query_id
stringlengths
32
32
query
stringlengths
7
4.32k
positive_passages
listlengths
1
1
negative_passages
listlengths
88
101
c030c2babe41c5ec51c56cc6672360d2
Where adds a new predicate for the UnsavedPostQuery builder.
[ { "docid": "111e956c23ff77cd435b76c7fbac9355", "score": "0.78482574", "text": "func (upq *UnsavedPostQuery) Where(ps ...predicate.UnsavedPost) *UnsavedPostQuery {\n\tupq.predicates = append(upq.predicates, ps...)\n\treturn upq\n}", "title": "" } ]
[ { "docid": "a491e6fda1efa3834eca25bee1f6eaf3", "score": "0.74576175", "text": "func (upu *UnsavedPostUpdate) Where(ps ...predicate.UnsavedPost) *UnsavedPostUpdate {\n\tupu.mutation.predicates = append(upu.mutation.predicates, ps...)\n\treturn upu\n}", "title": "" }, { "docid": "8a68290f38695ca9ff3a44bb3488a642", "score": "0.6361639", "text": "func (m *PostMutation) Where(ps ...predicate.Post) {\n\tm.predicates = append(m.predicates, ps...)\n}", "title": "" }, { "docid": "30a7670a19862d4c23c6f13727bb2b83", "score": "0.6036226", "text": "func (pu *PostUpdate) Where(ps ...predicate.Post) *PostUpdate {\n\tpu.mutation.Where(ps...)\n\treturn pu\n}", "title": "" }, { "docid": "30a7670a19862d4c23c6f13727bb2b83", "score": "0.6036226", "text": "func (pu *PostUpdate) Where(ps ...predicate.Post) *PostUpdate {\n\tpu.mutation.Where(ps...)\n\treturn pu\n}", "title": "" }, { "docid": "ebdc6ef067ae831d94a1379b3a7f1185", "score": "0.6004291", "text": "func (mnu *MedicalNoteUpdate) Where(ps ...predicate.MedicalNote) *MedicalNoteUpdate {\n\tmnu.predicates = append(mnu.predicates, ps...)\n\treturn mnu\n}", "title": "" }, { "docid": "8922927832c8087d0542c0ed440869ac", "score": "0.58924496", "text": "func (pu *PrenameUpdate) Where(ps ...predicate.Prename) *PrenameUpdate {\n\tpu.predicates = append(pu.predicates, ps...)\n\treturn pu\n}", "title": "" }, { "docid": "c773ea962a63989a47ca02e0f1905af6", "score": "0.5860995", "text": "func (pid *PostImageDelete) Where(ps ...predicate.PostImage) *PostImageDelete {\n\tpid.mutation.predicates = append(pid.mutation.predicates, ps...)\n\treturn pid\n}", "title": "" }, { "docid": "9e638174ba80b3ac870cf259ca4da34b", "score": "0.58576787", "text": "func (sd *SurgeryappointmentDelete) Where(ps ...predicate.Surgeryappointment) *SurgeryappointmentDelete {\n\tsd.mutation.predicates = append(sd.mutation.predicates, ps...)\n\treturn sd\n}", "title": "" }, { "docid": "aafd6db6ea97b13e0924bb38a746e9be", "score": "0.5785725", "text": "func (sq *ScopeQuery) addPredicate(pred func(s *sql.Selector)) {\n\tsq.predicates = append(sq.predicates, pred)\n}", "title": "" }, { "docid": "caa1798747af6ca3cad64a6a7bc5698e", "score": "0.5760569", "text": "func (rd *RecipeDelete) Where(ps ...predicate.Recipe) *RecipeDelete {\n\trd.predicates = append(rd.predicates, ps...)\n\treturn rd\n}", "title": "" }, { "docid": "ed3192bfa6947e92e12fcadc7186952f", "score": "0.57325804", "text": "func (m *ScopeMutation) addPredicate(pred func(s *sql.Selector)) {\n\tm.predicates = append(m.predicates, pred)\n}", "title": "" }, { "docid": "cf1542f1b73e8a45ac6fe1a92eb41a8d", "score": "0.57174146", "text": "func (mu *MedicalrecordstaffUpdate) Where(ps ...predicate.Medicalrecordstaff) *MedicalrecordstaffUpdate {\n\tmu.predicates = append(mu.predicates, ps...)\n\treturn mu\n}", "title": "" }, { "docid": "1bb776134bfbbfd13c70737c2fda721e", "score": "0.5709353", "text": "func (puo *PostUpdateOne) Where(ps ...predicate.Post) *PostUpdateOne {\n\tpuo.mutation.Where(ps...)\n\treturn puo\n}", "title": "" }, { "docid": "1bb776134bfbbfd13c70737c2fda721e", "score": "0.5709353", "text": "func (puo *PostUpdateOne) Where(ps ...predicate.Post) *PostUpdateOne {\n\tpuo.mutation.Where(ps...)\n\treturn puo\n}", "title": "" }, { "docid": "775fe168969d2f677d9af1169674cea0", "score": "0.5698252", "text": "func (mu *MedicalfileUpdate) Where(ps ...predicate.Medicalfile) *MedicalfileUpdate {\n\tmu.predicates = append(mu.predicates, ps...)\n\treturn mu\n}", "title": "" }, { "docid": "b5261405766535ed43ae1ce767341889", "score": "0.5677084", "text": "func (rfu *ReportFilterUpdate) Where(ps ...predicate.ReportFilter) *ReportFilterUpdate {\n\trfu.mutation.predicates = append(rfu.mutation.predicates, ps...)\n\treturn rfu\n}", "title": "" }, { "docid": "94e86e30984419f6a52c140ba8970c29", "score": "0.56719464", "text": "func (tu *TopicUpdate) Where(ps ...predicate.Topic) *TopicUpdate {\n\ttu.predicates = append(tu.predicates, ps...)\n\treturn tu\n}", "title": "" }, { "docid": "d81cc13be17bbc8dc12ff5e529a91f2e", "score": "0.56699514", "text": "func (fu *FlowUpdate) Where(ps ...predicate.Flow) *FlowUpdate {\n\tfu.predicates = append(fu.predicates, ps...)\n\treturn fu\n}", "title": "" }, { "docid": "3119b1493b563cecc8109925d3ce4df2", "score": "0.5659508", "text": "func (sqd *SurveyQuestionDelete) Where(ps ...predicate.SurveyQuestion) *SurveyQuestionDelete {\n\tsqd.predicates = append(sqd.predicates, ps...)\n\treturn sqd\n}", "title": "" }, { "docid": "90ba3dad1601022cfecef171b43f0d9e", "score": "0.56492287", "text": "func (squ *SurveyQuestionUpdate) Where(ps ...predicate.SurveyQuestion) *SurveyQuestionUpdate {\n\tsqu.predicates = append(squ.predicates, ps...)\n\treturn squ\n}", "title": "" }, { "docid": "95a06e43dcb637dae064f3c67a48ea96", "score": "0.5635331", "text": "func (au *AppUpdate) Where(ps ...predicate.App) *AppUpdate {\n\tau.predicates = append(au.predicates, ps...)\n\treturn au\n}", "title": "" }, { "docid": "533e03b4e04b93f30082622bba18c1f8", "score": "0.5598308", "text": "func (hu *HistorytakingUpdate) Where(ps ...predicate.Historytaking) *HistorytakingUpdate {\n\thu.predicates = append(hu.predicates, ps...)\n\treturn hu\n}", "title": "" }, { "docid": "8b6c4652f61d685b945cb60a5f904d69", "score": "0.5589953", "text": "func (aaq *APIAuditQuery) addPredicate(pred func(s *sql.Selector)) {\n\taaq.predicates = append(aaq.predicates, pred)\n}", "title": "" }, { "docid": "d71f39a23cfd5dda5c91bdf18f8badde", "score": "0.55461013", "text": "func (ftu *FieldTypeUpdate) Where(ps ...predicate.FieldType) *FieldTypeUpdate {\n\tftu.predicates = append(ftu.predicates, ps...)\n\treturn ftu\n}", "title": "" }, { "docid": "39f71255fda2eeeb8fb972fffbddc4c9", "score": "0.5543502", "text": "func (utd *UserTopicDelete) Where(ps ...predicate.UserTopic) *UserTopicDelete {\n\tutd.predicates = append(utd.predicates, ps...)\n\treturn utd\n}", "title": "" }, { "docid": "3b8d07e3361fca60f273f44b7107b387", "score": "0.5536594", "text": "func (su *SubjectUpdate) Where(ps ...predicate.Subject) *SubjectUpdate {\n\tsu.predicates = append(su.predicates, ps...)\n\treturn su\n}", "title": "" }, { "docid": "740a757088741540e434cd146776fd0f", "score": "0.5534948", "text": "func (m *APIAuditMutation) addPredicate(pred func(s *sql.Selector)) {\n\tm.predicates = append(m.predicates, pred)\n}", "title": "" }, { "docid": "216bb465e188584e702aa4ab06e639ce", "score": "0.5532839", "text": "func (gq *GrantQuery) addPredicate(pred func(s *sql.Selector)) {\n\tgq.predicates = append(gq.predicates, pred)\n}", "title": "" }, { "docid": "0d8c4f6e6268520d2c4e05589dafd862", "score": "0.55199546", "text": "func (pu *PharmacistUpdate) Where(ps ...predicate.Pharmacist) *PharmacistUpdate {\n\tpu.predicates = append(pu.predicates, ps...)\n\treturn pu\n}", "title": "" }, { "docid": "e27937b119c6c7b26e5f80f90fdab0d8", "score": "0.5514336", "text": "func (ub *UpdateBuilder) Where(\n\tpred interface{},\n\targs ...interface{},\n) *UpdateBuilder {\n\tub.sql = ub.sql.Where(pred, args...)\n\treturn ub\n}", "title": "" }, { "docid": "68ca9c0ed28e7f978f1843263664240b", "score": "0.5513512", "text": "func (c *AdminClient) QueryUnsavedPosts(a *Admin) *UnsavedPostQuery {\n\tquery := &UnsavedPostQuery{config: c.config}\n\tquery.path = func(ctx context.Context) (fromV *sql.Selector, _ error) {\n\t\tid := a.ID\n\t\tstep := sqlgraph.NewStep(\n\t\t\tsqlgraph.From(admin.Table, admin.FieldID, id),\n\t\t\tsqlgraph.To(unsavedpost.Table, unsavedpost.FieldID),\n\t\t\tsqlgraph.Edge(sqlgraph.O2M, false, admin.UnsavedPostsTable, admin.UnsavedPostsColumn),\n\t\t)\n\t\tfromV = sqlgraph.Neighbors(a.driver.Dialect(), step)\n\t\treturn fromV, nil\n\t}\n\treturn query\n}", "title": "" }, { "docid": "ec7eac14372bbd0d57b3ced6f8b4c035", "score": "0.5505918", "text": "func (fq *ForumQuery) Where(ps ...predicate.Forum) *ForumQuery {\n\tfq.predicates = append(fq.predicates, ps...)\n\treturn fq\n}", "title": "" }, { "docid": "89e3f4202aa87829b2c31bfa1f5c711a", "score": "0.5499232", "text": "func (tq *TweetQuery) Where(ps ...predicate.Tweet) *TweetQuery {\n\ttq.predicates = append(tq.predicates, ps...)\n\treturn tq\n}", "title": "" }, { "docid": "80e7ed96359efa64feccfeafe84dc5e3", "score": "0.5491524", "text": "func (dqu *DNSBLQueryUpdate) Where(ps ...predicate.DNSBLQuery) *DNSBLQueryUpdate {\n\tdqu.mutation.predicates = append(dqu.mutation.predicates, ps...)\n\treturn dqu\n}", "title": "" }, { "docid": "5d342db7309f7b105d96d7d9345a035b", "score": "0.5478695", "text": "func (wq *WordQuery) Where(ps ...predicate.Word) *WordQuery {\n\twq.predicates = append(wq.predicates, ps...)\n\treturn wq\n}", "title": "" }, { "docid": "134a39cf457cd43d963b015a7f2172db", "score": "0.54764515", "text": "func (m *GrantMutation) addPredicate(pred func(s *sql.Selector)) {\n\tm.predicates = append(m.predicates, pred)\n}", "title": "" }, { "docid": "a2caaaf387a00d8d3ab7186211fdbc17", "score": "0.5474657", "text": "func (au *AntenatalinformationUpdate) Where(ps ...predicate.Antenatalinformation) *AntenatalinformationUpdate {\n\tau.mutation.predicates = append(au.mutation.predicates, ps...)\n\treturn au\n}", "title": "" }, { "docid": "0bb553ae10907eec34d30e43ed6426f9", "score": "0.5456908", "text": "func (ftq *FactTypeQuery) addPredicate(pred func(s *sql.Selector)) {\n\tftq.predicates = append(ftq.predicates, pred)\n}", "title": "" }, { "docid": "60cb231d18636bd0effd3f8544462193", "score": "0.5454455", "text": "func (fq *FactQuery) addPredicate(pred func(s *sql.Selector)) {\n\tfq.predicates = append(fq.predicates, pred)\n}", "title": "" }, { "docid": "6dc119f146df84c50e17baaaa98b30a4", "score": "0.54530907", "text": "func (wq *WorkflowQuery) Where(ps ...predicate.Workflow) *WorkflowQuery {\n\twq.predicates = append(wq.predicates, ps...)\n\treturn wq\n}", "title": "" }, { "docid": "782e67b139ab522e19bc5aae07703422", "score": "0.5450868", "text": "func (eu *ExtradoctorUpdate) Where(ps ...predicate.Extradoctor) *ExtradoctorUpdate {\n\teu.predicates = append(eu.predicates, ps...)\n\treturn eu\n}", "title": "" }, { "docid": "7764614efa392f1a0f7806c62c56d154", "score": "0.54479796", "text": "func (rq *ReceiptQuery) Where(ps ...predicate.Receipt) *ReceiptQuery {\n\trq.predicates = append(rq.predicates, ps...)\n\treturn rq\n}", "title": "" }, { "docid": "770477ca044e98a1976a231f2d9a687b", "score": "0.5443067", "text": "func (du *DatumUpdate) Where(ps ...predicate.Datum) *DatumUpdate {\n\tdu.predicates = append(du.predicates, ps...)\n\treturn du\n}", "title": "" }, { "docid": "304e80cfc9035e0aee840d40f84f83de", "score": "0.5442907", "text": "func (du *DiagnosisUpdate) Where(ps ...predicate.Diagnosis) *DiagnosisUpdate {\n\tdu.mutation.predicates = append(du.mutation.predicates, ps...)\n\treturn du\n}", "title": "" }, { "docid": "7b6c749f1657443fbe2257ea3dc72d01", "score": "0.5440536", "text": "func (au *ArticleUpdate) Where(ps ...predicate.Article) *ArticleUpdate {\n\tau.mutation.predicates = append(au.mutation.predicates, ps...)\n\treturn au\n}", "title": "" }, { "docid": "32ecf2f802bc4fa12d76583dbcd48489", "score": "0.5426665", "text": "func (uu *UserUpdate) Where(ps ...predicate.User) *UserUpdate {\n\tuu.predicates = append(uu.predicates, ps...)\n\treturn uu\n}", "title": "" }, { "docid": "32ecf2f802bc4fa12d76583dbcd48489", "score": "0.5426665", "text": "func (uu *UserUpdate) Where(ps ...predicate.User) *UserUpdate {\n\tuu.predicates = append(uu.predicates, ps...)\n\treturn uu\n}", "title": "" }, { "docid": "32ecf2f802bc4fa12d76583dbcd48489", "score": "0.5426665", "text": "func (uu *UserUpdate) Where(ps ...predicate.User) *UserUpdate {\n\tuu.predicates = append(uu.predicates, ps...)\n\treturn uu\n}", "title": "" }, { "docid": "32ecf2f802bc4fa12d76583dbcd48489", "score": "0.5426665", "text": "func (uu *UserUpdate) Where(ps ...predicate.User) *UserUpdate {\n\tuu.predicates = append(uu.predicates, ps...)\n\treturn uu\n}", "title": "" }, { "docid": "32ecf2f802bc4fa12d76583dbcd48489", "score": "0.5426665", "text": "func (uu *UserUpdate) Where(ps ...predicate.User) *UserUpdate {\n\tuu.predicates = append(uu.predicates, ps...)\n\treturn uu\n}", "title": "" }, { "docid": "32ecf2f802bc4fa12d76583dbcd48489", "score": "0.5426665", "text": "func (uu *UserUpdate) Where(ps ...predicate.User) *UserUpdate {\n\tuu.predicates = append(uu.predicates, ps...)\n\treturn uu\n}", "title": "" }, { "docid": "32ecf2f802bc4fa12d76583dbcd48489", "score": "0.5426665", "text": "func (uu *UserUpdate) Where(ps ...predicate.User) *UserUpdate {\n\tuu.predicates = append(uu.predicates, ps...)\n\treturn uu\n}", "title": "" }, { "docid": "cbb02be19159b706eafc9214ceb57e90", "score": "0.5423777", "text": "func (stqu *SurveyTemplateQuestionUpdate) Where(ps ...predicate.SurveyTemplateQuestion) *SurveyTemplateQuestionUpdate {\n\tstqu.predicates = append(stqu.predicates, ps...)\n\treturn stqu\n}", "title": "" }, { "docid": "8c871741dfb2337818a7774fc16bbbca", "score": "0.54086256", "text": "func (upq *UnsavedPostQuery) Clone() *UnsavedPostQuery {\n\tif upq == nil {\n\t\treturn nil\n\t}\n\treturn &UnsavedPostQuery{\n\t\tconfig: upq.config,\n\t\tlimit: upq.limit,\n\t\toffset: upq.offset,\n\t\torder: append([]OrderFunc{}, upq.order...),\n\t\tpredicates: append([]predicate.UnsavedPost{}, upq.predicates...),\n\t\twithAuthor: upq.withAuthor.Clone(),\n\t\twithCategory: upq.withCategory.Clone(),\n\t\twithThumbnail: upq.withThumbnail.Clone(),\n\t\twithImages: upq.withImages.Clone(),\n\t\twithVideos: upq.withVideos.Clone(),\n\t\twithAttachments: upq.withAttachments.Clone(),\n\t\t// clone intermediate query.\n\t\tsql: upq.sql.Clone(),\n\t\tpath: upq.path,\n\t}\n}", "title": "" }, { "docid": "1836404d510cbd731316cfad5abbbb14", "score": "0.540622", "text": "func (pu *PatientrecordUpdate) Where(ps ...predicate.Patientrecord) *PatientrecordUpdate {\n\tpu.predicates = append(pu.predicates, ps...)\n\treturn pu\n}", "title": "" }, { "docid": "91b3dcf706bd789f224cfdf964a6187c", "score": "0.5403871", "text": "func (m *TodoItemMutation) Where(ps ...predicate.TodoItem) {\n\tm.predicates = append(m.predicates, ps...)\n}", "title": "" }, { "docid": "6c2c036ae3c6addbdfb67b846a1b82f9", "score": "0.54035634", "text": "func (m *FactMutation) addPredicate(pred func(s *sql.Selector)) {\n\tm.predicates = append(m.predicates, pred)\n}", "title": "" }, { "docid": "4fb5a0274474f3e27b84b5865ae42c72", "score": "0.53762984", "text": "func (eptu *EquipmentPortTypeUpdate) Where(ps ...predicate.EquipmentPortType) *EquipmentPortTypeUpdate {\n\teptu.predicates = append(eptu.predicates, ps...)\n\treturn eptu\n}", "title": "" }, { "docid": "7fb5e0ffc26f04cd0ce54e48372233b0", "score": "0.53719026", "text": "func (au *AnnouncementUpdate) Where(ps ...predicate.Announcement) *AnnouncementUpdate {\n\tau.predicates = append(au.predicates, ps...)\n\treturn au\n}", "title": "" }, { "docid": "c2283f69fe13b0a1b6ea92241a3458f3", "score": "0.53658766", "text": "func (pu *PrefixUpdate) Where(ps ...predicate.Prefix) *PrefixUpdate {\n\tpu.predicates = append(pu.predicates, ps...)\n\treturn pu\n}", "title": "" }, { "docid": "8e6eebb4d04791ed7c4e006eeaafd255", "score": "0.5361766", "text": "func (bu *BillUpdate) Where(ps ...predicate.Bill) *BillUpdate {\n\tbu.predicates = append(bu.predicates, ps...)\n\treturn bu\n}", "title": "" }, { "docid": "4e045f06d87b0f45d93a3f6aedbc5192", "score": "0.5356507", "text": "func (m *FactTypeMutation) addPredicate(pred func(s *sql.Selector)) {\n\tm.predicates = append(m.predicates, pred)\n}", "title": "" }, { "docid": "b008acda821a850523a86cbbf7897832", "score": "0.53517014", "text": "func (c *UnsavedPostThumbnailClient) QueryUnsavedPost(upt *UnsavedPostThumbnail) *UnsavedPostQuery {\n\tquery := &UnsavedPostQuery{config: c.config}\n\tquery.path = func(ctx context.Context) (fromV *sql.Selector, _ error) {\n\t\tid := upt.ID\n\t\tstep := sqlgraph.NewStep(\n\t\t\tsqlgraph.From(unsavedpostthumbnail.Table, unsavedpostthumbnail.FieldID, id),\n\t\t\tsqlgraph.To(unsavedpost.Table, unsavedpost.FieldID),\n\t\t\tsqlgraph.Edge(sqlgraph.O2O, true, unsavedpostthumbnail.UnsavedPostTable, unsavedpostthumbnail.UnsavedPostColumn),\n\t\t)\n\t\tfromV = sqlgraph.Neighbors(upt.driver.Dialect(), step)\n\t\treturn fromV, nil\n\t}\n\treturn query\n}", "title": "" }, { "docid": "787985296c4d9268c26339b2b0507080", "score": "0.53474236", "text": "func (bu *BookingUpdate) Where(ps ...predicate.Booking) *BookingUpdate {\n\tbu.predicates = append(bu.predicates, ps...)\n\treturn bu\n}", "title": "" }, { "docid": "787985296c4d9268c26339b2b0507080", "score": "0.53474236", "text": "func (bu *BookingUpdate) Where(ps ...predicate.Booking) *BookingUpdate {\n\tbu.predicates = append(bu.predicates, ps...)\n\treturn bu\n}", "title": "" }, { "docid": "1fb8398c61b691f42c99578c45def147", "score": "0.53394413", "text": "func (mu *MannerUpdate) Where(ps ...predicate.Manner) *MannerUpdate {\n\tmu.predicates = append(mu.predicates, ps...)\n\treturn mu\n}", "title": "" }, { "docid": "6dafb4505314b2974d58b57af1d86846", "score": "0.5337878", "text": "func (eq *EntryQuery) Where(ps ...predicate.Entry) *EntryQuery {\n\teq.predicates = append(eq.predicates, ps...)\n\treturn eq\n}", "title": "" }, { "docid": "35a1901ca1451fd2b54f1a9a38d9f757", "score": "0.5328683", "text": "func (luq *LastUpdatedQuery) Where(ps ...predicate.LastUpdated) *LastUpdatedQuery {\n\tluq.predicates = append(luq.predicates, ps...)\n\treturn luq\n}", "title": "" }, { "docid": "e88fd131d622ecaee06e0747e8823872", "score": "0.5327712", "text": "func (c *UnsavedPostAttachmentClient) QueryUnsavedPost(upa *UnsavedPostAttachment) *UnsavedPostQuery {\n\tquery := &UnsavedPostQuery{config: c.config}\n\tquery.path = func(ctx context.Context) (fromV *sql.Selector, _ error) {\n\t\tid := upa.ID\n\t\tstep := sqlgraph.NewStep(\n\t\t\tsqlgraph.From(unsavedpostattachment.Table, unsavedpostattachment.FieldID, id),\n\t\t\tsqlgraph.To(unsavedpost.Table, unsavedpost.FieldID),\n\t\t\tsqlgraph.Edge(sqlgraph.M2O, true, unsavedpostattachment.UnsavedPostTable, unsavedpostattachment.UnsavedPostColumn),\n\t\t)\n\t\tfromV = sqlgraph.Neighbors(upa.driver.Dialect(), step)\n\t\treturn fromV, nil\n\t}\n\treturn query\n}", "title": "" }, { "docid": "9f8b84cae1b489d635a2fdf0b9e790f0", "score": "0.53258985", "text": "func (b DeleteBuilder) Where(pred interface{}, args ...interface{}) WhereConditions {\n\treturn builder.Append(b, \"WhereParts\", newWherePart(pred, args...)).(DeleteBuilder)\n}", "title": "" }, { "docid": "6d142226c2949ad76f76af3bdd894f9a", "score": "0.53143483", "text": "func (srd *ScholarshipRequestDelete) Where(ps ...predicate.ScholarshipRequest) *ScholarshipRequestDelete {\n\tsrd.predicates = append(srd.predicates, ps...)\n\treturn srd\n}", "title": "" }, { "docid": "7041c1fcce09fffe09e568684c406f2f", "score": "0.5311462", "text": "func (usu *UserStatusUpdate) Where(ps ...predicate.UserStatus) *UserStatusUpdate {\n\tusu.predicates = append(usu.predicates, ps...)\n\treturn usu\n}", "title": "" }, { "docid": "33c2af3b5a5ec2d2570f9ecbc591d1b4", "score": "0.53087765", "text": "func (mu *MoneytransferUpdate) Where(ps ...predicate.Moneytransfer) *MoneytransferUpdate {\n\tmu.predicates = append(mu.predicates, ps...)\n\treturn mu\n}", "title": "" }, { "docid": "31a12a514e5d07900e108477116d9e26", "score": "0.5307604", "text": "func (rq *RentQuery) Where(ps ...predicate.Rent) *RentQuery {\n\trq.predicates = append(rq.predicates, ps...)\n\treturn rq\n}", "title": "" }, { "docid": "923eba632ca7e222bd9dafb239aaa24e", "score": "0.53056234", "text": "func (nu *NodeUpdate) Where(ps ...predicate.Node) *NodeUpdate {\n\tnu.predicates = append(nu.predicates, ps...)\n\treturn nu\n}", "title": "" }, { "docid": "6e22989a3ca5398565903351e8c80f69", "score": "0.5304948", "text": "func (tu *TypetreatmentUpdate) Where(ps ...predicate.Typetreatment) *TypetreatmentUpdate {\n\ttu.predicates = append(tu.predicates, ps...)\n\treturn tu\n}", "title": "" }, { "docid": "8cf66492862873ab70600829c9af3e40", "score": "0.53049463", "text": "func (atu *ActivityTypeUpdate) Where(ps ...predicate.ActivityType) *ActivityTypeUpdate {\n\tatu.predicates = append(atu.predicates, ps...)\n\treturn atu\n}", "title": "" }, { "docid": "158a52f1e76dcea3ba17d3478399d89a", "score": "0.53048474", "text": "func (jd *JobpositionDelete) Where(ps ...predicate.Jobposition) *JobpositionDelete {\n\tjd.predicates = append(jd.predicates, ps...)\n\treturn jd\n}", "title": "" }, { "docid": "9347ecc61e7335d1afc7f21fba4f5ae2", "score": "0.5304297", "text": "func (c *CategoryClient) QueryUnsavedPosts(ca *Category) *UnsavedPostQuery {\n\tquery := &UnsavedPostQuery{config: c.config}\n\tquery.path = func(ctx context.Context) (fromV *sql.Selector, _ error) {\n\t\tid := ca.ID\n\t\tstep := sqlgraph.NewStep(\n\t\t\tsqlgraph.From(category.Table, category.FieldID, id),\n\t\t\tsqlgraph.To(unsavedpost.Table, unsavedpost.FieldID),\n\t\t\tsqlgraph.Edge(sqlgraph.O2M, false, category.UnsavedPostsTable, category.UnsavedPostsColumn),\n\t\t)\n\t\tfromV = sqlgraph.Neighbors(ca.driver.Dialect(), step)\n\t\treturn fromV, nil\n\t}\n\treturn query\n}", "title": "" }, { "docid": "ae310d22e004393f6ee3f72037c966ca", "score": "0.5302769", "text": "func (pu *PetUpdate) Where(ps ...predicate.Pet) *PetUpdate {\n\tpu.predicates = append(pu.predicates, ps...)\n\treturn pu\n}", "title": "" }, { "docid": "ae310d22e004393f6ee3f72037c966ca", "score": "0.5302769", "text": "func (pu *PetUpdate) Where(ps ...predicate.Pet) *PetUpdate {\n\tpu.predicates = append(pu.predicates, ps...)\n\treturn pu\n}", "title": "" }, { "docid": "53cad74e4fe0a39390a3d8bac0d8aeb0", "score": "0.5301346", "text": "func (m *StreetMutation) Where(ps ...predicate.Street) {\n\tm.predicates = append(m.predicates, ps...)\n}", "title": "" }, { "docid": "fcf6c27113c191da89c19bf22f5653c2", "score": "0.5301298", "text": "func (bu *BankdetailUpdate) Where(ps ...predicate.Bankdetail) *BankdetailUpdate {\n\tbu.mutation.predicates = append(bu.mutation.predicates, ps...)\n\treturn bu\n}", "title": "" }, { "docid": "8c4d582fab56eda891f8bc406df087ea", "score": "0.5286709", "text": "func (du *DayUpdate) Where(ps ...predicate.Day) *DayUpdate {\n\tdu.predicates = append(du.predicates, ps...)\n\treturn du\n}", "title": "" }, { "docid": "e1637bf041af52fe7fc1b90d0b6377f0", "score": "0.52834177", "text": "func (du *DoctorUpdate) Where(ps ...predicate.Doctor) *DoctorUpdate {\n\tdu.predicates = append(du.predicates, ps...)\n\treturn du\n}", "title": "" }, { "docid": "e5f2568c0133b433bfc28d2162942666", "score": "0.5275433", "text": "func (wq *WidgetQuery) Where(ps ...predicate.Widget) *WidgetQuery {\n\twq.predicates = append(wq.predicates, ps...)\n\treturn wq\n}", "title": "" }, { "docid": "50a0a0ae7b616e942d69bf45abb3ded1", "score": "0.5273985", "text": "func (td *TodoDelete) Where(ps ...predicate.Todo) *TodoDelete {\n\ttd.mutation.Where(ps...)\n\treturn td\n}", "title": "" }, { "docid": "ba3e8ec5f41c2ef53dbf472c812e2189", "score": "0.52701694", "text": "func (du *DealUpdate) Where(ps ...predicate.Deal) *DealUpdate {\n\tdu.mutation.predicates = append(du.mutation.predicates, ps...)\n\treturn du\n}", "title": "" }, { "docid": "7cd9d87e829b090d15cc8099b9831719", "score": "0.5268415", "text": "func (qiu *QueueItemUpdate) Where(ps ...predicate.QueueItem) *QueueItemUpdate {\n\tqiu.mutation.predicates = append(qiu.mutation.predicates, ps...)\n\treturn qiu\n}", "title": "" }, { "docid": "d46220171832ab3a6b83e6fa7a7bdec0", "score": "0.5267159", "text": "func (ths *deleteQueryBuilder) AddWhere(where ...string) *deleteQueryBuilder {\n\tths.whereFragments = append(ths.whereFragments, where...)\n\n\treturn ths\n}", "title": "" }, { "docid": "50505e47882f003e14ac51cc6aa7a716", "score": "0.5261916", "text": "func (erd *EpidemiologicResultsDelete) Where(ps ...predicate.EpidemiologicResults) *EpidemiologicResultsDelete {\n\terd.predicates = append(erd.predicates, ps...)\n\treturn erd\n}", "title": "" }, { "docid": "035ec56a5597a0d4964a0b2d52abb773", "score": "0.52612734", "text": "func (uu *UserUpdate) Where(ps ...predicate.User) *UserUpdate {\n\tuu.mutation.predicates = append(uu.mutation.predicates, ps...)\n\treturn uu\n}", "title": "" }, { "docid": "035ec56a5597a0d4964a0b2d52abb773", "score": "0.52612734", "text": "func (uu *UserUpdate) Where(ps ...predicate.User) *UserUpdate {\n\tuu.mutation.predicates = append(uu.mutation.predicates, ps...)\n\treturn uu\n}", "title": "" }, { "docid": "035ec56a5597a0d4964a0b2d52abb773", "score": "0.52612734", "text": "func (uu *UserUpdate) Where(ps ...predicate.User) *UserUpdate {\n\tuu.mutation.predicates = append(uu.mutation.predicates, ps...)\n\treturn uu\n}", "title": "" }, { "docid": "a9bffb030617b90064f0652ce5c39094", "score": "0.526042", "text": "func (du *DoctorinfoUpdate) Where(ps ...predicate.Doctorinfo) *DoctorinfoUpdate {\n\tdu.predicates = append(du.predicates, ps...)\n\treturn du\n}", "title": "" }, { "docid": "1bc0ce6db619ab7cbb8f944b11f4ee42", "score": "0.5250418", "text": "func (fdq *FurnitureDetailQuery) Where(ps ...predicate.FurnitureDetail) *FurnitureDetailQuery {\n\tfdq.predicates = append(fdq.predicates, ps...)\n\treturn fdq\n}", "title": "" }, { "docid": "7144bd025521a72313fa44173e1643f8", "score": "0.52365357", "text": "func (pu *ProfileUpdate) Where(ps ...predicate.Profile) *ProfileUpdate {\n\tpu.predicates = append(pu.predicates, ps...)\n\treturn pu\n}", "title": "" }, { "docid": "00656a31abf0e9ecfe134ef15565ed62", "score": "0.52179426", "text": "func (eptu *EquipmentPortTypeUpdate) Where(ps ...predicate.EquipmentPortType) *EquipmentPortTypeUpdate {\n\teptu.mutation.predicates = append(eptu.mutation.predicates, ps...)\n\treturn eptu\n}", "title": "" }, { "docid": "d916bc8a03feff6ab9b302428431c84e", "score": "0.52156466", "text": "func (lu *LocationUpdate) Where(ps ...predicate.Location) *LocationUpdate {\n\tlu.predicates = append(lu.predicates, ps...)\n\treturn lu\n}", "title": "" }, { "docid": "e3e29b8dcdc60f69c3135c5464b637e1", "score": "0.5214086", "text": "func (rq *RemedyQuery) Where(ps ...predicate.Remedy) *RemedyQuery {\n\trq.predicates = append(rq.predicates, ps...)\n\treturn rq\n}", "title": "" } ]
68b97835f7814d68a599857626f9b34c
make a box and return a pointer to it go will just put it on the heap for you
[ { "docid": "33ba6fc2880f04c7fbcb743d7b4dd6ea", "score": "0.7723369", "text": "func make_box(w, h int) *box {\n\ttemp := box{w, h}\n\treturn &temp\n}", "title": "" } ]
[ { "docid": "a9a9bb816a5c362bee9d212b96a72655", "score": "0.6527517", "text": "func NewBox(hx, hy, hz float64) Shape { return &box{math.Abs(hx), math.Abs(hy), math.Abs(hz)} }", "title": "" }, { "docid": "10155052a2964102fc3398788a0132b3", "score": "0.6407516", "text": "func (c *cbox) box() *cbox { return c }", "title": "" }, { "docid": "b82c8756dd274bab58552ee889430b36", "score": "0.6304245", "text": "func NewBox(leftBottomX, leftBottomY, rightTopX, rightTopY int) *Box {\n\treturn &Box{leftBottomX, leftBottomY, rightTopX, rightTopY}\n}", "title": "" }, { "docid": "92e57f2d0e0b0249c90e7739436ccc8a", "score": "0.62641186", "text": "func NewBox(w, h int, c color.Color) *Box {\n\timg, _ := ebiten.NewImage(w, h, ebiten.FilterDefault)\n\tb := &Box{\n\t\tid: gm.nextID(),\n\t\tRect: image.Rect(0, 0, w, h),\n\t\tColor: c,\n\t\tisDirty: true,\n\t\tImage: img,\n\t\tParent: nil,\n\t\tChildren: []Element{},\n\t\tmouseCallbacks: mouseCallbacks{},\n\t\tkeyCallbacks: keyCallbacks{},\n\t\tuiCallbacks: uiCallbacks{},\n\t\tSelf: nil,\n\t\tvisible: true,\n\t}\n\tb.Self = b\n\treturn b\n}", "title": "" }, { "docid": "177fdc1b2b5fb12e9d2e836b3c661d14", "score": "0.619062", "text": "func NewBox(x, y, width, height int) *Box {\n\tb := new(Box)\n\n\tb.x = x\n\tb.y = y\n\tb.width = width\n\tb.height = height\n\n\treturn b\n}", "title": "" }, { "docid": "3c3927d673571e3a38ecd5970c2adf8a", "score": "0.61479914", "text": "func NewBox(child Drawable) *Box {\n\tb := &Box{\n\t\tvisible: true,\n\t\tborder: NewRectangle(child.PreferredSize()),\n\t\tchild: child,\n\t}\n\tb.SetSize(child.PreferredSize())\n\treturn b\n}", "title": "" }, { "docid": "0f81243e87bf9e96f4224ddb65a316a2", "score": "0.60699165", "text": "func BoxNew(orientation Orientation, spacing int) (*Box, error) {\n\tc := C.gtk_box_new(C.GtkOrientation(orientation), C.gint(spacing))\n\tif c == nil {\n\t\treturn nil, nilPtrErr\n\t}\n\tobj := glib.Take(unsafe.Pointer(c))\n\treturn wrapBox(obj), nil\n}", "title": "" }, { "docid": "975c8218915077efb896f01dcc94a9a1", "score": "0.6046042", "text": "func NewBox(bg dull.Color) *Box {\n\treturn &Box{\n\t\tbg: bg,\n\t}\n}", "title": "" }, { "docid": "10782616f6f1ee0b8ddf37ad8a67ec2a", "score": "0.6032134", "text": "func NewBox(minX, minY, maxX, maxY float64) Box {\r\n\tvar b Box = Box{\r\n\t\tMinX: minX,\r\n\t\tMinY: minY,\r\n\t\tMaxX: maxX,\r\n\t\tMaxY: maxY,\r\n\t}\r\n\treturn b\r\n}", "title": "" }, { "docid": "d4e7ddd924169dd2e90bf891dafcb44e", "score": "0.6009182", "text": "func newOutbox() *outbox {\n\to := &outbox{}\n\treturn o\n}", "title": "" }, { "docid": "c43ea960bd65eacb0e35332492629b4c", "score": "0.59550345", "text": "func BoxNew(orientation Orientation, spacing int) (*Box, error) {\n\tc := C.gtk_box_new(C.GtkOrientation(orientation), C.gint(spacing))\n\tif c == nil {\n\t\treturn nil, nilPtrErr\n\t}\n\tobj := wrapObject(unsafe.Pointer(c))\n\treturn wrapBox(obj), nil\n}", "title": "" }, { "docid": "757e7eb6079135cc3b41f962f28ea0ed", "score": "0.59025085", "text": "func gGoInterfaceCopyGo(boxed unsafe.Pointer) unsafe.Pointer {\n Holder.Grab(*(*interface{})(boxed))\n newboxed := C.malloc(C.size_t(unsafe.Sizeof([2]unsafe.Pointer{})))\n C.memcpy(newboxed, boxed, C.size_t(unsafe.Sizeof([2]unsafe.Pointer{})))\n return newboxed\n}", "title": "" }, { "docid": "12e059e1127ff2cc97d47975faf7128f", "score": "0.58982", "text": "func Box(id string, x float64, y float64, w float64, h float64, cv *canvas.Canvas) model.UIElement {\n\telementCursor := glfw.CreateStandardCursor(glfw.ArrowCursor)\n\tboxElement := model.UIElement{ID: id, WType: \"box\", X: x, Y: y, W: w, H: h, Cursor: elementCursor, Text: \"\"}\n\t//boxElement := model.UIElement{ID: id, WType: \"box\", X: x, Y: y, W: w, H: h, Canvas: cv, Cursor: elementCursor, Text: \"\"}\n\tmodel.DrawBox(boxElement)\n\treturn boxElement\n}", "title": "" }, { "docid": "48c42415a9608513751aa2173637163a", "score": "0.5832621", "text": "func NewBox(cid event.CID, x, y, w, h float64, r render.Renderable, layers ...int) *Box {\n\tb := Box{}\n\tcid = cid.Parse(&b)\n\tb.Solid = *entities.NewSolid(x, y, w, h, r, mouse.DefaultTree, cid)\n\tif b.R != nil && len(layers) > 0 {\n\t\trender.Draw(b.R, layers...)\n\t}\n\tb.metadata = make(map[string]string)\n\treturn &b\n}", "title": "" }, { "docid": "540f2adf06354197aec1e22e45bb1f08", "score": "0.5755613", "text": "func (v *Box) native() *C.GtkBox {\n\tif v == nil {\n\t\treturn nil\n\t}\n\tptr := unsafe.Pointer(v.Object.Native())\n\treturn C.toGtkBox(ptr)\n}", "title": "" }, { "docid": "a4922fa4c830bcb7dbe90ec3daea9b6a", "score": "0.5746722", "text": "func (self Box) Grow(x, y int) Box {\n\tself.X -= x\n\tself.Y -= y\n\tself.W += x * 2\n\tself.H += y * 2\n\treturn self\n}", "title": "" }, { "docid": "7e10b7437c3b10e3e98d5757b8f12073", "score": "0.5720713", "text": "func NewGrowingBox() *Box {\n\tret := newBox()\n\tret.grow = true\n\treturn ret\n}", "title": "" }, { "docid": "be7f1ef1d0be9503707297dac84cdf1c", "score": "0.5719742", "text": "func NewBox(width, height, length float64) *Box {\n\thalfWidth, halfHeight, halfLength := width*0.5, height*0.5, length*0.5\n\tvertices := []Vertex{\n\t\t// up plane\n\t\tVertex{Position: math.Vec3{-halfWidth, halfHeight, -halfLength}},\n\t\tVertex{Position: math.Vec3{-halfWidth, halfHeight, halfLength}},\n\t\tVertex{Position: math.Vec3{halfWidth, halfHeight, halfLength}},\n\t\tVertex{Position: math.Vec3{halfWidth, halfHeight, -halfLength}},\n\t\t// down plane\n\t\tVertex{Position: math.Vec3{-halfWidth, -halfHeight, -halfLength}},\n\t\tVertex{Position: math.Vec3{-halfWidth, -halfHeight, halfLength}},\n\t\tVertex{Position: math.Vec3{halfWidth, -halfHeight, halfLength}},\n\t\tVertex{Position: math.Vec3{halfWidth, -halfHeight, -halfLength}},\n\t}\n\tfaces := []Face{\n\t\t// top\n\t\tFace{Vertices: [3]int64{0, 1, 2}},\n\t\tFace{Vertices: [3]int64{0, 2, 3}},\n\t\t// right\n\t\tFace{Vertices: [3]int64{2, 7, 3}},\n\t\tFace{Vertices: [3]int64{2, 6, 7}},\n\t\t// bottom\n\t\tFace{Vertices: [3]int64{7, 5, 4}},\n\t\tFace{Vertices: [3]int64{7, 6, 5}},\n\t\t// left\n\t\tFace{Vertices: [3]int64{4, 5, 0}},\n\t\tFace{Vertices: [3]int64{5, 1, 0}},\n\t\t// back\n\t\tFace{Vertices: [3]int64{5, 2, 1}},\n\t\tFace{Vertices: [3]int64{5, 6, 2}},\n\t\t// front\n\t\tFace{Vertices: [3]int64{0, 3, 7}},\n\t\tFace{Vertices: [3]int64{0, 7, 4}},\n\t}\n\tcalculateFacesAndVerticesNormals(vertices, faces)\n\treturn &Box{\n\t\tSimpleGeometry: &SimpleGeometry{\n\t\t\tvertices: vertices,\n\t\t\tfaces: faces,\n\t\t},\n\t}\n}", "title": "" }, { "docid": "a98d39d29f01ae6a8a9d4565c33b9d4f", "score": "0.5671907", "text": "func NewBoxed(t Boxable) Boxed {\n\treturn Boxed{t}\n}", "title": "" }, { "docid": "8b7f9adc9ad74c6998adadb705b19110", "score": "0.5641672", "text": "func (p *BasePipeline) Box() Box {\n\treturn p.box\n}", "title": "" }, { "docid": "dcf5fcf3b7e01e233a02769c372f87e4", "score": "0.5608123", "text": "func AddNewBox(parent ki.Ki, name string, pos, size mat32.Vec3) *Box {\n\tbx := parent.AddNewChild(KiT_Box, name).(*Box)\n\tbx.Initial.Pos = pos\n\tbx.Size = size\n\treturn bx\n}", "title": "" }, { "docid": "b8e0ad55fb6e08353ad8289f92cdfb17", "score": "0.5596637", "text": "func NewBox(inner Component) *Box {\n\tret := newBox()\n\tret.inner = inner\n\treturn ret\n}", "title": "" }, { "docid": "e2ad3b86ae2f0cedea3b0161dc4b37a5", "score": "0.5593894", "text": "func (bc BarChart) box() Box {\n\tdpr := bc.Background.Padding.GetRight(10)\n\tdpb := bc.Background.Padding.GetBottom(50)\n\n\treturn Box{\n\t\tTop: 20,\n\t\tLeft: 20,\n\t\tRight: bc.GetWidth() - dpr,\n\t\tBottom: bc.GetHeight() - dpb,\n\t}\n}", "title": "" }, { "docid": "124111ed9d077c714fcb21873a416245", "score": "0.55753034", "text": "func (v *Box) native() *C.GtkBox {\n\tif v == nil || v.GObject == nil {\n\t\treturn nil\n\t}\n\tp := unsafe.Pointer(v.GObject)\n\treturn C.toGtkBox(p)\n}", "title": "" }, { "docid": "c88ca9229550b73b9062fabe0b2d6256", "score": "0.55731434", "text": "func (moovBoxFactory) New(box bmfcommon.Box) (cb bmfcommon.CommonBox, childBoxSeriesOffset int, err error) {\n\tdefer func() {\n\t\tif errRaw := recover(); errRaw != nil {\n\t\t\terr = log.Wrap(errRaw.(error))\n\t\t}\n\t}()\n\n\tmoovBox := &MoovBox{\n\t\tBox: box,\n\t}\n\n\terr = moovBox.parse()\n\tlog.PanicIf(err)\n\n\treturn moovBox, 0, nil\n}", "title": "" }, { "docid": "4e57ccbb580b3dbca25159553f1c8707", "score": "0.5550961", "text": "func Box(topleft a.Pair, bottomright a.Pair) *GPPolygon {\n\tpg := &GPPolygon{}\n\tpg.Knot(topleft)\n\tpg.Knot(a.MakePair(bottomright.XPart(), topleft.YPart()))\n\tpg.Knot(bottomright)\n\tpg.Knot(a.MakePair(topleft.XPart(), bottomright.YPart()))\n\treturn pg.Cycle()\n}", "title": "" }, { "docid": "542360f843e11e91cd6d40b5bece529f", "score": "0.5527567", "text": "func boxgen() []obj {\n\tvar prevh float64 = 0.5\n\t// golden mean, sort of\n\tvar prevw float64 = 0.75\n\tvar i int32\n\tvar at int32\n\tvar battr int32\n\tvar with int32\n\tvar ddval float64\n\tvar fillval float64\n\tvar xwith float64\n\tvar ywith float64\n\tvar h float64\n\tvar w float64\n\tvar x0 float64\n\tvar y0 float64\n\tvar x1 float64\n\tvar y1 float64\n\tvar p []obj\n\tvar ppos []obj\n\tvar ap []Attr\n\th = getfval([]byte(\"boxht\\x00\"))\n\tw = getfval([]byte(\"boxwid\\x00\"))\n\twith = 0\n\tbattr = with\n\tat = battr\n\tywith = 0\n\txwith = ywith\n\tfillval = xwith\n\tddval = fillval\n\tfor i = 0; i < nattr; i++ {\n\t\tap = attr[i:]\n\t\tswitch ap[0].a_type {\n\t\tcase 57388:\n\t\t\th = (*ap[0].a_val.f())\n\t\tcase 57389:\n\t\t\tw = (*ap[0].a_val.f())\n\t\tcase 57398:\n\t\t\th = prevh\n\t\t\tw = prevw\n\t\tcase 57383:\n\t\t\t// corner\n\t\t\twith = (*ap[0].a_val.i())\n\t\tcase 57381:\n\t\t\tppos = (*ap[0].a_val.o())\n\t\t\tcurx = float64(ppos[0].o_x)\n\t\t\tcury = float64(ppos[0].o_y)\n\t\t\tat ++\n\t\tcase 4:\n\t\t\tbattr |= 4\n\t\tcase 57432:\n\t\t\tbattr |= 128\n\t\tcase 57428:\n\t\t\tfallthrough\n\t\tcase 57429:\n\t\t\tbattr |= func() int32 {\n\t\t\t\tif ap[0].a_type == 57428 {\n\t\t\t\t\treturn 16\n\t\t\t\t}\n\t\t\t\treturn 32\n\t\t\t}()\n\t\t\tif ap[0].a_sub == 0 {\n\t\t\t\tddval = getfval([]byte(\"dashwid\\x00\"))\n\t\t\t} else {\n\t\t\t\tddval = (*ap[0].a_val.f())\n\t\t\t}\n\t\tcase 57431:\n\t\t\tbattr |= 64\n\t\t\tif ap[0].a_sub == 0 {\n\t\t\t\tfillval = getfval([]byte(\"fillval\\x00\"))\n\t\t\t} else {\n\t\t\t\tfillval = (*ap[0].a_val.f())\n\t\t\t}\n\t\tcase 57374:\n\t\t\tsavetext(ap[0].a_sub, (*ap[0].a_val.p()))\n\t\t\tbreak\n\t\t}\n\t}\n\tif with != 0 {\n\t\tswitch with {\n\t\tcase 57403:\n\t\t\tywith = -h/2\n\t\tcase 57404:\n\t\t\tywith = h/2\n\t\tcase 57401:\n\t\t\txwith = -w/2\n\t\tcase 57402:\n\t\t\txwith = w/2\n\t\tcase 57405:\n\t\t\txwith = -w/2\n\t\t\tywith = -h/2\n\t\tcase 57407:\n\t\t\txwith = -w/2\n\t\t\tywith = h/2\n\t\tcase 57406:\n\t\t\txwith = w/2\n\t\t\tywith = -h/2\n\t\tcase 57408:\n\t\t\txwith = w/2\n\t\t\tywith = h/2\n\t\t\tbreak\n\t\t}\n\t\tcurx += xwith\n\t\tcury += ywith\n\t}\n\tif noarch.Not(at) {\n\t\tif hvmode == 0 {\n\t\t\tcurx += w/2\n\t\t} else if hvmode == 2 {\n\t\t\tcurx -= w/2\n\t\t} else if hvmode == 1 {\n\t\t\tcury += h/2\n\t\t} else {\n\t\t\tcury -= h/2\n\t\t}\n\t}\n\tx0 = curx-w/2\n\ty0 = cury-h/2\n\tx1 = curx+w/2\n\ty1 = cury+h/2\n\textreme(x0, y0)\n\textreme(x1, y1)\n\tp = makenode(1, 2)\n\tp[0].o_val[:][0] = ofloat((float32(w)))\n\tp[0].o_val[:][1] = ofloat((float32(h)))\n\tp[0].o_attr = battr\n\tp[0].o_ddval = float32(ddval)\n\tp[0].o_fillval = float32(fillval)\n\tif dbg != 0 {\n\t\tnoarch.Printf([]byte(\"B %g %g %g %g at %g %g, h=%g, w=%g\\n\\x00\"), x0, y0, x1, y1, curx, cury, h, w)\n\t}\n\tif hvmode == 0 {\n\t\tcurx = x1\n\t} else if hvmode == 2 {\n\t\tcurx = x0\n\t} else if hvmode == 1 {\n\t\tcury = y1\n\t} else {\n\t\tcury = y0\n\t}\n\tprevh = h\n\tprevw = w\n\treturn p\n}", "title": "" }, { "docid": "ad1a310e1749f57e1366050d0e1e9df6", "score": "0.5516082", "text": "func allocBoundingBoxMemory(n int) unsafe.Pointer {\n\tmem, err := C.calloc(C.size_t(n), (C.size_t)(sizeOfBoundingBoxValue))\n\tif err != nil {\n\t\tpanic(\"memory alloc error: \" + err.Error())\n\t}\n\treturn mem\n}", "title": "" }, { "docid": "1e7164d28b93f2eecb45dff22d8433f0", "score": "0.54961336", "text": "func (mvhdBoxFactory) New(box bmfcommon.Box) (cb bmfcommon.CommonBox, childBoxSeriesOffset int, err error) {\n\tdefer func() {\n\t\tif errRaw := recover(); errRaw != nil {\n\t\t\terr = log.Wrap(errRaw.(error))\n\t\t}\n\t}()\n\n\tmvhdBox := &MvhdBox{\n\t\tBox: box,\n\t}\n\n\terr = mvhdBox.parse()\n\tlog.PanicIf(err)\n\n\treturn mvhdBox, -1, nil\n}", "title": "" }, { "docid": "225fc6d36222115bb5216ee23066cb7e", "score": "0.54673344", "text": "func NewBoxA2() *Box {\n\treturn NewBox(0, 0, 1191, 1684)\n}", "title": "" }, { "docid": "c4b9bb558f50ff469329c0bf27460784", "score": "0.54349744", "text": "func (pitmBoxFactory) New(box bmfcommon.Box) (cb bmfcommon.CommonBox, childBoxSeriesOffset int, err error) {\n\tdefer func() {\n\t\tif errRaw := recover(); errRaw != nil {\n\t\t\terr = log.Wrap(errRaw.(error))\n\t\t}\n\t}()\n\n\tdata, err := box.Data()\n\tlog.PanicIf(err)\n\n\tversion := data[0]\n\n\tvar itemId uint32\n\n\tif version == 0 {\n\t\titemId16 := bmfcommon.DefaultEndianness.Uint16(data[4:6])\n\t\titemId = uint32(itemId16)\n\t} else if version == 1 {\n\t\titemId = bmfcommon.DefaultEndianness.Uint32(data[4:8])\n\t} else {\n\t\tlog.Panicf(\"pitm: version (%d) not supported\", version)\n\t}\n\n\tpitm := &PitmBox{\n\t\tBox: box,\n\t\titemId: itemId,\n\t}\n\n\treturn pitm, -1, nil\n}", "title": "" }, { "docid": "8feaec54083e2d7976662dca35ef2ff9", "score": "0.5380456", "text": "func NewHeap() Heap {\n var new_heap Heap\n new_heap.body = make([]int, 0)\n new_heap.size = 0\n\n return new_heap\n}", "title": "" }, { "docid": "fd25be4bf60ee2b337b0e2553b0337aa", "score": "0.53622466", "text": "func (gr *guillotineRepacker) addBox(b *box) bool {\n\t// determine which free rectangle to place b into\n\t// if no such rectangle, restart with new pallet\n\tidx := gr.getFreeRectangle(b)\n\tif idx == -1 {\n\t\treturn false\n\t}\n\n\trect := &gr.free[idx]\n\n\t// place box at bottom left of free rect\n\tb.x = rect.x + rect.l - b.l\n\tb.y = rect.y\n\tgr.boxes = append(gr.boxes, *b)\n\n\t// use guillotine split to divide free rect\n\tgr.splitFreeRect(idx, b)\n\n\t// the rectangle merge improvement helps to defragment\n\t// free space by merging free rectangles\n\tgr.merge()\n\treturn true\n}", "title": "" }, { "docid": "be45d22b98418c42f0cfa9886b76d845", "score": "0.5332345", "text": "func (mn *manager) Box(t *testing.T, conf *Config) Container {\n\n\tname := mn.boxName(t.Name(), conf.Image, conf.Cmd)\n\n\t// cname is a simple canonical name that includes the\n\t// container image name and params.\n\tcname := conf.Image\n\tif len(conf.Cmd) != 0 {\n\t\tcname = cname + \": \" + strings.Join(conf.Cmd, \" \")\n\t}\n\n\tlogf(t, \"creating (%s) as %s\", cname, name)\n\n\tc, err := mn.client.ContainerCreate(\n\t\tcontext.Background(),\n\t\t&dockercontainer.Config{\n\t\t\tImage: conf.Image,\n\t\t\tCmd: strslice.StrSlice(conf.Cmd),\n\t\t\tEnv: conf.Env,\n\t\t\tHostname: conf.Hostname,\n\t\t\tDomainname: conf.Domainname,\n\t\t\tUser: conf.User,\n\t\t},\n\t\tnil,\n\t\tnil,\n\t\tname,\n\t)\n\tif err != nil {\n\t\tfatalf(t, \"Failed to create container: %s\", err)\n\t}\n\n\terr = mn.client.ContainerStart(context.Background(), c.ID, types.ContainerStartOptions{})\n\tif err != nil {\n\t\tfatalf(t, \"Failed to start container: %v\", err)\n\t}\n\n\tlogf(t, \"started (%s) as %s\", cname, name)\n\n\tcjson, err := mn.client.ContainerInspect(context.Background(), c.ID)\n\n\tif err != nil {\n\t\tfatalf(t, \"Failed to inspect: %v\", err)\n\t}\n\n\treturn &container{j: cjson, c: mn.client, t: t}\n}", "title": "" }, { "docid": "166882bd7f783dccd2608952c2fb38f7", "score": "0.5327469", "text": "func createObj(typ reflect.Type) (reflect.Value, func(reflect.Value) reflect.Value) {\n\tlevel := 0\n\tfor typ.Kind() == reflect.Ptr {\n\t\tlevel++\n\t\ttyp = typ.Elem()\n\t}\n\tobj := reflect.New(typ).Elem()\n\treturn obj, func(v reflect.Value) reflect.Value {\n\t\tfor ; level > 0; level-- {\n\t\t\tobj = obj.Addr()\n\t\t}\n\t\treturn obj\n\t}\n}", "title": "" }, { "docid": "d21bad8d4834cd074d05ef73156e6bd0", "score": "0.52953875", "text": "func Ptr[T basicType](v T) *T {\n\treturn &v\n}", "title": "" }, { "docid": "7fc6f1d148abf56917d599843dc905e2", "score": "0.52748024", "text": "func (mdatBoxFactory) New(box bmfcommon.Box) (cb bmfcommon.CommonBox, childBoxSeriesOffset int, err error) {\n\tdefer func() {\n\t\tif errRaw := recover(); errRaw != nil {\n\t\t\terr = log.Wrap(errRaw.(error))\n\t\t}\n\t}()\n\n\tmdatBox := &MdatBox{\n\t\tBox: box,\n\t}\n\n\treturn mdatBox, -1, nil\n}", "title": "" }, { "docid": "c507c41e243cc012cd129dcee60b82b8", "score": "0.5211718", "text": "func (g *grid2d) addBox(b box, x uint8, y uint8) {\n\tfor i := y; i < (y + b.w); i++ {\n\t\tfor j := x; j < (x + b.l); j++ {\n\t\t\tif i+1 > gridSize || j+1 > gridSize {\n\t\t\t\treturn // error handling\n\t\t\t}\n\t\t\tg[i][j] = &b\n\t\t\tg[i][j].x = x\n\t\t\tg[i][j].y = y\n\t\t}\n\t}\n}", "title": "" }, { "docid": "9e75a4a196d96edd18dd006b911410d6", "score": "0.51986957", "text": "func (stsdBoxFactory) New(box bmfcommon.Box) (cb bmfcommon.CommonBox, childBoxSeriesOffset int, err error) {\n\tdefer func() {\n\t\tif errRaw := recover(); errRaw != nil {\n\t\t\terr = log.Wrap(errRaw.(error))\n\t\t}\n\t}()\n\n\tstsdBox := &StsdBox{\n\t\tBox: box,\n\t}\n\n\terr = stsdBox.parse()\n\tlog.PanicIf(err)\n\n\treturn stsdBox, 8, nil\n}", "title": "" }, { "docid": "767f7afecf9002b60394329650322d21", "score": "0.51985747", "text": "func (b *T) alloc(leaf bool) (*node, uint32) {\n\tn := new(node)\n\tn.leaf = leaf\n\tn.next = invalidNode\n\tn.prev = invalidNode\n\tn.parent = invalidNode\n\tb.nodes = append(b.nodes, n)\n\treturn n, uint32(len(b.nodes) - 1)\n}", "title": "" }, { "docid": "85fef7249b384817a734d2eb75bd7927", "score": "0.5190682", "text": "func HBox(w float64) *Box {\n\treturn newBox(w, 0, 0)\n}", "title": "" }, { "docid": "73553f38a002b8f329aaf57242a6ae8e", "score": "0.5176747", "text": "func allocateMemory(frame *rtda.Frame) {\n\tvars := frame.LocalVars()\n\t// vars.GetRef(0) // this\n\tbytes := vars.GetLong(1)\n\n\taddress := allocate(bytes)\n\tstack := frame.OperandStack()\n\tstack.PushLong(address)\n}", "title": "" }, { "docid": "c4f4c7530e22b692df1bbd27ca0758f4", "score": "0.51720977", "text": "func (page *Page) addBox(id string, rounded bool) (*Tag, error) {\n\ttag, err := page.root.GetTag(\"body\")\n\tif err == nil {\n\t\treturn tag.AddBox(id, rounded, \"0.9em\", \"Speaks browser so you don't have to\", \"white\", \"black\", \"3em\"), nil\n\t}\n\treturn tag, err\n}", "title": "" }, { "docid": "f41d64011c2d876925b33987fa5e6312", "score": "0.51631397", "text": "func drawBox(g *graphics, w, h int32) {\n\n\tg.setGlobalColor(0, 0, 0, 0)\n\tg.fillRect(128-w/2-2, 120-h/2-2, w+4, h+4)\n\tg.setGlobalColor(255, 255, 255, 255)\n\tg.fillRect(128-w/2-1, 120-h/2-1, w+2, h+2)\n\tg.setGlobalColor(72, 72, 72, 72)\n\tg.fillRect(128-w/2, 120-h/2, w, h)\n}", "title": "" }, { "docid": "599dea893bfedddabf4ef93336f17318", "score": "0.51258004", "text": "func (r *Box) NewInnerBox(topMargin, rightMargin, bottomMargin, leftMargin int) *Box {\n\treturn NewBox(r.leftBottomX+leftMargin, r.leftBottomY+bottomMargin, r.rightTopX-rightMargin, r.rightTopY-topMargin)\n}", "title": "" }, { "docid": "5ce7012343bbfb6456495659c6648072", "score": "0.51113415", "text": "func (r AllocResult) Ptr() memory.Pointer {\n\treturn memory.Pointer{Address: r.rng.Base, Pool: memory.ApplicationPool}\n}", "title": "" }, { "docid": "bfa0cd17b6b3a93d9952d3e4e8f9af62", "score": "0.5096961", "text": "func allocRectangleMemory(n int) unsafe.Pointer {\n\tmem, err := C.calloc(C.size_t(n), (C.size_t)(sizeOfRectangleValue))\n\tif err != nil {\n\t\tpanic(\"memory alloc error: \" + err.Error())\n\t}\n\treturn mem\n}", "title": "" }, { "docid": "4d610cf4a6c3433a0a7971e9d068c2af", "score": "0.507419", "text": "func (v ThumbnailType) Ptr() *ThumbnailType {\n\treturn &v\n}", "title": "" }, { "docid": "99da6be8ff68acb0bbd3a524a957d112", "score": "0.50719595", "text": "func (ftypBoxFactory) New(box bmfcommon.Box) (cb bmfcommon.CommonBox, childBoxSeriesOffset int, err error) {\n\tdefer func() {\n\t\tif errRaw := recover(); errRaw != nil {\n\t\t\terr = log.Wrap(errRaw.(error))\n\t\t}\n\t}()\n\n\tftypBox := &FtypBox{\n\t\tBox: box,\n\t}\n\n\terr = ftypBox.parse()\n\tlog.PanicIf(err)\n\n\treturn ftypBox, -1, nil\n}", "title": "" }, { "docid": "77ed9e2b491629509e391014bb8e3ea6", "score": "0.5062896", "text": "func Box(width, height int, text ...string) []objects.Renderable {\n\tresult := make([]objects.Renderable, 0, width*height)\n\n\t// nolint: gocyclo\n\tfor x := 0; x <= width+1; x++ {\n\t\tfor y := 0; y <= height+1; y++ {\n\t\t\tsymbol := boxSymbol(x, y, width+1, height+1)\n\n\t\t\tif len(text) > y-1 && y > 0 {\n\t\t\t\tmessage := text[y-1]\n\n\t\t\t\tif x > 0 {\n\t\t\t\t\tr, s := utf8.DecodeRuneInString(message)\n\n\t\t\t\t\tif s > 0 {\n\t\t\t\t\t\tsymbol = r\n\t\t\t\t\t\ttext[y-1] = message[s:]\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tresult = append(result, objects.Renderable{Location: objects.Point{x, y}, Symbol: symbol})\n\t\t}\n\t}\n\n\treturn result\n}", "title": "" }, { "docid": "9dd76f0151b3b24eec3e2f71912652ae", "score": "0.5042489", "text": "func NewBoxA1() *Box {\n\treturn NewBox(0, 0, 1684, 2384)\n}", "title": "" }, { "docid": "49eddd66347bfd71b1a6e0fdcd1eb956", "score": "0.5037497", "text": "func (b *Box) newTrack() track {\n\tatomic.AddInt64(&b.allocs, 1)\n\treturn track(C.musly_track_alloc(b.jukebox))\n}", "title": "" }, { "docid": "f0227b0cb9f70616dbead8e828df9faf", "score": "0.5018108", "text": "func newMemory(t uint64, l map[uint64]*commonpb.Entry) *raft.Memory {\n\treturn raft.NewMemory(map[uint64]uint64{\n\t\traft.KeyTerm: t,\n\t\traft.KeyVotedFor: raftgorums.None,\n\t\traft.KeyNextIndex: uint64(len(l) + 1),\n\t}, l)\n}", "title": "" }, { "docid": "958b92f1140765fbb8329f23cfba1bd3", "score": "0.5014334", "text": "func (b *Box) Bottom() int { return b.y }", "title": "" }, { "docid": "8406d08fb6ea2de728967647755c7d48", "score": "0.5005712", "text": "func newNode(bucket *MyBucket) *Node {\n\tnode := Node{}\n\tnode.Bucket = bucket\n\tnode.Left = nil\n\tnode.Right = nil\n\tnode.Parent = nil\n\treturn &node\n}", "title": "" }, { "docid": "fc8d424ea5a8ca9106b7fd9c0864b18a", "score": "0.4994699", "text": "func (b *Box) Top() int { return b.y + b.height }", "title": "" }, { "docid": "7d982ade68cb8ee98e6a06263123d114", "score": "0.49946547", "text": "func putLong(frame *rtda.Frame) {\n\tfields := frame.GetRefVar(1).Fields\n\toffset := frame.GetLongVar(2)\n\tx := frame.GetLongVar(4)\n\n\tif slots, ok := fields.([]heap.Slot); ok {\n\t\t// object\n\t\tslots[offset] = heap.NewLongSlot(x)\n\t} else if longs, ok := fields.([]int64); ok {\n\t\t// long[]\n\t\tlongs[offset] = x\n\t} else {\n\t\tpanic(\"putLong!\")\n\t}\n}", "title": "" }, { "docid": "da3be6c7053c6ec25d0641be44b50476", "score": "0.49936235", "text": "func (s *Struct) Ptr() PointerType { return PointerTo(s) }", "title": "" }, { "docid": "bbd31bd3a44b12454414badd4693e427", "score": "0.4986977", "text": "func (x *Rectangle) PassRef() (*C.Rectangle, *cgoAllocMap) {\n\tif x == nil {\n\t\treturn nil, nil\n\t} else if x.refcee8783a != nil {\n\t\treturn x.refcee8783a, nil\n\t}\n\tmemcee8783a := allocRectangleMemory(1)\n\trefcee8783a := (*C.Rectangle)(memcee8783a)\n\tallocscee8783a := new(cgoAllocMap)\n\tallocscee8783a.Add(memcee8783a)\n\n\tvar cx_allocs *cgoAllocMap\n\trefcee8783a.x, cx_allocs = (C.float)(x.X), cgoAllocsUnknown\n\tallocscee8783a.Borrow(cx_allocs)\n\n\tvar cy_allocs *cgoAllocMap\n\trefcee8783a.y, cy_allocs = (C.float)(x.Y), cgoAllocsUnknown\n\tallocscee8783a.Borrow(cy_allocs)\n\n\tvar cwidth_allocs *cgoAllocMap\n\trefcee8783a.width, cwidth_allocs = (C.float)(x.Width), cgoAllocsUnknown\n\tallocscee8783a.Borrow(cwidth_allocs)\n\n\tvar cheight_allocs *cgoAllocMap\n\trefcee8783a.height, cheight_allocs = (C.float)(x.Height), cgoAllocsUnknown\n\tallocscee8783a.Borrow(cheight_allocs)\n\n\tx.refcee8783a = refcee8783a\n\tx.allocscee8783a = allocscee8783a\n\treturn refcee8783a, allocscee8783a\n\n}", "title": "" }, { "docid": "9a1c3f294067da731caec74800fff7dc", "score": "0.49861115", "text": "func allocPRectangleMemory(n int) unsafe.Pointer {\n\tmem, err := C.calloc(C.size_t(n), (C.size_t)(sizeOfPRectangleValue))\n\tif err != nil {\n\t\tpanic(\"memory alloc error: \" + err.Error())\n\t}\n\treturn mem\n}", "title": "" }, { "docid": "7b36a6383477a8f8772b5c504d4f6ead", "score": "0.49727008", "text": "func main() {\n\n\t//r1 is of type Rect\n\tvar r1 Rect\n\tr1.w = 5.3\n\tr1.h = 2.7\n\n\tfmt.Printf(\"Area of r1 = %.2f\\n\", area(r1))\n\n\t//r2 is a pointer to a Rect\n\tr2 := new(Rect)\n\tr2.w = 3.5\n\tr2.h = 7.1\n\n\tfmt.Printf(\"Area of r2 = %.2f\\n\", area(*r2)) //need to use * b/c it is the indirection operator and will call area to the specific place in memory that the reference r2 has already allocated within the context of the allocation\n}", "title": "" }, { "docid": "0d656fe5a4166f6d87cb1379c8a8968b", "score": "0.4970671", "text": "func ButtonBoxNew(orientation Orientation) (*ButtonBox, error) {\n\tc := C.gtk_button_box_new(C.GtkOrientation(orientation))\n\tif c == nil {\n\t\treturn nil, nilPtrErr\n\t}\n\tobj := glib.Take(unsafe.Pointer(c))\n\treturn wrapButtonBox(obj), nil\n}", "title": "" }, { "docid": "6a28de2f8d1dae97edf20a7f753e535a", "score": "0.49691287", "text": "func pointer(v interface{}) interface{} {\n\tif reflect.ValueOf(v).Kind() != reflect.Ptr {\n\t\tvalue := reflect.New(reflect.ValueOf(v).Type())\n\t\tvalue.Elem().Set(reflect.ValueOf(v))\n\t\treturn value.Interface()\n\t}\n\treturn v\n}", "title": "" }, { "docid": "251fe8c74746d7d4c9d0d5fd746b77e0", "score": "0.4967003", "text": "func MakePointer(instance interface{}) interface{} {\n\tt := reflect.TypeOf(instance)\n\n\tcp := reflect.New(t)\n\tcp.Elem().Set(reflect.ValueOf(instance))\n\n\t// Avoid double pointers...\n\tif t.Kind() == reflect.Ptr {\n\t\treturn cp.Elem().Interface()\n\t}\n\n\treturn cp.Interface()\n}", "title": "" }, { "docid": "1b16b1d150c287315f433e8ab548f12d", "score": "0.49548993", "text": "func (box *Box) Height() float64 { return box.height }", "title": "" }, { "docid": "9b21e7679cb0adfa44b7a02eae816648", "score": "0.49388424", "text": "func (priv *Private) ToBox() (*[32]byte, error) {\n\terr := priv.Check()\n\tif err != nil {\n\t\tvar passphrase []byte\n\t\tpassphrase, err = PassphrasePrompt(false)\n\t\tif err != nil {\n\t\t\treturn nil, err\n\t\t}\n\n\t\terr = priv.decrypt(passphrase)\n\t\tif err != nil {\n\t\t\treturn nil, err\n\t\t}\n\t}\n\n\tvar sboxKey [32]byte\n\tdigest := sha512.Sum512(priv.key[:32])\n\tdigest[0] &= 248\n\tdigest[31] &= 127\n\tdigest[31] |= 64\n\tcopy(sboxKey[:], digest[:])\n\tdefer zero64(&digest)\n\treturn &sboxKey, nil\n}", "title": "" }, { "docid": "e1a785c27caf62e7e332845a60b95940", "score": "0.4937714", "text": "func NewBox2(center, size v2.Vec) Box2 {\n\thalf := size.MulScalar(0.5)\n\treturn Box2{center.Sub(half), center.Add(half)}\n}", "title": "" }, { "docid": "423100f9e65b2055a02c38f897bc222b", "score": "0.4937599", "text": "func (pg *Pager) SetBox(b *Box) {\n\tpg.box = b\n\tpg.dirty = true\n}", "title": "" }, { "docid": "84c4451786ad11741857601a99208b94", "score": "0.4935496", "text": "func newStructurePointer(n, s string, h int32) *myStructure {\n\tif h > 300 {\n\t\th = 0\n\t}\n\treturn &myStructure{n, s, h}\n}", "title": "" }, { "docid": "c0a00e8e26c26c649fac8bf8bd15a4a5", "score": "0.49344185", "text": "func putObject(frame *rtda.Frame) {\n\tfields := frame.GetRefVar(1).Fields\n\toffset := frame.GetLongVar(2)\n\tx := frame.GetRefVar(4)\n\n\tif slots, ok := fields.([]heap.Slot); ok {\n\t\t// object\n\t\tslots[offset] = heap.NewRefSlot(x)\n\t} else if objs, ok := fields.([]*heap.Object); ok {\n\t\t// ref[]\n\t\tobjs[offset] = x\n\t} else {\n\t\tpanic(\"putObject!\")\n\t}\n}", "title": "" }, { "docid": "01435b5050941c462b8576599c3b0009", "score": "0.4933886", "text": "func (pub *Public) ToBox() (*[32]byte, error) {\n\tvar A = &edwards25519.ExtendedGroupElement{}\n\tvar oneMinusY = &edwards25519.FieldElement{}\n\tvar x = &edwards25519.FieldElement{}\n\n\tedpub := [32]byte{}\n\tcopy(edpub[:], pub.key[:])\n\n\tif !A.FromBytes(&edpub) {\n\t\treturn nil, errors.New(\"signify: invalid public key\")\n\t}\n\n\tedwards25519.FeOne(oneMinusY)\n\tedwards25519.FeSub(oneMinusY, oneMinusY, &A.Y)\n\tedwards25519.FeOne(x)\n\tedwards25519.FeAdd(x, x, &A.Y)\n\tedwards25519.FeInvert(oneMinusY, oneMinusY)\n\tedwards25519.FeMul(x, x, oneMinusY)\n\tedwards25519.FeToBytes(&edpub, x)\n\n\treturn &edpub, nil\n}", "title": "" }, { "docid": "35b6aeae212848f4916eada97e752041", "score": "0.4932422", "text": "func allocRayMemory(n int) unsafe.Pointer {\n\tmem, err := C.calloc(C.size_t(n), (C.size_t)(sizeOfRayValue))\n\tif err != nil {\n\t\tpanic(\"memory alloc error: \" + err.Error())\n\t}\n\treturn mem\n}", "title": "" }, { "docid": "e2a6e37db9afd56779f503166389afc4", "score": "0.4927845", "text": "func ValuePtr(v interface{}) (interface{}, error) {\n\tt, err := IndirectType(v)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\treturn reflect.New(t).Interface(), nil\n}", "title": "" }, { "docid": "7888ea1331f26ffcae7050b13b25b5fe", "score": "0.49270386", "text": "func _goMalloc(size uintptr) *C.PyObject {\n\t// We have to use []unsafe.Pointer instead of []byte, otherwise the Go\n\t// runtime will mark the memory as not containing pointers, and won't use it\n\t// to pin other Go allocations in memory - in which case we might as well\n\t// just stick with the Python allocator.\n\tn := (size + upSize - 1) / upSize\n\ts := make([]unsafe.Pointer, n)\n\tp := unsafe.Pointer(&s[0])\n\n\t// We need to keep a reference to the allocation, so that the Go runtime\n\t// doesn't free the memory before we are finished with it.\n\tallocated[uintptr(p)] = s\n\n\treturn (*C.PyObject)(p)\n}", "title": "" }, { "docid": "1fddedcdf1bb045bfc6d52b4b65cf922", "score": "0.4924448", "text": "func (v TipoGvm) Ptr() *TipoGvm {\n\treturn &v\n}", "title": "" }, { "docid": "182109da7499555bafb1284b43507063", "score": "0.49167484", "text": "func Box(\n\ttargetMin, targetMax [2]float64, wrapX bool,\n\titemDist func(min, max [2]float64, data interface{}) float64,\n) (\n\talgo func(min, max [2]float64, data interface{}, item bool) (dist float64),\n) {\n\treturn func(min, max [2]float64, data interface{}, item bool) (dist float64) {\n\t\tif item && itemDist != nil {\n\t\t\treturn itemDist(min, max, data)\n\t\t}\n\t\treturn BoxDistCalc(targetMin, targetMax, min, max, wrapX)\n\t}\n}", "title": "" }, { "docid": "0da6afd2790777f35c01f73bd1643f52", "score": "0.49148613", "text": "func getNewPtrToType(obj interface{}) (interface{}, error) {\n\tif reflect.TypeOf(obj).Kind() == reflect.Ptr {\n\t\treturn nil, errors.New(\"wrong object kind\")\n\t}\n\treturn reflect.New(reflect.TypeOf(obj)).Interface(), nil\n}", "title": "" }, { "docid": "172880d91f7c517aa9e79dc7edae271e", "score": "0.48852056", "text": "func NewHBox(c ...Widget) *Box {\n\treturn &Box{\n\t\tchildren: c,\n\t\talignment: Horizontal,\n\t}\n}", "title": "" }, { "docid": "35b3ab732d565082b67d2f707631ab94", "score": "0.4882961", "text": "func (e *memEncoderState) alloc(t reflect.Type, n int) uintptr {\n\talign := uintptr(t.Align())\n\tif e.next%align != 0 {\n\t\te.next += align - (e.next % align)\n\t}\n\tcur := e.next\n\te.next += t.Size() * uintptr(n)\n\treturn cur\n}", "title": "" }, { "docid": "acc9fe249ab911b7ddcbf4550036693c", "score": "0.4880399", "text": "func newHeapNode(value HeapElement) *HeapNode {\n\treturn &HeapNode{\n\t\tvalue: value,\n\t}\n}", "title": "" }, { "docid": "c0b480904429347599eef64bd4f75975", "score": "0.48644868", "text": "func ptr[T any](x T) *T {\n\treturn &x\n}", "title": "" }, { "docid": "ddd538193179bf5e9f0b11f8d6641f08", "score": "0.4860255", "text": "func AnimalPtr(v Animal) *Animal {\n return &v\n}", "title": "" }, { "docid": "86100b3fc1a2a8e5f0c31c8e0c5e2afe", "score": "0.48531562", "text": "func NewVBox(c ...Widget) *Box {\n\treturn &Box{\n\t\tchildren: c,\n\t\talignment: Vertical,\n\t}\n}", "title": "" }, { "docid": "1ca8e7aed11d9d70a995eebddbbd23ed", "score": "0.4851734", "text": "func (world *World) Malloc(flags uint, size uint) *Memory {\n\treturn &Memory{world, size}\n}", "title": "" }, { "docid": "2a0caecb024e378a797dc500f3170412", "score": "0.4851055", "text": "func EventBoxNew() (*EventBox, error) {\n\tc := C.gtk_event_box_new()\n\tif c == nil {\n\t\treturn nil, nilPtrErr\n\t}\n\tobj := wrapObject(unsafe.Pointer(c))\n\treturn wrapEventBox(obj), nil\n}", "title": "" }, { "docid": "067bc1165e35cd3b82f58e06c6419660", "score": "0.48480636", "text": "func NewPhysicsNinjaAABB(body *PhysicsNinjaBody, x int, y int, width int, height int) *PhysicsNinjaAABB {\n return &PhysicsNinjaAABB{js.Global.Get(\"Phaser\").Get(\"Physics\").Get(\"Ninja\").Get(\"AABB\").New(body, x, y, width, height)}\n}", "title": "" }, { "docid": "747429c21fb4b5b47212453ef406b498", "score": "0.48418543", "text": "func DrawBox(x int, y int, width int, height int, style Style) {\n\tfg := style.FG\n\tbg := style.BG\n\n\txmax := x + width - 1\n\tymax := y + height - 1\n\n\ttermbox.SetCell(x, y, BOX_CORNER_TL, fg, bg)\n\ttermbox.SetCell(xmax, y, BOX_CORNER_TR, fg, bg)\n\ttermbox.SetCell(x, ymax, BOX_CORNER_BL, fg, bg)\n\ttermbox.SetCell(xmax, ymax, BOX_CORNER_BR, fg, bg)\n\n\tfor i := x + 1; i <= xmax-1; i++ {\n\t\ttermbox.SetCell(i, y, BOX_HOZ, fg, bg)\n\t\ttermbox.SetCell(i, ymax, BOX_HOZ, fg, bg)\n\t}\n\n\tfor i := y + 1; i <= ymax-1; i++ {\n\t\ttermbox.SetCell(x, i, BOX_VERT, fg, bg)\n\t\ttermbox.SetCell(xmax, i, BOX_VERT, fg, bg)\n\t}\n}", "title": "" }, { "docid": "b48e3cc6e208125d7bd0cd7b1a891138", "score": "0.4840144", "text": "func (ib *ItemBox) build(ibNum int) error {\n\tnumStr := strconv.Itoa(ibNum + 1)\n\tx := strconv.FormatUint(uint64(ib.X), 10)\n\ty := strconv.FormatUint(uint64(ib.Y), 10)\n\tw := strconv.FormatUint(uint64(ib.Width), 10)\n\th := strconv.FormatUint(uint64(ib.Height), 10)\n\ttemplate := `<p:sp>\n<p:nvSpPr>\n<p:cNvPr id=\"` + strconv.Itoa(ibNum+2) + `\" name=\"ItemBox ` + numStr + `\"/>\n<p:cNvSpPr/>\n<p:nvPr>\n<p:ph idx=\"1\"/>\n</p:nvPr>\n</p:nvSpPr>\n<p:spPr>\n<a:xfrm>\n<a:off x=\"` + x + `\" y=\"` + y + `\"/>\n<a:ext cx=\"` + w + `\" cy=\"` + h + `\"/>\n</a:xfrm>\n</p:spPr>\n<p:txBody>\n<a:bodyPr/>\n<a:lstStyle/>\n</p:txBody>\n</p:sp>`\n\tib.xml = etree.NewDocument()\n\tif err := ib.xml.ReadFromString(template); err != nil {\n\t\treturn err\n\t}\n\ttxBody := ib.xml.FindElement(\"p:sp/p:txBody\")\n\tif txBody == nil {\n\t\treturn fmt.Errorf(\"cannot find txBody\")\n\t}\n\tfor _, line := range ib.Items {\n\t\ttxBody.Child = append(txBody.Child, ib.buildLine(line).Root())\n\t}\n\treturn nil\n}", "title": "" }, { "docid": "303a4c03f669a9410dc5f663afc30e2c", "score": "0.4837267", "text": "func newMemory(t uint64, l map[uint64]*commonpb.Entry) *Memory {\n\treturn NewMemory(map[uint64]uint64{\n\t\tKeyTerm: t,\n\t\tKeyVotedFor: none,\n\t\tKeyNextIndex: uint64(len(l) + 1),\n\t}, l)\n}", "title": "" }, { "docid": "5442f1df471d0751e217ce7969c8508a", "score": "0.48280522", "text": "func (s VerOnePtr) NewPtr() (VerOneData, error) {\n\tss, err := NewVerOneData(s.Struct.Segment())\n\tif err != nil {\n\t\treturn VerOneData{}, err\n\t}\n\terr = s.Struct.SetPtr(0, ss.Struct.ToPtr())\n\treturn ss, err\n}", "title": "" }, { "docid": "4429e5b96eab84e0a4d30b2091ad1076", "score": "0.4826566", "text": "func (o Object) BBox() BBox {\n\tmin, max := o.Rect(nil)\n\treturn BBox{\n\t\tMin: Position{min[0], min[1], min[2]},\n\t\tMax: Position{max[0], max[1], max[2]},\n\t}\n}", "title": "" }, { "docid": "ae20a5f152850401ea235a793d181652", "score": "0.48225713", "text": "func (q *PktQueue) Ptr() unsafe.Pointer {\n\treturn unsafe.Pointer(q)\n}", "title": "" }, { "docid": "d46ec854165a1336ffd0b4c58bad2e8b", "score": "0.48159567", "text": "func (s VerOnePtr) NewPtr() (VerOneData, error) {\n\n\tss, err := NewVerOneData(s.Struct.Segment())\n\tif err != nil {\n\t\treturn VerOneData{}, err\n\t}\n\terr = s.Struct.SetPointer(0, ss)\n\treturn ss, err\n}", "title": "" }, { "docid": "1b8e6bb3c8b9a55fe3a20dfa48df7b59", "score": "0.48146567", "text": "func getObject(frame *rtda.Frame) {\n\tvars := frame.LocalVars()\n\tfields := vars.GetRef(1).Data()\n\toffset := vars.GetLong(2)\n\n\tif anys, ok := fields.(heap.Slots); ok {\n\t\t// object\n\t\tx := anys.GetRef(uint(offset))\n\t\tframe.OperandStack().PushRef(x)\n\t} else if objs, ok := fields.([]*heap.Object); ok {\n\t\t// ref[]\n\t\tx := objs[offset]\n\t\tframe.OperandStack().PushRef(x)\n\t} else {\n\t\tpanic(\"getObject!\")\n\t}\n}", "title": "" }, { "docid": "13cc28c4998533023ccdc08405154565", "score": "0.48061988", "text": "func (b Board) Box(r uint8) []uint8 {\n\tconst boxWidth = 3\n\tconst boxHeight = boxWidth\n\n\trowOffset, colOffset := r/boxWidth*boxHeight, r%boxWidth*boxWidth\n\n\tresults := make([]uint8, len(b[0]))\n\tfor i := uint8(0); i < boxHeight; i++ {\n\t\tfor j := uint8(0); j < boxWidth; j++ {\n\t\t\tresults[i*boxWidth+j] = b[i+rowOffset][j+colOffset]\n\t\t}\n\t}\n\treturn results\n}", "title": "" }, { "docid": "2234358c53c0a4df8d239af90dee9f62", "score": "0.48022535", "text": "func wrapObject(ptr unsafe.Pointer) *glib.Object {\n\tobj := &glib.Object{glib.ToGObject(ptr)}\n\n\tif obj.IsFloating() {\n\t\tobj.RefSink()\n\t} else {\n\t\tobj.Ref()\n\t}\n\n\truntime.SetFinalizer(obj, (*glib.Object).Unref)\n\treturn obj\n}", "title": "" }, { "docid": "3ab90fc36ffbfddf12e62f5bd20fadeb", "score": "0.47936618", "text": "func osStackAlloc(s *mspan) {\n}", "title": "" }, { "docid": "7925d697d6323d3ab5baee02c3257844", "score": "0.47930542", "text": "func (hdlr Latex) Box(txt string, fnt vg.Font) (width, height, depth vg.Length) {\n\tcnv := drawtex.New()\n\tfnts := &ttf.Fonts{\n\t\tRm: fnt.Font(),\n\t\tDefault: fnt.Font(),\n\t\tIt: fnt.Font(), // FIXME(sbinet): need a gonum/plot font set\n\t}\n\tbox, err := mtex.Parse(txt, fnt.Size.Points(), latexDPI, ttf.NewFrom(cnv, fnts))\n\tif err != nil {\n\t\tpanic(fmt.Errorf(\"could not parse math expression: %w\", err))\n\t}\n\n\tvar sh tex.Ship\n\tsh.Call(0, 0, box.(tex.Tree))\n\n\twidth = vg.Length(box.Width())\n\theight = vg.Length(box.Height())\n\tdepth = vg.Length(box.Depth())\n\n\t// Add a bit of space, with a linegap as mtex.Box is returning\n\t// a very tight bounding box.\n\t// See gonum/plot#661.\n\tif depth != 0 {\n\t\tvar (\n\t\t\te = fnt.Extents()\n\t\t\tlinegap = e.Height - (e.Ascent + e.Descent)\n\t\t)\n\t\tdepth += linegap\n\t}\n\n\tdpi := vg.Length(hdlr.dpi() / latexDPI)\n\treturn width * dpi, height * dpi, depth * dpi\n}", "title": "" }, { "docid": "fffcf5d5144d16d632a93de560a81a0d", "score": "0.47709402", "text": "func (*BoxComponent) FlexComponent() {}", "title": "" }, { "docid": "676bf490ab68a93761c568ee3f9d7e00", "score": "0.47696286", "text": "func VBox(h, d float64) *Box {\n\treturn newBox(0, h, d)\n}", "title": "" } ]
10069e32a2bbd4598f45ee76206258c7
Deprecated: Use SystemGetAttrResp.ProtoReflect.Descriptor instead.
[ { "docid": "42ab582f3e978ade396d1c8ff7eb8542", "score": "0.75987524", "text": "func (*SystemGetAttrResp) Descriptor() ([]byte, []int) {\n\treturn file_mgmt_system_proto_rawDescGZIP(), []int{15}\n}", "title": "" } ]
[ { "docid": "d9bf95be347f3079f799f5e6503aac18", "score": "0.7516538", "text": "func (*SystemGetAttrReq) Descriptor() ([]byte, []int) {\n\treturn file_mgmt_system_proto_rawDescGZIP(), []int{14}\n}", "title": "" }, { "docid": "cb9cefaa8ab12e6d951b6f3c8ea992e1", "score": "0.68265134", "text": "func (*SystemGetPropResp) Descriptor() ([]byte, []int) {\n\treturn file_mgmt_system_proto_rawDescGZIP(), []int{18}\n}", "title": "" }, { "docid": "8fa20737eb8121775ef4930098602db5", "score": "0.6823358", "text": "func (*MsgDescriptor) Descriptor() ([]byte, []int) {\n\treturn file_cosmos_base_reflection_v2alpha1_reflection_proto_rawDescGZIP(), []int{10}\n}", "title": "" }, { "docid": "4732c8ddd2956f657a48eee268194324", "score": "0.6765756", "text": "func (*SystemGetPropReq) Descriptor() ([]byte, []int) {\n\treturn file_mgmt_system_proto_rawDescGZIP(), []int{17}\n}", "title": "" }, { "docid": "3276219b3a2903222bd7f501214ce667", "score": "0.67309237", "text": "func (*GetCodecDescriptorRequest) Descriptor() ([]byte, []int) {\n\treturn file_cosmos_base_reflection_v2alpha1_reflection_proto_rawDescGZIP(), []int{15}\n}", "title": "" }, { "docid": "8b80d04945361ff653daabd3876d0710", "score": "0.6726161", "text": "func (*GetCodecDescriptorResponse) Descriptor() ([]byte, []int) {\n\treturn file_cosmos_base_reflection_v2alpha1_reflection_proto_rawDescGZIP(), []int{16}\n}", "title": "" }, { "docid": "fb9e8f51604635709bf52cdd8f1c0d61", "score": "0.66977954", "text": "func (*GetQueryServicesDescriptorResponse) Descriptor() ([]byte, []int) {\n\treturn file_cosmos_base_reflection_v2alpha1_reflection_proto_rawDescGZIP(), []int{20}\n}", "title": "" }, { "docid": "88991b32d43d8ccf25607d667138edcc", "score": "0.663499", "text": "func (*GetChainDescriptorRequest) Descriptor() ([]byte, []int) {\n\treturn file_cosmos_base_reflection_v2alpha1_reflection_proto_rawDescGZIP(), []int{13}\n}", "title": "" }, { "docid": "01c16293ebfb2c70fc613adda33b6eba", "score": "0.66225624", "text": "func (*GetQueryServicesDescriptorRequest) Descriptor() ([]byte, []int) {\n\treturn file_cosmos_base_reflection_v2alpha1_reflection_proto_rawDescGZIP(), []int{19}\n}", "title": "" }, { "docid": "b54583e0e3baed94e499955dd2e98ebf", "score": "0.66217804", "text": "func (*ModifyCacheDirectiveResponseProto) Descriptor() ([]byte, []int) {\n\treturn file_ClientNamenodeProtocol_proto_rawDescGZIP(), []int{104}\n}", "title": "" }, { "docid": "7335282bcfca0fc8f40ee8636f748c0d", "score": "0.661359", "text": "func (x *fastReflection_MsgRevoke) Descriptor() protoreflect.MessageDescriptor {\n\treturn md_MsgRevoke\n}", "title": "" }, { "docid": "9981f75076316556afac9e4bd8b24cd9", "score": "0.6592505", "text": "func (x *fastReflection_MsgRevokeResponse) Descriptor() protoreflect.MessageDescriptor {\n\treturn md_MsgRevokeResponse\n}", "title": "" }, { "docid": "47f2972a98ba2ca3739dc62dbfccf6bc", "score": "0.65585333", "text": "func (*GetChainDescriptorResponse) Descriptor() ([]byte, []int) {\n\treturn file_cosmos_base_reflection_v2alpha1_reflection_proto_rawDescGZIP(), []int{14}\n}", "title": "" }, { "docid": "c8255a5181e929deb2ecbbb92db089a1", "score": "0.65501124", "text": "func (*GetMetricDescriptorRequest) Descriptor() ([]byte, []int) {\n\treturn edgelq_monitoring_proto_v3_metric_descriptor_custom_proto_rawDescGZIP(), []int{2}\n}", "title": "" }, { "docid": "e4656e8ed84cdc96957351d7baeb563d", "score": "0.65244323", "text": "func (*SystemSetAttrReq) Descriptor() ([]byte, []int) {\n\treturn file_mgmt_system_proto_rawDescGZIP(), []int{13}\n}", "title": "" }, { "docid": "ad17a3990372466f65a914aa8005f98f", "score": "0.65219206", "text": "func (*GetTxDescriptorResponse) Descriptor() ([]byte, []int) {\n\treturn file_cosmos_base_reflection_v2alpha1_reflection_proto_rawDescGZIP(), []int{22}\n}", "title": "" }, { "docid": "26b217d36ce0a97e1f15684e064ddb99", "score": "0.65101206", "text": "func (*ReqSystemMsg) Descriptor() ([]byte, []int) {\n\treturn file_structmsg_proto_rawDescGZIP(), []int{7}\n}", "title": "" }, { "docid": "68c1d198cc416a040c4ee32e45aedd0d", "score": "0.65036726", "text": "func (*PatchTracesRequest) Descriptor() ([]byte, []int) {\n\treturn file_google_devtools_cloudtrace_v1_trace_proto_rawDescGZIP(), []int{6}\n}", "title": "" }, { "docid": "f76c3aa3305cf1f15c896c9d3e60711d", "score": "0.6498024", "text": "func (x *fastReflection_GetResponse) Descriptor() protoreflect.MessageDescriptor {\n\treturn md_GetResponse\n}", "title": "" }, { "docid": "6931292ad286476ba3bd9b5bc85e85d0", "score": "0.6469522", "text": "func (*GetTxDescriptorRequest) Descriptor() ([]byte, []int) {\n\treturn file_cosmos_base_reflection_v2alpha1_reflection_proto_rawDescGZIP(), []int{21}\n}", "title": "" }, { "docid": "7cd38ebe89d4b173819a17a439af4d3b", "score": "0.6462223", "text": "func (*ModifyCacheDirectiveRequestProto) Descriptor() ([]byte, []int) {\n\treturn file_ClientNamenodeProtocol_proto_rawDescGZIP(), []int{103}\n}", "title": "" }, { "docid": "793c8d97b463cc8c415e0018b0ced3ff", "score": "0.6461729", "text": "func (*ListMetricDescriptorsResponse) Descriptor() ([]byte, []int) {\n\treturn edgelq_monitoring_proto_v3_metric_descriptor_custom_proto_rawDescGZIP(), []int{1}\n}", "title": "" }, { "docid": "cc65eac54359a993953974a71bb2dfc8", "score": "0.645601", "text": "func (*ReqSystemMsgRead) Descriptor() ([]byte, []int) {\n\treturn file_structmsg_proto_rawDescGZIP(), []int{10}\n}", "title": "" }, { "docid": "4c07e45c2d4814dcc607582f25046579", "score": "0.64472044", "text": "func (*GetAuthnDescriptorRequest) Descriptor() ([]byte, []int) {\n\treturn file_cosmos_base_reflection_v2alpha1_reflection_proto_rawDescGZIP(), []int{11}\n}", "title": "" }, { "docid": "4fa7228eaf18f496483d7d3c7e689a34", "score": "0.6445686", "text": "func (*RemoveCacheDirectiveResponseProto) Descriptor() ([]byte, []int) {\n\treturn file_ClientNamenodeProtocol_proto_rawDescGZIP(), []int{106}\n}", "title": "" }, { "docid": "e99e4b58fda99407bb8be3abfbd0e691", "score": "0.64428467", "text": "func (*GetAuthnDescriptorResponse) Descriptor() ([]byte, []int) {\n\treturn file_cosmos_base_reflection_v2alpha1_reflection_proto_rawDescGZIP(), []int{12}\n}", "title": "" }, { "docid": "817e16e57e1947a130488661a051550a", "score": "0.64275855", "text": "func (*GetTraceRequest) Descriptor() ([]byte, []int) {\n\treturn file_google_devtools_cloudtrace_v1_trace_proto_rawDescGZIP(), []int{5}\n}", "title": "" }, { "docid": "e358280e8f8d43d1d06bd89946795a3e", "score": "0.6424106", "text": "func (*RspSystemMsgRead) Descriptor() ([]byte, []int) {\n\treturn file_structmsg_proto_rawDescGZIP(), []int{16}\n}", "title": "" }, { "docid": "771069dd3f35b88a0fc798ba1d034fc2", "score": "0.6419459", "text": "func (x *fastReflection_GetQueryServicesDescriptorRequest) Descriptor() protoreflect.MessageDescriptor {\n\treturn md_GetQueryServicesDescriptorRequest\n}", "title": "" }, { "docid": "2ebba6abaaf0de9b0a3ce63263bb2f9e", "score": "0.6415025", "text": "func (*RspSystemMsg) Descriptor() ([]byte, []int) {\n\treturn file_structmsg_proto_rawDescGZIP(), []int{13}\n}", "title": "" }, { "docid": "901e341f6bbefbc899fc182391f89b08", "score": "0.6412089", "text": "func (*AddCacheDirectiveResponseProto) Descriptor() ([]byte, []int) {\n\treturn file_ClientNamenodeProtocol_proto_rawDescGZIP(), []int{102}\n}", "title": "" }, { "docid": "b6251d1ed704b4999d89b2afa41205ec", "score": "0.6406393", "text": "func (*ReqSystemMsgNew) Descriptor() ([]byte, []int) {\n\treturn file_structmsg_proto_rawDescGZIP(), []int{9}\n}", "title": "" }, { "docid": "4f5ab9c8cc18e39847da65e38aaa6b4c", "score": "0.6406377", "text": "func (*GetServiceRequest) Descriptor() ([]byte, []int) {\n\treturn file_protos_message_proto_rawDescGZIP(), []int{6}\n}", "title": "" }, { "docid": "9333be99562c72b418859da40de0f690", "score": "0.6404301", "text": "func (*QueryMethodDescriptor) Descriptor() ([]byte, []int) {\n\treturn file_cosmos_base_reflection_v2alpha1_reflection_proto_rawDescGZIP(), []int{25}\n}", "title": "" }, { "docid": "7fd97d07dfb969f49d82b536fa930938", "score": "0.6404092", "text": "func (*GenericRefreshResponseProto) Descriptor() ([]byte, []int) {\n\treturn file_GenericRefreshProtocol_proto_rawDescGZIP(), []int{1}\n}", "title": "" }, { "docid": "a2b7d50d2fee982639bc502122a9dab1", "score": "0.6403103", "text": "func (*WatchRequest_SRVRequest) Descriptor() ([]byte, []int) {\n\treturn file_servok_api_v1_v1_proto_rawDescGZIP(), []int{0, 0}\n}", "title": "" }, { "docid": "b900cdd876a2074cb5f3759cb1ca9de6", "score": "0.63979435", "text": "func (*SystemMsg) Descriptor() ([]byte, []int) {\n\treturn file_structmsg_proto_rawDescGZIP(), []int{18}\n}", "title": "" }, { "docid": "87134125a8e093fe07d2613512d5192d", "score": "0.63935816", "text": "func (*CacheDirectiveInfoProto) Descriptor() ([]byte, []int) {\n\treturn file_ClientNamenodeProtocol_proto_rawDescGZIP(), []int{98}\n}", "title": "" }, { "docid": "e6bbc40f3ee5ca95a5fb8176ba67a12a", "score": "0.6392196", "text": "func (*QueryServicesDescriptor) Descriptor() ([]byte, []int) {\n\treturn file_cosmos_base_reflection_v2alpha1_reflection_proto_rawDescGZIP(), []int{23}\n}", "title": "" }, { "docid": "881ac101146d19aaafa126b21cac0113", "score": "0.63893116", "text": "func (*GetDeviceRequest) Descriptor() ([]byte, []int) {\n\treturn file_public_api_proto_public_api_proto_rawDescGZIP(), []int{6}\n}", "title": "" }, { "docid": "9758ae651dd233ce0895a70c8cfcde63", "score": "0.63836604", "text": "func (*GetVersionRequest) Descriptor() ([]byte, []int) {\n\treturn file_lightbits_api_duros_v2_durosapiv2_proto_rawDescGZIP(), []int{23}\n}", "title": "" }, { "docid": "072c0be82d6220534b696ee7229c249f", "score": "0.6380409", "text": "func (*GenericRefreshRequestProto) Descriptor() ([]byte, []int) {\n\treturn file_GenericRefreshProtocol_proto_rawDescGZIP(), []int{0}\n}", "title": "" }, { "docid": "39d2cc2213b0eb6d3c5b4d279502a291", "score": "0.6376298", "text": "func (x *fastReflection_GetCodecDescriptorRequest) Descriptor() protoreflect.MessageDescriptor {\n\treturn md_GetCodecDescriptorRequest\n}", "title": "" }, { "docid": "8b3361a8c6e9efdb3bc263c149cb27a0", "score": "0.6368117", "text": "func (*GetHostRequest) Descriptor() ([]byte, []int) {\n\treturn file_lightbits_api_duros_v2_durosapiv2_proto_rawDescGZIP(), []int{38}\n}", "title": "" }, { "docid": "a93adbcf6110fe4f604f5fe7b02ae18c", "score": "0.636693", "text": "func (*QueryServiceDescriptor) Descriptor() ([]byte, []int) {\n\treturn file_cosmos_base_reflection_v2alpha1_reflection_proto_rawDescGZIP(), []int{24}\n}", "title": "" }, { "docid": "43ed02c26b9d2add9d55e353e8f3ab6f", "score": "0.63615155", "text": "func (*GetCLRequest) Descriptor() ([]byte, []int) {\n\treturn file_go_chromium_org_luci_cv_internal_admin_api_admin_proto_rawDescGZIP(), []int{7}\n}", "title": "" }, { "docid": "36a62c68acf0e2b6787fe0f926d0b131", "score": "0.6359744", "text": "func (*SetPermissionResponseProto) Descriptor() ([]byte, []int) {\n\treturn file_ClientNamenodeProtocol_proto_rawDescGZIP(), []int{19}\n}", "title": "" }, { "docid": "82f4259e40aa17510c9c441ff3369f39", "score": "0.6359639", "text": "func (*GetCLResponse) Descriptor() ([]byte, []int) {\n\treturn file_go_chromium_org_luci_cv_internal_admin_api_admin_proto_rawDescGZIP(), []int{8}\n}", "title": "" }, { "docid": "652da5ca00640637ff7787ba3d41bec9", "score": "0.635616", "text": "func (x *fastReflection_GetQueryServicesDescriptorResponse) Descriptor() protoreflect.MessageDescriptor {\n\treturn md_GetQueryServicesDescriptorResponse\n}", "title": "" }, { "docid": "936bda3bc579ec0ee6864b469ceda05b", "score": "0.63547444", "text": "func (*AppDescriptor) Descriptor() ([]byte, []int) {\n\treturn file_cosmos_base_reflection_v2alpha1_reflection_proto_rawDescGZIP(), []int{0}\n}", "title": "" }, { "docid": "a0712d43419957312b7db2ffa8311a8b", "score": "0.6352027", "text": "func (*GetPrivateConnectionRequest) Descriptor() ([]byte, []int) {\n\treturn file_google_cloud_vmwareengine_v1_vmwareengine_proto_rawDescGZIP(), []int{42}\n}", "title": "" }, { "docid": "0ea406287f5ff3f576a7b9e42010fbab", "score": "0.63515836", "text": "func (*GetAdditionalDatanodeResponseProto) Descriptor() ([]byte, []int) {\n\treturn file_ClientNamenodeProtocol_proto_rawDescGZIP(), []int{27}\n}", "title": "" }, { "docid": "aeeaab90ac76113ba35af18c4c5aaa83", "score": "0.6348359", "text": "func (*ChainDescriptor) Descriptor() ([]byte, []int) {\n\treturn file_cosmos_base_reflection_v2alpha1_reflection_proto_rawDescGZIP(), []int{4}\n}", "title": "" }, { "docid": "4a5e7315f33a7833ea12caa853a8b636", "score": "0.6335277", "text": "func (x *fastReflection_MsgDescriptor) Descriptor() protoreflect.MessageDescriptor {\n\treturn md_MsgDescriptor\n}", "title": "" }, { "docid": "d883985907ccbe48db994a2ccd73539e", "score": "0.6335209", "text": "func (*CodecDescriptor) Descriptor() ([]byte, []int) {\n\treturn file_cosmos_base_reflection_v2alpha1_reflection_proto_rawDescGZIP(), []int{5}\n}", "title": "" }, { "docid": "ebb6811662e43a551714907b2bea799f", "score": "0.6327634", "text": "func (*GetHostResp) Descriptor() ([]byte, []int) {\n\treturn file_devicestatus_devicestatus_proto_rawDescGZIP(), []int{1}\n}", "title": "" }, { "docid": "37b966986237ea6d2991e7e564c6f6b5", "score": "0.6321385", "text": "func (*GetQuotaUsageResponseProto) Descriptor() ([]byte, []int) {\n\treturn file_ClientNamenodeProtocol_proto_rawDescGZIP(), []int{126}\n}", "title": "" }, { "docid": "7c676d08106b70720d1f729fde252d86", "score": "0.6321189", "text": "func (x *fastReflection_GetCodecDescriptorRequest) Get(descriptor protoreflect.FieldDescriptor) protoreflect.Value {\n\tswitch descriptor.FullName() {\n\tdefault:\n\t\tif descriptor.IsExtension() {\n\t\t\tpanic(fmt.Errorf(\"proto3 declared messages do not support extensions: cosmos.base.reflection.v2alpha1.GetCodecDescriptorRequest\"))\n\t\t}\n\t\tpanic(fmt.Errorf(\"message cosmos.base.reflection.v2alpha1.GetCodecDescriptorRequest does not contain field %s\", descriptor.FullName()))\n\t}\n}", "title": "" }, { "docid": "4b0df84d9bfdd3784de26df6cec0b482", "score": "0.63181245", "text": "func (*GetConfigurationDescriptorRequest) Descriptor() ([]byte, []int) {\n\treturn file_cosmos_base_reflection_v2alpha1_reflection_proto_rawDescGZIP(), []int{17}\n}", "title": "" }, { "docid": "ba2e4c730c4ae06a9a16323112136cf2", "score": "0.63178265", "text": "func (x *fastReflection_GetCodecDescriptorResponse) Mutable(fd protoreflect.FieldDescriptor) protoreflect.Value {\n\tswitch fd.FullName() {\n\tcase \"cosmos.base.reflection.v2alpha1.GetCodecDescriptorResponse.codec\":\n\t\tif x.Codec == nil {\n\t\t\tx.Codec = new(CodecDescriptor)\n\t\t}\n\t\treturn protoreflect.ValueOfMessage(x.Codec.ProtoReflect())\n\tdefault:\n\t\tif fd.IsExtension() {\n\t\t\tpanic(fmt.Errorf(\"proto3 declared messages do not support extensions: cosmos.base.reflection.v2alpha1.GetCodecDescriptorResponse\"))\n\t\t}\n\t\tpanic(fmt.Errorf(\"message cosmos.base.reflection.v2alpha1.GetCodecDescriptorResponse does not contain field %s\", fd.FullName()))\n\t}\n}", "title": "" }, { "docid": "ba2078838fadafcd536f8ebc120ae0b0", "score": "0.63130766", "text": "func (*SystemQueryResp) Descriptor() ([]byte, []int) {\n\treturn file_mgmt_system_proto_rawDescGZIP(), []int{8}\n}", "title": "" }, { "docid": "2175903355259e2505bb0af06facf222", "score": "0.6312059", "text": "func (*RemoveCacheDirectiveRequestProto) Descriptor() ([]byte, []int) {\n\treturn file_ClientNamenodeProtocol_proto_rawDescGZIP(), []int{105}\n}", "title": "" }, { "docid": "e67734f7b6d593ac8745a319a071cea5", "score": "0.63114405", "text": "func (*GetHostReq) Descriptor() ([]byte, []int) {\n\treturn file_devicestatus_devicestatus_proto_rawDescGZIP(), []int{0}\n}", "title": "" }, { "docid": "f33fab082288fad8ef34daf7d264b549", "score": "0.6301096", "text": "func (*InterfaceAcceptingMessageDescriptor) Descriptor() ([]byte, []int) {\n\treturn file_cosmos_base_reflection_v2alpha1_reflection_proto_rawDescGZIP(), []int{8}\n}", "title": "" }, { "docid": "b18cc33f83330ae6cd624204123a7566", "score": "0.6295258", "text": "func (x *fastReflection_GetCodecDescriptorResponse) Descriptor() protoreflect.MessageDescriptor {\n\treturn md_GetCodecDescriptorResponse\n}", "title": "" }, { "docid": "7774ab7653dad1b638335759042ffadb", "score": "0.62949294", "text": "func (*GetPrivateCloudRequest) Descriptor() ([]byte, []int) {\n\treturn file_google_cloud_vmwareengine_v1_vmwareengine_proto_rawDescGZIP(), []int{2}\n}", "title": "" }, { "docid": "5a1a1190a72ea6a550695e50a397e2ce", "score": "0.6292158", "text": "func (*GetConfigurationDescriptorResponse) Descriptor() ([]byte, []int) {\n\treturn file_cosmos_base_reflection_v2alpha1_reflection_proto_rawDescGZIP(), []int{18}\n}", "title": "" }, { "docid": "9cef1e61a17bbca7872e982e7be44241", "score": "0.6288617", "text": "func (*ConfigRequest_V1_System) Descriptor() ([]byte, []int) {\n\treturn file_config_notifications_config_request_proto_rawDescGZIP(), []int{0, 0, 0}\n}", "title": "" }, { "docid": "765a0eaa9b27399c294c0b6f6ef8d821", "score": "0.62861526", "text": "func (*DeleteMetricDescriptorRequest) Descriptor() ([]byte, []int) {\n\treturn edgelq_monitoring_proto_v3_metric_descriptor_custom_proto_rawDescGZIP(), []int{4}\n}", "title": "" }, { "docid": "8a6411e6ddf517c258cbd2798397aadc", "score": "0.62830096", "text": "func (x *fastReflection_ResponseInfo) Descriptor() protoreflect.MessageDescriptor {\n\treturn md_ResponseInfo\n}", "title": "" }, { "docid": "c47076e34704cf11c60e25b3f7db74ce", "score": "0.6281227", "text": "func (x *fastReflection_GetQueryServicesDescriptorRequest) Get(descriptor protoreflect.FieldDescriptor) protoreflect.Value {\n\tswitch descriptor.FullName() {\n\tdefault:\n\t\tif descriptor.IsExtension() {\n\t\t\tpanic(fmt.Errorf(\"proto3 declared messages do not support extensions: cosmos.base.reflection.v2alpha1.GetQueryServicesDescriptorRequest\"))\n\t\t}\n\t\tpanic(fmt.Errorf(\"message cosmos.base.reflection.v2alpha1.GetQueryServicesDescriptorRequest does not contain field %s\", descriptor.FullName()))\n\t}\n}", "title": "" }, { "docid": "bcc93f8b423107071836abada7b4598b", "score": "0.6279783", "text": "func (x *fastReflection_RequestInfo) Descriptor() protoreflect.MessageDescriptor {\n\treturn md_RequestInfo\n}", "title": "" }, { "docid": "298fdd3f762e94e9e4089d457b3bb410", "score": "0.6277011", "text": "func (*GetDeviceRequest) Descriptor() ([]byte, []int) {\n\treturn file_api_proto_rawDescGZIP(), []int{51}\n}", "title": "" }, { "docid": "426829f830e13aa086abb3d4726c500d", "score": "0.6276357", "text": "func (*RspSystemMsgAction) Descriptor() ([]byte, []int) {\n\treturn file_structmsg_proto_rawDescGZIP(), []int{14}\n}", "title": "" }, { "docid": "6bff7a72f2dcbffb1dfb964753fcbaed", "score": "0.62760884", "text": "func (*ReqSystemMsgAction) Descriptor() ([]byte, []int) {\n\treturn file_structmsg_proto_rawDescGZIP(), []int{8}\n}", "title": "" }, { "docid": "bb417dc0de830df9f64f24febaf598f2", "score": "0.6274659", "text": "func (*RspSystemMsgNew) Descriptor() ([]byte, []int) {\n\treturn file_structmsg_proto_rawDescGZIP(), []int{15}\n}", "title": "" }, { "docid": "f3c86acdc9a0b4fd678b3785d71ce80a", "score": "0.6274434", "text": "func (*MachineAttribute) Descriptor() ([]byte, []int) {\n\treturn file_clusterdata_trace_format_v3_proto_rawDescGZIP(), []int{5}\n}", "title": "" }, { "docid": "802e4bfde546a6d508600f891ea28765", "score": "0.62687224", "text": "func (*GetLinkTargetResponseProto) Descriptor() ([]byte, []int) {\n\treturn file_ClientNamenodeProtocol_proto_rawDescGZIP(), []int{136}\n}", "title": "" }, { "docid": "c3cb72fbfeef706b6838e0d79fb1ae7b", "score": "0.62650967", "text": "func (*SystemStopReq) Descriptor() ([]byte, []int) {\n\treturn file_mgmt_system_proto_rawDescGZIP(), []int{1}\n}", "title": "" }, { "docid": "9ce506a00c6f79cb9111b5e4c812eb04", "score": "0.62612736", "text": "func (*GetNodeRequest) Descriptor() ([]byte, []int) {\n\treturn file_lightbits_api_duros_v2_durosapiv2_proto_rawDescGZIP(), []int{43}\n}", "title": "" }, { "docid": "b5c90429a6d359dc0273ee6e78dfc1a5", "score": "0.6259767", "text": "func (*ListMetricDescriptorsRequest) Descriptor() ([]byte, []int) {\n\treturn edgelq_monitoring_proto_v3_metric_descriptor_custom_proto_rawDescGZIP(), []int{0}\n}", "title": "" }, { "docid": "d45c8087eecdc46f0d1c5505fb6edbdc", "score": "0.62596995", "text": "func (*GetStoredMnemonicResponse) Descriptor() ([]byte, []int) {\n\treturn file_space_proto_rawDescGZIP(), []int{19}\n}", "title": "" }, { "docid": "4fbc6849c98c52ca532a7660ae84f695", "score": "0.6259505", "text": "func (x *fastReflection_GetChainDescriptorRequest) Descriptor() protoreflect.MessageDescriptor {\n\treturn md_GetChainDescriptorRequest\n}", "title": "" }, { "docid": "499ddf4e2a9574577adabe909602ddaa", "score": "0.62590873", "text": "func (*GetFsStatsResponseProto) Descriptor() ([]byte, []int) {\n\treturn file_ClientNamenodeProtocol_proto_rawDescGZIP(), []int{59}\n}", "title": "" }, { "docid": "ca15d665ed02fa24b4fba30c69f86151", "score": "0.62545246", "text": "func (*DescribeRequest) Descriptor() ([]byte, []int) {\n\treturn file_proto_udfmanager_proto_rawDescGZIP(), []int{5}\n}", "title": "" }, { "docid": "c159cf33e610c267b0777b29c6122f65", "score": "0.6252143", "text": "func (*GetDetailRequest) Descriptor() ([]byte, []int) {\n\treturn file_pkg_pr12er_service_proto_rawDescGZIP(), []int{5}\n}", "title": "" }, { "docid": "8ac8a7a80243a46d125918746911723c", "score": "0.62503815", "text": "func (*SystemQueryReq) Descriptor() ([]byte, []int) {\n\treturn file_mgmt_system_proto_rawDescGZIP(), []int{7}\n}", "title": "" }, { "docid": "2dde4d211dbafbc84567bcda3dc725c7", "score": "0.6249135", "text": "func (*UpdatePrivateCloudRequest) Descriptor() ([]byte, []int) {\n\treturn file_google_cloud_vmwareengine_v1_vmwareengine_proto_rawDescGZIP(), []int{4}\n}", "title": "" }, { "docid": "18e8501b4c216edd943b6dd1646d6045", "score": "0.62463415", "text": "func (*InfoResp) Descriptor() ([]byte, []int) {\n\treturn file_api_front_admin_v1_sys_proto_rawDescGZIP(), []int{3}\n}", "title": "" }, { "docid": "31cf0a86adb96f8e8fa705839a47f9a1", "score": "0.6244915", "text": "func (*UnlinkDeviceRequest) Descriptor() ([]byte, []int) {\n\treturn file_console_proto_rawDescGZIP(), []int{14}\n}", "title": "" }, { "docid": "70af20df5a8eb9b268614830097df46c", "score": "0.6244475", "text": "func (*CMsgDOTAPeriodicResourceUpdated) Descriptor() ([]byte, []int) {\n\treturn file_dota_gcmessages_client_proto_rawDescGZIP(), []int{62}\n}", "title": "" }, { "docid": "7e4f7a1a7414feac33e90c128749ee17", "score": "0.6243526", "text": "func (*AddCacheDirectiveRequestProto) Descriptor() ([]byte, []int) {\n\treturn file_ClientNamenodeProtocol_proto_rawDescGZIP(), []int{101}\n}", "title": "" }, { "docid": "44602e439d706cbe8649e2af8518a305", "score": "0.6241826", "text": "func (*ListCacheDirectivesResponseProto) Descriptor() ([]byte, []int) {\n\treturn file_ClientNamenodeProtocol_proto_rawDescGZIP(), []int{109}\n}", "title": "" }, { "docid": "c88a945a2b4d6e1ee9af2ec7925973f2", "score": "0.6241012", "text": "func (*GetPersonRequest) Descriptor() ([]byte, []int) {\n\treturn file_person_reqmsgs_proto_rawDescGZIP(), []int{3}\n}", "title": "" }, { "docid": "a21f687e142b8951b5cb23e70e824ad8", "score": "0.62374395", "text": "func (*UpdatePrivateConnectionRequest) Descriptor() ([]byte, []int) {\n\treturn file_google_cloud_vmwareengine_v1_vmwareengine_proto_rawDescGZIP(), []int{45}\n}", "title": "" }, { "docid": "9d748997cb3eca67ab017185ecfde535", "score": "0.6231942", "text": "func (*PApiMetaData) Descriptor() ([]byte, []int) {\n\treturn file_v1_Span_proto_rawDescGZIP(), []int{14}\n}", "title": "" }, { "docid": "091828d044f1b4c88c564d229dd1bc80", "score": "0.62314266", "text": "func (*ConfigRequest_V1_System) Descriptor() ([]byte, []int) {\n\treturn file_config_dex_config_request_proto_rawDescGZIP(), []int{0, 0, 0}\n}", "title": "" }, { "docid": "f8d08db7c25d10b1b3090ee6551447d0", "score": "0.6227456", "text": "func (*CacheDirectiveStatsProto) Descriptor() ([]byte, []int) {\n\treturn file_ClientNamenodeProtocol_proto_rawDescGZIP(), []int{100}\n}", "title": "" }, { "docid": "5c6dbfd0c7b58aa763ecb1b82228a9f2", "score": "0.6227212", "text": "func (*MsgRevokeResponse) Descriptor() ([]byte, []int) {\n\treturn file_cosmos_authz_v1beta1_tx_proto_rawDescGZIP(), []int{5}\n}", "title": "" }, { "docid": "2081b9b99a5f456f0cf22ec370c64285", "score": "0.62266284", "text": "func (*GetDatanodeReportResponseProto) Descriptor() ([]byte, []int) {\n\treturn file_ClientNamenodeProtocol_proto_rawDescGZIP(), []int{65}\n}", "title": "" } ]
8ed933b0afe2306627ad6367f1945abd
NewSignals creates a new SignalSelecter that listens for operating system signals that you specify, such as SIGINT, SIGHUP, SIGTERM, etc.
[ { "docid": "de0a04f60409524b12fe596e11b3c3cd", "score": "0.6848299", "text": "func NewSignals(signalsAndActions map[os.Signal]GracefulAction) *Signals {\n\ts := &Signals{\n\t\t// opting for size 2 to ensure that the os.Notify does not block\n\t\tsignalChan: make(chan os.Signal, 2),\n\t\t// actions allows users to specify how they want to handle signals\n\t\tactions: signalsAndActions,\n\t\tBaseSignaler: NewBaseSignaler(),\n\t}\n\n\t// Extract signals\n\tsigs := make([]os.Signal, 0, len(signalsAndActions))\n\tfor key := range signalsAndActions {\n\t\tsigs = append(sigs, key)\n\t}\n\n\t// Listen for those signals\n\tsignal.Notify(s.signalChan, sigs...)\n\n\t// Listen for signals\n\t// This goroutine will wait for signals to come in from the OS, look up what to do from the map then signal to the\n\t// ServiceManager what it needs to do.\n\tgo func(routineSig *Signals) {\n\t\tfor {\n\t\t\tselect {\n\t\t\tcase gotSignal := <-routineSig.signalChan:\n\t\t\t\t// Operating system sent us an error\n\t\t\t\troutineSig.OnSignal <- func(manager *ServiceManager) GracefulAction {\n\t\t\t\t\treturn routineSig.actions[gotSignal]\n\t\t\t\t}\n\t\t\tcase <-routineSig.OnCancel:\n\t\t\t\t// We got a OnCancel, end the loop to prevent go routine from leaking\n\t\t\t\treturn\n\t\t\t}\n\t\t}\n\t}(s)\n\treturn s\n}", "title": "" } ]
[ { "docid": "f0f1bce7ed032a898879fc56cdc00bd7", "score": "0.7004386", "text": "func NewSignal(signals ...os.Signal) *Signal {\n\tsig := &Signal{\n\t\tc: make(chan os.Signal),\n\t}\n\tsignal.Notify(sig.c, signals...)\n\treturn sig\n}", "title": "" }, { "docid": "016011d8d3dbe38de66b90e1a6ee1585", "score": "0.61553526", "text": "func listenSignals() {\n\tsigChan := make(chan os.Signal, 1)\n\tsignal.Notify(sigChan, syscall.SIGINT, syscall.SIGTERM, syscall.SIGQUIT)\n\n\tgo handleSignals(sigChan)\n}", "title": "" }, { "docid": "644c39ad2ecc1f1732017868d970e927", "score": "0.6024177", "text": "func New() SignalHandler {\n\th := &handler{\n\t\tincoming: make(chan os.Signal, 20),\n\t\tfuncs: make(map[os.Signal][]func()),\n\t\tstop: make(chan struct{}),\n\t}\n\tgo h.listen()\n\treturn h\n}", "title": "" }, { "docid": "03244a050d08806ee8aa1de647854c9f", "score": "0.59782517", "text": "func ServeSignals() (err error) {\n\tif len(handlers) == 0 {\n\t\tsetupSignals()\n\t}\n\tif len(handlers) == 0 {\n\t\treturn // no handlers, skip the os signal listening\n\t}\n\n\t// syscall.Getenv()\n\tsignals := makeHandlers()\n\n\t// defer func() {\n\t// \tremovePID(ctx)\n\t// }()\n\t//\n\t// log.Printf(\"serve signals ... pid: %v in %v\", os.Getpid(), ctx.PidFileName)\n\n\tch := make(chan os.Signal, 8)\n\tsignal.Notify(ch, signals...)\n\n\tfor sig := range ch {\n\t\tlog.Printf(\".. signal caught: %v\", sig)\n\t\terr = handlers[sig](sig)\n\t\tif err != nil {\n\t\t\tbreak\n\t\t}\n\t}\n\n\tsignal.Stop(ch)\n\n\tif err == ErrStop {\n\t\terr = nil\n\t}\n\n\treturn\n}", "title": "" }, { "docid": "58c86426355713f24fe9ee51e589c789", "score": "0.587345", "text": "func PosixSignalsAdapter() AdapterFunc {\n\treturn signalsAdapter(make(chan os.Signal))\n}", "title": "" }, { "docid": "1a886a4d2da6d28e01680715f56cf319", "score": "0.58619475", "text": "func listenSignals() {\n\tsc := make(chan os.Signal, 2)\n\tsignal.Notify(sc, os.Interrupt, syscall.SIGTERM)\n\tgo func() {\n\t\tswitch <-sc {\n\t\tcase os.Interrupt:\n\t\t\tlog.Warn(\"Interrupt signal received\")\n\t\tcase syscall.SIGTERM:\n\t\t\tlog.Warn(\"Termination signal received\")\n\t\t}\n\t\tShutdown()\n\t}()\n}", "title": "" }, { "docid": "a24382a90ceafa2870c820f02daa20be", "score": "0.58513963", "text": "func DefaultSignals() *Signals {\n\treturn NewSignals(defaultSignals)\n}", "title": "" }, { "docid": "4d965f693ca226fa181989a68d007dea", "score": "0.57971907", "text": "func onSignals(log api.Logger, cancel context.CancelFunc) {\n\tgo func() {\n\t\tmsg := \"Received operating system signal: %s\"\n\n\t\tsigTerm := make(chan os.Signal, 1)\n\t\tsignal.Notify(sigTerm, unix.SIGTERM)\n\t\tsigInt := make(chan os.Signal, 1)\n\t\tsignal.Notify(sigInt, unix.SIGINT)\n\n\t\tselect {\n\t\tcase s := <-sigInt:\n\t\t\tlog.Printf(msg, s.String())\n\t\tcase s := <-sigTerm:\n\t\t\tlog.Printf(msg, s.String())\n\t\t}\n\t\tcancel()\n\n\t\ts := <-sigInt\n\t\tlog.Printf(msg, s.String())\n\t\tlog.Printf(\"Process aborted\")\n\t\tos.Exit(1)\n\t}()\n}", "title": "" }, { "docid": "e877099bc13d51c94636380b66b34039", "score": "0.5754359", "text": "func SetupSignals(log logger.Logger, cancel, cleanup func()) {\n\tsignals := make(chan os.Signal, 5)\n\tsignal.Notify(signals, os.Interrupt, syscall.SIGHUP, syscall.SIGQUIT, syscall.SIGTERM)\n\tgo handleSignals(signals, log, cancel, cleanup)\n}", "title": "" }, { "docid": "5898fccec88ffae6276d7048f96e1f23", "score": "0.572061", "text": "func (a *App) registerSignals() {\n\t// *nix systems support SIGTERM so handle shutdown on that too\n\tsignal.Notify(a.signalChan, os.Interrupt, syscall.SIGTERM)\n\n\t// *nix has SIGHUP for reload\n\tsignal.Notify(a.signalChan, syscall.SIGHUP)\n}", "title": "" }, { "docid": "c3791244643161c7f386d5f19e38e089", "score": "0.5715897", "text": "func toSignal(signalName string) os.Signal {\n\tif signalName == \"HUP\" {\n\t\treturn syscall.SIGHUP\n\t} else if signalName == \"INT\" {\n\t\treturn syscall.SIGINT\n\t} else if signalName == \"QUIT\" {\n\t\treturn syscall.SIGQUIT\n\t} else if signalName == \"KILL\" {\n\t\treturn syscall.SIGKILL\n\t} else if signalName == \"USR1\" {\n\t\treturn syscall.SIGUSR1\n\t} else if signalName == \"USR2\" {\n\t\treturn syscall.SIGUSR2\n\t} else {\n\t\treturn syscall.SIGTERM\n\t}\n\n}", "title": "" }, { "docid": "272e3573abbb8a3a84ea9dcb4151e2db", "score": "0.5711119", "text": "func toSignal(signalName string) os.Signal {\n\tif signalName == \"HUP\" {\n\t\treturn syscall.SIGHUP\n\t} else if signalName == \"INT\" {\n\t\treturn syscall.SIGINT\n\t} else if signalName == \"QUIT\" {\n\t\treturn syscall.SIGQUIT\n\t} else if signalName == \"KILL\" {\n\t\treturn syscall.SIGKILL\n\t} else if signalName == \"USR1\" {\n\t\treturn syscall.SIGUSR1\n\t} else if signalName == \"USR2\" {\n\t\treturn syscall.SIGUSR2\n\t} else {\n\t\treturn syscall.SIGTERM\n\n\t}\n\n}", "title": "" }, { "docid": "21f9aeb1999d1043745ffe35b3002c24", "score": "0.57101953", "text": "func ServeSignals(ctx *Context) (err error) {\n\tif len(handlers) == 0 {\n\t\tsetupSignals(ctx)\n\t}\n\tif len(handlers) == 0 {\n\t\treturn // no handlers, skip the os signal listening\n\t}\n\n\t// syscall.Getenv()\n\tsignals := makeHandlers()\n\n\tdefer func() {\n\t\tremovePID(ctx)\n\t}()\n\n\tlog.Printf(\"serve signals ... pid: %v in %v\", os.Getpid(), ctx.PidFileName)\n\tch := make(chan os.Signal, 8)\n\tsignal.Notify(ch, signals...)\n\n\tfor sig := range ch {\n\t\tlog.Printf(\".. signal caught: %v\", sig)\n\t\terr = handlers[sig](sig)\n\t\tif err != nil {\n\t\t\tbreak\n\t\t}\n\t}\n\n\tsignal.Stop(ch)\n\n\tif err == ErrStop {\n\t\terr = nil\n\t}\n\n\treturn\n}", "title": "" }, { "docid": "411d50a0d374f4b4ea7d485c3e272582", "score": "0.56244636", "text": "func (ns *NodeSession) watchSignals(shell io.Writer) {\n\texitSignals := make(chan os.Signal, 1)\n\t// catch SIGTERM\n\tsignal.Notify(exitSignals, syscall.SIGTERM)\n\tgo func() {\n\t\tdefer ns.closer.Close()\n\t\t<-exitSignals\n\t}()\n\t// Catch Ctrl-C signal\n\tctrlCSignal := make(chan os.Signal, 1)\n\tsignal.Notify(ctrlCSignal, syscall.SIGINT)\n\tgo func() {\n\t\tfor {\n\t\t\t<-ctrlCSignal\n\t\t\t_, err := shell.Write([]byte{3})\n\t\t\tif err != nil {\n\t\t\t\tlog.Errorf(err.Error())\n\t\t\t}\n\t\t}\n\t}()\n\t// Catch Ctrl-Z signal\n\tctrlZSignal := make(chan os.Signal, 1)\n\tsignal.Notify(ctrlZSignal, syscall.SIGTSTP)\n\tgo func() {\n\t\tfor {\n\t\t\t<-ctrlZSignal\n\t\t\t_, err := shell.Write([]byte{26})\n\t\t\tif err != nil {\n\t\t\t\tlog.Errorf(err.Error())\n\t\t\t}\n\t\t}\n\t}()\n}", "title": "" }, { "docid": "8709ee0841e0b5504e7bee6e1980f062", "score": "0.5601776", "text": "func main() {\n\tsignals := make(chan os.Signal, 1)\n\t// catch SIGINT(Ctrl+C), KILL signal\n\tsignal.Notify(signals, syscall.SIGINT, syscall.SIGTERM)\n\tfmt.Println(\"waiting SIGNAL\")\n\t<-signals\n\tfmt.Println(\"catch SIGNAL\")\n\tos.Exit(0)\n}", "title": "" }, { "docid": "1b25afe3e30fd96d2d59aa07c4a5e062", "score": "0.5588195", "text": "func NewSignaler() *Signaler {\n\treturn &Signaler{C: make(chan struct{})}\n}", "title": "" }, { "docid": "49b02d43ac5e4cb6069e35056fd02b4b", "score": "0.55859584", "text": "func (c *Component) New(ctx context.Context, conf *Config) (Signal, error) {\n\tsigs := make([]Signal, 0, len(conf.Installed))\n\tfor _, installed := range conf.Installed {\n\t\tswitch {\n\t\tcase strings.EqualFold(installed, \"OS\"):\n\t\t\tsig, err := c.OS.New(ctx, conf.OS)\n\t\t\tif err != nil {\n\t\t\t\treturn nil, err\n\t\t\t}\n\t\t\tsigs = append(sigs, sig)\n\t\tdefault:\n\t\t\treturn nil, fmt.Errorf(\"unknown installed signal type %s\", installed)\n\t\t}\n\t}\n\treturn fanIn(sigs), nil\n}", "title": "" }, { "docid": "115c9f4ae2281ac606177e628a006b8d", "score": "0.5518384", "text": "func createSignalHandler() (stopCh <-chan struct{}) {\n\tstop := make(chan struct{})\n\tc := make(chan os.Signal, 2)\n\tsignal.Notify(c, syscall.SIGINT, syscall.SIGTERM)\n\tgo func() {\n\t\tsig := <-c\n\t\tfmt.Printf(\"Signal handler: received signal %s\\n\", sig)\n\t\tclose(stop)\n\t}()\n\treturn stop\n}", "title": "" }, { "docid": "a6a2d907942bf3e5d5388d7b686adec4", "score": "0.55041516", "text": "func listenToSystemSignals() {\n\tsignalChan := make(chan os.Signal, 1)\n\tcode := 0\n\n\tsignal.Notify(signalChan, os.Interrupt)\n\tsignal.Notify(signalChan, os.Kill)\n\tsignal.Notify(signalChan, syscall.SIGTERM)\n\n\tselect {\n\tcase sig := <-signalChan:\n\t\tlog.Info(\"Received signal %s. shutting down\", sig)\n\tcase code = <-exitChan:\n\t\tswitch code {\n\t\tcase 0:\n\t\t\tlog.Info(\"Shutting down\")\n\t\tdefault:\n\t\t\tlog.Warn(\"Shutting down\")\n\t\t}\n\t}\n\tlog.Close()\n\tos.Exit(code)\n}", "title": "" }, { "docid": "2a0033b078df3f7d1379f9818991013a", "score": "0.5499595", "text": "func NewSignal(signal_type string, target string) *Signal {\n\treturn &Signal{\n\t\tSignalType: signal_type,\n\t\tTarget: target,\n\t}\n}", "title": "" }, { "docid": "7ac6094c995ee85319b26ad524bfe325", "score": "0.5473068", "text": "func setupSignals(rs resolvers.ApiResolver, log logger.Logger) {\n\t// log what we do\n\tlog.Info(\"os signals captured\")\n\n\t// make the signal consumer\n\tts := make(chan os.Signal, 1)\n\tsignal.Notify(ts, syscall.SIGINT, syscall.SIGTERM)\n\n\t// start monitoring\n\tgo func() {\n\t\t// wait for the signal\n\t\t<-ts\n\n\t\t// log nad close repository\n\t\tlog.Notice(\"server is terminating\")\n\t\tif repo := repository.R(); repo != nil {\n\t\t\trepo.Close()\n\t\t}\n\n\t\t// close resolvers\n\t\trs.Close()\n\n\t\t// we are done\n\t\tlog.Info(\"done\")\n\t\tos.Exit(0)\n\t}()\n}", "title": "" }, { "docid": "ef7b1f7537205cbe6b6ab547c99d1fa7", "score": "0.5462454", "text": "func getOnExitSignals() []os.Signal {\n\treturn []os.Signal{syscall.SIGUSR1, syscall.SIGINT, syscall.SIGTERM}\n}", "title": "" }, { "docid": "e3f0f82dc6d28f4a54e03bfd5700a446", "score": "0.54248", "text": "func GetSignals() []os.Signal {\n\treturn []os.Signal{os.Interrupt}\n}", "title": "" }, { "docid": "16c84222c76f7fce80a9eef5e72eb12d", "score": "0.54212934", "text": "func NewSignalSource(sigs ...os.Signal) SignalSource {\n\treturn &signalSource{sigs, nil}\n}", "title": "" }, { "docid": "9743ab2f13957ca8e7bcc0d6b77cd858", "score": "0.53830904", "text": "func (*OSComponent) New(_ context.Context, conf *OSConfig) (Signal, error) {\n\tsigs := make([]os.Signal, 0, len(conf.Signals))\n\tfor _, sig := range conf.Signals {\n\t\tsigs = append(sigs, syscall.Signal(sig))\n\t}\n\treturn osSignal(sigs), nil\n}", "title": "" }, { "docid": "2efdc853bbbde83637c309cb015f2230", "score": "0.53741735", "text": "func (wi *Instance) InstallSignalHandlers() {\n\tsigChan := make(chan os.Signal, 1)\n\tsignal.Notify(sigChan, syscall.SIGTERM, syscall.SIGINT)\n\tgo func() {\n\t\tfor s := range sigChan {\n\t\t\t// We got a signal, notify our modules.\n\t\t\t// Use an extra function to properly unlock using defer.\n\t\t\tfunc() {\n\t\t\t\twi.currentWorkerMutex.Lock()\n\t\t\t\tdefer wi.currentWorkerMutex.Unlock()\n\t\t\t\tif wi.currentCancelFunc != nil {\n\t\t\t\t\tlog.Infof(\"Trying to cancel current worker after receiving signal: %v\", s)\n\t\t\t\t\twi.currentCancelFunc()\n\t\t\t\t} else {\n\t\t\t\t\tlog.Infof(\"Shutting down idle worker after receiving signal: %v\", s)\n\t\t\t\t\tos.Exit(0)\n\t\t\t\t}\n\t\t\t}()\n\t\t}\n\t}()\n}", "title": "" }, { "docid": "d990ca03b7595a48867ce44f643610b7", "score": "0.5333383", "text": "func mysighandler(sig int) int {\n println(\"signal $sig\")\n return 0\n}", "title": "" }, { "docid": "578d2186d753fe1771e13a96080a8a20", "score": "0.5329907", "text": "func New(opts ...Option) IOsignal {\n\tosignal := new(Osignal)\n\tfor _, opt := range opts {\n\t\topt(osignal)\n\t}\n\treturn osignal\n}", "title": "" }, { "docid": "6c14e368e7d44eafbc5e159602dee9a3", "score": "0.5320127", "text": "func New(name string) *Signal {\n\tif name == \"\" {\n\t\t// Create a unique signal each time for anonymous signals.\n\t\treturn &Signal{name: name}\n\t}\n\n\t// Try to find the named signal from registry.\n\tsig, ok := registry.Load(name)\n\tif !ok {\n\t\t// Not found.\n\t\t//\n\t\t// Find or register the named signal atomically. We re-try to find\n\t\t// it first since it may have been set by others concurrently.\n\t\tsig, _ = registry.LoadOrStore(name, &Signal{name: name})\n\t}\n\n\treturn sig.(*Signal)\n}", "title": "" }, { "docid": "aeec716243414cf32ae19d4583461e1c", "score": "0.53018385", "text": "func sighalt() <-chan os.Signal {\n\tinterrupts := make(chan os.Signal, 1)\n\tsignal.Notify(interrupts, os.Interrupt, syscall.SIGQUIT, syscall.SIGTERM)\n\treturn interrupts\n}", "title": "" }, { "docid": "1f72e5be9a667aaebe177c3357d6ea91", "score": "0.52768695", "text": "func handleSignals(c chan os.Signal) {\n\tlog.Print(\"Notice: System signal monitoring is enabled(watch: SIGINT,SIGTERM,SIGQUIT)\\n\")\n\n\tswitch <-c {\n\tcase syscall.SIGINT:\n\t\tfmt.Println(\"\\nShutdown by Ctrl+C\")\n\tcase syscall.SIGTERM: // by kill\n\t\tfmt.Println(\"\\nShutdown quickly\")\n\tcase syscall.SIGQUIT:\n\t\tfmt.Println(\"\\nShutdown gracefully\")\n\t\t// do graceful shutdown\n\t}\n\n\t// sync logs\n\tLogger.Sync()\n\n\t// unregister from eureka\n\terkServer.Unregister()\n\n\t// 等待一秒\n\ttime.Sleep(1e9 / 2)\n\tfmt.Println(\"\\nBye...\")\n\n\tos.Exit(0)\n}", "title": "" }, { "docid": "1ededa71eb5b405e525584584dd9a4df", "score": "0.5262517", "text": "func sendSignals() {\n\t/* Save for later ... sorting */\n\tvar priorities []int\n\n\t/* Get our priority list */\n\tfor priority, _ := range registers {\n\t\tpriorities = append(priorities, priority)\n\t}\n\n\t/* Make sure we sort them in numerical order */\n\tsort.Ints(priorities)\n\n\t/* Go through each of them and send the shutdown signal */\n\tfor _, priority := range priorities {\n\t\tfor x := 0; x < registers[priority]; x++ {\n\t\t\tshutdown[priority] <- true\n\t\t}\n\t\tfor x := 0; x < registers[priority]; x++ {\n\t\t\t<-waiting[priority]\n\t\t}\n\t}\n}", "title": "" }, { "docid": "5fb30e7f1d80e444f27e54838ee9115c", "score": "0.52464974", "text": "func (app *App) acceptSignals() <-chan error {\n\tc := make(chan error)\n\tgo func() {\n\t\tsc := make(chan os.Signal)\n\t\tsignal.Notify(sc, syscall.SIGINT, syscall.SIGHUP, syscall.SIGTERM)\n\t\tsig := <-sc\n\t\tswitch sig {\n\t\tcase syscall.SIGHUP:\n\t\t\tif err := app.reload(); err != nil {\n\t\t\t\tc <- fmt.Errorf(\"app closed unexpectedly for reload failed. error:%s\", err.Error())\n\t\t\t}\n\t\tcase syscall.SIGTERM:\n\t\t\t{\n\t\t\t\tif err := app.quit(); err != nil {\n\t\t\t\t\tc <- fmt.Errorf(\"app recevied signal:%s, but quit failed. error:%s\", sig.String(), err.Error())\n\t\t\t\t} else {\n\t\t\t\t\tc <- fmt.Errorf(\"app closed gracefully for receiving signal:%s\", sig.String())\n\t\t\t\t}\n\t\t\t}\n\t\tcase syscall.SIGINT:\n\t\t\tc <- fmt.Errorf(\"app closed unexpectedly for receiving signal:%s\", sig.String())\n\t\t}\n\t}()\n\treturn c\n}", "title": "" }, { "docid": "c7b760a1ad8267c9b2b88ed31c5a11d4", "score": "0.5223457", "text": "func (s *Server) CreateSignal(command string) chan input.Signal {\n\tc := make(chan input.Signal)\n\ts.signals[command] = c\n\treturn c\n}", "title": "" }, { "docid": "e9efc7ba45a4a2152feb072ed702ba54", "score": "0.52025604", "text": "func ListenToSignals(signals []os.Signal, apps ...stopper) {\n\tlogger := logging.Logger()\n\ts := make(chan os.Signal, 1)\n\tsignal.Notify(s, signals...)\n\n\t<-s\n\tvar err error\n\tfor _, a := range apps {\n\t\terr = a.Stop()\n\t\tif err != nil {\n\t\t\tlogger.Error(\"stopping resulted in error\", zap.Error(err))\n\t\t}\n\t}\n\tif err != nil {\n\t\tos.Exit(1)\n\t}\n\n\tos.Exit(0)\n}", "title": "" }, { "docid": "29226846d6c4e7265f8682dd8aca65ba", "score": "0.5200871", "text": "func (s *Server) listenSignals() {\n\t<-s.signals\n}", "title": "" }, { "docid": "5225459bb1ef05deb2cf30a070a8aee9", "score": "0.51936984", "text": "func InitSignal() chan os.Signal {\n\tc := make(chan os.Signal, 1)\n\tsignal.Notify(c, syscall.SIGHUP, syscall.SIGQUIT, syscall.SIGTERM, syscall.SIGINT, syscall.SIGSTOP)\n\treturn c\n}", "title": "" }, { "docid": "0e46b0bb9d4beac065b60fc1ee136aff", "score": "0.5184247", "text": "func (s *Server) configureSignals() {\n\tsignal.Notify(s.signals, syscall.SIGTERM)\n}", "title": "" }, { "docid": "105c4380a43e8a78206c38f9779603fe", "score": "0.5176091", "text": "func Signal() {\n\tselect {\n\tcase signals <- true:\n\tdefault:\n\t}\n}", "title": "" }, { "docid": "c6468c9ab7293978f90b979a07e9c374", "score": "0.5136211", "text": "func handleSignals() <-chan struct{} {\n\tsigCh := make(chan os.Signal)\n\tstopCh := make(chan struct{})\n\tgo func() {\n\t\tsignal.Notify(sigCh)\n\t\t<-sigCh\n\t\tclose(stopCh)\n\t\tos.Exit(1)\n\t}()\n\treturn stopCh\n}", "title": "" }, { "docid": "f069f3eb20ef0e43780d7aea0293b278", "score": "0.50991905", "text": "func Signal(onStop func()) {\n\t// Create a channel to handle os signals\n\tc := make(chan os.Signal, 1)\n\t// Send the following signals to the channel\n\tsignal.Notify(c, syscall.SIGINT)\n\tsignal.Notify(c, syscall.SIGKILL)\n\tsignal.Notify(c, syscall.SIGTERM)\n\n\t// Clean up when we receive a signal\n\tgo func() {\n\t\tselect {\n\t\tcase sig := <-c:\n\t\t\tlogger.Warn(fmt.Sprintf(\"Signal received '%s'\", sig))\n\t\t\tsignal.Stop(c)\n\t\t\tonStop()\n\t\t\tos.Exit(1)\n\t\t}\n\t}()\n}", "title": "" }, { "docid": "ac1238cb18e066e7fbf3207344eefd6f", "score": "0.50717616", "text": "func RegisterSignalHandler(ctx context.Context) {\n\tsignalChannel := make(chan os.Signal, 1)\n\tsignal.Notify(signalChannel, syscall.SIGHUP, os.Interrupt, syscall.SIGTERM)\n\n\tgo func() {\n\t\tfor sig := range signalChannel {\n\t\t\tbase.InfofCtx(ctx, base.KeyAll, \"Handling signal: %v\", sig)\n\t\t\tswitch sig {\n\t\t\tcase syscall.SIGHUP:\n\t\t\t\tHandleSighup()\n\t\t\tdefault:\n\t\t\t\t// Ensure log buffers are flushed before exiting.\n\t\t\t\tbase.FlushLogBuffers()\n\t\t\t\tos.Exit(130) // 130 == exit code 128 + 2 (interrupt)\n\t\t\t}\n\t\t}\n\t}()\n}", "title": "" }, { "docid": "435c733ef51bcc693d5ef83fde83b40d", "score": "0.50331664", "text": "func installSignalHandler() chan os.Signal {\n\tsigCh := make(chan os.Signal, 3)\n\tsignal.Notify(sigCh, os.Interrupt, syscall.SIGQUIT)\n\tgo func() {\n\t\tfor {\n\t\t\tsig := <-sigCh\n\t\t\tlog.Debugf(\"Got signal: %s\", sig.String())\n\t\t}\n\t}()\n\treturn sigCh\n}", "title": "" }, { "docid": "be73df968a82cf28382cb4cedd099d16", "score": "0.50069505", "text": "func (srv *Server) handleSignals() {\n\tvar sig os.Signal\n\n\tsignal.Notify(\n\t\tsrv.sigChan,\n\t\thookableSignals...,\n\t)\n\n\tpid := syscall.Getpid()\n\tfor {\n\t\tsig = <-srv.sigChan\n\t\tsrv.signalHooks(PreSignal, sig)\n\t\tswitch sig {\n\t\tcase syscall.SIGHUP:\n\t\t\tlog.Println(pid, \"Received SIGHUP. forking.\")\n\t\t\terr := srv.fork()\n\t\t\tif err != nil {\n\t\t\t\tlog.Println(\"Fork err:\", err)\n\t\t\t}\n\t\tcase syscall.SIGINT:\n\t\t\tlog.Println(pid, \"Received SIGINT.\")\n\t\t\tsrv.shutdown()\n\t\tcase syscall.SIGTERM:\n\t\t\tlog.Println(pid, \"Received SIGTERM.\")\n\t\t\tsrv.shutdown()\n\t\tdefault:\n\t\t\tlog.Printf(\"Received %v: nothing i care about...\\n\", sig)\n\t\t}\n\t\tsrv.signalHooks(PostSignal, sig)\n\t}\n}", "title": "" }, { "docid": "f34c459a11323bf0a4e72ef5356f08e8", "score": "0.5001476", "text": "func registerSignalHandler() {\n\tgo func() {\n\t sigs := make(chan os.Signal, 1)\n\t signal.Notify(sigs, syscall.SIGABRT, syscall.SIGTERM)\n\t buf := make([]byte, 1<<20)\n\t for {\n\t\t<-sigs\n\t\tstacklen := runtime.Stack(buf, true)\n\t\t// Print out detailed stack info to facilitate debugging\n\t\tfmt.Printf(\"=== received terminate ===\\n*** goroutine dump...\\n%s\\n*** end\\n\", buf[:stacklen])\n\t\tdebug.PrintStack()\n\t\tos.Exit(-1)\n\t }\n\t}()\n}", "title": "" }, { "docid": "e3ef6197840a53a8996030223aec69fe", "score": "0.49793488", "text": "func signalsAdapter(c chan os.Signal) AdapterFunc {\n\treturn func(runner Runner) Runner {\n\t\treturn RunnerFunc(func(ctx context.Context) {\n\t\t\tctx, cancel := context.WithCancel(ctx)\n\t\t\tdefer cancel()\n\n\t\t\t// Run the adapter runner in a go-routine so that the current go-routine\n\t\t\t// takes care of signal handling\n\t\t\tgo runner.Run(ctx)\n\n\t\t\t// Bear in mind that SIGKILL and SIGSTOP cannot be trapped, see\n\t\t\t// https://goo.gl/5gvRrN. Also know that pressing <ctrl-c> from CLI\n\t\t\t// will make the process receive a SIGINT.\n\t\t\tsignal.Notify(c, syscall.SIGINT, syscall.SIGTERM, syscall.SIGHUP)\n\n\t\t\tfor {\n\t\t\t\tselect {\n\t\t\t\tcase signal := <-c:\n\t\t\t\t\tswitch signal {\n\t\t\t\t\tcase syscall.SIGINT, syscall.SIGTERM:\n\t\t\t\t\t\tcancel()\n\n\t\t\t\t\t\t// TODO: How do we wait until everybody cancelled ?\n\n\t\t\t\t\t\treturn\n\n\t\t\t\t\tcase syscall.SIGHUP:\n\t\t\t\t\t\t// TODO: reload, but how do we know if everybody has cancelled and returned\n\t\t\t\t\t}\n\n\t\t\t\tcase <-ctx.Done():\n\t\t\t\t\treturn\n\t\t\t\t}\n\t\t\t}\n\t\t})\n\t}\n}", "title": "" }, { "docid": "7e1074743f0cc44215a49a8c0998d375", "score": "0.49753428", "text": "func SignalNotifier() chan os.Signal {\n\tsignalCh := make(chan os.Signal, 1)\n\tsignal.Notify(signalCh, syscall.SIGINT, syscall.SIGTERM)\n\tlastNotifier = signalCh\n\treturn signalCh\n}", "title": "" }, { "docid": "e25f4d7def5ab3686a0b039414623ffb", "score": "0.496068", "text": "func TrapSignals(onTrapped func(s os.Signal)) (waiter func()) {\n\tdone := make(chan struct{}, 1)\n\t// sigs := make(chan os.Signal, 1)\n\t// signal.Notify(sigs, syscall.SIGTERM, syscall.SIGINT, syscall.SIGKILL, syscall.SIGHUP, syscall.SIGQUIT)\n\t//\n\t// go func() {\n\t// \ts := <-sigs\n\t// \tcmdr.Logger.Debugf(\"receive signal '%v'\", s)\n\t//\n\t// \tonTrapped(s)\n\t//\n\t// \t// for _, s := range servers {\n\t// \t// \ts.Stop()\n\t// \t// }\n\t// \t// cmdr.Logger.Infof(\"done\")\n\t// \tdone <- struct{}{}\n\t// }()\n\n\twaiter = func() {\n\t\tfor {\n\t\t\tselect {\n\t\t\tcase <-done:\n\t\t\t\t// os.Exit(1)\n\t\t\t\t// cmdr.Logger.Infof(\"done got.\")\n\t\t\t\treturn\n\t\t\t}\n\t\t}\n\t}\n\n\treturn\n}", "title": "" }, { "docid": "91dce09ade0a73f49f21a186553d407c", "score": "0.49381807", "text": "func TrapSignals() chan os.Signal {\n\tsig := make(chan os.Signal, 1)\n\tsignal.Notify(sig, os.Interrupt)\n\treturn sig\n}", "title": "" }, { "docid": "5df5481dea2b427a06d377d66ada2280", "score": "0.49256384", "text": "func (srv *MicroService) handleSignals() {\n\tvar sig os.Signal\n\n\tsignal.Notify(\n\t\tsrv.sigChan,\n\t\thookableSignals...,\n\t)\n\n\tpid := syscall.Getpid()\n\tfor {\n\t\tsig = <-srv.sigChan\n\t\tsrv.signalHooks(PreSignal, sig)\n\t\tswitch sig {\n\t\tcase syscall.SIGHUP:\n\t\t\tfmt.Println(\"Received SIGHUP. forking.\", pid)\n\t\t\terr := srv.fork()\n\t\t\tif err != nil {\n\t\t\t\tsrv.logger.Error(\"error=%v\", err)\n\t\t\t}\n\t\tcase syscall.SIGINT:\n\t\t\tfmt.Println(\"Received SIGINT.\", pid)\n\t\t\tsrv.shutdown()\n\t\tcase syscall.SIGTERM:\n\t\t\tfmt.Println(\"Received SIGTERM.\", pid)\n\t\t\tsrv.shutdown()\n\t\tdefault:\n\t\t\tfmt.Printf(\"Received %v: nothing i care about...\\n\", sig)\n\t\t}\n\t\tsrv.signalHooks(PostSignal, sig)\n\t}\n}", "title": "" }, { "docid": "3a49979629e9f38804f51087976d7ab9", "score": "0.4903636", "text": "func SignalNum(s string) syscall.Signal {\n\treturn unix.SignalNum(s)\n}", "title": "" }, { "docid": "21f460f23313f501cc8f7d0dc070907b", "score": "0.49007463", "text": "func (s *Server) handleSignals() {\n\tc := make(chan os.Signal, 1)\n\tsignal.Notify(c, os.Interrupt)\n\tgo func() {\n\t\tfor sig := range c {\n\t\t\ts.log.Infof(\"Server received signal: %v\\n\", sig)\n\t\t\ts.Shutdown()\n\t\t\ts.log.Infof(\"Server exiting.\")\n\t\t\tos.Exit(0)\n\t\t}\n\t}()\n}", "title": "" }, { "docid": "a0e542c3e6eda50b4faee1e18feb8f34", "score": "0.49005827", "text": "func OnSignalReceived(signalName string, deciders ...Decider) Decider {\n\treturn OnSignalsReceived([]string{signalName}, deciders...)\n}", "title": "" }, { "docid": "4937df9020d8352d37b07d7b1217aeeb", "score": "0.48974666", "text": "func handleSignals(sigchans []chan os.Signal, handler func(linux.Signal), stop, done chan struct{}) {\n\t// Build a select case.\n\tsc := []reflect.SelectCase{{Dir: reflect.SelectRecv, Chan: reflect.ValueOf(stop)}}\n\tfor _, sigchan := range sigchans {\n\t\tsc = append(sc, reflect.SelectCase{Dir: reflect.SelectRecv, Chan: reflect.ValueOf(sigchan)})\n\t}\n\n\tfor {\n\t\t// Wait for a notification.\n\t\tindex, _, ok := reflect.Select(sc)\n\n\t\t// Was it the stop channel?\n\t\tif index == 0 {\n\t\t\tif !ok {\n\t\t\t\t// Stop forwarding and notify that it's done.\n\t\t\t\tclose(done)\n\t\t\t\treturn\n\t\t\t}\n\t\t\tcontinue\n\t\t}\n\n\t\t// How about a different close?\n\t\tif !ok {\n\t\t\tpanic(\"signal channel closed unexpectedly\")\n\t\t}\n\n\t\t// Otherwise, it was a signal on channel N. Index 0 represents the stop\n\t\t// channel, so index N represents the channel for signal N.\n\t\thandler(linux.Signal(index))\n\t}\n}", "title": "" }, { "docid": "f7c05a40a80082f3aa053145fca9fb30", "score": "0.4874338", "text": "func WaitForSignals(signals ...os.Signal) {\n\tsigs := make(chan os.Signal,1)\n\tsignal.Notify(sigs, signals...)\n\t<-sigs\n}", "title": "" }, { "docid": "cf6ba36660b35d5ea63bb1c8f4f66095", "score": "0.48501813", "text": "func signalHandler() {\n\tc := make(chan os.Signal, 1)\n\t// Signal für CTRL-C abfangen...\n\tsignal.Notify(c, syscall.SIGINT)\n\n\t// foreach signal received\n\tfor signal := range c {\n\t\tfmt.Println(\"\\nSignal empfangen...\")\n\t\tfmt.Println(signal.String())\n\t\tswitch signal {\n\t\tcase syscall.SIGINT:\n\t\t\tos.Exit(0)\n\t\t}\n\t}\n}", "title": "" }, { "docid": "63b259e5d6c0ade64e3748c8752a4272", "score": "0.48389813", "text": "func setupSignals() (chan os.Signal, error) {\n\tsignals := make(chan os.Signal, 2048)\n\tsignal.Notify(signals)\n\t// make sure runc is setup to use the monitor\n\t// for waiting on processes\n\trunc.Monitor = reaper.Default\n\t// set the shim as the subreaper for all orphaned processes created by the container\n\tif err := sys.SetSubreaper(1); err != nil {\n\t\treturn nil, err\n\t}\n\treturn signals, nil\n}", "title": "" }, { "docid": "857b3b25b2a4f833c0e244a7eff5c083", "score": "0.4831344", "text": "func handleSignals() {\n\tc := make(chan os.Signal, 1)\n\tsignal.Notify(c, syscall.SIGINT, syscall.SIGQUIT)\n\n\tfor {\n\t\t// Block until a signal is received.\n\t\ts := <-c\n\t\tlogger.Print(\"Caught signal: \", s)\n\t\tswitch s {\n\t\tcase syscall.SIGINT:\n\t\t\tclearPins()\n\t\t\tlogger.Print(\"Exiting\")\n\t\t\tos.Exit(0)\n\n\t\tcase syscall.SIGQUIT:\n\t\t\tlogState()\n\t\t}\n\t}\n}", "title": "" }, { "docid": "2a05ce533e79ef1708e504fc420abebd", "score": "0.48258692", "text": "func GetSignals(field string, descend bool) ([]model.Signal, error) {\n\tif db == nil {\n\t\treturn nil, fmt.Errorf(\"no connection is created to the database\")\n\t}\n\n\tif field == \"\" {\n\t\tfield = DEFAULT_SIGNAL_FIELD\n\t}\n\n\torder := \"DESC\"\n\tif !descend {\n\t\torder = \"ASC\"\n\t}\n\n\tvar results []model.Signal\n\terr := db.Select(&results, fmt.Sprintf(\"SELECT * FROM signals ORDER BY %s %s\", field, order))\n\tif err != nil {\n\t\treturn nil, fmt.Errorf(\"error reading signals: %q\", err)\n\t}\n\n\treturn results, nil\n}", "title": "" }, { "docid": "5e7f0a23fccad57cc2c0168e678f0d84", "score": "0.48210844", "text": "func handleSignals() {\n\tc := make(chan os.Signal, 1)\n\tsignal.Notify(c, syscall.SIGINT)\n\tgo func() {\n\t\tfor sig := range c {\n\t\t\tswitch sig {\n\t\t\tcase syscall.SIGINT:\n\t\t\t\tbridge.shutdown()\n\t\t\t\tos.Exit(0)\n\t\t\t}\n\t\t}\n\t}()\n}", "title": "" }, { "docid": "d7aff2c3e855c4368af42c0820824ee8", "score": "0.48017082", "text": "func NewSignalWatcher(ctx context.Context, conn *dbus.Conn, specs ...MatchSpec) (*SignalWatcher, error) {\n\t// Add connection-level match rules to ensure that we receive the requested signals.\n\t// While it's not well-documented, dbus-daemon does not perform deduplication of match rules, so it's\n\t// safe to add the same match rule twice for two different SignalWatchers and then close one of them.\n\tvar added []MatchSpec\n\tfor _, spec := range specs {\n\t\tif err := conn.BusObject().CallWithContext(ctx, busInterface+\".AddMatch\", 0, spec.String()).Err; err != nil {\n\t\t\t// If we failed, remove any specs that we added.\n\t\t\tfor _, as := range added {\n\t\t\t\t// Use context.Background in case ctx has already expired due to the test timing out.\n\t\t\t\t// dbus-daemon should never hang (and if it does, the DUT is already in bad shape).\n\t\t\t\tif err := removeMatch(context.Background(), conn.BusObject(), as); err != nil { // NOLINT\n\t\t\t\t\ttesting.ContextLogf(ctx, \"Failed to remove D-Bus match rule %q\", as)\n\t\t\t\t}\n\t\t\t}\n\t\t\treturn nil, err\n\t\t}\n\t\tadded = append(added, spec)\n\t}\n\n\tsw := &SignalWatcher{\n\t\tSignals: make(chan *dbus.Signal, SignalChanSize),\n\t\tconn: conn,\n\t\tspecs: specs,\n\t\tallSigs: make(chan *dbus.Signal, SignalChanSize),\n\t}\n\n\t// Matching goroutine.\n\tgo func() {\n\t\tfor sig := range sw.allSigs {\n\t\t\tfor _, spec := range sw.specs {\n\t\t\t\tif spec.MatchesSignal(sig) {\n\t\t\t\t\tsw.Signals <- sig\n\t\t\t\t\tbreak\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\tclose(sw.Signals)\n\t}()\n\tconn.Signal(sw.allSigs)\n\n\treturn sw, nil\n}", "title": "" }, { "docid": "97e47039607621ad1ae16d8169626a78", "score": "0.4779638", "text": "func (tg *ThreadGroup) SignalHandlers() *SignalHandlers {\n\treturn tg.signalHandlers\n}", "title": "" }, { "docid": "8f11fef0d7e0be69290160bd634f57f6", "score": "0.4771303", "text": "func Signal(stopSignals ...os.Signal) {\n\tif len(stopSignals) == 0 {\n\t\tpanic(\"GRACE PANIC nil stopSignals\")\n\t}\n\tif isRunning {\n\t\tpanic(\"GRACE PANIC set stop signals after running.\")\n\t}\n\tdefaultStopSignal = stopSignals\n}", "title": "" }, { "docid": "f1dac0a1fbc1072909025245207e706d", "score": "0.4760695", "text": "func RegisterSignals(signals []model.Signal) error {\n\tif db == nil {\n\t\treturn fmt.Errorf(\"no connection is created to the database\")\n\t}\n\n\ttx := db.MustBegin()\n\n\tfor _, signal := range signals {\n\t\tif err := registerSignal(signal, tx); err != nil {\n\t\t\treturn err\n\t\t}\n\t}\n\n\tif err := tx.Commit(); err != nil {\n\t\treturn fmt.Errorf(\"failed to complete signals registration : %s\", err)\n\t}\n\treturn nil\n}", "title": "" }, { "docid": "8ef0819906cc233a06a365e8a4fd050d", "score": "0.4758656", "text": "func New(basepath string) (*LogHandleMap, *chan os.Signal) {\n\tlm := &LogHandleMap{}\n\n\tlm.hmap = make(map[string]*reopen.FileWriter)\n\tlm.lmap = make(map[string]*logrus.Logger)\n\tlm.bp = basepath\n\n\tsc := make(chan os.Signal, 1)\n\tsignal.Notify(sc, syscall.SIGUSR2)\n\tlm.signal = sc\n\tlm.configured = true\n\treturn lm, &sc\n}", "title": "" }, { "docid": "c370f95bd9c0ec249b00541d8461e5c4", "score": "0.47560534", "text": "func TestEverything(t *testing.T) {\n\tsset := NewSignalHandlerSet()\n\n\thandler := func(s os.Signal, arg interface{}) {\n\t\tfmt.Printf(\"handle signal: %v\\n\", s)\n\t\tif s == syscall.SIGTERM {\n\t\t\tfmt.Printf(\"signal terminate received, exited normally\\n\")\n\t\t\tos.Exit(0)\n\t\t}\n\t}\n\tsset.Register(syscall.SIGINT, handler)\n\tsset.Register(syscall.SIGUSR1, handler)\n\tsset.Register(syscall.SIGUSR2, handler)\n\tsset.Register(syscall.SIGTERM, handler)\n\n\tsset.Start()\n\n\ttime.Sleep(time.Hour)\n}", "title": "" }, { "docid": "ee03a0024efdb523aa84d07893921bb6", "score": "0.47323382", "text": "func TrapSignals(ctx apitypes.Context) {\n\n\tcontext.RegisterCustomKey(signalContextKey, context.CustomLoggerKey)\n\n\tsigc := make(chan os.Signal, 1)\n\tsignal.Notify(sigc)\n\n\tgo func() {\n\t\tfor s := range sigc {\n\n\t\t\tctx := ctx.WithValue(signalContextKey, s.String())\n\t\t\tif ok, graceful := IsExitSignal(s); ok && !graceful {\n\t\t\t\tctx.Error(\"received signal; aborting\")\n\t\t\t\tos.Exit(1)\n\t\t\t}\n\n\t\t\tfunc() {\n\t\t\t\tsigHandlersRWL.RLock()\n\t\t\t\tdefer sigHandlersRWL.RUnlock()\n\n\t\t\t\t// execute the signal handlers in reverse order. the first\n\t\t\t\t// one registered should be executed last as it was registered\n\t\t\t\t// the earliest\n\t\t\t\tfor i := len(sigHandlers) - 1; i >= 0; i-- {\n\t\t\t\t\tsigHandlers[i](ctx, s)\n\t\t\t\t}\n\t\t\t}()\n\n\t\t\tif ok, graceful := IsExitSignal(s); ok && graceful {\n\t\t\t\tctx.Error(\"received signal; shutting down\")\n\t\t\t\tos.Exit(0)\n\t\t\t}\n\t\t}\n\t}()\n}", "title": "" }, { "docid": "fa825ffd449c5fc265aa99603461ce4f", "score": "0.46782225", "text": "func parseSignalArgument(arg string) (int, error) {\n\tvar signal syscall.Signal\n\n\tswitch arg {\n\tcase \"abrt\":\n\t\tsignal = syscall.SIGABRT\n\tcase \"alrm\":\n\t\tsignal = syscall.SIGALRM\n\tcase \"bus\":\n\t\tsignal = syscall.SIGBUS\n\tcase \"chld\":\n\t\tsignal = syscall.SIGCHLD\n\t\t// case \"cld\":\n\t\t// \tsignal = syscall.SIGCLD\n\tcase \"cont\":\n\t\tsignal = syscall.SIGCONT\n\tcase \"fpe\":\n\t\tsignal = syscall.SIGFPE\n\tcase \"hup\":\n\t\tsignal = syscall.SIGHUP\n\tcase \"ill\":\n\t\tsignal = syscall.SIGILL\n\tcase \"int\":\n\t\tsignal = syscall.SIGINT\n\tcase \"io\":\n\t\tsignal = syscall.SIGIO\n\tcase \"iot\":\n\t\tsignal = syscall.SIGIOT\n\tcase \"kill\":\n\t\tsignal = syscall.SIGKILL\n\tcase \"pipe\":\n\t\tsignal = syscall.SIGPIPE\n\t\t// case \"poll\":\n\t\t// \tsignal = syscall.SIGPOLL\n\tcase \"prof\":\n\t\tsignal = syscall.SIGPROF\n\t\t// case \"pwr\":\n\t\t// \tsignal = syscall.SIGPWR\n\tcase \"quit\":\n\t\tsignal = syscall.SIGQUIT\n\tcase \"segv\":\n\t\tsignal = syscall.SIGSEGV\n\t\t// case \"stkflt\":\n\t\t// \tsignal = syscall.SIGSTKFLT\n\tcase \"stop\":\n\t\tsignal = syscall.SIGSTOP\n\tcase \"sys\":\n\t\tsignal = syscall.SIGSYS\n\tcase \"term\":\n\t\tsignal = syscall.SIGTERM\n\tcase \"trap\":\n\t\tsignal = syscall.SIGTRAP\n\tcase \"tstp\":\n\t\tsignal = syscall.SIGTSTP\n\tcase \"ttin\":\n\t\tsignal = syscall.SIGTTIN\n\tcase \"ttou\":\n\t\tsignal = syscall.SIGTTOU\n\t\t// case \"unused\":\n\t\t// \tsignal = syscall.SIGUNUSED\n\tcase \"urg\":\n\t\tsignal = syscall.SIGURG\n\tcase \"usr1\":\n\t\tsignal = syscall.SIGUSR1\n\tcase \"usr2\":\n\t\tsignal = syscall.SIGUSR2\n\tcase \"vtalrm\":\n\t\tsignal = syscall.SIGVTALRM\n\tcase \"winch\":\n\t\tsignal = syscall.SIGWINCH\n\tcase \"xcpu\":\n\t\tsignal = syscall.SIGXCPU\n\tcase \"xfsz\":\n\t\tsignal = syscall.SIGXFSZ\n\tdefault:\n\t\treturn 0, fmt.Errorf(\"morta: invalid signal %s\", arg)\n\t}\n\n\treturn int(signal), nil\n}", "title": "" }, { "docid": "177a0545c776f1a22c65837731f3a4e7", "score": "0.46731701", "text": "func (sm *SourceMgr) HandleSignals(sigch chan os.Signal) {\n\tsm.sigmut.Lock()\n\t// always start by closing the qch, which will lead to any existing signal\n\t// handler terminating, and deregistering its sigch.\n\tif sm.qch != nil {\n\t\tclose(sm.qch)\n\t}\n\tsm.qch = make(chan struct{})\n\n\t// Run a new goroutine with the input sigch and the fresh qch\n\tgo func(sch chan os.Signal, qch <-chan struct{}) {\n\t\tdefer signal.Stop(sch)\n\t\tfor {\n\t\t\tselect {\n\t\t\tcase <-sch:\n\t\t\t\t// Set up a timer to uninstall the signal handler after three\n\t\t\t\t// seconds, so that the user can easily force termination with a\n\t\t\t\t// second ctrl-c\n\t\t\t\tgo func(c <-chan time.Time) {\n\t\t\t\t\t<-c\n\t\t\t\t\tsignal.Stop(sch)\n\t\t\t\t}(time.After(3 * time.Second))\n\n\t\t\t\tif !atomic.CompareAndSwapInt32(&sm.releasing, 0, 1) {\n\t\t\t\t\t// Something's already called Release() on this sm, so we\n\t\t\t\t\t// don't have to do anything, as we'd just be redoing\n\t\t\t\t\t// that work. Instead, deregister and return.\n\t\t\t\t\treturn\n\t\t\t\t}\n\n\t\t\t\topc := atomic.LoadInt32(&sm.opcount)\n\t\t\t\tif opc > 0 {\n\t\t\t\t\tfmt.Printf(\"Signal received: waiting for %v ops to complete...\\n\", opc)\n\t\t\t\t}\n\n\t\t\t\t// Mutex interaction in a signal handler is, as a general rule,\n\t\t\t\t// unsafe. I'm not clear on whether the guarantees Go provides\n\t\t\t\t// around signal handling, or having passed this through a\n\t\t\t\t// channel in general, obviate those concerns, but it's a lot\n\t\t\t\t// easier to just rely on the mutex contained in the Once right\n\t\t\t\t// now, so do that until it proves problematic or someone\n\t\t\t\t// provides a clear explanation.\n\t\t\t\tsm.relonce.Do(func() { sm.doRelease() })\n\t\t\t\treturn\n\t\t\tcase <-qch:\n\t\t\t\t// quit channel triggered - deregister our sigch and return\n\t\t\t\treturn\n\t\t\t}\n\t\t}\n\t}(sigch, sm.qch)\n\t// Try to ensure handler is blocked in for-select before releasing the mutex\n\truntime.Gosched()\n\n\tsm.sigmut.Unlock()\n}", "title": "" }, { "docid": "efecba3f50b838c29a9776cbf238a537", "score": "0.46395886", "text": "func MakeSignalSet(sigs ...Signal) SignalSet {\n\tindices := make([]int, len(sigs))\n\tfor i, sig := range sigs {\n\t\tindices[i] = sig.Index()\n\t}\n\treturn SignalSet(bits.Mask64(indices...))\n}", "title": "" }, { "docid": "1ed9207802964b7a70d4ffec44aa3f42", "score": "0.46370614", "text": "func signalHandler(signalChan chan os.Signal, exitChan chan int) {\n\tsignal.Notify(signalChan,\n\t\tsyscall.SIGHUP,\n\t\tsyscall.SIGINT,\n\t\tsyscall.SIGTERM,\n\t\tsyscall.SIGQUIT)\n\n\tgo func() {\n\t\tfor {\n\t\t\ts := <-signalChan\n\t\t\tswitch s {\n\t\t\tcase syscall.SIGHUP:\n\t\t\t\texitChan <- 0\n\n\t\t\tcase syscall.SIGINT:\n\t\t\t\texitChan <- 0\n\n\t\t\tcase syscall.SIGTERM:\n\t\t\t\texitChan <- 0\n\n\t\t\tcase syscall.SIGQUIT:\n\t\t\t\texitChan <- 0\n\n\t\t\tdefault:\n\t\t\t\tfmt.Println(\"Unknown signal.\")\n\t\t\t\texitChan <- 1\n\t\t\t}\n\t\t}\n\t}()\n}", "title": "" }, { "docid": "64eea81260b3903c1e1e368ba920ceeb", "score": "0.46225098", "text": "func WaitSignals(signals ...os.Signal) {\n\tc := make(chan os.Signal, 1)\n\tsignal.Notify(c, signals...)\n\t<-c\n}", "title": "" }, { "docid": "8a7ed979d2e4afc62d0e0b63a7af94b6", "score": "0.46216688", "text": "func OnSignalsReceived(signalNames []string, deciders ...Decider) Decider {\n\treturn func(ctx *FSMContext, h *swf.HistoryEvent, data interface{}) Outcome {\n\t\tswitch *h.EventType {\n\t\tcase swf.EventTypeWorkflowExecutionSignaled:\n\t\t\tfor _, signalName := range signalNames {\n\t\t\t\tif *h.WorkflowExecutionSignaledEventAttributes.SignalName == signalName {\n\t\t\t\t\tlogf(ctx, \"at=on-signal-received\")\n\t\t\t\t\treturn NewComposedDecider(deciders...)(ctx, h, data)\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\treturn ctx.Pass()\n\t}\n}", "title": "" }, { "docid": "dd8d5cfc7b9ddafa1b8a9e913269cd28", "score": "0.4618401", "text": "func osSignalHandler(shutdown chan<- string) {\n\tvar sigs = make(chan os.Signal, 1)\n\tsignal.Notify(sigs, syscall.SIGINT, syscall.SIGTERM)\n\n\tsig := <-sigs // this is the blocking part\n\n\tgo func(){\n\t\ttime.Sleep(2*time.Second)\n\t\tlog.Fatalf(\"shutdown was ignored, bailing out now.\\n\")\n\t}()\n\n\tshutdown <- fmt.Sprintf(\"received signal %v\", sig)\n}", "title": "" }, { "docid": "a7123daee1e1c12d4c96ea99ce0dd7a2", "score": "0.4618271", "text": "func WithOnEventsSignal(callback func(io *SoundIo)) Option {\n\treturn func(io *SoundIo) {\n\t\tio.onEventsSignal = callback\n\t}\n}", "title": "" }, { "docid": "bd9127071787f15c278d9e643400c8a5", "score": "0.460976", "text": "func (s *Semaphore) Signal(count int) {\n\t(*semaphore)(s).signal(count)\n}", "title": "" }, { "docid": "f40cb3cf7d4652689c08280801628bd9", "score": "0.46070582", "text": "func NewDefaultSignalHandler() *defaultSignalHandler {\n\treturn &defaultSignalHandler{}\n}", "title": "" }, { "docid": "4e7c28d121f3fffed3c8afa37b73394c", "score": "0.45723146", "text": "func PrepareSignalHandler(s *State) {\n\ts.SignalChan = make(chan os.Signal, 1)\n\tsignal.Notify(s.SignalChan, os.Interrupt)\n\tgo func() {\n\t\tfor range s.SignalChan {\n\t\t\t// caught CTRL+C\n\t\t\tif !s.Quiet {\n\t\t\t\tfmt.Println(\"[!] Keyboard interrupt detected, terminating.\")\n\t\t\t\ts.Terminate = true\n\t\t\t}\n\t\t}\n\t}()\n}", "title": "" }, { "docid": "4afab57f80ee2b4a3e01eff93b1c7e65", "score": "0.4560176", "text": "func initializeSignalHandler(connection *gorm.DB) {\n\tsignalChannel := make(chan os.Signal, 2)\n\tsignal.Notify(signalChannel, os.Interrupt, syscall.SIGTERM)\n\tgo func() {\n\t\tsig := <-signalChannel\n\n\t\tswitch sig {\n\t\t// handle SIGINT\n\t\tcase os.Interrupt:\n\t\t\tmid.LogInfo(\"received SIGINT signal\")\n\t\t\tdefer connection.Close()\n\n\t\t\tmid.LogInfo(\"graceful application shutdown complete\")\n\t\t\tos.Exit(0)\n\n\t\t// handle SIGTERM\n\t\tcase syscall.SIGTERM:\n\t\t\tmid.LogInfo(\"received SIGTERM signal\")\n\t\t\tdefer connection.Close()\n\n\t\t\tmid.LogInfo(\"application terminated\")\n\t\t\tos.Exit(-1)\n\t\t}\n\t}()\n\n\tmid.LogInfo(\"initalized signal handler\")\n}", "title": "" }, { "docid": "8de00a3470dabfe533ab3aec3678b74f", "score": "0.45531926", "text": "func HandledSignals() []syscall.Signal {\n\tvar signals []syscall.Signal\n\n\tfor sig := range handledSignalsMap {\n\t\tsignals = append(signals, sig)\n\t}\n\n\treturn signals\n}", "title": "" }, { "docid": "05b512600d5fde08a537ff00395f68fa", "score": "0.4544652", "text": "func (b *Builder) ConnectSignals(signals map[string]interface{}) {\n\tbuilderSignals.Lock()\n\tbuilderSignals.m[b.native()] = signals\n\tbuilderSignals.Unlock()\n\n\tC._gtk_builder_connect_signals_full(b.native())\n}", "title": "" }, { "docid": "27bf531081927b2ea39a230c9de16268", "score": "0.4537286", "text": "func (s *Strategy) createSignals(pos []order.Position, spotSignal, futuresSignal *signal.Signal, diffBetweenFuturesSpot decimal.Decimal, isLastEvent bool) ([]signal.Event, error) {\n\tif spotSignal == nil {\n\t\treturn nil, fmt.Errorf(\"%w missing spot signal\", gctcommon.ErrNilPointer)\n\t}\n\tif futuresSignal == nil {\n\t\treturn nil, fmt.Errorf(\"%w missing futures signal\", gctcommon.ErrNilPointer)\n\t}\n\tvar response []signal.Event\n\tswitch {\n\tcase len(pos) == 0,\n\t\tpos[len(pos)-1].Status == order.Closed &&\n\t\t\tdiffBetweenFuturesSpot.GreaterThan(s.openShortDistancePercentage):\n\t\t// check to see if order is appropriate to action\n\t\tspotSignal.SetPrice(spotSignal.ClosePrice)\n\t\tspotSignal.AppendReasonf(\"Signalling purchase of %v\", spotSignal.Pair())\n\t\t// first the spot purchase\n\t\tspotSignal.SetDirection(order.Buy)\n\t\t// second the futures purchase, using the newly acquired asset\n\t\t// as collateral to short\n\t\tfuturesSignal.SetDirection(order.Short)\n\t\tfuturesSignal.SetPrice(futuresSignal.ClosePrice)\n\t\tfuturesSignal.AppendReason(\"Shorting to perform cash and carry\")\n\t\tfuturesSignal.CollateralCurrency = spotSignal.CurrencyPair.Base\n\t\tfuturesSignal.MatchesOrderAmount = true\n\t\tspotSignal.AppendReasonf(\"Signalling shorting of %v after spot order placed\", futuresSignal.Pair())\n\t\t// set the FillDependentEvent to use the futures signal\n\t\t// as the futures signal relies on a completed spot order purchase\n\t\t// to use as collateral\n\t\tspotSignal.FillDependentEvent = futuresSignal\n\t\t// only appending spotSignal as futuresSignal will be raised later\n\t\tresponse = append(response, spotSignal)\n\tcase pos[len(pos)-1].Status == order.Open &&\n\t\tdiffBetweenFuturesSpot.LessThanOrEqual(s.closeShortDistancePercentage):\n\t\t// closing positions when custom threshold met\n\t\tspotSignal.SetDirection(order.ClosePosition)\n\t\tspotSignal.AppendReasonf(\"Closing position. Met threshold of %v\", s.closeShortDistancePercentage)\n\t\tfuturesSignal.SetDirection(order.ClosePosition)\n\t\tfuturesSignal.AppendReasonf(\"Closing position. Met threshold %v\", s.closeShortDistancePercentage)\n\t\tresponse = append(response, futuresSignal, spotSignal)\n\tcase pos[len(pos)-1].Status == order.Open &&\n\t\tisLastEvent:\n\t\t// closing positions on last event\n\t\tspotSignal.SetDirection(order.ClosePosition)\n\t\tspotSignal.AppendReason(\"Selling asset on last event\")\n\t\tfuturesSignal.SetDirection(order.ClosePosition)\n\t\tfuturesSignal.AppendReason(\"Closing position on last event\")\n\t\tresponse = append(response, futuresSignal, spotSignal)\n\tdefault:\n\t\tresponse = append(response, spotSignal, futuresSignal)\n\t}\n\treturn response, nil\n}", "title": "" }, { "docid": "c815c380799b24477ee05c14539c5efa", "score": "0.4531483", "text": "func handleSignals(log logrus.FieldLogger, cancel context.CancelFunc, reloadCh chan<- struct{}) {\n\tsignals := make(chan os.Signal, 1)\n\tsignal.Notify(signals, syscall.SIGINT, syscall.SIGHUP, syscall.SIGUSR1)\n\n\tfor sig := range signals {\n\t\tswitch sig {\n\t\tcase syscall.SIGINT:\n\t\t\tlog.Info(\"Received interrupt, triggering shutdown.\")\n\t\t\tcancel()\n\t\t\treturn\n\t\tcase syscall.SIGHUP, syscall.SIGUSR1:\n\t\t\tlog.Info(\"Received reload signal, queueing reload.\")\n\t\t\tselect {\n\t\t\tcase reloadCh <- struct{}{}:\n\t\t\tdefault:\n\t\t\t\tlog.Warn(\"Unable to queue reload, reload already queued.\")\n\t\t\t}\n\t\t}\n\t}\n}", "title": "" }, { "docid": "5e8cd3e9478e2f90765955e0673d7522", "score": "0.4523004", "text": "func (d *DBusObject) CreateWatcher(ctx context.Context, signalNames ...string) (*dbusutil.SignalWatcher, error) {\n\tspecs := make([]dbusutil.MatchSpec, len(signalNames))\n\tfor i, sigName := range signalNames {\n\t\tspecs[i] = dbusutil.MatchSpec{\n\t\t\tType: \"signal\",\n\t\t\tPath: d.obj.Path(),\n\t\t\tInterface: d.iface,\n\t\t\tMember: sigName,\n\t\t}\n\t}\n\twatcher, err := dbusutil.NewSignalWatcher(ctx, d.conn, specs...)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\treturn watcher, nil\n}", "title": "" }, { "docid": "f1427dc5281a67a071f2b1aca95305f0", "score": "0.45061255", "text": "func WithSignal(parent context.Context, sig ...os.Signal) context.Context {\n\treturn withSignal(parent, signalNotifier{}, sig...)\n}", "title": "" }, { "docid": "fdf2e06175b8857bb0a29dbb9db7aec1", "score": "0.45042762", "text": "func newDarwinWatcher(activeThreshold, pollFrequency time.Duration) (Monitor, error) {\n\tw := Watcher{}\n\tw.activeThreshold = activeThreshold\n\tw.pollFrequency = pollFrequency\n\t_, err := w.TimeSinceLastInput()\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\tgo w.activityPoller()\n\treturn &w, nil\n}", "title": "" }, { "docid": "718d8e36c4f945dbdaf42675e1bcd81b", "score": "0.4497206", "text": "func init() {\n\tsignalsLock.Lock()\n\tgracePeriod = time.Second\n\tsignals = func() <-chan os.Signal {\n\t\treturn interrupt\n\t}\n\tsignalsLock.Unlock()\n}", "title": "" }, { "docid": "290e749e31832f913ce65ba3c1def851", "score": "0.44935203", "text": "func ParseSignal(rawSignal string) (syscall.Signal, error) {\n\treturn signal.ParseSignal(rawSignal)\n}", "title": "" }, { "docid": "5e2877b07bfb73013bb25e72f96acf6d", "score": "0.44914487", "text": "func (p *Processor) handleSignals() {\n\tvar captureSignal = make(chan os.Signal, 1)\n\n\t// when k8s deletes pods, it sends SIGTERM (https://kubernetes.io/docs/concepts/workloads/pods/pod-lifecycle/#pod-termination)\n\t// when docker stops container it sends SIGTERM by default (https://docs.docker.com/engine/reference/commandline/stop/)\n\t// but you can specify a specific signal with a specific option, so we support SIGABRT and SIGINT as well\n\tsignal.Notify(captureSignal, syscall.SIGTERM, syscall.SIGABRT, syscall.SIGINT)\n\tp.terminateAllTriggers(<-captureSignal)\n\tp.Stop()\n}", "title": "" }, { "docid": "ff1c5cee5aa11f0cf3c598b914491f60", "score": "0.44779083", "text": "func GetSignal() chan os.Signal {\n\tsig := make(chan os.Signal, 1)\n\tsignal.Notify(sig, os.Interrupt, os.Kill)\n\treturn sig\n}", "title": "" }, { "docid": "e50670c20359b0d2a26136bfddab8e24", "score": "0.4477857", "text": "func New() *Hub {\n\thub := &Hub{\n\t\trooms: make(map[string]*Room),\n\t\tRWMutex: new(sync.RWMutex),\n\t}\n\tgo func() {\n\t\tch := make(chan os.Signal)\n\t\tsignal.Notify(ch, syscall.SIGINT, syscall.SIGTERM) // Se mi arriva SIGINT o SIGTERM lo notifico tramite channel\n\t\t<-ch // Richiesta bloccante di un segnale sul channel\n\t\thub.RLock()\n\t\tdefer hub.RUnlock()\n\t\tfor name, room := range hub.rooms { // Chiudo il canale Quit di ogni match (e quindi li termino)\n\t\t\tlog.Printf(\"Closing room [%s] \\n\", name)\n\t\t\troom.Quit <- struct{}{}\n\t\t}\n\t\tos.Exit(0) // Termino l'esecuzione\n\t}()\n\n\treturn hub\n}", "title": "" }, { "docid": "437f52dd853d617255f1741c1981ffe2", "score": "0.44746813", "text": "func NewSignalNameChange[Key SignalType, Value SignalType](mappings map[Key]Value) *SignalNameChange {\n\tsig := &SignalNameChange{\n\t\tupdates: make(map[string]string, len(mappings)),\n\t\trollback: make(map[string]string, len(mappings)),\n\t}\n\tfor k, v := range mappings {\n\t\tsig.updates[string(k)] = string(v)\n\t\tsig.rollback[string(v)] = string(k)\n\t}\n\treturn sig\n}", "title": "" }, { "docid": "c2fe5ec770a4b318e2058448cf839a26", "score": "0.44581577", "text": "func signalHandler(i iface.Counter) {\n\n\t// bind && wait signal\n\tvar sigs = make(chan os.Signal, 1)\n\tsignal.Notify(sigs, syscall.SIGINT, syscall.SIGTERM)\n\t<-sigs\n\n\t// save to file\n\terr := i.Save(filename)\n\tif err != nil {\n\t\tlog.Fatal(\"Failed to save file\", err)\n\t}\n\n\t// exit\n\t// it is probably a good idea to stop http server (and everything else) first when using it on a real application\n\n\tlog.Println(\"Terminating\")\n\tos.Exit(0)\n}", "title": "" }, { "docid": "4bf917344ba84c8170eea6febd87f393", "score": "0.4439659", "text": "func signalHandler(a agent.Agent) {\n\tc := make(chan os.Signal, 1)\n\tsignal.Notify(c, syscall.SIGINT, syscall.SIGTERM)\n\n\tlogrus.WithFields(logrus.Fields{\n\t\t\"signal\": (<-c).String(),\n\t}).Info(\"shutting down due to signal\")\n\n\ta.Stop()\n}", "title": "" }, { "docid": "ca7db0577ef23cdcb100a9b1e23c38f3", "score": "0.44391927", "text": "func sendSomeSignals() {\n\tdone := make(chan struct{})\n\tgo func() {\n\t\tspin()\n\t\tclose(done)\n\t}()\n\twinch()\n\t<-done\n}", "title": "" }, { "docid": "237992fab4e989ecf62b56cfe99118ca", "score": "0.4437751", "text": "func InstallSignalHandler(handler SignalHandler) {\n\tsignalHandlers_mutex.Lock()\n\tsignalHandlers[handler] = true\n\tsignalHandlers_mutex.Unlock()\n}", "title": "" }, { "docid": "4fe34f1bb5329a90c85ef2a86397109e", "score": "0.44214776", "text": "func SetSignalHandler(sig syscall.Signal, f func(syscall.Signal)) {\n\tsigChan := make(chan os.Signal)\n\tgo func() {\n\t\tfor _ = range sigChan {\n\t\t\tf(sig)\n\t\t}\n\t}()\n\tsignal.Notify(sigChan, sig)\n}", "title": "" }, { "docid": "7e304f723aabb167ba86ad73aaa21460", "score": "0.441686", "text": "func catchSignal(fd []uintptr, sig chan os.Signal) {\n\tselect {\n\tcase <-sig:\n\t\techoOn(fd)\n\t\tos.Exit(2)\n\t}\n}", "title": "" }, { "docid": "c6bb8f41b8d19a9ca51ef43cdf072abc", "score": "0.44132107", "text": "func SignalHandler(logger logger.Logger, cancel context.CancelFunc, srv *http.Server) {\n\t// chan size 2 as multiple interrupts is force quit (supports ^C for dev)\n\tc := make(chan os.Signal, 2)\n\tsignal.Notify(c, os.Interrupt)\n\n\tvar lastSignal time.Time\n\tfor {\n\t\ts := <-c\n\t\tif time.Since(lastSignal) < time.Second {\n\t\t\tlogger.Fatal(\"Two signals in short succession, forcing quit\")\n\t\t}\n\n\t\tlastSignal = time.Now()\n\t\tlogger.Infof(\"Received %v, preparing to shutdown\", s)\n\t\tshuttingDown = true\n\t\tsrv.Shutdown(context.Background())\n\t\tcancel()\n\t}\n}", "title": "" }, { "docid": "eb995d2c8f22c9e5bbfe0fab3d11d5b0", "score": "0.44088528", "text": "func newHub() *Hub {\n\treturn &Hub{\n\t\tclients: make(map[*Client]bool),\n\t\tbroadcast: make(chan []byte),\n\t\tregister: make(chan *Client),\n\t\tunregister: make(chan *Client),\n\t}\n}", "title": "" } ]
2122f2db278a98c495eac8f9b57e6740
IDNotIn applies the NotIn predicate on the ID field.
[ { "docid": "b8c0bbe09f508278504203b2be77a95a", "score": "0.8036456", "text": "func IDNotIn(ids ...int) predicate.User {\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(ids) == 0 {\n\t\t\ts.Where(sql.False())\n\t\t\treturn\n\t\t}\n\t\tv := make([]interface{}, len(ids))\n\t\tfor i := range v {\n\t\t\tv[i] = ids[i]\n\t\t}\n\t\ts.Where(sql.NotIn(s.C(FieldID), v...))\n\t})\n}", "title": "" } ]
[ { "docid": "d50c198cb91ae9e6ebbff3ce8104cb1c", "score": "0.8206011", "text": "func (qs TransactionQuerySet) IDNotIn(ID uint, IDRest ...uint) TransactionQuerySet {\n\tiArgs := []interface{}{ID}\n\tfor _, arg := range IDRest {\n\t\tiArgs = append(iArgs, arg)\n\t}\n\treturn qs.w(qs.db.Where(\"id NOT IN (?)\", iArgs))\n}", "title": "" }, { "docid": "fd9eb045ec72d18a621feaf95db38fa3", "score": "0.8201042", "text": "func (qs StoryQuerySet) IDNotIn(ID uint, IDRest ...uint) StoryQuerySet {\n\tiArgs := []interface{}{ID}\n\tfor _, arg := range IDRest {\n\t\tiArgs = append(iArgs, arg)\n\t}\n\treturn qs.w(qs.db.Where(\"id NOT IN (?)\", iArgs))\n}", "title": "" }, { "docid": "b117a571c6d204112cba488971ecf8ea", "score": "0.81528646", "text": "func IDNotIn(ids ...int) predicate.Loanbinding {\n\treturn predicate.Loanbinding(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(ids) == 0 {\n\t\t\ts.Where(sql.False())\n\t\t\treturn\n\t\t}\n\t\tv := make([]interface{}, len(ids))\n\t\tfor i := range v {\n\t\t\tv[i] = ids[i]\n\t\t}\n\t\ts.Where(sql.NotIn(s.C(FieldID), v...))\n\t})\n}", "title": "" }, { "docid": "3ba12201ef578c0c4b3395bd6d7b2b5b", "score": "0.81509393", "text": "func IDNotIn(ids ...int) predicate.Member {\n\treturn predicate.Member(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(ids) == 0 {\n\t\t\ts.Where(sql.False())\n\t\t\treturn\n\t\t}\n\t\tv := make([]interface{}, len(ids))\n\t\tfor i := range v {\n\t\t\tv[i] = ids[i]\n\t\t}\n\t\ts.Where(sql.NotIn(s.C(FieldID), v...))\n\t})\n}", "title": "" }, { "docid": "d455395083c7fefc1bebf1c3c0b38ca0", "score": "0.8137837", "text": "func IDNotIn(ids ...int) predicate.Process {\n\treturn predicate.Process(sql.FieldNotIn(FieldID, ids...))\n}", "title": "" }, { "docid": "95fa6d59d941d7248cbdd3dddc6adab8", "score": "0.8124964", "text": "func IDNotIn(ids ...int) predicate.File {\n\treturn predicate.File(sql.FieldNotIn(FieldID, ids...))\n}", "title": "" }, { "docid": "6c162d9f810d19cf24e8f0f83e1b6898", "score": "0.8116083", "text": "func (qs FrameQuerySet) IDNotIn(ID uint, IDRest ...uint) FrameQuerySet {\n\tiArgs := []interface{}{ID}\n\tfor _, arg := range IDRest {\n\t\tiArgs = append(iArgs, arg)\n\t}\n\treturn qs.w(qs.db.Where(\"id NOT IN (?)\", iArgs))\n}", "title": "" }, { "docid": "e419df3dd9ad124d2ce6a95a8b7b5c1b", "score": "0.8113161", "text": "func IDNotIn(ids ...int) predicate.Template {\n\treturn predicate.Template(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(ids) == 0 {\n\t\t\ts.Where(sql.False())\n\t\t\treturn\n\t\t}\n\t\tv := make([]interface{}, len(ids))\n\t\tfor i := range v {\n\t\t\tv[i] = ids[i]\n\t\t}\n\t\ts.Where(sql.NotIn(s.C(FieldID), v...))\n\t})\n}", "title": "" }, { "docid": "1449f4342dc08c3c3e8278f2fad16498", "score": "0.80882305", "text": "func IDNotIn(ids ...int) predicate.MoreInfoModule {\n\treturn predicate.MoreInfoModule(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(ids) == 0 {\n\t\t\ts.Where(sql.False())\n\t\t\treturn\n\t\t}\n\t\tv := make([]interface{}, len(ids))\n\t\tfor i := range v {\n\t\t\tv[i] = ids[i]\n\t\t}\n\t\ts.Where(sql.NotIn(s.C(FieldID), v...))\n\t})\n}", "title": "" }, { "docid": "f70f0ade458f6b8468f1967673925def", "score": "0.80820817", "text": "func IDNotIn(ids ...int) predicate.Lease {\n\treturn predicate.Lease(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(ids) == 0 {\n\t\t\ts.Where(sql.False())\n\t\t\treturn\n\t\t}\n\t\tv := make([]interface{}, len(ids))\n\t\tfor i := range v {\n\t\t\tv[i] = ids[i]\n\t\t}\n\t\ts.Where(sql.NotIn(s.C(FieldID), v...))\n\t})\n}", "title": "" }, { "docid": "d52cd70657e7ab4993e4deaf08df05aa", "score": "0.8066697", "text": "func IDNotIn(ids ...int) predicate.Entity {\n\treturn predicate.Entity(sql.FieldNotIn(FieldID, ids...))\n}", "title": "" }, { "docid": "a6d5524900be4bf707e0aea8d57997cc", "score": "0.8064301", "text": "func IDNotIn(ids ...int) predicate.Register {\n\treturn predicate.Register(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(ids) == 0 {\n\t\t\ts.Where(sql.False())\n\t\t\treturn\n\t\t}\n\t\tv := make([]interface{}, len(ids))\n\t\tfor i := range v {\n\t\t\tv[i] = ids[i]\n\t\t}\n\t\ts.Where(sql.NotIn(s.C(FieldID), v...))\n\t})\n}", "title": "" }, { "docid": "28faab72d16675072496ad42df4b9d02", "score": "0.8060657", "text": "func IDNotIn(ids ...int) predicate.BaselineCharacteristicsModule {\n\treturn predicate.BaselineCharacteristicsModule(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(ids) == 0 {\n\t\t\ts.Where(sql.False())\n\t\t\treturn\n\t\t}\n\t\tv := make([]interface{}, len(ids))\n\t\tfor i := range v {\n\t\t\tv[i] = ids[i]\n\t\t}\n\t\ts.Where(sql.NotIn(s.C(FieldID), v...))\n\t})\n}", "title": "" }, { "docid": "52acecb32f85676529ffce372c87965d", "score": "0.80562454", "text": "func IDNotIn(ids ...int) predicate.AdminSession {\n\treturn predicate.AdminSession(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(ids) == 0 {\n\t\t\ts.Where(sql.False())\n\t\t\treturn\n\t\t}\n\t\tv := make([]interface{}, len(ids))\n\t\tfor i := range v {\n\t\t\tv[i] = ids[i]\n\t\t}\n\t\ts.Where(sql.NotIn(s.C(FieldID), v...))\n\t})\n}", "title": "" }, { "docid": "eceffb0b1107363f56026b4357f3d08d", "score": "0.8053782", "text": "func IDNotIn(ids ...int) predicate.NetInterface {\n\treturn predicate.NetInterface(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(ids) == 0 {\n\t\t\ts.Where(sql.False())\n\t\t\treturn\n\t\t}\n\t\tv := make([]interface{}, len(ids))\n\t\tfor i := range v {\n\t\t\tv[i] = ids[i]\n\t\t}\n\t\ts.Where(sql.NotIn(s.C(FieldID), v...))\n\t})\n}", "title": "" }, { "docid": "f94199bac48d43583fc91ebb4c535bb9", "score": "0.8049947", "text": "func IDNotIn(ids ...uuid.UUID) predicate.Request {\n\treturn predicate.Request(sql.FieldNotIn(FieldID, ids...))\n}", "title": "" }, { "docid": "452e5ca5443db87466d0e883e8e5308e", "score": "0.80472195", "text": "func IDNotIn(ids ...int) predicate.User {\n\treturn predicate.User(sql.FieldNotIn(FieldID, ids...))\n}", "title": "" }, { "docid": "6cc11ff55aa0b47b7124c54ce8b44540", "score": "0.8037346", "text": "func IDNotIn(ids ...int) predicate.Agentkyc {\n\treturn predicate.Agentkyc(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(ids) == 0 {\n\t\t\ts.Where(sql.False())\n\t\t\treturn\n\t\t}\n\t\tv := make([]interface{}, len(ids))\n\t\tfor i := range v {\n\t\t\tv[i] = ids[i]\n\t\t}\n\t\ts.Where(sql.NotIn(s.C(FieldID), v...))\n\t})\n}", "title": "" }, { "docid": "c7b6d20162eca187348cd5ed1ca4ab5d", "score": "0.8034318", "text": "func IDNotIn(ids ...int) predicate.Account {\n\treturn predicate.Account(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(ids) == 0 {\n\t\t\ts.Where(sql.False())\n\t\t\treturn\n\t\t}\n\t\tv := make([]interface{}, len(ids))\n\t\tfor i := range v {\n\t\t\tv[i] = ids[i]\n\t\t}\n\t\ts.Where(sql.NotIn(s.C(FieldID), v...))\n\t})\n}", "title": "" }, { "docid": "4bba88ea4730cd0466dbec7de7e25909", "score": "0.8031426", "text": "func IDNotIn(ids ...int) predicate.Tag {\n\treturn predicate.Tag(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(ids) == 0 {\n\t\t\ts.Where(sql.False())\n\t\t\treturn\n\t\t}\n\t\tv := make([]interface{}, len(ids))\n\t\tfor i := range v {\n\t\t\tv[i] = ids[i]\n\t\t}\n\t\ts.Where(sql.NotIn(s.C(FieldID), v...))\n\t})\n}", "title": "" }, { "docid": "4bba88ea4730cd0466dbec7de7e25909", "score": "0.8031426", "text": "func IDNotIn(ids ...int) predicate.Tag {\n\treturn predicate.Tag(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(ids) == 0 {\n\t\t\ts.Where(sql.False())\n\t\t\treturn\n\t\t}\n\t\tv := make([]interface{}, len(ids))\n\t\tfor i := range v {\n\t\t\tv[i] = ids[i]\n\t\t}\n\t\ts.Where(sql.NotIn(s.C(FieldID), v...))\n\t})\n}", "title": "" }, { "docid": "33c6da419aefacefc9f2aacd192ca046", "score": "0.80278224", "text": "func IDNotIn(ids ...int) predicate.Specialdoctor {\n\treturn predicate.Specialdoctor(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(ids) == 0 {\n\t\t\ts.Where(sql.False())\n\t\t\treturn\n\t\t}\n\t\tv := make([]interface{}, len(ids))\n\t\tfor i := range v {\n\t\t\tv[i] = ids[i]\n\t\t}\n\t\ts.Where(sql.NotIn(s.C(FieldID), v...))\n\t})\n}", "title": "" }, { "docid": "b6e3f9b37b0b7ad056c3d1dbed361099", "score": "0.802341", "text": "func IDNotIn(ids ...int) predicate.TravelRestrictionSnapshot {\n\treturn predicate.TravelRestrictionSnapshot(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(ids) == 0 {\n\t\t\ts.Where(sql.False())\n\t\t\treturn\n\t\t}\n\t\tv := make([]interface{}, len(ids))\n\t\tfor i := range v {\n\t\t\tv[i] = ids[i]\n\t\t}\n\t\ts.Where(sql.NotIn(s.C(FieldID), v...))\n\t})\n}", "title": "" }, { "docid": "fdd6173074a1fdf2bf484e4b2ea45c64", "score": "0.8020191", "text": "func IDNotIn(ids ...int) predicate.UserStatus {\n\treturn predicate.UserStatus(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(ids) == 0 {\n\t\t\ts.Where(sql.False())\n\t\t\treturn\n\t\t}\n\t\tv := make([]interface{}, len(ids))\n\t\tfor i := range v {\n\t\t\tv[i] = ids[i]\n\t\t}\n\t\ts.Where(sql.NotIn(s.C(FieldID), v...))\n\t})\n}", "title": "" }, { "docid": "8b9f5c112187e83c02887a12dbbd998e", "score": "0.80154705", "text": "func IDNotIn(ids ...int) predicate.K8sMetric {\n\treturn predicate.K8sMetric(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(ids) == 0 {\n\t\t\ts.Where(sql.False())\n\t\t\treturn\n\t\t}\n\t\tv := make([]interface{}, len(ids))\n\t\tfor i := range v {\n\t\t\tv[i] = ids[i]\n\t\t}\n\t\ts.Where(sql.NotIn(s.C(FieldID), v...))\n\t})\n}", "title": "" }, { "docid": "c5ada72802ccb6a5165f88aaa4bc2fdc", "score": "0.80147606", "text": "func IDNotIn(ids ...int) predicate.Receipt {\n\treturn predicate.Receipt(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(ids) == 0 {\n\t\t\ts.Where(sql.False())\n\t\t\treturn\n\t\t}\n\t\tv := make([]interface{}, len(ids))\n\t\tfor i := range v {\n\t\t\tv[i] = ids[i]\n\t\t}\n\t\ts.Where(sql.NotIn(s.C(FieldID), v...))\n\t})\n}", "title": "" }, { "docid": "dbc26bc3b184d9f53ee211d0de918658", "score": "0.8012907", "text": "func IDNotIn(ids ...int) predicate.CheckIn {\n\treturn predicate.CheckIn(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(ids) == 0 {\n\t\t\ts.Where(sql.False())\n\t\t\treturn\n\t\t}\n\t\tv := make([]interface{}, len(ids))\n\t\tfor i := range v {\n\t\t\tv[i] = ids[i]\n\t\t}\n\t\ts.Where(sql.NotIn(s.C(FieldID), v...))\n\t})\n}", "title": "" }, { "docid": "4639bcbaf68b3223d8de525774dcccd8", "score": "0.80025905", "text": "func IDNotIn(ids ...int) predicate.Pointpendinglbtransaction {\n\treturn predicate.Pointpendinglbtransaction(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(ids) == 0 {\n\t\t\ts.Where(sql.False())\n\t\t\treturn\n\t\t}\n\t\tv := make([]interface{}, len(ids))\n\t\tfor i := range v {\n\t\t\tv[i] = ids[i]\n\t\t}\n\t\ts.Where(sql.NotIn(s.C(FieldID), v...))\n\t})\n}", "title": "" }, { "docid": "3619991d0873f00b82bd192e5d3b5041", "score": "0.800095", "text": "func IDNotIn(ids ...int) predicate.Prescription {\n\treturn predicate.Prescription(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(ids) == 0 {\n\t\t\ts.Where(sql.False())\n\t\t\treturn\n\t\t}\n\t\tv := make([]interface{}, len(ids))\n\t\tfor i := range v {\n\t\t\tv[i] = ids[i]\n\t\t}\n\t\ts.Where(sql.NotIn(s.C(FieldID), v...))\n\t})\n}", "title": "" }, { "docid": "ca4faf582380ecec2d4ad44c5a9bd843", "score": "0.79950076", "text": "func IDNotIn(ids ...int) predicate.Courseclass {\n\treturn predicate.Courseclass(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(ids) == 0 {\n\t\t\ts.Where(sql.False())\n\t\t\treturn\n\t\t}\n\t\tv := make([]interface{}, len(ids))\n\t\tfor i := range v {\n\t\t\tv[i] = ids[i]\n\t\t}\n\t\ts.Where(sql.NotIn(s.C(FieldID), v...))\n\t})\n}", "title": "" }, { "docid": "2fcd67eb980b9d5159aa5739c1feb943", "score": "0.7986734", "text": "func IDNotIn(ids ...int) predicate.Drug {\n\treturn predicate.Drug(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(ids) == 0 {\n\t\t\ts.Where(sql.False())\n\t\t\treturn\n\t\t}\n\t\tv := make([]interface{}, len(ids))\n\t\tfor i := range v {\n\t\t\tv[i] = ids[i]\n\t\t}\n\t\ts.Where(sql.NotIn(s.C(FieldID), v...))\n\t})\n}", "title": "" }, { "docid": "ec2fa2e7f972ad1fc48dac87f9263729", "score": "0.79844487", "text": "func IDNotIn(ids ...int) predicate.Scholarshiptype {\n\treturn predicate.Scholarshiptype(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(ids) == 0 {\n\t\t\ts.Where(sql.False())\n\t\t\treturn\n\t\t}\n\t\tv := make([]interface{}, len(ids))\n\t\tfor i := range v {\n\t\t\tv[i] = ids[i]\n\t\t}\n\t\ts.Where(sql.NotIn(s.C(FieldID), v...))\n\t})\n}", "title": "" }, { "docid": "5122bd2dff87f44fdac1160ab16ddf07", "score": "0.7981525", "text": "func IDNotIn(ids ...int) predicate.Customer {\n\treturn predicate.Customer(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(ids) == 0 {\n\t\t\ts.Where(sql.False())\n\t\t\treturn\n\t\t}\n\t\tv := make([]interface{}, len(ids))\n\t\tfor i := range v {\n\t\t\tv[i] = ids[i]\n\t\t}\n\t\ts.Where(sql.NotIn(s.C(FieldID), v...))\n\t})\n}", "title": "" }, { "docid": "dc38258e01a5610f859530c518c22630", "score": "0.7973724", "text": "func IDNotIn(ids ...int) predicate.Media {\n\treturn predicate.Media(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(ids) == 0 {\n\t\t\ts.Where(sql.False())\n\t\t\treturn\n\t\t}\n\t\tv := make([]interface{}, len(ids))\n\t\tfor i := range v {\n\t\t\tv[i] = ids[i]\n\t\t}\n\t\ts.Where(sql.NotIn(s.C(FieldID), v...))\n\t})\n}", "title": "" }, { "docid": "85b1fb67a82307e05c2d45b4446cc7fc", "score": "0.79730576", "text": "func IDNotIn(ids ...int) predicate.ExValueScan {\n\treturn predicate.ExValueScan(sql.FieldNotIn(FieldID, ids...))\n}", "title": "" }, { "docid": "df13c0c0793e0c30373124639a520a6c", "score": "0.7969618", "text": "func IDNotIn(ids ...int) predicate.Patient {\n\treturn predicate.Patient(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(ids) == 0 {\n\t\t\ts.Where(sql.False())\n\t\t\treturn\n\t\t}\n\t\tv := make([]interface{}, len(ids))\n\t\tfor i := range v {\n\t\t\tv[i] = ids[i]\n\t\t}\n\t\ts.Where(sql.NotIn(s.C(FieldID), v...))\n\t})\n}", "title": "" }, { "docid": "df13c0c0793e0c30373124639a520a6c", "score": "0.7969618", "text": "func IDNotIn(ids ...int) predicate.Patient {\n\treturn predicate.Patient(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(ids) == 0 {\n\t\t\ts.Where(sql.False())\n\t\t\treturn\n\t\t}\n\t\tv := make([]interface{}, len(ids))\n\t\tfor i := range v {\n\t\t\tv[i] = ids[i]\n\t\t}\n\t\ts.Where(sql.NotIn(s.C(FieldID), v...))\n\t})\n}", "title": "" }, { "docid": "df13c0c0793e0c30373124639a520a6c", "score": "0.7969618", "text": "func IDNotIn(ids ...int) predicate.Patient {\n\treturn predicate.Patient(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(ids) == 0 {\n\t\t\ts.Where(sql.False())\n\t\t\treturn\n\t\t}\n\t\tv := make([]interface{}, len(ids))\n\t\tfor i := range v {\n\t\t\tv[i] = ids[i]\n\t\t}\n\t\ts.Where(sql.NotIn(s.C(FieldID), v...))\n\t})\n}", "title": "" }, { "docid": "01982183da807910cd139c743e7d7b64", "score": "0.7967867", "text": "func IDNotIn(ids ...int) predicate.ProblemStatus {\n\treturn predicate.ProblemStatus(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(ids) == 0 {\n\t\t\ts.Where(sql.False())\n\t\t\treturn\n\t\t}\n\t\tv := make([]interface{}, len(ids))\n\t\tfor i := range v {\n\t\t\tv[i] = ids[i]\n\t\t}\n\t\ts.Where(sql.NotIn(s.C(FieldID), v...))\n\t})\n}", "title": "" }, { "docid": "40ae2bc19b6f1dfed6aeb221fc8c4ea7", "score": "0.7961617", "text": "func IDNotIn(ids ...int) predicate.Tweet {\n\treturn predicate.Tweet(sql.FieldNotIn(FieldID, ids...))\n}", "title": "" }, { "docid": "fa0e7a50f3431de793a440ccc988035d", "score": "0.79598683", "text": "func IDNotIn(ids ...string) predicate.DSession {\n\treturn predicate.DSession(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(ids) == 0 {\n\t\t\ts.Where(sql.False())\n\t\t\treturn\n\t\t}\n\t\tv := make([]interface{}, len(ids))\n\t\tfor i := range v {\n\t\t\tv[i] = ids[i]\n\t\t}\n\t\ts.Where(sql.NotIn(s.C(FieldID), v...))\n\t})\n}", "title": "" }, { "docid": "e236d24bd148ef961f1de235681e74b5", "score": "0.7957956", "text": "func IDNotIn(ids ...int) predicate.Roomtype {\n\treturn predicate.Roomtype(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(ids) == 0 {\n\t\t\ts.Where(sql.False())\n\t\t\treturn\n\t\t}\n\t\tv := make([]interface{}, len(ids))\n\t\tfor i := range v {\n\t\t\tv[i] = ids[i]\n\t\t}\n\t\ts.Where(sql.NotIn(s.C(FieldID), v...))\n\t})\n}", "title": "" }, { "docid": "b584587b215b6b720289b3d5c0548489", "score": "0.7951877", "text": "func IDNotIn(ids ...string) predicate.DRoom {\n\treturn predicate.DRoom(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(ids) == 0 {\n\t\t\ts.Where(sql.False())\n\t\t\treturn\n\t\t}\n\t\tv := make([]interface{}, len(ids))\n\t\tfor i := range v {\n\t\t\tv[i] = ids[i]\n\t\t}\n\t\ts.Where(sql.NotIn(s.C(FieldID), v...))\n\t})\n}", "title": "" }, { "docid": "478efee301122cadcedadf056094f853", "score": "0.7950608", "text": "func IDNotIn(ids ...int) predicate.Educationlevel {\n\treturn predicate.Educationlevel(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(ids) == 0 {\n\t\t\ts.Where(sql.False())\n\t\t\treturn\n\t\t}\n\t\tv := make([]interface{}, len(ids))\n\t\tfor i := range v {\n\t\t\tv[i] = ids[i]\n\t\t}\n\t\ts.Where(sql.NotIn(s.C(FieldID), v...))\n\t})\n}", "title": "" }, { "docid": "c9f9da0336ff066c5b8e15c28826d18d", "score": "0.79448044", "text": "func IDNotIn(ids ...int) predicate.Taste {\n\treturn predicate.Taste(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(ids) == 0 {\n\t\t\ts.Where(sql.False())\n\t\t\treturn\n\t\t}\n\t\tv := make([]interface{}, len(ids))\n\t\tfor i := range v {\n\t\t\tv[i] = ids[i]\n\t\t}\n\t\ts.Where(sql.NotIn(s.C(FieldID), v...))\n\t})\n}", "title": "" }, { "docid": "7d74c06259a6cfed097840cc17b6f689", "score": "0.7944439", "text": "func IDNotIn(ids ...int) predicate.Dentist {\n\treturn predicate.Dentist(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(ids) == 0 {\n\t\t\ts.Where(sql.False())\n\t\t\treturn\n\t\t}\n\t\tv := make([]interface{}, len(ids))\n\t\tfor i := range v {\n\t\t\tv[i] = ids[i]\n\t\t}\n\t\ts.Where(sql.NotIn(s.C(FieldID), v...))\n\t})\n}", "title": "" }, { "docid": "b6b6ce13871861e8e5b51ca8234e6769", "score": "0.7944", "text": "func IDNotIn(ids ...int64) predicate.ServiceInfo {\n\treturn predicate.ServiceInfo(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(ids) == 0 {\n\t\t\ts.Where(sql.False())\n\t\t\treturn\n\t\t}\n\t\tv := make([]interface{}, len(ids))\n\t\tfor i := range v {\n\t\t\tv[i] = ids[i]\n\t\t}\n\t\ts.Where(sql.NotIn(s.C(FieldID), v...))\n\t})\n}", "title": "" }, { "docid": "33a07860a8b59b05a0da8d27d1ccc335", "score": "0.79438984", "text": "func IDNotIn(ids ...int) predicate.Device {\n\treturn predicate.Device(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(ids) == 0 {\n\t\t\ts.Where(sql.False())\n\t\t\treturn\n\t\t}\n\t\tv := make([]interface{}, len(ids))\n\t\tfor i := range v {\n\t\t\tv[i] = ids[i]\n\t\t}\n\t\ts.Where(sql.NotIn(s.C(FieldID), v...))\n\t})\n}", "title": "" }, { "docid": "c73df20abc38be83eccb5b623c4fd588", "score": "0.79432666", "text": "func IDNotIn(ids ...int) predicate.Room {\n\treturn predicate.Room(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(ids) == 0 {\n\t\t\ts.Where(sql.False())\n\t\t\treturn\n\t\t}\n\t\tv := make([]interface{}, len(ids))\n\t\tfor i := range v {\n\t\t\tv[i] = ids[i]\n\t\t}\n\t\ts.Where(sql.NotIn(s.C(FieldID), v...))\n\t})\n}", "title": "" }, { "docid": "98e788c4f6b7c1d33d56d53a10edd805", "score": "0.7939183", "text": "func (qs SpriteQuerySet) IDNotIn(ID uint, IDRest ...uint) SpriteQuerySet {\n\tiArgs := []interface{}{ID}\n\tfor _, arg := range IDRest {\n\t\tiArgs = append(iArgs, arg)\n\t}\n\treturn qs.w(qs.db.Where(\"id NOT IN (?)\", iArgs))\n}", "title": "" }, { "docid": "8609440da6c598368d6ae5abbaf54f95", "score": "0.7938253", "text": "func IDNotIn(ids ...int) predicate.DNSDetectorResult {\n\treturn predicate.DNSDetectorResult(sql.FieldNotIn(FieldID, ids...))\n}", "title": "" }, { "docid": "c68adf3bea42af3c301afa3872a66935", "score": "0.79379016", "text": "func IDNotIn(ids ...int) predicate.EntityAddress {\n\treturn predicate.EntityAddress(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(ids) == 0 {\n\t\t\ts.Where(sql.False())\n\t\t\treturn\n\t\t}\n\t\tv := make([]interface{}, len(ids))\n\t\tfor i := range v {\n\t\t\tv[i] = ids[i]\n\t\t}\n\t\ts.Where(sql.NotIn(s.C(FieldID), v...))\n\t})\n}", "title": "" }, { "docid": "b67f2b7d736237af44ece530beced6a6", "score": "0.79371893", "text": "func IDNotIn(ids ...int) predicate.Employee {\n\treturn predicate.Employee(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(ids) == 0 {\n\t\t\ts.Where(sql.False())\n\t\t\treturn\n\t\t}\n\t\tv := make([]interface{}, len(ids))\n\t\tfor i := range v {\n\t\t\tv[i] = ids[i]\n\t\t}\n\t\ts.Where(sql.NotIn(s.C(FieldID), v...))\n\t})\n}", "title": "" }, { "docid": "e80ae2b9274cff4d5fb73fccf40fbf56", "score": "0.79352736", "text": "func IDNotIn(ids ...uuid.UUID) predicate.InstanceRuntime {\n\treturn predicate.InstanceRuntime(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(ids) == 0 {\n\t\t\ts.Where(sql.False())\n\t\t\treturn\n\t\t}\n\t\tv := make([]interface{}, len(ids))\n\t\tfor i := range v {\n\t\t\tv[i] = ids[i]\n\t\t}\n\t\ts.Where(sql.NotIn(s.C(FieldID), v...))\n\t})\n}", "title": "" }, { "docid": "96398bc344af44f6ee35166b9e6c3545", "score": "0.79202694", "text": "func IDNotIn(ids ...string) predicate.Character {\n\treturn predicate.Character(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(ids) == 0 {\n\t\t\ts.Where(sql.False())\n\t\t\treturn\n\t\t}\n\t\tv := make([]interface{}, len(ids))\n\t\tfor i := range v {\n\t\t\tv[i] = ids[i]\n\t\t}\n\t\ts.Where(sql.NotIn(s.C(FieldID), v...))\n\t})\n}", "title": "" }, { "docid": "2b0688464126054a6f7835f0bb0914f6", "score": "0.79163986", "text": "func IDNotIn(ids ...uuid.UUID) predicate.Operation {\n\treturn predicate.Operation(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(ids) == 0 {\n\t\t\ts.Where(sql.False())\n\t\t\treturn\n\t\t}\n\t\tv := make([]interface{}, len(ids))\n\t\tfor i := range v {\n\t\t\tv[i] = ids[i]\n\t\t}\n\t\ts.Where(sql.NotIn(s.C(FieldID), v...))\n\t})\n}", "title": "" }, { "docid": "9e2a739b81c965fb92cbfae0df94687e", "score": "0.79155284", "text": "func IDNotIn(ids ...int) predicate.DetectionJobInstance {\n\treturn predicate.DetectionJobInstance(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(ids) == 0 {\n\t\t\ts.Where(sql.False())\n\t\t\treturn\n\t\t}\n\t\tv := make([]interface{}, len(ids))\n\t\tfor i := range v {\n\t\t\tv[i] = ids[i]\n\t\t}\n\t\ts.Where(sql.NotIn(s.C(FieldID), v...))\n\t})\n}", "title": "" }, { "docid": "b7fd0c329f4e059c665a60b2a1535879", "score": "0.7911612", "text": "func IDNotIn(ids ...string) predicate.Sample {\n\treturn predicate.Sample(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(ids) == 0 {\n\t\t\ts.Where(sql.False())\n\t\t\treturn\n\t\t}\n\t\tv := make([]interface{}, len(ids))\n\t\tfor i := range v {\n\t\t\tv[i] = ids[i]\n\t\t}\n\t\ts.Where(sql.NotIn(s.C(FieldID), v...))\n\t})\n}", "title": "" }, { "docid": "680ba7d7a50a16fcdc7dd79583472b3c", "score": "0.79092944", "text": "func IDNotIn(ids ...uint64) predicate.District {\n\treturn predicate.District(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(ids) == 0 {\n\t\t\ts.Where(sql.False())\n\t\t\treturn\n\t\t}\n\t\tv := make([]interface{}, len(ids))\n\t\tfor i := range v {\n\t\t\tv[i] = ids[i]\n\t\t}\n\t\ts.Where(sql.NotIn(s.C(FieldID), v...))\n\t})\n}", "title": "" }, { "docid": "73aa2f27b4a1df660a4947daf50198b2", "score": "0.79070705", "text": "func IDNotIn(ids ...int) predicate.Task {\n\treturn predicate.Task(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(ids) == 0 {\n\t\t\ts.Where(sql.False())\n\t\t\treturn\n\t\t}\n\t\tv := make([]interface{}, len(ids))\n\t\tfor i := range v {\n\t\t\tv[i] = ids[i]\n\t\t}\n\t\ts.Where(sql.NotIn(s.C(FieldID), v...))\n\t})\n}", "title": "" }, { "docid": "978256d7d6107fabe549d8a7e3129ef0", "score": "0.7885571", "text": "func IDNotIn(ids ...int) predicate.Staff {\n\treturn predicate.Staff(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(ids) == 0 {\n\t\t\ts.Where(sql.False())\n\t\t\treturn\n\t\t}\n\t\tv := make([]interface{}, len(ids))\n\t\tfor i := range v {\n\t\t\tv[i] = ids[i]\n\t\t}\n\t\ts.Where(sql.NotIn(s.C(FieldID), v...))\n\t})\n}", "title": "" }, { "docid": "0bda65718c8a95f170b437633a24c928", "score": "0.78822136", "text": "func IDNotIn(ids ...int) predicate.Transactionfactorhistory {\n\treturn predicate.Transactionfactorhistory(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(ids) == 0 {\n\t\t\ts.Where(sql.False())\n\t\t\treturn\n\t\t}\n\t\tv := make([]interface{}, len(ids))\n\t\tfor i := range v {\n\t\t\tv[i] = ids[i]\n\t\t}\n\t\ts.Where(sql.NotIn(s.C(FieldID), v...))\n\t})\n}", "title": "" }, { "docid": "20ae8b7200d2ee266f0d416327ecf67d", "score": "0.7881929", "text": "func IDNotIn(ids ...int64) predicate.Sensor {\n\treturn predicate.Sensor(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(ids) == 0 {\n\t\t\ts.Where(sql.False())\n\t\t\treturn\n\t\t}\n\t\tv := make([]interface{}, len(ids))\n\t\tfor i := range v {\n\t\t\tv[i] = ids[i]\n\t\t}\n\t\ts.Where(sql.NotIn(s.C(FieldID), v...))\n\t})\n}", "title": "" }, { "docid": "2ae9cb8208ba933806b4ee842983b184", "score": "0.7879277", "text": "func IDNotIn(ids ...string) predicate.OfflineSession {\n\treturn predicate.OfflineSession(func(s *sql.Selector) {\n\t\tv := make([]interface{}, len(ids))\n\t\tfor i := range v {\n\t\t\tv[i] = ids[i]\n\t\t}\n\t\ts.Where(sql.NotIn(s.C(FieldID), v...))\n\t})\n}", "title": "" }, { "docid": "5fff6c33dad000fbaed9f5189dc2afcb", "score": "0.78765935", "text": "func IDNotIn(ids ...int) predicate.FixRoom {\n\treturn predicate.FixRoom(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(ids) == 0 {\n\t\t\ts.Where(sql.False())\n\t\t\treturn\n\t\t}\n\t\tv := make([]interface{}, len(ids))\n\t\tfor i := range v {\n\t\t\tv[i] = ids[i]\n\t\t}\n\t\ts.Where(sql.NotIn(s.C(FieldID), v...))\n\t})\n}", "title": "" }, { "docid": "43609875cddd4c49c665568dae964ffe", "score": "0.7873595", "text": "func IDNotIn(ids ...int) predicate.CardScan {\n\treturn predicate.CardScan(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(ids) == 0 {\n\t\t\ts.Where(sql.False())\n\t\t\treturn\n\t\t}\n\t\tv := make([]interface{}, len(ids))\n\t\tfor i := range v {\n\t\t\tv[i] = ids[i]\n\t\t}\n\t\ts.Where(sql.NotIn(s.C(FieldID), v...))\n\t})\n}", "title": "" }, { "docid": "541d74b373abb81f8bfa7278c5f6f295", "score": "0.78632224", "text": "func IDNotIn(ids ...int) predicate.RoutingNumber {\n\treturn predicate.RoutingNumber(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(ids) == 0 {\n\t\t\ts.Where(sql.False())\n\t\t\treturn\n\t\t}\n\t\tv := make([]interface{}, len(ids))\n\t\tfor i := range v {\n\t\t\tv[i] = ids[i]\n\t\t}\n\t\ts.Where(sql.NotIn(s.C(FieldID), v...))\n\t})\n}", "title": "" }, { "docid": "9009db83a800695164a1d4978f6b1162", "score": "0.7857792", "text": "func IDNotIn(ids ...int) predicate.Doctorinfo {\n\treturn predicate.Doctorinfo(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(ids) == 0 {\n\t\t\ts.Where(sql.False())\n\t\t\treturn\n\t\t}\n\t\tv := make([]interface{}, len(ids))\n\t\tfor i := range v {\n\t\t\tv[i] = ids[i]\n\t\t}\n\t\ts.Where(sql.NotIn(s.C(FieldID), v...))\n\t})\n}", "title": "" }, { "docid": "25c2cb9c155ca2cfcbeac1f325208267", "score": "0.7854994", "text": "func IDNotIn(ids ...int) predicate.UserUserTopic {\n\treturn predicate.UserUserTopic(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(ids) == 0 {\n\t\t\ts.Where(sql.False())\n\t\t\treturn\n\t\t}\n\t\tv := make([]interface{}, len(ids))\n\t\tfor i := range v {\n\t\t\tv[i] = ids[i]\n\t\t}\n\t\ts.Where(sql.NotIn(s.C(FieldID), v...))\n\t})\n}", "title": "" }, { "docid": "9e0ef951d3ed6c921c9eb725753d3051", "score": "0.78365064", "text": "func IDNotIn(ids ...int) predicate.EventGroup {\n\treturn predicate.EventGroup(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(ids) == 0 {\n\t\t\ts.Where(sql.False())\n\t\t\treturn\n\t\t}\n\t\tv := make([]interface{}, len(ids))\n\t\tfor i := range v {\n\t\t\tv[i] = ids[i]\n\t\t}\n\t\ts.Where(sql.NotIn(s.C(FieldID), v...))\n\t})\n}", "title": "" }, { "docid": "88a1468d4cfd77b7b7cf4e937d06de9d", "score": "0.7824283", "text": "func IDNotIn(ids ...uuid.UUID) predicate.User {\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(ids) == 0 {\n\t\t\ts.Where(sql.False())\n\t\t\treturn\n\t\t}\n\t\tv := make([]interface{}, len(ids))\n\t\tfor i := range v {\n\t\t\tv[i] = ids[i]\n\t\t}\n\t\ts.Where(sql.NotIn(s.C(FieldID), v...))\n\t})\n}", "title": "" }, { "docid": "6f8a25806afa74d74e6b3d5e0f0f7341", "score": "0.7781392", "text": "func IDNotIn(ids ...int) predicate.SubjectsOffered {\n\treturn predicate.SubjectsOffered(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(ids) == 0 {\n\t\t\ts.Where(sql.False())\n\t\t\treturn\n\t\t}\n\t\tv := make([]interface{}, len(ids))\n\t\tfor i := range v {\n\t\t\tv[i] = ids[i]\n\t\t}\n\t\ts.Where(sql.NotIn(s.C(FieldID), v...))\n\t})\n}", "title": "" }, { "docid": "ea460bc28dde1274197060fedcbbda65", "score": "0.7770854", "text": "func IDNotIn(ids ...uuid.UUID) predicate.Survey {\n\treturn predicate.Survey(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(ids) == 0 {\n\t\t\ts.Where(sql.False())\n\t\t\treturn\n\t\t}\n\t\tv := make([]interface{}, len(ids))\n\t\tfor i := range v {\n\t\t\tv[i] = ids[i]\n\t\t}\n\t\ts.Where(sql.NotIn(s.C(FieldID), v...))\n\t})\n}", "title": "" }, { "docid": "b1d91ab9685d81e066c6994d248ec066", "score": "0.7762203", "text": "func IDNotIn(ids ...int) predicate.Groups {\n\treturn predicate.Groups(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(ids) == 0 {\n\t\t\ts.Where(sql.False())\n\t\t\treturn\n\t\t}\n\t\tv := make([]interface{}, len(ids))\n\t\tfor i := range v {\n\t\t\tv[i] = ids[i]\n\t\t}\n\t\ts.Where(sql.NotIn(s.C(FieldID), v...))\n\t})\n}", "title": "" }, { "docid": "629430f06c143bd82406925d4713f613", "score": "0.7734569", "text": "func IDNotIn(ids ...uuid.UUID) predicate.Wallet {\n\treturn predicate.Wallet(func(s *sql.Selector) {\n\t\tv := make([]interface{}, len(ids))\n\t\tfor i := range v {\n\t\t\tv[i] = ids[i]\n\t\t}\n\t\ts.Where(sql.NotIn(s.C(FieldID), v...))\n\t})\n}", "title": "" }, { "docid": "63d909d69bf429d7de2e06329f5be27d", "score": "0.76748455", "text": "func IDNotIn(ids ...int) predicate.FurnitureDetail {\n\treturn predicate.FurnitureDetail(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(ids) == 0 {\n\t\t\ts.Where(sql.False())\n\t\t\treturn\n\t\t}\n\t\tv := make([]interface{}, len(ids))\n\t\tfor i := range v {\n\t\t\tv[i] = ids[i]\n\t\t}\n\t\ts.Where(sql.NotIn(s.C(FieldID), v...))\n\t})\n}", "title": "" }, { "docid": "889f6c048c33261a33194620b98d77e7", "score": "0.7659756", "text": "func IDNotIn(ids ...int) predicate.IPStaticRoutingTable {\n\treturn predicate.IPStaticRoutingTable(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(ids) == 0 {\n\t\t\ts.Where(sql.False())\n\t\t\treturn\n\t\t}\n\t\tv := make([]interface{}, len(ids))\n\t\tfor i := range v {\n\t\t\tv[i] = ids[i]\n\t\t}\n\t\ts.Where(sql.NotIn(s.C(FieldID), v...))\n\t})\n}", "title": "" }, { "docid": "55184d9be6a4ba6d2f33b9da2dd3c5da", "score": "0.7644136", "text": "func IDNotIn(ids ...string) predicate.Group {\n\treturn predicate.Group(func(t *dsl.Traversal) {\n\t\tv := make([]interface{}, len(ids))\n\t\tfor i := range v {\n\t\t\tv[i] = ids[i]\n\t\t}\n\t\tt.HasID(p.Without(v...))\n\t})\n}", "title": "" }, { "docid": "e9a9f15a699a12e8a369e67ac47fa7b5", "score": "0.75770026", "text": "func FieldIDNotIn(vs ...int) predicate.File {\n\treturn predicate.File(sql.FieldNotIn(FieldFieldID, vs...))\n}", "title": "" }, { "docid": "790f13a247d5257573e42b59741acffe", "score": "0.7445375", "text": "func PidNotIn(vs ...string) predicate.Account {\n\tv := make([]interface{}, len(vs))\n\tfor i := range v {\n\t\tv[i] = vs[i]\n\t}\n\treturn predicate.Account(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(FieldPid), v...))\n\t})\n}", "title": "" }, { "docid": "c3ade9769a216aac8644b6ac7f4f0f34", "score": "0.73784244", "text": "func MEMBERIDNotIn(vs ...string) predicate.Member {\n\tv := make([]interface{}, len(vs))\n\tfor i := range v {\n\t\tv[i] = vs[i]\n\t}\n\treturn predicate.Member(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(FieldMEMBERID), v...))\n\t})\n}", "title": "" }, { "docid": "2f181dc628b20f69f92d2601a02270ff", "score": "0.73771924", "text": "func InviterIDNotIn(vs ...int) predicate.UserUserTopic {\n\tv := make([]interface{}, len(vs))\n\tfor i := range v {\n\t\tv[i] = vs[i]\n\t}\n\treturn predicate.UserUserTopic(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(FieldInviterID), v...))\n\t})\n}", "title": "" }, { "docid": "3c8ea82700a07d236cb01a0f6333db5b", "score": "0.7372731", "text": "func RoleIDNotIn(vs ...int) predicate.Account {\n\tv := make([]interface{}, len(vs))\n\tfor i := range v {\n\t\tv[i] = vs[i]\n\t}\n\treturn predicate.Account(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(FieldRoleID), v...))\n\t})\n}", "title": "" }, { "docid": "a46bd78acb07ad4d80d4d0fc44e01c58", "score": "0.7371409", "text": "func PidNotIn(vs ...uint64) predicate.District {\n\tv := make([]interface{}, len(vs))\n\tfor i := range v {\n\t\tv[i] = vs[i]\n\t}\n\treturn predicate.District(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(FieldPid), v...))\n\t})\n}", "title": "" }, { "docid": "922b672b7f7a8add477cd5b3a680aaf7", "score": "0.73387533", "text": "func FileimportIDNotIn(vs ...int) predicate.Loanbinding {\n\tv := make([]interface{}, len(vs))\n\tfor i := range v {\n\t\tv[i] = vs[i]\n\t}\n\treturn predicate.Loanbinding(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(FieldFileimportID), v...))\n\t})\n}", "title": "" }, { "docid": "be9ad9c7414aacc390d0b18e1843fd01", "score": "0.7308437", "text": "func RoleIDNotIn(vs ...int) predicate.RoleUser {\n\treturn predicate.RoleUser(sql.FieldNotIn(FieldRoleID, vs...))\n}", "title": "" }, { "docid": "8c9b88f4119509c14cd285131f02be99", "score": "0.729543", "text": "func CrmIDNotIn(vs ...uuid.UUID) 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.NotIn(s.C(FieldCrmID), v...))\n\t})\n}", "title": "" }, { "docid": "0e630634aa8c1870bf5504b49907969c", "score": "0.7265838", "text": "func RoomIDNotIn(vs ...string) predicate.DSession {\n\tv := make([]interface{}, len(vs))\n\tfor i := range v {\n\t\tv[i] = vs[i]\n\t}\n\treturn predicate.DSession(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(FieldRoomID), v...))\n\t})\n}", "title": "" }, { "docid": "fc407831165f0947e1776d9c8ed31615", "score": "0.7258748", "text": "func OfficeIDNotIn(vs ...int) predicate.Sample {\n\tv := make([]interface{}, len(vs))\n\tfor i := range v {\n\t\tv[i] = vs[i]\n\t}\n\treturn predicate.Sample(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(FieldOfficeID), v...))\n\t})\n}", "title": "" }, { "docid": "17fe600d86f8d1d7c7548830d4da08b8", "score": "0.7240786", "text": "func FileimportIDNotIn(vs ...int) predicate.Agentkyc {\n\tv := make([]interface{}, len(vs))\n\tfor i := range v {\n\t\tv[i] = vs[i]\n\t}\n\treturn predicate.Agentkyc(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(FieldFileimportID), v...))\n\t})\n}", "title": "" }, { "docid": "70c8a2168d5359001b3491898f27dd3d", "score": "0.71125996", "text": "func AgentIDNotIn(vs ...string) predicate.Agentkyc {\n\tv := make([]interface{}, len(vs))\n\tfor i := range v {\n\t\tv[i] = vs[i]\n\t}\n\treturn predicate.Agentkyc(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(FieldAgentID), v...))\n\t})\n}", "title": "" }, { "docid": "fc9a496ab382b931210dec909f823ebf", "score": "0.71019685", "text": "func WalletIdNotIn(vs ...string) predicate.Loanbinding {\n\tv := make([]interface{}, len(vs))\n\tfor i := range v {\n\t\tv[i] = vs[i]\n\t}\n\treturn predicate.Loanbinding(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(FieldWalletId), v...))\n\t})\n}", "title": "" }, { "docid": "180e30c36e23911fb76982dac96e547b", "score": "0.71017003", "text": "func UserIDNotIn(vs ...int) predicate.Account {\n\tv := make([]interface{}, len(vs))\n\tfor i := range v {\n\t\tv[i] = vs[i]\n\t}\n\treturn predicate.Account(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(FieldUserID), v...))\n\t})\n}", "title": "" }, { "docid": "d224a9cb24056b1059a3a1b0d23f2e75", "score": "0.70902663", "text": "func ExternalIDNotIn(vs ...int) 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.NotIn(s.C(FieldExternalID), v...))\n\t})\n}", "title": "" }, { "docid": "41330a6f338ee099388552dd95109a5c", "score": "0.70842063", "text": "func UserIDNotIn(vs ...int) predicate.UserStatus {\n\tv := make([]interface{}, len(vs))\n\tfor i := range v {\n\t\tv[i] = vs[i]\n\t}\n\treturn predicate.UserStatus(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(FieldUserID), v...))\n\t})\n}", "title": "" }, { "docid": "609e7d01732bf8cdf3ebaca6698b5ee2", "score": "0.7072121", "text": "func LabelIdNotIn(vs ...uint) predicate.K8sMetric {\n\tv := make([]interface{}, len(vs))\n\tfor i := range v {\n\t\tv[i] = vs[i]\n\t}\n\treturn predicate.K8sMetric(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(FieldLabelId), v...))\n\t})\n}", "title": "" }, { "docid": "9c9500b6766858e2c8168e58aa672aa6", "score": "0.7069416", "text": "func UserIDNotIn(vs ...string) predicate.DSession {\n\tv := make([]interface{}, len(vs))\n\tfor i := range v {\n\t\tv[i] = vs[i]\n\t}\n\treturn predicate.DSession(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(FieldUserID), v...))\n\t})\n}", "title": "" } ]
2c7714a42de8019d68924cd9119a9b6a
Delete deletes a pipeline job with the given name. Parameters: resourceGroupName the name of the resource group. The name is case insensitive. accountName the Azure Video Analyzer account name. pipelineJobName the pipeline job name.
[ { "docid": "612340bd80b1700015d8a9804b782836", "score": "0.728211", "text": "func (client PipelineJobsClient) Delete(ctx context.Context, resourceGroupName string, accountName string, pipelineJobName string) (result autorest.Response, err error) {\n\tif tracing.IsEnabled() {\n\t\tctx = tracing.StartSpan(ctx, fqdn+\"/PipelineJobsClient.Delete\")\n\t\tdefer func() {\n\t\t\tsc := -1\n\t\t\tif result.Response != nil {\n\t\t\t\tsc = result.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: client.SubscriptionID,\n\t\t\tConstraints: []validation.Constraint{{Target: \"client.SubscriptionID\", Name: validation.MinLength, Rule: 1, Chain: nil}}},\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}}}}); err != nil {\n\t\treturn result, validation.NewError(\"videoanalyzer.PipelineJobsClient\", \"Delete\", err.Error())\n\t}\n\n\treq, err := client.DeletePreparer(ctx, resourceGroupName, accountName, pipelineJobName)\n\tif err != nil {\n\t\terr = autorest.NewErrorWithError(err, \"videoanalyzer.PipelineJobsClient\", \"Delete\", nil, \"Failure preparing request\")\n\t\treturn\n\t}\n\n\tresp, err := client.DeleteSender(req)\n\tif err != nil {\n\t\tresult.Response = resp\n\t\terr = autorest.NewErrorWithError(err, \"videoanalyzer.PipelineJobsClient\", \"Delete\", resp, \"Failure sending request\")\n\t\treturn\n\t}\n\n\tresult, err = client.DeleteResponder(resp)\n\tif err != nil {\n\t\terr = autorest.NewErrorWithError(err, \"videoanalyzer.PipelineJobsClient\", \"Delete\", resp, \"Failure responding to request\")\n\t\treturn\n\t}\n\n\treturn\n}", "title": "" } ]
[ { "docid": "9d1526fb679db077bd169cd621611c18", "score": "0.6143415", "text": "func (c *Client) DeleteJob(namespace, name string) error {\n\t_, err := c.do(\"DELETE\", jobGeneratePath(namespace, name), nil, nil)\n\treturn errors.Wrap(err, \"failed to delete Job\")\n}", "title": "" }, { "docid": "91698c91f5130ce8382f24253242705f", "score": "0.60677254", "text": "func DeleteJob(db gorp.SqlExecutor, job sdk.Job) error {\n\tif err := deletePipelineActionByActionID(db, job.Action.ID); err != nil {\n\t\treturn err\n\t}\n\treturn action.DeleteTypeJoinedByID(db, job.Action.ID)\n}", "title": "" }, { "docid": "ee72ac63313402bb0870deac31120ad8", "score": "0.5908942", "text": "func (client PipelineJobsClient) DeletePreparer(ctx context.Context, resourceGroupName string, accountName string, pipelineJobName string) (*http.Request, error) {\n\tpathParameters := map[string]interface{}{\n\t\t\"accountName\": autorest.Encode(\"path\", accountName),\n\t\t\"pipelineJobName\": autorest.Encode(\"path\", pipelineJobName),\n\t\t\"resourceGroupName\": autorest.Encode(\"path\", resourceGroupName),\n\t\t\"subscriptionId\": autorest.Encode(\"path\", client.SubscriptionID),\n\t}\n\n\tconst APIVersion = \"2021-11-01-preview\"\n\tqueryParameters := map[string]interface{}{\n\t\t\"api-version\": APIVersion,\n\t}\n\n\tpreparer := autorest.CreatePreparer(\n\t\tautorest.AsDelete(),\n\t\tautorest.WithBaseURL(client.BaseURI),\n\t\tautorest.WithPathParameters(\"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Media/videoAnalyzers/{accountName}/pipelineJobs/{pipelineJobName}\", pathParameters),\n\t\tautorest.WithQueryParameters(queryParameters))\n\treturn preparer.Prepare((&http.Request{}).WithContext(ctx))\n}", "title": "" }, { "docid": "8f4a5783b3ec4cb08cf72955b0ee586a", "score": "0.5908656", "text": "func (h *RPCHandlers) DeleteJob(ctx context.Context, req *pb.DeleteJobRequest) (*pb.DeleteJobResponse, error) {\n\tremoteUUID, err := uuid.Parse(req.Id)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\t_, err = h.svc.DeleteJob(ctx, &DeleteJobArgs{\n\t\tFeedsManagerID: h.feedsManagerID,\n\t\tRemoteUUID: remoteUUID,\n\t})\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\treturn &pb.DeleteJobResponse{}, nil\n}", "title": "" }, { "docid": "2cb448d7be66e597110c39aa71f90b84", "score": "0.5815084", "text": "func (client *Client) JobDelete(project_id, id string, params *JobDeleteParams) error {\n\n\terr := func() error {\n\n\t\turl := fmt.Sprintf(\"/v2/projects/%s/jobs/%s\", url.QueryEscape(project_id), url.QueryEscape(id))\n\n\t\tparamsBuf := bytes.NewBuffer(nil)\n\t\terr := json.NewEncoder(paramsBuf).Encode(&params)\n\t\tif err != nil {\n\t\t\treturn err\n\t\t}\n\n\t\trc, err := client.sendRequest(\"DELETE\", url, \"application/json\", paramsBuf, 204)\n\n\t\tif err != nil {\n\t\t\treturn err\n\t\t}\n\t\tdefer rc.Close()\n\n\t\treturn nil\n\t}()\n\treturn err\n}", "title": "" }, { "docid": "3961d85e46a2caf4acb32c482726e858", "score": "0.57612026", "text": "func (c *Client) DeleteJob(j *Job) error {\n\tvar mr multipartRequest\n\tmr.init()\n\tmr.WriteField(\"jobid\", j.ID)\n\tmr.WriteField(\"printerid\", j.PrinterID)\n\terr := jsonRPC(&c.auth, \"POST\", cloudprintURL+\"/deletejob\", &mr, nil)\n\tif err != nil {\n\t\treturn fmt.Errorf(\"DeleteJob: %v\", err)\n\t}\n\treturn nil\n}", "title": "" }, { "docid": "d21f44815055d04756a332c97cdfadfe", "score": "0.5697675", "text": "func (client *JobsClient) Delete(ctx context.Context, resourceGroupName string, jobCollectionName string, jobName string, options *JobsDeleteOptions) (JobsDeleteResponse, error) {\n\treq, err := client.deleteCreateRequest(ctx, resourceGroupName, jobCollectionName, jobName, options)\n\tif err != nil {\n\t\treturn JobsDeleteResponse{}, err\n\t}\n\tresp, err := client.pl.Do(req)\n\tif err != nil {\n\t\treturn JobsDeleteResponse{}, err\n\t}\n\tif !runtime.HasStatusCode(resp, http.StatusOK) {\n\t\treturn JobsDeleteResponse{}, client.deleteHandleError(resp)\n\t}\n\treturn JobsDeleteResponse{RawResponse: resp}, nil\n}", "title": "" }, { "docid": "35995b58f37e55c61e695bf2a4840dd3", "score": "0.5635371", "text": "func (t *Tracker) DeleteJob(jobid string) error {\n\treturn nil\n}", "title": "" }, { "docid": "4b8c69ef20c5bb980b66b0001190102c", "score": "0.56169677", "text": "func DeleteJob(c echo.Context) error {\n\tid, _ := strconv.Atoi(c.Param(\"id\"))\n\terr := models.DeleteJobByID(id)\n\tif err != nil {\n\t\treturn err\n\t}\n\treturn c.NoContent(http.StatusOK)\n}", "title": "" }, { "docid": "f651657f6dc14b327354ed5ae36c9a6c", "score": "0.55958813", "text": "func (client BatchServiceClient) deleteJob(ctx context.Context, request common.OCIRequest) (common.OCIResponse, error) {\n\thttpRequest, err := request.HTTPRequest(http.MethodDelete, \"/jobs/{jobId}\")\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\tvar response DeleteJobResponse\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": "db49eaf71fe242dea96621a4c16eecb4", "score": "0.55590296", "text": "func (c *Client) DeleteJob(name, namespace string) error {\n\tif err := c.initClient(); err != nil {\n\t\treturn err\n\t}\n\n\treturn c.batch.Jobs(namespace).Delete(context.TODO(), name, metav1.DeleteOptions{\n\t\tPropagationPolicy: &deleteForegroundPolicy,\n\t})\n}", "title": "" }, { "docid": "6ac1275cb5bf337ec2c6d4879afb2e18", "score": "0.5556857", "text": "func (jobHander *JobApiHandler) DeleteJob(w http.ResponseWriter, r *http.Request, ps httprouter.Params) {\n\tw.Header().Set(\"Content-Type\", \"application/json\")\n\tid := ps.ByName(\"id\")\n\tidint, err := strconv.Atoi(id)\n\tif err != nil {\n\t\tfmt.Println(err)\n\t\thttp.Error(w, http.StatusText(404), 404)\n\t\treturn\n\t}\n\t_, err = jobHander.jobService.Job(idint)\n\tif err != nil {\n\t\tfmt.Println(err)\n\t\thttp.Error(w, http.StatusText(404), 404)\n\t\treturn\n\t}\n\tjob, err := jobHander.jobService.DeleteJob(idint)\n\tif err != nil {\n\t\tfmt.Println(err)\n\t\thttp.Error(w, http.StatusText(404), 404)\n\t\treturn\n\t}\n\tresponse, err := json.Marshal(job)\n\tw.Write(response)\n\treturn\n}", "title": "" }, { "docid": "3cc3c696138eae793157cd6586d1dc40", "score": "0.5532412", "text": "func (client BatchServiceClient) DeleteJob(ctx context.Context, request DeleteJobRequest) (response DeleteJobResponse, err error) {\n\tvar ociResponse common.OCIResponse\n\tpolicy := common.NoRetryPolicy()\n\tif client.RetryPolicy() != nil {\n\t\tpolicy = *client.RetryPolicy()\n\t}\n\tif request.RetryPolicy() != nil {\n\t\tpolicy = *request.RetryPolicy()\n\t}\n\tociResponse, err = common.Retry(ctx, request, client.deleteJob, policy)\n\tif err != nil {\n\t\tif ociResponse != nil {\n\t\t\tif httpResponse := ociResponse.HTTPResponse(); httpResponse != nil {\n\t\t\t\topcRequestId := httpResponse.Header.Get(\"opc-request-id\")\n\t\t\t\tresponse = DeleteJobResponse{RawResponse: httpResponse, OpcRequestId: &opcRequestId}\n\t\t\t} else {\n\t\t\t\tresponse = DeleteJobResponse{}\n\t\t\t}\n\t\t}\n\t\treturn\n\t}\n\tif convertedResponse, ok := ociResponse.(DeleteJobResponse); ok {\n\t\tresponse = convertedResponse\n\t} else {\n\t\terr = fmt.Errorf(\"failed to convert OCIResponse into DeleteJobResponse\")\n\t}\n\treturn\n}", "title": "" }, { "docid": "20f4f9158c68abe6182d7a38493c7026", "score": "0.5502865", "text": "func DeleteJob(clientset *kubernetes.Clientset, jobName, namespace string) error {\n\tlog.Debugf(\"deleting Job with Name=%s in namespace %s\", jobName, namespace)\n\tdelOptions := meta_v1.DeleteOptions{}\n\tvar delProp meta_v1.DeletionPropagation\n\tdelProp = meta_v1.DeletePropagationForeground\n\tdelOptions.PropagationPolicy = &delProp\n\n\t//delete the job\n\terr := clientset.Batch().Jobs(namespace).Delete(jobName,\n\t\t&delOptions)\n\tif err != nil {\n\t\tlog.Error(\"error deleting Job \" + jobName + err.Error())\n\t\treturn err\n\t}\n\n\tlog.Info(\"deleted Job \" + jobName)\n\treturn err\n}", "title": "" }, { "docid": "a22cd343cf53865a45ed6e407c70aa8d", "score": "0.54958236", "text": "func (q *JobClient) Delete(jobName string) (err error) {\n\tvar (\n\t\tstatusCode int\n\t)\n\n\tjobName = ParseJobPath(jobName)\n\tapi := fmt.Sprintf(\"%s/doDelete\", jobName)\n\theader := map[string]string{\n\t\thttpdownloader.ContentType: httpdownloader.ApplicationForm,\n\t}\n\n\tif statusCode, _, err = q.Request(http.MethodPost, api, header, nil); err == nil {\n\t\tif statusCode != 200 && statusCode != 302 {\n\t\t\terr = fmt.Errorf(\"unexpected status code: %d\", statusCode)\n\t\t}\n\t}\n\treturn\n}", "title": "" }, { "docid": "16c92a9796bbc0bd801557db26740669", "score": "0.54878426", "text": "func (o *orm) DeleteJob(ctx context.Context, id int32) error {\n\to.claimedJobsMu.Lock()\n\tdefer o.claimedJobsMu.Unlock()\n\n\terr := o.db.Exec(`\n\t\t\tWITH deleted_jobs AS (\n\t\t\t\tDELETE FROM jobs WHERE id = ? RETURNING offchainreporting_oracle_spec_id, pipeline_spec_id, keeper_spec_id\n\t\t\t),\n\t\t\tdeleted_oracle_specs AS (\n\t\t\t\tDELETE FROM offchainreporting_oracle_specs WHERE id IN (SELECT offchainreporting_oracle_spec_id FROM deleted_jobs)\n\t\t\t),\n\t\t\tdeleted_keeper_specs AS (\n\t\t\t\tDELETE FROM keeper_specs WHERE id IN (SELECT keeper_spec_id FROM deleted_jobs)\n\t\t\t)\n\t\t\tDELETE FROM pipeline_specs WHERE id IN (SELECT pipeline_spec_id FROM deleted_jobs)\n \t`, id).Error\n\tif err != nil {\n\t\treturn errors.Wrap(err, \"DeleteJob failed to delete job\")\n\t}\n\n\tif err := o.unclaimJob(ctx, id); err != nil {\n\t\treturn errors.Wrap(err, \"DeleteJob failed to unclaim job\")\n\t}\n\n\treturn nil\n}", "title": "" }, { "docid": "d6220f2d89b32b222e9bc0b33162e7a7", "score": "0.54693776", "text": "func DeleteJob(deleteJobID string) (deleteJSONString string, err error) {\n\n\tusername := os.Getenv(\"SAUCE_USERNAME\")\n\taccessKey := os.Getenv(\"SAUCE_ACCESS_KEY\")\n\n\tjobJson, getErr := GetJob(deleteJobID)\n\n\tif getErr != nil {\n\t\treturn \"{}\", getErr\n\t}\n\t// convert the job response to a JobData struct\n\tvar jobData JobData\n\terrUnmarshalling := json.Unmarshal([]byte(jobJson), &jobData)\n\tif errUnmarshalling != nil {\n\t\treturn \"{}\", errUnmarshalling\n\t}\n\tif jobData.ID != deleteJobID {\n\t\treturn \"\", fmt.Errorf(fmt.Sprintf(\"job %s not found\", deleteJobID))\n\t}\n\tif strings.ToLower(jobData.Status) == \"running\" {\n\t\treturn \"\", fmt.Errorf(fmt.Sprintf(\"job %s is running\", deleteJobID))\n\t}\n\n\tclient := &http.Client{}\n\trequest, reqErr := http.NewRequest(\"DELETE\", apiURL+\"/\"+username+\"/jobs/\"+deleteJobID, nil)\n\tif reqErr != nil {\n\t\treturn \"\", reqErr\n\t}\n\trequest.SetBasicAuth(username, accessKey)\n\tresponse, doErr := client.Do(request)\n\tif doErr != nil {\n\t\treturn \"\", err\n\t}\n\tif response.StatusCode > 299 {\n\t\treturn \"\", fmt.Errorf(fmt.Sprintf(\"request error with status code %d\\n\", response.StatusCode))\n\t}\n\n\trespBody := DeleteJobData{}\n\tdecoder := json.NewDecoder(response.Body)\n\tdecodeErr := decoder.Decode(&respBody)\n\tif decodeErr != nil {\n\t\treturn \"\", decodeErr\n\t}\n\tjsonBytes, marshErr := json.MarshalIndent(respBody, \"\", \" \")\n\tif marshErr != nil {\n\t\treturn \"\", marshErr\n\t}\n\treturn string(jsonBytes), nil\n\n}", "title": "" }, { "docid": "a357c54d2297b311063090328f922891", "score": "0.5341596", "text": "func (a JobsAPI) Delete(jobID int64) error {\n\tdata := httpmodels.GenericJobReq{JobID: jobID}\n\t_, err := a.Client.performQuery(http.MethodPost, \"/jobs/delete\", data, nil)\n\treturn err\n}", "title": "" }, { "docid": "804c527a9907847617c25ee41b6f09fb", "score": "0.53156203", "text": "func DeleteJob() error {\n\tconfig, err := util.BuildConfig(deleteJobFlags.Master, deleteJobFlags.Kubeconfig)\n\tif err != nil {\n\t\treturn err\n\t}\n\n\tif deleteJobFlags.JobName == \"\" {\n\t\terr := fmt.Errorf(\"job name is mandatory to delete a particular job\")\n\t\treturn err\n\t}\n\n\tjobClient := versioned.NewForConfigOrDie(config)\n\terr = jobClient.BatchV1alpha1().Jobs(deleteJobFlags.Namespace).Delete(context.TODO(), deleteJobFlags.JobName, metav1.DeleteOptions{})\n\tif err != nil {\n\t\treturn err\n\t}\n\tfmt.Printf(\"delete job %v successfully\\n\", deleteJobFlags.JobName)\n\treturn nil\n}", "title": "" }, { "docid": "865e5a92586eab0cbac862a65c756040", "score": "0.5300778", "text": "func (router *router) deletePipeline(request *restful.Request, response *restful.Response) {\n\tprojectName := request.PathParameter(projectPathParameterName)\n\tpipelineName := request.PathParameter(pipelinePathParameterName)\n\n\tif err := router.pipelineManager.DeletePipeline(projectName, pipelineName); err != nil {\n\t\thttputil.ResponseWithError(response, err)\n\t\treturn\n\t}\n\n\tresponse.WriteHeaderAndEntity(http.StatusNoContent, nil)\n}", "title": "" }, { "docid": "1b219f70665d865dfa4ddcb6e0886d1e", "score": "0.52904576", "text": "func (j *JobInfo) DeleteJob(jobName string) {\n\tklog.Infof(\"Deleting job: %v...\", jobName)\n\tdeletePolicy := metav1.DeletePropagationForeground\n\tif err := j.jobsClient.Delete(jobName, &metav1.DeleteOptions{\n\t\tPropagationPolicy: &deletePolicy,\n\t}); err != nil {\n\t\tklog.Errorf(\"Delete job: %v err: %v\", jobName, err)\n\t}\n\tklog.Infof(\"Deleted job %v\", jobName)\n}", "title": "" }, { "docid": "671039b21423fc05b10b6645ec097439", "score": "0.5290162", "text": "func DeletePipeline(ctx context.Context, db gorp.SqlExecutor, pipelineID int64) error {\n\tif err := DeleteAllStage(ctx, db, pipelineID); err != nil {\n\t\treturn err\n\t}\n\n\tif err := DeleteAllParameterFromPipeline(db, pipelineID); err != nil {\n\t\treturn err\n\t}\n\n\t// Delete pipeline\n\tquery := `DELETE FROM pipeline WHERE id = $1`\n\tif _, err := db.Exec(query, pipelineID); err != nil {\n\t\treturn sdk.WithStack(err)\n\t}\n\n\treturn nil\n}", "title": "" }, { "docid": "3ae2fe2087652e700227a3fe9298f41e", "score": "0.5284435", "text": "func (t *Table) DeleteJob(ctx context.Context, key Key) error {\n\ts := \"DELETE FROM \" + t.name + \" WHERE path=? AND body=?\" // nolint: gosec\n\t_, err := t.db.ExecContext(ctx, s, key.Path, key.Body)\n\treturn err\n}", "title": "" }, { "docid": "8d1012efa42903b287f5d99e52f641b6", "score": "0.5276358", "text": "func (c JobController) Delete(ctx *fasthttp.RequestCtx) {\n\tid := phi.URLParam(ctx, \"jobID\")\n\n\tjob := model2.NewJob()\n\tc.App.Database.QueryRow(fmt.Sprintf(\"SELECT * FROM %s WHERE id = $1\", job.TableName()),\n\t\tid).Force()\n\n\tc.App.Database.Delete(job.TableName(), \"id = $1\", id).Force()\n\n\tc.JSONResponse(ctx, nil, fasthttp.StatusNoContent)\n}", "title": "" }, { "docid": "b5be766d045adf1f16272a0beea00618", "score": "0.52458775", "text": "func (j *FakeJenkins) DeleteJob(gojenkins.Job) error {\n\treturn nil\n}", "title": "" }, { "docid": "a5293871336328ddfcb1f86b9b0d2cbe", "score": "0.5216664", "text": "func (jc *JobsController) Delete(c *gin.Context) {\n\tjobSpec := job.Job{}\n\terr := jobSpec.SetID(c.Param(\"ID\"))\n\tif err != nil {\n\t\tjsonAPIError(c, http.StatusUnprocessableEntity, err)\n\t\treturn\n\t}\n\n\terr = jc.App.DeleteJob(c.Request.Context(), jobSpec.ID)\n\tif errors.Cause(err) == orm.ErrorNotFound {\n\t\tjsonAPIError(c, http.StatusNotFound, errors.New(\"JobSpec not found\"))\n\t\treturn\n\t}\n\tif err != nil {\n\t\tjsonAPIError(c, http.StatusInternalServerError, err)\n\t\treturn\n\t}\n\n\tjsonAPIResponseWithStatus(c, nil, \"job\", http.StatusNoContent)\n}", "title": "" }, { "docid": "b5bc3fa53b04099bbdccf9c2028362cf", "score": "0.5208896", "text": "func (o *Job) Delete(exec boil.Executor) error {\n\tif o == nil {\n\t\treturn errors.New(\"models: no Job provided for delete\")\n\t}\n\n\tif err := o.doBeforeDeleteHooks(exec); err != nil {\n\t\treturn err\n\t}\n\n\targs := queries.ValuesFromMapping(reflect.Indirect(reflect.ValueOf(o)), jobPrimaryKeyMapping)\n\tsql := \"DELETE FROM \\\"job\\\" WHERE \\\"job_id\\\"=$1\"\n\n\tif boil.DebugMode {\n\t\tfmt.Fprintln(boil.DebugWriter, sql)\n\t\tfmt.Fprintln(boil.DebugWriter, args...)\n\t}\n\n\t_, err := exec.Exec(sql, args...)\n\tif err != nil {\n\t\treturn errors.Wrap(err, \"models: unable to delete from job\")\n\t}\n\n\tif err := o.doAfterDeleteHooks(exec); err != nil {\n\t\treturn err\n\t}\n\n\treturn nil\n}", "title": "" }, { "docid": "9f61eaf5e5675783ced15d2cf9419044", "score": "0.5200749", "text": "func (kc *KalaClient) DeleteJob(id string) (bool, error) {\n\t// nil is completely safe to use, as it is simply ignored in the sling library.\n\tresp, err := kc.requester.New().Delete(api.JobPath + id + \"/\").ReceiveSuccess(nil)\n\tif err != nil {\n\t\treturn false, err\n\t}\n\tif resp.StatusCode != http.StatusNoContent {\n\t\treturn false, fmt.Errorf(\"Delete failed with a status code of %d\", resp.StatusCode)\n\t}\n\treturn true, nil\n}", "title": "" }, { "docid": "36a8d42d4f6979f05622a15985a888ff", "score": "0.51803297", "text": "func (jt *JobTracker) DeleteJob(jobid string) error {\n\tjt.Lock()\n\tdefer jt.Unlock()\n\n\tif !jt.js.HasJob(jobid) {\n\t\treturn errors.New(\"Job does not exist in job store\")\n\t}\n\tjt.ps.Lock()\n\tstate, exists := jt.ps.jobState[jobid]\n\tjt.ps.Unlock()\n\tif exists && (state != drmaa2interface.Done && state != drmaa2interface.Failed) {\n\t\treturn errors.New(\"Job is not in an end state (done/failed)\")\n\t}\n\tif !exists {\n\t\treturn errors.New(\"Job does not exist\")\n\t}\n\tjt.js.RemoveJob(jobid)\n\tjt.ps.Unregister(jobid)\n\treturn nil\n}", "title": "" }, { "docid": "c27fc2d224ac9640ed226ce6b2ae33ce", "score": "0.5167499", "text": "func (db *PostgresPersistence) DeleteJob(jobId uuid.UUID) error {\n\tlog.Warn(fmt.Sprintf(\"deleting job with ID %+v\", jobId))\n\tquery := `DELETE FROM jobs WHERE id=$1`\n\t_, err := db.Session.Exec(context.Background(), query, jobId)\n\treturn err\n}", "title": "" }, { "docid": "8156477e461e7fc9123b66e47520684a", "score": "0.50687295", "text": "func TestDeleteJob(t *testing.T) {\n\tjobID, err := makeTestJob()\n\tif err != nil {\n\t\tt.Error(\"Error scheduling test job:\", err)\n\t\tt.FailNow()\n\t}\n\tlog.Println(\"Made test job with ID\", jobID)\n\n\t// delete the job we just made\n\tresp, err := jobRequest.Delete(testServerURLDelete, jobID)\n\tif err != nil {\n\t\tt.Error(\"Error when deleting job from server\", err)\n\t\tt.FailNow()\n\t}\n\tif resp.StatusCode != http.StatusOK {\n\t\tt.Error(\"Error when deleting job from server. Server returned non-200\")\n\t\tt.FailNow()\n\t}\n\n}", "title": "" }, { "docid": "32a6f2c2ac9805865425ed4f8ce75897", "score": "0.5065161", "text": "func (client *Client) JobKeysDelete(project_id, id string, params *JobKeysDeleteParams) error {\n\n\terr := func() error {\n\n\t\turl := fmt.Sprintf(\"/v2/projects/%s/jobs/%s/keys\", url.QueryEscape(project_id), url.QueryEscape(id))\n\n\t\tparamsBuf := bytes.NewBuffer(nil)\n\t\terr := json.NewEncoder(paramsBuf).Encode(&params)\n\t\tif err != nil {\n\t\t\treturn err\n\t\t}\n\n\t\trc, err := client.sendRequest(\"DELETE\", url, \"application/json\", paramsBuf, 204)\n\n\t\tif err != nil {\n\t\t\treturn err\n\t\t}\n\t\tdefer rc.Close()\n\n\t\treturn nil\n\t}()\n\treturn err\n}", "title": "" }, { "docid": "7ce9070ba4665c922fc348df6edbe198", "score": "0.50465536", "text": "func (r Resource) deleteTestPipelineRun(name string) {\n\tT.Logf(\"Deleting pipelinerun: %s\\n\", name)\n\t_ = r.PipelineClient.TektonV1alpha1().PipelineRuns(\"ns1\").Delete(name, &metav1.DeleteOptions{})\n}", "title": "" }, { "docid": "511b063db3c56ed3b8df7bc3d62ea1f6", "score": "0.5039046", "text": "func DeleteJob(id int) (string, bool) {\n\t_, err := db.Exec(\"DELETE FROM job WHERE id=?\", id)\n\tif err != nil {\n\t\tlog.Printf(\"Error deleting Job %d: %s\", id, err)\n\t\treturn `{\"errors\":[{\"detail\": \"` + err.Error() + `\"}]}`, false\n\t}\n\treturn \"{}\", true\n}", "title": "" }, { "docid": "cf796b85b537d1281bef83e13f185549", "score": "0.5028282", "text": "func (client *Client) JobLocaleDelete(project_id, job_id, id string, params *JobLocaleDeleteParams) error {\n\n\terr := func() error {\n\n\t\turl := fmt.Sprintf(\"/v2/projects/%s/jobs/%s/locales/%s\", url.QueryEscape(project_id), url.QueryEscape(job_id), url.QueryEscape(id))\n\n\t\tparamsBuf := bytes.NewBuffer(nil)\n\t\terr := json.NewEncoder(paramsBuf).Encode(&params)\n\t\tif err != nil {\n\t\t\treturn err\n\t\t}\n\n\t\trc, err := client.sendRequest(\"DELETE\", url, \"application/json\", paramsBuf, 204)\n\n\t\tif err != nil {\n\t\t\treturn err\n\t\t}\n\t\tdefer rc.Close()\n\n\t\treturn nil\n\t}()\n\treturn err\n}", "title": "" }, { "docid": "20e5419352c6139b865f4e0cd56b76ae", "score": "0.5023942", "text": "func deleteJobHandler(w http.ResponseWriter, r *http.Request) {\n\tvars := mux.Vars(r)\n\tjobID, ok := vars[\"id\"]\n\tif !ok {\n\t\tresponseWithApplicationError(w, http.StatusBadRequest, \"Missing job id\")\n\t\treturn\n\t}\n\n\tk8sScheduler, err := createScheduler()\n\tif err != nil {\n\t\tresponseWithError(w, err)\n\t\treturn\n\t}\n\n\terr = k8sScheduler.DeleteJob(jobID)\n\tif err != nil {\n\t\tresponseWithError(w, err)\n\t\treturn\n\t}\n\n\tw.WriteHeader(202)\n}", "title": "" }, { "docid": "70ce72e149a6f6c58d2c8151c4af2c85", "score": "0.4999797", "text": "func (c *Cron) DeleteJob(id int) {\n}", "title": "" }, { "docid": "c90eb34b09420e9a93fd23f7ba0f5bf2", "score": "0.49953416", "text": "func (c *bareMetalJobs) Delete(ctx context.Context, name string, opts metav1.DeleteOptions) error {\n\treturn c.client.Delete().\n\t\tNamespace(c.ns).\n\t\tResource(\"baremetaljobs\").\n\t\tName(name).\n\t\tBody(&opts).\n\t\tDo(ctx).\n\t\tError()\n}", "title": "" }, { "docid": "218bc0134e1e0467ebe7a3355a98bc78", "score": "0.4977408", "text": "func (c *kuberhealthyJobs) Delete(name string, options *metav1.DeleteOptions) error {\n\treturn c.client.Delete().\n\t\tNamespace(c.ns).\n\t\tResource(\"khjobs\").\n\t\tName(name).\n\t\tBody(options).\n\t\tDo(context.TODO()).\n\t\tError()\n}", "title": "" }, { "docid": "616c036679847e31be689cf592ba0063", "score": "0.49358335", "text": "func (ps *PipelinesService) Delete(org string, slug string) (*Response, error) {\n\n\tu := fmt.Sprintf(\"v2/organizations/%s/pipelines/%s\", org, slug)\n\n\treq, err := ps.client.NewRequest(\"DELETE\", u, nil)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\treturn ps.client.Do(req, nil)\n}", "title": "" }, { "docid": "b8027ae9bdff2248dbda02e8e55da0ec", "score": "0.4932999", "text": "func DeleteAccount(username string, accountName string) {\n\tpipe := r.TxPipeline()\n\tpipe.Del(\"account:\" + username + \":\" + accountName)\n\tpipe.Del(\"transactions:\" + username + \":\" + accountName)\n\tpipe.SRem(\"accounts:\"+username, accountName)\n\tpipe.Exec()\n}", "title": "" }, { "docid": "5d297343abba5cb3f09cc3e7ce6b65fa", "score": "0.49170268", "text": "func (s *JobServer) DeleteRunAlphaJob(ctx context.Context, request *alphapb.DeleteRunAlphaJobRequest) (*emptypb.Empty, error) {\n\n\tcl, err := createConfigJob(ctx, request.GetServiceAccountFile())\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\treturn &emptypb.Empty{}, cl.DeleteJob(ctx, ProtoToJob(request.GetResource()))\n\n}", "title": "" }, { "docid": "b6357f21df00d665992d723f3cfe29ea", "score": "0.4900307", "text": "func (db *PostgresDB) deleteJob(id string) error {\n\tconst funcName = \"deleteJob\"\n\t_, err := db.DB.Exec(deleteJob, id)\n\tif err != nil {\n\t\tdesc := fmt.Sprintf(\"%s: unable to delete job entry with id \"+\n\t\t\t\"(%s): %v\", funcName, id, err)\n\t\treturn errs.DBError(errs.DeleteEntry, desc)\n\t}\n\treturn nil\n}", "title": "" }, { "docid": "6353d698a03fa7784278e905603e621e", "score": "0.48974678", "text": "func (c *JobClient) DeleteCustomJob(ctx context.Context, req *aiplatformpb.DeleteCustomJobRequest, opts ...gax.CallOption) (*DeleteCustomJobOperation, error) {\n\treturn c.internalClient.DeleteCustomJob(ctx, req, opts...)\n}", "title": "" }, { "docid": "04372c9c7788ca9cdd8ec1a2bbff1946", "score": "0.48822466", "text": "func Delete(c *golangsdk.ServiceClient, id string) (r elb.JobResult) {\n\treqOpt := &golangsdk.RequestOpts{OkCodes: []int{200}}\n\t_, r.Err = c.DeleteWithResponse(resourceURL(c, id), &r.Body, reqOpt)\n\treturn\n}", "title": "" }, { "docid": "38464bfa22fa9956215b2de937d5111a", "score": "0.4844287", "text": "func (r *memoryDB) DeleteJob(jobID string) (types.Job, error) {\n\tr.mtx.RLock()\n\tdefer r.mtx.RUnlock()\n\n\tif val, ok := r.jobs[jobID]; ok {\n\t\tdelete(r.jobs, jobID)\n\t\treturn val, nil\n\t}\n\treturn types.Job{}, errors.New(\"job not found\")\n}", "title": "" }, { "docid": "9d08e5ac5b866692c9ab7db323259d9a", "score": "0.48231474", "text": "func (c *Client) DeleteRetryJob(retryAt int64, jobID string) error {\n\tok, _, err := c.deleteZsetJob(redisKeyRetry(c.namespace), retryAt, jobID)\n\tif err != nil {\n\t\treturn err\n\t}\n\tif !ok {\n\t\treturn ErrNotDeleted\n\t}\n\treturn nil\n}", "title": "" }, { "docid": "344baecadecfc30f1c1c10b717fe2fae", "score": "0.48033646", "text": "func (t *SimpleChaincode) Delete(stub shim.ChaincodeStubInterface, args []string) ([]byte, error) {\n\tvar err error\n\tif len(args) != 1 {\n\t\treturn nil, errors.New(\"Incorrect number of arguments. Expecting 1. \")\n\t}\n\tJobID := args[0]\n\tJobInfo, err := stub.GetState(JobID)\n\n\t//test if the job has been existed\n\tif err != nil {\n\t\treturn nil, errors.New(\"The job never been exited\")\n\t}\n\n\tif JobInfo == nil {\n\t\treturn nil, errors.New(\"The job`s information is empty!\")\n\t}\n\n\terr = stub.DelState(JobID) //remove the key from chaincode state\n\tif err != nil {\n\t\treturn nil, errors.New(\"Failed to delete this job information! \")\n\t}\n\n\treturn nil, nil\n}", "title": "" }, { "docid": "0cfc38c1b094dcefc42d9a22c02aa268", "score": "0.4771765", "text": "func Delete_job(db *sql.DB, id int) error {\n\tfmt.Println(id)\n\tres, err := db.Exec(\"DELETE FROM jobs WHERE id=?\", id)\n\tinsert_id, _ := res.LastInsertId()\n\tlog.Printf(\"Job with id: %d was deleted\", insert_id)\n\n\treturn err\n}", "title": "" }, { "docid": "528912f82bf5533a5acc89590038e171", "score": "0.47670093", "text": "func (c *jobRESTClient) DeleteCustomJob(ctx context.Context, req *aiplatformpb.DeleteCustomJobRequest, opts ...gax.CallOption) (*DeleteCustomJobOperation, error) {\n\tbaseUrl, err := url.Parse(c.endpoint)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\tbaseUrl.Path += fmt.Sprintf(\"/v1beta1/%v\", req.GetName())\n\n\t// Build HTTP headers from client and context metadata.\n\thds := []string{\"x-goog-request-params\", fmt.Sprintf(\"%s=%v\", \"name\", url.QueryEscape(req.GetName()))}\n\n\thds = append(c.xGoogHeaders, hds...)\n\thds = append(hds, \"Content-Type\", \"application/json\")\n\theaders := gax.BuildHeaders(ctx, hds...)\n\tunm := protojson.UnmarshalOptions{AllowPartial: true, DiscardUnknown: true}\n\tresp := &longrunningpb.Operation{}\n\te := gax.Invoke(ctx, func(ctx context.Context, settings gax.CallSettings) error {\n\t\tif settings.Path != \"\" {\n\t\t\tbaseUrl.Path = settings.Path\n\t\t}\n\t\thttpReq, err := http.NewRequest(\"DELETE\", baseUrl.String(), nil)\n\t\tif err != nil {\n\t\t\treturn err\n\t\t}\n\t\thttpReq = httpReq.WithContext(ctx)\n\t\thttpReq.Header = headers\n\n\t\thttpRsp, err := c.httpClient.Do(httpReq)\n\t\tif err != nil {\n\t\t\treturn err\n\t\t}\n\t\tdefer httpRsp.Body.Close()\n\n\t\tif err = googleapi.CheckResponse(httpRsp); err != nil {\n\t\t\treturn err\n\t\t}\n\n\t\tbuf, err := io.ReadAll(httpRsp.Body)\n\t\tif err != nil {\n\t\t\treturn err\n\t\t}\n\n\t\tif err := unm.Unmarshal(buf, resp); err != nil {\n\t\t\treturn err\n\t\t}\n\n\t\treturn nil\n\t}, opts...)\n\tif e != nil {\n\t\treturn nil, e\n\t}\n\n\toverride := fmt.Sprintf(\"/ui/%s\", resp.GetName())\n\treturn &DeleteCustomJobOperation{\n\t\tlro: longrunning.InternalNewOperation(*c.LROClient, resp),\n\t\tpollPath: override,\n\t}, nil\n}", "title": "" }, { "docid": "fd3f3b59eb979a7bd7506feecb6467b8", "score": "0.47456253", "text": "func (c *restClient) DeleteEvaluationJob(ctx context.Context, req *datalabelingpb.DeleteEvaluationJobRequest, opts ...gax.CallOption) error {\n\tbaseUrl, err := url.Parse(c.endpoint)\n\tif err != nil {\n\t\treturn err\n\t}\n\tbaseUrl.Path += fmt.Sprintf(\"/v1beta1/%v\", req.GetName())\n\n\tparams := url.Values{}\n\tparams.Add(\"$alt\", \"json;enum-encoding=int\")\n\n\tbaseUrl.RawQuery = params.Encode()\n\n\t// Build HTTP headers from client and context metadata.\n\thds := []string{\"x-goog-request-params\", fmt.Sprintf(\"%s=%v\", \"name\", url.QueryEscape(req.GetName()))}\n\n\thds = append(c.xGoogHeaders, hds...)\n\thds = append(hds, \"Content-Type\", \"application/json\")\n\theaders := gax.BuildHeaders(ctx, hds...)\n\treturn gax.Invoke(ctx, func(ctx context.Context, settings gax.CallSettings) error {\n\t\tif settings.Path != \"\" {\n\t\t\tbaseUrl.Path = settings.Path\n\t\t}\n\t\thttpReq, err := http.NewRequest(\"DELETE\", baseUrl.String(), nil)\n\t\tif err != nil {\n\t\t\treturn err\n\t\t}\n\t\thttpReq = httpReq.WithContext(ctx)\n\t\thttpReq.Header = headers\n\n\t\thttpRsp, err := c.httpClient.Do(httpReq)\n\t\tif err != nil {\n\t\t\treturn err\n\t\t}\n\t\tdefer httpRsp.Body.Close()\n\n\t\t// Returns nil if there is no error, otherwise wraps\n\t\t// the response code and body into a non-nil error\n\t\treturn googleapi.CheckResponse(httpRsp)\n\t}, opts...)\n}", "title": "" }, { "docid": "3c076a855b00c6cf0e395026dc55c551", "score": "0.4734131", "text": "func (j *JobService) Delete(job string) (bool, *http.Response, error) {\n\tsuccess := new(interface{})\n\tresp, err := j.sling.New().Path(ChronosAPIJob).Delete(job).ReceiveSuccess(success)\n\n\treturn resp.StatusCode == 204, resp, err\n}", "title": "" }, { "docid": "5d5f5aad31e1148d5b5e1c64c99d2cf7", "score": "0.47338197", "text": "func (c *mSJobs) Delete(name string, options *metav1.DeleteOptions) error {\n\treturn c.client.Delete().\n\t\tNamespace(c.ns).\n\t\tResource(\"msjobs\").\n\t\tName(name).\n\t\tBody(options).\n\t\tDo().\n\t\tError()\n}", "title": "" }, { "docid": "34546e51abb72525b0d03e7b80430d70", "score": "0.47334218", "text": "func (client PipelineJobsClient) Cancel(ctx context.Context, resourceGroupName string, accountName string, pipelineJobName string) (result PipelineJobsCancelFuture, err error) {\n\tif tracing.IsEnabled() {\n\t\tctx = tracing.StartSpan(ctx, fqdn+\"/PipelineJobsClient.Cancel\")\n\t\tdefer func() {\n\t\t\tsc := -1\n\t\t\tif result.FutureAPI != nil && result.FutureAPI.Response() != nil {\n\t\t\t\tsc = result.FutureAPI.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: client.SubscriptionID,\n\t\t\tConstraints: []validation.Constraint{{Target: \"client.SubscriptionID\", Name: validation.MinLength, Rule: 1, Chain: nil}}},\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}}}}); err != nil {\n\t\treturn result, validation.NewError(\"videoanalyzer.PipelineJobsClient\", \"Cancel\", err.Error())\n\t}\n\n\treq, err := client.CancelPreparer(ctx, resourceGroupName, accountName, pipelineJobName)\n\tif err != nil {\n\t\terr = autorest.NewErrorWithError(err, \"videoanalyzer.PipelineJobsClient\", \"Cancel\", nil, \"Failure preparing request\")\n\t\treturn\n\t}\n\n\tresult, err = client.CancelSender(req)\n\tif err != nil {\n\t\terr = autorest.NewErrorWithError(err, \"videoanalyzer.PipelineJobsClient\", \"Cancel\", result.Response(), \"Failure sending request\")\n\t\treturn\n\t}\n\n\treturn\n}", "title": "" }, { "docid": "c44a47192676825b4f4dd74e7c5c1ef2", "score": "0.47199953", "text": "func (service *Service) DeleteEdgeJob(ID portainer.EdgeJobID) error {\n\tidentifier := service.connection.ConvertToKey(int(ID))\n\treturn service.connection.DeleteObject(BucketName, identifier)\n}", "title": "" }, { "docid": "6b693ca2c18fc88499945a3dbe6db73d", "score": "0.47123754", "text": "func StopDeleteJob(c *gin.Context) error {\n\tuser, err := GetUser(c)\n\tif err != nil {\n\t\treturn err\n\t}\n\tjobID := user.ScreenName\n\n\tcancel, found := jobs.Get(jobID)\n\tif !found {\n\t\treturn fmt.Errorf(\"Job id: %s is not running\", jobID)\n\t}\n\n\tcancel()\n\treturn nil\n}", "title": "" }, { "docid": "dcb4d08647520c2a32c7c3bdaa103cf9", "score": "0.4639834", "text": "func RemoveJob(name string) error {\n\tjobPath := filepath.Join(configCtlHome, \"jobs\", name)\n\treturn os.RemoveAll(jobPath)\n}", "title": "" }, { "docid": "a52dc7d35b2c78bf3676a26df1f1fefd", "score": "0.460528", "text": "func (r *ProjectsLocationsJobsService) Delete(name string) *ProjectsLocationsJobsDeleteCall {\n\tc := &ProjectsLocationsJobsDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)}\n\tc.name = name\n\treturn c\n}", "title": "" }, { "docid": "f425cdb8af07c4591dbb31931c4cbcdb", "score": "0.4592291", "text": "func (client *JobsClient) deleteCreateRequest(ctx context.Context, resourceGroupName string, jobCollectionName string, jobName string, options *JobsDeleteOptions) (*policy.Request, error) {\n\turlPath := \"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Scheduler/jobCollections/{jobCollectionName}/jobs/{jobName}\"\n\tif client.subscriptionID == \"\" {\n\t\treturn nil, errors.New(\"parameter client.subscriptionID cannot be empty\")\n\t}\n\turlPath = strings.ReplaceAll(urlPath, \"{subscriptionId}\", url.PathEscape(client.subscriptionID))\n\tif resourceGroupName == \"\" {\n\t\treturn nil, errors.New(\"parameter resourceGroupName cannot be empty\")\n\t}\n\turlPath = strings.ReplaceAll(urlPath, \"{resourceGroupName}\", url.PathEscape(resourceGroupName))\n\tif jobCollectionName == \"\" {\n\t\treturn nil, errors.New(\"parameter jobCollectionName cannot be empty\")\n\t}\n\turlPath = strings.ReplaceAll(urlPath, \"{jobCollectionName}\", url.PathEscape(jobCollectionName))\n\tif jobName == \"\" {\n\t\treturn nil, errors.New(\"parameter jobName cannot be empty\")\n\t}\n\turlPath = strings.ReplaceAll(urlPath, \"{jobName}\", url.PathEscape(jobName))\n\treq, err := runtime.NewRequest(ctx, http.MethodDelete, 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\", \"2016-03-01\")\n\treq.Raw().URL.RawQuery = reqQP.Encode()\n\treturn req, nil\n}", "title": "" }, { "docid": "61cf7cf08db98e201a6035c21b906897", "score": "0.4584325", "text": "func (c *jobRESTClient) DeleteBatchPredictionJob(ctx context.Context, req *aiplatformpb.DeleteBatchPredictionJobRequest, opts ...gax.CallOption) (*DeleteBatchPredictionJobOperation, error) {\n\tbaseUrl, err := url.Parse(c.endpoint)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\tbaseUrl.Path += fmt.Sprintf(\"/v1beta1/%v\", req.GetName())\n\n\t// Build HTTP headers from client and context metadata.\n\thds := []string{\"x-goog-request-params\", fmt.Sprintf(\"%s=%v\", \"name\", url.QueryEscape(req.GetName()))}\n\n\thds = append(c.xGoogHeaders, hds...)\n\thds = append(hds, \"Content-Type\", \"application/json\")\n\theaders := gax.BuildHeaders(ctx, hds...)\n\tunm := protojson.UnmarshalOptions{AllowPartial: true, DiscardUnknown: true}\n\tresp := &longrunningpb.Operation{}\n\te := gax.Invoke(ctx, func(ctx context.Context, settings gax.CallSettings) error {\n\t\tif settings.Path != \"\" {\n\t\t\tbaseUrl.Path = settings.Path\n\t\t}\n\t\thttpReq, err := http.NewRequest(\"DELETE\", baseUrl.String(), nil)\n\t\tif err != nil {\n\t\t\treturn err\n\t\t}\n\t\thttpReq = httpReq.WithContext(ctx)\n\t\thttpReq.Header = headers\n\n\t\thttpRsp, err := c.httpClient.Do(httpReq)\n\t\tif err != nil {\n\t\t\treturn err\n\t\t}\n\t\tdefer httpRsp.Body.Close()\n\n\t\tif err = googleapi.CheckResponse(httpRsp); err != nil {\n\t\t\treturn err\n\t\t}\n\n\t\tbuf, err := io.ReadAll(httpRsp.Body)\n\t\tif err != nil {\n\t\t\treturn err\n\t\t}\n\n\t\tif err := unm.Unmarshal(buf, resp); err != nil {\n\t\t\treturn err\n\t\t}\n\n\t\treturn nil\n\t}, opts...)\n\tif e != nil {\n\t\treturn nil, e\n\t}\n\n\toverride := fmt.Sprintf(\"/ui/%s\", resp.GetName())\n\treturn &DeleteBatchPredictionJobOperation{\n\t\tlro: longrunning.InternalNewOperation(*c.LROClient, resp),\n\t\tpollPath: override,\n\t}, nil\n}", "title": "" }, { "docid": "83cf4b6596aa1897c0326e0ff542180f", "score": "0.45664886", "text": "func (m *Mockstore) DeleteJob(appName, jobName string) error {\n\tm.ctrl.T.Helper()\n\tret := m.ctrl.Call(m, \"DeleteJob\", appName, jobName)\n\tret0, _ := ret[0].(error)\n\treturn ret0\n}", "title": "" }, { "docid": "e086b8f3eee3dbe182329451be70d519", "score": "0.45588735", "text": "func (c *FakeKMSKeyRingImportJobs) Delete(ctx context.Context, name string, opts v1.DeleteOptions) error {\n\t_, err := c.Fake.\n\t\tInvokes(testing.NewDeleteActionWithOptions(kmskeyringimportjobsResource, c.ns, name, opts), &v1alpha1.KMSKeyRingImportJob{})\n\n\treturn err\n}", "title": "" }, { "docid": "bda101106f1179276d66ba264dd5c122", "score": "0.45423108", "text": "func (a *Client) DeleteCloudProjectServiceNameACLAccountID(params *DeleteCloudProjectServiceNameACLAccountIDParams, authInfo runtime.ClientAuthInfoWriter) (*DeleteCloudProjectServiceNameACLAccountIDOK, error) {\n\t// TODO: Validate the params before sending\n\tif params == nil {\n\t\tparams = NewDeleteCloudProjectServiceNameACLAccountIDParams()\n\t}\n\n\tresult, err := a.transport.Submit(&runtime.ClientOperation{\n\t\tID: \"DeleteCloudProjectServiceNameACLAccountID\",\n\t\tMethod: \"DELETE\",\n\t\tPathPattern: \"/cloud/project/{serviceName}/acl/{accountId}\",\n\t\tProducesMediaTypes: []string{\"application/json\"},\n\t\tConsumesMediaTypes: []string{\"application/json\"},\n\t\tSchemes: []string{\"https\"},\n\t\tParams: params,\n\t\tReader: &DeleteCloudProjectServiceNameACLAccountIDReader{formats: a.formats},\n\t\tAuthInfo: authInfo,\n\t\tContext: params.Context,\n\t\tClient: params.HTTPClient,\n\t})\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\treturn result.(*DeleteCloudProjectServiceNameACLAccountIDOK), nil\n\n}", "title": "" }, { "docid": "b20eab74b2110b0fed64890287b5795f", "score": "0.45253834", "text": "func (client *JobsClient) deleteCreateRequest(ctx context.Context, resourceGroupName string, jobCollectionName string, jobName string, options *JobsClientDeleteOptions) (*policy.Request, error) {\n\turlPath := \"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Scheduler/jobCollections/{jobCollectionName}/jobs/{jobName}\"\n\tif client.subscriptionID == \"\" {\n\t\treturn nil, errors.New(\"parameter client.subscriptionID cannot be empty\")\n\t}\n\turlPath = strings.ReplaceAll(urlPath, \"{subscriptionId}\", url.PathEscape(client.subscriptionID))\n\tif resourceGroupName == \"\" {\n\t\treturn nil, errors.New(\"parameter resourceGroupName cannot be empty\")\n\t}\n\turlPath = strings.ReplaceAll(urlPath, \"{resourceGroupName}\", url.PathEscape(resourceGroupName))\n\tif jobCollectionName == \"\" {\n\t\treturn nil, errors.New(\"parameter jobCollectionName cannot be empty\")\n\t}\n\turlPath = strings.ReplaceAll(urlPath, \"{jobCollectionName}\", url.PathEscape(jobCollectionName))\n\tif jobName == \"\" {\n\t\treturn nil, errors.New(\"parameter jobName cannot be empty\")\n\t}\n\turlPath = strings.ReplaceAll(urlPath, \"{jobName}\", url.PathEscape(jobName))\n\treq, err := runtime.NewRequest(ctx, http.MethodDelete, runtime.JoinPaths(client.internal.Endpoint(), urlPath))\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\treqQP := req.Raw().URL.Query()\n\treqQP.Set(\"api-version\", \"2016-03-01\")\n\treq.Raw().URL.RawQuery = reqQP.Encode()\n\treturn req, nil\n}", "title": "" }, { "docid": "1ec91d69e6dccfaf2da2e0f7c341c0f3", "score": "0.4524272", "text": "func (client BatchServiceClient) DeleteJobDefinition(ctx context.Context, request DeleteJobDefinitionRequest) (response DeleteJobDefinitionResponse, err error) {\n\tvar ociResponse common.OCIResponse\n\tpolicy := common.NoRetryPolicy()\n\tif client.RetryPolicy() != nil {\n\t\tpolicy = *client.RetryPolicy()\n\t}\n\tif request.RetryPolicy() != nil {\n\t\tpolicy = *request.RetryPolicy()\n\t}\n\tociResponse, err = common.Retry(ctx, request, client.deleteJobDefinition, policy)\n\tif err != nil {\n\t\tif ociResponse != nil {\n\t\t\tif httpResponse := ociResponse.HTTPResponse(); httpResponse != nil {\n\t\t\t\topcRequestId := httpResponse.Header.Get(\"opc-request-id\")\n\t\t\t\tresponse = DeleteJobDefinitionResponse{RawResponse: httpResponse, OpcRequestId: &opcRequestId}\n\t\t\t} else {\n\t\t\t\tresponse = DeleteJobDefinitionResponse{}\n\t\t\t}\n\t\t}\n\t\treturn\n\t}\n\tif convertedResponse, ok := ociResponse.(DeleteJobDefinitionResponse); ok {\n\t\tresponse = convertedResponse\n\t} else {\n\t\terr = fmt.Errorf(\"failed to convert OCIResponse into DeleteJobDefinitionResponse\")\n\t}\n\treturn\n}", "title": "" }, { "docid": "6c3d7cfa6efc8aacf43b6fdb60e7e8fe", "score": "0.4507542", "text": "func handleDeleteJob(w http.ResponseWriter, r *http.Request) {\n\tvar (\n\t\tjobID = chi.URLParam(r, \"jobID\")\n\t\ts, err = jobber.Machinery.GetBackend().GetState(jobID)\n\t)\n\tif err != nil {\n\t\tsendErrorResponse(w, fmt.Sprintf(\"Error fetching job: %v\", err), http.StatusInternalServerError)\n\t\treturn\n\t}\n\n\t// If the job is already complete, no go.\n\tif s.IsCompleted() {\n\t\tsendErrorResponse(w, \"Can't delete job as it's already complete.\", http.StatusGone)\n\t\treturn\n\t}\n\n\t// Stop the job if it's running.\n\tjobMutex.RLock()\n\tcancel, ok := jobContexts[jobID]\n\tjobMutex.RUnlock()\n\tif ok {\n\t\tcancel()\n\t}\n\n\t// Delete the job.\n\tif err := jobber.Machinery.GetBackend().PurgeState(jobID); err != nil {\n\t\tsendErrorResponse(w, fmt.Sprintf(\"Error deleting job: %v\", err), http.StatusGone)\n\t\treturn\n\t}\n\n\tsendResponse(w, true)\n}", "title": "" }, { "docid": "eb762b9d68dceca86aa58a3093477519", "score": "0.45064077", "text": "func (n *JobsService) Delete(ctx context.Context, req *DeleteRequest) (*DeleteResponse, error) {\n\treturn &DeleteResponse{}, nil\n}", "title": "" }, { "docid": "a187d529dbd7bdd46c946d81a064c47e", "score": "0.44918585", "text": "func (client BatchServiceClient) deleteJobDefinition(ctx context.Context, request common.OCIRequest) (common.OCIResponse, error) {\n\thttpRequest, err := request.HTTPRequest(http.MethodDelete, \"/jobDefinitions/{jobDefinitionId}\")\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\tvar response DeleteJobDefinitionResponse\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": "696a4d165b0ddfc9847e4fc804135253", "score": "0.44855836", "text": "func (suite *MockDatastoreTestSuite) TestDataStoreDeleteJob() {\n\tctx, cancelFunc := context.WithTimeout(\n\t\tcontext.Background(),\n\t\ttime.Second)\n\tdefer cancelFunc()\n\tjobID := &peloton.JobID{\n\t\tValue: uuid.New(),\n\t}\n\n\t// Failure test for get job_config\n\tsuite.jobConfigOps.EXPECT().GetCurrentVersion(ctx, gomock.Any()).\n\t\tReturn(nil, nil, errors.New(\"my-error\"))\n\tsuite.Error(suite.store.DeleteJob(ctx, jobID.GetValue()))\n}", "title": "" }, { "docid": "e0769b74396056cdb082274af56d18ff", "score": "0.44721487", "text": "func (client BaseClient) DeleteAcrTag(ctx context.Context, name string, reference string) (result autorest.Response, err error) {\n\tif tracing.IsEnabled() {\n\t\tctx = tracing.StartSpan(ctx, fqdn+\"/BaseClient.DeleteAcrTag\")\n\t\tdefer func() {\n\t\t\tsc := -1\n\t\t\tif result.Response != nil {\n\t\t\t\tsc = result.Response.StatusCode\n\t\t\t}\n\t\t\ttracing.EndSpan(ctx, sc, err)\n\t\t}()\n\t}\n\treq, err := client.DeleteAcrTagPreparer(ctx, name, reference)\n\tif err != nil {\n\t\terr = autorest.NewErrorWithError(err, \"acr.BaseClient\", \"DeleteAcrTag\", nil, \"Failure preparing request\")\n\t\treturn\n\t}\n\n\tresp, err := client.DeleteAcrTagSender(req)\n\tif err != nil {\n\t\tresult.Response = resp\n\t\terr = autorest.NewErrorWithError(err, \"acr.BaseClient\", \"DeleteAcrTag\", resp, \"Failure sending request\")\n\t\treturn\n\t}\n\n\tresult, err = client.DeleteAcrTagResponder(resp)\n\tif err != nil {\n\t\terr = autorest.NewErrorWithError(err, \"acr.BaseClient\", \"DeleteAcrTag\", resp, \"Failure responding to request\")\n\t}\n\n\treturn\n}", "title": "" }, { "docid": "375f1f57282489577518d3d08c294785", "score": "0.44633335", "text": "func (jbal *JobBallancer) removeJob(jid string) error {\r\n\tif _, isFind := jbal.acJob[jid]; isFind {\r\n\t\tdelete(jbal.acJob, jid)\r\n\t} else {\r\n\t\treturn errors.New(\"error: can't remove job because job with id not found\")\r\n\t}\r\n\treturn nil\r\n}", "title": "" }, { "docid": "9316c89d583521e53439c81567753f1d", "score": "0.44582984", "text": "func (api *API) DeleteCronjob(appName, depName, cronjobId string) error {\n\treturn api.Delete(fmt.Sprintf(\"/app/%s/deployment/%s/cron/%s/\", appName, depName, cronjobId))\n}", "title": "" }, { "docid": "90257b8cc187102c1ea453928c0d1cef", "score": "0.44533765", "text": "func (s *Scheduler) RemoveJobByTag(tag string) error {\n\tjobindex, err := s.findJobsIndexByTag(tag)\n\tif err != nil {\n\t\treturn err\n\t}\n\t// Remove job if jobindex is valid\n\ts.jobs = removeAtIndex(s.jobs, jobindex)\n\treturn nil\n}", "title": "" }, { "docid": "6f647903df00951a5e7d0905948732e8", "score": "0.4450145", "text": "func (c *client) RemoveJob(channel, id string) error {\n\tif atomic.LoadInt32(&c.closeFlag) == 1 {\n\t\treturn errors.New(ErrorClosedConnection)\n\t}\n\n\tif !isValidChannelName(channel) {\n\t\treturn errors.New(ErrorInvalidChannelName)\n\t}\n\n\tif id == \"\" {\n\t\treturn errors.New(ErrorInvalidJobID)\n\t}\n\n\t// Send Remove command to Scheduler\n\tif err := c.protocol.WriteCommand(command.Remove(channel, id)); err != nil {\n\t\tc.log(LogLevelError, \"Remove job %s %s %v\", channel, id, err)\n\t\treturn err\n\t}\n\n\treturn nil\n}", "title": "" }, { "docid": "8d9c815aff1d2a7d8803f6d75c321521", "score": "0.44462582", "text": "func (mr *MockdeployerMockRecorder) DeletePipeline(pipelineName interface{}) *gomock.Call {\n\tmr.mock.ctrl.T.Helper()\n\treturn mr.mock.ctrl.RecordCallWithMethodType(mr.mock, \"DeletePipeline\", reflect.TypeOf((*Mockdeployer)(nil).DeletePipeline), pipelineName)\n}", "title": "" }, { "docid": "1b3078d08ac432795c6f048803874df7", "score": "0.4444286", "text": "func (client *StorageAccountsClient) Delete(ctx context.Context, resourceGroupName string, accountName string, options *StorageAccountsDeleteOptions) (StorageAccountsDeleteResponse, error) {\n\treq, err := client.deleteCreateRequest(ctx, resourceGroupName, accountName, options)\n\tif err != nil {\n\t\treturn StorageAccountsDeleteResponse{}, err\n\t}\n\tresp, err := client.pl.Do(req)\n\tif err != nil {\n\t\treturn StorageAccountsDeleteResponse{}, err\n\t}\n\tif !runtime.HasStatusCode(resp, http.StatusOK, http.StatusNoContent) {\n\t\treturn StorageAccountsDeleteResponse{}, client.deleteHandleError(resp)\n\t}\n\treturn StorageAccountsDeleteResponse{RawResponse: resp}, nil\n}", "title": "" }, { "docid": "9aebf0fd41f70b1b656cc6043d8f0a30", "score": "0.4434226", "text": "func DeletePipelineActionByStage(ctx context.Context, db gorp.SqlExecutor, stageID int64) error {\n\tpas, err := getPipelineActionsByStageID(ctx, db, stageID)\n\tif err != nil {\n\t\treturn err\n\t}\n\n\tactionIDs := pipelineActionsToActionIDs(pas)\n\n\tif err := deletePipelineActionsByIDs(db, pipelineActionsToIDs(pas)); err != nil {\n\t\treturn err\n\t}\n\n\tif err := action.DeleteAllTypeJoinedByIDs(db, actionIDs); err != nil {\n\t\treturn err\n\t}\n\n\treturn nil\n}", "title": "" }, { "docid": "3672bfd8d95b538d158086f744459602", "score": "0.44199252", "text": "func (mr *MockpipelineDeployerMockRecorder) DeletePipeline(pipelineName interface{}) *gomock.Call {\n\tmr.mock.ctrl.T.Helper()\n\treturn mr.mock.ctrl.RecordCallWithMethodType(mr.mock, \"DeletePipeline\", reflect.TypeOf((*MockpipelineDeployer)(nil).DeletePipeline), pipelineName)\n}", "title": "" }, { "docid": "d714059ac5657fd3866d4f775e4fc208", "score": "0.44068125", "text": "func (c *jobRESTClient) DeleteDataLabelingJob(ctx context.Context, req *aiplatformpb.DeleteDataLabelingJobRequest, opts ...gax.CallOption) (*DeleteDataLabelingJobOperation, error) {\n\tbaseUrl, err := url.Parse(c.endpoint)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\tbaseUrl.Path += fmt.Sprintf(\"/v1beta1/%v\", req.GetName())\n\n\t// Build HTTP headers from client and context metadata.\n\thds := []string{\"x-goog-request-params\", fmt.Sprintf(\"%s=%v\", \"name\", url.QueryEscape(req.GetName()))}\n\n\thds = append(c.xGoogHeaders, hds...)\n\thds = append(hds, \"Content-Type\", \"application/json\")\n\theaders := gax.BuildHeaders(ctx, hds...)\n\tunm := protojson.UnmarshalOptions{AllowPartial: true, DiscardUnknown: true}\n\tresp := &longrunningpb.Operation{}\n\te := gax.Invoke(ctx, func(ctx context.Context, settings gax.CallSettings) error {\n\t\tif settings.Path != \"\" {\n\t\t\tbaseUrl.Path = settings.Path\n\t\t}\n\t\thttpReq, err := http.NewRequest(\"DELETE\", baseUrl.String(), nil)\n\t\tif err != nil {\n\t\t\treturn err\n\t\t}\n\t\thttpReq = httpReq.WithContext(ctx)\n\t\thttpReq.Header = headers\n\n\t\thttpRsp, err := c.httpClient.Do(httpReq)\n\t\tif err != nil {\n\t\t\treturn err\n\t\t}\n\t\tdefer httpRsp.Body.Close()\n\n\t\tif err = googleapi.CheckResponse(httpRsp); err != nil {\n\t\t\treturn err\n\t\t}\n\n\t\tbuf, err := io.ReadAll(httpRsp.Body)\n\t\tif err != nil {\n\t\t\treturn err\n\t\t}\n\n\t\tif err := unm.Unmarshal(buf, resp); err != nil {\n\t\t\treturn err\n\t\t}\n\n\t\treturn nil\n\t}, opts...)\n\tif e != nil {\n\t\treturn nil, e\n\t}\n\n\toverride := fmt.Sprintf(\"/ui/%s\", resp.GetName())\n\treturn &DeleteDataLabelingJobOperation{\n\t\tlro: longrunning.InternalNewOperation(*c.LROClient, resp),\n\t\tpollPath: override,\n\t}, nil\n}", "title": "" }, { "docid": "c1b5fc3caa67359b36de1ea51b022155", "score": "0.44044185", "text": "func (s *CrondSvc) DeletePipelineCrond(cronID uint64) error {\n\tif cronID <= 0 {\n\t\treturn nil\n\t}\n\treturn s.js.Put(context.Background(), etcdCronPrefixDeleteKey+strconv.FormatUint(cronID, 10), nil)\n}", "title": "" }, { "docid": "2291e95f92a4bdc94186abfff0df1da1", "score": "0.43957224", "text": "func (runner *runner) DeleteRule(table Table, chain Chain, args ...string) error {\n\tfullArgs := makeFullArgs(table, chain, args...)\n\n\trunner.mu.Lock()\n\tdefer runner.mu.Unlock()\n\n\texists, err := runner.checkRule(table, chain, args...)\n\tif err != nil {\n\t\treturn err\n\t}\n\tif !exists {\n\t\treturn nil\n\t}\n\tout, err := runner.run(opDeleteRule, fullArgs)\n\tif err != nil {\n\t\treturn fmt.Errorf(\"error deleting rule: %v: %s\", err, out)\n\t}\n\treturn nil\n}", "title": "" }, { "docid": "8c3447539f77c4da0c044572be53bc33", "score": "0.43857428", "text": "func (m *MockjobStore) DeleteJob(appName, jobName string) error {\n\tm.ctrl.T.Helper()\n\tret := m.ctrl.Call(m, \"DeleteJob\", appName, jobName)\n\tret0, _ := ret[0].(error)\n\treturn ret0\n}", "title": "" }, { "docid": "ae088b1f110d7e57ebd7b9015df8767f", "score": "0.4382624", "text": "func (_m *Controller) DeleteJob(namespace string, jobName string, options *v1.DeleteOptions) error {\n\tret := _m.Called(namespace, jobName, options)\n\n\tvar r0 error\n\tif rf, ok := ret.Get(0).(func(string, string, *v1.DeleteOptions) error); ok {\n\t\tr0 = rf(namespace, jobName, options)\n\t} else {\n\t\tr0 = ret.Error(0)\n\t}\n\n\treturn r0\n}", "title": "" }, { "docid": "5f888c4c1fc002f0f921465c837c1257", "score": "0.43804923", "text": "func (c *JobClient) DeleteNasJob(ctx context.Context, req *aiplatformpb.DeleteNasJobRequest, opts ...gax.CallOption) (*DeleteNasJobOperation, error) {\n\treturn c.internalClient.DeleteNasJob(ctx, req, opts...)\n}", "title": "" }, { "docid": "d518993096db18823faf04da9896a3c5", "score": "0.4367995", "text": "func (this *Job) Delete() (isDelete bool, err error) {\n\tif this.Id <= 0 {\n\t\treturn false, errors.New(\"删除对象不能为空\")\n\t}\n\tjobName := \"job_\" + strconv.Itoa(this.Id)\n\to := orm.NewOrm()\n\tnum, err := o.Delete(this)\n\tif num > 0 {\n\t\tif _, err = logic.G_jobMgr.DeleteJob(jobName); err != nil {\n\t\t\tfmt.Println(err.Error())\n\t\t}\n\t}\n\treturn num > 0, err\n}", "title": "" }, { "docid": "0ba8add81006d22728bd2243cb291695", "score": "0.43550402", "text": "func (c *JobClient) DeleteDataLabelingJob(ctx context.Context, req *aiplatformpb.DeleteDataLabelingJobRequest, opts ...gax.CallOption) (*DeleteDataLabelingJobOperation, error) {\n\treturn c.internalClient.DeleteDataLabelingJob(ctx, req, opts...)\n}", "title": "" }, { "docid": "c2573ee989090bb8b26f7f0fad99a8e5", "score": "0.43526587", "text": "func (a *Client) CancelJob(params *CancelJobParams, authInfo runtime.ClientAuthInfoWriter) (*CancelJobOK, error) {\n\t// TODO: Validate the params before sending\n\tif params == nil {\n\t\tparams = NewCancelJobParams()\n\t}\n\n\tresult, err := a.transport.Submit(&runtime.ClientOperation{\n\t\tID: \"cancelJob\",\n\t\tMethod: \"POST\",\n\t\tPathPattern: \"/jobs/action/cancel\",\n\t\tProducesMediaTypes: []string{\"application/json\"},\n\t\tConsumesMediaTypes: []string{\"application/json\"},\n\t\tSchemes: []string{\"http\"},\n\t\tParams: params,\n\t\tReader: &CancelJobReader{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.(*CancelJobOK)\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 cancelJob: API contract not enforced by server. Client expected to get an error, but got: %T\", result)\n\tpanic(msg)\n}", "title": "" }, { "docid": "ad716573745365a37a4fc2eb3684e499", "score": "0.43459353", "text": "func RemovePipeline(db gorp.SqlExecutor, key, appName, pipelineName string) error {\n\tquery := `SELECT pipeline_build.id FROM pipeline_build\n\t\t\t\t\t\t\tJOIN application ON application.id = pipeline_build.application_id\n\t\t\t\t\t\t\tJOIN pipeline ON pipeline.id = pipeline_build.pipeline_id\n\t\t\t\t\t\t\tJOIN project ON pipeline.project_id = project.id\n\t\t\t\t\t\t\tWHERE application.name = $1 AND pipeline.name = $2 AND project.projectKey = $3`\n\trows, err := db.Query(query, appName, pipelineName, key)\n\tif err != nil {\n\t\treturn err\n\t}\n\tdefer rows.Close()\n\tvar pipelineBuildIDs []int64\n\tfor rows.Next() {\n\t\tvar id int64\n\t\tif err = rows.Scan(&id); err != nil {\n\t\t\treturn err\n\t\t}\n\t\tpipelineBuildIDs = append(pipelineBuildIDs, id)\n\t}\n\n\tfor _, id := range pipelineBuildIDs {\n\t\terr := pipeline.DeletePipelineBuildByID(db, id)\n\t\tif err != nil {\n\t\t\treturn fmt.Errorf(\"RemovePipeline> cannot delete pb %d> %s\", id, err)\n\t\t}\n\t}\n\n\terr = trigger.DeleteApplicationPipelineTriggers(db, key, appName, pipelineName)\n\tif err != nil {\n\t\treturn fmt.Errorf(\"RemovePipeline> cannot delete app trigger> %s\", err)\n\t}\n\n\t// Delete application_pipeline link\n\tquery = `DELETE FROM application_pipeline\n\t USING application, project, pipeline\n\t WHERE application.project_id = project.id AND application.id = application_pipeline.application_id AND pipeline.id = application_pipeline.pipeline_id\n\t AND application.name = $1 AND project.projectKey = $2 AND pipeline.name = $3`\n\tresult, err := db.Exec(query, appName, key, pipelineName)\n\tif err != nil {\n\t\treturn fmt.Errorf(\"RemovePipeline> cannot application_pipeline link> %s\", err)\n\t}\n\trowAffected, err := result.RowsAffected()\n\tif err != nil {\n\t\treturn err\n\t}\n\tif rowAffected == 0 {\n\t\treturn sdk.ErrNoAttachedPipeline\n\t}\n\n\treturn nil\n}", "title": "" }, { "docid": "9fe566a15fa2ba6aaeaa2a7d4cdec1c9", "score": "0.4343713", "text": "func (client *gocloak) DeleteComponent(token string, realm string, componentID string) error {\n\tresp, err := getRequestWithBearerAuth(token).\n\t\tDelete(client.basePath + authRealm + realm + \"/components/\" + componentID)\n\n\terr = checkForError(resp, err)\n\tif err != nil {\n\t\treturn err\n\t}\n\n\treturn nil\n}", "title": "" }, { "docid": "2ec76dfde3f489d74775ec4a93e35426", "score": "0.43247098", "text": "func DeleteReport(c *gin.Context) {\n\tdb := config.DbConn()\n\t//db := mocks.MockDbConn()\n\n\t// Get ID from request.\n\treportId := c.Params.ByName(\"jobReportId\")\n\tfmt.Printf(\"Get Report with ID: \" + reportId)\n\n\tif !CheckForCookie(c) {\n\t\tlog.Println(\"User is unauthorized to delete this Report\")\n\t\treturn\n\t}\n\n\t// Create query to delete the report with its requested ID.\n\tres, err := db.Exec(\"DELETE FROM jobreports WHERE job_report_id=?\", reportId)\n\tif err != nil {\n\t\tlog.Printf(\"Report failed to delete.\")\n\t\tc.JSON(500, nil)\n\t}\n\n\taffectedRows, err := res.RowsAffected()\n\tif err != nil {\n\t\tlog.Printf(\"Report failed to delete.\")\n\t\tc.JSON(500, nil)\n\t}\n\n\tfmt.Printf(\"\\nThe statement affected %d rows\\n\", affectedRows)\n\tc.JSON(204, nil) // Report has been deleted successfully.\n}", "title": "" }, { "docid": "f57899bf3bca5a1afc8e26c18c9a03ff", "score": "0.43227115", "text": "func (client *JobsClient) deleteCreateRequest(ctx context.Context, resourceGroupName string, jobName string, options *JobsClientBeginDeleteOptions) (*policy.Request, error) {\n\turlPath := \"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.App/jobs/{jobName}\"\n\tif client.subscriptionID == \"\" {\n\t\treturn nil, errors.New(\"parameter client.subscriptionID cannot be empty\")\n\t}\n\turlPath = strings.ReplaceAll(urlPath, \"{subscriptionId}\", url.PathEscape(client.subscriptionID))\n\tif resourceGroupName == \"\" {\n\t\treturn nil, errors.New(\"parameter resourceGroupName cannot be empty\")\n\t}\n\turlPath = strings.ReplaceAll(urlPath, \"{resourceGroupName}\", url.PathEscape(resourceGroupName))\n\tif jobName == \"\" {\n\t\treturn nil, errors.New(\"parameter jobName cannot be empty\")\n\t}\n\turlPath = strings.ReplaceAll(urlPath, \"{jobName}\", url.PathEscape(jobName))\n\treq, err := runtime.NewRequest(ctx, http.MethodDelete, runtime.JoinPaths(client.internal.Endpoint(), urlPath))\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\treqQP := req.Raw().URL.Query()\n\treqQP.Set(\"api-version\", \"2023-05-01\")\n\treq.Raw().URL.RawQuery = reqQP.Encode()\n\treq.Raw().Header[\"Accept\"] = []string{\"application/json\"}\n\treturn req, nil\n}", "title": "" }, { "docid": "787111dd1da7f38b94ab02c0b2a1b141", "score": "0.43203005", "text": "func (h *HelmReconciler) DeleteComponent(componentName string) error {\n\treturn h.runForAllTypes(func(labels map[string]string, objects *unstructured.UnstructuredList) error {\n\t\treturn h.pruneUnlistedResources(map[string]bool{}, labels, componentName, objects, false)\n\t})\n}", "title": "" }, { "docid": "7cdfdb06e83994d23e72e32a286f9403", "score": "0.43171382", "text": "func ExamplePipelinesClient_Delete() {\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 := armdatafactory.NewClientFactory(\"<subscription-id>\", cred, nil)\n\tif err != nil {\n\t\tlog.Fatalf(\"failed to create client: %v\", err)\n\t}\n\t_, err = clientFactory.NewPipelinesClient().Delete(ctx, \"exampleResourceGroup\", \"exampleFactoryName\", \"examplePipeline\", nil)\n\tif err != nil {\n\t\tlog.Fatalf(\"failed to finish the request: %v\", err)\n\t}\n}", "title": "" }, { "docid": "59847b7b1b5a0c611abe0f2b17541740", "score": "0.43142834", "text": "func (o *JobSeeker) Delete(ctx context.Context, exec boil.ContextExecutor) (int64, error) {\n\tif o == nil {\n\t\treturn 0, errors.New(\"models: no JobSeeker provided for delete\")\n\t}\n\n\tif err := o.doBeforeDeleteHooks(ctx, exec); err != nil {\n\t\treturn 0, err\n\t}\n\n\targs := queries.ValuesFromMapping(reflect.Indirect(reflect.ValueOf(o)), jobSeekerPrimaryKeyMapping)\n\tsql := \"DELETE FROM \\\"job_seeker\\\" WHERE \\\"id\\\"=$1\"\n\n\tif boil.IsDebug(ctx) {\n\t\twriter := boil.DebugWriterFrom(ctx)\n\t\tfmt.Fprintln(writer, sql)\n\t\tfmt.Fprintln(writer, args...)\n\t}\n\tresult, err := exec.ExecContext(ctx, sql, args...)\n\tif err != nil {\n\t\treturn 0, errors.Wrap(err, \"models: unable to delete from job_seeker\")\n\t}\n\n\trowsAff, err := result.RowsAffected()\n\tif err != nil {\n\t\treturn 0, errors.Wrap(err, \"models: failed to get rows affected by delete for job_seeker\")\n\t}\n\n\tif err := o.doAfterDeleteHooks(ctx, exec); err != nil {\n\t\treturn 0, err\n\t}\n\n\treturn rowsAff, nil\n}", "title": "" }, { "docid": "13be45d72e1439c506559cb1706e5b9a", "score": "0.43106243", "text": "func (mr *MockstoreMockRecorder) DeleteJob(appName, jobName interface{}) *gomock.Call {\n\tmr.mock.ctrl.T.Helper()\n\treturn mr.mock.ctrl.RecordCallWithMethodType(mr.mock, \"DeleteJob\", reflect.TypeOf((*Mockstore)(nil).DeleteJob), appName, jobName)\n}", "title": "" }, { "docid": "1611a25f1ace5e5b10772a367353594f", "score": "0.4308692", "text": "func DeleteJobs(clientset *kubernetes.Clientset, selector, namespace string) error {\n\tlog.Debugf(\"deleting Jobs with selector=%s in namespace %s\", selector, namespace)\n\n\t//delete the job\n\tdelOptions := meta_v1.DeleteOptions{}\n\tvar delProp meta_v1.DeletionPropagation\n\tdelProp = meta_v1.DeletePropagationForeground\n\tdelOptions.PropagationPolicy = &delProp\n\n\tlo := meta_v1.ListOptions{LabelSelector: selector}\n\n\terr := clientset.Batch().Jobs(namespace).DeleteCollection(&delOptions, lo)\n\tif err != nil {\n\t\tlog.Error(\"error deleting Jobs \" + selector + err.Error())\n\t\treturn err\n\t}\n\n\treturn err\n}", "title": "" }, { "docid": "9b1c3f435047649a30358f59f591fa0b", "score": "0.4305256", "text": "func (r Registry) Delete(j *jobs.Job) {\n\tuuid := j.UUID()\n\tr <- registryCommand{action: remove, key: uuid}\n}", "title": "" }, { "docid": "8819a786e27d10032a40b45e91cf32f1", "score": "0.43029794", "text": "func (l loginRuleClient) Delete(ctx context.Context, name string) error {\n\tteleportClient, err := l.TeleportClientAccessor(ctx)\n\tif err != nil {\n\t\treturn trace.Wrap(err)\n\t}\n\n\treturn trace.Wrap(teleportClient.DeleteLoginRule(ctx, name))\n}", "title": "" }, { "docid": "3631bd68da18f5159f935a13bcd50f4e", "score": "0.4300531", "text": "func (c *jobRESTClient) DeleteNasJob(ctx context.Context, req *aiplatformpb.DeleteNasJobRequest, opts ...gax.CallOption) (*DeleteNasJobOperation, error) {\n\tbaseUrl, err := url.Parse(c.endpoint)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\tbaseUrl.Path += fmt.Sprintf(\"/v1beta1/%v\", req.GetName())\n\n\t// Build HTTP headers from client and context metadata.\n\thds := []string{\"x-goog-request-params\", fmt.Sprintf(\"%s=%v\", \"name\", url.QueryEscape(req.GetName()))}\n\n\thds = append(c.xGoogHeaders, hds...)\n\thds = append(hds, \"Content-Type\", \"application/json\")\n\theaders := gax.BuildHeaders(ctx, hds...)\n\tunm := protojson.UnmarshalOptions{AllowPartial: true, DiscardUnknown: true}\n\tresp := &longrunningpb.Operation{}\n\te := gax.Invoke(ctx, func(ctx context.Context, settings gax.CallSettings) error {\n\t\tif settings.Path != \"\" {\n\t\t\tbaseUrl.Path = settings.Path\n\t\t}\n\t\thttpReq, err := http.NewRequest(\"DELETE\", baseUrl.String(), nil)\n\t\tif err != nil {\n\t\t\treturn err\n\t\t}\n\t\thttpReq = httpReq.WithContext(ctx)\n\t\thttpReq.Header = headers\n\n\t\thttpRsp, err := c.httpClient.Do(httpReq)\n\t\tif err != nil {\n\t\t\treturn err\n\t\t}\n\t\tdefer httpRsp.Body.Close()\n\n\t\tif err = googleapi.CheckResponse(httpRsp); err != nil {\n\t\t\treturn err\n\t\t}\n\n\t\tbuf, err := io.ReadAll(httpRsp.Body)\n\t\tif err != nil {\n\t\t\treturn err\n\t\t}\n\n\t\tif err := unm.Unmarshal(buf, resp); err != nil {\n\t\t\treturn err\n\t\t}\n\n\t\treturn nil\n\t}, opts...)\n\tif e != nil {\n\t\treturn nil, e\n\t}\n\n\toverride := fmt.Sprintf(\"/ui/%s\", resp.GetName())\n\treturn &DeleteNasJobOperation{\n\t\tlro: longrunning.InternalNewOperation(*c.LROClient, resp),\n\t\tpollPath: override,\n\t}, nil\n}", "title": "" }, { "docid": "17eb01946e818cbebb449b9e716e25fe", "score": "0.42977116", "text": "func (client PipelineJobsClient) DeleteSender(req *http.Request) (*http.Response, error) {\n\treturn client.Send(req, azure.DoRetryWithRegistration(client.Client))\n}", "title": "" } ]
7d86a6c30db35f910c7e7fddd56cd3a7
ReadGitIgnore implements the io.Reader interface for reading a gitignore file line by line. It behaves exactly like the GitIgnore function. The only difference is that GitIgnore works on a string slice. ReadGitIgnore returns a boolean value if we match or not and an error.
[ { "docid": "c6c39878fad061ace5cd3e71d1caafee", "score": "0.77847546", "text": "func ReadGitIgnore(content io.Reader, name string) (ignore bool, err error) {\n\tscanner := bufio.NewScanner(content)\n\n\tfor scanner.Scan() {\n\t\tpattern := strings.TrimSpace(scanner.Text())\n\t\tif len(pattern) == 0 || pattern[0] == '#' {\n\t\t\tcontinue\n\t\t}\n\t\tp := parsePattern(pattern)\n\t\t// Convert Windows paths to Unix paths\n\t\tname = filepath.ToSlash(name)\n\t\tmatch, err := regexp.MatchString(p.Regex, name)\n\t\tif err != nil {\n\t\t\treturn ignore, err\n\t\t}\n\t\tif match {\n\t\t\tif p.Include {\n\t\t\t\treturn false, scanner.Err()\n\t\t\t}\n\t\t\tignore = true\n\t\t}\n\t}\n\treturn ignore, scanner.Err()\n}", "title": "" } ]
[ { "docid": "d0293e3e4591cf0182813bd2570ce98f", "score": "0.5745747", "text": "func GitIgnore(patterns []string, name string) (ignore bool, err error) {\n\tfor _, pattern := range patterns {\n\t\tp := parsePattern(pattern)\n\t\t// Convert Windows paths to Unix paths\n\t\tname = filepath.ToSlash(name)\n\t\tmatch, err := regexp.MatchString(p.Regex, name)\n\t\tif err != nil {\n\t\t\treturn ignore, err\n\t\t}\n\t\tif match {\n\t\t\tif p.Include {\n\t\t\t\treturn false, nil\n\t\t\t}\n\t\t\tignore = true\n\t\t}\n\t}\n\treturn ignore, nil\n}", "title": "" }, { "docid": "d511d56df4d1de08a2939379d69ae6e4", "score": "0.57055795", "text": "func Gitignore(name string) ([]byte, error) {\n\treturn AssetFS().ReadFile(\"gitignore\", name)\n}", "title": "" }, { "docid": "70e284f18c33ef31c92a86ae88c572b0", "score": "0.5532083", "text": "func Gitignore(name string) ([]byte, error) {\n\treturn fileFromDir(path.Join(\"gitignore\", name))\n}", "title": "" }, { "docid": "7da4abbb7a1498de41805ff284ed90fb", "score": "0.5492368", "text": "func ReadDockerIgnore(path string) ([]string, error) {\n\t// Note that a missing .dockerignore file isn't treated as an error\n\treader, err := os.Open(path)\n\tif err != nil {\n\t\tif !os.IsNotExist(err) {\n\t\t\treturn nil, fmt.Errorf(\"Error reading '%s': %v\", path, err)\n\t\t}\n\t\treturn nil, nil\n\t}\n\tdefer reader.Close()\n\n\tscanner := bufio.NewScanner(reader)\n\tvar excludes []string\n\n\tfor scanner.Scan() {\n\t\tpattern := strings.TrimSpace(scanner.Text())\n\t\tif pattern == \"\" {\n\t\t\tcontinue\n\t\t}\n\t\tpattern = filepath.Clean(pattern)\n\t\texcludes = append(excludes, pattern)\n\t}\n\tif err = scanner.Err(); err != nil {\n\t\treturn nil, fmt.Errorf(\"Error reading '%s': %v\", path, err)\n\t}\n\treturn excludes, nil\n}", "title": "" }, { "docid": "a5b00bccdc8b6126277f16a928bca1f5", "score": "0.53469944", "text": "func TestNewGitIgnore(t *testing.T) {\n\tignore, _ := NewGitIgnore(\".ignoretest\")\n\n\tif ignore.Match(\"\", false) != false {\n\t\tt.Error(\"empty should never match\")\n\t}\n}", "title": "" }, { "docid": "cee7394fdbc83b4422c24e2ae9b9e8da", "score": "0.531367", "text": "func ReadFilesFromGit(repo, commitSHA1 string, ignoreRegex *regexp.Regexp, phpExtensions []string) ReadCallback {\n\tcatter, err := git.NewCatter(repo)\n\tif err != nil {\n\t\tlog.Fatalf(\"Could not start catter: %s\", err.Error())\n\t}\n\n\ttree, err := git.GetTreeSHA1(catter, commitSHA1)\n\tif err != nil {\n\t\tlog.Fatalf(\"Could not get tree sha1: %s\", err.Error())\n\t}\n\n\tsuffixes := makePHPExtensionSuffixes(phpExtensions)\n\n\treturn func(ch chan FileInfo) {\n\t\tstart := time.Now()\n\t\tidx := 0\n\n\t\terr = catter.Walk(\n\t\t\t\"\",\n\t\t\ttree,\n\t\t\tfunc(filename []byte) bool {\n\t\t\t\treturn isPHPExtensionBytes(filename, suffixes)\n\t\t\t},\n\t\t\tfunc(filename string, contents []byte) {\n\t\t\t\tidx++\n\t\t\t\tif time.Since(start) >= 2*time.Second {\n\t\t\t\t\tstart = time.Now()\n\t\t\t\t\tlog.Printf(\"Processed %d files from git\", idx)\n\t\t\t\t}\n\n\t\t\t\tif ignoreRegex != nil && ignoreRegex.MatchString(filename) {\n\t\t\t\t\treturn\n\t\t\t\t}\n\n\t\t\t\tch <- FileInfo{\n\t\t\t\t\tName: filename,\n\t\t\t\t\tContents: contents,\n\t\t\t\t}\n\t\t\t},\n\t\t)\n\n\t\tif err != nil {\n\t\t\tlog.Fatalf(\"Could not walk: %s\", err.Error())\n\t\t}\n\t}\n}", "title": "" }, { "docid": "4da76139703e9e5e2d005cbd937abba8", "score": "0.52020675", "text": "func NewGitIgnoreFileMatcher(prefix string, exprs ...string) FileMatcher {\n\tignorer := ignore.CompileIgnoreLines(exprs...)\n\tm := &gitIgnoreFileMatcher{\n\t\tignorer: ignorer,\n\t\tprefix: prefix,\n\t}\n\treturn m\n}", "title": "" }, { "docid": "19f7e50d3cf91add401ac20964aa2c8b", "score": "0.5060962", "text": "func (c *Client) GitIgnore() *GitIgnoreService {\n\treturn &GitIgnoreService{client: c}\n}", "title": "" }, { "docid": "19f7e50d3cf91add401ac20964aa2c8b", "score": "0.5060962", "text": "func (c *Client) GitIgnore() *GitIgnoreService {\n\treturn &GitIgnoreService{client: c}\n}", "title": "" }, { "docid": "7badb94a36f6715983d9733929b39a70", "score": "0.49965963", "text": "func Test_ignore_getIgnoreLines(t *testing.T) {\n\ttype fields struct {\n\t\tfrom map[string]bool\n\t\tlines []int\n\t}\n\ttests := []struct {\n\t\tname string\n\t\tfields fields\n\t\twant []int\n\t}{\n\t\t{\n\t\t\tname: \"get ignore lines: with dups\",\n\t\t\tfields: fields{\n\t\t\t\tfrom: make(map[string]bool),\n\t\t\t\tlines: []int{1, 1, 2, 3, 4},\n\t\t\t},\n\t\t\twant: []int{1, 2, 3, 4},\n\t\t},\n\t\t{\n\t\t\tname: \"get ignore lines: without dups\",\n\t\t\tfields: fields{\n\t\t\t\tfrom: make(map[string]bool),\n\t\t\t\tlines: []int{1, 2, 3, 4},\n\t\t\t},\n\t\t\twant: []int{1, 2, 3, 4},\n\t\t},\n\t}\n\tfor _, tt := range tests {\n\t\tt.Run(tt.name, func(t *testing.T) {\n\t\t\ti := &ignore{\n\t\t\t\tfrom: tt.fields.from,\n\t\t\t\tlines: tt.fields.lines,\n\t\t\t}\n\t\t\tif got := i.getIgnoreLines(); !reflect.DeepEqual(got, tt.want) {\n\t\t\t\tt.Errorf(\"ignore.getIgnoreLines() = %v, want %v\", got, tt.want)\n\t\t\t}\n\t\t})\n\t}\n}", "title": "" }, { "docid": "62eef2de34e4f8ef423288d41ac34c23", "score": "0.4932868", "text": "func Test_ignore_getIgnoreComments(t *testing.T) {\n\ttype fields struct {\n\t\tfrom map[string]bool\n\t\tlines []int\n\t}\n\ttype args struct {\n\t\tnode *parser.Node\n\t}\n\ttests := []struct {\n\t\tname string\n\t\tfields fields\n\t\targs args\n\t\twantIgnore bool\n\t\twantLines []int\n\t}{\n\t\t{\n\t\t\tname: \"get ignore comments: should ignore single line\",\n\t\t\tfields: fields{\n\t\t\t\tfrom: make(map[string]bool),\n\t\t\t\tlines: make([]int, 0),\n\t\t\t},\n\t\t\targs: args{\n\t\t\t\tnode: &parser.Node{\n\t\t\t\t\tPrevComment: []string{\"kics-scan ignore-line\"},\n\t\t\t\t\tStartLine: 3,\n\t\t\t\t\tEndLine: 3,\n\t\t\t\t},\n\t\t\t},\n\t\t\twantIgnore: false,\n\t\t\twantLines: []int{2, 3},\n\t\t},\n\t\t{\n\t\t\tname: \"get ignore comments: should ignore multi-line\",\n\t\t\tfields: fields{\n\t\t\t\tfrom: make(map[string]bool),\n\t\t\t\tlines: make([]int, 0),\n\t\t\t},\n\t\t\targs: args{\n\t\t\t\tnode: &parser.Node{\n\t\t\t\t\tPrevComment: []string{\"kics-scan ignore-line\"},\n\t\t\t\t\tStartLine: 3,\n\t\t\t\t\tEndLine: 6,\n\t\t\t\t},\n\t\t\t},\n\t\t\twantIgnore: false,\n\t\t\twantLines: []int{2, 3, 4, 5, 6},\n\t\t},\n\t\t{\n\t\t\tname: \"get ignore comments: should ignore comment multi-line\",\n\t\t\tfields: fields{\n\t\t\t\tfrom: make(map[string]bool),\n\t\t\t\tlines: make([]int, 0),\n\t\t\t},\n\t\t\targs: args{\n\t\t\t\tnode: &parser.Node{\n\t\t\t\t\tPrevComment: []string{\"kics-scan ignore-line\", \"kics-scan regular command\"},\n\t\t\t\t\tStartLine: 3,\n\t\t\t\t\tEndLine: 6,\n\t\t\t\t},\n\t\t\t},\n\t\t\twantIgnore: false,\n\t\t\twantLines: []int{2, 3, 4, 5, 6, 1},\n\t\t},\n\t\t{\n\t\t\tname: \"get ignore comments: should ignore regular comment\",\n\t\t\tfields: fields{\n\t\t\t\tfrom: make(map[string]bool),\n\t\t\t\tlines: make([]int, 0),\n\t\t\t},\n\t\t\targs: args{\n\t\t\t\tnode: &parser.Node{\n\t\t\t\t\tPrevComment: []string{\"this is a regular comment\"},\n\t\t\t\t\tStartLine: 3,\n\t\t\t\t\tEndLine: 6,\n\t\t\t\t},\n\t\t\t},\n\t\t\twantIgnore: false,\n\t\t\twantLines: []int{2},\n\t\t},\n\t\t{\n\t\t\tname: \"get ignore comments: should return true for ignore block\",\n\t\t\tfields: fields{\n\t\t\t\tfrom: make(map[string]bool),\n\t\t\t\tlines: make([]int, 0),\n\t\t\t},\n\t\t\targs: args{\n\t\t\t\tnode: &parser.Node{\n\t\t\t\t\tPrevComment: []string{\"kics-scan ignore-block\"},\n\t\t\t\t\tStartLine: 3,\n\t\t\t\t\tEndLine: 6,\n\t\t\t\t},\n\t\t\t},\n\t\t\twantIgnore: true,\n\t\t\twantLines: []int{2},\n\t\t},\n\t}\n\tfor _, tt := range tests {\n\t\tt.Run(tt.name, func(t *testing.T) {\n\t\t\ti := &ignore{\n\t\t\t\tfrom: tt.fields.from,\n\t\t\t\tlines: tt.fields.lines,\n\t\t\t}\n\t\t\tif gotIgnore := i.getIgnoreComments(tt.args.node); gotIgnore != tt.wantIgnore {\n\t\t\t\tt.Errorf(\"ignore.getIgnoreComments() = %v, want %v\", gotIgnore, tt.wantIgnore)\n\t\t\t}\n\t\t\trequire.Equal(t, tt.wantLines, i.getIgnoreLines())\n\t\t})\n\t}\n}", "title": "" }, { "docid": "56529cd69f9fbaa901c92f1df5c6a948", "score": "0.47668818", "text": "func Readln(r *bufio.Reader) (string, error) {\n var (isPrefix bool = true\n err error = nil\n line, ln []byte\n )\n for isPrefix && err == nil {\n line, isPrefix, err = r.ReadLine()\n ln = append(ln, line...)\n }\n return string(ln),err\n}", "title": "" }, { "docid": "7d29e85bbbb51ab666ee8c7e50ebf0af", "score": "0.47489285", "text": "func (fs *FS) Read(path string) ([]byte, error) {\n\tif _, _, gitPath, ok := fs.parseGitURL(path); ok {\n\t\tvar result []byte\n\t\terr := fs.withGit(path, func(r *git.Repository, bfs billy.Filesystem) error {\n\t\t\tf, err := bfs.Open(gitPath)\n\t\t\tif err != nil {\n\t\t\t\treturn err\n\t\t\t}\n\t\t\tdefer f.Close()\n\n\t\t\tresult, err = ioutil.ReadAll(f)\n\t\t\treturn err\n\t\t})\n\t\treturn result, err\n\t}\n\treturn ioutil.ReadFile(filepath.Join(fs.BaseDir, filepath.Clean(path)))\n}", "title": "" }, { "docid": "ad920c2535bf6eff9f2f9f0b58e2ae58", "score": "0.47042224", "text": "func shouldConsiderLinesOfCommit(hash string) bool {\n\tfor _, ignore := range []string{\n\t\t\"41e4d9a34c1d9dcb2eef3ff39ff9c1f987bfa02a\", // Consistent formatting for Dawn/Tint.\n\t\t\"e87ac76f7ddf9237f3022cda90224bd0691fb318\", // Merge tint -> dawn\n\t\t\"b0acbd436dbd499505a3fa8bf89e69231ec4d1e0\", // Fix build/namespaces issues\n\t} {\n\t\tif hash == ignore {\n\t\t\treturn false\n\t\t}\n\t}\n\treturn true\n}", "title": "" }, { "docid": "da7489b30ae5cf6a0160e310c2493e79", "score": "0.46988598", "text": "func TestDockerbuildIgnoreWithNewline(t *testing.T) {\n\tf := newFixture(t)\n\n\tf.dockerfile(\"Dockerfile\")\n\tf.yaml(\"foo.yaml\", deployment(\"foo\", image(\"gcr.io/foo\")))\n\tf.file(\"Tiltfile\", `\ndocker_build('gcr.io/foo', '.', ignore=\"\\nweirdfile.txt\")\nk8s_yaml('foo.yaml')\n`)\n\n\tf.loadErrString(`ignore cannot contain newlines; found ignore: \"\\nweirdfile.txt\"`)\n}", "title": "" }, { "docid": "d1f5b551136e82b65ab1d4dfb1d79e81", "score": "0.4689695", "text": "func shouldConsiderLinesOfFile(path string) bool {\n\tfor _, ignore := range []string{\n\t\t\"Doxyfile\",\n\t\t\"package-lock.json\",\n\t\t\"src/tint/builtin_table.inl\",\n\t\t\"src/tint/resolver/intrinsic_table.inl\",\n\t\t\"test/tint/\",\n\t\t\"third_party/gn/webgpu-cts/test_list.txt\",\n\t\t\"third_party/khronos/\",\n\t\t\"webgpu-cts/\",\n\t\t\"src/external/petamoriken\",\n\t} {\n\t\tif strings.HasPrefix(path, ignore) {\n\t\t\treturn false\n\t\t}\n\t}\n\treturn true\n}", "title": "" }, { "docid": "6875ef1586c9cad2a5a5bbc3b1784416", "score": "0.46526694", "text": "func ReadingLines(filename string) []string {\n\tvar result []string\n\tif strings.HasPrefix(filename, \"~\") {\n\t\tfilename, _ = homedir.Expand(filename)\n\t}\n\tfile, err := os.Open(filename)\n\tdefer file.Close()\n\tif err != nil {\n\t\treturn result\n\t}\n\n\tscanner := bufio.NewScanner(file)\n\tfor scanner.Scan() {\n\t\tval := scanner.Text()\n\t\tif val == \"\" {\n\t\t\tcontinue\n\t\t}\n\t\tresult = append(result, val)\n\t}\n\n\tif err := scanner.Err(); err != nil {\n\t\treturn result\n\t}\n\treturn result\n}", "title": "" }, { "docid": "2b6f78c638c7d06d08e55bf7c931a381", "score": "0.4648725", "text": "func MatchReader(pattern string, r io.RuneReader) (bool, error)", "title": "" }, { "docid": "23391c551b13b51df50a5f4bc5c582db", "score": "0.4639784", "text": "func hasLines(r io.Reader) (bool, error) {\n\t// TODO: if any files we read have > 64KB lines, we'll need to switch to bytes.ReadLine\n\t// TODO: probably going to be secrets\n\ts := bufio.NewScanner(r)\n\tfor s.Scan() {\n\t\tif line := strings.TrimSpace(s.Text()); len(line) > 0 && line[0] != '#' {\n\t\t\treturn true, nil\n\t\t}\n\t}\n\tif err := s.Err(); err != nil && err != io.EOF {\n\t\treturn false, err\n\t}\n\treturn false, nil\n}", "title": "" }, { "docid": "1f1b93783f4ea0adc8d2a56cf522ff44", "score": "0.4634073", "text": "func (wc *Wildcat) ReadFileListFromReader(in io.Reader, index *Order) {\n\treader := bufio.NewReader(in)\n\torder := index.Sub()\n\tnewWc := wc.updateFileList(false)\n\tfor {\n\t\tline, err := reader.ReadString('\\n')\n\t\tline = strings.TrimSpace(line)\n\t\tif line != \"\" && !newWc.config.IsIgnore(line) {\n\t\t\terr := newWc.handleItem(NewArgWithIndex(order, line))\n\t\t\tnewWc.config.ec.Push(err)\n\t\t}\n\t\tif err == io.EOF {\n\t\t\tbreak\n\t\t}\n\t\torder = order.Next()\n\t}\n}", "title": "" }, { "docid": "e5a877c1c3769163234259cc482ddcfa", "score": "0.46219033", "text": "func ReadMultiline(in Readline, opts ReadOptions, prompt string) (src string, firstToken int, err error) {\n\tvar line, buf []byte\n\tm := mNormal\n\tparen := 0\n\tfirstToken = -1\n\tlastToken := -1\n\toptPrompt := opts&ReadOptShowPrompt != 0\n\toptAllComments := opts&ReadOptCollectAllComments != 0\n\tignorenl := false\n\tvar currPrompt string\n\tif optPrompt {\n\t\tcurrPrompt = prompt\n\t}\n\n\t// comments do not reset ignorenl\n\tresetnl := func(paren int, m mode) bool {\n\t\treturn paren != 0 ||\n\t\t\t(m != mNormal && m != mSlash && m != mHash &&\n\t\t\t\tm != mLineComment && m != mComment && m != mCommentStar)\n\t}\n\tfoundtoken := func(pos int) {\n\t\tlastToken = len(buf) + pos\n\t\tif firstToken < 0 {\n\t\t\tfirstToken = lastToken\n\t\t\tif debug {\n\t\t\t\toutput.Debugf(\"ReadMultiline: setting firstToken to %d, line up to it = %q\", firstToken, line[:pos])\n\t\t\t}\n\t\t}\n\t}\n\tinvalidChar := func(i int, ch byte, ctx string) (string, int, error) {\n\t\treturn string(append(buf, line[:i]...)), firstToken,\n\t\t\terrors.New(fmt.Sprintf(\"unexpected character %q inside %s literal\", ch, ctx))\n\t}\n\n\tfor {\n\t\tline, err = in.Read(currPrompt)\n\t\tfor i, ch := range line {\n\t\t\tif debug {\n\t\t\t\toutput.Debugf(\"ReadMultiline: found %q\\tmode=%v\\tparen=%d ignorenl=%t\", ch, m, paren, ignorenl)\n\t\t\t}\n\t\t\tswitch m {\n\t\t\tcase mPlus, mMinus:\n\t\t\t\tif ch == '+' {\n\t\t\t\t\tif m == mPlus {\n\t\t\t\t\t\tm = mNormal\n\t\t\t\t\t} else {\n\t\t\t\t\t\tm = mPlus\n\t\t\t\t\t}\n\t\t\t\t\tbreak\n\t\t\t\t} else if ch == '-' {\n\t\t\t\t\tif m == mMinus {\n\t\t\t\t\t\tm = mNormal\n\t\t\t\t\t} else {\n\t\t\t\t\t\tm = mMinus\n\t\t\t\t\t}\n\t\t\t\t\tbreak\n\t\t\t\t}\n\t\t\t\tm = mNormal\n\t\t\t\tignorenl = true\n\t\t\t\tif ch <= ' ' {\n\t\t\t\t\tcontinue\n\t\t\t\t}\n\t\t\t\tfallthrough\n\t\t\tcase mNormal:\n\t\t\t\tswitch ch {\n\t\t\t\tcase '(', '[', '{':\n\t\t\t\t\tparen++\n\t\t\t\tcase ')', ']', '}':\n\t\t\t\t\tparen--\n\t\t\t\tcase '\\'':\n\t\t\t\t\tm = mRune\n\t\t\t\tcase '\"':\n\t\t\t\t\tm = mString\n\t\t\t\tcase '`':\n\t\t\t\t\tm = mRawString\n\t\t\t\tcase '/':\n\t\t\t\t\tm = mSlash\n\t\t\t\t\tcontinue // no tokens yet\n\t\t\t\tcase '#':\n\t\t\t\t\tm = mHash // support #! line comments\n\t\t\t\t\tcontinue // no tokens yet\n\t\t\t\tcase '~':\n\t\t\t\t\tm = mTilde\n\t\t\t\tcase '!', '%', '&', '*', ',', '.', '<', '=', '>', '^', '|':\n\t\t\t\t\tignorenl = paren == 0\n\t\t\t\tcase '+':\n\t\t\t\t\tignorenl = false\n\t\t\t\t\tif paren == 0 {\n\t\t\t\t\t\tm = mPlus\n\t\t\t\t\t}\n\t\t\t\tcase '-':\n\t\t\t\t\tignorenl = false\n\t\t\t\t\tif paren == 0 {\n\t\t\t\t\t\tm = mMinus\n\t\t\t\t\t}\n\t\t\t\tdefault:\n\t\t\t\t\tif ch <= ' ' {\n\t\t\t\t\t\tcontinue // not a token\n\t\t\t\t\t}\n\t\t\t\t\tignorenl = false // found a token\n\t\t\t\t}\n\t\t\tcase mRune:\n\t\t\t\tswitch ch {\n\t\t\t\tcase '\\\\':\n\t\t\t\t\tm = mRuneEscape\n\t\t\t\tcase '\\'':\n\t\t\t\t\tm = mNormal\n\t\t\t\tdefault:\n\t\t\t\t\tif ch < ' ' {\n\t\t\t\t\t\treturn invalidChar(i, ch, \"rune\")\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\tcase mRuneEscape:\n\t\t\t\tif ch < ' ' {\n\t\t\t\t\treturn invalidChar(i, ch, \"rune\")\n\t\t\t\t}\n\t\t\t\tm = mRune\n\t\t\tcase mString:\n\t\t\t\tswitch ch {\n\t\t\t\tcase '\\\\':\n\t\t\t\t\tm = mStringEscape\n\t\t\t\tcase '\"':\n\t\t\t\t\tm = mNormal\n\t\t\t\tdefault:\n\t\t\t\t\tif ch < ' ' {\n\t\t\t\t\t\treturn invalidChar(i, ch, \"string\")\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\tcase mStringEscape:\n\t\t\t\tif ch < ' ' {\n\t\t\t\t\treturn invalidChar(i, ch, \"string\")\n\t\t\t\t}\n\t\t\t\tm = mString\n\t\t\tcase mRawString:\n\t\t\t\tswitch ch {\n\t\t\t\tcase '`':\n\t\t\t\t\tm = mNormal\n\t\t\t\t}\n\t\t\tcase mSlash:\n\t\t\t\tswitch ch {\n\t\t\t\tcase '/':\n\t\t\t\t\tm = mLineComment\n\t\t\t\t\tcontinue // no tokens\n\t\t\t\tcase '*':\n\t\t\t\t\tm = mComment\n\t\t\t\t\tcontinue // no tokens\n\t\t\t\tdefault:\n\t\t\t\t\tm = mNormal\n\t\t\t\t\tif ch <= ' ' {\n\t\t\t\t\t\tignorenl = true\n\t\t\t\t\t} else {\n\t\t\t\t\t\tfoundtoken(i - 1)\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\tcase mHash:\n\t\t\t\tswitch ch {\n\t\t\t\tcase '!':\n\t\t\t\t\tm = mLineComment\n\t\t\t\t\tline[i-1] = '/'\n\t\t\t\t\tline[i] = '/'\n\t\t\t\t\tcontinue // no tokens\n\t\t\t\tdefault:\n\t\t\t\t\tm = mNormal\n\t\t\t\t\tfoundtoken(i - 1)\n\t\t\t\t}\n\t\t\tcase mLineComment:\n\t\t\t\tcontinue\n\t\t\tcase mComment:\n\t\t\t\tswitch ch {\n\t\t\t\tcase '*':\n\t\t\t\t\tm = mCommentStar\n\t\t\t\t}\n\t\t\t\tcontinue\n\t\t\tcase mCommentStar:\n\t\t\t\tswitch ch {\n\t\t\t\tcase '/':\n\t\t\t\t\tm = mNormal\n\t\t\t\tdefault:\n\t\t\t\t\tm = mComment\n\t\t\t\t}\n\t\t\t\tcontinue\n\t\t\tcase mTilde:\n\t\t\t\tm = mNormal\n\t\t\t}\n\t\t\tif debug {\n\t\t\t\toutput.Debugf(\"ReadMultiline: \\tmode=%v\\tparen=%d ignorenl=%t resetnl=%t\", m, paren, ignorenl, resetnl(paren, m))\n\t\t\t}\n\t\t\tif resetnl(paren, m) {\n\t\t\t\tignorenl = false\n\t\t\t\tif debug {\n\t\t\t\t\toutput.Debugf(\"ReadMultiline: cleared ignorenl\")\n\t\t\t\t}\n\t\t\t}\n\t\t\tif ch > ' ' {\n\t\t\t\tfoundtoken(i)\n\t\t\t}\n\t\t}\n\t\tbuf = append(buf, line...)\n\t\tif m == mLineComment {\n\t\t\tm = mNormal\n\t\t}\n\t\tif err != nil {\n\t\t\tbreak\n\t\t}\n\t\tif paren <= 0 && !ignorenl && m == mNormal && (firstToken >= 0 || !optAllComments) {\n\t\t\tif firstToken >= 0 && lastIsKeywordIgnoresNl(line, firstToken, lastToken) {\n\t\t\t\tignorenl = true\n\t\t\t} else {\n\t\t\t\tbreak\n\t\t\t}\n\t\t}\n\t\tif debug {\n\t\t\toutput.Debugf(\"ReadMultiline: continuing\\tmode=%v\\tparen=%d ignorenl=%t\", m, paren, ignorenl)\n\t\t}\n\t\tif m == mPlus || m == mMinus {\n\t\t\tm = mNormal\n\t\t}\n\t\tif optPrompt {\n\t\t\tcurrPrompt = makeDots(9 + 2*paren)\n\t\t}\n\t}\n\tif err != nil {\n\t\tif err == io.EOF && paren > 0 {\n\t\t\terr = errors.New(\"unexpected EOF\")\n\t\t}\n\t\treturn string(buf), firstToken, err\n\t}\n\tif debug {\n\t\toutput.Debugf(\"ReadMultiline: read %d bytes, firstToken at %d\", len(buf), firstToken)\n\t\tif firstToken >= 0 {\n\t\t\toutput.Debugf(\"ReadMultiline: comments: %q\", buf[:firstToken])\n\t\t\toutput.Debugf(\"ReadMultiline: tokens: %q\", buf[firstToken:])\n\t\t} else {\n\t\t\toutput.Debugf(\"ReadMultiline: comments: %q\", buf)\n\t\t}\n\t}\n\treturn string(buf), firstToken, nil\n}", "title": "" }, { "docid": "413269e1b2c86d2c2392e12e5b948df9", "score": "0.45835608", "text": "func TestRead(t *testing.T) {\n\ttestGlobals.pipeWrite.Write(WELCOME) /* Ignored message */\n\n\t/* Block until the line to be ignored is read */\n\tfor {\n\t\tdata := testGlobals.reader.Peek()\n\t\tif len(data) > 0 {\n\t\t\tbreak\n\t\t}\n\t}\n\n\tgo func () {\n\t\ttestGlobals.pipeWrite.Write([]byte{'a'})\n\t}()\n\n\ttestGlobals.reader.Reset()\n\tdata := testGlobals.reader.Get()\n\n\tif len(data) == 0 {\n\t\tt.Fatal(\"No data read from pipe\")\n\t}\n\n\tif string(data) != \"a\" {\n\t\tt.Fatal(\"Invalid reading: \", string(data))\n\t}\n}", "title": "" }, { "docid": "18f1395a5684f2738a01f3c2086f8b5e", "score": "0.457942", "text": "func ExampleReadFile() {\n\n\t// check README file exists\n\t_, err := os.Stat(README)\n\tif err == nil {\n\t} else if os.IsNotExist(err) {\n\t\tfmt.Printf(\"Please Create a '%s'\\n\", README)\n\t\tpanic(err)\n\t} else {\n\t\tpanic(err)\n\t}\n\n\t// read README file content\n\tc, err := ioutil.ReadFile(README)\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\tfmt.Print(len(c) != 0)\n\t// Output:\n\t// true\n}", "title": "" }, { "docid": "b0506a02ad323b70b5c48ee5edd977e7", "score": "0.45759064", "text": "func loadIgnorer() error {\n\tvar err error\n\tignorer, err = ignore.CompileIgnoreFile(filepath.Join(folder, \".gitignore\"))\n\tif err != nil {\n\t\treturn err\n\t}\n\treturn nil\n}", "title": "" }, { "docid": "683bd03b1e5db728aaba9e548d82922f", "score": "0.45647365", "text": "func (vcs *vcs) Ignore(repopath string, toignore []string) error {\r\n\tbase := vcs.GetRepoBase(repopath)\r\n\tgitIgnore := filepath.Join(base, \".gitignore\")\r\n\r\n\treturn appendLines(gitIgnore, toignore)\r\n}", "title": "" }, { "docid": "8b8c610f5a94179fd3c6faf2de475a9b", "score": "0.45598486", "text": "func AnalyzeReader(filename string, language *Language, file io.Reader, opts *ClocOptions) *ClocFile {\n\tif opts.Debug {\n\t\tfmt.Printf(\"filename=%v\\n\", filename)\n\t}\n\n\tclocFile := &ClocFile{\n\t\tName: filename,\n\t\tLang: language.Name,\n\t}\n\n\tisFirstLine := true\n\tvar inComments [][2]string\n\tbuf := getByteSlice()\n\tdefer putByteSlice(buf)\n\tscanner := bufio.NewScanner(file)\n\tscanner.Buffer(buf.Bytes(), 1024*1024)\n\nscannerloop:\n\tfor scanner.Scan() {\n\t\tlineOrg := scanner.Text()\n\t\tline := strings.TrimSpace(lineOrg)\n\n\t\tif len(strings.TrimSpace(line)) == 0 {\n\t\t\tonBlank(clocFile, opts, len(inComments) > 0, line, lineOrg)\n\t\t\tcontinue\n\t\t}\n\n\t\t// shebang line is 'code'\n\t\tif isFirstLine && strings.HasPrefix(line, \"#!\") {\n\t\t\tonCode(clocFile, opts, len(inComments) > 0, line, lineOrg)\n\t\t\tisFirstLine = false\n\t\t\tcontinue\n\t\t}\n\n\t\tif len(inComments) == 0 {\n\t\t\tif isFirstLine {\n\t\t\t\tline = trimBOM(line)\n\t\t\t}\n\n\t\tsingleloop:\n\t\t\tfor _, singleComment := range language.lineComments {\n\t\t\t\tif strings.HasPrefix(line, singleComment) {\n\t\t\t\t\t// check if single comment is a prefix of multi comment\n\t\t\t\t\tfor _, ml := range language.multiLines {\n\t\t\t\t\t\tif ml[0] != \"\" && strings.HasPrefix(line, ml[0]) {\n\t\t\t\t\t\t\tbreak singleloop\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\tonComment(clocFile, opts, len(inComments) > 0, line, lineOrg)\n\t\t\t\t\tcontinue scannerloop\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tif len(language.multiLines) == 0 {\n\t\t\t\tonCode(clocFile, opts, len(inComments) > 0, line, lineOrg)\n\t\t\t\tcontinue scannerloop\n\t\t\t}\n\t\t}\n\n\t\tif len(inComments) == 0 && !containsComment(line, language.multiLines) {\n\t\t\tonCode(clocFile, opts, len(inComments) > 0, line, lineOrg)\n\t\t\tcontinue scannerloop\n\t\t}\n\n\t\tlenLine := len(line)\n\t\tif len(language.multiLines) == 1 && len(language.multiLines[0]) == 2 && language.multiLines[0][0] == \"\" {\n\t\t\tonCode(clocFile, opts, len(inComments) > 0, line, lineOrg)\n\t\t\tcontinue\n\t\t}\n\t\tcodeFlags := make([]bool, len(language.multiLines))\n\t\tfor pos := 0; pos < lenLine; {\n\t\t\tfor idx, ml := range language.multiLines {\n\t\t\t\tbegin, end := ml[0], ml[1]\n\t\t\t\tlenBegin := len(begin)\n\n\t\t\t\tif pos+lenBegin <= lenLine && strings.HasPrefix(line[pos:], begin) && (begin != end || len(inComments) == 0) {\n\t\t\t\t\tpos += lenBegin\n\t\t\t\t\tinComments = append(inComments, [2]string{begin, end})\n\t\t\t\t\tcontinue\n\t\t\t\t}\n\n\t\t\t\tif n := len(inComments); n > 0 {\n\t\t\t\t\tlast := inComments[n-1]\n\t\t\t\t\tif pos+len(last[1]) <= lenLine && strings.HasPrefix(line[pos:], last[1]) {\n\t\t\t\t\t\tinComments = inComments[:n-1]\n\t\t\t\t\t\tpos += len(last[1])\n\t\t\t\t\t}\n\t\t\t\t} else if pos < lenLine && !unicode.IsSpace(nextRune(line[pos:])) {\n\t\t\t\t\tcodeFlags[idx] = true\n\t\t\t\t}\n\t\t\t}\n\t\t\tpos++\n\t\t}\n\n\t\tisCode := true\n\t\tfor _, b := range codeFlags {\n\t\t\tif !b {\n\t\t\t\tisCode = false\n\t\t\t}\n\t\t}\n\n\t\tif isCode {\n\t\t\tonCode(clocFile, opts, len(inComments) > 0, line, lineOrg)\n\t\t} else {\n\t\t\tonComment(clocFile, opts, len(inComments) > 0, line, lineOrg)\n\t\t}\n\t}\n\n\treturn clocFile\n}", "title": "" }, { "docid": "c7ab39e33eefaf433a952bd6f92fc0f3", "score": "0.45597386", "text": "func readFile(file string, jsonC bool, typeC int, ignore bool, telescope bool) []string {\n\tmainFile, err := ioutil.ReadFile(file)\n\tif err != nil {\n\t\tlog.Fatal(err)\n\t}\n\ttext := string(mainFile)\n\tre := regexp.MustCompile(`https?:\\/\\/(www\\.)?[-a-zA-Z0-9@:%._\\+~#=]{2,256}\\.[a-z]{2,4}\\b([-a-zA-Z0-9@:%_\\+.~#?&//=]*)`)\n\tif telescope == true {\n\t\tre = regexp.MustCompile(`https?:\\/\\/localhost:[0-9]{1,5}\\/([-a-zA-Z0-9()@:%_\\+.~#?&\\/=]*)`)\n\t}\n\tresult := re.FindAllString(text, -1)\n\n\tif ignore {\n\t\tvar tempList []string\n\t\tignoreList := ignoreURL(\"ignore.txt\")\n\t\tfmt.Println(\"ignored urls \", ignoreList)\n\t\tfmt.Println(\"----------------------------------------------------------------------------------\")\n\t\tfor _, link := range result {\n\t\t\tvalid := true\n\t\t\tfor _, url := range ignoreList {\n\t\t\t\tif strings.HasPrefix(link, url) {\n\t\t\t\t\tvalid = false\n\t\t\t\t\tbreak\n\t\t\t\t}\n\t\t\t}\n\t\t\tif valid {\n\t\t\t\ttempList = append(tempList, link)\n\t\t\t}\n\t\t}\n\t\tresult = tempList\n\t}\n\treturn result\n}", "title": "" }, { "docid": "d2ec18c3cf10a336b03b752b302bc753", "score": "0.45420673", "text": "func ParseGitignoreFromDir(path string) (gitignore.IgnoreMatcher, error) {\n\tf, err := os.Open(filepath.Join(path, \".gitignore\"))\n\tswitch {\n\tcase os.IsNotExist(err):\n\t\treturn nil, nil // No gitignore file, not an error\n\tcase err != nil:\n\t\treturn nil, err // Some unexpected error (e.g. access failure)\n\t}\n\tdefer f.Close()\n\tmatcher := gitignore.NewGitIgnoreFromReader(path, f)\n\treturn matcher, nil\n}", "title": "" }, { "docid": "2cca23d2ec1d8bafcac4a58834717968", "score": "0.45233932", "text": "func (di *spdxDefaultImplementation) IgnorePatterns(\n\tdirPath string, extraPatterns []string, skipGitIgnore bool,\n) ([]gitignore.Pattern, error) {\n\tpatterns := []gitignore.Pattern{}\n\tfor _, s := range extraPatterns {\n\t\tpatterns = append(patterns, gitignore.ParsePattern(s, nil))\n\t}\n\n\tif skipGitIgnore {\n\t\tlogrus.Debug(\"Not using patterns in .gitignore\")\n\t\treturn patterns, nil\n\t}\n\n\tif util.Exists(filepath.Join(dirPath, gitIgnoreFile)) {\n\t\tf, err := os.Open(filepath.Join(dirPath, gitIgnoreFile))\n\t\tif err != nil {\n\t\t\treturn nil, errors.Wrap(err, \"opening gitignore file\")\n\t\t}\n\t\tdefer f.Close()\n\n\t\t// When using .gitignore files, we alwas add the .git directory\n\t\t// to match git's behavior\n\t\tpatterns = append(patterns, gitignore.ParsePattern(\".git/\", nil))\n\n\t\tscanner := bufio.NewScanner(f)\n\t\tfor scanner.Scan() {\n\t\t\ts := scanner.Text()\n\t\t\tif !strings.HasPrefix(s, \"#\") && len(strings.TrimSpace(s)) > 0 {\n\t\t\t\tlogrus.Debugf(\"Loaded .gitignore pattern: >>%s<<\", s)\n\t\t\t\tpatterns = append(patterns, gitignore.ParsePattern(s, nil))\n\t\t\t}\n\t\t}\n\t}\n\n\tlogrus.Debugf(\n\t\t\"Loaded %d patterns from .gitignore (+ %d extra) at root of directory\", len(patterns), len(extraPatterns),\n\t)\n\treturn patterns, nil\n}", "title": "" }, { "docid": "b94cc3aab651f52ba2fc389469d8a9a5", "score": "0.4513017", "text": "func readLines(path string, in io.Reader) ([]string, error) {\n\tif in == nil {\n\t\tfile, err := os.Open(path)\n\t\tif err != nil {\n\t\t\treturn nil, err\n\t\t}\n\t\tdefer file.Close()\n\t\tin = file\n\t}\n\n\tvar lines []string\n\tscanner := bufio.NewScanner(in)\n\tfor scanner.Scan() {\n\t\tlines = append(lines, scanner.Text())\n\t}\n\treturn lines, scanner.Err()\n}", "title": "" }, { "docid": "2279e5762259852bb664724e3b08875a", "score": "0.4488828", "text": "func ReadOldFilesFromGit(repo, commitSHA1 string, changes []git.Change, phpExtensions []string) ReadCallback {\n\tchangedMap := make(map[string][]git.LineRange, len(changes))\n\tfor _, ch := range changes {\n\t\tif ch.Type == git.Added {\n\t\t\tcontinue\n\t\t}\n\t\tchangedMap[ch.OldName] = append(changedMap[ch.OldName], ch.OldLineRanges...)\n\t}\n\n\tcatter, err := git.NewCatter(repo)\n\tif err != nil {\n\t\tlog.Fatalf(\"Could not start catter: %s\", err.Error())\n\t}\n\n\ttree, err := git.GetTreeSHA1(catter, commitSHA1)\n\tif err != nil {\n\t\tlog.Fatalf(\"Could not get tree sha1: %s\", err.Error())\n\t}\n\n\tsuffixes := makePHPExtensionSuffixes(phpExtensions)\n\n\treturn func(ch chan FileInfo) {\n\t\terr = catter.Walk(\n\t\t\t\"\",\n\t\t\ttree,\n\t\t\tfunc(filename []byte) bool {\n\t\t\t\tif !isPHPExtensionBytes(filename, suffixes) {\n\t\t\t\t\treturn false\n\t\t\t\t}\n\n\t\t\t\t_, ok := changedMap[string(filename)]\n\t\t\t\treturn ok\n\t\t\t},\n\t\t\tfunc(filename string, contents []byte) {\n\t\t\t\tch <- FileInfo{\n\t\t\t\t\tName: filename,\n\t\t\t\t\tContents: contents,\n\t\t\t\t\tLineRanges: changedMap[filename],\n\t\t\t\t}\n\t\t\t},\n\t\t)\n\n\t\tif err != nil {\n\t\t\tlog.Fatalf(\"Could not walk: %s\", err.Error())\n\t\t}\n\t}\n}", "title": "" }, { "docid": "16151ad19ae4b451fb8c4faa40856c10", "score": "0.4483928", "text": "func addGitignore(wg *sync.WaitGroup) {\n\tdefer wg.Done()\n\tignoreFile := \".gitignore\"\n\t_, err := os.Stat(ignoreFile)\n\tif err != nil {\n\t\t// Does not exist create\n\t\tf, err := os.Create(ignoreFile)\n\t\tdefer f.Close()\n\t\tif err != nil {\n\t\t\tlog.Fatal(err)\n\t\t}\n\t\tf.WriteString(\"#Ignore gitf files\\n\")\n\t\tf.WriteString(\"gitf.toml\\n\")\n\t\tf.WriteString(\"gitf.log\\n\")\n\t} else {\n\t\t// Exists, append\n\t\tf, err := os.OpenFile(ignoreFile, os.O_RDWR|os.O_APPEND, 0660)\n\t\tdefer f.Close()\n\t\tif err != nil {\n\t\t\tlog.Fatal(err)\n\t\t}\n\t\tf.WriteString(\"#Ignore gitf files\\n\")\n\t\tf.WriteString(\"gitf.toml\\n\")\n\t\tf.WriteString(\"gitf.log\\n\")\n\t}\n\treturn\n}", "title": "" }, { "docid": "e31741ba914db84ddf77582a16a119bb", "score": "0.4460545", "text": "func TestReadCRLF(t *testing.T) {\n\ttype testCase struct {\n\t\treader io.Reader\n\t\texpectedErr error\n\t}\n\ttests := []testCase{\n\t\t// Test - 1 valid buffer with CRLF.\n\t\t{bytes.NewReader([]byte(\"\\r\\n\")), nil},\n\t\t// Test - 2 invalid buffer with no CRLF.\n\t\t{bytes.NewReader([]byte(\"he\")), errMalformedEncoding},\n\t\t// Test - 3 invalid buffer with more characters.\n\t\t{bytes.NewReader([]byte(\"he\\r\\n\")), errMalformedEncoding},\n\t\t// Test - 4 smaller buffer than expected.\n\t\t{bytes.NewReader([]byte(\"h\")), io.ErrUnexpectedEOF},\n\t}\n\tfor i, tt := range tests {\n\t\terr := readCRLF(tt.reader)\n\t\tif err != tt.expectedErr {\n\t\t\tt.Errorf(\"Test %d: Expected %s, got %s this\", i+1, tt.expectedErr, err)\n\t\t}\n\t}\n}", "title": "" }, { "docid": "1f59afdeb97c37c595952bf1552c8c0a", "score": "0.44598964", "text": "func readDriftIgnoreLine(line string) []string {\n\tfor strings.Contains(line, \"**\") {\n\t\tline = strings.ReplaceAll(line, \"**\", \"*\")\n\t}\n\n\tvar splitted []string\n\tlastWordEnd := 0\n\tfor i := range line {\n\t\tif line[i] == '.' && ((i >= 1 && line[i-1] != '\\\\') || (i >= 2 && line[i-1] == '\\\\' && line[i-2] == '\\\\')) {\n\t\t\tsplitted = append(splitted, unescapeDriftIgnoreLine(line[lastWordEnd:i]))\n\t\t\tlastWordEnd = i + 1\n\t\t\tcontinue\n\t\t}\n\t\tif i == len(line)-1 {\n\t\t\tsplitted = append(splitted, unescapeDriftIgnoreLine(line[lastWordEnd:]))\n\t\t}\n\t}\n\treturn splitted\n}", "title": "" }, { "docid": "5ac2fda9e04894f636475ac147e57ae8", "score": "0.4424879", "text": "func Test_ignore_ignoreBlock(t *testing.T) {\n\ttype fields struct {\n\t\tfrom map[string]bool\n\t\tlines []int\n\t}\n\ttype args struct {\n\t\tnode *parser.Node\n\t\tfrom string\n\t}\n\ttests := []struct {\n\t\tname string\n\t\tfields fields\n\t\targs args\n\t\twant []int\n\t}{\n\t\t{\n\t\t\tname: \"ignore block: should add\",\n\t\t\tfields: fields{\n\t\t\t\tfrom: map[string]bool{\n\t\t\t\t\t\"testing_lines\": true,\n\t\t\t\t},\n\t\t\t\tlines: []int{1, 2, 3},\n\t\t\t},\n\t\t\targs: args{\n\t\t\t\tnode: &parser.Node{\n\t\t\t\t\tStartLine: 5,\n\t\t\t\t\tEndLine: 5,\n\t\t\t\t},\n\t\t\t\tfrom: \"testing_lines\",\n\t\t\t},\n\t\t\twant: []int{1, 2, 3, 5},\n\t\t},\n\t\t{\n\t\t\tname: \"ignore block: should not add\",\n\t\t\tfields: fields{\n\t\t\t\tfrom: map[string]bool{\n\t\t\t\t\t\"testing_lines\": true,\n\t\t\t\t},\n\t\t\t\tlines: []int{1, 2, 3},\n\t\t\t},\n\t\t\targs: args{\n\t\t\t\tnode: &parser.Node{\n\t\t\t\t\tStartLine: 5,\n\t\t\t\t\tEndLine: 5,\n\t\t\t\t},\n\t\t\t\tfrom: \"testing_not_lines\",\n\t\t\t},\n\t\t\twant: []int{1, 2, 3},\n\t\t},\n\t}\n\tfor _, tt := range tests {\n\t\tt.Run(tt.name, func(t *testing.T) {\n\t\t\ti := &ignore{\n\t\t\t\tfrom: tt.fields.from,\n\t\t\t\tlines: tt.fields.lines,\n\t\t\t}\n\t\t\ti.ignoreBlock(tt.args.node, tt.args.from)\n\t\t\tgot := i.getIgnoreLines()\n\t\t\trequire.Equal(t, tt.want, got)\n\t\t})\n\t}\n}", "title": "" }, { "docid": "b2e4a4a35da5252d1babea1c846d6374", "score": "0.44225177", "text": "func readFromGithub(username string) ([]byte, bool, error) {\n\tr, err := http.Get(\"https://api.github.com/users/\" + username)\n\tif err != nil {\n\t\treturn nil, false, fmt.Errorf(\"error retrieving github user %q: %v\", username, err)\n\t}\n\t// Save username in our negative cache if we get a 404.\n\tif r.StatusCode == http.StatusNotFound {\n\t\tif err = cachesave(negativeCacheFile(username), []byte{}); err != nil {\n\t\t\treturn nil, false, fmt.Errorf(\"negative cache write error for %q: %v\", username, err)\n\t\t}\n\t\treturn nil, false, nil\n\t}\n\n\tif r.StatusCode < 200 || r.StatusCode > 299 {\n\t\treturn nil, false, fmt.Errorf(\"github returned status %d (%s) for user %q\", r.StatusCode, r.Status, username)\n\t}\n\tjdata, err := ioutil.ReadAll(r.Body)\n\tif err != nil {\n\t\treturn nil, false, fmt.Errorf(\"error reading http body for user %q: %v\", username, err)\n\t}\n\treturn jdata, true, nil\n}", "title": "" }, { "docid": "bc4f3a1b47a434185401ed1981b8f034", "score": "0.44151518", "text": "func load(ignoreFile io.Reader) (*filter, error) {\n\tf := filter{}\n\n\tignoreScanner := bufio.NewScanner(ignoreFile)\n\tfor ignoreScanner.Scan() {\n\t\tnextPatternString := ignoreScanner.Text()\n\n\t\tnextPredicate, err := newRegexPredicate(nextPatternString)\n\t\tif err != nil {\n\t\t\treturn nil, err\n\t\t}\n\n\t\tf.addPredicate(nextPredicate)\n\t}\n\n\treturn &f, nil\n}", "title": "" }, { "docid": "8138bb7599aca3ce9f9a591e4b916d01", "score": "0.4380404", "text": "func repoStatusGitParse(lines [][]byte) (RepoStatus, error) {\n\tvar status RepoStatus\n\n\tfor _, line := range lines {\n\t\tif len(line) < 4 {\n\t\t\tcontinue\n\t\t}\n\n\t\tif line[0] == '#' && line[1] == '#' {\n\t\t\trepoStatusGitBranch(&status, line)\n\t\t\tcontinue\n\t\t}\n\n\t\tif line[0] == 'D' || line[1] == 'D' {\n\t\t\tstatus.Deleted++\n\t\t\tcontinue\n\t\t}\n\n\t\tif line[0] == 'M' || line[1] == 'M' {\n\t\t\tstatus.Modified++\n\t\t\tcontinue\n\t\t}\n\n\t\tif line[0] == 'A' || line[1] == '?' {\n\t\t\tstatus.Added++\n\t\t\tcontinue\n\t\t}\n\t}\n\n\treturn status, nil\n}", "title": "" }, { "docid": "1de70474cabe5571f857774652b18d0e", "score": "0.43751362", "text": "func ignore(src string) bool {\n\n\t// Skip our own config file.\n\tif filepath.Base(src) == \"dashing.json\" {\n\t\treturn true\n\t}\n\n\t// Skip VCS dirs.\n\tparts := strings.Split(src, \"/\")\n\tfor _, p := range parts {\n\t\tswitch p {\n\t\tcase \".git\", \".svn\":\n\t\t\treturn true\n\t\t}\n\t}\n\treturn false\n}", "title": "" }, { "docid": "6df8a87b0b49d92050a72688ecdb7165", "score": "0.43683505", "text": "func RegexpMatchReader(re *regexp.Regexp, r io.RuneReader) bool", "title": "" }, { "docid": "fb38c3eca191a393d86e777a3ea20f5d", "score": "0.4366754", "text": "func ReadRleFile(inputGrid string) map[gol.Cell]bool {\n\tvar rleLine bytes.Buffer\n\trleFile, err := os.Open(inputGrid)\n\tif err != nil {\n\t\tpanic(fmt.Sprintf(\"error opening file: %v\\n\", err))\n\t}\n\n\trleScanner := bufio.NewScanner(rleFile)\n\n\tfor rleScanner.Scan() {\n\t\tline := strings.TrimSpace(rleScanner.Text())\n\t\tif len(line) == 0 {\n\t\t\tcontinue\n\t\t}\n\n\t\tstart := line[0]\n\n\t\tif unicode.IsDigit(rune(start)) || start == 'b' || start == 'o' || start == '$' || start == '!' {\n\t\t\trleLine.WriteString(line)\n\t\t}\n\t}\n\n\tif err := rleScanner.Err(); err != nil {\n\t\tpanic(err)\n\t}\n\treturn parseRleLine(rleLine)\n}", "title": "" }, { "docid": "e7e320f0e5afea3db07c2b7b2a81e629", "score": "0.43558323", "text": "func (t *Templates) GetGitignore() ([]byte, error) {\n\treturn t.box.Find(\"create/.gitignore\")\n}", "title": "" }, { "docid": "e36691e4ed5b0057e0a49bf9652cbd09", "score": "0.43324122", "text": "func ApplyIgnore(ignores *[]string, sourcePath string) (err error) {\n\tif len(*ignores) == 0 {\n\t\trules, err := dfutil.GetIgnoreRulesFromDirectory(sourcePath)\n\t\tif err != nil {\n\t\t\treturn err\n\t\t}\n\t\t*ignores = append(*ignores, rules...)\n\t}\n\n\tindexFile := pkgUtil.GetIndexFileRelativeToContext()\n\t// check if the ignores flag has the index file\n\tif !dfutil.In(*ignores, indexFile) {\n\t\t*ignores = append(*ignores, indexFile)\n\t}\n\n\t// check if the ignores flag has the git dir\n\tif !dfutil.In(*ignores, gitDirName) {\n\t\t*ignores = append(*ignores, gitDirName)\n\t}\n\n\treturn nil\n}", "title": "" }, { "docid": "ab02b260e5c26cef81e1c50d72e90250", "score": "0.43287244", "text": "func (g *Git) MetadataRead(mdDir string) (string, error) {\n\treturn \"\", nil\n}", "title": "" }, { "docid": "962abb7992c1843254aaacc5db475a65", "score": "0.43275097", "text": "func isIgnoredLine(line string) bool {\n\tline = strings.TrimSpace(line)\n\treturn line == \"\" || strings.HasPrefix(line, \"#\")\n}", "title": "" }, { "docid": "7786d131e34ed5770da02a2a0bb324d6", "score": "0.43121347", "text": "func TestICLFileRead(t *testing.T) {\n\tfd, err := os.Open(filepath.Join(\"test\", \"testdata\", \"BNK20180905121042882-A.icl\"))\n\tif err != nil {\n\t\tt.Errorf(\"%T: %s\", err, err)\n\t}\n\tdefer fd.Close()\n\tr := NewReader(fd, ReadVariableLineLengthOption())\n\t_, err = r.Read()\n\n\tif err != nil {\n\t\tif p, ok := err.(*ParseError); ok {\n\t\t\tif e, ok := p.Err.(*BundleError); ok {\n\t\t\t\tif e.FieldName != \"entries\" {\n\t\t\t\t\tt.Errorf(\"%T: %s\", e, e)\n\t\t\t\t}\n\t\t\t}\n\t\t} else {\n\t\t\tt.Errorf(\"%T: %s\", err, err)\n\t\t}\n\t}\n\n\terr2 := r.File.Validate()\n\n\tif err2 != nil {\n\t\tif e, ok := err2.(*FileError); ok {\n\t\t\tif e.FieldName != \"BundleCount\" {\n\t\t\t\tt.Errorf(\"%T: %s\", e, e)\n\t\t\t}\n\t\t} else {\n\t\t\tt.Errorf(\"%T: %s\", err, err)\n\t\t}\n\t}\n}", "title": "" }, { "docid": "818575ffca6c916b3861f4b9c8064106", "score": "0.42999986", "text": "func (s *Shell) ReadMultiLines(terminator string) string {\n\treturn s.ReadMultiLinesFunc(func(line string) bool {\n\t\tif strings.HasSuffix(strings.TrimSpace(line), terminator) {\n\t\t\treturn false\n\t\t}\n\t\treturn true\n\t})\n}", "title": "" }, { "docid": "4b3e23ec955e2634e3e9fc8bd584b6ed", "score": "0.4292131", "text": "func readFromFile(path string) ([]GitHubIssue, error) {\n\tvar issues []GitHubIssue\n\tbytes, err := ioutil.ReadFile(path)\n\tif err != nil {\n\t\treturn issues, err\n\t}\n\terr = json.Unmarshal(bytes, &issues)\n\tif err != nil {\n\t\treturn issues, err\n\t}\n\treturn issues, nil\n}", "title": "" }, { "docid": "a00a5f039ae680e6a23a2801ec66afeb", "score": "0.42835355", "text": "func readFile(filePath string) ([]byte, error) {\n\tif strings.TrimSpace(filePath) == \"-\" {\n\t\treturn ioutil.ReadAll(os.Stdin)\n\t}\n\n\treturn ioutil.ReadFile(filePath)\n\n}", "title": "" }, { "docid": "9b0e82b29301115c044d8cf9904948d0", "score": "0.42806205", "text": "func FromReader(r io.Reader, repoRoot string) (*Codeowners, error) {\n\tco := &Codeowners{\n\t\trepoRoot: repoRoot,\n\t}\n\tco.Patterns = parseCodeowners(r)\n\treturn co, nil\n}", "title": "" }, { "docid": "e9746c548ea67b85c1d6d586101e0094", "score": "0.42661917", "text": "func ReadMultilines(filename string) []geom.Line {\n\tcontent, err := ioutil.ReadFile(filename)\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\treturn ParseMultilines(content)\n}", "title": "" }, { "docid": "fca044fc00af24360e0c00a8eb91b998", "score": "0.4255957", "text": "func SkipLines(skip int, in string) (string, error) {\n\tif skip < 0 {\n\t\treturn \"\", fmt.Errorf(\"skip must be >= 0\")\n\t}\n\tif skip == 0 {\n\t\treturn in, nil\n\t}\n\n\tlines := strings.SplitN(in, \"\\n\", skip+1)\n\tif skip >= len(lines) {\n\t\treturn \"\", nil\n\t}\n\n\treturn lines[skip], nil\n}", "title": "" }, { "docid": "79c0becd1d18142f09d6c6a109a4cde6", "score": "0.42502338", "text": "func (rm *ReadManager) Read(b []byte) (int, error) {\nstart:\n\tif !rm.stream && rm.readLimit > 0 && rm.readLines == rm.readLimit {\n\t\treturn 0, io.EOF\n\t}\n\n\tif len(rm.lines) == 0 {\n\t\tctx, cancel := context.WithTimeout(context.Background(), time.Second*3)\n\t\tdefer cancel()\n\n\t\tlines, delta, err := rm.read(ctx, rm.offset, chunkSize, nil)\n\t\tif err != nil {\n\t\t\treturn 0, err\n\t\t}\n\n\t\tif len(lines) > 0 {\n\t\t\tlinesLen := 0\n\t\t\tfor _, line := range lines {\n\t\t\t\trm.Prepend(line)\n\t\t\t\tlinesLen += len(line.Message) + 1\n\t\t\t}\n\n\t\t\tif linesLen < chunkSize {\n\t\t\t\trm.offset = rm.offset + linesLen - 1\n\t\t\t} else {\n\t\t\t\trm.offset = (rm.offset + chunkSize) - delta - 1\n\t\t\t}\n\t\t}\n\t}\n\n\tline := rm.Pop()\n\tif line == nil {\n\t\treturn 0, ErrNoData\n\t}\n\n\tif rm.skip > 0 && rm.skipped < rm.skip {\n\t\trm.skipped++\n\t\tgoto start\n\t}\n\n\trm.readLines++\n\treturn strings.NewReader(rm.formatFn(*line, rm)).Read(b)\n}", "title": "" }, { "docid": "0f4a20ca00826addf4a015fad28a336e", "score": "0.42483014", "text": "func ReadBranch(lineChan chan string, branch *Branch, writer *bufio.Writer) {\n\tenterBranch := false\n\temptyLine := 0\n\tfor s := range lineChan {\n\t\tif s != \"\" {\n\t\t\tenterBranch = true\n\t\t\tchanges := changeRegex.FindAllStringSubmatch(s, -1)\n\t\t\tif changes != nil {\n\t\t\t\twriter.WriteString(fmt.Sprintf(\"%v\\t%v\\t%v\\t%v\\t%v\\t%v\\n\", branch.Origin, branch.Target, changes[0][1], changes[0][2], changes[0][3], changes[0][4]))\n\t\t\t\tbranch.Changes = append(branch.Changes, changes[0][1:])\n\t\t\t}\n\t\t} else if s == \"\" {\n\t\t\temptyLine ++\n\t\t\tif enterBranch {\n\t\t\t\tbreak\n\t\t\t}\n\t\t\tif emptyLine == 3 {\n\t\t\t\tbreak\n\t\t\t}\n\t\t}\n\t}\n\n}", "title": "" }, { "docid": "c72e69c3f30da8970ecbc6375bbf0d5d", "score": "0.42466247", "text": "func (it *Assertions) ReaderNotContains(reader io.Reader, contains interface{}, formatAndArgs ...interface{}) bool {\n\treturn ReaderNotContains(it.t, reader, contains, formatAndArgs...)\n}", "title": "" }, { "docid": "25c4e77fe91228532d289baa67ef4ab0", "score": "0.42160612", "text": "func ReadConfigFile(path string) ([]byte, bool, error) {\n\tdata, err := ioutil.ReadFile(path)\n\tif err != nil {\n\t\treturn nil, false, err\n\t}\n\n\tif bytes.HasPrefix(data, []byte(\"Salted__\")) {\n\t\treturn data, true, nil // encrypted\n\t}\n\n\treturn data, false, nil\n}", "title": "" }, { "docid": "e276b52c8d6c823b8d82ac20e6da9bdc", "score": "0.4215561", "text": "func CheckReadMe(zxRoot, bsslRoot string) bool {\n cmd := exec.Command(\"git\", \"log\", \"-n1\", \"--pretty=%H\")\n cmd.Dir = bsslRoot\n out, err := cmd.Output()\n if err != nil {\n log.Fatal(err)\n }\n file, err := os.Open(zxRoot + string(os.PathSeparator) + \"README.fuchsia.md\")\n if err != nil {\n log.Fatal(err)\n }\n scanner := bufio.NewScanner(file)\n for scanner.Scan() {\n if strings.Contains(scanner.Text(), strings.TrimSpace(string(out))) {\n return true\n }\n }\n if err := scanner.Err(); err != nil {\n log.Fatal(err)\n }\n return false\n}", "title": "" }, { "docid": "ec17fab670ba186d48baa69c0bbf67e4", "score": "0.42017376", "text": "func shouldSkip(f string) bool {\n\tfor _, skip := range skipFiles {\n\t\tif strings.HasSuffix(f, skip) {\n\t\t\treturn true\n\t\t}\n\t}\n\n\tign, ig := ignorer.(*ignore.GitIgnore)\n\n\tif ig && ign != nil {\n\t\treturn ignorer.MatchesPath(strings.Replace(f, folder, \"\", 1))\n\t}\n\n\treturn false\n}", "title": "" }, { "docid": "1f459abc845f2ade3f83f6fc5fd8b361", "score": "0.41945007", "text": "func ReadImports(proj *report.Project, filePath string) error {\n\tfile, err := os.Open(filePath)\n\tif err != nil {\n\t\tmsg := fmt.Errorf(\"Something went wrong opening the file %s\", filePath)\n\t\tlog.Printf(msg.Error())\n\t\treturn err\n\t}\n\tdefer file.Close()\n\tscanner := bufio.NewScanner(file)\n\n\tfor scanner.Scan() {\n\t\tlineText := scanner.Text()\n\t\tswitch {\n\t\tcase modLine.MatchString(lineText):\n\t\t\tlineText = strings.TrimSpace(lineText)\n\t\t\tmatch := modLine.FindStringSubmatch(lineText)\n\t\t\tmatchResult := make(map[string]string)\n\t\t\tfor i, name := range modLine.SubexpNames() {\n\t\t\t\tif i != 0 && name != \"\" {\n\t\t\t\t\tmatchResult[name] = match[i]\n\t\t\t\t}\n\t\t\t}\n\t\t\tproj.Name = matchResult[\"package\"]\n\t\tcase modInlineRequire.MatchString(lineText):\n\t\t\tlineText = strings.TrimSpace(lineText)\n\t\t\tmatch := modInlineRequire.FindStringSubmatch(lineText)\n\t\t\tmatchResult := make(map[string]string)\n\t\t\tfor i, name := range modInlineRequire.SubexpNames() {\n\t\t\t\tif i != 0 && name != \"\" {\n\t\t\t\t\tmatchResult[name] = match[i]\n\t\t\t\t}\n\t\t\t}\n\t\t\tproj.InsertImport(matchResult[\"import\"], matchResult[\"version\"], \"\", \"\", (matchResult[\"indirect\"] == \"\"))\n\t\tcase modRequire.MatchString(lineText):\n\t\t\tfor scanner.Scan() {\n\t\t\t\tlineText = scanner.Text()\n\t\t\t\tswitch {\n\t\t\t\tcase requireLine.MatchString(lineText):\n\t\t\t\t\tlineText = strings.TrimSpace(lineText)\n\t\t\t\t\tmatch := requireLine.FindStringSubmatch(lineText)\n\t\t\t\t\tmatchResult := make(map[string]string)\n\t\t\t\t\tfor i, name := range requireLine.SubexpNames() {\n\t\t\t\t\t\tif i != 0 && name != \"\" {\n\t\t\t\t\t\t\tmatchResult[name] = match[i]\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\tproj.InsertImport(matchResult[\"import\"], matchResult[\"version\"], \"\", \"\", (matchResult[\"indirect\"] == \"\"))\n\t\t\t\tcase closingBracket.MatchString(lineText):\n\t\t\t\t\tbreak\n\t\t\t\t}\n\t\t\t}\n\t\tdefault:\n\t\t\tcontinue\n\t\t}\n\t}\n\treturn nil\n}", "title": "" }, { "docid": "e730654993a8779b804862a283f874ba", "score": "0.41904223", "text": "func (g *Git) ReadFile(path string) ([]byte, error) {\n\tf, err := g.fs.Open(path)\n\tif err != nil {\n\t\treturn nil, errors.Wrapf(err, \"unable to open a file %s\", path)\n\t}\n\n\tbody, err := ioutil.ReadAll(f)\n\tif err != nil {\n\t\treturn nil, errors.Wrapf(err, \"unable to read a file %s\", path)\n\t}\n\n\treturn body, nil\n}", "title": "" }, { "docid": "54b746de2abd40afa064abd94a55af80", "score": "0.41881797", "text": "func readLines(path string) (lines []string, err error) {\n var (\n file *os.File\n part []byte\n prefix bool\n )\n if file, err = os.Open(path); err != nil {\n return\n }\n defer file.Close()\n\n reader := bufio.NewReader(file)\n buffer := bytes.NewBuffer(make([]byte, 0))\n for {\n if part, prefix, err = reader.ReadLine(); err != nil {\n break\n }\n buffer.Write(part)\n if !prefix {\n lines = append(lines, buffer.String())\n buffer.Reset()\n }\n }\n if err == io.EOF {\n err = nil\n }\n return\n}", "title": "" }, { "docid": "29dd548eaf042580d9adb9497889d54f", "score": "0.41827658", "text": "func ReadLines(filename string) ([]string, error) {\n\treturn ReadLinesOffsetN(filename, 0, -1)\n}", "title": "" }, { "docid": "29dd548eaf042580d9adb9497889d54f", "score": "0.41827658", "text": "func ReadLines(filename string) ([]string, error) {\n\treturn ReadLinesOffsetN(filename, 0, -1)\n}", "title": "" }, { "docid": "29dd548eaf042580d9adb9497889d54f", "score": "0.41827658", "text": "func ReadLines(filename string) ([]string, error) {\n\treturn ReadLinesOffsetN(filename, 0, -1)\n}", "title": "" }, { "docid": "f4458f1822357622f7bf5fa7417baddb", "score": "0.41761273", "text": "func isGitRepo(dir string) bool {\n\tfiles, err := ioutil.ReadDir(dir)\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\n\tfor _, file := range files {\n\t\tif isDotGitDir(file) {\n\t\t\treturn true\n\t\t}\n\t}\n\n\treturn false\n}", "title": "" }, { "docid": "de82ccd0164b7a311f34e2e77b5d2834", "score": "0.41728547", "text": "func ReadLinesOffsetN(filename string, offset uint, n int) (ret []string, err error) {\n\tf, err := os.Open(filename)\n\tif err != nil {\n\t\treturn []string{\"\"}, err\n\t}\n\tdefer f.Close()\n\n\tvar line string\n\tr := bufio.NewReader(f)\n\tfor i := 0; i < n+int(offset) || n < 0; i++ {\n\t\tline, err = r.ReadString('\\n')\n\t\t// on EOF we also break, but we should have results\n\t\t// on other errors, we should not have any result which we check on the \"client\"\n\t\tif err != nil {\n\t\t\tbreak\n\t\t}\n\t\tif i < int(offset) {\n\t\t\tcontinue\n\t\t}\n\t\tret = append(ret, strings.Trim(line, \"\\n\"))\n\t}\n\n\treturn ret, err\n}", "title": "" }, { "docid": "9ff4f8a129fc0c6194b4fc2b0fb5960b", "score": "0.4169367", "text": "func readLines(path string) (lines []string, err os.Error) {\n var (\n file *os.File\n part []byte\n prefix bool\n )\n if file, err = os.Open(path); err != nil {\n return\n }\n reader := bufio.NewReader(file)\n buffer := bytes.NewBuffer(make([]byte, 1024))\n for {\n if part, prefix, err = reader.ReadLine(); err != nil {\n break\n }\n buffer.Write(part)\n if !prefix {\n lines = append(lines, buffer.String())\n buffer.Reset()\n }\n }\n if err == os.EOF {\n err = nil\n }\n return\n}", "title": "" }, { "docid": "0f1a9e53e68d535fccafdd50e2729e89", "score": "0.4158053", "text": "func ReadCheckEOF(reader *bufio.Reader, delim byte, handler EOFHandler) (string, error) {\n\tread, err := reader.ReadString(delim)\n\tif err != nil {\n\t\tif err == io.EOF {\n\t\t\thandler.Handle()\n\t\t\treturn \"\", nil\n\t\t}\n\t\treturn \"\", err\n\t}\n\treturn read, nil\n}", "title": "" }, { "docid": "63e5b2e614478c243be40dfa46fbcccb", "score": "0.41572976", "text": "func MatchContentIgnoreCarriageReturn(path Path) error {\n\tif m, ok := path.(*filePath); ok {\n\t\tm.file.ignoreCariageReturn = true\n\t}\n\treturn nil\n}", "title": "" }, { "docid": "23f98dfd10c4226c26cba3b5c7e03e1d", "score": "0.41458324", "text": "func (obj *testReader) Read(p []byte) (n int, err error) {\n\tif len(*obj) > 0 {\n\t\t// get first string and add \\n for splitting by Scanner\n\t\tretStr := (*obj)[0] + \"\\n\"\n\t\t// copy string into buffer\n\t\tretStrLen := copy(p[:], retStr)\n\t\t// remove first string from the list\n\t\t*obj = (*obj)[1:]\n\t\treturn retStrLen, nil\n\t} else {\n\t\t// if the list of strings is empty then return end of file\n\t\treturn 0, io.EOF\n\t}\n}", "title": "" }, { "docid": "0611e2ab8fc94ce14b70f43d82c14d72", "score": "0.41408068", "text": "func ReadLinesOffsetN(filename string, offset uint, n int) ([]string, error) {\n\tf, err := os.Open(filename)\n\tif err != nil {\n\t\treturn []string{\"\"}, err\n\t}\n\tdefer f.Close()\n\n\tvar ret []string\n\n\tr := bufio.NewReader(f)\n\tfor i := 0; i < n+int(offset) || n < 0; i++ {\n\t\tline, err := r.ReadString('\\n')\n\t\tif err != nil {\n\t\t\tbreak\n\t\t}\n\t\tif i < int(offset) {\n\t\t\tcontinue\n\t\t}\n\t\tret = append(ret, strings.Trim(line, \"\\n\"))\n\t}\n\n\treturn ret, nil\n}", "title": "" }, { "docid": "0611e2ab8fc94ce14b70f43d82c14d72", "score": "0.41408068", "text": "func ReadLinesOffsetN(filename string, offset uint, n int) ([]string, error) {\n\tf, err := os.Open(filename)\n\tif err != nil {\n\t\treturn []string{\"\"}, err\n\t}\n\tdefer f.Close()\n\n\tvar ret []string\n\n\tr := bufio.NewReader(f)\n\tfor i := 0; i < n+int(offset) || n < 0; i++ {\n\t\tline, err := r.ReadString('\\n')\n\t\tif err != nil {\n\t\t\tbreak\n\t\t}\n\t\tif i < int(offset) {\n\t\t\tcontinue\n\t\t}\n\t\tret = append(ret, strings.Trim(line, \"\\n\"))\n\t}\n\n\treturn ret, nil\n}", "title": "" }, { "docid": "b281318bc86ae073ef2b13f3bb80ca20", "score": "0.41379192", "text": "func Scan() bool {\n\tif !initialized {\n\t\targs := os.Args\n\t\tif len(args) >= 1 {\n\t\t\targs = args[1:] // Shift off the program name\n\t\t}\n\t\tInit(args)\n\t}\n\tif reader == nil {\n\t\tif readStdin {\n\t\t\treturn false\n\t\t}\n\t\tif len(fileArgs) == 0 {\n\t\t\treturn false\n\t\t}\n\t\tvar err error\n\t\tfile, err = os.Open(fileArgs[0])\n\t\tif err != nil {\n\t\t\tcurError = err\n\t\t\treturn false\n\t\t}\n\t\tfileArgs = fileArgs[1:]\n\t\treader = bufio.NewReader(file)\n\t}\n\tvar err error\n\tline, err = reader.ReadBytes('\\n')\n\tswitch err {\n\tcase io.EOF:\n\t\tif len(line) == 0 {\n\t\t\tif file != nil {\n\t\t\t\tfile.Close()\n\t\t\t}\n\t\t\treader = nil\n\t\t\treturn Scan()\n\t\t}\n\t\t// line does not end with \\n\n\tcase nil:\n\t\t// line ends with \\n\n\t\tline = line[:len(line)-1]\n\tdefault:\n\t\tcurError = err\n\t\treturn false\n\t}\n\treturn true\n}", "title": "" }, { "docid": "3494cda6f0ce3ce6eaf853fe5f494f45", "score": "0.41328785", "text": "func ReadLinesOffsetN(filename string, offset uint, n int) ([]string, error) {\n\n f, err := os.Open(filename)\n if err != nil {\n return []string{\"\"}, err\n }\n defer f.Close()\n\n var ret []string\n\n r := bufio.NewReader(f)\n for i := 0; i < n+int(offset) || n < 0; i++ {\n line, err := r.ReadString('\\n')\n if err != nil {\n break\n }\n if i < int(offset) {\n continue\n }\n ret = append(ret, strings.Trim(line, \"\\n\"))\n }\n\n return ret, nil\n\n}", "title": "" }, { "docid": "3494cda6f0ce3ce6eaf853fe5f494f45", "score": "0.41328785", "text": "func ReadLinesOffsetN(filename string, offset uint, n int) ([]string, error) {\n\n f, err := os.Open(filename)\n if err != nil {\n return []string{\"\"}, err\n }\n defer f.Close()\n\n var ret []string\n\n r := bufio.NewReader(f)\n for i := 0; i < n+int(offset) || n < 0; i++ {\n line, err := r.ReadString('\\n')\n if err != nil {\n break\n }\n if i < int(offset) {\n continue\n }\n ret = append(ret, strings.Trim(line, \"\\n\"))\n }\n\n return ret, nil\n\n}", "title": "" }, { "docid": "b06246d38460d5da428204ce5a95fdd3", "score": "0.4130527", "text": "func ReadLines(fn string) []string {\n\tvar final []string\n\tif hasFile, _ := PathExists(fn); !hasFile {\n\t\tlog.Fatalf(\"%s not existed.\", fn)\n\t}\n\tf, err := os.Open(fn)\n\tif err != nil {\n\t\tlog.Fatal(err)\n\t}\n\tbuf := bufio.NewReader(f)\n\tfor {\n\t\tb, errR := buf.ReadBytes('\\n')\n\t\tif errR != nil {\n\t\t\tif errR == io.EOF {\n\t\t\t\tbreak\n\t\t\t}\n\t\t\tlog.Fatal(errR.Error())\n\t\t}\n\t\tfinal = append(final, strings.ReplaceAll(string(b), \"\\n\", \"\"))\n\t}\n\treturn final\n}", "title": "" }, { "docid": "68b35951c2290f567dd34572750fc793", "score": "0.41120094", "text": "func BenchmarkTag_readLine(b *testing.B) {\n\ta := assert.New(b)\n\tt := &tag{data: []rune(\"line1\\n @delimiter line2 \\n\")}\n\ta.NotNil(t)\n\n\tfor i := 0; i < b.N; i++ {\n\t\t_ = t.readLine()\n\t\tt.pos = 0\n\t}\n}", "title": "" }, { "docid": "55e6c550a10a887bafe3dd6950c5c92f", "score": "0.40989515", "text": "func (b *Builder) getIgnored() []string {\n\tignoreFilename := \".buildignore\"\n\t// retrieve the ignore file\n\tignoreFileBytes, err := ioutil.ReadFile(filepath.Join(b.loadFrom, \".buildignore\"))\n\tif err != nil {\n\t\t// assume no ignore file exists, do nothing\n\t\treturn []string{}\n\t}\n\t// get the lines in the ignore file\n\tlines := strings.Split(string(ignoreFileBytes), \"\\n\")\n\t// adds the .ignore file\n\tlines = append(lines, ignoreFilename)\n\t// turns relative paths into absolute paths\n\tvar output []string\n\tfor _, line := range lines {\n\t\tif !filepath.IsAbs(line) {\n\t\t\tline, err = filepath.Abs(line)\n\t\t\tif err != nil {\n\t\t\t\tcore.RaiseErr(\"cannot convert relation path to absolute path: %s\", err)\n\t\t\t}\n\t\t}\n\t\toutput = append(output, line)\n\t}\n\treturn output\n}", "title": "" }, { "docid": "8f37a1b6c068611ade36c71ff3259607", "score": "0.4097915", "text": "func ReadNotebook(path string, loadResources bool) (*Notebook, error) {\n\t_, err := IsNotebook(path)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\t// list the files in the notebook (aka. the notes)\n\tfiles, err := ioutil.ReadDir(path)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\tvar metadata *NotebookMetadata\n\tvar numNotes = 0\n\tif len(files) > 1 {\n\t\tnumNotes = len(files) - 1\n\t}\n\tnotes := make([]*Note, numNotes)\n\tfor i, f := range files {\n\t\tp := filepath.Join(path, f.Name())\n\t\tif f.Name() == \"meta.json\" {\n\t\t\tmetadata, err = ReadNotebookMetadata(p)\n\t\t\tif err != nil {\n\t\t\t\treturn nil, err\n\t\t\t}\n\t\t} else {\n\t\t\tn, err := ReadNote(p, loadResources)\n\t\t\tif err != nil {\n\t\t\t\treturn nil, err\n\t\t\t}\n\t\t\tnotes[i] = n\n\t\t}\n\t}\n\n\treturn &Notebook{metadata, notes}, nil\n}", "title": "" }, { "docid": "4c4523ac49e689b9a21da5d1ffa1a401", "score": "0.4084629", "text": "func MustReadLines(filename string) []string {\n\tr, err := ReadLines(filename)\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\treturn r\n}", "title": "" }, { "docid": "4c4523ac49e689b9a21da5d1ffa1a401", "score": "0.4084629", "text": "func MustReadLines(filename string) []string {\n\tr, err := ReadLines(filename)\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\treturn r\n}", "title": "" }, { "docid": "68d63f19db1af8cc3d74ab084a03ef3b", "score": "0.4083748", "text": "func ReadLines(fullpath string) ([]string, error) {\n\tf, err := os.Open(fullpath)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\tdefer f.Close()\n\n\tvar lines []string\n\tscanner := bufio.NewScanner(f)\n\tfor scanner.Scan() {\n\t\tlines = append(lines, scanner.Text())\n\t}\n\treturn lines, scanner.Err()\n}", "title": "" }, { "docid": "5f8980c2c4e786ac61f82ba4c01dcb2c", "score": "0.40830296", "text": "func readLine(br *bufio.Reader) ([]byte, error) {\n\tvar line []byte\n\tfor {\n\t\tbts, err := br.ReadSlice('\\n')\n\t\tif err == bufio.ErrBufferFull {\n\t\t\t// Copy bytes because next read will discard them.\n\t\t\tline = append(line, bts...)\n\t\t\tcontinue\n\t\t}\n\n\t\t// Avoid copy of single read.\n\t\tif line == nil {\n\t\t\tline = bts\n\t\t} else {\n\t\t\tline = append(line, bts...)\n\t\t}\n\n\t\tif err != nil {\n\t\t\treturn line, err\n\t\t}\n\n\t\t// Size of line is at least 1.\n\t\t// In other case bufio.ReadSlice() returns error.\n\t\tn := len(line)\n\n\t\t// Cut '\\n' or '\\r\\n'.\n\t\tif n > 1 && line[n-2] == '\\r' {\n\t\t\tline = line[:n-2]\n\t\t} else {\n\t\t\tline = line[:n-1]\n\t\t}\n\n\t\treturn line, nil\n\t}\n}", "title": "" }, { "docid": "d08766d52c5ee3bcd90b4145c888a594", "score": "0.40810597", "text": "func ReadLines(path string) ([]string, int, error) {\n\tfile, err := os.Open(path)\n\tif err != nil {\n\t\treturn nil, 0, err\n\t}\n\tdefer file.Close()\n\n\tvar lines []string\n\tlineCount := 0\n\tscanner := bufio.NewScanner(file)\n\tfor scanner.Scan() {\n\t\tlines = append(lines, scanner.Text())\n\t\tlineCount++\n\t}\n\n\tif scanner.Err() == bufio.ErrTooLong {\n\t\tpanic(scanner.Err())\n\t}\n\treturn lines, lineCount, scanner.Err()\n}", "title": "" }, { "docid": "07a24a9f2af15de558e3d87976b22a84", "score": "0.40787724", "text": "func ReadLines(filePath string) ([]string, error) {\n\tfile, err := os.OpenFile(filePath, os.O_RDONLY, 0755)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\tdefer file.Close()\n\tscanner := bufio.NewScanner(file)\n\tres := make([]string, 0)\n\tfor scanner.Scan() {\n\t\tline := scanner.Text()\n\t\tres = append(res, line)\n\t}\n\tif err = scanner.Err(); err != nil {\n\t\treturn nil, err\n\t}\n\treturn res, nil\n}", "title": "" }, { "docid": "99bd2645d070ca773350c14095dcf3c3", "score": "0.40760937", "text": "func (r *readerWrap) Read(p []byte) (int, error) {\n\tr.mu.Lock()\n\tdefer r.mu.Unlock()\n\n\tn, err := r.source.Read(p)\n\tr.err = err\n\n\tif r.err != nil {\n\t\treturn n, r.err\n\t}\n\n\tq := p[:n]\n\t// todo(ysiato, schandra, pknudsgaard) this looks like another intentional no-error-check like digest.go:407\n\tr.digestWriter.Write(q)\n\n\treturn n, r.err\n}", "title": "" }, { "docid": "63d9d70a3a2642d98c4d185aeb2c40f0", "score": "0.4074076", "text": "func BuildIgnoreFilter(srcPath string) (FileFilter, error) {\n\tignoreFiles := []string{\n\t\t\".kfignore\",\n\t\t\".cfignore\",\n\t}\n\n\tvar defaultIgnoreLines = []string{\n\t\t\".cfignore\",\n\t\t\".kfignore\",\n\t\t\"/manifest.yml\",\n\t\t\".gitignore\",\n\t\t\".git\",\n\t\t\".hg\",\n\t\t\".svn\",\n\t\t\"_darcs\",\n\t\t\".DS_Store\",\n\t}\n\n\tvar (\n\t\tgitignore *ignore.GitIgnore\n\t\terr error\n\t)\n\tfor _, ignoreFile := range ignoreFiles {\n\t\tgitignore, err = ignore.CompileIgnoreFileAndLines(\n\t\t\tfilepath.Join(srcPath, ignoreFile),\n\t\t\tdefaultIgnoreLines...,\n\t\t)\n\t\tif err != nil {\n\t\t\t// Just move on.\n\t\t\tcontinue\n\t\t}\n\n\t\tbreak\n\t}\n\n\tif gitignore == nil {\n\t\tgitignore, err = ignore.CompileIgnoreLines(defaultIgnoreLines...)\n\t\tif err != nil {\n\t\t\treturn nil, err\n\t\t}\n\t}\n\n\treturn func(path string) bool {\n\t\treturn !gitignore.MatchesPath(path)\n\t}, nil\n}", "title": "" }, { "docid": "1ecdf57c536f053b729f85f119903eef", "score": "0.4071663", "text": "func ReadFilesFromGitWithChanges(repo, commitSHA1 string, changes []git.Change, phpExtensions []string) ReadCallback {\n\tchangedMap := make(map[string][]git.LineRange, len(changes))\n\tfor _, ch := range changes {\n\t\tif ch.Type == git.Deleted {\n\t\t\t// TODO: actually support deletes too\n\t\t\tcontinue\n\t\t}\n\n\t\tchangedMap[ch.NewName] = append(changedMap[ch.NewName], ch.LineRanges...)\n\t}\n\n\tcatter, err := git.NewCatter(repo)\n\tif err != nil {\n\t\tlog.Fatalf(\"Could not start catter: %s\", err.Error())\n\t}\n\n\ttree, err := git.GetTreeSHA1(catter, commitSHA1)\n\tif err != nil {\n\t\tlog.Fatalf(\"Could not get tree sha1: %s\", err.Error())\n\t}\n\n\tsuffixes := makePHPExtensionSuffixes(phpExtensions)\n\n\treturn func(ch chan FileInfo) {\n\t\terr = catter.Walk(\n\t\t\t\"\",\n\t\t\ttree,\n\t\t\tfunc(filename []byte) bool {\n\t\t\t\tif !isPHPExtensionBytes(filename, suffixes) {\n\t\t\t\t\treturn false\n\t\t\t\t}\n\n\t\t\t\t_, ok := changedMap[string(filename)]\n\t\t\t\treturn ok\n\t\t\t},\n\t\t\tfunc(filename string, contents []byte) {\n\t\t\t\tch <- FileInfo{\n\t\t\t\t\tName: filename,\n\t\t\t\t\tContents: contents,\n\t\t\t\t\tLineRanges: changedMap[filename],\n\t\t\t\t}\n\t\t\t},\n\t\t)\n\n\t\tif err != nil {\n\t\t\tlog.Fatalf(\"Could not walk: %s\", err.Error())\n\t\t}\n\t}\n}", "title": "" }, { "docid": "1e0d8599e79faae5a1a0274a34363aaf", "score": "0.406016", "text": "func ReadN(r io.Reader, n int64) ([]byte, bool, error) {\n\tb, err := ioutil.ReadAll(io.LimitReader(r, n+1))\n\tif err != nil {\n\t\treturn nil, false, err\n\t}\n\tif int64(len(b)) > n {\n\t\treturn b[:n], true, nil\n\t}\n\treturn b, false, nil\n}", "title": "" }, { "docid": "ae753edbb1912b788c2af819a38bcafb", "score": "0.40530574", "text": "func readLine(path string) {\n\tinFile, ok := os.Open(path)\n\tif ok != nil {\n\t\tpanic(fmt.Sprintf(\"open failed: %s\", ok))\n\t}\n\tdefer inFile.Close()\n\tscanner := bufio.NewScanner(inFile)\n\t//scanner.Split(bufio.ScanLines) // This is not needed. ScanLine is the default split function\n\n\tfor scanner.Scan() {\n\t\tfmt.Println(scanner.Text()) // The newline isn't part of the returned Text\n\t}\n}", "title": "" }, { "docid": "1baf67d246855334476b02a77cccc86b", "score": "0.40487275", "text": "func Test_ignore_setIgnore(t *testing.T) {\n\ttype fields struct {\n\t\tfrom map[string]bool\n\t\tlines []int\n\t}\n\ttype args struct {\n\t\tfrom string\n\t}\n\ttests := []struct {\n\t\tname string\n\t\tfields fields\n\t\targs args\n\t}{\n\t\t{\n\t\t\tname: \"set ignore\",\n\t\t\tfields: fields{\n\t\t\t\tfrom: make(map[string]bool),\n\t\t\t\tlines: make([]int, 0),\n\t\t\t},\n\t\t\targs: args{\n\t\t\t\tfrom: \"testing_lines\",\n\t\t\t},\n\t\t},\n\t}\n\tfor _, tt := range tests {\n\t\tt.Run(tt.name, func(t *testing.T) {\n\t\t\ti := &ignore{\n\t\t\t\tfrom: tt.fields.from,\n\t\t\t\tlines: tt.fields.lines,\n\t\t\t}\n\t\t\ti.setIgnore(tt.args.from)\n\t\t\t_, ok := i.from[tt.args.from]\n\t\t\trequire.True(t, ok)\n\t\t})\n\t}\n}", "title": "" }, { "docid": "eebaf022d02a9d7c46c278a88df3a653", "score": "0.4044517", "text": "func readLine(r *bufio.Reader) ([]byte, error) {\n\tline_, err := r.ReadBytes('\\n')\n\tif err == io.EOF {\n\t\tif len(line_) == 0 {\n\t\t\treturn nil, io.EOF\n\t\t}\n\n\t\t// ReadBytes returned io.EOF, because it didn't find another newline, but there is\n\t\t// still the remainder of the file to return as a line.\n\t\tline := line_\n\t\treturn line, nil\n\t} else if err != nil {\n\t\treturn nil, err\n\t}\n\tline := line_[0 : len(line_)-1]\n\treturn dropCR(line), nil\n}", "title": "" }, { "docid": "5161233b65d85e47c3c6307eb5f86571", "score": "0.40435693", "text": "func (lo *LooseObject) Reader() (io.ReadCloser, error) {\n\tr, err := lo.open()\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\terr = lo.readHeader(r.(RuneReader))\n\tif err != nil {\n\t\tr.Close()\n\t\treturn nil, err\n\t}\n\n\tr, err = wrapHashVerifier(lo, r)\n\tif err != nil {\n\t\t_ = r.Close() // swallow close error\n\t\treturn nil, err\n\t}\n\treturn r, nil\n}", "title": "" }, { "docid": "3523990ea26cf435709958718da2526b", "score": "0.40361115", "text": "func ReadLines(path string) (lines []string, err error) {\n\tvar (\n\t\tfile *os.File\n\t\tpart []byte\n\t\tprefix bool\n\t)\n\n\tif file, err = os.Open(path); err != nil {\n\t\treturn\n\t}\n\n\treader := bufio.NewReader(file)\n\tbuffer := bytes.NewBuffer(make([]byte, 1024))\n\n\tfor {\n\t\tif part, prefix, err = reader.ReadLine(); err != nil {\n\t\t\tbreak\n\t\t}\n\t\tbuffer.Write(part)\n\t\tif !prefix {\n\t\t\tlines = append(lines, buffer.String())\n\t\t\tbuffer.Reset()\n\t\t}\n\t}\n\tif err == io.EOF {\n\t\terr = nil\n\t}\n\treturn\n}", "title": "" }, { "docid": "b792060af9c4caacfec80793873c7e58", "score": "0.40314254", "text": "func ReadHistory(filename string) (bool, error) {\n\tvar cfilename *C.char\n\tif len(filename) != 0 {\n\t\tcfilename = C.CString(filename)\n\t}\n\terr := C.read_history(cfilename)\n\tif cfilename != nil {\n\t\tC.free(unsafe.Pointer(cfilename))\n\t}\n\tif err != 0 {\n\t\te := syscall.Errno(err)\n\t\tif e == syscall.ENOENT { // ignored when the file doesn't exist.\n\t\t\treturn false, nil\n\t\t}\n\t\treturn false, e\n\t}\n\treturn true, nil\n}", "title": "" }, { "docid": "59c6df38f13184b7c5e2e292e0d0a1ae", "score": "0.40312788", "text": "func worklogReader(r io.ReadCloser) (io.ReadCloser, error) {\n\tif s, ok := r.(interface{ Stat() (os.FileInfo, error) }); ok {\n\t\tif info, err := s.Stat(); err == nil {\n\t\t\tif isPipe := (info.Mode() & os.ModeCharDevice) == 0; isPipe {\n\t\t\t\treturn r, nil\n\t\t\t}\n\t\t}\n\t}\n\tpathOrURL := worklogPath()\n\tif strings.HasPrefix(pathOrURL, \"http://\") || strings.HasPrefix(pathOrURL, \"https://\") {\n\t\tresp, err := http.Get(pathOrURL)\n\t\tif err != nil {\n\t\t\treturn nil, err\n\t\t}\n\t\treturn resp.Body, nil\n\t} else {\n\t\treturn os.Open(pathOrURL)\n\t}\n}", "title": "" }, { "docid": "6cc4768a1e68ad0b6d98b9615c84166b", "score": "0.4026318", "text": "func goimportApplicable(in []byte) bool {\n\treturn !commentInImportRegexp.Match(in)\n}", "title": "" }, { "docid": "19c536ab362c85bdd8d7ff15165dc23a", "score": "0.40257436", "text": "func MustReadLines(filename string) []string {\n\tr, err := ReadLines(filename)\n\tif err != nil {\n\t\tpanic(\"read file error:\" + filename)\n\t}\n\treturn r\n}", "title": "" }, { "docid": "ad8fcdfa072fb54ec854ef465806a61f", "score": "0.4019265", "text": "func readLines(path string) ([]string, error) {\n file, err := os.Open(path)\n if err != nil {\n return nil, err\n }\n defer file.Close()\n\n var lines []string\n scanner := bufio.NewScanner(file)\n for scanner.Scan() {\n lines = append(lines, scanner.Text())\n }\n return lines, scanner.Err()\n}", "title": "" }, { "docid": "ad8fcdfa072fb54ec854ef465806a61f", "score": "0.4019265", "text": "func readLines(path string) ([]string, error) {\n file, err := os.Open(path)\n if err != nil {\n return nil, err\n }\n defer file.Close()\n\n var lines []string\n scanner := bufio.NewScanner(file)\n for scanner.Scan() {\n lines = append(lines, scanner.Text())\n }\n return lines, scanner.Err()\n}", "title": "" } ]
9696dacdbe3c04ffe2492b176c540e19
NewSession provides a discordgo.Session instance to be used in unit testing with prepopulated initial state.
[ { "docid": "2ba2cb3b55228df36a45397330a7a02f", "score": "0.7533041", "text": "func NewSession() (*discordgo.Session, error) {\n\trole := mockrole.New(\n\t\tmockrole.WithID(mockconstants.TestRole),\n\t\tmockrole.WithName(mockconstants.TestRole),\n\t\tmockrole.WithPermissions(discordgo.PermissionViewChannel),\n\t)\n\n\tephRole := mockrole.New(\n\t\tmockrole.WithID(fmt.Sprintf(\"%s %s\", rolePrefix, mockconstants.TestChannel)),\n\t\tmockrole.WithName(fmt.Sprintf(\"%s %s\", rolePrefix, mockconstants.TestChannel)),\n\t\tmockrole.WithPermissions(discordgo.PermissionViewChannel),\n\t)\n\n\tbotUser := mockuser.New(\n\t\tmockuser.WithID(mockconstants.TestUser+\"Bot\"),\n\t\tmockuser.WithUsername(mockconstants.TestUser+\"Bot\"),\n\t\tmockuser.WithBotFlag(true),\n\t)\n\n\tstate, err := mockstate.New(\n\t\tmockstate.WithUser(botUser),\n\t\tmockstate.WithGuilds(\n\t\t\tsmallGuild(botUser, role, ephRole),\n\t\t\tlargeGuild(botUser, role, ephRole),\n\t\t),\n\t)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\treturn mocksession.New(\n\t\tmocksession.WithState(state),\n\t\tmocksession.WithClient(&http.Client{\n\t\t\tTransport: mockrest.NewTransport(state),\n\t\t}),\n\t)\n}", "title": "" } ]
[ { "docid": "76e1bd6d16c09b24d5b5f945ce30df2e", "score": "0.74390495", "text": "func NewSession(tokens map[string]string, botID string) (*Session, error) {\n\ttoken := tokens[botID]\n\tif token == \"\" {\n\t\treturn nil, errors.New(\"token for bot ID is not configured\")\n\t}\n\n\tnewSession, err := discordgo.New(\"Bot \" + token)\n\tif err != nil {\n\t\treturn nil, errors.New(\"error creating bot session\")\n\t}\n\tnewSession.MaxRestRetries = 0\n\n\tnewSession.Client = &http.Client{\n\t\tTimeout: 1 * time.Hour,\n\t}\n\n\treturn &Session{\n\t\tClient: newSession,\n\t\tBotID: botID,\n\t}, nil\n}", "title": "" }, { "docid": "f5d4d7a89b9400d8de8ba7b9f4c70413", "score": "0.7385621", "text": "func NewSession(cp CredentialProvider) Session {\n\treturn Session{\n\t\tID: NewID(),\n\t\tUserID: cp.GetUserID(),\n\t\tOwnerID: cp.GetStringID(),\n\t}\n}", "title": "" }, { "docid": "e0670160974fcee8846932ddf9a6f4bd", "score": "0.7377223", "text": "func (w WebDriverCore) newSession(desired, required Capabilities) (*Session, error) {\n\tif desired == nil {\n\t\tdesired = map[string]interface{}{}\n\t}\n\tp := params{\"desiredCapabilities\": desired, \"requiredCapabilities\": required}\n\tsessionId, data, err := w.do(p, \"POST\", \"/session\")\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\tvar capabilities Capabilities\n\terr = json.Unmarshal(data, &capabilities)\n\treturn &Session{Id: sessionId, Capabilities: capabilities}, err\n}", "title": "" }, { "docid": "b6d114854eda5c835731197ec3ca6ffc", "score": "0.73074275", "text": "func NewSession() *Session {\n\tlog.Println(\"Creating new Session\")\n\treturn &Session{\n\t\tID: newID(),\n\t\tPos: Tail,\n\t}\n}", "title": "" }, { "docid": "b83a5ca6d3a834d736aebbf06fd6ed41", "score": "0.73059916", "text": "func newSession() *Session {\n\ts := new(Session)\n\ts.id = generateId()\n\ts.isNew = true\n\ts.classifier = nbc.New([]float64{InterestingPrior, UninterestingPrior})\n\ts.haveRead = make(map[int64]bool)\n\ts.haveIgnored = make(map[int64]bool)\n\ts.haveBrowsed = 0\n\treturn s\n}", "title": "" }, { "docid": "606fcc7cd83b9a63645b15be775ee648", "score": "0.73006976", "text": "func newSession(vehicleID, userID string, duration time.Duration) *Session {\n\treturn &Session{\n\t\tvehicleID: vehicleID,\n\t\tuserID: userID,\n\t\tstart: time.Now(),\n\t\tduration: duration,\n\t\tdone: make(chan bool),\n\t\tstop: make(chan bool),\n\t}\n}", "title": "" }, { "docid": "692e9e38ce2355a1a78b2e3629d52946", "score": "0.7266485", "text": "func NewSession() *Session {\n\treturn &Session{Client:&http.Client{}}\n}", "title": "" }, { "docid": "b2dfada0eabf2893c8fd668d292213d0", "score": "0.721796", "text": "func NewSession(readonly bool) (*Session, error) {\n\treturn newSession(globalGogm, readonly)\n}", "title": "" }, { "docid": "3b04e06142ebf53653b9937ba17f66dc", "score": "0.7214364", "text": "func NewSession() *Session {\n\treturn &Session{\n\t\tCleanupEnabled: true,\n\t\tcleanupQueue: []CleanupFunc{},\n\t\topen: true,\n\t}\n}", "title": "" }, { "docid": "cf5305bfd796584322115678199999ce", "score": "0.72049993", "text": "func NewSession() *Session {\n\treturn &Session{\n\t\tData: map[string]interface{}{},\n\t}\n}", "title": "" }, { "docid": "70b80455a579e832c2b84ad327ef9cff", "score": "0.7200316", "text": "func NewSession(arg string) DBObject {\n\treturn DBObject{&mgo.Session{}}\n}", "title": "" }, { "docid": "96d7357df5ceba180d0d4059de89e785", "score": "0.71934235", "text": "func NewSession() *Session {\n\treturn &Session{\n\t\tcache: make(map[string]tokenjob),\n\t\tclock: clock.NewClock(),\n\t}\n}", "title": "" }, { "docid": "a8dcf52a3f967741a2676e5daf5f2f97", "score": "0.71758705", "text": "func NewSession(session *mgo.Session, databaseName string) Session {\n\treturn &sessionImpl{\n\t\tSession: session,\n\t\tDatabaseName: databaseName,\n\t}\n}", "title": "" }, { "docid": "acb795b62eb9e33a41f832956af21912", "score": "0.7157493", "text": "func startNewSession() *session.Session {\n\tsess, err := session.NewSession()\n\tif err != nil {\n\t\tfmt.Println(\"failed to create session,\", err)\n\t}\n\treturn sess\n}", "title": "" }, { "docid": "2d0ed0699a4eb840a11c59d3f5b3d6a0", "score": "0.7144257", "text": "func NewSession(con *websocket.Conn, tkn string) *Session {\n\tif tkn == \"\" {\n\t\ttkn, _ = token.GetAnonToken()\n\t}\n\treturn &Session{\n\t\tToken: tkn,\n\t\tConn: con,\n\t\tSub: &chatroom.Subscriber{\n\t\t\tConn: con,\n\t\t},\n\t}\n}", "title": "" }, { "docid": "67421e317c0ad844abd7d13290334ed4", "score": "0.7117576", "text": "func (m *Manager) NewSession() *Session {\n\ts := sessionPool.Get().(*Session)\n\ts.ID = ess.RandomString(m.idLength)\n\ts.IsNew = true\n\tt := time.Now()\n\ts.CreatedTime = &t\n\treturn s\n}", "title": "" }, { "docid": "0e1ec1716e049032cc55fa262b7afca4", "score": "0.7086629", "text": "func (s *SSH) newSession() (*ssh.Session, func(), error) {\n\tclient, closer, err := s.newClient()\n\tif err != nil {\n\t\treturn nil, nil, err\n\t}\n\n\tsession, err := client.NewSession()\n\tif err != nil {\n\t\treturn nil, nil, err\n\t}\n\n\treturn session,\n\t\tfunc() {\n\t\t\tcloser()\n\t\t\tsession.Close()\n\t\t},\n\t\tnil\n}", "title": "" }, { "docid": "a7678d8962c7b9007e9f82c045a43973", "score": "0.7019145", "text": "func New() *Session {\n\trand.Seed(int64(time.Now().Unix()))\n\n\ts := new(Session)\n\ts.ID = randomString()\n\ts.Created = time.Now()\n\ts.Updated = time.Now()\n\ts.Store = make(map[string]interface{})\n\n\treturn s\n}", "title": "" }, { "docid": "f08a99096f25e5a4473a8481f48fc7b1", "score": "0.7012789", "text": "func newSession(ttl int64) *Session {\n\treturn &Session{\n\t\tdata: make(map[string]interface{}),\n\t\tttl: ttl,\n\t}\n}", "title": "" }, { "docid": "0e114abb601dd79c49fdd3aae7e6c9d8", "score": "0.70049596", "text": "func (t FakeSession) New(host, port string) (connection.Session, error) {\n\treturn t, nil\n}", "title": "" }, { "docid": "89ef2902e57c877f3257b84888c28670", "score": "0.69721276", "text": "func NewSession(log *logrus.Entry, input io.Reader, output io.Writer, state *State) *Session {\n\treturn &Session{\n\t\tlog: log,\n\t\tinput: input,\n\t\toutput: output,\n\t\tstate: state,\n\t}\n}", "title": "" }, { "docid": "319bf4d14b4d324f3b6b73544838377c", "score": "0.69574076", "text": "func NewSession() (*session.Session, error) {\n\n\tsess, err := session.NewSession()\n\treturn sess, err\n}", "title": "" }, { "docid": "348908f89f711f20404aa9dbb59513de", "score": "0.69557333", "text": "func NewSession(info *NodeInfo, creator dataNodeCreatorFunc) *Session {\n\treturn &Session{\n\t\tinfo: info,\n\t\tclientCreator: creator,\n\t}\n}", "title": "" }, { "docid": "104033d13d4d8ff3918c9320236caeff", "score": "0.6941977", "text": "func NewSession(ctx context.Context, client *datastore.Client, userKey *datastore.Key) (*Session, error) {\n\treturn NewSessionWithDuration(ctx, client, userKey, defaultSessionDur)\n}", "title": "" }, { "docid": "fa77876651e04c68f2192c4a50be3d39", "score": "0.6941611", "text": "func NewSession() *Session {\n\treturn &Session{\n\t\tSources: []*sources.Source{},\n\t\tsourcesMap: map[string]bool{},\n\t\tanalyzersMap: map[string]bool{},\n\t}\n}", "title": "" }, { "docid": "488fe71e671212ace6f68afac136613c", "score": "0.69294965", "text": "func (ts *Session) NewSession() *Session {\n\tsess := NewSession()\n\n\tts.RegisterCleanupFunc(func() error {\n\t\tsess.Cleanup()\n\t\treturn nil\n\t})\n\n\treturn sess\n}", "title": "" }, { "docid": "ff1eda9d1080aedd66ea06c22c0e545c", "score": "0.68927133", "text": "func NewSession(id string) *Session {\n\treturn &Session{\n\t\tID: id,\n\t\tIsValid: true,\n\t\tisDirty: false,\n\t\tdata: make(map[string]interface{}),\n\t\tlock: new(sync.RWMutex),\n\t}\n}", "title": "" }, { "docid": "b5eaa5a575feeca82bab57b0d3dd2704", "score": "0.68685824", "text": "func (sdk *FabricSDK) NewSession(c context.Org, user apifabclient.User) (*Session, error) {\n\treturn NewSession(user, sdk.SessionFactory), nil\n}", "title": "" }, { "docid": "de487ba3497e2de433f7663fefa43d7e", "score": "0.6856343", "text": "func (sm *SessionManager) NewSession() (Session, error) {\n\tsession := Session{ExpirationTime: time.Now().Add(sm.sessionDuration.Duration).Unix()}\n\n\tid := make([]byte, 32)\n\tif _, err := io.ReadFull(rand.Reader, id); err != nil {\n\t\treturn session, err\n\t}\n\tsession.ID = base64.URLEncoding.EncodeToString(id)\n\n\treturn session, nil\n}", "title": "" }, { "docid": "cad04d1a2072bb98216b131addeb4b6f", "score": "0.68541366", "text": "func NewSession(session *gocql.Session) Session {\n\treturn Session{\n\t\tSession: session,\n\t\tMapper: DefaultMapper,\n\t}\n}", "title": "" }, { "docid": "d59d8b04944bfa236530bb91063f73c8", "score": "0.6852099", "text": "func (i *InboxSession) NewSession() inbox.InboxSession {\n\tloadEnv()\n\tvar auth *bind.TransactOpts\n\tswitch i.Local {\n\tcase true:\n\t\tkeystore, err := os.Open(myenv[\"KEYSTORE\"])\n\t\tif err != nil {\n\t\t\tlog.Fatalf(\"Cannot load keystore from location %s: %v\\n\", os.Getenv(\"KEYSTORE\"), err)\n\t\t}\n\n\t\tdefer keystore.Close()\n\n\t\tkeypass := myenv[\"KEYSTOREPASS\"]\n\t\tauth, err = bind.NewTransactor(keystore, keypass)\n\t\tif err != nil {\n\t\t\tlog.Fatalf(\"Error occurreed %v\\n\", err)\n\t\t}\n\tdefault:\n\t\tprivatekey, _ := crypto.HexToECDSA(os.Getenv(\"PRIVATE_KEY\"))\n\t\tauth = bind.NewKeyedTransactor(privatekey)\n\t}\n\n\tauth.Nonce = big.NewInt(1)\n\tauth.GasLimit = 3000000\n\tauth.GasPrice = big.NewInt(1200000000000)\n\n\treturn inbox.InboxSession{\n\t\tTransactOpts: *auth,\n\t\tCallOpts: bind.CallOpts{\n\t\t\tFrom: auth.From,\n\t\t\tContext: i.Ctx,\n\t\t},\n\t}\n}", "title": "" }, { "docid": "fdaf25b432438e6f6c3e09ab059cabbd", "score": "0.68501526", "text": "func NewSession(ctx context.Context, sshcfg *ssh.ClientConfig, target string) (s OpSession, err error) {\n\treturn NewSessionWithConfig(ctx, sshcfg, target, client.DefaultConfig)\n}", "title": "" }, { "docid": "24f6684c0376215bd113bc1a2f3da389", "score": "0.68380636", "text": "func NewSession(userID string, sessionID string) *Session {\n\treturn &Session{\n\t\tUserID: userID,\n\t\tSessionID: sessionID,\n\t\tCreatedUTC: time.Now().UTC(),\n\t\tState: map[string]interface{}{},\n\t}\n}", "title": "" }, { "docid": "98860ecb0a41431661f4aa892df2c7f2", "score": "0.68377304", "text": "func NewSession() *LodaSession {\n\tm := make(map[interface{}]interface{})\n\treturn &LodaSession{SessionMap: m}\n}", "title": "" }, { "docid": "6ad624c332286e9ae09262be65e37188", "score": "0.68153834", "text": "func NewSession(db *gorp.DbMap, expire int64) (s *Session, err error) {\n\tid := uuid.Must(uuid.NewV4()).String()\n\tnow := time.Now().Unix()\n\ts = &Session{\n\t\tID: id,\n\t\tCreated: now,\n\t\tExpire: now + expire,\n\t\tStore: gin.H{},\n\t}\n\n\terr = db.Insert(s)\n\tif err != nil {\n\t\terr = errors.Wrapf(err, \"new session failed\")\n\t\treturn\n\t}\n\n\treturn\n}", "title": "" }, { "docid": "1e567f86d2cc1f100ceafcdb7c5aa5d2", "score": "0.68149203", "text": "func NewSession(url, container, path, user, password, token, id string) (*Session, error) {\n\tenv, err := envSession()\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\t// TODO: Use reflect (see sessionFields pb/method.go)\n\tsession := &Session{\n\t\tUrl: firstVal(url, env.Url),\n\t\tContainer: firstVal(container, env.Container),\n\t\tPath: firstVal(path, env.Path),\n\t\tUser: firstVal(user, env.User),\n\t\tPassword: firstVal(password, env.Password),\n\t\tToken: firstVal(token, env.Token),\n\t\tId: firstVal(id, env.Id),\n\t}\n\n\treturn session, nil\n}", "title": "" }, { "docid": "5aed1427c0aa9806186ad8e7534c22ab", "score": "0.6782815", "text": "func newSession(peer wamp.Peer, sid wamp.ID, details wamp.Dict) *session {\n\tif sid == 0 {\n\t\tsid = wamp.GlobalID()\n\t}\n\n\treturn &session{\n\t\tSession: wamp.Session{\n\t\t\tPeer: peer,\n\t\t\tID: sid,\n\t\t\tDetails: details,\n\t\t},\n\t\tkillChan: make(chan *wamp.Goodbye),\n\t}\n}", "title": "" }, { "docid": "b25f358cda80975e5bbf93ac8aa1b66d", "score": "0.6773582", "text": "func NewSession(config *root.MongoConfig) (*Session, error) {\n\tfmt.Println(\"Opening session to mongoDB at \" + config.IP)\n\tsession, err := mgo.Dial(config.IP)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\tsession.SetMode(mgo.Monotonic, true)\n\treturn &Session{session}, err\n}", "title": "" }, { "docid": "a7c4b1f77de5491e019a89c5f97f2637", "score": "0.67690223", "text": "func NewSession() *Session {\n\tssn := Session{}\n\tssn.extras = make(map[string]interface{})\n\tssn.lock = &sync.RWMutex{}\n\n\tnewID := \"\"\n\tfor newID == \"\" {\n\t\tnewID = randomHash()\n\t\tif _, ok := sessionData[newID]; ok {\n\t\t\tlog.Warn(\"session.NewSession\", \"curious cookie namespace collision on \"+newID)\n\t\t\tnewID = \"\"\n\t\t\tcontinue\n\t\t}\n\t}\n\n\tssn.ID = newID\n\n\tmapLock.Lock()\n\tsessionData[ssn.ID] = &ssn\n\tmapLock.Unlock()\n\n\treturn &ssn\n}", "title": "" }, { "docid": "916dec6f65048d4f08b151f00a28fa2e", "score": "0.67578226", "text": "func (q *Router) NewSession(sessionOption []amqp.SessionOption) (*amqp.Session, error) {\n\tsession, err := q.Client.NewSession(sessionOption...)\n\tif err != nil {\n\t\treturn session, errorhandler.AMQPConnectionError{Desc: err.Error()}\n\t}\n\treturn session, nil\n}", "title": "" }, { "docid": "c30542f2aa0fbb1283708b57173e0947", "score": "0.67497003", "text": "func (m *Manager) NewSession(config *StartConfig)(err error) {\n\tvar id string\n\tvar ses *session\n\tidGenerated := false\n\n\tvar systreeConnStatus *systree.ClientConnectStatus\n\n\tdefer func() {\n\t\tif err != nil {\n\t\t\tvar reason packet.ReasonCode\n\t\t\tvar hasErrReason bool\n\t\t\tif reason, hasErrReason = err.(packet.ReasonCode); !hasErrReason {\n\t\t\t\tswitch config.Req.Version() {\n\t\t\t\tcase packet.ProtocolV50:\n\t\t\t\t\treason = packet.CodeUnspecifiedError\n\t\t\t\tdefault:\n\t\t\t\t\treason = packet.CodeRefusedServerUnavailable\n\t\t\t\t}\n\t\t\t}\n\t\t\tconfig.Resp.SetReturnCode(reason) // nolint: errcheck\n\t\t\tm.log.Warn(\"Session create error.\", zap.Error(err))\n\t\t}\n\n\t\tif rErr := routines.WriteMessage(config.Conn, config.Resp); rErr != nil {\n\t\t\tm.log.Error(\"Couldn't write CONNACK\", zap.String(\"ClientID\", id), zap.Error(rErr))\n\t\t} else {\n\t\t\tif ses != nil {\n\t\t\t\tses.start()\n\t\t\t\tm.Systree.Clients().Connected(id, systreeConnStatus)\n\t\t\t}\n\t\t}\n\t}()\n\n\tm.checkServerStatus(config.Req.Version(), config.Resp)\n\n\t// if response has return code differs from CodeSuccess return from this point\n\t// and send connack in deferred statement\n\tif config.Resp.ReturnCode() != packet.CodeSuccess {\n\t\treturn\n\t}\n\n\t// client might come with empty client id\n\tif id = string(config.Req.ClientID()); len(id) == 0 {\n\t\tid = m.genClientID()\n\t\tidGenerated = true\n\t}\n\n\tif ses, err = m.loadSession(id, config.Req.Version(), config.Resp); err == nil {\n\t\tif systreeConnStatus, err = m.configureSession(config, ses, id, idGenerated); err != nil {\n\t\t\tm.sessions.Delete(id)\n\t\t\tm.sessionsCount.Done()\n\t\t}\n\t}\n\treturn\n}", "title": "" }, { "docid": "60dad5d1bdc931aef1f69a6a2c9db5e2", "score": "0.6731742", "text": "func NewSession(email string, password string) (Session, error) {\n\tvar session Session\n\tuser, err := checkPassword(email, password)\n\tif err != nil {\n\t\terr = errors.New(\"The email/password combination was not found.\")\n\t\treturn session, err\n\t}\n\n\tsession, err = getSessionToken(user)\n\tif err != nil {\n\t\terr = errors.New(\"Session could not be established at this time try again later.\")\n\t\treturn session, err\n\t}\n\n\treturn session, nil\n}", "title": "" }, { "docid": "ecb905a2fe4d6e04cffd0f0d987eeb2b", "score": "0.67275417", "text": "func NewSession() (session *Session) {\n\treturn &Session{\n\t\tDefaultSession: &openid.DefaultSession{\n\t\t\tClaims: &fjwt.IDTokenClaims{\n\t\t\t\tExtra: map[string]any{},\n\t\t\t},\n\t\t\tHeaders: &fjwt.Headers{\n\t\t\t\tExtra: map[string]any{},\n\t\t\t},\n\t\t},\n\t\tExtra: map[string]any{},\n\t}\n}", "title": "" }, { "docid": "48e087889efba45c6326f355ea8f1dba", "score": "0.67234653", "text": "func (c *context) NewSession(newSessionInput *v3io.NewSessionInput) (v3io.Session, error) {\n\treturn newSession(c.logger,\n\t\tc,\n\t\tnewSessionInput.URL,\n\t\tnewSessionInput.Username,\n\t\tnewSessionInput.Password,\n\t\tnewSessionInput.AccessKey)\n}", "title": "" }, { "docid": "3d3273cd0bc10be61276eb654766f2e7", "score": "0.67210704", "text": "func NewSession(sctx sessionctx.Context, sqlExec sqlexec.SQLExecutor, closeFn func(Session)) Session {\n\treturn &session{\n\t\tContext: sctx,\n\t\tsqlExec: sqlExec,\n\t\tcloseFn: closeFn,\n\t}\n}", "title": "" }, { "docid": "d4ca48c80939c9192f89fe9c8917dcf5", "score": "0.67046195", "text": "func New(name string, addr string) *Session {\n\tsession := Session{\n\t\tlogger: log.New(os.Stdout, \"\", log.LstdFlags),\n\t\tname: name,\n\t\tdone: make(chan bool),\n\t}\n\tgo session.handleReconnect(addr)\n\treturn &session\n}", "title": "" }, { "docid": "59cd109eda83f1098d1be863a7df0d94", "score": "0.66979533", "text": "func NewSession(ctx context.Context, location, origin jid.JID, rw io.ReadWriter, state SessionState, negotiate Negotiator) (*Session, error) {\n\treturn negotiateSession(ctx, location, origin, rw, state, negotiate)\n}", "title": "" }, { "docid": "f183773a24d9d0638867a476313cbbb5", "score": "0.66876197", "text": "func NewSession(d Driver, u *sdk.User) (sessionstore.SessionKey, error) {\n\tsession, err := d.Store().New(\"\")\n\tif err != nil {\n\t\treturn \"\", err\n\t}\n\tlog.Notice(\"Auth> New Session for %s\", u.Username)\n\td.Store().Set(session, \"username\", u.Username)\n\treturn session, err\n}", "title": "" }, { "docid": "0f4c7d571e895db4d88cef2ab72977b9", "score": "0.6681996", "text": "func NewSession(user BasicUser, domain BasicDomain, userAgent, remoteAddr string) *Session {\n\ts := &Session{\n\t\tID: uuid.NewV4().String(),\n\t\tDomain: &domain,\n\t\tUser: &user,\n\t\tUserAgent: userAgent,\n\t\tRemoteAddr: remoteAddr,\n\t}\n\tnow := time.Now().UTC()\n\ts.CreatedOn.Time = now\n\ts.UpdatedOn.Time = now\n\ts.ExpiresOn.Time = now.Add(time.Duration(config.SessionTTLMinutes()) * time.Minute)\n\treturn s\n}", "title": "" }, { "docid": "da5bc9af2ba785e9907a9843c2f436de", "score": "0.66615766", "text": "func newSession(c context.Context, scout *scout.Reporter, mi *rpc.OutboundInfo) (*session, error) {\n\tdlog.Info(c, \"-- Starting new session\")\n\tconn, mc, ver, err := connectToManager(c)\n\tif mc == nil || err != nil {\n\t\treturn nil, err\n\t}\n\n\tas := convertSubnets(mi.AlsoProxySubnets)\n\tns := convertSubnets(mi.NeverProxySubnets)\n\ts := &session{\n\t\tscout: scout,\n\t\thandlers: tunnel.NewPool(),\n\t\tfragmentMap: make(map[uint16][]*buffer.Data),\n\t\trndSource: rand.NewSource(time.Now().UnixNano()),\n\t\tsession: mi.Session,\n\t\tmanagerClient: mc,\n\t\tmanagerVersion: ver,\n\t\tclientConn: conn,\n\t\talsoProxySubnets: as,\n\t\tneverProxyRoutes: routing.Routes(c, ns),\n\t\tproxyCluster: true,\n\t\tvifReady: make(chan error, 2),\n\t}\n\n\ts.dev, err = vif.OpenTun(c)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\tif dnsproxy.ManagerCanDoDNSQueryTypes(ver) {\n\t\ts.dnsServer = dns.NewServer(mi.Dns, s.clusterLookup, false)\n\t} else {\n\t\ts.dnsServer = dns.NewServer(mi.Dns, s.legacyClusterLookup, true)\n\t}\n\tdlog.Infof(c, \"also-proxy subnets %v\", as)\n\tdlog.Infof(c, \"never-proxy subnets %v\", ns)\n\treturn s, nil\n}", "title": "" }, { "docid": "30241855f6bda7a8226e1aadde042977", "score": "0.6658982", "text": "func NewSession(ctx *pulumi.Context,\n\tname string, args *SessionArgs, opts ...pulumi.ResourceOption) (*Session, error) {\n\tif args == nil {\n\t\treturn nil, errors.New(\"missing one or more required arguments\")\n\t}\n\n\tif args.IntegrationAccountName == nil {\n\t\treturn nil, errors.New(\"invalid value for required argument 'IntegrationAccountName'\")\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:logic/v20160601:Session\"),\n\t\t},\n\t\t{\n\t\t\tType: pulumi.String(\"azure-native:logic:Session\"),\n\t\t},\n\t\t{\n\t\t\tType: pulumi.String(\"azure-nextgen:logic:Session\"),\n\t\t},\n\t\t{\n\t\t\tType: pulumi.String(\"azure-native:logic/v20180701preview:Session\"),\n\t\t},\n\t\t{\n\t\t\tType: pulumi.String(\"azure-nextgen:logic/v20180701preview:Session\"),\n\t\t},\n\t\t{\n\t\t\tType: pulumi.String(\"azure-native:logic/v20190501:Session\"),\n\t\t},\n\t\t{\n\t\t\tType: pulumi.String(\"azure-nextgen:logic/v20190501:Session\"),\n\t\t},\n\t})\n\topts = append(opts, aliases)\n\tvar resource Session\n\terr := ctx.RegisterResource(\"azure-native:logic/v20160601:Session\", name, args, &resource, opts...)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\treturn &resource, nil\n}", "title": "" }, { "docid": "2c19ed0a0d52100a95caff96706934e9", "score": "0.66539353", "text": "func NewSession(dbName string) *DatabaseSession {\n\tsession, err := mgo.Dial(\"mongodb://localhost\")\n if err != nil {\n panic(err)\n }\n\n return &DatabaseSession{session, dbName}\n}", "title": "" }, { "docid": "f63dd96559f57d79043434de99a83c90", "score": "0.66488", "text": "func getNewDGSession(ev *EnvVar) (discordgo.Session, error) {\n dg, err := discordgo.New(\"Bot \" + ev.Token)\n if err != nil {\n log.Fatal(\"Failed to initialize DiscordGo session.\")\n return *dg, err\n }\n\n return *dg, nil\n}", "title": "" }, { "docid": "f12c663c5bcb16796900de21a89dc55a", "score": "0.6647703", "text": "func NewSession() (*Session, error) {\n\tsqlSession, err := newSQLSession()\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\treturn &Session{*sqlSession}, nil\n}", "title": "" }, { "docid": "cc5845bfe0e7f05b6e06a9727d4c1189", "score": "0.66414416", "text": "func (s *storeMock) New(\n\tr *http.Request, name string) (*sessions.Session, error) {\n\tif s.behavior == \"ok\" {\n\t\treturn sessions.NewSession(s, SESSION_NAME), nil\n\t}\n\treturn nil, errors.New(\"some error\")\n}", "title": "" }, { "docid": "7f5e64056a4eb54b409c1ea266596fdc", "score": "0.6641229", "text": "func NewSession(server int) *Session {\n\ts := new(Session)\n\ts.servers = make(map[int32]comet, server)\n\ts.rooms = make(map[int64]map[int32]int32)\n\ts.seq = int32((time.Now().UnixNano()/1000000) & 0x7fffffff)\n\treturn s\n}", "title": "" }, { "docid": "1ed1666ed833f28ef2dd54223c3d0ee8", "score": "0.66406184", "text": "func NewSession(\n\tctx context.Context,\n\tsession warp.Session,\n\tw string,\n\tsessionType warp.SessionType,\n\tusername string,\n\tcancel func(),\n\tconn net.Conn,\n) (*Session, error) {\n\tmux, err := yamux.Client(conn, &yamux.Config{\n\t\tAcceptBacklog: 256,\n\t\tEnableKeepAlive: true,\n\t\tKeepAliveInterval: 2 * time.Second,\n\t\tConnectionWriteTimeout: 10 * time.Second,\n\t\tMaxStreamWindowSize: 256 * 1024,\n\t\tLogOutput: ioutil.Discard,\n\t})\n\tif err != nil {\n\t\treturn nil, errors.Trace(\n\t\t\terrors.Newf(\"Failed to open session to warpd: %v\", err),\n\t\t)\n\t}\n\n\tss := &Session{\n\t\tsession: session,\n\t\twarp: w,\n\t\tsessionType: sessionType,\n\t\tusername: username,\n\t\tconn: conn,\n\t\tmux: mux,\n\t\tcancel: cancel,\n\t\tmutex: &sync.Mutex{},\n\t}\n\n\t// Opens state channel stateC.\n\tss.stateC, err = mux.Open()\n\tif err != nil {\n\t\tss.TearDown()\n\t\treturn nil, errors.Trace(\n\t\t\terrors.Newf(\"State channel open error: %v\", err),\n\t\t)\n\t}\n\tss.stateR = gob.NewDecoder(ss.stateC)\n\n\t// Open update channel updateC.\n\tss.updateC, err = mux.Open()\n\tif err != nil {\n\t\tss.TearDown()\n\t\treturn nil, errors.Trace(\n\t\t\terrors.Newf(\"Update channel open error: %v\", err),\n\t\t)\n\t}\n\tss.updateW = gob.NewEncoder(ss.updateC)\n\n\t// Send initial SessionHello.\n\thello := warp.SessionHello{\n\t\tWarp: ss.warp,\n\t\tFrom: ss.session,\n\t\tVersion: warp.Version,\n\t\tType: ss.sessionType,\n\t\tUsername: ss.username,\n\t}\n\tif err := ss.updateW.Encode(hello); err != nil {\n\t\tss.TearDown()\n\t\treturn nil, errors.Trace(\n\t\t\terrors.Newf(\"Send hello error: %v\", err),\n\t\t)\n\t}\n\n\t// Opens error channel errorC.\n\tss.errorC, err = mux.Open()\n\tif err != nil {\n\t\tss.TearDown()\n\t\treturn nil, errors.Trace(\n\t\t\terrors.Newf(\"Error channel open error: %v\", err),\n\t\t)\n\t}\n\tss.errorR = gob.NewDecoder(ss.errorC)\n\n\t// Open data channel dataC.\n\tss.dataC, err = mux.Open()\n\tif err != nil {\n\t\tss.TearDown()\n\t\treturn nil, errors.Trace(\n\t\t\terrors.Newf(\"Data channel open error: %v\", err),\n\t\t)\n\t}\n\n\t// Setup warp state.\n\tss.state = NewWarpState(hello)\n\n\treturn ss, nil\n}", "title": "" }, { "docid": "ddf1dbd92c8220d50cd37fbab0551a89", "score": "0.6632011", "text": "func New(timeout time.Duration) *Session {\n\treturn &Session{\n\t\ttimeout: timeout,\n\t\tcache: make(map[string]*object),\n\t}\n}", "title": "" }, { "docid": "9d2f53e0b335c7a8a906a29e9538ef12", "score": "0.6628671", "text": "func NewSession() (*Session, error) {\n\tctr, err := newTransport(nil)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\telt, err := newTransport(nil)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\ts := &Session{\n\t\tctr: ctr,\n\t\tel: newEventListener(elt),\n\t}\n\n\treturn s, nil\n}", "title": "" }, { "docid": "709d906aa9a6ad77eccbc8f1bd842322", "score": "0.6609149", "text": "func (c *context) New(name string) *sessions.Session {\n\treturn &sessions.Session{\n\t\tName: name,\n\t\tValues: map[string]interface{}{},\n\t\tStore: c,\n\t}\n}", "title": "" }, { "docid": "fde3edaee6495a7827d4457e0d0795f7", "score": "0.66056085", "text": "func NewSession(username, password string) (*Session, error) {\n\tjar, err := cookiejar.New(nil)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\tclient := &http.Client{}\n\tclient.Jar = jar\n\n\treturn &Session{\n\t\tlogin: loginForm{\n\t\t\tUsername: username,\n\t\t\tPassword: password,\n\t\t},\n\t\tclient: client,\n\t\tschema: schema.NewEncoder(),\n\t}, nil\n}", "title": "" }, { "docid": "9066982395cc071814c2b0e66c08498d", "score": "0.6598646", "text": "func (t *Mpls_SignalingProtocols_RsvpTe) NewSession(LocalIndex uint64) (*Mpls_SignalingProtocols_RsvpTe_Session, error) {\n\n\t// Initialise the list within the receiver struct if it has not already been\n\t// created.\n\tif t.Session == nil {\n\t\tt.Session = make(map[uint64]*Mpls_SignalingProtocols_RsvpTe_Session)\n\t}\n\n\tkey := LocalIndex\n\n\t// Ensure that this key has not already been used in the\n\t// list. Keyed YANG lists do not allow duplicate keys to\n\t// be created.\n\tif _, ok := t.Session[key]; ok {\n\t\treturn nil, fmt.Errorf(\"duplicate key %v for list Session\", key)\n\t}\n\n\tt.Session[key] = &Mpls_SignalingProtocols_RsvpTe_Session{\n\t\tLocalIndex: &LocalIndex,\n\t}\n\n\treturn t.Session[key], nil\n}", "title": "" }, { "docid": "9a979c2c40f2842ba654803fe27f1caf", "score": "0.6593655", "text": "func (t *Mpls_SignalingProtocols_RsvpTe) NewSession(LocalIndex uint64) (*Mpls_SignalingProtocols_RsvpTe_Session, error) {\n\n\t// Initialise the list within the receiver struct if it has not already been\n\t// created.\n\tif t.Session == nil {\n\t\tt.Session = make(map[uint64]*Mpls_SignalingProtocols_RsvpTe_Session)\n\t}\n\n\tkey := LocalIndex\n\n\t// Ensure that this key has not already been used in the\n\t// list. Keyed YANG lists do not allow duplicate keys to\n\t// be created.\n\tif _, ok := t.Session[key]; ok {\n\t\treturn nil, fmt.Errorf(\"duplicate key %%v for list Session\", key)\n\t}\n\n\tt.Session[key] = &Mpls_SignalingProtocols_RsvpTe_Session{\n\t\tLocalIndex: &LocalIndex,\n\t}\n\n\treturn t.Session[key], nil\n}", "title": "" }, { "docid": "106487f372d4d7312df9313818d56703", "score": "0.6587635", "text": "func NewSession() (*Session, error) {\n\truntime, err := js.NewRuntime(ShellAssets)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\ts := &Session{\n\t\truntime: runtime,\n\t\trl: newContLiner(),\n\t}\n\n\ts.runtime.Start()\n\ts.runtime.RegisterAPIClient(CrudClient)\n\n\tif err := s.loadHistory(); err != nil {\n\t\treturn nil, fmt.Errorf(\"while reading history: %s\", err)\n\t}\n\n\ts.rl.SetWordCompleter(s.completeWord)\n\n\treturn s, nil\n}", "title": "" }, { "docid": "c60f4f34068929539384dc8898af3abf", "score": "0.658756", "text": "func newsess(tb testing.TB) *session.Session {\n\tcfg := &aws.Config{\n\t\tCredentials: credentials.NewEnvCredentials(),\n\t}\n\n\tsess, err := session.NewSession(cfg)\n\tif err != nil {\n\t\ttb.Fatal(\"failed to setup aws session\", err)\n\t}\n\n\treturn sess\n}", "title": "" }, { "docid": "41be22cd1c44cd139007648b7337cea0", "score": "0.6579496", "text": "func (c *Sessions) NewSession(userID int, deviceType string) (string, error) {\n\ttoken, err := authentication.GenerateJwt(strconv.Itoa(userID))\n\tif err != nil {\n\t\tfmt.Println(1, err)\n\t\treturn \"\", err\n\t}\n\n\terr = c.db.Update(func(tx *boltdb.Tx) error {\n\t\tb := tx.Bucket(keys.session)\n\n\t\tid, _ := b.NextSequence()\n\n\t\tt := types.NewSession(userID, token, deviceType)\n\t\tt.ID = int(id)\n\n\t\tvar enc []byte\n\t\tenc, err = encode(t)\n\t\tif err != nil {\n\t\t\treturn err\n\t\t}\n\n\t\terr = b.Put([]byte(token), enc)\n\n\t\treturn err\n\t})\n\n\treturn token, err\n}", "title": "" }, { "docid": "3dd392c22112dfa1f1675ebe1caae0e8", "score": "0.6571826", "text": "func NewSession(ctx context.Context, name, sharedKey string) (*Session, error) {\n\tid := identity.NewID()\n\n\tvar unary []grpc.UnaryServerInterceptor\n\tvar stream []grpc.StreamServerInterceptor\n\n\tserverOpts := []grpc.ServerOption{}\n\n\tif span := trace.SpanFromContext(ctx); span.SpanContext().IsValid() {\n\t\tunary = append(unary, filterServer(otelgrpc.UnaryServerInterceptor(otelgrpc.WithTracerProvider(span.TracerProvider()), otelgrpc.WithPropagators(propagators))))\n\t\tstream = append(stream, otelgrpc.StreamServerInterceptor(otelgrpc.WithTracerProvider(span.TracerProvider()), otelgrpc.WithPropagators(propagators)))\n\t}\n\n\tunary = append(unary, grpcerrors.UnaryServerInterceptor)\n\tstream = append(stream, grpcerrors.StreamServerInterceptor)\n\n\tif len(unary) == 1 {\n\t\tserverOpts = append(serverOpts, grpc.UnaryInterceptor(unary[0]))\n\t} else if len(unary) > 1 {\n\t\tserverOpts = append(serverOpts, grpc.UnaryInterceptor(grpc_middleware.ChainUnaryServer(unary...)))\n\t}\n\n\tif len(stream) == 1 {\n\t\tserverOpts = append(serverOpts, grpc.StreamInterceptor(stream[0]))\n\t} else if len(stream) > 1 {\n\t\tserverOpts = append(serverOpts, grpc.StreamInterceptor(grpc_middleware.ChainStreamServer(stream...)))\n\t}\n\n\ts := &Session{\n\t\tid: id,\n\t\tname: name,\n\t\tsharedKey: sharedKey,\n\t\tgrpcServer: grpc.NewServer(serverOpts...),\n\t}\n\n\tgrpc_health_v1.RegisterHealthServer(s.grpcServer, health.NewServer())\n\n\treturn s, nil\n}", "title": "" }, { "docid": "003ecf8bdd1351f2e3a986b35204c9d9", "score": "0.65652984", "text": "func (srv *Server) newSession(conn net.Conn, config *config.Config) (s *session) {\n\tbr := bufio.NewReader(conn)\n\ts = &session{\n\t\tsrv: srv,\n\t\tconn: conn,\n\t\tbr: br,\n\t\tbw: bufio.NewWriter(conn),\n\n\t\t// used for reading the DATA\n\t\tsmtpReader: textproto.NewReader(br),\n\n\t\tconfig: config,\n\t}\n\n\ts.remoteHost = \"unknown\"\n\n\t// Set tls = true if TLS is already in use.\n\t_, s.tls = s.conn.(*tls.Conn)\n\n\treturn\n}", "title": "" }, { "docid": "f04492476d1c399d926fd4d1c47a300c", "score": "0.6549442", "text": "func New(db *sql.DB) *Session {\r\n\treturn &Session{db: db}\r\n}", "title": "" }, { "docid": "3f807b81528ce3e0ae4d16f0ecd497b2", "score": "0.65451324", "text": "func (client *Client) NewSession(host, rtsp, session, username, password string) (Session, error) {\n\ts := Session{\n\t\thost,\n\t\t0,\n\t\tnil,\n\t\tsession,\n\t\tclient.UserAgent,\n\t\tusername,\n\t\tpassword,\n\t\trtsp,\n\t}\n\tclient.Sessions = append(client.Sessions, s)\n\n\terr := s.Connect()\n\treturn s, err\n}", "title": "" }, { "docid": "f7b692e68c517a96572967c18e99c450", "score": "0.65403485", "text": "func New(args ...interface{}) (s *Session, err error) {\n\n\t// Create an empty Session interface.\n\ts = &Session{\n\t\tState: NewState(),\n\t\tRatelimiter: NewRatelimiter(),\n\t\tStateEnabled: true,\n\t\tCompress: true,\n\t\tShouldReconnectOnError: true,\n\t\tShardID: 0,\n\t\tShardCount: 1,\n\t\tMaxRestRetries: 3,\n\t\tClient: &http.Client{Timeout: (20 * time.Second)},\n\t\tUserAgent: \"DiscordBot (https://github.com/bwmarrin/discordgo, v\" + VERSION + \")\",\n\t\tsequence: new(int64),\n\t\tLastHeartbeatAck: time.Now().UTC(),\n\t}\n\n\t// Initilize the Identify Package with defaults\n\t// These can be modified prior to calling Open()\n\ts.Identify.Compress = true\n\ts.Identify.LargeThreshold = 250\n\ts.Identify.GuildSubscriptions = true\n\ts.Identify.Properties.OS = runtime.GOOS\n\ts.Identify.Properties.Browser = \"DiscordGo v\" + VERSION\n\ts.Identify.Intents = MakeIntent(IntentsAllWithoutPrivileged)\n\n\t// If no arguments are passed return the empty Session interface.\n\tif args == nil {\n\t\treturn\n\t}\n\n\t// Variables used below when parsing func arguments\n\tvar auth, pass string\n\n\t// Parse passed arguments\n\tfor _, arg := range args {\n\n\t\tswitch v := arg.(type) {\n\n\t\tcase []string:\n\t\t\tif len(v) > 3 {\n\t\t\t\terr = fmt.Errorf(\"too many string parameters provided\")\n\t\t\t\treturn\n\t\t\t}\n\n\t\t\t// First string is either token or username\n\t\t\tif len(v) > 0 {\n\t\t\t\tauth = v[0]\n\t\t\t}\n\n\t\t\t// If second string exists, it must be a password.\n\t\t\tif len(v) > 1 {\n\t\t\t\tpass = v[1]\n\t\t\t}\n\n\t\t\t// If third string exists, it must be an auth token.\n\t\t\tif len(v) > 2 {\n\t\t\t\ts.Identify.Token = v[2]\n\t\t\t\ts.Token = v[2] // TODO: Remove, Deprecated - Kept for backwards compatibility.\n\t\t\t}\n\n\t\tcase string:\n\t\t\t// First string must be either auth token or username.\n\t\t\t// Second string must be a password.\n\t\t\t// Only 2 input strings are supported.\n\n\t\t\tif auth == \"\" {\n\t\t\t\tauth = v\n\t\t\t} else if pass == \"\" {\n\t\t\t\tpass = v\n\t\t\t} else if s.Token == \"\" {\n\t\t\t\ts.Identify.Token = v\n\t\t\t\ts.Token = v // TODO: Remove, Deprecated - Kept for backwards compatibility.\n\t\t\t} else {\n\t\t\t\terr = fmt.Errorf(\"too many string parameters provided\")\n\t\t\t\treturn\n\t\t\t}\n\n\t\t\t//\t\tcase Config:\n\t\t\t// TODO: Parse configuration struct\n\n\t\tdefault:\n\t\t\terr = fmt.Errorf(\"unsupported parameter type provided\")\n\t\t\treturn\n\t\t}\n\t}\n\n\t// If only one string was provided, assume it is an auth token.\n\t// Otherwise get auth token from Discord, if a token was specified\n\t// Discord will verify it for free, or log the user in if it is\n\t// invalid.\n\tif pass == \"\" {\n\t\ts.Identify.Token = auth\n\t\ts.Token = auth // TODO: Remove, Deprecated - Kept for backwards compatibility.\n\t} else {\n\t\terr = s.Login(auth, pass)\n\t\t// TODO: Remove last s.Token part, Deprecated - Kept for backwards compatibility.\n\t\tif err != nil || s.Identify.Token == \"\" || s.Token == \"\" {\n\t\t\tif s.MFA {\n\t\t\t\terr = ErrMFA\n\t\t\t} else {\n\t\t\t\terr = fmt.Errorf(\"Unable to fetch discord authentication token. %v\", err)\n\t\t\t}\n\t\t\treturn\n\t\t}\n\t}\n\n\treturn\n}", "title": "" }, { "docid": "c8cb27e89a22589b85af79e30e12170f", "score": "0.65336406", "text": "func (db *DB) NewSession() *Session {\n\treturn &Session{db.Engine.NewSession()}\n}", "title": "" }, { "docid": "3f830255d34497de9af73a0396de59e1", "score": "0.65254086", "text": "func NewSession(node *Node, conn Connection, url string, headers *map[string]string, uid string) *Session {\n\tsession := &Session{\n\t\tnode: node,\n\t\tconn: conn,\n\t\tenv: common.NewSessionEnv(url, headers),\n\t\tsubscriptions: make(map[string]bool),\n\t\tsendCh: make(chan *ws.SentFrame, 256),\n\t\tclosed: false,\n\t\tConnected: false,\n\t\tpingInterval: time.Duration(node.config.PingInterval) * time.Second,\n\t\tpingTimestampPrecision: node.config.PingTimestampPrecision,\n\t\t// Use JSON by default\n\t\tencoder: encoders.JSON{},\n\t\t// Use Action Cable executor by default (implemented by node)\n\t\texecutor: node,\n\t}\n\n\tsession.UID = uid\n\n\tctx := node.log.WithFields(log.Fields{\n\t\t\"sid\": session.UID,\n\t})\n\n\tsession.Log = ctx\n\n\tsession.addPing()\n\tgo session.SendMessages()\n\n\treturn session\n}", "title": "" }, { "docid": "3082b439a6071da958bd371144818c8c", "score": "0.6524955", "text": "func (t *NetworkInstance_Mpls_SignalingProtocols_RsvpTe) NewSession(LocalIndex uint64) (*NetworkInstance_Mpls_SignalingProtocols_RsvpTe_Session, error) {\n\n\t// Initialise the list within the receiver struct if it has not already been\n\t// created.\n\tif t.Session == nil {\n\t\tt.Session = make(map[uint64]*NetworkInstance_Mpls_SignalingProtocols_RsvpTe_Session)\n\t}\n\n\tkey := LocalIndex\n\n\t// Ensure that this key has not already been used in the\n\t// list. Keyed YANG lists do not allow duplicate keys to\n\t// be created.\n\tif _, ok := t.Session[key]; ok {\n\t\treturn nil, fmt.Errorf(\"duplicate key %v for list Session\", key)\n\t}\n\n\tt.Session[key] = &NetworkInstance_Mpls_SignalingProtocols_RsvpTe_Session{\n\t\tLocalIndex: &LocalIndex,\n\t}\n\n\treturn t.Session[key], nil\n}", "title": "" }, { "docid": "a5d135114e9c1c2222724270887f3c90", "score": "0.652294", "text": "func (t *NetworkInstance_Mpls_SignalingProtocols_RsvpTe) NewSession(LocalIndex uint64) (*NetworkInstance_Mpls_SignalingProtocols_RsvpTe_Session, error) {\n\n\t// Initialise the list within the receiver struct if it has not already been\n\t// created.\n\tif t.Session == nil {\n\t\tt.Session = make(map[uint64]*NetworkInstance_Mpls_SignalingProtocols_RsvpTe_Session)\n\t}\n\n\tkey := LocalIndex\n\n\t// Ensure that this key has not already been used in the\n\t// list. Keyed YANG lists do not allow duplicate keys to\n\t// be created.\n\tif _, ok := t.Session[key]; ok {\n\t\treturn nil, fmt.Errorf(\"duplicate key %%v for list Session\", key)\n\t}\n\n\tt.Session[key] = &NetworkInstance_Mpls_SignalingProtocols_RsvpTe_Session{\n\t\tLocalIndex: &LocalIndex,\n\t}\n\n\treturn t.Session[key], nil\n}", "title": "" }, { "docid": "c19fb36bd0c5ccfe2f1adbb05c546320", "score": "0.65188164", "text": "func New(session_name string, database int, host string, port int) (*SessionConnect, error) {\n\t// session ID name\n\ttemp_connection := new(SessionConnect)\n\ttemp_connection.session_id = session_name\n\n\t// connecting to redis\n\ttmp_redis := rsess_redis_connector.DefaultSpec().Db(database).Host(host).Port(port)\n\ttmp_client, e := rsess_redis_connector.NewSynchClientWithSpec(tmp_redis)\n\tif e != nil {\n\t\tlog.Printf(\"%s\", e)\n\t\treturn nil, e\n\t}\n\tclredis = tmp_client\n\n\t// assign Redis connection\n\treturn temp_connection, nil\n}", "title": "" }, { "docid": "3e05096ec9f785d6082e4eff2d68588e", "score": "0.64898384", "text": "func NewSession(clientConfig *ssh.ClientConfig, target string) (*Session, *HelloMessage, error) {\n\n\tvar session Session\n\tvar err error\n\n\tsession.sshClient, err = ssh.Dial(\"tcp\", target, clientConfig)\n\tif err != nil {\n\t\treturn nil, nil, err\n\t}\n\n\tif session.sshSession, err = session.sshClient.NewSession(); err != nil {\n\t\t_ = session.sshClient.Close()\n\t\treturn nil, nil, err\n\t}\n\n\tcloseAll := func() {\n\t\t_ = session.sshClient.Close()\n\t\t_ = session.sshSession.Close()\n\t}\n\n\tif err := session.sshSession.RequestSubsystem(\"netconf\"); err != nil {\n\t\tcloseAll()\n\t\treturn nil, nil, err\n\t}\n\n\tif session.reader, err = session.sshSession.StdoutPipe(); err != nil {\n\t\tcloseAll()\n\t\treturn nil, nil, err\n\t}\n\n\tif session.writeCloser, err = session.sshSession.StdinPipe(); err != nil {\n\t\tcloseAll()\n\t\treturn nil, nil, err\n\t}\n\n\tvar helloMessage HelloMessage\n\tif err := session.NewDecoder().DecodeHello(&helloMessage); err != nil {\n\t\tcloseAll()\n\t\treturn nil, nil, err\n\t}\n\n\tif _, err := io.Copy(&session, strings.NewReader(DefaultHelloMessage)); err != nil {\n\t\tcloseAll()\n\t\treturn nil, nil, err\n\t}\n\n\treturn &session, &helloMessage, nil\n}", "title": "" }, { "docid": "0af7bddfbce3d87b9f981fe0876d5761", "score": "0.64839256", "text": "func newSession(prm connParams) (s *session, err error) {\n\ts = &session{envChange: envChange{msg: newMsg(EnvChange)},\n\t\tdone: done{msg: newMsg(Done)},\n\t\tsqlMessage: sqlMessage{msg: newMsg(SQLMessage)},\n\t\treturnStatus: returnStatus{msg: newMsg(ReturnStatus)},\n\t\tIsError: isError, packetSize: prm.packetSize,\n\t\treadTimeout: prm.readTimeout, writeTimeout: prm.writeTimeout,\n\t\tloginTimeout: prm.loginTimeout, res: &Result{lastError: nil}}\n\n\t// init resultset, buffer, parameters, message cache...\n\ts.res.s = s\n\ts.server = prm.host\n\ts.messageMap = map[byte]netlib.Messager{byte(EnvChange): &s.envChange,\n\t\tbyte(DoneProc): &s.done, byte(DoneInProc): &s.done,\n\t\tbyte(Done): &s.done, byte(ReturnStatus): &s.returnStatus,\n\t\tbyte(SQLMessage): &s.sqlMessage}\n\n\t// connect\n\tif s.c, err = dial(prm); err != nil {\n\t\treturn s, err\n\t}\n\n\t// init netlib buffer\n\ts.b = netlib.NewBuffer(s.packetSize, s.c)\n\ts.b.ReadTimeout, s.b.WriteTimeout = s.readTimeout, s.writeTimeout\n\ts.b.DefaultMessageMap = s.messageMap\n\n\t// now log in\n\tif err = s.login(prm); err != nil {\n\t\t// retry without password encryption\n\t\tif err == ErrUnsupportedPassWordEncrytion && prm.encryptPassword == \"try\" {\n\t\t\ts.c.Close()\n\t\t\tprm.encryptPassword = \"no\"\n\t\t\treturn newSession(prm)\n\t\t}\n\t\treturn s, err\n\t}\n\n\treturn s, nil\n}", "title": "" }, { "docid": "85dd616fbbb82eb6a436ba2d92399a01", "score": "0.6481486", "text": "func newSession(stor storage.Storage, o *opt.Options) (s *session, err error) {\n\tif stor == nil {\n\t\treturn nil, os.ErrInvalid\n\t}\n\tstorLock, err := stor.Lock()\n\tif err != nil {\n\t\treturn\n\t}\n\ts = &session{\n\t\tstor: stor,\n\t\tstorLock: storLock,\n\t}\n\ts.setOptions(o)\n\ts.tops = newTableOps(s)\n\ts.setVersion(newVersion(s))\n\ts.log(\"log@legend F·NumFile S·FileSize N·Entry C·BadEntry B·BadBlock Ke·KeyError D·DroppedEntry L·Level Q·SeqNum T·TimeElapsed\")\n\treturn\n}", "title": "" }, { "docid": "6418b5b054e2351a26aef4d1d8f3527d", "score": "0.64770764", "text": "func (s *Server) NewSession() (*Session, error) {\n\tsess := &Session{\n\t\tserver: s,\n\t\trecv: make(chan *MessagePayload, 10),\n\t}\n\n\t// generate a random nickname and assign the server address to the user\n\tnickname := petname.Generate(2, \"-\")\n\terr := s.db.AssignServer(nickname, s.httpAddr)\n\tif err != nil {\n\t\t// check if dup\n\t\t// if dup: retry with another name\n\t\treturn nil, err\n\t}\n\tsess.Nickname = nickname\n\ts.mutex.Lock()\n\ts.sessions[nickname] = sess\n\ts.mutex.Unlock()\n\n\t// greets the user and send its nickname\n\terr = s.systemSess.SendMessage(nickname, fmt.Sprintf(\"Greetings, %s.\", nickname))\n\tif err != nil {\n\t\treturn nil, errors.Wrap(err, \"send to user\")\n\t}\n\treturn sess, nil\n}", "title": "" }, { "docid": "5e85c73abe4df4b2c2be7c0da902112d", "score": "0.6473984", "text": "func New() *SessionManager {\n\n sm := &SessionManager{\n sessions: make(sessDict),\n Config: SessionManagerConfig{\n CleanerInterval: 1 * time.Minute,\n MaxLifetime: 24 * time.Hour,\n EnableHttpHeader: false,\n SessionHeader: \"\",\n },\n Cookie: SessionCookie{\n Name: \"sessionid\",\n Domain: \"\",\n HTTPOnly: true,\n Secure: false,\n Lifetime: 24 * time.Hour,\n },\n }\n\n go sm.GlobalCleaner()\n\n return sm\n}", "title": "" }, { "docid": "82bacff101d3c88e0a8b12f475b0f3c7", "score": "0.6467356", "text": "func NewSession(conn net.Conn) *Session {\n\tid := fmt.Sprintf(\"%x\", md5.Sum([]byte(conn.LocalAddr().String()+\"::\"+conn.RemoteAddr().String())))\n\treturn &Session{\n\t\tcount: 0,\n\t\tid: id,\n\t\tvals: make(map[string]interface{}),\n\t}\n}", "title": "" }, { "docid": "fa7864329fac3187f571e3a16431853f", "score": "0.64629495", "text": "func NewSession(conn *xorm.Engine) *Session {\n\treturn &Session{\n\t\tengine: conn,\n\t}\n}", "title": "" }, { "docid": "871aaeeb9e5776f184794bfdf176ae51", "score": "0.6458493", "text": "func NewSession() (*Session, context.Context) {\n\tcallHandlingCtx, callHandlingCancel := context.WithCancel(context.Background())\n\tcalls := &Session{\n\t\tcallMap: callMap{},\n\t\tstats: expvar.NewMap(\"stats\"),\n\t\tcallHandlingCancel: callHandlingCancel,\n\t}\n\texpvar.Publish(\"calls\", calls.callMap)\n\treturn calls, callHandlingCtx\n}", "title": "" }, { "docid": "31f52a41d2abdabdd3c74ab401ff301a", "score": "0.645789", "text": "func NewSession() (*Session, error) {\n\treturn NewSessionWithContext(context.Background())\n}", "title": "" }, { "docid": "c7ec6b47bcbc1402ae34d27834d696db", "score": "0.64544636", "text": "func NewSession(apikey string) (*Session, error) {\n\turl, err := url.Parse(`https://ury.org.uk/api/v2`)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\treturn &Session{requester: api.NewRequester(apikey, *url)}, nil\n}", "title": "" }, { "docid": "35ea2529ca1d32499bb01fe238ce2f13", "score": "0.64437914", "text": "func (s *SessionManager) NewSession(ctx context.Context, conn *mysql.Conn) error {\n\tvar err error\n\n\ts.mu.Lock()\n\tdefer s.mu.Unlock()\n\ts.sessions[conn.ConnectionID], s.idxRegs[conn.ConnectionID], s.viewRegs[conn.ConnectionID], err = s.builder(ctx, conn, s.addr)\n\n\treturn err\n}", "title": "" }, { "docid": "7aafc7122b56098fdef4d74afbfce795", "score": "0.6436442", "text": "func NewSession(name, business string) *LocalSession {\n\treturn &LocalSession{\n\t\tName: name,\n\t\tID: utils.GenerateID(),\n\t\tBusiness: business}\n}", "title": "" }, { "docid": "13b844520588ae878f9d0e035c245244", "score": "0.643496", "text": "func (s *Server) newSession(engine *gin.Engine) {\n\t// store := cookie.NewStore([]byte(\"secret\"))\n\t// store, _ := redis.NewStore(10, \"tcp\", \"localhost:6379\", \"\", []byte(\"secret\"))\n\n\ts.store, _ = gormstore.NewStore(db.DB, gormstore.Options{\n\t\tTableName: \"gin_sessions\",\n\t\tSkipCreateTable: false,\n\t}, []byte(\"secret\"))\n\n\tengine.Use(sessions.Sessions(\"gin-session\", s.store))\n\n\t// If you want periodic cleanup of expired sessions:\n\tgo s.store.PeriodicCleanup(1*time.Second, s.shutdownFinished)\n}", "title": "" }, { "docid": "84ea54db27a2b4d8c1f04c4f5f2a393d", "score": "0.64345133", "text": "func NewSession(address string, settings *Settings) (*Session, error) {\n\tlogger := NewLogger(settings.LoggingLevel)\n\n\tlogger.Debug(\"Validating settings\")\n\n\terr := settings.validate()\n\tif err != nil {\n\t\treturn nil, fmt.Errorf(\"invalid settings: %w\", err)\n\t}\n\n\tlogger.Debug(\"Settings configured correctly\")\n\n\tr := rand.New(rand.NewSource(time.Now().UTC().UnixNano()))\n\n\tsession := &Session{\n\t\tStats: NewStatistics(),\n\t\tlastSeq: 0,\n\t\tfinishReqs: make(chan error, 1),\n\t\tfinished: make(chan bool, 1),\n\t\tid: r.Intn(math.MaxUint16),\n\t\tbigID: r.Uint64(),\n\t\trMap: newReplyMap(),\n\t\tsettings: settings,\n\t\tiaddr: address,\n\t\tlogger: logger,\n\t\tisStarted: false,\n\t\tisFinished: false,\n\t}\n\n\tsession.AddOnStart(initStatsCb)\n\tsession.AddOnFinish(finishStatsCb)\n\n\tlogger.Infof(\"Created session with id %d, bigID %d, iaddr %s\",\n\t\tsession.id, session.bigID, session.iaddr)\n\n\treturn session, nil\n}", "title": "" }, { "docid": "45af7790529efdc58ee07c495fedf804", "score": "0.6433817", "text": "func NewSession(id uint32, conn net.Conn, protocol PacketProtocol, sendChanSize uint, readBufferSize int) *Session {\r\n\tif readBufferSize > 0 {\r\n\t\tconn = NewBufferConn(conn, readBufferSize)\r\n\t}\r\n\r\n\tsession := &Session{\r\n\t\tid: id,\r\n\t\tconn: conn,\r\n\t\tprotocol: protocol,\r\n\t\twriter: protocol.NewWriter(),\r\n\t\treader: protocol.NewReader(),\r\n\t\tsendPacketChan: make(chan []byte, sendChanSize),\r\n\t\tcloseChan: make(chan int),\r\n\t}\r\n\r\n\tgo session.sendLoop()\r\n\r\n\treturn session\r\n}", "title": "" }, { "docid": "7e14490acdaaca5fb4d11789ee7606e6", "score": "0.6428828", "text": "func NewSession(config input.SessionConfig) (*Session, error) {\n\tdv, ok := config.Device.(Device)\n\tif !ok {\n\t\treturn nil, fmt.Errorf(\"device is on unknown type %T\", config.Device)\n\t}\n\n\t// Free up the device inside the config.\n\tconfig.Device = nil\n\n\treturn &Session{\n\t\tdv,\n\t\tconfig,\n\t}, nil\n}", "title": "" }, { "docid": "8bb8df21171689864008cf622ad2ccbe", "score": "0.64229167", "text": "func NewMockSession() (Session, error) {\n\treturn CreateMockSession(), nil\n}", "title": "" }, { "docid": "1b58fd1c171e0f23baf387a77edf139d", "score": "0.6416465", "text": "func (s *SessionStore) NewSession() auth.Session {\n\tsn := Session{\n\t\tid: uuid.New().String(),\n\t\tdata: make(map[string]string),\n\t}\n\ts.sessions[sn.id] = &sn\n\treturn &sn\n}", "title": "" }, { "docid": "9b5bf265c206a7b0cc82007c6aba44b2", "score": "0.63696927", "text": "func NewSession() *RedisSession {\n\tconnection := pool.Get()\n\treturn &RedisSession{connection}\n}", "title": "" }, { "docid": "79d081ec4e0fec672a616c41175b0c6b", "score": "0.63684505", "text": "func NewSession(node *Node, conn Connection, url string, headers *map[string]string, uid string, opts ...SessionOption) *Session {\n\tsession := &Session{\n\t\tconn: conn,\n\t\tmetrics: node.metrics,\n\t\tenv: common.NewSessionEnv(url, headers),\n\t\tsubscriptions: NewSubscriptionState(),\n\t\tsendCh: make(chan *ws.SentFrame, 256),\n\t\tclosed: false,\n\t\tConnected: false,\n\t\tpingInterval: time.Duration(node.config.PingInterval) * time.Second,\n\t\tpingTimestampPrecision: node.config.PingTimestampPrecision,\n\t\t// Use JSON by default\n\t\tencoder: encoders.JSON{},\n\t\t// Use Action Cable executor by default (implemented by node)\n\t\texecutor: node,\n\t}\n\n\tsession.uid = uid\n\n\tctx := node.log.WithFields(log.Fields{\n\t\t\"sid\": session.uid,\n\t})\n\n\tsession.Log = ctx\n\n\tfor _, opt := range opts {\n\t\topt(session)\n\t}\n\n\tif session.pingInterval > 0 {\n\t\tsession.startPing()\n\t}\n\n\tif !session.handshakeDeadline.IsZero() {\n\t\tval := time.Until(session.handshakeDeadline)\n\t\ttime.AfterFunc(val, session.maybeDisconnectIdle)\n\t}\n\n\tgo session.SendMessages()\n\n\treturn session\n}", "title": "" }, { "docid": "822a2c3cca47ca6b485a9d21138d47e0", "score": "0.6365377", "text": "func (c *Client) newSession(ctx context.Context) (*amqp.Session, error) {\n\tc.mu.Lock()\n\tdefer c.mu.Unlock()\n\tif c.conn != nil {\n\t\treturn c.conn.NewSession(ctx, nil) // already connected\n\t}\n\tconn, err := amqp.Dial(ctx, \"amqps://\"+c.sak.HostName, &amqp.ConnOptions{\n\t\tTLSConfig: c.tls,\n\t\tProperties: map[string]any{\"com.microsoft:client-version\": userAgent},\n\t})\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\tdefer func() {\n\t\tif err != nil {\n\t\t\t_ = conn.Close()\n\t\t}\n\t}()\n\n\tc.logger.Debugf(\"connected to %s\", c.sak.HostName)\n\tif err = c.putTokenContinuously(ctx, conn); err != nil {\n\t\treturn nil, err\n\t}\n\n\tsess, err := conn.NewSession(ctx, nil)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\tc.conn = conn\n\treturn sess, nil\n}", "title": "" }, { "docid": "5e9504908c908c000575578c268a763f", "score": "0.63575155", "text": "func NewSession(vault cvault.Session) (Session, error) {\n\temailConfig, err := vault.ReadMap(\"/kv/data/wikipedia/email\")\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\tserver, worked := emailConfig[\"SMTPServer\"].(string)\n\tif !worked || len(server) <= 0 {\n\t\treturn nil, errors.New(\"Could not load 'SMTPServer' from Vault\")\n\t}\n\n\tport, worked := emailConfig[\"ServerPort\"].(string)\n\tif !worked || len(port) <= 0 {\n\t\treturn nil, errors.New(\"Could not load 'ServerPort' from Vault\")\n\t}\n\n\temail, worked := emailConfig[\"Email\"].(string)\n\tif !worked || len(email) <= 0 {\n\t\treturn nil, errors.New(\"Could not load 'Email' from Vault\")\n\t}\n\n\tpassword, worked := emailConfig[\"Password\"].(string)\n\tif !worked || len(password) <= 0 {\n\t\treturn nil, errors.New(\"Could not load 'Password' from Vault\")\n\t}\n\n\temailAuth := smtp.PlainAuth(\"\", email, password, server)\n\n\treturn &session{\n\t\tSMTPServer: server + \":\" + port,\n\t\tSourceEmail: email,\n\t\tAuth: emailAuth,\n\t}, nil\n}", "title": "" }, { "docid": "515e2451a43ada99b7f03cadbccbcd0f", "score": "0.6354944", "text": "func newSession(shell string) (s session, err error) {\n\tcmd := exec.Command(shell)\n\tptmx, err := pty.Start(cmd)\n\tif err != nil {\n\t\treturn\n\t}\n\ts = session{ptmx, cmd.Process.Pid}\n\treturn\n}", "title": "" }, { "docid": "c8ddf06a898d3373e1ebc06c8e68c52d", "score": "0.6352278", "text": "func (s *Store) New(req *http.Request, name string) (*sessions.Session, error) {\n\tsession := sessions.NewSession(s, name)\n\topts := *s.opts\n\tsession.Options = &opts\n\tsession.IsNew = true\n\tvar err error\n\tif cookie, errCookie := req.Cookie(name); errCookie == nil {\n\t\tif err = securecookie.DecodeMulti(name, cookie.Value, &session.ID, s.codecs...); err == nil {\n\t\t\tvar ts = core.Session{}\n\t\t\tts.UUID = session.ID\n\t\t\tif err := s.repo.GetSession(&ts); err == nil {\n\t\t\t\tsession.IsNew = false\n\t\t\t\terr = securecookie.DecodeMulti(name, ts.Values, &session.Values, s.codecs...)\n\t\t\t} else if err != se.ErrNotFound {\n\t\t\t\treturn session, err\n\t\t\t}\n\t\t}\n\t}\n\treturn session, err\n}", "title": "" } ]
289e1cd1a7812f016c1d736cc3054d99
NewAddKeyNotFound creates AddKeyNotFound with default headers values
[ { "docid": "7ad9731c9c5466f6bedebfb958c7a249", "score": "0.6976615", "text": "func NewAddKeyNotFound() *AddKeyNotFound {\n\n\treturn &AddKeyNotFound{}\n}", "title": "" } ]
[ { "docid": "7417ae2fe842b1feab9eda2c456c5aea", "score": "0.613826", "text": "func (d *Directive) AddKeyDoesNotExist(key string) {\n\tif len(d.KeyDoesNotExist) == 0 {\n\t\td.KeyDoesNotExist = make(map[string]bool)\n\t}\n\td.KeyDoesNotExist[key] = true\n}", "title": "" }, { "docid": "f5ee83fb6b470ea23fe7b34e7c2ce203", "score": "0.59990275", "text": "func (table *CacheTable) NotFoundAdd(key interface{}, lifeSpan time.Duration, data interface{}) bool {\n\ttable.Lock()\n\n\tif _, ok := table.items[key]; ok {\n\t\ttable.Unlock()\n\t\treturn false\n\t}\n\n\titem := NewCacheItem(key, lifeSpan, data)\n\ttable.addInternal(item)\n\n\treturn true\n}", "title": "" }, { "docid": "179f95fb75a8e6974db79884516cdbb1", "score": "0.59457016", "text": "func NewCreateNewAPIKeyNotFound() *CreateNewAPIKeyNotFound {\n\treturn &CreateNewAPIKeyNotFound{}\n}", "title": "" }, { "docid": "e69128223c75155fb92ef1ea15192c89", "score": "0.5924118", "text": "func NewKeyNotFoundError() error {\n\treturn &KeyInvaildError{s: \"key is not found\"}\n}", "title": "" }, { "docid": "06974742166cb44884a3ff241683101b", "score": "0.5871711", "text": "func addCustom(givenKeys map[string]keyfunc.GivenKey, kid string) (key string) {\n\tkey = \"\"\n\tgivenKeys[kid] = keyfunc.NewGivenCustom(key)\n\treturn key\n}", "title": "" }, { "docid": "672341b59ee3747180d46f2c4de6e15a", "score": "0.58632463", "text": "func newMissingKeyError(key string) error {\n\treturn newError(ERR_MISSING_KEY, \"missing %q\", key)\n}", "title": "" }, { "docid": "ae92f13c65cd9af75fa9dc3edf1d3d8d", "score": "0.5861582", "text": "func newMissingKeyAction(name string) MissingKeyAction {\n\tmissingKeyNames = append(missingKeyNames, name)\n\treturn MissingKeyAction(len(missingKeyNames) - 1)\n}", "title": "" }, { "docid": "b9d173d943113929cf6a20f8b90adfb7", "score": "0.5760347", "text": "func addHeaderIfMissing(\n\tkey, value string,\n\theaders []*envoycore.HeaderValueOption,\n) []*envoycore.HeaderValueOption {\n\tfor _, hvo := range headers {\n\t\tif hvo.GetHeader() == nil {\n\t\t\tcontinue\n\t\t}\n\t\tif hvo.GetHeader().GetKey() != key {\n\t\t\tcontinue\n\t\t}\n\t\tif hvo.GetHeader().GetValue() == value {\n\t\t\treturn headers\n\t\t}\n\t}\n\n\treturn append(headers, &envoycore.HeaderValueOption{\n\t\tHeader: &envoycore.HeaderValue{\n\t\t\tKey: key,\n\t\t\tValue: value,\n\t\t},\n\t\tAppend: boolValue(false),\n\t})\n}", "title": "" }, { "docid": "6a5bbabc1076448e54914a29f7fc815b", "score": "0.5660582", "text": "func (e *InvalidConfigError) AddMissingKey(k string) {\n\te.missingKeys = append(e.missingKeys, k)\n}", "title": "" }, { "docid": "39756ba2bdc3d87af97bcedc3f2d8aca", "score": "0.56555414", "text": "func NoSuchKey(k any) error {\n\treturn noSuchKeyError{k}\n}", "title": "" }, { "docid": "8ecdbc9c53dd8b1d55af8e437ce626e1", "score": "0.5551012", "text": "func (h Header) Add(key, value string) {\n\tif h.Get(key) == \"\" {\n\t\th.Set(key, value)\n\t}\n}", "title": "" }, { "docid": "c4f7830bc5946089e70e10d65993f640", "score": "0.5526068", "text": "func (o *baseObject) addResourceKey(header http.Header) {\n\tif o.resourceKey != nil {\n\t\theader.Add(\"X-Goog-Drive-Resource-Keys\", fmt.Sprintf(\"%s/%s\", o.id, *o.resourceKey))\n\t}\n}", "title": "" }, { "docid": "f3b689207107e85222e15496724f0249", "score": "0.54818946", "text": "func addKey(dl deepLoc, k any) deepLoc {\n\tdl.fullName += fmt.Sprintf(\"[%v]\", k)\n\treturn dl\n}", "title": "" }, { "docid": "bdbdf993384de2e3b7506126428c34a8", "score": "0.5430513", "text": "func (this *Agent) Add(key agent.AddedKey) error {\n\tlog.Println(\"Add\", key)\n\treturn E_UNSUPPORTED\n}", "title": "" }, { "docid": "f76b1ba6c1c1a16c0a7fa3bd4d521f62", "score": "0.54100466", "text": "func NewKeyNotFound(key string, id uint64) *KeyNotFound {\n\treturn &KeyNotFound{\n\t\tkey: key,\n\t\tid: id,\n\t}\n}", "title": "" }, { "docid": "a5070ee219607487a29d8babbfe5937e", "score": "0.54008234", "text": "func NewKeyDefault(code int) *KeyDefault {\n\tif code <= 0 {\n\t\tcode = 500\n\t}\n\n\treturn &KeyDefault{\n\t\t_statusCode: code,\n\t}\n}", "title": "" }, { "docid": "5e6af7b44d888224fb59a96903c975ac", "score": "0.5377651", "text": "func (e *ApiClientService) AddKey(name string, keyadd AccessKey) (key KeyItem, err error) {\n\turl := fmt.Sprintf(\"clients/%s/keys\", name)\n\tbody, err := JSONReader(keyadd)\n\terr = e.client.magicRequestDecoder(\"POST\", url, body, &key)\n\treturn\n}", "title": "" }, { "docid": "9b16e6aa335dffb614101d79897507c4", "score": "0.5375585", "text": "func addNonBulkRequestHeaders(req *http.Request, reqID uuid.UUID) {\n\t// Info: https://github.com/CMSgov/beneficiary-fhir-data/blob/master/docs/request-audit-headers.md\n\taddDefaultRequestHeaders(req, reqID)\n}", "title": "" }, { "docid": "d09d6de208f7375958e6640c399306c6", "score": "0.5367212", "text": "func (e *UserService) AddKey(name string, keyadd AccessKey) (key KeyItem, err error) {\n\turl := fmt.Sprintf(\"users/%s/keys\", name)\n\tbody, err := JSONReader(keyadd)\n\terr = e.client.magicRequestDecoder(\"POST\", url, body, &key)\n\treturn\n}", "title": "" }, { "docid": "94777243579112d5da42bf6470206061", "score": "0.53591985", "text": "func (tx *Transaction) AddRequestHeader(key string, value string) {\n key = strings.ToLower(key)\n tx.GetCollection(\"request_headers_names\").AddToKey(\"\", key)\n tx.GetCollection(\"request_headers\").AddToKey(key, value)\n}", "title": "" }, { "docid": "ad72897d3a0e4f9f144ed63488bad6a1", "score": "0.5346819", "text": "func newAPIKeyHeaderSecurityDefinition(secDefName, apiKeyName string) SpecSecurityDefinition {\n\treturn newAPIKeySecurityDefinition(secDefName, newAPIKeyHeader(apiKeyName))\n}", "title": "" }, { "docid": "4c138438a89366eb314ffff11139918d", "score": "0.5344918", "text": "func (g *Guestfs) Luks_add_key (device string, key string, newkey string, keyslot int) *GuestfsError {\n if g.g == nil {\n return closed_handle_error (\"luks_add_key\")\n }\n\n c_device := C.CString (device)\n defer C.free (unsafe.Pointer (c_device))\n\n c_key := C.CString (key)\n defer C.free (unsafe.Pointer (c_key))\n\n c_newkey := C.CString (newkey)\n defer C.free (unsafe.Pointer (c_newkey))\n\n r := C.guestfs_luks_add_key (g.g, c_device, c_key, c_newkey, C.int (keyslot))\n\n if r == -1 {\n return get_error_from_handle (g, \"luks_add_key\")\n }\n return nil\n}", "title": "" }, { "docid": "444c7b6439f63a88a0e61b554277a238", "score": "0.5340268", "text": "func (e KvError) KeyNotFound() bool {\n\treturn e.Code == StatusKeyNotFound\n}", "title": "" }, { "docid": "79bf1c20f600f90c173a35ee38a26cff", "score": "0.53205985", "text": "func (d *Directive) AddKeyExists(key string) {\n\tif len(d.KeyExists) == 0 {\n\t\td.KeyExists = make(map[string]bool)\n\t}\n\td.KeyExists[key] = true\n}", "title": "" }, { "docid": "0f71c174487010bdde5c428d89196153", "score": "0.52907664", "text": "func (suite *BindingHandlersSuite) TestBindingCreateMissingFieldUniqueKey() {\n\n\tpostJSON := `{\n \"service_uuid\": \"uuid1\",\n \"host\": \"host1\",\n \"auth_identifier\": \"test_dn\",\n \"auth_type\": \"x509\"\n}`\n\n\texpRespJSON := `{\n \"error\": {\n \"message\": \"binding object contains empty fields. empty value for field: unique_key\",\n \"code\": 422,\n \"status\": \"UNPROCESSABLE ENTITY\"\n }\n}`\n\n\treq, err := http.NewRequest(\"POST\", \"http://localhost:8080/bindings/b1\", bytes.NewBuffer([]byte(postJSON)))\n\tif err != nil {\n\t\tLOGGER.Error(err.Error())\n\t}\n\n\tmockstore := &stores.Mockstore{Server: \"localhost\", Database: \"test_db\"}\n\tmockstore.SetUp()\n\n\tcfg := &config.Config{}\n\t_ = cfg.ConfigSetUp(\"../config/configuration-test-files/test-conf.json\")\n\n\trouter := mux.NewRouter().StrictSlash(true)\n\tw := httptest.NewRecorder()\n\trouter.HandleFunc(\"/bindings/{name}\", WrapConfig(BindingCreate, mockstore, cfg))\n\trouter.ServeHTTP(w, req)\n\tsuite.Equal(422, w.Code)\n\tsuite.Equal(expRespJSON, w.Body.String())\n}", "title": "" }, { "docid": "3ec9bbca8959efdad957caeedb70b6d5", "score": "0.52512044", "text": "func (r *Request) AddKey(name string, value interface{}) *Request {\n\tif r.Key == nil {\n\t\tr.Key = make(map[string]interface{})\n\t}\n\tr.Key[name] = value\n\treturn r\n}", "title": "" }, { "docid": "3bfbc99c7b5a981854300be6e2ae5a46", "score": "0.5238021", "text": "func (ctx *ListKeysContext) NotFound(r error) error {\n\tctx.ResponseData.Header().Set(\"Content-Type\", \"application/vnd.goa.error\")\n\treturn ctx.ResponseData.Service.Send(ctx.Context, 404, r)\n}", "title": "" }, { "docid": "a7e75d3fa7f61a38e585d64963d41da9", "score": "0.5222587", "text": "func TestGetKeyNotFound(t *testing.T) {\n\tSetTestMode(true)\n\topen(func(db *bolt.DB, path string) {\n\t\tdb.Update(func(tx *bolt.Tx) error {\n\t\t\t_, err := tx.CreateBucket([]byte(\"widgets\"))\n\t\t\treturn err\n\t\t})\n\t\tdb.Close()\n\t\toutput := run(\"get\", path, \"widgets\", \"foo\")\n\t\tequals(t, \"key not found: foo\", output)\n\t})\n}", "title": "" }, { "docid": "682c88a9c9d7f566b322ed43a15dc073", "score": "0.52161485", "text": "func NewCreateNewAPIKeyNotAcceptable() *CreateNewAPIKeyNotAcceptable {\n\treturn &CreateNewAPIKeyNotAcceptable{}\n}", "title": "" }, { "docid": "de1c63c4e93ab57a3e9d8441da1fff48", "score": "0.51931155", "text": "func NewNotFoundErr(key string) error {\n\treturn fmt.Errorf(\"with key %s: %w\", key, ErrNotFound)\n}", "title": "" }, { "docid": "88e96228e50c37893fc0edb7dee7f2f5", "score": "0.5184359", "text": "func NewHeadNotFound(name string, id string, message string, temporary bool, timeout bool, fault bool) *goa.ServiceError {\n\tv := &goa.ServiceError{}\n\tv.Name = name\n\tv.ID = id\n\tv.Message = message\n\tv.Temporary = temporary\n\tv.Timeout = timeout\n\tv.Fault = fault\n\n\treturn v\n}", "title": "" }, { "docid": "8b93ec9d9da9c92a4b6c43877973a2da", "score": "0.5174107", "text": "func (bucket *lolrus) add(k string, exp int, v interface{}, opt sgbucket.WriteOptions) (added bool, err error) {\n\terr = bucket.Write(k, 0, exp, v, opt|sgbucket.AddOnly)\n\tif err == sgbucket.ErrKeyExists {\n\t\treturn false, nil\n\t}\n\treturn (err == nil), err\n}", "title": "" }, { "docid": "b8c1877133db6e55c14a0c7a26f96192", "score": "0.5173962", "text": "func TestImmutableConfigurationAddPropertyWithNonExistingName(t *testing.T) {\n\n\tvar nonExistingKey = \"Key4\"\n\n\tif !validImmutableConfiguration.HasProperty(nonExistingKey) {\n\t\tif !validImmutableConfiguration.AddProperty(validImmutableConfiguration.Property(nonExistingKey)).HasProperty(nonExistingKey) {\n\t\t\tt.Errorf(\"Configuration.AddProperty(...).HasProperty(\\\"%v\\\") should be true\", nonExistingKey)\n\t\t}\n\t} else {\n\t\tt.Skip(\"Configuration.HasProperty(\\\"%v\\\") should be false\", nonExistingKey)\n\t}\n}", "title": "" }, { "docid": "aeba060a1fbbd6c19f99de28d437358d", "score": "0.51707333", "text": "func NewKey(method string, u *url.URL, h http.Header) Key {\n\treturn Key{method: method, header: h, u: *u, vary: []string{}}\n}", "title": "" }, { "docid": "b177f413972063ff398abed168f03698", "score": "0.5153945", "text": "func AddKey(stub shim.ChaincodeStubInterface, id string, keysName string)(bool, error){\n\tfmt.Println(\"Entering AddKey\")\n\n\tvar maKeys[] string\n\n\tmaKeysBytes, err := stub.GetState(keysName)\n\tif err != nil || len(maKeysBytes) == 0 {\n\t\tfmt.Println(\"AddKey: keys not found for \"+keysName+\". Creating now...\")\n\t\tmaKeys = []string{}\n\t}else{\n\t\terr = json.Unmarshal(maKeysBytes, &maKeys)\n\t\tif err != nil {\n\t\t\tfmt.Println(\"AddKey: Error unmarshalling keys %s \", err)\n\t\t\treturn false, err\n\t\t}\n\t}\n\n\tmaKeys = append(maKeys, id)\n\n\tbytes, _ := json.Marshal(&maKeys)\n\t\n\terr = stub.PutState(maKeysName, bytes)\n\tif err != nil{\n\t\tfmt.Printf(\"AddKey: Error storing key: %s\", err);\n\t\treturn false, err\n\t}\n\n\treturn true, nil\n\n}", "title": "" }, { "docid": "403dd6cac5bdba355de9e9f439f9d7ec", "score": "0.5143468", "text": "func (e errstack) Add(key string, payload interface{}) {\n\te.details[key] = payload\n}", "title": "" }, { "docid": "7098ab06a62864fc0335301920aa4473", "score": "0.51255566", "text": "func TestCacheGetUnknownKey(t *testing.T) {\n\t_, err := operations.Get(\"Key\")\n\tif err == nil {\n\t\tt.Error(\"expected 'no related values' error message, got nil\")\n\t}\n\n\t// case ok\n\t_, err = operations.Upsert(\"key\", []byte(\"value\"), 0)\n\tif err != nil {\n\t\tt.Error(\"here: unexpected error\")\n\t}\n}", "title": "" }, { "docid": "e0cc7ece20302ef6c5770dd673eac1aa", "score": "0.5124335", "text": "func (node *Node) addKey(key, value string) error {\n\tnodeId, err := node.getHashKey(key)\n\tif err != nil {\n\t\treturn err\n\t}\n\tnode1, err := node.findNextNode(nodeId)\n\tif err != nil {\n\t\treturn err\n\t}\n\terr = node.addKeyRPC(node1, key, value)\n\tfmt.Println(\"----------------------------------------------------------------\")\n\thk, errhk := node.getHashKey(key)\n\tif errhk != nil {\n\t\treturn errhk\n\t} else {\n\t\tfmt.Printf(\n\t\t\t\"[Command] Add a new key:\\n\\t(%s, \\\"%s\\\")\\n\\tHashKey: %d\\n\\tFrom: %d\\n\\tTo: %d\\n\",\n\t\t\tkey,\n\t\t\tvalue,\n\t\t\t(&big.Int{}).SetBytes(hk),\n\t\t\t(&big.Int{}).SetBytes(node.NodeId),\n\t\t\t(&big.Int{}).SetBytes(node1.NodeId),\n\t\t)\n\t}\n\treturn err\n}", "title": "" }, { "docid": "03a42f59817e5368428f16c5e00d4295", "score": "0.5120933", "text": "func (v *validation) populate_headers() error {\n\n temp_headers := make(map[string]string)\n for _, k := range v.signed_headers {\n // if header doesn't exist, throw error\n if _, ok := v.request.headers[k]; ok {\n temp_headers[k] = v.request.headers[k]\n }else{\n fmt.Println(fmt.Sprintf(\"Header %s was not included in request, but request says that header was signed\",k))\n return errors.New(fmt.Sprintf(\"Header %s was not included in request, but request says that header was signed\",k))\n }\n\n }\n v.request.headers = temp_headers\n\n return nil\n}", "title": "" }, { "docid": "623e9972179102708f8fe8f0c6c8b5f1", "score": "0.51085037", "text": "func AddNewKeyRequestHandler(w http.ResponseWriter, r *http.Request) {\n\tvar kb cryptokeys.Keybase\n\tvar m NewKeyBody\n\n\tkb, err := keys.GetKeyBase()\n\tif err != nil {\n\t\tw.WriteHeader(http.StatusInternalServerError)\n\t\tw.Write([]byte(err.Error()))\n\t\treturn\n\t}\n\n\terr = utils.ReadPostBody(w, r, cdc, &m)\n\tif err != nil {\n\t\treturn\n\t}\n\n\tif m.Name == \"\" {\n\t\tw.WriteHeader(http.StatusBadRequest)\n\t\tw.Write([]byte(\"You have to specify a name for the locally stored account.\"))\n\t\treturn\n\t}\n\tif m.Password == \"\" {\n\t\tw.WriteHeader(http.StatusBadRequest)\n\t\tw.Write([]byte(\"You have to specify a password for the locally stored account.\"))\n\t\treturn\n\t}\n\n\t// check if already exists\n\tinfos, err := kb.List()\n\tfor _, i := range infos {\n\t\tif i.GetName() == m.Name {\n\t\t\tw.WriteHeader(http.StatusConflict)\n\t\t\tw.Write([]byte(fmt.Sprintf(\"Account with name %s already exists.\", m.Name)))\n\t\t\treturn\n\t\t}\n\t}\n\n\t// create account\n\tseed := m.Seed\n\tif seed == \"\" {\n\t\tseed = getSeed(cryptokeys.Secp256k1)\n\t}\n\tinfo, err := kb.CreateKey(m.Name, seed, m.Password)\n\tif err != nil {\n\t\tw.WriteHeader(http.StatusInternalServerError)\n\t\tw.Write([]byte(err.Error()))\n\t\treturn\n\t}\n\n\tkeyOutput, err := keys.Bech32KeyOutput(info)\n\tif err != nil {\n\t\tw.WriteHeader(http.StatusInternalServerError)\n\t\tw.Write([]byte(err.Error()))\n\t\treturn\n\t}\n\n\tkeyOutput.Seed = seed\n\n\tbz, err := cdc.MarshalJSONIndent(keyOutput,\"\",\" \")\n\tif err != nil {\n\t\tw.WriteHeader(http.StatusInternalServerError)\n\t\tw.Write([]byte(err.Error()))\n\t\treturn\n\t}\n\n\tw.Write(bz)\n}", "title": "" }, { "docid": "85202aece01ed434707b0e1c95ccd3e0", "score": "0.5084333", "text": "func (h *Headers) Add(key string, value interface{}) {\n\tif h.Extra == nil {\n\t\th.Extra = make(map[string]interface{})\n\t}\n\th.Extra[key] = value\n}", "title": "" }, { "docid": "5af156ced45afb6e2b927743eee71dd8", "score": "0.5076601", "text": "func addNewChild(m map[string]*yang.Entry, k string, v *yang.Entry, errs []error) []error {\n\tif _, ok := m[k]; !ok {\n\t\tm[k] = v\n\t\treturn errs\n\t}\n\terrs = append(errs, fmt.Errorf(\"%s was duplicate\", v.Path()))\n\treturn errs\n}", "title": "" }, { "docid": "ad4a5f3249e20130989f2f5d3cd7b99e", "score": "0.50656635", "text": "func NewCreateNewAPIKeyBadRequest() *CreateNewAPIKeyBadRequest {\n\treturn &CreateNewAPIKeyBadRequest{}\n}", "title": "" }, { "docid": "99bb5e0035b0705b65822368d7c38d85", "score": "0.5058837", "text": "func NewAddKeyOK() *AddKeyOK {\n\n\treturn &AddKeyOK{}\n}", "title": "" }, { "docid": "d0f3c43203c9999d2c08de1a56b5245c", "score": "0.50585675", "text": "func NewGenerateAPIKeyNotFound() *GenerateAPIKeyNotFound {\n\treturn &GenerateAPIKeyNotFound{}\n}", "title": "" }, { "docid": "7b915fc6e226d7193ed0bfbc399ddd26", "score": "0.5056444", "text": "func createKey(name, version, nodeID string) string {\n\treturn fmt.Sprintf(\"%s:%s:%s\", nodeID, name, version)\n}", "title": "" }, { "docid": "c23df9d7b8dbb1d8b96317f0e1b02886", "score": "0.50559217", "text": "func (c Config)Add(k string, v string)error{\n\tfor key := range c {\n\t\tif key == k {\n\t\t\treturn fmt.Errorf(\"key [%s] is exists\", k)\n\t\t}\n\t}\n\tc[k] = v\n\treturn nil\n}", "title": "" }, { "docid": "a369f8770b93aac165aaab845ca8b26b", "score": "0.5052892", "text": "func (cl *Transport)addHeader(req *http.Request, header map[string]string) (r *http.Request){\n for key, value := range header {\n if key != \"\" && value != \"\" {\n req.Header.Add(key, value)\n }\n }\n return req\n}", "title": "" }, { "docid": "c1cd28b27ba2ebe54cf2e2a81edbe6d0", "score": "0.5047055", "text": "func GetNewKey(length int) (error, string) {\n\tkey := middlewares.CreateKey(length)\n\n\tvar exists bool\n\t_ = config.DB.QueryRow(\"SELECT EXISTS(SELECT 1 FROM urls WHERE key = $1);\", key).Scan(&exists)\n\tfor exists == true {\n\t\tkey = middlewares.CreateKey(length)\n\t\t_ = config.DB.QueryRow(\"SELECT EXISTS(SELECT 1 FROM urls WHERE key = $1);\", key).Scan(&exists)\n\t}\n\n\treturn nil, key\n}", "title": "" }, { "docid": "4b3f8d726406f66818fb60138494eaf6", "score": "0.5044112", "text": "func NewErrKeyNotFound(name string) error {\n\treturn errKeyNotFound{\n\t\tcode: codeKeyNotFound,\n\t\tname: name,\n\t}\n}", "title": "" }, { "docid": "be0772d62b456409a7d3d84a6743c602", "score": "0.50336915", "text": "func (t *ParseResult) addKey(key string) {\n\tt.orderedkeys = append(t.orderedkeys, key)\n}", "title": "" }, { "docid": "f8ae0ebc6d78ec047b1a1c45e10b9d81", "score": "0.5028011", "text": "func (r *RequestBuilder) AddKey(b []byte) *RequestBuilder {\n\tr.keys = append(r.keys, b)\n\treturn r\n}", "title": "" }, { "docid": "8302098fe4ecd706a778bc9274e1e174", "score": "0.50268096", "text": "func TestCacheExistsUnknownKey(t *testing.T) {\n\t_, err := operations.Upsert(\"key\", []byte(\"value\"), 10*time.Second)\n\n\tif err != nil {\n\t\tt.Errorf(\"expected no errors in Upsert method, got: %v\", err.Error())\n\t}\n\n\texists, err1 := operations.Exists(\"yek\")\n\tif err1 != nil {\n\t\tif !errors.Is(err1, gokey.ErrNoExistKey) {\n\t\t\tt.Errorf(\"Ok. expected ErrNoExistKey, got: %v\", err1.Error())\n\t\t}\n\t}\n\n\tif exists {\n\t\tt.Errorf(\"Ok. expected it doesn't exists, got %t\", exists)\n\t}\n}", "title": "" }, { "docid": "badfffc8dfcdaf0642a800da428043b8", "score": "0.50178957", "text": "func (e *noDefaultTLSDataError) NotFound() {}", "title": "" }, { "docid": "180db2756f6cea33debb9ef52f851358", "score": "0.49990237", "text": "func (params *headerParams) Add(key string, val MaybeString) Params {\n\t// Add param to order list if new.\n\tif _, ok := params.params[key]; !ok {\n\t\tparams.paramOrder = append(params.paramOrder, key)\n\t}\n\n\t// Set param value.\n\tparams.params[key] = val\n\n\t// Return the params so calls can be chained.\n\treturn params\n}", "title": "" }, { "docid": "113e4cd385d1f24af544860144d9e528", "score": "0.4997099", "text": "func KeyWithHeaders(m *Middleware) {\n\tm.keyComponents.headers.enabled = true\n}", "title": "" }, { "docid": "aa44db07426ba01b317e551de9730b60", "score": "0.49861714", "text": "func ApiKeyCreate(w http.ResponseWriter, r *http.Request) {\n\n\taccount, err := utilsCr.GetWorkAccount(w,r)\n\tif err != nil || account == nil {\n\t\tu.Respond(w, u.MessageError(u.Error{Message:\"Ошибка авторизации\"}))\n\t\treturn\n\t}\n\n\tinput := struct {\n\t\tName string `json:\"name\"`\n\t\tEnabled bool `json:\"enabled\"`\n\t}{}\n\n\tif err := json.NewDecoder(r.Body).Decode(&input); err != nil {\n\t\tu.Respond(w, u.MessageError(err, \"Техническая ошибка в запросе\"))\n\t\treturn\n\t}\n\n\tapiKey, err := account.ApiKeyCreate(models.ApiKey{Name: input.Name, Enabled: input.Enabled})\n\tif err != nil {\n\t\tu.Respond(w, u.MessageError(u.Error{Message:\"Ошибка во время создания ключа\"}))\n\t\treturn\n\t}\n\n\tresp := u.Message(true, \"POST Api Key Created\")\n\tresp[\"api_key\"] = *apiKey\n\tu.Respond(w, resp)\n}", "title": "" }, { "docid": "d5211d344e7247bd8b05989a950242fc", "score": "0.49837524", "text": "func testDuplicateSkykeyAdd(t *testing.T, c client.Client) {\n\terr := skykeyAdd(c, testSkykeyString)\n\tif err != nil {\n\t\tt.Fatal(err)\n\t}\n\n\terr = skykeyAdd(c, testSkykeyString)\n\tif !strings.Contains(err.Error(), skykey.ErrSkykeyWithIDAlreadyExists.Error()) {\n\t\tt.Fatal(\"Expected duplicate name error but got\", err)\n\t}\n}", "title": "" }, { "docid": "ddb3b3d2cf983b11c073a9fb8fbbff75", "score": "0.49811113", "text": "func newErrNotFound(msg string, err error) error {\n\treturn &ErrNotFound{\n\t\tmyError: myError{\n\t\t\tmsg: msg,\n\t\t\twerr: err,\n\t\t},\n\t}\n}", "title": "" }, { "docid": "554d73b981f2d03131bcc83f008571ef", "score": "0.49703547", "text": "func (a *AuditedHeadersConfig) add(ctx context.Context, header string, hmac bool) error {\n\tif header == \"\" {\n\t\treturn fmt.Errorf(\"header value cannot be empty\")\n\t}\n\n\t// Grab a write lock\n\ta.Lock()\n\tdefer a.Unlock()\n\n\tif a.Headers == nil {\n\t\ta.Headers = make(map[string]*auditedHeaderSettings, 1)\n\t}\n\n\ta.Headers[strings.ToLower(header)] = &auditedHeaderSettings{hmac}\n\tentry, err := logical.StorageEntryJSON(auditedHeadersEntry, a.Headers)\n\tif err != nil {\n\t\treturn errwrap.Wrapf(\"failed to persist audited headers config: {{err}}\", err)\n\t}\n\n\tif err := a.view.Put(ctx, entry); err != nil {\n\t\treturn errwrap.Wrapf(\"failed to persist audited headers config: {{err}}\", err)\n\t}\n\n\treturn nil\n}", "title": "" }, { "docid": "a3b107485b392ed1b3e8e1a265a16ba8", "score": "0.49621356", "text": "func addItem(key string, value string) error { // Adding item to map\n\tif len(key) == 0 {\n\t\treturn errors.New(\"addItem: Key has length 0\") // failed\n\t}\n\t_, ok := itemMap[key] // value, exists\n\tif !ok { // item name not used yet\n\t\titemMap[key] = value\n\t\treturn nil // success\n\t}\n\treturn errors.New(\"addItem: Item exists\") // failed\n}", "title": "" }, { "docid": "e4d6425a62f135a64de08f072f84435f", "score": "0.49558195", "text": "func Test_addOrUpdateNode_new_node_custom_networking_eniConfig_notfound(t *testing.T) {\n\tctrl := gomock.NewController(t)\n\tdefer ctrl.Finish()\n\n\tmanager, mockK8sWrapper, _ := getMockManagerWithK8sWrapper(ctrl)\n\n\tnodeWithENIConfig := v1Node.DeepCopy()\n\tnodeWithENIConfig.Labels[config.CustomNetworkingLabel] = eniConfigName\n\tnodeWithENIConfig.Labels[eniConfig.Spec.Subnet] = subnetID\n\n\tmockK8sWrapper.EXPECT().GetENIConfig(eniConfigName).Return(nil, mockError)\n\t_, err := manager.addOrUpdateNode(nodeWithENIConfig)\n\t_, isPresent := manager.GetNode(v1Node.Name)\n\n\tassert.Error(t, mockError, err)\n\tassert.False(t, isPresent)\n}", "title": "" }, { "docid": "8fe54f2f21a4f3082c9ffc56c96b00ac", "score": "0.49520522", "text": "func addKeyToUser(w http.ResponseWriter, r *http.Request, t *auth.Token) error {\n\tcontent, err := getKeyFromBody(r.Body)\n\tif err != nil {\n\t\treturn err\n\t}\n\tu, err := t.User()\n\tif err != nil {\n\t\treturn err\n\t}\n\trec.Log(u.Email, \"add-key\", content)\n\tkey := auth.Key{Content: content}\n\tif u.HasKey(key) {\n\t\treturn &errors.HTTP{Code: http.StatusConflict, Message: \"User already has this key\"}\n\t}\n\tactions := []*action.Action{\n\t\t&addKeyInGandalfAction,\n\t\t&addKeyInDatabaseAction,\n\t}\n\tpipeline := action.NewPipeline(actions...)\n\treturn pipeline.Execute(&key, u)\n}", "title": "" }, { "docid": "b5936b038d0eac995a9fc09a6fc21ac1", "score": "0.4948719", "text": "func (a DefaultApi) AddKeyPair(authorization string, clusterId string, body V4AddKeyPairBody, xRequestID string, xGiantSwarmActivity string, xGiantSwarmCmdLine string) (*V4AddKeyPairResponse, *APIResponse, error) {\n\n\tvar localVarHttpMethod = strings.ToUpper(\"Post\")\n\t// create path and map variables\n\tlocalVarPath := a.Configuration.BasePath + \"/v4/clusters/{cluster_id}/key-pairs/\"\n\tlocalVarPath = strings.Replace(localVarPath, \"{\"+\"cluster_id\"+\"}\", fmt.Sprintf(\"%v\", clusterId), -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// add default headers if any\n\tfor key := range a.Configuration.DefaultHeader {\n\t\tlocalVarHeaderParams[key] = a.Configuration.DefaultHeader[key]\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 := 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}\n\n\t// set Accept header\n\tlocalVarHttpHeaderAccept := a.Configuration.APIClient.SelectHeaderAccept(localVarHttpHeaderAccepts)\n\tif localVarHttpHeaderAccept != \"\" {\n\t\tlocalVarHeaderParams[\"Accept\"] = localVarHttpHeaderAccept\n\t}\n\t// header params \"Authorization\"\n\tlocalVarHeaderParams[\"Authorization\"] = a.Configuration.APIClient.ParameterToString(authorization, \"\")\n\t// header params \"X-Request-ID\"\n\tlocalVarHeaderParams[\"X-Request-ID\"] = a.Configuration.APIClient.ParameterToString(xRequestID, \"\")\n\t// header params \"X-Giant-Swarm-Activity\"\n\tlocalVarHeaderParams[\"X-Giant-Swarm-Activity\"] = a.Configuration.APIClient.ParameterToString(xGiantSwarmActivity, \"\")\n\t// header params \"X-Giant-Swarm-CmdLine\"\n\tlocalVarHeaderParams[\"X-Giant-Swarm-CmdLine\"] = a.Configuration.APIClient.ParameterToString(xGiantSwarmCmdLine, \"\")\n\t// body params\n\tlocalVarPostBody = &body\n\tvar successPayload = new(V4AddKeyPairResponse)\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: \"AddKeyPair\", 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": "7302d9d714e94c53db5039a591dc3e84", "score": "0.49465352", "text": "func (c *CuckooIndex) addNew(key unsafe.Pointer, recordID memCom.RecordID, eventTime uint32) (added bool, hashResults [memCom.NumHashes]hashResult) {\n\tfor hashIndex := 0; hashIndex < memCom.NumHashes; hashIndex++ {\n\t\thashResult := c.hash(key, hashIndex)\n\t\thashResults[hashIndex] = hashResult\n\t\tfor i := 0; i < memCom.BucketSize; i++ {\n\t\t\tif c.isEmpty(hashResult.bucket, i) {\n\t\t\t\tc.insertBucket(key, recordID, hashResult.signature, eventTime, hashResult.bucket, i)\n\t\t\t\tc.numBucketEntries++\n\t\t\t\tadded = true\n\t\t\t\treturn\n\t\t\t} else if c.recordExpired(hashResult.bucket, i) {\n\t\t\t\tc.insertBucket(key, recordID, hashResult.signature, eventTime, hashResult.bucket, i)\n\t\t\t\tadded = true\n\t\t\t\treturn\n\t\t\t}\n\t\t}\n\t}\n\treturn\n}", "title": "" }, { "docid": "7925dcd29708c017694e7f76434a508f", "score": "0.49438545", "text": "func (c *CuckooIndex) findOrAddNew(key unsafe.Pointer, value memCom.RecordID, eventTime uint32) (existingFound bool, added bool, recordID memCom.RecordID, hashResults [memCom.NumHashes]hashResult) {\n\tindexToInsert := -1\n\tisInsert := false\n\tvar bucketToInsert unsafe.Pointer\n\tvar signatureToInsert uint8\n\n\t// look for existing record in buckets with all hash functions\n\t// mark potential slot to insert new record\n\tfor hashIndex := 0; hashIndex < memCom.NumHashes; hashIndex++ {\n\t\thashResult := c.hash(key, hashIndex)\n\t\thashResults[hashIndex] = hashResult\n\t\tfor i := 0; i < memCom.BucketSize; i++ {\n\t\t\tisEmpty := c.isEmpty(hashResult.bucket, i)\n\t\t\tif isEmpty || c.recordExpired(hashResult.bucket, i) {\n\t\t\t\tif indexToInsert < 0 {\n\t\t\t\t\tindexToInsert = i\n\t\t\t\t\tbucketToInsert = hashResult.bucket\n\t\t\t\t\tsignatureToInsert = hashResult.signature\n\t\t\t\t\tisInsert = isEmpty\n\t\t\t\t}\n\t\t\t} else if *c.getSignature(hashResult.bucket, i) == hashResult.signature && utils.MemEqual(c.getKey(hashResult.bucket, i), key, c.keyBytes) {\n\t\t\t\texistingFound = true\n\t\t\t\trecordID = *c.getRecordID(hashResult.bucket, i)\n\t\t\t\treturn\n\t\t\t}\n\t\t}\n\t}\n\n\t// look for existing record in stash\n\tfor i := 0; i < stashSize; i++ {\n\t\tif !c.recordExpired(c.stash, i) && !c.isEmpty(c.stash, i) &&\n\t\t\tutils.MemEqual(c.getKey(c.stash, i), key, c.keyBytes) {\n\t\t\texistingFound = true\n\t\t\trecordID = *c.getRecordID(c.stash, i)\n\t\t\treturn\n\t\t}\n\t}\n\n\tif indexToInsert >= 0 {\n\t\tc.insertBucket(key, value, signatureToInsert, eventTime, bucketToInsert, indexToInsert)\n\t\tif isInsert {\n\t\t\tc.numBucketEntries++\n\t\t}\n\t\tadded = true\n\t\trecordID = value\n\t}\n\n\treturn\n}", "title": "" }, { "docid": "1740703ad9348972ec2050bfc72f9d97", "score": "0.494379", "text": "func NewPostMissingHeader(name string, id string, message string, temporary bool, timeout bool, fault bool) *goa.ServiceError {\n\tv := &goa.ServiceError{}\n\tv.Name = name\n\tv.ID = id\n\tv.Message = message\n\tv.Temporary = temporary\n\tv.Timeout = timeout\n\tv.Fault = fault\n\n\treturn v\n}", "title": "" }, { "docid": "89fad3a00c6fcad53988f340d995012a", "score": "0.49423438", "text": "func (r *GoHeader) Add(key string, value string) {\n\tif r.isResponse {\n\t\tr.Source.(*GoResponse).Original.Header().Add(key, value)\n\t}\n}", "title": "" }, { "docid": "0d3d51f0b9552a985c7cfb97d3335b48", "score": "0.4927112", "text": "func keyNotFound(err error) bool {\n\tif err != nil {\n\t\tif etcdError, ok := err.(etcd.Error); ok {\n\t\t\tif etcdError.Code == etcd.ErrorCodeKeyNotFound ||\n\t\t\t\tetcdError.Code == etcd.ErrorCodeNotFile ||\n\t\t\t\tetcdError.Code == etcd.ErrorCodeNotDir {\n\t\t\t\treturn true\n\t\t\t}\n\t\t}\n\t}\n\treturn false\n}", "title": "" }, { "docid": "0d43dbb60f32ecb49a741c54878a391c", "score": "0.49262083", "text": "func AppendMinKeyElement(dst []byte, key string) []byte { return AppendHeader(dst, TypeMinKey, key) }", "title": "" }, { "docid": "0669e78ead90a2679efb75ea54afa4d8", "score": "0.49223128", "text": "func (tt *MultiTokenTransfer) AddIfNotFound() (err error) {\n\tquery := `insert into multi_tokens (txhash,lookup_id,tokenid,blocknumber,index,operator,source,dest,amount,timestamp) \n\t\t\t\t\tvalues ($1,$2,$3,$4,$5,$6,$7,$8,$9,$10) on conflict do nothing`\n\tctx, cancel := context.WithTimeout(context.Background(), timeout())\n\tdefer cancel()\n\n\t_, err = db.ExecContext(ctx, query, tt.TxHash, tt.LookupID, tt.TokenID, tt.BlockNumber, tt.TxIndex, &tt.Operator, tt.Source, tt.Dest, tt.Quantity, tt.Timestamp)\n\treturn\n}", "title": "" }, { "docid": "99928f03b17ffede78823eeaea62e6d5", "score": "0.4922008", "text": "func (v *Map) addKey(key string) {\n\tv.keysMu.Lock()\n\tdefer v.keysMu.Unlock()\n\t// Using insertion sort to place key into the already-sorted v.keys.\n\tif i := sort.SearchStrings(v.keys, key); i >= len(v.keys) {\n\t\tv.keys = append(v.keys, key)\n\t} else if v.keys[i] != key {\n\t\tv.keys = append(v.keys, \"\")\n\t\tcopy(v.keys[i+1:], v.keys[i:])\n\t\tv.keys[i] = key\n\t}\n}", "title": "" }, { "docid": "05cc0476f125b6fac6bcb9fb18b47756", "score": "0.4916639", "text": "func addKeyFromLiteral(configMap *v1.ConfigMap, keyName, data string) error {\n\tif _, entryExists := configMap.Data[keyName]; entryExists {\n\t\treturn trace.BadParameter(\"cannot add key %s, another key by that name already exists: %v.\", keyName, configMap.Data)\n\t}\n\tconfigMap.Data[keyName] = data\n\treturn nil\n}", "title": "" }, { "docid": "83a70c8182a542c5355929e1499a23e9", "score": "0.49155962", "text": "func newKey(kind, stringID string, intID int64, datasetID, name string, namespace string) *Key {\n\treturn &Key{\n\t\tkind: kind,\n\t\tstringID: stringID,\n\t\tname: name,\n\t\tintID: intID,\n\t\tdatasetID: datasetID,\n\t\tnamespace: namespace,\n\t}\n}", "title": "" }, { "docid": "cc70120d40e4a9c588cabd5ec5aba527", "score": "0.491532", "text": "func (gn *Generator) scriptKeyAlreadyExists() bool {\n\tvar (\n\t\tkey = gn.genKey()\n\t\trpath = gn.conf.GetURL()\n\t\tkpath = gn.conf.GetURL(key)\n\t\tvalue = &models.Object{\n\t\t\tName: \"Rob\",\n\t\t\tData: \"Intel\",\n\t\t}\n\t)\n\tif !gn.doGet(kpath, 404, nil) {\n\t\treturn false\n\t}\n\tif !gn.doPost(rpath, 200, &models.Message{\n\t\tKey: key,\n\t\tValue: value,\n\t}) {\n\t\treturn false\n\t}\n\tif !gn.doPost(rpath, 409, &models.Message{\n\t\tKey: key,\n\t\tValue: value,\n\t}) {\n\t\treturn false\n\t}\n\treturn true\n}", "title": "" }, { "docid": "ae91d7cc3a767a5ff95adf243b505bc7", "score": "0.49128047", "text": "func TestImmutableConfigurationAddPropertyWithExistingName(t *testing.T) {\n\n\tvar existingKey = \"Key3\"\n\n\tif validImmutableConfiguration.HasProperty(existingKey) {\n\t\tif !validImmutableConfiguration.AddProperty(validImmutableConfiguration.Property(existingKey)).HasProperty(existingKey) {\n\t\t\tt.Errorf(\"Configuration.AddProperty(...).HasProperty(\\\"%v\\\") should be true\", existingKey)\n\t\t}\n\t} else {\n\t\tt.Skip(\"Configuration.HasProperty(\\\"%v\\\") should be true\", existingKey)\n\t}\n}", "title": "" }, { "docid": "2736b55604b92722fe1bbd0e4e242ee6", "score": "0.490957", "text": "func newKey(keys ...string) string {\n\tfinal := \"\"\n\tfor index, key := range keys {\n\t\tif index < 1 {\n\t\t\tfinal = key\n\t\t} else {\n\t\t\tfinal += \":\" + key\n\t\t}\n\t}\n\treturn final\n}", "title": "" }, { "docid": "107598dffd54788134b01c2ef4f88c24", "score": "0.49044615", "text": "func addDeployKey(ctx context.Context, keyID, repoID int64, name, fingerprint string, mode perm.AccessMode) (*DeployKey, error) {\n\tif err := checkDeployKey(ctx, keyID, repoID, name); err != nil {\n\t\treturn nil, err\n\t}\n\n\tkey := &DeployKey{\n\t\tKeyID: keyID,\n\t\tRepoID: repoID,\n\t\tName: name,\n\t\tFingerprint: fingerprint,\n\t\tMode: mode,\n\t}\n\treturn key, db.Insert(ctx, key)\n}", "title": "" }, { "docid": "ea9fbeb0dc0b555516adc05ee735de72", "score": "0.49039185", "text": "func (b *DynamoDBBackend) createKey(fullPath string, val []byte, ttl time.Duration, overwrite bool) error {\n\tr := record{\n\t\tHashKey: hashKey,\n\t\tFullPath: fullPath,\n\t\tValue: val,\n\t\tTTL: ttl,\n\t\tTimestamp: time.Now().UTC().Unix(),\n\t}\n\tif ttl != backend.Forever {\n\t\tr.Expires = aws.Int64(b.clock.Now().UTC().Add(ttl).Unix())\n\t}\n\tav, err := dynamodbattribute.MarshalMap(r)\n\tif err != nil {\n\t\treturn trace.Wrap(err)\n\t}\n\tinput := dynamodb.PutItemInput{\n\t\tItem: av,\n\t\tTableName: aws.String(b.Tablename),\n\t}\n\tif !overwrite {\n\t\tinput.SetConditionExpression(\"attribute_not_exists(FullPath)\")\n\t}\n\t_, err = b.svc.PutItem(&input)\n\terr = convertError(err)\n\tif err != nil {\n\t\treturn trace.Wrap(err)\n\t}\n\treturn nil\n}", "title": "" }, { "docid": "8209c82db2c5bc11161ecb7aa45b8c0d", "score": "0.48968273", "text": "func testAddRemoveKeyEx(ctx context.Context, utility *hwsec.CryptohomeClient, hf *files.HomedirFiles) error {\n\t// AddKeyEx shouldn't work if password is incorrect.\n\tif err := utility.AddVaultKey(ctx, util.FirstUsername, util.IncorrectPassword, util.Password1Label, util.FirstPassword2, util.Password2Label, false); err == nil {\n\t\treturn errors.New(\"add key succeeded when it shouldn't\")\n\t}\n\n\t// AddKey should work if everything is correct.\n\tif err := utility.AddVaultKey(ctx, util.FirstUsername, util.FirstPassword1, util.Password1Label, util.FirstPassword2, util.Password2Label, false); err != nil {\n\t\treturn errors.Wrap(err, \"failed to add keys\")\n\t}\n\tif err := checkKeysLabels(ctx, utility, []string{util.Password1Label, util.Password2Label}); err != nil {\n\t\treturn errors.Wrap(err, \"list of keys is incorrect after adding key\")\n\t}\n\n\t// Mount and unmount with the new key.\n\tif err := checkMountState(ctx, utility, hf, false); err != nil {\n\t\treturn errors.Wrap(err, \"vault mounted before testing AddKeyEx\")\n\t}\n\tif err := utility.MountVault(ctx, util.Password2Label, hwsec.NewPassAuthConfig(util.FirstUsername, util.FirstPassword2), false, hwsec.NewVaultConfig()); err != nil {\n\t\treturn errors.Wrap(err, \"failed to mount vault with the added key\")\n\t}\n\tif err := checkMountState(ctx, utility, hf, true); err != nil {\n\t\treturn errors.Wrap(err, \"vault not mounted after mounting with added key\")\n\t}\n\n\t// CheckKeyEx should work correctly with both the new and old key.\n\tif err := testCheckKeyEx(ctx, utility, util.FirstUsername, util.Password1Label, util.FirstPassword1, util.IncorrectPassword); err != nil {\n\t\treturn errors.Wrap(err, \"old key malfunctions while mounted with added key\")\n\t}\n\tif err := testCheckKeyEx(ctx, utility, util.FirstUsername, util.Password2Label, util.FirstPassword2, util.IncorrectPassword); err != nil {\n\t\treturn errors.Wrap(err, \"new key malfunctions while mounted with added key\")\n\t}\n\t// Now unmount it.\n\tif err := unmountTestVault(ctx, utility, hf); err != nil {\n\t\treturn errors.Wrap(err, \"failed to unmount\")\n\t}\n\n\t// The old key should still work as expected.\n\tif err := utility.MountVault(ctx, util.Password1Label, hwsec.NewPassAuthConfig(util.FirstUsername, util.FirstPassword1), false, hwsec.NewVaultConfig()); err != nil {\n\t\treturn errors.Wrap(err, \"failed to mount vault with the old key after adding pin\")\n\t}\n\tif err := checkMountState(ctx, utility, hf, true); err != nil {\n\t\treturn errors.Wrap(err, \"vault not mounted after mounting with old key after adding new key\")\n\t}\n\t// CheckKeyEx should work correctly with both the new and old key.\n\tif err := testCheckKeyEx(ctx, utility, util.FirstUsername, util.Password1Label, util.FirstPassword1, util.IncorrectPassword); err != nil {\n\t\treturn errors.Wrap(err, \"old key malfunctions while mounted with old key\")\n\t}\n\tif err := testCheckKeyEx(ctx, utility, util.FirstUsername, util.Password2Label, util.FirstPassword2, util.IncorrectPassword); err != nil {\n\t\treturn errors.Wrap(err, \"new key malfunctions while mounted with old key\")\n\t}\n\tif err := unmountTestVault(ctx, utility, hf); err != nil {\n\t\treturn errors.Wrap(err, \"failed to unmount\")\n\t}\n\n\t// RemoveKeyEx should work, and test everything is alright after removing the key.\n\tif err := utility.RemoveVaultKey(ctx, util.FirstUsername, util.FirstPassword1, util.Password2Label); err != nil {\n\t\treturn errors.Wrap(err, \"failed to remove key\")\n\t}\n\tif err := utility.MountVault(ctx, util.Password2Label, hwsec.NewPassAuthConfig(util.FirstUsername, util.FirstPassword2), false, hwsec.NewVaultConfig()); err == nil {\n\t\treturn errors.New(\"still can mount vault with removed key\")\n\t}\n\tif err := checkMountState(ctx, utility, hf, false); err != nil {\n\t\treturn errors.Wrap(err, \"vault mounted after unmounting and failed mount\")\n\t}\n\n\treturn nil\n}", "title": "" }, { "docid": "d01e6f4c55c6756f417b90705340b168", "score": "0.48963267", "text": "func TestMissingHeader(t *testing.T) {\n\thandlers := defaultHandlers()\n\tconfigItem := makeConfigurationItem(\"foo\", \"foo\", 0, []byte(\"foo\"), defaultChain)\n\tconfigItem.Header = nil\n\tdata, _ := proto.Marshal(configItem)\n\t_, err := NewConfigurationManager(&cb.ConfigurationEnvelope{\n\t\tItems: []*cb.SignedConfigurationItem{&cb.SignedConfigurationItem{ConfigurationItem: data}},\n\t}, &mockPolicyManager{&mockPolicy{}}, handlers)\n\n\tif err == nil {\n\t\tt.Errorf(\"Should have errored creating the configuration manager because of the missing header\")\n\t}\n}", "title": "" }, { "docid": "0b60dda73775d340311aa431da618196", "score": "0.4884982", "text": "func (d *Downloaded) AddHeader(key string, value string) {\n\tif d.header == nil {\n\t\td.header = make(http.Header)\n\t}\n\n\td.header.Add(key, value)\n}", "title": "" }, { "docid": "34b349fb27977fafa9846c4e876c1bf9", "score": "0.4881151", "text": "func NotHaveHeaderKeys(keys []string, actual http.Header) error {\n\tvar errs errors\n\tfor _, k := range keys {\n\t\tif vs := actual.Values(k); len(vs) != 0 {\n\t\t\terrs = append(errs, fmt.Errorf(\"expect %v key not in %v\", k, actual))\n\t\t\tcontinue\n\t\t}\n\t}\n\treturn errs\n}", "title": "" }, { "docid": "1673d0c90db6225d0e351a2fd9a2fd7f", "score": "0.48794153", "text": "func (r *Response) Add(key, value string) {\n\tr.handlerHeader.Add(key, value)\n}", "title": "" }, { "docid": "f3f54a52d68865cd0be82ef791d7c16a", "score": "0.48766288", "text": "func (c *Client) addPending(key string) {\n\tc.mu.Lock()\n\tc.results[key] = struct{}{}\n\tc.mu.Unlock()\n}", "title": "" }, { "docid": "a8ccb4e794068c7cc6562147232832ac", "score": "0.4874044", "text": "func (hdr *impl) Add(key string, value string) {\n\thdr.Header.Add(key, value)\n}", "title": "" }, { "docid": "0a1970376cfb1ade3525329c07af5f1c", "score": "0.4870116", "text": "func (h Header) Add(key, value string) {\n\tkey = CanonicalHeaderKey(key)\n\th[key] = append(h[key], value)\n}", "title": "" }, { "docid": "22bb6cc8e079705da84068022fc55b25", "score": "0.4869403", "text": "func NewAPIUpdateApikeyNotFound() *APIUpdateApikeyNotFound {\n\treturn &APIUpdateApikeyNotFound{}\n}", "title": "" }, { "docid": "75ce5f29446c61787da32324fb109f45", "score": "0.485802", "text": "func addHeaderCanonical(h http.Header, key, value string) {\n\th[key] = append(h[key], value)\n}", "title": "" }, { "docid": "2449cc9da955a8ac3c3c5ade224f3f82", "score": "0.4844739", "text": "func IncompleteKey(kind string, parent *Key) *Key {\n\treturn &Key{\n\t\tKind: kind,\n\t\tParent: parent,\n\t}\n}", "title": "" }, { "docid": "afaafaa9f49e8cd0980d61c56609b06f", "score": "0.48440024", "text": "func (v *Validator) AddError(key, message string) {\n\tif _, exists := v.Errors[key]; !exists {\n\t\tv.Errors[key] = message\n\t}\n}", "title": "" }, { "docid": "7ce1f97d46c7b89c425c2b59a9a5428c", "score": "0.48408565", "text": "func (h HeaderMap) Add(key, value string) {\n\th[key] = value\n}", "title": "" }, { "docid": "a977de0174d89167d29e3debaf8c5757", "score": "0.48396188", "text": "func TestNewGivenCustom(t *testing.T) {\n\n\t// Register the signing method.\n\tjwt.RegisterSigningMethod(method.CustomAlg, func() jwt.SigningMethod {\n\t\treturn method.EmptyCustom{}\n\t})\n\n\t// Create the map of given keys.\n\tgivenKeys := make(map[string]keyfunc.GivenKey)\n\tkey := addCustom(givenKeys, testKID)\n\n\t// Use the custom key to create a JWKs.\n\tjwks := keyfunc.NewGiven(givenKeys)\n\n\t// Create the JWT with the appropriate key ID.\n\ttoken := jwt.New(method.EmptyCustom{})\n\ttoken.Header[algAttribute] = method.CustomAlg\n\ttoken.Header[kidAttribute] = testKID\n\n\t// Sign, parse, and validate the JWT.\n\tsignParseValidate(t, token, key, jwks)\n}", "title": "" }, { "docid": "26d69e7e6fd5fa8a782739538bb613d5", "score": "0.48356754", "text": "func invalidAPIKeyTestComponentInfo(t *testing.T, ts *httptest.Server) {\n\treq, err := http.NewRequest(\"GET\", ts.URL+\"/api/componentinfo\", nil)\n\tinvalidKey := \"invalidAPIKey\"\n\tif err != nil {\n\t\tt.Fatal(err)\n\t}\n\treq.Header.Set(\"apiKey\", invalidKey)\n\tresp, err := http.DefaultClient.Do(req)\n\tif err != nil {\n\t\tt.Fatal(err)\n\t}\n\tif resp.StatusCode != http.StatusUnauthorized {\n\t\tt.Error(\"Invalid API key was accepted: \", invalidKey)\n\t}\n}", "title": "" }, { "docid": "c81d390368f91e4124cc75a810819128", "score": "0.48354304", "text": "func addSSHKey(ctx context.Context, client AWSClient, pair evergreen.SSHKeyPair) error {\n\tif _, err := client.ImportKeyPair(ctx, &ec2.ImportKeyPairInput{\n\t\tKeyName: aws.String(pair.Name),\n\t\tPublicKeyMaterial: []byte(pair.Public),\n\t}); err != nil {\n\t\tvar apiErr smithy.APIError\n\t\tif errors.As(err, &apiErr) && apiErr.ErrorCode() == EC2DuplicateKeyPair {\n\t\t\treturn nil\n\t\t}\n\t\treturn errors.Wrap(err, \"importing public SSH key\")\n\t}\n\treturn nil\n}", "title": "" }, { "docid": "dd8bfd17170720a6288f4135671ed534", "score": "0.48335648", "text": "func (client *ManagedInstanceKeysClient) createOrUpdateCreateRequest(ctx context.Context, resourceGroupName string, managedInstanceName string, keyName string, parameters ManagedInstanceKey, options *ManagedInstanceKeysClientBeginCreateOrUpdateOptions) (*policy.Request, error) {\n\turlPath := \"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/managedInstances/{managedInstanceName}/keys/{keyName}\"\n\tif resourceGroupName == \"\" {\n\t\treturn nil, errors.New(\"parameter resourceGroupName cannot be empty\")\n\t}\n\turlPath = strings.ReplaceAll(urlPath, \"{resourceGroupName}\", url.PathEscape(resourceGroupName))\n\tif managedInstanceName == \"\" {\n\t\treturn nil, errors.New(\"parameter managedInstanceName cannot be empty\")\n\t}\n\turlPath = strings.ReplaceAll(urlPath, \"{managedInstanceName}\", url.PathEscape(managedInstanceName))\n\tif keyName == \"\" {\n\t\treturn nil, errors.New(\"parameter keyName cannot be empty\")\n\t}\n\turlPath = strings.ReplaceAll(urlPath, \"{keyName}\", url.PathEscape(keyName))\n\tif client.subscriptionID == \"\" {\n\t\treturn nil, errors.New(\"parameter client.subscriptionID cannot be empty\")\n\t}\n\turlPath = strings.ReplaceAll(urlPath, \"{subscriptionId}\", url.PathEscape(client.subscriptionID))\n\treq, err := runtime.NewRequest(ctx, http.MethodPut, runtime.JoinPaths(client.internal.Endpoint(), urlPath))\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\treqQP := req.Raw().URL.Query()\n\treqQP.Set(\"api-version\", \"2020-11-01-preview\")\n\treq.Raw().URL.RawQuery = reqQP.Encode()\n\treq.Raw().Header[\"Accept\"] = []string{\"application/json\"}\n\tif err := runtime.MarshalAsJSON(req, parameters); err != nil {\n\t\treturn nil, err\n\t}\n\treturn req, nil\n}", "title": "" }, { "docid": "3c28e2a5ee4cad88e3509bbcf85a4d2a", "score": "0.4830126", "text": "func (e CustomTag_HeaderValidationError) Key() bool { return e.key }", "title": "" }, { "docid": "8d94e079fc33cf4abd465f88894c2642", "score": "0.48271427", "text": "func (fkm *FileKeyMap) AddKey(key string, used bool) string {\n\tindex := crypto.SHA512HexFromHex(key)\n\tfor _, fileKey := range fkm.Keys {\n\t\tif fileKey.Index == index {\n\t\t\tif used {\n\t\t\t\tfileKey.Used++\n\t\t\t}\n\t\t\treturn index\n\t\t}\n\t}\n\tvar fileKey *FileKey\n\tif used {\n\t\tfileKey = &FileKey{Index: index, Key: key, Used: 1}\n\t} else {\n\t\tfileKey = &FileKey{Index: index, Key: key, Used: 0}\n\t}\n\tfkm.Keys = append(fkm.Keys, fileKey)\n\treturn index\n}", "title": "" }, { "docid": "2644d9754fd318d5f2c4532bc9143b05", "score": "0.48266938", "text": "func (c *Itsyouonline) AddApiKey(username string, usersusernameapikeyspostreqbody UsersUsernameApikeysPostReqBody, headers, queryParams map[string]interface{}) (UserAPIKey, *http.Response, error) {\n\tqsParam := buildQueryString(queryParams)\n\tvar u UserAPIKey\n\n\tresp, err := c.doReqWithBody(\"POST\", rootURL+\"/users/\"+username+\"/apikeys\", &usersusernameapikeyspostreqbody, headers, qsParam)\n\tif err != nil {\n\t\treturn u, nil, err\n\t}\n\tdefer resp.Body.Close()\n\n\treturn u, resp, json.NewDecoder(resp.Body).Decode(&u)\n}", "title": "" }, { "docid": "4761b8502e92113417b2ec51fed1a0eb", "score": "0.48265988", "text": "func (ob *OrderBy) Add(key OrderByKey) error {\n\tif !key.Supported() {\n\t\treturn errors.Errorf(\"Attempted to add unsupported key %s\", key)\n\t}\n\n\tif orderByContains(ob.keys, key) {\n\t\treturn errors.Errorf(\"Attempted to add duplicate key %s\", key)\n\t}\n\n\tif key.GetMirrorKey() != \"\" && orderByContains(ob.keys, key.GetMirrorKey()) {\n\t\treturn errors.Errorf(\"Attempted to add conflicting key %s\", key)\n\t}\n\n\tob.keys = append(ob.keys, key)\n\treturn nil\n}", "title": "" } ]
b81ce70e91b01ece82eca850fdb3afc2
WithCreatedAtGt adds the createdAtGt to the pull request comments list params
[ { "docid": "15f7a2e409b583dd59a0d1160039d6b5", "score": "0.8200696", "text": "func (o *PullRequestCommentsListParams) WithCreatedAtGt(createdAtGt *string) *PullRequestCommentsListParams {\n\to.SetCreatedAtGt(createdAtGt)\n\treturn o\n}", "title": "" } ]
[ { "docid": "d287e52bdd396b7b1db0453088dbf2a2", "score": "0.7598161", "text": "func (o *PullRequestCommentsListParams) WithCreatedAt(createdAt *string) *PullRequestCommentsListParams {\n\to.SetCreatedAt(createdAt)\n\treturn o\n}", "title": "" }, { "docid": "b1fb4dc1fe8df260b14817112f6227ce", "score": "0.70846754", "text": "func (o *PullRequestCommentsListParams) WithCreatedAtLt(createdAtLt *string) *PullRequestCommentsListParams {\n\to.SetCreatedAtLt(createdAtLt)\n\treturn o\n}", "title": "" }, { "docid": "d049eac77d561df9722d1203d8766926", "score": "0.7067277", "text": "func (o *PullRequestCommentsListParams) WithCreatedAtGte(createdAtGte *string) *PullRequestCommentsListParams {\n\to.SetCreatedAtGte(createdAtGte)\n\treturn o\n}", "title": "" }, { "docid": "17c4b71fff646a342a2c61f9caa9e1c3", "score": "0.66229117", "text": "func (o *PullRequestCommentsListParams) SetCreatedAtGt(createdAtGt *string) {\n\to.CreatedAtGt = createdAtGt\n}", "title": "" }, { "docid": "045be693b8dc93f32dc60c76f104bcac", "score": "0.6546452", "text": "func (o *PullRequestCommentsListParams) WithCreatedAtLte(createdAtLte *string) *PullRequestCommentsListParams {\n\to.SetCreatedAtLte(createdAtLte)\n\treturn o\n}", "title": "" }, { "docid": "22a4a6e210c44d5da51c786d231b12f2", "score": "0.61889285", "text": "func (o *PullRequestCommentsListParams) SetCreatedAt(createdAt *string) {\n\to.CreatedAt = createdAt\n}", "title": "" }, { "docid": "f6d50ecd2a2b17b6c9eb1947cf0f30ca", "score": "0.61618364", "text": "func (o *PullRequestCommentsListParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error {\n\n\tif err := r.SetTimeout(o.timeout); err != nil {\n\t\treturn err\n\t}\n\tvar res []error\n\n\tif o.ApexUserID != nil {\n\n\t\t// query param apex_user_id\n\t\tvar qrApexUserID float64\n\t\tif o.ApexUserID != nil {\n\t\t\tqrApexUserID = *o.ApexUserID\n\t\t}\n\t\tqApexUserID := swag.FormatFloat64(qrApexUserID)\n\t\tif qApexUserID != \"\" {\n\t\t\tif err := r.SetQueryParam(\"apex_user_id\", qApexUserID); err != nil {\n\t\t\t\treturn err\n\t\t\t}\n\t\t}\n\n\t}\n\n\tif o.ApexUserIDIn != nil {\n\n\t\t// query param apex_user_id__in\n\t\tvar qrApexUserIDIn string\n\t\tif o.ApexUserIDIn != nil {\n\t\t\tqrApexUserIDIn = *o.ApexUserIDIn\n\t\t}\n\t\tqApexUserIDIn := qrApexUserIDIn\n\t\tif qApexUserIDIn != \"\" {\n\t\t\tif err := r.SetQueryParam(\"apex_user_id__in\", qApexUserIDIn); err != nil {\n\t\t\t\treturn err\n\t\t\t}\n\t\t}\n\n\t}\n\n\tif o.CreatedAt != nil {\n\n\t\t// query param created_at\n\t\tvar qrCreatedAt string\n\t\tif o.CreatedAt != nil {\n\t\t\tqrCreatedAt = *o.CreatedAt\n\t\t}\n\t\tqCreatedAt := qrCreatedAt\n\t\tif qCreatedAt != \"\" {\n\t\t\tif err := r.SetQueryParam(\"created_at\", qCreatedAt); err != nil {\n\t\t\t\treturn err\n\t\t\t}\n\t\t}\n\n\t}\n\n\tif o.CreatedAtGt != nil {\n\n\t\t// query param created_at__gt\n\t\tvar qrCreatedAtGt string\n\t\tif o.CreatedAtGt != nil {\n\t\t\tqrCreatedAtGt = *o.CreatedAtGt\n\t\t}\n\t\tqCreatedAtGt := qrCreatedAtGt\n\t\tif qCreatedAtGt != \"\" {\n\t\t\tif err := r.SetQueryParam(\"created_at__gt\", qCreatedAtGt); err != nil {\n\t\t\t\treturn err\n\t\t\t}\n\t\t}\n\n\t}\n\n\tif o.CreatedAtGte != nil {\n\n\t\t// query param created_at__gte\n\t\tvar qrCreatedAtGte string\n\t\tif o.CreatedAtGte != nil {\n\t\t\tqrCreatedAtGte = *o.CreatedAtGte\n\t\t}\n\t\tqCreatedAtGte := qrCreatedAtGte\n\t\tif qCreatedAtGte != \"\" {\n\t\t\tif err := r.SetQueryParam(\"created_at__gte\", qCreatedAtGte); err != nil {\n\t\t\t\treturn err\n\t\t\t}\n\t\t}\n\n\t}\n\n\tif o.CreatedAtLt != nil {\n\n\t\t// query param created_at__lt\n\t\tvar qrCreatedAtLt string\n\t\tif o.CreatedAtLt != nil {\n\t\t\tqrCreatedAtLt = *o.CreatedAtLt\n\t\t}\n\t\tqCreatedAtLt := qrCreatedAtLt\n\t\tif qCreatedAtLt != \"\" {\n\t\t\tif err := r.SetQueryParam(\"created_at__lt\", qCreatedAtLt); err != nil {\n\t\t\t\treturn err\n\t\t\t}\n\t\t}\n\n\t}\n\n\tif o.CreatedAtLte != nil {\n\n\t\t// query param created_at__lte\n\t\tvar qrCreatedAtLte string\n\t\tif o.CreatedAtLte != nil {\n\t\t\tqrCreatedAtLte = *o.CreatedAtLte\n\t\t}\n\t\tqCreatedAtLte := qrCreatedAtLte\n\t\tif qCreatedAtLte != \"\" {\n\t\t\tif err := r.SetQueryParam(\"created_at__lte\", qCreatedAtLte); err != nil {\n\t\t\t\treturn err\n\t\t\t}\n\t\t}\n\n\t}\n\n\tif o.Filters != nil {\n\n\t\t// query param filters\n\t\tvar qrFilters string\n\t\tif o.Filters != nil {\n\t\t\tqrFilters = *o.Filters\n\t\t}\n\t\tqFilters := qrFilters\n\t\tif qFilters != \"\" {\n\t\t\tif err := r.SetQueryParam(\"filters\", qFilters); err != nil {\n\t\t\t\treturn err\n\t\t\t}\n\t\t}\n\n\t}\n\n\tif o.ID != nil {\n\n\t\t// query param id\n\t\tvar qrID float64\n\t\tif o.ID != nil {\n\t\t\tqrID = *o.ID\n\t\t}\n\t\tqID := swag.FormatFloat64(qrID)\n\t\tif qID != \"\" {\n\t\t\tif err := r.SetQueryParam(\"id\", qID); err != nil {\n\t\t\t\treturn err\n\t\t\t}\n\t\t}\n\n\t}\n\n\tif o.IDIn != nil {\n\n\t\t// query param id__in\n\t\tvar qrIDIn float64\n\t\tif o.IDIn != nil {\n\t\t\tqrIDIn = *o.IDIn\n\t\t}\n\t\tqIDIn := swag.FormatFloat64(qrIDIn)\n\t\tif qIDIn != \"\" {\n\t\t\tif err := r.SetQueryParam(\"id__in\", qIDIn); err != nil {\n\t\t\t\treturn err\n\t\t\t}\n\t\t}\n\n\t}\n\n\tif o.Limit != nil {\n\n\t\t// query param limit\n\t\tvar qrLimit int64\n\t\tif o.Limit != nil {\n\t\t\tqrLimit = *o.Limit\n\t\t}\n\t\tqLimit := swag.FormatInt64(qrLimit)\n\t\tif qLimit != \"\" {\n\t\t\tif err := r.SetQueryParam(\"limit\", qLimit); err != nil {\n\t\t\t\treturn err\n\t\t\t}\n\t\t}\n\n\t}\n\n\tif o.Offset != nil {\n\n\t\t// query param offset\n\t\tvar qrOffset int64\n\t\tif o.Offset != nil {\n\t\t\tqrOffset = *o.Offset\n\t\t}\n\t\tqOffset := swag.FormatInt64(qrOffset)\n\t\tif qOffset != \"\" {\n\t\t\tif err := r.SetQueryParam(\"offset\", qOffset); err != nil {\n\t\t\t\treturn err\n\t\t\t}\n\t\t}\n\n\t}\n\n\tif o.Ordering != nil {\n\n\t\t// query param ordering\n\t\tvar qrOrdering string\n\t\tif o.Ordering != nil {\n\t\t\tqrOrdering = *o.Ordering\n\t\t}\n\t\tqOrdering := qrOrdering\n\t\tif qOrdering != \"\" {\n\t\t\tif err := r.SetQueryParam(\"ordering\", qOrdering); err != nil {\n\t\t\t\treturn err\n\t\t\t}\n\t\t}\n\n\t}\n\n\tif o.PullRequestID != nil {\n\n\t\t// query param pull_request_id\n\t\tvar qrPullRequestID float64\n\t\tif o.PullRequestID != nil {\n\t\t\tqrPullRequestID = *o.PullRequestID\n\t\t}\n\t\tqPullRequestID := swag.FormatFloat64(qrPullRequestID)\n\t\tif qPullRequestID != \"\" {\n\t\t\tif err := r.SetQueryParam(\"pull_request_id\", qPullRequestID); err != nil {\n\t\t\t\treturn err\n\t\t\t}\n\t\t}\n\n\t}\n\n\tif o.Search != nil {\n\n\t\t// query param search\n\t\tvar qrSearch string\n\t\tif o.Search != nil {\n\t\t\tqrSearch = *o.Search\n\t\t}\n\t\tqSearch := qrSearch\n\t\tif qSearch != \"\" {\n\t\t\tif err := r.SetQueryParam(\"search\", qSearch); err != nil {\n\t\t\t\treturn err\n\t\t\t}\n\t\t}\n\n\t}\n\n\tif o.UserAliasID != nil {\n\n\t\t// query param user_alias_id\n\t\tvar qrUserAliasID string\n\t\tif o.UserAliasID != nil {\n\t\t\tqrUserAliasID = *o.UserAliasID\n\t\t}\n\t\tqUserAliasID := qrUserAliasID\n\t\tif qUserAliasID != \"\" {\n\t\t\tif err := r.SetQueryParam(\"user_alias_id\", qUserAliasID); err != nil {\n\t\t\t\treturn err\n\t\t\t}\n\t\t}\n\n\t}\n\n\tif o.UserAliasIDIn != nil {\n\n\t\t// query param user_alias_id__in\n\t\tvar qrUserAliasIDIn string\n\t\tif o.UserAliasIDIn != nil {\n\t\t\tqrUserAliasIDIn = *o.UserAliasIDIn\n\t\t}\n\t\tqUserAliasIDIn := qrUserAliasIDIn\n\t\tif qUserAliasIDIn != \"\" {\n\t\t\tif err := r.SetQueryParam(\"user_alias_id__in\", qUserAliasIDIn); err != nil {\n\t\t\t\treturn err\n\t\t\t}\n\t\t}\n\n\t}\n\n\tif len(res) > 0 {\n\t\treturn errors.CompositeValidationError(res...)\n\t}\n\treturn nil\n}", "title": "" }, { "docid": "da3bf1f42186d0a9074b3e8fedc0ac00", "score": "0.5978316", "text": "func (o *PullRequestCommentsListParams) WithOrdering(ordering *string) *PullRequestCommentsListParams {\n\to.SetOrdering(ordering)\n\treturn o\n}", "title": "" }, { "docid": "c83767a2798e7685cf6a19c05f6b76f3", "score": "0.5770017", "text": "func (o *PullRequestCommentsListParams) SetCreatedAtLt(createdAtLt *string) {\n\to.CreatedAtLt = createdAtLt\n}", "title": "" }, { "docid": "155be7623e800fb4069d68d5910e2abd", "score": "0.555389", "text": "func (o *PullRequestCommentsListParams) SetCreatedAtGte(createdAtGte *string) {\n\to.CreatedAtGte = createdAtGte\n}", "title": "" }, { "docid": "549f3b19b69b846a1d15878ffa92fba3", "score": "0.550502", "text": "func (o *PullRequestCommentsListParams) WithTimeout(timeout time.Duration) *PullRequestCommentsListParams {\n\to.SetTimeout(timeout)\n\treturn o\n}", "title": "" }, { "docid": "57bbc0bb23a7e5e9f61eea88dd81fe12", "score": "0.54997885", "text": "func (o *PullRequestCommentsListParams) WithContext(ctx context.Context) *PullRequestCommentsListParams {\n\to.SetContext(ctx)\n\treturn o\n}", "title": "" }, { "docid": "c4fa7dbb0df21f7ff4c040190f44cbab", "score": "0.54955846", "text": "func NewPullRequestCommentsListParams() *PullRequestCommentsListParams {\n\tvar ()\n\treturn &PullRequestCommentsListParams{\n\n\t\ttimeout: cr.DefaultTimeout,\n\t}\n}", "title": "" }, { "docid": "07edd77c250b352469961e34bb246c51", "score": "0.5402251", "text": "func (f *FakeClient) ListPullRequestComments(owner, repo string, number int) ([]github.ReviewComment, error) {\n\tf.lock.RLock()\n\tdefer f.lock.RUnlock()\n\treturn append([]github.ReviewComment{}, f.PullRequestComments[number]...), nil\n}", "title": "" }, { "docid": "28ae836790883b43b7ad6b205a69d935", "score": "0.5398004", "text": "func NewPullRequestCommentsListParamsWithHTTPClient(client *http.Client) *PullRequestCommentsListParams {\n\tvar ()\n\treturn &PullRequestCommentsListParams{\n\t\tHTTPClient: client,\n\t}\n}", "title": "" }, { "docid": "46586a1268a90f8d7b10f09e2be90b0b", "score": "0.5357953", "text": "func (o *PullRequestCommentsListParams) WithOffset(offset *int64) *PullRequestCommentsListParams {\n\to.SetOffset(offset)\n\treturn o\n}", "title": "" }, { "docid": "08df8906ffd4943982db00b39f3ba936", "score": "0.5324835", "text": "func NewPullRequestCommentsListParamsWithTimeout(timeout time.Duration) *PullRequestCommentsListParams {\n\tvar ()\n\treturn &PullRequestCommentsListParams{\n\n\t\ttimeout: timeout,\n\t}\n}", "title": "" }, { "docid": "a45bcbb0f78a3e892c10c33fc5b03c21", "score": "0.5275621", "text": "func (o *TicketProjectsListParams) WithUpdatedAtGt(updatedAtGt *string) *TicketProjectsListParams {\n\to.SetUpdatedAtGt(updatedAtGt)\n\treturn o\n}", "title": "" }, { "docid": "0ed331ca540294a8ceac26af570249da", "score": "0.52319115", "text": "func (o *PullRequestCommentsListParams) WithLimit(limit *int64) *PullRequestCommentsListParams {\n\to.SetLimit(limit)\n\treturn o\n}", "title": "" }, { "docid": "f723400b86756d45f97fd962d6a0ae0d", "score": "0.5230128", "text": "func (o *PullRequestCommentsListParams) WithHTTPClient(client *http.Client) *PullRequestCommentsListParams {\n\to.SetHTTPClient(client)\n\treturn o\n}", "title": "" }, { "docid": "a4b98854b3f72463c269967425f6c70a", "score": "0.5175515", "text": "func SetCommentsViaCommentDateGmt(iCommentDateGmt time.Time, comments *Comments) (int64, error) {\n\tcomments.CommentDateGmt = iCommentDateGmt\n\treturn Engine.Insert(comments)\n}", "title": "" }, { "docid": "0f53b97e453ccf78d721573f3ecb5058", "score": "0.5160678", "text": "func (o *PullRequestCommentsListParams) WithID(id *float64) *PullRequestCommentsListParams {\n\to.SetID(id)\n\treturn o\n}", "title": "" }, { "docid": "207eadd2ac338f02745af79a18393fe9", "score": "0.49926984", "text": "func (o *PullRequestCommentsListParams) WithPullRequestID(pullRequestID *float64) *PullRequestCommentsListParams {\n\to.SetPullRequestID(pullRequestID)\n\treturn o\n}", "title": "" }, { "docid": "bc2dad8485f3d19528e499d80dec0397", "score": "0.49705654", "text": "func (o *PullRequestCommentsListParams) SetCreatedAtLte(createdAtLte *string) {\n\to.CreatedAtLte = createdAtLte\n}", "title": "" }, { "docid": "26e1b74e26ac4c4dc8a8d7935d04c63d", "score": "0.49647036", "text": "func (qs StoryQuerySet) CreatedAtGt(createdAt time.Time) StoryQuerySet {\n\treturn qs.w(qs.db.Where(\"created_at > ?\", createdAt))\n}", "title": "" }, { "docid": "4da24983feaa59773032bd98fd8f64e7", "score": "0.4927217", "text": "func ByCreatedAt(opts ...sql.OrderTermOption) OrderOption {\n\treturn sql.OrderByField(FieldCreatedAt, opts...).ToFunc()\n}", "title": "" }, { "docid": "4da24983feaa59773032bd98fd8f64e7", "score": "0.4927217", "text": "func ByCreatedAt(opts ...sql.OrderTermOption) OrderOption {\n\treturn sql.OrderByField(FieldCreatedAt, opts...).ToFunc()\n}", "title": "" }, { "docid": "4da24983feaa59773032bd98fd8f64e7", "score": "0.4927217", "text": "func ByCreatedAt(opts ...sql.OrderTermOption) OrderOption {\n\treturn sql.OrderByField(FieldCreatedAt, opts...).ToFunc()\n}", "title": "" }, { "docid": "4da24983feaa59773032bd98fd8f64e7", "score": "0.4927217", "text": "func ByCreatedAt(opts ...sql.OrderTermOption) OrderOption {\n\treturn sql.OrderByField(FieldCreatedAt, opts...).ToFunc()\n}", "title": "" }, { "docid": "6727aa4c706f04b562b96cf18d167986", "score": "0.49158448", "text": "func (o *TicketProjectsListParams) WithUpdatedAt(updatedAt *string) *TicketProjectsListParams {\n\to.SetUpdatedAt(updatedAt)\n\treturn o\n}", "title": "" }, { "docid": "9af1956e021b8e3f81e5d5c5e7082208", "score": "0.4894692", "text": "func (o *TicketProjectsListParams) WithUpdatedAtLt(updatedAtLt *string) *TicketProjectsListParams {\n\to.SetUpdatedAtLt(updatedAtLt)\n\treturn o\n}", "title": "" }, { "docid": "905c85df03f26bf5ddf9cbdc32ba4574", "score": "0.4889536", "text": "func CreatedAt(v time.Time) predicate.Request {\n\treturn predicate.Request(sql.FieldEQ(FieldCreatedAt, v))\n}", "title": "" }, { "docid": "a4faf307670a86f44c5a17fdacd0722b", "score": "0.48547706", "text": "func (o *TicketProjectsListParams) WithUpdatedAtGte(updatedAtGte *string) *TicketProjectsListParams {\n\to.SetUpdatedAtGte(updatedAtGte)\n\treturn o\n}", "title": "" }, { "docid": "24cd1bb1952e1043c927cfd5e51cdd6a", "score": "0.4851759", "text": "func (b *NotificationBuilder) CreatedAt(value time.Time) *NotificationBuilder {\n\tb.createdAt = value\n\tb.bitmap_ |= 16\n\treturn b\n}", "title": "" }, { "docid": "f8842a357872b57d69eb8748b02b756e", "score": "0.4823787", "text": "func (qs FrameQuerySet) CreatedAtGt(createdAt time.Time) FrameQuerySet {\n\treturn qs.w(qs.db.Where(\"created_at > ?\", createdAt))\n}", "title": "" }, { "docid": "e3cce860ec71fc514bbc83b7f0889a27", "score": "0.48174024", "text": "func (o *PullRequestCommentsListParams) WithFilters(filters *string) *PullRequestCommentsListParams {\n\to.SetFilters(filters)\n\treturn o\n}", "title": "" }, { "docid": "3cad2308f5fd2946896fe9d7f3a4c5d2", "score": "0.480805", "text": "func WithCreatedAt(createdAt time.Time) ImageOption {\n\treturn func(i *options) error {\n\t\ti.createdAt = createdAt\n\t\treturn nil\n\t}\n}", "title": "" }, { "docid": "2b056fc4818bfecc3d1c70076ca72fc9", "score": "0.4798944", "text": "func (glc *GroceryListCreate) SetCreatedAt(t time.Time) *GroceryListCreate {\n\tglc.mutation.SetCreatedAt(t)\n\treturn glc\n}", "title": "" }, { "docid": "2922dd64ac91527ff311a94e8a2535f6", "score": "0.47925735", "text": "func (c *Comment) SetCreatedAt(createdAt time.Time) {\n\tc.CreatedAt = createdAt\n}", "title": "" }, { "docid": "47af911ad89a64739422ea58c8b275c6", "score": "0.47837132", "text": "func (qs TransactionQuerySet) CreatedAtGt(createdAt time.Time) TransactionQuerySet {\n\treturn qs.w(qs.db.Where(\"created_at > ?\", createdAt))\n}", "title": "" }, { "docid": "dba38c778da3b5257428310d6b644e52", "score": "0.47609496", "text": "func createCommentRequestFactory(postID string) models.CreateCommentRequest {\n\treturn models.CreateCommentRequest{\n\t\tPostID: postID,\n\t\tParentCommentID: nil,\n\t\tAuthor: generateRandomAlphanumericString(restapi.MinUsernameLen),\n\t\tContent: generateRandomAlphanumericString(restapi.MinCommentContentLen),\n\t}\n}", "title": "" }, { "docid": "98faf7465eaff6554ae4e38cd25231d4", "score": "0.47229072", "text": "func CreatedAtIn(vs ...time.Time) predicate.Request {\n\treturn predicate.Request(sql.FieldIn(FieldCreatedAt, vs...))\n}", "title": "" }, { "docid": "06da334c8bdae78570233136f141d340", "score": "0.47054586", "text": "func CreatedAtGTE(v time.Time) predicate.Request {\n\treturn predicate.Request(sql.FieldGTE(FieldCreatedAt, v))\n}", "title": "" }, { "docid": "b09efc4eb8dad972f67b10c9bd096a32", "score": "0.47013962", "text": "func (qs StoryQuerySet) CreatedAtLt(createdAt time.Time) StoryQuerySet {\n\treturn qs.w(qs.db.Where(\"created_at < ?\", createdAt))\n}", "title": "" }, { "docid": "afd7c16801848c3a599c5d2d3f9cd4d3", "score": "0.4694495", "text": "func PutCommentsViaCommentDateGmt(CommentDateGmt_ time.Time, iComments *Comments) (int64, error) {\n\trow, err := Engine.Update(iComments, &Comments{CommentDateGmt: CommentDateGmt_})\n\treturn row, err\n}", "title": "" }, { "docid": "51f071f387c446c3ea99bbc3e1046b76", "score": "0.46837622", "text": "func CreatedAtGT(v time.Time) predicate.Request {\n\treturn predicate.Request(sql.FieldGT(FieldCreatedAt, v))\n}", "title": "" }, { "docid": "6078f37e1456010e61728a3abb397670", "score": "0.4681372", "text": "func GetCommentsesViaCommentDateGmt(offset int, limit int, CommentDateGmt_ time.Time, field string) (*[]*Comments, error) {\n\tvar _Comments = new([]*Comments)\n\terr := Engine.Table(\"comments\").Where(\"comment_date_gmt = ?\", CommentDateGmt_).Limit(limit, offset).Desc(field).Find(_Comments)\n\treturn _Comments, err\n}", "title": "" }, { "docid": "c778d3716ad791f125d09bf7cd756a87", "score": "0.46409446", "text": "func (f *FakeClient) CreatePullRequestReviewComment(owner, repo string, number int, rc github.ReviewComment) error {\n\tf.lock.Lock()\n\tdefer f.lock.Unlock()\n\tf.PullRequestReviewCommentID++\n\tf.PullRequestReviewCommentsAdded = append(f.PullRequestReviewCommentsAdded, fmt.Sprintf(\"%s/%s#%d:%s\", owner, repo, number, rc.Body))\n\tf.PullRequestReviewComments[number] = append(f.PullRequestReviewComments[number], rc)\n\treturn nil\n}", "title": "" }, { "docid": "4cdf27e0d6e2a8496879362b8b602a7d", "score": "0.4638384", "text": "func CommentList(fn core.CommentListFunc) Handler {\n\treturn func(ctx context.Context, w http.ResponseWriter, r *http.Request) {\n\t\tvar (\n\t\t\tapp = appFromContext(ctx)\n\t\t\tcurrentUser = userFromContext(ctx)\n\t\t)\n\n\t\tpostID, err := extractPostID(r)\n\t\tif err != nil {\n\t\t\trespondError(w, 0, wrapError(ErrBadRequest, err.Error()))\n\t\t\treturn\n\t\t}\n\n\t\topts, err := extractCommentOpts(r)\n\t\tif err != nil {\n\t\t\trespondError(w, 0, wrapError(ErrBadRequest, err.Error()))\n\t\t\treturn\n\t\t}\n\n\t\topts.Before, err = extractTimeCursorBefore(r)\n\t\tif err != nil {\n\t\t\trespondError(w, 0, wrapError(ErrBadRequest, err.Error()))\n\t\t\treturn\n\t\t}\n\n\t\topts.Limit, err = extractLimit(r)\n\t\tif err != nil {\n\t\t\trespondError(w, 0, wrapError(ErrBadRequest, err.Error()))\n\t\t\treturn\n\t\t}\n\n\t\tfeed, err := fn(app, currentUser.ID, postID, opts)\n\t\tif err != nil {\n\t\t\trespondError(w, 0, err)\n\t\t\treturn\n\t\t}\n\n\t\tif len(feed.Comments) == 0 {\n\t\t\trespondJSON(w, http.StatusNoContent, nil)\n\t\t}\n\n\t\trespondJSON(w, http.StatusOK, &payloadComments{\n\t\t\tcomments: feed.Comments,\n\t\t\tpagination: pagination(\n\t\t\t\tr,\n\t\t\t\topts.Limit,\n\t\t\t\tcommentCursorAfter(feed.Comments, opts.Limit),\n\t\t\t\tcommentCursorBefore(feed.Comments, opts.Limit),\n\t\t\t),\n\t\t\tuserMap: feed.UserMap,\n\t\t})\n\t}\n}", "title": "" }, { "docid": "5c07b3d9b1a4b8e08b24339a880de4cc", "score": "0.46170524", "text": "func (g *giteaClient) PullRequestComment(ctx context.Context, repo string, prRequest sdk.VCSPullRequestCommentRequest) error {\n\treturn sdk.WithStack(sdk.ErrNotImplemented)\n}", "title": "" }, { "docid": "011624c7003b9fa92c6342b50d33cdeb", "score": "0.45742884", "text": "func (qs FrameQuerySet) CreatedAtLt(createdAt time.Time) FrameQuerySet {\n\treturn qs.w(qs.db.Where(\"created_at < ?\", createdAt))\n}", "title": "" }, { "docid": "8cbd319248e0011c224bb70a92c1c035", "score": "0.45635268", "text": "func CreatedAtNotIn(vs ...time.Time) predicate.Request {\n\treturn predicate.Request(sql.FieldNotIn(FieldCreatedAt, vs...))\n}", "title": "" }, { "docid": "b98dd105a78162ef34eb8f13915c817f", "score": "0.45624828", "text": "func (qs TransactionQuerySet) CreatedAtLt(createdAt time.Time) TransactionQuerySet {\n\treturn qs.w(qs.db.Where(\"created_at < ?\", createdAt))\n}", "title": "" }, { "docid": "66c9feade394aaedfbddad905bdbb31a", "score": "0.45590538", "text": "func (o *PullRequestCommentsListParams) WithIDIn(iDIn *float64) *PullRequestCommentsListParams {\n\to.SetIDIn(iDIn)\n\treturn o\n}", "title": "" }, { "docid": "46826262f80c9b52cf24badf2f0733f9", "score": "0.454545", "text": "func setDateInListOpt(listOpt *gitlab.ListCommitsOptions, since, until string) error {\n\tif since != \"\" {\n\t\tsinceDate, err := time.Parse(layoutISO, since)\n\t\tif err != nil {\n\t\t\treturn fmt.Errorf(\"error convert date 'since': %v\\n\", err)\n\t\t}\n\t\tlistOpt.Since = gitlab.Time(sinceDate)\n\t}\n\tif until != \"\" {\n\t\tuntilDate, err := time.Parse(layoutISO, until)\n\t\tif err != nil {\n\t\t\treturn fmt.Errorf(\"error convert date 'until': %v\\n\", err)\n\t\t}\n\t\tlistOpt.Until = gitlab.Time(untilDate)\n\t}\n\treturn nil\n}", "title": "" }, { "docid": "8531f998b87db231a4c43360b05c567f", "score": "0.453008", "text": "func WithSortUpdatedAt(isAsc bool) Option {\n\treturn func(q *Query) {\n\t\tq.Sort = SortBy{UpdatedAt: query.Order{IsAsc: null.BoolFrom(isAsc)}}\n\t}\n}", "title": "" }, { "docid": "e1ed52083d7b68552f16bd954fe397f8", "score": "0.45286745", "text": "func (b *AttachmentBuilder) CreatedAt(value time.Time) *AttachmentBuilder {\n\tb.createdAt = value\n\tb.bitmap_ |= 16\n\treturn b\n}", "title": "" }, { "docid": "26a87b55cd9657b2b52ea7910b8026b9", "score": "0.4526201", "text": "func CreatedAtLT(v time.Time) predicate.Request {\n\treturn predicate.Request(sql.FieldLT(FieldCreatedAt, v))\n}", "title": "" }, { "docid": "1e4288fb9392bcaab9ba0ae71da00a6a", "score": "0.45222694", "text": "func (r *Resolver) PostComments(req struct {\n\tInput *UserPostCommentsInput\n}) (*PostCommentsResult, error) {\n\n\t// if req.Input.OtherUserID != nil {\n\t// \tuserID = int64(*req.Input.OtherUserID)\n\t// }\n\n\tif req.Input == nil {\n\t\treq.Input = &UserPostCommentsInput{}\n\t}\n\n\tvar limit int32\n\tif req.Input.Limit == nil || *req.Input.Limit == 0 || *req.Input.Limit > 100 {\n\t\tlimit = 100\n\t} else {\n\t\tlimit = *req.Input.Limit\n\t}\n\n\tpostCommentResolvers, nextPageToken, err := resolvePostComments(r.server, resolvePostCommentsInput{\n\t\t// ByUserID: userID,\n\t\tPostID: req.Input.PostID,\n\t\tPageToken: req.Input.PageToken,\n\t\tLimit: limit,\n\t})\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\treturn &PostCommentsResult{\n\t\tcomments: postCommentResolvers,\n\t\tnextPageToken: nextPageToken,\n\t}, nil\n}", "title": "" }, { "docid": "2fcb3389f649c0878e365499cccdd013", "score": "0.450877", "text": "func PullRequestOptionsWithRepo(opt ListPullRequestsOptions, owner string, repo string) ListPullRequestsOptions {\n\treturn ListPullRequestsOptions{\n\t\tOwner: owner,\n\t\tRepository: repo,\n\t\tQuery: opt.Query,\n\t\tTimeField: opt.TimeField,\n\t}\n}", "title": "" }, { "docid": "07f8c6d7f832ce70fd2fb9b3a30e2eac", "score": "0.45087042", "text": "func (o *ExpandedBitlink) SetCreatedAt(v string) {\n\to.CreatedAt = &v\n}", "title": "" }, { "docid": "bc2d8eb33d02dd191668261ba0cf29ca", "score": "0.45017698", "text": "func CreatedAt(v time.Time) predicate.AdminSession {\n\treturn predicate.AdminSession(func(s *sql.Selector) {\n\t\ts.Where(sql.EQ(s.C(FieldCreatedAt), v))\n\t})\n}", "title": "" }, { "docid": "9295b13da87061341cd48012cd51ae05", "score": "0.4480857", "text": "func (b *ApplicationBuilder) CreatedAt(value time.Time) *ApplicationBuilder {\n\tb.createdAt = value\n\tb.bitmap_ |= 8\n\treturn b\n}", "title": "" }, { "docid": "4d2da2892346d166ec8a281a5a5683da", "score": "0.4477959", "text": "func GetCommentsesByCommentDateGmtAndCommentApprovedAndCommentParent(offset int, limit int, CommentDateGmt_ time.Time, CommentApproved_ string, CommentParent_ int64) (*[]*Comments, error) {\n\tvar _Comments = new([]*Comments)\n\terr := Engine.Table(\"comments\").Where(\"comment_date_gmt = ? and comment_approved = ? and comment_parent = ?\", CommentDateGmt_, CommentApproved_, CommentParent_).Limit(limit, offset).Find(_Comments)\n\treturn _Comments, err\n}", "title": "" }, { "docid": "bc96eb152853a967d85653246b9e9a41", "score": "0.44775903", "text": "func EnrichComments(ctx *Ctx, ds DS, comments []interface{}, item map[string]interface{}, affs bool) (richComments []interface{}, err error) {\n\tfor _, comment := range comments {\n\t\trichComment := make(map[string]interface{})\n\t\tfor _, field := range RawFields {\n\t\t\tv, _ := item[field]\n\t\t\trichComment[field] = v\n\t\t}\n\t\tfields := []string{\"project_id\", \"project_key\", \"project_name\", \"issue_type\", \"issue_description\"}\n\t\tfor _, field := range fields {\n\t\t\trichComment[field] = item[field]\n\t\t}\n\t\t// This overwrites project passed from outside, but this was requested, we can comment this out if needed\n\t\tif ctx.Project == \"\" {\n\t\t\trichComment[\"project\"] = item[\"project_key\"]\n\t\t} else {\n\t\t\trichComment[\"project\"] = ctx.Project\n\t\t}\n\t\trichComment[\"issue_key\"] = item[\"key\"]\n\t\trichComment[\"issue_url\"] = item[\"url\"]\n\n\t\tauthors := []string{Author, \"updateAuthor\"}\n\t\tfor _, a := range authors {\n\t\t\tauthor, ok := Dig(comment, []string{a}, false, true)\n\t\t\tif ok {\n\t\t\t\trichComment[a], _ = Dig(author, []string{\"displayName\"}, true, false)\n\t\t\t\ttz, ok := Dig(author, []string{\"timeZone\"}, false, true)\n\t\t\t\tif ok {\n\t\t\t\t\trichComment[a+\"_tz\"] = tz\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\trichComment[a] = nil\n\t\t\t}\n\t\t}\n\t\tvar dt time.Time\n\t\tvar created interface{}\n\t\tfor _, field := range []string{\"created\", \"updated\"} {\n\t\t\tidt, _ := Dig(comment, []string{field}, true, false)\n\t\t\tdt, err = TimeParseInterfaceString(idt)\n\t\t\tif err != nil {\n\t\t\t\trichComment[field] = nil\n\t\t\t} else {\n\t\t\t\trichComment[field] = dt\n\t\t\t}\n\t\t\tif field == \"created\" {\n\t\t\t\tcreated = idt\n\t\t\t}\n\t\t}\n\t\tcid, _ := Dig(comment, []string{\"id\"}, true, false)\n\t\trichComment[\"body\"], _ = Dig(comment, []string{\"body\"}, true, false)\n\t\trichComment[\"comment_id\"] = cid\n\t\tiid, ok := item[\"id\"].(string)\n\t\tif !ok {\n\t\t\terr = fmt.Errorf(\"missing string id field in issue %+v\", DumpKeys(item))\n\t\t\treturn\n\t\t}\n\t\tcomid, ok := cid.(string)\n\t\tif !ok {\n\t\t\terr = fmt.Errorf(\"missing string id field in comment %+v\", DumpKeys(comment))\n\t\t\treturn\n\t\t}\n\t\trichComment[\"id\"] = fmt.Sprintf(\"%s_comment_%s\", iid, comid)\n\t\trichComment[\"type\"] = Comment\n\t\tif affs {\n\t\t\tvar affsItems map[string]interface{}\n\t\t\titemComment := map[string]interface{}{\"data\": map[string]interface{}{\"fields\": comment}}\n\t\t\taffsItems, err = ds.AffsItems(ctx, itemComment, []string{Author, \"updateAuthor\"}, created)\n\t\t\tif err != nil {\n\t\t\t\treturn\n\t\t\t}\n\t\t\tfor prop, value := range affsItems {\n\t\t\t\trichComment[prop] = value\n\t\t\t}\n\t\t}\n\t\tfor prop, value := range CommonFields(ds, created, Comment) {\n\t\t\trichComment[prop] = value\n\t\t}\n\t\terr = EnrichItem(ctx, ds, richComment)\n\t\tif err != nil {\n\t\t\treturn\n\t\t}\n\t\trichComments = append(richComments, richComment)\n\t}\n\treturn\n}", "title": "" }, { "docid": "a06e4a9ae729ecedfcfef412094a2f73", "score": "0.44732815", "text": "func NewListWorkItemCommentsContext(ctx context.Context, r *http.Request, service *goa.Service) (*ListWorkItemCommentsContext, error) {\n\tvar err error\n\tresp := goa.ContextResponse(ctx)\n\tresp.Service = service\n\treq := goa.ContextRequest(ctx)\n\treq.Request = r\n\trctx := ListWorkItemCommentsContext{Context: ctx, ResponseData: resp, RequestData: req}\n\theaderIfModifiedSince := req.Header[\"If-Modified-Since\"]\n\tif len(headerIfModifiedSince) > 0 {\n\t\trawIfModifiedSince := headerIfModifiedSince[0]\n\t\treq.Params[\"If-Modified-Since\"] = []string{rawIfModifiedSince}\n\t\trctx.IfModifiedSince = &rawIfModifiedSince\n\t}\n\theaderIfNoneMatch := req.Header[\"If-None-Match\"]\n\tif len(headerIfNoneMatch) > 0 {\n\t\trawIfNoneMatch := headerIfNoneMatch[0]\n\t\treq.Params[\"If-None-Match\"] = []string{rawIfNoneMatch}\n\t\trctx.IfNoneMatch = &rawIfNoneMatch\n\t}\n\tparamPageLimit := req.Params[\"page[limit]\"]\n\tif len(paramPageLimit) > 0 {\n\t\trawPageLimit := paramPageLimit[0]\n\t\tif pageLimit, err2 := strconv.Atoi(rawPageLimit); err2 == nil {\n\t\t\ttmp80 := pageLimit\n\t\t\ttmp79 := &tmp80\n\t\t\trctx.PageLimit = tmp79\n\t\t} else {\n\t\t\terr = goa.MergeErrors(err, goa.InvalidParamTypeError(\"page[limit]\", rawPageLimit, \"integer\"))\n\t\t}\n\t}\n\tparamPageOffset := req.Params[\"page[offset]\"]\n\tif len(paramPageOffset) > 0 {\n\t\trawPageOffset := paramPageOffset[0]\n\t\trctx.PageOffset = &rawPageOffset\n\t}\n\tparamWiID := req.Params[\"wiID\"]\n\tif len(paramWiID) > 0 {\n\t\trawWiID := paramWiID[0]\n\t\tif wiID, err2 := uuid.FromString(rawWiID); err2 == nil {\n\t\t\trctx.WiID = wiID\n\t\t} else {\n\t\t\terr = goa.MergeErrors(err, goa.InvalidParamTypeError(\"wiID\", rawWiID, \"uuid\"))\n\t\t}\n\t}\n\treturn &rctx, err\n}", "title": "" }, { "docid": "13c6635329357a45071317f0d0a9530a", "score": "0.44693118", "text": "func (q *buzzFeedQ) WithCreatedAt(createdAt int64) BuzzFeedQI {\n\tq.table.QBuilder = q.table.QBuilder.Where(\"created_at = ?\", createdAt)\n\treturn q\n}", "title": "" }, { "docid": "0105b4c0618fdf936b20ae8b67c088e2", "score": "0.44587946", "text": "func GetCommentsesByCommentDateGmtAndCommentParent(offset int, limit int, CommentDateGmt_ time.Time, CommentParent_ int64) (*[]*Comments, error) {\n\tvar _Comments = new([]*Comments)\n\terr := Engine.Table(\"comments\").Where(\"comment_date_gmt = ? and comment_parent = ?\", CommentDateGmt_, CommentParent_).Limit(limit, offset).Find(_Comments)\n\treturn _Comments, err\n}", "title": "" }, { "docid": "0accb36bbcfcd9162b21af150a16a71c", "score": "0.4455721", "text": "func GetCommentsViaCommentDateGmt(iCommentDateGmt time.Time) (*Comments, error) {\n\tvar _Comments = &Comments{CommentDateGmt: iCommentDateGmt}\n\thas, err := Engine.Get(_Comments)\n\tif has {\n\t\treturn _Comments, err\n\t} else {\n\t\treturn nil, err\n\t}\n}", "title": "" }, { "docid": "f1a5d1a59f527fe542a6435d62a7a702", "score": "0.4433473", "text": "func (o *PullRequestCommentsListParams) WithSearch(search *string) *PullRequestCommentsListParams {\n\to.SetSearch(search)\n\treturn o\n}", "title": "" }, { "docid": "50a92aa62e09211753ce16a34ec5415b", "score": "0.44226533", "text": "func (pr PullRequest) PostComment(msg string) (Comment, error) {\n\tlog.Println(\"github.pr.comments.create.started\")\n\n\tvar err error\n\tvar comment Comment\n\n\tcreateCommentPath := fmt.Sprintf(\"/repos/%s/issues/%d/comments\", pr.Base.Repository.FullName, pr.Number)\n\trequestBodyAsBytes := []byte(fmt.Sprintf(`{\"body\":\"%s\"}`, msg))\n\trequestBody := ioutil.NopCloser(bytes.NewReader(requestBodyAsBytes))\n\n\trequest := NewGitHubRequest(createCommentPath)\n\trequest.Method = \"POST\"\n\trequest.Header.Set(\"ContentLength\", string(len(requestBodyAsBytes)))\n\trequest.Body = requestBody\n\tresponse, err := httpClient.Do(request)\n\n\tvar responseBodyAsBytes []byte\n\n\tif err != nil {\n\t\tlog.Println(\"github.pr.comments.create.failed error:\", err.Error())\n\t\treturn comment, err\n\t}\n\n\tdefer response.Body.Close()\n\n\tresponseBodyAsBytes, err = ioutil.ReadAll(response.Body)\n\tif err != nil {\n\t\tlog.Println(\"github.pr.comments.create.failed error:\", err)\n\t\treturn comment, err\n\t}\n\n\tif response.StatusCode != http.StatusCreated {\n\t\tapiError := new(Error)\n\t\tjson.Unmarshal(responseBodyAsBytes, apiError)\n\t\tlog.Printf(\"github.pr.comments.create.failed status: %d, msg: %s \\n\", response.StatusCode, apiError.Message)\n\t\treturn comment, err\n\t}\n\n\tjson.Unmarshal(responseBodyAsBytes, &comment)\n\n\tlog.Println(\"github.pr.comments.create.completed number:\", pr.Number)\n\treturn comment, nil\n}", "title": "" }, { "docid": "54b0abb3b114e6ef5924496984f6fef1", "score": "0.4413996", "text": "func (n *RGATreeListNode) CreatedAt() *time.Ticket {\n\treturn n.elem.CreatedAt()\n}", "title": "" }, { "docid": "0680cdc689e0a2b6a4e2a1b2fd565d28", "score": "0.44127277", "text": "func GetCommentsesByCommentDateAndCommentDateGmtAndCommentParent(offset int, limit int, CommentDate_ time.Time, CommentDateGmt_ time.Time, CommentParent_ int64) (*[]*Comments, error) {\n\tvar _Comments = new([]*Comments)\n\terr := Engine.Table(\"comments\").Where(\"comment_date = ? and comment_date_gmt = ? and comment_parent = ?\", CommentDate_, CommentDateGmt_, CommentParent_).Limit(limit, offset).Find(_Comments)\n\treturn _Comments, err\n}", "title": "" }, { "docid": "0b2f183f6d71b1ca864d4456cc6a2949", "score": "0.44063738", "text": "func CreatedAt(v time.Time) predicate.Operation {\n\treturn predicate.Operation(func(s *sql.Selector) {\n\t\ts.Where(sql.EQ(s.C(FieldCreatedAt), v))\n\t})\n}", "title": "" }, { "docid": "0ec51b1584988d23d606bde18f20e251", "score": "0.44055545", "text": "func CreatedAt(v time.Time) predicate.Template {\n\treturn predicate.Template(func(s *sql.Selector) {\n\t\ts.Where(sql.EQ(s.C(FieldCreatedAt), v))\n\t})\n}", "title": "" }, { "docid": "3e6d9f0a8a610f7542f3f74279345cfe", "score": "0.43977797", "text": "func (s *ListSolNetworkOperationsMetadata) SetCreatedAt(v time.Time) *ListSolNetworkOperationsMetadata {\n\ts.CreatedAt = &v\n\treturn s\n}", "title": "" }, { "docid": "39a8fd7ae9d28d945a8583d6723a3374", "score": "0.43815514", "text": "func (r *PullRequestResource) Create(project, slug, title, fromRef, toRef string, reviewers []string) (*PullRequest, error) {\n\tpr := &PullRequest{\n\t\tTitle: title,\n\t\tOpen: true,\n\t\tFromRef: &PullRequestReference{\n\t\t\tId: fromRef,\n\t\t\tRepository: &Repo{\n\t\t\t\tSlug: slug,\n\t\t\t\tProject: &Project{\n\t\t\t\t\tKey: project,\n\t\t\t\t},\n\t\t\t},\n\t\t},\n\t\tToRef: &PullRequestReference{\n\t\t\tId: toRef,\n\t\t\tRepository: &Repo{\n\t\t\t\tSlug: slug,\n\t\t\t\tProject: &Project{\n\t\t\t\t\tKey: project,\n\t\t\t\t},\n\t\t\t},\n\t\t},\n\t\tLocked: false,\n\t}\n\n\tfor _, reviewer := range reviewers {\n\t\tpr.Reviewers = append(pr.Reviewers, &Reviewer{User: &User{Username: reviewer}})\n\t}\n\n\tprData, err := json.Marshal(pr)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\tpath := fmt.Sprintf(\"/projects/%s/repos/%s/pull-requests\", project, slug)\n\n\tif err := r.client.do(\"POST\", \"core\", path, nil, prData, &pr); err != nil {\n\t\treturn nil, err\n\t}\n\n\treturn pr, nil\n}", "title": "" }, { "docid": "fcb55bfb4f920c18e72c24e604cb6d4c", "score": "0.43807304", "text": "func (o *LinkDeliveryGetResponse) SetCreatedAt(v time.Time) {\n\to.CreatedAt = v\n}", "title": "" }, { "docid": "5a33a45bffcadcec26abe32f419476c3", "score": "0.43802488", "text": "func GetCommentsesByCommentDateAndCommentDateGmt(offset int, limit int, CommentDate_ time.Time, CommentDateGmt_ time.Time) (*[]*Comments, error) {\n\tvar _Comments = new([]*Comments)\n\terr := Engine.Table(\"comments\").Where(\"comment_date = ? and comment_date_gmt = ?\", CommentDate_, CommentDateGmt_).Limit(limit, offset).Find(_Comments)\n\treturn _Comments, err\n}", "title": "" }, { "docid": "d41808bd5a711c6747445ec835ef4094", "score": "0.43781585", "text": "func GetCommentsesByCommentDateGmtAndCommentApproved(offset int, limit int, CommentDateGmt_ time.Time, CommentApproved_ string) (*[]*Comments, error) {\n\tvar _Comments = new([]*Comments)\n\terr := Engine.Table(\"comments\").Where(\"comment_date_gmt = ? and comment_approved = ?\", CommentDateGmt_, CommentApproved_).Limit(limit, offset).Find(_Comments)\n\treturn _Comments, err\n}", "title": "" }, { "docid": "42ebbf25d14b04a78d15f00e51c5defa", "score": "0.43767917", "text": "func CreatedAt(v time.Time) predicate.Wallet {\n\treturn predicate.Wallet(func(s *sql.Selector) {\n\t\ts.Where(sql.EQ(s.C(FieldCreatedAt), v))\n\t})\n}", "title": "" }, { "docid": "45e91c3ac743ec15ee50a0aca04c1777", "score": "0.43765384", "text": "func (o *TicketProjectsListParams) SetUpdatedAtLt(updatedAtLt *string) {\n\to.UpdatedAtLt = updatedAtLt\n}", "title": "" }, { "docid": "1fd48c9a517abad1b6ed3e743c599024", "score": "0.4372942", "text": "func GetCommentsesByCommentDateAndCommentDateGmtAndCommentApproved(offset int, limit int, CommentDate_ time.Time, CommentDateGmt_ time.Time, CommentApproved_ string) (*[]*Comments, error) {\n\tvar _Comments = new([]*Comments)\n\terr := Engine.Table(\"comments\").Where(\"comment_date = ? and comment_date_gmt = ? and comment_approved = ?\", CommentDate_, CommentDateGmt_, CommentApproved_).Limit(limit, offset).Find(_Comments)\n\treturn _Comments, err\n}", "title": "" }, { "docid": "b7341ee0f0dcc58b711db370f2041319", "score": "0.4371572", "text": "func CreatedAtEQ(v time.Time) predicate.Request {\n\treturn predicate.Request(sql.FieldEQ(FieldCreatedAt, v))\n}", "title": "" }, { "docid": "11a00806aaeb9efa6531c0db3a09ac37", "score": "0.43707222", "text": "func (o *PullRequestCommentsListParams) WithApexUserIDIn(apexUserIDIn *string) *PullRequestCommentsListParams {\n\to.SetApexUserIDIn(apexUserIDIn)\n\treturn o\n}", "title": "" }, { "docid": "3d22a805821d8692fe15eefb28615358", "score": "0.43676403", "text": "func CreatedAt(v time.Time) predicate.Customer {\n\treturn predicate.Customer(func(s *sql.Selector) {\n\t\ts.Where(sql.EQ(s.C(FieldCreatedAt), v))\n\t})\n}", "title": "" }, { "docid": "b9f41283cbf4a39de351293636fd0796", "score": "0.4358101", "text": "func (u *URL) FormattedCreatedAt() string {\n\treturn u.CreatedAt.Format(time.RFC1123)\n}", "title": "" }, { "docid": "96776015550cc6f3bf6886edc1382058", "score": "0.43528003", "text": "func GetCommentsesByCommentDateGmtAndCommentParentAndUserId(offset int, limit int, CommentDateGmt_ time.Time, CommentParent_ int64, UserId_ int64) (*[]*Comments, error) {\n\tvar _Comments = new([]*Comments)\n\terr := Engine.Table(\"comments\").Where(\"comment_date_gmt = ? and comment_parent = ? and user_id = ?\", CommentDateGmt_, CommentParent_, UserId_).Limit(limit, offset).Find(_Comments)\n\treturn _Comments, err\n}", "title": "" }, { "docid": "269f8c0c39cf0394cfdb39404905d9b2", "score": "0.4350998", "text": "func GCreatedAt(v time.Time) predicate.Groups {\n\treturn predicate.Groups(func(s *sql.Selector) {\n\t\ts.Where(sql.EQ(s.C(FieldGCreatedAt), v))\n\t})\n}", "title": "" }, { "docid": "3380fc447d4c88f9a8e9f0f1086f4a3f", "score": "0.43497264", "text": "func GetCommentsesByCommentDateGmtAndCommentTypeAndCommentParent(offset int, limit int, CommentDateGmt_ time.Time, CommentType_ string, CommentParent_ int64) (*[]*Comments, error) {\n\tvar _Comments = new([]*Comments)\n\terr := Engine.Table(\"comments\").Where(\"comment_date_gmt = ? and comment_type = ? and comment_parent = ?\", CommentDateGmt_, CommentType_, CommentParent_).Limit(limit, offset).Find(_Comments)\n\treturn _Comments, err\n}", "title": "" }, { "docid": "147df80107c92deab4d00626422e8649", "score": "0.43441215", "text": "func GetCommentsesByCommentDateGmtAndCommentApprovedAndCommentType(offset int, limit int, CommentDateGmt_ time.Time, CommentApproved_ string, CommentType_ string) (*[]*Comments, error) {\n\tvar _Comments = new([]*Comments)\n\terr := Engine.Table(\"comments\").Where(\"comment_date_gmt = ? and comment_approved = ? and comment_type = ?\", CommentDateGmt_, CommentApproved_, CommentType_).Limit(limit, offset).Find(_Comments)\n\treturn _Comments, err\n}", "title": "" }, { "docid": "344f4a2deb31212429527127f8ab30b8", "score": "0.43368965", "text": "func (m *WeChatPayMutation) SetCreatedAt(t time.Time) {\n\tm.created_at = &t\n}", "title": "" }, { "docid": "2e312b6fb029dba3a92423dd863ef5af", "score": "0.4333082", "text": "func GetCommentsesByCommentAuthorIpAndCommentDateGmt(offset int, limit int, CommentAuthorIp_ string, CommentDateGmt_ time.Time) (*[]*Comments, error) {\n\tvar _Comments = new([]*Comments)\n\terr := Engine.Table(\"comments\").Where(\"comment_author_ip = ? and comment_date_gmt = ?\", CommentAuthorIp_, CommentDateGmt_).Limit(limit, offset).Find(_Comments)\n\treturn _Comments, err\n}", "title": "" }, { "docid": "04b8e804ba229fd2f56f4167e36bad2a", "score": "0.43321916", "text": "func (o *SearchServiceLevelObjectiveAttributes) SetCreatedAt(v int64) {\n\to.CreatedAt = &v\n}", "title": "" }, { "docid": "bc2558ae132ed43bc545437f7acc98cd", "score": "0.4329065", "text": "func (o *ViewProject) SetCreatedAt(v string) {\n\to.CreatedAt = &v\n}", "title": "" }, { "docid": "7031989fbf152ee054334c7c0e6ec7d5", "score": "0.4328916", "text": "func CreatedAt(v time.Time) predicate.K8sMetric {\n\treturn predicate.K8sMetric(func(s *sql.Selector) {\n\t\ts.Where(sql.EQ(s.C(FieldCreatedAt), v))\n\t})\n}", "title": "" }, { "docid": "0b0ed3150ee1d44d4ab5637127752c34", "score": "0.43227845", "text": "func (s *ListSolFunctionPackageMetadata) SetCreatedAt(v time.Time) *ListSolFunctionPackageMetadata {\n\ts.CreatedAt = &v\n\treturn s\n}", "title": "" }, { "docid": "9ed5859d3decf783ca6b1c167092a7fa", "score": "0.43202505", "text": "func (a *RGATreeList) DeleteByCreatedAt(createdAt *time.Ticket, deletedAt *time.Ticket) *RGATreeListNode {\n\tnode, ok := a.nodeMapByCreatedAt[createdAt.Key()]\n\tif !ok {\n\t\tlog.Logger.Fatalf(\n\t\t\t\"fail to find the given createdAt: %s\",\n\t\t\tcreatedAt.Key(),\n\t\t)\n\t}\n\n\talreadyRemoved := node.isRemoved()\n\tif node.elem.Remove(deletedAt) && !alreadyRemoved {\n\t\ta.nodeMapByIndex.Splay(node.indexNode)\n\t\ta.size--\n\t}\n\treturn node\n}", "title": "" }, { "docid": "e0190982ff19d53322e59d7737d98267", "score": "0.43092257", "text": "func GetCommentsesByCommentDateGmtAndCommentApprovedAndUserId(offset int, limit int, CommentDateGmt_ time.Time, CommentApproved_ string, UserId_ int64) (*[]*Comments, error) {\n\tvar _Comments = new([]*Comments)\n\terr := Engine.Table(\"comments\").Where(\"comment_date_gmt = ? and comment_approved = ? and user_id = ?\", CommentDateGmt_, CommentApproved_, UserId_).Limit(limit, offset).Find(_Comments)\n\treturn _Comments, err\n}", "title": "" }, { "docid": "eb215a2125fb64208a17c414e9faf15b", "score": "0.43042094", "text": "func GetCommentsesByCommentDateAndCommentDateGmtAndUserId(offset int, limit int, CommentDate_ time.Time, CommentDateGmt_ time.Time, UserId_ int64) (*[]*Comments, error) {\n\tvar _Comments = new([]*Comments)\n\terr := Engine.Table(\"comments\").Where(\"comment_date = ? and comment_date_gmt = ? and user_id = ?\", CommentDate_, CommentDateGmt_, UserId_).Limit(limit, offset).Find(_Comments)\n\treturn _Comments, err\n}", "title": "" } ]
dd33f1526d2141d419ba3b434724718c
WithProductID adds the productID to the update vidm Ssh user password using p o s t params
[ { "docid": "496035bdf7a70a1114473376f757165a", "score": "0.7384593", "text": "func (o *UpdateVidmSSHUserPasswordUsingPOSTParams) WithProductID(productID string) *UpdateVidmSSHUserPasswordUsingPOSTParams {\n\to.SetProductID(productID)\n\treturn o\n}", "title": "" } ]
[ { "docid": "192478c9b1c5b116765377fa152d9d59", "score": "0.7395977", "text": "func (o *UpdateVidmSSHUserPasswordUsingPOSTParams) SetProductID(productID string) {\n\to.ProductID = productID\n}", "title": "" }, { "docid": "580a9c5c650f1d99cfedd6c550060682", "score": "0.6031727", "text": "func (env *Env) UpdateProductHandler(w http.ResponseWriter, r *http.Request) *helpers.AppError {\n\tvars := mux.Vars(r)\n\tvar (\n\t\tid int\n\t\terr error\n\t\tp models.Product\n\t)\n\n\tif err := r.ParseForm(); err != nil {\n\t\treturn &helpers.AppError{\n\t\t\tError: err,\n\t\t\tMessage: \"form parsing error\",\n\t\t\tCode: http.StatusBadRequest}\n\t}\n\n\t// retrieving the logged user id from request context\n\tc := helpers.ContainerFromRequestContext(r)\n\n\tif err := global.Decoder.Decode(&p, r.PostForm); err != nil {\n\t\treturn &helpers.AppError{\n\t\t\tError: err,\n\t\t\tMessage: \"form decoding error\",\n\t\t\tCode: http.StatusBadRequest}\n\t}\n\t// p.ProductCreationDate = time.Now()\n\tp.PersonID = c.PersonID\n\tlog.WithFields(log.Fields{\"p\": p}).Debug(\"UpdateProductHandler\")\n\n\tif id, err = strconv.Atoi(vars[\"id\"]); err != nil {\n\t\treturn &helpers.AppError{\n\t\t\tError: err,\n\t\t\tMessage: \"id atoi conversion\",\n\t\t\tCode: http.StatusInternalServerError}\n\t}\n\n\tupdatedp, _ := env.DB.GetProduct(id)\n\tupdatedp.CasNumber = p.CasNumber\n\tupdatedp.CeNumber = p.CeNumber\n\tupdatedp.EmpiricalFormula = p.EmpiricalFormula\n\tupdatedp.LinearFormula = p.LinearFormula\n\tupdatedp.Name = p.Name\n\tupdatedp.ProductSpecificity = p.ProductSpecificity\n\tupdatedp.Symbols = p.Symbols\n\tupdatedp.Synonyms = p.Synonyms\n\tupdatedp.ProductMSDS = p.ProductMSDS\n\tupdatedp.ProductRestricted = p.ProductRestricted\n\tupdatedp.ProductRadioactive = p.ProductRadioactive\n\tupdatedp.LinearFormula = p.LinearFormula\n\tupdatedp.ProductThreeDFormula = p.ProductThreeDFormula\n\tupdatedp.ProductMolFormula = p.ProductMolFormula\n\tupdatedp.ProductDisposalComment = p.ProductDisposalComment\n\tupdatedp.ProductRemark = p.ProductRemark\n\tupdatedp.PhysicalState = p.PhysicalState\n\tupdatedp.SignalWord = p.SignalWord\n\tupdatedp.ClassOfCompound = p.ClassOfCompound\n\tupdatedp.HazardStatements = p.HazardStatements\n\tupdatedp.PrecautionaryStatements = p.PrecautionaryStatements\n\tlog.WithFields(log.Fields{\"updatedp\": updatedp}).Debug(\"UpdateProductHandler\")\n\n\tif err := env.DB.UpdateProduct(updatedp); err != nil {\n\t\treturn &helpers.AppError{\n\t\t\tError: err,\n\t\t\tMessage: \"update product error\",\n\t\t\tCode: http.StatusInternalServerError}\n\t}\n\n\tw.Header().Set(\"Content-Type\", \"application/json; charset=UTF-8\")\n\tw.WriteHeader(http.StatusOK)\n\tjson.NewEncoder(w).Encode(updatedp)\n\n\treturn nil\n}", "title": "" }, { "docid": "d14113c989895049f6fedc7991ea86fb", "score": "0.59844774", "text": "func (ac *AccountCreate) SetProductID(id int) *AccountCreate {\n\tac.mutation.SetProductID(id)\n\treturn ac\n}", "title": "" }, { "docid": "32f02e49f60c8c91e79444542cddea37", "score": "0.59433496", "text": "func (au *AccountUpdate) SetProductID(id int) *AccountUpdate {\n\tau.mutation.SetProductID(id)\n\treturn au\n}", "title": "" }, { "docid": "2d1833de52a4fbbf46fa94fa41a264ae", "score": "0.589244", "text": "func withProductID(id uuid.UUID) productOption {\n\treturn func(m *ProductMutation) {\n\t\tvar (\n\t\t\terr error\n\t\t\tonce sync.Once\n\t\t\tvalue *Product\n\t\t)\n\t\tm.oldValue = func(ctx context.Context) (*Product, error) {\n\t\t\tonce.Do(func() {\n\t\t\t\tif m.done {\n\t\t\t\t\terr = fmt.Errorf(\"querying old values post mutation is not allowed\")\n\t\t\t\t} else {\n\t\t\t\t\tvalue, err = m.Client().Product.Get(ctx, id)\n\t\t\t\t}\n\t\t\t})\n\t\t\treturn value, err\n\t\t}\n\t\tm.id = &id\n\t}\n}", "title": "" }, { "docid": "ed3015806a03f0611915d6b4a1c9539a", "score": "0.5882735", "text": "func (s *RedeemSavingsFlexibleProductService) ProductId(productId string) *RedeemSavingsFlexibleProductService {\n\ts.productId = productId\n\treturn s\n}", "title": "" }, { "docid": "2636f58a8c73b5e4986c12193754a092", "score": "0.5878165", "text": "func (auo *AccountUpdateOne) SetProductID(id int) *AccountUpdateOne {\n\tauo.mutation.SetProductID(id)\n\treturn auo\n}", "title": "" }, { "docid": "8ffbcada9fa037389396885d46e259b0", "score": "0.5875094", "text": "func (rc *RatingCreate) SetProductID(id int) *RatingCreate {\n\trc.mutation.SetProductID(id)\n\treturn rc\n}", "title": "" }, { "docid": "7ad857fdbfa8b3a2a7857a3299e81ed4", "score": "0.5847719", "text": "func updateProduct(c echo.Context) error {\n\tvar product map[int]string\n\tpID, err := strconv.Atoi(c.Param(\"id\"))\n\tif err != nil {\n\t\treturn err\n\t}\n\tfor _, p := range Products {\n\t\tfor k := range p {\n\n\t\t\tif pID == k {\n\t\t\t\tproduct = p\n\t\t\t}\n\t\t}\n\t}\n\tif product == nil {\n\t\treturn c.JSON(http.StatusNotFound, \"Product not found\")\n\t}\n\ttype body struct {\n\t\tName string `json:\"product_name\" validate:\"min=4\"`\n\t}\n\tvar reqBody body\n\te.Validator = &ProductValidator{validator: v}\n\tif err := c.Bind(&reqBody); err != nil {\n\t\treturn err\n\t}\n\tif err := c.Validate(reqBody); err != nil {\n\t\treturn err\n\t}\n\tproduct[pID] = reqBody.Name\n\treturn c.JSON(http.StatusOK, product)\n}", "title": "" }, { "docid": "b96c719b74db41239d272cdf0ff88c2b", "score": "0.5832513", "text": "func updateProduct(db *sql.DB, id2 int, product string, ptype string, price int, os string) {\n\tsprice := strconv.Itoa(price) // int to string\n\tsid := strconv.Itoa(id2) // int to string\n\ttx, _ := db.Begin()\n\n\tstmt, _ := tx.Prepare(\"update products set product=?,ptype=?,price=?,os=? where id=?\")\n\t_, err := stmt.Exec(product, ptype, sprice, os, sid)\n\terrchecker(err)\n\ttx.Commit()\n}", "title": "" }, { "docid": "ce9bcac2f2496791e2f78bf6068d53ea", "score": "0.58116424", "text": "func (s *StakingProductPositionService) ProductId(productId string) *StakingProductPositionService {\n\ts.productId = &productId\n\treturn s\n}", "title": "" }, { "docid": "1978da3c235f2f8d4099731fa85d7004", "score": "0.58040434", "text": "func (r *PackageProductRow) SetProductID(productID int32) { r.Data.ProductID = productID }", "title": "" }, { "docid": "7da82ca2527f980472c11f67b6d6964e", "score": "0.579453", "text": "func (o *GetLolGamhsV1ProductsByProductIDCurrentSummonerMatchesParams) SetProductID(productID string) {\n\to.ProductID = productID\n}", "title": "" }, { "docid": "3da4a77b8d3387ff28b6bd4fa4426659", "score": "0.576895", "text": "func (ou *OrderonlineUpdate) SetProductID(id int) *OrderonlineUpdate {\n\tou.mutation.SetProductID(id)\n\treturn ou\n}", "title": "" }, { "docid": "1369cfe5def119e64d30ad5bfe1e92ed", "score": "0.5768811", "text": "func (s *PurchaseSavingsFlexibleProductService) ProductId(productId string) *PurchaseSavingsFlexibleProductService {\n\ts.productId = productId\n\treturn s\n}", "title": "" }, { "docid": "ecbbfd30d5e9885b416505d7b6857eb1", "score": "0.5754727", "text": "func UpdateProduct(c *gin.Context) {\n\tid := c.Param(\"id\")\n\n\tvar item models.Product\n\n\tif config.DB.First(&item, \"id = ?\", id).RecordNotFound() {\n\t\tc.JSON(404, gin.H{\n\t\t\t\"status\": \"error\",\n\t\t\t\"message\": \"record not found\"})\n\t\tc.Abort()\n\t\treturn\n\t}\n\n\t// To make sure, it is the right store account who do the update\n\tstoreID := uint(c.MustGet(\"jwt_store_id\").(float64))\n\tif storeID != item.StoreID {\n\t\tc.JSON(403, gin.H{\n\t\t\t\"status\": \"error\",\n\t\t\t\"message\": \"this data is forbidden\"})\n\t\tc.Abort()\n\t\treturn\n\t}\n\n\t// Get Form for updating the product\n\tprice, _ := strconv.Atoi(c.PostForm(\"price\"))\n\tstock, _ := strconv.Atoi(c.PostForm(\"stock\"))\n\tweight, _ := strconv.Atoi(c.PostForm(\"weight\"))\n\tcondition, _ := strconv.ParseBool(c.PostForm(\"condition\"))\n\tcategoryRaw, _ := strconv.ParseUint(c.PostForm(\"category\"), 10, 32)\n\n\t// change category to uint\n\tcategory := uint(categoryRaw)\n\n\tif c.PostForm(\"name\") != item.Name {\n\t\t/* Check and make slug\n\t\tInitialize Model */\n\t\toldItem := []models.Product{}\n\n\t\t// Get Parameter\n\t\tslugs := slug.Make(c.PostForm(\"name\"))\n\n\t\t// Do Query\n\t\tconfig.DB.First(&oldItem, \"slug = ?\", slugs)\n\n\t\tif len(oldItem) >= 1 {\n\t\t\tslugs = slugs + \"-\" + strconv.FormatInt(time.Now().Unix(), 10)\n\t\t}\n\n\t\tconfig.DB.Model(&item).Where(\"id = ?\", id).Updates(models.Product{\n\t\t\tName: c.PostForm(\"name\"),\n\t\t\tDescription: c.PostForm(\"description\"),\n\t\t\tSlug: slugs,\n\t\t\tPrice: price,\n\t\t\tCondition: condition,\n\t\t\tInitialStock: stock,\n\t\t\tWeight: weight,\n\t\t\tStoreID: storeID,\n\t\t\tCategoryID: category,\n\t\t})\n\n\t} else {\n\t\tslugs := item.Slug\n\n\t\tconfig.DB.Model(&item).Where(\"id = ?\", id).Updates(models.Product{\n\t\t\tName: c.PostForm(\"name\"),\n\t\t\tDescription: c.PostForm(\"description\"),\n\t\t\tSlug: slugs,\n\t\t\tPrice: price,\n\t\t\tCondition: condition,\n\t\t\tInitialStock: stock,\n\t\t\tWeight: weight,\n\t\t\tStoreID: storeID,\n\t\t\tCategoryID: category,\n\t\t})\n\t}\n\n\tc.JSON(200, gin.H{\n\t\t\"status\": \"berhasil update data product\",\n\t\t\"data\": item,\n\t})\n}", "title": "" }, { "docid": "0deeea8d24bc9e1ca625d0bfbece736c", "score": "0.57260054", "text": "func (ouo *OrderonlineUpdateOne) SetProductID(id int) *OrderonlineUpdateOne {\n\touo.mutation.SetProductID(id)\n\treturn ouo\n}", "title": "" }, { "docid": "29142fd185cfde26873d7ed7556b0b1c", "score": "0.5707741", "text": "func (pu *PromotionUpdate) SetProductID(id int) *PromotionUpdate {\n\tpu.mutation.SetProductID(id)\n\treturn pu\n}", "title": "" }, { "docid": "dcb5475cc6908d79aeeae356a65f0ad8", "score": "0.5704922", "text": "func update(id int, pro Product) {\n\tif !authenticated{\n\t\tfmt.Println(errorPrefix, \"Not authenticated\")\n\t\tos.Exit(0)\n\t}\n\tfmt.Println(dbPrefix,\"Updating product { id = \",id,\" | name = \", pro.name ,\"}\")\n\tdatabase[id] = pro\n\tfmt.Println(dbPrefix,\"Updated.\")\n}", "title": "" }, { "docid": "5f0a2a9bbdb7894a004e866211cfb283", "score": "0.5694697", "text": "func (puo *PromotionUpdateOne) SetProductID(id int) *PromotionUpdateOne {\n\tpuo.mutation.SetProductID(id)\n\treturn puo\n}", "title": "" }, { "docid": "ec6faf8f2238d6e24747f91f9a305ede", "score": "0.55488265", "text": "func UpdateProduct(id string, db *sql.DB, resp *ProductResp) error {\n\tquery := `update shopalyst_product_v1.product set name = $1 , description = $2 , image_url = $3\nwhere id = $4`\n\t_, err := db.Exec(query, resp.Name, resp.Description, resp.ImageUrl, id)\n\tif err != nil {\n\t\treturn err\n\t}\n\treturn nil\n}", "title": "" }, { "docid": "116c3005baf170dc78cb1a6b89a40fd1", "score": "0.55434877", "text": "func Updateproduct(c *gin.Context) {\n\tdb := c.MustGet(\"db\").(*gorm.DB)\n\tvar product models.Product\n\tid := c.Param(\"id\")\n\tif err := db.Where(\"id = ?\", id).First(&product).Error; err != nil {\n\t\tlog.Println(\"The product is not available with this Id\", id)\n\t\tc.JSON(http.StatusBadRequest, gin.H{\"error\": \"Product not found!\"})\n\t\treturn\n\t}\n\tvar input models.Product\n\tif err := c.ShouldBindJSON(&input); err != nil {\n\t\tc.JSON(http.StatusBadRequest, gin.H{\"error\": err.Error()})\n\t\treturn\n\t}\n\tdb.Model(&product).Updates(input)\n\tc.JSON(http.StatusOK, gin.H{\"Updated Product Is\": product})\n}", "title": "" }, { "docid": "60b5242d9d2b5ade459ff388897e78e3", "score": "0.5458739", "text": "func (ruo *ReceiptUpdateOne) SetProductID(id int) *ReceiptUpdateOne {\n\truo.mutation.SetProductID(id)\n\treturn ruo\n}", "title": "" }, { "docid": "9faef3928417e8be25650773969bcae1", "score": "0.54454434", "text": "func (m *WindowsPhoneXAP) SetProductIdentifier(value *string)() {\n err := m.GetBackingStore().Set(\"productIdentifier\", value)\n if err != nil {\n panic(err)\n }\n}", "title": "" }, { "docid": "d6f79bb5aa1e27e779a8bcb6df9659b9", "score": "0.54420877", "text": "func put(id int, pro Product) {\n\tif !authenticated{\n\t\tfmt.Println(errorPrefix, \"Not authenticated\")\n\t\tos.Exit(0)\n\t}\n\tfmt.Println(dbPrefix,\"Puting product { id = \",id,\" | name = \", pro.name ,\"}\")\n\tdatabase[id] = pro\n\tfmt.Println(dbPrefix,\"Inserted.\")\n}", "title": "" }, { "docid": "bc3be06f9c64e25c654f144bbbdc8498", "score": "0.54353976", "text": "func (f *Fave) Addproduct(ownerId int, id int, accessKey string) (resp responses.Ok, err error) {\n\tparams := map[string]interface{}{}\n\n\tparams[\"owner_id\"] = ownerId\n\n\tparams[\"id\"] = id\n\n\tif accessKey != \"\" {\n\t\tparams[\"access_key\"] = accessKey\n\t}\n\n\terr = f.SendObjRequest(\"fave.addProduct\", params, &resp)\n\n\treturn\n}", "title": "" }, { "docid": "e2b2e2e859d0e9724f968443ee6e7a87", "score": "0.539686", "text": "func (o *CreateProductSnapshotRequestUsingPOSTParams) SetProductID(productID string) {\n\to.ProductID = productID\n}", "title": "" }, { "docid": "7a0d42f36a61d7b27bbfb22d2cf370a0", "score": "0.53913254", "text": "func ProductUpdate(c *gin.Context) {\r\n\tproduct := models.Product{}\r\n\tdb := models.GetDB()\r\n\tif err := c.ShouldBind(&product); err != nil {\r\n\t\tsession := sessions.Default(c)\r\n\t\tsession.AddFlash(err.Error())\r\n\t\tsession.Save()\r\n\t\tc.Redirect(http.StatusSeeOther, \"/admin/products\")\r\n\t\treturn\r\n\t}\r\n\tdb.Where(\"id in (?)\", product.ImageIds).Find(&product.Images)\r\n\tif err := db.Save(&product).Error; err != nil {\r\n\t\tc.HTML(http.StatusInternalServerError, \"errors/500\", nil)\r\n\t\tlogrus.Error(err)\r\n\t\treturn\r\n\t}\r\n\tc.Redirect(http.StatusFound, \"/admin/products\")\r\n}", "title": "" }, { "docid": "af12799cf5b044e87c20dbf00cc5e4b0", "score": "0.5388413", "text": "func UpdatePassword(ctx *crsctx.Ctx, rw web.ResponseWriter, req *web.Request) {\n\tvar (\n\t\terr error\n\t\titemInfo *models.ItemPassToken\n\t)\n\tjob := streams.NewJob(\"Confirmation\")\n\n\titemInfo = new(models.ItemPassToken)\n\tba, err := ioutil.ReadAll(req.Body)\n\tif err != nil {\n\t\tjob.EventErr(\"UpdatePassword error: \", err)\n\t\tresponse.ErrorBadRequest(response.ERROR_NO_CONTENT, rw)\n\t\treturn\n\t}\n\n\terr = json.Unmarshal(ba, itemInfo)\n\tif err != nil {\n\t\tjob.EventErr(\"UpdatePassword error: \", err)\n\t\tresponse.ErrorBadRequest(response.ERROR_REQUEST_DATA, rw)\n\t\treturn\n\t}\n\n\thash, _ := HashPassword(itemInfo.Password)\n\n\tsession := db.GetSession()\n\tvar resp models.Token\n\t_, err = session.\n\t\tSelect(\"*\").\n\t\tFrom(models.TokenRestorePassword).\n\t\tWhere(\"token=?\", itemInfo.Token).\n\t\tLoad(&resp)\n\tif err != nil {\n\t\tresponse.Error(response.ERROR_DBERROR, rw)\n\t\tjob.EventErr(\"UpdatePassword error: \", err)\n\t\treturn\n\t}\n\n\tsession = db.GetSession()\n\t_, err = session.\n\t\tUpdate(models.CustomersTableName).\n\t\tSet(\"password\", hash).\n\t\tWhere(\"id=?\", resp.IdCustomer).\n\t\tExec()\n\tif err != nil {\n\t\tjob.EventErr(\"UpdatePassword error\", err)\n\t\tresponse.ErrorInternalServer(response.ERROR_DBERROR, rw)\n\t\treturn\n\t}\n\tsession = db.GetSession()\n\tvar respUser models.InfoWithToken\n\t_, err = session.\n\t\tSelect(\"*\").\n\t\tFrom(models.CustomersTableName).\n\t\tWhere(\"id=?\", resp.IdCustomer).\n\t\tLoad(&respUser)\n\tif err != nil {\n\t\tresponse.Error(response.ERROR_DBERROR, rw)\n\t\tjob.EventErr(\"UserExist error: \", err)\n\t\treturn\n\t}\n\tsession = db.GetSession()\n\t_, err = session.\n\t\tDeleteFrom(models.TokenRestorePassword).\n\t\tWhere(\"id_customer=?\", resp.IdCustomer).\n\t\tExec()\n\tif err != nil {\n\t\tjob.EventErr(\"Confirmation error\", err)\n\t\tresponse.ErrorInternalServer(response.ERROR_DBERROR, rw)\n\t\treturn\n\t}\n\t//response.Error(\"\", rw)\n\tSetToken(rw, &respUser)\n\tjob.Complete(health.Success)\n}", "title": "" }, { "docid": "b0eb8159b7068a7e885e3a4fdd0072ab", "score": "0.537886", "text": "func (ru *ReceiptUpdate) SetProductID(id int) *ReceiptUpdate {\n\tru.mutation.SetProductID(id)\n\treturn ru\n}", "title": "" }, { "docid": "298bcfff821c9a37b792c9219e2ca880", "score": "0.53724027", "text": "func UpdateProduct(w http.ResponseWriter, r *http.Request) {\n\tvar prod Product\n\terr := json.NewDecoder(r.Body).Decode(&prod)\n\tif err != nil {\n\t\tw.WriteHeader(http.StatusBadRequest)\n\t}\n\n\tid := mux.Vars(r)[\"id\"]\n\n\tfmt.Printf(\"%#v\\n\", id)\n\tfmt.Printf(\"%#v\\n\", prod)\n\n\tfor _, product := range products {\n\t\tif product.ID == id {\n\t\t\tproduct.Name = prod.Name\n\t\t}\n\t}\n}", "title": "" }, { "docid": "ee143d88e29b2bee5d0fb4ffcb524951", "score": "0.5356432", "text": "func UpdateProduct(id int, name, description string, price float64, quantity int) {\n\tdb := db.ConnectWithPostgres()\n\tdefer db.Close()\n\n\tUpdateProduct, err := db.Prepare(\"UPDATE products SET name = $1, description = $2, price = $3, quantity = $4 WHERE id = $5\")\n\tif err != nil {\n\t\tpanic(err.Error())\n\t}\n\n\tUpdateProduct.Exec(name, description, price, quantity, id)\n}", "title": "" }, { "docid": "087d62f6aca4dcbfd3f953f133145c95", "score": "0.53393203", "text": "func (p *Product) Update(ctx context.Context, w http.ResponseWriter, r *http.Request, params map[string]string) error {\n\tctx, span := trace.StartSpan(ctx, \"handlers.Product.Update\")\n\tdefer span.End()\n\n\tclaims, ok := ctx.Value(auth.Key).(auth.Claims)\n\tif !ok {\n\t\treturn web.NewShutdownError(\"claims missing from context\")\n\t}\n\n\tv, ok := ctx.Value(web.KeyValues).(*web.Values)\n\tif !ok {\n\t\treturn web.NewShutdownError(\"web value missing from context\")\n\t}\n\n\tvar up product.UpdateProduct\n\tif err := web.Decode(r, &up); err != nil {\n\t\treturn errors.Wrap(err, \"\")\n\t}\n\n\tif err := product.Update(ctx, p.db, claims, params[\"id\"], up, v.Now); err != nil {\n\t\tswitch err {\n\t\tcase product.ErrInvalidID:\n\t\t\treturn web.NewRequestError(err, http.StatusBadRequest)\n\t\tcase product.ErrNotFound:\n\t\t\treturn web.NewRequestError(err, http.StatusNotFound)\n\t\tcase product.ErrForbidden:\n\t\t\treturn web.NewRequestError(err, http.StatusForbidden)\n\t\tdefault:\n\t\t\treturn errors.Wrapf(err, \"updating product %q: %+v\", params[\"id\"], up)\n\t\t}\n\t}\n\n\treturn web.Respond(ctx, w, nil, http.StatusNoContent)\n}", "title": "" }, { "docid": "a37920f1d10ab6ae44b15a63be1bbde6", "score": "0.5324911", "text": "func (controller *ProductController) Update(writer http.ResponseWriter, request *http.Request) {\n\tproductID, err := controller.GetRequestParamAsInt(request, \"productId\")\n\n\tif err != nil {\n\t\twriter.WriteHeader(400)\n\t\treturn\n\t}\n\n\tproduct := models.Product{}\n\terr = controller.ParseJSONBody(request, &product)\n\n\tif err != nil {\n\t\twriter.WriteHeader(400)\n\t\treturn\n\t}\n\n\tproduct.ID = productID\n\n\tif err != nil {\n\t\twriter.WriteHeader(400)\n\t\treturn\n\t}\n\n\tcontroller.productManager.Save(&product)\n}", "title": "" }, { "docid": "bb52ff8710b7b28b7e47d04fcb803f36", "score": "0.5290203", "text": "func SetNewPassword(rw web.ResponseWriter, req *web.Request) {\n\tvar (\n\t\terr error\n\t\titemInfo *models.Info\n\t)\n\tjob := streams.NewJob(\"SetNewPassword\")\n\t_, err = checkToken(rw, req)\n\tif err != nil {\n\t\tjob.EventErr(\"SetNewPassword error\", err)\n\t\tresponse.ErrorInternalServer(response.ERROR_NO_ACCESS_TOKEN, rw)\n\t\treturn\n\t}\n\n\titemInfo = new(models.Info)\n\tba, err := ioutil.ReadAll(req.Body)\n\tif err != nil {\n\t\tjob.EventErr(\"SetNewPassword error: \", err)\n\t\tresponse.ErrorBadRequest(response.ERROR_NO_CONTENT, rw)\n\t\treturn\n\t}\n\n\terr = json.Unmarshal(ba, itemInfo)\n\tif err != nil {\n\t\tjob.EventErr(\"SetNewPassword error: \", err)\n\t\tresponse.ErrorBadRequest(response.ERROR_REQUEST_DATA, rw)\n\t\treturn\n\t}\n\n\thash, _ := HashPassword(itemInfo.Password)\n\n\tsession := db.GetSession()\n\t_, err = session.\n\t\tUpdate(models.CustomersTableName).\n\t\tSet(\"password\", hash).\n\t\tWhere(\"id=?\", itemInfo.ID).\n\t\tExec()\n\tif err != nil {\n\t\tjob.EventErr(\"SetNewPassword error\", err)\n\t\tresponse.ErrorInternalServer(response.ERROR_DBERROR, rw)\n\t\treturn\n\t}\n\n\tsession = db.GetSession()\n\t_, err = session.\n\t\tDeleteFrom(models.VerCodeRestorePassword).\n\t\tWhere(\"id_customer=?\", itemInfo.ID).\n\t\tExec()\n\tif err != nil {\n\t\tjob.EventErr(\"SetNewPassword error\", err)\n\t\tresponse.ErrorInternalServer(response.ERROR_DBERROR, rw)\n\t\treturn\n\t}\n\n\tresponse.Error(\"\", rw)\n\tjob.Complete(health.Success)\n}", "title": "" }, { "docid": "323e4cab5e7113be84cac99536a0e9c7", "score": "0.52757746", "text": "func (api *API) passUpdate(id gp.UserID, newHash []byte) (err error) {\n\ts, err := api.sc.Prepare(\"UPDATE users SET password = ? WHERE id = ?\")\n\tif err != nil {\n\t\treturn\n\t}\n\t_, err = s.Exec(newHash, id)\n\treturn\n}", "title": "" }, { "docid": "06256fdf27dee9896b0983fc80dde61b", "score": "0.5273666", "text": "func (p Products) UpdateProduct(w http.ResponseWriter, r *http.Request) {\n\tvars := mux.Vars(r)\n\tid, err := strconv.Atoi(vars[\"id\"])\n\tif err != nil {\n\t\thttp.Error(w, err.Error(), http.StatusBadRequest)\n\t\treturn\n\t}\n\n\tproduct := r.Context().Value(KeyProduct{}).(data.Product)\n\n\terr = data.UpdateProduct(id, &product)\n\tif err == data.ErrProductNotFound {\n\t\thttp.Error(w, \"Product not found\", http.StatusNotFound)\n\t\treturn\n\t}\n\n\tif err != nil {\n\t\thttp.Error(w, err.Error(), http.StatusInternalServerError)\n\t\treturn\n\t}\n}", "title": "" }, { "docid": "762b21751cf549ad9feff44d0766f15a", "score": "0.52671635", "text": "func (p Products) UpdateProduct(rw http.ResponseWriter, r *http.Request) {\n\tvars := mux.Vars(r)\n\tid, err := strconv.Atoi(vars[\"id\"])\n\tif err != nil {\n\t\thttp.Error(rw, \"Unable to convert id.\", http.StatusBadRequest)\n\t}\n\n\tp.l.Println(\"Handle PUT Product\", id)\n\tprod := r.Context().Value(KeyProduct{}).(data.Product)\n\n\terr = data.UpdateProduct(id, &prod)\n\tif err == data.ErrProductNotFound {\n\t\thttp.Error(rw, \"Product not found.\", http.StatusNotFound)\n\t\treturn\n\t}\n\n\tif err != nil {\n\t\thttp.Error(rw, \"Product not found.\", http.StatusInternalServerError)\n\t\treturn\n\t}\n}", "title": "" }, { "docid": "9870624e63798652e0f7157dd5cd6f8f", "score": "0.52540123", "text": "func (ou *OrderonlineUpdate) SetTypeproductID(id int) *OrderonlineUpdate {\n\tou.mutation.SetTypeproductID(id)\n\treturn ou\n}", "title": "" }, { "docid": "9001158d95af42af6ffc62f1f35dc920", "score": "0.5247104", "text": "func UpdateProduct(c *gin.Context) {\n\tvar product models.Product\n\tif err := models.DB.Where(\"id = ?\", c.Param(\"id\")).First(&product).Error; err != nil {\n\t\tc.JSON(http.StatusBadRequest, gin.H{\"error\": \"Record not found!\"})\n\t\treturn\n\t}\n\n\tvar input UpdateProductInput\n\tif err := c.ShouldBindJSON(&input); err != nil {\n\t\tc.JSON(http.StatusBadRequest, gin.H{\"error\": err.Error()})\n\t\treturn\n\t}\n\n\tmodels.DB.Model(&product).Update(\"expiry_date\", input.ExpiryDate)\n\tmodels.DB.Model(&product).Update(\"quantity\", input.Quantity)\n\n\tc.JSON(http.StatusOK, gin.H{\"data\": product})\n}", "title": "" }, { "docid": "99d3dc58c906fbe6289432546a9f6f29", "score": "0.52369034", "text": "func (a *ProductsApiService) UsersUserIdPasswordPut(ctx context.Context, userId int32, password Password) (*http.Response, error) {\n\tvar (\n\t\tlocalVarHttpMethod = strings.ToUpper(\"Put\")\n\t\tlocalVarPostBody interface{}\n\t\tlocalVarFileName string\n\t\tlocalVarFileBytes []byte\n\t\t\n\t)\n\n\t// create path and map variables\n\tlocalVarPath := a.client.cfg.BasePath + \"/users/{user_id}/password\"\n\tlocalVarPath = strings.Replace(localVarPath, \"{\"+\"user_id\"+\"}\", fmt.Sprintf(\"%v\", userId), -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\", \"text/plain\"}\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 = &password\n\tr, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\tlocalVarHttpResponse, err := a.client.callAPI(r)\n\tif err != nil || localVarHttpResponse == nil {\n\t\treturn localVarHttpResponse, err\n\t}\n\n\tlocalVarBody, err := ioutil.ReadAll(localVarHttpResponse.Body)\n\tlocalVarHttpResponse.Body.Close()\n\tif err != nil {\n\t\treturn localVarHttpResponse, err\n\t}\n\n\n\tif localVarHttpResponse.StatusCode >= 300 {\n\t\tnewErr := GenericSwaggerError{\n\t\t\tbody: localVarBody,\n\t\t\terror: localVarHttpResponse.Status,\n\t\t}\n\t\t\n\t\treturn localVarHttpResponse, newErr\n\t}\n\n\treturn localVarHttpResponse, nil\n}", "title": "" }, { "docid": "8b9227c0f0a2a94d5f8fd34a6bfc20c5", "score": "0.52317554", "text": "func (pro *Product) Update(prod string, reply *bool) error{\n\tif !authenticated{\n\t\tfmt.Println(errorPrefix, \"Not authenticated\")\n\t\t*reply = false\n\t\treturn nil\n\t}\n\tseparateString := strings.Split(prod, \":\")\n\tid_, _ :=\tstrconv.Atoi(separateString[0])\n\tnewProduct := Product{\n\t\tid: \tid_,\n\t\tname: \tseparateString[1],\n\t\tprice: \tseparateString[2],\n\t}\n\tupdate(id_, newProduct)\t\n *reply = true\n\treturn nil\n}", "title": "" }, { "docid": "18450897f18ea3d2ec5d2776213369c0", "score": "0.5229864", "text": "func AddProduct(ctx *Context, dev config.ProductCfg) {\n\tlog.Printf(\"ADDING Product %+v\", dev)\n\taffected, err := agent.MainConfig.Database.AddProductCfg(&dev)\n\tif err != nil {\n\t\tlog.Warningf(\"Error on insert for Product %s , affected : %+v , error: %s\", dev.ID, affected, err)\n\t\tctx.JSON(404, err.Error())\n\t} else {\n\t\t//TODO: review if needed return data or affected\n\t\tctx.JSON(200, &dev)\n\t}\n}", "title": "" }, { "docid": "7cb52c8be4a583cded0cc774afc0e7a6", "score": "0.52241415", "text": "func (m *VariantMutation) SetProductID(id uuid.UUID) {\n\tm.product = &id\n}", "title": "" }, { "docid": "e30fda8bb62d2de1ef5e25f163b4bcf1", "score": "0.5217036", "text": "func (o *QueryUserIAPOrdersParams) SetProductID(productID *string) {\n\to.ProductID = productID\n}", "title": "" }, { "docid": "c67e0d6c6ab6bc42d205589c11edbb58", "score": "0.520462", "text": "func (o *UpdateVidmSSHUserPasswordUsingPOSTParams) WithContext(ctx context.Context) *UpdateVidmSSHUserPasswordUsingPOSTParams {\n\to.SetContext(ctx)\n\treturn o\n}", "title": "" }, { "docid": "7958eae43f5c3f57bf7cf5e5f278c38d", "score": "0.5198992", "text": "func (p *Product) AddProduct(rw http.ResponseWriter, r *http.Request) {\n\tp.l.Debug(\"Add a product with id\")\n\n\tprod := r.Context().Value(KeyProduct{}).(*data.Product)\n\tp.productsDB.AddToList(prod)\n\n}", "title": "" }, { "docid": "c747f96bb8634f24d95e73f61ec71c45", "score": "0.5187732", "text": "func ProductHandler(w http.ResponseWriter, r *http.Request) {\n\t// int 1 - sekian / sadad (salah) kdtx-01213 (salah)\n\tid := r.URL.Query().Get(\"id\")\n\tname := r.URL.Query().Get(\"name\")\n\n\t// jika masukkan id 0 atau kurang dari 0 salah\n\t// masukkan sejenis string / code lain itu salah\n\n\tidNumber, err := strconv.Atoi(id)\n\n\tif err != nil || idNumber <= 0 {\n\t\thttp.Error(w, \"input id number error\", http.StatusBadRequest)\n\t\treturn\n\t}\n\n\tw.Write([]byte(\"ini adalah product : \" + id + \" bernama : \" + name))\n}", "title": "" }, { "docid": "7446250bd492f3e0353b7aa7661b2bb0", "score": "0.5185639", "text": "func (ouo *OrderonlineUpdateOne) SetTypeproductID(id int) *OrderonlineUpdateOne {\n\touo.mutation.SetTypeproductID(id)\n\treturn ouo\n}", "title": "" }, { "docid": "bee815b1e0524b4c49a889f636a7ba0b", "score": "0.5185269", "text": "func (m *MockLicense) ProductIDForSwidtag(arg0 context.Context, arg1 string, arg2 *v1.QueryProducts, arg3 ...string) (string, error) {\n\tm.ctrl.T.Helper()\n\tvarargs := []interface{}{arg0, arg1, arg2}\n\tfor _, a := range arg3 {\n\t\tvarargs = append(varargs, a)\n\t}\n\tret := m.ctrl.Call(m, \"ProductIDForSwidtag\", varargs...)\n\tret0, _ := ret[0].(string)\n\tret1, _ := ret[1].(error)\n\treturn ret0, ret1\n}", "title": "" }, { "docid": "4970dfb7f64d67d8e9a650d2f9b6ba06", "score": "0.51767725", "text": "func newProductWithID(id string) (p *product) {\n\tp = &product{\n\t\tIDV: ObjectIdHex(id),\n\t}\n\tp.CalculateCreatedOn()\n\treturn\n}", "title": "" }, { "docid": "b3ec0876be3ad6d4e84550fa4016150e", "score": "0.51708853", "text": "func (p *Products) UpdateProduct(rw http.ResponseWriter, r *http.Request) {\n\trw.Header().Add(\"Content-Type\", \"application/json\")\n\n\tid, err := getProductId(r)\n\tp.l.Debug(\"Update record\", \"id\", id)\n\tif err != nil {\n\t\tp.l.Error(\"Cannot find record\", \"error\", err)\n\t\thttp.Error(rw, \"Bad request\", http.StatusBadRequest)\n\t\treturn\n\t}\n\n\tprod := r.Context().Value(middleware.ProductKey{}).(data.Product)\n\terr = p.productsDB.UpdateProduct(id, prod)\n\tif err != nil {\n\t\tp.l.Error(\"Cannot insert record\", \"error\", err)\n\t\thttp.Error(rw, \"Product not found\", http.StatusBadRequest)\n\t\treturn\n\t}\n\trw.WriteHeader(http.StatusOK)\n}", "title": "" }, { "docid": "5724373f750a4f3ae1e6b8f1d2e22adc", "score": "0.51601774", "text": "func (o *GetInventoryListsByIDProductInventoryRecordsByIDParams) SetProductID(productID string) {\n\to.ProductID = productID\n}", "title": "" }, { "docid": "5a36f2a00b849e1a83f590fc77c52b2c", "score": "0.5159435", "text": "func (o *Options) applyProduct(v string) error {\n\to.Product = v\n\treturn nil\n}", "title": "" }, { "docid": "7840eff55cf35d5849b6d5001f0a27cb", "score": "0.51476717", "text": "func ProductPatch(c echo.Context) error {\n\tdefer c.Request().Body.Close()\n\terr := validatePermission(c, \"core_product_patch\")\n\tif err != nil {\n\t\treturn returnInvalidResponse(http.StatusForbidden, err, fmt.Sprintf(\"%s\", err))\n\t}\n\n\tproductID, _ := strconv.ParseUint(c.Param(\"id\"), 10, 64)\n\n\tproduct := models.Product{}\n\tproductPayload := ProductPayload{}\n\terr = product.FindbyID(productID)\n\tif err != nil {\n\t\tNLog(\"warning\", \"ProductPatch\", map[string]interface{}{\"message\": fmt.Sprintf(\"patch product %v\", productID), \"error\": err}, c.Get(\"user\").(*jwt.Token), \"\", false)\n\n\t\treturn returnInvalidResponse(http.StatusNotFound, err, fmt.Sprintf(\"Product %v tidak ditemukan\", productID))\n\t}\n\torigin := product\n\n\tpayloadRules := govalidator.MapData{\n\t\t\"name\": []string{},\n\t\t\"service_id\": []string{\"valid_id:services\"},\n\t\t\"min_timespan\": []string{\"numeric\"},\n\t\t\"max_timespan\": []string{\"numeric\"},\n\t\t\"interest\": []string{\"numeric\"},\n\t\t\"interest_type\": []string{},\n\t\t\"record_installment_details\": []string{\"bool\"},\n\t\t\"min_loan\": []string{\"numeric\"},\n\t\t\"max_loan\": []string{\"numeric\"},\n\t\t\"fees\": []string{},\n\t\t\"collaterals\": []string{},\n\t\t\"financing_sector\": []string{},\n\t\t\"assurance\": []string{},\n\t\t\"status\": []string{\"active_inactive\"},\n\t\t\"form\": []string{},\n\t\t\"description\": []string{},\n\t}\n\tvalidate := validateRequestPayload(c, payloadRules, &productPayload)\n\tif validate != nil {\n\t\tNLog(\"warning\", \"ProductPatch\", map[string]interface{}{\"message\": \"validation error\", \"error\": validate}, c.Get(\"user\").(*jwt.Token), \"\", false)\n\n\t\treturn returnInvalidResponse(http.StatusUnprocessableEntity, validate, \"Hambatan validasi.\")\n\t}\n\n\tif len(productPayload.Name) > 0 {\n\t\tproduct.Name = productPayload.Name\n\t}\n\tif productPayload.ServiceID > 0 {\n\t\tproduct.ServiceID = productPayload.ServiceID\n\t}\n\tif productPayload.MinTimeSpan > 0 {\n\t\tproduct.MinTimeSpan = productPayload.MinTimeSpan\n\t}\n\tif productPayload.MaxTimeSpan > 0 {\n\t\tproduct.MaxTimeSpan = productPayload.MaxTimeSpan\n\t}\n\tif productPayload.Interest > 0 {\n\t\tproduct.Interest = productPayload.Interest\n\t}\n\tif len(productPayload.InterestType) > 0 {\n\t\tproduct.InterestType = productPayload.InterestType\n\t}\n\tif productPayload.MinLoan > 0 {\n\t\tproduct.MinLoan = productPayload.MinLoan\n\t}\n\tif productPayload.MaxLoan > 0 {\n\t\tproduct.MaxLoan = productPayload.MaxLoan\n\t}\n\tif len(string(productPayload.Fees.RawMessage)) > 2 {\n\t\tproduct.Fees = productPayload.Fees\n\t}\n\tif len(productPayload.Collaterals) > 0 {\n\t\tproduct.Collaterals = pq.StringArray(productPayload.Collaterals)\n\t}\n\tif len(productPayload.FinancingSector) > 0 {\n\t\tproduct.FinancingSector = pq.StringArray(productPayload.FinancingSector)\n\t}\n\tif len(productPayload.Assurance) > 0 {\n\t\tproduct.Assurance = productPayload.Assurance\n\t}\n\tif len(productPayload.Status) > 0 {\n\t\tproduct.Status = productPayload.Status\n\t}\n\tif len(string(productPayload.Form.RawMessage)) > 2 {\n\t\tproduct.Form = productPayload.Form\n\t}\n\tif product.RecordInstallmentDetails != productPayload.RecordInstallmentDetails {\n\t\tproduct.RecordInstallmentDetails = productPayload.RecordInstallmentDetails\n\t}\n\tif len(productPayload.Description) > 0 {\n\t\tproduct.Description = productPayload.Description\n\t}\n\n\terr = middlewares.SubmitKafkaPayload(product, \"product_update\")\n\tif err != nil {\n\t\tNLog(\"error\", \"ProductPatch\", map[string]interface{}{\"message\": fmt.Sprintf(\"kafka submit error on product %v\", productID), \"error\": err, \"product\": product}, c.Get(\"user\").(*jwt.Token), \"\", false)\n\n\t\treturn returnInvalidResponse(http.StatusInternalServerError, err, fmt.Sprintf(\"Gagal update produk %v\", productID))\n\t}\n\n\tNAudittrail(origin, product, c.Get(\"user\").(*jwt.Token), \"product\", fmt.Sprint(product.ID), \"update\")\n\n\treturn c.JSON(http.StatusOK, product)\n}", "title": "" }, { "docid": "b4200daff773353c4eb9889834f613b6", "score": "0.5141634", "text": "func (t *SimpleChaincode) addProduct(stub shim.ChaincodeStubInterface, args []string) pb.Response {\r\n\tfmt.Println(\"Add product...\")\r\n\tvar product Product\r\n\tvar err error\r\n\t\r\n\tisExistAsBytes,_ := stub.GetState(args[0])\r\n\r\n\tif(isExistAsBytes != nil){\r\n\t\treturn shim.Error(err.Error())\r\n\t}\r\n\r\n\tproduct.Batchid=args[0]\r\n\tproduct.Barcode=args[1]\r\n\tproduct.Manfdate=args[2]\r\n\tproduct.Expdate=args[3]\r\n\tproduct.Prdname =args[4]\r\n\tproduct.Manname=args[5]\r\n\tproduct.Ownership=args[6]\r\n\tproduct.Quantity=args[7]\r\n\tproduct.Weight=args[8]\r\n\tproduct.Temp=args[9]\r\n\tproduct.Price =args[10]\r\n\tproduct.Comment=args[11]\r\n\r\n\tproductAsBytes, _ := json.Marshal(product)\r\n\terr = stub.PutState(product.Batchid, productAsBytes)\r\n\tif err != nil {\r\n\t\treturn shim.Error(err.Error())\r\n\t}\r\n\r\n\r\n\treturn shim.Success(nil)\r\n}", "title": "" }, { "docid": "6c6fc6d480db628cc7b2bd200607d7b8", "score": "0.5138288", "text": "func (o *InventoryInventoriesSearchParams) SetProductID(productID *int32) {\n\to.ProductID = productID\n}", "title": "" }, { "docid": "91c8caac2bc472a4ecc544893c9e778c", "score": "0.5115342", "text": "func EditPassword(uuid int, password string) (err error) {\n\t_, err = db.Exec(\"UPDATE users SET password=? WHERE uuid=?\", password, uuid)\n\treturn\n}", "title": "" }, { "docid": "e353ea4711deacda55e3bccf01c3d866", "score": "0.5106114", "text": "func (h Handlers) Update(ctx context.Context, w http.ResponseWriter, r *http.Request) error {\n\tv, err := web.GetValues(ctx)\n\tif err != nil {\n\t\treturn web.NewShutdownError(\"web value missing from context\")\n\t}\n\n\tclaims, err := auth.GetClaims(ctx)\n\tif err != nil {\n\t\treturn errors.New(\"claims missing from context\")\n\t}\n\n\tvar upd product.UpdateProduct\n\tif err := web.Decode(r, &upd); err != nil {\n\t\treturn fmt.Errorf(\"unable to decode payload: %w\", err)\n\t}\n\n\tid := web.Param(r, \"id\")\n\tif err := h.Product.Update(ctx, claims, id, upd, v.Now); err != nil {\n\t\tswitch validate.Cause(err) {\n\t\tcase database.ErrInvalidID:\n\t\t\treturn validate.NewRequestError(err, http.StatusBadRequest)\n\t\tcase database.ErrNotFound:\n\t\t\treturn validate.NewRequestError(err, http.StatusNotFound)\n\t\tcase database.ErrForbidden:\n\t\t\treturn validate.NewRequestError(err, http.StatusForbidden)\n\t\tdefault:\n\t\t\treturn fmt.Errorf(\"ID[%s] User[%+v]: %w\", id, &upd, err)\n\t\t}\n\t}\n\n\treturn web.Respond(ctx, w, nil, http.StatusNoContent)\n}", "title": "" }, { "docid": "f569ccbbe34ae7300ef9c0fa17278557", "score": "0.510533", "text": "func (o GetAppsAppOutput) ProductId() pulumi.StringOutput {\n\treturn o.ApplyT(func(v GetAppsApp) string { return v.ProductId }).(pulumi.StringOutput)\n}", "title": "" }, { "docid": "bf35190083e54c4f5e1020e7ba0b764e", "score": "0.5103362", "text": "func UpdateProduct(ctx echo.Context) error {\n\treq := productUpdateRequest{}\n\tif err := ctx.Bind(&req); err != nil {\n\t\treturn ctx.JSON(BadRequest, apiResponse{Message: err.Error()})\n\t}\n\tproductId := ctx.Param(\"productId\")\n\tif productId == \"\" || productId != req.ProductId {\n\t\treturn ctx.JSON(BadRequest, apiResponse{Message: \"invalid parameter\"})\n\t}\n\n\tp := &registry.Product{\n\t\tProductId: req.ProductId,\n\t\tProductName: req.ProductName,\n\t\tTimeUpdated: time.Now(),\n\t\tDescription: req.Description,\n\t\tCategory: req.Category,\n\t}\n\n\tr := getRegistry(ctx)\n\tif err := r.UpdateProduct(p); err != nil {\n\t\treturn ctx.JSON(ServerError, apiResponse{Message: err.Error()})\n\t}\n\t// Notify kafka\n\tasyncProduceMessage(ctx,\n\t\t&message.Product{\n\t\t\tTopicName: message.TopicNameProduct,\n\t\t\tProductId: p.ProductId,\n\t\t\tAction: message.ActionUpdate,\n\t\t})\n\n\treturn ctx.JSON(OK, apiResponse{})\n}", "title": "" }, { "docid": "4e85a722171585854aae0cc487f508e0", "score": "0.51023424", "text": "func (apim *ApimClient) AssignToProduct(p string, id string) (apimanagement.APIContract, error) {\n\tcontract, err := apim.ProductsAPIClient.CreateOrUpdate(apim.Ctx, apim.ResourceGroup, apim.ServiceName, p, id)\n\tif err != nil {\n\t\treturn apimanagement.APIContract{}, err\n\t}\n\treturn contract, nil\n}", "title": "" }, { "docid": "508407eb2a84b37c20dacaa650e8b1ea", "score": "0.5099286", "text": "func productPostHandler(w http.ResponseWriter, r *http.Request) {\n\t//retrieve the UserID variable\n\tuuid := getUserID(r.Context().Value(\"user\"))\n\n\tlocation := mux.Vars(r)[\"location\"]\n\n\tproductName, ok := r.URL.Query()[\"product\"]\n\t//If we can't find the correct parameter then return a status 400.\n\tif !ok {\n\t\tfmt.Println(\"Location Name missing from request\")\n\t\tw.Header().Add(\"statusDescription\", \"400 Bad Request\")\n\t\tw.WriteHeader(http.StatusBadRequest)\n\t\tw.Write([]byte(\"400 Bad Request.\"))\n\t\treturn\n\t}\n\n\tquantity, ok := r.URL.Query()[\"quantity\"]\n\t//If we can't find the correct parameter then return a status 400.\n\tif !ok {\n\t\tfmt.Println(\"Location Name missing from request\")\n\t\tw.Header().Add(\"statusDescription\", \"400 Bad Request\")\n\t\tw.WriteHeader(http.StatusBadRequest)\n\t\tw.Write([]byte(\"400 Bad Request.\"))\n\t\treturn\n\t}\n\n\taddProduct(uuid, kitchenTable, location, productName[0], quantity[0])\n\t//Set response headers.\n\tw.Header().Add(\"statusDescription\", \"200 OK\")\n\tw.Header().Set(\"Content-Type\", \"application/json\")\n\tw.WriteHeader(http.StatusOK)\n\treturn\n}", "title": "" }, { "docid": "5537eea45c140aaddf6ae4bc90b4b5e7", "score": "0.5096654", "text": "func UpdateProduct(oldID uint, new *models.Product) error {\n\tdb, err := Connect()\n\tif err != nil {\n\t\treturn err\n\t}\n\tdefer db.Close()\n\n\t//must have id\n\tif oldID == 0 {\n\t\treturn errors.New(\"ID cannot be 0\")\n\t}\n\n\terr = new.CalcPriority()\n\tif err != nil {\n\t\treturn err\n\t}\n\n\t_, err = db.Exec(`\n\t\tupdate products\n\t\tset title=?, categoryID=(select id from categories where title=?), price=?, storeID=(select id from stores where name=?), imageURL=?, affiliateURL=?, productURL=?, priority=?, commissionPercent=?\n\t\twhere id=? ;\n\n\t`, new.Title, new.Category, new.Price, new.Store, new.ImageURL, new.AffiliateURL, new.ProductURL, new.Priority, new.CommissionPercent, oldID)\n\n\tif err != nil {\n\t\treturn err\n\t}\n\n\treturn nil\n}", "title": "" }, { "docid": "1764bfee2103ba58c98d9d2ee8075971", "score": "0.50884247", "text": "func (ruo *RestaurantUpdateOne) AddProductIDs(ids ...int) *RestaurantUpdateOne {\n\truo.mutation.AddProductIDs(ids...)\n\treturn ruo\n}", "title": "" }, { "docid": "8e79a46c680821ae0a5161ffa77b5ea1", "score": "0.5082028", "text": "func (h *ProductHandler) HandlePut(w http.ResponseWriter, r *http.Request) {\n\tparams := mux.Vars(r)\n\tproductID, ok := params[\"productID\"]\n\tif !ok {\n\t\t// Bad Request\n\t\tw.WriteHeader(400)\n\t\treturn\n\t}\n\tbody, err := ioutil.ReadAll(r.Body)\n\tif err != nil {\n\t\t// Internal Server Error\n\t\tw.WriteHeader(500)\n\t\tw.Write([]byte(err.Error()))\n\t\treturn\n\t}\n\t// validate input\n\tproduct, err := validateProductFieldsAllPresented(body)\n\tif err != nil {\n\t\t// Bad Request\n\t\tw.WriteHeader(400)\n\t\tw.Write([]byte(err.Error()))\n\t\treturn\n\t}\n\tif product.ProductID != \"\" && product.ProductID != productID {\n\t\t// Bad Request\n\t\tw.WriteHeader(400)\n\t\tw.Write([]byte(\"invalid data\"))\n\t\treturn\n\t}\n\t// sets product.productID if it's empty\n\tproduct.ProductID = productID\n\n\t// Upsert to ensure idempotent\n\tif err := h.backend.Upsert(product); err != nil {\n\t\t// Forbidden\n\t\tw.WriteHeader(403)\n\t\tw.Write([]byte(err.Error()))\n\t\treturn\n\t}\n\t// Created\n\tw.WriteHeader(201)\n\treturn\n}", "title": "" }, { "docid": "2f616378825a9bf2cf46b904179c2431", "score": "0.5067381", "text": "func (o GetProductsProductOutput) ProductId() pulumi.StringOutput {\n\treturn o.ApplyT(func(v GetProductsProduct) string { return v.ProductId }).(pulumi.StringOutput)\n}", "title": "" }, { "docid": "440dac512cb5c6786c7d9b80a0e44c69", "score": "0.50606", "text": "func SetPassword(userid int64, newpass string) error {\n\thash, err := bcrypt.GenerateFromPassword([]byte(newpass), 12)\n\tif err != nil {\n\t\tlog.Printf(\"error generating hash: %s\", err)\n\t\treturn fmt.Errorf(\"error\")\n\t}\n\t_, err = stmtUpdateUser.Exec(hash, userid)\n\tif err != nil {\n\t\tlog.Printf(\"login: error updating user: %s\", err)\n\t\treturn fmt.Errorf(\"error\")\n\t}\n\n\terr = deleteauth(userid)\n\tif err != nil {\n\t\tlog.Printf(\"login: error deleting old auth: %s\", err)\n\t\treturn fmt.Errorf(\"error\")\n\t}\n\treturn nil\n}", "title": "" }, { "docid": "e5ade2338d11d58d4b740f12d0d5b8f1", "score": "0.5049718", "text": "func (o *PatchInventoryListsByIDProductInventoryRecordsByIDParams) SetProductID(productID string) {\n\to.ProductID = productID\n}", "title": "" }, { "docid": "5fe0fa1186070322841e23057db1f6ce", "score": "0.50460094", "text": "func UpdateRecipyProduct(c *gin.Context) {\n\tvar product models.Product\n\tif err := models.DB.Where(\"id = ?\", c.Param(\"id\")).First(&product).Error; err != nil {\n\t\tc.JSON(http.StatusBadRequest, gin.H{\"error\": \"Record not found!\"})\n\t\treturn\n\t}\n\n\tvar input UpdateProductInput\n\tif err := c.ShouldBindJSON(&input); err != nil {\n\t\tc.JSON(http.StatusBadRequest, gin.H{\"error\": err.Error()})\n\t\treturn\n\t}\n\n\tmodels.DB.Model(&product).Update(\"expiry_date\", input.ExpiryDate)\n\tmodels.DB.Model(&product).Update(\"quantity\", input.Quantity)\n\n\tc.JSON(http.StatusOK, gin.H{\"data\": product})\n}", "title": "" }, { "docid": "48c75f8987c4b458fb27eb086f8fb73d", "score": "0.5024969", "text": "func updateProductById(id int, products *[]product) {\n\tvar newStock int\n\tfmt.Println()\n\tfmt.Print(\"Enter the New quantity of the Product: \")\n\tfmt.Scanf(\"%d\", &newStock)\n\n\tfor i, p := range *products {\n\t\tif p.id == id {\n\t\t\t(*products)[i] = product{id, p.name, newStock}\n\t\t}\n\t}\n}", "title": "" }, { "docid": "48915eb576308f8e050fd41afd670ec4", "score": "0.5024064", "text": "func (p *Products) UpdateProduct(rw http.ResponseWriter, r *http.Request) {\n\tp.log.Println(\"Handle PUT Product request\")\n\n\tvars := mux.Vars(r)\n\tid, err := strconv.Atoi(vars[\"id\"])\n\tif err != nil {\n\t\thttp.Error(rw, \"Unable to convert id\", http.StatusBadRequest)\n\t\treturn\n\t}\n\n\tproduct := r.Context().Value(KeyProduct{}).(data.Product)\n\n\terr = data.UpdateProduct(id, &product)\n\tif err == data.ErrorProductNotFound {\n\t\thttp.Error(rw, \"Product not found\", http.StatusNotFound)\n\t\treturn\n\t}\n\n\tif err != nil {\n\t\thttp.Error(rw, \"Product not found\", http.StatusInternalServerError)\n\t\treturn\n\t}\n}", "title": "" }, { "docid": "bc049600a9482c969da9b2b2819c968c", "score": "0.50193864", "text": "func CreateProduct(c *gin.Context) {\n\t// Get Store ID from Authorization token\n\tstoreID := uint(c.MustGet(\"jwt_store_id\").(float64))\n\n\t/* Check and make slug\n\tInitialize Model */\n\toldItem := []models.Product{}\n\n\t// Get Parameter\n\tslug := slug.Make(c.PostForm(\"name\"))\n\n\t// Do Query\n\tconfig.DB.First(&oldItem, \"slug = ?\", slug)\n\n\tif len(oldItem) >= 1 {\n\t\tslug = slug + \"-\" + strconv.FormatInt(time.Now().Unix(), 10)\n\t}\n\n\t// set Parameter POST\n\tprice, _ := strconv.Atoi(c.PostForm(\"price\"))\n\tstock, _ := strconv.Atoi(c.PostForm(\"stock\"))\n\tweight, _ := strconv.Atoi(c.PostForm(\"weight\"))\n\tcondition, _ := strconv.ParseBool(c.PostForm(\"condition\"))\n\tcategoryRaw, _ := strconv.ParseUint(c.PostForm(\"category\"), 10, 32)\n\n\t// change category to uint\n\tcategory := uint(categoryRaw)\n\n\t// Get Form\n\titem := models.Product{\n\t\tName: c.PostForm(\"name\"),\n\t\tSlug: slug,\n\t\tDescription: c.PostForm(\"description\"),\n\t\tPrice: price,\n\t\tCondition: condition,\n\t\tInitialStock: stock,\n\t\tWeight: weight,\n\t\tStoreID: storeID,\n\t\tCategoryID: category,\n\t}\n\n\tif err := config.DB.Create(&item).Error; err != nil {\n\t\tc.JSON(500, gin.H{\n\t\t\t\"status\": \"error\",\n\t\t\t\"message\": err})\n\t\tc.Abort()\n\t\treturn\n\t}\n\n\tc.JSON(200, gin.H{\n\t\t\"status\": \"successfuly register user, please check your email\",\n\t\t\"data\": item,\n\t})\n}", "title": "" }, { "docid": "28a79b0fa2ad710b14c45b6d38f6e2b7", "score": "0.5014157", "text": "func (o *UpdateVidmSSHUserPasswordUsingPOSTParams) WithEnvironmentID(environmentID string) *UpdateVidmSSHUserPasswordUsingPOSTParams {\n\to.SetEnvironmentID(environmentID)\n\treturn o\n}", "title": "" }, { "docid": "20cd50b1eac5e9826be10add4f2cde9f", "score": "0.5013877", "text": "func (ru *RestaurantUpdate) AddProductIDs(ids ...int) *RestaurantUpdate {\n\tru.mutation.AddProductIDs(ids...)\n\treturn ru\n}", "title": "" }, { "docid": "39be25aafdff98336ff3de0d23183fe1", "score": "0.5012015", "text": "func (t *SimpleChaincode) updateProduct(stub shim.ChaincodeStubInterface, args []string) pb.Response {\n\tvar err error\n\n\t// 0 1 2 3 4\n\t// \"Book\", \"Go Tutorial\", \"Registered\", \"OrgA\", \"1530532962\"\n\tif len(args) < 5 {\n\t\treturn shim.Error(\"Incorrect number of arguments. Expecting 5\")\n\t}\n\n\t// ==== Input sanitation ====\n\tfor k, v := range args {\n\t\tif len(v) <= 0 {\n\t\t\treturn shim.Error(strconv.Itoa(k+1) + \"st argument must be a non-empty string\")\n\t\t}\n\t}\n\n\tproductName := args[0]\n\tnewDesc := args[1]\n\tnewState, err := strconv.Atoi(args[2])\n\tif err != nil {\n\t\treturn shim.Error(\"Product state must be int. Error: \" + err.Error())\n\t}\n\tnewOwner := strings.ToLower(args[3])\n\tlastUpdated, err := strconv.Atoi(args[4])\n\tif err != nil {\n\t\treturn shim.Error(\"Product date updated must be timestamp. Error: \" + err.Error())\n\t}\n\n\tproductAsBytes, err := stub.GetState(productName)\n\tif err != nil {\n\t\treturn shim.Error(\"Failed to get product:\" + err.Error())\n\t} else if productAsBytes == nil {\n\t\treturn shim.Error(\"Product does not exist\")\n\t}\n\n\tproductToUpdate := Product{}\n\terr = json.Unmarshal(productAsBytes, &productToUpdate) //unmarshal it aka JSON.parse()\n\tif err != nil {\n\t\treturn shim.Error(err.Error())\n\t}\n\n\t// ==== Check if state not legal ====\n\tlegalState := mapKey(productStateMachine, newState)\n\tlegalStateMachine := checkNewState(productStateMachine, productToUpdate.State, newState)\n\tif !legalState || !legalStateMachine {\n\t\treturn shim.Error(\"Not legal product state\")\n\t}\n\tproductToUpdate.Desc = newDesc\n\tproductToUpdate.State = newState\n\tproductToUpdate.Owner = newOwner\n\tproductToUpdate.LastUpdated = lastUpdated\n\n\tproductJSONasBytes, _ := json.Marshal(productToUpdate)\n\terr = stub.PutState(productName, productJSONasBytes) //rewrite the product\n\tif err != nil {\n\t\treturn shim.Error(err.Error())\n\t}\n\n\t// maintain the index\n\tif productToUpdate.State != newState {\n\t\t//delete old index\n\t\tindexName := \"state~name\"\n\t\tstateIndexKey, err := stub.CreateCompositeKey(indexName, []string{strconv.Itoa(productToUpdate.State), productToUpdate.Name})\n\t\tif err != nil {\n\t\t\treturn shim.Error(err.Error())\n\t\t}\n\n\t\t// Delete index entry to state.\n\t\terr = stub.DelState(stateIndexKey)\n\t\tif err != nil {\n\t\t\treturn shim.Error(\"Failed to delete state:\" + err.Error())\n\t\t}\n\t\t//create new index\n\t\tstateIndexKey, err = stub.CreateCompositeKey(indexName, []string{strconv.Itoa(newState), productToUpdate.Name})\n\t\tif err != nil {\n\t\t\treturn shim.Error(err.Error())\n\t\t}\n\t\t// Save index entry to state. Only the key name is needed, no need to store a duplicate copy of the product.\n\t\t// Note - passing a 'nil' value will effectively delete the key from state, therefore we pass null character as value\n\t\tvalue := []byte{0x00}\n\t\tstub.PutState(stateIndexKey, value)\n\t}\n\t// ==== Product updated and indexed. Return success ====\n\tlogger.Debug(\"- end update product\")\n\treturn shim.Success(nil)\n}", "title": "" }, { "docid": "f82ef22a064564687ebd74f616c13279", "score": "0.5003112", "text": "func Update(ctx context.Context, db *sqlx.DB, user auth.Claims, id string, update UpdateProduct, now time.Time) error {\n\n\tctx, span := trace.StartSpan(ctx, \"internal.product.Update\")\n\tdefer span.End()\n\n\t// Use the retrieve function to get the product to be updated.\n\tp, err := Retrieve(ctx, db, id)\n\tif err != nil {\n\t\treturn err\n\t}\n\n\t// Only allow this action to be performed by an admin\n\t// or the owner of this product.\n\tif !user.HasRole(auth.RoleAdmin) && p.UserID != user.Subject {\n\t\treturn ErrForbidden\n\t}\n\n\t// Only update fields that have been passed as all fields are optional\n\tif update.Name != nil {\n\t\tp.Name = *update.Name\n\t}\n\tif update.Cost != nil {\n\t\tp.Cost = *update.Cost\n\t}\n\tif update.Quantity != nil {\n\t\tp.Quantity = *update.Quantity\n\t}\n\tp.DateUpdated = now\n\n\tconst q = `UPDATE products SET\n \"name\" = $2,\n \"cost\" = $3,\n \"quantity\" = $4,\n \"date_updated\" = $5\n WHERE product_id = $1`\n\t_, err = db.ExecContext(ctx, q, id,\n\t\tp.Name, p.Cost,\n\t\tp.Quantity, p.DateUpdated,\n\t)\n\tif err != nil {\n\t\treturn errors.Wrap(err, \"updating product\")\n\t}\n\n\treturn nil\n}", "title": "" }, { "docid": "d9410d2d0b8fc45a662c01bde9b0b92f", "score": "0.49966115", "text": "func (r Repository) UpdateProduct(product Product) bool {\n\tsession, err := mgo.Dial(SERVER)\n\tdefer session.Close()\n\n\terr = session.DB(DBNAME).C(COLLECTION).UpdateId(product.ID, product)\n\n\tif err != nil {\n\t\tlog.Fatal(err)\n\t\treturn false\n\t}\n\n\tfmt.Println(\"Updated Product ID - \", product.ID)\n\n\treturn true\n}", "title": "" }, { "docid": "687e6bd8db0557d28d569af21cdd4cd1", "score": "0.4992781", "text": "func (o *UpsertMetadataForProductParams) WithProductID(ProductID string) *UpsertMetadataForProductParams {\n\to.ProductID = ProductID\n\treturn o\n}", "title": "" }, { "docid": "950d2771faac15336bdd43554fb5b3ee", "score": "0.49864158", "text": "func (o *GetLolGamhsV1ProductsByProductIDCurrentSummonerMatchesParams) WithProductID(productID string) *GetLolGamhsV1ProductsByProductIDCurrentSummonerMatchesParams {\n\to.SetProductID(productID)\n\treturn o\n}", "title": "" }, { "docid": "ff04df9cd657fd22a40248f98bd410c3", "score": "0.49822354", "text": "func UpdateUserPassword(context interface{}, db *db.DB, u *User, password string) error {\n\tlog.Dev(context, \"UpdateUserPassword\", \"Started : PublicID[%s]\", u.PublicID)\n\n\tif err := u.Validate(); err != nil {\n\t\tlog.Error(context, \"UpdateUserPassword\", err, \"Completed\")\n\t\treturn err\n\t}\n\n\tif len(password) < 8 {\n\t\terr := errors.New(\"Invalid password length\")\n\t\tlog.Error(context, \"UpdateUserPassword\", err, \"Completed\")\n\t\treturn err\n\t}\n\n\tnewPassHash, err := crypto.BcryptPassword(u.PrivateID + password)\n\tif err != nil {\n\t\tlog.Error(context, \"UpdateUserPassword\", err, \"Completed\")\n\t\treturn err\n\t}\n\n\tf := func(c *mgo.Collection) error {\n\t\tq := bson.M{\"public_id\": u.PublicID}\n\t\tupd := bson.M{\"$set\": bson.M{\"password\": newPassHash, \"modified_at\": time.Now().UTC()}}\n\t\tlog.Dev(context, \"UpdateUserPassword\", \"MGO : db.%s.Update(%s, CAN'T SHOW)\", c.Name, mongo.Query(q))\n\t\treturn c.Update(q, upd)\n\t}\n\n\tif err := db.ExecuteMGO(context, Collection, f); err != nil {\n\t\tlog.Error(context, \"UpdateUserPassword\", err, \"Completed\")\n\t\treturn err\n\t}\n\n\tlog.Dev(context, \"UpdateUserPassword\", \"Completed\")\n\treturn nil\n}", "title": "" }, { "docid": "2d00409f0350c431668869c807faf08c", "score": "0.49819958", "text": "func (p *Products) UpdateProduct(resp http.ResponseWriter, req *http.Request) {\n\tresp.Header().Set(\"Content-Type\", \"application/json\")\n\n\tprod := req.Context().Value(KeyProduct{}).(data.Product)\n\tp.log.Debug(\"Updating product\", \"id\", prod.ID)\n\n\terr := p.productDB.UpdateProduct(prod)\n\tif err == data.ErrProductNotFound {\n\t\tresp.WriteHeader(http.StatusNotFound)\n\t\tdata.ToJSON(&GenericError{Message: \"Product not found in database\"}, resp)\n\t\treturn\n\t}\n\tif err != nil {\n\t\thttp.Error(resp, \"Internal server error\", http.StatusInternalServerError)\n\t\treturn\n\t}\n\n\tresp.WriteHeader(http.StatusNoContent)\n}", "title": "" }, { "docid": "15166518126cbae20c8f93258f8c947c", "score": "0.49765673", "text": "func (o *UpdateStockReceiptItemParams) SetProductID(productID string) {\n\to.ProductID = productID\n}", "title": "" }, { "docid": "12657757ce8366afc4ebb2956bae35c1", "score": "0.49595314", "text": "func (p *Products) AddProduct(resp http.ResponseWriter, req *http.Request) {\n\tresp.Header().Set(\"Content-Type\", \"application/json\")\n\n\tprod := req.Context().Value(KeyProduct{}).(data.Product)\n\n\tp.log.Debug(\"Inserting product\", \"product\", prod)\n\n\tp.productDB.AddProduct(prod)\n\n}", "title": "" }, { "docid": "17dc61d80735addec857800955286126", "score": "0.4958811", "text": "func UpdatePackageProductRowsByPackageIDProductID(ctx context.Context, db SQLHandle, changeset PackageProductValues, keys ...interface{}) (numRows int64, err error) {\n\tnumRows, err = execWithJSONArgs(ctx, db, SQLUpdatePackageProductRowsByPackageIDProductID, changeset, keys)\n\tif err != nil {\n\t\treturn numRows, formatError(\"UpdatePackageProductRowsByPackageIDProductID\", err)\n\t}\n\treturn numRows, nil\n}", "title": "" }, { "docid": "e7874df6b84e9cafabf0b68af01df621", "score": "0.49582085", "text": "func UpdatePasswordByID(conn *sql.Tx, m *User) (int64, error) {\n\tquery := \"UPDATE s3web.users SET password_sha256=digest($2, 'sha256'), update_at=CURRENT_TIMESTAMP WHERE id=$1;\"\n\targs := []interface{}{m.ID, m.Password}\n\n\tr, err := conn.Exec(query, args...)\n\tif err != nil {\n\t\treturn 0, err\n\t}\n\n\treturn r.RowsAffected()\n}", "title": "" }, { "docid": "7e1c8815f7d4437a63940b50bf476153", "score": "0.4955967", "text": "func UpdatePassword(userStore *store.UserStore, newPassword, userID string) (*models.PublicUserInfo, error) {\n\tvar storedUser *models.UserCredentials\n\tvar err error\n\n\tstoredUser, err = userStore.GetUser(bson.M{\"username\": userID, \"kind\": models.LocalAuth})\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\thashedPassword, err := bcrypt.GenerateFromPassword([]byte(newPassword), types.PasswordEncryptionCost)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\tstoredUser.Password = string(hashedPassword)\n\n\tif storedUser.State == models.StateCreated {\n\t\tstoredUser.State = models.StateActive\n\t}\n\n\terr = userStore.UpdateUser(storedUser)\n\treturn storedUser.GetPublicInfo(), err\n}", "title": "" }, { "docid": "bc664e2b9f334d05c430e2126a3de1c8", "score": "0.49551994", "text": "func UpdateUserPassword(c *gin.Context) {\n\ttype newPassword struct {\n\t\tPassword string `json:\"password\" binding:\"required\"`\n\t}\n\n\t// parse object id from url path\n\tif !bson.IsObjectIdHex(c.Param(\"id\")) {\n\t\tc.JSON(http.StatusBadRequest, errRes{\n\t\t\tStatus: http.StatusBadRequest,\n\t\t\tMessage: \"Invaild id\",\n\t\t})\n\t\treturn\n\t}\n\n\toid := bson.ObjectIdHex(c.Param(\"id\"))\n\n\t// get user id\n\tidStr, ok := c.Get(\"user_id\")\n\tif !ok || !bson.IsObjectIdHex(idStr.(string)) {\n\t\tc.JSON(http.StatusUnauthorized, errRes{\n\t\t\tStatus: http.StatusUnauthorized,\n\t\t\tMessage: \"Invalid JWT token\",\n\t\t})\n\t\treturn\n\t}\n\tuserID := bson.ObjectIdHex(idStr.(string))\n\n\tif userID != oid {\n\t\tc.JSON(http.StatusForbidden, errRes{\n\t\t\tStatus: http.StatusForbidden,\n\t\t\tMessage: \"Can't change other user's password\",\n\t\t})\n\t\treturn\n\t}\n\n\tnewPsw := new(newPassword)\n\tif err := c.ShouldBindJSON(newPsw); err != nil {\n\t\tc.JSON(http.StatusBadRequest, errRes{\n\t\t\tStatus: http.StatusBadRequest,\n\t\t\tMessage: \"Bad Request\",\n\t\t})\n\t\treturn\n\t}\n\n\tvar user structure.User\n\tvar err error\n\tuser.PasswordHash, err = bcrypt.GenerateFromPassword(\n\t\t[]byte(newPsw.Password),\n\t\tbcrypt.DefaultCost,\n\t)\n\tif err != nil {\n\t\tc.JSON(http.StatusInternalServerError, errRes{\n\t\t\tStatus: http.StatusInternalServerError,\n\t\t\tMessage: \"Internal server error\",\n\t\t})\n\t\treturn\n\t}\n\n\terr = database.UpdateUser(\n\t\tbson.M{\n\t\t\t\"_id\": oid,\n\t\t},\n\t\tuser,\n\t)\n\tif err != nil {\n\t\tif err == database.ErrNoUser {\n\t\t\tc.JSON(http.StatusNotFound, errRes{\n\t\t\t\tStatus: http.StatusNotFound,\n\t\t\t\tMessage: \"No such user\",\n\t\t\t})\n\t\t\treturn\n\t\t}\n\n\t\tc.JSON(http.StatusInternalServerError, errRes{\n\t\t\tStatus: http.StatusInternalServerError,\n\t\t\tMessage: \"Internal server error\",\n\t\t})\n\t\treturn\n\t}\n\n\tc.JSON(http.StatusNoContent, nil)\n}", "title": "" }, { "docid": "fb81d538f8a4b7f9e957b0b1574db207", "score": "0.49526897", "text": "func (r *Registry) SaveProduct(product *models.Product, reply *models.Product) error {\n\tdb, err := getDB()\n\tif err != nil {\n\t\treturn err\n\t}\n\n\tif product.ID == 0 {\n\t\t// create product\n\t\terr = db.Save(product).Error\n\t\tif err != nil {\n\t\t\treturn err\n\t\t}\n\n\t\tkey, err := r.keygen.GenRandomKey(int64(product.ID))\n\t\tif err != nil {\n\t\t\treturn err\n\t\t}\n\n\t\tproduct.ProductKey = key\n\t}\n\n\terr = db.Save(product).Error\n\tif err != nil {\n\t\treturn err\n\t}\n\n\tcache := getCache()\n\tcacheKey := fmt.Sprintf(\"Product:%v\", product.ID)\n\tif _, ok := cache.Get(cacheKey); ok {\n\t\tcache.Delete(cacheKey)\n\t}\n\n\tsetProduct(reply, product)\n\n\treturn nil\n}", "title": "" }, { "docid": "861d574348c548dba73b996bba01b3ff", "score": "0.4941517", "text": "func AddProduct(p catalog.Product) error {\n\t// Marshal the newly updated product struct\n\tpayload, err := p.Marshal()\n\tif err != nil {\n\t\treturn err\n\t}\n\n\t// Create a map of DynamoDB Attribute Values containing the table keys\n\tkm := make(map[string]*dynamodb.AttributeValue)\n\tkm[\"PK\"] = &dynamodb.AttributeValue{\n\t\tS: aws.String(\"PRODUCT\"),\n\t}\n\tkm[\"SK\"] = &dynamodb.AttributeValue{\n\t\tS: aws.String(p.ID),\n\t}\n\n\t// Create a map of DynamoDB Attribute Values containing the table data elements\n\tem := make(map[string]*dynamodb.AttributeValue)\n\tem[\":payload\"] = &dynamodb.AttributeValue{\n\t\tS: aws.String(string(payload)),\n\t}\n\n\tuii := &dynamodb.UpdateItemInput{\n\t\tTableName: aws.String(table),\n\t\tKey: km,\n\t\tExpressionAttributeValues: em,\n\t\tUpdateExpression: aws.String(\"SET Payload = :payload\"),\n\t}\n\n\t_, err = dbs.UpdateItem(uii)\n\tif err != nil {\n\t\treturn err\n\t}\n\n\treturn nil\n}", "title": "" }, { "docid": "a122151e7cc7e298119a29aad28f6496", "score": "0.4931115", "text": "func UpdatePassword(c *fiber.Ctx) error {\n\t// parameters from the url will be store here.\n\tvar data map[string]string\n\n\t// Getting the data from the params\n\tif err := c.BodyParser(&data); err != nil {\n\t\treturn c.JSON(fiber.Map{\n\t\t\t\"message\": err,\n\t\t})\n\t}\n\n\t// Checking if the password matches\n\tif data[\"password\"] != data[\"password_confirm\"] {\n\t\tc.Status(400)\n\t\treturn c.JSON(fiber.Map{\n\t\t\t\"message\": \"passwords do not match\",\n\t\t})\n\t}\n\n\t// Getting the user id\n\tid, _ := middlewares.GetUserId(c)\n\n\t// Setting the user information\n\tuser := models.User{\n\t\t//Id: id,\n\t}\n\t// using in this way because the struct has embedded structs, and we cannot use id inside the struct.\n\tuser.Id = id\n\n\t// Setting the user password\n\tuser.SetPassword(data[\"password\"])\n\n\t// Updating the user\n\tdatabase.DB.Model(&user).Updates(&user)\n\n\t// Just return the success message\n\treturn c.JSON(fiber.Map{\n\t\t\"message\": \"Password was updated successfully\",\n\t})\n\n}", "title": "" }, { "docid": "31d9f269f9304c3162ec94e7ad3f9f3c", "score": "0.49279094", "text": "func Findproductbyid(c *gin.Context) {\n\tvar product models.Product\n\tdb := c.MustGet(\"db\").(*gorm.DB)\n\tid := c.Param(\"id\")\n\tif err := db.Where(\"id = ?\", id).First(&product).Error; err != nil {\n\t\tlog.Println(\"The product is not found with this Id:\", id)\n\t\tc.JSON(http.StatusBadRequest, gin.H{\"error\": \"Product not found!\"})\n\t\treturn\n\t}\n\tc.JSON(http.StatusOK, gin.H{\"Product\": product})\n}", "title": "" }, { "docid": "3841dea0088e602d3ab281bffbd112a9", "score": "0.49032223", "text": "func (s *Server) updateProduct(writer http.ResponseWriter, request *http.Request) {\n\tproduct := &types.Product{}\n\terr := json.NewDecoder(request.Body).Decode(&product)\n\tif err != nil {\n\t\tlog.Println(err)\n\t\thttp.Error(writer, http.StatusText(http.StatusBadRequest), http.StatusBadRequest)\n\t\treturn\n\t}\n\n\tstatus, err := s.adminSvc.UpdateProduct(request.Context(), product)\n\tif err == ErrCategoryDoesNotExist && status.Status == false {\n\t\tlog.Println(err)\n\t\thttp.Error(writer, http.StatusText(http.StatusBadRequest), http.StatusBadRequest)\n\t\treturn\n\t}\n\tif status.Status == false {\n\t\tlog.Println(err)\n\t\thttp.Error(writer, http.StatusText(http.StatusBadRequest), http.StatusBadRequest)\n\t\treturn\n\t}\n\n\tif err != nil {\n\t\tlog.Println(err)\n\t\thttp.Error(writer, http.StatusText(http.StatusInternalServerError), http.StatusInternalServerError)\n\t\treturn\n\t}\n\n\tdata, err := json.Marshal(status)\n\tif err != nil {\n\t\tlog.Println(err)\n\t\thttp.Error(writer, http.StatusText(http.StatusInternalServerError), http.StatusInternalServerError)\n\t\treturn\n\t}\n\n\twriter.Header().Set(\"Content-Type\", \"application/json\")\n\t_, err = writer.Write(data)\n\tif err != nil {\n\t\tlog.Println(err)\n\t\thttp.Error(writer, http.StatusText(http.StatusInternalServerError), http.StatusInternalServerError)\n\t\treturn\n\t}\n}", "title": "" }, { "docid": "46415ecab3cf6330a29e48b3ff92feeb", "score": "0.49009624", "text": "func (h *Handler) updateAPIProduct(c *gin.Context) handlerResponse {\n\n\tvar updatedAPIProduct types.APIProduct\n\tif err := c.ShouldBindJSON(&updatedAPIProduct); err != nil {\n\t\treturn handleBadRequest(err)\n\t}\n\tstoredAPIProduct, err := h.service.APIProduct.Update(updatedAPIProduct, h.who(c))\n\tif err != nil {\n\t\treturn handleError(err)\n\t}\n\treturn handleOK(storedAPIProduct)\n}", "title": "" }, { "docid": "1f3f5cb52f64c5a19a9c352693adb15d", "score": "0.4895968", "text": "func (this *UserAgent) AddProductToken(pt string) {\n\tthis.productTokens.PushBack(pt)\n}", "title": "" }, { "docid": "dc2b6c4280076c82e5079bd1c5af3cbc", "score": "0.48854864", "text": "func AddProduct(p *Product) {\n\tp.ID = getNextID()\n\tproductList = append(productList, p)\n}", "title": "" }, { "docid": "dc2b6c4280076c82e5079bd1c5af3cbc", "score": "0.48854864", "text": "func AddProduct(p *Product) {\n\tp.ID = getNextID()\n\tproductList = append(productList, p)\n}", "title": "" }, { "docid": "b33973a47fe5061cd8e5c4d5acb9266c", "score": "0.48744068", "text": "func SetPasswd(c *gin.Context) {\n\tid, _ := strconv.ParseUint(c.Param(\"id\"), 10, 64)\n\tvar json Password\n\tif err := c.ShouldBindJSON(&json); err != nil {\n\t\tutil.JSON(c, gin.H{\"message\": err.Error()})\n\t}\n\tpassword := json.Password\n\tpasswordHash, err := util.Hash(password)\n\tif err != nil {\n\t\tutil.JSON(c, gin.H{\"message\": err.Error()})\n\t}\n\tvar staff model.ShopStaff\n\trows, err := model.UpdateShopStaffPwd(staff, id, passwordHash)\n\tif err != nil {\n\t\tutil.JSON(c, gin.H{\"message\": err.Error()})\n\t}\n\tutil.JSON(c, gin.H{\"message\": \"success\", \"rows\": rows})\n}", "title": "" }, { "docid": "375c075c77984f468770a70eea28eab5", "score": "0.4873882", "text": "func updatePassword(id string, password string) bool {\n\tdb := mysql.New(\"tcp\", \"\", DBHost+\":\"+DBPort, DBUser, DBPassword, DBName)\n\n\terr := db.Connect()\n\tif err != nil {\n\t\t//panic(err)\n\t\treturn false\n\t}\n\n\tquery := \"UPDATE user SET \"\n\tquery = query + \"pwd = SHA1('\" + password + \"'), \"\n\tquery = query + \"resetcode = '' \"\n\tquery = query + \"WHERE id = \" + id\n\n\tfmt.Println(query)\n\t_, res, err := db.Query(query)\n\tif res == nil {\n\t\t//Do nothing\n\t}\n\tif err != nil {\n\t\t//panic(err)\n\t\treturn false\n\t}\n\n\treturn true\n}", "title": "" }, { "docid": "edcab665ad921b6e8226c9bda876346f", "score": "0.48718587", "text": "func (r Repository) AddProduct(product Product) bool {\n\tsession, err := mgo.Dial(SERVER)\n\tdefer session.Close()\n\n\tproductId += 1\n\tproduct.ID = productId\n\tsession.DB(DBNAME).C(COLLECTION).Insert(product)\n\tif err != nil {\n\t\tlog.Fatal(err)\n\t\treturn false\n\t}\n\n\tfmt.Println(\"Added New Product ID- \", product.ID)\n\n\treturn true\n}", "title": "" } ]
eb53532bfb95daaf93863c127984d1fb
FindIssues uses the github search API to find issues which match a particular query. TODO(foxish): we should accept map[string][]string and use net/url properly.
[ { "docid": "ed79673423f7749c730401faa1a2dead", "score": "0.72305655", "text": "func (c *Client) FindIssues(query string) ([]Issue, error) {\n\tresp, err := c.request(http.MethodGet, fmt.Sprintf(\"%s/search/issues?q=%s\", c.base, query), nil)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\tdefer resp.Body.Close()\n\tif resp.StatusCode != 200 {\n\t\treturn nil, fmt.Errorf(\"response not 200: %s\", resp.Status)\n\t}\n\n\tb, err := ioutil.ReadAll(resp.Body)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\tvar issSearchResult IssuesSearchResult\n\tif err := json.Unmarshal(b, &issSearchResult); err != nil {\n\t\treturn nil, err\n\t}\n\treturn issSearchResult.Issues, nil\n}", "title": "" } ]
[ { "docid": "e039582bd1d40a39cf343b15176f434e", "score": "0.74457216", "text": "func (g GithubClient) SearchIssues(query string) ([]github.Issue, error) {\n\tissues := make([]github.Issue, 0)\n\tissuesGot := make(map[int]bool)\n\tlastDateGot := \"\"\n\ttotalIssueNumber := 0\n\n\tlo := &github.ListOptions{\n\t\tPage: 1,\n\t\tPerPage: 100,\n\t}\n\t// In order to search for >1,000 result, we use created time as a metric of searching progress. Therefore we\n\t// enforce \"Sort:created\" and \"Order:desc\".\n\tso := &github.SearchOptions{\n\t\tSort: \"created\",\n\t\tListOptions: *lo,\n\t}\n\n\tfor {\n\t\tr, _, err := g.client.Search.Issues(context.Background(), query, so)\n\t\tif err != nil {\n\t\t\tif _, ok := err.(*github.RateLimitError); ok {\n\t\t\t\tlog.Printf(\"Hitting Github search API rate limit, sleeping for 30 seconds... error message: %v\", err)\n\t\t\t\ttime.Sleep(30 * time.Second)\n\t\t\t\tcontinue\n\t\t\t}\n\t\t\treturn nil, err\n\t\t}\n\t\ttotalIssueNumber = *r.Total\n\t\tbreak\n\t}\n\n\tfor len(issues) < totalIssueNumber {\n\t\tq := query + lastDateGot\n\t\t// Get total number of pages in resp.LastPage\n\t\tresult, resp, err := g.client.Search.Issues(context.Background(), q, so)\n\t\tif err != nil {\n\t\t\tif _, ok := err.(*github.RateLimitError); ok {\n\t\t\t\tlog.Printf(\"Hitting Github search API rate limit, sleeping for 30 seconds... error message: %v\", err)\n\t\t\t\ttime.Sleep(30 * time.Second)\n\t\t\t\tcontinue\n\t\t\t}\n\t\t\treturn nil, err\n\t\t}\n\t\tfor _, i := range result.Issues {\n\t\t\tif issuesGot[*i.Number] == false {\n\t\t\t\tissues = append(issues, i)\n\t\t\t\tissuesGot[*i.Number] = true\n\t\t\t\tlastDateGot = fmt.Sprintf(\" created:<=%s\", i.CreatedAt.Format(\"2006-01-02\"))\n\t\t\t}\n\t\t}\n\t\tso.ListOptions.Page++\n\n\t\tfor so.ListOptions.Page <= resp.LastPage {\n\t\t\tresult, _, err = g.client.Search.Issues(context.Background(), q, so)\n\t\t\tif err != nil {\n\t\t\t\tif _, ok := err.(*github.RateLimitError); ok {\n\t\t\t\t\tlog.Printf(\"Hitting Github search API rate limit, sleeping for 30 seconds... error message: %v\", err)\n\t\t\t\t\ttime.Sleep(30 * time.Second)\n\t\t\t\t\tcontinue\n\t\t\t\t}\n\t\t\t\treturn nil, err\n\t\t\t}\n\t\t\tfor _, i := range result.Issues {\n\t\t\t\tif issuesGot[*i.Number] == false {\n\t\t\t\t\tissues = append(issues, i)\n\t\t\t\t\tissuesGot[*i.Number] = true\n\t\t\t\t\tlastDateGot = fmt.Sprintf(\" created:<=%s\", i.CreatedAt.Format(\"2006-01-02\"))\n\t\t\t\t}\n\t\t\t}\n\t\t\tso.ListOptions.Page++\n\t\t}\n\t\t// Reset page number\n\t\tso.ListOptions.Page = 1\n\t}\n\treturn issues, nil\n}", "title": "" }, { "docid": "13258e55429acdb5f12d2d42bb853b0b", "score": "0.7394127", "text": "func (c *client) FindIssues(query, sort string, asc bool) ([]Issue, error) {\n\treturn c.FindIssuesWithOrg(\"\", query, sort, asc)\n}", "title": "" }, { "docid": "6b767c4b202566c0734ea85a588347c4", "score": "0.6870317", "text": "func search() {\n\tr := *repo\n\ti := *issue\n\trepos := setRepositories()\n\n\tfor key, value := range repos {\n\t\tif repos[key].name == r {\n\t\t\tclient := &http.Client{}\n\t\t\trepoName := value\n\t\t\treq, err := http.NewRequest(\"GET\", \"https://api.github.com/search/issues\", nil)\n\t\t\tif err != nil {\n\t\t\t\tfmt.Println(\"[ERROR] Some issue with request.\")\n\t\t\t}\n\t\t\tq := req.URL.Query()\n\t\t\tq.Add(\"q\", fmt.Sprintf(\"%s+repo:%s\", i, repoName.repo))\n\t\t\treq.URL.RawQuery = q.Encode()\n\t\t\tresp, _ := client.Do(req)\n\t\t\tbody, err := ioutil.ReadAll(resp.Body)\n\t\t\tdefer resp.Body.Close()\n\t\t\tprintResults(body)\n\t\t}\n\t}\n}", "title": "" }, { "docid": "0e9fcfb1ecbc9edf31ff2905672f4ff0", "score": "0.66967463", "text": "func searchIssues(query, groupBy string) (*Results, error) {\n\tvar (\n\t\tcategories = map[string]map[string]int{}\n\t)\n\n\tvar issueHandler func(jira.Issue) error = processIssueByLabel(categories)\n\tif groupBy == \"component\" {\n\t\tissueHandler = processIssueByComponent(categories)\n\t}\n\n\t// Let's search for those issues! Note that we don't currently have a\n\t// way to identify how many issues we may process here, so\n\t// https://giphy.com/gifs/OCu7zWojqFA1W/html5.\n\terr := jiraClient.Issue.SearchPages(query,\n\t\t&jira.SearchOptions{},\n\t\tissueHandler,\n\t)\n\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\t// Clean up the data by stretching out all data points across the\n\t// maximum time range.\n\tresults := sanitizeData(categories)\n\n\treturn results, err\n}", "title": "" }, { "docid": "42da2de5661b0be3d7f3d43309ea3d23", "score": "0.66840386", "text": "func (m *MaintainerManager) GetIssuesFound(query string) ([]*gh.SearchItem, error) {\n\to := &gh.Options{}\n\to.QueryParams = map[string]string{\n\t\t\"sort\": \"updated\",\n\t\t\"order\": \"asc\",\n\t\t\"per_page\": \"100\",\n\t}\n\tprevSize := -1\n\tpage := 1\n\tissuesFound := []*gh.SearchItem{}\n\tfor len(issuesFound) != prevSize {\n\t\to.QueryParams[\"page\"] = strconv.Itoa(page)\n\t\tif issues, err := m.client.SearchIssues(query, o); err != nil {\n\t\t\treturn nil, err\n\t\t} else {\n\t\t\tprevSize = len(issuesFound)\n\t\t\tissuesFound = append(issuesFound, issues...)\n\t\t\tpage += 1\n\t\t}\n\t\tfmt.Printf(\".\")\n\t}\n\treturn issuesFound, nil\n}", "title": "" }, { "docid": "4a4716e5553dbb5bc7ab392cbc6cfba3", "score": "0.6590633", "text": "func (fc *fakeClient) FindIssuesWithOrg(org, query, sort string, asc bool) ([]github.Issue, error) {\n\tif org == \"\" {\n\t\treturn nil, errors.New(\"passing an empty organization is highly discouraged, as it's incompatible with GitHub Apps\")\n\t}\n\tfields := expectedQueryRegex.FindStringSubmatch(query)\n\tif fields == nil || len(fields) != 4 {\n\t\treturn nil, fmt.Errorf(\"invalid query: `%s` does not match expected regex `%s`\", query, expectedQueryRegex.String())\n\t}\n\t// \"find\" results\n\towner, repo, author := fields[1], fields[2], fields[3]\n\tkey := fmt.Sprintf(\"%s,%s,%s\", github.NormLogin(owner), github.NormLogin(repo), github.NormLogin(author))\n\n\tissues := []github.Issue{}\n\tfor _, number := range sets.List(fc.prs[key]) {\n\t\tissues = append(issues, github.Issue{\n\t\t\tNumber: number,\n\t\t})\n\t}\n\treturn issues, nil\n}", "title": "" }, { "docid": "395ddbdbe4b1fadeb3ac17438a26a6d2", "score": "0.6349031", "text": "func (c *client) FindIssuesWithOrg(org, query, sort string, asc bool) ([]Issue, error) {\n\tloggerName := \"FindIssuesWithOrg\"\n\tif org == \"\" {\n\t\tloggerName = \"FindIssues\"\n\t}\n\tdurationLogger := c.log(loggerName, query)\n\tdefer durationLogger()\n\n\tvalues := url.Values{\n\t\t\"per_page\": []string{\"100\"},\n\t\t\"q\": []string{query},\n\t}\n\tvar issues []Issue\n\n\tif sort != \"\" {\n\t\tvalues[\"sort\"] = []string{sort}\n\t\tif asc {\n\t\t\tvalues[\"order\"] = []string{\"asc\"}\n\t\t}\n\t}\n\terr := c.readPaginatedResultsWithValues(\n\t\tfmt.Sprintf(\"/search/issues\"),\n\t\tvalues,\n\t\tacceptNone,\n\t\torg,\n\t\tfunc() interface{} { // newObj\n\t\t\treturn &IssuesSearchResult{}\n\t\t},\n\t\tfunc(obj interface{}) {\n\t\t\tissues = append(issues, obj.(*IssuesSearchResult).Issues...)\n\t\t},\n\t)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\treturn issues, err\n}", "title": "" }, { "docid": "bdcfc87a4566153626533ab28aaa34e1", "score": "0.6264982", "text": "func getIssues(user, repo, label string) []Datos {\n\t// Format the http link\n\turl := fmt.Sprintf(\"https://api.github.com/repos/%s/%s/issues?labels=%s&page=1&per_page=100\", user, repo, label)\n\n\t// Get response\n\tbody := connectHTML(url)\n\n\t// Filter data\n\tdata := getData(body)\n\n\treturn data\n\n}", "title": "" }, { "docid": "08fb3227d2e6b2e4ffbe19c64d732c8e", "score": "0.6217148", "text": "func IssuesQuery(organization string, repository string) (RepositoryIssuesQueryType, map[string]interface{}) {\n\tvariables := map[string]interface{}{\n\t\t\"org\": githubv4.String(organization),\n\t\t\"repo\": githubv4.String(repository),\n\t\t\"cursor\": (*githubv4.String)(nil),\n\t}\n\n\treturn RepositoryIssuesQueryType{}, variables\n}", "title": "" }, { "docid": "2880862d6ffa2a704b6ad09415364caa", "score": "0.6193892", "text": "func issues(ctx context.Context, c *client.Client, org string, project string, since time.Time, until time.Time, users []string, state string) ([]*github.Issue, error) {\n\tresult := []*github.Issue{}\n\topts := &github.IssueListByRepoOptions{\n\t\tState: state,\n\t\tSort: \"updated\",\n\t\tDirection: \"desc\",\n\t\tListOptions: github.ListOptions{\n\t\t\tPerPage: 100,\n\t\t},\n\t}\n\n\tmatchUser := map[string]bool{}\n\tfor _, u := range users {\n\t\tmatchUser[strings.ToLower(u)] = true\n\t}\n\n\tlogrus.Infof(\"Gathering issues for %s/%s, users=%q: %+v\", org, project, users, opts)\n\tfor page := 1; page != 0; {\n\t\topts.ListOptions.Page = page\n\t\tissues, resp, err := c.GitHubClient.Issues.ListByRepo(ctx, org, project, opts)\n\t\tif err != nil {\n\t\t\treturn result, err\n\t\t}\n\n\t\tlogrus.Infof(\"Processing page %d of %s/%s issue results ...\", page, org, project)\n\n\t\tpage = resp.NextPage\n\n\t\t// Repo has no issues!\n\t\tif len(issues) == 0 {\n\t\t\tbreak\n\t\t}\n\n\t\tlogrus.Infof(\"Current issue updated at %s\", issues[0].GetUpdatedAt())\n\n\t\tfor _, i := range issues {\n\t\t\tif i.IsPullRequest() {\n\t\t\t\tcontinue\n\t\t\t}\n\t\t\tif i.GetClosedAt().After(until) {\n\t\t\t\tlogrus.Infof(\"issue #%d closed at %s\", i.GetNumber(), i.GetUpdatedAt())\n\t\t\t\tcontinue\n\t\t\t}\n\n\t\t\tif i.GetUpdatedAt().Before(since) {\n\t\t\t\tlogrus.Infof(\"Hit issue #%d updated at %s\", i.GetNumber(), i.GetUpdatedAt())\n\t\t\t\tpage = 0\n\t\t\t\tbreak\n\t\t\t}\n\n\t\t\tif !i.GetClosedAt().IsZero() && i.GetClosedAt().Before(since) {\n\t\t\t\tcontinue\n\t\t\t}\n\n\t\t\tif state != \"\" && i.GetState() != state {\n\t\t\t\tlogrus.Infof(\"Skipping issue #%d (state=%q)\", i.GetNumber(), i.GetState())\n\t\t\t\tcontinue\n\t\t\t}\n\n\t\t\tt := issueDate(i)\n\n\t\t\tlogrus.Infof(\"Fetching #%d (closed %s, updated %s): %q\", i.GetNumber(), i.GetClosedAt().Format(dateForm), i.GetUpdatedAt().Format(dateForm), i.GetTitle())\n\n\t\t\tfull, err := ghcache.IssuesGet(ctx, c.Cache, c.GitHubClient, t, org, project, i.GetNumber())\n\t\t\tif err != nil {\n\t\t\t\ttime.Sleep(1 * time.Second)\n\t\t\t\tfull, err = ghcache.IssuesGet(ctx, c.Cache, c.GitHubClient, t, org, project, i.GetNumber())\n\t\t\t}\n\t\t\tif err != nil {\n\t\t\t\tlogrus.Errorf(\"failed IssuesGet: %v\", err)\n\t\t\t\tbreak\n\t\t\t}\n\n\t\t\tcreator := strings.ToLower(full.GetUser().GetLogin())\n\t\t\tcloser := strings.ToLower(full.GetClosedBy().GetLogin())\n\t\t\tif len(matchUser) > 0 && !matchUser[creator] && !matchUser[closer] {\n\t\t\t\tcontinue\n\t\t\t}\n\n\t\t\tresult = append(result, full)\n\t\t}\n\t}\n\n\tlogrus.Infof(\"Returning %d issues\", len(result))\n\treturn result, nil\n}", "title": "" }, { "docid": "76a9c392d90b00173f776ad902bcde56", "score": "0.6136934", "text": "func (m *MockClient) FindIssues(query, sort string, asc bool) ([]github.Issue, error) {\n\tm.ctrl.T.Helper()\n\tret := m.ctrl.Call(m, \"FindIssues\", query, sort, asc)\n\tret0, _ := ret[0].([]github.Issue)\n\tret1, _ := ret[1].(error)\n\treturn ret0, ret1\n}", "title": "" }, { "docid": "6dfc7e2cd7b335df830a32f6e4806a98", "score": "0.6107522", "text": "func (c *Client) EpicIssues(key, jql string, limit uint) (*SearchResult, error) {\n\tpath := fmt.Sprintf(\"/epic/%s/issue?maxResults=%d\", key, limit)\n\tif jql != \"\" {\n\t\tpath += fmt.Sprintf(\"&jql=%s\", url.QueryEscape(jql))\n\t}\n\n\tres, err := c.GetV1(context.Background(), path, nil)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\tif res == nil {\n\t\treturn nil, ErrEmptyResponse\n\t}\n\tdefer func() { _ = res.Body.Close() }()\n\n\tif res.StatusCode != http.StatusOK {\n\t\treturn nil, ErrUnexpectedStatusCode\n\t}\n\n\tvar out SearchResult\n\n\terr = json.NewDecoder(res.Body).Decode(&out)\n\n\treturn &out, err\n}", "title": "" }, { "docid": "4058b8ac643023b2e5a600bb372a3403", "score": "0.59905946", "text": "func GetIssues(owner, repo string, params map[string]string) (*IssuesList, error) {\n\turl := APIURL + strings.Join([]string{\"repos\", owner, repo, \"issues\"}, \"/\")\n\turl += \"?\"\n\tfor k, v := range params {\n\t\turl += k + \"=\" + v\n\t}\n\n\tresp, err := get(url)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\tvar result IssuesList\n\n\tif err := json.NewDecoder(resp.Body).Decode(&result); err != nil {\n\t\tresp.Body.Close()\n\t\treturn nil, err\n\t}\n\n\tresp.Body.Close()\n\treturn &result, nil\n}", "title": "" }, { "docid": "f68c15dc662d101b1c0dcb1afda09622", "score": "0.59874743", "text": "func (m *MockIssueClient) FindIssues(query, sort string, asc bool) ([]github.Issue, error) {\n\tm.ctrl.T.Helper()\n\tret := m.ctrl.Call(m, \"FindIssues\", query, sort, asc)\n\tret0, _ := ret[0].([]github.Issue)\n\tret1, _ := ret[1].(error)\n\treturn ret0, ret1\n}", "title": "" }, { "docid": "8477c456401a523b3ccbf432bcd82eee", "score": "0.59255534", "text": "func (j *DSGitHub) githubPullsFromIssues(ctx *Ctx, org, repo string, since *time.Time) (pullsData []map[string]interface{}, err error) {\n\tvar (\n\t\tissues []map[string]interface{}\n\t\tpull map[string]interface{}\n\t\tok bool\n\t)\n\tissues, err = j.githubIssues(ctx, org, repo, ctx.DateFrom)\n\tif err != nil {\n\t\treturn\n\t}\n\ti, pulls := 0, 0\n\tnIssues := len(issues)\n\tPrintf(\"%s/%s: processing %d issues (to filter for PRs)\\n\", j.URL, j.Category, nIssues)\n\tif j.ThrN > 1 {\n\t\tnThreads := 0\n\t\tch := make(chan interface{})\n\t\tfor _, issue := range issues {\n\t\t\ti++\n\t\t\tif i%ItemsPerPage == 0 {\n\t\t\t\truntime.GC()\n\t\t\t\tPrintf(\"%s/%s: processing %d/%d issues, %d pulls so far\\n\", j.URL, j.Category, i, nIssues, pulls)\n\t\t\t}\n\t\t\tisPR, _ := issue[\"is_pull\"]\n\t\t\tif !isPR.(bool) {\n\t\t\t\tcontinue\n\t\t\t}\n\t\t\tpulls++\n\t\t\tnumber, _ := issue[\"number\"]\n\t\t\tgo func(ch chan interface{}, num int) {\n\t\t\t\tpr, e := j.githubPull(ctx, org, repo, num)\n\t\t\t\tif e != nil {\n\t\t\t\t\tch <- e\n\t\t\t\t\treturn\n\t\t\t\t}\n\t\t\t\tch <- pr\n\t\t\t}(ch, int(number.(float64)))\n\t\t\tnThreads++\n\t\t\tif nThreads == j.ThrN {\n\t\t\t\tobj := <-ch\n\t\t\t\tnThreads--\n\t\t\t\terr, ok = obj.(error)\n\t\t\t\tif ok {\n\t\t\t\t\treturn\n\t\t\t\t}\n\t\t\t\tpullsData = append(pullsData, obj.(map[string]interface{}))\n\t\t\t}\n\t\t}\n\t\tfor nThreads > 0 {\n\t\t\tobj := <-ch\n\t\t\tnThreads--\n\t\t\terr, ok = obj.(error)\n\t\t\tif ok {\n\t\t\t\treturn\n\t\t\t}\n\t\t\tpullsData = append(pullsData, obj.(map[string]interface{}))\n\t\t}\n\t} else {\n\t\tfor _, issue := range issues {\n\t\t\ti++\n\t\t\tif i%ItemsPerPage == 0 {\n\t\t\t\truntime.GC()\n\t\t\t\tPrintf(\"%s/%s: processed %d/%d issues, %d pulls so far\\n\", j.URL, j.Category, i, nIssues, pulls)\n\t\t\t}\n\t\t\tisPR, _ := issue[\"is_pull\"]\n\t\t\tif !isPR.(bool) {\n\t\t\t\tcontinue\n\t\t\t}\n\t\t\tpulls++\n\t\t\tnumber, _ := issue[\"number\"]\n\t\t\tpull, err = j.githubPull(ctx, org, repo, int(number.(float64)))\n\t\t\tif err != nil {\n\t\t\t\treturn\n\t\t\t}\n\t\t\tpullsData = append(pullsData, pull)\n\t\t}\n\t}\n\treturn\n}", "title": "" }, { "docid": "d981ac5d5f58cdf79b928a5f5ffefbfd", "score": "0.5895204", "text": "func NewIssuesRequest(server string, projectId string, params *IssuesParams) (*http.Request, error) {\n\tvar err error\n\n\tvar pathParam0 string\n\n\tpathParam0, err = runtime.StyleParam(\"simple\", false, \"project_id\", projectId)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\tqueryUrl := fmt.Sprintf(\"%s/projects/%s/issues\", server, pathParam0)\n\n\tvar queryStrings []string\n\n\tvar queryParam0 string\n\tif params.Q != nil {\n\n\t\tqueryParam0, err = runtime.StyleParam(\"form\", true, \"q\", *params.Q)\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.Offset != nil {\n\n\t\tqueryParam1, err = runtime.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, queryParam1)\n\t}\n\n\tvar queryParam2 string\n\tif params.Limit != nil {\n\n\t\tqueryParam2, err = runtime.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, queryParam2)\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\treturn req, nil\n}", "title": "" }, { "docid": "dde655f8db36d32a91ef2e1d73b6f31e", "score": "0.586333", "text": "func GetIssuesInfo(conf *modules.Config, para modules.IssuePara, resChan chan interface{}) (interface{}, error) {\n\trequestPara := new(httppara.HTTPParameters)\n\tissues := make([]modules.Issue, 0)\n\tURL := initIssueQuery(conf, para)\n\ttoken := token.PersonalToken{Name: \"PRIVATE-TOKEN\", Value: conf.AccessInfo.PersonalToken}\n\tfmt.Println(\"URL\", URL)\n\trequestPara.InitPara(URL, \"GET\", token)\n\tissuesInfo, err := HTTPRequestWithHeader(requestPara, \"issue\")\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\tif para.FirstGet == true {\n\t\tresult := issuesInfo.(httppara.HTTPResponse)\n\t\terr = json.Unmarshal(result.HTTPResponse, &issues)\n\t\tif err != nil {\n\t\t\treturn nil, err\n\t\t}\n\t\tissueList, err := processIssueInfo(issues, conf, para.TargetID)\n\t\tif err != nil {\n\t\t\treturn nil, err\n\t\t}\n\t\tdata := modules.IssueWithHeader{\n\t\t\tHeader: result.HTTPHeader,\n\t\t\tIssues: issueList,\n\t\t}\n\t\treturn data, nil\n\t}\n\terr = json.Unmarshal(issuesInfo.(httppara.HTTPResponse).HTTPResponse, &issues)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\tissueList, err := processIssueInfo(issues, conf, para.TargetID)\n\tfmt.Println(issueList)\n\tresChan <- modules.IssueResult{Data: issueList, OK: err}\n\treturn nil, err\n}", "title": "" }, { "docid": "a7db0fc28977008e3914b21752ba4610", "score": "0.582058", "text": "func (r *Rietveld) Search(limit int, terms ...*SearchTerm) ([]*Issue, error) {\n\tsearchUrl := fmt.Sprintf(\"/search?format=json&limit=%d\", limit)\n\tfor _, term := range terms {\n\t\tsearchUrl += fmt.Sprintf(\"&%s=%s\", term.Key, term.Value)\n\t}\n\n\tvar issues issueListSortable\n\tcursor := \"\"\n\tfor {\n\t\tvar data struct {\n\t\t\tResults []*Issue\n\t\t\tCursor string\n\t\t}\n\t\terr := r.get(searchUrl+cursor, &data)\n\t\tif err != nil {\n\t\t\treturn nil, fmt.Errorf(\"Rietveld search failed: %v\", err)\n\t\t}\n\t\tif len(data.Results) == 0 {\n\t\t\tbreak\n\t\t}\n\t\tfor _, issue := range data.Results {\n\t\t\tfullIssue, err := r.GetIssueProperties(issue.Issue, false)\n\t\t\tif err != nil {\n\t\t\t\treturn nil, err\n\t\t\t} else {\n\t\t\t\tissues = append(issues, fullIssue)\n\t\t\t}\n\t\t}\n\t\tif len(issues) >= limit {\n\t\t\tbreak\n\t\t}\n\t\tcursor = \"&cursor=\" + data.Cursor\n\t}\n\tsort.Sort(issues)\n\treturn issues, nil\n}", "title": "" }, { "docid": "b7148a877067034ddeadc3466eae5e19", "score": "0.56456333", "text": "func (gh *GitHub) FetchIssues(ctx context.Context, owner, repo, ms string) ([]*github.Issue, error) {\n\toptions := &github.IssueListByRepoOptions{\n\t\tMilestone: ms,\n\t\tState: \"all\",\n\t}\n\tissues, _, err := gh.Client.Issues.ListByRepo(ctx, owner, repo, options)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\treturn issues, nil\n}", "title": "" }, { "docid": "f6ef8a0beeb0c2c181a458325a742f99", "score": "0.56009233", "text": "func SearchGitHub(query string, options SearchOptions, client *http.Client, results *[]RepoSearchResult, resultSet map[string]bool) (err error) {\n\tbase := \"\"\n\tif GetFlags().GithubRepo {\n\t\tbase = \"https://github.com/\" + query + \"/search\"\n\t} else {\n\t\tbase = \"https://github.com/search\"\n\t}\n\tpage, pages := 0, 1\n\tvar delay = 5\n\torders := []string{\"asc\"}\n\trankings := []string{\"indexed\"}\n\tfor i := 0; i < len(orders); i++ {\n\t\tfor j := 0; j < len(rankings); j++ {\n\t\t\tif i == 1 && j == 1 {\n\t\t\t\tcontinue\n\t\t\t}\n\t\t\tfor page < pages {\n\t\t\t\tstr := ConstructSearchURL(base, query, options)\n\t\t\t\t// fmt.Println(str)\n\t\t\t\tresponse, err := client.Get(str)\n\t\t\t\t// fmt.Println(response.StatusCode)\n\t\t\t\t// fmt.Println(err)\n\t\t\t\tif err != nil {\n\t\t\t\t\tif response != nil {\n\t\t\t\t\t\t// fmt.Println(response.StatusCode)\n\t\t\t\t\t\tif response.StatusCode == 403 {\n\t\t\t\t\t\t\tresponse.Body.Close()\n\t\t\t\t\t\t\tdelay += 5\n\t\t\t\t\t\t\tcolor.Yellow(\"[!] Rate limited by GitHub. Waiting \" + strconv.Itoa(delay) + \"s...\")\n\t\t\t\t\t\t\ttime.Sleep(time.Duration(delay) * time.Second)\n\t\t\t\t\t\t} else if response.StatusCode == 503 {\n\t\t\t\t\t\t\tbreak\n\t\t\t\t\t\t}\n\t\t\t\t\t} else {\n\t\t\t\t\t\tfmt.Println(err)\n\t\t\t\t\t}\n\t\t\t\t\tcontinue\n\t\t\t\t}\n\t\t\t\tif delay > 10 {\n\t\t\t\t\tdelay--\n\t\t\t\t}\n\t\t\t\tresponseData, err := ioutil.ReadAll(response.Body)\n\t\t\t\tresponseStr := string(responseData)\n\t\t\t\t// fmt.Println(responseStr)\n\n\t\t\t\tif err != nil {\n\t\t\t\t\tlog.Fatal(err)\n\t\t\t\t}\n\t\t\t\tresponse.Body.Close()\n\t\t\t\tresultRegex := regexp.MustCompile(\"href=\\\"\\\\/((.*)\\\\/blob\\\\/([0-9a-f]{40}\\\\/([^#\\\"]+)))\\\">\")\n\t\t\t\tmatches := resultRegex.FindAllStringSubmatch(responseStr, -1)\n\t\t\t\tif page == 0 {\n\t\t\t\t\tif len(matches) == 0 {\n\t\t\t\t\t\tresultRegex = regexp.MustCompile(\"(?s)react-app\\\\.embeddedData\\\">(.*?)<\\\\/script>\")\n\t\t\t\t\t\tmatch := resultRegex.FindStringSubmatch(responseStr)\n\t\t\t\t\t\tvar resultPayload NewSearchPayload\n\t\t\t\t\t\t\n\t\t\t\t\t\tif len(match) == 0 {\n\t\t\t\t\t\t\tpage++\n\t\t\t\t\t\t\tcontinue\n\t\t\t\t\t\t}\n\t\t\t\t\t\tjson.Unmarshal([]byte(match[1]), &resultPayload)\n\t\t\t\t\t\tif !GetFlags().ResultsOnly && !GetFlags().JsonOutput {\n\t\t\t\t\t\t\tif pages != resultPayload.Payload.PageCount {\n\t\t\t\t\t\t\t\tcolor.Cyan(\"[*] Searching \" + strconv.Itoa(resultPayload.Payload.PageCount) + \" pages of results for '\" + query + \"'...\")\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t\tpages = resultPayload.Payload.PageCount\n\t\t\t\t\t} else {\n\t\t\t\t\t\tregex := regexp.MustCompile(\"\\\\bdata\\\\-total\\\\-pages\\\\=\\\"(\\\\d+)\\\"\")\n\t\t\t\t\t\tmatch := regex.FindStringSubmatch(responseStr)\n\t\t\t\t\t\tif err != nil {\n\t\t\t\t\t\t\tlog.Fatal(err)\n\t\t\t\t\t\t}\n\t\t\t\t\t\tif len(match) == 2 {\n\t\t\t\t\t\t\tnewPages, err := strconv.Atoi(match[1])\n\t\t\t\t\t\t\tif err == nil {\n\t\t\t\t\t\t\t\tif newPages > GetFlags().Pages {\n\t\t\t\t\t\t\t\t\tnewPages = GetFlags().Pages\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\tpages = newPages\n\t\t\t\t\t\t\t\tif pages > 99 && GetFlags().ManyResults {\n\t\t\t\t\t\t\t\t\tif !GetFlags().ResultsOnly && !GetFlags().JsonOutput {\n\t\t\t\t\t\t\t\t\t\tcolor.Cyan(\"[*] Searching 100+ pages of results for '\" + query + \"'...\")\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\torders = append(orders, \"desc\")\n\t\t\t\t\t\t\t\t\trankings = append(orders, \"\")\n\t\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\t\tif !GetFlags().ResultsOnly && !GetFlags().JsonOutput {\n\t\t\t\t\t\t\t\t\t\tcolor.Cyan(\"[*] Searching \" + strconv.Itoa(pages) + \" pages of results for '\" + query + \"'...\")\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\tcolor.Red(\"[!] An error occurred while parsing the page count.\")\n\t\t\t\t\t\t\t\tfmt.Println(err)\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\tif strings.Index(responseStr, \"Sign in to GitHub\") > -1 {\n\t\t\t\t\t\t\t\tcolor.Red(\"[!] Unable to log into GitHub.\")\n\t\t\t\t\t\t\t\tlog.Fatal()\n\t\t\t\t\t\t\t} else if len(matches) > 0 {\n\t\t\t\t\t\t\t\tif !GetFlags().ResultsOnly {\n\t\t\t\t\t\t\t\t\tcolor.Cyan(\"[*] Searching 1 page of results for '\" + query + \"'...\")\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tpage++\n\t\t\t\tif len(matches) == 0 {\n\t\t\t\t\tresultRegex = regexp.MustCompile(\"(?s)react-app\\\\.embeddedData\\\">(.*?)<\\\\/script>\")\n\t\t\t\t\tmatch := resultRegex.FindStringSubmatch(responseStr)\n\t\t\t\t\tvar resultPayload NewSearchPayload\n\t\t\t\t\tif len(match) > 0 {\n\t\t\t\t\t\t// fmt.Println(match[1]/)\n\t\t\t\t\t\t// fmt.Println(match[1])\n\t\t\t\t\t\tjson.Unmarshal([]byte(match[1]), &resultPayload)\n\t\t\t\t\t\tfor _, result := range resultPayload.Payload.Results {\n\t\t\t\t\t\t\tif resultSet[(result.RepoName+result.Path)] == true {\n\t\t\t\t\t\t\t\tcontinue\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tif result.RepoName == \"\" {\n\t\t\t\t\t\t\t\tresult.RepoName = result.RepoNwo\n\t\t\t\t\t\t\t}\t\n\t\t\t\t\t\t\tresultSet[(result.RepoName + result.Path)] = true\n\t\t\t\t\t\t\tSearchWaitGroup.Add(1)\n\t\t\t\t\t\t\tgo ScanAndPrintResult(client, RepoSearchResult{\n\t\t\t\t\t\t\t\tRepo: result.RepoName,\n\t\t\t\t\t\t\t\tFile: result.Path,\n\t\t\t\t\t\t\t\tRaw: result.RepoName + \"/\" + result.CommitSha + \"/\" + result.Path,\n\t\t\t\t\t\t\t\tSource: \"repo\",\n\t\t\t\t\t\t\t\tQuery: query,\n\t\t\t\t\t\t\t\tURL: \"https://github.com/\" + result.RepoName + \"/blob/\" + result.CommitSha + \"/\" + result.Path,\n\t\t\t\t\t\t\t})\t\n\t\t\t\t\t\t\t// fmt.Println(result.RepoName + \"/\" + result.DefaultBranch + \"/\" + result.Path)\n\t\t\t\t\t\t}\t\n\t\t\t\t\t}\n\t\t\t\t} \n\t\t\t\toptions.Page = (page + 1)\n\t\t\t}\n\n\t\t}\n\t}\n\treturn nil\n}", "title": "" }, { "docid": "aaee044c8cd4f0b45a75b63f47324d5b", "score": "0.55172366", "text": "func (f *JiraFinder) Search() error {\n\toutput := [][]string{f.Config.FieldsToRetrieve}\n\n\terr, out := f.produceFields()\n\tif err != nil {\n\t\treturn err\n\t}\n\n\tfilters, fields := f.processFields(out)\n\terr, response := f.search(filters, fields)\n\tif err != nil {\n\t\treturn err\n\t}\n\n\tissues := f.prepareIssueObjects(response, fields)\n\tissueCh := f.processIssues(issues)\n\n\tcount := 0\n\tfor i := range issueCh {\n\t\tif i != nil {\n\t\t\tif f := download(*i); f != nil {\n\t\t\t\toutput = append(output, f)\n\t\t\t}\n\t\t}\n\n\t\tcount++\n\t\tif count == response.Total {\n\t\t\tclose(issueCh)\n\t\t}\n\t}\n\n\treturn writeToCsv(output, f.Config.DownloadPath)\n}", "title": "" }, { "docid": "ed6eed93e8fb15eebd9be1aef5ecfec4", "score": "0.54861766", "text": "func issueSearchKey(org string, project string, state string, days int) string {\n\tif days > 0 {\n\t\treturn fmt.Sprintf(\"%s-%s-%s-issues-within-%dd\", org, project, state, days)\n\t}\n\treturn fmt.Sprintf(\"%s-%s-%s-issues\", org, project, state)\n}", "title": "" }, { "docid": "4f58711b79e70e5b704ff8d543bd12d6", "score": "0.5464602", "text": "func (a *RepoAPI) readIssue(params interface{}) (resp *rpc.Response) {\n\tm := objx.New(cast.ToStringMap(params))\n\tname := m.Get(\"name\").Str()\n\treference := m.Get(\"reference\").Str()\n\treturn rpc.Success(util.Map{\n\t\t\"data\": a.mods.Repo.ReadIssue(name, reference),\n\t})\n}", "title": "" }, { "docid": "578929aa7f735a01e10405e586630f85", "score": "0.5454004", "text": "func (a *RepoAPI) listIssues(params interface{}) (resp *rpc.Response) {\n\tm := objx.New(cast.ToStringMap(params))\n\tname := m.Get(\"name\").Str()\n\treturn rpc.Success(util.Map{\n\t\t\"data\": a.mods.Repo.ListIssues(name),\n\t})\n}", "title": "" }, { "docid": "44b52204b20b0a42c58dab57b72022b9", "score": "0.54362136", "text": "func (o *Project) Issues(mods ...qm.QueryMod) issueQuery {\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(\"`issues`.`project_id`=?\", o.ID),\n\t)\n\n\tquery := Issues(queryMods...)\n\tqueries.SetFrom(query.Query, \"`issues`\")\n\n\tif len(queries.GetSelect(query.Query)) == 0 {\n\t\tqueries.SetSelect(query.Query, []string{\"`issues`.*\"})\n\t}\n\n\treturn query\n}", "title": "" }, { "docid": "2cd1ee899e271aa38fe9aed4606b24db", "score": "0.5429533", "text": "func (mr *MockIssueClientMockRecorder) FindIssues(query, sort, asc interface{}) *gomock.Call {\n\tmr.mock.ctrl.T.Helper()\n\treturn mr.mock.ctrl.RecordCallWithMethodType(mr.mock, \"FindIssues\", reflect.TypeOf((*MockIssueClient)(nil).FindIssues), query, sort, asc)\n}", "title": "" }, { "docid": "f87b9fa51c74f5187989b4d89e1fb169", "score": "0.54084754", "text": "func (h *Engine) updateIssues(ctx context.Context, org string, project string, state string, updatedDays int, key string) ([]*github.Issue, error) {\n\topt := &github.IssueListByRepoOptions{\n\t\tListOptions: github.ListOptions{PerPage: 100},\n\t\tState: state,\n\t}\n\tklog.V(2).Infof(\"%s issue list opts for %s: %+v\", state, key, opt)\n\n\tif updatedDays > 0 {\n\t\topt.Since = time.Now().Add(time.Duration(updatedDays*-24) * time.Hour)\n\t}\n\n\tvar allIssues []*github.Issue\n\n\tfor {\n\t\tklog.Infof(\"Downloading %s issues for %s/%s (page %d)...\", state, org, project, opt.Page)\n\t\tis, resp, err := h.client.Issues.ListByRepo(ctx, org, project, opt)\n\t\tif err != nil {\n\t\t\treturn is, err\n\t\t}\n\t\th.logRate(resp.Rate)\n\n\t\tfor _, i := range is {\n\t\t\tif i.IsPullRequest() {\n\t\t\t\tcontinue\n\t\t\t}\n\n\t\t\th.updateSimilarityTables(i.GetTitle(), i.GetHTMLURL())\n\t\t\tallIssues = append(allIssues, i)\n\t\t}\n\n\t\tif resp.NextPage == 0 {\n\t\t\tbreak\n\t\t}\n\t\topt.Page = resp.NextPage\n\t}\n\n\tif err := h.cache.Set(key, &persist.Thing{Issues: allIssues}); err != nil {\n\t\tklog.Errorf(\"set %q failed: %v\", key, err)\n\t}\n\n\tklog.V(1).Infof(\"updateIssues %s returning %d issues\", key, len(allIssues))\n\treturn allIssues, nil\n}", "title": "" }, { "docid": "78637ab66a4c80bb11a02b343270b060", "score": "0.5398878", "text": "func (mr *MockClientMockRecorder) FindIssues(query, sort, asc interface{}) *gomock.Call {\n\tmr.mock.ctrl.T.Helper()\n\treturn mr.mock.ctrl.RecordCallWithMethodType(mr.mock, \"FindIssues\", reflect.TypeOf((*MockClient)(nil).FindIssues), query, sort, asc)\n}", "title": "" }, { "docid": "01f0102707ce7416665811ddeeb2e95e", "score": "0.5356621", "text": "func GetIssue(owner, repo string, params map[string]string, issueN int) (*Issue, error) {\n\turl := APIURL + strings.Join([]string{\"repos\", owner, repo, \"issues\", strconv.Itoa(issueN)}, \"/\")\n\turl += \"?\"\n\tfor k, v := range params {\n\t\turl += k + \"=\" + v\n\t}\n\n\tresp, err := get(url)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\tvar result Issue\n\n\tif err := json.NewDecoder(resp.Body).Decode(&result); err != nil {\n\t\tresp.Body.Close()\n\t\treturn nil, err\n\t}\n\tresp.Body.Close()\n\treturn &result, nil\n}", "title": "" }, { "docid": "f164d1d6e513b445984b2052ed371f3b", "score": "0.53257066", "text": "func searchGitHubRepos(w http.ResponseWriter, r *http.Request) {\n\tsearchQuery := r.URL.Query().Get(\"query\")\n\tif searchQuery == \"\" {\n\t\tapiResponse(map[string]interface{}{}, w)\n\t}\n\n\tfor _, c := range r.Cookies() {\n\t\tfmt.Println(c)\n\t}\n\n\ttoken, err := parseTokenFromCookie(r)\n\thelpers.HandleError(err)\n\n\tres, err := github.SearchForRepos(token, searchQuery)\n\thelpers.HandleError(err)\n\tapiResponse(map[string]interface{}{\"data\": res}, w)\n}", "title": "" }, { "docid": "89e6ae5e5b7c3e2cb28c4ab0681c4e4f", "score": "0.5278732", "text": "func (c *Client) GetIssues(queryParams string) ([]Issue, error) {\n\treq, err := c.getRequest(\"/issues.json\", queryParams)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\tvar response issuesResponse\n\t_, err = c.Do(req, &response)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\treturn response.Issues, nil\n}", "title": "" }, { "docid": "d0a9734270b6e0af0c9442cd128e4ed4", "score": "0.5257177", "text": "func (it IssueTracker) GetBugs(project string, owner string) (*IssueList, error) {\n\terrFmt := \"error retrieving issues: %s\"\n\tif !it.IsAuthenticated() {\n\t\treturn nil, fmt.Errorf(errFmt, \"user is not authenticated!\")\n\t}\n\tparams := map[string]string{\n\t\t\"owner\": url.QueryEscape(owner),\n\t\t\"can\": \"open\",\n\t\t\"maxResults\": \"9999\",\n\t}\n\trequestURL := ISSUE_API_URL + project + \"/issues?\"\n\tfirst := true\n\tfor k, v := range params {\n\t\tif first {\n\t\t\tfirst = false\n\t\t} else {\n\t\t\trequestURL += \"&\"\n\t\t}\n\t\trequestURL += k + \"=\" + v\n\t}\n\tresp, err := it.OAuthTransport.Client().Get(requestURL)\n\tif err != nil {\n\t\treturn nil, fmt.Errorf(errFmt, err)\n\t}\n\tdefer resp.Body.Close()\n\tbody, _ := ioutil.ReadAll(resp.Body)\n\tif resp.StatusCode != http.StatusOK {\n\t\treturn nil, fmt.Errorf(errFmt, fmt.Sprintf(\n\t\t\t\"issue tracker returned code %d:%v\", resp.StatusCode, string(body)))\n\t}\n\n\tvar bugList IssueList\n\tif err := json.Unmarshal(body, &bugList); err != nil {\n\t\treturn nil, fmt.Errorf(errFmt, err)\n\t}\n\treturn &bugList, nil\n}", "title": "" }, { "docid": "9daa0ba1b52e53b1b036f29ee3f2ad3e", "score": "0.52554023", "text": "func NewCiIssuesGetInstanceRequest(server string, id string, params *CiIssuesGetInstanceParams) (*http.Request, error) {\n\tvar err error\n\n\tvar pathParam0 string\n\n\tpathParam0, err = runtime.StyleParamWithLocation(\"simple\", false, \"id\", runtime.ParamLocationPath, id)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\tserverURL, err := url.Parse(server)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\toperationPath := fmt.Sprintf(\"/v1/ciIssues/%s\", pathParam0)\n\tif operationPath[0] == '/' {\n\t\toperationPath = \".\" + operationPath\n\t}\n\n\tqueryURL, err := serverURL.Parse(operationPath)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\tqueryValues := queryURL.Query()\n\n\tif params.FieldsCiIssues != nil {\n\n\t\tif queryFrag, err := runtime.StyleParamWithLocation(\"form\", false, \"fields[ciIssues]\", runtime.ParamLocationQuery, *params.FieldsCiIssues); err != nil {\n\t\t\treturn nil, err\n\t\t} else if parsed, err := url.ParseQuery(queryFrag); err != nil {\n\t\t\treturn nil, err\n\t\t} else {\n\t\t\tfor k, v := range parsed {\n\t\t\t\tfor _, v2 := range v {\n\t\t\t\t\tqueryValues.Add(k, v2)\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t}\n\n\tqueryURL.RawQuery = queryValues.Encode()\n\n\treq, err := http.NewRequest(\"GET\", queryURL.String(), nil)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\treturn req, nil\n}", "title": "" }, { "docid": "9b906e8e1f444576a4746242656f78b4", "score": "0.5235198", "text": "func SearchRepo(terms []string) (*RepoSearchResult, error) {\n\tq := url.QueryEscape(strings.Join(terms, \" \"))\n\tif q != \"\" {\n\t\tq = \"?q=topic:\" + q\n\t}\n\tresp, err := http.Get(RepoURL + q)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\t//check the status code\n\tif resp.StatusCode != http.StatusOK {\n\t\tresp.Body.Close()\n\t\treturn nil, fmt.Errorf(\"search query Faild %s\", resp.Status)\n\t}\n\tvar result RepoSearchResult\n\tif err := json.NewDecoder(resp.Body).Decode(&result); err != nil {\n\t\tresp.Body.Close()\n\t\treturn nil, err\n\t}\n\tresp.Body.Close()\n\treturn &result, nil\n}", "title": "" }, { "docid": "080660663663a961d92a6ac0d087fb6e", "score": "0.52335423", "text": "func (g *Gitlab) Issues() ([]*Issue, error) {\n\n\turl := g.ResourceUrl(issues_url, nil)\n\n\tvar issues []*Issue\n\n\tcontents, err := g.buildAndExecRequest(\"GET\", url, nil)\n\tif err == nil {\n\t\terr = json.Unmarshal(contents, &issues)\n\t}\n\n\treturn issues, err\n}", "title": "" }, { "docid": "b7ec56a053d744bffe0de6b9cab8a32b", "score": "0.5197975", "text": "func NewIssues(httpClient *http.Client, scheme, host, path string) issues.Service {\n\tif !strings.HasSuffix(path, \"/\") {\n\t\tpath += \"/\"\n\t}\n\treturn &issueClient{\n\t\tclient: httpClient,\n\t\tbaseURL: &url.URL{\n\t\t\tScheme: scheme,\n\t\t\tHost: host,\n\t\t\tPath: path,\n\t\t},\n\t}\n}", "title": "" }, { "docid": "f83e4ee3159638120632c51f76bdd543", "score": "0.5184867", "text": "func (j *DSGitHub) FetchItemsIssue(ctx *Ctx) (err error) {\n\t// Process issues (possibly in threads)\n\tvar (\n\t\tch chan error\n\t\tallIssues []interface{}\n\t\tallIssuesMtx *sync.Mutex\n\t\tescha []chan error\n\t\teschaMtx *sync.Mutex\n\t)\n\tif j.ThrN > 1 {\n\t\tch = make(chan error)\n\t\tallIssuesMtx = &sync.Mutex{}\n\t\teschaMtx = &sync.Mutex{}\n\t}\n\tnThreads, nIss, issProcessed := 0, 0, 0\n\tprocessIssue := func(c chan error, issue map[string]interface{}) (wch chan error, e error) {\n\t\tdefer func() {\n\t\t\tif c != nil {\n\t\t\t\tc <- e\n\t\t\t}\n\t\t}()\n\t\titem, err := j.ProcessIssue(ctx, issue)\n\t\tFatalOnError(err)\n\t\tesItem := j.AddMetadata(ctx, item)\n\t\tif ctx.Project != \"\" {\n\t\t\titem[\"project\"] = ctx.Project\n\t\t}\n\t\tesItem[\"data\"] = item\n\t\tif issProcessed%ItemsPerPage == 0 {\n\t\t\tPrintf(\"%s/%s: processed %d/%d issues\\n\", j.URL, j.Category, issProcessed, nIss)\n\t\t}\n\t\tif allIssuesMtx != nil {\n\t\t\tallIssuesMtx.Lock()\n\t\t}\n\t\tallIssues = append(allIssues, esItem)\n\t\tnIssues := len(allIssues)\n\t\tif nIssues >= ctx.ESBulkSize {\n\t\t\tsendToElastic := func(c chan error) (ee error) {\n\t\t\t\tdefer func() {\n\t\t\t\t\tif c != nil {\n\t\t\t\t\t\tc <- ee\n\t\t\t\t\t}\n\t\t\t\t}()\n\t\t\t\tee = SendToElastic(ctx, j, true, UUID, allIssues)\n\t\t\t\tif ee != nil {\n\t\t\t\t\tPrintf(\"%s/%s: error %v sending %d issues to ElasticSearch\\n\", j.URL, j.Category, ee, len(allIssues))\n\t\t\t\t}\n\t\t\t\tallIssues = []interface{}{}\n\t\t\t\tif allIssuesMtx != nil {\n\t\t\t\t\tallIssuesMtx.Unlock()\n\t\t\t\t}\n\t\t\t\treturn\n\t\t\t}\n\t\t\tif j.ThrN > 1 {\n\t\t\t\twch = make(chan error)\n\t\t\t\tgo func() {\n\t\t\t\t\t_ = sendToElastic(wch)\n\t\t\t\t}()\n\t\t\t} else {\n\t\t\t\te = sendToElastic(nil)\n\t\t\t\tif e != nil {\n\t\t\t\t\treturn\n\t\t\t\t}\n\t\t\t}\n\t\t} else {\n\t\t\tif allIssuesMtx != nil {\n\t\t\t\tallIssuesMtx.Unlock()\n\t\t\t}\n\t\t}\n\t\treturn\n\t}\n\tissues, err := j.githubIssues(ctx, j.Org, j.Repo, ctx.DateFrom)\n\tFatalOnError(err)\n\truntime.GC()\n\tnIss = len(issues)\n\tPrintf(\"%s/%s: got %d issues\\n\", j.URL, j.Category, nIss)\n\tif j.ThrN > 1 {\n\t\tfor _, issue := range issues {\n\t\t\tgo func(iss map[string]interface{}) {\n\t\t\t\tvar (\n\t\t\t\t\te error\n\t\t\t\t\tesch chan error\n\t\t\t\t)\n\t\t\t\tesch, e = processIssue(ch, iss)\n\t\t\t\tif e != nil {\n\t\t\t\t\tPrintf(\"%s/%s: issues process error: %v\\n\", j.URL, j.Category, e)\n\t\t\t\t\treturn\n\t\t\t\t}\n\t\t\t\tif esch != nil {\n\t\t\t\t\tif eschaMtx != nil {\n\t\t\t\t\t\teschaMtx.Lock()\n\t\t\t\t\t}\n\t\t\t\t\tescha = append(escha, esch)\n\t\t\t\t\tif eschaMtx != nil {\n\t\t\t\t\t\teschaMtx.Unlock()\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}(issue)\n\t\t\tnThreads++\n\t\t\tif nThreads == j.ThrN {\n\t\t\t\terr = <-ch\n\t\t\t\tif err != nil {\n\t\t\t\t\treturn\n\t\t\t\t}\n\t\t\t\tissProcessed++\n\t\t\t\tnThreads--\n\t\t\t}\n\t\t}\n\t\tfor nThreads > 0 {\n\t\t\terr = <-ch\n\t\t\tnThreads--\n\t\t\tif err != nil {\n\t\t\t\treturn\n\t\t\t}\n\t\t\tissProcessed++\n\t\t}\n\t} else {\n\t\tfor _, issue := range issues {\n\t\t\t_, err = processIssue(nil, issue)\n\t\t\tif err != nil {\n\t\t\t\treturn\n\t\t\t}\n\t\t\tissProcessed++\n\t\t}\n\t}\n\tif eschaMtx != nil {\n\t\teschaMtx.Lock()\n\t}\n\tfor _, esch := range escha {\n\t\terr = <-esch\n\t\tif err != nil {\n\t\t\tif eschaMtx != nil {\n\t\t\t\teschaMtx.Unlock()\n\t\t\t}\n\t\t\treturn\n\t\t}\n\t}\n\tif eschaMtx != nil {\n\t\teschaMtx.Unlock()\n\t}\n\tnIssues := len(allIssues)\n\tif ctx.Debug > 0 {\n\t\tPrintf(\"%d remaining issues to send to ES\\n\", nIssues)\n\t}\n\tif nIssues > 0 {\n\t\terr = SendToElastic(ctx, j, true, UUID, allIssues)\n\t\tif err != nil {\n\t\t\tPrintf(\"%s/%s: error %v sending %d issues to ES\\n\", j.URL, j.Category, err, len(allIssues))\n\t\t}\n\t}\n\treturn\n}", "title": "" }, { "docid": "cb84d822ee42ec14d096ed0b1c92eb94", "score": "0.51605344", "text": "func ClosedIssues(ctx context.Context, c *client.Client, org string, project string, since time.Time, until time.Time, users []string) ([]*IssueSummary, error) {\n\tclosed, err := issues(ctx, c, org, project, since, until, users, \"closed\")\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\tresult := make([]*IssueSummary, 0, len(closed))\n\tfor _, i := range closed {\n\t\tresult = append(result, &IssueSummary{\n\t\t\tURL: i.GetHTMLURL(),\n\t\t\tDate: i.GetClosedAt().Format(dateForm),\n\t\t\tAuthor: i.GetUser().GetLogin(),\n\t\t\tCloser: i.GetClosedBy().GetLogin(),\n\t\t\tProject: project,\n\t\t\tTitle: i.GetTitle(),\n\t\t})\n\t}\n\n\treturn result, nil\n}", "title": "" }, { "docid": "9b71c10f4f451c14135ff6b7d66787e5", "score": "0.51588607", "text": "func (m *MaintainerManager) GetIssues(state, assignee string) ([]*gh.Issue, error) {\n\to := &gh.Options{}\n\to.QueryParams = map[string]string{\n\t\t\"sort\": \"updated\",\n\t\t\"direction\": \"asc\",\n\t\t\"state\": state,\n\t\t\"per_page\": \"100\",\n\t}\n\t// If assignee == \"\", don't add it to the params.\n\t// This will show all issues, assigned or not.\n\tif assignee != \"\" {\n\t\to.QueryParams[\"assignee\"] = assignee\n\t}\n\tprevSize := -1\n\tpage := 1\n\tall := []*gh.Issue{}\n\tfor len(all) != prevSize {\n\t\to.QueryParams[\"page\"] = strconv.Itoa(page)\n\t\tif issues, err := m.client.Issues(m.repo, o); err != nil {\n\t\t\treturn nil, err\n\t\t} else {\n\t\t\tprevSize = len(all)\n\t\t\tall = append(all, issues...)\n\t\t\tpage += 1\n\t\t}\n\t\tfmt.Printf(\".\")\n\t}\n\treturn all, nil\n}", "title": "" }, { "docid": "ad187117b997f06c31ad9290d019dbf6", "score": "0.5133385", "text": "func IssueList(project string, opts gitlab.ListProjectIssuesOptions, n int) ([]*gitlab.Issue, error) {\n\tif n == -1 {\n\t\topts.PerPage = 100\n\t}\n\tp, err := FindProject(project)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\tlist, resp, err := lab.Issues.ListProjectIssues(p.ID, &opts)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\tif resp.CurrentPage == resp.TotalPages {\n\t\treturn list, nil\n\t}\n\n\topts.Page = resp.NextPage\n\tfor len(list) < n || n == -1 {\n\t\tif n != -1 {\n\t\t\topts.PerPage = n - len(list)\n\t\t}\n\t\tissues, resp, err := lab.Issues.ListProjectIssues(p.ID, &opts)\n\t\tif err != nil {\n\t\t\treturn nil, err\n\t\t}\n\t\topts.Page = resp.NextPage\n\t\tlist = append(list, issues...)\n\t\tif resp.CurrentPage == resp.TotalPages {\n\t\t\tbreak\n\t\t}\n\t}\n\treturn list, nil\n}", "title": "" }, { "docid": "953ff6ab74472cb5495edc356f64d8bc", "score": "0.51289076", "text": "func Issues(ctx *context.Context) {\n\tif unit.TypeIssues.UnitGlobalDisabled() {\n\t\tlog.Debug(\"Issues overview page not available as it is globally disabled.\")\n\t\tctx.Status(http.StatusNotFound)\n\t\treturn\n\t}\n\n\tctx.Data[\"Title\"] = ctx.Tr(\"issues\")\n\tctx.Data[\"PageIsIssues\"] = true\n\tctx.Data[\"SingleRepoAction\"] = \"issue\"\n\tbuildIssueOverview(ctx, unit.TypeIssues)\n}", "title": "" }, { "docid": "67b73186df212c358845e5e4e1b61a54", "score": "0.5122271", "text": "func (c Client) ListIssues(ctx context.Context, since time.Time) ([]it.Issue, error) {\n\ty, m, d := since.Year(), since.Month(), since.Day()\n\tids, err := c.Client.FilterSearchIssueIDs(ctx, mantis.FilterSearchData{\n\t\tLastUpdateStartYear: &y,\n\t\tLastUpdateStartMonth: (*int)(&m),\n\t\tLastUpdateStartDay: &d,\n\t}, 0, 1000)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\tissues := make([]it.Issue, len(ids))\n\tfor i, id := range ids {\n\t\tissues[i] = it.Issue{ID: it.IssueID(strconv.Itoa(id))}\n\t}\n\treturn issues, nil\n}", "title": "" }, { "docid": "1e9b440dc24e00bbb38e9c130fd9c6f4", "score": "0.5114576", "text": "func fetchAllIssuesByLabel(client *github.Client, owner, name, state string, labels []string) []*github.Issue {\n\tpageIndex := 1\n\trepoOptions := github.IssueListByRepoOptions{\n\t\tListOptions: github.ListOptions{\n\t\t\tPage: pageIndex,\n\t\t\tPerPage: 100,\n\t\t},\n\t\tState: state,\n\t\tLabels: labels,\n\t}\n\tvar allIssues []*github.Issue\n\tfor {\n\t\tissues, _, err :=\n\t\t\tclient.Issues.ListByRepo(context.Background(), owner, name, &repoOptions)\n\t\tif err != nil {\n\t\t\tlog.Fatal(err)\n\t\t}\n\t\tallIssues = append(allIssues, issues...)\n\t\trepoOptions.Page++\n\t\tif len(issues) != 0 {\n\t\t\tbreak\n\t\t}\n\t}\n\treturn allIssues\n}", "title": "" }, { "docid": "fbdcc6f2c7e1f8183bb617ded85266ee", "score": "0.51119334", "text": "func (c *client) GetIssue(org, repo string, number int) (*Issue, error) {\n\tdurationLogger := c.log(\"GetIssue\", org, repo, number)\n\tdefer durationLogger()\n\n\tvar i Issue\n\t_, err := c.request(&request{\n\t\t// allow emoji\n\t\t// https://developer.github.com/changes/2018-02-22-label-description-search-preview/\n\t\taccept: \"application/vnd.github.symmetra-preview+json\",\n\t\tmethod: http.MethodGet,\n\t\tpath: fmt.Sprintf(\"/repos/%s/%s/issues/%d\", org, repo, number),\n\t\torg: org,\n\t\texitCodes: []int{200},\n\t}, &i)\n\treturn &i, err\n}", "title": "" }, { "docid": "64f179f7690092a2a130644a2d5c31cd", "score": "0.5107265", "text": "func (h *Engine) cachedIssues(ctx context.Context, org string, project string, state string, updatedDays int, newerThan time.Time) ([]*github.Issue, error) {\n\tkey := issueSearchKey(org, project, state, updatedDays)\n\n\tif x := h.cache.GetNewerThan(key, newerThan); x != nil {\n\t\treturn x.Issues, nil\n\t}\n\n\tklog.V(1).Infof(\"cache miss for %s newer than %s\", key, logu.STime(newerThan))\n\treturn h.updateIssues(ctx, org, project, state, updatedDays, key)\n}", "title": "" }, { "docid": "da985ec7fd4a3803bc1efaf01e164bbe", "score": "0.5103129", "text": "func (c *client) ListOpenIssues(org, repo string) ([]Issue, error) {\n\tc.log(\"ListOpenIssues\", org, repo)\n\tif c.fake {\n\t\treturn nil, nil\n\t}\n\tpath := fmt.Sprintf(\"/repos/%s/%s/issues\", org, repo)\n\tvar issues []Issue\n\terr := c.readPaginatedResults(\n\t\tpath,\n\t\tacceptNone,\n\t\torg,\n\t\tfunc() interface{} {\n\t\t\treturn &[]Issue{}\n\t\t},\n\t\tfunc(obj interface{}) {\n\t\t\tissues = append(issues, *(obj.(*[]Issue))...)\n\t\t},\n\t)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\treturn issues, nil\n}", "title": "" }, { "docid": "cdcd052b4fdf9324a2d4d6c85752c722", "score": "0.51015717", "text": "func fetchGithubIssue(conf *githubConfig) (*githubIssue, error) {\n\tctx := context.Background()\n\tts := oauth2.StaticTokenSource(\n\t\t&oauth2.Token{AccessToken: conf.token},\n\t)\n\ttc := oauth2.NewClient(ctx, ts)\n\tclient := github.NewClient(tc)\n\n\t// Read issue metadata\n\tissue, _, err := client.Issues.Get(context.Background(), conf.owner, conf.repo, conf.issueID)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\tres := &githubIssue{\n\t\tissue: issue,\n\t\tnameByLoginID: make(map[string]string),\n\t}\n\n\t// Read user metadata\n\tuser, _, err := client.Users.Get(context.Background(), stringify(issue.User.Login))\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\tres.nameByLoginID[stringify(issue.User.Login)] = stringify(user.Name)\n\n\t// Get all comments\n\tcomments, _, err := client.Issues.ListComments(context.Background(), conf.owner, conf.repo, conf.issueID, &github.IssueListCommentsOptions{})\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\tres.comments = comments\n\n\tloginIDs := []*string{\n\t\tissue.User.Login,\n\t}\n\t// Aggregate all users and read their metadata\n\tif issue.Assignee != nil {\n\t\tloginIDs = append(loginIDs, issue.Assignee.Login)\n\t}\n\n\tfor _, comment := range comments {\n\t\tloginIDs = append(loginIDs, comment.User.Login)\n\t}\n\n\tfor _, loginID := range loginIDs {\n\t\tid := stringify(loginID)\n\t\tif _, ok := res.nameByLoginID[id]; ok {\n\t\t\tcontinue\n\t\t}\n\t\tuser, _, err := client.Users.Get(context.Background(), id)\n\t\tif err != nil {\n\t\t\treturn nil, err\n\t\t}\n\t\tres.nameByLoginID[id] = stringify(user.Name)\n\t}\n\treturn res, nil\n}", "title": "" }, { "docid": "26331bd12833338e88118aeac51af9ab", "score": "0.5100036", "text": "func TestGitHubIssueMapping(t *testing.T) {\n\t// given\n\tresource.Require(t, resource.UnitTest)\n\tvar gitData = []remoteData{\n\t\t// JSON data file of Github issue with assignee to test that the data is getting correctly Mapped through the Map function\n\t\t// Github Issue API URL for the respective JSON data file to update the cache\n\t\t{\"github_issue_with_assignee.json\", true, \"http://api.github.com/repos/fabric8-wit-test/fabric8-wit-test-unit/issues/2\"},\n\t\t// JSON data file of Github issue with assignee and label\n\t\t// Issue API URL for the respective JSON file to update the cache\n\t\t{\"github_issue_with_assignee_labels.json\", true, \"https://api.github.com/repos/fabric8-wit-unit-test/fabric8-wit-test/issues/1\"},\n\t}\n\t// when/then\n\tfor _, j := range gitData {\n\t\tdoTestIssueMapping(t, j, remoteworkitem.ProviderGithub)\n\t}\n}", "title": "" }, { "docid": "55060e7b366e681c62daee3a7b9b3f4c", "score": "0.5089534", "text": "func populateIssues(client client.Client, repos *[]repo, filter client.IssueFilters) {\n\tvar wg sync.WaitGroup\n\tfor i, repo := range *repos {\n\t\twg.Add(1)\n\t\ti := i\n\t\trepo := repo\n\t\tgo func() {\n\t\t\tdefer wg.Done()\n\t\t\tvar err error\n\t\t\t(*repos)[i].Issues, err = client.GetIssuesForTriage(context.Background(), repo.Owner, repo.Name, filter)\n\t\t\t(*repos)[i].Error = err\n\t\t\tif err != nil {\n\t\t\t\tlog.Printf(\"Error gettings issues from %s, Error: %v\\n\", repo.FullName, err)\n\t\t\t\tif ghErr, ok := err.(*github.ErrorResponse); ok {\n\t\t\t\t\tif ghErr.Response.StatusCode == http.StatusNotFound {\n\t\t\t\t\t\tlog.Println(\"The repository could not be found, or you are not allowed to view it\")\n\t\t\t\t\t\tlog.Println(\"Have you set TRIAGE_GITHUB_TOKEN?\")\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\treturn\n\t\t\t}\n\t\t}()\n\t}\n\n\twg.Wait()\n}", "title": "" }, { "docid": "d0190f8465b63a178c72e6ec0bb2de51", "score": "0.5077512", "text": "func (w *ServerInterfaceWrapper) Issues(ctx echo.Context) error {\n\tvar err error\n\t// ------------- Path parameter \"project_id\" -------------\n\tvar projectId string\n\n\terr = runtime.BindStyledParameter(\"simple\", false, \"project_id\", ctx.Param(\"project_id\"), &projectId)\n\tif err != nil {\n\t\treturn echo.NewHTTPError(http.StatusBadRequest, fmt.Sprintf(\"Invalid format for parameter project_id: %s\", err))\n\t}\n\n\t// HasSecurity is set\n\n\tctx.Set(\"OpenId.Scopes\", []string{\"exitus/issue.read\"})\n\n\t// Parameter object where we will unmarshal all parameters from the context\n\tvar params IssuesParams\n\t// ------------- Optional query parameter \"q\" -------------\n\tif paramValue := ctx.QueryParam(\"q\"); paramValue != \"\" {\n\t}\n\n\terr = runtime.BindQueryParameter(\"form\", true, false, \"q\", ctx.QueryParams(), &params.Q)\n\tif err != nil {\n\t\treturn echo.NewHTTPError(http.StatusBadRequest, fmt.Sprintf(\"Invalid format for parameter q: %s\", err))\n\t}\n\n\t// ------------- Optional query parameter \"offset\" -------------\n\tif paramValue := ctx.QueryParam(\"offset\"); paramValue != \"\" {\n\t}\n\n\terr = runtime.BindQueryParameter(\"form\", true, false, \"offset\", ctx.QueryParams(), &params.Offset)\n\tif err != nil {\n\t\treturn echo.NewHTTPError(http.StatusBadRequest, fmt.Sprintf(\"Invalid format for parameter offset: %s\", err))\n\t}\n\n\t// ------------- Optional query parameter \"limit\" -------------\n\tif paramValue := ctx.QueryParam(\"limit\"); paramValue != \"\" {\n\t}\n\n\terr = runtime.BindQueryParameter(\"form\", true, false, \"limit\", ctx.QueryParams(), &params.Limit)\n\tif err != nil {\n\t\treturn echo.NewHTTPError(http.StatusBadRequest, fmt.Sprintf(\"Invalid format for parameter limit: %s\", err))\n\t}\n\n\t// Invoke the callback with all the unmarshalled arguments\n\terr = w.Handler.Issues(ctx, projectId, params)\n\treturn err\n}", "title": "" }, { "docid": "f6af4fdda6538cc504c3bf9b080b035e", "score": "0.5037018", "text": "func ImportIssues(db *sqlx.DB, repository string, inIssues []github.Issue) error {\n\ttx, err := db.Begin()\n\tif err != nil {\n\t\treturn errors.Wrap(err, \"import issue failure\")\n\t}\n\n\tdefer func() {\n\t\tif err != nil {\n\t\t\ttx.Rollback()\n\t\t\treturn\n\t\t}\n\n\t\terr = tx.Commit()\n\t}()\n\n\tlog.Info(\"updating or importing issues\")\n\tfor _, in := range inIssues {\n\t\tissue := ConvertIssue(repository, in)\n\n\t\tif _, err := tx.Exec(insertIssueSQL, issue.Number, issue.State, issue.Title, issue.Body,\n\t\t\tissue.User, issue.Labels, issue.Assignee, issue.ClosedAt, issue.CreatedAt,\n\t\t\tissue.UpdatedAt, issue.Milestone, issue.Repository); err != nil {\n\t\t\treturn err\n\t\t}\n\t}\n\n\tlog.Info(\"analyzing labels\")\n\tlabels := map[string]Label{}\n\n\tissue := Issue{}\n\trows, err := db.Queryx(activeIssuesSQL)\n\tif err != nil {\n\t\treturn errors.Wrap(err, \"query open issues failure\")\n\t}\n\tfor rows.Next() {\n\t\terr := rows.StructScan(&issue)\n\t\tif err != nil {\n\t\t\treturn errors.Wrap(err, \"scan issue into struct failure\")\n\t\t}\n\n\t\tfor _, label := range issue.Labels {\n\t\t\tlabels[label.Name] = label\n\t\t}\n\t}\n\n\tfor _, label := range labels {\n\t\tif _, err := tx.Exec(insertLabelSQL, label.Name, label.URL, label.Color); err != nil {\n\t\t\treturn errors.Wrap(err, \"insert label\")\n\t\t}\n\t}\n\n\treturn nil\n}", "title": "" }, { "docid": "57e1b3d417a07725fdbc9dbf52ddef2f", "score": "0.5015128", "text": "func (d *RetryDownloader) GetIssues(page, perPage int) ([]*Issue, bool, error) {\n\tvar (\n\t\tissues []*Issue\n\t\tisEnd bool\n\t\terr error\n\t)\n\n\terr = d.retry(func() error {\n\t\tissues, isEnd, err = d.Downloader.GetIssues(page, perPage)\n\t\treturn err\n\t})\n\n\treturn issues, isEnd, err\n}", "title": "" }, { "docid": "0d7cfafec7eab62714207efd01632b23", "score": "0.4976064", "text": "func (g GithubClient) ListAllIssues(owner, repo string) ([]*github.Issue, error) {\n\t// Because gathering all issues from large Github repo is time-consuming, we add a progress bar\n\t// rendering for more user-helpful output.\n\tlog.Printf(\"Gathering all issues from Github for %s/%s. This may take a while...\", owner, repo)\n\n\tstart := time.Now().Round(time.Second)\n\n\tlo := &github.ListOptions{\n\t\tPage: 1,\n\t\tPerPage: 100,\n\t}\n\tilo := &github.IssueListByRepoOptions{\n\t\tState: \"all\",\n\t\tListOptions: *lo,\n\t}\n\n\tissues, resp, err := g.client.Issues.ListByRepo(context.Background(), owner, repo, ilo)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\tRenderProgressBar(ilo.ListOptions.Page, resp.LastPage, time.Now().Round(time.Second).Sub(start).String(), true)\n\n\tilo.ListOptions.Page++\n\n\tfor ilo.ListOptions.Page <= resp.LastPage {\n\t\tis, _, err := g.client.Issues.ListByRepo(context.Background(), owner, repo, ilo)\n\t\tif err != nil {\n\t\t\t// New line following the progress bar\n\t\t\tfmt.Print(\"\\n\")\n\t\t\treturn nil, err\n\t\t}\n\t\tRenderProgressBar(ilo.ListOptions.Page, resp.LastPage, time.Now().Round(time.Second).Sub(start).String(), false)\n\n\t\tfor _, i := range is {\n\t\t\tissues = append(issues, i)\n\t\t}\n\t\tilo.ListOptions.Page++\n\t}\n\t// New line following the progress bar\n\tfmt.Print(\"\\n\")\n\tlog.Print(\"All issues fetched.\")\n\treturn issues, nil\n}", "title": "" }, { "docid": "4a6153ab167c64713688dcf8f921bf98", "score": "0.4974165", "text": "func IssueList(project string, opts *gitlab.ListProjectIssuesOptions) ([]*gitlab.Issue, error) {\n\tif os.Getenv(\"DEBUG\") != \"\" {\n\t\tspew.Dump(opts)\n\t}\n\n\tp, err := FindProject(project)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\tlist, _, err := lab.Issues.ListProjectIssues(p.ID, opts)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\treturn list, nil\n}", "title": "" }, { "docid": "d1fe2f46ed0cb8b7a4bb52bb005b936e", "score": "0.49118006", "text": "func getIssuesInfo(p *api.IssuePayload) (issueTitle, link, by, operator, operateResult, assignees string) {\n\tissueTitle = fmt.Sprintf(\"[Issue-%s #%d]: %s\\n%s\", p.Repository.FullName, p.Issue.Index, p.Action, p.Issue.Title)\n\tassignList := p.Issue.Assignees\n\tassignStringList := make([]string, len(assignList))\n\n\tfor i, user := range assignList {\n\t\tassignStringList[i] = user.UserName\n\t}\n\tif p.Action == api.HookIssueAssigned {\n\t\toperateResult = fmt.Sprintf(\"%s assign this to %s\", p.Sender.UserName, assignList[len(assignList)-1].UserName)\n\t} else if p.Action == api.HookIssueUnassigned {\n\t\toperateResult = fmt.Sprintf(\"%s unassigned this for someone\", p.Sender.UserName)\n\t} else if p.Action == api.HookIssueMilestoned {\n\t\toperateResult = fmt.Sprintf(\"%s/milestone/%d\", p.Repository.HTMLURL, p.Issue.Milestone.ID)\n\t}\n\tlink = p.Issue.HTMLURL\n\tby = fmt.Sprintf(\"Issue by %s\", p.Issue.Poster.UserName)\n\tif len(assignStringList) > 0 {\n\t\tassignees = fmt.Sprintf(\"Assignees: %s\", strings.Join(assignStringList, \", \"))\n\t}\n\toperator = fmt.Sprintf(\"Operator: %s\", p.Sender.UserName)\n\treturn issueTitle, link, by, operator, operateResult, assignees\n}", "title": "" }, { "docid": "770dcb23ecc9f1d4ede0e05cc0ac7f34", "score": "0.49060676", "text": "func (b *Indexer) Search(ctx context.Context, keyword string, repoIDs []int64, limit, start int) (*internal.SearchResult, error) {\n\tvar repoQueriesP []*query.NumericRangeQuery\n\tfor _, repoID := range repoIDs {\n\t\trepoQueriesP = append(repoQueriesP, numericEqualityQuery(repoID, \"RepoID\"))\n\t}\n\trepoQueries := make([]query.Query, len(repoQueriesP))\n\tfor i, v := range repoQueriesP {\n\t\trepoQueries[i] = query.Query(v)\n\t}\n\n\tindexerQuery := bleve.NewConjunctionQuery(\n\t\tbleve.NewDisjunctionQuery(repoQueries...),\n\t\tbleve.NewDisjunctionQuery(\n\t\t\tnewMatchPhraseQuery(keyword, \"Title\", issueIndexerAnalyzer),\n\t\t\tnewMatchPhraseQuery(keyword, \"Content\", issueIndexerAnalyzer),\n\t\t\tnewMatchPhraseQuery(keyword, \"Comments\", issueIndexerAnalyzer),\n\t\t))\n\tsearch := bleve.NewSearchRequestOptions(indexerQuery, limit, start, false)\n\tsearch.SortBy([]string{\"-_score\"})\n\n\tresult, err := b.inner.Indexer.SearchInContext(ctx, search)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\tret := internal.SearchResult{\n\t\tHits: make([]internal.Match, 0, len(result.Hits)),\n\t}\n\tfor _, hit := range result.Hits {\n\t\tid, err := indexer_internal.ParseBase36(hit.ID)\n\t\tif err != nil {\n\t\t\treturn nil, err\n\t\t}\n\t\tret.Hits = append(ret.Hits, internal.Match{\n\t\t\tID: id,\n\t\t})\n\t}\n\treturn &ret, nil\n}", "title": "" }, { "docid": "7d4b860750a83c26816dbccda362d1eb", "score": "0.4892973", "text": "func GetIssuesForSprint(jiraClient *jira.Client, sprintID int, jql string) ([]jira.Issue, *jira.Response, error) {\n\tif jql != \"\" {\n\t\tapiEndpoint := fmt.Sprintf(\"rest/agile/1.0/sprint/%d/issue?jql=%s\", sprintID, url.QueryEscape(jql))\n\t\treq, err := jiraClient.NewRequest(\"GET\", apiEndpoint, nil)\n\t\tif err != nil {\n\t\t\treturn nil, nil, err\n\t\t}\n\t\tresult := new(jira.IssuesInSprintResult)\n\t\tresp, err := jiraClient.Do(req, result)\n\t\tif err != nil {\n\t\t\terr = jira.NewJiraError(resp, err)\n\t\t}\n\t\tlog.WithFields(log.Fields{\"project\": jql, \"count\": len(result.Issues)}).Debug(\"Sprint issue\")\n\t\treturn result.Issues, resp, err\n\t}\n\treturn jiraClient.Sprint.GetIssuesForSprint(sprintID)\n}", "title": "" }, { "docid": "3a215ab93ab31e7e9e4dccc50dfec776", "score": "0.4858348", "text": "func APIProjectIssueHandler(er *Errorly) http.HandlerFunc {\n\treturn func(rw http.ResponseWriter, r *http.Request) {\n\t\tsession, _ := er.Store.Get(r, sessionName)\n\t\tdefer er.SaveSession(session, r, rw)\n\n\t\tvars := mux.Vars(r)\n\n\t\turlQuery := r.URL.Query()\n\n\t\t// Authenticate the user\n\t\tauth, user := er.AuthenticateSession(session)\n\n\t\tproject, viewable, _, ok := verifyProjectVisibility(er, rw, vars, user, auth, true)\n\t\tif !ok {\n\t\t\t// If ok is False, an error has already been provided to the ResponseWriter so we should just return\n\t\t\treturn\n\t\t}\n\n\t\tif !viewable {\n\t\t\t// No permission to view project. We will treat like the project\n\t\t\t// does not exist.\n\t\t\tpassResponse(rw, \"Could not find this project\", false, http.StatusBadRequest)\n\n\t\t\treturn\n\t\t}\n\n\t\t_issueID := urlQuery.Get(\"id\")\n\t\tif _issueID != \"\" {\n\t\t\t// If an ID is specified we will instead return just the issue\n\t\t\tissueID, err := strconv.ParseInt(_issueID, 10, 64)\n\t\t\tif err != nil {\n\t\t\t\tpassResponse(rw, \"ID argument is not valid\", false, http.StatusBadRequest)\n\n\t\t\t\treturn\n\t\t\t}\n\n\t\t\tissue := &structs.IssueEntry{}\n\n\t\t\terr = er.Postgres.Model(issue).\n\t\t\t\tWhere(\"issue_entry.project_id = ?\", project.ID).\n\t\t\t\tWhere(\"issue_entry.id = ?\", issueID).\n\t\t\t\tSelect()\n\t\t\tif err != nil {\n\t\t\t\tif errors.Is(err, pg.ErrNoRows) {\n\t\t\t\t\t// Invalid issue ID\n\t\t\t\t\tpassResponse(rw, \"Could not find this issue\", false, http.StatusBadRequest)\n\n\t\t\t\t\treturn\n\t\t\t\t}\n\n\t\t\t\tpassResponse(rw, err.Error(), false, http.StatusInternalServerError)\n\n\t\t\t\treturn\n\t\t\t}\n\n\t\t\tpassResponse(rw, structs.APIProjectIssues{\n\t\t\t\tIssue: issue,\n\t\t\t}, true, http.StatusOK)\n\n\t\t\treturn\n\t\t}\n\n\t\t// Get query from search\n\t\tquery := urlQuery.Get(\"q\")\n\t\tif query == \"\" {\n\t\t\tquery = \"\"\n\t\t}\n\n\t\t// We should get a limit argument here but at the moment\n\t\t// we will hardcode 25 per page.\n\t\t_pageLimit := pageLimit\n\n\t\t// Retrieve page argument from URL\n\t\t_page := r.FormValue(\"page\")\n\t\tif _page == \"\" {\n\t\t\tpassResponse(rw, \"Page argument is missing\", false, http.StatusBadRequest)\n\n\t\t\treturn\n\t\t}\n\n\t\t// Check page is a valid number. We will use the first page\n\t\t// argument provided as multiple could be passed.\n\t\tpage, err := strconv.Atoi(_page)\n\t\tif err != nil {\n\t\t\tpassResponse(rw, \"Page argument is not valid\", false, http.StatusBadRequest)\n\n\t\t\treturn\n\t\t}\n\n\t\tvar issues []structs.IssueEntry\n\n\t\tvar totalissues int\n\n\t\tif auth {\n\t\t\tissues, totalissues, err = fetchProjectIssues(er, project.ID, _pageLimit, page, query, user.ID)\n\t\t} else {\n\t\t\tissues, totalissues, err = fetchProjectIssues(er, project.ID, _pageLimit, page, query, 0)\n\t\t}\n\n\t\tif err != nil {\n\t\t\tpassResponse(rw, err.Error(), false, http.StatusInternalServerError)\n\n\t\t\treturn\n\t\t}\n\n\t\tpassResponse(rw, structs.APIProjectIssues{\n\t\t\tPage: page,\n\t\t\tTotalIssues: totalissues,\n\t\t\tIssues: issues,\n\t\t}, true, http.StatusOK)\n\t}\n}", "title": "" }, { "docid": "ac67412b1d4b0bd7a08f8332b82d4708", "score": "0.48535708", "text": "func (r *Reitveld) Issue(issue int64) (*Issue, error) {\n\treq, err := http.NewRequest(\"GET\", fmt.Sprintf(\"https://codereview.chromium.org/api/%d/\", issue), nil)\n\tif err != nil {\n\t\treturn nil, fmt.Errorf(\"Failed to build request: %s\", err)\n\t}\n\tresp, err := r.client.Do(req)\n\tif err != nil {\n\t\treturn nil, fmt.Errorf(\"Failed to retrieve issue info: %s\", err)\n\t}\n\tif resp.StatusCode != 200 {\n\t\treturn nil, fmt.Errorf(\"No such issue %d\", issue)\n\t}\n\tdec := json.NewDecoder(resp.Body)\n\tinfo := &Issue{}\n\tif err := dec.Decode(info); err != nil {\n\t\treturn nil, fmt.Errorf(\"Failed to read Reitveld issue info: %s\", err)\n\n\t}\n\treturn info, nil\n}", "title": "" }, { "docid": "5a4abcbb735dcb5921470a270f6a27fb", "score": "0.48428172", "text": "func stalePullRequests(staleTime time.Duration) (stale []Issue, err error) {\n\tstale = make([]Issue, 0)\n\n\turl := fmt.Sprintf(\"%s/orgs/%s/issues?filter=all&state=open\", *ghAPIFl, *ghOrgFl)\n\treq, err := http.NewRequest(\"GET\", url, nil)\n\tif err != nil {\n\t\treturn nil, fmt.Errorf(\"cannot create GET request: %s\", err)\n\t}\n\taddAuthentication(req)\n\n\tloadIssues := func(r *http.Request) ([]Issue, string, error) {\n\t\tresp, err := http.DefaultClient.Do(r)\n\t\tif err != nil {\n\t\t\treturn nil, \"\", fmt.Errorf(\"cannot fetch response: %s\", err)\n\t\t}\n\t\tdefer resp.Body.Close()\n\t\tvar issues []Issue\n\t\tif err := json.NewDecoder(resp.Body).Decode(&issues); err != nil {\n\t\t\treturn nil, \"\", fmt.Errorf(\"cannot decode response: %s\", err)\n\t\t}\n\t\tlist := linkRegex.FindStringSubmatch(resp.Header.Get(\"Link\"))\n\t\tnextURL := \"\"\n\t\tif len(list) == 2 {\n\t\t\tnextURL = list[1]\n\t\t}\n\t\treturn issues, nextURL, nil\n\t}\n\n\tvar issues []Issue\n\tloadMore := true\n\tfor loadMore == true {\n\t\tnewIssues, nextURL, loadErr := loadIssues(req)\n\t\tif loadErr != nil {\n\t\t\tpanic(\"Failed to load: \" + loadErr.Error())\n\t\t}\n\t\tissues = append(issues, newIssues...)\n\t\tif nextURL == \"\" {\n\t\t\tloadMore = false\n\t\t} else {\n\t\t\treq, err = http.NewRequest(\"GET\", nextURL, nil)\n\t\t\tif err != nil {\n\t\t\t\treturn nil, fmt.Errorf(\"cannot create GET request: %s\", err)\n\t\t\t}\n\t\t\taddAuthentication(req)\n\t\t}\n\t}\n\n\tnow := time.Now()\n\tfor _, issue := range issues {\n\t\tif !issue.isPullRequest() {\n\t\t\tcontinue\n\t\t}\n\t\tif issue.Assignee.Login == issue.User.Login {\n\t\t\t// Dev's assign PR's to themselves to signal it is not ready for\n\t\t\t// being merged.\n\t\t\tcontinue\n\t\t}\n\t\tif issue.CreatedAt.Add(staleTime).After(now) {\n\t\t\tcontinue\n\t\t}\n\n\t\tstale = append(stale, issue)\n\t}\n\treturn stale, nil\n}", "title": "" }, { "docid": "fde5afcf6b0afa5f3fd13ae566eb6f93", "score": "0.48351955", "text": "func (client *Client) IssuesByCustomFilter(filterName, filterValue string) (issues []*Issue, err error) {\n\tpath := fmt.Sprintf(\"/rest/api/2/search?jql=cf[%s]=%s\", filterName, filterValue)\n\tres, err := client.getRequest(path, http.StatusOK)\n\tif err != nil {\n\t\treturn issues, fmt.Errorf(\"IssuesByCustomFilter failed request: %w\", err)\n\t}\n\tdefer res.Body.Close()\n\n\tvar result struct {\n\t\tIssues []*Issue `json:\"issues\"`\n\t}\n\n\tbodyBytes, err := ioutil.ReadAll(res.Body)\n\tif err != nil {\n\t\treturn issues, fmt.Errorf(\"IssuesByCustomFilter failed to read response body: %w\", err)\n\t}\n\n\tif err := json.Unmarshal(bodyBytes, &result); err != nil {\n\t\treturn issues, fmt.Errorf(\"IssuesByCustomFilter failed unmarshal response body: %w\", err)\n\t}\n\treturn result.Issues, nil\n}", "title": "" }, { "docid": "1a8424f17c8358dc5743bd07e076950b", "score": "0.48293963", "text": "func (b *GithubBridge) GetIssueLocal(ctx context.Context, owner string, project string, number int) (*pbgh.Issue, error) {\n\turlv := \"https://api.github.com/repos/\" + owner + \"/\" + project + \"/issues/\" + strconv.Itoa(number)\n\tbody, _, err := b.visitURL(ctx, urlv)\n\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\tvar data map[string]interface{}\n\terr = json.Unmarshal([]byte(body), &data)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\tif _, ok := data[\"title\"]; !ok {\n\t\tb.RaiseIssue(\"Bad parse\", fmt.Sprintf(\"Bad parse %v\", string(body)))\n\t}\n\n\trbody := \"\"\n\tif _, ok := data[\"body\"]; ok {\n\t\trbody = fmt.Sprintf(\"%v\", data[\"body\"])\n\t}\n\n\tissue := &pbgh.Issue{Number: int32(number), Service: project, Title: data[\"title\"].(string), Body: rbody}\n\tif data[\"state\"].(string) == \"open\" {\n\t\tissue.State = pbgh.Issue_OPEN\n\t} else {\n\t\tissue.State = pbgh.Issue_CLOSED\n\t}\n\n\treturn issue, nil\n}", "title": "" }, { "docid": "ae328701aca79150bfe911462464a8e9", "score": "0.48010823", "text": "func (c *client) ListProjectIssues(\n\tid interface{},\n\topt *glab.ListProjectIssuesOptions,\n\toptions ...glab.RequestOptionFunc,\n) ([]*glab.Issue, *glab.Response, error) {\n\treturn c.c.Issues.ListProjectIssues(id, opt, options...)\n}", "title": "" }, { "docid": "8ecc99d93751539aebcc5b253af618b6", "score": "0.47658765", "text": "func GetAllIssues(db *gorm.DB, issues *[]Issue) (err error) {\n\tif err = db.Find(issues).Error; err != nil {\n\t\treturn err\n\t}\n\treturn nil\n}", "title": "" }, { "docid": "36e077526c6fa9f90cf2eb6da35b542e", "score": "0.47569445", "text": "func SortIssues(issues []*Issue) {\n\tsort.Slice(issues, func(i, j int) bool {\n\t\tpi := issues[i].Pos\n\t\tpj := issues[j].Pos\n\t\tif pi.Filename != pj.Filename {\n\t\t\treturn pi.Filename < pj.Filename\n\t\t}\n\t\treturn pi.Offset < pj.Offset\n\t})\n}", "title": "" }, { "docid": "9863db5c665c62693062673486861d7e", "score": "0.47469229", "text": "func (m *MilestoneTasks) PingEarlyIssues(ctx *wf.TaskContext, develVersion int, openTreeURL string) (result struct{}, _ error) {\n\tmilestoneName := fmt.Sprintf(\"Go1.%d\", develVersion)\n\n\tgh, ok := m.Client.(*GitHubClient)\n\tif !ok || gh.V4 == nil {\n\t\t// TODO(go.dev/issue/58856): Decide if it's worth moving the GraphQL query/mutation\n\t\t// into GitHubClientInterface. That kinda harms readability because GraphQL code is\n\t\t// basically a flexible API call, so it's most readable when close to where they're\n\t\t// used. This also depends on what kind of tests we'll want to use for this.\n\t\treturn struct{}{}, fmt.Errorf(\"no GitHub API v4 client\")\n\t}\n\n\t// Find all open early-in-cycle issues in the development major release milestone.\n\ttype issue struct {\n\t\tID githubv4.ID\n\t\tNumber int\n\t\tTitle string\n\n\t\tTimelineItems struct {\n\t\t\tNodes []struct {\n\t\t\t\tIssueComment struct {\n\t\t\t\t\tAuthor struct{ Login string }\n\t\t\t\t\tBody string\n\t\t\t\t} `graphql:\"...on IssueComment\"`\n\t\t\t}\n\t\t} `graphql:\"timelineItems(since: $avoidDupSince, itemTypes: ISSUE_COMMENT, last: 100)\"`\n\t}\n\tvar earlyIssues []issue\n\tmilestoneNumber, err := m.Client.FetchMilestone(ctx, m.RepoOwner, m.RepoName, milestoneName, false)\n\tif err != nil {\n\t\treturn struct{}{}, err\n\t}\n\tvariables := map[string]interface{}{\n\t\t\"repoOwner\": githubv4.String(m.RepoOwner),\n\t\t\"repoName\": githubv4.String(m.RepoName),\n\t\t\"avoidDupSince\": githubv4.DateTime{Time: time.Now().Add(-30 * 24 * time.Hour)},\n\t\t\"milestoneNumber\": githubv4.String(fmt.Sprint(milestoneNumber)), // For some reason GitHub API v4 uses string type for milestone numbers.\n\t\t\"issueCursor\": (*githubv4.String)(nil),\n\t}\n\tfor {\n\t\tvar q struct {\n\t\t\tRepository struct {\n\t\t\t\tIssues struct {\n\t\t\t\t\tNodes []issue\n\t\t\t\t\tPageInfo struct {\n\t\t\t\t\t\tEndCursor githubv4.String\n\t\t\t\t\t\tHasNextPage bool\n\t\t\t\t\t}\n\t\t\t\t} `graphql:\"issues(first: 100, after: $issueCursor, filterBy: {states: OPEN, labels: \\\"early-in-cycle\\\", milestoneNumber: $milestoneNumber}, orderBy: {field: CREATED_AT, direction: ASC})\"`\n\t\t\t} `graphql:\"repository(owner: $repoOwner, name: $repoName)\"`\n\t\t}\n\t\terr := gh.V4.Query(ctx, &q, variables)\n\t\tif err != nil {\n\t\t\treturn struct{}{}, err\n\t\t}\n\t\tearlyIssues = append(earlyIssues, q.Repository.Issues.Nodes...)\n\t\tif !q.Repository.Issues.PageInfo.HasNextPage {\n\t\t\tbreak\n\t\t}\n\t\tvariables[\"issueCursor\"] = githubv4.NewString(q.Repository.Issues.PageInfo.EndCursor)\n\t}\n\n\t// Ping them.\n\tctx.Printf(\"Processing %d early-in-cycle issues in %s milestone (milestone number %d).\", len(earlyIssues), milestoneName, milestoneNumber)\nEarlyIssuesLoop:\n\tfor _, i := range earlyIssues {\n\t\tfor _, n := range i.TimelineItems.Nodes {\n\t\t\tif n.IssueComment.Author.Login == \"gopherbot\" && strings.Contains(n.IssueComment.Body, \"friendly reminder\") {\n\t\t\t\tctx.Printf(\"Skipping issue %d, it was already pinged.\", i.Number)\n\t\t\t\tcontinue EarlyIssuesLoop\n\t\t\t}\n\t\t}\n\n\t\t// Post a comment.\n\t\tconst dryRun = false\n\t\tif dryRun {\n\t\t\tctx.Printf(\"[dry run] Would've pinged issue %d (%.32s…).\", i.Number, i.Title)\n\t\t\tcontinue\n\t\t}\n\t\terr := m.Client.PostComment(ctx, i.ID, fmt.Sprintf(\"This issue is currently labeled as early-in-cycle for Go 1.%d.\\n\"+\n\t\t\t\"That [time is now](%s), so a friendly reminder to look at it again.\", develVersion, openTreeURL))\n\t\tif err != nil {\n\t\t\treturn struct{}{}, err\n\t\t}\n\t\tctx.Printf(\"Pinged issue %d (%.32s…).\", i.Number, i.Title)\n\t\ttime.Sleep(3 * time.Second) // Take a moment between pinging issues to avoid a high rate of addComment mutations.\n\t}\n\n\treturn struct{}{}, nil\n}", "title": "" }, { "docid": "f6affba1942aefc49bf89fa421c44b8b", "score": "0.4735119", "text": "func (s *MilestonesService) GetMilestoneIssues(pid interface{}, milestone int, opt *GetMilestoneIssuesOptions, options ...RequestOptionFunc) ([]*Issue, *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/milestones/%d/issues\", PathEscape(project), milestone)\n\n\treq, err := s.client.NewRequest(http.MethodGet, u, opt, options)\n\tif err != nil {\n\t\treturn nil, nil, err\n\t}\n\n\tvar i []*Issue\n\tresp, err := s.client.Do(req, &i)\n\tif err != nil {\n\t\treturn nil, resp, err\n\t}\n\n\treturn i, resp, nil\n}", "title": "" }, { "docid": "36c5b2889e615720d2c77ff6f9558cf2", "score": "0.47215366", "text": "func (j *DSGitHub) ProcessIssue(ctx *Ctx, inIssue map[string]interface{}) (issue map[string]interface{}, err error) {\n\tissue = inIssue\n\tissue[\"user_data\"] = map[string]interface{}{}\n\tissue[\"assignee_data\"] = map[string]interface{}{}\n\tissue[\"assignees_data\"] = []interface{}{}\n\tissue[\"comments_data\"] = []interface{}{}\n\tissue[\"reactions_data\"] = []interface{}{}\n\t// [\"user\", \"assignee\", \"assignees\", \"comments\", \"reactions\"]\n\tuserLogin, ok := Dig(issue, []string{\"user\", \"login\"}, false, true)\n\tif ok {\n\t\tissue[\"user_data\"], _, err = j.githubUser(ctx, userLogin.(string))\n\t\tif err != nil {\n\t\t\treturn\n\t\t}\n\t}\n\tassigneeLogin, ok := Dig(issue, []string{\"assignee\", \"login\"}, false, true)\n\tif ok {\n\t\tissue[\"assignee_data\"], _, err = j.githubUser(ctx, assigneeLogin.(string))\n\t\tif err != nil {\n\t\t\treturn\n\t\t}\n\t}\n\tiAssignees, ok := Dig(issue, []string{\"assignees\"}, false, true)\n\tif ok {\n\t\tassignees, _ := iAssignees.([]interface{})\n\t\tassigneesAry := []map[string]interface{}{}\n\t\tfor _, assignee := range assignees {\n\t\t\taLogin, ok := Dig(assignee, []string{\"login\"}, false, true)\n\t\t\tif ok {\n\t\t\t\tassigneeData, _, e := j.githubUser(ctx, aLogin.(string))\n\t\t\t\tif e != nil {\n\t\t\t\t\terr = e\n\t\t\t\t\treturn\n\t\t\t\t}\n\t\t\t\tassigneesAry = append(assigneesAry, assigneeData)\n\t\t\t}\n\t\t}\n\t\tissue[\"assignees_data\"] = assigneesAry\n\t}\n\tnumber, ok := Dig(issue, []string{\"number\"}, false, true)\n\tif ok {\n\t\tissue[\"comments_data\"], err = j.githubIssueComments(ctx, j.Org, j.Repo, int(number.(float64)))\n\t\tif err != nil {\n\t\t\treturn\n\t\t}\n\t\tiCnt, ok := Dig(issue, []string{\"reactions\", \"total_count\"}, false, true)\n\t\tif ok {\n\t\t\tissue[\"reactions_data\"] = []interface{}{}\n\t\t\tcnt := int(iCnt.(float64))\n\t\t\tif cnt > 0 {\n\t\t\t\tissue[\"reactions_data\"], err = j.githubIssueReactions(ctx, j.Org, j.Repo, int(number.(float64)))\n\t\t\t\tif err != nil {\n\t\t\t\t\treturn\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\treturn\n}", "title": "" }, { "docid": "8b291f7664384df1eb766b1da3a36ef2", "score": "0.47068518", "text": "func (s *IssueService) Issues() ([]*domain.Issue, error) {\n\treturn s.IssueRepository.All()\n}", "title": "" }, { "docid": "d3c2d67a603a6354cbd894d37450720d", "score": "0.46998537", "text": "func (c *Client) GetSiemIssues(opts map[string]interface{}) ([]*Click, []*Message, error) {\n\treturn []*Click{}, []*Message{}, nil\n}", "title": "" }, { "docid": "59152f367616266de1dfab30fac9144e", "score": "0.46976697", "text": "func (c *Client) Search(ctx context.Context, args search.SymbolsParameters) (symbols result.Symbols, err error) {\n\tspan, ctx := ot.StartSpanFromContext(ctx, \"symbols.Client.Search\")\n\tdefer func() {\n\t\tif err != nil {\n\t\t\text.Error.Set(span, true)\n\t\t\tspan.LogFields(otlog.Error(err))\n\t\t}\n\t\tspan.Finish()\n\t}()\n\tspan.SetTag(\"Repo\", string(args.Repo))\n\tspan.SetTag(\"CommitID\", string(args.CommitID))\n\n\tresp, err := c.httpPost(ctx, \"search\", args.Repo, args)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\tdefer resp.Body.Close()\n\n\tif resp.StatusCode != http.StatusOK {\n\t\t// best-effort inclusion of body in error message\n\t\tbody, _ := io.ReadAll(io.LimitReader(resp.Body, 200))\n\t\treturn nil, errors.Errorf(\n\t\t\t\"Symbol.Search http status %d: %s\",\n\t\t\tresp.StatusCode,\n\t\t\tstring(body),\n\t\t)\n\t}\n\n\tvar response search.SymbolsResponse\n\terr = json.NewDecoder(resp.Body).Decode(&response)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\tif response.Err != \"\" {\n\t\treturn nil, errors.New(response.Err)\n\t}\n\tsymbols = response.Symbols\n\n\t// 🚨 SECURITY: We have valid results, so we need to apply sub-repo permissions\n\t// filtering.\n\tif c.SubRepoPermsChecker == nil {\n\t\treturn symbols, err\n\t}\n\n\tchecker := c.SubRepoPermsChecker()\n\tif !authz.SubRepoEnabled(checker) {\n\t\treturn symbols, err\n\t}\n\n\ta := actor.FromContext(ctx)\n\t// Filter in place\n\tfiltered := symbols[:0]\n\tfor _, r := range symbols {\n\t\trc := authz.RepoContent{\n\t\t\tRepo: args.Repo,\n\t\t\tPath: r.Path,\n\t\t}\n\t\tperm, err := authz.ActorPermissions(ctx, checker, a, rc)\n\t\tif err != nil {\n\t\t\treturn nil, errors.Wrap(err, \"checking sub-repo permissions\")\n\t\t}\n\t\tif perm.Include(authz.Read) {\n\t\t\tfiltered = append(filtered, r)\n\t\t}\n\t}\n\n\treturn filtered, nil\n}", "title": "" }, { "docid": "4fb322a9201f387c070d320de055b66f", "score": "0.46608132", "text": "func (a *RepoAPI) createIssue(params interface{}) (resp *rpc.Response) {\n\tm := objx.New(cast.ToStringMap(params))\n\tname := m.Get(\"name\").Str()\n\tcallParams := m.Get(\"params\").MSI()\n\treturn rpc.Success(util.Map{\n\t\t\"data\": a.mods.Repo.CreateIssue(name, callParams),\n\t})\n}", "title": "" }, { "docid": "4b892d035cb04c47ce17cbc9a82d6aaf", "score": "0.46553063", "text": "func TestIssue(t *testing.T) {\n\tts := httptest.NewServer(http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) {\n\t\tcheckAuth(t, r)\n\t\tval := `{\"expand\":\"renderedFields,names,schema,transitions,operations,editmeta,changelog\",\"id\":\"1234\",\"self\":\"https://test.atlassian.net/rest/api/2/issue/1234\",\"key\":\"ABC-01\",\"fields\":{\"summary\":\"This is a test\"}}`\n\t\tfmt.Fprintln(w, val)\n\t}))\n\tdefer ts.Close()\n\n\tc := NewJiraClient(ts.URL, \"foo\", \"bar\", 100)\n\ti, err := c.Issue(\"abc\", nil)\n\tif err != nil {\n\t\tt.Error(\"Error loading issue:\", err)\n\t}\n\n\tif i == nil {\n\t\tt.Error(\"issue is nil\")\n\t}\n\n\tif i.ID != \"1234\" {\n\t\tt.Error(\"Error expected issue ID to be 1234 got:\", i.ID)\n\t}\n\n\tif i.Key != \"ABC-01\" {\n\t\tt.Error(\"Error expected issue Key to be ABC-01 got:\", i.Key)\n\t}\n}", "title": "" }, { "docid": "0262bcac2d48b72833ba1da9168e7523", "score": "0.46533194", "text": "func (c *Client) GetIssues(opts *GetIssuesOptions) ([]*Issue, error) {\n\treturn c.GetIssuesContext(context.Background(), opts)\n}", "title": "" }, { "docid": "b1bbb8ad7d78666810845d55f56bfabc", "score": "0.46500534", "text": "func (a *RepoAPI) reopenIssue(params interface{}) (resp *rpc.Response) {\n\tm := objx.New(cast.ToStringMap(params))\n\tname := m.Get(\"name\").Str()\n\treference := m.Get(\"reference\").Str()\n\treturn rpc.Success(util.Map{\n\t\t\"data\": a.mods.Repo.ReopenIssue(name, reference),\n\t})\n}", "title": "" }, { "docid": "3e11f2aea3afae16a79d4b23a9dc4fcd", "score": "0.4639145", "text": "func (c *ClientWithResponses) IssuesWithResponse(ctx context.Context, projectId string, params *IssuesParams) (*issuesResponse, error) {\n\trsp, err := c.Issues(ctx, projectId, params)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\treturn ParseissuesResponse(rsp)\n}", "title": "" }, { "docid": "da14e18297a9c1336349b4850223ee34", "score": "0.46201807", "text": "func IssueListDiscussions(project string, issueNum int) ([]*gitlab.Discussion, error) {\n\tp, err := FindProject(project)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\tdiscussions := []*gitlab.Discussion{}\n\topt := &gitlab.ListIssueDiscussionsOptions{\n\t\t// 100 is the maximum allowed by the API\n\t\tPerPage: 100,\n\t\tPage: 1,\n\t}\n\n\tfor {\n\t\t// get a page of discussions from the API ...\n\t\td, resp, err := lab.Discussions.ListIssueDiscussions(p.ID, issueNum, opt)\n\t\tif err != nil {\n\t\t\treturn nil, err\n\t\t}\n\n\t\t// ... and add them to our collection of discussions\n\t\tdiscussions = append(discussions, d...)\n\n\t\t// if we've seen all the pages, then we can break here\n\t\tif opt.Page >= resp.TotalPages {\n\t\t\tbreak\n\t\t}\n\n\t\t// otherwise, update the page number to get the next page.\n\t\topt.Page = resp.NextPage\n\t}\n\n\treturn discussions, nil\n}", "title": "" }, { "docid": "eb0e2a7e51c516dec755e33f7b991531", "score": "0.46157792", "text": "func (client jiraServerClient) SearchUsersAssignableToIssue(issueKey, query string, maxResults int) ([]jira.User, error) {\n\treturn SearchUsersAssignableToIssue(client, issueKey, \"username\", query, maxResults)\n}", "title": "" }, { "docid": "3086f4b8d252c106763a46407b1798ed", "score": "0.45879805", "text": "func (g Gitlab) ResolveIssue(ctx context.Context, projectID, issueIID IntID, resolution Resolution) error {\n\t// Try to add a comment.\n\terr1 := trace.Wrap(g.PostResolutionComment(ctx, projectID, issueIID, resolution))\n\n\t// Try to close the issue.\n\terr2 := trace.Wrap(g.CloseIssue(ctx, projectID, issueIID, resolution))\n\n\treturn trace.NewAggregate(err1, err2)\n}", "title": "" }, { "docid": "02e0680e47ee38e164ff3a04e4c843bb", "score": "0.4549526", "text": "func (a *RepoAPI) closeIssue(params interface{}) (resp *rpc.Response) {\n\tm := objx.New(cast.ToStringMap(params))\n\tname := m.Get(\"name\").Str()\n\treference := m.Get(\"reference\").Str()\n\treturn rpc.Success(util.Map{\n\t\t\"data\": a.mods.Repo.CloseIssue(name, reference),\n\t})\n}", "title": "" }, { "docid": "75a5450250a1f4df79e84d3d7de1e0ba", "score": "0.45485607", "text": "func IssueUpdate(project string, issueNum int, opts *gitlab.UpdateIssueOptions) (string, error) {\n\tp, err := FindProject(project)\n\tif err != nil {\n\t\treturn \"\", err\n\t}\n\n\tissue, _, err := lab.Issues.UpdateIssue(p.ID, issueNum, opts)\n\tif err != nil {\n\t\treturn \"\", err\n\t}\n\treturn issue.WebURL, nil\n}", "title": "" }, { "docid": "ab98f9d28211662466c7db1901dfe647", "score": "0.45435578", "text": "func (projectL) LoadIssues(ctx context.Context, e boil.ContextExecutor, singular bool, maybeProject interface{}, mods queries.Applicator) error {\n\tvar slice []*Project\n\tvar object *Project\n\n\tif singular {\n\t\tobject = maybeProject.(*Project)\n\t} else {\n\t\tslice = *maybeProject.(*[]*Project)\n\t}\n\n\targs := make([]interface{}, 0, 1)\n\tif singular {\n\t\tif object.R == nil {\n\t\t\tobject.R = &projectR{}\n\t\t}\n\t\targs = append(args, object.ID)\n\t} else {\n\tOuter:\n\t\tfor _, obj := range slice {\n\t\t\tif obj.R == nil {\n\t\t\t\tobj.R = &projectR{}\n\t\t\t}\n\n\t\t\tfor _, a := range args {\n\t\t\t\tif queries.Equal(a, obj.ID) {\n\t\t\t\t\tcontinue Outer\n\t\t\t\t}\n\t\t\t}\n\n\t\t\targs = append(args, obj.ID)\n\t\t}\n\t}\n\n\tif len(args) == 0 {\n\t\treturn nil\n\t}\n\n\tquery := NewQuery(qm.From(`issues`), qm.WhereIn(`project_id in ?`, args...))\n\tif mods != nil {\n\t\tmods.Apply(query)\n\t}\n\n\tresults, err := query.QueryContext(ctx, e)\n\tif err != nil {\n\t\treturn errors.Wrap(err, \"failed to eager load issues\")\n\t}\n\n\tvar resultSlice []*Issue\n\tif err = queries.Bind(results, &resultSlice); err != nil {\n\t\treturn errors.Wrap(err, \"failed to bind eager loaded slice issues\")\n\t}\n\n\tif err = results.Close(); err != nil {\n\t\treturn errors.Wrap(err, \"failed to close results in eager load on issues\")\n\t}\n\tif err = results.Err(); err != nil {\n\t\treturn errors.Wrap(err, \"error occurred during iteration of eager loaded relations for issues\")\n\t}\n\n\tif len(issueAfterSelectHooks) != 0 {\n\t\tfor _, obj := range resultSlice {\n\t\t\tif err := obj.doAfterSelectHooks(ctx, 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.Issues = resultSlice\n\t\tfor _, foreign := range resultSlice {\n\t\t\tif foreign.R == nil {\n\t\t\t\tforeign.R = &issueR{}\n\t\t\t}\n\t\t\tforeign.R.Project = object\n\t\t}\n\t\treturn nil\n\t}\n\n\tfor _, foreign := range resultSlice {\n\t\tfor _, local := range slice {\n\t\t\tif queries.Equal(local.ID, foreign.ProjectID) {\n\t\t\t\tlocal.R.Issues = append(local.R.Issues, foreign)\n\t\t\t\tif foreign.R == nil {\n\t\t\t\t\tforeign.R = &issueR{}\n\t\t\t\t}\n\t\t\t\tforeign.R.Project = local\n\t\t\t\tbreak\n\t\t\t}\n\t\t}\n\t}\n\n\treturn nil\n}", "title": "" }, { "docid": "419cee29cfe8c952d89e70f0ad08e3e7", "score": "0.45407817", "text": "func (m *MockClient) ListOpenIssues(org, repo string) ([]github.Issue, error) {\n\tm.ctrl.T.Helper()\n\tret := m.ctrl.Call(m, \"ListOpenIssues\", org, repo)\n\tret0, _ := ret[0].([]github.Issue)\n\tret1, _ := ret[1].(error)\n\treturn ret0, ret1\n}", "title": "" }, { "docid": "ead7573bf3c50a60ee517b569955aa76", "score": "0.45286995", "text": "func findGitLabREADME(s string) (*source, error) {\n\tu, err := url.ParseRequestURI(s)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\tfor _, r := range readmeNames {\n\t\tv := u\n\t\tv.Path += \"/raw/master/\" + r\n\n\t\t// nolint:bodyclose\n\t\t// it is closed on the caller\n\t\tresp, err := http.Get(v.String())\n\t\tif err != nil {\n\t\t\treturn nil, err\n\t\t}\n\n\t\tif resp.StatusCode == http.StatusOK {\n\t\t\treturn &source{resp.Body, v.String()}, nil\n\t\t}\n\t}\n\n\treturn nil, errors.New(\"can't find README in GitLab repository\")\n}", "title": "" }, { "docid": "9df5f0086517707891419494e77b789b", "score": "0.45096207", "text": "func (js *jiraSuggest) Suggest(ctx context.Context, t *task.Task) ([]thirdparty.JiraTicket, error) {\n\tjql := t.GetJQL(js.bbProj.TicketSearchProjects)\n\n\tresults, err := js.jiraHandler.JQLSearch(jql, 0, -1)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\treturn results.Issues, nil\n}", "title": "" }, { "docid": "9df5f0086517707891419494e77b789b", "score": "0.45096207", "text": "func (js *jiraSuggest) Suggest(ctx context.Context, t *task.Task) ([]thirdparty.JiraTicket, error) {\n\tjql := t.GetJQL(js.bbProj.TicketSearchProjects)\n\n\tresults, err := js.jiraHandler.JQLSearch(jql, 0, -1)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\treturn results.Issues, nil\n}", "title": "" }, { "docid": "bd59a91e9c6ee6d43e2a695578ab7851", "score": "0.44991016", "text": "func (b *ProjectBoard) LoadIssues() (IssueList, error) {\n\tvar boardID int64\n\tif !b.Default {\n\t\tboardID = b.ID\n\n\t} else {\n\t\t// Issues without ProjectBoardID\n\t\tboardID = -1\n\t}\n\tissues, err := Issues(&IssuesOptions{\n\t\tProjectBoardID: boardID,\n\t\tProjectID: b.ProjectID,\n\t})\n\tb.Issues = issues\n\treturn issues, err\n}", "title": "" }, { "docid": "d480ece9bba22b7a8314a8b95667c9da", "score": "0.4480364", "text": "func (c Client) Search(repo, q, filter, dist string, perPage int) ([]Package, error) {\n\tendpoint := fmt.Sprintf(\"%s/repos/%s/search.json?q=%s&filter=%s&dist=%s&per_page=%d\", ServiceURL, repo, q, filter, dist, perPage)\n\n\treq, err := http.NewRequest(\"GET\", endpoint, nil)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\treq.SetBasicAuth(c.token, \"\")\n\treq.Header.Add(\"User-Agent\", UserAgent)\n\n\tclient := &http.Client{}\n\tresp, err := client.Do(req)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\tdefer resp.Body.Close()\n\n\tvar packages []Package\n\terr = decodeResponse(resp, &packages)\n\treturn packages, err\n}", "title": "" }, { "docid": "3300ed76e8c788729496ab5e971bb0f8", "score": "0.447229", "text": "func IssueGet(project string, issueNum int) (*gitlab.Issue, error) {\n\tp, err := FindProject(project)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\tissue, _, err := lab.Issues.GetIssue(p.ID, issueNum)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\treturn issue, nil\n}", "title": "" }, { "docid": "16c34581af0e85047683b6b3292bb7da", "score": "0.44639814", "text": "func marshalIssues(issues []*github.Issue) []byte {\n\tdata, err := json.Marshal(issues)\n\tif err != nil {\n\t\tlog.Fatal(err)\n\t}\n\treturn data\n}", "title": "" }, { "docid": "d83c9544a5d0606293a4a74203b26526", "score": "0.44625628", "text": "func (s *DiscussionsService) ListIssueDiscussions(pid interface{}, issue int, opt *ListIssueDiscussionsOptions, options ...RequestOptionFunc) ([]*Discussion, *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/issues/%d/discussions\", PathEscape(project), issue)\n\n\treq, err := s.client.NewRequest(http.MethodGet, u, opt, options)\n\tif err != nil {\n\t\treturn nil, nil, err\n\t}\n\n\tvar ds []*Discussion\n\tresp, err := s.client.Do(req, &ds)\n\tif err != nil {\n\t\treturn nil, resp, err\n\t}\n\n\treturn ds, resp, nil\n}", "title": "" }, { "docid": "f9257290fb60736040d3938c37a17e63", "score": "0.4457369", "text": "func SearchGithubCommitMessages(opt *SearchOpt, writer table.Writer) error {\n\tvar (\n\t\tctx = context.Background()\n\t\tclient = github.NewClient(nil)\n\t\tpage = 0\n\t\tperPage = 100\n\t\tremain = opt.MaxCommits\n\t\treadCommits = 0\n\t\tidx = 1\n\t\tcontinueReq = true\n\t)\n\tif opt.MaxCommits > 0 {\n\t\tperPage = opt.MaxCommits\n\t}\n\t// write header\n\twriter.Style().Format.Header = text.FormatDefault\n\twriter.Style().Format.Footer = text.FormatDefault\n\twriter.SetTitle(\"Matched Commits from /%s/%s. Keywords:%s\", opt.User, opt.Repo, strings.Join(opt.Keywords, \",\"))\n\twriter.AppendHeader(table.Row{\"#\", \"Message\", \"URL\"})\n\n\tfor {\n\t\tif !continueReq {\n\t\t\tbreak\n\t\t}\n\t\tcommits, response, err := client.Repositories.ListCommits(ctx, opt.User, opt.Repo,\n\t\t\t&github.CommitsListOptions{\n\t\t\t\tListOptions: github.ListOptions{\n\t\t\t\t\tPage: page,\n\t\t\t\t\tPerPage: perPage,\n\t\t\t\t},\n\t\t\t},\n\t\t)\n\t\tif err != nil {\n\t\t\treturn err\n\t\t}\n\t\tif response.StatusCode != http.StatusOK {\n\t\t\treturn fmt.Errorf(\"failed to fetch commits. status code:%d\", response.StatusCode)\n\t\t}\n\t\tfor _, commit := range commits {\n\t\t\tif opt.includeCommits(strings.ToLower(commit.GetCommit().GetMessage())) {\n\t\t\t\twriter.AppendRow(table.Row{\n\t\t\t\t\tidx, commit.GetCommit().GetMessage(), fmt.Sprintf(\"https://github.com/%s/%s/commit/%s\", opt.User, opt.Repo, commit.GetSHA()),\n\t\t\t\t})\n\t\t\t\twriter.AppendSeparator()\n\t\t\t\tidx++\n\t\t\t\tremain--\n\t\t\t}\n\t\t\tif opt.MaxCommits > 0 && remain < 0 {\n\t\t\t\tcontinueReq = false\n\t\t\t\tbreak\n\t\t\t}\n\t\t}\n\t\treadCommits += len(commits)\n\t\tif response.NextPage == 0 {\n\t\t\tcontinueReq = false\n\t\t}\n\t\tpage = response.NextPage\n\t}\n\twriter.AppendFooter(table.Row{\"\", \"\", fmt.Sprintf(\"Total Read Commits: #%d\", readCommits)})\n\twriter.Render()\n\treturn nil\n}", "title": "" }, { "docid": "300134bf3071a862ada51b47c7a9d209", "score": "0.44488582", "text": "func FindIssueReactions(issueID int64, listOptions db.ListOptions) (ReactionList, int64, error) {\n\treturn FindReactions(db.DefaultContext, FindReactionsOptions{\n\t\tListOptions: listOptions,\n\t\tIssueID: issueID,\n\t\tCommentID: -1,\n\t})\n}", "title": "" }, { "docid": "3188717dcbd40bd395bbd22da68306fe", "score": "0.44458255", "text": "func (j *Jira) IssuesAssignedTo(user string, maxResults int, startAt int) (i IssueList, err error) {\n\turi := j.ApiPath + \"/search?jql=assignee=\\\"\" +\n\t\turl.QueryEscape(user) + \"\\\"&startAt=\" + strconv.Itoa(startAt) +\n\t\t\"&maxResults=\" + strconv.Itoa(maxResults)\n\n\tcontents, err := j.getRequest(uri)\n\tif err != nil {\n\t\treturn\n\t}\n\n\tvar issues IssueList\n\terr = json.Unmarshal(contents, &issues)\n\tif err != nil {\n\t\treturn\n\t}\n\n\tfor _, issue := range issues.Issues {\n\t\tt, _ := time.Parse(dateLayout, issue.Fields.Created)\n\t\tissue.CreatedAt = t\n\t}\n\n\tpagination := Pagination{\n\t\tTotal: issues.Total,\n\t\tStartAt: issues.StartAt,\n\t\tMaxResults: issues.MaxResults,\n\t}\n\tpagination.Compute()\n\tissues.Pagination = &pagination\n\n\treturn issues, nil\n}", "title": "" }, { "docid": "57a30ac4b46eb32a9b05deb9e7869f1d", "score": "0.4435011", "text": "func (s *scanner) scan() ([]*github.IssueRequest, error) {\n\t// Read latest author info.\n\terr := s.getAnchor()\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\tnewAnchor, issues, err := s.scanFile()\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\tif newAnchor > s.anchor {\n\t\terr := s.setAnchor(newAnchor)\n\t\tif err != nil {\n\t\t\treturn nil, err\n\t\t}\n\t}\n\n\treturn issues, nil\n}", "title": "" }, { "docid": "6f63eb0b668464849bce61a5770e81c9", "score": "0.44279432", "text": "func GetIssue(params martini.Params) string {\n\tnumber, err := strconv.Atoi(params[\"issue\"])\n\tif err != nil {\n\t\treturn GenerateErrorMessage(err)\n\t}\n\n\tmsg := messages.GetIssue{\n\t\tIssue: &messages.Issue{\n\t\t\tID: params[\"issue\"],\n\t\t\tNumber: number,\n\t\t\tOrg: params[\"owner\"],\n\t\t\tRepo: params[\"repo\"],\n\t\t},\n\t\tConfig: config(),\n\t}\n\tresponse := Request(\"issues.details\", msg)\n\n\treturn response\n}", "title": "" }, { "docid": "d7ca4faecdf2ec359f586322db20644c", "score": "0.44176444", "text": "func (c *client) ListIssueEvents(org, repo string, num int) ([]ListedIssueEvent, error) {\n\tdurationLogger := c.log(\"ListIssueEvents\", org, repo, num)\n\tdefer durationLogger()\n\n\tif c.fake {\n\t\treturn nil, nil\n\t}\n\tpath := fmt.Sprintf(\"/repos/%s/%s/issues/%d/events\", org, repo, num)\n\tvar events []ListedIssueEvent\n\terr := c.readPaginatedResults(\n\t\tpath,\n\t\tacceptNone,\n\t\torg,\n\t\tfunc() interface{} {\n\t\t\treturn &[]ListedIssueEvent{}\n\t\t},\n\t\tfunc(obj interface{}) {\n\t\t\tevents = append(events, *(obj.(*[]ListedIssueEvent))...)\n\t\t},\n\t)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\treturn events, nil\n}", "title": "" }, { "docid": "3690347247f2034fb9f22d8a8a6d765e", "score": "0.4414945", "text": "func nag(ctx context.Context, client *github.Client, comment string, issues []*github.Issue) {\n\tre := regexp.MustCompile(`https://api.github.com/repos/([\\w]+)/([\\w]+)`)\n\tfor _, issue := range issues {\n\t\t// TODO: Process owner, repo, issue number\n\t\tmatch := re.FindStringSubmatch(*issue.RepositoryURL)\n\t\towner, repo := match[1], match[2]\n\t\tissueNumber := *issue.Number\n\t\tfmt.Printf(\"Owner: %v, Repo: %v, Issue #: %v\", owner, repo, issueNumber)\n\n\t\t_, _, err := client.Issues.CreateComment(ctx, owner, repo, issueNumber, &github.IssueComment{\n\t\t\tBody: &comment,\n\t\t})\n\t\tfmt.Println(\"=================================\\n\")\n\n\t\tif err != nil {\n\t\t\tfmt.Errorf(\"Error: %v\", err)\n\t\t}\n\t}\n\treturn\n}", "title": "" }, { "docid": "9f1a269ecfa7b38640d1ea99a6aef12d", "score": "0.44105315", "text": "func APIProjectFetchIssueHandler(er *Errorly) http.HandlerFunc {\n\treturn func(rw http.ResponseWriter, r *http.Request) {\n\t\tsession, _ := er.Store.Get(r, sessionName)\n\t\tdefer er.SaveSession(session, r, rw)\n\n\t\tvars := mux.Vars(r)\n\n\t\t_issueID, ok := vars[\"issue_id\"]\n\t\tif !ok {\n\t\t\tpassResponse(rw, \"Missing Issue ID\", false, http.StatusBadRequest)\n\n\t\t\treturn\n\t\t}\n\n\t\t// Authenticate the user\n\t\tauth, user := er.AuthenticateSession(session)\n\n\t\tproject, viewable, _, ok := verifyProjectVisibility(er, rw, vars, user, auth, true)\n\t\tif !ok {\n\t\t\t// If ok is False, an error has already been provided to the ResponseWriter so we should just return\n\t\t\treturn\n\t\t}\n\n\t\tif !viewable {\n\t\t\t// No permission to view project. We will treat like the project\n\t\t\t// does not exist.\n\t\t\tpassResponse(rw, \"Could not find this project\", false, http.StatusBadRequest)\n\n\t\t\treturn\n\t\t}\n\n\t\t// If an ID is specified we will instead return just the issue\n\t\tissueID, err := strconv.ParseInt(_issueID, 10, 64)\n\t\tif err != nil {\n\t\t\tpassResponse(rw, \"ID argument is not valid\", false, http.StatusBadRequest)\n\n\t\t\treturn\n\t\t}\n\n\t\tissue := &structs.IssueEntry{}\n\n\t\terr = er.Postgres.Model(issue).\n\t\t\tWhere(\"issue_entry.project_id = ?\", project.ID).\n\t\t\tWhere(\"issue_entry.id = ?\", issueID).\n\t\t\tSelect()\n\t\tif err != nil {\n\t\t\tif errors.Is(err, pg.ErrNoRows) {\n\t\t\t\t// Invalid issue ID\n\t\t\t\tpassResponse(rw, \"Could not find this issue\", false, http.StatusBadRequest)\n\n\t\t\t\treturn\n\t\t\t}\n\n\t\t\tpassResponse(rw, err.Error(), false, http.StatusInternalServerError)\n\n\t\t\treturn\n\t\t}\n\n\t\tpassResponse(rw, structs.APIProjectIssues{\n\t\t\tIssue: issue,\n\t\t}, true, http.StatusOK)\n\t}\n}", "title": "" }, { "docid": "ce34b0bd707487e2eb4911aca3ee8a42", "score": "0.4408382", "text": "func (b *GithubBridge) AddIssueLocal(ctx context.Context, owner, repo, title, body string, milestone int, printIm, print bool, config *pbgh.Config) ([]byte, int64, error) {\n\tb.attempts++\n\tpid := int64(0)\n\n\tpayload := Payload{Title: title, Body: body, Assignee: owner}\n\tbytes, err := json.Marshal(payload)\n\tif err != nil {\n\t\treturn nil, pid, err\n\t}\n\n\tif milestone > 0 {\n\t\tpayload := PayloadWithMilestone{Title: title, Body: body, Assignee: owner, Milestone: milestone}\n\t\tbytes, err = json.Marshal(payload)\n\t\tif err != nil {\n\t\t\treturn nil, pid, err\n\t\t}\n\n\t}\n\n\turlv := \"https://api.github.com/repos/\" + owner + \"/\" + repo + \"/issues\"\n\tresp, err := b.postURL(urlv, string(bytes))\n\tif err != nil {\n\t\treturn nil, pid, err\n\t}\n\n\tdefer resp.Body.Close()\n\trb, _ := ioutil.ReadAll(resp.Body)\n\n\tif resp.StatusCode != 200 && resp.StatusCode != 201 && resp.StatusCode != 0 {\n\t\tif resp.StatusCode == 404 {\n\t\t\treturn rb, pid, status.Errorf(codes.NotFound, \"POST error: %v -> %v\", resp.StatusCode, string(rb))\n\t\t}\n\t\treturn rb, pid, fmt.Errorf(\"POST error: %v -> %v\", resp.StatusCode, string(rb))\n\t}\n\n\tb.CtxLog(ctx, fmt.Sprintf(\"Print request: %v\", print))\n\tif print {\n\t\t// Best effort print\n\t\tconn, err := b.FDialServer(ctx, \"printer\")\n\t\tif err == nil {\n\t\t\tdefer conn.Close()\n\t\t\tclient := prpb.NewPrintServiceClient(conn)\n\t\t\tif resp.StatusCode != 201 {\n\t\t\t\tresp, err := client.Print(ctx, &prpb.PrintRequest{Lines: []string{fmt.Sprintf(\"%v: %v\", resp.StatusCode, title)}, Origin: \"github\", Override: printIm})\n\t\t\t\tif err == nil {\n\t\t\t\t\tpid = resp.GetUid()\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\tresp, err := client.Print(ctx, &prpb.PrintRequest{Lines: []string{fmt.Sprintf(\"%v\", title), \"\\n\", fmt.Sprintf(\"%v\", body)}, Origin: \"github\", Override: printIm})\n\t\t\t\tif err == nil {\n\t\t\t\t\tpid = resp.GetUid()\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\n\treturn rb, pid, nil\n}", "title": "" } ]
0de56cf9e1c0b8044c7ea177bb2b9af9
ValueType returns the tftypes.Type for a Schema. If Schema is missing, an empty Object is returned.
[ { "docid": "f8c0c34f7166a29ad5d9a96d97a0f428", "score": "0.8195357", "text": "func (s *Schema) ValueType() tftypes.Type {\n\tif s == nil {\n\t\treturn tftypes.Object{\n\t\t\tAttributeTypes: map[string]tftypes.Type{},\n\t\t}\n\t}\n\n\treturn s.Block.ValueType()\n}", "title": "" } ]
[ { "docid": "1579933da02db41ad796e94310d98f08", "score": "0.79389876", "text": "func (s *SchemaObject) ValueType() tftypes.Type {\n\tif s == nil {\n\t\treturn nil\n\t}\n\n\tattributeTypes := map[string]tftypes.Type{}\n\n\tfor _, attribute := range s.Attributes {\n\t\tif attribute == nil {\n\t\t\tcontinue\n\t\t}\n\n\t\tattributeType := attribute.ValueType()\n\n\t\tif attributeType == nil {\n\t\t\tcontinue\n\t\t}\n\n\t\tattributeTypes[attribute.Name] = attributeType\n\t}\n\n\tobjectType := tftypes.Object{\n\t\tAttributeTypes: attributeTypes,\n\t}\n\n\tswitch s.Nesting {\n\tcase SchemaObjectNestingModeList:\n\t\treturn tftypes.List{\n\t\t\tElementType: objectType,\n\t\t}\n\tcase SchemaObjectNestingModeMap:\n\t\treturn tftypes.Map{\n\t\t\tElementType: objectType,\n\t\t}\n\tcase SchemaObjectNestingModeSet:\n\t\treturn tftypes.Set{\n\t\t\tElementType: objectType,\n\t\t}\n\tcase SchemaObjectNestingModeSingle:\n\t\treturn objectType\n\tdefault:\n\t\treturn nil\n\t}\n}", "title": "" }, { "docid": "93077255b89f5f95e4219663399abf60", "score": "0.7231229", "text": "func (s *SchemaAttribute) ValueType() tftypes.Type {\n\tif s == nil {\n\t\treturn nil\n\t}\n\n\t// It is not valid to set both NestedType and Type.\n\tif s.NestedType != nil {\n\t\treturn s.NestedType.ValueType()\n\t}\n\n\treturn s.Type\n}", "title": "" }, { "docid": "786765aa25085150e01b5adc24b8f835", "score": "0.721029", "text": "func (s *SchemaBlock) ValueType() tftypes.Type {\n\tif s == nil {\n\t\treturn tftypes.Object{\n\t\t\tAttributeTypes: map[string]tftypes.Type{},\n\t\t}\n\t}\n\n\tattributeTypes := map[string]tftypes.Type{}\n\n\tfor _, attribute := range s.Attributes {\n\t\tif attribute == nil {\n\t\t\tcontinue\n\t\t}\n\n\t\tattributeType := attribute.ValueType()\n\n\t\tif attributeType == nil {\n\t\t\tcontinue\n\t\t}\n\n\t\tattributeTypes[attribute.Name] = attributeType\n\t}\n\n\tfor _, block := range s.BlockTypes {\n\t\tif block == nil {\n\t\t\tcontinue\n\t\t}\n\n\t\tblockType := block.ValueType()\n\n\t\tif blockType == nil {\n\t\t\tcontinue\n\t\t}\n\n\t\tattributeTypes[block.TypeName] = blockType\n\t}\n\n\treturn tftypes.Object{\n\t\tAttributeTypes: attributeTypes,\n\t}\n}", "title": "" }, { "docid": "74536e1b322928604f6fd8b40212a87f", "score": "0.6795528", "text": "func (v Value) Type() ValueType { return v.typ }", "title": "" }, { "docid": "9ac5c5f08673fed3eb82d4fd6a99e061", "score": "0.6686202", "text": "func (v *Value) Type() kiwi.ValueType {\n\treturn Type\n}", "title": "" }, { "docid": "d6b3b70902d7ba3da4ebd24cf09cc113", "score": "0.66737074", "text": "func (s *TypeSpec) ValueType() types.Type {\n\treturn s.getType(s.Type)\n\n}", "title": "" }, { "docid": "a102c54cd9f4165fc38864d4b5b79779", "score": "0.66100055", "text": "func (v *Value) Type() Type {\n\treturn v.typ\n}", "title": "" }, { "docid": "c1c49978314e21a5252e3e2932b4d1d6", "score": "0.6584658", "text": "func (v Value) Type() querypb.Type {\n\treturn v.typ\n}", "title": "" }, { "docid": "937c46121ff9ab7e0997e7ff7b3d7cc8", "score": "0.6561374", "text": "func (s *ValueSpec) ValueType() types.Type {\n\treturn s.getType(s.Type)\n\n}", "title": "" }, { "docid": "f480761d47bfbe64481813c4f0d61f9c", "score": "0.6554029", "text": "func (s *SchemaNestedBlock) ValueType() tftypes.Type {\n\tif s == nil {\n\t\treturn nil\n\t}\n\n\tblockType := s.Block.ValueType()\n\n\tswitch s.Nesting {\n\tcase SchemaNestedBlockNestingModeGroup:\n\t\treturn blockType\n\tcase SchemaNestedBlockNestingModeList:\n\t\treturn tftypes.List{\n\t\t\tElementType: blockType,\n\t\t}\n\tcase SchemaNestedBlockNestingModeMap:\n\t\treturn tftypes.Map{\n\t\t\tElementType: blockType,\n\t\t}\n\tcase SchemaNestedBlockNestingModeSet:\n\t\treturn tftypes.Set{\n\t\t\tElementType: blockType,\n\t\t}\n\tcase SchemaNestedBlockNestingModeSingle:\n\t\treturn blockType\n\tdefault:\n\t\treturn nil\n\t}\n}", "title": "" }, { "docid": "141959218919c93093c4f2722704b508", "score": "0.65503913", "text": "func (v Value) Type() Type {\n\treturn v.typ\n}", "title": "" }, { "docid": "911ddc3b25282d4b979d39b70cd404e9", "score": "0.6550269", "text": "func (s *baseNode) ValueType() types.Type {\n\tif expr, ok := s.node.(ast.Expr); ok {\n\t\treturn s.Info().TypeOf(expr)\n\t}\n\treturn nil\n}", "title": "" }, { "docid": "1839b9fb833ec296e0efa0c07cabff51", "score": "0.6497251", "text": "func (s *Field) ValueType() types.Type {\n\treturn s.getType(s.Type)\n}", "title": "" }, { "docid": "95fcbaf2b36b85895d5687e15d4ea7a7", "score": "0.64598936", "text": "func (v Value) Type() Type {\n\treturn TypeUndefined\n}", "title": "" }, { "docid": "573fec8f802330deee9d592c21423149", "score": "0.6438064", "text": "func (v Value) Type() Type {\n\tif v.Err != nil {\n\t\treturn TypeInvalid\n\t}\n\tif v.Value == nil {\n\t\treturn TypeNull\n\t}\n\tswitch v.Value.(type) {\n\tcase float64:\n\t\treturn TypeNum\n\tcase bool:\n\t\treturn TypeBool\n\tcase string:\n\t\treturn TypeStr\n\tcase map[string]interface{}:\n\t\treturn TypeObject\n\tcase []interface{}:\n\t\treturn TypeArray\n\tdefault:\n\t\treturn TypeInvalid\n\t}\n}", "title": "" }, { "docid": "7a221f9fae95e186345de09efbb64877", "score": "0.6412568", "text": "func (t ObjectType) ValueType(_ context.Context) attr.Value {\n\treturn Object{\n\t\tAttrTypes: t.AttrTypes,\n\t}\n}", "title": "" }, { "docid": "d7f574980844ecbc0d55376fcc3278c7", "score": "0.6351777", "text": "func (o ObjectType) ValueType(_ context.Context) attr.Value {\n\treturn ObjectValue{\n\t\tattributeTypes: o.AttrTypes,\n\t}\n}", "title": "" }, { "docid": "a62b7f8730f78b629c356c71103af0fe", "score": "0.6337638", "text": "func (v *govalue) Type() types.Type {\n\treturn v.typ\n}", "title": "" }, { "docid": "820db0ba5b0c67e741af0f0b2993364d", "score": "0.63288987", "text": "func (s *TypeAssertExpr) ValueType() types.Type {\n\treturn s.getType(s.Type)\n\n}", "title": "" }, { "docid": "9a244d27ff9072a7f79caa6076a7518b", "score": "0.62890923", "text": "func (s *Ident) ValueType() types.Type {\n\tif t := s.Info().TypeOf(s); t != nil {\n\t\treturn t\n\t}\n\n\treturn s.getType(s.node)\n}", "title": "" }, { "docid": "0d7b881e3aa80c4c6bad1b884387c8db", "score": "0.62149787", "text": "func (c *Schema) Type() reflect.Type {\n\treturn c.compType\n}", "title": "" }, { "docid": "720c188c9736eae962ffaae92aab2415", "score": "0.61950177", "text": "func (t typeID) ValueType() rbxfile.Type {\n\tswitch t {\n\tcase typeString:\n\t\treturn rbxfile.TypeString\n\tcase typeBool:\n\t\treturn rbxfile.TypeBool\n\tcase typeInt:\n\t\treturn rbxfile.TypeInt\n\tcase typeFloat:\n\t\treturn rbxfile.TypeFloat\n\tcase typeDouble:\n\t\treturn rbxfile.TypeDouble\n\tcase typeUDim:\n\t\treturn rbxfile.TypeUDim\n\tcase typeUDim2:\n\t\treturn rbxfile.TypeUDim2\n\tcase typeRay:\n\t\treturn rbxfile.TypeRay\n\tcase typeFaces:\n\t\treturn rbxfile.TypeFaces\n\tcase typeAxes:\n\t\treturn rbxfile.TypeAxes\n\tcase typeBrickColor:\n\t\treturn rbxfile.TypeBrickColor\n\tcase typeColor3:\n\t\treturn rbxfile.TypeColor3\n\tcase typeVector2:\n\t\treturn rbxfile.TypeVector2\n\tcase typeVector3:\n\t\treturn rbxfile.TypeVector3\n\tcase typeVector2int16:\n\t\treturn rbxfile.TypeVector2int16\n\tcase typeCFrame:\n\t\treturn rbxfile.TypeCFrame\n\tcase typeCFrameQuat:\n\t\treturn rbxfile.TypeCFrame\n\tcase typeToken:\n\t\treturn rbxfile.TypeToken\n\tcase typeReference:\n\t\treturn rbxfile.TypeReference\n\tcase typeVector3int16:\n\t\treturn rbxfile.TypeVector3int16\n\tcase typeNumberSequence:\n\t\treturn rbxfile.TypeNumberSequence\n\tcase typeColorSequence:\n\t\treturn rbxfile.TypeColorSequence\n\tcase typeNumberRange:\n\t\treturn rbxfile.TypeNumberRange\n\tcase typeRect:\n\t\treturn rbxfile.TypeRect\n\tcase typePhysicalProperties:\n\t\treturn rbxfile.TypePhysicalProperties\n\tcase typeColor3uint8:\n\t\treturn rbxfile.TypeColor3uint8\n\tcase typeInt64:\n\t\treturn rbxfile.TypeInt64\n\tcase typeSharedString:\n\t\treturn rbxfile.TypeSharedString\n\tcase typeOptional:\n\t\treturn rbxfile.TypeOptional\n\tcase typeUniqueId:\n\t\treturn rbxfile.TypeUniqueId\n\tcase typeFont:\n\t\treturn rbxfile.TypeFont\n\tdefault:\n\t\treturn rbxfile.TypeInvalid\n\t}\n}", "title": "" }, { "docid": "f1c4e72877883560328eb4a6b7d62adc", "score": "0.61540073", "text": "func (s *Schema) Get(typ interface{}) TypeMeta {\n\tswitch typ := typ.(type) {\n\tcase TypeMeta:\n\t\tif typ == nil {\n\t\t\treturn s.get(nil, false)\n\t\t}\n\t\treturn typ\n\tcase reflect.Type:\n\t\treturn s.get(typ, false)\n\tcase reflect.Value:\n\t\treturn s.get(typ.Type(), false)\n\tcase reflect.Kind:\n\t\tif kindType, ok := kindTypes[typ]; ok {\n\t\t\treturn s.get(kindType, false)\n\t\t}\n\t\tpanic(\"No default type has been defined for kind \" + typ.String())\n\tcase *Enum:\n\t\tif s.enumTypes[typ] != nil {\n\t\t\treturn s.enumTypes[typ]\n\t\t}\n\t\tr, ok := s.get(typ.typ, false).(*Primitive)\n\t\tif !ok {\n\t\t\tr = &Primitive{typ: typ.typ, enum: typ}\n\t\t} else {\n\t\t\tr = r.Copy()\n\t\t\tr.enum = typ\n\t\t}\n\t\ts.enumTypes[typ] = r\n\t\treturn r\n\tdefault:\n\t\treturn s.get(reflect.TypeOf(typ), false)\n\t}\n}", "title": "" }, { "docid": "a67e468e2746830cd064dd1a64107449", "score": "0.6074814", "text": "func (s *Scheme) GetSchema(in string) *api.Struct {\n\tif val, ok := s.Types[in]; ok {\n\t\treturn val\n\t}\n\treturn nil\n}", "title": "" }, { "docid": "3e6af8d7c68f7017364bc11f7be0f791", "score": "0.6050947", "text": "func (o ObjectValue) Type(ctx context.Context) attr.Type {\n\treturn ObjectType{AttrTypes: o.AttributeTypes(ctx)}\n}", "title": "" }, { "docid": "b30da0b593fa1a99e1359b60d71158b9", "score": "0.60254633", "text": "func (v *Value) Type() (actual Type, fundamental Type, err error) {\n\tif !gobool(C._g_is_value(v.native())) {\n\t\treturn actual, fundamental, errors.New(\"invalid GValue\")\n\t}\n\tcActual := C._g_value_type(v.native())\n\tcFundamental := C._g_value_fundamental(cActual)\n\treturn Type(cActual), Type(cFundamental), nil\n}", "title": "" }, { "docid": "2a5e290e3b138521bef2b090c7ef8f5f", "score": "0.6021848", "text": "func (v *actorTableType) Schema() string {\n\treturn v.s.SQLSchema\n}", "title": "" }, { "docid": "49fc7d76417034fd449c502c221b4a10", "score": "0.60152197", "text": "func (d *Value) GetType() ValueType {\n\treturn ValueType(C.gocef_value_get_type(d.toNative(), d.get_type))\n}", "title": "" }, { "docid": "58871f06d06c61732a7a48ee2f1468ee", "score": "0.6013551", "text": "func (lrv *LRValue) ValueType() types.Info {\n\treturn lrv.valueType\n}", "title": "" }, { "docid": "df9e8903c07855ad2620826857462c02", "score": "0.596442", "text": "func (v *jobTableType) Schema() string {\n\treturn v.s.SQLSchema\n}", "title": "" }, { "docid": "b8a9e1d0d1172bdbda1384a72849a86c", "score": "0.5938811", "text": "func (o ServerClaimOutput) ValueType() pulumi.StringPtrOutput {\n\treturn o.ApplyT(func(v *ServerClaim) pulumi.StringPtrOutput { return v.ValueType }).(pulumi.StringPtrOutput)\n}", "title": "" }, { "docid": "459c588141345094d87719f6f4c1fc87", "score": "0.59224117", "text": "func Get(typ interface{}) TypeMeta {\n\treturn DefaultSchema.Get(typ)\n}", "title": "" }, { "docid": "a4d76518b0305b1ce852197129ca2826", "score": "0.59099025", "text": "func (vl NullValue) GetType() int {\n\treturn ParticleType.NULL\n}", "title": "" }, { "docid": "9c04163106676f59063fd12ab416ad0e", "score": "0.5833463", "text": "func (r *reader) Type() Type {\n\treturn r.valueType\n}", "title": "" }, { "docid": "ebc2d6719bace52165f6d2b1ccdf861a", "score": "0.58327043", "text": "func (f *StructField) Type() Type { return f.parent.ts.types[f.dmt.FieldType().TypeReference()] }", "title": "" }, { "docid": "a4e48cdb6d0e5e520edac4de5ee56911", "score": "0.58255863", "text": "func (o MetricDescriptorOutput) ValueType() pulumi.StringOutput {\n\treturn o.ApplyT(func(v *MetricDescriptor) pulumi.StringOutput { return v.ValueType }).(pulumi.StringOutput)\n}", "title": "" }, { "docid": "c3321b08826dc064d20f19dacb759be4", "score": "0.57826126", "text": "func ValueType(hasValue, hasLang, hasSpecialId bool) ValueTypeInfo {\n\tswitch {\n\tcase hasValue && hasLang:\n\t\treturn ValueLang\n\tcase hasValue && !hasLang:\n\t\treturn ValuePlain\n\tcase !hasValue && hasSpecialId:\n\t\treturn ValueEmpty\n\tcase !hasValue && !hasSpecialId:\n\t\treturn ValueUid\n\tdefault:\n\t\treturn ValueUnknown\n\t}\n}", "title": "" }, { "docid": "d7ccbbdb006893d0994e93901a80e63b", "score": "0.57770884", "text": "func (g *ValueGenerator) Type(t string) interface{} {\n\tswitch t {\n\tcase \"string\":\n\t\treturn g.String()\n\tcase \"boolean\":\n\t\treturn g.Bool()\n\tcase \"number\":\n\t\treturn g.Float()\n\tcase \"integer\":\n\t\treturn g.Int()\n\tcase \"object\":\n\t\treturn g.Object()\n\tcase \"array\":\n\t\treturn g.Array()\n\tcase \"null\":\n\t\treturn nil\n\tdefault:\n\t\treturn g.Value()\n\t}\n}", "title": "" }, { "docid": "6fe64d505edc1dcf459e2601a5d505c6", "score": "0.57510453", "text": "func (m *MapValue) Type() ref.Type {\n\treturn m.typeValue\n}", "title": "" }, { "docid": "21ce9a359f2c259f0097593c7255b0f6", "score": "0.5744078", "text": "func (o FhirStoreStreamConfigBigqueryDestinationSchemaConfigOutput) SchemaType() pulumi.StringPtrOutput {\n\treturn o.ApplyT(func(v FhirStoreStreamConfigBigqueryDestinationSchemaConfig) *string { return v.SchemaType }).(pulumi.StringPtrOutput)\n}", "title": "" }, { "docid": "4d2d189007271eb9dfb19362932aa5cd", "score": "0.5734577", "text": "func (s *CompositeLit) ValueType() types.Type {\n\treturn s.getType(s.Type)\n}", "title": "" }, { "docid": "ceeac767b78b6163b31fe395cd064340", "score": "0.57239085", "text": "func (v *ValueObject) GetValueType() pb.OpAndDataType {\n\treturn v.valueType\n}", "title": "" }, { "docid": "e5aae2a42e33cbb7778592f289b729a1", "score": "0.5715184", "text": "func (v *cityTableType) Schema() string {\n\treturn v.s.SQLSchema\n}", "title": "" }, { "docid": "f864c423c40105bad9088ee269d45cb0", "score": "0.5711548", "text": "func (it *Null) Type() graph.Type { return graph.Null }", "title": "" }, { "docid": "bc26506da58d5b2abb37dae4d6e44647", "score": "0.5706596", "text": "func GetValueType(t, w int32) ValueType {\n\t// If you add ValueType instances, or different incantations of the\n\t// ByteValueType you'll need to update this function. Make sure your\n\t// ValueType implementation returns the correct type.\n\tswitch t {\n\tcase 0x00, 0x0F:\n\t\t// This is mostly for testing\n\t\t// 0x0F is an unknown null value\n\t\tnull := []byte(\"NULL\")\n\t\tif w > 4 {\n\t\t\tnull = append(null, bytes.Repeat([]byte(\" \"), int(w-4))...)\n\t\t}\n\t\treturn NewByteValueType(w, null[0:w])\n\tcase 0x01:\n\t\t// byte records with null == 0x0\n\t\treturn NewByteValueType(w, bytes.Repeat([]byte{0x0}, int(w)))\n\tcase 0x10:\n\t\t// Your standard 8 byte wide float64 records\n\t\treturn NewFloat64ValueType()\n\tcase 0x11:\n\t\t// int64 8 byte wide implementation, Null = MinInt64\n\t\treturn NewInt64ValueType()\n\t}\n\n\t// We should not be here\n\tpanic(\"Unimplemented journal data type\")\n\treturn nil\n}", "title": "" }, { "docid": "7a6a2f052893dbf4760c1e678fcda7cb", "score": "0.56948596", "text": "func TypeFromSchema(schema *spec.Schema, includeModels bool) (string, error) {\n\t// We support three types of schemas\n\t// 1. An empty schema, which we represent by the empty struct\n\t// 2. A schema with one element, the $ref key\n\t// 3. A schema with two elements. One a type with value 'array' and another items field\n\t// referencing the $ref\n\tif schema == nil {\n\t\treturn \"struct{}\", nil\n\t} else if schema.Ref.String() != \"\" {\n\t\tref := schema.Ref.String()\n\t\tif !strings.HasPrefix(ref, \"#/definitions/\") {\n\t\t\treturn \"\", fmt.Errorf(\"schema.$ref has undefined reference type. Must start with #/definitions\")\n\t\t}\n\t\tdef := ref[len(\"#/definitions/\"):]\n\t\tif includeModels {\n\t\t\tdef = \"models.\" + def\n\t\t}\n\t\treturn def, nil\n\t} else {\n\t\tschemaType := schema.Type\n\t\tif len(schemaType) != 1 || schemaType[0] != \"array\" {\n\t\t\treturn \"\", fmt.Errorf(\"Two element schemas must have a 'type' field with the value 'array'\")\n\t\t}\n\t\titems := schema.Items\n\t\tif items == nil || items.Schema == nil {\n\t\t\treturn \"\", fmt.Errorf(\"Two element schemas must have a '$ref' field in the 'items' descriptions\")\n\t\t}\n\t\tref := items.Schema.Ref.String()\n\t\tif !strings.HasPrefix(ref, \"#/definitions/\") {\n\t\t\treturn \"\", fmt.Errorf(\"schema.$ref has undefined reference type. Must start with #/definitions\")\n\t\t}\n\t\tdef := ref[len(\"#/definitions/\"):]\n\t\tif includeModels {\n\t\t\tdef = \"models.\" + def\n\t\t}\n\t\treturn \"[]\" + def, nil\n\t}\n}", "title": "" }, { "docid": "c5abe0a635a404fb9b4e5cf3e3363989", "score": "0.56938946", "text": "func (v *Value) Type() Type {\n\tif v.t == typeRawString {\n\t\tv.s = unescapeStringBestEffort(v.s)\n\t\tv.t = TypeString\n\t}\n\treturn v.t\n}", "title": "" }, { "docid": "56fac6cce6153c99930cf895b36dd2b4", "score": "0.56875706", "text": "func (v *candleTableType) Schema() string {\n\treturn v.s.SQLSchema\n}", "title": "" }, { "docid": "418e7dd826ea3c1bc5aa8f2dffdf25fe", "score": "0.56858575", "text": "func (n *Null) Type() Type { return NullObj }", "title": "" }, { "docid": "8947e05b7905269bd5d13afec739dcd7", "score": "0.5672185", "text": "func (n *Null) Type() Type { return NULL }", "title": "" }, { "docid": "fff2c50e635b3b804f0a0d39194fb1f0", "score": "0.566354", "text": "func (obj *tableSchema) Value() values.Value {\n\treturn obj.val\n}", "title": "" }, { "docid": "6b44ddc813843df5fba3951cd1a41ff9", "score": "0.5622635", "text": "func (n *Null) Type() Type {\n\treturn NULL\n}", "title": "" }, { "docid": "7edcc3600b5a9bcf66e394e1f0f7b65e", "score": "0.56222856", "text": "func (o *SourceType) GetSchema() string {\n\tif o == nil || o.Schema == nil {\n\t\tvar ret string\n\t\treturn ret\n\t}\n\treturn *o.Schema\n}", "title": "" }, { "docid": "d87b76aecd3981f0182d52d90e95dbcf", "score": "0.5614603", "text": "func (c *Core) GetSchema() string {\n\treturn c.schema.Val()\n}", "title": "" }, { "docid": "3b20c2229485c9779cd4cf03c13e2ab2", "score": "0.560729", "text": "func getSchemaType(fieldType reflect.Type) string {\n\tif fieldType.Kind() == reflect.Ptr {\n\t\tfieldType = fieldType.Elem()\n\t}\n\n\t// check if implements SchemaType\n\tschemaTypeElem := reflect.New(fieldType).Interface()\n\tif schemaTyper, ok := schemaTypeElem.(SchemaType); ok {\n\t\treturn schemaTyper.SchemaType()\n\t}\n\n\tswitch fieldType.Kind() {\n\tcase reflect.Interface:\n\t\treturn \"uid\"\n\tcase reflect.Slice:\n\t\tsliceType := fieldType.Elem()\n\t\treturn fmt.Sprintf(\"[%s]\", getSchemaType(sliceType))\n\tcase reflect.Struct:\n\t\tswitch fieldType.PkgPath() {\n\t\tcase \"time\":\n\t\t\t// golang std time\n\t\t\treturn \"datetime\"\n\t\tdefault:\n\t\t\t// one-to-one relation\n\t\t\treturn \"uid\"\n\t\t}\n\tcase reflect.Int, reflect.Int8, reflect.Int16, reflect.Int32, reflect.Int64,\n\t\treflect.Uint, reflect.Uint8, reflect.Uint16, reflect.Uint32, reflect.Uint64:\n\t\treturn \"int\"\n\tcase reflect.Float32, reflect.Float64:\n\t\treturn \"float\"\n\t}\n\n\treturn fieldType.Name()\n}", "title": "" }, { "docid": "655ffcd7101f4bac3deb2c28ff44e1ee", "score": "0.5583997", "text": "func (swagger *Swagger) GetSchemaRootType(schema *Schema, parentTag *MeqaTag) (*MeqaTag, *Schema) {\n\ttag := GetMeqaTag(schema.Description)\n\tif tag == nil {\n\t\ttag = parentTag\n\t}\n\treferenceName, referredSchema, err := swagger.GetReferredSchema((*Schema)(schema))\n\tif err != nil {\n\t\tmqutil.Logger.Print(err)\n\t\treturn nil, nil\n\t}\n\tif referredSchema != nil {\n\t\tif tag == nil {\n\t\t\ttag = &MeqaTag{referenceName, \"\", \"\", 0}\n\t\t}\n\t\treturn swagger.GetSchemaRootType(referredSchema, tag)\n\t}\n\tif len(schema.Enum) != 0 {\n\t\treturn nil, nil\n\t}\n\tif len(schema.Type) == 0 {\n\t\treturn nil, nil\n\t}\n\tif schema.Type.Contains(gojsonschema.TYPE_ARRAY) {\n\t\tvar itemSchema *spec.Schema\n\t\tif len(schema.Items.Schemas) != 0 {\n\t\t\titemSchema = &(schema.Items.Schemas[0])\n\t\t} else {\n\t\t\titemSchema = schema.Items.Schema\n\t\t}\n\t\treturn swagger.GetSchemaRootType((*Schema)(itemSchema), tag)\n\t} else if schema.Type.Contains(gojsonschema.TYPE_OBJECT) {\n\t\treturn tag, schema\n\t}\n\treturn nil, nil\n}", "title": "" }, { "docid": "1854a40bd892294fc25dbd51c21c23c1", "score": "0.55584735", "text": "func (c *Constant) Type() Type {\n\tif c.typ == nil {\n\t\tif c.ConstantValue.IsNull() {\n\t\t\tc.typ = NoneType\n\t\t} else {\n\t\t\tc.typ = ctyTypeToType(c.ConstantValue.Type(), false)\n\t\t}\n\t}\n\treturn c.typ\n}", "title": "" }, { "docid": "ed11e7fd506dfed8b6115899d8b532ff", "score": "0.5492741", "text": "func (t *DataType) Type() interface{} {\n\treturn \"\"\n}", "title": "" }, { "docid": "f320a6ce72ddb3665df180e58490398d", "score": "0.54836404", "text": "func (DefaultVal) ResolvedType() *types.T { return nil }", "title": "" }, { "docid": "36e98cb6fee89915acd474c3e3850cbd", "score": "0.5449709", "text": "func (field *Field) Type() FieldType {\n\treturn field.fieldType\n}", "title": "" }, { "docid": "4f7a4b5c5df6ddfd48beccfc14490d66", "score": "0.5442291", "text": "func (s *SecureValue) GetType() (value SecureValueTypeClass) {\n\tif s == nil {\n\t\treturn\n\t}\n\treturn s.Type\n}", "title": "" }, { "docid": "ca4ef6a10303174e5fd2ac4c84fd8c12", "score": "0.5433231", "text": "func (n *Null) Type() ObjectType { return NULL_OBJ }", "title": "" }, { "docid": "4b1b232f159acb39833a8c7614cf9415", "score": "0.5415908", "text": "func (v *ValueDerivedTable) Schema() sql.Schema {\n\tif len(v.ExpressionTuples) == 0 {\n\t\treturn nil\n\t}\n\n\t// TODO: get type by examining all rows, use most permissive type and cast everything to it\n\tchildSchema := v.Values.Schema()\n\tschema := make(sql.Schema, len(childSchema))\n\tfor i, col := range childSchema {\n\t\tc := *col\n\t\tc.Source = v.name\n\t\tif len(v.columns) > 0 {\n\t\t\tc.Name = v.columns[i]\n\t\t} else {\n\t\t\tc.Name = fmt.Sprintf(\"column_%d\", i)\n\t\t}\n\t\tschema[i] = &c\n\t}\n\n\treturn schema\n}", "title": "" }, { "docid": "2cfdcd7d3dba02d44fe96fbafc7b6667", "score": "0.5415015", "text": "func (o *Object) Type() *Type {\n\treturn o.typ\n}", "title": "" }, { "docid": "99b78cc5a688dad59505b353de50c9c8", "score": "0.5413161", "text": "func (a ALPN) TypeValue() TypeValue {\n\treturn ALPNTypeValue\n}", "title": "" }, { "docid": "edf8d1f9c65798a2f6917a26cb0f937b", "score": "0.54073006", "text": "func GetValueType(value interface{}) string {\n\tswitch value.(type) {\n\tcase string:\n\t\treturn \"string\"\n\tcase int:\n\t\treturn \"int\"\n\tcase int64:\n\t\treturn \"int64\"\n\tcase float32:\n\t\treturn \"float32\"\n\tcase float64:\n\t\treturn \"float64\"\n\tcase bool:\n\t\treturn \"bool\"\n\tcase []string:\n\t\treturn \"[]string\"\n\tcase []int:\n\t\treturn \"[]int\"\n\tcase []int64:\n\t\treturn \"[]int64\"\n\tcase []float32:\n\t\treturn \"[]float32\"\n\tcase []float64:\n\t\treturn \"[]float64\"\n\tcase []bool:\n\t\treturn \"[]bool\"\n\tdefault:\n\t\treturn \"Unknown\"\n\t}\n}", "title": "" }, { "docid": "483e1c9864bd77bae24bfd212804b2c9", "score": "0.54071265", "text": "func (t Type) String() string {\n\tswitch t.typ.Type {\n\tcase \"boolean\":\n\t\treturn SchemaTypeBool\n\tcase \"string\":\n\t\treturn SchemaTypeString\n\tcase \"integer\":\n\t\treturn SchemaTypeInt\n\tcase \"number\":\n\t\tif t.typ.Format == \"double\" {\n\t\t\treturn SchemaTypeFloat\n\t\t}\n\t\treturn \"unknown number type\"\n\tcase \"object\":\n\t\t// assume if this is set, it's a string -> string map for now.\n\t\t// https://swagger.io/docs/specification/data-models/dictionaries/\n\t\t// describes the behaviour of AdditionalProperties for type: object\n\t\tif t.typ.AdditionalProperties != nil {\n\t\t\tif v := t.typ.AdditionalProperties.Type; v == \"string\" {\n\t\t\t\treturn SchemaTypeMap\n\t\t\t} else {\n\t\t\t\treturn fmt.Sprintf(\"unknown AdditionalProperties: %q\", v)\n\t\t\t}\n\t\t}\n\t\treturn SchemaTypeList\n\tcase \"array\":\n\t\tif t.typ.Extension[\"x-dcl-list-type\"] == \"set\" {\n\t\t\treturn SchemaTypeSet\n\t\t}\n\t\treturn SchemaTypeList\n\tcase \"\":\n\t\treturn \"<nil>\"\n\tdefault:\n\t\treturn fmt.Sprintf(\"undefined type: %s\", t.typ)\n\t}\n}", "title": "" }, { "docid": "05ca240735b24af95987a8e044304549", "score": "0.53986156", "text": "func (r *valueDecoder) readTypeOfValue() *Type {\n\tk := r.peekKind()\n\tswitch k {\n\tcase BlobKind:\n\t\tr.skipBlob()\n\t\treturn BlobType\n\tcase BoolKind:\n\t\tr.skipKind()\n\t\tr.skipBool()\n\t\treturn BoolType\n\tcase NumberKind:\n\t\tr.skipKind()\n\t\tr.skipNumber()\n\t\treturn NumberType\n\tcase StringKind:\n\t\tr.skipKind()\n\t\tr.skipString()\n\t\treturn StringType\n\tcase ListKind, MapKind, RefKind, SetKind:\n\t\t// These do not decode the actual values anyway.\n\t\treturn r.readValue().typeOf()\n\tcase StructKind:\n\t\treturn readStructTypeOfValue(r)\n\tcase TypeKind:\n\t\tr.skipKind()\n\t\tr.skipType()\n\t\treturn TypeType\n\tcase CycleKind, UnionKind, ValueKind:\n\t\td.Panic(\"A value instance can never have type %s\", k)\n\t}\n\n\tpanic(\"not reachable\")\n}", "title": "" }, { "docid": "3b76f1c25781cbde227ef1a3fe168dac", "score": "0.53971785", "text": "func (t BitType_) ValueType() reflect.Type {\n\treturn bitValueType\n}", "title": "" }, { "docid": "ada1c4abe10acf758aede25ed7f8eaa3", "score": "0.5378044", "text": "func (fld Field) Type() FieldType {\n\treturn fld.ftype\n}", "title": "" }, { "docid": "ada1c4abe10acf758aede25ed7f8eaa3", "score": "0.5378044", "text": "func (fld Field) Type() FieldType {\n\treturn fld.ftype\n}", "title": "" }, { "docid": "a14487c88a4dc86bc6ece3f9b270b80a", "score": "0.53731763", "text": "func (n *Null) Type() Type { return NULLOBJ }", "title": "" }, { "docid": "765ac5fb8d3c1abda05885e5fddd74bc", "score": "0.53702515", "text": "func (n *NullT) Type() Type {\n\treturn NullType\n}", "title": "" }, { "docid": "b0e83347ca8fe45e428e984eede2f13a", "score": "0.5362342", "text": "func SchemaFromType(t reflect.Type) *Schema {\n /* TODO: Implement */\n return nil\n}", "title": "" }, { "docid": "cf3a28f8a648bf1b91947b639599acb8", "score": "0.5358539", "text": "func (f *dynamicField) Type() field.Type {\n\treturn f.fieldType\n}", "title": "" }, { "docid": "55071d839cd0b40cd4679d09651d9caf", "score": "0.5350417", "text": "func (r RenegotiationInfo) TypeValue() TypeValue {\n\treturn RenegotiationInfoTypeValue\n}", "title": "" }, { "docid": "c5a94595facd1cbc33b9ca157c2b1840", "score": "0.53414375", "text": "func (f *Field) TypeSchemaName() string {\n\tparts := strings.Split(f.Type, \".\")\n\treturn parts[len(parts)-1]\n}", "title": "" }, { "docid": "6bf6e10847329effd51fd99ee7b08d24", "score": "0.53336245", "text": "func NewSchemaType() *SchemaType {\n\tthis := SchemaType{}\n\treturn &this\n}", "title": "" }, { "docid": "1f1873b32f908daf0ddcbdc08a0b3eba", "score": "0.5331658", "text": "func (r *valueDecoder) readTypeOfValue(nbf *NomsBinFormat) (*Type, error) {\n\tk := r.PeekKind()\n\tswitch k {\n\tcase BlobKind:\n\t\terr := r.skipBlob(nbf)\n\t\tif err != nil {\n\t\t\treturn nil, err\n\t\t}\n\t\treturn PrimitiveTypeMap[BlobKind], nil\n\tcase ListKind, MapKind, RefKind, SetKind:\n\t\t// These do not decode the actual values anyway.\n\t\tval, err := r.readValue(nbf)\n\t\tif err != nil {\n\t\t\treturn nil, err\n\t\t}\n\t\td.Chk.True(val != nil)\n\t\treturn val.typeOf()\n\tcase StructKind:\n\t\treturn readStructTypeOfValue(nbf, r)\n\tcase TupleKind:\n\t\tval, err := r.readValue(nbf)\n\t\tif err != nil {\n\t\t\treturn nil, err\n\t\t}\n\t\td.Chk.True(val != nil)\n\t\treturn val.typeOf()\n\tcase JSONKind:\n\t\tval, err := r.readValue(nbf)\n\t\tif err != nil {\n\t\t\treturn nil, err\n\t\t}\n\t\td.Chk.True(val != nil)\n\t\treturn val.typeOf()\n\tcase TypeKind:\n\t\tr.skipKind()\n\t\terr := r.skipType()\n\t\tif err != nil {\n\t\t\treturn nil, err\n\t\t}\n\t\treturn PrimitiveTypeMap[TypeKind], nil\n\tcase CycleKind, UnionKind, ValueKind:\n\t\td.Panic(\"A value instance can never have type %s\", k)\n\t}\n\n\tif IsPrimitiveKind(k) {\n\t\tif emptyVal := KindToType[k]; emptyVal != nil {\n\t\t\tr.skipKind()\n\t\t\temptyVal.skip(nbf, &r.binaryNomsReader)\n\t\t\treturn PrimitiveTypeMap[k], nil\n\t\t}\n\t}\n\n\treturn nil, ErrUnknownType\n}", "title": "" }, { "docid": "bc6287bdbefc926305487ab02a3165fb", "score": "0.5330246", "text": "func (n *Node) Type() Type {\n\treturn n.typ\n}", "title": "" }, { "docid": "044e8c0643be876968f113e423035247", "score": "0.5304798", "text": "func (d DNull) Type() string {\n\treturn \"NULL\"\n}", "title": "" }, { "docid": "d03f3e4ecab1b6ae7d684d21c31a0ad0", "score": "0.52993125", "text": "func (t TimespanType_) ValueType() reflect.Type {\n\treturn timeValueType\n}", "title": "" }, { "docid": "cd4cdab8fa6fba1cd45c6227eeb70ba0", "score": "0.5281379", "text": "func (o *Object) Type() core.ObjectType { return o.t }", "title": "" }, { "docid": "59893ff3823beecc8f830cf45f5aa84e", "score": "0.5268014", "text": "func (t NumberType) ValueType(_ context.Context) attr.Value {\n\t// This Value does not need to be valid.\n\treturn NumberValue{}\n}", "title": "" }, { "docid": "2862b5c6efe80c8f8f66b4f06d476030", "score": "0.5263253", "text": "func (o *SunburstWidgetDefinition) GetType() SunburstWidgetDefinitionType {\n\tif o == nil {\n\t\tvar ret SunburstWidgetDefinitionType\n\t\treturn ret\n\t}\n\treturn o.Type\n}", "title": "" }, { "docid": "5f381f1d49dfe8e55988462593b4e38b", "score": "0.526107", "text": "func (rv *ReturnValue) Type() ObjectType { return ReturnValueObj }", "title": "" }, { "docid": "c09a9c703c4d424365e20deecba8b64c", "score": "0.5256109", "text": "func (o *MetaDefinitionAllOf) GetObjectType() string {\n\tif o == nil {\n\t\tvar ret string\n\t\treturn ret\n\t}\n\n\treturn o.ObjectType\n}", "title": "" }, { "docid": "0ad717e4c0be7c742e8e82ccc0fabd6b", "score": "0.5249926", "text": "func (*Tfdt) GetType() BoxType {\n\treturn BoxTypeTfdt()\n}", "title": "" }, { "docid": "8576b19b262e3d11446c93e50978a549", "score": "0.5239366", "text": "func (o *FirmwareUpgradeValidity) GetObjectType() string {\n\tif o == nil {\n\t\tvar ret string\n\t\treturn ret\n\t}\n\n\treturn o.ObjectType\n}", "title": "" }, { "docid": "a9b202a0bc71f8330f1814dd14ece149", "score": "0.52371657", "text": "func (v *specViewType) Schema() string {\n\treturn v.s.SQLSchema\n}", "title": "" }, { "docid": "059c7762641b028ef0741e9183e78aa5", "score": "0.5231177", "text": "func (m *SchemeTypeMutation) Type() string {\n\treturn m.typ\n}", "title": "" }, { "docid": "402b9f2f4c704af7c97d50a92ba565f8", "score": "0.5231161", "text": "func Type() *DataType {\n\treturn &DataType{}\n}", "title": "" }, { "docid": "151602a1aa2e7f80ea91ff5124b7c5c1", "score": "0.52287424", "text": "func TableTypeValue(t string) TableType {\n\tswitch t {\n\tcase \"VPORT\":\n\t\treturn VPORT\n\tcase \"LTYPE\":\n\t\treturn LTYPE\n\tcase \"LAYER\":\n\t\treturn LAYER\n\tcase \"STYLE\":\n\t\treturn STYLE\n\tcase \"VIEW\":\n\t\treturn VIEW\n\tcase \"UCS\":\n\t\treturn UCS\n\tcase \"APPID\":\n\t\treturn APPID\n\tcase \"DIMSTYLE\":\n\t\treturn DIMSTYLE\n\tcase \"BLOCK_RECORD\":\n\t\treturn BLOCK_RECORD\n\tdefault:\n\t\treturn -1\n\t}\n}", "title": "" }, { "docid": "b0b2300708afb1578785b5b1993c0945", "score": "0.52193815", "text": "func (inst *InstInsertValue) Type() types.Type {\n\t// Cache type if not present.\n\tif inst.Typ == nil {\n\t\tinst.Typ = inst.X.Type()\n\t}\n\treturn inst.Typ\n}", "title": "" }, { "docid": "c1ce17b53b97cd5d6addcf03d56880a7", "score": "0.5214719", "text": "func toGoType(schema *v3.Schema) string {\n\tif stringutils.IsNotEmpty(schema.Ref) {\n\t\treturn strings.TrimPrefix(schema.Ref, \"#/components/schemas/\")\n\t}\n\tswitch schema.Type {\n\tcase v3.IntegerT:\n\t\treturn integer2Go(schema)\n\tcase v3.StringT:\n\t\treturn string2Go(schema)\n\tcase v3.BooleanT:\n\t\treturn \"bool\"\n\tcase v3.NumberT:\n\t\treturn number2Go(schema)\n\tcase v3.ObjectT:\n\t\treturn object2Struct(schema)\n\tcase v3.ArrayT:\n\t\treturn \"[]\" + toGoType(schema.Items)\n\tdefault:\n\t\treturn \"interface{}\"\n\t}\n}", "title": "" }, { "docid": "2d4af9c019d628ea025ad21c4029d532", "score": "0.5209785", "text": "func Schema(ceType, registry string, t interface{}) (string, error) {\n\treflector := jsonschema.Reflector{\n\t\tAllowAdditionalProperties: false,\n\t\tExpandedStruct: true,\n\t}\n\tschema := reflector.Reflect(t)\n\n\tschema.Version = \"http://json-schema.org/schema#\"\n\tschema.Ref = RefURI(ceType, registry)\n\n\tst := reflect.TypeOf(t)\n\tfor i := 0; i < st.NumField(); i++ {\n\n\t}\n\n\tdata, err := json.MarshalIndent(schema, \"\", \" \")\n\tif err != nil {\n\t\treturn \"\", err\n\t}\n\treturn string(data), err\n}", "title": "" }, { "docid": "2130794f406c41e5d13cd91a2b99d37d", "score": "0.5200582", "text": "func (v Ref) Type() Type {\n\tpanic(errNotImplemented)\n}", "title": "" }, { "docid": "f2c41f6f2f6f09bed473eef5d8cf9f09", "score": "0.52002436", "text": "func getTypeNameForMapValueType(valueType string) *string {\n\tif _, ok := protoBufScalarTypes[valueType]; ok {\n\t\treturn nil // Ok it is a scalar. For scalar values we don't set the TypeName of the field.\n\t}\n\ttypeName := valueType\n\treturn &typeName\n}", "title": "" }, { "docid": "f2c41f6f2f6f09bed473eef5d8cf9f09", "score": "0.52002436", "text": "func getTypeNameForMapValueType(valueType string) *string {\n\tif _, ok := protoBufScalarTypes[valueType]; ok {\n\t\treturn nil // Ok it is a scalar. For scalar values we don't set the TypeName of the field.\n\t}\n\ttypeName := valueType\n\treturn &typeName\n}", "title": "" }, { "docid": "c31e78a68225e1204b96f00dfe1cde55", "score": "0.51953393", "text": "func fromValueType(t rbxfile.Type) typeID {\n\tswitch t {\n\tcase rbxfile.TypeString:\n\t\treturn typeString\n\tcase rbxfile.TypeBinaryString:\n\t\treturn typeString\n\tcase rbxfile.TypeProtectedString:\n\t\treturn typeString\n\tcase rbxfile.TypeContent:\n\t\treturn typeString\n\tcase rbxfile.TypeBool:\n\t\treturn typeBool\n\tcase rbxfile.TypeInt:\n\t\treturn typeInt\n\tcase rbxfile.TypeFloat:\n\t\treturn typeFloat\n\tcase rbxfile.TypeDouble:\n\t\treturn typeDouble\n\tcase rbxfile.TypeUDim:\n\t\treturn typeUDim\n\tcase rbxfile.TypeUDim2:\n\t\treturn typeUDim2\n\tcase rbxfile.TypeRay:\n\t\treturn typeRay\n\tcase rbxfile.TypeFaces:\n\t\treturn typeFaces\n\tcase rbxfile.TypeAxes:\n\t\treturn typeAxes\n\tcase rbxfile.TypeBrickColor:\n\t\treturn typeBrickColor\n\tcase rbxfile.TypeColor3:\n\t\treturn typeColor3\n\tcase rbxfile.TypeVector2:\n\t\treturn typeVector2\n\tcase rbxfile.TypeVector3:\n\t\treturn typeVector3\n\tcase rbxfile.TypeVector2int16:\n\t\treturn typeVector2int16\n\tcase rbxfile.TypeCFrame:\n\t\treturn typeCFrame\n\tcase rbxfile.TypeToken:\n\t\treturn typeToken\n\tcase rbxfile.TypeReference:\n\t\treturn typeReference\n\tcase rbxfile.TypeVector3int16:\n\t\treturn typeVector3int16\n\tcase rbxfile.TypeNumberSequence:\n\t\treturn typeNumberSequence\n\tcase rbxfile.TypeColorSequence:\n\t\treturn typeColorSequence\n\tcase rbxfile.TypeNumberRange:\n\t\treturn typeNumberRange\n\tcase rbxfile.TypeRect:\n\t\treturn typeRect\n\tcase rbxfile.TypePhysicalProperties:\n\t\treturn typePhysicalProperties\n\tcase rbxfile.TypeColor3uint8:\n\t\treturn typeColor3uint8\n\tcase rbxfile.TypeInt64:\n\t\treturn typeInt64\n\tcase rbxfile.TypeSharedString:\n\t\treturn typeSharedString\n\tcase rbxfile.TypeOptional:\n\t\treturn typeOptional\n\tcase rbxfile.TypeUniqueId:\n\t\treturn typeUniqueId\n\tcase rbxfile.TypeFont:\n\t\treturn typeFont\n\tdefault:\n\t\treturn typeInvalid\n\t}\n}", "title": "" } ]
263db4f15eb2d8401c3762832030e665
Compile implements WildcardPattern interface.
[ { "docid": "ab46a5fbf0d4b272c8026cb07c490607", "score": "0.69247186", "text": "func (p *unicodePattern) Compile(patternStr string, escape byte) {\n\tp.patChars, p.patTypes = stringutil.CompilePatternInner(patternStr, escape)\n}", "title": "" } ]
[ { "docid": "d23ebfea5e8973c79485341679536616", "score": "0.6948291", "text": "func Compile(pattern string) (Matcher, error) {\n\treturn CompileWithSeparator(pattern, defaultSeparator)\n}", "title": "" }, { "docid": "fc133f50cc331280f7137326367eeee1", "score": "0.69469076", "text": "func Compile(pattern string) (*Regex, error) {\n\treturn CompileOptions(pattern, FlagDefault, nil)\n}", "title": "" }, { "docid": "a5c95fab7d544e8ae6c73f54de1cbed9", "score": "0.69324434", "text": "func (s MatchCompiler) Compile(parts ...string) (Matcher, error) {\n\treturn s.compile(parts)\n}", "title": "" }, { "docid": "1c9956e71f492c0dc3d053a848080652", "score": "0.6862524", "text": "func (c *Compiler) Compile(pattern []byte) (*Matcher, error) {\n\treturn compile(c, pattern)\n}", "title": "" }, { "docid": "1c9956e71f492c0dc3d053a848080652", "score": "0.6862524", "text": "func (c *Compiler) Compile(pattern []byte) (*Matcher, error) {\n\treturn compile(c, pattern)\n}", "title": "" }, { "docid": "02b767bc275283c0ebabfa820543b02f", "score": "0.6737924", "text": "func compilePattern(c *Compiler, pattern ast.ASTNode, v Operand) {\n\tif c.Error != nil {\n\t\treturn\n\t}\n\n\tpattern.Accept(newpatternCompiler(c, v))\n\tc.Result = v // propagate back down\n}", "title": "" }, { "docid": "1c1a8f6168d05bd6b2d9f5d3216c0d48", "score": "0.66724724", "text": "func (c *Compiler) Compile(pattern string) error {\n\ttokens := lexer.Tokenize(pattern)\n\tast, err := c.parser.Parse(tokens)\n\n\tif err != nil {\n\t\treturn err\n\t}\n\n\tc.Ast = ast\n\tc.Exe = ast.Compile()\n\n\treturn nil\n}", "title": "" }, { "docid": "db6da545aafcbecb5bfa6a2d6f8dc000", "score": "0.65143305", "text": "func Compile(expr string) (RegExp, error) {\n\treturn newLibPcreRegexp(expr)\n}", "title": "" }, { "docid": "15ad02da6a5f42a3d0ee87dad42d0c69", "score": "0.64659065", "text": "func (h Host) Compile(expr string) (*Pattern, error) {\n\tif expr == \"\" {\n\t\treturn nil, ErrEmptyExpression\n\t}\n\treturn h.compileExternal(expr)\n}", "title": "" }, { "docid": "f3fb660620d1ce3562dec0355df1394c", "score": "0.6412639", "text": "func rxListCompile(pattern string) {\n\tif pattern != `` {\n\t\trxList[pattern] = regexp.MustCompile(pattern)\n\t}\n}", "title": "" }, { "docid": "8ac50613cb36da5ab0d186284d59e145", "score": "0.63797355", "text": "func Compile(expr string) (Regexp, error) {\n\tr, ext, err := syntax.Compile(expr)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\tif ext {\n\t\treturn r, nil\n\t}\n\tre, err := regexp.Compile(ignoreComments(expr))\n\treturn &reg{\n\t\tRegexp: re,\n\t}, err\n}", "title": "" }, { "docid": "d55e4688fc049917b5d2e6abed002500", "score": "0.6345207", "text": "func CompilePatterns(patterns []string) ([]regexp.Regexp, []string) {\n\tvar regexps []regexp.Regexp\n\tvar badPatterns []string // patterns that cannot be compiled into regex\n\n\tfor _, pattern := range patterns {\n\t\tr, err := regexp.Compile(pattern)\n\t\tif err != nil {\n\t\t\tlog.Printf(\"Error compiling pattern [%s]: %v\", pattern, err)\n\t\t\tbadPatterns = append(badPatterns, pattern)\n\t\t} else {\n\t\t\tregexps = append(regexps, *r)\n\t\t}\n\t}\n\treturn regexps, badPatterns\n}", "title": "" }, { "docid": "85aa3c9391f6dfb3e7c321c2896f3fa4", "score": "0.6314284", "text": "func Compile(str string) (Regexps, error) {\n\treg, err := syntax.Parse(str, syntax.Perl)\n\tif err != nil {\n\t\treturn nil, fmt.Errorf(\"crun: Compile(%q): %w\", str, err)\n\t}\n\treturn NewRegexps(reg), nil\n}", "title": "" }, { "docid": "f6db376ad7157afb80811a8ce67848ef", "score": "0.6299794", "text": "func compile(p *protocol.PatternInfo) (*readerGrep, error) {\n\tvar (\n\t\tre *regexp.Regexp\n\t\tliteralSubstring []byte\n\t)\n\tif p.Pattern != \"\" {\n\t\texpr := p.Pattern\n\t\tif !p.IsRegExp {\n\t\t\texpr = regexp.QuoteMeta(expr)\n\t\t}\n\t\tif p.IsWordMatch {\n\t\t\texpr = `\\b` + expr + `\\b`\n\t\t}\n\t\tif p.IsRegExp {\n\t\t\t// We don't do the search line by line, therefore we want the\n\t\t\t// regex engine to consider newlines for anchors (^$).\n\t\t\texpr = \"(?m:\" + expr + \")\"\n\t\t}\n\t\tif !p.IsCaseSensitive {\n\t\t\t// We don't just use (?i) because regexp library doesn't seem\n\t\t\t// to contain good optimizations for case insensitive\n\t\t\t// search. Instead we lowercase the input and pattern.\n\t\t\tre, err := syntax.Parse(expr, syntax.Perl)\n\t\t\tif err != nil {\n\t\t\t\treturn nil, err\n\t\t\t}\n\t\t\tlowerRegexpASCII(re)\n\t\t\texpr = re.String()\n\t\t}\n\n\t\tvar err error\n\t\tre, err = regexp.Compile(expr)\n\t\tif err != nil {\n\t\t\treturn nil, err\n\t\t}\n\n\t\t// Only use literalSubstring optimization if the regex engine doesn't\n\t\t// have a prefix to use.\n\t\tif pre, _ := re.LiteralPrefix(); pre == \"\" {\n\t\t\tast, err := syntax.Parse(expr, syntax.Perl)\n\t\t\tif err != nil {\n\t\t\t\treturn nil, err\n\t\t\t}\n\t\t\tast = ast.Simplify()\n\t\t\tliteralSubstring = []byte(longestLiteral(ast))\n\t\t}\n\t}\n\n\tpathOptions := pathmatch.CompileOptions{\n\t\tRegExp: p.PathPatternsAreRegExps,\n\t\tCaseSensitive: p.PathPatternsAreCaseSensitive,\n\t}\n\tmatchPath, err := pathmatch.CompilePathPatterns(p.AllIncludePatterns(), p.ExcludePattern, pathOptions)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\treturn &readerGrep{\n\t\tre: re,\n\t\tignoreCase: !p.IsCaseSensitive,\n\t\tmatchPath: matchPath,\n\t\tliteralSubstring: literalSubstring,\n\t}, nil\n}", "title": "" }, { "docid": "fee410dbee19a10d92333f1945eb0c33", "score": "0.6270032", "text": "func (re *JSRE) Compile(filename string, src interface{}) (err error) {\n\tre.Do(func(vm *otto.Otto) { _, err = compileAndRun(vm, filename, src) })\n\treturn err\n}", "title": "" }, { "docid": "dfd166b5053599c9ee6f2a9e573e7ad9", "score": "0.6159771", "text": "func (r *RawExemption) Compile() CompiledExemption {\n\t// if not specified, assume it's the field matches all\n\n\t// ensure that ResourceName has a trailing glob so it can match the IDs added by certain resource types\n\t// ie, Deployment pod name test-pod, ReplicaSet name test-pod-sdf932, PodName test-pod-sdf932-ew92\n\tif !strings.HasSuffix(r.ResourceName, \"*\") {\n\t\tr.ResourceName = r.ResourceName + \"*\"\n\t}\n\n\tif r.ClusterName == \"\" {\n\t\tr.ClusterName = \"*\"\n\t}\n\tif r.Namespace == \"\" {\n\t\tr.Namespace = \"*\"\n\t}\n\tif r.Username == \"\" {\n\t\tr.Username = \"*\"\n\t}\n\tif r.Group == \"\" {\n\t\tr.Group = \"*\"\n\t}\n\tif len(r.ExemptPolicies) == 0 {\n\t\tr.ExemptPolicies = []string{\"*\"}\n\t}\n\n\t// compile the RawExemption\n\tvar policies []glob.Glob\n\tfor _, p := range r.ExemptPolicies {\n\t\tpolicies = append(policies, glob.MustCompile(p))\n\t}\n\treturn CompiledExemption{\n\t\tClusterName: glob.MustCompile(r.ClusterName),\n\t\tResourceName: glob.MustCompile(r.ResourceName),\n\t\tNamespace: glob.MustCompile(r.Namespace),\n\t\tUsername: glob.MustCompile(r.Username),\n\t\tGroup: glob.MustCompile(r.Group),\n\t\tExemptPolicies: policies,\n\t}\n}", "title": "" }, { "docid": "a5a0ba0ec04c012b6131a407c227fbc0", "score": "0.6106701", "text": "func Compile(pattern string, options *Options) (Glob, error) {\n\tpattern = strings.TrimSpace(pattern)\n\treader := strings.NewReader(pattern)\n\n\tif options == nil {\n\t\toptions = DefaultOptions\n\t} else {\n\t\t// Check that the separator is not an expander\n\t\tfor _, expander := range expanders {\n\t\t\tif options.Separator == expander {\n\t\t\t\treturn nil, fmt.Errorf(\"'%s' is not allowed as a separator\", string(options.Separator))\n\t\t\t}\n\t\t}\n\t}\n\n\tstate := &parserState{\n\t\toptions: options,\n\t\tescapedSeparator: escapeRegexComponent(string(options.Separator)),\n\t\tprocessedTokens: make([]processedToken, 0, 10),\n\t}\n\tglob := &globImpl{\n\t\tRegexp: nil,\n\t\tglobPattern: pattern,\n\t\tnegated: false,\n\t\tparserState: state,\n\t}\n\n\tregexBuf := new(bytes.Buffer)\n\tif options.MatchAtStart {\n\t\tregexBuf.WriteRune('^')\n\t}\n\n\tvar err error\n\t// Transform into a regular expression pattern\n\t// 1. Parse negation prefixes\n\terr = parseNegation(reader, glob)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\t// 2. Tokenise and convert!\n\ttokeniser := newGlobTokeniser(reader, options)\n\tlastProcessedToken := &processedToken{}\n\tfor tokeniser.Scan() {\n\t\tif err = tokeniser.Err(); err != nil {\n\t\t\treturn nil, err\n\t\t}\n\n\t\ttoken, tokenType := tokeniser.Token()\n\t\tt := processedToken{\n\t\t\tcontents: nil,\n\t\t\ttokenType: tokenType,\n\t\t}\n\n\t\t// Special cases\n\t\tif tokenType == tcGlobStar && tokeniser.Peek() {\n\t\t\t// If this is a globstar and the next token is a separator, consume it (the globstar pattern itself includes\n\t\t\t// a separator)\n\t\t\tif err = tokeniser.PeekErr(); err != nil {\n\t\t\t\treturn nil, err\n\t\t\t}\n\t\t\t_, peekedType := tokeniser.PeekToken()\n\t\t\tif peekedType == tcSeparator {\n\t\t\t\ttokeniser.Scan()\n\t\t\t}\n\t\t}\n\t\tif tokenType == tcGlobStar && lastProcessedToken.tokenType == tcGlobStar {\n\t\t\t// If the last token was a globstar and this is too, remove the last. We don't remove this globstar because\n\t\t\t// it may now be the last in the pattern, which is special\n\t\t\tlastProcessedToken = popLastToken(state)\n\t\t}\n\t\tif tokenType == tcGlobStar && lastProcessedToken.tokenType == tcSeparator && !tokeniser.Peek() {\n\t\t\t// If this is the last token, and it's a globstar, remove a preceeding separator\n\t\t\tlastProcessedToken = popLastToken(state)\n\t\t}\n\n\t\tt.contents, err = processToken(token, tokenType, glob, tokeniser)\n\t\tif err != nil {\n\t\t\treturn nil, err\n\t\t}\n\n\t\tlastProcessedToken = &t\n\t\tstate.processedTokens = append(state.processedTokens, t)\n\t}\n\n\tfor _, t := range state.processedTokens {\n\t\tt.contents.WriteTo(regexBuf)\n\t}\n\n\tif options.MatchAtEnd {\n\t\tregexBuf.WriteRune('$')\n\t}\n\n\tregexString := regexBuf.String()\n\tLogger.Tracef(\"[ohmyglob:Glob] Compiled \\\"%s\\\" to regex `%s` (negated: %v)\", pattern, regexString, glob.negated)\n\tre, err := regexp.Compile(regexString)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\tglob.parserState = nil\n\tglob.Regexp = re\n\n\treturn glob, nil\n}", "title": "" }, { "docid": "c1734359c5f3184ed38db334fec3851b", "score": "0.60746616", "text": "func Compile(dictionary [][]byte) (*Matcher, error) {\n\tm := new(Matcher)\n\tm.buildTrie(dictionary)\n\t// no error for now\n\treturn m, nil\n}", "title": "" }, { "docid": "63fea2b7e2a9a691c60884c86f7314d0", "score": "0.5995075", "text": "func (v AnyOf) Compile(rc ReferenceChecker) error {\n\tfor _, sv := range v {\n\t\tif c, ok := sv.(Compiler); ok {\n\t\t\tif err := c.Compile(rc); err != nil {\n\t\t\t\treturn err\n\t\t\t}\n\t\t}\n\n\t}\n\treturn nil\n}", "title": "" }, { "docid": "d048efc738383d81a0b06fec9a0c0ae3", "score": "0.59534705", "text": "func (*JadeCompilerType) CompileMatchFunc() MatchFunc {\n\treturn filenameMatchFunc(\"*.jade\", true, true)\n}", "title": "" }, { "docid": "3bd9184ae82f0b4631b4bead8d6f55d9", "score": "0.58892804", "text": "func (m *Mux) Compile() {\n\tm.rt.compile()\n}", "title": "" }, { "docid": "3bd9184ae82f0b4631b4bead8d6f55d9", "score": "0.58892804", "text": "func (m *Mux) Compile() {\n\tm.rt.compile()\n}", "title": "" }, { "docid": "2ab1e46614005d87e950d8a3fe5e4ba0", "score": "0.5881906", "text": "func Compile(src string) (string, error) {\n\tp, err := ast.NewTParser(src)\n\tif err != nil {\n\t\treturn \"\", err\n\t}\n\tparsed, err := p.Program()\n\tif err != nil {\n\t\treturn \"\", err\n\t}\n\tresult := Gen(parsed, p.GetOffset())\n\treturn strings.Join(result, \"\\n\"), nil\n}", "title": "" }, { "docid": "9c71497b805d82d011c3147367cbafc4", "score": "0.58309025", "text": "func Compile(str string) (*Regexp, error) {\n\tre, err := NewRegexp(str, ONIG_OPTION_DEFAULT)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\treturn re.MakeThreadsafe(), nil\n}", "title": "" }, { "docid": "64079f2262ab9ff171c6630336453026", "score": "0.58211976", "text": "func Compile(str string) (regexp *Regexp, error os.Error) {\n\tregexp = new(Regexp)\n\t// doParse will panic if there is a parse error.\n\tdefer func() {\n\t\tif e := recover(); e != nil {\n\t\t\tregexp = nil\n\t\t\terror = e.(Error) // Will re-panic if error was not an Error, e.g. nil-pointer exception\n\t\t}\n\t}()\n\tregexp.expr = str\n\tregexp.inst = make([]*instr, 0, 10)\n\tregexp.doParse()\n\treturn\n}", "title": "" }, { "docid": "672a86b5d3a8fd19d9a1b431e98062b3", "score": "0.5795438", "text": "func (f *Filter) Compile() error {\n\tif len(f.NameDrop) == 0 &&\n\t\tlen(f.NamePass) == 0 &&\n\t\tlen(f.FieldDrop) == 0 &&\n\t\tlen(f.FieldPass) == 0 &&\n\t\tlen(f.TagInclude) == 0 &&\n\t\tlen(f.TagExclude) == 0 &&\n\t\tlen(f.TagPass) == 0 &&\n\t\tlen(f.TagDrop) == 0 {\n\t\treturn nil\n\t}\n\n\tf.isActive = true\n\tvar err error\n\tf.nameDrop, err = filter.Compile(f.NameDrop)\n\tif err != nil {\n\t\treturn fmt.Errorf(\"Error compiling 'namedrop', %s\", err)\n\t}\n\tf.namePass, err = filter.Compile(f.NamePass)\n\tif err != nil {\n\t\treturn fmt.Errorf(\"Error compiling 'namepass', %s\", err)\n\t}\n\n\tf.fieldDrop, err = filter.Compile(f.FieldDrop)\n\tif err != nil {\n\t\treturn fmt.Errorf(\"Error compiling 'fielddrop', %s\", err)\n\t}\n\tf.fieldPass, err = filter.Compile(f.FieldPass)\n\tif err != nil {\n\t\treturn fmt.Errorf(\"Error compiling 'fieldpass', %s\", err)\n\t}\n\n\tf.tagExclude, err = filter.Compile(f.TagExclude)\n\tif err != nil {\n\t\treturn fmt.Errorf(\"Error compiling 'tagexclude', %s\", err)\n\t}\n\tf.tagInclude, err = filter.Compile(f.TagInclude)\n\tif err != nil {\n\t\treturn fmt.Errorf(\"Error compiling 'taginclude', %s\", err)\n\t}\n\n\tfor i := range f.TagDrop {\n\t\tf.TagDrop[i].filter, err = filter.Compile(f.TagDrop[i].Filter)\n\t\tif err != nil {\n\t\t\treturn fmt.Errorf(\"Error compiling 'tagdrop', %s\", err)\n\t\t}\n\t}\n\tfor i := range f.TagPass {\n\t\tf.TagPass[i].filter, err = filter.Compile(f.TagPass[i].Filter)\n\t\tif err != nil {\n\t\t\treturn fmt.Errorf(\"Error compiling 'tagpass', %s\", err)\n\t\t}\n\t}\n\treturn nil\n}", "title": "" }, { "docid": "9464d0e5111da3b2169aafb681a5116a", "score": "0.5784315", "text": "func MustCompile(pattern string) Matcher {\n\tif !PrefixCheck(pattern) {\n\t\tpanic(\"Wrong prefix\")\n\t}\n\tif InnerDoubleStar(pattern) {\n\t\tpanic(\"Double star which is not at the end of pattern\")\n\t}\n\tSuffixCheck(pattern)\n\n\tm, err := CompileWithSeparator(pattern, defaultSeparator)\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\treturn m\n}", "title": "" }, { "docid": "7a53a64b36b9f1866612cf02e8f95bc3", "score": "0.5676471", "text": "func Compile(rs []rune, opts Options) (re *Regexp, err error) {\n\tdefer func() {\n\t\tswitch e := recover().(type) {\n\t\tcase nil:\n\t\t\treturn\n\t\tcase ParseError:\n\t\t\tre, err = nil, e\n\t\tdefault:\n\t\t\tpanic(e)\n\t\t}\n\t}()\n\n\tp := parser{rs: rs, nsub: 1, reverse: opts.Reverse, literal: opts.Literal}\n\tvar n int\n\tif opts.Delimited && len(p.rs) > 0 {\n\t\tp.delim = p.rs[0]\n\t\tp.pos = 1\n\t}\n\tre = e0(&p)\n\tn += p.pos\n\tif re == nil {\n\t\tre = &Regexp{start: new(node), end: new(node)}\n\t\tre.start.out[0].to = re.end\n\t}\n\tre = subexpr(re, 0)\n\tre.nsub = p.nsub\n\n\tswitch p.peek() {\n\tcase cparen:\n\t\tpanic(ParseError{Position: p.pos, Message: \"unmatched ')'\"})\n\tcase cbrace:\n\t\tpanic(ParseError{Position: p.pos, Message: \"unmatched ']'\"})\n\t}\n\n\tif opts.Delimited && n < len(rs) {\n\t\tif rs[n] != rs[0] {\n\t\t\tpanic(\"stopped before closing delimiter\")\n\t\t}\n\t\tn++\n\t}\n\tre.expr = rs[:n]\n\tnumberStates(re)\n\treturn re, nil\n}", "title": "" }, { "docid": "b1f99a3041c2686790734c8bf389d7cb", "score": "0.5661718", "text": "func Compile(str string) (regexp *Regexp, error os.Error) {\n\tregexp = new(Regexp)\n\t// doParse will panic if there is a parse error.\n\tdefer func() {\n\t\tif e := recover(); e != nil {\n\t\t\tregexp = nil\n\t\t\terror = e.(Error) // Will re-panic if error was not an Error, e.g. nil-pointer exception\n\t\t}\n\t}()\n\tregexp.expr = str\n\tregexp.inst = new(vector.Vector)\n\tregexp.doParse()\n\treturn\n}", "title": "" }, { "docid": "911118b95fc9a116bfec3fe7e6987a8a", "score": "0.5647678", "text": "func (s MatchCompiler) MustCompile(parts ...string) Matcher {\n\tm, err := s.Compile(parts...)\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\treturn m\n}", "title": "" }, { "docid": "c62dcf758609f54806c1c52007b188bc", "score": "0.56369466", "text": "func newpatternCompiler(c *Compiler, v Operand) *patternCompiler {\n\treturn &patternCompiler{c, v}\n}", "title": "" }, { "docid": "41e064cbfb58ced77838857e67900f20", "score": "0.563223", "text": "func (g *group) compile() {\n\tg.compiled = newPlugins()\n\tif g.parent != nil {\n\t\t// parent exists so request copy from parent\n\t\tg.compiled.link(g.parent.compiled.deepCopy())\n\t} else if g.mux != nil {\n\t\t// no parent so must be top level group, request\n\t\t// copy from muxer\n\t\tg.compiled.link(g.mux.chain.deepCopy())\n\t}\n\tg.compiled.link(g.chain.deepCopy())\n\tg.matcher.apply(func(c compilable) {\n\t\tc.compile()\n\t})\n}", "title": "" }, { "docid": "ece3a593b544883ae0084eed859d4067", "score": "0.55927944", "text": "func CompileList(patterns []string) ([]Matcher, error) {\n\tms := []Matcher{}\n\tfor _, pattern := range patterns {\n\t\tm, err := Compile(pattern)\n\t\tif err != nil {\n\t\t\treturn nil, err\n\t\t}\n\t\tms = append(ms, m)\n\t}\n\treturn ms, nil\n}", "title": "" }, { "docid": "81011ab42b5cdff39f1da7f9738709f6", "score": "0.55858636", "text": "func (p *Parameter) Compile(d Dialect, params *Parameters) (string, error) {\n\ti := params.Add(p.Value)\n\treturn d.Parameterize(i), nil\n}", "title": "" }, { "docid": "b199625908cbfe45d844d5705d1ce7e8", "score": "0.5582411", "text": "func Compile(input []byte) ([]byte, error) {\n\tctx := NewContext()\n\treturn ctx.run(\"\", string(input))\n\n}", "title": "" }, { "docid": "c777c42c725b7ccfcbbfbda8e28c29fc", "score": "0.5552193", "text": "func (mc *MatchCompiler[T]) Compile(filter ast.FilterNode) (Matcher[T], error) {\n\t// apply compiler passes on parsed ast\n\tvar err error\n\tfilter, err = transform.ApplyAll(filter, mc.passes)\n\tif err != nil {\n\t\treturn nil, fmt.Errorf(\"applying compiler passes: %w\", err)\n\t}\n\n\t// if the root node is a void op, return an allpass\n\tif _, ok := filter.(*ast.VoidOp); ok {\n\t\treturn &AllPass[T]{}, nil\n\t}\n\n\tvar result Matcher[T]\n\tvar currentOps *util.Stack[MatcherGroup[T]] = util.NewStack[MatcherGroup[T]]()\n\n\t// handle leaf is the ast walker func. group ops get pushed onto a stack on\n\t// the Enter state, and popped on the Exit state. Any ops between Enter and\n\t// Exit are added to the group. If there are no more groups on the stack after\n\t// an Exit state, we set the result to the final group.\n\thandleLeaf := func(leaf ast.FilterNode, state ast.TraversalState) {\n\t\tswitch n := leaf.(type) {\n\t\tcase *ast.AndOp:\n\t\t\tif state == ast.TraversalStateEnter {\n\t\t\t\tcurrentOps.Push(&And[T]{})\n\t\t\t} else if state == ast.TraversalStateExit {\n\t\t\t\tif currentOps.Length() > 1 {\n\t\t\t\t\tcurrent := currentOps.Pop()\n\t\t\t\t\tcurrentOps.Top().Add(current)\n\t\t\t\t} else {\n\t\t\t\t\tresult = currentOps.Pop()\n\t\t\t\t}\n\t\t\t}\n\t\tcase *ast.OrOp:\n\t\t\tif state == ast.TraversalStateEnter {\n\t\t\t\tcurrentOps.Push(&Or[T]{})\n\t\t\t} else if state == ast.TraversalStateExit {\n\t\t\t\tif currentOps.Length() > 1 {\n\t\t\t\t\tcurrent := currentOps.Pop()\n\t\t\t\t\tcurrentOps.Top().Add(current)\n\t\t\t\t} else {\n\t\t\t\t\tresult = currentOps.Pop()\n\t\t\t\t}\n\t\t\t}\n\n\t\tcase *ast.NotOp:\n\t\t\tif state == ast.TraversalStateEnter {\n\t\t\t\tcurrentOps.Push(&Not[T]{})\n\t\t\t} else if state == ast.TraversalStateExit {\n\t\t\t\tif currentOps.Length() > 1 {\n\t\t\t\t\tcurrent := currentOps.Pop()\n\t\t\t\t\tcurrentOps.Top().Add(current)\n\t\t\t\t} else {\n\t\t\t\t\tresult = currentOps.Pop()\n\t\t\t\t}\n\t\t\t}\n\t\tcase *ast.ContradictionOp:\n\t\t\tif currentOps.Length() == 0 {\n\t\t\t\tresult = &AllCut[T]{}\n\t\t\t} else {\n\t\t\t\tcurrentOps.Top().Add(&AllCut[T]{})\n\t\t\t}\n\t\tcase *ast.EqualOp:\n\t\t\tsm := mc.stringMatcher.NewStringMatcher(n.Op(), n.Left, n.Right)\n\t\t\tif currentOps.Length() == 0 {\n\t\t\t\tresult = sm\n\t\t\t} else {\n\t\t\t\tcurrentOps.Top().Add(sm)\n\t\t\t}\n\n\t\tcase *ast.ContainsOp:\n\t\t\tf := n.Left.Field\n\t\t\tkey := n.Left.Key\n\n\t\t\tvar sm Matcher[T]\n\t\t\tif f.IsSlice() {\n\t\t\t\tsm = mc.sliceMatcher.NewStringSliceMatcher(n.Op(), n.Left, n.Right)\n\t\t\t} else if f.IsMap() && key == \"\" {\n\t\t\t\tsm = mc.mapMatcher.NewStringMapMatcher(n.Op(), n.Left, n.Right)\n\t\t\t} else {\n\t\t\t\tsm = mc.stringMatcher.NewStringMatcher(n.Op(), n.Left, n.Right)\n\t\t\t}\n\n\t\t\tif currentOps.Length() == 0 {\n\t\t\t\tresult = sm\n\t\t\t} else {\n\t\t\t\tcurrentOps.Top().Add(sm)\n\t\t\t}\n\n\t\tcase *ast.ContainsPrefixOp:\n\t\t\tf := n.Left.Field\n\t\t\tkey := n.Left.Key\n\n\t\t\tvar sm Matcher[T]\n\t\t\tif f.IsSlice() {\n\t\t\t\tsm = mc.sliceMatcher.NewStringSliceMatcher(n.Op(), n.Left, n.Right)\n\t\t\t} else if f.IsMap() && key == \"\" {\n\t\t\t\tsm = mc.mapMatcher.NewStringMapMatcher(n.Op(), n.Left, n.Right)\n\t\t\t} else {\n\t\t\t\tsm = mc.stringMatcher.NewStringMatcher(n.Op(), n.Left, n.Right)\n\t\t\t}\n\n\t\t\tif currentOps.Length() == 0 {\n\t\t\t\tresult = sm\n\t\t\t} else {\n\t\t\t\tcurrentOps.Top().Add(sm)\n\t\t\t}\n\n\t\tcase *ast.ContainsSuffixOp:\n\t\t\tf := n.Left.Field\n\t\t\tkey := n.Left.Key\n\n\t\t\tvar sm Matcher[T]\n\t\t\tif f.IsSlice() {\n\t\t\t\tsm = mc.sliceMatcher.NewStringSliceMatcher(n.Op(), n.Left, n.Right)\n\t\t\t} else if f.IsMap() && key == \"\" {\n\t\t\t\tsm = mc.mapMatcher.NewStringMapMatcher(n.Op(), n.Left, n.Right)\n\t\t\t} else {\n\t\t\t\tsm = mc.stringMatcher.NewStringMatcher(n.Op(), n.Left, n.Right)\n\t\t\t}\n\n\t\t\tif currentOps.Length() == 0 {\n\t\t\t\tresult = sm\n\t\t\t} else {\n\t\t\t\tcurrentOps.Top().Add(sm)\n\t\t\t}\n\t\t}\n\t}\n\n\tast.PreOrderTraversal(filter, handleLeaf)\n\tif result == nil {\n\t\treturn &AllPass[T]{}, nil\n\t}\n\n\treturn result, nil\n}", "title": "" }, { "docid": "1312867f10378fa2897779d60046c8b1", "score": "0.55425525", "text": "func Compile(fpath string,\n\tmroPaths []string, checkSrcPath bool) (string, []string, *Ast, error) {\n\tvar parser Parser\n\treturn parser.Compile(fpath, mroPaths, checkSrcPath)\n}", "title": "" }, { "docid": "bee14557024ef1b3c9ecbffbeb670819", "score": "0.5511636", "text": "func Compile(selector string) (cascadia.Selector, error) {\n\treturn cache.Compile(selector)\n}", "title": "" }, { "docid": "facc5d66792d1774ac5858711182cefb", "score": "0.55116004", "text": "func Compile(filepath, source string) (_ rel.Expr, err error) {\n\tdefer func() {\n\t\tif r := recover(); r != nil {\n\t\t\tif e, ok := r.(error); ok {\n\t\t\t\terr = e\n\t\t\t} else {\n\t\t\t\terr = fmt.Errorf(\"error compiling %q: %v\", filepath, r)\n\t\t\t}\n\t\t}\n\t}()\n\treturn MustCompile(filepath, source), nil\n}", "title": "" }, { "docid": "ff8b06fffbda66437c45777bce4a2a76", "score": "0.5509791", "text": "func (p *parameterizable) compileParameters(uri string, ends bool, regexCache map[string]*regexp.Regexp) {\n\tidxs, err := p.braceIndices(uri)\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\n\tvar builder strings.Builder\n\n\t// Final regex will never be larger than src uri + 2 (for ^ and $)\n\t// Make initial alloc to avoid the need for realloc\n\tbuilder.Grow(len(uri) + 2)\n\n\tbuilder.WriteString(\"^\")\n\tlength := len(idxs)\n\tif length > 0 {\n\t\tend := 0\n\t\tfor i := 0; i < length; i += 2 {\n\t\t\traw := uri[end:idxs[i]]\n\t\t\tend = idxs[i+1]\n\t\t\tsub := uri[idxs[i]+1 : end]\n\t\t\tparts := strings.SplitN(sub, \":\", 2)\n\t\t\tif parts[0] == \"\" {\n\t\t\t\tpanic(fmt.Errorf(\"invalid route parameter, missing name in %q\", sub))\n\t\t\t}\n\t\t\tpattern := \"[^/]+\" // default pattern\n\t\t\tif len(parts) == 2 {\n\t\t\t\tpattern = parts[1]\n\t\t\t\tif pattern == \"\" {\n\t\t\t\t\tpanic(fmt.Errorf(\"invalid route parameter, missing pattern in %q\", sub))\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tbuilder.WriteString(raw)\n\t\t\tbuilder.WriteString(\"(\")\n\t\t\tbuilder.WriteString(pattern)\n\t\t\tbuilder.WriteString(\")\")\n\t\t\tend++ // Skip closing braces\n\t\t\tp.parameters = append(p.parameters, parts[0])\n\t\t}\n\t\tbuilder.WriteString(uri[end:])\n\t} else {\n\t\tbuilder.WriteString(uri)\n\t}\n\n\tif ends {\n\t\tbuilder.WriteString(\"$\")\n\t}\n\n\tpattern := builder.String()\n\tcachedRegex, ok := regexCache[pattern]\n\tif !ok {\n\t\tregex := regexp.MustCompile(pattern)\n\t\tregexCache[pattern] = regex\n\t\tp.regex = regex\n\t} else {\n\t\tp.regex = cachedRegex\n\t}\n\n\tif p.regex.NumSubexp() != length/2 {\n\t\tpanic(fmt.Sprintf(\"route %s contains capture groups in its regexp. \", uri) +\n\t\t\t\"Only non-capturing groups are accepted: e.g. (?:pattern) instead of (pattern)\")\n\t}\n}", "title": "" }, { "docid": "33d9c6cf7e5a9480842303ad532a97da", "score": "0.54611236", "text": "func Compile(content []byte) string {\n\treturn \"\"\n}", "title": "" }, { "docid": "2450733fac2faf0c361a351c4c0bd6a9", "score": "0.54104257", "text": "func (c *Compiler) Compile(s string) string {\n\tif c.Markdown == nil {\n\t\tc.Markdown = blackfriday.New(blackfriday.WithExtensions(blackfriday.CommonExtensions))\n\t}\n\n\tif c.Columns == 0 {\n\t\tc.Columns = 90\n\t}\n\n\tif c.SyntaxHighlighter == nil {\n\t\tc.SyntaxHighlighter = SyntaxTheme{}\n\t}\n\n\tn := c.Markdown.Parse([]byte(s))\n\treturn c.visit(n)\n}", "title": "" }, { "docid": "da5f9c625e7c27774746665cc4e00315", "score": "0.5404768", "text": "func (j *JadeCompilerType) CompileAll(srcPaths []string) error {\n\tlog.Default.Println(\"Compiling jade...\")\n\tfor _, srcPath := range srcPaths {\n\t\tif err := j.Compile(srcPath); err != nil {\n\t\t\treturn err\n\t\t}\n\t}\n\treturn nil\n}", "title": "" }, { "docid": "1bdeac51963e793546a552ef78675b65", "score": "0.5364793", "text": "func Compile(jsonPath string) (*Compiled, error) {\n\tsource := spec.JsonType_RAW_REQUEST\n\tmatch := sourceJsonPattern.FindString(jsonPath)\n\tif match != \"\" {\n\t\tif match == ModelResponsePrefix {\n\t\t\tsource = spec.JsonType_MODEL_RESPONSE\n\t\t}\n\n\t\tjsonPath = sourceJsonPattern.ReplaceAllString(jsonPath, \"$\")\n\t}\n\n\tcompiledJsonpath, err := jsonpath.Compile(jsonPath)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\treturn &Compiled{\n\t\tcpl: compiledJsonpath,\n\t\tsource: source,\n\t}, nil\n}", "title": "" }, { "docid": "3fe3d2919f9c14cddc9ba975fb1f8068", "score": "0.53193206", "text": "func MustCompile(expr string) RegExp {\n\tr, err := newLibPcreRegexp(expr)\n\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\treturn r\n}", "title": "" }, { "docid": "ac6695767eaf05f7f8bbf227baf594c6", "score": "0.5277155", "text": "func DefPattern(patterns ...Pattern) PatternMatching {\n\treturn PatternMatching{patterns: patterns}\n}", "title": "" }, { "docid": "fd9fb3fd4f91781719cbb5245236543e", "score": "0.5260397", "text": "func (c *Cache) Compile(selector string) (cascadia.Selector, error) {\n\tif s, ok := c.m.Load(selector); ok {\n\t\treturn s.(cascadia.Selector), nil\n\t}\n\n\tv, err := cascadia.Compile(selector)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\tc.m.Store(selector, v)\n\treturn v, nil\n}", "title": "" }, { "docid": "86b99d91a14262d7045d43297d82af49", "score": "0.5252568", "text": "func MustCompile(dictionary [][]byte) *Matcher {\n\tm, err := Compile(dictionary)\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\treturn m\n}", "title": "" }, { "docid": "c3c07b203621d9409d8d00b299956b19", "score": "0.5247939", "text": "func compileRegexps(regexpStrings []string) ([]*regexp.Regexp, error) {\n\tregexps := []*regexp.Regexp{}\n\tfor _, regexpStr := range regexpStrings {\n\t\tr, err := regexp.Compile(regexpStr)\n\t\tif err != nil {\n\t\t\treturn []*regexp.Regexp{}, err\n\t\t}\n\t\tregexps = append(regexps, r)\n\t}\n\treturn regexps, nil\n}", "title": "" }, { "docid": "ae4ba7b400c20d909c634b5c50e8cf23", "score": "0.52383566", "text": "func Compile(src string) error {\n\treturn smartVM.Compile([]rune(src))\n}", "title": "" }, { "docid": "480fcf8d0d170f3769c724a7536f6a6e", "score": "0.5234871", "text": "func CompileWithSeparator(pattern string, separator rune) (Matcher, error) {\n\n\tif pattern == \"\" {\n\t\treturn nil, errEmptyPattern\n\t}\n\n\tif !PrefixCheck(pattern) {\n\t\treturn nil, errInvalidPrefix\n\t}\n\n\tif InnerDoubleStar(pattern) {\n\t\treturn nil, errInvalidDoubleWildcard\n\t}\n\n\tsegments := GetSegmentsFromURI(pattern, defaultSeparator)\n\t// Check for malformed URI\n\tfor i, _ := range segments {\n\t\t// \"**\" Embedded in a segment\n\t\tif len(segments[i]) > 2 && strings.Contains(segments[i], \"**\") {\n\t\t\treturn nil, errInvalidDoubleWildcard\n\t\t\t// \"*\" Embedded in a segment - other than \"**\"\n\t\t} else if len(segments[i]) > 1 && segments[i] != \"**\" && strings.Contains(segments[i], \"*\") {\n\t\t\treturn nil, errInvalidWildcard\n\t\t}\n\t\t// Empty segment, e.g.: \"//\"\n\t\tif len(segments[i]) == 0 {\n\t\t\treturn nil, errInvalidSegment\n\t\t}\n\t}\n\n\treturn splitMatcher{\n\t\tsegments: segments,\n\t}, nil\n}", "title": "" }, { "docid": "04bdaf343fdf5f67aa9ba27bedd5010b", "score": "0.522373", "text": "func compileRegexp(reg, str string) bool {\n\treturn regexp.MustCompile(reg).Match([]byte(str))\n}", "title": "" }, { "docid": "9072f3000f412bff47970a19e85b7f53", "score": "0.51884776", "text": "func (r *RegexLexer) maybeCompile() (err error) {\n\tr.mu.Lock()\n\tdefer r.mu.Unlock()\n\tif r.compiled {\n\t\treturn nil\n\t}\n\tfor state, rules := range r.rules {\n\t\tfor i, rule := range rules {\n\t\t\tif rule.Regexp == nil {\n\t\t\t\trule.Regexp, err = regexp2.Compile(\"^(?\"+rule.flags+\")(?:\"+rule.Pattern+\")\", 0)\n\t\t\t\tif err != nil {\n\t\t\t\t\treturn fmt.Errorf(\"failed to compile rule %s.%d: %s\", state, i, err)\n\t\t\t\t}\n\t\t\t}\n\t\t\trules[i] = rule\n\t\t}\n\t}\n\tr.compiled = true\n\treturn nil\n}", "title": "" }, { "docid": "4c5d72468238e8e024b767c29d33522b", "score": "0.5188108", "text": "func (d FlagSplitterDef) Compile() FlagSplitter {\n\t// Compile our total flag set into a quick lookup map.\n\tfs := make(FlagSplitter, len(d.Solitary)+len(d.WithArg)+len(d.WithArgAllowConjoined))\n\tfs.registerFlags(d.Solitary, flagSplitterFlag{NumArgs: 0, AllowConjoined: false})\n\tfs.registerFlags(d.SolitaryAllowConjoined, flagSplitterFlag{NumArgs: 0, AllowConjoined: true})\n\tfs.registerFlags(d.WithArg, flagSplitterFlag{NumArgs: 1, AllowConjoined: false})\n\tfs.registerFlags(d.WithArgAllowConjoined, flagSplitterFlag{NumArgs: 1, AllowConjoined: true})\n\treturn fs\n}", "title": "" }, { "docid": "d142fe5ee97879f212057104e10e5eff", "score": "0.5179154", "text": "func (c *Compiler) Compile(source []byte) (*Closure, error) {\n\n\t// compile source code into a closure\n\tc_source := C.CString(string(source))\n\tmain_closure := C.gravity_compiler_run(c.cGravityCompiler, c_source, C.size_t(len(source)), 0, true)\n\tC.free(unsafe.Pointer(c_source))\n\n\tif main_closure == nil {\n\t\treturn nil, errors.New(\"compiler error occurred\")\n\t}\n\n\treturn &Closure{cGravityClosure: main_closure}, nil\n\n}", "title": "" }, { "docid": "44da5adbda3a0a767ae5b295f44f9de1", "score": "0.5178839", "text": "func (l *Limiter) Compile(\n\tlimit int,\n\tduration time.Duration,\n\tlimitType LimitType,\n\tuseThrottle bool,\n\tgetRedis RedisGetter,\n) func(next http.HandlerFunc) http.HandlerFunc {\n\treturn func(next http.HandlerFunc) http.HandlerFunc {\n\t\treturn func(w http.ResponseWriter, r *http.Request) {\n\t\t\tvar err error\n\t\t\tvar allowed bool\n\n\t\t\tif useThrottle {\n\t\t\t\tendpoint := r.URL.Path\n\t\t\t\tip := l.getIP(r)\n\t\t\t\trds := getRedis()\n\n\t\t\t\tif IP == limitType {\n\t\t\t\t\tallowed, err = l.hit(rds, fmt.Sprintf(\"%s:%s\", l.Prefix, ip), limit, duration)\n\t\t\t\t} else if ENDPOINT == limitType {\n\t\t\t\t\tallowed, err = l.hit(rds, fmt.Sprintf(\"%s:%s\", l.Prefix, endpoint), limit, duration)\n\t\t\t\t} else if IP_ENDPOINT == limitType {\n\t\t\t\t\tallowed, err = l.hit(rds, fmt.Sprintf(\"%s:%s:%s\", l.Prefix, ip, endpoint), limit, duration)\n\t\t\t\t}\n\n\t\t\t\tif nil != err {\n\t\t\t\t\tresponse.Error(w, err)\n\t\t\t\t\treturn\n\t\t\t\t}\n\n\t\t\t\tif !allowed {\n\t\t\t\t\tresponse.Error(w, httpError.TooManyRequest(\"rate limit reached\"))\n\t\t\t\t\treturn\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tnext(w, r)\n\t\t}\n\t}\n}", "title": "" }, { "docid": "19ea4774dc85579ddecd4ebcb9748f4c", "score": "0.51398414", "text": "func (p *Parameter) Compile(d dialect.Dialect, ps *Parameters) (string, error) {\n\tps.Add(p.Value)\n\treturn d.Param(ps.Len() - 1), nil\n}", "title": "" }, { "docid": "4c2dd7e6f85ace1a480b73fa2efff781", "score": "0.51362014", "text": "func (parser *Parser) Compile(fpath string,\n\tmroPaths []string, checkSrcPath bool) (string, []string, *Ast, error) {\n\tif data, err := ioutil.ReadFile(fpath); err != nil {\n\t\treturn \"\", nil, nil, err\n\t} else {\n\t\treturn parser.ParseSourceBytes(data, fpath, mroPaths, checkSrcPath)\n\t}\n}", "title": "" }, { "docid": "c0515605305db9121f1ae6b522d15a6e", "score": "0.5123704", "text": "func (request *Request) Compile(options *protocols.ExecutorOptions) error {\n\tfor _, operator := range options.Operators {\n\t\tif err := operator.Compile(); err != nil {\n\t\t\treturn errors.Wrap(err, \"could not compile operators\")\n\t\t}\n\t\trequest.compiledOperators = append(request.compiledOperators, operator)\n\t}\n\trequest.options = options\n\treturn nil\n}", "title": "" }, { "docid": "32f9701b57791064338e360ddd30bf4a", "score": "0.5113549", "text": "func compile(path string) (newPath string, vars map[string]int) {\n\tpath = strings2.TrimAfter(path, \"?\")\n\tl := len(path)\n\n\tif path[0] != '/' {\n\t\tlog.Panicln(\"Invalid pattern, must start with '/': \" + path)\n\t}\n\n\tif l != 1 && path[l-1] == '/' {\n\t\tpath = path[:l-1]\n\t}\n\n\tsections := strings.Split(path[1:], \"/\")\n\tnew := make([]byte, 0, len(path))\n\tvarIndex := 0\n\n\tfor _, s := range sections {\n\t\tnew = append(new, '/')\n\t\tlast := len(s)\n\t\ti := last - 1\n\n\t\tvar c byte\n\t\tfor ; i >= 0; i-- {\n\t\t\tif s[i] == _MATCH_WILDCARD {\n\t\t\t\tc = _WILDCARD\n\t\t\t} else if s[i] == _MATCH_REMAINSALL {\n\t\t\t\tc = _REMAINSALL\n\t\t\t} else {\n\t\t\t\tcontinue\n\t\t\t}\n\n\t\t\tif name := s[i+1:]; len(name) > 0 {\n\t\t\t\tif isInvalidSection(name) {\n\t\t\t\t\tlog.Panicf(\"path %s has pre-defined characters %c or %c\\n\",\n\t\t\t\t\t\tpath, _WILDCARD, _REMAINSALL)\n\t\t\t\t}\n\t\t\t\tif vars == nil {\n\t\t\t\t\tvars = make(map[string]int)\n\t\t\t\t}\n\t\t\t\tvars[name] = varIndex\n\t\t\t}\n\n\t\t\tvarIndex++\n\t\t\tlast = i\n\t\t\tbreak\n\t\t}\n\n\t\tif last != 0 {\n\t\t\tnew = append(new, []byte(s[:last])...)\n\t\t}\n\t\tif c != 0 {\n\t\t\tnew = append(new, c)\n\t\t}\n\t}\n\n\tnewPath = string(new)\n\tif vars == nil {\n\t\tvars = emptyVars\n\t}\n\n\treturn\n}", "title": "" }, { "docid": "4dfb42da8fcfbcdd5afc41f21055d914", "score": "0.5108236", "text": "func MustCompile(str string) Regexps {\n\treg, err := Compile(str)\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\treturn reg\n}", "title": "" }, { "docid": "efecda233183d21249e446b99304d002", "score": "0.5093111", "text": "func Compile(text string) (Expression, error) {\n\ttokens, err := tokenize(text)\n\tif err != nil {\n\t\treturn nil, fmt.Errorf(\"tokenizer error: %s\", err)\n\t}\n\texpr, pos, _, err := parse(tokens, 0) // we can drop finish-flag, err is enough\n\tif err != nil {\n\t\treturn nil, fmt.Errorf(\"parser error: %s\", err)\n\t}\n\tif pos < len(tokens) {\n\t\treturn nil, fmt.Errorf(\"extra content after token %s\", tokens[pos])\n\t}\n\treturn expr, nil\n}", "title": "" }, { "docid": "92b8181f1495c11b6337f364925e434e", "score": "0.50619346", "text": "func (vs *Values) Compile(layout *Template) (compiled string, err error) {\n\tif c, ok := layout.Read(vs); ok {\n\t\treturn c, nil\n\t}\n\n\tl := len(vs.Values)\n\tif l > 0 {\n\t\tchunks := make([]string, 0, l)\n\t\tfor i := 0; i < l; i++ {\n\t\t\tchunk, err := vs.Values[i].Compile(layout)\n\t\t\tif err != nil {\n\t\t\t\treturn \"\", err\n\t\t\t}\n\t\t\tchunks = append(chunks, chunk)\n\t\t}\n\t\tcompiled = layout.MustCompile(layout.ClauseGroup, strings.Join(chunks, layout.ValueSeparator))\n\t}\n\tlayout.Write(vs, compiled)\n\treturn\n}", "title": "" }, { "docid": "8446ecd1cd4d345ecb968400224d9110", "score": "0.5051064", "text": "func MustCompile(str string) Regexp {\n\tr, err := Compile(str)\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\treturn r\n}", "title": "" }, { "docid": "27d645a9e00883f2781162bd6fafc768", "score": "0.5047789", "text": "func (rt *Route) Compile(req *http.Request, p string) error {\n\tf, err := os.Create(fmt.Sprintf(\"%s%s\", p, rt.Path))\n\tif err != nil {\n\t\treturn err\n\t}\n\tdefer f.Close()\n\tw := bufio.NewWriter(f)\n\t_, err = w.Write(rt.StaticHandlerFunc(req))\n\tif err != nil {\n\t\treturn err\n\t}\n\tw.Flush()\n\treturn nil\n}", "title": "" }, { "docid": "81c1689c18a0b824c4557d714800b936", "score": "0.50172436", "text": "func compileExpr(i *tokenizer.Item, c compileCtx) (phpv.Runnable, error) {\n\tres, err := compileOneExpr(i, c)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\tfor {\n\t\tsr, err := compilePostExpr(res, nil, c)\n\t\tif err != nil {\n\t\t\treturn nil, err\n\t\t}\n\t\tif sr == nil {\n\t\t\treturn res, nil\n\t\t}\n\t\tres = sr\n\t}\n}", "title": "" }, { "docid": "0e59b91bb66e9f75c6ca2b778d11ee63", "score": "0.500968", "text": "func (c *Compiler) Compile(node ast.Node) error {\n\tif c.trace != nil {\n\t\tif node != nil {\n\t\t\tdefer un(trace(c, fmt.Sprintf(\"%s (%s)\", node.String(), reflect.TypeOf(node).Elem().Name())))\n\t\t} else {\n\t\t\tdefer un(trace(c, \"<nil>\"))\n\t\t}\n\t}\n\n\tswitch node := node.(type) {\n\tcase *ast.File:\n\t\tfor _, stmt := range node.Stmts {\n\t\t\tif err := c.Compile(stmt); err != nil {\n\t\t\t\treturn err\n\t\t\t}\n\t\t}\n\n\tcase *ast.ExprStmt:\n\t\tif err := c.Compile(node.Expr); err != nil {\n\t\t\treturn err\n\t\t}\n\t\tc.emit(OpPop)\n\n\tcase *ast.IncDecStmt:\n\t\top := token.AddAssign\n\t\tif node.Token == token.Dec {\n\t\t\top = token.SubAssign\n\t\t}\n\n\t\treturn c.compileAssign([]ast.Expr{node.Expr}, []ast.Expr{&ast.IntLit{Value: 1}}, op)\n\n\tcase *ast.ParenExpr:\n\t\tif err := c.Compile(node.Expr); err != nil {\n\t\t\treturn err\n\t\t}\n\n\tcase *ast.BinaryExpr:\n\t\tif node.Token == token.LAnd || node.Token == token.LOr {\n\t\t\treturn c.compileLogical(node)\n\t\t}\n\n\t\tif node.Token == token.Less {\n\t\t\tif err := c.Compile(node.RHS); err != nil {\n\t\t\t\treturn err\n\t\t\t}\n\n\t\t\tif err := c.Compile(node.LHS); err != nil {\n\t\t\t\treturn err\n\t\t\t}\n\n\t\t\tc.emit(OpGreaterThan)\n\n\t\t\treturn nil\n\t\t} else if node.Token == token.LessEq {\n\t\t\tif err := c.Compile(node.RHS); err != nil {\n\t\t\t\treturn err\n\t\t\t}\n\t\t\tif err := c.Compile(node.LHS); err != nil {\n\t\t\t\treturn err\n\t\t\t}\n\n\t\t\tc.emit(OpGreaterThanEqual)\n\n\t\t\treturn nil\n\t\t}\n\n\t\tif err := c.Compile(node.LHS); err != nil {\n\t\t\treturn err\n\t\t}\n\t\tif err := c.Compile(node.RHS); err != nil {\n\t\t\treturn err\n\t\t}\n\n\t\tswitch node.Token {\n\t\tcase token.Add:\n\t\t\tc.emit(OpAdd)\n\t\tcase token.Sub:\n\t\t\tc.emit(OpSub)\n\t\tcase token.Mul:\n\t\t\tc.emit(OpMul)\n\t\tcase token.Quo:\n\t\t\tc.emit(OpDiv)\n\t\tcase token.Rem:\n\t\t\tc.emit(OpRem)\n\t\tcase token.Greater:\n\t\t\tc.emit(OpGreaterThan)\n\t\tcase token.GreaterEq:\n\t\t\tc.emit(OpGreaterThanEqual)\n\t\tcase token.Equal:\n\t\t\tc.emit(OpEqual)\n\t\tcase token.NotEqual:\n\t\t\tc.emit(OpNotEqual)\n\t\tcase token.And:\n\t\t\tc.emit(OpBAnd)\n\t\tcase token.Or:\n\t\t\tc.emit(OpBOr)\n\t\tcase token.Xor:\n\t\t\tc.emit(OpBXor)\n\t\tcase token.AndNot:\n\t\t\tc.emit(OpBAndNot)\n\t\tcase token.Shl:\n\t\t\tc.emit(OpBShiftLeft)\n\t\tcase token.Shr:\n\t\t\tc.emit(OpBShiftRight)\n\t\tdefault:\n\t\t\treturn fmt.Errorf(\"unknown operator: %s\", node.Token.String())\n\t\t}\n\n\tcase *ast.IntLit:\n\t\tc.emit(OpConstant, c.addConstant(&objects.Int{Value: node.Value}))\n\n\tcase *ast.FloatLit:\n\t\tc.emit(OpConstant, c.addConstant(&objects.Float{Value: node.Value}))\n\n\tcase *ast.BoolLit:\n\t\tif node.Value {\n\t\t\tc.emit(OpTrue)\n\t\t} else {\n\t\t\tc.emit(OpFalse)\n\t\t}\n\n\tcase *ast.StringLit:\n\t\tc.emit(OpConstant, c.addConstant(&objects.String{Value: node.Value}))\n\n\tcase *ast.CharLit:\n\t\tc.emit(OpConstant, c.addConstant(&objects.Char{Value: node.Value}))\n\n\tcase *ast.UndefinedLit:\n\t\tc.emit(OpNull)\n\n\tcase *ast.UnaryExpr:\n\t\tif err := c.Compile(node.Expr); err != nil {\n\t\t\treturn err\n\t\t}\n\n\t\tswitch node.Token {\n\t\tcase token.Not:\n\t\t\tc.emit(OpLNot)\n\t\tcase token.Sub:\n\t\t\tc.emit(OpMinus)\n\t\tcase token.Xor:\n\t\t\tc.emit(OpBComplement)\n\t\tcase token.Add:\n\t\t\t// do nothing?\n\t\tdefault:\n\t\t\treturn fmt.Errorf(\"unknown operator: %s\", node.Token.String())\n\t\t}\n\n\tcase *ast.IfStmt:\n\t\t// open new symbol table for the statement\n\t\tc.symbolTable = c.symbolTable.Fork(true)\n\t\tdefer func() {\n\t\t\tc.symbolTable = c.symbolTable.Parent(false)\n\t\t}()\n\n\t\tif node.Init != nil {\n\t\t\tif err := c.Compile(node.Init); err != nil {\n\t\t\t\treturn err\n\t\t\t}\n\t\t}\n\n\t\tif err := c.Compile(node.Cond); err != nil {\n\t\t\treturn err\n\t\t}\n\n\t\t// first jump placeholder\n\t\tjumpPos1 := c.emit(OpJumpFalsy, 0)\n\n\t\tif err := c.Compile(node.Body); err != nil {\n\t\t\treturn err\n\t\t}\n\n\t\tif node.Else != nil {\n\t\t\t// second jump placeholder\n\t\t\tjumpPos2 := c.emit(OpJump, 0)\n\n\t\t\t// update first jump offset\n\t\t\tcurPos := len(c.currentInstructions())\n\t\t\tc.changeOperand(jumpPos1, curPos)\n\n\t\t\tif err := c.Compile(node.Else); err != nil {\n\t\t\t\treturn err\n\t\t\t}\n\n\t\t\t// update second jump offset\n\t\t\tcurPos = len(c.currentInstructions())\n\t\t\tc.changeOperand(jumpPos2, curPos)\n\t\t} else {\n\t\t\t// update first jump offset\n\t\t\tcurPos := len(c.currentInstructions())\n\t\t\tc.changeOperand(jumpPos1, curPos)\n\t\t}\n\n\tcase *ast.ForStmt:\n\t\treturn c.compileForStmt(node)\n\n\tcase *ast.ForInStmt:\n\t\treturn c.compileForInStmt(node)\n\n\tcase *ast.BranchStmt:\n\t\tif node.Token == token.Break {\n\t\t\tcurLoop := c.currentLoop()\n\t\t\tif curLoop == nil {\n\t\t\t\treturn fmt.Errorf(\"break statement outside loop\")\n\t\t\t}\n\t\t\tpos := c.emit(OpJump, 0)\n\t\t\tcurLoop.Breaks = append(curLoop.Breaks, pos)\n\t\t} else if node.Token == token.Continue {\n\t\t\tcurLoop := c.currentLoop()\n\t\t\tif curLoop == nil {\n\t\t\t\treturn fmt.Errorf(\"continue statement outside loop\")\n\t\t\t}\n\t\t\tpos := c.emit(OpJump, 0)\n\t\t\tcurLoop.Continues = append(curLoop.Continues, pos)\n\t\t} else {\n\t\t\treturn fmt.Errorf(\"unknown branch statement: %s\", node.Token.String())\n\t\t}\n\n\tcase *ast.BlockStmt:\n\t\tfor _, stmt := range node.Stmts {\n\t\t\tif err := c.Compile(stmt); err != nil {\n\t\t\t\treturn err\n\t\t\t}\n\t\t}\n\n\tcase *ast.AssignStmt:\n\t\tif err := c.compileAssign(node.LHS, node.RHS, node.Token); err != nil {\n\t\t\treturn err\n\t\t}\n\n\tcase *ast.Ident:\n\t\tsymbol, _, ok := c.symbolTable.Resolve(node.Name)\n\t\tif !ok {\n\t\t\treturn fmt.Errorf(\"undefined variable: %s\", node.Name)\n\t\t}\n\n\t\tswitch symbol.Scope {\n\t\tcase ScopeGlobal:\n\t\t\tc.emit(OpGetGlobal, symbol.Index)\n\t\tcase ScopeLocal:\n\t\t\tc.emit(OpGetLocal, symbol.Index)\n\t\tcase ScopeBuiltin:\n\t\t\tc.emit(OpGetBuiltin, symbol.Index)\n\t\tcase ScopeFree:\n\t\t\tc.emit(OpGetFree, symbol.Index)\n\t\t}\n\n\tcase *ast.ArrayLit:\n\t\tfor _, elem := range node.Elements {\n\t\t\tif err := c.Compile(elem); err != nil {\n\t\t\t\treturn err\n\t\t\t}\n\t\t}\n\n\t\tc.emit(OpArray, len(node.Elements))\n\n\tcase *ast.MapLit:\n\t\tfor _, elt := range node.Elements {\n\t\t\t// key\n\t\t\tc.emit(OpConstant, c.addConstant(&objects.String{Value: elt.Key}))\n\n\t\t\t// value\n\t\t\tif err := c.Compile(elt.Value); err != nil {\n\t\t\t\treturn err\n\t\t\t}\n\t\t}\n\n\t\tc.emit(OpMap, len(node.Elements)*2)\n\n\tcase *ast.SelectorExpr: // selector on RHS side\n\t\tif err := c.Compile(node.Expr); err != nil {\n\t\t\treturn err\n\t\t}\n\n\t\tif err := c.Compile(node.Sel); err != nil {\n\t\t\treturn err\n\t\t}\n\n\t\tc.emit(OpIndex)\n\n\tcase *ast.IndexExpr:\n\t\tif err := c.Compile(node.Expr); err != nil {\n\t\t\treturn err\n\t\t}\n\n\t\tif err := c.Compile(node.Index); err != nil {\n\t\t\treturn err\n\t\t}\n\n\t\tc.emit(OpIndex)\n\n\tcase *ast.SliceExpr:\n\t\tif err := c.Compile(node.Expr); err != nil {\n\t\t\treturn err\n\t\t}\n\n\t\tif node.Low != nil {\n\t\t\tif err := c.Compile(node.Low); err != nil {\n\t\t\t\treturn err\n\t\t\t}\n\t\t} else {\n\t\t\tc.emit(OpNull)\n\t\t}\n\n\t\tif node.High != nil {\n\t\t\tif err := c.Compile(node.High); err != nil {\n\t\t\t\treturn err\n\t\t\t}\n\t\t} else {\n\t\t\tc.emit(OpNull)\n\t\t}\n\n\t\tc.emit(OpSliceIndex)\n\n\tcase *ast.FuncLit:\n\t\tc.enterScope()\n\n\t\tfor _, p := range node.Type.Params.List {\n\t\t\tc.symbolTable.Define(p.Name)\n\t\t}\n\n\t\tif err := c.Compile(node.Body); err != nil {\n\t\t\treturn err\n\t\t}\n\n\t\t// add OpReturn if function returns nothing\n\t\tif !c.lastInstructionIs(OpReturnValue) && !c.lastInstructionIs(OpReturn) {\n\t\t\tc.emit(OpReturn)\n\t\t}\n\n\t\tfreeSymbols := c.symbolTable.FreeSymbols()\n\t\tnumLocals := c.symbolTable.MaxSymbols()\n\t\tinstructions := c.leaveScope()\n\n\t\tfor _, s := range freeSymbols {\n\t\t\tswitch s.Scope {\n\t\t\tcase ScopeLocal:\n\t\t\t\tc.emit(OpGetLocal, s.Index)\n\t\t\tcase ScopeFree:\n\t\t\t\tc.emit(OpGetFree, s.Index)\n\t\t\t}\n\t\t}\n\n\t\tcompiledFunction := &objects.CompiledFunction{\n\t\t\tInstructions: instructions,\n\t\t\tNumLocals: numLocals,\n\t\t\tNumParameters: len(node.Type.Params.List),\n\t\t}\n\n\t\tif len(freeSymbols) > 0 {\n\t\t\tc.emit(OpClosure, c.addConstant(compiledFunction), len(freeSymbols))\n\t\t} else {\n\t\t\tc.emit(OpConstant, c.addConstant(compiledFunction))\n\t\t}\n\n\tcase *ast.ReturnStmt:\n\t\tif c.symbolTable.Parent(true) == nil {\n\t\t\t// outside the function\n\t\t\treturn fmt.Errorf(\"return statement outside function\")\n\t\t}\n\n\t\tswitch len(node.Results) {\n\t\tcase 0:\n\t\t\tc.emit(OpReturn)\n\t\tcase 1:\n\t\t\tif err := c.Compile(node.Results[0]); err != nil {\n\t\t\t\treturn err\n\t\t\t}\n\n\t\t\tc.emit(OpReturnValue, 1)\n\t\tdefault:\n\t\t\treturn fmt.Errorf(\"multi-value return not implemented\")\n\t\t}\n\n\tcase *ast.CallExpr:\n\t\tif err := c.Compile(node.Func); err != nil {\n\t\t\treturn err\n\t\t}\n\n\t\tfor _, arg := range node.Args {\n\t\t\tif err := c.Compile(arg); err != nil {\n\t\t\t\treturn err\n\t\t\t}\n\t\t}\n\n\t\tc.emit(OpCall, len(node.Args))\n\n\tcase *ast.ImportExpr:\n\t\tstdMod, ok := c.stdModules[node.ModuleName]\n\t\tif ok {\n\t\t\t// standard modules contain only globals with no code.\n\t\t\t// so no need to compile anything\n\t\t\tc.emit(OpConstant, c.addConstant(stdMod))\n\t\t} else {\n\t\t\tuserMod, err := c.compileModule(node.ModuleName)\n\t\t\tif err != nil {\n\t\t\t\treturn err\n\t\t\t}\n\n\t\t\tc.emit(OpModule, c.addConstant(userMod))\n\t\t}\n\n\tcase *ast.ErrorExpr:\n\t\tif err := c.Compile(node.Expr); err != nil {\n\t\t\treturn err\n\t\t}\n\n\t\tc.emit(OpError)\n\t}\n\n\treturn nil\n}", "title": "" }, { "docid": "9e85e5f4bc54797d684d624d08a18801", "score": "0.5002426", "text": "func MustCompile(pattern string) *Regex {\n\tre, err := Compile(pattern)\n\tif err != nil {\n\t\tpanic(fmt.Sprintf(\"regex.MustCompile failed on %s: %s\", pattern, err))\n\t}\n\treturn re\n}", "title": "" }, { "docid": "90119e9bda377a1a976814216ca25355", "score": "0.4991549", "text": "func CompileSelector(dmt datamodel.Node) (Selector, error) {\n\treturn ParseContext{}.ParseSelector(dmt)\n}", "title": "" }, { "docid": "69f0ebbf1b8d75000fdb170d2c74d37f", "score": "0.49829993", "text": "func (c *NamespaceConfig) MustCompile() {\n\terr := c.Compile()\n\tif err != nil {\n\t\tpanic(err)\n\t}\n}", "title": "" }, { "docid": "1256f0c704a0c4e5834878c568bbfbfc", "score": "0.4980802", "text": "func (t *Template) ParseGlob(pattern string) (*Template, error) {}", "title": "" }, { "docid": "0da4c3995e48653c1e7faaf062e41939", "score": "0.49747476", "text": "func ExtractCompiled(re *regexp.Regexp, corpus string) (matches []string) {\n\tresultSets := re.FindAllStringSubmatch(corpus, -1)\n\tfor _, resultSet := range resultSets {\n\t\tfor _, result := range resultSet {\n\t\t\tmatches = append(matches, result)\n\t\t}\n\t}\n\n\treturn\n}", "title": "" }, { "docid": "198e2947859401444fd445f73319b4e2", "score": "0.49513435", "text": "func wildCardToRegexp(pattern string) string {\n\tvar result strings.Builder\n\tfor i, literal := range strings.Split(pattern, \"*\") {\n\n\t\t// Replace * with .*\n\t\tif i > 0 {\n\t\t\tresult.WriteString(\".*\")\n\t\t}\n\n\t\t// Quote any regular expression meta characters in the\n\t\t// literal text.\n\t\tresult.WriteString(regexp.QuoteMeta(literal))\n\t}\n\treturn result.String()\n}", "title": "" }, { "docid": "288510412abc40f48f8a7f78a26b8f36", "score": "0.49418932", "text": "func ParseGlob(pattern string) (*template.Template, error)", "title": "" }, { "docid": "1982457945fafc2ca5b98cfb37c0e5e0", "score": "0.49416283", "text": "func parsePattern(pat string) (*regexp.Regexp, error) {\n\treturn regexp.Compile(pat)\n}", "title": "" }, { "docid": "e27da301ff42e2c0c74a042a1cf1ef18", "score": "0.49384305", "text": "func Compile(path string) {\n\tpath = filepath.Clean(path)\n\tfileInfo, err := os.Stat(path)\n\tif err != nil {\n\t\tlog.Fatal(err)\n\t}\n\tif fileInfo.IsDir() {\n\t\tvar jackFiles []string\n\t\terr := filepath.Walk(path, getJackFiles(&jackFiles))\n\t\tif err != nil {\n\t\t\tlog.Fatal(err)\n\t\t}\n\n\t\tfor _, path = range jackFiles {\n\t\t\tcompileFile(path)\n\t\t}\n\t} else {\n\t\tcompileFile(path)\n\t}\n}", "title": "" }, { "docid": "d00062d4c078e78ca244833abb982a29", "score": "0.49377108", "text": "func (request *Request) Compile(options *protocols.ExecutorOptions) error {\n\trequest.options = options\n\n\tclient, err := networkclientpool.Get(options.Options, &networkclientpool.Configuration{})\n\tif err != nil {\n\t\treturn errors.Wrap(err, \"could not get network client\")\n\t}\n\trequest.dialer = client\n\n\tif len(request.Payloads) > 0 {\n\t\trequest.generator, err = generators.New(request.Payloads, request.AttackType.Value, request.options.TemplatePath, request.options.Options.AllowLocalFileAccess, options.Catalog, options.Options.AttackType)\n\t\tif err != nil {\n\t\t\treturn errors.Wrap(err, \"could not parse payloads\")\n\t\t}\n\t}\n\n\tif len(request.Matchers) > 0 || len(request.Extractors) > 0 {\n\t\tcompiled := &request.Operators\n\t\tcompiled.ExcludeMatchers = options.ExcludeMatchers\n\t\tcompiled.TemplateID = options.TemplateID\n\t\tif err := compiled.Compile(); err != nil {\n\t\t\treturn errors.Wrap(err, \"could not compile operators\")\n\t\t}\n\t\trequest.CompiledOperators = compiled\n\t}\n\treturn nil\n}", "title": "" }, { "docid": "440463c2ee3b282768acb2ce53c9f54b", "score": "0.49292043", "text": "func (w *Where) Compile(layout *Template) (compiled string, err error) {\n\tif c, ok := layout.Read(w); ok {\n\t\treturn c, nil\n\t}\n\n\tgrouped, err := groupCondition(layout, w.Conditions, layout.MustCompile(layout.ClauseOperator, layout.AndKeyword))\n\tif err != nil {\n\t\treturn \"\", err\n\t}\n\n\tif grouped != \"\" {\n\t\tcompiled = layout.MustCompile(layout.WhereLayout, conds{grouped})\n\t}\n\n\tlayout.Write(w, compiled)\n\n\treturn\n}", "title": "" }, { "docid": "0c02a051033dc8004ccc25e8f9fb27ee", "score": "0.49181265", "text": "func (e *Encoder) Compile() error {\n\treturn e.compile()\n}", "title": "" }, { "docid": "e8cf53cca92b3162af728495407d2457", "score": "0.4915537", "text": "func (r BoundedRegexp) Regexp() (*regexp.Regexp, error) {\n\treturn compile(string(r), true)\n}", "title": "" }, { "docid": "24e4d612f249adf5f86d17426eb6c1f6", "score": "0.4911089", "text": "func compileCORSRegexString(s string) (*regexp.Regexp, error) {\n\tr, err := relabel.NewRegexp(s)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\treturn r.Regexp, nil\n}", "title": "" }, { "docid": "9eb3bca47a3c32ec8646bcb3b9d6e111", "score": "0.49107528", "text": "func ParseGlob(pattern string) (*Template, error) {}", "title": "" }, { "docid": "f9b4cffa611df4779520aeb9cc695bcc", "score": "0.49017853", "text": "func (c *Compiler) MatchPattern(pattern, input string) (bool, error) {\n\terr := c.Compile(pattern)\n\n\tif err != nil {\n\t\treturn false, err\n\t}\n\n\treturn c.Match(input)\n}", "title": "" }, { "docid": "973a073d772a13a467b29dc9a8831ec2", "score": "0.4885395", "text": "func Pattern(filename string) string {\n\treturn filepath.Join(filepath.Dir(filename), filepath.Base(filename)+patternSuffix)\n}", "title": "" }, { "docid": "d2a6e7d1a1bdc8c68caa3bf4f6014933", "score": "0.48846087", "text": "func NewMatchCompiler[T any](\n\tstringFieldMapper StringFieldMapper[T],\n\tsliceFieldMapper SliceFieldMapper[T],\n\tmapFieldMapper MapFieldMapper[T],\n\tpasses ...transform.CompilerPass,\n) *MatchCompiler[T] {\n\treturn &MatchCompiler[T]{\n\t\tstringMatcher: NewStringMatcherFactory(stringFieldMapper),\n\t\tsliceMatcher: NewStringSliceMatcherFactory(sliceFieldMapper),\n\t\tmapMatcher: NewStringMapMatcherFactory(mapFieldMapper),\n\t\tpasses: passes,\n\t}\n}", "title": "" }, { "docid": "41f450cb9fd6d99f61edb1554ff9b293", "score": "0.48845214", "text": "func (l Logger) Compile(a ...interface{}) string {\n\tmsg := l.formatter.format(a...)\n\tprefix := \"\"\n\tif l.timeFormat != \"\" {\n\t\tts := time.Now().Format(l.timeFormat)\n\t\tprefix += fmt.Sprintf(\"%s \", ts)\n\t}\n\tif l.name != loggerRootName {\n\t\tprefix += fmt.Sprintf(\"[%s]\", l.name)\n\t}\n\tif prefix == \"\" {\n\t\treturn msg\n\t} else {\n\t\treturn fmt.Sprintf(\"%s %s\", prefix, msg)\n\t}\n}", "title": "" }, { "docid": "4e2fc8dcaa62b3463578489d835eedad", "score": "0.48834544", "text": "func (e *Engine) Compile(code []byte, origin *ScriptOrigin, data *ScriptData) *Script {\n\tvar originPtr unsafe.Pointer\n\tvar dataPtr unsafe.Pointer\n\n\tif origin != nil {\n\t\toriginPtr = origin.self\n\t}\n\n\tif data != nil {\n\t\tdataPtr = data.self\n\t}\n\n\tcodePtr := unsafe.Pointer((*reflect.StringHeader)(unsafe.Pointer(&code)).Data)\n\tself := C.V8_Compile(e.self, (*C.char)(codePtr), C.int(len(code)), originPtr, dataPtr)\n\n\tif self == nil {\n\t\treturn nil\n\t}\n\n\tresult := &Script{\n\t\tself: self,\n\t}\n\n\truntime.SetFinalizer(result, func(s *Script) {\n\t\tif traceDispose {\n\t\t\tprintln(\"v8.Script.Dispose()\", s.self)\n\t\t}\n\t\tC.V8_DisposeScript(s.self)\n\t})\n\n\treturn result\n}", "title": "" }, { "docid": "338b73520dd6805ceb4e53988e990ce8", "score": "0.4880647", "text": "func (r *Resource) Compile() error {\n\t// Compile schema and panic on any compilation error\n\tif c, ok := r.schema.(schema.Compiler); ok {\n\t\tif err := c.Compile(); err != nil {\n\t\t\treturn fmt.Errorf(\": schema compilation error: %s\", err)\n\t\t}\n\t}\n\tfor field, subResource := range r.resources {\n\t\tif err := subResource.resource.Compile(); err != nil {\n\t\t\tif err.Error()[0] == ':' {\n\t\t\t\t// Check if I'm the direct ancestor of the raised sub-error\n\t\t\t\treturn fmt.Errorf(\"%s%s\", field, err)\n\t\t\t}\n\t\t\treturn fmt.Errorf(\"%s.%s\", field, err)\n\t\t}\n\t}\n\treturn nil\n}", "title": "" }, { "docid": "93b13a215db0f02d693686e6f85a3452", "score": "0.48772648", "text": "func (t *Template) Compile() (*CompiledTemplate, error) {\n\ttEndpoint, err := template.New(\"endpoint\").Parse(t.Endpoint)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\ttHeaders := make([]compiledHeader, 0, len(t.Headers))\n\tfor _, header := range t.Headers {\n\t\ttValue, err := template.New(\"headerValue\").Parse(header.Value)\n\t\tif err != nil {\n\t\t\treturn nil, err\n\t\t}\n\t\thdc := compiledHeader{\n\t\t\tkey: header.Key,\n\t\t\tvalue: tValue,\n\t\t}\n\t\ttHeaders = append(tHeaders, hdc)\n\t}\n\n\tvar tBody *template.Template\n\tif t.Body != \"\" {\n\t\ttBody, err = template.New(\"body\").Parse(t.Body)\n\t\tif err != nil {\n\t\t\treturn nil, err\n\t\t}\n\t}\n\n\ttmplc := CompiledTemplate{\n\t\tmethod: t.Method,\n\t\tendpoint: tEndpoint,\n\t\theaders: tHeaders,\n\t\tbody: tBody,\n\t}\n\treturn &tmplc, nil\n}", "title": "" }, { "docid": "7c1dcaf3a73d328dde8176e30487eb96", "score": "0.48484212", "text": "func (r Resources) Match(pattern any) Resources {\n\tpatternstr, err := cast.ToStringE(pattern)\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\n\tg, err := glob.GetGlob(patternstr)\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\n\tvar matches Resources\n\tfor _, resource := range r {\n\t\tif g.Match(strings.ToLower(resource.Name())) {\n\t\t\tmatches = append(matches, resource)\n\t\t}\n\t}\n\treturn matches\n}", "title": "" }, { "docid": "8cb6a7a3b511a85066497bf04e79f499", "score": "0.48439127", "text": "func MustCompile(str string) *Regexp {\n\treturn MustCompileNonThreadsafe(str).MakeThreadsafe()\n}", "title": "" }, { "docid": "5850720c9535d6694c8551b1c47ad084", "score": "0.4829153", "text": "func NewPattern(prefix, suffix string) (pattern string) {\n\tif prefix != \"\" {\n\t\tif !strings.HasSuffix(prefix, \"*\") {\n\t\t\tprefix += \"*\"\n\t\t}\n\n\t\tpattern = prefix\n\t}\n\n\tif suffix != \"\" {\n\t\tif !strings.HasPrefix(suffix, \"*\") {\n\t\t\tsuffix = \"*\" + suffix\n\t\t}\n\n\t\tpattern += suffix\n\t}\n\n\tpattern = strings.Replace(pattern, \"**\", \"*\", -1)\n\n\treturn pattern\n}", "title": "" }, { "docid": "2502067befc9291457b4af7b60673f34", "score": "0.48194614", "text": "func (c *Compiler) Compile(ctx context.Context, node ast.StmtNode) (ast.Statement, error) {\n\tstmtCount(node)\n\tis := GetInfoSchema(ctx)\n\tif err := plan.Preprocess(node, is, ctx); err != nil {\n\t\treturn nil, errors.Trace(err)\n\t}\n\t// Validate should be after NameResolve.\n\tif err := plan.Validate(node, false); err != nil {\n\t\treturn nil, errors.Trace(err)\n\t}\n\tp, err := plan.Optimize(ctx, node, is)\n\tif err != nil {\n\t\treturn nil, errors.Trace(err)\n\t}\n\tsa := &statement{\n\t\tis: is,\n\t\tplan: p,\n\t\ttext: node.Text(),\n\t}\n\treturn sa, nil\n}", "title": "" }, { "docid": "b9ef28b9a97cdbf4461800911a94e87f", "score": "0.481899", "text": "func Compile(s string) ([]byte, error) {\n\tassemblies, err := Parse(s)\n\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\tasm := &Assembler{Lines: assemblies}\n\treturn asm.Assemble()\n}", "title": "" }, { "docid": "6890a0970869501f553ad1cbdeb4fb8d", "score": "0.48165938", "text": "func (b *BasicCompiler) Compile(ctx context.Context, protoFilePath string) error {\n\targuments := make([]string, len(b.arguments))\n\tcopy(arguments, b.arguments)\n\n\t// contains source relative\n\tif util.Contains(b.config.Config().ImportPaths,\n\t\tconsts.KeySourceRelative) {\n\t\targuments = append(arguments, \"--proto_path=\"+filepath.Dir(protoFilePath))\n\t}\n\targuments = util.DeduplicateSliceStably(arguments)\n\targuments = append(arguments, protoFilePath)\n\t_, err := command.Execute(ctx,\n\t\tb.Logger, b.dir, b.protocPath, arguments, nil)\n\tif err != nil {\n\t\treturn &ErrCompile{\n\t\t\tErrCommandExec: err.(*command.ErrCommandExec),\n\t\t}\n\t}\n\treturn nil\n}", "title": "" }, { "docid": "4a52a5e27239f1cd79f350cc292c51d2", "score": "0.48125798", "text": "func translate(pattern string) string {\n\trePat := make([]rune, 0, len(pattern))\n\tfor _, char := range pattern {\n\t\tswitch char {\n\t\tcase '*':\n\t\t\trePat = append(rePat, '.', '*')\n\t\tcase '?':\n\t\t\trePat = append(rePat, '.')\n\t\tdefault:\n\t\t\trePat = append(rePat, escape(char)...)\n\t\t}\n\t}\n\treturn string(rePat)\n}", "title": "" }, { "docid": "460571e158a79eb9ccfaffef37fc1932", "score": "0.4789597", "text": "func NewPattern(version int, ops []int, pool []string, verb string) (Pattern, error) {\n\tif version != 1 {\n\t\tgrpclog.Infof(\"unsupported version: %d\", version)\n\t\treturn Pattern{}, ErrInvalidPattern\n\t}\n\n\tl := len(ops)\n\tif l%2 != 0 {\n\t\tgrpclog.Infof(\"odd number of ops codes: %d\", l)\n\t\treturn Pattern{}, ErrInvalidPattern\n\t}\n\n\tvar (\n\t\ttypedOps []op\n\t\tstack, maxstack int\n\t\ttailLen int\n\t\tpushMSeen bool\n\t\tvars []string\n\t)\n\tfor i := 0; i < l; i += 2 {\n\t\top := op{code: utilities.OpCode(ops[i]), operand: ops[i+1]}\n\t\tswitch op.code {\n\t\tcase utilities.OpNop:\n\t\t\tcontinue\n\t\tcase utilities.OpPush:\n\t\t\tif pushMSeen {\n\t\t\t\ttailLen++\n\t\t\t}\n\t\t\tstack++\n\t\tcase utilities.OpPushM:\n\t\t\tif pushMSeen {\n\t\t\t\tgrpclog.Infof(\"pushM appears twice\")\n\t\t\t\treturn Pattern{}, ErrInvalidPattern\n\t\t\t}\n\t\t\tpushMSeen = true\n\t\t\tstack++\n\t\tcase utilities.OpLitPush:\n\t\t\tif op.operand < 0 || len(pool) <= op.operand {\n\t\t\t\tgrpclog.Infof(\"negative literal index: %d\", op.operand)\n\t\t\t\treturn Pattern{}, ErrInvalidPattern\n\t\t\t}\n\t\t\tif pushMSeen {\n\t\t\t\ttailLen++\n\t\t\t}\n\t\t\tstack++\n\t\tcase utilities.OpConcatN:\n\t\t\tif op.operand <= 0 {\n\t\t\t\tgrpclog.Infof(\"negative concat size: %d\", op.operand)\n\t\t\t\treturn Pattern{}, ErrInvalidPattern\n\t\t\t}\n\t\t\tstack -= op.operand\n\t\t\tif stack < 0 {\n\t\t\t\tgrpclog.Info(\"stack underflow\")\n\t\t\t\treturn Pattern{}, ErrInvalidPattern\n\t\t\t}\n\t\t\tstack++\n\t\tcase utilities.OpCapture:\n\t\t\tif op.operand < 0 || len(pool) <= op.operand {\n\t\t\t\tgrpclog.Infof(\"variable name index out of bound: %d\", op.operand)\n\t\t\t\treturn Pattern{}, ErrInvalidPattern\n\t\t\t}\n\t\t\tv := pool[op.operand]\n\t\t\top.operand = len(vars)\n\t\t\tvars = append(vars, v)\n\t\t\tstack--\n\t\t\tif stack < 0 {\n\t\t\t\tgrpclog.Infof(\"stack underflow\")\n\t\t\t\treturn Pattern{}, ErrInvalidPattern\n\t\t\t}\n\t\tdefault:\n\t\t\tgrpclog.Infof(\"invalid opcode: %d\", op.code)\n\t\t\treturn Pattern{}, ErrInvalidPattern\n\t\t}\n\n\t\tif maxstack < stack {\n\t\t\tmaxstack = stack\n\t\t}\n\t\ttypedOps = append(typedOps, op)\n\t}\n\treturn Pattern{\n\t\tops: typedOps,\n\t\tpool: pool,\n\t\tvars: vars,\n\t\tstacksize: maxstack,\n\t\ttailLen: tailLen,\n\t\tverb: verb,\n\t}, nil\n}", "title": "" }, { "docid": "02fbc75391d3731d1680a9003828ba21", "score": "0.477698", "text": "func (e *Engine) Compile(code []byte, origin *ScriptOrigin) *Script {\n\tcodePtr := unsafe.Pointer((*reflect.StringHeader)(unsafe.Pointer(&code)).Data)\n\tself := C.V8_Compile(e.self, (*C.char)(codePtr), C.int(len(code)), unsafe.Pointer(origin))\n\n\tif self == nil {\n\t\treturn nil\n\t}\n\n\tresult := &Script{\n\t\tself: self,\n\t}\n\n\truntime.SetFinalizer(result, func(s *Script) {\n\t\tif traceDispose {\n\t\t\tprintln(\"v8.Script.Dispose()\", s.self)\n\t\t}\n\t\tC.V8_DisposeScript(s.self)\n\t})\n\n\treturn result\n}", "title": "" }, { "docid": "68228eac9eedb64f000c55c8f7855913", "score": "0.47704747", "text": "func CompileString(dictionary []string) (*Matcher, error) {\n\tm := new(Matcher)\n\tm.buildTrieString(dictionary)\n\treturn m, nil\n}", "title": "" }, { "docid": "9d4c3db9363827ce1a32b3ff7fe82241", "score": "0.47663873", "text": "func (m Multiply) Compile() Node {\n\tleft := m.Left.Compile()\n\tright := m.Right.Compile()\n\tswitch left.(type) {\n\tcase Literal:\n\t\tswitch right.(type) {\n\t\tcase Literal:\n\t\t\tv, err := af.Multiply.ValidateRun([]interface{}{left.(Literal).Value, right.(Literal).Value})\n\t\t\tif err != nil {\n\t\t\t\treturn &Multiply{&NumericBinaryOperator{&BinaryOperator{Left: left, Right: right}}}\n\t\t\t}\n\t\t\treturn Literal{Value: v}\n\t\t}\n\t}\n\treturn &Multiply{&NumericBinaryOperator{&BinaryOperator{Left: left, Right: right}}}\n}", "title": "" } ]
0b77e4cfe1f515554212304edf3ffc03
IsTypeOf is used to determine if a given value is associated with the type
[ { "docid": "da1d000a54447a4bfcf98d76db24dac4", "score": "0.6009536", "text": "func (*entityImpl) IsTypeOf(s interface{}, p graphql.IsTypeOfParams) bool {\n\t_, ok := s.(*corev2.Entity)\n\treturn ok\n}", "title": "" } ]
[ { "docid": "421cc3a658a30913b42673eb17eaa39e", "score": "0.6762454", "text": "func IsType(input interface{}, t TypeID) bool {\n\tvar (\n\t\to map[string]interface{}\n\t\ttv interface{}\n\t\tok bool\n\t)\n\n\to, ok = input.(map[string]interface{})\n\tif !ok {\n\t\treturn false\n\t}\n\n\ttv, ok = o[\"@type\"]\n\tif !ok {\n\t\treturn false\n\t}\n\n\tswitch tv.(type) {\n\tcase string:\n\t\treturn t.URI() == tv.(string)\n\tcase []string:\n\t\tfor _, typeval := range tv.([]string) {\n\t\t\tif t.URI() == typeval {\n\t\t\t\treturn true\n\t\t\t}\n\t\t}\n\t}\n\treturn false\n}", "title": "" }, { "docid": "0ef29f4a30430156d1b5ffa2c81fbea7", "score": "0.6658675", "text": "func isType(obj interface{}, check reflect.Kind) bool {\n\treturn reflect.TypeOf(obj).Kind() == check\n}", "title": "" }, { "docid": "f036a4b30bb07a9e6a32d90e8585a7a1", "score": "0.65178186", "text": "func (t Token) IsType(other Type) bool {\n\treturn t.Type == other\n}", "title": "" }, { "docid": "889ea48a07645e07298a0fe23d1adafc", "score": "0.6510825", "text": "func (*mutationsImpl) IsTypeOf(s interface{}, p graphql.IsTypeOfParams) bool {\n\treturn false\n}", "title": "" }, { "docid": "d93d54469f4073c4db14f2057dca9e2d", "score": "0.6510558", "text": "func (*timeWindowWhenImpl) IsTypeOf(s interface{}, p graphql.IsTypeOfParams) bool {\n\t_, ok := s.(types.TimeWindowWhen)\n\treturn ok\n}", "title": "" }, { "docid": "a0193d7dce21a2c25f92fa62b46dad38", "score": "0.6460411", "text": "func (j JSON) IsOfType(typ string) bool {\n\tswitch typ {\n\tcase JSONOb:\n\t\treturn j.IsOb()\n\tcase JSONString:\n\t\treturn j.IsString()\n\tcase JSONList:\n\t\treturn j.IsList()\n\tcase JSONNum:\n\t\treturn j.IsNum()\n\tcase JSONBool:\n\t\treturn j.IsBool()\n\tcase JSONNull:\n\t\treturn j.IsNull()\n\tdefault:\n\t\tpanic(\"that's not a JSON type!\")\n\t}\n}", "title": "" }, { "docid": "1b2e117d9db5b211e78381ed23b4e014", "score": "0.6417863", "text": "func (t Type) Is(v interface{}) bool {\n\tswitch v := v.(type) {\n\tcase string:\n\t\treturn len(t) == 1 && t[0] == v\n\tcase Type:\n\t\tif len(v) != len(t) {\n\t\t\treturn false\n\t\t}\n\t\tvm := make(map[string]struct{})\n\t\tfor _, e := range v {\n\t\t\tvm[e] = struct{}{}\n\t\t}\n\t\tif len(vm) != len(t) {\n\t\t\treturn false\n\t\t}\n\t\tfor _, e := range t {\n\t\t\tif _, in := vm[e]; !in {\n\t\t\t\treturn false\n\t\t\t}\n\t\t}\n\t\treturn true\n\tcase []string:\n\t\tif len(v) != len(t) {\n\t\t\treturn false\n\t\t}\n\t\tvm := make(map[string]struct{})\n\t\tfor _, e := range v {\n\t\t\tvm[e] = struct{}{}\n\t\t}\n\t\tif len(vm) != len(t) {\n\t\t\treturn false\n\t\t}\n\t\tfor _, e := range t {\n\t\t\tif _, in := vm[e]; !in {\n\t\t\t\treturn false\n\t\t\t}\n\t\t}\n\t\treturn true\n\tdefault:\n\t\treturn false\n\t}\n}", "title": "" }, { "docid": "e6114732ed49115eccf2685793617632", "score": "0.64048296", "text": "func (o Operand) IsKindOf(v interface{}) {\n\tleftType := reflect.TypeOf(o.value)\n\trightType := reflect.TypeOf(v)\n\tif leftType != rightType {\n\t\tlogCall(o.a.t, \"IsKindOf\")\n\t\tFatalf(o.a.t, \"got [%v] for \\\"%s\\\" but want [%v]\", leftType, o.label, rightType)\n\t} else {\n\t\tLogf(o.a.t, \"%s is kind of %v\", o.label, rightType)\n\t}\n}", "title": "" }, { "docid": "994398e25ad712afee0e280bdff1bf9e", "score": "0.63933575", "text": "func (*handlerImpl) IsTypeOf(s interface{}, p graphql.IsTypeOfParams) bool {\n\t_, ok := s.(*types.Entity)\n\treturn ok\n}", "title": "" }, { "docid": "05be778322c2abe5851f5096c5092209", "score": "0.6362404", "text": "func (r Resourceness) IsValueType() bool {\n\treturn r == IsValueType\n}", "title": "" }, { "docid": "2bdd52ebc9c3fdd4f9619b2771426ea9", "score": "0.63400596", "text": "func (*timeWindowDaysImpl) IsTypeOf(s interface{}, p graphql.IsTypeOfParams) bool {\n\t_, ok := s.(types.TimeWindowDays)\n\treturn ok\n}", "title": "" }, { "docid": "cadf5d61d28db83a5488ffe4a38546d9", "score": "0.6292308", "text": "func IsType(buf []byte, kind types.Type) bool {\n\tmatcher := matchers.Matchers[kind]\n\tif matcher == nil {\n\t\treturn false\n\t}\n\treturn matcher(buf) != types.Unknown\n}", "title": "" }, { "docid": "0a34f6f2aca6343d429b727d3de7f9c0", "score": "0.61787665", "text": "func (at *Assertions) IsType(expect string, actual interface{}, args ...interface{}) bool {\n\tinfo, call, cinfo := typeCall(expect, actual, args...)\n\treturn IsType(at.t, expect, actual, info, call+1, cinfo)\n}", "title": "" }, { "docid": "5e38a081b7d3270e758ca038b64ed843", "score": "0.6142083", "text": "func (*handlerSocketImpl) IsTypeOf(s interface{}, p graphql.IsTypeOfParams) bool {\n\t_, ok := s.(*types.HandlerSocket)\n\treturn ok\n}", "title": "" }, { "docid": "21272903f8784a592cc57dc65dee6842", "score": "0.61385906", "text": "func TypeOf(v Value) Type {\n\tif v == nil {\n\t\treturn TypeNull\n\t}\n\treturn v.Type()\n}", "title": "" }, { "docid": "a209601a421d883d9bb446ab9ade805f", "score": "0.61324745", "text": "func TypeOf(t string, v interface{}) String {\n\tif t != \"\" {\n\t\treturn String(t)\n\t}\n\tif v != nil {\n\t\tswitch xType := fmt.Sprintf(\"%T\", v); xType {\n\t\tcase \"string\":\n\t\t\treturn String(\"string\")\n\t\tcase \"int\", \"int8\", \"int16\", \"int32\", \"int64\", \"float32\", \"float64\":\n\t\t\treturn String(\"number\")\n\t\tcase \"bool\":\n\t\t\treturn String(\"bool\")\n\t\tcase \"[]interface {}\":\n\t\t\treturn String(\"list\")\n\t\tcase \"map[string]interface {}\":\n\t\t\treturn String(\"map\")\n\t\t}\n\t}\n\treturn String(\"any\")\n}", "title": "" }, { "docid": "f2e41b8bae03fd2f7357db04cb4f587b", "score": "0.6128088", "text": "func IsVtypeval(input interface{}, t TypeID, v interface{}) bool {\n\tvar (\n\t\tvalobj map[string]interface{}\n\t\ttv interface{}\n\t\tvv interface{}\n\t\tok bool\n\t)\n\n\tswitch input.(type) {\n\tcase map[string]interface{}:\n\t\tvalobj = input.(map[string]interface{})\n\tdefault:\n\t\treturn false\n\t}\n\n\ttv, ok = valobj[\"@type\"]\n\tif !ok {\n\t\treturn false\n\t}\n\n\tswitch tv.(type) {\n\tcase string:\n\t\tif t.URI() != tv.(string) {\n\t\t\treturn false\n\t\t}\n\tdefault:\n\t\treturn false\n\t}\n\n\tvv, ok = valobj[\"@value\"]\n\tif !ok {\n\t\treturn false\n\t}\n\n\treturn v == vv\n\n}", "title": "" }, { "docid": "f647ba9f3fffce3d13d109add2cebe2c", "score": "0.60032463", "text": "func TypeOf(v interface{}) Type {\n\tvalue := (*Value)(unsafe.Pointer(&v))\n\treturn value.typ\n}", "title": "" }, { "docid": "22d26dc3aa98aaf9cc539cef20491ecd", "score": "0.5995131", "text": "func IsInstanceOf(objectPtr, typePtr interface{}) bool {\n\treturn reflect.TypeOf(objectPtr) == reflect.TypeOf(typePtr)\n}", "title": "" }, { "docid": "11b5be5b8a020485c99df069d4b24c88", "score": "0.59918016", "text": "func (*timeWindowTimeRangeImpl) IsTypeOf(s interface{}, p graphql.IsTypeOfParams) bool {\n\t_, ok := s.(types.TimeWindowTimeRange)\n\treturn ok\n}", "title": "" }, { "docid": "9daaeccc695a3a52d9ee600b6b2b4134", "score": "0.59668744", "text": "func (tr *transform) isType(t dataType, name string) bool {\n\tif name == \"\" {\n\t\treturn false\n\t}\n\n\tname = strings.SplitN(name, \"<<\", 2)[0] // could have a tag\n\n\tfor funcId := tr.funcId; funcId >= 0; funcId-- {\n\t\tfor blockId := tr.blockId; blockId >= 0; blockId-- {\n\t\t\tif _, ok := tr.vars[funcId][blockId][name]; ok { // variable found\n\t\t\t\tswitch t {\n\t\t\t\tcase sliceType:\n\t\t\t\t\tif _, ok := tr.slices[funcId][blockId][name]; ok {\n\t\t\t\t\t\treturn true\n\t\t\t\t\t}\n\t\t\t\tcase mapType:\n\t\t\t\t\tif _, ok := tr.maps[funcId][blockId][name]; ok {\n\t\t\t\t\t\treturn true\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\treturn false\n\t\t\t}\n\t\t}\n\t}\n\treturn false\n}", "title": "" }, { "docid": "1bd2bf3e91a7438aa4456e2468a66671", "score": "0.5962469", "text": "func (u Unit) IsType(unitType api.UnitTypeID) bool {\n\treturn u.UnitType == unitType\n}", "title": "" }, { "docid": "a26711529907b7a254ee53e46b98bc71", "score": "0.5950671", "text": "func IsVtype(input interface{}, t TypeID) bool {\n\tvar (\n\t\tn map[string]interface{}\n\t\ttv interface{}\n\t\tok bool\n\t)\n\n\tswitch input.(type) {\n\tcase map[string]interface{}:\n\t\tn = input.(map[string]interface{})\n\tdefault:\n\t\treturn false\n\t}\n\n\ttv, ok = n[\"@type\"]\n\tif !ok {\n\t\treturn false\n\t}\n\n\tswitch tv.(type) {\n\tcase string:\n\t\treturn t.URI() == tv.(string)\n\tdefault:\n\t\treturn false\n\t}\n}", "title": "" }, { "docid": "ffe941eefb11bb8cc9dbaa19354018ae", "score": "0.593843", "text": "func IsTypeOf(err error, tpe reflect.Type) bool {\n\t_, ok := GetTypeOf(err, tpe)\n\treturn ok\n}", "title": "" }, { "docid": "61d0fd45ba138826bf7a2c0e0888d278", "score": "0.59214854", "text": "func isValueType(d *lang.DefineExpr) bool {\n\treturn d.Tags.Contains(\"Value\")\n}", "title": "" }, { "docid": "daff39bc067fa7e1195408666b028d85", "score": "0.59153837", "text": "func IsInputType(ttype Type) bool {\n\tswitch GetNamed(ttype).(type) {\n\tcase *Scalar, *Enum, *InputObject:\n\t\treturn true\n\tdefault:\n\t\treturn false\n\t}\n}", "title": "" }, { "docid": "5b0e48ef31bccd32dd4bdda8c2810016", "score": "0.5887263", "text": "func (u Update) Is(msgTypeName string) bool {\n\treturn reflect.TypeOf(u.Value).Name() == msgTypeName\n}", "title": "" }, { "docid": "070c95eff33e25e6d814d6452fdf04a2", "score": "0.58793443", "text": "func (*roleBindingImpl) IsTypeOf(s interface{}, p graphql.IsTypeOfParams) bool {\n\t_, ok := s.(*corev2.RoleBinding)\n\treturn ok\n}", "title": "" }, { "docid": "cc18368909e047c03f1a74de24389b78", "score": "0.5875562", "text": "func (*roleImpl) IsTypeOf(s interface{}, p graphql.IsTypeOfParams) bool {\n\t_, ok := s.(*corev2.Role)\n\treturn ok\n}", "title": "" }, { "docid": "9a4788f7451b9579b828b3e1e27f0b6b", "score": "0.58745193", "text": "func (recv *Variant) IsOfType(type_ *VariantType) bool {\n\tc_type := (*C.GVariantType)(C.NULL)\n\tif type_ != nil {\n\t\tc_type = (*C.GVariantType)(type_.ToC())\n\t}\n\n\tretC := C.g_variant_is_of_type((*C.GVariant)(recv.native), c_type)\n\tretGo := retC == C.TRUE\n\n\treturn retGo\n}", "title": "" }, { "docid": "53a0616631b7fc631b3177fc22c76667", "score": "0.5871388", "text": "func validValueType(v interface{}) bool {\n\tk := reflect.TypeOf(v).Kind()\n\treturn k == reflect.String || k == reflect.Int || k == reflect.Bool\n}", "title": "" }, { "docid": "2fac64ca95a8416a606d582b65326708", "score": "0.58450955", "text": "func IsSupported(value interface{}) bool {\n\t_, ok := GetType(value)\n\treturn ok\n}", "title": "" }, { "docid": "39b7af2238256baf37be752a05d13019", "score": "0.5843988", "text": "func IsTypeRequest(code string) bool {\n\t_, ok := typeRequest[code]\n\treturn ok\n}", "title": "" }, { "docid": "319b5728d0155a3328b7f2648c6d9190", "score": "0.5831606", "text": "func IsElementType(i interface{}) bool {\n\tswitch i.(type) {\n\tcase *Element:\n\t\treturn true\n\tdefault:\n\t\treturn false\n\t}\n}", "title": "" }, { "docid": "c6f236fe9685579d640388dc87e913e7", "score": "0.57877594", "text": "func (st *CMDParam) isExpectedType() bool {\n\tswitch st.Type {\n\tcase \"\":\n\t\treturn true\n\n\tcase CMDParamTypeString:\n\t\t// any type could be converted to string\n\t\treturn true\n\n\tcase CMDParamTypeInt:\n\t\t_, err := st.GetIntValue()\n\t\treturn err == nil\n\t}\n\n\treturn false\n}", "title": "" }, { "docid": "4251fdbb34ada38f36803d445182f087", "score": "0.57790613", "text": "func (t Type) IsDat() bool {\n\treturn t == TypeDat\n}", "title": "" }, { "docid": "8983d25370890a0f73bc44cb04937d04", "score": "0.5773495", "text": "func (*assetImpl) IsTypeOf(s interface{}, p graphql.IsTypeOfParams) bool {\n\t_, ok := s.(*v2.Asset)\n\treturn ok\n}", "title": "" }, { "docid": "93dc8efad977c9e0f648666327997f77", "score": "0.57588655", "text": "func IsType(err error, t Type) bool {\n\tvar exc = &Exception{}\n\tif errors.As(err, &exc) {\n\t\treturn exc.Type == t\n\t}\n\n\treturn false\n}", "title": "" }, { "docid": "283c5ea92a30b20c59a9b2ff08c240b1", "score": "0.575672", "text": "func (h5 *HDF5) GetType(typeName string) (string, bool) {\n\tobj, has := h5.getTypeObj(typeName)\n\tif !has {\n\t\treturn \"\", false\n\t}\n\torigNames := map[string]bool{typeName: true}\n\tsig := cdlTypeString(obj.objAttr.class, h5, typeName, obj.objAttr, origNames)\n\treturn sig, true\n}", "title": "" }, { "docid": "08fc9cadf7849012282019ae770c674c", "score": "0.5748014", "text": "func IsTypeSupported(dataType string) bool {\n\t_, supported := supportedDataTypes[dataType]\n\treturn supported\n}", "title": "" }, { "docid": "787b1e83d753c769caeb54e3f5d63517", "score": "0.5745055", "text": "func (t PropertyType) IsInterface() bool {\n\treturn t == TypeEnum || t == TypeStack || t == TypeBoard || t == TypeTimer\n}", "title": "" }, { "docid": "ef349769e0dff1e19f080068d39b0414", "score": "0.573244", "text": "func (*InstOr) isValue() {}", "title": "" }, { "docid": "e86233e931e39be1fd51813e79d8ae72", "score": "0.570937", "text": "func (*corev2PipelineImpl) IsTypeOf(s interface{}, p graphql.IsTypeOfParams) bool {\n\t_, ok := s.(*corev2.Pipeline)\n\treturn ok\n}", "title": "" }, { "docid": "e86233e931e39be1fd51813e79d8ae72", "score": "0.570937", "text": "func (*corev2PipelineImpl) IsTypeOf(s interface{}, p graphql.IsTypeOfParams) bool {\n\t_, ok := s.(*corev2.Pipeline)\n\treturn ok\n}", "title": "" }, { "docid": "87fa1e966ceeb6d29c8be54e431be565", "score": "0.56969655", "text": "func (avp *avp) isDataType(dt avpDataType) bool {\n\treturn avp.payload.dataType == dt\n}", "title": "" }, { "docid": "e206879ae41f62102cc26d6075033a7a", "score": "0.5693138", "text": "func (t Type) IsDefined() bool {\n\treturn t.Name != \"\"\n}", "title": "" }, { "docid": "c2e6fd76e3658b186fc7fe839ce9b399", "score": "0.56804514", "text": "func (w column) HasType() bool {\n\treturn w.desc.Type != nil\n}", "title": "" }, { "docid": "73ff76e0d0a6bf01d8102db17c37eefe", "score": "0.5656563", "text": "func (o *WorkflowWorkflowInfoAllOf) HasType() bool {\n\tif o != nil && o.Type != nil {\n\t\treturn true\n\t}\n\n\treturn false\n}", "title": "" }, { "docid": "8c7f8a27644d78ebdd626ef89671e0ba", "score": "0.56538075", "text": "func (m typeMatcher) Match(v interface{}) bool {\n\tif v == nil {\n\t\treturn false\n\t}\n\treturn reflect.TypeOf(v).String() == m.value\n}", "title": "" }, { "docid": "7aff3ff415a98624d76a41378b2df300", "score": "0.56437343", "text": "func isType(typ token.Type, line token.LineContainer, _options ...isTypeOptions) bool {\n\t//Calculate the threshold\n\toptions := isTypeOptions{\n\t\tthreshold: isTypeThreshold,\n\t\tignoreTabs: false,\n\t}\n\n\tif len(_options) != 0 {\n\t\toptions = _options[0]\n\t}\n\tif options.threshold == 0 {\n\t\toptions.threshold = 2\n\t}\n\t//Check if there are too few tokens\n\tif len(line.Tokens) < options.threshold {\n\t\treturn false\n\t}\n\n\t//Checks the line\n\tfor _, t := range line.Tokens {\n\t\tif options.ignoreTabs && t.Type() == token.TypeTab {\n\t\t\tcontinue\n\t\t}\n\t\tif typ != t.Type() {\n\t\t\treturn false\n\t\t}\n\t}\n\n\treturn true\n}", "title": "" }, { "docid": "cb9bf9576b096bcb2f6c5fc8d0ee6171", "score": "0.5618855", "text": "func TypeOf(v interface{}) string {\n\tif classifier, ok := v.(Classifier); ok {\n\t\treturn classifier.Type()\n\t}\n\n\tval := reflect.ValueOf(v)\n\ttyp := val.Type()\n\tswitch typ.Kind() {\n\tcase reflect.Map:\n\t\tif typ.Key().Kind() == reflect.String {\n\t\t\tkey := reflect.ValueOf(FormatterTypeField)\n\t\t\tentry := val.MapIndex(key)\n\t\t\tif entry.IsValid() {\n\t\t\t\tif t, ok := entry.Interface().(string); ok {\n\t\t\t\t\treturn t\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\tcase reflect.Struct:\n\t\tfield := val.FieldByName(FormatterTypeField)\n\t\tif field.IsValid() && field.CanInterface() {\n\t\t\tif t, ok := field.Interface().(string); ok {\n\t\t\t\treturn t\n\t\t\t}\n\t\t}\n\n\tcase reflect.Ptr:\n\t\tptrElem := val.Elem()\n\t\tif ptrElem.IsValid() && ptrElem.CanInterface() {\n\t\t\treturn TypeOf(ptrElem.Interface())\n\t\t}\n\t}\n\n\treturn typ.String()\n}", "title": "" }, { "docid": "fd072f01cc736fc23cda4969d4ac38f5", "score": "0.5612519", "text": "func (ks KeyspaceNodes) HasType(name string) bool {\n\tfor _, shard := range ks {\n\t\tif _, ok := shard[name]; ok {\n\t\t\treturn true\n\t\t}\n\t}\n\treturn false\n}", "title": "" }, { "docid": "da3b47f937e817f05789df7c5ecd7f05", "score": "0.5608614", "text": "func (t *itype) TypeOf() reflect.Type {\n\treturn t.refType(map[string]*itype{}, false)\n}", "title": "" }, { "docid": "29d41acffb0684696a99f4b7ef62175e", "score": "0.5601157", "text": "func (t Type) IsJSONType() bool {\n\ttStr := t.TypeString()\n\ttStr = strings.TrimSpace(tStr)\n\treturn strings.HasPrefix(tStr, \"{\") && strings.HasSuffix(tStr, \"}\")\n}", "title": "" }, { "docid": "9bf044efc748a5e8f455232982b38fe3", "score": "0.559675", "text": "func Is(buf []byte, ext string) bool {\n\tkind := types.Get(ext)\n\tif kind != types.Unknown {\n\t\treturn IsType(buf, kind)\n\t}\n\treturn false\n}", "title": "" }, { "docid": "a679441d7d26c2a7071167358c7a8561", "score": "0.5576444", "text": "func (tx *stx) istype(qtype uint16) bool {\n\treturn tx.qtype == qtype || tx.qtype == dns.TypeANY\n}", "title": "" }, { "docid": "92e0e981249f64d6e5f5627d28e664b3", "score": "0.5550402", "text": "func (*clusterRoleBindingImpl) IsTypeOf(s interface{}, p graphql.IsTypeOfParams) bool {\n\t_, ok := s.(*corev2.ClusterRoleBinding)\n\treturn ok\n}", "title": "" }, { "docid": "826fd261f8445d47e2f6a4ae6c4bc2ee", "score": "0.5542109", "text": "func (this *Contains) Type() value.Type { return value.BOOLEAN }", "title": "" }, { "docid": "4635be4772cefe15ddfa5bbcad3ced90", "score": "0.5524451", "text": "func Typeof(fn *Funny, args []Value) Value {\n\tackEq(fn, args, 1)\n\treturn Typing(args[0])\n}", "title": "" }, { "docid": "156c6c0669e3a0e7e610e90c6eb5b7e7", "score": "0.5516796", "text": "func (at Type) IsCurrentType() (Type, error) {\n\tswitch at {\n\tcase AlarmTypeOne:\n\t\treturn at, nil\n\tcase AlarmTypeTwo:\n\t\treturn at, nil\n\tcase AlarmTypeThree:\n\t\treturn at, nil\n\tdefault:\n\t\treturn at, errors.New(\"the alarm type is error\")\n\t}\n}", "title": "" }, { "docid": "62ef19960adad7bab1b9233dae57ad79", "score": "0.5501662", "text": "func (*InstShl) isValue() {}", "title": "" }, { "docid": "e84b6b6b205a36a16fcf9682ef91f857", "score": "0.54959196", "text": "func (I *Detector) IsValue() bool {\n\treturn I.RuleType == RULE_TYPE_VALUE\n}", "title": "" }, { "docid": "3d6c3209b89f30239a8ddf2a98e76241", "score": "0.54955715", "text": "func IsUnderlyingTime(typ types.Type) bool {\n\treturn typ.Underlying().String() == timeString\n}", "title": "" }, { "docid": "9ab3c13a6dc385d38140ba97abbbd60d", "score": "0.54888886", "text": "func (o *DataScalarColumn) HasType() bool {\n\treturn o != nil && o.Type != nil\n}", "title": "" }, { "docid": "47c53e531e5bf00389e8ec28050a46bf", "score": "0.5484955", "text": "func (t *jsonSchemaType) IsTyped() bool {\n\treturn len(t.types) > 0\n}", "title": "" }, { "docid": "71945afa39196e32cda15558f4bc1932", "score": "0.54794556", "text": "func (v Value) IsString() bool {\n\treturn v.Kind == constant.String\n}", "title": "" }, { "docid": "c3c858a1bb0aca52826c488f79913ce5", "score": "0.54786706", "text": "func fieldIsStringType(obj interface{}, key string) bool {\n\tt := reflect.TypeOf(obj)\n\tv := reflect.ValueOf(obj)\n\tif reflect.TypeOf(obj).Kind() != reflect.Struct {\n\t\treturn false\n\t}\n\tfor i := 0; i < t.NumField(); i++ {\n\t\tfieldType := fmt.Sprint(v.Field(i).Type())\n\t\tif fieldType == \"string\" && v.Type().Field(i).Name == key {\n\t\t\treturn true\n\t\t}\n\t}\n\treturn false\n}", "title": "" }, { "docid": "9a4985c359736dc4cbc1a9d2224b99ba", "score": "0.5462496", "text": "func (c nydusType) Is(ctx context.Context, cs content.Store, desc ocispecs.Descriptor) (bool, error) {\n\tif desc.Annotations == nil {\n\t\treturn false, nil\n\t}\n\thasMediaType := desc.MediaType == nydusify.MediaTypeNydusBlob\n\t_, hasAnno := desc.Annotations[nydusify.LayerAnnotationNydusBlob]\n\n\t_, err := cs.Info(ctx, desc.Digest)\n\tif err != nil {\n\t\treturn false, err\n\t}\n\n\treturn hasMediaType && hasAnno, nil\n}", "title": "" }, { "docid": "6414e79d945b1f377d45b51c141afd31", "score": "0.54619724", "text": "func (c *TTypeMatcher) MatchTypeByName(expectedType string, actualType refl.Type) bool {\n\tif expectedType == \"\" {\n\t\treturn true\n\t}\n\n\tif actualType == nil {\n\t\tpanic(\"Actual type cannot be null\")\n\t}\n\n\tif actualType.Kind() == refl.Ptr {\n\t\tactualType = actualType.Elem()\n\t}\n\n\texpectedType = strings.ToLower(expectedType)\n\tactualTypeName := strings.ToLower(actualType.Name())\n\tactualTypeFullName := strings.ToLower(actualType.PkgPath() + \".\" + actualType.Name())\n\tactualTypeKind := actualType.Kind()\n\n\tif actualTypeName == expectedType || actualTypeFullName == expectedType {\n\t\treturn true\n\t}\n\n\tif expectedType == \"object\" {\n\t\treturn true\n\t}\n\n\tif expectedType == \"int\" || expectedType == \"integer\" {\n\t\treturn actualTypeKind == refl.Int8 ||\n\t\t\tactualTypeKind == refl.Uint8 ||\n\t\t\tactualTypeKind == refl.Int16 ||\n\t\t\tactualTypeKind == refl.Uint16 ||\n\t\t\tactualTypeKind == refl.Int32 ||\n\t\t\tactualTypeKind == refl.Int\n\t}\n\n\tif expectedType == \"long\" {\n\t\treturn actualTypeKind == refl.Int8 ||\n\t\t\tactualTypeKind == refl.Uint8 ||\n\t\t\tactualTypeKind == refl.Int16 ||\n\t\t\tactualTypeKind == refl.Uint16 ||\n\t\t\tactualTypeKind == refl.Int32 ||\n\t\t\tactualTypeKind == refl.Uint32 ||\n\t\t\tactualTypeKind == refl.Int64 ||\n\t\t\tactualTypeKind == refl.Uint64 ||\n\t\t\tactualTypeKind == refl.Int ||\n\t\t\tactualTypeKind == refl.Uint\n\t}\n\n\tif expectedType == \"float\" {\n\t\treturn actualTypeKind == refl.Float32\n\t}\n\n\tif expectedType == \"double\" {\n\t\treturn actualTypeKind == refl.Float32 ||\n\t\t\tactualTypeKind == refl.Float64\n\t}\n\n\tif expectedType == \"string\" {\n\t\treturn actualTypeKind == refl.String\n\t}\n\n\tif expectedType == \"bool\" || expectedType == \"boolean\" {\n\t\treturn actualTypeKind == refl.Bool\n\t}\n\n\tif expectedType == \"date\" || expectedType == \"datetime\" {\n\t\treturn actualType == refl.TypeOf(time.Time{})\n\t}\n\n\tif expectedType == \"timespan\" || expectedType == \"duration\" {\n\t\treturn actualTypeKind == refl.Int8 ||\n\t\t\tactualTypeKind == refl.Uint8 ||\n\t\t\tactualTypeKind == refl.Int16 ||\n\t\t\tactualTypeKind == refl.Uint16 ||\n\t\t\tactualTypeKind == refl.Int32 ||\n\t\t\tactualTypeKind == refl.Uint32 ||\n\t\t\tactualTypeKind == refl.Int64 ||\n\t\t\tactualTypeKind == refl.Uint64 ||\n\t\t\tactualTypeKind == refl.Int ||\n\t\t\tactualTypeKind == refl.Uint ||\n\t\t\tactualTypeKind == refl.Float32 ||\n\t\t\tactualTypeKind == refl.Float64 ||\n\t\t\tactualType == refl.TypeOf(time.Duration(1))\n\t}\n\n\tif expectedType == \"map\" || expectedType == \"dict\" || expectedType == \"dictionary\" {\n\t\treturn actualTypeKind == refl.Map\n\t}\n\n\tif expectedType == \"array\" || expectedType == \"list\" {\n\t\treturn actualTypeKind == refl.Array ||\n\t\t\tactualTypeKind == refl.Slice\n\t}\n\n\tif strings.HasSuffix(expectedType, \"[]\") {\n\t\tif actualTypeKind == refl.Slice || actualTypeKind == refl.Array {\n\t\t\texpectedType = expectedType[:len(expectedType)-2]\n\t\t\tactualType = actualType.Elem()\n\t\t\treturn c.MatchTypeByName(expectedType, actualType)\n\t\t}\n\t}\n\n\treturn false\n}", "title": "" }, { "docid": "65d1d68574955b7eb5c2686c509ce6d2", "score": "0.54581743", "text": "func IsVval(input interface{}, v interface{}) bool {\n\tvar (\n\t\tvalobj map[string]interface{}\n\t\tvv interface{}\n\t\tok bool\n\t)\n\n\tswitch input.(type) {\n\tcase map[string]interface{}:\n\t\tvalobj = input.(map[string]interface{})\n\t\t_, ok = valobj[\"@type\"]\n\t\tif ok {\n\t\t\treturn false\n\t\t}\n\t\tvv, ok = valobj[\"@value\"]\n\t\tif !ok {\n\t\t\treturn false\n\t\t}\n\tdefault:\n\t\tvv = input\n\t}\n\n\tswitch vv.(type) {\n\tcase string:\n\t\tswitch v.(type) {\n\t\tcase string:\n\t\t\treturn v.(string) == vv.(string)\n\t\tdefault:\n\t\t\treturn false\n\t\t}\n\tcase bool:\n\t\tswitch v.(type) {\n\t\tcase bool:\n\t\t\treturn v.(bool) == vv.(bool)\n\t\tdefault:\n\t\t\treturn false\n\t\t}\n\tcase int:\n\t\tswitch v.(type) {\n\t\tcase int:\n\t\t\treturn v.(int) == vv.(int)\n\t\tdefault:\n\t\t\treturn false\n\t\t}\n\tcase float64:\n\t\tswitch v.(type) {\n\t\tcase float64:\n\t\t\treturn v.(float64) == vv.(float64)\n\t\tdefault:\n\t\t\treturn false\n\t\t}\n\tcase nil:\n\t\tswitch v.(type) {\n\t\tcase nil:\n\t\t\treturn true\n\t\tdefault:\n\t\t\treturn false\n\t\t}\n\tdefault:\n\t\treturn false\n\t}\n}", "title": "" }, { "docid": "10e6e45c71c7cb1c20d36c4c29343ce4", "score": "0.5449346", "text": "func isValueValidForTermType(t TermType, value string) (interface{}, bool) {\n\tswitch t {\n\tcase TermString:\n\t\treturn value, true\n\tcase TermInt:\n\t\tn, err := strconv.Atoi(value)\n\t\tif err != nil {\n\t\t\treturn nil, false\n\t\t}\n\n\t\treturn n, true\n\tcase TermFloat:\n\t\tn, err := strconv.ParseFloat(value, 64)\n\t\tif err != nil {\n\t\t\treturn nil, false\n\t\t}\n\n\t\treturn n, true\n\tdefault:\n\t\tpanic(ErrInvalidTermType)\n\t}\n}", "title": "" }, { "docid": "3bf8502ee9f4b2fccf60bad69b6a94c4", "score": "0.5442294", "text": "func (*clusterRoleImpl) IsTypeOf(s interface{}, p graphql.IsTypeOfParams) bool {\n\t_, ok := s.(*corev2.ClusterRole)\n\treturn ok\n}", "title": "" }, { "docid": "f7003ed7def22582280f53c30dd38828", "score": "0.543617", "text": "func (t FuncType) IsFuncType() bool { return true }", "title": "" }, { "docid": "e9126a0a8f0d1a31ea6af5206ea9381a", "score": "0.54354405", "text": "func isTypeOk(name, content string, allowedTypes map[string]bool) error {\n\tif !allowedTypes[\"string\"] { // String output types are always passed through as the escape hatch for non-JSON bundle outputs.\n\t\tvar value interface{}\n\t\tif err := json.Unmarshal([]byte(content), &value); err != nil {\n\t\t\treturn fmt.Errorf(\"failed to parse %q: %s\", name, err)\n\t\t}\n\n\t\tv, err := golangTypeToJSONType(value)\n\t\tif err != nil {\n\t\t\treturn fmt.Errorf(\"%q is not a known JSON type. Expected %q to be one of: %s\", name, v, keys(allowedTypes))\n\t\t}\n\t\tif !allowedTypes[v] {\n\t\t\treturn fmt.Errorf(\"%q is not any of the expected types (%s) because it is %q\", name, keys(allowedTypes), v)\n\t\t}\n\t}\n\treturn nil\n}", "title": "" }, { "docid": "5643042b0bb58db7f9b48bb21968f9f5", "score": "0.543203", "text": "func (i verifyType) IsAverifyType() bool {\n\tfor _, v := range _verifyTypeValues {\n\t\tif i == v {\n\t\t\treturn true\n\t\t}\n\t}\n\treturn false\n}", "title": "" }, { "docid": "5ee5c5e721baec58509be5ad5da354f6", "score": "0.5428393", "text": "func (obj *typ) IsString() bool {\n\treturn obj.isString\n}", "title": "" }, { "docid": "fb2e72b7f9f71e69f64181a58a4978e8", "score": "0.5421277", "text": "func (h HeaderOf[T]) Is(value T) Endpoint {\n\tswitch v := any(value).(type) {\n\tcase string:\n\t\treturn func(ctx *Context) error {\n\t\t\treturn isHeaderEqString(ctx, string(h), v)\n\t\t}\n\tcase int:\n\t\treturn func(ctx *Context) error {\n\t\t\treturn isHeaderEqInt(ctx, string(h), v)\n\t\t}\n\tcase time.Time:\n\t\treturn func(ctx *Context) error {\n\t\t\treturn isHeaderEqTime(ctx, string(h), v)\n\t\t}\n\tdefault:\n\t\tpanic(\"invalid type\")\n\t}\n}", "title": "" }, { "docid": "a4e3cd2630a847fe6addb3b5ddf49337", "score": "0.542109", "text": "func (r *Result) HasType() bool {\n\tif r.Type != \"\" {\n\t\treturn true\n\t}\n\treturn false\n}", "title": "" }, { "docid": "d3c1c12b15fcb3043e50aebfeafe2785", "score": "0.5415702", "text": "func (v Value) Type() string {\n\treturn \"value\"\n}", "title": "" }, { "docid": "5f4e1223bf884bb5528e04a4c0030c55", "score": "0.54066455", "text": "func OfStructType(obj interface{}, check string) bool {\n\treturn isStructType(obj, check)\n}", "title": "" }, { "docid": "98fd2bbebe4242e16f4d5597ac467877", "score": "0.5403913", "text": "func isStructType(obj interface{}, check string) bool {\n\tvalue := reflect.ValueOf(obj).Type().String()\n\n\tif len(value) == 0 {\n\t\treturn false\n\t}\n\n\tif string(value[0]) == \"*\" {\n\t\tvalue = value[1:]\n\t}\n\n\treturn value == check\n}", "title": "" }, { "docid": "aed6281b18a742830badbd6a9fa68200", "score": "0.54033965", "text": "func (me *Struct) TypeOf(path string) string {\n\tif me.data[path] == nil {\n\t\treturn \"nil\"\n\t}\n\treturn reflect.TypeOf(*me.data[path]).String()\n}", "title": "" }, { "docid": "35bfd758c02c755114f5456a6dc561cf", "score": "0.5399636", "text": "func (n *Names) TypeOf(x interface{}) (*Type, error) {\n\treturn avroTypeOf(n, reflect.TypeOf(x))\n}", "title": "" }, { "docid": "581eeeabf27555f9456f1699314e9f1e", "score": "0.53964514", "text": "func String(obj interface{}) bool {\n\treturn isType(obj, reflect.String)\n}", "title": "" }, { "docid": "3970fe0e8af0c84a311f7889f8a2a0f2", "score": "0.5391564", "text": "func (t Type) IsBuiltin() bool {\n\t_, ok := scalarTypes[t.TypeString()]\n\treturn ok\n}", "title": "" }, { "docid": "507b41aa2bba53443d153e91e02329ac", "score": "0.53702015", "text": "func (this *IfInf) Type() value.Type { return value.NUMBER }", "title": "" }, { "docid": "90e3223799e4a7af392f555477289c0e", "score": "0.53661346", "text": "func isNillableType(value *reflect.Value) bool {\n\tk := value.Kind()\n\tswitch k {\n\tcase reflect.Chan, reflect.Func, reflect.Map, reflect.Ptr, reflect.Interface, reflect.Slice:\n\t\treturn true\n\t}\n\treturn false\n}", "title": "" }, { "docid": "be319b297a5649454cb00888dd854545", "score": "0.534891", "text": "func (this *Node) IsValue() bool {\n _, ok := this.node.(*ValueNode)\n return ok\n}", "title": "" }, { "docid": "d6b4f20536460d158693c4d3b157246f", "score": "0.53471565", "text": "func (*InstLShr) isValue() {}", "title": "" }, { "docid": "535dd2b9b5eabdcd6880e1cc9c259725", "score": "0.5337808", "text": "func (o *RegistryRequest) HasType() bool {\n\tif o != nil && o.Type != nil {\n\t\treturn true\n\t}\n\n\treturn false\n}", "title": "" }, { "docid": "619a3614d00e095c51358a4f89b81068", "score": "0.53350514", "text": "func (m *contentType) isOfContentType(r *http.Request) bool {\n\tcontentTypeHeader := r.Header.Get(\"Content-Type\")\n\n\tif !m.strict {\n\t\treturn strings.Split(contentTypeHeader, \";\")[0] == m.contentType\n\t}\n\n\treturn contentTypeHeader == m.contentType\n}", "title": "" }, { "docid": "55ca5cfc24ff30ae65e3eef95ec64f44", "score": "0.53347236", "text": "func TypeOf(v interface{}) ColumnType {\n\n\tswitch v.(type) {\n\tcase Int:\n\t\treturn IntType\n\tcase Uint:\n\t\treturn UintType\n\tcase Float:\n\t\treturn FloatType\n\tcase Text:\n\t\treturn TextType\n\tcase Binary:\n\t\treturn BinaryType\n\tcase Bool:\n\t\treturn BoolType\n\tcase Timestamp:\n\t\treturn TimestampType\n\tcase Set:\n\t\treturn SetType\n\tcase Map:\n\t\treturn MapType\n\tcase List:\n\t\treturn ListType\n\n\t}\n\n\treturn UnknownType\n}", "title": "" }, { "docid": "cf8f4c05d32f28ba2c3cf8c18b59f482", "score": "0.5334194", "text": "func TypeOf(pred string) types.Type {\n\tif obj, ok := str[pred]; ok {\n\t\treturn obj\n\t}\n\tif typ, ok := getScalar(pred); ok {\n\t\treturn typ\n\t}\n\treturn nil\n}", "title": "" }, { "docid": "91f08acc0ae380e1339fc828189bf279", "score": "0.53056806", "text": "func Type(v string) predicate.Decision {\n\treturn predicate.Decision(func(s *sql.Selector) {\n\t\ts.Where(sql.EQ(s.C(FieldType), v))\n\t})\n}", "title": "" }, { "docid": "1f1195cb18fdca04c8ed5c8c4b0a6ca1", "score": "0.52926636", "text": "func (HomogeneousType) Match(types []*types.T) bool {\n\treturn true\n}", "title": "" }, { "docid": "010da90f05d46dce4d80619edc699889", "score": "0.52888227", "text": "func (recv *VariantType) IsSubtypeOf(supertype *VariantType) bool {\n\tc_supertype := (*C.GVariantType)(C.NULL)\n\tif supertype != nil {\n\t\tc_supertype = (*C.GVariantType)(supertype.ToC())\n\t}\n\n\tretC := C.g_variant_type_is_subtype_of((*C.GVariantType)(recv.native), c_supertype)\n\tretGo := retC == C.TRUE\n\n\treturn retGo\n}", "title": "" }, { "docid": "9243b48c37b47966d0d8360a2f57bf81", "score": "0.5286007", "text": "func IsMetadata(t Type) bool {\n\t_, ok := t.(*MetadataType)\n\treturn ok\n}", "title": "" }, { "docid": "3f7f2fa85717c2eafedc75f603282594", "score": "0.52814156", "text": "func (k Kind) IsNumber() bool {\n\treturn k != String\n}", "title": "" }, { "docid": "c27c3729bd47bdcd1fdbd231290b6f5a", "score": "0.52777207", "text": "func Type(v interface{}) ValueType {\n\tt := Unknown\n\tswitch v.(type) {\n\tcase nil:\n\t\tt = Null\n\tcase bool:\n\t\tt = Bool\n\tcase string:\n\t\tt = String\n\tcase float64:\n\t\tt = Number\n\tcase []interface{}:\n\t\tt = Array\n\tcase map[string]interface{}:\n\t\tt = Object\n\t}\n\treturn t\n}", "title": "" }, { "docid": "e989224b6e03cca43e90c43f82494506", "score": "0.5274163", "text": "func IsTypeSupported(t types.Type) bool {\n\treturn isTypeSupported(t)\n}", "title": "" } ]
ba68c6e779b9a55d30c6e5a31776b885
Return a slice of Txs which can summarise all txs in `deltas` up to `latestDate`. Multiple Txs might be returned if it is not possible to accurately summarise in a single Tx without altering superficial losses (and preserving overall capital gains?) Note that `deltas` should provide all TXs for 60 days after latestDate, otherwise the summary may become innacurate/problematic if a new TX were added within that 60 day period after, and introduced a new superficial loss within 30 days of the summary. eg 1. (cannot be summarized)
[ { "docid": "dd591be8fad2b0de15c0333d5df0f533", "score": "0.63129556", "text": "func MakeSummaryTxs(latestDate date.Date, deltas []*TxDelta, splitAnnualGains bool) ([]*Tx, []string) {\n\tlatestDeltaInSummaryRangeIdx, latestSummarizableDeltaIdx, warnings_ :=\n\t\tgetSummaryRangeDeltaIndicies(latestDate, deltas)\n\tif latestDeltaInSummaryRangeIdx < 0 {\n\t\treturn nil, warnings_\n\t}\n\n\t// Create a map of affiliate to its last summarizable delta index. Not all\n\t// affiliates will have one.\n\taffilLastSummarizableDeltaIdxs := map[*Affiliate]int{}\n\t// affilIds will be sorted alphabetically for determinism\n\taffilIds := []string{}\n\tfor i := latestSummarizableDeltaIdx; i >= 0; i-- {\n\t\taf := NonNilTxAffiliate(deltas[i].Tx)\n\t\tif _, ok := affilLastSummarizableDeltaIdxs[af]; !ok {\n\t\t\taffilLastSummarizableDeltaIdxs[af] = i\n\t\t\taffilIds = append(affilIds, af.Id())\n\t\t}\n\t}\n\tsort.Strings(affilIds)\n\n\tvar summaryPeriodTxs []*Tx = make([]*Tx, 0, 0)\n\twarnings := util.NewSet[string]()\n\tfor _, afId := range affilIds {\n\t\taf := GlobalAffiliateDedupTable.MustGet(afId)\n\t\taffilLastSummarizableDeltaIdx := affilLastSummarizableDeltaIdxs[af]\n\n\t\tvar afSumTxs []*Tx\n\t\tvar warns []string\n\t\tif splitAnnualGains {\n\t\t\tafSumTxs, warns = makeAnnualGainsSummaryTxs(\n\t\t\t\taf, deltas, affilLastSummarizableDeltaIdx)\n\t\t} else {\n\t\t\tafSumTxs, warns = makeSimpleSummaryTxs(\n\t\t\t\taf, deltas, affilLastSummarizableDeltaIdx)\n\t\t}\n\t\tsummaryPeriodTxs = append(summaryPeriodTxs, afSumTxs...)\n\t\twarnings.AddAll(warns)\n\t}\n\tfor i, tx := range summaryPeriodTxs {\n\t\ttx.ReadIndex = uint32(i)\n\t}\n\tsummaryPeriodTxs = SortTxs(summaryPeriodTxs)\n\tfor _, tx := range summaryPeriodTxs {\n\t\ttx.ReadIndex = 0\n\t}\n\n\tunsummarizableTxs := deltas[latestSummarizableDeltaIdx+1 : latestDeltaInSummaryRangeIdx+1]\n\tif len(unsummarizableTxs) > 0 {\n\t\twarnings.Add(\n\t\t\t\"Some transactions to be summarized could not be due to superficial-loss conflicts\")\n\t}\n\tfor _, delta := range unsummarizableTxs {\n\t\tsummaryPeriodTxs = append(summaryPeriodTxs, delta.Tx)\n\t}\n\n\ttoday := date.Today()\n\tif latestDeltaInSummaryRangeIdx != -1 {\n\t\tlastSummarizableDelta := deltas[latestDeltaInSummaryRangeIdx]\n\t\t// Find the very latest day that could possibly ever affect or be affected by\n\t\t// the last tx. This should be 60 days.\n\t\tlastAffectingDay := GetLastDayInSuperficialLossPeriod(\n\t\t\tGetLastDayInSuperficialLossPeriod(lastSummarizableDelta.Tx.SettlementDate))\n\t\tif !today.After(lastAffectingDay) {\n\t\t\twarnings.Add(\n\t\t\t\t\"The current date is such that new TXs could potentially alter how the \" +\n\t\t\t\t\t\"summary is created. You should wait 60 days after your latest \" +\n\t\t\t\t\t\"transaction within the summary period to generate the summary\")\n\t\t}\n\t}\n\n\tvar warningsSlice []string\n\tif warnings.Len() > 0 {\n\t\twarningsSlice = warnings.ToSlice()\n\t}\n\treturn summaryPeriodTxs, warningsSlice\n}", "title": "" } ]
[ { "docid": "49cb607ba4558219493f46d77a25ff5e", "score": "0.59089243", "text": "func getSummaryRangeDeltaIndicies(latestDate date.Date, deltas []*TxDelta) (int, int, []string) {\n\t// Step 1: Find the latest Delta <= latestDate\n\tlatestDeltaInSummaryRangeIdx := -1\n\tfor i, delta := range deltas {\n\t\tif delta.Tx.SettlementDate.After(latestDate) {\n\t\t\tbreak\n\t\t}\n\t\tlatestDeltaInSummaryRangeIdx = i\n\t}\n\tif latestDeltaInSummaryRangeIdx == -1 {\n\t\treturn -1, -1, []string{\"No transactions in the summary period\"}\n\t}\n\n\t// Step 2: determine if any of the TXs within 30 days of latestDate are\n\t// superficial losses.\n\t// If any are, save the date 30 days prior to it (firstSuperficialLossPeriodDay)\n\ttxInSummaryOverlapsSuperficialLoss := false\n\tfirstSuperficialLossPeriodDay := date.New(3000, time.January, 1)\n\tlatestInSummaryDate := deltas[latestDeltaInSummaryRangeIdx].Tx.SettlementDate\n\tfor _, delta := range deltas[latestDeltaInSummaryRangeIdx+1:] {\n\t\tif delta.SuperficialLoss != 0.0 {\n\t\t\tfirstSuperficialLossPeriodDay = GetFirstDayInSuperficialLossPeriod(delta.Tx.SettlementDate)\n\t\t\ttxInSummaryOverlapsSuperficialLoss = !latestInSummaryDate.Before(firstSuperficialLossPeriodDay)\n\t\t\tbreak\n\t\t}\n\t}\n\n\t// Step 3: Find the latest TX in the summary period that can't affect any\n\t// unsummarized superficial losses.\n\tlatestSummarizableDeltaIdx := -1\n\tif txInSummaryOverlapsSuperficialLoss {\n\t\t// Find the txs which we wanted to summarize, but can't because they can affect\n\t\t// this superficial loss' partial calculation.\n\t\t// This will be any tx within the 30 day period of the first superficial loss\n\t\t// after the summary boundary, but also every tx within the 30 period\n\t\t// of any superficial loss at the end of the summary range.\n\t\tfor i := latestDeltaInSummaryRangeIdx; i >= 0; i-- {\n\t\t\tdelta := deltas[i]\n\t\t\tif delta.Tx.SettlementDate.Before(firstSuperficialLossPeriodDay) {\n\t\t\t\tlatestSummarizableDeltaIdx = i\n\t\t\t\tbreak\n\t\t\t}\n\t\t\tif delta.SuperficialLoss != 0.0 {\n\t\t\t\t// We've encountered another superficial loss within the summary\n\t\t\t\t// range. This can be affected by previous txs, so we need to now push\n\t\t\t\t// up the period where we can't find any txs.\n\t\t\t\tfirstSuperficialLossPeriodDay = GetFirstDayInSuperficialLossPeriod(delta.Tx.SettlementDate)\n\t\t\t}\n\t\t}\n\t} else {\n\t\tlatestSummarizableDeltaIdx = latestDeltaInSummaryRangeIdx\n\t}\n\n\treturn latestDeltaInSummaryRangeIdx, latestSummarizableDeltaIdx, nil\n}", "title": "" }, { "docid": "57c0b638b227a057bc17d736118db0dc", "score": "0.474305", "text": "func (eth *EthClient) GetPastNodesStakeUpdatedEvents(startBlock big.Int) ([]ChpRegistryNodeStakeUpdated, error) {\n\tregistryAddr := common.HexToAddress(eth.RegistryContractAddr)\n\tregistryInstance, err := NewChpRegistry(registryAddr, &eth.Client)\n\tif util.LoggerError(eth.Logger, err) != nil {\n\t\treturn []ChpRegistryNodeStakeUpdated{}, err\n\t}\n\tctx, cancel := context.WithTimeout(context.Background(), 20*time.Second)\n\tdefer cancel()\n\topt := &bind.FilterOpts{Context: ctx}\n\tstart := startBlock.Uint64()\n\topt.Start = start\n\ts := []common.Address{}\n\tstaked, err := registryInstance.FilterNodeStakeUpdated(opt, s)\n\tif util.LoggerError(eth.Logger, err) != nil {\n\t\treturn []ChpRegistryNodeStakeUpdated{}, err\n\t}\n\tnodeStructSlice := make([]ChpRegistryNodeStakeUpdated, 0)\n\tnotEmpty := true\n\tfor notEmpty {\n\t\tnotEmpty = staked.Next()\n\t\tif notEmpty {\n\t\t\tnodeStructSlice = append(nodeStructSlice, *staked.Event)\n\t\t}\n\t}\n\treturn nodeStructSlice, nil\n}", "title": "" }, { "docid": "360f8d2e89fe551ae4b5472e3fc14fd8", "score": "0.45925158", "text": "func GetLatestStats() (s []Statistic, err error) {\n\tminTime := time.Now().Add(-(24 * time.Hour))\n\tvar stats []Statistic\n\tstats, err = GetStats()\n\tif err != nil {\n\t\treturn\n\t}\n\tfor _, stat := range stats {\n\t\tif stat.StatTime > minTime.Unix() {\n\t\t\ts = append(s, stat)\n\t\t}\n\t}\n\treturn\n}", "title": "" }, { "docid": "c3ff8707515b3601d006da19ef19c64d", "score": "0.454397", "text": "func (s *volumeStatCalculator) GetLatest() ([]VolumeStats, bool) {\n\tif result := s.latest.Load(); result == nil {\n\t\treturn []VolumeStats{}, false\n\t} else {\n\t\treturn result.([]VolumeStats), true\n\t}\n}", "title": "" }, { "docid": "4fb61e873bb5cacbb0a4b142c0190f6e", "score": "0.45438403", "text": "func (c *COINUT) GetRecentTrades(ctx context.Context, p currency.Pair, assetType asset.Item) ([]trade.Data, error) {\n\tvar err error\n\tp, err = c.FormatExchangeCurrency(p, assetType)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\tcurrencyID := c.instrumentMap.LookupID(p.String())\n\tif currencyID == 0 {\n\t\treturn nil, errLookupInstrumentID\n\t}\n\tvar tradeData Trades\n\ttradeData, err = c.GetTrades(ctx, currencyID)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\tresp := make([]trade.Data, len(tradeData.Trades))\n\tfor i := range tradeData.Trades {\n\t\tvar side order.Side\n\t\tside, err = order.StringToOrderSide(tradeData.Trades[i].Side)\n\t\tif err != nil {\n\t\t\treturn nil, err\n\t\t}\n\t\tresp[i] = trade.Data{\n\t\t\tExchange: c.Name,\n\t\t\tTID: strconv.FormatInt(tradeData.Trades[i].TransactionID, 10),\n\t\t\tCurrencyPair: p,\n\t\t\tAssetType: assetType,\n\t\t\tSide: side,\n\t\t\tPrice: tradeData.Trades[i].Price,\n\t\t\tAmount: tradeData.Trades[i].Quantity,\n\t\t\tTimestamp: time.Unix(0, tradeData.Trades[i].Timestamp*int64(time.Microsecond)),\n\t\t}\n\t}\n\n\terr = c.AddTradesToBuffer(resp...)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\tsort.Sort(trade.ByDate(resp))\n\treturn resp, nil\n}", "title": "" }, { "docid": "51888d69b8b55c301bd72364316a8b4c", "score": "0.44924915", "text": "func (t transactions) fetchLastTxs(db database.DB, count int, maxBlocks int) ([]queryTx, error) {\n\ttxs := make([]queryTx, 0)\n\n\tif count <= 0 || maxBlocks <= 0 {\n\t\treturn txs, nil\n\t}\n\n\tif count > txsFetchLimit {\n\t\tmsg := \"requested txs count exceeds the limit\"\n\t\tlog.WithField(\"txsFetchLimit\", txsFetchLimit).\n\t\t\tWarn(msg)\n\t\treturn txs, errors.New(msg)\n\t}\n\n\tif maxBlocks > txsBlocksFetchLimit {\n\t\tmsg := \"requested txs MaxBlock count exceeds the limit\"\n\t\tlog.WithField(\"txsBlocksFetchLimit\", txsBlocksFetchLimit).\n\t\t\tWarn(msg)\n\t\treturn txs, errors.New(msg)\n\t}\n\n\terr := db.View(func(t database.Transaction) error {\n\t\tvar tip uint64\n\t\ttip, err := t.FetchCurrentHeight()\n\t\tif err != nil {\n\t\t\treturn err\n\t\t}\n\n\t\theight := tip\n\n\t\tfor {\n\t\t\thash, err := t.FetchBlockHashByHeight(height)\n\t\t\tif err != nil {\n\t\t\t\treturn err\n\t\t\t}\n\n\t\t\tblockTxs, err := t.FetchBlockTxs(hash)\n\t\t\tif err != nil {\n\t\t\t\treturn err\n\t\t\t}\n\n\t\t\theader, err := t.FetchBlockHeader(hash)\n\t\t\tif err != nil {\n\t\t\t\treturn err\n\t\t\t}\n\n\t\t\tfor _, tx := range blockTxs {\n\t\t\t\td, err := newQueryTx(tx, header.Hash, header.Timestamp, header.Height)\n\t\t\t\tif err == nil {\n\t\t\t\t\ttxs = append(txs, d)\n\t\t\t\t}\n\n\t\t\t\tif len(txs) >= count {\n\t\t\t\t\treturn nil\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tmaxBlocks--\n\t\t\tif maxBlocks <= 0 {\n\t\t\t\tbreak\n\t\t\t}\n\n\t\t\tif height == 0 {\n\t\t\t\tbreak\n\t\t\t}\n\n\t\t\theight--\n\t\t}\n\n\t\treturn nil\n\t})\n\n\treturn txs, err\n}", "title": "" }, { "docid": "94c9545da82c79405b8ba896fdcd9c7f", "score": "0.44146305", "text": "func Newest(limit int) ([]bobstore.Ref, error) {\n\treturn byPrefix([]byte(\"\"), kmByDate, limit)\n}", "title": "" }, { "docid": "71f50d8ee9f627cb8840d4ca15e85881", "score": "0.44083992", "text": "func (ng *crdtNodeGetter) GetDeltas(ctx context.Context, cids []cid.Cid) <-chan *deltaOption {\n\tdeltaOpts := make(chan *deltaOption, 1)\n\tgo func() {\n\t\tdefer close(deltaOpts)\n\t\tnodeOpts := ng.GetMany(ctx, cids)\n\t\tfor nodeOpt := range nodeOpts {\n\t\t\tif nodeOpt.Err != nil {\n\t\t\t\tdeltaOpts <- &deltaOption{err: nodeOpt.Err}\n\t\t\t\tcontinue\n\t\t\t}\n\t\t\tdelta, err := extractDelta(nodeOpt.Node)\n\t\t\tif err != nil {\n\t\t\t\tdeltaOpts <- &deltaOption{err: err}\n\t\t\t\tcontinue\n\t\t\t}\n\t\t\tdeltaOpts <- &deltaOption{\n\t\t\t\tdelta: delta,\n\t\t\t\tnode: nodeOpt.Node,\n\t\t\t}\n\t\t}\n\t}()\n\treturn deltaOpts\n}", "title": "" }, { "docid": "005e0a9a06363374c24a7244846aa18d", "score": "0.43871617", "text": "func fetchTxsForAddressNotBefore(ctx context.Context, params *chaincfg.Params, address string, notBefore int64, dcrdataURL string) ([]TxDetails, error) {\n\t// Get block explorer URL\n\taddr, err := dcrutil.DecodeAddress(address, params)\n\tif err != nil {\n\t\treturn nil, fmt.Errorf(\"invalid address %v: %v\", addr, err)\n\t}\n\n\t// Construct proper dcrdata url\n\tdcrdataURL += \"/address/\" + address\n\n\t// Fetch all txs for the passed in wallet address\n\t// that were sent after the notBefore timestamp\n\tvar (\n\t\ttargetTxs []TxDetails\n\t\tcount = 10\n\t\tskip = 0\n\t\tdone = false\n\t)\n\tfor !done {\n\t\t// Fetch a page of user payment txs\n\t\turl := dcrdataURL + \"/count/\" + strconv.Itoa(count) +\n\t\t\t\"/skip/\" + strconv.Itoa(skip) + \"/raw\"\n\t\tdcrdataTxs, err := fetchTxsWithBE(ctx, url)\n\t\tif err != nil {\n\t\t\treturn nil, fmt.Errorf(\"fetchDcrdataAddress: %v\", err)\n\t\t}\n\t\t// Convert transactions to TxDetails\n\t\ttxs := make([]TxDetails, len(dcrdataTxs))\n\t\tfor _, tx := range dcrdataTxs {\n\t\t\ttxDetails, err := convertBETransactionToTxDetails(address, tx)\n\t\t\tif err != nil {\n\t\t\t\treturn nil, fmt.Errorf(\"convertBETransactionToTxDetails: %v\",\n\t\t\t\t\ttx.TxId)\n\t\t\t}\n\t\t\ttxs = append(txs, *txDetails)\n\t\t}\n\t\tif len(txs) == 0 {\n\t\t\tdone = true\n\t\t\tcontinue\n\t\t}\n\t\t// Sanity check. Txs should already be sorted\n\t\t// in reverse chronological order.\n\t\tsort.SliceStable(txs, func(i, j int) bool {\n\t\t\treturn txs[i].Timestamp > txs[j].Timestamp\n\t\t})\n\n\t\t// Verify txs are within notBefore limit\n\t\tfor _, tx := range txs {\n\t\t\tif tx.Timestamp > notBefore {\n\t\t\t\ttargetTxs = append(targetTxs, tx)\n\t\t\t} else {\n\t\t\t\t// We have reached the notBefore\n\t\t\t\t// limit; stop requesting txs\n\t\t\t\tdone = true\n\t\t\t\tbreak\n\t\t\t}\n\t\t}\n\n\t\tskip += count\n\t}\n\n\treturn targetTxs, nil\n}", "title": "" }, { "docid": "945c282e989c0092ca0ccca0d75e0029", "score": "0.43834132", "text": "func (so *rebObject) newest() []*rebCT {\n\tvar l []*rebCT\n\tmax := 0\n\tfor _, ctList := range so.cts {\n\t\tif max < len(ctList) {\n\t\t\tmax = len(ctList)\n\t\t\tl = ctList\n\t\t}\n\t}\n\treturn l\n}", "title": "" }, { "docid": "b276121edff9dc667209c0ae16d94177", "score": "0.43592924", "text": "func head(since time.Duration, size int, reports []TestReport) []TestReport {\n\tret := make([]TestReport, 0)\n\tfor _, report := range reports {\n\t\tif report.date().Add(since).After(time.Now()) {\n\t\t\tret = append(ret, report)\n\t\t}\n\t}\n\treturn ret[:int(math.Min(float64(size), float64(len(ret))))]\n}", "title": "" }, { "docid": "47ac60083c2065e06c9ff95baa859036", "score": "0.43383068", "text": "func (eth *EthClient) GetPastNodesStakedEvents(startBlock big.Int) ([]ChpRegistryNodeStaked, error) {\n\tregistryAddr := common.HexToAddress(eth.RegistryContractAddr)\n\tregistryInstance, err := NewChpRegistry(registryAddr, &eth.Client)\n\tif util.LoggerError(eth.Logger, err) != nil {\n\t\treturn []ChpRegistryNodeStaked{}, err\n\t}\n\tctx, cancel := context.WithTimeout(context.Background(), 20*time.Second)\n\tdefer cancel()\n\topt := &bind.FilterOpts{Context: ctx}\n\tstart := startBlock.Uint64()\n\topt.Start = start\n\ts := []common.Address{}\n\tstaked, err := registryInstance.FilterNodeStaked(opt, s)\n\tif util.LoggerError(eth.Logger, err) != nil {\n\t\treturn []ChpRegistryNodeStaked{}, err\n\t}\n\tnodeStructSlice := make([]ChpRegistryNodeStaked, 0)\n\tnotEmpty := true\n\tfor notEmpty {\n\t\tnotEmpty = staked.Next()\n\t\tif notEmpty {\n\t\t\tnodeStructSlice = append(nodeStructSlice, *staked.Event)\n\t\t}\n\t}\n\treturn nodeStructSlice, nil\n}", "title": "" }, { "docid": "a8968657e5ee0516ac6e9d610880f7e8", "score": "0.43238547", "text": "func (z *ZB) GetRecentTrades(ctx context.Context, p currency.Pair, assetType asset.Item) ([]trade.Data, error) {\n\tvar err error\n\tp, err = z.FormatExchangeCurrency(p, assetType)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\tvar tradeData TradeHistory\n\ttradeData, err = z.GetTrades(ctx, p.String())\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\tresp := make([]trade.Data, len(tradeData))\n\tfor i := range tradeData {\n\t\tvar side order.Side\n\t\tside, err = order.StringToOrderSide(tradeData[i].Type)\n\t\tif err != nil {\n\t\t\treturn nil, err\n\t\t}\n\n\t\tresp[i] = trade.Data{\n\t\t\tExchange: z.Name,\n\t\t\tTID: strconv.FormatInt(tradeData[i].Tid, 10),\n\t\t\tCurrencyPair: p,\n\t\t\tAssetType: assetType,\n\t\t\tSide: side,\n\t\t\tPrice: tradeData[i].Price,\n\t\t\tAmount: tradeData[i].Amount,\n\t\t\tTimestamp: time.Unix(tradeData[i].Date, 0),\n\t\t}\n\t}\n\n\terr = z.AddTradesToBuffer(resp...)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\tsort.Sort(trade.ByDate(resp))\n\treturn resp, nil\n}", "title": "" }, { "docid": "fdf7543762374089f644eb36237369bd", "score": "0.43105286", "text": "func (eth *EthClient) GetPastNodesUnstakeEvents(startBlock big.Int) ([]ChpRegistryNodeUnStaked, error) {\n\tregistryAddr := common.HexToAddress(eth.RegistryContractAddr)\n\tregistryInstance, err := NewChpRegistry(registryAddr, &eth.Client)\n\tif util.LoggerError(eth.Logger, err) != nil {\n\t\treturn []ChpRegistryNodeUnStaked{}, err\n\t}\n\tctx, cancel := context.WithTimeout(context.Background(), 20*time.Second)\n\tdefer cancel()\n\topt := &bind.FilterOpts{Context: ctx}\n\tstart := startBlock.Uint64()\n\topt.Start = start\n\ts := []common.Address{}\n\tunStaked, err := registryInstance.FilterNodeUnStaked(opt, s)\n\tif util.LoggerError(eth.Logger, err) != nil {\n\t\treturn []ChpRegistryNodeUnStaked{}, err\n\t}\n\tnodeStructSlice := make([]ChpRegistryNodeUnStaked, 0)\n\tnotEmpty := true\n\tfor notEmpty {\n\t\tnotEmpty = unStaked.Next()\n\t\tif notEmpty {\n\t\t\tnodeStructSlice = append(nodeStructSlice, *unStaked.Event)\n\t\t}\n\t}\n\treturn nodeStructSlice, nil\n}", "title": "" }, { "docid": "480522f39a4b97f7c34e467993289b69", "score": "0.42516944", "text": "func (this *myList) isLatest(n *myNode) bool {\n\tif n.startId > this.head.startId {\n\t\treturn true\n\t} else if this.sum == 0 {\n\t\treturn true\n\t}\n\n\treturn false\n}", "title": "" }, { "docid": "4995ff4616ac7b45cd3667cee244f820", "score": "0.42365715", "text": "func fetchLatestTarVersions(url string) (versions map[string]Package, err error) {\n\tresp, err := http.Get(url)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\tdefer resp.Body.Close()\n\tdata, err := ioutil.ReadAll(resp.Body)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\tstart := bytes.Index(data, []byte(\"(\"))\n\tend := bytes.LastIndex(data, []byte(\")\"))\n\tif !(end > start && start > -1) {\n\t\treturn nil, errors.New(\"error in jsonp content\")\n\t}\n\tvar archives []Package\n\terr = json.Unmarshal(data[start+1:end], &archives)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\tversions = map[string]Package{}\n\tfor _, archive := range archives {\n\t\tfilename := path.Base(archive.ZipURL)\n\t\tif !strings.Contains(filename, \".tar.gz\") ||\n\t\t\t(strings.Contains(filename, \"enterprise\") && !strings.Contains(filename, \"standalone\")) ||\n\t\t\tstrings.Contains(filename, \"cluster\") ||\n\t\t\tstrings.Contains(filename, \"war\") {\n\t\t\tcontinue\n\t\t}\n\t\tmajmin := archive.Version.MajorMinor()\n\t\tv, ok := versions[majmin]\n\t\tif !ok || time.Time(archive.Released).After(time.Time(v.Released)) {\n\t\t\tversions[majmin] = archive\n\t\t}\n\t}\n\treturn versions, nil\n}", "title": "" }, { "docid": "53a86d8a9532e4d8c328a155a371afd9", "score": "0.41883692", "text": "func (eth *EthClient) GetPastCoresStakeUpdatedEvents(startBlock big.Int) ([]ChpRegistryCoreStakeUpdated, error) {\n\tregistryAddr := common.HexToAddress(eth.RegistryContractAddr)\n\tregistryInstance, err := NewChpRegistry(registryAddr, &eth.Client)\n\tif util.LoggerError(eth.Logger, err) != nil {\n\t\treturn []ChpRegistryCoreStakeUpdated{}, err\n\t}\n\tctx, cancel := context.WithTimeout(context.Background(), 20*time.Second)\n\tdefer cancel()\n\topt := &bind.FilterOpts{Context: ctx}\n\tstart := startBlock.Uint64()\n\topt.Start = start\n\ts := []common.Address{}\n\tstaked, err := registryInstance.FilterCoreStakeUpdated(opt, s)\n\tif util.LoggerError(eth.Logger, err) != nil {\n\t\treturn []ChpRegistryCoreStakeUpdated{}, err\n\t}\n\tnodeStructSlice := make([]ChpRegistryCoreStakeUpdated, 0)\n\tnotEmpty := true\n\tfor notEmpty {\n\t\tnotEmpty = staked.Next()\n\t\tif notEmpty {\n\t\t\tnodeStructSlice = append(nodeStructSlice, *staked.Event)\n\t\t}\n\t}\n\treturn nodeStructSlice, nil\n}", "title": "" }, { "docid": "7d3102dc8c36bc2d6062e7b9fb139426", "score": "0.4168257", "text": "func getLatestArtifact(artifacts []artifactInterface) artifactInterface {\n\treturnArtifact := artifacts[0]\n\tfor i := range artifacts {\n\t\tartifact := artifacts[i]\n\t\tif returnArtifact.Created_at.Before(artifact.Created_at) {\n\t\t\treturnArtifact = artifact\n\t\t}\n\t}\n\treturn returnArtifact\n}", "title": "" }, { "docid": "8b9d3fc6767439223c5a53a37a01e74c", "score": "0.4163165", "text": "func (top Top) Diff(previous Top) TopDiff {\n\t// The diff to eventually return\n\tdiff := TopDiff{\n\t\tTotals: map[string]NSTopInfo{},\n\t\tTime: time.Now(),\n\t}\n\n\t// For each namespace we are tracking, subtract the times and counts\n\t// for total/read/write and build a new map containing the diffs.\n\tprevTotals := previous.Totals\n\tcurTotals := top.Totals\n\tfor ns, prevNSInfo := range prevTotals {\n\t\tif curNSInfo, ok := curTotals[ns]; ok {\n\t\t\tdiff.Totals[ns] = NSTopInfo{\n\t\t\t\tTotal: TopField{\n\t\t\t\t\tTime: (curNSInfo.Total.Time - prevNSInfo.Total.Time) / 1000,\n\t\t\t\t\tCount: curNSInfo.Total.Count - prevNSInfo.Total.Count,\n\t\t\t\t},\n\t\t\t\tRead: TopField{\n\t\t\t\t\tTime: (curNSInfo.Read.Time - prevNSInfo.Read.Time) / 1000,\n\t\t\t\t\tCount: curNSInfo.Read.Count - prevNSInfo.Read.Count,\n\t\t\t\t},\n\t\t\t\tWrite: TopField{\n\t\t\t\t\tTime: (curNSInfo.Write.Time - prevNSInfo.Write.Time) / 1000,\n\t\t\t\t\tCount: curNSInfo.Write.Count - prevNSInfo.Write.Count,\n\t\t\t\t},\n\t\t\t}\n\t\t}\n\t}\n\treturn diff\n}", "title": "" }, { "docid": "b936ff5ac4d85e9176acd1100c4f8d63", "score": "0.41602477", "text": "func (tg *TradesGroup) Get() (result [][]schemas.Trade, err error) {\n\tvar b []byte\n\tvar trades []schemas.Trade\n\tfor _, symbol := range tg.symbols {\n\t\tvar resp []recentTrade\n\n\t\turl := apiTrades + \"?\" + \"symbol=\" + strings.ToUpper(symbol.OriginalName) + \"&limit=200\"\n\n\t\tif b, err = tg.httpClient.Get(url, httpclient.Params(), false); err != nil {\n\t\t\tlog.Println(\"Error\", err)\n\t\t\treturn\n\t\t}\n\t\tif err = json.Unmarshal(b, &resp); err != nil {\n\t\t\treturn\n\t\t}\n\n\t\ttrades, err = tg.mapSnapshot(resp, symbol.OriginalName)\n\t\tif err != nil {\n\t\t\tlog.Println(\"[BINANCE] Error mapping trades snapshot\", err)\n\t\t}\n\n\t\tresult = append(result, trades)\n\t}\n\n\treturn\n}", "title": "" }, { "docid": "09f5f0b24f8c8a55684dd46a243fa84d", "score": "0.41539374", "text": "func GetListOfCertsExpiringSoon(domain string, durationDays int) [][]string {\n\n\tdata := [][]string{}\n\tdb, err := sql.Open(\"postgres\", getPsqlInfo())\n\n\tif err != nil {\n\t\tlog.Error(err, \"Failed to establish connection with crt.sh database\")\n\t}\n\n\tdefer db.Close()\n\n\ttoday := time.Now().UTC()\n\n\tfutureDate := time.Now().UTC().AddDate(0, 0, durationDays)\n\n\tcertDuration := fmt.Sprintf(\"%d-%02d-%02d 00:00:00.000000\", today.Year(), today.Month(), today.Day())\n\n\tfutureDuration := fmt.Sprintf(\"%d-%02d-%02d 00:00:00.000000\", futureDate.Year(), futureDate.Month(), futureDate.Day())\n\n\trows, err := db.Query(GET_LIST_CERTS_ISSUED_BY_LE_SQL_EXPIRING_SOON, \"%.\"+domain, certDuration, futureDuration)\n\n\tif err != nil {\n\t\tlog.Error(err, \"Failed to recieve data from crt.sh database\")\n\t}\n\n\tdefer rows.Close()\n\n\tfor rows.Next() {\n\t\tvar name string\n\t\tvar notBefore string\n\t\tvar notAfter string\n\t\tvar row []string\n\n\t\terr = rows.Scan(&name, &notBefore, &notAfter)\n\n\t\tif err != nil {\n\t\t\tlog.Error(err, \"Error reading table\")\n\t\t}\n\n\t\trow = append(row, name)\n\t\trow = append(row, notBefore)\n\t\trow = append(row, notAfter)\n\n\t\tdata = append(data, row)\n\t}\n\n\terr = rows.Err()\n\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\n\treturn data\n}", "title": "" }, { "docid": "2c3f5a304267a11eb3ccf6f8f8773dca", "score": "0.41266963", "text": "func (by *Bybit) GetRecentTrades(ctx context.Context, p currency.Pair, assetType asset.Item) ([]trade.Data, error) {\n\tvar resp []trade.Data\n\n\tformattedPair, err := by.FormatExchangeCurrency(p, assetType)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\tswitch assetType {\n\tcase asset.Spot:\n\t\ttradeData, err := by.GetTrades(ctx, formattedPair.String(), 0)\n\t\tif err != nil {\n\t\t\treturn nil, err\n\t\t}\n\n\t\tfor i := range tradeData {\n\t\t\tresp = append(resp, trade.Data{\n\t\t\t\tExchange: by.Name,\n\t\t\t\tCurrencyPair: p,\n\t\t\t\tAssetType: assetType,\n\t\t\t\tPrice: tradeData[i].Price,\n\t\t\t\tAmount: tradeData[i].Volume,\n\t\t\t\tTimestamp: tradeData[i].Time,\n\t\t\t})\n\t\t}\n\n\tcase asset.CoinMarginedFutures, asset.Futures:\n\t\ttradeData, err := by.GetPublicTrades(ctx, formattedPair, 0)\n\t\tif err != nil {\n\t\t\treturn nil, err\n\t\t}\n\n\t\tfor i := range tradeData {\n\t\t\tresp = append(resp, trade.Data{\n\t\t\t\tExchange: by.Name,\n\t\t\t\tCurrencyPair: p,\n\t\t\t\tAssetType: assetType,\n\t\t\t\tPrice: tradeData[i].Price,\n\t\t\t\tAmount: tradeData[i].Qty,\n\t\t\t\tTimestamp: tradeData[i].Time,\n\t\t\t})\n\t\t}\n\n\tcase asset.USDTMarginedFutures:\n\t\ttradeData, err := by.GetUSDTPublicTrades(ctx, formattedPair, 0)\n\t\tif err != nil {\n\t\t\treturn nil, err\n\t\t}\n\n\t\tfor i := range tradeData {\n\t\t\tresp = append(resp, trade.Data{\n\t\t\t\tExchange: by.Name,\n\t\t\t\tCurrencyPair: p,\n\t\t\t\tAssetType: assetType,\n\t\t\t\tPrice: tradeData[i].Price,\n\t\t\t\tAmount: tradeData[i].Qty,\n\t\t\t\tTimestamp: tradeData[i].Time,\n\t\t\t})\n\t\t}\n\n\tcase asset.USDCMarginedFutures:\n\t\ttradeData, err := by.GetUSDCLatestTrades(ctx, formattedPair, \"PERPETUAL\", 0)\n\t\tif err != nil {\n\t\t\treturn nil, err\n\t\t}\n\n\t\tfor i := range tradeData {\n\t\t\tresp = append(resp, trade.Data{\n\t\t\t\tExchange: by.Name,\n\t\t\t\tCurrencyPair: p,\n\t\t\t\tAssetType: assetType,\n\t\t\t\tPrice: tradeData[i].OrderPrice.Float64(),\n\t\t\t\tAmount: tradeData[i].OrderQty.Float64(),\n\t\t\t\tTimestamp: tradeData[i].Timestamp.Time(),\n\t\t\t})\n\t\t}\n\n\tdefault:\n\t\treturn nil, fmt.Errorf(\"%s %w\", assetType, asset.ErrNotSupported)\n\t}\n\n\tif by.IsSaveTradeDataEnabled() {\n\t\terr := trade.AddTradesToBuffer(by.Name, resp...)\n\t\tif err != nil {\n\t\t\treturn nil, err\n\t\t}\n\t}\n\n\tsort.Sort(trade.ByDate(resp))\n\treturn resp, nil\n}", "title": "" }, { "docid": "5546a5e7ccb20d137c24ce20d0c29d78", "score": "0.41073498", "text": "func (ceres *Ceres) Fetch(fromTime, untilTime int64) (timeSeries *TimeSeries, err error) {\n\tnow := ceres.TimeNow().Unix() // TODO: danger of 2030 something overflow\n\tif fromTime > untilTime {\n\t\t// TODO: use errors\n\t\treturn nil, ErrInvalidFrom\n\t}\n\toldestTime := ceres.StartTime()\n\t// range is in the future\n\t// TODO: think about breaking compatibility and allow to read future datapoints\n\tif fromTime > now {\n\t\treturn nil, nil\n\t}\n\t// range is beyond retention\n\tif untilTime < oldestTime {\n\t\treturn nil, nil\n\t}\n\tif fromTime < oldestTime {\n\t\tfromTime = oldestTime\n\t}\n\tif untilTime > now {\n\t\tuntilTime = now\n\t}\n\n\t// Get list of all archives that needs to be read\n\tarchivesToRead := make([]*CeresSlice, 0)\n\tstepTime := int64(-1)\n\tfor _, archives := range ceres.archives {\n\t\tfor _, archive := range archives {\n\t\t\tarchiveStartTime := archive.MinRetention()\n\t\t\t// Assumption: our start time is wi\n\t\t\tif archiveStartTime > untilTime {\n\t\t\t\tbreak\n\t\t\t}\n\t\t\tarchiveStopTime := archive.MaxRetention()\n\t\t\tif isInInterval(archiveStartTime, archiveStopTime, fromTime, untilTime) {\n\t\t\t\tarchivesToRead = append(archivesToRead, archive)\n\t\t\t\tif archive.Step() > stepTime {\n\t\t\t\t\tstepTime = archive.Step()\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\n\tres := TimeSeries{\n\t\tfromTime: int(fromTime),\n\t\tuntilTime: int(untilTime),\n\t\tstep: int(stepTime),\n\t\tvalues: make([]float64, fromTime-untilTime),\n\t}\n\n\t/*\n\t\tbase := fromTime\n\t\tfor _, archive := range archivesToRead {\n\n\t\t}\n\t*/\n\n\treturn &res, nil\n\n\t/*\n\t\tfromInterval := archive.Interval(fromTime)\n\t\tuntilInterval := archive.Interval(untilTime)\n\t\tbaseInterval := ceres.getBaseInterval(archive)\n\n\t\tif baseInterval == 0 {\n\t\t\tstep := archive.SecondsPerPoint\n\t\t\tPoints := (untilInterval - fromInterval) / step\n\t\t\tvalues := make([]float64, Points)\n\t\t\tfor i := range values {\n\t\t\t\tvalues[i] = math.NaN()\n\t\t\t}\n\t\t\treturn &TimeSeries{fromInterval, untilInterval, step, values}, nil\n\t\t}\n\n\t\t// Zero-length time range: always include the next point\n\t\tif fromInterval == untilInterval {\n\t\t\tuntilInterval += archive.SecondsPerPoint\n\t\t}\n\n\t\tfromOffset := archive.PointOffset(baseInterval, fromInterval)\n\t\tuntilOffset := archive.PointOffset(baseInterval, untilInterval)\n\n\t\tseries, err := ceres.readSeries(fromOffset, untilOffset, archive)\n\t\tif err != nil {\n\t\t\treturn nil, err\n\t\t}\n\n\t\tvalues := make([]float64, len(series))\n\t\tfor i := range values {\n\t\t\tvalues[i] = math.NaN()\n\t\t}\n\t\tcurrentInterval := fromInterval\n\t\tstep := archive.SecondsPerPoint\n\n\t\tfor i, dPoint := range series {\n\t\t\tif dPoint.interval == currentInterval {\n\t\t\t\tvalues[i] = dPoint.value\n\t\t\t}\n\t\t\tcurrentInterval += step\n\t\t}\n\n\t\treturn &TimeSeries{fromInterval, untilInterval, step, values}, nil\n\t*/\n}", "title": "" }, { "docid": "4a92d0a0549740203ff24fed673cf76d", "score": "0.4104351", "text": "func FetchLatest() []BeautifiedPlacementData {\n\treturn beautifyData(scrapeAll())\n}", "title": "" }, { "docid": "6d98a1c655e60b3cc190fe4c0bfa0eec", "score": "0.40919745", "text": "func (hs *historyStorage) newestEntriesDataInHeightRange(key []byte, startHeight, endHeight uint64) ([][]byte, error) {\n\thistory, err := hs.fullHistory(key)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\tif len(history.entries) == 0 {\n\t\treturn nil, nil\n\t}\n\tstartBlockNum, err := hs.stateDB.newestBlockNumByHeight(startHeight)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\tendBlockNum, err := hs.stateDB.newestBlockNumByHeight(endHeight)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\treturn hs.blockRangeEntries(history, startBlockNum, endBlockNum), nil\n}", "title": "" }, { "docid": "bb82b94c43c2c2f792d87b13ab722dec", "score": "0.40859282", "text": "func (mock *mockPeerMonitor) LatestMetrics(ctx context.Context, in string, out *[]api.Metric) error {\n\tm := api.Metric{\n\t\tName: \"test\",\n\t\tPeer: PeerID1,\n\t\tValue: \"0\",\n\t\tValid: true,\n\t}\n\tm.SetTTL(2 * time.Second)\n\tlast := []api.Metric{m}\n\t*out = last\n\treturn nil\n}", "title": "" }, { "docid": "b5e756785e2fa88677e9c47cc158c7d7", "score": "0.4085343", "text": "func TestLatest(t *testing.T) {\n\tif err := filepath.WalkDir(\".\", func(fullpath string, entry fs.DirEntry, err error) error {\n\t\tif err != nil {\n\t\t\treturn err\n\t\t}\n\t\tif !strings.HasSuffix(fullpath, \".txtar\") {\n\t\t\treturn nil\n\t\t}\n\n\t\ta, err := txtar.ParseFile(fullpath)\n\t\tif err != nil {\n\t\t\treturn err\n\t\t}\n\n\t\tfor _, f := range a.Files {\n\t\t\tt.Run(path.Join(fullpath, f.Name), func(t *testing.T) {\n\t\t\t\tif !strings.HasSuffix(f.Name, \".cue\") {\n\t\t\t\t\treturn\n\t\t\t\t}\n\t\t\t\tv := parser.FromVersion(parser.Latest)\n\t\t\t\t_, err := parser.ParseFile(f.Name, f.Data, v)\n\t\t\t\tif err != nil {\n\t\t\t\t\tt.Errorf(\"%v: %v\", fullpath, err)\n\t\t\t\t}\n\t\t\t})\n\t\t}\n\t\treturn nil\n\t}); err != nil {\n\t\tt.Fatal(err)\n\t}\n}", "title": "" }, { "docid": "e4c838ac3bd6fb9f43c32c882fb893d0", "score": "0.40683892", "text": "func (dal *OfferDAL) GetLastOffers(before time.Time, size int) ([]models.Offer, error) {\n\toffs := []models.Offer{}\n\terr := dal.db.Select(&offs,\n\t\t`SELECT * FROM offer WHERE timestamp < $1\n\t\t\tORDER BY timestamp DESC\n\t\t\tLIMIT $2`, before.UTC(), size)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\treturn offs, nil\n}", "title": "" }, { "docid": "3e164dcae379fdc26f400be720632ae2", "score": "0.40662158", "text": "func GetTrades(dataInicial, dataFinal time.Time) ([]Trade, error) {\n\tclient := &http.Client{}\n\n\tvar message TradesMessage\n\tmessage.Data.Pagination.Pages = 99\n\tcurrentPage := 1\n\ttrades := []Trade{}\n\n\tfor currentPage <= message.Data.Pagination.Pages && message.Data.Pagination.Pages != 0 {\n\t\treq, _ := buildRequest(dataInicial, dataFinal, currentPage)\n\n\t\tresp, getErr := client.Do(req)\n\t\tif getErr != nil {\n\t\t\treturn nil, errors.Wrap(getErr, \"erro efetuando request\")\n\t\t}\n\n\t\tdefer resp.Body.Close()\n\n\t\tbody, readErr := ioutil.ReadAll(resp.Body)\n\t\tif readErr != nil {\n\t\t\treturn nil, errors.Wrap(readErr, \"erro ao ler Body de response\")\n\t\t}\n\n\t\tmessage = TradesMessage{}\n\n\t\tunmarshalError := json.Unmarshal(body, &message)\n\t\tif unmarshalError != nil {\n\t\t\treturn nil, errors.Wrap(unmarshalError, \"erro durante unmarshalling\")\n\t\t}\n\n\t\ttrades = append(trades, message.Data.Trades...)\n\t\tlog.Printf(\"fim da leitura de pagina %d/%d, total de trades [%d]\",\n\t\t\tcurrentPage,\n\t\t\tmessage.Data.Pagination.Pages,\n\t\t\tlen(trades))\n\n\t\tcurrentPage++\n\t}\n\n\tlog.Printf(\"consumo finalizado, localizados [%d] trades\", len(trades))\n\n\treturn trades, nil\n\n}", "title": "" }, { "docid": "8c6c35402e13e978452571f4f8bde51e", "score": "0.40604776", "text": "func UpdatedAtGTE(v time.Time) predicate.TransactionDetail {\n\treturn predicate.TransactionDetail(sql.FieldGTE(FieldUpdatedAt, v))\n}", "title": "" }, { "docid": "0064b7e686dbb74362ef05adc623c30d", "score": "0.4058631", "text": "func (e *ExchangeRates) GetLatestRates(baseCurrency, symbols string) (Rates, error) {\n\tvals := url.Values{}\n\n\tif len(baseCurrency) > 0 {\n\t\tvals.Set(\"base\", baseCurrency)\n\t}\n\n\tif len(symbols) > 0 {\n\t\tsymbols = cleanCurrencies(baseCurrency, symbols)\n\t\tvals.Set(\"symbols\", symbols)\n\t}\n\n\tvar result Rates\n\treturn result, e.SendHTTPRequest(exchangeRatesLatest, vals, &result)\n}", "title": "" }, { "docid": "cfaf9785070f84f99e0f8b76fd54ad44", "score": "0.40541628", "text": "func (g *timestampsGenerator) pullTimestamps(lastPullTimestamp time.Time, now time.Time) []time.Time {\n\tvar timestamps []time.Time\n\tupperBound := shiftToStartOfMinute(now)\n\n\tif lastPullTimestamp.IsZero() {\n\t\tif g.backfillEnabled {\n\t\t\ttimestamps = pullTimestampsWithDifference(upperBound.Add(-1*backfillIntervalDuration), upperBound,\n\t\t\t\tg.difference)\n\t\t} else {\n\t\t\ttimestamps = []time.Time{upperBound}\n\t\t}\n\t} else {\n\t\t// lastPullTimestamp is already set to start of minute\n\t\ttimestamps = pullTimestampsWithDifference(lastPullTimestamp, upperBound, g.difference)\n\t}\n\n\treturn timestamps\n}", "title": "" }, { "docid": "57ffb635d1f446c1344dec4104289a74", "score": "0.40471485", "text": "func (e *StatementsSummaryExtractor) Extract(\n\tsctx sessionctx.Context,\n\tschema *expression.Schema,\n\tnames []*types.FieldName,\n\tpredicates []expression.Expression,\n) (remained []expression.Expression) {\n\t// Extract the `digest` column\n\tremained, skip, digests := e.extractCol(schema, names, predicates, \"digest\", false)\n\tif skip {\n\t\te.SkipRequest = true\n\t\treturn nil\n\t}\n\tif !digests.Empty() {\n\t\te.Digests = digests\n\t}\n\n\ttr := e.findCoarseTimeRange(sctx, schema, names, remained)\n\tif tr == nil {\n\t\treturn remained\n\t}\n\n\tif tr.StartTime.After(tr.EndTime) {\n\t\te.SkipRequest = true\n\t\treturn nil\n\t}\n\te.CoarseTimeRange = tr\n\treturn remained\n}", "title": "" }, { "docid": "d00420fe90584fa14f4a994b93c17927", "score": "0.4045165", "text": "func getLastIngestionTs(edb events.EventDB, repos repograph.Map) (time.Time, error) {\n\ttimeEnd := time.Now()\n\twindow := time.Hour\n\tfor {\n\t\ttimeStart := timeEnd.Add(-window)\n\t\tvar latest time.Time\n\t\tfor repo := range repos {\n\t\t\tev, err := edb.Range(fmtStream(repo), timeStart, timeEnd)\n\t\t\tif err != nil {\n\t\t\t\treturn BEGINNING_OF_TIME, err\n\t\t\t}\n\t\t\tif len(ev) > 0 {\n\t\t\t\tts := ev[len(ev)-1].Timestamp\n\t\t\t\tif ts.After(latest) {\n\t\t\t\t\tlatest = ts\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\tif !util.TimeIsZero(latest) {\n\t\t\treturn latest, nil\n\t\t}\n\t\tif timeStart.Before(BEGINNING_OF_TIME) {\n\t\t\treturn BEGINNING_OF_TIME, nil\n\t\t}\n\t\twindow *= 2\n\t\ttimeEnd = timeStart\n\t}\n}", "title": "" }, { "docid": "648a7c965fe82f2e5c4217160e744799", "score": "0.4042886", "text": "func LastUpdates(db database.Querier, user *sdk.User, since time.Time) ([]sdk.ProjectLastUpdates, error) {\n\tquery := `\n\t\tSELECT \tproject.projectkey, project.last_modified, apps.name, apps.last_modified, pipelines.name, pipelines.last_modified\n\t\tFROM \tproject\t\n\t\tJOIN project_group ON project_group.project_id = project.id\n\t\tJOIN group_user ON project_group.group_id = group_user.group_id\n\t\tLEFT OUTER JOIN (\n\t\t\tSELECT \tapplication.project_id, application.name, application.last_modified\n\t\t\tFROM \tapplication, application_group, group_user\n\t\t\tWHERE application.id = application_group.application_id\n\t\t\tAND \tapplication_group.group_id = group_user.group_id\n\t\t\tAND \tgroup_user.user_id = $1\n\t\t\tAND\t\tapplication.last_modified >= $2\n\t\t) apps ON apps.project_id = project.id\n\t\tLEFT OUTER JOIN (\n\t\t\tSELECT \tpipeline.project_id, pipeline.name, pipeline.last_modified\n\t\t\tFROM \tpipeline, pipeline_group, group_user\n\t\t\tWHERE pipeline.id = pipeline_group.pipeline_id\n\t\t\tAND \tpipeline_group.group_id = group_user.group_id\n\t\t\tAND \tgroup_user.user_id = $1\n\t\t\tAND\t\tpipeline.last_modified >= $2\n\t\t) pipelines ON pipelines.project_id = project.id\n\t\tWHERE \tgroup_user.user_id = $1\n\t\tAND \tproject.last_modified >= $2\n\t\tORDER\tby project.projectkey asc\n\t`\n\trows, err := db.Query(query, user.ID, since)\n\tif err != nil {\n\t\treturn []sdk.ProjectLastUpdates{}, err\n\t}\n\tdefer rows.Close()\n\n\tres := []sdk.ProjectLastUpdates{}\n\n\tmapRes := map[string]*sdk.ProjectLastUpdates{}\n\n\tchanProj := make(chan struct {\n\t\tkey string\n\t\tlastModified time.Time\n\t})\n\tchanApp := make(chan struct {\n\t\tkey string\n\t\tname string\n\t\tlastModified time.Time\n\t})\n\tchanPip := make(chan struct {\n\t\tkey string\n\t\tname string\n\t\tlastModified time.Time\n\t})\n\n\twg := &sync.WaitGroup{}\n\tquit := make(chan int)\n\tgo func() {\n\t\tfor {\n\t\t\tselect {\n\t\t\tcase <-quit:\n\t\t\t\treturn\n\t\t\tcase proj := <-chanProj:\n\t\t\t\tr := mapRes[proj.key]\n\t\t\t\tif r == nil {\n\t\t\t\t\tmapRes[proj.key] = &sdk.ProjectLastUpdates{\n\t\t\t\t\t\tKey: proj.key,\n\t\t\t\t\t\tLastModified: proj.lastModified.Unix(),\n\t\t\t\t\t}\n\t\t\t\t\tr = mapRes[proj.key]\n\t\t\t\t}\n\t\t\t\tr.LastModified = proj.lastModified.Unix()\n\t\t\t\twg.Done()\n\t\t\tcase app := <-chanApp:\n\t\t\t\tr := mapRes[app.key]\n\t\t\t\tif r == nil {\n\t\t\t\t\tmapRes[app.key] = &sdk.ProjectLastUpdates{\n\t\t\t\t\t\tKey: app.key,\n\t\t\t\t\t}\n\t\t\t\t\tr = mapRes[app.key]\n\t\t\t\t}\n\t\t\t\tvar appExists bool\n\t\t\t\tfor _, a := range r.Applications {\n\t\t\t\t\tif app.name == a.Name {\n\t\t\t\t\t\tappExists = true\n\t\t\t\t\t\tbreak\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tif !appExists {\n\t\t\t\t\tr.Applications = append(r.Applications, struct {\n\t\t\t\t\t\tName string `json:\"name\"`\n\t\t\t\t\t\tLastModified int64 `json:\"last_modified\"`\n\t\t\t\t\t}{\n\t\t\t\t\t\tName: app.name,\n\t\t\t\t\t\tLastModified: app.lastModified.Unix(),\n\t\t\t\t\t})\n\t\t\t\t}\n\t\t\t\twg.Done()\n\t\t\tcase pip := <-chanPip:\n\t\t\t\tr := mapRes[pip.key]\n\t\t\t\tif r == nil {\n\t\t\t\t\tmapRes[pip.key] = &sdk.ProjectLastUpdates{\n\t\t\t\t\t\tKey: pip.key,\n\t\t\t\t\t}\n\t\t\t\t\tr = mapRes[pip.key]\n\t\t\t\t}\n\t\t\t\tvar pipExists bool\n\t\t\t\tfor _, p := range r.Pipelines {\n\t\t\t\t\tif pip.name == p.Name {\n\t\t\t\t\t\tpipExists = true\n\t\t\t\t\t\tbreak\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tif !pipExists {\n\t\t\t\t\tr.Pipelines = append(r.Pipelines, struct {\n\t\t\t\t\t\tName string `json:\"name\"`\n\t\t\t\t\t\tLastModified int64 `json:\"last_modified\"`\n\t\t\t\t\t}{\n\t\t\t\t\t\tName: pip.name,\n\t\t\t\t\t\tLastModified: pip.lastModified.Unix(),\n\t\t\t\t\t})\n\t\t\t\t}\n\t\t\t\twg.Done()\n\t\t\t}\n\t\t}\n\t}()\n\n\tfor rows.Next() {\n\t\tvar projectKey, appName, pipName sql.NullString\n\t\tvar projectLastModified, appLastModified, pipLastModified pq.NullTime\n\t\terr := rows.Scan(&projectKey, &projectLastModified, &appName, &appLastModified, &pipName, &pipLastModified)\n\t\tif err != nil {\n\t\t\tlog.Warning(\"LastUpdates> Error scanning values: %s\", err)\n\t\t\tcontinue\n\t\t}\n\n\t\twg.Add(1)\n\t\tchanProj <- struct {\n\t\t\tkey string\n\t\t\tlastModified time.Time\n\t\t}{\n\t\t\tprojectKey.String,\n\t\t\tprojectLastModified.Time,\n\t\t}\n\n\t\tif appName.Valid && appLastModified.Valid {\n\t\t\twg.Add(1)\n\t\t\tchanApp <- struct {\n\t\t\t\tkey string\n\t\t\t\tname string\n\t\t\t\tlastModified time.Time\n\t\t\t}{\n\t\t\t\tprojectKey.String,\n\t\t\t\tappName.String,\n\t\t\t\tappLastModified.Time,\n\t\t\t}\n\t\t}\n\n\t\tif pipName.Valid && pipLastModified.Valid {\n\t\t\twg.Add(1)\n\t\t\tchanPip <- struct {\n\t\t\t\tkey string\n\t\t\t\tname string\n\t\t\t\tlastModified time.Time\n\t\t\t}{\n\t\t\t\tprojectKey.String,\n\t\t\t\tpipName.String,\n\t\t\t\tpipLastModified.Time,\n\t\t\t}\n\t\t}\n\t}\n\n\twg.Wait()\n\tquit <- 1\n\tclose(chanProj)\n\tclose(chanApp)\n\tclose(chanPip)\n\tfor _, v := range mapRes {\n\t\tres = append(res, *v)\n\t}\n\n\treturn res, nil\n}", "title": "" }, { "docid": "b17a991b3545dbff72786d13f6a92865", "score": "0.40331402", "text": "func (bc *BlockChain) GetLatestBlocks() []Block {\n\tlatestBlocksList, _ := bc.Get(bc.Length)\n\treturn latestBlocksList\n}", "title": "" }, { "docid": "3ff74de1a00bfb9155b194e0f668b61f", "score": "0.40265888", "text": "func (s ChannelAdminLogEventActionChangeHistoryTTLArray) Retain(keep func(x ChannelAdminLogEventActionChangeHistoryTTL) bool) ChannelAdminLogEventActionChangeHistoryTTLArray {\n\tn := 0\n\tfor _, x := range s {\n\t\tif keep(x) {\n\t\t\ts[n] = x\n\t\t\tn++\n\t\t}\n\t}\n\ts = s[:n]\n\n\treturn s\n}", "title": "" }, { "docid": "c8a239a550f07f496bd7cc86d5a59af2", "score": "0.40219003", "text": "func (s *DependencyStore) GetDependencies(endTs time.Time, lookback time.Duration) ([]model.DependencyLink, error) {\n\tstartTs := model.TimeAsEpochMicroseconds(endTs.Add(-1 * lookback))\n\tbeginTs := model.TimeAsEpochMicroseconds(endTs)\n\tdeps := map[string]*model.DependencyLink{}\n\n\t// We need to do a full table scan - if this becomes a bottleneck, we can write write an index that describes\n\t// dependencyKeyPrefix + timestamp + parent + child key and do a key-only seek (which is fast - but requires additional writes)\n\terr := s.store.View(func(txn *badger.Txn) error {\n\t\topts := badger.DefaultIteratorOptions\n\t\topts.PrefetchValues = true\n\t\tit := txn.NewIterator(opts)\n\t\tdefer it.Close()\n\n\t\tval := []byte{}\n\t\tstartIndex := []byte{spanKeyPrefix}\n\t\tspans := make([]*model.Span, 0)\n\t\tprevTraceID := []byte{}\n\t\tfor it.Seek(startIndex); it.ValidForPrefix(startIndex); it.Next() {\n\t\t\titem := it.Item()\n\n\t\t\tkey := []byte{}\n\t\t\tkey = item.KeyCopy(key)\n\n\t\t\ttimestamp := binary.BigEndian.Uint64(key[sizeOfTraceID+1 : sizeOfTraceID+1+8])\n\t\t\ttraceID := key[1 : sizeOfTraceID+1]\n\n\t\t\tif timestamp >= startTs && timestamp <= beginTs {\n\t\t\t\tval, err := item.ValueCopy(val)\n\t\t\t\tif err != nil {\n\t\t\t\t\treturn err\n\t\t\t\t}\n\n\t\t\t\tsp := model.Span{}\n\t\t\t\tswitch item.UserMeta() & encodingTypeBits {\n\t\t\t\tcase jsonEncoding:\n\t\t\t\t\tif err := json.Unmarshal(val, &sp); err != nil {\n\t\t\t\t\t\treturn err\n\t\t\t\t\t}\n\t\t\t\tcase protoEncoding:\n\t\t\t\t\tif err := proto.Unmarshal(val, &sp); err != nil {\n\t\t\t\t\t\treturn err\n\t\t\t\t\t}\n\t\t\t\tdefault:\n\t\t\t\t\treturn fmt.Errorf(\"Unknown encoding type: %04b\", item.UserMeta()&encodingTypeBits)\n\t\t\t\t}\n\n\t\t\t\tif bytes.Equal(prevTraceID, traceID) {\n\t\t\t\t\t// Still processing the same one\n\t\t\t\t\tspans = append(spans, &sp)\n\t\t\t\t} else {\n\t\t\t\t\t// Process last complete span\n\t\t\t\t\ttrace := &model.Trace{\n\t\t\t\t\t\tSpans: spans,\n\t\t\t\t\t}\n\t\t\t\t\tprocessTrace(deps, trace)\n\n\t\t\t\t\tspans = make([]*model.Span, 0, cap(spans)) // Use previous cap\n\t\t\t\t\tspans = append(spans, &sp)\n\t\t\t\t}\n\t\t\t\tprevTraceID = traceID\n\t\t\t}\n\t\t}\n\t\tif len(spans) > 0 {\n\t\t\ttrace := &model.Trace{\n\t\t\t\tSpans: spans,\n\t\t\t}\n\t\t\tprocessTrace(deps, trace)\n\t\t}\n\n\t\treturn nil\n\t})\n\n\treturn depMapToSlice(deps), err\n}", "title": "" }, { "docid": "e0457417a514080c64ffc703a63766eb", "score": "0.40195304", "text": "func (idx *taskIndex) extract(now time.Time, max int) []*tq.Task {\n\tvar out []*tq.Task\n\tfor len(idx.data) > 0 && len(out) < max && !idx.data[0].ETA.After(now) {\n\t\tout = append(out, heap.Pop(&idx.data).(*tq.Task))\n\t}\n\treturn out\n}", "title": "" }, { "docid": "d84a7d58fb90e80e633b15382756e3a8", "score": "0.4009428", "text": "func TestInfoStoreDelta(t *testing.T) {\n\tis := createTestInfoStore(t)\n\n\t// Verify deltas with successive sequence numbers.\n\tfor i := 0; i < 10; i++ {\n\t\tdelta := is.delta(2, int64(i*3))\n\t\tinfosA := delta.getGroupInfos(\"a\")\n\t\tinfosB := delta.getGroupInfos(\"b\")\n\t\tif len(infosA) != 10-i || len(infosB) != 10-i {\n\t\t\tt.Fatalf(\"expected %d infos, not %d, %d\", 10-i, len(infosA), len(infosB))\n\t\t}\n\t\tfor j := 0; j < 10-i; j++ {\n\t\t\texpAKey := fmt.Sprintf(\"a.%d\", j+i)\n\t\t\texpBKey := fmt.Sprintf(\"b.%d\", j+i)\n\t\t\tif infosA[j].Key != expAKey || infosB[j].Key != expBKey {\n\t\t\t\tt.Errorf(\"run %d: key mismatch at index %d: %s != %s, %s != %s\",\n\t\t\t\t\ti, j, infosA[j].Key, expAKey, infosB[j].Key, expBKey)\n\t\t\t}\n\n\t\t\tinfoC := delta.getInfo(fmt.Sprintf(\"c.%d\", j+i))\n\t\t\tif infoC == nil {\n\t\t\t\tt.Errorf(\"unable to fetch non-group info %d\", j+i)\n\t\t\t}\n\t\t\tif i > 0 {\n\t\t\t\tinfoC = delta.getInfo(fmt.Sprintf(\"c.%d\", 0))\n\t\t\t\tif infoC != nil {\n\t\t\t\t\tt.Errorf(\"erroneously fetched non-group info %d\", j+i+1)\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\n\tif delta := is.delta(2, int64(30)); delta != nil {\n\t\tt.Error(\"fetching delta of infostore at maximum sequence number should return nil\")\n\t}\n}", "title": "" }, { "docid": "ec5d371f866b2b720b8743654689b828", "score": "0.40086553", "text": "func QueryLatestTsFromPD(tiStore kv.Storage) (int64, error) {\n\tversion, err := tiStore.CurrentVersion(oracle.GlobalTxnScope)\n\tif err != nil {\n\t\tlog.Error(\"get current version failed\", zap.Error(err))\n\t\treturn 0, errors.Trace(err)\n\t}\n\n\treturn int64(version.Ver), nil\n}", "title": "" }, { "docid": "f4e0cee0e5291f4975e8485a24e9909d", "score": "0.40042582", "text": "func (tbl DbUserTable) SliceLastupdated(req require.Requirement, wh where.Expression, qc where.QueryConstraint) ([]int64, error) {\n\treturn tbl.sliceInt64List(req, \"lastupdated\", wh, qc)\n}", "title": "" }, { "docid": "dcf75318e2cdf1d14efa6fb6edeb24b4", "score": "0.3998776", "text": "func (o *GetPublicGetLastTradesByCurrencyAndTimeParams) WithIncludeOld(includeOld *bool) *GetPublicGetLastTradesByCurrencyAndTimeParams {\n\to.SetIncludeOld(includeOld)\n\treturn o\n}", "title": "" }, { "docid": "f5fa2841f217b39f0c1bed9e2bc6a139", "score": "0.39968237", "text": "func getVersions(latestFeed string, otherFeeds ...string) (versions map[string]Package, err error) {\n\tversions = map[string]Package{}\n\n\tfor _, url := range append(otherFeeds, latestFeed) {\n\t\tnewVersions, err := fetchLatestTarVersions(url)\n\t\tif err != nil {\n\t\t\treturn nil, err\n\t\t}\n\t\tfor v, p := range newVersions {\n\t\t\tif url == latestFeed {\n\t\t\t\tp.Latest = true\n\t\t\t}\n\t\t\tversions[v] = p\n\t\t}\n\t}\n\treturn versions, nil\n}", "title": "" }, { "docid": "a50499a27b57ec17bacac80f98882910", "score": "0.399351", "text": "func LastUpdatedGTE(v time.Time) predicate.City {\n\treturn predicate.City(func(s *sql.Selector) {\n\t\ts.Where(sql.GTE(s.C(FieldLastUpdated), v))\n\t})\n}", "title": "" }, { "docid": "78dea9255221b4f600a1f7cd3aecbdba", "score": "0.39874086", "text": "func (r ReadingSlice) NotOlderThan(ts time.Time) (res ReadingSlice) {\n\tres = ReadingSlice{}\n\tfor _, reading := range r {\n\t\tif !reading.IsOlderThan(ts) {\n\t\t\tres = append(res, reading)\n\t\t}\n\t}\n\treturn res\n}", "title": "" }, { "docid": "d5be34b9ff0adf7ed03fc0333ce9828b", "score": "0.39521226", "text": "func (btc *baseWallet) fundMultiBestEffort(keep, maxLock uint64, values []*asset.MultiOrderValue,\n\tmaxFeeRate uint64, splitAllowed bool) ([]asset.Coins, [][]dex.Bytes, map[outPoint]*utxo, []*output, error) {\n\tutxos, _, avail, err := btc.spendableUTXOs(0)\n\tif err != nil {\n\t\treturn nil, nil, nil, nil, fmt.Errorf(\"error getting spendable utxos: %w\", err)\n\t}\n\n\tfundAllOrders := func() [][]*compositeUTXO {\n\t\tindexToFundingCoins := make(map[int][]*compositeUTXO, len(values))\n\t\tremainingUTXOs := utxos\n\t\tremainingOrders := values\n\t\tremainingIndexes := make([]int, len(values))\n\t\tfor i := range remainingIndexes {\n\t\t\tremainingIndexes[i] = i\n\t\t}\n\t\tvar totalFunded uint64\n\t\tfor range values {\n\t\t\torderIndex, fundingUTXOs := btc.orderWithLeastOverFund(maxLock-totalFunded, maxFeeRate, remainingOrders, remainingUTXOs)\n\t\t\tif orderIndex == -1 {\n\t\t\t\treturn nil\n\t\t\t}\n\t\t\ttotalFunded += sumUTXOs(fundingUTXOs)\n\t\t\tif totalFunded > avail-keep {\n\t\t\t\treturn nil\n\t\t\t}\n\t\t\tnewRemainingOrders := make([]*asset.MultiOrderValue, 0, len(remainingOrders)-1)\n\t\t\tnewRemainingIndexes := make([]int, 0, len(remainingOrders)-1)\n\t\t\tfor j := range remainingOrders {\n\t\t\t\tif j != orderIndex {\n\t\t\t\t\tnewRemainingOrders = append(newRemainingOrders, remainingOrders[j])\n\t\t\t\t\tnewRemainingIndexes = append(newRemainingIndexes, remainingIndexes[j])\n\t\t\t\t}\n\t\t\t}\n\t\t\tindexToFundingCoins[remainingIndexes[orderIndex]] = fundingUTXOs\n\t\t\tremainingOrders = newRemainingOrders\n\t\t\tremainingIndexes = newRemainingIndexes\n\t\t\tremainingUTXOs = utxoSetDiff(remainingUTXOs, fundingUTXOs)\n\t\t}\n\t\tallFundingUTXOs := make([][]*compositeUTXO, len(values))\n\t\tfor i := range values {\n\t\t\tallFundingUTXOs[i] = indexToFundingCoins[i]\n\t\t}\n\t\treturn allFundingUTXOs\n\t}\n\n\tfundInOrder := func(orderedValues []*asset.MultiOrderValue) [][]*compositeUTXO {\n\t\tallFundingUTXOs := make([][]*compositeUTXO, 0, len(orderedValues))\n\t\tremainingUTXOs := utxos\n\t\tvar totalFunded uint64\n\t\tfor _, value := range orderedValues {\n\t\t\tenough := orderEnough(value.Value, value.MaxSwapCount, maxFeeRate, btc.initTxSizeBase, btc.initTxSize, btc.segwit, false)\n\n\t\t\tvar fundingUTXOs []*compositeUTXO\n\t\t\tif maxLock > 0 {\n\t\t\t\tif maxLock < totalFunded {\n\t\t\t\t\t// Should never happen unless there is a bug in leastOverFundWithLimit\n\t\t\t\t\tbtc.log.Errorf(\"maxLock < totalFunded. %d < %d\", maxLock, totalFunded)\n\t\t\t\t\treturn allFundingUTXOs\n\t\t\t\t}\n\t\t\t\tfundingUTXOs = leastOverFundWithLimit(enough, maxLock-totalFunded, remainingUTXOs)\n\t\t\t} else {\n\t\t\t\tfundingUTXOs = leastOverFund(enough, remainingUTXOs)\n\t\t\t}\n\t\t\tif len(fundingUTXOs) == 0 {\n\t\t\t\treturn allFundingUTXOs\n\t\t\t}\n\t\t\ttotalFunded += sumUTXOs(fundingUTXOs)\n\t\t\tif totalFunded > avail-keep {\n\t\t\t\treturn allFundingUTXOs\n\t\t\t}\n\t\t\tallFundingUTXOs = append(allFundingUTXOs, fundingUTXOs)\n\t\t\tremainingUTXOs = utxoSetDiff(remainingUTXOs, fundingUTXOs)\n\t\t}\n\t\treturn allFundingUTXOs\n\t}\n\n\treturnValues := func(allFundingUTXOs [][]*compositeUTXO) (coins []asset.Coins, redeemScripts [][]dex.Bytes, fundingCoins map[outPoint]*utxo, spents []*output, err error) {\n\t\tcoins = make([]asset.Coins, len(allFundingUTXOs))\n\t\tfundingCoins = make(map[outPoint]*utxo)\n\t\tspents = make([]*output, 0, len(allFundingUTXOs))\n\t\tredeemScripts = make([][]dex.Bytes, len(allFundingUTXOs))\n\t\tfor i, fundingUTXOs := range allFundingUTXOs {\n\t\t\tcoins[i] = make(asset.Coins, len(fundingUTXOs))\n\t\t\tredeemScripts[i] = make([]dex.Bytes, len(fundingUTXOs))\n\t\t\tfor j, output := range fundingUTXOs {\n\t\t\t\tcoins[i][j] = newOutput(output.txHash, output.vout, output.amount)\n\t\t\t\tfundingCoins[outPoint{txHash: *output.txHash, vout: output.vout}] = &utxo{\n\t\t\t\t\ttxHash: output.txHash,\n\t\t\t\t\tvout: output.vout,\n\t\t\t\t\tamount: output.amount,\n\t\t\t\t\taddress: output.address,\n\t\t\t\t}\n\t\t\t\tspents = append(spents, newOutput(output.txHash, output.vout, output.amount))\n\t\t\t\tredeemScripts[i][j] = output.redeemScript\n\t\t\t}\n\t\t}\n\t\treturn\n\t}\n\n\t// Attempt to fund all orders by selecting the order that requires the least\n\t// over funding, removing the funding utxos from the set of available utxos,\n\t// and continuing until all orders are funded.\n\tallFundingUTXOs := fundAllOrders()\n\tif allFundingUTXOs != nil {\n\t\treturn returnValues(allFundingUTXOs)\n\t}\n\n\t// Return nil if a split is allowed. There is no need to fund in priority\n\t// order if a split will be done regardless.\n\tif splitAllowed {\n\t\treturn returnValues([][]*compositeUTXO{})\n\t}\n\n\t// If could not fully fund, fund as much as possible in the priority\n\t// order.\n\tallFundingUTXOs = fundInOrder(values)\n\treturn returnValues(allFundingUTXOs)\n}", "title": "" }, { "docid": "f467a7e6236ae929d19fc58ff8fbfa2b", "score": "0.39494604", "text": "func buildTDESlice(expChange map[string]types.TestClassification) TDESlice {\n\texpCol := TDESlice{newTestDigestExp()}\n\n\t// Assemble the collection of expectations.\n\tfor testName, classification := range expChange {\n\t\tfor digest, label := range classification {\n\t\t\texpCol.add(testName, digest, label)\n\t\t}\n\t}\n\n\treturn expCol\n}", "title": "" }, { "docid": "7d5866ee8595c1d3da1546551cd32a8c", "score": "0.3943018", "text": "func findLatestComplete(backups []*api.BackupTask) (*api.BackupTask, error) {\n\tif len(backups) < 1 {\n\t\treturn nil, status.New(status.BackupError, \"No backups found\")\n\t}\n\n\ttype parsed struct {\n\t\ttask *api.BackupTask\n\t\tdate time.Time\n\t}\n\n\tparsedBackups := []parsed{}\n\tfor _, b := range backups {\n\t\tif b.GetState() != api.BackupTask_COMPLETED {\n\t\t\tcontinue\n\t\t}\n\n\t\tdate, err := time.Parse(api.BackupTaskFormat, b.TaskID())\n\t\tif err != nil {\n\t\t\treturn nil, status.Errorf(status.BackupError, \"Unable to parse backup ID '%s' to time\", b.Id)\n\t\t}\n\n\t\tparsedBackups = append(parsedBackups, parsed{task: b, date: date})\n\t}\n\n\tif len(parsedBackups) < 1 {\n\t\treturn nil, status.New(status.BackupError, \"No complete backups were found\")\n\t}\n\n\tsort.Slice(parsedBackups, func(i, j int) bool {\n\t\treturn parsedBackups[i].date.After(parsedBackups[j].date)\n\t})\n\n\treturn parsedBackups[0].task, nil\n}", "title": "" }, { "docid": "5978b9ab5ec48dd8e3b464e867a4bf8f", "score": "0.39321896", "text": "func (sb *StatBlockchain) GetLogs(fromBlock uint64, toBlock uint64) ([]common.KNLog, error) {\n\tvar (\n\t\terr error\n\t\tresult []common.KNLog\n\t\tnoCatLog = 0\n\t)\n\n\t// get all logs from fromBlock to best block\n\tlogs, err := sb.GetRawLogs(fromBlock, toBlock)\n\tif err != nil {\n\t\treturn result, err\n\t}\n\n\tfor _, logItem := range logs {\n\t\tif logItem.Removed {\n\t\t\tlog.Printf(\"LogFetcher - Log is ignored because it is removed due to chain reorg\")\n\t\t\tcontinue\n\t\t}\n\n\t\tif len(logItem.Topics) == 0 {\n\t\t\tlog.Printf(\"Getting empty zero topic list. This shouldn't happen and is Ethereum responsibility.\")\n\t\t\tcontinue\n\t\t}\n\n\t\tts, err := sb.InterpretTimestamp(\n\t\t\tlogItem.BlockNumber,\n\t\t\tlogItem.Index,\n\t\t)\n\t\tif err != nil {\n\t\t\treturn result, err\n\t\t}\n\n\t\ttopic := logItem.Topics[0]\n\t\tswitch topic.Hex() {\n\t\tcase userCatEvent:\n\t\t\taddr, cat := logDataToCatLog(logItem.Data)\n\t\t\tresult = append(result, common.SetCatLog{\n\t\t\t\tTimestamp: ts,\n\t\t\t\tBlockNumber: logItem.BlockNumber,\n\t\t\t\tTransactionHash: logItem.TxHash,\n\t\t\t\tIndex: logItem.Index,\n\t\t\t\tAddress: addr,\n\t\t\t\tCategory: cat,\n\t\t\t})\n\t\t\tnoCatLog++\n\t\tcase feeToWalletEvent, burnFeeEvent, etherReceivalEvent, tradeEvent:\n\t\t\tif result, err = updateTradeLogs(result, logItem, ts); err != nil {\n\t\t\t\treturn result, err\n\t\t\t}\n\t\tdefault:\n\t\t\tlog.Printf(\"Unknown topic: %s\", topic.Hex())\n\t\t}\n\t}\n\n\tfor i, logItem := range result {\n\t\ttradeLog, ok := logItem.(common.TradeLog)\n\t\tif !ok {\n\t\t\tcontinue\n\t\t}\n\n\t\tethRate := sb.GetEthRate(tradeLog.Timestamp / 1000000)\n\t\tif ethRate != 0 {\n\t\t\tresult[i] = calculateFiatAmount(tradeLog, ethRate)\n\t\t}\n\t}\n\n\tlog.Printf(\"LogFetcher - Fetched %d trade logs, %d cat logs\", len(result)-noCatLog, noCatLog)\n\treturn result, nil\n}", "title": "" }, { "docid": "4b0d96b0758f9f1fb97618f96e6bbc72", "score": "0.39321715", "text": "func calculateSummary(mergeRequests []response.GitResponse) Summary {\n\ttimeLayout := \"2006-01-02T15:04:05.999Z07:00\" //TODO time helper might be better\n\tsummary := Summary{\n\t\tMergeRequestCountTotal: 0,\n\t\tMergeRequestCountToday: 0,\n\t\tEarliestAsHour: math.MinInt32,\n\t\tEarliestAsHourToday: math.MinInt32,\n\t}\n\n\tfor _, mergeRequest := range mergeRequests {\n\t\tcreatedAt, err := time.Parse(timeLayout, mergeRequest.CreatedAt)\n\n\t\tif err != nil {\n\t\t\tcontinue\n\t\t}\n\n\t\tnow := time.Now()\n\t\telapsedTimeAsHoursAfterMergeRequest := int(now.Sub(createdAt) / (time.Hour / time.Nanosecond))\n\n\t\tif isToday(createdAt, now) {\n\t\t\tsummary.MergeRequestCountToday += 1\n\t\t\tsummary.MergeRequestCountTotal += 1\n\n\t\t\tif elapsedTimeAsHoursAfterMergeRequest > summary.EarliestAsHourToday {\n\t\t\t\tsummary.EarliestAsHourToday = elapsedTimeAsHoursAfterMergeRequest\n\t\t\t\tsummary.EarliestAsHour = elapsedTimeAsHoursAfterMergeRequest\n\t\t\t}\n\n\t\t} else {\n\t\t\tsummary.MergeRequestCountTotal += 1\n\n\t\t\tif elapsedTimeAsHoursAfterMergeRequest > summary.EarliestAsHour {\n\t\t\t\tsummary.EarliestAsHour = elapsedTimeAsHoursAfterMergeRequest\n\t\t\t}\n\t\t}\n\t}\n\n\tif summary.EarliestAsHour == math.MinInt32 {\n\t\tsummary.EarliestAsHour = 0\n\t}\n\n\tif summary.EarliestAsHourToday == math.MinInt32 {\n\t\tsummary.EarliestAsHourToday = 0\n\t}\n\n\treturn summary\n}", "title": "" }, { "docid": "f1e3b7389b036e532795f2bfd0e39ea7", "score": "0.39215356", "text": "func TestLatestVulns(t *testing.T) {\n\tintegration.NeedDB(t)\n\tctx := zlog.Test(context.Background(), t)\n\n\tcases := []testCase{\n\t\t{\n\t\t\tVulnerable: 2,\n\t\t\tOps: [][]*claircore.Vulnerability{\n\t\t\t\t{\n\t\t\t\t\t{\n\t\t\t\t\t\tUpdater: \"test-updater\",\n\t\t\t\t\t\tPackage: &claircore.Package{\n\t\t\t\t\t\t\tName: \"vi\",\n\t\t\t\t\t\t\tVersion: \"v2.0.0\",\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\t{\n\t\t\t\t\t\tUpdater: \"test-updater2\",\n\t\t\t\t\t\tPackage: &claircore.Package{\n\t\t\t\t\t\t\tName: \"vi\",\n\t\t\t\t\t\t\tVersion: \"v3.0.0\",\n\t\t\t\t\t\t},\n\t\t\t\t\t},\n\t\t\t\t\t{\n\t\t\t\t\t\tUpdater: \"test-updater2\",\n\t\t\t\t\t\tPackage: &claircore.Package{\n\t\t\t\t\t\t\tName: \"vi\",\n\t\t\t\t\t\t\tVersion: \"v3.1.0\",\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\tRecords: []*claircore.IndexRecord{\n\t\t\t\t{\n\t\t\t\t\tPackage: &claircore.Package{\n\t\t\t\t\t\tID: \"1\",\n\t\t\t\t\t\tName: \"vi\",\n\t\t\t\t\t\tSource: &claircore.Package{\n\t\t\t\t\t\t\tName: \"vi\",\n\t\t\t\t\t\t\tVersion: \"v1.0.0\",\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\tpool := pgtest.TestMatcherDB(ctx, t)\n\tctx, done := context.WithCancel(ctx)\n\tdefer done()\n\tstore := NewMatcherStore(pool)\n\n\tfor _, tc := range cases {\n\t\tfor _, op := range tc.Ops {\n\t\t\t_, err := store.UpdateVulnerabilities(ctx, updater, driver.Fingerprint(uuid.New().String()), op)\n\t\t\tif err != nil {\n\t\t\t\tt.Fatalf(\"failed to perform update for first op: %v\", err)\n\t\t\t}\n\t\t}\n\n\t\tres, err := store.Get(ctx, tc.Records, datastore.GetOpts{})\n\t\tif err != nil {\n\t\t\tt.Fatalf(\"failed to get vulnerabilities: %v\", err)\n\t\t}\n\t\tvulns := []*claircore.Vulnerability{}\n\t\tfor _, vs := range res {\n\t\t\tvulns = append(vulns, vs...)\n\t\t}\n\t\tif len(vulns) != tc.Vulnerable {\n\t\t\tt.Fatalf(\"wrong number of vulns, got %d want %d\", len(vulns), tc.Vulnerable)\n\t\t}\n\t}\n}", "title": "" }, { "docid": "e5fcc34b9f83f96dab2f175cdd6584ac", "score": "0.39164767", "text": "func (t *TickerTracker) CalculateTrades() {\n\tnow := time.Now()\n\tt.PruneTrades(now)\n\n\tcount := len(t.Trades)\n\tif count < 1 {\n\t\treturn\n\t}\n\n\tvolumeHistogram := metrics.NewVolumeHistogramCalculator()\n\n\tt.HaveNetVolume = true\n\tt.HaveTotalVolume = true\n\tt.HaveVwap = true\n\tvwapPrice := float64(0)\n\tvwapVolume := float64(0)\n\tbuyVolume := float64(0)\n\tsellVolume := float64(0)\n\ttotalTrades := uint64(0)\n\tsellTrades := uint64(0)\n\tbuyTrades := uint64(0)\n\n\tfor i := count - 1; i >= 0; i-- {\n\t\ttrade := t.Trades[i]\n\n\t\tage := now.Sub(trade.Timestamp())\n\n\t\tif trade.BuyerMaker {\n\t\t\tsellVolume += trade.QuoteQuantity()\n\t\t\tsellTrades += 1\n\t\t} else {\n\t\t\tbuyVolume += trade.QuoteQuantity()\n\t\t\tbuyTrades += 1\n\t\t}\n\t\ttotalTrades += 1\n\n\t\tvwapVolume += trade.Quantity\n\t\tvwapPrice += trade.Quantity * trade.Price\n\t\tvwap := vwapPrice / vwapVolume\n\n\t\ttotalVolume := buyVolume + sellVolume\n\t\tnetVolume := buyVolume - sellVolume\n\n\t\tbucket := (int(age.Seconds()) / 60) + 1\n\n\t\tvolumeHistogram.AddTrade(trade)\n\n\t\tmetrics := t.Metrics[bucket]\n\t\tif metrics == nil {\n\t\t\tcontinue\n\t\t}\n\n\t\tmetrics.NetVolume = netVolume\n\t\tmetrics.TotalVolume = totalVolume\n\t\tmetrics.BuyVolume = buyVolume\n\t\tmetrics.SellVolume = sellVolume\n\t\tmetrics.Vwap = vwap\n\t\tmetrics.TotalTrades = totalTrades\n\t\tmetrics.BuyTrades = buyTrades\n\t\tmetrics.SellTrades = sellTrades\n\t}\n\n\tt.Histogram.TradeCount = volumeHistogram.TradeCount[:]\n\tt.Histogram.SellTradeCount = volumeHistogram.SellTradeCount[:]\n\tt.Histogram.BuyTradeCount = volumeHistogram.BuyTradeCount[:]\n\tt.Histogram.Volume = volumeHistogram.Volume[:]\n\tt.Histogram.SellVolume = volumeHistogram.SellVolume[:]\n\tt.Histogram.BuyVolume = volumeHistogram.BuyVolume[:]\n\tt.Histogram.NetVolume = volumeHistogram.NetVolume[:]\n}", "title": "" }, { "docid": "0ce2406d1944fec09e23939aeac49d05", "score": "0.3899852", "text": "func (o *ExtrasJournalEntriesListParams) WithLastUpdatedGte(lastUpdatedGte *string) *ExtrasJournalEntriesListParams {\n\to.SetLastUpdatedGte(lastUpdatedGte)\n\treturn o\n}", "title": "" }, { "docid": "da09a5306f93513b167cff57cc121b77", "score": "0.3893903", "text": "func (a *UsageMeteringApiService) GetUsageLogsByRetention(ctx _context.Context, startHr time.Time, o ...GetUsageLogsByRetentionOptionalParameters) (UsageLogsByRetentionResponse, *_nethttp.Response, error) {\n\treq, err := a.buildGetUsageLogsByRetentionRequest(ctx, startHr, o...)\n\tif err != nil {\n\t\tvar localVarReturnValue UsageLogsByRetentionResponse\n\t\treturn localVarReturnValue, nil, err\n\t}\n\n\treturn req.ApiService.getUsageLogsByRetentionExecute(req)\n}", "title": "" }, { "docid": "dbb7bc1cfa24a6bf0c7588adc60c61a5", "score": "0.3867068", "text": "func ReadTracerouteItemsSince(since string) ([]TracerouteGraph, error) {\n\tsqlReadSince := `\n\tSELECT\n\t\ta.Inserted, \n\t\ta.ActualDuration, \n\t\th.Ord, \n\t\th.HopIa, \n\t\th.HopAddr, \n\t\th.IntfID, \n\t\th.RespTime1, \n\t\th.RespTime2, \n\t\th.RespTime3,\t \n\t\ta.CmdOutput, \n\t\ta.Error,\n\t\ta.Path \n\tFROM (\n\t\t\tSELECT\n\t\t\t\tInserted,\n\t\t\t\tActualDuration,\n\t\t\t\tCIa,\n\t\t\t\tCAddr,\n\t\t\t\tSIa,\n\t\t\t\tSAddr,\n\t\t\t\tTimeout,\n\t\t\t\tCmdOutput,\n\t\t\t\tError,\n\t\t\t\tPath\n\t\t\tFROM traceroute\n\t\t\tWHERE Inserted > ?\t\t\t\n\t) AS a\n\tINNER JOIN trhops AS h ON a.Inserted = h.RunTimeKey\n\tORDER BY datetime(a.Inserted) DESC\n `\n\trows, err := db.Query(sqlReadSince, since)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\tdefer rows.Close()\n\n\tvar result []TracerouteHelper\n\tfor rows.Next() {\n\t\ttrf := TracerouteHelper{}\n\t\terr = rows.Scan(\n\t\t\t&trf.Inserted,\n\t\t\t&trf.ActualDuration,\n\t\t\t&trf.Ord,\n\t\t\t&trf.HopIa,\n\t\t\t&trf.HopAddr,\n\t\t\t&trf.IntfID,\n\t\t\t&trf.RespTime1,\n\t\t\t&trf.RespTime2,\n\t\t\t&trf.RespTime3,\n\t\t\t&trf.CmdOutput,\n\t\t\t&trf.Error,\n\t\t\t&trf.Path)\n\t\tif err != nil {\n\t\t\treturn nil, err\n\t\t}\n\t\tresult = append(result, trf)\n\t}\n\n\tvar graphEntries []TracerouteGraph\n\n\t// Store the infos of the last hop\n\tvar trhops []ReducedTrHopItem\n\n\tfor i, hop := range result {\n\t\trth := ReducedTrHopItem{HopIa: hop.HopIa,\n\t\t\tHopAddr: hop.HopAddr,\n\t\t\tIntfID: hop.IntfID,\n\t\t\tRespTime1: hop.RespTime1,\n\t\t\tRespTime2: hop.RespTime2,\n\t\t\tRespTime3: hop.RespTime3}\n\t\ttrhops = append(trhops, rth)\n\n\t\t// append hops group at the end of each group\n\t\tif (i+1) == len(result) || result[i+1].Inserted != hop.Inserted {\n\t\t\ttrg := TracerouteGraph{\n\t\t\t\tInserted: hop.Inserted,\n\t\t\t\tActualDuration: hop.ActualDuration,\n\t\t\t\tTrHops: trhops,\n\t\t\t\tCmdOutput: hop.CmdOutput,\n\t\t\t\tError: hop.Error,\n\t\t\t\tPath: hop.Path}\n\n\t\t\tgraphEntries = append(graphEntries, trg)\n\t\t\ttrhops = nil\n\t\t}\n\t}\n\n\treturn graphEntries, nil\n}", "title": "" }, { "docid": "c0c45ba17d9118a0edbe4fa8b860ce65", "score": "0.3865642", "text": "func Yesterday() (Announcements, error) {\n\tyesterdaysAnnouncements := Announcements{}\n\tcurrentTime := time.Now()\n\tyesterday := currentTime.AddDate(0, 0, -1)\n\n\titems, err := Fetch(currentTime.Year(), int(currentTime.Month()))\n\tif err != nil {\n\t\treturn yesterdaysAnnouncements, err\n\t}\n\n\tfor _, announcement := range items {\n\t\tannouncementPostDate, err := time.Parse(time.RFC3339, announcement.PostDate)\n\t\tif err != nil {\n\t\t\treturn yesterdaysAnnouncements, err\n\t\t}\n\n\t\tif dateEqual(announcementPostDate, yesterday) {\n\t\t\tyesterdaysAnnouncements = append(yesterdaysAnnouncements, announcement)\n\t\t}\n\t}\n\n\treturn yesterdaysAnnouncements, nil\n}", "title": "" }, { "docid": "96be4a608fe6b8e027fc7ac25165e1a0", "score": "0.38563558", "text": "func (s *Service) Old() ([]Offer, error) {\n\tofferEntities, err := s.offers.FindValidTill(time.Now().AddDate(0, 0, -1))\n\n\toldOffers := make([]Offer, 0)\n\n\tif err == sql.ErrNoRows {\n\t\treturn oldOffers, nil\n\t} else if err != nil {\n\t\treturn nil, err\n\t}\n\n\tfor _, o := range offerEntities {\n\t\toldOffer := Offer{\n\t\t\tID: o.ID,\n\t\t\tOwner: User{ID: o.Owner.ID},\n\t\t\tRestaurant: Restaurant{ID: o.Restaurant.ID},\n\t\t\tValidFrom: o.ValidFrom,\n\t\t\tValidTo: o.ValidTo,\n\t\t\tPaypalEnabled: o.PaypalEnabled,\n\t\t}\n\n\t\toldOffers = append(oldOffers, oldOffer)\n\t}\n\n\treturn oldOffers, nil\n}", "title": "" }, { "docid": "abc4d0e598854a63eb044b3eaa9b3ab2", "score": "0.38525888", "text": "func (m *MarketClient) GetRecentTrades(symbol string, limit int32) (interface{}, error) {\n\tvar err error\n\tif symbol == \"\" {\n\t\terr = errors.New(SymbolEmpty)\n\t\treturn nil, err\n\t}\n\tparams := fmt.Sprintf(\"symbol=%s\", symbol)\n\tif limit > 1000 {\n\t\tlimit = 1000\n\t}\n\tif limit > 0 {\n\t\tparams += fmt.Sprintf(\"&limit=%d\", limit)\n\t}\n\treq, err := m.Builder.Build(http.MethodGet, \"/fapi/v1/trades\", params)\n\tif err != nil {\n\t\tlogger.Error(\"Failed to build url: %s\", err.Error())\n\t}\n\tres, err := binance.HttpRequest(req)\n\tvar parser map[string]interface{}\n\terr = json.Unmarshal(res, &parser)\n\tif _, ok := parser[\"code\"]; ok {\n\t\tresult := model.APIErrorResponse{}\n\t\terr = json.Unmarshal(res, &result)\n\t\treturn result, err\n\t}\n\tresult := RecentTradesListResponse{}\n\terr = json.Unmarshal(res, &result)\n\treturn result, err\n}", "title": "" }, { "docid": "5892ba7885ee4a6135f1f846c9958174", "score": "0.38515347", "text": "func DataCheckLatestTransaction(){\n\tfile, err := os.Open(transactionfile)\n\tif err != nil {\n\t\tlog.Fatal(err)\n\t}\n\tdefer file.Close()\n\n\tscanner := bufio.NewScanner(file)\n\ttransactions := 0\n\tvar operationsStart []string\n\tvar operationsEnd []string\n\tfor scanner.Scan() {\n\t\tstatus := strings.Split(scanner.Text(), \":\")[0]\n\t\toperation := strings.Split(scanner.Text(), \":\")[1]\n\t\tif status == \"10\"{\n\t\t\ttransactions = 0\n\t\t\tcontinue\n\t\t} else if status == \"1\"{\n\t\t\toperationsStart = append(operationsStart, operation)\n\t\t\ttransactions += 1\n\t\t} else if status == \"0\"{\n\t\t\toperationsEnd = append(operationsEnd, operation)\n\t\t\ttransactions -= 1\n\t\t}\n\t}\n\tif transactions == 0{\n\t\tprint(\"All transactions passed\\n\")\n\t} else {\n\t\tprint(\"Not all operations successful\")\n\t\tgoodOperation := false\n\t\tfor _, start := range operationsStart{\n\t\t\tfor _, end := range operationsEnd{\n\t\t\t\tif start == end{\n\t\t\t\t\tgoodOperation = true\n\t\t\t\t}\n\t\t\t}\n\t\t\tif !goodOperation{\n\t\t\t\tDataRestoreOperation(start)\n\t\t\t}\n\t\t}\n\n\t}\n\n\tif err := scanner.Err(); err != nil {\n\t\tlog.Fatal(err)\n\t}\n}", "title": "" }, { "docid": "b4aaafe3aef0bcede4082de01ba9cd10", "score": "0.38469172", "text": "func (ft *FlowTable) FilterLast(last time.Duration) []*Flow {\n\tvar flows []*Flow\n\tselected := time.Now().Unix() - int64((last).Seconds())\n\tft.lock.RLock()\n\tfor _, f := range ft.table {\n\t\tfs := f.GetStatistics()\n\t\tif fs.Last >= selected {\n\t\t\tflows = append(flows, f)\n\t\t}\n\t}\n\tft.lock.RUnlock()\n\treturn flows\n}", "title": "" }, { "docid": "a9908a793bb6502bdf4c287a01cd13f9", "score": "0.38388157", "text": "func TestLatest(t *testing.T) {\n\troot := filepath.Join(\"testdata\", \"script\")\n\tif err := filepath.WalkDir(root, func(fullpath string, entry fs.DirEntry, err error) error {\n\t\tif err != nil {\n\t\t\treturn err\n\t\t}\n\t\tif !strings.HasSuffix(fullpath, \".txtar\") ||\n\t\t\tstrings.HasPrefix(filepath.Base(fullpath), \"fix\") {\n\t\t\treturn nil\n\t\t}\n\n\t\ta, err := txtar.ParseFile(fullpath)\n\t\tif err != nil {\n\t\t\treturn err\n\t\t}\n\t\tif bytes.HasPrefix(a.Comment, []byte(\"!\")) {\n\t\t\treturn nil\n\t\t}\n\n\t\tfor _, f := range a.Files {\n\t\t\tt.Run(path.Join(fullpath, f.Name), func(t *testing.T) {\n\t\t\t\tif !strings.HasSuffix(f.Name, \".cue\") {\n\t\t\t\t\treturn\n\t\t\t\t}\n\t\t\t\tv := parser.FromVersion(parser.Latest)\n\t\t\t\t_, err := parser.ParseFile(f.Name, f.Data, v)\n\t\t\t\tif err != nil {\n\t\t\t\t\tw := &bytes.Buffer{}\n\t\t\t\t\tfmt.Fprintf(w, \"\\n%s:\\n\", fullpath)\n\t\t\t\t\terrors.Print(w, err, nil)\n\t\t\t\t\tt.Error(w.String())\n\t\t\t\t}\n\t\t\t})\n\t\t}\n\t\treturn nil\n\t}); err != nil {\n\t\tt.Fatal(err)\n\t}\n}", "title": "" }, { "docid": "be46f2fc7012649d2b3a4e2ca9de5544", "score": "0.383692", "text": "func UpdatedAtGTE(v time.Time) predicate.Author {\n\treturn predicate.Author(func(s *sql.Selector) {\n\t\ts.Where(sql.GTE(s.C(FieldUpdatedAt), v))\n\t})\n}", "title": "" }, { "docid": "4c71eb75e7b08c3ed285bdeac7f787cf", "score": "0.38329923", "text": "func UpdatedAtGTE(v time.Time) predicate.Order {\n\treturn predicate.Order(func(s *sql.Selector) {\n\t\ts.Where(sql.GTE(s.C(FieldUpdatedAt), v))\n\t})\n}", "title": "" }, { "docid": "4c71eb75e7b08c3ed285bdeac7f787cf", "score": "0.38329923", "text": "func UpdatedAtGTE(v time.Time) predicate.Order {\n\treturn predicate.Order(func(s *sql.Selector) {\n\t\ts.Where(sql.GTE(s.C(FieldUpdatedAt), v))\n\t})\n}", "title": "" }, { "docid": "26559b6866c20475f0f2dc302a5e1d17", "score": "0.38304436", "text": "func (mtrs *Store) Latest(name string) []api.Metric {\n\tmtrs.mux.RLock()\n\tdefer mtrs.mux.RUnlock()\n\n\tbyPeer, ok := mtrs.byName[name]\n\tif !ok {\n\t\treturn []api.Metric{}\n\t}\n\n\tmetrics := make([]api.Metric, 0, len(byPeer))\n\tfor _, window := range byPeer {\n\t\tm, err := window.Latest()\n\t\tif err != nil || m.Discard() {\n\t\t\tcontinue\n\t\t}\n\t\tmetrics = append(metrics, m)\n\t}\n\treturn metrics\n}", "title": "" }, { "docid": "b02677844fd706b3c1e4496d9d975460", "score": "0.38297907", "text": "func (e *Extraction) Updates(filters ...Filter) ([]*Update, error) {\n\torbs, err := e.Orbs()\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\tfor _, filter := range filters {\n\t\torbs = filter(orbs)\n\t}\n\n\tupdates := newUpdateSet()\n\tfor _, o := range orbs {\n\t\tif !o.Version().IsSemantic() {\n\t\t\tcontinue\n\t\t}\n\n\t\tnewVersion, err := CircleCIClient.LatestVersion(o)\n\t\tif err != nil {\n\t\t\treturn nil, err\n\t\t}\n\n\t\tupdate := NewUpdate(o, newVersion)\n\t\tif !update.validate() {\n\t\t\tcontinue\n\t\t}\n\n\t\tif o.Version() != newVersion.Version() {\n\t\t\tupdates.add(update)\n\t\t}\n\t}\n\n\treturn updates.set, nil\n}", "title": "" }, { "docid": "8418393b09c893871ef06019d50d1736", "score": "0.3828634", "text": "func Historic(curr string, startTime time.Time, endTime time.Time, gran int) []gdax.HistoricRate {\n //Build client\n client := gdax.NewClient(\"\", \"\", \"\")\n\n // Holds all our return data\n var records []gdax.HistoricRate\n\n // Since this API is limited to 200 returned results per request and 6 calls\n // per second, break up the interval into smaller calls with a sleep\n numExpected := math.Ceil(endTime.Sub(startTime).Seconds() / float64(gran)) + 1\n if numExpected > 200 {\n frameLen := time.Duration(200*gran) * time.Second\n sframe := startTime\n eframe := startTime.Add(frameLen)\n for eframe.Before(endTime) {\n params := gdax.GetHistoricRatesParams { sframe, eframe, gran }\n records = append(records, processFrame(client, curr, params)...)\n sframe = eframe.Add(time.Duration(gran) * time.Second)\n eframe = sframe.Add(frameLen)\n time.Sleep(500 * time.Millisecond)\n }\n if eframe.After(endTime) {\n // The frame extends over the desired end boundary, so fill in\n params := gdax.GetHistoricRatesParams { sframe, endTime, gran }\n records = append(records, processFrame(client, curr, params)...)\n }\n } else {\n // Don't need to break up the call\n params := gdax.GetHistoricRatesParams { startTime, endTime, gran }\n records = processFrame(client, curr, params)\n }\n\n // Ensures data is returned in historical order (oldest first)\n sort.Slice(records, func(i, j int) bool {\n return records[i].Time.Before(records[j].Time)\n })\n\n return records\n}", "title": "" }, { "docid": "74e8ec4abe901537cbd7105886fe7cab", "score": "0.38276207", "text": "func TestGetPrice(t *testing.T) {\n\tnow := time.Now()\n\toneHourAgo := now.Add(time.Hour * -1)\n\ttwoHoursAgo := now.Add(time.Hour * -2)\n\n\tprice10K := decimal.New(10000, 1)\n\tprice20K := decimal.New(20000, 1)\n\n\tnow10k := &USDPrice{\n\t\tTimestamp: now,\n\t\tPrice: price10K,\n\t}\n\n\thourAgo20K := &USDPrice{\n\t\tTimestamp: oneHourAgo,\n\t\tPrice: price20K,\n\t}\n\n\ttests := []struct {\n\t\tname string\n\t\tprices []*USDPrice\n\t\trequest time.Time\n\t\texpectedErr error\n\t\texpectedPrice *USDPrice\n\t}{\n\t\t{\n\t\t\tname: \"no prices\",\n\t\t\tprices: nil,\n\t\t\trequest: oneHourAgo,\n\t\t\texpectedErr: errNoPrices,\n\t\t},\n\t\t{\n\t\t\tname: \"timestamp before range\",\n\t\t\tprices: []*USDPrice{now10k},\n\t\t\trequest: oneHourAgo,\n\t\t\texpectedErr: errPriceOutOfRange,\n\t\t\texpectedPrice: nil,\n\t\t},\n\t\t{\n\t\t\tname: \"timestamp equals data point timestamp\",\n\t\t\tprices: []*USDPrice{hourAgo20K, now10k},\n\t\t\trequest: now,\n\t\t\texpectedErr: nil,\n\t\t\texpectedPrice: now10k,\n\t\t},\n\t\t{\n\t\t\tname: \"timestamp after range\",\n\t\t\tprices: []*USDPrice{\n\t\t\t\t{\n\t\t\t\t\tTimestamp: twoHoursAgo,\n\t\t\t\t\tPrice: price10K,\n\t\t\t\t},\n\t\t\t\thourAgo20K,\n\t\t\t},\n\t\t\trequest: now,\n\t\t\texpectedErr: nil,\n\t\t\texpectedPrice: hourAgo20K,\n\t\t},\n\t\t{\n\t\t\tname: \"timestamp between prices, pick earlier\",\n\t\t\tprices: []*USDPrice{hourAgo20K, now10k},\n\t\t\trequest: now.Add(time.Minute * -30),\n\t\t\texpectedErr: nil,\n\t\t\texpectedPrice: hourAgo20K,\n\t\t},\n\t}\n\n\tfor _, test := range tests {\n\t\ttest := test\n\n\t\tt.Run(test.name, func(t *testing.T) {\n\t\t\tprice, err := GetPrice(test.prices, test.request)\n\t\t\tif err != test.expectedErr {\n\t\t\t\tt.Fatalf(\"expected: %v, got: %v\",\n\t\t\t\t\ttest.expectedErr, err)\n\t\t\t}\n\n\t\t\trequire.Equal(t, test.expectedPrice, price)\n\t\t})\n\t}\n}", "title": "" }, { "docid": "bc5fc2f9289f2832800ef1ff63521e4c", "score": "0.38261575", "text": "func (e *TDESlice) update(triagedDigests map[string]types.TestClassification) {\n\t// If the collection is empty then just build a new one.\n\tif len(*e) == 0 {\n\t\t*e = buildTDESlice(triagedDigests)\n\t\treturn\n\t}\n\n\t// Make a copy of the changes to keep track of the ones we have already accounted for.\n\tchange := (&Expectations{Tests: triagedDigests}).DeepCopy().Tests\n\n\t// empty keeps track of spots that have been changed to untriaged and can\n\t// be overridden. This avoids fragmentation of the batches of expecations.\n\tempty := []int{}\n\n\tfor batchIdx, exp := range *e {\n\t\tfor idx, name := range exp.Names {\n\t\t\tdigest := exp.Digests[idx]\n\t\t\tif newLabel, ok := change[name][digest]; ok {\n\t\t\t\t// Update the label and remove the entry.\n\t\t\t\texp.Labels[idx] = newLabel\n\t\t\t\tdelete(change[name], digest)\n\t\t\t}\n\t\t\t// Mark untriaged as empty slots for new entries to avoid fragmentation.\n\t\t\tif exp.Labels[idx] == types.UNTRIAGED {\n\t\t\t\tempty = append(empty, batchIdx, idx)\n\t\t\t}\n\t\t}\n\t}\n\n\temptyIdx := 0\n\tfor name, digests := range change {\n\t\tfor digest, label := range digests {\n\t\t\t// If we still have empty slots then insert this expectation.\n\t\t\tif emptyIdx < len(empty) {\n\t\t\t\tbatch := (*e)[empty[emptyIdx]]\n\t\t\t\tidx := empty[emptyIdx+1]\n\t\t\t\temptyIdx += 2\n\t\t\t\tbatch.Names[idx] = name\n\t\t\t\tbatch.Digests[idx] = digest\n\t\t\t\tbatch.Labels[idx] = label\n\t\t\t} else {\n\t\t\t\te.add(name, digest, label)\n\t\t\t}\n\t\t}\n\t}\n}", "title": "" }, { "docid": "0f9e51042a300dffd7d4d8a58c4f7ddf", "score": "0.3821405", "text": "func getLastAvailable() (bool, string) {\n\n\tlastDate := \"\"\n\tfound := false\n\tdate := time.Now()\n\n\t// Starting from today\n\tfor {\n\t\tlastDate = buildDatePrefix(date)\n\t\tmsoCount := 0\n\t\t// for each MSO\n\t\tfor _, mso := range msoList {\n\n\t\t\tprefix := cdwPrefix + \"/\" + mso.Code + \"/delta\"\n\t\t\tobjects := getS3Objects(cdwRegion, cdwBucketName, prefix, true)\n\n\t\t\tfor _, key := range objects.Contents {\n\t\t\t\t// iterate through the list to match the dates range/mso name\n\t\t\t\t// using the constracted below lookup string\n\t\t\t\tif verbose {\n\t\t\t\t\tlog.Println(\"Key: \", *key.Key)\n\t\t\t\t}\n\t\t\t\tif strings.Contains(*key.Key, \"_\"+lastDate) && *key.Size > 14 {\n\t\t\t\t\tmsoCount++\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\tif msoCount == len(msoList) {\n\t\t\tlastDate = formatOutputDate(date)\n\t\t\tfound = true\n\t\t\tbreak\n\t\t} else {\n\t\t\tdate = date.AddDate(0, 0, -1)\n\t\t\tif gotToFar(date) {\n\t\t\t\tbreak\n\t\t\t}\n\t\t}\n\t}\n\treturn found, lastDate\n}", "title": "" }, { "docid": "15a6bca035b6961f9cf4513d9305a7f0", "score": "0.38185775", "text": "func IsLatest(release *v1.ReleaseSpec, others []runtime.Object) bool {\n\tfor _, other := range others {\n\t\tm, err := meta.Accessor(other)\n\t\tif err != nil {\n\t\t\tcontinue\n\t\t}\n\t\tlabels := m.GetLabels()\n\t\tname := labels[\"name\"]\n\t\tif name == \"\" {\n\t\t\tname = labels[\"NAME\"]\n\t\t}\n\t\tif name != release.Name {\n\t\t\tcontinue\n\t\t}\n\n\t\tversion := labels[\"version\"]\n\t\tif version == \"\" {\n\t\t\tversion = labels[\"VERSION\"]\n\t\t}\n\n\t\tv, err := strconv.Atoi(version)\n\t\tif err != nil {\n\t\t\tcontinue\n\t\t}\n\n\t\tif v > release.Version {\n\t\t\treturn false\n\t\t}\n\t}\n\n\treturn true\n}", "title": "" }, { "docid": "28bf8fecf99b5d74d9c0bebd1c7a1bff", "score": "0.38169494", "text": "func (wal *Wallet) GetAllTransactions(offset, limit, txfilter int32) {\n\tgo func() {\n\t\tvar resp Response\n\t\twallets, err := wal.wallets()\n\t\tif err != nil {\n\t\t\tresp.Err = err\n\t\t\twal.Send <- resp\n\t\t\treturn\n\t\t}\n\n\t\tvar recentTxs []Transaction\n\n\t\ttransactions := make(map[int][]Transaction)\n\t\tticketTxs := make(map[int][]Transaction)\n\t\tbestBestBlock := wal.multi.GetBestBlock()\n\t\ttotalTxn := 0\n\n\t\tfor _, wall := range wallets {\n\t\t\ttxs, err := wall.GetTransactionsRaw(offset, limit, txfilter, true)\n\t\t\tif err != nil {\n\t\t\t\tresp.Err = err\n\t\t\t\twal.Send <- resp\n\t\t\t\treturn\n\t\t\t}\n\t\t\tfor _, txnRaw := range txs {\n\t\t\t\ttotalTxn++\n\t\t\t\tstatus, confirmations := transactionStatus(bestBestBlock.Height, txnRaw.BlockHeight)\n\t\t\t\ttxn := Transaction{\n\t\t\t\t\tTxn: txnRaw,\n\t\t\t\t\tStatus: status,\n\t\t\t\t\tBalance: dcrutil.Amount(txnRaw.Amount).String(),\n\t\t\t\t\tWalletName: wall.Name,\n\t\t\t\t\tConfirmations: confirmations,\n\t\t\t\t\tDateTime: dcrlibwallet.ExtractDateOrTime(txnRaw.Timestamp),\n\t\t\t\t}\n\t\t\t\trecentTxs = append(recentTxs, txn)\n\t\t\t\tif txn.Txn.Type == dcrlibwallet.TxTypeTicketPurchase {\n\t\t\t\t\tticketTxs[wall.ID] = append(ticketTxs[wall.ID], txn)\n\t\t\t\t}\n\t\t\t\ttransactions[txnRaw.WalletID] = append(transactions[txnRaw.WalletID], txn)\n\t\t\t}\n\t\t}\n\n\t\tsort.SliceStable(recentTxs, func(i, j int) bool {\n\t\t\tbackTime := time.Unix(recentTxs[j].Txn.Timestamp, 0)\n\t\t\tfrontTime := time.Unix(recentTxs[i].Txn.Timestamp, 0)\n\t\t\treturn backTime.Before(frontTime)\n\t\t})\n\n\t\trecentTxsLimit := 5\n\t\tif len(recentTxs) > recentTxsLimit {\n\t\t\trecentTxs = recentTxs[:recentTxsLimit]\n\t\t}\n\n\t\tresp.Resp = &Transactions{\n\t\t\tTotal: totalTxn,\n\t\t\tTxs: transactions,\n\t\t\tRecent: recentTxs,\n\t\t\tTickets: ticketTxs,\n\t\t}\n\t\twal.Send <- resp\n\t}()\n}", "title": "" }, { "docid": "48c13e96da43703ea9f8a584e6fb5c4c", "score": "0.38163152", "text": "func (_MattsuCoin *MattsuCoinTransactor) BuyLatestEthUsd(opts *bind.TransactOpts) (*types.Transaction, error) {\n\treturn _MattsuCoin.contract.Transact(opts, \"buyLatestEthUsd\")\n}", "title": "" }, { "docid": "a82b96b88619850c346902a55b777130", "score": "0.38113046", "text": "func findTTLChanges(existing, desired []targetConfig) ([]targetConfig, []targetConfig, ChangeList) {\n\n\tif (len(existing) == 0) || (len(desired) == 0) {\n\t\treturn existing, desired, nil\n\t}\n\n\t// Sort by comparableNoTTL\n\tsort.Slice(existing, func(i, j int) bool { return existing[i].comparableNoTTL < existing[j].comparableNoTTL })\n\tsort.Slice(desired, func(i, j int) bool { return desired[i].comparableNoTTL < desired[j].comparableNoTTL })\n\n\tvar instructions ChangeList\n\tvar existDiff, desiredDiff []targetConfig\n\tei := 0\n\tdi := 0\n\tfor (ei < len(existing)) && (di < len(desired)) {\n\t\ter := existing[ei].rec\n\t\tdr := desired[di].rec\n\t\tecomp := existing[ei].comparableNoTTL\n\t\tdcomp := desired[di].comparableNoTTL\n\n\t\tif ecomp == dcomp && er.TTL == dr.TTL {\n\t\t\tpanic(fmt.Sprintf(\n\t\t\t\t\"Should not happen. There should be some difference! ecomp=%q dcomp=%q er.TTL=%v dr.TTL=%v\\n\",\n\t\t\t\tecomp, dcomp, er.TTL, dr.TTL))\n\t\t}\n\n\t\tif ecomp == dcomp && er.TTL != dr.TTL {\n\t\t\tm := color.YellowString(\"± MODIFY-TTL %s %s %s\", dr.NameFQDN, dr.Type, humanDiff(existing[ei], desired[di]))\n\t\t\tv := mkChange(dr.NameFQDN, dr.Type, []string{m},\n\t\t\t\tmodels.Records{er},\n\t\t\t\tmodels.Records{dr},\n\t\t\t)\n\t\t\tv.HintOnlyTTL = true\n\t\t\tinstructions = append(instructions, v)\n\t\t\tei++\n\t\t\tdi++\n\t\t} else if ecomp < dcomp {\n\t\t\texistDiff = append(existDiff, existing[ei])\n\t\t\tei++\n\t\t} else if ecomp > dcomp {\n\t\t\tdesiredDiff = append(desiredDiff, desired[di])\n\t\t\tdi++\n\t\t} else {\n\t\t\tpanic(\"should not happen. ecomp cant be both == and != dcomp\")\n\t\t}\n\t}\n\n\t// Any remainder goes to the *Diff result:\n\tif ei < len(existing) {\n\t\texistDiff = append(existDiff, existing[ei:]...)\n\t}\n\tif di < len(desired) {\n\t\tdesiredDiff = append(desiredDiff, desired[di:]...)\n\t}\n\n\treturn existDiff, desiredDiff, instructions\n}", "title": "" }, { "docid": "e79c3716858da2fdcaeb195916ff3335", "score": "0.38072193", "text": "func TotalEntries(es ...Entry) Duration {\n\ttotal := NewDuration(0, 0)\n\tfor _, e := range es {\n\t\ttotal = total.Plus(e.Duration())\n\t}\n\treturn total\n}", "title": "" }, { "docid": "8cf5f3d377110a9b3efbd97c1c331988", "score": "0.38053527", "text": "func (efs ElasticFeedStore) ReindexFeedsToLatest(ctx context.Context, previousIndex string) (string, error) {\n\tsrc := olivere.NewReindexSource().Index(previousIndex)\n\tdst := olivere.NewReindexDestination().Index(IndexNameFeeds)\n\tstartTaskResult, err := efs.client.Reindex().Source(src).Destination(dst).DoAsync(ctx)\n\tif err != nil {\n\t\treturn \"\", err\n\t}\n\treturn startTaskResult.TaskId, nil\n}", "title": "" }, { "docid": "30e82240ae4ca7b7d1fe4809639ef467", "score": "0.3798962", "text": "func UpdatedAtGT(v time.Time) predicate.TransactionDetail {\n\treturn predicate.TransactionDetail(sql.FieldGT(FieldUpdatedAt, v))\n}", "title": "" }, { "docid": "072023095e2e36a01f46cc7fd10d33c0", "score": "0.3798406", "text": "func (teh *TlfEditHistory) GetComplete(ctx context.Context,\n\thead ImmutableRootMetadata) (TlfWriterEdits, error) {\n\tcurrEdits := teh.getEditsCopy()\n\tif currEdits != nil {\n\t\treturn currEdits, nil\n\t}\n\n\t// We have no history -- fetch from the server until we have a\n\t// complete history. TODO: make sure only one goroutine tries to\n\t// calculate the edit history at a time?\n\n\testimates := make(writerEditEstimates)\n\tfor _, writer := range head.GetTlfHandle().ResolvedWriters() {\n\t\testimates[writer] = 0\n\t}\n\trmds := []ImmutableRootMetadata{head}\n\testimates.update(rmds)\n\n\t// If unmerged, get all the unmerged updates.\n\tif head.MergedStatus() == Unmerged {\n\t\t_, unmergedRmds, err := getUnmergedMDUpdates(ctx, teh.config, head.TlfID(),\n\t\t\thead.BID(), head.Revision()-1)\n\t\tif err != nil {\n\t\t\treturn nil, err\n\t\t}\n\t\testimates.update(unmergedRmds)\n\t\trmds = teh.updateRmds(rmds, unmergedRmds)\n\t}\n\n\tfor (currEdits == nil || !currEdits.isComplete()) &&\n\t\tlen(rmds) < maxMDsToInspect &&\n\t\trmds[0].Revision() > MetadataRevisionInitial {\n\t\tteh.log.CDebugf(ctx, \"Edits not complete after %d revisions\", len(rmds))\n\t\tif estimates.isComplete() {\n\t\t\t// Once the estimate hits the threshold for each writer,\n\t\t\t// calculate the chains using all those MDs, and build the\n\t\t\t// real edit map (discounting deleted files, etc).\n\t\t\tvar err error\n\t\t\tcurrEdits, _, err = teh.calculateEditCounts(ctx, rmds)\n\t\t\tif err != nil {\n\t\t\t\treturn nil, err\n\t\t\t}\n\t\t\tif currEdits.isComplete() {\n\t\t\t\tbreak\n\t\t\t}\n\n\t\t\t// Set the estimates to their exact known values\n\t\t\testimates.reset(currEdits)\n\t\t}\n\n\t\tfor !estimates.isComplete() && len(rmds) < maxMDsToInspect &&\n\t\t\trmds[0].Revision() > MetadataRevisionInitial {\n\t\t\t// Starting from the head/branchpoint, work backwards\n\t\t\t// mdMax revisions at a time.\n\t\t\tendRev := rmds[0].Revision() - 1\n\t\t\tstartRev := endRev - maxMDsAtATime + 1\n\t\t\tif startRev < MetadataRevisionInitial {\n\t\t\t\tstartRev = MetadataRevisionInitial\n\t\t\t}\n\t\t\t// Don't fetch more MDs than we want to include in our\n\t\t\t// estimates.\n\t\t\tif int64(len(rmds))+int64(endRev-startRev)+1 > maxMDsToInspect {\n\t\t\t\tstartRev = MetadataRevision(\n\t\t\t\t\tint64(len(rmds)) + (int64(endRev) - maxMDsToInspect) + 1)\n\t\t\t}\n\n\t\t\tolderRmds, err := getMDRange(ctx, teh.config, head.TlfID(), NullBranchID,\n\t\t\t\tstartRev, endRev, Merged)\n\t\t\tif err != nil {\n\t\t\t\treturn nil, err\n\t\t\t}\n\n\t\t\t// Estimate the number of per-writer file operations by\n\t\t\t// keeping a count of the createOps and syncOps found.\n\t\t\testimates.update(olderRmds)\n\t\t\trmds = teh.updateRmds(rmds, olderRmds)\n\t\t}\n\t}\n\n\tif currEdits == nil {\n\t\t// We broke out of the loop early.\n\t\tvar err error\n\t\tcurrEdits, _, err = teh.calculateEditCounts(ctx, rmds)\n\t\tif err != nil {\n\t\t\treturn nil, err\n\t\t}\n\t}\n\n\tteh.setEdits(ctx, currEdits, rmds)\n\treturn teh.getEditsCopyLocked(), nil\n}", "title": "" }, { "docid": "4ff954dc05d2a69945910ce55ddc553a", "score": "0.3797992", "text": "func (s *TradeService) GetTradesUserHistory(a common.Address, tradeSpec *types.TradeSpec, sortedBy []string, pageOffset int, pageSize int) (*types.TradeRes, error) {\n\treturn s.tradeDao.GetTradesUserHistory(a, tradeSpec, sortedBy, pageOffset, pageSize)\n}", "title": "" }, { "docid": "1177264da1eab472d472881f0e2b1cf8", "score": "0.37955916", "text": "func (eth *EthClient) GetPastCoresUnstakeEvents(startBlock big.Int) ([]ChpRegistryCoreUnStaked, error) {\n\tregistryAddr := common.HexToAddress(eth.RegistryContractAddr)\n\tregistryInstance, err := NewChpRegistry(registryAddr, &eth.Client)\n\tif util.LoggerError(eth.Logger, err) != nil {\n\t\treturn []ChpRegistryCoreUnStaked{}, err\n\t}\n\tctx, cancel := context.WithTimeout(context.Background(), 20*time.Second)\n\tdefer cancel()\n\topt := &bind.FilterOpts{Context: ctx}\n\tstart := startBlock.Uint64()\n\topt.Start = start\n\ts := []common.Address{}\n\tunStaked, err := registryInstance.FilterCoreUnStaked(opt, s)\n\tif util.LoggerError(eth.Logger, err) != nil {\n\t\treturn []ChpRegistryCoreUnStaked{}, err\n\t}\n\tnodeStructSlice := make([]ChpRegistryCoreUnStaked, 0)\n\tnotEmpty := true\n\tfor notEmpty {\n\t\tnotEmpty = unStaked.Next()\n\t\tif notEmpty {\n\t\t\tnodeStructSlice = append(nodeStructSlice, *unStaked.Event)\n\t\t}\n\t}\n\treturn nodeStructSlice, nil\n}", "title": "" }, { "docid": "28c13dedb051e5c09b4a626f5b98b8f6", "score": "0.37910447", "text": "func GetLatestPackage(packages []PackageMeta, current *PackageMeta) PackageMeta {\n\t// Filter\n\tvar filtered []PackageMeta\n\tfor _, pkg := range packages {\n\t\tif (pkg.Arch == current.Arch) && (pkg.OS == current.OS) {\n\t\t\tfiltered = append(filtered, pkg)\n\t\t}\n\t}\n\t// Sort descending by version\n\tsort.Slice(filtered, func(i, j int) bool {\n\t\treturn filtered[i].Version.GT(filtered[j].Version)\n\t})\n\tif len(filtered) > 0 {\n\t\treturn filtered[0]\n\t}\n\treturn PackageMeta{}\n}", "title": "" }, { "docid": "7ba84c366910b3b9addcd85d89bd6236", "score": "0.3789999", "text": "func extractDailyInsightDataPoints(deployments []*model.Deployment, kind model.InsightMetricsKind, rangeFrom, rangeTo time.Time) ([]insight.DataPoint, error) {\n\tstep := model.InsightStep_DAILY\n\n\tvar movePoint func(time.Time, int) time.Time\n\tmovePoint = func(from time.Time, i int) time.Time {\n\t\tfrom = insight.NormalizeTime(from, step)\n\t\treturn from.AddDate(0, 0, i)\n\t}\n\n\tvar updatedps []insight.DataPoint\n\n\tto := movePoint(rangeFrom, 1)\n\tfor !to.After(rangeTo) {\n\t\ttargetTimestamp := insight.NormalizeTime(rangeFrom, step).Unix()\n\n\t\tvar data insight.DataPoint\n\t\tswitch kind {\n\t\tcase model.InsightMetricsKind_DEPLOYMENT_FREQUENCY:\n\t\t\tdata, deployments = extractDeployFrequency(deployments, rangeFrom.Unix(), to.Unix(), targetTimestamp)\n\t\tcase model.InsightMetricsKind_CHANGE_FAILURE_RATE:\n\t\t\tdata, deployments = extractChangeFailureRate(deployments, rangeFrom.Unix(), to.Unix(), targetTimestamp)\n\t\tdefault:\n\t\t\treturn nil, fmt.Errorf(\"invalid step: %v\", kind)\n\t\t}\n\n\t\tupdatedps = append(updatedps, data)\n\t\trangeFrom = movePoint(rangeFrom, 1)\n\t\tto = movePoint(to, 1)\n\t}\n\n\treturn updatedps, nil\n}", "title": "" }, { "docid": "9bfff5987a578b58aa80d22b61f552cd", "score": "0.3789457", "text": "func GetLatestExecutions(annotations []TaskAnnotation) []TaskAnnotation {\n\thighestExecutionAnnotations := map[string]TaskAnnotation{}\n\tfor idx, a := range annotations {\n\t\tstoredAnnotation, ok := highestExecutionAnnotations[a.TaskId]\n\t\tif !ok || storedAnnotation.TaskExecution < a.TaskExecution {\n\t\t\thighestExecutionAnnotations[a.TaskId] = annotations[idx]\n\t\t}\n\t}\n\tres := []TaskAnnotation{}\n\tfor _, a := range highestExecutionAnnotations {\n\t\tres = append(res, a)\n\t}\n\treturn res\n}", "title": "" }, { "docid": "e77e9020303f202ecf8b6b319540abc6", "score": "0.37850353", "text": "func UpdatedAtGTE(v time.Time) predicate.AuditLog {\n\treturn predicate.AuditLog(func(s *sql.Selector) {\n\t\ts.Where(sql.GTE(s.C(FieldUpdatedAt), v))\n\t},\n\t)\n}", "title": "" }, { "docid": "1f3196cc01f12bf84a6a15063cf6def6", "score": "0.37816784", "text": "func sliceSamples(samples []cortexpb.Sample, minTs int64) []cortexpb.Sample {\n\tif len(samples) <= 0 || minTs < samples[0].TimestampMs {\n\t\treturn samples\n\t}\n\n\tif len(samples) > 0 && minTs > samples[len(samples)-1].TimestampMs {\n\t\treturn samples[len(samples):]\n\t}\n\n\tsearchResult := sort.Search(len(samples), func(i int) bool {\n\t\treturn samples[i].TimestampMs > minTs\n\t})\n\n\treturn samples[searchResult:]\n}", "title": "" }, { "docid": "00f582b48a23d993390f4b9db50b2843", "score": "0.37807956", "text": "func (s *volumeStatCalculator) GetLatest() (PodVolumeStats, bool) {\n\tresult := s.latest.Load()\n\tif result == nil {\n\t\treturn PodVolumeStats{}, false\n\t}\n\treturn result.(PodVolumeStats), true\n}", "title": "" }, { "docid": "01e37acbf912019d9cad65b1c715467c", "score": "0.377452", "text": "func getLatestPricesFromDB(tickers []string, db *sql.DB) ([]stock.Price, error) {\n\tprices := make([]stock.Price, 0)\n\tquery := \"SELECT TICKER, PRICE, CURRENCY, PRICE_CHANGE, DATE_INSERTED FROM LATEST_PRICE WHERE TICKER=ANY($1)\"\n\trows, err := db.Query(query, pq.Array(tickers))\n\tdefer rows.Close()\n\tif err != nil {\n\t\treturn prices, err\n\t}\n\tvar price stock.Price\n\tfor rows.Next() {\n\t\terr = rows.Scan(\n\t\t\t&price.Ticker, &price.Price, &price.Currency, &price.PriceChange, &price.Date)\n\t\tif err != nil {\n\t\t\treturn prices, err\n\t\t}\n\t\tprices = append(prices, price)\n\t}\n\treturn prices, nil\n}", "title": "" }, { "docid": "28f601b5a627015edd269e4981acdd0b", "score": "0.37703842", "text": "func (_MattsuCoin *MattsuCoinTransactorSession) BuyLatestEthUsd() (*types.Transaction, error) {\n\treturn _MattsuCoin.Contract.BuyLatestEthUsd(&_MattsuCoin.TransactOpts)\n}", "title": "" }, { "docid": "26911d7297645ac70bdc01c7652e7bfa", "score": "0.3769045", "text": "func CalculateTrend(currentHealthiness, previousHealthiness *summarypb.HealthinessInfo) {\n\tpreviousFlakiness := map[string]float32{}\n\t// Create a map for faster lookup and avoiding repeated iteration through Tests\n\tfor _, test := range previousHealthiness.Tests {\n\t\tpreviousFlakiness[test.DisplayName] = test.Flakiness\n\t}\n\n\tfor i, test := range currentHealthiness.Tests {\n\t\tif value, ok := previousFlakiness[test.DisplayName]; ok {\n\t\t\tcurrentHealthiness.Tests[i].ChangeFromLastInterval = getTrend(test.Flakiness, value)\n\t\t}\n\t}\n}", "title": "" }, { "docid": "02286f0cfb6d0a334afb29c915af6d14", "score": "0.37681577", "text": "func (eth *EthClient) GetPastCoresStakedEvents(startBlock big.Int) ([]ChpRegistryCoreStaked, error) {\n\tregistryAddr := common.HexToAddress(eth.RegistryContractAddr)\n\tregistryInstance, err := NewChpRegistry(registryAddr, &eth.Client)\n\tif util.LoggerError(eth.Logger, err) != nil {\n\t\treturn []ChpRegistryCoreStaked{}, err\n\t}\n\tctx, cancel := context.WithTimeout(context.Background(), 20*time.Second)\n\tdefer cancel()\n\topt := &bind.FilterOpts{Context: ctx}\n\tstart := startBlock.Uint64()\n\topt.Start = start\n\ts := []common.Address{}\n\tstaked, err := registryInstance.FilterCoreStaked(opt, s)\n\tif util.LoggerError(eth.Logger, err) != nil {\n\t\treturn []ChpRegistryCoreStaked{}, err\n\t}\n\tnodeStructSlice := make([]ChpRegistryCoreStaked, 0)\n\tnotEmpty := true\n\tfor notEmpty {\n\t\tnotEmpty = staked.Next()\n\t\tif notEmpty {\n\t\t\tnodeStructSlice = append(nodeStructSlice, *staked.Event)\n\t\t}\n\t}\n\treturn nodeStructSlice, nil\n}", "title": "" }, { "docid": "247f321fcb936f9772fac4463fbd5ab1", "score": "0.3765471", "text": "func (_AggregatorInterface *AggregatorInterfaceCaller) LatestTimestamp(opts *bind.CallOpts) (*big.Int, error) {\n\tvar out []interface{}\n\terr := _AggregatorInterface.contract.Call(opts, &out, \"latestTimestamp\")\n\n\tif err != nil {\n\t\treturn *new(*big.Int), err\n\t}\n\n\tout0 := *abi.ConvertType(out[0], new(*big.Int)).(**big.Int)\n\n\treturn out0, err\n\n}", "title": "" }, { "docid": "dbadac1381003064596fbcb2e6db49eb", "score": "0.37642467", "text": "func (sl *SkipList) DeltaAll(delta float64) {\n\tnode := sl.root\n\tfor i := uint64(0); i < sl.n && node != nil; i++ {\n\t\tnode.data += delta\n\t\tnode = node.next[0]\n\t}\n}", "title": "" }, { "docid": "b2df2165d0f4cca0d44c5a46230c7298", "score": "0.37567183", "text": "func (session *Session) GetTimeEntries(daysBack int) ([]TimeEntry, error) {\n\tsince := time.Now().AddDate(0, 0, -daysBack).Format(\"2006-01-02\")\n\tuntil := time.Now().Format(\"2006-01-02\")\n\tparams := map[string]string{\n\t\t\"user_id\": \"me\",\n\t\t\"spent_on\": \"><\" + since + \"|\" + until,\n\t\t\"limit\": \"100\"}\n\n\tvar entries []TimeEntry\n\toffset := 0\n\n\tfor {\n\t\tdata, err := session.get(\"/time_entries.json\", params)\n\t\tif err != nil {\n\t\t\treturn nil, err\n\t\t}\n\n\t\tvar list struct {\n\t\t\tTimeEntries []TimeEntry `json:\"time_entries\"`\n\t\t\tLimit int `json:\"limit\"`\n\t\t\tOffset int `json:\"offset\"`\n\t\t\tTotalCount int `json:\"total_count\"`\n\t\t}\n\n\t\tdec := json.NewDecoder(bytes.NewReader(data))\n\t\terr = dec.Decode(&list)\n\t\tif err != nil {\n\t\t\treturn nil, err\n\t\t}\n\n\t\tentries = append(entries, list.TimeEntries...)\n\t\tif len(entries) == list.TotalCount {\n\t\t\tbreak\n\t\t}\n\n\t\toffset += len(entries)\n\t\tparams[\"offset\"] = strconv.Itoa(offset)\n\t}\n\n\treturn entries, nil\n}", "title": "" }, { "docid": "e849e0ba1aa6e92c7fef5ed8de767861", "score": "0.37527993", "text": "func TxDifference(a, b Transactions) (keep Transactions) {\n\tkeep = make(Transactions, 0, len(a))\n\n\tremove := make(map[common.Hash]struct{})\n\tfor _, tx := range b {\n\t\tremove[tx.Hash()] = struct{}{}\n\t}\n\n\tfor _, tx := range a {\n\t\tif _, ok := remove[tx.Hash()]; !ok {\n\t\t\tkeep = append(keep, tx)\n\t\t}\n\t}\n\n\treturn keep\n}", "title": "" }, { "docid": "66d8bfffe5923eaca1c4d13516050e2a", "score": "0.37512374", "text": "func GetCryptoHistory(tickers store.Tickers, st time.Time, et time.Time) map[string][]*store.TickerHistory {\n\n\tvar thm = make(map[string][]*store.TickerHistory)\n\tvar sBuilder strings.Builder\n\ttm := make(map[string]*store.Ticker)\n\n\tfor _, ticker := range tickers {\n\t\tif ticker.IsCrypto() {\n\t\t\tts := strings.ToLower(strings.Replace(ticker.Symbol, \"-USD\", \"USD\", 1))\n\t\t\tsBuilder.WriteString(ts)\n\t\t\tsBuilder.WriteString(\",\")\n\t\t\ttm[ts] = ticker\n\t\t}\n\t}\n\n\tif len(sBuilder.String()) == 0 {\n\t\treturn thm\n\t}\n\n\tdates := fmt.Sprintf(\"&startDate=%s&endDate=%s\", utils.DateFormat1(st), utils.DateFormat1(et))\n\turl := strings.Join([]string{cryptoURL, \"?tickers=\", sBuilder.String(), \"&resampleFreq=1day\", dates, \"&token=\", apiToken}, \"\")\n\t// log.Printf(\"url: %s\", url)\n\tvar s = new([]cResponse)\n\n\trunHTTPGet(url, s)\n\n\tfor _, res := range *s {\n\t\tt := tm[res.Symbol]\n\t\tif t != nil {\n\t\t\tfor _, th := range res.CTicker {\n\t\t\t\t// th.Exchange = t.Exchange\n\t\t\t\tth.Symbol = t.Symbol\n\t\t\t\tth.Date = utils.DateAdjustForUtc(th.Date)\n\t\t\t\t// log.Printf(\"Date: %v price: %f\", th.Date, th.Close)\n\t\t\t}\n\t\t\tthm[t.GetTickerID()] = res.CTicker\n\t\t}\n\t}\n\n\treturn thm\n}", "title": "" }, { "docid": "2979bd771c951f61401f47d87ba48d8c", "score": "0.3748602", "text": "func totalChanges(existingSlice *discovery.EndpointSlice, desiredSet endpointsliceutil.EndpointSet) totalsByAction {\n\ttotals := totalsByAction{}\n\texistingMatches := 0\n\n\tfor _, endpoint := range existingSlice.Endpoints {\n\t\tgot := desiredSet.Get(&endpoint)\n\t\tif got == nil {\n\t\t\t// If not desired, increment number of endpoints to be deleted.\n\t\t\ttotals.removed++\n\t\t} else {\n\t\t\texistingMatches++\n\n\t\t\t// If existing version of endpoint doesn't match desired version\n\t\t\t// increment number of endpoints to be updated.\n\t\t\tif !endpointsliceutil.EndpointsEqualBeyondHash(got, &endpoint) {\n\t\t\t\ttotals.updated++\n\t\t\t}\n\t\t}\n\t}\n\n\t// Any desired endpoints that have not been found in the existing slice will\n\t// be added.\n\ttotals.added = desiredSet.Len() - existingMatches\n\treturn totals\n}", "title": "" }, { "docid": "b64bd2d5c2cdd53b4c2db58bd5c0316d", "score": "0.37466955", "text": "func fixedEvents(t *testing.T) *event_feed_api.FeedResponse {\n\ttime1, err := time.Parse(time.RFC3339, \"2018-01-20T21:21:21Z\")\n\tassert.Nil(t, err)\n\ttimestamp1, err := ptypes.TimestampProto(time1)\n\tassert.Nil(t, err)\n\ttime2, err := time.Parse(time.RFC3339, \"2018-01-19T21:20:41Z\")\n\tassert.Nil(t, err)\n\ttimestamp2, err := ptypes.TimestampProto(time2)\n\tassert.Nil(t, err)\n\ttime3, err := time.Parse(time.RFC3339, \"2018-01-20T21:20:41Z\")\n\tassert.Nil(t, err)\n\ttimestamp3, err := ptypes.TimestampProto(time3)\n\tassert.Nil(t, err)\n\n\tvar (\n\t\tfixedEvents = []*event_feed_api.FeedEntry{\n\t\t\t{\n\t\t\t\tEventType: \"scanJobUpdated\",\n\t\t\t\tTags: []string{\"scanjob\"},\n\t\t\t\tVerb: \"update\",\n\t\t\t\tSourceEventPublished: timestamp1,\n\t\t\t\tProducer: &event_feed_api.Producer{\n\t\t\t\t\tName: \"mocked_event\",\n\t\t\t\t\tId: \"scanjob\",\n\t\t\t\t},\n\t\t\t\tActor: &event_feed_api.Actor{\n\t\t\t\t\tName: \"golang\",\n\t\t\t\t\tObjectType: \"automatic\",\n\t\t\t\t},\n\t\t\t\tTarget: &event_feed_api.Target{\n\t\t\t\t\tName: \"localhost\",\n\t\t\t\t},\n\t\t\t},\n\t\t}\n\t\t// This is the event type we will add multiple times to group it or not\n\t\tprofileUpdateEvent = &event_feed_api.FeedEntry{\n\t\t\tEventType: \"profileUpdated\",\n\t\t\tTags: []string{\"profile\"},\n\t\t\tVerb: \"update\",\n\t\t\tSourceEventPublished: timestamp2,\n\t\t\tProducer: &event_feed_api.Producer{\n\t\t\t\tName: \"mocked_event\",\n\t\t\t\tId: \"profile\",\n\t\t\t},\n\t\t\tActor: &event_feed_api.Actor{\n\t\t\t\tName: \"golang\",\n\t\t\t\tObjectType: \"automatic\",\n\t\t\t},\n\t\t\tTarget: &event_feed_api.Target{\n\t\t\t\tName: \"localhost\",\n\t\t\t},\n\t\t}\n\n\t\tlaterProfileUpdateEvent = &event_feed_api.FeedEntry{\n\t\t\tEventType: \"profileUpdated\",\n\t\t\tTags: []string{\"profile\"},\n\t\t\tVerb: \"update\",\n\t\t\tSourceEventPublished: timestamp3,\n\t\t\tProducer: &event_feed_api.Producer{\n\t\t\t\tName: \"mocked_event\",\n\t\t\t\tId: \"profile\",\n\t\t\t},\n\t\t\tActor: &event_feed_api.Actor{\n\t\t\t\tName: \"golang\",\n\t\t\t\tObjectType: \"automatic\",\n\t\t\t},\n\t\t\tTarget: &event_feed_api.Target{\n\t\t\t\tName: \"localhost\",\n\t\t\t},\n\t\t}\n\t)\n\n\t// Adding 9 profile events (updated by golang, since this is an automated test)\n\tfor i := 0; i < 99; i++ {\n\t\tfixedEvents = append(fixedEvents, profileUpdateEvent)\n\t}\n\n\t//Add a final profile with a later timestamp to test endtime.\n\tfixedEvents = append(fixedEvents, laterProfileUpdateEvent)\n\n\t// We are always returning 100 profile events plus 1 node edit\n\t// => 101 Events\n\n\t// sort fixedEvents\n\tsort.Slice(fixedEvents[:], func(i, j int) bool {\n\t\tidate, err := ptypes.Timestamp(fixedEvents[i].SourceEventPublished)\n\t\tassert.Nil(t, err)\n\t\tjdate, err := ptypes.Timestamp(fixedEvents[j].SourceEventPublished)\n\t\tassert.Nil(t, err)\n\t\treturn idate.After(jdate)\n\t})\n\n\treturn &event_feed_api.FeedResponse{FeedEntries: fixedEvents}\n}", "title": "" }, { "docid": "0f97e3ec138c248cd09071096d4f860b", "score": "0.37439513", "text": "func Latest(ctx aero.Context) error {\n\tuserID := ctx.Get(\"id\")\n\tuser, err := arn.GetUser(userID)\n\n\tif err != nil {\n\t\treturn ctx.Error(http.StatusBadRequest, \"Invalid user ID\")\n\t}\n\n\tnotifications := user.Notifications().Notifications()\n\n\t// Sort by date\n\tsort.Slice(notifications, func(i, j int) bool {\n\t\treturn notifications[i].Created > notifications[j].Created\n\t})\n\n\tif len(notifications) > maxNotifications {\n\t\tnotifications = notifications[:maxNotifications]\n\t}\n\n\treturn ctx.JSON(notifications)\n}", "title": "" }, { "docid": "15b4fd264f64b548af182210b300b6bd", "score": "0.37435174", "text": "func (dc *DiskCollector) calcDerivatives() error {\n\tinterval := dc.data.timestamp.Sub(dc.dataPrev.timestamp).Seconds()\n\n\tif interval <= 0 {\n\t\treturn errors.New(\"Invalid interval value\")\n\t}\n\n\tif len(dc.data.stats) == 0 || len(dc.dataPrev.stats) == 0 {\n\t\treturn errors.New(\"No data for calculation\")\n\t}\n\n\tvar diffVal uint64\n\n\t// (for each disk) keep values of the stats differences which are needed to calculate avg disk time\n\tavgDiskTime := make(map[string]*diffStats)\n\n\tfor key, val := range dc.data.stats {\n\n\t\t/** Calculate the change of the value in interval time **/\n\n\t\tvalPrev := dc.dataPrev.stats[key]\n\n\t\t// if the counter wraps around\n\t\tif val < valPrev {\n\t\t\tdiffVal = 1 + val + (uintMax - valPrev)\n\t\t} else {\n\t\t\tdiffVal = val - valPrev\n\t\t}\n\n\t\tderiveVal := float64(diffVal) / interval\n\n\t\tdisk, nMetric := parseMetricKey(key)\n\n\t\tif _, exists := avgDiskTime[disk]; exists == false {\n\t\t\tavgDiskTime[disk] = new(diffStats)\n\t\t}\n\n\t\t// switch special case for some metrics based on the last part of metric name\n\t\tswitch nMetric {\n\t\t// switch case based on the last part of metric name\n\t\tcase nOctetsWrite:\n\t\t\tdc.output[key] = 512 * deriveVal\n\n\t\tcase nOctetsRead:\n\t\t\tdc.output[key] = 512 * deriveVal\n\n\t\tcase nTimeWrite:\n\t\t\tavgDiskTime[disk].diffWriteTime = diffVal\n\n\t\tcase nTimeRead:\n\t\t\tavgDiskTime[disk].diffReadTime = diffVal\n\n\t\tcase nOpsRead:\n\t\t\tavgDiskTime[disk].diffReadOps = diffVal\n\t\t\tdc.output[key] = deriveVal\n\n\t\tcase nOpsWrite:\n\t\t\tavgDiskTime[disk].diffWriteOps = diffVal\n\t\t\tdc.output[key] = deriveVal\n\t\tcase nPendingOps:\n\t\t\t// its a gauge metric - see calGauge()\n\n\t\tdefault:\n\t\t\tdc.output[key] = deriveVal\n\t\t}\n\t}\n\n\t// calculate disk time\n\tfor disk, values := range avgDiskTime {\n\t\tdc.output[createMetricKey(disk, nTimeRead)] = calcTimeIncrement(values.diffReadTime, values.diffReadOps, interval)\n\t\tdc.output[createMetricKey(disk, nTimeWrite)] = calcTimeIncrement(values.diffWriteTime, values.diffWriteOps, interval)\n\t}\n\n\treturn nil\n}", "title": "" } ]
6bfb5526c4597f1da141a75fb6bd0da1
New returns new Config
[ { "docid": "4980c59eed6d14a5b38f6500d6f56fc4", "score": "0.64326245", "text": "func New() (*Config, error) {\n\tc := &Config{}\n\tconfigPath := os.Getenv(\"CONFIG_PATH\")\n\tconfigFile := filepath.Join(configPath, ConfigFileName)\n\tfile, err := os.Open(configFile)\n\tdefer file.Close()\n\tif err != nil {\n\t\treturn c, err\n\t}\n\n\tb, err := ioutil.ReadAll(file)\n\tif err != nil {\n\t\treturn c, err\n\t}\n\n\tif len(b) != 0 {\n\t\tyaml.Unmarshal(b, c)\n\t}\n\treturn c, nil\n}", "title": "" } ]
[ { "docid": "a24c2a221d1c2f12eddf98c1483157c8", "score": "0.7908078", "text": "func New() Config {\n\tc := Config{}\n\treturn c\n}", "title": "" }, { "docid": "25e9d8ab0926e18074189e2d6fa3af89", "score": "0.7775399", "text": "func New() *Config {\r\n\t// setup the config object\r\n\treturn &Config{}\r\n}", "title": "" }, { "docid": "8ee581fe90142f0626ff186ddc21d7a0", "score": "0.7740571", "text": "func New() *Config {\n\treturn &Config{\n\t\tcurrent: make(map[string]string),\n\t\told: make(map[string]string),\n\t\tsetTemporarilyAgeTracker: make(map[string]int),\n\t\tsetTemporarilyAge: 1,\n\t}\n}", "title": "" }, { "docid": "f8b4dc561cfb8cd644d150fd69c2770d", "score": "0.7697251", "text": "func New() *Config {\n\treturn &Config{}\n}", "title": "" }, { "docid": "f8b4dc561cfb8cd644d150fd69c2770d", "score": "0.7697251", "text": "func New() *Config {\n\treturn &Config{}\n}", "title": "" }, { "docid": "f8b4dc561cfb8cd644d150fd69c2770d", "score": "0.7697251", "text": "func New() *Config {\n\treturn &Config{}\n}", "title": "" }, { "docid": "473a83cf31a22e19ec462f42c3b10548", "score": "0.758265", "text": "func New() *Config {\n\tconfig := Config{}\n\treturn &config\n}", "title": "" }, { "docid": "f326b422e7a53c45606214909c0a39b9", "score": "0.7512791", "text": "func newConfig() *Config {\n\treturn NewConfigWithID(operatorType)\n}", "title": "" }, { "docid": "5ff8dc251dcdf6107b0ded6c30e1a6bb", "score": "0.750082", "text": "func newConfig() *config {\n\tcfg := new(config)\n\tcfg.Version = \"0.0.1\"\n\t// Empty Calendars\n\tcfg.Calendars = make(map[string]calendar)\n\treturn cfg\n}", "title": "" }, { "docid": "7fa44851d8041c748e78bc441c03d764", "score": "0.7395073", "text": "func New() *Config {\n\treturn new(Config)\n}", "title": "" }, { "docid": "522440aaa3e26a60c62cf300f0f6e228", "score": "0.72922075", "text": "func New() *Config {\n\tc := &Config{\n\t\tconfig: &blockio.Config{},\n\t}\n\treturn c\n}", "title": "" }, { "docid": "aafc0ea6bc6f15bfb6710a40964e75a0", "score": "0.72790885", "text": "func New() *Config {\n return &Config{\n App: App{\n Name: getEnv(\"APP_NAME\", \"GO Rest API\"),\n Port: getEnv(\"APP_PORT\", \"8080\"),\n },\n DBConfig: DBConfig{\n DBDriver: getEnv(\"DB_DRIVER\", \"mysql\"),\n DBHost: getEnv(\"DB_HOST\", \"localhost\"),\n DBPort: getEnv(\"DB_POST\", \"3306\"),\n DBUser: getEnv(\"DB_USER\", \"root\"),\n DBName: getEnv(\"DB_NAME\", \"go_rest_skeleton\"),\n DBPassword: getEnv(\"DB_PASSWORD\", \"\"),\n DBLog: getEnvAsBool(\"ENABLE_LOGGER\", true),\n },\n }\n}", "title": "" }, { "docid": "83312972b1c70c2c3da0b364cb571c8f", "score": "0.72667795", "text": "func New(configuration *config.Config) *Config {\n\treturn &Config{configuration}\n}", "title": "" }, { "docid": "b9e63c0a8af3e67e1f8ad018a6123114", "score": "0.7256387", "text": "func ConfigNew() *Config {\n\tc := Config{\n\t\tCreds: []ConfigCreds{},\n\t\tSync: []ConfigSync{},\n\t}\n\treturn &c\n}", "title": "" }, { "docid": "305e552433b7ebf1a4f52b7e8081d4df", "score": "0.7216516", "text": "func New(data interface{}) (Config, *probe.Error) {\n\tif err := CheckData(data); err != nil {\n\t\treturn nil, err.Trace()\n\t}\n\n\td := new(config)\n\td.data = data\n\td.lock = new(sync.RWMutex)\n\treturn d, nil\n}", "title": "" }, { "docid": "4e6ff48cdeb3caf9e4021c6a7a1dc388", "score": "0.7199782", "text": "func New(apiKey string) Config {\n\treturn Config{apiKey}\n}", "title": "" }, { "docid": "052d902bfb949198db6d18c70c57ba46", "score": "0.7170711", "text": "func New() Config {\n\tconfigFilePath := getConfigPath()\n\tcfg := Config{}\n\tif _, err := os.Stat(configFilePath); err != nil {\n\t\tcfg.saveConfig()\n\t\treturn cfg\n\t}\n\tcfg = readConfig()\n\treturn cfg\n}", "title": "" }, { "docid": "16a97178d5d3e0e31a37fa4ccb5e0d8a", "score": "0.71627134", "text": "func (l *configLoader) New() *latest.Config {\n\treturn latest.New().(*latest.Config)\n}", "title": "" }, { "docid": "49c126e553b71164c7e45fba6b1d84bb", "score": "0.71541935", "text": "func New() *Config {\n\tconfig := new(Config)\n\tconfig.Interval = DefaultInterval\n\tconfig.Period = [2]int{DefaultNumGrid, DefaultGridLen}\n\tconfig.Storage.Path = \"storage/\"\n\tconfig.Detector.Port = 2015\n\tconfig.Detector.Factor = DefaultWeightFactor\n\tconfig.Detector.BlackList = []string{}\n\tconfig.Webapp.Port = 2016\n\tconfig.Webapp.Auth = [2]string{\"admin\", \"admin\"}\n\tconfig.Webapp.Static = \"static\"\n\tconfig.Alerter.Command = \"\"\n\tconfig.Alerter.Workers = 4\n\treturn config\n}", "title": "" }, { "docid": "7f9ea4ec42d6d4b71dfacad0c2a74480", "score": "0.71423495", "text": "func New(apiKey string) Config {\n\treturn Config(apiKey)\n}", "title": "" }, { "docid": "e546f451e754d78dff0d0a9c9670697e", "score": "0.7101362", "text": "func New() *Config {\n\treturn &Config{\n\t\tenabled: false,\n\t}\n}", "title": "" }, { "docid": "74a0f8df2a96d70240f47bc1d3a1a0f6", "score": "0.7099215", "text": "func New() (*Config, error) {\n\tconfigBytes, err := readConfigFile(determinConfigPath())\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\tc, err := hydrateConfig(configBytes)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\treturn c, nil\n}", "title": "" }, { "docid": "9f6b51821a8da745e484d880e1dfe7a0", "score": "0.7077152", "text": "func New() (*Config, error) {\n\tc := &Config{}\n\tif err := c.Load(); err != nil {\n\t\treturn c, err\n\t}\n\n\treturn c, nil\n}", "title": "" }, { "docid": "fcfda87bb32d688c982ef85c143609a9", "score": "0.707012", "text": "func New() Config {\n\treturn Config{\n\t\tResolvers: &Resolver{\n\t\t\tsc: &data.DBConnector{},\n\t\t},\n\t}\n}", "title": "" }, { "docid": "1858321950d25b4e423d8ad1712ec552", "score": "0.7069246", "text": "func New() IConfig {\n\treturn &Config{\n\t\tMutex: sync.Mutex{},\n\t}\n}", "title": "" }, { "docid": "a4e5cdcb78b97e727529e4c793b5f24e", "score": "0.7049386", "text": "func New() *Config {\n\treturn &Config{Comment: Comment, Spliter: Spliter, data: map[string]*Section{}}\n}", "title": "" }, { "docid": "2d2150b53a61e8d32f54134a85254dcb", "score": "0.7045421", "text": "func New() *Config {\n\treturn &Config{viper: viper.New()}\n}", "title": "" }, { "docid": "b7a578e4ab601d9b218c85bfd3826b8d", "score": "0.7025902", "text": "func New(path string) (Config, error) {\n\tfile, err := os.Open(path)\n\tdefer file.Close()\n\tif err != nil {\n\t\tlog.Fatal(err)\n\t}\n\tdecoder := json.NewDecoder(file)\n\tcfg := Config{}\n\terr = decoder.Decode(&cfg)\n\tif err != nil {\n\t\tlog.Fatal(err)\n\t}\n\n\treturn cfg, nil\n}", "title": "" }, { "docid": "56c77e84a05dbcd0206688c9d8ba8422", "score": "0.7024586", "text": "func New() *Config {\n\tc := new(Config)\n\tc.SystemPath = DefaultSystemConfigPath\n\tc.Addr = \"127.0.0.1:4001\"\n\tc.HTTPReadTimeout = server.DefaultReadTimeout\n\tc.HTTPWriteTimeout = server.DefaultWriteTimeout\n\tc.MaxResultBuffer = 1024\n\tc.MaxRetryAttempts = 3\n\tc.RetryInterval = 10.0\n\tc.Snapshot = true\n\tc.SnapshotCount = 10000\n\tc.Peer.Addr = \"127.0.0.1:7001\"\n\tc.Peer.HeartbeatInterval = defaultHeartbeatInterval\n\tc.Peer.ElectionTimeout = defaultElectionTimeout\n\trand.Seed(time.Now().UTC().UnixNano())\n\t// Make maximum twice as minimum.\n\tc.RetryInterval = float64(50+rand.Int()%50) * defaultHeartbeatInterval / 1000\n\tc.Cluster.ActiveSize = server.DefaultActiveSize\n\tc.Cluster.RemoveDelay = server.DefaultRemoveDelay\n\tc.Cluster.SyncInterval = server.DefaultSyncInterval\n\treturn c\n}", "title": "" }, { "docid": "6e99ff3dd3841f775d5ce3a564bde3c7", "score": "0.7019461", "text": "func New() Config {\n\tvar instance Config\n\n\tk := koanf.New(\".\")\n\n\tif err := k.Load(structs.Provider(def, \"koanf\"), nil); err != nil {\n\t\tlogrus.Fatalf(\"error loading default: %s\", err)\n\t}\n\n\tif err := k.Load(file.Provider(\"config.yml\"), yaml.Parser()); err != nil {\n\t\tlogrus.Errorf(\"error loading file: %s\", err)\n\t}\n\n\tif err := k.Load(env.Provider(_Prefix, \".\", func(s string) string {\n\t\tparsedEnv := strings.ReplaceAll(strings.ToLower(strings.TrimPrefix(s, _Prefix)), \"__\", \"-\")\n\n\t\treturn strings.ReplaceAll(parsedEnv, \"_\", \".\")\n\t}), nil); err != nil {\n\t\tlogrus.Errorf(\"error loading environment variables: %s\", err)\n\t}\n\n\tif err := k.Unmarshal(\"\", &instance); err != nil {\n\t\tlogrus.Fatalf(\"error unmarshalling config: %s\", err)\n\t}\n\n\tlogrus.Infof(\"following configuration is loaded:\\n%+v\", instance)\n\n\treturn instance\n}", "title": "" }, { "docid": "8d62862b27ebca3b18b004cc9871bcc1", "score": "0.70046186", "text": "func New() *Config {\n\treturn &Config{Hyperledger: hlconfig.New()}\n}", "title": "" }, { "docid": "369114ad9693def71d00b07d5b7a971a", "score": "0.6985774", "text": "func New() *Config {\n\treturn &Config{\n\t\tIndex: DefaultIndex,\n\t\tPlatform: DefaultPlatform,\n\t\tLogLevel: DefaultLogLevel,\n\t\tLogFormat: DefaultLogFormat,\n\t}\n}", "title": "" }, { "docid": "c54459f609cf6e417232cef321308200", "score": "0.69695204", "text": "func newConfig(file string) *Config {\n\tconfig := Config{}\n\tif _, err := os.Stat(file); !os.IsNotExist(err) {\n\t\tif fullpath, err := filepath.Abs(file); err == nil {\n\t\t\tconfig.configFile = fullpath\n\t\t\tconfig.settings = FlattenConfig(fullpath)\n\t\t\treturn &config\n\t\t}\n\t}\n\treturn nil\n}", "title": "" }, { "docid": "bca9bed5cc55578965fabde5fbca17fd", "score": "0.69166183", "text": "func New() *Config {\n\tc := &Config{\n\t\tAuth: new(auth.Config),\n\t\tpath: configPath,\n\t}\n\n\treturn c\n}", "title": "" }, { "docid": "def662e95bb8682e7e490dd1945ddeac", "score": "0.6910268", "text": "func New(path string) (Config, error) {\n\tvar cfg Config\n\n\tfile, err := os.Open(path)\n\tdefer file.Close()\n\tif err != nil {\n\t\treturn cfg, err\n\t}\n\n\tif err = json.NewDecoder(file).Decode(&cfg); err != nil {\n\t\treturn cfg, err\n\t}\n\n\treturn cfg, err\n}", "title": "" }, { "docid": "84671a91fe212f0d566b389b586eb1df", "score": "0.68830866", "text": "func New() Config {\n\tc := Config{}\n\tc.OutputDirectory = \"./output\"\n\treturn c\n}", "title": "" }, { "docid": "1684b81ed30a6d69b67b78f75ea0f12d", "score": "0.6875342", "text": "func New(path string) *Config {\n\treturn &Config{Path: path}\n}", "title": "" }, { "docid": "3581257f353cc903caf37415edef5084", "score": "0.68734074", "text": "func New() (*Config, error) {\n\n\tvar c Config\n\tif err := envconfig.Process(\"\", &c); err != nil {\n\t\treturn nil, errors.Wrap(err, \"impossible to parse app configuration \")\n\t}\n\n\treturn &c, nil\n}", "title": "" }, { "docid": "c9077aede1e6fd50bcad21cdcda74c38", "score": "0.6867837", "text": "func New(configName string) *Config {\n\tconfig := &Config{\n\t\tName: configName,\n\t\tRoot: \"~/\",\n\t\tWindows: make([]*Window, 3),\n\t}\n\n\tconfig.Windows[0] = &Window{\n\t\tName: \"editor\",\n\t\tLayout: \"main-vertical\",\n\t\tPanes: []string{\n\t\t\t\"vim\",\n\t\t\t\"guard\",\n\t\t},\n\t}\n\n\tconfig.Windows[1] = &Window{\n\t\tName: \"server\",\n\t\tPanes: []string{\n\t\t\t\"bundle exec rails s\",\n\t\t},\n\t}\n\n\tconfig.Windows[2] = &Window{\n\t\tName: \"logs\",\n\t\tPanes: []string{\n\t\t\t\"tail -f log/development.log\",\n\t\t},\n\t}\n\n\treturn config\n}", "title": "" }, { "docid": "cb130817bd3f6425267ac0376e7b2df5", "score": "0.68648714", "text": "func (c *Config) New() (types.ConfigSource, error) {\n\treturn New(), nil\n}", "title": "" }, { "docid": "0ce8a92677fe507b1f9a2520e2cfbd75", "score": "0.68480647", "text": "func New(file string, cipherFlg bool) *Config {\n\tvar err error\n\tconf, err = loadConfig(file)\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\n\t//if cipherFlg {\n\t//\tCipher()\n\t//}\n\n\treturn conf\n}", "title": "" }, { "docid": "059595c8fa10dde1848bf586fbeb2b30", "score": "0.68376786", "text": "func New(config *Config) *Configor {\n\tif config == nil {\n\t\tconfig = &Config{}\n\t}\n\n\tif os.Getenv(\"CONFIGOR_DEBUG_MODE\") != \"\" {\n\t\tconfig.Debug = true\n\t}\n\n\tif os.Getenv(\"CONFIGOR_VERBOSE_MODE\") != \"\" {\n\t\tconfig.Verbose = true\n\t}\n\n\treturn &Configor{Config: config}\n}", "title": "" }, { "docid": "5625f0c906521d3fd616b4f3974e262b", "score": "0.6834488", "text": "func new(cfgFile string) (*rendora, error) {\n\tc, err := config.New(cfgFile)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\tlog.Println(\"Configuration loaded\")\n\n\trendora := &rendora{\n\t\tc: c,\n\t\tmetrics: &service.Metrics{},\n\t\tcfgFile: cfgFile,\n\t}\n\n\treturn rendora, nil\n}", "title": "" }, { "docid": "3008cd053492ff4d25a89bcaf2e05621", "score": "0.68296564", "text": "func NewConfig() Config {\n\treturn Config{\n\t\tType: \"none\",\n\t\tAllowCreate: true,\n\t\tRedisConfig: NewRedisConfig(),\n\t\tFileConfig: NewFileConfig(),\n\t}\n}", "title": "" }, { "docid": "ca8bcab466d78d6180e79d36fc7bd508", "score": "0.6828014", "text": "func New(c *cli.Context) Config {\n\t// the error is ignored because logger is unnecessary\n\tgc, _ := config.NewGlobalConfig(c) // nolint: errcheck\n\treturn Config{\n\t\tGlobalConfig: gc,\n\t\tDBConfig: config.NewDBConfig(c),\n\n\t\tListen: c.String(\"listen\"),\n\t\tToken: c.String(\"token\"),\n\t\tTokenHeader: c.String(\"token-header\"),\n\t}\n}", "title": "" }, { "docid": "8d1f858c839b8b96a6103effdb00faab", "score": "0.6816923", "text": "func New(filename string) *Config {\n\tconfig := Config{}\n\tconfig.Setup(filename)\n\treturn &config\n}", "title": "" }, { "docid": "92419126c724c5d4d325d14c513b4955", "score": "0.6816455", "text": "func NewConfig() Config {\n\treturn Config{}\n}", "title": "" }, { "docid": "270df6e3752bef051ab49f1762774a26", "score": "0.68140334", "text": "func newConfig() *Config {\n\tconfig.SetupSources(\"calculator\")\n\n\treturn &Config{\n\t\tLogger: Logger{\n\t\t\tDebug: viper.GetBool(\"logger.debug\"),\n\t\t\tConsole: viper.GetBool(\"logger.console\"),\n\t\t},\n\t\tDatabase: Database{\n\t\t\tDSN: viper.GetString(\"database.dsn\"),\n\t\t\tConnMaxLifetime: viper.GetDuration(\"database.connmaxlifetime\"),\n\t\t\tMaxOpenConns: viper.GetInt(\"database.maxopenconns\"),\n\t\t\tMaxIdleConns: viper.GetInt(\"database.maxidleconns\"),\n\t\t},\n\t\tHTTP: HTTP{\n\t\t\tAddress: viper.GetString(\"http.address\"),\n\t\t\tMetricsAddress: viper.GetString(\"http.metricsaddress\"),\n\t\t\tReadTimeout: viper.GetDuration(\"http.readtimeout\"),\n\t\t\tReadHeaderTimeout: viper.GetDuration(\"http.readheadertimeout\"),\n\t\t\tWriteTimeout: viper.GetDuration(\"http.writetimeout\"),\n\t\t\tIdleTimeout: viper.GetDuration(\"http.idletimeout\"),\n\t\t\tMaxHeaderBytes: viper.GetInt(\"http.maxheaderbytes\"),\n\t\t},\n\t\tGRPC: GRPC{\n\t\t\tAddress: viper.GetString(\"grpc.address\"),\n\t\t},\n\t\tCalculator: Calculator{\n\t\t\tRateLimiter: RateLimiter{\n\t\t\t\tInterval: viper.GetDuration(\"calculator.ratelimiter.interval\"),\n\t\t\t\tB: viper.GetInt(\"calculator.ratelimiter.b\"),\n\t\t\t},\n\t\t\tCircuitBreaker: CircuitBreaker{\n\t\t\t\tMaxRequests: viper.GetInt(\n\t\t\t\t\t\"calculator.circuitbreaker.maxrequests\"),\n\t\t\t\tInterval: viper.GetDuration(\n\t\t\t\t\t\"calculator.circuitbreaker.interval\"),\n\t\t\t\tTimeout: viper.GetDuration(\n\t\t\t\t\t\"calculator.circuitbreaker.timeout\"),\n\t\t\t},\n\t\t},\n\t\tStorekeeper: Storekeeper{\n\t\t\tTimeInterval: viper.GetDuration(\"storekeeper.timeinterval\"),\n\t\t},\n\t\tPiClient: PiClient{\n\t\t\tTimeout: viper.GetDuration(\"piclient.timeout\"),\n\t\t\tAddress: viper.GetString(\"piclient.address\"),\n\t\t},\n\t}\n}", "title": "" }, { "docid": "a41a0058fb3bd74e57c1e60f0a63f1de", "score": "0.678007", "text": "func newConfig(cfg *config.AgentConfig) (*Config, error) {\n\tintakeURL, err := intakeURL(cfg)\n\tif err != nil {\n\t\treturn nil, errors.Wrap(err, \"config\")\n\t}\n\tmaxPayloadSize := cfg.AppSec.MaxPayloadSize\n\tif maxPayloadSize <= 0 {\n\t\tmaxPayloadSize = defaultPayloadSize\n\t}\n\treturn &Config{\n\t\tEnabled: cfg.AppSec.Enabled,\n\t\tIntakeURL: intakeURL,\n\t\tAPIKey: cfg.AppSec.APIKey,\n\t\tMaxPayloadSize: maxPayloadSize,\n\t}, nil\n}", "title": "" }, { "docid": "cd063f1165f176f0ae5b7dcd1d786747", "score": "0.67768013", "text": "func New() *structs.Configurator {\n\treturn &structs.Configurator{}\n}", "title": "" }, { "docid": "f107b6cd0ed73acf854e66cc24e25724", "score": "0.67595154", "text": "func NewConfig() *Config {\n\treturn &Config{\n\t\tversion: hasm,\n\t}\n}", "title": "" }, { "docid": "2e2ddbf7378bcad2f10063edc69c3cd1", "score": "0.67402524", "text": "func NewConfig() *Config {\n temp := environmentConfig()\n config := &temp\n\n if !config.complete() {\n config.merge(fileConfig())\n }\n defer func() {\n config.merge(defaultConfig())\n config.trimWhitespace()\n }()\n return config\n}", "title": "" }, { "docid": "330dcbdc9dba6ee911e13665b7d9b25f", "score": "0.6739247", "text": "func New(filePath string) (c Config, err error) {\n\n\tfile, _ := os.Open(filePath)\n\tdecoder := json.NewDecoder(file)\n\n\terr = decoder.Decode(&c)\n\n\treturn c, err\n}", "title": "" }, { "docid": "8d4b25e45b94e77a9961bd528bf8dfea", "score": "0.6717651", "text": "func newConfig() *config {\n\n\tviper.SetDefault(\"httpport\", int(9002))\n\tviper.SetDefault(\"mysqldb\", map[string]string{\n\t\t\"protocol\": \"tcp\",\n\t\t\"host\": \"127.0.0.1\",\n\t\t\"port\": \"3306\",\n\t\t\"user\": \"internal\",\n\t\t\"password\": \"dev\",\n\t\t\"dbname\": \"dev\",\n\t})\n\n\treturn &config{\n\t\tMySQLDBConf: &storage.MySQLDBConf{\n\t\t\tProtocol: viper.GetStringMapString(\"mysqldb\")[\"protocol\"],\n\t\t\tHost: viper.GetStringMapString(\"mysqldb\")[\"host\"],\n\t\t\tPort: viper.GetStringMapString(\"mysqldb\")[\"port\"],\n\t\t\tUser: viper.GetStringMapString(\"mysqldb\")[\"user\"],\n\t\t\tPassword: viper.GetStringMapString(\"mysqldb\")[\"password\"],\n\t\t\tDbName: viper.GetStringMapString(\"mysqldb\")[\"dbname\"],\n\t\t},\n\t\tHTTPPort: viper.GetInt(\"httpport\"),\n\t}\n}", "title": "" }, { "docid": "463b6f5b93a421f862708f901ffec2ed", "score": "0.670432", "text": "func New(path string) (*Config, error) {\n\tconfigBytes, err := ioutil.ReadFile(path)\n\tif err != nil {\n\t\treturn nil, newErrorReadFile(err)\n\t}\n\n\tconfig := &Config{}\n\tif err := json.Unmarshal(configBytes, config); err != nil {\n\t\treturn nil, newErrorUnmarshalConfig(err)\n\t}\n\n\treturn config, nil\n}", "title": "" }, { "docid": "966ef881a243e68307ff8e5e3a5d154d", "score": "0.669945", "text": "func New(filePath string) *Config {\n\treturn &Config{\n\t\tpath: filePath,\n\t\tCtold: CtoldConfig{\n\t\t\tpath: \"\",\n\t\t\tRepo: CtoldRepoDefault,\n\t\t\tTag: CtoldTagDefault,\n\t\t\tLocal: CtoldLocalDefault,\n\t\t\tLast: CtoldLastDefault,\n\t\t},\n\t\tMerge: MergeMap{\n\t\t\tCtoldPathToken: MergeConfig{\n\t\t\t\tInto: \"\",\n\t\t\t\tRoster: true,\n\t\t\t},\n\t\t},\n\t\tCompress: CompressMap{\n\t\t\tCtoldPathToken: CompressConfig{\n\t\t\t\tPath: fmt.Sprintf(\"ctold-%s-r%s-%s.zip\",\n\t\t\t\t\tCtoldTagToken, CtoldLastToken, DateTimeToken),\n\t\t\t\tOverwrite: true,\n\t\t\t\tMethod: \"zip\",\n\t\t\t\tLevel: 9,\n\t\t\t},\n\t\t},\n\t}\n}", "title": "" }, { "docid": "1d4d24e3099f531e6c87affb970c6bc0", "score": "0.66655016", "text": "func newConfig() *Config {\n\treturn &Config{\n\t\tSettings: ircutil.Settings{\n\t\t\tCaseSensitive: true,\n\t\t\tSymbol: \"!\",\n\t\t\tScope: []string{\"channel\"},\n\t\t},\n\t}\n}", "title": "" }, { "docid": "42ca2244ad82f27c793893e278f2d8d2", "score": "0.6655732", "text": "func New(cfg Config) Module { return Module{Factory: cfg} }", "title": "" }, { "docid": "34b7257815624bb48803e24f5ca956ce", "score": "0.6644752", "text": "func newConfig() config {\n\tcfg := config{\n\t\tCtx: context.Background(),\n\t\tProvider: common.DefaultConfigProvider(),\n\t\tDatabaseId: common.String(os.Getenv(\"OCI_DBS_OCID\")),\n\t\tVaultId: common.String(os.Getenv(\"OCI_VAULT_OCID\")),\n\t\tUsername: common.String(os.Getenv(\"OCI_DB_USER\")),\n\t\tConnectionString: common.String(os.Getenv(\"OCI_CONN_STRING\")),\n\t\tPassword: common.String(\n\t\t\tbase64.StdEncoding.EncodeToString(\n\t\t\t\t[]byte(os.Getenv(\"OCI_DB_PASS\")))),\n\t}\n\tcfg.DBToolsClient = cfg.getDatabaseToolsClient()\n\tcfg.VaultsClient = cfg.getVaultsClient()\n\tcfg.KmsVaultsClient = cfg.getKmsVaultsClient()\n\tcfg.DatabaseClient = cfg.getDatabaseClient()\n\tcfg.DbSystemClient = cfg.getMySqlDbSystemClient()\n\n\t// Things that need to be initialized AFTER the SDK clients\n\tcfg.VaultCompartmentId = cfg.getVaultCompartmentId()\n\tcfg.VaultKeyId = cfg.getVaultKeyId()\n\tcfg.WalletBase64 = cfg.getADBsWalletAsBase64String()\n\tcfg.TargetCompartmentId = cfg.getTargetCompartmentId()\n\tcfg.EndpointServiceId = cfg.getEndpointServiceId() // depends on TargetCompartmentId\n\tcfg.SubnetId = cfg.getDatabaseSubnetId()\n\n\tcfg.ConnectionString = cfg.getConnectionString() // respects OCI_CONN_STRING if defined\n\n\treturn cfg\n}", "title": "" }, { "docid": "03fc749fd2608863153009d4cbfca82a", "score": "0.6632756", "text": "func New() *Configuration {\n\treturn &Configuration{\n\t\toverride: make(map[string]interface{}),\n\t\tkeyDelim: defaultKeyDelim,\n\t\tkeyMap: &sync.Map{},\n\t\tonChanges: make([]func(*Configuration), 0),\n\t\twatchers: make(map[string][]func(*Configuration)),\n\t}\n}", "title": "" }, { "docid": "534253f0a113c41057efdd7899183712", "score": "0.6626722", "text": "func New(filename string) (*Cfg, error) {\n\tfullPath, err := filepath.Abs(strings.Trim(filename, \" \"))\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\t_, err = os.Stat(fullPath)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\tjsonData, err := ioutil.ReadFile(fullPath)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\tc := &Cfg{}\n\terr = json.Unmarshal(jsonData, c)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\terr = c.isValid()\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\treturn c, err\n}", "title": "" }, { "docid": "9172a0a14711c99f15de01b85d3c5773", "score": "0.66230106", "text": "func (storage *Storage) New() interface{} {\n\treturn &api.BuildConfig{}\n}", "title": "" }, { "docid": "ce1bab4b62531c595412dc0bc0a8d76a", "score": "0.66141516", "text": "func New(key, host, dir string) (*Config, error) {\n\tc := &Config{\n\t\tAPIKey: key,\n\t\tAPI: host,\n\t\tDir: dir,\n\t}\n\treturn c.configure()\n}", "title": "" }, { "docid": "de38369a4602648186db2420e76e6e30", "score": "0.6593564", "text": "func (g *Config) New() error {\n\n\tf, errr := ioutil.ReadFile(viper.ConfigFileUsed())\n\tif errr != nil {\n\t\treturn errr\n\t}\n\n\tformat := strings.TrimPrefix(filepath.Ext(viper.ConfigFileUsed()), \".\")\n\tif dbgVaultConf {\n\t\tlog.Printf(\"format of config file: %s\", format)\n\t}\n\n\tswitch format {\n\tcase \"json\":\n\t\tdecj := json.NewDecoder(bytes.NewReader(f))\n\t\tif err := decj.Decode(&g); err != nil {\n\t\t\terrm := fmt.Sprintf(\"error decoding config file: %v\", err)\n\t\t\treturn errors.New(errm)\n\t\t}\n\tcase \"yml\":\n\t\tfallthrough\n\tcase \"yaml\":\n\t\tif err := yaml.Unmarshal(f, g); err != nil {\n\t\t\terrm := fmt.Sprintf(\"unable to unmarshal yaml config file: %v\", err)\n\t\t\treturn errors.New(errm)\n\t\t}\n\tdefault:\n\t\terrm := fmt.Sprintf(\"unsupported config file format: %s\", format)\n\t\treturn errors.New(errm)\n\t}\n\n\tif dbgVaultConf {\n\t\tlog.Println(\"entire config decoded\")\n\t\tspew.Dump(g)\n\t}\n\n\treturn nil\n\n}", "title": "" }, { "docid": "91eb8677ad1ef30933cf1b283ad7d930", "score": "0.65859616", "text": "func NewConfig(fullpath, kind string) (Config, error) {\n\tfullpath = libstring.ExpandTildeAndEnv(fullpath)\n\n\tvar config Config\n\t_, err := toml.DecodeFile(fullpath, &config)\n\n\tif config.Interval == \"\" {\n\t\tconfig.Interval = \"1m\"\n\t}\n\n\tconfig.Kind = kind\n\n\treturn config, err\n}", "title": "" }, { "docid": "296a706cb68c5fc1760ceb18ddb2ad0e", "score": "0.65772176", "text": "func newConfig() Config {\n\treturn Config{\n\t\tCollector: CollectorConfig{\n\t\t\tHTTPProfiler: false,\n\t\t\tFramework: &framework.Collector{\n\t\t\t\tListenEndpointFlag: \"127.0.0.1:8124\",\n\t\t\t\tRecordInputLogFlag: false,\n\t\t\t\tInputLimitAmountKBytesFlag: 20480,\n\t\t\t\tInputLimitPeriodFlag: 60,\n\t\t\t},\n\t\t\tMesosAgent: &mesosAgent.Collector{\n\t\t\t\tPollPeriod: time.Duration(60 * time.Second),\n\t\t\t\tPort: 5051,\n\t\t\t\tRequestProtocol: \"http\",\n\t\t\t\tRequestTimeout: time.Duration(5 * time.Second),\n\t\t\t},\n\t\t\tNode: &node.Collector{\n\t\t\t\tPollPeriod: time.Duration(60 * time.Second),\n\t\t\t},\n\t\t},\n\t\tProducers: ProducersConfig{\n\t\t\tHTTPProducerConfig: httpProducer.Config{\n\t\t\t\tCacheExpiry: time.Duration(120 * time.Second),\n\t\t\t\tPort: 9000,\n\t\t\t},\n\t\t\tPrometheusProducerConfig: promProducer.Config{\n\t\t\t\tCacheExpiry: time.Duration(60 * time.Second),\n\t\t\t\tPort: 9273,\n\t\t\t},\n\t\t},\n\t\tLogLevel: \"info\",\n\t}\n}", "title": "" }, { "docid": "36c4023c42651c9f0364ce86616b0285", "score": "0.65591896", "text": "func New() *Cfg {\n\tlog := logger.New()\n\n\treturn &Cfg{log}\n}", "title": "" }, { "docid": "9565f6e5c55609ed2d2e13aa420d3196", "score": "0.65518993", "text": "func New(proj string, cfg string, c *http.Client) (Config, error) {\n\tsvc, err := getService(c)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\t// TODO: Consider checking for the configuration errors before returning.\n\treturn &impl{svc, proj, cfg}, nil\n}", "title": "" }, { "docid": "cd5456f504df34734d6b952bfee1958b", "score": "0.65507317", "text": "func New() *Config {\n\treturn &Config{\n\t\tDatabase: DatabaseConfig{\n\t\t\tHost: getEnv(\"DB_HOST\", \"\"),\n\t\t\tPort: getEnv(\"DB_PORT\", \"\"),\n\t\t\tName: getEnv(\"DB_NAME\", \"\"),\n\t\t\tPassword: getEnv(\"DB_PASSWORD\", \"\"),\n\t\t\tURL: getEnv(\"DB_URL\", \"\"),\n\t\t\tUser: getEnv(\"DB_USER\", \"\"),\n\t\t},\n\t}\n}", "title": "" }, { "docid": "c6d6b57b4b956c8af6432abdfaa7275c", "score": "0.65287197", "text": "func New(opts CliOptions) *Config {\n\turl := fmt.Sprintf(\"http://%v:%v/\", opts.AnkiAddress, opts.AnkiPort)\n\n\treturn &Config{\n\t\tCliOptions: opts,\n\t\tCurrentVersion: version,\n\t\tExtensions: utils.MakeSet(extensions),\n\t\tURL: url,\n\t}\n}", "title": "" }, { "docid": "1b06fe730ed6bdd926f5494c9de00eaf", "score": "0.65189326", "text": "func New(v *viper.Viper) (*Config, error) {\n\tvar cfg Config\n\terr := viper.Unmarshal(&cfg)\n\tif err != nil {\n\t\treturn nil, fmt.Errorf(\"could not unmarshall the config file to the Config struct: %s\", err)\n\t}\n\n\treturn &cfg, nil\n}", "title": "" }, { "docid": "c31948db3c2fe67d8c8faf57a9a6e23c", "score": "0.65108085", "text": "func NewConfig() config {\n\tif value == nil {\n\t\tvalue = make(config)\n\t}\n\treturn value\n}", "title": "" }, { "docid": "006e13576d8dda45086873ac961f0c05", "score": "0.6504731", "text": "func New(handler cfg.Handler) Configer {\n\treturn &config{handler: handler}\n}", "title": "" }, { "docid": "a7515c16f6e3057f4b291c37ff21c4c2", "score": "0.64886206", "text": "func NewConfig(name string) Config {\n\treturn Config{\n\t\tName: name,\n\t}\n}", "title": "" }, { "docid": "66cefe7c5130b4b4724a1e50f44fcf6c", "score": "0.6467379", "text": "func New(path, name string) (*Config, error) {\n\tviper.SetConfigName(name)\n\tviper.AddConfigPath(path)\n\tviper.SetConfigType(\"toml\")\n\terr := viper.ReadInConfig()\n\tif err != nil {\n\t\treturn nil, fmt.Errorf(\"failed to read config: %w\", err)\n\t}\n\n\tvar c Config\n\terr = viper.Unmarshal(&c)\n\tif err != nil {\n\t\treturn &c, fmt.Errorf(\"failed to unmarshal config: %w\", err)\n\t}\n\n\treturn &c, nil\n}", "title": "" }, { "docid": "8dd3bbfeca0a260aad50dcf41a2cd828", "score": "0.64658093", "text": "func New(path string) (*Config, error) {\n\tf, err := os.OpenFile(path, os.O_CREATE|os.O_RDONLY, 0600)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\tcfg := new(Config)\n\terr = yaml.NewDecoder(f).Decode(&cfg)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\treturn cfg, nil\n}", "title": "" }, { "docid": "bd76eda71180279822ee30f065eec1d6", "score": "0.6452199", "text": "func New(cfg Config) *Config {\n\tcfg.MasterBackOffTime = defaultBackOff\n\n\tcfg.Etcd = etcd.New(cfg.KubeadmCfg.EtcdClientConfig)\n\tcfg.Kubeadm = cfg.KubeadmCfg\n\n\t// Wire up the concrete implementation with the same data\n\tkmm := &Kmm{}\n\tkmm.ConfigType = cfg.ConfigType\n\tcfg.Kmm = kmm\n\n\treturn &cfg\n}", "title": "" }, { "docid": "3563b0f7e1db3f35c9df4ab749a8e931", "score": "0.64520806", "text": "func New(path string) (*Config, error) {\n\tcontents, err := ioutil.ReadFile(path)\n\tif err != nil {\n\t\tlog.Printf(\"Unable to create config file: %v\", err)\n\t\treturn nil, err\n\t}\n\n\tconf := &Config{}\n\tif err := yaml.Unmarshal(contents, conf); err != nil {\n\t\tlog.Printf(\"Unable to create config file: %v\", err)\n\t\treturn nil, err\n\t}\n\n\treturn conf, nil\n}", "title": "" }, { "docid": "139efc601b57bdb64f77c326e18ca778", "score": "0.6449689", "text": "func New(url string) (*Config, error) {\n\tconfig := &Config{}\n\tvar backend ConfigBackend\n\n\tif url == \"\" {\n\t\treturn nil, fmt.Errorf(\"Empty URL provided but not supported\")\n\t}\n\n\terr := config.SetURL(url)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\tswitch config.url.Scheme {\n\tcase \"\", \"file\":\n\t\tbackend = NewFileBackend()\n\tdefault:\n\t\treturn nil, fmt.Errorf(\"Configuration backend '%s' not supported\", config.url.Scheme)\n\t}\n\n\tconfig.backend = backend\n\n\treturn config, nil\n}", "title": "" }, { "docid": "9434eb08f9f8a70b7126b5c936b0d324", "score": "0.6441883", "text": "func New(opts ...option) Fate {\n\tc := cloneConfig(globalConf)\n\tfor _, opt := range opts {\n\t\topt(c)\n\t}\n\treturn &fate{conf: c}\n}", "title": "" }, { "docid": "9620d09247b78bf27009ff4269f711bb", "score": "0.6436847", "text": "func GetNewConfig() Config {\n\tc := Config{}\n\tc.GitURL = \"https://api.github.com\"\n\tc.BaseOrganisation = \"informationgrid\"\n\tc.MiscDefaultBranch = \"develop\"\n\tc.MaxRepos = 100\n\tc.MaxBranches = 100\n\tc.SinceTime = time.Now().AddDate(0, -6, 0)\n\treturn c\n}", "title": "" }, { "docid": "39436e0c7e2a30726d0b397b5a885b67", "score": "0.64366955", "text": "func New() *XConfig {\n\tc := &XConfig{\n\t\tParameters: make(map[string]Parameter),\n\t\tComments: make(map[string]string),\n\t\tMultiple: false,\n\t}\n\treturn c\n}", "title": "" }, { "docid": "0ed86042b6fe9ae5c37120cce4d103a4", "score": "0.6428902", "text": "func New() *Config {\n return &Config{\n\tGitHub: GitHubConfig{\n\t Username: getEnv(\"GITHUB_USERNAME\", \"\"),\n\t APIKey: getEnv(\"GITHUB_API_KEY\", \"\"),\n\t},\n\tDebugMode: getEnvAsBool(\"DEBUG_MODE\", true),\n\tUserRoles: getEnvAsSlice(\"USER_ROLES\", []string{\"admin\"}, \",\"),\n\tMaxUsers: getEnvAsInt(\"MAX_USERS\", 1),\n }\n}", "title": "" }, { "docid": "08bd321fde9a222e7f844c6cff4f2d80", "score": "0.6428376", "text": "func newDefaultConfig() config {\n\treturn config{\n\t\tmode: 0644,\n\t\tdirMode: 0755,\n\t\ttimeFormat: \"20060102150405\",\n\t\tmaxSize: 256 * size.MB,\n\t\tmaxAge: 0,\n\t\tmaxBackups: 0,\n\t}\n}", "title": "" }, { "docid": "3b2d7c70426a1c33e8e31c09bba973f0", "score": "0.6391495", "text": "func New(opts ...Option) *Configuration {\n\tcnf := &Configuration{\n\t\topts: defaultOptions,\n\t\tparser: NewParser(),\n\t}\n\tfor _, o := range opts {\n\t\to(&cnf.opts)\n\t}\n\n\tif cnf.opts.global {\n\t\tcnf.AsGlobal()\n\t}\n\n\treturn cnf\n}", "title": "" }, { "docid": "5b26f284aa54fb2022e4e31f147969b6", "score": "0.6383319", "text": "func NewConfig() {\r\n\tviper.SetConfigName(\"config\")\r\n\tviper.SetConfigType(\"yaml\")\r\n\tviper.AddConfigPath(\"./config\")\r\n\r\n\t// viper.AutomaticEnv()\r\n\r\n\tif err := viper.ReadInConfig(); err != nil {\r\n\t\tlog.Fatal(err)\r\n\t}\r\n\r\n\tif err := viper.Unmarshal(&C); err != nil {\r\n\t\tlog.Fatal(err)\r\n\t}\r\n\r\n\tC.Login.URL = replaceString(C.Login.URL)\r\n\tC.URL.Base = replaceString(C.URL.Base)\r\n\tC.URL.Describe = replaceString(C.URL.Describe)\r\n\tC.URL.Job = replaceString(C.URL.Job)\r\n\tC.URL.Close = replaceString(C.URL.Close)\r\n\tC.URL.Batch = replaceString(C.URL.Batch)\r\n\tC.URL.Result = replaceString(C.URL.Result)\r\n}", "title": "" }, { "docid": "6d971b6447b621789eff9cd3a50f0c93", "score": "0.637964", "text": "func New() (*Cfg, error) {\n\tcfg := &Cfg{}\n\terr := envconfig.Process(\"\", cfg)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\t// Read and decode the metrics configuration JSON\n\tdata, err := ioutil.ReadFile(cfg.MetricsConfigFile)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\terr = json.Unmarshal(data, cfg)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\treturn cfg, nil\n}", "title": "" }, { "docid": "d8f70208f4762449d87fffe26a59bf06", "score": "0.6374592", "text": "func (c *Cache) New(config string) error {\n\terr := json.Unmarshal([]byte(config), &c.conninfo)\n\tif err != nil {\n\t\treturn err\n\t}\n\n\tif c.p == nil {\n\t\tif err := c.connectInit(); err != nil {\n\t\t\treturn err\n\t\t}\n\t}\n\treturn nil\n}", "title": "" }, { "docid": "4c23b49bf17c0075d55d43e97f519f8f", "score": "0.6367029", "text": "func NewConfig() *Config {\n\tc := &Config{}\n\tc.localStore = localstore.NewLocalStore()\n\n\ta, err := c.localStore.Load(filename)\n\tif err != nil {\n\t\tc.App, _ = defaults()\n\t}\n\tif err = json.Unmarshal(a, &c.App); err != nil {\n\t\tfmt.Printf(\"error\")\n\t}\n\treturn c\n}", "title": "" }, { "docid": "5aadfc5f509fd948b0127e67e155076d", "score": "0.635483", "text": "func New() Config {\n\tport := os.Getenv(\"PORT\")\n\n\thost := os.Getenv(\"HOST\")\n\n\tpassword := os.Getenv(\"PASSWORD\")\n\n\treturn Config{\n\t\tPort: port,\n\t\tHost: host,\n\t\tPassword: password,\n\t}\n}", "title": "" }, { "docid": "98d29d1b373c4293e269db16bb37c08c", "score": "0.6336096", "text": "func New() Config {\n\tc := Config{}\n\tc.Efs2File = \"./Efs2file\"\n\tc.Port = \"22\"\n\tusr, homeDir, err := UserDetails(\"\")\n\tif err != nil {\n\t\treturn c\n\t}\n\tc.User = usr\n\tc.KeyFile = homeDir + \"/.ssh/id_rsa\"\n\treturn c\n}", "title": "" }, { "docid": "f03369cc048d11a362998b15ac93333a", "score": "0.632734", "text": "func New(opts ...Option) (Config, error) {\n\tvar o = Options{}\n\tfor _, opt := range opts {\n\t\topt(&o)\n\t}\n\n\t// need read from config file\n\tif len(o.FilePath) > 0 {\n\t\tlog.Info(\"config read from file:\", o.FilePath)\n\t\to.Sources = append(o.Sources, file.NewSource(file.WithPath(o.FilePath)))\n\t}\n\tdefaultSource, _ := json.Marshal(GetDefault())\n\to.Sources = append(o.Sources,\n\t\tcliSource.NewSource(o.App, cliSource.Context(o.App.Context())),\n\t\tmemory.NewSource(memory.WithJSON(defaultSource)),\n\t)\n\n\tc, err := config.NewConfig(config.Storage(true), config.Watch(false))\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\tif err := c.Load(o.Sources...); err != nil {\n\t\treturn nil, err\n\t}\n\n\treturn &stackConfig{config: c}, nil\n}", "title": "" }, { "docid": "2f4bd2fff69051144746b44e8fe9cf45", "score": "0.63222355", "text": "func New(options ...SetupOption) (Config, error) {\n\ts := newSetup(\"root\", nil)\n\tif err := s.apply(options...); err != nil {\n\t\treturn nil, err\n\t}\n\tif err := walkAndWrap(s); err != nil {\n\t\treturn nil, err\n\t}\n\treturn s.config, s.validate()\n}", "title": "" }, { "docid": "0bd3317f8aec3d90f28818c235a704cc", "score": "0.6319072", "text": "func New(m map[string]interface{}) (*Options, error) {\n\to := &Options{}\n\tif err := mapstructure.Decode(m, o); err != nil {\n\t\terr = errors.Wrap(err, \"error decoding conf\")\n\t\treturn nil, err\n\t}\n\n\tif o.UserLayout == \"\" {\n\t\to.UserLayout = \"{{.Id.OpaqueId}}\"\n\t}\n\t// ensure user layout has no starting or trailing /\n\to.UserLayout = strings.Trim(o.UserLayout, \"/\")\n\n\tif o.ShareFolder == \"\" {\n\t\to.ShareFolder = \"/Shares\"\n\t}\n\t// ensure share folder always starts with slash\n\to.ShareFolder = filepath.Join(\"/\", o.ShareFolder)\n\n\t// c.DataDirectory should never end in / unless it is the root\n\to.Root = filepath.Clean(o.Root)\n\n\treturn o, nil\n}", "title": "" }, { "docid": "b069ab56c512cdef2d0df6291c835bf7", "score": "0.6318424", "text": "func New(namespace, token, channel string) (*Config, error) {\n\tc := &Config{\n\t\tNamespace: namespace,\n\t\tToken: token,\n\t\tChannel: channel,\n\t}\n\treturn c, nil\n}", "title": "" }, { "docid": "6f3555b12542d66aac86c7ac4054201e", "score": "0.6314181", "text": "func New(\n\tcfgPtr any, // must be a pointer to a struct\n\tproviders ...Provider, // providers will be executed in order of their declaration\n) *Configurator {\n\treturn &Configurator{\n\t\tconfigPtr: cfgPtr,\n\t\tproviders: providers,\n\t\tregisteredTags: map[string]struct{}{},\n\t\tloggerFn: log.Printf,\n\t\tonErrorFn: func(err error) {\n\t\t\tif err != nil {\n\t\t\t\tlog.Fatal(err)\n\t\t\t}\n\t\t},\n\t\tloggingEnabled: false,\n\t}\n}", "title": "" }, { "docid": "d0b6d6fd2ccf9b0e3916fff240116132", "score": "0.629255", "text": "func New(filename string, value interface{}, setFromEnvvars func(interface{})) *Config {\n\tconf := &Config{\n\t\tValue: value,\n\t\tFilename: filename,\n\t\tSetFromEnvvars: setFromEnvvars,\n\t}\n\n\tif e := conf.Read(); e != nil {\n\t\tlog.Error(er.Error(e, \"Failed to read a config file\"))\n\t\treturn nil\n\t}\n\n\treturn conf\n}", "title": "" }, { "docid": "d0ff3947ae18eb2e18dd6d2d799260ba", "score": "0.62838656", "text": "func (c FakeConfig) New() (Runtime, error) {\n\tif c.Runtime == nil {\n\t\treturn nil, fmt.Errorf(\"no runtime defined\")\n\t}\n\n\treturn c.Runtime, nil\n}", "title": "" }, { "docid": "6e469bcd8266c0a60f9df34c8c6232a7", "score": "0.62730116", "text": "func NewConfig() *Config {\n\treturn &Config{\n\t\tPlays: make([]*Play, 0),\n\t}\n}", "title": "" } ]
803df1850ddfb09f9170e3b65930ced4
If the WalkHandlers.TConditions function is not nil (ie. was set by outside code), calls it with this TConditions instance as the single argument. Then calls the Walk() method on 3/3 embed(s) and 0/0 field(s) belonging to this TConditions instance.
[ { "docid": "867914a956445426392a30a5f72eb2ae", "score": "0.7184094", "text": "func (me *TConditions) Walk() (err error) {\n\tif fn := WalkHandlers.TConditions; me != nil {\n\t\tif fn != nil {\n\t\t\tif err = fn(me, true); xsdt.OnWalkError(&err, &WalkErrors, WalkContinueOnError, WalkOnError) {\n\t\t\t\treturn\n\t\t\t}\n\t\t}\n\t\tif err = me.TrafficElement.Walk(); xsdt.OnWalkError(&err, &WalkErrors, WalkContinueOnError, WalkOnError) {\n\t\t\treturn\n\t\t}\n\t\tif err = me.XsdGoPkgHasElem_DrivingConditionTypesequenceextensioncomplexContentConditionsschema_DrivingConditionType_TDrivingConditionTypeEnum_.Walk(); xsdt.OnWalkError(&err, &WalkErrors, WalkContinueOnError, WalkOnError) {\n\t\t\treturn\n\t\t}\n\t\tif err = me.XsdGoPkgHasElem_ConditionsExtensionsequenceextensioncomplexContentConditionsschema_ConditionsExtension_TExtensionType_.Walk(); xsdt.OnWalkError(&err, &WalkErrors, WalkContinueOnError, WalkOnError) {\n\t\t\treturn\n\t\t}\n\t\tif fn != nil {\n\t\t\tif err = fn(me, false); xsdt.OnWalkError(&err, &WalkErrors, WalkContinueOnError, WalkOnError) {\n\t\t\t\treturn\n\t\t\t}\n\t\t}\n\t}\n\treturn\n}", "title": "" } ]
[ { "docid": "afa77241bf24908209eaf416fcd610e3", "score": "0.6532895", "text": "func (me *TRoadConditions) Walk() (err error) {\n\tif fn := WalkHandlers.TRoadConditions; me != nil {\n\t\tif fn != nil {\n\t\t\tif err = fn(me, true); xsdt.OnWalkError(&err, &WalkErrors, WalkContinueOnError, WalkOnError) {\n\t\t\t\treturn\n\t\t\t}\n\t\t}\n\t\tif err = me.XsdGoPkgHasElem_RoadConditionsExtensionsequenceextensioncomplexContentRoadConditionsschema_RoadConditionsExtension_TExtensionType_.Walk(); xsdt.OnWalkError(&err, &WalkErrors, WalkContinueOnError, WalkOnError) {\n\t\t\treturn\n\t\t}\n\t\tif err = me.TConditions.Walk(); xsdt.OnWalkError(&err, &WalkErrors, WalkContinueOnError, WalkOnError) {\n\t\t\treturn\n\t\t}\n\t\tif fn != nil {\n\t\t\tif err = fn(me, false); xsdt.OnWalkError(&err, &WalkErrors, WalkContinueOnError, WalkOnError) {\n\t\t\t\treturn\n\t\t\t}\n\t\t}\n\t}\n\treturn\n}", "title": "" }, { "docid": "204693b7233afab608a14d874aa08a4a", "score": "0.5940814", "text": "func (me *TWeatherRelatedRoadConditions) Walk() (err error) {\n\tif fn := WalkHandlers.TWeatherRelatedRoadConditions; me != nil {\n\t\tif fn != nil {\n\t\t\tif err = fn(me, true); xsdt.OnWalkError(&err, &WalkErrors, WalkContinueOnError, WalkOnError) {\n\t\t\t\treturn\n\t\t\t}\n\t\t}\n\t\tif err = me.TRoadConditions.Walk(); xsdt.OnWalkError(&err, &WalkErrors, WalkContinueOnError, WalkOnError) {\n\t\t\treturn\n\t\t}\n\t\tif err = me.XsdGoPkgHasElems_WeatherRelatedRoadConditionTypesequenceextensioncomplexContentRoadSurfaceConditionInformationschema_WeatherRelatedRoadConditionType_TWeatherRelatedRoadConditionTypeEnum_.Walk(); xsdt.OnWalkError(&err, &WalkErrors, WalkContinueOnError, WalkOnError) {\n\t\t\treturn\n\t\t}\n\t\tif err = me.XsdGoPkgHasElem_RoadSurfaceConditionMeasurementssequenceextensioncomplexContentRoadSurfaceConditionInformationschema_RoadSurfaceConditionMeasurements_TRoadSurfaceConditionMeasurements_.Walk(); xsdt.OnWalkError(&err, &WalkErrors, WalkContinueOnError, WalkOnError) {\n\t\t\treturn\n\t\t}\n\t\tif err = me.XsdGoPkgHasElem_WeatherRelatedRoadConditionsExtensionsequenceextensioncomplexContentWeatherRelatedRoadConditionsschema_WeatherRelatedRoadConditionsExtension_TExtensionType_.Walk(); xsdt.OnWalkError(&err, &WalkErrors, WalkContinueOnError, WalkOnError) {\n\t\t\treturn\n\t\t}\n\t\tif fn != nil {\n\t\t\tif err = fn(me, false); xsdt.OnWalkError(&err, &WalkErrors, WalkContinueOnError, WalkOnError) {\n\t\t\t\treturn\n\t\t\t}\n\t\t}\n\t}\n\treturn\n}", "title": "" }, { "docid": "8e327c02c5755ec917b6e850bdc05ec6", "score": "0.5705703", "text": "func (me *TRoadSurfaceConditionInformation) Walk() (err error) {\n\tif fn := WalkHandlers.TRoadSurfaceConditionInformation; me != nil {\n\t\tif fn != nil {\n\t\t\tif err = fn(me, true); xsdt.OnWalkError(&err, &WalkErrors, WalkContinueOnError, WalkOnError) {\n\t\t\t\treturn\n\t\t\t}\n\t\t}\n\t\tif err = me.TWeatherData.Walk(); xsdt.OnWalkError(&err, &WalkErrors, WalkContinueOnError, WalkOnError) {\n\t\t\treturn\n\t\t}\n\t\tif err = me.XsdGoPkgHasElems_WeatherRelatedRoadConditionTypesequenceextensioncomplexContentRoadSurfaceConditionInformationschema_WeatherRelatedRoadConditionType_TWeatherRelatedRoadConditionTypeEnum_.Walk(); xsdt.OnWalkError(&err, &WalkErrors, WalkContinueOnError, WalkOnError) {\n\t\t\treturn\n\t\t}\n\t\tif err = me.XsdGoPkgHasElem_RoadSurfaceConditionMeasurementssequenceextensioncomplexContentRoadSurfaceConditionInformationschema_RoadSurfaceConditionMeasurements_TRoadSurfaceConditionMeasurements_.Walk(); xsdt.OnWalkError(&err, &WalkErrors, WalkContinueOnError, WalkOnError) {\n\t\t\treturn\n\t\t}\n\t\tif err = me.XsdGoPkgHasElem_RoadSurfaceConditionInformationExtensionsequenceextensioncomplexContentRoadSurfaceConditionInformationschema_RoadSurfaceConditionInformationExtension_TExtensionType_.Walk(); xsdt.OnWalkError(&err, &WalkErrors, WalkContinueOnError, WalkOnError) {\n\t\t\treturn\n\t\t}\n\t\tif fn != nil {\n\t\t\tif err = fn(me, false); xsdt.OnWalkError(&err, &WalkErrors, WalkContinueOnError, WalkOnError) {\n\t\t\t\treturn\n\t\t\t}\n\t\t}\n\t}\n\treturn\n}", "title": "" }, { "docid": "6e2eaaff9f24c9f4ed3cf160186a4bed", "score": "0.5645612", "text": "func (me *TPoorEnvironmentConditions) Walk() (err error) {\n\tif fn := WalkHandlers.TPoorEnvironmentConditions; me != nil {\n\t\tif fn != nil {\n\t\t\tif err = fn(me, true); xsdt.OnWalkError(&err, &WalkErrors, WalkContinueOnError, WalkOnError) {\n\t\t\t\treturn\n\t\t\t}\n\t\t}\n\t\tif err = me.TConditions.Walk(); xsdt.OnWalkError(&err, &WalkErrors, WalkContinueOnError, WalkOnError) {\n\t\t\treturn\n\t\t}\n\t\tif err = me.XsdGoPkgHasElems_PoorEnvironmentTypesequenceextensioncomplexContentPoorEnvironmentConditionsschema_PoorEnvironmentType_TPoorEnvironmentTypeEnum_.Walk(); xsdt.OnWalkError(&err, &WalkErrors, WalkContinueOnError, WalkOnError) {\n\t\t\treturn\n\t\t}\n\t\tif err = me.XsdGoPkgHasElem_HumiditysequenceextensioncomplexContentHumidityInformationschema_Humidity_THumidity_.Walk(); xsdt.OnWalkError(&err, &WalkErrors, WalkContinueOnError, WalkOnError) {\n\t\t\treturn\n\t\t}\n\t\tif err = me.XsdGoPkgHasElem_PoorEnvironmentConditionsExtensionsequenceextensioncomplexContentPoorEnvironmentConditionsschema_PoorEnvironmentConditionsExtension_TExtensionType_.Walk(); xsdt.OnWalkError(&err, &WalkErrors, WalkContinueOnError, WalkOnError) {\n\t\t\treturn\n\t\t}\n\t\tif err = me.XsdGoPkgHasElem_PrecipitationDetailsequenceextensioncomplexContentPrecipitationInformationschema_PrecipitationDetail_TPrecipitationDetail_.Walk(); xsdt.OnWalkError(&err, &WalkErrors, WalkContinueOnError, WalkOnError) {\n\t\t\treturn\n\t\t}\n\t\tif err = me.XsdGoPkgHasElem_VisibilitysequenceextensioncomplexContentVisibilityInformationschema_Visibility_TVisibility_.Walk(); xsdt.OnWalkError(&err, &WalkErrors, WalkContinueOnError, WalkOnError) {\n\t\t\treturn\n\t\t}\n\t\tif err = me.XsdGoPkgHasElem_PollutionsequenceextensioncomplexContentPoorEnvironmentConditionsschema_Pollution_TPollution_.Walk(); xsdt.OnWalkError(&err, &WalkErrors, WalkContinueOnError, WalkOnError) {\n\t\t\treturn\n\t\t}\n\t\tif err = me.XsdGoPkgHasElem_TemperaturesequenceextensioncomplexContentTemperatureInformationschema_Temperature_Temperature_.Walk(); xsdt.OnWalkError(&err, &WalkErrors, WalkContinueOnError, WalkOnError) {\n\t\t\treturn\n\t\t}\n\t\tif err = me.XsdGoPkgHasElem_WindsequenceextensioncomplexContentWindInformationschema_Wind_TWind_.Walk(); xsdt.OnWalkError(&err, &WalkErrors, WalkContinueOnError, WalkOnError) {\n\t\t\treturn\n\t\t}\n\t\tif fn != nil {\n\t\t\tif err = fn(me, false); xsdt.OnWalkError(&err, &WalkErrors, WalkContinueOnError, WalkOnError) {\n\t\t\t\treturn\n\t\t\t}\n\t\t}\n\t}\n\treturn\n}", "title": "" }, { "docid": "a3d513b91c82f1ef9c8c68b8b99332c3", "score": "0.55455774", "text": "func (me *TRoadSurfaceConditionMeasurements) Walk() (err error) {\n\tif fn := WalkHandlers.TRoadSurfaceConditionMeasurements; me != nil {\n\t\tif fn != nil {\n\t\t\tif err = fn(me, true); xsdt.OnWalkError(&err, &WalkErrors, WalkContinueOnError, WalkOnError) {\n\t\t\t\treturn\n\t\t\t}\n\t\t}\n\t\tif err = me.XsdGoPkgHasElem_ProtectionTemperaturesequenceRoadSurfaceConditionMeasurementsschema_ProtectionTemperature_TemperatureValue_.Walk(); xsdt.OnWalkError(&err, &WalkErrors, WalkContinueOnError, WalkOnError) {\n\t\t\treturn\n\t\t}\n\t\tif err = me.XsdGoPkgHasElem_DeIcingApplicationRatesequenceRoadSurfaceConditionMeasurementsschema_DeIcingApplicationRate_TApplicationRateValue_.Walk(); xsdt.OnWalkError(&err, &WalkErrors, WalkContinueOnError, WalkOnError) {\n\t\t\treturn\n\t\t}\n\t\tif err = me.XsdGoPkgHasElem_DeIcingConcentrationsequenceRoadSurfaceConditionMeasurementsschema_DeIcingConcentration_TKilogramsConcentrationValue_.Walk(); xsdt.OnWalkError(&err, &WalkErrors, WalkContinueOnError, WalkOnError) {\n\t\t\treturn\n\t\t}\n\t\tif err = me.XsdGoPkgHasElem_DepthOfSnowsequenceRoadSurfaceConditionMeasurementsschema_DepthOfSnow_TFloatingPointMetreDistanceValue_.Walk(); xsdt.OnWalkError(&err, &WalkErrors, WalkContinueOnError, WalkOnError) {\n\t\t\treturn\n\t\t}\n\t\tif err = me.XsdGoPkgHasElem_WaterFilmThicknesssequenceRoadSurfaceConditionMeasurementsschema_WaterFilmThickness_TFloatingPointMetreDistanceValue_.Walk(); xsdt.OnWalkError(&err, &WalkErrors, WalkContinueOnError, WalkOnError) {\n\t\t\treturn\n\t\t}\n\t\tif err = me.XsdGoPkgHasElem_RoadSurfaceConditionMeasurementsExtensionsequenceRoadSurfaceConditionMeasurementsschema_RoadSurfaceConditionMeasurementsExtension_TExtensionType_.Walk(); xsdt.OnWalkError(&err, &WalkErrors, WalkContinueOnError, WalkOnError) {\n\t\t\treturn\n\t\t}\n\t\tif err = me.XsdGoPkgHasElem_RoadSurfaceTemperaturesequenceRoadSurfaceConditionMeasurementsschema_RoadSurfaceTemperature_TemperatureValue_.Walk(); xsdt.OnWalkError(&err, &WalkErrors, WalkContinueOnError, WalkOnError) {\n\t\t\treturn\n\t\t}\n\t\tif fn != nil {\n\t\t\tif err = fn(me, false); xsdt.OnWalkError(&err, &WalkErrors, WalkContinueOnError, WalkOnError) {\n\t\t\t\treturn\n\t\t\t}\n\t\t}\n\t}\n\treturn\n}", "title": "" }, { "docid": "213925901bd2eec17f1aa331a42a60dd", "score": "0.55355316", "text": "func (me *TNonWeatherRelatedRoadConditions) Walk() (err error) {\n\tif fn := WalkHandlers.TNonWeatherRelatedRoadConditions; me != nil {\n\t\tif fn != nil {\n\t\t\tif err = fn(me, true); xsdt.OnWalkError(&err, &WalkErrors, WalkContinueOnError, WalkOnError) {\n\t\t\t\treturn\n\t\t\t}\n\t\t}\n\t\tif err = me.TRoadConditions.Walk(); xsdt.OnWalkError(&err, &WalkErrors, WalkContinueOnError, WalkOnError) {\n\t\t\treturn\n\t\t}\n\t\tif err = me.XsdGoPkgHasElems_NonWeatherRelatedRoadConditionTypesequenceextensioncomplexContentNonWeatherRelatedRoadConditionsschema_NonWeatherRelatedRoadConditionType_TNonWeatherRelatedRoadConditionTypeEnum_.Walk(); xsdt.OnWalkError(&err, &WalkErrors, WalkContinueOnError, WalkOnError) {\n\t\t\treturn\n\t\t}\n\t\tif err = me.XsdGoPkgHasElem_NonWeatherRelatedRoadConditionsExtensionsequenceextensioncomplexContentNonWeatherRelatedRoadConditionsschema_NonWeatherRelatedRoadConditionsExtension_TExtensionType_.Walk(); xsdt.OnWalkError(&err, &WalkErrors, WalkContinueOnError, WalkOnError) {\n\t\t\treturn\n\t\t}\n\t\tif fn != nil {\n\t\t\tif err = fn(me, false); xsdt.OnWalkError(&err, &WalkErrors, WalkContinueOnError, WalkOnError) {\n\t\t\t\treturn\n\t\t\t}\n\t\t}\n\t}\n\treturn\n}", "title": "" }, { "docid": "b4d4a4f81630416920500704df58ab22", "score": "0.5305348", "text": "func (t *RouteTable) SetConditions(c ...runtimev1alpha1.Condition) {\n\tt.Status.SetConditions(c...)\n}", "title": "" }, { "docid": "787f8ceee3c7658215478654eb8844ab", "score": "0.5118068", "text": "func (tr *ServiceExpose) SetConditions(c ...runtimev1alpha1.Condition) {\n\ttr.Status.SetConditions(c...)\n}", "title": "" }, { "docid": "7613fec5f176c8c19fe62afa6d27c672", "score": "0.50948644", "text": "func (o DiagnosticsOutput) Conditions() ConditionsPtrOutput {\n\treturn o.ApplyT(func(v Diagnostics) *Conditions { return v.Conditions }).(ConditionsPtrOutput)\n}", "title": "" }, { "docid": "394f6278a2669d61003073bf3c40d844", "score": "0.5069302", "text": "func (me *TFilterReference) Walk() (err error) {\n\tif fn := WalkHandlers.TFilterReference; me != nil {\n\t\tif fn != nil {\n\t\t\tif err = fn(me, true); xsdt.OnWalkError(&err, &WalkErrors, WalkContinueOnError, WalkOnError) {\n\t\t\t\treturn\n\t\t\t}\n\t\t}\n\t\tif err = me.XsdGoPkgHasElem_FilterOperationApprovedsequenceFilterReferenceschema_FilterOperationApproved_TBoolean_.Walk(); xsdt.OnWalkError(&err, &WalkErrors, WalkContinueOnError, WalkOnError) {\n\t\t\treturn\n\t\t}\n\t\tif err = me.XsdGoPkgHasElem_KeyFilterReferencesequenceFilterReferenceschema_KeyFilterReference_TString_.Walk(); xsdt.OnWalkError(&err, &WalkErrors, WalkContinueOnError, WalkOnError) {\n\t\t\treturn\n\t\t}\n\t\tif err = me.XsdGoPkgHasElem_FilterReferenceExtensionsequenceFilterReferenceschema_FilterReferenceExtension_TExtensionType_.Walk(); xsdt.OnWalkError(&err, &WalkErrors, WalkContinueOnError, WalkOnError) {\n\t\t\treturn\n\t\t}\n\t\tif err = me.XsdGoPkgHasElem_DeleteFiltersequenceFilterReferenceschema_DeleteFilter_TBoolean_.Walk(); xsdt.OnWalkError(&err, &WalkErrors, WalkContinueOnError, WalkOnError) {\n\t\t\treturn\n\t\t}\n\t\tif fn != nil {\n\t\t\tif err = fn(me, false); xsdt.OnWalkError(&err, &WalkErrors, WalkContinueOnError, WalkOnError) {\n\t\t\t\treturn\n\t\t\t}\n\t\t}\n\t}\n\treturn\n}", "title": "" }, { "docid": "e084708735c5c7c6ebec505d9eee7b53", "score": "0.5063127", "text": "func (mg *SubnetRouteTableAssociation) SetConditions(c ...xpv1.Condition) {\n\tmg.Status.SetConditions(c...)\n}", "title": "" }, { "docid": "c7085ab61a0db532c53e7db5d3d0b58e", "score": "0.5051953", "text": "func (me *TWind) Walk() (err error) {\n\tif fn := WalkHandlers.TWind; me != nil {\n\t\tif fn != nil {\n\t\t\tif err = fn(me, true); xsdt.OnWalkError(&err, &WalkErrors, WalkContinueOnError, WalkOnError) {\n\t\t\t\treturn\n\t\t\t}\n\t\t}\n\t\tif err = me.XsdGoPkgHasElem_WindMeasurementHeightsequenceWindschema_WindMeasurementHeight_TMetresAsNonNegativeInteger_.Walk(); xsdt.OnWalkError(&err, &WalkErrors, WalkContinueOnError, WalkOnError) {\n\t\t\treturn\n\t\t}\n\t\tif err = me.XsdGoPkgHasElem_WindSpeedsequenceWindschema_WindSpeed_TSpeedValue_.Walk(); xsdt.OnWalkError(&err, &WalkErrors, WalkContinueOnError, WalkOnError) {\n\t\t\treturn\n\t\t}\n\t\tif err = me.XsdGoPkgHasElem_MaximumWindSpeedsequenceWindschema_MaximumWindSpeed_TSpeedValue_.Walk(); xsdt.OnWalkError(&err, &WalkErrors, WalkContinueOnError, WalkOnError) {\n\t\t\treturn\n\t\t}\n\t\tif err = me.XsdGoPkgHasElem_WindDirectionBearingsequenceWindschema_WindDirectionBearing_TDirectionBearingValue_.Walk(); xsdt.OnWalkError(&err, &WalkErrors, WalkContinueOnError, WalkOnError) {\n\t\t\treturn\n\t\t}\n\t\tif err = me.XsdGoPkgHasElem_WindDirectionCompasssequenceWindschema_WindDirectionCompass_TDirectionCompassValue_.Walk(); xsdt.OnWalkError(&err, &WalkErrors, WalkContinueOnError, WalkOnError) {\n\t\t\treturn\n\t\t}\n\t\tif err = me.XsdGoPkgHasElem_WindExtensionsequenceWindschema_WindExtension_TExtensionType_.Walk(); xsdt.OnWalkError(&err, &WalkErrors, WalkContinueOnError, WalkOnError) {\n\t\t\treturn\n\t\t}\n\t\tif fn != nil {\n\t\t\tif err = fn(me, false); xsdt.OnWalkError(&err, &WalkErrors, WalkContinueOnError, WalkOnError) {\n\t\t\t\treturn\n\t\t\t}\n\t\t}\n\t}\n\treturn\n}", "title": "" }, { "docid": "d506e6d263726a6b70e8d836ee8dc2c6", "score": "0.50444543", "text": "func (m *ConditionalAccessPolicyDetail) SetConditions(value ConditionalAccessConditionSetable)() {\n m.conditions = value\n}", "title": "" }, { "docid": "29024cd3140a1b3415bbcb64a0ed3174", "score": "0.5033653", "text": "func (r *Route) SetConditions(c ...runtimev1alpha1.Condition) {\n\tr.Status.SetConditions(c...)\n}", "title": "" }, { "docid": "fb4cff2635744793c9f4f465481d79ab", "score": "0.5025913", "text": "func (tr *RolloutTrait) SetConditions(c ...runtimev1alpha1.Condition) {\n\ttr.Status.SetConditions(c...)\n}", "title": "" }, { "docid": "3fa0337425404148e01db47b9348f39a", "score": "0.5021393", "text": "func (n *Ternary) Walk(v walker.Visitor) {\n\tif !v.EnterNode(n) {\n\t\treturn\n\t}\n\n\tif n.Condition != nil {\n\t\tn.Condition.Walk(v)\n\t}\n\n\tif n.IfTrue != nil {\n\t\tn.IfTrue.Walk(v)\n\t}\n\n\tif n.IfFalse != nil {\n\t\tn.IfFalse.Walk(v)\n\t}\n\n\tv.LeaveNode(n)\n}", "title": "" }, { "docid": "06aec032893cc9cdd8a085e21e6413a8", "score": "0.50116897", "text": "func (o DiagnosticsResponseOutput) Conditions() ConditionsResponsePtrOutput {\n\treturn o.ApplyT(func(v DiagnosticsResponse) *ConditionsResponse { return v.Conditions }).(ConditionsResponsePtrOutput)\n}", "title": "" }, { "docid": "dcf8d184dcb0d4bec54e8991ce81acff", "score": "0.4987869", "text": "func (mg *VirtualWAN) SetConditions(c ...xpv1.Condition) {\n\tmg.Status.SetConditions(c...)\n}", "title": "" }, { "docid": "52fbce1cb128d589010249393e2e3215", "score": "0.49843618", "text": "func (rb *DetectionRuleBuilder) Conditions(conditions []RuleConditionBuilder) *DetectionRuleBuilder {\n\ttmp := make([]RuleCondition, len(conditions))\n\tfor _, value := range conditions {\n\t\ttmp = append(tmp, value.Build())\n\t}\n\trb.v.Conditions = tmp\n\treturn rb\n}", "title": "" }, { "docid": "da530cb9ae1553bd1ab82d956c9bebe6", "score": "0.4966993", "text": "func Walk(t *tree.Tree, ch chan int) {\n\tch <- t.Value\n\tif t.Left != nil {\n\t\tWalk(t.Left, ch)\n\t}\n\tif t.Right != nil {\n\t\tWalk(t.Right, ch)\n\t}\n}", "title": "" }, { "docid": "1f61312b478787495d48918ea34b3512", "score": "0.4944422", "text": "func (mg *VirtualNetworkPeering) SetConditions(c ...xpv1.Condition) {\n\tmg.Status.SetConditions(c...)\n}", "title": "" }, { "docid": "17d7104578b8ae2a5c185de0031674cb", "score": "0.49062032", "text": "func Walk(t *tree.Tree, ch chan int){\n\tch <- t.Value\n\tif t.Left != nil{\n\t\tgo Walk(t.Left, ch)\n\t}\n\tif t.Right != nil{\n\t\tgo Walk(t.Right, ch)\n\t}\n}", "title": "" }, { "docid": "fc61513e7c2089a20d410b4e977ef89a", "score": "0.4904699", "text": "func GetConditions(un *unstructured.Unstructured) wfv1.Conditions {\n\tif un == nil {\n\t\treturn nil\n\t}\n\titems, _, _ := unstructured.NestedSlice(un.Object, \"status\", \"conditions\")\n\tvar x wfv1.Conditions\n\tfor _, item := range items {\n\t\tm, ok := item.(map[string]interface{})\n\t\tif !ok {\n\t\t\treturn nil\n\t\t}\n\t\tx = append(x, wfv1.Condition{\n\t\t\tType: wfv1.ConditionType(m[\"type\"].(string)),\n\t\t\tStatus: metav1.ConditionStatus(m[\"status\"].(string)),\n\t\t})\n\t}\n\treturn x\n}", "title": "" }, { "docid": "a9fd7ddd27a67f91c13ee168a1811aeb", "score": "0.48945573", "text": "func Walk(t *tree.Tree, ch chan int) {\n\tch <- t.Value\n\n\tif t.Left != nil {\n\t\tgo Walk(t.Left, ch)\n\t}\n\n\tif t.Right != nil {\n\t\tgo Walk(t.Right, ch)\n\t}\n}", "title": "" }, { "docid": "4ec25c81b2fb93e4d44321d05c37265a", "score": "0.4892603", "text": "func (n *If) Walk(v walker.Visitor) {\n\tif !v.EnterNode(n) {\n\t\treturn\n\t}\n\n\tif n.Cond != nil {\n\t\tn.Cond.Walk(v)\n\t}\n\n\tif n.Stmt != nil {\n\t\tn.Stmt.Walk(v)\n\t}\n\n\tif n.ElseIf != nil {\n\t\tfor _, nn := range n.ElseIf {\n\t\t\tif nn != nil {\n\t\t\t\tnn.Walk(v)\n\t\t\t}\n\t\t}\n\t}\n\n\tif n.Else != nil {\n\t\tn.Else.Walk(v)\n\t}\n\n\tv.LeaveNode(n)\n}", "title": "" }, { "docid": "3e307e5bcca33f8c4ed3cf5eaef7a6df", "score": "0.48768023", "text": "func (me *TDelays) Walk() (err error) {\n\tif fn := WalkHandlers.TDelays; me != nil {\n\t\tif fn != nil {\n\t\t\tif err = fn(me, true); xsdt.OnWalkError(&err, &WalkErrors, WalkContinueOnError, WalkOnError) {\n\t\t\t\treturn\n\t\t\t}\n\t\t}\n\t\tif err = me.XsdGoPkgHasElem_DelayBandsequenceDelaysschema_DelayBand_TDelayBandEnum_.Walk(); xsdt.OnWalkError(&err, &WalkErrors, WalkContinueOnError, WalkOnError) {\n\t\t\treturn\n\t\t}\n\t\tif err = me.XsdGoPkgHasElem_DelaysTypesequenceDelaysschema_DelaysType_TDelaysTypeEnum_.Walk(); xsdt.OnWalkError(&err, &WalkErrors, WalkContinueOnError, WalkOnError) {\n\t\t\treturn\n\t\t}\n\t\tif err = me.XsdGoPkgHasElem_DelayTimeValuesequenceDelaysschema_DelayTimeValue_TSeconds_.Walk(); xsdt.OnWalkError(&err, &WalkErrors, WalkContinueOnError, WalkOnError) {\n\t\t\treturn\n\t\t}\n\t\tif err = me.XsdGoPkgHasElem_DelaysExtensionsequenceDelaysschema_DelaysExtension_TExtensionType_.Walk(); xsdt.OnWalkError(&err, &WalkErrors, WalkContinueOnError, WalkOnError) {\n\t\t\treturn\n\t\t}\n\t\tif fn != nil {\n\t\t\tif err = fn(me, false); xsdt.OnWalkError(&err, &WalkErrors, WalkContinueOnError, WalkOnError) {\n\t\t\t\treturn\n\t\t\t}\n\t\t}\n\t}\n\treturn\n}", "title": "" }, { "docid": "70bbd41c696811f55f5e1b333d8a40d9", "score": "0.48468202", "text": "func Walk(t *BTree, order func(t *BTree, w []interface{}) []interface{}) []interface{} {\n\treturn order(t, nil)\n}", "title": "" }, { "docid": "54211ca6cdcaa5478e4756deaf9a62db", "score": "0.48379195", "text": "func (o DatadogMetricStatusPtrOutput) Conditions() DatadogMetricStatusConditionsArrayOutput {\n\treturn o.ApplyT(func(v *DatadogMetricStatus) []DatadogMetricStatusConditions {\n\t\tif v == nil {\n\t\t\treturn nil\n\t\t}\n\t\treturn v.Conditions\n\t}).(DatadogMetricStatusConditionsArrayOutput)\n}", "title": "" }, { "docid": "4833d0cce3e5ec38b11addae8244d2b2", "score": "0.48329392", "text": "func (in *Conditions) DeepCopy() *Conditions {\n\tif in == nil {\n\t\treturn nil\n\t}\n\tout := new(Conditions)\n\tin.DeepCopyInto(out)\n\treturn out\n}", "title": "" }, { "docid": "da79bd48cbe041fe96dc2874420135b5", "score": "0.48194417", "text": "func (c *AzureStackHCILoadBalancer) SetConditions(conditions clusterv1.Conditions) {\n\tc.Status.Conditions = conditions\n}", "title": "" }, { "docid": "1c78ee96f32b115bc37f7b30c9ec50a8", "score": "0.48179168", "text": "func Walk(t *tree.Tree, ch chan int) {\n\tif t == nil {\n\t\treturn\n\t}\n\n\tif t.Left != nil {\n\t\tWalk(t.Left, ch)\n\t}\n\n\tch <- t.Value\n\n\tif t.Right != nil {\n\t\tWalk(t.Right, ch)\n\t}\n}", "title": "" }, { "docid": "be7a352bdd52320bb2fd7a4a165c1055", "score": "0.4814307", "text": "func (m *PacketMachine) SetConditions(conditions clusterv1.Conditions) {\n\tm.Status.Conditions = conditions\n}", "title": "" }, { "docid": "fe7d790982cfef23422c9801c9f96282", "score": "0.4810121", "text": "func (server *Server) SetConditions(conditions conditions.Conditions) {\n\tserver.Status.Conditions = conditions\n}", "title": "" }, { "docid": "fe7d790982cfef23422c9801c9f96282", "score": "0.4810121", "text": "func (server *Server) SetConditions(conditions conditions.Conditions) {\n\tserver.Status.Conditions = conditions\n}", "title": "" }, { "docid": "dc32be931cdf533372d0d2b0c7b5b09d", "score": "0.4803047", "text": "func (rule *ServersOutboundFirewallRule) SetConditions(conditions conditions.Conditions) {\n\trule.Status.Conditions = conditions\n}", "title": "" }, { "docid": "c065259321497c655d4f8fedeaf72a0f", "score": "0.48023048", "text": "func (mg *GlobalCluster) SetConditions(c ...xpv1.Condition) {\n\tmg.Status.SetConditions(c...)\n}", "title": "" }, { "docid": "bc72b2eab4a197ebe99b47f660ee622c", "score": "0.47969326", "text": "func SetConditions(cr interface{ UnstructuredContent() map[string]interface{} }, c ...v1alpha1.Condition) error {\n\tconditioned := v1alpha1.ConditionedStatus{}\n\tfetched, exists, err := unstructured.NestedFieldCopy(cr.UnstructuredContent(), \"status\")\n\tif err != nil {\n\t\treturn err\n\t}\n\tif exists {\n\t\tstatusJSON, err := json.Marshal(fetched)\n\t\tif err != nil {\n\t\t\treturn err\n\t\t}\n\t\tif err := json.Unmarshal(statusJSON, &conditioned); err != nil {\n\t\t\treturn err\n\t\t}\n\t}\n\tconditioned.SetConditions(c...)\n\tresultJSON, err := json.Marshal(conditioned.Conditions)\n\tif err != nil {\n\t\treturn err\n\t}\n\tfinalForm := []interface{}{}\n\tif err := json.Unmarshal(resultJSON, &finalForm); err != nil {\n\t\treturn err\n\t}\n\treturn unstructured.SetNestedSlice(cr.UnstructuredContent(), finalForm, \"status\", \"conditions\")\n}", "title": "" }, { "docid": "eb571450914396d0bc90b508b4aae63c", "score": "0.47918049", "text": "func (trigger *SqlDatabaseContainerTrigger) SetConditions(conditions conditions.Conditions) {\n\ttrigger.Status.Conditions = conditions\n}", "title": "" }, { "docid": "a501fe1a2390eb3b2c2d32efe5f8fe69", "score": "0.47765493", "text": "func (i *CloudsqlInstance) SetConditions(c ...runtimev1alpha1.Condition) {\n\ti.Status.SetConditions(c...)\n}", "title": "" }, { "docid": "4a139b7b53646959dc1d17d3afc87523", "score": "0.47714418", "text": "func (mg *DBCluster) SetConditions(c ...xpv1.Condition) {\n\tmg.Status.SetConditions(c...)\n}", "title": "" }, { "docid": "218b02aee040150f24d0e7b9deb425a9", "score": "0.47632334", "text": "func (trs *TektonResultStatus) InitializeConditions() {\n\tresultsCondSet.Manage(trs).InitializeConditions()\n}", "title": "" }, { "docid": "90c7b4e0155fe74c194665bec2767eae", "score": "0.47610244", "text": "func (o ActionGroupOutput) Conditions() ConditionsPtrOutput {\n\treturn o.ApplyT(func(v ActionGroup) *Conditions { return v.Conditions }).(ConditionsPtrOutput)\n}", "title": "" }, { "docid": "7ca0a117e48e68523ef017e6af044628", "score": "0.47573933", "text": "func (o GetLocalRouterFilterPtrOutput) Conditions() GetLocalRouterFilterConditionArrayOutput {\n\treturn o.ApplyT(func(v *GetLocalRouterFilter) []GetLocalRouterFilterCondition {\n\t\tif v == nil {\n\t\t\treturn nil\n\t\t}\n\t\treturn v.Conditions\n\t}).(GetLocalRouterFilterConditionArrayOutput)\n}", "title": "" }, { "docid": "6ff1059426c8fbf6dd697ef25bb2fdd9", "score": "0.47570777", "text": "func Walk(t *tree.Tree, ch chan int) {\n\tif t.Left != nil {\n\t\tWalk(t.Left, ch)\n\t}\n\tch <- t.Value\n\tif t.Right != nil {\n\t\tWalk(t.Right, ch)\n\t}\n}", "title": "" }, { "docid": "203c44a6d6e92ae94826daca6d8112da", "score": "0.47526658", "text": "func (cm *MachineInstance) SetConditions(c ...runtimev1alpha1.Condition) {\n\tcm.Status.SetConditions(c...)\n}", "title": "" }, { "docid": "f552f632106b9fae17132897fd20ff6a", "score": "0.47500414", "text": "func (i *MySQLInstance) SetConditions(c ...runtimev1alpha1.Condition) {\n\ti.Status.SetConditions(c...)\n}", "title": "" }, { "docid": "2f9026a13b6ca6bcff9da7bfbc72aabe", "score": "0.47439384", "text": "func Walk(t *tree.Tree, ch chan int) {\n\tif t != nil {\n\t\tWalk(t.Left, ch)\n\t\tch <- t.Value\n\t\tWalk(t.Right, ch)\n\t}\n}", "title": "" }, { "docid": "abe3003a22a8dcd4371f7f414f4c7d37", "score": "0.4743248", "text": "func (me *TRoadworks) Walk() (err error) {\n\tif fn := WalkHandlers.TRoadworks; me != nil {\n\t\tif fn != nil {\n\t\t\tif err = fn(me, true); xsdt.OnWalkError(&err, &WalkErrors, WalkContinueOnError, WalkOnError) {\n\t\t\t\treturn\n\t\t\t}\n\t\t}\n\t\tif err = me.TOperatorAction.Walk(); xsdt.OnWalkError(&err, &WalkErrors, WalkContinueOnError, WalkOnError) {\n\t\t\treturn\n\t\t}\n\t\tif err = me.XsdGoPkgHasElem_UnderTrafficsequenceextensioncomplexContentRoadworksschema_UnderTraffic_TBoolean_.Walk(); xsdt.OnWalkError(&err, &WalkErrors, WalkContinueOnError, WalkOnError) {\n\t\t\treturn\n\t\t}\n\t\tif err = me.XsdGoPkgHasElem_UrgentRoadworkssequenceextensioncomplexContentRoadworksschema_UrgentRoadworks_TBoolean_.Walk(); xsdt.OnWalkError(&err, &WalkErrors, WalkContinueOnError, WalkOnError) {\n\t\t\treturn\n\t\t}\n\t\tif err = me.XsdGoPkgHasElem_MaintenanceVehiclessequenceextensioncomplexContentRoadworksschema_MaintenanceVehicles_TMaintenanceVehicles_.Walk(); xsdt.OnWalkError(&err, &WalkErrors, WalkContinueOnError, WalkOnError) {\n\t\t\treturn\n\t\t}\n\t\tif err = me.XsdGoPkgHasElem_RoadworksDurationsequenceextensioncomplexContentRoadworksschema_RoadworksDuration_TRoadworksDurationEnum_.Walk(); xsdt.OnWalkError(&err, &WalkErrors, WalkContinueOnError, WalkOnError) {\n\t\t\treturn\n\t\t}\n\t\tif err = me.XsdGoPkgHasElem_RoadworksScalesequenceextensioncomplexContentRoadworksschema_RoadworksScale_TRoadworksScaleEnum_.Walk(); xsdt.OnWalkError(&err, &WalkErrors, WalkContinueOnError, WalkOnError) {\n\t\t\treturn\n\t\t}\n\t\tif err = me.XsdGoPkgHasElem_MobilitysequenceextensioncomplexContentRoadworksschema_Mobility_TMobility_.Walk(); xsdt.OnWalkError(&err, &WalkErrors, WalkContinueOnError, WalkOnError) {\n\t\t\treturn\n\t\t}\n\t\tif err = me.XsdGoPkgHasElem_SubjectssequenceextensioncomplexContentRoadworksschema_Subjects_TSubjects_.Walk(); xsdt.OnWalkError(&err, &WalkErrors, WalkContinueOnError, WalkOnError) {\n\t\t\treturn\n\t\t}\n\t\tif err = me.XsdGoPkgHasElem_RoadworksExtensionsequenceextensioncomplexContentRoadworksschema_RoadworksExtension_TExtensionType_.Walk(); xsdt.OnWalkError(&err, &WalkErrors, WalkContinueOnError, WalkOnError) {\n\t\t\treturn\n\t\t}\n\t\tif fn != nil {\n\t\t\tif err = fn(me, false); xsdt.OnWalkError(&err, &WalkErrors, WalkContinueOnError, WalkOnError) {\n\t\t\t\treturn\n\t\t\t}\n\t\t}\n\t}\n\treturn\n}", "title": "" }, { "docid": "105679ca89fef440f691f59d1249cb3a", "score": "0.47406566", "text": "func (me *TObstruction) Walk() (err error) {\n\tif fn := WalkHandlers.TObstruction; me != nil {\n\t\tif fn != nil {\n\t\t\tif err = fn(me, true); xsdt.OnWalkError(&err, &WalkErrors, WalkContinueOnError, WalkOnError) {\n\t\t\t\treturn\n\t\t\t}\n\t\t}\n\t\tif err = me.XsdGoPkgHasElem_MobilityOfObstructionsequenceextensioncomplexContentObstructionschema_MobilityOfObstruction_TMobility_.Walk(); xsdt.OnWalkError(&err, &WalkErrors, WalkContinueOnError, WalkOnError) {\n\t\t\treturn\n\t\t}\n\t\tif err = me.XsdGoPkgHasElem_ObstructionExtensionsequenceextensioncomplexContentObstructionschema_ObstructionExtension_TExtensionType_.Walk(); xsdt.OnWalkError(&err, &WalkErrors, WalkContinueOnError, WalkOnError) {\n\t\t\treturn\n\t\t}\n\t\tif err = me.TrafficElement.Walk(); xsdt.OnWalkError(&err, &WalkErrors, WalkContinueOnError, WalkOnError) {\n\t\t\treturn\n\t\t}\n\t\tif err = me.XsdGoPkgHasElem_NumberOfObstructionssequenceextensioncomplexContentObstructionschema_NumberOfObstructions_TNonNegativeInteger_.Walk(); xsdt.OnWalkError(&err, &WalkErrors, WalkContinueOnError, WalkOnError) {\n\t\t\treturn\n\t\t}\n\t\tif fn != nil {\n\t\t\tif err = fn(me, false); xsdt.OnWalkError(&err, &WalkErrors, WalkContinueOnError, WalkOnError) {\n\t\t\t\treturn\n\t\t\t}\n\t\t}\n\t}\n\treturn\n}", "title": "" }, { "docid": "7f85710d77afeaae8a4295ba0d5be273", "score": "0.4739584", "text": "func (cm *KubernetesCluster) SetConditions(c ...runtimev1alpha1.Condition) {\n\tcm.Status.SetConditions(c...)\n}", "title": "" }, { "docid": "9b25e428af327953be512fe25121307f", "score": "0.47350764", "text": "func (me *TConstructionWorks) Walk() (err error) {\n\tif fn := WalkHandlers.TConstructionWorks; me != nil {\n\t\tif fn != nil {\n\t\t\tif err = fn(me, true); xsdt.OnWalkError(&err, &WalkErrors, WalkContinueOnError, WalkOnError) {\n\t\t\t\treturn\n\t\t\t}\n\t\t}\n\t\tif err = me.TRoadworks.Walk(); xsdt.OnWalkError(&err, &WalkErrors, WalkContinueOnError, WalkOnError) {\n\t\t\treturn\n\t\t}\n\t\tif err = me.XsdGoPkgHasElem_ConstructionWorkTypesequenceextensioncomplexContentConstructionWorksschema_ConstructionWorkType_TConstructionWorkTypeEnum_.Walk(); xsdt.OnWalkError(&err, &WalkErrors, WalkContinueOnError, WalkOnError) {\n\t\t\treturn\n\t\t}\n\t\tif err = me.XsdGoPkgHasElem_ConstructionWorksExtensionsequenceextensioncomplexContentConstructionWorksschema_ConstructionWorksExtension_TExtensionType_.Walk(); xsdt.OnWalkError(&err, &WalkErrors, WalkContinueOnError, WalkOnError) {\n\t\t\treturn\n\t\t}\n\t\tif fn != nil {\n\t\t\tif err = fn(me, false); xsdt.OnWalkError(&err, &WalkErrors, WalkContinueOnError, WalkOnError) {\n\t\t\t\treturn\n\t\t\t}\n\t\t}\n\t}\n\treturn\n}", "title": "" }, { "docid": "bcdcffd5ac4b7a5f484a7910a99f48d0", "score": "0.47320732", "text": "func Walk(t *tree.Tree, ch chan int) {\n\tqueue := make([]*tree.Tree, 0)\n\tcurrent := t\n\tqueue = append(queue, current)\n\tfor {\n\t\tif len(queue) < 1 { break }\n\t\tcurrent = queue[0]\n\t\tif len(queue) > 1 {\n\t\t\tqueue = queue[1:]\n\t\t} else {\n\t\t\tqueue = make([]*tree.Tree, 0)\n\t\t}\n\t\tif current.Left != nil {\n\t\t\tqueue = append(queue, current.Left)\n\t\t} \n\t\tif current.Right != nil {\n\t\t\tqueue = append(queue, current.Right)\n\t\t}\n\t\tch <- current.Value\n\t}\n\t//fmt.Println(\"Closing channel\")\n\tclose(ch)\n}", "title": "" }, { "docid": "854979ad32ce0b192a7d6f6d6bb1239f", "score": "0.4729267", "text": "func (mg *CachePolicy) SetConditions(c ...xpv1.Condition) {\n\tmg.Status.SetConditions(c...)\n}", "title": "" }, { "docid": "e84404b59575084683df4219cbb47d4e", "score": "0.47289124", "text": "func (mg *AccessPolicy) SetConditions(c ...xpv1.Condition) {\n\tmg.Status.SetConditions(c...)\n}", "title": "" }, { "docid": "851d971f22380e002c67caf0f51e679b", "score": "0.47170785", "text": "func (me *TMaintenanceVehicles) Walk() (err error) {\n\tif fn := WalkHandlers.TMaintenanceVehicles; me != nil {\n\t\tif fn != nil {\n\t\t\tif err = fn(me, true); xsdt.OnWalkError(&err, &WalkErrors, WalkContinueOnError, WalkOnError) {\n\t\t\t\treturn\n\t\t\t}\n\t\t}\n\t\tif err = me.XsdGoPkgHasElem_MaintenanceVehiclesExtensionsequenceMaintenanceVehiclesschema_MaintenanceVehiclesExtension_TExtensionType_.Walk(); xsdt.OnWalkError(&err, &WalkErrors, WalkContinueOnError, WalkOnError) {\n\t\t\treturn\n\t\t}\n\t\tif err = me.XsdGoPkgHasElem_NumberOfMaintenanceVehiclessequenceMaintenanceVehiclesschema_NumberOfMaintenanceVehicles_TNonNegativeInteger_.Walk(); xsdt.OnWalkError(&err, &WalkErrors, WalkContinueOnError, WalkOnError) {\n\t\t\treturn\n\t\t}\n\t\tif err = me.XsdGoPkgHasElems_MaintenanceVehicleActionssequenceMaintenanceVehiclesschema_MaintenanceVehicleActions_TMaintenanceVehicleActionsEnum_.Walk(); xsdt.OnWalkError(&err, &WalkErrors, WalkContinueOnError, WalkOnError) {\n\t\t\treturn\n\t\t}\n\t\tif fn != nil {\n\t\t\tif err = fn(me, false); xsdt.OnWalkError(&err, &WalkErrors, WalkContinueOnError, WalkOnError) {\n\t\t\t\treturn\n\t\t\t}\n\t\t}\n\t}\n\treturn\n}", "title": "" }, { "docid": "39eff110337fc08fe41c3a694a14f27d", "score": "0.47119862", "text": "func (o ActionGroupResponseOutput) Conditions() ConditionsResponsePtrOutput {\n\treturn o.ApplyT(func(v ActionGroupResponse) *ConditionsResponse { return v.Conditions }).(ConditionsResponsePtrOutput)\n}", "title": "" }, { "docid": "11052682c3dafd5edc5e28c2ed888d99", "score": "0.4706594", "text": "func (me *TRoadsideAssistance) Walk() (err error) {\n\tif fn := WalkHandlers.TRoadsideAssistance; me != nil {\n\t\tif fn != nil {\n\t\t\tif err = fn(me, true); xsdt.OnWalkError(&err, &WalkErrors, WalkContinueOnError, WalkOnError) {\n\t\t\t\treturn\n\t\t\t}\n\t\t}\n\t\tif err = me.TOperatorAction.Walk(); xsdt.OnWalkError(&err, &WalkErrors, WalkContinueOnError, WalkOnError) {\n\t\t\treturn\n\t\t}\n\t\tif err = me.XsdGoPkgHasElem_RoadsideAssistanceTypesequenceextensioncomplexContentRoadsideAssistanceschema_RoadsideAssistanceType_TRoadsideAssistanceTypeEnum_.Walk(); xsdt.OnWalkError(&err, &WalkErrors, WalkContinueOnError, WalkOnError) {\n\t\t\treturn\n\t\t}\n\t\tif err = me.XsdGoPkgHasElem_RoadsideAssistanceExtensionsequenceextensioncomplexContentRoadsideAssistanceschema_RoadsideAssistanceExtension_TExtensionType_.Walk(); xsdt.OnWalkError(&err, &WalkErrors, WalkContinueOnError, WalkOnError) {\n\t\t\treturn\n\t\t}\n\t\tif fn != nil {\n\t\t\tif err = fn(me, false); xsdt.OnWalkError(&err, &WalkErrors, WalkContinueOnError, WalkOnError) {\n\t\t\t\treturn\n\t\t\t}\n\t\t}\n\t}\n\treturn\n}", "title": "" }, { "docid": "aad980aa99028407d0394b72400d28be", "score": "0.47041845", "text": "func Walk(t *tree.Tree, ch chan int) {\n\tvar walk func(*tree.Tree)\n\n\twalk = func(t *tree.Tree) {\n\t\tif t != nil {\n\t\t\twalk(t.Left)\n\t\t\tch <- t.Value\n\t\t\twalk(t.Right)\n\t\t}\n\t}\n\twalk(t)\n\tclose(ch)\n}", "title": "" }, { "docid": "dae242a4f7051edb8c08efd801ede707", "score": "0.47032768", "text": "func (mg *VirtualNetworkGateway) SetConditions(c ...xpv1.Condition) {\n\tmg.Status.SetConditions(c...)\n}", "title": "" }, { "docid": "d7d7277451cc16eada3ae603b247a3b0", "score": "0.47028956", "text": "func (topic *NamespacesTopic) SetConditions(conditions conditions.Conditions) {\n\ttopic.Status.Conditions = conditions\n}", "title": "" }, { "docid": "4bc077705e21f52742357faabfd18cf2", "score": "0.47015858", "text": "func (ts *TriggerStatus) InitializeConditions() {\n\ttriggerCondSet.Manage(ts).InitializeConditions()\n}", "title": "" }, { "docid": "123144a9aac31bfba0715f3e9d82623e", "score": "0.47008187", "text": "func (mg *Distribution) SetConditions(c ...xpv1.Condition) {\n\tmg.Status.SetConditions(c...)\n}", "title": "" }, { "docid": "1e89cab0383f1e4a461f5c304fadf8a2", "score": "0.46970513", "text": "func (o SuppressionOutput) Conditions() ConditionsPtrOutput {\n\treturn o.ApplyT(func(v Suppression) *Conditions { return v.Conditions }).(ConditionsPtrOutput)\n}", "title": "" }, { "docid": "c55f45118dc15d6ece6ed664217aa22f", "score": "0.4694291", "text": "func (me *TManagement) Walk() (err error) {\n\tif fn := WalkHandlers.TManagement; me != nil {\n\t\tif fn != nil {\n\t\t\tif err = fn(me, true); xsdt.OnWalkError(&err, &WalkErrors, WalkContinueOnError, WalkOnError) {\n\t\t\t\treturn\n\t\t\t}\n\t\t}\n\t\tif err = me.XsdGoPkgHasElem_LifeCycleManagementsequenceManagementschema_LifeCycleManagement_TLifeCycleManagement_.Walk(); xsdt.OnWalkError(&err, &WalkErrors, WalkContinueOnError, WalkOnError) {\n\t\t\treturn\n\t\t}\n\t\tif err = me.XsdGoPkgHasElem_FilterExitManagementsequenceManagementschema_FilterExitManagement_TFilterExitManagement_.Walk(); xsdt.OnWalkError(&err, &WalkErrors, WalkContinueOnError, WalkOnError) {\n\t\t\treturn\n\t\t}\n\t\tif err = me.XsdGoPkgHasElem_ManagementExtensionsequenceManagementschema_ManagementExtension_TExtensionType_.Walk(); xsdt.OnWalkError(&err, &WalkErrors, WalkContinueOnError, WalkOnError) {\n\t\t\treturn\n\t\t}\n\t\tif fn != nil {\n\t\t\tif err = fn(me, false); xsdt.OnWalkError(&err, &WalkErrors, WalkContinueOnError, WalkOnError) {\n\t\t\t\treturn\n\t\t\t}\n\t\t}\n\t}\n\treturn\n}", "title": "" }, { "docid": "c2f625096070fba2661f86eb66cc5ba1", "score": "0.46910617", "text": "func Walk(t *tree.Tree, ch chan int) {\n var walker func (*tree.Tree)\n walker = func(t *tree.Tree) {\n if t == nil {\n return\n }\n\n walker(t.Left)\n ch <- t.Value\n walker(t.Right)\n }\n \n walker(t)\n close(ch)\n}", "title": "" }, { "docid": "72622c47da9e2f9c7b959c06f1187da4", "score": "0.46883142", "text": "func (procedure *SqlDatabaseContainerStoredProcedure) SetConditions(conditions conditions.Conditions) {\n\tprocedure.Status.Conditions = conditions\n}", "title": "" }, { "docid": "6765a98d19eefc3ec77b0985f62afeaa", "score": "0.46881977", "text": "func Walk(t *tree.Tree, ch chan int) {\n var walker func(t *tree.Tree)\n walker = func(t *tree.Tree) {\n if t.Left != nil {\n walker(t.Left)\n }\n\n ch <- t.Value\n\n if t.Right != nil {\n walker(t.Right)\n }\n }\n\n walker(t)\n close(ch)\n}", "title": "" }, { "docid": "6b3d82848b2f12645653eb162b55971f", "score": "0.46818745", "text": "func (o DaemonSetStatusPatchPtrOutput) Conditions() DaemonSetConditionPatchArrayOutput {\n\treturn o.ApplyT(func(v *DaemonSetStatusPatch) []DaemonSetConditionPatch {\n\t\tif v == nil {\n\t\t\treturn nil\n\t\t}\n\t\treturn v.Conditions\n\t}).(DaemonSetConditionPatchArrayOutput)\n}", "title": "" }, { "docid": "116a9310c87d8e045dd62021e5eef29b", "score": "0.4680997", "text": "func Walk(t *tree.Tree, ch chan int) {\n\tif t == nil {\n\t\treturn\n\t}\n\tWalk(t.Left, ch)\n\tch <- t.Value\n\tWalk(t.Right, ch)\n\n}", "title": "" }, { "docid": "67730f7be75523ed92af31fc576b8a57", "score": "0.46723002", "text": "func (k *KKInstance) SetConditions(conditions clusterv1.Conditions) {\n\tk.Status.Conditions = conditions\n}", "title": "" }, { "docid": "4c331ed163a55f3482175a99de9a4be3", "score": "0.46709672", "text": "func (o GetProxyLBFilterPtrOutput) Conditions() GetProxyLBFilterConditionArrayOutput {\n\treturn o.ApplyT(func(v *GetProxyLBFilter) []GetProxyLBFilterCondition {\n\t\tif v == nil {\n\t\t\treturn nil\n\t\t}\n\t\treturn v.Conditions\n\t}).(GetProxyLBFilterConditionArrayOutput)\n}", "title": "" }, { "docid": "04c09d809915d18366ea537d1cd5e3b4", "score": "0.46709225", "text": "func (o DaemonSetStatusPtrOutput) Conditions() DaemonSetConditionArrayOutput {\n\treturn o.ApplyT(func(v *DaemonSetStatus) []DaemonSetCondition {\n\t\tif v == nil {\n\t\t\treturn nil\n\t\t}\n\t\treturn v.Conditions\n\t}).(DaemonSetConditionArrayOutput)\n}", "title": "" }, { "docid": "466008149d9f434eb0639fd2fdf3071b", "score": "0.46674138", "text": "func (o SuppressionResponseOutput) Conditions() ConditionsResponsePtrOutput {\n\treturn o.ApplyT(func(v SuppressionResponse) *ConditionsResponse { return v.Conditions }).(ConditionsResponsePtrOutput)\n}", "title": "" }, { "docid": "10ac6f396ff6ec5db1baf9639b3c7807", "score": "0.46635997", "text": "func (o GetWafRulesWafRuleOutput) Conditions() GetWafRulesWafRuleConditionArrayOutput {\n\treturn o.ApplyT(func(v GetWafRulesWafRule) []GetWafRulesWafRuleCondition { return v.Conditions }).(GetWafRulesWafRuleConditionArrayOutput)\n}", "title": "" }, { "docid": "26e00007b36ab2ec3f3344e830f720d6", "score": "0.46627426", "text": "func (o GetDNSFilterPtrOutput) Conditions() GetDNSFilterConditionArrayOutput {\n\treturn o.ApplyT(func(v *GetDNSFilter) []GetDNSFilterCondition {\n\t\tif v == nil {\n\t\t\treturn nil\n\t\t}\n\t\treturn v.Conditions\n\t}).(GetDNSFilterConditionArrayOutput)\n}", "title": "" }, { "docid": "794d1c3bf5aa94e637b2648404c4137d", "score": "0.46627313", "text": "func (o DatadogAgentStatusPtrOutput) Conditions() DatadogAgentStatusConditionsArrayOutput {\n\treturn o.ApplyT(func(v *DatadogAgentStatus) []DatadogAgentStatusConditions {\n\t\tif v == nil {\n\t\t\treturn nil\n\t\t}\n\t\treturn v.Conditions\n\t}).(DatadogAgentStatusConditionsArrayOutput)\n}", "title": "" }, { "docid": "2c03304b05b8a110d5d173201f4a5167", "score": "0.46626693", "text": "func (mg *VirtualNetwork) SetConditions(c ...xpv1.Condition) {\n\tmg.Status.SetConditions(c...)\n}", "title": "" }, { "docid": "2c03304b05b8a110d5d173201f4a5167", "score": "0.46626693", "text": "func (mg *VirtualNetwork) SetConditions(c ...xpv1.Condition) {\n\tmg.Status.SetConditions(c...)\n}", "title": "" }, { "docid": "00062c6ce667bd90c37500761b48a522", "score": "0.46601415", "text": "func Walk(t *tree.Tree, ch chan int) {\n var _walk func(t *tree.Tree, ch chan int)\n _walk = func(t *tree.Tree, ch chan int) {\n if(t.Left!=nil) {_walk(t.Left,ch)}\n ch<-t.Value\n if(t.Right!=nil) {_walk(t.Right,ch)}\n }\n _walk(t,ch)\n close(ch)\n}", "title": "" }, { "docid": "0c5a092fdec69fe45eb4865be8382a4a", "score": "0.46591666", "text": "func Walk(t *tree.Tree, ch chan int, level int) {\n\tif t.Left != nil {\n\t\tWalk(t.Left, ch, level+1)\n\t}\n\tch <- t.Value\n\tif t.Right != nil {\n\t\tWalk(t.Right, ch, level+1)\n\t}\n\tif level == 0 {\n\t\tclose(ch)\n\t}\n}", "title": "" }, { "docid": "4dc391e8642398499a206fc414f8b12f", "score": "0.46586925", "text": "func (mg *DBClusterParameterGroup) SetConditions(c ...xpv1.Condition) {\n\tmg.Status.SetConditions(c...)\n}", "title": "" }, { "docid": "2729cd0063c4d87e5568eb8512f50298", "score": "0.46565342", "text": "func (k *KKMachine) SetConditions(conditions clusterv1.Conditions) {\n\tk.Status.Conditions = conditions\n}", "title": "" }, { "docid": "b4065b930bd6eca99abaca1098723d0b", "score": "0.4651814", "text": "func EvaluateConditions(log logr.Logger, ctx context.EvalInterface, conditions []kyverno.Condition) bool {\n\t// AND the conditions\n\tfor _, condition := range conditions {\n\t\tif !Evaluate(log, ctx, condition) {\n\t\t\treturn false\n\t\t}\n\t}\n\treturn true\n}", "title": "" }, { "docid": "4935a7f7b7f1bd2ae17bb5d764d8e13a", "score": "0.4641592", "text": "func (me *TLinear) Walk() (err error) {\n\tif fn := WalkHandlers.TLinear; me != nil {\n\t\tif fn != nil {\n\t\t\tif err = fn(me, true); xsdt.OnWalkError(&err, &WalkErrors, WalkContinueOnError, WalkOnError) {\n\t\t\t\treturn\n\t\t\t}\n\t\t}\n\t\tif err = me.TNetworkLocation.Walk(); xsdt.OnWalkError(&err, &WalkErrors, WalkContinueOnError, WalkOnError) {\n\t\t\treturn\n\t\t}\n\t\tif err = me.XsdGoPkgHasElem_TpegLinearLocationsequenceextensioncomplexContentLinearschema_TpegLinearLocation_TpegLinearLocation_.Walk(); xsdt.OnWalkError(&err, &WalkErrors, WalkContinueOnError, WalkOnError) {\n\t\t\treturn\n\t\t}\n\t\tif err = me.XsdGoPkgHasElem_AlertCLinearsequenceextensioncomplexContentLinearschema_AlertCLinear_TAlertCLinear_.Walk(); xsdt.OnWalkError(&err, &WalkErrors, WalkContinueOnError, WalkOnError) {\n\t\t\treturn\n\t\t}\n\t\tif err = me.XsdGoPkgHasElem_LinearWithinLinearElementsequenceextensioncomplexContentLinearschema_LinearWithinLinearElement_TLinearWithinLinearElement_.Walk(); xsdt.OnWalkError(&err, &WalkErrors, WalkContinueOnError, WalkOnError) {\n\t\t\treturn\n\t\t}\n\t\tif err = me.XsdGoPkgHasElem_LinearExtensionsequenceextensioncomplexContentLinearschema_LinearExtension_TExtensionType_.Walk(); xsdt.OnWalkError(&err, &WalkErrors, WalkContinueOnError, WalkOnError) {\n\t\t\treturn\n\t\t}\n\t\tif fn != nil {\n\t\t\tif err = fn(me, false); xsdt.OnWalkError(&err, &WalkErrors, WalkContinueOnError, WalkOnError) {\n\t\t\t\treturn\n\t\t\t}\n\t\t}\n\t}\n\treturn\n}", "title": "" }, { "docid": "b67c77cfb9f0697d0a71c5fce5b25aca", "score": "0.46412656", "text": "func (mg *VirtualNetworkGatewayConnection) SetConditions(c ...xpv1.Condition) {\n\tmg.Status.SetConditions(c...)\n}", "title": "" }, { "docid": "036f2eac9f76177d57ff45657628a785", "score": "0.46372458", "text": "func (o FlowSchemaStatusPtrOutput) Conditions() FlowSchemaConditionArrayOutput {\n\treturn o.ApplyT(func(v *FlowSchemaStatus) []FlowSchemaCondition {\n\t\tif v == nil {\n\t\t\treturn nil\n\t\t}\n\t\treturn v.Conditions\n\t}).(FlowSchemaConditionArrayOutput)\n}", "title": "" }, { "docid": "667ec7c4ae49901f1c2a7ea7847860c8", "score": "0.46286333", "text": "func (endpoint *DnsResolversInboundEndpoint) SetConditions(conditions conditions.Conditions) {\n\tendpoint.Status.Conditions = conditions\n}", "title": "" }, { "docid": "53e4448139b9b2d6bbea5da25b6dcf41", "score": "0.46232656", "text": "func (me *TrafficData) Walk() (err error) {\n\tif fn := WalkHandlers.TrafficData; me != nil {\n\t\tif fn != nil {\n\t\t\tif err = fn(me, true); xsdt.OnWalkError(&err, &WalkErrors, WalkContinueOnError, WalkOnError) {\n\t\t\t\treturn\n\t\t\t}\n\t\t}\n\t\tif err = me.TBasicData.Walk(); xsdt.OnWalkError(&err, &WalkErrors, WalkContinueOnError, WalkOnError) {\n\t\t\treturn\n\t\t}\n\t\tif err = me.XsdGoPkgHasElem_ForVehiclesWithCharacteristicsOfsequenceextensioncomplexContentTrafficDataschema_ForVehiclesWithCharacteristicsOf_TVehicleCharacteristics_.Walk(); xsdt.OnWalkError(&err, &WalkErrors, WalkContinueOnError, WalkOnError) {\n\t\t\treturn\n\t\t}\n\t\tif err = me.XsdGoPkgHasElem_TrafficDataExtensionsequenceextensioncomplexContentTrafficDataschema_TrafficDataExtension_TExtensionType_.Walk(); xsdt.OnWalkError(&err, &WalkErrors, WalkContinueOnError, WalkOnError) {\n\t\t\treturn\n\t\t}\n\t\tif fn != nil {\n\t\t\tif err = fn(me, false); xsdt.OnWalkError(&err, &WalkErrors, WalkContinueOnError, WalkOnError) {\n\t\t\t\treturn\n\t\t\t}\n\t\t}\n\t}\n\treturn\n}", "title": "" }, { "docid": "0d33f1ac42bf08aa2e8456b6a88fa167", "score": "0.46225965", "text": "func Walk(t *tree.Tree, ch chan<- int) {\n\tif t == nil {\n\t\treturn\n\t}\n\tWalk(t.Left, ch)\n\tch <- t.Value\n\tWalk(t.Right, ch)\n}", "title": "" }, { "docid": "59dfa4b33b825df22e66425338214864", "score": "0.4620739", "text": "func (me *THumidity) Walk() (err error) {\n\tif fn := WalkHandlers.THumidity; me != nil {\n\t\tif fn != nil {\n\t\t\tif err = fn(me, true); xsdt.OnWalkError(&err, &WalkErrors, WalkContinueOnError, WalkOnError) {\n\t\t\t\treturn\n\t\t\t}\n\t\t}\n\t\tif err = me.XsdGoPkgHasElem_RelativeHumiditysequenceHumidityschema_RelativeHumidity_TPercentageValue_.Walk(); xsdt.OnWalkError(&err, &WalkErrors, WalkContinueOnError, WalkOnError) {\n\t\t\treturn\n\t\t}\n\t\tif err = me.XsdGoPkgHasElem_HumidityExtensionsequenceHumidityschema_HumidityExtension_TExtensionType_.Walk(); xsdt.OnWalkError(&err, &WalkErrors, WalkContinueOnError, WalkOnError) {\n\t\t\treturn\n\t\t}\n\t\tif fn != nil {\n\t\t\tif err = fn(me, false); xsdt.OnWalkError(&err, &WalkErrors, WalkContinueOnError, WalkOnError) {\n\t\t\t\treturn\n\t\t\t}\n\t\t}\n\t}\n\treturn\n}", "title": "" }, { "docid": "9f643b150ede9fd7cf401ed94ffdfec6", "score": "0.4609223", "text": "func (e *ExtensionConfig) SetConditions(conditions clusterv1.Conditions) {\n\te.Status.Conditions = conditions\n}", "title": "" }, { "docid": "465baf95417f495612372f6387614e9d", "score": "0.460909", "text": "func (i *PostgreSQLInstance) SetConditions(c ...runtimev1alpha1.Condition) {\n\ti.Status.SetConditions(c...)\n}", "title": "" }, { "docid": "994efeddf1a79fe8d27c539e5d4faa7f", "score": "0.4609089", "text": "func (o DatadogMetricStatusOutput) Conditions() DatadogMetricStatusConditionsArrayOutput {\n\treturn o.ApplyT(func(v DatadogMetricStatus) []DatadogMetricStatusConditions { return v.Conditions }).(DatadogMetricStatusConditionsArrayOutput)\n}", "title": "" }, { "docid": "dc435bc6687b3182d93b29ee72924ef0", "score": "0.4608059", "text": "func (c *AzureCluster) SetConditions(conditions clusterv1.Conditions) {\n\tc.Status.Conditions = conditions\n}", "title": "" }, { "docid": "592d096805807371d0551ceae8c95f78", "score": "0.4607328", "text": "func (o GetInternetFilterPtrOutput) Conditions() GetInternetFilterConditionArrayOutput {\n\treturn o.ApplyT(func(v *GetInternetFilter) []GetInternetFilterCondition {\n\t\tif v == nil {\n\t\t\treturn nil\n\t\t}\n\t\treturn v.Conditions\n\t}).(GetInternetFilterConditionArrayOutput)\n}", "title": "" }, { "docid": "dc5558f6bca7715159e43d8565a4549d", "score": "0.46072882", "text": "func (o GetServerFilterPtrOutput) Conditions() GetServerFilterConditionArrayOutput {\n\treturn o.ApplyT(func(v *GetServerFilter) []GetServerFilterCondition {\n\t\tif v == nil {\n\t\t\treturn nil\n\t\t}\n\t\treturn v.Conditions\n\t}).(GetServerFilterConditionArrayOutput)\n}", "title": "" }, { "docid": "c3d3956c7ac19176c854e1f341dd3207", "score": "0.4600728", "text": "func (o WorkstationConfigOutput) Conditions() WorkstationConfigConditionArrayOutput {\n\treturn o.ApplyT(func(v *WorkstationConfig) WorkstationConfigConditionArrayOutput { return v.Conditions }).(WorkstationConfigConditionArrayOutput)\n}", "title": "" }, { "docid": "e9465d37660902cfa3e9578b523179f7", "score": "0.4600366", "text": "func (database *ServersDatabase) SetConditions(conditions conditions.Conditions) {\n\tdatabase.Status.Conditions = conditions\n}", "title": "" }, { "docid": "8e56eb60064b033a43d4b0cfef4be1ef", "score": "0.46001697", "text": "func (me *TWeatherData) Walk() (err error) {\n\tif fn := WalkHandlers.TWeatherData; me != nil {\n\t\tif fn != nil {\n\t\t\tif err = fn(me, true); xsdt.OnWalkError(&err, &WalkErrors, WalkContinueOnError, WalkOnError) {\n\t\t\t\treturn\n\t\t\t}\n\t\t}\n\t\tif err = me.XsdGoPkgHasElem_WeatherDataExtensionsequenceextensioncomplexContentWeatherDataschema_WeatherDataExtension_TExtensionType_.Walk(); xsdt.OnWalkError(&err, &WalkErrors, WalkContinueOnError, WalkOnError) {\n\t\t\treturn\n\t\t}\n\t\tif err = me.TBasicData.Walk(); xsdt.OnWalkError(&err, &WalkErrors, WalkContinueOnError, WalkOnError) {\n\t\t\treturn\n\t\t}\n\t\tif fn != nil {\n\t\t\tif err = fn(me, false); xsdt.OnWalkError(&err, &WalkErrors, WalkContinueOnError, WalkOnError) {\n\t\t\t\treturn\n\t\t\t}\n\t\t}\n\t}\n\treturn\n}", "title": "" }, { "docid": "1d92b209413bb880afbeabd5eb178c6f", "score": "0.4598628", "text": "func (mg *SubnetNATGatewayAssociation) SetConditions(c ...xpv1.Condition) {\n\tmg.Status.SetConditions(c...)\n}", "title": "" } ]
bf015093f10a2aa64e06b61cf3edc626
DepthRangef sets the mapping from normalized device coordinates to window coordinates.
[ { "docid": "f1da3a52a853a13799d5f7c0d7d4653c", "score": "0.7960572", "text": "func DepthRangef(n, f float32) {\n\t_pluginInstance.glContext.DepthRangef(n, f)\n}", "title": "" } ]
[ { "docid": "ce2a8c186922539200cf3b9c34f7b212", "score": "0.7827473", "text": "func DepthRangef(zNear Clampf, zFar Clampf) {\n\tczNear, _ := (C.GLclampf)(zNear), cgoAllocsUnknown\n\tczFar, _ := (C.GLclampf)(zFar), cgoAllocsUnknown\n\tC.glDepthRangef(czNear, czFar)\n}", "title": "" }, { "docid": "03975521345b27f4bc5f03238c92c251", "score": "0.7111603", "text": "func (gl *GL) DepthRange(nearVal, farVal float64) {\n\tC.gl1_3_glDepthRange(gl.funcs, C.GLdouble(nearVal), C.GLdouble(farVal))\n}", "title": "" }, { "docid": "fdf54921a8317cc8679ba075fc25a11d", "score": "0.63685614", "text": "func DepthRangex(zNear Clampx, zFar Clampx) {\n\tczNear, _ := (C.GLclampx)(zNear), cgoAllocsUnknown\n\tczFar, _ := (C.GLclampx)(zFar), cgoAllocsUnknown\n\tC.glDepthRangex(czNear, czFar)\n}", "title": "" }, { "docid": "f90b7939e1b17a2678c4f1ccfae8f52d", "score": "0.5452438", "text": "func SetDepthFunc(_func Enum) {\n\tc_func, _ := (C.GLenum)(_func), cgoAllocsUnknown\n\tC.glDepthFunc(c_func)\n}", "title": "" }, { "docid": "6904bb4a39c48aa7a7d615efde683a0e", "score": "0.5259214", "text": "func DepthFunc(fn Enum) {\n\t_pluginInstance.glContext.DepthFunc(gl.Enum(fn))\n}", "title": "" }, { "docid": "c69e48d12e03a4df945303d4c2189990", "score": "0.520497", "text": "func CmdSetDepthBounds(commandBuffer CommandBuffer, minDepthBounds float32, maxDepthBounds float32) {\n\tccommandBuffer, _ := *(*C.VkCommandBuffer)(unsafe.Pointer(&commandBuffer)), cgoAllocsUnknown\n\tcminDepthBounds, _ := (C.float)(minDepthBounds), cgoAllocsUnknown\n\tcmaxDepthBounds, _ := (C.float)(maxDepthBounds), cgoAllocsUnknown\n\tC.callVkCmdSetDepthBounds(ccommandBuffer, cminDepthBounds, cmaxDepthBounds)\n}", "title": "" }, { "docid": "7b8071c8eb3fba140aee50c09c541446", "score": "0.50593436", "text": "func Depth(depth int) Option {\n\treturn func(f *Filehound) {\n\t\tf.maxDepth = depth\n\t}\n}", "title": "" }, { "docid": "e4a2a6d163a5c5fd76158795552ac3c0", "score": "0.49839127", "text": "func VEventfDepth(ctx context.Context, depth int, level Level, format string, args ...interface{}) {\n\tvEventf(ctx, false /* isErr */, 1+depth, level, format, args...)\n}", "title": "" }, { "docid": "4bc9cb56d093615631538971d92d0c97", "score": "0.4971352", "text": "func ClearDepthf(d float32) {\n\t_pluginInstance.glContext.ClearDepthf(d)\n}", "title": "" }, { "docid": "d46482ef476c43863bb9f44b2dee4d8d", "score": "0.49218363", "text": "func SetDepthLimit(depth int) {\r\n\tdepthLimit = depth\r\n}", "title": "" }, { "docid": "728fad74b7673525519643fe644a6638", "score": "0.48747492", "text": "func (i *Index) MappingDepthLimit(mappingDepthLimit int) *Index {\n\ti.mappingDepthLimit = &mappingDepthLimit\n\treturn i\n}", "title": "" }, { "docid": "29dc14b3418b0f646565d8bd1a32c623", "score": "0.4861471", "text": "func Frustumf(left Float, right Float, bottom Float, top Float, zNear Float, zFar Float) {\n\tcleft, _ := (C.GLfloat)(left), cgoAllocsUnknown\n\tcright, _ := (C.GLfloat)(right), cgoAllocsUnknown\n\tcbottom, _ := (C.GLfloat)(bottom), cgoAllocsUnknown\n\tctop, _ := (C.GLfloat)(top), cgoAllocsUnknown\n\tczNear, _ := (C.GLfloat)(zNear), cgoAllocsUnknown\n\tczFar, _ := (C.GLfloat)(zFar), cgoAllocsUnknown\n\tC.glFrustumf(cleft, cright, cbottom, ctop, czNear, czFar)\n}", "title": "" }, { "docid": "3be02467f80348671806a5036835f612", "score": "0.48249856", "text": "func ClearDepthf(depth Clampf) {\n\tcdepth, _ := (C.GLclampf)(depth), cgoAllocsUnknown\n\tC.glClearDepthf(cdepth)\n}", "title": "" }, { "docid": "4033069721d69e775a121f97059eabfb", "score": "0.48080337", "text": "func Rangef(scope common.Scope, args ...interface{}) interface{} {\n\tmakefloat64 := func(arg interface{}) float64 {\n\t\tval, ok := arg.(float64)\n\t\tif ok == false {\n\t\t\tintw, ok := arg.(int64)\n\t\t\tif ok == false {\n\t\t\t\tpanic(\"expected int64, or float64\")\n\t\t\t}\n\t\t\tval = float64(intw)\n\t\t}\n\t\treturn val\n\t}\n\n\trnd := scope.GetRandom()\n\tif len(args) == 2 {\n\t\tmin, max := makefloat64(args[0]), makefloat64(args[1])\n\t\tf := (rnd.Float64() * (max - min)) + min\n\t\treturn f\n\n\t} else if len(args) == 1 {\n\t\tmax := makefloat64(args[0])\n\t\treturn rnd.Float64() * max\n\t}\n\tpanic(fmt.Errorf(\"atleast one argument expected for range-form\\n\"))\n}", "title": "" }, { "docid": "9bf757124d54bc0290ca10f510d15129", "score": "0.47838068", "text": "func (m *voiceApp) setDepth() {\n\tvar scale float32\n\tswitch m.mode {\n\tcase modModeAM:\n\t\tscale = 1.0\n\tcase modModeFM:\n\t\tscale = core.MIDIToFrequency(m.note * 0.25)\n\tcase modModePM:\n\t\tscale = core.Pi * 0.15\n\tdefault:\n\t}\n\tcore.EventInFloat(m.lfo, \"depth\", core.MapLin(m.depth, 0, scale))\n}", "title": "" }, { "docid": "bf1f3358a26a64f625d713ed3f3f202b", "score": "0.46980774", "text": "func DepthMask(on bool) {\n\tif on {\n\t\tC.goglDepthMask(1)\n\t} else {\n\t\tC.goglDepthMask(0)\n\t}\n}", "title": "" }, { "docid": "816b77005ed6ed7913f7b311265f3e5a", "score": "0.46270588", "text": "func Bounds(f float32) float32 {\n\tif f < 0 {\n\t\tf = 0\n\t}\n\tif f > 1 {\n\t\tf = 1\n\t}\n\treturn f\n}", "title": "" }, { "docid": "19ccc2e4f291160da859707dcfdfd785", "score": "0.461809", "text": "func (t *FenWickTree) Range(l, r int) int {\n\tif l < r {\n\t\tpanic(\"invalid bounds\")\n\t}\n\tif l == 1 {\n\t\treturn t.Query(r)\n\t}\n\treturn t.Query(r) - t.Query(l)\n}", "title": "" }, { "docid": "07180cb4c942a0ab0c198c65eeedcb87", "score": "0.45958823", "text": "func FloatRange(start float64, end float64) Domain[float64] {\n\treturn FloatRangeStep(start, end, 1.0)\n}", "title": "" }, { "docid": "faefc511bc9fa8753b0894592408c4dd", "score": "0.45091727", "text": "func (c *Cube) SetDepth(dep float32) {\n\tc.depth = dep\n}", "title": "" }, { "docid": "93eb64cc4430379e94fcfb300a37769f", "score": "0.44323346", "text": "func (f *Faker) Float64Range(min, max float64) float64 {\n\treturn float64Range(f.Rand, min, max)\n}", "title": "" }, { "docid": "082d59262e061a5b3839e364f9102d97", "score": "0.44189948", "text": "func (m *dirsMap) Range(f func(key string, value bool) bool) {\n\tm.data.Range(func(k, v interface{}) bool {\n\t\tkey, ok := k.(string)\n\t\tif !ok {\n\t\t\treturn false\n\t\t}\n\t\tvalue, ok := v.(bool)\n\t\tif !ok {\n\t\t\treturn false\n\t\t}\n\t\treturn f(key, value)\n\t})\n}", "title": "" }, { "docid": "ced90b6e39e903b7722c39f4c3a0423d", "score": "0.44049", "text": "func DepthMask(flag Boolean) {\n\tcflag, _ := (C.GLboolean)(flag), cgoAllocsUnknown\n\tC.glDepthMask(cflag)\n}", "title": "" }, { "docid": "5561cf825f3e4a857cff4ed599b0404c", "score": "0.43701297", "text": "func RangeMap(value, in_range_min, in_range_max, out_range_min, out_range_max float64) float64 {\n\tfractional_loc := (value - in_range_min) / (in_range_max - in_range_min)\n\treturn fractional_loc*(out_range_max-out_range_min) + out_range_min\n}", "title": "" }, { "docid": "183d8d104940463ee337b995a9e25621", "score": "0.4333147", "text": "func (dm *DerivationsMap) Range(f func(filename string, drv *Derivation) bool) {\n\tdm.Map.Range(func(key, value interface{}) bool {\n\t\treturn f(key.(string), value.(*Derivation))\n\t})\n}", "title": "" }, { "docid": "11d5f086e1d21551ef16a40c605fcad1", "score": "0.4321102", "text": "func (m *Maze) Range(f func(x, y int) bool) {\n\tfor y := 0; y < m.height; y++ {\n\t\tfor x := 0; x < m.width; x++ {\n\t\t\tif !f(x, y) {\n\t\t\t\treturn\n\t\t\t}\n\t\t}\n\t}\n}", "title": "" }, { "docid": "91d9606f07270a3dc9b3581f19b6a601", "score": "0.43158242", "text": "func DepthMask(flag bool) {\n\t_pluginInstance.glContext.DepthMask(flag)\n}", "title": "" }, { "docid": "fe7999f035dc52cdbca2ef3ed4b09766", "score": "0.42996472", "text": "func Float64Range(min, max float64) gopter.Gen {\n\td := max - min\n\tif d < 0 || d > math.MaxFloat64 {\n\t\treturn Fail(reflect.TypeOf(float64(0)))\n\t}\n\n\treturn func(genParams *gopter.GenParameters) *gopter.GenResult {\n\t\tgenResult := gopter.NewGenResult(min+genParams.Rng.Float64()*d, Float64Shrinker)\n\t\tgenResult.Sieve = func(v interface{}) bool {\n\t\t\treturn v.(float64) >= min && v.(float64) <= max\n\t\t}\n\t\treturn genResult\n\t}\n}", "title": "" }, { "docid": "8ab16b2c7d4065939660a63ecff1d415", "score": "0.42660078", "text": "func (x *fastReflection_QueryParamsRequest) Range(f func(protoreflect.FieldDescriptor, protoreflect.Value) bool) {\n}", "title": "" }, { "docid": "9e1c80cf0d8b0acc2847ec9374ff3e90", "score": "0.4264034", "text": "func (s *Base) Range(f func(x int32) bool) {\n\tmin := atomic.LoadInt32(&s.min)\n\ts.Static.Range(func(x uint32) bool {\n\t\treturn f(min + int32(x))\n\t})\n}", "title": "" }, { "docid": "46015421048cca815cfe95319d6405cf", "score": "0.42604747", "text": "func (x *Index) NormalizedDepth(refID int) []float32 {\n\n\tif x.medianSizePerTile == 0.0 {\n\t\tx.init()\n\t}\n\tif refID >= len(x.sizes) {\n\t\treturn make([]float32, 0)\n\t}\n\tref := x.sizes[refID]\n\n\tdepths := make([]float32, 0, len(ref))\n\tif x.medianSizePerTile == 0 {\n\t\treturn depths\n\t}\n\n\tfor i, o := range ref {\n\t\tdepths = append(depths, float32(float64(o)/x.medianSizePerTile))\n\t\tif depths[i] > 50000 {\n\t\t\tdepths[i] = 50000\n\t\t}\n\t}\n\treturn depths\n}", "title": "" }, { "docid": "e1f21116a6cc15273380b5e786c85df9", "score": "0.42569208", "text": "func (entry *FanoutEntry) WithinMatchingDepthRange(symbolDepth int) bool {\n\tif (entry.MatchSymbolDepthStart <= symbolDepth) && (entry.MatchSymbolDepthFinish >= symbolDepth) {\n\t\treturn true\n\t}\n\treturn false\n}", "title": "" }, { "docid": "9c8e7aaccaa6baeca4a8f997d76995c4", "score": "0.42445678", "text": "func (a *GetEventListenersArgs) SetDepth(depth int) *GetEventListenersArgs {\n\ta.Depth = &depth\n\treturn a\n}", "title": "" }, { "docid": "d40533e3511709d1c7118579d709617e", "score": "0.4208452", "text": "func (model *Model) SetDepth(val int) {\n\tmodel.Lock()\n\tmodel.Depth = val\n\tmodel.Unlock()\n}", "title": "" }, { "docid": "f87651769c1c6657dfed8f90806c31a9", "score": "0.4199122", "text": "func (x *fastReflection_GetNodeInfoRequest) Range(f func(protoreflect.FieldDescriptor, protoreflect.Value) bool) {\n}", "title": "" }, { "docid": "ad8df1b794df55bc0308b2f5f249946f", "score": "0.41971624", "text": "func (s *NumericAxisOptions) SetRange(v *AxisDisplayRange) *NumericAxisOptions {\n\ts.Range = v\n\treturn s\n}", "title": "" }, { "docid": "2b07cf01e9cf7b627b9a3aad846be3d3", "score": "0.41778043", "text": "func (x *fastReflection_MsgDefineResolver) Range(f func(protoreflect.FieldDescriptor, protoreflect.Value) bool) {\n\tif x.Manager != \"\" {\n\t\tvalue := protoreflect.ValueOfString(x.Manager)\n\t\tif !f(fd_MsgDefineResolver_manager, value) {\n\t\t\treturn\n\t\t}\n\t}\n\tif x.ResolverUrl != \"\" {\n\t\tvalue := protoreflect.ValueOfString(x.ResolverUrl)\n\t\tif !f(fd_MsgDefineResolver_resolver_url, value) {\n\t\t\treturn\n\t\t}\n\t}\n}", "title": "" }, { "docid": "0aead86e5670bdfb4253efd258fc1e84", "score": "0.4159844", "text": "func (x *fastReflection_GenesisState) Range(f func(protoreflect.FieldDescriptor, protoreflect.Value) bool) {\n\tif x.Index != uint64(0) {\n\t\tvalue := protoreflect.ValueOfUint64(x.Index)\n\t\tif !f(fd_GenesisState_index, value) {\n\t\t\treturn\n\t\t}\n\t}\n\tif len(x.Owners) != 0 {\n\t\tvalue := protoreflect.ValueOfList(&_GenesisState_2_list{list: &x.Owners})\n\t\tif !f(fd_GenesisState_owners, value) {\n\t\t\treturn\n\t\t}\n\t}\n}", "title": "" }, { "docid": "a1e1618e43b71b60ca1ef33e23eaac8a", "score": "0.4135508", "text": "func (_this *DOMMatrix) SetF(value float64) {\n\tinput := value\n\t_this.Value_JS.Set(\"f\", input)\n}", "title": "" }, { "docid": "29ab6141c643fcdb50d7d76c09b6d98b", "score": "0.4119841", "text": "func (d *Domain) SetRange(min, max int) error {\n\t// Attempting to set an empty range will cause an IO error.\n\t// Rather than trying to figure out the right order to set\n\t// them in, try both orders.\n\terr1 := writeInt(filepath.Join(d.path, \"scaling_min_freq\"), min)\n\tif err2 := writeInt(filepath.Join(d.path, \"scaling_max_freq\"), max); err2 != nil {\n\t\treturn err2\n\t}\n\tif err1 != nil {\n\t\terr1 = writeInt(filepath.Join(d.path, \"scaling_min_freq\"), min)\n\t}\n\treturn err1\n}", "title": "" }, { "docid": "0e64a220ceff51f60b245ab9388f9737", "score": "0.40995818", "text": "func (nuts *NUTS) updateDepth(depth int) {\n\tif len(nuts.Depth) <= depth {\n\t\tnuts.Depth = append(nuts.Depth,\n\t\t\tmake([][2]float64, depth-len(nuts.Depth)+1)...)\n\t}\n\tfor i := 0; i != depth; i++ {\n\t\tnuts.Depth[i][0]++\n\t}\n\tnuts.Depth[depth][1]++\n}", "title": "" }, { "docid": "5e446fbd2bdd226299bf95d3e295535e", "score": "0.40886787", "text": "func (s HashSpace) SetLevels(min, max int) {\n\tC.dHashSpaceSetLevels(s.c(), C.int(min), C.int(max))\n}", "title": "" }, { "docid": "0d0d2bd5313bc3730f92fdc25da15180", "score": "0.40864658", "text": "func VErrEventfDepth(\n\tctx context.Context, depth int, level Level, format string, args ...interface{},\n) {\n\tvEventf(ctx, true /* isErr */, 1+depth, level, format, args...)\n}", "title": "" }, { "docid": "542cefbc3e5327c6fd287a2d17248785", "score": "0.4075571", "text": "func (x *fastReflection_AllowDenomProposal) Range(f func(protoreflect.FieldDescriptor, protoreflect.Value) bool) {\n\tif x.Title != \"\" {\n\t\tvalue := protoreflect.ValueOfString(x.Title)\n\t\tif !f(fd_AllowDenomProposal_title, value) {\n\t\t\treturn\n\t\t}\n\t}\n\tif x.Description != \"\" {\n\t\tvalue := protoreflect.ValueOfString(x.Description)\n\t\tif !f(fd_AllowDenomProposal_description, value) {\n\t\t\treturn\n\t\t}\n\t}\n\tif x.Denom != nil {\n\t\tvalue := protoreflect.ValueOfMessage(x.Denom.ProtoReflect())\n\t\tif !f(fd_AllowDenomProposal_denom, value) {\n\t\t\treturn\n\t\t}\n\t}\n}", "title": "" }, { "docid": "b1b1636f04c4eed1a5e767bbfc7d2239", "score": "0.40552902", "text": "func (x *fastReflection_Module) Range(f func(protoreflect.FieldDescriptor, protoreflect.Value) bool) {\n}", "title": "" }, { "docid": "233b7a2c04ff714bb6704255e950956d", "score": "0.40538806", "text": "func (d *Decoder) MaxDepth(n int) {\n\td.maxDepth = n\n}", "title": "" }, { "docid": "d5b4fa1a46aee8f00ec26071175033ce", "score": "0.4048276", "text": "func (r *Renderer) drawRange(startX, endX, y int) {\n\tr.lastY, r.lastX = y, endX\n\tif startX >= endX {\n\t\treturn\n\t}\n\n\tmapIdx := GB_BASE_MAP // 0x9800\n\tif util.Bit(r.g.LCDC, TileMap) {\n\t\tmapIdx += GB_SIZE_MAP // 0x9c00\n\t}\n\n\tif r.disableBG {\n\t\tfor x := startX; x < endX; x++ {\n\t\t\tr.row[x] = 0\n\t\t}\n\t}\n\n\tif util.Bit(r.g.LCDC, BgEnable) || r.Model >= util.GB_MODEL_CGB {\n\t\twy, wx := int(r.wy)+int(r.currentWy), int(r.wx)+int(r.currentWx)-7\n\t\tif util.Bit(r.g.LCDC, Window) && wy == y && wx <= endX {\n\t\t\tr.hasWindow = true\n\t\t}\n\t\tscx, scy := int(r.g.io[GB_REG_SCX]), int(r.g.io[GB_REG_SCY])\n\t\tif util.Bit(r.g.LCDC, Window) && r.hasWindow && wx <= endX && !r.disableWIN {\n\t\t\tif wx > 0 && !r.disableBG {\n\t\t\t\t// bg -> window\n\t\t\t\tr.drawBackground(mapIdx, startX, wx, scx, scy+y, r.highlightBG)\n\n\t\t\t\t// fallthrough and draw window\n\t\t\t}\n\n\t\t\tmapIdx = GB_BASE_MAP\n\t\t\tif util.Bit(r.g.LCDC, WindowTileMap) {\n\t\t\t\tmapIdx += GB_SIZE_MAP // 0x9c00\n\t\t\t}\n\t\t\tr.drawBackground(mapIdx, wx, endX, -wx, y-wy, r.highlightWIN)\n\t\t} else if !r.disableBG {\n\t\t\tr.drawBackground(mapIdx, startX, endX, scx, scy+y, r.highlightBG)\n\t\t}\n\t} else if !r.disableBG {\n\t\tfor x := startX; x < endX; x++ {\n\t\t\tr.row[x] = 0\n\t\t}\n\t}\n\n\tif startX == 0 {\n\t\tr.cleanOAM(y)\n\t}\n\tif util.Bit(r.g.LCDC, ObjEnable) && !r.disableOBJ {\n\t\tfor i := 0; i < r.objMax; i++ {\n\t\t\tr.drawObj(r.obj[i], startX, endX, y)\n\t\t}\n\t}\n\n\thighlightAmount := (r.highlightAmount + 6) >> 4\n\tif r.lastHighlightAmount != highlightAmount {\n\t\tr.lastHighlightAmount = highlightAmount\n\t\tfor i := 0; i < PAL_SGB_BORDER; i++ {\n\t\t\tif i >= PAL_OBJ && i&3 == 0 {\n\t\t\t\tcontinue\n\t\t\t}\n\t\t\tr.Palette[i+PAL_HIGHLIGHT] = r.Palette[i]\n\t\t}\n\t}\n\n\tsgbOffset := 0\n\tif (r.Model&util.GB_MODEL_SGB != 0) && r.sgbBorders {\n\t\tsgbOffset = r.outputBufferStride*40 + 48\n\t}\n\n\trow := r.outputBuffer[r.outputBufferStride*y+sgbOffset:]\n\tx, p := startX, 0\n\tswitch r.sgbRenderMode {\n\tcase 0:\n\t\tif r.Model&util.GB_MODEL_SGB != 0 {\n\t\t\tp = int(r.sgbAttributes[(startX>>5)+5*(y>>3)])\n\t\t\tp >>= 6 - ((x / 4) & 0x6)\n\t\t\tp &= 3\n\t\t\tp <<= 2\n\t\t}\n\t\tfor ; x < ((startX+7) & ^7) && x < endX; x++ {\n\t\t\trow[x] = r.Palette[p|int(r.Lookup[r.row[x]&OBJ_PRIO_MASK])]\n\t\t}\n\n\t\tfor ; x+7 < (endX & ^7); x += 8 {\n\t\t\tif (r.Model & util.GB_MODEL_SGB) != 0 {\n\t\t\t\tp = int(r.sgbAttributes[(x>>5)+5*(y>>3)])\n\t\t\t\tp >>= 6 - ((x / 4) & 0x6)\n\t\t\t\tp &= 3\n\t\t\t\tp <<= 2\n\t\t\t}\n\t\t\trow[x+0] = r.Palette[p|int(r.Lookup[r.row[x]&OBJ_PRIO_MASK])]\n\t\t\trow[x+1] = r.Palette[p|int(r.Lookup[r.row[x+1]&OBJ_PRIO_MASK])]\n\t\t\trow[x+2] = r.Palette[p|int(r.Lookup[r.row[x+2]&OBJ_PRIO_MASK])]\n\t\t\trow[x+3] = r.Palette[p|int(r.Lookup[r.row[x+3]&OBJ_PRIO_MASK])]\n\t\t\trow[x+4] = r.Palette[p|int(r.Lookup[r.row[x+4]&OBJ_PRIO_MASK])]\n\t\t\trow[x+5] = r.Palette[p|int(r.Lookup[r.row[x+5]&OBJ_PRIO_MASK])]\n\t\t\trow[x+6] = r.Palette[p|int(r.Lookup[r.row[x+6]&OBJ_PRIO_MASK])]\n\t\t\trow[x+7] = r.Palette[p|int(r.Lookup[r.row[x+7]&OBJ_PRIO_MASK])]\n\t\t}\n\t\tif (r.Model & util.GB_MODEL_SGB) != 0 {\n\t\t\tp = int(r.sgbAttributes[(x>>5)+5*(y>>3)])\n\t\t\tp >>= 6 - ((x / 4) & 0x6)\n\t\t\tp &= 3\n\t\t\tp <<= 2\n\t\t}\n\t\tfor ; x < endX; x++ {\n\t\t\trow[x] = r.Palette[p|int(r.Lookup[r.row[x]&OBJ_PRIO_MASK])]\n\t\t}\n\tcase 2:\n\t\tfor ; x < ((startX+7) & ^7) && x < endX; x++ {\n\t\t\trow[x] = 0\n\t\t}\n\t\tfor ; x+7 < (endX & ^7); x += 8 {\n\t\t\trow[x] = 0\n\t\t\trow[x+1] = 0\n\t\t\trow[x+2] = 0\n\t\t\trow[x+3] = 0\n\t\t\trow[x+4] = 0\n\t\t\trow[x+5] = 0\n\t\t\trow[x+6] = 0\n\t\t\trow[x+7] = 0\n\t\t}\n\t\tfor ; x < endX; x++ {\n\t\t\trow[x] = 0\n\t\t}\n\tcase 3:\n\t\tfor ; x < ((startX+7) & ^7) && x < endX; x++ {\n\t\t\trow[x] = r.Palette[0]\n\t\t}\n\t\tfor ; x+7 < (endX & ^7); x += 8 {\n\t\t\trow[x] = r.Palette[0]\n\t\t\trow[x+1] = r.Palette[0]\n\t\t\trow[x+2] = r.Palette[0]\n\t\t\trow[x+3] = r.Palette[0]\n\t\t\trow[x+4] = r.Palette[0]\n\t\t\trow[x+5] = r.Palette[0]\n\t\t\trow[x+6] = r.Palette[0]\n\t\t\trow[x+7] = r.Palette[0]\n\t\t}\n\t\tfor ; x < endX; x++ {\n\t\t\trow[x] = r.Palette[0]\n\t\t}\n\t}\n}", "title": "" }, { "docid": "70ee9dce4bc17c703248bb6ffcf8cb2a", "score": "0.40480494", "text": "func getRange(freq int, fps fpSettings) int {\n\tstep := (fps.maxFeq - fps.minFreq) / fps.pointsCount\n\tz := (freq - fps.minFreq) / step\n\tif z < 0 {\n\t\tz = 0\n\t}\n\tif z > fps.pointsCount-1 {\n\t\tz = fps.pointsCount - 1\n\t}\n\tRANGE := []int{40, 80, 120, 180, 300}\n\ti := 0\n\tfor RANGE[i] < freq {\n\t\ti++\n\t}\n\treturn z\n}", "title": "" }, { "docid": "2f7b88750ff8beec17dbe75253bf4a3d", "score": "0.40461603", "text": "func (x *fastReflection_ContinuousVestingAccount) Range(f func(protoreflect.FieldDescriptor, protoreflect.Value) bool) {\n\tif x.BaseVestingAccount != nil {\n\t\tvalue := protoreflect.ValueOfMessage(x.BaseVestingAccount.ProtoReflect())\n\t\tif !f(fd_ContinuousVestingAccount_base_vesting_account, value) {\n\t\t\treturn\n\t\t}\n\t}\n\tif x.StartTime != int64(0) {\n\t\tvalue := protoreflect.ValueOfInt64(x.StartTime)\n\t\tif !f(fd_ContinuousVestingAccount_start_time, value) {\n\t\t\treturn\n\t\t}\n\t}\n}", "title": "" }, { "docid": "b9483287e6e092589f9b6eb8c924c828", "score": "0.40308473", "text": "func (o *IpamPrefixesListParams) SetDepthGt(depthGt *string) {\n\to.DepthGt = depthGt\n}", "title": "" }, { "docid": "e53a05699698039ace7fa38017a4559f", "score": "0.40257242", "text": "func (_this *ShaderPrecisionFormat) RangeMax() int {\n\tvar ret int\n\tvalue := _this.Value_JS.Get(\"rangeMax\")\n\tret = (value).Int()\n\treturn ret\n}", "title": "" }, { "docid": "6c2e893ddecd5b1308afffcf0a6c8ba2", "score": "0.4002621", "text": "func FloatRangeStep(start float64, end float64, step float64) Domain[float64] {\n\trangeLength := int(math.Ceil((end - start) / step))\n\tdomain := make(Domain[float64], rangeLength, rangeLength)\n\tfor i := int(0); i < rangeLength; i++ {\n\t\tdomain[i] = float64(i)*step + start\n\t}\n\treturn domain\n}", "title": "" }, { "docid": "e13cdc8ee9bdf8bb21542c87152ff3e4", "score": "0.4001575", "text": "func NewRange(low float64, high float64) *_Range {\n\t_result := &_Range{\n\t\tLow: low,\n\t\tHigh: high,\n\t\t_ExtensionObjectDefinition: NewExtensionObjectDefinition(),\n\t}\n\t_result._ExtensionObjectDefinition._ExtensionObjectDefinitionChildRequirements = _result\n\treturn _result\n}", "title": "" }, { "docid": "c8d15ca7da5c89b817e7e3afeb671144", "score": "0.39985496", "text": "func (x *fastReflection_QueryParamsResponse) Range(f func(protoreflect.FieldDescriptor, protoreflect.Value) bool) {\n\tif x.Params != nil {\n\t\tvalue := protoreflect.ValueOfMessage(x.Params.ProtoReflect())\n\t\tif !f(fd_QueryParamsResponse_params, value) {\n\t\t\treturn\n\t\t}\n\t}\n}", "title": "" }, { "docid": "2b5f38dd3723c60d2f557119f2ce2582", "score": "0.3995426", "text": "func (bl *BeeLogger) SetLogFuncCallDepth(d int) {\n\tbl.loggerFuncCallDepth = d\n}", "title": "" }, { "docid": "65d89ec1a40c3f1f6298493d6564756f", "score": "0.3994437", "text": "func (x *fastReflection_MsgCreateBatchResponse) Range(f func(protoreflect.FieldDescriptor, protoreflect.Value) bool) {\n\tif x.BatchDenom != \"\" {\n\t\tvalue := protoreflect.ValueOfString(x.BatchDenom)\n\t\tif !f(fd_MsgCreateBatchResponse_batch_denom, value) {\n\t\t\treturn\n\t\t}\n\t}\n}", "title": "" }, { "docid": "b9cbee7ac01fec33500d7343293c0fec", "score": "0.39927962", "text": "func Range(value float64) *SimpleElement {\n\treturn newSEFloat(\"range\", value)\n}", "title": "" }, { "docid": "9707621012a8ada2355c92fef7817955", "score": "0.3992467", "text": "func (b *bptLightPath) Densities(totalLight float64, maxDepth, maxLightDepth int, f func(float64)) {\n\tif maxLightDepth == 0 {\n\t\tmaxLightDepth = maxDepth\n\t}\n\n\tsourceDensityProduct := 1.0\n\tfor i := len(b.Points) - 1; i > 0; i-- {\n\t\tp := b.Points[i]\n\t\tp.Accumulator = sourceDensityProduct\n\t\tsourceDensityProduct *= p.SourceDensity\n\t}\n\n\t// Density of doing a regular backward path trace.\n\tif len(b.Points) <= maxDepth {\n\t\tf(sourceDensityProduct)\n\t}\n\n\toutArea := func(i1, i2 int) float64 {\n\t\tdiff := b.Points[i1].Point.Sub(b.Points[i2].Point)\n\t\treturn 4 * math.Pi * diff.Dot(diff)\n\t}\n\tcosIn := func(i int) float64 {\n\t\treturn b.Points[i].SourceDot()\n\t}\n\tcosOut := func(i int) float64 {\n\t\treturn b.Points[i].DestDot()\n\t}\n\n\tif len(b.Points) > 1 {\n\t\tlightDensity := b.Points[0].Emission.Sum() / totalLight\n\n\t\t// Density of selecting the point on the light and\n\t\t// connecting it to an eye path.\n\t\tif len(b.Points)-1 <= maxDepth {\n\t\t\tf(lightDensity * b.Points[1].Accumulator * outArea(0, 1) / cosOut(0))\n\t\t}\n\n\t\t// Densities of starting a path on the light and\n\t\t// connecting it to the eye path.\n\t\tfor i, p := range b.Points[2:] {\n\t\t\tif i+1 >= maxLightDepth {\n\t\t\t\tbreak\n\t\t\t}\n\t\t\tlightDensity *= b.Points[i].DestDensity\n\t\t\tlightDensity *= cosIn(i+1) / cosOut(i)\n\t\t\tif len(b.Points)-(i+2) <= maxDepth {\n\t\t\t\tf(p.Accumulator * lightDensity * outArea(i+1, i+2) / cosOut(i+1))\n\t\t\t}\n\t\t}\n\t}\n}", "title": "" }, { "docid": "d66a58a1f7304c4ee7d1cfceaaee57a6", "score": "0.39879018", "text": "func (r *VAORenderable) RenderDepth(depthShader *shaders.DepthShader) {\n\tgl.BindVertexArray(r.vao)\n\tdepthShader.Model.Set(r.getModelMatrix())\n\tfor _, p := range r.portions {\n\t\tdepthShader.Diffuse.Set(gl.TEXTURE0, 0, p.diffuse)\n\t\tgl.DrawArrays(r.renderStyle, p.startIndex, p.numIndex)\n\t}\n}", "title": "" }, { "docid": "8161bc1eff84e5fba2b9459afa6709e1", "score": "0.39825895", "text": "func (tree *RankTree) Range(start, end int) []string {\n\treturn tree.rangeBasic(start, end, false)\n}", "title": "" }, { "docid": "6a3d725660019f24c64481a53605dfd0", "score": "0.398003", "text": "func (x *fastReflection_Validator) Range(f func(protoreflect.FieldDescriptor, protoreflect.Value) bool) {\n\tif x.Address != \"\" {\n\t\tvalue := protoreflect.ValueOfString(x.Address)\n\t\tif !f(fd_Validator_address, value) {\n\t\t\treturn\n\t\t}\n\t}\n\tif x.PubKey != nil {\n\t\tvalue := protoreflect.ValueOfMessage(x.PubKey.ProtoReflect())\n\t\tif !f(fd_Validator_pub_key, value) {\n\t\t\treturn\n\t\t}\n\t}\n\tif x.VotingPower != int64(0) {\n\t\tvalue := protoreflect.ValueOfInt64(x.VotingPower)\n\t\tif !f(fd_Validator_voting_power, value) {\n\t\t\treturn\n\t\t}\n\t}\n\tif x.ProposerPriority != int64(0) {\n\t\tvalue := protoreflect.ValueOfInt64(x.ProposerPriority)\n\t\tif !f(fd_Validator_proposer_priority, value) {\n\t\t\treturn\n\t\t}\n\t}\n}", "title": "" }, { "docid": "2e102be0ec3830460792e6c870064fff", "score": "0.39781162", "text": "func (x *fastReflection_Module) Range(f func(protoreflect.FieldDescriptor, protoreflect.Value) bool) {\n\tif x.Path != \"\" {\n\t\tvalue := protoreflect.ValueOfString(x.Path)\n\t\tif !f(fd_Module_path, value) {\n\t\t\treturn\n\t\t}\n\t}\n\tif x.Version != \"\" {\n\t\tvalue := protoreflect.ValueOfString(x.Version)\n\t\tif !f(fd_Module_version, value) {\n\t\t\treturn\n\t\t}\n\t}\n\tif x.Sum != \"\" {\n\t\tvalue := protoreflect.ValueOfString(x.Sum)\n\t\tif !f(fd_Module_sum, value) {\n\t\t\treturn\n\t\t}\n\t}\n}", "title": "" }, { "docid": "e23830c08d7da018b56abee0aa4a1aeb", "score": "0.39774", "text": "func Float32Range(min, max float32) gopter.Gen {\n\td := max - min\n\tif d < 0 || d > math.MaxFloat32 {\n\t\treturn Fail(reflect.TypeOf(float32(0)))\n\t}\n\treturn func(genParams *gopter.GenParameters) *gopter.GenResult {\n\t\tgenResult := gopter.NewGenResult(min+genParams.Rng.Float32()*d, Float32Shrinker)\n\t\tgenResult.Sieve = func(v interface{}) bool {\n\t\t\treturn v.(float32) >= min && v.(float32) <= max\n\t\t}\n\t\treturn genResult\n\t}\n}", "title": "" }, { "docid": "e15bcad3ab4762a4722a1730a684e468", "score": "0.39700517", "text": "func (x *fastReflection_QueryCommunityPoolRequest) Range(f func(protoreflect.FieldDescriptor, protoreflect.Value) bool) {\n}", "title": "" }, { "docid": "51ed47529b5a60162c149c11305d6a95", "score": "0.39628968", "text": "func (f ArtistFilter) Range(min, max string) (exp Filter) {\n\treturn Filter{\n\t\texpression: \"artist >= ? AND artist <= ?\",\n\t\targs: []interface{}{min, max},\n\t}\n}", "title": "" }, { "docid": "26ec6f0a9ac9f5b4e0d7d7246fdaf074", "score": "0.39608067", "text": "func Debugf(ft string, v ...interface{}) {\n\tif lvl <= ld {\n\t\tlogf(out, px, \"debug\", ft, v...)\n\t}\n}", "title": "" }, { "docid": "828e0650f6f82b8c8734878ee511e7a9", "score": "0.3960716", "text": "func RecursionDepth(d int) Option {\n\treturn func(c *Config) {\n\t\tc.recursionDepth = d\n\t}\n}", "title": "" }, { "docid": "195196b6fcb215aca0dc0f22033ca745", "score": "0.39605463", "text": "func (l *Logger) Debugf(format string, args ...interface{}) {\n\tfor _, s := range l.sinks {\n\t\ts.DebugDepth(l.depth+2, fmt.Sprintf(format, args...))\n\t}\n}", "title": "" }, { "docid": "167a94a09eb9d164a5b3b3b5264208c2", "score": "0.39488018", "text": "func SetupRangeTree(batch engine.Engine, ms *engine.MVCCStats, timestamp proto.Timestamp, startKey proto.Key) error {\n\ttree := &proto.RangeTree{\n\t\tRootKey: startKey,\n\t}\n\tnode := &proto.RangeTreeNode{\n\t\tKey: startKey,\n\t\tBlack: true,\n\t}\n\tif err := engine.MVCCPutProto(batch, ms, engine.KeyRangeTreeRoot, timestamp, nil, tree); err != nil {\n\t\treturn err\n\t}\n\tif err := engine.MVCCPutProto(batch, ms, engine.RangeTreeNodeKey(startKey), timestamp, nil, node); err != nil {\n\t\treturn err\n\t}\n\treturn nil\n}", "title": "" }, { "docid": "627730c5a25bff513baff4872d9acdef", "score": "0.39485615", "text": "func SetupRangeTree(batch engine.Engine, ms *engine.MVCCStats,\n\ttimestamp proto.Timestamp, startKey proto.Key) error {\n\n\ttree := &proto.RangeTree{\n\t\tRootKey: startKey,\n\t}\n\n\tnode := &proto.RangeTreeNode{\n\t\tKey: startKey,\n\t\tBlack: true,\n\t}\n\n\tif err := engine.MVCCPutProto(batch, ms, engine.RangeTreeNodeKey(startKey), timestamp, nil, node); err != nil {\n\t\treturn err\n\t}\n\n\tif err := engine.MVCCPutProto(batch, ms, engine.KeyRangeTreeRoot, timestamp, nil, tree); err != nil {\n\t\treturn err\n\t}\n\n\treturn nil\n}", "title": "" }, { "docid": "6557df62091b9a94b5c08aec6bf79bd3", "score": "0.3947954", "text": "func Float64Range(min, max float64) float64 {\n\treturn float64Range(globalFaker.Rand, min, max)\n}", "title": "" }, { "docid": "aee242f6e0941d0ebb6a42db291d7d29", "score": "0.3942166", "text": "func (l *logger) PrintfCtxDepth(ctx context.Context, depth int, f string, args ...interface{}) {\n\tmsg := crdblog.FormatWithContextTags(ctx, f, args...)\n\tif err := l.stdoutL.Output(depth+1, msg); err != nil {\n\t\t// Changing our interface to return an Error from a logging method seems too\n\t\t// onerous. Let's yell to the default logger and if that fails, oh well.\n\t\t_ = log.Output(depth+1, fmt.Sprintf(\"failed to log message: %v: %s\", err, msg))\n\t}\n}", "title": "" }, { "docid": "523759c5d7d9ab4bddc15968b6c6177e", "score": "0.39417586", "text": "func Range(low, high, n int, f pargo.RangeFunc) {\n\tvar recur func(int, int, int)\n\trecur = func(low, high, n int) {\n\t\tswitch {\n\t\tcase n == 1:\n\t\t\tf(low, high)\n\t\tcase n > 1:\n\t\t\tbatchSize := ((high - low - 1) / n) + 1\n\t\t\thalf := n / 2\n\t\t\tmid := low + batchSize*half\n\t\t\tif mid >= high {\n\t\t\t\tf(low, high)\n\t\t\t} else {\n\t\t\t\tvar p interface{}\n\t\t\t\tvar wg sync.WaitGroup\n\t\t\t\twg.Add(1)\n\t\t\t\tgo func() {\n\t\t\t\t\tdefer func() {\n\t\t\t\t\t\twg.Done()\n\t\t\t\t\t\tp = recover()\n\t\t\t\t\t}()\n\t\t\t\t\trecur(mid, high, n-half)\n\t\t\t\t}()\n\t\t\t\trecur(low, mid, half)\n\t\t\t\twg.Wait()\n\t\t\t\tif p != nil {\n\t\t\t\t\tpanic(p)\n\t\t\t\t}\n\t\t\t}\n\t\tdefault:\n\t\t\tpanic(fmt.Sprintf(\"invalid number of batches: %v\", n))\n\t\t}\n\t}\n\trecur(low, high, internal.ComputeNofBatches(low, high, n))\n}", "title": "" }, { "docid": "aeb1b67e54838cfc8a94754b63765e38", "score": "0.39406052", "text": "func InitRenderer() {\n\tgl.Enable(gl.DEPTH_TEST)\n\tgl.DepthFunc(gl.LESS)\n\tgl.Enable(gl.MULTISAMPLE)\n\tgl.Enable(gl.BLEND)\n\tgl.BlendFunc(gl.SRC_ALPHA, gl.ONE_MINUS_SRC_ALPHA)\n\tgl.DepthMask(true)\n\tgl.PointSize(8.0)\n\tgl.ClearColor(0.0, 0.0, 0.0, 1.0)\n\tgl.CullFace(gl.BACK)\n\tgl.PolygonOffset(2.5, 1.0)\n\n\tls, err := shaders.NewLineShader()\n\tif err != nil {\n\t\tlog.Fatalf(\"Failed to compile LineShader: %v\", err)\n\t}\n\n\tds, err := shaders.NewDepthShader()\n\tif err != nil {\n\t\tlog.Fatalf(\"Failed to compile DepthShader: %v\", err)\n\t}\n\n\tlcs, err := shaders.NewLightCullingShader()\n\tif err != nil {\n\t\tlog.Fatalf(\"Failed to compile LightCullingShader: %v\", err)\n\t}\n\n\tcs, err := shaders.NewColorShader()\n\tif err != nil {\n\t\tlog.Fatalf(\"Failed to compile ColorShader: %v\", err)\n\t}\n\n\tvar depthMapFBO uint32\n\tgl.GenFramebuffers(1, &depthMapFBO)\n\tvar depthMap uint32\n\tgl.GenTextures(1, &depthMap)\n\tgl.BindTexture(gl.TEXTURE_2D, depthMap)\n\tgl.TexImage2D(gl.TEXTURE_2D, 0, gl.DEPTH_COMPONENT, int32(Window.Width), int32(Window.Height), 0, gl.DEPTH_COMPONENT, gl.FLOAT, nil)\n\tgl.TexParameteri(gl.TEXTURE_2D, gl.TEXTURE_MIN_FILTER, gl.NEAREST)\n\tgl.TexParameteri(gl.TEXTURE_2D, gl.TEXTURE_MAG_FILTER, gl.NEAREST)\n\tgl.TexParameteri(gl.TEXTURE_2D, gl.TEXTURE_WRAP_S, gl.CLAMP_TO_BORDER)\n\tgl.TexParameteri(gl.TEXTURE_2D, gl.TEXTURE_WRAP_T, gl.CLAMP_TO_BORDER)\n\tborderColor := []float32{1.0, 1.0, 1.0, 1.0}\n\tgl.TexParameterfv(gl.TEXTURE_2D, gl.TEXTURE_BORDER_COLOR, &borderColor[0])\n\tgl.BindFramebuffer(gl.FRAMEBUFFER, depthMapFBO)\n\tgl.FramebufferTexture2D(gl.FRAMEBUFFER, gl.DEPTH_ATTACHMENT, gl.TEXTURE_2D, depthMap, 0)\n\tgl.DrawBuffer(gl.NONE)\n\tgl.ReadBuffer(gl.NONE)\n\tgl.BindFramebuffer(gl.FRAMEBUFFER, 0)\n\n\t// Build CSM Depth FrameBuffers\n\tvar csmDepthMapFBO uint32\n\tgl.GenFramebuffers(1, &csmDepthMapFBO)\n\tvar csmDepthMaps [NumberOfCascades]uint32\n\tgl.GenTextures(NumberOfCascades, &csmDepthMaps[0])\n\n\tfor _, m := range csmDepthMaps {\n\t\tgl.BindTexture(gl.TEXTURE_2D, m)\n\t\tgl.TexImage2D(gl.TEXTURE_2D, 0, gl.DEPTH_COMPONENT32F, shadowMapSize, shadowMapSize, 0, gl.DEPTH_COMPONENT, gl.FLOAT, nil)\n\t\tgl.TexParameteri(gl.TEXTURE_2D, gl.TEXTURE_MIN_FILTER, gl.NEAREST)\n\t\tgl.TexParameteri(gl.TEXTURE_2D, gl.TEXTURE_MAG_FILTER, gl.NEAREST)\n\t\tgl.TexParameteri(gl.TEXTURE_2D, gl.TEXTURE_WRAP_S, gl.CLAMP_TO_BORDER)\n\t\tgl.TexParameteri(gl.TEXTURE_2D, gl.TEXTURE_WRAP_T, gl.CLAMP_TO_BORDER)\n\t}\n\n\tgl.BindFramebuffer(gl.FRAMEBUFFER, csmDepthMapFBO)\n\tgl.FramebufferTexture2D(gl.FRAMEBUFFER, gl.DEPTH_ATTACHMENT, gl.TEXTURE_2D, csmDepthMaps[0], 0)\n\tgl.DrawBuffer(gl.NONE)\n\tgl.ReadBuffer(gl.NONE)\n\tgl.BindFramebuffer(gl.FRAMEBUFFER, 0)\n\n\tUpdatePip(&csmDepthMaps[0], Window.GetNearFar(0))\n\n\tRenderer = r{\n\t\tlineShader: ls,\n\t\tdepthShader: ds,\n\t\tlightCullingShader: lcs,\n\t\tcolorShader: cs,\n\t\tdepthMapFBO: depthMapFBO,\n\t\tdepthMap: depthMap,\n\t\tcsmDepthMapFBO: csmDepthMapFBO,\n\t\tcsmDepthMaps: csmDepthMaps,\n\t}\n\n\tmessagebus.RegisterType(\"key\", func(m *messagebus.Message) {\n\t\tpressedKeys := m.Data1.([]glfw.Key)\n\t\tfor _, key := range pressedKeys {\n\t\t\tif key >= glfw.KeyF1 && key <= glfw.KeyF25 {\n\t\t\t\tcs.RenderMode.Set(int32(key - glfw.KeyF1))\n\t\t\t}\n\t\t\tswitch key {\n\t\t\tcase glfw.KeyPageUp:\n\t\t\t\tUpdateDirectionalLight(func(dL DirectionalLight) DirectionalLight {\n\t\t\t\t\tm := mgl32.Rotate3DZ(.01)\n\t\t\t\t\tdL.Direction = m.Mul3x1(dL.Direction)\n\t\t\t\t\treturn dL\n\t\t\t\t})\n\t\t\tcase glfw.KeyPageDown:\n\t\t\t\tUpdateDirectionalLight(func(dL DirectionalLight) DirectionalLight {\n\t\t\t\t\tm := mgl32.Rotate3DZ(-.01)\n\t\t\t\t\tdL.Direction = m.Mul3x1(dL.Direction)\n\t\t\t\t\treturn dL\n\t\t\t\t})\n\t\t\t}\n\t\t}\n\t\tpressedKeysThisFrame := m.Data2.([]glfw.Key)\n\t\tfor _, key := range pressedKeysThisFrame {\n\t\t\tswitch key {\n\t\t\tcase glfw.KeyKP7:\n\t\t\t\tUpdatePip(&csmDepthMaps[0], Window.GetNearFar(0))\n\t\t\tcase glfw.KeyKP8:\n\t\t\t\tUpdatePip(&csmDepthMaps[1], Window.GetNearFar(1))\n\t\t\tcase glfw.KeyKP9:\n\t\t\t\tUpdatePip(&csmDepthMaps[2], Window.GetNearFar(2))\n\t\t\tcase glfw.KeyKPDivide:\n\t\t\t\tUpdatePip(&csmDepthMaps[3], Window.GetNearFar(3))\n\t\t\tcase glfw.KeyPrintScreen:\n\t\t\t\tScreenshot()\n\t\t\tcase glfw.KeyL:\n\t\t\t\tAddPointLight(ActiveCamera.GetPosition().Add(ActiveCamera.GetForward().Mul(10)), whiteColor, 1.0, 30.0)\n\t\t\t}\n\t\t}\n\t})\n}", "title": "" }, { "docid": "46f0b6503f6bc8b8f458af34f4689e34", "score": "0.39382416", "text": "func NewRange(min, max float64) *Range {\n\tr := new(Range)\n\tr.VMin, r.VMax = min, max\n\treturn r\n}", "title": "" }, { "docid": "4065ec7c7062c09c80424bd8ab80a22e", "score": "0.39374396", "text": "func (s *ArcAxisConfiguration) SetRange(v *ArcAxisDisplayRange) *ArcAxisConfiguration {\n\ts.Range = v\n\treturn s\n}", "title": "" }, { "docid": "05ee10be9bde7ad7e02cc9fb77061c00", "score": "0.39317948", "text": "func CmdSetDepthBias(commandBuffer CommandBuffer, depthBiasConstantFactor float32, depthBiasClamp float32, depthBiasSlopeFactor float32) {\n\tccommandBuffer, _ := *(*C.VkCommandBuffer)(unsafe.Pointer(&commandBuffer)), cgoAllocsUnknown\n\tcdepthBiasConstantFactor, _ := (C.float)(depthBiasConstantFactor), cgoAllocsUnknown\n\tcdepthBiasClamp, _ := (C.float)(depthBiasClamp), cgoAllocsUnknown\n\tcdepthBiasSlopeFactor, _ := (C.float)(depthBiasSlopeFactor), cgoAllocsUnknown\n\tC.callVkCmdSetDepthBias(ccommandBuffer, cdepthBiasConstantFactor, cdepthBiasClamp, cdepthBiasSlopeFactor)\n}", "title": "" }, { "docid": "4c73968f43df27ab08bfa29ac825f46c", "score": "0.39288062", "text": "func (x *fastReflection_MsgRegisterResolver) Range(f func(protoreflect.FieldDescriptor, protoreflect.Value) bool) {\n\tif x.Manager != \"\" {\n\t\tvalue := protoreflect.ValueOfString(x.Manager)\n\t\tif !f(fd_MsgRegisterResolver_manager, value) {\n\t\t\treturn\n\t\t}\n\t}\n\tif x.ResolverId != uint64(0) {\n\t\tvalue := protoreflect.ValueOfUint64(x.ResolverId)\n\t\tif !f(fd_MsgRegisterResolver_resolver_id, value) {\n\t\t\treturn\n\t\t}\n\t}\n\tif len(x.ContentHashes) != 0 {\n\t\tvalue := protoreflect.ValueOfList(&_MsgRegisterResolver_3_list{list: &x.ContentHashes})\n\t\tif !f(fd_MsgRegisterResolver_content_hashes, value) {\n\t\t\treturn\n\t\t}\n\t}\n}", "title": "" }, { "docid": "aa0c494b5a8ac5af09869b682f696c37", "score": "0.39111787", "text": "func (x *fastReflection_QueryValidatorSlashesRequest) Range(f func(protoreflect.FieldDescriptor, protoreflect.Value) bool) {\n\tif x.ValidatorAddress != \"\" {\n\t\tvalue := protoreflect.ValueOfString(x.ValidatorAddress)\n\t\tif !f(fd_QueryValidatorSlashesRequest_validator_address, value) {\n\t\t\treturn\n\t\t}\n\t}\n\tif x.StartingHeight != uint64(0) {\n\t\tvalue := protoreflect.ValueOfUint64(x.StartingHeight)\n\t\tif !f(fd_QueryValidatorSlashesRequest_starting_height, value) {\n\t\t\treturn\n\t\t}\n\t}\n\tif x.EndingHeight != uint64(0) {\n\t\tvalue := protoreflect.ValueOfUint64(x.EndingHeight)\n\t\tif !f(fd_QueryValidatorSlashesRequest_ending_height, value) {\n\t\t\treturn\n\t\t}\n\t}\n\tif x.Pagination != nil {\n\t\tvalue := protoreflect.ValueOfMessage(x.Pagination.ProtoReflect())\n\t\tif !f(fd_QueryValidatorSlashesRequest_pagination, value) {\n\t\t\treturn\n\t\t}\n\t}\n}", "title": "" }, { "docid": "5a0a2144f59e9599ee65cc10c15354f9", "score": "0.3908792", "text": "func (x *fastReflection_MsgDefineResolverResponse) Range(f func(protoreflect.FieldDescriptor, protoreflect.Value) bool) {\n\tif x.ResolverId != uint64(0) {\n\t\tvalue := protoreflect.ValueOfUint64(x.ResolverId)\n\t\tif !f(fd_MsgDefineResolverResponse_resolver_id, value) {\n\t\t\treturn\n\t\t}\n\t}\n}", "title": "" }, { "docid": "ff5692f250deffd1ba5b60c8440ceedc", "score": "0.39083204", "text": "func (x *fastReflection_Grant) Range(f func(protoreflect.FieldDescriptor, protoreflect.Value) bool) {\n\tif x.Granter != \"\" {\n\t\tvalue := protoreflect.ValueOfString(x.Granter)\n\t\tif !f(fd_Grant_granter, value) {\n\t\t\treturn\n\t\t}\n\t}\n\tif x.Grantee != \"\" {\n\t\tvalue := protoreflect.ValueOfString(x.Grantee)\n\t\tif !f(fd_Grant_grantee, value) {\n\t\t\treturn\n\t\t}\n\t}\n\tif x.Allowance != nil {\n\t\tvalue := protoreflect.ValueOfMessage(x.Allowance.ProtoReflect())\n\t\tif !f(fd_Grant_allowance, value) {\n\t\t\treturn\n\t\t}\n\t}\n}", "title": "" }, { "docid": "62217efbbd1c7197cea1945f9181b454", "score": "0.39083084", "text": "func (x *fastReflection_WithAMap) Range(f func(protoreflect.FieldDescriptor, protoreflect.Value) bool) {\n\tif len(x.StrMap) != 0 {\n\t\tvalue := protoreflect.ValueOfMap(&_WithAMap_1_map{m: &x.StrMap})\n\t\tif !f(fd_WithAMap_str_map, value) {\n\t\t\treturn\n\t\t}\n\t}\n}", "title": "" }, { "docid": "1e2b76953808fd5d86bc881fb4516958", "score": "0.39063975", "text": "func fsyncRange(fd int, how int, start int64, length int64) (err error) {\n\t_, _, e1 := syscall6(uintptr(unsafe.Pointer(&libc_fsync_range)), 4, uintptr(fd), uintptr(how), uintptr(start), uintptr(length), 0, 0)\n\tif e1 != 0 {\n\t\terr = errnoErr(e1)\n\t}\n\treturn\n}", "title": "" }, { "docid": "4eab93b2ba2e6dd7e6af20b8ab04c24c", "score": "0.39023516", "text": "func NewZoomRange(zoomBegin uint, zoomEndInclusive uint) Generator {\n\treturn &zoomRangeState{\n\t\tnext: coord.Coord{Z: zoomBegin, X: 0, Y: 0},\n\t\tend: zoomEndInclusive,\n\t\tcurZoomRange: dimRange(zoomBegin),\n\t}\n}", "title": "" }, { "docid": "a106fa4c399ed35426544b2315218388", "score": "0.3887415", "text": "func (w *Progress) UpdateRange() {\n\t// Fill in a default range if none has been specified.\n\tif w.Min == 0 && w.Max == 0 {\n\t\tw.Max = 100\n\t}\n}", "title": "" }, { "docid": "5ce4fac60f6e6ee49d88aa1222380dc1", "score": "0.3884953", "text": "func (x *fastReflection_QueryDelegatorValidatorsRequest) Range(f func(protoreflect.FieldDescriptor, protoreflect.Value) bool) {\n\tif x.DelegatorAddress != \"\" {\n\t\tvalue := protoreflect.ValueOfString(x.DelegatorAddress)\n\t\tif !f(fd_QueryDelegatorValidatorsRequest_delegator_address, value) {\n\t\t\treturn\n\t\t}\n\t}\n}", "title": "" }, { "docid": "5d298e45d7a3a22e42d5f75ef957547e", "score": "0.38774323", "text": "func (x *fastReflection_QueryValidatorDistributionInfoRequest) Range(f func(protoreflect.FieldDescriptor, protoreflect.Value) bool) {\n\tif x.ValidatorAddress != \"\" {\n\t\tvalue := protoreflect.ValueOfString(x.ValidatorAddress)\n\t\tif !f(fd_QueryValidatorDistributionInfoRequest_validator_address, value) {\n\t\t\treturn\n\t\t}\n\t}\n}", "title": "" }, { "docid": "e532c8ee0515b4764cb112406bcaa321", "score": "0.38729241", "text": "func (self *TraitRange) SetRange(min float64, max float64) {\n\tC.gtk_range_set_range(self.CPointer, C.gdouble(min), C.gdouble(max))\n\treturn\n}", "title": "" }, { "docid": "9a4052ef2b9e3547a8d2a89c4adbaaf5", "score": "0.3870822", "text": "func (d *Device) GetDepthScale() (float32, error) {\n\tvar err *C.rs_error\n\ts := (float32)(C.rs_get_device_depth_scale((*C.rs_device)(d), &err))\n\tif err != nil {\n\t\treturn 0.0, errorFrom(err)\n\t}\n\treturn s, nil\n}", "title": "" }, { "docid": "afb4c7b42a85f4d9c96bc615283e977c", "score": "0.38701588", "text": "func Debugf(format string, v ...interface{}) {\n\tif lvl > LogLevelDebug {\n\t\treturn\n\t}\n\td(format, v...)\n}", "title": "" }, { "docid": "1df54747cc1c168f76d457e5492f6aba", "score": "0.38678882", "text": "func WithFieldDepth(f Fields, depth int) Logger {\n\treturn callerInfo(depth).WithFields(logrus.Fields(f))\n}", "title": "" }, { "docid": "b633ca2cf7852991819d1be027aaa14d", "score": "0.38675842", "text": "func (x *fastReflection_NestedMessage) Range(f func(protoreflect.FieldDescriptor, protoreflect.Value) bool) {\n\tif x.Foo != \"\" {\n\t\tvalue := protoreflect.ValueOfString(x.Foo)\n\t\tif !f(fd_NestedMessage_foo, value) {\n\t\t\treturn\n\t\t}\n\t}\n\tif x.Bar != int32(0) {\n\t\tvalue := protoreflect.ValueOfInt32(x.Bar)\n\t\tif !f(fd_NestedMessage_bar, value) {\n\t\t\treturn\n\t\t}\n\t}\n}", "title": "" }, { "docid": "301b297092bd83dcd7cd0a98d1c5bc64", "score": "0.38666922", "text": "func UintRange() *UintRangeFilter {\r\n\tf := new(UintRangeFilter)\r\n\r\n\tf.defaultLeftVal = 0\r\n\tf.defaultRightVal = types.MaxUint\r\n\r\n\treturn f\r\n}", "title": "" }, { "docid": "6c8ffa763af9b96228e066082ad4e8d7", "score": "0.38644704", "text": "func MaxDepth(depth int) func(*Collector) {\n\treturn func(c *Collector) {\n\t\tc.MaxDepth = depth\n\t}\n}", "title": "" }, { "docid": "03a1c1c0694c04a540adab910cab8c5a", "score": "0.38613158", "text": "func Int64Range() *Int64RangeFilter {\r\n\tf := new(Int64RangeFilter)\r\n\r\n\tf.defaultLeftVal = math.MinInt64\r\n\tf.defaultRightVal = math.MaxInt64\r\n\r\n\treturn f\r\n}", "title": "" }, { "docid": "abcb149f15caff2a3aa86161d0e5f0cd", "score": "0.38596278", "text": "func (x *fastReflection_BaseVestingAccount) Range(f func(protoreflect.FieldDescriptor, protoreflect.Value) bool) {\n\tif x.BaseAccount != nil {\n\t\tvalue := protoreflect.ValueOfMessage(x.BaseAccount.ProtoReflect())\n\t\tif !f(fd_BaseVestingAccount_base_account, value) {\n\t\t\treturn\n\t\t}\n\t}\n\tif len(x.OriginalVesting) != 0 {\n\t\tvalue := protoreflect.ValueOfList(&_BaseVestingAccount_2_list{list: &x.OriginalVesting})\n\t\tif !f(fd_BaseVestingAccount_original_vesting, value) {\n\t\t\treturn\n\t\t}\n\t}\n\tif len(x.DelegatedFree) != 0 {\n\t\tvalue := protoreflect.ValueOfList(&_BaseVestingAccount_3_list{list: &x.DelegatedFree})\n\t\tif !f(fd_BaseVestingAccount_delegated_free, value) {\n\t\t\treturn\n\t\t}\n\t}\n\tif len(x.DelegatedVesting) != 0 {\n\t\tvalue := protoreflect.ValueOfList(&_BaseVestingAccount_4_list{list: &x.DelegatedVesting})\n\t\tif !f(fd_BaseVestingAccount_delegated_vesting, value) {\n\t\t\treturn\n\t\t}\n\t}\n\tif x.EndTime != int64(0) {\n\t\tvalue := protoreflect.ValueOfInt64(x.EndTime)\n\t\tif !f(fd_BaseVestingAccount_end_time, value) {\n\t\t\treturn\n\t\t}\n\t}\n}", "title": "" }, { "docid": "3eee886a57e9a17e0d21b62b36e24031", "score": "0.38540846", "text": "func (o *IpamPrefixesListParams) SetDepth(depth *string) {\n\to.Depth = depth\n}", "title": "" }, { "docid": "d19151a11dfcb777aac917ff9b89fc44", "score": "0.3849441", "text": "func (x *fastReflection_GetNodeInfoResponse) Range(f func(protoreflect.FieldDescriptor, protoreflect.Value) bool) {\n\tif x.DefaultNodeInfo != nil {\n\t\tvalue := protoreflect.ValueOfMessage(x.DefaultNodeInfo.ProtoReflect())\n\t\tif !f(fd_GetNodeInfoResponse_default_node_info, value) {\n\t\t\treturn\n\t\t}\n\t}\n\tif x.ApplicationVersion != nil {\n\t\tvalue := protoreflect.ValueOfMessage(x.ApplicationVersion.ProtoReflect())\n\t\tif !f(fd_GetNodeInfoResponse_application_version, value) {\n\t\t\treturn\n\t\t}\n\t}\n}", "title": "" }, { "docid": "53f6e045020569e29da85331529bdb4d", "score": "0.38404632", "text": "func (o FleetObservabilityLoggingConfigPtrOutput) FleetScopeLogsConfig() FleetObservabilityRoutingConfigPtrOutput {\n\treturn o.ApplyT(func(v *FleetObservabilityLoggingConfig) *FleetObservabilityRoutingConfig {\n\t\tif v == nil {\n\t\t\treturn nil\n\t\t}\n\t\treturn v.FleetScopeLogsConfig\n\t}).(FleetObservabilityRoutingConfigPtrOutput)\n}", "title": "" }, { "docid": "2f8c1fb7f0312748854479cc38edb321", "score": "0.38351312", "text": "func (o FleetObservabilityLoggingConfigOutput) FleetScopeLogsConfig() FleetObservabilityRoutingConfigPtrOutput {\n\treturn o.ApplyT(func(v FleetObservabilityLoggingConfig) *FleetObservabilityRoutingConfig {\n\t\treturn v.FleetScopeLogsConfig\n\t}).(FleetObservabilityRoutingConfigPtrOutput)\n}", "title": "" } ]
a089dab796ef913efb0b9006ac1be7db
ClearUpdatedBy clears the value of the "updated_by" field.
[ { "docid": "78cb9e103fda07a87cd8b7ea38658aba", "score": "0.726187", "text": "func (u *VehicleModelUpsertBulk) ClearUpdatedBy() *VehicleModelUpsertBulk {\n\treturn u.Update(func(s *VehicleModelUpsert) {\n\t\ts.ClearUpdatedBy()\n\t})\n}", "title": "" } ]
[ { "docid": "be75cc7b04c92550e1350d4bc587b030", "score": "0.81375813", "text": "func (u *VehicleModelUpsert) ClearUpdatedBy() *VehicleModelUpsert {\n\tu.SetNull(vehiclemodel.FieldUpdatedBy)\n\treturn u\n}", "title": "" }, { "docid": "2f3d8342fc88a614374f3fda8f5b4486", "score": "0.79794705", "text": "func (u *MetadataUpsert) ClearUpdatedBy() *MetadataUpsert {\n\tu.SetNull(metadata.FieldUpdatedBy)\n\treturn u\n}", "title": "" }, { "docid": "2dc128b6189831d75aa4ba36f325524d", "score": "0.7584569", "text": "func (u *MetadataUpsertOne) ClearUpdatedBy() *MetadataUpsertOne {\n\treturn u.Update(func(s *MetadataUpsert) {\n\t\ts.ClearUpdatedBy()\n\t})\n}", "title": "" }, { "docid": "c4567ce143e13b8ef6842bd124d8ba68", "score": "0.75734013", "text": "func (u *RaceUpsert) ClearUpdatedBy() *RaceUpsert {\n\tu.SetNull(race.FieldUpdatedBy)\n\treturn u\n}", "title": "" }, { "docid": "f9fb029523761593a99c3f3f2b66e36e", "score": "0.74048245", "text": "func (u *VehicleModelUpsertOne) ClearUpdatedBy() *VehicleModelUpsertOne {\n\treturn u.Update(func(s *VehicleModelUpsert) {\n\t\ts.ClearUpdatedBy()\n\t})\n}", "title": "" }, { "docid": "975254bd5cacfccb7e4a348f0f966db3", "score": "0.73786265", "text": "func (u *MetadataUpsertBulk) ClearUpdatedBy() *MetadataUpsertBulk {\n\treturn u.Update(func(s *MetadataUpsert) {\n\t\ts.ClearUpdatedBy()\n\t})\n}", "title": "" }, { "docid": "0a0a3571ea36586629d774de2b0860f2", "score": "0.7283235", "text": "func (vcuo *VehicleClassUpdateOne) ClearUpdatedBy() *VehicleClassUpdateOne {\n\tvcuo.mutation.ClearUpdatedBy()\n\treturn vcuo\n}", "title": "" }, { "docid": "07c0c0af66ad6c27595a9e2b9b02a5de", "score": "0.7158222", "text": "func (vcu *VehicleClassUpdate) ClearUpdatedBy() *VehicleClassUpdate {\n\tvcu.mutation.ClearUpdatedBy()\n\treturn vcu\n}", "title": "" }, { "docid": "c15fcaf113776614822f7b98184aa0bd", "score": "0.71062887", "text": "func (u *RaceUpsertOne) ClearUpdatedBy() *RaceUpsertOne {\n\treturn u.Update(func(s *RaceUpsert) {\n\t\ts.ClearUpdatedBy()\n\t})\n}", "title": "" }, { "docid": "ba0f2677364c95a902582c0367e68625", "score": "0.70121", "text": "func (u *RaceUpsertBulk) ClearUpdatedBy() *RaceUpsertBulk {\n\treturn u.Update(func(s *RaceUpsert) {\n\t\ts.ClearUpdatedBy()\n\t})\n}", "title": "" }, { "docid": "739d2ca2b6b5f7b8328528d078571477", "score": "0.6953194", "text": "func (piu *PlayerIdentifierUpdate) ClearUpdatedBy() *PlayerIdentifierUpdate {\n\tpiu.mutation.ClearUpdatedBy()\n\treturn piu\n}", "title": "" }, { "docid": "cec9222946cf4937c691548cff4e5dd9", "score": "0.6916893", "text": "func (piuo *PlayerIdentifierUpdateOne) ClearUpdatedBy() *PlayerIdentifierUpdateOne {\n\tpiuo.mutation.ClearUpdatedBy()\n\treturn piuo\n}", "title": "" }, { "docid": "54020cb9285cf7d40d7d4b4784380fc0", "score": "0.66545475", "text": "func (m *gerritListener) SetUpdatedBy(val string) {\n\tm.updatedByField = val\n}", "title": "" }, { "docid": "0e4deac77169b1786bfcc47ab8e29efa", "score": "0.65344584", "text": "func (s *Secret) SetUpdatedBy(v string) {\n\t// return if Secret type is nil\n\tif s == nil {\n\t\treturn\n\t}\n\n\ts.UpdatedBy = &v\n}", "title": "" }, { "docid": "3b4809a7ae50eaefb9eabf452ddf92b5", "score": "0.6364634", "text": "func (m *UserMutation) ClearUpdatedAt() {\n\tm.updated_at = nil\n\tm.clearedFields[user.FieldUpdatedAt] = struct{}{}\n}", "title": "" }, { "docid": "3b0a3339ac0f614eeb0513b97e8fb42b", "score": "0.6353691", "text": "func (u *MetadataUpsert) SetUpdatedBy(v int) *MetadataUpsert {\n\tu.Set(metadata.FieldUpdatedBy, v)\n\treturn u\n}", "title": "" }, { "docid": "70225bfb9c6edfa24ed9e50831b8a07f", "score": "0.63534534", "text": "func (o *ViewAllocation) SetUpdatedBy(v int32) {\n\to.UpdatedBy = &v\n}", "title": "" }, { "docid": "b41c894eeb20a49cd42e4cd078bc232b", "score": "0.6317248", "text": "func (u *VehicleModelUpsert) SetUpdatedBy(v int) *VehicleModelUpsert {\n\tu.Set(vehiclemodel.FieldUpdatedBy, v)\n\treturn u\n}", "title": "" }, { "docid": "b9e6c03aa398bc0ac5b7b65cf889c196", "score": "0.6311953", "text": "func (m *UserActiveRecordMutation) ClearUpdatedAt() {\n\tm.updated_at = nil\n\tm.clearedFields[useractiverecord.FieldUpdatedAt] = struct{}{}\n}", "title": "" }, { "docid": "04a3b370461bfcfa4addc0b2b6d8961c", "score": "0.62484586", "text": "func (vcuo *VehicleClassUpdateOne) SetUpdatedBy(i int) *VehicleClassUpdateOne {\n\tvcuo.mutation.ResetUpdatedBy()\n\tvcuo.mutation.SetUpdatedBy(i)\n\treturn vcuo\n}", "title": "" }, { "docid": "fa46e17b1bb3663821e77a65cf0ba383", "score": "0.62280065", "text": "func (m *CustomerFollowMutation) ClearDeleteBy() {\n\tm.deleteBy = nil\n\tm.clearedFields[customerfollow.FieldDeleteBy] = struct{}{}\n}", "title": "" }, { "docid": "8b2781dd9e23b72852cb62420fe63727", "score": "0.6206293", "text": "func (u FlagSnapshotUpdater) SetUpdatedBy(updatedBy string) FlagSnapshotUpdater {\n\tu.fields[string(FlagSnapshotDBSchema.UpdatedBy)] = updatedBy\n\treturn u\n}", "title": "" }, { "docid": "825046b589daa7a53474cd5afc1f9188", "score": "0.61815375", "text": "func (u *MetadataUpsertOne) SetUpdatedBy(v int) *MetadataUpsertOne {\n\treturn u.Update(func(s *MetadataUpsert) {\n\t\ts.SetUpdatedBy(v)\n\t})\n}", "title": "" }, { "docid": "a6c3dcc2965b9fe92ae67d3b6d561898", "score": "0.61732846", "text": "func (o *EnvironmentResponse) SetLastUpdatedBy(v string) {\n\to.LastUpdatedBy = &v\n}", "title": "" }, { "docid": "74cd3fa7d2e201d4367606758dd48e44", "score": "0.60808593", "text": "func (u *RaceUpsert) SetUpdatedBy(v int) *RaceUpsert {\n\tu.Set(race.FieldUpdatedBy, v)\n\treturn u\n}", "title": "" }, { "docid": "ab4f070d7aa4f7a4c4eb7b696c5c65d9", "score": "0.60709876", "text": "func (u *VehicleModelUpsertOne) SetUpdatedBy(v int) *VehicleModelUpsertOne {\n\treturn u.Update(func(s *VehicleModelUpsert) {\n\t\ts.SetUpdatedBy(v)\n\t})\n}", "title": "" }, { "docid": "a5f18b675aa4fd6b8f6ff467d5c7209b", "score": "0.6070672", "text": "func (s *Secret) GetUpdatedBy() string {\n\t// return zero value if Secret type or UpdatedBy field is nil\n\tif s == nil || s.UpdatedBy == nil {\n\t\treturn \"\"\n\t}\n\n\treturn *s.UpdatedBy\n}", "title": "" }, { "docid": "63e14aceb9d7818284de65e348b48db6", "score": "0.60513574", "text": "func (mc *MetadataCreate) SetUpdatedBy(i int) *MetadataCreate {\n\tmc.mutation.SetUpdatedBy(i)\n\treturn mc\n}", "title": "" }, { "docid": "2177ca04acd56dad533c5189b2859f7d", "score": "0.6045993", "text": "func (vmc *VehicleModelCreate) SetUpdatedBy(i int) *VehicleModelCreate {\n\tvmc.mutation.SetUpdatedBy(i)\n\treturn vmc\n}", "title": "" }, { "docid": "b88c3156c2cbe4aa0225cf32ded9619c", "score": "0.6019794", "text": "func (vcu *VehicleClassUpdate) SetUpdatedBy(i int) *VehicleClassUpdate {\n\tvcu.mutation.ResetUpdatedBy()\n\tvcu.mutation.SetUpdatedBy(i)\n\treturn vcu\n}", "title": "" }, { "docid": "35960ab045bf4bbb6f38a3c5d7470bc2", "score": "0.59446526", "text": "func (m *BouncerMutation) ClearUpdatedAt() {\n\tm.updated_at = nil\n\tm.clearedFields[bouncer.FieldUpdatedAt] = struct{}{}\n}", "title": "" }, { "docid": "dae01222fca9a55970cc5fddbc7bb707", "score": "0.5899058", "text": "func (m *UserMutation) ResetUpdatedAt() {\n\tm.updated_at = nil\n\tdelete(m.clearedFields, user.FieldUpdatedAt)\n}", "title": "" }, { "docid": "f2b6e2147fe0f224455d10e3b047bddd", "score": "0.5885768", "text": "func (u *MetadataUpsertBulk) SetUpdatedBy(v int) *MetadataUpsertBulk {\n\treturn u.Update(func(s *MetadataUpsert) {\n\t\ts.SetUpdatedBy(v)\n\t})\n}", "title": "" }, { "docid": "f6bfcbfd3989d1c4cc651ba41a15bd10", "score": "0.58683395", "text": "func (m *ParticipantMutation) ClearCreatedBy() {\n\tm.clearedcreatedBy = true\n}", "title": "" }, { "docid": "f806a2ca40841f96b014355ab5f9452c", "score": "0.58610636", "text": "func (u *RaceUpsertOne) SetUpdatedBy(v int) *RaceUpsertOne {\n\treturn u.Update(func(s *RaceUpsert) {\n\t\ts.SetUpdatedBy(v)\n\t})\n}", "title": "" }, { "docid": "567cdb6f116597e14669db88fa18b388", "score": "0.58577406", "text": "func (m *MachineMutation) ClearUpdatedAt() {\n\tm.updated_at = nil\n\tm.clearedFields[machine.FieldUpdatedAt] = struct{}{}\n}", "title": "" }, { "docid": "50ce601668f6b408828e88294bdc02ac", "score": "0.58475244", "text": "func (m *MetaMutation) ClearUpdatedAt() {\n\tm.updated_at = nil\n\tm.clearedFields[meta.FieldUpdatedAt] = struct{}{}\n}", "title": "" }, { "docid": "1d5d4f9e8477617628ce5ab5b53329a4", "score": "0.5830327", "text": "func (u *VehicleModelUpsertBulk) SetUpdatedBy(v int) *VehicleModelUpsertBulk {\n\treturn u.Update(func(s *VehicleModelUpsert) {\n\t\ts.SetUpdatedBy(v)\n\t})\n}", "title": "" }, { "docid": "6cf4cfa19a4b61c3d6dff1b17615c03a", "score": "0.58247495", "text": "func (acc *BaseAccount) SetUpdateBy(editor string) Account {\n\tacc.UpdateBy = editor\n\treturn acc\n}", "title": "" }, { "docid": "5ecc8218f842fe142c3a0fd80963e928", "score": "0.581361", "text": "func (m *CustomerFollowMutation) ResetDeleteBy() {\n\tm.deleteBy = nil\n\tdelete(m.clearedFields, customerfollow.FieldDeleteBy)\n}", "title": "" }, { "docid": "26ce4734982f2f0d894a2a8345276968", "score": "0.57979465", "text": "func (m *TransactionMutation) ClearUpdatedDate() {\n\tm.updatedDate = nil\n\tm.clearedFields[transaction.FieldUpdatedDate] = struct{}{}\n}", "title": "" }, { "docid": "8bb5f2f65d35e9f22e2c940f64296069", "score": "0.57480323", "text": "func (m *UserActiveRecordMutation) ResetUpdatedAt() {\n\tm.updated_at = nil\n\tdelete(m.clearedFields, useractiverecord.FieldUpdatedAt)\n}", "title": "" }, { "docid": "c85dc27e782533718cb3495e704844d8", "score": "0.573955", "text": "func (rc *RaceCreate) SetUpdatedBy(i int) *RaceCreate {\n\trc.mutation.SetUpdatedBy(i)\n\treturn rc\n}", "title": "" }, { "docid": "6fea11398b4771cc923cb618da32c07e", "score": "0.57234776", "text": "func (o ManagementGroupDetailsResponseOutput) UpdatedBy() pulumi.StringPtrOutput {\n\treturn o.ApplyT(func(v ManagementGroupDetailsResponse) *string { return v.UpdatedBy }).(pulumi.StringPtrOutput)\n}", "title": "" }, { "docid": "6fea11398b4771cc923cb618da32c07e", "score": "0.57234776", "text": "func (o ManagementGroupDetailsResponseOutput) UpdatedBy() pulumi.StringPtrOutput {\n\treturn o.ApplyT(func(v ManagementGroupDetailsResponse) *string { return v.UpdatedBy }).(pulumi.StringPtrOutput)\n}", "title": "" }, { "docid": "36f975923f028c93b3f7c9cd7bc38e7b", "score": "0.57124543", "text": "func (m *AlertMutation) ClearUpdatedAt() {\n\tm.updated_at = nil\n\tm.clearedFields[alert.FieldUpdatedAt] = struct{}{}\n}", "title": "" }, { "docid": "5059b21f422b7d9c671686095b3438ab", "score": "0.57116365", "text": "func (u *MetadataUpsert) UpdateUpdatedBy() *MetadataUpsert {\n\tu.SetExcluded(metadata.FieldUpdatedBy)\n\treturn u\n}", "title": "" }, { "docid": "9cf82f22b9a64b78904072121cb92d01", "score": "0.5706664", "text": "func (bc *BaseCurrency) SetUpdateBy(editor string) Currency {\n\tbc.UpdateBy = editor\n\treturn bc\n}", "title": "" }, { "docid": "b92f58b362fd82a532ba2b3e4e1eb618", "score": "0.5701932", "text": "func (vcu *VehicleClassUpdate) ClearCreatedBy() *VehicleClassUpdate {\n\tvcu.mutation.ClearCreatedBy()\n\treturn vcu\n}", "title": "" }, { "docid": "b0c72b877663bb83dd481b8b6df041ca", "score": "0.5653029", "text": "func (m *UserMutation) ResetUpdatedAt() {\n\tm.updated_at = nil\n}", "title": "" }, { "docid": "b0c72b877663bb83dd481b8b6df041ca", "score": "0.5653029", "text": "func (m *UserMutation) ResetUpdatedAt() {\n\tm.updated_at = nil\n}", "title": "" }, { "docid": "b0c72b877663bb83dd481b8b6df041ca", "score": "0.5653029", "text": "func (m *UserMutation) ResetUpdatedAt() {\n\tm.updated_at = nil\n}", "title": "" }, { "docid": "fef980233095025ec268415a64df7d4f", "score": "0.56524175", "text": "func (o ManagementGroupDetailsResponsePtrOutput) UpdatedBy() pulumi.StringPtrOutput {\n\treturn o.ApplyT(func(v *ManagementGroupDetailsResponse) *string {\n\t\tif v == nil {\n\t\t\treturn nil\n\t\t}\n\t\treturn v.UpdatedBy\n\t}).(pulumi.StringPtrOutput)\n}", "title": "" }, { "docid": "fef980233095025ec268415a64df7d4f", "score": "0.56524175", "text": "func (o ManagementGroupDetailsResponsePtrOutput) UpdatedBy() pulumi.StringPtrOutput {\n\treturn o.ApplyT(func(v *ManagementGroupDetailsResponse) *string {\n\t\tif v == nil {\n\t\t\treturn nil\n\t\t}\n\t\treturn v.UpdatedBy\n\t}).(pulumi.StringPtrOutput)\n}", "title": "" }, { "docid": "731ac0ca2784430a8daa073b02f01d39", "score": "0.56285906", "text": "func (vcuo *VehicleClassUpdateOne) ClearCreatedBy() *VehicleClassUpdateOne {\n\tvcuo.mutation.ClearCreatedBy()\n\treturn vcuo\n}", "title": "" }, { "docid": "2d3747fed551a95d734f85779ed337da", "score": "0.56206685", "text": "func (u *VehicleModelUpsertBulk) ClearCreatedBy() *VehicleModelUpsertBulk {\n\treturn u.Update(func(s *VehicleModelUpsert) {\n\t\ts.ClearCreatedBy()\n\t})\n}", "title": "" }, { "docid": "f626fe85d9e8d94c2d044d6743e06048", "score": "0.5613547", "text": "func (m *UserActiveRecordMutation) UpdatedAtCleared() bool {\n\t_, ok := m.clearedFields[useractiverecord.FieldUpdatedAt]\n\treturn ok\n}", "title": "" }, { "docid": "4604c3d03447d204b40f8bd2beb5adcf", "score": "0.56094134", "text": "func (u *RaceUpsertBulk) SetUpdatedBy(v int) *RaceUpsertBulk {\n\treturn u.Update(func(s *RaceUpsert) {\n\t\ts.SetUpdatedBy(v)\n\t})\n}", "title": "" }, { "docid": "04b95bc772a124bbfd6d251783e637f5", "score": "0.56081206", "text": "func (u *MetadataUpsertBulk) ClearCreatedBy() *MetadataUpsertBulk {\n\treturn u.Update(func(s *MetadataUpsert) {\n\t\ts.ClearCreatedBy()\n\t})\n}", "title": "" }, { "docid": "135a3aa6590d43da628524e7fbeec591", "score": "0.5602879", "text": "func (m *UserMutation) ResetUpdatedAt() {\n\tm.updatedAt = nil\n}", "title": "" }, { "docid": "a03bb9565f0721ae64ff5c6b69106a81", "score": "0.55915844", "text": "func (piuo *PlayerIdentifierUpdateOne) SetUpdatedBy(i int) *PlayerIdentifierUpdateOne {\n\tpiuo.mutation.ResetUpdatedBy()\n\tpiuo.mutation.SetUpdatedBy(i)\n\treturn piuo\n}", "title": "" }, { "docid": "3a4be0c85855219ae930b0904fd1a12e", "score": "0.5588824", "text": "func (m *ConfigItemMutation) ClearUpdatedAt() {\n\tm.updated_at = nil\n\tm.clearedFields[configitem.FieldUpdatedAt] = struct{}{}\n}", "title": "" }, { "docid": "f6d85a6efae048e016eb958b09de69e4", "score": "0.55772054", "text": "func (m *EventMutation) ClearUpdatedAt() {\n\tm.updated_at = nil\n\tm.clearedFields[event.FieldUpdatedAt] = struct{}{}\n}", "title": "" }, { "docid": "0beef537bbae885b64d61b3903808a1f", "score": "0.55244887", "text": "func (m *ParticipantMutation) ResetCreatedBy() {\n\tm.createdBy = nil\n\tm.clearedcreatedBy = false\n}", "title": "" }, { "docid": "bca2ffbe55393f52de7579e5d51799ec", "score": "0.5523956", "text": "func (m *UserMutation) UpdatedAtCleared() bool {\n\t_, ok := m.clearedFields[user.FieldUpdatedAt]\n\treturn ok\n}", "title": "" }, { "docid": "91321c1a826d5f30b30ec57d58670427", "score": "0.5517679", "text": "func (pu *ParticipantUpdate) ClearCreatedBy() *ParticipantUpdate {\n\tpu.mutation.ClearCreatedBy()\n\treturn pu\n}", "title": "" }, { "docid": "6e451c05e505f0dac5574911a969f384", "score": "0.55147356", "text": "func (piu *PlayerIdentifierUpdate) SetUpdatedBy(i int) *PlayerIdentifierUpdate {\n\tpiu.mutation.ResetUpdatedBy()\n\tpiu.mutation.SetUpdatedBy(i)\n\treturn piu\n}", "title": "" }, { "docid": "bd95f01e443fd468a9f90099be01c180", "score": "0.5513452", "text": "func (m *DecisionMutation) ClearUpdatedAt() {\n\tm.updated_at = nil\n\tm.clearedFields[decision.FieldUpdatedAt] = struct{}{}\n}", "title": "" }, { "docid": "16c0feb05b613fee2bcdafab3b4b6bdf", "score": "0.54880166", "text": "func (uaru *UserActiveRecordUpdate) ClearUpdatedAt() *UserActiveRecordUpdate {\n\tuaru.mutation.ClearUpdatedAt()\n\treturn uaru\n}", "title": "" }, { "docid": "ed6dfb1a8c61951f298e874a686678bf", "score": "0.5452924", "text": "func (u *VehicleModelUpsert) UpdateUpdatedBy() *VehicleModelUpsert {\n\tu.SetExcluded(vehiclemodel.FieldUpdatedBy)\n\treturn u\n}", "title": "" }, { "docid": "1a81d03286e195eb0be6de6dc233226e", "score": "0.5443804", "text": "func (u *MetadataUpsertOne) ClearCreatedBy() *MetadataUpsertOne {\n\treturn u.Update(func(s *MetadataUpsert) {\n\t\ts.ClearCreatedBy()\n\t})\n}", "title": "" }, { "docid": "6557ea873d3a9711b16eee53f4048502", "score": "0.54336035", "text": "func (m *BouncerMutation) ResetUpdatedAt() {\n\tm.updated_at = nil\n\tdelete(m.clearedFields, bouncer.FieldUpdatedAt)\n}", "title": "" }, { "docid": "71b7dc4bdbc6f8b9df00060114e74929", "score": "0.543085", "text": "func (u *MetadataUpsertOne) UpdateUpdatedBy() *MetadataUpsertOne {\n\treturn u.Update(func(s *MetadataUpsert) {\n\t\ts.UpdateUpdatedBy()\n\t})\n}", "title": "" }, { "docid": "beb5e7664f0dda8e4a7ab9c14f362394", "score": "0.54222876", "text": "func (m *AuthMutation) ResetUpdatedAt() {\n\tm.updatedAt = nil\n}", "title": "" }, { "docid": "735065e4a71be44b631e4c190a63af22", "score": "0.54211175", "text": "func (u *VehicleModelUpsertOne) ClearCreatedBy() *VehicleModelUpsertOne {\n\treturn u.Update(func(s *VehicleModelUpsert) {\n\t\ts.ClearCreatedBy()\n\t})\n}", "title": "" }, { "docid": "f41cb07d4037b50af2bc95cdc67fe749", "score": "0.5410537", "text": "func (puo *ParticipantUpdateOne) ClearCreatedBy() *ParticipantUpdateOne {\n\tpuo.mutation.ClearCreatedBy()\n\treturn puo\n}", "title": "" }, { "docid": "0917df9e0cc673e8a2c10e7b869baf81", "score": "0.53891456", "text": "func (m *MachineMutation) ResetUpdatedAt() {\n\tm.updated_at = nil\n\tdelete(m.clearedFields, machine.FieldUpdatedAt)\n}", "title": "" }, { "docid": "5096e78254b19c6d95e8a46e00044ef0", "score": "0.53879654", "text": "func (o *GiveawaysPool) SetModifiedBy(v int32) {\n\to.ModifiedBy = &v\n}", "title": "" }, { "docid": "62eedf8e62373c891a4fc06a87fbbf8a", "score": "0.53866607", "text": "func (o *EnvironmentResponse) GetLastUpdatedBy() string {\n\tif o == nil || o.LastUpdatedBy == nil {\n\t\tvar ret string\n\t\treturn ret\n\t}\n\treturn *o.LastUpdatedBy\n}", "title": "" }, { "docid": "ac040dabcc8547823302eb5354d7f49b", "score": "0.53749514", "text": "func (u *VehicleModelUpsert) ClearUpdatedWith() *VehicleModelUpsert {\n\tu.SetNull(vehiclemodel.FieldUpdatedWith)\n\treturn u\n}", "title": "" }, { "docid": "781adf20371206f7c4bfdbb12126b866", "score": "0.5370346", "text": "func (u *VehicleModelUpsert) ClearCreatedBy() *VehicleModelUpsert {\n\tu.SetNull(vehiclemodel.FieldCreatedBy)\n\treturn u\n}", "title": "" }, { "docid": "7b0e23ef3b3a92f9c0a796f21b072caa", "score": "0.5363008", "text": "func (acc *BaseAccount) GetUpdateBy() string {\n\treturn acc.UpdateBy\n}", "title": "" }, { "docid": "bda5bf4bf4f97ff310f937c82cd7973f", "score": "0.536075", "text": "func (m *AdminMutation) ResetUpdatedAt() {\n\tm.updated_at = nil\n}", "title": "" }, { "docid": "33368f615e6626726179d20512bf15d1", "score": "0.5350591", "text": "func (uaruo *UserActiveRecordUpdateOne) ClearUpdatedAt() *UserActiveRecordUpdateOne {\n\tuaruo.mutation.ClearUpdatedAt()\n\treturn uaruo\n}", "title": "" }, { "docid": "5e8d971f3ec37a19b37c5da981f312e9", "score": "0.5348947", "text": "func (f *UserFilter) WhereUpdatedBy(p entql.IntP) {\n\tf.Where(p.Field(user.FieldUpdatedBy))\n}", "title": "" }, { "docid": "faa138ccf6a5cac9a68d40f6dc132707", "score": "0.53487784", "text": "func (m *gerritListener) UpdatedBy() string {\n\treturn m.updatedByField\n}", "title": "" }, { "docid": "ffb71b10c020ed58f273e0035209eac4", "score": "0.5341146", "text": "func (m *TransactionMutation) ClearReversedBy() {\n\tm.reversedBy = nil\n\tm.clearedFields[transaction.FieldReversedBy] = struct{}{}\n}", "title": "" }, { "docid": "7cef912f2d368aa29e3977720389916a", "score": "0.5322276", "text": "func (u *RaceUpsertBulk) ClearCreatedBy() *RaceUpsertBulk {\n\treturn u.Update(func(s *RaceUpsert) {\n\t\ts.ClearCreatedBy()\n\t})\n}", "title": "" }, { "docid": "f8e753396dcc597c2e8065c4b85c2c5b", "score": "0.5320809", "text": "func (iuo *IngredientUpdateOne) ClearUseBy() *IngredientUpdateOne {\n\tiuo.use_by = nil\n\tiuo.clearuse_by = true\n\treturn iuo\n}", "title": "" }, { "docid": "0b77d70f28619f155644a465f9cad991", "score": "0.53160036", "text": "func (m *ChannelMutation) ResetUpdatedAt() {\n\tm.updatedAt = nil\n}", "title": "" }, { "docid": "2753171f8acca8e198a81e76937ae5b7", "score": "0.5306579", "text": "func (m *MetaMutation) ResetUpdatedAt() {\n\tm.updated_at = nil\n\tdelete(m.clearedFields, meta.FieldUpdatedAt)\n}", "title": "" }, { "docid": "57e0ae21bbb6c0721c80c45caa0f15e5", "score": "0.5291379", "text": "func (m *ResourceMutation) ResetUpdatedAt() {\n\tm.updatedAt = nil\n}", "title": "" }, { "docid": "85d7ba45e8ebdcdfd08b48f673ea4fdf", "score": "0.5288367", "text": "func (u *MetadataUpsert) ClearUpdatedWith() *MetadataUpsert {\n\tu.SetNull(metadata.FieldUpdatedWith)\n\treturn u\n}", "title": "" }, { "docid": "34ebdb7490c57bfa56bef233da3e0ea2", "score": "0.5270422", "text": "func (o *ViewAllocation) GetUpdatedBy() int32 {\n\tif o == nil || o.UpdatedBy == nil {\n\t\tvar ret int32\n\t\treturn ret\n\t}\n\treturn *o.UpdatedBy\n}", "title": "" }, { "docid": "ae554883e462d9a2539d9a69530e3920", "score": "0.52548087", "text": "func (piu *PlayerIdentifierUpdate) ClearCreatedBy() *PlayerIdentifierUpdate {\n\tpiu.mutation.ClearCreatedBy()\n\treturn piu\n}", "title": "" }, { "docid": "903f24e8ddee3ec138f08b077214f9c4", "score": "0.52530384", "text": "func (iu *IngredientUpdate) ClearUseBy() *IngredientUpdate {\n\tiu.use_by = nil\n\tiu.clearuse_by = true\n\treturn iu\n}", "title": "" }, { "docid": "6126df1a9f6806d7047a6625d28cbd14", "score": "0.523664", "text": "func (bc *BaseCurrency) GetUpdateBy() string {\n\treturn bc.UpdateBy\n}", "title": "" }, { "docid": "1555468b5ae3920e4c154e837e5561c6", "score": "0.5236196", "text": "func (u *MetadataUpsert) ClearCreatedBy() *MetadataUpsert {\n\tu.SetNull(metadata.FieldCreatedBy)\n\treturn u\n}", "title": "" }, { "docid": "8c93cc8d938fe23cca7aedf1a26fabc6", "score": "0.52269715", "text": "func (m *PermissionMutation) ResetUpdateTime() {\n\tm.update_time = nil\n}", "title": "" }, { "docid": "0c5dc70422ffc4506b1a51edce7400cb", "score": "0.5222358", "text": "func (piuo *PlayerIdentifierUpdateOne) ClearCreatedBy() *PlayerIdentifierUpdateOne {\n\tpiuo.mutation.ClearCreatedBy()\n\treturn piuo\n}", "title": "" } ]
781001e30d43fb9d06c61cd16155414f
initTerrain initializes the world's terrain. Currently terrain is all initialized to grass land unless it is above a certain threshold in which case it is made a mountain.
[ { "docid": "2bc2518f2b3336eb4a9f50dc1a393129", "score": "0.7817523", "text": "func initTerrain(w *world.World) {\n\tconst minMountain = world.MaxElevation * 0.75\n\n\tfor x := 0; x < w.W; x++ {\n\t\tfor y := 0; y < w.H; y++ {\n\t\t\tl := w.At(x, y)\n\t\t\tif float64(l.Elevation) >= minMountain {\n\t\t\t\tl.Terrain = &world.Terrain['m']\n\t\t\t} else {\n\t\t\t\tl.Terrain = &world.Terrain['g']\n\t\t\t}\n\t\t}\n\t}\n}", "title": "" } ]
[ { "docid": "b28aa2388e63cd0435799959d49496e6", "score": "0.6105924", "text": "func doTerrain(w *world.World) {\n\tstart(\"Initializing terrain\")\n\tinitTerrain(w)\n\tfinish()\n\n\tsz := float64(w.W * w.H)\n\tstart(\"Adding oceans\")\n\tht := int(math.Ceil(world.MaxElevation * 0.2))\n\toceans := addLiquid(w, 'w', int(sz*0.01), int(sz*0.4), int(sz*0.45), int(sz*0.55), ht)\n\tfinish()\n\n\tstart(\"Adding lakes\")\n\tht = int(math.Ceil(world.MaxElevation * 0.1))\n\taddLiquid(w, 'w', 7, int(sz*0.01), int(sz*0.05), int(sz*0.8), ht)\n\tfinish()\n\n\tstart(\"Adding forests\")\n\tgrowTerrain(w, \"g\", 'f', int(sz*0.2), int(sz*0.25), 0.005)\n\tfinish()\n\n\tstart(\"Adding desert\")\n\tgrowTerrain(w, \"gf\", 'd', int(sz*0.04), int(sz*0.08), 0.0002)\n\tfinish()\n\n\tstart(\"Adding glacier\")\n\tgrowTerrain(w, \"gf\", 'i', int(sz*0.04), int(sz*0.08), 0.0002)\n\tfinish()\n\n\tstart(\"Adding rivers\")\n\taddRivers(w, oceans, 25, int(sz*0.02))\n\tfinish()\n}", "title": "" }, { "docid": "0e48b5c0e3ab295d26d0fffd450f1bdb", "score": "0.50674117", "text": "func growTerrain(w *world.World, fertile string, ch uint8, minSz, maxSz int, seedFrac float64) {\n\ttotal := rand.Intn(maxSz-minSz) + minSz\n\ttmap := makeTopoMap(w)\n\tvar land []*contour\n\tfor _, c := range tmap.conts {\n\t\tif strings.Contains(fertile, c.terrain.Char) {\n\t\t\tland = append(land, c)\n\t\t}\n\t}\n\n\t// scramble\n\tfor i := 0; i < len(land)-1; i++ {\n\t\tj := rand.Intn(len(land)-i) + i\n\t\tland[i], land[j] = land[j], land[i]\n\t}\n\n\t// get some seed locations.\n\tn := 0\n\tnSeeds := int(float64(total) * seedFrac)\n\tif nSeeds == 0 {\n\t\tnSeeds = 1\n\t}\n\tif nSeeds > len(land) {\n\t\tnSeeds = len(land)\n\t}\n\tseeds := land[:nSeeds]\n\tfor _, s := range seeds {\n\t\ts.terrain = &world.Terrain[ch]\n\t\tn += s.size\n\t}\n\n\tfor len(seeds) > 0 && n < minSz {\n\t\ti := rand.Intn(len(seeds))\n\t\tc := seeds[i]\n\t\tvar adj []*contour\n\t\tfor _, a := range c.adj {\n\n\t\t\tif strings.Contains(fertile, a.terrain.Char) &&\n\t\t\t\tn+a.size < maxSz {\n\t\t\t\tadj = append(adj, a)\n\t\t\t}\n\t\t}\n\t\tif len(adj) == 0 {\n\t\t\tseeds[i], seeds = seeds[len(seeds)-1], seeds[:len(seeds)-1]\n\t\t\tcontinue\n\t\t}\n\t\tc = adj[rand.Intn(len(adj))]\n\t\tn += c.size\n\t\tc.terrain = &world.Terrain[ch]\n\t\tseeds = append(seeds, c)\n\t}\n\n\tfor x := 0; x < w.W; x++ {\n\t\tfor y := 0; y < w.H; y++ {\n\t\t\tc := tmap.getContour(x, y)\n\t\t\tloc := w.At(x, y)\n\t\t\tloc.Terrain = c.terrain\n\t\t\tloc.Elevation = c.height\n\t\t\tloc.Depth = c.depth\n\t\t}\n\t}\n}", "title": "" }, { "docid": "c554810e2bc244f0d7e92aa7ee262d5c", "score": "0.48567608", "text": "func (this *Store) TileTerrain(tileset string, tile *stores.Terrain) (err error) {\n\tfilename := filepath.Join(\n\t\tthis.root,\n\t\ttileset,\n\t\tstrconv.FormatUint(tile.Z, 10),\n\t\tstrconv.FormatUint(tile.X, 10),\n\t\tstrconv.FormatUint(tile.Y, 10)+\".terrain\")\n\n\tbody, err := this.readFile(filename)\n\tif err != nil {\n\t\treturn\n\t}\n\n\terr = tile.UnmarshalBinary(body)\n\treturn\n}", "title": "" }, { "docid": "048b0907f3e97c8df68d1d235630f5fa", "score": "0.45742786", "text": "func Init() {\n\tdeltaTime = 1.0 / 60.0 / 10.0 * 1000\n\tgravityForce = rl.NewVector2(0, 9.81)\n\n\tbodies = make([]*Body, 0, maxBodies)\n\tmanifolds = make([]*manifold, 0, maxManifolds)\n}", "title": "" }, { "docid": "0f8dc7a75913c0d732c428a0efa01675", "score": "0.4559836", "text": "func (civilian *CivilianBehavior) Init(p *Provider, agent *Agent) {\n\t// Pick a random node for the home location.\n\tcivilian.Home = p.RNG().Node(p.Arena().Nodes)\n\n\t// Set it as the starting location\n\tcivilian.Home.Enter(agent)\n\n\tif agent.Kind == OffenderAgentKind {\n\t\tagent.Location.TotalHCP++\n\t} else {\n\t\tagent.Location.TotalLCP++\n\t}\n\n\t// If the agent is employed, choose a work location\n\tif civilian.Employed {\n\t\t// Ensure that the work location is not the same as their home location.\n\t\tfor civilian.Work == nil || civilian.Work == civilian.Home {\n\t\t\tcivilian.ChooseWork(p)\n\t\t}\n\t}\n\n\t// Start with some amount of money.\n\tcivilian.Wealth = p.RNG().NormalInt64(\n\t\tint64(p.Config.Economy.WealthMean), int64(p.Config.Economy.WealthStdDev))\n\tif civilian.Wealth < 0 {\n\t\tcivilian.Wealth = 0\n\t}\n}", "title": "" }, { "docid": "76e577c2c11f7350e57784b61f7f2b8e", "score": "0.4433666", "text": "func loadTermap() {\n\tfile, err := os.Open(\"terrain.dat\")\n\tif err != nil {\n\t\tdie(err)\n\t}\n\tdefer file.Close()\n\tdec := gob.NewDecoder(file)\n\tif err = dec.Decode(&termap); err != nil {\n\t\tdie(err)\n\t}\n\tif flagVerbose {\n\t\tfmt.Fprintf(os.Stderr, \"Loaded terrain map (%d items)\\n\", len(termap))\n\t}\n}", "title": "" }, { "docid": "13f76ffe0ea531ddd8c01a934fa49200", "score": "0.44082505", "text": "func init() {\n\tprintln(\"geometry package initialized\")\n\n\tif rectLen < 0 {\n\t\tlog.Fatal(\"rectLen < 0 !\")\n\t}\n\n\tif rectWid < 0 {\n\t\tlog.Fatal(\"rectWid < 0 !\")\n\t}\n}", "title": "" }, { "docid": "a6c60680d90856d54a476738aa215dd2", "score": "0.43942356", "text": "func (s *Sim) Init() {\n\trand.Seed(time.Now().UTC().UnixNano())\n\ts.Units = make([]Cellular, *Width*(*Width))\n\tn := 0\n\tfor i := 1; i <= *Width; i++ {\n\t\tfor j := 1; j <= *Width; j++ {\n\t\t\tp := rand.Float64()\n\t\t\tif p < *population {\n\t\t\t\ts.Units[n] = s.CreateCell(i, j, Deeppink, Deeppink)\n\t\t\t} else {\n\t\t\t\ts.Units[n] = s.CreateCell(i, j, White, White)\n\t\t\t}\n\t\t\tn++\n\t\t}\n\t}\n}", "title": "" }, { "docid": "afef410c133280cd6fb53e0c96cfa051", "score": "0.42940608", "text": "func (pTypeDef *MapTest) Init() *MapTest {\n\tif pTypeDef.Locations == nil {\n\t\tpTypeDef.Locations = make(map[string]int32)\n\t}\n\treturn pTypeDef\n}", "title": "" }, { "docid": "e556fb4d1a9edee1b3a9b0e5e37b4259", "score": "0.42831528", "text": "func initGameState(firstLevel level.Level, players []actor.Actor, adversaries []actor.Actor) *GameState {\n\tgs := &GameState{\n\t\tLevel: &firstLevel,\n\t\t//Adversaries: GenerateAdversaries(numPlayers),\n\t}\n\tplaceActors(gs, players, getTopLeftUnoccupiedWalkable, level.NewPosition2D(0, 0))\n\tplaceActors(gs, adversaries, getBottomRightUnoccupiedWalkable, firstLevel.Size)\n\treturn gs\n}", "title": "" }, { "docid": "eed872b04d9690caeb1bfc6a17dac754", "score": "0.42714262", "text": "func init() {\n\tInitAllData() //init globals\n\tInitialiseAllMasks() //init attack masks\n}", "title": "" }, { "docid": "080312dcdf3f52dd95e624cd6508cb55", "score": "0.42700142", "text": "func (s *SmartContract) InitLedger(ctx contractapi.TransactionContextInterface) error {\n\tassets := []Asset{\n\t\t{ID: \"asset1\", Color: \"blue\", Size: 5, Owner: \"Tomoko\", AppraisedValue: 300},\n\t\t{ID: \"asset2\", Color: \"red\", Size: 5, Owner: \"Brad\", AppraisedValue: 400},\n\t\t{ID: \"asset3\", Color: \"green\", Size: 10, Owner: \"Jin Soo\", AppraisedValue: 500},\n\t\t{ID: \"asset4\", Color: \"yellow\", Size: 10, Owner: \"Max\", AppraisedValue: 600},\n\t\t{ID: \"asset5\", Color: \"black\", Size: 15, Owner: \"Adriana\", AppraisedValue: 700},\n\t\t{ID: \"asset6\", Color: \"white\", Size: 15, Owner: \"Michel\", AppraisedValue: 800},\n\t}\n\n\tfor _, asset := range assets {\n\t\tassetJSON, err := json.Marshal(asset)\n\t\tif err != nil {\n\t\t\treturn err\n\t\t}\n\n\t\terr = ctx.GetStub().PutState(asset.ID, assetJSON)\n\t\tif err != nil {\n\t\t\treturn fmt.Errorf(\"failed to put to world state. %v\", err)\n\t\t}\n\t}\n\n\treturn nil\n}", "title": "" }, { "docid": "45657305d7bbae8a713fb151cc634b26", "score": "0.42594072", "text": "func (w *World) Init() {\n\n}", "title": "" }, { "docid": "e1c820114631c17158b04f8f5d78729b", "score": "0.42564607", "text": "func processTerrainData(path string) (err error) {\n\ttype oter struct {\n\t\tID string `json:\"id\"`\n\t\tColor string `json:\"color\"`\n\t\tSyms interface{} `json:\"sym\"`\n\t}\n\tif flagVerbose {\n\t\tfmt.Fprintf(os.Stderr, \"File: %s\\n\", path)\n\t}\n\tfile, err := os.Open(path)\n\tif err != nil {\n\t\treturn\n\t}\n\tdefer file.Close()\n\tdec := json.NewDecoder(file)\n\t_, err = dec.Token() // Skip over '['\n\tif err != nil {\n\t\treturn\n\t}\n\tvar rawTer oter\n\tfor dec.More() {\n\t\terr = dec.Decode(&rawTer)\n\t\tif err != nil {\n\t\t\twarn(\"Bad item format: %s\\n\", err)\n\t\t\tcontinue\n\t\t}\n\t\tif rawTer.Syms == nil {\n\t\t\tcontinue\n\t\t}\n\t\tif _, ok := termap[rawTer.ID]; ok {\n\t\t\twarn(\"Terrain %v already defined\\n\", rawTer.ID)\n\t\t}\n\t\tvar syms []string\n\t\tswitch tsym := rawTer.Syms.(type) {\n\t\tcase float64:\n\t\t\tsyms = make([]string, 1)\n\t\t\tsyms[0] = parseSym(int32(tsym))\n\t\tcase []interface{}:\n\t\t\tsyms = make([]string, len(tsym))\n\t\t\tfor i, ttsym := range tsym {\n\t\t\t\t// below will blow up with appropriate message on wrong type\n\t\t\t\tsyms[i] = parseSym(int32(ttsym.(float64)))\n\t\t\t}\n\t\tdefault:\n\t\t\twarn(\"Unkown sym type: %v\\n\", tsym)\n\t\t\tcontinue\n\t\t}\n\t\tter := Terrain{syms, rawTer.Color}\n\t\ttermap[rawTer.ID] = ter\n\t\tif flagVerbose {\n\t\t\tfmt.Fprintf(os.Stderr, \"Parsed terrain: %v = %v\\n\", rawTer.ID, ter)\n\t\t}\n\t}\n\treturn\n}", "title": "" }, { "docid": "bc61cedd4fc55b3f250d46d683badfad", "score": "0.4247223", "text": "func (boid Boid) avoidTerrain(i BoidInfo, w *world.World) {\n\tif i.AvoidTerrain == \"\" {\n\t\treturn\n\t}\n\n\tvar a geom.Point\n\tdd := i.TerrainDist * i.TerrainDist\n\tsz := geom.Pt(i.TerrainDist, i.TerrainDist)\n\tx0, y0 := w.Tile(boid.Box.Min.Sub(sz))\n\tx1, y1 := w.Tile(boid.Box.Min.Add(sz))\n\n\tfor x := x0; x <= x1; x++ {\n\t\tfor y := y0; y <= y1; y++ {\n\t\t\tl := w.At(x, y)\n\t\t\tch := l.Terrain.Char\n\t\t\tif l.Depth <= i.MaxDepth && strings.Index(i.AvoidTerrain, ch) < 0 {\n\t\t\t\tcontinue\n\t\t\t}\n\t\t\tpt := geom.Pt((float64(x)+0.5)*world.TileSize.X,\n\t\t\t\t(float64(y)+0.5)*world.TileSize.Y)\n\t\t\tif w.Pixels.SqDist(boid.Box.Center(), pt) > dd {\n\t\t\t\tcontinue\n\t\t\t}\n\t\t\ta = a.Add(avoidVec(boid.Box.Center(), pt, i.TerrainDist, w))\n\t\t}\n\t}\n\tbias := geom.Pt(i.TerrainBias, i.TerrainBias)\n\ta = a.Mul(bias)\n\tboid.Vel = boid.Vel.Add(a)\n}", "title": "" }, { "docid": "61da95d29a4992ed377e03de49018ac3", "score": "0.42210433", "text": "func (r *Ray) Init(ty uint32, P, D m.Vec3, maxdist float32, level uint8, sc *ShaderContext) {\n\tr.P = P\n\tr.D = D\n\tr.Tclosest = maxdist\n\tr.Type = ty\n\tr.Setup()\n\n\tr.Level = level\n\tr.Lambda = sc.Lambda\n\tr.Time = sc.Time\n\tr.NodesT = 0\n\tr.LeafsT = 0\n\n\tr.Scramble = sc.Scramble // ^ math.Float64bits(pdf)\n\tr.I = sc.I\n\n\t// Compute ray differentials for reflection\n\tif ty&RayTypeReflected != 0 {\n\t\tr.DdPdx = sc.DdPdx\n\t\tr.DdPdy = sc.DdPdy\n\n\t\tDdotNdx := m.Vec3Dot(sc.DdDdx, sc.N) + m.Vec3Dot(sc.Rd, sc.DdNdx)\n\t\tDdotNdy := m.Vec3Dot(sc.DdDdy, sc.N) + m.Vec3Dot(sc.Rd, sc.DdNdy)\n\n\t\tr.DdDdx = m.Vec3Mad(sc.DdDdx, m.Vec3Add(m.Vec3Scale(m.Vec3Dot(sc.Rd, sc.N), sc.DdNdx), m.Vec3Scale(DdotNdx, sc.N)), -2)\n\t\tr.DdDdy = m.Vec3Mad(sc.DdDdy, m.Vec3Add(m.Vec3Scale(m.Vec3Dot(sc.Rd, sc.N), sc.DdNdy), m.Vec3Scale(DdotNdy, sc.N)), -2)\n\n\t}\n\n\tif ty&RayTypeShadow != 0 {\n\t\treturn\n\t}\n}", "title": "" }, { "docid": "e3bd36e785226dc55e6415bcaf593262", "score": "0.4214822", "text": "func (t *ThresholdMap[K, V]) Init(mode Mode) *ThresholdMap[K, V] {\n\tt.Lock()\n\tdefer t.Unlock()\n\tif t.tree != nil {\n\t\tpanic(\"ThresholdMap has already been initialized before\")\n\t}\n\n\tt.mode = mode\n\tt.tree = redblacktree.NewWith(func(a interface{}, b interface{}) int {\n\t\treturn lo.Comparator(a.(K), b.(K))\n\t})\n\n\treturn t\n}", "title": "" }, { "docid": "e6ad8f854ec932474760f1df1faf352f", "score": "0.41831288", "text": "func init() {\n\t_temps = make(map[string]int)\n\t_mems = make(map[string]devices.MemoryInfo)\n\t_cpus = make(map[string]int)\n\terrors = make(map[string]error)\n\tdevices.RegisterTemp(updateNvidiaTemp)\n\tdevices.RegisterMem(updateNvidiaMem)\n\tdevices.RegisterCPU(updateNvidiaUsage)\n\n\tlock = sync.Mutex{}\n\tdevices.RegisterStartup(startup)\n}", "title": "" }, { "docid": "3541dc8fd66ed67cd65eb3cd0fcdf4e6", "score": "0.4183011", "text": "func (p *PageTables) Init(allocator Allocator) {\n\tp.Allocator = allocator\n\tp.root = p.Allocator.NewPTEs()\n\tp.rootPhysical = p.Allocator.PhysicalFor(p.root)\n}", "title": "" }, { "docid": "a658e1ee63b34f816b83a7e92855a3c2", "score": "0.4173672", "text": "func (n *Network) initLayers() {\n\n}", "title": "" }, { "docid": "3c116f9c9c10872fc860da471e873642", "score": "0.41723803", "text": "func (s *SmartContract) InitPercentage(ctx contractapi.TransactionContextInterface, org string) (*energyProductionPercentage, error) {\n\tvar number string\n\tif org == \"org1\" {\n\t\tnumber = \"40\"\n\t} else {\n\t\tnumber = \"60\"\n\t}\n\n\tpercentage := energyProductionPercentage{\n\t\tOrg: org,\n\t\tPercentage: number,\n\t}\n\n\tpercentageJSON, err := json.Marshal(percentage)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\terr = ctx.GetStub().PutState(percentage.Org, percentageJSON)\n\tif err != nil {\n\t\treturn nil, fmt.Errorf(\"failed to put to world state. %v\", err)\n\t}\n\n\treturn &percentage, nil\n}", "title": "" }, { "docid": "330bf400ca4eb85c1b8f15258752af30", "score": "0.41322553", "text": "func (b *Board) Init() error {\n\tif b.Size < 4 || b.Size >= 10 {\n\t\treturn fmt.Errorf(\"%v is not a valid board size\", b.Size)\n\t}\n\n\tb.Squares = map[string][]*Stone{}\n\tb.IterateOverSquares(func(l string, s []*Stone) error {\n\t\tb.Squares[l] = []*Stone{}\n\t\treturn nil\n\t})\n\n\treturn nil\n}", "title": "" }, { "docid": "bbd47317a85fec92d4c349d5904b8821", "score": "0.41320536", "text": "func InitEnvironment(islandNames []string, xBounds [2]float64, yBounds [2]float64, disasterParams DisasterParameters) (*Environment, error) {\n\n\tag := ArchipeligoGeography{[]Island{}, xBounds, yBounds}\n\n\tfor i, name := range islandNames {\n\t\tisland := Island{name, float64(i), float64(0)} // begin with points on x axis\n\t\tag.islands = append(ag.islands, island)\n\t}\n\treturn &Environment{ag, disasterParams, DisasterReport{}}, nil // may want ability to return error in future\n}", "title": "" }, { "docid": "a6b8c6c6df4e881849270e92c8114805", "score": "0.4128833", "text": "func runPrepare(root string) {\n\terr := processTerrainData(filepath.Join(root, \"data\", \"json\",\n\t\t\"overmap_terrain.json\"))\n\tif err != nil {\n\t\tdie(err)\n\t}\n\terr = filepath.Walk(filepath.Join(root, \"data\", \"json\", \"mapgen\"), walkForMapgen)\n\tif err != nil {\n\t\tdie(err)\n\t}\n\terr = filepath.Walk(filepath.Join(root, \"data\", \"mods\"), walkForMods)\n\tif err != nil {\n\t\tdie(err)\n\t}\n}", "title": "" }, { "docid": "526fad29081ea575054390e305a91863", "score": "0.41249713", "text": "func (m *Model) Init(rng *rand.LockedRand) {\n\tgain := initializers.Gain(activation.Identity)\n\tinitializers.XavierUniform(m.OutputMerge.W.Value().(mat.Matrix), gain, rng)\n\tfor _, h := range m.Heads {\n\t\th.Init(rng)\n\t}\n}", "title": "" }, { "docid": "36a12abfe81de3c24a7f6e59f10a6c51", "score": "0.41124105", "text": "func addLiquid(w *world.World, ch uint8, minSz, maxSz, minAmt, maxAmt, maxHt int) (added []*world.Loc) {\n\tnLiquid := 0\n\ttmap := makeTopoMap(w)\n\n\tmins := tmap.minima()\n\tfor len(mins) > 0 && nLiquid < minAmt {\n\t\ti := rand.Intn(len(mins))\n\t\tmin := mins[i]\n\t\tmins[i], mins = mins[len(mins)-1], mins[:len(mins)-1]\n\n\t\tif min.terrain.Char != \"g\" {\n\t\t\tcontinue\n\t\t}\n\n\t\tamt := 1\n\t\tif maxHt > 1 {\n\t\t\tamt = rand.Intn(maxHt-1) + 1\n\t\t}\n\t\thts := make([]int, amt)\n\t\tfor i := range hts {\n\t\t\thts[i] = min.height + i\n\t\t}\n\t\tfor i := 0; i < len(hts)-1; i++ {\n\t\t\tj := rand.Intn(len(hts)-i) + i\n\t\t\thts[i], hts[j] = hts[j], hts[i]\n\t\t}\n\n\t\tfor _, ht := range hts {\n\t\t\tfl := tmap.flood(min, ht)\n\t\t\tsz := 0\n\t\t\tfor _, c := range fl {\n\t\t\t\tif c.terrain != &world.Terrain[ch] {\n\t\t\t\t\tsz += c.size\n\t\t\t\t}\n\t\t\t}\n\t\t\tif sz > maxSz || nLiquid+sz > maxAmt {\n\t\t\t\tht--\n\t\t\t\tcontinue\n\t\t\t} else if sz < minSz {\n\t\t\t\tbreak\n\t\t\t}\n\t\t\tfor _, c := range fl {\n\t\t\t\tc.terrain = &world.Terrain[ch]\n\t\t\t\tc.depth += ht - c.height\n\t\t\t\tc.height = ht\n\t\t\t}\n\t\t\tnLiquid += sz\n\t\t\tbreak\n\t\t}\n\t}\n\n\tfor x := 0; x < w.W; x++ {\n\t\tfor y := 0; y < w.H; y++ {\n\t\t\tc := tmap.getContour(x, y)\n\t\t\tloc := w.At(x, y)\n\t\t\tif loc.Terrain != c.terrain {\n\t\t\t\tadded = append(added, w.At(x, y))\n\t\t\t}\n\t\t\tloc.Terrain = c.terrain\n\t\t\tloc.Elevation = c.height\n\t\t\tloc.Depth = c.depth\n\t\t}\n\t}\n\treturn\n}", "title": "" }, { "docid": "cf1dee5cc0e4d34c639ba76921c91128", "score": "0.41104013", "text": "func glInit() {\n\tgl.Init()\n\n\t// Load the shaders\n\tcurrentShader = CreateShaderProgram(shaders)\n\toffsetUniform = gl.GetUniformLocation(currentShader, gl.GLString(\"offset\"))\n\tfrustumScaleUnif = gl.GetUniformLocation(currentShader, gl.GLString(\"frustumScale\"))\n\tzNearUnif = gl.GetUniformLocation(currentShader, gl.GLString(\"zNear\"))\n\tzFarUnif = gl.GetUniformLocation(currentShader, gl.GLString(\"zFar\"))\n\tgl.UseProgram(currentShader)\n\t// Initialize the uniforms\n\tgl.Uniform1f(frustumScaleUnif, 1.0)\n\tgl.Uniform1f(zNearUnif, 1.0)\n\tgl.Uniform1f(zFarUnif, 3.0)\n\tgl.UseProgram(0)\n\n}", "title": "" }, { "docid": "b5d5588fcae846a956ef9cf333088dd5", "score": "0.40929422", "text": "func (m *Miner) initializeWallet() *Wallet {\n\tw := new(Wallet)\n\tw.Miner = m\n\tpriv, pub := rsautil.GenerateKeyPair()\n\n\tw.privateKey = priv\n\tpubArr := rsautil.PublicKeyToBytes(pub)\n\tcopy(w.PublicKey[0:rsautil.KeySize], pubArr[0:rsautil.KeySize])\n\t//fmt.Printf(\"%x\", w.PublicKey)\n\n\tw.transactions = make([]transactionAndProof, 0)\n\treturn w\n}", "title": "" }, { "docid": "fc3d245e057374b9289d398644df3175", "score": "0.40866944", "text": "func (o *OneRNG) Init(ctx context.Context) error {\n\ti := 0\n\tfor ; i < 200; i++ {\n\t\tn, err := o.readData(ctx)\n\t\tif err != nil {\n\t\t\treturn err\n\t\t}\n\t\tif n > 0 {\n\t\t\tbreak\n\t\t}\n\t}\n\t// fmt.Fprintf(os.Stderr, \"Initialized after %d loops\\n\", i)\n\n\treturn nil\n}", "title": "" }, { "docid": "311397baafdcb83841079cab126d6adb", "score": "0.4067972", "text": "func (n *Normal) Init(r prng.Engine, params ...float64) {\n\tif len(params) != 2 {\n\t\tpanic(\"Error initializing Normal Distribution.\" +\n\t\t\t\"Expecting two float64 parameters.\")\n\t}\n\tif params[1] <= 0 {\n\t\tpanic(\"Parameter 'sigma' should be greater than 0\")\n\t}\n\tn.rng = r\n\tn.m = params[0]\n\tn.s = params[1]\n}", "title": "" }, { "docid": "9c5b2d6c67412d883eba4df45379eeda", "score": "0.4056713", "text": "func (xft *XFastTrie) init(intType interface{}) {\n\tbits := uint8(0)\n\tswitch intType.(type) {\n\tcase uint8:\n\t\tbits = 8\n\tcase uint16:\n\t\tbits = 16\n\tcase uint32:\n\t\tbits = 32\n\tcase uint, uint64:\n\t\tbits = 64\n\tdefault:\n\t\t// we'll panic with a bad value to the constructor.\n\t\tpanic(`Invalid universe size provided.`)\n\t}\n\n\txft.layers = make([]map[uint64]*node, bits)\n\txft.bits = bits\n\txft.diff = 64 - bits\n\tfor i := uint8(0); i < bits; i++ {\n\t\txft.layers[i] = make(map[uint64]*node, 50) // we can obviously be more intelligent about this.\n\t}\n\txft.num = 0\n\txft.root = newNode(nil, nil)\n}", "title": "" }, { "docid": "943b314cb784397786607b266728aff2", "score": "0.40529424", "text": "func (server *Server) InitializeWorld() {\n\tserver.World.LoadAreas()\n\tserver.World.Initialize()\n\n}", "title": "" }, { "docid": "c7b537c6515c87c26f9d58db79fc3c8f", "score": "0.40421903", "text": "func init() {\n\tsize := archaius.Conf.Population * int(archaius.Conf.RunDuration)\n\tif size <= 0 {\n\t\tsize = 100\n\t}\n\tflowmap = make(flowmaptype, size)\n}", "title": "" }, { "docid": "aa56a3177bd5555ba564536e70d11de3", "score": "0.40406898", "text": "func FirstSceneInit(string, interface{}) {\n\tinitTiles()\n\tsounds = font.New()\n}", "title": "" }, { "docid": "8dcf76d3aa3b763531dc28e522c4a8b5", "score": "0.40403745", "text": "func (r *RoomMap) Init() {\n\tr.Map = make(map[string][]Participant)\n}", "title": "" }, { "docid": "a9dfef860d27b71e1d0d22d5070448b7", "score": "0.40386456", "text": "func (p *pageAlloc) sysInit() {\n\t// Reserve memory for each level. This will get mapped in\n\t// as R/W by setArenas.\n\tfor l, shift := range levelShift {\n\t\tentries := 1 << (heapAddrBits - shift)\n\n\t\t// Reserve b bytes of memory anywhere in the address space.\n\t\tb := alignUp(uintptr(entries)*pallocSumBytes, physPageSize)\n\t\tr := sysReserve(nil, b)\n\t\tif r == nil {\n\t\t\tthrow(\"failed to reserve page summary memory\")\n\t\t}\n\n\t\t// Put this reservation into a slice.\n\t\tsl := notInHeapSlice{(*notInHeap)(r), 0, entries}\n\t\tp.summary[l] = *(*[]pallocSum)(unsafe.Pointer(&sl))\n\t}\n}", "title": "" }, { "docid": "e30c8ff15585d024985bdf4d8d59b3c4", "score": "0.4032059", "text": "func (s *pageAlloc) sysInit() {\n\t// Reserve memory for each level. This will get mapped in\n\t// as R/W by setArenas.\n\tfor l, shift := range levelShift {\n\t\tentries := 1 << (heapAddrBits - shift)\n\n\t\t// Reserve b bytes of memory anywhere in the address space.\n\t\tb := alignUp(uintptr(entries)*pallocSumBytes, physPageSize)\n\t\tr := sysReserve(nil, b)\n\t\tif r == nil {\n\t\t\tthrow(\"failed to reserve page summary memory\")\n\t\t}\n\n\t\t// Put this reservation into a slice.\n\t\tsl := notInHeapSlice{(*notInHeap)(r), 0, entries}\n\t\ts.summary[l] = *(*[]pallocSum)(unsafe.Pointer(&sl))\n\t}\n}", "title": "" }, { "docid": "3c1be2366e2031a6df8ad62c0ea6aab3", "score": "0.4026982", "text": "func (pl *player) init(pos vec2, ass assets) {\n\tpl.pos = pos\n\tpl.spr = createSprite(48, 48)\n\tpl.spr.currentFrame = 1\n\tpl.speed = vec2{x: 0, y: 0}\n\tpl.target = vec2{x: 0, y: 0}\n\tpl.isPassive = true\n\tpl.doubleJump = false\n\tpl.catTouchTimer = 0.0\n\tpl.returning = false\n\tpl.cloudPos.x = pl.pos.x\n\tpl.cloudPos.y = pl.pos.y\n\n\tfor i := 0; i < 16; i++ {\n\t\tpl.white[i] = newWhitening()\n\t}\n\tpl.whiteTimer = 10.0\n\n\tpl.sndJump = ass.getSound(\"jump\")\n\tpl.sndDie = ass.getSound(\"die\")\n}", "title": "" }, { "docid": "09d9a7b922fd521295dbd32fb8a9d51a", "score": "0.40236485", "text": "func init() {\r\n\timg.Init(tmpl, ft)\r\n}", "title": "" }, { "docid": "a40cbc1bab4737a628a67d4833d5e8a1", "score": "0.40159857", "text": "func (h *Hardhat) init() error {\n\th.amu.Lock()\n\tdefer h.amu.Unlock()\n\th.dmu.Lock()\n\tdefer h.dmu.Unlock()\n\n\tif err := h.initArtifacts(); err != nil {\n\t\treturn err\n\t}\n\tif err := h.initDeployments(); err != nil {\n\t\treturn err\n\t}\n\treturn nil\n}", "title": "" }, { "docid": "dc61076fe39392232dafb26d757525d8", "score": "0.39982697", "text": "func init() {\n\tregisterWithWeight(\"templates\", 100, func(router *gin.Engine) {\n\t\tt, err := loadTemplate()\n\t\tutils.CheckAndExit(err)\n\t\trouter.SetHTMLTemplate(t)\n\t})\n}", "title": "" }, { "docid": "c3d78971f87a3ebad4d69b1d74cb14bf", "score": "0.39857215", "text": "func initEdgeDict(tess *tesselator) {\n\ttess.dict = newDict(tess)\n\n\tw := (tess.bmax[0] - tess.bmin[0])\n\th := (tess.bmax[1] - tess.bmin[1])\n\n\t// If the bbox is empty, ensure that sentinels are not coincident by\n\t// slightly enlarging it.\n\t// TODO: This hack was introduced at https://github.com/memononen/libtess2/commit/d7c34ac3ff11993b0fc0395fe7d96f4cc75e6bb6.\n\t// Is this logic correct?\n\tsmin := tess.bmin[0] - adjust(w)\n\tsmax := tess.bmax[0] + adjust(w)\n\ttmin := tess.bmin[1] - adjust(h)\n\ttmax := tess.bmax[1] + adjust(h)\n\n\taddSentinel(tess, smin, smax, tmin)\n\taddSentinel(tess, smin, smax, tmax)\n}", "title": "" }, { "docid": "25788aa53370c9774be6bf9cf821b3d1", "score": "0.39842126", "text": "func init() {\n\tlog.Println(\"Loading Config\")\n\tloadConfig()\n\n\tlog.Println(\"Loading Templates\")\n\tloadTemplates()\n\n\tlog.Println(\"Loading Pages\")\n\tloadPages()\n\n\tlog.Println(\"Loading Posts\")\n\tloadPosts()\n\n\tlog.Println(\"Loading Tags\")\n\tloadTags()\n\n\tn := 5\n\n\tif len(postsJSON) < 5 {\n\t\tn = len(postsJSON)\n\t}\n\n\tsidebarAssets = &Sidebar{postsJSON[0:n], tags, pages}\n}", "title": "" }, { "docid": "c050f4e8ee99ab83d62d52638b3bcaa1", "score": "0.39787206", "text": "func (n *Trie) Init() {\n\t*n = Trie{\n\t\tChildren: make(map[rune]*Trie),\n\t\tIsWord: false,\n\t}\n}", "title": "" }, { "docid": "23596c5d76cb4e39b9367a93b7dca9fa", "score": "0.39696038", "text": "func (o *ElementaryTrapz) Init(f fun.Ss, a, b, eps float64) {\n\to.n = 0\n\to.f = f\n\to.a = a\n\to.b = b\n\to.eps = eps\n}", "title": "" }, { "docid": "e1fc4bc5757ca8ce54a10b5b635cf5c4", "score": "0.39604038", "text": "func (gw *GridWriter) init() {\n\tif len(gw.Grid) <= gw.CurrentRow {\n\t\tgw.Grid = append(gw.Grid, []Cell{})\n\t}\n}", "title": "" }, { "docid": "24a8cd8fe9e64bb93adc6880315871c5", "score": "0.3960166", "text": "func init() {\n\tarrange.Register(thresholdRegName, &ThresholdCreator{})\n}", "title": "" }, { "docid": "3cfe1fc3429064d4d792966750c37268", "score": "0.39574727", "text": "func (o *FdmLaplacian) InitWithGrid(gtype string, xmin, xmax []float64, ndiv []int) (g *gm.Grid) {\n\tg = new(gm.Grid)\n\tg.GenUniform(xmin, xmax, ndiv, false)\n\to.g = g\n\treturn\n}", "title": "" }, { "docid": "7284e5ade4dbd47a55746da8aa0b30b6", "score": "0.39552015", "text": "func InitStations(d Database) {\n\tlog.WithFields(log.Fields{\n\t\t\"logger\": \"db.init\",\n\t}).Info(\"Checking and initializing stations settings structures.\")\n\tCreateTableIfNeeded(d, StationsTable)\n\tupdateSettingsIndexes(d)\n}", "title": "" }, { "docid": "78403b1df2515dc5502de413b633dc19", "score": "0.39542344", "text": "func (m *nodemap) init() {\n\tif m.index == nil {\n\t\tm.index = make(map[string]int, DefaultNodeMapCapacity)\n\t\tm.pairs = make([]namenode, 0, DefaultNodeMapCapacity)\n\t}\n}", "title": "" }, { "docid": "ba3a00a486df218e6bdec024ceb6467e", "score": "0.39513737", "text": "func (t *Template) initDefaults() {\n\t// Create the map.\n\tt.pluginDataMap = make(pluginDataMap)\n\n\t// Set the bulldozer template functions.\n\tt.Funcs(bulldozerFuncMap)\n\n\t// Create a new emitter and set the recover function\n\tt.emitter = emission.NewEmitter().\n\t\tRecoverWith(recoverEmitter)\n}", "title": "" }, { "docid": "664cd92c97c0ddcd84925a56c4ab62da", "score": "0.39475065", "text": "func initTxMap() {\n\tcommonTxMapInit()\n\tvoteTxMapInit()\n\tsystemTxMapInit()\n\tbonusTxMapInit()\n\n}", "title": "" }, { "docid": "8cde33f55f0f701c8c68be46307199bb", "score": "0.39422116", "text": "func (g *Game) initialize() {\n\tvar wg sync.WaitGroup\n\tfor _, ps := range g.parts {\n\t\tfor _, p := range ps {\n\t\t\twg.Add(1)\n\t\t\tgo p.drawPart(&wg)\n\t\t\twg.Add(1)\n\t\t\tgo p.updateGhostCells(&wg)\n\t\t}\n\t}\n\twg.Wait()\n}", "title": "" }, { "docid": "5dec927af614c35a989198a42978df26", "score": "0.39325863", "text": "func DoInit(world *GameState, params map[string]int) {\n\tworld.Log(\"init do nothing\")\n}", "title": "" }, { "docid": "a139d6db8fa16a6be04f7c9ee72c0724", "score": "0.39300424", "text": "func (level *Level) CreateTiles() ([]MapTile, []MapTile) {\n\tgd := NewGameData()\n\ttiles := make([]MapTile, gd.ScreenHeight*gd.ScreenWidth)\n\twalls := make([]MapTile, gd.ScreenHeight*gd.ScreenWidth)\n\n\t// TODO:: this should use the asset atlas .. if it worked\n\tfloorTile, _, err := ebitenutil.NewImageFromFile(\"assets/kenney-dungeon/Isometric/stone_E.png\");\n\tif err != nil {\n\t\tlog.Fatal(err)\n\t}\n\twallE, _, err := ebitenutil.NewImageFromFile(\"assets/kenney-dungeon/Isometric/stoneWall_E.png\");\n\tif err != nil {\n\t\tlog.Fatal(err)\n\t}\n\twallW, _, err := ebitenutil.NewImageFromFile(\"assets/kenney-dungeon/Isometric/stoneWall_W.png\");\n\tif err != nil {\n\t\tlog.Fatal(err)\n\t}\n\twallN, _, err := ebitenutil.NewImageFromFile(\"assets/kenney-dungeon/Isometric/stoneWall_N.png\");\n\tif err != nil {\n\t\tlog.Fatal(err)\n\t}\n\twallS, _, err := ebitenutil.NewImageFromFile(\"assets/kenney-dungeon/Isometric/stoneWall_S.png\");\n\tif err != nil {\n\t\tlog.Fatal(err)\n\t}\n\n\tindex := 0\n\n\tfor x := 0; x < gd.ScreenWidth; x++ {\n\t\tfor y := 0; y < gd.ScreenHeight; y++ {\n\t\t\tindex = level.GetIndexFromXY(x, y)\n\t\t\t// TODO:: more tiles and isometric facing walls and stuff\n\t\t\ttile := MapTile{\n\t\t\t\tPixelX: x * gd.TileWidth,\n\t\t\t\tPixelY: y * gd.TileWidth, // we are ignoring tile height here\n\t\t\t\tBlocked: false,\n\t\t\t\tImage: floorTile,\n\t\t\t\tLabel: \"floor\",\n\t\t\t}\n\t\t\t\n\t\t\t// TODO:: place walls via mapgen instead of just on borders\n\t\t\tif x == 0 || x == gd.ScreenWidth-1 || y == 0 || y == gd.ScreenHeight - 1 {\n\t\t\t\ttile.Blocked = true\n\t\t\t\twall := MapTile{\n\t\t\t\t\tPixelX: x * gd.TileWidth,\n\t\t\t\t\tPixelY: y * gd.TileWidth, // we are ignoring tile height here\n\t\t\t\t\tBlocked: false,\n\t\t\t\t\tLabel: \"wall\",\n\t\t\t\t}\n\t\t\t\twall.Blocked = true\n\t\t\t\tif x == 0 {\n\t\t\t\t\twall.Image = wallE\n\t\t\t\t} else if x == gd.ScreenWidth - 1 {\n\t\t\t\t\twall.Image = wallW\n\t\t\t\t} else if y == 0 {\n\t\t\t\t\twall.Image = wallS\n\t\t\t\t} else {\n\t\t\t\t\twall.Image =wallN\n\t\t\t\t}\n\t\t\t\twalls[index] = wall\n\t\t\t}\n\t\t\ttiles[index] = tile\n\t\t\t\n\t\t}\n\t}\n\treturn tiles, walls\n}", "title": "" }, { "docid": "2f74822783e1fbb428c9f5f1e2df2beb", "score": "0.3928662", "text": "func (s *SmartContract) InitLedger(ctx contractapi.TransactionContextInterface) error {\n\tloans := []Loan{\n\t\tLoan{Value: \"5.00\", SenderName: \"Bank of Beijing\", RecverName: \"YiweiLi\", Timestamp: \"2020-09-02 15:04:05\"},\n\t\tLoan{Value: \"3.00\", SenderName: \"YiweiLi\", RecverName: \"Bank of Beijing\", Timestamp: \"2020-10-03 15:04:05\"},\n\t\tLoan{Value: \"3.00\", SenderName: \"Bank of China\", RecverName: \"Test\", Timestamp: \"2020-11-01 15:59:59\"},\n\t\tLoan{Value: \"3.00\", SenderName: \"Test\", RecverName: \"Bank of China\", Timestamp: \"2020-11-02 15:59:59\"},\n\t}\n\n\tfor i, loan := range loans {\n\t\tloanAsBytes, _ := json.Marshal(loan)\n\t\terr := ctx.GetStub().PutState(\"TX\"+strconv.Itoa(i), loanAsBytes)\n\n\t\tif err != nil {\n\t\t\treturn fmt.Errorf(\"Failed to put to world state. %s\", err.Error())\n\t\t}\n\t}\n\n\treturn nil\n}", "title": "" }, { "docid": "a576b645bd229d49ffb2e68a79dc6c0d", "score": "0.39230278", "text": "func (m *MultiLRUCache) Init(buckets, bucket_capacity uint) {\n\tm.buckets = buckets\n\tm.cache = make([]*LRUCache, buckets)\n\tfor i := uint(0); i < buckets; i++ {\n\t\tm.cache[i] = NewLRUCache(bucket_capacity)\n\t}\n}", "title": "" }, { "docid": "7c42819778eb7b484d8dc0efa9cb446d", "score": "0.39210787", "text": "func (blockchain *Blockchain) Init() {\n\tblockchain.height = -1 //Set to -1 since we are about to add genesis (0)\n\tfor i := 0; i < STARTING_BLOCKS; i++ {\n\t\tblockchain.pushToChain(Block{\n\t\t\ti, BASElINE_DIFFICULTY, i * blockchain.expectedBlockTime, true})\n\t}\n\tblockchain.forkHeight = 0\n\tblockchain.nextDifficulty = BASElINE_DIFFICULTY\n\tblockchain.nextPrivateDifficulty = BASElINE_DIFFICULTY\n\t//blockchain.chainType = unassigned\n}", "title": "" }, { "docid": "2b5fca71bd3bd8c5ad07981f1a31a6c9", "score": "0.39092952", "text": "func (r *NodeRunnerBase) init(numPeers int) {\n\tr.initPeerChannels(numPeers)\n\tr.initCases()\n}", "title": "" }, { "docid": "38271c98086c6120a793a7555e926884", "score": "0.38972402", "text": "func (tape *MagTape6026T) MtInit(dev int, bus *BusT, statsChan chan MtStatT, logID int, debugLogging bool) bool {\n\ttape.mtMu.Lock()\n\ttape.devNum = dev\n\ttape.bus = bus\n\ttape.logID = logID\n\ttape.debugLogging = debugLogging\n\ttape.commandSet[mtCmdRead] = mtCmdReadBits\n\ttape.commandSet[mtCmdRewind] = mtCmdRewindBits\n\ttape.commandSet[mtCmdCtrlMode] = mtCmdCtrlModeBits\n\ttape.commandSet[mtCmdSpaceFwd] = mtCmdSpaceFwdBits\n\ttape.commandSet[mtCmdSpaceRev] = mtCmdSpaceRevBits\n\ttape.commandSet[mtCmdWrite] = mtCmdWiteBits\n\ttape.commandSet[mtCmdWriteEOF] = mtCmdWriteEOFBits\n\ttape.commandSet[mtCmdErase] = mtCmdEraseBits\n\ttape.commandSet[mtCmdReadNonStop] = mtCmdReadNonStopBits\n\ttape.commandSet[mtCmdUnload] = mtCmdUnloadBits\n\ttape.commandSet[mtCmdDriveMode] = mtCmdDriveModeBits\n\n\ttape.bus.SetResetFunc(tape.devNum, tape.MtReset)\n\ttape.bus.SetDataInFunc(tape.devNum, tape.mtDataIn)\n\ttape.bus.SetDataOutFunc(tape.devNum, tape.mtDataOut)\n\n\tgo tape.mtStatSender(statsChan)\n\n\ttape.statusReg1 = mtSr1HiDensity | mtSr19Track | mtSr1UnitReady\n\ttape.statusReg2 = mtSr2PEMode\n\ttape.mtMu.Unlock()\n\n\tlogging.DebugPrint(tape.logID, \"mt Initialised via call to mtInit()\\n\")\n\treturn true\n}", "title": "" }, { "docid": "2c42b59f9bb52080db5549ff0b82d7da", "score": "0.3893777", "text": "func (nlc *nlc) init() {\n\tnlc.m = make(map[string]*lockInfo, initCapacity)\n}", "title": "" }, { "docid": "b3c80c46ad96efe4ca6a94d00c762463", "score": "0.38933367", "text": "func Init(cfg Config, datadir string, zoneLock sync.Locker, shutdown <-chan struct{}, wg *sync.WaitGroup) error {\n\tif err := loadLocTempl(datadir); err != nil {\n\t\treturn err\n\t}\n\n\tchatMode = cfg.ChatMode\n\n\t// ensure that require or deny have the corresponding on or off default\n\tswitch cfg.ChatMode.Mode {\n\tcase ChatModeRequire:\n\t\tchatMode.Default = true\n\tcase ChatModeDeny:\n\t\tchatMode.Default = false\n\tdefault:\n\t\t// whatever the config set is fine.\n\t}\n\tinitCommands(cfg.Commands)\n\treturn loadWorld(datadir, zoneLock, shutdown, wg)\n}", "title": "" }, { "docid": "66a1be6daa07e00392aa4b9cbd0670ad", "score": "0.38782147", "text": "func (room *RoomInformation) Init(rs *models.RoomSettings, id string,\n\tdbRoomID int32, location *time.Location) {\n\n\troom.setID(utils.RandomString(16))\n}", "title": "" }, { "docid": "0c282c9d1da09c23976004860bf78131", "score": "0.38764462", "text": "func initializeRing(conf *Config, trans Transport) (*Ring, error) {\n\t// Initialize the hash bits\n\tconf.hashBits = conf.HashFunc().Size() * 8\n\n\t// Initialize vivaldi coordinate client using the config\n\tcoord, err := coordinate.NewClient(conf.Coordinate)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\t// Init stabilizer\n\tstab := newAdaptiveStabilize(conf.StabilizeMin, conf.StabilizeMax,\n\t\tconf.StabilizeThresh, conf.StabilizeStayCount)\n\n\t// Initialize a ring\n\tring := &Ring{\n\t\tcoordClient: coord,\n\t\tstab: stab,\n\t}\n\tring.init(conf, trans)\n\n\treturn ring, nil\n}", "title": "" }, { "docid": "9c783635e49f1b6aaaf54e47d755eddf", "score": "0.38736078", "text": "func (dr *DeferredRenderer) Init(width, height int32) error {\n\tdr.width = width\n\tdr.height = height\n\tdr.Frame = gfx.GenFramebuffer()\n\n\t// setup the depth buffer\n\tdr.Depth = gfx.GenRenderbuffer()\n\tgfx.BindRenderbuffer(graphics.RENDERBUFFER, dr.Depth)\n\tgfx.RenderbufferStorage(graphics.RENDERBUFFER, graphics.DEPTH_COMPONENT24, width, height)\n\n\t// setup the diffuse texture\n\tdr.Diffuse = gfx.GenTexture()\n\tgfx.ActiveTexture(graphics.TEXTURE0)\n\tgfx.BindTexture(graphics.TEXTURE_2D, dr.Diffuse)\n\tgfx.TexImage2D(graphics.TEXTURE_2D, 0, graphics.RGBA32F, width, height, 0, graphics.RGBA, graphics.FLOAT, nil, 0)\n\tgfx.TexParameterf(graphics.TEXTURE_2D, graphics.TEXTURE_MAG_FILTER, graphics.LINEAR)\n\tgfx.TexParameterf(graphics.TEXTURE_2D, graphics.TEXTURE_MIN_FILTER, graphics.LINEAR)\n\tgfx.TexParameterf(graphics.TEXTURE_2D, graphics.TEXTURE_WRAP_S, graphics.CLAMP_TO_EDGE)\n\tgfx.TexParameterf(graphics.TEXTURE_2D, graphics.TEXTURE_WRAP_T, graphics.CLAMP_TO_EDGE)\n\n\t// setup the positions texture\n\tdr.Positions = gfx.GenTexture()\n\tgfx.ActiveTexture(graphics.TEXTURE1)\n\tgfx.BindTexture(graphics.TEXTURE_2D, dr.Positions)\n\tgfx.TexImage2D(graphics.TEXTURE_2D, 0, graphics.RGBA32F, width, height, 0, graphics.RGBA, graphics.FLOAT, nil, 0)\n\tgfx.TexParameterf(graphics.TEXTURE_2D, graphics.TEXTURE_MAG_FILTER, graphics.LINEAR)\n\tgfx.TexParameterf(graphics.TEXTURE_2D, graphics.TEXTURE_MIN_FILTER, graphics.LINEAR)\n\tgfx.TexParameterf(graphics.TEXTURE_2D, graphics.TEXTURE_WRAP_S, graphics.CLAMP_TO_EDGE)\n\tgfx.TexParameterf(graphics.TEXTURE_2D, graphics.TEXTURE_WRAP_T, graphics.CLAMP_TO_EDGE)\n\n\t// setup the normals texture\n\tdr.Normals = gfx.GenTexture()\n\tgfx.ActiveTexture(graphics.TEXTURE2)\n\tgfx.BindTexture(graphics.TEXTURE_2D, dr.Normals)\n\tgfx.TexImage2D(graphics.TEXTURE_2D, 0, graphics.RGBA16F, width, height, 0, graphics.RGBA, graphics.FLOAT, nil, 0)\n\tgfx.TexParameterf(graphics.TEXTURE_2D, graphics.TEXTURE_MAG_FILTER, graphics.LINEAR)\n\tgfx.TexParameterf(graphics.TEXTURE_2D, graphics.TEXTURE_MIN_FILTER, graphics.LINEAR)\n\tgfx.TexParameterf(graphics.TEXTURE_2D, graphics.TEXTURE_WRAP_S, graphics.CLAMP_TO_EDGE)\n\tgfx.TexParameterf(graphics.TEXTURE_2D, graphics.TEXTURE_WRAP_T, graphics.CLAMP_TO_EDGE)\n\n\t// now bind all of these things to the framebuffer\n\tgfx.BindFramebuffer(graphics.FRAMEBUFFER, dr.Frame)\n\tgfx.FramebufferRenderbuffer(graphics.FRAMEBUFFER, graphics.DEPTH_ATTACHMENT, graphics.RENDERBUFFER, dr.Depth)\n\tgfx.FramebufferTexture2D(graphics.FRAMEBUFFER, graphics.COLOR_ATTACHMENT0, graphics.TEXTURE_2D, dr.Diffuse, 0)\n\tgfx.FramebufferTexture2D(graphics.FRAMEBUFFER, graphics.COLOR_ATTACHMENT1, graphics.TEXTURE_2D, dr.Positions, 0)\n\tgfx.FramebufferTexture2D(graphics.FRAMEBUFFER, graphics.COLOR_ATTACHMENT2, graphics.TEXTURE_2D, dr.Normals, 0)\n\n\t// how did it all go? lets find out ...\n\tstatus := gfx.CheckFramebufferStatus(graphics.FRAMEBUFFER)\n\tswitch {\n\tcase status == graphics.FRAMEBUFFER_UNSUPPORTED:\n\t\treturn fmt.Errorf(\"Failed to create the deferred rendering pipeline because the framebuffer was unsupported.\\n\")\n\tcase status != graphics.FRAMEBUFFER_COMPLETE:\n\t\treturn fmt.Errorf(\"Failed to create the deferred rendering pipeline. Code 0x%x\\n\", status)\n\t}\n\n\tgfx.BindFramebuffer(graphics.FRAMEBUFFER, 0)\n\n\t// create a plane for the composite pass\n\tgroggy.Logsf(\"DEBUG\", \"Creatiing composite plane %dx%d.\", width, height)\n\tcp := CreatePlaneXY(\"composite\", 0, 0, float32(width), float32(height))\n\tcp.Core.Tex0 = gfx.GenTexture()\n\tgfx.BindTexture(graphics.TEXTURE_2D, cp.Core.Tex0)\n\tgfx.TexParameterf(graphics.TEXTURE_2D, graphics.TEXTURE_MAG_FILTER, graphics.LINEAR)\n\tgfx.TexParameterf(graphics.TEXTURE_2D, graphics.TEXTURE_MIN_FILTER, graphics.LINEAR)\n\tgfx.TexParameterf(graphics.TEXTURE_2D, graphics.TEXTURE_WRAP_S, graphics.REPEAT)\n\tgfx.TexParameterf(graphics.TEXTURE_2D, graphics.TEXTURE_WRAP_T, graphics.REPEAT)\n\tgfx.BindTexture(graphics.TEXTURE_2D, 0)\n\tdr.CompositePlane = cp\n\n\treturn nil\n}", "title": "" }, { "docid": "4abfb59cf3a45e84d7a6aab9ff23ff0b", "score": "0.3865522", "text": "func init() {\n\tlog.SetFlags(log.Ltime | log.Lshortfile)\n\tlog.Println(\"init() function called! :)\")\n\twasInit = true\n\n\trand.Seed(time.Now().UnixNano())\n}", "title": "" }, { "docid": "6b21a21349b2c6fbcecad4911867bacc", "score": "0.38611963", "text": "func (pm *patternMap) init() {\n\tpm.Lock()\n\tdefer pm.Unlock()\n\tpm.subjects = map[string]string{}\n}", "title": "" }, { "docid": "6080396a9996d5e43baca70fb7bea9bc", "score": "0.38555908", "text": "func NewWorld(maxAnts int) *World {\n\tmaxPheromones := maxAnts * int(pheromoneDuration/antPheromoneFrequency) * 2\n\n\tworld := &World{\n\t\tAnts: make([]*Ant, maxAnts),\n\t\tPheromones: NewPheromoneStorage(maxPheromones),\n\t\tFood: NewFood(mgl32.Vec2{0.2, 0.2}),\n\t\tHole: NewHole(mgl32.Vec2{0.8, 0.8}),\n\t\tMaxPheromones: maxPheromones,\n\t}\n\tfor i := 0; i < maxAnts; i++ {\n\t\tworld.Ants[i] = NewAnt(util.RandomPoint())\n\t\tif i == 0 {\n\t\t\tworld.Ants[i].IsRed = true\n\t\t}\n\t}\n\treturn world\n}", "title": "" }, { "docid": "4fe778da8de6a7c0fa4ebc5bb2f2b22c", "score": "0.38513872", "text": "func (p *Polygon) initEdgeTable() {\n\tfor i := 0; i < 200; i++ {\n\t\tp.edge_table[i][0].x = -1\n\t\tp.edge_table[i][1].x = -1\n\t}\n\tp.poly_minY = 200\n\tp.poly_maxY = -1\n}", "title": "" }, { "docid": "a94ed5fc344c53e9c5301b74bfe5a6f0", "score": "0.38489738", "text": "func init() {\n\n\tlog.Println(\"main.init\")\n\t// log path setting\n\tRootPath, err := os.Getwd()\n\tutil.Assert(err)\n\tlogPath := RootPath + config.ConstConfigLogPath\n\tlogFile, _ := os.Create(logPath)\n\n\t// request log out put, file and terminate stdout\n\tgin.DefaultWriter = io.MultiWriter(logFile, os.Stdout)\n}", "title": "" }, { "docid": "eef55fa797eb317d3b1893036dd47238", "score": "0.384864", "text": "func (p *HelloWorld) Init() error {\n\tlog.Println(\"Hello World!\")\n\tp.Universe.RegisterWorld(\"Arrakis\", 10)\n\treturn nil\n}", "title": "" }, { "docid": "8cf93b50620db3b97828befcccec8273", "score": "0.3847751", "text": "func (p *Policy) Init(threshold int, attributes_array []string) {\n\t \tp.rnd = util.GetRand()\n\t \tp.s = util.RandModOrder(p.rnd) // je pense propre à la policy\t\n\t\tp.Attr_proof = attributes_array\n\t \t//construction du noeud racine\n\t \tp.tree_nodes = make([]*node.NODE,1)\n\t \tp.tree_nodes[0] = new (node.NODE)\n\t \tp.tree_nodes[0].X = make([]*curve.BIG,1)\n\t p.tree_nodes[0].Y = make([]*curve.BIG,1)\n\t p.tree_nodes[0].X[0] = curve.NewBIGint(0)\n\t p.tree_nodes[0].Y[0] = p.s\n\n\t p.tree_nodes[0].Threshold = threshold\n\t\tfor i := len(p.tree_nodes[0].X) ; i<threshold;i++ {\n\t \t\tp.tree_nodes[0].X = append(p.tree_nodes[0].X,curve.NewBIGint(10+i))\n\t \t\tp.tree_nodes[0].Y = append(p.tree_nodes[0].Y,util.RandModOrder(p.rnd))\n\t\t}\n}", "title": "" }, { "docid": "e5e13164210550315fc7c3802dbd95ee", "score": "0.38459113", "text": "func (t *tars) Init(gen *generator.Generator) {\n\tt.gen = gen\n}", "title": "" }, { "docid": "9cbe998dc1fc32dbd2b17e555cb77fbd", "score": "0.3838996", "text": "func InitRepository(chainConfig config.RepositoryConfig, eventCenter types.EventCenter) error {\n\tlock.Lock()\n\tdefer lock.Unlock()\n\tif initialized {\n\t\tlog.Warn(\"Chain repository has been initialized\")\n\t}\n\tlog.Info(\"Start initializing block chain\")\n\tswitch chainConfig.PluginName {\n\tcase PLUGIN_LEVELDB:\n\t\tif chainConfig.StateDataPath == chainConfig.BlockDataPath {\n\t\t\tlog.Error(\"Statedb path should be different with Blockdb path\")\n\t\t\treturn fmt.Errorf(\"statedb path should be different with blockdb path\")\n\t\t}\n\t\t// create statedb low level database.\n\t\tlevelDB, err := leveldb.New(chainConfig.StateDataPath, 0, 0, \"\")\n\t\tif err != nil {\n\t\t\tlog.Error(\"Failed to create levelDB for Statedb, as: %v\", err)\n\t\t\treturn err\n\t\t}\n\t\t// create blockstore\n\t\tbstore, err := blockstore.NewBlockStore(&blkconf.BlockStoreConfig{\n\t\t\tPluginName: PLUGIN_LEVELDB,\n\t\t\tDataPath: chainConfig.BlockDataPath,\n\t\t})\n\t\tif err != nil {\n\t\t\tlog.Error(\"Failed to create file-based block store, as: %v\", err)\n\t\t\treturn err\n\t\t}\n\t\tstateDiskDB = levelDB\n\t\tglobalBlockStore = bstore\n\tcase PLUGIN_MEMDB:\n\t\tstateDiskDB = memorydb.New()\n\t\t// create blockstore\n\t\tbstore, err := blockstore.NewBlockStore(&blkconf.BlockStoreConfig{\n\t\t\tPluginName: PLUGIN_MEMDB,\n\t\t\tDataPath: \"\",\n\t\t})\n\t\tif err != nil {\n\t\t\tlog.Error(\"Failed to create memory-based block store, as: %v\", err)\n\t\t\treturn err\n\t\t}\n\t\tglobalBlockStore = bstore\n\tdefault:\n\t\tlog.Error(\"Unsupported plugin type: %s \", chainConfig.PluginName)\n\t\treturn fmt.Errorf(\"Unsupported plugin type: %s \", chainConfig.PluginName)\n\t}\n\n\tglobalEventCenter = eventCenter\n\tinitialized = true\n\treturn nil\n}", "title": "" }, { "docid": "a229e14b264879240e520f946a1e5c8b", "score": "0.3838786", "text": "func (s *SmartContract) InitLedger(ctx contractapi.TransactionContextInterface) error {\n\n\tassets := []Asset{\n\t\n\t\t{ID: \"asset1\", Owner: \"DennisRitchie\", AppraisedValue: 10},\n\t\t\n\t\t{ID: \"asset2\", Owner: \"BjarneStroustrup\", AppraisedValue: 10},\n\t\t\n\t\t{ID: \"asset3\", Owner: \"RasmusLerdorf\", AppraisedValue: 10},\n\t\t\n\t\t{ID: \"asset4\", Owner: \"GuidoRossum\", AppraisedValue: 10},\n\t\t\n\t\t{ID: \"asset5\", Owner: \"LinusTorvalds\", AppraisedValue: 10},\n\t\t\n\t\t{ID: \"asset6\", Owner: \"AlanTuring\", AppraisedValue: 10},\n\t\t\n\t\t{ID: \"asset7\", Owner: \"GeoffreyHinton\", AppraisedValue: 10},\n\n\n\tfor _, asset := range assets {\n\t\tassetJSON, err := json.Marshal(asset)\n\t\tif err != nil {\n\t\t\treturn err\n\t\t}\n\n\t\terr = ctx.GetStub().PutState(asset.ID, assetJSON)\n\t\tif err != nil {\n\t\t\treturn fmt.Errorf(\"failed to add to world state. %v\", err)\n\t\t}\n\t}\n\n\treturn nil\n}\n\n// Creating an asset according to given values\nfunc (s *SmartContract) CreateAsset(ctx contractapi.TransactionContextInterface, id string, owner string, appraisedValue int) error {\n\texists, err := s.AssetExists(ctx, id)\n\tif err != nil {\n\t\treturn err\n\t}\n\tif exists {\n\t\treturn fmt.Errorf(\"asset %s already exists\", id)\n\t}\n\n\tasset := Asset{\n\t\tID: id,\n\n\t\tOwner: owner,\n\t\t\n\t\tAppraisedValue: appraisedValue,\n\t\t\n\t}\n\tassetJSON, err := json.Marshal(asset)\n\tif err != nil {\n\t\treturn err\n\t}\n\n\treturn ctx.GetStub().PutState(id, assetJSON)\n}\n\n// Retrieves values from world state\nfunc (s *SmartContract) ReadAsset(ctx contractapi.TransactionContextInterface, id string) (*Asset, error) {\n\tassetJSON, err := ctx.GetStub().GetState(id)\n\tif err != nil {\n\t\treturn nil, fmt.Errorf(\"failed to read from world state: %v\", err)\n\t}\n\tif assetJSON == nil {\n\t\treturn nil, fmt.Errorf(\"asset %s does not exist\", id)\n\t}\n\n\tvar asset Asset\n\terr = json.Unmarshal(assetJSON, &asset)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\treturn &asset, nil\n}\n\n// Updates an asset\nfunc (s *SmartContract) UpdateAsset(ctx contractapi.TransactionContextInterface, id string, owner string, appraisedValue int) error {\n\texists, err := s.AssetExists(ctx, id)\n\tif err != nil {\n\t\treturn err\n\t}\n\tif !exists {\n\t\treturn fmt.Errorf(\"asset %s does not exist\", id)\n\t}\n\n\t// overwriting original asset with the new one\n\tasset := Asset{\n\t\tID: id,\n\t\tOwner: owner,\n\t\tAppraisedValue: appraisedValue,\n\t}\n\tassetJSON, err := json.Marshal(asset)\n\tif err != nil {\n\t\treturn err\n\t}\n\n\treturn ctx.GetStub().PutState(id, assetJSON)\n}\n\n// Deletes asset\nfunc (s *SmartContract) DeleteAsset(ctx contractapi.TransactionContextInterface, id string) error {\n\texists, err := s.AssetExists(ctx, id)\n\tif err != nil {\n\t\treturn err\n\t}\n\tif !exists {\n\t\treturn fmt.Errorf(\"asset %s does not exist\", id)\n\t}\n\n\treturn ctx.GetStub().DelState(id)\n}\n\n// If the asset exists - 'true' is returned\nfunc (s *SmartContract) AssetExists(ctx contractapi.TransactionContextInterface, id string) (bool, error) {\n\tassetJSON, err := ctx.GetStub().GetState(id)\n\tif err != nil {\n\t\treturn false, fmt.Errorf(\"failed to read from world state: %v\", err)\n\t}\n\n\treturn assetJSON != nil, nil\n}\n\n// Changes ownership of an asset\nfunc (s *SmartContract) TransferAsset(ctx contractapi.TransactionContextInterface, id string, newOwner string) error {\n\tasset, err := s.ReadAsset(ctx, id)\n\tif err != nil {\n\t\treturn err\n\t}\n\n\tasset.Owner = newOwner\n\tassetJSON, err := json.Marshal(asset)\n\tif err != nil {\n\t\treturn err\n\t}\n\n\treturn ctx.GetStub().PutState(id, assetJSON)\n}\n\n// All the world state assets are retrieved\nfunc (s *SmartContract) GetAllAssets(ctx contractapi.TransactionContextInterface) ([]*Asset, error) {\n\t\n\tresultsIterator, err := ctx.GetStub().GetStateByRange(\"\", \"\")\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\tdefer resultsIterator.Close()\n\n\tvar assets []*Asset\n\tfor resultsIterator.HasNext() {\n\t\tqueryResponse, err := resultsIterator.Next()\n\t\tif err != nil {\n\t\t\treturn nil, err\n\t\t}\n\n\t\tvar asset Asset\n\t\terr = json.Unmarshal(queryResponse.Value, &asset)\n\t\tif err != nil {\n\t\t\treturn nil, err\n\t\t}\n\t\tassets = append(assets, &asset)\n\t}\n\n\treturn assets, nil\n}\n", "title": "" }, { "docid": "16b42511b3f52b32b1c4ea4d52baf5c2", "score": "0.38361824", "text": "func (tb *MapperCommon) Init() {\n}", "title": "" }, { "docid": "94f5675d47f728f634ec6f1b14856547", "score": "0.38353232", "text": "func InitializeMpt() *MerklePatriciaTrie {\n\tdb := make(map[string]Node)\n\troot := \"\"\n\treturn &MerklePatriciaTrie{db, root}\n}", "title": "" }, { "docid": "7b81a91f78f084d01e403781962b7c6c", "score": "0.38295183", "text": "func (x *TypeOneLRU) Initialize(ctx context.Context) error {\n\treturn nil\n}", "title": "" }, { "docid": "3b88d714cbb11ada30829c460cce341c", "score": "0.38246557", "text": "func (scene *Stage1) Initialize() {\n\tsimra.LogDebug(\"[IN]\")\n\n\tsimra.GetInstance().SetDesiredScreenSize(config.ScreenWidth, config.ScreenHeight)\n\n\t// add global touch listener to catch touch end event\n\tsimra.GetInstance().AddTouchListener(scene)\n\n\t// TODO: when goes to next scene, remove global touch listener\n\t// simra.GetInstance().RemoveTouchListener(Stage1)\n\n\tscene.resetPosition()\n\tscene.setupSprites()\n\tscene.registerViews()\n\tscene.registerModels()\n\tscene.remainingLife = remainingLifeAtStart\n\n\tsimra.GetInstance().AddCollisionListener(&scene.ball, &scene.obstacle[0], &scene.models)\n\tsimra.GetInstance().AddCollisionListener(&scene.ball, &scene.obstacle[1], &scene.models)\n\n\tscene.showReadyText()\n\tscene.gamestate = readyToStart\n\n\tsimra.LogDebug(\"[OUT]\")\n}", "title": "" }, { "docid": "68423574426079f594c45aaf976b22bb", "score": "0.38228178", "text": "func (nodes *Nodes) Init(logger log.Log) bool {\n\tnodes.NodesMap = map[string]Node{}\n\treturn true\n}", "title": "" }, { "docid": "d503aeacd7823434b72a9114eb436cb4", "score": "0.3810202", "text": "func (r *Registry) init() {\n\tr.lock.Lock(); defer r.lock.Unlock()\n\tif r.reg == nil {\n\t\tr.reg = make(map[int]FrameCallbackType)\n\t\tr.ann = make(map[int]interface{})\n\t\tr.slot = 0\n\t}\n}", "title": "" }, { "docid": "2297190d02d17e73575f554587753865", "score": "0.3795667", "text": "func performInitialization() {\n\temptyBoard = append(append(append(bytes.Repeat([]byte{' '}, N+1), '\\n'),\n\t\tbytes.Repeat(append([]byte{' '}, append(bytes.Repeat([]byte{'.'}, N), '\\n')...), N)...),\n\t\tbytes.Repeat([]byte{' '}, N+2)...)\n\n\tpat3set = pat3set_func()\n\n\tspatPatternDict = make(map[int]uint64) // hash(neighborhoodGridcular()) <- spatial id\n\tlargePatterns = make(map[uint64]float64) // hash(neighborhoodGridcular()) -> probability\n}", "title": "" }, { "docid": "503c71928dfee75cd88d9971e61d42f9", "score": "0.37944254", "text": "func (z *Rasterizer) Reset(w, h int) {\n\tif n := w * h; n > cap(z.area) {\n\t\tz.area = make([]float32, n)\n\t} else {\n\t\tz.area = z.area[:n]\n\t\tfor i := range z.area {\n\t\t\tz.area[i] = 0\n\t\t}\n\t}\n\tz.size = image.Point{w, h}\n\tz.first = f32.Vec2{}\n\tz.pen = f32.Vec2{}\n\tz.DrawOp = draw.Over\n}", "title": "" }, { "docid": "a5b25111fd634e69a18ce524a7b1b62b", "score": "0.37925103", "text": "func (ledger *Ledger) init() error {\n\n\t// genesis block\n\tblockHeader := new(pb.BlockHeader)\n\tblockHeader.TimeStamp = uint32(0)\n\tblockHeader.Nonce = uint32(100)\n\tblockHeader.Height = 0\n\n\tgenesisBlock := new(pb.Block)\n\tgenesisBlock.Header = blockHeader\n\twriteBatchs := ledger.block.AppendBlock(genesisBlock)\n\tif err := ledger.state.UpdateAsset(0, account.Address{}, account.Address{}, \"{}\"); err != nil {\n\t\tpanic(err)\n\t}\n\twriteBatchs = append(writeBatchs, ledger.state.WriteBatchs()...)\n\n\t// admin address\n\tbuf, err := contract.ConcrateStateJson(contract.DefaultAdminAddr)\n\tif err != nil {\n\t\treturn err\n\t}\n\n\twriteBatchs = append(writeBatchs,\n\t\tdb.NewWriteBatch(contract.ColumnFamily,\n\t\t\tdb.OperationPut,\n\t\t\t[]byte(contract.EnSmartContractKey(config.GlobalStateKey, config.AdminKey)),\n\t\t\tbuf.Bytes(), contract.ColumnFamily))\n\n\t// global contract\n\tbuf, err = contract.ConcrateStateJson(&contract.DefaultGlobalContract)\n\tif err != nil {\n\t\treturn err\n\t}\n\n\twriteBatchs = append(writeBatchs,\n\t\tdb.NewWriteBatch(contract.ColumnFamily,\n\t\t\tdb.OperationPut,\n\t\t\t[]byte(contract.EnSmartContractKey(config.GlobalStateKey, config.GlobalContractKey)),\n\t\t\tbuf.Bytes(), contract.ColumnFamily))\n\n\treturn ledger.dbHandler.AtomicWrite(writeBatchs)\n\n}", "title": "" }, { "docid": "266fde8fc7157669783ff67bcc33ba56", "score": "0.37769878", "text": "func InitWallet() *Wallet {\n\treturn &Wallet{}\n}", "title": "" }, { "docid": "91394f161c9c7bfa44b79231dac1693d", "score": "0.3774141", "text": "func init() {\n\tResourceTemplates = map[string]string{\n\t\t\"data-sources\": dataSourcesTpl,\n\t\t\"output\": outputTpl,\n\t\t\"provider\": providerTpl,\n\t\t\"resources\": resourcesTpl,\n\t\t\"variables\": variablesTpl,\n\t}\n}", "title": "" }, { "docid": "7a853320598c9c861f7c3a9e9ca48109", "score": "0.3771537", "text": "func (f *FftBasics) Init(log_n uint8) {\n\tf.log_n = log_n\n\tf.n = uint(1) << f.log_n\n\n\t// An n-th root of unity can be generated by 7^(5*(p-1)/n) mod p.\n\tf.MOD_W = mod_pow(7, (MOD_P-1)/uint64(f.n))\n\tf.MOD_W = mod_pow(f.MOD_W, 5)\n\tf.MOD_INVW = mod_inv(f.MOD_W)\n\n\tif log_n != 0 && mod_pow(f.MOD_W, uint64(f.n-1)) == 1 {\n\t\tpanic(\"Root of 1 is wrong: w ** (n-1) == 1\")\n\t}\n\tif mod_pow(f.MOD_W, uint64(f.n)) != 1 {\n\t\tpanic(\"Root of 1 is wrong: w ** n != 1\")\n\t}\n}", "title": "" }, { "docid": "4cd880799cf84a5190e4b6acfd3387dc", "score": "0.37686238", "text": "func InitializeTree(geneT Tree, speciesN int) {\n\tfor _, i := range geneT {\n\t\ti.cost = make(map[*Node]float64, speciesN)\n\t\ti.speciation = make(map[*Node]float64, speciesN)\n\t\ti.duplication = make(map[*Node]float64, speciesN)\n\t\ti.transfer = make(map[*Node]float64, speciesN)\n\t\ti.in = make(map[*Node]float64, speciesN)\n\t\ti.inAlt = make(map[*Node]float64, speciesN)\n\t\ti.out = make(map[*Node]float64, speciesN)\n\t}\n}", "title": "" }, { "docid": "8f9261aaef6b508305297d1660dbd35a", "score": "0.37667957", "text": "func Initialize(windowTitle string, windowWidth, windowHeight int, baseDir string) func() {\n\t// log print with .go file and line number.\n\tlog.SetFlags(log.Lshortfile)\n\t// avoid defaulting to stderr.\n\tlog.SetOutput(os.Stdout)\n\n\tasset.SetBaseDir(baseDir)\n\n\t// Initialize gl constants and the glfw window. Note that this must be done before all other gl usage.\n\tif view.Window != nil {\n\t\tlog.Fatal(\"GLFW Window already initialized\")\n\t}\n\tif err := view.Initialize(windowWidth, windowHeight, windowTitle); err != nil {\n\t\tlog.Fatal(err)\n\t}\n\n\t// Initialize Shaders\n\tif err := shader.Initialize(); err != nil {\n\t\tlog.Fatal(err)\n\t}\n\tif err := gl.GetError(); err != 0 {\n\t\tlog.Fatalf(\"gl error: %v\", err)\n\t}\n\tshader.Model.SetAmbientLight(&color.NRGBA{60, 60, 60, 0}) // 3D objects don't look 3D in max lighting, so tone it down as a default.\n\tshader.Model.SetDiffuse(mgl32.Vec3{0, 0, 1}, &color.NRGBA{150, 150, 150, 255})\n\n\t// Initialize singletons.\n\tmouse.Initialize(view.Window)\n\tkeyboard.Initialize(view.Window)\n\tfps.Initialize()\n\n\t// Load standard meshes (cubes, rectangles, etc). These depend on OpenGL buffers, which depend on having an OpenGL\n\t// context. They must be called sometime after glfw is initialized to work.\n\tmesh.Initialize()\n\n\treturn view.Terminate\n}", "title": "" }, { "docid": "3ac24b1c9e7e0e44ffe7821213eb4d59", "score": "0.37652874", "text": "func InitWorld(opt WorldOpt) (world *rbxmk.World, err error) {\n\tworld = rbxmk.NewWorld(lua.NewState(lua.Options{\n\t\tSkipOpenLibs: true,\n\t\tIncludeGoStackTrace: opt.Debug,\n\t}))\n\tworld.EnvHook = opt.EventHook\n\tif !opt.ExcludeRoots {\n\t\tif opt.InsecurePaths {\n\t\t\tworld.FS.SetSecured(false)\n\t\t}\n\t\tif wd, err := os.Getwd(); err == nil {\n\t\t\t// Working directory is an accessible root.\n\t\t\tworld.FS.AddRoot(wd)\n\t\t}\n\t\tfor _, root := range opt.IncludedRoots {\n\t\t\tworld.FS.AddRoot(root)\n\t\t}\n\t}\n\tvar libraries rbxmk.Libraries\n\tif !opt.ExcludeProgram {\n\t\tlibraries = append(libraries, ProgramLibrary)\n\t}\n\tlibraries = append(libraries, opt.IncludeLibraries...)\n\tsort.Sort(libraries)\n\tincluded := make(map[string]bool, len(libraries))\n\tfor _, lib := range libraries {\n\t\tincluded[lib.Name] = true\n\t}\n\tfor _, list := range opt.Libraries {\n\t\tfor _, name := range strings.Split(list, \",\") {\n\t\t\tname = strings.TrimSpace(name)\n\t\t\tif name == \"\" {\n\t\t\t\tcontinue\n\t\t\t}\n\t\t\tinclude := true\n\t\t\tswitch name[0] {\n\t\t\tcase '-':\n\t\t\t\tinclude = false\n\t\t\t\tname = name[1:]\n\t\t\tcase '+':\n\t\t\t\tinclude = true\n\t\t\t\tname = name[1:]\n\t\t\t}\n\t\t\tif name == \"*\" {\n\t\t\t\tfor lib := range included {\n\t\t\t\t\tincluded[lib] = include\n\t\t\t\t}\n\t\t\t} else if _, ok := included[name]; ok {\n\t\t\t\tincluded[name] = include\n\t\t\t}\n\t\t}\n\t}\n\t// Load negative-priority libraries before formats.\n\tfor _, lib := range libraries {\n\t\tif lib.Priority >= 0 {\n\t\t\tbreak\n\t\t}\n\t\tif !included[lib.Name] {\n\t\t\tcontinue\n\t\t}\n\t\tif err := world.Open(lib); err != nil {\n\t\t\treturn nil, err\n\t\t}\n\t}\n\tif !opt.ExcludeFormats {\n\t\tfor _, f := range formats.All() {\n\t\t\tworld.RegisterFormat(f())\n\t\t}\n\t}\n\tif !opt.ExcludeEnums {\n\t\tworld.RegisterEnums(enums.All()...)\n\t}\n\tfor _, lib := range libraries {\n\t\tif lib.Priority < 0 {\n\t\t\t// Already loaded negative-priority libraries.\n\t\t\tcontinue\n\t\t}\n\t\tif !included[lib.Name] {\n\t\t\tcontinue\n\t\t}\n\t\tif err := world.Open(lib); err != nil {\n\t\t\treturn nil, err\n\t\t}\n\t}\n\tfor _, arg := range opt.Args {\n\t\tworld.LuaState().Push(ParseLuaValue(arg))\n\t}\n\treturn world, nil\n}", "title": "" }, { "docid": "69f286b856a4cd8cd0f83a9dafb8ea5c", "score": "0.37652332", "text": "func (this *GlobalMercator) TileBounds(tx float64, ty float64, zoom int64) (float64, float64, float64, float64) {\n\tminx, miny := this.PixelsToMeters(tx*this.tileSize, ty*this.tileSize, zoom)\n\tmaxx, maxy := this.PixelsToMeters((tx+1)*this.tileSize, (ty+1)*this.tileSize, zoom)\n\treturn minx, miny, maxx, maxy\n}", "title": "" }, { "docid": "d89d804f1b3ef9a778aca701a34a933d", "score": "0.3761198", "text": "func (pTypeDef *MapArrayTest) Init() *MapArrayTest {\n\tif pTypeDef.Locations == nil {\n\t\tpTypeDef.Locations = make(map[string]ArrayOfInt)\n\t}\n\treturn pTypeDef\n}", "title": "" }, { "docid": "ffe34f8903de1cb3505d2b52ece8936d", "score": "0.37600544", "text": "func (o *DistFrechet) Init(p *Variable) {\n\to.L, o.C, o.A = p.L, p.C, p.A\n\tif math.Abs(o.C) < 1e-15 {\n\t\to.C = 1\n\t}\n\tp.M = o.Mean()\n\tp.S = math.Sqrt(o.Variance())\n}", "title": "" }, { "docid": "094fb7cacad05098fad1fc00d7c90547", "score": "0.37544614", "text": "func (obj *NormalEstimator) Initialize(p ThreadPool) error {\n obj.sum_g = make( []float64, p.NumberOfThreads())\n obj.sum_m = make( [][]float64, p.NumberOfThreads())\n obj.sum_s = make([][][]float64, p.NumberOfThreads())\n for i := 0; i < p.NumberOfThreads(); i++ {\n obj.sum_g[i] = 0.0\n obj.sum_m[i] = make( []float64, obj.n)\n obj.sum_s[i] = make([][]float64, obj.n)\n for j := 0; j < obj.n; j++ {\n obj.sum_s[i][j] = make([]float64, obj.n)\n }\n }\n obj.gamma_max = 0.0\n return nil\n}", "title": "" }, { "docid": "f5df790754cdeb56c9acdaae640bac00", "score": "0.37534148", "text": "func (c *Chip8) init() {\n\tc.pc = programStart // program counter starts at 0x200\n\tc.sp = 0\n\tc.index = 0\n\tc.delayTimer = 0\n\tc.SoundTimer = 0\n\n\t// clear Register.\n\tfor i := range c.v {\n\t\tc.v[i] = 0\n\t}\n\n\t// clear call stack.\n\tfor i := range c.stack {\n\t\tc.stack[i] = 0\n\t}\n\n\t// clear graphics.\n\tfor i := range c.Video {\n\t\tc.Video[i] = 0\n\t}\n\n\t// init Key.\n\tfor i := range c.Key {\n\t\tc.Key[i] = 0\n\t}\n\n\t// load the fontset into memory. By convention, fontset occupies 0x50-0x9F.\n\tfor i, font := range fontSet {\n\t\tc.memory[fontStart+i] = font\n\t}\n}", "title": "" }, { "docid": "957dc64231b8cc7b1ba2bca14ef76502", "score": "0.3750623", "text": "func (s *Solver) Init(popSize int) error {\n\tnumGenes := float32(s.Map.StepsAllowed) * genomePaddingRatio\n\ts.species = genetics.NewSpecies(int(numGenes), 3)\n\ts.population = make([]genetics.Chromosome, popSize)\n\tfor i := 0; i < popSize; i++ {\n\t\ts.population[i], _ = s.species.NewRand(s.Rand)\n\t}\n\n\treturn nil\n}", "title": "" }, { "docid": "e0a7cd2ebe0b454399ef167bdde5b6ab", "score": "0.37494856", "text": "func (mem *Mempool) InitWAL() {\n\twalDir := mem.config.WalDir()\n\terr := cmn.EnsureDir(walDir, 0700)\n\tif err != nil {\n\t\tpanic(errors.Wrap(err, \"Error ensuring Mempool WAL dir\"))\n\t}\n\taf, err := auto.OpenAutoFile(walDir + \"/wal\")\n\tif err != nil {\n\t\tpanic(errors.Wrap(err, \"Error opening Mempool WAL file\"))\n\t}\n\tmem.wal = af\n}", "title": "" }, { "docid": "9acf50ffb19abbef4615f7f1573b7ab7", "score": "0.37353578", "text": "func (smote *Runtime) Init() {\n\trand.Seed(time.Now().UnixNano())\n\n\tif smote.K <= 0 {\n\t\tsmote.K = resampling.DefaultK\n\t}\n\tif smote.PercentOver <= 0 {\n\t\tsmote.PercentOver = resampling.DefaultPercentOver\n\t}\n}", "title": "" }, { "docid": "1bc7612a3769a94f81da4b9cfe79eaee", "score": "0.37307864", "text": "func (db *DB) InitStateTree(depth uint64, genesisAccounts []UserState) error {\n\t// calculate total number of leaves\n\ttotalLeaves := math.Exp2(float64(depth))\n\tif int(totalLeaves) != len(genesisAccounts) {\n\t\treturn errors.New(\"Depth and number of leaves do not match\")\n\t}\n\tdb.Logger.Debug(\"Attempting to init balance tree\", \"totalAccounts\", totalLeaves)\n\n\tvar err error\n\n\t// insert coodinator leaf\n\terr = db.InsertCoordinatorAccounts(&genesisAccounts[0], depth)\n\tif err != nil {\n\t\tdb.Logger.Error(\"Unable to insert coodinator account\", \"err\", err)\n\t\treturn err\n\t}\n\n\tvar insertRecords []interface{}\n\tprevNodePath := genesisAccounts[0].Path\n\n\tfor i := 1; i < len(genesisAccounts); i++ {\n\t\tpathToAdjacentNode, err := GetAdjacentNodePath(prevNodePath)\n\t\tif err != nil {\n\t\t\treturn err\n\t\t}\n\t\tgenesisAccounts[i].UpdatePath(pathToAdjacentNode)\n\t\tinsertRecords = append(insertRecords, genesisAccounts[i])\n\t\tprevNodePath = genesisAccounts[i].Path\n\t}\n\n\tdb.Logger.Info(\"Creating user accounts, might take a minute or two, sit back.....\", \"count\", len(insertRecords))\n\terr = gormbulk.BulkInsert(db.Instance, insertRecords, CHUNK_SIZE)\n\tif err != nil {\n\t\tdb.Logger.Error(\"Unable to insert accounts to DB\", \"err\", err)\n\t\treturn errors.New(\"Unable to insert accounts\")\n\t}\n\n\t// merkelise\n\t// 1. Pick all leaves at level depth\n\t// 2. Iterate 2 of them and create parents and store\n\t// 3. Persist all parents to database\n\t// 4. Start with next round\n\tfor i := depth; i > 0; i-- {\n\t\t// get all leaves at depth N\n\t\taccs, err := db.GetStatesAtDepth(i)\n\t\tif err != nil {\n\t\t\treturn err\n\t\t}\n\t\tvar nextLevelAccounts []interface{}\n\n\t\t// iterate over 2 at a time and create next level\n\t\tfor i := 0; i < len(accs); i += 2 {\n\t\t\tleft, err := HexToByteArray(accs[i].Hash)\n\t\t\tif err != nil {\n\t\t\t\treturn err\n\t\t\t}\n\t\t\tright, err := HexToByteArray(accs[i+1].Hash)\n\t\t\tif err != nil {\n\t\t\t\treturn err\n\t\t\t}\n\t\t\tparentHash, err := GetParent(left, right)\n\t\t\tif err != nil {\n\t\t\t\treturn err\n\t\t\t}\n\t\t\tparentPath := GetParentPath(accs[i].Path)\n\t\t\tnewAccNode := *newStateNode(parentPath, parentHash.String())\n\t\t\tnextLevelAccounts = append(nextLevelAccounts, newAccNode)\n\t\t}\n\t\terr = gormbulk.BulkInsert(db.Instance, nextLevelAccounts, CHUNK_SIZE)\n\t\tif err != nil {\n\t\t\tdb.Logger.Error(\"Unable to insert states to DB\", \"err\", err)\n\t\t\treturn errors.New(\"Unable to insert states\")\n\t\t}\n\t}\n\n\t// mark the root node type correctly\n\treturn nil\n}", "title": "" }, { "docid": "75bf569452b19fcc4574b74f62cd4fa3", "score": "0.37289563", "text": "func (g *Grade) init() {\n\tg.allClasses = make(map[string]*class.Class)\n}", "title": "" } ]
0d6c29f100b99a71339bccf5f86d3c5e
BalanceOf is a free data retrieval call binding the contract method 0x70a08231. Solidity: function balanceOf(address owner) view returns(uint256)
[ { "docid": "6094b32cdc1aac92d5bec6abbcc6d393", "score": "0.0", "text": "func (_ERC721 *ERC721CallerSession) BalanceOf(owner common.Address) (*big.Int, error) {\n\treturn _ERC721.Contract.BalanceOf(&_ERC721.CallOpts, owner)\n}", "title": "" } ]
[ { "docid": "da3428fa3d562c14403091dbe3cfa4e3", "score": "0.84409904", "text": "func (_ZapToken *ZapTokenCaller) BalanceOf(opts *bind.CallOpts, _owner common.Address) (*big.Int, error) {\r\n\tvar (\r\n\t\tret0 = new(*big.Int)\r\n\t)\r\n\tout := ret0\r\n\terr := _ZapToken.contract.Call(opts, out, \"balanceOf\", _owner)\r\n\treturn *ret0, err\r\n}", "title": "" }, { "docid": "672f13d64335ea13b435f0970e2aea59", "score": "0.8384515", "text": "func (_Token *TokenCaller) BalanceOf(opts *bind.CallOpts, _owner common.Address) (*big.Int, error) {\n\tvar (\n\t\tret0 = new(*big.Int)\n\t)\n\tout := ret0\n\terr := _Token.contract.Call(opts, out, \"balanceOf\", _owner)\n\treturn *ret0, err\n}", "title": "" }, { "docid": "672f13d64335ea13b435f0970e2aea59", "score": "0.8384515", "text": "func (_Token *TokenCaller) BalanceOf(opts *bind.CallOpts, _owner common.Address) (*big.Int, error) {\n\tvar (\n\t\tret0 = new(*big.Int)\n\t)\n\tout := ret0\n\terr := _Token.contract.Call(opts, out, \"balanceOf\", _owner)\n\treturn *ret0, err\n}", "title": "" }, { "docid": "672f13d64335ea13b435f0970e2aea59", "score": "0.8384515", "text": "func (_Token *TokenCaller) BalanceOf(opts *bind.CallOpts, _owner common.Address) (*big.Int, error) {\n\tvar (\n\t\tret0 = new(*big.Int)\n\t)\n\tout := ret0\n\terr := _Token.contract.Call(opts, out, \"balanceOf\", _owner)\n\treturn *ret0, err\n}", "title": "" }, { "docid": "4e134b4cff2e0232393919a0e4195013", "score": "0.8374816", "text": "func (_CogNetwork *CogNetworkCaller) BalanceOf(opts *bind.CallOpts, tokenOwner common.Address) (*big.Int, error) {\n\tvar (\n\t\tret0 = new(*big.Int)\n\t)\n\tout := ret0\n\terr := _CogNetwork.contract.Call(opts, out, \"balanceOf\", tokenOwner)\n\treturn *ret0, err\n}", "title": "" }, { "docid": "fc47f1dc755228b19028d4e71b355df4", "score": "0.8372069", "text": "func (_ERC20Interface *ERC20InterfaceCaller) BalanceOf(opts *bind.CallOpts, tokenOwner common.Address) (*big.Int, error) {\n\tvar (\n\t\tret0 = new(*big.Int)\n\t)\n\tout := ret0\n\terr := _ERC20Interface.contract.Call(opts, out, \"balanceOf\", tokenOwner)\n\treturn *ret0, err\n}", "title": "" }, { "docid": "a0fc2ef241e22b4139e611267a5a9f26", "score": "0.83719236", "text": "func (_MintableToken *MintableTokenCaller) BalanceOf(opts *bind.CallOpts, _owner common.Address) (*big.Int, error) {\r\n\tvar (\r\n\t\tret0 = new(*big.Int)\r\n\t)\r\n\tout := ret0\r\n\terr := _MintableToken.contract.Call(opts, out, \"balanceOf\", _owner)\r\n\treturn *ret0, err\r\n}", "title": "" }, { "docid": "a8592a3093dc008c55d28ef2d5fbf0a0", "score": "0.8368455", "text": "func (_GasToken2 *GasToken2Caller) BalanceOf(opts *bind.CallOpts, owner common.Address) (*big.Int, error) {\n\tvar (\n\t\tret0 = new(*big.Int)\n\t)\n\tout := ret0\n\terr := _GasToken2.contract.Call(opts, out, \"balanceOf\", owner)\n\treturn *ret0, err\n}", "title": "" }, { "docid": "01a493b883dbc84c3b6584b35565fc7d", "score": "0.8346656", "text": "func (_Contract *ContractCaller) BalanceOf(opts *bind.CallOpts, owner common.Address) (*big.Int, error) {\n\tvar (\n\t\tret0 = new(*big.Int)\n\t)\n\tout := ret0\n\terr := _Contract.contract.Call(opts, out, \"balanceOf\", owner)\n\treturn *ret0, err\n}", "title": "" }, { "docid": "ca1a5382593424efe0627003092289cb", "score": "0.83462465", "text": "func (_BurnableToken *BurnableTokenCaller) BalanceOf(opts *bind.CallOpts, _owner common.Address) (*big.Int, error) {\n\tvar (\n\t\tret0 = new(*big.Int)\n\t)\n\tout := ret0\n\terr := _BurnableToken.contract.Call(opts, out, \"balanceOf\", _owner)\n\treturn *ret0, err\n}", "title": "" }, { "docid": "9faefde8778a0a48741a17c4eab4472c", "score": "0.8345983", "text": "func (_Wrapper *WrapperCaller) BalanceOf(opts *bind.CallOpts, tokenOwner common.Address) (*big.Int, error) {\n\tvar (\n\t\tret0 = new(*big.Int)\n\t)\n\tout := ret0\n\terr := _Wrapper.contract.Call(opts, out, \"balanceOf\", tokenOwner)\n\treturn *ret0, err\n}", "title": "" }, { "docid": "ad77232f8fcbdfa914fd9bec7c674cf5", "score": "0.83416206", "text": "func (_PausableToken *PausableTokenCaller) BalanceOf(opts *bind.CallOpts, _owner common.Address) (*big.Int, error) {\n\tvar (\n\t\tret0 = new(*big.Int)\n\t)\n\tout := ret0\n\terr := _PausableToken.contract.Call(opts, out, \"balanceOf\", _owner)\n\treturn *ret0, err\n}", "title": "" }, { "docid": "687be56be89b37796768a43536a5e84c", "score": "0.8339764", "text": "func (_ERC20Basic *ERC20BasicCaller) BalanceOf(opts *bind.CallOpts, tokenOwner common.Address) (*big.Int, error) {\n\tvar (\n\t\tret0 = new(*big.Int)\n\t)\n\tout := ret0\n\tresults := make([]interface{}, 1)\n\tresults[0] = out\n\terr := _ERC20Basic.contract.Call(opts, &results, \"balanceOf\", tokenOwner)\n\treturn *ret0, err\n}", "title": "" }, { "docid": "28aa5068dbb698c2fbd623d8e3c6b694", "score": "0.8328121", "text": "func (_CardOwnership *CardOwnershipCaller) BalanceOf(opts *bind.CallOpts, _owner common.Address) (*big.Int, error) {\n\tvar (\n\t\tret0 = new(*big.Int)\n\t)\n\tout := ret0\n\terr := _CardOwnership.contract.Call(opts, out, \"balanceOf\", _owner)\n\treturn *ret0, err\n}", "title": "" }, { "docid": "d8b5d86a2e2378fb299eaa79caada992", "score": "0.83279663", "text": "func (_StandardToken *StandardTokenCaller) BalanceOf(opts *bind.CallOpts, _owner common.Address) (*big.Int, error) {\r\n\tvar (\r\n\t\tret0 = new(*big.Int)\r\n\t)\r\n\tout := ret0\r\n\terr := _StandardToken.contract.Call(opts, out, \"balanceOf\", _owner)\r\n\treturn *ret0, err\r\n}", "title": "" }, { "docid": "0772ae51b15bddacd6fb26a9bf2c9df2", "score": "0.83211446", "text": "func (_ShadowToken *ShadowTokenCaller) BalanceOf(opts *bind.CallOpts, _owner common.Address) (*big.Int, error) {\n\tvar out []interface{}\n\terr := _ShadowToken.contract.Call(opts, &out, \"balanceOf\", _owner)\n\n\tif err != nil {\n\t\treturn *new(*big.Int), err\n\t}\n\n\tout0 := *abi.ConvertType(out[0], new(*big.Int)).(**big.Int)\n\n\treturn out0, err\n\n}", "title": "" }, { "docid": "0ff5ef11d5bc62d350b9d3512d0e6f58", "score": "0.8308453", "text": "func (_Token *TokenCaller) BalanceOf(opts *bind.CallOpts, owner common.Address, id *big.Int) (*big.Int, error) {\n\tvar (\n\t\tret0 = new(*big.Int)\n\t)\n\tout := ret0\n\terr := _Token.contract.Call(opts, out, \"balanceOf\", owner, id)\n\treturn *ret0, err\n}", "title": "" }, { "docid": "529876bba278cd2091b850a16394b1e2", "score": "0.8305113", "text": "func (_BikeToken *BikeTokenCaller) BalanceOf(opts *bind.CallOpts, _owner common.Address) (*big.Int, error) {\n\tvar (\n\t\tret0 = new(*big.Int)\n\t)\n\tout := ret0\n\terr := _BikeToken.contract.Call(opts, out, \"balanceOf\", _owner)\n\treturn *ret0, err\n}", "title": "" }, { "docid": "3cbfc80afc14f1a7e879c029b2c5ce1f", "score": "0.8296728", "text": "func (_NFToken *NFTokenCaller) BalanceOf(opts *bind.CallOpts, _owner common.Address) (*big.Int, error) {\n\tvar (\n\t\tret0 = new(*big.Int)\n\t)\n\tout := ret0\n\terr := _NFToken.contract.Call(opts, out, \"balanceOf\", _owner)\n\treturn *ret0, err\n}", "title": "" }, { "docid": "f2edb5a8cbf2cbb2bd2c2d38645ff5eb", "score": "0.82949084", "text": "func (_BasicToken *BasicTokenCaller) BalanceOf(opts *bind.CallOpts, _owner common.Address) (*big.Int, error) {\r\n\tvar (\r\n\t\tret0 = new(*big.Int)\r\n\t)\r\n\tout := ret0\r\n\terr := _BasicToken.contract.Call(opts, out, \"balanceOf\", _owner)\r\n\treturn *ret0, err\r\n}", "title": "" }, { "docid": "ec2db4739da12ac28738923698bc0d2d", "score": "0.8289053", "text": "func (_MyToken *MyTokenCaller) BalanceOf(opts *bind.CallOpts, _owner common.Address) (*big.Int, error) {\n\tvar (\n\t\tret0 = new(*big.Int)\n\t)\n\tout := ret0\n\terr := _MyToken.contract.Call(opts, out, \"balanceOf\", _owner)\n\treturn *ret0, err\n}", "title": "" }, { "docid": "08b64960828ebe3eec1004c653f10e37", "score": "0.82800263", "text": "func (_StandardToken *StandardTokenCaller) BalanceOf(opts *bind.CallOpts, _owner common.Address) (*big.Int, error) {\n\tvar (\n\t\tret0 = new(*big.Int)\n\t)\n\tout := ret0\n\terr := _StandardToken.contract.Call(opts, out, \"balanceOf\", _owner)\n\treturn *ret0, err\n}", "title": "" }, { "docid": "08b64960828ebe3eec1004c653f10e37", "score": "0.82800263", "text": "func (_StandardToken *StandardTokenCaller) BalanceOf(opts *bind.CallOpts, _owner common.Address) (*big.Int, error) {\n\tvar (\n\t\tret0 = new(*big.Int)\n\t)\n\tout := ret0\n\terr := _StandardToken.contract.Call(opts, out, \"balanceOf\", _owner)\n\treturn *ret0, err\n}", "title": "" }, { "docid": "38a696d3ad01b53975f1f9fd39851060", "score": "0.8278055", "text": "func (_StandardDelegate *StandardDelegateSession) BalanceOf(_owner common.Address) (*big.Int, error) {\n\treturn _StandardDelegate.Contract.BalanceOf(&_StandardDelegate.CallOpts, _owner)\n}", "title": "" }, { "docid": "1640ebd57b1f783e558f80a29aefa5ae", "score": "0.827805", "text": "func (_NFT *NFTCaller) BalanceOf(opts *bind.CallOpts, owner common.Address) (*big.Int, error) {\n\tvar (\n\t\tret0 = new(*big.Int)\n\t)\n\tout := ret0\n\terr := _NFT.contract.Call(opts, out, \"balanceOf\", owner)\n\treturn *ret0, err\n}", "title": "" }, { "docid": "301226c4b9ddb2552ad1308ca4267a5e", "score": "0.8277909", "text": "func (_Paper *PaperCaller) BalanceOf(opts *bind.CallOpts, _owner common.Address) (*big.Int, error) {\n\tvar (\n\t\tret0 = new(*big.Int)\n\t)\n\tout := ret0\n\terr := _Paper.contract.Call(opts, out, \"balanceOf\", _owner)\n\treturn *ret0, err\n}", "title": "" }, { "docid": "5de77b30f95fd28d48842ddbc96b3908", "score": "0.8276427", "text": "func (_Radex *RadexCaller) BalanceOf(opts *bind.CallOpts, token common.Address, user common.Address) (*big.Int, error) {\n\tvar (\n\t\tret0 = new(*big.Int)\n\t)\n\tout := ret0\n\terr := _Radex.contract.Call(opts, out, \"balanceOf\", token, user)\n\treturn *ret0, err\n}", "title": "" }, { "docid": "1943849dac21d10fd791646bbde56504", "score": "0.82753456", "text": "func balanceOf(args []string) (string, error) {\n\targs[0] = xrc20ContractAddress\n\tsigner = \"io1qqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqd39ym7\"\n\tgasLimit = 50000\n\tvar err error\n\txrc20Bytes, err = xrc20ABI.Pack(\"balanceOf\", toEthAddr(xrc20OwnerAddress))\n\tif err != nil {\n\t\treturn \"\", err\n\t}\n\treturn read(args)\n}", "title": "" }, { "docid": "042fe4da3d6bf9b90355c00fe2f1f5c0", "score": "0.82715046", "text": "func (_ERC223Token *ERC223TokenCaller) BalanceOf(opts *bind.CallOpts, _owner common.Address) (*big.Int, error) {\n\tvar (\n\t\tret0 = new(*big.Int)\n\t)\n\tout := ret0\n\terr := _ERC223Token.contract.Call(opts, out, \"balanceOf\", _owner)\n\treturn *ret0, err\n}", "title": "" }, { "docid": "58df7ebf5501b5b53eac731f1517e354", "score": "0.8267837", "text": "func (_CryptoCardsCore *CryptoCardsCoreCaller) BalanceOf(opts *bind.CallOpts, _owner common.Address) (*big.Int, error) {\n\tvar (\n\t\tret0 = new(*big.Int)\n\t)\n\tout := ret0\n\terr := _CryptoCardsCore.contract.Call(opts, out, \"balanceOf\", _owner)\n\treturn *ret0, err\n}", "title": "" }, { "docid": "a074e391ed933bc3015a290df29a8b3a", "score": "0.8252513", "text": "func (_DAICash *DAICashCaller) BalanceOf(opts *bind.CallOpts, _owner common.Address) (*big.Int, error) {\n\tvar (\n\t\tret0 = new(*big.Int)\n\t)\n\tout := ret0\n\terr := _DAICash.contract.Call(opts, out, \"balanceOf\", _owner)\n\treturn *ret0, err\n}", "title": "" }, { "docid": "4c587dcea1f6687118a5acd08aacc8f9", "score": "0.82471776", "text": "func (_BasicToken *BasicTokenCaller) BalanceOf(opts *bind.CallOpts, _owner common.Address) (*big.Int, error) {\n\tvar (\n\t\tret0 = new(*big.Int)\n\t)\n\tout := ret0\n\terr := _BasicToken.contract.Call(opts, out, \"balanceOf\", _owner)\n\treturn *ret0, err\n}", "title": "" }, { "docid": "4c587dcea1f6687118a5acd08aacc8f9", "score": "0.82471776", "text": "func (_BasicToken *BasicTokenCaller) BalanceOf(opts *bind.CallOpts, _owner common.Address) (*big.Int, error) {\n\tvar (\n\t\tret0 = new(*big.Int)\n\t)\n\tout := ret0\n\terr := _BasicToken.contract.Call(opts, out, \"balanceOf\", _owner)\n\treturn *ret0, err\n}", "title": "" }, { "docid": "789b6045a266cd1542c27c94f38447d9", "score": "0.82271034", "text": "func (_StandardToken *StandardTokenCaller) BalanceOf(opts *bind.CallOpts, _owner common.Address) (*big.Int, error) {\n\tvar out []interface{}\n\terr := _StandardToken.contract.Call(opts, &out, \"balanceOf\", _owner)\n\n\tif err != nil {\n\t\treturn *new(*big.Int), err\n\t}\n\n\tout0 := *abi.ConvertType(out[0], new(*big.Int)).(**big.Int)\n\n\treturn out0, err\n\n}", "title": "" }, { "docid": "789b6045a266cd1542c27c94f38447d9", "score": "0.82271034", "text": "func (_StandardToken *StandardTokenCaller) BalanceOf(opts *bind.CallOpts, _owner common.Address) (*big.Int, error) {\n\tvar out []interface{}\n\terr := _StandardToken.contract.Call(opts, &out, \"balanceOf\", _owner)\n\n\tif err != nil {\n\t\treturn *new(*big.Int), err\n\t}\n\n\tout0 := *abi.ConvertType(out[0], new(*big.Int)).(**big.Int)\n\n\treturn out0, err\n\n}", "title": "" }, { "docid": "afbaa350b769927bfd77c5c59b3db2b3", "score": "0.82199967", "text": "func (_Standard *StandardCaller) BalanceOf(opts *bind.CallOpts, _owner common.Address) (*big.Int, error) {\n\tvar (\n\t\tret0 = new(*big.Int)\n\t)\n\tout := ret0\n\terr := _Standard.contract.Call(opts, out, \"balanceOf\", _owner)\n\treturn *ret0, err\n}", "title": "" }, { "docid": "1789b6aeff3fd2ce618350054f828f5a", "score": "0.8216754", "text": "func (_Pxa *PxaCaller) BalanceOf(opts *bind.CallOpts, _owner common.Address) (*big.Int, error) {\n\tvar (\n\t\tret0 = new(*big.Int)\n\t)\n\tout := ret0\n\terr := _Pxa.contract.Call(opts, out, \"balanceOf\", _owner)\n\treturn *ret0, err\n}", "title": "" }, { "docid": "0c7398984f60983832bb7860b3422328", "score": "0.8200828", "text": "func (_StandardDelegate *StandardDelegateCaller) BalanceOf(opts *bind.CallOpts, _owner common.Address) (*big.Int, error) {\n\tvar (\n\t\tret0 = new(*big.Int)\n\t)\n\tout := ret0\n\terr := _StandardDelegate.contract.Call(opts, out, \"balanceOf\", _owner)\n\treturn *ret0, err\n}", "title": "" }, { "docid": "91084b095b81265e253fff3e62f9aa8c", "score": "0.8199094", "text": "func (_CardBattles *CardBattlesCaller) BalanceOf(opts *bind.CallOpts, _owner common.Address) (*big.Int, error) {\n\tvar (\n\t\tret0 = new(*big.Int)\n\t)\n\tout := ret0\n\terr := _CardBattles.contract.Call(opts, out, \"balanceOf\", _owner)\n\treturn *ret0, err\n}", "title": "" }, { "docid": "daf53e924873f661312092b88eef456e", "score": "0.8198967", "text": "func (_Standard *StandardSession) BalanceOf(_owner common.Address) (*big.Int, error) {\n\treturn _Standard.Contract.BalanceOf(&_Standard.CallOpts, _owner)\n}", "title": "" }, { "docid": "adddbf43a750787d8087459faf19e135", "score": "0.81967574", "text": "func (_CVLTokenContract *CVLTokenContractCaller) BalanceOf(opts *bind.CallOpts, owner common.Address) (*big.Int, error) {\n\tvar (\n\t\tret0 = new(*big.Int)\n\t)\n\tout := ret0\n\terr := _CVLTokenContract.contract.Call(opts, out, \"balanceOf\", owner)\n\treturn *ret0, err\n}", "title": "" }, { "docid": "2a6d164abf240815cd1a809808c6d966", "score": "0.8195085", "text": "func (_Ytc *YtcCaller) BalanceOf(opts *bind.CallOpts, _owner common.Address) (*big.Int, error) {\n\tvar (\n\t\tret0 = new(*big.Int)\n\t)\n\tout := ret0\n\terr := _Ytc.contract.Call(opts, out, \"balanceOf\", _owner)\n\treturn *ret0, err\n}", "title": "" }, { "docid": "43ff9281eb44a13c2314c46fd59c44d3", "score": "0.81922996", "text": "func (_Token *TokenCaller) BalanceOf(opts *bind.CallOpts, arg0 common.Address) (*big.Int, error) {\n\tvar (\n\t\tret0 = new(*big.Int)\n\t)\n\tout := ret0\n\terr := _Token.contract.Call(opts, out, \"balanceOf\", arg0)\n\treturn *ret0, err\n}", "title": "" }, { "docid": "6467c5f1f494b1581516c55f95701aeb", "score": "0.81909287", "text": "func (_Ticket721 *Ticket721Caller) BalanceOf(opts *bind.CallOpts, owner common.Address) (*big.Int, error) {\n\tvar (\n\t\tret0 = new(*big.Int)\n\t)\n\tout := ret0\n\terr := _Ticket721.contract.Call(opts, out, \"balanceOf\", owner)\n\treturn *ret0, err\n}", "title": "" }, { "docid": "4f4c42004bb827ca742e28a03d315ec0", "score": "0.81893957", "text": "func (_Test *TestCaller) BalanceOf(opts *bind.CallOpts, owner common.Address) (*big.Int, error) {\n\tvar out []interface{}\n\terr := _Test.contract.Call(opts, &out, \"balanceOf\", owner)\n\n\tif err != nil {\n\t\treturn *new(*big.Int), err\n\t}\n\n\tout0 := *abi.ConvertType(out[0], new(*big.Int)).(**big.Int)\n\n\treturn out0, err\n\n}", "title": "" }, { "docid": "5b34ab39f8f2de48ce3619c983547dbc", "score": "0.8189063", "text": "func (_CardMinting *CardMintingCaller) BalanceOf(opts *bind.CallOpts, _owner common.Address) (*big.Int, error) {\n\tvar (\n\t\tret0 = new(*big.Int)\n\t)\n\tout := ret0\n\terr := _CardMinting.contract.Call(opts, out, \"balanceOf\", _owner)\n\treturn *ret0, err\n}", "title": "" }, { "docid": "3331463743d2b5180a8ca6be0b36369c", "score": "0.8188427", "text": "func (_EtherDelta *EtherDeltaCaller) BalanceOf(opts *bind.CallOpts, token common.Address, user common.Address) (*big.Int, error) {\n\tvar (\n\t\tret0 = new(*big.Int)\n\t)\n\tout := ret0\n\terr := _EtherDelta.contract.Call(opts, out, \"balanceOf\", token, user)\n\treturn *ret0, err\n}", "title": "" }, { "docid": "5a830c2cff9eaf8bc697a3cba69179ee", "score": "0.8182739", "text": "func (_ERC20Interface *ERC20InterfaceCallerSession) BalanceOf(tokenOwner common.Address) (*big.Int, error) {\n\treturn _ERC20Interface.Contract.BalanceOf(&_ERC20Interface.CallOpts, tokenOwner)\n}", "title": "" }, { "docid": "d073987b2cd9c1ff14cbe3ca218007f2", "score": "0.817971", "text": "func (_Asset *AssetCaller) BalanceOf(opts *bind.CallOpts, arg0 common.Address) (*big.Int, error) {\n\tvar (\n\t\tret0 = new(*big.Int)\n\t)\n\tout := ret0\n\terr := _Asset.contract.Call(opts, out, \"balanceOf\", arg0)\n\treturn *ret0, err\n}", "title": "" }, { "docid": "8ce1bbcb8b73487893ec3c9e20083e23", "score": "0.8178511", "text": "func (_BasicToken *BasicTokenCaller) BalanceOf(opts *bind.CallOpts, _owner common.Address) (*big.Int, error) {\n\tvar out []interface{}\n\terr := _BasicToken.contract.Call(opts, &out, \"balanceOf\", _owner)\n\n\tif err != nil {\n\t\treturn *new(*big.Int), err\n\t}\n\n\tout0 := *abi.ConvertType(out[0], new(*big.Int)).(**big.Int)\n\n\treturn out0, err\n\n}", "title": "" }, { "docid": "8ce1bbcb8b73487893ec3c9e20083e23", "score": "0.8178511", "text": "func (_BasicToken *BasicTokenCaller) BalanceOf(opts *bind.CallOpts, _owner common.Address) (*big.Int, error) {\n\tvar out []interface{}\n\terr := _BasicToken.contract.Call(opts, &out, \"balanceOf\", _owner)\n\n\tif err != nil {\n\t\treturn *new(*big.Int), err\n\t}\n\n\tout0 := *abi.ConvertType(out[0], new(*big.Int)).(**big.Int)\n\n\treturn out0, err\n\n}", "title": "" }, { "docid": "a59ecd777704501dd1e0bcc53d17cfc2", "score": "0.81760585", "text": "func (_ZBGCard *ZBGCardCaller) BalanceOf(opts *bind.CallOpts, _owner common.Address) (*big.Int, error) {\n\tvar (\n\t\tret0 = new(*big.Int)\n\t)\n\tout := ret0\n\terr := _ZBGCard.contract.Call(opts, out, \"balanceOf\", _owner)\n\treturn *ret0, err\n}", "title": "" }, { "docid": "ea538bf7443450d868fa701f8a388ad8", "score": "0.8162349", "text": "func (_Test *TestCallerSession) BalanceOf(owner common.Address) (*big.Int, error) {\n\treturn _Test.Contract.BalanceOf(&_Test.CallOpts, owner)\n}", "title": "" }, { "docid": "90558ba3f30467530dd9d1464fbf03af", "score": "0.8158117", "text": "func (_StandardDelegate *StandardDelegateCallerSession) BalanceOf(_owner common.Address) (*big.Int, error) {\n\treturn _StandardDelegate.Contract.BalanceOf(&_StandardDelegate.CallOpts, _owner)\n}", "title": "" }, { "docid": "d755162ed5c3df5839955844b7c5b472", "score": "0.815309", "text": "func (_DistrictContract *DistrictContractCaller) BalanceOf(opts *bind.CallOpts, owner common.Address) (*big.Int, error) {\n\tvar out []interface{}\n\terr := _DistrictContract.contract.Call(opts, &out, \"balanceOf\", owner)\n\n\tif err != nil {\n\t\treturn *new(*big.Int), err\n\t}\n\n\tout0 := *abi.ConvertType(out[0], new(*big.Int)).(**big.Int)\n\n\treturn out0, err\n\n}", "title": "" }, { "docid": "e03bb601de0eb00f9b347b1fdf0b26b4", "score": "0.8148652", "text": "func (_BerryGetters *BerryGettersCaller) BalanceOf(opts *bind.CallOpts, _user common.Address) (*big.Int, error) {\n\tvar (\n\t\tret0 = new(*big.Int)\n\t)\n\tout := ret0\n\terr := _BerryGetters.contract.Call(opts, out, \"balanceOf\", _user)\n\treturn *ret0, err\n}", "title": "" }, { "docid": "67fcd0a46070da417670c5eb2cbc5de3", "score": "0.81486094", "text": "func (_LegacyReputationToken *LegacyReputationTokenCaller) BalanceOf(opts *bind.CallOpts, _owner common.Address) (*big.Int, error) {\n\tvar (\n\t\tret0 = new(*big.Int)\n\t)\n\tout := ret0\n\terr := _LegacyReputationToken.contract.Call(opts, out, \"balanceOf\", _owner)\n\treturn *ret0, err\n}", "title": "" }, { "docid": "eba366de9f2d7b42414300e707b664a5", "score": "0.8147806", "text": "func (_IPancakeERC20 *IPancakeERC20Caller) BalanceOf(opts *bind.CallOpts, owner common.Address) (*big.Int, error) {\n\tvar out []interface{}\n\terr := _IPancakeERC20.contract.Call(opts, &out, \"balanceOf\", owner)\n\n\tif err != nil {\n\t\treturn *new(*big.Int), err\n\t}\n\n\tout0 := *abi.ConvertType(out[0], new(*big.Int)).(**big.Int)\n\n\treturn out0, err\n\n}", "title": "" }, { "docid": "b12ce9ebc765411741accf2ab572c80c", "score": "0.8144635", "text": "func (_Standard *StandardCallerSession) BalanceOf(_owner common.Address) (*big.Int, error) {\n\treturn _Standard.Contract.BalanceOf(&_Standard.CallOpts, _owner)\n}", "title": "" }, { "docid": "4feaa6a7db1f44dbe11991e7a1f73a54", "score": "0.81390697", "text": "func (_SampleERC20MintableToken *SampleERC20MintableTokenCaller) BalanceOf(opts *bind.CallOpts, owner common.Address) (*big.Int, error) {\n\tvar (\n\t\tret0 = new(*big.Int)\n\t)\n\tout := ret0\n\terr := _SampleERC20MintableToken.contract.Call(opts, out, \"balanceOf\", owner)\n\treturn *ret0, err\n}", "title": "" }, { "docid": "c816ccf70b3691af8b1135bb33fd3d59", "score": "0.8138074", "text": "func (_IERC20 *IERC20Caller) BalanceOf(opts *bind.CallOpts, owner common.Address) (*big.Int, error) {\n\tvar out []interface{}\n\terr := _IERC20.contract.Call(opts, &out, \"balanceOf\", owner)\n\n\tif err != nil {\n\t\treturn *new(*big.Int), err\n\t}\n\n\tout0 := *abi.ConvertType(out[0], new(*big.Int)).(**big.Int)\n\n\treturn out0, err\n\n}", "title": "" }, { "docid": "bf8574510bfe53dcb5b08ce98b7cbc0d", "score": "0.81342125", "text": "func (_RepTok *RepTokCaller) BalanceOf(opts *bind.CallOpts, _account common.Address) (*big.Int, error) {\n\tvar (\n\t\tret0 = new(*big.Int)\n\t)\n\tout := ret0\n\terr := _RepTok.contract.Call(opts, out, \"balanceOf\", _account)\n\treturn *ret0, err\n}", "title": "" }, { "docid": "ec45544c2cad00481564e0711b7f15f6", "score": "0.8133828", "text": "func (_GGToken *GGTokenCaller) BalanceOf(opts *bind.CallOpts, tokenOwner common.Address) (*big.Int, error) {\n\tvar out []interface{}\n\terr := _GGToken.contract.Call(opts, &out, \"balanceOf\", tokenOwner)\n\n\tif err != nil {\n\t\treturn *new(*big.Int), err\n\t}\n\n\tout0 := *abi.ConvertType(out[0], new(*big.Int)).(**big.Int)\n\n\treturn out0, err\n\n}", "title": "" }, { "docid": "2c09731723671475ab0c61000ddf36db", "score": "0.81329525", "text": "func (_Binding *BindingCaller) BalanceOf(opts *bind.CallOpts, owner common.Address) (*big.Int, error) {\n\tvar out []interface{}\n\terr := _Binding.contract.Call(opts, &out, \"balanceOf\", owner)\n\n\tif err != nil {\n\t\treturn *new(*big.Int), err\n\t}\n\n\tout0 := *abi.ConvertType(out[0], new(*big.Int)).(**big.Int)\n\n\treturn out0, err\n\n}", "title": "" }, { "docid": "8c46179f9340cf96389d183a184127b7", "score": "0.81327057", "text": "func (_Dai *DaiCaller) BalanceOf(opts *bind.CallOpts, src common.Address) (*big.Int, error) {\n\tvar (\n\t\tret0 = new(*big.Int)\n\t)\n\tout := ret0\n\terr := _Dai.contract.Call(opts, out, \"balanceOf\", src)\n\treturn *ret0, err\n}", "title": "" }, { "docid": "acc6d1ffaf7e7f3b9b591cb376ceb9cf", "score": "0.812924", "text": "func (_Contract *ContractSession) BalanceOf(owner common.Address) (*big.Int, error) {\n\treturn _Contract.Contract.BalanceOf(&_Contract.CallOpts, owner)\n}", "title": "" }, { "docid": "51d840b37fe522318ab4ddde7b185861", "score": "0.8126554", "text": "func (_IPairedErc20 *IPairedErc20Caller) BalanceOf(opts *bind.CallOpts, account common.Address) (*big.Int, error) {\n\tvar out []interface{}\n\terr := _IPairedErc20.contract.Call(opts, &out, \"balanceOf\", account)\n\n\tif err != nil {\n\t\treturn *new(*big.Int), err\n\t}\n\n\tout0 := *abi.ConvertType(out[0], new(*big.Int)).(**big.Int)\n\n\treturn out0, err\n\n}", "title": "" }, { "docid": "13aa01958870f5cc77ebc4e575f1c33d", "score": "0.81262237", "text": "func (_Contract *ContractCallerSession) BalanceOf(owner common.Address) (*big.Int, error) {\n\treturn _Contract.Contract.BalanceOf(&_Contract.CallOpts, owner)\n}", "title": "" }, { "docid": "3d0726a285a629135a76cfdc54387142", "score": "0.8122323", "text": "func (_BlackList *BlackListCaller) BalanceOf(opts *bind.CallOpts, _owner common.Address) (*big.Int, error) {\n\tvar out []interface{}\n\terr := _BlackList.contract.Call(opts, &out, \"balanceOf\", _owner)\n\n\tif err != nil {\n\t\treturn *new(*big.Int), err\n\t}\n\n\tout0 := *abi.ConvertType(out[0], new(*big.Int)).(**big.Int)\n\n\treturn out0, err\n\n}", "title": "" }, { "docid": "b5e50d4cc88febcbf770dd9c81ce657a", "score": "0.8119633", "text": "func (_CogNetwork *CogNetworkCallerSession) BalanceOf(tokenOwner common.Address) (*big.Int, error) {\n\treturn _CogNetwork.Contract.BalanceOf(&_CogNetwork.CallOpts, tokenOwner)\n}", "title": "" }, { "docid": "5a61a861c5febc156c4d88e6ccb89b40", "score": "0.8116391", "text": "func (_Binding *BindingCallerSession) BalanceOf(owner common.Address) (*big.Int, error) {\n\treturn _Binding.Contract.BalanceOf(&_Binding.CallOpts, owner)\n}", "title": "" }, { "docid": "d7d92ef59d046a5c85ef125f99604c38", "score": "0.81153065", "text": "func (_ERC20Interface *ERC20InterfaceSession) BalanceOf(tokenOwner common.Address) (*big.Int, error) {\n\treturn _ERC20Interface.Contract.BalanceOf(&_ERC20Interface.CallOpts, tokenOwner)\n}", "title": "" }, { "docid": "d0a0767cbced6c8441df86619ff2ca87", "score": "0.811252", "text": "func (_StandardToken *StandardTokenCallerSession) BalanceOf(_owner common.Address) (*big.Int, error) {\r\n\treturn _StandardToken.Contract.BalanceOf(&_StandardToken.CallOpts, _owner)\r\n}", "title": "" }, { "docid": "c8c7363a35d884a2502e4e3db46aa00e", "score": "0.810558", "text": "func (_GPSToken *GPSTokenCaller) BalanceOf(opts *bind.CallOpts, tokenOwner common.Address) (*big.Int, error) {\n\tvar out []interface{}\n\terr := _GPSToken.contract.Call(opts, &out, \"balanceOf\", tokenOwner)\n\n\tif err != nil {\n\t\treturn *new(*big.Int), err\n\t}\n\n\tout0 := *abi.ConvertType(out[0], new(*big.Int)).(**big.Int)\n\n\treturn out0, err\n\n}", "title": "" }, { "docid": "78beed8c08aa4599e17315ac5c94a11c", "score": "0.81049836", "text": "func (_Test *TestSession) BalanceOf(owner common.Address) (*big.Int, error) {\n\treturn _Test.Contract.BalanceOf(&_Test.CallOpts, owner)\n}", "title": "" }, { "docid": "1dd7f9c851dcf6156c9de73b1146c123", "score": "0.8100415", "text": "func (_SuperCoin *SuperCoinCaller) BalanceOf(opts *bind.CallOpts, _owner common.Address) (*big.Int, error) {\n\tvar (\n\t\tret0 = new(*big.Int)\n\t)\n\tout := ret0\n\terr := _SuperCoin.contract.Call(opts, out, \"balanceOf\", _owner)\n\treturn *ret0, err\n}", "title": "" }, { "docid": "f78a9f5b461ca469160427ebc27bf867", "score": "0.8100027", "text": "func (_ZapToken *ZapTokenCallerSession) BalanceOf(_owner common.Address) (*big.Int, error) {\r\n\treturn _ZapToken.Contract.BalanceOf(&_ZapToken.CallOpts, _owner)\r\n}", "title": "" }, { "docid": "44f41a215fc6e2dbf4e095f9e46fc5a6", "score": "0.8099493", "text": "func (_GasToken2 *GasToken2CallerSession) BalanceOf(owner common.Address) (*big.Int, error) {\n\treturn _GasToken2.Contract.BalanceOf(&_GasToken2.CallOpts, owner)\n}", "title": "" }, { "docid": "a80fe7909d83e2801d500a596dc04c15", "score": "0.809839", "text": "func (_DhToken *DhTokenCaller) BalanceOf(opts *bind.CallOpts, account common.Address) (*big.Int, error) {\n\tvar (\n\t\tret0 = new(*big.Int)\n\t)\n\tout := ret0\n\terr := _DhToken.contract.Call(opts, out, \"balanceOf\", account)\n\treturn *ret0, err\n}", "title": "" }, { "docid": "430b14853a30ef813af54b5466d8d3af", "score": "0.8090345", "text": "func (_MonsterCore *MonsterCoreCaller) BalanceOf(opts *bind.CallOpts, _owner common.Address) (*big.Int, error) {\n\tvar (\n\t\tret0 = new(*big.Int)\n\t)\n\tout := ret0\n\terr := _MonsterCore.contract.Call(opts, out, \"balanceOf\", _owner)\n\treturn *ret0, err\n}", "title": "" }, { "docid": "539156296a287112d83e308e1a051055", "score": "0.80891633", "text": "func (_NFT721 *NFT721Caller) BalanceOf(opts *bind.CallOpts, owner common.Address) (*big.Int, error) {\n\tvar out []interface{}\n\terr := _NFT721.contract.Call(opts, &out, \"balanceOf\", owner)\n\n\tif err != nil {\n\t\treturn *new(*big.Int), err\n\t}\n\n\tout0 := *abi.ConvertType(out[0], new(*big.Int)).(**big.Int)\n\n\treturn out0, err\n\n}", "title": "" }, { "docid": "363e7d7eb0a4182339f9d33548e34454", "score": "0.8088184", "text": "func (_ArbERC721 *ArbERC721Caller) BalanceOf(opts *bind.CallOpts, owner common.Address) (*big.Int, error) {\n\tvar out []interface{}\n\terr := _ArbERC721.contract.Call(opts, &out, \"balanceOf\", owner)\n\n\tif err != nil {\n\t\treturn *new(*big.Int), err\n\t}\n\n\tout0 := *abi.ConvertType(out[0], new(*big.Int)).(**big.Int)\n\n\treturn out0, err\n\n}", "title": "" }, { "docid": "82740abc5712f74eb5a32cb3ae3051f6", "score": "0.8085454", "text": "func (_UpgradedStandardToken *UpgradedStandardTokenCaller) BalanceOf(opts *bind.CallOpts, _owner common.Address) (*big.Int, error) {\n\tvar out []interface{}\n\terr := _UpgradedStandardToken.contract.Call(opts, &out, \"balanceOf\", _owner)\n\n\tif err != nil {\n\t\treturn *new(*big.Int), err\n\t}\n\n\tout0 := *abi.ConvertType(out[0], new(*big.Int)).(**big.Int)\n\n\treturn out0, err\n\n}", "title": "" }, { "docid": "2b229d92cfe2417779e958f7d30cdef3", "score": "0.80836344", "text": "func (_ShadowToken *ShadowTokenCallerSession) BalanceOf(_owner common.Address) (*big.Int, error) {\n\treturn _ShadowToken.Contract.BalanceOf(&_ShadowToken.CallOpts, _owner)\n}", "title": "" }, { "docid": "d84c9896e20e03e7a1644db4f8a28f5e", "score": "0.808341", "text": "func (_BerryMaster *BerryMasterCaller) BalanceOf(opts *bind.CallOpts, _user common.Address) (*big.Int, error) {\n\tvar (\n\t\tret0 = new(*big.Int)\n\t)\n\tout := ret0\n\terr := _BerryMaster.contract.Call(opts, out, \"balanceOf\", _user)\n\treturn *ret0, err\n}", "title": "" }, { "docid": "323fdfae25e6a79ad4e9f7b5b84c78b2", "score": "0.8082777", "text": "func (_MintableToken *MintableTokenCallerSession) BalanceOf(_owner common.Address) (*big.Int, error) {\r\n\treturn _MintableToken.Contract.BalanceOf(&_MintableToken.CallOpts, _owner)\r\n}", "title": "" }, { "docid": "0e3bc5c390e81bad8c15add274525a20", "score": "0.80805737", "text": "func (_Binding *BindingSession) BalanceOf(owner common.Address) (*big.Int, error) {\n\treturn _Binding.Contract.BalanceOf(&_Binding.CallOpts, owner)\n}", "title": "" }, { "docid": "00b628058f7d1bed10e9c6a9e51127cd", "score": "0.8079402", "text": "func (_Asset *AssetCallerSession) BalanceOf(arg0 common.Address) (*big.Int, error) {\n\treturn _Asset.Contract.BalanceOf(&_Asset.CallOpts, arg0)\n}", "title": "" }, { "docid": "cb64b479a7c1ea25bb843e426c8b9bea", "score": "0.807662", "text": "func (_DAICash *DAICashSession) BalanceOf(_owner common.Address) (*big.Int, error) {\n\treturn _DAICash.Contract.BalanceOf(&_DAICash.CallOpts, _owner)\n}", "title": "" }, { "docid": "2c400daa922d5c0d627b4a3fe6721bce", "score": "0.80747336", "text": "func (_MonsterMinting *MonsterMintingCaller) BalanceOf(opts *bind.CallOpts, _owner common.Address) (*big.Int, error) {\n\tvar (\n\t\tret0 = new(*big.Int)\n\t)\n\tout := ret0\n\terr := _MonsterMinting.contract.Call(opts, out, \"balanceOf\", _owner)\n\treturn *ret0, err\n}", "title": "" }, { "docid": "3e63d20ca94c22e3e7885bfb62062acb", "score": "0.8072902", "text": "func (_ERC721 *ERC721Caller) BalanceOf(opts *bind.CallOpts, owner common.Address) (*big.Int, error) {\n\tvar out []interface{}\n\terr := _ERC721.contract.Call(opts, &out, \"balanceOf\", owner)\n\n\tif err != nil {\n\t\treturn *new(*big.Int), err\n\t}\n\n\tout0 := *abi.ConvertType(out[0], new(*big.Int)).(**big.Int)\n\n\treturn out0, err\n\n}", "title": "" }, { "docid": "d108ab1c6d92c4f1d9f93ceded0c954f", "score": "0.80717176", "text": "func (_ShadowToken *ShadowTokenSession) BalanceOf(_owner common.Address) (*big.Int, error) {\n\treturn _ShadowToken.Contract.BalanceOf(&_ShadowToken.CallOpts, _owner)\n}", "title": "" }, { "docid": "36a9f528d88b12f6983c7b8c5a212487", "score": "0.8063068", "text": "func (_IPancakePair *IPancakePairCaller) BalanceOf(opts *bind.CallOpts, owner common.Address) (*big.Int, error) {\n\tvar out []interface{}\n\terr := _IPancakePair.contract.Call(opts, &out, \"balanceOf\", owner)\n\n\tif err != nil {\n\t\treturn *new(*big.Int), err\n\t}\n\n\tout0 := *abi.ConvertType(out[0], new(*big.Int)).(**big.Int)\n\n\treturn out0, err\n\n}", "title": "" }, { "docid": "be7050591bbe726202c04a0c95192638", "score": "0.806034", "text": "func (_NFT *NFTSession) BalanceOf(owner common.Address) (*big.Int, error) {\n\treturn _NFT.Contract.BalanceOf(&_NFT.CallOpts, owner)\n}", "title": "" }, { "docid": "8de3c44b81b1def00825397c239d89ab", "score": "0.80576944", "text": "func (_PancakeERC20 *PancakeERC20Caller) BalanceOf(opts *bind.CallOpts, arg0 common.Address) (*big.Int, error) {\n\tvar out []interface{}\n\terr := _PancakeERC20.contract.Call(opts, &out, \"balanceOf\", arg0)\n\n\tif err != nil {\n\t\treturn *new(*big.Int), err\n\t}\n\n\tout0 := *abi.ConvertType(out[0], new(*big.Int)).(**big.Int)\n\n\treturn out0, err\n\n}", "title": "" }, { "docid": "e2b1414c0c153be71a946818759b2120", "score": "0.80572784", "text": "func (_ZapToken *ZapTokenSession) BalanceOf(_owner common.Address) (*big.Int, error) {\r\n\treturn _ZapToken.Contract.BalanceOf(&_ZapToken.CallOpts, _owner)\r\n}", "title": "" }, { "docid": "e64402b191a8788ab5d1673f045ac844", "score": "0.80549914", "text": "func (_MyToken *MyTokenCallerSession) BalanceOf(_owner common.Address) (*big.Int, error) {\n\treturn _MyToken.Contract.BalanceOf(&_MyToken.CallOpts, _owner)\n}", "title": "" }, { "docid": "a865cb8448665e6f7fc4a9d5ab066cbb", "score": "0.80548584", "text": "func (_CardOwnership *CardOwnershipCallerSession) BalanceOf(_owner common.Address) (*big.Int, error) {\n\treturn _CardOwnership.Contract.BalanceOf(&_CardOwnership.CallOpts, _owner)\n}", "title": "" }, { "docid": "a33de622435191480560f0d7f76846df", "score": "0.8054304", "text": "func (_NFT *NFTCallerSession) BalanceOf(owner common.Address) (*big.Int, error) {\n\treturn _NFT.Contract.BalanceOf(&_NFT.CallOpts, owner)\n}", "title": "" }, { "docid": "402130bcf3434a03255d0d41d4ed9738", "score": "0.8053904", "text": "func (_StandardToken *StandardTokenSession) BalanceOf(_owner common.Address) (*big.Int, error) {\r\n\treturn _StandardToken.Contract.BalanceOf(&_StandardToken.CallOpts, _owner)\r\n}", "title": "" }, { "docid": "1f23ff6ddaa2d9f2eec4b76a9374d479", "score": "0.80535334", "text": "func (_CogNetwork *CogNetworkSession) BalanceOf(tokenOwner common.Address) (*big.Int, error) {\n\treturn _CogNetwork.Contract.BalanceOf(&_CogNetwork.CallOpts, tokenOwner)\n}", "title": "" } ]
a68593549b60e5c505f2b9c72f1cb107
RegisterConversions adds conversion functions to the given scheme. Public to allow building arbitrary schemes.
[ { "docid": "add8b48ce22de371b8125f13a85c7ead", "score": "0.7357288", "text": "func RegisterConversions(s *runtime.Scheme) error {\n\tif err := s.AddGeneratedConversionFunc((*ArchiveAccess)(nil), (*helm.ArchiveAccess)(nil), func(a, b interface{}, scope conversion.Scope) error {\n\t\treturn Convert_v1alpha1_ArchiveAccess_To_helm_ArchiveAccess(a.(*ArchiveAccess), b.(*helm.ArchiveAccess), scope)\n\t}); err != nil {\n\t\treturn err\n\t}\n\tif err := s.AddGeneratedConversionFunc((*helm.ArchiveAccess)(nil), (*ArchiveAccess)(nil), func(a, b interface{}, scope conversion.Scope) error {\n\t\treturn Convert_helm_ArchiveAccess_To_v1alpha1_ArchiveAccess(a.(*helm.ArchiveAccess), b.(*ArchiveAccess), scope)\n\t}); err != nil {\n\t\treturn err\n\t}\n\tif err := s.AddGeneratedConversionFunc((*Chart)(nil), (*helm.Chart)(nil), func(a, b interface{}, scope conversion.Scope) error {\n\t\treturn Convert_v1alpha1_Chart_To_helm_Chart(a.(*Chart), b.(*helm.Chart), scope)\n\t}); err != nil {\n\t\treturn err\n\t}\n\tif err := s.AddGeneratedConversionFunc((*helm.Chart)(nil), (*Chart)(nil), func(a, b interface{}, scope conversion.Scope) error {\n\t\treturn Convert_helm_Chart_To_v1alpha1_Chart(a.(*helm.Chart), b.(*Chart), scope)\n\t}); err != nil {\n\t\treturn err\n\t}\n\tif err := s.AddGeneratedConversionFunc((*Configuration)(nil), (*helm.Configuration)(nil), func(a, b interface{}, scope conversion.Scope) error {\n\t\treturn Convert_v1alpha1_Configuration_To_helm_Configuration(a.(*Configuration), b.(*helm.Configuration), scope)\n\t}); err != nil {\n\t\treturn err\n\t}\n\tif err := s.AddGeneratedConversionFunc((*helm.Configuration)(nil), (*Configuration)(nil), func(a, b interface{}, scope conversion.Scope) error {\n\t\treturn Convert_helm_Configuration_To_v1alpha1_Configuration(a.(*helm.Configuration), b.(*Configuration), scope)\n\t}); err != nil {\n\t\treturn err\n\t}\n\tif err := s.AddGeneratedConversionFunc((*ExportConfiguration)(nil), (*helm.ExportConfiguration)(nil), func(a, b interface{}, scope conversion.Scope) error {\n\t\treturn Convert_v1alpha1_ExportConfiguration_To_helm_ExportConfiguration(a.(*ExportConfiguration), b.(*helm.ExportConfiguration), scope)\n\t}); err != nil {\n\t\treturn err\n\t}\n\tif err := s.AddGeneratedConversionFunc((*helm.ExportConfiguration)(nil), (*ExportConfiguration)(nil), func(a, b interface{}, scope conversion.Scope) error {\n\t\treturn Convert_helm_ExportConfiguration_To_v1alpha1_ExportConfiguration(a.(*helm.ExportConfiguration), b.(*ExportConfiguration), scope)\n\t}); err != nil {\n\t\treturn err\n\t}\n\tif err := s.AddGeneratedConversionFunc((*ProviderConfiguration)(nil), (*helm.ProviderConfiguration)(nil), func(a, b interface{}, scope conversion.Scope) error {\n\t\treturn Convert_v1alpha1_ProviderConfiguration_To_helm_ProviderConfiguration(a.(*ProviderConfiguration), b.(*helm.ProviderConfiguration), scope)\n\t}); err != nil {\n\t\treturn err\n\t}\n\tif err := s.AddGeneratedConversionFunc((*helm.ProviderConfiguration)(nil), (*ProviderConfiguration)(nil), func(a, b interface{}, scope conversion.Scope) error {\n\t\treturn Convert_helm_ProviderConfiguration_To_v1alpha1_ProviderConfiguration(a.(*helm.ProviderConfiguration), b.(*ProviderConfiguration), scope)\n\t}); err != nil {\n\t\treturn err\n\t}\n\tif err := s.AddGeneratedConversionFunc((*ProviderStatus)(nil), (*helm.ProviderStatus)(nil), func(a, b interface{}, scope conversion.Scope) error {\n\t\treturn Convert_v1alpha1_ProviderStatus_To_helm_ProviderStatus(a.(*ProviderStatus), b.(*helm.ProviderStatus), scope)\n\t}); err != nil {\n\t\treturn err\n\t}\n\tif err := s.AddGeneratedConversionFunc((*helm.ProviderStatus)(nil), (*ProviderStatus)(nil), func(a, b interface{}, scope conversion.Scope) error {\n\t\treturn Convert_helm_ProviderStatus_To_v1alpha1_ProviderStatus(a.(*helm.ProviderStatus), b.(*ProviderStatus), scope)\n\t}); err != nil {\n\t\treturn err\n\t}\n\tif err := s.AddGeneratedConversionFunc((*RemoteArchiveAccess)(nil), (*helm.RemoteArchiveAccess)(nil), func(a, b interface{}, scope conversion.Scope) error {\n\t\treturn Convert_v1alpha1_RemoteArchiveAccess_To_helm_RemoteArchiveAccess(a.(*RemoteArchiveAccess), b.(*helm.RemoteArchiveAccess), scope)\n\t}); err != nil {\n\t\treturn err\n\t}\n\tif err := s.AddGeneratedConversionFunc((*helm.RemoteArchiveAccess)(nil), (*RemoteArchiveAccess)(nil), func(a, b interface{}, scope conversion.Scope) error {\n\t\treturn Convert_helm_RemoteArchiveAccess_To_v1alpha1_RemoteArchiveAccess(a.(*helm.RemoteArchiveAccess), b.(*RemoteArchiveAccess), scope)\n\t}); err != nil {\n\t\treturn err\n\t}\n\tif err := s.AddGeneratedConversionFunc((*RemoteChartReference)(nil), (*helm.RemoteChartReference)(nil), func(a, b interface{}, scope conversion.Scope) error {\n\t\treturn Convert_v1alpha1_RemoteChartReference_To_helm_RemoteChartReference(a.(*RemoteChartReference), b.(*helm.RemoteChartReference), scope)\n\t}); err != nil {\n\t\treturn err\n\t}\n\tif err := s.AddGeneratedConversionFunc((*helm.RemoteChartReference)(nil), (*RemoteChartReference)(nil), func(a, b interface{}, scope conversion.Scope) error {\n\t\treturn Convert_helm_RemoteChartReference_To_v1alpha1_RemoteChartReference(a.(*helm.RemoteChartReference), b.(*RemoteChartReference), scope)\n\t}); err != nil {\n\t\treturn err\n\t}\n\treturn nil\n}", "title": "" } ]
[ { "docid": "9d0c487abf35e563fed06fc212f7375c", "score": "0.76559615", "text": "func RegisterConversions(scheme *runtime.Scheme) error {\n\treturn scheme.AddGeneratedConversionFuncs(\n\t\tConvert_v1beta1_APIResource_To_apifederation_APIResource,\n\t\tConvert_apifederation_APIResource_To_v1beta1_APIResource,\n\t\tConvert_v1beta1_APIServer_To_apifederation_APIServer,\n\t\tConvert_apifederation_APIServer_To_v1beta1_APIServer,\n\t\tConvert_v1beta1_APIServerList_To_apifederation_APIServerList,\n\t\tConvert_apifederation_APIServerList_To_v1beta1_APIServerList,\n\t\tConvert_v1beta1_APIServerSpec_To_apifederation_APIServerSpec,\n\t\tConvert_apifederation_APIServerSpec_To_v1beta1_APIServerSpec,\n\t\tConvert_v1beta1_APIServerStatus_To_apifederation_APIServerStatus,\n\t\tConvert_apifederation_APIServerStatus_To_v1beta1_APIServerStatus,\n\t\tConvert_v1beta1_APISubResource_To_apifederation_APISubResource,\n\t\tConvert_apifederation_APISubResource_To_v1beta1_APISubResource,\n\t)\n}", "title": "" }, { "docid": "356df5e387a09a18d9da3dd13d29bef2", "score": "0.7486199", "text": "func RegisterConversions(scheme *runtime.Scheme) error {\n\treturn scheme.AddGeneratedConversionFuncs(\n\t\tConvert_v1alpha2_AWXJobAction_To_autoheal_AWXJobAction,\n\t\tConvert_autoheal_AWXJobAction_To_v1alpha2_AWXJobAction,\n\t\tConvert_v1alpha2_HealingRule_To_autoheal_HealingRule,\n\t\tConvert_autoheal_HealingRule_To_v1alpha2_HealingRule,\n\t\tConvert_v1alpha2_HealingRuleList_To_autoheal_HealingRuleList,\n\t\tConvert_autoheal_HealingRuleList_To_v1alpha2_HealingRuleList,\n\t)\n}", "title": "" }, { "docid": "9e9b13d219206da45153c80b6598465e", "score": "0.7481204", "text": "func RegisterConversions(s *runtime.Scheme) error {\n\tif err := s.AddGeneratedConversionFunc((*ConversionReview)(nil), (*api.ConversionReview)(nil), func(a, b interface{}, scope conversion.Scope) error {\n\t\treturn Convert_v1_ConversionReview_To_api_ConversionReview(a.(*ConversionReview), b.(*api.ConversionReview), scope)\n\t}); err != nil {\n\t\treturn err\n\t}\n\tif err := s.AddGeneratedConversionFunc((*api.ConversionReview)(nil), (*ConversionReview)(nil), func(a, b interface{}, scope conversion.Scope) error {\n\t\treturn Convert_api_ConversionReview_To_v1_ConversionReview(a.(*api.ConversionReview), b.(*ConversionReview), scope)\n\t}); err != nil {\n\t\treturn err\n\t}\n\treturn nil\n}", "title": "" }, { "docid": "33570f11b546d628832d7b49bf23f994", "score": "0.7473396", "text": "func RegisterConversions(s *runtime.Scheme) error {\n\tif err := s.AddGeneratedConversionFunc((*ClusterOpenIDConnectPreset)(nil), (*settings.ClusterOpenIDConnectPreset)(nil), func(a, b interface{}, scope conversion.Scope) error {\n\t\treturn Convert_v1alpha1_ClusterOpenIDConnectPreset_To_settings_ClusterOpenIDConnectPreset(a.(*ClusterOpenIDConnectPreset), b.(*settings.ClusterOpenIDConnectPreset), scope)\n\t}); err != nil {\n\t\treturn err\n\t}\n\tif err := s.AddGeneratedConversionFunc((*settings.ClusterOpenIDConnectPreset)(nil), (*ClusterOpenIDConnectPreset)(nil), func(a, b interface{}, scope conversion.Scope) error {\n\t\treturn Convert_settings_ClusterOpenIDConnectPreset_To_v1alpha1_ClusterOpenIDConnectPreset(a.(*settings.ClusterOpenIDConnectPreset), b.(*ClusterOpenIDConnectPreset), scope)\n\t}); err != nil {\n\t\treturn err\n\t}\n\tif err := s.AddGeneratedConversionFunc((*ClusterOpenIDConnectPresetList)(nil), (*settings.ClusterOpenIDConnectPresetList)(nil), func(a, b interface{}, scope conversion.Scope) error {\n\t\treturn Convert_v1alpha1_ClusterOpenIDConnectPresetList_To_settings_ClusterOpenIDConnectPresetList(a.(*ClusterOpenIDConnectPresetList), b.(*settings.ClusterOpenIDConnectPresetList), scope)\n\t}); err != nil {\n\t\treturn err\n\t}\n\tif err := s.AddGeneratedConversionFunc((*settings.ClusterOpenIDConnectPresetList)(nil), (*ClusterOpenIDConnectPresetList)(nil), func(a, b interface{}, scope conversion.Scope) error {\n\t\treturn Convert_settings_ClusterOpenIDConnectPresetList_To_v1alpha1_ClusterOpenIDConnectPresetList(a.(*settings.ClusterOpenIDConnectPresetList), b.(*ClusterOpenIDConnectPresetList), scope)\n\t}); err != nil {\n\t\treturn err\n\t}\n\tif err := s.AddGeneratedConversionFunc((*ClusterOpenIDConnectPresetSpec)(nil), (*settings.ClusterOpenIDConnectPresetSpec)(nil), func(a, b interface{}, scope conversion.Scope) error {\n\t\treturn Convert_v1alpha1_ClusterOpenIDConnectPresetSpec_To_settings_ClusterOpenIDConnectPresetSpec(a.(*ClusterOpenIDConnectPresetSpec), b.(*settings.ClusterOpenIDConnectPresetSpec), scope)\n\t}); err != nil {\n\t\treturn err\n\t}\n\tif err := s.AddGeneratedConversionFunc((*settings.ClusterOpenIDConnectPresetSpec)(nil), (*ClusterOpenIDConnectPresetSpec)(nil), func(a, b interface{}, scope conversion.Scope) error {\n\t\treturn Convert_settings_ClusterOpenIDConnectPresetSpec_To_v1alpha1_ClusterOpenIDConnectPresetSpec(a.(*settings.ClusterOpenIDConnectPresetSpec), b.(*ClusterOpenIDConnectPresetSpec), scope)\n\t}); err != nil {\n\t\treturn err\n\t}\n\tif err := s.AddGeneratedConversionFunc((*KubeAPIServerOpenIDConnect)(nil), (*settings.KubeAPIServerOpenIDConnect)(nil), func(a, b interface{}, scope conversion.Scope) error {\n\t\treturn Convert_v1alpha1_KubeAPIServerOpenIDConnect_To_settings_KubeAPIServerOpenIDConnect(a.(*KubeAPIServerOpenIDConnect), b.(*settings.KubeAPIServerOpenIDConnect), scope)\n\t}); err != nil {\n\t\treturn err\n\t}\n\tif err := s.AddGeneratedConversionFunc((*settings.KubeAPIServerOpenIDConnect)(nil), (*KubeAPIServerOpenIDConnect)(nil), func(a, b interface{}, scope conversion.Scope) error {\n\t\treturn Convert_settings_KubeAPIServerOpenIDConnect_To_v1alpha1_KubeAPIServerOpenIDConnect(a.(*settings.KubeAPIServerOpenIDConnect), b.(*KubeAPIServerOpenIDConnect), scope)\n\t}); err != nil {\n\t\treturn err\n\t}\n\tif err := s.AddGeneratedConversionFunc((*OpenIDConnectClientAuthentication)(nil), (*settings.OpenIDConnectClientAuthentication)(nil), func(a, b interface{}, scope conversion.Scope) error {\n\t\treturn Convert_v1alpha1_OpenIDConnectClientAuthentication_To_settings_OpenIDConnectClientAuthentication(a.(*OpenIDConnectClientAuthentication), b.(*settings.OpenIDConnectClientAuthentication), scope)\n\t}); err != nil {\n\t\treturn err\n\t}\n\tif err := s.AddGeneratedConversionFunc((*settings.OpenIDConnectClientAuthentication)(nil), (*OpenIDConnectClientAuthentication)(nil), func(a, b interface{}, scope conversion.Scope) error {\n\t\treturn Convert_settings_OpenIDConnectClientAuthentication_To_v1alpha1_OpenIDConnectClientAuthentication(a.(*settings.OpenIDConnectClientAuthentication), b.(*OpenIDConnectClientAuthentication), scope)\n\t}); err != nil {\n\t\treturn err\n\t}\n\tif err := s.AddGeneratedConversionFunc((*OpenIDConnectPreset)(nil), (*settings.OpenIDConnectPreset)(nil), func(a, b interface{}, scope conversion.Scope) error {\n\t\treturn Convert_v1alpha1_OpenIDConnectPreset_To_settings_OpenIDConnectPreset(a.(*OpenIDConnectPreset), b.(*settings.OpenIDConnectPreset), scope)\n\t}); err != nil {\n\t\treturn err\n\t}\n\tif err := s.AddGeneratedConversionFunc((*settings.OpenIDConnectPreset)(nil), (*OpenIDConnectPreset)(nil), func(a, b interface{}, scope conversion.Scope) error {\n\t\treturn Convert_settings_OpenIDConnectPreset_To_v1alpha1_OpenIDConnectPreset(a.(*settings.OpenIDConnectPreset), b.(*OpenIDConnectPreset), scope)\n\t}); err != nil {\n\t\treturn err\n\t}\n\tif err := s.AddGeneratedConversionFunc((*OpenIDConnectPresetList)(nil), (*settings.OpenIDConnectPresetList)(nil), func(a, b interface{}, scope conversion.Scope) error {\n\t\treturn Convert_v1alpha1_OpenIDConnectPresetList_To_settings_OpenIDConnectPresetList(a.(*OpenIDConnectPresetList), b.(*settings.OpenIDConnectPresetList), scope)\n\t}); err != nil {\n\t\treturn err\n\t}\n\tif err := s.AddGeneratedConversionFunc((*settings.OpenIDConnectPresetList)(nil), (*OpenIDConnectPresetList)(nil), func(a, b interface{}, scope conversion.Scope) error {\n\t\treturn Convert_settings_OpenIDConnectPresetList_To_v1alpha1_OpenIDConnectPresetList(a.(*settings.OpenIDConnectPresetList), b.(*OpenIDConnectPresetList), scope)\n\t}); err != nil {\n\t\treturn err\n\t}\n\tif err := s.AddGeneratedConversionFunc((*OpenIDConnectPresetSpec)(nil), (*settings.OpenIDConnectPresetSpec)(nil), func(a, b interface{}, scope conversion.Scope) error {\n\t\treturn Convert_v1alpha1_OpenIDConnectPresetSpec_To_settings_OpenIDConnectPresetSpec(a.(*OpenIDConnectPresetSpec), b.(*settings.OpenIDConnectPresetSpec), scope)\n\t}); err != nil {\n\t\treturn err\n\t}\n\tif err := s.AddGeneratedConversionFunc((*settings.OpenIDConnectPresetSpec)(nil), (*OpenIDConnectPresetSpec)(nil), func(a, b interface{}, scope conversion.Scope) error {\n\t\treturn Convert_settings_OpenIDConnectPresetSpec_To_v1alpha1_OpenIDConnectPresetSpec(a.(*settings.OpenIDConnectPresetSpec), b.(*OpenIDConnectPresetSpec), scope)\n\t}); err != nil {\n\t\treturn err\n\t}\n\treturn nil\n}", "title": "" }, { "docid": "e233fc69b077abdc467d22b445abac21", "score": "0.7469096", "text": "func RegisterConversions(s *runtime.Scheme) error {\n\tif err := s.AddGeneratedConversionFunc((*DeschedulerProfile)(nil), (*api.DeschedulerProfile)(nil), func(a, b interface{}, scope conversion.Scope) error {\n\t\treturn Convert_v1alpha2_DeschedulerProfile_To_api_DeschedulerProfile(a.(*DeschedulerProfile), b.(*api.DeschedulerProfile), scope)\n\t}); err != nil {\n\t\treturn err\n\t}\n\tif err := s.AddGeneratedConversionFunc((*api.DeschedulerProfile)(nil), (*DeschedulerProfile)(nil), func(a, b interface{}, scope conversion.Scope) error {\n\t\treturn Convert_api_DeschedulerProfile_To_v1alpha2_DeschedulerProfile(a.(*api.DeschedulerProfile), b.(*DeschedulerProfile), scope)\n\t}); err != nil {\n\t\treturn err\n\t}\n\tif err := s.AddGeneratedConversionFunc((*api.PluginConfig)(nil), (*PluginConfig)(nil), func(a, b interface{}, scope conversion.Scope) error {\n\t\treturn Convert_api_PluginConfig_To_v1alpha2_PluginConfig(a.(*api.PluginConfig), b.(*PluginConfig), scope)\n\t}); err != nil {\n\t\treturn err\n\t}\n\tif err := s.AddGeneratedConversionFunc((*PluginSet)(nil), (*api.PluginSet)(nil), func(a, b interface{}, scope conversion.Scope) error {\n\t\treturn Convert_v1alpha2_PluginSet_To_api_PluginSet(a.(*PluginSet), b.(*api.PluginSet), scope)\n\t}); err != nil {\n\t\treturn err\n\t}\n\tif err := s.AddGeneratedConversionFunc((*api.PluginSet)(nil), (*PluginSet)(nil), func(a, b interface{}, scope conversion.Scope) error {\n\t\treturn Convert_api_PluginSet_To_v1alpha2_PluginSet(a.(*api.PluginSet), b.(*PluginSet), scope)\n\t}); err != nil {\n\t\treturn err\n\t}\n\tif err := s.AddGeneratedConversionFunc((*Plugins)(nil), (*api.Plugins)(nil), func(a, b interface{}, scope conversion.Scope) error {\n\t\treturn Convert_v1alpha2_Plugins_To_api_Plugins(a.(*Plugins), b.(*api.Plugins), scope)\n\t}); err != nil {\n\t\treturn err\n\t}\n\tif err := s.AddGeneratedConversionFunc((*api.Plugins)(nil), (*Plugins)(nil), func(a, b interface{}, scope conversion.Scope) error {\n\t\treturn Convert_api_Plugins_To_v1alpha2_Plugins(a.(*api.Plugins), b.(*Plugins), scope)\n\t}); err != nil {\n\t\treturn err\n\t}\n\tif err := s.AddConversionFunc((*api.DeschedulerPolicy)(nil), (*DeschedulerPolicy)(nil), func(a, b interface{}, scope conversion.Scope) error {\n\t\treturn Convert_api_DeschedulerPolicy_To_v1alpha2_DeschedulerPolicy(a.(*api.DeschedulerPolicy), b.(*DeschedulerPolicy), scope)\n\t}); err != nil {\n\t\treturn err\n\t}\n\tif err := s.AddConversionFunc((*DeschedulerPolicy)(nil), (*api.DeschedulerPolicy)(nil), func(a, b interface{}, scope conversion.Scope) error {\n\t\treturn Convert_v1alpha2_DeschedulerPolicy_To_api_DeschedulerPolicy(a.(*DeschedulerPolicy), b.(*api.DeschedulerPolicy), scope)\n\t}); err != nil {\n\t\treturn err\n\t}\n\tif err := s.AddConversionFunc((*PluginConfig)(nil), (*api.PluginConfig)(nil), func(a, b interface{}, scope conversion.Scope) error {\n\t\treturn Convert_v1alpha2_PluginConfig_To_api_PluginConfig(a.(*PluginConfig), b.(*api.PluginConfig), scope)\n\t}); err != nil {\n\t\treturn err\n\t}\n\treturn nil\n}", "title": "" }, { "docid": "22afbe9d43a20e1489ecdc6d35b3a6f8", "score": "0.74576986", "text": "func RegisterConversions(s *runtime.Scheme) error {\n\tif err := s.AddGeneratedConversionFunc((*AdditionalBeneficiaryInformation)(nil), (*core.ClaimSpecification)(nil), func(a, b interface{}, scope conversion.Scope) error {\n\t\treturn Convert_v1_AdditionalBeneficiaryInformation_To_core_AdditionalBeneficiaryInformation(a.(*AdditionalBeneficiaryInformation), b.(*core.ClaimSpecification), scope)\n\t}); err != nil {\n\t\treturn err\n\t}\n\tif err := s.AddGeneratedConversionFunc((*core.ClaimSpecification)(nil), (*AdditionalBeneficiaryInformation)(nil), func(a, b interface{}, scope conversion.Scope) error {\n\t\treturn Convert_core_AdditionalBeneficiaryInformation_To_v1_AdditionalBeneficiaryInformation(a.(*core.ClaimSpecification), b.(*AdditionalBeneficiaryInformation), scope)\n\t}); err != nil {\n\t\treturn err\n\t}\n\tif err := s.AddGeneratedConversionFunc((*CustomResourceDefinition)(nil), (*core.CustomResourceDefinition)(nil), func(a, b interface{}, scope conversion.Scope) error {\n\t\treturn Convert_v1_CustomResourceDefinition_To_core_CustomResourceDefinition(a.(*CustomResourceDefinition), b.(*core.CustomResourceDefinition), scope)\n\t}); err != nil {\n\t\treturn err\n\t}\n\tif err := s.AddGeneratedConversionFunc((*core.CustomResourceDefinition)(nil), (*CustomResourceDefinition)(nil), func(a, b interface{}, scope conversion.Scope) error {\n\t\treturn Convert_core_CustomResourceDefinition_To_v1_CustomResourceDefinition(a.(*core.CustomResourceDefinition), b.(*CustomResourceDefinition), scope)\n\t}); err != nil {\n\t\treturn err\n\t}\n\tif err := s.AddGeneratedConversionFunc((*CustomResourceDefinitionList)(nil), (*core.CustomResourceDefinitionList)(nil), func(a, b interface{}, scope conversion.Scope) error {\n\t\treturn Convert_v1_CustomResourceDefinitionList_To_core_CustomResourceDefinitionList(a.(*CustomResourceDefinitionList), b.(*core.CustomResourceDefinitionList), scope)\n\t}); err != nil {\n\t\treturn err\n\t}\n\tif err := s.AddGeneratedConversionFunc((*core.CustomResourceDefinitionList)(nil), (*CustomResourceDefinitionList)(nil), func(a, b interface{}, scope conversion.Scope) error {\n\t\treturn Convert_core_CustomResourceDefinitionList_To_v1_CustomResourceDefinitionList(a.(*core.CustomResourceDefinitionList), b.(*CustomResourceDefinitionList), scope)\n\t}); err != nil {\n\t\treturn err\n\t}\n\tif err := s.AddGeneratedConversionFunc((*CustomResourceDefinitionNames)(nil), (*core.CustomResourceDefinitionNames)(nil), func(a, b interface{}, scope conversion.Scope) error {\n\t\treturn Convert_v1_CustomResourceDefinitionNames_To_core_CustomResourceDefinitionNames(a.(*CustomResourceDefinitionNames), b.(*core.CustomResourceDefinitionNames), scope)\n\t}); err != nil {\n\t\treturn err\n\t}\n\tif err := s.AddGeneratedConversionFunc((*core.CustomResourceDefinitionNames)(nil), (*CustomResourceDefinitionNames)(nil), func(a, b interface{}, scope conversion.Scope) error {\n\t\treturn Convert_core_CustomResourceDefinitionNames_To_v1_CustomResourceDefinitionNames(a.(*core.CustomResourceDefinitionNames), b.(*CustomResourceDefinitionNames), scope)\n\t}); err != nil {\n\t\treturn err\n\t}\n\tif err := s.AddGeneratedConversionFunc((*CustomResourceDefinitionSpec)(nil), (*core.CustomResourceDefinitionSpec)(nil), func(a, b interface{}, scope conversion.Scope) error {\n\t\treturn Convert_v1_CustomResourceDefinitionSpec_To_core_CustomResourceDefinitionSpec(a.(*CustomResourceDefinitionSpec), b.(*core.CustomResourceDefinitionSpec), scope)\n\t}); err != nil {\n\t\treturn err\n\t}\n\tif err := s.AddGeneratedConversionFunc((*core.CustomResourceDefinitionSpec)(nil), (*CustomResourceDefinitionSpec)(nil), func(a, b interface{}, scope conversion.Scope) error {\n\t\treturn Convert_core_CustomResourceDefinitionSpec_To_v1_CustomResourceDefinitionSpec(a.(*core.CustomResourceDefinitionSpec), b.(*CustomResourceDefinitionSpec), scope)\n\t}); err != nil {\n\t\treturn err\n\t}\n\tif err := s.AddGeneratedConversionFunc((*CustomResourceDefinitionValidation)(nil), (*core.CustomResourceDefinitionValidation)(nil), func(a, b interface{}, scope conversion.Scope) error {\n\t\treturn Convert_v1_CustomResourceDefinitionValidation_To_core_CustomResourceDefinitionValidation(a.(*CustomResourceDefinitionValidation), b.(*core.CustomResourceDefinitionValidation), scope)\n\t}); err != nil {\n\t\treturn err\n\t}\n\tif err := s.AddGeneratedConversionFunc((*core.CustomResourceDefinitionValidation)(nil), (*CustomResourceDefinitionValidation)(nil), func(a, b interface{}, scope conversion.Scope) error {\n\t\treturn Convert_core_CustomResourceDefinitionValidation_To_v1_CustomResourceDefinitionValidation(a.(*core.CustomResourceDefinitionValidation), b.(*CustomResourceDefinitionValidation), scope)\n\t}); err != nil {\n\t\treturn err\n\t}\n\tif err := s.AddGeneratedConversionFunc((*CustomResourceDefinitionVersion)(nil), (*core.CustomResourceDefinitionVersion)(nil), func(a, b interface{}, scope conversion.Scope) error {\n\t\treturn Convert_v1_CustomResourceDefinitionVersion_To_core_CustomResourceDefinitionVersion(a.(*CustomResourceDefinitionVersion), b.(*core.CustomResourceDefinitionVersion), scope)\n\t}); err != nil {\n\t\treturn err\n\t}\n\tif err := s.AddGeneratedConversionFunc((*core.CustomResourceDefinitionVersion)(nil), (*CustomResourceDefinitionVersion)(nil), func(a, b interface{}, scope conversion.Scope) error {\n\t\treturn Convert_core_CustomResourceDefinitionVersion_To_v1_CustomResourceDefinitionVersion(a.(*core.CustomResourceDefinitionVersion), b.(*CustomResourceDefinitionVersion), scope)\n\t}); err != nil {\n\t\treturn err\n\t}\n\tif err := s.AddGeneratedConversionFunc((*ExternalDocumentation)(nil), (*core.ExternalDocumentation)(nil), func(a, b interface{}, scope conversion.Scope) error {\n\t\treturn Convert_v1_ExternalDocumentation_To_core_ExternalDocumentation(a.(*ExternalDocumentation), b.(*core.ExternalDocumentation), scope)\n\t}); err != nil {\n\t\treturn err\n\t}\n\tif err := s.AddGeneratedConversionFunc((*core.ExternalDocumentation)(nil), (*ExternalDocumentation)(nil), func(a, b interface{}, scope conversion.Scope) error {\n\t\treturn Convert_core_ExternalDocumentation_To_v1_ExternalDocumentation(a.(*core.ExternalDocumentation), b.(*ExternalDocumentation), scope)\n\t}); err != nil {\n\t\treturn err\n\t}\n\tif err := s.AddGeneratedConversionFunc((*FormDefinition)(nil), (*core.FormDefinition)(nil), func(a, b interface{}, scope conversion.Scope) error {\n\t\treturn Convert_v1_FormDefinition_To_core_FormDefinition(a.(*FormDefinition), b.(*core.FormDefinition), scope)\n\t}); err != nil {\n\t\treturn err\n\t}\n\tif err := s.AddGeneratedConversionFunc((*core.FormDefinition)(nil), (*FormDefinition)(nil), func(a, b interface{}, scope conversion.Scope) error {\n\t\treturn Convert_core_FormDefinition_To_v1_FormDefinition(a.(*core.FormDefinition), b.(*FormDefinition), scope)\n\t}); err != nil {\n\t\treturn err\n\t}\n\tif err := s.AddGeneratedConversionFunc((*FormDefinitionList)(nil), (*core.FormDefinitionList)(nil), func(a, b interface{}, scope conversion.Scope) error {\n\t\treturn Convert_v1_FormDefinitionList_To_core_FormDefinitionList(a.(*FormDefinitionList), b.(*core.FormDefinitionList), scope)\n\t}); err != nil {\n\t\treturn err\n\t}\n\tif err := s.AddGeneratedConversionFunc((*core.FormDefinitionList)(nil), (*FormDefinitionList)(nil), func(a, b interface{}, scope conversion.Scope) error {\n\t\treturn Convert_core_FormDefinitionList_To_v1_FormDefinitionList(a.(*core.FormDefinitionList), b.(*FormDefinitionList), scope)\n\t}); err != nil {\n\t\treturn err\n\t}\n\tif err := s.AddGeneratedConversionFunc((*FormDefinitionNames)(nil), (*core.FormDefinitionNames)(nil), func(a, b interface{}, scope conversion.Scope) error {\n\t\treturn Convert_v1_FormDefinitionNames_To_core_FormDefinitionNames(a.(*FormDefinitionNames), b.(*core.FormDefinitionNames), scope)\n\t}); err != nil {\n\t\treturn err\n\t}\n\tif err := s.AddGeneratedConversionFunc((*core.FormDefinitionNames)(nil), (*FormDefinitionNames)(nil), func(a, b interface{}, scope conversion.Scope) error {\n\t\treturn Convert_core_FormDefinitionNames_To_v1_FormDefinitionNames(a.(*core.FormDefinitionNames), b.(*FormDefinitionNames), scope)\n\t}); err != nil {\n\t\treturn err\n\t}\n\tif err := s.AddGeneratedConversionFunc((*FormDefinitionSchema)(nil), (*core.FormDefinitionSchema)(nil), func(a, b interface{}, scope conversion.Scope) error {\n\t\treturn Convert_v1_FormDefinitionSchema_To_core_FormDefinitionSchema(a.(*FormDefinitionSchema), b.(*core.FormDefinitionSchema), scope)\n\t}); err != nil {\n\t\treturn err\n\t}\n\tif err := s.AddGeneratedConversionFunc((*core.FormDefinitionSchema)(nil), (*FormDefinitionSchema)(nil), func(a, b interface{}, scope conversion.Scope) error {\n\t\treturn Convert_core_FormDefinitionSchema_To_v1_FormDefinitionSchema(a.(*core.FormDefinitionSchema), b.(*FormDefinitionSchema), scope)\n\t}); err != nil {\n\t\treturn err\n\t}\n\tif err := s.AddGeneratedConversionFunc((*FormDefinitionSpec)(nil), (*core.FormDefinitionSpec)(nil), func(a, b interface{}, scope conversion.Scope) error {\n\t\treturn Convert_v1_FormDefinitionSpec_To_core_FormDefinitionSpec(a.(*FormDefinitionSpec), b.(*core.FormDefinitionSpec), scope)\n\t}); err != nil {\n\t\treturn err\n\t}\n\tif err := s.AddGeneratedConversionFunc((*core.FormDefinitionSpec)(nil), (*FormDefinitionSpec)(nil), func(a, b interface{}, scope conversion.Scope) error {\n\t\treturn Convert_core_FormDefinitionSpec_To_v1_FormDefinitionSpec(a.(*core.FormDefinitionSpec), b.(*FormDefinitionSpec), scope)\n\t}); err != nil {\n\t\treturn err\n\t}\n\tif err := s.AddGeneratedConversionFunc((*FormDefinitionValidation)(nil), (*core.FormDefinitionValidation)(nil), func(a, b interface{}, scope conversion.Scope) error {\n\t\treturn Convert_v1_FormDefinitionValidation_To_core_FormDefinitionValidation(a.(*FormDefinitionValidation), b.(*core.FormDefinitionValidation), scope)\n\t}); err != nil {\n\t\treturn err\n\t}\n\tif err := s.AddGeneratedConversionFunc((*core.FormDefinitionValidation)(nil), (*FormDefinitionValidation)(nil), func(a, b interface{}, scope conversion.Scope) error {\n\t\treturn Convert_core_FormDefinitionValidation_To_v1_FormDefinitionValidation(a.(*core.FormDefinitionValidation), b.(*FormDefinitionValidation), scope)\n\t}); err != nil {\n\t\treturn err\n\t}\n\tif err := s.AddGeneratedConversionFunc((*FormDefinitionVersion)(nil), (*core.FormDefinitionVersion)(nil), func(a, b interface{}, scope conversion.Scope) error {\n\t\treturn Convert_v1_FormDefinitionVersion_To_core_FormDefinitionVersion(a.(*FormDefinitionVersion), b.(*core.FormDefinitionVersion), scope)\n\t}); err != nil {\n\t\treturn err\n\t}\n\tif err := s.AddGeneratedConversionFunc((*core.FormDefinitionVersion)(nil), (*FormDefinitionVersion)(nil), func(a, b interface{}, scope conversion.Scope) error {\n\t\treturn Convert_core_FormDefinitionVersion_To_v1_FormDefinitionVersion(a.(*core.FormDefinitionVersion), b.(*FormDefinitionVersion), scope)\n\t}); err != nil {\n\t\treturn err\n\t}\n\tif err := s.AddGeneratedConversionFunc((*FormElementDefinition)(nil), (*core.FormElementDefinition)(nil), func(a, b interface{}, scope conversion.Scope) error {\n\t\treturn Convert_v1_FormElementDefinition_To_core_FormElementDefinition(a.(*FormElementDefinition), b.(*core.FormElementDefinition), scope)\n\t}); err != nil {\n\t\treturn err\n\t}\n\tif err := s.AddGeneratedConversionFunc((*core.FormElementDefinition)(nil), (*FormElementDefinition)(nil), func(a, b interface{}, scope conversion.Scope) error {\n\t\treturn Convert_core_FormElementDefinition_To_v1_FormElementDefinition(a.(*core.FormElementDefinition), b.(*FormElementDefinition), scope)\n\t}); err != nil {\n\t\treturn err\n\t}\n\tif err := s.AddGeneratedConversionFunc((*JSON)(nil), (*core.JSON)(nil), func(a, b interface{}, scope conversion.Scope) error {\n\t\treturn Convert_v1_JSON_To_core_JSON(a.(*JSON), b.(*core.JSON), scope)\n\t}); err != nil {\n\t\treturn err\n\t}\n\tif err := s.AddGeneratedConversionFunc((*core.JSON)(nil), (*JSON)(nil), func(a, b interface{}, scope conversion.Scope) error {\n\t\treturn Convert_core_JSON_To_v1_JSON(a.(*core.JSON), b.(*JSON), scope)\n\t}); err != nil {\n\t\treturn err\n\t}\n\tif err := s.AddGeneratedConversionFunc((*JSONSchemaProps)(nil), (*core.JSONSchemaProps)(nil), func(a, b interface{}, scope conversion.Scope) error {\n\t\treturn Convert_v1_JSONSchemaProps_To_core_JSONSchemaProps(a.(*JSONSchemaProps), b.(*core.JSONSchemaProps), scope)\n\t}); err != nil {\n\t\treturn err\n\t}\n\tif err := s.AddGeneratedConversionFunc((*core.JSONSchemaProps)(nil), (*JSONSchemaProps)(nil), func(a, b interface{}, scope conversion.Scope) error {\n\t\treturn Convert_core_JSONSchemaProps_To_v1_JSONSchemaProps(a.(*core.JSONSchemaProps), b.(*JSONSchemaProps), scope)\n\t}); err != nil {\n\t\treturn err\n\t}\n\tif err := s.AddGeneratedConversionFunc((*JSONSchemaPropsOrArray)(nil), (*core.JSONSchemaPropsOrArray)(nil), func(a, b interface{}, scope conversion.Scope) error {\n\t\treturn Convert_v1_JSONSchemaPropsOrArray_To_core_JSONSchemaPropsOrArray(a.(*JSONSchemaPropsOrArray), b.(*core.JSONSchemaPropsOrArray), scope)\n\t}); err != nil {\n\t\treturn err\n\t}\n\tif err := s.AddGeneratedConversionFunc((*core.JSONSchemaPropsOrArray)(nil), (*JSONSchemaPropsOrArray)(nil), func(a, b interface{}, scope conversion.Scope) error {\n\t\treturn Convert_core_JSONSchemaPropsOrArray_To_v1_JSONSchemaPropsOrArray(a.(*core.JSONSchemaPropsOrArray), b.(*JSONSchemaPropsOrArray), scope)\n\t}); err != nil {\n\t\treturn err\n\t}\n\tif err := s.AddGeneratedConversionFunc((*JSONSchemaPropsOrBool)(nil), (*core.JSONSchemaPropsOrBool)(nil), func(a, b interface{}, scope conversion.Scope) error {\n\t\treturn Convert_v1_JSONSchemaPropsOrBool_To_core_JSONSchemaPropsOrBool(a.(*JSONSchemaPropsOrBool), b.(*core.JSONSchemaPropsOrBool), scope)\n\t}); err != nil {\n\t\treturn err\n\t}\n\tif err := s.AddGeneratedConversionFunc((*core.JSONSchemaPropsOrBool)(nil), (*JSONSchemaPropsOrBool)(nil), func(a, b interface{}, scope conversion.Scope) error {\n\t\treturn Convert_core_JSONSchemaPropsOrBool_To_v1_JSONSchemaPropsOrBool(a.(*core.JSONSchemaPropsOrBool), b.(*JSONSchemaPropsOrBool), scope)\n\t}); err != nil {\n\t\treturn err\n\t}\n\tif err := s.AddGeneratedConversionFunc((*JSONSchemaPropsOrStringArray)(nil), (*core.JSONSchemaPropsOrStringArray)(nil), func(a, b interface{}, scope conversion.Scope) error {\n\t\treturn Convert_v1_JSONSchemaPropsOrStringArray_To_core_JSONSchemaPropsOrStringArray(a.(*JSONSchemaPropsOrStringArray), b.(*core.JSONSchemaPropsOrStringArray), scope)\n\t}); err != nil {\n\t\treturn err\n\t}\n\tif err := s.AddGeneratedConversionFunc((*core.JSONSchemaPropsOrStringArray)(nil), (*JSONSchemaPropsOrStringArray)(nil), func(a, b interface{}, scope conversion.Scope) error {\n\t\treturn Convert_core_JSONSchemaPropsOrStringArray_To_v1_JSONSchemaPropsOrStringArray(a.(*core.JSONSchemaPropsOrStringArray), b.(*JSONSchemaPropsOrStringArray), scope)\n\t}); err != nil {\n\t\treturn err\n\t}\n\tif err := s.AddGeneratedConversionFunc((*OrganizationScope)(nil), (*core.OperatingScope)(nil), func(a, b interface{}, scope conversion.Scope) error {\n\t\treturn Convert_v1_OperatingScope_To_core_OperatingScope(a.(*OrganizationScope), b.(*core.OperatingScope), scope)\n\t}); err != nil {\n\t\treturn err\n\t}\n\tif err := s.AddGeneratedConversionFunc((*core.OperatingScope)(nil), (*OrganizationScope)(nil), func(a, b interface{}, scope conversion.Scope) error {\n\t\treturn Convert_core_OperatingScope_To_v1_OperatingScope(a.(*core.OperatingScope), b.(*OrganizationScope), scope)\n\t}); err != nil {\n\t\treturn err\n\t}\n\tif err := s.AddGeneratedConversionFunc((*OperatingScopeList)(nil), (*core.OperatingScopeList)(nil), func(a, b interface{}, scope conversion.Scope) error {\n\t\treturn Convert_v1_OperatingScopeList_To_core_OperatingScopeList(a.(*OperatingScopeList), b.(*core.OperatingScopeList), scope)\n\t}); err != nil {\n\t\treturn err\n\t}\n\tif err := s.AddGeneratedConversionFunc((*core.OperatingScopeList)(nil), (*OperatingScopeList)(nil), func(a, b interface{}, scope conversion.Scope) error {\n\t\treturn Convert_core_OperatingScopeList_To_v1_OperatingScopeList(a.(*core.OperatingScopeList), b.(*OperatingScopeList), scope)\n\t}); err != nil {\n\t\treturn err\n\t}\n\tif err := s.AddGeneratedConversionFunc((*OrganizationScopeSpec)(nil), (*core.OperatingScopeSpec)(nil), func(a, b interface{}, scope conversion.Scope) error {\n\t\treturn Convert_v1_OperatingScopeSpec_To_core_OperatingScopeSpec(a.(*OrganizationScopeSpec), b.(*core.OperatingScopeSpec), scope)\n\t}); err != nil {\n\t\treturn err\n\t}\n\tif err := s.AddGeneratedConversionFunc((*core.OperatingScopeSpec)(nil), (*OrganizationScopeSpec)(nil), func(a, b interface{}, scope conversion.Scope) error {\n\t\treturn Convert_core_OperatingScopeSpec_To_v1_OperatingScopeSpec(a.(*core.OperatingScopeSpec), b.(*OrganizationScopeSpec), scope)\n\t}); err != nil {\n\t\treturn err\n\t}\n\tif err := s.AddGeneratedConversionFunc((*TranslatedString)(nil), (*core.TranslatedString)(nil), func(a, b interface{}, scope conversion.Scope) error {\n\t\treturn Convert_v1_TranslatedString_To_core_TranslatedString(a.(*TranslatedString), b.(*core.TranslatedString), scope)\n\t}); err != nil {\n\t\treturn err\n\t}\n\tif err := s.AddGeneratedConversionFunc((*core.TranslatedString)(nil), (*TranslatedString)(nil), func(a, b interface{}, scope conversion.Scope) error {\n\t\treturn Convert_core_TranslatedString_To_v1_TranslatedString(a.(*core.TranslatedString), b.(*TranslatedString), scope)\n\t}); err != nil {\n\t\treturn err\n\t}\n\tif err := s.AddGeneratedConversionFunc((*User)(nil), (*core.User)(nil), func(a, b interface{}, scope conversion.Scope) error {\n\t\treturn Convert_v1_User_To_core_User(a.(*User), b.(*core.User), scope)\n\t}); err != nil {\n\t\treturn err\n\t}\n\tif err := s.AddGeneratedConversionFunc((*core.User)(nil), (*User)(nil), func(a, b interface{}, scope conversion.Scope) error {\n\t\treturn Convert_core_User_To_v1_User(a.(*core.User), b.(*User), scope)\n\t}); err != nil {\n\t\treturn err\n\t}\n\tif err := s.AddGeneratedConversionFunc((*UserList)(nil), (*core.UserList)(nil), func(a, b interface{}, scope conversion.Scope) error {\n\t\treturn Convert_v1_UserList_To_core_UserList(a.(*UserList), b.(*core.UserList), scope)\n\t}); err != nil {\n\t\treturn err\n\t}\n\tif err := s.AddGeneratedConversionFunc((*core.UserList)(nil), (*UserList)(nil), func(a, b interface{}, scope conversion.Scope) error {\n\t\treturn Convert_core_UserList_To_v1_UserList(a.(*core.UserList), b.(*UserList), scope)\n\t}); err != nil {\n\t\treturn err\n\t}\n\treturn nil\n}", "title": "" }, { "docid": "dec6def5bb967e6e83ba247b00d25a28", "score": "0.74545676", "text": "func RegisterConversions(s *runtime.Scheme) error {\n\tif err := s.AddGeneratedConversionFunc((*APIEndpoint)(nil), (*v1alpha3.APIEndpoint)(nil), func(a, b interface{}, scope conversion.Scope) error {\n\t\treturn Convert_v1alpha2_APIEndpoint_To_v1alpha3_APIEndpoint(a.(*APIEndpoint), b.(*v1alpha3.APIEndpoint), scope)\n\t}); err != nil {\n\t\treturn err\n\t}\n\tif err := s.AddGeneratedConversionFunc((*v1alpha3.APIEndpoint)(nil), (*APIEndpoint)(nil), func(a, b interface{}, scope conversion.Scope) error {\n\t\treturn Convert_v1alpha3_APIEndpoint_To_v1alpha2_APIEndpoint(a.(*v1alpha3.APIEndpoint), b.(*APIEndpoint), scope)\n\t}); err != nil {\n\t\treturn err\n\t}\n\tif err := s.AddGeneratedConversionFunc((*CPIConfig)(nil), (*v1alpha3.CPIConfig)(nil), func(a, b interface{}, scope conversion.Scope) error {\n\t\treturn Convert_v1alpha2_CPIConfig_To_v1alpha3_CPIConfig(a.(*CPIConfig), b.(*v1alpha3.CPIConfig), scope)\n\t}); err != nil {\n\t\treturn err\n\t}\n\tif err := s.AddGeneratedConversionFunc((*v1alpha3.CPIConfig)(nil), (*CPIConfig)(nil), func(a, b interface{}, scope conversion.Scope) error {\n\t\treturn Convert_v1alpha3_CPIConfig_To_v1alpha2_CPIConfig(a.(*v1alpha3.CPIConfig), b.(*CPIConfig), scope)\n\t}); err != nil {\n\t\treturn err\n\t}\n\tif err := s.AddGeneratedConversionFunc((*CPIDiskConfig)(nil), (*v1alpha3.CPIDiskConfig)(nil), func(a, b interface{}, scope conversion.Scope) error {\n\t\treturn Convert_v1alpha2_CPIDiskConfig_To_v1alpha3_CPIDiskConfig(a.(*CPIDiskConfig), b.(*v1alpha3.CPIDiskConfig), scope)\n\t}); err != nil {\n\t\treturn err\n\t}\n\tif err := s.AddGeneratedConversionFunc((*v1alpha3.CPIDiskConfig)(nil), (*CPIDiskConfig)(nil), func(a, b interface{}, scope conversion.Scope) error {\n\t\treturn Convert_v1alpha3_CPIDiskConfig_To_v1alpha2_CPIDiskConfig(a.(*v1alpha3.CPIDiskConfig), b.(*CPIDiskConfig), scope)\n\t}); err != nil {\n\t\treturn err\n\t}\n\tif err := s.AddGeneratedConversionFunc((*CPIGlobalConfig)(nil), (*v1alpha3.CPIGlobalConfig)(nil), func(a, b interface{}, scope conversion.Scope) error {\n\t\treturn Convert_v1alpha2_CPIGlobalConfig_To_v1alpha3_CPIGlobalConfig(a.(*CPIGlobalConfig), b.(*v1alpha3.CPIGlobalConfig), scope)\n\t}); err != nil {\n\t\treturn err\n\t}\n\tif err := s.AddGeneratedConversionFunc((*v1alpha3.CPIGlobalConfig)(nil), (*CPIGlobalConfig)(nil), func(a, b interface{}, scope conversion.Scope) error {\n\t\treturn Convert_v1alpha3_CPIGlobalConfig_To_v1alpha2_CPIGlobalConfig(a.(*v1alpha3.CPIGlobalConfig), b.(*CPIGlobalConfig), scope)\n\t}); err != nil {\n\t\treturn err\n\t}\n\tif err := s.AddGeneratedConversionFunc((*CPILabelConfig)(nil), (*v1alpha3.CPILabelConfig)(nil), func(a, b interface{}, scope conversion.Scope) error {\n\t\treturn Convert_v1alpha2_CPILabelConfig_To_v1alpha3_CPILabelConfig(a.(*CPILabelConfig), b.(*v1alpha3.CPILabelConfig), scope)\n\t}); err != nil {\n\t\treturn err\n\t}\n\tif err := s.AddGeneratedConversionFunc((*v1alpha3.CPILabelConfig)(nil), (*CPILabelConfig)(nil), func(a, b interface{}, scope conversion.Scope) error {\n\t\treturn Convert_v1alpha3_CPILabelConfig_To_v1alpha2_CPILabelConfig(a.(*v1alpha3.CPILabelConfig), b.(*CPILabelConfig), scope)\n\t}); err != nil {\n\t\treturn err\n\t}\n\tif err := s.AddGeneratedConversionFunc((*CPINetworkConfig)(nil), (*v1alpha3.CPINetworkConfig)(nil), func(a, b interface{}, scope conversion.Scope) error {\n\t\treturn Convert_v1alpha2_CPINetworkConfig_To_v1alpha3_CPINetworkConfig(a.(*CPINetworkConfig), b.(*v1alpha3.CPINetworkConfig), scope)\n\t}); err != nil {\n\t\treturn err\n\t}\n\tif err := s.AddGeneratedConversionFunc((*v1alpha3.CPINetworkConfig)(nil), (*CPINetworkConfig)(nil), func(a, b interface{}, scope conversion.Scope) error {\n\t\treturn Convert_v1alpha3_CPINetworkConfig_To_v1alpha2_CPINetworkConfig(a.(*v1alpha3.CPINetworkConfig), b.(*CPINetworkConfig), scope)\n\t}); err != nil {\n\t\treturn err\n\t}\n\tif err := s.AddGeneratedConversionFunc((*CPIProviderConfig)(nil), (*v1alpha3.CPIProviderConfig)(nil), func(a, b interface{}, scope conversion.Scope) error {\n\t\treturn Convert_v1alpha2_CPIProviderConfig_To_v1alpha3_CPIProviderConfig(a.(*CPIProviderConfig), b.(*v1alpha3.CPIProviderConfig), scope)\n\t}); err != nil {\n\t\treturn err\n\t}\n\tif err := s.AddGeneratedConversionFunc((*v1alpha3.CPIProviderConfig)(nil), (*CPIProviderConfig)(nil), func(a, b interface{}, scope conversion.Scope) error {\n\t\treturn Convert_v1alpha3_CPIProviderConfig_To_v1alpha2_CPIProviderConfig(a.(*v1alpha3.CPIProviderConfig), b.(*CPIProviderConfig), scope)\n\t}); err != nil {\n\t\treturn err\n\t}\n\tif err := s.AddGeneratedConversionFunc((*CPIStorageConfig)(nil), (*v1alpha3.CPIStorageConfig)(nil), func(a, b interface{}, scope conversion.Scope) error {\n\t\treturn Convert_v1alpha2_CPIStorageConfig_To_v1alpha3_CPIStorageConfig(a.(*CPIStorageConfig), b.(*v1alpha3.CPIStorageConfig), scope)\n\t}); err != nil {\n\t\treturn err\n\t}\n\tif err := s.AddGeneratedConversionFunc((*v1alpha3.CPIStorageConfig)(nil), (*CPIStorageConfig)(nil), func(a, b interface{}, scope conversion.Scope) error {\n\t\treturn Convert_v1alpha3_CPIStorageConfig_To_v1alpha2_CPIStorageConfig(a.(*v1alpha3.CPIStorageConfig), b.(*CPIStorageConfig), scope)\n\t}); err != nil {\n\t\treturn err\n\t}\n\tif err := s.AddGeneratedConversionFunc((*CPIVCenterConfig)(nil), (*v1alpha3.CPIVCenterConfig)(nil), func(a, b interface{}, scope conversion.Scope) error {\n\t\treturn Convert_v1alpha2_CPIVCenterConfig_To_v1alpha3_CPIVCenterConfig(a.(*CPIVCenterConfig), b.(*v1alpha3.CPIVCenterConfig), scope)\n\t}); err != nil {\n\t\treturn err\n\t}\n\tif err := s.AddGeneratedConversionFunc((*v1alpha3.CPIVCenterConfig)(nil), (*CPIVCenterConfig)(nil), func(a, b interface{}, scope conversion.Scope) error {\n\t\treturn Convert_v1alpha3_CPIVCenterConfig_To_v1alpha2_CPIVCenterConfig(a.(*v1alpha3.CPIVCenterConfig), b.(*CPIVCenterConfig), scope)\n\t}); err != nil {\n\t\treturn err\n\t}\n\tif err := s.AddGeneratedConversionFunc((*CPIWorkspaceConfig)(nil), (*v1alpha3.CPIWorkspaceConfig)(nil), func(a, b interface{}, scope conversion.Scope) error {\n\t\treturn Convert_v1alpha2_CPIWorkspaceConfig_To_v1alpha3_CPIWorkspaceConfig(a.(*CPIWorkspaceConfig), b.(*v1alpha3.CPIWorkspaceConfig), scope)\n\t}); err != nil {\n\t\treturn err\n\t}\n\tif err := s.AddGeneratedConversionFunc((*v1alpha3.CPIWorkspaceConfig)(nil), (*CPIWorkspaceConfig)(nil), func(a, b interface{}, scope conversion.Scope) error {\n\t\treturn Convert_v1alpha3_CPIWorkspaceConfig_To_v1alpha2_CPIWorkspaceConfig(a.(*v1alpha3.CPIWorkspaceConfig), b.(*CPIWorkspaceConfig), scope)\n\t}); err != nil {\n\t\treturn err\n\t}\n\tif err := s.AddGeneratedConversionFunc((*NetworkDeviceSpec)(nil), (*v1alpha3.NetworkDeviceSpec)(nil), func(a, b interface{}, scope conversion.Scope) error {\n\t\treturn Convert_v1alpha2_NetworkDeviceSpec_To_v1alpha3_NetworkDeviceSpec(a.(*NetworkDeviceSpec), b.(*v1alpha3.NetworkDeviceSpec), scope)\n\t}); err != nil {\n\t\treturn err\n\t}\n\tif err := s.AddGeneratedConversionFunc((*v1alpha3.NetworkDeviceSpec)(nil), (*NetworkDeviceSpec)(nil), func(a, b interface{}, scope conversion.Scope) error {\n\t\treturn Convert_v1alpha3_NetworkDeviceSpec_To_v1alpha2_NetworkDeviceSpec(a.(*v1alpha3.NetworkDeviceSpec), b.(*NetworkDeviceSpec), scope)\n\t}); err != nil {\n\t\treturn err\n\t}\n\tif err := s.AddGeneratedConversionFunc((*NetworkRouteSpec)(nil), (*v1alpha3.NetworkRouteSpec)(nil), func(a, b interface{}, scope conversion.Scope) error {\n\t\treturn Convert_v1alpha2_NetworkRouteSpec_To_v1alpha3_NetworkRouteSpec(a.(*NetworkRouteSpec), b.(*v1alpha3.NetworkRouteSpec), scope)\n\t}); err != nil {\n\t\treturn err\n\t}\n\tif err := s.AddGeneratedConversionFunc((*v1alpha3.NetworkRouteSpec)(nil), (*NetworkRouteSpec)(nil), func(a, b interface{}, scope conversion.Scope) error {\n\t\treturn Convert_v1alpha3_NetworkRouteSpec_To_v1alpha2_NetworkRouteSpec(a.(*v1alpha3.NetworkRouteSpec), b.(*NetworkRouteSpec), scope)\n\t}); err != nil {\n\t\treturn err\n\t}\n\tif err := s.AddGeneratedConversionFunc((*NetworkSpec)(nil), (*v1alpha3.NetworkSpec)(nil), func(a, b interface{}, scope conversion.Scope) error {\n\t\treturn Convert_v1alpha2_NetworkSpec_To_v1alpha3_NetworkSpec(a.(*NetworkSpec), b.(*v1alpha3.NetworkSpec), scope)\n\t}); err != nil {\n\t\treturn err\n\t}\n\tif err := s.AddGeneratedConversionFunc((*v1alpha3.NetworkSpec)(nil), (*NetworkSpec)(nil), func(a, b interface{}, scope conversion.Scope) error {\n\t\treturn Convert_v1alpha3_NetworkSpec_To_v1alpha2_NetworkSpec(a.(*v1alpha3.NetworkSpec), b.(*NetworkSpec), scope)\n\t}); err != nil {\n\t\treturn err\n\t}\n\tif err := s.AddGeneratedConversionFunc((*NetworkStatus)(nil), (*v1alpha3.NetworkStatus)(nil), func(a, b interface{}, scope conversion.Scope) error {\n\t\treturn Convert_v1alpha2_NetworkStatus_To_v1alpha3_NetworkStatus(a.(*NetworkStatus), b.(*v1alpha3.NetworkStatus), scope)\n\t}); err != nil {\n\t\treturn err\n\t}\n\tif err := s.AddGeneratedConversionFunc((*v1alpha3.NetworkStatus)(nil), (*NetworkStatus)(nil), func(a, b interface{}, scope conversion.Scope) error {\n\t\treturn Convert_v1alpha3_NetworkStatus_To_v1alpha2_NetworkStatus(a.(*v1alpha3.NetworkStatus), b.(*NetworkStatus), scope)\n\t}); err != nil {\n\t\treturn err\n\t}\n\tif err := s.AddGeneratedConversionFunc((*VSphereCluster)(nil), (*v1alpha3.VSphereCluster)(nil), func(a, b interface{}, scope conversion.Scope) error {\n\t\treturn Convert_v1alpha2_VSphereCluster_To_v1alpha3_VSphereCluster(a.(*VSphereCluster), b.(*v1alpha3.VSphereCluster), scope)\n\t}); err != nil {\n\t\treturn err\n\t}\n\tif err := s.AddGeneratedConversionFunc((*v1alpha3.VSphereCluster)(nil), (*VSphereCluster)(nil), func(a, b interface{}, scope conversion.Scope) error {\n\t\treturn Convert_v1alpha3_VSphereCluster_To_v1alpha2_VSphereCluster(a.(*v1alpha3.VSphereCluster), b.(*VSphereCluster), scope)\n\t}); err != nil {\n\t\treturn err\n\t}\n\tif err := s.AddGeneratedConversionFunc((*VSphereClusterList)(nil), (*v1alpha3.VSphereClusterList)(nil), func(a, b interface{}, scope conversion.Scope) error {\n\t\treturn Convert_v1alpha2_VSphereClusterList_To_v1alpha3_VSphereClusterList(a.(*VSphereClusterList), b.(*v1alpha3.VSphereClusterList), scope)\n\t}); err != nil {\n\t\treturn err\n\t}\n\tif err := s.AddGeneratedConversionFunc((*v1alpha3.VSphereClusterList)(nil), (*VSphereClusterList)(nil), func(a, b interface{}, scope conversion.Scope) error {\n\t\treturn Convert_v1alpha3_VSphereClusterList_To_v1alpha2_VSphereClusterList(a.(*v1alpha3.VSphereClusterList), b.(*VSphereClusterList), scope)\n\t}); err != nil {\n\t\treturn err\n\t}\n\tif err := s.AddGeneratedConversionFunc((*VSphereClusterSpec)(nil), (*v1alpha3.VSphereClusterSpec)(nil), func(a, b interface{}, scope conversion.Scope) error {\n\t\treturn Convert_v1alpha2_VSphereClusterSpec_To_v1alpha3_VSphereClusterSpec(a.(*VSphereClusterSpec), b.(*v1alpha3.VSphereClusterSpec), scope)\n\t}); err != nil {\n\t\treturn err\n\t}\n\tif err := s.AddGeneratedConversionFunc((*VSphereMachine)(nil), (*v1alpha3.VSphereMachine)(nil), func(a, b interface{}, scope conversion.Scope) error {\n\t\treturn Convert_v1alpha2_VSphereMachine_To_v1alpha3_VSphereMachine(a.(*VSphereMachine), b.(*v1alpha3.VSphereMachine), scope)\n\t}); err != nil {\n\t\treturn err\n\t}\n\tif err := s.AddGeneratedConversionFunc((*v1alpha3.VSphereMachine)(nil), (*VSphereMachine)(nil), func(a, b interface{}, scope conversion.Scope) error {\n\t\treturn Convert_v1alpha3_VSphereMachine_To_v1alpha2_VSphereMachine(a.(*v1alpha3.VSphereMachine), b.(*VSphereMachine), scope)\n\t}); err != nil {\n\t\treturn err\n\t}\n\tif err := s.AddGeneratedConversionFunc((*VSphereMachineList)(nil), (*v1alpha3.VSphereMachineList)(nil), func(a, b interface{}, scope conversion.Scope) error {\n\t\treturn Convert_v1alpha2_VSphereMachineList_To_v1alpha3_VSphereMachineList(a.(*VSphereMachineList), b.(*v1alpha3.VSphereMachineList), scope)\n\t}); err != nil {\n\t\treturn err\n\t}\n\tif err := s.AddGeneratedConversionFunc((*v1alpha3.VSphereMachineList)(nil), (*VSphereMachineList)(nil), func(a, b interface{}, scope conversion.Scope) error {\n\t\treturn Convert_v1alpha3_VSphereMachineList_To_v1alpha2_VSphereMachineList(a.(*v1alpha3.VSphereMachineList), b.(*VSphereMachineList), scope)\n\t}); err != nil {\n\t\treturn err\n\t}\n\tif err := s.AddGeneratedConversionFunc((*VSphereMachineTemplate)(nil), (*v1alpha3.VSphereMachineTemplate)(nil), func(a, b interface{}, scope conversion.Scope) error {\n\t\treturn Convert_v1alpha2_VSphereMachineTemplate_To_v1alpha3_VSphereMachineTemplate(a.(*VSphereMachineTemplate), b.(*v1alpha3.VSphereMachineTemplate), scope)\n\t}); err != nil {\n\t\treturn err\n\t}\n\tif err := s.AddGeneratedConversionFunc((*v1alpha3.VSphereMachineTemplate)(nil), (*VSphereMachineTemplate)(nil), func(a, b interface{}, scope conversion.Scope) error {\n\t\treturn Convert_v1alpha3_VSphereMachineTemplate_To_v1alpha2_VSphereMachineTemplate(a.(*v1alpha3.VSphereMachineTemplate), b.(*VSphereMachineTemplate), scope)\n\t}); err != nil {\n\t\treturn err\n\t}\n\tif err := s.AddGeneratedConversionFunc((*VSphereMachineTemplateList)(nil), (*v1alpha3.VSphereMachineTemplateList)(nil), func(a, b interface{}, scope conversion.Scope) error {\n\t\treturn Convert_v1alpha2_VSphereMachineTemplateList_To_v1alpha3_VSphereMachineTemplateList(a.(*VSphereMachineTemplateList), b.(*v1alpha3.VSphereMachineTemplateList), scope)\n\t}); err != nil {\n\t\treturn err\n\t}\n\tif err := s.AddGeneratedConversionFunc((*v1alpha3.VSphereMachineTemplateList)(nil), (*VSphereMachineTemplateList)(nil), func(a, b interface{}, scope conversion.Scope) error {\n\t\treturn Convert_v1alpha3_VSphereMachineTemplateList_To_v1alpha2_VSphereMachineTemplateList(a.(*v1alpha3.VSphereMachineTemplateList), b.(*VSphereMachineTemplateList), scope)\n\t}); err != nil {\n\t\treturn err\n\t}\n\tif err := s.AddGeneratedConversionFunc((*v1alpha3.VSphereMachineTemplateResource)(nil), (*VSphereMachineTemplateResource)(nil), func(a, b interface{}, scope conversion.Scope) error {\n\t\treturn Convert_v1alpha3_VSphereMachineTemplateResource_To_v1alpha2_VSphereMachineTemplateResource(a.(*v1alpha3.VSphereMachineTemplateResource), b.(*VSphereMachineTemplateResource), scope)\n\t}); err != nil {\n\t\treturn err\n\t}\n\tif err := s.AddGeneratedConversionFunc((*VSphereMachineTemplateSpec)(nil), (*v1alpha3.VSphereMachineTemplateSpec)(nil), func(a, b interface{}, scope conversion.Scope) error {\n\t\treturn Convert_v1alpha2_VSphereMachineTemplateSpec_To_v1alpha3_VSphereMachineTemplateSpec(a.(*VSphereMachineTemplateSpec), b.(*v1alpha3.VSphereMachineTemplateSpec), scope)\n\t}); err != nil {\n\t\treturn err\n\t}\n\tif err := s.AddGeneratedConversionFunc((*v1alpha3.VSphereMachineTemplateSpec)(nil), (*VSphereMachineTemplateSpec)(nil), func(a, b interface{}, scope conversion.Scope) error {\n\t\treturn Convert_v1alpha3_VSphereMachineTemplateSpec_To_v1alpha2_VSphereMachineTemplateSpec(a.(*v1alpha3.VSphereMachineTemplateSpec), b.(*VSphereMachineTemplateSpec), scope)\n\t}); err != nil {\n\t\treturn err\n\t}\n\tif err := s.AddGeneratedConversionFunc((*VirtualMachine)(nil), (*v1alpha3.VirtualMachine)(nil), func(a, b interface{}, scope conversion.Scope) error {\n\t\treturn Convert_v1alpha2_VirtualMachine_To_v1alpha3_VirtualMachine(a.(*VirtualMachine), b.(*v1alpha3.VirtualMachine), scope)\n\t}); err != nil {\n\t\treturn err\n\t}\n\tif err := s.AddGeneratedConversionFunc((*v1alpha3.VirtualMachine)(nil), (*VirtualMachine)(nil), func(a, b interface{}, scope conversion.Scope) error {\n\t\treturn Convert_v1alpha3_VirtualMachine_To_v1alpha2_VirtualMachine(a.(*v1alpha3.VirtualMachine), b.(*VirtualMachine), scope)\n\t}); err != nil {\n\t\treturn err\n\t}\n\tif err := s.AddConversionFunc((*CPICloudConfig)(nil), (*v1alpha3.CPICloudConfig)(nil), func(a, b interface{}, scope conversion.Scope) error {\n\t\treturn Convert_v1alpha2_CPICloudConfig_To_v1alpha3_CPICloudConfig(a.(*CPICloudConfig), b.(*v1alpha3.CPICloudConfig), scope)\n\t}); err != nil {\n\t\treturn err\n\t}\n\tif err := s.AddConversionFunc((*VSphereClusterStatus)(nil), (*v1alpha3.VSphereClusterStatus)(nil), func(a, b interface{}, scope conversion.Scope) error {\n\t\treturn Convert_v1alpha2_VSphereClusterStatus_To_v1alpha3_VSphereClusterStatus(a.(*VSphereClusterStatus), b.(*v1alpha3.VSphereClusterStatus), scope)\n\t}); err != nil {\n\t\treturn err\n\t}\n\tif err := s.AddConversionFunc((*VSphereMachineSpec)(nil), (*v1alpha3.VSphereMachineSpec)(nil), func(a, b interface{}, scope conversion.Scope) error {\n\t\treturn Convert_v1alpha2_VSphereMachineSpec_To_v1alpha3_VSphereMachineSpec(a.(*VSphereMachineSpec), b.(*v1alpha3.VSphereMachineSpec), scope)\n\t}); err != nil {\n\t\treturn err\n\t}\n\tif err := s.AddConversionFunc((*VSphereMachineStatus)(nil), (*v1alpha3.VSphereMachineStatus)(nil), func(a, b interface{}, scope conversion.Scope) error {\n\t\treturn Convert_v1alpha2_VSphereMachineStatus_To_v1alpha3_VSphereMachineStatus(a.(*VSphereMachineStatus), b.(*v1alpha3.VSphereMachineStatus), scope)\n\t}); err != nil {\n\t\treturn err\n\t}\n\tif err := s.AddConversionFunc((*VSphereMachineTemplateResource)(nil), (*v1alpha3.VSphereMachineTemplateResource)(nil), func(a, b interface{}, scope conversion.Scope) error {\n\t\treturn Convert_v1alpha2_VSphereMachineTemplateResource_To_v1alpha3_VSphereMachineTemplateResource(a.(*VSphereMachineTemplateResource), b.(*v1alpha3.VSphereMachineTemplateResource), scope)\n\t}); err != nil {\n\t\treturn err\n\t}\n\tif err := s.AddConversionFunc((*v1alpha3.CPICloudConfig)(nil), (*CPICloudConfig)(nil), func(a, b interface{}, scope conversion.Scope) error {\n\t\treturn Convert_v1alpha3_CPICloudConfig_To_v1alpha2_CPICloudConfig(a.(*v1alpha3.CPICloudConfig), b.(*CPICloudConfig), scope)\n\t}); err != nil {\n\t\treturn err\n\t}\n\tif err := s.AddConversionFunc((*v1alpha3.VSphereClusterSpec)(nil), (*VSphereClusterSpec)(nil), func(a, b interface{}, scope conversion.Scope) error {\n\t\treturn Convert_v1alpha3_VSphereClusterSpec_To_v1alpha2_VSphereClusterSpec(a.(*v1alpha3.VSphereClusterSpec), b.(*VSphereClusterSpec), scope)\n\t}); err != nil {\n\t\treturn err\n\t}\n\tif err := s.AddConversionFunc((*v1alpha3.VSphereClusterStatus)(nil), (*VSphereClusterStatus)(nil), func(a, b interface{}, scope conversion.Scope) error {\n\t\treturn Convert_v1alpha3_VSphereClusterStatus_To_v1alpha2_VSphereClusterStatus(a.(*v1alpha3.VSphereClusterStatus), b.(*VSphereClusterStatus), scope)\n\t}); err != nil {\n\t\treturn err\n\t}\n\tif err := s.AddConversionFunc((*v1alpha3.VSphereMachineSpec)(nil), (*VSphereMachineSpec)(nil), func(a, b interface{}, scope conversion.Scope) error {\n\t\treturn Convert_v1alpha3_VSphereMachineSpec_To_v1alpha2_VSphereMachineSpec(a.(*v1alpha3.VSphereMachineSpec), b.(*VSphereMachineSpec), scope)\n\t}); err != nil {\n\t\treturn err\n\t}\n\tif err := s.AddConversionFunc((*v1alpha3.VSphereMachineStatus)(nil), (*VSphereMachineStatus)(nil), func(a, b interface{}, scope conversion.Scope) error {\n\t\treturn Convert_v1alpha3_VSphereMachineStatus_To_v1alpha2_VSphereMachineStatus(a.(*v1alpha3.VSphereMachineStatus), b.(*VSphereMachineStatus), scope)\n\t}); err != nil {\n\t\treturn err\n\t}\n\treturn nil\n}", "title": "" }, { "docid": "0d8c6973573b8480d0266303f841c911", "score": "0.73649156", "text": "func RegisterConversions(scheme *runtime.Scheme) error {\n\treturn scheme.AddGeneratedConversionFuncs(\n\t\tConvert_v1alpha1_DefaultBackup_To_backup_DefaultBackup,\n\t\tConvert_backup_DefaultBackup_To_v1alpha1_DefaultBackup,\n\t\tConvert_v1alpha1_DefaultBackupList_To_backup_DefaultBackupList,\n\t\tConvert_backup_DefaultBackupList_To_v1alpha1_DefaultBackupList,\n\t\tConvert_v1alpha1_DefaultBackupSpec_To_backup_DefaultBackupSpec,\n\t\tConvert_backup_DefaultBackupSpec_To_v1alpha1_DefaultBackupSpec,\n\t\tConvert_v1alpha1_DefaultBackupStatus_To_backup_DefaultBackupStatus,\n\t\tConvert_backup_DefaultBackupStatus_To_v1alpha1_DefaultBackupStatus,\n\t\tConvert_v1alpha1_DefaultBackupStatusStrategy_To_backup_DefaultBackupStatusStrategy,\n\t\tConvert_backup_DefaultBackupStatusStrategy_To_v1alpha1_DefaultBackupStatusStrategy,\n\t\tConvert_v1alpha1_DefaultBackupStrategy_To_backup_DefaultBackupStrategy,\n\t\tConvert_backup_DefaultBackupStrategy_To_v1alpha1_DefaultBackupStrategy,\n\t)\n}", "title": "" }, { "docid": "99f4957df8a01795b70d201e299bb036", "score": "0.7359387", "text": "func RegisterConversions(s *runtime.Scheme) error {\n\tif err := s.AddGeneratedConversionFunc((*CRDDeletionProtection)(nil), (*config.CRDDeletionProtection)(nil), func(a, b interface{}, scope conversion.Scope) error {\n\t\treturn Convert_v1alpha1_CRDDeletionProtection_To_config_CRDDeletionProtection(a.(*CRDDeletionProtection), b.(*config.CRDDeletionProtection), scope)\n\t}); err != nil {\n\t\treturn err\n\t}\n\tif err := s.AddGeneratedConversionFunc((*config.CRDDeletionProtection)(nil), (*CRDDeletionProtection)(nil), func(a, b interface{}, scope conversion.Scope) error {\n\t\treturn Convert_config_CRDDeletionProtection_To_v1alpha1_CRDDeletionProtection(a.(*config.CRDDeletionProtection), b.(*CRDDeletionProtection), scope)\n\t}); err != nil {\n\t\treturn err\n\t}\n\tif err := s.AddGeneratedConversionFunc((*EndpointSliceHintsWebhookConfig)(nil), (*config.EndpointSliceHintsWebhookConfig)(nil), func(a, b interface{}, scope conversion.Scope) error {\n\t\treturn Convert_v1alpha1_EndpointSliceHintsWebhookConfig_To_config_EndpointSliceHintsWebhookConfig(a.(*EndpointSliceHintsWebhookConfig), b.(*config.EndpointSliceHintsWebhookConfig), scope)\n\t}); err != nil {\n\t\treturn err\n\t}\n\tif err := s.AddGeneratedConversionFunc((*config.EndpointSliceHintsWebhookConfig)(nil), (*EndpointSliceHintsWebhookConfig)(nil), func(a, b interface{}, scope conversion.Scope) error {\n\t\treturn Convert_config_EndpointSliceHintsWebhookConfig_To_v1alpha1_EndpointSliceHintsWebhookConfig(a.(*config.EndpointSliceHintsWebhookConfig), b.(*EndpointSliceHintsWebhookConfig), scope)\n\t}); err != nil {\n\t\treturn err\n\t}\n\tif err := s.AddGeneratedConversionFunc((*ExtensionValidation)(nil), (*config.ExtensionValidation)(nil), func(a, b interface{}, scope conversion.Scope) error {\n\t\treturn Convert_v1alpha1_ExtensionValidation_To_config_ExtensionValidation(a.(*ExtensionValidation), b.(*config.ExtensionValidation), scope)\n\t}); err != nil {\n\t\treturn err\n\t}\n\tif err := s.AddGeneratedConversionFunc((*config.ExtensionValidation)(nil), (*ExtensionValidation)(nil), func(a, b interface{}, scope conversion.Scope) error {\n\t\treturn Convert_config_ExtensionValidation_To_v1alpha1_ExtensionValidation(a.(*config.ExtensionValidation), b.(*ExtensionValidation), scope)\n\t}); err != nil {\n\t\treturn err\n\t}\n\tif err := s.AddGeneratedConversionFunc((*GarbageCollectorControllerConfig)(nil), (*config.GarbageCollectorControllerConfig)(nil), func(a, b interface{}, scope conversion.Scope) error {\n\t\treturn Convert_v1alpha1_GarbageCollectorControllerConfig_To_config_GarbageCollectorControllerConfig(a.(*GarbageCollectorControllerConfig), b.(*config.GarbageCollectorControllerConfig), scope)\n\t}); err != nil {\n\t\treturn err\n\t}\n\tif err := s.AddGeneratedConversionFunc((*config.GarbageCollectorControllerConfig)(nil), (*GarbageCollectorControllerConfig)(nil), func(a, b interface{}, scope conversion.Scope) error {\n\t\treturn Convert_config_GarbageCollectorControllerConfig_To_v1alpha1_GarbageCollectorControllerConfig(a.(*config.GarbageCollectorControllerConfig), b.(*GarbageCollectorControllerConfig), scope)\n\t}); err != nil {\n\t\treturn err\n\t}\n\tif err := s.AddGeneratedConversionFunc((*HTTPSServer)(nil), (*config.HTTPSServer)(nil), func(a, b interface{}, scope conversion.Scope) error {\n\t\treturn Convert_v1alpha1_HTTPSServer_To_config_HTTPSServer(a.(*HTTPSServer), b.(*config.HTTPSServer), scope)\n\t}); err != nil {\n\t\treturn err\n\t}\n\tif err := s.AddGeneratedConversionFunc((*config.HTTPSServer)(nil), (*HTTPSServer)(nil), func(a, b interface{}, scope conversion.Scope) error {\n\t\treturn Convert_config_HTTPSServer_To_v1alpha1_HTTPSServer(a.(*config.HTTPSServer), b.(*HTTPSServer), scope)\n\t}); err != nil {\n\t\treturn err\n\t}\n\tif err := s.AddGeneratedConversionFunc((*HealthControllerConfig)(nil), (*config.HealthControllerConfig)(nil), func(a, b interface{}, scope conversion.Scope) error {\n\t\treturn Convert_v1alpha1_HealthControllerConfig_To_config_HealthControllerConfig(a.(*HealthControllerConfig), b.(*config.HealthControllerConfig), scope)\n\t}); err != nil {\n\t\treturn err\n\t}\n\tif err := s.AddGeneratedConversionFunc((*config.HealthControllerConfig)(nil), (*HealthControllerConfig)(nil), func(a, b interface{}, scope conversion.Scope) error {\n\t\treturn Convert_config_HealthControllerConfig_To_v1alpha1_HealthControllerConfig(a.(*config.HealthControllerConfig), b.(*HealthControllerConfig), scope)\n\t}); err != nil {\n\t\treturn err\n\t}\n\tif err := s.AddGeneratedConversionFunc((*HighAvailabilityConfigWebhookConfig)(nil), (*config.HighAvailabilityConfigWebhookConfig)(nil), func(a, b interface{}, scope conversion.Scope) error {\n\t\treturn Convert_v1alpha1_HighAvailabilityConfigWebhookConfig_To_config_HighAvailabilityConfigWebhookConfig(a.(*HighAvailabilityConfigWebhookConfig), b.(*config.HighAvailabilityConfigWebhookConfig), scope)\n\t}); err != nil {\n\t\treturn err\n\t}\n\tif err := s.AddGeneratedConversionFunc((*config.HighAvailabilityConfigWebhookConfig)(nil), (*HighAvailabilityConfigWebhookConfig)(nil), func(a, b interface{}, scope conversion.Scope) error {\n\t\treturn Convert_config_HighAvailabilityConfigWebhookConfig_To_v1alpha1_HighAvailabilityConfigWebhookConfig(a.(*config.HighAvailabilityConfigWebhookConfig), b.(*HighAvailabilityConfigWebhookConfig), scope)\n\t}); err != nil {\n\t\treturn err\n\t}\n\tif err := s.AddGeneratedConversionFunc((*IngressControllerSelector)(nil), (*config.IngressControllerSelector)(nil), func(a, b interface{}, scope conversion.Scope) error {\n\t\treturn Convert_v1alpha1_IngressControllerSelector_To_config_IngressControllerSelector(a.(*IngressControllerSelector), b.(*config.IngressControllerSelector), scope)\n\t}); err != nil {\n\t\treturn err\n\t}\n\tif err := s.AddGeneratedConversionFunc((*config.IngressControllerSelector)(nil), (*IngressControllerSelector)(nil), func(a, b interface{}, scope conversion.Scope) error {\n\t\treturn Convert_config_IngressControllerSelector_To_v1alpha1_IngressControllerSelector(a.(*config.IngressControllerSelector), b.(*IngressControllerSelector), scope)\n\t}); err != nil {\n\t\treturn err\n\t}\n\tif err := s.AddGeneratedConversionFunc((*KubeletCSRApproverControllerConfig)(nil), (*config.KubeletCSRApproverControllerConfig)(nil), func(a, b interface{}, scope conversion.Scope) error {\n\t\treturn Convert_v1alpha1_KubeletCSRApproverControllerConfig_To_config_KubeletCSRApproverControllerConfig(a.(*KubeletCSRApproverControllerConfig), b.(*config.KubeletCSRApproverControllerConfig), scope)\n\t}); err != nil {\n\t\treturn err\n\t}\n\tif err := s.AddGeneratedConversionFunc((*config.KubeletCSRApproverControllerConfig)(nil), (*KubeletCSRApproverControllerConfig)(nil), func(a, b interface{}, scope conversion.Scope) error {\n\t\treturn Convert_config_KubeletCSRApproverControllerConfig_To_v1alpha1_KubeletCSRApproverControllerConfig(a.(*config.KubeletCSRApproverControllerConfig), b.(*KubeletCSRApproverControllerConfig), scope)\n\t}); err != nil {\n\t\treturn err\n\t}\n\tif err := s.AddGeneratedConversionFunc((*KubernetesServiceHostWebhookConfig)(nil), (*config.KubernetesServiceHostWebhookConfig)(nil), func(a, b interface{}, scope conversion.Scope) error {\n\t\treturn Convert_v1alpha1_KubernetesServiceHostWebhookConfig_To_config_KubernetesServiceHostWebhookConfig(a.(*KubernetesServiceHostWebhookConfig), b.(*config.KubernetesServiceHostWebhookConfig), scope)\n\t}); err != nil {\n\t\treturn err\n\t}\n\tif err := s.AddGeneratedConversionFunc((*config.KubernetesServiceHostWebhookConfig)(nil), (*KubernetesServiceHostWebhookConfig)(nil), func(a, b interface{}, scope conversion.Scope) error {\n\t\treturn Convert_config_KubernetesServiceHostWebhookConfig_To_v1alpha1_KubernetesServiceHostWebhookConfig(a.(*config.KubernetesServiceHostWebhookConfig), b.(*KubernetesServiceHostWebhookConfig), scope)\n\t}); err != nil {\n\t\treturn err\n\t}\n\tif err := s.AddGeneratedConversionFunc((*ManagedResourceControllerConfig)(nil), (*config.ManagedResourceControllerConfig)(nil), func(a, b interface{}, scope conversion.Scope) error {\n\t\treturn Convert_v1alpha1_ManagedResourceControllerConfig_To_config_ManagedResourceControllerConfig(a.(*ManagedResourceControllerConfig), b.(*config.ManagedResourceControllerConfig), scope)\n\t}); err != nil {\n\t\treturn err\n\t}\n\tif err := s.AddGeneratedConversionFunc((*config.ManagedResourceControllerConfig)(nil), (*ManagedResourceControllerConfig)(nil), func(a, b interface{}, scope conversion.Scope) error {\n\t\treturn Convert_config_ManagedResourceControllerConfig_To_v1alpha1_ManagedResourceControllerConfig(a.(*config.ManagedResourceControllerConfig), b.(*ManagedResourceControllerConfig), scope)\n\t}); err != nil {\n\t\treturn err\n\t}\n\tif err := s.AddGeneratedConversionFunc((*NetworkPolicyControllerConfig)(nil), (*config.NetworkPolicyControllerConfig)(nil), func(a, b interface{}, scope conversion.Scope) error {\n\t\treturn Convert_v1alpha1_NetworkPolicyControllerConfig_To_config_NetworkPolicyControllerConfig(a.(*NetworkPolicyControllerConfig), b.(*config.NetworkPolicyControllerConfig), scope)\n\t}); err != nil {\n\t\treturn err\n\t}\n\tif err := s.AddGeneratedConversionFunc((*config.NetworkPolicyControllerConfig)(nil), (*NetworkPolicyControllerConfig)(nil), func(a, b interface{}, scope conversion.Scope) error {\n\t\treturn Convert_config_NetworkPolicyControllerConfig_To_v1alpha1_NetworkPolicyControllerConfig(a.(*config.NetworkPolicyControllerConfig), b.(*NetworkPolicyControllerConfig), scope)\n\t}); err != nil {\n\t\treturn err\n\t}\n\tif err := s.AddGeneratedConversionFunc((*NodeControllerConfig)(nil), (*config.NodeControllerConfig)(nil), func(a, b interface{}, scope conversion.Scope) error {\n\t\treturn Convert_v1alpha1_NodeControllerConfig_To_config_NodeControllerConfig(a.(*NodeControllerConfig), b.(*config.NodeControllerConfig), scope)\n\t}); err != nil {\n\t\treturn err\n\t}\n\tif err := s.AddGeneratedConversionFunc((*config.NodeControllerConfig)(nil), (*NodeControllerConfig)(nil), func(a, b interface{}, scope conversion.Scope) error {\n\t\treturn Convert_config_NodeControllerConfig_To_v1alpha1_NodeControllerConfig(a.(*config.NodeControllerConfig), b.(*NodeControllerConfig), scope)\n\t}); err != nil {\n\t\treturn err\n\t}\n\tif err := s.AddGeneratedConversionFunc((*PodSchedulerNameWebhookConfig)(nil), (*config.PodSchedulerNameWebhookConfig)(nil), func(a, b interface{}, scope conversion.Scope) error {\n\t\treturn Convert_v1alpha1_PodSchedulerNameWebhookConfig_To_config_PodSchedulerNameWebhookConfig(a.(*PodSchedulerNameWebhookConfig), b.(*config.PodSchedulerNameWebhookConfig), scope)\n\t}); err != nil {\n\t\treturn err\n\t}\n\tif err := s.AddGeneratedConversionFunc((*config.PodSchedulerNameWebhookConfig)(nil), (*PodSchedulerNameWebhookConfig)(nil), func(a, b interface{}, scope conversion.Scope) error {\n\t\treturn Convert_config_PodSchedulerNameWebhookConfig_To_v1alpha1_PodSchedulerNameWebhookConfig(a.(*config.PodSchedulerNameWebhookConfig), b.(*PodSchedulerNameWebhookConfig), scope)\n\t}); err != nil {\n\t\treturn err\n\t}\n\tif err := s.AddGeneratedConversionFunc((*PodTopologySpreadConstraintsWebhookConfig)(nil), (*config.PodTopologySpreadConstraintsWebhookConfig)(nil), func(a, b interface{}, scope conversion.Scope) error {\n\t\treturn Convert_v1alpha1_PodTopologySpreadConstraintsWebhookConfig_To_config_PodTopologySpreadConstraintsWebhookConfig(a.(*PodTopologySpreadConstraintsWebhookConfig), b.(*config.PodTopologySpreadConstraintsWebhookConfig), scope)\n\t}); err != nil {\n\t\treturn err\n\t}\n\tif err := s.AddGeneratedConversionFunc((*config.PodTopologySpreadConstraintsWebhookConfig)(nil), (*PodTopologySpreadConstraintsWebhookConfig)(nil), func(a, b interface{}, scope conversion.Scope) error {\n\t\treturn Convert_config_PodTopologySpreadConstraintsWebhookConfig_To_v1alpha1_PodTopologySpreadConstraintsWebhookConfig(a.(*config.PodTopologySpreadConstraintsWebhookConfig), b.(*PodTopologySpreadConstraintsWebhookConfig), scope)\n\t}); err != nil {\n\t\treturn err\n\t}\n\tif err := s.AddGeneratedConversionFunc((*ProjectedTokenMountWebhookConfig)(nil), (*config.ProjectedTokenMountWebhookConfig)(nil), func(a, b interface{}, scope conversion.Scope) error {\n\t\treturn Convert_v1alpha1_ProjectedTokenMountWebhookConfig_To_config_ProjectedTokenMountWebhookConfig(a.(*ProjectedTokenMountWebhookConfig), b.(*config.ProjectedTokenMountWebhookConfig), scope)\n\t}); err != nil {\n\t\treturn err\n\t}\n\tif err := s.AddGeneratedConversionFunc((*config.ProjectedTokenMountWebhookConfig)(nil), (*ProjectedTokenMountWebhookConfig)(nil), func(a, b interface{}, scope conversion.Scope) error {\n\t\treturn Convert_config_ProjectedTokenMountWebhookConfig_To_v1alpha1_ProjectedTokenMountWebhookConfig(a.(*config.ProjectedTokenMountWebhookConfig), b.(*ProjectedTokenMountWebhookConfig), scope)\n\t}); err != nil {\n\t\treturn err\n\t}\n\tif err := s.AddGeneratedConversionFunc((*ResourceManagerConfiguration)(nil), (*config.ResourceManagerConfiguration)(nil), func(a, b interface{}, scope conversion.Scope) error {\n\t\treturn Convert_v1alpha1_ResourceManagerConfiguration_To_config_ResourceManagerConfiguration(a.(*ResourceManagerConfiguration), b.(*config.ResourceManagerConfiguration), scope)\n\t}); err != nil {\n\t\treturn err\n\t}\n\tif err := s.AddGeneratedConversionFunc((*config.ResourceManagerConfiguration)(nil), (*ResourceManagerConfiguration)(nil), func(a, b interface{}, scope conversion.Scope) error {\n\t\treturn Convert_config_ResourceManagerConfiguration_To_v1alpha1_ResourceManagerConfiguration(a.(*config.ResourceManagerConfiguration), b.(*ResourceManagerConfiguration), scope)\n\t}); err != nil {\n\t\treturn err\n\t}\n\tif err := s.AddGeneratedConversionFunc((*ResourceManagerControllerConfiguration)(nil), (*config.ResourceManagerControllerConfiguration)(nil), func(a, b interface{}, scope conversion.Scope) error {\n\t\treturn Convert_v1alpha1_ResourceManagerControllerConfiguration_To_config_ResourceManagerControllerConfiguration(a.(*ResourceManagerControllerConfiguration), b.(*config.ResourceManagerControllerConfiguration), scope)\n\t}); err != nil {\n\t\treturn err\n\t}\n\tif err := s.AddGeneratedConversionFunc((*config.ResourceManagerControllerConfiguration)(nil), (*ResourceManagerControllerConfiguration)(nil), func(a, b interface{}, scope conversion.Scope) error {\n\t\treturn Convert_config_ResourceManagerControllerConfiguration_To_v1alpha1_ResourceManagerControllerConfiguration(a.(*config.ResourceManagerControllerConfiguration), b.(*ResourceManagerControllerConfiguration), scope)\n\t}); err != nil {\n\t\treturn err\n\t}\n\tif err := s.AddGeneratedConversionFunc((*ResourceManagerWebhookConfiguration)(nil), (*config.ResourceManagerWebhookConfiguration)(nil), func(a, b interface{}, scope conversion.Scope) error {\n\t\treturn Convert_v1alpha1_ResourceManagerWebhookConfiguration_To_config_ResourceManagerWebhookConfiguration(a.(*ResourceManagerWebhookConfiguration), b.(*config.ResourceManagerWebhookConfiguration), scope)\n\t}); err != nil {\n\t\treturn err\n\t}\n\tif err := s.AddGeneratedConversionFunc((*config.ResourceManagerWebhookConfiguration)(nil), (*ResourceManagerWebhookConfiguration)(nil), func(a, b interface{}, scope conversion.Scope) error {\n\t\treturn Convert_config_ResourceManagerWebhookConfiguration_To_v1alpha1_ResourceManagerWebhookConfiguration(a.(*config.ResourceManagerWebhookConfiguration), b.(*ResourceManagerWebhookConfiguration), scope)\n\t}); err != nil {\n\t\treturn err\n\t}\n\tif err := s.AddGeneratedConversionFunc((*SeccompProfileWebhookConfig)(nil), (*config.SeccompProfileWebhookConfig)(nil), func(a, b interface{}, scope conversion.Scope) error {\n\t\treturn Convert_v1alpha1_SeccompProfileWebhookConfig_To_config_SeccompProfileWebhookConfig(a.(*SeccompProfileWebhookConfig), b.(*config.SeccompProfileWebhookConfig), scope)\n\t}); err != nil {\n\t\treturn err\n\t}\n\tif err := s.AddGeneratedConversionFunc((*config.SeccompProfileWebhookConfig)(nil), (*SeccompProfileWebhookConfig)(nil), func(a, b interface{}, scope conversion.Scope) error {\n\t\treturn Convert_config_SeccompProfileWebhookConfig_To_v1alpha1_SeccompProfileWebhookConfig(a.(*config.SeccompProfileWebhookConfig), b.(*SeccompProfileWebhookConfig), scope)\n\t}); err != nil {\n\t\treturn err\n\t}\n\tif err := s.AddGeneratedConversionFunc((*SecretControllerConfig)(nil), (*config.SecretControllerConfig)(nil), func(a, b interface{}, scope conversion.Scope) error {\n\t\treturn Convert_v1alpha1_SecretControllerConfig_To_config_SecretControllerConfig(a.(*SecretControllerConfig), b.(*config.SecretControllerConfig), scope)\n\t}); err != nil {\n\t\treturn err\n\t}\n\tif err := s.AddGeneratedConversionFunc((*config.SecretControllerConfig)(nil), (*SecretControllerConfig)(nil), func(a, b interface{}, scope conversion.Scope) error {\n\t\treturn Convert_config_SecretControllerConfig_To_v1alpha1_SecretControllerConfig(a.(*config.SecretControllerConfig), b.(*SecretControllerConfig), scope)\n\t}); err != nil {\n\t\treturn err\n\t}\n\tif err := s.AddGeneratedConversionFunc((*Server)(nil), (*config.Server)(nil), func(a, b interface{}, scope conversion.Scope) error {\n\t\treturn Convert_v1alpha1_Server_To_config_Server(a.(*Server), b.(*config.Server), scope)\n\t}); err != nil {\n\t\treturn err\n\t}\n\tif err := s.AddGeneratedConversionFunc((*config.Server)(nil), (*Server)(nil), func(a, b interface{}, scope conversion.Scope) error {\n\t\treturn Convert_config_Server_To_v1alpha1_Server(a.(*config.Server), b.(*Server), scope)\n\t}); err != nil {\n\t\treturn err\n\t}\n\tif err := s.AddGeneratedConversionFunc((*ServerConfiguration)(nil), (*config.ServerConfiguration)(nil), func(a, b interface{}, scope conversion.Scope) error {\n\t\treturn Convert_v1alpha1_ServerConfiguration_To_config_ServerConfiguration(a.(*ServerConfiguration), b.(*config.ServerConfiguration), scope)\n\t}); err != nil {\n\t\treturn err\n\t}\n\tif err := s.AddGeneratedConversionFunc((*config.ServerConfiguration)(nil), (*ServerConfiguration)(nil), func(a, b interface{}, scope conversion.Scope) error {\n\t\treturn Convert_config_ServerConfiguration_To_v1alpha1_ServerConfiguration(a.(*config.ServerConfiguration), b.(*ServerConfiguration), scope)\n\t}); err != nil {\n\t\treturn err\n\t}\n\tif err := s.AddGeneratedConversionFunc((*SourceClientConnection)(nil), (*config.SourceClientConnection)(nil), func(a, b interface{}, scope conversion.Scope) error {\n\t\treturn Convert_v1alpha1_SourceClientConnection_To_config_SourceClientConnection(a.(*SourceClientConnection), b.(*config.SourceClientConnection), scope)\n\t}); err != nil {\n\t\treturn err\n\t}\n\tif err := s.AddGeneratedConversionFunc((*config.SourceClientConnection)(nil), (*SourceClientConnection)(nil), func(a, b interface{}, scope conversion.Scope) error {\n\t\treturn Convert_config_SourceClientConnection_To_v1alpha1_SourceClientConnection(a.(*config.SourceClientConnection), b.(*SourceClientConnection), scope)\n\t}); err != nil {\n\t\treturn err\n\t}\n\tif err := s.AddGeneratedConversionFunc((*SystemComponentsConfigWebhookConfig)(nil), (*config.SystemComponentsConfigWebhookConfig)(nil), func(a, b interface{}, scope conversion.Scope) error {\n\t\treturn Convert_v1alpha1_SystemComponentsConfigWebhookConfig_To_config_SystemComponentsConfigWebhookConfig(a.(*SystemComponentsConfigWebhookConfig), b.(*config.SystemComponentsConfigWebhookConfig), scope)\n\t}); err != nil {\n\t\treturn err\n\t}\n\tif err := s.AddGeneratedConversionFunc((*config.SystemComponentsConfigWebhookConfig)(nil), (*SystemComponentsConfigWebhookConfig)(nil), func(a, b interface{}, scope conversion.Scope) error {\n\t\treturn Convert_config_SystemComponentsConfigWebhookConfig_To_v1alpha1_SystemComponentsConfigWebhookConfig(a.(*config.SystemComponentsConfigWebhookConfig), b.(*SystemComponentsConfigWebhookConfig), scope)\n\t}); err != nil {\n\t\treturn err\n\t}\n\tif err := s.AddGeneratedConversionFunc((*TLSServer)(nil), (*config.TLSServer)(nil), func(a, b interface{}, scope conversion.Scope) error {\n\t\treturn Convert_v1alpha1_TLSServer_To_config_TLSServer(a.(*TLSServer), b.(*config.TLSServer), scope)\n\t}); err != nil {\n\t\treturn err\n\t}\n\tif err := s.AddGeneratedConversionFunc((*config.TLSServer)(nil), (*TLSServer)(nil), func(a, b interface{}, scope conversion.Scope) error {\n\t\treturn Convert_config_TLSServer_To_v1alpha1_TLSServer(a.(*config.TLSServer), b.(*TLSServer), scope)\n\t}); err != nil {\n\t\treturn err\n\t}\n\tif err := s.AddGeneratedConversionFunc((*TargetClientConnection)(nil), (*config.TargetClientConnection)(nil), func(a, b interface{}, scope conversion.Scope) error {\n\t\treturn Convert_v1alpha1_TargetClientConnection_To_config_TargetClientConnection(a.(*TargetClientConnection), b.(*config.TargetClientConnection), scope)\n\t}); err != nil {\n\t\treturn err\n\t}\n\tif err := s.AddGeneratedConversionFunc((*config.TargetClientConnection)(nil), (*TargetClientConnection)(nil), func(a, b interface{}, scope conversion.Scope) error {\n\t\treturn Convert_config_TargetClientConnection_To_v1alpha1_TargetClientConnection(a.(*config.TargetClientConnection), b.(*TargetClientConnection), scope)\n\t}); err != nil {\n\t\treturn err\n\t}\n\tif err := s.AddGeneratedConversionFunc((*TokenInvalidatorControllerConfig)(nil), (*config.TokenInvalidatorControllerConfig)(nil), func(a, b interface{}, scope conversion.Scope) error {\n\t\treturn Convert_v1alpha1_TokenInvalidatorControllerConfig_To_config_TokenInvalidatorControllerConfig(a.(*TokenInvalidatorControllerConfig), b.(*config.TokenInvalidatorControllerConfig), scope)\n\t}); err != nil {\n\t\treturn err\n\t}\n\tif err := s.AddGeneratedConversionFunc((*config.TokenInvalidatorControllerConfig)(nil), (*TokenInvalidatorControllerConfig)(nil), func(a, b interface{}, scope conversion.Scope) error {\n\t\treturn Convert_config_TokenInvalidatorControllerConfig_To_v1alpha1_TokenInvalidatorControllerConfig(a.(*config.TokenInvalidatorControllerConfig), b.(*TokenInvalidatorControllerConfig), scope)\n\t}); err != nil {\n\t\treturn err\n\t}\n\tif err := s.AddGeneratedConversionFunc((*TokenInvalidatorWebhookConfig)(nil), (*config.TokenInvalidatorWebhookConfig)(nil), func(a, b interface{}, scope conversion.Scope) error {\n\t\treturn Convert_v1alpha1_TokenInvalidatorWebhookConfig_To_config_TokenInvalidatorWebhookConfig(a.(*TokenInvalidatorWebhookConfig), b.(*config.TokenInvalidatorWebhookConfig), scope)\n\t}); err != nil {\n\t\treturn err\n\t}\n\tif err := s.AddGeneratedConversionFunc((*config.TokenInvalidatorWebhookConfig)(nil), (*TokenInvalidatorWebhookConfig)(nil), func(a, b interface{}, scope conversion.Scope) error {\n\t\treturn Convert_config_TokenInvalidatorWebhookConfig_To_v1alpha1_TokenInvalidatorWebhookConfig(a.(*config.TokenInvalidatorWebhookConfig), b.(*TokenInvalidatorWebhookConfig), scope)\n\t}); err != nil {\n\t\treturn err\n\t}\n\tif err := s.AddGeneratedConversionFunc((*TokenRequestorControllerConfig)(nil), (*config.TokenRequestorControllerConfig)(nil), func(a, b interface{}, scope conversion.Scope) error {\n\t\treturn Convert_v1alpha1_TokenRequestorControllerConfig_To_config_TokenRequestorControllerConfig(a.(*TokenRequestorControllerConfig), b.(*config.TokenRequestorControllerConfig), scope)\n\t}); err != nil {\n\t\treturn err\n\t}\n\tif err := s.AddGeneratedConversionFunc((*config.TokenRequestorControllerConfig)(nil), (*TokenRequestorControllerConfig)(nil), func(a, b interface{}, scope conversion.Scope) error {\n\t\treturn Convert_config_TokenRequestorControllerConfig_To_v1alpha1_TokenRequestorControllerConfig(a.(*config.TokenRequestorControllerConfig), b.(*TokenRequestorControllerConfig), scope)\n\t}); err != nil {\n\t\treturn err\n\t}\n\treturn nil\n}", "title": "" }, { "docid": "8fc5b6c381e950ca9146b76760d44598", "score": "0.73342705", "text": "func RegisterConversions(s *runtime.Scheme) error {\n\tif err := s.AddGeneratedConversionFunc((*v1alpha1.GroupResource)(nil), (*v1.GroupResource)(nil), func(a, b interface{}, scope conversion.Scope) error {\n\t\treturn Convert_v1alpha1_GroupResource_To_v1_GroupResource(a.(*v1alpha1.GroupResource), b.(*v1.GroupResource), scope)\n\t}); err != nil {\n\t\treturn err\n\t}\n\tif err := s.AddGeneratedConversionFunc((*v1.GroupResource)(nil), (*v1alpha1.GroupResource)(nil), func(a, b interface{}, scope conversion.Scope) error {\n\t\treturn Convert_v1_GroupResource_To_v1alpha1_GroupResource(a.(*v1.GroupResource), b.(*v1alpha1.GroupResource), scope)\n\t}); err != nil {\n\t\treturn err\n\t}\n\tif err := s.AddConversionFunc((*config.NamespaceControllerConfiguration)(nil), (*v1alpha1.NamespaceControllerConfiguration)(nil), func(a, b interface{}, scope conversion.Scope) error {\n\t\treturn Convert_config_NamespaceControllerConfiguration_To_v1alpha1_NamespaceControllerConfiguration(a.(*config.NamespaceControllerConfiguration), b.(*v1alpha1.NamespaceControllerConfiguration), scope)\n\t}); err != nil {\n\t\treturn err\n\t}\n\tif err := s.AddConversionFunc((*v1alpha1.NamespaceControllerConfiguration)(nil), (*config.NamespaceControllerConfiguration)(nil), func(a, b interface{}, scope conversion.Scope) error {\n\t\treturn Convert_v1alpha1_NamespaceControllerConfiguration_To_config_NamespaceControllerConfiguration(a.(*v1alpha1.NamespaceControllerConfiguration), b.(*config.NamespaceControllerConfiguration), scope)\n\t}); err != nil {\n\t\treturn err\n\t}\n\treturn nil\n}", "title": "" }, { "docid": "9b72825f300c6523aec9d1377dd61601", "score": "0.7329006", "text": "func RegisterConversions(scheme *runtime.Scheme) error {\n\treturn scheme.AddGeneratedConversionFuncs(\n\t\tConvert_v1_APIService_To_apiregistration_APIService,\n\t\tConvert_apiregistration_APIService_To_v1_APIService,\n\t\tConvert_v1_APIServiceCondition_To_apiregistration_APIServiceCondition,\n\t\tConvert_apiregistration_APIServiceCondition_To_v1_APIServiceCondition,\n\t\tConvert_v1_APIServiceList_To_apiregistration_APIServiceList,\n\t\tConvert_apiregistration_APIServiceList_To_v1_APIServiceList,\n\t\tConvert_v1_APIServiceSpec_To_apiregistration_APIServiceSpec,\n\t\tConvert_apiregistration_APIServiceSpec_To_v1_APIServiceSpec,\n\t\tConvert_v1_APIServiceStatus_To_apiregistration_APIServiceStatus,\n\t\tConvert_apiregistration_APIServiceStatus_To_v1_APIServiceStatus,\n\t\tConvert_v1_ServiceReference_To_apiregistration_ServiceReference,\n\t\tConvert_apiregistration_ServiceReference_To_v1_ServiceReference,\n\t)\n}", "title": "" }, { "docid": "958501483ce82fa60f247c87a4f7c6d2", "score": "0.7306412", "text": "func RegisterConversions(s *runtime.Scheme) error {\n\tif err := s.AddGeneratedConversionFunc((*Bastion)(nil), (*v1alpha7.Bastion)(nil), func(a, b interface{}, scope conversion.Scope) error {\n\t\treturn Convert_v1alpha3_Bastion_To_v1alpha7_Bastion(a.(*Bastion), b.(*v1alpha7.Bastion), scope)\n\t}); err != nil {\n\t\treturn err\n\t}\n\tif err := s.AddGeneratedConversionFunc((*v1alpha7.Bastion)(nil), (*Bastion)(nil), func(a, b interface{}, scope conversion.Scope) error {\n\t\treturn Convert_v1alpha7_Bastion_To_v1alpha3_Bastion(a.(*v1alpha7.Bastion), b.(*Bastion), scope)\n\t}); err != nil {\n\t\treturn err\n\t}\n\tif err := s.AddGeneratedConversionFunc((*ExternalRouterIPParam)(nil), (*v1alpha7.ExternalRouterIPParam)(nil), func(a, b interface{}, scope conversion.Scope) error {\n\t\treturn Convert_v1alpha3_ExternalRouterIPParam_To_v1alpha7_ExternalRouterIPParam(a.(*ExternalRouterIPParam), b.(*v1alpha7.ExternalRouterIPParam), scope)\n\t}); err != nil {\n\t\treturn err\n\t}\n\tif err := s.AddGeneratedConversionFunc((*v1alpha7.ExternalRouterIPParam)(nil), (*ExternalRouterIPParam)(nil), func(a, b interface{}, scope conversion.Scope) error {\n\t\treturn Convert_v1alpha7_ExternalRouterIPParam_To_v1alpha3_ExternalRouterIPParam(a.(*v1alpha7.ExternalRouterIPParam), b.(*ExternalRouterIPParam), scope)\n\t}); err != nil {\n\t\treturn err\n\t}\n\tif err := s.AddGeneratedConversionFunc((*LoadBalancer)(nil), (*v1alpha7.LoadBalancer)(nil), func(a, b interface{}, scope conversion.Scope) error {\n\t\treturn Convert_v1alpha3_LoadBalancer_To_v1alpha7_LoadBalancer(a.(*LoadBalancer), b.(*v1alpha7.LoadBalancer), scope)\n\t}); err != nil {\n\t\treturn err\n\t}\n\tif err := s.AddGeneratedConversionFunc((*Network)(nil), (*v1alpha7.Network)(nil), func(a, b interface{}, scope conversion.Scope) error {\n\t\treturn Convert_v1alpha3_Network_To_v1alpha7_Network(a.(*Network), b.(*v1alpha7.Network), scope)\n\t}); err != nil {\n\t\treturn err\n\t}\n\tif err := s.AddGeneratedConversionFunc((*NetworkParam)(nil), (*v1alpha7.NetworkParam)(nil), func(a, b interface{}, scope conversion.Scope) error {\n\t\treturn Convert_v1alpha3_NetworkParam_To_v1alpha7_NetworkParam(a.(*NetworkParam), b.(*v1alpha7.NetworkParam), scope)\n\t}); err != nil {\n\t\treturn err\n\t}\n\tif err := s.AddGeneratedConversionFunc((*v1alpha7.NetworkParam)(nil), (*NetworkParam)(nil), func(a, b interface{}, scope conversion.Scope) error {\n\t\treturn Convert_v1alpha7_NetworkParam_To_v1alpha3_NetworkParam(a.(*v1alpha7.NetworkParam), b.(*NetworkParam), scope)\n\t}); err != nil {\n\t\treturn err\n\t}\n\tif err := s.AddGeneratedConversionFunc((*OpenStackCluster)(nil), (*v1alpha7.OpenStackCluster)(nil), func(a, b interface{}, scope conversion.Scope) error {\n\t\treturn Convert_v1alpha3_OpenStackCluster_To_v1alpha7_OpenStackCluster(a.(*OpenStackCluster), b.(*v1alpha7.OpenStackCluster), scope)\n\t}); err != nil {\n\t\treturn err\n\t}\n\tif err := s.AddGeneratedConversionFunc((*v1alpha7.OpenStackCluster)(nil), (*OpenStackCluster)(nil), func(a, b interface{}, scope conversion.Scope) error {\n\t\treturn Convert_v1alpha7_OpenStackCluster_To_v1alpha3_OpenStackCluster(a.(*v1alpha7.OpenStackCluster), b.(*OpenStackCluster), scope)\n\t}); err != nil {\n\t\treturn err\n\t}\n\tif err := s.AddGeneratedConversionFunc((*OpenStackClusterList)(nil), (*v1alpha7.OpenStackClusterList)(nil), func(a, b interface{}, scope conversion.Scope) error {\n\t\treturn Convert_v1alpha3_OpenStackClusterList_To_v1alpha7_OpenStackClusterList(a.(*OpenStackClusterList), b.(*v1alpha7.OpenStackClusterList), scope)\n\t}); err != nil {\n\t\treturn err\n\t}\n\tif err := s.AddGeneratedConversionFunc((*v1alpha7.OpenStackClusterList)(nil), (*OpenStackClusterList)(nil), func(a, b interface{}, scope conversion.Scope) error {\n\t\treturn Convert_v1alpha7_OpenStackClusterList_To_v1alpha3_OpenStackClusterList(a.(*v1alpha7.OpenStackClusterList), b.(*OpenStackClusterList), scope)\n\t}); err != nil {\n\t\treturn err\n\t}\n\tif err := s.AddGeneratedConversionFunc((*OpenStackClusterStatus)(nil), (*v1alpha7.OpenStackClusterStatus)(nil), func(a, b interface{}, scope conversion.Scope) error {\n\t\treturn Convert_v1alpha3_OpenStackClusterStatus_To_v1alpha7_OpenStackClusterStatus(a.(*OpenStackClusterStatus), b.(*v1alpha7.OpenStackClusterStatus), scope)\n\t}); err != nil {\n\t\treturn err\n\t}\n\tif err := s.AddGeneratedConversionFunc((*OpenStackMachine)(nil), (*v1alpha7.OpenStackMachine)(nil), func(a, b interface{}, scope conversion.Scope) error {\n\t\treturn Convert_v1alpha3_OpenStackMachine_To_v1alpha7_OpenStackMachine(a.(*OpenStackMachine), b.(*v1alpha7.OpenStackMachine), scope)\n\t}); err != nil {\n\t\treturn err\n\t}\n\tif err := s.AddGeneratedConversionFunc((*v1alpha7.OpenStackMachine)(nil), (*OpenStackMachine)(nil), func(a, b interface{}, scope conversion.Scope) error {\n\t\treturn Convert_v1alpha7_OpenStackMachine_To_v1alpha3_OpenStackMachine(a.(*v1alpha7.OpenStackMachine), b.(*OpenStackMachine), scope)\n\t}); err != nil {\n\t\treturn err\n\t}\n\tif err := s.AddGeneratedConversionFunc((*OpenStackMachineList)(nil), (*v1alpha7.OpenStackMachineList)(nil), func(a, b interface{}, scope conversion.Scope) error {\n\t\treturn Convert_v1alpha3_OpenStackMachineList_To_v1alpha7_OpenStackMachineList(a.(*OpenStackMachineList), b.(*v1alpha7.OpenStackMachineList), scope)\n\t}); err != nil {\n\t\treturn err\n\t}\n\tif err := s.AddGeneratedConversionFunc((*v1alpha7.OpenStackMachineList)(nil), (*OpenStackMachineList)(nil), func(a, b interface{}, scope conversion.Scope) error {\n\t\treturn Convert_v1alpha7_OpenStackMachineList_To_v1alpha3_OpenStackMachineList(a.(*v1alpha7.OpenStackMachineList), b.(*OpenStackMachineList), scope)\n\t}); err != nil {\n\t\treturn err\n\t}\n\tif err := s.AddGeneratedConversionFunc((*OpenStackMachineStatus)(nil), (*v1alpha7.OpenStackMachineStatus)(nil), func(a, b interface{}, scope conversion.Scope) error {\n\t\treturn Convert_v1alpha3_OpenStackMachineStatus_To_v1alpha7_OpenStackMachineStatus(a.(*OpenStackMachineStatus), b.(*v1alpha7.OpenStackMachineStatus), scope)\n\t}); err != nil {\n\t\treturn err\n\t}\n\tif err := s.AddGeneratedConversionFunc((*v1alpha7.OpenStackMachineStatus)(nil), (*OpenStackMachineStatus)(nil), func(a, b interface{}, scope conversion.Scope) error {\n\t\treturn Convert_v1alpha7_OpenStackMachineStatus_To_v1alpha3_OpenStackMachineStatus(a.(*v1alpha7.OpenStackMachineStatus), b.(*OpenStackMachineStatus), scope)\n\t}); err != nil {\n\t\treturn err\n\t}\n\tif err := s.AddGeneratedConversionFunc((*OpenStackMachineTemplate)(nil), (*v1alpha7.OpenStackMachineTemplate)(nil), func(a, b interface{}, scope conversion.Scope) error {\n\t\treturn Convert_v1alpha3_OpenStackMachineTemplate_To_v1alpha7_OpenStackMachineTemplate(a.(*OpenStackMachineTemplate), b.(*v1alpha7.OpenStackMachineTemplate), scope)\n\t}); err != nil {\n\t\treturn err\n\t}\n\tif err := s.AddGeneratedConversionFunc((*v1alpha7.OpenStackMachineTemplate)(nil), (*OpenStackMachineTemplate)(nil), func(a, b interface{}, scope conversion.Scope) error {\n\t\treturn Convert_v1alpha7_OpenStackMachineTemplate_To_v1alpha3_OpenStackMachineTemplate(a.(*v1alpha7.OpenStackMachineTemplate), b.(*OpenStackMachineTemplate), scope)\n\t}); err != nil {\n\t\treturn err\n\t}\n\tif err := s.AddGeneratedConversionFunc((*OpenStackMachineTemplateList)(nil), (*v1alpha7.OpenStackMachineTemplateList)(nil), func(a, b interface{}, scope conversion.Scope) error {\n\t\treturn Convert_v1alpha3_OpenStackMachineTemplateList_To_v1alpha7_OpenStackMachineTemplateList(a.(*OpenStackMachineTemplateList), b.(*v1alpha7.OpenStackMachineTemplateList), scope)\n\t}); err != nil {\n\t\treturn err\n\t}\n\tif err := s.AddGeneratedConversionFunc((*v1alpha7.OpenStackMachineTemplateList)(nil), (*OpenStackMachineTemplateList)(nil), func(a, b interface{}, scope conversion.Scope) error {\n\t\treturn Convert_v1alpha7_OpenStackMachineTemplateList_To_v1alpha3_OpenStackMachineTemplateList(a.(*v1alpha7.OpenStackMachineTemplateList), b.(*OpenStackMachineTemplateList), scope)\n\t}); err != nil {\n\t\treturn err\n\t}\n\tif err := s.AddGeneratedConversionFunc((*OpenStackMachineTemplateResource)(nil), (*v1alpha7.OpenStackMachineTemplateResource)(nil), func(a, b interface{}, scope conversion.Scope) error {\n\t\treturn Convert_v1alpha3_OpenStackMachineTemplateResource_To_v1alpha7_OpenStackMachineTemplateResource(a.(*OpenStackMachineTemplateResource), b.(*v1alpha7.OpenStackMachineTemplateResource), scope)\n\t}); err != nil {\n\t\treturn err\n\t}\n\tif err := s.AddGeneratedConversionFunc((*v1alpha7.OpenStackMachineTemplateResource)(nil), (*OpenStackMachineTemplateResource)(nil), func(a, b interface{}, scope conversion.Scope) error {\n\t\treturn Convert_v1alpha7_OpenStackMachineTemplateResource_To_v1alpha3_OpenStackMachineTemplateResource(a.(*v1alpha7.OpenStackMachineTemplateResource), b.(*OpenStackMachineTemplateResource), scope)\n\t}); err != nil {\n\t\treturn err\n\t}\n\tif err := s.AddGeneratedConversionFunc((*OpenStackMachineTemplateSpec)(nil), (*v1alpha7.OpenStackMachineTemplateSpec)(nil), func(a, b interface{}, scope conversion.Scope) error {\n\t\treturn Convert_v1alpha3_OpenStackMachineTemplateSpec_To_v1alpha7_OpenStackMachineTemplateSpec(a.(*OpenStackMachineTemplateSpec), b.(*v1alpha7.OpenStackMachineTemplateSpec), scope)\n\t}); err != nil {\n\t\treturn err\n\t}\n\tif err := s.AddGeneratedConversionFunc((*v1alpha7.OpenStackMachineTemplateSpec)(nil), (*OpenStackMachineTemplateSpec)(nil), func(a, b interface{}, scope conversion.Scope) error {\n\t\treturn Convert_v1alpha7_OpenStackMachineTemplateSpec_To_v1alpha3_OpenStackMachineTemplateSpec(a.(*v1alpha7.OpenStackMachineTemplateSpec), b.(*OpenStackMachineTemplateSpec), scope)\n\t}); err != nil {\n\t\treturn err\n\t}\n\tif err := s.AddGeneratedConversionFunc((*Router)(nil), (*v1alpha7.Router)(nil), func(a, b interface{}, scope conversion.Scope) error {\n\t\treturn Convert_v1alpha3_Router_To_v1alpha7_Router(a.(*Router), b.(*v1alpha7.Router), scope)\n\t}); err != nil {\n\t\treturn err\n\t}\n\tif err := s.AddGeneratedConversionFunc((*SecurityGroup)(nil), (*v1alpha7.SecurityGroup)(nil), func(a, b interface{}, scope conversion.Scope) error {\n\t\treturn Convert_v1alpha3_SecurityGroup_To_v1alpha7_SecurityGroup(a.(*SecurityGroup), b.(*v1alpha7.SecurityGroup), scope)\n\t}); err != nil {\n\t\treturn err\n\t}\n\tif err := s.AddGeneratedConversionFunc((*v1alpha7.SecurityGroup)(nil), (*SecurityGroup)(nil), func(a, b interface{}, scope conversion.Scope) error {\n\t\treturn Convert_v1alpha7_SecurityGroup_To_v1alpha3_SecurityGroup(a.(*v1alpha7.SecurityGroup), b.(*SecurityGroup), scope)\n\t}); err != nil {\n\t\treturn err\n\t}\n\tif err := s.AddGeneratedConversionFunc((*SecurityGroupFilter)(nil), (*v1alpha7.SecurityGroupFilter)(nil), func(a, b interface{}, scope conversion.Scope) error {\n\t\treturn Convert_v1alpha3_SecurityGroupFilter_To_v1alpha7_SecurityGroupFilter(a.(*SecurityGroupFilter), b.(*v1alpha7.SecurityGroupFilter), scope)\n\t}); err != nil {\n\t\treturn err\n\t}\n\tif err := s.AddGeneratedConversionFunc((*v1alpha7.SecurityGroupFilter)(nil), (*SecurityGroupFilter)(nil), func(a, b interface{}, scope conversion.Scope) error {\n\t\treturn Convert_v1alpha7_SecurityGroupFilter_To_v1alpha3_SecurityGroupFilter(a.(*v1alpha7.SecurityGroupFilter), b.(*SecurityGroupFilter), scope)\n\t}); err != nil {\n\t\treturn err\n\t}\n\tif err := s.AddGeneratedConversionFunc((*SecurityGroupParam)(nil), (*v1alpha7.SecurityGroupParam)(nil), func(a, b interface{}, scope conversion.Scope) error {\n\t\treturn Convert_v1alpha3_SecurityGroupParam_To_v1alpha7_SecurityGroupParam(a.(*SecurityGroupParam), b.(*v1alpha7.SecurityGroupParam), scope)\n\t}); err != nil {\n\t\treturn err\n\t}\n\tif err := s.AddGeneratedConversionFunc((*v1alpha7.SecurityGroupParam)(nil), (*SecurityGroupParam)(nil), func(a, b interface{}, scope conversion.Scope) error {\n\t\treturn Convert_v1alpha7_SecurityGroupParam_To_v1alpha3_SecurityGroupParam(a.(*v1alpha7.SecurityGroupParam), b.(*SecurityGroupParam), scope)\n\t}); err != nil {\n\t\treturn err\n\t}\n\tif err := s.AddGeneratedConversionFunc((*SecurityGroupRule)(nil), (*v1alpha7.SecurityGroupRule)(nil), func(a, b interface{}, scope conversion.Scope) error {\n\t\treturn Convert_v1alpha3_SecurityGroupRule_To_v1alpha7_SecurityGroupRule(a.(*SecurityGroupRule), b.(*v1alpha7.SecurityGroupRule), scope)\n\t}); err != nil {\n\t\treturn err\n\t}\n\tif err := s.AddGeneratedConversionFunc((*v1alpha7.SecurityGroupRule)(nil), (*SecurityGroupRule)(nil), func(a, b interface{}, scope conversion.Scope) error {\n\t\treturn Convert_v1alpha7_SecurityGroupRule_To_v1alpha3_SecurityGroupRule(a.(*v1alpha7.SecurityGroupRule), b.(*SecurityGroupRule), scope)\n\t}); err != nil {\n\t\treturn err\n\t}\n\tif err := s.AddGeneratedConversionFunc((*Subnet)(nil), (*v1alpha7.Subnet)(nil), func(a, b interface{}, scope conversion.Scope) error {\n\t\treturn Convert_v1alpha3_Subnet_To_v1alpha7_Subnet(a.(*Subnet), b.(*v1alpha7.Subnet), scope)\n\t}); err != nil {\n\t\treturn err\n\t}\n\tif err := s.AddGeneratedConversionFunc((*v1alpha7.Subnet)(nil), (*Subnet)(nil), func(a, b interface{}, scope conversion.Scope) error {\n\t\treturn Convert_v1alpha7_Subnet_To_v1alpha3_Subnet(a.(*v1alpha7.Subnet), b.(*Subnet), scope)\n\t}); err != nil {\n\t\treturn err\n\t}\n\tif err := s.AddGeneratedConversionFunc((*SubnetParam)(nil), (*v1alpha7.SubnetParam)(nil), func(a, b interface{}, scope conversion.Scope) error {\n\t\treturn Convert_v1alpha3_SubnetParam_To_v1alpha7_SubnetParam(a.(*SubnetParam), b.(*v1alpha7.SubnetParam), scope)\n\t}); err != nil {\n\t\treturn err\n\t}\n\tif err := s.AddGeneratedConversionFunc((*v1alpha7.SubnetParam)(nil), (*SubnetParam)(nil), func(a, b interface{}, scope conversion.Scope) error {\n\t\treturn Convert_v1alpha7_SubnetParam_To_v1alpha3_SubnetParam(a.(*v1alpha7.SubnetParam), b.(*SubnetParam), scope)\n\t}); err != nil {\n\t\treturn err\n\t}\n\tif err := s.AddConversionFunc((*[]Network)(nil), (*[]v1alpha7.Network)(nil), func(a, b interface{}, scope conversion.Scope) error {\n\t\treturn Convert_Slice_v1alpha3_Network_To_Slice_v1alpha7_Network(a.(*[]Network), b.(*[]v1alpha7.Network), scope)\n\t}); err != nil {\n\t\treturn err\n\t}\n\tif err := s.AddConversionFunc((*[]v1alpha7.Network)(nil), (*[]Network)(nil), func(a, b interface{}, scope conversion.Scope) error {\n\t\treturn Convert_Slice_v1alpha7_Network_To_Slice_v1alpha3_Network(a.(*[]v1alpha7.Network), b.(*[]Network), scope)\n\t}); err != nil {\n\t\treturn err\n\t}\n\tif err := s.AddConversionFunc((*apiv1alpha3.APIEndpoint)(nil), (*v1beta1.APIEndpoint)(nil), func(a, b interface{}, scope conversion.Scope) error {\n\t\treturn Convert_v1alpha3_APIEndpoint_To_v1beta1_APIEndpoint(a.(*apiv1alpha3.APIEndpoint), b.(*v1beta1.APIEndpoint), scope)\n\t}); err != nil {\n\t\treturn err\n\t}\n\tif err := s.AddConversionFunc((*Filter)(nil), (*v1alpha7.NetworkFilter)(nil), func(a, b interface{}, scope conversion.Scope) error {\n\t\treturn Convert_v1alpha3_Filter_To_v1alpha7_NetworkFilter(a.(*Filter), b.(*v1alpha7.NetworkFilter), scope)\n\t}); err != nil {\n\t\treturn err\n\t}\n\tif err := s.AddConversionFunc((*Instance)(nil), (*v1alpha7.Instance)(nil), func(a, b interface{}, scope conversion.Scope) error {\n\t\treturn Convert_v1alpha3_Instance_To_v1alpha7_Instance(a.(*Instance), b.(*v1alpha7.Instance), scope)\n\t}); err != nil {\n\t\treturn err\n\t}\n\tif err := s.AddConversionFunc((*OpenStackClusterSpec)(nil), (*v1alpha7.OpenStackClusterSpec)(nil), func(a, b interface{}, scope conversion.Scope) error {\n\t\treturn Convert_v1alpha3_OpenStackClusterSpec_To_v1alpha7_OpenStackClusterSpec(a.(*OpenStackClusterSpec), b.(*v1alpha7.OpenStackClusterSpec), scope)\n\t}); err != nil {\n\t\treturn err\n\t}\n\tif err := s.AddConversionFunc((*OpenStackMachineSpec)(nil), (*v1alpha7.OpenStackMachineSpec)(nil), func(a, b interface{}, scope conversion.Scope) error {\n\t\treturn Convert_v1alpha3_OpenStackMachineSpec_To_v1alpha7_OpenStackMachineSpec(a.(*OpenStackMachineSpec), b.(*v1alpha7.OpenStackMachineSpec), scope)\n\t}); err != nil {\n\t\treturn err\n\t}\n\tif err := s.AddConversionFunc((*RootVolume)(nil), (*v1alpha7.RootVolume)(nil), func(a, b interface{}, scope conversion.Scope) error {\n\t\treturn Convert_v1alpha3_RootVolume_To_v1alpha7_RootVolume(a.(*RootVolume), b.(*v1alpha7.RootVolume), scope)\n\t}); err != nil {\n\t\treturn err\n\t}\n\tif err := s.AddConversionFunc((*SubnetFilter)(nil), (*v1alpha7.SubnetFilter)(nil), func(a, b interface{}, scope conversion.Scope) error {\n\t\treturn Convert_v1alpha3_SubnetFilter_To_v1alpha7_SubnetFilter(a.(*SubnetFilter), b.(*v1alpha7.SubnetFilter), scope)\n\t}); err != nil {\n\t\treturn err\n\t}\n\tif err := s.AddConversionFunc((*v1alpha7.Instance)(nil), (*Instance)(nil), func(a, b interface{}, scope conversion.Scope) error {\n\t\treturn Convert_v1alpha7_Instance_To_v1alpha3_Instance(a.(*v1alpha7.Instance), b.(*Instance), scope)\n\t}); err != nil {\n\t\treturn err\n\t}\n\tif err := s.AddConversionFunc((*v1alpha7.LoadBalancer)(nil), (*LoadBalancer)(nil), func(a, b interface{}, scope conversion.Scope) error {\n\t\treturn Convert_v1alpha7_LoadBalancer_To_v1alpha3_LoadBalancer(a.(*v1alpha7.LoadBalancer), b.(*LoadBalancer), scope)\n\t}); err != nil {\n\t\treturn err\n\t}\n\tif err := s.AddConversionFunc((*v1alpha7.NetworkFilter)(nil), (*Filter)(nil), func(a, b interface{}, scope conversion.Scope) error {\n\t\treturn Convert_v1alpha7_NetworkFilter_To_v1alpha3_Filter(a.(*v1alpha7.NetworkFilter), b.(*Filter), scope)\n\t}); err != nil {\n\t\treturn err\n\t}\n\tif err := s.AddConversionFunc((*v1alpha7.Network)(nil), (*Network)(nil), func(a, b interface{}, scope conversion.Scope) error {\n\t\treturn Convert_v1alpha7_Network_To_v1alpha3_Network(a.(*v1alpha7.Network), b.(*Network), scope)\n\t}); err != nil {\n\t\treturn err\n\t}\n\tif err := s.AddConversionFunc((*v1alpha7.OpenStackClusterSpec)(nil), (*OpenStackClusterSpec)(nil), func(a, b interface{}, scope conversion.Scope) error {\n\t\treturn Convert_v1alpha7_OpenStackClusterSpec_To_v1alpha3_OpenStackClusterSpec(a.(*v1alpha7.OpenStackClusterSpec), b.(*OpenStackClusterSpec), scope)\n\t}); err != nil {\n\t\treturn err\n\t}\n\tif err := s.AddConversionFunc((*v1alpha7.OpenStackClusterStatus)(nil), (*OpenStackClusterStatus)(nil), func(a, b interface{}, scope conversion.Scope) error {\n\t\treturn Convert_v1alpha7_OpenStackClusterStatus_To_v1alpha3_OpenStackClusterStatus(a.(*v1alpha7.OpenStackClusterStatus), b.(*OpenStackClusterStatus), scope)\n\t}); err != nil {\n\t\treturn err\n\t}\n\tif err := s.AddConversionFunc((*v1alpha7.OpenStackMachineSpec)(nil), (*OpenStackMachineSpec)(nil), func(a, b interface{}, scope conversion.Scope) error {\n\t\treturn Convert_v1alpha7_OpenStackMachineSpec_To_v1alpha3_OpenStackMachineSpec(a.(*v1alpha7.OpenStackMachineSpec), b.(*OpenStackMachineSpec), scope)\n\t}); err != nil {\n\t\treturn err\n\t}\n\tif err := s.AddConversionFunc((*v1alpha7.RootVolume)(nil), (*RootVolume)(nil), func(a, b interface{}, scope conversion.Scope) error {\n\t\treturn Convert_v1alpha7_RootVolume_To_v1alpha3_RootVolume(a.(*v1alpha7.RootVolume), b.(*RootVolume), scope)\n\t}); err != nil {\n\t\treturn err\n\t}\n\tif err := s.AddConversionFunc((*v1alpha7.Router)(nil), (*Router)(nil), func(a, b interface{}, scope conversion.Scope) error {\n\t\treturn Convert_v1alpha7_Router_To_v1alpha3_Router(a.(*v1alpha7.Router), b.(*Router), scope)\n\t}); err != nil {\n\t\treturn err\n\t}\n\tif err := s.AddConversionFunc((*v1alpha7.SubnetFilter)(nil), (*SubnetFilter)(nil), func(a, b interface{}, scope conversion.Scope) error {\n\t\treturn Convert_v1alpha7_SubnetFilter_To_v1alpha3_SubnetFilter(a.(*v1alpha7.SubnetFilter), b.(*SubnetFilter), scope)\n\t}); err != nil {\n\t\treturn err\n\t}\n\tif err := s.AddConversionFunc((*v1beta1.APIEndpoint)(nil), (*apiv1alpha3.APIEndpoint)(nil), func(a, b interface{}, scope conversion.Scope) error {\n\t\treturn Convert_v1beta1_APIEndpoint_To_v1alpha3_APIEndpoint(a.(*v1beta1.APIEndpoint), b.(*apiv1alpha3.APIEndpoint), scope)\n\t}); err != nil {\n\t\treturn err\n\t}\n\treturn nil\n}", "title": "" }, { "docid": "76e37f9282903446cc49c0bc8f7fd72a", "score": "0.72566944", "text": "func RegisterConversions(s *runtime.Scheme) error {\n\tif err := s.AddGeneratedConversionFunc((*Foo)(nil), (*baz.Foo)(nil), func(a, b interface{}, scope conversion.Scope) error {\n\t\treturn Convert_v1beta1_Foo_To_baz_Foo(a.(*Foo), b.(*baz.Foo), scope)\n\t}); err != nil {\n\t\treturn err\n\t}\n\tif err := s.AddGeneratedConversionFunc((*baz.Foo)(nil), (*Foo)(nil), func(a, b interface{}, scope conversion.Scope) error {\n\t\treturn Convert_baz_Foo_To_v1beta1_Foo(a.(*baz.Foo), b.(*Foo), scope)\n\t}); err != nil {\n\t\treturn err\n\t}\n\tif err := s.AddGeneratedConversionFunc((*FooBar)(nil), (*baz.FooBar)(nil), func(a, b interface{}, scope conversion.Scope) error {\n\t\treturn Convert_v1beta1_FooBar_To_baz_FooBar(a.(*FooBar), b.(*baz.FooBar), scope)\n\t}); err != nil {\n\t\treturn err\n\t}\n\tif err := s.AddGeneratedConversionFunc((*baz.FooBar)(nil), (*FooBar)(nil), func(a, b interface{}, scope conversion.Scope) error {\n\t\treturn Convert_baz_FooBar_To_v1beta1_FooBar(a.(*baz.FooBar), b.(*FooBar), scope)\n\t}); err != nil {\n\t\treturn err\n\t}\n\tif err := s.AddGeneratedConversionFunc((*FooList)(nil), (*baz.FooList)(nil), func(a, b interface{}, scope conversion.Scope) error {\n\t\treturn Convert_v1beta1_FooList_To_baz_FooList(a.(*FooList), b.(*baz.FooList), scope)\n\t}); err != nil {\n\t\treturn err\n\t}\n\tif err := s.AddGeneratedConversionFunc((*baz.FooList)(nil), (*FooList)(nil), func(a, b interface{}, scope conversion.Scope) error {\n\t\treturn Convert_baz_FooList_To_v1beta1_FooList(a.(*baz.FooList), b.(*FooList), scope)\n\t}); err != nil {\n\t\treturn err\n\t}\n\tif err := s.AddGeneratedConversionFunc((*FooSpec)(nil), (*baz.FooSpec)(nil), func(a, b interface{}, scope conversion.Scope) error {\n\t\treturn Convert_v1beta1_FooSpec_To_baz_FooSpec(a.(*FooSpec), b.(*baz.FooSpec), scope)\n\t}); err != nil {\n\t\treturn err\n\t}\n\tif err := s.AddGeneratedConversionFunc((*baz.FooSpec)(nil), (*FooSpec)(nil), func(a, b interface{}, scope conversion.Scope) error {\n\t\treturn Convert_baz_FooSpec_To_v1beta1_FooSpec(a.(*baz.FooSpec), b.(*FooSpec), scope)\n\t}); err != nil {\n\t\treturn err\n\t}\n\tif err := s.AddGeneratedConversionFunc((*FooStatus)(nil), (*baz.FooStatus)(nil), func(a, b interface{}, scope conversion.Scope) error {\n\t\treturn Convert_v1beta1_FooStatus_To_baz_FooStatus(a.(*FooStatus), b.(*baz.FooStatus), scope)\n\t}); err != nil {\n\t\treturn err\n\t}\n\tif err := s.AddGeneratedConversionFunc((*baz.FooStatus)(nil), (*FooStatus)(nil), func(a, b interface{}, scope conversion.Scope) error {\n\t\treturn Convert_baz_FooStatus_To_v1beta1_FooStatus(a.(*baz.FooStatus), b.(*FooStatus), scope)\n\t}); err != nil {\n\t\treturn err\n\t}\n\treturn nil\n}", "title": "" }, { "docid": "587bafe14461f489d56fc48bceed293d", "score": "0.7243064", "text": "func RegisterConversions(s *runtime.Scheme) error {\n\tif err := s.AddGeneratedConversionFunc((*GardenletDeployment)(nil), (*seedmanagement.GardenletDeployment)(nil), func(a, b interface{}, scope conversion.Scope) error {\n\t\treturn Convert_v1alpha1_GardenletDeployment_To_seedmanagement_GardenletDeployment(a.(*GardenletDeployment), b.(*seedmanagement.GardenletDeployment), scope)\n\t}); err != nil {\n\t\treturn err\n\t}\n\tif err := s.AddGeneratedConversionFunc((*seedmanagement.GardenletDeployment)(nil), (*GardenletDeployment)(nil), func(a, b interface{}, scope conversion.Scope) error {\n\t\treturn Convert_seedmanagement_GardenletDeployment_To_v1alpha1_GardenletDeployment(a.(*seedmanagement.GardenletDeployment), b.(*GardenletDeployment), scope)\n\t}); err != nil {\n\t\treturn err\n\t}\n\tif err := s.AddGeneratedConversionFunc((*Image)(nil), (*seedmanagement.Image)(nil), func(a, b interface{}, scope conversion.Scope) error {\n\t\treturn Convert_v1alpha1_Image_To_seedmanagement_Image(a.(*Image), b.(*seedmanagement.Image), scope)\n\t}); err != nil {\n\t\treturn err\n\t}\n\tif err := s.AddGeneratedConversionFunc((*seedmanagement.Image)(nil), (*Image)(nil), func(a, b interface{}, scope conversion.Scope) error {\n\t\treturn Convert_seedmanagement_Image_To_v1alpha1_Image(a.(*seedmanagement.Image), b.(*Image), scope)\n\t}); err != nil {\n\t\treturn err\n\t}\n\tif err := s.AddGeneratedConversionFunc((*ManagedSeed)(nil), (*seedmanagement.ManagedSeed)(nil), func(a, b interface{}, scope conversion.Scope) error {\n\t\treturn Convert_v1alpha1_ManagedSeed_To_seedmanagement_ManagedSeed(a.(*ManagedSeed), b.(*seedmanagement.ManagedSeed), scope)\n\t}); err != nil {\n\t\treturn err\n\t}\n\tif err := s.AddGeneratedConversionFunc((*seedmanagement.ManagedSeed)(nil), (*ManagedSeed)(nil), func(a, b interface{}, scope conversion.Scope) error {\n\t\treturn Convert_seedmanagement_ManagedSeed_To_v1alpha1_ManagedSeed(a.(*seedmanagement.ManagedSeed), b.(*ManagedSeed), scope)\n\t}); err != nil {\n\t\treturn err\n\t}\n\tif err := s.AddGeneratedConversionFunc((*ManagedSeedList)(nil), (*seedmanagement.ManagedSeedList)(nil), func(a, b interface{}, scope conversion.Scope) error {\n\t\treturn Convert_v1alpha1_ManagedSeedList_To_seedmanagement_ManagedSeedList(a.(*ManagedSeedList), b.(*seedmanagement.ManagedSeedList), scope)\n\t}); err != nil {\n\t\treturn err\n\t}\n\tif err := s.AddGeneratedConversionFunc((*seedmanagement.ManagedSeedList)(nil), (*ManagedSeedList)(nil), func(a, b interface{}, scope conversion.Scope) error {\n\t\treturn Convert_seedmanagement_ManagedSeedList_To_v1alpha1_ManagedSeedList(a.(*seedmanagement.ManagedSeedList), b.(*ManagedSeedList), scope)\n\t}); err != nil {\n\t\treturn err\n\t}\n\tif err := s.AddGeneratedConversionFunc((*ManagedSeedSet)(nil), (*seedmanagement.ManagedSeedSet)(nil), func(a, b interface{}, scope conversion.Scope) error {\n\t\treturn Convert_v1alpha1_ManagedSeedSet_To_seedmanagement_ManagedSeedSet(a.(*ManagedSeedSet), b.(*seedmanagement.ManagedSeedSet), scope)\n\t}); err != nil {\n\t\treturn err\n\t}\n\tif err := s.AddGeneratedConversionFunc((*seedmanagement.ManagedSeedSet)(nil), (*ManagedSeedSet)(nil), func(a, b interface{}, scope conversion.Scope) error {\n\t\treturn Convert_seedmanagement_ManagedSeedSet_To_v1alpha1_ManagedSeedSet(a.(*seedmanagement.ManagedSeedSet), b.(*ManagedSeedSet), scope)\n\t}); err != nil {\n\t\treturn err\n\t}\n\tif err := s.AddGeneratedConversionFunc((*ManagedSeedSetList)(nil), (*seedmanagement.ManagedSeedSetList)(nil), func(a, b interface{}, scope conversion.Scope) error {\n\t\treturn Convert_v1alpha1_ManagedSeedSetList_To_seedmanagement_ManagedSeedSetList(a.(*ManagedSeedSetList), b.(*seedmanagement.ManagedSeedSetList), scope)\n\t}); err != nil {\n\t\treturn err\n\t}\n\tif err := s.AddGeneratedConversionFunc((*seedmanagement.ManagedSeedSetList)(nil), (*ManagedSeedSetList)(nil), func(a, b interface{}, scope conversion.Scope) error {\n\t\treturn Convert_seedmanagement_ManagedSeedSetList_To_v1alpha1_ManagedSeedSetList(a.(*seedmanagement.ManagedSeedSetList), b.(*ManagedSeedSetList), scope)\n\t}); err != nil {\n\t\treturn err\n\t}\n\tif err := s.AddGeneratedConversionFunc((*ManagedSeedSetSpec)(nil), (*seedmanagement.ManagedSeedSetSpec)(nil), func(a, b interface{}, scope conversion.Scope) error {\n\t\treturn Convert_v1alpha1_ManagedSeedSetSpec_To_seedmanagement_ManagedSeedSetSpec(a.(*ManagedSeedSetSpec), b.(*seedmanagement.ManagedSeedSetSpec), scope)\n\t}); err != nil {\n\t\treturn err\n\t}\n\tif err := s.AddGeneratedConversionFunc((*seedmanagement.ManagedSeedSetSpec)(nil), (*ManagedSeedSetSpec)(nil), func(a, b interface{}, scope conversion.Scope) error {\n\t\treturn Convert_seedmanagement_ManagedSeedSetSpec_To_v1alpha1_ManagedSeedSetSpec(a.(*seedmanagement.ManagedSeedSetSpec), b.(*ManagedSeedSetSpec), scope)\n\t}); err != nil {\n\t\treturn err\n\t}\n\tif err := s.AddGeneratedConversionFunc((*ManagedSeedSetStatus)(nil), (*seedmanagement.ManagedSeedSetStatus)(nil), func(a, b interface{}, scope conversion.Scope) error {\n\t\treturn Convert_v1alpha1_ManagedSeedSetStatus_To_seedmanagement_ManagedSeedSetStatus(a.(*ManagedSeedSetStatus), b.(*seedmanagement.ManagedSeedSetStatus), scope)\n\t}); err != nil {\n\t\treturn err\n\t}\n\tif err := s.AddGeneratedConversionFunc((*seedmanagement.ManagedSeedSetStatus)(nil), (*ManagedSeedSetStatus)(nil), func(a, b interface{}, scope conversion.Scope) error {\n\t\treturn Convert_seedmanagement_ManagedSeedSetStatus_To_v1alpha1_ManagedSeedSetStatus(a.(*seedmanagement.ManagedSeedSetStatus), b.(*ManagedSeedSetStatus), scope)\n\t}); err != nil {\n\t\treturn err\n\t}\n\tif err := s.AddGeneratedConversionFunc((*ManagedSeedSpec)(nil), (*seedmanagement.ManagedSeedSpec)(nil), func(a, b interface{}, scope conversion.Scope) error {\n\t\treturn Convert_v1alpha1_ManagedSeedSpec_To_seedmanagement_ManagedSeedSpec(a.(*ManagedSeedSpec), b.(*seedmanagement.ManagedSeedSpec), scope)\n\t}); err != nil {\n\t\treturn err\n\t}\n\tif err := s.AddGeneratedConversionFunc((*seedmanagement.ManagedSeedSpec)(nil), (*ManagedSeedSpec)(nil), func(a, b interface{}, scope conversion.Scope) error {\n\t\treturn Convert_seedmanagement_ManagedSeedSpec_To_v1alpha1_ManagedSeedSpec(a.(*seedmanagement.ManagedSeedSpec), b.(*ManagedSeedSpec), scope)\n\t}); err != nil {\n\t\treturn err\n\t}\n\tif err := s.AddGeneratedConversionFunc((*ManagedSeedStatus)(nil), (*seedmanagement.ManagedSeedStatus)(nil), func(a, b interface{}, scope conversion.Scope) error {\n\t\treturn Convert_v1alpha1_ManagedSeedStatus_To_seedmanagement_ManagedSeedStatus(a.(*ManagedSeedStatus), b.(*seedmanagement.ManagedSeedStatus), scope)\n\t}); err != nil {\n\t\treturn err\n\t}\n\tif err := s.AddGeneratedConversionFunc((*seedmanagement.ManagedSeedStatus)(nil), (*ManagedSeedStatus)(nil), func(a, b interface{}, scope conversion.Scope) error {\n\t\treturn Convert_seedmanagement_ManagedSeedStatus_To_v1alpha1_ManagedSeedStatus(a.(*seedmanagement.ManagedSeedStatus), b.(*ManagedSeedStatus), scope)\n\t}); err != nil {\n\t\treturn err\n\t}\n\tif err := s.AddGeneratedConversionFunc((*ManagedSeedTemplate)(nil), (*seedmanagement.ManagedSeedTemplate)(nil), func(a, b interface{}, scope conversion.Scope) error {\n\t\treturn Convert_v1alpha1_ManagedSeedTemplate_To_seedmanagement_ManagedSeedTemplate(a.(*ManagedSeedTemplate), b.(*seedmanagement.ManagedSeedTemplate), scope)\n\t}); err != nil {\n\t\treturn err\n\t}\n\tif err := s.AddGeneratedConversionFunc((*seedmanagement.ManagedSeedTemplate)(nil), (*ManagedSeedTemplate)(nil), func(a, b interface{}, scope conversion.Scope) error {\n\t\treturn Convert_seedmanagement_ManagedSeedTemplate_To_v1alpha1_ManagedSeedTemplate(a.(*seedmanagement.ManagedSeedTemplate), b.(*ManagedSeedTemplate), scope)\n\t}); err != nil {\n\t\treturn err\n\t}\n\tif err := s.AddGeneratedConversionFunc((*RollingUpdateStrategy)(nil), (*seedmanagement.RollingUpdateStrategy)(nil), func(a, b interface{}, scope conversion.Scope) error {\n\t\treturn Convert_v1alpha1_RollingUpdateStrategy_To_seedmanagement_RollingUpdateStrategy(a.(*RollingUpdateStrategy), b.(*seedmanagement.RollingUpdateStrategy), scope)\n\t}); err != nil {\n\t\treturn err\n\t}\n\tif err := s.AddGeneratedConversionFunc((*seedmanagement.RollingUpdateStrategy)(nil), (*RollingUpdateStrategy)(nil), func(a, b interface{}, scope conversion.Scope) error {\n\t\treturn Convert_seedmanagement_RollingUpdateStrategy_To_v1alpha1_RollingUpdateStrategy(a.(*seedmanagement.RollingUpdateStrategy), b.(*RollingUpdateStrategy), scope)\n\t}); err != nil {\n\t\treturn err\n\t}\n\tif err := s.AddGeneratedConversionFunc((*Shoot)(nil), (*seedmanagement.Shoot)(nil), func(a, b interface{}, scope conversion.Scope) error {\n\t\treturn Convert_v1alpha1_Shoot_To_seedmanagement_Shoot(a.(*Shoot), b.(*seedmanagement.Shoot), scope)\n\t}); err != nil {\n\t\treturn err\n\t}\n\tif err := s.AddGeneratedConversionFunc((*seedmanagement.Shoot)(nil), (*Shoot)(nil), func(a, b interface{}, scope conversion.Scope) error {\n\t\treturn Convert_seedmanagement_Shoot_To_v1alpha1_Shoot(a.(*seedmanagement.Shoot), b.(*Shoot), scope)\n\t}); err != nil {\n\t\treturn err\n\t}\n\tif err := s.AddGeneratedConversionFunc((*UpdateStrategy)(nil), (*seedmanagement.UpdateStrategy)(nil), func(a, b interface{}, scope conversion.Scope) error {\n\t\treturn Convert_v1alpha1_UpdateStrategy_To_seedmanagement_UpdateStrategy(a.(*UpdateStrategy), b.(*seedmanagement.UpdateStrategy), scope)\n\t}); err != nil {\n\t\treturn err\n\t}\n\tif err := s.AddGeneratedConversionFunc((*seedmanagement.UpdateStrategy)(nil), (*UpdateStrategy)(nil), func(a, b interface{}, scope conversion.Scope) error {\n\t\treturn Convert_seedmanagement_UpdateStrategy_To_v1alpha1_UpdateStrategy(a.(*seedmanagement.UpdateStrategy), b.(*UpdateStrategy), scope)\n\t}); err != nil {\n\t\treturn err\n\t}\n\tif err := s.AddConversionFunc((*core.SeedTemplate)(nil), (*v1beta1.SeedTemplate)(nil), func(a, b interface{}, scope conversion.Scope) error {\n\t\treturn Convert_core_SeedTemplate_To_v1beta1_SeedTemplate(a.(*core.SeedTemplate), b.(*v1beta1.SeedTemplate), scope)\n\t}); err != nil {\n\t\treturn err\n\t}\n\tif err := s.AddConversionFunc((*core.ShootTemplate)(nil), (*v1beta1.ShootTemplate)(nil), func(a, b interface{}, scope conversion.Scope) error {\n\t\treturn Convert_core_ShootTemplate_To_v1beta1_ShootTemplate(a.(*core.ShootTemplate), b.(*v1beta1.ShootTemplate), scope)\n\t}); err != nil {\n\t\treturn err\n\t}\n\tif err := s.AddConversionFunc((*seedmanagement.Gardenlet)(nil), (*Gardenlet)(nil), func(a, b interface{}, scope conversion.Scope) error {\n\t\treturn Convert_seedmanagement_Gardenlet_To_v1alpha1_Gardenlet(a.(*seedmanagement.Gardenlet), b.(*Gardenlet), scope)\n\t}); err != nil {\n\t\treturn err\n\t}\n\tif err := s.AddConversionFunc((*Gardenlet)(nil), (*seedmanagement.Gardenlet)(nil), func(a, b interface{}, scope conversion.Scope) error {\n\t\treturn Convert_v1alpha1_Gardenlet_To_seedmanagement_Gardenlet(a.(*Gardenlet), b.(*seedmanagement.Gardenlet), scope)\n\t}); err != nil {\n\t\treturn err\n\t}\n\tif err := s.AddConversionFunc((*v1beta1.SeedTemplate)(nil), (*core.SeedTemplate)(nil), func(a, b interface{}, scope conversion.Scope) error {\n\t\treturn Convert_v1beta1_SeedTemplate_To_core_SeedTemplate(a.(*v1beta1.SeedTemplate), b.(*core.SeedTemplate), scope)\n\t}); err != nil {\n\t\treturn err\n\t}\n\tif err := s.AddConversionFunc((*v1beta1.ShootTemplate)(nil), (*core.ShootTemplate)(nil), func(a, b interface{}, scope conversion.Scope) error {\n\t\treturn Convert_v1beta1_ShootTemplate_To_core_ShootTemplate(a.(*v1beta1.ShootTemplate), b.(*core.ShootTemplate), scope)\n\t}); err != nil {\n\t\treturn err\n\t}\n\treturn nil\n}", "title": "" }, { "docid": "a1bc51163d6737cd892c884fb33cdbbc", "score": "0.72420126", "text": "func RegisterConversions(s *runtime.Scheme) error {\n\tif err := s.AddGeneratedConversionFunc((*DeschedulerProfile)(nil), (*config.DeschedulerProfile)(nil), func(a, b interface{}, scope conversion.Scope) error {\n\t\treturn Convert_v1alpha2_DeschedulerProfile_To_config_DeschedulerProfile(a.(*DeschedulerProfile), b.(*config.DeschedulerProfile), scope)\n\t}); err != nil {\n\t\treturn err\n\t}\n\tif err := s.AddGeneratedConversionFunc((*config.DeschedulerProfile)(nil), (*DeschedulerProfile)(nil), func(a, b interface{}, scope conversion.Scope) error {\n\t\treturn Convert_config_DeschedulerProfile_To_v1alpha2_DeschedulerProfile(a.(*config.DeschedulerProfile), b.(*DeschedulerProfile), scope)\n\t}); err != nil {\n\t\treturn err\n\t}\n\tif err := s.AddGeneratedConversionFunc((*LoadAnomalyCondition)(nil), (*config.LoadAnomalyCondition)(nil), func(a, b interface{}, scope conversion.Scope) error {\n\t\treturn Convert_v1alpha2_LoadAnomalyCondition_To_config_LoadAnomalyCondition(a.(*LoadAnomalyCondition), b.(*config.LoadAnomalyCondition), scope)\n\t}); err != nil {\n\t\treturn err\n\t}\n\tif err := s.AddGeneratedConversionFunc((*config.LoadAnomalyCondition)(nil), (*LoadAnomalyCondition)(nil), func(a, b interface{}, scope conversion.Scope) error {\n\t\treturn Convert_config_LoadAnomalyCondition_To_v1alpha2_LoadAnomalyCondition(a.(*config.LoadAnomalyCondition), b.(*LoadAnomalyCondition), scope)\n\t}); err != nil {\n\t\treturn err\n\t}\n\tif err := s.AddGeneratedConversionFunc((*LowNodeLoadArgs)(nil), (*config.LowNodeLoadArgs)(nil), func(a, b interface{}, scope conversion.Scope) error {\n\t\treturn Convert_v1alpha2_LowNodeLoadArgs_To_config_LowNodeLoadArgs(a.(*LowNodeLoadArgs), b.(*config.LowNodeLoadArgs), scope)\n\t}); err != nil {\n\t\treturn err\n\t}\n\tif err := s.AddGeneratedConversionFunc((*config.LowNodeLoadArgs)(nil), (*LowNodeLoadArgs)(nil), func(a, b interface{}, scope conversion.Scope) error {\n\t\treturn Convert_config_LowNodeLoadArgs_To_v1alpha2_LowNodeLoadArgs(a.(*config.LowNodeLoadArgs), b.(*LowNodeLoadArgs), scope)\n\t}); err != nil {\n\t\treturn err\n\t}\n\tif err := s.AddGeneratedConversionFunc((*LowNodeLoadPodSelector)(nil), (*config.LowNodeLoadPodSelector)(nil), func(a, b interface{}, scope conversion.Scope) error {\n\t\treturn Convert_v1alpha2_LowNodeLoadPodSelector_To_config_LowNodeLoadPodSelector(a.(*LowNodeLoadPodSelector), b.(*config.LowNodeLoadPodSelector), scope)\n\t}); err != nil {\n\t\treturn err\n\t}\n\tif err := s.AddGeneratedConversionFunc((*config.LowNodeLoadPodSelector)(nil), (*LowNodeLoadPodSelector)(nil), func(a, b interface{}, scope conversion.Scope) error {\n\t\treturn Convert_config_LowNodeLoadPodSelector_To_v1alpha2_LowNodeLoadPodSelector(a.(*config.LowNodeLoadPodSelector), b.(*LowNodeLoadPodSelector), scope)\n\t}); err != nil {\n\t\treturn err\n\t}\n\tif err := s.AddGeneratedConversionFunc((*MigrationControllerArgs)(nil), (*config.MigrationControllerArgs)(nil), func(a, b interface{}, scope conversion.Scope) error {\n\t\treturn Convert_v1alpha2_MigrationControllerArgs_To_config_MigrationControllerArgs(a.(*MigrationControllerArgs), b.(*config.MigrationControllerArgs), scope)\n\t}); err != nil {\n\t\treturn err\n\t}\n\tif err := s.AddGeneratedConversionFunc((*config.MigrationControllerArgs)(nil), (*MigrationControllerArgs)(nil), func(a, b interface{}, scope conversion.Scope) error {\n\t\treturn Convert_config_MigrationControllerArgs_To_v1alpha2_MigrationControllerArgs(a.(*config.MigrationControllerArgs), b.(*MigrationControllerArgs), scope)\n\t}); err != nil {\n\t\treturn err\n\t}\n\tif err := s.AddGeneratedConversionFunc((*MigrationObjectLimiter)(nil), (*config.MigrationObjectLimiter)(nil), func(a, b interface{}, scope conversion.Scope) error {\n\t\treturn Convert_v1alpha2_MigrationObjectLimiter_To_config_MigrationObjectLimiter(a.(*MigrationObjectLimiter), b.(*config.MigrationObjectLimiter), scope)\n\t}); err != nil {\n\t\treturn err\n\t}\n\tif err := s.AddGeneratedConversionFunc((*config.MigrationObjectLimiter)(nil), (*MigrationObjectLimiter)(nil), func(a, b interface{}, scope conversion.Scope) error {\n\t\treturn Convert_config_MigrationObjectLimiter_To_v1alpha2_MigrationObjectLimiter(a.(*config.MigrationObjectLimiter), b.(*MigrationObjectLimiter), scope)\n\t}); err != nil {\n\t\treturn err\n\t}\n\tif err := s.AddGeneratedConversionFunc((*Namespaces)(nil), (*config.Namespaces)(nil), func(a, b interface{}, scope conversion.Scope) error {\n\t\treturn Convert_v1alpha2_Namespaces_To_config_Namespaces(a.(*Namespaces), b.(*config.Namespaces), scope)\n\t}); err != nil {\n\t\treturn err\n\t}\n\tif err := s.AddGeneratedConversionFunc((*config.Namespaces)(nil), (*Namespaces)(nil), func(a, b interface{}, scope conversion.Scope) error {\n\t\treturn Convert_config_Namespaces_To_v1alpha2_Namespaces(a.(*config.Namespaces), b.(*Namespaces), scope)\n\t}); err != nil {\n\t\treturn err\n\t}\n\tif err := s.AddGeneratedConversionFunc((*Plugin)(nil), (*config.Plugin)(nil), func(a, b interface{}, scope conversion.Scope) error {\n\t\treturn Convert_v1alpha2_Plugin_To_config_Plugin(a.(*Plugin), b.(*config.Plugin), scope)\n\t}); err != nil {\n\t\treturn err\n\t}\n\tif err := s.AddGeneratedConversionFunc((*config.Plugin)(nil), (*Plugin)(nil), func(a, b interface{}, scope conversion.Scope) error {\n\t\treturn Convert_config_Plugin_To_v1alpha2_Plugin(a.(*config.Plugin), b.(*Plugin), scope)\n\t}); err != nil {\n\t\treturn err\n\t}\n\tif err := s.AddGeneratedConversionFunc((*PluginConfig)(nil), (*config.PluginConfig)(nil), func(a, b interface{}, scope conversion.Scope) error {\n\t\treturn Convert_v1alpha2_PluginConfig_To_config_PluginConfig(a.(*PluginConfig), b.(*config.PluginConfig), scope)\n\t}); err != nil {\n\t\treturn err\n\t}\n\tif err := s.AddGeneratedConversionFunc((*config.PluginConfig)(nil), (*PluginConfig)(nil), func(a, b interface{}, scope conversion.Scope) error {\n\t\treturn Convert_config_PluginConfig_To_v1alpha2_PluginConfig(a.(*config.PluginConfig), b.(*PluginConfig), scope)\n\t}); err != nil {\n\t\treturn err\n\t}\n\tif err := s.AddGeneratedConversionFunc((*PluginSet)(nil), (*config.PluginSet)(nil), func(a, b interface{}, scope conversion.Scope) error {\n\t\treturn Convert_v1alpha2_PluginSet_To_config_PluginSet(a.(*PluginSet), b.(*config.PluginSet), scope)\n\t}); err != nil {\n\t\treturn err\n\t}\n\tif err := s.AddGeneratedConversionFunc((*config.PluginSet)(nil), (*PluginSet)(nil), func(a, b interface{}, scope conversion.Scope) error {\n\t\treturn Convert_config_PluginSet_To_v1alpha2_PluginSet(a.(*config.PluginSet), b.(*PluginSet), scope)\n\t}); err != nil {\n\t\treturn err\n\t}\n\tif err := s.AddGeneratedConversionFunc((*Plugins)(nil), (*config.Plugins)(nil), func(a, b interface{}, scope conversion.Scope) error {\n\t\treturn Convert_v1alpha2_Plugins_To_config_Plugins(a.(*Plugins), b.(*config.Plugins), scope)\n\t}); err != nil {\n\t\treturn err\n\t}\n\tif err := s.AddGeneratedConversionFunc((*config.Plugins)(nil), (*Plugins)(nil), func(a, b interface{}, scope conversion.Scope) error {\n\t\treturn Convert_config_Plugins_To_v1alpha2_Plugins(a.(*config.Plugins), b.(*Plugins), scope)\n\t}); err != nil {\n\t\treturn err\n\t}\n\tif err := s.AddGeneratedConversionFunc((*PriorityThreshold)(nil), (*config.PriorityThreshold)(nil), func(a, b interface{}, scope conversion.Scope) error {\n\t\treturn Convert_v1alpha2_PriorityThreshold_To_config_PriorityThreshold(a.(*PriorityThreshold), b.(*config.PriorityThreshold), scope)\n\t}); err != nil {\n\t\treturn err\n\t}\n\tif err := s.AddGeneratedConversionFunc((*config.PriorityThreshold)(nil), (*PriorityThreshold)(nil), func(a, b interface{}, scope conversion.Scope) error {\n\t\treturn Convert_config_PriorityThreshold_To_v1alpha2_PriorityThreshold(a.(*config.PriorityThreshold), b.(*PriorityThreshold), scope)\n\t}); err != nil {\n\t\treturn err\n\t}\n\tif err := s.AddConversionFunc((*config.DeschedulerConfiguration)(nil), (*DeschedulerConfiguration)(nil), func(a, b interface{}, scope conversion.Scope) error {\n\t\treturn Convert_config_DeschedulerConfiguration_To_v1alpha2_DeschedulerConfiguration(a.(*config.DeschedulerConfiguration), b.(*DeschedulerConfiguration), scope)\n\t}); err != nil {\n\t\treturn err\n\t}\n\tif err := s.AddConversionFunc((*DeschedulerConfiguration)(nil), (*config.DeschedulerConfiguration)(nil), func(a, b interface{}, scope conversion.Scope) error {\n\t\treturn Convert_v1alpha2_DeschedulerConfiguration_To_config_DeschedulerConfiguration(a.(*DeschedulerConfiguration), b.(*config.DeschedulerConfiguration), scope)\n\t}); err != nil {\n\t\treturn err\n\t}\n\treturn nil\n}", "title": "" }, { "docid": "6e2ef82a85b6db536a060d8ba8910a4d", "score": "0.7218582", "text": "func RegisterConversions(s *runtime.Scheme) error {\n\tif err := s.AddGeneratedConversionFunc((*Example)(nil), (*example.Example)(nil), func(a, b interface{}, scope conversion.Scope) error {\n\t\treturn Convert_v1alpha1_Example_To_example_Example(a.(*Example), b.(*example.Example), scope)\n\t}); err != nil {\n\t\treturn err\n\t}\n\tif err := s.AddGeneratedConversionFunc((*example.Example)(nil), (*Example)(nil), func(a, b interface{}, scope conversion.Scope) error {\n\t\treturn Convert_example_Example_To_v1alpha1_Example(a.(*example.Example), b.(*Example), scope)\n\t}); err != nil {\n\t\treturn err\n\t}\n\tif err := s.AddGeneratedConversionFunc((*ExampleList)(nil), (*example.ExampleList)(nil), func(a, b interface{}, scope conversion.Scope) error {\n\t\treturn Convert_v1alpha1_ExampleList_To_example_ExampleList(a.(*ExampleList), b.(*example.ExampleList), scope)\n\t}); err != nil {\n\t\treturn err\n\t}\n\tif err := s.AddGeneratedConversionFunc((*example.ExampleList)(nil), (*ExampleList)(nil), func(a, b interface{}, scope conversion.Scope) error {\n\t\treturn Convert_example_ExampleList_To_v1alpha1_ExampleList(a.(*example.ExampleList), b.(*ExampleList), scope)\n\t}); err != nil {\n\t\treturn err\n\t}\n\tif err := s.AddConversionFunc((*example.ExampleSpec)(nil), (*ExampleSpec)(nil), func(a, b interface{}, scope conversion.Scope) error {\n\t\treturn Convert_example_ExampleSpec_To_v1alpha1_ExampleSpec(a.(*example.ExampleSpec), b.(*ExampleSpec), scope)\n\t}); err != nil {\n\t\treturn err\n\t}\n\tif err := s.AddConversionFunc((*ExampleSpec)(nil), (*example.ExampleSpec)(nil), func(a, b interface{}, scope conversion.Scope) error {\n\t\treturn Convert_v1alpha1_ExampleSpec_To_example_ExampleSpec(a.(*ExampleSpec), b.(*example.ExampleSpec), scope)\n\t}); err != nil {\n\t\treturn err\n\t}\n\treturn nil\n}", "title": "" }, { "docid": "be354dee07a99839e1577b1cc43c53ea", "score": "0.7194309", "text": "func RegisterConversions(scheme *runtime.Scheme) error {\n\treturn scheme.AddGeneratedConversionFuncs(\n\t\tConvert_v1alpha1_ClusterAlert_To_monitoring_ClusterAlert,\n\t\tConvert_monitoring_ClusterAlert_To_v1alpha1_ClusterAlert,\n\t\tConvert_v1alpha1_ClusterAlertList_To_monitoring_ClusterAlertList,\n\t\tConvert_monitoring_ClusterAlertList_To_v1alpha1_ClusterAlertList,\n\t\tConvert_v1alpha1_ClusterAlertSpec_To_monitoring_ClusterAlertSpec,\n\t\tConvert_monitoring_ClusterAlertSpec_To_v1alpha1_ClusterAlertSpec,\n\t\tConvert_v1alpha1_NodeAlert_To_monitoring_NodeAlert,\n\t\tConvert_monitoring_NodeAlert_To_v1alpha1_NodeAlert,\n\t\tConvert_v1alpha1_NodeAlertList_To_monitoring_NodeAlertList,\n\t\tConvert_monitoring_NodeAlertList_To_v1alpha1_NodeAlertList,\n\t\tConvert_v1alpha1_NodeAlertSpec_To_monitoring_NodeAlertSpec,\n\t\tConvert_monitoring_NodeAlertSpec_To_v1alpha1_NodeAlertSpec,\n\t\tConvert_v1alpha1_PodAlert_To_monitoring_PodAlert,\n\t\tConvert_monitoring_PodAlert_To_v1alpha1_PodAlert,\n\t\tConvert_v1alpha1_PodAlertList_To_monitoring_PodAlertList,\n\t\tConvert_monitoring_PodAlertList_To_v1alpha1_PodAlertList,\n\t\tConvert_v1alpha1_PodAlertSpec_To_monitoring_PodAlertSpec,\n\t\tConvert_monitoring_PodAlertSpec_To_v1alpha1_PodAlertSpec,\n\t\tConvert_v1alpha1_Receiver_To_monitoring_Receiver,\n\t\tConvert_monitoring_Receiver_To_v1alpha1_Receiver,\n\t)\n}", "title": "" }, { "docid": "8c026e54c6ea3692202b95edffba94d1", "score": "0.7190011", "text": "func RegisterConversions(scheme *runtime.Scheme) error {\n\treturn scheme.AddGeneratedConversionFuncs(\n\t\tConvert_v1_Batch_To_helium_Batch,\n\t\tConvert_helium_Batch_To_v1_Batch,\n\t\tConvert_v1_BatchList_To_helium_BatchList,\n\t\tConvert_helium_BatchList_To_v1_BatchList,\n\t\tConvert_v1_ConfigSpec_To_helium_ConfigSpec,\n\t\tConvert_helium_ConfigSpec_To_v1_ConfigSpec,\n\t\tConvert_v1_Interact_To_helium_Interact,\n\t\tConvert_helium_Interact_To_v1_Interact,\n\t\tConvert_v1_InteractList_To_helium_InteractList,\n\t\tConvert_helium_InteractList_To_v1_InteractList,\n\t\tConvert_v1_Jobtype_To_helium_Jobtype,\n\t\tConvert_helium_Jobtype_To_v1_Jobtype,\n\t\tConvert_v1_JobtypeList_To_helium_JobtypeList,\n\t\tConvert_helium_JobtypeList_To_v1_JobtypeList,\n\t\tConvert_v1_JobtypeSpec_To_helium_JobtypeSpec,\n\t\tConvert_helium_JobtypeSpec_To_v1_JobtypeSpec,\n\t\tConvert_v1_JobtypeStatus_To_helium_JobtypeStatus,\n\t\tConvert_helium_JobtypeStatus_To_v1_JobtypeStatus,\n\t\tConvert_v1_JobtypeStatusStrategy_To_helium_JobtypeStatusStrategy,\n\t\tConvert_helium_JobtypeStatusStrategy_To_v1_JobtypeStatusStrategy,\n\t\tConvert_v1_JobtypeStrategy_To_helium_JobtypeStrategy,\n\t\tConvert_helium_JobtypeStrategy_To_v1_JobtypeStrategy,\n\t\tConvert_v1_KryptonRepoSpec_To_helium_KryptonRepoSpec,\n\t\tConvert_helium_KryptonRepoSpec_To_v1_KryptonRepoSpec,\n\t\tConvert_v1_NeonRepoSpec_To_helium_NeonRepoSpec,\n\t\tConvert_helium_NeonRepoSpec_To_v1_NeonRepoSpec,\n\t\tConvert_v1_SecuritySpec_To_helium_SecuritySpec,\n\t\tConvert_helium_SecuritySpec_To_v1_SecuritySpec,\n\t\tConvert_v1_StreamDataSpec_To_helium_StreamDataSpec,\n\t\tConvert_helium_StreamDataSpec_To_v1_StreamDataSpec,\n\t\tConvert_v1_Streaming_To_helium_Streaming,\n\t\tConvert_helium_Streaming_To_v1_Streaming,\n\t\tConvert_v1_StreamingList_To_helium_StreamingList,\n\t\tConvert_helium_StreamingList_To_v1_StreamingList,\n\t\tConvert_v1_Training_To_helium_Training,\n\t\tConvert_helium_Training_To_v1_Training,\n\t\tConvert_v1_TrainingList_To_helium_TrainingList,\n\t\tConvert_helium_TrainingList_To_v1_TrainingList,\n\t)\n}", "title": "" }, { "docid": "21bc8d5ceb2dc7708d7f00d2ec42bb07", "score": "0.71558243", "text": "func RegisterConversions(s *runtime.Scheme) error {\n\tif err := s.AddGeneratedConversionFunc((*AWSFargateProfile)(nil), (*v1alpha4.AWSFargateProfile)(nil), func(a, b interface{}, scope conversion.Scope) error {\n\t\treturn Convert_v1alpha3_AWSFargateProfile_To_v1alpha4_AWSFargateProfile(a.(*AWSFargateProfile), b.(*v1alpha4.AWSFargateProfile), scope)\n\t}); err != nil {\n\t\treturn err\n\t}\n\tif err := s.AddGeneratedConversionFunc((*v1alpha4.AWSFargateProfile)(nil), (*AWSFargateProfile)(nil), func(a, b interface{}, scope conversion.Scope) error {\n\t\treturn Convert_v1alpha4_AWSFargateProfile_To_v1alpha3_AWSFargateProfile(a.(*v1alpha4.AWSFargateProfile), b.(*AWSFargateProfile), scope)\n\t}); err != nil {\n\t\treturn err\n\t}\n\tif err := s.AddGeneratedConversionFunc((*AWSFargateProfileList)(nil), (*v1alpha4.AWSFargateProfileList)(nil), func(a, b interface{}, scope conversion.Scope) error {\n\t\treturn Convert_v1alpha3_AWSFargateProfileList_To_v1alpha4_AWSFargateProfileList(a.(*AWSFargateProfileList), b.(*v1alpha4.AWSFargateProfileList), scope)\n\t}); err != nil {\n\t\treturn err\n\t}\n\tif err := s.AddGeneratedConversionFunc((*v1alpha4.AWSFargateProfileList)(nil), (*AWSFargateProfileList)(nil), func(a, b interface{}, scope conversion.Scope) error {\n\t\treturn Convert_v1alpha4_AWSFargateProfileList_To_v1alpha3_AWSFargateProfileList(a.(*v1alpha4.AWSFargateProfileList), b.(*AWSFargateProfileList), scope)\n\t}); err != nil {\n\t\treturn err\n\t}\n\tif err := s.AddGeneratedConversionFunc((*AWSLaunchTemplate)(nil), (*v1alpha4.AWSLaunchTemplate)(nil), func(a, b interface{}, scope conversion.Scope) error {\n\t\treturn Convert_v1alpha3_AWSLaunchTemplate_To_v1alpha4_AWSLaunchTemplate(a.(*AWSLaunchTemplate), b.(*v1alpha4.AWSLaunchTemplate), scope)\n\t}); err != nil {\n\t\treturn err\n\t}\n\tif err := s.AddGeneratedConversionFunc((*v1alpha4.AWSLaunchTemplate)(nil), (*AWSLaunchTemplate)(nil), func(a, b interface{}, scope conversion.Scope) error {\n\t\treturn Convert_v1alpha4_AWSLaunchTemplate_To_v1alpha3_AWSLaunchTemplate(a.(*v1alpha4.AWSLaunchTemplate), b.(*AWSLaunchTemplate), scope)\n\t}); err != nil {\n\t\treturn err\n\t}\n\tif err := s.AddGeneratedConversionFunc((*AWSMachinePool)(nil), (*v1alpha4.AWSMachinePool)(nil), func(a, b interface{}, scope conversion.Scope) error {\n\t\treturn Convert_v1alpha3_AWSMachinePool_To_v1alpha4_AWSMachinePool(a.(*AWSMachinePool), b.(*v1alpha4.AWSMachinePool), scope)\n\t}); err != nil {\n\t\treturn err\n\t}\n\tif err := s.AddGeneratedConversionFunc((*v1alpha4.AWSMachinePool)(nil), (*AWSMachinePool)(nil), func(a, b interface{}, scope conversion.Scope) error {\n\t\treturn Convert_v1alpha4_AWSMachinePool_To_v1alpha3_AWSMachinePool(a.(*v1alpha4.AWSMachinePool), b.(*AWSMachinePool), scope)\n\t}); err != nil {\n\t\treturn err\n\t}\n\tif err := s.AddGeneratedConversionFunc((*AWSMachinePoolInstanceStatus)(nil), (*v1alpha4.AWSMachinePoolInstanceStatus)(nil), func(a, b interface{}, scope conversion.Scope) error {\n\t\treturn Convert_v1alpha3_AWSMachinePoolInstanceStatus_To_v1alpha4_AWSMachinePoolInstanceStatus(a.(*AWSMachinePoolInstanceStatus), b.(*v1alpha4.AWSMachinePoolInstanceStatus), scope)\n\t}); err != nil {\n\t\treturn err\n\t}\n\tif err := s.AddGeneratedConversionFunc((*v1alpha4.AWSMachinePoolInstanceStatus)(nil), (*AWSMachinePoolInstanceStatus)(nil), func(a, b interface{}, scope conversion.Scope) error {\n\t\treturn Convert_v1alpha4_AWSMachinePoolInstanceStatus_To_v1alpha3_AWSMachinePoolInstanceStatus(a.(*v1alpha4.AWSMachinePoolInstanceStatus), b.(*AWSMachinePoolInstanceStatus), scope)\n\t}); err != nil {\n\t\treturn err\n\t}\n\tif err := s.AddGeneratedConversionFunc((*AWSMachinePoolList)(nil), (*v1alpha4.AWSMachinePoolList)(nil), func(a, b interface{}, scope conversion.Scope) error {\n\t\treturn Convert_v1alpha3_AWSMachinePoolList_To_v1alpha4_AWSMachinePoolList(a.(*AWSMachinePoolList), b.(*v1alpha4.AWSMachinePoolList), scope)\n\t}); err != nil {\n\t\treturn err\n\t}\n\tif err := s.AddGeneratedConversionFunc((*v1alpha4.AWSMachinePoolList)(nil), (*AWSMachinePoolList)(nil), func(a, b interface{}, scope conversion.Scope) error {\n\t\treturn Convert_v1alpha4_AWSMachinePoolList_To_v1alpha3_AWSMachinePoolList(a.(*v1alpha4.AWSMachinePoolList), b.(*AWSMachinePoolList), scope)\n\t}); err != nil {\n\t\treturn err\n\t}\n\tif err := s.AddGeneratedConversionFunc((*AWSMachinePoolSpec)(nil), (*v1alpha4.AWSMachinePoolSpec)(nil), func(a, b interface{}, scope conversion.Scope) error {\n\t\treturn Convert_v1alpha3_AWSMachinePoolSpec_To_v1alpha4_AWSMachinePoolSpec(a.(*AWSMachinePoolSpec), b.(*v1alpha4.AWSMachinePoolSpec), scope)\n\t}); err != nil {\n\t\treturn err\n\t}\n\tif err := s.AddGeneratedConversionFunc((*v1alpha4.AWSMachinePoolSpec)(nil), (*AWSMachinePoolSpec)(nil), func(a, b interface{}, scope conversion.Scope) error {\n\t\treturn Convert_v1alpha4_AWSMachinePoolSpec_To_v1alpha3_AWSMachinePoolSpec(a.(*v1alpha4.AWSMachinePoolSpec), b.(*AWSMachinePoolSpec), scope)\n\t}); err != nil {\n\t\treturn err\n\t}\n\tif err := s.AddGeneratedConversionFunc((*AWSMachinePoolStatus)(nil), (*v1alpha4.AWSMachinePoolStatus)(nil), func(a, b interface{}, scope conversion.Scope) error {\n\t\treturn Convert_v1alpha3_AWSMachinePoolStatus_To_v1alpha4_AWSMachinePoolStatus(a.(*AWSMachinePoolStatus), b.(*v1alpha4.AWSMachinePoolStatus), scope)\n\t}); err != nil {\n\t\treturn err\n\t}\n\tif err := s.AddGeneratedConversionFunc((*v1alpha4.AWSMachinePoolStatus)(nil), (*AWSMachinePoolStatus)(nil), func(a, b interface{}, scope conversion.Scope) error {\n\t\treturn Convert_v1alpha4_AWSMachinePoolStatus_To_v1alpha3_AWSMachinePoolStatus(a.(*v1alpha4.AWSMachinePoolStatus), b.(*AWSMachinePoolStatus), scope)\n\t}); err != nil {\n\t\treturn err\n\t}\n\tif err := s.AddGeneratedConversionFunc((*AWSManagedCluster)(nil), (*v1alpha4.AWSManagedCluster)(nil), func(a, b interface{}, scope conversion.Scope) error {\n\t\treturn Convert_v1alpha3_AWSManagedCluster_To_v1alpha4_AWSManagedCluster(a.(*AWSManagedCluster), b.(*v1alpha4.AWSManagedCluster), scope)\n\t}); err != nil {\n\t\treturn err\n\t}\n\tif err := s.AddGeneratedConversionFunc((*v1alpha4.AWSManagedCluster)(nil), (*AWSManagedCluster)(nil), func(a, b interface{}, scope conversion.Scope) error {\n\t\treturn Convert_v1alpha4_AWSManagedCluster_To_v1alpha3_AWSManagedCluster(a.(*v1alpha4.AWSManagedCluster), b.(*AWSManagedCluster), scope)\n\t}); err != nil {\n\t\treturn err\n\t}\n\tif err := s.AddGeneratedConversionFunc((*AWSManagedClusterList)(nil), (*v1alpha4.AWSManagedClusterList)(nil), func(a, b interface{}, scope conversion.Scope) error {\n\t\treturn Convert_v1alpha3_AWSManagedClusterList_To_v1alpha4_AWSManagedClusterList(a.(*AWSManagedClusterList), b.(*v1alpha4.AWSManagedClusterList), scope)\n\t}); err != nil {\n\t\treturn err\n\t}\n\tif err := s.AddGeneratedConversionFunc((*v1alpha4.AWSManagedClusterList)(nil), (*AWSManagedClusterList)(nil), func(a, b interface{}, scope conversion.Scope) error {\n\t\treturn Convert_v1alpha4_AWSManagedClusterList_To_v1alpha3_AWSManagedClusterList(a.(*v1alpha4.AWSManagedClusterList), b.(*AWSManagedClusterList), scope)\n\t}); err != nil {\n\t\treturn err\n\t}\n\tif err := s.AddGeneratedConversionFunc((*AWSManagedClusterSpec)(nil), (*v1alpha4.AWSManagedClusterSpec)(nil), func(a, b interface{}, scope conversion.Scope) error {\n\t\treturn Convert_v1alpha3_AWSManagedClusterSpec_To_v1alpha4_AWSManagedClusterSpec(a.(*AWSManagedClusterSpec), b.(*v1alpha4.AWSManagedClusterSpec), scope)\n\t}); err != nil {\n\t\treturn err\n\t}\n\tif err := s.AddGeneratedConversionFunc((*v1alpha4.AWSManagedClusterSpec)(nil), (*AWSManagedClusterSpec)(nil), func(a, b interface{}, scope conversion.Scope) error {\n\t\treturn Convert_v1alpha4_AWSManagedClusterSpec_To_v1alpha3_AWSManagedClusterSpec(a.(*v1alpha4.AWSManagedClusterSpec), b.(*AWSManagedClusterSpec), scope)\n\t}); err != nil {\n\t\treturn err\n\t}\n\tif err := s.AddGeneratedConversionFunc((*AWSManagedClusterStatus)(nil), (*v1alpha4.AWSManagedClusterStatus)(nil), func(a, b interface{}, scope conversion.Scope) error {\n\t\treturn Convert_v1alpha3_AWSManagedClusterStatus_To_v1alpha4_AWSManagedClusterStatus(a.(*AWSManagedClusterStatus), b.(*v1alpha4.AWSManagedClusterStatus), scope)\n\t}); err != nil {\n\t\treturn err\n\t}\n\tif err := s.AddGeneratedConversionFunc((*v1alpha4.AWSManagedClusterStatus)(nil), (*AWSManagedClusterStatus)(nil), func(a, b interface{}, scope conversion.Scope) error {\n\t\treturn Convert_v1alpha4_AWSManagedClusterStatus_To_v1alpha3_AWSManagedClusterStatus(a.(*v1alpha4.AWSManagedClusterStatus), b.(*AWSManagedClusterStatus), scope)\n\t}); err != nil {\n\t\treturn err\n\t}\n\tif err := s.AddGeneratedConversionFunc((*AWSManagedMachinePool)(nil), (*v1alpha4.AWSManagedMachinePool)(nil), func(a, b interface{}, scope conversion.Scope) error {\n\t\treturn Convert_v1alpha3_AWSManagedMachinePool_To_v1alpha4_AWSManagedMachinePool(a.(*AWSManagedMachinePool), b.(*v1alpha4.AWSManagedMachinePool), scope)\n\t}); err != nil {\n\t\treturn err\n\t}\n\tif err := s.AddGeneratedConversionFunc((*v1alpha4.AWSManagedMachinePool)(nil), (*AWSManagedMachinePool)(nil), func(a, b interface{}, scope conversion.Scope) error {\n\t\treturn Convert_v1alpha4_AWSManagedMachinePool_To_v1alpha3_AWSManagedMachinePool(a.(*v1alpha4.AWSManagedMachinePool), b.(*AWSManagedMachinePool), scope)\n\t}); err != nil {\n\t\treturn err\n\t}\n\tif err := s.AddGeneratedConversionFunc((*AWSManagedMachinePoolList)(nil), (*v1alpha4.AWSManagedMachinePoolList)(nil), func(a, b interface{}, scope conversion.Scope) error {\n\t\treturn Convert_v1alpha3_AWSManagedMachinePoolList_To_v1alpha4_AWSManagedMachinePoolList(a.(*AWSManagedMachinePoolList), b.(*v1alpha4.AWSManagedMachinePoolList), scope)\n\t}); err != nil {\n\t\treturn err\n\t}\n\tif err := s.AddGeneratedConversionFunc((*v1alpha4.AWSManagedMachinePoolList)(nil), (*AWSManagedMachinePoolList)(nil), func(a, b interface{}, scope conversion.Scope) error {\n\t\treturn Convert_v1alpha4_AWSManagedMachinePoolList_To_v1alpha3_AWSManagedMachinePoolList(a.(*v1alpha4.AWSManagedMachinePoolList), b.(*AWSManagedMachinePoolList), scope)\n\t}); err != nil {\n\t\treturn err\n\t}\n\tif err := s.AddGeneratedConversionFunc((*AWSManagedMachinePoolSpec)(nil), (*v1alpha4.AWSManagedMachinePoolSpec)(nil), func(a, b interface{}, scope conversion.Scope) error {\n\t\treturn Convert_v1alpha3_AWSManagedMachinePoolSpec_To_v1alpha4_AWSManagedMachinePoolSpec(a.(*AWSManagedMachinePoolSpec), b.(*v1alpha4.AWSManagedMachinePoolSpec), scope)\n\t}); err != nil {\n\t\treturn err\n\t}\n\tif err := s.AddGeneratedConversionFunc((*AWSManagedMachinePoolStatus)(nil), (*v1alpha4.AWSManagedMachinePoolStatus)(nil), func(a, b interface{}, scope conversion.Scope) error {\n\t\treturn Convert_v1alpha3_AWSManagedMachinePoolStatus_To_v1alpha4_AWSManagedMachinePoolStatus(a.(*AWSManagedMachinePoolStatus), b.(*v1alpha4.AWSManagedMachinePoolStatus), scope)\n\t}); err != nil {\n\t\treturn err\n\t}\n\tif err := s.AddGeneratedConversionFunc((*v1alpha4.AWSManagedMachinePoolStatus)(nil), (*AWSManagedMachinePoolStatus)(nil), func(a, b interface{}, scope conversion.Scope) error {\n\t\treturn Convert_v1alpha4_AWSManagedMachinePoolStatus_To_v1alpha3_AWSManagedMachinePoolStatus(a.(*v1alpha4.AWSManagedMachinePoolStatus), b.(*AWSManagedMachinePoolStatus), scope)\n\t}); err != nil {\n\t\treturn err\n\t}\n\tif err := s.AddGeneratedConversionFunc((*AutoScalingGroup)(nil), (*v1alpha4.AutoScalingGroup)(nil), func(a, b interface{}, scope conversion.Scope) error {\n\t\treturn Convert_v1alpha3_AutoScalingGroup_To_v1alpha4_AutoScalingGroup(a.(*AutoScalingGroup), b.(*v1alpha4.AutoScalingGroup), scope)\n\t}); err != nil {\n\t\treturn err\n\t}\n\tif err := s.AddGeneratedConversionFunc((*v1alpha4.AutoScalingGroup)(nil), (*AutoScalingGroup)(nil), func(a, b interface{}, scope conversion.Scope) error {\n\t\treturn Convert_v1alpha4_AutoScalingGroup_To_v1alpha3_AutoScalingGroup(a.(*v1alpha4.AutoScalingGroup), b.(*AutoScalingGroup), scope)\n\t}); err != nil {\n\t\treturn err\n\t}\n\tif err := s.AddGeneratedConversionFunc((*BlockDeviceMapping)(nil), (*v1alpha4.BlockDeviceMapping)(nil), func(a, b interface{}, scope conversion.Scope) error {\n\t\treturn Convert_v1alpha3_BlockDeviceMapping_To_v1alpha4_BlockDeviceMapping(a.(*BlockDeviceMapping), b.(*v1alpha4.BlockDeviceMapping), scope)\n\t}); err != nil {\n\t\treturn err\n\t}\n\tif err := s.AddGeneratedConversionFunc((*v1alpha4.BlockDeviceMapping)(nil), (*BlockDeviceMapping)(nil), func(a, b interface{}, scope conversion.Scope) error {\n\t\treturn Convert_v1alpha4_BlockDeviceMapping_To_v1alpha3_BlockDeviceMapping(a.(*v1alpha4.BlockDeviceMapping), b.(*BlockDeviceMapping), scope)\n\t}); err != nil {\n\t\treturn err\n\t}\n\tif err := s.AddGeneratedConversionFunc((*EBS)(nil), (*v1alpha4.EBS)(nil), func(a, b interface{}, scope conversion.Scope) error {\n\t\treturn Convert_v1alpha3_EBS_To_v1alpha4_EBS(a.(*EBS), b.(*v1alpha4.EBS), scope)\n\t}); err != nil {\n\t\treturn err\n\t}\n\tif err := s.AddGeneratedConversionFunc((*v1alpha4.EBS)(nil), (*EBS)(nil), func(a, b interface{}, scope conversion.Scope) error {\n\t\treturn Convert_v1alpha4_EBS_To_v1alpha3_EBS(a.(*v1alpha4.EBS), b.(*EBS), scope)\n\t}); err != nil {\n\t\treturn err\n\t}\n\tif err := s.AddGeneratedConversionFunc((*FargateProfileSpec)(nil), (*v1alpha4.FargateProfileSpec)(nil), func(a, b interface{}, scope conversion.Scope) error {\n\t\treturn Convert_v1alpha3_FargateProfileSpec_To_v1alpha4_FargateProfileSpec(a.(*FargateProfileSpec), b.(*v1alpha4.FargateProfileSpec), scope)\n\t}); err != nil {\n\t\treturn err\n\t}\n\tif err := s.AddGeneratedConversionFunc((*v1alpha4.FargateProfileSpec)(nil), (*FargateProfileSpec)(nil), func(a, b interface{}, scope conversion.Scope) error {\n\t\treturn Convert_v1alpha4_FargateProfileSpec_To_v1alpha3_FargateProfileSpec(a.(*v1alpha4.FargateProfileSpec), b.(*FargateProfileSpec), scope)\n\t}); err != nil {\n\t\treturn err\n\t}\n\tif err := s.AddGeneratedConversionFunc((*FargateProfileStatus)(nil), (*v1alpha4.FargateProfileStatus)(nil), func(a, b interface{}, scope conversion.Scope) error {\n\t\treturn Convert_v1alpha3_FargateProfileStatus_To_v1alpha4_FargateProfileStatus(a.(*FargateProfileStatus), b.(*v1alpha4.FargateProfileStatus), scope)\n\t}); err != nil {\n\t\treturn err\n\t}\n\tif err := s.AddGeneratedConversionFunc((*v1alpha4.FargateProfileStatus)(nil), (*FargateProfileStatus)(nil), func(a, b interface{}, scope conversion.Scope) error {\n\t\treturn Convert_v1alpha4_FargateProfileStatus_To_v1alpha3_FargateProfileStatus(a.(*v1alpha4.FargateProfileStatus), b.(*FargateProfileStatus), scope)\n\t}); err != nil {\n\t\treturn err\n\t}\n\tif err := s.AddGeneratedConversionFunc((*FargateSelector)(nil), (*v1alpha4.FargateSelector)(nil), func(a, b interface{}, scope conversion.Scope) error {\n\t\treturn Convert_v1alpha3_FargateSelector_To_v1alpha4_FargateSelector(a.(*FargateSelector), b.(*v1alpha4.FargateSelector), scope)\n\t}); err != nil {\n\t\treturn err\n\t}\n\tif err := s.AddGeneratedConversionFunc((*v1alpha4.FargateSelector)(nil), (*FargateSelector)(nil), func(a, b interface{}, scope conversion.Scope) error {\n\t\treturn Convert_v1alpha4_FargateSelector_To_v1alpha3_FargateSelector(a.(*v1alpha4.FargateSelector), b.(*FargateSelector), scope)\n\t}); err != nil {\n\t\treturn err\n\t}\n\tif err := s.AddGeneratedConversionFunc((*InstancesDistribution)(nil), (*v1alpha4.InstancesDistribution)(nil), func(a, b interface{}, scope conversion.Scope) error {\n\t\treturn Convert_v1alpha3_InstancesDistribution_To_v1alpha4_InstancesDistribution(a.(*InstancesDistribution), b.(*v1alpha4.InstancesDistribution), scope)\n\t}); err != nil {\n\t\treturn err\n\t}\n\tif err := s.AddGeneratedConversionFunc((*v1alpha4.InstancesDistribution)(nil), (*InstancesDistribution)(nil), func(a, b interface{}, scope conversion.Scope) error {\n\t\treturn Convert_v1alpha4_InstancesDistribution_To_v1alpha3_InstancesDistribution(a.(*v1alpha4.InstancesDistribution), b.(*InstancesDistribution), scope)\n\t}); err != nil {\n\t\treturn err\n\t}\n\tif err := s.AddGeneratedConversionFunc((*ManagedMachinePoolScaling)(nil), (*v1alpha4.ManagedMachinePoolScaling)(nil), func(a, b interface{}, scope conversion.Scope) error {\n\t\treturn Convert_v1alpha3_ManagedMachinePoolScaling_To_v1alpha4_ManagedMachinePoolScaling(a.(*ManagedMachinePoolScaling), b.(*v1alpha4.ManagedMachinePoolScaling), scope)\n\t}); err != nil {\n\t\treturn err\n\t}\n\tif err := s.AddGeneratedConversionFunc((*v1alpha4.ManagedMachinePoolScaling)(nil), (*ManagedMachinePoolScaling)(nil), func(a, b interface{}, scope conversion.Scope) error {\n\t\treturn Convert_v1alpha4_ManagedMachinePoolScaling_To_v1alpha3_ManagedMachinePoolScaling(a.(*v1alpha4.ManagedMachinePoolScaling), b.(*ManagedMachinePoolScaling), scope)\n\t}); err != nil {\n\t\treturn err\n\t}\n\tif err := s.AddGeneratedConversionFunc((*ManagedRemoteAccess)(nil), (*v1alpha4.ManagedRemoteAccess)(nil), func(a, b interface{}, scope conversion.Scope) error {\n\t\treturn Convert_v1alpha3_ManagedRemoteAccess_To_v1alpha4_ManagedRemoteAccess(a.(*ManagedRemoteAccess), b.(*v1alpha4.ManagedRemoteAccess), scope)\n\t}); err != nil {\n\t\treturn err\n\t}\n\tif err := s.AddGeneratedConversionFunc((*v1alpha4.ManagedRemoteAccess)(nil), (*ManagedRemoteAccess)(nil), func(a, b interface{}, scope conversion.Scope) error {\n\t\treturn Convert_v1alpha4_ManagedRemoteAccess_To_v1alpha3_ManagedRemoteAccess(a.(*v1alpha4.ManagedRemoteAccess), b.(*ManagedRemoteAccess), scope)\n\t}); err != nil {\n\t\treturn err\n\t}\n\tif err := s.AddGeneratedConversionFunc((*MixedInstancesPolicy)(nil), (*v1alpha4.MixedInstancesPolicy)(nil), func(a, b interface{}, scope conversion.Scope) error {\n\t\treturn Convert_v1alpha3_MixedInstancesPolicy_To_v1alpha4_MixedInstancesPolicy(a.(*MixedInstancesPolicy), b.(*v1alpha4.MixedInstancesPolicy), scope)\n\t}); err != nil {\n\t\treturn err\n\t}\n\tif err := s.AddGeneratedConversionFunc((*v1alpha4.MixedInstancesPolicy)(nil), (*MixedInstancesPolicy)(nil), func(a, b interface{}, scope conversion.Scope) error {\n\t\treturn Convert_v1alpha4_MixedInstancesPolicy_To_v1alpha3_MixedInstancesPolicy(a.(*v1alpha4.MixedInstancesPolicy), b.(*MixedInstancesPolicy), scope)\n\t}); err != nil {\n\t\treturn err\n\t}\n\tif err := s.AddGeneratedConversionFunc((*Overrides)(nil), (*v1alpha4.Overrides)(nil), func(a, b interface{}, scope conversion.Scope) error {\n\t\treturn Convert_v1alpha3_Overrides_To_v1alpha4_Overrides(a.(*Overrides), b.(*v1alpha4.Overrides), scope)\n\t}); err != nil {\n\t\treturn err\n\t}\n\tif err := s.AddGeneratedConversionFunc((*v1alpha4.Overrides)(nil), (*Overrides)(nil), func(a, b interface{}, scope conversion.Scope) error {\n\t\treturn Convert_v1alpha4_Overrides_To_v1alpha3_Overrides(a.(*v1alpha4.Overrides), b.(*Overrides), scope)\n\t}); err != nil {\n\t\treturn err\n\t}\n\tif err := s.AddGeneratedConversionFunc((*RefreshPreferences)(nil), (*v1alpha4.RefreshPreferences)(nil), func(a, b interface{}, scope conversion.Scope) error {\n\t\treturn Convert_v1alpha3_RefreshPreferences_To_v1alpha4_RefreshPreferences(a.(*RefreshPreferences), b.(*v1alpha4.RefreshPreferences), scope)\n\t}); err != nil {\n\t\treturn err\n\t}\n\tif err := s.AddGeneratedConversionFunc((*v1alpha4.RefreshPreferences)(nil), (*RefreshPreferences)(nil), func(a, b interface{}, scope conversion.Scope) error {\n\t\treturn Convert_v1alpha4_RefreshPreferences_To_v1alpha3_RefreshPreferences(a.(*v1alpha4.RefreshPreferences), b.(*RefreshPreferences), scope)\n\t}); err != nil {\n\t\treturn err\n\t}\n\tif err := s.AddConversionFunc((*apiv1alpha3.APIEndpoint)(nil), (*apiv1alpha4.APIEndpoint)(nil), func(a, b interface{}, scope conversion.Scope) error {\n\t\treturn Convert_v1alpha3_APIEndpoint_To_v1alpha4_APIEndpoint(a.(*apiv1alpha3.APIEndpoint), b.(*apiv1alpha4.APIEndpoint), scope)\n\t}); err != nil {\n\t\treturn err\n\t}\n\tif err := s.AddConversionFunc((*clusterapiproviderawsapiv1alpha3.AWSResourceReference)(nil), (*clusterapiproviderawsapiv1alpha4.AWSResourceReference)(nil), func(a, b interface{}, scope conversion.Scope) error {\n\t\treturn Convert_v1alpha3_AWSResourceReference_To_v1alpha4_AWSResourceReference(a.(*clusterapiproviderawsapiv1alpha3.AWSResourceReference), b.(*clusterapiproviderawsapiv1alpha4.AWSResourceReference), scope)\n\t}); err != nil {\n\t\treturn err\n\t}\n\tif err := s.AddConversionFunc((*apiv1alpha4.APIEndpoint)(nil), (*apiv1alpha3.APIEndpoint)(nil), func(a, b interface{}, scope conversion.Scope) error {\n\t\treturn Convert_v1alpha4_APIEndpoint_To_v1alpha3_APIEndpoint(a.(*apiv1alpha4.APIEndpoint), b.(*apiv1alpha3.APIEndpoint), scope)\n\t}); err != nil {\n\t\treturn err\n\t}\n\tif err := s.AddConversionFunc((*v1alpha4.AWSManagedMachinePoolSpec)(nil), (*AWSManagedMachinePoolSpec)(nil), func(a, b interface{}, scope conversion.Scope) error {\n\t\treturn Convert_v1alpha4_AWSManagedMachinePoolSpec_To_v1alpha3_AWSManagedMachinePoolSpec(a.(*v1alpha4.AWSManagedMachinePoolSpec), b.(*AWSManagedMachinePoolSpec), scope)\n\t}); err != nil {\n\t\treturn err\n\t}\n\tif err := s.AddConversionFunc((*clusterapiproviderawsapiv1alpha4.AWSResourceReference)(nil), (*clusterapiproviderawsapiv1alpha3.AWSResourceReference)(nil), func(a, b interface{}, scope conversion.Scope) error {\n\t\treturn Convert_v1alpha4_AWSResourceReference_To_v1alpha3_AWSResourceReference(a.(*clusterapiproviderawsapiv1alpha4.AWSResourceReference), b.(*clusterapiproviderawsapiv1alpha3.AWSResourceReference), scope)\n\t}); err != nil {\n\t\treturn err\n\t}\n\treturn nil\n}", "title": "" }, { "docid": "fa158faf5e04a2fdbaa5c792b57c1a1e", "score": "0.71457165", "text": "func RegisterConversions(s *runtime.Scheme) error {\n\tif err := s.AddGeneratedConversionFunc((*url.Values)(nil), (*CreateOptions)(nil), func(a, b interface{}, scope conversion.Scope) error {\n\t\treturn Convert_url_Values_To_v1_CreateOptions(a.(*url.Values), b.(*CreateOptions), scope)\n\t}); err != nil {\n\t\treturn err\n\t}\n\tif err := s.AddGeneratedConversionFunc((*url.Values)(nil), (*DeleteOptions)(nil), func(a, b interface{}, scope conversion.Scope) error {\n\t\treturn Convert_url_Values_To_v1_DeleteOptions(a.(*url.Values), b.(*DeleteOptions), scope)\n\t}); err != nil {\n\t\treturn err\n\t}\n\tif err := s.AddGeneratedConversionFunc((*url.Values)(nil), (*GetOptions)(nil), func(a, b interface{}, scope conversion.Scope) error {\n\t\treturn Convert_url_Values_To_v1_GetOptions(a.(*url.Values), b.(*GetOptions), scope)\n\t}); err != nil {\n\t\treturn err\n\t}\n\tif err := s.AddGeneratedConversionFunc((*url.Values)(nil), (*ListOptions)(nil), func(a, b interface{}, scope conversion.Scope) error {\n\t\treturn Convert_url_Values_To_v1_ListOptions(a.(*url.Values), b.(*ListOptions), scope)\n\t}); err != nil {\n\t\treturn err\n\t}\n\tif err := s.AddGeneratedConversionFunc((*url.Values)(nil), (*PatchOptions)(nil), func(a, b interface{}, scope conversion.Scope) error {\n\t\treturn Convert_url_Values_To_v1_PatchOptions(a.(*url.Values), b.(*PatchOptions), scope)\n\t}); err != nil {\n\t\treturn err\n\t}\n\tif err := s.AddGeneratedConversionFunc((*url.Values)(nil), (*TableOptions)(nil), func(a, b interface{}, scope conversion.Scope) error {\n\t\treturn Convert_url_Values_To_v1_TableOptions(a.(*url.Values), b.(*TableOptions), scope)\n\t}); err != nil {\n\t\treturn err\n\t}\n\tif err := s.AddGeneratedConversionFunc((*url.Values)(nil), (*UpdateOptions)(nil), func(a, b interface{}, scope conversion.Scope) error {\n\t\treturn Convert_url_Values_To_v1_UpdateOptions(a.(*url.Values), b.(*UpdateOptions), scope)\n\t}); err != nil {\n\t\treturn err\n\t}\n\tif err := s.AddConversionFunc((*map[string]string)(nil), (*LabelSelector)(nil), func(a, b interface{}, scope conversion.Scope) error {\n\t\treturn Convert_Map_string_To_string_To_v1_LabelSelector(a.(*map[string]string), b.(*LabelSelector), scope)\n\t}); err != nil {\n\t\treturn err\n\t}\n\tif err := s.AddConversionFunc((**bool)(nil), (*bool)(nil), func(a, b interface{}, scope conversion.Scope) error {\n\t\treturn Convert_Pointer_bool_To_bool(a.(**bool), b.(*bool), scope)\n\t}); err != nil {\n\t\treturn err\n\t}\n\tif err := s.AddConversionFunc((**float64)(nil), (*float64)(nil), func(a, b interface{}, scope conversion.Scope) error {\n\t\treturn Convert_Pointer_float64_To_float64(a.(**float64), b.(*float64), scope)\n\t}); err != nil {\n\t\treturn err\n\t}\n\tif err := s.AddConversionFunc((**int32)(nil), (*int32)(nil), func(a, b interface{}, scope conversion.Scope) error {\n\t\treturn Convert_Pointer_int32_To_int32(a.(**int32), b.(*int32), scope)\n\t}); err != nil {\n\t\treturn err\n\t}\n\tif err := s.AddConversionFunc((**int64)(nil), (*int)(nil), func(a, b interface{}, scope conversion.Scope) error {\n\t\treturn Convert_Pointer_int64_To_int(a.(**int64), b.(*int), scope)\n\t}); err != nil {\n\t\treturn err\n\t}\n\tif err := s.AddConversionFunc((**int64)(nil), (*int64)(nil), func(a, b interface{}, scope conversion.Scope) error {\n\t\treturn Convert_Pointer_int64_To_int64(a.(**int64), b.(*int64), scope)\n\t}); err != nil {\n\t\treturn err\n\t}\n\tif err := s.AddConversionFunc((**intstr.IntOrString)(nil), (*intstr.IntOrString)(nil), func(a, b interface{}, scope conversion.Scope) error {\n\t\treturn Convert_Pointer_intstr_IntOrString_To_intstr_IntOrString(a.(**intstr.IntOrString), b.(*intstr.IntOrString), scope)\n\t}); err != nil {\n\t\treturn err\n\t}\n\tif err := s.AddConversionFunc((**string)(nil), (*string)(nil), func(a, b interface{}, scope conversion.Scope) error {\n\t\treturn Convert_Pointer_string_To_string(a.(**string), b.(*string), scope)\n\t}); err != nil {\n\t\treturn err\n\t}\n\tif err := s.AddConversionFunc((**Duration)(nil), (*Duration)(nil), func(a, b interface{}, scope conversion.Scope) error {\n\t\treturn Convert_Pointer_v1_Duration_To_v1_Duration(a.(**Duration), b.(*Duration), scope)\n\t}); err != nil {\n\t\treturn err\n\t}\n\tif err := s.AddConversionFunc((*[]string)(nil), (**DeletionPropagation)(nil), func(a, b interface{}, scope conversion.Scope) error {\n\t\treturn Convert_Slice_string_To_Pointer_v1_DeletionPropagation(a.(*[]string), b.(**DeletionPropagation), scope)\n\t}); err != nil {\n\t\treturn err\n\t}\n\tif err := s.AddConversionFunc((*[]string)(nil), (**Time)(nil), func(a, b interface{}, scope conversion.Scope) error {\n\t\treturn Convert_Slice_string_To_Pointer_v1_Time(a.(*[]string), b.(**Time), scope)\n\t}); err != nil {\n\t\treturn err\n\t}\n\tif err := s.AddConversionFunc((*[]string)(nil), (*[]int32)(nil), func(a, b interface{}, scope conversion.Scope) error {\n\t\treturn Convert_Slice_string_To_Slice_int32(a.(*[]string), b.(*[]int32), scope)\n\t}); err != nil {\n\t\treturn err\n\t}\n\tif err := s.AddConversionFunc((*[]string)(nil), (*IncludeObjectPolicy)(nil), func(a, b interface{}, scope conversion.Scope) error {\n\t\treturn Convert_Slice_string_To_v1_IncludeObjectPolicy(a.(*[]string), b.(*IncludeObjectPolicy), scope)\n\t}); err != nil {\n\t\treturn err\n\t}\n\tif err := s.AddConversionFunc((*[]string)(nil), (*ResourceVersionMatch)(nil), func(a, b interface{}, scope conversion.Scope) error {\n\t\treturn Convert_Slice_string_To_v1_ResourceVersionMatch(a.(*[]string), b.(*ResourceVersionMatch), scope)\n\t}); err != nil {\n\t\treturn err\n\t}\n\tif err := s.AddConversionFunc((*[]string)(nil), (*Time)(nil), func(a, b interface{}, scope conversion.Scope) error {\n\t\treturn Convert_Slice_string_To_v1_Time(a.(*[]string), b.(*Time), scope)\n\t}); err != nil {\n\t\treturn err\n\t}\n\tif err := s.AddConversionFunc((*bool)(nil), (**bool)(nil), func(a, b interface{}, scope conversion.Scope) error {\n\t\treturn Convert_bool_To_Pointer_bool(a.(*bool), b.(**bool), scope)\n\t}); err != nil {\n\t\treturn err\n\t}\n\tif err := s.AddConversionFunc((*fields.Selector)(nil), (*string)(nil), func(a, b interface{}, scope conversion.Scope) error {\n\t\treturn Convert_fields_Selector_To_string(a.(*fields.Selector), b.(*string), scope)\n\t}); err != nil {\n\t\treturn err\n\t}\n\tif err := s.AddConversionFunc((*float64)(nil), (**float64)(nil), func(a, b interface{}, scope conversion.Scope) error {\n\t\treturn Convert_float64_To_Pointer_float64(a.(*float64), b.(**float64), scope)\n\t}); err != nil {\n\t\treturn err\n\t}\n\tif err := s.AddConversionFunc((*int32)(nil), (**int32)(nil), func(a, b interface{}, scope conversion.Scope) error {\n\t\treturn Convert_int32_To_Pointer_int32(a.(*int32), b.(**int32), scope)\n\t}); err != nil {\n\t\treturn err\n\t}\n\tif err := s.AddConversionFunc((*int64)(nil), (**int64)(nil), func(a, b interface{}, scope conversion.Scope) error {\n\t\treturn Convert_int64_To_Pointer_int64(a.(*int64), b.(**int64), scope)\n\t}); err != nil {\n\t\treturn err\n\t}\n\tif err := s.AddConversionFunc((*int)(nil), (**int64)(nil), func(a, b interface{}, scope conversion.Scope) error {\n\t\treturn Convert_int_To_Pointer_int64(a.(*int), b.(**int64), scope)\n\t}); err != nil {\n\t\treturn err\n\t}\n\tif err := s.AddConversionFunc((*intstr.IntOrString)(nil), (**intstr.IntOrString)(nil), func(a, b interface{}, scope conversion.Scope) error {\n\t\treturn Convert_intstr_IntOrString_To_Pointer_intstr_IntOrString(a.(*intstr.IntOrString), b.(**intstr.IntOrString), scope)\n\t}); err != nil {\n\t\treturn err\n\t}\n\tif err := s.AddConversionFunc((*intstr.IntOrString)(nil), (*intstr.IntOrString)(nil), func(a, b interface{}, scope conversion.Scope) error {\n\t\treturn Convert_intstr_IntOrString_To_intstr_IntOrString(a.(*intstr.IntOrString), b.(*intstr.IntOrString), scope)\n\t}); err != nil {\n\t\treturn err\n\t}\n\tif err := s.AddConversionFunc((*labels.Selector)(nil), (*string)(nil), func(a, b interface{}, scope conversion.Scope) error {\n\t\treturn Convert_labels_Selector_To_string(a.(*labels.Selector), b.(*string), scope)\n\t}); err != nil {\n\t\treturn err\n\t}\n\tif err := s.AddConversionFunc((*resource.Quantity)(nil), (*resource.Quantity)(nil), func(a, b interface{}, scope conversion.Scope) error {\n\t\treturn Convert_resource_Quantity_To_resource_Quantity(a.(*resource.Quantity), b.(*resource.Quantity), scope)\n\t}); err != nil {\n\t\treturn err\n\t}\n\tif err := s.AddConversionFunc((*string)(nil), (**string)(nil), func(a, b interface{}, scope conversion.Scope) error {\n\t\treturn Convert_string_To_Pointer_string(a.(*string), b.(**string), scope)\n\t}); err != nil {\n\t\treturn err\n\t}\n\tif err := s.AddConversionFunc((*string)(nil), (*fields.Selector)(nil), func(a, b interface{}, scope conversion.Scope) error {\n\t\treturn Convert_string_To_fields_Selector(a.(*string), b.(*fields.Selector), scope)\n\t}); err != nil {\n\t\treturn err\n\t}\n\tif err := s.AddConversionFunc((*string)(nil), (*labels.Selector)(nil), func(a, b interface{}, scope conversion.Scope) error {\n\t\treturn Convert_string_To_labels_Selector(a.(*string), b.(*labels.Selector), scope)\n\t}); err != nil {\n\t\treturn err\n\t}\n\tif err := s.AddConversionFunc((*url.Values)(nil), (*DeleteOptions)(nil), func(a, b interface{}, scope conversion.Scope) error {\n\t\treturn Convert_url_Values_To_v1_DeleteOptions(a.(*url.Values), b.(*DeleteOptions), scope)\n\t}); err != nil {\n\t\treturn err\n\t}\n\tif err := s.AddConversionFunc((*DeleteOptions)(nil), (*DeleteOptions)(nil), func(a, b interface{}, scope conversion.Scope) error {\n\t\treturn Convert_v1_DeleteOptions_To_v1_DeleteOptions(a.(*DeleteOptions), b.(*DeleteOptions), scope)\n\t}); err != nil {\n\t\treturn err\n\t}\n\tif err := s.AddConversionFunc((*Duration)(nil), (**Duration)(nil), func(a, b interface{}, scope conversion.Scope) error {\n\t\treturn Convert_v1_Duration_To_Pointer_v1_Duration(a.(*Duration), b.(**Duration), scope)\n\t}); err != nil {\n\t\treturn err\n\t}\n\tif err := s.AddConversionFunc((*InternalEvent)(nil), (*WatchEvent)(nil), func(a, b interface{}, scope conversion.Scope) error {\n\t\treturn Convert_v1_InternalEvent_To_v1_WatchEvent(a.(*InternalEvent), b.(*WatchEvent), scope)\n\t}); err != nil {\n\t\treturn err\n\t}\n\tif err := s.AddConversionFunc((*LabelSelector)(nil), (*map[string]string)(nil), func(a, b interface{}, scope conversion.Scope) error {\n\t\treturn Convert_v1_LabelSelector_To_Map_string_To_string(a.(*LabelSelector), b.(*map[string]string), scope)\n\t}); err != nil {\n\t\treturn err\n\t}\n\tif err := s.AddConversionFunc((*ListMeta)(nil), (*ListMeta)(nil), func(a, b interface{}, scope conversion.Scope) error {\n\t\treturn Convert_v1_ListMeta_To_v1_ListMeta(a.(*ListMeta), b.(*ListMeta), scope)\n\t}); err != nil {\n\t\treturn err\n\t}\n\tif err := s.AddConversionFunc((*MicroTime)(nil), (*MicroTime)(nil), func(a, b interface{}, scope conversion.Scope) error {\n\t\treturn Convert_v1_MicroTime_To_v1_MicroTime(a.(*MicroTime), b.(*MicroTime), scope)\n\t}); err != nil {\n\t\treturn err\n\t}\n\tif err := s.AddConversionFunc((*Time)(nil), (*Time)(nil), func(a, b interface{}, scope conversion.Scope) error {\n\t\treturn Convert_v1_Time_To_v1_Time(a.(*Time), b.(*Time), scope)\n\t}); err != nil {\n\t\treturn err\n\t}\n\tif err := s.AddConversionFunc((*TypeMeta)(nil), (*TypeMeta)(nil), func(a, b interface{}, scope conversion.Scope) error {\n\t\treturn Convert_v1_TypeMeta_To_v1_TypeMeta(a.(*TypeMeta), b.(*TypeMeta), scope)\n\t}); err != nil {\n\t\treturn err\n\t}\n\tif err := s.AddConversionFunc((*WatchEvent)(nil), (*InternalEvent)(nil), func(a, b interface{}, scope conversion.Scope) error {\n\t\treturn Convert_v1_WatchEvent_To_v1_InternalEvent(a.(*WatchEvent), b.(*InternalEvent), scope)\n\t}); err != nil {\n\t\treturn err\n\t}\n\tif err := s.AddConversionFunc((*WatchEvent)(nil), (*watch.Event)(nil), func(a, b interface{}, scope conversion.Scope) error {\n\t\treturn Convert_v1_WatchEvent_To_watch_Event(a.(*WatchEvent), b.(*watch.Event), scope)\n\t}); err != nil {\n\t\treturn err\n\t}\n\tif err := s.AddConversionFunc((*watch.Event)(nil), (*WatchEvent)(nil), func(a, b interface{}, scope conversion.Scope) error {\n\t\treturn Convert_watch_Event_To_v1_WatchEvent(a.(*watch.Event), b.(*WatchEvent), scope)\n\t}); err != nil {\n\t\treturn err\n\t}\n\treturn nil\n}", "title": "" }, { "docid": "ca653873baa2bfbc8caf8aa6b3c3ada3", "score": "0.7144096", "text": "func RegisterConversions(s *runtime.Scheme) error {\n\tif err := s.AddGeneratedConversionFunc((*APIGroup)(nil), (*discovery.APIGroup)(nil), func(a, b interface{}, scope conversion.Scope) error {\n\t\treturn Convert_v1_APIGroup_To_discovery_APIGroup(a.(*APIGroup), b.(*discovery.APIGroup), scope)\n\t}); err != nil {\n\t\treturn err\n\t}\n\tif err := s.AddGeneratedConversionFunc((*discovery.APIGroup)(nil), (*APIGroup)(nil), func(a, b interface{}, scope conversion.Scope) error {\n\t\treturn Convert_discovery_APIGroup_To_v1_APIGroup(a.(*discovery.APIGroup), b.(*APIGroup), scope)\n\t}); err != nil {\n\t\treturn err\n\t}\n\tif err := s.AddGeneratedConversionFunc((*APIGroupList)(nil), (*discovery.APIGroupList)(nil), func(a, b interface{}, scope conversion.Scope) error {\n\t\treturn Convert_v1_APIGroupList_To_discovery_APIGroupList(a.(*APIGroupList), b.(*discovery.APIGroupList), scope)\n\t}); err != nil {\n\t\treturn err\n\t}\n\tif err := s.AddGeneratedConversionFunc((*discovery.APIGroupList)(nil), (*APIGroupList)(nil), func(a, b interface{}, scope conversion.Scope) error {\n\t\treturn Convert_discovery_APIGroupList_To_v1_APIGroupList(a.(*discovery.APIGroupList), b.(*APIGroupList), scope)\n\t}); err != nil {\n\t\treturn err\n\t}\n\tif err := s.AddGeneratedConversionFunc((*APIResource)(nil), (*discovery.APIResource)(nil), func(a, b interface{}, scope conversion.Scope) error {\n\t\treturn Convert_v1_APIResource_To_discovery_APIResource(a.(*APIResource), b.(*discovery.APIResource), scope)\n\t}); err != nil {\n\t\treturn err\n\t}\n\tif err := s.AddGeneratedConversionFunc((*discovery.APIResource)(nil), (*APIResource)(nil), func(a, b interface{}, scope conversion.Scope) error {\n\t\treturn Convert_discovery_APIResource_To_v1_APIResource(a.(*discovery.APIResource), b.(*APIResource), scope)\n\t}); err != nil {\n\t\treturn err\n\t}\n\tif err := s.AddGeneratedConversionFunc((*APIResourceList)(nil), (*discovery.APIResourceList)(nil), func(a, b interface{}, scope conversion.Scope) error {\n\t\treturn Convert_v1_APIResourceList_To_discovery_APIResourceList(a.(*APIResourceList), b.(*discovery.APIResourceList), scope)\n\t}); err != nil {\n\t\treturn err\n\t}\n\tif err := s.AddGeneratedConversionFunc((*discovery.APIResourceList)(nil), (*APIResourceList)(nil), func(a, b interface{}, scope conversion.Scope) error {\n\t\treturn Convert_discovery_APIResourceList_To_v1_APIResourceList(a.(*discovery.APIResourceList), b.(*APIResourceList), scope)\n\t}); err != nil {\n\t\treturn err\n\t}\n\tif err := s.AddGeneratedConversionFunc((*APIService)(nil), (*discovery.APIService)(nil), func(a, b interface{}, scope conversion.Scope) error {\n\t\treturn Convert_v1_APIService_To_discovery_APIService(a.(*APIService), b.(*discovery.APIService), scope)\n\t}); err != nil {\n\t\treturn err\n\t}\n\tif err := s.AddGeneratedConversionFunc((*discovery.APIService)(nil), (*APIService)(nil), func(a, b interface{}, scope conversion.Scope) error {\n\t\treturn Convert_discovery_APIService_To_v1_APIService(a.(*discovery.APIService), b.(*APIService), scope)\n\t}); err != nil {\n\t\treturn err\n\t}\n\tif err := s.AddGeneratedConversionFunc((*APIServiceList)(nil), (*discovery.APIServiceList)(nil), func(a, b interface{}, scope conversion.Scope) error {\n\t\treturn Convert_v1_APIServiceList_To_discovery_APIServiceList(a.(*APIServiceList), b.(*discovery.APIServiceList), scope)\n\t}); err != nil {\n\t\treturn err\n\t}\n\tif err := s.AddGeneratedConversionFunc((*discovery.APIServiceList)(nil), (*APIServiceList)(nil), func(a, b interface{}, scope conversion.Scope) error {\n\t\treturn Convert_discovery_APIServiceList_To_v1_APIServiceList(a.(*discovery.APIServiceList), b.(*APIServiceList), scope)\n\t}); err != nil {\n\t\treturn err\n\t}\n\tif err := s.AddGeneratedConversionFunc((*APIServiceSpec)(nil), (*discovery.APIServiceSpec)(nil), func(a, b interface{}, scope conversion.Scope) error {\n\t\treturn Convert_v1_APIServiceSpec_To_discovery_APIServiceSpec(a.(*APIServiceSpec), b.(*discovery.APIServiceSpec), scope)\n\t}); err != nil {\n\t\treturn err\n\t}\n\tif err := s.AddGeneratedConversionFunc((*discovery.APIServiceSpec)(nil), (*APIServiceSpec)(nil), func(a, b interface{}, scope conversion.Scope) error {\n\t\treturn Convert_discovery_APIServiceSpec_To_v1_APIServiceSpec(a.(*discovery.APIServiceSpec), b.(*APIServiceSpec), scope)\n\t}); err != nil {\n\t\treturn err\n\t}\n\tif err := s.AddGeneratedConversionFunc((*GroupVersionForDiscovery)(nil), (*discovery.GroupVersionForDiscovery)(nil), func(a, b interface{}, scope conversion.Scope) error {\n\t\treturn Convert_v1_GroupVersionForDiscovery_To_discovery_GroupVersionForDiscovery(a.(*GroupVersionForDiscovery), b.(*discovery.GroupVersionForDiscovery), scope)\n\t}); err != nil {\n\t\treturn err\n\t}\n\tif err := s.AddGeneratedConversionFunc((*discovery.GroupVersionForDiscovery)(nil), (*GroupVersionForDiscovery)(nil), func(a, b interface{}, scope conversion.Scope) error {\n\t\treturn Convert_discovery_GroupVersionForDiscovery_To_v1_GroupVersionForDiscovery(a.(*discovery.GroupVersionForDiscovery), b.(*GroupVersionForDiscovery), scope)\n\t}); err != nil {\n\t\treturn err\n\t}\n\treturn nil\n}", "title": "" }, { "docid": "747bf1995c85979396fb0fd7816b6536", "score": "0.7127698", "text": "func RegisterConversions(s *runtime.Scheme) error {\n\tif err := s.AddGeneratedConversionFunc((*APIServerLoadBalancer)(nil), (*v1alpha7.APIServerLoadBalancer)(nil), func(a, b interface{}, scope conversion.Scope) error {\n\t\treturn Convert_v1alpha6_APIServerLoadBalancer_To_v1alpha7_APIServerLoadBalancer(a.(*APIServerLoadBalancer), b.(*v1alpha7.APIServerLoadBalancer), scope)\n\t}); err != nil {\n\t\treturn err\n\t}\n\tif err := s.AddGeneratedConversionFunc((*v1alpha7.APIServerLoadBalancer)(nil), (*APIServerLoadBalancer)(nil), func(a, b interface{}, scope conversion.Scope) error {\n\t\treturn Convert_v1alpha7_APIServerLoadBalancer_To_v1alpha6_APIServerLoadBalancer(a.(*v1alpha7.APIServerLoadBalancer), b.(*APIServerLoadBalancer), scope)\n\t}); err != nil {\n\t\treturn err\n\t}\n\tif err := s.AddGeneratedConversionFunc((*AddressPair)(nil), (*v1alpha7.AddressPair)(nil), func(a, b interface{}, scope conversion.Scope) error {\n\t\treturn Convert_v1alpha6_AddressPair_To_v1alpha7_AddressPair(a.(*AddressPair), b.(*v1alpha7.AddressPair), scope)\n\t}); err != nil {\n\t\treturn err\n\t}\n\tif err := s.AddGeneratedConversionFunc((*v1alpha7.AddressPair)(nil), (*AddressPair)(nil), func(a, b interface{}, scope conversion.Scope) error {\n\t\treturn Convert_v1alpha7_AddressPair_To_v1alpha6_AddressPair(a.(*v1alpha7.AddressPair), b.(*AddressPair), scope)\n\t}); err != nil {\n\t\treturn err\n\t}\n\tif err := s.AddGeneratedConversionFunc((*Bastion)(nil), (*v1alpha7.Bastion)(nil), func(a, b interface{}, scope conversion.Scope) error {\n\t\treturn Convert_v1alpha6_Bastion_To_v1alpha7_Bastion(a.(*Bastion), b.(*v1alpha7.Bastion), scope)\n\t}); err != nil {\n\t\treturn err\n\t}\n\tif err := s.AddGeneratedConversionFunc((*v1alpha7.Bastion)(nil), (*Bastion)(nil), func(a, b interface{}, scope conversion.Scope) error {\n\t\treturn Convert_v1alpha7_Bastion_To_v1alpha6_Bastion(a.(*v1alpha7.Bastion), b.(*Bastion), scope)\n\t}); err != nil {\n\t\treturn err\n\t}\n\tif err := s.AddGeneratedConversionFunc((*ExternalRouterIPParam)(nil), (*v1alpha7.ExternalRouterIPParam)(nil), func(a, b interface{}, scope conversion.Scope) error {\n\t\treturn Convert_v1alpha6_ExternalRouterIPParam_To_v1alpha7_ExternalRouterIPParam(a.(*ExternalRouterIPParam), b.(*v1alpha7.ExternalRouterIPParam), scope)\n\t}); err != nil {\n\t\treturn err\n\t}\n\tif err := s.AddGeneratedConversionFunc((*v1alpha7.ExternalRouterIPParam)(nil), (*ExternalRouterIPParam)(nil), func(a, b interface{}, scope conversion.Scope) error {\n\t\treturn Convert_v1alpha7_ExternalRouterIPParam_To_v1alpha6_ExternalRouterIPParam(a.(*v1alpha7.ExternalRouterIPParam), b.(*ExternalRouterIPParam), scope)\n\t}); err != nil {\n\t\treturn err\n\t}\n\tif err := s.AddGeneratedConversionFunc((*FixedIP)(nil), (*v1alpha7.FixedIP)(nil), func(a, b interface{}, scope conversion.Scope) error {\n\t\treturn Convert_v1alpha6_FixedIP_To_v1alpha7_FixedIP(a.(*FixedIP), b.(*v1alpha7.FixedIP), scope)\n\t}); err != nil {\n\t\treturn err\n\t}\n\tif err := s.AddGeneratedConversionFunc((*v1alpha7.FixedIP)(nil), (*FixedIP)(nil), func(a, b interface{}, scope conversion.Scope) error {\n\t\treturn Convert_v1alpha7_FixedIP_To_v1alpha6_FixedIP(a.(*v1alpha7.FixedIP), b.(*FixedIP), scope)\n\t}); err != nil {\n\t\treturn err\n\t}\n\tif err := s.AddGeneratedConversionFunc((*LoadBalancer)(nil), (*v1alpha7.LoadBalancer)(nil), func(a, b interface{}, scope conversion.Scope) error {\n\t\treturn Convert_v1alpha6_LoadBalancer_To_v1alpha7_LoadBalancer(a.(*LoadBalancer), b.(*v1alpha7.LoadBalancer), scope)\n\t}); err != nil {\n\t\treturn err\n\t}\n\tif err := s.AddGeneratedConversionFunc((*v1alpha7.LoadBalancer)(nil), (*LoadBalancer)(nil), func(a, b interface{}, scope conversion.Scope) error {\n\t\treturn Convert_v1alpha7_LoadBalancer_To_v1alpha6_LoadBalancer(a.(*v1alpha7.LoadBalancer), b.(*LoadBalancer), scope)\n\t}); err != nil {\n\t\treturn err\n\t}\n\tif err := s.AddGeneratedConversionFunc((*NetworkFilter)(nil), (*v1alpha7.NetworkFilter)(nil), func(a, b interface{}, scope conversion.Scope) error {\n\t\treturn Convert_v1alpha6_NetworkFilter_To_v1alpha7_NetworkFilter(a.(*NetworkFilter), b.(*v1alpha7.NetworkFilter), scope)\n\t}); err != nil {\n\t\treturn err\n\t}\n\tif err := s.AddGeneratedConversionFunc((*v1alpha7.NetworkFilter)(nil), (*NetworkFilter)(nil), func(a, b interface{}, scope conversion.Scope) error {\n\t\treturn Convert_v1alpha7_NetworkFilter_To_v1alpha6_NetworkFilter(a.(*v1alpha7.NetworkFilter), b.(*NetworkFilter), scope)\n\t}); err != nil {\n\t\treturn err\n\t}\n\tif err := s.AddGeneratedConversionFunc((*OpenStackCluster)(nil), (*v1alpha7.OpenStackCluster)(nil), func(a, b interface{}, scope conversion.Scope) error {\n\t\treturn Convert_v1alpha6_OpenStackCluster_To_v1alpha7_OpenStackCluster(a.(*OpenStackCluster), b.(*v1alpha7.OpenStackCluster), scope)\n\t}); err != nil {\n\t\treturn err\n\t}\n\tif err := s.AddGeneratedConversionFunc((*v1alpha7.OpenStackCluster)(nil), (*OpenStackCluster)(nil), func(a, b interface{}, scope conversion.Scope) error {\n\t\treturn Convert_v1alpha7_OpenStackCluster_To_v1alpha6_OpenStackCluster(a.(*v1alpha7.OpenStackCluster), b.(*OpenStackCluster), scope)\n\t}); err != nil {\n\t\treturn err\n\t}\n\tif err := s.AddGeneratedConversionFunc((*OpenStackClusterList)(nil), (*v1alpha7.OpenStackClusterList)(nil), func(a, b interface{}, scope conversion.Scope) error {\n\t\treturn Convert_v1alpha6_OpenStackClusterList_To_v1alpha7_OpenStackClusterList(a.(*OpenStackClusterList), b.(*v1alpha7.OpenStackClusterList), scope)\n\t}); err != nil {\n\t\treturn err\n\t}\n\tif err := s.AddGeneratedConversionFunc((*v1alpha7.OpenStackClusterList)(nil), (*OpenStackClusterList)(nil), func(a, b interface{}, scope conversion.Scope) error {\n\t\treturn Convert_v1alpha7_OpenStackClusterList_To_v1alpha6_OpenStackClusterList(a.(*v1alpha7.OpenStackClusterList), b.(*OpenStackClusterList), scope)\n\t}); err != nil {\n\t\treturn err\n\t}\n\tif err := s.AddGeneratedConversionFunc((*OpenStackClusterSpec)(nil), (*v1alpha7.OpenStackClusterSpec)(nil), func(a, b interface{}, scope conversion.Scope) error {\n\t\treturn Convert_v1alpha6_OpenStackClusterSpec_To_v1alpha7_OpenStackClusterSpec(a.(*OpenStackClusterSpec), b.(*v1alpha7.OpenStackClusterSpec), scope)\n\t}); err != nil {\n\t\treturn err\n\t}\n\tif err := s.AddGeneratedConversionFunc((*OpenStackClusterTemplate)(nil), (*v1alpha7.OpenStackClusterTemplate)(nil), func(a, b interface{}, scope conversion.Scope) error {\n\t\treturn Convert_v1alpha6_OpenStackClusterTemplate_To_v1alpha7_OpenStackClusterTemplate(a.(*OpenStackClusterTemplate), b.(*v1alpha7.OpenStackClusterTemplate), scope)\n\t}); err != nil {\n\t\treturn err\n\t}\n\tif err := s.AddGeneratedConversionFunc((*v1alpha7.OpenStackClusterTemplate)(nil), (*OpenStackClusterTemplate)(nil), func(a, b interface{}, scope conversion.Scope) error {\n\t\treturn Convert_v1alpha7_OpenStackClusterTemplate_To_v1alpha6_OpenStackClusterTemplate(a.(*v1alpha7.OpenStackClusterTemplate), b.(*OpenStackClusterTemplate), scope)\n\t}); err != nil {\n\t\treturn err\n\t}\n\tif err := s.AddGeneratedConversionFunc((*OpenStackClusterTemplateList)(nil), (*v1alpha7.OpenStackClusterTemplateList)(nil), func(a, b interface{}, scope conversion.Scope) error {\n\t\treturn Convert_v1alpha6_OpenStackClusterTemplateList_To_v1alpha7_OpenStackClusterTemplateList(a.(*OpenStackClusterTemplateList), b.(*v1alpha7.OpenStackClusterTemplateList), scope)\n\t}); err != nil {\n\t\treturn err\n\t}\n\tif err := s.AddGeneratedConversionFunc((*v1alpha7.OpenStackClusterTemplateList)(nil), (*OpenStackClusterTemplateList)(nil), func(a, b interface{}, scope conversion.Scope) error {\n\t\treturn Convert_v1alpha7_OpenStackClusterTemplateList_To_v1alpha6_OpenStackClusterTemplateList(a.(*v1alpha7.OpenStackClusterTemplateList), b.(*OpenStackClusterTemplateList), scope)\n\t}); err != nil {\n\t\treturn err\n\t}\n\tif err := s.AddGeneratedConversionFunc((*OpenStackClusterTemplateResource)(nil), (*v1alpha7.OpenStackClusterTemplateResource)(nil), func(a, b interface{}, scope conversion.Scope) error {\n\t\treturn Convert_v1alpha6_OpenStackClusterTemplateResource_To_v1alpha7_OpenStackClusterTemplateResource(a.(*OpenStackClusterTemplateResource), b.(*v1alpha7.OpenStackClusterTemplateResource), scope)\n\t}); err != nil {\n\t\treturn err\n\t}\n\tif err := s.AddGeneratedConversionFunc((*v1alpha7.OpenStackClusterTemplateResource)(nil), (*OpenStackClusterTemplateResource)(nil), func(a, b interface{}, scope conversion.Scope) error {\n\t\treturn Convert_v1alpha7_OpenStackClusterTemplateResource_To_v1alpha6_OpenStackClusterTemplateResource(a.(*v1alpha7.OpenStackClusterTemplateResource), b.(*OpenStackClusterTemplateResource), scope)\n\t}); err != nil {\n\t\treturn err\n\t}\n\tif err := s.AddGeneratedConversionFunc((*OpenStackClusterTemplateSpec)(nil), (*v1alpha7.OpenStackClusterTemplateSpec)(nil), func(a, b interface{}, scope conversion.Scope) error {\n\t\treturn Convert_v1alpha6_OpenStackClusterTemplateSpec_To_v1alpha7_OpenStackClusterTemplateSpec(a.(*OpenStackClusterTemplateSpec), b.(*v1alpha7.OpenStackClusterTemplateSpec), scope)\n\t}); err != nil {\n\t\treturn err\n\t}\n\tif err := s.AddGeneratedConversionFunc((*v1alpha7.OpenStackClusterTemplateSpec)(nil), (*OpenStackClusterTemplateSpec)(nil), func(a, b interface{}, scope conversion.Scope) error {\n\t\treturn Convert_v1alpha7_OpenStackClusterTemplateSpec_To_v1alpha6_OpenStackClusterTemplateSpec(a.(*v1alpha7.OpenStackClusterTemplateSpec), b.(*OpenStackClusterTemplateSpec), scope)\n\t}); err != nil {\n\t\treturn err\n\t}\n\tif err := s.AddGeneratedConversionFunc((*OpenStackIdentityReference)(nil), (*v1alpha7.OpenStackIdentityReference)(nil), func(a, b interface{}, scope conversion.Scope) error {\n\t\treturn Convert_v1alpha6_OpenStackIdentityReference_To_v1alpha7_OpenStackIdentityReference(a.(*OpenStackIdentityReference), b.(*v1alpha7.OpenStackIdentityReference), scope)\n\t}); err != nil {\n\t\treturn err\n\t}\n\tif err := s.AddGeneratedConversionFunc((*v1alpha7.OpenStackIdentityReference)(nil), (*OpenStackIdentityReference)(nil), func(a, b interface{}, scope conversion.Scope) error {\n\t\treturn Convert_v1alpha7_OpenStackIdentityReference_To_v1alpha6_OpenStackIdentityReference(a.(*v1alpha7.OpenStackIdentityReference), b.(*OpenStackIdentityReference), scope)\n\t}); err != nil {\n\t\treturn err\n\t}\n\tif err := s.AddGeneratedConversionFunc((*OpenStackMachine)(nil), (*v1alpha7.OpenStackMachine)(nil), func(a, b interface{}, scope conversion.Scope) error {\n\t\treturn Convert_v1alpha6_OpenStackMachine_To_v1alpha7_OpenStackMachine(a.(*OpenStackMachine), b.(*v1alpha7.OpenStackMachine), scope)\n\t}); err != nil {\n\t\treturn err\n\t}\n\tif err := s.AddGeneratedConversionFunc((*v1alpha7.OpenStackMachine)(nil), (*OpenStackMachine)(nil), func(a, b interface{}, scope conversion.Scope) error {\n\t\treturn Convert_v1alpha7_OpenStackMachine_To_v1alpha6_OpenStackMachine(a.(*v1alpha7.OpenStackMachine), b.(*OpenStackMachine), scope)\n\t}); err != nil {\n\t\treturn err\n\t}\n\tif err := s.AddGeneratedConversionFunc((*OpenStackMachineList)(nil), (*v1alpha7.OpenStackMachineList)(nil), func(a, b interface{}, scope conversion.Scope) error {\n\t\treturn Convert_v1alpha6_OpenStackMachineList_To_v1alpha7_OpenStackMachineList(a.(*OpenStackMachineList), b.(*v1alpha7.OpenStackMachineList), scope)\n\t}); err != nil {\n\t\treturn err\n\t}\n\tif err := s.AddGeneratedConversionFunc((*v1alpha7.OpenStackMachineList)(nil), (*OpenStackMachineList)(nil), func(a, b interface{}, scope conversion.Scope) error {\n\t\treturn Convert_v1alpha7_OpenStackMachineList_To_v1alpha6_OpenStackMachineList(a.(*v1alpha7.OpenStackMachineList), b.(*OpenStackMachineList), scope)\n\t}); err != nil {\n\t\treturn err\n\t}\n\tif err := s.AddGeneratedConversionFunc((*v1alpha7.OpenStackMachineSpec)(nil), (*OpenStackMachineSpec)(nil), func(a, b interface{}, scope conversion.Scope) error {\n\t\treturn Convert_v1alpha7_OpenStackMachineSpec_To_v1alpha6_OpenStackMachineSpec(a.(*v1alpha7.OpenStackMachineSpec), b.(*OpenStackMachineSpec), scope)\n\t}); err != nil {\n\t\treturn err\n\t}\n\tif err := s.AddGeneratedConversionFunc((*OpenStackMachineStatus)(nil), (*v1alpha7.OpenStackMachineStatus)(nil), func(a, b interface{}, scope conversion.Scope) error {\n\t\treturn Convert_v1alpha6_OpenStackMachineStatus_To_v1alpha7_OpenStackMachineStatus(a.(*OpenStackMachineStatus), b.(*v1alpha7.OpenStackMachineStatus), scope)\n\t}); err != nil {\n\t\treturn err\n\t}\n\tif err := s.AddGeneratedConversionFunc((*v1alpha7.OpenStackMachineStatus)(nil), (*OpenStackMachineStatus)(nil), func(a, b interface{}, scope conversion.Scope) error {\n\t\treturn Convert_v1alpha7_OpenStackMachineStatus_To_v1alpha6_OpenStackMachineStatus(a.(*v1alpha7.OpenStackMachineStatus), b.(*OpenStackMachineStatus), scope)\n\t}); err != nil {\n\t\treturn err\n\t}\n\tif err := s.AddGeneratedConversionFunc((*OpenStackMachineTemplate)(nil), (*v1alpha7.OpenStackMachineTemplate)(nil), func(a, b interface{}, scope conversion.Scope) error {\n\t\treturn Convert_v1alpha6_OpenStackMachineTemplate_To_v1alpha7_OpenStackMachineTemplate(a.(*OpenStackMachineTemplate), b.(*v1alpha7.OpenStackMachineTemplate), scope)\n\t}); err != nil {\n\t\treturn err\n\t}\n\tif err := s.AddGeneratedConversionFunc((*v1alpha7.OpenStackMachineTemplate)(nil), (*OpenStackMachineTemplate)(nil), func(a, b interface{}, scope conversion.Scope) error {\n\t\treturn Convert_v1alpha7_OpenStackMachineTemplate_To_v1alpha6_OpenStackMachineTemplate(a.(*v1alpha7.OpenStackMachineTemplate), b.(*OpenStackMachineTemplate), scope)\n\t}); err != nil {\n\t\treturn err\n\t}\n\tif err := s.AddGeneratedConversionFunc((*OpenStackMachineTemplateList)(nil), (*v1alpha7.OpenStackMachineTemplateList)(nil), func(a, b interface{}, scope conversion.Scope) error {\n\t\treturn Convert_v1alpha6_OpenStackMachineTemplateList_To_v1alpha7_OpenStackMachineTemplateList(a.(*OpenStackMachineTemplateList), b.(*v1alpha7.OpenStackMachineTemplateList), scope)\n\t}); err != nil {\n\t\treturn err\n\t}\n\tif err := s.AddGeneratedConversionFunc((*v1alpha7.OpenStackMachineTemplateList)(nil), (*OpenStackMachineTemplateList)(nil), func(a, b interface{}, scope conversion.Scope) error {\n\t\treturn Convert_v1alpha7_OpenStackMachineTemplateList_To_v1alpha6_OpenStackMachineTemplateList(a.(*v1alpha7.OpenStackMachineTemplateList), b.(*OpenStackMachineTemplateList), scope)\n\t}); err != nil {\n\t\treturn err\n\t}\n\tif err := s.AddGeneratedConversionFunc((*OpenStackMachineTemplateResource)(nil), (*v1alpha7.OpenStackMachineTemplateResource)(nil), func(a, b interface{}, scope conversion.Scope) error {\n\t\treturn Convert_v1alpha6_OpenStackMachineTemplateResource_To_v1alpha7_OpenStackMachineTemplateResource(a.(*OpenStackMachineTemplateResource), b.(*v1alpha7.OpenStackMachineTemplateResource), scope)\n\t}); err != nil {\n\t\treturn err\n\t}\n\tif err := s.AddGeneratedConversionFunc((*v1alpha7.OpenStackMachineTemplateResource)(nil), (*OpenStackMachineTemplateResource)(nil), func(a, b interface{}, scope conversion.Scope) error {\n\t\treturn Convert_v1alpha7_OpenStackMachineTemplateResource_To_v1alpha6_OpenStackMachineTemplateResource(a.(*v1alpha7.OpenStackMachineTemplateResource), b.(*OpenStackMachineTemplateResource), scope)\n\t}); err != nil {\n\t\treturn err\n\t}\n\tif err := s.AddGeneratedConversionFunc((*OpenStackMachineTemplateSpec)(nil), (*v1alpha7.OpenStackMachineTemplateSpec)(nil), func(a, b interface{}, scope conversion.Scope) error {\n\t\treturn Convert_v1alpha6_OpenStackMachineTemplateSpec_To_v1alpha7_OpenStackMachineTemplateSpec(a.(*OpenStackMachineTemplateSpec), b.(*v1alpha7.OpenStackMachineTemplateSpec), scope)\n\t}); err != nil {\n\t\treturn err\n\t}\n\tif err := s.AddGeneratedConversionFunc((*v1alpha7.OpenStackMachineTemplateSpec)(nil), (*OpenStackMachineTemplateSpec)(nil), func(a, b interface{}, scope conversion.Scope) error {\n\t\treturn Convert_v1alpha7_OpenStackMachineTemplateSpec_To_v1alpha6_OpenStackMachineTemplateSpec(a.(*v1alpha7.OpenStackMachineTemplateSpec), b.(*OpenStackMachineTemplateSpec), scope)\n\t}); err != nil {\n\t\treturn err\n\t}\n\tif err := s.AddGeneratedConversionFunc((*RootVolume)(nil), (*v1alpha7.RootVolume)(nil), func(a, b interface{}, scope conversion.Scope) error {\n\t\treturn Convert_v1alpha6_RootVolume_To_v1alpha7_RootVolume(a.(*RootVolume), b.(*v1alpha7.RootVolume), scope)\n\t}); err != nil {\n\t\treturn err\n\t}\n\tif err := s.AddGeneratedConversionFunc((*v1alpha7.RootVolume)(nil), (*RootVolume)(nil), func(a, b interface{}, scope conversion.Scope) error {\n\t\treturn Convert_v1alpha7_RootVolume_To_v1alpha6_RootVolume(a.(*v1alpha7.RootVolume), b.(*RootVolume), scope)\n\t}); err != nil {\n\t\treturn err\n\t}\n\tif err := s.AddGeneratedConversionFunc((*Router)(nil), (*v1alpha7.Router)(nil), func(a, b interface{}, scope conversion.Scope) error {\n\t\treturn Convert_v1alpha6_Router_To_v1alpha7_Router(a.(*Router), b.(*v1alpha7.Router), scope)\n\t}); err != nil {\n\t\treturn err\n\t}\n\tif err := s.AddGeneratedConversionFunc((*v1alpha7.Router)(nil), (*Router)(nil), func(a, b interface{}, scope conversion.Scope) error {\n\t\treturn Convert_v1alpha7_Router_To_v1alpha6_Router(a.(*v1alpha7.Router), b.(*Router), scope)\n\t}); err != nil {\n\t\treturn err\n\t}\n\tif err := s.AddGeneratedConversionFunc((*SecurityGroup)(nil), (*v1alpha7.SecurityGroup)(nil), func(a, b interface{}, scope conversion.Scope) error {\n\t\treturn Convert_v1alpha6_SecurityGroup_To_v1alpha7_SecurityGroup(a.(*SecurityGroup), b.(*v1alpha7.SecurityGroup), scope)\n\t}); err != nil {\n\t\treturn err\n\t}\n\tif err := s.AddGeneratedConversionFunc((*v1alpha7.SecurityGroup)(nil), (*SecurityGroup)(nil), func(a, b interface{}, scope conversion.Scope) error {\n\t\treturn Convert_v1alpha7_SecurityGroup_To_v1alpha6_SecurityGroup(a.(*v1alpha7.SecurityGroup), b.(*SecurityGroup), scope)\n\t}); err != nil {\n\t\treturn err\n\t}\n\tif err := s.AddGeneratedConversionFunc((*v1alpha7.SecurityGroupFilter)(nil), (*SecurityGroupFilter)(nil), func(a, b interface{}, scope conversion.Scope) error {\n\t\treturn Convert_v1alpha7_SecurityGroupFilter_To_v1alpha6_SecurityGroupFilter(a.(*v1alpha7.SecurityGroupFilter), b.(*SecurityGroupFilter), scope)\n\t}); err != nil {\n\t\treturn err\n\t}\n\tif err := s.AddGeneratedConversionFunc((*SecurityGroupRule)(nil), (*v1alpha7.SecurityGroupRule)(nil), func(a, b interface{}, scope conversion.Scope) error {\n\t\treturn Convert_v1alpha6_SecurityGroupRule_To_v1alpha7_SecurityGroupRule(a.(*SecurityGroupRule), b.(*v1alpha7.SecurityGroupRule), scope)\n\t}); err != nil {\n\t\treturn err\n\t}\n\tif err := s.AddGeneratedConversionFunc((*v1alpha7.SecurityGroupRule)(nil), (*SecurityGroupRule)(nil), func(a, b interface{}, scope conversion.Scope) error {\n\t\treturn Convert_v1alpha7_SecurityGroupRule_To_v1alpha6_SecurityGroupRule(a.(*v1alpha7.SecurityGroupRule), b.(*SecurityGroupRule), scope)\n\t}); err != nil {\n\t\treturn err\n\t}\n\tif err := s.AddGeneratedConversionFunc((*Subnet)(nil), (*v1alpha7.Subnet)(nil), func(a, b interface{}, scope conversion.Scope) error {\n\t\treturn Convert_v1alpha6_Subnet_To_v1alpha7_Subnet(a.(*Subnet), b.(*v1alpha7.Subnet), scope)\n\t}); err != nil {\n\t\treturn err\n\t}\n\tif err := s.AddGeneratedConversionFunc((*v1alpha7.Subnet)(nil), (*Subnet)(nil), func(a, b interface{}, scope conversion.Scope) error {\n\t\treturn Convert_v1alpha7_Subnet_To_v1alpha6_Subnet(a.(*v1alpha7.Subnet), b.(*Subnet), scope)\n\t}); err != nil {\n\t\treturn err\n\t}\n\tif err := s.AddGeneratedConversionFunc((*SubnetFilter)(nil), (*v1alpha7.SubnetFilter)(nil), func(a, b interface{}, scope conversion.Scope) error {\n\t\treturn Convert_v1alpha6_SubnetFilter_To_v1alpha7_SubnetFilter(a.(*SubnetFilter), b.(*v1alpha7.SubnetFilter), scope)\n\t}); err != nil {\n\t\treturn err\n\t}\n\tif err := s.AddGeneratedConversionFunc((*v1alpha7.SubnetFilter)(nil), (*SubnetFilter)(nil), func(a, b interface{}, scope conversion.Scope) error {\n\t\treturn Convert_v1alpha7_SubnetFilter_To_v1alpha6_SubnetFilter(a.(*v1alpha7.SubnetFilter), b.(*SubnetFilter), scope)\n\t}); err != nil {\n\t\treturn err\n\t}\n\tif err := s.AddGeneratedConversionFunc((*ValueSpec)(nil), (*v1alpha7.ValueSpec)(nil), func(a, b interface{}, scope conversion.Scope) error {\n\t\treturn Convert_v1alpha6_ValueSpec_To_v1alpha7_ValueSpec(a.(*ValueSpec), b.(*v1alpha7.ValueSpec), scope)\n\t}); err != nil {\n\t\treturn err\n\t}\n\tif err := s.AddGeneratedConversionFunc((*v1alpha7.ValueSpec)(nil), (*ValueSpec)(nil), func(a, b interface{}, scope conversion.Scope) error {\n\t\treturn Convert_v1alpha7_ValueSpec_To_v1alpha6_ValueSpec(a.(*v1alpha7.ValueSpec), b.(*ValueSpec), scope)\n\t}); err != nil {\n\t\treturn err\n\t}\n\tif err := s.AddConversionFunc((*Instance)(nil), (*v1alpha7.BastionStatus)(nil), func(a, b interface{}, scope conversion.Scope) error {\n\t\treturn Convert_v1alpha6_Instance_To_v1alpha7_BastionStatus(a.(*Instance), b.(*v1alpha7.BastionStatus), scope)\n\t}); err != nil {\n\t\treturn err\n\t}\n\tif err := s.AddConversionFunc((*Network)(nil), (*v1alpha7.NetworkStatus)(nil), func(a, b interface{}, scope conversion.Scope) error {\n\t\treturn Convert_v1alpha6_Network_To_v1alpha7_NetworkStatus(a.(*Network), b.(*v1alpha7.NetworkStatus), scope)\n\t}); err != nil {\n\t\treturn err\n\t}\n\tif err := s.AddConversionFunc((*Network)(nil), (*v1alpha7.NetworkStatusWithSubnets)(nil), func(a, b interface{}, scope conversion.Scope) error {\n\t\treturn Convert_v1alpha6_Network_To_v1alpha7_NetworkStatusWithSubnets(a.(*Network), b.(*v1alpha7.NetworkStatusWithSubnets), scope)\n\t}); err != nil {\n\t\treturn err\n\t}\n\tif err := s.AddConversionFunc((*OpenStackClusterStatus)(nil), (*v1alpha7.OpenStackClusterStatus)(nil), func(a, b interface{}, scope conversion.Scope) error {\n\t\treturn Convert_v1alpha6_OpenStackClusterStatus_To_v1alpha7_OpenStackClusterStatus(a.(*OpenStackClusterStatus), b.(*v1alpha7.OpenStackClusterStatus), scope)\n\t}); err != nil {\n\t\treturn err\n\t}\n\tif err := s.AddConversionFunc((*OpenStackMachineSpec)(nil), (*v1alpha7.OpenStackMachineSpec)(nil), func(a, b interface{}, scope conversion.Scope) error {\n\t\treturn Convert_v1alpha6_OpenStackMachineSpec_To_v1alpha7_OpenStackMachineSpec(a.(*OpenStackMachineSpec), b.(*v1alpha7.OpenStackMachineSpec), scope)\n\t}); err != nil {\n\t\treturn err\n\t}\n\tif err := s.AddConversionFunc((*PortOpts)(nil), (*v1alpha7.PortOpts)(nil), func(a, b interface{}, scope conversion.Scope) error {\n\t\treturn Convert_v1alpha6_PortOpts_To_v1alpha7_PortOpts(a.(*PortOpts), b.(*v1alpha7.PortOpts), scope)\n\t}); err != nil {\n\t\treturn err\n\t}\n\tif err := s.AddConversionFunc((*SecurityGroupFilter)(nil), (*v1alpha7.SecurityGroupFilter)(nil), func(a, b interface{}, scope conversion.Scope) error {\n\t\treturn Convert_v1alpha6_SecurityGroupFilter_To_v1alpha7_SecurityGroupFilter(a.(*SecurityGroupFilter), b.(*v1alpha7.SecurityGroupFilter), scope)\n\t}); err != nil {\n\t\treturn err\n\t}\n\tif err := s.AddConversionFunc((*SecurityGroupParam)(nil), (*v1alpha7.SecurityGroupFilter)(nil), func(a, b interface{}, scope conversion.Scope) error {\n\t\treturn Convert_v1alpha6_SecurityGroupParam_To_v1alpha7_SecurityGroupFilter(a.(*SecurityGroupParam), b.(*v1alpha7.SecurityGroupFilter), scope)\n\t}); err != nil {\n\t\treturn err\n\t}\n\tif err := s.AddConversionFunc((*SubnetParam)(nil), (*v1alpha7.SubnetFilter)(nil), func(a, b interface{}, scope conversion.Scope) error {\n\t\treturn Convert_v1alpha6_SubnetParam_To_v1alpha7_SubnetFilter(a.(*SubnetParam), b.(*v1alpha7.SubnetFilter), scope)\n\t}); err != nil {\n\t\treturn err\n\t}\n\tif err := s.AddConversionFunc((*v1alpha7.BastionStatus)(nil), (*Instance)(nil), func(a, b interface{}, scope conversion.Scope) error {\n\t\treturn Convert_v1alpha7_BastionStatus_To_v1alpha6_Instance(a.(*v1alpha7.BastionStatus), b.(*Instance), scope)\n\t}); err != nil {\n\t\treturn err\n\t}\n\tif err := s.AddConversionFunc((*v1alpha7.NetworkStatusWithSubnets)(nil), (*Network)(nil), func(a, b interface{}, scope conversion.Scope) error {\n\t\treturn Convert_v1alpha7_NetworkStatusWithSubnets_To_v1alpha6_Network(a.(*v1alpha7.NetworkStatusWithSubnets), b.(*Network), scope)\n\t}); err != nil {\n\t\treturn err\n\t}\n\tif err := s.AddConversionFunc((*v1alpha7.NetworkStatus)(nil), (*Network)(nil), func(a, b interface{}, scope conversion.Scope) error {\n\t\treturn Convert_v1alpha7_NetworkStatus_To_v1alpha6_Network(a.(*v1alpha7.NetworkStatus), b.(*Network), scope)\n\t}); err != nil {\n\t\treturn err\n\t}\n\tif err := s.AddConversionFunc((*v1alpha7.OpenStackClusterSpec)(nil), (*OpenStackClusterSpec)(nil), func(a, b interface{}, scope conversion.Scope) error {\n\t\treturn Convert_v1alpha7_OpenStackClusterSpec_To_v1alpha6_OpenStackClusterSpec(a.(*v1alpha7.OpenStackClusterSpec), b.(*OpenStackClusterSpec), scope)\n\t}); err != nil {\n\t\treturn err\n\t}\n\tif err := s.AddConversionFunc((*v1alpha7.OpenStackClusterStatus)(nil), (*OpenStackClusterStatus)(nil), func(a, b interface{}, scope conversion.Scope) error {\n\t\treturn Convert_v1alpha7_OpenStackClusterStatus_To_v1alpha6_OpenStackClusterStatus(a.(*v1alpha7.OpenStackClusterStatus), b.(*OpenStackClusterStatus), scope)\n\t}); err != nil {\n\t\treturn err\n\t}\n\tif err := s.AddConversionFunc((*v1alpha7.PortOpts)(nil), (*PortOpts)(nil), func(a, b interface{}, scope conversion.Scope) error {\n\t\treturn Convert_v1alpha7_PortOpts_To_v1alpha6_PortOpts(a.(*v1alpha7.PortOpts), b.(*PortOpts), scope)\n\t}); err != nil {\n\t\treturn err\n\t}\n\tif err := s.AddConversionFunc((*v1alpha7.SecurityGroupFilter)(nil), (*SecurityGroupParam)(nil), func(a, b interface{}, scope conversion.Scope) error {\n\t\treturn Convert_v1alpha7_SecurityGroupFilter_To_v1alpha6_SecurityGroupParam(a.(*v1alpha7.SecurityGroupFilter), b.(*SecurityGroupParam), scope)\n\t}); err != nil {\n\t\treturn err\n\t}\n\tif err := s.AddConversionFunc((*v1alpha7.SubnetFilter)(nil), (*SubnetParam)(nil), func(a, b interface{}, scope conversion.Scope) error {\n\t\treturn Convert_v1alpha7_SubnetFilter_To_v1alpha6_SubnetParam(a.(*v1alpha7.SubnetFilter), b.(*SubnetParam), scope)\n\t}); err != nil {\n\t\treturn err\n\t}\n\treturn nil\n}", "title": "" }, { "docid": "cceb7dab6c2c3d916e9381c215733a4a", "score": "0.71214503", "text": "func RegisterConversions(s *runtime.Scheme) error {\n\tif err := s.AddGeneratedConversionFunc((*RestrictedEndpointsAdmissionConfig)(nil), (*restrictedendpoints.RestrictedEndpointsAdmissionConfig)(nil), func(a, b interface{}, scope conversion.Scope) error {\n\t\treturn Convert_v1_RestrictedEndpointsAdmissionConfig_To_restrictedendpoints_RestrictedEndpointsAdmissionConfig(a.(*RestrictedEndpointsAdmissionConfig), b.(*restrictedendpoints.RestrictedEndpointsAdmissionConfig), scope)\n\t}); err != nil {\n\t\treturn err\n\t}\n\tif err := s.AddGeneratedConversionFunc((*restrictedendpoints.RestrictedEndpointsAdmissionConfig)(nil), (*RestrictedEndpointsAdmissionConfig)(nil), func(a, b interface{}, scope conversion.Scope) error {\n\t\treturn Convert_restrictedendpoints_RestrictedEndpointsAdmissionConfig_To_v1_RestrictedEndpointsAdmissionConfig(a.(*restrictedendpoints.RestrictedEndpointsAdmissionConfig), b.(*RestrictedEndpointsAdmissionConfig), scope)\n\t}); err != nil {\n\t\treturn err\n\t}\n\treturn nil\n}", "title": "" }, { "docid": "70eb6b95ff3ab13fccf1d70142ff252e", "score": "0.7120103", "text": "func RegisterConversions(s *runtime.Scheme) error {\n\tif err := s.AddGeneratedConversionFunc((*v1alpha1.AllocationResult)(nil), (*resource.AllocationResult)(nil), func(a, b interface{}, scope conversion.Scope) error {\n\t\treturn Convert_v1alpha1_AllocationResult_To_resource_AllocationResult(a.(*v1alpha1.AllocationResult), b.(*resource.AllocationResult), scope)\n\t}); err != nil {\n\t\treturn err\n\t}\n\tif err := s.AddGeneratedConversionFunc((*resource.AllocationResult)(nil), (*v1alpha1.AllocationResult)(nil), func(a, b interface{}, scope conversion.Scope) error {\n\t\treturn Convert_resource_AllocationResult_To_v1alpha1_AllocationResult(a.(*resource.AllocationResult), b.(*v1alpha1.AllocationResult), scope)\n\t}); err != nil {\n\t\treturn err\n\t}\n\tif err := s.AddGeneratedConversionFunc((*v1alpha1.PodScheduling)(nil), (*resource.PodScheduling)(nil), func(a, b interface{}, scope conversion.Scope) error {\n\t\treturn Convert_v1alpha1_PodScheduling_To_resource_PodScheduling(a.(*v1alpha1.PodScheduling), b.(*resource.PodScheduling), scope)\n\t}); err != nil {\n\t\treturn err\n\t}\n\tif err := s.AddGeneratedConversionFunc((*resource.PodScheduling)(nil), (*v1alpha1.PodScheduling)(nil), func(a, b interface{}, scope conversion.Scope) error {\n\t\treturn Convert_resource_PodScheduling_To_v1alpha1_PodScheduling(a.(*resource.PodScheduling), b.(*v1alpha1.PodScheduling), scope)\n\t}); err != nil {\n\t\treturn err\n\t}\n\tif err := s.AddGeneratedConversionFunc((*v1alpha1.PodSchedulingList)(nil), (*resource.PodSchedulingList)(nil), func(a, b interface{}, scope conversion.Scope) error {\n\t\treturn Convert_v1alpha1_PodSchedulingList_To_resource_PodSchedulingList(a.(*v1alpha1.PodSchedulingList), b.(*resource.PodSchedulingList), scope)\n\t}); err != nil {\n\t\treturn err\n\t}\n\tif err := s.AddGeneratedConversionFunc((*resource.PodSchedulingList)(nil), (*v1alpha1.PodSchedulingList)(nil), func(a, b interface{}, scope conversion.Scope) error {\n\t\treturn Convert_resource_PodSchedulingList_To_v1alpha1_PodSchedulingList(a.(*resource.PodSchedulingList), b.(*v1alpha1.PodSchedulingList), scope)\n\t}); err != nil {\n\t\treturn err\n\t}\n\tif err := s.AddGeneratedConversionFunc((*v1alpha1.PodSchedulingSpec)(nil), (*resource.PodSchedulingSpec)(nil), func(a, b interface{}, scope conversion.Scope) error {\n\t\treturn Convert_v1alpha1_PodSchedulingSpec_To_resource_PodSchedulingSpec(a.(*v1alpha1.PodSchedulingSpec), b.(*resource.PodSchedulingSpec), scope)\n\t}); err != nil {\n\t\treturn err\n\t}\n\tif err := s.AddGeneratedConversionFunc((*resource.PodSchedulingSpec)(nil), (*v1alpha1.PodSchedulingSpec)(nil), func(a, b interface{}, scope conversion.Scope) error {\n\t\treturn Convert_resource_PodSchedulingSpec_To_v1alpha1_PodSchedulingSpec(a.(*resource.PodSchedulingSpec), b.(*v1alpha1.PodSchedulingSpec), scope)\n\t}); err != nil {\n\t\treturn err\n\t}\n\tif err := s.AddGeneratedConversionFunc((*v1alpha1.PodSchedulingStatus)(nil), (*resource.PodSchedulingStatus)(nil), func(a, b interface{}, scope conversion.Scope) error {\n\t\treturn Convert_v1alpha1_PodSchedulingStatus_To_resource_PodSchedulingStatus(a.(*v1alpha1.PodSchedulingStatus), b.(*resource.PodSchedulingStatus), scope)\n\t}); err != nil {\n\t\treturn err\n\t}\n\tif err := s.AddGeneratedConversionFunc((*resource.PodSchedulingStatus)(nil), (*v1alpha1.PodSchedulingStatus)(nil), func(a, b interface{}, scope conversion.Scope) error {\n\t\treturn Convert_resource_PodSchedulingStatus_To_v1alpha1_PodSchedulingStatus(a.(*resource.PodSchedulingStatus), b.(*v1alpha1.PodSchedulingStatus), scope)\n\t}); err != nil {\n\t\treturn err\n\t}\n\tif err := s.AddGeneratedConversionFunc((*v1alpha1.ResourceClaim)(nil), (*resource.ResourceClaim)(nil), func(a, b interface{}, scope conversion.Scope) error {\n\t\treturn Convert_v1alpha1_ResourceClaim_To_resource_ResourceClaim(a.(*v1alpha1.ResourceClaim), b.(*resource.ResourceClaim), scope)\n\t}); err != nil {\n\t\treturn err\n\t}\n\tif err := s.AddGeneratedConversionFunc((*resource.ResourceClaim)(nil), (*v1alpha1.ResourceClaim)(nil), func(a, b interface{}, scope conversion.Scope) error {\n\t\treturn Convert_resource_ResourceClaim_To_v1alpha1_ResourceClaim(a.(*resource.ResourceClaim), b.(*v1alpha1.ResourceClaim), scope)\n\t}); err != nil {\n\t\treturn err\n\t}\n\tif err := s.AddGeneratedConversionFunc((*v1alpha1.ResourceClaimConsumerReference)(nil), (*resource.ResourceClaimConsumerReference)(nil), func(a, b interface{}, scope conversion.Scope) error {\n\t\treturn Convert_v1alpha1_ResourceClaimConsumerReference_To_resource_ResourceClaimConsumerReference(a.(*v1alpha1.ResourceClaimConsumerReference), b.(*resource.ResourceClaimConsumerReference), scope)\n\t}); err != nil {\n\t\treturn err\n\t}\n\tif err := s.AddGeneratedConversionFunc((*resource.ResourceClaimConsumerReference)(nil), (*v1alpha1.ResourceClaimConsumerReference)(nil), func(a, b interface{}, scope conversion.Scope) error {\n\t\treturn Convert_resource_ResourceClaimConsumerReference_To_v1alpha1_ResourceClaimConsumerReference(a.(*resource.ResourceClaimConsumerReference), b.(*v1alpha1.ResourceClaimConsumerReference), scope)\n\t}); err != nil {\n\t\treturn err\n\t}\n\tif err := s.AddGeneratedConversionFunc((*v1alpha1.ResourceClaimList)(nil), (*resource.ResourceClaimList)(nil), func(a, b interface{}, scope conversion.Scope) error {\n\t\treturn Convert_v1alpha1_ResourceClaimList_To_resource_ResourceClaimList(a.(*v1alpha1.ResourceClaimList), b.(*resource.ResourceClaimList), scope)\n\t}); err != nil {\n\t\treturn err\n\t}\n\tif err := s.AddGeneratedConversionFunc((*resource.ResourceClaimList)(nil), (*v1alpha1.ResourceClaimList)(nil), func(a, b interface{}, scope conversion.Scope) error {\n\t\treturn Convert_resource_ResourceClaimList_To_v1alpha1_ResourceClaimList(a.(*resource.ResourceClaimList), b.(*v1alpha1.ResourceClaimList), scope)\n\t}); err != nil {\n\t\treturn err\n\t}\n\tif err := s.AddGeneratedConversionFunc((*v1alpha1.ResourceClaimParametersReference)(nil), (*resource.ResourceClaimParametersReference)(nil), func(a, b interface{}, scope conversion.Scope) error {\n\t\treturn Convert_v1alpha1_ResourceClaimParametersReference_To_resource_ResourceClaimParametersReference(a.(*v1alpha1.ResourceClaimParametersReference), b.(*resource.ResourceClaimParametersReference), scope)\n\t}); err != nil {\n\t\treturn err\n\t}\n\tif err := s.AddGeneratedConversionFunc((*resource.ResourceClaimParametersReference)(nil), (*v1alpha1.ResourceClaimParametersReference)(nil), func(a, b interface{}, scope conversion.Scope) error {\n\t\treturn Convert_resource_ResourceClaimParametersReference_To_v1alpha1_ResourceClaimParametersReference(a.(*resource.ResourceClaimParametersReference), b.(*v1alpha1.ResourceClaimParametersReference), scope)\n\t}); err != nil {\n\t\treturn err\n\t}\n\tif err := s.AddGeneratedConversionFunc((*v1alpha1.ResourceClaimSchedulingStatus)(nil), (*resource.ResourceClaimSchedulingStatus)(nil), func(a, b interface{}, scope conversion.Scope) error {\n\t\treturn Convert_v1alpha1_ResourceClaimSchedulingStatus_To_resource_ResourceClaimSchedulingStatus(a.(*v1alpha1.ResourceClaimSchedulingStatus), b.(*resource.ResourceClaimSchedulingStatus), scope)\n\t}); err != nil {\n\t\treturn err\n\t}\n\tif err := s.AddGeneratedConversionFunc((*resource.ResourceClaimSchedulingStatus)(nil), (*v1alpha1.ResourceClaimSchedulingStatus)(nil), func(a, b interface{}, scope conversion.Scope) error {\n\t\treturn Convert_resource_ResourceClaimSchedulingStatus_To_v1alpha1_ResourceClaimSchedulingStatus(a.(*resource.ResourceClaimSchedulingStatus), b.(*v1alpha1.ResourceClaimSchedulingStatus), scope)\n\t}); err != nil {\n\t\treturn err\n\t}\n\tif err := s.AddGeneratedConversionFunc((*v1alpha1.ResourceClaimSpec)(nil), (*resource.ResourceClaimSpec)(nil), func(a, b interface{}, scope conversion.Scope) error {\n\t\treturn Convert_v1alpha1_ResourceClaimSpec_To_resource_ResourceClaimSpec(a.(*v1alpha1.ResourceClaimSpec), b.(*resource.ResourceClaimSpec), scope)\n\t}); err != nil {\n\t\treturn err\n\t}\n\tif err := s.AddGeneratedConversionFunc((*resource.ResourceClaimSpec)(nil), (*v1alpha1.ResourceClaimSpec)(nil), func(a, b interface{}, scope conversion.Scope) error {\n\t\treturn Convert_resource_ResourceClaimSpec_To_v1alpha1_ResourceClaimSpec(a.(*resource.ResourceClaimSpec), b.(*v1alpha1.ResourceClaimSpec), scope)\n\t}); err != nil {\n\t\treturn err\n\t}\n\tif err := s.AddGeneratedConversionFunc((*v1alpha1.ResourceClaimStatus)(nil), (*resource.ResourceClaimStatus)(nil), func(a, b interface{}, scope conversion.Scope) error {\n\t\treturn Convert_v1alpha1_ResourceClaimStatus_To_resource_ResourceClaimStatus(a.(*v1alpha1.ResourceClaimStatus), b.(*resource.ResourceClaimStatus), scope)\n\t}); err != nil {\n\t\treturn err\n\t}\n\tif err := s.AddGeneratedConversionFunc((*resource.ResourceClaimStatus)(nil), (*v1alpha1.ResourceClaimStatus)(nil), func(a, b interface{}, scope conversion.Scope) error {\n\t\treturn Convert_resource_ResourceClaimStatus_To_v1alpha1_ResourceClaimStatus(a.(*resource.ResourceClaimStatus), b.(*v1alpha1.ResourceClaimStatus), scope)\n\t}); err != nil {\n\t\treturn err\n\t}\n\tif err := s.AddGeneratedConversionFunc((*v1alpha1.ResourceClaimTemplate)(nil), (*resource.ResourceClaimTemplate)(nil), func(a, b interface{}, scope conversion.Scope) error {\n\t\treturn Convert_v1alpha1_ResourceClaimTemplate_To_resource_ResourceClaimTemplate(a.(*v1alpha1.ResourceClaimTemplate), b.(*resource.ResourceClaimTemplate), scope)\n\t}); err != nil {\n\t\treturn err\n\t}\n\tif err := s.AddGeneratedConversionFunc((*resource.ResourceClaimTemplate)(nil), (*v1alpha1.ResourceClaimTemplate)(nil), func(a, b interface{}, scope conversion.Scope) error {\n\t\treturn Convert_resource_ResourceClaimTemplate_To_v1alpha1_ResourceClaimTemplate(a.(*resource.ResourceClaimTemplate), b.(*v1alpha1.ResourceClaimTemplate), scope)\n\t}); err != nil {\n\t\treturn err\n\t}\n\tif err := s.AddGeneratedConversionFunc((*v1alpha1.ResourceClaimTemplateList)(nil), (*resource.ResourceClaimTemplateList)(nil), func(a, b interface{}, scope conversion.Scope) error {\n\t\treturn Convert_v1alpha1_ResourceClaimTemplateList_To_resource_ResourceClaimTemplateList(a.(*v1alpha1.ResourceClaimTemplateList), b.(*resource.ResourceClaimTemplateList), scope)\n\t}); err != nil {\n\t\treturn err\n\t}\n\tif err := s.AddGeneratedConversionFunc((*resource.ResourceClaimTemplateList)(nil), (*v1alpha1.ResourceClaimTemplateList)(nil), func(a, b interface{}, scope conversion.Scope) error {\n\t\treturn Convert_resource_ResourceClaimTemplateList_To_v1alpha1_ResourceClaimTemplateList(a.(*resource.ResourceClaimTemplateList), b.(*v1alpha1.ResourceClaimTemplateList), scope)\n\t}); err != nil {\n\t\treturn err\n\t}\n\tif err := s.AddGeneratedConversionFunc((*v1alpha1.ResourceClaimTemplateSpec)(nil), (*resource.ResourceClaimTemplateSpec)(nil), func(a, b interface{}, scope conversion.Scope) error {\n\t\treturn Convert_v1alpha1_ResourceClaimTemplateSpec_To_resource_ResourceClaimTemplateSpec(a.(*v1alpha1.ResourceClaimTemplateSpec), b.(*resource.ResourceClaimTemplateSpec), scope)\n\t}); err != nil {\n\t\treturn err\n\t}\n\tif err := s.AddGeneratedConversionFunc((*resource.ResourceClaimTemplateSpec)(nil), (*v1alpha1.ResourceClaimTemplateSpec)(nil), func(a, b interface{}, scope conversion.Scope) error {\n\t\treturn Convert_resource_ResourceClaimTemplateSpec_To_v1alpha1_ResourceClaimTemplateSpec(a.(*resource.ResourceClaimTemplateSpec), b.(*v1alpha1.ResourceClaimTemplateSpec), scope)\n\t}); err != nil {\n\t\treturn err\n\t}\n\tif err := s.AddGeneratedConversionFunc((*v1alpha1.ResourceClass)(nil), (*resource.ResourceClass)(nil), func(a, b interface{}, scope conversion.Scope) error {\n\t\treturn Convert_v1alpha1_ResourceClass_To_resource_ResourceClass(a.(*v1alpha1.ResourceClass), b.(*resource.ResourceClass), scope)\n\t}); err != nil {\n\t\treturn err\n\t}\n\tif err := s.AddGeneratedConversionFunc((*resource.ResourceClass)(nil), (*v1alpha1.ResourceClass)(nil), func(a, b interface{}, scope conversion.Scope) error {\n\t\treturn Convert_resource_ResourceClass_To_v1alpha1_ResourceClass(a.(*resource.ResourceClass), b.(*v1alpha1.ResourceClass), scope)\n\t}); err != nil {\n\t\treturn err\n\t}\n\tif err := s.AddGeneratedConversionFunc((*v1alpha1.ResourceClassList)(nil), (*resource.ResourceClassList)(nil), func(a, b interface{}, scope conversion.Scope) error {\n\t\treturn Convert_v1alpha1_ResourceClassList_To_resource_ResourceClassList(a.(*v1alpha1.ResourceClassList), b.(*resource.ResourceClassList), scope)\n\t}); err != nil {\n\t\treturn err\n\t}\n\tif err := s.AddGeneratedConversionFunc((*resource.ResourceClassList)(nil), (*v1alpha1.ResourceClassList)(nil), func(a, b interface{}, scope conversion.Scope) error {\n\t\treturn Convert_resource_ResourceClassList_To_v1alpha1_ResourceClassList(a.(*resource.ResourceClassList), b.(*v1alpha1.ResourceClassList), scope)\n\t}); err != nil {\n\t\treturn err\n\t}\n\tif err := s.AddGeneratedConversionFunc((*v1alpha1.ResourceClassParametersReference)(nil), (*resource.ResourceClassParametersReference)(nil), func(a, b interface{}, scope conversion.Scope) error {\n\t\treturn Convert_v1alpha1_ResourceClassParametersReference_To_resource_ResourceClassParametersReference(a.(*v1alpha1.ResourceClassParametersReference), b.(*resource.ResourceClassParametersReference), scope)\n\t}); err != nil {\n\t\treturn err\n\t}\n\tif err := s.AddGeneratedConversionFunc((*resource.ResourceClassParametersReference)(nil), (*v1alpha1.ResourceClassParametersReference)(nil), func(a, b interface{}, scope conversion.Scope) error {\n\t\treturn Convert_resource_ResourceClassParametersReference_To_v1alpha1_ResourceClassParametersReference(a.(*resource.ResourceClassParametersReference), b.(*v1alpha1.ResourceClassParametersReference), scope)\n\t}); err != nil {\n\t\treturn err\n\t}\n\treturn nil\n}", "title": "" }, { "docid": "25360d0d44095699496feb7b303338b7", "score": "0.71015066", "text": "func RegisterConversions(s *runtime.Scheme) error {\n\tif err := s.AddGeneratedConversionFunc((*TestType)(nil), (*example3io.TestType)(nil), func(a, b interface{}, scope conversion.Scope) error {\n\t\treturn Convert_v1_TestType_To_example3io_TestType(a.(*TestType), b.(*example3io.TestType), scope)\n\t}); err != nil {\n\t\treturn err\n\t}\n\tif err := s.AddGeneratedConversionFunc((*example3io.TestType)(nil), (*TestType)(nil), func(a, b interface{}, scope conversion.Scope) error {\n\t\treturn Convert_example3io_TestType_To_v1_TestType(a.(*example3io.TestType), b.(*TestType), scope)\n\t}); err != nil {\n\t\treturn err\n\t}\n\tif err := s.AddGeneratedConversionFunc((*TestTypeList)(nil), (*example3io.TestTypeList)(nil), func(a, b interface{}, scope conversion.Scope) error {\n\t\treturn Convert_v1_TestTypeList_To_example3io_TestTypeList(a.(*TestTypeList), b.(*example3io.TestTypeList), scope)\n\t}); err != nil {\n\t\treturn err\n\t}\n\tif err := s.AddGeneratedConversionFunc((*example3io.TestTypeList)(nil), (*TestTypeList)(nil), func(a, b interface{}, scope conversion.Scope) error {\n\t\treturn Convert_example3io_TestTypeList_To_v1_TestTypeList(a.(*example3io.TestTypeList), b.(*TestTypeList), scope)\n\t}); err != nil {\n\t\treturn err\n\t}\n\tif err := s.AddGeneratedConversionFunc((*TestTypeStatus)(nil), (*example3io.TestTypeStatus)(nil), func(a, b interface{}, scope conversion.Scope) error {\n\t\treturn Convert_v1_TestTypeStatus_To_example3io_TestTypeStatus(a.(*TestTypeStatus), b.(*example3io.TestTypeStatus), scope)\n\t}); err != nil {\n\t\treturn err\n\t}\n\tif err := s.AddGeneratedConversionFunc((*example3io.TestTypeStatus)(nil), (*TestTypeStatus)(nil), func(a, b interface{}, scope conversion.Scope) error {\n\t\treturn Convert_example3io_TestTypeStatus_To_v1_TestTypeStatus(a.(*example3io.TestTypeStatus), b.(*TestTypeStatus), scope)\n\t}); err != nil {\n\t\treturn err\n\t}\n\treturn nil\n}", "title": "" }, { "docid": "d6d14c69132e46844c17760dd98906d2", "score": "0.70885235", "text": "func RegisterConversions(s *runtime.Scheme) error {\n\tif err := s.AddGeneratedConversionFunc((*AttachedDiskSpec)(nil), (*v1beta1.AttachedDiskSpec)(nil), func(a, b interface{}, scope conversion.Scope) error {\n\t\treturn Convert_v1alpha3_AttachedDiskSpec_To_v1beta1_AttachedDiskSpec(a.(*AttachedDiskSpec), b.(*v1beta1.AttachedDiskSpec), scope)\n\t}); err != nil {\n\t\treturn err\n\t}\n\tif err := s.AddGeneratedConversionFunc((*v1beta1.AttachedDiskSpec)(nil), (*AttachedDiskSpec)(nil), func(a, b interface{}, scope conversion.Scope) error {\n\t\treturn Convert_v1beta1_AttachedDiskSpec_To_v1alpha3_AttachedDiskSpec(a.(*v1beta1.AttachedDiskSpec), b.(*AttachedDiskSpec), scope)\n\t}); err != nil {\n\t\treturn err\n\t}\n\tif err := s.AddGeneratedConversionFunc((*BuildParams)(nil), (*v1beta1.BuildParams)(nil), func(a, b interface{}, scope conversion.Scope) error {\n\t\treturn Convert_v1alpha3_BuildParams_To_v1beta1_BuildParams(a.(*BuildParams), b.(*v1beta1.BuildParams), scope)\n\t}); err != nil {\n\t\treturn err\n\t}\n\tif err := s.AddGeneratedConversionFunc((*v1beta1.BuildParams)(nil), (*BuildParams)(nil), func(a, b interface{}, scope conversion.Scope) error {\n\t\treturn Convert_v1beta1_BuildParams_To_v1alpha3_BuildParams(a.(*v1beta1.BuildParams), b.(*BuildParams), scope)\n\t}); err != nil {\n\t\treturn err\n\t}\n\tif err := s.AddGeneratedConversionFunc((*Filter)(nil), (*v1beta1.Filter)(nil), func(a, b interface{}, scope conversion.Scope) error {\n\t\treturn Convert_v1alpha3_Filter_To_v1beta1_Filter(a.(*Filter), b.(*v1beta1.Filter), scope)\n\t}); err != nil {\n\t\treturn err\n\t}\n\tif err := s.AddGeneratedConversionFunc((*v1beta1.Filter)(nil), (*Filter)(nil), func(a, b interface{}, scope conversion.Scope) error {\n\t\treturn Convert_v1beta1_Filter_To_v1alpha3_Filter(a.(*v1beta1.Filter), b.(*Filter), scope)\n\t}); err != nil {\n\t\treturn err\n\t}\n\tif err := s.AddGeneratedConversionFunc((*GCPCluster)(nil), (*v1beta1.GCPCluster)(nil), func(a, b interface{}, scope conversion.Scope) error {\n\t\treturn Convert_v1alpha3_GCPCluster_To_v1beta1_GCPCluster(a.(*GCPCluster), b.(*v1beta1.GCPCluster), scope)\n\t}); err != nil {\n\t\treturn err\n\t}\n\tif err := s.AddGeneratedConversionFunc((*v1beta1.GCPCluster)(nil), (*GCPCluster)(nil), func(a, b interface{}, scope conversion.Scope) error {\n\t\treturn Convert_v1beta1_GCPCluster_To_v1alpha3_GCPCluster(a.(*v1beta1.GCPCluster), b.(*GCPCluster), scope)\n\t}); err != nil {\n\t\treturn err\n\t}\n\tif err := s.AddGeneratedConversionFunc((*GCPClusterList)(nil), (*v1beta1.GCPClusterList)(nil), func(a, b interface{}, scope conversion.Scope) error {\n\t\treturn Convert_v1alpha3_GCPClusterList_To_v1beta1_GCPClusterList(a.(*GCPClusterList), b.(*v1beta1.GCPClusterList), scope)\n\t}); err != nil {\n\t\treturn err\n\t}\n\tif err := s.AddGeneratedConversionFunc((*v1beta1.GCPClusterList)(nil), (*GCPClusterList)(nil), func(a, b interface{}, scope conversion.Scope) error {\n\t\treturn Convert_v1beta1_GCPClusterList_To_v1alpha3_GCPClusterList(a.(*v1beta1.GCPClusterList), b.(*GCPClusterList), scope)\n\t}); err != nil {\n\t\treturn err\n\t}\n\tif err := s.AddGeneratedConversionFunc((*GCPMachine)(nil), (*v1beta1.GCPMachine)(nil), func(a, b interface{}, scope conversion.Scope) error {\n\t\treturn Convert_v1alpha3_GCPMachine_To_v1beta1_GCPMachine(a.(*GCPMachine), b.(*v1beta1.GCPMachine), scope)\n\t}); err != nil {\n\t\treturn err\n\t}\n\tif err := s.AddGeneratedConversionFunc((*v1beta1.GCPMachine)(nil), (*GCPMachine)(nil), func(a, b interface{}, scope conversion.Scope) error {\n\t\treturn Convert_v1beta1_GCPMachine_To_v1alpha3_GCPMachine(a.(*v1beta1.GCPMachine), b.(*GCPMachine), scope)\n\t}); err != nil {\n\t\treturn err\n\t}\n\tif err := s.AddGeneratedConversionFunc((*GCPMachineList)(nil), (*v1beta1.GCPMachineList)(nil), func(a, b interface{}, scope conversion.Scope) error {\n\t\treturn Convert_v1alpha3_GCPMachineList_To_v1beta1_GCPMachineList(a.(*GCPMachineList), b.(*v1beta1.GCPMachineList), scope)\n\t}); err != nil {\n\t\treturn err\n\t}\n\tif err := s.AddGeneratedConversionFunc((*v1beta1.GCPMachineList)(nil), (*GCPMachineList)(nil), func(a, b interface{}, scope conversion.Scope) error {\n\t\treturn Convert_v1beta1_GCPMachineList_To_v1alpha3_GCPMachineList(a.(*v1beta1.GCPMachineList), b.(*GCPMachineList), scope)\n\t}); err != nil {\n\t\treturn err\n\t}\n\tif err := s.AddGeneratedConversionFunc((*GCPMachineSpec)(nil), (*v1beta1.GCPMachineSpec)(nil), func(a, b interface{}, scope conversion.Scope) error {\n\t\treturn Convert_v1alpha3_GCPMachineSpec_To_v1beta1_GCPMachineSpec(a.(*GCPMachineSpec), b.(*v1beta1.GCPMachineSpec), scope)\n\t}); err != nil {\n\t\treturn err\n\t}\n\tif err := s.AddGeneratedConversionFunc((*GCPMachineStatus)(nil), (*v1beta1.GCPMachineStatus)(nil), func(a, b interface{}, scope conversion.Scope) error {\n\t\treturn Convert_v1alpha3_GCPMachineStatus_To_v1beta1_GCPMachineStatus(a.(*GCPMachineStatus), b.(*v1beta1.GCPMachineStatus), scope)\n\t}); err != nil {\n\t\treturn err\n\t}\n\tif err := s.AddGeneratedConversionFunc((*v1beta1.GCPMachineStatus)(nil), (*GCPMachineStatus)(nil), func(a, b interface{}, scope conversion.Scope) error {\n\t\treturn Convert_v1beta1_GCPMachineStatus_To_v1alpha3_GCPMachineStatus(a.(*v1beta1.GCPMachineStatus), b.(*GCPMachineStatus), scope)\n\t}); err != nil {\n\t\treturn err\n\t}\n\tif err := s.AddGeneratedConversionFunc((*GCPMachineTemplate)(nil), (*v1beta1.GCPMachineTemplate)(nil), func(a, b interface{}, scope conversion.Scope) error {\n\t\treturn Convert_v1alpha3_GCPMachineTemplate_To_v1beta1_GCPMachineTemplate(a.(*GCPMachineTemplate), b.(*v1beta1.GCPMachineTemplate), scope)\n\t}); err != nil {\n\t\treturn err\n\t}\n\tif err := s.AddGeneratedConversionFunc((*v1beta1.GCPMachineTemplate)(nil), (*GCPMachineTemplate)(nil), func(a, b interface{}, scope conversion.Scope) error {\n\t\treturn Convert_v1beta1_GCPMachineTemplate_To_v1alpha3_GCPMachineTemplate(a.(*v1beta1.GCPMachineTemplate), b.(*GCPMachineTemplate), scope)\n\t}); err != nil {\n\t\treturn err\n\t}\n\tif err := s.AddGeneratedConversionFunc((*GCPMachineTemplateList)(nil), (*v1beta1.GCPMachineTemplateList)(nil), func(a, b interface{}, scope conversion.Scope) error {\n\t\treturn Convert_v1alpha3_GCPMachineTemplateList_To_v1beta1_GCPMachineTemplateList(a.(*GCPMachineTemplateList), b.(*v1beta1.GCPMachineTemplateList), scope)\n\t}); err != nil {\n\t\treturn err\n\t}\n\tif err := s.AddGeneratedConversionFunc((*v1beta1.GCPMachineTemplateList)(nil), (*GCPMachineTemplateList)(nil), func(a, b interface{}, scope conversion.Scope) error {\n\t\treturn Convert_v1beta1_GCPMachineTemplateList_To_v1alpha3_GCPMachineTemplateList(a.(*v1beta1.GCPMachineTemplateList), b.(*GCPMachineTemplateList), scope)\n\t}); err != nil {\n\t\treturn err\n\t}\n\tif err := s.AddGeneratedConversionFunc((*GCPMachineTemplateResource)(nil), (*v1beta1.GCPMachineTemplateResource)(nil), func(a, b interface{}, scope conversion.Scope) error {\n\t\treturn Convert_v1alpha3_GCPMachineTemplateResource_To_v1beta1_GCPMachineTemplateResource(a.(*GCPMachineTemplateResource), b.(*v1beta1.GCPMachineTemplateResource), scope)\n\t}); err != nil {\n\t\treturn err\n\t}\n\tif err := s.AddGeneratedConversionFunc((*GCPMachineTemplateSpec)(nil), (*v1beta1.GCPMachineTemplateSpec)(nil), func(a, b interface{}, scope conversion.Scope) error {\n\t\treturn Convert_v1alpha3_GCPMachineTemplateSpec_To_v1beta1_GCPMachineTemplateSpec(a.(*GCPMachineTemplateSpec), b.(*v1beta1.GCPMachineTemplateSpec), scope)\n\t}); err != nil {\n\t\treturn err\n\t}\n\tif err := s.AddGeneratedConversionFunc((*v1beta1.GCPMachineTemplateSpec)(nil), (*GCPMachineTemplateSpec)(nil), func(a, b interface{}, scope conversion.Scope) error {\n\t\treturn Convert_v1beta1_GCPMachineTemplateSpec_To_v1alpha3_GCPMachineTemplateSpec(a.(*v1beta1.GCPMachineTemplateSpec), b.(*GCPMachineTemplateSpec), scope)\n\t}); err != nil {\n\t\treturn err\n\t}\n\tif err := s.AddGeneratedConversionFunc((*MetadataItem)(nil), (*v1beta1.MetadataItem)(nil), func(a, b interface{}, scope conversion.Scope) error {\n\t\treturn Convert_v1alpha3_MetadataItem_To_v1beta1_MetadataItem(a.(*MetadataItem), b.(*v1beta1.MetadataItem), scope)\n\t}); err != nil {\n\t\treturn err\n\t}\n\tif err := s.AddGeneratedConversionFunc((*v1beta1.MetadataItem)(nil), (*MetadataItem)(nil), func(a, b interface{}, scope conversion.Scope) error {\n\t\treturn Convert_v1beta1_MetadataItem_To_v1alpha3_MetadataItem(a.(*v1beta1.MetadataItem), b.(*MetadataItem), scope)\n\t}); err != nil {\n\t\treturn err\n\t}\n\tif err := s.AddGeneratedConversionFunc((*Network)(nil), (*v1beta1.Network)(nil), func(a, b interface{}, scope conversion.Scope) error {\n\t\treturn Convert_v1alpha3_Network_To_v1beta1_Network(a.(*Network), b.(*v1beta1.Network), scope)\n\t}); err != nil {\n\t\treturn err\n\t}\n\tif err := s.AddGeneratedConversionFunc((*v1beta1.Network)(nil), (*Network)(nil), func(a, b interface{}, scope conversion.Scope) error {\n\t\treturn Convert_v1beta1_Network_To_v1alpha3_Network(a.(*v1beta1.Network), b.(*Network), scope)\n\t}); err != nil {\n\t\treturn err\n\t}\n\tif err := s.AddGeneratedConversionFunc((*NetworkSpec)(nil), (*v1beta1.NetworkSpec)(nil), func(a, b interface{}, scope conversion.Scope) error {\n\t\treturn Convert_v1alpha3_NetworkSpec_To_v1beta1_NetworkSpec(a.(*NetworkSpec), b.(*v1beta1.NetworkSpec), scope)\n\t}); err != nil {\n\t\treturn err\n\t}\n\tif err := s.AddGeneratedConversionFunc((*v1beta1.NetworkSpec)(nil), (*NetworkSpec)(nil), func(a, b interface{}, scope conversion.Scope) error {\n\t\treturn Convert_v1beta1_NetworkSpec_To_v1alpha3_NetworkSpec(a.(*v1beta1.NetworkSpec), b.(*NetworkSpec), scope)\n\t}); err != nil {\n\t\treturn err\n\t}\n\tif err := s.AddGeneratedConversionFunc((*ServiceAccount)(nil), (*v1beta1.ServiceAccount)(nil), func(a, b interface{}, scope conversion.Scope) error {\n\t\treturn Convert_v1alpha3_ServiceAccount_To_v1beta1_ServiceAccount(a.(*ServiceAccount), b.(*v1beta1.ServiceAccount), scope)\n\t}); err != nil {\n\t\treturn err\n\t}\n\tif err := s.AddGeneratedConversionFunc((*v1beta1.ServiceAccount)(nil), (*ServiceAccount)(nil), func(a, b interface{}, scope conversion.Scope) error {\n\t\treturn Convert_v1beta1_ServiceAccount_To_v1alpha3_ServiceAccount(a.(*v1beta1.ServiceAccount), b.(*ServiceAccount), scope)\n\t}); err != nil {\n\t\treturn err\n\t}\n\tif err := s.AddGeneratedConversionFunc((*SubnetSpec)(nil), (*v1beta1.SubnetSpec)(nil), func(a, b interface{}, scope conversion.Scope) error {\n\t\treturn Convert_v1alpha3_SubnetSpec_To_v1beta1_SubnetSpec(a.(*SubnetSpec), b.(*v1beta1.SubnetSpec), scope)\n\t}); err != nil {\n\t\treturn err\n\t}\n\tif err := s.AddConversionFunc((*GCPClusterSpec)(nil), (*v1beta1.GCPClusterSpec)(nil), func(a, b interface{}, scope conversion.Scope) error {\n\t\treturn Convert_v1alpha3_GCPClusterSpec_To_v1beta1_GCPClusterSpec(a.(*GCPClusterSpec), b.(*v1beta1.GCPClusterSpec), scope)\n\t}); err != nil {\n\t\treturn err\n\t}\n\tif err := s.AddConversionFunc((*GCPClusterStatus)(nil), (*v1beta1.GCPClusterStatus)(nil), func(a, b interface{}, scope conversion.Scope) error {\n\t\treturn Convert_v1alpha3_GCPClusterStatus_To_v1beta1_GCPClusterStatus(a.(*GCPClusterStatus), b.(*v1beta1.GCPClusterStatus), scope)\n\t}); err != nil {\n\t\treturn err\n\t}\n\tif err := s.AddConversionFunc((*v1beta1.GCPClusterSpec)(nil), (*GCPClusterSpec)(nil), func(a, b interface{}, scope conversion.Scope) error {\n\t\treturn Convert_v1beta1_GCPClusterSpec_To_v1alpha3_GCPClusterSpec(a.(*v1beta1.GCPClusterSpec), b.(*GCPClusterSpec), scope)\n\t}); err != nil {\n\t\treturn err\n\t}\n\tif err := s.AddConversionFunc((*v1beta1.GCPClusterStatus)(nil), (*GCPClusterStatus)(nil), func(a, b interface{}, scope conversion.Scope) error {\n\t\treturn Convert_v1beta1_GCPClusterStatus_To_v1alpha3_GCPClusterStatus(a.(*v1beta1.GCPClusterStatus), b.(*GCPClusterStatus), scope)\n\t}); err != nil {\n\t\treturn err\n\t}\n\tif err := s.AddConversionFunc((*v1beta1.GCPMachineSpec)(nil), (*GCPMachineSpec)(nil), func(a, b interface{}, scope conversion.Scope) error {\n\t\treturn Convert_v1beta1_GCPMachineSpec_To_v1alpha3_GCPMachineSpec(a.(*v1beta1.GCPMachineSpec), b.(*GCPMachineSpec), scope)\n\t}); err != nil {\n\t\treturn err\n\t}\n\tif err := s.AddConversionFunc((*v1beta1.GCPMachineTemplateResource)(nil), (*GCPMachineTemplateResource)(nil), func(a, b interface{}, scope conversion.Scope) error {\n\t\treturn Convert_v1beta1_GCPMachineTemplateResource_To_v1alpha3_GCPMachineTemplateResource(a.(*v1beta1.GCPMachineTemplateResource), b.(*GCPMachineTemplateResource), scope)\n\t}); err != nil {\n\t\treturn err\n\t}\n\tif err := s.AddConversionFunc((*v1beta1.SubnetSpec)(nil), (*SubnetSpec)(nil), func(a, b interface{}, scope conversion.Scope) error {\n\t\treturn Convert_v1beta1_SubnetSpec_To_v1alpha3_SubnetSpec(a.(*v1beta1.SubnetSpec), b.(*SubnetSpec), scope)\n\t}); err != nil {\n\t\treturn err\n\t}\n\treturn nil\n}", "title": "" }, { "docid": "5ba885ebd3a9032467888c0121ea0a58", "score": "0.7085908", "text": "func RegisterConversions(s *runtime.Scheme) error {\n\tif err := s.AddGeneratedConversionFunc((*v1.AWSElasticBlockStoreVolumeSource)(nil), (*core.AWSElasticBlockStoreVolumeSource)(nil), func(a, b interface{}, scope conversion.Scope) error {\n\t\treturn Convert_v1_AWSElasticBlockStoreVolumeSource_To_core_AWSElasticBlockStoreVolumeSource(a.(*v1.AWSElasticBlockStoreVolumeSource), b.(*core.AWSElasticBlockStoreVolumeSource), scope)\n\t}); err != nil {\n\t\treturn err\n\t}\n\tif err := s.AddGeneratedConversionFunc((*core.AWSElasticBlockStoreVolumeSource)(nil), (*v1.AWSElasticBlockStoreVolumeSource)(nil), func(a, b interface{}, scope conversion.Scope) error {\n\t\treturn Convert_core_AWSElasticBlockStoreVolumeSource_To_v1_AWSElasticBlockStoreVolumeSource(a.(*core.AWSElasticBlockStoreVolumeSource), b.(*v1.AWSElasticBlockStoreVolumeSource), scope)\n\t}); err != nil {\n\t\treturn err\n\t}\n\tif err := s.AddGeneratedConversionFunc((*v1.Affinity)(nil), (*core.Affinity)(nil), func(a, b interface{}, scope conversion.Scope) error {\n\t\treturn Convert_v1_Affinity_To_core_Affinity(a.(*v1.Affinity), b.(*core.Affinity), scope)\n\t}); err != nil {\n\t\treturn err\n\t}\n\tif err := s.AddGeneratedConversionFunc((*core.Affinity)(nil), (*v1.Affinity)(nil), func(a, b interface{}, scope conversion.Scope) error {\n\t\treturn Convert_core_Affinity_To_v1_Affinity(a.(*core.Affinity), b.(*v1.Affinity), scope)\n\t}); err != nil {\n\t\treturn err\n\t}\n\tif err := s.AddGeneratedConversionFunc((*v1.AttachedVolume)(nil), (*core.AttachedVolume)(nil), func(a, b interface{}, scope conversion.Scope) error {\n\t\treturn Convert_v1_AttachedVolume_To_core_AttachedVolume(a.(*v1.AttachedVolume), b.(*core.AttachedVolume), scope)\n\t}); err != nil {\n\t\treturn err\n\t}\n\tif err := s.AddGeneratedConversionFunc((*core.AttachedVolume)(nil), (*v1.AttachedVolume)(nil), func(a, b interface{}, scope conversion.Scope) error {\n\t\treturn Convert_core_AttachedVolume_To_v1_AttachedVolume(a.(*core.AttachedVolume), b.(*v1.AttachedVolume), scope)\n\t}); err != nil {\n\t\treturn err\n\t}\n\tif err := s.AddGeneratedConversionFunc((*v1.AvoidPods)(nil), (*core.AvoidPods)(nil), func(a, b interface{}, scope conversion.Scope) error {\n\t\treturn Convert_v1_AvoidPods_To_core_AvoidPods(a.(*v1.AvoidPods), b.(*core.AvoidPods), scope)\n\t}); err != nil {\n\t\treturn err\n\t}\n\tif err := s.AddGeneratedConversionFunc((*core.AvoidPods)(nil), (*v1.AvoidPods)(nil), func(a, b interface{}, scope conversion.Scope) error {\n\t\treturn Convert_core_AvoidPods_To_v1_AvoidPods(a.(*core.AvoidPods), b.(*v1.AvoidPods), scope)\n\t}); err != nil {\n\t\treturn err\n\t}\n\tif err := s.AddGeneratedConversionFunc((*v1.AzureDiskVolumeSource)(nil), (*core.AzureDiskVolumeSource)(nil), func(a, b interface{}, scope conversion.Scope) error {\n\t\treturn Convert_v1_AzureDiskVolumeSource_To_core_AzureDiskVolumeSource(a.(*v1.AzureDiskVolumeSource), b.(*core.AzureDiskVolumeSource), scope)\n\t}); err != nil {\n\t\treturn err\n\t}\n\tif err := s.AddGeneratedConversionFunc((*core.AzureDiskVolumeSource)(nil), (*v1.AzureDiskVolumeSource)(nil), func(a, b interface{}, scope conversion.Scope) error {\n\t\treturn Convert_core_AzureDiskVolumeSource_To_v1_AzureDiskVolumeSource(a.(*core.AzureDiskVolumeSource), b.(*v1.AzureDiskVolumeSource), scope)\n\t}); err != nil {\n\t\treturn err\n\t}\n\tif err := s.AddGeneratedConversionFunc((*v1.AzureFilePersistentVolumeSource)(nil), (*core.AzureFilePersistentVolumeSource)(nil), func(a, b interface{}, scope conversion.Scope) error {\n\t\treturn Convert_v1_AzureFilePersistentVolumeSource_To_core_AzureFilePersistentVolumeSource(a.(*v1.AzureFilePersistentVolumeSource), b.(*core.AzureFilePersistentVolumeSource), scope)\n\t}); err != nil {\n\t\treturn err\n\t}\n\tif err := s.AddGeneratedConversionFunc((*core.AzureFilePersistentVolumeSource)(nil), (*v1.AzureFilePersistentVolumeSource)(nil), func(a, b interface{}, scope conversion.Scope) error {\n\t\treturn Convert_core_AzureFilePersistentVolumeSource_To_v1_AzureFilePersistentVolumeSource(a.(*core.AzureFilePersistentVolumeSource), b.(*v1.AzureFilePersistentVolumeSource), scope)\n\t}); err != nil {\n\t\treturn err\n\t}\n\tif err := s.AddGeneratedConversionFunc((*v1.AzureFileVolumeSource)(nil), (*core.AzureFileVolumeSource)(nil), func(a, b interface{}, scope conversion.Scope) error {\n\t\treturn Convert_v1_AzureFileVolumeSource_To_core_AzureFileVolumeSource(a.(*v1.AzureFileVolumeSource), b.(*core.AzureFileVolumeSource), scope)\n\t}); err != nil {\n\t\treturn err\n\t}\n\tif err := s.AddGeneratedConversionFunc((*core.AzureFileVolumeSource)(nil), (*v1.AzureFileVolumeSource)(nil), func(a, b interface{}, scope conversion.Scope) error {\n\t\treturn Convert_core_AzureFileVolumeSource_To_v1_AzureFileVolumeSource(a.(*core.AzureFileVolumeSource), b.(*v1.AzureFileVolumeSource), scope)\n\t}); err != nil {\n\t\treturn err\n\t}\n\tif err := s.AddGeneratedConversionFunc((*v1.Binding)(nil), (*core.Binding)(nil), func(a, b interface{}, scope conversion.Scope) error {\n\t\treturn Convert_v1_Binding_To_core_Binding(a.(*v1.Binding), b.(*core.Binding), scope)\n\t}); err != nil {\n\t\treturn err\n\t}\n\tif err := s.AddGeneratedConversionFunc((*core.Binding)(nil), (*v1.Binding)(nil), func(a, b interface{}, scope conversion.Scope) error {\n\t\treturn Convert_core_Binding_To_v1_Binding(a.(*core.Binding), b.(*v1.Binding), scope)\n\t}); err != nil {\n\t\treturn err\n\t}\n\tif err := s.AddGeneratedConversionFunc((*v1.CSIPersistentVolumeSource)(nil), (*core.CSIPersistentVolumeSource)(nil), func(a, b interface{}, scope conversion.Scope) error {\n\t\treturn Convert_v1_CSIPersistentVolumeSource_To_core_CSIPersistentVolumeSource(a.(*v1.CSIPersistentVolumeSource), b.(*core.CSIPersistentVolumeSource), scope)\n\t}); err != nil {\n\t\treturn err\n\t}\n\tif err := s.AddGeneratedConversionFunc((*core.CSIPersistentVolumeSource)(nil), (*v1.CSIPersistentVolumeSource)(nil), func(a, b interface{}, scope conversion.Scope) error {\n\t\treturn Convert_core_CSIPersistentVolumeSource_To_v1_CSIPersistentVolumeSource(a.(*core.CSIPersistentVolumeSource), b.(*v1.CSIPersistentVolumeSource), scope)\n\t}); err != nil {\n\t\treturn err\n\t}\n\tif err := s.AddGeneratedConversionFunc((*v1.CSIVolumeSource)(nil), (*core.CSIVolumeSource)(nil), func(a, b interface{}, scope conversion.Scope) error {\n\t\treturn Convert_v1_CSIVolumeSource_To_core_CSIVolumeSource(a.(*v1.CSIVolumeSource), b.(*core.CSIVolumeSource), scope)\n\t}); err != nil {\n\t\treturn err\n\t}\n\tif err := s.AddGeneratedConversionFunc((*core.CSIVolumeSource)(nil), (*v1.CSIVolumeSource)(nil), func(a, b interface{}, scope conversion.Scope) error {\n\t\treturn Convert_core_CSIVolumeSource_To_v1_CSIVolumeSource(a.(*core.CSIVolumeSource), b.(*v1.CSIVolumeSource), scope)\n\t}); err != nil {\n\t\treturn err\n\t}\n\tif err := s.AddGeneratedConversionFunc((*v1.Capabilities)(nil), (*core.Capabilities)(nil), func(a, b interface{}, scope conversion.Scope) error {\n\t\treturn Convert_v1_Capabilities_To_core_Capabilities(a.(*v1.Capabilities), b.(*core.Capabilities), scope)\n\t}); err != nil {\n\t\treturn err\n\t}\n\tif err := s.AddGeneratedConversionFunc((*core.Capabilities)(nil), (*v1.Capabilities)(nil), func(a, b interface{}, scope conversion.Scope) error {\n\t\treturn Convert_core_Capabilities_To_v1_Capabilities(a.(*core.Capabilities), b.(*v1.Capabilities), scope)\n\t}); err != nil {\n\t\treturn err\n\t}\n\tif err := s.AddGeneratedConversionFunc((*v1.CephFSPersistentVolumeSource)(nil), (*core.CephFSPersistentVolumeSource)(nil), func(a, b interface{}, scope conversion.Scope) error {\n\t\treturn Convert_v1_CephFSPersistentVolumeSource_To_core_CephFSPersistentVolumeSource(a.(*v1.CephFSPersistentVolumeSource), b.(*core.CephFSPersistentVolumeSource), scope)\n\t}); err != nil {\n\t\treturn err\n\t}\n\tif err := s.AddGeneratedConversionFunc((*core.CephFSPersistentVolumeSource)(nil), (*v1.CephFSPersistentVolumeSource)(nil), func(a, b interface{}, scope conversion.Scope) error {\n\t\treturn Convert_core_CephFSPersistentVolumeSource_To_v1_CephFSPersistentVolumeSource(a.(*core.CephFSPersistentVolumeSource), b.(*v1.CephFSPersistentVolumeSource), scope)\n\t}); err != nil {\n\t\treturn err\n\t}\n\tif err := s.AddGeneratedConversionFunc((*v1.CephFSVolumeSource)(nil), (*core.CephFSVolumeSource)(nil), func(a, b interface{}, scope conversion.Scope) error {\n\t\treturn Convert_v1_CephFSVolumeSource_To_core_CephFSVolumeSource(a.(*v1.CephFSVolumeSource), b.(*core.CephFSVolumeSource), scope)\n\t}); err != nil {\n\t\treturn err\n\t}\n\tif err := s.AddGeneratedConversionFunc((*core.CephFSVolumeSource)(nil), (*v1.CephFSVolumeSource)(nil), func(a, b interface{}, scope conversion.Scope) error {\n\t\treturn Convert_core_CephFSVolumeSource_To_v1_CephFSVolumeSource(a.(*core.CephFSVolumeSource), b.(*v1.CephFSVolumeSource), scope)\n\t}); err != nil {\n\t\treturn err\n\t}\n\tif err := s.AddGeneratedConversionFunc((*v1.CinderPersistentVolumeSource)(nil), (*core.CinderPersistentVolumeSource)(nil), func(a, b interface{}, scope conversion.Scope) error {\n\t\treturn Convert_v1_CinderPersistentVolumeSource_To_core_CinderPersistentVolumeSource(a.(*v1.CinderPersistentVolumeSource), b.(*core.CinderPersistentVolumeSource), scope)\n\t}); err != nil {\n\t\treturn err\n\t}\n\tif err := s.AddGeneratedConversionFunc((*core.CinderPersistentVolumeSource)(nil), (*v1.CinderPersistentVolumeSource)(nil), func(a, b interface{}, scope conversion.Scope) error {\n\t\treturn Convert_core_CinderPersistentVolumeSource_To_v1_CinderPersistentVolumeSource(a.(*core.CinderPersistentVolumeSource), b.(*v1.CinderPersistentVolumeSource), scope)\n\t}); err != nil {\n\t\treturn err\n\t}\n\tif err := s.AddGeneratedConversionFunc((*v1.CinderVolumeSource)(nil), (*core.CinderVolumeSource)(nil), func(a, b interface{}, scope conversion.Scope) error {\n\t\treturn Convert_v1_CinderVolumeSource_To_core_CinderVolumeSource(a.(*v1.CinderVolumeSource), b.(*core.CinderVolumeSource), scope)\n\t}); err != nil {\n\t\treturn err\n\t}\n\tif err := s.AddGeneratedConversionFunc((*core.CinderVolumeSource)(nil), (*v1.CinderVolumeSource)(nil), func(a, b interface{}, scope conversion.Scope) error {\n\t\treturn Convert_core_CinderVolumeSource_To_v1_CinderVolumeSource(a.(*core.CinderVolumeSource), b.(*v1.CinderVolumeSource), scope)\n\t}); err != nil {\n\t\treturn err\n\t}\n\tif err := s.AddGeneratedConversionFunc((*v1.ClaimSource)(nil), (*core.ClaimSource)(nil), func(a, b interface{}, scope conversion.Scope) error {\n\t\treturn Convert_v1_ClaimSource_To_core_ClaimSource(a.(*v1.ClaimSource), b.(*core.ClaimSource), scope)\n\t}); err != nil {\n\t\treturn err\n\t}\n\tif err := s.AddGeneratedConversionFunc((*core.ClaimSource)(nil), (*v1.ClaimSource)(nil), func(a, b interface{}, scope conversion.Scope) error {\n\t\treturn Convert_core_ClaimSource_To_v1_ClaimSource(a.(*core.ClaimSource), b.(*v1.ClaimSource), scope)\n\t}); err != nil {\n\t\treturn err\n\t}\n\tif err := s.AddGeneratedConversionFunc((*v1.ClientIPConfig)(nil), (*core.ClientIPConfig)(nil), func(a, b interface{}, scope conversion.Scope) error {\n\t\treturn Convert_v1_ClientIPConfig_To_core_ClientIPConfig(a.(*v1.ClientIPConfig), b.(*core.ClientIPConfig), scope)\n\t}); err != nil {\n\t\treturn err\n\t}\n\tif err := s.AddGeneratedConversionFunc((*core.ClientIPConfig)(nil), (*v1.ClientIPConfig)(nil), func(a, b interface{}, scope conversion.Scope) error {\n\t\treturn Convert_core_ClientIPConfig_To_v1_ClientIPConfig(a.(*core.ClientIPConfig), b.(*v1.ClientIPConfig), scope)\n\t}); err != nil {\n\t\treturn err\n\t}\n\tif err := s.AddGeneratedConversionFunc((*v1.ComponentCondition)(nil), (*core.ComponentCondition)(nil), func(a, b interface{}, scope conversion.Scope) error {\n\t\treturn Convert_v1_ComponentCondition_To_core_ComponentCondition(a.(*v1.ComponentCondition), b.(*core.ComponentCondition), scope)\n\t}); err != nil {\n\t\treturn err\n\t}\n\tif err := s.AddGeneratedConversionFunc((*core.ComponentCondition)(nil), (*v1.ComponentCondition)(nil), func(a, b interface{}, scope conversion.Scope) error {\n\t\treturn Convert_core_ComponentCondition_To_v1_ComponentCondition(a.(*core.ComponentCondition), b.(*v1.ComponentCondition), scope)\n\t}); err != nil {\n\t\treturn err\n\t}\n\tif err := s.AddGeneratedConversionFunc((*v1.ComponentStatus)(nil), (*core.ComponentStatus)(nil), func(a, b interface{}, scope conversion.Scope) error {\n\t\treturn Convert_v1_ComponentStatus_To_core_ComponentStatus(a.(*v1.ComponentStatus), b.(*core.ComponentStatus), scope)\n\t}); err != nil {\n\t\treturn err\n\t}\n\tif err := s.AddGeneratedConversionFunc((*core.ComponentStatus)(nil), (*v1.ComponentStatus)(nil), func(a, b interface{}, scope conversion.Scope) error {\n\t\treturn Convert_core_ComponentStatus_To_v1_ComponentStatus(a.(*core.ComponentStatus), b.(*v1.ComponentStatus), scope)\n\t}); err != nil {\n\t\treturn err\n\t}\n\tif err := s.AddGeneratedConversionFunc((*v1.ComponentStatusList)(nil), (*core.ComponentStatusList)(nil), func(a, b interface{}, scope conversion.Scope) error {\n\t\treturn Convert_v1_ComponentStatusList_To_core_ComponentStatusList(a.(*v1.ComponentStatusList), b.(*core.ComponentStatusList), scope)\n\t}); err != nil {\n\t\treturn err\n\t}\n\tif err := s.AddGeneratedConversionFunc((*core.ComponentStatusList)(nil), (*v1.ComponentStatusList)(nil), func(a, b interface{}, scope conversion.Scope) error {\n\t\treturn Convert_core_ComponentStatusList_To_v1_ComponentStatusList(a.(*core.ComponentStatusList), b.(*v1.ComponentStatusList), scope)\n\t}); err != nil {\n\t\treturn err\n\t}\n\tif err := s.AddGeneratedConversionFunc((*v1.ConfigMap)(nil), (*core.ConfigMap)(nil), func(a, b interface{}, scope conversion.Scope) error {\n\t\treturn Convert_v1_ConfigMap_To_core_ConfigMap(a.(*v1.ConfigMap), b.(*core.ConfigMap), scope)\n\t}); err != nil {\n\t\treturn err\n\t}\n\tif err := s.AddGeneratedConversionFunc((*core.ConfigMap)(nil), (*v1.ConfigMap)(nil), func(a, b interface{}, scope conversion.Scope) error {\n\t\treturn Convert_core_ConfigMap_To_v1_ConfigMap(a.(*core.ConfigMap), b.(*v1.ConfigMap), scope)\n\t}); err != nil {\n\t\treturn err\n\t}\n\tif err := s.AddGeneratedConversionFunc((*v1.ConfigMapEnvSource)(nil), (*core.ConfigMapEnvSource)(nil), func(a, b interface{}, scope conversion.Scope) error {\n\t\treturn Convert_v1_ConfigMapEnvSource_To_core_ConfigMapEnvSource(a.(*v1.ConfigMapEnvSource), b.(*core.ConfigMapEnvSource), scope)\n\t}); err != nil {\n\t\treturn err\n\t}\n\tif err := s.AddGeneratedConversionFunc((*core.ConfigMapEnvSource)(nil), (*v1.ConfigMapEnvSource)(nil), func(a, b interface{}, scope conversion.Scope) error {\n\t\treturn Convert_core_ConfigMapEnvSource_To_v1_ConfigMapEnvSource(a.(*core.ConfigMapEnvSource), b.(*v1.ConfigMapEnvSource), scope)\n\t}); err != nil {\n\t\treturn err\n\t}\n\tif err := s.AddGeneratedConversionFunc((*v1.ConfigMapKeySelector)(nil), (*core.ConfigMapKeySelector)(nil), func(a, b interface{}, scope conversion.Scope) error {\n\t\treturn Convert_v1_ConfigMapKeySelector_To_core_ConfigMapKeySelector(a.(*v1.ConfigMapKeySelector), b.(*core.ConfigMapKeySelector), scope)\n\t}); err != nil {\n\t\treturn err\n\t}\n\tif err := s.AddGeneratedConversionFunc((*core.ConfigMapKeySelector)(nil), (*v1.ConfigMapKeySelector)(nil), func(a, b interface{}, scope conversion.Scope) error {\n\t\treturn Convert_core_ConfigMapKeySelector_To_v1_ConfigMapKeySelector(a.(*core.ConfigMapKeySelector), b.(*v1.ConfigMapKeySelector), scope)\n\t}); err != nil {\n\t\treturn err\n\t}\n\tif err := s.AddGeneratedConversionFunc((*v1.ConfigMapList)(nil), (*core.ConfigMapList)(nil), func(a, b interface{}, scope conversion.Scope) error {\n\t\treturn Convert_v1_ConfigMapList_To_core_ConfigMapList(a.(*v1.ConfigMapList), b.(*core.ConfigMapList), scope)\n\t}); err != nil {\n\t\treturn err\n\t}\n\tif err := s.AddGeneratedConversionFunc((*core.ConfigMapList)(nil), (*v1.ConfigMapList)(nil), func(a, b interface{}, scope conversion.Scope) error {\n\t\treturn Convert_core_ConfigMapList_To_v1_ConfigMapList(a.(*core.ConfigMapList), b.(*v1.ConfigMapList), scope)\n\t}); err != nil {\n\t\treturn err\n\t}\n\tif err := s.AddGeneratedConversionFunc((*v1.ConfigMapNodeConfigSource)(nil), (*core.ConfigMapNodeConfigSource)(nil), func(a, b interface{}, scope conversion.Scope) error {\n\t\treturn Convert_v1_ConfigMapNodeConfigSource_To_core_ConfigMapNodeConfigSource(a.(*v1.ConfigMapNodeConfigSource), b.(*core.ConfigMapNodeConfigSource), scope)\n\t}); err != nil {\n\t\treturn err\n\t}\n\tif err := s.AddGeneratedConversionFunc((*core.ConfigMapNodeConfigSource)(nil), (*v1.ConfigMapNodeConfigSource)(nil), func(a, b interface{}, scope conversion.Scope) error {\n\t\treturn Convert_core_ConfigMapNodeConfigSource_To_v1_ConfigMapNodeConfigSource(a.(*core.ConfigMapNodeConfigSource), b.(*v1.ConfigMapNodeConfigSource), scope)\n\t}); err != nil {\n\t\treturn err\n\t}\n\tif err := s.AddGeneratedConversionFunc((*v1.ConfigMapProjection)(nil), (*core.ConfigMapProjection)(nil), func(a, b interface{}, scope conversion.Scope) error {\n\t\treturn Convert_v1_ConfigMapProjection_To_core_ConfigMapProjection(a.(*v1.ConfigMapProjection), b.(*core.ConfigMapProjection), scope)\n\t}); err != nil {\n\t\treturn err\n\t}\n\tif err := s.AddGeneratedConversionFunc((*core.ConfigMapProjection)(nil), (*v1.ConfigMapProjection)(nil), func(a, b interface{}, scope conversion.Scope) error {\n\t\treturn Convert_core_ConfigMapProjection_To_v1_ConfigMapProjection(a.(*core.ConfigMapProjection), b.(*v1.ConfigMapProjection), scope)\n\t}); err != nil {\n\t\treturn err\n\t}\n\tif err := s.AddGeneratedConversionFunc((*v1.ConfigMapVolumeSource)(nil), (*core.ConfigMapVolumeSource)(nil), func(a, b interface{}, scope conversion.Scope) error {\n\t\treturn Convert_v1_ConfigMapVolumeSource_To_core_ConfigMapVolumeSource(a.(*v1.ConfigMapVolumeSource), b.(*core.ConfigMapVolumeSource), scope)\n\t}); err != nil {\n\t\treturn err\n\t}\n\tif err := s.AddGeneratedConversionFunc((*core.ConfigMapVolumeSource)(nil), (*v1.ConfigMapVolumeSource)(nil), func(a, b interface{}, scope conversion.Scope) error {\n\t\treturn Convert_core_ConfigMapVolumeSource_To_v1_ConfigMapVolumeSource(a.(*core.ConfigMapVolumeSource), b.(*v1.ConfigMapVolumeSource), scope)\n\t}); err != nil {\n\t\treturn err\n\t}\n\tif err := s.AddGeneratedConversionFunc((*v1.Container)(nil), (*core.Container)(nil), func(a, b interface{}, scope conversion.Scope) error {\n\t\treturn Convert_v1_Container_To_core_Container(a.(*v1.Container), b.(*core.Container), scope)\n\t}); err != nil {\n\t\treturn err\n\t}\n\tif err := s.AddGeneratedConversionFunc((*core.Container)(nil), (*v1.Container)(nil), func(a, b interface{}, scope conversion.Scope) error {\n\t\treturn Convert_core_Container_To_v1_Container(a.(*core.Container), b.(*v1.Container), scope)\n\t}); err != nil {\n\t\treturn err\n\t}\n\tif err := s.AddGeneratedConversionFunc((*v1.ContainerImage)(nil), (*core.ContainerImage)(nil), func(a, b interface{}, scope conversion.Scope) error {\n\t\treturn Convert_v1_ContainerImage_To_core_ContainerImage(a.(*v1.ContainerImage), b.(*core.ContainerImage), scope)\n\t}); err != nil {\n\t\treturn err\n\t}\n\tif err := s.AddGeneratedConversionFunc((*core.ContainerImage)(nil), (*v1.ContainerImage)(nil), func(a, b interface{}, scope conversion.Scope) error {\n\t\treturn Convert_core_ContainerImage_To_v1_ContainerImage(a.(*core.ContainerImage), b.(*v1.ContainerImage), scope)\n\t}); err != nil {\n\t\treturn err\n\t}\n\tif err := s.AddGeneratedConversionFunc((*v1.ContainerPort)(nil), (*core.ContainerPort)(nil), func(a, b interface{}, scope conversion.Scope) error {\n\t\treturn Convert_v1_ContainerPort_To_core_ContainerPort(a.(*v1.ContainerPort), b.(*core.ContainerPort), scope)\n\t}); err != nil {\n\t\treturn err\n\t}\n\tif err := s.AddGeneratedConversionFunc((*core.ContainerPort)(nil), (*v1.ContainerPort)(nil), func(a, b interface{}, scope conversion.Scope) error {\n\t\treturn Convert_core_ContainerPort_To_v1_ContainerPort(a.(*core.ContainerPort), b.(*v1.ContainerPort), scope)\n\t}); err != nil {\n\t\treturn err\n\t}\n\tif err := s.AddGeneratedConversionFunc((*v1.ContainerResizePolicy)(nil), (*core.ContainerResizePolicy)(nil), func(a, b interface{}, scope conversion.Scope) error {\n\t\treturn Convert_v1_ContainerResizePolicy_To_core_ContainerResizePolicy(a.(*v1.ContainerResizePolicy), b.(*core.ContainerResizePolicy), scope)\n\t}); err != nil {\n\t\treturn err\n\t}\n\tif err := s.AddGeneratedConversionFunc((*core.ContainerResizePolicy)(nil), (*v1.ContainerResizePolicy)(nil), func(a, b interface{}, scope conversion.Scope) error {\n\t\treturn Convert_core_ContainerResizePolicy_To_v1_ContainerResizePolicy(a.(*core.ContainerResizePolicy), b.(*v1.ContainerResizePolicy), scope)\n\t}); err != nil {\n\t\treturn err\n\t}\n\tif err := s.AddGeneratedConversionFunc((*v1.ContainerState)(nil), (*core.ContainerState)(nil), func(a, b interface{}, scope conversion.Scope) error {\n\t\treturn Convert_v1_ContainerState_To_core_ContainerState(a.(*v1.ContainerState), b.(*core.ContainerState), scope)\n\t}); err != nil {\n\t\treturn err\n\t}\n\tif err := s.AddGeneratedConversionFunc((*core.ContainerState)(nil), (*v1.ContainerState)(nil), func(a, b interface{}, scope conversion.Scope) error {\n\t\treturn Convert_core_ContainerState_To_v1_ContainerState(a.(*core.ContainerState), b.(*v1.ContainerState), scope)\n\t}); err != nil {\n\t\treturn err\n\t}\n\tif err := s.AddGeneratedConversionFunc((*v1.ContainerStateRunning)(nil), (*core.ContainerStateRunning)(nil), func(a, b interface{}, scope conversion.Scope) error {\n\t\treturn Convert_v1_ContainerStateRunning_To_core_ContainerStateRunning(a.(*v1.ContainerStateRunning), b.(*core.ContainerStateRunning), scope)\n\t}); err != nil {\n\t\treturn err\n\t}\n\tif err := s.AddGeneratedConversionFunc((*core.ContainerStateRunning)(nil), (*v1.ContainerStateRunning)(nil), func(a, b interface{}, scope conversion.Scope) error {\n\t\treturn Convert_core_ContainerStateRunning_To_v1_ContainerStateRunning(a.(*core.ContainerStateRunning), b.(*v1.ContainerStateRunning), scope)\n\t}); err != nil {\n\t\treturn err\n\t}\n\tif err := s.AddGeneratedConversionFunc((*v1.ContainerStateTerminated)(nil), (*core.ContainerStateTerminated)(nil), func(a, b interface{}, scope conversion.Scope) error {\n\t\treturn Convert_v1_ContainerStateTerminated_To_core_ContainerStateTerminated(a.(*v1.ContainerStateTerminated), b.(*core.ContainerStateTerminated), scope)\n\t}); err != nil {\n\t\treturn err\n\t}\n\tif err := s.AddGeneratedConversionFunc((*core.ContainerStateTerminated)(nil), (*v1.ContainerStateTerminated)(nil), func(a, b interface{}, scope conversion.Scope) error {\n\t\treturn Convert_core_ContainerStateTerminated_To_v1_ContainerStateTerminated(a.(*core.ContainerStateTerminated), b.(*v1.ContainerStateTerminated), scope)\n\t}); err != nil {\n\t\treturn err\n\t}\n\tif err := s.AddGeneratedConversionFunc((*v1.ContainerStateWaiting)(nil), (*core.ContainerStateWaiting)(nil), func(a, b interface{}, scope conversion.Scope) error {\n\t\treturn Convert_v1_ContainerStateWaiting_To_core_ContainerStateWaiting(a.(*v1.ContainerStateWaiting), b.(*core.ContainerStateWaiting), scope)\n\t}); err != nil {\n\t\treturn err\n\t}\n\tif err := s.AddGeneratedConversionFunc((*core.ContainerStateWaiting)(nil), (*v1.ContainerStateWaiting)(nil), func(a, b interface{}, scope conversion.Scope) error {\n\t\treturn Convert_core_ContainerStateWaiting_To_v1_ContainerStateWaiting(a.(*core.ContainerStateWaiting), b.(*v1.ContainerStateWaiting), scope)\n\t}); err != nil {\n\t\treturn err\n\t}\n\tif err := s.AddGeneratedConversionFunc((*v1.ContainerStatus)(nil), (*core.ContainerStatus)(nil), func(a, b interface{}, scope conversion.Scope) error {\n\t\treturn Convert_v1_ContainerStatus_To_core_ContainerStatus(a.(*v1.ContainerStatus), b.(*core.ContainerStatus), scope)\n\t}); err != nil {\n\t\treturn err\n\t}\n\tif err := s.AddGeneratedConversionFunc((*core.ContainerStatus)(nil), (*v1.ContainerStatus)(nil), func(a, b interface{}, scope conversion.Scope) error {\n\t\treturn Convert_core_ContainerStatus_To_v1_ContainerStatus(a.(*core.ContainerStatus), b.(*v1.ContainerStatus), scope)\n\t}); err != nil {\n\t\treturn err\n\t}\n\tif err := s.AddGeneratedConversionFunc((*v1.DaemonEndpoint)(nil), (*core.DaemonEndpoint)(nil), func(a, b interface{}, scope conversion.Scope) error {\n\t\treturn Convert_v1_DaemonEndpoint_To_core_DaemonEndpoint(a.(*v1.DaemonEndpoint), b.(*core.DaemonEndpoint), scope)\n\t}); err != nil {\n\t\treturn err\n\t}\n\tif err := s.AddGeneratedConversionFunc((*core.DaemonEndpoint)(nil), (*v1.DaemonEndpoint)(nil), func(a, b interface{}, scope conversion.Scope) error {\n\t\treturn Convert_core_DaemonEndpoint_To_v1_DaemonEndpoint(a.(*core.DaemonEndpoint), b.(*v1.DaemonEndpoint), scope)\n\t}); err != nil {\n\t\treturn err\n\t}\n\tif err := s.AddGeneratedConversionFunc((*v1.DownwardAPIProjection)(nil), (*core.DownwardAPIProjection)(nil), func(a, b interface{}, scope conversion.Scope) error {\n\t\treturn Convert_v1_DownwardAPIProjection_To_core_DownwardAPIProjection(a.(*v1.DownwardAPIProjection), b.(*core.DownwardAPIProjection), scope)\n\t}); err != nil {\n\t\treturn err\n\t}\n\tif err := s.AddGeneratedConversionFunc((*core.DownwardAPIProjection)(nil), (*v1.DownwardAPIProjection)(nil), func(a, b interface{}, scope conversion.Scope) error {\n\t\treturn Convert_core_DownwardAPIProjection_To_v1_DownwardAPIProjection(a.(*core.DownwardAPIProjection), b.(*v1.DownwardAPIProjection), scope)\n\t}); err != nil {\n\t\treturn err\n\t}\n\tif err := s.AddGeneratedConversionFunc((*v1.DownwardAPIVolumeFile)(nil), (*core.DownwardAPIVolumeFile)(nil), func(a, b interface{}, scope conversion.Scope) error {\n\t\treturn Convert_v1_DownwardAPIVolumeFile_To_core_DownwardAPIVolumeFile(a.(*v1.DownwardAPIVolumeFile), b.(*core.DownwardAPIVolumeFile), scope)\n\t}); err != nil {\n\t\treturn err\n\t}\n\tif err := s.AddGeneratedConversionFunc((*core.DownwardAPIVolumeFile)(nil), (*v1.DownwardAPIVolumeFile)(nil), func(a, b interface{}, scope conversion.Scope) error {\n\t\treturn Convert_core_DownwardAPIVolumeFile_To_v1_DownwardAPIVolumeFile(a.(*core.DownwardAPIVolumeFile), b.(*v1.DownwardAPIVolumeFile), scope)\n\t}); err != nil {\n\t\treturn err\n\t}\n\tif err := s.AddGeneratedConversionFunc((*v1.DownwardAPIVolumeSource)(nil), (*core.DownwardAPIVolumeSource)(nil), func(a, b interface{}, scope conversion.Scope) error {\n\t\treturn Convert_v1_DownwardAPIVolumeSource_To_core_DownwardAPIVolumeSource(a.(*v1.DownwardAPIVolumeSource), b.(*core.DownwardAPIVolumeSource), scope)\n\t}); err != nil {\n\t\treturn err\n\t}\n\tif err := s.AddGeneratedConversionFunc((*core.DownwardAPIVolumeSource)(nil), (*v1.DownwardAPIVolumeSource)(nil), func(a, b interface{}, scope conversion.Scope) error {\n\t\treturn Convert_core_DownwardAPIVolumeSource_To_v1_DownwardAPIVolumeSource(a.(*core.DownwardAPIVolumeSource), b.(*v1.DownwardAPIVolumeSource), scope)\n\t}); err != nil {\n\t\treturn err\n\t}\n\tif err := s.AddGeneratedConversionFunc((*v1.EmptyDirVolumeSource)(nil), (*core.EmptyDirVolumeSource)(nil), func(a, b interface{}, scope conversion.Scope) error {\n\t\treturn Convert_v1_EmptyDirVolumeSource_To_core_EmptyDirVolumeSource(a.(*v1.EmptyDirVolumeSource), b.(*core.EmptyDirVolumeSource), scope)\n\t}); err != nil {\n\t\treturn err\n\t}\n\tif err := s.AddGeneratedConversionFunc((*core.EmptyDirVolumeSource)(nil), (*v1.EmptyDirVolumeSource)(nil), func(a, b interface{}, scope conversion.Scope) error {\n\t\treturn Convert_core_EmptyDirVolumeSource_To_v1_EmptyDirVolumeSource(a.(*core.EmptyDirVolumeSource), b.(*v1.EmptyDirVolumeSource), scope)\n\t}); err != nil {\n\t\treturn err\n\t}\n\tif err := s.AddGeneratedConversionFunc((*v1.EndpointAddress)(nil), (*core.EndpointAddress)(nil), func(a, b interface{}, scope conversion.Scope) error {\n\t\treturn Convert_v1_EndpointAddress_To_core_EndpointAddress(a.(*v1.EndpointAddress), b.(*core.EndpointAddress), scope)\n\t}); err != nil {\n\t\treturn err\n\t}\n\tif err := s.AddGeneratedConversionFunc((*core.EndpointAddress)(nil), (*v1.EndpointAddress)(nil), func(a, b interface{}, scope conversion.Scope) error {\n\t\treturn Convert_core_EndpointAddress_To_v1_EndpointAddress(a.(*core.EndpointAddress), b.(*v1.EndpointAddress), scope)\n\t}); err != nil {\n\t\treturn err\n\t}\n\tif err := s.AddGeneratedConversionFunc((*v1.EndpointPort)(nil), (*core.EndpointPort)(nil), func(a, b interface{}, scope conversion.Scope) error {\n\t\treturn Convert_v1_EndpointPort_To_core_EndpointPort(a.(*v1.EndpointPort), b.(*core.EndpointPort), scope)\n\t}); err != nil {\n\t\treturn err\n\t}\n\tif err := s.AddGeneratedConversionFunc((*core.EndpointPort)(nil), (*v1.EndpointPort)(nil), func(a, b interface{}, scope conversion.Scope) error {\n\t\treturn Convert_core_EndpointPort_To_v1_EndpointPort(a.(*core.EndpointPort), b.(*v1.EndpointPort), scope)\n\t}); err != nil {\n\t\treturn err\n\t}\n\tif err := s.AddGeneratedConversionFunc((*v1.EndpointSubset)(nil), (*core.EndpointSubset)(nil), func(a, b interface{}, scope conversion.Scope) error {\n\t\treturn Convert_v1_EndpointSubset_To_core_EndpointSubset(a.(*v1.EndpointSubset), b.(*core.EndpointSubset), scope)\n\t}); err != nil {\n\t\treturn err\n\t}\n\tif err := s.AddGeneratedConversionFunc((*core.EndpointSubset)(nil), (*v1.EndpointSubset)(nil), func(a, b interface{}, scope conversion.Scope) error {\n\t\treturn Convert_core_EndpointSubset_To_v1_EndpointSubset(a.(*core.EndpointSubset), b.(*v1.EndpointSubset), scope)\n\t}); err != nil {\n\t\treturn err\n\t}\n\tif err := s.AddGeneratedConversionFunc((*v1.Endpoints)(nil), (*core.Endpoints)(nil), func(a, b interface{}, scope conversion.Scope) error {\n\t\treturn Convert_v1_Endpoints_To_core_Endpoints(a.(*v1.Endpoints), b.(*core.Endpoints), scope)\n\t}); err != nil {\n\t\treturn err\n\t}\n\tif err := s.AddGeneratedConversionFunc((*core.Endpoints)(nil), (*v1.Endpoints)(nil), func(a, b interface{}, scope conversion.Scope) error {\n\t\treturn Convert_core_Endpoints_To_v1_Endpoints(a.(*core.Endpoints), b.(*v1.Endpoints), scope)\n\t}); err != nil {\n\t\treturn err\n\t}\n\tif err := s.AddGeneratedConversionFunc((*v1.EndpointsList)(nil), (*core.EndpointsList)(nil), func(a, b interface{}, scope conversion.Scope) error {\n\t\treturn Convert_v1_EndpointsList_To_core_EndpointsList(a.(*v1.EndpointsList), b.(*core.EndpointsList), scope)\n\t}); err != nil {\n\t\treturn err\n\t}\n\tif err := s.AddGeneratedConversionFunc((*core.EndpointsList)(nil), (*v1.EndpointsList)(nil), func(a, b interface{}, scope conversion.Scope) error {\n\t\treturn Convert_core_EndpointsList_To_v1_EndpointsList(a.(*core.EndpointsList), b.(*v1.EndpointsList), scope)\n\t}); err != nil {\n\t\treturn err\n\t}\n\tif err := s.AddGeneratedConversionFunc((*v1.EnvFromSource)(nil), (*core.EnvFromSource)(nil), func(a, b interface{}, scope conversion.Scope) error {\n\t\treturn Convert_v1_EnvFromSource_To_core_EnvFromSource(a.(*v1.EnvFromSource), b.(*core.EnvFromSource), scope)\n\t}); err != nil {\n\t\treturn err\n\t}\n\tif err := s.AddGeneratedConversionFunc((*core.EnvFromSource)(nil), (*v1.EnvFromSource)(nil), func(a, b interface{}, scope conversion.Scope) error {\n\t\treturn Convert_core_EnvFromSource_To_v1_EnvFromSource(a.(*core.EnvFromSource), b.(*v1.EnvFromSource), scope)\n\t}); err != nil {\n\t\treturn err\n\t}\n\tif err := s.AddGeneratedConversionFunc((*v1.EnvVar)(nil), (*core.EnvVar)(nil), func(a, b interface{}, scope conversion.Scope) error {\n\t\treturn Convert_v1_EnvVar_To_core_EnvVar(a.(*v1.EnvVar), b.(*core.EnvVar), scope)\n\t}); err != nil {\n\t\treturn err\n\t}\n\tif err := s.AddGeneratedConversionFunc((*core.EnvVar)(nil), (*v1.EnvVar)(nil), func(a, b interface{}, scope conversion.Scope) error {\n\t\treturn Convert_core_EnvVar_To_v1_EnvVar(a.(*core.EnvVar), b.(*v1.EnvVar), scope)\n\t}); err != nil {\n\t\treturn err\n\t}\n\tif err := s.AddGeneratedConversionFunc((*v1.EnvVarSource)(nil), (*core.EnvVarSource)(nil), func(a, b interface{}, scope conversion.Scope) error {\n\t\treturn Convert_v1_EnvVarSource_To_core_EnvVarSource(a.(*v1.EnvVarSource), b.(*core.EnvVarSource), scope)\n\t}); err != nil {\n\t\treturn err\n\t}\n\tif err := s.AddGeneratedConversionFunc((*core.EnvVarSource)(nil), (*v1.EnvVarSource)(nil), func(a, b interface{}, scope conversion.Scope) error {\n\t\treturn Convert_core_EnvVarSource_To_v1_EnvVarSource(a.(*core.EnvVarSource), b.(*v1.EnvVarSource), scope)\n\t}); err != nil {\n\t\treturn err\n\t}\n\tif err := s.AddGeneratedConversionFunc((*v1.EphemeralContainer)(nil), (*core.EphemeralContainer)(nil), func(a, b interface{}, scope conversion.Scope) error {\n\t\treturn Convert_v1_EphemeralContainer_To_core_EphemeralContainer(a.(*v1.EphemeralContainer), b.(*core.EphemeralContainer), scope)\n\t}); err != nil {\n\t\treturn err\n\t}\n\tif err := s.AddGeneratedConversionFunc((*core.EphemeralContainer)(nil), (*v1.EphemeralContainer)(nil), func(a, b interface{}, scope conversion.Scope) error {\n\t\treturn Convert_core_EphemeralContainer_To_v1_EphemeralContainer(a.(*core.EphemeralContainer), b.(*v1.EphemeralContainer), scope)\n\t}); err != nil {\n\t\treturn err\n\t}\n\tif err := s.AddGeneratedConversionFunc((*v1.EphemeralContainerCommon)(nil), (*core.EphemeralContainerCommon)(nil), func(a, b interface{}, scope conversion.Scope) error {\n\t\treturn Convert_v1_EphemeralContainerCommon_To_core_EphemeralContainerCommon(a.(*v1.EphemeralContainerCommon), b.(*core.EphemeralContainerCommon), scope)\n\t}); err != nil {\n\t\treturn err\n\t}\n\tif err := s.AddGeneratedConversionFunc((*core.EphemeralContainerCommon)(nil), (*v1.EphemeralContainerCommon)(nil), func(a, b interface{}, scope conversion.Scope) error {\n\t\treturn Convert_core_EphemeralContainerCommon_To_v1_EphemeralContainerCommon(a.(*core.EphemeralContainerCommon), b.(*v1.EphemeralContainerCommon), scope)\n\t}); err != nil {\n\t\treturn err\n\t}\n\tif err := s.AddGeneratedConversionFunc((*v1.EphemeralVolumeSource)(nil), (*core.EphemeralVolumeSource)(nil), func(a, b interface{}, scope conversion.Scope) error {\n\t\treturn Convert_v1_EphemeralVolumeSource_To_core_EphemeralVolumeSource(a.(*v1.EphemeralVolumeSource), b.(*core.EphemeralVolumeSource), scope)\n\t}); err != nil {\n\t\treturn err\n\t}\n\tif err := s.AddGeneratedConversionFunc((*core.EphemeralVolumeSource)(nil), (*v1.EphemeralVolumeSource)(nil), func(a, b interface{}, scope conversion.Scope) error {\n\t\treturn Convert_core_EphemeralVolumeSource_To_v1_EphemeralVolumeSource(a.(*core.EphemeralVolumeSource), b.(*v1.EphemeralVolumeSource), scope)\n\t}); err != nil {\n\t\treturn err\n\t}\n\tif err := s.AddGeneratedConversionFunc((*v1.Event)(nil), (*core.Event)(nil), func(a, b interface{}, scope conversion.Scope) error {\n\t\treturn Convert_v1_Event_To_core_Event(a.(*v1.Event), b.(*core.Event), scope)\n\t}); err != nil {\n\t\treturn err\n\t}\n\tif err := s.AddGeneratedConversionFunc((*core.Event)(nil), (*v1.Event)(nil), func(a, b interface{}, scope conversion.Scope) error {\n\t\treturn Convert_core_Event_To_v1_Event(a.(*core.Event), b.(*v1.Event), scope)\n\t}); err != nil {\n\t\treturn err\n\t}\n\tif err := s.AddGeneratedConversionFunc((*v1.EventList)(nil), (*core.EventList)(nil), func(a, b interface{}, scope conversion.Scope) error {\n\t\treturn Convert_v1_EventList_To_core_EventList(a.(*v1.EventList), b.(*core.EventList), scope)\n\t}); err != nil {\n\t\treturn err\n\t}\n\tif err := s.AddGeneratedConversionFunc((*core.EventList)(nil), (*v1.EventList)(nil), func(a, b interface{}, scope conversion.Scope) error {\n\t\treturn Convert_core_EventList_To_v1_EventList(a.(*core.EventList), b.(*v1.EventList), scope)\n\t}); err != nil {\n\t\treturn err\n\t}\n\tif err := s.AddGeneratedConversionFunc((*v1.EventSeries)(nil), (*core.EventSeries)(nil), func(a, b interface{}, scope conversion.Scope) error {\n\t\treturn Convert_v1_EventSeries_To_core_EventSeries(a.(*v1.EventSeries), b.(*core.EventSeries), scope)\n\t}); err != nil {\n\t\treturn err\n\t}\n\tif err := s.AddGeneratedConversionFunc((*core.EventSeries)(nil), (*v1.EventSeries)(nil), func(a, b interface{}, scope conversion.Scope) error {\n\t\treturn Convert_core_EventSeries_To_v1_EventSeries(a.(*core.EventSeries), b.(*v1.EventSeries), scope)\n\t}); err != nil {\n\t\treturn err\n\t}\n\tif err := s.AddGeneratedConversionFunc((*v1.EventSource)(nil), (*core.EventSource)(nil), func(a, b interface{}, scope conversion.Scope) error {\n\t\treturn Convert_v1_EventSource_To_core_EventSource(a.(*v1.EventSource), b.(*core.EventSource), scope)\n\t}); err != nil {\n\t\treturn err\n\t}\n\tif err := s.AddGeneratedConversionFunc((*core.EventSource)(nil), (*v1.EventSource)(nil), func(a, b interface{}, scope conversion.Scope) error {\n\t\treturn Convert_core_EventSource_To_v1_EventSource(a.(*core.EventSource), b.(*v1.EventSource), scope)\n\t}); err != nil {\n\t\treturn err\n\t}\n\tif err := s.AddGeneratedConversionFunc((*v1.ExecAction)(nil), (*core.ExecAction)(nil), func(a, b interface{}, scope conversion.Scope) error {\n\t\treturn Convert_v1_ExecAction_To_core_ExecAction(a.(*v1.ExecAction), b.(*core.ExecAction), scope)\n\t}); err != nil {\n\t\treturn err\n\t}\n\tif err := s.AddGeneratedConversionFunc((*core.ExecAction)(nil), (*v1.ExecAction)(nil), func(a, b interface{}, scope conversion.Scope) error {\n\t\treturn Convert_core_ExecAction_To_v1_ExecAction(a.(*core.ExecAction), b.(*v1.ExecAction), scope)\n\t}); err != nil {\n\t\treturn err\n\t}\n\tif err := s.AddGeneratedConversionFunc((*v1.FCVolumeSource)(nil), (*core.FCVolumeSource)(nil), func(a, b interface{}, scope conversion.Scope) error {\n\t\treturn Convert_v1_FCVolumeSource_To_core_FCVolumeSource(a.(*v1.FCVolumeSource), b.(*core.FCVolumeSource), scope)\n\t}); err != nil {\n\t\treturn err\n\t}\n\tif err := s.AddGeneratedConversionFunc((*core.FCVolumeSource)(nil), (*v1.FCVolumeSource)(nil), func(a, b interface{}, scope conversion.Scope) error {\n\t\treturn Convert_core_FCVolumeSource_To_v1_FCVolumeSource(a.(*core.FCVolumeSource), b.(*v1.FCVolumeSource), scope)\n\t}); err != nil {\n\t\treturn err\n\t}\n\tif err := s.AddGeneratedConversionFunc((*v1.FlexPersistentVolumeSource)(nil), (*core.FlexPersistentVolumeSource)(nil), func(a, b interface{}, scope conversion.Scope) error {\n\t\treturn Convert_v1_FlexPersistentVolumeSource_To_core_FlexPersistentVolumeSource(a.(*v1.FlexPersistentVolumeSource), b.(*core.FlexPersistentVolumeSource), scope)\n\t}); err != nil {\n\t\treturn err\n\t}\n\tif err := s.AddGeneratedConversionFunc((*core.FlexPersistentVolumeSource)(nil), (*v1.FlexPersistentVolumeSource)(nil), func(a, b interface{}, scope conversion.Scope) error {\n\t\treturn Convert_core_FlexPersistentVolumeSource_To_v1_FlexPersistentVolumeSource(a.(*core.FlexPersistentVolumeSource), b.(*v1.FlexPersistentVolumeSource), scope)\n\t}); err != nil {\n\t\treturn err\n\t}\n\tif err := s.AddGeneratedConversionFunc((*v1.FlexVolumeSource)(nil), (*core.FlexVolumeSource)(nil), func(a, b interface{}, scope conversion.Scope) error {\n\t\treturn Convert_v1_FlexVolumeSource_To_core_FlexVolumeSource(a.(*v1.FlexVolumeSource), b.(*core.FlexVolumeSource), scope)\n\t}); err != nil {\n\t\treturn err\n\t}\n\tif err := s.AddGeneratedConversionFunc((*core.FlexVolumeSource)(nil), (*v1.FlexVolumeSource)(nil), func(a, b interface{}, scope conversion.Scope) error {\n\t\treturn Convert_core_FlexVolumeSource_To_v1_FlexVolumeSource(a.(*core.FlexVolumeSource), b.(*v1.FlexVolumeSource), scope)\n\t}); err != nil {\n\t\treturn err\n\t}\n\tif err := s.AddGeneratedConversionFunc((*v1.FlockerVolumeSource)(nil), (*core.FlockerVolumeSource)(nil), func(a, b interface{}, scope conversion.Scope) error {\n\t\treturn Convert_v1_FlockerVolumeSource_To_core_FlockerVolumeSource(a.(*v1.FlockerVolumeSource), b.(*core.FlockerVolumeSource), scope)\n\t}); err != nil {\n\t\treturn err\n\t}\n\tif err := s.AddGeneratedConversionFunc((*core.FlockerVolumeSource)(nil), (*v1.FlockerVolumeSource)(nil), func(a, b interface{}, scope conversion.Scope) error {\n\t\treturn Convert_core_FlockerVolumeSource_To_v1_FlockerVolumeSource(a.(*core.FlockerVolumeSource), b.(*v1.FlockerVolumeSource), scope)\n\t}); err != nil {\n\t\treturn err\n\t}\n\tif err := s.AddGeneratedConversionFunc((*v1.GCEPersistentDiskVolumeSource)(nil), (*core.GCEPersistentDiskVolumeSource)(nil), func(a, b interface{}, scope conversion.Scope) error {\n\t\treturn Convert_v1_GCEPersistentDiskVolumeSource_To_core_GCEPersistentDiskVolumeSource(a.(*v1.GCEPersistentDiskVolumeSource), b.(*core.GCEPersistentDiskVolumeSource), scope)\n\t}); err != nil {\n\t\treturn err\n\t}\n\tif err := s.AddGeneratedConversionFunc((*core.GCEPersistentDiskVolumeSource)(nil), (*v1.GCEPersistentDiskVolumeSource)(nil), func(a, b interface{}, scope conversion.Scope) error {\n\t\treturn Convert_core_GCEPersistentDiskVolumeSource_To_v1_GCEPersistentDiskVolumeSource(a.(*core.GCEPersistentDiskVolumeSource), b.(*v1.GCEPersistentDiskVolumeSource), scope)\n\t}); err != nil {\n\t\treturn err\n\t}\n\tif err := s.AddGeneratedConversionFunc((*v1.GRPCAction)(nil), (*core.GRPCAction)(nil), func(a, b interface{}, scope conversion.Scope) error {\n\t\treturn Convert_v1_GRPCAction_To_core_GRPCAction(a.(*v1.GRPCAction), b.(*core.GRPCAction), scope)\n\t}); err != nil {\n\t\treturn err\n\t}\n\tif err := s.AddGeneratedConversionFunc((*core.GRPCAction)(nil), (*v1.GRPCAction)(nil), func(a, b interface{}, scope conversion.Scope) error {\n\t\treturn Convert_core_GRPCAction_To_v1_GRPCAction(a.(*core.GRPCAction), b.(*v1.GRPCAction), scope)\n\t}); err != nil {\n\t\treturn err\n\t}\n\tif err := s.AddGeneratedConversionFunc((*v1.GitRepoVolumeSource)(nil), (*core.GitRepoVolumeSource)(nil), func(a, b interface{}, scope conversion.Scope) error {\n\t\treturn Convert_v1_GitRepoVolumeSource_To_core_GitRepoVolumeSource(a.(*v1.GitRepoVolumeSource), b.(*core.GitRepoVolumeSource), scope)\n\t}); err != nil {\n\t\treturn err\n\t}\n\tif err := s.AddGeneratedConversionFunc((*core.GitRepoVolumeSource)(nil), (*v1.GitRepoVolumeSource)(nil), func(a, b interface{}, scope conversion.Scope) error {\n\t\treturn Convert_core_GitRepoVolumeSource_To_v1_GitRepoVolumeSource(a.(*core.GitRepoVolumeSource), b.(*v1.GitRepoVolumeSource), scope)\n\t}); err != nil {\n\t\treturn err\n\t}\n\tif err := s.AddGeneratedConversionFunc((*v1.GlusterfsPersistentVolumeSource)(nil), (*core.GlusterfsPersistentVolumeSource)(nil), func(a, b interface{}, scope conversion.Scope) error {\n\t\treturn Convert_v1_GlusterfsPersistentVolumeSource_To_core_GlusterfsPersistentVolumeSource(a.(*v1.GlusterfsPersistentVolumeSource), b.(*core.GlusterfsPersistentVolumeSource), scope)\n\t}); err != nil {\n\t\treturn err\n\t}\n\tif err := s.AddGeneratedConversionFunc((*core.GlusterfsPersistentVolumeSource)(nil), (*v1.GlusterfsPersistentVolumeSource)(nil), func(a, b interface{}, scope conversion.Scope) error {\n\t\treturn Convert_core_GlusterfsPersistentVolumeSource_To_v1_GlusterfsPersistentVolumeSource(a.(*core.GlusterfsPersistentVolumeSource), b.(*v1.GlusterfsPersistentVolumeSource), scope)\n\t}); err != nil {\n\t\treturn err\n\t}\n\tif err := s.AddGeneratedConversionFunc((*v1.GlusterfsVolumeSource)(nil), (*core.GlusterfsVolumeSource)(nil), func(a, b interface{}, scope conversion.Scope) error {\n\t\treturn Convert_v1_GlusterfsVolumeSource_To_core_GlusterfsVolumeSource(a.(*v1.GlusterfsVolumeSource), b.(*core.GlusterfsVolumeSource), scope)\n\t}); err != nil {\n\t\treturn err\n\t}\n\tif err := s.AddGeneratedConversionFunc((*core.GlusterfsVolumeSource)(nil), (*v1.GlusterfsVolumeSource)(nil), func(a, b interface{}, scope conversion.Scope) error {\n\t\treturn Convert_core_GlusterfsVolumeSource_To_v1_GlusterfsVolumeSource(a.(*core.GlusterfsVolumeSource), b.(*v1.GlusterfsVolumeSource), scope)\n\t}); err != nil {\n\t\treturn err\n\t}\n\tif err := s.AddGeneratedConversionFunc((*v1.HTTPGetAction)(nil), (*core.HTTPGetAction)(nil), func(a, b interface{}, scope conversion.Scope) error {\n\t\treturn Convert_v1_HTTPGetAction_To_core_HTTPGetAction(a.(*v1.HTTPGetAction), b.(*core.HTTPGetAction), scope)\n\t}); err != nil {\n\t\treturn err\n\t}\n\tif err := s.AddGeneratedConversionFunc((*core.HTTPGetAction)(nil), (*v1.HTTPGetAction)(nil), func(a, b interface{}, scope conversion.Scope) error {\n\t\treturn Convert_core_HTTPGetAction_To_v1_HTTPGetAction(a.(*core.HTTPGetAction), b.(*v1.HTTPGetAction), scope)\n\t}); err != nil {\n\t\treturn err\n\t}\n\tif err := s.AddGeneratedConversionFunc((*v1.HTTPHeader)(nil), (*core.HTTPHeader)(nil), func(a, b interface{}, scope conversion.Scope) error {\n\t\treturn Convert_v1_HTTPHeader_To_core_HTTPHeader(a.(*v1.HTTPHeader), b.(*core.HTTPHeader), scope)\n\t}); err != nil {\n\t\treturn err\n\t}\n\tif err := s.AddGeneratedConversionFunc((*core.HTTPHeader)(nil), (*v1.HTTPHeader)(nil), func(a, b interface{}, scope conversion.Scope) error {\n\t\treturn Convert_core_HTTPHeader_To_v1_HTTPHeader(a.(*core.HTTPHeader), b.(*v1.HTTPHeader), scope)\n\t}); err != nil {\n\t\treturn err\n\t}\n\tif err := s.AddGeneratedConversionFunc((*v1.HostAlias)(nil), (*core.HostAlias)(nil), func(a, b interface{}, scope conversion.Scope) error {\n\t\treturn Convert_v1_HostAlias_To_core_HostAlias(a.(*v1.HostAlias), b.(*core.HostAlias), scope)\n\t}); err != nil {\n\t\treturn err\n\t}\n\tif err := s.AddGeneratedConversionFunc((*core.HostAlias)(nil), (*v1.HostAlias)(nil), func(a, b interface{}, scope conversion.Scope) error {\n\t\treturn Convert_core_HostAlias_To_v1_HostAlias(a.(*core.HostAlias), b.(*v1.HostAlias), scope)\n\t}); err != nil {\n\t\treturn err\n\t}\n\tif err := s.AddGeneratedConversionFunc((*v1.HostIP)(nil), (*core.HostIP)(nil), func(a, b interface{}, scope conversion.Scope) error {\n\t\treturn Convert_v1_HostIP_To_core_HostIP(a.(*v1.HostIP), b.(*core.HostIP), scope)\n\t}); err != nil {\n\t\treturn err\n\t}\n\tif err := s.AddGeneratedConversionFunc((*core.HostIP)(nil), (*v1.HostIP)(nil), func(a, b interface{}, scope conversion.Scope) error {\n\t\treturn Convert_core_HostIP_To_v1_HostIP(a.(*core.HostIP), b.(*v1.HostIP), scope)\n\t}); err != nil {\n\t\treturn err\n\t}\n\tif err := s.AddGeneratedConversionFunc((*v1.HostPathVolumeSource)(nil), (*core.HostPathVolumeSource)(nil), func(a, b interface{}, scope conversion.Scope) error {\n\t\treturn Convert_v1_HostPathVolumeSource_To_core_HostPathVolumeSource(a.(*v1.HostPathVolumeSource), b.(*core.HostPathVolumeSource), scope)\n\t}); err != nil {\n\t\treturn err\n\t}\n\tif err := s.AddGeneratedConversionFunc((*core.HostPathVolumeSource)(nil), (*v1.HostPathVolumeSource)(nil), func(a, b interface{}, scope conversion.Scope) error {\n\t\treturn Convert_core_HostPathVolumeSource_To_v1_HostPathVolumeSource(a.(*core.HostPathVolumeSource), b.(*v1.HostPathVolumeSource), scope)\n\t}); err != nil {\n\t\treturn err\n\t}\n\tif err := s.AddGeneratedConversionFunc((*v1.ISCSIPersistentVolumeSource)(nil), (*core.ISCSIPersistentVolumeSource)(nil), func(a, b interface{}, scope conversion.Scope) error {\n\t\treturn Convert_v1_ISCSIPersistentVolumeSource_To_core_ISCSIPersistentVolumeSource(a.(*v1.ISCSIPersistentVolumeSource), b.(*core.ISCSIPersistentVolumeSource), scope)\n\t}); err != nil {\n\t\treturn err\n\t}\n\tif err := s.AddGeneratedConversionFunc((*core.ISCSIPersistentVolumeSource)(nil), (*v1.ISCSIPersistentVolumeSource)(nil), func(a, b interface{}, scope conversion.Scope) error {\n\t\treturn Convert_core_ISCSIPersistentVolumeSource_To_v1_ISCSIPersistentVolumeSource(a.(*core.ISCSIPersistentVolumeSource), b.(*v1.ISCSIPersistentVolumeSource), scope)\n\t}); err != nil {\n\t\treturn err\n\t}\n\tif err := s.AddGeneratedConversionFunc((*v1.ISCSIVolumeSource)(nil), (*core.ISCSIVolumeSource)(nil), func(a, b interface{}, scope conversion.Scope) error {\n\t\treturn Convert_v1_ISCSIVolumeSource_To_core_ISCSIVolumeSource(a.(*v1.ISCSIVolumeSource), b.(*core.ISCSIVolumeSource), scope)\n\t}); err != nil {\n\t\treturn err\n\t}\n\tif err := s.AddGeneratedConversionFunc((*core.ISCSIVolumeSource)(nil), (*v1.ISCSIVolumeSource)(nil), func(a, b interface{}, scope conversion.Scope) error {\n\t\treturn Convert_core_ISCSIVolumeSource_To_v1_ISCSIVolumeSource(a.(*core.ISCSIVolumeSource), b.(*v1.ISCSIVolumeSource), scope)\n\t}); err != nil {\n\t\treturn err\n\t}\n\tif err := s.AddGeneratedConversionFunc((*v1.KeyToPath)(nil), (*core.KeyToPath)(nil), func(a, b interface{}, scope conversion.Scope) error {\n\t\treturn Convert_v1_KeyToPath_To_core_KeyToPath(a.(*v1.KeyToPath), b.(*core.KeyToPath), scope)\n\t}); err != nil {\n\t\treturn err\n\t}\n\tif err := s.AddGeneratedConversionFunc((*core.KeyToPath)(nil), (*v1.KeyToPath)(nil), func(a, b interface{}, scope conversion.Scope) error {\n\t\treturn Convert_core_KeyToPath_To_v1_KeyToPath(a.(*core.KeyToPath), b.(*v1.KeyToPath), scope)\n\t}); err != nil {\n\t\treturn err\n\t}\n\tif err := s.AddGeneratedConversionFunc((*v1.Lifecycle)(nil), (*core.Lifecycle)(nil), func(a, b interface{}, scope conversion.Scope) error {\n\t\treturn Convert_v1_Lifecycle_To_core_Lifecycle(a.(*v1.Lifecycle), b.(*core.Lifecycle), scope)\n\t}); err != nil {\n\t\treturn err\n\t}\n\tif err := s.AddGeneratedConversionFunc((*core.Lifecycle)(nil), (*v1.Lifecycle)(nil), func(a, b interface{}, scope conversion.Scope) error {\n\t\treturn Convert_core_Lifecycle_To_v1_Lifecycle(a.(*core.Lifecycle), b.(*v1.Lifecycle), scope)\n\t}); err != nil {\n\t\treturn err\n\t}\n\tif err := s.AddGeneratedConversionFunc((*v1.LifecycleHandler)(nil), (*core.LifecycleHandler)(nil), func(a, b interface{}, scope conversion.Scope) error {\n\t\treturn Convert_v1_LifecycleHandler_To_core_LifecycleHandler(a.(*v1.LifecycleHandler), b.(*core.LifecycleHandler), scope)\n\t}); err != nil {\n\t\treturn err\n\t}\n\tif err := s.AddGeneratedConversionFunc((*core.LifecycleHandler)(nil), (*v1.LifecycleHandler)(nil), func(a, b interface{}, scope conversion.Scope) error {\n\t\treturn Convert_core_LifecycleHandler_To_v1_LifecycleHandler(a.(*core.LifecycleHandler), b.(*v1.LifecycleHandler), scope)\n\t}); err != nil {\n\t\treturn err\n\t}\n\tif err := s.AddGeneratedConversionFunc((*v1.LimitRange)(nil), (*core.LimitRange)(nil), func(a, b interface{}, scope conversion.Scope) error {\n\t\treturn Convert_v1_LimitRange_To_core_LimitRange(a.(*v1.LimitRange), b.(*core.LimitRange), scope)\n\t}); err != nil {\n\t\treturn err\n\t}\n\tif err := s.AddGeneratedConversionFunc((*core.LimitRange)(nil), (*v1.LimitRange)(nil), func(a, b interface{}, scope conversion.Scope) error {\n\t\treturn Convert_core_LimitRange_To_v1_LimitRange(a.(*core.LimitRange), b.(*v1.LimitRange), scope)\n\t}); err != nil {\n\t\treturn err\n\t}\n\tif err := s.AddGeneratedConversionFunc((*v1.LimitRangeItem)(nil), (*core.LimitRangeItem)(nil), func(a, b interface{}, scope conversion.Scope) error {\n\t\treturn Convert_v1_LimitRangeItem_To_core_LimitRangeItem(a.(*v1.LimitRangeItem), b.(*core.LimitRangeItem), scope)\n\t}); err != nil {\n\t\treturn err\n\t}\n\tif err := s.AddGeneratedConversionFunc((*core.LimitRangeItem)(nil), (*v1.LimitRangeItem)(nil), func(a, b interface{}, scope conversion.Scope) error {\n\t\treturn Convert_core_LimitRangeItem_To_v1_LimitRangeItem(a.(*core.LimitRangeItem), b.(*v1.LimitRangeItem), scope)\n\t}); err != nil {\n\t\treturn err\n\t}\n\tif err := s.AddGeneratedConversionFunc((*v1.LimitRangeList)(nil), (*core.LimitRangeList)(nil), func(a, b interface{}, scope conversion.Scope) error {\n\t\treturn Convert_v1_LimitRangeList_To_core_LimitRangeList(a.(*v1.LimitRangeList), b.(*core.LimitRangeList), scope)\n\t}); err != nil {\n\t\treturn err\n\t}\n\tif err := s.AddGeneratedConversionFunc((*core.LimitRangeList)(nil), (*v1.LimitRangeList)(nil), func(a, b interface{}, scope conversion.Scope) error {\n\t\treturn Convert_core_LimitRangeList_To_v1_LimitRangeList(a.(*core.LimitRangeList), b.(*v1.LimitRangeList), scope)\n\t}); err != nil {\n\t\treturn err\n\t}\n\tif err := s.AddGeneratedConversionFunc((*v1.LimitRangeSpec)(nil), (*core.LimitRangeSpec)(nil), func(a, b interface{}, scope conversion.Scope) error {\n\t\treturn Convert_v1_LimitRangeSpec_To_core_LimitRangeSpec(a.(*v1.LimitRangeSpec), b.(*core.LimitRangeSpec), scope)\n\t}); err != nil {\n\t\treturn err\n\t}\n\tif err := s.AddGeneratedConversionFunc((*core.LimitRangeSpec)(nil), (*v1.LimitRangeSpec)(nil), func(a, b interface{}, scope conversion.Scope) error {\n\t\treturn Convert_core_LimitRangeSpec_To_v1_LimitRangeSpec(a.(*core.LimitRangeSpec), b.(*v1.LimitRangeSpec), scope)\n\t}); err != nil {\n\t\treturn err\n\t}\n\tif err := s.AddGeneratedConversionFunc((*v1.List)(nil), (*core.List)(nil), func(a, b interface{}, scope conversion.Scope) error {\n\t\treturn Convert_v1_List_To_core_List(a.(*v1.List), b.(*core.List), scope)\n\t}); err != nil {\n\t\treturn err\n\t}\n\tif err := s.AddGeneratedConversionFunc((*core.List)(nil), (*v1.List)(nil), func(a, b interface{}, scope conversion.Scope) error {\n\t\treturn Convert_core_List_To_v1_List(a.(*core.List), b.(*v1.List), scope)\n\t}); err != nil {\n\t\treturn err\n\t}\n\tif err := s.AddGeneratedConversionFunc((*v1.LoadBalancerIngress)(nil), (*core.LoadBalancerIngress)(nil), func(a, b interface{}, scope conversion.Scope) error {\n\t\treturn Convert_v1_LoadBalancerIngress_To_core_LoadBalancerIngress(a.(*v1.LoadBalancerIngress), b.(*core.LoadBalancerIngress), scope)\n\t}); err != nil {\n\t\treturn err\n\t}\n\tif err := s.AddGeneratedConversionFunc((*core.LoadBalancerIngress)(nil), (*v1.LoadBalancerIngress)(nil), func(a, b interface{}, scope conversion.Scope) error {\n\t\treturn Convert_core_LoadBalancerIngress_To_v1_LoadBalancerIngress(a.(*core.LoadBalancerIngress), b.(*v1.LoadBalancerIngress), scope)\n\t}); err != nil {\n\t\treturn err\n\t}\n\tif err := s.AddGeneratedConversionFunc((*v1.LocalObjectReference)(nil), (*core.LocalObjectReference)(nil), func(a, b interface{}, scope conversion.Scope) error {\n\t\treturn Convert_v1_LocalObjectReference_To_core_LocalObjectReference(a.(*v1.LocalObjectReference), b.(*core.LocalObjectReference), scope)\n\t}); err != nil {\n\t\treturn err\n\t}\n\tif err := s.AddGeneratedConversionFunc((*core.LocalObjectReference)(nil), (*v1.LocalObjectReference)(nil), func(a, b interface{}, scope conversion.Scope) error {\n\t\treturn Convert_core_LocalObjectReference_To_v1_LocalObjectReference(a.(*core.LocalObjectReference), b.(*v1.LocalObjectReference), scope)\n\t}); err != nil {\n\t\treturn err\n\t}\n\tif err := s.AddGeneratedConversionFunc((*v1.LocalVolumeSource)(nil), (*core.LocalVolumeSource)(nil), func(a, b interface{}, scope conversion.Scope) error {\n\t\treturn Convert_v1_LocalVolumeSource_To_core_LocalVolumeSource(a.(*v1.LocalVolumeSource), b.(*core.LocalVolumeSource), scope)\n\t}); err != nil {\n\t\treturn err\n\t}\n\tif err := s.AddGeneratedConversionFunc((*core.LocalVolumeSource)(nil), (*v1.LocalVolumeSource)(nil), func(a, b interface{}, scope conversion.Scope) error {\n\t\treturn Convert_core_LocalVolumeSource_To_v1_LocalVolumeSource(a.(*core.LocalVolumeSource), b.(*v1.LocalVolumeSource), scope)\n\t}); err != nil {\n\t\treturn err\n\t}\n\tif err := s.AddGeneratedConversionFunc((*v1.NFSVolumeSource)(nil), (*core.NFSVolumeSource)(nil), func(a, b interface{}, scope conversion.Scope) error {\n\t\treturn Convert_v1_NFSVolumeSource_To_core_NFSVolumeSource(a.(*v1.NFSVolumeSource), b.(*core.NFSVolumeSource), scope)\n\t}); err != nil {\n\t\treturn err\n\t}\n\tif err := s.AddGeneratedConversionFunc((*core.NFSVolumeSource)(nil), (*v1.NFSVolumeSource)(nil), func(a, b interface{}, scope conversion.Scope) error {\n\t\treturn Convert_core_NFSVolumeSource_To_v1_NFSVolumeSource(a.(*core.NFSVolumeSource), b.(*v1.NFSVolumeSource), scope)\n\t}); err != nil {\n\t\treturn err\n\t}\n\tif err := s.AddGeneratedConversionFunc((*v1.Namespace)(nil), (*core.Namespace)(nil), func(a, b interface{}, scope conversion.Scope) error {\n\t\treturn Convert_v1_Namespace_To_core_Namespace(a.(*v1.Namespace), b.(*core.Namespace), scope)\n\t}); err != nil {\n\t\treturn err\n\t}\n\tif err := s.AddGeneratedConversionFunc((*core.Namespace)(nil), (*v1.Namespace)(nil), func(a, b interface{}, scope conversion.Scope) error {\n\t\treturn Convert_core_Namespace_To_v1_Namespace(a.(*core.Namespace), b.(*v1.Namespace), scope)\n\t}); err != nil {\n\t\treturn err\n\t}\n\tif err := s.AddGeneratedConversionFunc((*v1.NamespaceCondition)(nil), (*core.NamespaceCondition)(nil), func(a, b interface{}, scope conversion.Scope) error {\n\t\treturn Convert_v1_NamespaceCondition_To_core_NamespaceCondition(a.(*v1.NamespaceCondition), b.(*core.NamespaceCondition), scope)\n\t}); err != nil {\n\t\treturn err\n\t}\n\tif err := s.AddGeneratedConversionFunc((*core.NamespaceCondition)(nil), (*v1.NamespaceCondition)(nil), func(a, b interface{}, scope conversion.Scope) error {\n\t\treturn Convert_core_NamespaceCondition_To_v1_NamespaceCondition(a.(*core.NamespaceCondition), b.(*v1.NamespaceCondition), scope)\n\t}); err != nil {\n\t\treturn err\n\t}\n\tif err := s.AddGeneratedConversionFunc((*v1.NamespaceList)(nil), (*core.NamespaceList)(nil), func(a, b interface{}, scope conversion.Scope) error {\n\t\treturn Convert_v1_NamespaceList_To_core_NamespaceList(a.(*v1.NamespaceList), b.(*core.NamespaceList), scope)\n\t}); err != nil {\n\t\treturn err\n\t}\n\tif err := s.AddGeneratedConversionFunc((*core.NamespaceList)(nil), (*v1.NamespaceList)(nil), func(a, b interface{}, scope conversion.Scope) error {\n\t\treturn Convert_core_NamespaceList_To_v1_NamespaceList(a.(*core.NamespaceList), b.(*v1.NamespaceList), scope)\n\t}); err != nil {\n\t\treturn err\n\t}\n\tif err := s.AddGeneratedConversionFunc((*v1.NamespaceSpec)(nil), (*core.NamespaceSpec)(nil), func(a, b interface{}, scope conversion.Scope) error {\n\t\treturn Convert_v1_NamespaceSpec_To_core_NamespaceSpec(a.(*v1.NamespaceSpec), b.(*core.NamespaceSpec), scope)\n\t}); err != nil {\n\t\treturn err\n\t}\n\tif err := s.AddGeneratedConversionFunc((*core.NamespaceSpec)(nil), (*v1.NamespaceSpec)(nil), func(a, b interface{}, scope conversion.Scope) error {\n\t\treturn Convert_core_NamespaceSpec_To_v1_NamespaceSpec(a.(*core.NamespaceSpec), b.(*v1.NamespaceSpec), scope)\n\t}); err != nil {\n\t\treturn err\n\t}\n\tif err := s.AddGeneratedConversionFunc((*v1.NamespaceStatus)(nil), (*core.NamespaceStatus)(nil), func(a, b interface{}, scope conversion.Scope) error {\n\t\treturn Convert_v1_NamespaceStatus_To_core_NamespaceStatus(a.(*v1.NamespaceStatus), b.(*core.NamespaceStatus), scope)\n\t}); err != nil {\n\t\treturn err\n\t}\n\tif err := s.AddGeneratedConversionFunc((*core.NamespaceStatus)(nil), (*v1.NamespaceStatus)(nil), func(a, b interface{}, scope conversion.Scope) error {\n\t\treturn Convert_core_NamespaceStatus_To_v1_NamespaceStatus(a.(*core.NamespaceStatus), b.(*v1.NamespaceStatus), scope)\n\t}); err != nil {\n\t\treturn err\n\t}\n\tif err := s.AddGeneratedConversionFunc((*v1.Node)(nil), (*core.Node)(nil), func(a, b interface{}, scope conversion.Scope) error {\n\t\treturn Convert_v1_Node_To_core_Node(a.(*v1.Node), b.(*core.Node), scope)\n\t}); err != nil {\n\t\treturn err\n\t}\n\tif err := s.AddGeneratedConversionFunc((*core.Node)(nil), (*v1.Node)(nil), func(a, b interface{}, scope conversion.Scope) error {\n\t\treturn Convert_core_Node_To_v1_Node(a.(*core.Node), b.(*v1.Node), scope)\n\t}); err != nil {\n\t\treturn err\n\t}\n\tif err := s.AddGeneratedConversionFunc((*v1.NodeAddress)(nil), (*core.NodeAddress)(nil), func(a, b interface{}, scope conversion.Scope) error {\n\t\treturn Convert_v1_NodeAddress_To_core_NodeAddress(a.(*v1.NodeAddress), b.(*core.NodeAddress), scope)\n\t}); err != nil {\n\t\treturn err\n\t}\n\tif err := s.AddGeneratedConversionFunc((*core.NodeAddress)(nil), (*v1.NodeAddress)(nil), func(a, b interface{}, scope conversion.Scope) error {\n\t\treturn Convert_core_NodeAddress_To_v1_NodeAddress(a.(*core.NodeAddress), b.(*v1.NodeAddress), scope)\n\t}); err != nil {\n\t\treturn err\n\t}\n\tif err := s.AddGeneratedConversionFunc((*v1.NodeAffinity)(nil), (*core.NodeAffinity)(nil), func(a, b interface{}, scope conversion.Scope) error {\n\t\treturn Convert_v1_NodeAffinity_To_core_NodeAffinity(a.(*v1.NodeAffinity), b.(*core.NodeAffinity), scope)\n\t}); err != nil {\n\t\treturn err\n\t}\n\tif err := s.AddGeneratedConversionFunc((*core.NodeAffinity)(nil), (*v1.NodeAffinity)(nil), func(a, b interface{}, scope conversion.Scope) error {\n\t\treturn Convert_core_NodeAffinity_To_v1_NodeAffinity(a.(*core.NodeAffinity), b.(*v1.NodeAffinity), scope)\n\t}); err != nil {\n\t\treturn err\n\t}\n\tif err := s.AddGeneratedConversionFunc((*v1.NodeCondition)(nil), (*core.NodeCondition)(nil), func(a, b interface{}, scope conversion.Scope) error {\n\t\treturn Convert_v1_NodeCondition_To_core_NodeCondition(a.(*v1.NodeCondition), b.(*core.NodeCondition), scope)\n\t}); err != nil {\n\t\treturn err\n\t}\n\tif err := s.AddGeneratedConversionFunc((*core.NodeCondition)(nil), (*v1.NodeCondition)(nil), func(a, b interface{}, scope conversion.Scope) error {\n\t\treturn Convert_core_NodeCondition_To_v1_NodeCondition(a.(*core.NodeCondition), b.(*v1.NodeCondition), scope)\n\t}); err != nil {\n\t\treturn err\n\t}\n\tif err := s.AddGeneratedConversionFunc((*v1.NodeConfigSource)(nil), (*core.NodeConfigSource)(nil), func(a, b interface{}, scope conversion.Scope) error {\n\t\treturn Convert_v1_NodeConfigSource_To_core_NodeConfigSource(a.(*v1.NodeConfigSource), b.(*core.NodeConfigSource), scope)\n\t}); err != nil {\n\t\treturn err\n\t}\n\tif err := s.AddGeneratedConversionFunc((*core.NodeConfigSource)(nil), (*v1.NodeConfigSource)(nil), func(a, b interface{}, scope conversion.Scope) error {\n\t\treturn Convert_core_NodeConfigSource_To_v1_NodeConfigSource(a.(*core.NodeConfigSource), b.(*v1.NodeConfigSource), scope)\n\t}); err != nil {\n\t\treturn err\n\t}\n\tif err := s.AddGeneratedConversionFunc((*v1.NodeConfigStatus)(nil), (*core.NodeConfigStatus)(nil), func(a, b interface{}, scope conversion.Scope) error {\n\t\treturn Convert_v1_NodeConfigStatus_To_core_NodeConfigStatus(a.(*v1.NodeConfigStatus), b.(*core.NodeConfigStatus), scope)\n\t}); err != nil {\n\t\treturn err\n\t}\n\tif err := s.AddGeneratedConversionFunc((*core.NodeConfigStatus)(nil), (*v1.NodeConfigStatus)(nil), func(a, b interface{}, scope conversion.Scope) error {\n\t\treturn Convert_core_NodeConfigStatus_To_v1_NodeConfigStatus(a.(*core.NodeConfigStatus), b.(*v1.NodeConfigStatus), scope)\n\t}); err != nil {\n\t\treturn err\n\t}\n\tif err := s.AddGeneratedConversionFunc((*v1.NodeDaemonEndpoints)(nil), (*core.NodeDaemonEndpoints)(nil), func(a, b interface{}, scope conversion.Scope) error {\n\t\treturn Convert_v1_NodeDaemonEndpoints_To_core_NodeDaemonEndpoints(a.(*v1.NodeDaemonEndpoints), b.(*core.NodeDaemonEndpoints), scope)\n\t}); err != nil {\n\t\treturn err\n\t}\n\tif err := s.AddGeneratedConversionFunc((*core.NodeDaemonEndpoints)(nil), (*v1.NodeDaemonEndpoints)(nil), func(a, b interface{}, scope conversion.Scope) error {\n\t\treturn Convert_core_NodeDaemonEndpoints_To_v1_NodeDaemonEndpoints(a.(*core.NodeDaemonEndpoints), b.(*v1.NodeDaemonEndpoints), scope)\n\t}); err != nil {\n\t\treturn err\n\t}\n\tif err := s.AddGeneratedConversionFunc((*v1.NodeList)(nil), (*core.NodeList)(nil), func(a, b interface{}, scope conversion.Scope) error {\n\t\treturn Convert_v1_NodeList_To_core_NodeList(a.(*v1.NodeList), b.(*core.NodeList), scope)\n\t}); err != nil {\n\t\treturn err\n\t}\n\tif err := s.AddGeneratedConversionFunc((*core.NodeList)(nil), (*v1.NodeList)(nil), func(a, b interface{}, scope conversion.Scope) error {\n\t\treturn Convert_core_NodeList_To_v1_NodeList(a.(*core.NodeList), b.(*v1.NodeList), scope)\n\t}); err != nil {\n\t\treturn err\n\t}\n\tif err := s.AddGeneratedConversionFunc((*v1.NodeProxyOptions)(nil), (*core.NodeProxyOptions)(nil), func(a, b interface{}, scope conversion.Scope) error {\n\t\treturn Convert_v1_NodeProxyOptions_To_core_NodeProxyOptions(a.(*v1.NodeProxyOptions), b.(*core.NodeProxyOptions), scope)\n\t}); err != nil {\n\t\treturn err\n\t}\n\tif err := s.AddGeneratedConversionFunc((*core.NodeProxyOptions)(nil), (*v1.NodeProxyOptions)(nil), func(a, b interface{}, scope conversion.Scope) error {\n\t\treturn Convert_core_NodeProxyOptions_To_v1_NodeProxyOptions(a.(*core.NodeProxyOptions), b.(*v1.NodeProxyOptions), scope)\n\t}); err != nil {\n\t\treturn err\n\t}\n\tif err := s.AddGeneratedConversionFunc((*v1.NodeResources)(nil), (*core.NodeResources)(nil), func(a, b interface{}, scope conversion.Scope) error {\n\t\treturn Convert_v1_NodeResources_To_core_NodeResources(a.(*v1.NodeResources), b.(*core.NodeResources), scope)\n\t}); err != nil {\n\t\treturn err\n\t}\n\tif err := s.AddGeneratedConversionFunc((*core.NodeResources)(nil), (*v1.NodeResources)(nil), func(a, b interface{}, scope conversion.Scope) error {\n\t\treturn Convert_core_NodeResources_To_v1_NodeResources(a.(*core.NodeResources), b.(*v1.NodeResources), scope)\n\t}); err != nil {\n\t\treturn err\n\t}\n\tif err := s.AddGeneratedConversionFunc((*v1.NodeSelector)(nil), (*core.NodeSelector)(nil), func(a, b interface{}, scope conversion.Scope) error {\n\t\treturn Convert_v1_NodeSelector_To_core_NodeSelector(a.(*v1.NodeSelector), b.(*core.NodeSelector), scope)\n\t}); err != nil {\n\t\treturn err\n\t}\n\tif err := s.AddGeneratedConversionFunc((*core.NodeSelector)(nil), (*v1.NodeSelector)(nil), func(a, b interface{}, scope conversion.Scope) error {\n\t\treturn Convert_core_NodeSelector_To_v1_NodeSelector(a.(*core.NodeSelector), b.(*v1.NodeSelector), scope)\n\t}); err != nil {\n\t\treturn err\n\t}\n\tif err := s.AddGeneratedConversionFunc((*v1.NodeSelectorRequirement)(nil), (*core.NodeSelectorRequirement)(nil), func(a, b interface{}, scope conversion.Scope) error {\n\t\treturn Convert_v1_NodeSelectorRequirement_To_core_NodeSelectorRequirement(a.(*v1.NodeSelectorRequirement), b.(*core.NodeSelectorRequirement), scope)\n\t}); err != nil {\n\t\treturn err\n\t}\n\tif err := s.AddGeneratedConversionFunc((*core.NodeSelectorRequirement)(nil), (*v1.NodeSelectorRequirement)(nil), func(a, b interface{}, scope conversion.Scope) error {\n\t\treturn Convert_core_NodeSelectorRequirement_To_v1_NodeSelectorRequirement(a.(*core.NodeSelectorRequirement), b.(*v1.NodeSelectorRequirement), scope)\n\t}); err != nil {\n\t\treturn err\n\t}\n\tif err := s.AddGeneratedConversionFunc((*v1.NodeSelectorTerm)(nil), (*core.NodeSelectorTerm)(nil), func(a, b interface{}, scope conversion.Scope) error {\n\t\treturn Convert_v1_NodeSelectorTerm_To_core_NodeSelectorTerm(a.(*v1.NodeSelectorTerm), b.(*core.NodeSelectorTerm), scope)\n\t}); err != nil {\n\t\treturn err\n\t}\n\tif err := s.AddGeneratedConversionFunc((*core.NodeSelectorTerm)(nil), (*v1.NodeSelectorTerm)(nil), func(a, b interface{}, scope conversion.Scope) error {\n\t\treturn Convert_core_NodeSelectorTerm_To_v1_NodeSelectorTerm(a.(*core.NodeSelectorTerm), b.(*v1.NodeSelectorTerm), scope)\n\t}); err != nil {\n\t\treturn err\n\t}\n\tif err := s.AddGeneratedConversionFunc((*v1.NodeStatus)(nil), (*core.NodeStatus)(nil), func(a, b interface{}, scope conversion.Scope) error {\n\t\treturn Convert_v1_NodeStatus_To_core_NodeStatus(a.(*v1.NodeStatus), b.(*core.NodeStatus), scope)\n\t}); err != nil {\n\t\treturn err\n\t}\n\tif err := s.AddGeneratedConversionFunc((*core.NodeStatus)(nil), (*v1.NodeStatus)(nil), func(a, b interface{}, scope conversion.Scope) error {\n\t\treturn Convert_core_NodeStatus_To_v1_NodeStatus(a.(*core.NodeStatus), b.(*v1.NodeStatus), scope)\n\t}); err != nil {\n\t\treturn err\n\t}\n\tif err := s.AddGeneratedConversionFunc((*v1.NodeSystemInfo)(nil), (*core.NodeSystemInfo)(nil), func(a, b interface{}, scope conversion.Scope) error {\n\t\treturn Convert_v1_NodeSystemInfo_To_core_NodeSystemInfo(a.(*v1.NodeSystemInfo), b.(*core.NodeSystemInfo), scope)\n\t}); err != nil {\n\t\treturn err\n\t}\n\tif err := s.AddGeneratedConversionFunc((*core.NodeSystemInfo)(nil), (*v1.NodeSystemInfo)(nil), func(a, b interface{}, scope conversion.Scope) error {\n\t\treturn Convert_core_NodeSystemInfo_To_v1_NodeSystemInfo(a.(*core.NodeSystemInfo), b.(*v1.NodeSystemInfo), scope)\n\t}); err != nil {\n\t\treturn err\n\t}\n\tif err := s.AddGeneratedConversionFunc((*v1.ObjectFieldSelector)(nil), (*core.ObjectFieldSelector)(nil), func(a, b interface{}, scope conversion.Scope) error {\n\t\treturn Convert_v1_ObjectFieldSelector_To_core_ObjectFieldSelector(a.(*v1.ObjectFieldSelector), b.(*core.ObjectFieldSelector), scope)\n\t}); err != nil {\n\t\treturn err\n\t}\n\tif err := s.AddGeneratedConversionFunc((*core.ObjectFieldSelector)(nil), (*v1.ObjectFieldSelector)(nil), func(a, b interface{}, scope conversion.Scope) error {\n\t\treturn Convert_core_ObjectFieldSelector_To_v1_ObjectFieldSelector(a.(*core.ObjectFieldSelector), b.(*v1.ObjectFieldSelector), scope)\n\t}); err != nil {\n\t\treturn err\n\t}\n\tif err := s.AddGeneratedConversionFunc((*v1.ObjectReference)(nil), (*core.ObjectReference)(nil), func(a, b interface{}, scope conversion.Scope) error {\n\t\treturn Convert_v1_ObjectReference_To_core_ObjectReference(a.(*v1.ObjectReference), b.(*core.ObjectReference), scope)\n\t}); err != nil {\n\t\treturn err\n\t}\n\tif err := s.AddGeneratedConversionFunc((*core.ObjectReference)(nil), (*v1.ObjectReference)(nil), func(a, b interface{}, scope conversion.Scope) error {\n\t\treturn Convert_core_ObjectReference_To_v1_ObjectReference(a.(*core.ObjectReference), b.(*v1.ObjectReference), scope)\n\t}); err != nil {\n\t\treturn err\n\t}\n\tif err := s.AddGeneratedConversionFunc((*v1.PersistentVolume)(nil), (*core.PersistentVolume)(nil), func(a, b interface{}, scope conversion.Scope) error {\n\t\treturn Convert_v1_PersistentVolume_To_core_PersistentVolume(a.(*v1.PersistentVolume), b.(*core.PersistentVolume), scope)\n\t}); err != nil {\n\t\treturn err\n\t}\n\tif err := s.AddGeneratedConversionFunc((*core.PersistentVolume)(nil), (*v1.PersistentVolume)(nil), func(a, b interface{}, scope conversion.Scope) error {\n\t\treturn Convert_core_PersistentVolume_To_v1_PersistentVolume(a.(*core.PersistentVolume), b.(*v1.PersistentVolume), scope)\n\t}); err != nil {\n\t\treturn err\n\t}\n\tif err := s.AddGeneratedConversionFunc((*v1.PersistentVolumeClaim)(nil), (*core.PersistentVolumeClaim)(nil), func(a, b interface{}, scope conversion.Scope) error {\n\t\treturn Convert_v1_PersistentVolumeClaim_To_core_PersistentVolumeClaim(a.(*v1.PersistentVolumeClaim), b.(*core.PersistentVolumeClaim), scope)\n\t}); err != nil {\n\t\treturn err\n\t}\n\tif err := s.AddGeneratedConversionFunc((*core.PersistentVolumeClaim)(nil), (*v1.PersistentVolumeClaim)(nil), func(a, b interface{}, scope conversion.Scope) error {\n\t\treturn Convert_core_PersistentVolumeClaim_To_v1_PersistentVolumeClaim(a.(*core.PersistentVolumeClaim), b.(*v1.PersistentVolumeClaim), scope)\n\t}); err != nil {\n\t\treturn err\n\t}\n\tif err := s.AddGeneratedConversionFunc((*v1.PersistentVolumeClaimCondition)(nil), (*core.PersistentVolumeClaimCondition)(nil), func(a, b interface{}, scope conversion.Scope) error {\n\t\treturn Convert_v1_PersistentVolumeClaimCondition_To_core_PersistentVolumeClaimCondition(a.(*v1.PersistentVolumeClaimCondition), b.(*core.PersistentVolumeClaimCondition), scope)\n\t}); err != nil {\n\t\treturn err\n\t}\n\tif err := s.AddGeneratedConversionFunc((*core.PersistentVolumeClaimCondition)(nil), (*v1.PersistentVolumeClaimCondition)(nil), func(a, b interface{}, scope conversion.Scope) error {\n\t\treturn Convert_core_PersistentVolumeClaimCondition_To_v1_PersistentVolumeClaimCondition(a.(*core.PersistentVolumeClaimCondition), b.(*v1.PersistentVolumeClaimCondition), scope)\n\t}); err != nil {\n\t\treturn err\n\t}\n\tif err := s.AddGeneratedConversionFunc((*v1.PersistentVolumeClaimList)(nil), (*core.PersistentVolumeClaimList)(nil), func(a, b interface{}, scope conversion.Scope) error {\n\t\treturn Convert_v1_PersistentVolumeClaimList_To_core_PersistentVolumeClaimList(a.(*v1.PersistentVolumeClaimList), b.(*core.PersistentVolumeClaimList), scope)\n\t}); err != nil {\n\t\treturn err\n\t}\n\tif err := s.AddGeneratedConversionFunc((*core.PersistentVolumeClaimList)(nil), (*v1.PersistentVolumeClaimList)(nil), func(a, b interface{}, scope conversion.Scope) error {\n\t\treturn Convert_core_PersistentVolumeClaimList_To_v1_PersistentVolumeClaimList(a.(*core.PersistentVolumeClaimList), b.(*v1.PersistentVolumeClaimList), scope)\n\t}); err != nil {\n\t\treturn err\n\t}\n\tif err := s.AddGeneratedConversionFunc((*v1.PersistentVolumeClaimSpec)(nil), (*core.PersistentVolumeClaimSpec)(nil), func(a, b interface{}, scope conversion.Scope) error {\n\t\treturn Convert_v1_PersistentVolumeClaimSpec_To_core_PersistentVolumeClaimSpec(a.(*v1.PersistentVolumeClaimSpec), b.(*core.PersistentVolumeClaimSpec), scope)\n\t}); err != nil {\n\t\treturn err\n\t}\n\tif err := s.AddGeneratedConversionFunc((*core.PersistentVolumeClaimSpec)(nil), (*v1.PersistentVolumeClaimSpec)(nil), func(a, b interface{}, scope conversion.Scope) error {\n\t\treturn Convert_core_PersistentVolumeClaimSpec_To_v1_PersistentVolumeClaimSpec(a.(*core.PersistentVolumeClaimSpec), b.(*v1.PersistentVolumeClaimSpec), scope)\n\t}); err != nil {\n\t\treturn err\n\t}\n\tif err := s.AddGeneratedConversionFunc((*v1.PersistentVolumeClaimStatus)(nil), (*core.PersistentVolumeClaimStatus)(nil), func(a, b interface{}, scope conversion.Scope) error {\n\t\treturn Convert_v1_PersistentVolumeClaimStatus_To_core_PersistentVolumeClaimStatus(a.(*v1.PersistentVolumeClaimStatus), b.(*core.PersistentVolumeClaimStatus), scope)\n\t}); err != nil {\n\t\treturn err\n\t}\n\tif err := s.AddGeneratedConversionFunc((*core.PersistentVolumeClaimStatus)(nil), (*v1.PersistentVolumeClaimStatus)(nil), func(a, b interface{}, scope conversion.Scope) error {\n\t\treturn Convert_core_PersistentVolumeClaimStatus_To_v1_PersistentVolumeClaimStatus(a.(*core.PersistentVolumeClaimStatus), b.(*v1.PersistentVolumeClaimStatus), scope)\n\t}); err != nil {\n\t\treturn err\n\t}\n\tif err := s.AddGeneratedConversionFunc((*v1.PersistentVolumeClaimTemplate)(nil), (*core.PersistentVolumeClaimTemplate)(nil), func(a, b interface{}, scope conversion.Scope) error {\n\t\treturn Convert_v1_PersistentVolumeClaimTemplate_To_core_PersistentVolumeClaimTemplate(a.(*v1.PersistentVolumeClaimTemplate), b.(*core.PersistentVolumeClaimTemplate), scope)\n\t}); err != nil {\n\t\treturn err\n\t}\n\tif err := s.AddGeneratedConversionFunc((*core.PersistentVolumeClaimTemplate)(nil), (*v1.PersistentVolumeClaimTemplate)(nil), func(a, b interface{}, scope conversion.Scope) error {\n\t\treturn Convert_core_PersistentVolumeClaimTemplate_To_v1_PersistentVolumeClaimTemplate(a.(*core.PersistentVolumeClaimTemplate), b.(*v1.PersistentVolumeClaimTemplate), scope)\n\t}); err != nil {\n\t\treturn err\n\t}\n\tif err := s.AddGeneratedConversionFunc((*v1.PersistentVolumeClaimVolumeSource)(nil), (*core.PersistentVolumeClaimVolumeSource)(nil), func(a, b interface{}, scope conversion.Scope) error {\n\t\treturn Convert_v1_PersistentVolumeClaimVolumeSource_To_core_PersistentVolumeClaimVolumeSource(a.(*v1.PersistentVolumeClaimVolumeSource), b.(*core.PersistentVolumeClaimVolumeSource), scope)\n\t}); err != nil {\n\t\treturn err\n\t}\n\tif err := s.AddGeneratedConversionFunc((*core.PersistentVolumeClaimVolumeSource)(nil), (*v1.PersistentVolumeClaimVolumeSource)(nil), func(a, b interface{}, scope conversion.Scope) error {\n\t\treturn Convert_core_PersistentVolumeClaimVolumeSource_To_v1_PersistentVolumeClaimVolumeSource(a.(*core.PersistentVolumeClaimVolumeSource), b.(*v1.PersistentVolumeClaimVolumeSource), scope)\n\t}); err != nil {\n\t\treturn err\n\t}\n\tif err := s.AddGeneratedConversionFunc((*v1.PersistentVolumeList)(nil), (*core.PersistentVolumeList)(nil), func(a, b interface{}, scope conversion.Scope) error {\n\t\treturn Convert_v1_PersistentVolumeList_To_core_PersistentVolumeList(a.(*v1.PersistentVolumeList), b.(*core.PersistentVolumeList), scope)\n\t}); err != nil {\n\t\treturn err\n\t}\n\tif err := s.AddGeneratedConversionFunc((*core.PersistentVolumeList)(nil), (*v1.PersistentVolumeList)(nil), func(a, b interface{}, scope conversion.Scope) error {\n\t\treturn Convert_core_PersistentVolumeList_To_v1_PersistentVolumeList(a.(*core.PersistentVolumeList), b.(*v1.PersistentVolumeList), scope)\n\t}); err != nil {\n\t\treturn err\n\t}\n\tif err := s.AddGeneratedConversionFunc((*v1.PersistentVolumeSource)(nil), (*core.PersistentVolumeSource)(nil), func(a, b interface{}, scope conversion.Scope) error {\n\t\treturn Convert_v1_PersistentVolumeSource_To_core_PersistentVolumeSource(a.(*v1.PersistentVolumeSource), b.(*core.PersistentVolumeSource), scope)\n\t}); err != nil {\n\t\treturn err\n\t}\n\tif err := s.AddGeneratedConversionFunc((*core.PersistentVolumeSource)(nil), (*v1.PersistentVolumeSource)(nil), func(a, b interface{}, scope conversion.Scope) error {\n\t\treturn Convert_core_PersistentVolumeSource_To_v1_PersistentVolumeSource(a.(*core.PersistentVolumeSource), b.(*v1.PersistentVolumeSource), scope)\n\t}); err != nil {\n\t\treturn err\n\t}\n\tif err := s.AddGeneratedConversionFunc((*v1.PersistentVolumeStatus)(nil), (*core.PersistentVolumeStatus)(nil), func(a, b interface{}, scope conversion.Scope) error {\n\t\treturn Convert_v1_PersistentVolumeStatus_To_core_PersistentVolumeStatus(a.(*v1.PersistentVolumeStatus), b.(*core.PersistentVolumeStatus), scope)\n\t}); err != nil {\n\t\treturn err\n\t}\n\tif err := s.AddGeneratedConversionFunc((*core.PersistentVolumeStatus)(nil), (*v1.PersistentVolumeStatus)(nil), func(a, b interface{}, scope conversion.Scope) error {\n\t\treturn Convert_core_PersistentVolumeStatus_To_v1_PersistentVolumeStatus(a.(*core.PersistentVolumeStatus), b.(*v1.PersistentVolumeStatus), scope)\n\t}); err != nil {\n\t\treturn err\n\t}\n\tif err := s.AddGeneratedConversionFunc((*v1.PhotonPersistentDiskVolumeSource)(nil), (*core.PhotonPersistentDiskVolumeSource)(nil), func(a, b interface{}, scope conversion.Scope) error {\n\t\treturn Convert_v1_PhotonPersistentDiskVolumeSource_To_core_PhotonPersistentDiskVolumeSource(a.(*v1.PhotonPersistentDiskVolumeSource), b.(*core.PhotonPersistentDiskVolumeSource), scope)\n\t}); err != nil {\n\t\treturn err\n\t}\n\tif err := s.AddGeneratedConversionFunc((*core.PhotonPersistentDiskVolumeSource)(nil), (*v1.PhotonPersistentDiskVolumeSource)(nil), func(a, b interface{}, scope conversion.Scope) error {\n\t\treturn Convert_core_PhotonPersistentDiskVolumeSource_To_v1_PhotonPersistentDiskVolumeSource(a.(*core.PhotonPersistentDiskVolumeSource), b.(*v1.PhotonPersistentDiskVolumeSource), scope)\n\t}); err != nil {\n\t\treturn err\n\t}\n\tif err := s.AddGeneratedConversionFunc((*v1.PodAffinity)(nil), (*core.PodAffinity)(nil), func(a, b interface{}, scope conversion.Scope) error {\n\t\treturn Convert_v1_PodAffinity_To_core_PodAffinity(a.(*v1.PodAffinity), b.(*core.PodAffinity), scope)\n\t}); err != nil {\n\t\treturn err\n\t}\n\tif err := s.AddGeneratedConversionFunc((*core.PodAffinity)(nil), (*v1.PodAffinity)(nil), func(a, b interface{}, scope conversion.Scope) error {\n\t\treturn Convert_core_PodAffinity_To_v1_PodAffinity(a.(*core.PodAffinity), b.(*v1.PodAffinity), scope)\n\t}); err != nil {\n\t\treturn err\n\t}\n\tif err := s.AddGeneratedConversionFunc((*v1.PodAffinityTerm)(nil), (*core.PodAffinityTerm)(nil), func(a, b interface{}, scope conversion.Scope) error {\n\t\treturn Convert_v1_PodAffinityTerm_To_core_PodAffinityTerm(a.(*v1.PodAffinityTerm), b.(*core.PodAffinityTerm), scope)\n\t}); err != nil {\n\t\treturn err\n\t}\n\tif err := s.AddGeneratedConversionFunc((*core.PodAffinityTerm)(nil), (*v1.PodAffinityTerm)(nil), func(a, b interface{}, scope conversion.Scope) error {\n\t\treturn Convert_core_PodAffinityTerm_To_v1_PodAffinityTerm(a.(*core.PodAffinityTerm), b.(*v1.PodAffinityTerm), scope)\n\t}); err != nil {\n\t\treturn err\n\t}\n\tif err := s.AddGeneratedConversionFunc((*v1.PodAntiAffinity)(nil), (*core.PodAntiAffinity)(nil), func(a, b interface{}, scope conversion.Scope) error {\n\t\treturn Convert_v1_PodAntiAffinity_To_core_PodAntiAffinity(a.(*v1.PodAntiAffinity), b.(*core.PodAntiAffinity), scope)\n\t}); err != nil {\n\t\treturn err\n\t}\n\tif err := s.AddGeneratedConversionFunc((*core.PodAntiAffinity)(nil), (*v1.PodAntiAffinity)(nil), func(a, b interface{}, scope conversion.Scope) error {\n\t\treturn Convert_core_PodAntiAffinity_To_v1_PodAntiAffinity(a.(*core.PodAntiAffinity), b.(*v1.PodAntiAffinity), scope)\n\t}); err != nil {\n\t\treturn err\n\t}\n\tif err := s.AddGeneratedConversionFunc((*v1.PodAttachOptions)(nil), (*core.PodAttachOptions)(nil), func(a, b interface{}, scope conversion.Scope) error {\n\t\treturn Convert_v1_PodAttachOptions_To_core_PodAttachOptions(a.(*v1.PodAttachOptions), b.(*core.PodAttachOptions), scope)\n\t}); err != nil {\n\t\treturn err\n\t}\n\tif err := s.AddGeneratedConversionFunc((*core.PodAttachOptions)(nil), (*v1.PodAttachOptions)(nil), func(a, b interface{}, scope conversion.Scope) error {\n\t\treturn Convert_core_PodAttachOptions_To_v1_PodAttachOptions(a.(*core.PodAttachOptions), b.(*v1.PodAttachOptions), scope)\n\t}); err != nil {\n\t\treturn err\n\t}\n\tif err := s.AddGeneratedConversionFunc((*v1.PodCondition)(nil), (*core.PodCondition)(nil), func(a, b interface{}, scope conversion.Scope) error {\n\t\treturn Convert_v1_PodCondition_To_core_PodCondition(a.(*v1.PodCondition), b.(*core.PodCondition), scope)\n\t}); err != nil {\n\t\treturn err\n\t}\n\tif err := s.AddGeneratedConversionFunc((*core.PodCondition)(nil), (*v1.PodCondition)(nil), func(a, b interface{}, scope conversion.Scope) error {\n\t\treturn Convert_core_PodCondition_To_v1_PodCondition(a.(*core.PodCondition), b.(*v1.PodCondition), scope)\n\t}); err != nil {\n\t\treturn err\n\t}\n\tif err := s.AddGeneratedConversionFunc((*v1.PodDNSConfig)(nil), (*core.PodDNSConfig)(nil), func(a, b interface{}, scope conversion.Scope) error {\n\t\treturn Convert_v1_PodDNSConfig_To_core_PodDNSConfig(a.(*v1.PodDNSConfig), b.(*core.PodDNSConfig), scope)\n\t}); err != nil {\n\t\treturn err\n\t}\n\tif err := s.AddGeneratedConversionFunc((*core.PodDNSConfig)(nil), (*v1.PodDNSConfig)(nil), func(a, b interface{}, scope conversion.Scope) error {\n\t\treturn Convert_core_PodDNSConfig_To_v1_PodDNSConfig(a.(*core.PodDNSConfig), b.(*v1.PodDNSConfig), scope)\n\t}); err != nil {\n\t\treturn err\n\t}\n\tif err := s.AddGeneratedConversionFunc((*v1.PodDNSConfigOption)(nil), (*core.PodDNSConfigOption)(nil), func(a, b interface{}, scope conversion.Scope) error {\n\t\treturn Convert_v1_PodDNSConfigOption_To_core_PodDNSConfigOption(a.(*v1.PodDNSConfigOption), b.(*core.PodDNSConfigOption), scope)\n\t}); err != nil {\n\t\treturn err\n\t}\n\tif err := s.AddGeneratedConversionFunc((*core.PodDNSConfigOption)(nil), (*v1.PodDNSConfigOption)(nil), func(a, b interface{}, scope conversion.Scope) error {\n\t\treturn Convert_core_PodDNSConfigOption_To_v1_PodDNSConfigOption(a.(*core.PodDNSConfigOption), b.(*v1.PodDNSConfigOption), scope)\n\t}); err != nil {\n\t\treturn err\n\t}\n\tif err := s.AddGeneratedConversionFunc((*v1.PodExecOptions)(nil), (*core.PodExecOptions)(nil), func(a, b interface{}, scope conversion.Scope) error {\n\t\treturn Convert_v1_PodExecOptions_To_core_PodExecOptions(a.(*v1.PodExecOptions), b.(*core.PodExecOptions), scope)\n\t}); err != nil {\n\t\treturn err\n\t}\n\tif err := s.AddGeneratedConversionFunc((*core.PodExecOptions)(nil), (*v1.PodExecOptions)(nil), func(a, b interface{}, scope conversion.Scope) error {\n\t\treturn Convert_core_PodExecOptions_To_v1_PodExecOptions(a.(*core.PodExecOptions), b.(*v1.PodExecOptions), scope)\n\t}); err != nil {\n\t\treturn err\n\t}\n\tif err := s.AddGeneratedConversionFunc((*v1.PodIP)(nil), (*core.PodIP)(nil), func(a, b interface{}, scope conversion.Scope) error {\n\t\treturn Convert_v1_PodIP_To_core_PodIP(a.(*v1.PodIP), b.(*core.PodIP), scope)\n\t}); err != nil {\n\t\treturn err\n\t}\n\tif err := s.AddGeneratedConversionFunc((*core.PodIP)(nil), (*v1.PodIP)(nil), func(a, b interface{}, scope conversion.Scope) error {\n\t\treturn Convert_core_PodIP_To_v1_PodIP(a.(*core.PodIP), b.(*v1.PodIP), scope)\n\t}); err != nil {\n\t\treturn err\n\t}\n\tif err := s.AddGeneratedConversionFunc((*v1.PodList)(nil), (*core.PodList)(nil), func(a, b interface{}, scope conversion.Scope) error {\n\t\treturn Convert_v1_PodList_To_core_PodList(a.(*v1.PodList), b.(*core.PodList), scope)\n\t}); err != nil {\n\t\treturn err\n\t}\n\tif err := s.AddGeneratedConversionFunc((*core.PodList)(nil), (*v1.PodList)(nil), func(a, b interface{}, scope conversion.Scope) error {\n\t\treturn Convert_core_PodList_To_v1_PodList(a.(*core.PodList), b.(*v1.PodList), scope)\n\t}); err != nil {\n\t\treturn err\n\t}\n\tif err := s.AddGeneratedConversionFunc((*v1.PodLogOptions)(nil), (*core.PodLogOptions)(nil), func(a, b interface{}, scope conversion.Scope) error {\n\t\treturn Convert_v1_PodLogOptions_To_core_PodLogOptions(a.(*v1.PodLogOptions), b.(*core.PodLogOptions), scope)\n\t}); err != nil {\n\t\treturn err\n\t}\n\tif err := s.AddGeneratedConversionFunc((*core.PodLogOptions)(nil), (*v1.PodLogOptions)(nil), func(a, b interface{}, scope conversion.Scope) error {\n\t\treturn Convert_core_PodLogOptions_To_v1_PodLogOptions(a.(*core.PodLogOptions), b.(*v1.PodLogOptions), scope)\n\t}); err != nil {\n\t\treturn err\n\t}\n\tif err := s.AddGeneratedConversionFunc((*v1.PodOS)(nil), (*core.PodOS)(nil), func(a, b interface{}, scope conversion.Scope) error {\n\t\treturn Convert_v1_PodOS_To_core_PodOS(a.(*v1.PodOS), b.(*core.PodOS), scope)\n\t}); err != nil {\n\t\treturn err\n\t}\n\tif err := s.AddGeneratedConversionFunc((*core.PodOS)(nil), (*v1.PodOS)(nil), func(a, b interface{}, scope conversion.Scope) error {\n\t\treturn Convert_core_PodOS_To_v1_PodOS(a.(*core.PodOS), b.(*v1.PodOS), scope)\n\t}); err != nil {\n\t\treturn err\n\t}\n\tif err := s.AddGeneratedConversionFunc((*v1.PodPortForwardOptions)(nil), (*core.PodPortForwardOptions)(nil), func(a, b interface{}, scope conversion.Scope) error {\n\t\treturn Convert_v1_PodPortForwardOptions_To_core_PodPortForwardOptions(a.(*v1.PodPortForwardOptions), b.(*core.PodPortForwardOptions), scope)\n\t}); err != nil {\n\t\treturn err\n\t}\n\tif err := s.AddGeneratedConversionFunc((*core.PodPortForwardOptions)(nil), (*v1.PodPortForwardOptions)(nil), func(a, b interface{}, scope conversion.Scope) error {\n\t\treturn Convert_core_PodPortForwardOptions_To_v1_PodPortForwardOptions(a.(*core.PodPortForwardOptions), b.(*v1.PodPortForwardOptions), scope)\n\t}); err != nil {\n\t\treturn err\n\t}\n\tif err := s.AddGeneratedConversionFunc((*v1.PodProxyOptions)(nil), (*core.PodProxyOptions)(nil), func(a, b interface{}, scope conversion.Scope) error {\n\t\treturn Convert_v1_PodProxyOptions_To_core_PodProxyOptions(a.(*v1.PodProxyOptions), b.(*core.PodProxyOptions), scope)\n\t}); err != nil {\n\t\treturn err\n\t}\n\tif err := s.AddGeneratedConversionFunc((*core.PodProxyOptions)(nil), (*v1.PodProxyOptions)(nil), func(a, b interface{}, scope conversion.Scope) error {\n\t\treturn Convert_core_PodProxyOptions_To_v1_PodProxyOptions(a.(*core.PodProxyOptions), b.(*v1.PodProxyOptions), scope)\n\t}); err != nil {\n\t\treturn err\n\t}\n\tif err := s.AddGeneratedConversionFunc((*v1.PodReadinessGate)(nil), (*core.PodReadinessGate)(nil), func(a, b interface{}, scope conversion.Scope) error {\n\t\treturn Convert_v1_PodReadinessGate_To_core_PodReadinessGate(a.(*v1.PodReadinessGate), b.(*core.PodReadinessGate), scope)\n\t}); err != nil {\n\t\treturn err\n\t}\n\tif err := s.AddGeneratedConversionFunc((*core.PodReadinessGate)(nil), (*v1.PodReadinessGate)(nil), func(a, b interface{}, scope conversion.Scope) error {\n\t\treturn Convert_core_PodReadinessGate_To_v1_PodReadinessGate(a.(*core.PodReadinessGate), b.(*v1.PodReadinessGate), scope)\n\t}); err != nil {\n\t\treturn err\n\t}\n\tif err := s.AddGeneratedConversionFunc((*v1.PodResourceClaim)(nil), (*core.PodResourceClaim)(nil), func(a, b interface{}, scope conversion.Scope) error {\n\t\treturn Convert_v1_PodResourceClaim_To_core_PodResourceClaim(a.(*v1.PodResourceClaim), b.(*core.PodResourceClaim), scope)\n\t}); err != nil {\n\t\treturn err\n\t}\n\tif err := s.AddGeneratedConversionFunc((*core.PodResourceClaim)(nil), (*v1.PodResourceClaim)(nil), func(a, b interface{}, scope conversion.Scope) error {\n\t\treturn Convert_core_PodResourceClaim_To_v1_PodResourceClaim(a.(*core.PodResourceClaim), b.(*v1.PodResourceClaim), scope)\n\t}); err != nil {\n\t\treturn err\n\t}\n\tif err := s.AddGeneratedConversionFunc((*v1.PodResourceClaimStatus)(nil), (*core.PodResourceClaimStatus)(nil), func(a, b interface{}, scope conversion.Scope) error {\n\t\treturn Convert_v1_PodResourceClaimStatus_To_core_PodResourceClaimStatus(a.(*v1.PodResourceClaimStatus), b.(*core.PodResourceClaimStatus), scope)\n\t}); err != nil {\n\t\treturn err\n\t}\n\tif err := s.AddGeneratedConversionFunc((*core.PodResourceClaimStatus)(nil), (*v1.PodResourceClaimStatus)(nil), func(a, b interface{}, scope conversion.Scope) error {\n\t\treturn Convert_core_PodResourceClaimStatus_To_v1_PodResourceClaimStatus(a.(*core.PodResourceClaimStatus), b.(*v1.PodResourceClaimStatus), scope)\n\t}); err != nil {\n\t\treturn err\n\t}\n\tif err := s.AddGeneratedConversionFunc((*v1.PodSchedulingGate)(nil), (*core.PodSchedulingGate)(nil), func(a, b interface{}, scope conversion.Scope) error {\n\t\treturn Convert_v1_PodSchedulingGate_To_core_PodSchedulingGate(a.(*v1.PodSchedulingGate), b.(*core.PodSchedulingGate), scope)\n\t}); err != nil {\n\t\treturn err\n\t}\n\tif err := s.AddGeneratedConversionFunc((*core.PodSchedulingGate)(nil), (*v1.PodSchedulingGate)(nil), func(a, b interface{}, scope conversion.Scope) error {\n\t\treturn Convert_core_PodSchedulingGate_To_v1_PodSchedulingGate(a.(*core.PodSchedulingGate), b.(*v1.PodSchedulingGate), scope)\n\t}); err != nil {\n\t\treturn err\n\t}\n\tif err := s.AddGeneratedConversionFunc((*v1.PodSecurityContext)(nil), (*core.PodSecurityContext)(nil), func(a, b interface{}, scope conversion.Scope) error {\n\t\treturn Convert_v1_PodSecurityContext_To_core_PodSecurityContext(a.(*v1.PodSecurityContext), b.(*core.PodSecurityContext), scope)\n\t}); err != nil {\n\t\treturn err\n\t}\n\tif err := s.AddGeneratedConversionFunc((*core.PodSecurityContext)(nil), (*v1.PodSecurityContext)(nil), func(a, b interface{}, scope conversion.Scope) error {\n\t\treturn Convert_core_PodSecurityContext_To_v1_PodSecurityContext(a.(*core.PodSecurityContext), b.(*v1.PodSecurityContext), scope)\n\t}); err != nil {\n\t\treturn err\n\t}\n\tif err := s.AddGeneratedConversionFunc((*v1.PodSignature)(nil), (*core.PodSignature)(nil), func(a, b interface{}, scope conversion.Scope) error {\n\t\treturn Convert_v1_PodSignature_To_core_PodSignature(a.(*v1.PodSignature), b.(*core.PodSignature), scope)\n\t}); err != nil {\n\t\treturn err\n\t}\n\tif err := s.AddGeneratedConversionFunc((*core.PodSignature)(nil), (*v1.PodSignature)(nil), func(a, b interface{}, scope conversion.Scope) error {\n\t\treturn Convert_core_PodSignature_To_v1_PodSignature(a.(*core.PodSignature), b.(*v1.PodSignature), scope)\n\t}); err != nil {\n\t\treturn err\n\t}\n\tif err := s.AddGeneratedConversionFunc((*v1.PodStatusResult)(nil), (*core.PodStatusResult)(nil), func(a, b interface{}, scope conversion.Scope) error {\n\t\treturn Convert_v1_PodStatusResult_To_core_PodStatusResult(a.(*v1.PodStatusResult), b.(*core.PodStatusResult), scope)\n\t}); err != nil {\n\t\treturn err\n\t}\n\tif err := s.AddGeneratedConversionFunc((*core.PodStatusResult)(nil), (*v1.PodStatusResult)(nil), func(a, b interface{}, scope conversion.Scope) error {\n\t\treturn Convert_core_PodStatusResult_To_v1_PodStatusResult(a.(*core.PodStatusResult), b.(*v1.PodStatusResult), scope)\n\t}); err != nil {\n\t\treturn err\n\t}\n\tif err := s.AddGeneratedConversionFunc((*v1.PodTemplate)(nil), (*core.PodTemplate)(nil), func(a, b interface{}, scope conversion.Scope) error {\n\t\treturn Convert_v1_PodTemplate_To_core_PodTemplate(a.(*v1.PodTemplate), b.(*core.PodTemplate), scope)\n\t}); err != nil {\n\t\treturn err\n\t}\n\tif err := s.AddGeneratedConversionFunc((*core.PodTemplate)(nil), (*v1.PodTemplate)(nil), func(a, b interface{}, scope conversion.Scope) error {\n\t\treturn Convert_core_PodTemplate_To_v1_PodTemplate(a.(*core.PodTemplate), b.(*v1.PodTemplate), scope)\n\t}); err != nil {\n\t\treturn err\n\t}\n\tif err := s.AddGeneratedConversionFunc((*v1.PodTemplateList)(nil), (*core.PodTemplateList)(nil), func(a, b interface{}, scope conversion.Scope) error {\n\t\treturn Convert_v1_PodTemplateList_To_core_PodTemplateList(a.(*v1.PodTemplateList), b.(*core.PodTemplateList), scope)\n\t}); err != nil {\n\t\treturn err\n\t}\n\tif err := s.AddGeneratedConversionFunc((*core.PodTemplateList)(nil), (*v1.PodTemplateList)(nil), func(a, b interface{}, scope conversion.Scope) error {\n\t\treturn Convert_core_PodTemplateList_To_v1_PodTemplateList(a.(*core.PodTemplateList), b.(*v1.PodTemplateList), scope)\n\t}); err != nil {\n\t\treturn err\n\t}\n\tif err := s.AddGeneratedConversionFunc((*v1.PortStatus)(nil), (*core.PortStatus)(nil), func(a, b interface{}, scope conversion.Scope) error {\n\t\treturn Convert_v1_PortStatus_To_core_PortStatus(a.(*v1.PortStatus), b.(*core.PortStatus), scope)\n\t}); err != nil {\n\t\treturn err\n\t}\n\tif err := s.AddGeneratedConversionFunc((*core.PortStatus)(nil), (*v1.PortStatus)(nil), func(a, b interface{}, scope conversion.Scope) error {\n\t\treturn Convert_core_PortStatus_To_v1_PortStatus(a.(*core.PortStatus), b.(*v1.PortStatus), scope)\n\t}); err != nil {\n\t\treturn err\n\t}\n\tif err := s.AddGeneratedConversionFunc((*v1.PortworxVolumeSource)(nil), (*core.PortworxVolumeSource)(nil), func(a, b interface{}, scope conversion.Scope) error {\n\t\treturn Convert_v1_PortworxVolumeSource_To_core_PortworxVolumeSource(a.(*v1.PortworxVolumeSource), b.(*core.PortworxVolumeSource), scope)\n\t}); err != nil {\n\t\treturn err\n\t}\n\tif err := s.AddGeneratedConversionFunc((*core.PortworxVolumeSource)(nil), (*v1.PortworxVolumeSource)(nil), func(a, b interface{}, scope conversion.Scope) error {\n\t\treturn Convert_core_PortworxVolumeSource_To_v1_PortworxVolumeSource(a.(*core.PortworxVolumeSource), b.(*v1.PortworxVolumeSource), scope)\n\t}); err != nil {\n\t\treturn err\n\t}\n\tif err := s.AddGeneratedConversionFunc((*v1.Preconditions)(nil), (*core.Preconditions)(nil), func(a, b interface{}, scope conversion.Scope) error {\n\t\treturn Convert_v1_Preconditions_To_core_Preconditions(a.(*v1.Preconditions), b.(*core.Preconditions), scope)\n\t}); err != nil {\n\t\treturn err\n\t}\n\tif err := s.AddGeneratedConversionFunc((*core.Preconditions)(nil), (*v1.Preconditions)(nil), func(a, b interface{}, scope conversion.Scope) error {\n\t\treturn Convert_core_Preconditions_To_v1_Preconditions(a.(*core.Preconditions), b.(*v1.Preconditions), scope)\n\t}); err != nil {\n\t\treturn err\n\t}\n\tif err := s.AddGeneratedConversionFunc((*v1.PreferAvoidPodsEntry)(nil), (*core.PreferAvoidPodsEntry)(nil), func(a, b interface{}, scope conversion.Scope) error {\n\t\treturn Convert_v1_PreferAvoidPodsEntry_To_core_PreferAvoidPodsEntry(a.(*v1.PreferAvoidPodsEntry), b.(*core.PreferAvoidPodsEntry), scope)\n\t}); err != nil {\n\t\treturn err\n\t}\n\tif err := s.AddGeneratedConversionFunc((*core.PreferAvoidPodsEntry)(nil), (*v1.PreferAvoidPodsEntry)(nil), func(a, b interface{}, scope conversion.Scope) error {\n\t\treturn Convert_core_PreferAvoidPodsEntry_To_v1_PreferAvoidPodsEntry(a.(*core.PreferAvoidPodsEntry), b.(*v1.PreferAvoidPodsEntry), scope)\n\t}); err != nil {\n\t\treturn err\n\t}\n\tif err := s.AddGeneratedConversionFunc((*v1.PreferredSchedulingTerm)(nil), (*core.PreferredSchedulingTerm)(nil), func(a, b interface{}, scope conversion.Scope) error {\n\t\treturn Convert_v1_PreferredSchedulingTerm_To_core_PreferredSchedulingTerm(a.(*v1.PreferredSchedulingTerm), b.(*core.PreferredSchedulingTerm), scope)\n\t}); err != nil {\n\t\treturn err\n\t}\n\tif err := s.AddGeneratedConversionFunc((*core.PreferredSchedulingTerm)(nil), (*v1.PreferredSchedulingTerm)(nil), func(a, b interface{}, scope conversion.Scope) error {\n\t\treturn Convert_core_PreferredSchedulingTerm_To_v1_PreferredSchedulingTerm(a.(*core.PreferredSchedulingTerm), b.(*v1.PreferredSchedulingTerm), scope)\n\t}); err != nil {\n\t\treturn err\n\t}\n\tif err := s.AddGeneratedConversionFunc((*v1.Probe)(nil), (*core.Probe)(nil), func(a, b interface{}, scope conversion.Scope) error {\n\t\treturn Convert_v1_Probe_To_core_Probe(a.(*v1.Probe), b.(*core.Probe), scope)\n\t}); err != nil {\n\t\treturn err\n\t}\n\tif err := s.AddGeneratedConversionFunc((*core.Probe)(nil), (*v1.Probe)(nil), func(a, b interface{}, scope conversion.Scope) error {\n\t\treturn Convert_core_Probe_To_v1_Probe(a.(*core.Probe), b.(*v1.Probe), scope)\n\t}); err != nil {\n\t\treturn err\n\t}\n\tif err := s.AddGeneratedConversionFunc((*v1.ProbeHandler)(nil), (*core.ProbeHandler)(nil), func(a, b interface{}, scope conversion.Scope) error {\n\t\treturn Convert_v1_ProbeHandler_To_core_ProbeHandler(a.(*v1.ProbeHandler), b.(*core.ProbeHandler), scope)\n\t}); err != nil {\n\t\treturn err\n\t}\n\tif err := s.AddGeneratedConversionFunc((*core.ProbeHandler)(nil), (*v1.ProbeHandler)(nil), func(a, b interface{}, scope conversion.Scope) error {\n\t\treturn Convert_core_ProbeHandler_To_v1_ProbeHandler(a.(*core.ProbeHandler), b.(*v1.ProbeHandler), scope)\n\t}); err != nil {\n\t\treturn err\n\t}\n\tif err := s.AddGeneratedConversionFunc((*v1.ProjectedVolumeSource)(nil), (*core.ProjectedVolumeSource)(nil), func(a, b interface{}, scope conversion.Scope) error {\n\t\treturn Convert_v1_ProjectedVolumeSource_To_core_ProjectedVolumeSource(a.(*v1.ProjectedVolumeSource), b.(*core.ProjectedVolumeSource), scope)\n\t}); err != nil {\n\t\treturn err\n\t}\n\tif err := s.AddGeneratedConversionFunc((*core.ProjectedVolumeSource)(nil), (*v1.ProjectedVolumeSource)(nil), func(a, b interface{}, scope conversion.Scope) error {\n\t\treturn Convert_core_ProjectedVolumeSource_To_v1_ProjectedVolumeSource(a.(*core.ProjectedVolumeSource), b.(*v1.ProjectedVolumeSource), scope)\n\t}); err != nil {\n\t\treturn err\n\t}\n\tif err := s.AddGeneratedConversionFunc((*v1.QuobyteVolumeSource)(nil), (*core.QuobyteVolumeSource)(nil), func(a, b interface{}, scope conversion.Scope) error {\n\t\treturn Convert_v1_QuobyteVolumeSource_To_core_QuobyteVolumeSource(a.(*v1.QuobyteVolumeSource), b.(*core.QuobyteVolumeSource), scope)\n\t}); err != nil {\n\t\treturn err\n\t}\n\tif err := s.AddGeneratedConversionFunc((*core.QuobyteVolumeSource)(nil), (*v1.QuobyteVolumeSource)(nil), func(a, b interface{}, scope conversion.Scope) error {\n\t\treturn Convert_core_QuobyteVolumeSource_To_v1_QuobyteVolumeSource(a.(*core.QuobyteVolumeSource), b.(*v1.QuobyteVolumeSource), scope)\n\t}); err != nil {\n\t\treturn err\n\t}\n\tif err := s.AddGeneratedConversionFunc((*v1.RBDPersistentVolumeSource)(nil), (*core.RBDPersistentVolumeSource)(nil), func(a, b interface{}, scope conversion.Scope) error {\n\t\treturn Convert_v1_RBDPersistentVolumeSource_To_core_RBDPersistentVolumeSource(a.(*v1.RBDPersistentVolumeSource), b.(*core.RBDPersistentVolumeSource), scope)\n\t}); err != nil {\n\t\treturn err\n\t}\n\tif err := s.AddGeneratedConversionFunc((*core.RBDPersistentVolumeSource)(nil), (*v1.RBDPersistentVolumeSource)(nil), func(a, b interface{}, scope conversion.Scope) error {\n\t\treturn Convert_core_RBDPersistentVolumeSource_To_v1_RBDPersistentVolumeSource(a.(*core.RBDPersistentVolumeSource), b.(*v1.RBDPersistentVolumeSource), scope)\n\t}); err != nil {\n\t\treturn err\n\t}\n\tif err := s.AddGeneratedConversionFunc((*v1.RBDVolumeSource)(nil), (*core.RBDVolumeSource)(nil), func(a, b interface{}, scope conversion.Scope) error {\n\t\treturn Convert_v1_RBDVolumeSource_To_core_RBDVolumeSource(a.(*v1.RBDVolumeSource), b.(*core.RBDVolumeSource), scope)\n\t}); err != nil {\n\t\treturn err\n\t}\n\tif err := s.AddGeneratedConversionFunc((*core.RBDVolumeSource)(nil), (*v1.RBDVolumeSource)(nil), func(a, b interface{}, scope conversion.Scope) error {\n\t\treturn Convert_core_RBDVolumeSource_To_v1_RBDVolumeSource(a.(*core.RBDVolumeSource), b.(*v1.RBDVolumeSource), scope)\n\t}); err != nil {\n\t\treturn err\n\t}\n\tif err := s.AddGeneratedConversionFunc((*v1.RangeAllocation)(nil), (*core.RangeAllocation)(nil), func(a, b interface{}, scope conversion.Scope) error {\n\t\treturn Convert_v1_RangeAllocation_To_core_RangeAllocation(a.(*v1.RangeAllocation), b.(*core.RangeAllocation), scope)\n\t}); err != nil {\n\t\treturn err\n\t}\n\tif err := s.AddGeneratedConversionFunc((*core.RangeAllocation)(nil), (*v1.RangeAllocation)(nil), func(a, b interface{}, scope conversion.Scope) error {\n\t\treturn Convert_core_RangeAllocation_To_v1_RangeAllocation(a.(*core.RangeAllocation), b.(*v1.RangeAllocation), scope)\n\t}); err != nil {\n\t\treturn err\n\t}\n\tif err := s.AddGeneratedConversionFunc((*v1.ReplicationController)(nil), (*core.ReplicationController)(nil), func(a, b interface{}, scope conversion.Scope) error {\n\t\treturn Convert_v1_ReplicationController_To_core_ReplicationController(a.(*v1.ReplicationController), b.(*core.ReplicationController), scope)\n\t}); err != nil {\n\t\treturn err\n\t}\n\tif err := s.AddGeneratedConversionFunc((*core.ReplicationController)(nil), (*v1.ReplicationController)(nil), func(a, b interface{}, scope conversion.Scope) error {\n\t\treturn Convert_core_ReplicationController_To_v1_ReplicationController(a.(*core.ReplicationController), b.(*v1.ReplicationController), scope)\n\t}); err != nil {\n\t\treturn err\n\t}\n\tif err := s.AddGeneratedConversionFunc((*v1.ReplicationControllerCondition)(nil), (*core.ReplicationControllerCondition)(nil), func(a, b interface{}, scope conversion.Scope) error {\n\t\treturn Convert_v1_ReplicationControllerCondition_To_core_ReplicationControllerCondition(a.(*v1.ReplicationControllerCondition), b.(*core.ReplicationControllerCondition), scope)\n\t}); err != nil {\n\t\treturn err\n\t}\n\tif err := s.AddGeneratedConversionFunc((*core.ReplicationControllerCondition)(nil), (*v1.ReplicationControllerCondition)(nil), func(a, b interface{}, scope conversion.Scope) error {\n\t\treturn Convert_core_ReplicationControllerCondition_To_v1_ReplicationControllerCondition(a.(*core.ReplicationControllerCondition), b.(*v1.ReplicationControllerCondition), scope)\n\t}); err != nil {\n\t\treturn err\n\t}\n\tif err := s.AddGeneratedConversionFunc((*v1.ReplicationControllerList)(nil), (*core.ReplicationControllerList)(nil), func(a, b interface{}, scope conversion.Scope) error {\n\t\treturn Convert_v1_ReplicationControllerList_To_core_ReplicationControllerList(a.(*v1.ReplicationControllerList), b.(*core.ReplicationControllerList), scope)\n\t}); err != nil {\n\t\treturn err\n\t}\n\tif err := s.AddGeneratedConversionFunc((*core.ReplicationControllerList)(nil), (*v1.ReplicationControllerList)(nil), func(a, b interface{}, scope conversion.Scope) error {\n\t\treturn Convert_core_ReplicationControllerList_To_v1_ReplicationControllerList(a.(*core.ReplicationControllerList), b.(*v1.ReplicationControllerList), scope)\n\t}); err != nil {\n\t\treturn err\n\t}\n\tif err := s.AddGeneratedConversionFunc((*v1.ReplicationControllerStatus)(nil), (*core.ReplicationControllerStatus)(nil), func(a, b interface{}, scope conversion.Scope) error {\n\t\treturn Convert_v1_ReplicationControllerStatus_To_core_ReplicationControllerStatus(a.(*v1.ReplicationControllerStatus), b.(*core.ReplicationControllerStatus), scope)\n\t}); err != nil {\n\t\treturn err\n\t}\n\tif err := s.AddGeneratedConversionFunc((*core.ReplicationControllerStatus)(nil), (*v1.ReplicationControllerStatus)(nil), func(a, b interface{}, scope conversion.Scope) error {\n\t\treturn Convert_core_ReplicationControllerStatus_To_v1_ReplicationControllerStatus(a.(*core.ReplicationControllerStatus), b.(*v1.ReplicationControllerStatus), scope)\n\t}); err != nil {\n\t\treturn err\n\t}\n\tif err := s.AddGeneratedConversionFunc((*v1.ResourceClaim)(nil), (*core.ResourceClaim)(nil), func(a, b interface{}, scope conversion.Scope) error {\n\t\treturn Convert_v1_ResourceClaim_To_core_ResourceClaim(a.(*v1.ResourceClaim), b.(*core.ResourceClaim), scope)\n\t}); err != nil {\n\t\treturn err\n\t}\n\tif err := s.AddGeneratedConversionFunc((*core.ResourceClaim)(nil), (*v1.ResourceClaim)(nil), func(a, b interface{}, scope conversion.Scope) error {\n\t\treturn Convert_core_ResourceClaim_To_v1_ResourceClaim(a.(*core.ResourceClaim), b.(*v1.ResourceClaim), scope)\n\t}); err != nil {\n\t\treturn err\n\t}\n\tif err := s.AddGeneratedConversionFunc((*v1.ResourceFieldSelector)(nil), (*core.ResourceFieldSelector)(nil), func(a, b interface{}, scope conversion.Scope) error {\n\t\treturn Convert_v1_ResourceFieldSelector_To_core_ResourceFieldSelector(a.(*v1.ResourceFieldSelector), b.(*core.ResourceFieldSelector), scope)\n\t}); err != nil {\n\t\treturn err\n\t}\n\tif err := s.AddGeneratedConversionFunc((*core.ResourceFieldSelector)(nil), (*v1.ResourceFieldSelector)(nil), func(a, b interface{}, scope conversion.Scope) error {\n\t\treturn Convert_core_ResourceFieldSelector_To_v1_ResourceFieldSelector(a.(*core.ResourceFieldSelector), b.(*v1.ResourceFieldSelector), scope)\n\t}); err != nil {\n\t\treturn err\n\t}\n\tif err := s.AddGeneratedConversionFunc((*v1.ResourceQuota)(nil), (*core.ResourceQuota)(nil), func(a, b interface{}, scope conversion.Scope) error {\n\t\treturn Convert_v1_ResourceQuota_To_core_ResourceQuota(a.(*v1.ResourceQuota), b.(*core.ResourceQuota), scope)\n\t}); err != nil {\n\t\treturn err\n\t}\n\tif err := s.AddGeneratedConversionFunc((*core.ResourceQuota)(nil), (*v1.ResourceQuota)(nil), func(a, b interface{}, scope conversion.Scope) error {\n\t\treturn Convert_core_ResourceQuota_To_v1_ResourceQuota(a.(*core.ResourceQuota), b.(*v1.ResourceQuota), scope)\n\t}); err != nil {\n\t\treturn err\n\t}\n\tif err := s.AddGeneratedConversionFunc((*v1.ResourceQuotaList)(nil), (*core.ResourceQuotaList)(nil), func(a, b interface{}, scope conversion.Scope) error {\n\t\treturn Convert_v1_ResourceQuotaList_To_core_ResourceQuotaList(a.(*v1.ResourceQuotaList), b.(*core.ResourceQuotaList), scope)\n\t}); err != nil {\n\t\treturn err\n\t}\n\tif err := s.AddGeneratedConversionFunc((*core.ResourceQuotaList)(nil), (*v1.ResourceQuotaList)(nil), func(a, b interface{}, scope conversion.Scope) error {\n\t\treturn Convert_core_ResourceQuotaList_To_v1_ResourceQuotaList(a.(*core.ResourceQuotaList), b.(*v1.ResourceQuotaList), scope)\n\t}); err != nil {\n\t\treturn err\n\t}\n\tif err := s.AddGeneratedConversionFunc((*v1.ResourceQuotaSpec)(nil), (*core.ResourceQuotaSpec)(nil), func(a, b interface{}, scope conversion.Scope) error {\n\t\treturn Convert_v1_ResourceQuotaSpec_To_core_ResourceQuotaSpec(a.(*v1.ResourceQuotaSpec), b.(*core.ResourceQuotaSpec), scope)\n\t}); err != nil {\n\t\treturn err\n\t}\n\tif err := s.AddGeneratedConversionFunc((*core.ResourceQuotaSpec)(nil), (*v1.ResourceQuotaSpec)(nil), func(a, b interface{}, scope conversion.Scope) error {\n\t\treturn Convert_core_ResourceQuotaSpec_To_v1_ResourceQuotaSpec(a.(*core.ResourceQuotaSpec), b.(*v1.ResourceQuotaSpec), scope)\n\t}); err != nil {\n\t\treturn err\n\t}\n\tif err := s.AddGeneratedConversionFunc((*v1.ResourceQuotaStatus)(nil), (*core.ResourceQuotaStatus)(nil), func(a, b interface{}, scope conversion.Scope) error {\n\t\treturn Convert_v1_ResourceQuotaStatus_To_core_ResourceQuotaStatus(a.(*v1.ResourceQuotaStatus), b.(*core.ResourceQuotaStatus), scope)\n\t}); err != nil {\n\t\treturn err\n\t}\n\tif err := s.AddGeneratedConversionFunc((*core.ResourceQuotaStatus)(nil), (*v1.ResourceQuotaStatus)(nil), func(a, b interface{}, scope conversion.Scope) error {\n\t\treturn Convert_core_ResourceQuotaStatus_To_v1_ResourceQuotaStatus(a.(*core.ResourceQuotaStatus), b.(*v1.ResourceQuotaStatus), scope)\n\t}); err != nil {\n\t\treturn err\n\t}\n\tif err := s.AddGeneratedConversionFunc((*v1.ResourceRequirements)(nil), (*core.ResourceRequirements)(nil), func(a, b interface{}, scope conversion.Scope) error {\n\t\treturn Convert_v1_ResourceRequirements_To_core_ResourceRequirements(a.(*v1.ResourceRequirements), b.(*core.ResourceRequirements), scope)\n\t}); err != nil {\n\t\treturn err\n\t}\n\tif err := s.AddGeneratedConversionFunc((*core.ResourceRequirements)(nil), (*v1.ResourceRequirements)(nil), func(a, b interface{}, scope conversion.Scope) error {\n\t\treturn Convert_core_ResourceRequirements_To_v1_ResourceRequirements(a.(*core.ResourceRequirements), b.(*v1.ResourceRequirements), scope)\n\t}); err != nil {\n\t\treturn err\n\t}\n\tif err := s.AddGeneratedConversionFunc((*v1.SELinuxOptions)(nil), (*core.SELinuxOptions)(nil), func(a, b interface{}, scope conversion.Scope) error {\n\t\treturn Convert_v1_SELinuxOptions_To_core_SELinuxOptions(a.(*v1.SELinuxOptions), b.(*core.SELinuxOptions), scope)\n\t}); err != nil {\n\t\treturn err\n\t}\n\tif err := s.AddGeneratedConversionFunc((*core.SELinuxOptions)(nil), (*v1.SELinuxOptions)(nil), func(a, b interface{}, scope conversion.Scope) error {\n\t\treturn Convert_core_SELinuxOptions_To_v1_SELinuxOptions(a.(*core.SELinuxOptions), b.(*v1.SELinuxOptions), scope)\n\t}); err != nil {\n\t\treturn err\n\t}\n\tif err := s.AddGeneratedConversionFunc((*v1.ScaleIOPersistentVolumeSource)(nil), (*core.ScaleIOPersistentVolumeSource)(nil), func(a, b interface{}, scope conversion.Scope) error {\n\t\treturn Convert_v1_ScaleIOPersistentVolumeSource_To_core_ScaleIOPersistentVolumeSource(a.(*v1.ScaleIOPersistentVolumeSource), b.(*core.ScaleIOPersistentVolumeSource), scope)\n\t}); err != nil {\n\t\treturn err\n\t}\n\tif err := s.AddGeneratedConversionFunc((*core.ScaleIOPersistentVolumeSource)(nil), (*v1.ScaleIOPersistentVolumeSource)(nil), func(a, b interface{}, scope conversion.Scope) error {\n\t\treturn Convert_core_ScaleIOPersistentVolumeSource_To_v1_ScaleIOPersistentVolumeSource(a.(*core.ScaleIOPersistentVolumeSource), b.(*v1.ScaleIOPersistentVolumeSource), scope)\n\t}); err != nil {\n\t\treturn err\n\t}\n\tif err := s.AddGeneratedConversionFunc((*v1.ScaleIOVolumeSource)(nil), (*core.ScaleIOVolumeSource)(nil), func(a, b interface{}, scope conversion.Scope) error {\n\t\treturn Convert_v1_ScaleIOVolumeSource_To_core_ScaleIOVolumeSource(a.(*v1.ScaleIOVolumeSource), b.(*core.ScaleIOVolumeSource), scope)\n\t}); err != nil {\n\t\treturn err\n\t}\n\tif err := s.AddGeneratedConversionFunc((*core.ScaleIOVolumeSource)(nil), (*v1.ScaleIOVolumeSource)(nil), func(a, b interface{}, scope conversion.Scope) error {\n\t\treturn Convert_core_ScaleIOVolumeSource_To_v1_ScaleIOVolumeSource(a.(*core.ScaleIOVolumeSource), b.(*v1.ScaleIOVolumeSource), scope)\n\t}); err != nil {\n\t\treturn err\n\t}\n\tif err := s.AddGeneratedConversionFunc((*v1.ScopeSelector)(nil), (*core.ScopeSelector)(nil), func(a, b interface{}, scope conversion.Scope) error {\n\t\treturn Convert_v1_ScopeSelector_To_core_ScopeSelector(a.(*v1.ScopeSelector), b.(*core.ScopeSelector), scope)\n\t}); err != nil {\n\t\treturn err\n\t}\n\tif err := s.AddGeneratedConversionFunc((*core.ScopeSelector)(nil), (*v1.ScopeSelector)(nil), func(a, b interface{}, scope conversion.Scope) error {\n\t\treturn Convert_core_ScopeSelector_To_v1_ScopeSelector(a.(*core.ScopeSelector), b.(*v1.ScopeSelector), scope)\n\t}); err != nil {\n\t\treturn err\n\t}\n\tif err := s.AddGeneratedConversionFunc((*v1.ScopedResourceSelectorRequirement)(nil), (*core.ScopedResourceSelectorRequirement)(nil), func(a, b interface{}, scope conversion.Scope) error {\n\t\treturn Convert_v1_ScopedResourceSelectorRequirement_To_core_ScopedResourceSelectorRequirement(a.(*v1.ScopedResourceSelectorRequirement), b.(*core.ScopedResourceSelectorRequirement), scope)\n\t}); err != nil {\n\t\treturn err\n\t}\n\tif err := s.AddGeneratedConversionFunc((*core.ScopedResourceSelectorRequirement)(nil), (*v1.ScopedResourceSelectorRequirement)(nil), func(a, b interface{}, scope conversion.Scope) error {\n\t\treturn Convert_core_ScopedResourceSelectorRequirement_To_v1_ScopedResourceSelectorRequirement(a.(*core.ScopedResourceSelectorRequirement), b.(*v1.ScopedResourceSelectorRequirement), scope)\n\t}); err != nil {\n\t\treturn err\n\t}\n\tif err := s.AddGeneratedConversionFunc((*v1.SeccompProfile)(nil), (*core.SeccompProfile)(nil), func(a, b interface{}, scope conversion.Scope) error {\n\t\treturn Convert_v1_SeccompProfile_To_core_SeccompProfile(a.(*v1.SeccompProfile), b.(*core.SeccompProfile), scope)\n\t}); err != nil {\n\t\treturn err\n\t}\n\tif err := s.AddGeneratedConversionFunc((*core.SeccompProfile)(nil), (*v1.SeccompProfile)(nil), func(a, b interface{}, scope conversion.Scope) error {\n\t\treturn Convert_core_SeccompProfile_To_v1_SeccompProfile(a.(*core.SeccompProfile), b.(*v1.SeccompProfile), scope)\n\t}); err != nil {\n\t\treturn err\n\t}\n\tif err := s.AddGeneratedConversionFunc((*core.Secret)(nil), (*v1.Secret)(nil), func(a, b interface{}, scope conversion.Scope) error {\n\t\treturn Convert_core_Secret_To_v1_Secret(a.(*core.Secret), b.(*v1.Secret), scope)\n\t}); err != nil {\n\t\treturn err\n\t}\n\tif err := s.AddGeneratedConversionFunc((*v1.SecretEnvSource)(nil), (*core.SecretEnvSource)(nil), func(a, b interface{}, scope conversion.Scope) error {\n\t\treturn Convert_v1_SecretEnvSource_To_core_SecretEnvSource(a.(*v1.SecretEnvSource), b.(*core.SecretEnvSource), scope)\n\t}); err != nil {\n\t\treturn err\n\t}\n\tif err := s.AddGeneratedConversionFunc((*core.SecretEnvSource)(nil), (*v1.SecretEnvSource)(nil), func(a, b interface{}, scope conversion.Scope) error {\n\t\treturn Convert_core_SecretEnvSource_To_v1_SecretEnvSource(a.(*core.SecretEnvSource), b.(*v1.SecretEnvSource), scope)\n\t}); err != nil {\n\t\treturn err\n\t}\n\tif err := s.AddGeneratedConversionFunc((*v1.SecretKeySelector)(nil), (*core.SecretKeySelector)(nil), func(a, b interface{}, scope conversion.Scope) error {\n\t\treturn Convert_v1_SecretKeySelector_To_core_SecretKeySelector(a.(*v1.SecretKeySelector), b.(*core.SecretKeySelector), scope)\n\t}); err != nil {\n\t\treturn err\n\t}\n\tif err := s.AddGeneratedConversionFunc((*core.SecretKeySelector)(nil), (*v1.SecretKeySelector)(nil), func(a, b interface{}, scope conversion.Scope) error {\n\t\treturn Convert_core_SecretKeySelector_To_v1_SecretKeySelector(a.(*core.SecretKeySelector), b.(*v1.SecretKeySelector), scope)\n\t}); err != nil {\n\t\treturn err\n\t}\n\tif err := s.AddGeneratedConversionFunc((*v1.SecretList)(nil), (*core.SecretList)(nil), func(a, b interface{}, scope conversion.Scope) error {\n\t\treturn Convert_v1_SecretList_To_core_SecretList(a.(*v1.SecretList), b.(*core.SecretList), scope)\n\t}); err != nil {\n\t\treturn err\n\t}\n\tif err := s.AddGeneratedConversionFunc((*core.SecretList)(nil), (*v1.SecretList)(nil), func(a, b interface{}, scope conversion.Scope) error {\n\t\treturn Convert_core_SecretList_To_v1_SecretList(a.(*core.SecretList), b.(*v1.SecretList), scope)\n\t}); err != nil {\n\t\treturn err\n\t}\n\tif err := s.AddGeneratedConversionFunc((*v1.SecretProjection)(nil), (*core.SecretProjection)(nil), func(a, b interface{}, scope conversion.Scope) error {\n\t\treturn Convert_v1_SecretProjection_To_core_SecretProjection(a.(*v1.SecretProjection), b.(*core.SecretProjection), scope)\n\t}); err != nil {\n\t\treturn err\n\t}\n\tif err := s.AddGeneratedConversionFunc((*core.SecretProjection)(nil), (*v1.SecretProjection)(nil), func(a, b interface{}, scope conversion.Scope) error {\n\t\treturn Convert_core_SecretProjection_To_v1_SecretProjection(a.(*core.SecretProjection), b.(*v1.SecretProjection), scope)\n\t}); err != nil {\n\t\treturn err\n\t}\n\tif err := s.AddGeneratedConversionFunc((*v1.SecretReference)(nil), (*core.SecretReference)(nil), func(a, b interface{}, scope conversion.Scope) error {\n\t\treturn Convert_v1_SecretReference_To_core_SecretReference(a.(*v1.SecretReference), b.(*core.SecretReference), scope)\n\t}); err != nil {\n\t\treturn err\n\t}\n\tif err := s.AddGeneratedConversionFunc((*core.SecretReference)(nil), (*v1.SecretReference)(nil), func(a, b interface{}, scope conversion.Scope) error {\n\t\treturn Convert_core_SecretReference_To_v1_SecretReference(a.(*core.SecretReference), b.(*v1.SecretReference), scope)\n\t}); err != nil {\n\t\treturn err\n\t}\n\tif err := s.AddGeneratedConversionFunc((*v1.SecretVolumeSource)(nil), (*core.SecretVolumeSource)(nil), func(a, b interface{}, scope conversion.Scope) error {\n\t\treturn Convert_v1_SecretVolumeSource_To_core_SecretVolumeSource(a.(*v1.SecretVolumeSource), b.(*core.SecretVolumeSource), scope)\n\t}); err != nil {\n\t\treturn err\n\t}\n\tif err := s.AddGeneratedConversionFunc((*core.SecretVolumeSource)(nil), (*v1.SecretVolumeSource)(nil), func(a, b interface{}, scope conversion.Scope) error {\n\t\treturn Convert_core_SecretVolumeSource_To_v1_SecretVolumeSource(a.(*core.SecretVolumeSource), b.(*v1.SecretVolumeSource), scope)\n\t}); err != nil {\n\t\treturn err\n\t}\n\tif err := s.AddGeneratedConversionFunc((*v1.SecurityContext)(nil), (*core.SecurityContext)(nil), func(a, b interface{}, scope conversion.Scope) error {\n\t\treturn Convert_v1_SecurityContext_To_core_SecurityContext(a.(*v1.SecurityContext), b.(*core.SecurityContext), scope)\n\t}); err != nil {\n\t\treturn err\n\t}\n\tif err := s.AddGeneratedConversionFunc((*core.SecurityContext)(nil), (*v1.SecurityContext)(nil), func(a, b interface{}, scope conversion.Scope) error {\n\t\treturn Convert_core_SecurityContext_To_v1_SecurityContext(a.(*core.SecurityContext), b.(*v1.SecurityContext), scope)\n\t}); err != nil {\n\t\treturn err\n\t}\n\tif err := s.AddGeneratedConversionFunc((*v1.SerializedReference)(nil), (*core.SerializedReference)(nil), func(a, b interface{}, scope conversion.Scope) error {\n\t\treturn Convert_v1_SerializedReference_To_core_SerializedReference(a.(*v1.SerializedReference), b.(*core.SerializedReference), scope)\n\t}); err != nil {\n\t\treturn err\n\t}\n\tif err := s.AddGeneratedConversionFunc((*core.SerializedReference)(nil), (*v1.SerializedReference)(nil), func(a, b interface{}, scope conversion.Scope) error {\n\t\treturn Convert_core_SerializedReference_To_v1_SerializedReference(a.(*core.SerializedReference), b.(*v1.SerializedReference), scope)\n\t}); err != nil {\n\t\treturn err\n\t}\n\tif err := s.AddGeneratedConversionFunc((*v1.Service)(nil), (*core.Service)(nil), func(a, b interface{}, scope conversion.Scope) error {\n\t\treturn Convert_v1_Service_To_core_Service(a.(*v1.Service), b.(*core.Service), scope)\n\t}); err != nil {\n\t\treturn err\n\t}\n\tif err := s.AddGeneratedConversionFunc((*core.Service)(nil), (*v1.Service)(nil), func(a, b interface{}, scope conversion.Scope) error {\n\t\treturn Convert_core_Service_To_v1_Service(a.(*core.Service), b.(*v1.Service), scope)\n\t}); err != nil {\n\t\treturn err\n\t}\n\tif err := s.AddGeneratedConversionFunc((*v1.ServiceAccount)(nil), (*core.ServiceAccount)(nil), func(a, b interface{}, scope conversion.Scope) error {\n\t\treturn Convert_v1_ServiceAccount_To_core_ServiceAccount(a.(*v1.ServiceAccount), b.(*core.ServiceAccount), scope)\n\t}); err != nil {\n\t\treturn err\n\t}\n\tif err := s.AddGeneratedConversionFunc((*core.ServiceAccount)(nil), (*v1.ServiceAccount)(nil), func(a, b interface{}, scope conversion.Scope) error {\n\t\treturn Convert_core_ServiceAccount_To_v1_ServiceAccount(a.(*core.ServiceAccount), b.(*v1.ServiceAccount), scope)\n\t}); err != nil {\n\t\treturn err\n\t}\n\tif err := s.AddGeneratedConversionFunc((*v1.ServiceAccountList)(nil), (*core.ServiceAccountList)(nil), func(a, b interface{}, scope conversion.Scope) error {\n\t\treturn Convert_v1_ServiceAccountList_To_core_ServiceAccountList(a.(*v1.ServiceAccountList), b.(*core.ServiceAccountList), scope)\n\t}); err != nil {\n\t\treturn err\n\t}\n\tif err := s.AddGeneratedConversionFunc((*core.ServiceAccountList)(nil), (*v1.ServiceAccountList)(nil), func(a, b interface{}, scope conversion.Scope) error {\n\t\treturn Convert_core_ServiceAccountList_To_v1_ServiceAccountList(a.(*core.ServiceAccountList), b.(*v1.ServiceAccountList), scope)\n\t}); err != nil {\n\t\treturn err\n\t}\n\tif err := s.AddGeneratedConversionFunc((*v1.ServiceAccountTokenProjection)(nil), (*core.ServiceAccountTokenProjection)(nil), func(a, b interface{}, scope conversion.Scope) error {\n\t\treturn Convert_v1_ServiceAccountTokenProjection_To_core_ServiceAccountTokenProjection(a.(*v1.ServiceAccountTokenProjection), b.(*core.ServiceAccountTokenProjection), scope)\n\t}); err != nil {\n\t\treturn err\n\t}\n\tif err := s.AddGeneratedConversionFunc((*core.ServiceAccountTokenProjection)(nil), (*v1.ServiceAccountTokenProjection)(nil), func(a, b interface{}, scope conversion.Scope) error {\n\t\treturn Convert_core_ServiceAccountTokenProjection_To_v1_ServiceAccountTokenProjection(a.(*core.ServiceAccountTokenProjection), b.(*v1.ServiceAccountTokenProjection), scope)\n\t}); err != nil {\n\t\treturn err\n\t}\n\tif err := s.AddGeneratedConversionFunc((*v1.ServiceList)(nil), (*core.ServiceList)(nil), func(a, b interface{}, scope conversion.Scope) error {\n\t\treturn Convert_v1_ServiceList_To_core_ServiceList(a.(*v1.ServiceList), b.(*core.ServiceList), scope)\n\t}); err != nil {\n\t\treturn err\n\t}\n\tif err := s.AddGeneratedConversionFunc((*core.ServiceList)(nil), (*v1.ServiceList)(nil), func(a, b interface{}, scope conversion.Scope) error {\n\t\treturn Convert_core_ServiceList_To_v1_ServiceList(a.(*core.ServiceList), b.(*v1.ServiceList), scope)\n\t}); err != nil {\n\t\treturn err\n\t}\n\tif err := s.AddGeneratedConversionFunc((*v1.ServicePort)(nil), (*core.ServicePort)(nil), func(a, b interface{}, scope conversion.Scope) error {\n\t\treturn Convert_v1_ServicePort_To_core_ServicePort(a.(*v1.ServicePort), b.(*core.ServicePort), scope)\n\t}); err != nil {\n\t\treturn err\n\t}\n\tif err := s.AddGeneratedConversionFunc((*core.ServicePort)(nil), (*v1.ServicePort)(nil), func(a, b interface{}, scope conversion.Scope) error {\n\t\treturn Convert_core_ServicePort_To_v1_ServicePort(a.(*core.ServicePort), b.(*v1.ServicePort), scope)\n\t}); err != nil {\n\t\treturn err\n\t}\n\tif err := s.AddGeneratedConversionFunc((*v1.ServiceProxyOptions)(nil), (*core.ServiceProxyOptions)(nil), func(a, b interface{}, scope conversion.Scope) error {\n\t\treturn Convert_v1_ServiceProxyOptions_To_core_ServiceProxyOptions(a.(*v1.ServiceProxyOptions), b.(*core.ServiceProxyOptions), scope)\n\t}); err != nil {\n\t\treturn err\n\t}\n\tif err := s.AddGeneratedConversionFunc((*core.ServiceProxyOptions)(nil), (*v1.ServiceProxyOptions)(nil), func(a, b interface{}, scope conversion.Scope) error {\n\t\treturn Convert_core_ServiceProxyOptions_To_v1_ServiceProxyOptions(a.(*core.ServiceProxyOptions), b.(*v1.ServiceProxyOptions), scope)\n\t}); err != nil {\n\t\treturn err\n\t}\n\tif err := s.AddGeneratedConversionFunc((*v1.ServiceSpec)(nil), (*core.ServiceSpec)(nil), func(a, b interface{}, scope conversion.Scope) error {\n\t\treturn Convert_v1_ServiceSpec_To_core_ServiceSpec(a.(*v1.ServiceSpec), b.(*core.ServiceSpec), scope)\n\t}); err != nil {\n\t\treturn err\n\t}\n\tif err := s.AddGeneratedConversionFunc((*core.ServiceSpec)(nil), (*v1.ServiceSpec)(nil), func(a, b interface{}, scope conversion.Scope) error {\n\t\treturn Convert_core_ServiceSpec_To_v1_ServiceSpec(a.(*core.ServiceSpec), b.(*v1.ServiceSpec), scope)\n\t}); err != nil {\n\t\treturn err\n\t}\n\tif err := s.AddGeneratedConversionFunc((*v1.ServiceStatus)(nil), (*core.ServiceStatus)(nil), func(a, b interface{}, scope conversion.Scope) error {\n\t\treturn Convert_v1_ServiceStatus_To_core_ServiceStatus(a.(*v1.ServiceStatus), b.(*core.ServiceStatus), scope)\n\t}); err != nil {\n\t\treturn err\n\t}\n\tif err := s.AddGeneratedConversionFunc((*core.ServiceStatus)(nil), (*v1.ServiceStatus)(nil), func(a, b interface{}, scope conversion.Scope) error {\n\t\treturn Convert_core_ServiceStatus_To_v1_ServiceStatus(a.(*core.ServiceStatus), b.(*v1.ServiceStatus), scope)\n\t}); err != nil {\n\t\treturn err\n\t}\n\tif err := s.AddGeneratedConversionFunc((*v1.SessionAffinityConfig)(nil), (*core.SessionAffinityConfig)(nil), func(a, b interface{}, scope conversion.Scope) error {\n\t\treturn Convert_v1_SessionAffinityConfig_To_core_SessionAffinityConfig(a.(*v1.SessionAffinityConfig), b.(*core.SessionAffinityConfig), scope)\n\t}); err != nil {\n\t\treturn err\n\t}\n\tif err := s.AddGeneratedConversionFunc((*core.SessionAffinityConfig)(nil), (*v1.SessionAffinityConfig)(nil), func(a, b interface{}, scope conversion.Scope) error {\n\t\treturn Convert_core_SessionAffinityConfig_To_v1_SessionAffinityConfig(a.(*core.SessionAffinityConfig), b.(*v1.SessionAffinityConfig), scope)\n\t}); err != nil {\n\t\treturn err\n\t}\n\tif err := s.AddGeneratedConversionFunc((*v1.StorageOSPersistentVolumeSource)(nil), (*core.StorageOSPersistentVolumeSource)(nil), func(a, b interface{}, scope conversion.Scope) error {\n\t\treturn Convert_v1_StorageOSPersistentVolumeSource_To_core_StorageOSPersistentVolumeSource(a.(*v1.StorageOSPersistentVolumeSource), b.(*core.StorageOSPersistentVolumeSource), scope)\n\t}); err != nil {\n\t\treturn err\n\t}\n\tif err := s.AddGeneratedConversionFunc((*core.StorageOSPersistentVolumeSource)(nil), (*v1.StorageOSPersistentVolumeSource)(nil), func(a, b interface{}, scope conversion.Scope) error {\n\t\treturn Convert_core_StorageOSPersistentVolumeSource_To_v1_StorageOSPersistentVolumeSource(a.(*core.StorageOSPersistentVolumeSource), b.(*v1.StorageOSPersistentVolumeSource), scope)\n\t}); err != nil {\n\t\treturn err\n\t}\n\tif err := s.AddGeneratedConversionFunc((*v1.StorageOSVolumeSource)(nil), (*core.StorageOSVolumeSource)(nil), func(a, b interface{}, scope conversion.Scope) error {\n\t\treturn Convert_v1_StorageOSVolumeSource_To_core_StorageOSVolumeSource(a.(*v1.StorageOSVolumeSource), b.(*core.StorageOSVolumeSource), scope)\n\t}); err != nil {\n\t\treturn err\n\t}\n\tif err := s.AddGeneratedConversionFunc((*core.StorageOSVolumeSource)(nil), (*v1.StorageOSVolumeSource)(nil), func(a, b interface{}, scope conversion.Scope) error {\n\t\treturn Convert_core_StorageOSVolumeSource_To_v1_StorageOSVolumeSource(a.(*core.StorageOSVolumeSource), b.(*v1.StorageOSVolumeSource), scope)\n\t}); err != nil {\n\t\treturn err\n\t}\n\tif err := s.AddGeneratedConversionFunc((*v1.Sysctl)(nil), (*core.Sysctl)(nil), func(a, b interface{}, scope conversion.Scope) error {\n\t\treturn Convert_v1_Sysctl_To_core_Sysctl(a.(*v1.Sysctl), b.(*core.Sysctl), scope)\n\t}); err != nil {\n\t\treturn err\n\t}\n\tif err := s.AddGeneratedConversionFunc((*core.Sysctl)(nil), (*v1.Sysctl)(nil), func(a, b interface{}, scope conversion.Scope) error {\n\t\treturn Convert_core_Sysctl_To_v1_Sysctl(a.(*core.Sysctl), b.(*v1.Sysctl), scope)\n\t}); err != nil {\n\t\treturn err\n\t}\n\tif err := s.AddGeneratedConversionFunc((*v1.TCPSocketAction)(nil), (*core.TCPSocketAction)(nil), func(a, b interface{}, scope conversion.Scope) error {\n\t\treturn Convert_v1_TCPSocketAction_To_core_TCPSocketAction(a.(*v1.TCPSocketAction), b.(*core.TCPSocketAction), scope)\n\t}); err != nil {\n\t\treturn err\n\t}\n\tif err := s.AddGeneratedConversionFunc((*core.TCPSocketAction)(nil), (*v1.TCPSocketAction)(nil), func(a, b interface{}, scope conversion.Scope) error {\n\t\treturn Convert_core_TCPSocketAction_To_v1_TCPSocketAction(a.(*core.TCPSocketAction), b.(*v1.TCPSocketAction), scope)\n\t}); err != nil {\n\t\treturn err\n\t}\n\tif err := s.AddGeneratedConversionFunc((*v1.Taint)(nil), (*core.Taint)(nil), func(a, b interface{}, scope conversion.Scope) error {\n\t\treturn Convert_v1_Taint_To_core_Taint(a.(*v1.Taint), b.(*core.Taint), scope)\n\t}); err != nil {\n\t\treturn err\n\t}\n\tif err := s.AddGeneratedConversionFunc((*core.Taint)(nil), (*v1.Taint)(nil), func(a, b interface{}, scope conversion.Scope) error {\n\t\treturn Convert_core_Taint_To_v1_Taint(a.(*core.Taint), b.(*v1.Taint), scope)\n\t}); err != nil {\n\t\treturn err\n\t}\n\tif err := s.AddGeneratedConversionFunc((*v1.Toleration)(nil), (*core.Toleration)(nil), func(a, b interface{}, scope conversion.Scope) error {\n\t\treturn Convert_v1_Toleration_To_core_Toleration(a.(*v1.Toleration), b.(*core.Toleration), scope)\n\t}); err != nil {\n\t\treturn err\n\t}\n\tif err := s.AddGeneratedConversionFunc((*core.Toleration)(nil), (*v1.Toleration)(nil), func(a, b interface{}, scope conversion.Scope) error {\n\t\treturn Convert_core_Toleration_To_v1_Toleration(a.(*core.Toleration), b.(*v1.Toleration), scope)\n\t}); err != nil {\n\t\treturn err\n\t}\n\tif err := s.AddGeneratedConversionFunc((*v1.TopologySelectorLabelRequirement)(nil), (*core.TopologySelectorLabelRequirement)(nil), func(a, b interface{}, scope conversion.Scope) error {\n\t\treturn Convert_v1_TopologySelectorLabelRequirement_To_core_TopologySelectorLabelRequirement(a.(*v1.TopologySelectorLabelRequirement), b.(*core.TopologySelectorLabelRequirement), scope)\n\t}); err != nil {\n\t\treturn err\n\t}\n\tif err := s.AddGeneratedConversionFunc((*core.TopologySelectorLabelRequirement)(nil), (*v1.TopologySelectorLabelRequirement)(nil), func(a, b interface{}, scope conversion.Scope) error {\n\t\treturn Convert_core_TopologySelectorLabelRequirement_To_v1_TopologySelectorLabelRequirement(a.(*core.TopologySelectorLabelRequirement), b.(*v1.TopologySelectorLabelRequirement), scope)\n\t}); err != nil {\n\t\treturn err\n\t}\n\tif err := s.AddGeneratedConversionFunc((*v1.TopologySelectorTerm)(nil), (*core.TopologySelectorTerm)(nil), func(a, b interface{}, scope conversion.Scope) error {\n\t\treturn Convert_v1_TopologySelectorTerm_To_core_TopologySelectorTerm(a.(*v1.TopologySelectorTerm), b.(*core.TopologySelectorTerm), scope)\n\t}); err != nil {\n\t\treturn err\n\t}\n\tif err := s.AddGeneratedConversionFunc((*core.TopologySelectorTerm)(nil), (*v1.TopologySelectorTerm)(nil), func(a, b interface{}, scope conversion.Scope) error {\n\t\treturn Convert_core_TopologySelectorTerm_To_v1_TopologySelectorTerm(a.(*core.TopologySelectorTerm), b.(*v1.TopologySelectorTerm), scope)\n\t}); err != nil {\n\t\treturn err\n\t}\n\tif err := s.AddGeneratedConversionFunc((*v1.TopologySpreadConstraint)(nil), (*core.TopologySpreadConstraint)(nil), func(a, b interface{}, scope conversion.Scope) error {\n\t\treturn Convert_v1_TopologySpreadConstraint_To_core_TopologySpreadConstraint(a.(*v1.TopologySpreadConstraint), b.(*core.TopologySpreadConstraint), scope)\n\t}); err != nil {\n\t\treturn err\n\t}\n\tif err := s.AddGeneratedConversionFunc((*core.TopologySpreadConstraint)(nil), (*v1.TopologySpreadConstraint)(nil), func(a, b interface{}, scope conversion.Scope) error {\n\t\treturn Convert_core_TopologySpreadConstraint_To_v1_TopologySpreadConstraint(a.(*core.TopologySpreadConstraint), b.(*v1.TopologySpreadConstraint), scope)\n\t}); err != nil {\n\t\treturn err\n\t}\n\tif err := s.AddGeneratedConversionFunc((*v1.TypedLocalObjectReference)(nil), (*core.TypedLocalObjectReference)(nil), func(a, b interface{}, scope conversion.Scope) error {\n\t\treturn Convert_v1_TypedLocalObjectReference_To_core_TypedLocalObjectReference(a.(*v1.TypedLocalObjectReference), b.(*core.TypedLocalObjectReference), scope)\n\t}); err != nil {\n\t\treturn err\n\t}\n\tif err := s.AddGeneratedConversionFunc((*core.TypedLocalObjectReference)(nil), (*v1.TypedLocalObjectReference)(nil), func(a, b interface{}, scope conversion.Scope) error {\n\t\treturn Convert_core_TypedLocalObjectReference_To_v1_TypedLocalObjectReference(a.(*core.TypedLocalObjectReference), b.(*v1.TypedLocalObjectReference), scope)\n\t}); err != nil {\n\t\treturn err\n\t}\n\tif err := s.AddGeneratedConversionFunc((*v1.TypedObjectReference)(nil), (*core.TypedObjectReference)(nil), func(a, b interface{}, scope conversion.Scope) error {\n\t\treturn Convert_v1_TypedObjectReference_To_core_TypedObjectReference(a.(*v1.TypedObjectReference), b.(*core.TypedObjectReference), scope)\n\t}); err != nil {\n\t\treturn err\n\t}\n\tif err := s.AddGeneratedConversionFunc((*core.TypedObjectReference)(nil), (*v1.TypedObjectReference)(nil), func(a, b interface{}, scope conversion.Scope) error {\n\t\treturn Convert_core_TypedObjectReference_To_v1_TypedObjectReference(a.(*core.TypedObjectReference), b.(*v1.TypedObjectReference), scope)\n\t}); err != nil {\n\t\treturn err\n\t}\n\tif err := s.AddGeneratedConversionFunc((*v1.VolumeDevice)(nil), (*core.VolumeDevice)(nil), func(a, b interface{}, scope conversion.Scope) error {\n\t\treturn Convert_v1_VolumeDevice_To_core_VolumeDevice(a.(*v1.VolumeDevice), b.(*core.VolumeDevice), scope)\n\t}); err != nil {\n\t\treturn err\n\t}\n\tif err := s.AddGeneratedConversionFunc((*core.VolumeDevice)(nil), (*v1.VolumeDevice)(nil), func(a, b interface{}, scope conversion.Scope) error {\n\t\treturn Convert_core_VolumeDevice_To_v1_VolumeDevice(a.(*core.VolumeDevice), b.(*v1.VolumeDevice), scope)\n\t}); err != nil {\n\t\treturn err\n\t}\n\tif err := s.AddGeneratedConversionFunc((*v1.VolumeMount)(nil), (*core.VolumeMount)(nil), func(a, b interface{}, scope conversion.Scope) error {\n\t\treturn Convert_v1_VolumeMount_To_core_VolumeMount(a.(*v1.VolumeMount), b.(*core.VolumeMount), scope)\n\t}); err != nil {\n\t\treturn err\n\t}\n\tif err := s.AddGeneratedConversionFunc((*core.VolumeMount)(nil), (*v1.VolumeMount)(nil), func(a, b interface{}, scope conversion.Scope) error {\n\t\treturn Convert_core_VolumeMount_To_v1_VolumeMount(a.(*core.VolumeMount), b.(*v1.VolumeMount), scope)\n\t}); err != nil {\n\t\treturn err\n\t}\n\tif err := s.AddGeneratedConversionFunc((*v1.VolumeNodeAffinity)(nil), (*core.VolumeNodeAffinity)(nil), func(a, b interface{}, scope conversion.Scope) error {\n\t\treturn Convert_v1_VolumeNodeAffinity_To_core_VolumeNodeAffinity(a.(*v1.VolumeNodeAffinity), b.(*core.VolumeNodeAffinity), scope)\n\t}); err != nil {\n\t\treturn err\n\t}\n\tif err := s.AddGeneratedConversionFunc((*core.VolumeNodeAffinity)(nil), (*v1.VolumeNodeAffinity)(nil), func(a, b interface{}, scope conversion.Scope) error {\n\t\treturn Convert_core_VolumeNodeAffinity_To_v1_VolumeNodeAffinity(a.(*core.VolumeNodeAffinity), b.(*v1.VolumeNodeAffinity), scope)\n\t}); err != nil {\n\t\treturn err\n\t}\n\tif err := s.AddGeneratedConversionFunc((*v1.VolumeProjection)(nil), (*core.VolumeProjection)(nil), func(a, b interface{}, scope conversion.Scope) error {\n\t\treturn Convert_v1_VolumeProjection_To_core_VolumeProjection(a.(*v1.VolumeProjection), b.(*core.VolumeProjection), scope)\n\t}); err != nil {\n\t\treturn err\n\t}\n\tif err := s.AddGeneratedConversionFunc((*core.VolumeProjection)(nil), (*v1.VolumeProjection)(nil), func(a, b interface{}, scope conversion.Scope) error {\n\t\treturn Convert_core_VolumeProjection_To_v1_VolumeProjection(a.(*core.VolumeProjection), b.(*v1.VolumeProjection), scope)\n\t}); err != nil {\n\t\treturn err\n\t}\n\tif err := s.AddGeneratedConversionFunc((*v1.VolumeSource)(nil), (*core.VolumeSource)(nil), func(a, b interface{}, scope conversion.Scope) error {\n\t\treturn Convert_v1_VolumeSource_To_core_VolumeSource(a.(*v1.VolumeSource), b.(*core.VolumeSource), scope)\n\t}); err != nil {\n\t\treturn err\n\t}\n\tif err := s.AddGeneratedConversionFunc((*core.VolumeSource)(nil), (*v1.VolumeSource)(nil), func(a, b interface{}, scope conversion.Scope) error {\n\t\treturn Convert_core_VolumeSource_To_v1_VolumeSource(a.(*core.VolumeSource), b.(*v1.VolumeSource), scope)\n\t}); err != nil {\n\t\treturn err\n\t}\n\tif err := s.AddGeneratedConversionFunc((*v1.VsphereVirtualDiskVolumeSource)(nil), (*core.VsphereVirtualDiskVolumeSource)(nil), func(a, b interface{}, scope conversion.Scope) error {\n\t\treturn Convert_v1_VsphereVirtualDiskVolumeSource_To_core_VsphereVirtualDiskVolumeSource(a.(*v1.VsphereVirtualDiskVolumeSource), b.(*core.VsphereVirtualDiskVolumeSource), scope)\n\t}); err != nil {\n\t\treturn err\n\t}\n\tif err := s.AddGeneratedConversionFunc((*core.VsphereVirtualDiskVolumeSource)(nil), (*v1.VsphereVirtualDiskVolumeSource)(nil), func(a, b interface{}, scope conversion.Scope) error {\n\t\treturn Convert_core_VsphereVirtualDiskVolumeSource_To_v1_VsphereVirtualDiskVolumeSource(a.(*core.VsphereVirtualDiskVolumeSource), b.(*v1.VsphereVirtualDiskVolumeSource), scope)\n\t}); err != nil {\n\t\treturn err\n\t}\n\tif err := s.AddGeneratedConversionFunc((*v1.WeightedPodAffinityTerm)(nil), (*core.WeightedPodAffinityTerm)(nil), func(a, b interface{}, scope conversion.Scope) error {\n\t\treturn Convert_v1_WeightedPodAffinityTerm_To_core_WeightedPodAffinityTerm(a.(*v1.WeightedPodAffinityTerm), b.(*core.WeightedPodAffinityTerm), scope)\n\t}); err != nil {\n\t\treturn err\n\t}\n\tif err := s.AddGeneratedConversionFunc((*core.WeightedPodAffinityTerm)(nil), (*v1.WeightedPodAffinityTerm)(nil), func(a, b interface{}, scope conversion.Scope) error {\n\t\treturn Convert_core_WeightedPodAffinityTerm_To_v1_WeightedPodAffinityTerm(a.(*core.WeightedPodAffinityTerm), b.(*v1.WeightedPodAffinityTerm), scope)\n\t}); err != nil {\n\t\treturn err\n\t}\n\tif err := s.AddGeneratedConversionFunc((*v1.WindowsSecurityContextOptions)(nil), (*core.WindowsSecurityContextOptions)(nil), func(a, b interface{}, scope conversion.Scope) error {\n\t\treturn Convert_v1_WindowsSecurityContextOptions_To_core_WindowsSecurityContextOptions(a.(*v1.WindowsSecurityContextOptions), b.(*core.WindowsSecurityContextOptions), scope)\n\t}); err != nil {\n\t\treturn err\n\t}\n\tif err := s.AddGeneratedConversionFunc((*core.WindowsSecurityContextOptions)(nil), (*v1.WindowsSecurityContextOptions)(nil), func(a, b interface{}, scope conversion.Scope) error {\n\t\treturn Convert_core_WindowsSecurityContextOptions_To_v1_WindowsSecurityContextOptions(a.(*core.WindowsSecurityContextOptions), b.(*v1.WindowsSecurityContextOptions), scope)\n\t}); err != nil {\n\t\treturn err\n\t}\n\tif err := s.AddGeneratedConversionFunc((*url.Values)(nil), (*v1.NodeProxyOptions)(nil), func(a, b interface{}, scope conversion.Scope) error {\n\t\treturn Convert_url_Values_To_v1_NodeProxyOptions(a.(*url.Values), b.(*v1.NodeProxyOptions), scope)\n\t}); err != nil {\n\t\treturn err\n\t}\n\tif err := s.AddGeneratedConversionFunc((*url.Values)(nil), (*v1.PodAttachOptions)(nil), func(a, b interface{}, scope conversion.Scope) error {\n\t\treturn Convert_url_Values_To_v1_PodAttachOptions(a.(*url.Values), b.(*v1.PodAttachOptions), scope)\n\t}); err != nil {\n\t\treturn err\n\t}\n\tif err := s.AddGeneratedConversionFunc((*url.Values)(nil), (*v1.PodExecOptions)(nil), func(a, b interface{}, scope conversion.Scope) error {\n\t\treturn Convert_url_Values_To_v1_PodExecOptions(a.(*url.Values), b.(*v1.PodExecOptions), scope)\n\t}); err != nil {\n\t\treturn err\n\t}\n\tif err := s.AddGeneratedConversionFunc((*url.Values)(nil), (*v1.PodLogOptions)(nil), func(a, b interface{}, scope conversion.Scope) error {\n\t\treturn Convert_url_Values_To_v1_PodLogOptions(a.(*url.Values), b.(*v1.PodLogOptions), scope)\n\t}); err != nil {\n\t\treturn err\n\t}\n\tif err := s.AddGeneratedConversionFunc((*url.Values)(nil), (*v1.PodPortForwardOptions)(nil), func(a, b interface{}, scope conversion.Scope) error {\n\t\treturn Convert_url_Values_To_v1_PodPortForwardOptions(a.(*url.Values), b.(*v1.PodPortForwardOptions), scope)\n\t}); err != nil {\n\t\treturn err\n\t}\n\tif err := s.AddGeneratedConversionFunc((*url.Values)(nil), (*v1.PodProxyOptions)(nil), func(a, b interface{}, scope conversion.Scope) error {\n\t\treturn Convert_url_Values_To_v1_PodProxyOptions(a.(*url.Values), b.(*v1.PodProxyOptions), scope)\n\t}); err != nil {\n\t\treturn err\n\t}\n\tif err := s.AddGeneratedConversionFunc((*url.Values)(nil), (*v1.ServiceProxyOptions)(nil), func(a, b interface{}, scope conversion.Scope) error {\n\t\treturn Convert_url_Values_To_v1_ServiceProxyOptions(a.(*url.Values), b.(*v1.ServiceProxyOptions), scope)\n\t}); err != nil {\n\t\treturn err\n\t}\n\tif err := s.AddConversionFunc((*apps.ReplicaSetSpec)(nil), (*v1.ReplicationControllerSpec)(nil), func(a, b interface{}, scope conversion.Scope) error {\n\t\treturn Convert_apps_ReplicaSetSpec_To_v1_ReplicationControllerSpec(a.(*apps.ReplicaSetSpec), b.(*v1.ReplicationControllerSpec), scope)\n\t}); err != nil {\n\t\treturn err\n\t}\n\tif err := s.AddConversionFunc((*apps.ReplicaSetStatus)(nil), (*v1.ReplicationControllerStatus)(nil), func(a, b interface{}, scope conversion.Scope) error {\n\t\treturn Convert_apps_ReplicaSetStatus_To_v1_ReplicationControllerStatus(a.(*apps.ReplicaSetStatus), b.(*v1.ReplicationControllerStatus), scope)\n\t}); err != nil {\n\t\treturn err\n\t}\n\tif err := s.AddConversionFunc((*apps.ReplicaSet)(nil), (*v1.ReplicationController)(nil), func(a, b interface{}, scope conversion.Scope) error {\n\t\treturn Convert_apps_ReplicaSet_To_v1_ReplicationController(a.(*apps.ReplicaSet), b.(*v1.ReplicationController), scope)\n\t}); err != nil {\n\t\treturn err\n\t}\n\tif err := s.AddConversionFunc((*core.LoadBalancerStatus)(nil), (*v1.LoadBalancerStatus)(nil), func(a, b interface{}, scope conversion.Scope) error {\n\t\treturn Convert_core_LoadBalancerStatus_To_v1_LoadBalancerStatus(a.(*core.LoadBalancerStatus), b.(*v1.LoadBalancerStatus), scope)\n\t}); err != nil {\n\t\treturn err\n\t}\n\tif err := s.AddConversionFunc((*core.NodeSpec)(nil), (*v1.NodeSpec)(nil), func(a, b interface{}, scope conversion.Scope) error {\n\t\treturn Convert_core_NodeSpec_To_v1_NodeSpec(a.(*core.NodeSpec), b.(*v1.NodeSpec), scope)\n\t}); err != nil {\n\t\treturn err\n\t}\n\tif err := s.AddConversionFunc((*core.PersistentVolumeSpec)(nil), (*v1.PersistentVolumeSpec)(nil), func(a, b interface{}, scope conversion.Scope) error {\n\t\treturn Convert_core_PersistentVolumeSpec_To_v1_PersistentVolumeSpec(a.(*core.PersistentVolumeSpec), b.(*v1.PersistentVolumeSpec), scope)\n\t}); err != nil {\n\t\treturn err\n\t}\n\tif err := s.AddConversionFunc((*core.PodSpec)(nil), (*v1.PodSpec)(nil), func(a, b interface{}, scope conversion.Scope) error {\n\t\treturn Convert_core_PodSpec_To_v1_PodSpec(a.(*core.PodSpec), b.(*v1.PodSpec), scope)\n\t}); err != nil {\n\t\treturn err\n\t}\n\tif err := s.AddConversionFunc((*core.PodStatus)(nil), (*v1.PodStatus)(nil), func(a, b interface{}, scope conversion.Scope) error {\n\t\treturn Convert_core_PodStatus_To_v1_PodStatus(a.(*core.PodStatus), b.(*v1.PodStatus), scope)\n\t}); err != nil {\n\t\treturn err\n\t}\n\tif err := s.AddConversionFunc((*core.PodTemplateSpec)(nil), (*v1.PodTemplateSpec)(nil), func(a, b interface{}, scope conversion.Scope) error {\n\t\treturn Convert_core_PodTemplateSpec_To_v1_PodTemplateSpec(a.(*core.PodTemplateSpec), b.(*v1.PodTemplateSpec), scope)\n\t}); err != nil {\n\t\treturn err\n\t}\n\tif err := s.AddConversionFunc((*core.Pod)(nil), (*v1.Pod)(nil), func(a, b interface{}, scope conversion.Scope) error {\n\t\treturn Convert_core_Pod_To_v1_Pod(a.(*core.Pod), b.(*v1.Pod), scope)\n\t}); err != nil {\n\t\treturn err\n\t}\n\tif err := s.AddConversionFunc((*core.ReplicationControllerSpec)(nil), (*v1.ReplicationControllerSpec)(nil), func(a, b interface{}, scope conversion.Scope) error {\n\t\treturn Convert_core_ReplicationControllerSpec_To_v1_ReplicationControllerSpec(a.(*core.ReplicationControllerSpec), b.(*v1.ReplicationControllerSpec), scope)\n\t}); err != nil {\n\t\treturn err\n\t}\n\tif err := s.AddConversionFunc((*core.Volume)(nil), (*v1.Volume)(nil), func(a, b interface{}, scope conversion.Scope) error {\n\t\treturn Convert_core_Volume_To_v1_Volume(a.(*core.Volume), b.(*v1.Volume), scope)\n\t}); err != nil {\n\t\treturn err\n\t}\n\tif err := s.AddConversionFunc((*v1.LoadBalancerStatus)(nil), (*core.LoadBalancerStatus)(nil), func(a, b interface{}, scope conversion.Scope) error {\n\t\treturn Convert_v1_LoadBalancerStatus_To_core_LoadBalancerStatus(a.(*v1.LoadBalancerStatus), b.(*core.LoadBalancerStatus), scope)\n\t}); err != nil {\n\t\treturn err\n\t}\n\tif err := s.AddConversionFunc((*v1.NodeSpec)(nil), (*core.NodeSpec)(nil), func(a, b interface{}, scope conversion.Scope) error {\n\t\treturn Convert_v1_NodeSpec_To_core_NodeSpec(a.(*v1.NodeSpec), b.(*core.NodeSpec), scope)\n\t}); err != nil {\n\t\treturn err\n\t}\n\tif err := s.AddConversionFunc((*v1.PersistentVolumeSpec)(nil), (*core.PersistentVolumeSpec)(nil), func(a, b interface{}, scope conversion.Scope) error {\n\t\treturn Convert_v1_PersistentVolumeSpec_To_core_PersistentVolumeSpec(a.(*v1.PersistentVolumeSpec), b.(*core.PersistentVolumeSpec), scope)\n\t}); err != nil {\n\t\treturn err\n\t}\n\tif err := s.AddConversionFunc((*v1.PodSpec)(nil), (*core.PodSpec)(nil), func(a, b interface{}, scope conversion.Scope) error {\n\t\treturn Convert_v1_PodSpec_To_core_PodSpec(a.(*v1.PodSpec), b.(*core.PodSpec), scope)\n\t}); err != nil {\n\t\treturn err\n\t}\n\tif err := s.AddConversionFunc((*v1.PodStatus)(nil), (*core.PodStatus)(nil), func(a, b interface{}, scope conversion.Scope) error {\n\t\treturn Convert_v1_PodStatus_To_core_PodStatus(a.(*v1.PodStatus), b.(*core.PodStatus), scope)\n\t}); err != nil {\n\t\treturn err\n\t}\n\tif err := s.AddConversionFunc((*v1.PodTemplateSpec)(nil), (*core.PodTemplateSpec)(nil), func(a, b interface{}, scope conversion.Scope) error {\n\t\treturn Convert_v1_PodTemplateSpec_To_core_PodTemplateSpec(a.(*v1.PodTemplateSpec), b.(*core.PodTemplateSpec), scope)\n\t}); err != nil {\n\t\treturn err\n\t}\n\tif err := s.AddConversionFunc((*v1.Pod)(nil), (*core.Pod)(nil), func(a, b interface{}, scope conversion.Scope) error {\n\t\treturn Convert_v1_Pod_To_core_Pod(a.(*v1.Pod), b.(*core.Pod), scope)\n\t}); err != nil {\n\t\treturn err\n\t}\n\tif err := s.AddConversionFunc((*v1.ReplicationControllerSpec)(nil), (*apps.ReplicaSetSpec)(nil), func(a, b interface{}, scope conversion.Scope) error {\n\t\treturn Convert_v1_ReplicationControllerSpec_To_apps_ReplicaSetSpec(a.(*v1.ReplicationControllerSpec), b.(*apps.ReplicaSetSpec), scope)\n\t}); err != nil {\n\t\treturn err\n\t}\n\tif err := s.AddConversionFunc((*v1.ReplicationControllerSpec)(nil), (*core.ReplicationControllerSpec)(nil), func(a, b interface{}, scope conversion.Scope) error {\n\t\treturn Convert_v1_ReplicationControllerSpec_To_core_ReplicationControllerSpec(a.(*v1.ReplicationControllerSpec), b.(*core.ReplicationControllerSpec), scope)\n\t}); err != nil {\n\t\treturn err\n\t}\n\tif err := s.AddConversionFunc((*v1.ReplicationControllerStatus)(nil), (*apps.ReplicaSetStatus)(nil), func(a, b interface{}, scope conversion.Scope) error {\n\t\treturn Convert_v1_ReplicationControllerStatus_To_apps_ReplicaSetStatus(a.(*v1.ReplicationControllerStatus), b.(*apps.ReplicaSetStatus), scope)\n\t}); err != nil {\n\t\treturn err\n\t}\n\tif err := s.AddConversionFunc((*v1.ReplicationController)(nil), (*apps.ReplicaSet)(nil), func(a, b interface{}, scope conversion.Scope) error {\n\t\treturn Convert_v1_ReplicationController_To_apps_ReplicaSet(a.(*v1.ReplicationController), b.(*apps.ReplicaSet), scope)\n\t}); err != nil {\n\t\treturn err\n\t}\n\tif err := s.AddConversionFunc((*v1.ResourceList)(nil), (*core.ResourceList)(nil), func(a, b interface{}, scope conversion.Scope) error {\n\t\treturn Convert_v1_ResourceList_To_core_ResourceList(a.(*v1.ResourceList), b.(*core.ResourceList), scope)\n\t}); err != nil {\n\t\treturn err\n\t}\n\tif err := s.AddConversionFunc((*v1.Secret)(nil), (*core.Secret)(nil), func(a, b interface{}, scope conversion.Scope) error {\n\t\treturn Convert_v1_Secret_To_core_Secret(a.(*v1.Secret), b.(*core.Secret), scope)\n\t}); err != nil {\n\t\treturn err\n\t}\n\tif err := s.AddConversionFunc((*v1.Volume)(nil), (*core.Volume)(nil), func(a, b interface{}, scope conversion.Scope) error {\n\t\treturn Convert_v1_Volume_To_core_Volume(a.(*v1.Volume), b.(*core.Volume), scope)\n\t}); err != nil {\n\t\treturn err\n\t}\n\treturn nil\n}", "title": "" }, { "docid": "8020ea61491a8dbd2f576e0095d91ee6", "score": "0.7080767", "text": "func RegisterConversions(scheme *runtime.Scheme) error {\n\treturn scheme.AddGeneratedConversionFuncs(\n\t\tConvert_v1alpha1_PriorityClass_To_scheduling_PriorityClass,\n\t\tConvert_scheduling_PriorityClass_To_v1alpha1_PriorityClass,\n\t\tConvert_v1alpha1_PriorityClassList_To_scheduling_PriorityClassList,\n\t\tConvert_scheduling_PriorityClassList_To_v1alpha1_PriorityClassList,\n\t)\n}", "title": "" }, { "docid": "668af251de3252f9bc21fb3305a79a59", "score": "0.70758086", "text": "func RegisterConversions(s *runtime.Scheme) error {\n\tif err := s.AddGeneratedConversionFunc((*APISpec)(nil), (*kops.APISpec)(nil), func(a, b interface{}, scope conversion.Scope) error {\n\t\treturn Convert_v1alpha3_APISpec_To_kops_APISpec(a.(*APISpec), b.(*kops.APISpec), scope)\n\t}); err != nil {\n\t\treturn err\n\t}\n\tif err := s.AddGeneratedConversionFunc((*kops.APISpec)(nil), (*APISpec)(nil), func(a, b interface{}, scope conversion.Scope) error {\n\t\treturn Convert_kops_APISpec_To_v1alpha3_APISpec(a.(*kops.APISpec), b.(*APISpec), scope)\n\t}); err != nil {\n\t\treturn err\n\t}\n\tif err := s.AddGeneratedConversionFunc((*AWSAuthenticationIdentityMappingSpec)(nil), (*kops.AWSAuthenticationIdentityMappingSpec)(nil), func(a, b interface{}, scope conversion.Scope) error {\n\t\treturn Convert_v1alpha3_AWSAuthenticationIdentityMappingSpec_To_kops_AWSAuthenticationIdentityMappingSpec(a.(*AWSAuthenticationIdentityMappingSpec), b.(*kops.AWSAuthenticationIdentityMappingSpec), scope)\n\t}); err != nil {\n\t\treturn err\n\t}\n\tif err := s.AddGeneratedConversionFunc((*kops.AWSAuthenticationIdentityMappingSpec)(nil), (*AWSAuthenticationIdentityMappingSpec)(nil), func(a, b interface{}, scope conversion.Scope) error {\n\t\treturn Convert_kops_AWSAuthenticationIdentityMappingSpec_To_v1alpha3_AWSAuthenticationIdentityMappingSpec(a.(*kops.AWSAuthenticationIdentityMappingSpec), b.(*AWSAuthenticationIdentityMappingSpec), scope)\n\t}); err != nil {\n\t\treturn err\n\t}\n\tif err := s.AddGeneratedConversionFunc((*AWSAuthenticationSpec)(nil), (*kops.AWSAuthenticationSpec)(nil), func(a, b interface{}, scope conversion.Scope) error {\n\t\treturn Convert_v1alpha3_AWSAuthenticationSpec_To_kops_AWSAuthenticationSpec(a.(*AWSAuthenticationSpec), b.(*kops.AWSAuthenticationSpec), scope)\n\t}); err != nil {\n\t\treturn err\n\t}\n\tif err := s.AddGeneratedConversionFunc((*kops.AWSAuthenticationSpec)(nil), (*AWSAuthenticationSpec)(nil), func(a, b interface{}, scope conversion.Scope) error {\n\t\treturn Convert_kops_AWSAuthenticationSpec_To_v1alpha3_AWSAuthenticationSpec(a.(*kops.AWSAuthenticationSpec), b.(*AWSAuthenticationSpec), scope)\n\t}); err != nil {\n\t\treturn err\n\t}\n\tif err := s.AddGeneratedConversionFunc((*AWSPermission)(nil), (*kops.AWSPermission)(nil), func(a, b interface{}, scope conversion.Scope) error {\n\t\treturn Convert_v1alpha3_AWSPermission_To_kops_AWSPermission(a.(*AWSPermission), b.(*kops.AWSPermission), scope)\n\t}); err != nil {\n\t\treturn err\n\t}\n\tif err := s.AddGeneratedConversionFunc((*kops.AWSPermission)(nil), (*AWSPermission)(nil), func(a, b interface{}, scope conversion.Scope) error {\n\t\treturn Convert_kops_AWSPermission_To_v1alpha3_AWSPermission(a.(*kops.AWSPermission), b.(*AWSPermission), scope)\n\t}); err != nil {\n\t\treturn err\n\t}\n\tif err := s.AddGeneratedConversionFunc((*AWSSpec)(nil), (*kops.AWSSpec)(nil), func(a, b interface{}, scope conversion.Scope) error {\n\t\treturn Convert_v1alpha3_AWSSpec_To_kops_AWSSpec(a.(*AWSSpec), b.(*kops.AWSSpec), scope)\n\t}); err != nil {\n\t\treturn err\n\t}\n\tif err := s.AddGeneratedConversionFunc((*kops.AWSSpec)(nil), (*AWSSpec)(nil), func(a, b interface{}, scope conversion.Scope) error {\n\t\treturn Convert_kops_AWSSpec_To_v1alpha3_AWSSpec(a.(*kops.AWSSpec), b.(*AWSSpec), scope)\n\t}); err != nil {\n\t\treturn err\n\t}\n\tif err := s.AddGeneratedConversionFunc((*AcceleratorConfig)(nil), (*kops.AcceleratorConfig)(nil), func(a, b interface{}, scope conversion.Scope) error {\n\t\treturn Convert_v1alpha3_AcceleratorConfig_To_kops_AcceleratorConfig(a.(*AcceleratorConfig), b.(*kops.AcceleratorConfig), scope)\n\t}); err != nil {\n\t\treturn err\n\t}\n\tif err := s.AddGeneratedConversionFunc((*kops.AcceleratorConfig)(nil), (*AcceleratorConfig)(nil), func(a, b interface{}, scope conversion.Scope) error {\n\t\treturn Convert_kops_AcceleratorConfig_To_v1alpha3_AcceleratorConfig(a.(*kops.AcceleratorConfig), b.(*AcceleratorConfig), scope)\n\t}); err != nil {\n\t\treturn err\n\t}\n\tif err := s.AddGeneratedConversionFunc((*AccessLogSpec)(nil), (*kops.AccessLogSpec)(nil), func(a, b interface{}, scope conversion.Scope) error {\n\t\treturn Convert_v1alpha3_AccessLogSpec_To_kops_AccessLogSpec(a.(*AccessLogSpec), b.(*kops.AccessLogSpec), scope)\n\t}); err != nil {\n\t\treturn err\n\t}\n\tif err := s.AddGeneratedConversionFunc((*kops.AccessLogSpec)(nil), (*AccessLogSpec)(nil), func(a, b interface{}, scope conversion.Scope) error {\n\t\treturn Convert_kops_AccessLogSpec_To_v1alpha3_AccessLogSpec(a.(*kops.AccessLogSpec), b.(*AccessLogSpec), scope)\n\t}); err != nil {\n\t\treturn err\n\t}\n\tif err := s.AddGeneratedConversionFunc((*AddonSpec)(nil), (*kops.AddonSpec)(nil), func(a, b interface{}, scope conversion.Scope) error {\n\t\treturn Convert_v1alpha3_AddonSpec_To_kops_AddonSpec(a.(*AddonSpec), b.(*kops.AddonSpec), scope)\n\t}); err != nil {\n\t\treturn err\n\t}\n\tif err := s.AddGeneratedConversionFunc((*kops.AddonSpec)(nil), (*AddonSpec)(nil), func(a, b interface{}, scope conversion.Scope) error {\n\t\treturn Convert_kops_AddonSpec_To_v1alpha3_AddonSpec(a.(*kops.AddonSpec), b.(*AddonSpec), scope)\n\t}); err != nil {\n\t\treturn err\n\t}\n\tif err := s.AddGeneratedConversionFunc((*AlwaysAllowAuthorizationSpec)(nil), (*kops.AlwaysAllowAuthorizationSpec)(nil), func(a, b interface{}, scope conversion.Scope) error {\n\t\treturn Convert_v1alpha3_AlwaysAllowAuthorizationSpec_To_kops_AlwaysAllowAuthorizationSpec(a.(*AlwaysAllowAuthorizationSpec), b.(*kops.AlwaysAllowAuthorizationSpec), scope)\n\t}); err != nil {\n\t\treturn err\n\t}\n\tif err := s.AddGeneratedConversionFunc((*kops.AlwaysAllowAuthorizationSpec)(nil), (*AlwaysAllowAuthorizationSpec)(nil), func(a, b interface{}, scope conversion.Scope) error {\n\t\treturn Convert_kops_AlwaysAllowAuthorizationSpec_To_v1alpha3_AlwaysAllowAuthorizationSpec(a.(*kops.AlwaysAllowAuthorizationSpec), b.(*AlwaysAllowAuthorizationSpec), scope)\n\t}); err != nil {\n\t\treturn err\n\t}\n\tif err := s.AddGeneratedConversionFunc((*AmazonVPCNetworkingSpec)(nil), (*kops.AmazonVPCNetworkingSpec)(nil), func(a, b interface{}, scope conversion.Scope) error {\n\t\treturn Convert_v1alpha3_AmazonVPCNetworkingSpec_To_kops_AmazonVPCNetworkingSpec(a.(*AmazonVPCNetworkingSpec), b.(*kops.AmazonVPCNetworkingSpec), scope)\n\t}); err != nil {\n\t\treturn err\n\t}\n\tif err := s.AddGeneratedConversionFunc((*kops.AmazonVPCNetworkingSpec)(nil), (*AmazonVPCNetworkingSpec)(nil), func(a, b interface{}, scope conversion.Scope) error {\n\t\treturn Convert_kops_AmazonVPCNetworkingSpec_To_v1alpha3_AmazonVPCNetworkingSpec(a.(*kops.AmazonVPCNetworkingSpec), b.(*AmazonVPCNetworkingSpec), scope)\n\t}); err != nil {\n\t\treturn err\n\t}\n\tif err := s.AddGeneratedConversionFunc((*AssetsSpec)(nil), (*kops.AssetsSpec)(nil), func(a, b interface{}, scope conversion.Scope) error {\n\t\treturn Convert_v1alpha3_AssetsSpec_To_kops_AssetsSpec(a.(*AssetsSpec), b.(*kops.AssetsSpec), scope)\n\t}); err != nil {\n\t\treturn err\n\t}\n\tif err := s.AddGeneratedConversionFunc((*kops.AssetsSpec)(nil), (*AssetsSpec)(nil), func(a, b interface{}, scope conversion.Scope) error {\n\t\treturn Convert_kops_AssetsSpec_To_v1alpha3_AssetsSpec(a.(*kops.AssetsSpec), b.(*AssetsSpec), scope)\n\t}); err != nil {\n\t\treturn err\n\t}\n\tif err := s.AddGeneratedConversionFunc((*AuthenticationSpec)(nil), (*kops.AuthenticationSpec)(nil), func(a, b interface{}, scope conversion.Scope) error {\n\t\treturn Convert_v1alpha3_AuthenticationSpec_To_kops_AuthenticationSpec(a.(*AuthenticationSpec), b.(*kops.AuthenticationSpec), scope)\n\t}); err != nil {\n\t\treturn err\n\t}\n\tif err := s.AddGeneratedConversionFunc((*kops.AuthenticationSpec)(nil), (*AuthenticationSpec)(nil), func(a, b interface{}, scope conversion.Scope) error {\n\t\treturn Convert_kops_AuthenticationSpec_To_v1alpha3_AuthenticationSpec(a.(*kops.AuthenticationSpec), b.(*AuthenticationSpec), scope)\n\t}); err != nil {\n\t\treturn err\n\t}\n\tif err := s.AddGeneratedConversionFunc((*AuthorizationSpec)(nil), (*kops.AuthorizationSpec)(nil), func(a, b interface{}, scope conversion.Scope) error {\n\t\treturn Convert_v1alpha3_AuthorizationSpec_To_kops_AuthorizationSpec(a.(*AuthorizationSpec), b.(*kops.AuthorizationSpec), scope)\n\t}); err != nil {\n\t\treturn err\n\t}\n\tif err := s.AddGeneratedConversionFunc((*kops.AuthorizationSpec)(nil), (*AuthorizationSpec)(nil), func(a, b interface{}, scope conversion.Scope) error {\n\t\treturn Convert_kops_AuthorizationSpec_To_v1alpha3_AuthorizationSpec(a.(*kops.AuthorizationSpec), b.(*AuthorizationSpec), scope)\n\t}); err != nil {\n\t\treturn err\n\t}\n\tif err := s.AddGeneratedConversionFunc((*AzureSpec)(nil), (*kops.AzureSpec)(nil), func(a, b interface{}, scope conversion.Scope) error {\n\t\treturn Convert_v1alpha3_AzureSpec_To_kops_AzureSpec(a.(*AzureSpec), b.(*kops.AzureSpec), scope)\n\t}); err != nil {\n\t\treturn err\n\t}\n\tif err := s.AddGeneratedConversionFunc((*kops.AzureSpec)(nil), (*AzureSpec)(nil), func(a, b interface{}, scope conversion.Scope) error {\n\t\treturn Convert_kops_AzureSpec_To_v1alpha3_AzureSpec(a.(*kops.AzureSpec), b.(*AzureSpec), scope)\n\t}); err != nil {\n\t\treturn err\n\t}\n\tif err := s.AddGeneratedConversionFunc((*BastionLoadBalancerSpec)(nil), (*kops.BastionLoadBalancerSpec)(nil), func(a, b interface{}, scope conversion.Scope) error {\n\t\treturn Convert_v1alpha3_BastionLoadBalancerSpec_To_kops_BastionLoadBalancerSpec(a.(*BastionLoadBalancerSpec), b.(*kops.BastionLoadBalancerSpec), scope)\n\t}); err != nil {\n\t\treturn err\n\t}\n\tif err := s.AddGeneratedConversionFunc((*kops.BastionLoadBalancerSpec)(nil), (*BastionLoadBalancerSpec)(nil), func(a, b interface{}, scope conversion.Scope) error {\n\t\treturn Convert_kops_BastionLoadBalancerSpec_To_v1alpha3_BastionLoadBalancerSpec(a.(*kops.BastionLoadBalancerSpec), b.(*BastionLoadBalancerSpec), scope)\n\t}); err != nil {\n\t\treturn err\n\t}\n\tif err := s.AddGeneratedConversionFunc((*BastionSpec)(nil), (*kops.BastionSpec)(nil), func(a, b interface{}, scope conversion.Scope) error {\n\t\treturn Convert_v1alpha3_BastionSpec_To_kops_BastionSpec(a.(*BastionSpec), b.(*kops.BastionSpec), scope)\n\t}); err != nil {\n\t\treturn err\n\t}\n\tif err := s.AddGeneratedConversionFunc((*kops.BastionSpec)(nil), (*BastionSpec)(nil), func(a, b interface{}, scope conversion.Scope) error {\n\t\treturn Convert_kops_BastionSpec_To_v1alpha3_BastionSpec(a.(*kops.BastionSpec), b.(*BastionSpec), scope)\n\t}); err != nil {\n\t\treturn err\n\t}\n\tif err := s.AddGeneratedConversionFunc((*CNINetworkingSpec)(nil), (*kops.CNINetworkingSpec)(nil), func(a, b interface{}, scope conversion.Scope) error {\n\t\treturn Convert_v1alpha3_CNINetworkingSpec_To_kops_CNINetworkingSpec(a.(*CNINetworkingSpec), b.(*kops.CNINetworkingSpec), scope)\n\t}); err != nil {\n\t\treturn err\n\t}\n\tif err := s.AddGeneratedConversionFunc((*kops.CNINetworkingSpec)(nil), (*CNINetworkingSpec)(nil), func(a, b interface{}, scope conversion.Scope) error {\n\t\treturn Convert_kops_CNINetworkingSpec_To_v1alpha3_CNINetworkingSpec(a.(*kops.CNINetworkingSpec), b.(*CNINetworkingSpec), scope)\n\t}); err != nil {\n\t\treturn err\n\t}\n\tif err := s.AddGeneratedConversionFunc((*CalicoNetworkingSpec)(nil), (*kops.CalicoNetworkingSpec)(nil), func(a, b interface{}, scope conversion.Scope) error {\n\t\treturn Convert_v1alpha3_CalicoNetworkingSpec_To_kops_CalicoNetworkingSpec(a.(*CalicoNetworkingSpec), b.(*kops.CalicoNetworkingSpec), scope)\n\t}); err != nil {\n\t\treturn err\n\t}\n\tif err := s.AddGeneratedConversionFunc((*kops.CalicoNetworkingSpec)(nil), (*CalicoNetworkingSpec)(nil), func(a, b interface{}, scope conversion.Scope) error {\n\t\treturn Convert_kops_CalicoNetworkingSpec_To_v1alpha3_CalicoNetworkingSpec(a.(*kops.CalicoNetworkingSpec), b.(*CalicoNetworkingSpec), scope)\n\t}); err != nil {\n\t\treturn err\n\t}\n\tif err := s.AddGeneratedConversionFunc((*CanalNetworkingSpec)(nil), (*kops.CanalNetworkingSpec)(nil), func(a, b interface{}, scope conversion.Scope) error {\n\t\treturn Convert_v1alpha3_CanalNetworkingSpec_To_kops_CanalNetworkingSpec(a.(*CanalNetworkingSpec), b.(*kops.CanalNetworkingSpec), scope)\n\t}); err != nil {\n\t\treturn err\n\t}\n\tif err := s.AddGeneratedConversionFunc((*kops.CanalNetworkingSpec)(nil), (*CanalNetworkingSpec)(nil), func(a, b interface{}, scope conversion.Scope) error {\n\t\treturn Convert_kops_CanalNetworkingSpec_To_v1alpha3_CanalNetworkingSpec(a.(*kops.CanalNetworkingSpec), b.(*CanalNetworkingSpec), scope)\n\t}); err != nil {\n\t\treturn err\n\t}\n\tif err := s.AddGeneratedConversionFunc((*CertManagerConfig)(nil), (*kops.CertManagerConfig)(nil), func(a, b interface{}, scope conversion.Scope) error {\n\t\treturn Convert_v1alpha3_CertManagerConfig_To_kops_CertManagerConfig(a.(*CertManagerConfig), b.(*kops.CertManagerConfig), scope)\n\t}); err != nil {\n\t\treturn err\n\t}\n\tif err := s.AddGeneratedConversionFunc((*kops.CertManagerConfig)(nil), (*CertManagerConfig)(nil), func(a, b interface{}, scope conversion.Scope) error {\n\t\treturn Convert_kops_CertManagerConfig_To_v1alpha3_CertManagerConfig(a.(*kops.CertManagerConfig), b.(*CertManagerConfig), scope)\n\t}); err != nil {\n\t\treturn err\n\t}\n\tif err := s.AddGeneratedConversionFunc((*CiliumNetworkingSpec)(nil), (*kops.CiliumNetworkingSpec)(nil), func(a, b interface{}, scope conversion.Scope) error {\n\t\treturn Convert_v1alpha3_CiliumNetworkingSpec_To_kops_CiliumNetworkingSpec(a.(*CiliumNetworkingSpec), b.(*kops.CiliumNetworkingSpec), scope)\n\t}); err != nil {\n\t\treturn err\n\t}\n\tif err := s.AddGeneratedConversionFunc((*kops.CiliumNetworkingSpec)(nil), (*CiliumNetworkingSpec)(nil), func(a, b interface{}, scope conversion.Scope) error {\n\t\treturn Convert_kops_CiliumNetworkingSpec_To_v1alpha3_CiliumNetworkingSpec(a.(*kops.CiliumNetworkingSpec), b.(*CiliumNetworkingSpec), scope)\n\t}); err != nil {\n\t\treturn err\n\t}\n\tif err := s.AddGeneratedConversionFunc((*CloudConfiguration)(nil), (*kops.CloudConfiguration)(nil), func(a, b interface{}, scope conversion.Scope) error {\n\t\treturn Convert_v1alpha3_CloudConfiguration_To_kops_CloudConfiguration(a.(*CloudConfiguration), b.(*kops.CloudConfiguration), scope)\n\t}); err != nil {\n\t\treturn err\n\t}\n\tif err := s.AddGeneratedConversionFunc((*kops.CloudConfiguration)(nil), (*CloudConfiguration)(nil), func(a, b interface{}, scope conversion.Scope) error {\n\t\treturn Convert_kops_CloudConfiguration_To_v1alpha3_CloudConfiguration(a.(*kops.CloudConfiguration), b.(*CloudConfiguration), scope)\n\t}); err != nil {\n\t\treturn err\n\t}\n\tif err := s.AddGeneratedConversionFunc((*CloudControllerManagerConfig)(nil), (*kops.CloudControllerManagerConfig)(nil), func(a, b interface{}, scope conversion.Scope) error {\n\t\treturn Convert_v1alpha3_CloudControllerManagerConfig_To_kops_CloudControllerManagerConfig(a.(*CloudControllerManagerConfig), b.(*kops.CloudControllerManagerConfig), scope)\n\t}); err != nil {\n\t\treturn err\n\t}\n\tif err := s.AddGeneratedConversionFunc((*kops.CloudControllerManagerConfig)(nil), (*CloudControllerManagerConfig)(nil), func(a, b interface{}, scope conversion.Scope) error {\n\t\treturn Convert_kops_CloudControllerManagerConfig_To_v1alpha3_CloudControllerManagerConfig(a.(*kops.CloudControllerManagerConfig), b.(*CloudControllerManagerConfig), scope)\n\t}); err != nil {\n\t\treturn err\n\t}\n\tif err := s.AddGeneratedConversionFunc((*CloudProviderSpec)(nil), (*kops.CloudProviderSpec)(nil), func(a, b interface{}, scope conversion.Scope) error {\n\t\treturn Convert_v1alpha3_CloudProviderSpec_To_kops_CloudProviderSpec(a.(*CloudProviderSpec), b.(*kops.CloudProviderSpec), scope)\n\t}); err != nil {\n\t\treturn err\n\t}\n\tif err := s.AddGeneratedConversionFunc((*kops.CloudProviderSpec)(nil), (*CloudProviderSpec)(nil), func(a, b interface{}, scope conversion.Scope) error {\n\t\treturn Convert_kops_CloudProviderSpec_To_v1alpha3_CloudProviderSpec(a.(*kops.CloudProviderSpec), b.(*CloudProviderSpec), scope)\n\t}); err != nil {\n\t\treturn err\n\t}\n\tif err := s.AddGeneratedConversionFunc((*Cluster)(nil), (*kops.Cluster)(nil), func(a, b interface{}, scope conversion.Scope) error {\n\t\treturn Convert_v1alpha3_Cluster_To_kops_Cluster(a.(*Cluster), b.(*kops.Cluster), scope)\n\t}); err != nil {\n\t\treturn err\n\t}\n\tif err := s.AddGeneratedConversionFunc((*kops.Cluster)(nil), (*Cluster)(nil), func(a, b interface{}, scope conversion.Scope) error {\n\t\treturn Convert_kops_Cluster_To_v1alpha3_Cluster(a.(*kops.Cluster), b.(*Cluster), scope)\n\t}); err != nil {\n\t\treturn err\n\t}\n\tif err := s.AddGeneratedConversionFunc((*ClusterAutoscalerConfig)(nil), (*kops.ClusterAutoscalerConfig)(nil), func(a, b interface{}, scope conversion.Scope) error {\n\t\treturn Convert_v1alpha3_ClusterAutoscalerConfig_To_kops_ClusterAutoscalerConfig(a.(*ClusterAutoscalerConfig), b.(*kops.ClusterAutoscalerConfig), scope)\n\t}); err != nil {\n\t\treturn err\n\t}\n\tif err := s.AddGeneratedConversionFunc((*kops.ClusterAutoscalerConfig)(nil), (*ClusterAutoscalerConfig)(nil), func(a, b interface{}, scope conversion.Scope) error {\n\t\treturn Convert_kops_ClusterAutoscalerConfig_To_v1alpha3_ClusterAutoscalerConfig(a.(*kops.ClusterAutoscalerConfig), b.(*ClusterAutoscalerConfig), scope)\n\t}); err != nil {\n\t\treturn err\n\t}\n\tif err := s.AddGeneratedConversionFunc((*ClusterList)(nil), (*kops.ClusterList)(nil), func(a, b interface{}, scope conversion.Scope) error {\n\t\treturn Convert_v1alpha3_ClusterList_To_kops_ClusterList(a.(*ClusterList), b.(*kops.ClusterList), scope)\n\t}); err != nil {\n\t\treturn err\n\t}\n\tif err := s.AddGeneratedConversionFunc((*kops.ClusterList)(nil), (*ClusterList)(nil), func(a, b interface{}, scope conversion.Scope) error {\n\t\treturn Convert_kops_ClusterList_To_v1alpha3_ClusterList(a.(*kops.ClusterList), b.(*ClusterList), scope)\n\t}); err != nil {\n\t\treturn err\n\t}\n\tif err := s.AddGeneratedConversionFunc((*ClusterSpec)(nil), (*kops.ClusterSpec)(nil), func(a, b interface{}, scope conversion.Scope) error {\n\t\treturn Convert_v1alpha3_ClusterSpec_To_kops_ClusterSpec(a.(*ClusterSpec), b.(*kops.ClusterSpec), scope)\n\t}); err != nil {\n\t\treturn err\n\t}\n\tif err := s.AddGeneratedConversionFunc((*kops.ClusterSpec)(nil), (*ClusterSpec)(nil), func(a, b interface{}, scope conversion.Scope) error {\n\t\treturn Convert_kops_ClusterSpec_To_v1alpha3_ClusterSpec(a.(*kops.ClusterSpec), b.(*ClusterSpec), scope)\n\t}); err != nil {\n\t\treturn err\n\t}\n\tif err := s.AddGeneratedConversionFunc((*ClusterSubnetSpec)(nil), (*kops.ClusterSubnetSpec)(nil), func(a, b interface{}, scope conversion.Scope) error {\n\t\treturn Convert_v1alpha3_ClusterSubnetSpec_To_kops_ClusterSubnetSpec(a.(*ClusterSubnetSpec), b.(*kops.ClusterSubnetSpec), scope)\n\t}); err != nil {\n\t\treturn err\n\t}\n\tif err := s.AddGeneratedConversionFunc((*kops.ClusterSubnetSpec)(nil), (*ClusterSubnetSpec)(nil), func(a, b interface{}, scope conversion.Scope) error {\n\t\treturn Convert_kops_ClusterSubnetSpec_To_v1alpha3_ClusterSubnetSpec(a.(*kops.ClusterSubnetSpec), b.(*ClusterSubnetSpec), scope)\n\t}); err != nil {\n\t\treturn err\n\t}\n\tif err := s.AddGeneratedConversionFunc((*ConfigStoreSpec)(nil), (*kops.ConfigStoreSpec)(nil), func(a, b interface{}, scope conversion.Scope) error {\n\t\treturn Convert_v1alpha3_ConfigStoreSpec_To_kops_ConfigStoreSpec(a.(*ConfigStoreSpec), b.(*kops.ConfigStoreSpec), scope)\n\t}); err != nil {\n\t\treturn err\n\t}\n\tif err := s.AddGeneratedConversionFunc((*kops.ConfigStoreSpec)(nil), (*ConfigStoreSpec)(nil), func(a, b interface{}, scope conversion.Scope) error {\n\t\treturn Convert_kops_ConfigStoreSpec_To_v1alpha3_ConfigStoreSpec(a.(*kops.ConfigStoreSpec), b.(*ConfigStoreSpec), scope)\n\t}); err != nil {\n\t\treturn err\n\t}\n\tif err := s.AddGeneratedConversionFunc((*ContainerdConfig)(nil), (*kops.ContainerdConfig)(nil), func(a, b interface{}, scope conversion.Scope) error {\n\t\treturn Convert_v1alpha3_ContainerdConfig_To_kops_ContainerdConfig(a.(*ContainerdConfig), b.(*kops.ContainerdConfig), scope)\n\t}); err != nil {\n\t\treturn err\n\t}\n\tif err := s.AddGeneratedConversionFunc((*kops.ContainerdConfig)(nil), (*ContainerdConfig)(nil), func(a, b interface{}, scope conversion.Scope) error {\n\t\treturn Convert_kops_ContainerdConfig_To_v1alpha3_ContainerdConfig(a.(*kops.ContainerdConfig), b.(*ContainerdConfig), scope)\n\t}); err != nil {\n\t\treturn err\n\t}\n\tif err := s.AddGeneratedConversionFunc((*DCGMExporterConfig)(nil), (*kops.DCGMExporterConfig)(nil), func(a, b interface{}, scope conversion.Scope) error {\n\t\treturn Convert_v1alpha3_DCGMExporterConfig_To_kops_DCGMExporterConfig(a.(*DCGMExporterConfig), b.(*kops.DCGMExporterConfig), scope)\n\t}); err != nil {\n\t\treturn err\n\t}\n\tif err := s.AddGeneratedConversionFunc((*kops.DCGMExporterConfig)(nil), (*DCGMExporterConfig)(nil), func(a, b interface{}, scope conversion.Scope) error {\n\t\treturn Convert_kops_DCGMExporterConfig_To_v1alpha3_DCGMExporterConfig(a.(*kops.DCGMExporterConfig), b.(*DCGMExporterConfig), scope)\n\t}); err != nil {\n\t\treturn err\n\t}\n\tif err := s.AddGeneratedConversionFunc((*DNSAccessSpec)(nil), (*kops.DNSAccessSpec)(nil), func(a, b interface{}, scope conversion.Scope) error {\n\t\treturn Convert_v1alpha3_DNSAccessSpec_To_kops_DNSAccessSpec(a.(*DNSAccessSpec), b.(*kops.DNSAccessSpec), scope)\n\t}); err != nil {\n\t\treturn err\n\t}\n\tif err := s.AddGeneratedConversionFunc((*kops.DNSAccessSpec)(nil), (*DNSAccessSpec)(nil), func(a, b interface{}, scope conversion.Scope) error {\n\t\treturn Convert_kops_DNSAccessSpec_To_v1alpha3_DNSAccessSpec(a.(*kops.DNSAccessSpec), b.(*DNSAccessSpec), scope)\n\t}); err != nil {\n\t\treturn err\n\t}\n\tif err := s.AddGeneratedConversionFunc((*DNSControllerGossipConfig)(nil), (*kops.DNSControllerGossipConfig)(nil), func(a, b interface{}, scope conversion.Scope) error {\n\t\treturn Convert_v1alpha3_DNSControllerGossipConfig_To_kops_DNSControllerGossipConfig(a.(*DNSControllerGossipConfig), b.(*kops.DNSControllerGossipConfig), scope)\n\t}); err != nil {\n\t\treturn err\n\t}\n\tif err := s.AddGeneratedConversionFunc((*kops.DNSControllerGossipConfig)(nil), (*DNSControllerGossipConfig)(nil), func(a, b interface{}, scope conversion.Scope) error {\n\t\treturn Convert_kops_DNSControllerGossipConfig_To_v1alpha3_DNSControllerGossipConfig(a.(*kops.DNSControllerGossipConfig), b.(*DNSControllerGossipConfig), scope)\n\t}); err != nil {\n\t\treturn err\n\t}\n\tif err := s.AddGeneratedConversionFunc((*DNSControllerGossipConfigSecondary)(nil), (*kops.DNSControllerGossipConfigSecondary)(nil), func(a, b interface{}, scope conversion.Scope) error {\n\t\treturn Convert_v1alpha3_DNSControllerGossipConfigSecondary_To_kops_DNSControllerGossipConfigSecondary(a.(*DNSControllerGossipConfigSecondary), b.(*kops.DNSControllerGossipConfigSecondary), scope)\n\t}); err != nil {\n\t\treturn err\n\t}\n\tif err := s.AddGeneratedConversionFunc((*kops.DNSControllerGossipConfigSecondary)(nil), (*DNSControllerGossipConfigSecondary)(nil), func(a, b interface{}, scope conversion.Scope) error {\n\t\treturn Convert_kops_DNSControllerGossipConfigSecondary_To_v1alpha3_DNSControllerGossipConfigSecondary(a.(*kops.DNSControllerGossipConfigSecondary), b.(*DNSControllerGossipConfigSecondary), scope)\n\t}); err != nil {\n\t\treturn err\n\t}\n\tif err := s.AddGeneratedConversionFunc((*DOSpec)(nil), (*kops.DOSpec)(nil), func(a, b interface{}, scope conversion.Scope) error {\n\t\treturn Convert_v1alpha3_DOSpec_To_kops_DOSpec(a.(*DOSpec), b.(*kops.DOSpec), scope)\n\t}); err != nil {\n\t\treturn err\n\t}\n\tif err := s.AddGeneratedConversionFunc((*kops.DOSpec)(nil), (*DOSpec)(nil), func(a, b interface{}, scope conversion.Scope) error {\n\t\treturn Convert_kops_DOSpec_To_v1alpha3_DOSpec(a.(*kops.DOSpec), b.(*DOSpec), scope)\n\t}); err != nil {\n\t\treturn err\n\t}\n\tif err := s.AddGeneratedConversionFunc((*DockerConfig)(nil), (*kops.DockerConfig)(nil), func(a, b interface{}, scope conversion.Scope) error {\n\t\treturn Convert_v1alpha3_DockerConfig_To_kops_DockerConfig(a.(*DockerConfig), b.(*kops.DockerConfig), scope)\n\t}); err != nil {\n\t\treturn err\n\t}\n\tif err := s.AddGeneratedConversionFunc((*kops.DockerConfig)(nil), (*DockerConfig)(nil), func(a, b interface{}, scope conversion.Scope) error {\n\t\treturn Convert_kops_DockerConfig_To_v1alpha3_DockerConfig(a.(*kops.DockerConfig), b.(*DockerConfig), scope)\n\t}); err != nil {\n\t\treturn err\n\t}\n\tif err := s.AddGeneratedConversionFunc((*EBSCSIDriverSpec)(nil), (*kops.EBSCSIDriverSpec)(nil), func(a, b interface{}, scope conversion.Scope) error {\n\t\treturn Convert_v1alpha3_EBSCSIDriverSpec_To_kops_EBSCSIDriverSpec(a.(*EBSCSIDriverSpec), b.(*kops.EBSCSIDriverSpec), scope)\n\t}); err != nil {\n\t\treturn err\n\t}\n\tif err := s.AddGeneratedConversionFunc((*kops.EBSCSIDriverSpec)(nil), (*EBSCSIDriverSpec)(nil), func(a, b interface{}, scope conversion.Scope) error {\n\t\treturn Convert_kops_EBSCSIDriverSpec_To_v1alpha3_EBSCSIDriverSpec(a.(*kops.EBSCSIDriverSpec), b.(*EBSCSIDriverSpec), scope)\n\t}); err != nil {\n\t\treturn err\n\t}\n\tif err := s.AddGeneratedConversionFunc((*EgressProxySpec)(nil), (*kops.EgressProxySpec)(nil), func(a, b interface{}, scope conversion.Scope) error {\n\t\treturn Convert_v1alpha3_EgressProxySpec_To_kops_EgressProxySpec(a.(*EgressProxySpec), b.(*kops.EgressProxySpec), scope)\n\t}); err != nil {\n\t\treturn err\n\t}\n\tif err := s.AddGeneratedConversionFunc((*kops.EgressProxySpec)(nil), (*EgressProxySpec)(nil), func(a, b interface{}, scope conversion.Scope) error {\n\t\treturn Convert_kops_EgressProxySpec_To_v1alpha3_EgressProxySpec(a.(*kops.EgressProxySpec), b.(*EgressProxySpec), scope)\n\t}); err != nil {\n\t\treturn err\n\t}\n\tif err := s.AddGeneratedConversionFunc((*EnvVar)(nil), (*kops.EnvVar)(nil), func(a, b interface{}, scope conversion.Scope) error {\n\t\treturn Convert_v1alpha3_EnvVar_To_kops_EnvVar(a.(*EnvVar), b.(*kops.EnvVar), scope)\n\t}); err != nil {\n\t\treturn err\n\t}\n\tif err := s.AddGeneratedConversionFunc((*kops.EnvVar)(nil), (*EnvVar)(nil), func(a, b interface{}, scope conversion.Scope) error {\n\t\treturn Convert_kops_EnvVar_To_v1alpha3_EnvVar(a.(*kops.EnvVar), b.(*EnvVar), scope)\n\t}); err != nil {\n\t\treturn err\n\t}\n\tif err := s.AddGeneratedConversionFunc((*EtcdBackupSpec)(nil), (*kops.EtcdBackupSpec)(nil), func(a, b interface{}, scope conversion.Scope) error {\n\t\treturn Convert_v1alpha3_EtcdBackupSpec_To_kops_EtcdBackupSpec(a.(*EtcdBackupSpec), b.(*kops.EtcdBackupSpec), scope)\n\t}); err != nil {\n\t\treturn err\n\t}\n\tif err := s.AddGeneratedConversionFunc((*kops.EtcdBackupSpec)(nil), (*EtcdBackupSpec)(nil), func(a, b interface{}, scope conversion.Scope) error {\n\t\treturn Convert_kops_EtcdBackupSpec_To_v1alpha3_EtcdBackupSpec(a.(*kops.EtcdBackupSpec), b.(*EtcdBackupSpec), scope)\n\t}); err != nil {\n\t\treturn err\n\t}\n\tif err := s.AddGeneratedConversionFunc((*EtcdClusterSpec)(nil), (*kops.EtcdClusterSpec)(nil), func(a, b interface{}, scope conversion.Scope) error {\n\t\treturn Convert_v1alpha3_EtcdClusterSpec_To_kops_EtcdClusterSpec(a.(*EtcdClusterSpec), b.(*kops.EtcdClusterSpec), scope)\n\t}); err != nil {\n\t\treturn err\n\t}\n\tif err := s.AddGeneratedConversionFunc((*kops.EtcdClusterSpec)(nil), (*EtcdClusterSpec)(nil), func(a, b interface{}, scope conversion.Scope) error {\n\t\treturn Convert_kops_EtcdClusterSpec_To_v1alpha3_EtcdClusterSpec(a.(*kops.EtcdClusterSpec), b.(*EtcdClusterSpec), scope)\n\t}); err != nil {\n\t\treturn err\n\t}\n\tif err := s.AddGeneratedConversionFunc((*EtcdManagerSpec)(nil), (*kops.EtcdManagerSpec)(nil), func(a, b interface{}, scope conversion.Scope) error {\n\t\treturn Convert_v1alpha3_EtcdManagerSpec_To_kops_EtcdManagerSpec(a.(*EtcdManagerSpec), b.(*kops.EtcdManagerSpec), scope)\n\t}); err != nil {\n\t\treturn err\n\t}\n\tif err := s.AddGeneratedConversionFunc((*kops.EtcdManagerSpec)(nil), (*EtcdManagerSpec)(nil), func(a, b interface{}, scope conversion.Scope) error {\n\t\treturn Convert_kops_EtcdManagerSpec_To_v1alpha3_EtcdManagerSpec(a.(*kops.EtcdManagerSpec), b.(*EtcdManagerSpec), scope)\n\t}); err != nil {\n\t\treturn err\n\t}\n\tif err := s.AddGeneratedConversionFunc((*EtcdMemberSpec)(nil), (*kops.EtcdMemberSpec)(nil), func(a, b interface{}, scope conversion.Scope) error {\n\t\treturn Convert_v1alpha3_EtcdMemberSpec_To_kops_EtcdMemberSpec(a.(*EtcdMemberSpec), b.(*kops.EtcdMemberSpec), scope)\n\t}); err != nil {\n\t\treturn err\n\t}\n\tif err := s.AddGeneratedConversionFunc((*kops.EtcdMemberSpec)(nil), (*EtcdMemberSpec)(nil), func(a, b interface{}, scope conversion.Scope) error {\n\t\treturn Convert_kops_EtcdMemberSpec_To_v1alpha3_EtcdMemberSpec(a.(*kops.EtcdMemberSpec), b.(*EtcdMemberSpec), scope)\n\t}); err != nil {\n\t\treturn err\n\t}\n\tif err := s.AddGeneratedConversionFunc((*ExecContainerAction)(nil), (*kops.ExecContainerAction)(nil), func(a, b interface{}, scope conversion.Scope) error {\n\t\treturn Convert_v1alpha3_ExecContainerAction_To_kops_ExecContainerAction(a.(*ExecContainerAction), b.(*kops.ExecContainerAction), scope)\n\t}); err != nil {\n\t\treturn err\n\t}\n\tif err := s.AddGeneratedConversionFunc((*kops.ExecContainerAction)(nil), (*ExecContainerAction)(nil), func(a, b interface{}, scope conversion.Scope) error {\n\t\treturn Convert_kops_ExecContainerAction_To_v1alpha3_ExecContainerAction(a.(*kops.ExecContainerAction), b.(*ExecContainerAction), scope)\n\t}); err != nil {\n\t\treturn err\n\t}\n\tif err := s.AddGeneratedConversionFunc((*ExternalDNSConfig)(nil), (*kops.ExternalDNSConfig)(nil), func(a, b interface{}, scope conversion.Scope) error {\n\t\treturn Convert_v1alpha3_ExternalDNSConfig_To_kops_ExternalDNSConfig(a.(*ExternalDNSConfig), b.(*kops.ExternalDNSConfig), scope)\n\t}); err != nil {\n\t\treturn err\n\t}\n\tif err := s.AddGeneratedConversionFunc((*kops.ExternalDNSConfig)(nil), (*ExternalDNSConfig)(nil), func(a, b interface{}, scope conversion.Scope) error {\n\t\treturn Convert_kops_ExternalDNSConfig_To_v1alpha3_ExternalDNSConfig(a.(*kops.ExternalDNSConfig), b.(*ExternalDNSConfig), scope)\n\t}); err != nil {\n\t\treturn err\n\t}\n\tif err := s.AddGeneratedConversionFunc((*ExternalNetworkingSpec)(nil), (*kops.ExternalNetworkingSpec)(nil), func(a, b interface{}, scope conversion.Scope) error {\n\t\treturn Convert_v1alpha3_ExternalNetworkingSpec_To_kops_ExternalNetworkingSpec(a.(*ExternalNetworkingSpec), b.(*kops.ExternalNetworkingSpec), scope)\n\t}); err != nil {\n\t\treturn err\n\t}\n\tif err := s.AddGeneratedConversionFunc((*kops.ExternalNetworkingSpec)(nil), (*ExternalNetworkingSpec)(nil), func(a, b interface{}, scope conversion.Scope) error {\n\t\treturn Convert_kops_ExternalNetworkingSpec_To_v1alpha3_ExternalNetworkingSpec(a.(*kops.ExternalNetworkingSpec), b.(*ExternalNetworkingSpec), scope)\n\t}); err != nil {\n\t\treturn err\n\t}\n\tif err := s.AddGeneratedConversionFunc((*FileAssetSpec)(nil), (*kops.FileAssetSpec)(nil), func(a, b interface{}, scope conversion.Scope) error {\n\t\treturn Convert_v1alpha3_FileAssetSpec_To_kops_FileAssetSpec(a.(*FileAssetSpec), b.(*kops.FileAssetSpec), scope)\n\t}); err != nil {\n\t\treturn err\n\t}\n\tif err := s.AddGeneratedConversionFunc((*kops.FileAssetSpec)(nil), (*FileAssetSpec)(nil), func(a, b interface{}, scope conversion.Scope) error {\n\t\treturn Convert_kops_FileAssetSpec_To_v1alpha3_FileAssetSpec(a.(*kops.FileAssetSpec), b.(*FileAssetSpec), scope)\n\t}); err != nil {\n\t\treturn err\n\t}\n\tif err := s.AddGeneratedConversionFunc((*FlannelNetworkingSpec)(nil), (*kops.FlannelNetworkingSpec)(nil), func(a, b interface{}, scope conversion.Scope) error {\n\t\treturn Convert_v1alpha3_FlannelNetworkingSpec_To_kops_FlannelNetworkingSpec(a.(*FlannelNetworkingSpec), b.(*kops.FlannelNetworkingSpec), scope)\n\t}); err != nil {\n\t\treturn err\n\t}\n\tif err := s.AddGeneratedConversionFunc((*kops.FlannelNetworkingSpec)(nil), (*FlannelNetworkingSpec)(nil), func(a, b interface{}, scope conversion.Scope) error {\n\t\treturn Convert_kops_FlannelNetworkingSpec_To_v1alpha3_FlannelNetworkingSpec(a.(*kops.FlannelNetworkingSpec), b.(*FlannelNetworkingSpec), scope)\n\t}); err != nil {\n\t\treturn err\n\t}\n\tif err := s.AddGeneratedConversionFunc((*GCESpec)(nil), (*kops.GCESpec)(nil), func(a, b interface{}, scope conversion.Scope) error {\n\t\treturn Convert_v1alpha3_GCESpec_To_kops_GCESpec(a.(*GCESpec), b.(*kops.GCESpec), scope)\n\t}); err != nil {\n\t\treturn err\n\t}\n\tif err := s.AddGeneratedConversionFunc((*kops.GCESpec)(nil), (*GCESpec)(nil), func(a, b interface{}, scope conversion.Scope) error {\n\t\treturn Convert_kops_GCESpec_To_v1alpha3_GCESpec(a.(*kops.GCESpec), b.(*GCESpec), scope)\n\t}); err != nil {\n\t\treturn err\n\t}\n\tif err := s.AddGeneratedConversionFunc((*GCPNetworkingSpec)(nil), (*kops.GCPNetworkingSpec)(nil), func(a, b interface{}, scope conversion.Scope) error {\n\t\treturn Convert_v1alpha3_GCPNetworkingSpec_To_kops_GCPNetworkingSpec(a.(*GCPNetworkingSpec), b.(*kops.GCPNetworkingSpec), scope)\n\t}); err != nil {\n\t\treturn err\n\t}\n\tif err := s.AddGeneratedConversionFunc((*kops.GCPNetworkingSpec)(nil), (*GCPNetworkingSpec)(nil), func(a, b interface{}, scope conversion.Scope) error {\n\t\treturn Convert_kops_GCPNetworkingSpec_To_v1alpha3_GCPNetworkingSpec(a.(*kops.GCPNetworkingSpec), b.(*GCPNetworkingSpec), scope)\n\t}); err != nil {\n\t\treturn err\n\t}\n\tif err := s.AddGeneratedConversionFunc((*GossipConfig)(nil), (*kops.GossipConfig)(nil), func(a, b interface{}, scope conversion.Scope) error {\n\t\treturn Convert_v1alpha3_GossipConfig_To_kops_GossipConfig(a.(*GossipConfig), b.(*kops.GossipConfig), scope)\n\t}); err != nil {\n\t\treturn err\n\t}\n\tif err := s.AddGeneratedConversionFunc((*kops.GossipConfig)(nil), (*GossipConfig)(nil), func(a, b interface{}, scope conversion.Scope) error {\n\t\treturn Convert_kops_GossipConfig_To_v1alpha3_GossipConfig(a.(*kops.GossipConfig), b.(*GossipConfig), scope)\n\t}); err != nil {\n\t\treturn err\n\t}\n\tif err := s.AddGeneratedConversionFunc((*GossipConfigSecondary)(nil), (*kops.GossipConfigSecondary)(nil), func(a, b interface{}, scope conversion.Scope) error {\n\t\treturn Convert_v1alpha3_GossipConfigSecondary_To_kops_GossipConfigSecondary(a.(*GossipConfigSecondary), b.(*kops.GossipConfigSecondary), scope)\n\t}); err != nil {\n\t\treturn err\n\t}\n\tif err := s.AddGeneratedConversionFunc((*kops.GossipConfigSecondary)(nil), (*GossipConfigSecondary)(nil), func(a, b interface{}, scope conversion.Scope) error {\n\t\treturn Convert_kops_GossipConfigSecondary_To_v1alpha3_GossipConfigSecondary(a.(*kops.GossipConfigSecondary), b.(*GossipConfigSecondary), scope)\n\t}); err != nil {\n\t\treturn err\n\t}\n\tif err := s.AddGeneratedConversionFunc((*HTTPProxy)(nil), (*kops.HTTPProxy)(nil), func(a, b interface{}, scope conversion.Scope) error {\n\t\treturn Convert_v1alpha3_HTTPProxy_To_kops_HTTPProxy(a.(*HTTPProxy), b.(*kops.HTTPProxy), scope)\n\t}); err != nil {\n\t\treturn err\n\t}\n\tif err := s.AddGeneratedConversionFunc((*kops.HTTPProxy)(nil), (*HTTPProxy)(nil), func(a, b interface{}, scope conversion.Scope) error {\n\t\treturn Convert_kops_HTTPProxy_To_v1alpha3_HTTPProxy(a.(*kops.HTTPProxy), b.(*HTTPProxy), scope)\n\t}); err != nil {\n\t\treturn err\n\t}\n\tif err := s.AddGeneratedConversionFunc((*HetznerSpec)(nil), (*kops.HetznerSpec)(nil), func(a, b interface{}, scope conversion.Scope) error {\n\t\treturn Convert_v1alpha3_HetznerSpec_To_kops_HetznerSpec(a.(*HetznerSpec), b.(*kops.HetznerSpec), scope)\n\t}); err != nil {\n\t\treturn err\n\t}\n\tif err := s.AddGeneratedConversionFunc((*kops.HetznerSpec)(nil), (*HetznerSpec)(nil), func(a, b interface{}, scope conversion.Scope) error {\n\t\treturn Convert_kops_HetznerSpec_To_v1alpha3_HetznerSpec(a.(*kops.HetznerSpec), b.(*HetznerSpec), scope)\n\t}); err != nil {\n\t\treturn err\n\t}\n\tif err := s.AddGeneratedConversionFunc((*HookSpec)(nil), (*kops.HookSpec)(nil), func(a, b interface{}, scope conversion.Scope) error {\n\t\treturn Convert_v1alpha3_HookSpec_To_kops_HookSpec(a.(*HookSpec), b.(*kops.HookSpec), scope)\n\t}); err != nil {\n\t\treturn err\n\t}\n\tif err := s.AddGeneratedConversionFunc((*kops.HookSpec)(nil), (*HookSpec)(nil), func(a, b interface{}, scope conversion.Scope) error {\n\t\treturn Convert_kops_HookSpec_To_v1alpha3_HookSpec(a.(*kops.HookSpec), b.(*HookSpec), scope)\n\t}); err != nil {\n\t\treturn err\n\t}\n\tif err := s.AddGeneratedConversionFunc((*HubbleSpec)(nil), (*kops.HubbleSpec)(nil), func(a, b interface{}, scope conversion.Scope) error {\n\t\treturn Convert_v1alpha3_HubbleSpec_To_kops_HubbleSpec(a.(*HubbleSpec), b.(*kops.HubbleSpec), scope)\n\t}); err != nil {\n\t\treturn err\n\t}\n\tif err := s.AddGeneratedConversionFunc((*kops.HubbleSpec)(nil), (*HubbleSpec)(nil), func(a, b interface{}, scope conversion.Scope) error {\n\t\treturn Convert_kops_HubbleSpec_To_v1alpha3_HubbleSpec(a.(*kops.HubbleSpec), b.(*HubbleSpec), scope)\n\t}); err != nil {\n\t\treturn err\n\t}\n\tif err := s.AddGeneratedConversionFunc((*IAMProfileSpec)(nil), (*kops.IAMProfileSpec)(nil), func(a, b interface{}, scope conversion.Scope) error {\n\t\treturn Convert_v1alpha3_IAMProfileSpec_To_kops_IAMProfileSpec(a.(*IAMProfileSpec), b.(*kops.IAMProfileSpec), scope)\n\t}); err != nil {\n\t\treturn err\n\t}\n\tif err := s.AddGeneratedConversionFunc((*kops.IAMProfileSpec)(nil), (*IAMProfileSpec)(nil), func(a, b interface{}, scope conversion.Scope) error {\n\t\treturn Convert_kops_IAMProfileSpec_To_v1alpha3_IAMProfileSpec(a.(*kops.IAMProfileSpec), b.(*IAMProfileSpec), scope)\n\t}); err != nil {\n\t\treturn err\n\t}\n\tif err := s.AddGeneratedConversionFunc((*IAMSpec)(nil), (*kops.IAMSpec)(nil), func(a, b interface{}, scope conversion.Scope) error {\n\t\treturn Convert_v1alpha3_IAMSpec_To_kops_IAMSpec(a.(*IAMSpec), b.(*kops.IAMSpec), scope)\n\t}); err != nil {\n\t\treturn err\n\t}\n\tif err := s.AddGeneratedConversionFunc((*kops.IAMSpec)(nil), (*IAMSpec)(nil), func(a, b interface{}, scope conversion.Scope) error {\n\t\treturn Convert_kops_IAMSpec_To_v1alpha3_IAMSpec(a.(*kops.IAMSpec), b.(*IAMSpec), scope)\n\t}); err != nil {\n\t\treturn err\n\t}\n\tif err := s.AddGeneratedConversionFunc((*InstanceGroup)(nil), (*kops.InstanceGroup)(nil), func(a, b interface{}, scope conversion.Scope) error {\n\t\treturn Convert_v1alpha3_InstanceGroup_To_kops_InstanceGroup(a.(*InstanceGroup), b.(*kops.InstanceGroup), scope)\n\t}); err != nil {\n\t\treturn err\n\t}\n\tif err := s.AddGeneratedConversionFunc((*kops.InstanceGroup)(nil), (*InstanceGroup)(nil), func(a, b interface{}, scope conversion.Scope) error {\n\t\treturn Convert_kops_InstanceGroup_To_v1alpha3_InstanceGroup(a.(*kops.InstanceGroup), b.(*InstanceGroup), scope)\n\t}); err != nil {\n\t\treturn err\n\t}\n\tif err := s.AddGeneratedConversionFunc((*InstanceGroupList)(nil), (*kops.InstanceGroupList)(nil), func(a, b interface{}, scope conversion.Scope) error {\n\t\treturn Convert_v1alpha3_InstanceGroupList_To_kops_InstanceGroupList(a.(*InstanceGroupList), b.(*kops.InstanceGroupList), scope)\n\t}); err != nil {\n\t\treturn err\n\t}\n\tif err := s.AddGeneratedConversionFunc((*kops.InstanceGroupList)(nil), (*InstanceGroupList)(nil), func(a, b interface{}, scope conversion.Scope) error {\n\t\treturn Convert_kops_InstanceGroupList_To_v1alpha3_InstanceGroupList(a.(*kops.InstanceGroupList), b.(*InstanceGroupList), scope)\n\t}); err != nil {\n\t\treturn err\n\t}\n\tif err := s.AddGeneratedConversionFunc((*InstanceGroupSpec)(nil), (*kops.InstanceGroupSpec)(nil), func(a, b interface{}, scope conversion.Scope) error {\n\t\treturn Convert_v1alpha3_InstanceGroupSpec_To_kops_InstanceGroupSpec(a.(*InstanceGroupSpec), b.(*kops.InstanceGroupSpec), scope)\n\t}); err != nil {\n\t\treturn err\n\t}\n\tif err := s.AddGeneratedConversionFunc((*kops.InstanceGroupSpec)(nil), (*InstanceGroupSpec)(nil), func(a, b interface{}, scope conversion.Scope) error {\n\t\treturn Convert_kops_InstanceGroupSpec_To_v1alpha3_InstanceGroupSpec(a.(*kops.InstanceGroupSpec), b.(*InstanceGroupSpec), scope)\n\t}); err != nil {\n\t\treturn err\n\t}\n\tif err := s.AddGeneratedConversionFunc((*InstanceMetadataOptions)(nil), (*kops.InstanceMetadataOptions)(nil), func(a, b interface{}, scope conversion.Scope) error {\n\t\treturn Convert_v1alpha3_InstanceMetadataOptions_To_kops_InstanceMetadataOptions(a.(*InstanceMetadataOptions), b.(*kops.InstanceMetadataOptions), scope)\n\t}); err != nil {\n\t\treturn err\n\t}\n\tif err := s.AddGeneratedConversionFunc((*kops.InstanceMetadataOptions)(nil), (*InstanceMetadataOptions)(nil), func(a, b interface{}, scope conversion.Scope) error {\n\t\treturn Convert_kops_InstanceMetadataOptions_To_v1alpha3_InstanceMetadataOptions(a.(*kops.InstanceMetadataOptions), b.(*InstanceMetadataOptions), scope)\n\t}); err != nil {\n\t\treturn err\n\t}\n\tif err := s.AddGeneratedConversionFunc((*InstanceRequirementsSpec)(nil), (*kops.InstanceRequirementsSpec)(nil), func(a, b interface{}, scope conversion.Scope) error {\n\t\treturn Convert_v1alpha3_InstanceRequirementsSpec_To_kops_InstanceRequirementsSpec(a.(*InstanceRequirementsSpec), b.(*kops.InstanceRequirementsSpec), scope)\n\t}); err != nil {\n\t\treturn err\n\t}\n\tif err := s.AddGeneratedConversionFunc((*kops.InstanceRequirementsSpec)(nil), (*InstanceRequirementsSpec)(nil), func(a, b interface{}, scope conversion.Scope) error {\n\t\treturn Convert_kops_InstanceRequirementsSpec_To_v1alpha3_InstanceRequirementsSpec(a.(*kops.InstanceRequirementsSpec), b.(*InstanceRequirementsSpec), scope)\n\t}); err != nil {\n\t\treturn err\n\t}\n\tif err := s.AddGeneratedConversionFunc((*InstanceRootVolumeSpec)(nil), (*kops.InstanceRootVolumeSpec)(nil), func(a, b interface{}, scope conversion.Scope) error {\n\t\treturn Convert_v1alpha3_InstanceRootVolumeSpec_To_kops_InstanceRootVolumeSpec(a.(*InstanceRootVolumeSpec), b.(*kops.InstanceRootVolumeSpec), scope)\n\t}); err != nil {\n\t\treturn err\n\t}\n\tif err := s.AddGeneratedConversionFunc((*kops.InstanceRootVolumeSpec)(nil), (*InstanceRootVolumeSpec)(nil), func(a, b interface{}, scope conversion.Scope) error {\n\t\treturn Convert_kops_InstanceRootVolumeSpec_To_v1alpha3_InstanceRootVolumeSpec(a.(*kops.InstanceRootVolumeSpec), b.(*InstanceRootVolumeSpec), scope)\n\t}); err != nil {\n\t\treturn err\n\t}\n\tif err := s.AddGeneratedConversionFunc((*KarpenterConfig)(nil), (*kops.KarpenterConfig)(nil), func(a, b interface{}, scope conversion.Scope) error {\n\t\treturn Convert_v1alpha3_KarpenterConfig_To_kops_KarpenterConfig(a.(*KarpenterConfig), b.(*kops.KarpenterConfig), scope)\n\t}); err != nil {\n\t\treturn err\n\t}\n\tif err := s.AddGeneratedConversionFunc((*kops.KarpenterConfig)(nil), (*KarpenterConfig)(nil), func(a, b interface{}, scope conversion.Scope) error {\n\t\treturn Convert_kops_KarpenterConfig_To_v1alpha3_KarpenterConfig(a.(*kops.KarpenterConfig), b.(*KarpenterConfig), scope)\n\t}); err != nil {\n\t\treturn err\n\t}\n\tif err := s.AddGeneratedConversionFunc((*Keyset)(nil), (*kops.Keyset)(nil), func(a, b interface{}, scope conversion.Scope) error {\n\t\treturn Convert_v1alpha3_Keyset_To_kops_Keyset(a.(*Keyset), b.(*kops.Keyset), scope)\n\t}); err != nil {\n\t\treturn err\n\t}\n\tif err := s.AddGeneratedConversionFunc((*kops.Keyset)(nil), (*Keyset)(nil), func(a, b interface{}, scope conversion.Scope) error {\n\t\treturn Convert_kops_Keyset_To_v1alpha3_Keyset(a.(*kops.Keyset), b.(*Keyset), scope)\n\t}); err != nil {\n\t\treturn err\n\t}\n\tif err := s.AddGeneratedConversionFunc((*KeysetItem)(nil), (*kops.KeysetItem)(nil), func(a, b interface{}, scope conversion.Scope) error {\n\t\treturn Convert_v1alpha3_KeysetItem_To_kops_KeysetItem(a.(*KeysetItem), b.(*kops.KeysetItem), scope)\n\t}); err != nil {\n\t\treturn err\n\t}\n\tif err := s.AddGeneratedConversionFunc((*kops.KeysetItem)(nil), (*KeysetItem)(nil), func(a, b interface{}, scope conversion.Scope) error {\n\t\treturn Convert_kops_KeysetItem_To_v1alpha3_KeysetItem(a.(*kops.KeysetItem), b.(*KeysetItem), scope)\n\t}); err != nil {\n\t\treturn err\n\t}\n\tif err := s.AddGeneratedConversionFunc((*KeysetList)(nil), (*kops.KeysetList)(nil), func(a, b interface{}, scope conversion.Scope) error {\n\t\treturn Convert_v1alpha3_KeysetList_To_kops_KeysetList(a.(*KeysetList), b.(*kops.KeysetList), scope)\n\t}); err != nil {\n\t\treturn err\n\t}\n\tif err := s.AddGeneratedConversionFunc((*kops.KeysetList)(nil), (*KeysetList)(nil), func(a, b interface{}, scope conversion.Scope) error {\n\t\treturn Convert_kops_KeysetList_To_v1alpha3_KeysetList(a.(*kops.KeysetList), b.(*KeysetList), scope)\n\t}); err != nil {\n\t\treturn err\n\t}\n\tif err := s.AddGeneratedConversionFunc((*KeysetSpec)(nil), (*kops.KeysetSpec)(nil), func(a, b interface{}, scope conversion.Scope) error {\n\t\treturn Convert_v1alpha3_KeysetSpec_To_kops_KeysetSpec(a.(*KeysetSpec), b.(*kops.KeysetSpec), scope)\n\t}); err != nil {\n\t\treturn err\n\t}\n\tif err := s.AddGeneratedConversionFunc((*kops.KeysetSpec)(nil), (*KeysetSpec)(nil), func(a, b interface{}, scope conversion.Scope) error {\n\t\treturn Convert_kops_KeysetSpec_To_v1alpha3_KeysetSpec(a.(*kops.KeysetSpec), b.(*KeysetSpec), scope)\n\t}); err != nil {\n\t\treturn err\n\t}\n\tif err := s.AddGeneratedConversionFunc((*KopeioAuthenticationSpec)(nil), (*kops.KopeioAuthenticationSpec)(nil), func(a, b interface{}, scope conversion.Scope) error {\n\t\treturn Convert_v1alpha3_KopeioAuthenticationSpec_To_kops_KopeioAuthenticationSpec(a.(*KopeioAuthenticationSpec), b.(*kops.KopeioAuthenticationSpec), scope)\n\t}); err != nil {\n\t\treturn err\n\t}\n\tif err := s.AddGeneratedConversionFunc((*kops.KopeioAuthenticationSpec)(nil), (*KopeioAuthenticationSpec)(nil), func(a, b interface{}, scope conversion.Scope) error {\n\t\treturn Convert_kops_KopeioAuthenticationSpec_To_v1alpha3_KopeioAuthenticationSpec(a.(*kops.KopeioAuthenticationSpec), b.(*KopeioAuthenticationSpec), scope)\n\t}); err != nil {\n\t\treturn err\n\t}\n\tif err := s.AddGeneratedConversionFunc((*KopeioNetworkingSpec)(nil), (*kops.KopeioNetworkingSpec)(nil), func(a, b interface{}, scope conversion.Scope) error {\n\t\treturn Convert_v1alpha3_KopeioNetworkingSpec_To_kops_KopeioNetworkingSpec(a.(*KopeioNetworkingSpec), b.(*kops.KopeioNetworkingSpec), scope)\n\t}); err != nil {\n\t\treturn err\n\t}\n\tif err := s.AddGeneratedConversionFunc((*kops.KopeioNetworkingSpec)(nil), (*KopeioNetworkingSpec)(nil), func(a, b interface{}, scope conversion.Scope) error {\n\t\treturn Convert_kops_KopeioNetworkingSpec_To_v1alpha3_KopeioNetworkingSpec(a.(*kops.KopeioNetworkingSpec), b.(*KopeioNetworkingSpec), scope)\n\t}); err != nil {\n\t\treturn err\n\t}\n\tif err := s.AddGeneratedConversionFunc((*KubeAPIServerConfig)(nil), (*kops.KubeAPIServerConfig)(nil), func(a, b interface{}, scope conversion.Scope) error {\n\t\treturn Convert_v1alpha3_KubeAPIServerConfig_To_kops_KubeAPIServerConfig(a.(*KubeAPIServerConfig), b.(*kops.KubeAPIServerConfig), scope)\n\t}); err != nil {\n\t\treturn err\n\t}\n\tif err := s.AddGeneratedConversionFunc((*kops.KubeAPIServerConfig)(nil), (*KubeAPIServerConfig)(nil), func(a, b interface{}, scope conversion.Scope) error {\n\t\treturn Convert_kops_KubeAPIServerConfig_To_v1alpha3_KubeAPIServerConfig(a.(*kops.KubeAPIServerConfig), b.(*KubeAPIServerConfig), scope)\n\t}); err != nil {\n\t\treturn err\n\t}\n\tif err := s.AddGeneratedConversionFunc((*KubeControllerManagerConfig)(nil), (*kops.KubeControllerManagerConfig)(nil), func(a, b interface{}, scope conversion.Scope) error {\n\t\treturn Convert_v1alpha3_KubeControllerManagerConfig_To_kops_KubeControllerManagerConfig(a.(*KubeControllerManagerConfig), b.(*kops.KubeControllerManagerConfig), scope)\n\t}); err != nil {\n\t\treturn err\n\t}\n\tif err := s.AddGeneratedConversionFunc((*kops.KubeControllerManagerConfig)(nil), (*KubeControllerManagerConfig)(nil), func(a, b interface{}, scope conversion.Scope) error {\n\t\treturn Convert_kops_KubeControllerManagerConfig_To_v1alpha3_KubeControllerManagerConfig(a.(*kops.KubeControllerManagerConfig), b.(*KubeControllerManagerConfig), scope)\n\t}); err != nil {\n\t\treturn err\n\t}\n\tif err := s.AddGeneratedConversionFunc((*KubeDNSConfig)(nil), (*kops.KubeDNSConfig)(nil), func(a, b interface{}, scope conversion.Scope) error {\n\t\treturn Convert_v1alpha3_KubeDNSConfig_To_kops_KubeDNSConfig(a.(*KubeDNSConfig), b.(*kops.KubeDNSConfig), scope)\n\t}); err != nil {\n\t\treturn err\n\t}\n\tif err := s.AddGeneratedConversionFunc((*kops.KubeDNSConfig)(nil), (*KubeDNSConfig)(nil), func(a, b interface{}, scope conversion.Scope) error {\n\t\treturn Convert_kops_KubeDNSConfig_To_v1alpha3_KubeDNSConfig(a.(*kops.KubeDNSConfig), b.(*KubeDNSConfig), scope)\n\t}); err != nil {\n\t\treturn err\n\t}\n\tif err := s.AddGeneratedConversionFunc((*KubeProxyConfig)(nil), (*kops.KubeProxyConfig)(nil), func(a, b interface{}, scope conversion.Scope) error {\n\t\treturn Convert_v1alpha3_KubeProxyConfig_To_kops_KubeProxyConfig(a.(*KubeProxyConfig), b.(*kops.KubeProxyConfig), scope)\n\t}); err != nil {\n\t\treturn err\n\t}\n\tif err := s.AddGeneratedConversionFunc((*kops.KubeProxyConfig)(nil), (*KubeProxyConfig)(nil), func(a, b interface{}, scope conversion.Scope) error {\n\t\treturn Convert_kops_KubeProxyConfig_To_v1alpha3_KubeProxyConfig(a.(*kops.KubeProxyConfig), b.(*KubeProxyConfig), scope)\n\t}); err != nil {\n\t\treturn err\n\t}\n\tif err := s.AddGeneratedConversionFunc((*KubeSchedulerConfig)(nil), (*kops.KubeSchedulerConfig)(nil), func(a, b interface{}, scope conversion.Scope) error {\n\t\treturn Convert_v1alpha3_KubeSchedulerConfig_To_kops_KubeSchedulerConfig(a.(*KubeSchedulerConfig), b.(*kops.KubeSchedulerConfig), scope)\n\t}); err != nil {\n\t\treturn err\n\t}\n\tif err := s.AddGeneratedConversionFunc((*kops.KubeSchedulerConfig)(nil), (*KubeSchedulerConfig)(nil), func(a, b interface{}, scope conversion.Scope) error {\n\t\treturn Convert_kops_KubeSchedulerConfig_To_v1alpha3_KubeSchedulerConfig(a.(*kops.KubeSchedulerConfig), b.(*KubeSchedulerConfig), scope)\n\t}); err != nil {\n\t\treturn err\n\t}\n\tif err := s.AddGeneratedConversionFunc((*KubeletConfigSpec)(nil), (*kops.KubeletConfigSpec)(nil), func(a, b interface{}, scope conversion.Scope) error {\n\t\treturn Convert_v1alpha3_KubeletConfigSpec_To_kops_KubeletConfigSpec(a.(*KubeletConfigSpec), b.(*kops.KubeletConfigSpec), scope)\n\t}); err != nil {\n\t\treturn err\n\t}\n\tif err := s.AddGeneratedConversionFunc((*kops.KubeletConfigSpec)(nil), (*KubeletConfigSpec)(nil), func(a, b interface{}, scope conversion.Scope) error {\n\t\treturn Convert_kops_KubeletConfigSpec_To_v1alpha3_KubeletConfigSpec(a.(*kops.KubeletConfigSpec), b.(*KubeletConfigSpec), scope)\n\t}); err != nil {\n\t\treturn err\n\t}\n\tif err := s.AddGeneratedConversionFunc((*KubenetNetworkingSpec)(nil), (*kops.KubenetNetworkingSpec)(nil), func(a, b interface{}, scope conversion.Scope) error {\n\t\treturn Convert_v1alpha3_KubenetNetworkingSpec_To_kops_KubenetNetworkingSpec(a.(*KubenetNetworkingSpec), b.(*kops.KubenetNetworkingSpec), scope)\n\t}); err != nil {\n\t\treturn err\n\t}\n\tif err := s.AddGeneratedConversionFunc((*kops.KubenetNetworkingSpec)(nil), (*KubenetNetworkingSpec)(nil), func(a, b interface{}, scope conversion.Scope) error {\n\t\treturn Convert_kops_KubenetNetworkingSpec_To_v1alpha3_KubenetNetworkingSpec(a.(*kops.KubenetNetworkingSpec), b.(*KubenetNetworkingSpec), scope)\n\t}); err != nil {\n\t\treturn err\n\t}\n\tif err := s.AddGeneratedConversionFunc((*KuberouterNetworkingSpec)(nil), (*kops.KuberouterNetworkingSpec)(nil), func(a, b interface{}, scope conversion.Scope) error {\n\t\treturn Convert_v1alpha3_KuberouterNetworkingSpec_To_kops_KuberouterNetworkingSpec(a.(*KuberouterNetworkingSpec), b.(*kops.KuberouterNetworkingSpec), scope)\n\t}); err != nil {\n\t\treturn err\n\t}\n\tif err := s.AddGeneratedConversionFunc((*kops.KuberouterNetworkingSpec)(nil), (*KuberouterNetworkingSpec)(nil), func(a, b interface{}, scope conversion.Scope) error {\n\t\treturn Convert_kops_KuberouterNetworkingSpec_To_v1alpha3_KuberouterNetworkingSpec(a.(*kops.KuberouterNetworkingSpec), b.(*KuberouterNetworkingSpec), scope)\n\t}); err != nil {\n\t\treturn err\n\t}\n\tif err := s.AddGeneratedConversionFunc((*LeaderElectionConfiguration)(nil), (*kops.LeaderElectionConfiguration)(nil), func(a, b interface{}, scope conversion.Scope) error {\n\t\treturn Convert_v1alpha3_LeaderElectionConfiguration_To_kops_LeaderElectionConfiguration(a.(*LeaderElectionConfiguration), b.(*kops.LeaderElectionConfiguration), scope)\n\t}); err != nil {\n\t\treturn err\n\t}\n\tif err := s.AddGeneratedConversionFunc((*kops.LeaderElectionConfiguration)(nil), (*LeaderElectionConfiguration)(nil), func(a, b interface{}, scope conversion.Scope) error {\n\t\treturn Convert_kops_LeaderElectionConfiguration_To_v1alpha3_LeaderElectionConfiguration(a.(*kops.LeaderElectionConfiguration), b.(*LeaderElectionConfiguration), scope)\n\t}); err != nil {\n\t\treturn err\n\t}\n\tif err := s.AddGeneratedConversionFunc((*LoadBalancerAccessSpec)(nil), (*kops.LoadBalancerAccessSpec)(nil), func(a, b interface{}, scope conversion.Scope) error {\n\t\treturn Convert_v1alpha3_LoadBalancerAccessSpec_To_kops_LoadBalancerAccessSpec(a.(*LoadBalancerAccessSpec), b.(*kops.LoadBalancerAccessSpec), scope)\n\t}); err != nil {\n\t\treturn err\n\t}\n\tif err := s.AddGeneratedConversionFunc((*kops.LoadBalancerAccessSpec)(nil), (*LoadBalancerAccessSpec)(nil), func(a, b interface{}, scope conversion.Scope) error {\n\t\treturn Convert_kops_LoadBalancerAccessSpec_To_v1alpha3_LoadBalancerAccessSpec(a.(*kops.LoadBalancerAccessSpec), b.(*LoadBalancerAccessSpec), scope)\n\t}); err != nil {\n\t\treturn err\n\t}\n\tif err := s.AddGeneratedConversionFunc((*LoadBalancerControllerSpec)(nil), (*kops.LoadBalancerControllerSpec)(nil), func(a, b interface{}, scope conversion.Scope) error {\n\t\treturn Convert_v1alpha3_LoadBalancerControllerSpec_To_kops_LoadBalancerControllerSpec(a.(*LoadBalancerControllerSpec), b.(*kops.LoadBalancerControllerSpec), scope)\n\t}); err != nil {\n\t\treturn err\n\t}\n\tif err := s.AddGeneratedConversionFunc((*kops.LoadBalancerControllerSpec)(nil), (*LoadBalancerControllerSpec)(nil), func(a, b interface{}, scope conversion.Scope) error {\n\t\treturn Convert_kops_LoadBalancerControllerSpec_To_v1alpha3_LoadBalancerControllerSpec(a.(*kops.LoadBalancerControllerSpec), b.(*LoadBalancerControllerSpec), scope)\n\t}); err != nil {\n\t\treturn err\n\t}\n\tif err := s.AddGeneratedConversionFunc((*LoadBalancerSpec)(nil), (*kops.LoadBalancerSpec)(nil), func(a, b interface{}, scope conversion.Scope) error {\n\t\treturn Convert_v1alpha3_LoadBalancerSpec_To_kops_LoadBalancerSpec(a.(*LoadBalancerSpec), b.(*kops.LoadBalancerSpec), scope)\n\t}); err != nil {\n\t\treturn err\n\t}\n\tif err := s.AddGeneratedConversionFunc((*kops.LoadBalancerSpec)(nil), (*LoadBalancerSpec)(nil), func(a, b interface{}, scope conversion.Scope) error {\n\t\treturn Convert_kops_LoadBalancerSpec_To_v1alpha3_LoadBalancerSpec(a.(*kops.LoadBalancerSpec), b.(*LoadBalancerSpec), scope)\n\t}); err != nil {\n\t\treturn err\n\t}\n\tif err := s.AddGeneratedConversionFunc((*LoadBalancerSubnetSpec)(nil), (*kops.LoadBalancerSubnetSpec)(nil), func(a, b interface{}, scope conversion.Scope) error {\n\t\treturn Convert_v1alpha3_LoadBalancerSubnetSpec_To_kops_LoadBalancerSubnetSpec(a.(*LoadBalancerSubnetSpec), b.(*kops.LoadBalancerSubnetSpec), scope)\n\t}); err != nil {\n\t\treturn err\n\t}\n\tif err := s.AddGeneratedConversionFunc((*kops.LoadBalancerSubnetSpec)(nil), (*LoadBalancerSubnetSpec)(nil), func(a, b interface{}, scope conversion.Scope) error {\n\t\treturn Convert_kops_LoadBalancerSubnetSpec_To_v1alpha3_LoadBalancerSubnetSpec(a.(*kops.LoadBalancerSubnetSpec), b.(*LoadBalancerSubnetSpec), scope)\n\t}); err != nil {\n\t\treturn err\n\t}\n\tif err := s.AddGeneratedConversionFunc((*MetricsServerConfig)(nil), (*kops.MetricsServerConfig)(nil), func(a, b interface{}, scope conversion.Scope) error {\n\t\treturn Convert_v1alpha3_MetricsServerConfig_To_kops_MetricsServerConfig(a.(*MetricsServerConfig), b.(*kops.MetricsServerConfig), scope)\n\t}); err != nil {\n\t\treturn err\n\t}\n\tif err := s.AddGeneratedConversionFunc((*kops.MetricsServerConfig)(nil), (*MetricsServerConfig)(nil), func(a, b interface{}, scope conversion.Scope) error {\n\t\treturn Convert_kops_MetricsServerConfig_To_v1alpha3_MetricsServerConfig(a.(*kops.MetricsServerConfig), b.(*MetricsServerConfig), scope)\n\t}); err != nil {\n\t\treturn err\n\t}\n\tif err := s.AddGeneratedConversionFunc((*MinMaxSpec)(nil), (*kops.MinMaxSpec)(nil), func(a, b interface{}, scope conversion.Scope) error {\n\t\treturn Convert_v1alpha3_MinMaxSpec_To_kops_MinMaxSpec(a.(*MinMaxSpec), b.(*kops.MinMaxSpec), scope)\n\t}); err != nil {\n\t\treturn err\n\t}\n\tif err := s.AddGeneratedConversionFunc((*kops.MinMaxSpec)(nil), (*MinMaxSpec)(nil), func(a, b interface{}, scope conversion.Scope) error {\n\t\treturn Convert_kops_MinMaxSpec_To_v1alpha3_MinMaxSpec(a.(*kops.MinMaxSpec), b.(*MinMaxSpec), scope)\n\t}); err != nil {\n\t\treturn err\n\t}\n\tif err := s.AddGeneratedConversionFunc((*MixedInstancesPolicySpec)(nil), (*kops.MixedInstancesPolicySpec)(nil), func(a, b interface{}, scope conversion.Scope) error {\n\t\treturn Convert_v1alpha3_MixedInstancesPolicySpec_To_kops_MixedInstancesPolicySpec(a.(*MixedInstancesPolicySpec), b.(*kops.MixedInstancesPolicySpec), scope)\n\t}); err != nil {\n\t\treturn err\n\t}\n\tif err := s.AddGeneratedConversionFunc((*kops.MixedInstancesPolicySpec)(nil), (*MixedInstancesPolicySpec)(nil), func(a, b interface{}, scope conversion.Scope) error {\n\t\treturn Convert_kops_MixedInstancesPolicySpec_To_v1alpha3_MixedInstancesPolicySpec(a.(*kops.MixedInstancesPolicySpec), b.(*MixedInstancesPolicySpec), scope)\n\t}); err != nil {\n\t\treturn err\n\t}\n\tif err := s.AddGeneratedConversionFunc((*NTPConfig)(nil), (*kops.NTPConfig)(nil), func(a, b interface{}, scope conversion.Scope) error {\n\t\treturn Convert_v1alpha3_NTPConfig_To_kops_NTPConfig(a.(*NTPConfig), b.(*kops.NTPConfig), scope)\n\t}); err != nil {\n\t\treturn err\n\t}\n\tif err := s.AddGeneratedConversionFunc((*kops.NTPConfig)(nil), (*NTPConfig)(nil), func(a, b interface{}, scope conversion.Scope) error {\n\t\treturn Convert_kops_NTPConfig_To_v1alpha3_NTPConfig(a.(*kops.NTPConfig), b.(*NTPConfig), scope)\n\t}); err != nil {\n\t\treturn err\n\t}\n\tif err := s.AddGeneratedConversionFunc((*NetworkingSpec)(nil), (*kops.NetworkingSpec)(nil), func(a, b interface{}, scope conversion.Scope) error {\n\t\treturn Convert_v1alpha3_NetworkingSpec_To_kops_NetworkingSpec(a.(*NetworkingSpec), b.(*kops.NetworkingSpec), scope)\n\t}); err != nil {\n\t\treturn err\n\t}\n\tif err := s.AddGeneratedConversionFunc((*kops.NetworkingSpec)(nil), (*NetworkingSpec)(nil), func(a, b interface{}, scope conversion.Scope) error {\n\t\treturn Convert_kops_NetworkingSpec_To_v1alpha3_NetworkingSpec(a.(*kops.NetworkingSpec), b.(*NetworkingSpec), scope)\n\t}); err != nil {\n\t\treturn err\n\t}\n\tif err := s.AddGeneratedConversionFunc((*NodeLocalDNSConfig)(nil), (*kops.NodeLocalDNSConfig)(nil), func(a, b interface{}, scope conversion.Scope) error {\n\t\treturn Convert_v1alpha3_NodeLocalDNSConfig_To_kops_NodeLocalDNSConfig(a.(*NodeLocalDNSConfig), b.(*kops.NodeLocalDNSConfig), scope)\n\t}); err != nil {\n\t\treturn err\n\t}\n\tif err := s.AddGeneratedConversionFunc((*kops.NodeLocalDNSConfig)(nil), (*NodeLocalDNSConfig)(nil), func(a, b interface{}, scope conversion.Scope) error {\n\t\treturn Convert_kops_NodeLocalDNSConfig_To_v1alpha3_NodeLocalDNSConfig(a.(*kops.NodeLocalDNSConfig), b.(*NodeLocalDNSConfig), scope)\n\t}); err != nil {\n\t\treturn err\n\t}\n\tif err := s.AddGeneratedConversionFunc((*NodeProblemDetectorConfig)(nil), (*kops.NodeProblemDetectorConfig)(nil), func(a, b interface{}, scope conversion.Scope) error {\n\t\treturn Convert_v1alpha3_NodeProblemDetectorConfig_To_kops_NodeProblemDetectorConfig(a.(*NodeProblemDetectorConfig), b.(*kops.NodeProblemDetectorConfig), scope)\n\t}); err != nil {\n\t\treturn err\n\t}\n\tif err := s.AddGeneratedConversionFunc((*kops.NodeProblemDetectorConfig)(nil), (*NodeProblemDetectorConfig)(nil), func(a, b interface{}, scope conversion.Scope) error {\n\t\treturn Convert_kops_NodeProblemDetectorConfig_To_v1alpha3_NodeProblemDetectorConfig(a.(*kops.NodeProblemDetectorConfig), b.(*NodeProblemDetectorConfig), scope)\n\t}); err != nil {\n\t\treturn err\n\t}\n\tif err := s.AddGeneratedConversionFunc((*NodeTerminationHandlerSpec)(nil), (*kops.NodeTerminationHandlerSpec)(nil), func(a, b interface{}, scope conversion.Scope) error {\n\t\treturn Convert_v1alpha3_NodeTerminationHandlerSpec_To_kops_NodeTerminationHandlerSpec(a.(*NodeTerminationHandlerSpec), b.(*kops.NodeTerminationHandlerSpec), scope)\n\t}); err != nil {\n\t\treturn err\n\t}\n\tif err := s.AddGeneratedConversionFunc((*kops.NodeTerminationHandlerSpec)(nil), (*NodeTerminationHandlerSpec)(nil), func(a, b interface{}, scope conversion.Scope) error {\n\t\treturn Convert_kops_NodeTerminationHandlerSpec_To_v1alpha3_NodeTerminationHandlerSpec(a.(*kops.NodeTerminationHandlerSpec), b.(*NodeTerminationHandlerSpec), scope)\n\t}); err != nil {\n\t\treturn err\n\t}\n\tif err := s.AddGeneratedConversionFunc((*NvidiaGPUConfig)(nil), (*kops.NvidiaGPUConfig)(nil), func(a, b interface{}, scope conversion.Scope) error {\n\t\treturn Convert_v1alpha3_NvidiaGPUConfig_To_kops_NvidiaGPUConfig(a.(*NvidiaGPUConfig), b.(*kops.NvidiaGPUConfig), scope)\n\t}); err != nil {\n\t\treturn err\n\t}\n\tif err := s.AddGeneratedConversionFunc((*kops.NvidiaGPUConfig)(nil), (*NvidiaGPUConfig)(nil), func(a, b interface{}, scope conversion.Scope) error {\n\t\treturn Convert_kops_NvidiaGPUConfig_To_v1alpha3_NvidiaGPUConfig(a.(*kops.NvidiaGPUConfig), b.(*NvidiaGPUConfig), scope)\n\t}); err != nil {\n\t\treturn err\n\t}\n\tif err := s.AddGeneratedConversionFunc((*OIDCAuthenticationSpec)(nil), (*kops.OIDCAuthenticationSpec)(nil), func(a, b interface{}, scope conversion.Scope) error {\n\t\treturn Convert_v1alpha3_OIDCAuthenticationSpec_To_kops_OIDCAuthenticationSpec(a.(*OIDCAuthenticationSpec), b.(*kops.OIDCAuthenticationSpec), scope)\n\t}); err != nil {\n\t\treturn err\n\t}\n\tif err := s.AddGeneratedConversionFunc((*kops.OIDCAuthenticationSpec)(nil), (*OIDCAuthenticationSpec)(nil), func(a, b interface{}, scope conversion.Scope) error {\n\t\treturn Convert_kops_OIDCAuthenticationSpec_To_v1alpha3_OIDCAuthenticationSpec(a.(*kops.OIDCAuthenticationSpec), b.(*OIDCAuthenticationSpec), scope)\n\t}); err != nil {\n\t\treturn err\n\t}\n\tif err := s.AddGeneratedConversionFunc((*OpenstackBlockStorageConfig)(nil), (*kops.OpenstackBlockStorageConfig)(nil), func(a, b interface{}, scope conversion.Scope) error {\n\t\treturn Convert_v1alpha3_OpenstackBlockStorageConfig_To_kops_OpenstackBlockStorageConfig(a.(*OpenstackBlockStorageConfig), b.(*kops.OpenstackBlockStorageConfig), scope)\n\t}); err != nil {\n\t\treturn err\n\t}\n\tif err := s.AddGeneratedConversionFunc((*kops.OpenstackBlockStorageConfig)(nil), (*OpenstackBlockStorageConfig)(nil), func(a, b interface{}, scope conversion.Scope) error {\n\t\treturn Convert_kops_OpenstackBlockStorageConfig_To_v1alpha3_OpenstackBlockStorageConfig(a.(*kops.OpenstackBlockStorageConfig), b.(*OpenstackBlockStorageConfig), scope)\n\t}); err != nil {\n\t\treturn err\n\t}\n\tif err := s.AddGeneratedConversionFunc((*OpenstackLoadbalancerConfig)(nil), (*kops.OpenstackLoadbalancerConfig)(nil), func(a, b interface{}, scope conversion.Scope) error {\n\t\treturn Convert_v1alpha3_OpenstackLoadbalancerConfig_To_kops_OpenstackLoadbalancerConfig(a.(*OpenstackLoadbalancerConfig), b.(*kops.OpenstackLoadbalancerConfig), scope)\n\t}); err != nil {\n\t\treturn err\n\t}\n\tif err := s.AddGeneratedConversionFunc((*kops.OpenstackLoadbalancerConfig)(nil), (*OpenstackLoadbalancerConfig)(nil), func(a, b interface{}, scope conversion.Scope) error {\n\t\treturn Convert_kops_OpenstackLoadbalancerConfig_To_v1alpha3_OpenstackLoadbalancerConfig(a.(*kops.OpenstackLoadbalancerConfig), b.(*OpenstackLoadbalancerConfig), scope)\n\t}); err != nil {\n\t\treturn err\n\t}\n\tif err := s.AddGeneratedConversionFunc((*OpenstackMetadata)(nil), (*kops.OpenstackMetadata)(nil), func(a, b interface{}, scope conversion.Scope) error {\n\t\treturn Convert_v1alpha3_OpenstackMetadata_To_kops_OpenstackMetadata(a.(*OpenstackMetadata), b.(*kops.OpenstackMetadata), scope)\n\t}); err != nil {\n\t\treturn err\n\t}\n\tif err := s.AddGeneratedConversionFunc((*kops.OpenstackMetadata)(nil), (*OpenstackMetadata)(nil), func(a, b interface{}, scope conversion.Scope) error {\n\t\treturn Convert_kops_OpenstackMetadata_To_v1alpha3_OpenstackMetadata(a.(*kops.OpenstackMetadata), b.(*OpenstackMetadata), scope)\n\t}); err != nil {\n\t\treturn err\n\t}\n\tif err := s.AddGeneratedConversionFunc((*OpenstackMonitor)(nil), (*kops.OpenstackMonitor)(nil), func(a, b interface{}, scope conversion.Scope) error {\n\t\treturn Convert_v1alpha3_OpenstackMonitor_To_kops_OpenstackMonitor(a.(*OpenstackMonitor), b.(*kops.OpenstackMonitor), scope)\n\t}); err != nil {\n\t\treturn err\n\t}\n\tif err := s.AddGeneratedConversionFunc((*kops.OpenstackMonitor)(nil), (*OpenstackMonitor)(nil), func(a, b interface{}, scope conversion.Scope) error {\n\t\treturn Convert_kops_OpenstackMonitor_To_v1alpha3_OpenstackMonitor(a.(*kops.OpenstackMonitor), b.(*OpenstackMonitor), scope)\n\t}); err != nil {\n\t\treturn err\n\t}\n\tif err := s.AddGeneratedConversionFunc((*OpenstackNetwork)(nil), (*kops.OpenstackNetwork)(nil), func(a, b interface{}, scope conversion.Scope) error {\n\t\treturn Convert_v1alpha3_OpenstackNetwork_To_kops_OpenstackNetwork(a.(*OpenstackNetwork), b.(*kops.OpenstackNetwork), scope)\n\t}); err != nil {\n\t\treturn err\n\t}\n\tif err := s.AddGeneratedConversionFunc((*kops.OpenstackNetwork)(nil), (*OpenstackNetwork)(nil), func(a, b interface{}, scope conversion.Scope) error {\n\t\treturn Convert_kops_OpenstackNetwork_To_v1alpha3_OpenstackNetwork(a.(*kops.OpenstackNetwork), b.(*OpenstackNetwork), scope)\n\t}); err != nil {\n\t\treturn err\n\t}\n\tif err := s.AddGeneratedConversionFunc((*OpenstackRouter)(nil), (*kops.OpenstackRouter)(nil), func(a, b interface{}, scope conversion.Scope) error {\n\t\treturn Convert_v1alpha3_OpenstackRouter_To_kops_OpenstackRouter(a.(*OpenstackRouter), b.(*kops.OpenstackRouter), scope)\n\t}); err != nil {\n\t\treturn err\n\t}\n\tif err := s.AddGeneratedConversionFunc((*kops.OpenstackRouter)(nil), (*OpenstackRouter)(nil), func(a, b interface{}, scope conversion.Scope) error {\n\t\treturn Convert_kops_OpenstackRouter_To_v1alpha3_OpenstackRouter(a.(*kops.OpenstackRouter), b.(*OpenstackRouter), scope)\n\t}); err != nil {\n\t\treturn err\n\t}\n\tif err := s.AddGeneratedConversionFunc((*OpenstackSpec)(nil), (*kops.OpenstackSpec)(nil), func(a, b interface{}, scope conversion.Scope) error {\n\t\treturn Convert_v1alpha3_OpenstackSpec_To_kops_OpenstackSpec(a.(*OpenstackSpec), b.(*kops.OpenstackSpec), scope)\n\t}); err != nil {\n\t\treturn err\n\t}\n\tif err := s.AddGeneratedConversionFunc((*kops.OpenstackSpec)(nil), (*OpenstackSpec)(nil), func(a, b interface{}, scope conversion.Scope) error {\n\t\treturn Convert_kops_OpenstackSpec_To_v1alpha3_OpenstackSpec(a.(*kops.OpenstackSpec), b.(*OpenstackSpec), scope)\n\t}); err != nil {\n\t\treturn err\n\t}\n\tif err := s.AddGeneratedConversionFunc((*PDCSIDriver)(nil), (*kops.PDCSIDriver)(nil), func(a, b interface{}, scope conversion.Scope) error {\n\t\treturn Convert_v1alpha3_PDCSIDriver_To_kops_PDCSIDriver(a.(*PDCSIDriver), b.(*kops.PDCSIDriver), scope)\n\t}); err != nil {\n\t\treturn err\n\t}\n\tif err := s.AddGeneratedConversionFunc((*kops.PDCSIDriver)(nil), (*PDCSIDriver)(nil), func(a, b interface{}, scope conversion.Scope) error {\n\t\treturn Convert_kops_PDCSIDriver_To_v1alpha3_PDCSIDriver(a.(*kops.PDCSIDriver), b.(*PDCSIDriver), scope)\n\t}); err != nil {\n\t\treturn err\n\t}\n\tif err := s.AddGeneratedConversionFunc((*PackagesConfig)(nil), (*kops.PackagesConfig)(nil), func(a, b interface{}, scope conversion.Scope) error {\n\t\treturn Convert_v1alpha3_PackagesConfig_To_kops_PackagesConfig(a.(*PackagesConfig), b.(*kops.PackagesConfig), scope)\n\t}); err != nil {\n\t\treturn err\n\t}\n\tif err := s.AddGeneratedConversionFunc((*kops.PackagesConfig)(nil), (*PackagesConfig)(nil), func(a, b interface{}, scope conversion.Scope) error {\n\t\treturn Convert_kops_PackagesConfig_To_v1alpha3_PackagesConfig(a.(*kops.PackagesConfig), b.(*PackagesConfig), scope)\n\t}); err != nil {\n\t\treturn err\n\t}\n\tif err := s.AddGeneratedConversionFunc((*PodIdentityWebhookSpec)(nil), (*kops.PodIdentityWebhookSpec)(nil), func(a, b interface{}, scope conversion.Scope) error {\n\t\treturn Convert_v1alpha3_PodIdentityWebhookSpec_To_kops_PodIdentityWebhookSpec(a.(*PodIdentityWebhookSpec), b.(*kops.PodIdentityWebhookSpec), scope)\n\t}); err != nil {\n\t\treturn err\n\t}\n\tif err := s.AddGeneratedConversionFunc((*kops.PodIdentityWebhookSpec)(nil), (*PodIdentityWebhookSpec)(nil), func(a, b interface{}, scope conversion.Scope) error {\n\t\treturn Convert_kops_PodIdentityWebhookSpec_To_v1alpha3_PodIdentityWebhookSpec(a.(*kops.PodIdentityWebhookSpec), b.(*PodIdentityWebhookSpec), scope)\n\t}); err != nil {\n\t\treturn err\n\t}\n\tif err := s.AddGeneratedConversionFunc((*RBACAuthorizationSpec)(nil), (*kops.RBACAuthorizationSpec)(nil), func(a, b interface{}, scope conversion.Scope) error {\n\t\treturn Convert_v1alpha3_RBACAuthorizationSpec_To_kops_RBACAuthorizationSpec(a.(*RBACAuthorizationSpec), b.(*kops.RBACAuthorizationSpec), scope)\n\t}); err != nil {\n\t\treturn err\n\t}\n\tif err := s.AddGeneratedConversionFunc((*kops.RBACAuthorizationSpec)(nil), (*RBACAuthorizationSpec)(nil), func(a, b interface{}, scope conversion.Scope) error {\n\t\treturn Convert_kops_RBACAuthorizationSpec_To_v1alpha3_RBACAuthorizationSpec(a.(*kops.RBACAuthorizationSpec), b.(*RBACAuthorizationSpec), scope)\n\t}); err != nil {\n\t\treturn err\n\t}\n\tif err := s.AddGeneratedConversionFunc((*RollingUpdate)(nil), (*kops.RollingUpdate)(nil), func(a, b interface{}, scope conversion.Scope) error {\n\t\treturn Convert_v1alpha3_RollingUpdate_To_kops_RollingUpdate(a.(*RollingUpdate), b.(*kops.RollingUpdate), scope)\n\t}); err != nil {\n\t\treturn err\n\t}\n\tif err := s.AddGeneratedConversionFunc((*kops.RollingUpdate)(nil), (*RollingUpdate)(nil), func(a, b interface{}, scope conversion.Scope) error {\n\t\treturn Convert_kops_RollingUpdate_To_v1alpha3_RollingUpdate(a.(*kops.RollingUpdate), b.(*RollingUpdate), scope)\n\t}); err != nil {\n\t\treturn err\n\t}\n\tif err := s.AddGeneratedConversionFunc((*RouteSpec)(nil), (*kops.RouteSpec)(nil), func(a, b interface{}, scope conversion.Scope) error {\n\t\treturn Convert_v1alpha3_RouteSpec_To_kops_RouteSpec(a.(*RouteSpec), b.(*kops.RouteSpec), scope)\n\t}); err != nil {\n\t\treturn err\n\t}\n\tif err := s.AddGeneratedConversionFunc((*kops.RouteSpec)(nil), (*RouteSpec)(nil), func(a, b interface{}, scope conversion.Scope) error {\n\t\treturn Convert_kops_RouteSpec_To_v1alpha3_RouteSpec(a.(*kops.RouteSpec), b.(*RouteSpec), scope)\n\t}); err != nil {\n\t\treturn err\n\t}\n\tif err := s.AddGeneratedConversionFunc((*Runc)(nil), (*kops.Runc)(nil), func(a, b interface{}, scope conversion.Scope) error {\n\t\treturn Convert_v1alpha3_Runc_To_kops_Runc(a.(*Runc), b.(*kops.Runc), scope)\n\t}); err != nil {\n\t\treturn err\n\t}\n\tif err := s.AddGeneratedConversionFunc((*kops.Runc)(nil), (*Runc)(nil), func(a, b interface{}, scope conversion.Scope) error {\n\t\treturn Convert_kops_Runc_To_v1alpha3_Runc(a.(*kops.Runc), b.(*Runc), scope)\n\t}); err != nil {\n\t\treturn err\n\t}\n\tif err := s.AddGeneratedConversionFunc((*SSHCredential)(nil), (*kops.SSHCredential)(nil), func(a, b interface{}, scope conversion.Scope) error {\n\t\treturn Convert_v1alpha3_SSHCredential_To_kops_SSHCredential(a.(*SSHCredential), b.(*kops.SSHCredential), scope)\n\t}); err != nil {\n\t\treturn err\n\t}\n\tif err := s.AddGeneratedConversionFunc((*kops.SSHCredential)(nil), (*SSHCredential)(nil), func(a, b interface{}, scope conversion.Scope) error {\n\t\treturn Convert_kops_SSHCredential_To_v1alpha3_SSHCredential(a.(*kops.SSHCredential), b.(*SSHCredential), scope)\n\t}); err != nil {\n\t\treturn err\n\t}\n\tif err := s.AddGeneratedConversionFunc((*SSHCredentialList)(nil), (*kops.SSHCredentialList)(nil), func(a, b interface{}, scope conversion.Scope) error {\n\t\treturn Convert_v1alpha3_SSHCredentialList_To_kops_SSHCredentialList(a.(*SSHCredentialList), b.(*kops.SSHCredentialList), scope)\n\t}); err != nil {\n\t\treturn err\n\t}\n\tif err := s.AddGeneratedConversionFunc((*kops.SSHCredentialList)(nil), (*SSHCredentialList)(nil), func(a, b interface{}, scope conversion.Scope) error {\n\t\treturn Convert_kops_SSHCredentialList_To_v1alpha3_SSHCredentialList(a.(*kops.SSHCredentialList), b.(*SSHCredentialList), scope)\n\t}); err != nil {\n\t\treturn err\n\t}\n\tif err := s.AddGeneratedConversionFunc((*SSHCredentialSpec)(nil), (*kops.SSHCredentialSpec)(nil), func(a, b interface{}, scope conversion.Scope) error {\n\t\treturn Convert_v1alpha3_SSHCredentialSpec_To_kops_SSHCredentialSpec(a.(*SSHCredentialSpec), b.(*kops.SSHCredentialSpec), scope)\n\t}); err != nil {\n\t\treturn err\n\t}\n\tif err := s.AddGeneratedConversionFunc((*kops.SSHCredentialSpec)(nil), (*SSHCredentialSpec)(nil), func(a, b interface{}, scope conversion.Scope) error {\n\t\treturn Convert_kops_SSHCredentialSpec_To_v1alpha3_SSHCredentialSpec(a.(*kops.SSHCredentialSpec), b.(*SSHCredentialSpec), scope)\n\t}); err != nil {\n\t\treturn err\n\t}\n\tif err := s.AddGeneratedConversionFunc((*ScalewaySpec)(nil), (*kops.ScalewaySpec)(nil), func(a, b interface{}, scope conversion.Scope) error {\n\t\treturn Convert_v1alpha3_ScalewaySpec_To_kops_ScalewaySpec(a.(*ScalewaySpec), b.(*kops.ScalewaySpec), scope)\n\t}); err != nil {\n\t\treturn err\n\t}\n\tif err := s.AddGeneratedConversionFunc((*kops.ScalewaySpec)(nil), (*ScalewaySpec)(nil), func(a, b interface{}, scope conversion.Scope) error {\n\t\treturn Convert_kops_ScalewaySpec_To_v1alpha3_ScalewaySpec(a.(*kops.ScalewaySpec), b.(*ScalewaySpec), scope)\n\t}); err != nil {\n\t\treturn err\n\t}\n\tif err := s.AddGeneratedConversionFunc((*ServiceAccountExternalPermission)(nil), (*kops.ServiceAccountExternalPermission)(nil), func(a, b interface{}, scope conversion.Scope) error {\n\t\treturn Convert_v1alpha3_ServiceAccountExternalPermission_To_kops_ServiceAccountExternalPermission(a.(*ServiceAccountExternalPermission), b.(*kops.ServiceAccountExternalPermission), scope)\n\t}); err != nil {\n\t\treturn err\n\t}\n\tif err := s.AddGeneratedConversionFunc((*kops.ServiceAccountExternalPermission)(nil), (*ServiceAccountExternalPermission)(nil), func(a, b interface{}, scope conversion.Scope) error {\n\t\treturn Convert_kops_ServiceAccountExternalPermission_To_v1alpha3_ServiceAccountExternalPermission(a.(*kops.ServiceAccountExternalPermission), b.(*ServiceAccountExternalPermission), scope)\n\t}); err != nil {\n\t\treturn err\n\t}\n\tif err := s.AddGeneratedConversionFunc((*ServiceAccountIssuerDiscoveryConfig)(nil), (*kops.ServiceAccountIssuerDiscoveryConfig)(nil), func(a, b interface{}, scope conversion.Scope) error {\n\t\treturn Convert_v1alpha3_ServiceAccountIssuerDiscoveryConfig_To_kops_ServiceAccountIssuerDiscoveryConfig(a.(*ServiceAccountIssuerDiscoveryConfig), b.(*kops.ServiceAccountIssuerDiscoveryConfig), scope)\n\t}); err != nil {\n\t\treturn err\n\t}\n\tif err := s.AddGeneratedConversionFunc((*kops.ServiceAccountIssuerDiscoveryConfig)(nil), (*ServiceAccountIssuerDiscoveryConfig)(nil), func(a, b interface{}, scope conversion.Scope) error {\n\t\treturn Convert_kops_ServiceAccountIssuerDiscoveryConfig_To_v1alpha3_ServiceAccountIssuerDiscoveryConfig(a.(*kops.ServiceAccountIssuerDiscoveryConfig), b.(*ServiceAccountIssuerDiscoveryConfig), scope)\n\t}); err != nil {\n\t\treturn err\n\t}\n\tif err := s.AddGeneratedConversionFunc((*SnapshotControllerConfig)(nil), (*kops.SnapshotControllerConfig)(nil), func(a, b interface{}, scope conversion.Scope) error {\n\t\treturn Convert_v1alpha3_SnapshotControllerConfig_To_kops_SnapshotControllerConfig(a.(*SnapshotControllerConfig), b.(*kops.SnapshotControllerConfig), scope)\n\t}); err != nil {\n\t\treturn err\n\t}\n\tif err := s.AddGeneratedConversionFunc((*kops.SnapshotControllerConfig)(nil), (*SnapshotControllerConfig)(nil), func(a, b interface{}, scope conversion.Scope) error {\n\t\treturn Convert_kops_SnapshotControllerConfig_To_v1alpha3_SnapshotControllerConfig(a.(*kops.SnapshotControllerConfig), b.(*SnapshotControllerConfig), scope)\n\t}); err != nil {\n\t\treturn err\n\t}\n\tif err := s.AddGeneratedConversionFunc((*TargetSpec)(nil), (*kops.TargetSpec)(nil), func(a, b interface{}, scope conversion.Scope) error {\n\t\treturn Convert_v1alpha3_TargetSpec_To_kops_TargetSpec(a.(*TargetSpec), b.(*kops.TargetSpec), scope)\n\t}); err != nil {\n\t\treturn err\n\t}\n\tif err := s.AddGeneratedConversionFunc((*kops.TargetSpec)(nil), (*TargetSpec)(nil), func(a, b interface{}, scope conversion.Scope) error {\n\t\treturn Convert_kops_TargetSpec_To_v1alpha3_TargetSpec(a.(*kops.TargetSpec), b.(*TargetSpec), scope)\n\t}); err != nil {\n\t\treturn err\n\t}\n\tif err := s.AddGeneratedConversionFunc((*TerraformSpec)(nil), (*kops.TerraformSpec)(nil), func(a, b interface{}, scope conversion.Scope) error {\n\t\treturn Convert_v1alpha3_TerraformSpec_To_kops_TerraformSpec(a.(*TerraformSpec), b.(*kops.TerraformSpec), scope)\n\t}); err != nil {\n\t\treturn err\n\t}\n\tif err := s.AddGeneratedConversionFunc((*kops.TerraformSpec)(nil), (*TerraformSpec)(nil), func(a, b interface{}, scope conversion.Scope) error {\n\t\treturn Convert_kops_TerraformSpec_To_v1alpha3_TerraformSpec(a.(*kops.TerraformSpec), b.(*TerraformSpec), scope)\n\t}); err != nil {\n\t\treturn err\n\t}\n\tif err := s.AddGeneratedConversionFunc((*TopologySpec)(nil), (*kops.TopologySpec)(nil), func(a, b interface{}, scope conversion.Scope) error {\n\t\treturn Convert_v1alpha3_TopologySpec_To_kops_TopologySpec(a.(*TopologySpec), b.(*kops.TopologySpec), scope)\n\t}); err != nil {\n\t\treturn err\n\t}\n\tif err := s.AddGeneratedConversionFunc((*kops.TopologySpec)(nil), (*TopologySpec)(nil), func(a, b interface{}, scope conversion.Scope) error {\n\t\treturn Convert_kops_TopologySpec_To_v1alpha3_TopologySpec(a.(*kops.TopologySpec), b.(*TopologySpec), scope)\n\t}); err != nil {\n\t\treturn err\n\t}\n\tif err := s.AddGeneratedConversionFunc((*UserData)(nil), (*kops.UserData)(nil), func(a, b interface{}, scope conversion.Scope) error {\n\t\treturn Convert_v1alpha3_UserData_To_kops_UserData(a.(*UserData), b.(*kops.UserData), scope)\n\t}); err != nil {\n\t\treturn err\n\t}\n\tif err := s.AddGeneratedConversionFunc((*kops.UserData)(nil), (*UserData)(nil), func(a, b interface{}, scope conversion.Scope) error {\n\t\treturn Convert_kops_UserData_To_v1alpha3_UserData(a.(*kops.UserData), b.(*UserData), scope)\n\t}); err != nil {\n\t\treturn err\n\t}\n\tif err := s.AddGeneratedConversionFunc((*VolumeMountSpec)(nil), (*kops.VolumeMountSpec)(nil), func(a, b interface{}, scope conversion.Scope) error {\n\t\treturn Convert_v1alpha3_VolumeMountSpec_To_kops_VolumeMountSpec(a.(*VolumeMountSpec), b.(*kops.VolumeMountSpec), scope)\n\t}); err != nil {\n\t\treturn err\n\t}\n\tif err := s.AddGeneratedConversionFunc((*kops.VolumeMountSpec)(nil), (*VolumeMountSpec)(nil), func(a, b interface{}, scope conversion.Scope) error {\n\t\treturn Convert_kops_VolumeMountSpec_To_v1alpha3_VolumeMountSpec(a.(*kops.VolumeMountSpec), b.(*VolumeMountSpec), scope)\n\t}); err != nil {\n\t\treturn err\n\t}\n\tif err := s.AddGeneratedConversionFunc((*VolumeSpec)(nil), (*kops.VolumeSpec)(nil), func(a, b interface{}, scope conversion.Scope) error {\n\t\treturn Convert_v1alpha3_VolumeSpec_To_kops_VolumeSpec(a.(*VolumeSpec), b.(*kops.VolumeSpec), scope)\n\t}); err != nil {\n\t\treturn err\n\t}\n\tif err := s.AddGeneratedConversionFunc((*kops.VolumeSpec)(nil), (*VolumeSpec)(nil), func(a, b interface{}, scope conversion.Scope) error {\n\t\treturn Convert_kops_VolumeSpec_To_v1alpha3_VolumeSpec(a.(*kops.VolumeSpec), b.(*VolumeSpec), scope)\n\t}); err != nil {\n\t\treturn err\n\t}\n\tif err := s.AddGeneratedConversionFunc((*WarmPoolSpec)(nil), (*kops.WarmPoolSpec)(nil), func(a, b interface{}, scope conversion.Scope) error {\n\t\treturn Convert_v1alpha3_WarmPoolSpec_To_kops_WarmPoolSpec(a.(*WarmPoolSpec), b.(*kops.WarmPoolSpec), scope)\n\t}); err != nil {\n\t\treturn err\n\t}\n\tif err := s.AddGeneratedConversionFunc((*kops.WarmPoolSpec)(nil), (*WarmPoolSpec)(nil), func(a, b interface{}, scope conversion.Scope) error {\n\t\treturn Convert_kops_WarmPoolSpec_To_v1alpha3_WarmPoolSpec(a.(*kops.WarmPoolSpec), b.(*WarmPoolSpec), scope)\n\t}); err != nil {\n\t\treturn err\n\t}\n\tif err := s.AddGeneratedConversionFunc((*WeaveNetworkingSpec)(nil), (*kops.WeaveNetworkingSpec)(nil), func(a, b interface{}, scope conversion.Scope) error {\n\t\treturn Convert_v1alpha3_WeaveNetworkingSpec_To_kops_WeaveNetworkingSpec(a.(*WeaveNetworkingSpec), b.(*kops.WeaveNetworkingSpec), scope)\n\t}); err != nil {\n\t\treturn err\n\t}\n\tif err := s.AddGeneratedConversionFunc((*kops.WeaveNetworkingSpec)(nil), (*WeaveNetworkingSpec)(nil), func(a, b interface{}, scope conversion.Scope) error {\n\t\treturn Convert_kops_WeaveNetworkingSpec_To_v1alpha3_WeaveNetworkingSpec(a.(*kops.WeaveNetworkingSpec), b.(*WeaveNetworkingSpec), scope)\n\t}); err != nil {\n\t\treturn err\n\t}\n\treturn nil\n}", "title": "" }, { "docid": "2ca37128d065055917da7a7dde213f35", "score": "0.7069471", "text": "func RegisterConversions(s *runtime.Scheme) error {\n\tif err := s.AddGeneratedConversionFunc((*APIService)(nil), (*apiregistration.APIService)(nil), func(a, b interface{}, scope conversion.Scope) error {\n\t\treturn Convert_v1_APIService_To_apiregistration_APIService(a.(*APIService), b.(*apiregistration.APIService), scope)\n\t}); err != nil {\n\t\treturn err\n\t}\n\tif err := s.AddGeneratedConversionFunc((*apiregistration.APIService)(nil), (*APIService)(nil), func(a, b interface{}, scope conversion.Scope) error {\n\t\treturn Convert_apiregistration_APIService_To_v1_APIService(a.(*apiregistration.APIService), b.(*APIService), scope)\n\t}); err != nil {\n\t\treturn err\n\t}\n\tif err := s.AddGeneratedConversionFunc((*APIServiceCondition)(nil), (*apiregistration.APIServiceCondition)(nil), func(a, b interface{}, scope conversion.Scope) error {\n\t\treturn Convert_v1_APIServiceCondition_To_apiregistration_APIServiceCondition(a.(*APIServiceCondition), b.(*apiregistration.APIServiceCondition), scope)\n\t}); err != nil {\n\t\treturn err\n\t}\n\tif err := s.AddGeneratedConversionFunc((*apiregistration.APIServiceCondition)(nil), (*APIServiceCondition)(nil), func(a, b interface{}, scope conversion.Scope) error {\n\t\treturn Convert_apiregistration_APIServiceCondition_To_v1_APIServiceCondition(a.(*apiregistration.APIServiceCondition), b.(*APIServiceCondition), scope)\n\t}); err != nil {\n\t\treturn err\n\t}\n\tif err := s.AddGeneratedConversionFunc((*APIServiceList)(nil), (*apiregistration.APIServiceList)(nil), func(a, b interface{}, scope conversion.Scope) error {\n\t\treturn Convert_v1_APIServiceList_To_apiregistration_APIServiceList(a.(*APIServiceList), b.(*apiregistration.APIServiceList), scope)\n\t}); err != nil {\n\t\treturn err\n\t}\n\tif err := s.AddGeneratedConversionFunc((*apiregistration.APIServiceList)(nil), (*APIServiceList)(nil), func(a, b interface{}, scope conversion.Scope) error {\n\t\treturn Convert_apiregistration_APIServiceList_To_v1_APIServiceList(a.(*apiregistration.APIServiceList), b.(*APIServiceList), scope)\n\t}); err != nil {\n\t\treturn err\n\t}\n\tif err := s.AddGeneratedConversionFunc((*APIServiceSpec)(nil), (*apiregistration.APIServiceSpec)(nil), func(a, b interface{}, scope conversion.Scope) error {\n\t\treturn Convert_v1_APIServiceSpec_To_apiregistration_APIServiceSpec(a.(*APIServiceSpec), b.(*apiregistration.APIServiceSpec), scope)\n\t}); err != nil {\n\t\treturn err\n\t}\n\tif err := s.AddGeneratedConversionFunc((*apiregistration.APIServiceSpec)(nil), (*APIServiceSpec)(nil), func(a, b interface{}, scope conversion.Scope) error {\n\t\treturn Convert_apiregistration_APIServiceSpec_To_v1_APIServiceSpec(a.(*apiregistration.APIServiceSpec), b.(*APIServiceSpec), scope)\n\t}); err != nil {\n\t\treturn err\n\t}\n\tif err := s.AddGeneratedConversionFunc((*APIServiceStatus)(nil), (*apiregistration.APIServiceStatus)(nil), func(a, b interface{}, scope conversion.Scope) error {\n\t\treturn Convert_v1_APIServiceStatus_To_apiregistration_APIServiceStatus(a.(*APIServiceStatus), b.(*apiregistration.APIServiceStatus), scope)\n\t}); err != nil {\n\t\treturn err\n\t}\n\tif err := s.AddGeneratedConversionFunc((*apiregistration.APIServiceStatus)(nil), (*APIServiceStatus)(nil), func(a, b interface{}, scope conversion.Scope) error {\n\t\treturn Convert_apiregistration_APIServiceStatus_To_v1_APIServiceStatus(a.(*apiregistration.APIServiceStatus), b.(*APIServiceStatus), scope)\n\t}); err != nil {\n\t\treturn err\n\t}\n\tif err := s.AddGeneratedConversionFunc((*ServiceReference)(nil), (*apiregistration.ServiceReference)(nil), func(a, b interface{}, scope conversion.Scope) error {\n\t\treturn Convert_v1_ServiceReference_To_apiregistration_ServiceReference(a.(*ServiceReference), b.(*apiregistration.ServiceReference), scope)\n\t}); err != nil {\n\t\treturn err\n\t}\n\tif err := s.AddGeneratedConversionFunc((*apiregistration.ServiceReference)(nil), (*ServiceReference)(nil), func(a, b interface{}, scope conversion.Scope) error {\n\t\treturn Convert_apiregistration_ServiceReference_To_v1_ServiceReference(a.(*apiregistration.ServiceReference), b.(*ServiceReference), scope)\n\t}); err != nil {\n\t\treturn err\n\t}\n\treturn nil\n}", "title": "" }, { "docid": "e3da8a48d3a90d03621bb66e53541dd1", "score": "0.7067252", "text": "func RegisterConversions(s *runtime.Scheme) error {\n\tif err := s.AddGeneratedConversionFunc((*APIEndpoint)(nil), (*kubeadm.APIEndpoint)(nil), func(a, b interface{}, scope conversion.Scope) error {\n\t\treturn Convert_v1beta3_APIEndpoint_To_kubeadm_APIEndpoint(a.(*APIEndpoint), b.(*kubeadm.APIEndpoint), scope)\n\t}); err != nil {\n\t\treturn err\n\t}\n\tif err := s.AddGeneratedConversionFunc((*kubeadm.APIEndpoint)(nil), (*APIEndpoint)(nil), func(a, b interface{}, scope conversion.Scope) error {\n\t\treturn Convert_kubeadm_APIEndpoint_To_v1beta3_APIEndpoint(a.(*kubeadm.APIEndpoint), b.(*APIEndpoint), scope)\n\t}); err != nil {\n\t\treturn err\n\t}\n\tif err := s.AddGeneratedConversionFunc((*APIServer)(nil), (*kubeadm.APIServer)(nil), func(a, b interface{}, scope conversion.Scope) error {\n\t\treturn Convert_v1beta3_APIServer_To_kubeadm_APIServer(a.(*APIServer), b.(*kubeadm.APIServer), scope)\n\t}); err != nil {\n\t\treturn err\n\t}\n\tif err := s.AddGeneratedConversionFunc((*kubeadm.APIServer)(nil), (*APIServer)(nil), func(a, b interface{}, scope conversion.Scope) error {\n\t\treturn Convert_kubeadm_APIServer_To_v1beta3_APIServer(a.(*kubeadm.APIServer), b.(*APIServer), scope)\n\t}); err != nil {\n\t\treturn err\n\t}\n\tif err := s.AddGeneratedConversionFunc((*BootstrapTokenDiscovery)(nil), (*kubeadm.BootstrapTokenDiscovery)(nil), func(a, b interface{}, scope conversion.Scope) error {\n\t\treturn Convert_v1beta3_BootstrapTokenDiscovery_To_kubeadm_BootstrapTokenDiscovery(a.(*BootstrapTokenDiscovery), b.(*kubeadm.BootstrapTokenDiscovery), scope)\n\t}); err != nil {\n\t\treturn err\n\t}\n\tif err := s.AddGeneratedConversionFunc((*kubeadm.BootstrapTokenDiscovery)(nil), (*BootstrapTokenDiscovery)(nil), func(a, b interface{}, scope conversion.Scope) error {\n\t\treturn Convert_kubeadm_BootstrapTokenDiscovery_To_v1beta3_BootstrapTokenDiscovery(a.(*kubeadm.BootstrapTokenDiscovery), b.(*BootstrapTokenDiscovery), scope)\n\t}); err != nil {\n\t\treturn err\n\t}\n\tif err := s.AddGeneratedConversionFunc((*ClusterConfiguration)(nil), (*kubeadm.ClusterConfiguration)(nil), func(a, b interface{}, scope conversion.Scope) error {\n\t\treturn Convert_v1beta3_ClusterConfiguration_To_kubeadm_ClusterConfiguration(a.(*ClusterConfiguration), b.(*kubeadm.ClusterConfiguration), scope)\n\t}); err != nil {\n\t\treturn err\n\t}\n\tif err := s.AddGeneratedConversionFunc((*kubeadm.ClusterConfiguration)(nil), (*ClusterConfiguration)(nil), func(a, b interface{}, scope conversion.Scope) error {\n\t\treturn Convert_kubeadm_ClusterConfiguration_To_v1beta3_ClusterConfiguration(a.(*kubeadm.ClusterConfiguration), b.(*ClusterConfiguration), scope)\n\t}); err != nil {\n\t\treturn err\n\t}\n\tif err := s.AddGeneratedConversionFunc((*DNS)(nil), (*kubeadm.DNS)(nil), func(a, b interface{}, scope conversion.Scope) error {\n\t\treturn Convert_v1beta3_DNS_To_kubeadm_DNS(a.(*DNS), b.(*kubeadm.DNS), scope)\n\t}); err != nil {\n\t\treturn err\n\t}\n\tif err := s.AddGeneratedConversionFunc((*kubeadm.DNS)(nil), (*DNS)(nil), func(a, b interface{}, scope conversion.Scope) error {\n\t\treturn Convert_kubeadm_DNS_To_v1beta3_DNS(a.(*kubeadm.DNS), b.(*DNS), scope)\n\t}); err != nil {\n\t\treturn err\n\t}\n\tif err := s.AddGeneratedConversionFunc((*Discovery)(nil), (*kubeadm.Discovery)(nil), func(a, b interface{}, scope conversion.Scope) error {\n\t\treturn Convert_v1beta3_Discovery_To_kubeadm_Discovery(a.(*Discovery), b.(*kubeadm.Discovery), scope)\n\t}); err != nil {\n\t\treturn err\n\t}\n\tif err := s.AddGeneratedConversionFunc((*kubeadm.Discovery)(nil), (*Discovery)(nil), func(a, b interface{}, scope conversion.Scope) error {\n\t\treturn Convert_kubeadm_Discovery_To_v1beta3_Discovery(a.(*kubeadm.Discovery), b.(*Discovery), scope)\n\t}); err != nil {\n\t\treturn err\n\t}\n\tif err := s.AddGeneratedConversionFunc((*Etcd)(nil), (*kubeadm.Etcd)(nil), func(a, b interface{}, scope conversion.Scope) error {\n\t\treturn Convert_v1beta3_Etcd_To_kubeadm_Etcd(a.(*Etcd), b.(*kubeadm.Etcd), scope)\n\t}); err != nil {\n\t\treturn err\n\t}\n\tif err := s.AddGeneratedConversionFunc((*kubeadm.Etcd)(nil), (*Etcd)(nil), func(a, b interface{}, scope conversion.Scope) error {\n\t\treturn Convert_kubeadm_Etcd_To_v1beta3_Etcd(a.(*kubeadm.Etcd), b.(*Etcd), scope)\n\t}); err != nil {\n\t\treturn err\n\t}\n\tif err := s.AddGeneratedConversionFunc((*ExternalEtcd)(nil), (*kubeadm.ExternalEtcd)(nil), func(a, b interface{}, scope conversion.Scope) error {\n\t\treturn Convert_v1beta3_ExternalEtcd_To_kubeadm_ExternalEtcd(a.(*ExternalEtcd), b.(*kubeadm.ExternalEtcd), scope)\n\t}); err != nil {\n\t\treturn err\n\t}\n\tif err := s.AddGeneratedConversionFunc((*kubeadm.ExternalEtcd)(nil), (*ExternalEtcd)(nil), func(a, b interface{}, scope conversion.Scope) error {\n\t\treturn Convert_kubeadm_ExternalEtcd_To_v1beta3_ExternalEtcd(a.(*kubeadm.ExternalEtcd), b.(*ExternalEtcd), scope)\n\t}); err != nil {\n\t\treturn err\n\t}\n\tif err := s.AddGeneratedConversionFunc((*FileDiscovery)(nil), (*kubeadm.FileDiscovery)(nil), func(a, b interface{}, scope conversion.Scope) error {\n\t\treturn Convert_v1beta3_FileDiscovery_To_kubeadm_FileDiscovery(a.(*FileDiscovery), b.(*kubeadm.FileDiscovery), scope)\n\t}); err != nil {\n\t\treturn err\n\t}\n\tif err := s.AddGeneratedConversionFunc((*kubeadm.FileDiscovery)(nil), (*FileDiscovery)(nil), func(a, b interface{}, scope conversion.Scope) error {\n\t\treturn Convert_kubeadm_FileDiscovery_To_v1beta3_FileDiscovery(a.(*kubeadm.FileDiscovery), b.(*FileDiscovery), scope)\n\t}); err != nil {\n\t\treturn err\n\t}\n\tif err := s.AddGeneratedConversionFunc((*HostPathMount)(nil), (*kubeadm.HostPathMount)(nil), func(a, b interface{}, scope conversion.Scope) error {\n\t\treturn Convert_v1beta3_HostPathMount_To_kubeadm_HostPathMount(a.(*HostPathMount), b.(*kubeadm.HostPathMount), scope)\n\t}); err != nil {\n\t\treturn err\n\t}\n\tif err := s.AddGeneratedConversionFunc((*kubeadm.HostPathMount)(nil), (*HostPathMount)(nil), func(a, b interface{}, scope conversion.Scope) error {\n\t\treturn Convert_kubeadm_HostPathMount_To_v1beta3_HostPathMount(a.(*kubeadm.HostPathMount), b.(*HostPathMount), scope)\n\t}); err != nil {\n\t\treturn err\n\t}\n\tif err := s.AddGeneratedConversionFunc((*ImageMeta)(nil), (*kubeadm.ImageMeta)(nil), func(a, b interface{}, scope conversion.Scope) error {\n\t\treturn Convert_v1beta3_ImageMeta_To_kubeadm_ImageMeta(a.(*ImageMeta), b.(*kubeadm.ImageMeta), scope)\n\t}); err != nil {\n\t\treturn err\n\t}\n\tif err := s.AddGeneratedConversionFunc((*kubeadm.ImageMeta)(nil), (*ImageMeta)(nil), func(a, b interface{}, scope conversion.Scope) error {\n\t\treturn Convert_kubeadm_ImageMeta_To_v1beta3_ImageMeta(a.(*kubeadm.ImageMeta), b.(*ImageMeta), scope)\n\t}); err != nil {\n\t\treturn err\n\t}\n\tif err := s.AddGeneratedConversionFunc((*JoinConfiguration)(nil), (*kubeadm.JoinConfiguration)(nil), func(a, b interface{}, scope conversion.Scope) error {\n\t\treturn Convert_v1beta3_JoinConfiguration_To_kubeadm_JoinConfiguration(a.(*JoinConfiguration), b.(*kubeadm.JoinConfiguration), scope)\n\t}); err != nil {\n\t\treturn err\n\t}\n\tif err := s.AddGeneratedConversionFunc((*JoinControlPlane)(nil), (*kubeadm.JoinControlPlane)(nil), func(a, b interface{}, scope conversion.Scope) error {\n\t\treturn Convert_v1beta3_JoinControlPlane_To_kubeadm_JoinControlPlane(a.(*JoinControlPlane), b.(*kubeadm.JoinControlPlane), scope)\n\t}); err != nil {\n\t\treturn err\n\t}\n\tif err := s.AddGeneratedConversionFunc((*kubeadm.JoinControlPlane)(nil), (*JoinControlPlane)(nil), func(a, b interface{}, scope conversion.Scope) error {\n\t\treturn Convert_kubeadm_JoinControlPlane_To_v1beta3_JoinControlPlane(a.(*kubeadm.JoinControlPlane), b.(*JoinControlPlane), scope)\n\t}); err != nil {\n\t\treturn err\n\t}\n\tif err := s.AddGeneratedConversionFunc((*Networking)(nil), (*kubeadm.Networking)(nil), func(a, b interface{}, scope conversion.Scope) error {\n\t\treturn Convert_v1beta3_Networking_To_kubeadm_Networking(a.(*Networking), b.(*kubeadm.Networking), scope)\n\t}); err != nil {\n\t\treturn err\n\t}\n\tif err := s.AddGeneratedConversionFunc((*kubeadm.Networking)(nil), (*Networking)(nil), func(a, b interface{}, scope conversion.Scope) error {\n\t\treturn Convert_kubeadm_Networking_To_v1beta3_Networking(a.(*kubeadm.Networking), b.(*Networking), scope)\n\t}); err != nil {\n\t\treturn err\n\t}\n\tif err := s.AddGeneratedConversionFunc((*Patches)(nil), (*kubeadm.Patches)(nil), func(a, b interface{}, scope conversion.Scope) error {\n\t\treturn Convert_v1beta3_Patches_To_kubeadm_Patches(a.(*Patches), b.(*kubeadm.Patches), scope)\n\t}); err != nil {\n\t\treturn err\n\t}\n\tif err := s.AddGeneratedConversionFunc((*kubeadm.Patches)(nil), (*Patches)(nil), func(a, b interface{}, scope conversion.Scope) error {\n\t\treturn Convert_kubeadm_Patches_To_v1beta3_Patches(a.(*kubeadm.Patches), b.(*Patches), scope)\n\t}); err != nil {\n\t\treturn err\n\t}\n\tif err := s.AddConversionFunc((*kubeadm.ControlPlaneComponent)(nil), (*ControlPlaneComponent)(nil), func(a, b interface{}, scope conversion.Scope) error {\n\t\treturn Convert_kubeadm_ControlPlaneComponent_To_v1beta3_ControlPlaneComponent(a.(*kubeadm.ControlPlaneComponent), b.(*ControlPlaneComponent), scope)\n\t}); err != nil {\n\t\treturn err\n\t}\n\tif err := s.AddConversionFunc((*kubeadm.InitConfiguration)(nil), (*InitConfiguration)(nil), func(a, b interface{}, scope conversion.Scope) error {\n\t\treturn Convert_kubeadm_InitConfiguration_To_v1beta3_InitConfiguration(a.(*kubeadm.InitConfiguration), b.(*InitConfiguration), scope)\n\t}); err != nil {\n\t\treturn err\n\t}\n\tif err := s.AddConversionFunc((*kubeadm.JoinConfiguration)(nil), (*JoinConfiguration)(nil), func(a, b interface{}, scope conversion.Scope) error {\n\t\treturn Convert_kubeadm_JoinConfiguration_To_v1beta3_JoinConfiguration(a.(*kubeadm.JoinConfiguration), b.(*JoinConfiguration), scope)\n\t}); err != nil {\n\t\treturn err\n\t}\n\tif err := s.AddConversionFunc((*kubeadm.LocalEtcd)(nil), (*LocalEtcd)(nil), func(a, b interface{}, scope conversion.Scope) error {\n\t\treturn Convert_kubeadm_LocalEtcd_To_v1beta3_LocalEtcd(a.(*kubeadm.LocalEtcd), b.(*LocalEtcd), scope)\n\t}); err != nil {\n\t\treturn err\n\t}\n\tif err := s.AddConversionFunc((*kubeadm.NodeRegistrationOptions)(nil), (*NodeRegistrationOptions)(nil), func(a, b interface{}, scope conversion.Scope) error {\n\t\treturn Convert_kubeadm_NodeRegistrationOptions_To_v1beta3_NodeRegistrationOptions(a.(*kubeadm.NodeRegistrationOptions), b.(*NodeRegistrationOptions), scope)\n\t}); err != nil {\n\t\treturn err\n\t}\n\tif err := s.AddConversionFunc((*ControlPlaneComponent)(nil), (*kubeadm.ControlPlaneComponent)(nil), func(a, b interface{}, scope conversion.Scope) error {\n\t\treturn Convert_v1beta3_ControlPlaneComponent_To_kubeadm_ControlPlaneComponent(a.(*ControlPlaneComponent), b.(*kubeadm.ControlPlaneComponent), scope)\n\t}); err != nil {\n\t\treturn err\n\t}\n\tif err := s.AddConversionFunc((*InitConfiguration)(nil), (*kubeadm.InitConfiguration)(nil), func(a, b interface{}, scope conversion.Scope) error {\n\t\treturn Convert_v1beta3_InitConfiguration_To_kubeadm_InitConfiguration(a.(*InitConfiguration), b.(*kubeadm.InitConfiguration), scope)\n\t}); err != nil {\n\t\treturn err\n\t}\n\tif err := s.AddConversionFunc((*LocalEtcd)(nil), (*kubeadm.LocalEtcd)(nil), func(a, b interface{}, scope conversion.Scope) error {\n\t\treturn Convert_v1beta3_LocalEtcd_To_kubeadm_LocalEtcd(a.(*LocalEtcd), b.(*kubeadm.LocalEtcd), scope)\n\t}); err != nil {\n\t\treturn err\n\t}\n\tif err := s.AddConversionFunc((*NodeRegistrationOptions)(nil), (*kubeadm.NodeRegistrationOptions)(nil), func(a, b interface{}, scope conversion.Scope) error {\n\t\treturn Convert_v1beta3_NodeRegistrationOptions_To_kubeadm_NodeRegistrationOptions(a.(*NodeRegistrationOptions), b.(*kubeadm.NodeRegistrationOptions), scope)\n\t}); err != nil {\n\t\treturn err\n\t}\n\treturn nil\n}", "title": "" }, { "docid": "94f0984b16aa0204fe0314523881fb0f", "score": "0.7054162", "text": "func RegisterConversions(s *runtime.Scheme) error {\n\tif err := s.AddGeneratedConversionFunc((*Provider)(nil), (*unversioned.Provider)(nil), func(a, b interface{}, scope conversion.Scope) error {\n\t\treturn Convert_v1alpha1_Provider_To_unversioned_Provider(a.(*Provider), b.(*unversioned.Provider), scope)\n\t}); err != nil {\n\t\treturn err\n\t}\n\tif err := s.AddGeneratedConversionFunc((*unversioned.Provider)(nil), (*Provider)(nil), func(a, b interface{}, scope conversion.Scope) error {\n\t\treturn Convert_unversioned_Provider_To_v1alpha1_Provider(a.(*unversioned.Provider), b.(*Provider), scope)\n\t}); err != nil {\n\t\treturn err\n\t}\n\tif err := s.AddGeneratedConversionFunc((*ProviderList)(nil), (*unversioned.ProviderList)(nil), func(a, b interface{}, scope conversion.Scope) error {\n\t\treturn Convert_v1alpha1_ProviderList_To_unversioned_ProviderList(a.(*ProviderList), b.(*unversioned.ProviderList), scope)\n\t}); err != nil {\n\t\treturn err\n\t}\n\tif err := s.AddGeneratedConversionFunc((*unversioned.ProviderList)(nil), (*ProviderList)(nil), func(a, b interface{}, scope conversion.Scope) error {\n\t\treturn Convert_unversioned_ProviderList_To_v1alpha1_ProviderList(a.(*unversioned.ProviderList), b.(*ProviderList), scope)\n\t}); err != nil {\n\t\treturn err\n\t}\n\tif err := s.AddGeneratedConversionFunc((*ProviderSpec)(nil), (*unversioned.ProviderSpec)(nil), func(a, b interface{}, scope conversion.Scope) error {\n\t\treturn Convert_v1alpha1_ProviderSpec_To_unversioned_ProviderSpec(a.(*ProviderSpec), b.(*unversioned.ProviderSpec), scope)\n\t}); err != nil {\n\t\treturn err\n\t}\n\tif err := s.AddGeneratedConversionFunc((*unversioned.ProviderSpec)(nil), (*ProviderSpec)(nil), func(a, b interface{}, scope conversion.Scope) error {\n\t\treturn Convert_unversioned_ProviderSpec_To_v1alpha1_ProviderSpec(a.(*unversioned.ProviderSpec), b.(*ProviderSpec), scope)\n\t}); err != nil {\n\t\treturn err\n\t}\n\treturn nil\n}", "title": "" }, { "docid": "8771bcb024b783691ce754e192f0a093", "score": "0.70380825", "text": "func RegisterConversions(s *runtime.Scheme) error {\n\tif err := s.AddGeneratedConversionFunc((*ComposeFile)(nil), (*v1beta2.ComposeFile)(nil), func(a, b interface{}, scope conversion.Scope) error {\n\t\treturn Convert_v1alpha3_ComposeFile_To_v1beta2_ComposeFile(a.(*ComposeFile), b.(*v1beta2.ComposeFile), scope)\n\t}); err != nil {\n\t\treturn err\n\t}\n\tif err := s.AddGeneratedConversionFunc((*v1beta2.ComposeFile)(nil), (*ComposeFile)(nil), func(a, b interface{}, scope conversion.Scope) error {\n\t\treturn Convert_v1beta2_ComposeFile_To_v1alpha3_ComposeFile(a.(*v1beta2.ComposeFile), b.(*ComposeFile), scope)\n\t}); err != nil {\n\t\treturn err\n\t}\n\tif err := s.AddGeneratedConversionFunc((*ConfigObjConfig)(nil), (*v1beta2.ConfigObjConfig)(nil), func(a, b interface{}, scope conversion.Scope) error {\n\t\treturn Convert_v1alpha3_ConfigObjConfig_To_v1beta2_ConfigObjConfig(a.(*ConfigObjConfig), b.(*v1beta2.ConfigObjConfig), scope)\n\t}); err != nil {\n\t\treturn err\n\t}\n\tif err := s.AddGeneratedConversionFunc((*v1beta2.ConfigObjConfig)(nil), (*ConfigObjConfig)(nil), func(a, b interface{}, scope conversion.Scope) error {\n\t\treturn Convert_v1beta2_ConfigObjConfig_To_v1alpha3_ConfigObjConfig(a.(*v1beta2.ConfigObjConfig), b.(*ConfigObjConfig), scope)\n\t}); err != nil {\n\t\treturn err\n\t}\n\tif err := s.AddGeneratedConversionFunc((*Constraint)(nil), (*v1beta2.Constraint)(nil), func(a, b interface{}, scope conversion.Scope) error {\n\t\treturn Convert_v1alpha3_Constraint_To_v1beta2_Constraint(a.(*Constraint), b.(*v1beta2.Constraint), scope)\n\t}); err != nil {\n\t\treturn err\n\t}\n\tif err := s.AddGeneratedConversionFunc((*v1beta2.Constraint)(nil), (*Constraint)(nil), func(a, b interface{}, scope conversion.Scope) error {\n\t\treturn Convert_v1beta2_Constraint_To_v1alpha3_Constraint(a.(*v1beta2.Constraint), b.(*Constraint), scope)\n\t}); err != nil {\n\t\treturn err\n\t}\n\tif err := s.AddGeneratedConversionFunc((*Constraints)(nil), (*v1beta2.Constraints)(nil), func(a, b interface{}, scope conversion.Scope) error {\n\t\treturn Convert_v1alpha3_Constraints_To_v1beta2_Constraints(a.(*Constraints), b.(*v1beta2.Constraints), scope)\n\t}); err != nil {\n\t\treturn err\n\t}\n\tif err := s.AddGeneratedConversionFunc((*v1beta2.Constraints)(nil), (*Constraints)(nil), func(a, b interface{}, scope conversion.Scope) error {\n\t\treturn Convert_v1beta2_Constraints_To_v1alpha3_Constraints(a.(*v1beta2.Constraints), b.(*Constraints), scope)\n\t}); err != nil {\n\t\treturn err\n\t}\n\tif err := s.AddGeneratedConversionFunc((*DeployConfig)(nil), (*v1beta2.DeployConfig)(nil), func(a, b interface{}, scope conversion.Scope) error {\n\t\treturn Convert_v1alpha3_DeployConfig_To_v1beta2_DeployConfig(a.(*DeployConfig), b.(*v1beta2.DeployConfig), scope)\n\t}); err != nil {\n\t\treturn err\n\t}\n\tif err := s.AddGeneratedConversionFunc((*v1beta2.DeployConfig)(nil), (*DeployConfig)(nil), func(a, b interface{}, scope conversion.Scope) error {\n\t\treturn Convert_v1beta2_DeployConfig_To_v1alpha3_DeployConfig(a.(*v1beta2.DeployConfig), b.(*DeployConfig), scope)\n\t}); err != nil {\n\t\treturn err\n\t}\n\tif err := s.AddGeneratedConversionFunc((*External)(nil), (*v1beta2.External)(nil), func(a, b interface{}, scope conversion.Scope) error {\n\t\treturn Convert_v1alpha3_External_To_v1beta2_External(a.(*External), b.(*v1beta2.External), scope)\n\t}); err != nil {\n\t\treturn err\n\t}\n\tif err := s.AddGeneratedConversionFunc((*v1beta2.External)(nil), (*External)(nil), func(a, b interface{}, scope conversion.Scope) error {\n\t\treturn Convert_v1beta2_External_To_v1alpha3_External(a.(*v1beta2.External), b.(*External), scope)\n\t}); err != nil {\n\t\treturn err\n\t}\n\tif err := s.AddGeneratedConversionFunc((*FileObjectConfig)(nil), (*v1beta2.FileObjectConfig)(nil), func(a, b interface{}, scope conversion.Scope) error {\n\t\treturn Convert_v1alpha3_FileObjectConfig_To_v1beta2_FileObjectConfig(a.(*FileObjectConfig), b.(*v1beta2.FileObjectConfig), scope)\n\t}); err != nil {\n\t\treturn err\n\t}\n\tif err := s.AddGeneratedConversionFunc((*v1beta2.FileObjectConfig)(nil), (*FileObjectConfig)(nil), func(a, b interface{}, scope conversion.Scope) error {\n\t\treturn Convert_v1beta2_FileObjectConfig_To_v1alpha3_FileObjectConfig(a.(*v1beta2.FileObjectConfig), b.(*FileObjectConfig), scope)\n\t}); err != nil {\n\t\treturn err\n\t}\n\tif err := s.AddGeneratedConversionFunc((*FileReferenceConfig)(nil), (*v1beta2.FileReferenceConfig)(nil), func(a, b interface{}, scope conversion.Scope) error {\n\t\treturn Convert_v1alpha3_FileReferenceConfig_To_v1beta2_FileReferenceConfig(a.(*FileReferenceConfig), b.(*v1beta2.FileReferenceConfig), scope)\n\t}); err != nil {\n\t\treturn err\n\t}\n\tif err := s.AddGeneratedConversionFunc((*v1beta2.FileReferenceConfig)(nil), (*FileReferenceConfig)(nil), func(a, b interface{}, scope conversion.Scope) error {\n\t\treturn Convert_v1beta2_FileReferenceConfig_To_v1alpha3_FileReferenceConfig(a.(*v1beta2.FileReferenceConfig), b.(*FileReferenceConfig), scope)\n\t}); err != nil {\n\t\treturn err\n\t}\n\tif err := s.AddGeneratedConversionFunc((*HealthCheckConfig)(nil), (*v1beta2.HealthCheckConfig)(nil), func(a, b interface{}, scope conversion.Scope) error {\n\t\treturn Convert_v1alpha3_HealthCheckConfig_To_v1beta2_HealthCheckConfig(a.(*HealthCheckConfig), b.(*v1beta2.HealthCheckConfig), scope)\n\t}); err != nil {\n\t\treturn err\n\t}\n\tif err := s.AddGeneratedConversionFunc((*v1beta2.HealthCheckConfig)(nil), (*HealthCheckConfig)(nil), func(a, b interface{}, scope conversion.Scope) error {\n\t\treturn Convert_v1beta2_HealthCheckConfig_To_v1alpha3_HealthCheckConfig(a.(*v1beta2.HealthCheckConfig), b.(*HealthCheckConfig), scope)\n\t}); err != nil {\n\t\treturn err\n\t}\n\tif err := s.AddGeneratedConversionFunc((*Owner)(nil), (*v1beta2.Owner)(nil), func(a, b interface{}, scope conversion.Scope) error {\n\t\treturn Convert_v1alpha3_Owner_To_v1beta2_Owner(a.(*Owner), b.(*v1beta2.Owner), scope)\n\t}); err != nil {\n\t\treturn err\n\t}\n\tif err := s.AddGeneratedConversionFunc((*v1beta2.Owner)(nil), (*Owner)(nil), func(a, b interface{}, scope conversion.Scope) error {\n\t\treturn Convert_v1beta2_Owner_To_v1alpha3_Owner(a.(*v1beta2.Owner), b.(*Owner), scope)\n\t}); err != nil {\n\t\treturn err\n\t}\n\tif err := s.AddGeneratedConversionFunc((*Placement)(nil), (*v1beta2.Placement)(nil), func(a, b interface{}, scope conversion.Scope) error {\n\t\treturn Convert_v1alpha3_Placement_To_v1beta2_Placement(a.(*Placement), b.(*v1beta2.Placement), scope)\n\t}); err != nil {\n\t\treturn err\n\t}\n\tif err := s.AddGeneratedConversionFunc((*v1beta2.Placement)(nil), (*Placement)(nil), func(a, b interface{}, scope conversion.Scope) error {\n\t\treturn Convert_v1beta2_Placement_To_v1alpha3_Placement(a.(*v1beta2.Placement), b.(*Placement), scope)\n\t}); err != nil {\n\t\treturn err\n\t}\n\tif err := s.AddGeneratedConversionFunc((*Resource)(nil), (*v1beta2.Resource)(nil), func(a, b interface{}, scope conversion.Scope) error {\n\t\treturn Convert_v1alpha3_Resource_To_v1beta2_Resource(a.(*Resource), b.(*v1beta2.Resource), scope)\n\t}); err != nil {\n\t\treturn err\n\t}\n\tif err := s.AddGeneratedConversionFunc((*v1beta2.Resource)(nil), (*Resource)(nil), func(a, b interface{}, scope conversion.Scope) error {\n\t\treturn Convert_v1beta2_Resource_To_v1alpha3_Resource(a.(*v1beta2.Resource), b.(*Resource), scope)\n\t}); err != nil {\n\t\treturn err\n\t}\n\tif err := s.AddGeneratedConversionFunc((*Resources)(nil), (*v1beta2.Resources)(nil), func(a, b interface{}, scope conversion.Scope) error {\n\t\treturn Convert_v1alpha3_Resources_To_v1beta2_Resources(a.(*Resources), b.(*v1beta2.Resources), scope)\n\t}); err != nil {\n\t\treturn err\n\t}\n\tif err := s.AddGeneratedConversionFunc((*v1beta2.Resources)(nil), (*Resources)(nil), func(a, b interface{}, scope conversion.Scope) error {\n\t\treturn Convert_v1beta2_Resources_To_v1alpha3_Resources(a.(*v1beta2.Resources), b.(*Resources), scope)\n\t}); err != nil {\n\t\treturn err\n\t}\n\tif err := s.AddGeneratedConversionFunc((*RestartPolicy)(nil), (*v1beta2.RestartPolicy)(nil), func(a, b interface{}, scope conversion.Scope) error {\n\t\treturn Convert_v1alpha3_RestartPolicy_To_v1beta2_RestartPolicy(a.(*RestartPolicy), b.(*v1beta2.RestartPolicy), scope)\n\t}); err != nil {\n\t\treturn err\n\t}\n\tif err := s.AddGeneratedConversionFunc((*v1beta2.RestartPolicy)(nil), (*RestartPolicy)(nil), func(a, b interface{}, scope conversion.Scope) error {\n\t\treturn Convert_v1beta2_RestartPolicy_To_v1alpha3_RestartPolicy(a.(*v1beta2.RestartPolicy), b.(*RestartPolicy), scope)\n\t}); err != nil {\n\t\treturn err\n\t}\n\tif err := s.AddGeneratedConversionFunc((*Scale)(nil), (*v1beta2.Scale)(nil), func(a, b interface{}, scope conversion.Scope) error {\n\t\treturn Convert_v1alpha3_Scale_To_v1beta2_Scale(a.(*Scale), b.(*v1beta2.Scale), scope)\n\t}); err != nil {\n\t\treturn err\n\t}\n\tif err := s.AddGeneratedConversionFunc((*v1beta2.Scale)(nil), (*Scale)(nil), func(a, b interface{}, scope conversion.Scope) error {\n\t\treturn Convert_v1beta2_Scale_To_v1alpha3_Scale(a.(*v1beta2.Scale), b.(*Scale), scope)\n\t}); err != nil {\n\t\treturn err\n\t}\n\tif err := s.AddGeneratedConversionFunc((*SecretConfig)(nil), (*v1beta2.SecretConfig)(nil), func(a, b interface{}, scope conversion.Scope) error {\n\t\treturn Convert_v1alpha3_SecretConfig_To_v1beta2_SecretConfig(a.(*SecretConfig), b.(*v1beta2.SecretConfig), scope)\n\t}); err != nil {\n\t\treturn err\n\t}\n\tif err := s.AddGeneratedConversionFunc((*v1beta2.SecretConfig)(nil), (*SecretConfig)(nil), func(a, b interface{}, scope conversion.Scope) error {\n\t\treturn Convert_v1beta2_SecretConfig_To_v1alpha3_SecretConfig(a.(*v1beta2.SecretConfig), b.(*SecretConfig), scope)\n\t}); err != nil {\n\t\treturn err\n\t}\n\tif err := s.AddGeneratedConversionFunc((*ServiceConfig)(nil), (*v1beta2.ServiceConfig)(nil), func(a, b interface{}, scope conversion.Scope) error {\n\t\treturn Convert_v1alpha3_ServiceConfig_To_v1beta2_ServiceConfig(a.(*ServiceConfig), b.(*v1beta2.ServiceConfig), scope)\n\t}); err != nil {\n\t\treturn err\n\t}\n\tif err := s.AddGeneratedConversionFunc((*v1beta2.ServiceConfig)(nil), (*ServiceConfig)(nil), func(a, b interface{}, scope conversion.Scope) error {\n\t\treturn Convert_v1beta2_ServiceConfig_To_v1alpha3_ServiceConfig(a.(*v1beta2.ServiceConfig), b.(*ServiceConfig), scope)\n\t}); err != nil {\n\t\treturn err\n\t}\n\tif err := s.AddGeneratedConversionFunc((*ServiceConfigObjConfig)(nil), (*v1beta2.ServiceConfigObjConfig)(nil), func(a, b interface{}, scope conversion.Scope) error {\n\t\treturn Convert_v1alpha3_ServiceConfigObjConfig_To_v1beta2_ServiceConfigObjConfig(a.(*ServiceConfigObjConfig), b.(*v1beta2.ServiceConfigObjConfig), scope)\n\t}); err != nil {\n\t\treturn err\n\t}\n\tif err := s.AddGeneratedConversionFunc((*v1beta2.ServiceConfigObjConfig)(nil), (*ServiceConfigObjConfig)(nil), func(a, b interface{}, scope conversion.Scope) error {\n\t\treturn Convert_v1beta2_ServiceConfigObjConfig_To_v1alpha3_ServiceConfigObjConfig(a.(*v1beta2.ServiceConfigObjConfig), b.(*ServiceConfigObjConfig), scope)\n\t}); err != nil {\n\t\treturn err\n\t}\n\tif err := s.AddGeneratedConversionFunc((*ServicePortConfig)(nil), (*v1beta2.ServicePortConfig)(nil), func(a, b interface{}, scope conversion.Scope) error {\n\t\treturn Convert_v1alpha3_ServicePortConfig_To_v1beta2_ServicePortConfig(a.(*ServicePortConfig), b.(*v1beta2.ServicePortConfig), scope)\n\t}); err != nil {\n\t\treturn err\n\t}\n\tif err := s.AddGeneratedConversionFunc((*v1beta2.ServicePortConfig)(nil), (*ServicePortConfig)(nil), func(a, b interface{}, scope conversion.Scope) error {\n\t\treturn Convert_v1beta2_ServicePortConfig_To_v1alpha3_ServicePortConfig(a.(*v1beta2.ServicePortConfig), b.(*ServicePortConfig), scope)\n\t}); err != nil {\n\t\treturn err\n\t}\n\tif err := s.AddGeneratedConversionFunc((*ServiceSecretConfig)(nil), (*v1beta2.ServiceSecretConfig)(nil), func(a, b interface{}, scope conversion.Scope) error {\n\t\treturn Convert_v1alpha3_ServiceSecretConfig_To_v1beta2_ServiceSecretConfig(a.(*ServiceSecretConfig), b.(*v1beta2.ServiceSecretConfig), scope)\n\t}); err != nil {\n\t\treturn err\n\t}\n\tif err := s.AddGeneratedConversionFunc((*v1beta2.ServiceSecretConfig)(nil), (*ServiceSecretConfig)(nil), func(a, b interface{}, scope conversion.Scope) error {\n\t\treturn Convert_v1beta2_ServiceSecretConfig_To_v1alpha3_ServiceSecretConfig(a.(*v1beta2.ServiceSecretConfig), b.(*ServiceSecretConfig), scope)\n\t}); err != nil {\n\t\treturn err\n\t}\n\tif err := s.AddGeneratedConversionFunc((*ServiceVolumeConfig)(nil), (*v1beta2.ServiceVolumeConfig)(nil), func(a, b interface{}, scope conversion.Scope) error {\n\t\treturn Convert_v1alpha3_ServiceVolumeConfig_To_v1beta2_ServiceVolumeConfig(a.(*ServiceVolumeConfig), b.(*v1beta2.ServiceVolumeConfig), scope)\n\t}); err != nil {\n\t\treturn err\n\t}\n\tif err := s.AddGeneratedConversionFunc((*v1beta2.ServiceVolumeConfig)(nil), (*ServiceVolumeConfig)(nil), func(a, b interface{}, scope conversion.Scope) error {\n\t\treturn Convert_v1beta2_ServiceVolumeConfig_To_v1alpha3_ServiceVolumeConfig(a.(*v1beta2.ServiceVolumeConfig), b.(*ServiceVolumeConfig), scope)\n\t}); err != nil {\n\t\treturn err\n\t}\n\tif err := s.AddGeneratedConversionFunc((*Stack)(nil), (*v1beta2.Stack)(nil), func(a, b interface{}, scope conversion.Scope) error {\n\t\treturn Convert_v1alpha3_Stack_To_v1beta2_Stack(a.(*Stack), b.(*v1beta2.Stack), scope)\n\t}); err != nil {\n\t\treturn err\n\t}\n\tif err := s.AddGeneratedConversionFunc((*v1beta2.Stack)(nil), (*Stack)(nil), func(a, b interface{}, scope conversion.Scope) error {\n\t\treturn Convert_v1beta2_Stack_To_v1alpha3_Stack(a.(*v1beta2.Stack), b.(*Stack), scope)\n\t}); err != nil {\n\t\treturn err\n\t}\n\tif err := s.AddGeneratedConversionFunc((*StackList)(nil), (*v1beta2.StackList)(nil), func(a, b interface{}, scope conversion.Scope) error {\n\t\treturn Convert_v1alpha3_StackList_To_v1beta2_StackList(a.(*StackList), b.(*v1beta2.StackList), scope)\n\t}); err != nil {\n\t\treturn err\n\t}\n\tif err := s.AddGeneratedConversionFunc((*v1beta2.StackList)(nil), (*StackList)(nil), func(a, b interface{}, scope conversion.Scope) error {\n\t\treturn Convert_v1beta2_StackList_To_v1alpha3_StackList(a.(*v1beta2.StackList), b.(*StackList), scope)\n\t}); err != nil {\n\t\treturn err\n\t}\n\tif err := s.AddGeneratedConversionFunc((*StackSpec)(nil), (*v1beta2.StackSpec)(nil), func(a, b interface{}, scope conversion.Scope) error {\n\t\treturn Convert_v1alpha3_StackSpec_To_v1beta2_StackSpec(a.(*StackSpec), b.(*v1beta2.StackSpec), scope)\n\t}); err != nil {\n\t\treturn err\n\t}\n\tif err := s.AddGeneratedConversionFunc((*v1beta2.StackSpec)(nil), (*StackSpec)(nil), func(a, b interface{}, scope conversion.Scope) error {\n\t\treturn Convert_v1beta2_StackSpec_To_v1alpha3_StackSpec(a.(*v1beta2.StackSpec), b.(*StackSpec), scope)\n\t}); err != nil {\n\t\treturn err\n\t}\n\tif err := s.AddGeneratedConversionFunc((*StackStatus)(nil), (*v1beta2.StackStatus)(nil), func(a, b interface{}, scope conversion.Scope) error {\n\t\treturn Convert_v1alpha3_StackStatus_To_v1beta2_StackStatus(a.(*StackStatus), b.(*v1beta2.StackStatus), scope)\n\t}); err != nil {\n\t\treturn err\n\t}\n\tif err := s.AddGeneratedConversionFunc((*v1beta2.StackStatus)(nil), (*StackStatus)(nil), func(a, b interface{}, scope conversion.Scope) error {\n\t\treturn Convert_v1beta2_StackStatus_To_v1alpha3_StackStatus(a.(*v1beta2.StackStatus), b.(*StackStatus), scope)\n\t}); err != nil {\n\t\treturn err\n\t}\n\tif err := s.AddGeneratedConversionFunc((*UpdateConfig)(nil), (*v1beta2.UpdateConfig)(nil), func(a, b interface{}, scope conversion.Scope) error {\n\t\treturn Convert_v1alpha3_UpdateConfig_To_v1beta2_UpdateConfig(a.(*UpdateConfig), b.(*v1beta2.UpdateConfig), scope)\n\t}); err != nil {\n\t\treturn err\n\t}\n\tif err := s.AddGeneratedConversionFunc((*v1beta2.UpdateConfig)(nil), (*UpdateConfig)(nil), func(a, b interface{}, scope conversion.Scope) error {\n\t\treturn Convert_v1beta2_UpdateConfig_To_v1alpha3_UpdateConfig(a.(*v1beta2.UpdateConfig), b.(*UpdateConfig), scope)\n\t}); err != nil {\n\t\treturn err\n\t}\n\treturn nil\n}", "title": "" }, { "docid": "6fc6798d99e178f401bc3600f5818691", "score": "0.70254254", "text": "func RegisterConversions(scheme *runtime.Scheme) error {\n\treturn scheme.AddGeneratedConversionFuncs(\n\t\tConvert_v1alpha1_AuthInfo_To_clusterregistry_AuthInfo,\n\t\tConvert_clusterregistry_AuthInfo_To_v1alpha1_AuthInfo,\n\t\tConvert_v1alpha1_AuthProviderConfig_To_clusterregistry_AuthProviderConfig,\n\t\tConvert_clusterregistry_AuthProviderConfig_To_v1alpha1_AuthProviderConfig,\n\t\tConvert_v1alpha1_AuthProviderType_To_clusterregistry_AuthProviderType,\n\t\tConvert_clusterregistry_AuthProviderType_To_v1alpha1_AuthProviderType,\n\t\tConvert_v1alpha1_CloudProvider_To_clusterregistry_CloudProvider,\n\t\tConvert_clusterregistry_CloudProvider_To_v1alpha1_CloudProvider,\n\t\tConvert_v1alpha1_Cluster_To_clusterregistry_Cluster,\n\t\tConvert_clusterregistry_Cluster_To_v1alpha1_Cluster,\n\t\tConvert_v1alpha1_ClusterList_To_clusterregistry_ClusterList,\n\t\tConvert_clusterregistry_ClusterList_To_v1alpha1_ClusterList,\n\t\tConvert_v1alpha1_ClusterSpec_To_clusterregistry_ClusterSpec,\n\t\tConvert_clusterregistry_ClusterSpec_To_v1alpha1_ClusterSpec,\n\t\tConvert_v1alpha1_ClusterStatus_To_clusterregistry_ClusterStatus,\n\t\tConvert_clusterregistry_ClusterStatus_To_v1alpha1_ClusterStatus,\n\t\tConvert_v1alpha1_KubernetesAPIEndpoints_To_clusterregistry_KubernetesAPIEndpoints,\n\t\tConvert_clusterregistry_KubernetesAPIEndpoints_To_v1alpha1_KubernetesAPIEndpoints,\n\t\tConvert_v1alpha1_ServerAddressByClientCIDR_To_clusterregistry_ServerAddressByClientCIDR,\n\t\tConvert_clusterregistry_ServerAddressByClientCIDR_To_v1alpha1_ServerAddressByClientCIDR,\n\t)\n}", "title": "" }, { "docid": "cb7edb7a37875e689d80ec0bec7ba44b", "score": "0.7016825", "text": "func RegisterConversions(s *runtime.Scheme) error {\n\tif err := s.AddGeneratedConversionFunc((*PacketCluster)(nil), (*v1beta1.PacketCluster)(nil), func(a, b interface{}, scope conversion.Scope) error {\n\t\treturn Convert_v1alpha3_PacketCluster_To_v1beta1_PacketCluster(a.(*PacketCluster), b.(*v1beta1.PacketCluster), scope)\n\t}); err != nil {\n\t\treturn err\n\t}\n\tif err := s.AddGeneratedConversionFunc((*v1beta1.PacketCluster)(nil), (*PacketCluster)(nil), func(a, b interface{}, scope conversion.Scope) error {\n\t\treturn Convert_v1beta1_PacketCluster_To_v1alpha3_PacketCluster(a.(*v1beta1.PacketCluster), b.(*PacketCluster), scope)\n\t}); err != nil {\n\t\treturn err\n\t}\n\tif err := s.AddGeneratedConversionFunc((*PacketClusterList)(nil), (*v1beta1.PacketClusterList)(nil), func(a, b interface{}, scope conversion.Scope) error {\n\t\treturn Convert_v1alpha3_PacketClusterList_To_v1beta1_PacketClusterList(a.(*PacketClusterList), b.(*v1beta1.PacketClusterList), scope)\n\t}); err != nil {\n\t\treturn err\n\t}\n\tif err := s.AddGeneratedConversionFunc((*v1beta1.PacketClusterList)(nil), (*PacketClusterList)(nil), func(a, b interface{}, scope conversion.Scope) error {\n\t\treturn Convert_v1beta1_PacketClusterList_To_v1alpha3_PacketClusterList(a.(*v1beta1.PacketClusterList), b.(*PacketClusterList), scope)\n\t}); err != nil {\n\t\treturn err\n\t}\n\tif err := s.AddGeneratedConversionFunc((*PacketClusterSpec)(nil), (*v1beta1.PacketClusterSpec)(nil), func(a, b interface{}, scope conversion.Scope) error {\n\t\treturn Convert_v1alpha3_PacketClusterSpec_To_v1beta1_PacketClusterSpec(a.(*PacketClusterSpec), b.(*v1beta1.PacketClusterSpec), scope)\n\t}); err != nil {\n\t\treturn err\n\t}\n\tif err := s.AddGeneratedConversionFunc((*v1beta1.PacketClusterSpec)(nil), (*PacketClusterSpec)(nil), func(a, b interface{}, scope conversion.Scope) error {\n\t\treturn Convert_v1beta1_PacketClusterSpec_To_v1alpha3_PacketClusterSpec(a.(*v1beta1.PacketClusterSpec), b.(*PacketClusterSpec), scope)\n\t}); err != nil {\n\t\treturn err\n\t}\n\tif err := s.AddGeneratedConversionFunc((*PacketClusterStatus)(nil), (*v1beta1.PacketClusterStatus)(nil), func(a, b interface{}, scope conversion.Scope) error {\n\t\treturn Convert_v1alpha3_PacketClusterStatus_To_v1beta1_PacketClusterStatus(a.(*PacketClusterStatus), b.(*v1beta1.PacketClusterStatus), scope)\n\t}); err != nil {\n\t\treturn err\n\t}\n\tif err := s.AddGeneratedConversionFunc((*PacketMachine)(nil), (*v1beta1.PacketMachine)(nil), func(a, b interface{}, scope conversion.Scope) error {\n\t\treturn Convert_v1alpha3_PacketMachine_To_v1beta1_PacketMachine(a.(*PacketMachine), b.(*v1beta1.PacketMachine), scope)\n\t}); err != nil {\n\t\treturn err\n\t}\n\tif err := s.AddGeneratedConversionFunc((*v1beta1.PacketMachine)(nil), (*PacketMachine)(nil), func(a, b interface{}, scope conversion.Scope) error {\n\t\treturn Convert_v1beta1_PacketMachine_To_v1alpha3_PacketMachine(a.(*v1beta1.PacketMachine), b.(*PacketMachine), scope)\n\t}); err != nil {\n\t\treturn err\n\t}\n\tif err := s.AddGeneratedConversionFunc((*PacketMachineList)(nil), (*v1beta1.PacketMachineList)(nil), func(a, b interface{}, scope conversion.Scope) error {\n\t\treturn Convert_v1alpha3_PacketMachineList_To_v1beta1_PacketMachineList(a.(*PacketMachineList), b.(*v1beta1.PacketMachineList), scope)\n\t}); err != nil {\n\t\treturn err\n\t}\n\tif err := s.AddGeneratedConversionFunc((*v1beta1.PacketMachineList)(nil), (*PacketMachineList)(nil), func(a, b interface{}, scope conversion.Scope) error {\n\t\treturn Convert_v1beta1_PacketMachineList_To_v1alpha3_PacketMachineList(a.(*v1beta1.PacketMachineList), b.(*PacketMachineList), scope)\n\t}); err != nil {\n\t\treturn err\n\t}\n\tif err := s.AddGeneratedConversionFunc((*PacketMachineTemplate)(nil), (*v1beta1.PacketMachineTemplate)(nil), func(a, b interface{}, scope conversion.Scope) error {\n\t\treturn Convert_v1alpha3_PacketMachineTemplate_To_v1beta1_PacketMachineTemplate(a.(*PacketMachineTemplate), b.(*v1beta1.PacketMachineTemplate), scope)\n\t}); err != nil {\n\t\treturn err\n\t}\n\tif err := s.AddGeneratedConversionFunc((*v1beta1.PacketMachineTemplate)(nil), (*PacketMachineTemplate)(nil), func(a, b interface{}, scope conversion.Scope) error {\n\t\treturn Convert_v1beta1_PacketMachineTemplate_To_v1alpha3_PacketMachineTemplate(a.(*v1beta1.PacketMachineTemplate), b.(*PacketMachineTemplate), scope)\n\t}); err != nil {\n\t\treturn err\n\t}\n\tif err := s.AddGeneratedConversionFunc((*PacketMachineTemplateList)(nil), (*v1beta1.PacketMachineTemplateList)(nil), func(a, b interface{}, scope conversion.Scope) error {\n\t\treturn Convert_v1alpha3_PacketMachineTemplateList_To_v1beta1_PacketMachineTemplateList(a.(*PacketMachineTemplateList), b.(*v1beta1.PacketMachineTemplateList), scope)\n\t}); err != nil {\n\t\treturn err\n\t}\n\tif err := s.AddGeneratedConversionFunc((*v1beta1.PacketMachineTemplateList)(nil), (*PacketMachineTemplateList)(nil), func(a, b interface{}, scope conversion.Scope) error {\n\t\treturn Convert_v1beta1_PacketMachineTemplateList_To_v1alpha3_PacketMachineTemplateList(a.(*v1beta1.PacketMachineTemplateList), b.(*PacketMachineTemplateList), scope)\n\t}); err != nil {\n\t\treturn err\n\t}\n\tif err := s.AddGeneratedConversionFunc((*PacketMachineTemplateResource)(nil), (*v1beta1.PacketMachineTemplateResource)(nil), func(a, b interface{}, scope conversion.Scope) error {\n\t\treturn Convert_v1alpha3_PacketMachineTemplateResource_To_v1beta1_PacketMachineTemplateResource(a.(*PacketMachineTemplateResource), b.(*v1beta1.PacketMachineTemplateResource), scope)\n\t}); err != nil {\n\t\treturn err\n\t}\n\tif err := s.AddGeneratedConversionFunc((*v1beta1.PacketMachineTemplateResource)(nil), (*PacketMachineTemplateResource)(nil), func(a, b interface{}, scope conversion.Scope) error {\n\t\treturn Convert_v1beta1_PacketMachineTemplateResource_To_v1alpha3_PacketMachineTemplateResource(a.(*v1beta1.PacketMachineTemplateResource), b.(*PacketMachineTemplateResource), scope)\n\t}); err != nil {\n\t\treturn err\n\t}\n\tif err := s.AddGeneratedConversionFunc((*PacketMachineTemplateSpec)(nil), (*v1beta1.PacketMachineTemplateSpec)(nil), func(a, b interface{}, scope conversion.Scope) error {\n\t\treturn Convert_v1alpha3_PacketMachineTemplateSpec_To_v1beta1_PacketMachineTemplateSpec(a.(*PacketMachineTemplateSpec), b.(*v1beta1.PacketMachineTemplateSpec), scope)\n\t}); err != nil {\n\t\treturn err\n\t}\n\tif err := s.AddGeneratedConversionFunc((*v1beta1.PacketMachineTemplateSpec)(nil), (*PacketMachineTemplateSpec)(nil), func(a, b interface{}, scope conversion.Scope) error {\n\t\treturn Convert_v1beta1_PacketMachineTemplateSpec_To_v1alpha3_PacketMachineTemplateSpec(a.(*v1beta1.PacketMachineTemplateSpec), b.(*PacketMachineTemplateSpec), scope)\n\t}); err != nil {\n\t\treturn err\n\t}\n\tif err := s.AddConversionFunc((*PacketMachineSpec)(nil), (*v1beta1.PacketMachineSpec)(nil), func(a, b interface{}, scope conversion.Scope) error {\n\t\treturn Convert_v1alpha3_PacketMachineSpec_To_v1beta1_PacketMachineSpec(a.(*PacketMachineSpec), b.(*v1beta1.PacketMachineSpec), scope)\n\t}); err != nil {\n\t\treturn err\n\t}\n\tif err := s.AddConversionFunc((*PacketMachineStatus)(nil), (*v1beta1.PacketMachineStatus)(nil), func(a, b interface{}, scope conversion.Scope) error {\n\t\treturn Convert_v1alpha3_PacketMachineStatus_To_v1beta1_PacketMachineStatus(a.(*PacketMachineStatus), b.(*v1beta1.PacketMachineStatus), scope)\n\t}); err != nil {\n\t\treturn err\n\t}\n\tif err := s.AddConversionFunc((*v1beta1.PacketClusterStatus)(nil), (*PacketClusterStatus)(nil), func(a, b interface{}, scope conversion.Scope) error {\n\t\treturn Convert_v1beta1_PacketClusterStatus_To_v1alpha3_PacketClusterStatus(a.(*v1beta1.PacketClusterStatus), b.(*PacketClusterStatus), scope)\n\t}); err != nil {\n\t\treturn err\n\t}\n\tif err := s.AddConversionFunc((*v1beta1.PacketMachineSpec)(nil), (*PacketMachineSpec)(nil), func(a, b interface{}, scope conversion.Scope) error {\n\t\treturn Convert_v1beta1_PacketMachineSpec_To_v1alpha3_PacketMachineSpec(a.(*v1beta1.PacketMachineSpec), b.(*PacketMachineSpec), scope)\n\t}); err != nil {\n\t\treturn err\n\t}\n\tif err := s.AddConversionFunc((*v1beta1.PacketMachineStatus)(nil), (*PacketMachineStatus)(nil), func(a, b interface{}, scope conversion.Scope) error {\n\t\treturn Convert_v1beta1_PacketMachineStatus_To_v1alpha3_PacketMachineStatus(a.(*v1beta1.PacketMachineStatus), b.(*PacketMachineStatus), scope)\n\t}); err != nil {\n\t\treturn err\n\t}\n\treturn nil\n}", "title": "" }, { "docid": "020533123370f69cfb9ddce068436bec", "score": "0.69873726", "text": "func RegisterConversions(s *runtime.Scheme) error {\n\tif err := s.AddGeneratedConversionFunc((*v1alpha1.Initializer)(nil), (*admissionregistration.Initializer)(nil), func(a, b interface{}, scope conversion.Scope) error {\n\t\treturn Convert_v1alpha1_Initializer_To_admissionregistration_Initializer(a.(*v1alpha1.Initializer), b.(*admissionregistration.Initializer), scope)\n\t}); err != nil {\n\t\treturn err\n\t}\n\tif err := s.AddGeneratedConversionFunc((*admissionregistration.Initializer)(nil), (*v1alpha1.Initializer)(nil), func(a, b interface{}, scope conversion.Scope) error {\n\t\treturn Convert_admissionregistration_Initializer_To_v1alpha1_Initializer(a.(*admissionregistration.Initializer), b.(*v1alpha1.Initializer), scope)\n\t}); err != nil {\n\t\treturn err\n\t}\n\tif err := s.AddGeneratedConversionFunc((*v1alpha1.InitializerConfiguration)(nil), (*admissionregistration.InitializerConfiguration)(nil), func(a, b interface{}, scope conversion.Scope) error {\n\t\treturn Convert_v1alpha1_InitializerConfiguration_To_admissionregistration_InitializerConfiguration(a.(*v1alpha1.InitializerConfiguration), b.(*admissionregistration.InitializerConfiguration), scope)\n\t}); err != nil {\n\t\treturn err\n\t}\n\tif err := s.AddGeneratedConversionFunc((*admissionregistration.InitializerConfiguration)(nil), (*v1alpha1.InitializerConfiguration)(nil), func(a, b interface{}, scope conversion.Scope) error {\n\t\treturn Convert_admissionregistration_InitializerConfiguration_To_v1alpha1_InitializerConfiguration(a.(*admissionregistration.InitializerConfiguration), b.(*v1alpha1.InitializerConfiguration), scope)\n\t}); err != nil {\n\t\treturn err\n\t}\n\tif err := s.AddGeneratedConversionFunc((*v1alpha1.InitializerConfigurationList)(nil), (*admissionregistration.InitializerConfigurationList)(nil), func(a, b interface{}, scope conversion.Scope) error {\n\t\treturn Convert_v1alpha1_InitializerConfigurationList_To_admissionregistration_InitializerConfigurationList(a.(*v1alpha1.InitializerConfigurationList), b.(*admissionregistration.InitializerConfigurationList), scope)\n\t}); err != nil {\n\t\treturn err\n\t}\n\tif err := s.AddGeneratedConversionFunc((*admissionregistration.InitializerConfigurationList)(nil), (*v1alpha1.InitializerConfigurationList)(nil), func(a, b interface{}, scope conversion.Scope) error {\n\t\treturn Convert_admissionregistration_InitializerConfigurationList_To_v1alpha1_InitializerConfigurationList(a.(*admissionregistration.InitializerConfigurationList), b.(*v1alpha1.InitializerConfigurationList), scope)\n\t}); err != nil {\n\t\treturn err\n\t}\n\tif err := s.AddGeneratedConversionFunc((*v1alpha1.Rule)(nil), (*admissionregistration.Rule)(nil), func(a, b interface{}, scope conversion.Scope) error {\n\t\treturn Convert_v1alpha1_Rule_To_admissionregistration_Rule(a.(*v1alpha1.Rule), b.(*admissionregistration.Rule), scope)\n\t}); err != nil {\n\t\treturn err\n\t}\n\tif err := s.AddGeneratedConversionFunc((*admissionregistration.Rule)(nil), (*v1alpha1.Rule)(nil), func(a, b interface{}, scope conversion.Scope) error {\n\t\treturn Convert_admissionregistration_Rule_To_v1alpha1_Rule(a.(*admissionregistration.Rule), b.(*v1alpha1.Rule), scope)\n\t}); err != nil {\n\t\treturn err\n\t}\n\treturn nil\n}", "title": "" }, { "docid": "1b832b41a19ff85166dab221021bd07d", "score": "0.69621164", "text": "func RegisterConversions(s *runtime.Scheme) error {\n\tif err := s.AddGeneratedConversionFunc((*v1alpha1.ClusterCIDR)(nil), (*networking.ClusterCIDR)(nil), func(a, b interface{}, scope conversion.Scope) error {\n\t\treturn Convert_v1alpha1_ClusterCIDR_To_networking_ClusterCIDR(a.(*v1alpha1.ClusterCIDR), b.(*networking.ClusterCIDR), scope)\n\t}); err != nil {\n\t\treturn err\n\t}\n\tif err := s.AddGeneratedConversionFunc((*networking.ClusterCIDR)(nil), (*v1alpha1.ClusterCIDR)(nil), func(a, b interface{}, scope conversion.Scope) error {\n\t\treturn Convert_networking_ClusterCIDR_To_v1alpha1_ClusterCIDR(a.(*networking.ClusterCIDR), b.(*v1alpha1.ClusterCIDR), scope)\n\t}); err != nil {\n\t\treturn err\n\t}\n\tif err := s.AddGeneratedConversionFunc((*v1alpha1.ClusterCIDRList)(nil), (*networking.ClusterCIDRList)(nil), func(a, b interface{}, scope conversion.Scope) error {\n\t\treturn Convert_v1alpha1_ClusterCIDRList_To_networking_ClusterCIDRList(a.(*v1alpha1.ClusterCIDRList), b.(*networking.ClusterCIDRList), scope)\n\t}); err != nil {\n\t\treturn err\n\t}\n\tif err := s.AddGeneratedConversionFunc((*networking.ClusterCIDRList)(nil), (*v1alpha1.ClusterCIDRList)(nil), func(a, b interface{}, scope conversion.Scope) error {\n\t\treturn Convert_networking_ClusterCIDRList_To_v1alpha1_ClusterCIDRList(a.(*networking.ClusterCIDRList), b.(*v1alpha1.ClusterCIDRList), scope)\n\t}); err != nil {\n\t\treturn err\n\t}\n\tif err := s.AddGeneratedConversionFunc((*v1alpha1.ClusterCIDRSpec)(nil), (*networking.ClusterCIDRSpec)(nil), func(a, b interface{}, scope conversion.Scope) error {\n\t\treturn Convert_v1alpha1_ClusterCIDRSpec_To_networking_ClusterCIDRSpec(a.(*v1alpha1.ClusterCIDRSpec), b.(*networking.ClusterCIDRSpec), scope)\n\t}); err != nil {\n\t\treturn err\n\t}\n\tif err := s.AddGeneratedConversionFunc((*networking.ClusterCIDRSpec)(nil), (*v1alpha1.ClusterCIDRSpec)(nil), func(a, b interface{}, scope conversion.Scope) error {\n\t\treturn Convert_networking_ClusterCIDRSpec_To_v1alpha1_ClusterCIDRSpec(a.(*networking.ClusterCIDRSpec), b.(*v1alpha1.ClusterCIDRSpec), scope)\n\t}); err != nil {\n\t\treturn err\n\t}\n\tif err := s.AddGeneratedConversionFunc((*v1alpha1.IPAddress)(nil), (*networking.IPAddress)(nil), func(a, b interface{}, scope conversion.Scope) error {\n\t\treturn Convert_v1alpha1_IPAddress_To_networking_IPAddress(a.(*v1alpha1.IPAddress), b.(*networking.IPAddress), scope)\n\t}); err != nil {\n\t\treturn err\n\t}\n\tif err := s.AddGeneratedConversionFunc((*networking.IPAddress)(nil), (*v1alpha1.IPAddress)(nil), func(a, b interface{}, scope conversion.Scope) error {\n\t\treturn Convert_networking_IPAddress_To_v1alpha1_IPAddress(a.(*networking.IPAddress), b.(*v1alpha1.IPAddress), scope)\n\t}); err != nil {\n\t\treturn err\n\t}\n\tif err := s.AddGeneratedConversionFunc((*v1alpha1.IPAddressList)(nil), (*networking.IPAddressList)(nil), func(a, b interface{}, scope conversion.Scope) error {\n\t\treturn Convert_v1alpha1_IPAddressList_To_networking_IPAddressList(a.(*v1alpha1.IPAddressList), b.(*networking.IPAddressList), scope)\n\t}); err != nil {\n\t\treturn err\n\t}\n\tif err := s.AddGeneratedConversionFunc((*networking.IPAddressList)(nil), (*v1alpha1.IPAddressList)(nil), func(a, b interface{}, scope conversion.Scope) error {\n\t\treturn Convert_networking_IPAddressList_To_v1alpha1_IPAddressList(a.(*networking.IPAddressList), b.(*v1alpha1.IPAddressList), scope)\n\t}); err != nil {\n\t\treturn err\n\t}\n\tif err := s.AddGeneratedConversionFunc((*v1alpha1.IPAddressSpec)(nil), (*networking.IPAddressSpec)(nil), func(a, b interface{}, scope conversion.Scope) error {\n\t\treturn Convert_v1alpha1_IPAddressSpec_To_networking_IPAddressSpec(a.(*v1alpha1.IPAddressSpec), b.(*networking.IPAddressSpec), scope)\n\t}); err != nil {\n\t\treturn err\n\t}\n\tif err := s.AddGeneratedConversionFunc((*networking.IPAddressSpec)(nil), (*v1alpha1.IPAddressSpec)(nil), func(a, b interface{}, scope conversion.Scope) error {\n\t\treturn Convert_networking_IPAddressSpec_To_v1alpha1_IPAddressSpec(a.(*networking.IPAddressSpec), b.(*v1alpha1.IPAddressSpec), scope)\n\t}); err != nil {\n\t\treturn err\n\t}\n\tif err := s.AddGeneratedConversionFunc((*v1alpha1.ParentReference)(nil), (*networking.ParentReference)(nil), func(a, b interface{}, scope conversion.Scope) error {\n\t\treturn Convert_v1alpha1_ParentReference_To_networking_ParentReference(a.(*v1alpha1.ParentReference), b.(*networking.ParentReference), scope)\n\t}); err != nil {\n\t\treturn err\n\t}\n\tif err := s.AddGeneratedConversionFunc((*networking.ParentReference)(nil), (*v1alpha1.ParentReference)(nil), func(a, b interface{}, scope conversion.Scope) error {\n\t\treturn Convert_networking_ParentReference_To_v1alpha1_ParentReference(a.(*networking.ParentReference), b.(*v1alpha1.ParentReference), scope)\n\t}); err != nil {\n\t\treturn err\n\t}\n\treturn nil\n}", "title": "" }, { "docid": "96e2bd8bd7d449104f17d3f10d443d7c", "score": "0.6952675", "text": "func RegisterConversions(s *runtime.Scheme) error {\n\tif err := s.AddGeneratedConversionFunc((*v1beta2.Scale)(nil), (*scheme.Scale)(nil), func(a, b interface{}, scope conversion.Scope) error {\n\t\treturn Convert_v1beta2_Scale_To_scheme_Scale(a.(*v1beta2.Scale), b.(*scheme.Scale), scope)\n\t}); err != nil {\n\t\treturn err\n\t}\n\tif err := s.AddGeneratedConversionFunc((*scheme.Scale)(nil), (*v1beta2.Scale)(nil), func(a, b interface{}, scope conversion.Scope) error {\n\t\treturn Convert_scheme_Scale_To_v1beta2_Scale(a.(*scheme.Scale), b.(*v1beta2.Scale), scope)\n\t}); err != nil {\n\t\treturn err\n\t}\n\tif err := s.AddGeneratedConversionFunc((*v1beta2.ScaleSpec)(nil), (*scheme.ScaleSpec)(nil), func(a, b interface{}, scope conversion.Scope) error {\n\t\treturn Convert_v1beta2_ScaleSpec_To_scheme_ScaleSpec(a.(*v1beta2.ScaleSpec), b.(*scheme.ScaleSpec), scope)\n\t}); err != nil {\n\t\treturn err\n\t}\n\tif err := s.AddGeneratedConversionFunc((*scheme.ScaleSpec)(nil), (*v1beta2.ScaleSpec)(nil), func(a, b interface{}, scope conversion.Scope) error {\n\t\treturn Convert_scheme_ScaleSpec_To_v1beta2_ScaleSpec(a.(*scheme.ScaleSpec), b.(*v1beta2.ScaleSpec), scope)\n\t}); err != nil {\n\t\treturn err\n\t}\n\tif err := s.AddConversionFunc((*scheme.ScaleStatus)(nil), (*v1beta2.ScaleStatus)(nil), func(a, b interface{}, scope conversion.Scope) error {\n\t\treturn Convert_scheme_ScaleStatus_To_v1beta2_ScaleStatus(a.(*scheme.ScaleStatus), b.(*v1beta2.ScaleStatus), scope)\n\t}); err != nil {\n\t\treturn err\n\t}\n\tif err := s.AddConversionFunc((*v1beta2.ScaleStatus)(nil), (*scheme.ScaleStatus)(nil), func(a, b interface{}, scope conversion.Scope) error {\n\t\treturn Convert_v1beta2_ScaleStatus_To_scheme_ScaleStatus(a.(*v1beta2.ScaleStatus), b.(*scheme.ScaleStatus), scope)\n\t}); err != nil {\n\t\treturn err\n\t}\n\treturn nil\n}", "title": "" }, { "docid": "e70b22dc59349f39307ed4b904cced86", "score": "0.6947119", "text": "func RegisterConversions(s *runtime.Scheme) error {\n\tif err := s.AddGeneratedConversionFunc((*PodSecurityConfiguration)(nil), (*api.PodSecurityConfiguration)(nil), func(a, b interface{}, scope conversion.Scope) error {\n\t\treturn Convert_v1alpha1_PodSecurityConfiguration_To_api_PodSecurityConfiguration(a.(*PodSecurityConfiguration), b.(*api.PodSecurityConfiguration), scope)\n\t}); err != nil {\n\t\treturn err\n\t}\n\tif err := s.AddGeneratedConversionFunc((*api.PodSecurityConfiguration)(nil), (*PodSecurityConfiguration)(nil), func(a, b interface{}, scope conversion.Scope) error {\n\t\treturn Convert_api_PodSecurityConfiguration_To_v1alpha1_PodSecurityConfiguration(a.(*api.PodSecurityConfiguration), b.(*PodSecurityConfiguration), scope)\n\t}); err != nil {\n\t\treturn err\n\t}\n\tif err := s.AddGeneratedConversionFunc((*PodSecurityDefaults)(nil), (*api.PodSecurityDefaults)(nil), func(a, b interface{}, scope conversion.Scope) error {\n\t\treturn Convert_v1alpha1_PodSecurityDefaults_To_api_PodSecurityDefaults(a.(*PodSecurityDefaults), b.(*api.PodSecurityDefaults), scope)\n\t}); err != nil {\n\t\treturn err\n\t}\n\tif err := s.AddGeneratedConversionFunc((*api.PodSecurityDefaults)(nil), (*PodSecurityDefaults)(nil), func(a, b interface{}, scope conversion.Scope) error {\n\t\treturn Convert_api_PodSecurityDefaults_To_v1alpha1_PodSecurityDefaults(a.(*api.PodSecurityDefaults), b.(*PodSecurityDefaults), scope)\n\t}); err != nil {\n\t\treturn err\n\t}\n\tif err := s.AddGeneratedConversionFunc((*PodSecurityExemptions)(nil), (*api.PodSecurityExemptions)(nil), func(a, b interface{}, scope conversion.Scope) error {\n\t\treturn Convert_v1alpha1_PodSecurityExemptions_To_api_PodSecurityExemptions(a.(*PodSecurityExemptions), b.(*api.PodSecurityExemptions), scope)\n\t}); err != nil {\n\t\treturn err\n\t}\n\tif err := s.AddGeneratedConversionFunc((*api.PodSecurityExemptions)(nil), (*PodSecurityExemptions)(nil), func(a, b interface{}, scope conversion.Scope) error {\n\t\treturn Convert_api_PodSecurityExemptions_To_v1alpha1_PodSecurityExemptions(a.(*api.PodSecurityExemptions), b.(*PodSecurityExemptions), scope)\n\t}); err != nil {\n\t\treturn err\n\t}\n\treturn nil\n}", "title": "" }, { "docid": "ce3006856519189285d3a33423c86bf6", "score": "0.6946372", "text": "func RegisterConversions(s *runtime.Scheme) error {\n\tif err := s.AddGeneratedConversionFunc((*Configuration)(nil), (*resourcequota.Configuration)(nil), func(a, b interface{}, scope conversion.Scope) error {\n\t\treturn Convert_v1beta1_Configuration_To_resourcequota_Configuration(a.(*Configuration), b.(*resourcequota.Configuration), scope)\n\t}); err != nil {\n\t\treturn err\n\t}\n\tif err := s.AddGeneratedConversionFunc((*resourcequota.Configuration)(nil), (*Configuration)(nil), func(a, b interface{}, scope conversion.Scope) error {\n\t\treturn Convert_resourcequota_Configuration_To_v1beta1_Configuration(a.(*resourcequota.Configuration), b.(*Configuration), scope)\n\t}); err != nil {\n\t\treturn err\n\t}\n\tif err := s.AddGeneratedConversionFunc((*LimitedResource)(nil), (*resourcequota.LimitedResource)(nil), func(a, b interface{}, scope conversion.Scope) error {\n\t\treturn Convert_v1beta1_LimitedResource_To_resourcequota_LimitedResource(a.(*LimitedResource), b.(*resourcequota.LimitedResource), scope)\n\t}); err != nil {\n\t\treturn err\n\t}\n\tif err := s.AddGeneratedConversionFunc((*resourcequota.LimitedResource)(nil), (*LimitedResource)(nil), func(a, b interface{}, scope conversion.Scope) error {\n\t\treturn Convert_resourcequota_LimitedResource_To_v1beta1_LimitedResource(a.(*resourcequota.LimitedResource), b.(*LimitedResource), scope)\n\t}); err != nil {\n\t\treturn err\n\t}\n\treturn nil\n}", "title": "" }, { "docid": "8cbb2b603c9029da94ca08db579b9d85", "score": "0.69148815", "text": "func RegisterConversions(s *runtime.Scheme) error {\n\tif err := s.AddGeneratedConversionFunc((*Configuration)(nil), (*eventratelimit.Configuration)(nil), func(a, b interface{}, scope conversion.Scope) error {\n\t\treturn Convert_v1alpha1_Configuration_To_eventratelimit_Configuration(a.(*Configuration), b.(*eventratelimit.Configuration), scope)\n\t}); err != nil {\n\t\treturn err\n\t}\n\tif err := s.AddGeneratedConversionFunc((*eventratelimit.Configuration)(nil), (*Configuration)(nil), func(a, b interface{}, scope conversion.Scope) error {\n\t\treturn Convert_eventratelimit_Configuration_To_v1alpha1_Configuration(a.(*eventratelimit.Configuration), b.(*Configuration), scope)\n\t}); err != nil {\n\t\treturn err\n\t}\n\tif err := s.AddGeneratedConversionFunc((*Limit)(nil), (*eventratelimit.Limit)(nil), func(a, b interface{}, scope conversion.Scope) error {\n\t\treturn Convert_v1alpha1_Limit_To_eventratelimit_Limit(a.(*Limit), b.(*eventratelimit.Limit), scope)\n\t}); err != nil {\n\t\treturn err\n\t}\n\tif err := s.AddGeneratedConversionFunc((*eventratelimit.Limit)(nil), (*Limit)(nil), func(a, b interface{}, scope conversion.Scope) error {\n\t\treturn Convert_eventratelimit_Limit_To_v1alpha1_Limit(a.(*eventratelimit.Limit), b.(*Limit), scope)\n\t}); err != nil {\n\t\treturn err\n\t}\n\treturn nil\n}", "title": "" }, { "docid": "0bc74dd35cd4d5c586da4b30b34f93f9", "score": "0.6914856", "text": "func RegisterConversions(s *runtime.Scheme) error {\n\tif err := s.AddGeneratedConversionFunc((*CritConfig)(nil), (*v1alpha2.CritConfig)(nil), func(a, b interface{}, scope conversion.Scope) error {\n\t\treturn Convert_v1alpha1_CritConfig_To_v1alpha2_CritConfig(a.(*CritConfig), b.(*v1alpha2.CritConfig), scope)\n\t}); err != nil {\n\t\treturn err\n\t}\n\tif err := s.AddGeneratedConversionFunc((*v1alpha2.CritConfig)(nil), (*CritConfig)(nil), func(a, b interface{}, scope conversion.Scope) error {\n\t\treturn Convert_v1alpha2_CritConfig_To_v1alpha1_CritConfig(a.(*v1alpha2.CritConfig), b.(*CritConfig), scope)\n\t}); err != nil {\n\t\treturn err\n\t}\n\tif err := s.AddGeneratedConversionFunc((*CritConfigList)(nil), (*v1alpha2.CritConfigList)(nil), func(a, b interface{}, scope conversion.Scope) error {\n\t\treturn Convert_v1alpha1_CritConfigList_To_v1alpha2_CritConfigList(a.(*CritConfigList), b.(*v1alpha2.CritConfigList), scope)\n\t}); err != nil {\n\t\treturn err\n\t}\n\tif err := s.AddGeneratedConversionFunc((*v1alpha2.CritConfigList)(nil), (*CritConfigList)(nil), func(a, b interface{}, scope conversion.Scope) error {\n\t\treturn Convert_v1alpha2_CritConfigList_To_v1alpha1_CritConfigList(a.(*v1alpha2.CritConfigList), b.(*CritConfigList), scope)\n\t}); err != nil {\n\t\treturn err\n\t}\n\tif err := s.AddGeneratedConversionFunc((*CritConfigStatus)(nil), (*v1alpha2.CritConfigStatus)(nil), func(a, b interface{}, scope conversion.Scope) error {\n\t\treturn Convert_v1alpha1_CritConfigStatus_To_v1alpha2_CritConfigStatus(a.(*CritConfigStatus), b.(*v1alpha2.CritConfigStatus), scope)\n\t}); err != nil {\n\t\treturn err\n\t}\n\tif err := s.AddGeneratedConversionFunc((*v1alpha2.CritConfigStatus)(nil), (*CritConfigStatus)(nil), func(a, b interface{}, scope conversion.Scope) error {\n\t\treturn Convert_v1alpha2_CritConfigStatus_To_v1alpha1_CritConfigStatus(a.(*v1alpha2.CritConfigStatus), b.(*CritConfigStatus), scope)\n\t}); err != nil {\n\t\treturn err\n\t}\n\tif err := s.AddGeneratedConversionFunc((*CritConfigTemplate)(nil), (*v1alpha2.CritConfigTemplate)(nil), func(a, b interface{}, scope conversion.Scope) error {\n\t\treturn Convert_v1alpha1_CritConfigTemplate_To_v1alpha2_CritConfigTemplate(a.(*CritConfigTemplate), b.(*v1alpha2.CritConfigTemplate), scope)\n\t}); err != nil {\n\t\treturn err\n\t}\n\tif err := s.AddGeneratedConversionFunc((*v1alpha2.CritConfigTemplate)(nil), (*CritConfigTemplate)(nil), func(a, b interface{}, scope conversion.Scope) error {\n\t\treturn Convert_v1alpha2_CritConfigTemplate_To_v1alpha1_CritConfigTemplate(a.(*v1alpha2.CritConfigTemplate), b.(*CritConfigTemplate), scope)\n\t}); err != nil {\n\t\treturn err\n\t}\n\tif err := s.AddGeneratedConversionFunc((*CritConfigTemplateList)(nil), (*v1alpha2.CritConfigTemplateList)(nil), func(a, b interface{}, scope conversion.Scope) error {\n\t\treturn Convert_v1alpha1_CritConfigTemplateList_To_v1alpha2_CritConfigTemplateList(a.(*CritConfigTemplateList), b.(*v1alpha2.CritConfigTemplateList), scope)\n\t}); err != nil {\n\t\treturn err\n\t}\n\tif err := s.AddGeneratedConversionFunc((*v1alpha2.CritConfigTemplateList)(nil), (*CritConfigTemplateList)(nil), func(a, b interface{}, scope conversion.Scope) error {\n\t\treturn Convert_v1alpha2_CritConfigTemplateList_To_v1alpha1_CritConfigTemplateList(a.(*v1alpha2.CritConfigTemplateList), b.(*CritConfigTemplateList), scope)\n\t}); err != nil {\n\t\treturn err\n\t}\n\tif err := s.AddGeneratedConversionFunc((*CritConfigTemplateResource)(nil), (*v1alpha2.CritConfigTemplateResource)(nil), func(a, b interface{}, scope conversion.Scope) error {\n\t\treturn Convert_v1alpha1_CritConfigTemplateResource_To_v1alpha2_CritConfigTemplateResource(a.(*CritConfigTemplateResource), b.(*v1alpha2.CritConfigTemplateResource), scope)\n\t}); err != nil {\n\t\treturn err\n\t}\n\tif err := s.AddGeneratedConversionFunc((*v1alpha2.CritConfigTemplateResource)(nil), (*CritConfigTemplateResource)(nil), func(a, b interface{}, scope conversion.Scope) error {\n\t\treturn Convert_v1alpha2_CritConfigTemplateResource_To_v1alpha1_CritConfigTemplateResource(a.(*v1alpha2.CritConfigTemplateResource), b.(*CritConfigTemplateResource), scope)\n\t}); err != nil {\n\t\treturn err\n\t}\n\tif err := s.AddGeneratedConversionFunc((*CritConfigTemplateSpec)(nil), (*v1alpha2.CritConfigTemplateSpec)(nil), func(a, b interface{}, scope conversion.Scope) error {\n\t\treturn Convert_v1alpha1_CritConfigTemplateSpec_To_v1alpha2_CritConfigTemplateSpec(a.(*CritConfigTemplateSpec), b.(*v1alpha2.CritConfigTemplateSpec), scope)\n\t}); err != nil {\n\t\treturn err\n\t}\n\tif err := s.AddGeneratedConversionFunc((*v1alpha2.CritConfigTemplateSpec)(nil), (*CritConfigTemplateSpec)(nil), func(a, b interface{}, scope conversion.Scope) error {\n\t\treturn Convert_v1alpha2_CritConfigTemplateSpec_To_v1alpha1_CritConfigTemplateSpec(a.(*v1alpha2.CritConfigTemplateSpec), b.(*CritConfigTemplateSpec), scope)\n\t}); err != nil {\n\t\treturn err\n\t}\n\tif err := s.AddGeneratedConversionFunc((*File)(nil), (*v1alpha2.File)(nil), func(a, b interface{}, scope conversion.Scope) error {\n\t\treturn Convert_v1alpha1_File_To_v1alpha2_File(a.(*File), b.(*v1alpha2.File), scope)\n\t}); err != nil {\n\t\treturn err\n\t}\n\tif err := s.AddGeneratedConversionFunc((*v1alpha2.File)(nil), (*File)(nil), func(a, b interface{}, scope conversion.Scope) error {\n\t\treturn Convert_v1alpha2_File_To_v1alpha1_File(a.(*v1alpha2.File), b.(*File), scope)\n\t}); err != nil {\n\t\treturn err\n\t}\n\tif err := s.AddGeneratedConversionFunc((*NTP)(nil), (*v1alpha2.NTP)(nil), func(a, b interface{}, scope conversion.Scope) error {\n\t\treturn Convert_v1alpha1_NTP_To_v1alpha2_NTP(a.(*NTP), b.(*v1alpha2.NTP), scope)\n\t}); err != nil {\n\t\treturn err\n\t}\n\tif err := s.AddGeneratedConversionFunc((*v1alpha2.NTP)(nil), (*NTP)(nil), func(a, b interface{}, scope conversion.Scope) error {\n\t\treturn Convert_v1alpha2_NTP_To_v1alpha1_NTP(a.(*v1alpha2.NTP), b.(*NTP), scope)\n\t}); err != nil {\n\t\treturn err\n\t}\n\tif err := s.AddGeneratedConversionFunc((*User)(nil), (*v1alpha2.User)(nil), func(a, b interface{}, scope conversion.Scope) error {\n\t\treturn Convert_v1alpha1_User_To_v1alpha2_User(a.(*User), b.(*v1alpha2.User), scope)\n\t}); err != nil {\n\t\treturn err\n\t}\n\tif err := s.AddGeneratedConversionFunc((*v1alpha2.User)(nil), (*User)(nil), func(a, b interface{}, scope conversion.Scope) error {\n\t\treturn Convert_v1alpha2_User_To_v1alpha1_User(a.(*v1alpha2.User), b.(*User), scope)\n\t}); err != nil {\n\t\treturn err\n\t}\n\tif err := s.AddConversionFunc((*CritConfigSpec)(nil), (*v1alpha2.CritConfigSpec)(nil), func(a, b interface{}, scope conversion.Scope) error {\n\t\treturn Convert_v1alpha1_CritConfigSpec_To_v1alpha2_CritConfigSpec(a.(*CritConfigSpec), b.(*v1alpha2.CritConfigSpec), scope)\n\t}); err != nil {\n\t\treturn err\n\t}\n\tif err := s.AddConversionFunc((*v1alpha2.CritConfigSpec)(nil), (*CritConfigSpec)(nil), func(a, b interface{}, scope conversion.Scope) error {\n\t\treturn Convert_v1alpha2_CritConfigSpec_To_v1alpha1_CritConfigSpec(a.(*v1alpha2.CritConfigSpec), b.(*CritConfigSpec), scope)\n\t}); err != nil {\n\t\treturn err\n\t}\n\treturn nil\n}", "title": "" }, { "docid": "aa8d56c1ae43b906dc031db8b6fcc653", "score": "0.6897091", "text": "func RegisterConversions(s *runtime.Scheme) error {\n\tif err := s.AddGeneratedConversionFunc((*EKSConfig)(nil), (*v1alpha4.EKSConfig)(nil), func(a, b interface{}, scope conversion.Scope) error {\n\t\treturn Convert_v1alpha3_EKSConfig_To_v1alpha4_EKSConfig(a.(*EKSConfig), b.(*v1alpha4.EKSConfig), scope)\n\t}); err != nil {\n\t\treturn err\n\t}\n\tif err := s.AddGeneratedConversionFunc((*v1alpha4.EKSConfig)(nil), (*EKSConfig)(nil), func(a, b interface{}, scope conversion.Scope) error {\n\t\treturn Convert_v1alpha4_EKSConfig_To_v1alpha3_EKSConfig(a.(*v1alpha4.EKSConfig), b.(*EKSConfig), scope)\n\t}); err != nil {\n\t\treturn err\n\t}\n\tif err := s.AddGeneratedConversionFunc((*EKSConfigList)(nil), (*v1alpha4.EKSConfigList)(nil), func(a, b interface{}, scope conversion.Scope) error {\n\t\treturn Convert_v1alpha3_EKSConfigList_To_v1alpha4_EKSConfigList(a.(*EKSConfigList), b.(*v1alpha4.EKSConfigList), scope)\n\t}); err != nil {\n\t\treturn err\n\t}\n\tif err := s.AddGeneratedConversionFunc((*v1alpha4.EKSConfigList)(nil), (*EKSConfigList)(nil), func(a, b interface{}, scope conversion.Scope) error {\n\t\treturn Convert_v1alpha4_EKSConfigList_To_v1alpha3_EKSConfigList(a.(*v1alpha4.EKSConfigList), b.(*EKSConfigList), scope)\n\t}); err != nil {\n\t\treturn err\n\t}\n\tif err := s.AddGeneratedConversionFunc((*EKSConfigSpec)(nil), (*v1alpha4.EKSConfigSpec)(nil), func(a, b interface{}, scope conversion.Scope) error {\n\t\treturn Convert_v1alpha3_EKSConfigSpec_To_v1alpha4_EKSConfigSpec(a.(*EKSConfigSpec), b.(*v1alpha4.EKSConfigSpec), scope)\n\t}); err != nil {\n\t\treturn err\n\t}\n\tif err := s.AddGeneratedConversionFunc((*v1alpha4.EKSConfigSpec)(nil), (*EKSConfigSpec)(nil), func(a, b interface{}, scope conversion.Scope) error {\n\t\treturn Convert_v1alpha4_EKSConfigSpec_To_v1alpha3_EKSConfigSpec(a.(*v1alpha4.EKSConfigSpec), b.(*EKSConfigSpec), scope)\n\t}); err != nil {\n\t\treturn err\n\t}\n\tif err := s.AddGeneratedConversionFunc((*EKSConfigStatus)(nil), (*v1alpha4.EKSConfigStatus)(nil), func(a, b interface{}, scope conversion.Scope) error {\n\t\treturn Convert_v1alpha3_EKSConfigStatus_To_v1alpha4_EKSConfigStatus(a.(*EKSConfigStatus), b.(*v1alpha4.EKSConfigStatus), scope)\n\t}); err != nil {\n\t\treturn err\n\t}\n\tif err := s.AddGeneratedConversionFunc((*v1alpha4.EKSConfigStatus)(nil), (*EKSConfigStatus)(nil), func(a, b interface{}, scope conversion.Scope) error {\n\t\treturn Convert_v1alpha4_EKSConfigStatus_To_v1alpha3_EKSConfigStatus(a.(*v1alpha4.EKSConfigStatus), b.(*EKSConfigStatus), scope)\n\t}); err != nil {\n\t\treturn err\n\t}\n\tif err := s.AddGeneratedConversionFunc((*EKSConfigTemplate)(nil), (*v1alpha4.EKSConfigTemplate)(nil), func(a, b interface{}, scope conversion.Scope) error {\n\t\treturn Convert_v1alpha3_EKSConfigTemplate_To_v1alpha4_EKSConfigTemplate(a.(*EKSConfigTemplate), b.(*v1alpha4.EKSConfigTemplate), scope)\n\t}); err != nil {\n\t\treturn err\n\t}\n\tif err := s.AddGeneratedConversionFunc((*v1alpha4.EKSConfigTemplate)(nil), (*EKSConfigTemplate)(nil), func(a, b interface{}, scope conversion.Scope) error {\n\t\treturn Convert_v1alpha4_EKSConfigTemplate_To_v1alpha3_EKSConfigTemplate(a.(*v1alpha4.EKSConfigTemplate), b.(*EKSConfigTemplate), scope)\n\t}); err != nil {\n\t\treturn err\n\t}\n\tif err := s.AddGeneratedConversionFunc((*EKSConfigTemplateList)(nil), (*v1alpha4.EKSConfigTemplateList)(nil), func(a, b interface{}, scope conversion.Scope) error {\n\t\treturn Convert_v1alpha3_EKSConfigTemplateList_To_v1alpha4_EKSConfigTemplateList(a.(*EKSConfigTemplateList), b.(*v1alpha4.EKSConfigTemplateList), scope)\n\t}); err != nil {\n\t\treturn err\n\t}\n\tif err := s.AddGeneratedConversionFunc((*v1alpha4.EKSConfigTemplateList)(nil), (*EKSConfigTemplateList)(nil), func(a, b interface{}, scope conversion.Scope) error {\n\t\treturn Convert_v1alpha4_EKSConfigTemplateList_To_v1alpha3_EKSConfigTemplateList(a.(*v1alpha4.EKSConfigTemplateList), b.(*EKSConfigTemplateList), scope)\n\t}); err != nil {\n\t\treturn err\n\t}\n\tif err := s.AddGeneratedConversionFunc((*EKSConfigTemplateResource)(nil), (*v1alpha4.EKSConfigTemplateResource)(nil), func(a, b interface{}, scope conversion.Scope) error {\n\t\treturn Convert_v1alpha3_EKSConfigTemplateResource_To_v1alpha4_EKSConfigTemplateResource(a.(*EKSConfigTemplateResource), b.(*v1alpha4.EKSConfigTemplateResource), scope)\n\t}); err != nil {\n\t\treturn err\n\t}\n\tif err := s.AddGeneratedConversionFunc((*v1alpha4.EKSConfigTemplateResource)(nil), (*EKSConfigTemplateResource)(nil), func(a, b interface{}, scope conversion.Scope) error {\n\t\treturn Convert_v1alpha4_EKSConfigTemplateResource_To_v1alpha3_EKSConfigTemplateResource(a.(*v1alpha4.EKSConfigTemplateResource), b.(*EKSConfigTemplateResource), scope)\n\t}); err != nil {\n\t\treturn err\n\t}\n\tif err := s.AddGeneratedConversionFunc((*EKSConfigTemplateSpec)(nil), (*v1alpha4.EKSConfigTemplateSpec)(nil), func(a, b interface{}, scope conversion.Scope) error {\n\t\treturn Convert_v1alpha3_EKSConfigTemplateSpec_To_v1alpha4_EKSConfigTemplateSpec(a.(*EKSConfigTemplateSpec), b.(*v1alpha4.EKSConfigTemplateSpec), scope)\n\t}); err != nil {\n\t\treturn err\n\t}\n\tif err := s.AddGeneratedConversionFunc((*v1alpha4.EKSConfigTemplateSpec)(nil), (*EKSConfigTemplateSpec)(nil), func(a, b interface{}, scope conversion.Scope) error {\n\t\treturn Convert_v1alpha4_EKSConfigTemplateSpec_To_v1alpha3_EKSConfigTemplateSpec(a.(*v1alpha4.EKSConfigTemplateSpec), b.(*EKSConfigTemplateSpec), scope)\n\t}); err != nil {\n\t\treturn err\n\t}\n\treturn nil\n}", "title": "" }, { "docid": "c6fe837b6caf1bcbea4b854f17eb0bde", "score": "0.68910116", "text": "func RegisterConversions(s *runtime.Scheme) error {\n\tif err := s.AddGeneratedConversionFunc((*Flunder)(nil), (*wardle.Flunder)(nil), func(a, b interface{}, scope conversion.Scope) error {\n\t\treturn Convert_v1beta1_Flunder_To_wardle_Flunder(a.(*Flunder), b.(*wardle.Flunder), scope)\n\t}); err != nil {\n\t\treturn err\n\t}\n\tif err := s.AddGeneratedConversionFunc((*wardle.Flunder)(nil), (*Flunder)(nil), func(a, b interface{}, scope conversion.Scope) error {\n\t\treturn Convert_wardle_Flunder_To_v1beta1_Flunder(a.(*wardle.Flunder), b.(*Flunder), scope)\n\t}); err != nil {\n\t\treturn err\n\t}\n\tif err := s.AddGeneratedConversionFunc((*FlunderList)(nil), (*wardle.FlunderList)(nil), func(a, b interface{}, scope conversion.Scope) error {\n\t\treturn Convert_v1beta1_FlunderList_To_wardle_FlunderList(a.(*FlunderList), b.(*wardle.FlunderList), scope)\n\t}); err != nil {\n\t\treturn err\n\t}\n\tif err := s.AddGeneratedConversionFunc((*wardle.FlunderList)(nil), (*FlunderList)(nil), func(a, b interface{}, scope conversion.Scope) error {\n\t\treturn Convert_wardle_FlunderList_To_v1beta1_FlunderList(a.(*wardle.FlunderList), b.(*FlunderList), scope)\n\t}); err != nil {\n\t\treturn err\n\t}\n\tif err := s.AddGeneratedConversionFunc((*FlunderSpec)(nil), (*wardle.FlunderSpec)(nil), func(a, b interface{}, scope conversion.Scope) error {\n\t\treturn Convert_v1beta1_FlunderSpec_To_wardle_FlunderSpec(a.(*FlunderSpec), b.(*wardle.FlunderSpec), scope)\n\t}); err != nil {\n\t\treturn err\n\t}\n\tif err := s.AddGeneratedConversionFunc((*wardle.FlunderSpec)(nil), (*FlunderSpec)(nil), func(a, b interface{}, scope conversion.Scope) error {\n\t\treturn Convert_wardle_FlunderSpec_To_v1beta1_FlunderSpec(a.(*wardle.FlunderSpec), b.(*FlunderSpec), scope)\n\t}); err != nil {\n\t\treturn err\n\t}\n\tif err := s.AddGeneratedConversionFunc((*FlunderStatus)(nil), (*wardle.FlunderStatus)(nil), func(a, b interface{}, scope conversion.Scope) error {\n\t\treturn Convert_v1beta1_FlunderStatus_To_wardle_FlunderStatus(a.(*FlunderStatus), b.(*wardle.FlunderStatus), scope)\n\t}); err != nil {\n\t\treturn err\n\t}\n\tif err := s.AddGeneratedConversionFunc((*wardle.FlunderStatus)(nil), (*FlunderStatus)(nil), func(a, b interface{}, scope conversion.Scope) error {\n\t\treturn Convert_wardle_FlunderStatus_To_v1beta1_FlunderStatus(a.(*wardle.FlunderStatus), b.(*FlunderStatus), scope)\n\t}); err != nil {\n\t\treturn err\n\t}\n\treturn nil\n}", "title": "" }, { "docid": "91f84a6dd6e76e9e768087b268bddbb0", "score": "0.68243533", "text": "func RegisterConversions(s *runtime.Scheme) error {\n\tif err := s.AddGeneratedConversionFunc((*v1beta1.CSIDriver)(nil), (*storage.CSIDriver)(nil), func(a, b interface{}, scope conversion.Scope) error {\n\t\treturn Convert_v1beta1_CSIDriver_To_storage_CSIDriver(a.(*v1beta1.CSIDriver), b.(*storage.CSIDriver), scope)\n\t}); err != nil {\n\t\treturn err\n\t}\n\tif err := s.AddGeneratedConversionFunc((*storage.CSIDriver)(nil), (*v1beta1.CSIDriver)(nil), func(a, b interface{}, scope conversion.Scope) error {\n\t\treturn Convert_storage_CSIDriver_To_v1beta1_CSIDriver(a.(*storage.CSIDriver), b.(*v1beta1.CSIDriver), scope)\n\t}); err != nil {\n\t\treturn err\n\t}\n\tif err := s.AddGeneratedConversionFunc((*v1beta1.CSIDriverList)(nil), (*storage.CSIDriverList)(nil), func(a, b interface{}, scope conversion.Scope) error {\n\t\treturn Convert_v1beta1_CSIDriverList_To_storage_CSIDriverList(a.(*v1beta1.CSIDriverList), b.(*storage.CSIDriverList), scope)\n\t}); err != nil {\n\t\treturn err\n\t}\n\tif err := s.AddGeneratedConversionFunc((*storage.CSIDriverList)(nil), (*v1beta1.CSIDriverList)(nil), func(a, b interface{}, scope conversion.Scope) error {\n\t\treturn Convert_storage_CSIDriverList_To_v1beta1_CSIDriverList(a.(*storage.CSIDriverList), b.(*v1beta1.CSIDriverList), scope)\n\t}); err != nil {\n\t\treturn err\n\t}\n\tif err := s.AddGeneratedConversionFunc((*v1beta1.CSIDriverSpec)(nil), (*storage.CSIDriverSpec)(nil), func(a, b interface{}, scope conversion.Scope) error {\n\t\treturn Convert_v1beta1_CSIDriverSpec_To_storage_CSIDriverSpec(a.(*v1beta1.CSIDriverSpec), b.(*storage.CSIDriverSpec), scope)\n\t}); err != nil {\n\t\treturn err\n\t}\n\tif err := s.AddGeneratedConversionFunc((*storage.CSIDriverSpec)(nil), (*v1beta1.CSIDriverSpec)(nil), func(a, b interface{}, scope conversion.Scope) error {\n\t\treturn Convert_storage_CSIDriverSpec_To_v1beta1_CSIDriverSpec(a.(*storage.CSIDriverSpec), b.(*v1beta1.CSIDriverSpec), scope)\n\t}); err != nil {\n\t\treturn err\n\t}\n\tif err := s.AddGeneratedConversionFunc((*v1beta1.CSINode)(nil), (*storage.CSINode)(nil), func(a, b interface{}, scope conversion.Scope) error {\n\t\treturn Convert_v1beta1_CSINode_To_storage_CSINode(a.(*v1beta1.CSINode), b.(*storage.CSINode), scope)\n\t}); err != nil {\n\t\treturn err\n\t}\n\tif err := s.AddGeneratedConversionFunc((*storage.CSINode)(nil), (*v1beta1.CSINode)(nil), func(a, b interface{}, scope conversion.Scope) error {\n\t\treturn Convert_storage_CSINode_To_v1beta1_CSINode(a.(*storage.CSINode), b.(*v1beta1.CSINode), scope)\n\t}); err != nil {\n\t\treturn err\n\t}\n\tif err := s.AddGeneratedConversionFunc((*v1beta1.CSINodeDriver)(nil), (*storage.CSINodeDriver)(nil), func(a, b interface{}, scope conversion.Scope) error {\n\t\treturn Convert_v1beta1_CSINodeDriver_To_storage_CSINodeDriver(a.(*v1beta1.CSINodeDriver), b.(*storage.CSINodeDriver), scope)\n\t}); err != nil {\n\t\treturn err\n\t}\n\tif err := s.AddGeneratedConversionFunc((*storage.CSINodeDriver)(nil), (*v1beta1.CSINodeDriver)(nil), func(a, b interface{}, scope conversion.Scope) error {\n\t\treturn Convert_storage_CSINodeDriver_To_v1beta1_CSINodeDriver(a.(*storage.CSINodeDriver), b.(*v1beta1.CSINodeDriver), scope)\n\t}); err != nil {\n\t\treturn err\n\t}\n\tif err := s.AddGeneratedConversionFunc((*v1beta1.CSINodeList)(nil), (*storage.CSINodeList)(nil), func(a, b interface{}, scope conversion.Scope) error {\n\t\treturn Convert_v1beta1_CSINodeList_To_storage_CSINodeList(a.(*v1beta1.CSINodeList), b.(*storage.CSINodeList), scope)\n\t}); err != nil {\n\t\treturn err\n\t}\n\tif err := s.AddGeneratedConversionFunc((*storage.CSINodeList)(nil), (*v1beta1.CSINodeList)(nil), func(a, b interface{}, scope conversion.Scope) error {\n\t\treturn Convert_storage_CSINodeList_To_v1beta1_CSINodeList(a.(*storage.CSINodeList), b.(*v1beta1.CSINodeList), scope)\n\t}); err != nil {\n\t\treturn err\n\t}\n\tif err := s.AddGeneratedConversionFunc((*v1beta1.CSINodeSpec)(nil), (*storage.CSINodeSpec)(nil), func(a, b interface{}, scope conversion.Scope) error {\n\t\treturn Convert_v1beta1_CSINodeSpec_To_storage_CSINodeSpec(a.(*v1beta1.CSINodeSpec), b.(*storage.CSINodeSpec), scope)\n\t}); err != nil {\n\t\treturn err\n\t}\n\tif err := s.AddGeneratedConversionFunc((*storage.CSINodeSpec)(nil), (*v1beta1.CSINodeSpec)(nil), func(a, b interface{}, scope conversion.Scope) error {\n\t\treturn Convert_storage_CSINodeSpec_To_v1beta1_CSINodeSpec(a.(*storage.CSINodeSpec), b.(*v1beta1.CSINodeSpec), scope)\n\t}); err != nil {\n\t\treturn err\n\t}\n\tif err := s.AddGeneratedConversionFunc((*v1beta1.CSIStorageCapacity)(nil), (*storage.CSIStorageCapacity)(nil), func(a, b interface{}, scope conversion.Scope) error {\n\t\treturn Convert_v1beta1_CSIStorageCapacity_To_storage_CSIStorageCapacity(a.(*v1beta1.CSIStorageCapacity), b.(*storage.CSIStorageCapacity), scope)\n\t}); err != nil {\n\t\treturn err\n\t}\n\tif err := s.AddGeneratedConversionFunc((*storage.CSIStorageCapacity)(nil), (*v1beta1.CSIStorageCapacity)(nil), func(a, b interface{}, scope conversion.Scope) error {\n\t\treturn Convert_storage_CSIStorageCapacity_To_v1beta1_CSIStorageCapacity(a.(*storage.CSIStorageCapacity), b.(*v1beta1.CSIStorageCapacity), scope)\n\t}); err != nil {\n\t\treturn err\n\t}\n\tif err := s.AddGeneratedConversionFunc((*v1beta1.CSIStorageCapacityList)(nil), (*storage.CSIStorageCapacityList)(nil), func(a, b interface{}, scope conversion.Scope) error {\n\t\treturn Convert_v1beta1_CSIStorageCapacityList_To_storage_CSIStorageCapacityList(a.(*v1beta1.CSIStorageCapacityList), b.(*storage.CSIStorageCapacityList), scope)\n\t}); err != nil {\n\t\treturn err\n\t}\n\tif err := s.AddGeneratedConversionFunc((*storage.CSIStorageCapacityList)(nil), (*v1beta1.CSIStorageCapacityList)(nil), func(a, b interface{}, scope conversion.Scope) error {\n\t\treturn Convert_storage_CSIStorageCapacityList_To_v1beta1_CSIStorageCapacityList(a.(*storage.CSIStorageCapacityList), b.(*v1beta1.CSIStorageCapacityList), scope)\n\t}); err != nil {\n\t\treturn err\n\t}\n\tif err := s.AddGeneratedConversionFunc((*v1beta1.StorageClass)(nil), (*storage.StorageClass)(nil), func(a, b interface{}, scope conversion.Scope) error {\n\t\treturn Convert_v1beta1_StorageClass_To_storage_StorageClass(a.(*v1beta1.StorageClass), b.(*storage.StorageClass), scope)\n\t}); err != nil {\n\t\treturn err\n\t}\n\tif err := s.AddGeneratedConversionFunc((*storage.StorageClass)(nil), (*v1beta1.StorageClass)(nil), func(a, b interface{}, scope conversion.Scope) error {\n\t\treturn Convert_storage_StorageClass_To_v1beta1_StorageClass(a.(*storage.StorageClass), b.(*v1beta1.StorageClass), scope)\n\t}); err != nil {\n\t\treturn err\n\t}\n\tif err := s.AddGeneratedConversionFunc((*v1beta1.StorageClassList)(nil), (*storage.StorageClassList)(nil), func(a, b interface{}, scope conversion.Scope) error {\n\t\treturn Convert_v1beta1_StorageClassList_To_storage_StorageClassList(a.(*v1beta1.StorageClassList), b.(*storage.StorageClassList), scope)\n\t}); err != nil {\n\t\treturn err\n\t}\n\tif err := s.AddGeneratedConversionFunc((*storage.StorageClassList)(nil), (*v1beta1.StorageClassList)(nil), func(a, b interface{}, scope conversion.Scope) error {\n\t\treturn Convert_storage_StorageClassList_To_v1beta1_StorageClassList(a.(*storage.StorageClassList), b.(*v1beta1.StorageClassList), scope)\n\t}); err != nil {\n\t\treturn err\n\t}\n\tif err := s.AddGeneratedConversionFunc((*v1beta1.TokenRequest)(nil), (*storage.TokenRequest)(nil), func(a, b interface{}, scope conversion.Scope) error {\n\t\treturn Convert_v1beta1_TokenRequest_To_storage_TokenRequest(a.(*v1beta1.TokenRequest), b.(*storage.TokenRequest), scope)\n\t}); err != nil {\n\t\treturn err\n\t}\n\tif err := s.AddGeneratedConversionFunc((*storage.TokenRequest)(nil), (*v1beta1.TokenRequest)(nil), func(a, b interface{}, scope conversion.Scope) error {\n\t\treturn Convert_storage_TokenRequest_To_v1beta1_TokenRequest(a.(*storage.TokenRequest), b.(*v1beta1.TokenRequest), scope)\n\t}); err != nil {\n\t\treturn err\n\t}\n\tif err := s.AddGeneratedConversionFunc((*v1beta1.VolumeAttachment)(nil), (*storage.VolumeAttachment)(nil), func(a, b interface{}, scope conversion.Scope) error {\n\t\treturn Convert_v1beta1_VolumeAttachment_To_storage_VolumeAttachment(a.(*v1beta1.VolumeAttachment), b.(*storage.VolumeAttachment), scope)\n\t}); err != nil {\n\t\treturn err\n\t}\n\tif err := s.AddGeneratedConversionFunc((*storage.VolumeAttachment)(nil), (*v1beta1.VolumeAttachment)(nil), func(a, b interface{}, scope conversion.Scope) error {\n\t\treturn Convert_storage_VolumeAttachment_To_v1beta1_VolumeAttachment(a.(*storage.VolumeAttachment), b.(*v1beta1.VolumeAttachment), scope)\n\t}); err != nil {\n\t\treturn err\n\t}\n\tif err := s.AddGeneratedConversionFunc((*v1beta1.VolumeAttachmentList)(nil), (*storage.VolumeAttachmentList)(nil), func(a, b interface{}, scope conversion.Scope) error {\n\t\treturn Convert_v1beta1_VolumeAttachmentList_To_storage_VolumeAttachmentList(a.(*v1beta1.VolumeAttachmentList), b.(*storage.VolumeAttachmentList), scope)\n\t}); err != nil {\n\t\treturn err\n\t}\n\tif err := s.AddGeneratedConversionFunc((*storage.VolumeAttachmentList)(nil), (*v1beta1.VolumeAttachmentList)(nil), func(a, b interface{}, scope conversion.Scope) error {\n\t\treturn Convert_storage_VolumeAttachmentList_To_v1beta1_VolumeAttachmentList(a.(*storage.VolumeAttachmentList), b.(*v1beta1.VolumeAttachmentList), scope)\n\t}); err != nil {\n\t\treturn err\n\t}\n\tif err := s.AddGeneratedConversionFunc((*v1beta1.VolumeAttachmentSource)(nil), (*storage.VolumeAttachmentSource)(nil), func(a, b interface{}, scope conversion.Scope) error {\n\t\treturn Convert_v1beta1_VolumeAttachmentSource_To_storage_VolumeAttachmentSource(a.(*v1beta1.VolumeAttachmentSource), b.(*storage.VolumeAttachmentSource), scope)\n\t}); err != nil {\n\t\treturn err\n\t}\n\tif err := s.AddGeneratedConversionFunc((*storage.VolumeAttachmentSource)(nil), (*v1beta1.VolumeAttachmentSource)(nil), func(a, b interface{}, scope conversion.Scope) error {\n\t\treturn Convert_storage_VolumeAttachmentSource_To_v1beta1_VolumeAttachmentSource(a.(*storage.VolumeAttachmentSource), b.(*v1beta1.VolumeAttachmentSource), scope)\n\t}); err != nil {\n\t\treturn err\n\t}\n\tif err := s.AddGeneratedConversionFunc((*v1beta1.VolumeAttachmentSpec)(nil), (*storage.VolumeAttachmentSpec)(nil), func(a, b interface{}, scope conversion.Scope) error {\n\t\treturn Convert_v1beta1_VolumeAttachmentSpec_To_storage_VolumeAttachmentSpec(a.(*v1beta1.VolumeAttachmentSpec), b.(*storage.VolumeAttachmentSpec), scope)\n\t}); err != nil {\n\t\treturn err\n\t}\n\tif err := s.AddGeneratedConversionFunc((*storage.VolumeAttachmentSpec)(nil), (*v1beta1.VolumeAttachmentSpec)(nil), func(a, b interface{}, scope conversion.Scope) error {\n\t\treturn Convert_storage_VolumeAttachmentSpec_To_v1beta1_VolumeAttachmentSpec(a.(*storage.VolumeAttachmentSpec), b.(*v1beta1.VolumeAttachmentSpec), scope)\n\t}); err != nil {\n\t\treturn err\n\t}\n\tif err := s.AddGeneratedConversionFunc((*v1beta1.VolumeAttachmentStatus)(nil), (*storage.VolumeAttachmentStatus)(nil), func(a, b interface{}, scope conversion.Scope) error {\n\t\treturn Convert_v1beta1_VolumeAttachmentStatus_To_storage_VolumeAttachmentStatus(a.(*v1beta1.VolumeAttachmentStatus), b.(*storage.VolumeAttachmentStatus), scope)\n\t}); err != nil {\n\t\treturn err\n\t}\n\tif err := s.AddGeneratedConversionFunc((*storage.VolumeAttachmentStatus)(nil), (*v1beta1.VolumeAttachmentStatus)(nil), func(a, b interface{}, scope conversion.Scope) error {\n\t\treturn Convert_storage_VolumeAttachmentStatus_To_v1beta1_VolumeAttachmentStatus(a.(*storage.VolumeAttachmentStatus), b.(*v1beta1.VolumeAttachmentStatus), scope)\n\t}); err != nil {\n\t\treturn err\n\t}\n\tif err := s.AddGeneratedConversionFunc((*v1beta1.VolumeError)(nil), (*storage.VolumeError)(nil), func(a, b interface{}, scope conversion.Scope) error {\n\t\treturn Convert_v1beta1_VolumeError_To_storage_VolumeError(a.(*v1beta1.VolumeError), b.(*storage.VolumeError), scope)\n\t}); err != nil {\n\t\treturn err\n\t}\n\tif err := s.AddGeneratedConversionFunc((*storage.VolumeError)(nil), (*v1beta1.VolumeError)(nil), func(a, b interface{}, scope conversion.Scope) error {\n\t\treturn Convert_storage_VolumeError_To_v1beta1_VolumeError(a.(*storage.VolumeError), b.(*v1beta1.VolumeError), scope)\n\t}); err != nil {\n\t\treturn err\n\t}\n\tif err := s.AddGeneratedConversionFunc((*v1beta1.VolumeNodeResources)(nil), (*storage.VolumeNodeResources)(nil), func(a, b interface{}, scope conversion.Scope) error {\n\t\treturn Convert_v1beta1_VolumeNodeResources_To_storage_VolumeNodeResources(a.(*v1beta1.VolumeNodeResources), b.(*storage.VolumeNodeResources), scope)\n\t}); err != nil {\n\t\treturn err\n\t}\n\tif err := s.AddGeneratedConversionFunc((*storage.VolumeNodeResources)(nil), (*v1beta1.VolumeNodeResources)(nil), func(a, b interface{}, scope conversion.Scope) error {\n\t\treturn Convert_storage_VolumeNodeResources_To_v1beta1_VolumeNodeResources(a.(*storage.VolumeNodeResources), b.(*v1beta1.VolumeNodeResources), scope)\n\t}); err != nil {\n\t\treturn err\n\t}\n\treturn nil\n}", "title": "" }, { "docid": "e67279e6d98f05ed01dbe2effe5a0a0b", "score": "0.6816766", "text": "func RegisterConversions(s *runtime.Scheme) error {\n\tif err := s.AddGeneratedConversionFunc((*BlockDeviceVolume)(nil), (*ignite.BlockDeviceVolume)(nil), func(a, b interface{}, scope conversion.Scope) error {\n\t\treturn Convert_v1alpha4_BlockDeviceVolume_To_ignite_BlockDeviceVolume(a.(*BlockDeviceVolume), b.(*ignite.BlockDeviceVolume), scope)\n\t}); err != nil {\n\t\treturn err\n\t}\n\tif err := s.AddGeneratedConversionFunc((*ignite.BlockDeviceVolume)(nil), (*BlockDeviceVolume)(nil), func(a, b interface{}, scope conversion.Scope) error {\n\t\treturn Convert_ignite_BlockDeviceVolume_To_v1alpha4_BlockDeviceVolume(a.(*ignite.BlockDeviceVolume), b.(*BlockDeviceVolume), scope)\n\t}); err != nil {\n\t\treturn err\n\t}\n\tif err := s.AddGeneratedConversionFunc((*Configuration)(nil), (*ignite.Configuration)(nil), func(a, b interface{}, scope conversion.Scope) error {\n\t\treturn Convert_v1alpha4_Configuration_To_ignite_Configuration(a.(*Configuration), b.(*ignite.Configuration), scope)\n\t}); err != nil {\n\t\treturn err\n\t}\n\tif err := s.AddGeneratedConversionFunc((*ignite.Configuration)(nil), (*Configuration)(nil), func(a, b interface{}, scope conversion.Scope) error {\n\t\treturn Convert_ignite_Configuration_To_v1alpha4_Configuration(a.(*ignite.Configuration), b.(*Configuration), scope)\n\t}); err != nil {\n\t\treturn err\n\t}\n\tif err := s.AddGeneratedConversionFunc((*ConfigurationSpec)(nil), (*ignite.ConfigurationSpec)(nil), func(a, b interface{}, scope conversion.Scope) error {\n\t\treturn Convert_v1alpha4_ConfigurationSpec_To_ignite_ConfigurationSpec(a.(*ConfigurationSpec), b.(*ignite.ConfigurationSpec), scope)\n\t}); err != nil {\n\t\treturn err\n\t}\n\tif err := s.AddGeneratedConversionFunc((*ignite.ConfigurationSpec)(nil), (*ConfigurationSpec)(nil), func(a, b interface{}, scope conversion.Scope) error {\n\t\treturn Convert_ignite_ConfigurationSpec_To_v1alpha4_ConfigurationSpec(a.(*ignite.ConfigurationSpec), b.(*ConfigurationSpec), scope)\n\t}); err != nil {\n\t\treturn err\n\t}\n\tif err := s.AddGeneratedConversionFunc((*FileMapping)(nil), (*ignite.FileMapping)(nil), func(a, b interface{}, scope conversion.Scope) error {\n\t\treturn Convert_v1alpha4_FileMapping_To_ignite_FileMapping(a.(*FileMapping), b.(*ignite.FileMapping), scope)\n\t}); err != nil {\n\t\treturn err\n\t}\n\tif err := s.AddGeneratedConversionFunc((*ignite.FileMapping)(nil), (*FileMapping)(nil), func(a, b interface{}, scope conversion.Scope) error {\n\t\treturn Convert_ignite_FileMapping_To_v1alpha4_FileMapping(a.(*ignite.FileMapping), b.(*FileMapping), scope)\n\t}); err != nil {\n\t\treturn err\n\t}\n\tif err := s.AddGeneratedConversionFunc((*Image)(nil), (*ignite.Image)(nil), func(a, b interface{}, scope conversion.Scope) error {\n\t\treturn Convert_v1alpha4_Image_To_ignite_Image(a.(*Image), b.(*ignite.Image), scope)\n\t}); err != nil {\n\t\treturn err\n\t}\n\tif err := s.AddGeneratedConversionFunc((*ignite.Image)(nil), (*Image)(nil), func(a, b interface{}, scope conversion.Scope) error {\n\t\treturn Convert_ignite_Image_To_v1alpha4_Image(a.(*ignite.Image), b.(*Image), scope)\n\t}); err != nil {\n\t\treturn err\n\t}\n\tif err := s.AddGeneratedConversionFunc((*ImageSpec)(nil), (*ignite.ImageSpec)(nil), func(a, b interface{}, scope conversion.Scope) error {\n\t\treturn Convert_v1alpha4_ImageSpec_To_ignite_ImageSpec(a.(*ImageSpec), b.(*ignite.ImageSpec), scope)\n\t}); err != nil {\n\t\treturn err\n\t}\n\tif err := s.AddGeneratedConversionFunc((*ignite.ImageSpec)(nil), (*ImageSpec)(nil), func(a, b interface{}, scope conversion.Scope) error {\n\t\treturn Convert_ignite_ImageSpec_To_v1alpha4_ImageSpec(a.(*ignite.ImageSpec), b.(*ImageSpec), scope)\n\t}); err != nil {\n\t\treturn err\n\t}\n\tif err := s.AddGeneratedConversionFunc((*ImageStatus)(nil), (*ignite.ImageStatus)(nil), func(a, b interface{}, scope conversion.Scope) error {\n\t\treturn Convert_v1alpha4_ImageStatus_To_ignite_ImageStatus(a.(*ImageStatus), b.(*ignite.ImageStatus), scope)\n\t}); err != nil {\n\t\treturn err\n\t}\n\tif err := s.AddGeneratedConversionFunc((*ignite.ImageStatus)(nil), (*ImageStatus)(nil), func(a, b interface{}, scope conversion.Scope) error {\n\t\treturn Convert_ignite_ImageStatus_To_v1alpha4_ImageStatus(a.(*ignite.ImageStatus), b.(*ImageStatus), scope)\n\t}); err != nil {\n\t\treturn err\n\t}\n\tif err := s.AddGeneratedConversionFunc((*Kernel)(nil), (*ignite.Kernel)(nil), func(a, b interface{}, scope conversion.Scope) error {\n\t\treturn Convert_v1alpha4_Kernel_To_ignite_Kernel(a.(*Kernel), b.(*ignite.Kernel), scope)\n\t}); err != nil {\n\t\treturn err\n\t}\n\tif err := s.AddGeneratedConversionFunc((*ignite.Kernel)(nil), (*Kernel)(nil), func(a, b interface{}, scope conversion.Scope) error {\n\t\treturn Convert_ignite_Kernel_To_v1alpha4_Kernel(a.(*ignite.Kernel), b.(*Kernel), scope)\n\t}); err != nil {\n\t\treturn err\n\t}\n\tif err := s.AddGeneratedConversionFunc((*KernelSpec)(nil), (*ignite.KernelSpec)(nil), func(a, b interface{}, scope conversion.Scope) error {\n\t\treturn Convert_v1alpha4_KernelSpec_To_ignite_KernelSpec(a.(*KernelSpec), b.(*ignite.KernelSpec), scope)\n\t}); err != nil {\n\t\treturn err\n\t}\n\tif err := s.AddGeneratedConversionFunc((*ignite.KernelSpec)(nil), (*KernelSpec)(nil), func(a, b interface{}, scope conversion.Scope) error {\n\t\treturn Convert_ignite_KernelSpec_To_v1alpha4_KernelSpec(a.(*ignite.KernelSpec), b.(*KernelSpec), scope)\n\t}); err != nil {\n\t\treturn err\n\t}\n\tif err := s.AddGeneratedConversionFunc((*KernelStatus)(nil), (*ignite.KernelStatus)(nil), func(a, b interface{}, scope conversion.Scope) error {\n\t\treturn Convert_v1alpha4_KernelStatus_To_ignite_KernelStatus(a.(*KernelStatus), b.(*ignite.KernelStatus), scope)\n\t}); err != nil {\n\t\treturn err\n\t}\n\tif err := s.AddGeneratedConversionFunc((*ignite.KernelStatus)(nil), (*KernelStatus)(nil), func(a, b interface{}, scope conversion.Scope) error {\n\t\treturn Convert_ignite_KernelStatus_To_v1alpha4_KernelStatus(a.(*ignite.KernelStatus), b.(*KernelStatus), scope)\n\t}); err != nil {\n\t\treturn err\n\t}\n\tif err := s.AddGeneratedConversionFunc((*Network)(nil), (*ignite.Network)(nil), func(a, b interface{}, scope conversion.Scope) error {\n\t\treturn Convert_v1alpha4_Network_To_ignite_Network(a.(*Network), b.(*ignite.Network), scope)\n\t}); err != nil {\n\t\treturn err\n\t}\n\tif err := s.AddGeneratedConversionFunc((*ignite.Network)(nil), (*Network)(nil), func(a, b interface{}, scope conversion.Scope) error {\n\t\treturn Convert_ignite_Network_To_v1alpha4_Network(a.(*ignite.Network), b.(*Network), scope)\n\t}); err != nil {\n\t\treturn err\n\t}\n\tif err := s.AddGeneratedConversionFunc((*OCIImageSource)(nil), (*ignite.OCIImageSource)(nil), func(a, b interface{}, scope conversion.Scope) error {\n\t\treturn Convert_v1alpha4_OCIImageSource_To_ignite_OCIImageSource(a.(*OCIImageSource), b.(*ignite.OCIImageSource), scope)\n\t}); err != nil {\n\t\treturn err\n\t}\n\tif err := s.AddGeneratedConversionFunc((*ignite.OCIImageSource)(nil), (*OCIImageSource)(nil), func(a, b interface{}, scope conversion.Scope) error {\n\t\treturn Convert_ignite_OCIImageSource_To_v1alpha4_OCIImageSource(a.(*ignite.OCIImageSource), b.(*OCIImageSource), scope)\n\t}); err != nil {\n\t\treturn err\n\t}\n\tif err := s.AddGeneratedConversionFunc((*Pool)(nil), (*ignite.Pool)(nil), func(a, b interface{}, scope conversion.Scope) error {\n\t\treturn Convert_v1alpha4_Pool_To_ignite_Pool(a.(*Pool), b.(*ignite.Pool), scope)\n\t}); err != nil {\n\t\treturn err\n\t}\n\tif err := s.AddGeneratedConversionFunc((*ignite.Pool)(nil), (*Pool)(nil), func(a, b interface{}, scope conversion.Scope) error {\n\t\treturn Convert_ignite_Pool_To_v1alpha4_Pool(a.(*ignite.Pool), b.(*Pool), scope)\n\t}); err != nil {\n\t\treturn err\n\t}\n\tif err := s.AddGeneratedConversionFunc((*PoolDevice)(nil), (*ignite.PoolDevice)(nil), func(a, b interface{}, scope conversion.Scope) error {\n\t\treturn Convert_v1alpha4_PoolDevice_To_ignite_PoolDevice(a.(*PoolDevice), b.(*ignite.PoolDevice), scope)\n\t}); err != nil {\n\t\treturn err\n\t}\n\tif err := s.AddGeneratedConversionFunc((*ignite.PoolDevice)(nil), (*PoolDevice)(nil), func(a, b interface{}, scope conversion.Scope) error {\n\t\treturn Convert_ignite_PoolDevice_To_v1alpha4_PoolDevice(a.(*ignite.PoolDevice), b.(*PoolDevice), scope)\n\t}); err != nil {\n\t\treturn err\n\t}\n\tif err := s.AddGeneratedConversionFunc((*PoolSpec)(nil), (*ignite.PoolSpec)(nil), func(a, b interface{}, scope conversion.Scope) error {\n\t\treturn Convert_v1alpha4_PoolSpec_To_ignite_PoolSpec(a.(*PoolSpec), b.(*ignite.PoolSpec), scope)\n\t}); err != nil {\n\t\treturn err\n\t}\n\tif err := s.AddGeneratedConversionFunc((*ignite.PoolSpec)(nil), (*PoolSpec)(nil), func(a, b interface{}, scope conversion.Scope) error {\n\t\treturn Convert_ignite_PoolSpec_To_v1alpha4_PoolSpec(a.(*ignite.PoolSpec), b.(*PoolSpec), scope)\n\t}); err != nil {\n\t\treturn err\n\t}\n\tif err := s.AddGeneratedConversionFunc((*PoolStatus)(nil), (*ignite.PoolStatus)(nil), func(a, b interface{}, scope conversion.Scope) error {\n\t\treturn Convert_v1alpha4_PoolStatus_To_ignite_PoolStatus(a.(*PoolStatus), b.(*ignite.PoolStatus), scope)\n\t}); err != nil {\n\t\treturn err\n\t}\n\tif err := s.AddGeneratedConversionFunc((*ignite.PoolStatus)(nil), (*PoolStatus)(nil), func(a, b interface{}, scope conversion.Scope) error {\n\t\treturn Convert_ignite_PoolStatus_To_v1alpha4_PoolStatus(a.(*ignite.PoolStatus), b.(*PoolStatus), scope)\n\t}); err != nil {\n\t\treturn err\n\t}\n\tif err := s.AddGeneratedConversionFunc((*Runtime)(nil), (*ignite.Runtime)(nil), func(a, b interface{}, scope conversion.Scope) error {\n\t\treturn Convert_v1alpha4_Runtime_To_ignite_Runtime(a.(*Runtime), b.(*ignite.Runtime), scope)\n\t}); err != nil {\n\t\treturn err\n\t}\n\tif err := s.AddGeneratedConversionFunc((*ignite.Runtime)(nil), (*Runtime)(nil), func(a, b interface{}, scope conversion.Scope) error {\n\t\treturn Convert_ignite_Runtime_To_v1alpha4_Runtime(a.(*ignite.Runtime), b.(*Runtime), scope)\n\t}); err != nil {\n\t\treturn err\n\t}\n\tif err := s.AddGeneratedConversionFunc((*SSH)(nil), (*ignite.SSH)(nil), func(a, b interface{}, scope conversion.Scope) error {\n\t\treturn Convert_v1alpha4_SSH_To_ignite_SSH(a.(*SSH), b.(*ignite.SSH), scope)\n\t}); err != nil {\n\t\treturn err\n\t}\n\tif err := s.AddGeneratedConversionFunc((*ignite.SSH)(nil), (*SSH)(nil), func(a, b interface{}, scope conversion.Scope) error {\n\t\treturn Convert_ignite_SSH_To_v1alpha4_SSH(a.(*ignite.SSH), b.(*SSH), scope)\n\t}); err != nil {\n\t\treturn err\n\t}\n\tif err := s.AddGeneratedConversionFunc((*VM)(nil), (*ignite.VM)(nil), func(a, b interface{}, scope conversion.Scope) error {\n\t\treturn Convert_v1alpha4_VM_To_ignite_VM(a.(*VM), b.(*ignite.VM), scope)\n\t}); err != nil {\n\t\treturn err\n\t}\n\tif err := s.AddGeneratedConversionFunc((*ignite.VM)(nil), (*VM)(nil), func(a, b interface{}, scope conversion.Scope) error {\n\t\treturn Convert_ignite_VM_To_v1alpha4_VM(a.(*ignite.VM), b.(*VM), scope)\n\t}); err != nil {\n\t\treturn err\n\t}\n\tif err := s.AddGeneratedConversionFunc((*VMImageSpec)(nil), (*ignite.VMImageSpec)(nil), func(a, b interface{}, scope conversion.Scope) error {\n\t\treturn Convert_v1alpha4_VMImageSpec_To_ignite_VMImageSpec(a.(*VMImageSpec), b.(*ignite.VMImageSpec), scope)\n\t}); err != nil {\n\t\treturn err\n\t}\n\tif err := s.AddGeneratedConversionFunc((*ignite.VMImageSpec)(nil), (*VMImageSpec)(nil), func(a, b interface{}, scope conversion.Scope) error {\n\t\treturn Convert_ignite_VMImageSpec_To_v1alpha4_VMImageSpec(a.(*ignite.VMImageSpec), b.(*VMImageSpec), scope)\n\t}); err != nil {\n\t\treturn err\n\t}\n\tif err := s.AddGeneratedConversionFunc((*VMKernelSpec)(nil), (*ignite.VMKernelSpec)(nil), func(a, b interface{}, scope conversion.Scope) error {\n\t\treturn Convert_v1alpha4_VMKernelSpec_To_ignite_VMKernelSpec(a.(*VMKernelSpec), b.(*ignite.VMKernelSpec), scope)\n\t}); err != nil {\n\t\treturn err\n\t}\n\tif err := s.AddGeneratedConversionFunc((*ignite.VMKernelSpec)(nil), (*VMKernelSpec)(nil), func(a, b interface{}, scope conversion.Scope) error {\n\t\treturn Convert_ignite_VMKernelSpec_To_v1alpha4_VMKernelSpec(a.(*ignite.VMKernelSpec), b.(*VMKernelSpec), scope)\n\t}); err != nil {\n\t\treturn err\n\t}\n\tif err := s.AddGeneratedConversionFunc((*VMNetworkSpec)(nil), (*ignite.VMNetworkSpec)(nil), func(a, b interface{}, scope conversion.Scope) error {\n\t\treturn Convert_v1alpha4_VMNetworkSpec_To_ignite_VMNetworkSpec(a.(*VMNetworkSpec), b.(*ignite.VMNetworkSpec), scope)\n\t}); err != nil {\n\t\treturn err\n\t}\n\tif err := s.AddGeneratedConversionFunc((*ignite.VMNetworkSpec)(nil), (*VMNetworkSpec)(nil), func(a, b interface{}, scope conversion.Scope) error {\n\t\treturn Convert_ignite_VMNetworkSpec_To_v1alpha4_VMNetworkSpec(a.(*ignite.VMNetworkSpec), b.(*VMNetworkSpec), scope)\n\t}); err != nil {\n\t\treturn err\n\t}\n\tif err := s.AddGeneratedConversionFunc((*VMSandboxSpec)(nil), (*ignite.VMSandboxSpec)(nil), func(a, b interface{}, scope conversion.Scope) error {\n\t\treturn Convert_v1alpha4_VMSandboxSpec_To_ignite_VMSandboxSpec(a.(*VMSandboxSpec), b.(*ignite.VMSandboxSpec), scope)\n\t}); err != nil {\n\t\treturn err\n\t}\n\tif err := s.AddGeneratedConversionFunc((*ignite.VMSandboxSpec)(nil), (*VMSandboxSpec)(nil), func(a, b interface{}, scope conversion.Scope) error {\n\t\treturn Convert_ignite_VMSandboxSpec_To_v1alpha4_VMSandboxSpec(a.(*ignite.VMSandboxSpec), b.(*VMSandboxSpec), scope)\n\t}); err != nil {\n\t\treturn err\n\t}\n\tif err := s.AddGeneratedConversionFunc((*VMSpec)(nil), (*ignite.VMSpec)(nil), func(a, b interface{}, scope conversion.Scope) error {\n\t\treturn Convert_v1alpha4_VMSpec_To_ignite_VMSpec(a.(*VMSpec), b.(*ignite.VMSpec), scope)\n\t}); err != nil {\n\t\treturn err\n\t}\n\tif err := s.AddGeneratedConversionFunc((*ignite.VMSpec)(nil), (*VMSpec)(nil), func(a, b interface{}, scope conversion.Scope) error {\n\t\treturn Convert_ignite_VMSpec_To_v1alpha4_VMSpec(a.(*ignite.VMSpec), b.(*VMSpec), scope)\n\t}); err != nil {\n\t\treturn err\n\t}\n\tif err := s.AddGeneratedConversionFunc((*VMStatus)(nil), (*ignite.VMStatus)(nil), func(a, b interface{}, scope conversion.Scope) error {\n\t\treturn Convert_v1alpha4_VMStatus_To_ignite_VMStatus(a.(*VMStatus), b.(*ignite.VMStatus), scope)\n\t}); err != nil {\n\t\treturn err\n\t}\n\tif err := s.AddGeneratedConversionFunc((*ignite.VMStatus)(nil), (*VMStatus)(nil), func(a, b interface{}, scope conversion.Scope) error {\n\t\treturn Convert_ignite_VMStatus_To_v1alpha4_VMStatus(a.(*ignite.VMStatus), b.(*VMStatus), scope)\n\t}); err != nil {\n\t\treturn err\n\t}\n\tif err := s.AddGeneratedConversionFunc((*VMStorageSpec)(nil), (*ignite.VMStorageSpec)(nil), func(a, b interface{}, scope conversion.Scope) error {\n\t\treturn Convert_v1alpha4_VMStorageSpec_To_ignite_VMStorageSpec(a.(*VMStorageSpec), b.(*ignite.VMStorageSpec), scope)\n\t}); err != nil {\n\t\treturn err\n\t}\n\tif err := s.AddGeneratedConversionFunc((*ignite.VMStorageSpec)(nil), (*VMStorageSpec)(nil), func(a, b interface{}, scope conversion.Scope) error {\n\t\treturn Convert_ignite_VMStorageSpec_To_v1alpha4_VMStorageSpec(a.(*ignite.VMStorageSpec), b.(*VMStorageSpec), scope)\n\t}); err != nil {\n\t\treturn err\n\t}\n\tif err := s.AddGeneratedConversionFunc((*Volume)(nil), (*ignite.Volume)(nil), func(a, b interface{}, scope conversion.Scope) error {\n\t\treturn Convert_v1alpha4_Volume_To_ignite_Volume(a.(*Volume), b.(*ignite.Volume), scope)\n\t}); err != nil {\n\t\treturn err\n\t}\n\tif err := s.AddGeneratedConversionFunc((*ignite.Volume)(nil), (*Volume)(nil), func(a, b interface{}, scope conversion.Scope) error {\n\t\treturn Convert_ignite_Volume_To_v1alpha4_Volume(a.(*ignite.Volume), b.(*Volume), scope)\n\t}); err != nil {\n\t\treturn err\n\t}\n\tif err := s.AddGeneratedConversionFunc((*VolumeMount)(nil), (*ignite.VolumeMount)(nil), func(a, b interface{}, scope conversion.Scope) error {\n\t\treturn Convert_v1alpha4_VolumeMount_To_ignite_VolumeMount(a.(*VolumeMount), b.(*ignite.VolumeMount), scope)\n\t}); err != nil {\n\t\treturn err\n\t}\n\tif err := s.AddGeneratedConversionFunc((*ignite.VolumeMount)(nil), (*VolumeMount)(nil), func(a, b interface{}, scope conversion.Scope) error {\n\t\treturn Convert_ignite_VolumeMount_To_v1alpha4_VolumeMount(a.(*ignite.VolumeMount), b.(*VolumeMount), scope)\n\t}); err != nil {\n\t\treturn err\n\t}\n\treturn nil\n}", "title": "" }, { "docid": "9f5895991b6506d45f34eca7e268af11", "score": "0.68052214", "text": "func RegisterConversions(s *runtime.Scheme) error {\n\tif err := s.AddGeneratedConversionFunc((*AWSManagedControlPlane)(nil), (*v1alpha4.AWSManagedControlPlane)(nil), func(a, b interface{}, scope conversion.Scope) error {\n\t\treturn Convert_v1alpha3_AWSManagedControlPlane_To_v1alpha4_AWSManagedControlPlane(a.(*AWSManagedControlPlane), b.(*v1alpha4.AWSManagedControlPlane), scope)\n\t}); err != nil {\n\t\treturn err\n\t}\n\tif err := s.AddGeneratedConversionFunc((*v1alpha4.AWSManagedControlPlane)(nil), (*AWSManagedControlPlane)(nil), func(a, b interface{}, scope conversion.Scope) error {\n\t\treturn Convert_v1alpha4_AWSManagedControlPlane_To_v1alpha3_AWSManagedControlPlane(a.(*v1alpha4.AWSManagedControlPlane), b.(*AWSManagedControlPlane), scope)\n\t}); err != nil {\n\t\treturn err\n\t}\n\tif err := s.AddGeneratedConversionFunc((*AWSManagedControlPlaneList)(nil), (*v1alpha4.AWSManagedControlPlaneList)(nil), func(a, b interface{}, scope conversion.Scope) error {\n\t\treturn Convert_v1alpha3_AWSManagedControlPlaneList_To_v1alpha4_AWSManagedControlPlaneList(a.(*AWSManagedControlPlaneList), b.(*v1alpha4.AWSManagedControlPlaneList), scope)\n\t}); err != nil {\n\t\treturn err\n\t}\n\tif err := s.AddGeneratedConversionFunc((*v1alpha4.AWSManagedControlPlaneList)(nil), (*AWSManagedControlPlaneList)(nil), func(a, b interface{}, scope conversion.Scope) error {\n\t\treturn Convert_v1alpha4_AWSManagedControlPlaneList_To_v1alpha3_AWSManagedControlPlaneList(a.(*v1alpha4.AWSManagedControlPlaneList), b.(*AWSManagedControlPlaneList), scope)\n\t}); err != nil {\n\t\treturn err\n\t}\n\tif err := s.AddGeneratedConversionFunc((*AWSManagedControlPlaneSpec)(nil), (*v1alpha4.AWSManagedControlPlaneSpec)(nil), func(a, b interface{}, scope conversion.Scope) error {\n\t\treturn Convert_v1alpha3_AWSManagedControlPlaneSpec_To_v1alpha4_AWSManagedControlPlaneSpec(a.(*AWSManagedControlPlaneSpec), b.(*v1alpha4.AWSManagedControlPlaneSpec), scope)\n\t}); err != nil {\n\t\treturn err\n\t}\n\tif err := s.AddGeneratedConversionFunc((*v1alpha4.AWSManagedControlPlaneSpec)(nil), (*AWSManagedControlPlaneSpec)(nil), func(a, b interface{}, scope conversion.Scope) error {\n\t\treturn Convert_v1alpha4_AWSManagedControlPlaneSpec_To_v1alpha3_AWSManagedControlPlaneSpec(a.(*v1alpha4.AWSManagedControlPlaneSpec), b.(*AWSManagedControlPlaneSpec), scope)\n\t}); err != nil {\n\t\treturn err\n\t}\n\tif err := s.AddGeneratedConversionFunc((*AWSManagedControlPlaneStatus)(nil), (*v1alpha4.AWSManagedControlPlaneStatus)(nil), func(a, b interface{}, scope conversion.Scope) error {\n\t\treturn Convert_v1alpha3_AWSManagedControlPlaneStatus_To_v1alpha4_AWSManagedControlPlaneStatus(a.(*AWSManagedControlPlaneStatus), b.(*v1alpha4.AWSManagedControlPlaneStatus), scope)\n\t}); err != nil {\n\t\treturn err\n\t}\n\tif err := s.AddGeneratedConversionFunc((*v1alpha4.AWSManagedControlPlaneStatus)(nil), (*AWSManagedControlPlaneStatus)(nil), func(a, b interface{}, scope conversion.Scope) error {\n\t\treturn Convert_v1alpha4_AWSManagedControlPlaneStatus_To_v1alpha3_AWSManagedControlPlaneStatus(a.(*v1alpha4.AWSManagedControlPlaneStatus), b.(*AWSManagedControlPlaneStatus), scope)\n\t}); err != nil {\n\t\treturn err\n\t}\n\tif err := s.AddGeneratedConversionFunc((*Addon)(nil), (*v1alpha4.Addon)(nil), func(a, b interface{}, scope conversion.Scope) error {\n\t\treturn Convert_v1alpha3_Addon_To_v1alpha4_Addon(a.(*Addon), b.(*v1alpha4.Addon), scope)\n\t}); err != nil {\n\t\treturn err\n\t}\n\tif err := s.AddGeneratedConversionFunc((*v1alpha4.Addon)(nil), (*Addon)(nil), func(a, b interface{}, scope conversion.Scope) error {\n\t\treturn Convert_v1alpha4_Addon_To_v1alpha3_Addon(a.(*v1alpha4.Addon), b.(*Addon), scope)\n\t}); err != nil {\n\t\treturn err\n\t}\n\tif err := s.AddGeneratedConversionFunc((*AddonIssue)(nil), (*v1alpha4.AddonIssue)(nil), func(a, b interface{}, scope conversion.Scope) error {\n\t\treturn Convert_v1alpha3_AddonIssue_To_v1alpha4_AddonIssue(a.(*AddonIssue), b.(*v1alpha4.AddonIssue), scope)\n\t}); err != nil {\n\t\treturn err\n\t}\n\tif err := s.AddGeneratedConversionFunc((*v1alpha4.AddonIssue)(nil), (*AddonIssue)(nil), func(a, b interface{}, scope conversion.Scope) error {\n\t\treturn Convert_v1alpha4_AddonIssue_To_v1alpha3_AddonIssue(a.(*v1alpha4.AddonIssue), b.(*AddonIssue), scope)\n\t}); err != nil {\n\t\treturn err\n\t}\n\tif err := s.AddGeneratedConversionFunc((*AddonState)(nil), (*v1alpha4.AddonState)(nil), func(a, b interface{}, scope conversion.Scope) error {\n\t\treturn Convert_v1alpha3_AddonState_To_v1alpha4_AddonState(a.(*AddonState), b.(*v1alpha4.AddonState), scope)\n\t}); err != nil {\n\t\treturn err\n\t}\n\tif err := s.AddGeneratedConversionFunc((*v1alpha4.AddonState)(nil), (*AddonState)(nil), func(a, b interface{}, scope conversion.Scope) error {\n\t\treturn Convert_v1alpha4_AddonState_To_v1alpha3_AddonState(a.(*v1alpha4.AddonState), b.(*AddonState), scope)\n\t}); err != nil {\n\t\treturn err\n\t}\n\tif err := s.AddGeneratedConversionFunc((*ControlPlaneLoggingSpec)(nil), (*v1alpha4.ControlPlaneLoggingSpec)(nil), func(a, b interface{}, scope conversion.Scope) error {\n\t\treturn Convert_v1alpha3_ControlPlaneLoggingSpec_To_v1alpha4_ControlPlaneLoggingSpec(a.(*ControlPlaneLoggingSpec), b.(*v1alpha4.ControlPlaneLoggingSpec), scope)\n\t}); err != nil {\n\t\treturn err\n\t}\n\tif err := s.AddGeneratedConversionFunc((*v1alpha4.ControlPlaneLoggingSpec)(nil), (*ControlPlaneLoggingSpec)(nil), func(a, b interface{}, scope conversion.Scope) error {\n\t\treturn Convert_v1alpha4_ControlPlaneLoggingSpec_To_v1alpha3_ControlPlaneLoggingSpec(a.(*v1alpha4.ControlPlaneLoggingSpec), b.(*ControlPlaneLoggingSpec), scope)\n\t}); err != nil {\n\t\treturn err\n\t}\n\tif err := s.AddGeneratedConversionFunc((*EncryptionConfig)(nil), (*v1alpha4.EncryptionConfig)(nil), func(a, b interface{}, scope conversion.Scope) error {\n\t\treturn Convert_v1alpha3_EncryptionConfig_To_v1alpha4_EncryptionConfig(a.(*EncryptionConfig), b.(*v1alpha4.EncryptionConfig), scope)\n\t}); err != nil {\n\t\treturn err\n\t}\n\tif err := s.AddGeneratedConversionFunc((*v1alpha4.EncryptionConfig)(nil), (*EncryptionConfig)(nil), func(a, b interface{}, scope conversion.Scope) error {\n\t\treturn Convert_v1alpha4_EncryptionConfig_To_v1alpha3_EncryptionConfig(a.(*v1alpha4.EncryptionConfig), b.(*EncryptionConfig), scope)\n\t}); err != nil {\n\t\treturn err\n\t}\n\tif err := s.AddGeneratedConversionFunc((*EndpointAccess)(nil), (*v1alpha4.EndpointAccess)(nil), func(a, b interface{}, scope conversion.Scope) error {\n\t\treturn Convert_v1alpha3_EndpointAccess_To_v1alpha4_EndpointAccess(a.(*EndpointAccess), b.(*v1alpha4.EndpointAccess), scope)\n\t}); err != nil {\n\t\treturn err\n\t}\n\tif err := s.AddGeneratedConversionFunc((*v1alpha4.EndpointAccess)(nil), (*EndpointAccess)(nil), func(a, b interface{}, scope conversion.Scope) error {\n\t\treturn Convert_v1alpha4_EndpointAccess_To_v1alpha3_EndpointAccess(a.(*v1alpha4.EndpointAccess), b.(*EndpointAccess), scope)\n\t}); err != nil {\n\t\treturn err\n\t}\n\tif err := s.AddGeneratedConversionFunc((*IAMAuthenticatorConfig)(nil), (*v1alpha4.IAMAuthenticatorConfig)(nil), func(a, b interface{}, scope conversion.Scope) error {\n\t\treturn Convert_v1alpha3_IAMAuthenticatorConfig_To_v1alpha4_IAMAuthenticatorConfig(a.(*IAMAuthenticatorConfig), b.(*v1alpha4.IAMAuthenticatorConfig), scope)\n\t}); err != nil {\n\t\treturn err\n\t}\n\tif err := s.AddGeneratedConversionFunc((*v1alpha4.IAMAuthenticatorConfig)(nil), (*IAMAuthenticatorConfig)(nil), func(a, b interface{}, scope conversion.Scope) error {\n\t\treturn Convert_v1alpha4_IAMAuthenticatorConfig_To_v1alpha3_IAMAuthenticatorConfig(a.(*v1alpha4.IAMAuthenticatorConfig), b.(*IAMAuthenticatorConfig), scope)\n\t}); err != nil {\n\t\treturn err\n\t}\n\tif err := s.AddGeneratedConversionFunc((*KubernetesMapping)(nil), (*v1alpha4.KubernetesMapping)(nil), func(a, b interface{}, scope conversion.Scope) error {\n\t\treturn Convert_v1alpha3_KubernetesMapping_To_v1alpha4_KubernetesMapping(a.(*KubernetesMapping), b.(*v1alpha4.KubernetesMapping), scope)\n\t}); err != nil {\n\t\treturn err\n\t}\n\tif err := s.AddGeneratedConversionFunc((*v1alpha4.KubernetesMapping)(nil), (*KubernetesMapping)(nil), func(a, b interface{}, scope conversion.Scope) error {\n\t\treturn Convert_v1alpha4_KubernetesMapping_To_v1alpha3_KubernetesMapping(a.(*v1alpha4.KubernetesMapping), b.(*KubernetesMapping), scope)\n\t}); err != nil {\n\t\treturn err\n\t}\n\tif err := s.AddGeneratedConversionFunc((*OIDCProviderStatus)(nil), (*v1alpha4.OIDCProviderStatus)(nil), func(a, b interface{}, scope conversion.Scope) error {\n\t\treturn Convert_v1alpha3_OIDCProviderStatus_To_v1alpha4_OIDCProviderStatus(a.(*OIDCProviderStatus), b.(*v1alpha4.OIDCProviderStatus), scope)\n\t}); err != nil {\n\t\treturn err\n\t}\n\tif err := s.AddGeneratedConversionFunc((*v1alpha4.OIDCProviderStatus)(nil), (*OIDCProviderStatus)(nil), func(a, b interface{}, scope conversion.Scope) error {\n\t\treturn Convert_v1alpha4_OIDCProviderStatus_To_v1alpha3_OIDCProviderStatus(a.(*v1alpha4.OIDCProviderStatus), b.(*OIDCProviderStatus), scope)\n\t}); err != nil {\n\t\treturn err\n\t}\n\tif err := s.AddGeneratedConversionFunc((*RoleMapping)(nil), (*v1alpha4.RoleMapping)(nil), func(a, b interface{}, scope conversion.Scope) error {\n\t\treturn Convert_v1alpha3_RoleMapping_To_v1alpha4_RoleMapping(a.(*RoleMapping), b.(*v1alpha4.RoleMapping), scope)\n\t}); err != nil {\n\t\treturn err\n\t}\n\tif err := s.AddGeneratedConversionFunc((*v1alpha4.RoleMapping)(nil), (*RoleMapping)(nil), func(a, b interface{}, scope conversion.Scope) error {\n\t\treturn Convert_v1alpha4_RoleMapping_To_v1alpha3_RoleMapping(a.(*v1alpha4.RoleMapping), b.(*RoleMapping), scope)\n\t}); err != nil {\n\t\treturn err\n\t}\n\tif err := s.AddGeneratedConversionFunc((*UserMapping)(nil), (*v1alpha4.UserMapping)(nil), func(a, b interface{}, scope conversion.Scope) error {\n\t\treturn Convert_v1alpha3_UserMapping_To_v1alpha4_UserMapping(a.(*UserMapping), b.(*v1alpha4.UserMapping), scope)\n\t}); err != nil {\n\t\treturn err\n\t}\n\tif err := s.AddGeneratedConversionFunc((*v1alpha4.UserMapping)(nil), (*UserMapping)(nil), func(a, b interface{}, scope conversion.Scope) error {\n\t\treturn Convert_v1alpha4_UserMapping_To_v1alpha3_UserMapping(a.(*v1alpha4.UserMapping), b.(*UserMapping), scope)\n\t}); err != nil {\n\t\treturn err\n\t}\n\tif err := s.AddConversionFunc((*apiv1alpha3.APIEndpoint)(nil), (*apiv1alpha4.APIEndpoint)(nil), func(a, b interface{}, scope conversion.Scope) error {\n\t\treturn Convert_v1alpha3_APIEndpoint_To_v1alpha4_APIEndpoint(a.(*apiv1alpha3.APIEndpoint), b.(*apiv1alpha4.APIEndpoint), scope)\n\t}); err != nil {\n\t\treturn err\n\t}\n\tif err := s.AddConversionFunc((*clusterapiproviderawsapiv1alpha3.Bastion)(nil), (*clusterapiproviderawsapiv1alpha4.Bastion)(nil), func(a, b interface{}, scope conversion.Scope) error {\n\t\treturn Convert_v1alpha3_Bastion_To_v1alpha4_Bastion(a.(*clusterapiproviderawsapiv1alpha3.Bastion), b.(*clusterapiproviderawsapiv1alpha4.Bastion), scope)\n\t}); err != nil {\n\t\treturn err\n\t}\n\tif err := s.AddConversionFunc((*clusterapiproviderawsapiv1alpha3.NetworkSpec)(nil), (*clusterapiproviderawsapiv1alpha4.NetworkSpec)(nil), func(a, b interface{}, scope conversion.Scope) error {\n\t\treturn Convert_v1alpha3_NetworkSpec_To_v1alpha4_NetworkSpec(a.(*clusterapiproviderawsapiv1alpha3.NetworkSpec), b.(*clusterapiproviderawsapiv1alpha4.NetworkSpec), scope)\n\t}); err != nil {\n\t\treturn err\n\t}\n\tif err := s.AddConversionFunc((*clusterapiproviderawsapiv1alpha3.Network)(nil), (*clusterapiproviderawsapiv1alpha4.Network)(nil), func(a, b interface{}, scope conversion.Scope) error {\n\t\treturn Convert_v1alpha3_Network_To_v1alpha4_Network(a.(*clusterapiproviderawsapiv1alpha3.Network), b.(*clusterapiproviderawsapiv1alpha4.Network), scope)\n\t}); err != nil {\n\t\treturn err\n\t}\n\tif err := s.AddConversionFunc((*apiv1alpha4.APIEndpoint)(nil), (*apiv1alpha3.APIEndpoint)(nil), func(a, b interface{}, scope conversion.Scope) error {\n\t\treturn Convert_v1alpha4_APIEndpoint_To_v1alpha3_APIEndpoint(a.(*apiv1alpha4.APIEndpoint), b.(*apiv1alpha3.APIEndpoint), scope)\n\t}); err != nil {\n\t\treturn err\n\t}\n\tif err := s.AddConversionFunc((*clusterapiproviderawsapiv1alpha4.Bastion)(nil), (*clusterapiproviderawsapiv1alpha3.Bastion)(nil), func(a, b interface{}, scope conversion.Scope) error {\n\t\treturn Convert_v1alpha4_Bastion_To_v1alpha3_Bastion(a.(*clusterapiproviderawsapiv1alpha4.Bastion), b.(*clusterapiproviderawsapiv1alpha3.Bastion), scope)\n\t}); err != nil {\n\t\treturn err\n\t}\n\tif err := s.AddConversionFunc((*clusterapiproviderawsapiv1alpha4.NetworkSpec)(nil), (*clusterapiproviderawsapiv1alpha3.NetworkSpec)(nil), func(a, b interface{}, scope conversion.Scope) error {\n\t\treturn Convert_v1alpha4_NetworkSpec_To_v1alpha3_NetworkSpec(a.(*clusterapiproviderawsapiv1alpha4.NetworkSpec), b.(*clusterapiproviderawsapiv1alpha3.NetworkSpec), scope)\n\t}); err != nil {\n\t\treturn err\n\t}\n\tif err := s.AddConversionFunc((*clusterapiproviderawsapiv1alpha4.Network)(nil), (*clusterapiproviderawsapiv1alpha3.Network)(nil), func(a, b interface{}, scope conversion.Scope) error {\n\t\treturn Convert_v1alpha4_Network_To_v1alpha3_Network(a.(*clusterapiproviderawsapiv1alpha4.Network), b.(*clusterapiproviderawsapiv1alpha3.Network), scope)\n\t}); err != nil {\n\t\treturn err\n\t}\n\treturn nil\n}", "title": "" }, { "docid": "01b0176d544f02d47a66e19d3eb05de0", "score": "0.67945725", "text": "func RegisterConversions(s *runtime.Scheme) error {\n\tif err := s.AddGeneratedConversionFunc((*AWSCluster)(nil), (*v1alpha3.AWSCluster)(nil), func(a, b interface{}, scope conversion.Scope) error {\n\t\treturn Convert_v1alpha2_AWSCluster_To_v1alpha3_AWSCluster(a.(*AWSCluster), b.(*v1alpha3.AWSCluster), scope)\n\t}); err != nil {\n\t\treturn err\n\t}\n\tif err := s.AddGeneratedConversionFunc((*v1alpha3.AWSCluster)(nil), (*AWSCluster)(nil), func(a, b interface{}, scope conversion.Scope) error {\n\t\treturn Convert_v1alpha3_AWSCluster_To_v1alpha2_AWSCluster(a.(*v1alpha3.AWSCluster), b.(*AWSCluster), scope)\n\t}); err != nil {\n\t\treturn err\n\t}\n\tif err := s.AddGeneratedConversionFunc((*AWSClusterList)(nil), (*v1alpha3.AWSClusterList)(nil), func(a, b interface{}, scope conversion.Scope) error {\n\t\treturn Convert_v1alpha2_AWSClusterList_To_v1alpha3_AWSClusterList(a.(*AWSClusterList), b.(*v1alpha3.AWSClusterList), scope)\n\t}); err != nil {\n\t\treturn err\n\t}\n\tif err := s.AddGeneratedConversionFunc((*v1alpha3.AWSClusterList)(nil), (*AWSClusterList)(nil), func(a, b interface{}, scope conversion.Scope) error {\n\t\treturn Convert_v1alpha3_AWSClusterList_To_v1alpha2_AWSClusterList(a.(*v1alpha3.AWSClusterList), b.(*AWSClusterList), scope)\n\t}); err != nil {\n\t\treturn err\n\t}\n\tif err := s.AddGeneratedConversionFunc((*AWSLoadBalancerSpec)(nil), (*v1alpha3.AWSLoadBalancerSpec)(nil), func(a, b interface{}, scope conversion.Scope) error {\n\t\treturn Convert_v1alpha2_AWSLoadBalancerSpec_To_v1alpha3_AWSLoadBalancerSpec(a.(*AWSLoadBalancerSpec), b.(*v1alpha3.AWSLoadBalancerSpec), scope)\n\t}); err != nil {\n\t\treturn err\n\t}\n\tif err := s.AddGeneratedConversionFunc((*AWSMachine)(nil), (*v1alpha3.AWSMachine)(nil), func(a, b interface{}, scope conversion.Scope) error {\n\t\treturn Convert_v1alpha2_AWSMachine_To_v1alpha3_AWSMachine(a.(*AWSMachine), b.(*v1alpha3.AWSMachine), scope)\n\t}); err != nil {\n\t\treturn err\n\t}\n\tif err := s.AddGeneratedConversionFunc((*v1alpha3.AWSMachine)(nil), (*AWSMachine)(nil), func(a, b interface{}, scope conversion.Scope) error {\n\t\treturn Convert_v1alpha3_AWSMachine_To_v1alpha2_AWSMachine(a.(*v1alpha3.AWSMachine), b.(*AWSMachine), scope)\n\t}); err != nil {\n\t\treturn err\n\t}\n\tif err := s.AddGeneratedConversionFunc((*AWSMachineList)(nil), (*v1alpha3.AWSMachineList)(nil), func(a, b interface{}, scope conversion.Scope) error {\n\t\treturn Convert_v1alpha2_AWSMachineList_To_v1alpha3_AWSMachineList(a.(*AWSMachineList), b.(*v1alpha3.AWSMachineList), scope)\n\t}); err != nil {\n\t\treturn err\n\t}\n\tif err := s.AddGeneratedConversionFunc((*v1alpha3.AWSMachineList)(nil), (*AWSMachineList)(nil), func(a, b interface{}, scope conversion.Scope) error {\n\t\treturn Convert_v1alpha3_AWSMachineList_To_v1alpha2_AWSMachineList(a.(*v1alpha3.AWSMachineList), b.(*AWSMachineList), scope)\n\t}); err != nil {\n\t\treturn err\n\t}\n\tif err := s.AddGeneratedConversionFunc((*AWSMachineTemplate)(nil), (*v1alpha3.AWSMachineTemplate)(nil), func(a, b interface{}, scope conversion.Scope) error {\n\t\treturn Convert_v1alpha2_AWSMachineTemplate_To_v1alpha3_AWSMachineTemplate(a.(*AWSMachineTemplate), b.(*v1alpha3.AWSMachineTemplate), scope)\n\t}); err != nil {\n\t\treturn err\n\t}\n\tif err := s.AddGeneratedConversionFunc((*v1alpha3.AWSMachineTemplate)(nil), (*AWSMachineTemplate)(nil), func(a, b interface{}, scope conversion.Scope) error {\n\t\treturn Convert_v1alpha3_AWSMachineTemplate_To_v1alpha2_AWSMachineTemplate(a.(*v1alpha3.AWSMachineTemplate), b.(*AWSMachineTemplate), scope)\n\t}); err != nil {\n\t\treturn err\n\t}\n\tif err := s.AddGeneratedConversionFunc((*AWSMachineTemplateList)(nil), (*v1alpha3.AWSMachineTemplateList)(nil), func(a, b interface{}, scope conversion.Scope) error {\n\t\treturn Convert_v1alpha2_AWSMachineTemplateList_To_v1alpha3_AWSMachineTemplateList(a.(*AWSMachineTemplateList), b.(*v1alpha3.AWSMachineTemplateList), scope)\n\t}); err != nil {\n\t\treturn err\n\t}\n\tif err := s.AddGeneratedConversionFunc((*v1alpha3.AWSMachineTemplateList)(nil), (*AWSMachineTemplateList)(nil), func(a, b interface{}, scope conversion.Scope) error {\n\t\treturn Convert_v1alpha3_AWSMachineTemplateList_To_v1alpha2_AWSMachineTemplateList(a.(*v1alpha3.AWSMachineTemplateList), b.(*AWSMachineTemplateList), scope)\n\t}); err != nil {\n\t\treturn err\n\t}\n\tif err := s.AddGeneratedConversionFunc((*AWSMachineTemplateResource)(nil), (*v1alpha3.AWSMachineTemplateResource)(nil), func(a, b interface{}, scope conversion.Scope) error {\n\t\treturn Convert_v1alpha2_AWSMachineTemplateResource_To_v1alpha3_AWSMachineTemplateResource(a.(*AWSMachineTemplateResource), b.(*v1alpha3.AWSMachineTemplateResource), scope)\n\t}); err != nil {\n\t\treturn err\n\t}\n\tif err := s.AddGeneratedConversionFunc((*v1alpha3.AWSMachineTemplateResource)(nil), (*AWSMachineTemplateResource)(nil), func(a, b interface{}, scope conversion.Scope) error {\n\t\treturn Convert_v1alpha3_AWSMachineTemplateResource_To_v1alpha2_AWSMachineTemplateResource(a.(*v1alpha3.AWSMachineTemplateResource), b.(*AWSMachineTemplateResource), scope)\n\t}); err != nil {\n\t\treturn err\n\t}\n\tif err := s.AddGeneratedConversionFunc((*AWSMachineTemplateSpec)(nil), (*v1alpha3.AWSMachineTemplateSpec)(nil), func(a, b interface{}, scope conversion.Scope) error {\n\t\treturn Convert_v1alpha2_AWSMachineTemplateSpec_To_v1alpha3_AWSMachineTemplateSpec(a.(*AWSMachineTemplateSpec), b.(*v1alpha3.AWSMachineTemplateSpec), scope)\n\t}); err != nil {\n\t\treturn err\n\t}\n\tif err := s.AddGeneratedConversionFunc((*v1alpha3.AWSMachineTemplateSpec)(nil), (*AWSMachineTemplateSpec)(nil), func(a, b interface{}, scope conversion.Scope) error {\n\t\treturn Convert_v1alpha3_AWSMachineTemplateSpec_To_v1alpha2_AWSMachineTemplateSpec(a.(*v1alpha3.AWSMachineTemplateSpec), b.(*AWSMachineTemplateSpec), scope)\n\t}); err != nil {\n\t\treturn err\n\t}\n\tif err := s.AddGeneratedConversionFunc((*AWSResourceReference)(nil), (*v1alpha3.AWSResourceReference)(nil), func(a, b interface{}, scope conversion.Scope) error {\n\t\treturn Convert_v1alpha2_AWSResourceReference_To_v1alpha3_AWSResourceReference(a.(*AWSResourceReference), b.(*v1alpha3.AWSResourceReference), scope)\n\t}); err != nil {\n\t\treturn err\n\t}\n\tif err := s.AddGeneratedConversionFunc((*v1alpha3.AWSResourceReference)(nil), (*AWSResourceReference)(nil), func(a, b interface{}, scope conversion.Scope) error {\n\t\treturn Convert_v1alpha3_AWSResourceReference_To_v1alpha2_AWSResourceReference(a.(*v1alpha3.AWSResourceReference), b.(*AWSResourceReference), scope)\n\t}); err != nil {\n\t\treturn err\n\t}\n\tif err := s.AddGeneratedConversionFunc((*BuildParams)(nil), (*v1alpha3.BuildParams)(nil), func(a, b interface{}, scope conversion.Scope) error {\n\t\treturn Convert_v1alpha2_BuildParams_To_v1alpha3_BuildParams(a.(*BuildParams), b.(*v1alpha3.BuildParams), scope)\n\t}); err != nil {\n\t\treturn err\n\t}\n\tif err := s.AddGeneratedConversionFunc((*v1alpha3.BuildParams)(nil), (*BuildParams)(nil), func(a, b interface{}, scope conversion.Scope) error {\n\t\treturn Convert_v1alpha3_BuildParams_To_v1alpha2_BuildParams(a.(*v1alpha3.BuildParams), b.(*BuildParams), scope)\n\t}); err != nil {\n\t\treturn err\n\t}\n\tif err := s.AddGeneratedConversionFunc((*ClassicELB)(nil), (*v1alpha3.ClassicELB)(nil), func(a, b interface{}, scope conversion.Scope) error {\n\t\treturn Convert_v1alpha2_ClassicELB_To_v1alpha3_ClassicELB(a.(*ClassicELB), b.(*v1alpha3.ClassicELB), scope)\n\t}); err != nil {\n\t\treturn err\n\t}\n\tif err := s.AddGeneratedConversionFunc((*ClassicELBAttributes)(nil), (*v1alpha3.ClassicELBAttributes)(nil), func(a, b interface{}, scope conversion.Scope) error {\n\t\treturn Convert_v1alpha2_ClassicELBAttributes_To_v1alpha3_ClassicELBAttributes(a.(*ClassicELBAttributes), b.(*v1alpha3.ClassicELBAttributes), scope)\n\t}); err != nil {\n\t\treturn err\n\t}\n\tif err := s.AddGeneratedConversionFunc((*ClassicELBHealthCheck)(nil), (*v1alpha3.ClassicELBHealthCheck)(nil), func(a, b interface{}, scope conversion.Scope) error {\n\t\treturn Convert_v1alpha2_ClassicELBHealthCheck_To_v1alpha3_ClassicELBHealthCheck(a.(*ClassicELBHealthCheck), b.(*v1alpha3.ClassicELBHealthCheck), scope)\n\t}); err != nil {\n\t\treturn err\n\t}\n\tif err := s.AddGeneratedConversionFunc((*v1alpha3.ClassicELBHealthCheck)(nil), (*ClassicELBHealthCheck)(nil), func(a, b interface{}, scope conversion.Scope) error {\n\t\treturn Convert_v1alpha3_ClassicELBHealthCheck_To_v1alpha2_ClassicELBHealthCheck(a.(*v1alpha3.ClassicELBHealthCheck), b.(*ClassicELBHealthCheck), scope)\n\t}); err != nil {\n\t\treturn err\n\t}\n\tif err := s.AddGeneratedConversionFunc((*ClassicELBListener)(nil), (*v1alpha3.ClassicELBListener)(nil), func(a, b interface{}, scope conversion.Scope) error {\n\t\treturn Convert_v1alpha2_ClassicELBListener_To_v1alpha3_ClassicELBListener(a.(*ClassicELBListener), b.(*v1alpha3.ClassicELBListener), scope)\n\t}); err != nil {\n\t\treturn err\n\t}\n\tif err := s.AddGeneratedConversionFunc((*v1alpha3.ClassicELBListener)(nil), (*ClassicELBListener)(nil), func(a, b interface{}, scope conversion.Scope) error {\n\t\treturn Convert_v1alpha3_ClassicELBListener_To_v1alpha2_ClassicELBListener(a.(*v1alpha3.ClassicELBListener), b.(*ClassicELBListener), scope)\n\t}); err != nil {\n\t\treturn err\n\t}\n\tif err := s.AddGeneratedConversionFunc((*Filter)(nil), (*v1alpha3.Filter)(nil), func(a, b interface{}, scope conversion.Scope) error {\n\t\treturn Convert_v1alpha2_Filter_To_v1alpha3_Filter(a.(*Filter), b.(*v1alpha3.Filter), scope)\n\t}); err != nil {\n\t\treturn err\n\t}\n\tif err := s.AddGeneratedConversionFunc((*v1alpha3.Filter)(nil), (*Filter)(nil), func(a, b interface{}, scope conversion.Scope) error {\n\t\treturn Convert_v1alpha3_Filter_To_v1alpha2_Filter(a.(*v1alpha3.Filter), b.(*Filter), scope)\n\t}); err != nil {\n\t\treturn err\n\t}\n\tif err := s.AddGeneratedConversionFunc((*IngressRule)(nil), (*v1alpha3.IngressRule)(nil), func(a, b interface{}, scope conversion.Scope) error {\n\t\treturn Convert_v1alpha2_IngressRule_To_v1alpha3_IngressRule(a.(*IngressRule), b.(*v1alpha3.IngressRule), scope)\n\t}); err != nil {\n\t\treturn err\n\t}\n\tif err := s.AddGeneratedConversionFunc((*v1alpha3.IngressRule)(nil), (*IngressRule)(nil), func(a, b interface{}, scope conversion.Scope) error {\n\t\treturn Convert_v1alpha3_IngressRule_To_v1alpha2_IngressRule(a.(*v1alpha3.IngressRule), b.(*IngressRule), scope)\n\t}); err != nil {\n\t\treturn err\n\t}\n\tif err := s.AddGeneratedConversionFunc((*Network)(nil), (*v1alpha3.Network)(nil), func(a, b interface{}, scope conversion.Scope) error {\n\t\treturn Convert_v1alpha2_Network_To_v1alpha3_Network(a.(*Network), b.(*v1alpha3.Network), scope)\n\t}); err != nil {\n\t\treturn err\n\t}\n\tif err := s.AddGeneratedConversionFunc((*v1alpha3.Network)(nil), (*Network)(nil), func(a, b interface{}, scope conversion.Scope) error {\n\t\treturn Convert_v1alpha3_Network_To_v1alpha2_Network(a.(*v1alpha3.Network), b.(*Network), scope)\n\t}); err != nil {\n\t\treturn err\n\t}\n\tif err := s.AddGeneratedConversionFunc((*NetworkSpec)(nil), (*v1alpha3.NetworkSpec)(nil), func(a, b interface{}, scope conversion.Scope) error {\n\t\treturn Convert_v1alpha2_NetworkSpec_To_v1alpha3_NetworkSpec(a.(*NetworkSpec), b.(*v1alpha3.NetworkSpec), scope)\n\t}); err != nil {\n\t\treturn err\n\t}\n\tif err := s.AddGeneratedConversionFunc((*RouteTable)(nil), (*v1alpha3.RouteTable)(nil), func(a, b interface{}, scope conversion.Scope) error {\n\t\treturn Convert_v1alpha2_RouteTable_To_v1alpha3_RouteTable(a.(*RouteTable), b.(*v1alpha3.RouteTable), scope)\n\t}); err != nil {\n\t\treturn err\n\t}\n\tif err := s.AddGeneratedConversionFunc((*v1alpha3.RouteTable)(nil), (*RouteTable)(nil), func(a, b interface{}, scope conversion.Scope) error {\n\t\treturn Convert_v1alpha3_RouteTable_To_v1alpha2_RouteTable(a.(*v1alpha3.RouteTable), b.(*RouteTable), scope)\n\t}); err != nil {\n\t\treturn err\n\t}\n\tif err := s.AddGeneratedConversionFunc((*SecurityGroup)(nil), (*v1alpha3.SecurityGroup)(nil), func(a, b interface{}, scope conversion.Scope) error {\n\t\treturn Convert_v1alpha2_SecurityGroup_To_v1alpha3_SecurityGroup(a.(*SecurityGroup), b.(*v1alpha3.SecurityGroup), scope)\n\t}); err != nil {\n\t\treturn err\n\t}\n\tif err := s.AddGeneratedConversionFunc((*v1alpha3.SecurityGroup)(nil), (*SecurityGroup)(nil), func(a, b interface{}, scope conversion.Scope) error {\n\t\treturn Convert_v1alpha3_SecurityGroup_To_v1alpha2_SecurityGroup(a.(*v1alpha3.SecurityGroup), b.(*SecurityGroup), scope)\n\t}); err != nil {\n\t\treturn err\n\t}\n\tif err := s.AddGeneratedConversionFunc((*SubnetSpec)(nil), (*v1alpha3.SubnetSpec)(nil), func(a, b interface{}, scope conversion.Scope) error {\n\t\treturn Convert_v1alpha2_SubnetSpec_To_v1alpha3_SubnetSpec(a.(*SubnetSpec), b.(*v1alpha3.SubnetSpec), scope)\n\t}); err != nil {\n\t\treturn err\n\t}\n\tif err := s.AddGeneratedConversionFunc((*v1alpha3.SubnetSpec)(nil), (*SubnetSpec)(nil), func(a, b interface{}, scope conversion.Scope) error {\n\t\treturn Convert_v1alpha3_SubnetSpec_To_v1alpha2_SubnetSpec(a.(*v1alpha3.SubnetSpec), b.(*SubnetSpec), scope)\n\t}); err != nil {\n\t\treturn err\n\t}\n\tif err := s.AddGeneratedConversionFunc((*VPCSpec)(nil), (*v1alpha3.VPCSpec)(nil), func(a, b interface{}, scope conversion.Scope) error {\n\t\treturn Convert_v1alpha2_VPCSpec_To_v1alpha3_VPCSpec(a.(*VPCSpec), b.(*v1alpha3.VPCSpec), scope)\n\t}); err != nil {\n\t\treturn err\n\t}\n\tif err := s.AddConversionFunc((*AWSClusterSpec)(nil), (*v1alpha3.AWSClusterSpec)(nil), func(a, b interface{}, scope conversion.Scope) error {\n\t\treturn Convert_v1alpha2_AWSClusterSpec_To_v1alpha3_AWSClusterSpec(a.(*AWSClusterSpec), b.(*v1alpha3.AWSClusterSpec), scope)\n\t}); err != nil {\n\t\treturn err\n\t}\n\tif err := s.AddConversionFunc((*AWSClusterStatus)(nil), (*v1alpha3.AWSClusterStatus)(nil), func(a, b interface{}, scope conversion.Scope) error {\n\t\treturn Convert_v1alpha2_AWSClusterStatus_To_v1alpha3_AWSClusterStatus(a.(*AWSClusterStatus), b.(*v1alpha3.AWSClusterStatus), scope)\n\t}); err != nil {\n\t\treturn err\n\t}\n\tif err := s.AddConversionFunc((*AWSMachineSpec)(nil), (*v1alpha3.AWSMachineSpec)(nil), func(a, b interface{}, scope conversion.Scope) error {\n\t\treturn Convert_v1alpha2_AWSMachineSpec_To_v1alpha3_AWSMachineSpec(a.(*AWSMachineSpec), b.(*v1alpha3.AWSMachineSpec), scope)\n\t}); err != nil {\n\t\treturn err\n\t}\n\tif err := s.AddConversionFunc((*AWSMachineStatus)(nil), (*v1alpha3.AWSMachineStatus)(nil), func(a, b interface{}, scope conversion.Scope) error {\n\t\treturn Convert_v1alpha2_AWSMachineStatus_To_v1alpha3_AWSMachineStatus(a.(*AWSMachineStatus), b.(*v1alpha3.AWSMachineStatus), scope)\n\t}); err != nil {\n\t\treturn err\n\t}\n\tif err := s.AddConversionFunc((*CloudInit)(nil), (*v1alpha3.CloudInit)(nil), func(a, b interface{}, scope conversion.Scope) error {\n\t\treturn Convert_v1alpha2_CloudInit_To_v1alpha3_CloudInit(a.(*CloudInit), b.(*v1alpha3.CloudInit), scope)\n\t}); err != nil {\n\t\treturn err\n\t}\n\tif err := s.AddConversionFunc((*Instance)(nil), (*v1alpha3.Instance)(nil), func(a, b interface{}, scope conversion.Scope) error {\n\t\treturn Convert_v1alpha2_Instance_To_v1alpha3_Instance(a.(*Instance), b.(*v1alpha3.Instance), scope)\n\t}); err != nil {\n\t\treturn err\n\t}\n\tif err := s.AddConversionFunc((*v1alpha3.AWSClusterSpec)(nil), (*AWSClusterSpec)(nil), func(a, b interface{}, scope conversion.Scope) error {\n\t\treturn Convert_v1alpha3_AWSClusterSpec_To_v1alpha2_AWSClusterSpec(a.(*v1alpha3.AWSClusterSpec), b.(*AWSClusterSpec), scope)\n\t}); err != nil {\n\t\treturn err\n\t}\n\tif err := s.AddConversionFunc((*v1alpha3.AWSClusterStatus)(nil), (*AWSClusterStatus)(nil), func(a, b interface{}, scope conversion.Scope) error {\n\t\treturn Convert_v1alpha3_AWSClusterStatus_To_v1alpha2_AWSClusterStatus(a.(*v1alpha3.AWSClusterStatus), b.(*AWSClusterStatus), scope)\n\t}); err != nil {\n\t\treturn err\n\t}\n\tif err := s.AddConversionFunc((*v1alpha3.AWSLoadBalancerSpec)(nil), (*AWSLoadBalancerSpec)(nil), func(a, b interface{}, scope conversion.Scope) error {\n\t\treturn Convert_v1alpha3_AWSLoadBalancerSpec_To_v1alpha2_AWSLoadBalancerSpec(a.(*v1alpha3.AWSLoadBalancerSpec), b.(*AWSLoadBalancerSpec), scope)\n\t}); err != nil {\n\t\treturn err\n\t}\n\tif err := s.AddConversionFunc((*v1alpha3.AWSMachineSpec)(nil), (*AWSMachineSpec)(nil), func(a, b interface{}, scope conversion.Scope) error {\n\t\treturn Convert_v1alpha3_AWSMachineSpec_To_v1alpha2_AWSMachineSpec(a.(*v1alpha3.AWSMachineSpec), b.(*AWSMachineSpec), scope)\n\t}); err != nil {\n\t\treturn err\n\t}\n\tif err := s.AddConversionFunc((*v1alpha3.AWSMachineStatus)(nil), (*AWSMachineStatus)(nil), func(a, b interface{}, scope conversion.Scope) error {\n\t\treturn Convert_v1alpha3_AWSMachineStatus_To_v1alpha2_AWSMachineStatus(a.(*v1alpha3.AWSMachineStatus), b.(*AWSMachineStatus), scope)\n\t}); err != nil {\n\t\treturn err\n\t}\n\tif err := s.AddConversionFunc((*v1alpha3.ClassicELBAttributes)(nil), (*ClassicELBAttributes)(nil), func(a, b interface{}, scope conversion.Scope) error {\n\t\treturn Convert_v1alpha3_ClassicELBAttributes_To_v1alpha2_ClassicELBAttributes(a.(*v1alpha3.ClassicELBAttributes), b.(*ClassicELBAttributes), scope)\n\t}); err != nil {\n\t\treturn err\n\t}\n\tif err := s.AddConversionFunc((*v1alpha3.ClassicELB)(nil), (*ClassicELB)(nil), func(a, b interface{}, scope conversion.Scope) error {\n\t\treturn Convert_v1alpha3_ClassicELB_To_v1alpha2_ClassicELB(a.(*v1alpha3.ClassicELB), b.(*ClassicELB), scope)\n\t}); err != nil {\n\t\treturn err\n\t}\n\tif err := s.AddConversionFunc((*v1alpha3.CloudInit)(nil), (*CloudInit)(nil), func(a, b interface{}, scope conversion.Scope) error {\n\t\treturn Convert_v1alpha3_CloudInit_To_v1alpha2_CloudInit(a.(*v1alpha3.CloudInit), b.(*CloudInit), scope)\n\t}); err != nil {\n\t\treturn err\n\t}\n\tif err := s.AddConversionFunc((*v1alpha3.Instance)(nil), (*Instance)(nil), func(a, b interface{}, scope conversion.Scope) error {\n\t\treturn Convert_v1alpha3_Instance_To_v1alpha2_Instance(a.(*v1alpha3.Instance), b.(*Instance), scope)\n\t}); err != nil {\n\t\treturn err\n\t}\n\tif err := s.AddConversionFunc((*v1alpha3.NetworkSpec)(nil), (*NetworkSpec)(nil), func(a, b interface{}, scope conversion.Scope) error {\n\t\treturn Convert_v1alpha3_NetworkSpec_To_v1alpha2_NetworkSpec(a.(*v1alpha3.NetworkSpec), b.(*NetworkSpec), scope)\n\t}); err != nil {\n\t\treturn err\n\t}\n\tif err := s.AddConversionFunc((*v1alpha3.VPCSpec)(nil), (*VPCSpec)(nil), func(a, b interface{}, scope conversion.Scope) error {\n\t\treturn Convert_v1alpha3_VPCSpec_To_v1alpha2_VPCSpec(a.(*v1alpha3.VPCSpec), b.(*VPCSpec), scope)\n\t}); err != nil {\n\t\treturn err\n\t}\n\treturn nil\n}", "title": "" }, { "docid": "81db7e59243f344b71208802574fe24e", "score": "0.6752422", "text": "func RegisterConversions(s *runtime.Scheme) error {\n\tif err := s.AddGeneratedConversionFunc((*ResourceGroup)(nil), (*v1.ResourceGroup)(nil), func(a, b interface{}, scope conversion.Scope) error {\n\t\treturn Convert_v20191001_ResourceGroup_To_v1_ResourceGroup(a.(*ResourceGroup), b.(*v1.ResourceGroup), scope)\n\t}); err != nil {\n\t\treturn err\n\t}\n\tif err := s.AddGeneratedConversionFunc((*v1.ResourceGroup)(nil), (*ResourceGroup)(nil), func(a, b interface{}, scope conversion.Scope) error {\n\t\treturn Convert_v1_ResourceGroup_To_v20191001_ResourceGroup(a.(*v1.ResourceGroup), b.(*ResourceGroup), scope)\n\t}); err != nil {\n\t\treturn err\n\t}\n\tif err := s.AddGeneratedConversionFunc((*ResourceGroupList)(nil), (*v1.ResourceGroupList)(nil), func(a, b interface{}, scope conversion.Scope) error {\n\t\treturn Convert_v20191001_ResourceGroupList_To_v1_ResourceGroupList(a.(*ResourceGroupList), b.(*v1.ResourceGroupList), scope)\n\t}); err != nil {\n\t\treturn err\n\t}\n\tif err := s.AddGeneratedConversionFunc((*v1.ResourceGroupList)(nil), (*ResourceGroupList)(nil), func(a, b interface{}, scope conversion.Scope) error {\n\t\treturn Convert_v1_ResourceGroupList_To_v20191001_ResourceGroupList(a.(*v1.ResourceGroupList), b.(*ResourceGroupList), scope)\n\t}); err != nil {\n\t\treturn err\n\t}\n\tif err := s.AddGeneratedConversionFunc((*ResourceGroupSpec)(nil), (*v1.ResourceGroupSpec)(nil), func(a, b interface{}, scope conversion.Scope) error {\n\t\treturn Convert_v20191001_ResourceGroupSpec_To_v1_ResourceGroupSpec(a.(*ResourceGroupSpec), b.(*v1.ResourceGroupSpec), scope)\n\t}); err != nil {\n\t\treturn err\n\t}\n\tif err := s.AddGeneratedConversionFunc((*v1.ResourceGroupSpec)(nil), (*ResourceGroupSpec)(nil), func(a, b interface{}, scope conversion.Scope) error {\n\t\treturn Convert_v1_ResourceGroupSpec_To_v20191001_ResourceGroupSpec(a.(*v1.ResourceGroupSpec), b.(*ResourceGroupSpec), scope)\n\t}); err != nil {\n\t\treturn err\n\t}\n\tif err := s.AddGeneratedConversionFunc((*ResourceGroupStatus)(nil), (*v1.ResourceGroupStatus)(nil), func(a, b interface{}, scope conversion.Scope) error {\n\t\treturn Convert_v20191001_ResourceGroupStatus_To_v1_ResourceGroupStatus(a.(*ResourceGroupStatus), b.(*v1.ResourceGroupStatus), scope)\n\t}); err != nil {\n\t\treturn err\n\t}\n\tif err := s.AddGeneratedConversionFunc((*v1.ResourceGroupStatus)(nil), (*ResourceGroupStatus)(nil), func(a, b interface{}, scope conversion.Scope) error {\n\t\treturn Convert_v1_ResourceGroupStatus_To_v20191001_ResourceGroupStatus(a.(*v1.ResourceGroupStatus), b.(*ResourceGroupStatus), scope)\n\t}); err != nil {\n\t\treturn err\n\t}\n\treturn nil\n}", "title": "" }, { "docid": "3f1e6cbe09ff6d151709283213fdfcf3", "score": "0.6748286", "text": "func RegisterConversions(s *runtime.Scheme) error {\n\tif err := s.AddGeneratedConversionFunc((*v1beta1.PriorityClass)(nil), (*scheduling.PriorityClass)(nil), func(a, b interface{}, scope conversion.Scope) error {\n\t\treturn Convert_v1beta1_PriorityClass_To_scheduling_PriorityClass(a.(*v1beta1.PriorityClass), b.(*scheduling.PriorityClass), scope)\n\t}); err != nil {\n\t\treturn err\n\t}\n\tif err := s.AddGeneratedConversionFunc((*scheduling.PriorityClass)(nil), (*v1beta1.PriorityClass)(nil), func(a, b interface{}, scope conversion.Scope) error {\n\t\treturn Convert_scheduling_PriorityClass_To_v1beta1_PriorityClass(a.(*scheduling.PriorityClass), b.(*v1beta1.PriorityClass), scope)\n\t}); err != nil {\n\t\treturn err\n\t}\n\tif err := s.AddGeneratedConversionFunc((*v1beta1.PriorityClassList)(nil), (*scheduling.PriorityClassList)(nil), func(a, b interface{}, scope conversion.Scope) error {\n\t\treturn Convert_v1beta1_PriorityClassList_To_scheduling_PriorityClassList(a.(*v1beta1.PriorityClassList), b.(*scheduling.PriorityClassList), scope)\n\t}); err != nil {\n\t\treturn err\n\t}\n\tif err := s.AddGeneratedConversionFunc((*scheduling.PriorityClassList)(nil), (*v1beta1.PriorityClassList)(nil), func(a, b interface{}, scope conversion.Scope) error {\n\t\treturn Convert_scheduling_PriorityClassList_To_v1beta1_PriorityClassList(a.(*scheduling.PriorityClassList), b.(*v1beta1.PriorityClassList), scope)\n\t}); err != nil {\n\t\treturn err\n\t}\n\treturn nil\n}", "title": "" }, { "docid": "62cabda1a623986e8c04fdff3475f4e4", "score": "0.67434514", "text": "func RegisterConversions(scheme *runtime.Scheme) error {\n\treturn scheme.AddGeneratedConversionFuncs(\n\t\tConvert_v1_ClusterRoleScopeRestriction_To_api_ClusterRoleScopeRestriction,\n\t\tConvert_api_ClusterRoleScopeRestriction_To_v1_ClusterRoleScopeRestriction,\n\t\tConvert_v1_OAuthAccessToken_To_api_OAuthAccessToken,\n\t\tConvert_api_OAuthAccessToken_To_v1_OAuthAccessToken,\n\t\tConvert_v1_OAuthAccessTokenList_To_api_OAuthAccessTokenList,\n\t\tConvert_api_OAuthAccessTokenList_To_v1_OAuthAccessTokenList,\n\t\tConvert_v1_OAuthAuthorizeToken_To_api_OAuthAuthorizeToken,\n\t\tConvert_api_OAuthAuthorizeToken_To_v1_OAuthAuthorizeToken,\n\t\tConvert_v1_OAuthAuthorizeTokenList_To_api_OAuthAuthorizeTokenList,\n\t\tConvert_api_OAuthAuthorizeTokenList_To_v1_OAuthAuthorizeTokenList,\n\t\tConvert_v1_OAuthClient_To_api_OAuthClient,\n\t\tConvert_api_OAuthClient_To_v1_OAuthClient,\n\t\tConvert_v1_OAuthClientAuthorization_To_api_OAuthClientAuthorization,\n\t\tConvert_api_OAuthClientAuthorization_To_v1_OAuthClientAuthorization,\n\t\tConvert_v1_OAuthClientAuthorizationList_To_api_OAuthClientAuthorizationList,\n\t\tConvert_api_OAuthClientAuthorizationList_To_v1_OAuthClientAuthorizationList,\n\t\tConvert_v1_OAuthClientList_To_api_OAuthClientList,\n\t\tConvert_api_OAuthClientList_To_v1_OAuthClientList,\n\t\tConvert_v1_OAuthRedirectReference_To_api_OAuthRedirectReference,\n\t\tConvert_api_OAuthRedirectReference_To_v1_OAuthRedirectReference,\n\t\tConvert_v1_RedirectReference_To_api_RedirectReference,\n\t\tConvert_api_RedirectReference_To_v1_RedirectReference,\n\t\tConvert_v1_ScopeRestriction_To_api_ScopeRestriction,\n\t\tConvert_api_ScopeRestriction_To_v1_ScopeRestriction,\n\t)\n}", "title": "" }, { "docid": "d211a81faf7c0ac82b5a31cfa5053158", "score": "0.67206204", "text": "func RegisterConversions(scheme *runtime.Scheme) error {\n\treturn scheme.AddGeneratedConversionFuncs(\n\t\tConvert_v1beta1_PriorityClass_To_scheduling_PriorityClass,\n\t\tConvert_scheduling_PriorityClass_To_v1beta1_PriorityClass,\n\t\tConvert_v1beta1_PriorityClassList_To_scheduling_PriorityClassList,\n\t\tConvert_scheduling_PriorityClassList_To_v1beta1_PriorityClassList,\n\t)\n}", "title": "" }, { "docid": "641518e009b8ae84a86e1e37d2d6aef1", "score": "0.6716688", "text": "func RegisterConversions(s *runtime.Scheme) error {\n\tif err := s.AddGeneratedConversionFunc((*ExpansionTemplate)(nil), (*unversioned.ExpansionTemplate)(nil), func(a, b interface{}, scope conversion.Scope) error {\n\t\treturn Convert_v1beta1_ExpansionTemplate_To_unversioned_ExpansionTemplate(a.(*ExpansionTemplate), b.(*unversioned.ExpansionTemplate), scope)\n\t}); err != nil {\n\t\treturn err\n\t}\n\tif err := s.AddGeneratedConversionFunc((*unversioned.ExpansionTemplate)(nil), (*ExpansionTemplate)(nil), func(a, b interface{}, scope conversion.Scope) error {\n\t\treturn Convert_unversioned_ExpansionTemplate_To_v1beta1_ExpansionTemplate(a.(*unversioned.ExpansionTemplate), b.(*ExpansionTemplate), scope)\n\t}); err != nil {\n\t\treturn err\n\t}\n\tif err := s.AddGeneratedConversionFunc((*ExpansionTemplateList)(nil), (*unversioned.ExpansionTemplateList)(nil), func(a, b interface{}, scope conversion.Scope) error {\n\t\treturn Convert_v1beta1_ExpansionTemplateList_To_unversioned_ExpansionTemplateList(a.(*ExpansionTemplateList), b.(*unversioned.ExpansionTemplateList), scope)\n\t}); err != nil {\n\t\treturn err\n\t}\n\tif err := s.AddGeneratedConversionFunc((*unversioned.ExpansionTemplateList)(nil), (*ExpansionTemplateList)(nil), func(a, b interface{}, scope conversion.Scope) error {\n\t\treturn Convert_unversioned_ExpansionTemplateList_To_v1beta1_ExpansionTemplateList(a.(*unversioned.ExpansionTemplateList), b.(*ExpansionTemplateList), scope)\n\t}); err != nil {\n\t\treturn err\n\t}\n\tif err := s.AddGeneratedConversionFunc((*ExpansionTemplateSpec)(nil), (*unversioned.ExpansionTemplateSpec)(nil), func(a, b interface{}, scope conversion.Scope) error {\n\t\treturn Convert_v1beta1_ExpansionTemplateSpec_To_unversioned_ExpansionTemplateSpec(a.(*ExpansionTemplateSpec), b.(*unversioned.ExpansionTemplateSpec), scope)\n\t}); err != nil {\n\t\treturn err\n\t}\n\tif err := s.AddGeneratedConversionFunc((*unversioned.ExpansionTemplateSpec)(nil), (*ExpansionTemplateSpec)(nil), func(a, b interface{}, scope conversion.Scope) error {\n\t\treturn Convert_unversioned_ExpansionTemplateSpec_To_v1beta1_ExpansionTemplateSpec(a.(*unversioned.ExpansionTemplateSpec), b.(*ExpansionTemplateSpec), scope)\n\t}); err != nil {\n\t\treturn err\n\t}\n\tif err := s.AddGeneratedConversionFunc((*ExpansionTemplateStatus)(nil), (*unversioned.ExpansionTemplateStatus)(nil), func(a, b interface{}, scope conversion.Scope) error {\n\t\treturn Convert_v1beta1_ExpansionTemplateStatus_To_unversioned_ExpansionTemplateStatus(a.(*ExpansionTemplateStatus), b.(*unversioned.ExpansionTemplateStatus), scope)\n\t}); err != nil {\n\t\treturn err\n\t}\n\tif err := s.AddGeneratedConversionFunc((*unversioned.ExpansionTemplateStatus)(nil), (*ExpansionTemplateStatus)(nil), func(a, b interface{}, scope conversion.Scope) error {\n\t\treturn Convert_unversioned_ExpansionTemplateStatus_To_v1beta1_ExpansionTemplateStatus(a.(*unversioned.ExpansionTemplateStatus), b.(*ExpansionTemplateStatus), scope)\n\t}); err != nil {\n\t\treturn err\n\t}\n\tif err := s.AddGeneratedConversionFunc((*GeneratedGVK)(nil), (*unversioned.GeneratedGVK)(nil), func(a, b interface{}, scope conversion.Scope) error {\n\t\treturn Convert_v1beta1_GeneratedGVK_To_unversioned_GeneratedGVK(a.(*GeneratedGVK), b.(*unversioned.GeneratedGVK), scope)\n\t}); err != nil {\n\t\treturn err\n\t}\n\tif err := s.AddGeneratedConversionFunc((*unversioned.GeneratedGVK)(nil), (*GeneratedGVK)(nil), func(a, b interface{}, scope conversion.Scope) error {\n\t\treturn Convert_unversioned_GeneratedGVK_To_v1beta1_GeneratedGVK(a.(*unversioned.GeneratedGVK), b.(*GeneratedGVK), scope)\n\t}); err != nil {\n\t\treturn err\n\t}\n\treturn nil\n}", "title": "" }, { "docid": "f678820b857e6774702d0ab69b3fbc4b", "score": "0.6644665", "text": "func RegisterConversions(s *runtime.Scheme) error {\n\tif err := s.AddGeneratedConversionFunc((*AzureConfiguration)(nil), (*config.AzureConfiguration)(nil), func(a, b interface{}, scope conversion.Scope) error {\n\t\treturn Convert_v1alpha1_AzureConfiguration_To_config_AzureConfiguration(a.(*AzureConfiguration), b.(*config.AzureConfiguration), scope)\n\t}); err != nil {\n\t\treturn err\n\t}\n\tif err := s.AddGeneratedConversionFunc((*config.AzureConfiguration)(nil), (*AzureConfiguration)(nil), func(a, b interface{}, scope conversion.Scope) error {\n\t\treturn Convert_config_AzureConfiguration_To_v1alpha1_AzureConfiguration(a.(*config.AzureConfiguration), b.(*AzureConfiguration), scope)\n\t}); err != nil {\n\t\treturn err\n\t}\n\tif err := s.AddGeneratedConversionFunc((*AzureFailedVMRemedyConfiguration)(nil), (*config.AzureFailedVMRemedyConfiguration)(nil), func(a, b interface{}, scope conversion.Scope) error {\n\t\treturn Convert_v1alpha1_AzureFailedVMRemedyConfiguration_To_config_AzureFailedVMRemedyConfiguration(a.(*AzureFailedVMRemedyConfiguration), b.(*config.AzureFailedVMRemedyConfiguration), scope)\n\t}); err != nil {\n\t\treturn err\n\t}\n\tif err := s.AddGeneratedConversionFunc((*config.AzureFailedVMRemedyConfiguration)(nil), (*AzureFailedVMRemedyConfiguration)(nil), func(a, b interface{}, scope conversion.Scope) error {\n\t\treturn Convert_config_AzureFailedVMRemedyConfiguration_To_v1alpha1_AzureFailedVMRemedyConfiguration(a.(*config.AzureFailedVMRemedyConfiguration), b.(*AzureFailedVMRemedyConfiguration), scope)\n\t}); err != nil {\n\t\treturn err\n\t}\n\tif err := s.AddGeneratedConversionFunc((*AzureOrphanedPublicIPRemedyConfiguration)(nil), (*config.AzureOrphanedPublicIPRemedyConfiguration)(nil), func(a, b interface{}, scope conversion.Scope) error {\n\t\treturn Convert_v1alpha1_AzureOrphanedPublicIPRemedyConfiguration_To_config_AzureOrphanedPublicIPRemedyConfiguration(a.(*AzureOrphanedPublicIPRemedyConfiguration), b.(*config.AzureOrphanedPublicIPRemedyConfiguration), scope)\n\t}); err != nil {\n\t\treturn err\n\t}\n\tif err := s.AddGeneratedConversionFunc((*config.AzureOrphanedPublicIPRemedyConfiguration)(nil), (*AzureOrphanedPublicIPRemedyConfiguration)(nil), func(a, b interface{}, scope conversion.Scope) error {\n\t\treturn Convert_config_AzureOrphanedPublicIPRemedyConfiguration_To_v1alpha1_AzureOrphanedPublicIPRemedyConfiguration(a.(*config.AzureOrphanedPublicIPRemedyConfiguration), b.(*AzureOrphanedPublicIPRemedyConfiguration), scope)\n\t}); err != nil {\n\t\treturn err\n\t}\n\tif err := s.AddGeneratedConversionFunc((*ControllerConfiguration)(nil), (*config.ControllerConfiguration)(nil), func(a, b interface{}, scope conversion.Scope) error {\n\t\treturn Convert_v1alpha1_ControllerConfiguration_To_config_ControllerConfiguration(a.(*ControllerConfiguration), b.(*config.ControllerConfiguration), scope)\n\t}); err != nil {\n\t\treturn err\n\t}\n\tif err := s.AddGeneratedConversionFunc((*config.ControllerConfiguration)(nil), (*ControllerConfiguration)(nil), func(a, b interface{}, scope conversion.Scope) error {\n\t\treturn Convert_config_ControllerConfiguration_To_v1alpha1_ControllerConfiguration(a.(*config.ControllerConfiguration), b.(*ControllerConfiguration), scope)\n\t}); err != nil {\n\t\treturn err\n\t}\n\treturn nil\n}", "title": "" }, { "docid": "dde30917ba886de20103531b4dce9301", "score": "0.65455556", "text": "func RegisterConversions(scheme *runtime.Scheme) error {\n\treturn scheme.AddGeneratedConversionFuncs(\n\t\tConvert_v2alpha1_CrossVersionObjectReference_To_autoscaling_CrossVersionObjectReference,\n\t\tConvert_autoscaling_CrossVersionObjectReference_To_v2alpha1_CrossVersionObjectReference,\n\t\tConvert_v2alpha1_HorizontalPodAutoscaler_To_autoscaling_HorizontalPodAutoscaler,\n\t\tConvert_autoscaling_HorizontalPodAutoscaler_To_v2alpha1_HorizontalPodAutoscaler,\n\t\tConvert_v2alpha1_HorizontalPodAutoscalerList_To_autoscaling_HorizontalPodAutoscalerList,\n\t\tConvert_autoscaling_HorizontalPodAutoscalerList_To_v2alpha1_HorizontalPodAutoscalerList,\n\t\tConvert_v2alpha1_HorizontalPodAutoscalerSpec_To_autoscaling_HorizontalPodAutoscalerSpec,\n\t\tConvert_autoscaling_HorizontalPodAutoscalerSpec_To_v2alpha1_HorizontalPodAutoscalerSpec,\n\t\tConvert_v2alpha1_HorizontalPodAutoscalerStatus_To_autoscaling_HorizontalPodAutoscalerStatus,\n\t\tConvert_autoscaling_HorizontalPodAutoscalerStatus_To_v2alpha1_HorizontalPodAutoscalerStatus,\n\t\tConvert_v2alpha1_MetricSpec_To_autoscaling_MetricSpec,\n\t\tConvert_autoscaling_MetricSpec_To_v2alpha1_MetricSpec,\n\t\tConvert_v2alpha1_MetricStatus_To_autoscaling_MetricStatus,\n\t\tConvert_autoscaling_MetricStatus_To_v2alpha1_MetricStatus,\n\t\tConvert_v2alpha1_ObjectMetricSource_To_autoscaling_ObjectMetricSource,\n\t\tConvert_autoscaling_ObjectMetricSource_To_v2alpha1_ObjectMetricSource,\n\t\tConvert_v2alpha1_ObjectMetricStatus_To_autoscaling_ObjectMetricStatus,\n\t\tConvert_autoscaling_ObjectMetricStatus_To_v2alpha1_ObjectMetricStatus,\n\t\tConvert_v2alpha1_PodsMetricSource_To_autoscaling_PodsMetricSource,\n\t\tConvert_autoscaling_PodsMetricSource_To_v2alpha1_PodsMetricSource,\n\t\tConvert_v2alpha1_PodsMetricStatus_To_autoscaling_PodsMetricStatus,\n\t\tConvert_autoscaling_PodsMetricStatus_To_v2alpha1_PodsMetricStatus,\n\t\tConvert_v2alpha1_ResourceMetricSource_To_autoscaling_ResourceMetricSource,\n\t\tConvert_autoscaling_ResourceMetricSource_To_v2alpha1_ResourceMetricSource,\n\t\tConvert_v2alpha1_ResourceMetricStatus_To_autoscaling_ResourceMetricStatus,\n\t\tConvert_autoscaling_ResourceMetricStatus_To_v2alpha1_ResourceMetricStatus,\n\t)\n}", "title": "" }, { "docid": "0d42795674e8f10195a724a0e7b7a044", "score": "0.556953", "text": "func RegisterConverter(c Converter) {\n\tconverters = append(converters, c)\n}", "title": "" }, { "docid": "089c4d2ed66e9f903837ceccf9e199f2", "score": "0.54215276", "text": "func AddToScheme(objs ...Object) func(s *runtime.Scheme) error {\n\treturn func(s *runtime.Scheme) error {\n\t\tfor i := range objs {\n\t\t\tobj := objs[i]\n\t\t\ts.AddKnownTypes(obj.GetGroupVersionResource().GroupVersion(), obj.New(), obj.NewList())\n\t\t\tif obj.IsStorageVersion() {\n\t\t\t\ts.AddKnownTypes(schema.GroupVersion{\n\t\t\t\t\tGroup: obj.GetGroupVersionResource().Group,\n\t\t\t\t\tVersion: runtime.APIVersionInternal,\n\t\t\t\t}, obj.New(), obj.NewList())\n\t\t\t} else {\n\t\t\t\tmultiVersionObj, ok := obj.(MultiVersionObject)\n\t\t\t\tif !ok {\n\t\t\t\t\treturn fmt.Errorf(\"resource should implement MultiVersionObject if it's not storage-version\")\n\t\t\t\t}\n\t\t\t\t// registering conversion functions to scheme instance\n\t\t\t\tstorageVersionObj := multiVersionObj.NewStorageVersionObject()\n\t\t\t\tif err := s.AddConversionFunc(obj, storageVersionObj, func(from, to interface{}, _ conversion.Scope) error {\n\t\t\t\t\treturn from.(MultiVersionObject).ConvertToStorageVersion(to.(runtime.Object))\n\t\t\t\t}); err != nil {\n\t\t\t\t\treturn err\n\t\t\t\t}\n\t\t\t\tif err := s.AddConversionFunc(storageVersionObj, obj, func(from, to interface{}, _ conversion.Scope) error {\n\t\t\t\t\treturn from.(MultiVersionObject).ConvertFromStorageVersion(to.(runtime.Object))\n\t\t\t\t}); err != nil {\n\t\t\t\t\treturn err\n\t\t\t\t}\n\t\t\t}\n\t\t\tif _, ok := obj.(resourcestrategy.Defaulter); ok {\n\t\t\t\ts.AddTypeDefaultingFunc(obj, func(o interface{}) {\n\t\t\t\t\to.(resourcestrategy.Defaulter).Default()\n\t\t\t\t})\n\t\t\t}\n\t\t\t// register subresources\n\t\t\tif objWithStatus, ok := obj.(ObjectWithStatusSubResource); ok {\n\t\t\t\tif statusObj, ok := objWithStatus.GetStatus().(runtime.Object); ok {\n\t\t\t\t\ts.AddKnownTypes(obj.GetGroupVersionResource().GroupVersion(), statusObj)\n\t\t\t\t}\n\t\t\t}\n\t\t\tif _, ok := obj.(ObjectWithScaleSubResource); ok {\n\t\t\t\tif !s.Recognizes(autoscalingv1.SchemeGroupVersion.WithKind(\"Scale\")) {\n\t\t\t\t\tif err := autoscalingv1.AddToScheme(s); 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\tif sgs, ok := obj.(ObjectWithArbitrarySubResource); ok {\n\t\t\t\tfor _, sub := range sgs.GetArbitrarySubResources() {\n\t\t\t\t\tsub := sub\n\t\t\t\t\tparentGVR := obj.GetGroupVersionResource()\n\t\t\t\t\tsubResourceGVR := parentGVR.GroupVersion().WithResource(parentGVR.Resource + \"/\" + sub.SubResourceName())\n\t\t\t\t\tif reflect.TypeOf(sub.New()) != reflect.TypeOf(obj) { // subResource.New() may return the parent resource at some time\n\t\t\t\t\t\ts.AddKnownTypes(subResourceGVR.GroupVersion(), sub.New())\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\treturn nil\n\t}\n}", "title": "" }, { "docid": "84cf1137d2522fe2a736d32dd6f892f3", "score": "0.5170142", "text": "func RegisterDeepCopies(scheme *runtime.Scheme) error {\n\treturn scheme.AddGeneratedDeepCopyFuncs(\n\t\tconversion.GeneratedDeepCopyFunc{Fn: func(in interface{}, out interface{}, c *conversion.Cloner) error {\n\t\t\tin.(*Function).DeepCopyInto(out.(*Function))\n\t\t\treturn nil\n\t\t}, InType: reflect.TypeOf(&Function{})},\n\t\tconversion.GeneratedDeepCopyFunc{Fn: func(in interface{}, out interface{}, c *conversion.Cloner) error {\n\t\t\tin.(*FunctionList).DeepCopyInto(out.(*FunctionList))\n\t\t\treturn nil\n\t\t}, InType: reflect.TypeOf(&FunctionList{})},\n\t\tconversion.GeneratedDeepCopyFunc{Fn: func(in interface{}, out interface{}, c *conversion.Cloner) error {\n\t\t\tin.(*FunctionResources).DeepCopyInto(out.(*FunctionResources))\n\t\t\treturn nil\n\t\t}, InType: reflect.TypeOf(&FunctionResources{})},\n\t\tconversion.GeneratedDeepCopyFunc{Fn: func(in interface{}, out interface{}, c *conversion.Cloner) error {\n\t\t\tin.(*FunctionSpec).DeepCopyInto(out.(*FunctionSpec))\n\t\t\treturn nil\n\t\t}, InType: reflect.TypeOf(&FunctionSpec{})},\n\t\tconversion.GeneratedDeepCopyFunc{Fn: func(in interface{}, out interface{}, c *conversion.Cloner) error {\n\t\t\tin.(*FunctionStatus).DeepCopyInto(out.(*FunctionStatus))\n\t\t\treturn nil\n\t\t}, InType: reflect.TypeOf(&FunctionStatus{})},\n\t)\n}", "title": "" }, { "docid": "ace6243a3b0d16d57a707c7613af4103", "score": "0.5107449", "text": "func AddToScheme(scheme *runtime.Scheme) error {\n\t// This returns an error if and only if any of the following function calls return an error.\n\t// If many errors are returned, they are all concatenated after each other.\n\treturn errors.NewAggregate([]error{\n\t\tclientgoscheme.AddToScheme(scheme), // Register all known Kubernetes types\n\t\tssv1alpha1.AddToScheme(scheme), // Register Bitnami's Sealed Secrets types\n\t\tcapeiv1alpha1.AddToScheme(scheme), // Register baremetalproviderspec v1alpha1 types\n\t\tcapeiv1alpha3.AddToScheme(scheme), // Register cluster.weave.works v1alpha3 types\n\t\tclusterv1alpha3.AddToScheme(scheme), // Register the upstream CAPI v1alpha3 types\n\t\tscheme.SetVersionPriority(capeiv1alpha3.GroupVersion), // Always prefer v1alpha3 when encoding our types\n\t})\n}", "title": "" }, { "docid": "d4a89c35110293bea4e5fd5656e43195", "score": "0.50880533", "text": "func AddExternalConversion(typeName string, fn ConversionFunc) {\n\tconversionFuncs[typeTuple{\"\", \"v1beta1\", typeName}] = fn\n}", "title": "" }, { "docid": "3420718915269d91a6ea72a6e51ae9b6", "score": "0.5087559", "text": "func RegisterPlugin(scheme string, f PluginFunc) {\n\tpluginRegistration[scheme] = f\n}", "title": "" }, { "docid": "4274bbd18c80ee8061fb56c25dd2fb28", "score": "0.49481374", "text": "func (c *Catalog) RegisterFunction(ctx *sql.Context, fns ...sql.Function) {\n\tfor _, fn := range fns {\n\t\terr := c.builtInFunctions.Register(fn)\n\t\tif err != nil {\n\t\t\tpanic(err)\n\t\t}\n\t}\n}", "title": "" }, { "docid": "666be04177d7232cae10122d9c8a91ff", "score": "0.49041203", "text": "func init() {\n\t_ = apiextensionsv1.AddToScheme(crdScheme)\n\t_ = apiextensionsv1beta1.AddToScheme(crdScheme)\n}", "title": "" }, { "docid": "49e0519cec33fa9892a9fa2808f34bda", "score": "0.4894644", "text": "func AddConversion(in interface{}, out interface{}, converter Converter) {\n\tsrcType := extractType(in)\n\ttargetType := extractType(out)\n\tAddConversionByType(srcType, targetType, converter)\n}", "title": "" }, { "docid": "28cecc604ceb716d3d9be55c5dfafe03", "score": "0.48766392", "text": "func AddConversionByType(srcType reflect.Type, targetType reflect.Type, converter Converter) {\n\tif _, ok := converterMap[srcType]; !ok {\n\t\tconverterMap[srcType] = map[reflect.Type]Converter{}\n\t}\n\tconverterMap[srcType][targetType] = converter\n}", "title": "" }, { "docid": "baa2fc824e21390fc5ff341383a83495", "score": "0.48148057", "text": "func Register(schema string, factoryFunc FactoryFunc) {\n\tsupported.Store(schema, factoryFunc)\n}", "title": "" }, { "docid": "26cd036653230cbd630b6c6a7840e2b9", "score": "0.47755566", "text": "func RegisterDeepCopies(scheme *runtime.Scheme) error {\n\treturn scheme.AddGeneratedDeepCopyFuncs(\n\t\tconversion.GeneratedDeepCopyFunc{Fn: DeepCopy_v1alpha1_ClusterAlert, InType: reflect.TypeOf(&ClusterAlert{})},\n\t\tconversion.GeneratedDeepCopyFunc{Fn: DeepCopy_v1alpha1_ClusterAlertList, InType: reflect.TypeOf(&ClusterAlertList{})},\n\t\tconversion.GeneratedDeepCopyFunc{Fn: DeepCopy_v1alpha1_ClusterAlertSpec, InType: reflect.TypeOf(&ClusterAlertSpec{})},\n\t\tconversion.GeneratedDeepCopyFunc{Fn: DeepCopy_v1alpha1_IcingaCommand, InType: reflect.TypeOf(&IcingaCommand{})},\n\t\tconversion.GeneratedDeepCopyFunc{Fn: DeepCopy_v1alpha1_NodeAlert, InType: reflect.TypeOf(&NodeAlert{})},\n\t\tconversion.GeneratedDeepCopyFunc{Fn: DeepCopy_v1alpha1_NodeAlertList, InType: reflect.TypeOf(&NodeAlertList{})},\n\t\tconversion.GeneratedDeepCopyFunc{Fn: DeepCopy_v1alpha1_NodeAlertSpec, InType: reflect.TypeOf(&NodeAlertSpec{})},\n\t\tconversion.GeneratedDeepCopyFunc{Fn: DeepCopy_v1alpha1_PodAlert, InType: reflect.TypeOf(&PodAlert{})},\n\t\tconversion.GeneratedDeepCopyFunc{Fn: DeepCopy_v1alpha1_PodAlertList, InType: reflect.TypeOf(&PodAlertList{})},\n\t\tconversion.GeneratedDeepCopyFunc{Fn: DeepCopy_v1alpha1_PodAlertSpec, InType: reflect.TypeOf(&PodAlertSpec{})},\n\t\tconversion.GeneratedDeepCopyFunc{Fn: DeepCopy_v1alpha1_Receiver, InType: reflect.TypeOf(&Receiver{})},\n\t)\n}", "title": "" }, { "docid": "16e545e92d984ad4517b27033339e934", "score": "0.47249386", "text": "func RegisterEncoder(ctx context.Context, f InitializeEncoderFunc, schemes ...string) error {\n\n\terr := ensureRoster()\n\n\tif err != nil {\n\t\treturn err\n\t}\n\n\tfor _, s := range schemes {\n\n\t\terr := encoders.Register(ctx, s, f)\n\n\t\tif err != nil {\n\t\t\treturn err\n\t\t}\n\t}\n\n\treturn nil\n}", "title": "" }, { "docid": "fbb2697b2a2483acdb3d3975c36004a0", "score": "0.4713501", "text": "func RegisterConverter(src, dst *Format, c Converter) {\n\tkey := srcDstFmt{src.Key(), dst.Key()}\n\tif _, found := registeredConverters[key]; found {\n\t\tpanic(fmt.Errorf(\"Converter from %s to %s already registered\", src, dst))\n\t}\n\tregisteredConverters[key] = c\n}", "title": "" }, { "docid": "34a5280519d363f1d08229ac1883f137", "score": "0.46179697", "text": "func Register(ss SignatureScheme, f func(io.Reader) (Signer, error)) {\n\t// we cannot import the corresponding constructors directly due to import cycles.\n\tsignatures[ss] = f\n}", "title": "" }, { "docid": "ab4ecf70bf497aa1fe0e3a9baff44d2d", "score": "0.46167082", "text": "func AddToScheme(s *runtime.Scheme) error {\n\tvar AddToSchemes runtime.SchemeBuilder\n\taddToSchemes := append(AddToSchemes, toolchainv1alpha1.AddToScheme, extensionsv1.AddToScheme)\n\treturn addToSchemes.AddToScheme(s)\n}", "title": "" }, { "docid": "a13db4448ee1f3404373e417070d3f3a", "score": "0.45876306", "text": "func AddToScheme(scheme *runtime.Scheme) {\n\tutilruntime.Must(v1.AddtoScheme(scheme))\n}", "title": "" }, { "docid": "097b55c3f2bfb52fa93bf8ceadbe1086", "score": "0.4584873", "text": "func AddToScheme(scheme *runtime.Scheme) {\n\tutilruntime.Must(v1alpha1.AddToScheme(scheme))\n\tutilruntime.Must(config.AddToScheme(scheme))\n\tutilruntime.Must(configv1.AddToScheme(scheme))\n}", "title": "" }, { "docid": "b0f962fac5a834e832489dd9f6f9c6b5", "score": "0.45320758", "text": "func addKnownTypes(scheme *runtime.Scheme) error {\n\tScheme = scheme\n\tscheme.AddKnownTypes(SchemeGroupVersion,\n\t\t&ServerlessDB{},\n\t\t&ServerlessDBList{},\n\t)\n\n\tmetav1.AddToGroupVersion(scheme, SchemeGroupVersion)\n\treturn nil\n}", "title": "" }, { "docid": "175cc01727f420cef14e091f1bd186c3", "score": "0.44680563", "text": "func NewConversionController(\n\tctx context.Context,\n\tpath string,\n\tkinds map[schema.GroupKind]GroupKindConversion,\n\twithContext func(context.Context) context.Context,\n) *controller.Impl {\n\n\topts := []OptionFunc{\n\t\tWithPath(path),\n\t\tWithWrapContext(withContext),\n\t\tWithKinds(kinds),\n\t}\n\n\treturn newController(ctx, opts...)\n}", "title": "" }, { "docid": "3db8af9fc9a83cf69b57a5bd285be78d", "score": "0.44586104", "text": "func Register(scheme string, creator NotifierCreator) {\n\tregistry[scheme] = creator\n}", "title": "" }, { "docid": "0a85c46b8cc598d2ed46b693cb756f1f", "score": "0.4448025", "text": "func AddInternalConversion(typeName string, fn ConversionFunc) {\n\tconversionFuncs[typeTuple{\"v1beta1\", \"\", typeName}] = fn\n}", "title": "" }, { "docid": "8286346e4e90bd69104caccd177960bc", "score": "0.44430396", "text": "func AddToScheme(s *runtime.Scheme) error {\n\treturn AddToSchemes.AddToScheme(s)\n}", "title": "" }, { "docid": "8286346e4e90bd69104caccd177960bc", "score": "0.44430396", "text": "func AddToScheme(s *runtime.Scheme) error {\n\treturn AddToSchemes.AddToScheme(s)\n}", "title": "" }, { "docid": "8286346e4e90bd69104caccd177960bc", "score": "0.44430396", "text": "func AddToScheme(s *runtime.Scheme) error {\n\treturn AddToSchemes.AddToScheme(s)\n}", "title": "" }, { "docid": "8286346e4e90bd69104caccd177960bc", "score": "0.44430396", "text": "func AddToScheme(s *runtime.Scheme) error {\n\treturn AddToSchemes.AddToScheme(s)\n}", "title": "" }, { "docid": "74bea23cf379debc49dc74e0e9cd239e", "score": "0.44205227", "text": "func Register(ext *sqlite.ExtensionApi, opt *options.Options) (_ sqlite.ErrorCode, err error) {\n\tvar fns = map[string]sqlite.Function{\n\t\t\"go_mod_to_json\": &GoModToJSON{},\n\t}\n\n\tfor name, fn := range fns {\n\t\tif err = ext.CreateFunction(name, fn); err != nil {\n\t\t\treturn sqlite.SQLITE_ERROR, errors.Wrapf(err, \"failed to register golang %q function\", name)\n\t\t}\n\t}\n\treturn sqlite.SQLITE_OK, nil\n}", "title": "" }, { "docid": "7bf4d596015fa352e2705d108ad57d76", "score": "0.44149208", "text": "func (s *Storage) NewConversion(from, to Code) (Conversion, error) {\n\ts.mtx.Lock()\n\tdefer s.mtx.Unlock()\n\n\tif !s.fxRates.HasData() {\n\t\terr := storage.SeedDefaultForeignExchangeRates()\n\t\tif err != nil {\n\t\t\treturn Conversion{}, err\n\t\t}\n\t}\n\treturn s.fxRates.Register(from, to)\n}", "title": "" }, { "docid": "0d49afac30dd30db4a235cd195c89dc7", "score": "0.44138795", "text": "func doConversion(convertRequest *v1.ConversionRequest, converter Converter) (*v1.ConversionResponse, error) {\n\tif convertRequest == nil {\n\t\treturn nil, errors.New(\"invalid request\")\n\t}\n\n\tvar convertedObjects []runtime.RawExtension\n\tfor _, obj := range convertRequest.Objects {\n\t\tcr := unstructured.Unstructured{}\n\t\tif err := cr.UnmarshalJSON(obj.Raw); err != nil {\n\t\t\treturn nil, microerror.Mask(err)\n\t\t}\n\t\tconvertedCR, err := converter.Convert(&cr, convertRequest.DesiredAPIVersion)\n\t\tif err != nil {\n\t\t\treturn nil, microerror.Mask(err)\n\t\t}\n\t\tconvertedCR.SetAPIVersion(convertRequest.DesiredAPIVersion)\n\t\tconvertedObjects = append(convertedObjects, runtime.RawExtension{Object: convertedCR})\n\t}\n\n\treturn &v1.ConversionResponse{\n\t\tConvertedObjects: convertedObjects,\n\t\tUID: convertRequest.UID,\n\t\tResult: metav1.Status{\n\t\t\tStatus: metav1.StatusSuccess,\n\t\t},\n\t}, nil\n}", "title": "" }, { "docid": "8efd32cab41252139ab43dc6dbb4700e", "score": "0.4412818", "text": "func RegisterWithMapper(schema string, factoryFunc FactoryURLFunc) {\n\tsupported.Store(schema, factoryFunc)\n}", "title": "" }, { "docid": "f739833764b08dec1e69b7a44f0582e6", "score": "0.43949744", "text": "func addDefaultingFuncs(scheme *runtime.Scheme) error {\n\treturn RegisterDefaults(scheme)\n}", "title": "" }, { "docid": "136a7c02ecfef1facac873a5ade6b36d", "score": "0.4387424", "text": "func addKnownTypes(scheme *runtime.Scheme) error {\n\t// At the moment the v3 API is identical to the internal API. Register the same set of definitions as the\n\t// internal set, no conversions are required since they are identical.\n\tscheme.AddKnownTypes(v3.SchemeGroupVersionInternal, v3.AllKnownTypes...)\n\treturn nil\n}", "title": "" }, { "docid": "70ebdcd9c6774a9fe4ad58137872b133", "score": "0.43767044", "text": "func SchemeWith(o ...runtime.Object) *runtime.Scheme {\n\ts := runtime.NewScheme()\n\ts.AddKnownTypes(GV, o...)\n\treturn s\n}", "title": "" }, { "docid": "139e2f5621d20ab61b04a2efe7c96775", "score": "0.43748885", "text": "func (app *BaseApp) registerABCIListenerPlugin(\n\tappOpts servertypes.AppOptions,\n\tkeys map[string]*storetypes.KVStoreKey,\n\tabciListener storetypes.ABCIListener,\n) {\n\tstopNodeOnErrKey := fmt.Sprintf(\"%s.%s.%s\", StreamingTomlKey, StreamingABCITomlKey, StreamingABCIStopNodeOnErrTomlKey)\n\tstopNodeOnErr := cast.ToBool(appOpts.Get(stopNodeOnErrKey))\n\tkeysKey := fmt.Sprintf(\"%s.%s.%s\", StreamingTomlKey, StreamingABCITomlKey, StreamingABCIKeysTomlKey)\n\texposeKeysStr := cast.ToStringSlice(appOpts.Get(keysKey))\n\texposedKeys := exposeStoreKeysSorted(exposeKeysStr, keys)\n\tapp.cms.AddListeners(exposedKeys)\n\tapp.SetStreamingManager(\n\t\tstoretypes.StreamingManager{\n\t\t\tABCIListeners: []storetypes.ABCIListener{abciListener},\n\t\t\tStopNodeOnErr: stopNodeOnErr,\n\t\t},\n\t)\n}", "title": "" }, { "docid": "57c561dfc84b7a3aaf5a058409859e93", "score": "0.43661734", "text": "func (s *summarizer) registerProtocolNames(protocols []fidlgen.Protocol) {\n\tfor _, p := range protocols {\n\t\t// This will become useful when deliberating channel syntax.\n\t\ts.symbols.addProtocol(p.Name)\n\t}\n}", "title": "" }, { "docid": "1e8610fc7445395fa11887ff05934b9c", "score": "0.43597022", "text": "func (d *Decoder) RegisterConverter(value interface{}, converterFunc Converter) {\n\td.cache.registerConverter(value, converterFunc)\n}", "title": "" }, { "docid": "7309f9a93b4f917afabddc0d13d92cbb", "score": "0.4345797", "text": "func RegisterVersions(svc *graphql.Service, impl VersionsFieldResolvers) {\n\tsvc.RegisterObject(_ObjectTypeVersionsDesc, impl)\n}", "title": "" }, { "docid": "301c55ef2c0fbf4c72cb4c2c2abda07b", "score": "0.43331233", "text": "func NewCRConverterFactory(serviceResolver webhook.ServiceResolver, authResolverWrapper webhook.AuthenticationInfoResolverWrapper) (*CRConverterFactory, error) {\n\tconverterFactory := &CRConverterFactory{}\n\tif utilfeature.DefaultFeatureGate.Enabled(apiextensionsfeatures.CustomResourceWebhookConversion) {\n\t\twebhookConverterFactory, err := newWebhookConverterFactory(serviceResolver, authResolverWrapper)\n\t\tif err != nil {\n\t\t\treturn nil, err\n\t\t}\n\t\tconverterFactory.webhookConverterFactory = webhookConverterFactory\n\t}\n\treturn converterFactory, nil\n}", "title": "" }, { "docid": "7db8b97955869376f04d81019158b597", "score": "0.43291655", "text": "func init() {\n\tSchemeBuilder.Register(RegisterDeepCopies)\n}", "title": "" }, { "docid": "9729e03b472468d99a158c4d6175f6d4", "score": "0.4328819", "text": "func RegisterDeepCopies(scheme *runtime.Scheme) error {\n\treturn scheme.AddGeneratedDeepCopyFuncs(\n\t\tconversion.GeneratedDeepCopyFunc{Fn: DeepCopy_v1beta1_Cluster, InType: reflect.TypeOf(&Cluster{})},\n\t\tconversion.GeneratedDeepCopyFunc{Fn: DeepCopy_v1beta1_ClusterCondition, InType: reflect.TypeOf(&ClusterCondition{})},\n\t\tconversion.GeneratedDeepCopyFunc{Fn: DeepCopy_v1beta1_ClusterList, InType: reflect.TypeOf(&ClusterList{})},\n\t\tconversion.GeneratedDeepCopyFunc{Fn: DeepCopy_v1beta1_ClusterSpec, InType: reflect.TypeOf(&ClusterSpec{})},\n\t\tconversion.GeneratedDeepCopyFunc{Fn: DeepCopy_v1beta1_ClusterStatus, InType: reflect.TypeOf(&ClusterStatus{})},\n\t\tconversion.GeneratedDeepCopyFunc{Fn: DeepCopy_v1beta1_ServerAddressByClientCIDR, InType: reflect.TypeOf(&ServerAddressByClientCIDR{})},\n\t)\n}", "title": "" }, { "docid": "71b762b7189dc9e949fc7339c2dcff32", "score": "0.43105167", "text": "func Install(scheme *runtime.Scheme) {\n\tutilruntime.Must(trebuchet_v1.AddToScheme(scheme))\n}", "title": "" }, { "docid": "66e6e4eea37dd46966eb3633455caa35", "score": "0.430919", "text": "func (app *BaseApp) RegisterStreamingServices(appOpts servertypes.AppOptions, keys map[string]*storetypes.KVStoreKey) error {\n\t// register streaming services\n\tstreamingCfg := cast.ToStringMap(appOpts.Get(StreamingTomlKey))\n\tfor service := range streamingCfg {\n\t\tpluginKey := fmt.Sprintf(\"%s.%s.%s\", StreamingTomlKey, service, StreamingABCIPluginTomlKey)\n\t\tpluginName := strings.TrimSpace(cast.ToString(appOpts.Get(pluginKey)))\n\t\tif len(pluginName) > 0 {\n\t\t\tlogLevel := cast.ToString(appOpts.Get(flags.FlagLogLevel))\n\t\t\tplugin, err := streaming.NewStreamingPlugin(pluginName, logLevel)\n\t\t\tif err != nil {\n\t\t\t\treturn fmt.Errorf(\"failed to load streaming plugin: %w\", err)\n\t\t\t}\n\t\t\tif err := app.registerStreamingPlugin(appOpts, keys, plugin); err != nil {\n\t\t\t\treturn fmt.Errorf(\"failed to register streaming plugin %w\", err)\n\t\t\t}\n\t\t}\n\t}\n\n\treturn nil\n}", "title": "" }, { "docid": "71f6eff9447a5093f5cdb150ba6b21e4", "score": "0.43029478", "text": "func RegisterProvider(scheme string, provider Provider) {\n\tproviders[scheme] = provider\n}", "title": "" }, { "docid": "f6478ce51f7e52bd3e19bcde042cc120", "score": "0.42876193", "text": "func registerRelationBuiltins(class string, types ...string) {\n\tCLASS := strings.ToUpper(class)\n\tall := []interface{}{}\n\tfor _, privType := range types {\n\t\tTYPE := strings.ToUpper(privType)\n\t\tBuiltinsProfiles[\"__default_\"+privType+\"_on_\"+class+\"__\"] = []interface{}{map[string]string{\n\t\t\t\"default\": \"global\",\n\t\t\t\"type\": TYPE,\n\t\t\t\"on\": CLASS,\n\t\t}, map[string]string{\n\t\t\t\"default\": \"schema\",\n\t\t\t\"type\": TYPE,\n\t\t\t\"on\": CLASS,\n\t\t}}\n\t\tBuiltinsProfiles[\"__\"+privType+\"_on_all_\"+class+\"__\"] = []interface{}{map[string]string{\n\t\t\t\"type\": TYPE,\n\t\t\t\"on\": \"ALL \" + CLASS + \" IN SCHEMA\",\n\t\t}}\n\t\tBuiltinsProfiles[\"__\"+privType+\"_on_\"+class+\"__\"] = []interface{}{\n\t\t\t\"__default_\" + privType + \"_on_\" + class + \"__\",\n\t\t\t\"__\" + privType + \"_on_all_\" + class + \"__\",\n\t\t}\n\t\tall = append(all, \"__\"+privType+\"_on_\"+class+\"__\")\n\t}\n\tBuiltinsProfiles[\"__all_on_\"+class+\"__\"] = all\n}", "title": "" }, { "docid": "3ca200a3fc6470c24049bc6e953c90d2", "score": "0.42725053", "text": "func RegisterChannelFormat(values *ytapi.Values, table *ytapi.Table) error {\n\n\ttable.RegisterPart(\"id\", []*ytapi.Flag{\n\t\t&ytapi.Flag{Name: \"channel\", Path: \"Id\", Type: ytapi.FLAG_CHANNEL},\n\t})\n\n\ttable.RegisterPart(\"snippet\", []*ytapi.Flag{\n\t\t&ytapi.Flag{Name: \"title\", Path: \"Snippet/Title\", Type: ytapi.FLAG_STRING},\n\t\t&ytapi.Flag{Name: \"description\", Path: \"Snippet/Description\", Type: ytapi.FLAG_STRING},\n\t\t&ytapi.Flag{Name: \"publishedAt\", Path: \"Snippet/PublishedAt\", Type: ytapi.FLAG_TIME},\n\t\t&ytapi.Flag{Name: \"country\", Path: \"Snippet/Country\", Type: ytapi.FLAG_REGION},\n\t\t&ytapi.Flag{Name: \"defaultLanguage\", Path: \"Snippet/DefaultLanguage\", Type: ytapi.FLAG_LANGUAGE},\n\t})\n\n\ttable.RegisterPart(\"contentDetails\", []*ytapi.Flag{\n\t\t&ytapi.Flag{Name: \"playlistLikes\", Path: \"ContentDetails/RelatedPlaylists/Likes\", Type: ytapi.FLAG_PLAYLIST},\n\t\t&ytapi.Flag{Name: \"playlistFavorites\", Path: \"ContentDetails/RelatedPlaylists/Favourites\", Type: ytapi.FLAG_PLAYLIST},\n\t\t&ytapi.Flag{Name: \"playlistUploads\", Path: \"ContentDetails/RelatedPlaylists/Uploads\", Type: ytapi.FLAG_PLAYLIST},\n\t\t&ytapi.Flag{Name: \"playlistWatchHistory\", Path: \"ContentDetails/RelatedPlaylists/WatchHistory\", Type: ytapi.FLAG_PLAYLIST},\n\t\t&ytapi.Flag{Name: \"playlistWatchLater\", Path: \"ContentDetails/RelatedPlaylists/WatchLater\", Type: ytapi.FLAG_PLAYLIST},\n\t\t&ytapi.Flag{Name: \"googlePlusUserId\", Path: \"ContentDetails/GooglePlusUserId\", Type: ytapi.FLAG_STRING},\n\t})\n\n\ttable.RegisterPart(\"statistics\", []*ytapi.Flag{\n\t\t&ytapi.Flag{Name: \"viewCount\", Path: \"Statistics/ViewCount\", Type: ytapi.FLAG_UINT},\n\t\t&ytapi.Flag{Name: \"commentCount\", Path: \"Statistics/CommentCount\", Type: ytapi.FLAG_UINT},\n\t\t&ytapi.Flag{Name: \"subscriberCount\", Path: \"Statistics/SubscriberCount\", Type: ytapi.FLAG_UINT},\n\t\t&ytapi.Flag{Name: \"hiddenSubscriberCount\", Path: \"Statistics/HiddenSubscriberCount\", Type: ytapi.FLAG_BOOL},\n\t\t&ytapi.Flag{Name: \"videoCount\", Path: \"Statistics/VideoCount\", Type: ytapi.FLAG_UINT},\n\t})\n\n\ttable.RegisterPart(\"status\", []*ytapi.Flag{\n\t\t&ytapi.Flag{Name: \"privacyStatus\", Path: \"Status/PrivacyStatus\", Type: ytapi.FLAG_STRING},\n\t\t&ytapi.Flag{Name: \"isLinked\", Path: \"Status/IsLinked\", Type: ytapi.FLAG_BOOL},\n\t\t&ytapi.Flag{Name: \"longUploadsStatus\", Path: \"Status/LongUploadsStatus\", Type: ytapi.FLAG_STRING},\n\t})\n\n\ttable.RegisterPart(\"auditDetails\", []*ytapi.Flag{\n\t\t&ytapi.Flag{Name: \"overallGoodStanding\", Path: \"AuditDetails/OverallGoodStanding\", Type: ytapi.FLAG_BOOL},\n\t\t&ytapi.Flag{Name: \"communityGuidelinesGoodStanding\", Path: \"AuditDetails/CommunityGuidelinesGoodStanding\", Type: ytapi.FLAG_BOOL},\n\t\t&ytapi.Flag{Name: \"copyrightStrikesGoodStanding\", Path: \"AuditDetails/CopyrightStrikesGoodStanding\", Type: ytapi.FLAG_BOOL},\n\t\t&ytapi.Flag{Name: \"contentIdClaimsGoodStanding\", Path: \"AuditDetails/ContentIdClaimsGoodStanding\", Type: ytapi.FLAG_BOOL},\n\t})\n\n\ttable.RegisterPart(\"contentOwnerDetails\", []*ytapi.Flag{\n\t\t&ytapi.Flag{Name: \"contentowner\", Path: \"ContentOwnerDetails/ContentOwner\", Type: ytapi.FLAG_CONTENTOWNER},\n\t\t&ytapi.Flag{Name: \"timeLinked\", Path: \"ContentOwnerDetails/TimeLinked\", Type: ytapi.FLAG_TIME},\n\t})\n\n\t// set default columns\n\ttable.SetColumns([]string{\"channel\", \"title\", \"description\", \"defaultLanguage\", \"country\"})\n\n\t// success\n\treturn nil\n}", "title": "" } ]
833e37e0788ee24184f86ea9411da008
SetTap allows you to set one datapoint tap at a time to inspect datapoints going out of the agent.
[ { "docid": "822dadc92776d463b8c85b8e0b251879", "score": "0.77102864", "text": "func (sw *SignalFxWriter) SetTap(dpTap *tap.DatapointTap) {\n\tsw.dpTap = dpTap\n}", "title": "" } ]
[ { "docid": "072da3bcbf57868b5e29d31721fdd768", "score": "0.678378", "text": "func (o *NetConfig) SetTap(v string) {\n\to.Tap = &v\n}", "title": "" }, { "docid": "63875539711be3963b70f394ec642983", "score": "0.65070593", "text": "func Tap(obj fyne.Tappable) {\n\tTapAt(obj, fyne.NewPos(1, 1))\n}", "title": "" }, { "docid": "31fba2c4c43dd21f634499741f40af53", "score": "0.56520396", "text": "func (trkr *tapTracker) tap(newTime time.Time) {\n\tprevTime := trkr.lastTapTime\n\ttrkr.lastTapTime = &newTime\n\tif prevTime != nil {\n\t\ttrkr.totalDuration = trkr.totalDuration + newTime.Sub(*prevTime)\n\t}\n\tif prevTime == nil {\n\t\treturn\n\t}\n\ttrkr.numberOfTaps++\n}", "title": "" }, { "docid": "d7ff7243d7e3f5476fea23af38641c9f", "score": "0.5650849", "text": "func TapAt(obj fyne.Tappable, pos fyne.Position) {\n\tev, c := prepareTap(obj, pos)\n\ttap(c, obj, ev)\n}", "title": "" }, { "docid": "3cdea95ed3ce424cf249633034be77d0", "score": "0.56192005", "text": "func Tap(target string, h *TestHelper, arg ...string) ([]*TapEvent, error) {\n\tcmd := append([]string{\"viz\", \"tap\", target}, arg...)\n\toutputStream, err := h.LinkerdRunStream(cmd...)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\tdefer outputStream.Stop()\n\n\toutputLines, err := outputStream.ReadUntil(10, 1*time.Minute)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\ttapEventByID := make(map[string]*TapEvent)\n\tfor _, line := range outputLines {\n\t\tfields := toFieldMap(line)\n\t\tobj, ok := tapEventByID[fields[\"id\"]]\n\t\tif !ok {\n\t\t\tobj = &TapEvent{}\n\t\t\ttapEventByID[fields[\"id\"]] = obj\n\t\t}\n\t\tobj.LineCount++\n\t\tobj.TLS = fields[\"tls\"]\n\n\t\tswitch fields[\"type\"] {\n\t\tcase \"req\":\n\t\t\tobj.Method = fields[\":method\"]\n\t\t\tobj.Authority = fields[\":authority\"]\n\t\t\tobj.Path = fields[\":path\"]\n\t\tcase \"rsp\":\n\t\t\tobj.HTTPStatus = fields[\":status\"]\n\t\tcase \"end\":\n\t\t\tobj.GrpcStatus = fields[\"grpc-status\"]\n\t\t}\n\t}\n\n\toutput := make([]*TapEvent, 0)\n\tfor _, obj := range tapEventByID {\n\t\tif obj.LineCount == 3 { // filter out incomplete events\n\t\t\toutput = append(output, obj)\n\t\t}\n\t}\n\n\treturn output, nil\n}", "title": "" }, { "docid": "a9bf5fc545cbc09a27fc90f4e73cb8cc", "score": "0.5151143", "text": "func (l *TapRect) Tapped(*fyne.PointEvent) {\n\tif l.OnTapped != nil {\n\t\tl.OnTapped()\n\t}\n}", "title": "" }, { "docid": "414cf14c1dab6dbfb5f2e54e44ad1cbd", "score": "0.51117545", "text": "func (s *GRPCTapServer) Tap(req *tapPb.TapRequest, stream tapPb.Tap_TapServer) error {\n\treturn status.Error(codes.Unimplemented, \"Tap is deprecated, use TapByResource\")\n}", "title": "" }, { "docid": "ef618d3ea1cf1430308c1410232a534a", "score": "0.5012175", "text": "func setupTapDevice(podID types.UUID) (netlink.Link, error) {\n\t// network device names are limited to 16 characters\n\t// the suffix %d will be replaced by the kernel with a suitable number\n\tnameTemplate := fmt.Sprintf(\"rkt-%s-tap%%d\", podID.String()[0:4])\n\tifName, err := tuntap.CreatePersistentIface(nameTemplate, tuntap.Tap)\n\tif err != nil {\n\t\treturn nil, fmt.Errorf(\"tuntap persist %v\", err)\n\t}\n\tlink, err := netlink.LinkByName(ifName)\n\tif err != nil {\n\t\treturn nil, fmt.Errorf(\"cannot find link %q: %v\", ifName, err)\n\t}\n\terr = netlink.LinkSetUp(link)\n\tif err != nil {\n\t\treturn nil, fmt.Errorf(\"cannot set link up %q: %v\", ifName, err)\n\t}\n\treturn link, nil\n}", "title": "" }, { "docid": "98e660f8fe8a5ddfabf80a780c196898", "score": "0.49741375", "text": "func (a *Agent) SetData(key string, data string) {\n\tglobals.GetInstance().Set(a.ID, key, data)\n}", "title": "" }, { "docid": "b692d63d006233a84263777ae5ddfae7", "score": "0.4931812", "text": "func (r *Result) SetHit(hit uint32) {\n\t(*audit.DataAuditResult)(r).\n\t\tSetHit(hit)\n}", "title": "" }, { "docid": "d3f1ebc7a14452e3d3ba9c5278ec1eed", "score": "0.48385596", "text": "func (_e *DataConn_Expecter) SetTime(path interface{}, t interface{}) *DataConn_SetTime_Call {\n\treturn &DataConn_SetTime_Call{Call: _e.mock.On(\"SetTime\", path, t)}\n}", "title": "" }, { "docid": "a7441f52d0525c896edaa1837f907577", "score": "0.4776951", "text": "func (l *Latency) Set(idx int, latency int64) {\n\tif idx+1 > len(l.history) {\n\t\treturn\n\t}\n\tl.history[idx] = latency\n\tl.setCount++\n\tl.shouldReset()\n}", "title": "" }, { "docid": "8824cee223aa7e38955f52311b0ae691", "score": "0.46552747", "text": "func (t *TAPDarwin) SetIP(ip net.IP) {\n\tt.IP = ip\n}", "title": "" }, { "docid": "51a8f14625fe88400e29294fa9641119", "score": "0.46504304", "text": "func NewCmdTap() *cobra.Command {\n\toptions := newTapOptions()\n\n\tcmd := &cobra.Command{\n\t\tUse: \"tap [flags] (RESOURCE)\",\n\t\tShort: \"Listen to a traffic stream\",\n\t\tLong: `Listen to a traffic stream.\n\n The RESOURCE argument specifies the target resource(s) to tap:\n (TYPE [NAME] | TYPE/NAME)\n\n Examples:\n * cronjob/my-cronjob\n * deploy\n * deploy/my-deploy\n * deploy my-deploy\n * ds/my-daemonset\n * job/my-job\n * ns/my-ns\n * rs\n * rs/my-replicaset\n * sts\n * sts/my-statefulset\n\n Valid resource types include:\n * cronjobs\n * daemonsets\n * deployments\n * jobs\n * namespaces\n * pods\n * replicasets\n * replicationcontrollers\n * statefulsets\n * services (only supported as a --to resource)`,\n\t\tExample: ` # tap the web deployment in the default namespace\n linkerd viz tap deploy/web\n\n # tap the web-dlbvj pod in the default namespace\n linkerd viz tap pod/web-dlbvj\n\n # tap the test namespace, filter by request to prod namespace\n linkerd viz tap ns/test --to ns/prod`,\n\t\tArgs: cobra.RangeArgs(1, 2),\n\t\tValidArgsFunction: func(cmd *cobra.Command, args []string, toComplete string) ([]string, cobra.ShellCompDirective) {\n\t\t\t// This command requires at most two arguments if we already have\n\t\t\t// two after requesting autocompletion i.e. [tab][tab]\n\t\t\t// skip running validArgsFunction\n\t\t\tif len(args) > 1 {\n\t\t\t\treturn nil, cobra.ShellCompDirectiveError\n\t\t\t}\n\n\t\t\tk8sAPI, err := k8s.NewAPI(kubeconfigPath, kubeContext, impersonate, impersonateGroup, 0)\n\t\t\tif err != nil {\n\t\t\t\treturn nil, cobra.ShellCompDirectiveError\n\t\t\t}\n\n\t\t\tif options.namespace == \"\" {\n\t\t\t\toptions.namespace = pkgcmd.GetDefaultNamespace(kubeconfigPath, kubeContext)\n\t\t\t}\n\n\t\t\tcc := k8s.NewCommandCompletion(k8sAPI, options.namespace)\n\n\t\t\tresults, err := cc.Complete(args, toComplete)\n\t\t\tif err != nil {\n\t\t\t\treturn nil, cobra.ShellCompDirectiveError\n\t\t\t}\n\n\t\t\treturn results, cobra.ShellCompDirectiveDefault\n\t\t},\n\t\tRunE: func(cmd *cobra.Command, args []string) error {\n\t\t\tif options.namespace == \"\" {\n\t\t\t\toptions.namespace = pkgcmd.GetDefaultNamespace(kubeconfigPath, kubeContext)\n\t\t\t}\n\n\t\t\tapi.CheckClientOrExit(hc.VizOptions{\n\t\t\t\tOptions: &healthcheck.Options{\n\t\t\t\t\tControlPlaneNamespace: controlPlaneNamespace,\n\t\t\t\t\tKubeConfig: kubeconfigPath,\n\t\t\t\t\tImpersonate: impersonate,\n\t\t\t\t\tImpersonateGroup: impersonateGroup,\n\t\t\t\t\tKubeContext: kubeContext,\n\t\t\t\t\tAPIAddr: apiAddr,\n\t\t\t\t},\n\t\t\t\tVizNamespaceOverride: vizNamespace,\n\t\t\t})\n\n\t\t\trequestParams := pkg.TapRequestParams{\n\t\t\t\tResource: strings.Join(args, \"/\"),\n\t\t\t\tNamespace: options.namespace,\n\t\t\t\tToResource: options.toResource,\n\t\t\t\tToNamespace: options.toNamespace,\n\t\t\t\tMaxRps: options.maxRps,\n\t\t\t\tScheme: options.scheme,\n\t\t\t\tMethod: options.method,\n\t\t\t\tAuthority: options.authority,\n\t\t\t\tPath: options.path,\n\t\t\t\tExtract: options.output == jsonOutput,\n\t\t\t\tLabelSelector: options.labelSelector,\n\t\t\t}\n\n\t\t\terr := options.validate()\n\t\t\tif err != nil {\n\t\t\t\treturn fmt.Errorf(\"validation error when executing tap command: %w\", err)\n\t\t\t}\n\n\t\t\treq, err := pkg.BuildTapByResourceRequest(requestParams)\n\t\t\tif err != nil {\n\t\t\t\tfmt.Fprintln(os.Stderr, err.Error())\n\t\t\t\tos.Exit(1)\n\t\t\t}\n\n\t\t\tk8sAPI, err := k8s.NewAPI(kubeconfigPath, kubeContext, impersonate, impersonateGroup, 0)\n\t\t\tif err != nil {\n\t\t\t\tfmt.Fprintln(os.Stderr, err.Error())\n\t\t\t\tos.Exit(1)\n\t\t\t}\n\n\t\t\terr = requestTapByResourceFromAPI(cmd.Context(), os.Stdout, k8sAPI, req, options)\n\t\t\tif err != nil {\n\t\t\t\tfmt.Fprintln(os.Stderr, err.Error())\n\t\t\t\tos.Exit(1)\n\t\t\t}\n\n\t\t\treturn nil\n\t\t},\n\t}\n\n\tcmd.PersistentFlags().StringVarP(&options.namespace, \"namespace\", \"n\", options.namespace,\n\t\t\"Namespace of the specified resource\")\n\tcmd.PersistentFlags().StringVar(&options.toResource, \"to\", options.toResource,\n\t\t\"Display requests to this resource\")\n\tcmd.PersistentFlags().StringVar(&options.toNamespace, \"to-namespace\", options.toNamespace,\n\t\t\"Sets the namespace used to lookup the \\\"--to\\\" resource; by default the current \\\"--namespace\\\" is used\")\n\tcmd.PersistentFlags().Float32Var(&options.maxRps, \"max-rps\", options.maxRps,\n\t\t\"Maximum requests per second to tap.\")\n\tcmd.PersistentFlags().StringVar(&options.scheme, \"scheme\", options.scheme,\n\t\t\"Display requests with this scheme\")\n\tcmd.PersistentFlags().StringVar(&options.method, \"method\", options.method,\n\t\t\"Display requests with this HTTP method\")\n\tcmd.PersistentFlags().StringVar(&options.authority, \"authority\", options.authority,\n\t\t\"Display requests with this :authority\")\n\tcmd.PersistentFlags().StringVar(&options.path, \"path\", options.path,\n\t\t\"Display requests with paths that start with this prefix\")\n\tcmd.PersistentFlags().StringVarP(&options.output, \"output\", \"o\", options.output,\n\t\tfmt.Sprintf(\"Output format. One of: \\\"%s\\\", \\\"%s\\\", \\\"%s\\\"\", wideOutput, jsonOutput, jsonPathOutput))\n\tcmd.PersistentFlags().StringVarP(&options.labelSelector, \"selector\", \"l\", options.labelSelector,\n\t\t\"Selector (label query) to filter on, supports '=', '==', and '!='\")\n\n\tpkgcmd.ConfigureNamespaceFlagCompletion(\n\t\tcmd, []string{\"namespace\", \"to-namespace\"},\n\t\tkubeconfigPath, impersonate, impersonateGroup, kubeContext)\n\treturn cmd\n}", "title": "" }, { "docid": "27e516e64a419861aad6d4adae59d664", "score": "0.46449852", "text": "func (m *AuditEvent) SetActivity(value *string)() {\n err := m.GetBackingStore().Set(\"activity\", value)\n if err != nil {\n panic(err)\n }\n}", "title": "" }, { "docid": "f8e26f1405c339732d714f05ac848a00", "score": "0.4622379", "text": "func TapCanvas(c fyne.Canvas, pos fyne.Position) {\n\tif o, p := findTappable(c, pos); o != nil {\n\t\ttap(c, o.(fyne.Tappable), &fyne.PointEvent{AbsolutePosition: pos, Position: p})\n\t}\n}", "title": "" }, { "docid": "e22eaca26be353bdbc108ea991bbcf4b", "score": "0.46222898", "text": "func (d *Dao) SetPointTip(c context.Context, mid, id int64, val int, expired int32) (err error) {\n\tvar (\n\t\tkey = pointTip(mid, id)\n\t)\n\tconn := d.mc.Get(c)\n\tdefer conn.Close()\n\titem := &gmc.Item{Key: key, Object: val, Expiration: expired, Flags: gmc.FlagJSON}\n\tif err = conn.Set(item); err != nil {\n\t\terr = errors.WithStack(err)\n\t\treturn\n\t}\n\treturn\n}", "title": "" }, { "docid": "a7bba4f5791bcf9c75c85858061798bc", "score": "0.46207315", "text": "func (o *Agent) SetTile(t *GridObject) {\n\to.tile = t\n}", "title": "" }, { "docid": "6fcd279413125c6b669d48982dbc7fcd", "score": "0.4605869", "text": "func Set(d Metric) {\n\tdriver = d\n}", "title": "" }, { "docid": "32f58a49e107ede4b5b81dcfc67c2fde", "score": "0.46053368", "text": "func (d Device) Set(cmd, params string) error {\n\t_, err := d.Write([]byte(\"AT\" + cmd + \"=\" + params + \"\\r\\n\"))\n\treturn err\n}", "title": "" }, { "docid": "d62f43ee936a613dc6b29e67820bbe74", "score": "0.45885363", "text": "func (trkr *tapTracker) reset() {\n\ttrkr.totalDuration = time.Duration(0)\n\ttrkr.numberOfTaps = 0\n\ttrkr.lastTapTime = nil\n}", "title": "" }, { "docid": "a856dfef5346c8745f2146c51832ab60", "score": "0.45825845", "text": "func (mik *Mikrotik) SetOne(apipath, name, value string) error {\n\t_, err := mik.RunArgs(apipath, fmt.Sprintf(\"=%s=%s\", name, value))\n\treturn err\n}", "title": "" }, { "docid": "0e29e586a4596a166edfeb037a20351a", "score": "0.45669246", "text": "func (ep *EntryPoints) SetValue(val interface{}) {\n\t*ep = val.(EntryPoints)\n}", "title": "" }, { "docid": "284996da386b9e961043fa11d01f17bf", "score": "0.45589182", "text": "func (m *RiskDetection) SetActivity(value *ActivityType)() {\n err := m.GetBackingStore().Set(\"activity\", value)\n if err != nil {\n panic(err)\n }\n}", "title": "" }, { "docid": "62a7d5d612c394cde40aa7e668449f83", "score": "0.4557471", "text": "func (b *edgePVMounter) SetUpAt(dir string, fsGroup *int64) error {\n\treturn fmt.Errorf(\"SetUpAt() does not make sense for edge pv volumes\")\n}", "title": "" }, { "docid": "5ff5e1aa9ce9abb2f86bcebba856543d", "score": "0.45573825", "text": "func (frame *RTUFrame) SetData(data []byte) {\n\tframe.Data = data\n}", "title": "" }, { "docid": "85400338ea68fe9005c0612efa951ed6", "score": "0.45513394", "text": "func (p *Perfdata) SetLabel(label string) error {\n\tlog.Debug(\"Label: \", label)\n\n\tif label == \"\" {\n\t\treturn errors.New(\"Label can't be empty\")\n\t}\n\n\tp.label = label\n\n\treturn nil\n}", "title": "" }, { "docid": "1c5235b2c123703ed0eed86d446ed20f", "score": "0.45271093", "text": "func (l *LocalSDKServer) SetAnnotation(_ context.Context, kv *sdk.KeyValue) (*sdk.Empty, error) {\n\tl.logger.WithField(\"values\", kv).Info(\"Setting annotation\")\n\tl.gsMutex.Lock()\n\tdefer l.gsMutex.Unlock()\n\n\tif l.gs.ObjectMeta == nil {\n\t\tl.gs.ObjectMeta = &sdk.GameServer_ObjectMeta{}\n\t}\n\tif l.gs.ObjectMeta.Annotations == nil {\n\t\tl.gs.ObjectMeta.Annotations = map[string]string{}\n\t}\n\n\tl.gs.ObjectMeta.Annotations[metadataPrefix+kv.Key] = kv.Value\n\tl.update <- struct{}{}\n\tl.recordRequestWithValue(\"setannotation\", kv.Value, \"UID\")\n\treturn &sdk.Empty{}, nil\n}", "title": "" }, { "docid": "dc32b13779d509811ef7ffe95ac5f897", "score": "0.45221564", "text": "func (m *MapPanel) Tap(x, y int32) {\n\tif m.app.MapData.Side == rp.MapSide_TOP {\n\t\tx = m.app.MapData.X - x + 1\n\t\ty = m.app.MapData.Y - y + 1\n\t}\n\tif x < 1 || x > m.app.MapData.X || y < 1 || y > m.app.MapData.Y {\n\t\t// out of bounds\n\t\treturn\n\t}\n\n\tif m.command == nil {\n\t\t// no command set\n\t\treturn\n\t}\n\n\tunitX := m.command.GameState.Grid.GetX()\n\tunitY := m.command.GameState.Grid.GetY()\n\n\tdx := (unitX - x)\n\tdy := (unitY - y)\n\tdistance := dx*dx + dy*dy\n\tswitch m.order {\n\tcase rp.Order_RESTAGE:\n\t\t//m.app.ordersPanel.build()\n\t\tm.command.SetObjective(x, y)\n\t\twidget.Renderer(m.mapWidget).Refresh()\n\tcase rp.Order_MARCH:\n\t\t// march to location if not too far\n\t\tmaxd := int32(10)\n\t\tswitch m.command.Arm {\n\t\tcase rp.Arm_CAVALRY:\n\t\t\tmaxd = 14\n\t\t}\n\t\tif distance > maxd {\n\t\t\tprintln(\"too far\", distance)\n\t\t\treturn\n\t\t}\n\t\tm.command.AddToObjective(x, y)\n\tcase rp.Order_DEFEND:\n\t\t// defend at current location\n\t\treturn\n\tcase rp.Order_ENGAGE:\n\t\t// can engage out to 2 grids\n\t\tif distance > 4 {\n\t\t\tprintln(\"too far\", distance)\n\t\t\treturn\n\t\t}\n\t\tm.command.AddToObjective(x, y)\n\tcase rp.Order_ATTACK:\n\t\t// can attack out to 1 grid\n\t\tif distance > 2 {\n\t\t\tprintln(\"too far\", distance)\n\t\t\treturn\n\t\t}\n\t\tm.command.SetObjective(x, y)\n\tcase rp.Order_CHARGE:\n\t\t// check the range\n\t\tif distance > 9 {\n\t\t\tprintln(\"too far\", distance)\n\t\t\treturn\n\t\t}\n\t\tm.command.SetObjective(x, y)\n\tcase rp.Order_PURSUIT:\n\t\t// check the range\n\t\tif distance > 12 {\n\t\t\tprintln(\"too far\", distance)\n\t\t\treturn\n\t\t}\n\t\tm.command.AddToObjective(x, y)\n\tcase rp.Order_FIRE:\n\t\t// can fire out to adj grid\n\t\tif distance > 4 {\n\t\t\tprintln(\"too far\", distance)\n\t\t\treturn\n\t\t}\n\t\tm.command.SetObjective(x, y)\n\t}\n\tm.app.store.CommanderMap.Refresh(m.command)\n\n\twidget.Renderer(m.mapWidget).Refresh()\n}", "title": "" }, { "docid": "4c0e89d4a48dd36cb1cbfe7b480a3fec", "score": "0.45145142", "text": "func DoubleTap(obj fyne.DoubleTappable) {\n\tev, c := prepareTap(obj, fyne.NewPos(1, 1))\n\thandleFocusOnTap(c, obj)\n\tobj.DoubleTapped(ev)\n}", "title": "" }, { "docid": "52650a917b5a5e0cf305f6d5d70ad3e3", "score": "0.45139846", "text": "func (a *ofFlowAction) SetARPTpa(addr net.IP) FlowBuilder {\n\tsetARPTpaAct := &ofctrl.SetARPTpaAction{IP: addr}\n\ta.builder.ApplyAction(setARPTpaAct)\n\treturn a.builder\n}", "title": "" }, { "docid": "3aa5d24f3535d941a9cbe6e0a52da8d1", "score": "0.45054263", "text": "func (p *Packet) SetTemperature(v float32) error {\n\t// create the temperature telemetry struct\n\tt := NewTemperatureTelemetry(v)\n\n\t// write the temperature telemetry struct to the telemetry group buffer\n\terr := binary.Write(&p.TelemetryData, binary.BigEndian, t)\n\n\t// return whether an error occurred\n\treturn err\n}", "title": "" }, { "docid": "bcd1ff1393b56e3fd3e729fe5358b945", "score": "0.45013297", "text": "func (Aftertouch) set(channel uint8, firstArg uint8) setter1 {\n\tvar m Aftertouch\n\tm.channel = channel\n\tm.pressure = midilib.ParseUint7(firstArg)\n\treturn m\n}", "title": "" }, { "docid": "361032705e442cc912000bc471185a71", "score": "0.4499252", "text": "func (t *Tab) Click(x, y float64) error {\n\treturn t.click(x, y, 1)\n}", "title": "" }, { "docid": "0b88ccbc2ae9c8f29acb46c94fe83af5", "score": "0.4495335", "text": "func (m *AuditEvent) SetActor(value AuditActorable)() {\n err := m.GetBackingStore().Set(\"actor\", value)\n if err != nil {\n panic(err)\n }\n}", "title": "" }, { "docid": "0c7408701e7c270365730433bdee01a3", "score": "0.4476892", "text": "func (input *YafInput) SetData(key, val interface{}) {\r\n\tinput.Data[key] = val\r\n}", "title": "" }, { "docid": "fed93d483715ea37a2fa8219f4cbb89d", "score": "0.44662827", "text": "func TapKey(ctx context.Context, tconn *chrome.TestConn, keyName string) error {\n\tkey, err := FindKeyNode(ctx, tconn, keyName)\n\tif err != nil {\n\t\treturn errors.Wrapf(err, \"failed to find key: %s\", keyName)\n\t}\n\tdefer key.Release(ctx)\n\n\tif err := key.LeftClick(ctx); err != nil {\n\t\treturn errors.Wrapf(err, \"failed to click key %s\", keyName)\n\t}\n\treturn nil\n}", "title": "" }, { "docid": "93d5b31f20b97a83ac522489ed9731bd", "score": "0.44614494", "text": "func (c *context) setAt(path string, value interface{}) {\n\tif path != \"\" {\n\t\tc.set[path] = reflect.ValueOf(value)\n\t}\n}", "title": "" }, { "docid": "5cab137163be95f1a2336f0494aef8bf", "score": "0.44528535", "text": "func (pa PixelArray) Touch(medium Medium, rand Random) error {\n\treturn pa[rand.Intn(len(pa))].Touch(medium, rand)\n}", "title": "" }, { "docid": "2a7103068fefc3951a885626a01f72d4", "score": "0.4447098", "text": "func (l *LocalSDKServer) SetAnnotation(_ context.Context, kv *sdk.KeyValue) (*sdk.Empty, error) {\n\tlogrus.WithField(\"values\", kv).Info(\"Setting annotation\")\n\n\tif l.gs.ObjectMeta == nil {\n\t\tl.gs.ObjectMeta = &sdk.GameServer_ObjectMeta{}\n\t}\n\tif l.gs.ObjectMeta.Annotations == nil {\n\t\tl.gs.ObjectMeta.Annotations = map[string]string{}\n\t}\n\n\tl.gs.ObjectMeta.Annotations[metadataPrefix+kv.Key] = kv.Value\n\tl.update <- struct{}{}\n\treturn &sdk.Empty{}, nil\n}", "title": "" }, { "docid": "f7b3c435a32d2fb918e1c8000a6f9948", "score": "0.4437618", "text": "func (g *gpu) SetData(id int, name string, price int, tdp int, memory int, clock string) {\n\tg.id = id\n\tg.name = name\n\tg.price = price\n\tg.tdp = tdp\n\tg.memory = memory\n\tg.clock = clock\n}", "title": "" }, { "docid": "8eaf4e88a28d3ef53743209311f1be77", "score": "0.44260508", "text": "func (buf *Buffer) Set(targ int, data interface{}, usage int) {\n\tbuf.Bind(targ)\n\tp, t, ts, s := toCtype(data)\n\tC.glBufferData(C.GLenum(targ), C.GLsizeiptr(s), p, C.GLenum(usage))\n\tbuf.t = t\n\tbuf.ts = ts\n\tbuf.Unbind(targ)\n}", "title": "" }, { "docid": "8a7df134360d62f9e47a8c1888de520f", "score": "0.44124863", "text": "func (c *Chip8) SetDT(val uint8) {\n\tc.startDelayTimer(val)\n}", "title": "" }, { "docid": "71f931d04f586967678ead941ed8fd8c", "score": "0.44078597", "text": "func (client *Client) SetAttribute(path string, options *option.SetAttribute) error {\n\treturn client.post(join(pathsPrefix, path, setAttribute), noParams, options, nil)\n}", "title": "" }, { "docid": "e2e066ce56f6b62b497455eabef2ddca", "score": "0.4397081", "text": "func TapSecondary(obj fyne.SecondaryTappable) {\n\tTapSecondaryAt(obj, fyne.NewPos(1, 1))\n}", "title": "" }, { "docid": "1a109f6e5ec0070576e1d75f3bc66d47", "score": "0.4395705", "text": "func (m *BusinessScenarioTask) SetTarget(value BusinessScenarioTaskTargetBaseable)() {\n err := m.GetBackingStore().Set(\"target\", value)\n if err != nil {\n panic(err)\n }\n}", "title": "" }, { "docid": "b4e58c08414cc36a58c6e5d4794a3e0a", "score": "0.43941808", "text": "func (c *CPU) TYA(address uint16) {\n\tc.A = c.Y\n\tc.Status.setZN(c.A)\n}", "title": "" }, { "docid": "0f899767fc37e52a4b16f63637e5215c", "score": "0.43884772", "text": "func (p *Pov) SetAt(x, y, z float64) *Pov {\n\tp.stable = false\n\tp.T.Loc.X, p.T.Loc.Y, p.T.Loc.Z = x, y, z\n\treturn p\n}", "title": "" }, { "docid": "eb9e0d64f00158e20566f2ec5eaaa54e", "score": "0.4383296", "text": "func SetTable(t Table) { table = t }", "title": "" }, { "docid": "32e5fd177d72d00af80a52b2e1c85888", "score": "0.43760395", "text": "func (o *NetworkManager_Device_Macvlan) GetTap(ctx context.Context) (tap bool, err error) {\n\terr = o.object.CallWithContext(ctx, \"org.freedesktop.DBus.Properties.Get\", 0, InterfaceNetworkManager_Device_Macvlan, \"Tap\").Store(&tap)\n\treturn\n}", "title": "" }, { "docid": "ad4358f7618da0bf3fd6056aab40aec6", "score": "0.43728754", "text": "func (t *Task) SetData(d interface{}) *Task {\n\tencoded, err := json.Marshal(d)\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\tt.Data = encoded\n\treturn t\n}", "title": "" }, { "docid": "38470843320aaeeda24c5d6dda28d678", "score": "0.43701914", "text": "func (m *MobileAppAssignment) SetTarget(value DeviceAndAppManagementAssignmentTargetable)() {\n m.target = value\n}", "title": "" }, { "docid": "347daf1c03b00d604b106ac43704d81c", "score": "0.43682456", "text": "func (c *Int64Gauge) Set(ctx context.Context, v int64) {\n\tstats.Record(ctx, c.measureCt.M(v))\n}", "title": "" }, { "docid": "520a1ee60db159a4e4e8144a8bbe878e", "score": "0.43667722", "text": "func (self *Creature) SetDataA(member interface{}) {\n self.Object.Set(\"data\", member)\n}", "title": "" }, { "docid": "6613b95b17d33fe5ab2a8f31f87d563c", "score": "0.4360049", "text": "func (m *RiskDetection) SetActivity(value *ActivityType)() {\n m.activity = value\n}", "title": "" }, { "docid": "2acb46e01f399c371cead9fe37d6abdf", "score": "0.43466344", "text": "func (metricsItem *Item) SetValue(value float64) {\n\tmetricsItem.handler.Set(value)\n}", "title": "" }, { "docid": "2e5402d67d643986222a313c723d47f2", "score": "0.43326896", "text": "func (o *Benchmarks) SetUp(v int64) {\n\to.Up = &v\n}", "title": "" }, { "docid": "ae40611f683849f77001ac7e35fce1ed", "score": "0.43307385", "text": "func (sample *Sample) SetTag(name, value string) {\n\tsample.lockWrite(func() {\n\t\tsample.setTag(name, value)\n\t})\n}", "title": "" }, { "docid": "2a003b9d9d29e2ff4dd0bd2b4d7ae86e", "score": "0.43304634", "text": "func (e *Entry) SetPayload(payload map[string]interface{}) {\n\te.task.Payload = payload\n}", "title": "" }, { "docid": "c87aa0880779223fab1edc7294860176", "score": "0.43300745", "text": "func (tctx *TestContext) SetActor(actorName string) {\n\tif _, exists := tctx.actors[actorName]; exists {\n\t\ttctx.currentActorName = actorName\n\t} else {\n\t\tlog.Fatalf(\"actorName: %s does not exist\", actorName)\n\t}\n}", "title": "" }, { "docid": "02729cd7af11a63a09403ea205d524c3", "score": "0.43299243", "text": "func (t *TestClock) Set(now time.Time) {\n\tt.mu.Lock()\n\tdefer t.mu.Unlock()\n\tt.now = now\n}", "title": "" }, { "docid": "47b2b4c9370e1c16b9dca745a2c97ffb", "score": "0.4329349", "text": "func (m *Event) SetSensitivity(value *Sensitivity)() {\n err := m.GetBackingStore().Set(\"sensitivity\", value)\n if err != nil {\n panic(err)\n }\n}", "title": "" }, { "docid": "c2988a4e423a0e91e88391f22b6a8750", "score": "0.43279493", "text": "func (dc *TestingClock) Set(now time.Time) {\n\tdc.now = now\n}", "title": "" }, { "docid": "75ea17c90ae2a32f7a64035c13650ab8", "score": "0.4327461", "text": "func (p *JSONAnnotationParser) SetAnnotation(name string, annotationType interface{}) {\n\tif name == \"\" {\n\t\tpanic(errors.New(\"Variable 'name' must be not empty\"))\n\t}\n\n\tif _, ok := protectedAnnotations[name]; ok {\n\t\tpanic(errors.Errorf(\"Annotation name '%s' is not allowed for change\", name))\n\t}\n\n\tp.annotations[name] = annotationType\n}", "title": "" }, { "docid": "3f6a0682533efdbd37e2c897e36bf267", "score": "0.43268743", "text": "func (t *TCounter) Set(v uint64) {\n\tatomic.StoreUint64(&t.value, v)\n}", "title": "" }, { "docid": "5161498eb17e2037a86d12d2676cc3c5", "score": "0.43260163", "text": "func (d *DockTile) SetBadge(v interface{}) error {\n\tif d.simulateErr {\n\t\treturn ErrSimulated\n\t}\n\t_, err := json.Marshal(v)\n\treturn err\n}", "title": "" }, { "docid": "b0c58bdaf8449a78d95e876ee38a2add", "score": "0.4321488", "text": "func (nc *collector) Set(key string, value interface{}) {\n\tnc.data[key] = value\n}", "title": "" }, { "docid": "b5c03933766fbe8ccb936fdd7d959a70", "score": "0.43162358", "text": "func (t *Table) SetAnnotation(ant *entsql.Annotation) *Table {\n\tt.Annotation = ant\n\treturn t\n}", "title": "" }, { "docid": "aa54026bf9bc2bc1d643395f2d870c17", "score": "0.43161613", "text": "func (vm *VM) setActor(_ context.Context, key address.Address, a *states.Actor) error {\n\tif err := vm.actors.Put(abi.AddrKey(key), a); err != nil {\n\t\treturn xerrors.Errorf(\"setting actor in state tree failed: %w\", err)\n\t}\n\tvm.actorsDirty = true\n\treturn nil\n}", "title": "" }, { "docid": "ba35daf5da8befebeebecce8a2f5172a", "score": "0.43148294", "text": "func (m *MacOSEndpointProtectionConfiguration) SetAdvancedThreatProtectionAutomaticSampleSubmission(value *Enablement)() {\n err := m.GetBackingStore().Set(\"advancedThreatProtectionAutomaticSampleSubmission\", value)\n if err != nil {\n panic(err)\n }\n}", "title": "" }, { "docid": "92a7ef25e8903a76c3d1a0baeeb96cf5", "score": "0.43128163", "text": "func (me *TxsdShow) Set(s string) { (*xsdt.Token)(me).Set(s) }", "title": "" }, { "docid": "b99dc49663281dd4d9ffa2e0b9229c25", "score": "0.43108326", "text": "func (o *Evento) SetData(v time.Time) {\n\to.Data.Set(&v)\n}", "title": "" }, { "docid": "a0bf31c156b2c3b61e8480aa9dabe1f9", "score": "0.43086553", "text": "func (l *Label) SetData(data *LabelData) {\n\tl.d0 = binary.BigEndian.Uint64((*data)[0:8])\n\tl.d1 = binary.BigEndian.Uint64((*data)[8:16])\n}", "title": "" }, { "docid": "5706b4a80b6392f54594fc9e8607c554", "score": "0.4302488", "text": "func (i *Installer) SetMetadatum(name, key string, value interface{}) {\n\ti.log.Printf(\"[Metrics] %s (%q) is %q\", name, key, value)\n\ti.scout.SetMetadatum(key, value)\n}", "title": "" }, { "docid": "43118f4b210a7e84b1b0297fd888e0d1", "score": "0.43002447", "text": "func (muo *MetadataUpdateOne) SetData(m map[string]interface{}) *MetadataUpdateOne {\n\tmuo.mutation.SetData(m)\n\treturn muo\n}", "title": "" }, { "docid": "7c4e496beddcb47bc76044db2c30c49d", "score": "0.4299105", "text": "func SetData(data map[string]any) {\n\tdc.SetData(data)\n}", "title": "" }, { "docid": "a66dcf03d6bac711b95531835f0e6d27", "score": "0.4296802", "text": "func (frame *Frame) SetAlive(x, y int) {\n\tframe.SetState(x, y, true)\n}", "title": "" }, { "docid": "2a56cdcf8a8d349bf82dd6d1d11fd84d", "score": "0.42962116", "text": "func (fpv *EncryptDataResponse_FieldTerminalPathValue) SetTo(target **EncryptDataResponse) {\n\tif *target == nil {\n\t\t*target = new(EncryptDataResponse)\n\t}\n\tswitch fpv.selector {\n\tcase EncryptDataResponse_FieldPathSelectorData:\n\t\t(*target).Data = fpv.value.([]byte)\n\tdefault:\n\t\tpanic(fmt.Sprintf(\"Invalid selector for EncryptDataResponse: %d\", fpv.selector))\n\t}\n}", "title": "" }, { "docid": "b73b90231dbe59a68c423dbeb8db578f", "score": "0.4292215", "text": "func (self *History) SetCap(cap int) {\n\tself.mux.Lock()\n\tdefer self.mux.Unlock()\n\n\tself.cap = cap\n\n\tself.recap()\n}", "title": "" }, { "docid": "b19214aeb54d4022dba553ff47c384e2", "score": "0.42830536", "text": "func (c *CPU) TAY(address uint16) {\n\tc.Y = c.A\n\tc.Status.setZN(c.Y)\n}", "title": "" }, { "docid": "cb70c67f385f35e78d677bfde565af7e", "score": "0.42789352", "text": "func (kernel *Kernel) SetArg(index uint, val uint32) {\n}", "title": "" }, { "docid": "74b3836d4e1d43e446b99ab65ab4fc4f", "score": "0.42758048", "text": "func (i *RuntimeInfo) Set(ip InfoPopulator, key string, data interface{}) {\n\tif i.Data == nil {\n\t\ti.Data = make(map[InfoPopulator]map[string]interface{})\n\t}\n\tif _, ok := i.Data[ip]; !ok {\n\t\ti.Data[ip] = make(map[string]interface{})\n\t}\n\ti.Data[ip][key] = data\n}", "title": "" }, { "docid": "3a535b8305c86e9b822248cbaddef70f", "score": "0.42746896", "text": "func (_TBSCertList *TBSCertListTransactor) SetSignature(opts *bind.TransactOpts, data []uint8) (*types.Transaction, error) {\n\treturn _TBSCertList.contract.Transact(opts, \"setSignature\", data)\n}", "title": "" }, { "docid": "f2ce6d30db76de4d8808c1cc905250d8", "score": "0.427297", "text": "func (m *UriClickSecurityState) SetClickDateTime(value *i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time)() {\n err := m.GetBackingStore().Set(\"clickDateTime\", value)\n if err != nil {\n panic(err)\n }\n}", "title": "" }, { "docid": "f6812dc253ea5456c8fa48bcbf8b53d3", "score": "0.42596883", "text": "func (m *Schedule) SetTimesOff(value []TimeOffable)() {\n err := m.GetBackingStore().Set(\"timesOff\", value)\n if err != nil {\n panic(err)\n }\n}", "title": "" }, { "docid": "928d016545fd020886bf323a8a3dc98e", "score": "0.42577773", "text": "func (c *Client) Touch(key string, seconds int32) error {\n\tspan := c.startSpan(\"Touch\")\n\terr := c.Client.Touch(key, seconds)\n\tspan.Finish(tracer.WithError(err))\n\treturn err\n}", "title": "" }, { "docid": "28bc82562f0448c9febbde4b5b2e66e6", "score": "0.42575178", "text": "func (_m *HostExpirationRegistryInterface) Set(_a0 string, _a1 int64) {\n\t_m.Called(_a0, _a1)\n}", "title": "" }, { "docid": "fc1e58e2116a0f9668651b5bb0dabbbe", "score": "0.42534405", "text": "func Set(uint64) error { return nil }", "title": "" }, { "docid": "fe6356d24c3017206685f7dec244d119", "score": "0.4232437", "text": "func createTAPAdapter(netHandle *netlink.Handle, tapName string, hardAddr net.HardwareAddr) (*netlink.Tuntap, error) {\n\tla := netlink.NewLinkAttrs()\n\tla.Name = tapName\n\tla.HardwareAddr = hardAddr\n\n\ttuntap := &netlink.Tuntap{\n\t\tLinkAttrs: la,\n\t\tMode: netlink.TUNTAP_MODE_TAP,\n\t}\n\n\treturn tuntap, addLink(netHandle, tuntap)\n}", "title": "" }, { "docid": "e54f80f2f71c6f4598bb787f88a4da4d", "score": "0.42262176", "text": "func (p *Provider) SetTracer(ctx context.Context, t *tracing.Tracer) {\n\tp.tracer = t\n\tp.traceConfig(ctx, p.Koanf, SnapshotSpanOpName)\n}", "title": "" }, { "docid": "6413a960bc00f618039222a519bb59ba", "score": "0.42246336", "text": "func (p *Perfdata) SetValue(value int) {\n\tlog.Debug(\"Value: \", value)\n\n\tp.value = value\n}", "title": "" }, { "docid": "d6ccc2bfd5e5b8eff2cd62f0c74184f2", "score": "0.4220606", "text": "func (mr *MockDBUpdateTransactionMockRecorder) SetTip(arg0 interface{}) *gomock.Call {\n\tmr.mock.ctrl.T.Helper()\n\treturn mr.mock.ctrl.RecordCallWithMethodType(mr.mock, \"SetTip\", reflect.TypeOf((*MockDBUpdateTransaction)(nil).SetTip), arg0)\n}", "title": "" }, { "docid": "c6e31919be15075de0091bfa39b19486", "score": "0.4215825", "text": "func SetExam(m *ExamData, key string, val Exam) {\n\tm.mux.Lock()\n\tm.v[key] = val\n\tm.mux.Unlock()\n\treturn\n}", "title": "" }, { "docid": "790f9890ce0dbfa335bf28769dfed8e1", "score": "0.42119458", "text": "func (e *Event) SetActivity(activity string) {\n\te.Activity = activity\n\tlog.Println(\"Nome do evento alterado para\", e.Activity)\n}", "title": "" }, { "docid": "d1c4fc5f8fde4a2968366b61d8aef1b6", "score": "0.4201987", "text": "func (m *DeviceLink) SetIpAddress(value *string)() {\n err := m.GetBackingStore().Set(\"ipAddress\", value)\n if err != nil {\n panic(err)\n }\n}", "title": "" }, { "docid": "e7eaa664c1fff616da56fa8a6fc0a167", "score": "0.42010128", "text": "func (m *CustomTaskExtensionCalloutData) SetTask(value Taskable)() {\n err := m.GetBackingStore().Set(\"task\", value)\n if err != nil {\n panic(err)\n }\n}", "title": "" }, { "docid": "6ab692d62be3dc819418283460c6deca", "score": "0.42001808", "text": "func (p *PTE) setPageTable(pt *PageTables, ptes *PTEs) {\n\taddr := pt.Allocator.PhysicalFor(ptes)\n\tif addr&^optionMask != addr {\n\t\t// This should never happen.\n\t\tpanic(\"unaligned physical address!\")\n\t}\n\tv := addr | present | user | writable | accessed | dirty\n\tatomic.StoreUintptr((*uintptr)(p), v)\n}", "title": "" }, { "docid": "091be2fa49d32c37419c51ababa7fec2", "score": "0.41975862", "text": "func (seg *Segment) SetData(data []byte) {\n\tseg.data = data\n}", "title": "" }, { "docid": "b277383ab79363fe91c2b07f88aa7439", "score": "0.4195544", "text": "func (entry *Entry) SetTimes(times int) {\n\tentry.times.Set(times)\n}", "title": "" }, { "docid": "86ac22bd5995d5ac9ed3ac5c6e6740f5", "score": "0.41950396", "text": "func CreateTap() (Tap, error) {\n\treturn Tap{}, nil\n}", "title": "" } ]
57046d96cd00e41bb8ead072f611bd8d
ManagedIdentitySettingsGenerator returns a generator of ManagedIdentitySettings instances for property testing.
[ { "docid": "8a69189771879067abe57aed5581f247", "score": "0.8737133", "text": "func ManagedIdentitySettingsGenerator() gopter.Gen {\n\tif managedIdentitySettingsGenerator != nil {\n\t\treturn managedIdentitySettingsGenerator\n\t}\n\n\tgenerators := make(map[string]gopter.Gen)\n\tAddIndependentPropertyGeneratorsForManagedIdentitySettings(generators)\n\tmanagedIdentitySettingsGenerator = gen.Struct(reflect.TypeOf(ManagedIdentitySettings{}), generators)\n\n\treturn managedIdentitySettingsGenerator\n}", "title": "" } ]
[ { "docid": "12d6c7b0fc02491b70e0640006455a9a", "score": "0.7195484", "text": "func ServiceManagedResourcesSettingsGenerator() gopter.Gen {\n\tif serviceManagedResourcesSettingsGenerator != nil {\n\t\treturn serviceManagedResourcesSettingsGenerator\n\t}\n\n\tgenerators := make(map[string]gopter.Gen)\n\tAddRelatedPropertyGeneratorsForServiceManagedResourcesSettings(generators)\n\tserviceManagedResourcesSettingsGenerator = gen.Struct(reflect.TypeOf(ServiceManagedResourcesSettings{}), generators)\n\n\treturn serviceManagedResourcesSettingsGenerator\n}", "title": "" }, { "docid": "53671f9ec093d319096628ce4a63b607", "score": "0.67163634", "text": "func ManagedIdentityGenerator() gopter.Gen {\n\tif managedIdentityGenerator != nil {\n\t\treturn managedIdentityGenerator\n\t}\n\n\tgenerators := make(map[string]gopter.Gen)\n\tAddIndependentPropertyGeneratorsForManagedIdentity(generators)\n\tmanagedIdentityGenerator = gen.Struct(reflect.TypeOf(ManagedIdentity{}), generators)\n\n\t// The above call to gen.Struct() captures the map, so create a new one\n\tgenerators = make(map[string]gopter.Gen)\n\tAddIndependentPropertyGeneratorsForManagedIdentity(generators)\n\tAddRelatedPropertyGeneratorsForManagedIdentity(generators)\n\tmanagedIdentityGenerator = gen.Struct(reflect.TypeOf(ManagedIdentity{}), generators)\n\n\treturn managedIdentityGenerator\n}", "title": "" }, { "docid": "33fe3fecbea89169a0a88314af73ce21", "score": "0.6603743", "text": "func ManagedIdentityGenerator() gopter.Gen {\n\tif managedIdentityGenerator != nil {\n\t\treturn managedIdentityGenerator\n\t}\n\n\tgenerators := make(map[string]gopter.Gen)\n\tAddIndependentPropertyGeneratorsForManagedIdentity(generators)\n\tmanagedIdentityGenerator = gen.Struct(reflect.TypeOf(ManagedIdentity{}), generators)\n\n\treturn managedIdentityGenerator\n}", "title": "" }, { "docid": "84bb47c7ad72cb6ef74e0c95d0806f34", "score": "0.65380186", "text": "func AddIndependentPropertyGeneratorsForManagedIdentitySettings(gens map[string]gopter.Gen) {\n\tgens[\"Resource\"] = gen.PtrOf(gen.AlphaString())\n}", "title": "" }, { "docid": "2bb547ec59a6399a9b8a97e3d94530eb", "score": "0.6446146", "text": "func CosmosDbSettingsGenerator() gopter.Gen {\n\tif cosmosDbSettingsGenerator != nil {\n\t\treturn cosmosDbSettingsGenerator\n\t}\n\n\tgenerators := make(map[string]gopter.Gen)\n\tAddIndependentPropertyGeneratorsForCosmosDbSettings(generators)\n\tcosmosDbSettingsGenerator = gen.Struct(reflect.TypeOf(CosmosDbSettings{}), generators)\n\n\treturn cosmosDbSettingsGenerator\n}", "title": "" }, { "docid": "edba75d99beb60377ea12e1628f3823e", "score": "0.6394913", "text": "func ManagedIdentitySettings_STATUSGenerator() gopter.Gen {\n\tif managedIdentitySettings_STATUSGenerator != nil {\n\t\treturn managedIdentitySettings_STATUSGenerator\n\t}\n\n\tgenerators := make(map[string]gopter.Gen)\n\tAddIndependentPropertyGeneratorsForManagedIdentitySettings_STATUS(generators)\n\tmanagedIdentitySettings_STATUSGenerator = gen.Struct(reflect.TypeOf(ManagedIdentitySettings_STATUS{}), generators)\n\n\treturn managedIdentitySettings_STATUSGenerator\n}", "title": "" }, { "docid": "08e67dd182151a98791c363b1e71a402", "score": "0.6222691", "text": "func ManagedServiceIdentityGenerator() gopter.Gen {\n\tif managedServiceIdentityGenerator != nil {\n\t\treturn managedServiceIdentityGenerator\n\t}\n\n\tgenerators := make(map[string]gopter.Gen)\n\tAddIndependentPropertyGeneratorsForManagedServiceIdentity(generators)\n\tmanagedServiceIdentityGenerator = gen.Struct(reflect.TypeOf(ManagedServiceIdentity{}), generators)\n\n\t// The above call to gen.Struct() captures the map, so create a new one\n\tgenerators = make(map[string]gopter.Gen)\n\tAddIndependentPropertyGeneratorsForManagedServiceIdentity(generators)\n\tAddRelatedPropertyGeneratorsForManagedServiceIdentity(generators)\n\tmanagedServiceIdentityGenerator = gen.Struct(reflect.TypeOf(ManagedServiceIdentity{}), generators)\n\n\treturn managedServiceIdentityGenerator\n}", "title": "" }, { "docid": "08e67dd182151a98791c363b1e71a402", "score": "0.6222691", "text": "func ManagedServiceIdentityGenerator() gopter.Gen {\n\tif managedServiceIdentityGenerator != nil {\n\t\treturn managedServiceIdentityGenerator\n\t}\n\n\tgenerators := make(map[string]gopter.Gen)\n\tAddIndependentPropertyGeneratorsForManagedServiceIdentity(generators)\n\tmanagedServiceIdentityGenerator = gen.Struct(reflect.TypeOf(ManagedServiceIdentity{}), generators)\n\n\t// The above call to gen.Struct() captures the map, so create a new one\n\tgenerators = make(map[string]gopter.Gen)\n\tAddIndependentPropertyGeneratorsForManagedServiceIdentity(generators)\n\tAddRelatedPropertyGeneratorsForManagedServiceIdentity(generators)\n\tmanagedServiceIdentityGenerator = gen.Struct(reflect.TypeOf(ManagedServiceIdentity{}), generators)\n\n\treturn managedServiceIdentityGenerator\n}", "title": "" }, { "docid": "26752f4e1d90e863098bdaa2320b4776", "score": "0.6173929", "text": "func AddRelatedPropertyGeneratorsForServiceManagedResourcesSettings(gens map[string]gopter.Gen) {\n\tgens[\"CosmosDb\"] = gen.PtrOf(CosmosDbSettingsGenerator())\n}", "title": "" }, { "docid": "21454e45b73cb750ebb2b55934911731", "score": "0.59208083", "text": "func ServerlessUpstreamSettingsGenerator() gopter.Gen {\n\tif serverlessUpstreamSettingsGenerator != nil {\n\t\treturn serverlessUpstreamSettingsGenerator\n\t}\n\n\tgenerators := make(map[string]gopter.Gen)\n\tAddRelatedPropertyGeneratorsForServerlessUpstreamSettings(generators)\n\tserverlessUpstreamSettingsGenerator = gen.Struct(reflect.TypeOf(ServerlessUpstreamSettings{}), generators)\n\n\treturn serverlessUpstreamSettingsGenerator\n}", "title": "" }, { "docid": "b8b5311bdc93e3333b30b47a08aae241", "score": "0.5761111", "text": "func AddRelatedPropertyGeneratorsForUpstreamAuthSettings(gens map[string]gopter.Gen) {\n\tgens[\"ManagedIdentity\"] = gen.PtrOf(ManagedIdentitySettingsGenerator())\n}", "title": "" }, { "docid": "e8d6f5d02295fa59169be39df3f59715", "score": "0.5696316", "text": "func ServersAuditingSettingGenerator() gopter.Gen {\n\tif serversAuditingSettingGenerator != nil {\n\t\treturn serversAuditingSettingGenerator\n\t}\n\n\tgenerators := make(map[string]gopter.Gen)\n\tAddRelatedPropertyGeneratorsForServersAuditingSetting(generators)\n\tserversAuditingSettingGenerator = gen.Struct(reflect.TypeOf(ServersAuditingSetting{}), generators)\n\n\treturn serversAuditingSettingGenerator\n}", "title": "" }, { "docid": "918f708822a1d979b43f8882a841ea09", "score": "0.56380075", "text": "func VirtualMachineScaleSetIdentityGenerator() gopter.Gen {\n\tif virtualMachineScaleSetIdentityGenerator != nil {\n\t\treturn virtualMachineScaleSetIdentityGenerator\n\t}\n\n\tgenerators := make(map[string]gopter.Gen)\n\tAddIndependentPropertyGeneratorsForVirtualMachineScaleSetIdentity(generators)\n\tvirtualMachineScaleSetIdentityGenerator = gen.Struct(reflect.TypeOf(VirtualMachineScaleSetIdentity{}), generators)\n\n\treturn virtualMachineScaleSetIdentityGenerator\n}", "title": "" }, { "docid": "0e181a05825a039f55cda91f88bd7e3e", "score": "0.561696", "text": "func UpstreamAuthSettingsGenerator() gopter.Gen {\n\tif upstreamAuthSettingsGenerator != nil {\n\t\treturn upstreamAuthSettingsGenerator\n\t}\n\n\tgenerators := make(map[string]gopter.Gen)\n\tAddIndependentPropertyGeneratorsForUpstreamAuthSettings(generators)\n\tupstreamAuthSettingsGenerator = gen.Struct(reflect.TypeOf(UpstreamAuthSettings{}), generators)\n\n\t// The above call to gen.Struct() captures the map, so create a new one\n\tgenerators = make(map[string]gopter.Gen)\n\tAddIndependentPropertyGeneratorsForUpstreamAuthSettings(generators)\n\tAddRelatedPropertyGeneratorsForUpstreamAuthSettings(generators)\n\tupstreamAuthSettingsGenerator = gen.Struct(reflect.TypeOf(UpstreamAuthSettings{}), generators)\n\n\treturn upstreamAuthSettingsGenerator\n}", "title": "" }, { "docid": "0613fdb93c8ece3e11908a327ac6ec27", "score": "0.5565586", "text": "func PatchSettingsGenerator() gopter.Gen {\n\tif patchSettingsGenerator != nil {\n\t\treturn patchSettingsGenerator\n\t}\n\n\tgenerators := make(map[string]gopter.Gen)\n\tAddIndependentPropertyGeneratorsForPatchSettings(generators)\n\tpatchSettingsGenerator = gen.Struct(reflect.TypeOf(PatchSettings{}), generators)\n\n\treturn patchSettingsGenerator\n}", "title": "" }, { "docid": "f34ba603a6da740adb66920ea57f40f7", "score": "0.55376506", "text": "func VirtualMachineScaleSetPublicIPAddressConfigurationDnsSettingsGenerator() gopter.Gen {\n\tif virtualMachineScaleSetPublicIPAddressConfigurationDnsSettingsGenerator != nil {\n\t\treturn virtualMachineScaleSetPublicIPAddressConfigurationDnsSettingsGenerator\n\t}\n\n\tgenerators := make(map[string]gopter.Gen)\n\tAddIndependentPropertyGeneratorsForVirtualMachineScaleSetPublicIPAddressConfigurationDnsSettings(generators)\n\tvirtualMachineScaleSetPublicIPAddressConfigurationDnsSettingsGenerator = gen.Struct(reflect.TypeOf(VirtualMachineScaleSetPublicIPAddressConfigurationDnsSettings{}), generators)\n\n\treturn virtualMachineScaleSetPublicIPAddressConfigurationDnsSettingsGenerator\n}", "title": "" }, { "docid": "c12ffb332efde9cb39fd3809c3925c89", "score": "0.55342644", "text": "func AddIndependentPropertyGeneratorsForManagedIdentity(gens map[string]gopter.Gen) {\n\tgens[\"UserAssignedIdentity\"] = gen.PtrOf(gen.AlphaString())\n}", "title": "" }, { "docid": "c54dceddfadb688ddd6497a1944039c6", "score": "0.55201036", "text": "func ServiceManagedResourcesSettings_STATUSGenerator() gopter.Gen {\n\tif serviceManagedResourcesSettings_STATUSGenerator != nil {\n\t\treturn serviceManagedResourcesSettings_STATUSGenerator\n\t}\n\n\tgenerators := make(map[string]gopter.Gen)\n\tAddRelatedPropertyGeneratorsForServiceManagedResourcesSettings_STATUS(generators)\n\tserviceManagedResourcesSettings_STATUSGenerator = gen.Struct(reflect.TypeOf(ServiceManagedResourcesSettings_STATUS{}), generators)\n\n\treturn serviceManagedResourcesSettings_STATUSGenerator\n}", "title": "" }, { "docid": "ad88ba68255ca34385d40b43c14dada6", "score": "0.5512706", "text": "func VirtualMachineScaleSetNetworkConfigurationDnsSettingsGenerator() gopter.Gen {\n\tif virtualMachineScaleSetNetworkConfigurationDnsSettingsGenerator != nil {\n\t\treturn virtualMachineScaleSetNetworkConfigurationDnsSettingsGenerator\n\t}\n\n\tgenerators := make(map[string]gopter.Gen)\n\tAddIndependentPropertyGeneratorsForVirtualMachineScaleSetNetworkConfigurationDnsSettings(generators)\n\tvirtualMachineScaleSetNetworkConfigurationDnsSettingsGenerator = gen.Struct(reflect.TypeOf(VirtualMachineScaleSetNetworkConfigurationDnsSettings{}), generators)\n\n\treturn virtualMachineScaleSetNetworkConfigurationDnsSettingsGenerator\n}", "title": "" }, { "docid": "9fafc42204de7b8ccb3530c4f66c3e29", "score": "0.5497798", "text": "func AddIndependentPropertyGeneratorsForVirtualMachineScaleSetManagedDiskParameters(gens map[string]gopter.Gen) {\n\tgens[\"StorageAccountType\"] = gen.PtrOf(gen.AlphaString())\n}", "title": "" }, { "docid": "7b86385a02a1cb46d5b563f4f2d2bd12", "score": "0.54629177", "text": "func AddIndependentPropertyGeneratorsForManagedIdentity(gens map[string]gopter.Gen) {\n\tgens[\"Type\"] = gen.PtrOf(gen.AlphaString())\n}", "title": "" }, { "docid": "a60a691743c461a3cd789bfa1e4cf847", "score": "0.5436322", "text": "func AddIndependentPropertyGeneratorsForManagedIdentitySettings_STATUS(gens map[string]gopter.Gen) {\n\tgens[\"Resource\"] = gen.PtrOf(gen.AlphaString())\n}", "title": "" }, { "docid": "3fbdcf3c6991a92fc9d9260c95467088", "score": "0.5428718", "text": "func AddIndependentPropertyGeneratorsForManagedServiceIdentity(gens map[string]gopter.Gen) {\n\tgens[\"Type\"] = gen.PtrOf(gen.OneConstOf(\n\t\tManagedServiceIdentity_Type_None,\n\t\tManagedServiceIdentity_Type_SystemAssigned,\n\t\tManagedServiceIdentity_Type_SystemAssignedUserAssigned,\n\t\tManagedServiceIdentity_Type_UserAssigned))\n}", "title": "" }, { "docid": "a9202b43a91a36f046d331697f3dacf9", "score": "0.5408161", "text": "func IdentityGenerator() gopter.Gen {\n\tif identityGenerator != nil {\n\t\treturn identityGenerator\n\t}\n\n\tgenerators := make(map[string]gopter.Gen)\n\tAddIndependentPropertyGeneratorsForIdentity(generators)\n\tidentityGenerator = gen.Struct(reflect.TypeOf(Identity{}), generators)\n\n\t// The above call to gen.Struct() captures the map, so create a new one\n\tgenerators = make(map[string]gopter.Gen)\n\tAddIndependentPropertyGeneratorsForIdentity(generators)\n\tAddRelatedPropertyGeneratorsForIdentity(generators)\n\tidentityGenerator = gen.Struct(reflect.TypeOf(Identity{}), generators)\n\n\treturn identityGenerator\n}", "title": "" }, { "docid": "ea685c32d1655019920e4d3f323cb86e", "score": "0.54034406", "text": "func SignalRCorsSettingsGenerator() gopter.Gen {\n\tif signalRCorsSettingsGenerator != nil {\n\t\treturn signalRCorsSettingsGenerator\n\t}\n\n\tgenerators := make(map[string]gopter.Gen)\n\tAddIndependentPropertyGeneratorsForSignalRCorsSettings(generators)\n\tsignalRCorsSettingsGenerator = gen.Struct(reflect.TypeOf(SignalRCorsSettings{}), generators)\n\n\treturn signalRCorsSettingsGenerator\n}", "title": "" }, { "docid": "ed92d82b2fda9a3afeabd63bae805b75", "score": "0.5379541", "text": "func AddIndependentPropertyGeneratorsForVirtualMachineScaleSetNetworkConfigurationDnsSettings(gens map[string]gopter.Gen) {\n\tgens[\"DnsServers\"] = gen.SliceOf(gen.AlphaString())\n}", "title": "" }, { "docid": "e61ebec8a2ba7b3063df9338aed11086", "score": "0.5370618", "text": "func ManagedIdentity_STATUSGenerator() gopter.Gen {\n\tif managedIdentity_STATUSGenerator != nil {\n\t\treturn managedIdentity_STATUSGenerator\n\t}\n\n\tgenerators := make(map[string]gopter.Gen)\n\tAddIndependentPropertyGeneratorsForManagedIdentity_STATUS(generators)\n\tmanagedIdentity_STATUSGenerator = gen.Struct(reflect.TypeOf(ManagedIdentity_STATUS{}), generators)\n\n\t// The above call to gen.Struct() captures the map, so create a new one\n\tgenerators = make(map[string]gopter.Gen)\n\tAddIndependentPropertyGeneratorsForManagedIdentity_STATUS(generators)\n\tAddRelatedPropertyGeneratorsForManagedIdentity_STATUS(generators)\n\tmanagedIdentity_STATUSGenerator = gen.Struct(reflect.TypeOf(ManagedIdentity_STATUS{}), generators)\n\n\treturn managedIdentity_STATUSGenerator\n}", "title": "" }, { "docid": "3799ea380d39cf180d531e587fc022c1", "score": "0.53612626", "text": "func Servers_AuditingSetting_SpecGenerator() gopter.Gen {\n\tif servers_AuditingSetting_SpecGenerator != nil {\n\t\treturn servers_AuditingSetting_SpecGenerator\n\t}\n\n\tgenerators := make(map[string]gopter.Gen)\n\tAddIndependentPropertyGeneratorsForServers_AuditingSetting_Spec(generators)\n\tservers_AuditingSetting_SpecGenerator = gen.Struct(reflect.TypeOf(Servers_AuditingSetting_Spec{}), generators)\n\n\treturn servers_AuditingSetting_SpecGenerator\n}", "title": "" }, { "docid": "5ec96e93fa6f77d548f5105bf461d1f6", "score": "0.532016", "text": "func AddRelatedPropertyGeneratorsForManagedIdentity(gens map[string]gopter.Gen) {\n\tgens[\"UserAssignedIdentities\"] = gen.SliceOf(UserAssignedIdentityDetailsGenerator())\n}", "title": "" }, { "docid": "69d03c3f98bf5cdee4f98f419961dde4", "score": "0.5309583", "text": "func AddIndependentPropertyGeneratorsForManagedServiceIdentity(gens map[string]gopter.Gen) {\n\tgens[\"Type\"] = gen.PtrOf(gen.AlphaString())\n}", "title": "" }, { "docid": "8a4be3cba143a06683e730ac9baf3a3f", "score": "0.52834827", "text": "func VirtualMachineScaleSetManagedDiskParametersGenerator() gopter.Gen {\n\tif virtualMachineScaleSetManagedDiskParametersGenerator != nil {\n\t\treturn virtualMachineScaleSetManagedDiskParametersGenerator\n\t}\n\n\tgenerators := make(map[string]gopter.Gen)\n\tAddIndependentPropertyGeneratorsForVirtualMachineScaleSetManagedDiskParameters(generators)\n\tvirtualMachineScaleSetManagedDiskParametersGenerator = gen.Struct(reflect.TypeOf(VirtualMachineScaleSetManagedDiskParameters{}), generators)\n\n\t// The above call to gen.Struct() captures the map, so create a new one\n\tgenerators = make(map[string]gopter.Gen)\n\tAddIndependentPropertyGeneratorsForVirtualMachineScaleSetManagedDiskParameters(generators)\n\tAddRelatedPropertyGeneratorsForVirtualMachineScaleSetManagedDiskParameters(generators)\n\tvirtualMachineScaleSetManagedDiskParametersGenerator = gen.Struct(reflect.TypeOf(VirtualMachineScaleSetManagedDiskParameters{}), generators)\n\n\treturn virtualMachineScaleSetManagedDiskParametersGenerator\n}", "title": "" }, { "docid": "8c65488889efcb18710689e12c6ebb0b", "score": "0.52632356", "text": "func IdentityForCmkGenerator() gopter.Gen {\n\tif identityForCmkGenerator != nil {\n\t\treturn identityForCmkGenerator\n\t}\n\n\tgenerators := make(map[string]gopter.Gen)\n\tAddIndependentPropertyGeneratorsForIdentityForCmk(generators)\n\tidentityForCmkGenerator = gen.Struct(reflect.TypeOf(IdentityForCmk{}), generators)\n\n\treturn identityForCmkGenerator\n}", "title": "" }, { "docid": "fd650a5436bcffe6a237f87585730507", "score": "0.5260751", "text": "func SignalRTlsSettingsGenerator() gopter.Gen {\n\tif signalRTlsSettingsGenerator != nil {\n\t\treturn signalRTlsSettingsGenerator\n\t}\n\n\tgenerators := make(map[string]gopter.Gen)\n\tAddIndependentPropertyGeneratorsForSignalRTlsSettings(generators)\n\tsignalRTlsSettingsGenerator = gen.Struct(reflect.TypeOf(SignalRTlsSettings{}), generators)\n\n\treturn signalRTlsSettingsGenerator\n}", "title": "" }, { "docid": "06dc8568a7ec158fa5bc1896fcb87131", "score": "0.52551156", "text": "func ManagedClusterIdentity_ARMGenerator() gopter.Gen {\n\tif managedClusterIdentity_ARMGenerator != nil {\n\t\treturn managedClusterIdentity_ARMGenerator\n\t}\n\n\tgenerators := make(map[string]gopter.Gen)\n\tAddIndependentPropertyGeneratorsForManagedClusterIdentity_ARM(generators)\n\tmanagedClusterIdentity_ARMGenerator = gen.Struct(reflect.TypeOf(ManagedClusterIdentity_ARM{}), generators)\n\n\t// The above call to gen.Struct() captures the map, so create a new one\n\tgenerators = make(map[string]gopter.Gen)\n\tAddIndependentPropertyGeneratorsForManagedClusterIdentity_ARM(generators)\n\tAddRelatedPropertyGeneratorsForManagedClusterIdentity_ARM(generators)\n\tmanagedClusterIdentity_ARMGenerator = gen.Struct(reflect.TypeOf(ManagedClusterIdentity_ARM{}), generators)\n\n\treturn managedClusterIdentity_ARMGenerator\n}", "title": "" }, { "docid": "18dd55e19c764de1f9e065aec4199a87", "score": "0.52444625", "text": "func DiffDiskSettingsGenerator() gopter.Gen {\n\tif diffDiskSettingsGenerator != nil {\n\t\treturn diffDiskSettingsGenerator\n\t}\n\n\tgenerators := make(map[string]gopter.Gen)\n\tAddIndependentPropertyGeneratorsForDiffDiskSettings(generators)\n\tdiffDiskSettingsGenerator = gen.Struct(reflect.TypeOf(DiffDiskSettings{}), generators)\n\n\treturn diffDiskSettingsGenerator\n}", "title": "" }, { "docid": "8a324ce0a7ae45d4e3cddea5853bfa10", "score": "0.52344096", "text": "func AddIndependentPropertyGeneratorsForManagedClusterWindowsProfile_ARM(gens map[string]gopter.Gen) {\n\tgens[\"AdminPassword\"] = gen.PtrOf(gen.AlphaString())\n\tgens[\"AdminUsername\"] = gen.PtrOf(gen.AlphaString())\n\tgens[\"EnableCSIProxy\"] = gen.PtrOf(gen.Bool())\n\tgens[\"LicenseType\"] = gen.PtrOf(gen.OneConstOf(ManagedClusterWindowsProfile_LicenseType_None, ManagedClusterWindowsProfile_LicenseType_Windows_Server))\n}", "title": "" }, { "docid": "b14626c26c3f840d7bca4539752ae929", "score": "0.5228183", "text": "func AddRelatedPropertyGeneratorsForManagedServiceIdentity(gens map[string]gopter.Gen) {\n\tgens[\"UserAssignedIdentities\"] = gen.SliceOf(UserAssignedIdentityDetailsGenerator())\n}", "title": "" }, { "docid": "b14626c26c3f840d7bca4539752ae929", "score": "0.5228183", "text": "func AddRelatedPropertyGeneratorsForManagedServiceIdentity(gens map[string]gopter.Gen) {\n\tgens[\"UserAssignedIdentities\"] = gen.SliceOf(UserAssignedIdentityDetailsGenerator())\n}", "title": "" }, { "docid": "309175fbab419bddf871119ad6ef53b4", "score": "0.51786953", "text": "func ManagedIdentity_STATUSGenerator() gopter.Gen {\n\tif managedIdentity_STATUSGenerator != nil {\n\t\treturn managedIdentity_STATUSGenerator\n\t}\n\n\tgenerators := make(map[string]gopter.Gen)\n\tAddIndependentPropertyGeneratorsForManagedIdentity_STATUS(generators)\n\tmanagedIdentity_STATUSGenerator = gen.Struct(reflect.TypeOf(ManagedIdentity_STATUS{}), generators)\n\n\treturn managedIdentity_STATUSGenerator\n}", "title": "" }, { "docid": "20938098a85950efbea1d14315f0e3b3", "score": "0.5175557", "text": "func AddRelatedPropertyGeneratorsForVirtualMachineScaleSetManagedDiskParameters(gens map[string]gopter.Gen) {\n\tgens[\"DiskEncryptionSet\"] = gen.PtrOf(DiskEncryptionSetParametersGenerator())\n}", "title": "" }, { "docid": "4c432035ad7f478474b0beb784868c49", "score": "0.5174018", "text": "func AddRelatedPropertyGeneratorsForServiceManagedResourcesSettings_STATUS(gens map[string]gopter.Gen) {\n\tgens[\"CosmosDb\"] = gen.PtrOf(CosmosDbSettings_STATUSGenerator())\n}", "title": "" }, { "docid": "bbafd90a836590f623cb4ece4af5c6e1", "score": "0.5142436", "text": "func AddIndependentPropertyGeneratorsForVirtualMachineScaleSetsSpec(gens map[string]gopter.Gen) {\n\tgens[\"AzureName\"] = gen.AlphaString()\n\tgens[\"DoNotRunExtensionsOnOverprovisionedVMs\"] = gen.PtrOf(gen.Bool())\n\tgens[\"Location\"] = gen.PtrOf(gen.AlphaString())\n\tgens[\"OrchestrationMode\"] = gen.PtrOf(gen.AlphaString())\n\tgens[\"OriginalVersion\"] = gen.AlphaString()\n\tgens[\"Overprovision\"] = gen.PtrOf(gen.Bool())\n\tgens[\"PlatformFaultDomainCount\"] = gen.PtrOf(gen.Int())\n\tgens[\"SinglePlacementGroup\"] = gen.PtrOf(gen.Bool())\n\tgens[\"Tags\"] = gen.MapOf(gen.AlphaString(), gen.AlphaString())\n\tgens[\"ZoneBalance\"] = gen.PtrOf(gen.Bool())\n\tgens[\"Zones\"] = gen.SliceOf(gen.AlphaString())\n}", "title": "" }, { "docid": "2d20e6d09713e7971fcf729b857c388b", "score": "0.5142034", "text": "func AddIndependentPropertyGeneratorsForUefiSettings(gens map[string]gopter.Gen) {\n\tgens[\"SecureBootEnabled\"] = gen.PtrOf(gen.Bool())\n\tgens[\"VTpmEnabled\"] = gen.PtrOf(gen.Bool())\n}", "title": "" }, { "docid": "a3c701324f2f929c798ad8964d8ab54c", "score": "0.5119058", "text": "func AddIndependentPropertyGeneratorsForManagedClusterAADProfile_ARM(gens map[string]gopter.Gen) {\n\tgens[\"AdminGroupObjectIDs\"] = gen.SliceOf(gen.AlphaString())\n\tgens[\"ClientAppID\"] = gen.PtrOf(gen.AlphaString())\n\tgens[\"EnableAzureRBAC\"] = gen.PtrOf(gen.Bool())\n\tgens[\"Managed\"] = gen.PtrOf(gen.Bool())\n\tgens[\"ServerAppID\"] = gen.PtrOf(gen.AlphaString())\n\tgens[\"ServerAppSecret\"] = gen.PtrOf(gen.AlphaString())\n\tgens[\"TenantID\"] = gen.PtrOf(gen.AlphaString())\n}", "title": "" }, { "docid": "523e807cad5f644df702c3351021db95", "score": "0.5118924", "text": "func AddIndependentPropertyGeneratorsForVirtualMachineScaleSetOSDisk(gens map[string]gopter.Gen) {\n\tgens[\"Caching\"] = gen.PtrOf(gen.AlphaString())\n\tgens[\"CreateOption\"] = gen.PtrOf(gen.AlphaString())\n\tgens[\"DiskSizeGB\"] = gen.PtrOf(gen.Int())\n\tgens[\"Name\"] = gen.PtrOf(gen.AlphaString())\n\tgens[\"OsType\"] = gen.PtrOf(gen.AlphaString())\n\tgens[\"VhdContainers\"] = gen.SliceOf(gen.AlphaString())\n\tgens[\"WriteAcceleratorEnabled\"] = gen.PtrOf(gen.Bool())\n}", "title": "" }, { "docid": "16fb74092009ccf40914cc76998a8aed", "score": "0.51150537", "text": "func UefiSettingsGenerator() gopter.Gen {\n\tif uefiSettingsGenerator != nil {\n\t\treturn uefiSettingsGenerator\n\t}\n\n\tgenerators := make(map[string]gopter.Gen)\n\tAddIndependentPropertyGeneratorsForUefiSettings(generators)\n\tuefiSettingsGenerator = gen.Struct(reflect.TypeOf(UefiSettings{}), generators)\n\n\treturn uefiSettingsGenerator\n}", "title": "" }, { "docid": "47e11dbb6b6f7a7c2e262035e3a08b3f", "score": "0.5110519", "text": "func AddIndependentPropertyGeneratorsForVirtualMachineScaleSetOSProfile(gens map[string]gopter.Gen) {\n\tgens[\"AdminPassword\"] = gen.PtrOf(gen.AlphaString())\n\tgens[\"AdminUsername\"] = gen.PtrOf(gen.AlphaString())\n\tgens[\"ComputerNamePrefix\"] = gen.PtrOf(gen.AlphaString())\n\tgens[\"CustomData\"] = gen.PtrOf(gen.AlphaString())\n}", "title": "" }, { "docid": "d890982feb2139d73b278968b02b692b", "score": "0.5109316", "text": "func VirtualMachineScaleSetsSpecPropertiesVirtualMachineProfileNetworkProfileNetworkInterfaceConfigurationsPropertiesIpConfigurationsGenerator() gopter.Gen {\n\tif virtualMachineScaleSetsSpecPropertiesVirtualMachineProfileNetworkProfileNetworkInterfaceConfigurationsPropertiesIpConfigurationsGenerator != nil {\n\t\treturn virtualMachineScaleSetsSpecPropertiesVirtualMachineProfileNetworkProfileNetworkInterfaceConfigurationsPropertiesIpConfigurationsGenerator\n\t}\n\n\tgenerators := make(map[string]gopter.Gen)\n\tAddIndependentPropertyGeneratorsForVirtualMachineScaleSetsSpecPropertiesVirtualMachineProfileNetworkProfileNetworkInterfaceConfigurationsPropertiesIpConfigurations(generators)\n\tvirtualMachineScaleSetsSpecPropertiesVirtualMachineProfileNetworkProfileNetworkInterfaceConfigurationsPropertiesIpConfigurationsGenerator = gen.Struct(reflect.TypeOf(VirtualMachineScaleSets_Spec_Properties_VirtualMachineProfile_NetworkProfile_NetworkInterfaceConfigurations_Properties_IpConfigurations{}), generators)\n\n\t// The above call to gen.Struct() captures the map, so create a new one\n\tgenerators = make(map[string]gopter.Gen)\n\tAddIndependentPropertyGeneratorsForVirtualMachineScaleSetsSpecPropertiesVirtualMachineProfileNetworkProfileNetworkInterfaceConfigurationsPropertiesIpConfigurations(generators)\n\tAddRelatedPropertyGeneratorsForVirtualMachineScaleSetsSpecPropertiesVirtualMachineProfileNetworkProfileNetworkInterfaceConfigurationsPropertiesIpConfigurations(generators)\n\tvirtualMachineScaleSetsSpecPropertiesVirtualMachineProfileNetworkProfileNetworkInterfaceConfigurationsPropertiesIpConfigurationsGenerator = gen.Struct(reflect.TypeOf(VirtualMachineScaleSets_Spec_Properties_VirtualMachineProfile_NetworkProfile_NetworkInterfaceConfigurations_Properties_IpConfigurations{}), generators)\n\n\treturn virtualMachineScaleSetsSpecPropertiesVirtualMachineProfileNetworkProfileNetworkInterfaceConfigurationsPropertiesIpConfigurationsGenerator\n}", "title": "" }, { "docid": "c37103bbd0755732c2a0de6bc7c76cae", "score": "0.5098236", "text": "func ManagedClusterProperties_ARMGenerator() gopter.Gen {\n\tif managedClusterProperties_ARMGenerator != nil {\n\t\treturn managedClusterProperties_ARMGenerator\n\t}\n\n\tgenerators := make(map[string]gopter.Gen)\n\tAddIndependentPropertyGeneratorsForManagedClusterProperties_ARM(generators)\n\tmanagedClusterProperties_ARMGenerator = gen.Struct(reflect.TypeOf(ManagedClusterProperties_ARM{}), generators)\n\n\t// The above call to gen.Struct() captures the map, so create a new one\n\tgenerators = make(map[string]gopter.Gen)\n\tAddIndependentPropertyGeneratorsForManagedClusterProperties_ARM(generators)\n\tAddRelatedPropertyGeneratorsForManagedClusterProperties_ARM(generators)\n\tmanagedClusterProperties_ARMGenerator = gen.Struct(reflect.TypeOf(ManagedClusterProperties_ARM{}), generators)\n\n\treturn managedClusterProperties_ARMGenerator\n}", "title": "" }, { "docid": "db45d0fc3a16dc2da9c1f9b0001370d9", "score": "0.50846267", "text": "func AddIndependentPropertyGeneratorsForManagedClusterProperties_ARM(gens map[string]gopter.Gen) {\n\tgens[\"DisableLocalAccounts\"] = gen.PtrOf(gen.Bool())\n\tgens[\"DiskEncryptionSetID\"] = gen.PtrOf(gen.AlphaString())\n\tgens[\"DnsPrefix\"] = gen.PtrOf(gen.AlphaString())\n\tgens[\"EnablePodSecurityPolicy\"] = gen.PtrOf(gen.Bool())\n\tgens[\"EnableRBAC\"] = gen.PtrOf(gen.Bool())\n\tgens[\"FqdnSubdomain\"] = gen.PtrOf(gen.AlphaString())\n\tgens[\"KubernetesVersion\"] = gen.PtrOf(gen.AlphaString())\n\tgens[\"NodeResourceGroup\"] = gen.PtrOf(gen.AlphaString())\n}", "title": "" }, { "docid": "e88e6af986809ad23e770282debc17d1", "score": "0.5077904", "text": "func AddIndependentPropertyGeneratorsForElasticPoolPerDatabaseSettings_ARM(gens map[string]gopter.Gen) {\n\tgens[\"MaxCapacity\"] = gen.PtrOf(gen.Float64())\n\tgens[\"MinCapacity\"] = gen.PtrOf(gen.Float64())\n}", "title": "" }, { "docid": "bca6f1d314395f1248a72620abe49a39", "score": "0.50720024", "text": "func ManagedServiceIdentity_STATUSGenerator() gopter.Gen {\n\tif managedServiceIdentity_STATUSGenerator != nil {\n\t\treturn managedServiceIdentity_STATUSGenerator\n\t}\n\n\tgenerators := make(map[string]gopter.Gen)\n\tAddIndependentPropertyGeneratorsForManagedServiceIdentity_STATUS(generators)\n\tmanagedServiceIdentity_STATUSGenerator = gen.Struct(reflect.TypeOf(ManagedServiceIdentity_STATUS{}), generators)\n\n\t// The above call to gen.Struct() captures the map, so create a new one\n\tgenerators = make(map[string]gopter.Gen)\n\tAddIndependentPropertyGeneratorsForManagedServiceIdentity_STATUS(generators)\n\tAddRelatedPropertyGeneratorsForManagedServiceIdentity_STATUS(generators)\n\tmanagedServiceIdentity_STATUSGenerator = gen.Struct(reflect.TypeOf(ManagedServiceIdentity_STATUS{}), generators)\n\n\treturn managedServiceIdentity_STATUSGenerator\n}", "title": "" }, { "docid": "bca6f1d314395f1248a72620abe49a39", "score": "0.50720024", "text": "func ManagedServiceIdentity_STATUSGenerator() gopter.Gen {\n\tif managedServiceIdentity_STATUSGenerator != nil {\n\t\treturn managedServiceIdentity_STATUSGenerator\n\t}\n\n\tgenerators := make(map[string]gopter.Gen)\n\tAddIndependentPropertyGeneratorsForManagedServiceIdentity_STATUS(generators)\n\tmanagedServiceIdentity_STATUSGenerator = gen.Struct(reflect.TypeOf(ManagedServiceIdentity_STATUS{}), generators)\n\n\t// The above call to gen.Struct() captures the map, so create a new one\n\tgenerators = make(map[string]gopter.Gen)\n\tAddIndependentPropertyGeneratorsForManagedServiceIdentity_STATUS(generators)\n\tAddRelatedPropertyGeneratorsForManagedServiceIdentity_STATUS(generators)\n\tmanagedServiceIdentity_STATUSGenerator = gen.Struct(reflect.TypeOf(ManagedServiceIdentity_STATUS{}), generators)\n\n\treturn managedServiceIdentity_STATUSGenerator\n}", "title": "" }, { "docid": "a9c94f463f3bbb7057cc222a0657ca0b", "score": "0.50695425", "text": "func AddIndependentPropertyGeneratorsForSignalRTlsSettings(gens map[string]gopter.Gen) {\n\tgens[\"ClientCertEnabled\"] = gen.PtrOf(gen.Bool())\n}", "title": "" }, { "docid": "9bad9177af2e20977d1e27428392fb17", "score": "0.5061483", "text": "func VirtualMachineScaleSetStorageProfileGenerator() gopter.Gen {\n\tif virtualMachineScaleSetStorageProfileGenerator != nil {\n\t\treturn virtualMachineScaleSetStorageProfileGenerator\n\t}\n\n\tgenerators := make(map[string]gopter.Gen)\n\tAddRelatedPropertyGeneratorsForVirtualMachineScaleSetStorageProfile(generators)\n\tvirtualMachineScaleSetStorageProfileGenerator = gen.Struct(reflect.TypeOf(VirtualMachineScaleSetStorageProfile{}), generators)\n\n\treturn virtualMachineScaleSetStorageProfileGenerator\n}", "title": "" }, { "docid": "dafd4f49659a9e3eee317db9523a269f", "score": "0.5054488", "text": "func AddIndependentPropertyGeneratorsForVirtualMachineScaleSetsSpecPropertiesVirtualMachineProfile(gens map[string]gopter.Gen) {\n\tgens[\"EvictionPolicy\"] = gen.PtrOf(gen.AlphaString())\n\tgens[\"LicenseType\"] = gen.PtrOf(gen.AlphaString())\n\tgens[\"Priority\"] = gen.PtrOf(gen.AlphaString())\n}", "title": "" }, { "docid": "d8fe51f104ff7a4fdb3b2be7832c0ebf", "score": "0.50533044", "text": "func AddIndependentPropertyGeneratorsForVirtualMachineScaleSetIdentity(gens map[string]gopter.Gen) {\n\tgens[\"Type\"] = gen.PtrOf(gen.AlphaString())\n}", "title": "" }, { "docid": "9418db55c34e843011c238492c432417", "score": "0.50423884", "text": "func AddIndependentPropertyGeneratorsForVirtualMachineScaleSetPublicIPAddressConfigurationDnsSettings(gens map[string]gopter.Gen) {\n\tgens[\"DomainNameLabel\"] = gen.PtrOf(gen.AlphaString())\n}", "title": "" }, { "docid": "344bfec72fb5ed4fdd32b59e11b31472", "score": "0.5032156", "text": "func AddIndependentPropertyGeneratorsForStorageEndpointProperties(gens map[string]gopter.Gen) {\n\tgens[\"AuthenticationType\"] = gen.PtrOf(gen.OneConstOf(StorageEndpointProperties_AuthenticationType_IdentityBased, StorageEndpointProperties_AuthenticationType_KeyBased))\n\tgens[\"ContainerName\"] = gen.PtrOf(gen.AlphaString())\n\tgens[\"SasTtlAsIso8601\"] = gen.PtrOf(gen.AlphaString())\n}", "title": "" }, { "docid": "042c80b1858ccd0f87b6f98f99693741", "score": "0.50214684", "text": "func AddIndependentPropertyGeneratorsForVirtualMachineScaleSetsSpecPropertiesVirtualMachineProfileNetworkProfileNetworkInterfaceConfigurations(gens map[string]gopter.Gen) {\n\tgens[\"EnableAcceleratedNetworking\"] = gen.PtrOf(gen.Bool())\n\tgens[\"EnableFpga\"] = gen.PtrOf(gen.Bool())\n\tgens[\"EnableIPForwarding\"] = gen.PtrOf(gen.Bool())\n\tgens[\"Id\"] = gen.PtrOf(gen.AlphaString())\n\tgens[\"Name\"] = gen.PtrOf(gen.AlphaString())\n\tgens[\"Primary\"] = gen.PtrOf(gen.Bool())\n}", "title": "" }, { "docid": "fc1c24f1dbb0402c69e3ffd011a7667a", "score": "0.5015161", "text": "func AddIndependentPropertyGeneratorsForSignalRCorsSettings(gens map[string]gopter.Gen) {\n\tgens[\"AllowedOrigins\"] = gen.SliceOf(gen.AlphaString())\n}", "title": "" }, { "docid": "77bf3a3228fa4e0edbc9fcaa28f373f0", "score": "0.501103", "text": "func CosmosDbSettings_STATUSGenerator() gopter.Gen {\n\tif cosmosDbSettings_STATUSGenerator != nil {\n\t\treturn cosmosDbSettings_STATUSGenerator\n\t}\n\n\tgenerators := make(map[string]gopter.Gen)\n\tAddIndependentPropertyGeneratorsForCosmosDbSettings_STATUS(generators)\n\tcosmosDbSettings_STATUSGenerator = gen.Struct(reflect.TypeOf(CosmosDbSettings_STATUS{}), generators)\n\n\treturn cosmosDbSettings_STATUSGenerator\n}", "title": "" }, { "docid": "6106533776ff6e8df73f165b5ebc2017", "score": "0.50095844", "text": "func AddIndependentPropertyGeneratorsForManagedClusterAPIServerAccessProfile_ARM(gens map[string]gopter.Gen) {\n\tgens[\"AuthorizedIPRanges\"] = gen.SliceOf(gen.AlphaString())\n\tgens[\"EnablePrivateCluster\"] = gen.PtrOf(gen.Bool())\n\tgens[\"EnablePrivateClusterPublicFQDN\"] = gen.PtrOf(gen.Bool())\n\tgens[\"PrivateDNSZone\"] = gen.PtrOf(gen.AlphaString())\n}", "title": "" }, { "docid": "a5583868aae660f01bd3516ff3d6844a", "score": "0.50072867", "text": "func ManagedClusterHTTPProxyConfig_ARMGenerator() gopter.Gen {\n\tif managedClusterHTTPProxyConfig_ARMGenerator != nil {\n\t\treturn managedClusterHTTPProxyConfig_ARMGenerator\n\t}\n\n\tgenerators := make(map[string]gopter.Gen)\n\tAddIndependentPropertyGeneratorsForManagedClusterHTTPProxyConfig_ARM(generators)\n\tmanagedClusterHTTPProxyConfig_ARMGenerator = gen.Struct(reflect.TypeOf(ManagedClusterHTTPProxyConfig_ARM{}), generators)\n\n\treturn managedClusterHTTPProxyConfig_ARMGenerator\n}", "title": "" }, { "docid": "f99baefd009724949ce20b66aa2e2cfb", "score": "0.50065106", "text": "func AddIndependentPropertyGeneratorsForCosmosDbSettings(gens map[string]gopter.Gen) {\n\tgens[\"CollectionsThroughput\"] = gen.PtrOf(gen.Int())\n}", "title": "" }, { "docid": "209f7cadfc384ea6701b6083d61564a9", "score": "0.5003194", "text": "func AddIndependentPropertyGeneratorsForVirtualMachineScaleSetsSpecPropertiesVirtualMachineProfileNetworkProfileNetworkInterfaceConfigurationsPropertiesIpConfigurations(gens map[string]gopter.Gen) {\n\tgens[\"Id\"] = gen.PtrOf(gen.AlphaString())\n\tgens[\"Name\"] = gen.PtrOf(gen.AlphaString())\n\tgens[\"Primary\"] = gen.PtrOf(gen.Bool())\n\tgens[\"PrivateIPAddressVersion\"] = gen.PtrOf(gen.AlphaString())\n}", "title": "" }, { "docid": "e19ae9317ca5f2321c7a6bf3bf984900", "score": "0.5001578", "text": "func VirtualMachineScaleSetsSpecPropertiesVirtualMachineProfileGenerator() gopter.Gen {\n\tif virtualMachineScaleSetsSpecPropertiesVirtualMachineProfileGenerator != nil {\n\t\treturn virtualMachineScaleSetsSpecPropertiesVirtualMachineProfileGenerator\n\t}\n\n\tgenerators := make(map[string]gopter.Gen)\n\tAddIndependentPropertyGeneratorsForVirtualMachineScaleSetsSpecPropertiesVirtualMachineProfile(generators)\n\tvirtualMachineScaleSetsSpecPropertiesVirtualMachineProfileGenerator = gen.Struct(reflect.TypeOf(VirtualMachineScaleSets_Spec_Properties_VirtualMachineProfile{}), generators)\n\n\t// The above call to gen.Struct() captures the map, so create a new one\n\tgenerators = make(map[string]gopter.Gen)\n\tAddIndependentPropertyGeneratorsForVirtualMachineScaleSetsSpecPropertiesVirtualMachineProfile(generators)\n\tAddRelatedPropertyGeneratorsForVirtualMachineScaleSetsSpecPropertiesVirtualMachineProfile(generators)\n\tvirtualMachineScaleSetsSpecPropertiesVirtualMachineProfileGenerator = gen.Struct(reflect.TypeOf(VirtualMachineScaleSets_Spec_Properties_VirtualMachineProfile{}), generators)\n\n\treturn virtualMachineScaleSetsSpecPropertiesVirtualMachineProfileGenerator\n}", "title": "" }, { "docid": "564b8028a992f2fe066f6f972d6e72ba", "score": "0.49947172", "text": "func AddRelatedPropertyGeneratorsForSecurityProfile(gens map[string]gopter.Gen) {\n\tgens[\"UefiSettings\"] = gen.PtrOf(UefiSettingsGenerator())\n}", "title": "" }, { "docid": "12859552583fc564ef1cc06565a0311d", "score": "0.49908996", "text": "func AddIndependentPropertyGeneratorsForManagedClusterServicePrincipalProfile_ARM(gens map[string]gopter.Gen) {\n\tgens[\"ClientId\"] = gen.PtrOf(gen.AlphaString())\n\tgens[\"Secret\"] = gen.PtrOf(gen.AlphaString())\n}", "title": "" }, { "docid": "e6d361e382dff0ac190081a04f59ec37", "score": "0.49889648", "text": "func UserAssignedIdentityOperatorConfigMapsGenerator() gopter.Gen {\n\tif userAssignedIdentityOperatorConfigMapsGenerator != nil {\n\t\treturn userAssignedIdentityOperatorConfigMapsGenerator\n\t}\n\n\tgenerators := make(map[string]gopter.Gen)\n\tuserAssignedIdentityOperatorConfigMapsGenerator = gen.Struct(reflect.TypeOf(UserAssignedIdentityOperatorConfigMaps{}), generators)\n\n\treturn userAssignedIdentityOperatorConfigMapsGenerator\n}", "title": "" }, { "docid": "176bca6b7c2fa0b37664b2eb408c2696", "score": "0.49804366", "text": "func AddRelatedPropertyGeneratorsForStorageEndpointProperties(gens map[string]gopter.Gen) {\n\tgens[\"Identity\"] = gen.PtrOf(ManagedIdentityGenerator())\n}", "title": "" }, { "docid": "dd210584daa717a0d72d33f6f14c2a18", "score": "0.4977388", "text": "func AddIndependentPropertyGeneratorsForPeriodicModeProperties(gens map[string]gopter.Gen) {\n\tgens[\"BackupIntervalInMinutes\"] = gen.PtrOf(gen.Int())\n\tgens[\"BackupRetentionIntervalInHours\"] = gen.PtrOf(gen.Int())\n}", "title": "" }, { "docid": "dd210584daa717a0d72d33f6f14c2a18", "score": "0.4977388", "text": "func AddIndependentPropertyGeneratorsForPeriodicModeProperties(gens map[string]gopter.Gen) {\n\tgens[\"BackupIntervalInMinutes\"] = gen.PtrOf(gen.Int())\n\tgens[\"BackupRetentionIntervalInHours\"] = gen.PtrOf(gen.Int())\n}", "title": "" }, { "docid": "d062592a2008da400d6ffe392ec5cdd4", "score": "0.49769664", "text": "func AddIndependentPropertyGeneratorsForVirtualMachineScaleSetManagedDiskParametersStatus(gens map[string]gopter.Gen) {\n\tgens[\"StorageAccountType\"] = gen.PtrOf(gen.AlphaString())\n}", "title": "" }, { "docid": "e79df3d8265b2a7a4c2df5fdc3d7e272", "score": "0.49721226", "text": "func AddIndependentPropertyGeneratorsForVirtualMachineScaleSetNetworkConfigurationDnsSettingsStatus(gens map[string]gopter.Gen) {\n\tgens[\"DnsServers\"] = gen.SliceOf(gen.AlphaString())\n}", "title": "" }, { "docid": "19630033165396f15838bc4318fd22b7", "score": "0.49676478", "text": "func ManagedClusterPodIdentityProfile_ARMGenerator() gopter.Gen {\n\tif managedClusterPodIdentityProfile_ARMGenerator != nil {\n\t\treturn managedClusterPodIdentityProfile_ARMGenerator\n\t}\n\n\tgenerators := make(map[string]gopter.Gen)\n\tAddIndependentPropertyGeneratorsForManagedClusterPodIdentityProfile_ARM(generators)\n\tmanagedClusterPodIdentityProfile_ARMGenerator = gen.Struct(reflect.TypeOf(ManagedClusterPodIdentityProfile_ARM{}), generators)\n\n\t// The above call to gen.Struct() captures the map, so create a new one\n\tgenerators = make(map[string]gopter.Gen)\n\tAddIndependentPropertyGeneratorsForManagedClusterPodIdentityProfile_ARM(generators)\n\tAddRelatedPropertyGeneratorsForManagedClusterPodIdentityProfile_ARM(generators)\n\tmanagedClusterPodIdentityProfile_ARMGenerator = gen.Struct(reflect.TypeOf(ManagedClusterPodIdentityProfile_ARM{}), generators)\n\n\treturn managedClusterPodIdentityProfile_ARMGenerator\n}", "title": "" }, { "docid": "e3f1065b06563b9c66b3b5aa89696e3a", "score": "0.49651572", "text": "func IdentityProperties_ARMGenerator() gopter.Gen {\n\tif identityProperties_ARMGenerator != nil {\n\t\treturn identityProperties_ARMGenerator\n\t}\n\n\tgenerators := make(map[string]gopter.Gen)\n\tAddIndependentPropertyGeneratorsForIdentityProperties_ARM(generators)\n\tidentityProperties_ARMGenerator = gen.Struct(reflect.TypeOf(IdentityProperties_ARM{}), generators)\n\n\t// The above call to gen.Struct() captures the map, so create a new one\n\tgenerators = make(map[string]gopter.Gen)\n\tAddIndependentPropertyGeneratorsForIdentityProperties_ARM(generators)\n\tAddRelatedPropertyGeneratorsForIdentityProperties_ARM(generators)\n\tidentityProperties_ARMGenerator = gen.Struct(reflect.TypeOf(IdentityProperties_ARM{}), generators)\n\n\treturn identityProperties_ARMGenerator\n}", "title": "" }, { "docid": "5fe1d039c6098927c1d9c2ae928b90db", "score": "0.49559522", "text": "func VirtualMachineScaleSetGenerator() gopter.Gen {\n\tif virtualMachineScaleSetGenerator != nil {\n\t\treturn virtualMachineScaleSetGenerator\n\t}\n\n\tgenerators := make(map[string]gopter.Gen)\n\tAddRelatedPropertyGeneratorsForVirtualMachineScaleSet(generators)\n\tvirtualMachineScaleSetGenerator = gen.Struct(reflect.TypeOf(VirtualMachineScaleSet{}), generators)\n\n\treturn virtualMachineScaleSetGenerator\n}", "title": "" }, { "docid": "0fe5b40f0253b9dbcb46ee0b2de1df21", "score": "0.49482486", "text": "func AddRelatedPropertyGeneratorsForServerlessUpstreamSettings(gens map[string]gopter.Gen) {\n\tgens[\"Templates\"] = gen.SliceOf(UpstreamTemplateGenerator())\n}", "title": "" }, { "docid": "1072fa11fc95ddf9e0a39ef4c0ee4ef8", "score": "0.49427062", "text": "func AddRelatedPropertyGeneratorsForVirtualMachineScaleSetOSDisk(gens map[string]gopter.Gen) {\n\tgens[\"DiffDiskSettings\"] = gen.PtrOf(DiffDiskSettingsGenerator())\n\tgens[\"Image\"] = gen.PtrOf(VirtualHardDiskGenerator())\n\tgens[\"ManagedDisk\"] = gen.PtrOf(VirtualMachineScaleSetManagedDiskParametersGenerator())\n}", "title": "" }, { "docid": "2adf1731da9f90b5c74ab8616d2a2836", "score": "0.4935771", "text": "func DiskEncryptionSetParametersGenerator() gopter.Gen {\n\tif diskEncryptionSetParametersGenerator != nil {\n\t\treturn diskEncryptionSetParametersGenerator\n\t}\n\n\tgenerators := make(map[string]gopter.Gen)\n\tdiskEncryptionSetParametersGenerator = gen.Struct(reflect.TypeOf(DiskEncryptionSetParameters{}), generators)\n\n\treturn diskEncryptionSetParametersGenerator\n}", "title": "" }, { "docid": "685cde3afbfd9a93d468df9f42579cc0", "score": "0.49187005", "text": "func AddRelatedPropertyGeneratorsForVirtualMachineScaleSetOSProfile(gens map[string]gopter.Gen) {\n\tgens[\"LinuxConfiguration\"] = gen.PtrOf(LinuxConfigurationGenerator())\n\tgens[\"Secrets\"] = gen.SliceOf(VaultSecretGroupGenerator())\n\tgens[\"WindowsConfiguration\"] = gen.PtrOf(WindowsConfigurationGenerator())\n}", "title": "" }, { "docid": "78aa58a6e1d6937c209a62e3529a058c", "score": "0.4916112", "text": "func AddIndependentPropertyGeneratorsForManagedIdentity_STATUS(gens map[string]gopter.Gen) {\n\tgens[\"PrincipalId\"] = gen.PtrOf(gen.AlphaString())\n\tgens[\"TenantId\"] = gen.PtrOf(gen.AlphaString())\n\tgens[\"Type\"] = gen.PtrOf(gen.AlphaString())\n}", "title": "" }, { "docid": "96c47e0b267a979c10138c78e21bc4e9", "score": "0.4897226", "text": "func VirtualMachineScaleSetsSpecPropertiesVirtualMachineProfileNetworkProfileNetworkInterfaceConfigurationsGenerator() gopter.Gen {\n\tif virtualMachineScaleSetsSpecPropertiesVirtualMachineProfileNetworkProfileNetworkInterfaceConfigurationsGenerator != nil {\n\t\treturn virtualMachineScaleSetsSpecPropertiesVirtualMachineProfileNetworkProfileNetworkInterfaceConfigurationsGenerator\n\t}\n\n\tgenerators := make(map[string]gopter.Gen)\n\tAddIndependentPropertyGeneratorsForVirtualMachineScaleSetsSpecPropertiesVirtualMachineProfileNetworkProfileNetworkInterfaceConfigurations(generators)\n\tvirtualMachineScaleSetsSpecPropertiesVirtualMachineProfileNetworkProfileNetworkInterfaceConfigurationsGenerator = gen.Struct(reflect.TypeOf(VirtualMachineScaleSets_Spec_Properties_VirtualMachineProfile_NetworkProfile_NetworkInterfaceConfigurations{}), generators)\n\n\t// The above call to gen.Struct() captures the map, so create a new one\n\tgenerators = make(map[string]gopter.Gen)\n\tAddIndependentPropertyGeneratorsForVirtualMachineScaleSetsSpecPropertiesVirtualMachineProfileNetworkProfileNetworkInterfaceConfigurations(generators)\n\tAddRelatedPropertyGeneratorsForVirtualMachineScaleSetsSpecPropertiesVirtualMachineProfileNetworkProfileNetworkInterfaceConfigurations(generators)\n\tvirtualMachineScaleSetsSpecPropertiesVirtualMachineProfileNetworkProfileNetworkInterfaceConfigurationsGenerator = gen.Struct(reflect.TypeOf(VirtualMachineScaleSets_Spec_Properties_VirtualMachineProfile_NetworkProfile_NetworkInterfaceConfigurations{}), generators)\n\n\treturn virtualMachineScaleSetsSpecPropertiesVirtualMachineProfileNetworkProfileNetworkInterfaceConfigurationsGenerator\n}", "title": "" }, { "docid": "765757fbd8c854c828cfe1d6cacaaebb", "score": "0.48966217", "text": "func AddRelatedPropertyGeneratorsForVirtualMachineScaleSet(gens map[string]gopter.Gen) {\n\tgens[\"Spec\"] = VirtualMachineScaleSetsSpecGenerator()\n\tgens[\"Status\"] = VirtualMachineScaleSetStatusGenerator()\n}", "title": "" }, { "docid": "218110fbe531aa8bcb2fb81c22cd9960", "score": "0.4893345", "text": "func VirtualMachineScaleSetIdentityStatusGenerator() gopter.Gen {\n\tif virtualMachineScaleSetIdentityStatusGenerator != nil {\n\t\treturn virtualMachineScaleSetIdentityStatusGenerator\n\t}\n\n\tgenerators := make(map[string]gopter.Gen)\n\tAddIndependentPropertyGeneratorsForVirtualMachineScaleSetIdentityStatus(generators)\n\tvirtualMachineScaleSetIdentityStatusGenerator = gen.Struct(reflect.TypeOf(VirtualMachineScaleSetIdentity_Status{}), generators)\n\n\t// The above call to gen.Struct() captures the map, so create a new one\n\tgenerators = make(map[string]gopter.Gen)\n\tAddIndependentPropertyGeneratorsForVirtualMachineScaleSetIdentityStatus(generators)\n\tAddRelatedPropertyGeneratorsForVirtualMachineScaleSetIdentityStatus(generators)\n\tvirtualMachineScaleSetIdentityStatusGenerator = gen.Struct(reflect.TypeOf(VirtualMachineScaleSetIdentity_Status{}), generators)\n\n\treturn virtualMachineScaleSetIdentityStatusGenerator\n}", "title": "" }, { "docid": "4871f45d23c21a39cb56b1320ad84910", "score": "0.48905292", "text": "func AddIndependentPropertyGeneratorsForManagedClusterIdentity_ARM(gens map[string]gopter.Gen) {\n\tgens[\"Type\"] = gen.PtrOf(gen.OneConstOf(ManagedClusterIdentity_Type_None, ManagedClusterIdentity_Type_SystemAssigned, ManagedClusterIdentity_Type_UserAssigned))\n}", "title": "" }, { "docid": "b220314b34a88953d0ca90ed9485bba0", "score": "0.4889948", "text": "func AddRelatedPropertyGeneratorsForServersAuditingSetting(gens map[string]gopter.Gen) {\n\tgens[\"Spec\"] = Servers_AuditingSetting_SpecGenerator()\n\tgens[\"Status\"] = Servers_AuditingSetting_STATUSGenerator()\n}", "title": "" }, { "docid": "4db500e4f83fb821151ca62292ff4504", "score": "0.48790476", "text": "func AddIndependentPropertyGeneratorsForVirtualMachineScaleSetIdentityStatus(gens map[string]gopter.Gen) {\n\tgens[\"PrincipalId\"] = gen.PtrOf(gen.AlphaString())\n\tgens[\"TenantId\"] = gen.PtrOf(gen.AlphaString())\n\tgens[\"Type\"] = gen.PtrOf(gen.AlphaString())\n}", "title": "" }, { "docid": "adad39c1d574f958f11e91a6b429567d", "score": "0.48788565", "text": "func NewEntitlementManagementSettings()(*EntitlementManagementSettings) {\n m := &EntitlementManagementSettings{\n Entity: *NewEntity(),\n }\n return m\n}", "title": "" }, { "docid": "8590fd7259f5cf6b9bcdea9224f5b1d9", "score": "0.48780504", "text": "func AddIndependentPropertyGeneratorsForKeyVaultProperties(gens map[string]gopter.Gen) {\n\tgens[\"IdentityClientId\"] = gen.PtrOf(gen.AlphaString())\n\tgens[\"KeyIdentifier\"] = gen.PtrOf(gen.AlphaString())\n\tgens[\"KeyVaultArmId\"] = gen.PtrOf(gen.AlphaString())\n}", "title": "" }, { "docid": "6e6aecab66b585ba66bc1fd8aee2f327", "score": "0.4877383", "text": "func AddIndependentPropertyGeneratorsForManagedClusterAddonProfile_ARM(gens map[string]gopter.Gen) {\n\tgens[\"Config\"] = gen.MapOf(gen.AlphaString(), gen.AlphaString())\n\tgens[\"Enabled\"] = gen.PtrOf(gen.Bool())\n}", "title": "" }, { "docid": "b63ce80f8596f916c9a92b33b81c997c", "score": "0.48759553", "text": "func AddRelatedPropertyGeneratorsForEncryptionProperty(gens map[string]gopter.Gen) {\n\tgens[\"Identity\"] = gen.PtrOf(IdentityForCmkGenerator())\n\tgens[\"KeyVaultProperties\"] = gen.PtrOf(KeyVaultPropertiesGenerator())\n}", "title": "" }, { "docid": "4abeb1ccd4f881840f6c9d4108011864", "score": "0.48744646", "text": "func AddIndependentPropertyGeneratorsForEncryptionProperty(gens map[string]gopter.Gen) {\n\tgens[\"Status\"] = gen.PtrOf(gen.OneConstOf(EncryptionProperty_Status_Disabled, EncryptionProperty_Status_Enabled))\n}", "title": "" }, { "docid": "aad09c1e3d6da8a82448caaa3a440613", "score": "0.48728696", "text": "func AddIndependentPropertyGeneratorsForManagedClusterPodIdentityProfile_ARM(gens map[string]gopter.Gen) {\n\tgens[\"AllowNetworkPluginKubenet\"] = gen.PtrOf(gen.Bool())\n\tgens[\"Enabled\"] = gen.PtrOf(gen.Bool())\n}", "title": "" }, { "docid": "af54ce87430434c49c5774129d69515d", "score": "0.4870331", "text": "func AddIndependentPropertyGeneratorsForCloudToDeviceProperties(gens map[string]gopter.Gen) {\n\tgens[\"DefaultTtlAsIso8601\"] = gen.PtrOf(gen.AlphaString())\n\tgens[\"MaxDeliveryCount\"] = gen.PtrOf(gen.Int())\n}", "title": "" }, { "docid": "3775bd0fa7ac3f878118cf8c1b456f8c", "score": "0.48570302", "text": "func StorageEndpointPropertiesGenerator() gopter.Gen {\n\tif storageEndpointPropertiesGenerator != nil {\n\t\treturn storageEndpointPropertiesGenerator\n\t}\n\n\tgenerators := make(map[string]gopter.Gen)\n\tAddIndependentPropertyGeneratorsForStorageEndpointProperties(generators)\n\tstorageEndpointPropertiesGenerator = gen.Struct(reflect.TypeOf(StorageEndpointProperties{}), generators)\n\n\t// The above call to gen.Struct() captures the map, so create a new one\n\tgenerators = make(map[string]gopter.Gen)\n\tAddIndependentPropertyGeneratorsForStorageEndpointProperties(generators)\n\tAddRelatedPropertyGeneratorsForStorageEndpointProperties(generators)\n\tstorageEndpointPropertiesGenerator = gen.Struct(reflect.TypeOf(StorageEndpointProperties{}), generators)\n\n\treturn storageEndpointPropertiesGenerator\n}", "title": "" }, { "docid": "11843778cc1e558ea33ea25481ad2b3d", "score": "0.48527136", "text": "func AddIndependentPropertyGeneratorsForWindowsConfiguration(gens map[string]gopter.Gen) {\n\tgens[\"EnableAutomaticUpdates\"] = gen.PtrOf(gen.Bool())\n\tgens[\"ProvisionVMAgent\"] = gen.PtrOf(gen.Bool())\n\tgens[\"TimeZone\"] = gen.PtrOf(gen.AlphaString())\n}", "title": "" }, { "docid": "5b3d097b545ca17a7a7db22d6c2e3a11", "score": "0.48506695", "text": "func VirtualMachineScaleSetsSpecPropertiesVirtualMachineProfileExtensionProfileGenerator() gopter.Gen {\n\tif virtualMachineScaleSetsSpecPropertiesVirtualMachineProfileExtensionProfileGenerator != nil {\n\t\treturn virtualMachineScaleSetsSpecPropertiesVirtualMachineProfileExtensionProfileGenerator\n\t}\n\n\tgenerators := make(map[string]gopter.Gen)\n\tAddIndependentPropertyGeneratorsForVirtualMachineScaleSetsSpecPropertiesVirtualMachineProfileExtensionProfile(generators)\n\tvirtualMachineScaleSetsSpecPropertiesVirtualMachineProfileExtensionProfileGenerator = gen.Struct(reflect.TypeOf(VirtualMachineScaleSets_Spec_Properties_VirtualMachineProfile_ExtensionProfile{}), generators)\n\n\t// The above call to gen.Struct() captures the map, so create a new one\n\tgenerators = make(map[string]gopter.Gen)\n\tAddIndependentPropertyGeneratorsForVirtualMachineScaleSetsSpecPropertiesVirtualMachineProfileExtensionProfile(generators)\n\tAddRelatedPropertyGeneratorsForVirtualMachineScaleSetsSpecPropertiesVirtualMachineProfileExtensionProfile(generators)\n\tvirtualMachineScaleSetsSpecPropertiesVirtualMachineProfileExtensionProfileGenerator = gen.Struct(reflect.TypeOf(VirtualMachineScaleSets_Spec_Properties_VirtualMachineProfile_ExtensionProfile{}), generators)\n\n\treturn virtualMachineScaleSetsSpecPropertiesVirtualMachineProfileExtensionProfileGenerator\n}", "title": "" }, { "docid": "6eee0a35d3e51fe2583cd5541795db28", "score": "0.48493502", "text": "func ArmIdentityGenerator() gopter.Gen {\n\tif armIdentityGenerator != nil {\n\t\treturn armIdentityGenerator\n\t}\n\n\tgenerators := make(map[string]gopter.Gen)\n\tAddIndependentPropertyGeneratorsForArmIdentity(generators)\n\tarmIdentityGenerator = gen.Struct(reflect.TypeOf(ArmIdentity{}), generators)\n\n\t// The above call to gen.Struct() captures the map, so create a new one\n\tgenerators = make(map[string]gopter.Gen)\n\tAddIndependentPropertyGeneratorsForArmIdentity(generators)\n\tAddRelatedPropertyGeneratorsForArmIdentity(generators)\n\tarmIdentityGenerator = gen.Struct(reflect.TypeOf(ArmIdentity{}), generators)\n\n\treturn armIdentityGenerator\n}", "title": "" } ]
db778da4954800f766e7b73fc72ef0aa
NewHotelCaller creates a new readonly instance of Hotel, bound to a specific deployed contract.
[ { "docid": "80239214456e2050db101512134f9f56", "score": "0.7407805", "text": "func NewHotelCaller(address common.Address, caller bind.ContractCaller) (*HotelCaller, error) {\n\tcontract, err := bindHotel(address, caller, nil)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\treturn &HotelCaller{contract: contract}, nil\n}", "title": "" } ]
[ { "docid": "f52534c17f3c302445e6f5701321fb9f", "score": "0.6962342", "text": "func NewHotel() *Hotel { return &Hotel{} }", "title": "" }, { "docid": "087745fd412392b2ef0249745a517017", "score": "0.64673674", "text": "func NewHotel(address common.Address, backend bind.ContractBackend) (*Hotel, error) {\n\tcontract, err := bindHotel(address, backend, backend)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\treturn &Hotel{HotelCaller: HotelCaller{contract: contract}, HotelTransactor: HotelTransactor{contract: contract}}, nil\n}", "title": "" }, { "docid": "c69abb81f18d746aaf3a5b6aebad8eaa", "score": "0.62286335", "text": "func bindHotel(address common.Address, caller bind.ContractCaller, transactor bind.ContractTransactor) (*bind.BoundContract, error) {\n\tparsed, err := abi.JSON(strings.NewReader(HotelABI))\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\treturn bind.NewBoundContract(address, parsed, caller, transactor), nil\n}", "title": "" }, { "docid": "f7da92ebd9cec705f1ac47e4b457905b", "score": "0.5572868", "text": "func DeployHotel(auth *bind.TransactOpts, backend bind.ContractBackend, _name string, _description string, _manager common.Address) (common.Address, *types.Transaction, *Hotel, error) {\n\tparsed, err := abi.JSON(strings.NewReader(HotelABI))\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(HotelBin), backend, _name, _description, _manager)\n\tif err != nil {\n\t\treturn common.Address{}, nil, nil, err\n\t}\n\treturn address, tx, &Hotel{HotelCaller: HotelCaller{contract: contract}, HotelTransactor: HotelTransactor{contract: contract}}, nil\n}", "title": "" }, { "docid": "00d8a7a33da97fadf24860efae106c12", "score": "0.5282485", "text": "func newContract(client *rpc.Client) (common.Address, *checkpointoracle.CheckpointOracle) {\n\taddr := getContractAddr(client)\n\tif addr == (common.Address{}) {\n\t\tutils.Fatalf(\"No specified registrar contract address\")\n\t}\n\tcontract, err := checkpointoracle.NewCheckpointOracle(addr, ethclient.NewClient(client))\n\tif err != nil {\n\t\tutils.Fatalf(\"Failed to setup registrar contract %s: %v\", addr, err)\n\t}\n\treturn addr, contract\n}", "title": "" }, { "docid": "0381272921172b79f5b6dc3c7be65e0f", "score": "0.51621944", "text": "func (_Hotel *HotelCaller) Created(opts *bind.CallOpts) (*big.Int, error) {\n\tvar (\n\t\tret0 = new(*big.Int)\n\t)\n\tout := ret0\n\terr := _Hotel.contract.Call(opts, out, \"created\")\n\treturn *ret0, err\n}", "title": "" }, { "docid": "835a74c42d837447eee48abf819b425c", "score": "0.5156103", "text": "func (_Router *RouterCaller) Factory(opts *bind.CallOpts) (common.Address, error) {\n\tvar out []interface{}\n\terr := _Router.contract.Call(opts, &out, \"factory\")\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": "822b316b05f23618a9ef30eb8c8207f2", "score": "0.51547205", "text": "func NewVehicleBookingCaller(address common.Address, caller bind.ContractCaller) (*VehicleBookingCaller, error) {\n\tcontract, err := bindVehicleBooking(address, caller, nil, nil)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\treturn &VehicleBookingCaller{contract: contract}, nil\n}", "title": "" }, { "docid": "634a3e7e2a9625ff250d850464fd67c3", "score": "0.5091918", "text": "func NewBookingCaller(address common.Address, caller bind.ContractCaller) (*BookingCaller, error) {\n\tcontract, err := bindBooking(address, caller, nil, nil)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\treturn &BookingCaller{contract: contract}, nil\n}", "title": "" }, { "docid": "587af14b477915f43c8d56d5ac8e2fcb", "score": "0.50585276", "text": "func NewCaller() *Caller {\n\treturn &Caller{\n\t\tpool: GetSessionPoolInstance(),\n\t}\n}", "title": "" }, { "docid": "9189118327aa75ef64a99718cc9a958d", "score": "0.50438565", "text": "func NewCoolContractCaller(address common.Address, caller bind.ContractCaller) (*CoolContractCaller, error) {\n\tcontract, err := bindCoolContract(address, caller, nil, nil)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\treturn &CoolContractCaller{contract: contract}, nil\n}", "title": "" }, { "docid": "35a287fc367ebc49f77f4bafbcdd6ae8", "score": "0.49313453", "text": "func NewReserveContractCaller(address common.Address, caller bind.ContractCaller) (*ReserveContractCaller, error) {\n\tcontract, err := bindReserveContract(address, caller, nil)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\treturn &ReserveContractCaller{contract: contract}, nil\n}", "title": "" }, { "docid": "79144f49a9a0b341eb23b29957214b94", "score": "0.492714", "text": "func (_SwapRouter *SwapRouterCaller) Factory(opts *bind.CallOpts) (common.Address, error) {\n\tvar out []interface{}\n\terr := _SwapRouter.contract.Call(opts, &out, \"factory\")\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": "9b9366d0e4601fbd65485c154a1da638", "score": "0.49233675", "text": "func (_Hotel *HotelCallerSession) Created() (*big.Int, error) {\n\treturn _Hotel.Contract.Created(&_Hotel.CallOpts)\n}", "title": "" }, { "docid": "12033bfb37d34767d19365ef243d66bc", "score": "0.49118888", "text": "func (_ContractRegistry *ContractRegistryCaller) NewOwner(opts *bind.CallOpts) (common.Address, error) {\n\tvar out []interface{}\n\terr := _ContractRegistry.contract.Call(opts, &out, \"newOwner\")\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": "59055dc6e41b071d6622584ba250eac8", "score": "0.4881177", "text": "func New(id wendy.NodeID, localIP, globalIP, region string, port int) *Peter {\n\tnode := wendy.NewNode(id, localIP, globalIP, region, port)\n\tcluster := wendy.NewCluster(node, nil)\n\tpeter := &Peter{\n\t\tsubscriptions: newSubscriptionMap(),\n\t\tparents: newParentMap(),\n\t\tcluster: cluster,\n\t\tlog: log.New(os.Stdout, \"peter(\"+id.String()+\") \", log.LstdFlags),\n\t\tlogLevel: LogLevelWarn,\n\t}\n\tcluster.RegisterCallback(peter)\n\treturn peter\n}", "title": "" }, { "docid": "4266bf143a8ac34959c7109f35daa795", "score": "0.48787576", "text": "func (*rebFactory) New(args xreg.Args) xreg.GlobalEntry {\n\treturn &rebFactory{args: args.Custom.(*xreg.RebalanceArgs)}\n}", "title": "" }, { "docid": "3df5845013d9ddd02a57e2fa855312b8", "score": "0.48754004", "text": "func (_Pancake *PancakeCaller) Factory(opts *bind.CallOpts) (common.Address, error) {\n\tvar out []interface{}\n\terr := _Pancake.contract.Call(opts, &out, \"factory\")\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": "27b06309efa42954618fc74be43d07e3", "score": "0.48661628", "text": "func (_Hotel *HotelRaw) Call(opts *bind.CallOpts, result interface{}, method string, params ...interface{}) error {\n\treturn _Hotel.Contract.HotelCaller.contract.Call(opts, result, method, params...)\n}", "title": "" }, { "docid": "53e8d8af5a129af6dd74cc8e43e966c3", "score": "0.48218477", "text": "func (_Router *RouterCallerSession) Factory() (common.Address, error) {\n\treturn _Router.Contract.Factory(&_Router.CallOpts)\n}", "title": "" }, { "docid": "c2b75a8e8a5a40a86bf805ca3aee3721", "score": "0.4809403", "text": "func NewRegistryCaller(address common.Address, caller bind.ContractCaller) (*RegistryCaller, error) {\n\tcontract, err := bindRegistry(address, caller, nil, nil)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\treturn &RegistryCaller{contract: contract}, nil\n}", "title": "" }, { "docid": "4558745efcba6350fb2847c41b00bfd1", "score": "0.47535285", "text": "func NewRoomFactoryCaller(address common.Address, caller bind.ContractCaller) (*RoomFactoryCaller, error) {\n\tcontract, err := bindRoomFactory(address, caller, nil, nil)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\treturn &RoomFactoryCaller{contract: contract}, nil\n}", "title": "" }, { "docid": "495fbc12a59bd45b9587b3de22aac5d8", "score": "0.47389647", "text": "func NewWalletCaller(address common.Address, caller bind.ContractCaller) (*WalletCaller, error) {\n\tcontract, err := bindWallet(address, caller, nil)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\treturn &WalletCaller{contract: contract}, nil\n}", "title": "" }, { "docid": "27abeaa919e81880657d3a060f2393fd", "score": "0.47275826", "text": "func newGateway(t *testing.T, db cluster.Node, certInfo *cert.Info) *cluster.Gateway {\n\terr := os.Mkdir(filepath.Join(db.Dir(), \"global\"), 0755)\n\tif err != nil {\n\t\tt.Fatal(err)\n\t}\n\n\tfileSystem := fsys.NewLocalFileSystem(false)\n\n\tgateway := cluster.NewGateway(\n\t\tdb,\n\t\tnode.ConfigSchema,\n\t\tfileSystem,\n\t\tcluster.WithLogger(log.NewNopLogger()),\n\t)\n\tif err := gateway.Init(certInfo); err != nil {\n\t\tt.Fatal(err)\n\t}\n\treturn gateway\n}", "title": "" }, { "docid": "a699a647fa54e0981896a77ae58a57d7", "score": "0.47179648", "text": "func (*Factory) New(args xreg.Args, _ *cluster.Bck) xreg.Renewable {\n\treturn &Factory{RenewBase: xreg.RenewBase{Args: args}}\n}", "title": "" }, { "docid": "ce592c0e0c6bc0a5c4ba0d3dffb8c9b7", "score": "0.46946913", "text": "func NewHotelTransactor(address common.Address, transactor bind.ContractTransactor) (*HotelTransactor, error) {\n\tcontract, err := bindHotel(address, nil, transactor)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\treturn &HotelTransactor{contract: contract}, nil\n}", "title": "" }, { "docid": "8bde1a7bb92320628fcbea9510d9905a", "score": "0.46875295", "text": "func NewHtlcCaller(address common.Address, caller bind.ContractCaller) (*HtlcCaller, error) {\n\tcontract, err := bindHtlc(address, caller, nil, nil)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\treturn &HtlcCaller{contract: contract}, nil\n}", "title": "" }, { "docid": "d1ed30d28a5bacc460c8fbbd1667bf23", "score": "0.46867192", "text": "func New() *gateway {\n\te := echo.New()\n\te.Validator = &gatewayValidator{validator: validator.New()}\n\treturn &gateway{\n\t\te: e,\n\t}\n}", "title": "" }, { "docid": "c4946ce10fa8065f5bb53ccb9da1d2d3", "score": "0.46861315", "text": "func (_Owned *OwnedCaller) NewOwner(opts *bind.CallOpts) (common.Address, error) {\n\tvar (\n\t\tret0 = new(common.Address)\n\t)\n\tout := ret0\n\terr := _Owned.contract.Call(opts, out, \"newOwner\")\n\treturn *ret0, err\n}", "title": "" }, { "docid": "e986ea3923c7efc2c1f4ff9dd7ab860d", "score": "0.46792337", "text": "func New(config Config) ZapWriteSyncer {\n\treturn &gelf{Config: config}\n}", "title": "" }, { "docid": "f7d049ed6ab4a243f8aea6d970f17ddf", "score": "0.46759906", "text": "func (_Hotel *HotelCallerRaw) Call(opts *bind.CallOpts, result interface{}, method string, params ...interface{}) error {\n\treturn _Hotel.Contract.contract.Call(opts, result, method, params...)\n}", "title": "" }, { "docid": "063560e4ac321d3016914940c21c2de5", "score": "0.4669639", "text": "func NewCompany()(*Company) {\n m := &Company{\n }\n m.backingStore = ie8677ce2c7e1b4c22e9c3827ecd078d41185424dd9eeb92b7d971ed2d49a392e.BackingStoreFactoryInstance();\n m.SetAdditionalData(make(map[string]any))\n return m\n}", "title": "" }, { "docid": "e402246bb044c62f835a19f06441c9ab", "score": "0.466589", "text": "func createLocalCallee(nxr router.Router, realm string) (*client.Client, error) {\n\tlogger := log.New(os.Stdout, \"CALLEE> \", log.LstdFlags)\n\tcfg := client.Config{\n\t\tRealm: realm,\n\t\tLogger: logger,\n\t}\n\tcallee, err := client.ConnectLocal(nxr, cfg)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\t// Register procedure \"time\"\n\tconst timeProc = \"worldtime\"\n\tif err = callee.Register(timeProc, worldTime, nil); err != nil {\n\t\treturn nil, fmt.Errorf(\"Failed to register %q: %s\", timeProc, err)\n\t}\n\tlog.Printf(\"Registered procedure %q with router\", timeProc)\n\n\treturn callee, nil\n}", "title": "" }, { "docid": "4e3d8e8957244982f3158486a67a3dc5", "score": "0.4663285", "text": "func NewContractRegistryCaller(address common.Address, caller bind.ContractCaller) (*ContractRegistryCaller, error) {\n\tcontract, err := bindContractRegistry(address, caller, nil, nil)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\treturn &ContractRegistryCaller{contract: contract}, nil\n}", "title": "" }, { "docid": "7fcd0be78c1ff414d4143b6cb212ec79", "score": "0.46560076", "text": "func (_Htlc *HtlcTransactor) NewContract(opts *bind.TransactOpts, _receiver common.Address, _hashlock [32]byte, _timelock *big.Int) (*types.Transaction, error) {\n\treturn _Htlc.contract.Transact(opts, \"newContract\", _receiver, _hashlock, _timelock)\n}", "title": "" }, { "docid": "b67061d11dfe1160e24076e8285cf7a2", "score": "0.46508065", "text": "func NewOldContractCaller(address common.Address, caller bind.ContractCaller) (*OldContractCaller, error) {\n\tcontract, err := bindOldContract(address, caller, nil, nil)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\treturn &OldContractCaller{contract: contract}, nil\n}", "title": "" }, { "docid": "0f5a255b44d1fb6c1698bfa817b3760f", "score": "0.4647926", "text": "func NewRandomCaller(address common.Address, caller bind.ContractCaller) (*RandomCaller, error) {\n\tcontract, err := bindRandom(address, caller, nil, nil)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\treturn &RandomCaller{contract: contract}, nil\n}", "title": "" }, { "docid": "6168a4bc865fe3a28030d3f490959edf", "score": "0.46393183", "text": "func newGateway(st serviced.State, iamSys *sys.Sys) (*gateway, error) {\n\tg := &gateway{\n\t\tstate: st,\n\n\t\tiamSys: iamSys,\n\t}\n\n\treturn g, nil\n}", "title": "" }, { "docid": "fda0402d684ca8b87965ed2c3a45f27b", "score": "0.46319005", "text": "func NewAugurWalletCaller(address common.Address, caller bind.ContractCaller) (*AugurWalletCaller, error) {\n\tcontract, err := bindAugurWallet(address, caller, nil, nil)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\treturn &AugurWalletCaller{contract: contract}, nil\n}", "title": "" }, { "docid": "73e30e129c88100ae0f7671e3180b1ec", "score": "0.4629015", "text": "func (_ContractRegistry *ContractRegistryCallerSession) NewOwner() (common.Address, error) {\n\treturn _ContractRegistry.Contract.NewOwner(&_ContractRegistry.CallOpts)\n}", "title": "" }, { "docid": "a0a7a25452d18e47d69b20b7fa1ef587", "score": "0.46221626", "text": "func NewPethCaller(address common.Address, caller bind.ContractCaller) (*PethCaller, error) {\n\tcontract, err := bindPeth(address, caller, nil, nil)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\treturn &PethCaller{contract: contract}, nil\n}", "title": "" }, { "docid": "336bf069b7d0505cc69fa72fb5b63f53", "score": "0.4621442", "text": "func NewRouterCaller(address common.Address, caller bind.ContractCaller) (*RouterCaller, error) {\n\tcontract, err := bindRouter(address, caller, nil, nil)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\treturn &RouterCaller{contract: contract}, nil\n}", "title": "" }, { "docid": "6587171ebfc720766e1aafe65f944e73", "score": "0.46195418", "text": "func (_Uniswapv2pair *Uniswapv2pairCaller) Factory(opts *bind.CallOpts) (common.Address, error) {\n\tvar out []interface{}\n\terr := _Uniswapv2pair.contract.Call(opts, &out, \"factory\")\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": "14263d53ec838d79edb090d8b0c65525", "score": "0.46190625", "text": "func New(p feiniubus.ClientConfigProvider, cfgs ...*feiniubus.Config) *Visitor {\n\tc := p.ClientConfig(ServiceName, cfgs...)\n\treturn newClient(*c.Config, c.Handlers, c.Endpoint)\n}", "title": "" }, { "docid": "f7d6b852be5580f23a7b5cb10c07b551", "score": "0.461023", "text": "func New(ctx context.Context) (Interface, error) {\n\treturn &challenger{}, nil\n}", "title": "" }, { "docid": "b0b86a0c02998530de19bff5cfd5d9b1", "score": "0.46029964", "text": "func NewFactoryCaller(address common.Address, caller bind.ContractCaller) (*FactoryCaller, error) {\n\tcontract, err := bindFactory(address, caller, nil, nil)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\treturn &FactoryCaller{contract: contract}, nil\n}", "title": "" }, { "docid": "46c0e4728495bc9b71b66765a6b9028c", "score": "0.46016723", "text": "func (*llcFactory) New(args xreg.Args, bck *meta.Bck) xreg.Renewable {\n\tp := &llcFactory{RenewBase: xreg.RenewBase{Args: args, Bck: bck}}\n\tp.Bck = bck\n\treturn p\n}", "title": "" }, { "docid": "1b8b286b49e50e4b30ccf88c1562be66", "score": "0.45965698", "text": "func NewContractManager() ainterface.ContractManager {\n return &Manager {}\n}", "title": "" }, { "docid": "cdf0210546404f155117f8bec5722bea", "score": "0.4590364", "text": "func New(notifier *gobrake.Notifier) fiber.Handler {\n\treturn func(c *fiber.Ctx) error {\n\t\tif notifier == nil {\n\t\t\tlog.Println(\"airbrake notifier not defined\")\n\t\t\treturn c.Next()\n\t\t}\n\n\t\t// Starts the timer.\n\t\t_, metric := gobrake.NewRouteMetric(context.TODO(), c.Route().Method, c.Route().Path)\n\t\terr := c.Next()\n\n\t\t// capture the status code and resolved Route\n\t\tmetric.StatusCode = c.Response().StatusCode()\n\t\tmetric.Route = c.Route().Path\n\n\t\t// Send to Airbrake\n\t\t_ = notifier.Routes.Notify(context.TODO(), metric)\n\t\treturn err\n\t}\n}", "title": "" }, { "docid": "d09bb9bc71aeb96d69966e2786b2494e", "score": "0.4588492", "text": "func New(n *gobrake.Notifier) iris.Handler {\n\treturn func(ctx iris.Context) {\n\t\tif n == nil {\n\t\t\tlog.Println(\"airbrake notifier not defined\")\n\t\t\treturn\n\t\t}\n\t\t_, metric := gobrake.NewRouteMetric(context.TODO(), ctx.Method(), ctx.GetCurrentRoute().Path())\n\t\tctx.Next()\n\t\tmetric.StatusCode = ctx.GetStatusCode()\n\t\t_ = n.Routes.Notify(context.TODO(), metric)\n\t}\n}", "title": "" }, { "docid": "12f8999a9936c5e9f3a19d3bfab7d70f", "score": "0.45816734", "text": "func NewBridgeCaller(address common.Address, caller bind.ContractCaller) (*BridgeCaller, error) {\n\tcontract, err := bindBridge(address, caller, nil, nil)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\treturn &BridgeCaller{contract: contract}, nil\n}", "title": "" }, { "docid": "871e4c5c0044cd8ebc0057a283773628", "score": "0.45807233", "text": "func New(ctx context.Context, serviceName, envCode, serviceType string, turnOnAutoReload bool) (*Registry, error) {\n\tif serviceName == \"\" || envCode == \"\" {\n\t\treturn nil, errors.New(\"service name and env code are required\")\n\t}\n\taddr, err := registryAddress()\n\tif err != nil {\n\t\treturn nil, fmt.Errorf(\"could not init registry api path: %v\", err)\n\t}\n\tres, err := http.Get(addr.getRegistry(serviceName, envCode, serviceType))\n\tif err != nil {\n\t\treturn nil, fmt.Errorf(\"could not init registry from api gateway: %v\", err)\n\t}\n\tdefer res.Body.Close()\n\treg, err := registryResponse(res)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\treg.ServiceType = serviceType\n\tif turnOnAutoReload {\n\t\tgo reg.autoReload(ctx)\n\t}\n\treturn reg, nil\n}", "title": "" }, { "docid": "735d58e2328c8403137fa15372dd2853", "score": "0.45796394", "text": "func (_Pancake *PancakeCallerSession) Factory() (common.Address, error) {\n\treturn _Pancake.Contract.Factory(&_Pancake.CallOpts)\n}", "title": "" }, { "docid": "f1adec7c84629de702ee0e4253f9fe4b", "score": "0.45660353", "text": "func New(ctx context.Context, hubaddress string) (*Miner, error) {\n\taddr, err := util.GetPublicIP()\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\tpubaddress := addr.String()\n\n\tctx, cancel := context.WithCancel(ctx)\n\tgrpcServer := grpc.NewServer()\n\tovs, err := NewOverseer(ctx)\n\tif err != nil {\n\t\tcancel()\n\t\treturn nil, err\n\t}\n\tm := &Miner{\n\t\tctx: ctx,\n\t\tcancel: cancel,\n\t\tgrpcServer: grpcServer,\n\t\tovs: ovs,\n\n\t\thubaddress: hubaddress,\n\t\tpubaddress: pubaddress,\n\n\t\trl: NewReverseListener(1),\n\t\tcontainers: make(map[string]ContainterInfo),\n\t}\n\n\tpb.RegisterMinerServer(grpcServer, m)\n\treturn m, nil\n}", "title": "" }, { "docid": "586405402a381397107af52439255788", "score": "0.4564962", "text": "func (_SwapLpToken *SwapLpTokenCaller) Factory(opts *bind.CallOpts) (common.Address, error) {\n\tvar out []interface{}\n\terr := _SwapLpToken.contract.Call(opts, &out, \"factory\")\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": "436c0f086b1fd459169c137618c36d45", "score": "0.45620054", "text": "func newTravelService(svc *Service) contract.TravelService {\n\treturn &travelService{\n\t\tsvc: svc,\n\t}\n}", "title": "" }, { "docid": "7e6a1f9648ba30fee672a7f9d16bc249", "score": "0.45563498", "text": "func NewContractCaller(address common.Address, caller bind.ContractCaller) (*ContractCaller, error) {\n\tcontract, err := bindContract(address, caller, nil, nil)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\treturn &ContractCaller{contract: contract}, nil\n}", "title": "" }, { "docid": "4acd3e4e9c3accbc130bc27659e0abd6", "score": "0.45519376", "text": "func New(ctx context.Context, connInfo ConnInfo) (Gateway, error) {\n\tdb, err := sql.Open(\"postgres\", connInfo.String())\n\tif err != nil {\n\t\treturn nil, errors.Wrap(err, \"Failed to connect to database\")\n\t}\n\treturn &gateway{\n\t\tdb: db,\n\t}, err\n}", "title": "" }, { "docid": "39b7a1ce2ede271c5634e01f82d56aa3", "score": "0.45509225", "text": "func New(Propagate bool, Bridge Bridge) *Pool {\n\tif Bridge == nil {\n\t\tpanic(\"a bridge is required\")\n\t}\n\treturn &Pool{\n\t\tnewBus(Propagate, Bridge),\n\t}\n}", "title": "" }, { "docid": "3cb1584c03e63bb553b9e4465d1cbff3", "score": "0.4532014", "text": "func NewVM() VM {\n return VM{\n Wren: C.createVM(),\n }\n}", "title": "" }, { "docid": "ea7df7d9f1ec2415208227b00d1a14c9", "score": "0.45297635", "text": "func (_Controller *ControllerCaller) PoolFactory(opts *bind.CallOpts) (common.Address, error) {\n\tvar out []interface{}\n\terr := _Controller.contract.Call(opts, &out, \"poolFactory\")\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": "297730c99e644067cf3c2029096f11be", "score": "0.45184633", "text": "func (_AENToken *AENTokenCaller) NewOwner(opts *bind.CallOpts) (common.Address, error) {\n\tvar (\n\t\tret0 = new(common.Address)\n\t)\n\tout := ret0\n\terr := _AENToken.contract.Call(opts, out, \"newOwner\")\n\treturn *ret0, err\n}", "title": "" }, { "docid": "ff0ebc8fed6f5cd70a7be8c0fda747cc", "score": "0.45137215", "text": "func New(maddr ma.Multiaddr, authToken string) (*API, func(), error) {\n\taddr, err := util.TCPAddrFromMultiAddr(maddr)\n\tif err != nil {\n\t\treturn nil, nil, err\n\t}\n\theaders := http.Header{\n\t\t\"Authorization\": []string{\"Bearer \" + authToken},\n\t}\n\tvar api API\n\tcloser, err := jsonrpc.NewMergeClient(\"ws://\"+addr+\"/rpc/v0\", \"Filecoin\",\n\t\t[]interface{}{\n\t\t\t&api.Internal,\n\t\t}, headers)\n\tif err != nil {\n\t\treturn nil, nil, err\n\t}\n\n\tif err := view.Register(vHeight); err != nil {\n\t\tlog.Fatalf(\"Failed to register views: %v\", err)\n\t}\n\n\tctx, cancel := context.WithCancel(context.Background())\n\tgo monitorLotusSync(ctx, &api)\n\n\treturn &api, func() {\n\t\tcancel()\n\t\tcloser()\n\t}, nil\n\n}", "title": "" }, { "docid": "05032b137298b580c50096b7f0df3ad7", "score": "0.45121524", "text": "func New(fd int, mtu int, closed func(error)) tcpip.LinkEndpointID {\n\tsyscall.SetNonblock(fd, true)\n\n\treturn stack.RegisterLinkEndpoint(&endpoint{\n\t\tfd: fd,\n\t\tmtu: mtu,\n\t\tclosed: closed,\n\t})\n}", "title": "" }, { "docid": "c217ddb6b8cafde033c5b2d9eb5f72ce", "score": "0.45054093", "text": "func newAddress(request *bnd.NewAddressRequest) (*bnd.NewAddressResponse, error) {\n\tconn, err := getClientConnection()\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\tdefer conn.Close()\n\tclient := bnd.NewSwapLibClient(conn)\n\tctx, cancel := context.WithCancel(context.Background())\n\tdefer cancel()\n\tresponse, err := client.NewAddress(ctx, request)\n\tif err != nil {\n\t\treturn response, err\n\t}\n\treturn response, nil\n}", "title": "" }, { "docid": "a636805a548f4ceeff583fe2188b72f2", "score": "0.45007482", "text": "func (_SwapRouter *SwapRouterCallerSession) Factory() (common.Address, error) {\n\treturn _SwapRouter.Contract.Factory(&_SwapRouter.CallOpts)\n}", "title": "" }, { "docid": "b480ac24fce7248f2121502118b7a044", "score": "0.449961", "text": "func newChannelCloser(cfg chanCloseCfg, deliveryScript []byte,\n\tidealFeePerKw chainfee.SatPerKWeight, negotiationHeight uint32,\n\tcloseReq *htlcswitch.ChanClose, locallyInitiated bool) *channelCloser {\n\n\t// Given the target fee-per-kw, we'll compute what our ideal _total_\n\t// fee will be starting at for this fee negotiation.\n\t//\n\t// TODO(roasbeef): should factor in minimal commit\n\tidealFeeSat := cfg.channel.CalcFee(idealFeePerKw)\n\n\t// If this fee is greater than the fee currently present within the\n\t// commitment transaction, then we'll clamp it down to be within the\n\t// proper range.\n\t//\n\t// TODO(roasbeef): clamp fee func?\n\tchannelCommitFee := cfg.channel.StateSnapshot().CommitFee\n\tif idealFeeSat > channelCommitFee {\n\t\tpeerLog.Infof(\"Ideal starting fee of %v is greater than \"+\n\t\t\t\"commit fee of %v, clamping\", int64(idealFeeSat),\n\t\t\tint64(channelCommitFee))\n\n\t\tidealFeeSat = channelCommitFee\n\t}\n\n\tpeerLog.Infof(\"Ideal fee for closure of ChannelPoint(%v) is: %v sat\",\n\t\tcfg.channel.ChannelPoint(), int64(idealFeeSat))\n\n\tcid := lnwire.NewChanIDFromOutPoint(cfg.channel.ChannelPoint())\n\treturn &channelCloser{\n\t\tcloseReq: closeReq,\n\t\tstate: closeIdle,\n\t\tchanPoint: *cfg.channel.ChannelPoint(),\n\t\tcid: cid,\n\t\tcfg: cfg,\n\t\tnegotiationHeight: negotiationHeight,\n\t\tidealFeeSat: idealFeeSat,\n\t\tlocalDeliveryScript: deliveryScript,\n\t\tpriorFeeOffers: make(map[btcutil.Amount]*lnwire.ClosingSigned),\n\t\tlocallyInitiated: locallyInitiated,\n\t}\n}", "title": "" }, { "docid": "7b44d36392c62e31a842c2884567de34", "score": "0.4499179", "text": "func newClient(ctx *cli.Context) *ethclient.Client {\n\tclient, err := ethclient.Dial(ctx.GlobalString(nodeURLFlag.Name))\n\tif err != nil {\n\t\tutils.Fatalf(\"Failed to connect to Ethereum node: %v\", err)\n\t}\n\treturn client\n}", "title": "" }, { "docid": "16dd365d836d4ed244f78d2d9437aacc", "score": "0.44975418", "text": "func New(\n\taddNewBlockFunc func(context.Context, *types.Block) (err error),\n\tbstore blockstore.Blockstore,\n\tcborStore, onlineStore *hamt.CborIpldStore,\n\tchainReader chain.ReadStore,\n\tcon consensus.Protocol,\n\tblockTime, blockMineDelay time.Duration,\n\tmsgPool *core.MessagePool,\n\tnodePorc *porcelain.API,\n\tptv consensus.PowerTableView,\n\tstartMiningFunc func(context.Context) error,\n\tstopMiningfunc func(context.Context),\n\tsyncer chain.Syncer,\n\tsigner consensus.TicketSigner,\n) API {\n\tnewDeps := apiDeps{\n\t\taddNewBlockFunc: addNewBlockFunc,\n\t\tblockStore: bstore,\n\t\tcBorStore: cborStore,\n\t\tonlineStore: onlineStore,\n\t\tchainReader: chainReader,\n\t\tconsensusProtocol: con,\n\t\tblockTime: blockTime,\n\t\tmineDelay: blockMineDelay,\n\t\tmsgPool: msgPool,\n\t\tnodePorcelain: nodePorc,\n\t\tpowerTable: ptv,\n\t\tstartMiningFunc: startMiningFunc,\n\t\tstopMiningFunc: stopMiningfunc,\n\t\tsyncer: syncer,\n\t\tticketSigner: signer,\n\t}\n\n\treturn API{apiDeps: newDeps}\n}", "title": "" }, { "docid": "bb83062d05814ae953c4055f61c547d7", "score": "0.44966167", "text": "func New(addr string, options ...Option) *Gotenberg {\n\tg := &Gotenberg{addr: addr}\n\tg.applyOptions(options...)\n\treturn g\n}", "title": "" }, { "docid": "37d20b5328e1dda836870ce74c57c4d1", "score": "0.44945946", "text": "func (_Uniswapv2pair *Uniswapv2pairCallerSession) Factory() (common.Address, error) {\n\treturn _Uniswapv2pair.Contract.Factory(&_Uniswapv2pair.CallOpts)\n}", "title": "" }, { "docid": "4a664bfc89c30d57f7b72f0f954c9419", "score": "0.44936422", "text": "func NewClient(bridgeName string,\n\tmgmtAddr string,\n\tovsDatapathType ovsconfig.OVSDatapathType,\n\tenableProxy bool,\n\tenableAntreaPolicy bool,\n\tenableEgress bool,\n\tenableDenyTracking bool,\n\tproxyAll bool,\n\tconnectUplinkToBridge bool) Client {\n\tbridge := binding.NewOFBridge(bridgeName, mgmtAddr)\n\tpolicyCache := cache.NewIndexer(\n\t\tpolicyConjKeyFunc,\n\t\tcache.Indexers{priorityIndex: priorityIndexFunc},\n\t)\n\tc := &client{\n\t\tbridge: bridge,\n\t\tenableProxy: enableProxy,\n\t\tproxyAll: proxyAll,\n\t\tenableAntreaPolicy: enableAntreaPolicy,\n\t\tenableDenyTracking: enableDenyTracking,\n\t\tenableEgress: enableEgress,\n\t\tconnectUplinkToBridge: connectUplinkToBridge,\n\t\tnodeFlowCache: newFlowCategoryCache(),\n\t\tpodFlowCache: newFlowCategoryCache(),\n\t\tserviceFlowCache: newFlowCategoryCache(),\n\t\ttfFlowCache: newFlowCategoryCache(),\n\t\tpolicyCache: policyCache,\n\t\tgroupCache: sync.Map{},\n\t\tglobalConjMatchFlowCache: map[string]*conjMatchFlowContext{},\n\t\tpacketInHandlers: map[uint8]map[string]PacketInHandler{},\n\t\tovsctlClient: ovsctl.NewClient(bridgeName),\n\t\tovsDatapathType: ovsDatapathType,\n\t\tovsMetersAreSupported: ovsMetersAreSupported(ovsDatapathType),\n\t}\n\tc.ofEntryOperations = c\n\tif enableAntreaPolicy {\n\t\tc.egressEntryTable, c.ingressEntryTable = AntreaPolicyEgressRuleTable.GetID(), AntreaPolicyIngressRuleTable.GetID()\n\t} else {\n\t\tc.egressEntryTable, c.ingressEntryTable = EgressRuleTable.GetID(), IngressRuleTable.GetID()\n\t}\n\tif enableEgress {\n\t\tc.snatFlowCache = newFlowCategoryCache()\n\t}\n\tc.generatePipeline()\n\treturn c\n}", "title": "" }, { "docid": "f7fa52f95816ccf89f998f74e0fbadf4", "score": "0.4472403", "text": "func (_Uniswapdex *UniswapdexCaller) FactoryAddress(opts *bind.CallOpts) (common.Address, error) {\n\tvar (\n\t\tret0 = new(common.Address)\n\t)\n\tout := ret0\n\terr := _Uniswapdex.contract.Call(opts, out, \"factoryAddress\")\n\treturn *ret0, err\n}", "title": "" }, { "docid": "6313323b4c1206055a62ff83d3003a04", "score": "0.446629", "text": "func bindFactory(address common.Address, caller bind.ContractCaller, transactor bind.ContractTransactor, filterer bind.ContractFilterer) (*bind.BoundContract, error) {\n\tparsed, err := abi.JSON(strings.NewReader(FactoryABI))\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\treturn bind.NewBoundContract(address, parsed, caller, transactor, filterer), nil\n}", "title": "" }, { "docid": "b8bc9a92f1b46753d43011ef2f177fdd", "score": "0.4463338", "text": "func (_UniswapExchange *UniswapExchangeCaller) FactoryAddress(opts *bind.CallOpts) (common.Address, error) {\n\tvar (\n\t\tret0 = new(common.Address)\n\t)\n\tout := ret0\n\terr := _UniswapExchange.contract.Call(opts, out, \"factoryAddress\")\n\treturn *ret0, err\n}", "title": "" }, { "docid": "20bd30c32146aa56aaa109d1d8955612", "score": "0.4456294", "text": "func New(endpoint string) *Client {\n s := &Client{}\n s.config.endpoint = endpoint\n return s\n}", "title": "" }, { "docid": "0c343d8e1aba5b8ce49cb0a62b6737b2", "score": "0.44554612", "text": "func New(config ...Config) fiber.Handler {\n\t// Set default config\n\tcfg := ConfigDefault\n\t// Override config if provided\n\tif len(config) > 0 {\n\t\tcfg = config[0]\n\t}\n\n\tapp := cfg.NewRelicApp\n\n\treturn func(c *fiber.Ctx) error {\n\t\t// Don't execute middleware if Next returns true\n\t\tif cfg.Next != nil && cfg.Next(c) {\n\t\t\treturn c.Next()\n\t\t}\n\n\t\ttxn := app.StartTransaction(c.Path())\n\t\ttxn.SetWebRequestHTTP(toHTTPRequest(c.Context()))\n\n\t\tc.Locals(\"newrelic_transaction\", txn)\n\n\t\tdefer func() {\n\t\t\trw := txn.SetWebResponse(&ResponseWriter{\n\t\t\t\theader: transformResponseHeaders(&c.Context().Response),\n\t\t\t})\n\n\t\t\trw.WriteHeader(c.Context().Response.StatusCode())\n\n\t\t\ttxn.End()\n\t\t}()\n\n\t\treturn c.Next()\n\t}\n}", "title": "" }, { "docid": "5a76100a2a27cb42a6879f34ab738ef3", "score": "0.44507763", "text": "func New(name string, age int) person {\n\tdrinksConsumed := 0\n\tperson := person{name, age, drinksConsumed}\n\treturn person\n}", "title": "" }, { "docid": "3cc5e267f307d6b267e5d94d2276501b", "score": "0.4445228", "text": "func NewGate(ships []*Ferry, staffs []*Staff, destination GateDestination) *Gate {\n\treturn &Gate{\n\t\tName: \"Gerbang Masuk\",\n\t\tCode: \"A\",\n\t\tShips: ships,\n\t\tStaffs: staffs,\n\t\tDestination: destination,\n\t\tenterChannel: make(chan *Car),\n\t}\n}", "title": "" }, { "docid": "f508cc830fe28134f6340ff19ff6645f", "score": "0.4439856", "text": "func New(appExit chan struct{}, addr string) (closer io.Closer) {\n\tl, err := net.Listen(\"tcp\", addr)\n\tif err != nil {\n\t\tfmt.Println(\"Error listening: \", err)\n\t\tos.Exit(1)\n\t}\n\n\tfmt.Println(\"Listening on \", addr)\n\n\tserver := &serverImpl{\n\t\tdone: make(chan struct{}),\n\t\tl: l,\n\t\twriteCh: make(chan []byte, 128),\n\t}\n\tgo server.run()\n\tcloser = server\n\treturn\n}", "title": "" }, { "docid": "ab64d599328d0dba1a1f1cb986da3988", "score": "0.44360134", "text": "func newExternalAddr(t *testing.T, funder, signer *lntest.HarnessNode,\n\timportedAccount string, addrType walletrpc.AddressType) string {\n\n\t// We'll generate a new address for Carol from Dave's node to receive\n\t// and fund a new channel.\n\tctxb := context.Background()\n\tctxt, cancel := context.WithTimeout(ctxb, defaultTimeout)\n\tdefer cancel()\n\tfunderResp, err := funder.NewAddress(ctxt, &lnrpc.NewAddressRequest{\n\t\tType: walletToLNAddrType(t, addrType),\n\t\tAccount: importedAccount,\n\t})\n\trequire.NoError(t, err)\n\n\t// Carol also needs to generate the address for the sake of this test to\n\t// be able to sign the channel funding input.\n\tctxt, cancel = context.WithTimeout(ctxb, defaultTimeout)\n\tdefer cancel()\n\tsignerResp, err := signer.NewAddress(ctxt, &lnrpc.NewAddressRequest{\n\t\tType: walletToLNAddrType(t, addrType),\n\t})\n\trequire.NoError(t, err)\n\n\t// Sanity check that the generated addresses match.\n\trequire.Equal(t, funderResp.Address, signerResp.Address)\n\tassertExternalAddrType(t, funderResp.Address, addrType)\n\n\treturn funderResp.Address\n}", "title": "" }, { "docid": "078bb556937f41c83354fa40f6adf7d9", "score": "0.44353157", "text": "func NewCoolContract(address common.Address, backend bind.ContractBackend) (*CoolContract, error) {\n\tcontract, err := bindCoolContract(address, backend, backend, backend)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\treturn &CoolContract{CoolContractCaller: CoolContractCaller{contract: contract}, CoolContractTransactor: CoolContractTransactor{contract: contract}, CoolContractFilterer: CoolContractFilterer{contract: contract}}, nil\n}", "title": "" }, { "docid": "8570f1719ea390012e03bee85cad479e", "score": "0.44317657", "text": "func (_SwapLpToken *SwapLpTokenCallerSession) Factory() (common.Address, error) {\n\treturn _SwapLpToken.Contract.Factory(&_SwapLpToken.CallOpts)\n}", "title": "" }, { "docid": "d6001c6b1b70b9d35fc1c34947068ae7", "score": "0.44313216", "text": "func (_PMintyMultiSale *PMintyMultiSaleTransactor) OfferNew(opts *bind.TransactOpts, token common.Address, tokenId *big.Int, ipfsString string, quantity *big.Int, price *big.Int, poolId *big.Int) (*types.Transaction, error) {\n\treturn _PMintyMultiSale.contract.Transact(opts, \"offerNew\", token, tokenId, ipfsString, quantity, price, poolId)\n}", "title": "" }, { "docid": "4e7566b4c8dfe0aa59defea996519481", "score": "0.44260216", "text": "func NewTopLevelCaller(address common.Address, caller bind.ContractCaller) (*TopLevelCaller, error) {\n\tcontract, err := bindTopLevel(address, caller, nil, nil)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\treturn &TopLevelCaller{contract: contract}, nil\n}", "title": "" }, { "docid": "7da68a7b1c4c82a34261dfecea08ff17", "score": "0.44248572", "text": "func NewMachineCaller(address common.Address, caller bind.ContractCaller) (*MachineCaller, error) {\n\tcontract, err := bindMachine(address, caller, nil, nil)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\treturn &MachineCaller{contract: contract}, nil\n}", "title": "" }, { "docid": "81bafdddd71a8fa099a59759d761e53d", "score": "0.44235003", "text": "func NewContract()(*Contract) {\n m := &Contract{\n DirectoryObject: *NewDirectoryObject(),\n }\n odataTypeValue := \"#microsoft.graph.contract\";\n m.SetOdataType(&odataTypeValue);\n return m\n}", "title": "" }, { "docid": "7fff5aa5b3184635712142b774a03876", "score": "0.44219404", "text": "func newHostSubnet(c *Client) *hostSubnet {\n\treturn &hostSubnet{\n\t\tr: c,\n\t}\n}", "title": "" }, { "docid": "666ece3a8043555a57413a149b5e103d", "score": "0.44217744", "text": "func (_Router *RouterSession) Factory() (common.Address, error) {\n\treturn _Router.Contract.Factory(&_Router.CallOpts)\n}", "title": "" }, { "docid": "c60a06683b5611ded1b7dfd4851062b3", "score": "0.44182074", "text": "func NewProtocolCaller(address common.Address, caller bind.ContractCaller) (*ProtocolCaller, error) {\n\tcontract, err := bindProtocol(address, caller, nil, nil)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\treturn &ProtocolCaller{contract: contract}, nil\n}", "title": "" }, { "docid": "c60a06683b5611ded1b7dfd4851062b3", "score": "0.44182074", "text": "func NewProtocolCaller(address common.Address, caller bind.ContractCaller) (*ProtocolCaller, error) {\n\tcontract, err := bindProtocol(address, caller, nil, nil)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\treturn &ProtocolCaller{contract: contract}, nil\n}", "title": "" }, { "docid": "d1c9aeca8f1a47c40678e34b123f59ca", "score": "0.44160402", "text": "func New(endpoint string, sender protocol.Sender, exts ...extension.Extension) Client {\n\treturn Client{\n\t\tendpoint: endpoint,\n\t\tsender: extension.Decorate(sender, exts...),\n\t}\n}", "title": "" }, { "docid": "b57281a19c0a94243cda32f0b9b1b5b4", "score": "0.4412955", "text": "func NewClient() (AccountServiceClient, func() error, error) {\n\n}", "title": "" }, { "docid": "78c34550e8a9cbab3b38fff1c8aa488b", "score": "0.44119713", "text": "func New(cfg *config.Config, sess *session.Session, buildkiteAPI bk.API) *AgentPool {\n\n\texecutor := statemachine.NewSFNExecutor(cfg, sess)\n\n\tparamStore := params.New(cfg)\n\n\treturn &AgentPool{\n\t\tAgents: []*AgentInstance{},\n\t\tbuildkiteAPI: buildkiteAPI,\n\t\tcfg: cfg,\n\t\tagentStore: store.NewAgents(cfg),\n\t\tparamStore: paramStore,\n\t\texecutor: executor,\n\t}\n}", "title": "" }, { "docid": "67b3c08e36c951b15e362c128bfe9b3e", "score": "0.4400066", "text": "func New(endpoint string) Client {\n\tclient := Client{Endpoint: endpoint}\n\treturn client\n}", "title": "" }, { "docid": "fbb811d50468a706c279fe82f293beb9", "score": "0.43914562", "text": "func NewCrowdsaleCaller(address common.Address, caller bind.ContractCaller) (*CrowdsaleCaller, error) {\n\tcontract, err := bindCrowdsale(address, caller, nil)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\treturn &CrowdsaleCaller{contract: contract}, nil\n}", "title": "" }, { "docid": "dede4be45df4777ba50a4dd395e22a13", "score": "0.4386535", "text": "func newGreTunEP(id string, localIP net.IP, key uint32) (*GreTunEP, error) {\n\tgre := &GreTunEP{}\n\tgre.Link = &netlink.Gretun{}\n\tgre.GlobalID = id\n\tgre.LocalIP = localIP\n\tgre.Key = key\n\treturn gre, nil\n}", "title": "" }, { "docid": "792b2330379a79c445bffe5b213ce44c", "score": "0.4382815", "text": "func NewCaller() transport.NewCaller {\n\treturn func(ctx *broker.Context) transport.Caller {\n\t\treturn &Caller{\n\t\t\tctx: ctx,\n\t\t}\n\t}\n}", "title": "" }, { "docid": "81e58ffe90b08001fc809f6bea990599", "score": "0.43814707", "text": "func New(config config.BotConfig, pe PricingEngine, ws wallet.WalletHandler) (b Bot, err error) {\n\tswitch config.Strategy {\n\tcase \"normal\":\n\t\tb, err = normal.New(config, pe, ws)\n\tdefault:\n\t\terr = errors.New(\"unrecognised bot strategy\")\n\t}\n\tif err != nil {\n\t\terr = errors.Wrap(err, fmt.Sprintf(\"failed to create new bot with strategy %s\", config.Strategy))\n\t\treturn\n\t}\n\n\treturn\n}", "title": "" }, { "docid": "693ac38ce84d86ddacddb861614da01a", "score": "0.43788528", "text": "func NewSingletonCaller(address common.Address, caller bind.ContractCaller) (*SingletonCaller, error) {\n\tcontract, err := bindSingleton(address, caller, nil, nil)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\treturn &SingletonCaller{contract: contract}, nil\n}", "title": "" } ]
7ea890c8f8d4689b594ff85dad6bf2ee
IpAddressEqualFold applies the EqualFold predicate on the "ipAddress" field.
[ { "docid": "c59e5ec551ca3403a65647e1b71c01da", "score": "0.8439836", "text": "func IpAddressEqualFold(v string) predicate.Machine {\n\treturn predicate.Machine(func(s *sql.Selector) {\n\t\ts.Where(sql.EqualFold(s.C(FieldIpAddress), v))\n\t})\n}", "title": "" } ]
[ { "docid": "c322fb6784a16c46d216f9898eb441ac", "score": "0.83508235", "text": "func IPAddressEqualFold(v string) predicate.IPAddress {\n\treturn predicate.IPAddress(func(s *sql.Selector) {\n\t\ts.Where(sql.EqualFold(s.C(FieldIPAddress), v))\n\t})\n}", "title": "" }, { "docid": "2d69bc058909850426c37b211fd5d6eb", "score": "0.7200645", "text": "func IPAddressContainsFold(v string) predicate.IPAddress {\n\treturn predicate.IPAddress(func(s *sql.Selector) {\n\t\ts.Where(sql.ContainsFold(s.C(FieldIPAddress), v))\n\t})\n}", "title": "" }, { "docid": "e0d2617f682e7fd36d2253f0110c2a0c", "score": "0.7164339", "text": "func IpAddressContainsFold(v string) predicate.Machine {\n\treturn predicate.Machine(func(s *sql.Selector) {\n\t\ts.Where(sql.ContainsFold(s.C(FieldIpAddress), v))\n\t})\n}", "title": "" }, { "docid": "cada7fc5a5b2dded49e0a1761844e9a4", "score": "0.6360635", "text": "func SubnetMaskEqualFold(v string) predicate.IPAddress {\n\treturn predicate.IPAddress(func(s *sql.Selector) {\n\t\ts.Where(sql.EqualFold(s.C(FieldSubnetMask), v))\n\t})\n}", "title": "" }, { "docid": "ab5705a93c222500d3c1733c632be4d2", "score": "0.608886", "text": "func HostnameEqualFold(v string) predicate.Referrer {\n\treturn predicate.Referrer(func(s *sql.Selector) {\n\t\ts.Where(sql.EqualFold(s.C(FieldHostname), v))\n\t})\n}", "title": "" }, { "docid": "f0c090027098b996c1107a43346ebf33", "score": "0.6035987", "text": "func CityEqualFold(v string) predicate.CustomerAddress {\n\treturn predicate.CustomerAddress(func(s *sql.Selector) {\n\t\ts.Where(sql.EqualFold(s.C(FieldCity), v))\n\t})\n}", "title": "" }, { "docid": "c28f1fc7be28dcef992feaef6d4bb50a", "score": "0.5985778", "text": "func StreetLineEqualFold(v string) predicate.Address {\n\treturn predicate.Address(func(s *sql.Selector) {\n\t\ts.Where(sql.EqualFold(s.C(FieldStreetLine), v))\n\t})\n}", "title": "" }, { "docid": "48a08ff572f93ee03a2482ecb5b1fb4e", "score": "0.59556586", "text": "func ProvinceEqualFold(v string) predicate.CustomerAddress {\n\treturn predicate.CustomerAddress(func(s *sql.Selector) {\n\t\ts.Where(sql.EqualFold(s.C(FieldProvince), v))\n\t})\n}", "title": "" }, { "docid": "a448297199cb2b6b8959113697ba235c", "score": "0.59375477", "text": "func IPAddressEQ(v string) predicate.IPAddress {\n\treturn predicate.IPAddress(func(s *sql.Selector) {\n\t\ts.Where(sql.EQ(s.C(FieldIPAddress), v))\n\t})\n}", "title": "" }, { "docid": "50405d0543333275d3bc7fedb0371468", "score": "0.5923606", "text": "func AreaEqualFold(v string) predicate.CustomerAddress {\n\treturn predicate.CustomerAddress(func(s *sql.Selector) {\n\t\ts.Where(sql.EqualFold(s.C(FieldArea), v))\n\t})\n}", "title": "" }, { "docid": "a5711a7b5ed26096bd11be08418124ae", "score": "0.58863807", "text": "func CityEqualFold(v string) predicate.OrderAddress {\n\treturn predicate.OrderAddress(func(s *sql.Selector) {\n\t\ts.Where(sql.EqualFold(s.C(FieldCity), v))\n\t})\n}", "title": "" }, { "docid": "fddb80bee93f26a7ffd75d114f813030", "score": "0.57903165", "text": "func ProvinceEqualFold(v string) predicate.OrderAddress {\n\treturn predicate.OrderAddress(func(s *sql.Selector) {\n\t\ts.Where(sql.EqualFold(s.C(FieldProvince), v))\n\t})\n}", "title": "" }, { "docid": "5f994d77a3476af25530388d375a38c3", "score": "0.56959283", "text": "func AreaEqualFold(v string) predicate.OrderAddress {\n\treturn predicate.OrderAddress(func(s *sql.Selector) {\n\t\ts.Where(sql.EqualFold(s.C(FieldArea), v))\n\t})\n}", "title": "" }, { "docid": "3962b210d3dfb9b2b4bc173ad695bab4", "score": "0.5692282", "text": "func OaidEqualFold(v string) predicate.UserExtend {\n\treturn predicate.UserExtend(func(s *sql.Selector) {\n\t\ts.Where(sql.EqualFold(s.C(FieldOaid), v))\n\t})\n}", "title": "" }, { "docid": "17e9e27aa72ba707951c8c008401082c", "score": "0.5676478", "text": "func NameEqualFold(v string) predicate.CustomerAddress {\n\treturn predicate.CustomerAddress(func(s *sql.Selector) {\n\t\ts.Where(sql.EqualFold(s.C(FieldName), v))\n\t})\n}", "title": "" }, { "docid": "a169b0c5a172c985bfb88544c2c22d85", "score": "0.5669419", "text": "func StreetNumberEqualFold(v string) predicate.Branch {\n\treturn predicate.Branch(func(s *sql.Selector) {\n\t\ts.Where(sql.EqualFold(s.C(FieldStreetNumber), v))\n\t})\n}", "title": "" }, { "docid": "a63fddff762c68b41f5e7fb9d1eb5327", "score": "0.5660942", "text": "func StreetNameEqualFold(v string) predicate.Branch {\n\treturn predicate.Branch(func(s *sql.Selector) {\n\t\ts.Where(sql.EqualFold(s.C(FieldStreetName), v))\n\t})\n}", "title": "" }, { "docid": "e2371f637fbe581065d7a1b081fe9b0e", "score": "0.5643655", "text": "func BssidEqualFold(v string) predicate.SurveyWiFiScan {\n\treturn predicate.SurveyWiFiScan(func(s *sql.Selector) {\n\t\ts.Where(sql.EqualFold(s.C(FieldBssid), v))\n\t},\n\t)\n}", "title": "" }, { "docid": "67d828ebb820f9321d56c283f3cf4038", "score": "0.56424904", "text": "func PhoneEqualFold(v string) predicate.CustomerAddress {\n\treturn predicate.CustomerAddress(func(s *sql.Selector) {\n\t\ts.Where(sql.EqualFold(s.C(FieldPhone), v))\n\t})\n}", "title": "" }, { "docid": "2a836782a7580eb9d2e4621f5204d528", "score": "0.56020707", "text": "func IPAddress(v string) predicate.IPAddress {\n\treturn predicate.IPAddress(func(s *sql.Selector) {\n\t\ts.Where(sql.EQ(s.C(FieldIPAddress), v))\n\t})\n}", "title": "" }, { "docid": "96de89ebca757e67e42684c50672ae48", "score": "0.5588485", "text": "func RecentAddressEqualFold(v string) predicate.Student {\n\treturn predicate.Student(func(s *sql.Selector) {\n\t\ts.Where(sql.EqualFold(s.C(FieldRecentAddress), v))\n\t})\n}", "title": "" }, { "docid": "2ce0229c2cefdcc06e7440b13a2b929e", "score": "0.5585904", "text": "func EmailEqualFold(v string) predicate.Detail {\n\treturn predicate.Detail(func(s *sql.Selector) {\n\t\ts.Where(sql.EqualFold(s.C(FieldEmail), v))\n\t})\n}", "title": "" }, { "docid": "be44ba0f8668f491de424ae23df2a790", "score": "0.5568724", "text": "func IpAddressEQ(v string) predicate.Machine {\n\treturn predicate.Machine(func(s *sql.Selector) {\n\t\ts.Where(sql.EQ(s.C(FieldIpAddress), v))\n\t})\n}", "title": "" }, { "docid": "f5a0d2230a45271c8aaf5ea69e1b063a", "score": "0.5549233", "text": "func EmailEqualFold(v string) predicate.Contact {\n\treturn predicate.Contact(func(s *sql.Selector) {\n\t\ts.Where(sql.EqualFold(s.C(FieldEmail), v))\n\t})\n}", "title": "" }, { "docid": "4e0ab4deeb3c70e0fcd7ca9fd8ad7715", "score": "0.553551", "text": "func SourceIdEqualFold(v string) predicate.Auth {\n\treturn predicate.Auth(func(s *sql.Selector) {\n\t\ts.Where(sql.EqualFold(s.C(FieldSourceId), v))\n\t})\n}", "title": "" }, { "docid": "4fcc8e26243fafce61f2f4f02979b0b4", "score": "0.55055785", "text": "func CityEqualFold(v string) predicate.Branch {\n\treturn predicate.Branch(func(s *sql.Selector) {\n\t\ts.Where(sql.EqualFold(s.C(FieldCity), v))\n\t})\n}", "title": "" }, { "docid": "c82b42e5f93a8b36fb4af91e3efb9ba8", "score": "0.54797244", "text": "func IpAddress(v string) predicate.Machine {\n\treturn predicate.Machine(func(s *sql.Selector) {\n\t\ts.Where(sql.EQ(s.C(FieldIpAddress), v))\n\t})\n}", "title": "" }, { "docid": "cea6ef05e06810bd3cfd854cd235ffc4", "score": "0.54751486", "text": "func HashEqualFold(v string) predicate.File {\n\treturn predicate.File(func(s *sql.Selector) {\n\t\ts.Where(sql.EqualFold(s.C(FieldHash), v))\n\t})\n}", "title": "" }, { "docid": "8e16f7b664925d2d61932c385a0472a3", "score": "0.5472413", "text": "func MachineIdEqualFold(v string) predicate.Machine {\n\treturn predicate.Machine(func(s *sql.Selector) {\n\t\ts.Where(sql.EqualFold(s.C(FieldMachineId), v))\n\t})\n}", "title": "" }, { "docid": "087d715fb854b2745aa851f5fb72e48f", "score": "0.54693514", "text": "func VinEqualFold(v string) predicate.Vehicle {\n\treturn predicate.Vehicle(func(s *sql.Selector) {\n\t\ts.Where(sql.EqualFold(s.C(FieldVin), v))\n\t})\n}", "title": "" }, { "docid": "84c7d2708d8e727435cee8323f6b650b", "score": "0.54643023", "text": "func PhoneEqualFold(v string) predicate.OrderAddress {\n\treturn predicate.OrderAddress(func(s *sql.Selector) {\n\t\ts.Where(sql.EqualFold(s.C(FieldPhone), v))\n\t})\n}", "title": "" }, { "docid": "189a9218f15f9a31a5d42f28c756c2cd", "score": "0.54187644", "text": "func (o *CommIpV6InterfaceAllOf) SetIpAddress(v string) {\n\to.IpAddress = &v\n}", "title": "" }, { "docid": "e4eb23e9662243a25a6f3a7b952ef3d9", "score": "0.5413268", "text": "func EmailEqualFold(v string) predicate.Student {\n\treturn predicate.Student(func(s *sql.Selector) {\n\t\ts.Where(sql.EqualFold(s.C(FieldEmail), v))\n\t})\n}", "title": "" }, { "docid": "01bec158c3aaafc17aee0edca5d7611c", "score": "0.54125625", "text": "func PasswordEqualFold(v string) predicate.Machine {\n\treturn predicate.Machine(func(s *sql.Selector) {\n\t\ts.Where(sql.EqualFold(s.C(FieldPassword), v))\n\t})\n}", "title": "" }, { "docid": "b83875e2a476ab66a60e2f89278c6947", "score": "0.53939563", "text": "func WalletIdEqualFold(v string) predicate.Pointpendingkyctransaction {\n\treturn predicate.Pointpendingkyctransaction(func(s *sql.Selector) {\n\t\ts.Where(sql.EqualFold(s.C(FieldWalletId), v))\n\t})\n}", "title": "" }, { "docid": "0b62f2027ef030fa6e505e238e193300", "score": "0.538081", "text": "func ImeiEqualFold(v string) predicate.UserExtend {\n\treturn predicate.UserExtend(func(s *sql.Selector) {\n\t\ts.Where(sql.EqualFold(s.C(FieldImei), v))\n\t})\n}", "title": "" }, { "docid": "35289a49e973f8a9fd504eab78614f4a", "score": "0.5378344", "text": "func SourceEqualFold(v string) predicate.Auth {\n\treturn predicate.Auth(func(s *sql.Selector) {\n\t\ts.Where(sql.EqualFold(s.C(FieldSource), v))\n\t})\n}", "title": "" }, { "docid": "ce1c1732c99438579761bd980fadd8a6", "score": "0.5357586", "text": "func AdidEqualFold(v string) predicate.UserExtend {\n\treturn predicate.UserExtend(func(s *sql.Selector) {\n\t\ts.Where(sql.EqualFold(s.C(FieldAdid), v))\n\t})\n}", "title": "" }, { "docid": "fc1cd205017a2126f760bcc8b5e676b4", "score": "0.5347356", "text": "func InstanceEqualFold(v string) predicate.Metrics {\n\treturn predicate.Metrics(func(s *sql.Selector) {\n\t\ts.Where(sql.EqualFold(s.C(FieldInstance), v))\n\t})\n}", "title": "" }, { "docid": "5ce0b63265783796bf608b8a16cf3f2a", "score": "0.533985", "text": "func AgentidEqualFold(v string) predicate.Agenttype {\n\treturn predicate.Agenttype(func(s *sql.Selector) {\n\t\ts.Where(sql.EqualFold(s.C(FieldAgentid), v))\n\t})\n}", "title": "" }, { "docid": "f5a10dbf29b8078c28455e4ee3e6cc75", "score": "0.53257906", "text": "func DomainEqualFold(v string) predicate.APIAudit {\n\treturn predicate.APIAudit(func(s *sql.Selector) {\n\t\ts.Where(sql.EqualFold(s.C(FieldDomain), v))\n\t})\n}", "title": "" }, { "docid": "b59274d40db9bc02b3bba1c6b348ae01", "score": "0.53194606", "text": "func NameEqualFold(v string) predicate.OrderAddress {\n\treturn predicate.OrderAddress(func(s *sql.Selector) {\n\t\ts.Where(sql.EqualFold(s.C(FieldName), v))\n\t})\n}", "title": "" }, { "docid": "471a30d59c4c89f57a3cc38ff7aca9bc", "score": "0.53076804", "text": "func SOURCEADDRESSEqualFold(v string) predicate.Source {\n\treturn predicate.Source(func(s *sql.Selector) {\n\t\ts.Where(sql.EqualFold(s.C(FieldSOURCEADDRESS), v))\n\t})\n}", "title": "" }, { "docid": "ec56489c0b0aec40ad5f25e30aaae7e4", "score": "0.52575356", "text": "func (b Binding) EqualIP(x net.IP) bool {\n\treturn b.IP.Equal(x)\n}", "title": "" }, { "docid": "6bb77c48c77b3104da604d493bdd2c79", "score": "0.52444816", "text": "func GeomEqualFold(v string) predicate.Address {\n\treturn predicate.Address(func(s *sql.Selector) {\n\t\ts.Where(sql.EqualFold(s.C(FieldGeom), v))\n\t})\n}", "title": "" }, { "docid": "cdf8adff1225dab10fe78fc81ef08268", "score": "0.5231564", "text": "func (in *IpAddress) DeepCopy() *IpAddress {\n\tif in == nil {\n\t\treturn nil\n\t}\n\tout := new(IpAddress)\n\tin.DeepCopyInto(out)\n\treturn out\n}", "title": "" }, { "docid": "90d52a1aa87fd5a654e63f66c405b409", "score": "0.5222939", "text": "func ValueEqualFold(v string) predicate.Contact {\n\treturn predicate.Contact(func(s *sql.Selector) {\n\t\ts.Where(sql.EqualFold(s.C(FieldValue), v))\n\t})\n}", "title": "" }, { "docid": "1d59953c205b9997e24b78df5df51dbe", "score": "0.5215848", "text": "func Field1EqualFold(v string) predicate.User {\n\treturn predicate.User(func(s *sql.Selector) {\n\t\ts.Where(sql.EqualFold(s.C(FieldField1), v))\n\t})\n}", "title": "" }, { "docid": "a53ad6acb2646b2952d4b1718bbbdb28", "score": "0.52029717", "text": "func SubnetMaskContainsFold(v string) predicate.IPAddress {\n\treturn predicate.IPAddress(func(s *sql.Selector) {\n\t\ts.Where(sql.ContainsFold(s.C(FieldSubnetMask), v))\n\t})\n}", "title": "" }, { "docid": "b65cc24be624429697f8958bbb3f7b0f", "score": "0.51894075", "text": "func DayEqualFold(v string) predicate.Slot {\n\treturn predicate.Slot(func(s *sql.Selector) {\n\t\ts.Where(sql.EqualFold(s.C(FieldDay), v))\n\t})\n}", "title": "" }, { "docid": "619f021ef6454e00349fb3c19ba990a7", "score": "0.5187216", "text": "func PlaceEqualFold(v string) predicate.CarCheckInOut {\n\treturn predicate.CarCheckInOut(func(s *sql.Selector) {\n\t\ts.Where(sql.EqualFold(s.C(FieldPlace), v))\n\t})\n}", "title": "" }, { "docid": "8b6b3c00dafe03beb24d4e7e74a88d00", "score": "0.5185271", "text": "func SOURCEADDRESSContainsFold(v string) predicate.Source {\n\treturn predicate.Source(func(s *sql.Selector) {\n\t\ts.Where(sql.ContainsFold(s.C(FieldSOURCEADDRESS), v))\n\t})\n}", "title": "" }, { "docid": "453564ead71b6921a8d27326729a6d1a", "score": "0.51749593", "text": "func FieldEqualFold(name string, substr string) func(*Selector) {\n\treturn func(s *Selector) {\n\t\ts.Where(EqualFold(s.C(name), substr))\n\t}\n}", "title": "" }, { "docid": "7d8ba81af69906a445eaf616bd3d9ee3", "score": "0.5153875", "text": "func (o *VirtualizationVmwareVcenter) SetIpAddress(v []string) {\n\to.IpAddress = v\n}", "title": "" }, { "docid": "a8cb1d66b20ecad4d0eb129b4ceef887", "score": "0.51503783", "text": "func ContentEqualFold(v string) predicate.CustomerFollow {\n\treturn predicate.CustomerFollow(func(s *sql.Selector) {\n\t\ts.Where(sql.EqualFold(s.C(FieldContent), v))\n\t})\n}", "title": "" }, { "docid": "91c107b4187fdc4dd2e0436035b7b2fb", "score": "0.5147377", "text": "func VersionEqualFold(v string) predicate.Machine {\n\treturn predicate.Machine(func(s *sql.Selector) {\n\t\ts.Where(sql.EqualFold(s.C(FieldVersion), v))\n\t})\n}", "title": "" }, { "docid": "9b5fcfc72b75e9e03997eefc01b9a45e", "score": "0.513903", "text": "func PartnerRefEqualFold(v string) predicate.Consumer {\n\treturn predicate.Consumer(func(s *sql.Selector) {\n\t\ts.Where(sql.EqualFold(s.C(FieldPartnerRef), v))\n\t})\n}", "title": "" }, { "docid": "376fe25aae3a7acd0c3c88469aabbede", "score": "0.5131621", "text": "func NickNameEqualFold(v string) predicate.UserExtend {\n\treturn predicate.UserExtend(func(s *sql.Selector) {\n\t\ts.Where(sql.EqualFold(s.C(FieldNickName), v))\n\t})\n}", "title": "" }, { "docid": "15d1dc2e4445cc26c7a41c07378b951c", "score": "0.5127693", "text": "func (o *VirtualizationIpAddressInfoAllOf) SetIpAddress(v string) {\n\to.IpAddress = &v\n}", "title": "" }, { "docid": "2b60d38823ba0b858893da95678b68af", "score": "0.5114979", "text": "func HostnameContainsFold(v string) predicate.Referrer {\n\treturn predicate.Referrer(func(s *sql.Selector) {\n\t\ts.Where(sql.ContainsFold(s.C(FieldHostname), v))\n\t})\n}", "title": "" }, { "docid": "32127cafd3472a2cc6768cc012994669", "score": "0.51143134", "text": "func AttributeEqualFold(v string) predicate.DetectionJob {\n\treturn predicate.DetectionJob(func(s *sql.Selector) {\n\t\ts.Where(sql.EqualFold(s.C(FieldAttribute), v))\n\t})\n}", "title": "" }, { "docid": "e9a05983cd80f286d824d48b6b467725", "score": "0.51032656", "text": "func StreetLineContainsFold(v string) predicate.Address {\n\treturn predicate.Address(func(s *sql.Selector) {\n\t\ts.Where(sql.ContainsFold(s.C(FieldStreetLine), v))\n\t})\n}", "title": "" }, { "docid": "ca06ecb25919c4c1f9ac14f3e3612c88", "score": "0.5102554", "text": "func MoneyEqualFold(v string) predicate.Card {\n\treturn predicate.Card(func(s *sql.Selector) {\n\t\ts.Where(sql.EqualFold(s.C(FieldMoney), v))\n\t})\n}", "title": "" }, { "docid": "0bde9e5191ec03780c461cc4a5e878a8", "score": "0.5101307", "text": "func PhoneEqualFold(v string) predicate.Restaurant {\n\treturn predicate.Restaurant(func(s *sql.Selector) {\n\t\ts.Where(sql.EqualFold(s.C(FieldPhone), v))\n\t})\n}", "title": "" }, { "docid": "37eb4b60e75a2798224740bf8331432f", "score": "0.5098228", "text": "func PhonenumberEqualFold(v string) predicate.Complaint {\n\treturn predicate.Complaint(func(s *sql.Selector) {\n\t\ts.Where(sql.EqualFold(s.C(FieldPhonenumber), v))\n\t})\n}", "title": "" }, { "docid": "147e092b7d2f27f155df5566ef30ac5c", "score": "0.50949293", "text": "func ContactEqualFold(v string) predicate.Clubapplication {\n\treturn predicate.Clubapplication(func(s *sql.Selector) {\n\t\ts.Where(sql.EqualFold(s.C(FieldContact), v))\n\t})\n}", "title": "" }, { "docid": "8578878128aa73109d98423243f0a777", "score": "0.50719154", "text": "func SsidEqualFold(v string) predicate.SurveyWiFiScan {\n\treturn predicate.SurveyWiFiScan(func(s *sql.Selector) {\n\t\ts.Where(sql.EqualFold(s.C(FieldSsid), v))\n\t},\n\t)\n}", "title": "" }, { "docid": "44cf59ddbab860f8d46743e37c88b790", "score": "0.50547534", "text": "func PhoneEqualFold(v string) predicate.Contact {\n\treturn predicate.Contact(func(s *sql.Selector) {\n\t\ts.Where(sql.EqualFold(s.C(FieldPhone), v))\n\t})\n}", "title": "" }, { "docid": "5bfe4ce1fbaffa7336e48a2a80068475", "score": "0.5051299", "text": "func NameEqualFold(v string) predicate.Task {\n\treturn predicate.Task(sql.FieldEqualFold(FieldName, v))\n}", "title": "" }, { "docid": "909f67a14e679fcd3b30ef4170bcd2d8", "score": "0.50461054", "text": "func PhoneEqualFold(v string) predicate.Detail {\n\treturn predicate.Detail(func(s *sql.Selector) {\n\t\ts.Where(sql.EqualFold(s.C(FieldPhone), v))\n\t})\n}", "title": "" }, { "docid": "98faaa785a0f6daaa00e214a6c2ac760", "score": "0.504254", "text": "func NameEqualFold(v string) predicate.Application {\n\treturn predicate.Application(func(s *sql.Selector) {\n\t\ts.Where(sql.EqualFold(s.C(FieldName), v))\n\t})\n}", "title": "" }, { "docid": "7b0c4d006cf20ff84ff638c258345ea3", "score": "0.50408435", "text": "func AdviceEqualFold(v string) predicate.Antenatalinformation {\n\treturn predicate.Antenatalinformation(func(s *sql.Selector) {\n\t\ts.Where(sql.EqualFold(s.C(FieldAdvice), v))\n\t})\n}", "title": "" }, { "docid": "9cae3efbf86db18bde67c747af7162d6", "score": "0.50403786", "text": "func NameEqualFold(v string) predicate.Referrer {\n\treturn predicate.Referrer(func(s *sql.Selector) {\n\t\ts.Where(sql.EqualFold(s.C(FieldName), v))\n\t})\n}", "title": "" }, { "docid": "dec8afa48874f12cbd316cb6e143d87c", "score": "0.5035871", "text": "func (m *NetworkInfo) SetIpAddress(value *string)() {\n m.ipAddress = value\n}", "title": "" }, { "docid": "f44b93d687322b18b2420b251c8619b8", "score": "0.5032513", "text": "func PasswordEqualFold(v string) predicate.User {\n\treturn predicate.User(func(s *sql.Selector) {\n\t\ts.Where(sql.EqualFold(s.C(FieldPassword), v))\n\t})\n}", "title": "" }, { "docid": "41a03d20cad5f839b97f680703860614", "score": "0.5029057", "text": "func BankCodeEqualFold(v string) predicate.Consumer {\n\treturn predicate.Consumer(func(s *sql.Selector) {\n\t\ts.Where(sql.EqualFold(s.C(FieldBankCode), v))\n\t})\n}", "title": "" }, { "docid": "d6feef6fc3adf6ada0375d8e41771327", "score": "0.5028859", "text": "func ProfilePicEqualFold(v string) predicate.User {\n\treturn predicate.User(func(s *sql.Selector) {\n\t\ts.Where(sql.EqualFold(s.C(FieldProfilePic), v))\n\t})\n}", "title": "" }, { "docid": "8575dfdce5b081e73153da9d64e26b5f", "score": "0.50221765", "text": "func IconEqualFold(v string) predicate.UserExtend {\n\treturn predicate.UserExtend(func(s *sql.Selector) {\n\t\ts.Where(sql.EqualFold(s.C(FieldIcon), v))\n\t})\n}", "title": "" }, { "docid": "241abfd5997ac094b9a3baad784a37ce", "score": "0.5013501", "text": "func (a Addr) Equal(x Addr) bool {\n\tsizea, _ := a.Mask.Size()\n\tsizeb, _ := x.Mask.Size()\n\t// ignore label for comparison\n\treturn a.IP.Equal(x.IP) && sizea == sizeb\n}", "title": "" }, { "docid": "447ed912094e038174808de615fcd7a6", "score": "0.50057876", "text": "func execEqualFold(_ int, p *gop.Context) {\n\targs := p.GetArgs(2)\n\tret := bytes.EqualFold(args[0].([]byte), args[1].([]byte))\n\tp.Ret(2, ret)\n}", "title": "" }, { "docid": "5c3316b6ecb16bf9db6b8b72dadf8586", "score": "0.5003124", "text": "func BioEqualFold(v string) predicate.User {\n\treturn predicate.User(func(s *sql.Selector) {\n\t\ts.Where(sql.EqualFold(s.C(FieldBio), v))\n\t})\n}", "title": "" }, { "docid": "6748796dc1352402980537299d60851c", "score": "0.49946293", "text": "func ColorEqualFold(v string) predicate.Car {\n\treturn predicate.Car(func(s *sql.Selector) {\n\t\ts.Where(sql.EqualFold(s.C(FieldColor), v))\n\t})\n}", "title": "" }, { "docid": "832613adfdd07c7b654a8071f215e269", "score": "0.49900872", "text": "func (o *StorageBridgeCollectionGetParams) SetIPAddress(iPAddress *string) {\n\to.IPAddress = iPAddress\n}", "title": "" }, { "docid": "ec5d664c0433f3e48f65e9d162becf12", "score": "0.49878702", "text": "func PhoneNumberEqualFold(v string) predicate.Company {\n\treturn predicate.Company(func(s *sql.Selector) {\n\t\ts.Where(sql.EqualFold(s.C(FieldPhoneNumber), v))\n\t})\n}", "title": "" }, { "docid": "87d8ba8d1bd6e48b79ed6aff162104a4", "score": "0.49861878", "text": "func (b *boundary) EqualIP(other boundary) bool {\n\treturn b.IP.Equal(other.IP) &&\n\t\tb.Int64 == other.Int64 &&\n\t\tb.Float64 == other.Float64\n}", "title": "" }, { "docid": "a89027f1a4d8d6fa953294ee4719b608", "score": "0.49855068", "text": "func ExplainEqualFold(v string) predicate.Detail {\n\treturn predicate.Detail(func(s *sql.Selector) {\n\t\ts.Where(sql.EqualFold(s.C(FieldExplain), v))\n\t})\n}", "title": "" }, { "docid": "7ef4dc762a3ac63f0e29683fe3ebd143", "score": "0.49788648", "text": "func IDCARDNUMBEREqualFold(v string) predicate.Employee {\n\treturn predicate.Employee(func(s *sql.Selector) {\n\t\ts.Where(sql.EqualFold(s.C(FieldIDCARDNUMBER), v))\n\t})\n}", "title": "" }, { "docid": "b1b181e028ecf8532214d9544176cbfe", "score": "0.49641633", "text": "func RemarkEqualFold(v string) predicate.CustomerAddress {\n\treturn predicate.CustomerAddress(func(s *sql.Selector) {\n\t\ts.Where(sql.EqualFold(s.C(FieldRemark), v))\n\t})\n}", "title": "" }, { "docid": "c0d7b1c6750738921b2f5a7aa61eb58f", "score": "0.4956071", "text": "func ContentEqualFold(v string) predicate.Comment {\n\treturn predicate.Comment(func(s *sql.Selector) {\n\t\ts.Where(sql.EqualFold(s.C(FieldContent), v))\n\t})\n}", "title": "" }, { "docid": "068d6c7b4a484cf9b7876f0f511b4d66", "score": "0.49537516", "text": "func ZipEqualFold(v string) predicate.Branch {\n\treturn predicate.Branch(func(s *sql.Selector) {\n\t\ts.Where(sql.EqualFold(s.C(FieldZip), v))\n\t})\n}", "title": "" }, { "docid": "4ec6629f2d3f7da57043448e29f90504", "score": "0.49529108", "text": "func NameEqualFold(v string) predicate.User {\n\treturn predicate.User(func(s *sql.Selector) {\n\t\ts.Where(sql.EqualFold(s.C(FieldName), v))\n\t})\n}", "title": "" }, { "docid": "4ec6629f2d3f7da57043448e29f90504", "score": "0.49529108", "text": "func NameEqualFold(v string) predicate.User {\n\treturn predicate.User(func(s *sql.Selector) {\n\t\ts.Where(sql.EqualFold(s.C(FieldName), v))\n\t})\n}", "title": "" }, { "docid": "ba21a2b2e9ac5301396db22e9a86cf86", "score": "0.49505734", "text": "func EMPLOYEEADDRESSContainsFold(v string) predicate.Employee {\n\treturn predicate.Employee(func(s *sql.Selector) {\n\t\ts.Where(sql.ContainsFold(s.C(FieldEMPLOYEEADDRESS), v))\n\t})\n}", "title": "" }, { "docid": "307724d247db8ac533c3c3b6a25ab4b7", "score": "0.49503356", "text": "func NameEqualFold(v string) predicate.Complaint {\n\treturn predicate.Complaint(func(s *sql.Selector) {\n\t\ts.Where(sql.EqualFold(s.C(FieldName), v))\n\t})\n}", "title": "" }, { "docid": "ee63bfa571251a10f55b6eb2df763697", "score": "0.49441046", "text": "func (s *InputDeviceNetworkSettings) SetIpAddress(v string) *InputDeviceNetworkSettings {\n\ts.IpAddress = &v\n\treturn s\n}", "title": "" }, { "docid": "f846e1eeff3f5ad22e1c7ad838662774", "score": "0.4940772", "text": "func (aluo *AuditLogUpdateOne) SetIPAddress(s string) *AuditLogUpdateOne {\n\taluo.ip_address = &s\n\treturn aluo\n}", "title": "" }, { "docid": "cfdd7dc92fb96b557a74a82676e710d5", "score": "0.49399373", "text": "func DataEqualFold(v string) predicate.Session {\n\treturn predicate.Session(func(s *sql.Selector) {\n\t\ts.Where(sql.EqualFold(s.C(FieldData), v))\n\t})\n}", "title": "" }, { "docid": "bb5d4e196fb1c7cb3047199d441b1dc3", "score": "0.49285293", "text": "func DateEqualFold(v string) predicate.Transactionfactor {\n\treturn predicate.Transactionfactor(func(s *sql.Selector) {\n\t\ts.Where(sql.EqualFold(s.C(FieldDate), v))\n\t})\n}", "title": "" }, { "docid": "c84294203961a435881e5722ae7c97f2", "score": "0.49228147", "text": "func ToAccountNameEqualFold(v string) predicate.Consumer {\n\treturn predicate.Consumer(func(s *sql.Selector) {\n\t\ts.Where(sql.EqualFold(s.C(FieldToAccountName), v))\n\t})\n}", "title": "" }, { "docid": "c521bf78c2518c5e6a2b78e30e686685", "score": "0.4918877", "text": "func OwnerEqualFold(v string) predicate.Task {\n\treturn predicate.Task(sql.FieldEqualFold(FieldOwner, v))\n}", "title": "" } ]
11ab5e9794cb3966f6b745e42d6c4502
/ Updates the warning displayed for this node in the Scene Dock. Use [method _get_configuration_warning] to setup the warning message to display. Args: [], Returns: void
[ { "docid": "51237c56139eb456b01164081a9f1d85", "score": "0.6982897", "text": "func (o *Node) UpdateConfigurationWarning() {\n\t//log.Println(\"Calling Node.UpdateConfigurationWarning()\")\n\n\t// Build out the method's arguments\n\tptrArguments := make([]gdnative.Pointer, 0, 0)\n\n\t// Get the method bind\n\tmethodBind := gdnative.NewMethodBind(\"Node\", \"update_configuration_warning\")\n\n\t// Call the parent method.\n\t// void\n\tretPtr := gdnative.NewEmptyVoid()\n\tgdnative.MethodBindPtrCall(methodBind, o.GetBaseObject(), ptrArguments, retPtr)\n\n}", "title": "" } ]
[ { "docid": "80d99ba37880c41103d8ca45e9d2ae23", "score": "0.60630846", "text": "func (o *Node) X_GetConfigurationWarning() gdnative.String {\n\t//log.Println(\"Calling Node.X_GetConfigurationWarning()\")\n\n\t// Build out the method's arguments\n\tptrArguments := make([]gdnative.Pointer, 0, 0)\n\n\t// Get the method bind\n\tmethodBind := gdnative.NewMethodBind(\"Node\", \"_get_configuration_warning\")\n\n\t// Call the parent method.\n\t// String\n\tretPtr := gdnative.NewEmptyString()\n\tgdnative.MethodBindPtrCall(methodBind, o.GetBaseObject(), ptrArguments, retPtr)\n\n\t// If we have a return type, convert it from a pointer into its actual object.\n\tret := gdnative.NewStringFromPointer(retPtr)\n\treturn ret\n}", "title": "" }, { "docid": "46a82a939a6d2e4fbb7d77c15cc65c4f", "score": "0.5841885", "text": "func (j *JSONMessage) SetWarn() {\n\tj.Add(JSONLevelKey, shared.WarningMessage)\n}", "title": "" }, { "docid": "7b180330dbfc32cf41432d7a31b61339", "score": "0.5788632", "text": "func (sa *SyncAgent) Warning(err error) error {\n\tif sa == nil {\n\t\treturn err\n\t}\n\treturn sa.ErrorEventWithState(EventWarning, ColorLightYellow, err)\n}", "title": "" }, { "docid": "5d5f8c238d9f75f3221c46a36913d134", "score": "0.5774749", "text": "func (c *Configuration) Warning() bool {\n\treturn c.warning\n}", "title": "" }, { "docid": "c524eebc2fa0b6dd10b94fb12d083d51", "score": "0.56382746", "text": "func Warning(msg string) {\n\tvlog[LL_WARNING].Warning(msg)\n}", "title": "" }, { "docid": "af4c59096019183edb039cf4ceca26f8", "score": "0.5636403", "text": "func (m *LicenseUnitsDetail) SetWarning(value *int32)() {\n err := m.GetBackingStore().Set(\"warning\", value)\n if err != nil {\n panic(err)\n }\n}", "title": "" }, { "docid": "cf8ac3602f8da7c65903818aa6e1ee7f", "score": "0.5590483", "text": "func (f *Flash) Warning(msg string, current ...bool) {\n\tf.WarningMsg = msg\n\tf.set(\"warning\", msg, current...)\n}", "title": "" }, { "docid": "2bce8d8e032cc5230394d3888d162ce3", "score": "0.5514713", "text": "func (m *LicenseUnitsDetail) SetWarning(value *int32)() {\n m.warning = value\n}", "title": "" }, { "docid": "315c7999480b07ea7192d94f4b2d3b58", "score": "0.547063", "text": "func Warning(stdout bool, msg string) {\n\tlogWarning(loggersMap.getLogger(gaugeModuleID), stdout, msg)\n}", "title": "" }, { "docid": "5cc5b4d3f59d5057033958e09b7afd02", "score": "0.54063016", "text": "func (l *Logger) Warning(module string, content ...interface{}) {\n\tl.writeLogLine(true, formatLogPrefix(module, \"W\", yellow(), content...))\n\tpublishLogMessage(\"W\", module, content...)\n}", "title": "" }, { "docid": "68442cb1ab912a9b06b3b00fab623873", "score": "0.5401596", "text": "func (gl *GoLogger) Warning(info, msg string) {\n\tlog.Println(\"[WARNING]\", info, msg)\n}", "title": "" }, { "docid": "7c466c94ff79dc560c2ef89dd73fe5d5", "score": "0.53964716", "text": "func (a *Log) Warning(msg string) *Log {\n\tif a.config.Loggers[Wrn] != nil {\n\t\tprepareLog := a.prepareLog(time.Now(), msg, 2)\n\t\ta.config.Loggers[Wrn].Channel <- fmt.Sprintf(\"[%s] %s\", Name(Wrn), prepareLog)\n\t} else {\n\t\tprintNotConfiguredMessage(Wrn, 2)\n\t}\n\treturn a\n}", "title": "" }, { "docid": "aa5a45207fff7945119b1be267f1fae3", "score": "0.53748727", "text": "func Warning(v ...interface{}) {\n\tGetInstance().Warning(v...)\n}", "title": "" }, { "docid": "86dd270fc10eb3b4876bd0063a9cce76", "score": "0.537119", "text": "func (s *Syslog) Warning(v string) {\n\ts.W.Warning(\"warning: \" + v)\n}", "title": "" }, { "docid": "e1abc2ce28ec8d8febee906b85716f97", "score": "0.53419906", "text": "func Warn(msg string) {\n\tlogrus.Warn(\"[%s] %s\", config.GetPodName(), msg)\n}", "title": "" }, { "docid": "e50a3a38e7b6a73b76f8a00f211416b8", "score": "0.532901", "text": "func (l *Logger) Warning(args ...interface{}) {\n\tif l.logLevel&LevelWarning == 0 || l.disabled {\n\t\treturn\n\t}\n\tlogger.Println(fmt.Sprintf(\"[ WARNING ] %s:\", l.Prefix), fmt.Sprint(args...))\n}", "title": "" }, { "docid": "f8952cb83d7f50dc1eccf0f48a32c33f", "score": "0.5323457", "text": "func (sl *SysLogger) Warning(info, msg string) {\n}", "title": "" }, { "docid": "1dd06aa8271302ea2b50ecdd0759f172", "score": "0.5321716", "text": "func (log *cLogger) Warning(s string) {\n\tlogger.Warn(s)\n}", "title": "" }, { "docid": "a1b38a78bff6f35a1c5e618740b2afb6", "score": "0.53052706", "text": "func SetWarningLevel(configuration CSharpProject) string {\n\n\tif configuration.WarningLevel == \"\" {\n\t\treturn \"\"\n\t}\n\n\twarningLevel, err := strconv.ParseInt(configuration.WarningLevel, 10, 32)\n\n\tif err != nil {\n\t\tfmt.Printf(\"Warning: Invalid value for warning level (%s), using the default value for the compiler.\", configuration.WarningLevel)\n\t\treturn \"\"\n\t}\n\n\tif warningLevel >= 0 && warningLevel <= 4 {\n\t\treturn fmt.Sprintf(\"-warn:%d\", warningLevel)\n\t}\n\n\tfmt.Printf(\"Warning: Invalid value for warning level (%s), using the default value for the compiler.\", configuration.WarningLevel)\n\n\treturn \"\"\n}", "title": "" }, { "docid": "9c779e478bcb4515d4e38528f31cd6a0", "score": "0.52705127", "text": "func Warning(v ...interface{}) {\n\tgetInstance().Warning(v...)\n}", "title": "" }, { "docid": "db6a78758047da030c855bae2ddd63e8", "score": "0.5250125", "text": "func (log *Logger) Warning(args ...interface{}) {\n\tvar rtParams runtimeParams\n\tif log.LineNumber {\n\t\trtParams.file, rtParams.function, rtParams.line = fetchLocation()\n\t}\n\tif log.logLevelCode > 3 {\n\t\tif log.RemoteAvailable {\n\t\t\t// Create the logMessage struct here\n\t\t\tlogStruct, _ := generateTimestamp(\"WARNING\", rtParams)\n\t\t\tch := make(chan int)\n\t\t\tgo sendLogMessageFromWrite(logStruct, ch, args...)\n\t\t\t<-ch\n\t\t}\n\t\treturn\n\t}\n\tch := make(chan int)\n\tgo func(ch chan int) {\n\t\twrite(warningPrefix, log, log.WarningColor, rtParams, ch, args...)\n\t}(ch)\n\t<-ch\n}", "title": "" }, { "docid": "d93888aa07f4d3743d5762a0c6f619b9", "score": "0.5234157", "text": "func (l WindowsLogger) NWarning(eventID uint32, v ...interface{}) error {\n\treturn l.send(l.ev.Warning(eventID, fmt.Sprint(v...)))\n}", "title": "" }, { "docid": "d93888aa07f4d3743d5762a0c6f619b9", "score": "0.5234157", "text": "func (l WindowsLogger) NWarning(eventID uint32, v ...interface{}) error {\n\treturn l.send(l.ev.Warning(eventID, fmt.Sprint(v...)))\n}", "title": "" }, { "docid": "e94e4a775462c741e20a6ccc4c3dd840", "score": "0.522915", "text": "func Warning(args ...interface{}) {\n\tif logger.Level >= logrus.WarnLevel {\n\t\tnewEntry().Warn(args...)\n\t}\n}", "title": "" }, { "docid": "59b17342f1fb526d3948d51529e2caa4", "score": "0.5219937", "text": "func (w wrapLogrus) Warning(message string) { w.Entry.Warning(message) }", "title": "" }, { "docid": "c58f9dfe30193f7576bb422bf32795e0", "score": "0.5215675", "text": "func Warning(format string, args ...interface{}) {\n\tsmLogger.Logger.Warning(format, args...)\n}", "title": "" }, { "docid": "ce7e219789133c934152932b12058553", "score": "0.5210236", "text": "func Warning(args ...interface{}) {\n\tglog.WarningDepth(1, args...)\n}", "title": "" }, { "docid": "b7d6d5fec54f154cf4010df0bbd23248", "score": "0.5209806", "text": "func (l *LoggingT)Warning(args ...interface{}) {\n\tl.print(warningLog, args...)\n}", "title": "" }, { "docid": "27cc06bb22bf53d8c3f71612895dadd4", "score": "0.5202849", "text": "func (fl *FluentLogger) Warning(msgs ...interface{}) {\n\tif fl.logLvl > warning {\n\t\treturn\n\t}\n\tdata := make(map[string]string)\n\tdata[\"message\"] = extractText(msgs)\n\tdata[\"stack\"] = getCallingStack()\n\tdata[\"level\"] = \"warning\"\n\tfl.sendLog(fl.app, data)\n}", "title": "" }, { "docid": "3674c41cb2e9b2279c147ca2d70c509b", "score": "0.51618123", "text": "func (l *dogoLog) Warning(v ...interface{}) {\n\tif RunTimeConfig.IsDebug() {\n\t\tv = append([]interface{}{RUN_WARNING_FORMAT}, v...)\n\t\tlog.Output(2, fmt.Sprint(v...))\n\t}\n}", "title": "" }, { "docid": "42792a989633432e8b4e7f37b0fc6ed5", "score": "0.5144527", "text": "func Warning(title, text string) (bool, error) {\n\tret := messageBox(title, text, mbOk|mbIconWarning)\n\treturn ret == idOk, nil\n}", "title": "" }, { "docid": "5c54260e97b0cf6431d1f8815672abb6", "score": "0.51408607", "text": "func (c *Client) Warning(title, text string, tags []string) error {\n\treturn c.Event(title, text, c.NewDefaultEventOpts(Warning, tags))\n}", "title": "" }, { "docid": "9ced1510b8b2cf887d05396c2ae78786", "score": "0.51235896", "text": "func (l *Logger) Warning(message string) {\n\tl.write(LOG_Warning, message)\n}", "title": "" }, { "docid": "9b2a38b203dee2c783bfce9d855b4cee", "score": "0.51191825", "text": "func Warning(text string, options ...Option) error {\n\treturn message(warningKind, text, applyOptions(options))\n}", "title": "" }, { "docid": "0db8785f53f733480b8fae95044eb601", "score": "0.511257", "text": "func Warning(args ...interface{}) {\n\t_PriLogger.Warning(args...)\n}", "title": "" }, { "docid": "9b9f1d60db73979368afacc86b8acb40", "score": "0.5112506", "text": "func (a Announcer) Warning(format string, args ...interface{}) {\n\t// Produce classic log line\n\ta.Announcer.Warning(format, args...)\n\n\t// Produce k8s event\n\tif a.writeEvent && a.chiCapable() {\n\t\tif len(args) > 0 {\n\t\t\ta.ctrl.EventWarning(a.chi, a.eventAction, a.eventReason, fmt.Sprintf(format, args...))\n\t\t} else {\n\t\t\ta.ctrl.EventWarning(a.chi, a.eventAction, a.eventReason, fmt.Sprint(format))\n\t\t}\n\t}\n\n\t// Produce chi status record\n\ta.writeCHIStatus(format, args...)\n}", "title": "" }, { "docid": "02a0b9c6ef88cbbf4a7cc4af369e147a", "score": "0.51054966", "text": "func Warning(msg interface{}) {\n\tdefaultLogger.log(defaultLogger.stackDepth, Level_Warning, nil, msg)\n}", "title": "" }, { "docid": "d4fcd76ce6677a781e0d8557ef738bca", "score": "0.510072", "text": "func Warning(args ...interface{}) {\n\tlogger.Warning(args...)\n}", "title": "" }, { "docid": "d4fcd76ce6677a781e0d8557ef738bca", "score": "0.510072", "text": "func Warning(args ...interface{}) {\n\tlogger.Warning(args...)\n}", "title": "" }, { "docid": "d4fcd76ce6677a781e0d8557ef738bca", "score": "0.510072", "text": "func Warning(args ...interface{}) {\n\tlogger.Warning(args...)\n}", "title": "" }, { "docid": "b24c381082d9bba3d2f52300354e6dbf", "score": "0.50856096", "text": "func Warning(format string, args ...interface{}) {\n\tlogger.Warning(format, args...)\n}", "title": "" }, { "docid": "24e3643458eff79b50c09bd84b11e855", "score": "0.5077236", "text": "func Warning(args ...interface{}) {\n\tstd.Warning(args...)\n}", "title": "" }, { "docid": "7688498ebcf4a3cde190760c2264a746", "score": "0.5062686", "text": "func Warning(m string) {\n\tfmt.Fprintf(os.Stderr, \"[%s] %s: %s\\n\", progname, color.Yellow(\"Warning\"), m)\n}", "title": "" }, { "docid": "6b2623e0c3b9ad35cfedbf25c77a8abe", "score": "0.50499684", "text": "func (o *ContainerUpdateOKBody) SetWarnings(v []string) {\n\to.Warnings = v\n}", "title": "" }, { "docid": "35c5e03eb6f4a394ade9f25207292446", "score": "0.50475025", "text": "func (l *loggerWrapper) Warning(args ...interface{}) {\n\tl.logger.Warn(sprint(args...))\n}", "title": "" }, { "docid": "cb5ce9a06d7b65f1ae6ea1e1ec98d171", "score": "0.5036527", "text": "func Warn(msg string) {\n\tcolor.Yellow(\"Warning: \" + msg)\n}", "title": "" }, { "docid": "ecf520c12ef159c6066613692cf003d8", "score": "0.503093", "text": "func (lg *Logger) Warning(format string, v ...interface{}) {\r\n\tif lg.level <= WARNING {\r\n\t\tlg.Output(2, fmt.Sprintf(\"WARNING: \"+format, v...))\r\n\t}\r\n}", "title": "" }, { "docid": "083f2fd52ea196daebab08e59b82ae27", "score": "0.5021384", "text": "func (s *SpecErr) SetWarningMessage(warningMsg string, msgId int64) {\n\ts.EmptyMsgData()\n\ts.ErrorMsgType\t= SpecErrTypeWARNING\n\ts.IsErr = false\n\ts.IsPanic = false\n\ts.setMessageText(warningMsg, msgId)\n}", "title": "" }, { "docid": "6988eab75ed44b634a1d8ded7a643ccb", "score": "0.5011309", "text": "func (std *LogrusLogger) Warning(args ...interface{}) {\n\tstd.internalLogger.Warning(args...)\n}", "title": "" }, { "docid": "888bc8e71e0e4c8007b935fdbe092f3f", "score": "0.5009029", "text": "func (gll GoLoggingLogger) Warning(ctx context.Context, f string, v ...interface{}) {\n\tgll.logger.Warning(gll.formatLog(ctx, f, v...))\n}", "title": "" }, { "docid": "b0363c4bcbbf43180bdd5dee4b1f6140", "score": "0.5002923", "text": "func (l *Eventlog) Warning(eid uint32, category uint16, msg []byte) error {\n\treturn l.report(uint16(Warn), eid, category, msg)\n}", "title": "" }, { "docid": "4c74921bfab977720952e5836e6235c7", "score": "0.5002249", "text": "func Warn(msg string, CTX ...interface{}) {\n\tblockRoot.write(msg, LvlWarn, CTX)\n}", "title": "" }, { "docid": "411c288bf4b0f5b357b1550e57c67745", "score": "0.49977848", "text": "func (w *TTYWriter) Warning(format string, args ...interface{}) {\n\tlog.out.Infof(format, args...)\n\tw.Fprintf(\"%s %s\\n\", coloredWarningSymbol, yellowString(format, args...))\n}", "title": "" }, { "docid": "bcd9661013f3b5546f3b67e86608892a", "score": "0.4995489", "text": "func (l *ConsoleLog) Warning(eid uint32, msg string) error {\n\treturn l.report(\"warn\", eid, msg)\n}", "title": "" }, { "docid": "94e7c64ee3c0fd97b4d799bf180e7002", "score": "0.49898487", "text": "func (l *Log) Warning(message string, params ...interface{}) {\n\tl.Println(\"WARNING \", message, params)\n}", "title": "" }, { "docid": "da448efe04d138c56b74b658edd2810b", "score": "0.4985721", "text": "func Warningf(parent Controller, format string, data ...interface{}) int {\n\tcaption := fmt.Sprintf(format, data...)\n\treturn MsgBox(parent, \"Warning\", caption, w32.MB_ICONWARNING|w32.MB_OKCANCEL)\n}", "title": "" }, { "docid": "b6a1387adf50cc714248158bbe49616c", "score": "0.49828327", "text": "func Warn(message string) {\n\tgeneric(\"WARN\", message)\n}", "title": "" }, { "docid": "4f2115c9e0a883e3b11b4097c69c7347", "score": "0.4971128", "text": "func (l *UnleashClientListener) OnWarning(warning error) {\n\tlog.Warn(nil, map[string]interface{}{\n\t\t\"err\": warning.Error(),\n\t}, \"toggles warning\")\n}", "title": "" }, { "docid": "b76f29d958811636812a80193a8595bd", "score": "0.49703106", "text": "func SetLevelToWarning() {\n\tlogger.Level = log.WarnLevel\n}", "title": "" }, { "docid": "43ea66e9fdb864f74da92cece49ee5af", "score": "0.49673197", "text": "func Warning(body string, v ...interface{}) string {\n\treturn fmt.Sprintf(`\n---------------------------------- WARNING ----------------------------------\n%s\n`, wordwrap.WrapString(fmt.Sprintf(body, v...), 70))\n}", "title": "" }, { "docid": "d9995b391a500e1ec43b666678a7cb88", "score": "0.4954958", "text": "func warning(format string, args ...interface{}) {\n\tfmt.Printf(\"[makeclones] \\x1b[36;1m%s\\x1b[0m\\n\", fmt.Sprintf(format, args...))\n}", "title": "" }, { "docid": "e29999f673d89372c7fd5fb30ccdba35", "score": "0.49511367", "text": "func EmitSecurityWarning() {\n\tif !mwsettings.HasSetting(\"security/user\") || !mwsettings.HasSetting(\"security/strict\") {\n\t\tlogger.LogWarning(\"Security section missing from configuration!!!! you should probably fix that!\")\n\t}\n}", "title": "" }, { "docid": "3b90bf4c48fb4e10aabf7c95e86c0d91", "score": "0.49396893", "text": "func Warning(a ...interface{}) {\n\tyellow := color.New(color.FgYellow).SprintFunc()\n\tif !IsJSON() {\n\t\tfmt.Fprintf(GetStderr(), \"%s%s%s%s\", prefixSpacing, yellow(getWarningString()), suffixSpacing, fmt.Sprintln(a...))\n\t}\n}", "title": "" }, { "docid": "f376047fb241a0b16f1d2dcb34616d29", "score": "0.49306786", "text": "func Warning(messages ...interface{}) {\n\n\tif DefaultLogLevel > 30 {\n\t\treturn\n\t}\n\tWarningLogger.Println(messages...)\n}", "title": "" }, { "docid": "30982327867d6c34a9a01b1345fe50e1", "score": "0.49283448", "text": "func Warning(message string, v ...interface{}) {\n\tprintLog(color.FgYellow, WarnPrefix, true, message, v...)\n}", "title": "" }, { "docid": "bcf77ea8571046bf4dac7fe913e83734", "score": "0.49239364", "text": "func (l *ContractLogger) Warning(msg interface{}) {\r\n if WARNING > l.level { return }\r\n\tlogMessage(WARNING, buildLogString(l.module, WARNING, msg))\r\n}", "title": "" }, { "docid": "6ac0089f7b801e1d23340b1c1ba3473b", "score": "0.49125108", "text": "func Warning(args ...interface{}) {\n\tmu.Lock()\n\tdefer mu.Unlock()\n\tlog.Warning(args...)\n}", "title": "" }, { "docid": "6ebc865cf12c38441f1391593df63a78", "score": "0.49098882", "text": "func (*nopProgress) PrintWarn(err error, message string, args ...interface{}) {}", "title": "" }, { "docid": "12a023d19634ef2518534df13542e656", "score": "0.49095637", "text": "func (le *LogEntry) Warning(msg string) {\n\tle.Log(WARNING, msg)\n}", "title": "" }, { "docid": "3754b71e1fdabb76a1d7cc6813e9395a", "score": "0.49065456", "text": "func AdjustWarningMessage(warningRaw string) string {\n\twarning := strings.Split(warningRaw, \":\")\n\tif len(warning) > 1 {\n\t\twarning[1] = strings.Replace(warning[1], \"safety_huskyci_analysis_requirements_raw.txt\", \"'requirements.txt'\", -1)\n\t\twarning[1] = strings.Replace(warning[1], \" unpinned\", \"Unpinned\", -1)\n\n\t\treturn (warning[1] + \" huskyCI can check it if you pin it in a format such as this: \\\"mypacket==3.2.9\\\" :D\")\n\t}\n\n\treturn warningRaw\n}", "title": "" }, { "docid": "3754b71e1fdabb76a1d7cc6813e9395a", "score": "0.49065456", "text": "func AdjustWarningMessage(warningRaw string) string {\n\twarning := strings.Split(warningRaw, \":\")\n\tif len(warning) > 1 {\n\t\twarning[1] = strings.Replace(warning[1], \"safety_huskyci_analysis_requirements_raw.txt\", \"'requirements.txt'\", -1)\n\t\twarning[1] = strings.Replace(warning[1], \" unpinned\", \"Unpinned\", -1)\n\n\t\treturn (warning[1] + \" huskyCI can check it if you pin it in a format such as this: \\\"mypacket==3.2.9\\\" :D\")\n\t}\n\n\treturn warningRaw\n}", "title": "" }, { "docid": "87611e7304490a7784f39d3263928580", "score": "0.49026346", "text": "func (log *Logger) Warning(format string, opts ...interface{}) {\n\tlog.Log(logger.LevelWarning, format, opts...)\n}", "title": "" }, { "docid": "1854e95d4f029196a5e18b89bbeae60f", "score": "0.49001172", "text": "func (l WindowsLogger) Warning(v ...interface{}) error {\n\treturn l.send(l.ev.Warning(2, fmt.Sprint(v...)))\n}", "title": "" }, { "docid": "1854e95d4f029196a5e18b89bbeae60f", "score": "0.49001172", "text": "func (l WindowsLogger) Warning(v ...interface{}) error {\n\treturn l.send(l.ev.Warning(2, fmt.Sprint(v...)))\n}", "title": "" }, { "docid": "31e5384adf8821caf3f95b18fbf43f16", "score": "0.48965788", "text": "func Warning(msg string) {\n\t_, err := fmt.Fprintf(Stderr, \"Warning: %v\\n\", msg)\n\tif err != nil {\n\t\tpanic(\"Can't write to stderr\")\n\t}\n}", "title": "" }, { "docid": "7bcdfee74d67d699c1951cd44efc8abe", "score": "0.48952475", "text": "func (ui *ColorUI) Warn(message string) {\n\tct.ChangeColor(ui.WarnFGColor.Code, ui.WarnFGColor.Bright, ui.WarnBGColor.Code, ui.WarnBGColor.Bright)\n\tui.UI.Warn(message)\n\tct.ResetColor()\n}", "title": "" }, { "docid": "7b9a5cd64c59d791e294c8694df35ccf", "score": "0.48788095", "text": "func (lg *Logger) Warning(v interface{}) {\n\tlg.Log(logging.Warning, v)\n}", "title": "" }, { "docid": "7b9a5cd64c59d791e294c8694df35ccf", "score": "0.48788095", "text": "func (lg *Logger) Warning(v interface{}) {\n\tlg.Log(logging.Warning, v)\n}", "title": "" }, { "docid": "1aa21a4720b57320ef35536a0b908640", "score": "0.48648947", "text": "func Warning(message string, details ...string) {\n\tcolor.Warn.Println(\"!\", message)\n\tfor _, detail := range details {\n\t\tfmt.Println(\" \", detail)\n\t}\n\tos.Exit(1)\n}", "title": "" }, { "docid": "f416abf7f16bada63d45b35c5368316f", "score": "0.48567444", "text": "func (l *logger) Warning(msg interface{}) {\n\tl.log(l.stackDepth, Level_Warning, nil, msg)\n}", "title": "" }, { "docid": "11037c819774dbd9573724b1c367a3d7", "score": "0.48523468", "text": "func Warning(ctx context.Context, v interface{}) {\n\tLog(ctx, logging.Warning, v)\n}", "title": "" }, { "docid": "f4fa036e2eaa3c623d4f1b18bb8d9740", "score": "0.48512352", "text": "func (sl *StandardLogger) Warning(info, msg string) {\n\tsl.mutex.Lock()\n\tdefer sl.mutex.Unlock()\n\n\tio.WriteString(sl.out, time.Now().Format(timeFormat))\n\tio.WriteString(sl.out, \" [WARNING] \")\n\tio.WriteString(sl.out, info)\n\tio.WriteString(sl.out, \" \")\n\tio.WriteString(sl.out, msg)\n\tio.WriteString(sl.out, \"\\n\")\n}", "title": "" }, { "docid": "83243ff93fec735369be1316f60972db", "score": "0.48500994", "text": "func Warning(args ...interface{}) {\n\tLog.Warning(args...)\n}", "title": "" }, { "docid": "ed093d4b3325bf9d9217b1b8e7152484", "score": "0.48487443", "text": "func ShowInvalidConfigurationMessage(validationErr error) {\n\tif validationErr == nil {\n\t\treturn\n\t}\n\n\tshowAccessCorrection := ShowInvalidConfigMessageNoHelp(validationErr)\n\n\tprintfln(\"These errors can be corrected by editing the configuration in the main menu, or \"+\n\t\t\"by editing the configuration file directly at %v.\", fancy.WithBold(config.ATermConfigPath()))\n\n\tif showAccessCorrection {\n\t\tprintline(\"If you have lost your access key pair, you can generate a new pair from the ASHIRT servers.\")\n\t}\n}", "title": "" }, { "docid": "e707f5072eae1e73340ea6f67e465347", "score": "0.4843514", "text": "func (*nopProgress) PrintSubWarn(message string, args ...interface{}) {}", "title": "" }, { "docid": "f0029d6feefcd387a0f7811cea3b21e3", "score": "0.4843041", "text": "func Warning(ctx context.Context, name string, body interface{}) {\n\tlog(ctx, \"WARNING\", name, body)\n}", "title": "" }, { "docid": "9cc8e75407f7c96c303f025500238732", "score": "0.48413286", "text": "func (z *Zap) Warning(format string, opts ...Option) {\n\tz.Log(LevelWarning, format, opts...)\n}", "title": "" }, { "docid": "33001b69e54263682b1cf54cacfad4c7", "score": "0.48358086", "text": "func WarnValue() Value { return warnValue }", "title": "" }, { "docid": "4b4087b4c5660691e87da60c0aa2dd62", "score": "0.4820523", "text": "func (wh *Webhook) PrintWarning(text string) error {\n\te := embed{\n\t\tTitle: \"Warning\",\n\t\tDescription: text,\n\t\tColor: colorYellow,\n\t\tTimestamp: time.Now().Format(time.RFC3339),\n\t}\n\terr := wh.printEmbed(e)\n\treturn err\n}", "title": "" }, { "docid": "bb670ba1469845fe2dc9e2dcf8017f55", "score": "0.48188347", "text": "func PrintWarning(label, msg string) {\n\tfmt.Printf(\"%s %s\\n\", label, red(msg))\n}", "title": "" }, { "docid": "eda3ed660244171c86fa93ad1e7713ce", "score": "0.48166525", "text": "func Warning(format string, args ...interface{}) {\n\tfmt.Printf(\"\\x1b[33;1m%s\\x1b[0m\\n\", fmt.Sprintf(format, args...))\n}", "title": "" }, { "docid": "bcb3948639ca6a71c783f688ed4327dc", "score": "0.48118857", "text": "func (t LoggerType) Warning(args ...any) {\n\tt.stdout.Warning(args...)\n}", "title": "" }, { "docid": "306c93bc0d3d4ae186e8083df91fe36c", "score": "0.48101732", "text": "func (b *VersionGateBuilder) WarningMessage(value string) *VersionGateBuilder {\n\tb.warningMessage = value\n\tb.bitmap_ |= 1024\n\treturn b\n}", "title": "" }, { "docid": "19db6185f51afbf1f4162ff24a903eb9", "score": "0.4809138", "text": "func Warning(v ...interface{}) {\n\tlogger.Warning(v...)\n}", "title": "" }, { "docid": "19db6185f51afbf1f4162ff24a903eb9", "score": "0.4809138", "text": "func Warning(v ...interface{}) {\n\tlogger.Warning(v...)\n}", "title": "" }, { "docid": "f314bc418ef6da02a62c7f26b5c3f6d1", "score": "0.4797045", "text": "func Warning(m string, f ...interface{}) {\n\tLogger(color.FgYellow, m, f...)\n}", "title": "" }, { "docid": "95a9e87d9288c9a25659b0cab1706018", "score": "0.47924945", "text": "func AppWarning(f string, args ...interface{}) {\n\tif appWarning != nil {\n\t\tappWarning.SetPrefix(getCustomPrefix(appWarning))\n\t\tappWarning.Printf(f, args...)\n\t}\n}", "title": "" }, { "docid": "cdbb7f657b05cddf608063069302134c", "score": "0.47907236", "text": "func Warning(format string, args ...interface{}) {\n\tLog(\"warning\", format, args...)\n}", "title": "" }, { "docid": "b6ec0e590b7134c0a5239824e07340e7", "score": "0.47905606", "text": "func Warning(f interface{}, v ...interface{}) {\n\tbeeLogger.Warn(formatLog(f, v...))\n}", "title": "" }, { "docid": "3f38160aa5308aa7757064e0c00b061c", "score": "0.47873384", "text": "func (o *DhcpStatic6AddInput) SetWarnings(v string) {\n\to.Warnings = &v\n}", "title": "" } ]
9647b873210526979d097a3177472b54
DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be nonnil.
[ { "docid": "956cf55d48f143ef742927472e121616", "score": "0.0", "text": "func (in *ServiceEndpointPropertiesFormat) DeepCopyInto(out *ServiceEndpointPropertiesFormat) {\n\t*out = *in\n\tif in.Locations != nil {\n\t\tin, out := &in.Locations, &out.Locations\n\t\t*out = make([]string, len(*in))\n\t\tcopy(*out, *in)\n\t}\n}", "title": "" } ]
[ { "docid": "fd68cc5c404d65fa5c03c64949665da7", "score": "0.8091258", "text": "func (in *Size) DeepCopyInto(out *Size) {\n\t*out = *in\n\treturn\n}", "title": "" }, { "docid": "5d6e92034d401db11b2b4eda0e0eefd6", "score": "0.8070881", "text": "func (in *RunnerInfo) DeepCopyInto(out *RunnerInfo) {\n\t*out = *in\n\tif in.Args != nil {\n\t\tin, out := &in.Args, &out.Args\n\t\t*out = make([]string, len(*in))\n\t\tcopy(*out, *in)\n\t}\n\tif in.Command != nil {\n\t\tin, out := &in.Command, &out.Command\n\t\t*out = make([]string, len(*in))\n\t\tcopy(*out, *in)\n\t}\n\tif in.RunnerAnnotation != nil {\n\t\tin, out := &in.RunnerAnnotation, &out.RunnerAnnotation\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\treturn\n}", "title": "" }, { "docid": "d982116a7c640b8d4621f78e6466b9a1", "score": "0.806059", "text": "func (in *StoredinfotypeOutputPath) DeepCopyInto(out *StoredinfotypeOutputPath) {\n\t*out = *in\n\treturn\n}", "title": "" }, { "docid": "f8afb71c2d59991b1cbdec6b51f10ad2", "score": "0.8057425", "text": "func (in *ConsoleInfo) DeepCopyInto(out *ConsoleInfo) {\n\t*out = *in\n\treturn\n}", "title": "" }, { "docid": "ed9b5634248e3b7802ed71d4cc82b2de", "score": "0.8045185", "text": "func (in *Build) DeepCopyInto(out *Build) {\n\t*out = *in\n\treturn\n}", "title": "" }, { "docid": "30d5a6805fd4fa1a057ce4497fc7b0ff", "score": "0.8035287", "text": "func (in *Build) DeepCopyInto(out *Build) {\n\t*out = *in\n}", "title": "" }, { "docid": "c57a7585eb4b85fbf8808d7ab3ba88f0", "score": "0.80240715", "text": "func (in *All) DeepCopyInto(out *All) {\n\t*out = *in\n\treturn\n}", "title": "" }, { "docid": "e9cb500ebbcbb1ec1b2276e4a6ad7c35", "score": "0.8016839", "text": "func (in *FileSystemInfo) DeepCopyInto(out *FileSystemInfo) {\n\t*out = *in\n\treturn\n}", "title": "" }, { "docid": "5284c00a2adccb70e1714da995a5c3d2", "score": "0.8015457", "text": "func (in *Container) DeepCopyInto(out *Container) {\n\t*out = *in\n\tout.Args = in.Args\n}", "title": "" }, { "docid": "20c3698346fd243d8c96d1b906bf7cd4", "score": "0.80137444", "text": "func (in *MongoDBBackup) DeepCopyInto(out *MongoDBBackup) {\n\t*out = *in\n\treturn\n}", "title": "" }, { "docid": "64f7c5b12b50180e8fc16b78724a33b3", "score": "0.79968315", "text": "func (in *DebugInfo) DeepCopyInto(out *DebugInfo) {\n\t*out = *in\n}", "title": "" }, { "docid": "594e2c3bdd34c995d30cff3b3e04a3b4", "score": "0.79824257", "text": "func (in *Backup) DeepCopyInto(out *Backup) {\n\t*out = *in\n}", "title": "" }, { "docid": "169ad04de6c05bd0b231ad19df0d40da", "score": "0.7973427", "text": "func (in *Selection) DeepCopyInto(out *Selection) {\n\t*out = *in\n\tif in.UseAllDevices != nil {\n\t\tin, out := &in.UseAllDevices, &out.UseAllDevices\n\t\t*out = new(bool)\n\t\t**out = **in\n\t}\n\tif in.Directories != nil {\n\t\tin, out := &in.Directories, &out.Directories\n\t\t*out = make([]Directory, len(*in))\n\t\tcopy(*out, *in)\n\t}\n\treturn\n}", "title": "" }, { "docid": "dc25f670b9ab6635efd1a7f707841646", "score": "0.7972012", "text": "func (in *ObjectReference) DeepCopyInto(out *ObjectReference) {\n\t*out = *in\n}", "title": "" }, { "docid": "dc25f670b9ab6635efd1a7f707841646", "score": "0.7972012", "text": "func (in *ObjectReference) DeepCopyInto(out *ObjectReference) {\n\t*out = *in\n}", "title": "" }, { "docid": "dc25f670b9ab6635efd1a7f707841646", "score": "0.7972012", "text": "func (in *ObjectReference) DeepCopyInto(out *ObjectReference) {\n\t*out = *in\n}", "title": "" }, { "docid": "4c8e7738691e5fc814aa9f04e5a0beb0", "score": "0.7971891", "text": "func (in *DependentObjectReference) DeepCopyInto(out *DependentObjectReference) {\n\t*out = *in\n\treturn\n}", "title": "" }, { "docid": "c6b0eba8d2656b9cbfb96b38ddc4e4ca", "score": "0.7960137", "text": "func (in *MongoDBRestore) DeepCopyInto(out *MongoDBRestore) {\n\t*out = *in\n\treturn\n}", "title": "" }, { "docid": "fcd61e82f34db96b76efba6276644908", "score": "0.7958281", "text": "func (in *ObjectSelector) DeepCopyInto(out *ObjectSelector) {\n\t*out = *in\n\treturn\n}", "title": "" }, { "docid": "1d7086a38f14633785818609a374af11", "score": "0.7957679", "text": "func (in *HostAndPath) DeepCopyInto(out *HostAndPath) {\n\t*out = *in\n}", "title": "" }, { "docid": "d71a08ebbf7d7d2bc0c2ca3727a341a9", "score": "0.79561895", "text": "func (in *OCIContentID) DeepCopyInto(out *OCIContentID) {\n\t*out = *in\n\treturn\n}", "title": "" }, { "docid": "5a741ba8543bcaf0b5e12409151d4a6b", "score": "0.79516757", "text": "func (in *Konnect) DeepCopyInto(out *Konnect) {\n\t*out = *in\n\treturn\n}", "title": "" }, { "docid": "9c50266b4bf090dac9b6eddc2dd56fe1", "score": "0.7948328", "text": "func (in *S2i) DeepCopyInto(out *S2i) {\n\t*out = *in\n\treturn\n}", "title": "" }, { "docid": "3c51337658fc0e9d2966273bd3459022", "score": "0.7948139", "text": "func (in *ObjectReference) DeepCopyInto(out *ObjectReference) {\n\t*out = *in\n\treturn\n}", "title": "" }, { "docid": "3c51337658fc0e9d2966273bd3459022", "score": "0.7948139", "text": "func (in *ObjectReference) DeepCopyInto(out *ObjectReference) {\n\t*out = *in\n\treturn\n}", "title": "" }, { "docid": "3c51337658fc0e9d2966273bd3459022", "score": "0.7948139", "text": "func (in *ObjectReference) DeepCopyInto(out *ObjectReference) {\n\t*out = *in\n\treturn\n}", "title": "" }, { "docid": "33fc96978d0776f1e447efa87c0eae3f", "score": "0.79443806", "text": "func (in *Args) DeepCopyInto(out *Args) {\n\t*out = *in\n}", "title": "" }, { "docid": "a62d2491925276d66a89576351b7bdb4", "score": "0.7942119", "text": "func (in *Replicas) DeepCopyInto(out *Replicas) {\n\t*out = *in\n\treturn\n}", "title": "" }, { "docid": "5a06ad0ad03bce466da4cc53b9ab069a", "score": "0.7933315", "text": "func (in *PvcInfo) DeepCopyInto(out *PvcInfo) {\n\t*out = *in\n\treturn\n}", "title": "" }, { "docid": "04bd8ff77eb66f0d7482e20409a29ad4", "score": "0.7931695", "text": "func (in *Nexus) DeepCopyInto(out *Nexus) {\n\t*out = *in\n\treturn\n}", "title": "" }, { "docid": "9a15d89300bd7975c23b970cd7e97f3d", "score": "0.79291415", "text": "func (in *File) DeepCopyInto(out *File) {\n\t*out = *in\n\treturn\n}", "title": "" }, { "docid": "28b00a91c908578687857cdc8c46f4ee", "score": "0.7926144", "text": "func (in *TestflowStep) DeepCopyInto(out *TestflowStep) {\n\t*out = *in\n\tif in.Config != nil {\n\t\tin, out := &in.Config, &out.Config\n\t\t*out = make([]ConfigElement, len(*in))\n\t\tfor i := range *in {\n\t\t\t(*in)[i].DeepCopyInto(&(*out)[i])\n\t\t}\n\t}\n\treturn\n}", "title": "" }, { "docid": "64d18093ce59b818a52f1604bd3d0643", "score": "0.79252785", "text": "func (in *Copy) DeepCopyInto(out *Copy) {\n\t*out = *in\n\treturn\n}", "title": "" }, { "docid": "fa638bb1ac9efb6a5f0ef2e594d2d3c2", "score": "0.792337", "text": "func (in *Check) DeepCopyInto(out *Check) {\n\t*out = *in\n}", "title": "" }, { "docid": "b757333658adc8c28495b373c70cdd61", "score": "0.7922698", "text": "func (in *CPUAndMem) DeepCopyInto(out *CPUAndMem) {\n\t*out = *in\n}", "title": "" }, { "docid": "aaeed9dbebc681d54de1c8c2058fad47", "score": "0.7919464", "text": "func (in *PropertyValue) DeepCopyInto(out *PropertyValue) {\n\t*out = *in\n}", "title": "" }, { "docid": "92a781c52ce2acbaf732790f97243de0", "score": "0.7917086", "text": "func (in *AddonObject) DeepCopyInto(out *AddonObject) {\n\t*out = *in\n\treturn\n}", "title": "" }, { "docid": "79e328959883a47a6974d28ff0091ef3", "score": "0.79163694", "text": "func (in *NetcatResult) DeepCopyInto(out *NetcatResult) {\n\t*out = *in\n\treturn\n}", "title": "" }, { "docid": "1fb65e67bcc01531c8fbbd94912d7379", "score": "0.79147154", "text": "func (in *DotConfig) DeepCopyInto(out *DotConfig) {\n\t*out = *in\n}", "title": "" }, { "docid": "c33d03bd1dd1387c878363147f87efb5", "score": "0.79129016", "text": "func (in *NetworkVshpereOpts) DeepCopyInto(out *NetworkVshpereOpts) {\n\t*out = *in\n\treturn\n}", "title": "" }, { "docid": "ebde97abbe9aa8149c7ca6159e15bd33", "score": "0.79029006", "text": "func (in *CPUAndMem) DeepCopyInto(out *CPUAndMem) {\n\t*out = *in\n\treturn\n}", "title": "" }, { "docid": "33f5df736c2936ad4e31771a61e88775", "score": "0.7901277", "text": "func (in *MysqlVersion) DeepCopyInto(out *MysqlVersion) {\n\t*out = *in\n}", "title": "" }, { "docid": "619b2a77ef3bb1471e6a23e586917386", "score": "0.79001755", "text": "func (in *CABundleDestination) DeepCopyInto(out *CABundleDestination) {\n\t*out = *in\n\treturn\n}", "title": "" }, { "docid": "f10759a9e3b4b70095a75a8f29f6d525", "score": "0.7897198", "text": "func (in *DeidentifytemplateUnwrapped) DeepCopyInto(out *DeidentifytemplateUnwrapped) {\n\t*out = *in\n\treturn\n}", "title": "" }, { "docid": "dddf435977ebcd6bfaf0b4c062ea8042", "score": "0.78915954", "text": "func (in *Image) DeepCopyInto(out *Image) {\n\t*out = *in\n}", "title": "" }, { "docid": "dddf435977ebcd6bfaf0b4c062ea8042", "score": "0.78915954", "text": "func (in *Image) DeepCopyInto(out *Image) {\n\t*out = *in\n}", "title": "" }, { "docid": "dddf435977ebcd6bfaf0b4c062ea8042", "score": "0.78915954", "text": "func (in *Image) DeepCopyInto(out *Image) {\n\t*out = *in\n}", "title": "" }, { "docid": "dfbb452b64d186c585249239d1b0a5c2", "score": "0.78894186", "text": "func (in *PublishTask) DeepCopyInto(out *PublishTask) {\n\t*out = *in\n\tout.Registry = in.Registry\n}", "title": "" }, { "docid": "23db226639df1ec5bfce6ed220d55ed3", "score": "0.7887173", "text": "func (in *Port) DeepCopyInto(out *Port) {\n\t*out = *in\n}", "title": "" }, { "docid": "23db226639df1ec5bfce6ed220d55ed3", "score": "0.7887173", "text": "func (in *Port) DeepCopyInto(out *Port) {\n\t*out = *in\n}", "title": "" }, { "docid": "d5ca2454336c8c33ddb7dcd75d173870", "score": "0.78862524", "text": "func (in *NodePoolInfo) DeepCopyInto(out *NodePoolInfo) {\n\t*out = *in\n\treturn\n}", "title": "" }, { "docid": "84d6746ddc264a1fefeb930f6dc9a54d", "score": "0.7882974", "text": "func (in *IngestMatch) DeepCopyInto(out *IngestMatch) {\n\t*out = *in\n\treturn\n}", "title": "" }, { "docid": "ae169a241fc750d6d99542ca8b2b06d1", "score": "0.7881722", "text": "func (in *BaseTask) DeepCopyInto(out *BaseTask) {\n\t*out = *in\n}", "title": "" }, { "docid": "7e6f9d20adbbec72ed85dde045cc014d", "score": "0.7877334", "text": "func (in *Partition) DeepCopyInto(out *Partition) {\n\t*out = *in\n\tout.FileSystem = in.FileSystem\n\treturn\n}", "title": "" }, { "docid": "f62c6fe6c0b72d76d8dcc28816c39d82", "score": "0.78756416", "text": "func (in *AquaEnforcerDetailes) DeepCopyInto(out *AquaEnforcerDetailes) {\n\t*out = *in\n}", "title": "" }, { "docid": "fa756ae28922fed925a87b236587b156", "score": "0.7874991", "text": "func (in *Git) DeepCopyInto(out *Git) {\n\t*out = *in\n}", "title": "" }, { "docid": "5c083f2a30b5b88fd1b331509f358f56", "score": "0.78734577", "text": "func (in *Directory) DeepCopyInto(out *Directory) {\n\t*out = *in\n\treturn\n}", "title": "" }, { "docid": "fbac25d82e819c2fbf45aff98d19462c", "score": "0.7868266", "text": "func (in *PingResult) DeepCopyInto(out *PingResult) {\n\t*out = *in\n\treturn\n}", "title": "" }, { "docid": "1e1088954cae99b323e1b34730ad0490", "score": "0.7865558", "text": "func (in *Proxy) DeepCopyInto(out *Proxy) {\n\t*out = *in\n}", "title": "" }, { "docid": "5186b8d1bfd3abf2fb983694f27e4aed", "score": "0.78650343", "text": "func (in *Image) DeepCopyInto(out *Image) {\n\t*out = *in\n\treturn\n}", "title": "" }, { "docid": "5186b8d1bfd3abf2fb983694f27e4aed", "score": "0.78650343", "text": "func (in *Image) DeepCopyInto(out *Image) {\n\t*out = *in\n\treturn\n}", "title": "" }, { "docid": "3131169e9b81994ea411b95e66f60963", "score": "0.7858105", "text": "func (in *MysqldImage) DeepCopyInto(out *MysqldImage) {\n\t*out = *in\n}", "title": "" }, { "docid": "b8c57c3a0f2dfa74226b698b7b8ad2e4", "score": "0.78514296", "text": "func (in *Snapshot) DeepCopyInto(out *Snapshot) {\n\t*out = *in\n\treturn\n}", "title": "" }, { "docid": "170ddf2575c007ccb3fc0068b04801fb", "score": "0.7849724", "text": "func (in *MemoryGibPerVcpuObservation) DeepCopyInto(out *MemoryGibPerVcpuObservation) {\n\t*out = *in\n}", "title": "" }, { "docid": "8f77db9449d807b50cf35ec73f5fcbce", "score": "0.78479207", "text": "func (in *Pool) DeepCopyInto(out *Pool) {\n\t*out = *in\n\treturn\n}", "title": "" }, { "docid": "768111c725e3f5f5235079124e0a96f5", "score": "0.7845771", "text": "func (in *Workspace) DeepCopyInto(out *Workspace) {\n\t*out = *in\n\treturn\n}", "title": "" }, { "docid": "36a32ca70ca4f4d6247817020e0c08f1", "score": "0.7845325", "text": "func (o *Root) DeepCopyInto(out *Root) {\n\n\ttarget, err := copystructure.Copy(o)\n\tif err != nil {\n\t\tpanic(fmt.Sprintf(\"Unable to deepcopy Root: %s\", err))\n\t}\n\n\t*out = *target.(*Root)\n}", "title": "" }, { "docid": "f4587e0baa95f420bd0dba802ecd256c", "score": "0.78377384", "text": "func (in *Proxy) DeepCopyInto(out *Proxy) {\n\t*out = *in\n\treturn\n}", "title": "" }, { "docid": "60bb9d5b70e5ef6b1701bd732fca2874", "score": "0.78375626", "text": "func (in *DebugOptions) DeepCopyInto(out *DebugOptions) {\n\t*out = *in\n\treturn\n}", "title": "" }, { "docid": "8a90fa08f4b62c55c837bba9860098d3", "score": "0.7837288", "text": "func (in *Flow) DeepCopyInto(out *Flow) {\n\t*out = *in\n\treturn\n}", "title": "" }, { "docid": "6af44f744e22e8c655f8c2045f82edd7", "score": "0.7836707", "text": "func (in *ImageBase) DeepCopyInto(out *ImageBase) {\n\t*out = *in\n}", "title": "" }, { "docid": "311404ea3ee92f40e4221355ddad6dfd", "score": "0.7833919", "text": "func (in *PortCheck) DeepCopyInto(out *PortCheck) {\n\t*out = *in\n\treturn\n}", "title": "" }, { "docid": "09e260a9495f25232a2f6fb9adfde18d", "score": "0.7833606", "text": "func (in *BundleObjectReference) DeepCopyInto(out *BundleObjectReference) {\n\t*out = *in\n\treturn\n}", "title": "" }, { "docid": "ac7d637e82c210b8470a3e45007e7831", "score": "0.78326166", "text": "func (in *ContainerRuntime) DeepCopyInto(out *ContainerRuntime) {\n\t*out = *in\n\treturn\n}", "title": "" }, { "docid": "3727ea7357660f79348fd63217d4649b", "score": "0.7829739", "text": "func (in *Version) DeepCopyInto(out *Version) {\n\t*out = *in\n\tif in.Created != nil {\n\t\tin, out := &in.Created, &out.Created\n\t\t*out = new(intstr.IntOrString)\n\t\t**out = **in\n\t}\n\treturn\n}", "title": "" }, { "docid": "83ff2746330e827c5ffb7cb92d668e4f", "score": "0.7826496", "text": "func (in *StepOutput) DeepCopyInto(out *StepOutput) {\n\t*out = *in\n\tif in.Labels != nil {\n\t\tin, out := &in.Labels, &out.Labels\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.parsedUrl != nil {\n\t\tout.parsedUrl = DeepCopyUrl(in.parsedUrl)\n\t}\n\treturn\n}", "title": "" }, { "docid": "b97dabd2033a257ea967ae09454b7ca3", "score": "0.78241146", "text": "func (in *ChaosResultSpec) DeepCopyInto(out *ChaosResultSpec) {\n\t*out = *in\n\treturn\n}", "title": "" }, { "docid": "6c5428e893310edb09bf8bfeb46297b4", "score": "0.7822216", "text": "func (in *Info) DeepCopyInto(out *Info) {\n\t*out = *in\n\tif in.AvailableClusterVersions != nil {\n\t\tin, out := &in.AvailableClusterVersions, &out.AvailableClusterVersions\n\t\t*out = make([]string, len(*in))\n\t\tcopy(*out, *in)\n\t}\n\tif in.SupportedClusterVersions != nil {\n\t\tin, out := &in.SupportedClusterVersions, &out.SupportedClusterVersions\n\t\t*out = make([]string, len(*in))\n\t\tcopy(*out, *in)\n\t}\n\treturn\n}", "title": "" }, { "docid": "2abf1d56e28a21e208ed94abae3e2540", "score": "0.78220356", "text": "func (in *NodeParams) DeepCopyInto(out *NodeParams) {\n\t*out = *in\n\treturn\n}", "title": "" }, { "docid": "9d83cc4f04161818cdf7da63378fa24b", "score": "0.7816533", "text": "func (in *FDocument) DeepCopyInto(out *FDocument) {\n\t*out = *in\n\tif in.ID != nil {\n\t\tin, out := &in.ID, &out.ID\n\t\t*out = new(string)\n\t\t**out = **in\n\t}\n\tif in.Path != nil {\n\t\tin, out := &in.Path, &out.Path\n\t\t*out = new(string)\n\t\t**out = **in\n\t}\n\tif in.Published != nil {\n\t\tin, out := &in.Published, &out.Published\n\t\t*out = new(bool)\n\t\t**out = **in\n\t}\n\tif in.Content != nil {\n\t\tin, out := &in.Content, &out.Content\n\t\t*out = new(string)\n\t\t**out = **in\n\t}\n\treturn\n}", "title": "" }, { "docid": "b16819350d4dbfa0a5a19961dffe66e9", "score": "0.7809596", "text": "func (in *ArangoBackupProgress) DeepCopyInto(out *ArangoBackupProgress) {\n\t*out = *in\n\treturn\n}", "title": "" }, { "docid": "1ab7dccf8a6a22edbbc3cbaf437ba91c", "score": "0.78094774", "text": "func (in *OneAgentProxy) DeepCopyInto(out *OneAgentProxy) {\n\t*out = *in\n\treturn\n}", "title": "" }, { "docid": "46827d00f1b80e33018751dea427d715", "score": "0.7809158", "text": "func (in *DataSourceObject) DeepCopyInto(out *DataSourceObject) {\n\t*out = *in\n\tif in.Properties != nil {\n\t\tin, out := &in.Properties, &out.Properties\n\t\t*out = make([]v1.EnvVar, len(*in))\n\t\tfor i := range *in {\n\t\t\t(*in)[i].DeepCopyInto(&(*out)[i])\n\t\t}\n\t}\n\treturn\n}", "title": "" }, { "docid": "3500f1895e195cb0ab50f3e97e4f91e4", "score": "0.78088176", "text": "func (in *AutoDelete) DeepCopyInto(out *AutoDelete) {\n\t*out = *in\n}", "title": "" }, { "docid": "768a732f575798df884d6452e16c6b7f", "score": "0.78055817", "text": "func (in *DeepOne) DeepCopyInto(out *DeepOne) {\n\t*out = *in\n\tout.TypeMeta = in.TypeMeta\n\tin.ObjectMeta.DeepCopyInto(&out.ObjectMeta)\n\tin.Spec.DeepCopyInto(&out.Spec)\n\tout.Status = in.Status\n\treturn\n}", "title": "" }, { "docid": "06564a8f4dc1e0b6ccdd0a451e6ce4c9", "score": "0.78037393", "text": "func (in *APIProperty) DeepCopyInto(out *APIProperty) {\n\t*out = *in\n\treturn\n}", "title": "" }, { "docid": "01b508f74eb653d3628e69f3ddedcd2a", "score": "0.780226", "text": "func (in *Destination) DeepCopyInto(out *Destination) {\n\t*out = *in\n\treturn\n}", "title": "" }, { "docid": "01b508f74eb653d3628e69f3ddedcd2a", "score": "0.780226", "text": "func (in *Destination) DeepCopyInto(out *Destination) {\n\t*out = *in\n\treturn\n}", "title": "" }, { "docid": "1f4d6f97d1ffe46d909d150e1cc77749", "score": "0.7801589", "text": "func (in *External) DeepCopyInto(out *External) {\n\t*out = *in\n\treturn\n}", "title": "" }, { "docid": "b7e7523fde1137751076e56a8a3a711e", "score": "0.77989304", "text": "func (in *RbacConfigTarget) DeepCopyInto(out *RbacConfigTarget) {\n\t*out = *in\n\tif in.Services != nil {\n\t\tin, out := &in.Services, &out.Services\n\t\t*out = make([]string, len(*in))\n\t\tcopy(*out, *in)\n\t}\n\tif in.Namespaces != nil {\n\t\tin, out := &in.Namespaces, &out.Namespaces\n\t\t*out = make([]string, len(*in))\n\t\tcopy(*out, *in)\n\t}\n\treturn\n}", "title": "" }, { "docid": "88999343056500ee781727902f489eca", "score": "0.77972376", "text": "func (in *Global) DeepCopyInto(out *Global) {\n\t*out = *in\n\tout.IdentityContext = in.IdentityContext\n}", "title": "" }, { "docid": "db315275db75fe989c440fd49d503f25", "score": "0.779456", "text": "func (in *Addon) DeepCopyInto(out *Addon) {\n\t*out = *in\n\tif in.Params != nil {\n\t\tin, out := &in.Params, &out.Params\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.Deps != nil {\n\t\tin, out := &in.Deps, &out.Deps\n\t\t*out = make([]string, len(*in))\n\t\tcopy(*out, *in)\n\t}\n\treturn\n}", "title": "" }, { "docid": "3fd37fa0a6e40b0c2c4b4779ff65d42b", "score": "0.77938616", "text": "func (in *Selector) DeepCopyInto(out *Selector) {\n\t*out = *in\n}", "title": "" }, { "docid": "c7e1d612f3613418287025d9beb75ebd", "score": "0.7793489", "text": "func (in *NamespacedName) DeepCopyInto(out *NamespacedName) {\n\t*out = *in\n}", "title": "" }, { "docid": "89c71347df6fe684a106ecc7aafaec49", "score": "0.7791363", "text": "func (in *UpdateStrategyDelayedRollingUpdate) DeepCopyInto(out *UpdateStrategyDelayedRollingUpdate) {\n\t*out = *in\n}", "title": "" }, { "docid": "34c8aebd15f9b68121362b956de82e91", "score": "0.77844346", "text": "func (in *LocalReferenceByKindAndName) DeepCopyInto(out *LocalReferenceByKindAndName) {\n\t*out = *in\n\treturn\n}", "title": "" }, { "docid": "fabdc2e250a855e2774e0355dc7af71e", "score": "0.77835834", "text": "func (in *Depth) DeepCopyInto(out *Depth) {\n\t*out = *in\n\tif in.Limit != nil {\n\t\tin, out := &in.Limit, &out.Limit\n\t\t*out = new(intstr.IntOrString)\n\t\t**out = **in\n\t}\n\treturn\n}", "title": "" }, { "docid": "7f23713ad64a40a5dcef1f163fd06673", "score": "0.7782143", "text": "func (in *VMSpec) DeepCopyInto(out *VMSpec) {\n\t*out = *in\n\tif in.Zone != nil {\n\t\tin, out := &in.Zone, &out.Zone\n\t\t*out = new(string)\n\t\t**out = **in\n\t}\n\tif in.CustomData != nil {\n\t\tin, out := &in.CustomData, &out.CustomData\n\t\t*out = new(string)\n\t\t**out = **in\n\t}\n\tif in.SecondaryNICs != nil {\n\t\tin, out := &in.SecondaryNICs, &out.SecondaryNICs\n\t\t*out = new([]string)\n\t\tif **in != nil {\n\t\t\tin, out := *in, *out\n\t\t\t*out = make([]string, len(*in))\n\t\t\tcopy(*out, *in)\n\t\t}\n\t}\n}", "title": "" }, { "docid": "30dacc7875f9f591955fc2c63075047c", "score": "0.7782028", "text": "func (in *DiskVsphereOpts) DeepCopyInto(out *DiskVsphereOpts) {\n\t*out = *in\n\treturn\n}", "title": "" }, { "docid": "42fa4c83c011b43eb1801b15f7a029c9", "score": "0.77817357", "text": "func (in *SamplePointerSubElem) DeepCopyInto(out *SamplePointerSubElem) {\n\t*out = *in\n\treturn\n}", "title": "" }, { "docid": "2c491c9c7a7bfdaf851a1ae13fa61785", "score": "0.7780803", "text": "func (in *Addon) DeepCopyInto(out *Addon) {\n\t*out = *in\n\tif in.AddonObjects != nil {\n\t\tin, out := &in.AddonObjects, &out.AddonObjects\n\t\t*out = make([]AddonObject, len(*in))\n\t\tcopy(*out, *in)\n\t}\n\treturn\n}", "title": "" } ]
942bc6632982c731398981e1284e134c
QueryAllVolume returns all volumes matching the given filter and selection.
[ { "docid": "3615633356d65ee0b36020852cc11e92", "score": "0.79729694", "text": "func (m *defaultManager) QueryAllVolume(ctx context.Context, queryFilter cnstypes.CnsQueryFilter,\n\tquerySelection cnstypes.CnsQuerySelection) (*cnstypes.CnsQueryResult, error) {\n\tctx, cancelFunc := ensureOperationContextHasATimeout(ctx)\n\tdefer cancelFunc()\n\tinternalQueryAllVolume := func() (*cnstypes.CnsQueryResult, error) {\n\t\tlog := logger.GetLogger(ctx)\n\t\terr := validateManager(ctx, m)\n\t\tif err != nil {\n\t\t\treturn nil, err\n\t\t}\n\t\t// Set up the VC connection.\n\t\terr = m.virtualCenter.ConnectCns(ctx)\n\t\tif err != nil {\n\t\t\tlog.Errorf(\"ConnectCns failed with err: %+v\", err)\n\t\t\treturn nil, err\n\t\t}\n\t\t// Call the CNS QueryAllVolume.\n\t\tres, err := m.virtualCenter.CnsClient.QueryAllVolume(ctx, queryFilter, querySelection)\n\t\tif err != nil {\n\t\t\tlog.Errorf(\"CNS QueryAllVolume failed from vCenter %q with err: %v\", m.virtualCenter.Config.Host, err)\n\t\t\treturn nil, err\n\t\t}\n\t\tres = updateQueryResult(ctx, m, res)\n\t\treturn res, err\n\t}\n\tstart := time.Now()\n\tresp, err := internalQueryAllVolume()\n\tif err != nil {\n\t\tprometheus.CnsControlOpsHistVec.WithLabelValues(prometheus.PrometheusCnsQueryAllVolumeOpType,\n\t\t\tprometheus.PrometheusFailStatus).Observe(time.Since(start).Seconds())\n\t} else {\n\t\tprometheus.CnsControlOpsHistVec.WithLabelValues(prometheus.PrometheusCnsQueryAllVolumeOpType,\n\t\t\tprometheus.PrometheusPassStatus).Observe(time.Since(start).Seconds())\n\t}\n\treturn resp, err\n}", "title": "" } ]
[ { "docid": "78b1549fc59622fa2a410a51652d0c3b", "score": "0.65170753", "text": "func (q volumeStateQuery) All() (VolumeStateSlice, error) {\n\tvar o VolumeStateSlice\n\n\terr := q.Bind(&o)\n\tif err != nil {\n\t\treturn nil, errors.Wrap(err, \"public: failed to assign all query results to VolumeState slice\")\n\t}\n\n\tif len(volumeStateAfterSelectHooks) != 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": "ee7bfa7136560708eb2093ab04b02c73", "score": "0.64962626", "text": "func (q volumeAccessQuery) All() (VolumeAccessSlice, error) {\n\tvar o VolumeAccessSlice\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 VolumeAccess slice\")\n\t}\n\n\tif len(volumeAccessAfterSelectHooks) != 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": "4ba0ea422258d1b20f9fff9febb37fce", "score": "0.63439476", "text": "func (q volumeFundingQuery) All() (VolumeFundingSlice, error) {\n\tvar o VolumeFundingSlice\n\n\terr := q.Bind(&o)\n\tif err != nil {\n\t\treturn nil, errors.Wrap(err, \"public: failed to assign all query results to VolumeFunding slice\")\n\t}\n\n\tif len(volumeFundingAfterSelectHooks) != 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": "80a9aa7a07a81651b04860d6719560d6", "score": "0.6208214", "text": "func (s *SQLiteState) AllVolumes() ([]*Volume, error) {\n\tif !s.valid {\n\t\treturn nil, define.ErrDBClosed\n\t}\n\n\trows, err := s.conn.Query(\"SELECT JSON FROM VolumeConfig;\")\n\tif err != nil {\n\t\treturn nil, fmt.Errorf(\"querying database for all volumes: %w\", err)\n\t}\n\tdefer rows.Close()\n\n\tvar volumes []*Volume\n\n\tfor rows.Next() {\n\t\tvar configJSON string\n\t\tif err := rows.Scan(&configJSON); err != nil {\n\t\t\treturn nil, fmt.Errorf(\"scanning volume config from database: %w\", err)\n\t\t}\n\t\tvol := new(Volume)\n\t\tvol.config = new(VolumeConfig)\n\t\tvol.state = new(VolumeState)\n\t\tvol.runtime = s.runtime\n\n\t\tif err := json.Unmarshal([]byte(configJSON), vol.config); err != nil {\n\t\t\treturn nil, fmt.Errorf(\"unmarshalling volume config: %w\", err)\n\t\t}\n\n\t\tif err := finalizeVolumeSqlite(vol); err != nil {\n\t\t\treturn nil, err\n\t\t}\n\n\t\tvolumes = append(volumes, vol)\n\t}\n\tif err := rows.Err(); err != nil {\n\t\treturn nil, err\n\t}\n\n\treturn volumes, nil\n}", "title": "" }, { "docid": "3569125bae5e30ce82149e06670f6312", "score": "0.6124166", "text": "func (v *Vsphere) GetAllVolumes(ctx *Context) (*[]NanosVolume, error) {\n\treturn nil, nil\n}", "title": "" }, { "docid": "cf0ce1c3030f9d7e63b6eda04a374af4", "score": "0.58890724", "text": "func (m *defaultManager) QueryVolume(ctx context.Context,\n\tqueryFilter cnstypes.CnsQueryFilter) (*cnstypes.CnsQueryResult, error) {\n\tctx, cancelFunc := ensureOperationContextHasATimeout(ctx)\n\tdefer cancelFunc()\n\tinternalQueryVolume := func() (*cnstypes.CnsQueryResult, error) {\n\t\tlog := logger.GetLogger(ctx)\n\t\terr := validateManager(ctx, m)\n\t\tif err != nil {\n\t\t\treturn nil, err\n\t\t}\n\t\t// Set up the VC connection.\n\t\terr = m.virtualCenter.ConnectCns(ctx)\n\t\tif err != nil {\n\t\t\tlog.Errorf(\"ConnectCns failed with err: %+v\", err)\n\t\t\treturn nil, err\n\t\t}\n\t\t// Call the CNS QueryVolume.\n\t\tres, err := m.virtualCenter.CnsClient.QueryVolume(ctx, queryFilter)\n\t\tif err != nil {\n\t\t\tlog.Errorf(\"CNS QueryVolume failed from vCenter %q with err: %v\", m.virtualCenter.Config.Host, err)\n\t\t\treturn nil, err\n\t\t}\n\t\tres = updateQueryResult(ctx, m, res)\n\t\treturn res, err\n\t}\n\tstart := time.Now()\n\tresp, err := internalQueryVolume()\n\tif err != nil {\n\t\tprometheus.CnsControlOpsHistVec.WithLabelValues(prometheus.PrometheusCnsQueryVolumeOpType,\n\t\t\tprometheus.PrometheusFailStatus).Observe(time.Since(start).Seconds())\n\t} else {\n\t\tprometheus.CnsControlOpsHistVec.WithLabelValues(prometheus.PrometheusCnsQueryVolumeOpType,\n\t\t\tprometheus.PrometheusPassStatus).Observe(time.Since(start).Seconds())\n\t}\n\treturn resp, err\n}", "title": "" }, { "docid": "9dd6c34cae6a772e7a85ce7e3d88f2ef", "score": "0.5884517", "text": "func (c *ClientConnection) Volumes(search ...string) ([]Volume, error) {\n\targs := make(map[string]interface{})\n\tvar volumes []Volume\n\n\tif !handleSearch(args, search) {\n\t\treturn make([]Volume, 0), &errors.LsmError{\n\t\t\tCode: errors.InvalidArgument,\n\t\t\tMessage: fmt.Sprintf(\n\t\t\t\t\"volume supports 0 or 2 search parameters (key, value), provide %d\", len(search)),\n\t\t\tData: \"\"}\n\t}\n\n\treturn volumes, c.tp.invoke(\"volumes\", args, &volumes)\n}", "title": "" }, { "docid": "422cf1a337368038408b7c65d10a62d9", "score": "0.57943547", "text": "func (c *K8sOrchestrator) GetAllVolumes() []string {\n\tvolumeIDs := make([]string, 0)\n\tfor volumeID := range c.volumeIDToPvcMap.items {\n\t\tvolumeIDs = append(volumeIDs, volumeID)\n\t}\n\treturn volumeIDs\n}", "title": "" }, { "docid": "0fa56463dafe07b315c484f0e0966489", "score": "0.57706964", "text": "func (p *Provider) GetAllVolumes(ctx *lepton.Context) (vols *[]lepton.NanosVolume, err error) {\n\treturn nil, errors.New(\"Unsupported\")\n\n\tlistVolumesResponse, err := p.blockstorageClient.ListVolumes(context.TODO(), core.ListVolumesRequest{CompartmentId: &p.compartmentID})\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\tvols = &[]lepton.NanosVolume{}\n\n\tfor _, v := range listVolumesResponse.Items {\n\t\tif checkHasOpsTags(v.FreeformTags) {\n\t\t\t*vols = append(*vols, lepton.NanosVolume{\n\t\t\t\tID: *v.Id,\n\t\t\t\tName: *v.DisplayName,\n\t\t\t\tStatus: string(v.LifecycleState),\n\t\t\t\tSize: strconv.Itoa(int(*v.SizeInGBs)),\n\t\t\t\tCreatedAt: lepton.Time2Human(v.TimeCreated.Time),\n\t\t\t})\n\t\t}\n\t}\n\n\treturn\n}", "title": "" }, { "docid": "a5e5f9b7045a7c30fae8a4b0f7a67103", "score": "0.5702324", "text": "func (volumeApi *VolumeApi) List() ([]Volume, error) {\n\treturn volumeApi.ListWithOptions(map[string]string{})\n}", "title": "" }, { "docid": "d0a2cf32dd2986e2bfb5d6cb55ae79e6", "score": "0.54536253", "text": "func (a *Client) ListVolumeSearch(params *ListVolumeSearchParams, authInfo runtime.ClientAuthInfoWriter) (*ListVolumeSearchOK, error) {\n\t// TODO: Validate the params before sending\n\tif params == nil {\n\t\tparams = NewListVolumeSearchParams()\n\t}\n\n\tresult, err := a.transport.Submit(&runtime.ClientOperation{\n\t\tID: \"ListVolumeSearch\",\n\t\tMethod: \"GET\",\n\t\tPathPattern: \"/block/volumes/search.json\",\n\t\tProducesMediaTypes: []string{\"application/json\", \"application/x-gzip\"},\n\t\tConsumesMediaTypes: []string{\"application/json\"},\n\t\tSchemes: []string{\"http\", \"https\"},\n\t\tParams: params,\n\t\tReader: &ListVolumeSearchReader{formats: a.formats},\n\t\tAuthInfo: authInfo,\n\t})\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\treturn result.(*ListVolumeSearchOK), nil\n}", "title": "" }, { "docid": "186a9b01653b19765b0ffdad5ded9a7d", "score": "0.5435864", "text": "func (m *defaultManager) QueryVolumeInfo(ctx context.Context,\n\tvolumeIDList []cnstypes.CnsVolumeId) (*cnstypes.CnsQueryVolumeInfoResult, error) {\n\tctx, cancelFunc := ensureOperationContextHasATimeout(ctx)\n\tdefer cancelFunc()\n\tinternalQueryVolumeInfo := func() (*cnstypes.CnsQueryVolumeInfoResult, error) {\n\t\tlog := logger.GetLogger(ctx)\n\t\terr := validateManager(ctx, m)\n\t\tif err != nil {\n\t\t\treturn nil, err\n\t\t}\n\t\t// Set up the VC connection.\n\t\terr = m.virtualCenter.ConnectCns(ctx)\n\t\tif err != nil {\n\t\t\tlog.Errorf(\"ConnectCns failed with err: %+v\", err)\n\t\t\treturn nil, err\n\t\t}\n\t\t// Call the CNS QueryVolumeInfo.\n\t\tqueryVolumeInfoTask, err := m.virtualCenter.CnsClient.QueryVolumeInfo(ctx, volumeIDList)\n\t\tif err != nil {\n\t\t\tlog.Errorf(\"CNS QueryAllVolume failed from vCenter %q with err: %v\", m.virtualCenter.Config.Host, err)\n\t\t\treturn nil, err\n\t\t}\n\n\t\t// Get the taskInfo.\n\t\tvar taskInfo *vim25types.TaskInfo\n\t\tif m.tasksListViewEnabled {\n\t\t\ttaskInfo, err = m.waitOnTask(ctx, queryVolumeInfoTask.Reference())\n\t\t} else {\n\t\t\ttaskInfo, err = cns.GetTaskInfo(ctx, queryVolumeInfoTask)\n\t\t}\n\t\tif err != nil || taskInfo == nil {\n\t\t\tlog.Errorf(\"failed to get QueryVolumeInfo taskInfo from vCenter %q with err: %v\",\n\t\t\t\tm.virtualCenter.Config.Host, err)\n\t\t\treturn nil, err\n\t\t}\n\t\tlog.Infof(\"QueryVolumeInfo: volumeIDList: %v, opId: %q\", volumeIDList, taskInfo.ActivationId)\n\t\t// Get the task results for the given task.\n\t\ttaskResult, err := cns.GetTaskResult(ctx, taskInfo)\n\t\tif err != nil {\n\t\t\tlog.Errorf(\"unable to find QueryVolumeInfo task result from vCenter %q: taskID %s and result %v\",\n\t\t\t\tm.virtualCenter.Config.Host, taskInfo.Task.Value, taskResult)\n\t\t\treturn nil, err\n\t\t}\n\t\tif taskResult == nil {\n\t\t\treturn nil, logger.LogNewErrorf(log, \"taskResult is empty for DeleteVolume task: %q, opID: %q\",\n\t\t\t\ttaskInfo.Task.Value, taskInfo.ActivationId)\n\t\t}\n\t\tvolumeOperationRes := taskResult.GetCnsVolumeOperationResult()\n\t\tif volumeOperationRes.Fault != nil {\n\t\t\treturn nil, logger.LogNewErrorf(log, \"failed to Query volumes: %v, fault: %q, opID: %q\",\n\t\t\t\tvolumeIDList, spew.Sdump(volumeOperationRes.Fault), taskInfo.ActivationId)\n\t\t}\n\t\tvolumeInfoResult := interface{}(taskResult).(*cnstypes.CnsQueryVolumeInfoResult)\n\t\tlog.Infof(\"QueryVolumeInfo successfully returned volumeInfo volumeIDList %v:, opId: %q\",\n\t\t\tvolumeIDList, taskInfo.ActivationId)\n\t\treturn volumeInfoResult, nil\n\t}\n\tstart := time.Now()\n\tresp, err := internalQueryVolumeInfo()\n\tif err != nil {\n\t\tprometheus.CnsControlOpsHistVec.WithLabelValues(prometheus.PrometheusCnsQueryVolumeInfoOpType,\n\t\t\tprometheus.PrometheusFailStatus).Observe(time.Since(start).Seconds())\n\t} else {\n\t\tprometheus.CnsControlOpsHistVec.WithLabelValues(prometheus.PrometheusCnsQueryVolumeInfoOpType,\n\t\t\tprometheus.PrometheusPassStatus).Observe(time.Since(start).Seconds())\n\t}\n\treturn resp, err\n}", "title": "" }, { "docid": "e77cdd29400af6e7408aebba8f513e89", "score": "0.5403885", "text": "func (q storageQuery) All(exec boil.Executor) (StorageSlice, error) {\n\tvar o []*Storage\n\n\terr := q.Bind(nil, exec, &o)\n\tif err != nil {\n\t\treturn nil, errors.Wrap(err, \"mdbmodels: failed to assign all query results to Storage slice\")\n\t}\n\n\treturn o, nil\n}", "title": "" }, { "docid": "ff1bfbdcda45fb3c3a71eaff9487ed8c", "score": "0.53778", "text": "func (d DiskStorage) GetAllByFilters(offset string, limit string, filters *filter.Filters) (count int, disks []model.Disk, err error) {\n\tq, err := filters.BuildQuery(model.Disk{}, d.db)\n\tif err != nil {\n\t\treturn count, disks, err\n\t}\n\n\tif offset != \"\" && limit != \"\" {\n\t\tif err = q.Limit(limit).Offset(offset).Find(&disks).Error; err != nil {\n\t\t\treturn count, disks, err\n\t\t}\n\t\tq.Model(&model.Disk{}).Count(&count)\n\t} else {\n\t\tif err = q.Find(&disks).Error; err != nil {\n\t\t\treturn count, disks, err\n\t\t}\n\t}\n\n\treturn count, disks, nil\n}", "title": "" }, { "docid": "752dd1ac4e755c5239422d5116644810", "score": "0.53643334", "text": "func (blockStorageService Service) Volumes() ([]Volume, error) {\n\tc := map[string][]Volume{\"json:volumes\": []Volume{}}\n\turl, err := blockStorageService.buildRequestURL(\"/volumes\")\n\tif err != nil {\n\t\treturn c[\"volumes\"], err\n\t}\n\n\terr = misc.GetJSON(url, blockStorageService.authenticator, &c)\n\treturn c[\"volumes\"], err\n}", "title": "" }, { "docid": "aae5e3b7552b7dc45b94ab2e196dc139", "score": "0.5331745", "text": "func (b StorageBladeStorage) GetAllByFilters(offset string, limit string, filters *filter.Filters) (count int, storageBlades []model.StorageBlade, err error) {\n\tq, err := filters.BuildQuery(model.StorageBlade{}, b.db)\n\tif err != nil {\n\t\treturn count, storageBlades, err\n\t}\n\n\tif offset != \"\" && limit != \"\" {\n\t\tif err = q.Limit(limit).Offset(offset).Find(&storageBlades).Error; err != nil {\n\t\t\treturn count, storageBlades, err\n\t\t}\n\t\tq.Model(&model.StorageBlade{}).Count(&count)\n\t} else {\n\t\tif err = q.Find(&storageBlades).Error; err != nil {\n\t\t\treturn count, storageBlades, err\n\t\t}\n\t}\n\n\treturn count, storageBlades, nil\n}", "title": "" }, { "docid": "4dfbd4f5af49c2a1fc91fb648726d3b4", "score": "0.5330024", "text": "func allVolumesByLabel(ociBin string, label string) ([]string, error) {\n\trr, err := runCmd(exec.Command(ociBin, \"volume\", \"ls\", \"--filter\", \"label=\"+label, \"--format\", \"{{.Name}}\"))\n\ts := bufio.NewScanner(bytes.NewReader(rr.Stdout.Bytes()))\n\tvar vols []string\n\tfor s.Scan() {\n\t\tv := strings.TrimSpace(s.Text())\n\t\tif v != \"\" {\n\t\t\tvols = append(vols, v)\n\t\t}\n\t}\n\tif scanErr := s.Err(); scanErr != nil {\n\t\tklog.Warningf(\"failed to read output: %v\", scanErr)\n\t\tif err == nil {\n\t\t\terr = scanErr\n\t\t}\n\t}\n\treturn vols, err\n}", "title": "" }, { "docid": "b250a516c80b70fe57a5a05efc44dc30", "score": "0.53159565", "text": "func (q volumeAccessQuery) AllP() VolumeAccessSlice {\n\to, err := q.All()\n\tif err != nil {\n\t\tpanic(boil.WrapErr(err))\n\t}\n\n\treturn o\n}", "title": "" }, { "docid": "3bfba2f9f8721301e6237851e7d06d65", "score": "0.53053164", "text": "func (volumeApi *VolumeApi) ListOfType(volumeType string) ([]Volume, error) {\n\treturn volumeApi.ListWithOptions(map[string]string{\n\t\t\"type\": volumeType,\n\t})\n}", "title": "" }, { "docid": "3559296cf800e0dc56ab04a1bb367aca", "score": "0.5215485", "text": "func VolumeFundings(exec boil.Executor, mods ...qm.QueryMod) volumeFundingQuery {\n\tmods = append(mods, qm.From(\"\\\"volume_funding\\\"\"))\n\treturn volumeFundingQuery{NewQuery(exec, mods...)}\n}", "title": "" }, { "docid": "cc172552f8b6ca14a6a782b249640cbf", "score": "0.5213312", "text": "func (q volumeFundingQuery) AllP() VolumeFundingSlice {\n\to, err := q.All()\n\tif err != nil {\n\t\tpanic(boil.WrapErr(err))\n\t}\n\n\treturn o\n}", "title": "" }, { "docid": "018a2b2521ca91a1957a6fcdd655555a", "score": "0.519312", "text": "func (c *ContivClient) VolumeList() (*[]*Volume, error) {\n\t// build key and URL\n\turl := c.baseURL + \"/api/v1/volumes/\"\n\n\t// http get the object\n\tvar objList []*Volume\n\terr := httpGet(url, &objList)\n\tif err != nil {\n\t\tlog.Debugf(\"Error getting volumes. Err: %v\", err)\n\t\treturn nil, err\n\t}\n\n\treturn &objList, nil\n}", "title": "" }, { "docid": "8ecdb282253da4d2fb479cf211120b69", "score": "0.5185329", "text": "func SetVolumeAll(pct byte) (err error) {\n\terr = nil\n\tif C.play_setvolume_all(C.uchar(pct)) < 0 {\n\t\terr = makePlayError(\"Setting volume failed: \")\n\t}\n\n\treturn\n}", "title": "" }, { "docid": "9cb213083b8718f681b3f8a98b232e48", "score": "0.5185187", "text": "func (q volumeStateQuery) AllP() VolumeStateSlice {\n\to, err := q.All()\n\tif err != nil {\n\t\tpanic(boil.WrapErr(err))\n\t}\n\n\treturn o\n}", "title": "" }, { "docid": "71f4a09be996e6a6966d33f58a2e9f6e", "score": "0.515038", "text": "func (q documentsBlobQuery) All(exec boil.Executor) (DocumentsBlobSlice, error) {\n\tvar o []*DocumentsBlob\n\n\terr := q.Bind(nil, exec, &o)\n\tif err != nil {\n\t\treturn nil, errors.Wrap(err, \"db: failed to assign all query results to DocumentsBlob slice\")\n\t}\n\n\tif len(documentsBlobAfterSelectHooks) != 0 {\n\t\tfor _, obj := range o {\n\t\t\tif err := obj.doAfterSelectHooks(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": "ee2f63f88e45d58e68461c83a8650af2", "score": "0.5146953", "text": "func (m *defaultManager) QueryVolumeAsync(ctx context.Context, queryFilter cnstypes.CnsQueryFilter,\n\tquerySelection *cnstypes.CnsQuerySelection) (*cnstypes.CnsQueryResult, error) {\n\tctx, cancelFunc := ensureOperationContextHasATimeout(ctx)\n\tdefer cancelFunc()\n\tlog := logger.GetLogger(ctx)\n\terr := validateManager(ctx, m)\n\tif err != nil {\n\t\tlog.Errorf(\"validateManager failed with err: %+v\", err)\n\t\treturn nil, err\n\t}\n\t// Set up the VC connection.\n\terr = m.virtualCenter.ConnectCns(ctx)\n\tif err != nil {\n\t\tlog.Errorf(\"ConnectCns failed with err: %+v\", err)\n\t\treturn nil, err\n\t}\n\tisvSphere70U3orAbove, err := cnsvsphere.IsvSphereVersion70U3orAbove(ctx, m.virtualCenter.Client.ServiceContent.About)\n\tif err != nil {\n\t\treturn nil, logger.LogNewErrorf(log,\n\t\t\t\"Error while checking the vSphere Version %q to invoke QueryVolumeAsync, Err= %+v\",\n\t\t\tm.virtualCenter.Client.ServiceContent.About.Version, err)\n\t}\n\tif !isvSphere70U3orAbove {\n\t\tmsg := fmt.Sprintf(\"QueryVolumeAsync is not supported in vSphere Version %q\",\n\t\t\tm.virtualCenter.Client.ServiceContent.About.Version)\n\t\tlog.Warnf(msg)\n\t\treturn nil, cnsvsphere.ErrNotSupported\n\t}\n\n\t// Call the CNS QueryVolumeAsync.\n\tqueryVolumeAsyncTask, err := m.virtualCenter.CnsClient.QueryVolumeAsync(ctx, queryFilter, querySelection)\n\tif err != nil {\n\t\tlog.Errorf(\"CNS QueryVolumeAsync failed from vCenter %q with err: %v\", m.virtualCenter.Config.Host, err)\n\t\treturn nil, err\n\t}\n\tvar queryVolumeAsyncTaskInfo *vim25types.TaskInfo\n\tif m.tasksListViewEnabled {\n\t\tqueryVolumeAsyncTaskInfo, err = m.waitOnTask(ctx, queryVolumeAsyncTask.Reference())\n\t} else {\n\t\tqueryVolumeAsyncTaskInfo, err = cns.GetTaskInfo(ctx, queryVolumeAsyncTask)\n\t}\n\tif err != nil {\n\t\tlog.Errorf(\"CNS QueryVolumeAsync failed to get TaskInfo with err: %v\", err)\n\t\treturn nil, err\n\t}\n\tqueryVolumeAsyncTaskResult, err := cns.GetTaskResult(ctx, queryVolumeAsyncTaskInfo)\n\tif err != nil {\n\t\tlog.Errorf(\"CNS QueryVolumeAsync failed to get TaskResult with err: %v\", err)\n\t\treturn nil, err\n\t}\n\tif queryVolumeAsyncTaskResult == nil {\n\t\treturn nil, logger.LogNewErrorf(log, \"taskResult is empty for QueryVolumeAsync task: %q, opID: %q\",\n\t\t\tqueryVolumeAsyncTaskInfo.Task.Value, queryVolumeAsyncTaskInfo.ActivationId)\n\t}\n\tvolumeOperationRes := queryVolumeAsyncTaskResult.GetCnsVolumeOperationResult()\n\tif volumeOperationRes.Fault != nil {\n\t\treturn nil, logger.LogNewErrorf(log,\n\t\t\t\"failed to query volumes using CnsQueryVolumeAsync, fault: %q, opID: %q\",\n\t\t\tspew.Sdump(volumeOperationRes.Fault), queryVolumeAsyncTaskInfo.ActivationId)\n\t}\n\tqueryVolumeAsyncResult := interface{}(queryVolumeAsyncTaskResult).(*cnstypes.CnsAsyncQueryResult)\n\tlog.Infof(\"QueryVolumeAsync successfully returned CnsQueryResult, opId: %q\", queryVolumeAsyncTaskInfo.ActivationId)\n\tlog.Debugf(\"QueryVolumeAsync returned CnsQueryResult: %+v\", spew.Sdump(queryVolumeAsyncResult.QueryResult))\n\treturn &queryVolumeAsyncResult.QueryResult, nil\n}", "title": "" }, { "docid": "60bc679d3ec142cb60d25e80cbb5ead7", "score": "0.5134799", "text": "func (p Player) SetVolumeAll(pct byte) {\n\tp.cmds <- setVolumeAllCmd(pct)\n}", "title": "" }, { "docid": "d06d138ec34bb4248942119829f691ab", "score": "0.5133213", "text": "func (a *HpArray) ShowVolumes(volumeType string) ([]string, error) {\n\tvar vr Response\n\tvolumes := []string{}\n\turl := fmt.Sprintf(\"%s/api/show/volumes\", a.URL)\n\treq, _ := http.NewRequest(\"GET\", url, nil)\n\ta.getSessionKey()\n\treq.Header.Set(\"sessionKey\", a.sessionKey)\n\treq.Header.Set(\"dataType\", \"ipa\")\n\tresp, err := a.Client.Do(req)\n\tif err != nil {\n\t\tlog.Fatal(\"Error:\", err)\n\t\treturn nil, err\n\t}\n\tdefer resp.Body.Close()\n\tdefer a.closeSession()\n\n\tif resp.StatusCode != 200 {\n\t\tlog.Fatal(\"Could not get volumes list\")\n\t\treturn nil, nil\n\t}\n\n\tbodyBytes, err := ioutil.ReadAll(resp.Body)\n\tif err != nil {\n\t\tlog.Fatal(\"Error:\", err)\n\t}\n\n\terr = xml.Unmarshal(bodyBytes, &vr)\n\tif err != nil {\n\t\tlog.Fatal(\"Error:\", err)\n\t}\n\n\tfor _, o := range vr.OBJECT {\n\t\tif o.Basetype == \"volumes\" {\n\n\t\t\tn := \"\"\n\t\t\tfor _, p := range o.PROPERTY {\n\t\t\t\tif p.Name == \"volume-name\" {\n\t\t\t\t\tn = p.Text\n\t\t\t\t}\n\t\t\t\tif p.Name == \"volume-type\" && p.Text == \"snapshot\" {\n\t\t\t\t\tif Contains([]string{\"snapshot\", \"all\"}, volumeType) {\n\t\t\t\t\t\tvolumes = append(volumes, n)\n\t\t\t\t\t}\n\t\t\t\t} else if p.Name == \"volume-type\" && Contains([]string{\"standard\", \"master volume\"}, p.Text) {\n\t\t\t\t\tif Contains([]string{\"volume\", \"all\"}, volumeType) {\n\t\t\t\t\t\tvolumes = append(volumes, n)\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\treturn volumes, nil\n}", "title": "" }, { "docid": "02a871cedc82f9a9355f2a88ccbf3ec9", "score": "0.51278573", "text": "func (volumeApi *VolumeApi) ListWithOptions(options map[string]string) ([]Volume, error) {\n\tdata, err := volumeApi.entityService.List(options)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\treturn parseVolumeList(data), nil\n}", "title": "" }, { "docid": "674b24481bdc2778591d1e3cac14ad65", "score": "0.5125028", "text": "func (d FakeDryccCmd) VolumesList(string, int) error {\n\treturn errors.New(\"volumes:list\")\n}", "title": "" }, { "docid": "f290421dc634d7cdeb060ac664079184", "score": "0.51211643", "text": "func (_class VDIClass) GetAll(sessionID SessionRef) (_retval []VDIRef, _err error) {\n\tif IsMock {\n\t\treturn _class.GetAllMock(sessionID)\n\t}\t\n\t_method := \"VDI.get_all\"\n\t_sessionIDArg, _err := convertSessionRefToXen(fmt.Sprintf(\"%s(%s)\", _method, \"session_id\"), sessionID)\n\tif _err != nil {\n\t\treturn\n\t}\n\t_result, _err := _class.client.APICall(_method, _sessionIDArg)\n\tif _err != nil {\n\t\treturn\n\t}\n\t_retval, _err = convertVDIRefSetToGo(_method + \" -> \", _result.Value)\n\treturn\n}", "title": "" }, { "docid": "1ddbdd0d26b126a2e537592de2600f4e", "score": "0.5113596", "text": "func (client *StorageRPCClient) ReadAll(volume, path string) (buf []byte, err error) {\n\terr = client.call(storageServiceName+\".ReadAll\", &ReadAllArgs{Vol: volume, Path: path}, &buf)\n\treturn buf, err\n}", "title": "" }, { "docid": "59457f976af5c194828d6855af0c6dfe", "score": "0.50776315", "text": "func VolumeList(r shared.RemoteDef) ([]shared.VolumeDef, error) {\n\tvar vols []shared.VolumeDef\n\n\tresp, err := Get(r, \"/volumes\")\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\terr = DecodeJson(resp, &vols)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\treturn vols, nil\n}", "title": "" }, { "docid": "189a04fa4f926fab44d6fdcd02195d91", "score": "0.5031772", "text": "func (client *APIClient) GetVolumes(organizationID, clusterID int) ([]PersistentVolume, error) {\n\tpath := fmt.Sprintf(\"/orgs/%d/clusters/%d/volumes\", organizationID, clusterID)\n\tcontent, err := client.get(path)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\tglog.V(8).Info(string(content))\n\tvar volumes []PersistentVolume\n\terr = json.Unmarshal(content, &volumes)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\treturn volumes, nil\n}", "title": "" }, { "docid": "26dc51701271e54df9fc2be6d3a0f38b", "score": "0.49934375", "text": "func (client *Client) GetVolumeList() (model.VolumesList, error) {\n\tvar volumeList model.VolumesList\n\terr := client.RestAPI.Get(rest.Rq{\n\t\tResult: &volumeList,\n\t\tURL: rest.URL{\n\t\t\tPath: volumesPath,\n\t\t\tParams: rest.P{},\n\t\t},\n\t})\n\treturn volumeList, err\n}", "title": "" }, { "docid": "995ad62e8cbdff4ac64a2ca4d1b1ba73", "score": "0.49840012", "text": "func (t *SmartContract) queryAllLogs(stub shim.ChaincodeStubInterface, args []string) sc.Response {\n\n\tqueryString := fmt.Sprintf(\"{\\\"selector\\\":{\\\"docType\\\":\\\"log\\\"}, \\\"sort\\\": [{\\\"Created\\\": \\\"desc\\\"}]}\")\n\n\tqueryResults, err := getQueryResultForQueryString(stub, queryString)\n\tif err != nil {\n\t\treturn shim.Error(err.Error())\n\t}\n\treturn shim.Success(queryResults)\n}", "title": "" }, { "docid": "c43d3d7593b351f0347e7071ab519c26", "score": "0.49711937", "text": "func (q playEvolutionQuery) All() (PlayEvolutionSlice, error) {\n\tvar o PlayEvolutionSlice\n\n\terr := q.Bind(&o)\n\tif err != nil {\n\t\treturn nil, errors.Wrap(err, \"public: failed to assign all query results to PlayEvolution slice\")\n\t}\n\n\tif len(playEvolutionAfterSelectHooks) != 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": "1912cb5f6b09507b80d2d1a46b3eaa5b", "score": "0.4970437", "text": "func (t *LinodeVolumeService) List(volumeId int) (*LinodeVolumeListResponse, error) {\n\tu := &url.Values{}\n\tif volumeId > 0 {\n\t\tu.Add(\"VolumeID\", strconv.Itoa(volumeId))\n\t}\n\tv := LinodeVolumeListResponse{}\n\tif err := t.client.do(\"volume.list\", u, &v.Response); err != nil {\n\t\treturn nil, err\n\t}\n\n\tv.Volume = make([]Volume, 5)\n\tif err := json.Unmarshal(v.RawData, &v.Volume); err != nil {\n\t\treturn nil, err\n\t}\n\treturn &v, nil\n}", "title": "" }, { "docid": "1991751bd1decdb6f1de1d903ab1c432", "score": "0.49481636", "text": "func QueryAllFromMongoBackup(db string, col string, filters map[string]interface{}) []bson.M {\n\tvar results []bson.M\n\terr := config.GetMongoBackupSession().DB(db).C(col).Find(filters).All(&results)\n\tif err != nil {\n\t\tfmt.Print(\"Problem while getting all mongo data query :\", err.Error())\n\t\tgo logger.ErrorLogger(err.Error(), \"MongoBackupPool\", \"Query All Error\")\n\t}\n\treturn results\n\n}", "title": "" }, { "docid": "bca0a11d9e4595079db38883b79f1ee3", "score": "0.49272192", "text": "func QueryAll() ([]Venture, error) {\n\trows, err := database.Get().Query(`SELECT\n\t\tid,\n\t\tlast_modified,\n\t\tdescription,\n\t\torder_ids,\n\t\tstate,\n\t\textra\n\tFROM ql_venture`)\n\n\tif rows != nil {\n\t\tdefer rows.Close()\n\t}\n\n\tif cookies.LogIfErr(err) {\n\t\treturn nil, err\n\t}\n\n\treturn mapRows(rows)\n}", "title": "" }, { "docid": "4934b8a25150cbce4ca37e0c7d0aa1f5", "score": "0.48982313", "text": "func (d *Driver) ListVolumes(ctx context.Context, req *csi.ListVolumesRequest) (*csi.ListVolumesResponse, error) {\n\tmaxEntries := req.MaxEntries\n\tif maxEntries == 0 && d.defaultVolumesPageSize > 0 {\n\t\tmaxEntries = int32(d.defaultVolumesPageSize)\n\t}\n\n\tlog := d.log.WithFields(logrus.Fields{\n\t\t\"max_entries\": req.MaxEntries,\n\t\t\"effective_max_entries\": maxEntries,\n\t\t\"req_starting_token\": req.StartingToken,\n\t\t\"method\": \"list_volumes\",\n\t})\n\tlog.Info(\"list volumes called\")\n\n\tvar startingToken int32\n\tif req.StartingToken != \"\" {\n\t\tparsedToken, err := strconv.ParseInt(req.StartingToken, 10, 32)\n\t\tif err != nil {\n\t\t\treturn nil, status.Errorf(codes.Aborted, \"ListVolumes starting token %q is not valid: %s\", req.StartingToken, err)\n\t\t}\n\t\tstartingToken = int32(parsedToken)\n\t}\n\n\tuntypedVolumes, nextToken, err := listResources(ctx, log, startingToken, maxEntries, func(ctx context.Context, listOpts *godo.ListOptions) ([]interface{}, *godo.Response, error) {\n\t\tvolListOpts := &godo.ListVolumeParams{\n\t\t\tListOptions: listOpts,\n\t\t\tRegion: d.region,\n\t\t}\n\t\tvolumes, resp, err := d.storage.ListVolumes(ctx, volListOpts)\n\t\tif err != nil {\n\t\t\treturn nil, resp, err\n\t\t}\n\n\t\tuntypedVolumes := make([]interface{}, 0, len(volumes))\n\t\tfor _, volume := range volumes {\n\t\t\tuntypedVolumes = append(untypedVolumes, volume)\n\t\t}\n\t\treturn untypedVolumes, resp, err\n\t})\n\tif err != nil {\n\t\treturn nil, fmt.Errorf(\"ListVolumes failed to list resources: %w\", err)\n\t}\n\n\tvolumes := make([]godo.Volume, 0, len(untypedVolumes))\n\tfor _, untypedVolume := range untypedVolumes {\n\t\tvolumes = append(volumes, untypedVolume.(godo.Volume))\n\t}\n\n\tvar entries []*csi.ListVolumesResponse_Entry\n\tfor _, vol := range volumes {\n\t\tattachedDropletIDs := make([]string, 0, len(vol.DropletIDs))\n\t\tfor _, dropletID := range vol.DropletIDs {\n\t\t\tattachedDropletIDs = append(attachedDropletIDs, strconv.Itoa(dropletID))\n\t\t}\n\n\t\tentries = append(entries, &csi.ListVolumesResponse_Entry{\n\t\t\tVolume: &csi.Volume{\n\t\t\t\tVolumeId: vol.ID,\n\t\t\t\tCapacityBytes: vol.SizeGigaBytes * giB,\n\t\t\t},\n\t\t\tStatus: &csi.ListVolumesResponse_VolumeStatus{\n\t\t\t\tPublishedNodeIds: attachedDropletIDs,\n\t\t\t},\n\t\t})\n\t}\n\n\tresp := &csi.ListVolumesResponse{\n\t\tEntries: entries,\n\t}\n\n\tif nextToken > 0 {\n\t\tresp.NextToken = strconv.FormatInt(int64(nextToken), 10)\n\t}\n\n\tlog.WithField(\"num_volume_entries\", len(resp.Entries)).Info(\"volumes listed\")\n\treturn resp, nil\n}", "title": "" }, { "docid": "02535430037ffb137b89c7423e00a479", "score": "0.48919708", "text": "func (v *Via) Volumes(ctx context.Context, block []string) (map[string]int, error) {\n\ttoReturn := make(map[string]int)\n\tvar cmd command\n\tcmd.Command = \"Vol\"\n\tcmd.Param1 = \"Get\"\n\n\tv.Log.Info(\"Sending command to get VIA Volume\", zap.String(\"address\", v.Address))\n\t// Note: Volume Get command in VIA API doesn't have any error handling so it only returns Vol|Get|XX or nothing\n\t// Checking for errors during execution of command\n\tvollevel, err := v.sendCommand(ctx, cmd)\n\tif err != nil {\n\t\tv.Log.Error(\"Failed to get volume\", zap.Error(err))\n\t\treturn nil, err\n\t}\n\n\tvolume, err := v.volumeParse(vollevel)\n\tif err != nil {\n\t\tv.Log.Error(\"failed to parse volume response\", zap.Error(err))\n\t\treturn nil, err\n\t}\n\n\ttoReturn[\"\"] = volume\n\treturn toReturn, nil\n}", "title": "" }, { "docid": "0f504127901e1e33627171061e3fb676", "score": "0.48851702", "text": "func (rc *ReadCloser) Volumes() []string {\n\tvolumes := make([]string, len(rc.f))\n\tfor idx, f := range rc.f {\n\t\tvolumes[idx] = f.Name()\n\t}\n\n\treturn volumes\n}", "title": "" }, { "docid": "20774ec96fdc4af3564668b6374f7bf6", "score": "0.48717985", "text": "func (q specializationKitQuery) All(ctx context.Context, exec boil.ContextExecutor) (SpecializationKitSlice, error) {\n\tvar o []*SpecializationKit\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 SpecializationKit slice\")\n\t}\n\n\tif len(specializationKitAfterSelectHooks) != 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": "464f3f7adfea68b8700114b203ee1011", "score": "0.48664737", "text": "func (q volumeStateQuery) DeleteAll() error {\n\tif q.Query == nil {\n\t\treturn errors.New(\"public: no volumeStateQuery provided for delete all\")\n\t}\n\n\tqueries.SetDelete(q.Query)\n\n\t_, err := q.Query.Exec()\n\tif err != nil {\n\t\treturn errors.Wrap(err, \"public: unable to delete all from volume_state\")\n\t}\n\n\treturn nil\n}", "title": "" }, { "docid": "75b1e80232fd058d761c07a83c71b544", "score": "0.48659244", "text": "func VolumeList() ([]*dockType.Volume, error) {\n\tvolumeList, err := client.VolumeList(context.Background(), filters.Args{})\n\treturn volumeList.Volumes, err\n}", "title": "" }, { "docid": "88caa68d86acbea6ef23ef340c6730dd", "score": "0.48580948", "text": "func (s *DataStore) GetAllVolumeAttachments() (runtime.Object, error) {\n\treturn s.kubeClient.StorageV1().VolumeAttachments().List(context.TODO(), metav1.ListOptions{})\n}", "title": "" }, { "docid": "e71a2c8993ff38834595647b3ffd9e48", "score": "0.48529336", "text": "func (d *driver) Volumes(\n\tctx types.Context,\n\topts *types.VolumesOpts) ([]*types.Volume, error) {\n\n\tlist, err := mustSession(ctx).blobClient.ListBlobs(d.container,\n\t\tblobStorage.ListBlobsParameters{Include: \"metadata\"})\n\tif err != nil {\n\t\treturn nil, goof.WithError(\"error listing blobs\", err)\n\t}\n\t// Convert retrieved volumes to libStorage types.Volume\n\tvols, convErr := d.toTypesVolume(ctx, list.Blobs, opts.Attachments)\n\tif convErr != nil {\n\t\treturn nil, goof.WithError(\n\t\t\t\"error converting to types.Volume\", convErr)\n\t}\n\treturn vols, nil\n}", "title": "" }, { "docid": "f652fda9943fa55ab12b4072a74270e0", "score": "0.48454455", "text": "func (q payPerViewEventQuery) All(ctx context.Context, exec boil.ContextExecutor) (PayPerViewEventSlice, error) {\n\tvar o []*PayPerViewEvent\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 PayPerViewEvent slice\")\n\t}\n\n\treturn o, nil\n}", "title": "" }, { "docid": "c1c55634ae45a63dbc9a631e9d50a613", "score": "0.48446512", "text": "func (o *CattleOrchestrator) GetVolumes(volumeFilters volume.Filters) (volumes []*volume.Volume, err error) {\n\tvs, err := o.client.Volume.List(&client.ListOpts{\n\t\tFilters: map[string]interface{}{\n\t\t\t\"limit\": -2,\n\t\t\t\"all\": true,\n\t\t},\n\t})\n\tif err != nil {\n\t\terr = fmt.Errorf(\"failed to list volumes: %s\", err)\n\t\treturn\n\t}\n\n\tvar mountpoint string\n\tvar h *client.Host\n\tfor _, v := range vs.Data {\n\t\tif len(v.Mounts) < 1 {\n\t\t\tmountpoint = \"/data\"\n\t\t} else {\n\t\t\tmountpoint = v.Mounts[0].Path\n\t\t}\n\n\t\tvar hostID, hostname string\n\t\tvar spc *client.StoragePoolCollection\n\t\terr = o.rawAPICall(\"GET\", v.Links[\"storagePools\"], \"\", &spc)\n\t\tif err != nil {\n\t\t\tcontinue\n\t\t}\n\n\t\tif len(spc.Data) == 0 {\n\t\t\tcontinue\n\t\t}\n\n\t\tif len(spc.Data[0].HostIds) == 0 {\n\t\t\tcontinue\n\t\t}\n\n\t\thostID = spc.Data[0].HostIds[0]\n\n\t\th, err = o.client.Host.ById(hostID)\n\t\tif err != nil {\n\t\t\thostname = hostID\n\t\t} else {\n\t\t\thostname = h.Hostname\n\t\t}\n\n\t\tv := &volume.Volume{\n\t\t\tID: v.Id,\n\t\t\tName: v.Name,\n\t\t\tMountpoint: mountpoint,\n\t\t\tHostBind: hostID,\n\t\t\tHostname: hostname,\n\t\t\tLogs: make(map[string]string),\n\t\t\tRepoName: v.Name,\n\t\t\tSubPath: \"\",\n\t\t}\n\n\t\tif b, _, _ := o.blacklistedVolume(v, volumeFilters); b {\n\t\t\tcontinue\n\t\t}\n\t\tvolumes = append(volumes, v)\n\t}\n\treturn\n}", "title": "" }, { "docid": "baaeed0b287e4b0e74a50a69ba8dc0af", "score": "0.4843408", "text": "func (o ContainerOutput) Volumes() pulumi.StringArrayOutput {\n\treturn o.ApplyT(func(v Container) []string { return v.Volumes }).(pulumi.StringArrayOutput)\n}", "title": "" }, { "docid": "b9255ef5e0aa376fd2130b3baa843d30", "score": "0.48337808", "text": "func (s *blobStore) FindAll(ctx context.Context) (models.Blobs, error) {\n\tdefer metrics.InstrumentQuery(\"blob_find_all\")()\n\tq := `SELECT\n\t\t\tmt.media_type,\n\t\t\tencode(b.digest, 'hex') as digest,\n\t\t\tb.size,\n\t\t\tb.created_at\n\t\tFROM\n\t\t\tblobs AS b\n\t\t\tJOIN media_types AS mt ON b.media_type_id = mt.id`\n\trows, err := s.db.QueryContext(ctx, q)\n\tif err != nil {\n\t\treturn nil, fmt.Errorf(\"finding blobs: %w\", err)\n\t}\n\n\treturn scanFullBlobs(rows)\n}", "title": "" }, { "docid": "3176fe2b56a569b0ce4851a62c993cfa", "score": "0.48252952", "text": "func GetAllVolumeIDs(ctx context.Context, trackingFileDirectory string) []string {\n\tLogc(ctx).WithField(\"trackingFileDirectory\", trackingFileDirectory).Debug(\">>>> iscsi.GetAllVolumeIDs\")\n\tdefer Logc(ctx).Debug(\"<<<< iscsi.GetAllVolumeIDs\")\n\n\tfiles, err := os.ReadDir(trackingFileDirectory)\n\tif err != nil {\n\t\tLogc(ctx).WithFields(LogFields{\n\t\t\t\"error\": err,\n\t\t}).Warn(\"Failed to get list of tracking files.\")\n\n\t\treturn nil\n\t}\n\n\tif len(files) == 0 {\n\t\tLogc(ctx).Debug(\"No tracking file found.\")\n\t\treturn nil\n\t}\n\n\tvolumeIDs := make([]string, 0)\n\tfor _, file := range files {\n\t\tif !file.IsDir() && strings.HasPrefix(file.Name(), \"pvc-\") && strings.HasSuffix(file.Name(), \".json\") {\n\t\t\tvolumeIDs = append(volumeIDs, strings.TrimSuffix(file.Name(), \".json\"))\n\t\t}\n\t}\n\n\tif len(volumeIDs) == 0 {\n\t\tLogc(ctx).Debug(\"No volume ID found.\")\n\t}\n\n\treturn volumeIDs\n}", "title": "" }, { "docid": "2a8bcca16b32046fc550dd803fce7223", "score": "0.48239022", "text": "func (logCollection *LogCollection) GetAllWithFilters(filters map[string]interface{}) error {\n\tdb := GetDatabase()\n\tdefer db.Close()\n\n\twhere := \"DELETED = FALSE\"\n\n\tfor filter, value := range filters {\n\t\tswitch filter {\n\t\tcase \"user_id\":\n\t\t\tfilters[\"user_id\"] = value.(uint64)\n\t\t\tif filters[\"user_id\"] != 0 {\n\t\t\t\twhere = where + \" AND user_id = :user_id\"\n\t\t\t}\n\t\tcase \"date\":\n\t\t\tif value != \"\" {\n\t\t\t\twhere = where + \" AND date = :date\"\n\t\t\t}\n\t\tcase \"from\":\n\t\t\tif value != \"\" {\n\t\t\t\twhere = where + \" AND date >= :from\"\n\t\t\t}\n\t\tcase \"until\":\n\t\t\tif value != \"\" {\n\t\t\t\twhere = where + \" AND date <= :until\"\n\t\t\t}\n\t\tcase \"language\":\n\t\t\tif value != \"\" {\n\t\t\t\twhere = where + \" AND language = :language\"\n\t\t\t}\n\t\tcase \"page\":\n\t\t\tpage, err := strconv.ParseUint(value.(string), 10, 64)\n\t\t\tif err != nil || page <= 0 {\n\t\t\t\tpage = 1\n\t\t\t}\n\n\t\t\tfilters[\"page\"] = (page - 1) * 30\n\t\t}\n\t}\n\n\tif _, ok := filters[\"page\"]; !ok {\n\t\tfilters[\"page\"] = 0\n\t}\n\n\tquery := `\n\t\tWITH filtered_logs AS (\n\t\t\tSELECT\n\t\t\t\tunnest(ids) AS id\n\t\t\tFROM (\n\t\t\t\tSELECT\n\t\t\t\t\tarray_agg(id) AS ids\n\t\t\t\tFROM logs\n\t\t\t\tWHERE ` + where + `\n\t\t\t\tGROUP BY date\n\t\t\t\tORDER BY date DESC\n\t\t\t\tOFFSET :page\n\t\t\t\tLIMIT 30\n\t\t\t) AS agg_ids\n\t\t)\n\t\tSELECT\n\t\t\tid,\n\t\t\tuser_id,\n\t\t\tlanguage,\n\t\t\tto_char(date, 'YYYY-MM-DD') AS date,\n\t\t\tduration,\n\t\t\tactivity,\n\t\t\tnotes\n\t\tFROM logs l\n\t\tWHERE EXISTS (\n\t\t\tSELECT 1\n\t\t\tFROM filtered_logs fl\n\t\t\tWHERE fl.id = l.id\n\t\t)\n\t\tORDER BY date DESC, language\n\t`\n\n\trows, err := db.NamedQuery(query, filters)\n\tdefer rows.Close()\n\n\tif err != nil {\n\t\treturn err\n\t}\n\n\tfor rows.Next() {\n\t\tvar log Log\n\t\terr = rows.StructScan(&log)\n\n\t\tif err != nil {\n\t\t\treturn err\n\t\t}\n\n\t\tlogCollection.Logs = append(logCollection.Logs, log)\n\t}\n\n\treturn err\n}", "title": "" }, { "docid": "7353f8f62894f23c39af4241dc21581c", "score": "0.48187622", "text": "func (sp *StoragePool) GetVolume(\n\tvolumehref, volumeid, ancestorvolumeid, volumename string,\n\tgetSnapshots bool) ([]*types.Volume, error) {\n\tdefer TimeSpent(\"GetVolume\", time.Now())\n\n\tvar (\n\t\terr error\n\t\tpath string\n\t\tvolume = &types.Volume{}\n\t\tvolumes []*types.Volume\n\t)\n\n\tif volumename != \"\" {\n\t\tvolumeid, err = sp.FindVolumeID(volumename)\n\t\tif err != nil && err.Error() == \"Not found\" {\n\t\t\treturn nil, nil\n\t\t}\n\t\tif err != nil {\n\t\t\treturn nil, fmt.Errorf(\"Error: problem finding volume: %s\", err)\n\t\t}\n\t}\n\n\tif volumeid != \"\" {\n\t\tpath = fmt.Sprintf(\"/api/instances/Volume::%s\", volumeid)\n\t} else if volumehref == \"\" {\n\t\tlink, err := GetLink(sp.StoragePool.Links,\n\t\t\t\"/api/StoragePool/relationship/Volume\")\n\t\tif err != nil {\n\t\t\treturn nil, err\n\t\t}\n\t\tpath = link.HREF\n\t} else {\n\t\tpath = volumehref\n\t}\n\n\tif volumehref == \"\" && volumeid == \"\" {\n\t\terr = sp.client.getJSONWithRetry(\n\t\t\thttp.MethodGet, path, nil, &volumes)\n\t} else {\n\t\terr = sp.client.getJSONWithRetry(\n\t\t\thttp.MethodGet, path, nil, volume)\n\t}\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\tif volumehref == \"\" && volumeid == \"\" {\n\t\tvar volumesNew []*types.Volume\n\t\tfor _, v := range volumes {\n\t\t\tif (!getSnapshots && v.AncestorVolumeID == ancestorvolumeid) || (getSnapshots && v.AncestorVolumeID != \"\") {\n\t\t\t\tvolumesNew = append(volumesNew, v)\n\t\t\t}\n\t\t}\n\t\tvolumes = volumesNew\n\t} else {\n\t\tvolumes = append(volumes, volume)\n\t}\n\treturn volumes, nil\n}", "title": "" }, { "docid": "1bfe3a28a38b2d3fc11c4175ef6f3776", "score": "0.4817841", "text": "func (q stockKeepingUnitQuery) All(exec boil.Executor) (StockKeepingUnitSlice, error) {\n\tvar o []*StockKeepingUnit\n\n\terr := q.Bind(nil, exec, &o)\n\tif err != nil {\n\t\treturn nil, errors.Wrap(err, \"db: failed to assign all query results to StockKeepingUnit slice\")\n\t}\n\n\tif len(stockKeepingUnitAfterSelectHooks) != 0 {\n\t\tfor _, obj := range o {\n\t\t\tif err := obj.doAfterSelectHooks(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": "34a7c23a0ea876fe487a1ce4fb95bc0b", "score": "0.480375", "text": "func (o BuildOptionsOutput) Volumes() VolumeArrayOutput {\n\treturn o.ApplyT(func(v BuildOptions) []Volume { return v.Volumes }).(VolumeArrayOutput)\n}", "title": "" }, { "docid": "5759d7084dfccb4d8bcd08c906f6eb64", "score": "0.48008975", "text": "func getVolumes(name string) []corev1.Volume {\n\tvar scriptsVolumeDefaultMode int32 = 0755\n\tvar config0640AccessMode int32 = 0640\n\n\treturn []corev1.Volume{\n\t\t{\n\t\t\tName: \"scripts\",\n\t\t\tVolumeSource: corev1.VolumeSource{\n\t\t\t\tConfigMap: &corev1.ConfigMapVolumeSource{\n\t\t\t\t\tDefaultMode: &scriptsVolumeDefaultMode,\n\t\t\t\t\tLocalObjectReference: corev1.LocalObjectReference{\n\t\t\t\t\t\tName: name + \"-scripts\",\n\t\t\t\t\t},\n\t\t\t\t},\n\t\t\t},\n\t\t},\n\t\t{\n\t\t\tName: \"config-data\",\n\t\t\tVolumeSource: corev1.VolumeSource{\n\t\t\t\tConfigMap: &corev1.ConfigMapVolumeSource{\n\t\t\t\t\tDefaultMode: &config0640AccessMode,\n\t\t\t\t\tLocalObjectReference: corev1.LocalObjectReference{\n\t\t\t\t\t\tName: name + \"-config-data\",\n\t\t\t\t\t},\n\t\t\t\t},\n\t\t\t},\n\t\t},\n\t\t{\n\t\t\tName: \"config-data-custom\",\n\t\t\tVolumeSource: corev1.VolumeSource{\n\t\t\t\tConfigMap: &corev1.ConfigMapVolumeSource{\n\t\t\t\t\tLocalObjectReference: corev1.LocalObjectReference{\n\t\t\t\t\t\tName: name + \"-config-data-custom\",\n\t\t\t\t\t},\n\t\t\t\t},\n\t\t\t},\n\t\t},\n\t\t{\n\t\t\tName: \"config-data-merged\",\n\t\t\tVolumeSource: corev1.VolumeSource{\n\t\t\t\tEmptyDir: &corev1.EmptyDirVolumeSource{Medium: \"\"},\n\t\t\t},\n\t\t},\n\t}\n\n}", "title": "" }, { "docid": "b399b7ded6be6f0227b0cb00c1b9de23", "score": "0.47908944", "text": "func (mo *EventManager) QueryEvents(\n\tfilter *EventFilterSpec,\n) ([]*Event, error) {\n\n\trequest := struct {\n\t\tXMLName xml.Name `xml:\"QueryEvents\"`\n\t\tThis *ManagedObjectReference `xml:\"_this,omitempty\"`\n\t\tFilter *EventFilterSpec `xml:\"filter,omitempty\"`\n\t}{\n\t\tThis: &ManagedObjectReference{Type: mo.ManagedObject.Type, Value: mo.ManagedObject.Value},\n\t\tFilter: filter,\n\t}\n\n\tresponse := struct {\n\t\tReturnval []*Event `xml:\"returnval\"`\n\t}{}\n\n\tif session == nil {\n\t\tpanic(\"You need to create a vSphereSession first\")\n\t}\n\n\terr := session.invoke(request, &response)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\treturn response.Returnval, nil\n\n}", "title": "" }, { "docid": "8814d6db23ac05f9c95b2b4d337ecd9d", "score": "0.47853574", "text": "func (q measureQuery) All() (MeasureSlice, error) {\n\tvar o MeasureSlice\n\n\terr := q.Bind(&o)\n\tif err != nil {\n\t\treturn nil, errors.Wrap(err, \"public: failed to assign all query results to Measure slice\")\n\t}\n\n\tif len(measureAfterSelectHooks) != 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": "7ad1915441364b69b1337186e6fcc685", "score": "0.47845346", "text": "func (q cvQuery) All() (CVSlice, error) {\n\tvar o CVSlice\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 CV slice\")\n\t}\n\n\tif len(cvAfterSelectHooks) != 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": "2c55079a1d265ccd95d8071f599c18ab", "score": "0.47756678", "text": "func (o TriggerBuildOptionsOutput) Volumes() TriggerBuildOptionsVolumeArrayOutput {\n\treturn o.ApplyT(func(v TriggerBuildOptions) []TriggerBuildOptionsVolume { return v.Volumes }).(TriggerBuildOptionsVolumeArrayOutput)\n}", "title": "" }, { "docid": "1485ddf0aff6fd68c6a4c2e245251be5", "score": "0.4766842", "text": "func (mo *HostDatastoreSystem) QueryUnresolvedVmfsVolumes() ([]*HostUnresolvedVmfsVolume, error) {\n\n\trequest := struct {\n\t\tXMLName xml.Name `xml:\"QueryUnresolvedVmfsVolumes\"`\n\t\tThis *ManagedObjectReference `xml:\"_this,omitempty\"`\n\t}{\n\t\tThis: &ManagedObjectReference{Type: mo.ManagedObject.Type, Value: mo.ManagedObject.Value},\n\t}\n\n\tresponse := struct {\n\t\tReturnval []*HostUnresolvedVmfsVolume `xml:\"returnval\"`\n\t}{}\n\n\tif session == nil {\n\t\tpanic(\"You need to create a vSphereSession first\")\n\t}\n\n\terr := session.invoke(request, &response)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\treturn response.Returnval, nil\n\n}", "title": "" }, { "docid": "dbcd3c86c905c5c886ed013a2f450898", "score": "0.47627088", "text": "func (o BuildOptionsResponseOutput) Volumes() VolumeResponseArrayOutput {\n\treturn o.ApplyT(func(v BuildOptionsResponse) []VolumeResponse { return v.Volumes }).(VolumeResponseArrayOutput)\n}", "title": "" }, { "docid": "110ad6e3112830de176540d3b74b7ff2", "score": "0.4745245", "text": "func (o *VolumeState) VolumeByFk(exec boil.Executor, mods ...qm.QueryMod) volumeQuery {\n\tqueryMods := []qm.QueryMod{\n\t\tqm.Where(\"id=?\", o.Volume),\n\t}\n\n\tqueryMods = append(queryMods, mods...)\n\n\tquery := Volumes(exec, queryMods...)\n\tqueries.SetFrom(query.Query, \"\\\"volume\\\"\")\n\n\treturn query\n}", "title": "" }, { "docid": "919201212178e87b1023a59ebe2fa335", "score": "0.47421622", "text": "func (s *Space) RawQueryAll(t ...interface{}) (ts interface{}, e interface{}) {\n\tts, e = QueryAll(*s.p, t...)\n\treturn ts, e\n}", "title": "" }, { "docid": "c82df7fbcc1979ecb8e3e9259ad43b0c", "score": "0.47373584", "text": "func (q restaurantPhotoQuery) All(ctx context.Context, exec boil.ContextExecutor) (RestaurantPhotoSlice, error) {\n\tvar o []*RestaurantPhoto\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 RestaurantPhoto slice\")\n\t}\n\n\tif len(restaurantPhotoAfterSelectHooks) != 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": "a3a7566748380ba8c62c8247bafb271c", "score": "0.4733246", "text": "func (r Network_Storage_Iscsi) GetSnapshotsForVolume() (resp []datatypes.Network_Storage, err error) {\n\terr = r.Session.DoRequest(\"SoftLayer_Network_Storage_Iscsi\", \"getSnapshotsForVolume\", nil, &r.Options, &resp)\n\treturn\n}", "title": "" }, { "docid": "eb929064b30198de436abcf2aad64fbb", "score": "0.47318318", "text": "func (o TaskSpecOutput) Volumes() VolumeArrayOutput {\n\treturn o.ApplyT(func(v TaskSpec) []Volume { return v.Volumes }).(VolumeArrayOutput)\n}", "title": "" }, { "docid": "f9cfcbf212ceb063b408ac419b7febab", "score": "0.47309923", "text": "func (q regionQuery) All() (RegionSlice, error) {\n\tvar o []*Region\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 Region slice\")\n\t}\n\n\tif len(regionAfterSelectHooks) != 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": "7c97556a31880b69d64a9ff9ef022bf0", "score": "0.4726175", "text": "func (d Client) GetVolumes() ([]VolumeEx, error) {\n\n\tif d.config.DebugTraceFlags[\"method\"] {\n\t\tfields := log.Fields{\n\t\t\t\"Method\": \"GetVolumes\",\n\t\t\t\"Type\": \"Client\",\n\t\t}\n\t\tlog.WithFields(fields).Debug(\">>>> GetVolumes\")\n\t\tdefer log.WithFields(fields).Debug(\"<<<< GetVolumes\")\n\t}\n\n\t// Query volumes on array\n\tresponse, responseBody, err := d.InvokeAPI(nil, \"GET\", \"/volumes\")\n\tif err != nil {\n\t\treturn nil, errors.New(\"failed to read volumes\")\n\t}\n\n\tif response.StatusCode != http.StatusOK {\n\t\treturn nil, Error{\n\t\t\tCode: response.StatusCode,\n\t\t\tMessage: \"failed to read volumes\",\n\t\t}\n\t}\n\n\tvolumes := make([]VolumeEx, 0)\n\terr = json.Unmarshal(responseBody, &volumes)\n\tif err != nil {\n\t\treturn nil, fmt.Errorf(\"could not parse volume data: %s. %v\", string(responseBody), err)\n\t}\n\n\tlog.WithField(\"Count\", len(volumes)).Debug(\"Read volumes.\")\n\n\treturn volumes, nil\n}", "title": "" }, { "docid": "4d67b8983b43f2ccb8c9caa11a0f09f6", "score": "0.47249624", "text": "func (s *xlStorage) ReadAll(ctx context.Context, volume string, path string) (buf []byte, err error) {\n\tvolumeDir, err := s.getVolDir(volume)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\t// Validate file path length, before reading.\n\tfilePath := pathJoin(volumeDir, path)\n\tif err = checkPathLength(filePath); err != nil {\n\t\treturn nil, err\n\t}\n\n\trequireDirectIO := globalStorageClass.GetDMA() == storageclass.DMAReadWrite\n\treturn s.readAllData(volumeDir, filePath, requireDirectIO)\n}", "title": "" }, { "docid": "cc355e0c2462859c865f3acadf57d741", "score": "0.47221187", "text": "func (c Client) Volumes() ([]*types.Volume, error) {\n\tc.Client.API().AddHeader(\"requestPath\", c.requestPath())\n\tserviceVolumeMap, err := c.Client.API().Volumes(\n\t\tc.ctx, false)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\tvar vols []*types.Volume\n\tfor serviceName, volumeMap := range serviceVolumeMap {\n\t\tfor _, vol := range volumeMap {\n\t\t\tvols = append(vols, NewVolume(vol, serviceName))\n\t\t}\n\t}\n\treturn vols, nil\n}", "title": "" }, { "docid": "b14d0707b426c03616412d452b02b141", "score": "0.472117", "text": "func (client *Client) ListVolumes(all bool) ([]api.Volume, error) {\n\t// return client.osclt.ListVolumes(all)\n\tif all {\n\t\treturn client.osclt.ListVolumes(all)\n\t}\n\treturn client.listMonitoredVolumes()\n}", "title": "" }, { "docid": "e4dcf7303be089d5d1cb42ac2a47b526", "score": "0.47208995", "text": "func (mo *SearchIndex) FindAllByUuid(\n\tdatacenter *Datacenter, uuid string, vmSearch bool, instanceUuid bool,\n) ([]*ManagedEntity, error) {\n\n\trequest := struct {\n\t\tXMLName xml.Name `xml:\"FindAllByUuid\"`\n\t\tThis *ManagedObjectReference `xml:\"_this,omitempty\"`\n\t\tDatacenter *Datacenter `xml:\"datacenter,omitempty\"`\n\t\tUuid string `xml:\"uuid,omitempty\"`\n\t\tVmSearch bool `xml:\"vmSearch,omitempty\"`\n\t\tInstanceUuid bool `xml:\"instanceUuid,omitempty\"`\n\t}{\n\t\tThis: &ManagedObjectReference{Type: mo.ManagedObject.Type, Value: mo.ManagedObject.Value},\n\t\tDatacenter: datacenter,\n\t\tUuid: uuid,\n\t\tVmSearch: vmSearch,\n\t\tInstanceUuid: instanceUuid,\n\t}\n\n\tresponse := struct {\n\t\tReturnval []*ManagedEntity `xml:\"returnval\"`\n\t}{}\n\n\tif session == nil {\n\t\tpanic(\"You need to create a vSphereSession first\")\n\t}\n\n\terr := session.invoke(request, &response)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\treturn response.Returnval, nil\n\n}", "title": "" }, { "docid": "5d0009d673ea7afcac8e5a0ad6277b27", "score": "0.4720665", "text": "func (q dbQuery) All() (DBSlice, error) {\n\tvar o DBSlice\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 DB slice\")\n\t}\n\n\tif len(dbAfterSelectHooks) != 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": "d3be5f100e4b274968888e251ead18d4", "score": "0.47162318", "text": "func (o *GetMandatesParams) SetFilterAllVersions(filterAllVersions *bool) {\n\to.FilterAllVersions = filterAllVersions\n}", "title": "" }, { "docid": "963bb47c158e97e5fe0a9e144007d2e7", "score": "0.47152564", "text": "func ListLVMPhysicalVolume() ([]PhysicalVolume, error) {\n\tif err := ReloadLVMMetadataCache(); err != nil {\n\t\treturn nil, err\n\t}\n\n\targs := []string{\n\t\t\"--options\", \"pv_all,vg_name\",\n\t\t\"--reportformat\", \"json\",\n\t\t\"--units\", \"b\",\n\t}\n\tcmd := exec.Command(PVList, args...)\n\toutput, err := cmd.CombinedOutput()\n\tif err != nil {\n\t\tklog.Errorf(\"lvm: error while running command %s %v: %v\", PVList, args, err)\n\t\treturn nil, err\n\t}\n\treturn decodePvsJSON(output)\n}", "title": "" }, { "docid": "375bdf670d34356d980160f29a6d621a", "score": "0.4713027", "text": "func (c *Client) List(opts metav1.ListOptions) (*zfsvolumev1.ZFSVolumeList, error) {\n\treturn c.clientset.ZfsV1().ZFSVolumes().List(opts)\n}", "title": "" }, { "docid": "27aac46cfac7f11b9f49a9d98753f189", "score": "0.47089276", "text": "func (q *Query) FindAll(v interface{}) error {\n\treturn q.FindAllWithContext(defaultContext, v)\n}", "title": "" }, { "docid": "737d4a6e8a699d4395c9b8bb704f70b1", "score": "0.4704843", "text": "func (q productQuery) All(ctx context.Context, exec boil.ContextExecutor) (ProductSlice, error) {\n\tvar o []*Product\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 Product slice\")\n\t}\n\n\tif len(productAfterSelectHooks) != 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": "39b1087f84aafc579e0fa6a61335e3df", "score": "0.47003046", "text": "func (o ContainerResponseOutput) Volumes() pulumi.StringArrayOutput {\n\treturn o.ApplyT(func(v ContainerResponse) []string { return v.Volumes }).(pulumi.StringArrayOutput)\n}", "title": "" }, { "docid": "5c260410c2b7297d9dc7b33c535f166b", "score": "0.4698091", "text": "func (s *SmartContract) QueryAllProducts(ctx contractapi.TransactionContextInterface) ([]QueryResult, error) {\n startKey := \"PRODUCT0\" \n endKey := \"PRODUCT99\" \n \n resultsIterator, err := ctx.GetStub().GetStateByRange(startKey, endKey) \n if err != nil { \n return nil, err \n } \n \n defer resultsIterator.Close() \n results := []QueryResult{} \n for resultsIterator.HasNext() { \n queryResponse, err := resultsIterator.Next() \n if err != nil { \n return nil, err \n } \n \n product := new(Product) \n _ = json.Unmarshal(queryResponse.Value, product) \n \n queryResult := QueryResult{Key: queryResponse.Key, Record: product}\n results = append(results, queryResult)\n } \n \n return results, nil \n}", "title": "" }, { "docid": "1ac26b127fd8301c862bef011f8ec929", "score": "0.4691994", "text": "func (s *ProjectServiceOp) ListVolumes(projectID string) ([]Volume, *Response, error) {\n\turl := fmt.Sprintf(\"%s/%s%s\", projectBasePath, projectID, volumeBasePath)\n\troot := new(volumesRoot)\n\n\tresp, err := s.client.DoRequest(\"GET\", url, nil, root)\n\tif err != nil {\n\t\treturn nil, resp, err\n\t}\n\n\treturn root.Volumes, resp, err\n}", "title": "" }, { "docid": "a617c3ccf4872b08be11697008b28dec", "score": "0.46822408", "text": "func (r *TransactionRepo) All(query string) (TransactionsCollection, error) {\n\t//log.Println(query)\n\tresult := TransactionsCollection{[]Transaction{}}\n\terr := r.coll.Find(bson.M{\n\t\t\"$or\": bson.M{\n\t\t\t\"subject\": query,\n\t\t\t\"object\": query,\n\t\t}}).All(&result.Data)\n\tif err != nil {\n\t\treturn result, err\n\t}\n\n\treturn result, nil\n}", "title": "" }, { "docid": "cbf7639caf1f9006c729d42359722526", "score": "0.46744567", "text": "func (a *Client) ListVolumes(params *ListVolumesParams, authInfo runtime.ClientAuthInfoWriter) (*ListVolumesOK, error) {\n\t// TODO: Validate the params before sending\n\tif params == nil {\n\t\tparams = NewListVolumesParams()\n\t}\n\n\tresult, err := a.transport.Submit(&runtime.ClientOperation{\n\t\tID: \"ListVolumes\",\n\t\tMethod: \"GET\",\n\t\tPathPattern: \"/block/volumes/bulk.json\",\n\t\tProducesMediaTypes: []string{\"application/json\", \"application/x-gzip\"},\n\t\tConsumesMediaTypes: []string{\"application/json\"},\n\t\tSchemes: []string{\"http\", \"https\"},\n\t\tParams: params,\n\t\tReader: &ListVolumesReader{formats: a.formats},\n\t\tAuthInfo: authInfo,\n\t})\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\treturn result.(*ListVolumesOK), nil\n}", "title": "" }, { "docid": "a97bea90b8cc16fc1bfbac422b01adcb", "score": "0.46735924", "text": "func (s *Dao) List(ctx context.Context, project, domain string, options ...datasource.FindOption) (*model.KVResponse, error) {\n\tresult, opts, err := s.listData(ctx, project, domain, options...)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\tfilterKVs, err := auth.FilterKVList(ctx, result.Data)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\tresult.Data = filterKVs\n\tresult.Total = len(filterKVs)\n\n\treturn pagingResult(result, opts), nil\n}", "title": "" }, { "docid": "29bf41d51ba8f47920320b92b431c650", "score": "0.46729347", "text": "func (o TaskSpecResponseOutput) Volumes() VolumeResponseArrayOutput {\n\treturn o.ApplyT(func(v TaskSpecResponse) []VolumeResponse { return v.Volumes }).(VolumeResponseArrayOutput)\n}", "title": "" }, { "docid": "8638c3586dcba86e6fd7ce873c993e76", "score": "0.4672662", "text": "func (o TriggerBuildStepOutput) Volumes() TriggerBuildStepVolumeArrayOutput {\n\treturn o.ApplyT(func(v TriggerBuildStep) []TriggerBuildStepVolume { return v.Volumes }).(TriggerBuildStepVolumeArrayOutput)\n}", "title": "" }, { "docid": "e570221af0b7f97b27c1e3e26d983928", "score": "0.4670378", "text": "func (mo *HostStorageSystem) QueryUnresolvedVmfsVolume() ([]*HostUnresolvedVmfsVolume, error) {\n\n\trequest := struct {\n\t\tXMLName xml.Name `xml:\"QueryUnresolvedVmfsVolume\"`\n\t\tThis *ManagedObjectReference `xml:\"_this,omitempty\"`\n\t}{\n\t\tThis: &ManagedObjectReference{Type: mo.ManagedObject.Type, Value: mo.ManagedObject.Value},\n\t}\n\n\tresponse := struct {\n\t\tReturnval []*HostUnresolvedVmfsVolume `xml:\"returnval\"`\n\t}{}\n\n\tif session == nil {\n\t\tpanic(\"You need to create a vSphereSession first\")\n\t}\n\n\terr := session.invoke(request, &response)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\treturn response.Returnval, nil\n\n}", "title": "" }, { "docid": "eddce37a87e8097058ee307225a1be71", "score": "0.46668038", "text": "func (q patientQuery) All(ctx context.Context, exec boil.ContextExecutor) (PatientSlice, error) {\n\tvar o []*Patient\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 Patient slice\")\n\t}\n\n\tif len(patientAfterSelectHooks) != 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": "6f20d9fbb0b7fd2f6b95692451a3ea2c", "score": "0.46651506", "text": "func VolumeStates(exec boil.Executor, mods ...qm.QueryMod) volumeStateQuery {\n\tmods = append(mods, qm.From(\"\\\"volume_state\\\"\"))\n\treturn volumeStateQuery{NewQuery(exec, mods...)}\n}", "title": "" }, { "docid": "569fc440ad10cd74365014322bc39720", "score": "0.4657985", "text": "func (q eventQuery) All(ctx context.Context, exec boil.ContextExecutor) (EventSlice, error) {\n\tvar o []*Event\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 Event slice\")\n\t}\n\n\tif len(eventAfterSelectHooks) != 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": "ea3a4937e422f93d197bbe2081e118b4", "score": "0.4657934", "text": "func (eptq *EquipmentPortTypeQuery) All(ctx context.Context) ([]*EquipmentPortType, error) {\n\treturn eptq.sqlAll(ctx)\n}", "title": "" }, { "docid": "8dc7378f0c4003c27338cbaec6e3fcb9", "score": "0.46418023", "text": "func (r repository) Query(ctx context.Context, offset, limit int) (\n\t[]entity.File, error) {\n\tvar res interface{}\n\n\tparams := make(map[string]interface{}, 1)\n\tparams[\"docType\"] = \"file\"\n\tparams[\"offset\"] = offset\n\tparams[\"limit\"] = limit\n\n\tstatement := r.db.N1QLQuery[dbcontext.GetAllDocType]\n\terr := r.db.Query(ctx, statement, params, &res)\n\tif err != nil {\n\t\treturn []entity.File{}, err\n\t}\n\tfiles := []entity.File{}\n\tfor _, u := range res.([]interface{}) {\n\t\tfile := entity.File{}\n\t\tb, _ := json.Marshal(u)\n\t\tjson.Unmarshal(b, &file)\n\t\tfiles = append(files, file)\n\t}\n\treturn files, nil\n}", "title": "" }, { "docid": "9f51212fe1e4a95dd5965249939662ed", "score": "0.46396586", "text": "func (ds *dataStore) GetAll() interface{} {\n\tarr := []psmb.MbtcpFilterStatus{}\n\tds.RLock()\n\tfor _, v := range ds.m {\n\t\tarr = append(arr, v.(psmb.MbtcpFilterStatus))\n\t}\n\tds.RUnlock()\n\n\tif len(arr) == 0 {\n\t\terr := ErrNoData\n\t\tconf.Log.WithError(err).Warn(\"Fail to get all items from filter data store\")\n\t\treturn nil\n\t}\n\treturn arr\n}", "title": "" }, { "docid": "88eb80d0705e0516529e121fe47fdd3e", "score": "0.46394527", "text": "func ByVolumeGroup(group string) By {\n\treturn byVolumeGroup(group)\n}", "title": "" }, { "docid": "b59079da00124d134718a86d547ffb39", "score": "0.46352503", "text": "func (client *Client) ListVolumes(all bool) ([]api.Volume, error) {\n\treturn client.osclt.ListVolumes(all)\n}", "title": "" }, { "docid": "a21dfcfd0c5afb11edb3c18b4955418b", "score": "0.46258947", "text": "func (r Network_Storage) GetSnapshotsForVolume() (resp []datatypes.Network_Storage, err error) {\n\terr = r.Session.DoRequest(\"SoftLayer_Network_Storage\", \"getSnapshotsForVolume\", nil, &r.Options, &resp)\n\treturn\n}", "title": "" }, { "docid": "e3b470b9a58a31563a43f2a4e54294b3", "score": "0.4622498", "text": "func (q totalQuery) All(ctx context.Context, exec boil.ContextExecutor) (TotalSlice, error) {\n\tvar o []*Total\n\n\terr := q.Bind(ctx, exec, &o)\n\tif err != nil {\n\t\treturn nil, errors.Wrap(err, \"boiler: failed to assign all query results to Total slice\")\n\t}\n\n\treturn o, nil\n}", "title": "" } ]
2d5d0f46394a68b2c6b805eb7e3305dc
Prefix accesses the prefix for the client, The prefix is the part of the URI between the endpoint and the hostname, of the API.
[ { "docid": "000868fa803635290e29b4a2cee36d85", "score": "0.74788815", "text": "func (c *Client) Prefix() string {\n\treturn c.prefix\n}", "title": "" } ]
[ { "docid": "055c7cf0af46e9f0e3bd89df807460ed", "score": "0.7529207", "text": "func (s *MagazineService) Prefix() string {\n\treturn \"/magazine\"\n}", "title": "" }, { "docid": "dedf566ffde8f69672f58f48773760f7", "score": "0.7302548", "text": "func SetPrefix(pre string) {\n\tservicePrefix = pre\n}", "title": "" }, { "docid": "a36d59c36c39fc01f31918f1c79efb79", "score": "0.7269504", "text": "func (s *cordswainerServer) PathPrefix() string {\n\treturn baseServicePath(s.pathPrefix, \"twirp.example.cordswainer.v1\", \"Cordswainer\")\n}", "title": "" }, { "docid": "19210e0d29fafe40325ac3a584a2ed91", "score": "0.7263887", "text": "func (s *autoRollServiceServer) PathPrefix() string {\n\treturn baseServicePath(s.pathPrefix, \"autoroll.rpc\", \"AutoRollService\")\n}", "title": "" }, { "docid": "b03a22be069dd011959b82555aac5c2d", "score": "0.7152183", "text": "func RESTPrefix(hostname string) string {\n\tif strings.Contains(hostname, \"127.0.0.1\") ||\n\t\tstrings.Contains(hostname, \"localhost\") {\n\t\treturn fmt.Sprintf(\"http://%s/api/v1/\", hostname) // unsecure HTTP for dev\n\t}\n\treturn fmt.Sprintf(\"https://%s/api/v1/\", hostname)\n}", "title": "" }, { "docid": "4abfbd7312b5421a28ed73c730e4ad5f", "score": "0.7149848", "text": "func GetPrefix() string {\n return prefix\n}", "title": "" }, { "docid": "331bba6c125084e701c2c2fccd843857", "score": "0.71456045", "text": "func (s *svc) Prefix() string {\n\treturn s.conf.Prefix\n}", "title": "" }, { "docid": "63e5d836ca8af00a331708c1d4382d01", "score": "0.7098469", "text": "func (r resourceHandler) Prefix() string { return r.prefix }", "title": "" }, { "docid": "fae1323e480c4d9a7a92e9b878a0f9f3", "score": "0.7090434", "text": "func (r *RouterPrefix) Prefix(prefix string) *RouterPrefix {\n\tif prefix == \"\" {\n\t\tpanic(\"prefix must begin with '/', '\" + prefix + \"'\")\n\t}\n\n\tif prefix[0] != '/' {\n\t\tpanic(\"prefix must start with '/', '\" + prefix + \"'\")\n\t}\n\n\treturn &RouterPrefix{\n\t\tbasePath: prefix,\n\t\trouter: r.router,\n\t}\n}", "title": "" }, { "docid": "806a193d4e03c0f5b9967cb0ae08c23e", "score": "0.70626557", "text": "func (s *CaptionsService) Prefix() string {\n\treturn \"\"\n}", "title": "" }, { "docid": "0a46b5e46dce1daac0500e3b6330377f", "score": "0.7054035", "text": "func (this *Route) Prefix(prefix string) *Route {\n\tthis.uri = strings.Trim(strings.TrimRight(prefix, \"/\")+\"/\"+strings.TrimLeft(this.uri, \"/\"), \"/\")\n\treturn this\n}", "title": "" }, { "docid": "6844e17397dc386b56d5b3369404fbde", "score": "0.7006765", "text": "func (a *AppService) GetPrefix() string {\n\treturn \"azure.appservice\"\n}", "title": "" }, { "docid": "cd4519586fa6196c8799c13ab417285b", "score": "0.6960952", "text": "func APIPrefix(prefix string) Option {\n\treturn func(opts *options) {\n\t\topts.prefix = prefix\n\t}\n}", "title": "" }, { "docid": "448c7048bc7a9d5ed8bdf33204f36ece", "score": "0.69550264", "text": "func (c *ircClient) Prefix() string {\n\tc.mu.Lock()\n\tdefer c.mu.Unlock()\n\treturn fmt.Sprintf(\"%s!%s@%s\", c.nick, c.user, c.host)\n}", "title": "" }, { "docid": "add77ac72e7f4fe2d83e6fe4ccd23986", "score": "0.6952936", "text": "func (backend Backend) Prefix() (string, error) {\n\tif backend.Local != nil {\n\t\treturn \"\", nil\n\t} else if backend.S3 != nil {\n\t\treturn backend.S3.Prefix, nil\n\t} else if backend.GCS != nil {\n\t\treturn backend.GCS.Prefix, nil\n\t} else if backend.Azure != nil {\n\t\treturn backend.Azure.Prefix, nil\n\t} else if backend.Swift != nil {\n\t\treturn backend.Swift.Prefix, nil\n\t} else if backend.Rest != nil {\n\t\tu, err := url.Parse(backend.Rest.URL)\n\t\tif err != nil {\n\t\t\treturn \"\", err\n\t\t}\n\t\treturn u.Path, nil\n\t}\n\treturn \"\", errors.New(\"failed to get prefix. Reason: Unknown backend type.\")\n}", "title": "" }, { "docid": "95f945c53e35ef929276f4def9fadfcf", "score": "0.69443977", "text": "func (s *organizationServiceServer) PathPrefix() string {\n\treturn baseServicePath(s.pathPrefix, \"buf.alpha.registry.v1alpha1\", \"OrganizationService\")\n}", "title": "" }, { "docid": "2c12abdfd67b906f3a513285decfcc5b", "score": "0.6915184", "text": "func (r *RestBuilder) PathPrefix( pathPrefix string ) *RestBuilder {\n if pathPrefix == \"/\" {\n pathPrefix = \"\"\n }\n\n if pathPrefix != \"\" {\n if pathPrefix[0:1] != \"/\" {\n pathPrefix = \"/\" + pathPrefix\n }\n for len(pathPrefix) > 1 && pathPrefix[len(pathPrefix)-1:] == \"/\" {\n pathPrefix = pathPrefix[0:len(pathPrefix)-1]\n }\n }\n\n if pathPrefix == \"/\" {\n pathPrefix = \"\"\n }\n\n r.pathPrefix = pathPrefix\n\n // Create the router for this prefix\n if pathPrefix != \"\" {\n r.pathPrefixRoute = r.server.router.NewRoute().\n PathPrefix( pathPrefix + \"/\" ).\n Subrouter()\n }\n\n return r\n}", "title": "" }, { "docid": "b5a0a6d4d085ed388b45d5727fac7faf", "score": "0.68968517", "text": "func (a *APIApp) SetPrefix(p string) {\n\tif !strings.HasPrefix(p, \"/\") {\n\t\tp = \"/\" + p\n\t}\n\n\ta.prefix = p\n}", "title": "" }, { "docid": "8a34bc8eb2cef351809b34fa1eee95ec", "score": "0.68710643", "text": "func APIPrefix(prefix string) Option {\n\treturn func(opts *Server) {\n\t\topts.apiPrefix = prefix\n\t}\n}", "title": "" }, { "docid": "8a34bc8eb2cef351809b34fa1eee95ec", "score": "0.68710643", "text": "func APIPrefix(prefix string) Option {\n\treturn func(opts *Server) {\n\t\topts.apiPrefix = prefix\n\t}\n}", "title": "" }, { "docid": "345572c837a4420318e4c9d103ce7504", "score": "0.6837545", "text": "func (o AppSpecServiceCorsAllowOriginsOutput) Prefix() pulumi.StringPtrOutput {\n\treturn o.ApplyT(func(v AppSpecServiceCorsAllowOrigins) *string { return v.Prefix }).(pulumi.StringPtrOutput)\n}", "title": "" }, { "docid": "e314b2c4847754bf668842ab7d81462e", "score": "0.68164885", "text": "func (c *Client) SetPrefix(p string) error {\n\tc.prefix = strings.Trim(p, \"/\")\n\treturn nil\n}", "title": "" }, { "docid": "3a3cc897dffd3129a936807871e0fbca", "score": "0.68129206", "text": "func (o GetAppSpecServiceCorsAllowOriginsOutput) Prefix() pulumi.StringPtrOutput {\n\treturn o.ApplyT(func(v GetAppSpecServiceCorsAllowOrigins) *string { return v.Prefix }).(pulumi.StringPtrOutput)\n}", "title": "" }, { "docid": "9d8725cbd4caf451e3cc91597afd2dd6", "score": "0.68120253", "text": "func (server *APIServer) GetPrefix() string {\n\treturn server.Prefix\n}", "title": "" }, { "docid": "09ff14a4045b1bcadb316e06fea00313", "score": "0.6785746", "text": "func GetPrefix() string {\n\treturn prefix\n}", "title": "" }, { "docid": "1578e679687db0f445be22678cdd4d9b", "score": "0.67391294", "text": "func (s *server) Prefix() *irc.Prefix {\n\treturn &irc.Prefix{Name: s.config.Name}\n}", "title": "" }, { "docid": "fab99fe981403ad35ee165b4ada3b8f9", "score": "0.6713685", "text": "func (base BaseHandler) Prefix() string {\n\treturn base.prefix\n}", "title": "" }, { "docid": "6ee179f50e64ee568d177f8b62e6acb8", "score": "0.6710908", "text": "func (s *cacheServer) PathPrefix() string {\n\treturn baseServicePath(s.pathPrefix, \"trivy.cache.v1\", \"Cache\")\n}", "title": "" }, { "docid": "bc74b5e5eb3281fba3b33d1ed0d9fed1", "score": "0.6705216", "text": "func (s *repositoryServiceServer) PathPrefix() string {\n\treturn baseServicePath(s.pathPrefix, \"buf.alpha.registry.v1alpha1\", \"RepositoryService\")\n}", "title": "" }, { "docid": "a8cb1dd86a59d0bdedc48349937112c3", "score": "0.66994387", "text": "func (s *Client) SetPrefix(prefix string) {\n\tif s == nil {\n\t\treturn\n\t}\n\ts.prefix = prefix\n}", "title": "" }, { "docid": "dce353567891e9cdfacd269ca2430d58", "score": "0.6694716", "text": "func (b rBuilder) Prefix(prefix string) rBuilder {\n\treturn builder.Set(b, \"prefix\", prefix).(rBuilder)\n}", "title": "" }, { "docid": "48dbaac480bfb0a3fc339edc2cf93d71", "score": "0.669404", "text": "func (m *Mux) Prefix(p string) *Mux {\n\tm.prefix = strings.TrimSuffix(p, \"/\")\n\treturn m\n}", "title": "" }, { "docid": "5228deb2323a12855e110a3bc3143869", "score": "0.6654488", "text": "func (_options *GetAutocompletionOptions) SetPrefix(prefix string) *GetAutocompletionOptions {\n\t_options.Prefix = core.StringPtr(prefix)\n\treturn _options\n}", "title": "" }, { "docid": "13c22006150e46c08fc761ee48461423", "score": "0.66300476", "text": "func APIPrefix(pre string) JSOpt {\n\treturn jsOptFn(func(js *jsOpts) error {\n\t\tjs.pre = pre\n\t\tif !strings.HasSuffix(js.pre, \".\") {\n\t\t\tjs.pre = js.pre + \".\"\n\t\t}\n\t\treturn nil\n\t})\n}", "title": "" }, { "docid": "e625c2a127662e07b7e41ff5e9fd69de", "score": "0.66207135", "text": "func (o GetAppSpecFunctionCorsAllowOriginsOutput) Prefix() pulumi.StringPtrOutput {\n\treturn o.ApplyT(func(v GetAppSpecFunctionCorsAllowOrigins) *string { return v.Prefix }).(pulumi.StringPtrOutput)\n}", "title": "" }, { "docid": "a0f3a71db1a0a6cb7b09e09ea1ff0f72", "score": "0.6614162", "text": "func (o AppSpecFunctionCorsAllowOriginsOutput) Prefix() pulumi.StringPtrOutput {\n\treturn o.ApplyT(func(v AppSpecFunctionCorsAllowOrigins) *string { return v.Prefix }).(pulumi.StringPtrOutput)\n}", "title": "" }, { "docid": "3ececdd3baa7bc58621e73003665fa9b", "score": "0.6610836", "text": "func (s *teamServiceServer) PathPrefix() string {\n\treturn baseServicePath(s.pathPrefix, \"buf.alpha.registry.v1alpha1\", \"TeamService\")\n}", "title": "" }, { "docid": "94a90a62897b386ee4c136b784f70ea9", "score": "0.6556209", "text": "func (s *repositoryBranchServiceServer) PathPrefix() string {\n\treturn baseServicePath(s.pathPrefix, \"buf.alpha.registry.v1alpha1\", \"RepositoryBranchService\")\n}", "title": "" }, { "docid": "365b44e2f3b9678d560552e4aa9d81f2", "score": "0.6546658", "text": "func (o AppSpecServiceCorsAllowOriginsPtrOutput) Prefix() pulumi.StringPtrOutput {\n\treturn o.ApplyT(func(v *AppSpecServiceCorsAllowOrigins) *string {\n\t\tif v == nil {\n\t\t\treturn nil\n\t\t}\n\t\treturn v.Prefix\n\t}).(pulumi.StringPtrOutput)\n}", "title": "" }, { "docid": "0f44aaabddc6a96572381c7c2aca0d83", "score": "0.6544464", "text": "func (o GetAppSpecServiceCorsAllowOriginsPtrOutput) Prefix() pulumi.StringPtrOutput {\n\treturn o.ApplyT(func(v *GetAppSpecServiceCorsAllowOrigins) *string {\n\t\tif v == nil {\n\t\t\treturn nil\n\t\t}\n\t\treturn v.Prefix\n\t}).(pulumi.StringPtrOutput)\n}", "title": "" }, { "docid": "04c7e9f34082e701d58b2ddbea7183be", "score": "0.6539227", "text": "func (s *repoServer) PathPrefix() string {\n\treturn baseServicePath(s.pathPrefix, \"redsail.bosn\", \"Repo\")\n}", "title": "" }, { "docid": "fe31a72dfc1342b81671b5ae372a1678", "score": "0.6527822", "text": "func (c *Client) GetWithPrefix(key string) (*clientv3.GetResponse, error) {\n\tctx, cancel := context.WithTimeout(context.Background(), requestTimeout)\n\tresp, err := c.Client.Get(ctx, key, clientv3.WithPrefix())\n\tcancel()\n\treturn resp, err\n}", "title": "" }, { "docid": "bab3c2ccd073d44c8f28d938cbe5f176", "score": "0.652559", "text": "func (o AppSpecStaticSiteCorsAllowOriginsOutput) Prefix() pulumi.StringPtrOutput {\n\treturn o.ApplyT(func(v AppSpecStaticSiteCorsAllowOrigins) *string { return v.Prefix }).(pulumi.StringPtrOutput)\n}", "title": "" }, { "docid": "f38b0941c82870cad913a3e330cdf690", "score": "0.65171653", "text": "func JSONPrefix() string {\n\tmu.RLock()\n\tdefer mu.RUnlock()\n\tprefix := jsonPrefix\n\treturn prefix\n}", "title": "" }, { "docid": "fa15bd1358f73737db05fc12dbfd1214", "score": "0.6516875", "text": "func (o GetAppSpecStaticSiteCorsAllowOriginsOutput) Prefix() pulumi.StringPtrOutput {\n\treturn o.ApplyT(func(v GetAppSpecStaticSiteCorsAllowOrigins) *string { return v.Prefix }).(pulumi.StringPtrOutput)\n}", "title": "" }, { "docid": "91dfedce945092717d6fe26b419c5e4a", "score": "0.65074813", "text": "func (e *Client) PrefixGet(ctx context.Context, prefix string) (map[string][]byte, error) {\n\tkey := e.KeyWithRootPath(prefix)\n\tkv := clientv3.NewKV(e.client)\n\tresp, err := kv.Get(ctx, key, clientv3.WithPrefix())\n\tif err != nil {\n\t\treturn nil, errors.Trace(err)\n\t}\n\tr := make(map[string][]byte)\n\tfor _, kv := range resp.Kvs {\n\t\tprefix := e.rootPath\n\t\tif !strings.HasSuffix(prefix, \"/\") {\n\t\t\tprefix = prefix + \"/\"\n\t\t}\n\t\tk := strings.TrimPrefix(string(kv.Key), prefix)\n\t\tr[k] = kv.Value\n\t}\n\treturn r, nil\n}", "title": "" }, { "docid": "db6c39c01d1708b5beddf903047b95be", "score": "0.6505757", "text": "func (kf *KeyFormat) Prefix() string {\n\treturn string([]byte{kf.prefix})\n}", "title": "" }, { "docid": "88319866de5f729097346cd3191e8908", "score": "0.6503544", "text": "func Prefix(serveFile FileServerFunc, folder, urlPrefix string) http.HandlerFunc {\n\treturn func(w http.ResponseWriter, r *http.Request) {\n\t\tif !strings.HasPrefix(r.URL.Path, urlPrefix) {\n\t\t\thttp.NotFound(w, r)\n\t\t\treturn\n\t\t}\n\t\tserveFile(w, r, folder+strings.TrimPrefix(r.URL.Path, urlPrefix))\n\t}\n}", "title": "" }, { "docid": "01b7d65a6ab9e47c6f9545e4ae7e38e9", "score": "0.6483795", "text": "func (key *Key) Prefix() string {\n\treturn key.name\n}", "title": "" }, { "docid": "c6229b85bcfba3691a8359d17315b09a", "score": "0.64746684", "text": "func (m *Use) Prefix() string {\n\treturn \"users/volume\"\n}", "title": "" }, { "docid": "b5e6a637ec7a33f5481a6825ad28244c", "score": "0.6470877", "text": "func PrefixClient(client Client, prefix string) Client {\n\treturn &prefixedKVClient{prefix, client}\n}", "title": "" }, { "docid": "cfc46a4da26efdb737c7dcbd0fd4e15f", "score": "0.6460963", "text": "func (b *Batcher) Prefix() string {\n\treturn fmt.Sprintf(\"{%s}.\", b.config.BatcherShardKey)\n}", "title": "" }, { "docid": "710938298bbe85bce8edd575c52026ca", "score": "0.64605016", "text": "func SetPrefix(prefix string) {\n\tglobalMetrics.SetPrefix(prefix)\n}", "title": "" }, { "docid": "18e3fd3db68a3770b460a92a0cc52156", "score": "0.6441653", "text": "func (s *repositoryCommitServiceServer) PathPrefix() string {\n\treturn baseServicePath(s.pathPrefix, \"buf.alpha.registry.v1alpha1\", \"RepositoryCommitService\")\n}", "title": "" }, { "docid": "38467f065f98b32211f3397652fb9adc", "score": "0.64270717", "text": "func (m *MCRWrapper) Prefix() string {\n\treturn \"mcr.microsoft.com/\"\n}", "title": "" }, { "docid": "a0d5c0cf94ce3d5d1fdd11628fcc9f6a", "score": "0.64085305", "text": "func (u User) NamespacePrefix() string {\n\tborkPrefix := envy.Get(\"BORK_NAMESPACE_PREFIX\", \"bork\")\n\n\tusername := strings.Split(strings.ToLower(u.Username), \" \")\n\n\tprefix := append([]string{borkPrefix}, username...)\n\n\treturn strings.Join(prefix, \"-\")\n}", "title": "" }, { "docid": "cac952dd09128c4a70028bfe0120b981", "score": "0.6404793", "text": "func (tool Tool) SetPrefix(prefix string) Tool {\n\ttool.prefix = prefix\n\treturn tool\n}", "title": "" }, { "docid": "1247c3672b764d22bf25ffee6ae66bfc", "score": "0.63925564", "text": "func Prefix(p string) {\n\tif p == \"\" || p == \"/\" {\n\t\treturn\n\t}\n\n\tbinDirPath = \"\"\n\tbinFilePath = \"\"\n\tlogDirPath = \"\"\n\tlibDirPath = \"\"\n\trunDirPath = \"\"\n\tetcDirPath = \"\"\n\tpidFilePath = \"\"\n\n\tprefix = p\n}", "title": "" }, { "docid": "3638e996777bce5930978f571214a0d6", "score": "0.6390254", "text": "func (o Options) ResourcePrefix() string {\n\treturn o.EtcdOptions.RESTOptions.ResourcePrefix\n}", "title": "" }, { "docid": "7ee368a45ffb279b6bf94b435c2713f9", "score": "0.6383052", "text": "func (pa *Patient) QueryPrefix() *PrefixQuery {\n\treturn (&PatientClient{config: pa.config}).QueryPrefix(pa)\n}", "title": "" }, { "docid": "7e5b45965abbfa9e1f3324b8d19652b8", "score": "0.637901", "text": "func (o GetAppSpecFunctionCorsAllowOriginsPtrOutput) Prefix() pulumi.StringPtrOutput {\n\treturn o.ApplyT(func(v *GetAppSpecFunctionCorsAllowOrigins) *string {\n\t\tif v == nil {\n\t\t\treturn nil\n\t\t}\n\t\treturn v.Prefix\n\t}).(pulumi.StringPtrOutput)\n}", "title": "" }, { "docid": "00e24773d9d2b58ed48e4e1e7b633939", "score": "0.6372243", "text": "func PathPrefix(r *http.Request) string {\n\tif prefix := httputil.PathBase(r); prefix != \"\" {\n\t\treturn prefix\n\t}\n\treturn \"/\"\n}", "title": "" }, { "docid": "e9436aa9842a861d2863d231b8a7a482", "score": "0.63661826", "text": "func (app *appContext) prefixHandler(w http.ResponseWriter, r *http.Request) {\n\tvar err error\n\tvar data *model.PrefixList\n\tparams := httprouter.ParamsFromContext(r.Context())\n\tprefixType := strings.ToLower(params.ByName(\"type\"))\n\tname := cleanDomain(params.ByName(\"prefix\"))\n\tif prefixType == \"active\" {\n\t\tdata, err = app.ds.GetTakenPrefixes(r.Context(), name)\n\n\t} else if prefixType == \"available\" {\n\t\tdata, err = app.ds.GetAvailablePrefixes(r.Context(), name)\n\t} else {\n\t\tserver.WriteJSONError(w, server.ErrResourceNotFound)\n\t\treturn\n\t}\n\tif err != nil {\n\t\tif err == datastore.ErrNoResource {\n\t\t\t// TODO make http err (not json)\n\t\t\tserver.WriteJSONError(w, server.ErrResourceNotFound)\n\t\t\treturn\n\t\t}\n\t\tpanic(err)\n\t}\n\n\tp := Page{name + \" Prefix\", \"Search\", data}\n\terr = app.templates.ExecuteTemplate(w, \"prefix.tmpl\", p)\n\tif err != nil {\n\t\tpanic(err)\n\t}\n}", "title": "" }, { "docid": "ee928cc1befa3d5ce9bb129d04812f6e", "score": "0.6358135", "text": "func (o AppSpecFunctionCorsAllowOriginsPtrOutput) Prefix() pulumi.StringPtrOutput {\n\treturn o.ApplyT(func(v *AppSpecFunctionCorsAllowOrigins) *string {\n\t\tif v == nil {\n\t\t\treturn nil\n\t\t}\n\t\treturn v.Prefix\n\t}).(pulumi.StringPtrOutput)\n}", "title": "" }, { "docid": "680e4cf8bb35739bc7497f35ea0077c3", "score": "0.6353762", "text": "func SetPrefix(prefix string) {\n\tstd.SetPrefix(prefix)\n}", "title": "" }, { "docid": "30638404f70ed2bdf6919d150948edb2", "score": "0.6323046", "text": "func Prefix(prefix string) Logger {\n\ts := &prefixlog{verbosity: 0}\n\ts.prefix = \"[\" + prefix + \"] \"\n\treturn s\n}", "title": "" }, { "docid": "44c79468696b9598465dc53f533cb945", "score": "0.6320778", "text": "func (s Store) Prefix() string { return s.prefix }", "title": "" }, { "docid": "17854b911321e49e8f402b35733c8ac6", "score": "0.6318333", "text": "func NodePrefix() string {\n\treturn EventPrefix() + \"/node\"\n}", "title": "" }, { "docid": "b5dace534e1b5a640cbab3236f942039", "score": "0.63048464", "text": "func (l EchoLogger) Prefix() string {\n\treturn \"\"\n}", "title": "" }, { "docid": "39a1ac553fcce0c1b53fd6f7963380c8", "score": "0.6300736", "text": "func ExampleCustomIPPrefixesClient_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 := armnetwork.NewClientFactory(\"<subscription-id>\", cred, nil)\n\tif err != nil {\n\t\tlog.Fatalf(\"failed to create client: %v\", err)\n\t}\n\tpoller, err := clientFactory.NewCustomIPPrefixesClient().BeginCreateOrUpdate(ctx, \"rg1\", \"test-customipprefix\", armnetwork.CustomIPPrefix{\n\t\tLocation: to.Ptr(\"westus\"),\n\t\tProperties: &armnetwork.CustomIPPrefixPropertiesFormat{\n\t\t\tCidr: to.Ptr(\"0.0.0.0/24\"),\n\t\t},\n\t}, nil)\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.CustomIPPrefix = armnetwork.CustomIPPrefix{\n\t// \tName: to.Ptr(\"test-customipprefix\"),\n\t// \tType: to.Ptr(\"Microsoft.Network/customIpPrefixes\"),\n\t// \tID: to.Ptr(\"/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/customIpPrefixes/test-customipprefix\"),\n\t// \tLocation: to.Ptr(\"westus\"),\n\t// \tEtag: to.Ptr(\"W/\\\"00000000-0000-0000-0000-00000000\\\"\"),\n\t// \tProperties: &armnetwork.CustomIPPrefixPropertiesFormat{\n\t// \t\tAuthorizationMessage: to.Ptr(\"authorizationMessage\"),\n\t// \t\tChildCustomIPPrefixes: []*armnetwork.SubResource{\n\t// \t\t},\n\t// \t\tCidr: to.Ptr(\"192.168.254.2/24\"),\n\t// \t\tCommissionedState: to.Ptr(armnetwork.CommissionedStateProvisioning),\n\t// \t\tFailedReason: to.Ptr(\"\"),\n\t// \t\tProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded),\n\t// \t\tPublicIPPrefixes: []*armnetwork.SubResource{\n\t// \t\t},\n\t// \t\tResourceGUID: to.Ptr(\"00000000-0000-0000-0000-00000000\"),\n\t// \t\tSignedMessage: to.Ptr(\"signedMessage\"),\n\t// \t},\n\t// \tZones: []*string{\n\t// \t\tto.Ptr(\"1\")},\n\t// \t}\n}", "title": "" }, { "docid": "41ed15954e8a72930bef9e53c99173ee", "score": "0.62817484", "text": "func (l EchoLogger) SetPrefix(s string) {}", "title": "" }, { "docid": "62992c8eadea5e3b6ec04937b076dbe8", "score": "0.6275381", "text": "func ExampleCustomIPPrefixesClient_Get() {\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 := armnetwork.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.NewCustomIPPrefixesClient().Get(ctx, \"rg1\", \"test-customipprefix\", &armnetwork.CustomIPPrefixesClientGetOptions{Expand: nil})\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.CustomIPPrefix = armnetwork.CustomIPPrefix{\n\t// \tName: to.Ptr(\"test-customipprefix\"),\n\t// \tType: to.Ptr(\"Microsoft.Network/customIpPrefixes\"),\n\t// \tID: to.Ptr(\"/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/customIpPrefixes/test-customipprefix\"),\n\t// \tLocation: to.Ptr(\"westus\"),\n\t// \tEtag: to.Ptr(\"W/\\\"00000000-0000-0000-0000-00000000\\\"\"),\n\t// \tProperties: &armnetwork.CustomIPPrefixPropertiesFormat{\n\t// \t\tAuthorizationMessage: to.Ptr(\"authorizationMessage\"),\n\t// \t\tChildCustomIPPrefixes: []*armnetwork.SubResource{\n\t// \t\t},\n\t// \t\tCidr: to.Ptr(\"0.0.0.0/24\"),\n\t// \t\tCommissionedState: to.Ptr(armnetwork.CommissionedStateCommissioned),\n\t// \t\tExpressRouteAdvertise: to.Ptr(false),\n\t// \t\tFailedReason: to.Ptr(\"\"),\n\t// \t\tNoInternetAdvertise: to.Ptr(false),\n\t// \t\tProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded),\n\t// \t\tPublicIPPrefixes: []*armnetwork.SubResource{\n\t// \t\t},\n\t// \t\tResourceGUID: to.Ptr(\"00000000-0000-0000-0000-00000000\"),\n\t// \t\tSignedMessage: to.Ptr(\"signedMessage\"),\n\t// \t},\n\t// }\n}", "title": "" }, { "docid": "31f0bdf24dde20c825a33393eaebcb46", "score": "0.62751794", "text": "func SetPrefix(s string) {\n\t// do nothing\n}", "title": "" }, { "docid": "43babf32c7d4c92649b1cfcb184c11ee", "score": "0.62695074", "text": "func SetPrefix(prefix string, conn db.Connection) *Invoker {\n\ti := DefaultInvoker(conn)\n\ti.prefix = prefix\n\treturn i\n}", "title": "" }, { "docid": "b86e3fd9a3542ce528a5a36bfb32ca20", "score": "0.62670565", "text": "func Prefix(prefix string) Option {\n\treturn func(o *options) {\n\t\to.prefix = prefix\n\t}\n}", "title": "" }, { "docid": "e8b193021b42900439c0ca44b7b5e3ea", "score": "0.6266361", "text": "func (b Base) Prefix() string {\n\tprefix, ok := basePrefixes[b]\n\tif ok {\n\t\treturn prefix\n\t}\n\treturn \"\"\n}", "title": "" }, { "docid": "0bf00c23c30bce21239ba9e791012244", "score": "0.6265661", "text": "func (ma MetadataAddress) Prefix() (string, error) {\n\tprefix, err := VerifyMetadataAddressFormat(ma)\n\tif len(prefix) == 0 {\n\t\treturn prefix, err\n\t}\n\treturn prefix, nil\n}", "title": "" }, { "docid": "986f1c7f7a6f091c5430b6d08a4efc7b", "score": "0.62655765", "text": "func (list *List) Prefix() []byte {\n\tbuffer := make([]byte, list.environ.HeaderLen+17)\n\tcopy(buffer[0:], list.environ.Header)\n\tbuffer[list.environ.HeaderLen] = types.DATA\n\tcopy(buffer[list.environ.HeaderLen+1:], list.meta.ID)\n\treturn buffer\n}", "title": "" }, { "docid": "911f27ff3753287e353d35d75e93df37", "score": "0.62539303", "text": "func NewPrefixClient(client Client, prefix string) Client {\n\treturn &prefixClient{\n\t\tclient: client,\n\t\tprefix: prefix,\n\t}\n}", "title": "" }, { "docid": "739b943245c43221d67cebdb01dff51f", "score": "0.62515366", "text": "func (s *Spinner) SetPrefix(text string) *Spinner {\n\ts.sp.Prefix = text + \" \"\n\treturn s\n}", "title": "" }, { "docid": "b2906a3af48f49bb58b3cadd4ba1391b", "score": "0.6250786", "text": "func (r *Range) Prefix() (*pb.RangeResponse, error) {\n\treturn r.kv.Range(\n\t\tcontext.TODO(),\n\t\t&pb.RangeRequest{\n\t\t\tKey: prefixNext(string(r.key)),\n\t\t\tRangeEnd: r.keyEnd,\n\t\t\tRevision: r.rev})\n}", "title": "" }, { "docid": "69770be5a3b7972ef5cf77758892899b", "score": "0.6232149", "text": "func (o GetAppSpecStaticSiteCorsAllowOriginsPtrOutput) Prefix() pulumi.StringPtrOutput {\n\treturn o.ApplyT(func(v *GetAppSpecStaticSiteCorsAllowOrigins) *string {\n\t\tif v == nil {\n\t\t\treturn nil\n\t\t}\n\t\treturn v.Prefix\n\t}).(pulumi.StringPtrOutput)\n}", "title": "" }, { "docid": "b5ad4d8128ca6c6c206e354d5fed7f6b", "score": "0.6228821", "text": "func (o AppSpecStaticSiteCorsAllowOriginsPtrOutput) Prefix() pulumi.StringPtrOutput {\n\treturn o.ApplyT(func(v *AppSpecStaticSiteCorsAllowOrigins) *string {\n\t\tif v == nil {\n\t\t\treturn nil\n\t\t}\n\t\treturn v.Prefix\n\t}).(pulumi.StringPtrOutput)\n}", "title": "" }, { "docid": "ae01b178c5b945bd06b3446c0cd8f496", "score": "0.62276816", "text": "func (s *Server) SetPrefix(prefix string) {\n\ts.prefix = prefix\n}", "title": "" }, { "docid": "3544a1158d9ceb221d8925c63dad0c21", "score": "0.62261415", "text": "func (o AlertmanagerSpecInitContainersEnvFromOutput) Prefix() pulumi.StringPtrOutput {\n\treturn o.ApplyT(func(v AlertmanagerSpecInitContainersEnvFrom) *string { return v.Prefix }).(pulumi.StringPtrOutput)\n}", "title": "" }, { "docid": "4feedbaaef14866a5f66f913d8fd16df", "score": "0.62247735", "text": "func (s *Spinner) Prefix(prefix string) {\n\ts.mu.Lock()\n\tdefer s.mu.Unlock()\n\n\ts.prefix = prefix\n\n\ts.notifyDataChange()\n}", "title": "" }, { "docid": "8bf3947e0fb2f0c1548a31a68a8a6a36", "score": "0.6218144", "text": "func (l *ConsoleLogger) Prefix(p string) {\n\tl.prefix = p\n}", "title": "" }, { "docid": "a46b0daf72deae2eea80ad16aa36a7fe", "score": "0.6200015", "text": "func (o UsageExportBucketOutput) Prefix() pulumi.StringPtrOutput {\n\treturn o.ApplyT(func(v *UsageExportBucket) pulumi.StringPtrOutput { return v.Prefix }).(pulumi.StringPtrOutput)\n}", "title": "" }, { "docid": "2fd8c754681c6484e49011d661e9c507", "score": "0.6196903", "text": "func (a *Client) GetLocalprefix(params *GetLocalprefixParams, authInfo runtime.ClientAuthInfoWriter) (*GetLocalprefixOK, error) {\n\t// TODO: Validate the params before sending\n\tif params == nil {\n\t\tparams = NewGetLocalprefixParams()\n\t}\n\n\tresult, err := a.transport.Submit(&runtime.ClientOperation{\n\t\tID: \"getLocalprefix\",\n\t\tMethod: \"GET\",\n\t\tPathPattern: \"/devices/{deviceId}/localprefix\",\n\t\tProducesMediaTypes: []string{\"application/json\"},\n\t\tConsumesMediaTypes: []string{\"application/json\"},\n\t\tSchemes: []string{\"https\"},\n\t\tParams: params,\n\t\tReader: &GetLocalprefixReader{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.(*GetLocalprefixOK)\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 getLocalprefix: API contract not enforced by server. Client expected to get an error, but got: %T\", result)\n\tpanic(msg)\n}", "title": "" }, { "docid": "9ffc635e8e1ae2cfa27468ad1f3598b3", "score": "0.61948127", "text": "func (o PrometheusSpecAlertingAlertmanagersOutput) PathPrefix() pulumi.StringPtrOutput {\n\treturn o.ApplyT(func(v PrometheusSpecAlertingAlertmanagers) *string { return v.PathPrefix }).(pulumi.StringPtrOutput)\n}", "title": "" }, { "docid": "734e18aaf7d6d623fb06726b3896245e", "score": "0.61920303", "text": "func SetJSONPrefix(pfx string) {\n\tmu.Lock()\n\tdefer mu.Unlock()\n \tjsonPrefix = pfx\n}", "title": "" }, { "docid": "f0ac00aaac8d168790006882c53c2a80", "score": "0.61885583", "text": "func EtcdMasterPrefix(instance string) string {\n\treturn fmt.Sprintf(\"/ns/service/red-cloud/%s/master/\", instance)\n}", "title": "" }, { "docid": "23c19554006f3abf3fe8024690aec8d4", "score": "0.6188214", "text": "func (c *prefixedKVClient) WatchPrefix(ctx context.Context, prefix string, f func(string, interface{}) bool) {\n\tc.client.WatchPrefix(ctx, fmt.Sprintf(\"%s%s\", c.prefix, prefix), func(k string, i interface{}) bool {\n\t\treturn f(strings.TrimPrefix(k, c.prefix), i)\n\t})\n}", "title": "" }, { "docid": "d964a7bb540048ac2aa21573ba735b15", "score": "0.6176019", "text": "func (o AlertmanagerSpecContainersEnvFromOutput) Prefix() pulumi.StringPtrOutput {\n\treturn o.ApplyT(func(v AlertmanagerSpecContainersEnvFrom) *string { return v.Prefix }).(pulumi.StringPtrOutput)\n}", "title": "" }, { "docid": "0c35538d85d1c71fdea509e0c941c29a", "score": "0.61746156", "text": "func (q Queries) Prefix() string {\n\treturn q.prefixQuery\n}", "title": "" }, { "docid": "c007f7612aeba813c7ffdcd67631ab95", "score": "0.6173952", "text": "func Prefix(values ...interface{}) Option {\n\treturn listinternal.FuncOption(func(options *listinternal.Options) {\n\t\toptions.Prefix = encodeutil.ValuesOf(values...)\n\t})\n}", "title": "" }, { "docid": "9f39d6c805505177d9baa1094061816d", "score": "0.6172352", "text": "func NewPrefixClient(c config) *PrefixClient {\n\treturn &PrefixClient{config: c}\n}", "title": "" }, { "docid": "08cac4d8f212b2b577e69a02acfd01d4", "score": "0.617022", "text": "func (l Logrus) Prefix() string {\n\treturn \"\"\n}", "title": "" }, { "docid": "08cac4d8f212b2b577e69a02acfd01d4", "score": "0.617022", "text": "func (l Logrus) Prefix() string {\n\treturn \"\"\n}", "title": "" }, { "docid": "e34ac08327a2a3115ebacb45737ce787", "score": "0.6144159", "text": "func (o EndpointConfigurationOutput) NamePrefix() pulumi.StringOutput {\n\treturn o.ApplyT(func(v *EndpointConfiguration) pulumi.StringOutput { return v.NamePrefix }).(pulumi.StringOutput)\n}", "title": "" } ]
feff709f44ea1ba88016c96716fe3b08
BatchWrite writes points to a shard in chunks.
[ { "docid": "5a0857d30606e9ab32a07c905ac787e6", "score": "0.8226409", "text": "func (s *Store) BatchWrite(shardID int, points []models.Point) error {\n\tnPts := len(points)\n\tchunkSz := 10000\n\tstart := 0\n\tend := chunkSz\n\n\tfor {\n\t\tif end > nPts {\n\t\t\tend = nPts\n\t\t}\n\t\tif end-start == 0 {\n\t\t\tbreak\n\t\t}\n\n\t\tif err := s.WriteToShard(uint64(shardID), points[start:end]); err != nil {\n\t\t\treturn err\n\t\t}\n\t\tstart = end\n\t\tend += chunkSz\n\t}\n\treturn nil\n}", "title": "" } ]
[ { "docid": "5a27bda4df3d978b2e847180ae772920", "score": "0.67367005", "text": "func writeBatch(ctx context.Context, kv chan *task.KV, che chan error) {\n\twb := pstore.NewWriteBatch()\n\tbatchSize := 0\n\tbatchWriteNum := 1\n\tfor i := range kv {\n\t\twb.Put(i.KeyBytes(), i.ValBytes())\n\t\tbatchSize += len(i.KeyBytes()) + len(i.ValBytes())\n\t\t// We write in batches of size 32MB.\n\t\tif batchSize >= 32*MB {\n\t\t\tx.Trace(ctx, \"Doing batch write %d.\", batchWriteNum)\n\t\t\tif err := pstore.WriteBatch(wb); err != nil {\n\t\t\t\tche <- err\n\t\t\t\treturn\n\t\t\t}\n\n\t\t\tbatchWriteNum++\n\t\t\t// Resetting batch size after a batch write.\n\t\t\tbatchSize = 0\n\t\t\t// Since we are writing data in batches, we need to clear up items enqueued\n\t\t\t// for batch write after every successful write.\n\t\t\twb.Clear()\n\t\t}\n\t}\n\t// After channel is closed the above loop would exit, we write the data in\n\t// write batch here.\n\tif batchSize > 0 {\n\t\tx.Trace(ctx, \"Doing batch write %d.\", batchWriteNum)\n\t\tche <- pstore.WriteBatch(wb)\n\t\treturn\n\t}\n\tche <- nil\n}", "title": "" }, { "docid": "5833778bbe984b102eb8252810c2512d", "score": "0.6618843", "text": "func (c *Client) writeChunk(handle int64, offset int64, data []byte) error {\n\tgfs.DebugMsgToFile(fmt.Sprintf(\"write chunk handle <%d> offset <%d> \", handle, offset), gfs.CLIENT, c.identifier)\n\tdefer gfs.DebugMsgToFile(fmt.Sprintf(\"write chunk handle <%d> offset <%d> end\", handle, offset), gfs.CLIENT, c.identifier)\n\tif len(data)+int(offset) > gfs.MaxChunkSize {\n\t\tgfs.DebugMsgToFile(fmt.Sprintf(\"write chunk handle <%d> offset <%d> err <%s>\", handle, offset,\n\t\t\tfmt.Errorf(\"len(data)+offset = %v > max chunk size\", len(data)+int(offset))), gfs.CLIENT, c.identifier)\n\t\treturn fmt.Errorf(\"len(data)+offset = %v > max chunk size\", len(data)+int(offset))\n\t}\n\n\treplicaInfo, err := c.replicaBuffer.Get(handle)\n\tif err != nil {\n\t\tgfs.DebugMsgToFile(fmt.Sprintf(\"write chunk handle <%d> offset <%d> err <%s>\", handle, offset, err), gfs.CLIENT, c.identifier)\n\t\treturn err\n\t}\n\n\tdataID := chunkserver.NewDataID(handle)\n\tchain := append(replicaInfo.Secondaries, replicaInfo.Primary)\n\n\tvar d gfs.ForwardDataReply\n\terr = gfs.Call(chain[0], \"ChunkServer.RPCForwardData\", gfs.ForwardDataArg{DataID: dataID, Data: data, ChainOrder: chain[1:]}, &d)\n\tif err != nil {\n\t\tgfs.DebugMsgToFile(fmt.Sprintf(\"write chunk handle <%d> offset <%d> err <%s>\", handle, offset, err), gfs.CLIENT, c.identifier)\n\t\treturn err\n\t}\n\n\terr = gfs.Call(replicaInfo.Primary, \"ChunkServer.RPCWriteChunk\",\n\t\tgfs.WriteChunkArg{DbID: dataID, Offset: offset, Secondaries: replicaInfo.Secondaries}, &gfs.WriteChunkReply{})\n\tif err != nil {\n\t\tgfs.DebugMsgToFile(fmt.Sprintf(\"write chunk handle <%d> offset <%d> err <%s>\", handle, offset, err), gfs.CLIENT, c.identifier)\n\t}\n\treturn err\n}", "title": "" }, { "docid": "0202bf0cf0c2d49c90a3c3a54c18d960", "score": "0.6513723", "text": "func (m *MutationStorage) WriteBatch(_ context.Context, directoryID string, revision int64,\n\tmutations []*pb.Entry) error {\n\tif _, ok := m.mtns[directoryID]; !ok {\n\t\tm.mtns[directoryID] = make(map[int64][]*pb.Entry)\n\t}\n\tm.mtns[directoryID][revision] = mutations\n\treturn nil\n}", "title": "" }, { "docid": "ec0565f319fcf661852308f2ceb6cfc1", "score": "0.64551604", "text": "func (tb *table) batchWritePool(ipCh chan map[string]dynamodb.AttributeValue) {\n\n\tfor marshaller = 0; marshaller < marshallers; marshaller++ {\n\t\tmarshallerWG.Add(1)\n\n\t\tgo func(ms int64) {\n\t\t\twriteRequestS := []dynamodb.WriteRequest{}\n\t\t\tcount := 0\n\n\t\t\tfor attrValMap := range ipCh {\n\t\t\t\tcount++\n\t\t\t\twriteRequest := dynamodb.WriteRequest{ // build the write request input\n\t\t\t\t\tPutRequest: &dynamodb.PutRequest{ // one item\n\t\t\t\t\t\tItem: attrValMap,\n\t\t\t\t\t},\n\t\t\t\t}\n\t\t\t\twriteRequestS = append(writeRequestS, writeRequest) // append to the xs\n\n\t\t\t\tif count == batchSize { // write the batch\n\t\t\t\t\tBatchInput := dynamodb.BatchWriteItemInput{\n\t\t\t\t\t\tRequestItems: map[string][]dynamodb.WriteRequest{\n\t\t\t\t\t\t\ttb.TableName: writeRequestS},\n\t\t\t\t\t}\n\t\t\t\t\ttb.batchWriteRetry(BatchInput)\n\t\t\t\t\twriteRequestS = []dynamodb.WriteRequest{}\n\n\t\t\t\t}\n\t\t\t} // range on channel loop\n\n\t\t\t// channel closed - flush any remaining PutRequests\n\t\t\tBatchInput := dynamodb.BatchWriteItemInput{\n\t\t\t\tRequestItems: map[string][]dynamodb.WriteRequest{\n\t\t\t\t\ttb.TableName: writeRequestS},\n\t\t\t}\n\t\t\ttb.batchWriteRetry(BatchInput)\n\n\t\t\tmarshallerWG.Done()\n\t\t}(marshaller)\n\t}\n}", "title": "" }, { "docid": "a025d14453d0951b333b14f26808f981", "score": "0.61407864", "text": "func (c *AWSStore) putChunks(ctx context.Context, userID string, chunks []Chunk) error {\n\tincomingErrors := make(chan error)\n\tfor _, chunk := range chunks {\n\t\tgo func(chunk Chunk) {\n\t\t\tincomingErrors <- c.putChunk(ctx, userID, &chunk)\n\t\t}(chunk)\n\t}\n\n\tvar lastErr error\n\tfor range chunks {\n\t\terr := <-incomingErrors\n\t\tif err != nil {\n\t\t\tlastErr = err\n\t\t}\n\t}\n\treturn lastErr\n}", "title": "" }, { "docid": "7b77c4d63707350a8cb32f4f554ba80a", "score": "0.610884", "text": "func (t *Tube) bulkWrite(bulk []*Record) {\n\t//\n\tchanged := make([]*Record, 0, len(bulk))\n\tfor _, r := range bulk {\n\t\tif t.write(r) {\n\t\t\tchanged = append(changed, r)\n\t\t}\n\t}\n\t//\n\tgo t.bulkWriteSync(changed)\n}", "title": "" }, { "docid": "6e56e87172d31a8850015b5df5e42aaa", "score": "0.60579604", "text": "func (c *Client) Write(path string, offset uint64, bytes []byte) bool {\n // TODO: Split one write into multiple RPC\n length := uint64(len(bytes))\n startChunkIndex := offset / ChunkSize\n endChunkIndex := (offset + length - 1) / ChunkSize // inclusive\n startIdx := uint64(0)\n for i := startChunkIndex; i <= endChunkIndex; i++ {\n startOffset := uint64(0)\n endOffset := uint64(ChunkSize) // exclusive\n if i == startChunkIndex {\n startOffset = offset % ChunkSize\n }\n if i == endChunkIndex {\n if rem := (offset + length) % ChunkSize; rem == 0 {\n endOffset = ChunkSize\n } else {\n endOffset = rem\n }\n }\n if ok := c.write(path, i, startOffset, endOffset, bytes[startIdx:startIdx+endOffset-startOffset]); !ok {\n return false\n }\n startIdx += endOffset - startOffset\n }\n return true\n}", "title": "" }, { "docid": "dc11295c7e20ea556d0fc65d1eac384e", "score": "0.60366267", "text": "func writeBlocks(compress dvid.Compression, checksum dvid.Checksum, blocks Blocks, wg1, wg2 *sync.WaitGroup) error {\n\tdb, err := server.OrderedKeyValueSetter()\n\tif err != nil {\n\t\treturn err\n\t}\n\n\tpreCompress, postCompress := 0, 0\n\n\t<-server.HandlerToken\n\tgo func() {\n\t\tdefer func() {\n\t\t\tdvid.Log(dvid.Debug, \"Wrote voxel blocks. Before %s: %d bytes. After: %d bytes\\n\",\n\t\t\t\tcompress, preCompress, postCompress)\n\t\t\tserver.HandlerToken <- 1\n\t\t\twg1.Done()\n\t\t\twg2.Done()\n\t\t}()\n\t\t// If we can do write batches, use it, else do put ranges.\n\t\t// With write batches, we write the byte slices immediately.\n\t\t// The put range approach can lead to duplicated memory.\n\t\tbatcher, ok := db.(storage.Batcher)\n\t\tif ok {\n\t\t\tbatch := batcher.NewBatch()\n\t\t\tfor i, block := range blocks {\n\t\t\t\tserialization, err := dvid.SerializeData(block.V, compress, checksum)\n\t\t\t\tpreCompress += len(block.V)\n\t\t\t\tpostCompress += len(serialization)\n\t\t\t\tif err != nil {\n\t\t\t\t\tfmt.Printf(\"Unable to serialize block: %s\\n\", err.Error())\n\t\t\t\t\treturn\n\t\t\t\t}\n\t\t\t\tbatch.Put(block.K, serialization)\n\t\t\t\tif i%KVWriteSize == KVWriteSize-1 {\n\t\t\t\t\tif err := batch.Commit(); err != nil {\n\t\t\t\t\t\tdvid.Log(dvid.Normal, \"Error on trying to write batch: %s\\n\", err.Error())\n\t\t\t\t\t\treturn\n\t\t\t\t\t}\n\t\t\t\t\tbatch = batcher.NewBatch()\n\t\t\t\t}\n\t\t\t}\n\t\t\tif err := batch.Commit(); err != nil {\n\t\t\t\tdvid.Log(dvid.Normal, \"Error on trying to write batch: %s\\n\", err.Error())\n\t\t\t\treturn\n\t\t\t}\n\t\t} else {\n\t\t\t// Serialize and compress the blocks.\n\t\t\tkeyvalues := make(storage.KeyValues, len(blocks))\n\t\t\tfor i, block := range blocks {\n\t\t\t\tserialization, err := dvid.SerializeData(block.V, compress, checksum)\n\t\t\t\tif err != nil {\n\t\t\t\t\tfmt.Printf(\"Unable to serialize block: %s\\n\", err.Error())\n\t\t\t\t\treturn\n\t\t\t\t}\n\t\t\t\tkeyvalues[i] = storage.KeyValue{\n\t\t\t\t\tK: block.K,\n\t\t\t\t\tV: serialization,\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t// Write them in one swoop.\n\t\t\terr := db.PutRange(keyvalues)\n\t\t\tif err != nil {\n\t\t\t\tfmt.Printf(\"Unable to write slice blocks: %s\\n\", err.Error())\n\t\t\t}\n\t\t}\n\n\t}()\n\treturn nil\n}", "title": "" }, { "docid": "698844e55361f32a83aa10b7431ae06e", "score": "0.5988311", "text": "func (c *Client) pushData(chunkLocations []string, dataId DataId, data []byte) error {\n // Push data to each replica's memory.\n for _, cs := range chunkLocations {\n pushDataReply := new(PushDataReply)\n if err := call(cs, \"ChunkServer.PushData\", &PushDataArgs{dataId, data},\n pushDataReply); err != nil {\n return err\n }\n }\n return nil\n}", "title": "" }, { "docid": "c782495bb2d2a5be29bd70b77d37bb72", "score": "0.5971024", "text": "func (s *SDSurfacer) writeBatch() {\n\tbatchTicker := time.Tick(time.Duration(s.c.GetBatchTimerSec()) * time.Second)\n\tfor {\n\t\tselect {\n\t\tcase em := <-s.writeChan:\n\t\t\t// Process EventMetrics to build timeseries using them and cache the timeseries\n\t\t\t// objects.\n\t\t\ts.recordEventMetrics(em)\n\t\tcase <-batchTicker:\n\t\t\t// Empty time series writes cause an error to be returned, so\n\t\t\t// we skip any calls that write but wouldn't set any data.\n\t\t\tif len(s.cache) == 0 {\n\t\t\t\tbreak\n\t\t\t}\n\n\t\t\tvar ts []*monitoring.TimeSeries\n\t\t\tfor _, v := range s.cache {\n\t\t\t\tts = append(ts, v)\n\t\t\t}\n\n\t\t\t// We batch the time series into appropriately-sized sets\n\t\t\t// and write them\n\t\t\tfor i := 0; i < len(ts); i += int(s.c.GetBatchSize()) {\n\t\t\t\tendIndex := min(len(ts), i+int(s.c.GetBatchSize()))\n\n\t\t\t\ts.l.Infof(\"Sending entries %d through %d of %d\", i, endIndex, len(ts))\n\n\t\t\t\t// Now that we've created the new metric, we can write the data. Making\n\t\t\t\t// a time series create call will automatically register a new metric\n\t\t\t\t// with the correct information if it does not already exist.\n\t\t\t\t// Ref: https://cloud.google.com/monitoring/custom-metrics/creating-metrics#auto-creation\n\t\t\t\trequestBody := monitoring.CreateTimeSeriesRequest{\n\t\t\t\t\tTimeSeries: ts[i:endIndex],\n\t\t\t\t}\n\t\t\t\tif _, err := s.client.Projects.TimeSeries.Create(\"projects/\"+s.projectName, &requestBody).Do(); err != nil {\n\t\t\t\t\ts.failCnt++\n\t\t\t\t\ts.l.Warningf(\"Unable to fulfill TimeSeries Create call. Err: %v\", err)\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t// Flush the cache after we've finished writing so we don't accidentally\n\t\t\t// re-write metric values that haven't been written over several write\n\t\t\t// cycles.\n\t\t\tfor k := range s.cache {\n\t\t\t\tdelete(s.cache, k)\n\t\t\t}\n\t\t}\n\t}\n\n}", "title": "" }, { "docid": "eba38d344fb17c0550960a9c63f935d1", "score": "0.5930712", "text": "func populateShard(ctx context.Context, pl *pool, group uint64) (int, error) {\n\tquery := new(Payload)\n\tdata, err := generateGroup(group)\n\tif err != nil {\n\t\treturn 0, x.Wrapf(err, \"While generating keys group\")\n\t}\n\tquery.Data = data\n\n\tconn, err := pl.Get()\n\tif err != nil {\n\t\treturn 0, err\n\t}\n\tdefer pl.Put(conn)\n\tc := NewWorkerClient(conn)\n\n\tstream, err := c.PredicateData(context.Background(), query)\n\tif err != nil {\n\t\treturn 0, err\n\t}\n\tx.Trace(ctx, \"Streaming data for group: %v\", group)\n\n\tkvs := make(chan *task.KV, 1000)\n\tche := make(chan error)\n\tgo writeBatch(ctx, kvs, che)\n\n\t// We can use count to check the number of posting lists returned in tests.\n\tcount := 0\n\tfor {\n\t\tpayload, err := stream.Recv()\n\t\tif err == io.EOF {\n\t\t\tbreak\n\t\t}\n\t\tif err != nil {\n\t\t\tclose(kvs)\n\t\t\treturn count, err\n\t\t}\n\t\tcount++\n\t\tuo := flatbuffers.GetUOffsetT(payload.Data)\n\t\tkv := new(task.KV)\n\t\tkv.Init(payload.Data, uo)\n\n\t\t// We check for errors, if there are no errors we send value to channel.\n\t\tselect {\n\t\tcase <-ctx.Done():\n\t\t\tx.TraceError(ctx, x.Errorf(\"Context timed out while streaming group: %v\", group))\n\t\t\tclose(kvs)\n\t\t\treturn count, ctx.Err()\n\n\t\tcase err := <-che:\n\t\t\tx.TraceError(ctx, x.Errorf(\"Error while doing a batch write for group: %v\", group))\n\t\t\tclose(kvs)\n\t\t\treturn count, err\n\n\t\tcase kvs <- kv:\n\t\t}\n\t}\n\tclose(kvs)\n\n\tif err := <-che; err != nil {\n\t\tx.TraceError(ctx, x.Errorf(\"Error while doing a batch write for group: %v\", group))\n\t\treturn count, err\n\t}\n\tx.Trace(ctx, \"Streaming complete for group: %v\", group)\n\treturn count, nil\n}", "title": "" }, { "docid": "3d9d220ff2ff539888a54c0fd93b7e92", "score": "0.59077114", "text": "func batchDump(sess *session.Session, data []TimeLineData) {\n\n\tsvc := dynamodb.New(sess, aws.NewConfig().WithLogLevel(aws.LogDebugWithHTTPBody))\n\twriteRequests := make([]*dynamodb.WriteRequest, 0, 25)\n\n\tfor idx, d := range data {\n\n\t\tif idx%25 == 0 {\n\n\t\t\tinput := &dynamodb.BatchWriteItemInput{\n\t\t\t\tRequestItems: map[string][]*dynamodb.WriteRequest{\n\t\t\t\t\t\"Cupcake_Data\": writeRequests,\n\t\t\t\t}}\n\n\t\t\tsendBatch(svc, input)\n\n\t\t\twriteRequests = writeRequests[:0]\n\t\t}\n\n\t\twriteRequests = append(writeRequests, &dynamodb.WriteRequest{PutRequest: &dynamodb.PutRequest{\n\t\t\tItem: map[string]*dynamodb.AttributeValue{\n\t\t\t\t\"Month\": {\n\t\t\t\t\tS: aws.String(d.Date),\n\t\t\t\t},\n\t\t\t\t\"Cupcake\": {\n\t\t\t\t\tN: aws.String(strconv.Itoa(d.Count)),\n\t\t\t\t},\n\t\t\t\t\"last_update\": {\n\t\t\t\t\tS: aws.String(time.Now().UTC().Format(time.RFC3339)),\n\t\t\t\t},\n\t\t\t},\n\t\t}})\n\t}\n\n\tinput := &dynamodb.BatchWriteItemInput{\n\t\tRequestItems: map[string][]*dynamodb.WriteRequest{\n\t\t\t\"Cupcake_Data\": writeRequests,\n\t\t}}\n\n\tsendBatch(svc, input)\n\n}", "title": "" }, { "docid": "a6f50d153dbf9a0ac79ddb421bd37303", "score": "0.5886422", "text": "func (s *Service) WriteBatcher() *WriteBatcher {\n\tdocumentsServiceByHost := make(map[string]*documents.Service)\n\tfor host, client := range s.clientsByHost {\n\t\tdocumentsServiceByHost[host] = documents.NewService(client)\n\t}\n\treturn &WriteBatcher{\n\t\tdocumentsServiceByHost: documentsServiceByHost,\n\t\tclient: s.client,\n\t\tclientsByHost: s.clientsByHost,\n\t\tthreadCount: uint8(len(s.forestInfo) * 2),\n\t\tbatchSize: 250,\n\t\tforestInfo: s.forestInfo,\n\t}\n}", "title": "" }, { "docid": "d8b905ee4ca8e09104583e9e995efddd", "score": "0.58762425", "text": "func (s *kvstore) BatchPut(kvpair []kv) error {\n\two := gorocksdb.NewDefaultWriteOptions()\n\twb := gorocksdb.NewWriteBatch()\n\ts.mu.Lock()\n\tdefer s.mu.Unlock()\n\tfor _, _kv := range kvpair {\n\t\tbyteK := toBytes(_kv.Key)\n\t\tbyteV := toBytes(_kv.Value)\n\t\twb.Put(byteK, byteV)\n\t}\n\terr := s.db.Write(wo, wb)\n\treturn err\n}", "title": "" }, { "docid": "c6197a0d31fb97781c07351e6d9162e1", "score": "0.5835309", "text": "func (m *Manager) distributeShardRecords(maxSize int64) error {\n\tvar (\n\t\tshards []*extract.Shard\n\t\terr error\n\n\t\twg = &sync.WaitGroup{}\n\t\tshardsToTarget = make(map[*cluster.Snode][]*extract.Shard, m.smap.CountTargets())\n\t\tsendOrder = make(map[string]map[string]*extract.Shard, m.smap.CountTargets())\n\n\t\terrCh = make(chan error, m.smap.CountTargets())\n\t)\n\n\tfor _, d := range m.smap.Tmap {\n\t\tshardsToTarget[d] = nil\n\t\tsendOrder[d.DaemonID] = make(map[string]*extract.Shard, 100)\n\t}\n\n\tif m.rs.OrderFileURL != \"\" {\n\t\tshards, err = m.generateShardsWithOrderingFile(maxSize)\n\t} else {\n\t\tshards, err = m.generateShardsWithTemplate(maxSize)\n\t}\n\n\tif err != nil {\n\t\treturn err\n\t}\n\n\t// TODO: Following heuristic doesn't seem to be working correctly in\n\t// all cases. When there is not much shards at each disk (like 1-5)\n\t// then it may happen that some target will have more shards than other\n\t// targets and will \"win\" all output shards what will result in enormous\n\t// skew and result in slow creation phase (single target will be\n\t// responsible for creating all shards).\n\t//\n\t// if m.extractCreator.UsingCompression() {\n\t// \tdaemonID := nodeForShardRequest(shardsToTarget, numLocalRecords)\n\t// \tbaseURL = m.smap.GetTarget(daemonID).URL(cmn.NetworkIntraData)\n\t// } else {\n\t// \t// If output shards are not compressed, there will always be less\n\t// \t// data sent over the network if the shard is constructed on the\n\t// \t// correct HRW target as opposed to constructing it on the target\n\t// \t// with optimal file content locality and then sent to the correct\n\t// \t// target.\n\t// }\n\n\tbck := cluster.NewBck(m.rs.OutputBucket, m.rs.OutputProvider, cmn.NsGlobal)\n\tif err := bck.Init(m.ctx.bmdOwner, m.ctx.t.Snode()); err != nil {\n\t\treturn err\n\t}\n\n\tfor _, s := range shards {\n\t\tsi, err := cluster.HrwTarget(bck.MakeUname(s.Name), m.smap)\n\t\tif err != nil {\n\t\t\treturn err\n\t\t}\n\t\tshardsToTarget[si] = append(shardsToTarget[si], s)\n\n\t\tsingleSendOrder := make(map[string]*extract.Shard)\n\t\tfor _, record := range s.Records.All() {\n\t\t\tshard, ok := singleSendOrder[record.DaemonID]\n\t\t\tif !ok {\n\t\t\t\tshard = &extract.Shard{\n\t\t\t\t\tName: s.Name,\n\t\t\t\t\tRecords: extract.NewRecords(100),\n\t\t\t\t}\n\t\t\t\tsingleSendOrder[record.DaemonID] = shard\n\t\t\t}\n\t\t\tshard.Records.Insert(record)\n\t\t}\n\n\t\tfor daemonID, shard := range singleSendOrder {\n\t\t\tsendOrder[daemonID][shard.Name] = shard\n\t\t}\n\t}\n\n\tm.recManager.Records.Drain()\n\n\tfor si, s := range shardsToTarget {\n\t\twg.Add(1)\n\t\tgo func(si *cluster.Snode, s []*extract.Shard, order map[string]*extract.Shard) {\n\t\t\tdefer wg.Done()\n\n\t\t\tbody, err := js.Marshal(creationPhaseMetadata{\n\t\t\t\tShards: s,\n\t\t\t\tSendOrder: order,\n\t\t\t})\n\t\t\tif err != nil {\n\t\t\t\terrCh <- err\n\t\t\t\treturn\n\t\t\t}\n\n\t\t\tquery := cmn.AddBckToQuery(nil, cmn.Bck{Provider: m.rs.Provider, Ns: cmn.NsGlobal})\n\t\t\treqArgs := &cmn.ReqArgs{\n\t\t\t\tMethod: http.MethodPost,\n\t\t\t\tBase: si.URL(cmn.NetworkIntraData),\n\t\t\t\tPath: cmn.URLPath(cmn.Version, cmn.Sort, cmn.Shards, m.ManagerUUID),\n\t\t\t\tQuery: query,\n\t\t\t\tBody: body,\n\t\t\t}\n\t\t\tif err := m.doWithAbort(reqArgs); err != nil {\n\t\t\t\terrCh <- err\n\t\t\t\treturn\n\t\t\t}\n\t\t}(si, s, sendOrder[si.DaemonID])\n\t}\n\n\twg.Wait()\n\tclose(errCh)\n\tfor err := range errCh {\n\t\treturn errors.Errorf(\"error while sending shards, err: %v\", err)\n\t}\n\tglog.Infof(\"finished sending all shards\")\n\treturn nil\n}", "title": "" }, { "docid": "2820a9b03196050ef52ff945e290dbb8", "score": "0.5778871", "text": "func (bw *BatchedWriter) runBatchWriter() {\n\tbw.writeWg.Add(1)\n\n\tfor bw.running.Load() || bw.scheduledCount.Load() != 0 {\n\n\t\tbatchedMutation, err := bw.store.Batched()\n\t\tif err != nil {\n\t\t\tpanic(err)\n\t\t}\n\t\tbatchCollector := newBatchCollector(batchedMutation, &bw.scheduledCount, bw.opts.batchSize)\n\t\tshouldFlush := false\n\n\t\tcollectValues := func() {\n\t\t\tbatchWriterTimeoutTimer := time.NewTimer(bw.opts.batchTimeout)\n\t\t\tdefer timeutil.CleanupTimer(batchWriterTimeoutTimer)\n\n\t\t\tfor {\n\t\t\t\tselect {\n\n\t\t\t\t// an element was added to the queue\n\t\t\t\tcase objectToPersist := <-bw.batchQueue:\n\t\t\t\t\tif batchCollector.Add(objectToPersist) {\n\t\t\t\t\t\t// batch size was reached => apply the mutations\n\t\t\t\t\t\tif err := batchCollector.Commit(); err != nil {\n\t\t\t\t\t\t\tpanic(err)\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\treturn\n\t\t\t\t\t}\n\n\t\t\t\t// flush was triggered\n\t\t\t\tcase <-bw.flushChan:\n\t\t\t\t\tshouldFlush = true\n\n\t\t\t\t\treturn\n\n\t\t\t\t// batch timeout was reached\n\t\t\t\tcase <-batchWriterTimeoutTimer.C:\n\t\t\t\t\t// apply the collected mutations\n\t\t\t\t\tif err := batchCollector.Commit(); err != nil {\n\t\t\t\t\t\tpanic(err)\n\t\t\t\t\t}\n\n\t\t\t\t\treturn\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\tcollectValues()\n\n\t\tif shouldFlush {\n\t\t\t// flush was triggered, collect all remaining elements from the queue and commit them.\n\n\t\tFlushValues:\n\t\t\tfor {\n\t\t\t\tselect {\n\n\t\t\t\t// pick the next element from the queue\n\t\t\t\tcase objectToPersist := <-bw.batchQueue:\n\t\t\t\t\tif batchCollector.Add(objectToPersist) {\n\t\t\t\t\t\t// batch size was reached => apply the mutations\n\t\t\t\t\t\tif err := batchCollector.Commit(); err != nil {\n\t\t\t\t\t\t\tpanic(err)\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\t// create a new collector to batch the remaining elements\n\t\t\t\t\t\tbatchedMutation, err := bw.store.Batched()\n\t\t\t\t\t\tif err != nil {\n\t\t\t\t\t\t\tpanic(err)\n\t\t\t\t\t\t}\n\t\t\t\t\t\tbatchCollector = newBatchCollector(batchedMutation, &bw.scheduledCount, bw.opts.batchSize)\n\t\t\t\t\t}\n\n\t\t\t\t// no elements left\n\t\t\t\tdefault:\n\t\t\t\t\t// apply the collected mutations\n\t\t\t\t\tif err := batchCollector.Commit(); err != nil {\n\t\t\t\t\t\tpanic(err)\n\t\t\t\t\t}\n\n\t\t\t\t\tbreak FlushValues\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\n\tbw.writeWg.Done()\n}", "title": "" }, { "docid": "1576d75ff1bb255227fe2ac218728ead", "score": "0.5777544", "text": "func (kv *ShardKV) send_shards() {\n\tfor shard_index, _ := range kv.shards {\n\t\tif kv.shards[shard_index] == false {\n\t\t\t// we do not own this shard\n\t\t\tcontinue\n\t\t}\n\n\t\tif kv.shards[shard_index] && kv.current_config.Shards[shard_index] != kv.gid {\n\t\t\t// we own this shard but it belongs in a new group\n\t\t\tr_gid := kv.current_config.Shards[shard_index]\n\n\t\t\t// send the shard to the new group\n\t\t\tkv.send_shard(r_gid, shard_index)\n\t\t}\n\t}\n}", "title": "" }, { "docid": "1432023af88e9e3071fe089bfdd3174f", "score": "0.57448876", "text": "func (h *Handler) serveWrite(w http.ResponseWriter, r *http.Request, u *User) {\n\tvar br batchWrite\n\n\tdec := json.NewDecoder(r.Body)\n\tdec.UseNumber()\n\n\tvar writeError = func(result Result, statusCode int) {\n\t\tw.WriteHeader(statusCode)\n\t\tw.Header().Add(\"content-type\", \"application/json\")\n\t\t_ = json.NewEncoder(w).Encode(&result)\n\t\treturn\n\t}\n\n\tfor {\n\t\tif err := dec.Decode(&br); err != nil {\n\t\t\tif err.Error() == \"EOF\" {\n\t\t\t\tw.WriteHeader(http.StatusOK)\n\t\t\t\treturn\n\t\t\t}\n\t\t\twriteError(Result{Err: err}, http.StatusInternalServerError)\n\t\t\treturn\n\t\t}\n\n\t\tif br.Database == \"\" {\n\t\t\twriteError(Result{Err: fmt.Errorf(\"database is required\")}, http.StatusInternalServerError)\n\t\t\treturn\n\t\t}\n\n\t\tif h.server.databases[br.Database] == nil {\n\t\t\twriteError(Result{Err: fmt.Errorf(\"database not found: %q\", br.Database)}, http.StatusNotFound)\n\t\t\treturn\n\t\t}\n\n\t\t// TODO corylanou: Check if user can write to specified database\n\t\t//if !user_can_write(br.Database) {\n\t\t//writeError(&Result{Err: fmt.Errorf(\"%q user is not authorized to write to database %q\", u.Name)}, http.StatusUnauthorized)\n\t\t//return\n\t\t//}\n\n\t\tfor _, p := range br.Points {\n\t\t\tif p.Timestamp.IsZero() {\n\t\t\t\tp.Timestamp = br.Timestamp\n\t\t\t}\n\t\t\tif len(br.Tags) > 0 {\n\t\t\t\tfor k, _ := range br.Tags {\n\t\t\t\t\tif p.Tags[k] == \"\" {\n\t\t\t\t\t\tp.Tags[k] = br.Tags[k]\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t\tif _, err := h.server.WriteSeries(br.Database, br.RetentionPolicy, []Point{p}); err != nil {\n\t\t\t\twriteError(Result{Err: err}, http.StatusInternalServerError)\n\t\t\t\treturn\n\t\t\t}\n\t\t}\n\t}\n}", "title": "" }, { "docid": "49f08a1e0ab137c6ad632f36b7ff6244", "score": "0.5743041", "text": "func (s *Storage) Write(wb util.WriteBatch, sync bool) error {\n\tmwb := wb.(*writeBatch)\n\tfor _, opt := range mwb.opts {\n\t\tif opt.isDelete {\n\t\t\ts.Delete(opt.key)\n\t\t} else {\n\t\t\ts.Set(opt.key, opt.value)\n\t\t}\n\t}\n\n\treturn nil\n}", "title": "" }, { "docid": "b9b214118bdd956af425e6676baa691a", "score": "0.57356405", "text": "func (r *RestSnapshotStore) PutBatch(b *protocol.BatchSnapshots) error {\n\tbuf, err := b.Encode()\n\tif err != nil {\n\t\treturn err\n\t}\n\tn := len(r.endpoint)\n\tif n == 0 {\n\t\treturn fmt.Errorf(\"No endpoint configured for snapshot store!\")\n\t}\n\turl := r.endpoint[0]\n\tif n > 1 {\n\t\turl = r.endpoint[rand.Intn(n)]\n\t}\n\tresp, err := r.client.Post(url+\"/batch\", \"application/json\", bytes.NewBuffer(buf))\n\tif err != nil {\n\t\treturn err\n\t}\n\tdefer resp.Body.Close()\n\t_, err = io.Copy(ioutil.Discard, resp.Body)\n\tif err != nil {\n\t\treturn err\n\t}\n\n\treturn nil\n}", "title": "" }, { "docid": "206f5c9d2bd2831b13f8b191ad8c94d3", "score": "0.57078385", "text": "func writeChunks(books []*pb3.Book){\r\n\t//SHOW_DETAILS log.Printf(\"Guargando Chunks\")\r\n\tfor i := 0; i < len(books); i++ {\r\n\t\tfileName := books[i].GetName() + \"_\" + books[i].GetPart()\r\n\t\t//SHOW_DETAILS log.Printf(fileName)\r\n\t\t_, err := os.Create(\"./chunks/\" + fileName)\r\n\r\n\t\tif err != nil {\r\n\t\t\tfmt.Println(err)\r\n\t\t\tos.Exit(1)\r\n\t\t}\r\n\r\n\t\t// write/save buffer to disk\r\n\t\tioutil.WriteFile(\"./chunks/\" + fileName, books[i].GetChunk(), os.ModeAppend)\r\n\r\n\t\t//SHOW_DETAILS fmt.Println(\"Split to : \", fileName)\r\n\t}\r\n}", "title": "" }, { "docid": "79f3a6268681bf24931319f366c8b662", "score": "0.5704739", "text": "func (fs FileStorage) writeChunk(file *os.File, offset int64, data []byte) error {\n\n\ts, err := file.Seek(offset, os.SEEK_SET)\n\tif err != nil {\n\t\treturn err\n\t}\n\tif s != offset {\n\t\treturn errors.New(\"seek文件偏移量错误\")\n\t}\n\t_, err = file.Write(data)\n\tif err != nil {\n\t\treturn err\n\t}\n\n\treturn nil\n}", "title": "" }, { "docid": "d1a9a05134f2e2f1c4866c8e6ca68e4b", "score": "0.5694845", "text": "func (b *Batch) Write() error {\n\tif b.tinyBatch.len() == 0 {\n\t\treturn nil\n\t}\n\n\tdefer b.db.bufPool.Put(b.tinyBatch.buffer)\n\n\ttopics := make(map[uint64]*message.Topic)\n\tb.tinyBatchGroup[b.tinyBatch.timeID()] = b.tinyBatch\n\n\tb.writeInternal(func(i int, e entry, data []byte) error {\n\t\tif e.topicSize != 0 {\n\t\t\tt, ok := topics[e.topicHash]\n\t\t\tif !ok {\n\t\t\t\tt = new(message.Topic)\n\t\t\t\trawTopic := data[entrySize+idSize : entrySize+idSize+e.topicSize]\n\t\t\t\tt.Unmarshal(rawTopic)\n\t\t\t\ttopics[e.topicHash] = t\n\t\t\t}\n\t\t\tb.db.trie.add(newTopic(e.topicHash, 0), t.Parts, t.Depth)\n\t\t}\n\t\tblockID := startBlockIndex(e.seq)\n\t\tmemseq := b.db.cacheID ^ e.seq\n\t\tif err := b.db.mem.Set(uint64(blockID), memseq, data); err != nil {\n\t\t\treturn err\n\t\t}\n\t\tif ok := b.db.timeWindow.add(b.tinyBatch.timeID(), e.topicHash, newWinEntry(e.seq, e.expiresAt)); !ok {\n\t\t\treturn errForbidden\n\t\t}\n\t\tb.tinyBatch.entries = append(b.tinyBatch.entries, e.seq)\n\t\treturn nil\n\t})\n\n\tb.tinyBatchLockC <- struct{}{}\n\tb.db.batchPool.write(b.tinyBatch)\n\tb.tinyBatch = b.db.newTinyBatch()\n\t<-b.tinyBatchLockC\n\n\treturn nil\n}", "title": "" }, { "docid": "69942319942e34b9c7ea8729b506c727", "score": "0.5665836", "text": "func WriteResultChunks(ctx context.Context, s sqliteutil.Execable, tableName string, serializer serialization.Serializer, resultChunks map[int]types.ResultChunkData) error {\n\tch := make(chan IndexedResultChunk, len(resultChunks))\n\n\tgo func() {\n\t\tdefer close(ch)\n\n\t\tfor i, v := range resultChunks {\n\t\t\tch <- IndexedResultChunk{Index: i, ResultChunk: v}\n\t\t}\n\t}()\n\n\treturn WriteResultChunksChan(ctx, s, tableName, serializer, ch)\n}", "title": "" }, { "docid": "c8d450800688d9dbd3be1e964243beae", "score": "0.5598088", "text": "func (self *LevelDbDatastore) sendBatch(query *parser.SelectQuery, series *protocol.Series, yield func(series *protocol.Series) error) (int, error) {\n\tdropped := int(math.MaxInt32)\n\n\tfor _, alias := range query.GetTableAliases(*series.Name) {\n\t\t_alias := alias\n\t\tnewSeries := &protocol.Series{Name: &_alias, Points: series.Points, Fields: series.Fields}\n\n\t\tlengthBeforeFiltering := len(newSeries.Points)\n\t\tvar filteredResult *protocol.Series\n\t\tvar err error\n\t\tif query.GetFromClause().Type == parser.FromClauseInnerJoin {\n\t\t\tfilteredResult = newSeries\n\t\t} else {\n\t\t\tfilteredResult, err = Filter(query, newSeries)\n\t\t\tif err != nil {\n\t\t\t\treturn 0, err\n\t\t\t}\n\t\t}\n\t\t_dropped := lengthBeforeFiltering - len(filteredResult.Points)\n\t\tif _dropped < dropped {\n\t\t\tdropped = _dropped\n\t\t}\n\t\tif err := yield(filteredResult); err != nil {\n\t\t\treturn 0, err\n\t\t}\n\t}\n\n\treturn dropped, nil\n}", "title": "" }, { "docid": "550eae8819056069b89a035d02a12384", "score": "0.5587409", "text": "func (m *Manager) distributeShardRecords(maxSize int64) error {\n\tvar (\n\t\tn = m.recManager.Records.Len()\n\t\tnames = m.rs.OutputFormat.Template.Iter()\n\t\tshardCount = m.rs.OutputFormat.Template.Count()\n\t\tstart int\n\t\tcurShardSize int64\n\t\twg = &sync.WaitGroup{}\n\t\terrCh = make(chan error, m.smap.CountTargets())\n\t\tshardsToTarget = make(map[string][]*extract.Shard, m.smap.CountTargets())\n\t\tnumLocalRecords = make(map[string]int, m.smap.CountTargets())\n\t)\n\n\tif maxSize <= 0 {\n\t\t// Heuristic: to count desired size of shard in case when maxSize is not\n\t\t// specified\n\t\tmaxSize = int64(math.Ceil(float64(m.totalUncompressedSize()) / float64(shardCount)))\n\t}\n\n\tfor _, d := range m.smap.Tmap {\n\t\tnumLocalRecords[d.URL(cmn.NetworkIntraData)] = 0\n\t\tshardsToTarget[d.URL(cmn.NetworkIntraData)] = nil\n\t}\n\tfor i, r := range m.recManager.Records.All() {\n\t\tnumLocalRecords[r.DaemonID]++\n\t\tcurShardSize += r.TotalSize() + m.extractCreator.MetadataSize()*int64(len(r.Objects))\n\t\tif curShardSize < maxSize && i < n-1 {\n\t\t\tcontinue\n\t\t}\n\n\t\tname, hasNext := names()\n\t\tif !hasNext {\n\t\t\t// no more shard names are available\n\t\t\treturn fmt.Errorf(\"number of shards to be created exceeds number of expected shards (%d)\", shardCount)\n\t\t}\n\t\tshard := &extract.Shard{\n\t\t\tName: name + m.rs.Extension,\n\t\t}\n\n\t\t// TODO: Following heuristic doesn't seem to be working correctly in\n\t\t// all cases. When there is not much shards at each disk (like 1-5)\n\t\t// then it may happen that some target will have more shards than other\n\t\t// targets and will \"win\" all output shards what will result in enormous\n\t\t// skew and result in slow creation phase (single target will be\n\t\t// responsible for creating all shards).\n\t\t//\n\t\t// if m.extractCreator.UsingCompression() {\n\t\t// \tdaemonID := nodeForShardRequest(shardsToTarget, numLocalRecords)\n\t\t// \tbaseURL = m.smap.GetTarget(daemonID).URL(cmn.NetworkIntraData)\n\t\t// } else {\n\t\t// \t// If output shards are not compressed, there will always be less\n\t\t// \t// data sent over the network if the shard is constructed on the\n\t\t// \t// correct HRW target as opposed to constructing it on the target\n\t\t// \t// with optimal file content locality and then sent to the correct\n\t\t// \t// target.\n\t\t// }\n\n\t\tsi, errStr := cluster.HrwTarget(m.rs.OutputBucket, shard.Name, m.smap)\n\t\tif errStr != \"\" {\n\t\t\treturn errors.New(errStr)\n\t\t}\n\t\tbaseURL := si.URL(cmn.NetworkIntraData)\n\n\t\tshard.Size = curShardSize\n\t\tshard.Records = m.recManager.Records.Slice(start, i+1)\n\t\tshardsToTarget[baseURL] = append(shardsToTarget[baseURL], shard)\n\n\t\tstart = i + 1\n\t\tcurShardSize = 0\n\t\tfor k := range numLocalRecords {\n\t\t\tnumLocalRecords[k] = 0\n\t\t}\n\t}\n\n\tm.recManager.Records.Drain()\n\n\tfor u, s := range shardsToTarget {\n\t\twg.Add(1)\n\t\tgo func(u string, s []*extract.Shard) {\n\t\t\tdefer wg.Done()\n\t\t\tbody, err := js.Marshal(s)\n\t\t\tif err != nil {\n\t\t\t\terrCh <- err\n\t\t\t\treturn\n\t\t\t}\n\t\t\tu += fmt.Sprintf(\n\t\t\t\t\"%s?%s=%s\",\n\t\t\t\tcmn.URLPath(cmn.Version, cmn.Sort, cmn.Shards, m.ManagerUUID),\n\t\t\t\tcmn.URLParamBckProvider, m.rs.BckProvider,\n\t\t\t)\n\t\t\tif _, err = m.doWithAbort(http.MethodPost, u, body, nil); err != nil {\n\t\t\t\terrCh <- err\n\t\t\t\treturn\n\t\t\t}\n\t\t}(u, s)\n\t}\n\n\twg.Wait()\n\tclose(errCh)\n\tfor err := range errCh {\n\t\treturn fmt.Errorf(\"error while sending shards, err: %v\", err)\n\t}\n\tglog.Infof(\"finished sending all shards\")\n\treturn nil\n}", "title": "" }, { "docid": "c4252105014b175e1e980340f73995f1", "score": "0.55791247", "text": "func (b *Batch) writeLoop(interval time.Duration) {\n\tb.db.closeW.Add(1)\n\tdefer b.db.closeW.Done()\n\ttinyBatchTicker := time.NewTicker(interval)\n\tfor {\n\t\tselect {\n\t\tcase <-b.commitComplete:\n\t\t\ttinyBatchTicker.Stop()\n\t\t\treturn\n\t\tcase <-b.db.closeC:\n\t\t\ttinyBatchTicker.Stop()\n\t\t\treturn\n\t\tcase <-tinyBatchTicker.C:\n\t\t\tif err := b.Write(); err != nil {\n\t\t\t\tlogger.Error().Err(err).Str(\"context\", \"batchWriteLoop\").Msgf(\"Error writing tinyBatch\")\n\t\t\t}\n\t\t}\n\t}\n}", "title": "" }, { "docid": "420ebedae6655d07d8ed62db3a3fcf3c", "score": "0.55358076", "text": "func (kv *ShardKV) send_shard(r_gid int64, shard_index int) {\n\tvar storage_toSend []Pair\n\tvar applied []int64\n\n\t// create list of Pair structs with shard data on them\n\tfor key, value := range kv.storage {\n\t\tif key2shard(key) == shard_index {\n\t\t\tstorage_toSend = append(storage_toSend, Pair{key, value})\n\t\t}\n\t}\n\n\t// copy list of applied ops\n\tfor id, _ := range kv.applied {\n\t\tapplied = append(applied, id)\n\t}\n\n\tfor _, srv := range kv.current_config.Groups[r_gid] {\n\t\t// form RPC args struct\n\t\topId := nrand()\n\t\targs := &SendShardArgs{}\n\t\targs.Storage = storage_toSend\n\t\targs.Config_num = kv.next_config_num\n\t\targs.Shard_index = shard_index\n\t\targs.Applied = applied\n\t\targs.OpId = opId\n\n\t\t// create RPC reply struct\n\t\tvar reply SendShardReply\n\n\t\t// call RPC\n\t\tok := call(srv, \"ShardKV.Receive_shard\", args, &reply)\n\n\t\tif ok && reply.Err == OK {\n\t\t\t// RPC succeeded\n\n\t\t\t// format delete shard op, and propose and evaluate delete shard op\n\t\t\tdeleteArgs := DeleteShardArgs{shard_index, kv.next_config_num}\n\t\t\top := Op{\"DeleteShard\", nrand(), deleteArgs}\n\t\t\tkv.proposeEvaluate(op)\n\t\t\treturn\n\t\t}\n\t}\n}", "title": "" }, { "docid": "645d4dce3ae2c558833710332f4ac30e", "score": "0.5501177", "text": "func (t *Store) SetBatch(list schema.KVList, options ...WriteOption) (index *schema.Index, err error) {\n\tif len(list.GetKVs()) == 0 {\n\t\treturn nil, errors.New(\"Empty set\")\n\t}\n\topts := makeWriteOptions(options...)\n\ttxn := t.db.NewTransactionAt(math.MaxUint64, true)\n\tdefer txn.Discard()\n\n\tfor _, kv := range list.KVs {\n\t\tif err = checkKey(kv.Key); err != nil {\n\t\t\treturn nil, err\n\t\t}\n\t\tif err = txn.SetEntry(&badger.Entry{\n\t\t\tKey: kv.Key,\n\t\t\tValue: kv.Value,\n\t\t}); err != nil {\n\t\t\terr = mapError(err)\n\t\t\treturn\n\t\t}\n\t}\n\n\ttsEntries := t.tree.NewBatch(&list)\n\tts := tsEntries[len(tsEntries)-1].ts\n\tindex = &schema.Index{\n\t\tIndex: ts - 1,\n\t}\n\n\tcb := func(err error) {\n\t\tif err == nil {\n\t\t\tfor _, entry := range tsEntries {\n\t\t\t\tt.tree.Commit(entry)\n\t\t\t}\n\t\t} else {\n\t\t\tfor _, entry := range tsEntries {\n\t\t\t\tt.tree.Discard(entry)\n\t\t\t}\n\t\t}\n\n\t\tif opts.asyncCommit {\n\t\t\tt.wg.Done()\n\t\t}\n\t}\n\n\tif opts.asyncCommit {\n\t\tt.wg.Add(1)\n\t\terr = mapError(txn.CommitAt(ts, cb)) // cb will be executed in a new goroutine\n\t} else {\n\t\terr = mapError(txn.CommitAt(ts, nil))\n\t\tcb(err)\n\t}\n\treturn\n}", "title": "" }, { "docid": "828e089ae4b60e19f145ea5ea07b3942", "score": "0.54960304", "text": "func (f *File) writeAtChunk(b []byte, off int64) (n int, err error) {\n\tcreditCharge, m, err := f.fs.loanCredit(len(b))\n\tdefer func() {\n\t\tif err != nil {\n\t\t\tf.fs.chargeCredit(creditCharge)\n\t\t}\n\t}()\n\tif err != nil {\n\t\treturn 0, err\n\t}\n\n\treq := &WriteRequest{\n\t\tFlags: 0,\n\t\tChannel: 0,\n\t\tRemainingBytes: 0,\n\t\tOffset: uint64(off),\n\t\tWriteChannelInfo: nil,\n\t\tData: b[:m],\n\t}\n\n\treq.FileId = f.fd\n\n\treq.CreditCharge = creditCharge\n\n\tres, err := f.sendRecv(SMB2_WRITE, req)\n\tif err != nil {\n\t\treturn 0, err\n\t}\n\n\tr := WriteResponseDecoder(res)\n\tif r.IsInvalid() {\n\t\treturn 0, &InvalidResponseError{\"broken write response format\"}\n\t}\n\n\treturn int(r.Count()), nil\n}", "title": "" }, { "docid": "76adf03b3d92e1efc012428877e8226c", "score": "0.5491039", "text": "func WriteResultChunksChan(ctx context.Context, s sqliteutil.Execable, tableName string, serializer serialization.Serializer, ch <-chan IndexedResultChunk) error {\n\treturn util.InvokeN(NumWriterRoutines, func() error {\n\t\tinserter := sqliteutil.NewBatchInserter(s, tableName, \"id\", \"data\")\n\n\t\tfor v := range ch {\n\t\t\tdata, err := serializer.MarshalResultChunkData(v.ResultChunk)\n\t\t\tif err != nil {\n\t\t\t\treturn errors.Wrap(err, \"serializer.MarshalResultChunkData\")\n\t\t\t}\n\n\t\t\tif err := inserter.Insert(ctx, v.Index, data); err != nil {\n\t\t\t\treturn errors.Wrap(err, \"inserter.Insert\")\n\t\t\t}\n\t\t}\n\n\t\tif err := inserter.Flush(ctx); err != nil {\n\t\t\treturn errors.Wrap(err, \"inserter.Flush\")\n\t\t}\n\n\t\treturn nil\n\t})\n}", "title": "" }, { "docid": "6a283ea27b4363dd642744066e63a8e9", "score": "0.5476831", "text": "func (stg *replicateStorage) Write(ctx context.Context, b *core.Shard) (err error) {\n\tspan := trace.SpanFromContextSafe(ctx)\n\n\t// modify shard.Body\n\twait, _ := stg.forward(ctx, b)\n\tdefer func() {\n\t\tfwdErr := wait(err)\n\t\tspan.Debugf(\"wait err:%v, fwdErr:%v\", err, fwdErr)\n\t\terr = fwdErr\n\t}()\n\n\t// write original location\n\terr = stg.masterStg.Write(ctx, b)\n\tif err != nil {\n\t\treturn err\n\t}\n\n\treturn nil\n}", "title": "" }, { "docid": "046e87580994c8539294bc17f9cdc96e", "score": "0.54732203", "text": "func WriteAll(baseBatch database.Batch, batches ...database.Batch) error {\n\tbaseBatch = baseBatch.Inner()\n\tfor _, batch := range batches {\n\t\tbatch = batch.Inner()\n\t\tif err := batch.Replay(baseBatch); err != nil {\n\t\t\treturn err\n\t\t}\n\t}\n\treturn baseBatch.Write()\n}", "title": "" }, { "docid": "c18888e22756bf6acdfdb29d9169d6bd", "score": "0.5471693", "text": "func batchWriter(tb *table, bi dynamodb.BatchWriteItemInput) error {\n\treq := tb.Svc.BatchWriteItemRequest(&bi)\n\tresult, err := req.Send(context.Background())\n\tif len(result.UnprocessedItems) != 0 {\n\t\terr = errors.New(\"Unprocessed Items\") // as well as dynamodb errors, force Retry\n\t}\n\treturn err\n}", "title": "" }, { "docid": "d42c4b99fc6c71bfb40561861b01aff6", "score": "0.5454405", "text": "func (bw *BatchWrite) Run() error {\n\tif bw.err != nil {\n\t\treturn bw.err\n\t}\n\tboff := backoff.NewExponentialBackOff()\n\tboff.MaxElapsedTime = 0\n\n\tloopSize := len(bw.ops) / 25\n\n\ti := 0\n\n\tfor i < loopSize+1 {\n\t\tvar res *dynamodb.BatchWriteItemOutput\n\t\tstart := i * 25\n\t\tend := start + 25\n\n\t\tif i == loopSize {\n\t\t\tend = len(bw.ops)\n\t\t}\n\n\t\treq := bw.input(start, end)\n\n\t\terr := retry(func() error {\n\t\t\tvar err error\n\t\t\tres, err = bw.batch.table.db.client.BatchWriteItem(req)\n\t\t\treturn err\n\t\t})\n\t\tif err != nil {\n\t\t\treturn err\n\t\t}\n\n\t\ttime.Sleep(boff.NextBackOff())\n\t\ti++\n\t}\n\n\treturn nil\n}", "title": "" }, { "docid": "2feb9b2a3a51b2b212cb38b936937dcf", "score": "0.54485285", "text": "func (c *Client) Write(path string, offset int64, data []byte) (size int, error error) {\n\tgfs.DebugMsgToFile(fmt.Sprintf(\"write file path <%s> offset <%d>\", path, offset), gfs.CLIENT, c.identifier)\n\tdefer gfs.DebugMsgToFile(fmt.Sprintf(\"write file path <%s> offset <%d> end\", path, offset), gfs.CLIENT, c.identifier)\n\tvar f gfs.GetFileInfoReply\n\terr := gfs.Call(c.master, \"Master.RPCGetFileInfo\", gfs.GetFileInfoArg{Path: path}, &f)\n\tif err != nil {\n\t\tgfs.DebugMsgToFile(fmt.Sprintf(\"write file path <%s> offset <%d> error <%s>\", path, offset, err), gfs.CLIENT, c.identifier)\n\t\treturn 0, err\n\t}\n\n\tif offset/gfs.MaxChunkSize > f.ChunkNum {\n\t\tgfs.DebugMsgToFile(fmt.Sprintf(\"write file path <%s> offset <%d> error <exceeds file size>\", path, offset), gfs.CLIENT, c.identifier)\n\t\treturn 0, fmt.Errorf(\"write file %s offset \", path)\n\t}\n\n\tbegin := 0\n\tfor {\n\t\tindex := offset / gfs.MaxChunkSize\n\t\tchunkOffset := offset % gfs.MaxChunkSize\n\n\t\thandle, err := c.getChunkHandle(path, index)\n\t\tif err != nil {\n\t\t\tgfs.DebugMsgToFile(fmt.Sprintf(\"write file path <%s> offset <%d> error <%s>\", path, offset, err), gfs.CLIENT, c.identifier)\n\t\t\treturn begin, err\n\t\t}\n\n\t\twriteMax := int(gfs.MaxChunkSize - chunkOffset)\n\t\tvar writeLen int\n\t\tif begin+writeMax > len(data) {\n\t\t\twriteLen = len(data) - begin\n\t\t} else {\n\t\t\twriteLen = writeMax\n\t\t}\n\n\t\tfor {\n\t\t\terr = c.writeChunk(handle, chunkOffset, data[begin:begin+writeLen])\n\t\t\tif err == nil {\n\t\t\t\tbreak\n\t\t\t}\n\t\t\tgfs.DebugMsgToFile(fmt.Sprintf(\"write file path <%s> offset <%d> error <write chunk error %s>\", path, offset, err), gfs.CLIENT, c.identifier)\n\t\t}\n\n\t\toffset += int64(writeLen)\n\t\tbegin += writeLen\n\n\t\tif begin == len(data) {\n\t\t\tbreak\n\t\t}\n\t}\n\n\treturn begin, nil\n}", "title": "" }, { "docid": "eda9cf344e476352b5aa4cb16748cb34", "score": "0.54252315", "text": "func transferWrites(throughput int, writingChannel chan *WriteEntry, messages chan *WriteEntry) {\n\tfor i := 0; i < throughput; {\n\t\tmessage := <-messages\n\t\twritingChannel <- message\n\t\ti += message.WriteUnitesConsumed\n\t}\n}", "title": "" }, { "docid": "672f4b0aefd5937d164de5c2acc0d22b", "score": "0.54234815", "text": "func (p RawKVProxy) BatchPut(id UUID, keys, values [][]byte) error {\n\tclient, ok := p.clients.Load(id)\n\tif !ok {\n\t\treturn errors.WithStack(ErrClientNotFound)\n\t}\n\treturn client.(*rawkv.Client).BatchPut(keys, values)\n}", "title": "" }, { "docid": "f06351e36bef6162c261c51db964a673", "score": "0.5350281", "text": "func (w *Writer) Write(data []byte) (n int, err error) {\n\tif w.errorTriggered {\n\t\treturn 0, fmt.Errorf(\"error occurred during previous writes\")\n\t}\n\n\tvar bytesWritten int64\n\tfor len(data) > 0 {\n\t\t// Check if we need to start a new shard.\n\t\tif w.shardFull() {\n\t\t\tif err := w.newShard(); err != nil {\n\t\t\t\tw.errorTriggered = true\n\t\t\t\treturn int(bytesWritten), err\n\t\t\t}\n\t\t}\n\t\t// Figure out how much of the input we can use before sharding.\n\t\tsplitPoint := w.opts.shardSize - w.bytesWritten\n\n\t\t// If we don't have enough to fill out the remainder of\n\t\t// the current shard, adjust the cut point.\n\t\tif splitPoint > int64(len(data)) {\n\t\t\tsplitPoint = int64(len(data))\n\t\t}\n\n\t\tn, err = w.currentFile.Write(data[:splitPoint])\n\t\tbytesWritten += int64(n)\n\t\tw.bytesWritten += int64(n)\n\t\tif (err != nil) || int64(n) != splitPoint {\n\t\t\tw.errorTriggered = true\n\t\t\treturn int(bytesWritten), fmt.Errorf(\"error writing: %v\", err)\n\t\t}\n\n\t\t// Drop the portion written so far.\n\t\tdata = data[splitPoint:]\n\t}\n\n\treturn int(bytesWritten), nil\n}", "title": "" }, { "docid": "b58762e9bf84f16423f552b6f05ab6c2", "score": "0.53460515", "text": "func (s *S3Remote) ChunkWriter(k K) (wc io.WriteCloser, err error) {\n\treturn s.bucket.PutWriter(fmt.Sprintf(\"%x\", k), nil, nil)\n}", "title": "" }, { "docid": "9192d036501ae3897d78de9db4d63491", "score": "0.533559", "text": "func (b *BTTraceStore) applyBulkBatched(ctx context.Context, rowNames []string, mutations []*bigtable.Mutation, batchSize int) error {\n\tif len(rowNames) == 0 {\n\t\treturn nil\n\t}\n\terr := util.ChunkIterParallel(ctx, len(rowNames), batchSize, func(ctx context.Context, chunkStart, chunkEnd int) error {\n\t\tctx, cancel := context.WithTimeout(ctx, writeTimeout)\n\t\tdefer cancel()\n\t\trowNames := rowNames[chunkStart:chunkEnd]\n\t\tmutations := mutations[chunkStart:chunkEnd]\n\t\terrs, err := b.table.ApplyBulk(ctx, rowNames, mutations)\n\t\tif err != nil {\n\t\t\treturn skerr.Wrapf(err, \"writing batch [%d:%d]\", chunkStart, chunkEnd)\n\t\t}\n\t\tif errs != nil {\n\t\t\treturn skerr.Wrapf(err, \"writing some portions of batch [%d:%d]\", chunkStart, chunkEnd)\n\t\t}\n\t\treturn nil\n\t})\n\tif err != nil {\n\t\treturn skerr.Wrapf(err, \"running ChunkIterParallel(%s...%s) batch size %d\", rowNames[0], rowNames[len(rowNames)-1], batchSize)\n\t}\n\treturn nil\n}", "title": "" }, { "docid": "86cefd3ea71f7826d533bfdb3b606de0", "score": "0.5334705", "text": "func saveChunk(ctx context.Context, db *sql.DB, chunkID int, instanceID, schema, table, checksum string, chunk *ChunkRange) error {\n\tchunkBytes, err := json.Marshal(chunk)\n\tif err != nil {\n\t\treturn errors.Trace(err)\n\t}\n\n\tsql := fmt.Sprintf(\"REPLACE INTO `%s`.`%s` VALUES(?, ?, ?, ?, ?, ?, ?, ?, ?);\", checkpointSchemaName, chunkTableName)\n\terr = dbutil.ExecSQLWithRetry(ctx, db, sql, chunkID, instanceID, schema, table, chunk.Where, checksum, string(chunkBytes), chunk.State, time.Now())\n\tif err != nil {\n\t\tlog.Error(\"save chunk info failed\", zap.Error(err))\n\t\treturn errors.Trace(err)\n\t}\n\treturn nil\n}", "title": "" }, { "docid": "2551df0dd72ecd21f59c4cdc8f259e07", "score": "0.53172594", "text": "func initChunks(ctx context.Context, db *sql.DB, instanceID, schema, table string, chunks []*ChunkRange) error {\n\tbeginTime := time.Now()\n\tbatch := 100\n\tnum := 0\n\tsqlPrefix := fmt.Sprintf(\"INSERT INTO `%s`.`%s` VALUES\", checkpointSchemaName, chunkTableName)\n\n\tvaluesPlaceholders := \"(?, ?, ?, ?, ?, ?, ?, ?, ?)\"\n\tvaluesPlaceholdersArray := make([]string, 0, batch)\n\tvalues := make([]interface{}, 0, 9*batch)\n\n\tfor i, chunk := range chunks {\n\t\tnum++\n\t\tchunkBytes, err := json.Marshal(chunk)\n\t\tif err != nil {\n\t\t\treturn errors.Trace(err)\n\t\t}\n\n\t\tvalues = append(values, chunk.ID, instanceID, schema, table, chunk.Where, \"\", string(chunkBytes), chunk.State, time.Now())\n\t\tvaluesPlaceholdersArray = append(valuesPlaceholdersArray, valuesPlaceholders)\n\n\t\tif num >= batch || i == len(chunks)-1 {\n\t\t\tsql := fmt.Sprintf(\"%s%s\", sqlPrefix, strings.Join(valuesPlaceholdersArray, \", \"))\n\t\t\terr = dbutil.ExecSQLWithRetry(ctx, db, sql, values...)\n\t\t\tif err != nil {\n\t\t\t\tlog.Error(\"save chunk info failed\", zap.Error(err))\n\t\t\t\treturn errors.Trace(err)\n\t\t\t}\n\t\t\tnum = 0\n\t\t\tvaluesPlaceholdersArray = valuesPlaceholdersArray[:0]\n\t\t\tvalues = values[:0]\n\t\t}\n\t}\n\n\tlog.Info(\"initial chunks\", zap.Duration(\"cost\", time.Since(beginTime)))\n\n\treturn nil\n}", "title": "" }, { "docid": "04b321d472dfcba956677f68a9a9a1d6", "score": "0.53080237", "text": "func PutMulti(ctx context.Context, client *datastore.Client, keys []*datastore.Key, endpoints []Stats) error {\n\tcount := 0\n\terrChan := make(chan error)\n\tfor start := 0; start < len(keys); start = start + batchSize {\n\t\tcount++\n\t\tend := start + batchSize\n\t\tif end > len(keys) {\n\t\t\tend = len(keys)\n\t\t}\n\n\t\t// TODO - add latency metric here.\n\t\tgo func(errChan chan error, start, end int) {\n\t\t\t_, err := client.PutMulti(ctx, keys[start:end], endpoints[start:end])\n\t\t\terrChan <- err\n\t\t}(errChan, start, end)\n\t}\n\n\tvar lastError error = nil\n\tfor ; count > 0; count-- {\n\t\terr := <-errChan\n\t\tif err != nil {\n\t\t\tlastError = err\n\t\t\tlog.Println(err)\n\t\t}\n\t}\n\n\tlog.Println(\"Put\", len(keys), \"entities\")\n\treturn lastError\n}", "title": "" }, { "docid": "8bdfae34dcb64466ced5aea789ad0395", "score": "0.53030676", "text": "func ChunkedInsert(resources []*Resource, clusterName string) ChunkedOperationResult {\n\tvar resourceErrors map[string]error\n\ttotalSuccessful := 0\n\tvar ExistingIndexMapMutex = sync.RWMutex{}\n\n\tkindMap := make(map[string]struct{})\n\tfor _, res := range resources {\n\t\tkindMap[res.Properties[\"kind\"].(string)] = struct{}{}\n\t}\n\n\tfor i := 0; i < len(resources); i += CHUNK_SIZE {\n\t\tendIndex := min(i+CHUNK_SIZE, len(resources))\n\t\tchunkResult := chunkedInsertHelper(resources[i:endIndex], clusterName)\n\t\tif chunkResult.ConnectionError != nil {\n\t\t\treturn chunkResult\n\t\t} else if chunkResult.ResourceErrors != nil {\n\t\t\tresourceErrors = mergeErrorMaps(resourceErrors, chunkResult.ResourceErrors) // if both are nil, this is nil\n\t\t}\n\t\ttotalSuccessful += chunkResult.SuccessfulResources\n\t}\n\tret := ChunkedOperationResult{\n\t\tResourceErrors: resourceErrors,\n\t\tSuccessfulResources: totalSuccessful,\n\t}\n\tfor kind := range kindMap {\n\t\tExistingIndexMapMutex.RLock()\n\t\texists := ExistingIndexMap[kind]\n\t\tExistingIndexMapMutex.RUnlock()\n\t\tif !exists {\n\t\t\tinsertErr := insertIndex(kind, \"_uid\")\n\t\t\tif insertErr == nil {\n\t\t\t\tExistingIndexMapMutex.Lock() // Lock map before writing\n\t\t\t\tExistingIndexMap[kind] = true\n\t\t\t\tExistingIndexMapMutex.Unlock() // Unlock map after writing\n\t\t\t}\n\t\t}\n\t}\n\treturn ret\n}", "title": "" }, { "docid": "bd02dc66c0aa2dfb3288d863921cec66", "score": "0.5297735", "text": "func (wb *RocksDBWriteBatchWrapper) Sync() error {\n\treturn wb.db.connect.Write(wb.db.wo, wb.batch)\n}", "title": "" }, { "docid": "50223649e1bf33675a63423ec69a211d", "score": "0.5291408", "text": "func TestChunkPipe(t *testing.T) {\n\tfor i := range dataWrites {\n\t\tt.Run(fmt.Sprintf(\"%d\", i), testChunkPipe)\n\t}\n}", "title": "" }, { "docid": "4c5c9251da32b9f9c8bc3bca07c36b2b", "score": "0.5270031", "text": "func (c *CouchDBStore) PutBulk(keys []string, values [][]byte) error {\n\terr := validateKeysAndValues(keys, values)\n\tif err != nil {\n\t\treturn err\n\t}\n\n\t// If CouchDB receives the same key multiple times, it will just keep the first change and disregard the rest.\n\t// We want the opposite behaviour - we need it to only keep the last change and disregard the earlier ones as if\n\t// they've been overwritten.\n\tkeys, values = removeDuplicatesKeepingOnlyLast(keys, values)\n\n\tvaluesToPut := make([][]byte, len(keys))\n\n\trevIDs, err := c.getRevIDs(keys)\n\tif err != nil {\n\t\treturn fmt.Errorf(getRevIDFailureErrMsg, err)\n\t}\n\n\tfor i, revID := range revIDs {\n\t\tvaluesToPut[i], err = c.addIDAndRevID(values[i], keys[i], revID)\n\t\tif err != nil {\n\t\t\treturn fmt.Errorf(failureWhileAddingRevID, err)\n\t\t}\n\t}\n\n\tvaluesToPutAsInterfaces := make([]interface{}, len(valuesToPut))\n\tfor i, valueToPut := range valuesToPut {\n\t\tvaluesToPutAsInterfaces[i] = valueToPut\n\t}\n\n\t_, err = c.db.BulkDocs(context.Background(), valuesToPutAsInterfaces)\n\tif err != nil {\n\t\treturn fmt.Errorf(failureWhileDoingBulkDocsCall, err)\n\t}\n\n\treturn nil\n}", "title": "" }, { "docid": "9f50a4ce8c2f6ee058174202d21bf20a", "score": "0.5266374", "text": "func (sm *SyncedMemory) flush() {\n\tlog.Println(\"Beginning Flush\")\n\t// ip := GetLocalIP()\n\tinternalMap, lock := sm.localMap.GetCurrentMapWithLock()\n\tpipe := sm.redisClient.Pipeline()\n\tlock.RLock()\n\tdefer lock.RUnlock()\n\tdataPoints := make([]flatEntry, len(*internalMap))\n\tcount := 0\n\tfor k, v := range *internalMap {\n\t\tdataPoints[count] = flatEntry{key: k.(string), val: v.(int)}\n\t\tcount = count + 1\n\t}\n\t// TODO - now stream it to Redis\n\tip := sm.config.host\n\ttotalDataPoints := len(dataPoints)\n\tchunkSize := 100\n\tchunks := totalDataPoints / chunkSize\n\tleftOver := totalDataPoints % chunkSize\n\tfor i := 0; i < chunks; i++ {\n\t\tvalueMap := make(map[string]interface{})\n\t\tvalueMap[\"host\"] = ip\n\t\tfor j := 0; j < chunkSize; j++ {\n\t\t\tcur := i*chunkSize + j\n\t\t\tentry := dataPoints[cur]\n\t\t\tvalueMap[entry.key] = entry.val\n\t\t}\n\t\txargs := &redis.XAddArgs{Values: valueMap}\n\t\tpipe.XAdd(xargs)\n\t}\n\n\tvalueMap := make(map[string]interface{})\n\tvalueMap[\"host\"] = ip\n\tfor i := 0; i < leftOver; i++ {\n\t\tentry := dataPoints[i]\n\t\tvalueMap[entry.key] = entry.val\n\t}\n\txargs := &redis.XAddArgs{Values: valueMap, Stream: streamName}\n\tpipe.XAdd(xargs)\n\t_, err := pipe.Exec()\n\tif err != nil {\n\t\tlog.Println(\"Error while streaming data via Redis Pipe\")\n\t} else {\n\t\tlog.Println(\"Completed flushing\")\n\t}\n}", "title": "" }, { "docid": "ce9c59a386f56a9fa1380958d2104366", "score": "0.5254716", "text": "func writeDataBlocks(ctx context.Context, dst io.Writer, enBlocks [][]byte, dataBlocks int, offset int64, length int64) (int64, error) {\n\t// Offset and out size cannot be negative.\n\tif offset < 0 || length < 0 {\n\t\tlogger.LogIf(ctx, errUnexpected)\n\t\treturn 0, errUnexpected\n\t}\n\n\t// Do we have enough blocks?\n\tif len(enBlocks) < dataBlocks {\n\t\tlogger.LogIf(ctx, fmt.Errorf(\"diskBlocks(%d)/dataBlocks(%d) - %w\", len(enBlocks), dataBlocks, reedsolomon.ErrTooFewShards))\n\t\treturn 0, reedsolomon.ErrTooFewShards\n\t}\n\n\t// Do we have enough data?\n\tif int64(getDataBlockLen(enBlocks, dataBlocks)) < length {\n\t\tlogger.LogIf(ctx, fmt.Errorf(\"getDataBlockLen(enBlocks, dataBlocks)(%d)/length(%d) - %w\", getDataBlockLen(enBlocks, dataBlocks), length, reedsolomon.ErrShortData))\n\t\treturn 0, reedsolomon.ErrShortData\n\t}\n\n\t// Counter to decrement total left to write.\n\twrite := length\n\n\t// Counter to increment total written.\n\tvar totalWritten int64\n\n\t// Write all data blocks to dst.\n\tfor _, block := range enBlocks[:dataBlocks] {\n\t\t// Skip blocks until we have reached our offset.\n\t\tif offset >= int64(len(block)) {\n\t\t\t// Decrement offset.\n\t\t\toffset -= int64(len(block))\n\t\t\tcontinue\n\t\t} else {\n\t\t\t// Skip until offset.\n\t\t\tblock = block[offset:]\n\n\t\t\t// Reset the offset for next iteration to read everything\n\t\t\t// from subsequent blocks.\n\t\t\toffset = 0\n\t\t}\n\n\t\t// We have written all the blocks, write the last remaining block.\n\t\tif write < int64(len(block)) {\n\t\t\tn, err := io.Copy(dst, bytes.NewReader(block[:write]))\n\t\t\tif err != nil {\n\t\t\t\t// The writer will be closed incase of range queries, which will emit ErrClosedPipe.\n\t\t\t\t// The reader pipe might be closed at ListObjects io.EOF ignore it.\n\t\t\t\tif err != io.ErrClosedPipe && err != io.EOF {\n\t\t\t\t\tlogger.LogIf(ctx, err)\n\t\t\t\t}\n\t\t\t\treturn 0, err\n\t\t\t}\n\t\t\ttotalWritten += n\n\t\t\tbreak\n\t\t}\n\n\t\t// Copy the block.\n\t\tn, err := io.Copy(dst, bytes.NewReader(block))\n\t\tif err != nil {\n\t\t\t// The writer will be closed incase of range queries, which will emit ErrClosedPipe.\n\t\t\t// The reader pipe might be closed at ListObjects io.EOF ignore it.\n\t\t\tif err != io.ErrClosedPipe && err != io.EOF {\n\t\t\t\tlogger.LogIf(ctx, err)\n\t\t\t}\n\t\t\treturn 0, err\n\t\t}\n\n\t\t// Decrement output size.\n\t\twrite -= n\n\n\t\t// Increment written.\n\t\ttotalWritten += n\n\t}\n\n\t// Success.\n\treturn totalWritten, nil\n}", "title": "" }, { "docid": "e191811fab7d54dfe35702d238219087", "score": "0.5254245", "text": "func (e *encoder) writeChunks(buf *bytes.Buffer, image *StructPNG) error {\n\n\tfor _, chunk := range image.Chunks() {\n\t\terr := e.writeChunk(buf, chunk)\n\t\tif err != nil {\n\t\t\treturn err\n\t\t}\n\t}\n\n\treturn nil\n}", "title": "" }, { "docid": "2d9e4cf63a6b7f33a2d31c6e73af5972", "score": "0.52524143", "text": "func (s *Storage) NewWriteBatch() util.WriteBatch {\n\treturn &writeBatch{}\n}", "title": "" }, { "docid": "2c41ef65d6b3430ecf8f77ea3f2cb6f2", "score": "0.52474695", "text": "func (c *Client) RangeBatch() {\n\tfor _, xx := range c.knownSeries() {\n\t\tquery := c.RangeQuery(xx)\n\t\tresp, err := c.Fetch(query)\n\t\tif err != nil {\n\t\t\terrorCounter.WithLabelValues(\"range query error\").Inc()\n\t\t\treturn\n\t\t}\n\n\t\tseries, _ := DecodeRangeQ(resp)\n\t\tc.RangeInsert(series)\n\t}\n}", "title": "" }, { "docid": "554b823fce1d54dff910ee18f35eef9d", "score": "0.52415305", "text": "func (shard *TableShard) saveUpsertBatch(upsertBatch *common.UpsertBatch, redoLogFile int64, offset uint32, recovery, skipBackFillRows bool) error {\n\ttableName := shard.Schema.Schema.Name\n\tshardID := shard.ShardID\n\tshard.LiveStore.WriterLock.Lock()\n\n\tif recovery {\n\t\tutils.GetReporter(tableName, shardID).GetCounter(utils.IngestedRecoveryBatches).Inc(1)\n\t\tutils.GetReporter(tableName, shardID).GetGauge(utils.RecoveryUpsertBatchSize).Update(float64(len(upsertBatch.GetBuffer())))\n\t\t// Put a 0 in maxEventTimePerFile in case this is redolog is full of backfill batches.\n\t\tshard.LiveStore.RedoLogManager.UpdateMaxEventTime(0, redoLogFile)\n\t} else {\n\t\tutils.GetReporter(tableName, shardID).GetCounter(utils.IngestedUpsertBatches).Inc(1)\n\t\tutils.GetReporter(tableName, shardID).GetGauge(utils.UpsertBatchSize).Update(float64(len(upsertBatch.GetBuffer())))\n\t\t// for non-recovery and local file based redolog, need write the upsertbatch into redolog file\n\t\tif shard.LiveStore.RedoLogManager.IsAppendEnabled() {\n\t\t\t// change original file/offset to be local redolog file/offset\n\t\t\tredoLogFile, offset = shard.LiveStore.RedoLogManager.AppendToRedoLog(upsertBatch)\n\t\t}\n\t}\n\n\tneedToWaitForBackfillBuffer, err := shard.ApplyUpsertBatch(upsertBatch, redoLogFile, offset, skipBackFillRows)\n\tshard.LiveStore.WriterLock.Unlock()\n\n\t// return immediately if it does not need to wait for backfill buffer availability\n\tif recovery || !needToWaitForBackfillBuffer {\n\t\treturn err\n\t}\n\n\t// otherwise: block until backfill buffer becomes available again\n\tshard.LiveStore.BackfillManager.WaitForBackfillBufferAvailability()\n\treturn err\n}", "title": "" }, { "docid": "b4bcc6d7b7f687662e04bbe33c7dfa45", "score": "0.5236259", "text": "func (m *MockBlock) WriteBatch(inserts *WriteBatch) (WriteBatchResult, error) {\n\tm.ctrl.T.Helper()\n\tret := m.ctrl.Call(m, \"WriteBatch\", inserts)\n\tret0, _ := ret[0].(WriteBatchResult)\n\tret1, _ := ret[1].(error)\n\treturn ret0, ret1\n}", "title": "" }, { "docid": "f0067fcc23b182c4e3b6e3d469fba220", "score": "0.52263767", "text": "func (m *SyncMap64) Flush() int {\n\tsize := 0\n\tfor _, shard := range m.shards {\n\t\tshard.Lock()\n\t\tsize += len(shard.items)\n\t\tshard.items = make(map[uint64]interface{})\n\t\tshard.Unlock()\n\t}\n\treturn size\n}", "title": "" }, { "docid": "a8973c52c7f7077755a5a1549db1281e", "score": "0.5225673", "text": "func (multiArray *MultiQueue) writeBlock(startIndex int, b *block) {\n\tfor index, bit := range b.serialize() {\n\t\tmultiArray.shm.Queue[startIndex+index] = bit\n\t}\n\n\tmultiArray.shm.Queue[startIndex] = 1\n}", "title": "" }, { "docid": "ed78b47af4c4e1be4735fc527306e84d", "score": "0.52166903", "text": "func TestChunkWriter_ReadAfterWrite(t *testing.T) {\n\tchk1 := assureChunkFromSamples(t, []chunks.Sample{sample{1, 1, nil, nil}})\n\tchk2 := assureChunkFromSamples(t, []chunks.Sample{sample{1, 2, nil, nil}})\n\tchk3 := assureChunkFromSamples(t, []chunks.Sample{sample{1, 3, nil, nil}})\n\tchk4 := assureChunkFromSamples(t, []chunks.Sample{sample{1, 4, nil, nil}})\n\tchk5 := assureChunkFromSamples(t, []chunks.Sample{sample{1, 5, nil, nil}})\n\tchunkSize := len(chk1.Chunk.Bytes()) + chunks.MaxChunkLengthFieldSize + chunks.ChunkEncodingSize + crc32.Size\n\n\ttests := []struct {\n\t\tchks [][]chunks.Meta\n\t\tsegmentSize,\n\t\texpSegmentsCount int\n\t\texpSegmentSizes []int\n\t}{\n\t\t// 0:Last chunk ends at the segment boundary so\n\t\t// all chunks should fit in a single segment.\n\t\t{\n\t\t\tchks: [][]chunks.Meta{\n\t\t\t\t{\n\t\t\t\t\tchk1,\n\t\t\t\t\tchk2,\n\t\t\t\t\tchk3,\n\t\t\t\t},\n\t\t\t},\n\t\t\tsegmentSize: 3 * chunkSize,\n\t\t\texpSegmentSizes: []int{3 * chunkSize},\n\t\t\texpSegmentsCount: 1,\n\t\t},\n\t\t// 1:Two chunks can fit in a single segment so the last one should result in a new segment.\n\t\t{\n\t\t\tchks: [][]chunks.Meta{\n\t\t\t\t{\n\t\t\t\t\tchk1,\n\t\t\t\t\tchk2,\n\t\t\t\t\tchk3,\n\t\t\t\t\tchk4,\n\t\t\t\t\tchk5,\n\t\t\t\t},\n\t\t\t},\n\t\t\tsegmentSize: 2 * chunkSize,\n\t\t\texpSegmentSizes: []int{2 * chunkSize, 2 * chunkSize, chunkSize},\n\t\t\texpSegmentsCount: 3,\n\t\t},\n\t\t// 2:When the segment size is smaller than the size of 2 chunks\n\t\t// the last segment should still create a new segment.\n\t\t{\n\t\t\tchks: [][]chunks.Meta{\n\t\t\t\t{\n\t\t\t\t\tchk1,\n\t\t\t\t\tchk2,\n\t\t\t\t\tchk3,\n\t\t\t\t},\n\t\t\t},\n\t\t\tsegmentSize: 2*chunkSize - 1,\n\t\t\texpSegmentSizes: []int{chunkSize, chunkSize, chunkSize},\n\t\t\texpSegmentsCount: 3,\n\t\t},\n\t\t// 3:When the segment is smaller than a single chunk\n\t\t// it should still be written by ignoring the max segment size.\n\t\t{\n\t\t\tchks: [][]chunks.Meta{\n\t\t\t\t{\n\t\t\t\t\tchk1,\n\t\t\t\t},\n\t\t\t},\n\t\t\tsegmentSize: chunkSize - 1,\n\t\t\texpSegmentSizes: []int{chunkSize},\n\t\t\texpSegmentsCount: 1,\n\t\t},\n\t\t// 4:All chunks are bigger than the max segment size, but\n\t\t// these should still be written even when this will result in bigger segment than the set size.\n\t\t// Each segment will hold a single chunk.\n\t\t{\n\t\t\tchks: [][]chunks.Meta{\n\t\t\t\t{\n\t\t\t\t\tchk1,\n\t\t\t\t\tchk2,\n\t\t\t\t\tchk3,\n\t\t\t\t},\n\t\t\t},\n\t\t\tsegmentSize: 1,\n\t\t\texpSegmentSizes: []int{chunkSize, chunkSize, chunkSize},\n\t\t\texpSegmentsCount: 3,\n\t\t},\n\t\t// 5:Adding multiple batches of chunks.\n\t\t{\n\t\t\tchks: [][]chunks.Meta{\n\t\t\t\t{\n\t\t\t\t\tchk1,\n\t\t\t\t\tchk2,\n\t\t\t\t\tchk3,\n\t\t\t\t},\n\t\t\t\t{\n\t\t\t\t\tchk4,\n\t\t\t\t\tchk5,\n\t\t\t\t},\n\t\t\t},\n\t\t\tsegmentSize: 3 * chunkSize,\n\t\t\texpSegmentSizes: []int{3 * chunkSize, 2 * chunkSize},\n\t\t\texpSegmentsCount: 2,\n\t\t},\n\t\t// 6:Adding multiple batches of chunks.\n\t\t{\n\t\t\tchks: [][]chunks.Meta{\n\t\t\t\t{\n\t\t\t\t\tchk1,\n\t\t\t\t},\n\t\t\t\t{\n\t\t\t\t\tchk2,\n\t\t\t\t\tchk3,\n\t\t\t\t},\n\t\t\t\t{\n\t\t\t\t\tchk4,\n\t\t\t\t},\n\t\t\t},\n\t\t\tsegmentSize: 2 * chunkSize,\n\t\t\texpSegmentSizes: []int{2 * chunkSize, 2 * chunkSize},\n\t\t\texpSegmentsCount: 2,\n\t\t},\n\t}\n\n\tfor i, test := range tests {\n\t\tt.Run(strconv.Itoa(i), func(t *testing.T) {\n\t\t\ttempDir := t.TempDir()\n\n\t\t\tchunkw, err := chunks.NewWriterWithSegSize(tempDir, chunks.SegmentHeaderSize+int64(test.segmentSize))\n\t\t\trequire.NoError(t, err)\n\n\t\t\tfor _, chks := range test.chks {\n\t\t\t\trequire.NoError(t, chunkw.WriteChunks(chks...))\n\t\t\t}\n\t\t\trequire.NoError(t, chunkw.Close())\n\n\t\t\tfiles, err := os.ReadDir(tempDir)\n\t\t\trequire.NoError(t, err)\n\t\t\trequire.Equal(t, test.expSegmentsCount, len(files), \"expected segments count mismatch\")\n\n\t\t\t// Verify that all data is written to the segments.\n\t\t\tsizeExp := 0\n\t\t\tsizeAct := 0\n\n\t\t\tfor _, chks := range test.chks {\n\t\t\t\tfor _, chk := range chks {\n\t\t\t\t\tl := make([]byte, binary.MaxVarintLen32)\n\t\t\t\t\tsizeExp += binary.PutUvarint(l, uint64(len(chk.Chunk.Bytes()))) // The length field.\n\t\t\t\t\tsizeExp += chunks.ChunkEncodingSize\n\t\t\t\t\tsizeExp += len(chk.Chunk.Bytes()) // The data itself.\n\t\t\t\t\tsizeExp += crc32.Size // The 4 bytes of crc32\n\t\t\t\t}\n\t\t\t}\n\t\t\tsizeExp += test.expSegmentsCount * chunks.SegmentHeaderSize // The segment header bytes.\n\n\t\t\tfor i, f := range files {\n\t\t\t\tfi, err := f.Info()\n\t\t\t\trequire.NoError(t, err)\n\t\t\t\tsize := int(fi.Size())\n\t\t\t\t// Verify that the segment is the same or smaller than the expected size.\n\t\t\t\trequire.GreaterOrEqual(t, chunks.SegmentHeaderSize+test.expSegmentSizes[i], size, \"Segment:%v should NOT be bigger than:%v actual:%v\", i, chunks.SegmentHeaderSize+test.expSegmentSizes[i], size)\n\n\t\t\t\tsizeAct += size\n\t\t\t}\n\t\t\trequire.Equal(t, sizeExp, sizeAct)\n\n\t\t\t// Check the content of the chunks.\n\t\t\tr, err := chunks.NewDirReader(tempDir, nil)\n\t\t\trequire.NoError(t, err)\n\t\t\tdefer func() { require.NoError(t, r.Close()) }()\n\n\t\t\tfor _, chks := range test.chks {\n\t\t\t\tfor _, chkExp := range chks {\n\t\t\t\t\tchkAct, err := r.Chunk(chkExp)\n\t\t\t\t\trequire.NoError(t, err)\n\t\t\t\t\trequire.Equal(t, chkExp.Chunk.Bytes(), chkAct.Bytes())\n\t\t\t\t}\n\t\t\t}\n\t\t})\n\t}\n}", "title": "" }, { "docid": "053471de65b27e9e137d97f6ab40288f", "score": "0.5209054", "text": "func (p *ThreadSafeQueue) BatchPut(items []interface{}) error {\n\n\tfor _, item := range items {\n\t\tif err := p.Put(item); err != nil {\n\t\t\treturn err\n\t\t}\n\t}\n\n\treturn nil\n}", "title": "" }, { "docid": "ae50e809c4aedfaa2933350035ef46e9", "score": "0.520654", "text": "func TestPrepareWrite_OneReplica_Max(t *testing.T) {\n\tGenericTestPrepareWrite(t, 0, apis.MaxChunkSize, []bool{false})\n\tGenericTestPrepareWrite(t, 7, apis.MaxChunkSize-7, []bool{false})\n}", "title": "" }, { "docid": "9c156e7ea1d379df2d6b99bbbff22ba6", "score": "0.5206156", "text": "func (c *AWSStore) putChunk(ctx context.Context, userID string, chunk *Chunk) error {\n\tbody, err := chunk.reader()\n\tif err != nil {\n\t\treturn err\n\t}\n\n\terr = instrument.TimeRequestHistogram(ctx, \"S3.PutObject\", s3RequestDuration, func(_ context.Context) error {\n\t\tvar err error\n\t\t_, err = c.cfg.S3.PutObject(&s3.PutObjectInput{\n\t\t\tBody: body,\n\t\t\tBucket: aws.String(c.cfg.BucketName),\n\t\t\tKey: aws.String(chunkName(userID, chunk.ID)),\n\t\t})\n\t\treturn err\n\t})\n\tif err != nil {\n\t\treturn err\n\t}\n\n\tif c.cfg.ChunkCache != nil {\n\t\tif err = c.cfg.ChunkCache.StoreChunkData(ctx, userID, chunk); err != nil {\n\t\t\tlog.Warnf(\"Could not store %v in chunk cache: %v\", chunk.ID, err)\n\t\t}\n\t}\n\treturn nil\n}", "title": "" }, { "docid": "2966d004cfc2817e5b273f6fa093da33", "score": "0.5205183", "text": "func TestWriterWrite(t *testing.T) {\n\ttests := []struct {\n\t\tgiveChunks [][]byte\n\t\twantBody []byte\n\t}{\n\t\t{\n\t\t\tgiveChunks: [][]byte{\n\t\t\t\t{},\n\t\t\t\t{0x01},\n\t\t\t\t{0x01, 0x02},\n\t\t\t\t{0x01, 0x02, 0x03},\n\t\t\t},\n\t\t\twantBody: []byte{\n\t\t\t\t0x00, 0x00, 0x00, 0x00,\n\t\t\t\t0x00, 0x00, 0x00, 0x01, 0x01,\n\t\t\t\t0x00, 0x00, 0x00, 0x02, 0x01, 0x02,\n\t\t\t\t0x00, 0x00, 0x00, 0x03, 0x01, 0x02, 0x03,\n\t\t\t},\n\t\t},\n\t}\n\n\tfor _, tt := range tests {\n\t\tvar buff bytes.Buffer\n\t\tw := NewWriter(&buff)\n\t\tfor _, chunk := range tt.giveChunks {\n\t\t\tassert.NoError(t, w.Write(chunk))\n\t\t}\n\t\tassert.Equal(t, tt.wantBody, buff.Bytes())\n\t}\n}", "title": "" }, { "docid": "d679e23dd0dc03c11553fcdd2111a450", "score": "0.52042645", "text": "func writeBatchDynamo(dynamoSvc *dynamodb.DynamoDB, dynamodbTable string, items []*dynamodb.WriteRequest) error {\n\t_, err := dynamoSvc.BatchWriteItem(&dynamodb.BatchWriteItemInput{\n\t\tRequestItems: map[string][]*dynamodb.WriteRequest{\n\t\t\tdynamodbTable: items,\n\t\t},\n\t},\n\t)\n\titems = items[:0]\n\treturn err\n}", "title": "" }, { "docid": "66b115a680894dd224f49d41ae8498a2", "score": "0.5204174", "text": "func WriteShardStateBytes(db DatabaseWriter, epoch *big.Int, data []byte) error {\n\tif err := db.Put(shardStateKey(epoch), data); err != nil {\n\t\treturn errors.Wrapf(\n\t\t\terr, \"cannot write sharding state\",\n\t\t)\n\t}\n\tutils.Logger().Info().\n\t\tStr(\"epoch\", epoch.String()).\n\t\tInt(\"size\", len(data)).Msg(\"wrote sharding state\")\n\treturn nil\n}", "title": "" }, { "docid": "f5db7e3ab9fb4b46b03991de92971f0c", "score": "0.51981574", "text": "func TestTxnPipelinerManyWrites(t *testing.T) {\n\tdefer leaktest.AfterTest(t)()\n\tdefer log.Scope(t).Close(t)\n\tctx := context.Background()\n\ttp, mockSender := makeMockTxnPipeliner()\n\n\t// Disable write_pipelining_max_outstanding_size,\n\t// write_pipelining_max_batch_size, and max_intents_bytes limits.\n\tpipelinedWritesMaxInFlightSize.Override(&tp.st.SV, math.MaxInt64)\n\tpipelinedWritesMaxBatchSize.Override(&tp.st.SV, 0)\n\ttrackedWritesMaxSize.Override(&tp.st.SV, math.MaxInt64)\n\n\tconst writes = 2048\n\tkeyBuf := roachpb.Key(strings.Repeat(\"a\", writes+1))\n\tmakeKey := func(i int) roachpb.Key { return keyBuf[:i+1] }\n\tmakeSeq := func(i int) enginepb.TxnSeq { return enginepb.TxnSeq(i) + 1 }\n\n\ttxn := makeTxnProto()\n\tvar ba roachpb.BatchRequest\n\tba.Header = roachpb.Header{Txn: &txn}\n\tfor i := 0; i < writes; i++ {\n\t\tputArgs := roachpb.PutRequest{RequestHeader: roachpb.RequestHeader{Key: makeKey(i)}}\n\t\tputArgs.Sequence = makeSeq(i)\n\t\tba.Add(&putArgs)\n\t}\n\n\tmockSender.MockSend(func(ba roachpb.BatchRequest) (*roachpb.BatchResponse, *roachpb.Error) {\n\t\trequire.Len(t, ba.Requests, writes)\n\t\trequire.True(t, ba.AsyncConsensus)\n\t\tfor i := 0; i < writes; i++ {\n\t\t\trequire.IsType(t, &roachpb.PutRequest{}, ba.Requests[i].GetInner())\n\t\t}\n\n\t\tbr := ba.CreateReply()\n\t\tbr.Txn = ba.Txn\n\t\treturn br, nil\n\t})\n\n\tbr, pErr := tp.SendLocked(ctx, ba)\n\trequire.Nil(t, pErr)\n\trequire.NotNil(t, br)\n\trequire.Equal(t, writes, tp.ifWrites.len())\n\n\t// Query every other write.\n\tba.Requests = nil\n\tfor i := 0; i < writes; i++ {\n\t\tif i%2 == 0 {\n\t\t\tkey := makeKey(i)\n\t\t\tba.Add(&roachpb.GetRequest{RequestHeader: roachpb.RequestHeader{Key: key}})\n\t\t}\n\t}\n\n\tmockSender.MockSend(func(ba roachpb.BatchRequest) (*roachpb.BatchResponse, *roachpb.Error) {\n\t\trequire.Len(t, ba.Requests, writes)\n\t\trequire.False(t, ba.AsyncConsensus)\n\t\tfor i := 0; i < writes; i++ {\n\t\t\tif i%2 == 0 {\n\t\t\t\tkey := makeKey(i)\n\t\t\t\trequire.IsType(t, &roachpb.QueryIntentRequest{}, ba.Requests[i].GetInner())\n\t\t\t\trequire.IsType(t, &roachpb.GetRequest{}, ba.Requests[i+1].GetInner())\n\n\t\t\t\tqiReq := ba.Requests[i].GetQueryIntent()\n\t\t\t\trequire.Equal(t, key, qiReq.Key)\n\t\t\t\trequire.Equal(t, txn.ID, qiReq.Txn.ID)\n\t\t\t\trequire.Equal(t, makeSeq(i), qiReq.Txn.Sequence)\n\n\t\t\t\tgetReq := ba.Requests[i+1].GetGet()\n\t\t\t\trequire.Equal(t, key, getReq.Key)\n\t\t\t}\n\t\t}\n\n\t\tbr = ba.CreateReply()\n\t\tbr.Txn = ba.Txn\n\t\tfor i := 0; i < writes; i++ {\n\t\t\tif i%2 == 0 {\n\t\t\t\tbr.Responses[i].GetQueryIntent().FoundIntent = true\n\t\t\t}\n\t\t}\n\t\treturn br, nil\n\t})\n\n\tbr, pErr = tp.SendLocked(ctx, ba)\n\trequire.Nil(t, pErr)\n\trequire.NotNil(t, br)\n\trequire.Equal(t, writes/2, tp.ifWrites.len())\n\n\t// Make sure the correct writes are still in-flight.\n\texpIdx := 1\n\ttp.ifWrites.ascend(func(w *inFlightWrite) {\n\t\trequire.Equal(t, makeKey(expIdx), w.Key)\n\t\trequire.Equal(t, makeSeq(expIdx), w.Sequence)\n\t\texpIdx += 2\n\t})\n}", "title": "" }, { "docid": "7e4d3dc1ad50df9ed0bc5b334a8cda0e", "score": "0.5188884", "text": "func (w *Writer) Write(p []byte) (int, error) {\n\tvar (\n\t\tpartitionKeySize = len(*w.partitionKey)\n\n\t\t// The maximum size of each chunk of data for each record.\n\t\tchunkSize = w.recordSizeLimit - partitionKeySize\n\t)\n\n\tchunks := chunk(chunkSize, p)\n\n\tvar records []*kinesis.PutRecordsRequestEntry\n\tfor _, d := range chunks {\n\t\trecords = append(records, &kinesis.PutRecordsRequestEntry{\n\t\t\tPartitionKey: w.partitionKey,\n\t\t\tData: d,\n\t\t})\n\t}\n\n\tvar input *kinesis.PutRecordsInput\n\tfor i, r := range records {\n\t\tif math.Mod(float64(i), float64(w.putRecordsLimit)) == 0 {\n\t\t\tif input != nil {\n\t\t\t\tif _, err := w.client.PutRecords(input); err != nil {\n\t\t\t\t\treturn len(p), err\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tinput = &kinesis.PutRecordsInput{\n\t\t\t\tStreamName: w.streamName,\n\t\t\t}\n\t\t}\n\n\t\tinput.Records = append(input.Records, r)\n\n\t}\n\n\tif input != nil {\n\t\tif _, err := w.client.PutRecords(input); err != nil {\n\t\t\treturn len(p), err\n\t\t}\n\t}\n\n\treturn len(p), nil\n}", "title": "" }, { "docid": "3d0fcf01f18c62c5d636fc2ff1eee7da", "score": "0.5180184", "text": "func (array FDBArray) writeAlignedBlocks(write []byte, firstBlock uint64, startBlock uint64, endBlock uint64, shift uint64, readVersion int64) error {\n\ttotalBlocksToWrite := (endBlock - startBlock)\n\tcompleteGroups := (totalBlocksToWrite / array.blocksPerTx)\n\tlastGroupSize := totalBlocksToWrite % array.blocksPerTx\n\tincompleteLastGroup := lastGroupSize != 0\n\tblockSize := uint64(array.blockSize)\n\n\tvar totalTransactions = completeGroups\n\tif incompleteLastGroup {\n\t\ttotalTransactions++\n\t}\n\n\tvar maybeError error\n\n\tvar once sync.Once\n\n\tvar wg sync.WaitGroup\n\n\twg.Add(int(totalTransactions))\n\n\tfor groupPosition := startBlock; groupPosition < startBlock+completeGroups*array.blocksPerTx; groupPosition += array.blocksPerTx {\n\n\t\tgo func(currentGroupPosition uint64) {\n\t\t\t_, err := readversioncache.TransactConflicting(array.database, func(tx fdb.Transaction) (ret interface{}, err error) {\n\t\t\t\ttx.SetReadVersion(readVersion)\n\t\t\t\ttx.AddReadConflictKey(array.ownershipTokenKey)\n\t\t\t\tfor i := currentGroupPosition; i < currentGroupPosition+array.blocksPerTx; i++ {\n\n\t\t\t\t\tkey := array.data.Pack(tuple.Tuple{i})\n\t\t\t\t\twriteBlock := i - firstBlock\n\t\t\t\t\tposition := (writeBlock-1)*blockSize + shift\n\t\t\t\t\ttx.Set(key, write[position:position+blockSize])\n\t\t\t\t}\n\t\t\t\treturn\n\t\t\t}, func(tx fdb.Transaction) {\n\t\t\t\tcomittedVersion, _ := tx.GetCommittedVersion()\n\t\t\t\tarray.versionCache.SetReadVersion(comittedVersion)\n\t\t\t})\n\t\t\tif err != nil {\n\t\t\t\tonce.Do(func() {\n\t\t\t\t\tmaybeError = err\n\t\t\t\t})\n\t\t\t}\n\t\t\twg.Done()\n\t\t\treturn\n\t\t}(groupPosition)\n\t}\n\n\tif incompleteLastGroup {\n\n\t\tgo func() {\n\t\t\t_, err := readversioncache.TransactConflicting(array.database, func(tx fdb.Transaction) (ret interface{}, err error) {\n\t\t\t\ttx.SetReadVersion(readVersion)\n\t\t\t\ttx.AddReadConflictKey(array.ownershipTokenKey)\n\n\t\t\t\tfor i := startBlock + completeGroups*array.blocksPerTx; i < endBlock; i++ {\n\t\t\t\t\tkey := array.data.Pack(tuple.Tuple{i})\n\t\t\t\t\twriteBlock := i - firstBlock\n\t\t\t\t\tposition := (writeBlock-1)*blockSize + shift\n\t\t\t\t\ttx.Set(key, write[position:position+blockSize])\n\t\t\t\t}\n\n\t\t\t\treturn\n\t\t\t}, func(tx fdb.Transaction) {\n\t\t\t\tcomittedVersion, _ := tx.GetCommittedVersion()\n\t\t\t\tarray.versionCache.SetReadVersion(comittedVersion)\n\t\t\t})\n\t\t\tmaybeError = err\n\t\t\twg.Done()\n\t\t\treturn\n\t\t}()\n\t}\n\n\twg.Wait()\n\n\treturn maybeError\n}", "title": "" }, { "docid": "2d11eedfb2112c4fce4c39e8d3baee71", "score": "0.5177509", "text": "func copyChunks(dst io.Writer, src io.Reader, chunkSize int64) (int64, error) {\n\tvar written int64\n\tfor {\n\t\tw, err := io.CopyN(dst, src, chunkSize)\n\t\twritten += w\n\t\tif errors.Is(err, io.EOF) {\n\t\t\treturn written, nil\n\t\t}\n\t\tif err != nil {\n\t\t\treturn written, err\n\t\t}\n\t}\n}", "title": "" }, { "docid": "ce331098c7f280e318b3f7a017cac93a", "score": "0.517647", "text": "func (s *Redis) WriteMultiple(i []store.Item) error {\n\treturn errors.New(\"Implementation pending\")\n}", "title": "" }, { "docid": "c7a990ba77d37fd2e902ce5e1e4fcdd3", "score": "0.51557815", "text": "func (m *SyncMap) Flush() int {\n\tsize := 0\n\tfor _, shard := range m.shards {\n\t\tshard.Lock()\n\t\tsize += len(shard.items)\n\t\tshard.items = make(map[string]interface{})\n\t\tshard.Unlock()\n\t}\n\treturn size\n}", "title": "" }, { "docid": "c49f37ae45d6b1d68d831bdfc1c9e01a", "score": "0.51557416", "text": "func (clt *Client) putRecordBatch(records []*firehose.Record) {\n\treq, _ := clt.srv.awsSvc.PutRecordBatchRequest(&firehose.PutRecordBatchInput{\n\t\tDeliveryStreamName: aws.String(clt.srv.config.StreamName),\n\t\tRecords: records,\n\t})\n\n\tctx, cancel := context.WithTimeout(context.Background(), connectTimeout)\n\tdefer cancel()\n\n\treq.SetContext(ctx)\n\n\terr := req.Send()\n\tif err != nil {\n\t\tif req.IsErrorThrottle() {\n\t\t\tlib.Debugf(\"Firehose client %d: ERROR IsErrorThrottle: %s\", clt.ID, err)\n\t\t} else {\n\t\t\tlib.Debugf(\"Firehose client %d: ERROR PutRecordBatch->Send: %s\", clt.ID, err)\n\t\t}\n\t\tclt.srv.failure()\n\t\treturn\n\t}\n\n\tlib.Debugf(\"Firehose client %d: sent batch with %d records, %d lines, %d bytes\", clt.ID, len(records), clt.count, clt.batchSize)\n}", "title": "" }, { "docid": "33c8cfe8fa8fdc02e38296a5a16ba393", "score": "0.5154636", "text": "func sendBatch(svc *dynamodb.DynamoDB, input *dynamodb.BatchWriteItemInput) {\n\n\tresult, err := svc.BatchWriteItem(input)\n\tif err != nil {\n\t\tif aerr, ok := err.(awserr.Error); ok {\n\t\t\tswitch aerr.Code() {\n\t\t\tcase dynamodb.ErrCodeProvisionedThroughputExceededException:\n\t\t\t\tfmt.Println(dynamodb.ErrCodeProvisionedThroughputExceededException, aerr.Error())\n\t\t\tcase dynamodb.ErrCodeResourceNotFoundException:\n\t\t\t\tfmt.Println(dynamodb.ErrCodeResourceNotFoundException, aerr.Error())\n\t\t\tcase dynamodb.ErrCodeItemCollectionSizeLimitExceededException:\n\t\t\t\tfmt.Println(dynamodb.ErrCodeItemCollectionSizeLimitExceededException, aerr.Error())\n\t\t\tcase dynamodb.ErrCodeRequestLimitExceeded:\n\t\t\t\tfmt.Println(dynamodb.ErrCodeRequestLimitExceeded, aerr.Error())\n\t\t\tcase dynamodb.ErrCodeInternalServerError:\n\t\t\t\tfmt.Println(dynamodb.ErrCodeInternalServerError, aerr.Error())\n\t\t\tdefault:\n\t\t\t\tfmt.Println(aerr.Error())\n\t\t\t}\n\t\t} else {\n\t\t\t// Print the error, cast err to awserr.Error to get the Code and\n\t\t\t// Message from an error.\n\t\t\tfmt.Println(err.Error())\n\t\t}\n\t\treturn\n\t}\n\n\tfmt.Println(result)\n}", "title": "" }, { "docid": "74a71c55d258eded17ef83cf2eef34da", "score": "0.515134", "text": "func (s *kvstore) BatchDelete(k []item) error {\n\two := gorocksdb.NewDefaultWriteOptions()\n\twb := gorocksdb.NewWriteBatch()\n\n\ts.mu.Lock()\n\tdefer s.mu.Unlock()\n\n\tfor _, _k := range k {\n\t\tbyteK := toBytes(_k)\n\t\twb.Delete(byteK)\n\t}\n\terr := s.db.Write(wo, wb)\n\treturn err\n}", "title": "" }, { "docid": "7cee229272fcae296caeec387fa959d4", "score": "0.515013", "text": "func (shard *TableShard) writeBatchRecords(columnDeletions []bool,\n\tupsertBatch *common.UpsertBatch, batchID int32, records []recordInfo, forUpdate bool) error {\n\tvar batch *LiveBatch\n\tif forUpdate {\n\t\t// We need to lock the batch for update to achieve row level consistency.\n\t\tbatch = shard.LiveStore.GetBatchForWrite(batchID)\n\t\tdefer batch.Unlock()\n\t} else {\n\t\t// Make sure all columns are created.\n\t\tbatch = shard.LiveStore.GetBatchForWrite(batchID)\n\t\tfor i := 0; i < upsertBatch.NumColumns; i++ {\n\t\t\tcolumnID, _ := upsertBatch.GetColumnID(i)\n\t\t\tif columnDeletions[columnID] {\n\t\t\t\tcontinue\n\t\t\t}\n\t\t\tbatch.GetOrCreateVectorParty(columnID, true)\n\t\t}\n\t\tbatch.Unlock()\n\n\t\tbatch.RLock()\n\t\tdefer batch.RUnlock()\n\t}\n\n\tif batch.MaxArrivalTime < upsertBatch.ArrivalTime {\n\t\tbatch.MaxArrivalTime = upsertBatch.ArrivalTime\n\t}\n\n\t// Instead of traversing row by row, we instead do column by column to avoid making checks on each row.\n\tfor col := 0; col < upsertBatch.NumColumns; col++ {\n\t\tcolumnID, err := upsertBatch.GetColumnID(col)\n\t\tif err != nil {\n\t\t\treturn utils.StackError(err, \"Failed to get column id for col %d\", col)\n\t\t}\n\t\tif columnDeletions[columnID] {\n\t\t\tcontinue\n\t\t}\n\n\t\tcolumnUpdateMode := upsertBatch.GetColumnUpdateMode(col)\n\t\tcolumnMode := upsertBatch.GetColumMode(col)\n\n\t\t// we will skip processing this column if\n\t\t// 1. columnMode is AllValuesDefault\n\t\t// 2. columnUpdateMode is UpdateOverwriteNotNull\n\t\tif columnMode == common.AllValuesDefault && columnUpdateMode == common.UpdateOverwriteNotNull {\n\t\t\tcontinue\n\t\t}\n\n\t\tif col >= upsertBatch.GetColumnLen() {\n\t\t\treturn utils.StackError(nil, \"Column index %d out of range %d\", col, upsertBatch.GetColumnLen())\n\t\t}\n\n\t\tvectorParty := batch.GetOrCreateVectorParty(columnID, true)\n\t\tdataType, _ := upsertBatch.GetColumnType(col)\n\t\tcmpFunc := common.GetCompareFunc(dataType)\n\n\t\t// check whether the update mode is valid based on data type.\n\t\tforceWrite := false\n\t\tif forUpdate {\n\t\t\tswitch columnUpdateMode {\n\t\t\tcase common.UpdateForceOverwrite:\n\t\t\t\t// always update\n\t\t\t\tforceWrite = true\n\t\t\tcase common.UpdateWithAddition:\n\t\t\t\tfallthrough\n\t\t\tcase common.UpdateWithMin:\n\t\t\t\tfallthrough\n\t\t\tcase common.UpdateWithMax:\n\t\t\t\tif !common.IsNumeric(dataType) {\n\t\t\t\t\treturn utils.StackError(nil, \"Unsupported data type %x for column update mode %x\", dataType, columnUpdateMode)\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\tfor _, recordInfo := range records {\n\t\t\tif recordInfo.row >= upsertBatch.NumRows {\n\t\t\t\treturn utils.StackError(nil, \"Row index %d out of range %d\", recordInfo.row, upsertBatch.NumRows)\n\t\t\t}\n\n\t\t\t// We explicitly treat different columns by checking whether they are\n\t\t\t// 1. Bool type\n\t\t\t// 2. Go types\n\t\t\t// 3. Other types\n\t\t\t// Via doing this, we save lots of stack space to storing all related fields for different cases.\n\t\t\tif dataType == common.Bool {\n\t\t\t\tval, valid, _ := upsertBatch.GetBool(recordInfo.row, col)\n\t\t\t\tif !valid && !forceWrite {\n\t\t\t\t\tcontinue\n\t\t\t\t}\n\t\t\t\tvectorParty.SetBool(recordInfo.index, val, valid)\n\t\t\t} else if common.IsGoType(dataType) {\n\t\t\t\tval := upsertBatch.ReadGoValue(recordInfo.row, col)\n\t\t\t\tvalid := val != nil\n\t\t\t\tif !valid && !forceWrite {\n\t\t\t\t\tcontinue\n\t\t\t\t}\n\t\t\t\tvectorParty.SetGoValue(recordInfo.index, val, valid)\n\t\t\t} else {\n\t\t\t\tval, valid, _ := upsertBatch.GetValue(recordInfo.row, col)\n\t\t\t\tif !valid && !forceWrite {\n\t\t\t\t\tcontinue\n\t\t\t\t}\n\n\t\t\t\t// only read oldValue when mode is one of add, min, max.\n\t\t\t\tif columnUpdateMode >= common.UpdateWithAddition && columnUpdateMode <= common.UpdateWithMax {\n\t\t\t\t\toldVal, oldValid := vectorParty.GetValue(recordInfo.index)\n\t\t\t\t\t// Only need to do calculation when old value is valid, otherwise we can directly\n\t\t\t\t\t// set what's in upsert batch.\n\t\t\t\t\tif oldValid {\n\t\t\t\t\t\tswitch columnUpdateMode {\n\t\t\t\t\t\tcase common.UpdateWithAddition:\n\t\t\t\t\t\t\tcommon.AdditionUpdate(oldVal, val, dataType)\n\t\t\t\t\t\tcase common.UpdateWithMin:\n\t\t\t\t\t\t\tcommon.MinMaxUpdate(oldVal, val, dataType, cmpFunc, 1)\n\t\t\t\t\t\tcase common.UpdateWithMax:\n\t\t\t\t\t\t\tcommon.MinMaxUpdate(oldVal, val, dataType, cmpFunc, -1)\n\t\t\t\t\t\t}\n\t\t\t\t\t\tcontinue\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\t// if the value is not updated, set the value directly using value from upsert batch.\n\t\t\t\tvectorParty.SetValue(recordInfo.index, val, valid)\n\t\t\t}\n\t\t}\n\t}\n\treturn nil\n}", "title": "" }, { "docid": "b00ebef8e34a59011f3fcb39375505b2", "score": "0.51493716", "text": "func (s *Shard) writeSeries(overwrite bool, data []byte) error {\n\tid, timestamp, values, err := unmarshalPoint(data)\n\tif err != nil {\n\t\treturn err\n\t}\n\n\t// TODO: make this work\n\tfmt.Println(\"writeSeries: \", id, timestamp, values)\n\treturn s.store.Update(func(tx *bolt.Tx) error {\n\t\treturn nil // TODO\n\t})\n}", "title": "" }, { "docid": "a4a4f84a0291e859ae5d572efafea2c1", "score": "0.5138297", "text": "func (c *AWSStore) calculateDynamoWrites(userID string, chunks []Chunk) (map[string][]*dynamodb.WriteRequest, error) {\n\twriteReqs := map[string][]*dynamodb.WriteRequest{}\n\tfor _, chunk := range chunks {\n\t\tmetricName, ok := chunk.Metric[model.MetricNameLabel]\n\t\tif !ok {\n\t\t\treturn nil, fmt.Errorf(\"no MetricNameLabel for chunk\")\n\t\t}\n\n\t\tentries := 0\n\t\tfor _, bucket := range c.bigBuckets(chunk.From, chunk.Through) {\n\t\t\thashValue := hashValue(userID, bucket.bucket, metricName)\n\t\t\tfor label, value := range chunk.Metric {\n\t\t\t\tif label == model.MetricNameLabel {\n\t\t\t\t\tcontinue\n\t\t\t\t}\n\n\t\t\t\tentries++\n\t\t\t\trangeValue, err := rangeValue(label, value, chunk.ID)\n\t\t\t\tif err != nil {\n\t\t\t\t\treturn nil, err\n\t\t\t\t}\n\t\t\t\twriteReqs[bucket.tableName] = append(writeReqs[bucket.tableName], &dynamodb.WriteRequest{\n\t\t\t\t\tPutRequest: &dynamodb.PutRequest{\n\t\t\t\t\t\tItem: map[string]*dynamodb.AttributeValue{\n\t\t\t\t\t\t\thashKey: {S: aws.String(hashValue)},\n\t\t\t\t\t\t\trangeKey: {B: rangeValue},\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\tindexEntriesPerChunk.Observe(float64(entries))\n\t}\n\treturn writeReqs, nil\n}", "title": "" }, { "docid": "a12c63fade44acdae9fe88d18bf22181", "score": "0.5138133", "text": "func (w *Writer) WriteBulk(bulk []byte) {\n\tw.b = append(w.b, '$')\n\tw.b = append(w.b, strconv.FormatInt(int64(len(bulk)), 10)...)\n\tw.b = append(w.b, '\\r', '\\n')\n\tw.b = append(w.b, bulk...)\n\tw.b = append(w.b, '\\r', '\\n')\n}", "title": "" }, { "docid": "bb67454f76376d00bb5fb958ce314d7c", "score": "0.5127495", "text": "func NewChunkedWriter(w io.Writer) io.WriteCloser {}", "title": "" }, { "docid": "092a0fdd57e04343f9eac7272148ebd7", "score": "0.51184165", "text": "func (ms MemoryEventStore) WriteBatch(ns string, streamId string,\n\tcMode es.ConcurrencyMode, expected int64, events []es.EventEnvelope) (int64, error) {\n\n\tms.mutex.Lock()\n\tdefer ms.mutex.Unlock()\n\n\t// The memory based event store creates the namespace when it\n\t// hasn't been seen before. This might not be possible in all\n\t// implementations, and might make sense to have an explicit\n\t// create namespace api on the event store interface\n\tnspace, ok := ms.nss[ns]\n\tif !ok {\n\t\tnspace = map[string][]es.EventEnvelope{}\n\t\tms.nss[ns] = nspace\n\t}\n\n\t// I'm assuming that the pass by value here does a deep copy of the event so\n\t// that the event store is storing a copy that cannot be mutated later\n\tinsertEvent := func(e es.EventEnvelope) (int64, error) {\n\t\tif strm, ok := nspace[streamId]; ok {\n\t\t\tswitch cMode {\n\t\t\tcase eventStore.ANY:\n\t\t\tcase eventStore.EXISTING_STREAM:\n\t\t\t\te.SeqNum = int64(len(strm))\n\t\t\t\tnspace[streamId] = append(strm, e)\n\t\t\t\treturn e.SeqNum, nil\n\t\t\tcase eventStore.EXPECTING_SEQ_NUM:\n\t\t\t\tif len(strm) == 0 {\n\t\t\t\t\treturn 0, esErrors.NewSeqExpectedErr(streamId, expected, -1)\n\t\t\t\t}\n\t\t\t\tlast := strm[len(strm)-1].SeqNum\n\t\t\t\tif last != expected {\n\t\t\t\t\treturn 0, esErrors.NewSeqExpectedErr(streamId, expected, last)\n\t\t\t\t}\n\t\t\t\te.SeqNum = last + 1\n\t\t\t\tnspace[streamId] = append(strm, e)\n\t\t\t\treturn e.SeqNum, nil\n\t\t\tcase eventStore.NEW_STREAM:\n\t\t\t\treturn 0, esErrors.NewStreamExists(streamId)\n\t\t\t}\n\t\t} else {\n\t\t\tswitch cMode {\n\t\t\tcase eventStore.ANY:\n\t\t\tcase eventStore.NEW_STREAM:\n\t\t\t\te.SeqNum = int64(len(strm))\n\t\t\t\tnspace[streamId] = append(strm, e)\n\t\t\t\treturn e.SeqNum, nil\n\t\t\tdefault:\n\t\t\t\treturn 0, esErrors.NewStreamDoesNotExist(streamId)\n\t\t\t}\n\t\t}\n\t\tpanic(\"unreachable code reached\")\n\t}\n\n\tvar lastId int64\n\tfor i, e := range events {\n\t\tlast, err := insertEvent(e)\n\t\tif err != nil {\n\t\t\t// remove elements from the stream that were part of the batch and written (stored\n\t\t\t// in the map) before this error\n\t\t\ts := nspace[streamId]\n\t\t\tl := len(s)\n\t\t\tnspace[streamId] = s[:l-i]\n\n\t\t\treturn 0, err\n\t\t}\n\t\tlastId = last\n\t}\n\treturn lastId, nil\n}", "title": "" }, { "docid": "01dd8ea0ab3f6b7db8335b6274ce6130", "score": "0.51181746", "text": "func (db *RocksDB) NewWriteBatch() WriteBatch {\n\tbatch := gorocksdb.NewWriteBatch()\n\treturn &RocksDBWriteBatchWrapper{\n\t\tbatch: batch,\n\t\tdb: db,\n\t\thistories: make(map[string][]string),\n\t}\n}", "title": "" }, { "docid": "69d3a5b09134e650d0a9bfc8ec33af53", "score": "0.511767", "text": "func (this *CipherWriter) encryptWriteChunk() error {\n // write nonce if it hasn't already been written\n if this.written == 0 {\n written, err := this.Writer.Write(this.Nonce[:])\n if err != nil { return err }\n this.written += int64(written)\n }\n // chunk\n cipherChunk := secretbox.Seal(nil, this.chunk, this.Nonce, this.Key)\n written, err := this.Writer.Write(cipherChunk)\n this.written += int64(written)\n return err\n}", "title": "" }, { "docid": "ced218a27fb78aa843cbbeb1836badee", "score": "0.5115925", "text": "func TestPrepareWrite_OneReplica_OverMax(t *testing.T) {\n\tGenericTestPrepareWrite(t, 0, apis.MaxChunkSize+1, []bool{false})\n\tGenericTestPrepareWrite(t, 8, apis.MaxChunkSize-7, []bool{false})\n}", "title": "" }, { "docid": "df3546c2ecfdc2b004c8237ee3d7070a", "score": "0.51066154", "text": "func (mCache *MemoryCache) _sendToShard(mes *Request) {\n\n\tkeyShard := mes.Key.ShardID(mCache.maxShards)\n\n\tmCache.RLock()\n\tmCache.Shards[keyShard].Act(mes)\n\tmCache.RUnlock()\n\n}", "title": "" }, { "docid": "68bf995819df6ee7f94839501e5005d5", "score": "0.5104043", "text": "func (c *Chunk) flushChunk(i int) (e error) {\n\tif _, ok := c.raw[i]; !ok {\n\t\treturn\n\t}\n\te = c.s.ToFile(c.fileName(i), c.raw[i])\n\treturn\n}", "title": "" }, { "docid": "c8cc14a8117689313c026850a9e0b0d4", "score": "0.5094311", "text": "func (ring *Ring) genBatchOrShard() {\n\ttaskCfg := ring.service.taskCfg\n\tvar parseErrs int\n\t// Respect batchSize boundary\n\tendOff := ((ring.ringGroundOff >> ring.batchSizeShift) + 1) << ring.batchSizeShift\n\tif endOff > ring.ringFilledOffset {\n\t\tendOff = ring.ringFilledOffset\n\t}\n\tmsgCnt := endOff - ring.ringGroundOff\n\tif atomic.LoadUint32(&ring.service.state) != util.StateRunning {\n\t\tutil.Logger.Info(fmt.Sprintf(\"Ring.genBatchOrShard discarded a batch for topic %v patittion %d, offset [%d,%d), messages %d\",\n\t\t\ttaskCfg.Topic, ring.partition, ring.ringGroundOff, endOff, msgCnt),\n\t\t\tzap.String(\"task\", taskCfg.Name))\n\t\tfor i := ring.ringGroundOff; i < endOff; i++ {\n\t\t\tmsgRow := &ring.ringBuf[i&(ring.ringCapMask)]\n\t\t\tmsgRow.Msg = nil\n\t\t\tmsgRow.Row = nil\n\t\t\tmsgRow.Shard = -1\n\t\t}\n\t} else if ring.service.sharder != nil {\n\t\tring.service.sharder.PutElems(ring.partition, ring.ringBuf, ring.ringGroundOff, endOff, ring.ringCapMask)\n\t} else {\n\t\tbatch := model.NewBatch()\n\t\tfor i := ring.ringGroundOff; i < endOff; i++ {\n\t\t\tmsgRow := &ring.ringBuf[i&(ring.ringCapMask)]\n\t\t\tif msgRow.Row != &model.FakedRow {\n\t\t\t\t*batch.Rows = append(*batch.Rows, msgRow.Row)\n\t\t\t} else {\n\t\t\t\tparseErrs++\n\t\t\t}\n\t\t\tmsgRow.Msg = nil\n\t\t\tmsgRow.Row = nil\n\t\t\tmsgRow.Shard = -1\n\t\t}\n\t\tbatch.RealSize = len(*batch.Rows)\n\n\t\tif batch.RealSize > 0 {\n\t\t\tutil.Logger.Info(fmt.Sprintf(\"created a batch for topic %v patittion %d, offset [%d,%d), messages %d, parse errors: %d\",\n\t\t\t\ttaskCfg.Topic, ring.partition, ring.ringGroundOff, endOff, batch.RealSize, parseErrs),\n\t\t\t\tzap.String(\"task\", taskCfg.Name))\n\n\t\t\tbatch.BatchIdx = ring.ringGroundOff >> ring.batchSizeShift\n\t\t\tring.batchSys.CreateBatchGroupSingle(batch, ring.partition, endOff-1)\n\t\t\tring.service.Flush(batch)\n\t\t\tstatistics.RingNormalBatchsTotal.WithLabelValues(taskCfg.Name).Inc()\n\t\t}\n\t}\n\tstatistics.RingMsgs.WithLabelValues(taskCfg.Name).Sub(float64(msgCnt))\n\tstatistics.ParsedRingMsgs.WithLabelValues(taskCfg.Name).Sub(float64(msgCnt))\n\tring.ringGroundOff = endOff\n\t//util.Logger.Debug(fmt.Sprintf(\"genBatchOrShard changed ring %p ringGroundOff to %d\", ring, ring.ringGroundOff))\n\tif ring.ringFilledOffset < ring.ringGroundOff {\n\t\tring.ringFilledOffset = ring.ringGroundOff\n\t}\n\tring.available.Broadcast()\n}", "title": "" }, { "docid": "c2c2a29d19563d4fda8d1b07918d022e", "score": "0.50910896", "text": "func (e *Manager) WriteIndex(ctx context.Context, dataShards map[blob.ID]blob.Bytes) ([]blob.Metadata, error) {\n\twritten := map[blob.ID]blob.Metadata{}\n\twrittenForEpoch := -1\n\n\tfor {\n\t\te.log.Debugf(\"refreshAttemptLocked\")\n\n\t\tp, err := e.getParameters()\n\t\tif err != nil {\n\t\t\treturn nil, err\n\t\t}\n\n\t\t// make sure we have at least 75% of remaining time\n\t\t//nolint:gomnd\n\t\tcs, err := e.committedState(ctx, 3*p.EpochRefreshFrequency/4)\n\t\tif err != nil {\n\t\t\treturn nil, errors.Wrap(err, \"error getting committed state\")\n\t\t}\n\n\t\tif cs.WriteEpoch != writtenForEpoch {\n\t\t\tif err = e.deletePartiallyWrittenShards(ctx, written); err != nil {\n\t\t\t\treturn nil, errors.Wrap(err, \"unable to delete partially written shard\")\n\t\t\t}\n\n\t\t\twrittenForEpoch = cs.WriteEpoch\n\t\t\twritten = map[blob.ID]blob.Metadata{}\n\t\t}\n\n\t\terr = e.writeIndexShards(ctx, dataShards, written, cs)\n\t\tif errors.Is(err, errWriteIndexTryAgain) {\n\t\t\tcontinue\n\t\t}\n\n\t\tif err != nil {\n\t\t\te.log.Debugw(\"index-write-error\", \"error\", err)\n\t\t\treturn nil, err\n\t\t}\n\n\t\te.Invalidate()\n\n\t\tbreak\n\t}\n\n\tcs, err := e.committedState(ctx, 0)\n\tif err != nil {\n\t\treturn nil, errors.Wrap(err, \"error getting committed state\")\n\t}\n\n\tif cs.WriteEpoch >= writtenForEpoch+2 {\n\t\te.log.Debugw(\"index-write-extremely-slow\")\n\n\t\tif err = e.deletePartiallyWrittenShards(ctx, written); err != nil {\n\t\t\te.log.Debugw(\"index-write-extremely-slow-cleanup-failed\", \"error\", err)\n\t\t}\n\n\t\treturn nil, ErrVerySlowIndexWrite\n\t}\n\n\tvar results []blob.Metadata\n\n\tfor _, v := range written {\n\t\tresults = append(results, v)\n\t}\n\n\te.log.Debugw(\"index-write-success\", \"results\", results)\n\n\treturn results, nil\n}", "title": "" }, { "docid": "8411731819dd9a15f3f1502152d42889", "score": "0.508086", "text": "func writeManyInstances(instances []*Instance, instanceWasActuallyFound bool, updateLastSeen bool) error {\n\twriteInstances := [](*Instance){}\n\tfor _, instance := range instances {\n\t\tif InstanceIsForgotten(&instance.Key) && !instance.IsSeed() {\n\t\t\tcontinue\n\t\t}\n\t\twriteInstances = append(writeInstances, instance)\n\t}\n\tif len(writeInstances) == 0 {\n\t\treturn nil // nothing to write\n\t}\n\tsql, args, err := mkInsertOdkuForInstances(writeInstances, instanceWasActuallyFound, updateLastSeen)\n\tif err != nil {\n\t\treturn err\n\t}\n\tif _, err := db.ExecVTOrc(sql, args...); err != nil {\n\t\treturn err\n\t}\n\treturn nil\n}", "title": "" }, { "docid": "9da6e40ecfb4cdd4e1c35378ef6e384a", "score": "0.50774056", "text": "func (s *Storage) Shard(ctx context.Context, fileSets []string, shardFunc ShardFunc) error {\n\tfileSets = applyPrefixes(fileSets)\n\treturn s.merge(ctx, fileSets, shardMergeFunc(s.shardThreshold, shardFunc))\n}", "title": "" }, { "docid": "0e217ab5e40a5a973a117666b1ec2a53", "score": "0.5072708", "text": "func GenericTestPrepareWrite(t *testing.T, offset uint32, length uint32, replicaFails []bool) {\n\tcache := &rpc.MockCache{\n\t\tChunkservers: map[apis.ServerAddress]apis.Chunkserver{},\n\t}\n\tvar allMocks []*mock.Mock\n\n\tchunk := apis.ChunkNum(rand.Uint64())\n\tdata := make([]byte, length)\n\tfor i := 0; i < int(length); i++ {\n\t\tdata[i] = \"fake\"[i%4]\n\t}\n\n\texpectedHash := apis.CalculateCommitHash(offset, data)\n\n\t// ** prepare mocked etcd responses and chunkservers **\n\n\texpectSuccess := true\n\tvar replicaAddresses []apis.ServerAddress\n\n\tfor id, fail := range replicaFails {\n\t\texpectSuccess = expectSuccess && !fail\n\n\t\taddress := apis.ServerAddress(fmt.Sprintf(\"chunk-address-%d\", id))\n\n\t\treplicaAddresses = append(replicaAddresses, address)\n\n\t\tchunkMock := &mocks.Chunkserver{}\n\t\tchunkChatter, err := chunkserver.WithChatter(chunkMock, cache)\n\t\tassert.NoError(t, err)\n\t\tcache.Chunkservers[address] = chunkChatter\n\t\tallMocks = append(allMocks, &chunkMock.Mock)\n\n\t\tif fail {\n\t\t\tchunkMock.On(\"StartWrite\", chunk, offset, data).Return(errors.New(\"sample failure for update_test\"))\n\t\t} else {\n\t\t\tchunkMock.On(\"StartWrite\", chunk, offset, data).Return(nil)\n\t\t}\n\t}\n\n\tif offset+length > apis.MaxChunkSize || len(replicaFails) == 0 {\n\t\texpectSuccess = false\n\t}\n\n\t// now perform operation\n\n\thash, err := (&Reference{\n\t\tReplicas: replicaAddresses,\n\t\tVersion: 5,\n\t\tChunk: chunk,\n\t}).PrepareWrite(cache, offset, data)\n\n\tif expectSuccess {\n\t\tassert.NoError(t, err)\n\t\tassert.Equal(t, expectedHash, hash)\n\n\t\tfor _, m := range allMocks {\n\t\t\tm.AssertExpectations(t)\n\t\t}\n\t} else {\n\t\tassert.Error(t, err)\n\t}\n}", "title": "" }, { "docid": "ce07a83b8ded9f63089024b34074c697", "score": "0.5072034", "text": "func (m *MockDownsamplerAndWriter) WriteBatch(arg0 context.Context, arg1 DownsampleAndWriteIter, arg2 WriteOptions) BatchError {\n\tm.ctrl.T.Helper()\n\tret := m.ctrl.Call(m, \"WriteBatch\", arg0, arg1, arg2)\n\tret0, _ := ret[0].(BatchError)\n\treturn ret0\n}", "title": "" }, { "docid": "0ff4c1e0841003ea0c680e031e9f249f", "score": "0.5071109", "text": "func (rws *responseWriterState) writeChunk(p []byte) (n int, err error) {\n\tif !rws.wroteHeader {\n\t\trws.writeHeader(200)\n\t}\n\tif !rws.sentHeader {\n\t\trws.sentHeader = true\n\t\tvar ctype, clen string // implicit ones, if we can calculate it\n\t\tif rws.handlerDone && rws.snapHeader.Get(\"Content-Length\") == \"\" {\n\t\t\tclen = strconv.Itoa(len(p))\n\t\t}\n\t\tif rws.snapHeader.Get(\"Content-Type\") == \"\" {\n\t\t\tctype = http.DetectContentType(p)\n\t\t}\n\t\tendStream := rws.handlerDone && len(p) == 0\n\t\trws.stream.conn.writeHeaders(headerWriteReq{\n\t\t\tstream: rws.stream,\n\t\t\thttpResCode: rws.status,\n\t\t\th: rws.snapHeader,\n\t\t\tendStream: endStream,\n\t\t\tcontentType: ctype,\n\t\t\tcontentLength: clen,\n\t\t}, rws.frameWriteCh)\n\t\tif endStream {\n\t\t\treturn\n\t\t}\n\t}\n\tif len(p) == 0 {\n\t\tif rws.handlerDone {\n\t\t\terr = rws.writeData(nil, true)\n\t\t}\n\t\treturn\n\t}\n\tfor len(p) > 0 {\n\t\tchunk := p\n\t\tif len(chunk) > handlerChunkWriteSize {\n\t\t\tchunk = chunk[:handlerChunkWriteSize]\n\t\t}\n\t\tallowedSize := rws.stream.flow.wait(int32(len(chunk)))\n\t\tif allowedSize == 0 {\n\t\t\treturn n, errStreamBroken\n\t\t}\n\t\tchunk = chunk[:allowedSize]\n\t\tp = p[len(chunk):]\n\t\tisFinal := rws.handlerDone && len(p) == 0\n\t\terr = rws.writeData(chunk, isFinal)\n\t\tif err != nil {\n\t\t\tbreak\n\t\t}\n\t\tn += len(chunk)\n\t}\n\treturn\n}", "title": "" }, { "docid": "152049e44eaffe71e790f0d1230235cb", "score": "0.505499", "text": "func TestBatchWriteItem(t *testing.T) {\n\tt.Parallel()\n\ttype TestData struct {\n\t\tS string\n\t}\n\ttestDataSet := func(count int) []*TestData {\n\t\tdata := make([]*TestData, count)\n\t\tfor i := 0; i < count; i++ {\n\t\t\tdata[i] = &TestData{\n\t\t\t\tS: strconv.Itoa(i),\n\t\t\t}\n\t\t}\n\t\treturn data\n\t}\n\tfor _, tc := range []struct {\n\t\tname string\n\t\ttable string\n\t\tinput interface{}\n\t\texpect *dynamodb.BatchWriteItemOutput\n\t}{\n\t\t{\n\t\t\tname: \"insert 2 items\",\n\t\t\ttable: \"test1\",\n\t\t\tinput: testDataSet(2),\n\t\t\texpect: &dynamodb.BatchWriteItemOutput{\n\t\t\t\tConsumedCapacity: []*dynamodb.ConsumedCapacity{\n\t\t\t\t\t{\n\t\t\t\t\t\tCapacityUnits: aws.Float64(2),\n\t\t\t\t\t\tTableName: aws.String(\"test1\"),\n\t\t\t\t\t},\n\t\t\t\t},\n\t\t\t},\n\t\t},\n\t\t{\n\t\t\tname: \"insert 115 items\",\n\t\t\ttable: \"testSet\",\n\t\t\tinput: testDataSet(115),\n\t\t\texpect: &dynamodb.BatchWriteItemOutput{\n\t\t\t\tConsumedCapacity: []*dynamodb.ConsumedCapacity{\n\t\t\t\t\t{\n\t\t\t\t\t\tCapacityUnits: aws.Float64(115),\n\t\t\t\t\t\tTableName: aws.String(\"testSet\"),\n\t\t\t\t\t},\n\t\t\t\t},\n\t\t\t},\n\t\t},\n\t\t{\n\t\t\tname: \"insert 1000 items\",\n\t\t\ttable: \"testLargeSet\",\n\t\t\tinput: testDataSet(1000),\n\t\t\texpect: &dynamodb.BatchWriteItemOutput{\n\t\t\t\tConsumedCapacity: []*dynamodb.ConsumedCapacity{\n\t\t\t\t\t{\n\t\t\t\t\t\tCapacityUnits: aws.Float64(1000),\n\t\t\t\t\t\tTableName: aws.String(\"testLargeSet\"),\n\t\t\t\t\t},\n\t\t\t\t},\n\t\t\t},\n\t\t},\n\t} {\n\t\ttc := tc\n\t\tt.Run(tc.name, func(t *testing.T) {\n\t\t\tt.Parallel()\n\t\t\t// Must have a local dynamodb running\n\t\t\tddb := dynamodb.New(\n\t\t\t\tsession.Must(session.NewSession(\n\t\t\t\t\t&aws.Config{\n\t\t\t\t\t\tRegion: aws.String(\"eu-west-1\"),\n\t\t\t\t\t\tEndpoint: aws.String(\"http://localhost:8000\"),\n\t\t\t\t\t\tCredentials: credentials.NewStaticCredentials(\"foo\", \"bar\", \"foobar\"),\n\t\t\t\t\t},\n\t\t\t\t)),\n\t\t\t)\n\t\t\t_, err := dynamodbx.CreateTableSync(ddb, &dynamodb.CreateTableInput{\n\t\t\t\tTableName: aws.String(tc.table),\n\t\t\t\tBillingMode: aws.String(dynamodb.BillingModePayPerRequest),\n\t\t\t\tAttributeDefinitions: []*dynamodb.AttributeDefinition{\n\t\t\t\t\t{\n\t\t\t\t\t\tAttributeName: aws.String(\"S\"),\n\t\t\t\t\t\tAttributeType: aws.String(dynamodb.ScalarAttributeTypeS),\n\t\t\t\t\t},\n\t\t\t\t},\n\t\t\t\tKeySchema: []*dynamodb.KeySchemaElement{\n\t\t\t\t\t{\n\t\t\t\t\t\tAttributeName: aws.String(\"S\"),\n\t\t\t\t\t\tKeyType: aws.String(dynamodb.KeyTypeHash),\n\t\t\t\t\t},\n\t\t\t\t},\n\t\t\t})\n\t\t\tdefer ddb.DeleteTable(&dynamodb.DeleteTableInput{\n\t\t\t\tTableName: aws.String(tc.table),\n\t\t\t})\n\t\t\tif err != nil {\n\t\t\t\tt.Fatal(err)\n\t\t\t}\n\t\t\treq, err := dynamodbx.BatchPutRequest(tc.table, tc.input)\n\t\t\tif err != nil {\n\t\t\t\tt.Fatal(err)\n\t\t\t}\n\t\t\tout, err := dynamodbx.BatchWriteItem(ddb, &dynamodb.BatchWriteItemInput{\n\t\t\t\tReturnConsumedCapacity: aws.String(\"TOTAL\"),\n\t\t\t\tReturnItemCollectionMetrics: aws.String(\"SIZE\"),\n\t\t\t\tRequestItems: req,\n\t\t\t})\n\t\t\tif err != nil {\n\t\t\t\tt.Fatal(err)\n\t\t\t}\n\t\t\tif tc.expect != nil && !reflect.DeepEqual(out, tc.expect) {\n\t\t\t\tt.Fatalf(pretty.Compare(out, tc.expect))\n\t\t\t}\n\t\t})\n\t}\n}", "title": "" }, { "docid": "1a958328c776d23f76e5191ac33d6060", "score": "0.5054887", "text": "func (c *Client) appendChunk(handle int64, data []byte) (offset int64, error error, errCode int) {\n\tgfs.DebugMsgToFile(fmt.Sprintf(\"append chunk handle <%d> offset <%d> start\", handle, offset), gfs.CLIENT, c.identifier)\n\tdefer gfs.DebugMsgToFile(fmt.Sprintf(\"append chunk handle <%d> offset <%d> end\", handle, offset), gfs.CLIENT, c.identifier)\n\tif len(data) > gfs.MaxAppendSize {\n\t\tgfs.DebugMsgToFile(fmt.Sprintf(\"append chunk handle <%d> offset <%d> error <%s>\", handle, offset,\n\t\t\tfmt.Errorf(\"len(data) = %v > max append size\", len(data))), gfs.CLIENT, c.identifier)\n\t\treturn -1, fmt.Errorf(\"len(data) = %v > max append size\", len(data)), gfs.UnknownError\n\t}\n\n\treplicaInfo, err := c.replicaBuffer.Get(handle)\n\tif err != nil {\n\t\tgfs.DebugMsgToFile(fmt.Sprintf(\"append chunk handle <%d> offset <%d> error <%s>\", handle, offset,\n\t\t\terr), gfs.CLIENT, c.identifier)\n\t\treturn -1, err, gfs.UnknownError\n\t}\n\n\tdataID := chunkserver.NewDataID(handle)\n\tchain := append(replicaInfo.Secondaries, replicaInfo.Primary)\n\n\tvar d gfs.ForwardDataReply\n\terr = gfs.Call(chain[0], \"ChunkServer.RPCForwardData\", gfs.ForwardDataArg{DataID: dataID, Data: data, ChainOrder: chain[1:]}, &d)\n\tif err != nil {\n\t\tgfs.DebugMsgToFile(fmt.Sprintf(\"append chunk handle <%d> offset <%d> error <%s>\", handle, offset,\n\t\t\terr), gfs.CLIENT, c.identifier)\n\t\treturn -1, err, gfs.UnknownError\n\t}\n\n\tvar a gfs.AppendChunkReply\n\terr = gfs.Call(replicaInfo.Primary, \"ChunkServer.RPCAppendChunk\",\n\t\tgfs.AppendChunkArg{DbID: dataID, Secondaries: replicaInfo.Secondaries}, &a)\n\tif err != nil {\n\t\tgfs.DebugMsgToFile(fmt.Sprintf(\"append chunk handle <%d> offset <%d> error <%s>\", handle, offset,\n\t\t\terr), gfs.CLIENT, c.identifier)\n\t\treturn -1, err, gfs.UnknownError\n\t}\n\tif a.ErrorCode == gfs.AppendExceedChunkSize {\n\t\tgfs.DebugMsgToFile(fmt.Sprintf(\"append chunk handle <%d> offset <%d> error <%s>\", handle, offset,\n\t\t\tfmt.Errorf(\"append over chunks\")), gfs.CLIENT, c.identifier)\n\t\treturn a.Offset, fmt.Errorf(\"append over chunks\"), a.ErrorCode\n\t}\n\treturn a.Offset, nil, gfs.Success\n}", "title": "" }, { "docid": "daec4bd0f04711d0721704fa6ba5cb93", "score": "0.5048786", "text": "func (self *WriteBatch) Put(key, value []byte) {\n\tcKey := byteToChar(key)\n\tcValue := byteToChar(value)\n\n\tC.rocksdb_writebatch_put(self.c, cKey, C.size_t(len(key)), cValue, C.size_t(len(value)))\n}", "title": "" }, { "docid": "82151d3262761fbf28788502430dadff", "score": "0.5044358", "text": "func (bal *balancer) transferSomeChunk(\n\tsrc apis.ServerID, dst apis.ServerID, chunks map[apis.ServerID]map[apis.ChunkVersion]bool) error {\n\n\t// Choose the mapping from the src chunkserver\n\tcvs, ok := chunks[src]\n\tif !ok {\n\t\treturn errors.New(\"List of chunks does not contain source server\")\n\t}\n\t// Grab some chunknum from the source to move\n\tvar curCV apis.ChunkVersion\n\tvar chunknum apis.ChunkNum\n\tchunknum = 0\n\tfor cv, _ := range cvs {\n\t\tcurCV = cv\n\t\tchunknum = cv.Chunk\n\t}\n\tif chunknum == 0 {\n\t\treturn errors.New(\"Chunklist for that source server was zero\")\n\t}\n\n\tentry, owner, err := bal.localCache.ReadEntry(chunknum)\n\tif owner != apis.NoRedirect {\n\t\treturn fmt.Errorf(\"Metadata for this server currently leased by %v\", owner)\n\t} else if err != nil {\n\t\treturn err\n\t}\n\n\tcsSrc, err := bal.idToCS(src)\n\tif err != nil {\n\t\treturn err\n\t}\n\tdstAddr, err := chunkupdate.AddressForChunkserver(bal.etcd, dst)\n\tif err != nil {\n\t\treturn err\n\t}\n\n\t// If this current function is halted, one of the replications\n\t// *should* be garbage collected.\n\terr = csSrc.Replicate(chunknum, dstAddr, entry.MostRecentVersion)\n\tif err != nil {\n\t\treturn err\n\t}\n\n\t// Find index of source in replicas\n\treplicas := []apis.ServerID{}\n\treplicas = append(replicas, entry.Replicas...)\n\n\trepI := -1\n\tfor i, id := range replicas {\n\t\tif src == id {\n\t\t\trepI = i\n\t\t\tbreak\n\t\t}\n\t}\n\tif repI == -1 {\n\t\treturn fmt.Errorf(\"Source server %d could not be found in list of replicas for chunk %v\", src, chunknum)\n\t}\n\n\t// Remove the src from the list of replicas and add the dst\n\treplicas = append(replicas[:repI], replicas[repI+1:]...)\n\treplicas = append(replicas, dst)\n\n\towner, err = bal.localCache.UpdateEntry(chunknum, entry, apis.MetadataEntry{\n\t\tMostRecentVersion: entry.MostRecentVersion,\n\t\tLastConsumedVersion: entry.LastConsumedVersion,\n\t\tReplicas: replicas,\n\t})\n\n\tif owner != apis.NoRedirect {\n\t\treturn fmt.Errorf(\"Cannot update metadata for chunk %d as server %d has a lease on it.\", chunknum, owner)\n\t} else if err != nil {\n\t\treturn err\n\t}\n\n\t// Finally, reflect the chunk move in the mapping of chunks provided\n\tdelete(chunks[src], curCV)\n\tchunks[dst][curCV] = true\n\n\treturn nil\n}", "title": "" }, { "docid": "9c6d1e1111121695c76e426b878193b1", "score": "0.50437725", "text": "func (w *RESPWriter) WriteBulkCommand(bulkCmd [][]string) error {\n\tfor _, cmd := range bulkCmd {\n\t\tw.bufferCommand(cmd...)\n\t}\n\treturn w.Flush()\n}", "title": "" }, { "docid": "dc2008d925f1f6fa538918502dd117ed", "score": "0.5040277", "text": "func streamSpentAddressesToWriter(buf io.Writer, abortSignal <-chan struct{}, spentAddressesStorage *objectstorage.ObjectStorage) (int32, error) {\n\n\tvar addressesWritten int32\n\n\twasAborted := false\n\tspentAddressesStorage.ForEachKeyOnly(func(key []byte) bool {\n\t\tselect {\n\t\tcase <-abortSignal:\n\t\t\twasAborted = true\n\t\t\treturn false\n\t\tdefault:\n\t\t}\n\n\t\taddressesWritten++\n\t\treturn binary.Write(buf, binary.LittleEndian, key) == nil\n\t}, false)\n\n\tif wasAborted {\n\t\treturn 0, errOperationAborted\n\t}\n\n\treturn addressesWritten, nil\n}", "title": "" }, { "docid": "16c14451ca9955e7ad52bec1fdd1541e", "score": "0.5039656", "text": "func appendBatchBySize(b []batchKeys, region locate.RegionVerID, keys [][]byte, sizeFn func([]byte) int, limit int) []batchKeys {\n\tvar start, end int\n\tfor start = 0; start < len(keys); start = end {\n\t\tvar size int\n\t\tfor end = start; end < len(keys) && size < limit; end++ {\n\t\t\tsize += sizeFn(keys[end])\n\t\t}\n\t\tb = append(b, batchKeys{\n\t\t\tregion: region,\n\t\t\tkeys: keys[start:end],\n\t\t})\n\t}\n\treturn b\n}", "title": "" }, { "docid": "4547ab10e8a905aef9402d59de270986", "score": "0.5037263", "text": "func sendBatch(requests []Request) {\n\tdefer wg.Done()\n\tbatch, err := httpbatch.Batch(requests)\n\tutils.Explain(err)\n\tresponses = append(responses, fmt.Sprintf(\"%v\", batch.Send()))\n}", "title": "" }, { "docid": "f094448d4c543fd798c62c5c68a4a53a", "score": "0.5035392", "text": "func (self *WriteBatch) Put(key, value []byte) {\n\tcKey := ByteToChar(key)\n\tcValue := ByteToChar(value)\n\n\tC.rocksdb_writebatch_put(self.c, cKey, C.size_t(len(key)), cValue, C.size_t(len(value)))\n}", "title": "" } ]
e454c3f07c05df068b2df22004bfc867
Required: resource to select
[ { "docid": "0a9d6c9641e4e591c91df73d5a1b4d99", "score": "0.0", "text": "func (o VirtualDatabaseSpecEnvValueFromResourceFieldRefOutput) Resource() pulumi.StringOutput {\n\treturn o.ApplyT(func(v VirtualDatabaseSpecEnvValueFromResourceFieldRef) string { return v.Resource }).(pulumi.StringOutput)\n}", "title": "" } ]
[ { "docid": "5a287f43aef5b4e973fc35567ea18b82", "score": "0.57260734", "text": "func (r *Request) Resource(resource string) *Request {\n\tif r.err != nil {\n\t\treturn r\n\t}\n\n\tif len(r.resource) != 0 {\n\t\tr.err = fmt.Errorf(\"resource already set to %q, cannot change to %q\", r.resource, resource)\n\t\treturn r\n\t}\n\n\tif msgs := IsValidPathSegmentName(resource); len(msgs) != 0 {\n\t\tr.err = fmt.Errorf(\"invalid resource %q: %v\", resource, msgs)\n\t\treturn r\n\t}\n\n\tr.resource = resource\n\n\treturn r\n}", "title": "" }, { "docid": "6b1abe6915cafe229645a910c1c555af", "score": "0.5606337", "text": "func Resource() parameter.Parameter {\n\treturn parameter.Single(CUTYPE, \"RESOURCE\")\n}", "title": "" }, { "docid": "23dc6117c7f46bcb3b51743a058e6da5", "score": "0.5457968", "text": "func (r *Request) Resource(resource string) *Request {\n\tif nil != r.err {\n\t\treturn r\n\t}\n\tr.resource = resource\n\treturn r\n}", "title": "" }, { "docid": "96a008b14dc1a4ca83e544e125c23763", "score": "0.5344702", "text": "func (m *ProgramControl) GetResource()(ProgramResourceable) {\n val, err := m.GetBackingStore().Get(\"resource\")\n if err != nil {\n panic(err)\n }\n if val != nil {\n return val.(ProgramResourceable)\n }\n return nil\n}", "title": "" }, { "docid": "4ebb056d7fac38aab87d4bab4eb8f979", "score": "0.5329034", "text": "func (c *Client) Resource(path string) *Resource {\n\tr := &Resource{u: c.URL()}\n\tif !isAPI(path) {\n\t\tpath = Path + path\n\t}\n\tr.u.Path = path\n\treturn r\n}", "title": "" }, { "docid": "e34fd71b46adc7631c356e610496fe23", "score": "0.53226614", "text": "func (client *ChildAvailabilityStatusesClient) getByResourceCreateRequest(ctx context.Context, resourceURI string, options *ChildAvailabilityStatusesClientGetByResourceOptions) (*policy.Request, error) {\n\turlPath := \"/{resourceUri}/providers/Microsoft.ResourceHealth/childAvailabilityStatuses/current\"\n\turlPath = strings.ReplaceAll(urlPath, \"{resourceUri}\", resourceURI)\n\treq, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.host, urlPath))\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\treqQP := req.Raw().URL.Query()\n\treqQP.Set(\"api-version\", \"2017-07-01\")\n\tif options != nil && options.Filter != nil {\n\t\treqQP.Set(\"$filter\", *options.Filter)\n\t}\n\tif options != nil && options.Expand != nil {\n\t\treqQP.Set(\"$expand\", *options.Expand)\n\t}\n\treq.Raw().URL.RawQuery = reqQP.Encode()\n\treq.Raw().Header.Set(\"Accept\", \"application/json\")\n\treturn req, nil\n}", "title": "" }, { "docid": "91b17a268f9f9553fcd9b353c34c4c70", "score": "0.53031796", "text": "func (r ApiGetResourcepoolLeaseResourceListRequest) Select_(select_ string) ApiGetResourcepoolLeaseResourceListRequest {\n\tr.select_ = &select_\n\treturn r\n}", "title": "" }, { "docid": "8f0350407a9b3359496d6588fd52db85", "score": "0.5280633", "text": "func (yad *yandexDisk) getResource(area string, path string, fields []string, limit int, offset int, previewCrop bool, previewSize string, sort string) (*http.Request, error) {\n\tvalues := url.Values{}\n\tvalues.Add(\"path\", path)\n\tvalues.Add(\"fields\", strings.Join(fields, \",\"))\n\tvalues.Add(\"limit\", strconv.Itoa(limit))\n\tvalues.Add(\"offset\", strconv.Itoa(offset))\n\tvalues.Add(\"preview_crop\", strconv.FormatBool(previewCrop))\n\tvalues.Add(\"preview_size\", previewSize)\n\tvalues.Add(\"sort\", sort)\n\n\tr, e := yad.client.request(http.MethodGet, \"/disk/\"+area+\"resources?\"+values.Encode(), nil)\n\tif e != nil {\n\t\treturn nil, e\n\t}\n\treturn r, nil\n}", "title": "" }, { "docid": "ed3e8523d813cf7d2f65cb1caecbf418", "score": "0.5272578", "text": "func selectObjectMetaForMatching(resourceSelectorType ResourceSelectorType, objectMeta metav1.ObjectMeta, clientset kubernetes.Clientset) *metav1.ObjectMeta {\n\tklog.Infof(\"resolving the resource to use for selection (type: %s)\", resourceSelectorType)\n\n\tswitch resourceSelectorType {\n\tcase GeneralResourceSelectorType:\n\t\treturn &objectMeta\n\tcase NamespaceResourceSelectorType:\n\t\tctx, cancel_fn := context.WithTimeout(context.TODO(), 5*time.Second)\n\t\tdefer cancel_fn()\n\t\tnamespace, err := clientset.CoreV1().Namespaces().Get(ctx, objectMeta.Namespace, metav1.GetOptions{})\n\t\tif err != nil {\n\t\t\tklog.Error(err)\n\t\t\treturn nil\n\t\t}\n\n\t\tif namespace != nil {\n\t\t\treturn &namespace.ObjectMeta\n\t\t} else {\n\t\t\tklog.Warningf(\"could not get a namespace information for %s\", objectMeta.Namespace)\n\t\t\treturn nil\n\t\t}\n\tcase ImageResourceSelectorType:\n\t\treturn nil\n\tdefault:\n\t\treturn nil\n\t}\n}", "title": "" }, { "docid": "ea11d77352cd403a281a32044a60f291", "score": "0.52566236", "text": "func (loader *segmentLoader) requestResource(ctx context.Context, infos ...*querypb.SegmentLoadInfo) (LoadResource, int, error) {\n\tsegmentIDs := lo.Map(infos, func(info *querypb.SegmentLoadInfo, _ int) int64 {\n\t\treturn info.GetSegmentID()\n\t})\n\tlog := log.Ctx(ctx).With(\n\t\tzap.Int64s(\"segmentIDs\", segmentIDs),\n\t)\n\n\tresource := LoadResource{}\n\n\tloader.mut.Lock()\n\tdefer loader.mut.Unlock()\n\n\tmemoryUsage := hardware.GetUsedMemoryCount()\n\ttotalMemory := hardware.GetMemoryCount()\n\n\tdiskUsage, err := GetLocalUsedSize(paramtable.Get().LocalStorageCfg.Path.GetValue())\n\tif err != nil {\n\t\treturn resource, 0, errors.Wrap(err, \"get local used size failed\")\n\t}\n\tdiskCap := paramtable.Get().QueryNodeCfg.DiskCapacityLimit.GetAsUint64()\n\n\tpoolCap := runtime.NumCPU() * paramtable.Get().CommonCfg.HighPriorityThreadCoreCoefficient.GetAsInt()\n\tif loader.committedResource.WorkNum >= poolCap {\n\t\treturn resource, 0, merr.WrapErrServiceRequestLimitExceeded(int32(poolCap))\n\t} else if loader.committedResource.MemorySize+memoryUsage >= totalMemory {\n\t\treturn resource, 0, merr.WrapErrServiceMemoryLimitExceeded(float32(loader.committedResource.MemorySize+memoryUsage), float32(totalMemory))\n\t} else if loader.committedResource.DiskSize+uint64(diskUsage) >= diskCap {\n\t\treturn resource, 0, merr.WrapErrServiceDiskLimitExceeded(float32(loader.committedResource.DiskSize+uint64(diskUsage)), float32(diskCap))\n\t}\n\n\tconcurrencyLevel := funcutil.Min(runtime.GOMAXPROCS(0), len(infos))\n\n\tfor _, info := range infos {\n\t\tfor _, field := range info.GetBinlogPaths() {\n\t\t\tresource.WorkNum += len(field.GetBinlogs())\n\t\t}\n\t\tfor _, index := range info.GetIndexInfos() {\n\t\t\tresource.WorkNum += len(index.IndexFilePaths)\n\t\t}\n\t}\n\n\tfor ; concurrencyLevel > 1; concurrencyLevel /= 2 {\n\t\t_, _, err := loader.checkSegmentSize(ctx, infos, concurrencyLevel)\n\t\tif err == nil {\n\t\t\tbreak\n\t\t}\n\t}\n\n\tmu, du, err := loader.checkSegmentSize(ctx, infos, concurrencyLevel)\n\tif err != nil {\n\t\tlog.Warn(\"no sufficient resource to load segments\", zap.Error(err))\n\t\treturn resource, 0, err\n\t}\n\n\tresource.MemorySize += mu\n\tresource.DiskSize += du\n\n\ttoMB := func(mem uint64) float64 {\n\t\treturn float64(mem) / 1024 / 1024\n\t}\n\tloader.committedResource.Add(resource)\n\tlog.Info(\"request resource for loading segments (unit in MiB)\",\n\t\tzap.Int(\"workerNum\", resource.WorkNum),\n\t\tzap.Int(\"committedWorkerNum\", loader.committedResource.WorkNum),\n\t\tzap.Float64(\"memory\", toMB(resource.MemorySize)),\n\t\tzap.Float64(\"committedMemory\", toMB(loader.committedResource.MemorySize)),\n\t\tzap.Float64(\"disk\", toMB(resource.DiskSize)),\n\t\tzap.Float64(\"committedDisk\", toMB(loader.committedResource.DiskSize)),\n\t)\n\n\treturn resource, concurrencyLevel, nil\n}", "title": "" }, { "docid": "bdbde4b43e337ea2a727f45626084417", "score": "0.52342105", "text": "func SelectFromWhere(table ResourceTable, idVal int) (resultRecord modelResource.Resource) {\n\treturn\n}", "title": "" }, { "docid": "844e2021e107864dbab380c1aaeb730b", "score": "0.5228863", "text": "func ChooseResources(typeName string, menuDescription string, nsr options.NsResourceMap) ([]*core.ResourceRef, error) {\n\n\tresOptions, resMap := generateCommonResourceSelectOptions(typeName, nsr)\n\tif len(resOptions) == 0 {\n\t\treturn []*core.ResourceRef{}, fmt.Errorf(\"No %v found. Please create a %v\", menuDescription, menuDescription)\n\t}\n\tquestion := &survey.MultiSelect{\n\t\tMessage: fmt.Sprintf(\"Select a %v\", menuDescription),\n\t\tOptions: resOptions,\n\t}\n\n\tvar choice []string\n\tif err := survey.AskOne(question, &choice, survey.Required); err != nil {\n\t\t// this should not error\n\t\tfmt.Println(\"error with input\")\n\t\treturn []*core.ResourceRef{}, err\n\t}\n\tvar response []*core.ResourceRef\n\tfor _, c := range choice {\n\t\tres := resMap[c].resourceRef\n\t\tresponse = append(response, &res)\n\t}\n\n\treturn response, nil\n}", "title": "" }, { "docid": "b9e077020e195e4a67b19110bb820a17", "score": "0.51997495", "text": "func (proto *Protocol) SELECT(command *Command) {\n\n}", "title": "" }, { "docid": "6adbdb397ff03e6964567034d4c21506", "score": "0.5186059", "text": "func getResource(name string, taskInfo *mesos.TaskInfo) *mesos.Resource {\n\tfor _, resource := range taskInfo.Resources {\n\t\tif *resource.Name == name {\n\t\t\treturn resource\n\t\t}\n\t}\n\n\treturn nil\n}", "title": "" }, { "docid": "125f4e3c6ae8c1467d48ed584379632c", "score": "0.51751286", "text": "func selectBookFromForm(res http.ResponseWriter, req *http.Request, params httprouter.Params) {\n\tServeTemplateWithParams(res, \"simpleSelector.html\", nil)\n}", "title": "" }, { "docid": "9518cba15cd7dbb2ee46d7a792a030c4", "score": "0.51634955", "text": "func (p *Portal) Resource(model interface{}) *Resource {\n\topts := ResourceOptions{}\n\n\tfieldr := NewFielder(model, opts.Fields)\n\tfieldr.portal = p\n\n\tresource := NewResource(model, fieldr)\n\tresource.Portal = p\n\tresource.Options = opts\n\n\tp.registry = append(p.registry, resource)\n\treturn resource\n}", "title": "" }, { "docid": "d562f90809354a9e1d4276f3223306ad", "score": "0.5160794", "text": "func (b *GovernanceRoleSettingRequestBuilder) Resource() *GovernanceResourceRequestBuilder {\n\tbb := &GovernanceResourceRequestBuilder{BaseRequestBuilder: b.BaseRequestBuilder}\n\tbb.baseURL += \"/resource\"\n\treturn bb\n}", "title": "" }, { "docid": "5b0baf03e3a95c76d4e6815682434769", "score": "0.5133971", "text": "func (p *SASQueryParameters) Resource() string {\n\treturn p.resource\n}", "title": "" }, { "docid": "06c00a8f2e5d372a0b74658ff4e3584c", "score": "0.51207507", "text": "func (r ApiGetHyperflexLicenseListRequest) Select_(select_ string) ApiGetHyperflexLicenseListRequest {\n\tr.select_ = &select_\n\treturn r\n}", "title": "" }, { "docid": "50daf44a5c6cbcb5476191b9ba8b7836", "score": "0.5066588", "text": "func (sel *CFNSelector) Resources(msg, finalMsg, help, body string) ([]template.CFNResource, error) {\n\ttpl := struct {\n\t\tResources map[string]struct {\n\t\t\tType string `yaml:\"Type\"`\n\t\t} `yaml:\"Resources\"`\n\t}{}\n\tif err := yaml.Unmarshal([]byte(body), &tpl); err != nil {\n\t\treturn nil, fmt.Errorf(\"unmarshal CloudFormation template: %v\", err)\n\t}\n\n\t// Prompt for a selection.\n\tvar options []prompt.Option\n\tfor name, resource := range tpl.Resources {\n\t\tif resource.Type == \"AWS::Lambda::Function\" || strings.HasPrefix(resource.Type, \"Custom::\") {\n\t\t\tcontinue\n\t\t}\n\t\toptions = append(options, prompt.Option{\n\t\t\tValue: name,\n\t\t\tHint: resource.Type,\n\t\t})\n\t}\n\tsort.Slice(options, func(i, j int) bool { // Sort options by resource type, if they're the same resource type then sort by logicalID.\n\t\tif options[i].Hint == options[j].Hint {\n\t\t\treturn options[i].Value < options[j].Value\n\t\t}\n\t\treturn options[i].Hint < options[j].Hint\n\t})\n\tlogicalIDs, err := sel.prompt.MultiSelectOptions(msg, help, options, prompt.WithFinalMessage(finalMsg))\n\tif err != nil {\n\t\treturn nil, fmt.Errorf(\"select CloudFormation resources: %v\", err)\n\t}\n\n\t// Transform to template.CFNResource\n\tout := make([]template.CFNResource, len(logicalIDs))\n\tfor i, logicalID := range logicalIDs {\n\t\tout[i] = template.CFNResource{\n\t\t\tType: template.CFNType(tpl.Resources[logicalID].Type),\n\t\t\tLogicalID: logicalID,\n\t\t}\n\t}\n\treturn out, nil\n}", "title": "" }, { "docid": "a48ade70294e819c4a45ae32fac78aa4", "score": "0.5061585", "text": "func (r ApiGetResourcepoolPoolListRequest) Select_(select_ string) ApiGetResourcepoolPoolListRequest {\n\tr.select_ = &select_\n\treturn r\n}", "title": "" }, { "docid": "d069d68e4f20645dd1952e1bcc165a4d", "score": "0.5056172", "text": "func SelectResources(data TmpJSON, resourceType string) map[string][]map[string]interface{} {\n\tvar resources []map[string]interface{}\n\t// resources := make([]map[string]interface{}, 0)\n\n\tfor _, v := range data.Data {\n\t\tif v[\"type\"] == resourceType {\n\t\t\tresources = append(resources, v)\n\t\t}\n\t}\n\n\tfiltered := map[string][]map[string]interface{}{\n\t\t\"data\": resources,\n\t}\n\treturn filtered\n}", "title": "" }, { "docid": "351c041b44ea911dba4166f92b09bfc6", "score": "0.5010516", "text": "func (r ApiGetHyperflexHealthListRequest) Select_(select_ string) ApiGetHyperflexHealthListRequest {\n\tr.select_ = &select_\n\treturn r\n}", "title": "" }, { "docid": "e7b53a6bae4b4d7f30771aed7aabfc51", "score": "0.49921843", "text": "func (r ApiGetResourcepoolLeaseListRequest) Select_(select_ string) ApiGetResourcepoolLeaseListRequest {\n\tr.select_ = &select_\n\treturn r\n}", "title": "" }, { "docid": "7b414f07297dec431fcefbbf97acdc8f", "score": "0.49862698", "text": "func GetResource(nsId string, resourceType string, resourceId string) (interface{}, error) {\n\n\terr := common.CheckString(nsId)\n\tif err != nil {\n\t\tcommon.CBLog.Error(err)\n\t\treturn nil, err\n\t}\n\n\terr = common.CheckString(resourceId)\n\tif err != nil {\n\t\tcommon.CBLog.Error(err)\n\t\treturn nil, err\n\t}\n\tcheck, err := CheckResource(nsId, resourceType, resourceId)\n\tif err != nil {\n\t\tcommon.CBLog.Error(err)\n\t\treturn nil, err\n\t}\n\n\tif !check {\n\t\terrString := \"The \" + resourceType + \" \" + resourceId + \" does not exist.\"\n\t\t//mapA := map[string]string{\"message\": errString}\n\t\t//mapB, _ := json.Marshal(mapA)\n\t\terr := fmt.Errorf(errString)\n\t\treturn nil, err\n\t}\n\n\tfmt.Println(\"[Get resource] \" + resourceType + \", \" + resourceId)\n\n\tkey := common.GenResourceKey(nsId, resourceType, resourceId)\n\t//fmt.Println(key)\n\n\tkeyValue, err := common.CBStore.Get(key)\n\tif err != nil {\n\t\tcommon.CBLog.Error(err)\n\t\treturn nil, err\n\t}\n\tif keyValue != nil {\n\t\tswitch resourceType {\n\t\tcase common.StrImage:\n\t\t\tres := TbImageInfo{}\n\t\t\terr = json.Unmarshal([]byte(keyValue.Value), &res)\n\t\t\tif err != nil {\n\t\t\t\tcommon.CBLog.Error(err)\n\t\t\t\treturn nil, err\n\t\t\t}\n\t\t\treturn res, nil\n\t\tcase common.StrSecurityGroup:\n\t\t\tres := TbSecurityGroupInfo{}\n\t\t\terr = json.Unmarshal([]byte(keyValue.Value), &res)\n\t\t\tif err != nil {\n\t\t\t\tcommon.CBLog.Error(err)\n\t\t\t\treturn nil, err\n\t\t\t}\n\t\t\treturn res, nil\n\t\tcase common.StrSpec:\n\t\t\tres := TbSpecInfo{}\n\t\t\terr = json.Unmarshal([]byte(keyValue.Value), &res)\n\t\t\tif err != nil {\n\t\t\t\tcommon.CBLog.Error(err)\n\t\t\t\treturn nil, err\n\t\t\t}\n\t\t\treturn res, nil\n\t\tcase common.StrSSHKey:\n\t\t\tres := TbSshKeyInfo{}\n\t\t\terr = json.Unmarshal([]byte(keyValue.Value), &res)\n\t\t\tif err != nil {\n\t\t\t\tcommon.CBLog.Error(err)\n\t\t\t\treturn nil, err\n\t\t\t}\n\t\t\treturn res, nil\n\t\tcase common.StrVNet:\n\t\t\tres := TbVNetInfo{}\n\t\t\terr = json.Unmarshal([]byte(keyValue.Value), &res)\n\t\t\tif err != nil {\n\t\t\t\tcommon.CBLog.Error(err)\n\t\t\t\treturn nil, err\n\t\t\t}\n\t\t\treturn res, nil\n\t\t}\n\n\t\t//return true, nil\n\t}\n\terrString := \"Cannot get \" + resourceType + \" \" + resourceId + \".\"\n\terr = fmt.Errorf(errString)\n\treturn nil, err\n}", "title": "" }, { "docid": "c4344b0d0d293a06293c1aaa29cb3081", "score": "0.49559382", "text": "func (r ApiGetIqnpoolReservationListRequest) Select_(select_ string) ApiGetIqnpoolReservationListRequest {\n\tr.select_ = &select_\n\treturn r\n}", "title": "" }, { "docid": "7399ff485b479413b3c6f9f6a06bce62", "score": "0.49519017", "text": "func getResource(ctx context.Context, client resource.Interface, obj runtime.Object) (runtime.Object, error) {\n\tobjMeta := resource.MustToMeta(obj)\n\n\tif objMeta.GetName() != \"\" || objMeta.GetGenerateName() == \"\" {\n\t\treturn client.Get(ctx, objMeta.GetName(), metav1.GetOptions{})\n\t}\n\n\tlist, err := client.List(ctx, metav1.ListOptions{\n\t\tLabelSelector: labels.SelectorFromSet(objMeta.GetLabels()).String(),\n\t})\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\tcount := len(list)\n\tif count == 0 {\n\t\treturn nil, apierrors.NewNotFound(schema.GroupResource{}, \"\")\n\t}\n\n\tif count != 1 {\n\t\treturn nil, fmt.Errorf(\"found %d resources with labels %#v, expected 1\", count, objMeta.GetLabels())\n\t}\n\n\treturn list[0], nil\n}", "title": "" }, { "docid": "515413c8cae449050356d6774c1ba303", "score": "0.4951665", "text": "func resourceShortFormFor(resource string) (string, bool) {\n\tvar alias string\n\texists := false\n\tfor k, val := range shortForms {\n\t\tif val == resource {\n\t\t\talias = k\n\t\t\texists = true\n\t\t\tbreak\n\t\t}\n\t}\n\treturn alias, exists\n}", "title": "" }, { "docid": "6201667c4f1ea4412df7d4ab33c5625a", "score": "0.49497265", "text": "func pickController(l object.VirtualDeviceList, bus int, ct string) (types.BaseVirtualController, error) {\n\tlog.Printf(\"[DEBUG] pickController: Looking for %s controller at bus number %d\", ct, bus)\n\tl = l.Select(func(device types.BaseVirtualDevice) bool {\n\t\tswitch d := device.(type) {\n\t\tcase types.BaseVirtualSCSIController:\n\t\t\tif ct == SubresourceControllerTypeSCSI {\n\t\t\t\treturn d.GetVirtualSCSIController().BusNumber == int32(bus)\n\t\t\t}\n\t\tcase types.BaseVirtualSATAController:\n\t\t\tif ct == SubresourceControllerTypeSATA {\n\t\t\t\treturn d.GetVirtualSATAController().BusNumber == int32(bus)\n\t\t\t}\n\t\tcase *types.VirtualIDEController:\n\t\t\tif ct == SubresourceControllerTypeIDE {\n\t\t\t\treturn d.GetVirtualController().BusNumber == int32(bus)\n\t\t\t}\n\t\tcase *types.VirtualPCIController:\n\t\t\tif ct == SubresourceControllerTypePCI {\n\t\t\t\treturn d.GetVirtualController().BusNumber == int32(bus)\n\t\t\t}\n\t\t}\n\t\treturn false\n\t})\n\n\tif len(l) == 0 {\n\t\treturn nil, fmt.Errorf(\"could not find controller at bus number %d\", bus)\n\t}\n\n\tlog.Printf(\"[DEBUG] pickSCSIController: Found controller: %s\", l.Name(l[0]))\n\treturn l[0].(types.BaseVirtualController), nil\n}", "title": "" }, { "docid": "3b3ceb0f7069540d85e5ca5597fa5c7a", "score": "0.49479374", "text": "func (t *PulsarTrigger) FetchResource(ctx context.Context) (interface{}, error) {\n\treturn t.Trigger.Template.Pulsar, nil\n}", "title": "" }, { "docid": "c16603eac6373d2c88b55d2e70d0ec5f", "score": "0.49376598", "text": "func (r ApiGetHyperflexTargetListRequest) Select_(select_ string) ApiGetHyperflexTargetListRequest {\n\tr.select_ = &select_\n\treturn r\n}", "title": "" }, { "docid": "0bc03d01ea48ca22fc7939c8f215bfde", "score": "0.49354333", "text": "func (tc *TeamResourceModel) ListByResource(resourceID string, dataselect *common.DataSelectQuery) ([]TeamResourceModel, uint32, error) {\n\to := orm.NewOrm()\n\n\tsql := fmt.Sprintf(`SELECT * FROM %s WHERE resource_id = ?;`, tc.TableName())\n\tvar refs []TeamResourceModel\n\t_, err := o.Raw(sql, resourceID).QueryRows(&refs)\n\tif err != nil {\n\t\terrCode, err := sqlstatus.ParseErrorCode(err)\n\t\treturn nil, errCode, err\n\t}\n\terrCode, err := sqlstatus.ParseErrorCode(err)\n\treturn refs, errCode, err\n}", "title": "" }, { "docid": "fc44f7cee31eeea50016803be4ca12ca", "score": "0.49330944", "text": "func (*IamPolicyAnalysisQuery_ResourceSelector) Descriptor() ([]byte, []int) {\n\treturn file_google_cloud_asset_v1_asset_service_proto_rawDescGZIP(), []int{26, 0}\n}", "title": "" }, { "docid": "9809068cd53bb665dcd34aa0885366c0", "score": "0.4924583", "text": "func (r *Request) RespondResource(rid string) {\n\ttype Ref struct {\n\t\tRID string `json:\"rid\"`\n\t}\n\tr.Respond(struct {\n\t\tResource Ref `json:\"resource\"`\n\t}{\n\t\tResource: Ref{RID: rid},\n\t})\n}", "title": "" }, { "docid": "76982b3949154b16d2a079e6c0d02b4b", "score": "0.49230745", "text": "func findResourceFromResourceName(gvr schema.GroupVersionResource, serverGroupsAndResources []*metav1.APIResourceList) (*metav1.APIResource, error) {\n\tfor _, list := range serverGroupsAndResources {\n\t\tgv, err := schema.ParseGroupVersion(list.GroupVersion)\n\t\tif err != nil {\n\t\t\treturn nil, err\n\t\t}\n\t\tif gv.Group == gvr.Group && gv.Version == gvr.Version {\n\t\t\tfor _, resource := range list.APIResources {\n\t\t\t\tif resource.Name == gvr.Resource {\n\t\t\t\t\t// if the matched resource has group or version set we don't need to copy from the parent list\n\t\t\t\t\tif resource.Group != \"\" || resource.Version != \"\" {\n\t\t\t\t\t\treturn &resource, nil\n\t\t\t\t\t}\n\t\t\t\t\tresult := resource.DeepCopy()\n\t\t\t\t\tresult.Group = gv.Group\n\t\t\t\t\tresult.Version = gv.Version\n\t\t\t\t\treturn result, nil\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\treturn nil, fmt.Errorf(\"resource %s not found in group %s\", gvr.Resource, gvr.GroupVersion())\n}", "title": "" }, { "docid": "a87f9717bb231189371d160da9a1c246", "score": "0.49154997", "text": "func (rr *Registry) Select(ctx context.Context, graphType, graphName string) (*Registration, error) {\n\trr.mu.Lock()\n\tdefer rr.mu.Unlock()\n\n\tkey := rr.keyFromGraphTypeAndName(graphType, graphName)\n\n\tgetRes, err := rr.kv.Get(ctx, key, etcdv3.WithLimit(2))\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\tif getRes.Count == 0 {\n\t\treturn nil, ErrZeroValues\n\t}\n\tif getRes.Count > 1 {\n\t\treturn nil, ErrMultipleValues\n\t}\n\n\treturn rr.unmarshalRegistration(getRes.Kvs[0])\n}", "title": "" }, { "docid": "87bf24d2c0671898875dc0ada714ac5a", "score": "0.49098364", "text": "func (tx *Tx) Resource() string {\n\treturn tx.resource\n}", "title": "" }, { "docid": "38e4e3d577524854653e04bd2e703556", "score": "0.49098355", "text": "func (clt *SMServiceClient) SelectSupply(sp Supply) (uint64, error) {\n\ttgt := &Target{\n\t\tId: GenerateIntID(),\n\t\tSenderId: uint64(clt.ClientID),\n\t\tTargetId: sp.Id, /// Message Id of Supply (not SenderId),\n\t\tType: sp.Type,\n\t}\n\tctx, cancel := context.WithTimeout(context.Background(), 10*time.Second)\n\tdefer cancel()\n\tresp, err := clt.Client.SelectSupply(ctx, tgt)\n\tif err != nil {\n\t\tlog.Printf(\"%v.SelectSupply err %v\", clt, err)\n\t\treturn 0, err\n\t}\n\tlog.Println(\"SelectSupply Response:\", resp)\n\t// if mbus is OK, start mbus!\n\tclt.MbusID = IDType(resp.MbusId)\n\tif clt.MbusID != 0 {\n\t\t//\t\tclt.SubscribeMbus()\n\t}\n\n\treturn uint64(clt.MbusID), nil\n}", "title": "" }, { "docid": "fcdd2eaf590864b29abf7d1f8fca6ef1", "score": "0.49087524", "text": "func Select(selector Selector) *fire.Callback {\n\treturn fire.C(\"ash/Selector\", fire.Authorizer, fire.All(), func(ctx *fire.Context) error {\n\t\t// get identity\n\t\tidentity := ctx.Data[IdentityDataKey]\n\t\tif identity == nil {\n\t\t\treturn fire.ErrAccessDenied.Wrap()\n\t\t}\n\n\t\t// run selector\n\t\tpolicy := selector(identity)\n\n\t\t// check policy\n\t\tif policy == nil {\n\t\t\treturn nil\n\t\t}\n\n\t\t// check stored\n\t\tif ctx.Data[PolicyDataKey] != nil {\n\t\t\treturn xo.F(\"existing policy\")\n\t\t}\n\n\t\t// store policy\n\t\tctx.Data[PolicyDataKey] = policy\n\n\t\treturn nil\n\t})\n}", "title": "" }, { "docid": "5c58d05f4c04c7f4718acd0fb4597943", "score": "0.49085718", "text": "func findResource(groupVersion string, kind string, serverPreferredResources, serverGroupsAndResources []*metav1.APIResourceList) (\n\tapiResource, parentAPIResource *metav1.APIResource, gvr schema.GroupVersionResource, err error,\n) {\n\tmatchingServerResources := getMatchingServerResources(groupVersion, kind, serverGroupsAndResources)\n\n\tonlySubresourcePresentInMatchingResources := len(matchingServerResources) > 0\n\tfor _, matchingServerResource := range matchingServerResources {\n\t\tif !kubeutils.IsSubresource(matchingServerResource.apiResource.Name) {\n\t\t\tonlySubresourcePresentInMatchingResources = false\n\t\t\tbreak\n\t\t}\n\t}\n\n\tif onlySubresourcePresentInMatchingResources {\n\t\tapiResourceWithListGV := matchingServerResources[0]\n\t\tmatchingServerResource := apiResourceWithListGV.apiResource\n\t\tlogger.V(6).Info(\"matched API resource to kind\", \"apiResource\", matchingServerResource, \"kind\", kind)\n\n\t\tgroupVersionResource := schema.GroupVersionResource{\n\t\t\tResource: matchingServerResource.Name,\n\t\t\tGroup: matchingServerResource.Group,\n\t\t\tVersion: matchingServerResource.Version,\n\t\t}\n\t\tlogger.V(6).Info(\"gv with resource\", \"gvWithResource\", groupVersionResource)\n\t\tgv, err := schema.ParseGroupVersion(apiResourceWithListGV.listGV)\n\t\tif err != nil {\n\t\t\treturn nil, nil, schema.GroupVersionResource{}, fmt.Errorf(\"failed to parse group version %s: %v\", apiResourceWithListGV.listGV, err)\n\t\t}\n\t\tparentAPIResource, err := findResourceFromResourceName(\n\t\t\tgv.WithResource(strings.Split(matchingServerResource.Name, \"/\")[0]),\n\t\t\tserverPreferredResources,\n\t\t)\n\t\tif err != nil {\n\t\t\treturn nil, nil, schema.GroupVersionResource{}, fmt.Errorf(\"failed to find parent resource for subresource %s: %v\", matchingServerResource.Name, err)\n\t\t}\n\t\tlogger.V(6).Info(\"parent API resource\", \"parentAPIResource\", parentAPIResource)\n\n\t\treturn &matchingServerResource, parentAPIResource, groupVersionResource, nil\n\t}\n\n\tif groupVersion == \"\" && len(matchingServerResources) > 0 {\n\t\tfor _, serverResourceList := range serverPreferredResources {\n\t\t\tfor _, serverResource := range serverResourceList.APIResources {\n\t\t\t\tserverResourceGv := getServerResourceGroupVersion(serverResourceList.GroupVersion, serverResource.Group, serverResource.Version)\n\t\t\t\tif serverResource.Kind == kind || serverResource.SingularName == kind {\n\t\t\t\t\tgv, _ := schema.ParseGroupVersion(serverResourceGv)\n\t\t\t\t\tserverResource.Group = gv.Group\n\t\t\t\t\tserverResource.Version = gv.Version\n\t\t\t\t\tgroupVersionResource := gv.WithResource(serverResource.Name)\n\n\t\t\t\t\tlogger.V(6).Info(\"matched API resource to kind\", \"apiResource\", serverResource, \"kind\", kind)\n\t\t\t\t\treturn &serverResource, nil, groupVersionResource, nil\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t} else {\n\t\tfor _, apiResourceWithListGV := range matchingServerResources {\n\t\t\tmatchingServerResource := apiResourceWithListGV.apiResource\n\t\t\tif !kubeutils.IsSubresource(matchingServerResource.Name) {\n\t\t\t\tlogger.V(6).Info(\"matched API resource to kind\", \"apiResource\", matchingServerResource, \"kind\", kind)\n\n\t\t\t\tgroupVersionResource := schema.GroupVersionResource{\n\t\t\t\t\tResource: matchingServerResource.Name,\n\t\t\t\t\tGroup: matchingServerResource.Group,\n\t\t\t\t\tVersion: matchingServerResource.Version,\n\t\t\t\t}\n\t\t\t\tlogger.V(6).Info(\"gv with resource\", \"groupVersionResource\", groupVersionResource)\n\t\t\t\treturn &matchingServerResource, nil, groupVersionResource, nil\n\t\t\t}\n\t\t}\n\t}\n\n\treturn nil, nil, schema.GroupVersionResource{}, fmt.Errorf(\"kind '%s' not found in groupVersion '%s'\", kind, groupVersion)\n}", "title": "" }, { "docid": "c7a4adab1e734bbc941b63715073fc3a", "score": "0.48999655", "text": "func (r ApiGetHyperflexNodeListRequest) Select_(select_ string) ApiGetHyperflexNodeListRequest {\n\tr.select_ = &select_\n\treturn r\n}", "title": "" }, { "docid": "111cb5847c9bd8d27f0e4c5d0ec423a5", "score": "0.48977125", "text": "func (r ApiGetHyperflexAlarmListRequest) Select_(select_ string) ApiGetHyperflexAlarmListRequest {\n\tr.select_ = &select_\n\treturn r\n}", "title": "" }, { "docid": "998f2d20433b0b2ff784356a313827d6", "score": "0.4890539", "text": "func (r ApiGetHyperflexHwCatalogListRequest) Select_(select_ string) ApiGetHyperflexHwCatalogListRequest {\n\tr.select_ = &select_\n\treturn r\n}", "title": "" }, { "docid": "206707dbaa17b4149b6c6f9e995da5f9", "score": "0.4889821", "text": "func askSelect(message string, options []string, response interface{}) error {\n\treturn survey.AskOne(&survey.Select{\n\t\tMessage: message,\n\t\tOptions: options,\n\t}, response, nil)\n}", "title": "" }, { "docid": "a1963871bb83299eb2501d7afd379dba", "score": "0.48773044", "text": "func (m *EducationSubmissionResource) GetResource()(EducationResourceable) {\n val, err := m.GetBackingStore().Get(\"resource\")\n if err != nil {\n panic(err)\n }\n if val != nil {\n return val.(EducationResourceable)\n }\n return nil\n}", "title": "" }, { "docid": "f5412c1a393d839d4c8678edcafbb417", "score": "0.4872024", "text": "func PrepareResource(client client.Client, request reconcile.Request, resource mdbv1.AtlasCustomResource, log *zap.SugaredLogger) workflow.Result {\n\terr := client.Get(context.Background(), request.NamespacedName, resource)\n\tif err != nil {\n\t\tif apiErrors.IsNotFound(err) {\n\t\t\t// Request object not found, could have been deleted after reconcile request.\n\t\t\t// Return and don't requeue\n\t\t\tlog.Debugf(\"Object %s doesn't exist, was it deleted after reconcile request?\", request.NamespacedName)\n\t\t\treturn workflow.TerminateSilently().WithoutRetry()\n\t\t}\n\t\t// Error reading the object - requeue the request. Note, that we don't intend to update resource status\n\t\t// as most of all it will fail as well.\n\t\tlog.Errorf(\"Failed to query object %s: %s\", request.NamespacedName, err)\n\t\treturn workflow.TerminateSilently()\n\t}\n\n\treturn workflow.OK()\n}", "title": "" }, { "docid": "de8702bc1410c0ef53b3ea95ccb0b1a6", "score": "0.48705474", "text": "func (yad *yandexDisk) GetResource(path string, fields []string, limit int, offset int, previewCrop bool, previewSize string, sort string) (r *Resource, e error) {\n\treq, e := yad.getResource(\"\", path, fields, limit, offset, previewCrop, previewSize, sort)\n\tif e != nil {\n\t\treturn nil, e\n\t}\n\n\tr = new(Resource)\n\t_, e = yad.client.getResponse(req, &r)\n\tif e != nil {\n\t\treturn nil, e\n\t}\n\treturn\n}", "title": "" }, { "docid": "4c7b786c5b4d23afe557ddefb20a5b66", "score": "0.48695633", "text": "func (_ *Index) Options(resource *restish.Resource, action string) (*restish.Resource, restish.StatusCode) {\n\tswitch {\n\tcase restish.ActionRead == action:\n\t\treturn resource, restish.StatusOk\n\n\t}\n\n\treturn resource, restish.StatusUnauthorized\n}", "title": "" }, { "docid": "67279e81be22bf1baa16bb386f0f00ea", "score": "0.48666295", "text": "func Resource(res string) Option {\n\treturn func(g *Generator) {\n\t\tg.Resource = res\n\t}\n}", "title": "" }, { "docid": "a77f776193cb0ac11ff10c6808b9e237", "score": "0.48657358", "text": "func resourceManager(askFor chan ResourceRequest, giveBack chan Resource) {\n\n\tres := Resource{}\n\tbusy := false\n\tqueue := PriorityQueue{}\n\n\tfor {\n\t\tselect {\n\t\tcase request := <-askFor:\n\t\t\tif busy == false {\n\t\t\t\tqueue.Insert(request, request.priority)\n\t\t\t\tif queue.Front() == request {\n\t\t\t\t\trequest.channel <- res\n\t\t\t\t\tbusy = true\n\t\t\t\t\tqueue.PopFront()\n\n\t\t\t\t}\n\t\t\t}\n\t\t\tbusy = false\n\n\t\tcase res = <-giveBack:\n\t\t\t//This one should lead to us getting the correct order of stuff I think\n\t\t\t//if busy == false {\n\t\t\tif !queue.Empty() {\n\t\t\t\tfirst_value := queue.Front() // //(ResourceRequest)\n\t\t\t\tfirst_value_id := first_value.(ResourceRequest).id //get id out now! :D\n\t\t\t\tfirst_value_channel := first_value.(ResourceRequest).channel\n\n\t\t\t\tfor i := 0; i < len(res.value); i++ {\n\t\t\t\t\tif first_value_id == res.value[i] {\n\t\t\t\t\t\tfirst_value_channel <- res\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t\t//}\n\t\t\t/*\n\t\t\t\t\tfor i := 0; i < len(res.value); i++ {\n\t\t\t\t\t\tif first_value_id == res.value[i] {\n\t\t\t\t\t\t\tbusy = true //avoid race conditions\n\t\t\t\t\t\t\tqueue.PopFront()\n\t\t\t\t\t\t\tbusy = false\n\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\tif !queue.Empty() {\n\t\t\t\t\tfirst_value_channel := queue.queue[0].val.(ResourceRequest).channel\n\t\t\t\t\tfirst_value_channel <- res\n\n\t\t\t\t}\n\t\t\t*/\n\n\t\t}\n\n\t}\n\n}", "title": "" }, { "docid": "517b3ac97bcf24c727c068ea8fe5e57f", "score": "0.48543257", "text": "func (r ApiGetHyperflexCapabilityInfoListRequest) Select_(select_ string) ApiGetHyperflexCapabilityInfoListRequest {\n\tr.select_ = &select_\n\treturn r\n}", "title": "" }, { "docid": "579959fe6cf9399c4ebdd9e00cf1eb18", "score": "0.484989", "text": "func (m *EducationAssignmentItemRequestBuilder) ResourcesById(id string)(*i37bd40aa3d07e5fb03511b981c264fa6dcad03889d85b2483191049178483b0d.EducationAssignmentResourceItemRequestBuilder) {\n urlTplParams := make(map[string]string)\n for idx, item := range m.pathParameters {\n urlTplParams[idx] = item\n }\n if id != \"\" {\n urlTplParams[\"educationAssignmentResource%2Did\"] = id\n }\n return i37bd40aa3d07e5fb03511b981c264fa6dcad03889d85b2483191049178483b0d.NewEducationAssignmentResourceItemRequestBuilderInternal(urlTplParams, m.requestAdapter);\n}", "title": "" }, { "docid": "fb39ea1e664ab797b45b794c55f53d7c", "score": "0.48421142", "text": "func (r ApiGetBulkSubRequestObjListRequest) Select_(select_ string) ApiGetBulkSubRequestObjListRequest {\n\tr.select_ = &select_\n\treturn r\n}", "title": "" }, { "docid": "1c3807c6218738f34b54b6905992d12c", "score": "0.48379752", "text": "func uniarySelect(client pbclient.MySpannerClient) error {\n\tfmt.Println(\"performing uniary select\")\n\tres, err := client.UniarySelect(ctx, &pb.ExampleTable{Id: int64(5), Name: \"bananas\"})\n\tif err != nil {\n\t\treturn err\n\t}\n\tfmt.Printf(\"recieved res: %+v\\n\\n\", res)\n\treturn nil\n}", "title": "" }, { "docid": "a98f47380190bcdd900ad8a9c069b6aa", "score": "0.48317733", "text": "func (r ApiGetHyperflexVolumeListRequest) Select_(select_ string) ApiGetHyperflexVolumeListRequest {\n\tr.select_ = &select_\n\treturn r\n}", "title": "" }, { "docid": "1456b8295bf2536d96426f1208df282d", "score": "0.48277444", "text": "func selectHandler(w http.ResponseWriter, r *http.Request) {\n\n\tdata := page{Title: \"School Database\", Header: \"What type would you like to create?\"}\n\ttemplateInit(w, \"select.html\", data)\n\n}", "title": "" }, { "docid": "7595a1e75f38dc3391de2d40223acee6", "score": "0.48212457", "text": "func (opts resourceOptions) newResource() *resource.Resource {\n\treturn &resource.Resource{\n\t\tGVK: resource.GVK{ // Remove whitespaces to prevent values like \" \" pass validation\n\t\t\tGroup: strings.TrimSpace(opts.Group),\n\t\t\tDomain: strings.TrimSpace(opts.Domain),\n\t\t\tVersion: strings.TrimSpace(opts.Version),\n\t\t\tKind: strings.TrimSpace(opts.Kind),\n\t\t},\n\t\tPlural: resource.RegularPlural(opts.Kind),\n\t\tAPI: &resource.API{},\n\t\tWebhooks: &resource.Webhooks{},\n\t}\n}", "title": "" }, { "docid": "e672ffce79d9957700ba30b22c031210", "score": "0.4811682", "text": "func (m *ProgramControl) SetResource(value ProgramResourceable)() {\n err := m.GetBackingStore().Set(\"resource\", value)\n if err != nil {\n panic(err)\n }\n}", "title": "" }, { "docid": "f49628631195ee41f26ae2872df6e044", "score": "0.480496", "text": "func (r ApiGetHyperflexDriveListRequest) Select_(select_ string) ApiGetHyperflexDriveListRequest {\n\tr.select_ = &select_\n\treturn r\n}", "title": "" }, { "docid": "96c4705690274f2ce973e3f8e604eadb", "score": "0.48036638", "text": "func (m *EducationAssignmentItemRequestBuilder) Resources()(*i88086f8017be5762df8cc58a527cb8b9ece6f57e0c9ce6c6a7b1682cb8a238cc.ResourcesRequestBuilder) {\n return i88086f8017be5762df8cc58a527cb8b9ece6f57e0c9ce6c6a7b1682cb8a238cc.NewResourcesRequestBuilderInternal(m.pathParameters, m.requestAdapter);\n}", "title": "" }, { "docid": "096d7d1c0415d8a05af2ed611ecbf48b", "score": "0.4798763", "text": "func (r *Router) Resource(pattern string, resource Resource) {\n\tsub := r.Group(pattern)\n\n\tif usesRes, ok := resource.(ResourceUses); ok {\n\t\tif len(usesRes.Uses()) > 0 {\n\t\t\tsub.Use(usesRes.Uses()...)\n\t\t}\n\t}\n\n\tfor _, m := range allowedHTTPMethods {\n\t\tif hfn, ok := isHandlerFuncInResource(m, resource); ok {\n\t\t\ts := sub.Subrouter()\n\t\t\tif mws, ok := isMiddlewareInResource(m, resource); ok {\n\t\t\t\ts.Use(mws()...)\n\t\t\t}\n\t\t\ts.HandleFunc(m, \"/\", hfn)\n\t\t}\n\t}\n}", "title": "" }, { "docid": "c157c4164c08abaf228eb238c81ca645", "score": "0.47891778", "text": "func testResource(t *testing.T, s *Service) {\n\tp := &model.ArgRes{\n\t\tResID: 1233,\n\t}\n\tres, err := s.Resource(context.TODO(), p)\n\tif err != nil {\n\t\tt.Logf(\"testResource error(%v) \\n\", err)\n\t\treturn\n\t}\n\tt.Logf(\"testResource res: %+v \\n\", res)\n}", "title": "" }, { "docid": "376e3b3019456d51ccf936761c7998e8", "score": "0.47853243", "text": "func (t *Transaction) Resource() rsrc.Resource {\n\treturn t.res\n}", "title": "" }, { "docid": "7f895752732bf2511b2c39352a456396", "score": "0.47813284", "text": "func (b *AccessReviewRequestBuilder) ResourceType(value string) *AccessReviewRequestBuilder {\n\tb.resourceType = value\n\tb.bitmap_ |= 32\n\treturn b\n}", "title": "" }, { "docid": "72bbaa1ce7cf2d5f59d087921a409ce5", "score": "0.4771949", "text": "func findSubresource(groupVersion, parentResourceName, subresource, kind string, serverResourcesList []*metav1.APIResourceList) (\n\tapiResource *metav1.APIResource, gvr schema.GroupVersionResource, err error,\n) {\n\tfor _, serverResourceList := range serverResourcesList {\n\t\tif groupVersion == \"\" || kubeutils.GroupVersionMatches(groupVersion, serverResourceList.GroupVersion) {\n\t\t\tfor _, serverResource := range serverResourceList.APIResources {\n\t\t\t\tif serverResource.Name == parentResourceName+\"/\"+strings.ToLower(subresource) {\n\t\t\t\t\tlogger.V(6).Info(\"matched API resource to kind\", \"apiResource\", serverResource, \"kind\", kind)\n\n\t\t\t\t\tserverResourceGv := getServerResourceGroupVersion(serverResourceList.GroupVersion, serverResource.Group, serverResource.Version)\n\t\t\t\t\tgv, _ := schema.ParseGroupVersion(serverResourceGv)\n\n\t\t\t\t\tserverResource.Group = gv.Group\n\t\t\t\t\tserverResource.Version = gv.Version\n\n\t\t\t\t\tgroupVersionResource := gv.WithResource(serverResource.Name)\n\t\t\t\t\tlogger.V(6).Info(\"gv with resource\", \"gvWithResource\", groupVersionResource)\n\t\t\t\t\treturn &serverResource, groupVersionResource, nil\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\n\treturn nil, schema.GroupVersionResource{}, fmt.Errorf(\"resource not found for kind %s\", kind)\n}", "title": "" }, { "docid": "f3c981f10657193273b20701a53eea71", "score": "0.47719467", "text": "func gvkForFlags(f *flag.FlagSet) *resource.Resource {\n\tr := &resource.Resource{}\n\tf.StringVar(&r.Group, \"group\", \"\", \"resource Group\")\n\tf.StringVar(&r.Version, \"version\", \"\", \"resource Version\")\n\tf.StringVar(&r.Kind, \"kind\", \"\", \"resource Kind\")\n\tf.StringVar(&r.Resource, \"resource\", \"\", \"resource Resource\")\n\treturn r\n}", "title": "" }, { "docid": "919e746d011b9d467beef501323e3fa4", "score": "0.47694513", "text": "func (r ApiGetHyperflexIscsiNetworkListRequest) Select_(select_ string) ApiGetHyperflexIscsiNetworkListRequest {\n\tr.select_ = &select_\n\treturn r\n}", "title": "" }, { "docid": "fb36ef06b2a517940126c00a29c59201", "score": "0.47655302", "text": "func (r ApiGetBulkRequestListRequest) Select_(select_ string) ApiGetBulkRequestListRequest {\n\tr.select_ = &select_\n\treturn r\n}", "title": "" }, { "docid": "940af96d3c6f1e415c9edabb1547df28", "score": "0.47646496", "text": "func (c *Company) Select(id string) error {\n\n\t// Chekc if all is digit or letter\n\t// sanitarize(id)\n\n\tuid, err := uuid.FromString(id)\n\tif err != nil {\n\t\tlog.Println(\"uuid.FromString Error ->\", err)\n\t\treturn err\n\t}\n\n\t// SELECT * FROM users WHERE id = id;\n\tresult := initdb.DbInstance.First(&c, uid)\n\tif result.Error == nil {\n\t\tinitdb.DbInstance.Preload(clause.Associations).Find(c)\n\t}\n\n\treturn result.Error\n}", "title": "" }, { "docid": "c91f2f883d1ae0a4ff735c52c8a2ef60", "score": "0.47637486", "text": "func (w *Strap) checkResource(req *Request) (*Resource, error) {\n\n\tfor key, r := range w.resources {\n\t\tfor _, rr := range *r {\n\t\t\tif key == req.Name && rr.Method == strings.ToUpper(req.Method) {\n\t\t\t\treturn rr, nil\n\t\t\t}\n\t\t}\n\t}\n\treturn nil, errors.New(\"Invalid resource or method\")\n}", "title": "" }, { "docid": "7789d7a6257bd23cd38d431094a18c64", "score": "0.47583655", "text": "func (handler GetLiquidityPoolByIDHandler) GetResource(w HeaderWriter, r *http.Request) (interface{}, error) {\n\tctx := r.Context()\n\tqp := LiquidityPoolQuery{}\n\terr := getParams(&qp, r)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\thistoryQ, err := horizonContext.HistoryQFromRequest(r)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\tcb, err := historyQ.FindLiquidityPoolByID(ctx, qp.ID)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\tledger := &history.Ledger{}\n\terr = historyQ.LedgerBySequence(ctx, ledger, int32(cb.LastModifiedLedger))\n\tif historyQ.NoRows(err) {\n\t\tledger = nil\n\t} else if err != nil {\n\t\treturn nil, errors.Wrap(err, \"LedgerBySequence error\")\n\t}\n\n\tvar resource protocol.LiquidityPool\n\terr = resourceadapter.PopulateLiquidityPool(ctx, &resource, cb, ledger)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\treturn resource, nil\n}", "title": "" }, { "docid": "3a5cd8f14372f03e4741e29886719edd", "score": "0.4756959", "text": "func (v FaturasResource) Edit(c buffalo.Context) error {\n\treturn c.Error(404, errors.New(\"not available\"))\n}", "title": "" }, { "docid": "74a9723b2f5412fb22b754b533183fc9", "score": "0.4755801", "text": "func (r ApiGetHyperflexLunListRequest) Select_(select_ string) ApiGetHyperflexLunListRequest {\n\tr.select_ = &select_\n\treturn r\n}", "title": "" }, { "docid": "6ed8f2c6111d59c96656a1bef7405e76", "score": "0.4750657", "text": "func ChooseMesh(nsr options.NsResourceMap) (core.ResourceRef, error) {\n\n\tmeshOptions, meshMap := generateMeshSelectOptions(nsr)\n\tif len(meshOptions) == 0 {\n\t\treturn core.ResourceRef{}, fmt.Errorf(\"No meshs found. Please create a mesh\")\n\t}\n\n\tquestion := &survey.Select{\n\t\tMessage: \"Select a mesh\",\n\t\tOptions: meshOptions,\n\t}\n\n\tvar choice string\n\tif err := survey.AskOne(question, &choice, survey.Required); err != nil {\n\t\t// this should not error\n\t\tfmt.Println(\"error with input\")\n\t\treturn core.ResourceRef{}, err\n\t}\n\n\treturn meshMap[choice].resourceRef, nil\n}", "title": "" }, { "docid": "cd21e95ea43c0b9b9c606cd730ec5073", "score": "0.47471973", "text": "func (f *Finding) Resource() string {\n\taff := f.etd.JSONPayload.AffectedResources\n\tif len(aff) == 0 {\n\t\treturn \"\"\n\t}\n\tm := extractResource.FindStringSubmatch(aff[0].GCPResourceName)\n\tif m == nil {\n\t\treturn \"\"\n\t}\n\treturn m[1]\n\n}", "title": "" }, { "docid": "d7c1344d3425c4cd194449caa1bead97", "score": "0.47349298", "text": "func setResource(alloc types.ResourceList, res map[string]int64, grpres map[string]int64) {\n\t// set resource\n\tfor key, val := range res {\n\t\tsetRes(alloc, key, val)\n\t}\n\t// set group resource\n\tfor key, val := range grpres {\n\t\tsetGrpRes(alloc, key, val)\n\t}\n}", "title": "" }, { "docid": "284338fc0932587368441705922037d1", "score": "0.47299686", "text": "func (q foreignLegalResourceQuery) One(ctx context.Context, exec boil.ContextExecutor) (*ForeignLegalResource, error) {\n\to := &ForeignLegalResource{}\n\n\tqueries.SetLimit(q.Query, 1)\n\n\terr := q.Bind(ctx, exec, 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, \"models: failed to execute a one query for ForeignLegalResources\")\n\t}\n\n\treturn o, nil\n}", "title": "" }, { "docid": "a76e8be7403b24fc2b1f7bef6c58e90d", "score": "0.47283712", "text": "func (t *Table) selectRow(ri int) {\r\n\r\n\ttrow := t.rows[ri]\r\n\ttrow.selected = true\r\n\tt.Dispatch(OnChange, nil)\r\n}", "title": "" }, { "docid": "895234152217cc8a4b738f06cc8531ec", "score": "0.47260287", "text": "func ResourceShortFormFor(resource string) (string, bool) {\n\tvar alias string\n\texists := false\n\tfor _, item := range ResourcesShortcutStatic {\n\t\tif item.LongForm.Resource == resource {\n\t\t\talias = item.ShortForm.Resource\n\t\t\texists = true\n\t\t\tbreak\n\t\t}\n\t}\n\treturn alias, exists\n}", "title": "" }, { "docid": "b3bf0aef4c37dc4a372a4bb8bf343355", "score": "0.4717043", "text": "func (jid JID) Resource() string {\n\tif i := strings.Index(string(jid), \"/\"); i != -1 {\n\t\treturn string(jid[i+1:])\n\t}\n\treturn \"\"\n}", "title": "" }, { "docid": "17575484028508f42258cb5eeaabdc7f", "score": "0.47147653", "text": "func createObjectPicker(n int64, distrib string) (ObjectSelector, error) {\n\n\tswitch distrib {\n\tcase ZIPFIAN_OBJECT_PICK:\n\t\tvar x = new(Zipf)\n\t\tx.SetParams(n, 0.8, 99)\n\t\treturn x, nil\n\tcase UNIFORM_OBJECT_PICK:\n\t\tvar y = new(Uniform)\n\t\ty.SetParams(n, 99)\n\t\treturn y, nil\n\t}\n\n\tfmt.Println(\"what is the distribution :\", distrib)\n\treturn new(Uniform), errors.New(\"Not a valid distribution for object selection\")\n}", "title": "" }, { "docid": "57c209a6191b531aa4cecb8217c8d28b", "score": "0.47108158", "text": "func (r ApiGetHyperflexSoftwareDistributionEntryListRequest) Select_(select_ string) ApiGetHyperflexSoftwareDistributionEntryListRequest {\n\tr.select_ = &select_\n\treturn r\n}", "title": "" }, { "docid": "db70111ec5b10ca5127afb6ce0c5d9f6", "score": "0.4706498", "text": "func (c Clients) Select(ctx context.Context, db int) error {\n\treq := newRequest(\"*2\\r\\n$6\\r\\nSELECT\\r\\n$\")\n\treq.int(int64(db))\n\treturn c.c.cmdSimple(ctx, req)\n}", "title": "" }, { "docid": "d140ebe132a4f4a2a3626f1f25462730", "score": "0.4705027", "text": "func (c *Client) ReceiveResource(method, path, resourceType, resourceVersion string) (interfaces.Resource, error) {\n\n\treq, err := http.NewRequest(method, c.Scheme+\"://\"+c.Address+path, nil)\n\n\treq.Header.Set(\n\t\t\"Content-Type\",\n\t\tmime.FormatMediaType(\n\t\t\tfmt.Sprintf(\"%s+%s\", resourceType, \"json\"),\n\t\t\tmap[string]string{\"version\": resourceVersion},\n\t\t),\n\t)\n\n\tclient := cleanhttp.DefaultClient()\n\tresp, err := client.Do(req)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\tmediaType, err := helpers.NewMediaType(resp.Header.Get(\"Content-Type\"))\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\tresource, err := factory.Require(mediaType.Type, mediaType.Version)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\terr = decodeBody(resp, &resource)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\treturn resource, nil\n}", "title": "" }, { "docid": "0da16ca0e1e8ccab1fe472f3120a802c", "score": "0.47048625", "text": "func (r ApiGetHyperflexServerModelListRequest) Select_(select_ string) ApiGetHyperflexServerModelListRequest {\n\tr.select_ = &select_\n\treturn r\n}", "title": "" }, { "docid": "5fd2bf6756464a0de12273b4fba7c4ad", "score": "0.47014514", "text": "func (m *DeviceManagementRequestBuilder) ResourceOperationsById(id string)(*i33db959724eee2740c1918f5227e5ccdeb2c6a3b9d32f0aa3121e2994bcf87c6.ResourceOperationItemRequestBuilder) {\n urlTplParams := make(map[string]string)\n for idx, item := range m.pathParameters {\n urlTplParams[idx] = item\n }\n if id != \"\" {\n urlTplParams[\"resourceOperation%2Did\"] = id\n }\n return i33db959724eee2740c1918f5227e5ccdeb2c6a3b9d32f0aa3121e2994bcf87c6.NewResourceOperationItemRequestBuilderInternal(urlTplParams, m.requestAdapter);\n}", "title": "" }, { "docid": "31ebc88346c72b05ef52961770a72d17", "score": "0.47008693", "text": "func (s *BasevhdlListener) EnterSelected_name(ctx *Selected_nameContext) {}", "title": "" }, { "docid": "3fa2d6265b789dc642b43cd9d5cb6a2c", "score": "0.46997342", "text": "func (r ApiGetBulkResultListRequest) Select_(select_ string) ApiGetBulkResultListRequest {\n\tr.select_ = &select_\n\treturn r\n}", "title": "" }, { "docid": "f24bef91f748a6f89cc3094aee095908", "score": "0.46961117", "text": "func (s *ResourceScope) Resource(resource string) *ResourceScope {\n\ts.resource = resource\n\treturn s\n}", "title": "" }, { "docid": "d0d25d26682368c46979938983ef45bc", "score": "0.46953446", "text": "func (c *podConverter) Resource() string {\n\treturn c.podResource\n}", "title": "" }, { "docid": "f13667736bc680002c56f998d9a04a62", "score": "0.4690884", "text": "func (r ApiGetHyperflexAutoSupportPolicyListRequest) Select_(select_ string) ApiGetHyperflexAutoSupportPolicyListRequest {\n\tr.select_ = &select_\n\treturn r\n}", "title": "" }, { "docid": "d7dfa127107be4dd5a2abb8f878b0a6d", "score": "0.46871132", "text": "func findResourceSecuredBy(r *raml.Resource) []raml.DefinitionChoice {\n\tif len(r.SecuredBy) > 0 {\n\t\treturn r.SecuredBy\n\t}\n\tif r.Parent == nil {\n\t\treturn []raml.DefinitionChoice{}\n\t}\n\treturn findResourceSecuredBy(r.Parent)\n}", "title": "" }, { "docid": "77417a80ca98c1065f11fe7952f7ec2a", "score": "0.4686516", "text": "func (c *CreateRedfishResource) CommandType() eh.CommandType { return CreateRedfishResourceCommand }", "title": "" }, { "docid": "196ac32f933053d404c1ff4d9834ba35", "score": "0.46829554", "text": "func ResourceId(w http.ResponseWriter, params martini.Params, m martini.Context) {\n\tid, err := strconv.ParseInt(params[\"id\"], 10, 64)\n\n\tif err != nil || id < 1 {\n\t\thttp.Error(w, \"Unprocessable Entity\", 422)\n\t}\n\n\tm.Map(IdParameter{Id: id})\n}", "title": "" }, { "docid": "95c066bd54e0ffc1478631af2cbecb8d", "score": "0.4682247", "text": "func renderSelect() error {\n\tview, err := g.View(ViewSelect)\n\tif err != nil {\n\t\treturn err\n\t}\n\n\tdbs, err := getDatabases()\n\tif err != nil {\n\t\treturn err\n\t}\n\n\tview.Title = fmt.Sprintf(\"Index (0~%d)\", dbs-1)\n\tview.Frame = true\n\tview.Editable = true\n\tview.Write([]byte(strconv.Itoa(client.Options().DB)))\n\treturn nil\n}", "title": "" }, { "docid": "d16563fdceb14487e2475459c4b143d7", "score": "0.46792662", "text": "func (r ApiGetHyperflexSoftwareDistributionVersionListRequest) Select_(select_ string) ApiGetHyperflexSoftwareDistributionVersionListRequest {\n\tr.select_ = &select_\n\treturn r\n}", "title": "" }, { "docid": "d631d040f874d78901024aa71bc2cc25", "score": "0.4669969", "text": "func (r ApiGetHyperflexSoftwareDistributionComponentListRequest) Select_(select_ string) ApiGetHyperflexSoftwareDistributionComponentListRequest {\n\tr.select_ = &select_\n\treturn r\n}", "title": "" }, { "docid": "c9771ad4989c1f5c1edd0f1c30e87932", "score": "0.46697438", "text": "func (service *Service) ResourceControl(ID portainer.ResourceControlID) (*portainer.ResourceControl, error) {\n\tvar resourceControl portainer.ResourceControl\n\tidentifier := service.connection.ConvertToKey(int(ID))\n\n\terr := service.connection.GetObject(BucketName, identifier, &resourceControl)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\treturn &resourceControl, nil\n}", "title": "" }, { "docid": "fae70c6821440a56d9231107a6545c7c", "score": "0.4669686", "text": "func (dao *Dao) SelectOne(ctx context.Context, id interface{}, opts ...options.SelectOption) (interface{}, error) {\n\tif len(dao.primaries) != 1 {\n\t\tpanic(\"SelectOne only support single primary key model: \" + dao.table)\n\t}\n\treturn dao.SelectOneByCondition(ctx,\n\t\t(&Query{}).\n\t\t\tEqual(dao.primaries[0].Name, id).\n\t\t\tLimit(1).\n\t\t\tData(),\n\t\topts...)\n}", "title": "" }, { "docid": "0b0488fa71be9b01376f68edbeb97670", "score": "0.46694714", "text": "func (c *Client) Select(dbname string) (client *Client, err error) {\n\tc.mux.RLock()\n\tif c.config.IsEqualDB(dbname) {\n\t\tc.mux.RUnlock()\n\n\t\treturn c, nil\n\t}\n\n\tconfig, err := c.config.NewWithDB(dbname)\n\tif err != nil {\n\t\tc.mux.RUnlock()\n\t\treturn\n\t}\n\n\tname := config.Name()\n\n\t// first, try loading a client from default manager\n\tclient, err = DefaultMgr.NewClientWithLogger(name)\n\tif err == nil {\n\t\tc.mux.RUnlock()\n\n\t\treturn client, nil\n\t}\n\n\tc.mux.RUnlock()\n\n\t// second, register new client for default manager\n\tc.mux.Lock()\n\tdefer c.mux.Unlock()\n\n\tDefaultMgr.Add(name, config)\n\n\treturn DefaultMgr.NewClientWithLogger(name)\n}", "title": "" }, { "docid": "f0d77b4d278054f0622462aa5c014760", "score": "0.4665997", "text": "func (c *FakeClient) Resource(resource *metav1.APIResource, namespace string) dynamic.ResourceInterface {\n\treturn &FakeResourceClient{\n\t\tFakeResourceClient: &dynamic_fake.FakeResourceClient{\n\t\t\tResource: c.GroupVersion.WithResource(resource.Name),\n\t\t\tKind: c.GroupVersion.WithKind(resource.Kind),\n\t\t\tNamespace: namespace,\n\n\t\t\tFake: c.Fake,\n\t\t},\n\t}\n}", "title": "" } ]
b21c4cb12bee8c645f5dda1954c44207
DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object.
[ { "docid": "b28c08dc37afc54ae9f1778043743fda", "score": "0.0", "text": "func (in *PizzaOrderList) DeepCopyObject() runtime.Object {\n\tif c := in.DeepCopy(); c != nil {\n\t\treturn c\n\t}\n\treturn nil\n}", "title": "" } ]
[ { "docid": "acaba9a6c8a5246bafe5f9dd357705c8", "score": "0.73405945", "text": "func (s *Source) DeepCopyObject() runtime.Object { return s }", "title": "" }, { "docid": "241a8087e36454e7c1e06dd8ce3ff05b", "score": "0.7202904", "text": "func (in *KuryrPort) DeepCopyObject() runtime.Object {\n\tif c := in.DeepCopy(); c != nil {\n\t\treturn c\n\t}\n\treturn nil\n}", "title": "" }, { "docid": "4791ae821659297d3908584f6f17a09c", "score": "0.7158322", "text": "func (d DirRes) DeepCopyObject() runtime.Object {\n\treturn d\n}", "title": "" }, { "docid": "152d33648c372c07416101826c5e9042", "score": "0.71076214", "text": "func (in *KobeUtil) DeepCopyObject() runtime.Object {\n\tif c := in.DeepCopy(); c != nil {\n\t\treturn c\n\t}\n\treturn nil\n}", "title": "" }, { "docid": "3347ef85eeed487752f2af5ad6f8cccc", "score": "0.7101636", "text": "func (in *Run) DeepCopyObject() runtime.Object {\n\tif c := in.DeepCopy(); c != nil {\n\t\treturn c\n\t}\n\treturn nil\n}", "title": "" }, { "docid": "3347ef85eeed487752f2af5ad6f8cccc", "score": "0.7101636", "text": "func (in *Run) DeepCopyObject() runtime.Object {\n\tif c := in.DeepCopy(); c != nil {\n\t\treturn c\n\t}\n\treturn nil\n}", "title": "" }, { "docid": "8bea899071433eee30c261819694a176", "score": "0.710064", "text": "func (in *Console) DeepCopyObject() runtime.Object {\n\tif c := in.DeepCopy(); c != nil {\n\t\treturn c\n\t}\n\treturn nil\n}", "title": "" }, { "docid": "21cbfd2584e847f4087af6094895c42c", "score": "0.7070077", "text": "func (in *Binding) DeepCopyObject() runtime.Object {\n\tif c := in.DeepCopy(); c != nil {\n\t\treturn c\n\t}\n\treturn nil\n}", "title": "" }, { "docid": "21cbfd2584e847f4087af6094895c42c", "score": "0.7070077", "text": "func (in *Binding) DeepCopyObject() runtime.Object {\n\tif c := in.DeepCopy(); c != nil {\n\t\treturn c\n\t}\n\treturn nil\n}", "title": "" }, { "docid": "47cfd60c2e3320c421dd9e7f5a813e27", "score": "0.70326", "text": "func (in *Cmd) DeepCopyObject() runtime.Object {\n\tif c := in.DeepCopy(); c != nil {\n\t\treturn c\n\t}\n\treturn nil\n}", "title": "" }, { "docid": "8494701d2b3ddcb31d6826c7675c4c16", "score": "0.702083", "text": "func (in *KnativeServing) DeepCopyObject() runtime.Object {\n\tif c := in.DeepCopy(); c != nil {\n\t\treturn c\n\t}\n\treturn nil\n}", "title": "" }, { "docid": "92334c3f674342ee45d4712097fcf341", "score": "0.70040345", "text": "func (in *KnativeEventing) DeepCopyObject() runtime.Object {\n\tif c := in.DeepCopy(); c != nil {\n\t\treturn c\n\t}\n\treturn nil\n}", "title": "" }, { "docid": "83329c473f03a2ee6d4e8f96e33ad437", "score": "0.70022136", "text": "func (in *BobRCrypto) DeepCopyObject() runtime.Object {\n\tif c := in.DeepCopy(); c != nil {\n\t\treturn c\n\t}\n\treturn nil\n}", "title": "" }, { "docid": "508d951ccc9a87c01b02ea294dec1374", "score": "0.69990677", "text": "func (in *CmdList) DeepCopyObject() runtime.Object {\n\tif c := in.DeepCopy(); c != nil {\n\t\treturn c\n\t}\n\treturn nil\n}", "title": "" }, { "docid": "1f2c10a8c7e2cd94afd3fd2429c3e526", "score": "0.6982433", "text": "func (in *CustomRun) DeepCopyObject() runtime.Object {\n\tif c := in.DeepCopy(); c != nil {\n\t\treturn c\n\t}\n\treturn nil\n}", "title": "" }, { "docid": "703ce510ab996375b56b5a04c85a6e6a", "score": "0.6973454", "text": "func (in *Shell) DeepCopyObject() runtime.Object {\n\tif c := in.DeepCopy(); c != nil {\n\t\treturn c\n\t}\n\treturn nil\n}", "title": "" }, { "docid": "a1d4c6527b916e54ba0777a054d7629a", "score": "0.6971334", "text": "func (in *Extension) DeepCopyObject() runtime.Object {\n\tif c := in.DeepCopy(); c != nil {\n\t\treturn c\n\t}\n\treturn nil\n}", "title": "" }, { "docid": "fa8b271b63fa0f7c6f106fdd9611e58e", "score": "0.6968575", "text": "func (in *Chat) DeepCopyObject() runtime.Object {\n\tif c := in.DeepCopy(); c != nil {\n\t\treturn c\n\t}\n\treturn nil\n}", "title": "" }, { "docid": "b13b2703e1976f046ef0241cba49e4ae", "score": "0.6967205", "text": "func (in *FluentBit) DeepCopyObject() runtime.Object {\n\tif c := in.DeepCopy(); c != nil {\n\t\treturn c\n\t}\n\treturn nil\n}", "title": "" }, { "docid": "f5e2d5259425a2d848c1e40f99492fe0", "score": "0.69627887", "text": "func (in *Init) DeepCopyObject() runtime.Object {\n\tif c := in.DeepCopy(); c != nil {\n\t\treturn c\n\t}\n\treturn nil\n}", "title": "" }, { "docid": "e958a970d12d23d6cb04d77dac49544c", "score": "0.69549114", "text": "func (in *Linkerd) DeepCopyObject() runtime.Object {\n\tif c := in.DeepCopy(); c != nil {\n\t\treturn c\n\t}\n\treturn nil\n}", "title": "" }, { "docid": "030df03bc1795d6085beb84cf812c360", "score": "0.6952036", "text": "func (in *PipelineRun) DeepCopyObject() runtime.Object {\n\tif c := in.DeepCopy(); c != nil {\n\t\treturn c\n\t}\n\treturn nil\n}", "title": "" }, { "docid": "3a17afa781b57b77264d1e4d316ac2c0", "score": "0.69444335", "text": "func (s *SourceList) DeepCopyObject() runtime.Object { return s }", "title": "" }, { "docid": "f3569664d5fded86f406bd5d8b037f2a", "score": "0.694265", "text": "func (in *Portieris) DeepCopyObject() runtime.Object {\n\tif c := in.DeepCopy(); c != nil {\n\t\treturn c\n\t}\n\treturn nil\n}", "title": "" }, { "docid": "cd37f2d8c1a14a9eb06aa8283d2d4085", "score": "0.69384795", "text": "func DeepCopy(obj interface{}) interface{} {\n\told := reflect.ValueOf(obj)\n\tnew := reflect.New(old.Type()).Elem()\n\tdeepCopy(old, new)\n\treturn new.Interface()\n}", "title": "" }, { "docid": "73a94e66a3385f7708bb1c671f09024e", "score": "0.6935968", "text": "func (in *KuryrPortList) DeepCopyObject() runtime.Object {\n\tif c := in.DeepCopy(); c != nil {\n\t\treturn c\n\t}\n\treturn nil\n}", "title": "" }, { "docid": "15b2448cf38e0cb1faeb85e606ed1864", "score": "0.6934507", "text": "func (in *Emqx) DeepCopyObject() runtime.Object {\n\tif c := in.DeepCopy(); c != nil {\n\t\treturn c\n\t}\n\treturn nil\n}", "title": "" }, { "docid": "550df47f57cdc21858b01025458e4bff", "score": "0.69297725", "text": "func (in *Factory) DeepCopyObject() runtime.Object {\n\tif c := in.DeepCopy(); c != nil {\n\t\treturn c\n\t}\n\treturn nil\n}", "title": "" }, { "docid": "d097756ca1dc143ac33c8a53b94dc601", "score": "0.6929302", "text": "func (c *CreateParam) DeepCopyObject() runtime.Object {\n\treturn c.DeepCopy()\n}", "title": "" }, { "docid": "6aad13608341837dff05b17c368fc263", "score": "0.6922684", "text": "func (in *Core) DeepCopyObject() runtime.Object {\n\tif c := in.DeepCopy(); c != nil {\n\t\treturn c\n\t}\n\treturn nil\n}", "title": "" }, { "docid": "bf46547c850e22676d9bc76d04662e8f", "score": "0.6902613", "text": "func (in *ComputeVPNTunnel) DeepCopyObject() runtime.Object {\n\tif c := in.DeepCopy(); c != nil {\n\t\treturn c\n\t}\n\treturn nil\n}", "title": "" }, { "docid": "bf46547c850e22676d9bc76d04662e8f", "score": "0.6902613", "text": "func (in *ComputeVPNTunnel) DeepCopyObject() runtime.Object {\n\tif c := in.DeepCopy(); c != nil {\n\t\treturn c\n\t}\n\treturn nil\n}", "title": "" }, { "docid": "644b2b863f3be23d8f7f51c42978076e", "score": "0.6897308", "text": "func (in *ImageBinding) DeepCopyObject() runtime.Object {\n\tif c := in.DeepCopy(); c != nil {\n\t\treturn c\n\t}\n\treturn nil\n}", "title": "" }, { "docid": "76f5640d44aea582ff38cbd43bd79341", "score": "0.6894229", "text": "func (in *Leviathan) DeepCopyObject() runtime.Object {\n\tif c := in.DeepCopy(); c != nil {\n\t\treturn c\n\t}\n\treturn nil\n}", "title": "" }, { "docid": "45a5598e6febb2fcfe39b9dafcadfc76", "score": "0.68903047", "text": "func (in *Idler) DeepCopyObject() runtime.Object {\n\tif c := in.DeepCopy(); c != nil {\n\t\treturn c\n\t}\n\treturn nil\n}", "title": "" }, { "docid": "afa86e62e22250e961398ed4301bebcd", "score": "0.6888844", "text": "func (in *Call) DeepCopyObject() runtime.Object {\n\tif c := in.DeepCopy(); c != nil {\n\t\treturn c\n\t}\n\treturn nil\n}", "title": "" }, { "docid": "8e915b592e1cf16a649584de1058e2d8", "score": "0.6884798", "text": "func (in *RabbitVhost) DeepCopyObject() runtime.Object {\n\tif c := in.DeepCopy(); c != nil {\n\t\treturn c\n\t}\n\treturn nil\n}", "title": "" }, { "docid": "27331ed45a6ffd21fc86e203e455c3f4", "score": "0.68793887", "text": "func (in *Host) DeepCopyObject() runtime.Object {\n\tif c := in.DeepCopy(); c != nil {\n\t\treturn c\n\t}\n\treturn nil\n}", "title": "" }, { "docid": "27331ed45a6ffd21fc86e203e455c3f4", "score": "0.68793887", "text": "func (in *Host) DeepCopyObject() runtime.Object {\n\tif c := in.DeepCopy(); c != nil {\n\t\treturn c\n\t}\n\treturn nil\n}", "title": "" }, { "docid": "250e5a1ef46d2251671f8a6eed052d12", "score": "0.6875642", "text": "func (in *TestBindable) DeepCopyObject() runtime.Object {\n\tif c := in.DeepCopy(); c != nil {\n\t\treturn c\n\t}\n\treturn nil\n}", "title": "" }, { "docid": "1c8bfd881383e0d7074c046711e3dcf6", "score": "0.6875278", "text": "func (in *VirtualEnvironment) DeepCopyObject() runtime.Object {\n\tif c := in.DeepCopy(); c != nil {\n\t\treturn c\n\t}\n\treturn nil\n}", "title": "" }, { "docid": "9b670c60ccf1879954c943051cf3b348", "score": "0.68710285", "text": "func (in *Seed) DeepCopyObject() runtime.Object {\n\tif c := in.DeepCopy(); c != nil {\n\t\treturn c\n\t}\n\treturn nil\n}", "title": "" }, { "docid": "bb10ea74ad5524ff0457c32d3c978784", "score": "0.6869126", "text": "func (in *SlimCNP) DeepCopyObject() runtime.Object {\n\tif c := in.DeepCopy(); c != nil {\n\t\treturn c\n\t}\n\treturn nil\n}", "title": "" }, { "docid": "26982e53617e286f3ba7106bc605169d", "score": "0.686619", "text": "func (in *RuntimeComponent) DeepCopyObject() runtime.Object {\n\tif c := in.DeepCopy(); c != nil {\n\t\treturn c\n\t}\n\treturn nil\n}", "title": "" }, { "docid": "3cc1db4bcd86e808735592fbd459cfcc", "score": "0.68659633", "text": "func (in *Kubemanager) DeepCopyObject() runtime.Object {\n\tif c := in.DeepCopy(); c != nil {\n\t\treturn c\n\t}\n\treturn nil\n}", "title": "" }, { "docid": "74e9ed69e8e79c6ad0b1880d7a9748da", "score": "0.6862544", "text": "func (in *PeerAuthentication) DeepCopyObject() runtime.Object {\n\tif c := in.DeepCopy(); c != nil {\n\t\treturn c\n\t}\n\treturn nil\n}", "title": "" }, { "docid": "a4e4182e813a398c53684e49f41ac460", "score": "0.6860485", "text": "func (in *What) DeepCopyObject() runtime.Object {\n\treturn &What{Kind: in.Kind}\n}", "title": "" }, { "docid": "5735f86d576a39ee2ea96ed92fba38e1", "score": "0.6857798", "text": "func (in *ConsoleList) DeepCopyObject() runtime.Object {\n\tif c := in.DeepCopy(); c != nil {\n\t\treturn c\n\t}\n\treturn nil\n}", "title": "" }, { "docid": "cf6cbd33fd4ea9dc8a15f38ecb2bcc37", "score": "0.6856392", "text": "func (in *Refresh) DeepCopyObject() runtime.Object {\n\tif c := in.DeepCopy(); c != nil {\n\t\treturn c\n\t}\n\treturn nil\n}", "title": "" }, { "docid": "066d190a2b6aaf6754ff98dd1a44e55e", "score": "0.6850223", "text": "func (in *ClowdJobInvocation) DeepCopyObject() runtime.Object {\n\tif c := in.DeepCopy(); c != nil {\n\t\treturn c\n\t}\n\treturn nil\n}", "title": "" }, { "docid": "3de10c3fd4d74e04ad823a886fd5a87c", "score": "0.68494534", "text": "func (in *Space) DeepCopyObject() runtime.Object {\n\tif c := in.DeepCopy(); c != nil {\n\t\treturn c\n\t}\n\treturn nil\n}", "title": "" }, { "docid": "c68d502540815ca6fa49ee3aa63de6f8", "score": "0.6848895", "text": "func (in *Bytebase) DeepCopyObject() runtime.Object {\n\tif c := in.DeepCopy(); c != nil {\n\t\treturn c\n\t}\n\treturn nil\n}", "title": "" }, { "docid": "d6689aff40a8ffd552b67e4afc42a063", "score": "0.68485147", "text": "func (in *ProcChaos) DeepCopyObject() runtime.Object {\n\tif c := in.DeepCopy(); c != nil {\n\t\treturn c\n\t}\n\treturn nil\n}", "title": "" }, { "docid": "8930b1fdd2549ccb6fc862dbe87945f2", "score": "0.6847822", "text": "func (in *Receiver) DeepCopyObject() runtime.Object {\n\tif c := in.DeepCopy(); c != nil {\n\t\treturn c\n\t}\n\treturn nil\n}", "title": "" }, { "docid": "b51853a7af7d313744b03590cc699ee8", "score": "0.68445104", "text": "func (in *RunService) DeepCopyObject() runtime.Object {\n\tif c := in.DeepCopy(); c != nil {\n\t\treturn c\n\t}\n\treturn nil\n}", "title": "" }, { "docid": "edf5a50736e0ba8a3adc9c7f1327d272", "score": "0.68409836", "text": "func (in *Get) DeepCopyObject() runtime.Object {\n\tif c := in.DeepCopy(); c != nil {\n\t\treturn c\n\t}\n\treturn nil\n}", "title": "" }, { "docid": "dc474f34fe7aba299d9d2c975c695a89", "score": "0.684062", "text": "func (in *Win95) DeepCopyObject() runtime.Object {\n\tif c := in.DeepCopy(); c != nil {\n\t\treturn c\n\t}\n\treturn nil\n}", "title": "" }, { "docid": "3f6dab406e5e925e7dcfe451db442d2c", "score": "0.68405986", "text": "func (in *CrcBundle) DeepCopyObject() runtime.Object {\n\tif c := in.DeepCopy(); c != nil {\n\t\treturn c\n\t}\n\treturn nil\n}", "title": "" }, { "docid": "c36b5c25a4b945cb2e97c9451c5cfd21", "score": "0.68338346", "text": "func (in *PolarisBuildStep) DeepCopyObject() runtime.Object {\n\tif c := in.DeepCopy(); c != nil {\n\t\treturn c\n\t}\n\treturn nil\n}", "title": "" }, { "docid": "b40d62941763c1d416e9d31ab26c911f", "score": "0.6831092", "text": "func (in *Redis) DeepCopyObject() runtime.Object {\n\tif c := in.DeepCopy(); c != nil {\n\t\treturn c\n\t}\n\treturn nil\n}", "title": "" }, { "docid": "662cc69dc31cab4e7bde2e440db71c6a", "score": "0.6824305", "text": "func (in *ServiceBinding) DeepCopyObject() runtime.Object {\n\tif c := in.DeepCopy(); c != nil {\n\t\treturn c\n\t}\n\treturn nil\n}", "title": "" }, { "docid": "24e15e83ce04e8d91506b826811caaa3", "score": "0.6824197", "text": "func (in *BindingList) DeepCopyObject() runtime.Object {\n\tif c := in.DeepCopy(); c != nil {\n\t\treturn c\n\t}\n\treturn nil\n}", "title": "" }, { "docid": "24e15e83ce04e8d91506b826811caaa3", "score": "0.6824197", "text": "func (in *BindingList) DeepCopyObject() runtime.Object {\n\tif c := in.DeepCopy(); c != nil {\n\t\treturn c\n\t}\n\treturn nil\n}", "title": "" }, { "docid": "ba246ea026a951ac74cdaac1a6610b61", "score": "0.68216795", "text": "func (in *ForecastleApp) DeepCopyObject() runtime.Object {\n\tif c := in.DeepCopy(); c != nil {\n\t\treturn c\n\t}\n\treturn nil\n}", "title": "" }, { "docid": "f7c814f96f03eaf38c6e7c71f17f3ffb", "score": "0.6820062", "text": "func (in *Gogatekeeper) DeepCopyObject() runtime.Object {\n\tif c := in.DeepCopy(); c != nil {\n\t\treturn c\n\t}\n\treturn nil\n}", "title": "" }, { "docid": "4b175f176854292735cc32bb2aad6874", "score": "0.68172765", "text": "func (in *GlobalObject) DeepCopyObject() runtime.Object {\n\tif c := in.DeepCopy(); c != nil {\n\t\treturn c\n\t}\n\treturn nil\n}", "title": "" }, { "docid": "0b4fafdee82c8479e1c138e12b86e9d0", "score": "0.68172044", "text": "func (in *Chaos) DeepCopyObject() runtime.Object {\n\tif c := in.DeepCopy(); c != nil {\n\t\treturn c\n\t}\n\treturn nil\n}", "title": "" }, { "docid": "e4af30c09bc8aea04769fa13a3b2fc33", "score": "0.68150663", "text": "func (in *KuryrNetwork) DeepCopyObject() runtime.Object {\n\tif c := in.DeepCopy(); c != nil {\n\t\treturn c\n\t}\n\treturn nil\n}", "title": "" }, { "docid": "81ec9c7e50e902721ad3bf36f4c935cd", "score": "0.68149114", "text": "func (in *RunList) DeepCopyObject() runtime.Object {\n\tif c := in.DeepCopy(); c != nil {\n\t\treturn c\n\t}\n\treturn nil\n}", "title": "" }, { "docid": "81ec9c7e50e902721ad3bf36f4c935cd", "score": "0.68149114", "text": "func (in *RunList) DeepCopyObject() runtime.Object {\n\tif c := in.DeepCopy(); c != nil {\n\t\treturn c\n\t}\n\treturn nil\n}", "title": "" }, { "docid": "b055ea8998645b326e1e0e063c42e5ae", "score": "0.6812369", "text": "func (in *ApiProxy) DeepCopyObject() runtime.Object {\n\tif c := in.DeepCopy(); c != nil {\n\t\treturn c\n\t}\n\treturn nil\n}", "title": "" }, { "docid": "00ba0fbd107f0a581fde24e39a0e86d9", "score": "0.6810431", "text": "func (in *RunServices) DeepCopyObject() runtime.Object {\n\tif c := in.DeepCopy(); c != nil {\n\t\treturn c\n\t}\n\treturn nil\n}", "title": "" }, { "docid": "541ace7c5e578e9c049a2a3d289066b2", "score": "0.68039435", "text": "func (in *IDPortenClient) DeepCopyObject() runtime.Object {\n\tif c := in.DeepCopy(); c != nil {\n\t\treturn c\n\t}\n\treturn nil\n}", "title": "" }, { "docid": "96119b1a12c3170813b4f89d571a59e6", "score": "0.6802864", "text": "func (in *RunnerImage) DeepCopyObject() runtime.Object {\n\tif c := in.DeepCopy(); c != nil {\n\t\treturn c\n\t}\n\treturn nil\n}", "title": "" }, { "docid": "0ddf9251dc119e9db2e6d879af774d6c", "score": "0.68019944", "text": "func (in *Proxier) DeepCopyObject() runtime.Object {\n\tif c := in.DeepCopy(); c != nil {\n\t\treturn c\n\t}\n\treturn nil\n}", "title": "" }, { "docid": "00e766e9282fb1b97758068a17381059", "score": "0.6800952", "text": "func (in *MaskinportenClient) DeepCopyObject() runtime.Object {\n\tif c := in.DeepCopy(); c != nil {\n\t\treturn c\n\t}\n\treturn nil\n}", "title": "" }, { "docid": "bdfece5a46ef72b2e31ac5edc6905388", "score": "0.6799422", "text": "func (in *Cosweb) DeepCopyObject() runtime.Object {\n\tif c := in.DeepCopy(); c != nil {\n\t\treturn c\n\t}\n\treturn nil\n}", "title": "" }, { "docid": "b3860121e76651effd55fda4a8c4b69f", "score": "0.67993426", "text": "func (in *VirtualServiceBase) DeepCopyObject() runtime.Object {\n\tif c := in.DeepCopy(); c != nil {\n\t\treturn c\n\t}\n\treturn nil\n}", "title": "" }, { "docid": "9404fae1a71345a1d67713ead811e5f3", "score": "0.67979926", "text": "func (in *ClowdEnvironment) DeepCopyObject() runtime.Object {\n\tif c := in.DeepCopy(); c != nil {\n\t\treturn c\n\t}\n\treturn nil\n}", "title": "" }, { "docid": "c0e5cf45f51606470d2efd83f239fd9b", "score": "0.6795403", "text": "func (in *SeedList) DeepCopyObject() runtime.Object {\n\tif c := in.DeepCopy(); c != nil {\n\t\treturn c\n\t}\n\treturn nil\n}", "title": "" }, { "docid": "08851f577beff8b9a55605234a10b571", "score": "0.67932934", "text": "func (in *Machine) DeepCopyObject() runtime.Object {\n\tif c := in.DeepCopy(); c != nil {\n\t\treturn c\n\t}\n\treturn nil\n}", "title": "" }, { "docid": "08851f577beff8b9a55605234a10b571", "score": "0.67932934", "text": "func (in *Machine) DeepCopyObject() runtime.Object {\n\tif c := in.DeepCopy(); c != nil {\n\t\treturn c\n\t}\n\treturn nil\n}", "title": "" }, { "docid": "08851f577beff8b9a55605234a10b571", "score": "0.67932934", "text": "func (in *Machine) DeepCopyObject() runtime.Object {\n\tif c := in.DeepCopy(); c != nil {\n\t\treturn c\n\t}\n\treturn nil\n}", "title": "" }, { "docid": "08851f577beff8b9a55605234a10b571", "score": "0.67932934", "text": "func (in *Machine) DeepCopyObject() runtime.Object {\n\tif c := in.DeepCopy(); c != nil {\n\t\treturn c\n\t}\n\treturn nil\n}", "title": "" }, { "docid": "c2c3d62f91dfb2c52bcbacf4c854e7b5", "score": "0.6793138", "text": "func (in *Flow) DeepCopyObject() runtime.Object {\n\tif c := in.DeepCopy(); c != nil {\n\t\treturn c\n\t}\n\treturn nil\n}", "title": "" }, { "docid": "e8d3edbc4aafe3a0e94ec1c46a354361", "score": "0.6792895", "text": "func (in *ExtensionList) DeepCopyObject() runtime.Object {\n\tif c := in.DeepCopy(); c != nil {\n\t\treturn c\n\t}\n\treturn nil\n}", "title": "" }, { "docid": "6bba529c437c45cfe4a96f73a11f136a", "score": "0.67918676", "text": "func (in *Proxy) DeepCopyObject() runtime.Object {\n\tif c := in.DeepCopy(); c != nil {\n\t\treturn c\n\t}\n\treturn nil\n}", "title": "" }, { "docid": "8ea92bd7febd58755b8cabe0d627355f", "score": "0.679132", "text": "func (in *DendronautTestResult) DeepCopyObject() runtime.Object {\n\tif c := in.DeepCopy(); c != nil {\n\t\treturn c\n\t}\n\treturn nil\n}", "title": "" }, { "docid": "3e3f85b55afae2df2d69d8207d2cbef8", "score": "0.6791218", "text": "func (in *NebulaCAList) DeepCopyObject() runtime.Object {\n\tif c := in.DeepCopy(); c != nil {\n\t\treturn c\n\t}\n\treturn nil\n}", "title": "" }, { "docid": "4a783bf5b574f47a0af297aa5379df83", "score": "0.6788586", "text": "func (in *ComputeTargetGRPCProxy) DeepCopyObject() runtime.Object {\n\tif c := in.DeepCopy(); c != nil {\n\t\treturn c\n\t}\n\treturn nil\n}", "title": "" }, { "docid": "4a783bf5b574f47a0af297aa5379df83", "score": "0.6788586", "text": "func (in *ComputeTargetGRPCProxy) DeepCopyObject() runtime.Object {\n\tif c := in.DeepCopy(); c != nil {\n\t\treturn c\n\t}\n\treturn nil\n}", "title": "" }, { "docid": "f43dde222339bc0b3c8ec6d9b642cf43", "score": "0.6788411", "text": "func (in *EtcdPeer) DeepCopyObject() runtime.Object {\n\tif c := in.DeepCopy(); c != nil {\n\t\treturn c\n\t}\n\treturn nil\n}", "title": "" }, { "docid": "f43dde222339bc0b3c8ec6d9b642cf43", "score": "0.6788411", "text": "func (in *EtcdPeer) DeepCopyObject() runtime.Object {\n\tif c := in.DeepCopy(); c != nil {\n\t\treturn c\n\t}\n\treturn nil\n}", "title": "" }, { "docid": "e1a132b4af7f55528161a0f94f124617", "score": "0.6787095", "text": "func (in *FluentBitList) DeepCopyObject() runtime.Object {\n\tif c := in.DeepCopy(); c != nil {\n\t\treturn c\n\t}\n\treturn nil\n}", "title": "" }, { "docid": "018775afbcc4660a0bd7b64df92cc224", "score": "0.67855704", "text": "func (in *Jitsi) DeepCopyObject() runtime.Object {\n\tif c := in.DeepCopy(); c != nil {\n\t\treturn c\n\t}\n\treturn nil\n}", "title": "" }, { "docid": "76f1e54550c239312aded69671699b83", "score": "0.67828524", "text": "func (in *ActiveMQArtemis) DeepCopyObject() runtime.Object {\n\tif c := in.DeepCopy(); c != nil {\n\t\treturn c\n\t}\n\treturn nil\n}", "title": "" }, { "docid": "25a155b2a12099e23ed2847a7c8cff50", "score": "0.67811084", "text": "func (in *Addon) DeepCopyObject() runtime.Object {\n\tif c := in.DeepCopy(); c != nil {\n\t\treturn c\n\t}\n\treturn nil\n}", "title": "" }, { "docid": "25a155b2a12099e23ed2847a7c8cff50", "score": "0.67811084", "text": "func (in *Addon) DeepCopyObject() runtime.Object {\n\tif c := in.DeepCopy(); c != nil {\n\t\treturn c\n\t}\n\treturn nil\n}", "title": "" }, { "docid": "25a155b2a12099e23ed2847a7c8cff50", "score": "0.67811084", "text": "func (in *Addon) DeepCopyObject() runtime.Object {\n\tif c := in.DeepCopy(); c != nil {\n\t\treturn c\n\t}\n\treturn nil\n}", "title": "" }, { "docid": "82c8936d5a296b83933646cece6b16f2", "score": "0.6779051", "text": "func (in *HookList) DeepCopyObject() runtime.Object {\n\tif c := in.DeepCopy(); c != nil {\n\t\treturn c\n\t}\n\treturn nil\n}", "title": "" }, { "docid": "82c8936d5a296b83933646cece6b16f2", "score": "0.6779051", "text": "func (in *HookList) DeepCopyObject() runtime.Object {\n\tif c := in.DeepCopy(); c != nil {\n\t\treturn c\n\t}\n\treturn nil\n}", "title": "" } ]
8bfe2fd2af29040748f03cbf903681dc
NewMockRepo creates a new mock instance
[ { "docid": "fe82b7a7dc959f6ffdfdf6cceddfb346", "score": "0.66652316", "text": "func NewMockRepo(ctrl *gomock.Controller) *MockRepo {\n\tmock := &MockRepo{ctrl: ctrl}\n\tmock.recorder = &MockRepoMockRecorder{mock}\n\treturn mock\n}", "title": "" } ]
[ { "docid": "c63bf1e5ff3c7aa96036b0bd1266f425", "score": "0.71914774", "text": "func NewMockRepo(a *config.AppConfig) *Repository {\n\treturn &Repository{\n\t\tApp: a,\n\t\tDB: database.NewMockPostgres(a),\n\t}\n}", "title": "" }, { "docid": "bfe2a5a5f786ad1067e544205ece8d72", "score": "0.6548107", "text": "func NewRepository(t mockConstructorTestingTNewRepository) *Repository {\n\tmock := &Repository{}\n\tmock.Mock.Test(t)\n\n\tt.Cleanup(func() { mock.AssertExpectations(t) })\n\n\treturn mock\n}", "title": "" }, { "docid": "313092e35a37548bffa319de47e72795", "score": "0.6522537", "text": "func NewMockRepository(conn *sql.DB) *MockRepository {\n\treturn &MockRepository{connection: conn}\n}", "title": "" }, { "docid": "414487026a2e7a7d7948e4c398941f42", "score": "0.6482843", "text": "func NewRepos(t mockConstructorTestingTNewRepos) *Repos {\n\tmock := &Repos{}\n\tmock.Mock.Test(t)\n\n\tt.Cleanup(func() { mock.AssertExpectations(t) })\n\n\treturn mock\n}", "title": "" }, { "docid": "3e23c1e7cdca71d54407277ad7fd9a62", "score": "0.62729466", "text": "func NewMockRepository() Repository {\n\tusers := make(map[string]User)\n\tdata := []User{\n\t\tNew(\"javier\", \"javier.golang@example.com\", \"password\"),\n\t\tNew(\"simon\", \"simon.golang@example.com\", \"password\"),\n\t}\n\tfor _, value := range data {\n\t\tusers[value.ID] = value\n\t}\n\treturn &MockRepository{Users: users}\n}", "title": "" }, { "docid": "61c2019f750e47df671b6ace1557e8a8", "score": "0.61895144", "text": "func NewRepository(userId string) *Repository {\n\n return &Repository{\n &repository{\n filepath.Join(rootDirPath, userId),\n nil,\n nil,\n },\n }\n}", "title": "" }, { "docid": "a1dd2f035b5b038165cc126ee7529353", "score": "0.6150531", "text": "func NewMockRepository() Repository {\n\troles := make(map[string]Role)\n\tdata := []Role{\n\t\tNew(\"ROLE_ADMIN\", \"ROLE_ADMIN\"),\n\t\tNew(\"ROLE_USER\", \"ROLE_USER\"),\n\t}\n\tfor _, value := range data {\n\t\troles[value.ID] = value\n\t}\n\treturn &MockRepository{Roles: roles}\n}", "title": "" }, { "docid": "287da45041dc81888a3f94f9efe13b44", "score": "0.606799", "text": "func NewMock() *Mock {\n\treturn &Mock{\n\t\tcache: map[string]*MockResult{},\n\t}\n}", "title": "" }, { "docid": "84fd34c458add86e2d709226680c930b", "score": "0.60632896", "text": "func NewMock() (*Mock, error) {\n\treturn &Mock{\n\t\thost: common.MockOrigin,\n\t\tcounter: 1,\n\t}, nil\n}", "title": "" }, { "docid": "ad1c5bea4856182926f417f7c49b3a85", "score": "0.60312635", "text": "func NewMock() *Mock {\n\treturn &Mock{}\n}", "title": "" }, { "docid": "6c635361fefd018000024753339bb417", "score": "0.5991697", "text": "func NewMockNumberRepo(ctrl *gomock.Controller) *MockNumberRepo {\n\tmock := &MockNumberRepo{ctrl: ctrl}\n\tmock.recorder = &MockNumberRepoMockRecorder{mock}\n\treturn mock\n}", "title": "" }, { "docid": "70beb983df2fe51b5f54f8cbc84e9145", "score": "0.59601146", "text": "func NewMock() *Mock {\n\treturn &Mock{now: time.Now()}\n}", "title": "" }, { "docid": "074a393353a14c405ef2f5bfb2e29c76", "score": "0.5897738", "text": "func NewMockDB(mock *MockDB) *PostgresRepository {\n\treturn &PostgresRepository{\n\t\tdb: mock,\n\t}\n}", "title": "" }, { "docid": "d68c7f2b8badd9d1a3083c9b9d1e4852", "score": "0.5886319", "text": "func testRepo() *library.Repo {\n\ti64 := int64(0)\n\ti := 0\n\tstr := \"\"\n\tb := false\n\n\treturn &library.Repo{\n\t\tID: &i64,\n\t\tPipelineType: &str,\n\t\tUserID: &i64,\n\t\tHash: &str,\n\t\tOrg: &str,\n\t\tName: &str,\n\t\tFullName: &str,\n\t\tLink: &str,\n\t\tClone: &str,\n\t\tBranch: &str,\n\t\tBuildLimit: &i64,\n\t\tTimeout: &i64,\n\t\tCounter: &i,\n\t\tVisibility: &str,\n\t\tPrivate: &b,\n\t\tTrusted: &b,\n\t\tActive: &b,\n\t\tAllowPull: &b,\n\t\tAllowPush: &b,\n\t\tAllowDeploy: &b,\n\t\tAllowTag: &b,\n\t\tAllowComment: &b,\n\t\tPreviousName: &str,\n\t}\n}", "title": "" }, { "docid": "4d0c184e26f5f5cbc1ff8afdb7e726f5", "score": "0.58754486", "text": "func NewMockRepoStore() *MockRepoStore {\n\treturn &MockRepoStore{\n\t\tListFunc: &RepoStoreListFunc{\n\t\t\tdefaultHook: func(context.Context, database.ReposListOptions) ([]*types.Repo, error) {\n\t\t\t\treturn nil, nil\n\t\t\t},\n\t\t},\n\t}\n}", "title": "" }, { "docid": "23776b5d702b39f5ed9b113b4fdce2a4", "score": "0.5869778", "text": "func newBusinessRepo(db *sql.DB) *businessRepo {\n\treturn &businessRepo{\n\t\tdb: db,\n\t}\n}", "title": "" }, { "docid": "4369ed5d731d240e5185cd434d4bfc19", "score": "0.58690196", "text": "func New(cfg model.Config) Repo {\n\treturn repo{cfg}\n}", "title": "" }, { "docid": "35a538110fe942752b649b60b4550f84", "score": "0.58653134", "text": "func NewMockAuthRepository() auth.Repository {\n\tdb := make(map[string]interface{})\n\treturn &MockAuthRepository{db}\n}", "title": "" }, { "docid": "8bd8096402c8a4e776d5f20be1a19b97", "score": "0.58402026", "text": "func (m *MockAdaptor) RepositoryCreate(ctx context.Context, org string, repo *github.Repository) (*github.Repository, *github.Response, error) {\n\tm.ctrl.T.Helper()\n\tret := m.ctrl.Call(m, \"RepositoryCreate\", ctx, org, repo)\n\tret0, _ := ret[0].(*github.Repository)\n\tret1, _ := ret[1].(*github.Response)\n\tret2, _ := ret[2].(error)\n\treturn ret0, ret1, ret2\n}", "title": "" }, { "docid": "b975bb4094a06c918da264c9d6025d8f", "score": "0.5830455", "text": "func NewMock() Service {\n\treturn &mock{}\n}", "title": "" }, { "docid": "1fea53ed14c2d168522c7c3ad00b15b1", "score": "0.58298135", "text": "func NewMock() *Mock {\n\treturn &Mock{\n\t\tmu: &sync.Mutex{},\n\t\tcache: make(map[string]string),\n\t}\n}", "title": "" }, { "docid": "782d2cfbc9a7d7f157f904013b847a78", "score": "0.5778371", "text": "func NewAccountRepositoryMock(t minimock.Tester) *AccountRepositoryMock {\n\tm := &AccountRepositoryMock{t: t}\n\tif controller, ok := t.(minimock.MockController); ok {\n\t\tcontroller.RegisterMocker(m)\n\t}\n\n\tm.CreateMock = mAccountRepositoryMockCreate{mock: m}\n\tm.CreateMock.callArgs = []*AccountRepositoryMockCreateParams{}\n\n\tm.DeleteMock = mAccountRepositoryMockDelete{mock: m}\n\tm.DeleteMock.callArgs = []*AccountRepositoryMockDeleteParams{}\n\n\tm.GetByIDMock = mAccountRepositoryMockGetByID{mock: m}\n\tm.GetByIDMock.callArgs = []*AccountRepositoryMockGetByIDParams{}\n\n\tm.ListMock = mAccountRepositoryMockList{mock: m}\n\tm.ListMock.callArgs = []*AccountRepositoryMockListParams{}\n\n\tm.ListByAvailabilityMock = mAccountRepositoryMockListByAvailability{mock: m}\n\tm.ListByAvailabilityMock.callArgs = []*AccountRepositoryMockListByAvailabilityParams{}\n\n\tm.UpdateMock = mAccountRepositoryMockUpdate{mock: m}\n\tm.UpdateMock.callArgs = []*AccountRepositoryMockUpdateParams{}\n\n\treturn m\n}", "title": "" }, { "docid": "58cdbdf6aa2416e708486108dcd636c3", "score": "0.5755811", "text": "func NewMockRepoStoreFrom(i RepoStore) *MockRepoStore {\n\treturn &MockRepoStore{\n\t\tListFunc: &RepoStoreListFunc{\n\t\t\tdefaultHook: i.List,\n\t\t},\n\t}\n}", "title": "" }, { "docid": "9fe011ae1b95e5f784496bad18f4b51d", "score": "0.57218164", "text": "func NewMock() *Mock {\n\tm := &Mock{}\n\tm.changed = make(chan time.Time)\n\tm.now = time.Unix(0, 0)\n\treturn m\n}", "title": "" }, { "docid": "e16c670eddc35326c31a25487cd6fe6a", "score": "0.5704543", "text": "func newCompanyRepo(db *sql.DB) *companyRepo {\n\treturn &companyRepo{\n\t\tdb: db,\n\t}\n}", "title": "" }, { "docid": "208bcb3ce74ae159e6a07f5659aa942d", "score": "0.5700543", "text": "func New() *Repo {\n\treturn &Repo{}\n}", "title": "" }, { "docid": "7f3b83038c01591f251d7fd8f05ddd5d", "score": "0.5683438", "text": "func NewMockClient() *MockClient {\n\treturn &MockClient{\n\t\tAddrForRepoFunc: &ClientAddrForRepoFunc{\n\t\t\tdefaultHook: func(api.RepoName) string {\n\t\t\t\treturn \"\"\n\t\t\t},\n\t\t},\n\t\tAddrsFunc: &ClientAddrsFunc{\n\t\t\tdefaultHook: func() []string {\n\t\t\t\treturn nil\n\t\t\t},\n\t\t},\n\t\tArchiveFunc: &ClientArchiveFunc{\n\t\t\tdefaultHook: func(context.Context, api.RepoName, ArchiveOptions) (io.ReadCloser, error) {\n\t\t\t\treturn nil, nil\n\t\t\t},\n\t\t},\n\t\tArchiveURLFunc: &ClientArchiveURLFunc{\n\t\t\tdefaultHook: func(api.RepoName, ArchiveOptions) *url.URL {\n\t\t\t\treturn nil\n\t\t\t},\n\t\t},\n\t\tCommandFunc: &ClientCommandFunc{\n\t\t\tdefaultHook: func(string, ...string) *Cmd {\n\t\t\t\treturn nil\n\t\t\t},\n\t\t},\n\t\tCreateCommitFromPatchFunc: &ClientCreateCommitFromPatchFunc{\n\t\t\tdefaultHook: func(context.Context, protocol.CreateCommitFromPatchRequest) (string, error) {\n\t\t\t\treturn \"\", nil\n\t\t\t},\n\t\t},\n\t\tGetGitolitePhabricatorMetadataFunc: &ClientGetGitolitePhabricatorMetadataFunc{\n\t\t\tdefaultHook: func(context.Context, string, api.RepoName) (*protocol.GitolitePhabricatorMetadataResponse, error) {\n\t\t\t\treturn nil, nil\n\t\t\t},\n\t\t},\n\t\tGetObjectFunc: &ClientGetObjectFunc{\n\t\t\tdefaultHook: func(context.Context, api.RepoName, string) (*gitdomain.GitObject, error) {\n\t\t\t\treturn nil, nil\n\t\t\t},\n\t\t},\n\t\tIsRepoCloneableFunc: &ClientIsRepoCloneableFunc{\n\t\t\tdefaultHook: func(context.Context, api.RepoName) error {\n\t\t\t\treturn nil\n\t\t\t},\n\t\t},\n\t\tIsRepoClonedFunc: &ClientIsRepoClonedFunc{\n\t\t\tdefaultHook: func(context.Context, api.RepoName) (bool, error) {\n\t\t\t\treturn false, nil\n\t\t\t},\n\t\t},\n\t\tListClonedFunc: &ClientListClonedFunc{\n\t\t\tdefaultHook: func(context.Context) ([]string, error) {\n\t\t\t\treturn nil, nil\n\t\t\t},\n\t\t},\n\t\tListGitoliteFunc: &ClientListGitoliteFunc{\n\t\t\tdefaultHook: func(context.Context, string) ([]*gitolite.Repo, error) {\n\t\t\t\treturn nil, nil\n\t\t\t},\n\t\t},\n\t\tP4ExecFunc: &ClientP4ExecFunc{\n\t\t\tdefaultHook: func(context.Context, string, string, string, ...string) (io.ReadCloser, http.Header, error) {\n\t\t\t\treturn nil, nil, nil\n\t\t\t},\n\t\t},\n\t\tRemoveFunc: &ClientRemoveFunc{\n\t\t\tdefaultHook: func(context.Context, api.RepoName) error {\n\t\t\t\treturn nil\n\t\t\t},\n\t\t},\n\t\tRendezvousAddrForRepoFunc: &ClientRendezvousAddrForRepoFunc{\n\t\t\tdefaultHook: func(api.RepoName) string {\n\t\t\t\treturn \"\"\n\t\t\t},\n\t\t},\n\t\tRepoCloneProgressFunc: &ClientRepoCloneProgressFunc{\n\t\t\tdefaultHook: func(context.Context, ...api.RepoName) (*protocol.RepoCloneProgressResponse, error) {\n\t\t\t\treturn nil, nil\n\t\t\t},\n\t\t},\n\t\tRepoInfoFunc: &ClientRepoInfoFunc{\n\t\t\tdefaultHook: func(context.Context, ...api.RepoName) (*protocol.RepoInfoResponse, error) {\n\t\t\t\treturn nil, nil\n\t\t\t},\n\t\t},\n\t\tReposStatsFunc: &ClientReposStatsFunc{\n\t\t\tdefaultHook: func(context.Context) (map[string]*protocol.ReposStats, error) {\n\t\t\t\treturn nil, nil\n\t\t\t},\n\t\t},\n\t\tRequestRepoMigrateFunc: &ClientRequestRepoMigrateFunc{\n\t\t\tdefaultHook: func(context.Context, api.RepoName) (*protocol.RepoUpdateResponse, error) {\n\t\t\t\treturn nil, nil\n\t\t\t},\n\t\t},\n\t\tRequestRepoUpdateFunc: &ClientRequestRepoUpdateFunc{\n\t\t\tdefaultHook: func(context.Context, api.RepoName, time.Duration) (*protocol.RepoUpdateResponse, error) {\n\t\t\t\treturn nil, nil\n\t\t\t},\n\t\t},\n\t\tSearchFunc: &ClientSearchFunc{\n\t\t\tdefaultHook: func(context.Context, *protocol.SearchRequest, func([]protocol.CommitMatch)) (bool, error) {\n\t\t\t\treturn false, nil\n\t\t\t},\n\t\t},\n\t}\n}", "title": "" }, { "docid": "b25dea26d2938eb240f3161de6072e6b", "score": "0.5679662", "text": "func NewRepo(ua IAdapter, fa farm.IAdapter, fwa farmworker.IAdapter) Repo {\n\treturn Repo{\n\t\tuserAdapter: ua,\n\t\tfarmAdapter: fa,\n\t\tfarmWorkerAdapter: fwa,\n\t}\n}", "title": "" }, { "docid": "ab0c55c32aa7136354d84ee98ea77f07", "score": "0.56727713", "text": "func TestCloneRepo(t *testing.T) {\n\tlocalRepoRootPath, err := tgz.Extract(\"testdata/repo.tgz\")\n\tdefer func() {\n\t\trequire.NoError(t, os.RemoveAll(localRepoRootPath))\n\t}()\n\trequire.NoError(t, err)\n\trequire.NotEmpty(t, localRepoRootPath)\n\n\trepo, err := git.PlainOpen(path.Join(localRepoRootPath, \"repo\"))\n\trequire.NoError(t, err)\n\n\tvar refs []*plumbing.Reference\n\titer, err := repo.References()\n\trequire.NoError(t, err)\n\titer.ForEach(func(r *plumbing.Reference) error {\n\t\trefs = append(refs, r)\n\t\treturn nil\n\t})\n\n\tdefaultCloner = &fakeCloner{repo: repo}\n\tdefaultLister = &fakeRefLister{refs: refs}\n\n\theadRef, err := repo.Head()\n\trequire.NoError(t, err)\n\n\tcommit, err := repo.CommitObject(headRef.Hash())\n\trequire.NoError(t, err)\n\trequire.Equal(t, \"Update README\\n\", commit.Message)\n\n\terr = CloneRepo(\"github.com/foo\", \"bar/baz\", \"1.0.0\")\n\trequire.NoError(t, err)\n\n\theadRef, err = repo.Head()\n\trequire.NoError(t, err)\n\n\tcommit, err = repo.CommitObject(headRef.Hash())\n\trequire.NoError(t, err)\n\trequire.Equal(t, \"Add README\\n\", commit.Message)\n}", "title": "" }, { "docid": "7098fac18ae434a937bcc914f1ee4ebc", "score": "0.56705177", "text": "func newUserRepo(db *sql.DB) *userRepo {\n\treturn &userRepo{\n\t\tdb: db,\n\t}\n}", "title": "" }, { "docid": "adb97976b94b534427d2ec68a2c135a5", "score": "0.56450355", "text": "func NewMock(file string) (mock Mock, path string, err error) {\n\tpath, err = filepath.Abs(file)\n\tif err != nil {\n\t\treturn\n\t}\n\tpath = filepath.Dir(path)\n\tdata, err := ioutil.ReadFile(file)\n\tif err != nil {\n\t\treturn\n\t}\n\terr = json.Unmarshal(data, &mock)\n\tif err != nil {\n\t\treturn\n\t}\n\n\treturn\n}", "title": "" }, { "docid": "99a137cb0fc885d36dfec7d8956b9450", "score": "0.5642031", "text": "func NewMockStickerRepo(ctrl *gomock.Controller) *MockStickerRepo {\n\tmock := &MockStickerRepo{ctrl: ctrl}\n\tmock.recorder = &MockStickerRepoMockRecorder{mock}\n\treturn mock\n}", "title": "" }, { "docid": "346451ae26348176c11d28f04fe2e80c", "score": "0.56380856", "text": "func (m *MockGormItf) New() GormItf {\n\tm.ctrl.T.Helper()\n\tret := m.ctrl.Call(m, \"New\")\n\tret0, _ := ret[0].(GormItf)\n\treturn ret0\n}", "title": "" }, { "docid": "19e796359e226482794f201ab0483404", "score": "0.5637613", "text": "func NewMock(idlerAPI string, state PodState, throwError bool) (idler *Mock) {\n\treturn &Mock{\n\t\tidlerAPI: idlerAPI,\n\t\tIdlerState: state,\n\t\tthrowError: throwError,\n\t}\n}", "title": "" }, { "docid": "528eed299257e545e55997bce3266202", "score": "0.56329", "text": "func NewUserRepository(db infrastructure.Database) UserRepository {\n return UserRepository{\n db: db,\n }\n}", "title": "" }, { "docid": "389505612d4b494ced311bb574c00586", "score": "0.5620455", "text": "func NewCompanyRepoMock() *CompanyRepoMock {\n\treturn &CompanyRepoMock{}\n}", "title": "" }, { "docid": "5387bcc22780e3b5fa2b8854e2f71ab7", "score": "0.56199586", "text": "func NewChainRepository() *ChainRepository {\n return &ChainRepository{}\n}", "title": "" }, { "docid": "fb9097437fbea2ab55dc2b7e556b8b6c", "score": "0.56198156", "text": "func New(session *mgo.Session, dbName string) (repo *MGORepository, err error) {\n\tif session == nil {\n\t\treturn nil, errors.New(\"Nil pointer provided\")\n\t}\n\trepo = &MGORepository{session: session, dbname: dbName}\n\treturn repo, nil\n\n}", "title": "" }, { "docid": "ee893774f96d0dd91620f9a4b6063725", "score": "0.56164813", "text": "func (_m *MockStore) Create(ctx context.Context, organizationID uint, repository Repository) error {\n\tret := _m.Called(ctx, organizationID, repository)\n\n\tvar r0 error\n\tif rf, ok := ret.Get(0).(func(context.Context, uint, Repository) error); ok {\n\t\tr0 = rf(ctx, organizationID, repository)\n\t} else {\n\t\tr0 = ret.Error(0)\n\t}\n\n\treturn r0\n}", "title": "" }, { "docid": "d551b2928d4dc0847649e3de90108a1d", "score": "0.56118625", "text": "func makeFakeGitRepo(t *testing.T, fakeTimestamp int) (string, error) {\n\tfakeGitDir := t.TempDir()\n\tcmds := [][]string{\n\t\t{\"git\", \"init\"},\n\t\t{\"git\", \"config\", \"user.email\", \"test@test.test\"},\n\t\t{\"git\", \"config\", \"user.name\", \"test test\"},\n\t\t{\"touch\", \"a_file\"},\n\t\t{\"git\", \"add\", \"a_file\"},\n\t\t{\"git\", \"commit\", \"-m\", \"adding a_file\"},\n\t}\n\tfor _, cmd := range cmds {\n\t\tc := exec.Command(cmd[0], cmd[1:]...)\n\t\tc.Dir = fakeGitDir\n\t\tc.Env = append(os.Environ(), gitTimestampEnvs(fakeTimestamp)...)\n\t\tif err := c.Run(); err != nil {\n\t\t\treturn fakeGitDir, err\n\t\t}\n\t}\n\treturn fakeGitDir, nil\n}", "title": "" }, { "docid": "cafc139169ddcd9446bc40b4a72bbab0", "score": "0.55802655", "text": "func New() *MockDB {\n\tlock.Lock()\n\tdefer lock.Unlock()\n\tdb, mock, err := sqlmock.New()\n\tgormDB, err := gorm.Open(\"postgres\", db)\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\treturn &MockDB{\n\t\tdb: db, DB: gormDB, Mock: mock,\n\t}\n}", "title": "" }, { "docid": "704daaea91f30daecc7dfb8f20057a36", "score": "0.55763096", "text": "func MockGetRepository_Return(returns *Repository) {\n\tGetRepositoryMock = func(context.Context, string, string) (*Repository, error) {\n\t\treturn returns, nil\n\t}\n}", "title": "" }, { "docid": "c92a75c1251a9afc3310ffbd4d94cb8b", "score": "0.5575172", "text": "func NewRepo() *Repo {\n\tdbmap := newDBMap()\n\tfor _, entity := range registry {\n\t\tdbmap.AddTable(entity).SetKeys(false, \"id\")\n\t}\n\treturn &Repo{\n\t\tdbmap: dbmap,\n\t}\n}", "title": "" }, { "docid": "b534fc59335ea0030ffba15f1b399124", "score": "0.5568149", "text": "func NewMockObject(ctrl *gomock.Controller) *MockObject {\n\tmock := &MockObject{ctrl: ctrl}\n\tmock.recorder = &MockObjectMockRecorder{mock}\n\treturn mock\n}", "title": "" }, { "docid": "bb00890674574ae58715ecb1091daac0", "score": "0.55634475", "text": "func NewRepo(db *sqlx.DB) *Repo {\n\treturn &Repo{db}\n}", "title": "" }, { "docid": "65493c9a4eb5351c8e8c67778dec11aa", "score": "0.55554", "text": "func NewMock(conf *config.Config, clusterID uint64) (*tikv.Server, *tikv.MockRegionManager, *tikv.MockPD, error) {\n\tphysical, logical := tikv.GetTS()\n\tts := uint64(physical)<<18 + uint64(logical)\n\n\tsafePoint := &tikv.SafePoint{}\n\tdb, err := createDB(subPathKV, safePoint, &conf.Engine)\n\tif err != nil {\n\t\treturn nil, nil, nil, err\n\t}\n\tbundle := &mvcc.DBBundle{\n\t\tDB: db,\n\t\tLockStore: lockstore.NewMemStore(8 << 20),\n\t\tStateTS: ts,\n\t}\n\n\trm, err := tikv.NewMockRegionManager(bundle, clusterID, tikv.RegionOptions{\n\t\tStoreAddr: conf.Server.StoreAddr,\n\t\tPDAddr: conf.Server.PDAddr,\n\t\tRegionSize: conf.Server.RegionSize,\n\t})\n\tif err != nil {\n\t\treturn nil, nil, nil, err\n\t}\n\tpdClient := tikv.NewMockPD(rm)\n\tsvr, err := setupStandAlongInnerServer(bundle, safePoint, rm, pdClient, conf)\n\tif err != nil {\n\t\treturn nil, nil, nil, err\n\t}\n\treturn svr, rm, pdClient, nil\n}", "title": "" }, { "docid": "3093501f2df82eb95627ee080d18ad16", "score": "0.55549943", "text": "func NewMock(addRouteCallback func(netlink.Route) error) (Component, func(Notification)) {\n\tc := &mockComponent{\n\t\tobserverSubComponent: newObserver(),\n\t\taddRouteCallback: addRouteCallback,\n\t}\n\treturn c, c.inject\n}", "title": "" }, { "docid": "ba7ec611a26f37e608c9e1ce0452396b", "score": "0.55517644", "text": "func NewMockRedis(ctrl *gomock.Controller) *MockRedis {\n mock := &MockRedis{ctrl: ctrl}\n mock.recorder = &MockRedisMockRecorder{mock}\n return mock\n}", "title": "" }, { "docid": "a7a05e39185c5773804b0ed5efb43021", "score": "0.55377465", "text": "func NewProductRepo() *MockProductRepository {\n\treturn &MockProductRepository{\n\t\tStorage: map[string]Product{},\n\t}\n}", "title": "" }, { "docid": "bd3abd6f0cfc715c1b5088915c7073c1", "score": "0.55170405", "text": "func New(ctx context.Context, opt *Options) (repo storage.Repository, err error) {\n\tDB, err := connect(ctx, opt)\n\n\trepo = &Driver{\n\t\tAccountRepository: NewAccountRepo(DB),\n\t\tCustomerRepository: NewCustomerRepo(DB),\n\t\tTransactionRepository: NewTransactionRepo(DB),\n\t}\n\treturn\n}", "title": "" }, { "docid": "cf9bde9d146c955e27acc9e73407cf2b", "score": "0.55125535", "text": "func NewMockGit(ctrl *gomock.Controller) *MockGit {\n\tmock := &MockGit{ctrl: ctrl}\n\tmock.recorder = &MockGitMockRecorder{mock}\n\treturn mock\n}", "title": "" }, { "docid": "8ceef1e1955f36ef7a43686b57b09da6", "score": "0.5505813", "text": "func New() *Mocker {\n\treturn &Mocker{}\n}", "title": "" }, { "docid": "7bb6dfcc75209f92f5ddbce0f5bb3a94", "score": "0.5504696", "text": "func NewGitHub(name string, spec *app.RegistryRefSpec) *GitHub {\n\treturn &GitHub{\n\t\tname: name,\n\t\tspec: spec,\n\t}\n}", "title": "" }, { "docid": "61aebfed6eb62efda17a0e31096b080b", "score": "0.55026263", "text": "func NewMock() *Mock {\n\treturn &Mock{\n\t\tValues: &sync.Map{},\n\t\tGetError: nil,\n\t\tSetError: nil,\n\t\tListError: nil,\n\t}\n}", "title": "" }, { "docid": "7bc7190b6f5e0f16d9be732f852f28d4", "score": "0.5501194", "text": "func NewProductRepositoryMock() *RepositoryMock {\n\torgData, _ := testdata.GetOrganizations()\n\tprodData, _ := testdata.GetProducts()\n\n\torgById := make(map[string]organizationentity.Organization)\n\tcatById := make(map[string]productcategoryentity.ProductCategory)\n\n\tfor _, org := range orgData.Organizations {\n\t\torgById[org.ID] = org\n\t}\n\tfor _, cat := range prodData.Categories {\n\t\tcatById[cat.ID] = cat\n\t}\n\n\tproductList := make([]*productentity.ProductForList, len(prodData.Products))\n\tfor i, prod := range prodData.Products {\n\t\tproductList[i] = &productentity.ProductForList{\n\t\t\tID: prod.ID,\n\t\t\tName: prod.Name,\n\t\t\tPrice: prod.Price,\n\t\t\tCount: prod.Count,\n\t\t\tStatus: prod.Status,\n\t\t\tCategory: productentity.CategoryForProduct{\n\t\t\t\tID: prod.IDCategory,\n\t\t\t\tName: catById[prod.IDCategory].Name,\n\t\t\t},\n\t\t\tOrganization: productentity.OrganizationForProduct{\n\t\t\t\tID: prod.IDOrganization,\n\t\t\t\tName: orgById[prod.IDOrganization].Name,\n\t\t\t\tPhone: orgById[prod.IDOrganization].Phone,\n\t\t\t\tEmail: orgById[prod.IDOrganization].Email,\n\t\t\t},\n\t\t}\n\t}\n\n\treturn &RepositoryMock{productList: productList}\n}", "title": "" }, { "docid": "db2d2be969cd121d326a62538f8af2ce", "score": "0.55005175", "text": "func (m *MockRepo) Create(body *api.BodyCreateRepo) (*api.ResultCreateRepo, error) {\n\tm.ctrl.T.Helper()\n\tret := m.ctrl.Call(m, \"Create\", body)\n\tret0, _ := ret[0].(*api.ResultCreateRepo)\n\tret1, _ := ret[1].(error)\n\treturn ret0, ret1\n}", "title": "" }, { "docid": "6f9701e1ce54d08e618f440075906ba8", "score": "0.54992014", "text": "func NewMockTodoRepo(ctrl *gomock.Controller) *MockTodoRepo {\n\tmock := &MockTodoRepo{ctrl: ctrl}\n\tmock.recorder = &MockTodoRepoMockRecorder{mock}\n\treturn mock\n}", "title": "" }, { "docid": "8f64308ce172a2a5f2bf112c3140a1f9", "score": "0.5485992", "text": "func (m *MockGenerator) New(arg0 string) io.Closer {\n\tm.ctrl.T.Helper()\n\tret := m.ctrl.Call(m, \"New\", arg0)\n\tret0, _ := ret[0].(io.Closer)\n\treturn ret0\n}", "title": "" }, { "docid": "1cd02b8b829d74f0839ff99c9822fe94", "score": "0.54776067", "text": "func NewMockIRepo(ctrl *gomock.Controller) *MockIRepo {\n\tmock := &MockIRepo{ctrl: ctrl}\n\tmock.recorder = &MockIRepoMockRecorder{mock}\n\treturn mock\n}", "title": "" }, { "docid": "19d8a19325acc626859b0656c55b76d1", "score": "0.5474028", "text": "func (m *MockWriteRepository) Create(ctx context.Context, url *url.URL, alias string) (string, error) {\n\tm.ctrl.T.Helper()\n\tret := m.ctrl.Call(m, \"Create\", ctx, url, alias)\n\tret0, _ := ret[0].(string)\n\tret1, _ := ret[1].(error)\n\treturn ret0, ret1\n}", "title": "" }, { "docid": "207bd86b4475029aa2d2f8c8d83261f0", "score": "0.5472921", "text": "func NewRepo() Repository {\n\treturn &repository{}\n}", "title": "" }, { "docid": "d308745c9c790fa3394c3f1d6f20bc65", "score": "0.5468306", "text": "func NewRepo() *Repo {\n\treturn &Repo{\n\t\troot: &node{\n\t\t\tname: \"root\",\n\t\t\temployees: map[string]*Employee{},\n\t\t\tchildDeps: map[string]*node{},\n\t\t},\n\t}\n}", "title": "" }, { "docid": "1e41943329f1b817ec924833e82d67f4", "score": "0.5466293", "text": "func New(t string, c *config.Config) Repo {\n\tvar repo Repo\n\tswitch t {\n\tcase \"plugins\":\n\t\trepo = &PluginRepo{\n\t\t\tConfig: c,\n\t\t\tList: make(map[string]*plugin.Plugin),\n\t\t\tRevision: 0,\n\t\t\tUpdateQueue: make(chan string, 100000),\n\t\t}\n\tcase \"themes\":\n\t\trepo = &ThemeRepo{\n\t\t\tConfig: c,\n\t\t\tList: make(map[string]*theme.Theme),\n\t\t\tRevision: 0,\n\t\t\tUpdateQueue: make(chan string, 100000),\n\t\t}\n\t}\n\treturn repo\n}", "title": "" }, { "docid": "5d993ab2057c82a7b5d7edcbaabeb794", "score": "0.54614514", "text": "func (m *MockClient) CreateRepo(ctx context.Context, in *pb.CreateRepoRequest, opts ...grpc.CallOption) (*pb.CreateRepoResponse, 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, \"CreateRepo\", varargs...)\n\tret0, _ := ret[0].(*pb.CreateRepoResponse)\n\tret1, _ := ret[1].(error)\n\treturn ret0, ret1\n}", "title": "" }, { "docid": "4e36692cc26993c143f89b67cd49b0a3", "score": "0.5455312", "text": "func NewRepo(a *config.AppConfig) *Repository {\r\n\treturn &Repository{\r\n\t\tApp: a,\r\n\t}\r\n}", "title": "" }, { "docid": "2482f25e3ebd19a37c11be680f793788", "score": "0.5454476", "text": "func NewMockClientFrom(i Client) *MockClient {\n\treturn &MockClient{\n\t\tAddrForRepoFunc: &ClientAddrForRepoFunc{\n\t\t\tdefaultHook: i.AddrForRepo,\n\t\t},\n\t\tAddrsFunc: &ClientAddrsFunc{\n\t\t\tdefaultHook: i.Addrs,\n\t\t},\n\t\tArchiveFunc: &ClientArchiveFunc{\n\t\t\tdefaultHook: i.Archive,\n\t\t},\n\t\tArchiveURLFunc: &ClientArchiveURLFunc{\n\t\t\tdefaultHook: i.ArchiveURL,\n\t\t},\n\t\tCommandFunc: &ClientCommandFunc{\n\t\t\tdefaultHook: i.Command,\n\t\t},\n\t\tCreateCommitFromPatchFunc: &ClientCreateCommitFromPatchFunc{\n\t\t\tdefaultHook: i.CreateCommitFromPatch,\n\t\t},\n\t\tGetGitolitePhabricatorMetadataFunc: &ClientGetGitolitePhabricatorMetadataFunc{\n\t\t\tdefaultHook: i.GetGitolitePhabricatorMetadata,\n\t\t},\n\t\tGetObjectFunc: &ClientGetObjectFunc{\n\t\t\tdefaultHook: i.GetObject,\n\t\t},\n\t\tIsRepoCloneableFunc: &ClientIsRepoCloneableFunc{\n\t\t\tdefaultHook: i.IsRepoCloneable,\n\t\t},\n\t\tIsRepoClonedFunc: &ClientIsRepoClonedFunc{\n\t\t\tdefaultHook: i.IsRepoCloned,\n\t\t},\n\t\tListClonedFunc: &ClientListClonedFunc{\n\t\t\tdefaultHook: i.ListCloned,\n\t\t},\n\t\tListGitoliteFunc: &ClientListGitoliteFunc{\n\t\t\tdefaultHook: i.ListGitolite,\n\t\t},\n\t\tP4ExecFunc: &ClientP4ExecFunc{\n\t\t\tdefaultHook: i.P4Exec,\n\t\t},\n\t\tRemoveFunc: &ClientRemoveFunc{\n\t\t\tdefaultHook: i.Remove,\n\t\t},\n\t\tRendezvousAddrForRepoFunc: &ClientRendezvousAddrForRepoFunc{\n\t\t\tdefaultHook: i.RendezvousAddrForRepo,\n\t\t},\n\t\tRepoCloneProgressFunc: &ClientRepoCloneProgressFunc{\n\t\t\tdefaultHook: i.RepoCloneProgress,\n\t\t},\n\t\tRepoInfoFunc: &ClientRepoInfoFunc{\n\t\t\tdefaultHook: i.RepoInfo,\n\t\t},\n\t\tReposStatsFunc: &ClientReposStatsFunc{\n\t\t\tdefaultHook: i.ReposStats,\n\t\t},\n\t\tRequestRepoMigrateFunc: &ClientRequestRepoMigrateFunc{\n\t\t\tdefaultHook: i.RequestRepoMigrate,\n\t\t},\n\t\tRequestRepoUpdateFunc: &ClientRequestRepoUpdateFunc{\n\t\t\tdefaultHook: i.RequestRepoUpdate,\n\t\t},\n\t\tSearchFunc: &ClientSearchFunc{\n\t\t\tdefaultHook: i.Search,\n\t\t},\n\t}\n}", "title": "" }, { "docid": "e1a2923dec398b3949ca88c619c633c8", "score": "0.54540896", "text": "func NewMockRepository(ctrl *gomock.Controller) *MockRepository {\n\tmock := &MockRepository{ctrl: ctrl}\n\tmock.recorder = &MockRepositoryMockRecorder{mock}\n\treturn mock\n}", "title": "" }, { "docid": "e1a2923dec398b3949ca88c619c633c8", "score": "0.54540896", "text": "func NewMockRepository(ctrl *gomock.Controller) *MockRepository {\n\tmock := &MockRepository{ctrl: ctrl}\n\tmock.recorder = &MockRepositoryMockRecorder{mock}\n\treturn mock\n}", "title": "" }, { "docid": "e1a2923dec398b3949ca88c619c633c8", "score": "0.54540896", "text": "func NewMockRepository(ctrl *gomock.Controller) *MockRepository {\n\tmock := &MockRepository{ctrl: ctrl}\n\tmock.recorder = &MockRepositoryMockRecorder{mock}\n\treturn mock\n}", "title": "" }, { "docid": "e1a2923dec398b3949ca88c619c633c8", "score": "0.54540896", "text": "func NewMockRepository(ctrl *gomock.Controller) *MockRepository {\n\tmock := &MockRepository{ctrl: ctrl}\n\tmock.recorder = &MockRepositoryMockRecorder{mock}\n\treturn mock\n}", "title": "" }, { "docid": "e1a2923dec398b3949ca88c619c633c8", "score": "0.54540896", "text": "func NewMockRepository(ctrl *gomock.Controller) *MockRepository {\n\tmock := &MockRepository{ctrl: ctrl}\n\tmock.recorder = &MockRepositoryMockRecorder{mock}\n\treturn mock\n}", "title": "" }, { "docid": "e1a2923dec398b3949ca88c619c633c8", "score": "0.54540896", "text": "func NewMockRepository(ctrl *gomock.Controller) *MockRepository {\n\tmock := &MockRepository{ctrl: ctrl}\n\tmock.recorder = &MockRepositoryMockRecorder{mock}\n\treturn mock\n}", "title": "" }, { "docid": "e1a2923dec398b3949ca88c619c633c8", "score": "0.54540896", "text": "func NewMockRepository(ctrl *gomock.Controller) *MockRepository {\n\tmock := &MockRepository{ctrl: ctrl}\n\tmock.recorder = &MockRepositoryMockRecorder{mock}\n\treturn mock\n}", "title": "" }, { "docid": "e1a2923dec398b3949ca88c619c633c8", "score": "0.54540896", "text": "func NewMockRepository(ctrl *gomock.Controller) *MockRepository {\n\tmock := &MockRepository{ctrl: ctrl}\n\tmock.recorder = &MockRepositoryMockRecorder{mock}\n\treturn mock\n}", "title": "" }, { "docid": "e1a2923dec398b3949ca88c619c633c8", "score": "0.54540896", "text": "func NewMockRepository(ctrl *gomock.Controller) *MockRepository {\n\tmock := &MockRepository{ctrl: ctrl}\n\tmock.recorder = &MockRepositoryMockRecorder{mock}\n\treturn mock\n}", "title": "" }, { "docid": "e1a2923dec398b3949ca88c619c633c8", "score": "0.54540896", "text": "func NewMockRepository(ctrl *gomock.Controller) *MockRepository {\n\tmock := &MockRepository{ctrl: ctrl}\n\tmock.recorder = &MockRepositoryMockRecorder{mock}\n\treturn mock\n}", "title": "" }, { "docid": "e1a2923dec398b3949ca88c619c633c8", "score": "0.54540896", "text": "func NewMockRepository(ctrl *gomock.Controller) *MockRepository {\n\tmock := &MockRepository{ctrl: ctrl}\n\tmock.recorder = &MockRepositoryMockRecorder{mock}\n\treturn mock\n}", "title": "" }, { "docid": "e1a2923dec398b3949ca88c619c633c8", "score": "0.54540896", "text": "func NewMockRepository(ctrl *gomock.Controller) *MockRepository {\n\tmock := &MockRepository{ctrl: ctrl}\n\tmock.recorder = &MockRepositoryMockRecorder{mock}\n\treturn mock\n}", "title": "" }, { "docid": "e1a2923dec398b3949ca88c619c633c8", "score": "0.54540896", "text": "func NewMockRepository(ctrl *gomock.Controller) *MockRepository {\n\tmock := &MockRepository{ctrl: ctrl}\n\tmock.recorder = &MockRepositoryMockRecorder{mock}\n\treturn mock\n}", "title": "" }, { "docid": "e1a2923dec398b3949ca88c619c633c8", "score": "0.54540896", "text": "func NewMockRepository(ctrl *gomock.Controller) *MockRepository {\n\tmock := &MockRepository{ctrl: ctrl}\n\tmock.recorder = &MockRepositoryMockRecorder{mock}\n\treturn mock\n}", "title": "" }, { "docid": "e1a2923dec398b3949ca88c619c633c8", "score": "0.54540896", "text": "func NewMockRepository(ctrl *gomock.Controller) *MockRepository {\n\tmock := &MockRepository{ctrl: ctrl}\n\tmock.recorder = &MockRepositoryMockRecorder{mock}\n\treturn mock\n}", "title": "" }, { "docid": "e1a2923dec398b3949ca88c619c633c8", "score": "0.54540896", "text": "func NewMockRepository(ctrl *gomock.Controller) *MockRepository {\n\tmock := &MockRepository{ctrl: ctrl}\n\tmock.recorder = &MockRepositoryMockRecorder{mock}\n\treturn mock\n}", "title": "" }, { "docid": "e1a2923dec398b3949ca88c619c633c8", "score": "0.54540896", "text": "func NewMockRepository(ctrl *gomock.Controller) *MockRepository {\n\tmock := &MockRepository{ctrl: ctrl}\n\tmock.recorder = &MockRepositoryMockRecorder{mock}\n\treturn mock\n}", "title": "" }, { "docid": "e1a2923dec398b3949ca88c619c633c8", "score": "0.54540896", "text": "func NewMockRepository(ctrl *gomock.Controller) *MockRepository {\n\tmock := &MockRepository{ctrl: ctrl}\n\tmock.recorder = &MockRepositoryMockRecorder{mock}\n\treturn mock\n}", "title": "" }, { "docid": "38cb33259a13775e9f3d27a79ee7f65d", "score": "0.5449205", "text": "func NewGitStore(t testing.TB) *GitStore {\n\tmock := &GitStore{}\n\n\tt.Cleanup(func() { mock.AssertExpectations(t) })\n\n\treturn mock\n}", "title": "" }, { "docid": "b7f221390fe6b2512eb5f63a122e9f02", "score": "0.544718", "text": "func (m *MockAdaptor) RepositoryCreateFromTemplate(ctx context.Context, templateOwner, templateRepo string, templateRepoReq *github.TemplateRepoRequest) (*github.Repository, *github.Response, error) {\n\tm.ctrl.T.Helper()\n\tret := m.ctrl.Call(m, \"RepositoryCreateFromTemplate\", ctx, templateOwner, templateRepo, templateRepoReq)\n\tret0, _ := ret[0].(*github.Repository)\n\tret1, _ := ret[1].(*github.Response)\n\tret2, _ := ret[2].(error)\n\treturn ret0, ret1, ret2\n}", "title": "" }, { "docid": "8b7f5d98aa391c28f98af3a29a17c6ed", "score": "0.5446992", "text": "func NewMockShortenerDBRepo(ctrl *gomock.Controller) *MockShortenerDBRepo {\n\tmock := &MockShortenerDBRepo{ctrl: ctrl}\n\tmock.recorder = &MockShortenerDBRepoMockRecorder{mock}\n\treturn mock\n}", "title": "" }, { "docid": "54aa4a6ca3198bda13d1111160eb1a86", "score": "0.5446403", "text": "func mkNewRemoteTestCase(repoType string, t *testing.T, extraFields map[string]interface{}) (*testing.T, resource.TestCase) {\n\t_, fqrn, name := mkNames(\"terraform-remote-test-repo-full\", fmt.Sprintf(\"artifactory_remote_%s_repository\", repoType))\n\n\tdefaultFields := map[string]interface{}{\n\t\t\"key\": name,\n\t\t\"url\": \"https://registry.npmjs.org/\",\n\t\t\"username\": \"user\",\n\t\t// This returns encrypted. Can't be tested\n\t\t//\"password\": \"foo\",\n\t\t\"proxy\": \"\",\n\n\t\t//\"description\": \"foo\", // the server returns this suffixed. Test seperate\n\t\t\"notes\": \"notes\",\n\t\t\"includes_pattern\": \"**/*.js\",\n\t\t\"excludes_pattern\": \"**/*.jsx\",\n\t\t\"repo_layout_ref\": \"npm-default\",\n\t\t\"hard_fail\": true,\n\t\t\"offline\": true,\n\t\t\"blacked_out\": true,\n\t\t\"xray_index\": true,\n\t\t\"store_artifacts_locally\": true,\n\t\t\"socket_timeout_millis\": 25000,\n\t\t\"local_address\": \"\",\n\t\t\"retrieval_cache_period_seconds\": 70,\n\t\t// this doesn't get returned on a GET\n\t\t//\"failed_retrieval_cache_period_secs\": 140,\n\t\t\"missed_cache_period_seconds\": 2500,\n\t\t\"unused_artifacts_cleanup_period_enabled\": true,\n\t\t\"unused_artifacts_cleanup_period_hours\": 96,\n\t\t\"assumed_offline_period_secs\": 96,\n\t\t\"share_configuration\": true,\n\t\t\"synchronize_properties\": true,\n\t\t\"block_mismatching_mime_types\": true,\n\t\t\"property_sets\": []interface{}{\"artifactory\"},\n\t\t\"allow_any_host_auth\": true,\n\t\t\"enable_cookie_management\": true,\n\t\t\"bypass_head_requests\": true,\n\t\t\"client_tls_certificate\": \"\",\n\t\t\"content_synchronisation\": map[string]interface{}{\n\t\t\t\"enabled\": false, // even when set to true, it seems to come back as false on the wire\n\t\t},\n\t}\n\tallFields := mergeMaps(defaultFields, extraFields)\n\tallFieldsHcl := fmtMapToHcl(allFields)\n\tconst remoteRepoFull = `\n\t\tresource \"artifactory_remote_%s_repository\" \"%s\" {\n%s\n\t\t}\n\t`\n\textraChecks := mapToTestChecks(fqrn, extraFields)\n\tdefaultChecks := mapToTestChecks(fqrn, allFields)\n\n\tchecks := append(defaultChecks, extraChecks...)\n\tconfig := fmt.Sprintf(remoteRepoFull, repoType, name, allFieldsHcl)\n\n\treturn t, resource.TestCase{\n\t\tProviderFactories: testAccProviders,\n\t\tPreCheck: func() { testAccPreCheck(t) },\n\t\tCheckDestroy: verifyDeleted(fqrn, testCheckRepo),\n\t\tSteps: []resource.TestStep{\n\t\t\t{\n\t\t\t\tConfig: config,\n\t\t\t\tCheck: resource.ComposeTestCheckFunc(checks...),\n\t\t\t},\n\t\t},\n\t}\n}", "title": "" }, { "docid": "123f7f664aa3f4c990ec3e3b874b6a86", "score": "0.544312", "text": "func New() *Repo{\n\treturn &Repo{\n\t\tItems: []Item{},\n\t}\n}", "title": "" }, { "docid": "0d103d786ac14a46f27bba8c0319fa8b", "score": "0.54429257", "text": "func newMockApiClientLogical(t mockConstructorTestingTnewMockApiClientLogical) *mockApiClientLogical {\n\tmock := &mockApiClientLogical{}\n\tmock.Mock.Test(t)\n\n\tt.Cleanup(func() { mock.AssertExpectations(t) })\n\n\treturn mock\n}", "title": "" }, { "docid": "c328f83645ff2bdfeae5a30afad7b9e1", "score": "0.54124075", "text": "func New() *Mock {\n\tmock := &Mock{\n\t\tCalls: Calls{},\n\t\tdisabled: false,\n\t\tpermissions: []accesscontrol.Permission{},\n\t\tbuiltInRoles: []string{},\n\t\tscopeResolvers: accesscontrol.NewResolvers(log.NewNopLogger()),\n\t}\n\n\treturn mock\n}", "title": "" }, { "docid": "5acc6b5967830026d739f4ada021eb3c", "score": "0.5410649", "text": "func New(ctx context.Context, remoteURL, appURL string) (*Repo, error) {\n\tremoteClient, err := remoteConnection(remoteURL)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\thttpClient, err := chttp.New(ctx, remoteURL)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\tlocalClient, err := localConnection()\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\tif e := localClient.CreateDB(ctx, stateDB); e != nil && kivik.StatusCode(e) != kivik.StatusConflict {\n\t\treturn nil, e\n\t}\n\tstateDB, err := localClient.DB(ctx, stateDB)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\tsetTransport(httpClient)\n\treturn &Repo{\n\t\tchttp: httpClient,\n\t\tremote: remoteClient,\n\t\tlocal: localClient,\n\t\tstate: stateDB,\n\t\tappURL: appURL,\n\t}, nil\n}", "title": "" }, { "docid": "ae717ec1c8a7196e6575550e7fcffa60", "score": "0.540899", "text": "func NewMockGreeterRepo(ctrl *gomock.Controller) *MockGreeterRepo {\n\tmock := &MockGreeterRepo{ctrl: ctrl}\n\tmock.recorder = &MockGreeterRepoMockRecorder{mock}\n\treturn mock\n}", "title": "" } ]
8abe9f2f19f273174efdaa51dc19f929
Log a warning message
[ { "docid": "68169a68ecf97f54dc39d92f3f82841a", "score": "0.7497076", "text": "func Warn(msg string, v ...interface{}) { global.Warn(msg, v...) }", "title": "" } ]
[ { "docid": "f2cb699e4c379cb85d4dbf4b1af499b0", "score": "0.8060016", "text": "func (l *Logger) Warning(args ...any) { l.log(WarnLevel, args) }", "title": "" }, { "docid": "68442cb1ab912a9b06b3b00fab623873", "score": "0.7946259", "text": "func (gl *GoLogger) Warning(info, msg string) {\n\tlog.Println(\"[WARNING]\", info, msg)\n}", "title": "" }, { "docid": "62c8622e071e46871fc76703598074e4", "score": "0.79270464", "text": "func (l *DefaultLogger) Warning(args ...interface{}) {\n\tl.logf(WARNING, nil, args...)\n}", "title": "" }, { "docid": "8e4a6e6f23930a083ebf75bde7036126", "score": "0.792208", "text": "func (sl *StandardLogger) Warning(info, msg string) {\n\tsl.writeLog(\"WARNING\", info, msg)\n}", "title": "" }, { "docid": "68e665c7fdee14f57974d5b0d9f0a0c9", "score": "0.7897522", "text": "func (l *Logger) Warning(fmt string, args ...interface{}) {\n\tl.Log(WARNING, fmt, args...)\n}", "title": "" }, { "docid": "5f5899a67eb8ba5d47a1d2479abaccc3", "score": "0.7887056", "text": "func (bl *BeeLogger) Warning(format string, v ...interface{}) {\n\tif LevelWarn > bl.level {\n\t\treturn\n\t}\n\tlm := &LogMsg{\n\t\tLevel: LevelWarn,\n\t\tMsg: format,\n\t\tWhen: time.Now(),\n\t\tArgs: v,\n\t}\n\n\tbl.writeMsg(lm)\n}", "title": "" }, { "docid": "9494c039db6b616c7a606bc8f469f24c", "score": "0.78632206", "text": "func (l glogger) Warning(args ...interface{}) {\n\tglog.Warning(args...)\n}", "title": "" }, { "docid": "a7c20f290a597ea46a8f360410a9e17e", "score": "0.78579754", "text": "func Warning(format string, args ...interface{}) {\n\tlog.Printf(\"[WARN]\"+format, args...)\n}", "title": "" }, { "docid": "d4fcd76ce6677a781e0d8557ef738bca", "score": "0.7817362", "text": "func Warning(args ...interface{}) {\n\tlogger.Warning(args...)\n}", "title": "" }, { "docid": "b6161c225fe75ca9b154eff3dab6d533", "score": "0.78038067", "text": "func Warning(msg string) {\n\tvar l logging\n\tl.level = \"warning\"\n\tl.message = msg\n\tif err := l.write(); err != nil {\n\t\tpanic(err)\n\t}\n}", "title": "" }, { "docid": "f6fcb43e89f0bdc429bb2df779915d55", "score": "0.78015846", "text": "func Warning(v ...interface{}) { log(warning, v...) }", "title": "" }, { "docid": "cdc8d4b8efbb5759394d2732049b2204", "score": "0.7789629", "text": "func (l *Logger) Warning(format string, v ...interface{}) {\n\tif WARNING > l.level {\n\t\treturn\n\t}\n\tl.writeMsg(WARNING, format, v...)\n}", "title": "" }, { "docid": "e7da8b35feb8015e4bae0d343743e8f4", "score": "0.77567464", "text": "func (logger *Logger) Warning(msg string) {\n\tlogger.Entry().Warning(msg)\n}", "title": "" }, { "docid": "79cd5d4666a8d23ca72a80e03e1cc284", "score": "0.7754884", "text": "func Warning(format string, args ...interface{}) {\n\tdefaultLogger.Warning(format, args...)\n}", "title": "" }, { "docid": "728809562eb77d3c9f69bfb055ee60d6", "score": "0.7716687", "text": "func (log *Logger) Warning(msg string, args ...interface{}) {\n\tlog.logAtLevel(syslog.LOG_WARNING, fmt.Sprintf(msg, args...))\n}", "title": "" }, { "docid": "bea85677173b734a9835957bd2039147", "score": "0.77137566", "text": "func (l *Logger) Warning(message string, args ...interface{}) {\n\tl.staged = l.staged[:0]\n\tl.log(WARNING, false, message, args...)\n}", "title": "" }, { "docid": "ebeed0930fcaca1a310045783a64c862", "score": "0.77128804", "text": "func (l *Logger) Warning(message string) error {\r\n\treturn l.writeLog(message, WARNING)\r\n}", "title": "" }, { "docid": "64ea22f1b4142041d00adb26c4fe3b92", "score": "0.7707212", "text": "func (l *stdLogger) Warning(args ...interface{}) {\n\tlog.Print(args...)\n}", "title": "" }, { "docid": "ea0b3e171ffcf25466fdd90f7004f286", "score": "0.77015454", "text": "func (l *Logger) Warning(message string) {\n\tif l.level < LvlWarning {\n\t\treturn\n\t}\n\tl.trace.Print(message)\n}", "title": "" }, { "docid": "6312bf4b65ccf97ca1e207fcb3fb002a", "score": "0.77004766", "text": "func (l *Logger) Warning(args ...interface{}) {\n\tl.Warn(args...)\n}", "title": "" }, { "docid": "6312bf4b65ccf97ca1e207fcb3fb002a", "score": "0.77004766", "text": "func (l *Logger) Warning(args ...interface{}) {\n\tl.Warn(args...)\n}", "title": "" }, { "docid": "907da4ac388f9d51b3f4e965712b82b6", "score": "0.7686664", "text": "func Warning(args ...interface{}) {\n\tpriLogger.Warning(args...)\n}", "title": "" }, { "docid": "bbbb8d6e3484d1ba6ea0c5ca79865688", "score": "0.7665759", "text": "func (g *GoLogger) Warning(f interface{}, v ...interface{}) {\n\tif LevelWarn > g.level {\n\t\treturn\n\t}\n\tformat := formatLog(f, v...)\n\tg.writeMsg(LevelWarn, format, v...)\n}", "title": "" }, { "docid": "1ffc69d278d34e453145ecc4d55d1752", "score": "0.7661764", "text": "func Warning(event string, pairs ...interface{}) {\n\trootLogger.Log(2, WARNING, event, pairs...)\n}", "title": "" }, { "docid": "1b664c2696b11f530ef6f249cde7ed32", "score": "0.7636942", "text": "func Warning(v ...interface{}) {\n\tdefaultLogger.output(sWarning, 0, fmt.Sprint(v...))\n}", "title": "" }, { "docid": "c93181594cd832798fc3fbf0c615702c", "score": "0.76321137", "text": "func (l *Logger) Warning(payload ...string) {\n\tl.log(logging.Warning, payload...)\n}", "title": "" }, { "docid": "478515f77ecc0b0989739e6fd0a5ff87", "score": "0.76212114", "text": "func Warning(format string, args ...interface{}) {\n\tulogger.Logger.Warning(format, args...)\n}", "title": "" }, { "docid": "c37f873154f1efe21975d0134123088c", "score": "0.7620359", "text": "func Warning(args ...interface{}) {\n\tlog.Warning(args...)\n}", "title": "" }, { "docid": "c37f873154f1efe21975d0134123088c", "score": "0.7620359", "text": "func Warning(args ...interface{}) {\n\tlog.Warning(args...)\n}", "title": "" }, { "docid": "40de2e15962a4eb01ad08848691854d4", "score": "0.7598372", "text": "func (n *node) Warning(args ...interface{}) {\n\tn.logLeveled(0, WARNING, fmt.Sprint(args...))\n}", "title": "" }, { "docid": "30ef39daad1877ed44b9abe63d200106", "score": "0.75879014", "text": "func LogWarning(format string, values ...interface{}) {\n\tfmt.Fprintf(Stderr, \"%s %s\\n\", au.Index(222, \"WARN:\"), fmt.Sprintf(format, values...))\n}", "title": "" }, { "docid": "bc39539fe4489a5c0b996f1772a95faf", "score": "0.75861794", "text": "func Warning(format string, v ...interface{}) {\n\tLog(WarningLevel, format, v...)\n}", "title": "" }, { "docid": "f78d80cc4e5bde06a4532ddec865799c", "score": "0.75828326", "text": "func (c *console) warning(time string, location string, message string) {\n\tfmt.Printf(\"%s %s %s\\n\", yellow, formatter(\"WARN\", time, location, message), reset)\n}", "title": "" }, { "docid": "d432dd9f9aa4fbb29d26df778f77bea2", "score": "0.757162", "text": "func (l *Logger) Warning(format string, a ...interface{}) {\n\tl.log.Warning(format, a...)\n}", "title": "" }, { "docid": "bac27af69aa81c548a226b30150b2193", "score": "0.7570978", "text": "func Warning(format string, a ...interface{}) {\n\tLogger.Warning.Output(2, \"] \" + fmt.Sprintf(format, a...))\n}", "title": "" }, { "docid": "762dc042e8e4efe380cf1e05f46f3d84", "score": "0.75587463", "text": "func Warning(msg string, args ...interface{}) {\n\tmsg = fmt.Sprintf(msg, args...)\n\tglog.Warningf(\"warning: %s\\n\", msg)\n}", "title": "" }, { "docid": "2df02c8b6491791f07095999e30570ac", "score": "0.75461245", "text": "func Warning(f interface{}, v ...interface{}) {\n\tlogger.Warning(formatLog(f, v...))\n}", "title": "" }, { "docid": "c4465813acc0962cecec4bd8d55d3853", "score": "0.754406", "text": "func Warning(args ...interface{}) {\n\t//gglog.Warning(args)\n\tlogger.Warn(args)\n}", "title": "" }, { "docid": "14ec062fc9d17163e922a333d440e71b", "score": "0.75388765", "text": "func (l *Logger) Warning(v ...interface{}) {\n\tl.output(sWarning, 0, fmt.Sprint(v...))\n}", "title": "" }, { "docid": "7ea40df61f499e80b1f09fd415ebd3af", "score": "0.753377", "text": "func Warning(args ...interface{}) {\n\tskipLogger().Warn(args...)\n}", "title": "" }, { "docid": "63a1fbc088bb05b79b19c41f6aae4f70", "score": "0.7533476", "text": "func Warning(v ...interface{}) {\n\twrite(fmt.Sprint(v...), (*syslog.Writer).Warning)\n}", "title": "" }, { "docid": "16f63dd616f0067b747643d83d87e430", "score": "0.7524187", "text": "func Warning(message string, a ...interface{}) {\n\tlog.Warning(message, a...)\n}", "title": "" }, { "docid": "f7f8c7c54e6da13ecf691deeb9c0b12f", "score": "0.75035316", "text": "func (l *logger) Warning(v ...interface{}) {\n\tl.bindContextFields()\n\tl.output(LevelWaring, 0, string(l.formatter.Output(l.flags, levelMap[LevelWaring], l.fields, fmt.Sprint(v...))))\n}", "title": "" }, { "docid": "867f19686cb457ce3158786639d59c1b", "score": "0.7503442", "text": "func Warning(args ...interface{}) {\n\n\tloc, _ := time.LoadLocation(\"Asia/Bangkok\")\n\tnow = time.Now().In(loc).Format(\"2006-01-02 15:04:05\")\n\tpc, fn, line, _ := runtime.Caller(1)\n\tfuc := runtime.FuncForPC(pc)\n\tproject := GetFillName(fuc.Name())\n\tl := logss.New(os.Stdout, \"\", 0)\n\tLog(l, fmt.Sprint(args...), \"warn\", fn+\":\"+strconv.Itoa(line), project)\n\t// log.WithFields(logs.Fields{\"time\": now, \"Line\": fn + \":\" + strconv.Itoa(line), \"func\": project, \"z-msg\": fmt.Sprint(args...)}).Warning(\"\")\n}", "title": "" }, { "docid": "dec7295b19c93bf3c5702bb69910a5ff", "score": "0.7496911", "text": "func Warning(args ...interface{}) {\n\tqLogger.Warning(args...)\n}", "title": "" }, { "docid": "7818b93e87852c4e6605680dbc4d0ac5", "score": "0.7496359", "text": "func Warning(v ...interface{}) {\n\tDefaultLogger.Warning(v...)\n}", "title": "" }, { "docid": "aebc94779a034cd22823eef4d5df1f14", "score": "0.7461577", "text": "func Warning(args ...interface{}) {\n\tmodule, mehtod, lineNum := getLogMetadata()\n\tfields := log.Fields{\n\t\tKEY_MODULE_NAME: module,\n\t\tKEY_FUNCTION_NAME: mehtod,\n\t\tKEY_LINE_NUM: lineNum,\n\t}\n\tlog.WithFields(fields).Warning(args)\n}", "title": "" }, { "docid": "a7da42f3ddbb079898f46fc335f4d6ec", "score": "0.743964", "text": "func (logr *AsynchLogger) Warning(msg message.LogMsg) {\n\tlogr.Log(&msg)\n}", "title": "" }, { "docid": "306e728386c53b634e985a708d895ef8", "score": "0.74240565", "text": "func (l *Logger) Warning(v ...interface{}) {\n\tif l.level < logrus.WarnLevel {\n\t\treturn\n\t}\n\tl.logger.WithField(\"module\", l.module).Warning(v...)\n}", "title": "" }, { "docid": "41670d4845e5d0d7c7db8f7cb9ea9005", "score": "0.7422297", "text": "func (l *Logger) Warning(v any) {\n\tif l.checkLogLevel(WarningLevel) {\n\t\tl.output(time.Now().UTC(), WarningLevel, v)\n\t}\n}", "title": "" }, { "docid": "bc528c5fd958ed234bdddbb12dd713c8", "score": "0.7400445", "text": "func (w *WrappedLogger) Warning(m string) error {\n\terr := w.formatOutput(LOG_WARNING, m)\n\treturn err\n}", "title": "" }, { "docid": "966a20179b0a0a23b7c4bef1ce5b3a27", "score": "0.7399523", "text": "func warningLog(v ...interface{}) {\n\tdoLog(warning, WARNING, 3, v...)\n}", "title": "" }, { "docid": "e623d988434fa04a2114da5f45eb6795", "score": "0.739569", "text": "func Warning(args ...interface{}) {\n\tfmt.Println(WARNING, time.Now().Format(\"01/02/06 3:04:05 PM\"), args)\n}", "title": "" }, { "docid": "f87dc0781880d7b1589f5d57a06b1089", "score": "0.73923206", "text": "func (l *Logger) Warning(message string, props Properties) {\n\tl.log(Warning, message, props)\n}", "title": "" }, { "docid": "0c9ed29be3e3666db1731a2f019fdd7b", "score": "0.7388482", "text": "func Warning(f interface{}, v ...interface{}) {\n\tgoLogger.Warn(f, v...)\n}", "title": "" }, { "docid": "334e0230dd9aa8f366c07497a120c20c", "score": "0.7361203", "text": "func (l *Logger) Warn(args ...any) { l.log(WarnLevel, args) }", "title": "" }, { "docid": "6d400feac3e5785be6f8510164ab7007", "score": "0.7358234", "text": "func Warning(v ...interface{}) {\n\tdefaultLogger.bindContextFields()\n\tdefaultLogger.output(LevelWaring, 0, string(defaultLogger.formatter.Output(defaultLogger.flags, levelMap[LevelWaring], defaultLogger.fields, fmt.Sprint(v...))))\n}", "title": "" }, { "docid": "1e6fe63f4d98c826f6fec14b3d5c404f", "score": "0.73521554", "text": "func Warning(f interface{}, v ...interface{}) {\n\tbeeLogger.Warn(formatPattern(f, v...), v...)\n}", "title": "" }, { "docid": "40aa5d7e6eaff1a6c82d8979b7b755ba", "score": "0.7343833", "text": "func Warning(s string, i ...interface{}) {\n\tif !logWriter.enabled {\n\t\treturn\n\t}\n\tif logWriter.warningEnabled {\n\t\tm := fmt.Sprintf(s, i...)\n\t\tif logWriter.locEnabled {\n\t\t\t_, f, line, ok := runtime.Caller(1)\n\t\t\tif ok {\n\t\t\t\tio.WriteString(logWriter.writer, logWriter.warnTxt+time.Now().Format(time.RFC3339Nano)+\"\\t\"+m+\"\\t\"+f+\" line:\"+strconv.Itoa(line)+\"\\n\")\n\t\t\t\treturn\n\t\t\t}\n\t\t\tio.WriteString(logWriter.writer, logWriter.warnTxt+time.Now().Format(time.RFC3339Nano)+\"\\t\"+m+\"\\n\")\n\t\t\treturn\n\t\t}\n\t\tio.WriteString(logWriter.writer, logWriter.warnTxt+time.Now().Format(time.RFC3339Nano)+\"\\t\"+m+\"\\n\")\n\t}\n}", "title": "" }, { "docid": "a9b183376fa8ad9763da06251b04bc3c", "score": "0.73337185", "text": "func Warning(format string, args ...interface{}) {\n\tAppLog.Warning(format, args...)\n}", "title": "" }, { "docid": "72d4a5330a9d847c5d34f605e0f8f589", "score": "0.73108435", "text": "func (log *Logger) Warning(message string, obj ...interface{}) {\n\tlog.Log(message, WARNING, obj...)\n}", "title": "" }, { "docid": "1bb99f8934384d66a2348fb289caf198", "score": "0.7305652", "text": "func (nl *NovaLogger) Warning(v ...interface{}) {\n nl.logrusLogger.Warning(v...)\n}", "title": "" }, { "docid": "8ce3c4ee9024aa6e0355f5a5fa483727", "score": "0.7288372", "text": "func Warning(msg string, args ...interface{}) {\n\tAppLog.Warning(msg, args...)\n}", "title": "" }, { "docid": "bb31d8a146007474e64599d31e9e4458", "score": "0.7285932", "text": "func (logger *Logger) Warning(v ...interface{}) {\n\tif logger.warningLogger != nil {\n\t\t_ = logger.warningLogger.Output(logger.depth, logger.wrap(fmt.Sprintln(v...)))\n\t}\n}", "title": "" }, { "docid": "1f08ef1b37aea8de6c67acbebd1eb5ee", "score": "0.72760546", "text": "func Warning(args ...interface{}) {\n\tLogrusEntry.Warning(args...)\n}", "title": "" }, { "docid": "9df4093dca5639b7379594b589736435", "score": "0.72620577", "text": "func (j *Journal) Warning(fmt string, vals ...interface{}) {\n\tj.mux.Lock()\n\twriteMsg(j.w, msgFmt, j.warningStr, getMsg(fmt, vals))\n\tj.mux.Unlock()\n}", "title": "" }, { "docid": "8ecba16b10767356270af3422509d5fd", "score": "0.72487015", "text": "func (logger *Manager) Warning(logType string, messageParts ...string) {\n\tlogger.Log(LogWarning, logType, messageParts...)\n}", "title": "" }, { "docid": "9f327d143f9326e186d268a4c4c5789f", "score": "0.7246983", "text": "func (l *CustomLogger) LogWarning(str string) {\n\tif l.logLevel >= WARN {\n\t\tl.logMessage(str, WARN)\n\t}\n}", "title": "" }, { "docid": "b49a8cbdf0a76cfb6d733f6a70dcd233", "score": "0.72160816", "text": "func (n *MemoryLogger) Warning(format string, args ...interface{}) {\n\tn.Warnings = append(n.Warnings, fmt.Sprintf(format, args))\n}", "title": "" }, { "docid": "bd2aac5371c6a3baee12d12cd70d20d8", "score": "0.72083473", "text": "func Warning(l grpclog.DepthLoggerV2, id *Identifier, args ...interface{}) {\n\tAddTraceEvent(l, id, 1, &TraceEventDesc{\n\t\tDesc: fmt.Sprint(args...),\n\t\tSeverity: CtWarning,\n\t})\n}", "title": "" }, { "docid": "ce9d149a3b4864d0fbc66eec5730c703", "score": "0.7195593", "text": "func (rl *RequestLogger) Warning(msg string) {\n\trl.b.Warning(msg)\n}", "title": "" }, { "docid": "bf943f7157a33b422b10ad1af0e63a82", "score": "0.7187014", "text": "func (logger *Logger) Warning(args ...interface{}) {\n\tlogger.WithField(PrefixField, logger.prefix).Warn(args...)\n}", "title": "" }, { "docid": "74c0073ce1a08a7d8b458209e8f75420", "score": "0.7168146", "text": "func (z *NoopLogger) Warn(args ...interface{}) {}", "title": "" }, { "docid": "24e3643458eff79b50c09bd84b11e855", "score": "0.71552515", "text": "func Warning(args ...interface{}) {\n\tstd.Warning(args...)\n}", "title": "" }, { "docid": "8be4e82a392e1ae1ff13a340786fcdfb", "score": "0.7151659", "text": "func Warn(m string) {\n // Invoke writeLog function with WARN level and message\n writeLog(WARN, m)\n}", "title": "" }, { "docid": "cd56aced845874e4f357e667e82ef68a", "score": "0.7144915", "text": "func Warn(args ...interface{}) error {\n\tmsg := FormatMessage(args...)\n\tstd.Log(2, WARNING, msg)\n\treturn errors.New(msg)\n}", "title": "" }, { "docid": "d72fd4155915afee7d12e97579a9c5e1", "score": "0.7139374", "text": "func (me *TextLogger) Warning(context Context, message string) {\n\tcurrent := (&Context{\n\t\t\"level\": WarningLevel,\n\t\t\"message\": message,\n\t}).Append(&context)\n\n\tme.write(YELLOW, current)\n\tos.Exit(0)\n}", "title": "" }, { "docid": "b3c1be9955fc988de22c81df3da83e43", "score": "0.71361524", "text": "func (l *Logger) Warn(args ...interface{}) {\n\tl.logentry(\"[WARN]\", args...)\n}", "title": "" }, { "docid": "d4210ae2d14ee02e14b5fd7ab902cfea", "score": "0.71355605", "text": "func Warning(message string) {\n\tBuilder().Warning(message)\n}", "title": "" }, { "docid": "3e732bb08cba7e342c96e94a3e477063", "score": "0.713202", "text": "func (cl *ColorLogger) Warning(v ...interface{}) {\n\tcl.Output(fmt.Sprintln(v...), Orange)\n}", "title": "" }, { "docid": "4e0c75706de62563cc51061818fdb9dd", "score": "0.7108583", "text": "func (rl *ResponderLogger) Warning(msg string) error {\n\trl.Log.Warning(\"[responder] \" + msg)\n\treturn nil\n}", "title": "" }, { "docid": "e0f269aa110ebdd265b13e1678d7b883", "score": "0.70958185", "text": "func (w *Writer) Warning(m string) error {\n\t_, err := w.writeAndRetry(LOG_WARNING, m)\n\treturn err\n}", "title": "" }, { "docid": "538fac8728a86e8ba84367e59faca26e", "score": "0.70945543", "text": "func (l *fakeLogger) Warningf(format string, v ...interface{}) {}", "title": "" }, { "docid": "1a6a41fd31fa5b3445c0bbe281ba067e", "score": "0.7093092", "text": "func LogWarning(err error) {\n\tcolor.Fprintf(os.Stderr, \"@{y!}Warning:@{y} %s\\n\", err)\n}", "title": "" }, { "docid": "b865d84070fb0598fe8af7452b5116e7", "score": "0.70928824", "text": "func (l *Logger) Warn(msg ...interface{}){\n\tif err:= l.log(\"warn\", msg); err!=nil{\n\t\tfmt.Println(\"ERROR\", err);\n\t}\n\t\n}", "title": "" }, { "docid": "b1add540639428e4dfb1ec939b41029b", "score": "0.7086124", "text": "func (logger Logger) Warn(args ...interface{}) {\n\tlogger.log(int(logging.Warning), args...)\n}", "title": "" }, { "docid": "ab6d32790f3284030765fcc65a4ebec7", "score": "0.7071744", "text": "func (l *NullLogger) Warn(msg string, args ...interface{}) {}", "title": "" }, { "docid": "d39c09b9fa550798d0eca09a1a64ba8f", "score": "0.7057601", "text": "func Warningln(args ...interface{}) {\n\t//gglog.Warningln(args)\n\tlogger.Warn(args)\n}", "title": "" }, { "docid": "ccb3f04f65997e24c0ca03f54fd38abe", "score": "0.70512974", "text": "func (l *logger) Warn(msg ...interface{}) {\n\tlog(l, WARNING, msg...)\n}", "title": "" }, { "docid": "807b6da38c997cb3bb26ace0d4a2adbc", "score": "0.70401555", "text": "func Warningf(format string, v ...interface{}) { logf(warning, format, v...) }", "title": "" }, { "docid": "3007836a75a521cf3202914162a94f4c", "score": "0.7032123", "text": "func Warning(message string, details ...string) {\n\tmsg := alert.Warning(message, details...)\n\tfmt.Print(msg)\n}", "title": "" }, { "docid": "c2af0d1765effd27080b302bd60bfe03", "score": "0.70292306", "text": "func Warningln(args ...interface{}) {\n\tlogger.Warningln(args...)\n}", "title": "" }, { "docid": "a8956607ad588b1b1fe3f30377d7b7ef", "score": "0.70268387", "text": "func Warn(v ...interface{}) {\n\tmu.Lock()\n\tdefer mu.Unlock()\n\tsetPrefix(WARNING)\n\tlogger.Println(v...)\n}", "title": "" }, { "docid": "c37ef9a929be7fab5c179a3cba486953", "score": "0.7011558", "text": "func Warnf(format string, v ...interface{}) { logger.lprintf(WARN, format, v...) }", "title": "" }, { "docid": "5af8b14486f66e645d362d3e65642261", "score": "0.70012397", "text": "func (s *LoggingStrategy) Warning(message string, fields ...map[string]interface{}) {\n\tfor _, logger := range s.loggers {\n\t\tif err := logger.Warning(message, fields...); err == nil {\n\t\t\treturn\n\t\t}\n\t}\n\n\tfmt.Println(fmt.Sprintf(\"Unable to write Warning to any logger - error: '%s', fields: '%v'\", message, fields))\n}", "title": "" }, { "docid": "7436ebc26e0943d798a29a4011337a01", "score": "0.6996954", "text": "func (p *SimpleCommandProgram) Warning(msg string) {\n msg = fmt.Sprintf(\"WARNING: %s\", msg)\n color.Yellow(msg)\n}", "title": "" }, { "docid": "053f807e92fef203cec2c7fb8b6265cd", "score": "0.6978246", "text": "func Warn(args ...interface{}) {\n\tglobalLogger.Warn(args...)\n}", "title": "" }, { "docid": "ced3f7c6a9c7915a73d10dfd664ad561", "score": "0.697707", "text": "func Warning(v any) {\n\tstd.Warning(v)\n}", "title": "" }, { "docid": "4237f7313ad95ac30903d8e1756256fa", "score": "0.69760543", "text": "func (p *Printer) PrintWarn(msg string, a ...interface{}) {\n if p.LogLevel >= WARNING {\n PrettyPrintWarn(msg, a...)\n }\n}", "title": "" }, { "docid": "b538a9cc94e3245bc89fde6117210002", "score": "0.69756174", "text": "func LogWarning(fileSource string, warning string) {\n\tLogWarningAPI(COMMON, fileSource, warning)\n}", "title": "" } ]
27a42cf480111066f61d90f5bf367d79
flattenDashboardGridLayoutWidgetsScorecardTimeSeriesQueryTimeSeriesFilterRatioPickTimeSeriesFilterDirectionEnum asserts that an interface is a string, and returns a pointer to a DashboardGridLayoutWidgetsScorecardTimeSeriesQueryTimeSeriesFilterRatioPickTimeSeriesFilterDirectionEnum with the same value as that string.
[ { "docid": "7c806cf925fa46fd21855968df304987", "score": "0.82089746", "text": "func flattenDashboardGridLayoutWidgetsScorecardTimeSeriesQueryTimeSeriesFilterRatioPickTimeSeriesFilterDirectionEnum(i interface{}) *DashboardGridLayoutWidgetsScorecardTimeSeriesQueryTimeSeriesFilterRatioPickTimeSeriesFilterDirectionEnum {\n\ts, ok := i.(string)\n\tif !ok {\n\t\treturn nil\n\t}\n\n\treturn DashboardGridLayoutWidgetsScorecardTimeSeriesQueryTimeSeriesFilterRatioPickTimeSeriesFilterDirectionEnumRef(s)\n}", "title": "" } ]
[ { "docid": "3d00b0172cd0d79baab222d4237fa5df", "score": "0.8210908", "text": "func flattenDashboardGridLayoutWidgetsScorecardTimeSeriesQueryTimeSeriesFilterPickTimeSeriesFilterDirectionEnum(i interface{}) *DashboardGridLayoutWidgetsScorecardTimeSeriesQueryTimeSeriesFilterPickTimeSeriesFilterDirectionEnum {\n\ts, ok := i.(string)\n\tif !ok {\n\t\treturn nil\n\t}\n\n\treturn DashboardGridLayoutWidgetsScorecardTimeSeriesQueryTimeSeriesFilterPickTimeSeriesFilterDirectionEnumRef(s)\n}", "title": "" }, { "docid": "06cf099b5b4abcb989951ca1c7894f80", "score": "0.8012996", "text": "func flattenDashboardColumnLayoutColumnsWidgetsScorecardTimeSeriesQueryTimeSeriesFilterRatioPickTimeSeriesFilterDirectionEnum(i interface{}) *DashboardColumnLayoutColumnsWidgetsScorecardTimeSeriesQueryTimeSeriesFilterRatioPickTimeSeriesFilterDirectionEnum {\n\ts, ok := i.(string)\n\tif !ok {\n\t\treturn nil\n\t}\n\n\treturn DashboardColumnLayoutColumnsWidgetsScorecardTimeSeriesQueryTimeSeriesFilterRatioPickTimeSeriesFilterDirectionEnumRef(s)\n}", "title": "" }, { "docid": "80e55101167d577dbd479c77101e52db", "score": "0.80119246", "text": "func flattenDashboardColumnLayoutColumnsWidgetsScorecardTimeSeriesQueryTimeSeriesFilterPickTimeSeriesFilterDirectionEnum(i interface{}) *DashboardColumnLayoutColumnsWidgetsScorecardTimeSeriesQueryTimeSeriesFilterPickTimeSeriesFilterDirectionEnum {\n\ts, ok := i.(string)\n\tif !ok {\n\t\treturn nil\n\t}\n\n\treturn DashboardColumnLayoutColumnsWidgetsScorecardTimeSeriesQueryTimeSeriesFilterPickTimeSeriesFilterDirectionEnumRef(s)\n}", "title": "" }, { "docid": "168938b4a25c55a77e1130fbcee059a6", "score": "0.78813255", "text": "func flattenDashboardGridLayoutWidgetsXyChartDataSetsTimeSeriesQueryTimeSeriesFilterRatioPickTimeSeriesFilterDirectionEnum(i interface{}) *DashboardGridLayoutWidgetsXyChartDataSetsTimeSeriesQueryTimeSeriesFilterRatioPickTimeSeriesFilterDirectionEnum {\n\ts, ok := i.(string)\n\tif !ok {\n\t\treturn nil\n\t}\n\n\treturn DashboardGridLayoutWidgetsXyChartDataSetsTimeSeriesQueryTimeSeriesFilterRatioPickTimeSeriesFilterDirectionEnumRef(s)\n}", "title": "" }, { "docid": "40b7f73891de9b1585fc0c72270370cf", "score": "0.78524995", "text": "func flattenDashboardGridLayoutWidgetsXyChartDataSetsTimeSeriesQueryTimeSeriesFilterPickTimeSeriesFilterDirectionEnum(i interface{}) *DashboardGridLayoutWidgetsXyChartDataSetsTimeSeriesQueryTimeSeriesFilterPickTimeSeriesFilterDirectionEnum {\n\ts, ok := i.(string)\n\tif !ok {\n\t\treturn nil\n\t}\n\n\treturn DashboardGridLayoutWidgetsXyChartDataSetsTimeSeriesQueryTimeSeriesFilterPickTimeSeriesFilterDirectionEnumRef(s)\n}", "title": "" }, { "docid": "c1edf85a1bab186c03f209f6bed014e6", "score": "0.7781231", "text": "func flattenDashboardRowLayoutRowsWidgetsScorecardTimeSeriesQueryTimeSeriesFilterPickTimeSeriesFilterDirectionEnum(i interface{}) *DashboardRowLayoutRowsWidgetsScorecardTimeSeriesQueryTimeSeriesFilterPickTimeSeriesFilterDirectionEnum {\n\ts, ok := i.(string)\n\tif !ok {\n\t\treturn nil\n\t}\n\n\treturn DashboardRowLayoutRowsWidgetsScorecardTimeSeriesQueryTimeSeriesFilterPickTimeSeriesFilterDirectionEnumRef(s)\n}", "title": "" }, { "docid": "e844311d6196575227b6ecebaff0f65e", "score": "0.7772225", "text": "func flattenDashboardRowLayoutRowsWidgetsScorecardTimeSeriesQueryTimeSeriesFilterRatioPickTimeSeriesFilterDirectionEnum(i interface{}) *DashboardRowLayoutRowsWidgetsScorecardTimeSeriesQueryTimeSeriesFilterRatioPickTimeSeriesFilterDirectionEnum {\n\ts, ok := i.(string)\n\tif !ok {\n\t\treturn nil\n\t}\n\n\treturn DashboardRowLayoutRowsWidgetsScorecardTimeSeriesQueryTimeSeriesFilterRatioPickTimeSeriesFilterDirectionEnumRef(s)\n}", "title": "" }, { "docid": "a6402ed6d282f4f91f34eb9fbc25f44a", "score": "0.76760316", "text": "func flattenDashboardMosaicLayoutTilesWidgetScorecardTimeSeriesQueryTimeSeriesFilterPickTimeSeriesFilterDirectionEnum(i interface{}) *DashboardMosaicLayoutTilesWidgetScorecardTimeSeriesQueryTimeSeriesFilterPickTimeSeriesFilterDirectionEnum {\n\ts, ok := i.(string)\n\tif !ok {\n\t\treturn nil\n\t}\n\n\treturn DashboardMosaicLayoutTilesWidgetScorecardTimeSeriesQueryTimeSeriesFilterPickTimeSeriesFilterDirectionEnumRef(s)\n}", "title": "" }, { "docid": "e0bfe739455d5e97fe5aea2d0eb74cf5", "score": "0.76745206", "text": "func flattenDashboardMosaicLayoutTilesWidgetScorecardTimeSeriesQueryTimeSeriesFilterRatioPickTimeSeriesFilterDirectionEnum(i interface{}) *DashboardMosaicLayoutTilesWidgetScorecardTimeSeriesQueryTimeSeriesFilterRatioPickTimeSeriesFilterDirectionEnum {\n\ts, ok := i.(string)\n\tif !ok {\n\t\treturn nil\n\t}\n\n\treturn DashboardMosaicLayoutTilesWidgetScorecardTimeSeriesQueryTimeSeriesFilterRatioPickTimeSeriesFilterDirectionEnumRef(s)\n}", "title": "" }, { "docid": "9ba442789687c3da70fadc5bad664709", "score": "0.75653434", "text": "func flattenDashboardColumnLayoutColumnsWidgetsXyChartDataSetsTimeSeriesQueryTimeSeriesFilterRatioPickTimeSeriesFilterDirectionEnum(i interface{}) *DashboardColumnLayoutColumnsWidgetsXyChartDataSetsTimeSeriesQueryTimeSeriesFilterRatioPickTimeSeriesFilterDirectionEnum {\n\ts, ok := i.(string)\n\tif !ok {\n\t\treturn nil\n\t}\n\n\treturn DashboardColumnLayoutColumnsWidgetsXyChartDataSetsTimeSeriesQueryTimeSeriesFilterRatioPickTimeSeriesFilterDirectionEnumRef(s)\n}", "title": "" }, { "docid": "7b47912c49808a1deb6fd16d00bbbcfa", "score": "0.75429666", "text": "func flattenDashboardColumnLayoutColumnsWidgetsXyChartDataSetsTimeSeriesQueryTimeSeriesFilterPickTimeSeriesFilterDirectionEnum(i interface{}) *DashboardColumnLayoutColumnsWidgetsXyChartDataSetsTimeSeriesQueryTimeSeriesFilterPickTimeSeriesFilterDirectionEnum {\n\ts, ok := i.(string)\n\tif !ok {\n\t\treturn nil\n\t}\n\n\treturn DashboardColumnLayoutColumnsWidgetsXyChartDataSetsTimeSeriesQueryTimeSeriesFilterPickTimeSeriesFilterDirectionEnumRef(s)\n}", "title": "" }, { "docid": "570a82c9b173f6def315b0b71a4668ba", "score": "0.7512693", "text": "func flattenDashboardGridLayoutWidgetsScorecardTimeSeriesQueryTimeSeriesFilterPickTimeSeriesFilterRankingMethodEnum(i interface{}) *DashboardGridLayoutWidgetsScorecardTimeSeriesQueryTimeSeriesFilterPickTimeSeriesFilterRankingMethodEnum {\n\ts, ok := i.(string)\n\tif !ok {\n\t\treturn nil\n\t}\n\n\treturn DashboardGridLayoutWidgetsScorecardTimeSeriesQueryTimeSeriesFilterPickTimeSeriesFilterRankingMethodEnumRef(s)\n}", "title": "" }, { "docid": "bf9bcc67dfe28419b3751d25844ec4c5", "score": "0.7366218", "text": "func flattenDashboardGridLayoutWidgetsScorecardTimeSeriesQueryTimeSeriesFilterRatioPickTimeSeriesFilterRankingMethodEnum(i interface{}) *DashboardGridLayoutWidgetsScorecardTimeSeriesQueryTimeSeriesFilterRatioPickTimeSeriesFilterRankingMethodEnum {\n\ts, ok := i.(string)\n\tif !ok {\n\t\treturn nil\n\t}\n\n\treturn DashboardGridLayoutWidgetsScorecardTimeSeriesQueryTimeSeriesFilterRatioPickTimeSeriesFilterRankingMethodEnumRef(s)\n}", "title": "" }, { "docid": "93344213f9e6be4de0b051f4ab3bdf47", "score": "0.7347079", "text": "func flattenDashboardColumnLayoutColumnsWidgetsScorecardTimeSeriesQueryTimeSeriesFilterPickTimeSeriesFilterRankingMethodEnum(i interface{}) *DashboardColumnLayoutColumnsWidgetsScorecardTimeSeriesQueryTimeSeriesFilterPickTimeSeriesFilterRankingMethodEnum {\n\ts, ok := i.(string)\n\tif !ok {\n\t\treturn nil\n\t}\n\n\treturn DashboardColumnLayoutColumnsWidgetsScorecardTimeSeriesQueryTimeSeriesFilterPickTimeSeriesFilterRankingMethodEnumRef(s)\n}", "title": "" }, { "docid": "e67a77fd3e904030d364c240a8d4b23c", "score": "0.72776824", "text": "func flattenDashboardRowLayoutRowsWidgetsXyChartDataSetsTimeSeriesQueryTimeSeriesFilterRatioPickTimeSeriesFilterDirectionEnum(i interface{}) *DashboardRowLayoutRowsWidgetsXyChartDataSetsTimeSeriesQueryTimeSeriesFilterRatioPickTimeSeriesFilterDirectionEnum {\n\ts, ok := i.(string)\n\tif !ok {\n\t\treturn nil\n\t}\n\n\treturn DashboardRowLayoutRowsWidgetsXyChartDataSetsTimeSeriesQueryTimeSeriesFilterRatioPickTimeSeriesFilterDirectionEnumRef(s)\n}", "title": "" }, { "docid": "a77d5598a7f66be7736636deb77cd477", "score": "0.7274611", "text": "func flattenDashboardRowLayoutRowsWidgetsXyChartDataSetsTimeSeriesQueryTimeSeriesFilterPickTimeSeriesFilterDirectionEnum(i interface{}) *DashboardRowLayoutRowsWidgetsXyChartDataSetsTimeSeriesQueryTimeSeriesFilterPickTimeSeriesFilterDirectionEnum {\n\ts, ok := i.(string)\n\tif !ok {\n\t\treturn nil\n\t}\n\n\treturn DashboardRowLayoutRowsWidgetsXyChartDataSetsTimeSeriesQueryTimeSeriesFilterPickTimeSeriesFilterDirectionEnumRef(s)\n}", "title": "" }, { "docid": "fa913b99a7481876d84f5649dcc4b197", "score": "0.72583103", "text": "func flattenDashboardGridLayoutWidgetsXyChartDataSetsTimeSeriesQueryTimeSeriesFilterPickTimeSeriesFilterRankingMethodEnum(i interface{}) *DashboardGridLayoutWidgetsXyChartDataSetsTimeSeriesQueryTimeSeriesFilterPickTimeSeriesFilterRankingMethodEnum {\n\ts, ok := i.(string)\n\tif !ok {\n\t\treturn nil\n\t}\n\n\treturn DashboardGridLayoutWidgetsXyChartDataSetsTimeSeriesQueryTimeSeriesFilterPickTimeSeriesFilterRankingMethodEnumRef(s)\n}", "title": "" }, { "docid": "d07cdd7dfa21f0e7f916404a1d1ef280", "score": "0.7219475", "text": "func flattenDashboardColumnLayoutColumnsWidgetsScorecardTimeSeriesQueryTimeSeriesFilterRatioPickTimeSeriesFilterRankingMethodEnum(i interface{}) *DashboardColumnLayoutColumnsWidgetsScorecardTimeSeriesQueryTimeSeriesFilterRatioPickTimeSeriesFilterRankingMethodEnum {\n\ts, ok := i.(string)\n\tif !ok {\n\t\treturn nil\n\t}\n\n\treturn DashboardColumnLayoutColumnsWidgetsScorecardTimeSeriesQueryTimeSeriesFilterRatioPickTimeSeriesFilterRankingMethodEnumRef(s)\n}", "title": "" }, { "docid": "cdcda037f148193c0be5e88bd8aabf91", "score": "0.7209472", "text": "func flattenDashboardMosaicLayoutTilesWidgetXyChartDataSetsTimeSeriesQueryTimeSeriesFilterPickTimeSeriesFilterDirectionEnum(i interface{}) *DashboardMosaicLayoutTilesWidgetXyChartDataSetsTimeSeriesQueryTimeSeriesFilterPickTimeSeriesFilterDirectionEnum {\n\ts, ok := i.(string)\n\tif !ok {\n\t\treturn nil\n\t}\n\n\treturn DashboardMosaicLayoutTilesWidgetXyChartDataSetsTimeSeriesQueryTimeSeriesFilterPickTimeSeriesFilterDirectionEnumRef(s)\n}", "title": "" }, { "docid": "3a99b5e2455e1c5c15d46775a9b9664b", "score": "0.71963555", "text": "func flattenDashboardMosaicLayoutTilesWidgetXyChartDataSetsTimeSeriesQueryTimeSeriesFilterRatioPickTimeSeriesFilterDirectionEnum(i interface{}) *DashboardMosaicLayoutTilesWidgetXyChartDataSetsTimeSeriesQueryTimeSeriesFilterRatioPickTimeSeriesFilterDirectionEnum {\n\ts, ok := i.(string)\n\tif !ok {\n\t\treturn nil\n\t}\n\n\treturn DashboardMosaicLayoutTilesWidgetXyChartDataSetsTimeSeriesQueryTimeSeriesFilterRatioPickTimeSeriesFilterDirectionEnumRef(s)\n}", "title": "" }, { "docid": "827a78de488b8d311c5028f9fea74cf4", "score": "0.71302754", "text": "func flattenDashboardRowLayoutRowsWidgetsScorecardTimeSeriesQueryTimeSeriesFilterPickTimeSeriesFilterRankingMethodEnum(i interface{}) *DashboardRowLayoutRowsWidgetsScorecardTimeSeriesQueryTimeSeriesFilterPickTimeSeriesFilterRankingMethodEnum {\n\ts, ok := i.(string)\n\tif !ok {\n\t\treturn nil\n\t}\n\n\treturn DashboardRowLayoutRowsWidgetsScorecardTimeSeriesQueryTimeSeriesFilterPickTimeSeriesFilterRankingMethodEnumRef(s)\n}", "title": "" }, { "docid": "8e7462d9ada96db6a67a9d02bb4b60ed", "score": "0.70941687", "text": "func flattenDashboardMosaicLayoutTilesWidgetScorecardTimeSeriesQueryTimeSeriesFilterPickTimeSeriesFilterRankingMethodEnum(i interface{}) *DashboardMosaicLayoutTilesWidgetScorecardTimeSeriesQueryTimeSeriesFilterPickTimeSeriesFilterRankingMethodEnum {\n\ts, ok := i.(string)\n\tif !ok {\n\t\treturn nil\n\t}\n\n\treturn DashboardMosaicLayoutTilesWidgetScorecardTimeSeriesQueryTimeSeriesFilterPickTimeSeriesFilterRankingMethodEnumRef(s)\n}", "title": "" }, { "docid": "cf2c50b750e0728b38fb837549a05970", "score": "0.70701367", "text": "func flattenDashboardGridLayoutWidgetsXyChartDataSetsTimeSeriesQueryTimeSeriesFilterRatioPickTimeSeriesFilterRankingMethodEnum(i interface{}) *DashboardGridLayoutWidgetsXyChartDataSetsTimeSeriesQueryTimeSeriesFilterRatioPickTimeSeriesFilterRankingMethodEnum {\n\ts, ok := i.(string)\n\tif !ok {\n\t\treturn nil\n\t}\n\n\treturn DashboardGridLayoutWidgetsXyChartDataSetsTimeSeriesQueryTimeSeriesFilterRatioPickTimeSeriesFilterRankingMethodEnumRef(s)\n}", "title": "" }, { "docid": "36da752861729b8576960aa9c33caf09", "score": "0.70174176", "text": "func flattenDashboardColumnLayoutColumnsWidgetsXyChartDataSetsTimeSeriesQueryTimeSeriesFilterPickTimeSeriesFilterRankingMethodEnum(i interface{}) *DashboardColumnLayoutColumnsWidgetsXyChartDataSetsTimeSeriesQueryTimeSeriesFilterPickTimeSeriesFilterRankingMethodEnum {\n\ts, ok := i.(string)\n\tif !ok {\n\t\treturn nil\n\t}\n\n\treturn DashboardColumnLayoutColumnsWidgetsXyChartDataSetsTimeSeriesQueryTimeSeriesFilterPickTimeSeriesFilterRankingMethodEnumRef(s)\n}", "title": "" }, { "docid": "a3d3de413a6c53c78d6ca7fd629c3b69", "score": "0.699958", "text": "func flattenDashboardRowLayoutRowsWidgetsScorecardTimeSeriesQueryTimeSeriesFilterRatioPickTimeSeriesFilterRankingMethodEnum(i interface{}) *DashboardRowLayoutRowsWidgetsScorecardTimeSeriesQueryTimeSeriesFilterRatioPickTimeSeriesFilterRankingMethodEnum {\n\ts, ok := i.(string)\n\tif !ok {\n\t\treturn nil\n\t}\n\n\treturn DashboardRowLayoutRowsWidgetsScorecardTimeSeriesQueryTimeSeriesFilterRatioPickTimeSeriesFilterRankingMethodEnumRef(s)\n}", "title": "" }, { "docid": "b13ffc4df0bc4212d8fa92b0c6a02e54", "score": "0.6963626", "text": "func flattenDashboardMosaicLayoutTilesWidgetScorecardTimeSeriesQueryTimeSeriesFilterRatioPickTimeSeriesFilterRankingMethodEnum(i interface{}) *DashboardMosaicLayoutTilesWidgetScorecardTimeSeriesQueryTimeSeriesFilterRatioPickTimeSeriesFilterRankingMethodEnum {\n\ts, ok := i.(string)\n\tif !ok {\n\t\treturn nil\n\t}\n\n\treturn DashboardMosaicLayoutTilesWidgetScorecardTimeSeriesQueryTimeSeriesFilterRatioPickTimeSeriesFilterRankingMethodEnumRef(s)\n}", "title": "" }, { "docid": "0077fd9d4cf4f3b41e2dd9467af40385", "score": "0.68548495", "text": "func flattenDashboardColumnLayoutColumnsWidgetsXyChartDataSetsTimeSeriesQueryTimeSeriesFilterRatioPickTimeSeriesFilterRankingMethodEnum(i interface{}) *DashboardColumnLayoutColumnsWidgetsXyChartDataSetsTimeSeriesQueryTimeSeriesFilterRatioPickTimeSeriesFilterRankingMethodEnum {\n\ts, ok := i.(string)\n\tif !ok {\n\t\treturn nil\n\t}\n\n\treturn DashboardColumnLayoutColumnsWidgetsXyChartDataSetsTimeSeriesQueryTimeSeriesFilterRatioPickTimeSeriesFilterRankingMethodEnumRef(s)\n}", "title": "" }, { "docid": "5b7cad1aaf305598431a9c0a7926c6fa", "score": "0.68154675", "text": "func flattenDashboardGridLayoutWidgetsScorecardTimeSeriesQueryTimeSeriesFilterAggregationCrossSeriesReducerEnum(i interface{}) *DashboardGridLayoutWidgetsScorecardTimeSeriesQueryTimeSeriesFilterAggregationCrossSeriesReducerEnum {\n\ts, ok := i.(string)\n\tif !ok {\n\t\treturn nil\n\t}\n\n\treturn DashboardGridLayoutWidgetsScorecardTimeSeriesQueryTimeSeriesFilterAggregationCrossSeriesReducerEnumRef(s)\n}", "title": "" }, { "docid": "2e861a3569e08181f3b4c0e26b25e670", "score": "0.68042654", "text": "func flattenDashboardGridLayoutWidgetsScorecardTimeSeriesQueryTimeSeriesFilterPickTimeSeriesFilterDirectionEnumSlice(c *Client, i interface{}, res *Dashboard) []DashboardGridLayoutWidgetsScorecardTimeSeriesQueryTimeSeriesFilterPickTimeSeriesFilterDirectionEnum {\n\ta, ok := i.([]interface{})\n\tif !ok {\n\t\treturn []DashboardGridLayoutWidgetsScorecardTimeSeriesQueryTimeSeriesFilterPickTimeSeriesFilterDirectionEnum{}\n\t}\n\n\tif len(a) == 0 {\n\t\treturn []DashboardGridLayoutWidgetsScorecardTimeSeriesQueryTimeSeriesFilterPickTimeSeriesFilterDirectionEnum{}\n\t}\n\n\titems := make([]DashboardGridLayoutWidgetsScorecardTimeSeriesQueryTimeSeriesFilterPickTimeSeriesFilterDirectionEnum, 0, len(a))\n\tfor _, item := range a {\n\t\titems = append(items, *flattenDashboardGridLayoutWidgetsScorecardTimeSeriesQueryTimeSeriesFilterPickTimeSeriesFilterDirectionEnum(item.(interface{})))\n\t}\n\n\treturn items\n}", "title": "" }, { "docid": "dec3e71f2e12b5bfefe6d458047f55c3", "score": "0.6802682", "text": "func flattenDashboardGridLayoutWidgetsScorecardTimeSeriesQueryTimeSeriesFilterSecondaryAggregationCrossSeriesReducerEnum(i interface{}) *DashboardGridLayoutWidgetsScorecardTimeSeriesQueryTimeSeriesFilterSecondaryAggregationCrossSeriesReducerEnum {\n\ts, ok := i.(string)\n\tif !ok {\n\t\treturn nil\n\t}\n\n\treturn DashboardGridLayoutWidgetsScorecardTimeSeriesQueryTimeSeriesFilterSecondaryAggregationCrossSeriesReducerEnumRef(s)\n}", "title": "" }, { "docid": "e9d61d3bd27975200140c6614ddddfae", "score": "0.6782604", "text": "func flattenDashboardGridLayoutWidgetsScorecardTimeSeriesQueryTimeSeriesFilterAggregationPerSeriesAlignerEnum(i interface{}) *DashboardGridLayoutWidgetsScorecardTimeSeriesQueryTimeSeriesFilterAggregationPerSeriesAlignerEnum {\n\ts, ok := i.(string)\n\tif !ok {\n\t\treturn nil\n\t}\n\n\treturn DashboardGridLayoutWidgetsScorecardTimeSeriesQueryTimeSeriesFilterAggregationPerSeriesAlignerEnumRef(s)\n}", "title": "" }, { "docid": "c4765042580e33d7c49bf4836aa4366c", "score": "0.6770461", "text": "func flattenDashboardGridLayoutWidgetsScorecardTimeSeriesQueryTimeSeriesFilterRatioPickTimeSeriesFilterDirectionEnumSlice(c *Client, i interface{}, res *Dashboard) []DashboardGridLayoutWidgetsScorecardTimeSeriesQueryTimeSeriesFilterRatioPickTimeSeriesFilterDirectionEnum {\n\ta, ok := i.([]interface{})\n\tif !ok {\n\t\treturn []DashboardGridLayoutWidgetsScorecardTimeSeriesQueryTimeSeriesFilterRatioPickTimeSeriesFilterDirectionEnum{}\n\t}\n\n\tif len(a) == 0 {\n\t\treturn []DashboardGridLayoutWidgetsScorecardTimeSeriesQueryTimeSeriesFilterRatioPickTimeSeriesFilterDirectionEnum{}\n\t}\n\n\titems := make([]DashboardGridLayoutWidgetsScorecardTimeSeriesQueryTimeSeriesFilterRatioPickTimeSeriesFilterDirectionEnum, 0, len(a))\n\tfor _, item := range a {\n\t\titems = append(items, *flattenDashboardGridLayoutWidgetsScorecardTimeSeriesQueryTimeSeriesFilterRatioPickTimeSeriesFilterDirectionEnum(item.(interface{})))\n\t}\n\n\treturn items\n}", "title": "" }, { "docid": "57c33584b515f66b0059f9701922330d", "score": "0.6756665", "text": "func flattenDashboardColumnLayoutColumnsWidgetsScorecardTimeSeriesQueryTimeSeriesFilterPickTimeSeriesFilterDirectionEnumSlice(c *Client, i interface{}, res *Dashboard) []DashboardColumnLayoutColumnsWidgetsScorecardTimeSeriesQueryTimeSeriesFilterPickTimeSeriesFilterDirectionEnum {\n\ta, ok := i.([]interface{})\n\tif !ok {\n\t\treturn []DashboardColumnLayoutColumnsWidgetsScorecardTimeSeriesQueryTimeSeriesFilterPickTimeSeriesFilterDirectionEnum{}\n\t}\n\n\tif len(a) == 0 {\n\t\treturn []DashboardColumnLayoutColumnsWidgetsScorecardTimeSeriesQueryTimeSeriesFilterPickTimeSeriesFilterDirectionEnum{}\n\t}\n\n\titems := make([]DashboardColumnLayoutColumnsWidgetsScorecardTimeSeriesQueryTimeSeriesFilterPickTimeSeriesFilterDirectionEnum, 0, len(a))\n\tfor _, item := range a {\n\t\titems = append(items, *flattenDashboardColumnLayoutColumnsWidgetsScorecardTimeSeriesQueryTimeSeriesFilterPickTimeSeriesFilterDirectionEnum(item.(interface{})))\n\t}\n\n\treturn items\n}", "title": "" }, { "docid": "6c8974358e7c56745ad86f4b3dd409ba", "score": "0.6749433", "text": "func flattenDashboardColumnLayoutColumnsWidgetsScorecardTimeSeriesQueryTimeSeriesFilterAggregationCrossSeriesReducerEnum(i interface{}) *DashboardColumnLayoutColumnsWidgetsScorecardTimeSeriesQueryTimeSeriesFilterAggregationCrossSeriesReducerEnum {\n\ts, ok := i.(string)\n\tif !ok {\n\t\treturn nil\n\t}\n\n\treturn DashboardColumnLayoutColumnsWidgetsScorecardTimeSeriesQueryTimeSeriesFilterAggregationCrossSeriesReducerEnumRef(s)\n}", "title": "" }, { "docid": "132f51074d319d9066e94c5e598a82d4", "score": "0.6745163", "text": "func flattenDashboardGridLayoutWidgetsScorecardTimeSeriesQueryTimeSeriesFilterSecondaryAggregationPerSeriesAlignerEnum(i interface{}) *DashboardGridLayoutWidgetsScorecardTimeSeriesQueryTimeSeriesFilterSecondaryAggregationPerSeriesAlignerEnum {\n\ts, ok := i.(string)\n\tif !ok {\n\t\treturn nil\n\t}\n\n\treturn DashboardGridLayoutWidgetsScorecardTimeSeriesQueryTimeSeriesFilterSecondaryAggregationPerSeriesAlignerEnumRef(s)\n}", "title": "" }, { "docid": "eba96846c9cbf6bc0bcccc26fe21617d", "score": "0.67245805", "text": "func flattenDashboardRowLayoutRowsWidgetsXyChartDataSetsTimeSeriesQueryTimeSeriesFilterPickTimeSeriesFilterRankingMethodEnum(i interface{}) *DashboardRowLayoutRowsWidgetsXyChartDataSetsTimeSeriesQueryTimeSeriesFilterPickTimeSeriesFilterRankingMethodEnum {\n\ts, ok := i.(string)\n\tif !ok {\n\t\treturn nil\n\t}\n\n\treturn DashboardRowLayoutRowsWidgetsXyChartDataSetsTimeSeriesQueryTimeSeriesFilterPickTimeSeriesFilterRankingMethodEnumRef(s)\n}", "title": "" }, { "docid": "df983f777fcd1f17a4bda7fce614a029", "score": "0.67242265", "text": "func flattenDashboardGridLayoutWidgetsScorecardTimeSeriesQueryTimeSeriesFilterRatioSecondaryAggregationPerSeriesAlignerEnum(i interface{}) *DashboardGridLayoutWidgetsScorecardTimeSeriesQueryTimeSeriesFilterRatioSecondaryAggregationPerSeriesAlignerEnum {\n\ts, ok := i.(string)\n\tif !ok {\n\t\treturn nil\n\t}\n\n\treturn DashboardGridLayoutWidgetsScorecardTimeSeriesQueryTimeSeriesFilterRatioSecondaryAggregationPerSeriesAlignerEnumRef(s)\n}", "title": "" }, { "docid": "c57c1c25d39336c5a1c8c21789733c28", "score": "0.67193115", "text": "func flattenDashboardGridLayoutWidgetsScorecardThresholdsDirectionEnum(i interface{}) *DashboardGridLayoutWidgetsScorecardThresholdsDirectionEnum {\n\ts, ok := i.(string)\n\tif !ok {\n\t\treturn nil\n\t}\n\n\treturn DashboardGridLayoutWidgetsScorecardThresholdsDirectionEnumRef(s)\n}", "title": "" }, { "docid": "6e43c82a6196f427d77757474675144c", "score": "0.6708311", "text": "func flattenDashboardMosaicLayoutTilesWidgetXyChartDataSetsTimeSeriesQueryTimeSeriesFilterPickTimeSeriesFilterRankingMethodEnum(i interface{}) *DashboardMosaicLayoutTilesWidgetXyChartDataSetsTimeSeriesQueryTimeSeriesFilterPickTimeSeriesFilterRankingMethodEnum {\n\ts, ok := i.(string)\n\tif !ok {\n\t\treturn nil\n\t}\n\n\treturn DashboardMosaicLayoutTilesWidgetXyChartDataSetsTimeSeriesQueryTimeSeriesFilterPickTimeSeriesFilterRankingMethodEnumRef(s)\n}", "title": "" }, { "docid": "33448e92a8220326e57b14df4e121b84", "score": "0.67068744", "text": "func flattenDashboardGridLayoutWidgetsScorecardTimeSeriesQueryTimeSeriesFilterRatioSecondaryAggregationCrossSeriesReducerEnum(i interface{}) *DashboardGridLayoutWidgetsScorecardTimeSeriesQueryTimeSeriesFilterRatioSecondaryAggregationCrossSeriesReducerEnum {\n\ts, ok := i.(string)\n\tif !ok {\n\t\treturn nil\n\t}\n\n\treturn DashboardGridLayoutWidgetsScorecardTimeSeriesQueryTimeSeriesFilterRatioSecondaryAggregationCrossSeriesReducerEnumRef(s)\n}", "title": "" }, { "docid": "955d6a5ee55a1af5d94b5ed1edc352bf", "score": "0.6706049", "text": "func flattenDashboardColumnLayoutColumnsWidgetsScorecardTimeSeriesQueryTimeSeriesFilterSecondaryAggregationCrossSeriesReducerEnum(i interface{}) *DashboardColumnLayoutColumnsWidgetsScorecardTimeSeriesQueryTimeSeriesFilterSecondaryAggregationCrossSeriesReducerEnum {\n\ts, ok := i.(string)\n\tif !ok {\n\t\treturn nil\n\t}\n\n\treturn DashboardColumnLayoutColumnsWidgetsScorecardTimeSeriesQueryTimeSeriesFilterSecondaryAggregationCrossSeriesReducerEnumRef(s)\n}", "title": "" }, { "docid": "2a23163eca4cb4c51a1bc9b1d691abb2", "score": "0.67054915", "text": "func flattenDashboardColumnLayoutColumnsWidgetsScorecardTimeSeriesQueryTimeSeriesFilterRatioPickTimeSeriesFilterDirectionEnumSlice(c *Client, i interface{}, res *Dashboard) []DashboardColumnLayoutColumnsWidgetsScorecardTimeSeriesQueryTimeSeriesFilterRatioPickTimeSeriesFilterDirectionEnum {\n\ta, ok := i.([]interface{})\n\tif !ok {\n\t\treturn []DashboardColumnLayoutColumnsWidgetsScorecardTimeSeriesQueryTimeSeriesFilterRatioPickTimeSeriesFilterDirectionEnum{}\n\t}\n\n\tif len(a) == 0 {\n\t\treturn []DashboardColumnLayoutColumnsWidgetsScorecardTimeSeriesQueryTimeSeriesFilterRatioPickTimeSeriesFilterDirectionEnum{}\n\t}\n\n\titems := make([]DashboardColumnLayoutColumnsWidgetsScorecardTimeSeriesQueryTimeSeriesFilterRatioPickTimeSeriesFilterDirectionEnum, 0, len(a))\n\tfor _, item := range a {\n\t\titems = append(items, *flattenDashboardColumnLayoutColumnsWidgetsScorecardTimeSeriesQueryTimeSeriesFilterRatioPickTimeSeriesFilterDirectionEnum(item.(interface{})))\n\t}\n\n\treturn items\n}", "title": "" }, { "docid": "ca16cc495e2095b7ac9ee10186d52b8d", "score": "0.66803366", "text": "func flattenDashboardColumnLayoutColumnsWidgetsScorecardThresholdsDirectionEnum(i interface{}) *DashboardColumnLayoutColumnsWidgetsScorecardThresholdsDirectionEnum {\n\ts, ok := i.(string)\n\tif !ok {\n\t\treturn nil\n\t}\n\n\treturn DashboardColumnLayoutColumnsWidgetsScorecardThresholdsDirectionEnumRef(s)\n}", "title": "" }, { "docid": "2cd580fb99ba9f2a63ad87beafe2ed4c", "score": "0.6654956", "text": "func flattenDashboardColumnLayoutColumnsWidgetsScorecardTimeSeriesQueryTimeSeriesFilterAggregationPerSeriesAlignerEnum(i interface{}) *DashboardColumnLayoutColumnsWidgetsScorecardTimeSeriesQueryTimeSeriesFilterAggregationPerSeriesAlignerEnum {\n\ts, ok := i.(string)\n\tif !ok {\n\t\treturn nil\n\t}\n\n\treturn DashboardColumnLayoutColumnsWidgetsScorecardTimeSeriesQueryTimeSeriesFilterAggregationPerSeriesAlignerEnumRef(s)\n}", "title": "" }, { "docid": "f8bc907b0146858b0a0fba53b4c36a14", "score": "0.6623317", "text": "func flattenDashboardColumnLayoutColumnsWidgetsScorecardTimeSeriesQueryTimeSeriesFilterRatioSecondaryAggregationCrossSeriesReducerEnum(i interface{}) *DashboardColumnLayoutColumnsWidgetsScorecardTimeSeriesQueryTimeSeriesFilterRatioSecondaryAggregationCrossSeriesReducerEnum {\n\ts, ok := i.(string)\n\tif !ok {\n\t\treturn nil\n\t}\n\n\treturn DashboardColumnLayoutColumnsWidgetsScorecardTimeSeriesQueryTimeSeriesFilterRatioSecondaryAggregationCrossSeriesReducerEnumRef(s)\n}", "title": "" }, { "docid": "a9ec2c69955865ffe8369f8fdf27e296", "score": "0.6619541", "text": "func flattenDashboardColumnLayoutColumnsWidgetsScorecardTimeSeriesQueryTimeSeriesFilterSecondaryAggregationPerSeriesAlignerEnum(i interface{}) *DashboardColumnLayoutColumnsWidgetsScorecardTimeSeriesQueryTimeSeriesFilterSecondaryAggregationPerSeriesAlignerEnum {\n\ts, ok := i.(string)\n\tif !ok {\n\t\treturn nil\n\t}\n\n\treturn DashboardColumnLayoutColumnsWidgetsScorecardTimeSeriesQueryTimeSeriesFilterSecondaryAggregationPerSeriesAlignerEnumRef(s)\n}", "title": "" }, { "docid": "63d1551c9658775eb673e9732a9962d5", "score": "0.66103154", "text": "func flattenDashboardColumnLayoutColumnsWidgetsScorecardTimeSeriesQueryTimeSeriesFilterRatioSecondaryAggregationPerSeriesAlignerEnum(i interface{}) *DashboardColumnLayoutColumnsWidgetsScorecardTimeSeriesQueryTimeSeriesFilterRatioSecondaryAggregationPerSeriesAlignerEnum {\n\ts, ok := i.(string)\n\tif !ok {\n\t\treturn nil\n\t}\n\n\treturn DashboardColumnLayoutColumnsWidgetsScorecardTimeSeriesQueryTimeSeriesFilterRatioSecondaryAggregationPerSeriesAlignerEnumRef(s)\n}", "title": "" }, { "docid": "b98935b93e20ec2670021295e56fd442", "score": "0.65768754", "text": "func flattenDashboardRowLayoutRowsWidgetsScorecardThresholdsDirectionEnum(i interface{}) *DashboardRowLayoutRowsWidgetsScorecardThresholdsDirectionEnum {\n\ts, ok := i.(string)\n\tif !ok {\n\t\treturn nil\n\t}\n\n\treturn DashboardRowLayoutRowsWidgetsScorecardThresholdsDirectionEnumRef(s)\n}", "title": "" }, { "docid": "07f0d13f34d6b2251286b6a93374c959", "score": "0.6570996", "text": "func flattenDashboardGridLayoutWidgetsScorecardTimeSeriesQueryTimeSeriesFilterRatioDenominatorAggregationPerSeriesAlignerEnum(i interface{}) *DashboardGridLayoutWidgetsScorecardTimeSeriesQueryTimeSeriesFilterRatioDenominatorAggregationPerSeriesAlignerEnum {\n\ts, ok := i.(string)\n\tif !ok {\n\t\treturn nil\n\t}\n\n\treturn DashboardGridLayoutWidgetsScorecardTimeSeriesQueryTimeSeriesFilterRatioDenominatorAggregationPerSeriesAlignerEnumRef(s)\n}", "title": "" }, { "docid": "8e9dd57ba957877090f05541e20744c2", "score": "0.6561376", "text": "func flattenDashboardRowLayoutRowsWidgetsXyChartDataSetsTimeSeriesQueryTimeSeriesFilterRatioPickTimeSeriesFilterRankingMethodEnum(i interface{}) *DashboardRowLayoutRowsWidgetsXyChartDataSetsTimeSeriesQueryTimeSeriesFilterRatioPickTimeSeriesFilterRankingMethodEnum {\n\ts, ok := i.(string)\n\tif !ok {\n\t\treturn nil\n\t}\n\n\treturn DashboardRowLayoutRowsWidgetsXyChartDataSetsTimeSeriesQueryTimeSeriesFilterRatioPickTimeSeriesFilterRankingMethodEnumRef(s)\n}", "title": "" }, { "docid": "537402969336cd2e00323088082f1656", "score": "0.65428257", "text": "func flattenDashboardMosaicLayoutTilesWidgetScorecardTimeSeriesQueryTimeSeriesFilterAggregationPerSeriesAlignerEnum(i interface{}) *DashboardMosaicLayoutTilesWidgetScorecardTimeSeriesQueryTimeSeriesFilterAggregationPerSeriesAlignerEnum {\n\ts, ok := i.(string)\n\tif !ok {\n\t\treturn nil\n\t}\n\n\treturn DashboardMosaicLayoutTilesWidgetScorecardTimeSeriesQueryTimeSeriesFilterAggregationPerSeriesAlignerEnumRef(s)\n}", "title": "" }, { "docid": "6361f80111a899fd40a030fdc47dc802", "score": "0.6540987", "text": "func flattenDashboardMosaicLayoutTilesWidgetXyChartDataSetsTimeSeriesQueryTimeSeriesFilterRatioPickTimeSeriesFilterRankingMethodEnum(i interface{}) *DashboardMosaicLayoutTilesWidgetXyChartDataSetsTimeSeriesQueryTimeSeriesFilterRatioPickTimeSeriesFilterRankingMethodEnum {\n\ts, ok := i.(string)\n\tif !ok {\n\t\treturn nil\n\t}\n\n\treturn DashboardMosaicLayoutTilesWidgetXyChartDataSetsTimeSeriesQueryTimeSeriesFilterRatioPickTimeSeriesFilterRankingMethodEnumRef(s)\n}", "title": "" }, { "docid": "f80985ccbfbb3d381fb5685ac3eb6bcc", "score": "0.6538122", "text": "func flattenDashboardRowLayoutRowsWidgetsScorecardTimeSeriesQueryTimeSeriesFilterAggregationCrossSeriesReducerEnum(i interface{}) *DashboardRowLayoutRowsWidgetsScorecardTimeSeriesQueryTimeSeriesFilterAggregationCrossSeriesReducerEnum {\n\ts, ok := i.(string)\n\tif !ok {\n\t\treturn nil\n\t}\n\n\treturn DashboardRowLayoutRowsWidgetsScorecardTimeSeriesQueryTimeSeriesFilterAggregationCrossSeriesReducerEnumRef(s)\n}", "title": "" }, { "docid": "8422dc638c858843669a20494a71ff8d", "score": "0.653655", "text": "func flattenDashboardMosaicLayoutTilesWidgetScorecardThresholdsDirectionEnum(i interface{}) *DashboardMosaicLayoutTilesWidgetScorecardThresholdsDirectionEnum {\n\ts, ok := i.(string)\n\tif !ok {\n\t\treturn nil\n\t}\n\n\treturn DashboardMosaicLayoutTilesWidgetScorecardThresholdsDirectionEnumRef(s)\n}", "title": "" }, { "docid": "bcadac7552190324e681420669a04fd9", "score": "0.6529645", "text": "func flattenDashboardRowLayoutRowsWidgetsScorecardTimeSeriesQueryTimeSeriesFilterSecondaryAggregationCrossSeriesReducerEnum(i interface{}) *DashboardRowLayoutRowsWidgetsScorecardTimeSeriesQueryTimeSeriesFilterSecondaryAggregationCrossSeriesReducerEnum {\n\ts, ok := i.(string)\n\tif !ok {\n\t\treturn nil\n\t}\n\n\treturn DashboardRowLayoutRowsWidgetsScorecardTimeSeriesQueryTimeSeriesFilterSecondaryAggregationCrossSeriesReducerEnumRef(s)\n}", "title": "" }, { "docid": "88944f243c19a5213ab5df2357108053", "score": "0.652567", "text": "func flattenDashboardMosaicLayoutTilesWidgetScorecardTimeSeriesQueryTimeSeriesFilterSecondaryAggregationPerSeriesAlignerEnum(i interface{}) *DashboardMosaicLayoutTilesWidgetScorecardTimeSeriesQueryTimeSeriesFilterSecondaryAggregationPerSeriesAlignerEnum {\n\ts, ok := i.(string)\n\tif !ok {\n\t\treturn nil\n\t}\n\n\treturn DashboardMosaicLayoutTilesWidgetScorecardTimeSeriesQueryTimeSeriesFilterSecondaryAggregationPerSeriesAlignerEnumRef(s)\n}", "title": "" }, { "docid": "b020b26978fc0ff9708c47d254f33fc8", "score": "0.6514547", "text": "func flattenDashboardGridLayoutWidgetsXyChartDataSetsTimeSeriesQueryTimeSeriesFilterAggregationPerSeriesAlignerEnum(i interface{}) *DashboardGridLayoutWidgetsXyChartDataSetsTimeSeriesQueryTimeSeriesFilterAggregationPerSeriesAlignerEnum {\n\ts, ok := i.(string)\n\tif !ok {\n\t\treturn nil\n\t}\n\n\treturn DashboardGridLayoutWidgetsXyChartDataSetsTimeSeriesQueryTimeSeriesFilterAggregationPerSeriesAlignerEnumRef(s)\n}", "title": "" }, { "docid": "b2bb51d65124982257109383f31fc7e7", "score": "0.65078914", "text": "func flattenDashboardMosaicLayoutTilesWidgetScorecardTimeSeriesQueryTimeSeriesFilterRatioSecondaryAggregationPerSeriesAlignerEnum(i interface{}) *DashboardMosaicLayoutTilesWidgetScorecardTimeSeriesQueryTimeSeriesFilterRatioSecondaryAggregationPerSeriesAlignerEnum {\n\ts, ok := i.(string)\n\tif !ok {\n\t\treturn nil\n\t}\n\n\treturn DashboardMosaicLayoutTilesWidgetScorecardTimeSeriesQueryTimeSeriesFilterRatioSecondaryAggregationPerSeriesAlignerEnumRef(s)\n}", "title": "" }, { "docid": "8c6af036e40f22eb04137632410300c5", "score": "0.6505712", "text": "func flattenDashboardGridLayoutWidgetsXyChartThresholdsDirectionEnum(i interface{}) *DashboardGridLayoutWidgetsXyChartThresholdsDirectionEnum {\n\ts, ok := i.(string)\n\tif !ok {\n\t\treturn nil\n\t}\n\n\treturn DashboardGridLayoutWidgetsXyChartThresholdsDirectionEnumRef(s)\n}", "title": "" }, { "docid": "fb4809153651d90b04bdd1047e36a3af", "score": "0.6475347", "text": "func flattenDashboardGridLayoutWidgetsScorecardTimeSeriesQueryTimeSeriesFilterRatioDenominatorAggregationCrossSeriesReducerEnum(i interface{}) *DashboardGridLayoutWidgetsScorecardTimeSeriesQueryTimeSeriesFilterRatioDenominatorAggregationCrossSeriesReducerEnum {\n\ts, ok := i.(string)\n\tif !ok {\n\t\treturn nil\n\t}\n\n\treturn DashboardGridLayoutWidgetsScorecardTimeSeriesQueryTimeSeriesFilterRatioDenominatorAggregationCrossSeriesReducerEnumRef(s)\n}", "title": "" }, { "docid": "0a061309773da1ec2b5a864d0c7122e0", "score": "0.64707756", "text": "func flattenDashboardColumnLayoutColumnsWidgetsScorecardTimeSeriesQueryTimeSeriesFilterRatioDenominatorAggregationPerSeriesAlignerEnum(i interface{}) *DashboardColumnLayoutColumnsWidgetsScorecardTimeSeriesQueryTimeSeriesFilterRatioDenominatorAggregationPerSeriesAlignerEnum {\n\ts, ok := i.(string)\n\tif !ok {\n\t\treturn nil\n\t}\n\n\treturn DashboardColumnLayoutColumnsWidgetsScorecardTimeSeriesQueryTimeSeriesFilterRatioDenominatorAggregationPerSeriesAlignerEnumRef(s)\n}", "title": "" }, { "docid": "37e027c60b24c8e2a0640f6fd49de96a", "score": "0.6465735", "text": "func flattenDashboardRowLayoutRowsWidgetsScorecardTimeSeriesQueryTimeSeriesFilterRatioSecondaryAggregationCrossSeriesReducerEnum(i interface{}) *DashboardRowLayoutRowsWidgetsScorecardTimeSeriesQueryTimeSeriesFilterRatioSecondaryAggregationCrossSeriesReducerEnum {\n\ts, ok := i.(string)\n\tif !ok {\n\t\treturn nil\n\t}\n\n\treturn DashboardRowLayoutRowsWidgetsScorecardTimeSeriesQueryTimeSeriesFilterRatioSecondaryAggregationCrossSeriesReducerEnumRef(s)\n}", "title": "" }, { "docid": "661ff623c260b1d8c52ba53e4785f0d2", "score": "0.64458114", "text": "func flattenDashboardGridLayoutWidgetsScorecardTimeSeriesQueryTimeSeriesFilterRatioNumeratorAggregationPerSeriesAlignerEnum(i interface{}) *DashboardGridLayoutWidgetsScorecardTimeSeriesQueryTimeSeriesFilterRatioNumeratorAggregationPerSeriesAlignerEnum {\n\ts, ok := i.(string)\n\tif !ok {\n\t\treturn nil\n\t}\n\n\treturn DashboardGridLayoutWidgetsScorecardTimeSeriesQueryTimeSeriesFilterRatioNumeratorAggregationPerSeriesAlignerEnumRef(s)\n}", "title": "" }, { "docid": "2b32c1a17a5e615fcba18db8afe084e1", "score": "0.6418293", "text": "func flattenDashboardGridLayoutWidgetsXyChartDataSetsTimeSeriesQueryTimeSeriesFilterSecondaryAggregationPerSeriesAlignerEnum(i interface{}) *DashboardGridLayoutWidgetsXyChartDataSetsTimeSeriesQueryTimeSeriesFilterSecondaryAggregationPerSeriesAlignerEnum {\n\ts, ok := i.(string)\n\tif !ok {\n\t\treturn nil\n\t}\n\n\treturn DashboardGridLayoutWidgetsXyChartDataSetsTimeSeriesQueryTimeSeriesFilterSecondaryAggregationPerSeriesAlignerEnumRef(s)\n}", "title": "" }, { "docid": "c73d62fa1093e45ce58a086bc47292d4", "score": "0.6412902", "text": "func flattenDashboardGridLayoutWidgetsXyChartDataSetsTimeSeriesQueryTimeSeriesFilterPickTimeSeriesFilterDirectionEnumSlice(c *Client, i interface{}, res *Dashboard) []DashboardGridLayoutWidgetsXyChartDataSetsTimeSeriesQueryTimeSeriesFilterPickTimeSeriesFilterDirectionEnum {\n\ta, ok := i.([]interface{})\n\tif !ok {\n\t\treturn []DashboardGridLayoutWidgetsXyChartDataSetsTimeSeriesQueryTimeSeriesFilterPickTimeSeriesFilterDirectionEnum{}\n\t}\n\n\tif len(a) == 0 {\n\t\treturn []DashboardGridLayoutWidgetsXyChartDataSetsTimeSeriesQueryTimeSeriesFilterPickTimeSeriesFilterDirectionEnum{}\n\t}\n\n\titems := make([]DashboardGridLayoutWidgetsXyChartDataSetsTimeSeriesQueryTimeSeriesFilterPickTimeSeriesFilterDirectionEnum, 0, len(a))\n\tfor _, item := range a {\n\t\titems = append(items, *flattenDashboardGridLayoutWidgetsXyChartDataSetsTimeSeriesQueryTimeSeriesFilterPickTimeSeriesFilterDirectionEnum(item.(interface{})))\n\t}\n\n\treturn items\n}", "title": "" }, { "docid": "9d0993e581b663538b273e41d95269d2", "score": "0.64128065", "text": "func flattenDashboardRowLayoutRowsWidgetsScorecardTimeSeriesQueryTimeSeriesFilterAggregationPerSeriesAlignerEnum(i interface{}) *DashboardRowLayoutRowsWidgetsScorecardTimeSeriesQueryTimeSeriesFilterAggregationPerSeriesAlignerEnum {\n\ts, ok := i.(string)\n\tif !ok {\n\t\treturn nil\n\t}\n\n\treturn DashboardRowLayoutRowsWidgetsScorecardTimeSeriesQueryTimeSeriesFilterAggregationPerSeriesAlignerEnumRef(s)\n}", "title": "" }, { "docid": "6caf84ab91c73179e930f2143a6f1a08", "score": "0.64090455", "text": "func flattenDashboardGridLayoutWidgetsScorecardTimeSeriesQueryTimeSeriesFilterRatioNumeratorAggregationCrossSeriesReducerEnum(i interface{}) *DashboardGridLayoutWidgetsScorecardTimeSeriesQueryTimeSeriesFilterRatioNumeratorAggregationCrossSeriesReducerEnum {\n\ts, ok := i.(string)\n\tif !ok {\n\t\treturn nil\n\t}\n\n\treturn DashboardGridLayoutWidgetsScorecardTimeSeriesQueryTimeSeriesFilterRatioNumeratorAggregationCrossSeriesReducerEnumRef(s)\n}", "title": "" }, { "docid": "3b317aca198e6ddb06862558bf9cd54e", "score": "0.6404727", "text": "func flattenDashboardMosaicLayoutTilesWidgetScorecardTimeSeriesQueryTimeSeriesFilterAggregationCrossSeriesReducerEnum(i interface{}) *DashboardMosaicLayoutTilesWidgetScorecardTimeSeriesQueryTimeSeriesFilterAggregationCrossSeriesReducerEnum {\n\ts, ok := i.(string)\n\tif !ok {\n\t\treturn nil\n\t}\n\n\treturn DashboardMosaicLayoutTilesWidgetScorecardTimeSeriesQueryTimeSeriesFilterAggregationCrossSeriesReducerEnumRef(s)\n}", "title": "" }, { "docid": "af832c6b151aaa4a9170531518f2a889", "score": "0.6396505", "text": "func flattenDashboardGridLayoutWidgetsXyChartDataSetsTimeSeriesQueryTimeSeriesFilterRatioPickTimeSeriesFilterDirectionEnumSlice(c *Client, i interface{}, res *Dashboard) []DashboardGridLayoutWidgetsXyChartDataSetsTimeSeriesQueryTimeSeriesFilterRatioPickTimeSeriesFilterDirectionEnum {\n\ta, ok := i.([]interface{})\n\tif !ok {\n\t\treturn []DashboardGridLayoutWidgetsXyChartDataSetsTimeSeriesQueryTimeSeriesFilterRatioPickTimeSeriesFilterDirectionEnum{}\n\t}\n\n\tif len(a) == 0 {\n\t\treturn []DashboardGridLayoutWidgetsXyChartDataSetsTimeSeriesQueryTimeSeriesFilterRatioPickTimeSeriesFilterDirectionEnum{}\n\t}\n\n\titems := make([]DashboardGridLayoutWidgetsXyChartDataSetsTimeSeriesQueryTimeSeriesFilterRatioPickTimeSeriesFilterDirectionEnum, 0, len(a))\n\tfor _, item := range a {\n\t\titems = append(items, *flattenDashboardGridLayoutWidgetsXyChartDataSetsTimeSeriesQueryTimeSeriesFilterRatioPickTimeSeriesFilterDirectionEnum(item.(interface{})))\n\t}\n\n\treturn items\n}", "title": "" }, { "docid": "9753176adb4f13db718f97a133f80ab2", "score": "0.6395288", "text": "func flattenDashboardColumnLayoutColumnsWidgetsScorecardTimeSeriesQueryTimeSeriesFilterRatioDenominatorAggregationCrossSeriesReducerEnum(i interface{}) *DashboardColumnLayoutColumnsWidgetsScorecardTimeSeriesQueryTimeSeriesFilterRatioDenominatorAggregationCrossSeriesReducerEnum {\n\ts, ok := i.(string)\n\tif !ok {\n\t\treturn nil\n\t}\n\n\treturn DashboardColumnLayoutColumnsWidgetsScorecardTimeSeriesQueryTimeSeriesFilterRatioDenominatorAggregationCrossSeriesReducerEnumRef(s)\n}", "title": "" }, { "docid": "b0e8a627db3b6e9808b1550d8bb2f467", "score": "0.63949126", "text": "func flattenDashboardRowLayoutRowsWidgetsScorecardTimeSeriesQueryTimeSeriesFilterSecondaryAggregationPerSeriesAlignerEnum(i interface{}) *DashboardRowLayoutRowsWidgetsScorecardTimeSeriesQueryTimeSeriesFilterSecondaryAggregationPerSeriesAlignerEnum {\n\ts, ok := i.(string)\n\tif !ok {\n\t\treturn nil\n\t}\n\n\treturn DashboardRowLayoutRowsWidgetsScorecardTimeSeriesQueryTimeSeriesFilterSecondaryAggregationPerSeriesAlignerEnumRef(s)\n}", "title": "" }, { "docid": "f2581ee7445743c7d67d132ba99f4bdb", "score": "0.63851184", "text": "func flattenDashboardColumnLayoutColumnsWidgetsScorecardTimeSeriesQueryTimeSeriesFilterRatioNumeratorAggregationCrossSeriesReducerEnum(i interface{}) *DashboardColumnLayoutColumnsWidgetsScorecardTimeSeriesQueryTimeSeriesFilterRatioNumeratorAggregationCrossSeriesReducerEnum {\n\ts, ok := i.(string)\n\tif !ok {\n\t\treturn nil\n\t}\n\n\treturn DashboardColumnLayoutColumnsWidgetsScorecardTimeSeriesQueryTimeSeriesFilterRatioNumeratorAggregationCrossSeriesReducerEnumRef(s)\n}", "title": "" }, { "docid": "d71589d3223005ab1dac68d7c69aef89", "score": "0.63827693", "text": "func flattenDashboardGridLayoutWidgetsXyChartDataSetsTimeSeriesQueryTimeSeriesFilterRatioSecondaryAggregationPerSeriesAlignerEnum(i interface{}) *DashboardGridLayoutWidgetsXyChartDataSetsTimeSeriesQueryTimeSeriesFilterRatioSecondaryAggregationPerSeriesAlignerEnum {\n\ts, ok := i.(string)\n\tif !ok {\n\t\treturn nil\n\t}\n\n\treturn DashboardGridLayoutWidgetsXyChartDataSetsTimeSeriesQueryTimeSeriesFilterRatioSecondaryAggregationPerSeriesAlignerEnumRef(s)\n}", "title": "" }, { "docid": "6ff18e57bf0175d44660489f90012e81", "score": "0.6381688", "text": "func flattenDashboardColumnLayoutColumnsWidgetsScorecardTimeSeriesQueryTimeSeriesFilterRatioNumeratorAggregationPerSeriesAlignerEnum(i interface{}) *DashboardColumnLayoutColumnsWidgetsScorecardTimeSeriesQueryTimeSeriesFilterRatioNumeratorAggregationPerSeriesAlignerEnum {\n\ts, ok := i.(string)\n\tif !ok {\n\t\treturn nil\n\t}\n\n\treturn DashboardColumnLayoutColumnsWidgetsScorecardTimeSeriesQueryTimeSeriesFilterRatioNumeratorAggregationPerSeriesAlignerEnumRef(s)\n}", "title": "" }, { "docid": "af60c498361af94d9b3028a6d4202272", "score": "0.63806474", "text": "func flattenDashboardMosaicLayoutTilesWidgetScorecardTimeSeriesQueryTimeSeriesFilterSecondaryAggregationCrossSeriesReducerEnum(i interface{}) *DashboardMosaicLayoutTilesWidgetScorecardTimeSeriesQueryTimeSeriesFilterSecondaryAggregationCrossSeriesReducerEnum {\n\ts, ok := i.(string)\n\tif !ok {\n\t\treturn nil\n\t}\n\n\treturn DashboardMosaicLayoutTilesWidgetScorecardTimeSeriesQueryTimeSeriesFilterSecondaryAggregationCrossSeriesReducerEnumRef(s)\n}", "title": "" }, { "docid": "ee27adc691604d8d209f3fd7efa761cc", "score": "0.6376355", "text": "func flattenDashboardRowLayoutRowsWidgetsScorecardTimeSeriesQueryTimeSeriesFilterRatioSecondaryAggregationPerSeriesAlignerEnum(i interface{}) *DashboardRowLayoutRowsWidgetsScorecardTimeSeriesQueryTimeSeriesFilterRatioSecondaryAggregationPerSeriesAlignerEnum {\n\ts, ok := i.(string)\n\tif !ok {\n\t\treturn nil\n\t}\n\n\treturn DashboardRowLayoutRowsWidgetsScorecardTimeSeriesQueryTimeSeriesFilterRatioSecondaryAggregationPerSeriesAlignerEnumRef(s)\n}", "title": "" }, { "docid": "69ef7c266b516b1fcd803617ecdd6b1d", "score": "0.6369871", "text": "func flattenDashboardGridLayoutWidgetsScorecardTimeSeriesQueryTimeSeriesFilterPickTimeSeriesFilterDirectionEnumMap(c *Client, i interface{}, res *Dashboard) map[string]DashboardGridLayoutWidgetsScorecardTimeSeriesQueryTimeSeriesFilterPickTimeSeriesFilterDirectionEnum {\n\ta, ok := i.(map[string]interface{})\n\tif !ok {\n\t\treturn map[string]DashboardGridLayoutWidgetsScorecardTimeSeriesQueryTimeSeriesFilterPickTimeSeriesFilterDirectionEnum{}\n\t}\n\n\tif len(a) == 0 {\n\t\treturn map[string]DashboardGridLayoutWidgetsScorecardTimeSeriesQueryTimeSeriesFilterPickTimeSeriesFilterDirectionEnum{}\n\t}\n\n\titems := make(map[string]DashboardGridLayoutWidgetsScorecardTimeSeriesQueryTimeSeriesFilterPickTimeSeriesFilterDirectionEnum)\n\tfor k, item := range a {\n\t\titems[k] = *flattenDashboardGridLayoutWidgetsScorecardTimeSeriesQueryTimeSeriesFilterPickTimeSeriesFilterDirectionEnum(item.(interface{}))\n\t}\n\n\treturn items\n}", "title": "" }, { "docid": "7cf0de673cc21a8ace84d4f76fa935af", "score": "0.6369622", "text": "func flattenDashboardColumnLayoutColumnsWidgetsXyChartThresholdsDirectionEnum(i interface{}) *DashboardColumnLayoutColumnsWidgetsXyChartThresholdsDirectionEnum {\n\ts, ok := i.(string)\n\tif !ok {\n\t\treturn nil\n\t}\n\n\treturn DashboardColumnLayoutColumnsWidgetsXyChartThresholdsDirectionEnumRef(s)\n}", "title": "" }, { "docid": "0ab3aa91d3c5574b7a63dbf53fdc98f5", "score": "0.6358786", "text": "func flattenDashboardGridLayoutWidgetsScorecardTimeSeriesQueryTimeSeriesFilterRatioPickTimeSeriesFilterDirectionEnumMap(c *Client, i interface{}, res *Dashboard) map[string]DashboardGridLayoutWidgetsScorecardTimeSeriesQueryTimeSeriesFilterRatioPickTimeSeriesFilterDirectionEnum {\n\ta, ok := i.(map[string]interface{})\n\tif !ok {\n\t\treturn map[string]DashboardGridLayoutWidgetsScorecardTimeSeriesQueryTimeSeriesFilterRatioPickTimeSeriesFilterDirectionEnum{}\n\t}\n\n\tif len(a) == 0 {\n\t\treturn map[string]DashboardGridLayoutWidgetsScorecardTimeSeriesQueryTimeSeriesFilterRatioPickTimeSeriesFilterDirectionEnum{}\n\t}\n\n\titems := make(map[string]DashboardGridLayoutWidgetsScorecardTimeSeriesQueryTimeSeriesFilterRatioPickTimeSeriesFilterDirectionEnum)\n\tfor k, item := range a {\n\t\titems[k] = *flattenDashboardGridLayoutWidgetsScorecardTimeSeriesQueryTimeSeriesFilterRatioPickTimeSeriesFilterDirectionEnum(item.(interface{}))\n\t}\n\n\treturn items\n}", "title": "" }, { "docid": "e8cf46438b8ebe0b7b19a12e599fd33a", "score": "0.6347628", "text": "func flattenDashboardMosaicLayoutTilesWidgetXyChartThresholdsDirectionEnum(i interface{}) *DashboardMosaicLayoutTilesWidgetXyChartThresholdsDirectionEnum {\n\ts, ok := i.(string)\n\tif !ok {\n\t\treturn nil\n\t}\n\n\treturn DashboardMosaicLayoutTilesWidgetXyChartThresholdsDirectionEnumRef(s)\n}", "title": "" }, { "docid": "7cee9580e2303852c8860e808e1107ac", "score": "0.63252413", "text": "func flattenDashboardGridLayoutWidgetsXyChartDataSetsTimeSeriesQueryTimeSeriesFilterAggregationCrossSeriesReducerEnum(i interface{}) *DashboardGridLayoutWidgetsXyChartDataSetsTimeSeriesQueryTimeSeriesFilterAggregationCrossSeriesReducerEnum {\n\ts, ok := i.(string)\n\tif !ok {\n\t\treturn nil\n\t}\n\n\treturn DashboardGridLayoutWidgetsXyChartDataSetsTimeSeriesQueryTimeSeriesFilterAggregationCrossSeriesReducerEnumRef(s)\n}", "title": "" }, { "docid": "c22ba5d8c2634b8a1dea5f748ed0530f", "score": "0.63238895", "text": "func flattenDashboardMosaicLayoutTilesWidgetScorecardTimeSeriesQueryTimeSeriesFilterRatioDenominatorAggregationPerSeriesAlignerEnum(i interface{}) *DashboardMosaicLayoutTilesWidgetScorecardTimeSeriesQueryTimeSeriesFilterRatioDenominatorAggregationPerSeriesAlignerEnum {\n\ts, ok := i.(string)\n\tif !ok {\n\t\treturn nil\n\t}\n\n\treturn DashboardMosaicLayoutTilesWidgetScorecardTimeSeriesQueryTimeSeriesFilterRatioDenominatorAggregationPerSeriesAlignerEnumRef(s)\n}", "title": "" }, { "docid": "845fecfd95a3152bb95578c96be9abfb", "score": "0.63054854", "text": "func flattenDashboardMosaicLayoutTilesWidgetScorecardTimeSeriesQueryTimeSeriesFilterRatioSecondaryAggregationCrossSeriesReducerEnum(i interface{}) *DashboardMosaicLayoutTilesWidgetScorecardTimeSeriesQueryTimeSeriesFilterRatioSecondaryAggregationCrossSeriesReducerEnum {\n\ts, ok := i.(string)\n\tif !ok {\n\t\treturn nil\n\t}\n\n\treturn DashboardMosaicLayoutTilesWidgetScorecardTimeSeriesQueryTimeSeriesFilterRatioSecondaryAggregationCrossSeriesReducerEnumRef(s)\n}", "title": "" }, { "docid": "4584ad49a5db57f174728db41314518e", "score": "0.63046145", "text": "func flattenDashboardMosaicLayoutTilesWidgetScorecardTimeSeriesQueryTimeSeriesFilterPickTimeSeriesFilterDirectionEnumSlice(c *Client, i interface{}, res *Dashboard) []DashboardMosaicLayoutTilesWidgetScorecardTimeSeriesQueryTimeSeriesFilterPickTimeSeriesFilterDirectionEnum {\n\ta, ok := i.([]interface{})\n\tif !ok {\n\t\treturn []DashboardMosaicLayoutTilesWidgetScorecardTimeSeriesQueryTimeSeriesFilterPickTimeSeriesFilterDirectionEnum{}\n\t}\n\n\tif len(a) == 0 {\n\t\treturn []DashboardMosaicLayoutTilesWidgetScorecardTimeSeriesQueryTimeSeriesFilterPickTimeSeriesFilterDirectionEnum{}\n\t}\n\n\titems := make([]DashboardMosaicLayoutTilesWidgetScorecardTimeSeriesQueryTimeSeriesFilterPickTimeSeriesFilterDirectionEnum, 0, len(a))\n\tfor _, item := range a {\n\t\titems = append(items, *flattenDashboardMosaicLayoutTilesWidgetScorecardTimeSeriesQueryTimeSeriesFilterPickTimeSeriesFilterDirectionEnum(item.(interface{})))\n\t}\n\n\treturn items\n}", "title": "" }, { "docid": "c7a7dcd639d75e93da8a8cb950bd0c6d", "score": "0.6302147", "text": "func flattenDashboardGridLayoutWidgetsXyChartDataSetsTimeSeriesQueryTimeSeriesFilterSecondaryAggregationCrossSeriesReducerEnum(i interface{}) *DashboardGridLayoutWidgetsXyChartDataSetsTimeSeriesQueryTimeSeriesFilterSecondaryAggregationCrossSeriesReducerEnum {\n\ts, ok := i.(string)\n\tif !ok {\n\t\treturn nil\n\t}\n\n\treturn DashboardGridLayoutWidgetsXyChartDataSetsTimeSeriesQueryTimeSeriesFilterSecondaryAggregationCrossSeriesReducerEnumRef(s)\n}", "title": "" }, { "docid": "9902fc11b7b1229b1c099664e0fde007", "score": "0.6299677", "text": "func flattenDashboardRowLayoutRowsWidgetsScorecardTimeSeriesQueryTimeSeriesFilterPickTimeSeriesFilterDirectionEnumSlice(c *Client, i interface{}, res *Dashboard) []DashboardRowLayoutRowsWidgetsScorecardTimeSeriesQueryTimeSeriesFilterPickTimeSeriesFilterDirectionEnum {\n\ta, ok := i.([]interface{})\n\tif !ok {\n\t\treturn []DashboardRowLayoutRowsWidgetsScorecardTimeSeriesQueryTimeSeriesFilterPickTimeSeriesFilterDirectionEnum{}\n\t}\n\n\tif len(a) == 0 {\n\t\treturn []DashboardRowLayoutRowsWidgetsScorecardTimeSeriesQueryTimeSeriesFilterPickTimeSeriesFilterDirectionEnum{}\n\t}\n\n\titems := make([]DashboardRowLayoutRowsWidgetsScorecardTimeSeriesQueryTimeSeriesFilterPickTimeSeriesFilterDirectionEnum, 0, len(a))\n\tfor _, item := range a {\n\t\titems = append(items, *flattenDashboardRowLayoutRowsWidgetsScorecardTimeSeriesQueryTimeSeriesFilterPickTimeSeriesFilterDirectionEnum(item.(interface{})))\n\t}\n\n\treturn items\n}", "title": "" }, { "docid": "1fb999459a24c51393c6bf2a6ed45483", "score": "0.62843937", "text": "func flattenDashboardColumnLayoutColumnsWidgetsXyChartDataSetsTimeSeriesQueryTimeSeriesFilterAggregationPerSeriesAlignerEnum(i interface{}) *DashboardColumnLayoutColumnsWidgetsXyChartDataSetsTimeSeriesQueryTimeSeriesFilterAggregationPerSeriesAlignerEnum {\n\ts, ok := i.(string)\n\tif !ok {\n\t\treturn nil\n\t}\n\n\treturn DashboardColumnLayoutColumnsWidgetsXyChartDataSetsTimeSeriesQueryTimeSeriesFilterAggregationPerSeriesAlignerEnumRef(s)\n}", "title": "" }, { "docid": "69cb0636fb50d8112f49455026b1c4e8", "score": "0.6267189", "text": "func flattenDashboardRowLayoutRowsWidgetsXyChartThresholdsDirectionEnum(i interface{}) *DashboardRowLayoutRowsWidgetsXyChartThresholdsDirectionEnum {\n\ts, ok := i.(string)\n\tif !ok {\n\t\treturn nil\n\t}\n\n\treturn DashboardRowLayoutRowsWidgetsXyChartThresholdsDirectionEnumRef(s)\n}", "title": "" }, { "docid": "9707a2368f241587050de00f77551a0b", "score": "0.6265392", "text": "func flattenDashboardColumnLayoutColumnsWidgetsScorecardTimeSeriesQueryTimeSeriesFilterPickTimeSeriesFilterDirectionEnumMap(c *Client, i interface{}, res *Dashboard) map[string]DashboardColumnLayoutColumnsWidgetsScorecardTimeSeriesQueryTimeSeriesFilterPickTimeSeriesFilterDirectionEnum {\n\ta, ok := i.(map[string]interface{})\n\tif !ok {\n\t\treturn map[string]DashboardColumnLayoutColumnsWidgetsScorecardTimeSeriesQueryTimeSeriesFilterPickTimeSeriesFilterDirectionEnum{}\n\t}\n\n\tif len(a) == 0 {\n\t\treturn map[string]DashboardColumnLayoutColumnsWidgetsScorecardTimeSeriesQueryTimeSeriesFilterPickTimeSeriesFilterDirectionEnum{}\n\t}\n\n\titems := make(map[string]DashboardColumnLayoutColumnsWidgetsScorecardTimeSeriesQueryTimeSeriesFilterPickTimeSeriesFilterDirectionEnum)\n\tfor k, item := range a {\n\t\titems[k] = *flattenDashboardColumnLayoutColumnsWidgetsScorecardTimeSeriesQueryTimeSeriesFilterPickTimeSeriesFilterDirectionEnum(item.(interface{}))\n\t}\n\n\treturn items\n}", "title": "" }, { "docid": "bf412ad1c0669d655cbfc98699c1f022", "score": "0.625915", "text": "func flattenDashboardColumnLayoutColumnsWidgetsScorecardTimeSeriesQueryTimeSeriesFilterRatioPickTimeSeriesFilterDirectionEnumMap(c *Client, i interface{}, res *Dashboard) map[string]DashboardColumnLayoutColumnsWidgetsScorecardTimeSeriesQueryTimeSeriesFilterRatioPickTimeSeriesFilterDirectionEnum {\n\ta, ok := i.(map[string]interface{})\n\tif !ok {\n\t\treturn map[string]DashboardColumnLayoutColumnsWidgetsScorecardTimeSeriesQueryTimeSeriesFilterRatioPickTimeSeriesFilterDirectionEnum{}\n\t}\n\n\tif len(a) == 0 {\n\t\treturn map[string]DashboardColumnLayoutColumnsWidgetsScorecardTimeSeriesQueryTimeSeriesFilterRatioPickTimeSeriesFilterDirectionEnum{}\n\t}\n\n\titems := make(map[string]DashboardColumnLayoutColumnsWidgetsScorecardTimeSeriesQueryTimeSeriesFilterRatioPickTimeSeriesFilterDirectionEnum)\n\tfor k, item := range a {\n\t\titems[k] = *flattenDashboardColumnLayoutColumnsWidgetsScorecardTimeSeriesQueryTimeSeriesFilterRatioPickTimeSeriesFilterDirectionEnum(item.(interface{}))\n\t}\n\n\treturn items\n}", "title": "" }, { "docid": "7b803932cf68436572b410c4ca25ad80", "score": "0.62541455", "text": "func flattenDashboardRowLayoutRowsWidgetsScorecardTimeSeriesQueryTimeSeriesFilterRatioPickTimeSeriesFilterDirectionEnumSlice(c *Client, i interface{}, res *Dashboard) []DashboardRowLayoutRowsWidgetsScorecardTimeSeriesQueryTimeSeriesFilterRatioPickTimeSeriesFilterDirectionEnum {\n\ta, ok := i.([]interface{})\n\tif !ok {\n\t\treturn []DashboardRowLayoutRowsWidgetsScorecardTimeSeriesQueryTimeSeriesFilterRatioPickTimeSeriesFilterDirectionEnum{}\n\t}\n\n\tif len(a) == 0 {\n\t\treturn []DashboardRowLayoutRowsWidgetsScorecardTimeSeriesQueryTimeSeriesFilterRatioPickTimeSeriesFilterDirectionEnum{}\n\t}\n\n\titems := make([]DashboardRowLayoutRowsWidgetsScorecardTimeSeriesQueryTimeSeriesFilterRatioPickTimeSeriesFilterDirectionEnum, 0, len(a))\n\tfor _, item := range a {\n\t\titems = append(items, *flattenDashboardRowLayoutRowsWidgetsScorecardTimeSeriesQueryTimeSeriesFilterRatioPickTimeSeriesFilterDirectionEnum(item.(interface{})))\n\t}\n\n\treturn items\n}", "title": "" }, { "docid": "ad6b818671e8fc4a20ed1c0d321df8bf", "score": "0.6248327", "text": "func flattenDashboardMosaicLayoutTilesWidgetScorecardTimeSeriesQueryTimeSeriesFilterRatioPickTimeSeriesFilterDirectionEnumSlice(c *Client, i interface{}, res *Dashboard) []DashboardMosaicLayoutTilesWidgetScorecardTimeSeriesQueryTimeSeriesFilterRatioPickTimeSeriesFilterDirectionEnum {\n\ta, ok := i.([]interface{})\n\tif !ok {\n\t\treturn []DashboardMosaicLayoutTilesWidgetScorecardTimeSeriesQueryTimeSeriesFilterRatioPickTimeSeriesFilterDirectionEnum{}\n\t}\n\n\tif len(a) == 0 {\n\t\treturn []DashboardMosaicLayoutTilesWidgetScorecardTimeSeriesQueryTimeSeriesFilterRatioPickTimeSeriesFilterDirectionEnum{}\n\t}\n\n\titems := make([]DashboardMosaicLayoutTilesWidgetScorecardTimeSeriesQueryTimeSeriesFilterRatioPickTimeSeriesFilterDirectionEnum, 0, len(a))\n\tfor _, item := range a {\n\t\titems = append(items, *flattenDashboardMosaicLayoutTilesWidgetScorecardTimeSeriesQueryTimeSeriesFilterRatioPickTimeSeriesFilterDirectionEnum(item.(interface{})))\n\t}\n\n\treturn items\n}", "title": "" }, { "docid": "028cc3c196494ede6201132fed15d127", "score": "0.62371343", "text": "func flattenDashboardRowLayoutRowsWidgetsScorecardTimeSeriesQueryTimeSeriesFilterRatioDenominatorAggregationCrossSeriesReducerEnum(i interface{}) *DashboardRowLayoutRowsWidgetsScorecardTimeSeriesQueryTimeSeriesFilterRatioDenominatorAggregationCrossSeriesReducerEnum {\n\ts, ok := i.(string)\n\tif !ok {\n\t\treturn nil\n\t}\n\n\treturn DashboardRowLayoutRowsWidgetsScorecardTimeSeriesQueryTimeSeriesFilterRatioDenominatorAggregationCrossSeriesReducerEnumRef(s)\n}", "title": "" }, { "docid": "cdee09dc5b3c3e86cf0b09ff56f4cf4f", "score": "0.6232596", "text": "func flattenDashboardRowLayoutRowsWidgetsScorecardTimeSeriesQueryTimeSeriesFilterRatioDenominatorAggregationPerSeriesAlignerEnum(i interface{}) *DashboardRowLayoutRowsWidgetsScorecardTimeSeriesQueryTimeSeriesFilterRatioDenominatorAggregationPerSeriesAlignerEnum {\n\ts, ok := i.(string)\n\tif !ok {\n\t\treturn nil\n\t}\n\n\treturn DashboardRowLayoutRowsWidgetsScorecardTimeSeriesQueryTimeSeriesFilterRatioDenominatorAggregationPerSeriesAlignerEnumRef(s)\n}", "title": "" }, { "docid": "464a5ebe445ab65eabf40a438a917d56", "score": "0.622959", "text": "func flattenDashboardColumnLayoutColumnsWidgetsXyChartDataSetsTimeSeriesQueryTimeSeriesFilterPickTimeSeriesFilterDirectionEnumSlice(c *Client, i interface{}, res *Dashboard) []DashboardColumnLayoutColumnsWidgetsXyChartDataSetsTimeSeriesQueryTimeSeriesFilterPickTimeSeriesFilterDirectionEnum {\n\ta, ok := i.([]interface{})\n\tif !ok {\n\t\treturn []DashboardColumnLayoutColumnsWidgetsXyChartDataSetsTimeSeriesQueryTimeSeriesFilterPickTimeSeriesFilterDirectionEnum{}\n\t}\n\n\tif len(a) == 0 {\n\t\treturn []DashboardColumnLayoutColumnsWidgetsXyChartDataSetsTimeSeriesQueryTimeSeriesFilterPickTimeSeriesFilterDirectionEnum{}\n\t}\n\n\titems := make([]DashboardColumnLayoutColumnsWidgetsXyChartDataSetsTimeSeriesQueryTimeSeriesFilterPickTimeSeriesFilterDirectionEnum, 0, len(a))\n\tfor _, item := range a {\n\t\titems = append(items, *flattenDashboardColumnLayoutColumnsWidgetsXyChartDataSetsTimeSeriesQueryTimeSeriesFilterPickTimeSeriesFilterDirectionEnum(item.(interface{})))\n\t}\n\n\treturn items\n}", "title": "" }, { "docid": "066bac9177bbe0c39dfc91c35d8d6428", "score": "0.62073183", "text": "func flattenDashboardGridLayoutWidgetsXyChartDataSetsTimeSeriesQueryTimeSeriesFilterRatioSecondaryAggregationCrossSeriesReducerEnum(i interface{}) *DashboardGridLayoutWidgetsXyChartDataSetsTimeSeriesQueryTimeSeriesFilterRatioSecondaryAggregationCrossSeriesReducerEnum {\n\ts, ok := i.(string)\n\tif !ok {\n\t\treturn nil\n\t}\n\n\treturn DashboardGridLayoutWidgetsXyChartDataSetsTimeSeriesQueryTimeSeriesFilterRatioSecondaryAggregationCrossSeriesReducerEnumRef(s)\n}", "title": "" }, { "docid": "592d612164c68eea6a6e4a0b91600eb4", "score": "0.6203723", "text": "func flattenDashboardColumnLayoutColumnsWidgetsXyChartDataSetsTimeSeriesQueryTimeSeriesFilterRatioPickTimeSeriesFilterDirectionEnumSlice(c *Client, i interface{}, res *Dashboard) []DashboardColumnLayoutColumnsWidgetsXyChartDataSetsTimeSeriesQueryTimeSeriesFilterRatioPickTimeSeriesFilterDirectionEnum {\n\ta, ok := i.([]interface{})\n\tif !ok {\n\t\treturn []DashboardColumnLayoutColumnsWidgetsXyChartDataSetsTimeSeriesQueryTimeSeriesFilterRatioPickTimeSeriesFilterDirectionEnum{}\n\t}\n\n\tif len(a) == 0 {\n\t\treturn []DashboardColumnLayoutColumnsWidgetsXyChartDataSetsTimeSeriesQueryTimeSeriesFilterRatioPickTimeSeriesFilterDirectionEnum{}\n\t}\n\n\titems := make([]DashboardColumnLayoutColumnsWidgetsXyChartDataSetsTimeSeriesQueryTimeSeriesFilterRatioPickTimeSeriesFilterDirectionEnum, 0, len(a))\n\tfor _, item := range a {\n\t\titems = append(items, *flattenDashboardColumnLayoutColumnsWidgetsXyChartDataSetsTimeSeriesQueryTimeSeriesFilterRatioPickTimeSeriesFilterDirectionEnum(item.(interface{})))\n\t}\n\n\treturn items\n}", "title": "" }, { "docid": "be6680b8689608f4aac9527d3c57c08b", "score": "0.6195041", "text": "func flattenDashboardMosaicLayoutTilesWidgetScorecardTimeSeriesQueryTimeSeriesFilterRatioNumeratorAggregationPerSeriesAlignerEnum(i interface{}) *DashboardMosaicLayoutTilesWidgetScorecardTimeSeriesQueryTimeSeriesFilterRatioNumeratorAggregationPerSeriesAlignerEnum {\n\ts, ok := i.(string)\n\tif !ok {\n\t\treturn nil\n\t}\n\n\treturn DashboardMosaicLayoutTilesWidgetScorecardTimeSeriesQueryTimeSeriesFilterRatioNumeratorAggregationPerSeriesAlignerEnumRef(s)\n}", "title": "" }, { "docid": "a283936df2c1bf7154655fd74fe4a38f", "score": "0.6189605", "text": "func flattenDashboardGridLayoutWidgetsXyChartDataSetsTimeSeriesQueryTimeSeriesFilterRatioDenominatorAggregationPerSeriesAlignerEnum(i interface{}) *DashboardGridLayoutWidgetsXyChartDataSetsTimeSeriesQueryTimeSeriesFilterRatioDenominatorAggregationPerSeriesAlignerEnum {\n\ts, ok := i.(string)\n\tif !ok {\n\t\treturn nil\n\t}\n\n\treturn DashboardGridLayoutWidgetsXyChartDataSetsTimeSeriesQueryTimeSeriesFilterRatioDenominatorAggregationPerSeriesAlignerEnumRef(s)\n}", "title": "" }, { "docid": "e46d13e078278ce77d2de3f8bfccbc98", "score": "0.6181026", "text": "func flattenDashboardColumnLayoutColumnsWidgetsScorecardTimeSeriesQueryTimeSeriesFilterPickTimeSeriesFilterRankingMethodEnumSlice(c *Client, i interface{}, res *Dashboard) []DashboardColumnLayoutColumnsWidgetsScorecardTimeSeriesQueryTimeSeriesFilterPickTimeSeriesFilterRankingMethodEnum {\n\ta, ok := i.([]interface{})\n\tif !ok {\n\t\treturn []DashboardColumnLayoutColumnsWidgetsScorecardTimeSeriesQueryTimeSeriesFilterPickTimeSeriesFilterRankingMethodEnum{}\n\t}\n\n\tif len(a) == 0 {\n\t\treturn []DashboardColumnLayoutColumnsWidgetsScorecardTimeSeriesQueryTimeSeriesFilterPickTimeSeriesFilterRankingMethodEnum{}\n\t}\n\n\titems := make([]DashboardColumnLayoutColumnsWidgetsScorecardTimeSeriesQueryTimeSeriesFilterPickTimeSeriesFilterRankingMethodEnum, 0, len(a))\n\tfor _, item := range a {\n\t\titems = append(items, *flattenDashboardColumnLayoutColumnsWidgetsScorecardTimeSeriesQueryTimeSeriesFilterPickTimeSeriesFilterRankingMethodEnum(item.(interface{})))\n\t}\n\n\treturn items\n}", "title": "" } ]
27a0a67157180c9006c3f786a5cb41a2
WaitForHealth Wait for the HTTP service of an instance to be ready
[ { "docid": "7bab657b8a33084b277160483ff7fd2b", "score": "0.7980247", "text": "func (instance *TerrariumInstance) WaitForHealth() error {\n\ttsStart := time.Now()\n\tfor {\n\t\thealthy, err := instance.IsHealthy()\n\t\tif err != nil {\n\t\t\treturn err\n\t\t}\n\t\tif healthy {\n\t\t\tbreak\n\t\t}\n\t\tdlog.Debug(\"Instance is not reachable over HTTPS yet\")\n\t\ttime.Sleep(1 * time.Second)\n\t\tnow := time.Now()\n\t\tif now.Before(tsStart) {\n\t\t\ttsStart = now\n\t\t}\n\t\tif now.Sub(tsStart) > config.HealthTimeout {\n\t\t\treturn errors.New(\"Timeout\")\n\t\t}\n\t}\n\treturn nil\n}", "title": "" } ]
[ { "docid": "8cd0c4ece5b7e0cdb3a9732292735d3d", "score": "0.6319478", "text": "func (g *GCloud) waitForInstance(name, wantStatus string, timeout time.Duration) error {\n\tstart := time.Now()\n\tfor {\n\t\tstatus, err := g.getInstanceStatus(name)\n\t\tif err == nil && status == wantStatus {\n\t\t\treturn nil\n\t\t} else if err != nil {\n\t\t\tif wantStatus == instanceStatusError {\n\t\t\t\t// Assume that the error means that the instance no\n\t\t\t\t// longer exists.\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\tif time.Now().Sub(start) > timeout {\n\t\t\treturn fmt.Errorf(\"Instance did not have status %q within timeout of %s\", wantStatus, timeout)\n\t\t}\n\t\tsklog.Infof(\"Waiting for instance %q (status %s)\", name, status)\n\t\ttime.Sleep(5 * time.Second)\n\t}\n}", "title": "" }, { "docid": "c80f190d93e66fa10f0d721d286bf48d", "score": "0.6176042", "text": "func WaitForMonitoringTPRReady(httpClient *http.Client, host, tprName string) error {\n\treturn wait.Poll(3*time.Second, 30*time.Second, func() (bool, error) {\n\t\tresp, err := httpClient.Get(host + \"/apis/monitoring.coreos.com/v1alpha1/\" + tprName)\n\t\tif err != nil {\n\t\t\treturn false, err\n\t\t}\n\t\tdefer resp.Body.Close()\n\n\t\tswitch resp.StatusCode {\n\t\tcase http.StatusOK:\n\t\t\treturn true, nil\n\t\tcase http.StatusNotFound: // not set up yet. wait.\n\t\t\treturn false, nil\n\t\tdefault:\n\t\t\treturn false, fmt.Errorf(\"invalid status code: %v\", resp.Status)\n\t\t}\n\t})\n}", "title": "" }, { "docid": "725e34367685e4d315c11b05da502758", "score": "0.6085228", "text": "func (g *autoScalingGroup) waitUntilInstancesReady(n int) error {\n\tdeadline := time.Now().Add(10 * time.Minute)\n\tfor {\n\t\tcount, err := inService(g.svc, g.name)\n\t\tif err != nil {\n\t\t\treturn err\n\t\t}\n\t\tif count == n {\n\t\t\treturn nil\n\t\t}\n\t\tif time.Now().After(deadline) {\n\t\t\treturn fmt.Errorf(\"timeout waiting for ASG instances to be ready)\")\n\t\t}\n\t\ttime.Sleep(5 * time.Second)\n\t}\n}", "title": "" }, { "docid": "e26986be8544d0de4073db7ec80243da", "score": "0.6055117", "text": "func (h *handlerImpl) Health(ctx context.Context) (*types.HealthStatus, error) {\n\th.startWG.Wait()\n\th.GetLogger().Debug(\"Matching service health check endpoint reached.\")\n\ths := &types.HealthStatus{Ok: true, Msg: \"matching good\"}\n\treturn hs, nil\n}", "title": "" }, { "docid": "bd3a5255002e9b4e803ca27f0ac9fced", "score": "0.60520595", "text": "func (e *Endpoint) HealthCheck(healthCheckURL string) {\n\tpreviousStatus := e.isActive()\n\tstatusCode := 500\n\tif resp, err := http.Get(e.Address.String() + \"/\" + healthCheckURL); err != nil {\n\t\t// Something is up ... disable this endpoint\n\t\te.Active = false\n\t} else {\n\t\t// Woot! Good to go ...\n\t\tstatusCode = resp.StatusCode\n\t\tif resp.StatusCode >= 500 {\n\t\t\te.Active = false\n\t\t} else {\n\t\t\te.Active = true\n\t\t}\n\t}\n\tlog.WithFields(log.Fields{\n\t\t\"previous\": previousStatus,\n\t\t\"current\": e.Active,\n\t}).Debug(e.Registered)\n\tif e.Active != previousStatus {\n\t\tif e.Active {\n\t\t\t// Whew, we came back online\n\t\t\tlog.WithFields(\n\t\t\t\tlog.Fields{\n\t\t\t\t\t\"URL\": e.Address.String(),\n\t\t\t\t}).Info(\"Up\")\n\t\t\te.Available = time.Now()\n\t\t} else {\n\t\t\t// BOO HISS!\n\t\t\tlog.WithFields(\n\t\t\t\tlog.Fields{\n\t\t\t\t\t\"URL\": e.Address.String(),\n\t\t\t\t\t\"Status\": statusCode,\n\t\t\t\t}).Error(\"Down\")\n\t\t}\n\t}\n}", "title": "" }, { "docid": "8f7589bc98ce3c4f06905b934ebeca30", "score": "0.6017827", "text": "func waitForHTTPStart(t testing.TB, s testHTTPStarter, timeout time.Duration) {\n\ttickCh := time.Tick(10 * time.Millisecond)\n\ttimeoutCh := time.After(timeout)\n\n\tfor {\n\t\tselect {\n\t\tcase <-tickCh:\n\t\t\tif s.IsListeningHTTP() {\n\t\t\t\treturn\n\t\t\t}\n\t\tcase <-timeoutCh:\n\t\t\tt.Errorf(\"The HTTP server did not start within the specified duration\")\n\t\t}\n\t}\n}", "title": "" }, { "docid": "629bdc32c9774b1b2ae956c925965f36", "score": "0.6008555", "text": "func ProbeHttpService(service model.Service, path string) bool {\n\tlog.Printf(\"probing service %v\", service.Id)\n\tif strings.TrimSpace(service.IP) == \"\" {\n\t\treturn false\n\t}\n\n\ttimeOutChan := make(chan string)\n\tserviceUpChan := make(chan string)\n\tgo probeHttpService(service, path, timeOutChan, serviceUpChan)\n\n\tselect {\n\tcase <-serviceUpChan:\n\t\treturn true //Service is up.\n\tcase <-time.After(totalProbeTime):\n\t\tclose(timeOutChan) //Timeout is reached. Stop waiting.\n\t\treturn false\n\t}\n}", "title": "" }, { "docid": "49c1f1832d6886d6e3e41b32001c5d92", "score": "0.59764487", "text": "func Health(w http.ResponseWriter, r *http.Request) {\n\ttime.Sleep(10 * time.Second)\n\tw.WriteHeader(http.StatusOK)\n\treturn\n}", "title": "" }, { "docid": "a4d4f38eb7494ff5112ab85a84c730da", "score": "0.59341925", "text": "func (client Client) WaitForInstanceStatus(ctx context.Context, instanceID int, status InstanceStatus, timeoutSeconds int) (*Instance, error) {\n\tstart := time.Now()\n\tfor {\n\t\tinstance, err := client.GetInstance(ctx, instanceID)\n\t\tif err != nil {\n\t\t\treturn instance, err\n\t\t}\n\t\tcomplete := (instance.Status == status)\n\n\t\tif complete {\n\t\t\treturn instance, nil\n\t\t}\n\n\t\ttime.Sleep(1 * time.Second)\n\t\tif time.Since(start) > time.Duration(timeoutSeconds)*time.Second {\n\t\t\treturn instance, fmt.Errorf(\"Instance %d didn't reach '%s' status in %d seconds\", instanceID, status, timeoutSeconds)\n\t\t}\n\t}\n}", "title": "" }, { "docid": "ac369060685096a5065bfa853c6bd751", "score": "0.5920879", "text": "func (b *Backend) checkHealth() error {\n\ttimeout := 3 * time.Second\n\tu, _ := url.Parse(b.Host)\n\tconn, err := net.DialTimeout(\"tcp\", u.Host, timeout)\n\tb.SetIsAlive(err == nil)\n\n\tif err != nil {\n\t\tlog.Infof(\"healthcheck for %s is %v\", b.Host, err == nil)\n\t}\n\tif conn != nil {\n\t\tconn.Close()\n\t}\n\treturn nil\n}", "title": "" }, { "docid": "c4df61787187494a73c335d349a3bbc1", "score": "0.5918758", "text": "func WaitForInstanceStatus(\n\tclient *gophercloud.ServiceClient, instance *instances.Instance, status string) error {\n\treturn tools.WaitFor(func() (bool, error) {\n\t\tlatest, err := instances.Get(client, instance.ID).Extract()\n\t\tif err != nil {\n\t\t\treturn false, err\n\t\t}\n\n\t\tif latest.Status == status {\n\t\t\treturn true, nil\n\t\t}\n\n\t\tif latest.Status == \"ERROR\" {\n\t\t\treturn false, fmt.Errorf(\"Instance in ERROR state\")\n\t\t}\n\n\t\treturn false, nil\n\t})\n}", "title": "" }, { "docid": "55b062bbd66af508216c12aa734a07df", "score": "0.5896812", "text": "func waitForKuberhealthyEndpointReady(ctx context.Context, kuberhealthyEndpoint string) chan error {\n\n\tdoneChan := make(chan error, 1)\n\n\tfor {\n\t\tselect {\n\t\tcase <-ctx.Done():\n\t\t\tdoneChan <- errors.New(\"context cancelled waiting for Kuberhealthy endpoint to be ready\")\n\t\t\treturn doneChan\n\t\tdefault:\n\t\t}\n\n\t\t_, err := http.NewRequest(\"GET\", kuberhealthyEndpoint, nil)\n\t\tif err == nil {\n\t\t\tlog.Debugln(kuberhealthyEndpoint, \"is ready.\")\n\t\t\tdoneChan <- nil\n\t\t\treturn doneChan\n\t\t} else {\n\t\t\tlog.Debugln(kuberhealthyEndpoint, \"is not ready yet...\"+err.Error())\n\t\t}\n\t\ttime.Sleep(time.Second * 3)\n\t}\n}", "title": "" }, { "docid": "dbb4aa0f6ac42d2f40cabbc1c7e0526c", "score": "0.5886077", "text": "func (c *Client) CheckHealth(mode string) *trtis.HealthResponse {\n\t// Create context for our request with 10 second timeout\n\tctx, cancel := context.WithTimeout(context.Background(), 10*time.Second)\n\tdefer cancel()\n\n\t// Create health request for given mode {\"live\", \"ready\"}\n\thealthRequest := trtis.HealthRequest{\n\t\tMode: mode,\n\t}\n\t// Submit health request to server\n\thealthResponse, err := c.grpcClient.Health(ctx, &healthRequest)\n\tif err != nil {\n\t\tlog.Fatalf(\"Couldn't get server health: %v\", err)\n\t}\n\treturn healthResponse\n}", "title": "" }, { "docid": "c7deff650226357756b20d1947f364cf", "score": "0.5865654", "text": "func checkHealth(serverURL *url.URL, backend *BackendConfig) error {\n\treq, err := backend.newRequest(serverURL)\n\tif err != nil {\n\t\treturn fmt.Errorf(\"failed to create HTTP request: %s\", err)\n\t}\n\n\treq = backend.addHeadersAndHost(req)\n\n\tclient := http.Client{\n\t\tTimeout: backend.requestTimeout,\n\t\tTransport: backend.Options.Transport,\n\t}\n\n\tresp, err := client.Do(req)\n\tif err != nil {\n\t\treturn fmt.Errorf(\"HTTP request failed: %s\", err)\n\t}\n\n\tdefer resp.Body.Close()\n\n\tif resp.StatusCode < http.StatusOK || resp.StatusCode >= http.StatusBadRequest {\n\t\treturn fmt.Errorf(\"received error status code: %v\", resp.StatusCode)\n\t}\n\n\treturn nil\n}", "title": "" }, { "docid": "aa46685bcc39b651e2636ea1ade56d27", "score": "0.5852108", "text": "func healthCheck(connection *sql.DB, t *testing.T, c *testmysql.Container) {\n\tvar pingError error\n\n\tmaxAttempts := 20\n\n\tfor attempts := 1; attempts <= maxAttempts; attempts++ {\n\t\tpingError = connection.Ping()\n\n\t\tif pingError == nil {\n\t\t\tbreak\n\t\t}\n\n\t\ttime.Sleep(time.Duration(attempts) * 100 * time.Millisecond)\n\t}\n\n\tif pingError != nil {\n\t\ttestmysql.DumpContainerLogs(t, c)\n\t\tt.Fatalf(\"waiting for database to be ready: %v\", pingError)\n\t}\n}", "title": "" }, { "docid": "1ff5d820a941dbddce67efe36b2a51c2", "score": "0.5839427", "text": "func (r *rancherUpgrader) WaitFor(desiredState ...string) (*rancher.Service, error) {\n\twaitInterval, _ := time.ParseDuration(fmt.Sprintf(\"%ds\", r.cfg.CheckInterval))\n\twaitTimeout, _ := time.ParseDuration(fmt.Sprintf(\"%ds\", r.cfg.UpgradeWaitTimeout))\n\tdesiredStates := map[string]struct{}{}\n\tfor _, state := range desiredState {\n\t\tdesiredStates[state] = struct{}{}\n\t}\n\tlog.Printf(\"Waiting for service to reach '%s' state\\n\", desiredState)\n\tstart := time.Now()\n\tfor {\n\t\t// Check the service status\n\t\treq, err := http.NewRequest(http.MethodGet, r.svcURL, nil)\n\t\treq.SetBasicAuth(r.cfg.RancherAccessKey, r.cfg.RancherSecretKey)\n\t\tres, err := r.client.Do(req)\n\t\tif err != nil {\n\t\t\t// Probably a network error\n\t\t\tlog.Println(err.Error())\n\t\t\tcontinue\n\t\t}\n\t\tdefer res.Body.Close()\n\t\tservice := rancher.Service{}\n\t\tjson.NewDecoder(res.Body).Decode(&service)\n\t\tlog.Println(\"State\", service.State)\n\t\tif _, ok := desiredStates[service.State]; ok {\n\t\t\t// state was one of the desiredStates\n\t\t\treturn &service, nil\n\t\t}\n\t\t// Block for cfg.CheckInterval seconds each loop cycle.\n\t\ttime.Sleep(waitInterval)\n\t\tif time.Since(start) > waitTimeout {\n\t\t\tlog.Printf(\"Timed out waiting for '%s'\", desiredState)\n\t\t\treturn &service, errors.New(\"Timed out waiting for desiredState\")\n\t\t}\n\t}\n}", "title": "" }, { "docid": "abfa2923af95b9284bcb62ea04bb577d", "score": "0.58095384", "text": "func (util *Utility) WaitForServiceToStart(log log.T, i *InstanceContext, targetVersion string) (result bool, svcRunningErr error) {\n\tisRunning := false\n\tisWorkerRunning := true\n\tvar workRunningErr error\n\tfor attempt := 0; attempt < verifyAttemptCount; attempt++ {\n\t\tif attempt > 0 {\n\t\t\tlog.Infof(\"Retrying update health check %v out of %v\", attempt+1, verifyAttemptCount)\n\t\t\ttime.Sleep(time.Duration(verifyRetryIntervalMilliseconds) * time.Millisecond)\n\t\t}\n\n\t\tisRunning, svcRunningErr = util.IsServiceRunning(log, i)\n\t\tif isRunning {\n\t\t\tlog.Infof(\"health check: amazon-ssm-agent is running\")\n\t\t} else {\n\t\t\tlog.Infof(\"health check: amazon-ssm-agent is not running\")\n\t\t}\n\n\t\tcompareResult, err := VersionCompare(targetVersion, SSMAgentWorkerMinVersion)\n\t\tif err == nil && compareResult >= 0 {\n\t\t\tisWorkerRunning, workRunningErr = util.IsWorkerRunning(log)\n\t\t\tif isWorkerRunning {\n\t\t\t\tlog.Infof(\"health check: %s is running\", model.SSMAgentWorkerName)\n\t\t\t} else {\n\t\t\t\tif workRunningErr != nil {\n\t\t\t\t\tlog.Warnf(\"health check: failed to get state of %s: %v\", model.SSMAgentWorkerName, workRunningErr)\n\t\t\t\t} else {\n\t\t\t\t\tlog.Infof(\"health check: %s is not running\", model.SSMAgentWorkerName)\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\tif svcRunningErr == nil && workRunningErr == nil && isRunning && isWorkerRunning {\n\t\t\treturn true, nil\n\t\t}\n\n\t}\n\n\terrorMessage := \"checking svc and agent worker running err\"\n\tif svcRunningErr != nil {\n\t\terrorMessage += \", \" + svcRunningErr.Error()\n\t}\n\tif workRunningErr != nil {\n\t\terrorMessage += \", \" + workRunningErr.Error()\n\t}\n\n\treturn false, fmt.Errorf(errorMessage)\n}", "title": "" }, { "docid": "477dd6439a56dd98958c2c4117ec693d", "score": "0.57775444", "text": "func waitForBigvState(d *schema.ResourceData, bigvClient *client, waitFor int) error {\n\turl := fmt.Sprintf(\"%s/virtual_machines/%s?view=overview\",\n\t\tbigvUri,\n\t\td.Get(\"name\"),\n\t)\n\n\tlog.Printf(\"[DEBUG] VM Health Check: %s\", url)\n\treq, _ := http.NewRequest(\"GET\", url, nil)\n\n\tvar body []byte\n\tfor {\n\t\tselect {\n\t\tcase <-time.After(waitForVM * time.Second):\n\t\t\treturn fmt.Errorf(\"VM state didn't happen in %d seconds\", waitForVM)\n\t\tcase <-time.Tick(vmCheckInterval * time.Second):\n\t\t\tresp, err := bigvClient.do(req)\n\t\t\tif err != nil {\n\t\t\t\treturn fmt.Errorf(\"Error checking on VM health: %s\", err)\n\t\t\t}\n\n\t\t\t// Always close the body when done\n\t\t\tdefer resp.Body.Close()\n\n\t\t\tbody, _ = ioutil.ReadAll(resp.Body)\n\n\t\t\tlog.Printf(\"[DEBUG] HTTP response Status: %s\", resp.Status)\n\t\t\t// No matter what, update everything comes from the state\n\t\t\tif err := resourceFromJson(d, body); err != nil {\n\t\t\t\treturn err\n\t\t\t}\n\n\t\t\tif resp.StatusCode == http.StatusOK {\n\t\t\t\tif waitFor == waitForProvisioned {\n\t\t\t\t\tlog.Println(\"[DEBUG] VM is Up and HTTP OK\")\n\t\t\t\t\treturn nil\n\t\t\t\t}\n\n\t\t\t\tlog.Println(\"[DEBUG] VM power:\", d.Get(\"power_on\").(bool))\n\t\t\t\tswitch {\n\t\t\t\tcase waitFor == waitForPowered && d.Get(\"power_on\").(bool):\n\t\t\t\t\tlog.Println(\"[DEBUG] VM is powered\")\n\t\t\t\t\treturn nil\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tif resp.StatusCode != http.StatusAccepted && resp.StatusCode != http.StatusOK {\n\t\t\t\treturn fmt.Errorf(\"VM healthcheck Bad HTTP status from bigv: %d\", resp.StatusCode)\n\t\t\t}\n\t\t}\n\t}\n\n\treturn fmt.Errorf(\"VM state didn't happen in %d seconds\", waitForVM)\n}", "title": "" }, { "docid": "2de4c44c28d0438962ae5fb0f6e7f6d0", "score": "0.5770483", "text": "func waitForHealthy() {\n\tif *healthCheckFreq <= 0 {\n\t\treturn\n\t}\n\tif healthCheck() == nil {\n\t\treturn\n\t}\n\tticker := time.NewTicker(time.Duration(*healthCheckFreq) * time.Second)\n\tfor range ticker.C {\n\t\tif healthCheck() == nil {\n\t\t\tticker.Stop()\n\t\t\treturn\n\t\t}\n\t}\n}", "title": "" }, { "docid": "ef5a6656fa1cbe0e1dff6ea9f04a501f", "score": "0.57677466", "text": "func (c *TestArchiver) WaitUntilHealthy(ctx context.Context, t time.Duration) (bool, error) {\n\tif e := c.Expectation(\"WaitUntilHealthy\"); e != nil {\n\t\treturn e.(func(context.Context, time.Duration) (bool, error))(ctx, t)\n\t}\n\treturn false, nil\n}", "title": "" }, { "docid": "c23dec3127186b76451d5e771490eb70", "score": "0.5730355", "text": "func (instance *TerrariumInstance) WaitForDeployment() error {\n\tvar previousStatus TerrariumStatusResponse\n\ttsStart := time.Now()\n\tfor {\n\t\tstatus, err := instance.Status()\n\t\tif err != nil {\n\t\t\treturn err\n\t\t}\n\t\tif *status != previousStatus {\n\t\t\tpreviousStatus = *status\n\t\t\tif !status.Success {\n\t\t\t\treturn errors.New(status.Message)\n\t\t\t}\n\t\t\tdlog.Info(status.Message)\n\t\t\tif status.Done {\n\t\t\t\tbreak\n\t\t\t}\n\t\t}\n\t\ttime.Sleep(1 * time.Second)\n\t\tnow := time.Now()\n\t\tif now.Before(tsStart) {\n\t\t\ttsStart = now\n\t\t}\n\t\tif now.Sub(tsStart) > config.DeployTimeout {\n\t\t\treturn errors.New(\"Timeout\")\n\t\t}\n\t}\n\treturn nil\n}", "title": "" }, { "docid": "fc045186dc208f7b711c5eb1188da04c", "score": "0.57156754", "text": "func (f *Framework) WaitForServiceInstanceReady(name, namespace string) error {\n\tsiClient := f.CatalogClientset.ServicecatalogV1beta1().ServiceInstances(namespace)\n\n\treturn wait.Poll(time.Second, time.Minute*1, func() (bool, error) {\n\t\tsi, err := siClient.Get(name, metav1.GetOptions{})\n\t\tif err != nil {\n\t\t\treturn false, nil\n\t\t}\n\n\t\tfor _, c := range si.Status.Conditions {\n\t\t\tif c.Type == catalogv1beta1.ServiceInstanceConditionReady {\n\t\t\t\tif c.Status == catalogv1beta1.ConditionTrue {\n\t\t\t\t\treturn true, nil\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\treturn false, nil\n\t})\n}", "title": "" }, { "docid": "7b2123fcd13f77ddefc1026a7bcf17bb", "score": "0.5698443", "text": "func WaitForKuberhealthy(ctx context.Context) error {\n\n\tkuberhealthyEndpoint := os.Getenv(external.KHReportingURL)\n\n\t// check the length of the reporting url to make sure we pulled one properly\n\tif len(kuberhealthyEndpoint) < 1 {\n\t\treturn errors.New(\"error getting kuberhealthy reporting URL from environment variable \" +\n\t\t\texternal.KHReportingURL + \" was blank\")\n\t}\n\n\tlog.Debugln(\"Checking if the kuberhealthy endpoint:\", kuberhealthyEndpoint, \"is ready.\")\n\tselect {\n\tcase err := <-waitForKuberhealthyEndpointReady(ctx, kuberhealthyEndpoint):\n\t\tif err != nil {\n\t\t\treturn err\n\t\t}\n\t\tlog.Debugln(\"Kuberhealthy endpoint:\", kuberhealthyEndpoint, \"is ready. Proceeding to run check.\")\n\tcase <-ctx.Done():\n\t\treturn errors.New(\"context cancelled waiting for Kuberhealthy endpoint to be ready\")\n\t}\n\treturn nil\n}", "title": "" }, { "docid": "a858dc8c7eff2398b4ace3d181d51972", "score": "0.56720406", "text": "func (h *HandlerGRPC) Health(context.Context, *healthservice.HealthRequest) (_ *healthservice.HealthStatus, retError error) {\n\th.handlerThrift.startWG.Wait()\n\th.handlerThrift.GetLogger().Debug(\"Matching service health check endpoint (gRPC) reached.\")\n\ths := &healthservice.HealthStatus{Ok: true, Msg: \"matching good\"}\n\treturn hs, nil\n}", "title": "" }, { "docid": "72258f6b7bc44b7a89843a38de9a176e", "score": "0.56657463", "text": "func checkingServiceAvailability(\n\tserviceURL string,\n\tspinner text.Spinner,\n\tc *DeployCommand,\n) (status int, err error) {\n\tremediation := \"The service has been successfully deployed and activated, but the service 'availability' check %s (we were looking for a %s but the last status code response was: %d). If using a custom domain, please be sure to check your DNS settings. Otherwise, your application might be taking longer than usual to deploy across our global network. Please continue to check the service URL and if still unavailable please contact Fastly support.\"\n\n\tdur := time.Duration(c.StatusCheckTimeout) * time.Second\n\tend := time.Now().Add(dur)\n\ttimeout := time.After(dur)\n\tticker := time.NewTicker(1 * time.Second)\n\tdefer func() { ticker.Stop() }()\n\n\terr = spinner.Start()\n\tif err != nil {\n\t\treturn 0, err\n\t}\n\tmsg := \"Checking service availability\"\n\tspinner.Message(msg + generateTimeout(time.Until(end)))\n\n\texpected := \"non-500 status code\"\n\tif validStatusCodeRange(c.StatusCheckCode) {\n\t\texpected = fmt.Sprintf(\"%d status code\", c.StatusCheckCode)\n\t}\n\n\t// Keep trying until we're timed out, got a result or got an error\n\tfor {\n\t\tselect {\n\t\tcase <-timeout:\n\t\t\treturnedStatus := fmt.Sprintf(\" (status: %d)\", status)\n\t\t\tspinner.StopFailMessage(msg + returnedStatus)\n\t\t\tspinErr := spinner.StopFail()\n\t\t\tif spinErr != nil {\n\t\t\t\treturn status, spinErr\n\t\t\t}\n\t\t\treturn status, fsterr.RemediationError{\n\t\t\t\tInner: errors.New(\"service not yet available\"),\n\t\t\t\tRemediation: fmt.Sprintf(remediation, \"timed out\", expected, status),\n\t\t\t}\n\t\tcase t := <-ticker.C:\n\t\t\tvar (\n\t\t\t\tok bool\n\t\t\t\terr error\n\t\t\t)\n\t\t\t// We overwrite the `status` variable in the parent scope (defined in the\n\t\t\t// return arguments list) so it can be used as part of both the timeout\n\t\t\t// and success scenarios.\n\t\t\tok, status, err = pingServiceURL(serviceURL, c.Globals.HTTPClient, c.StatusCheckCode)\n\t\t\tif err != nil {\n\t\t\t\treturnedStatus := fmt.Sprintf(\" (status: %d)\", status)\n\t\t\t\tspinner.StopFailMessage(msg + returnedStatus)\n\t\t\t\tspinErr := spinner.StopFail()\n\t\t\t\tif spinErr != nil {\n\t\t\t\t\treturn status, spinErr\n\t\t\t\t}\n\t\t\t\treturn status, fsterr.RemediationError{\n\t\t\t\t\tInner: err,\n\t\t\t\t\tRemediation: fmt.Sprintf(remediation, \"failed\", expected, status),\n\t\t\t\t}\n\t\t\t} else if ok {\n\t\t\t\treturnedStatus := fmt.Sprintf(\" (status: %d)\", status)\n\t\t\t\tspinner.StopMessage(msg + returnedStatus)\n\t\t\t\treturn status, spinner.Stop()\n\t\t\t}\n\t\t\t// Service not available, and no error, so jump back to top of loop\n\t\t\tspinner.Message(msg + generateTimeout(end.Sub(t)))\n\t\t}\n\t}\n}", "title": "" }, { "docid": "e938ef84d8bb9499e62fc8941da3bd84", "score": "0.5649498", "text": "func WaitForGreen(es *elastic.Client, maxTimeout *time.Duration) error {\n\tstart := time.Now()\n\tfor {\n\t\tlog.Info(\"check if elastic is ready\")\n\t\terr := es.WaitForGreenStatus(\"10s\")\n\t\tif err == nil {\n\t\t\tbreak\n\t\t}\n\t\tif maxTimeout != nil && time.Now().Sub(start) > *maxTimeout {\n\t\t\treturn errors.New(\"could not connect toElasticSearch in time\")\n\t\t}\n\t\tlog.Info(\"ElasticSearch not ready - wait\")\n\t}\n\n\treturn nil\n}", "title": "" }, { "docid": "bbaadb29326a28b59660ff924e908dc5", "score": "0.5646389", "text": "func (api *ApiServer) HealthCheck() (err error) {\n\terr = api.client.Ping()\n\tif err != nil {\n\t\terr = errors.Wrap(err, \"eth: \")\n\t}\n\n\treturn err\n}", "title": "" }, { "docid": "2af660dec620b0e2383be7aaf6b8c9ac", "score": "0.5635655", "text": "func HealthcheckURL(url string, retries int) error {\n\n\tvar err error\n\n\ttime.Sleep(3 * time.Second)\n\n\tfor retry := 0; retry < retries; retry++ {\n\n\t\t_, err = http.Get(url)\n\n\t\tif err != nil {\n\t\t\ttime.Sleep(3 * time.Second)\n\t\t} else {\n\t\t\treturn nil\n\t\t}\n\t}\n\treturn err\n}", "title": "" }, { "docid": "c44b223dd9e25992439b0afb7a6c291a", "score": "0.56266296", "text": "func (s *HttpcapServer) Wait() { s.wg.Wait() }", "title": "" }, { "docid": "8fe00fcfc34b75cb8989911767c61142", "score": "0.56135964", "text": "func (r *UserRest) Health(w http.ResponseWriter, req *http.Request) {\n\tr.mu.Lock()\n\tdefer r.mu.Unlock()\n\n\tif r.healthy {\n\t\tresp := HealthStatus{\n\t\t\tHostname: r.hostname,\n\t\t\tStartedAt: r.startedAt.Format(\"2006-01-02_15:04:05\"),\n\t\t\tUptime: time.Now().UTC().Sub(r.startedAt).String(),\n\t\t\tBuild: r.buildInfo,\n\t\t}\n\n\t\tWriteJSON(w, resp)\n\t} else {\n\t\tWriteErr(w, fmt.Errorf(\"Server in graceful shutdown mode\"), http.StatusInternalServerError)\n\t}\n}", "title": "" }, { "docid": "dcab27ad65d3255f60f3f9a7f32ac76f", "score": "0.56046623", "text": "func (aws AWS) WaitUntilRunning(host *Host, timeout time.Duration) error {\n\treturn WaitUntilRunningOnEC2(aws.SVC, (*host).ID, timeout, host)\n}", "title": "" }, { "docid": "3821bb5bb2e24c92c987911e9be08ec5", "score": "0.5596106", "text": "func (j *TestJig) WaitForLoadBalancerDestroy(ctx context.Context, ip string, port int, timeout time.Duration) (*v1.Service, error) {\n\t// TODO: once support ticket 21807001 is resolved, reduce this timeout back to something reasonable\n\tdefer func() {\n\t\tif err := framework.EnsureLoadBalancerResourcesDeleted(ctx, ip, strconv.Itoa(port)); err != nil {\n\t\t\tframework.Logf(\"Failed to delete cloud resources for service: %s %d (%v)\", ip, port, err)\n\t\t}\n\t}()\n\n\tframework.Logf(\"Waiting up to %v for service %q to have no LoadBalancer\", timeout, j.Name)\n\tservice, err := j.waitForCondition(ctx, timeout, \"have no load balancer\", func(svc *v1.Service) bool {\n\t\treturn len(svc.Status.LoadBalancer.Ingress) == 0\n\t})\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\treturn j.sanityCheckService(service, service.Spec.Type)\n}", "title": "" }, { "docid": "89ee4fe3cf482d73b866d674353dc0dc", "score": "0.55855095", "text": "func waitForServer(t *testing.T, localPort string) {\n\tfor i := 0; i < 10; i++ {\n\t\ttime.Sleep(100 * time.Millisecond)\n\t\tres, err := http.Get(fmt.Sprintf(\"http://localhost:%s/ping\", localPort))\n\t\tif err == nil && res.StatusCode == 200 {\n\t\t\treturn\n\t\t}\n\t}\n\tassert.Fail(t, \"server failed to start within 1 second\")\n}", "title": "" }, { "docid": "7718f2028610e711ccca1fc01f188aaa", "score": "0.55706716", "text": "func (s *Service) WaitReady() error {\n\tif s.server.ReadyForConnections(serverStartTimeout) {\n\t\treturn nil\n\t}\n\n\treturn errorx.TimeoutElapsed.New(\n\t\t\"Failed to start NATS server within %d seconds\", serverStartTimeout,\n\t)\n}", "title": "" }, { "docid": "330ad78874d3a4b3016af87d62566a95", "score": "0.556143", "text": "func (r *AppRest) Health(w http.ResponseWriter, req *http.Request) {\n\tr.mu.Lock()\n\tdefer r.mu.Unlock()\n\n\tif r.healthy {\n\t\tdbstatus := \"ok\"\n\t\terr := r.db.Ping()\n\t\tif err != nil {\n\t\t\tdbstatus = \"down\"\n\t\t}\n\n\t\tresp := HealthStatus{\n\t\t\tHostname: r.hostname,\n\t\t\tStartedAt: r.startedAt.Format(\"2006-01-02_15:04:05\"),\n\t\t\tUptime: time.Now().UTC().Sub(r.startedAt).String(),\n\t\t\tBuild: r.buildInfo,\n\t\t\tDBStatus: dbstatus,\n\t\t}\n\n\t\tWriteJSON(w, resp)\n\t} else {\n\t\tWriteErr(w, fmt.Errorf(\"Server in graceful shutdown mode\"), http.StatusInternalServerError)\n\t}\n}", "title": "" }, { "docid": "efee3202b3bb220d05daa5e761648976", "score": "0.5554826", "text": "func (s *ServerPool) HealthCheck() {\n\tfor _, b := range s.backends {\n\t\tstatus := \"up\"\n\t\talive := isBackendAlive(b.URL)\n\t\tb.SetAlive(alive)\n\t\tif !alive {\n\t\t\tstatus = \"down\"\n\t\t}\n\t\tlog.Printf(\"%s [%s]\\n\", b.URL, status)\n\t}\n}", "title": "" }, { "docid": "343d256cae8083d50ad7f8e41b9b15a6", "score": "0.5550223", "text": "func main() {\n\t// Create a new Checker\n\tchecker := health.NewChecker(\n\n\t\t// Configure a global timeout that will be applied to all checks.\n\t\thealth.WithTimeout(10*time.Second),\n\n\t\t// A simple successFunc to see if a fake database connection is up.\n\t\thealth.WithCheck(health.Check{\n\t\t\tName: \"database\",\n\t\t\tTimeout: 2 * time.Second, // A successFunc specific timeout.\n\t\t\tStatusListener: onComponentStatusChanged,\n\t\t\tCheck: func(ctx context.Context) error {\n\t\t\t\treturn nil // no error\n\t\t\t},\n\t\t}),\n\n\t\t// A simple successFunc to see if a fake file system up.\n\t\thealth.WithCheck(health.Check{\n\t\t\tName: \"filesystem\",\n\t\t\tTimeout: 2 * time.Second, // A successFunc specific timeout.\n\t\t\tStatusListener: onComponentStatusChanged,\n\t\t\tCheck: func(ctx context.Context) error {\n\t\t\t\treturn nil // example error\n\t\t\t},\n\t\t}),\n\n\t\t// The following check will be executed periodically every 30 seconds.\n\t\thealth.WithPeriodicCheck(5*time.Second, 10*time.Second, health.Check{\n\t\t\tName: \"search-engine\",\n\t\t\tStatusListener: onComponentStatusChanged,\n\t\t\tCheck: volatileFunc(),\n\t\t}),\n\n\t\t// This listener will be called whenever system health status changes (e.g., from \"up\" to \"down\").\n\t\thealth.WithStatusListener(onSystemStatusChanged),\n\t)\n\n\t// We Create a new http.Handler that provides health successFunc information\n\t// serialized as a JSON string via HTTP.\n\thttp.Handle(\"/health\", health.NewHandler(checker))\n\thttp.ListenAndServe(\":3000\", nil)\n}", "title": "" }, { "docid": "72e6cf4a9694273782a5226d99c4def6", "score": "0.5537917", "text": "func (ctr *Container) WaitForHealthy(healthyTimeout time.Duration) error {\n\ttimeout := time.After(healthyTimeout * time.Second)\n\ttick := time.Tick(1 * time.Second)\n\n\tfor {\n\t\tselect {\n\t\tcase <-timeout:\n\t\t\treturn errors.New(\"container not healthy\")\n\t\tcase <-tick:\n\t\t\tif ctr.IsHealthy() {\n\t\t\t\treturn nil\n\t\t\t}\n\t\t}\n\n\t}\n\n}", "title": "" }, { "docid": "69f16a7eec29521db0e3f27862184094", "score": "0.5534996", "text": "func WaitForStatus(c *gophercloud.ServiceClient, id, status string, secs int) error {\n\treturn gophercloud.WaitFor(secs, func() (bool, error) {\n\t\tcurrent, err := Get(c, id).Extract()\n\t\tif err != nil {\n\t\t\treturn false, err\n\t\t}\n\n\t\tif current.Status == status {\n\t\t\treturn true, nil\n\t\t}\n\n\t\treturn false, nil\n\t})\n}", "title": "" }, { "docid": "a50d01548ce2b707685a63f91e4d457f", "score": "0.55308443", "text": "func (c *Client) WaitForActivationPhase(name string, phase v1alpha1.Phase) error {\n\tbackupSI := &v1alpha1.ServiceInstance{}\n\n\t// wait for the status of the newly created resource\n\tfor count := 0; count < 60; count++ {\n\n\t\terr := c.Client.Get(context.Background(), types.NamespacedName{\n\t\t\tName: name,\n\t\t\t// TODO retrive somehow IS namespace\n\t\t\tNamespace: \"pipeline-system\",\n\t\t}, backupSI)\n\n\t\tif err != nil {\n\t\t\tfmt.Println(errors.Wrap(err, \"failed to look up service instance\"))\n\t\t} else {\n\t\t\t// TODO use a specific error to signal shouldRetry\n\t\t\tif backupSI != nil && backupSI.Status.Status == v1alpha1.StatusManaged &&\n\t\t\t\tbackupSI.Status.Phase == phase {\n\t\t\t\t// is.logger.Debug(\"Service instance status populated.\")\n\t\t\t\t// step forward\n\t\t\t\treturn nil\n\t\t\t}\n\t\t}\n\n\t\t// sleep a bit for the reconcile to proceed\n\t\ttime.Sleep(2 * time.Second)\n\t}\n\n\treturn errors.New(fmt.Sprintf(\"timeout waiting for ServiceInstance phase: %s\", phase))\n}", "title": "" }, { "docid": "7ee9a011d146d83c761d32e6b6b9c272", "score": "0.5526668", "text": "func (h *Health) Check(\n\tinterval int,\n\trpcTimeout int,\n\tlogger *logrus.Logger,\n\tgotenberg *gotenberg.Client,\n\tconns ...*grpc.ClientConn) {\n\trpcTimeoutDuration := time.Duration(rpcTimeout) * time.Second\n\tfor {\n\t\tflag := true\n\t\tfor _, conn := range conns {\n\t\t\tfunc() {\n\t\t\t\trpcCtx, rpcCancel := context.WithTimeout(context.Background(), rpcTimeoutDuration)\n\t\t\t\tdefer rpcCancel()\n\t\t\t\tresp, err := healthpb.NewHealthClient(conn).Check(\n\t\t\t\t\trpcCtx, &healthpb.HealthCheckRequest{Service: \"\"})\n\t\t\t\ttargetMsg := fmt.Sprintf(\"target server %s\", conn.Target())\n\t\t\t\tif err != nil {\n\t\t\t\t\tif stat, ok := status.FromError(err); ok && stat.Code() == codes.Unimplemented {\n\t\t\t\t\t\tlogger.Printf(\n\t\t\t\t\t\t\t\"error: %s does not implement the grpc health protocol (grpc.health.v1.Health)\",\n\t\t\t\t\t\t\ttargetMsg)\n\t\t\t\t\t} else if stat, ok := status.FromError(err); ok && stat.Code() == codes.DeadlineExceeded {\n\t\t\t\t\t\tlogger.Printf(\"timeout: %s health rpc did not complete within %v\", targetMsg, rpcTimeout)\n\t\t\t\t\t} else {\n\t\t\t\t\t\tlogger.Printf(\"error: %s health rpc failed: %+v\", err, targetMsg)\n\t\t\t\t\t}\n\t\t\t\t\th.UnSet()\n\t\t\t\t\tflag = false\n\t\t\t\t}\n\n\t\t\t\tif resp.GetStatus() != healthpb.HealthCheckResponse_SERVING {\n\t\t\t\t\tlogger.Printf(\"%s service unhealthy (responded with %q)\",\n\t\t\t\t\t\ttargetMsg, resp.GetStatus().String())\n\t\t\t\t\th.UnSet()\n\t\t\t\t\tflag = false\n\t\t\t\t}\n\t\t\t}()\n\t\t}\n\n\t\tif !gotenberg.Healthy() {\n\t\t\tlogger.Printf(\"error: gotenberg at %s unhealthy\", gotenberg.Hostname)\n\t\t\th.UnSet()\n\t\t\tflag = false\n\t\t}\n\n\t\tif flag {\n\t\t\th.Set()\n\t\t}\n\n\t\ttime.Sleep(time.Second * time.Duration(interval))\n\t}\n}", "title": "" }, { "docid": "301d074af483d9ff8e539eed4fd8dfaa", "score": "0.55254024", "text": "func (s stack) WaitHostReady(hostParam stacks.HostParameter, timeout time.Duration) (_ *abstract.HostCore, xerr fail.Error) {\n\tnullAHC := abstract.NewHostCore()\n\tif s.IsNull() {\n\t\treturn nullAHC, fail.InvalidInstanceError()\n\t}\n\tahf, hostRef, xerr := stacks.ValidateHostParameter(hostParam)\n\tif xerr != nil {\n\t\treturn nullAHC, xerr\n\t}\n\n\tdefer debug.NewTracer(nil, tracing.ShouldTrace(\"stack.aws\") || tracing.ShouldTrace(\"stacks.compute\"), \"(%s, %v)\", hostRef, timeout).WithStopwatch().Entering().Exiting()\n\tdefer fail.OnPanic(&xerr)\n\tdefer fail.OnExitTraceError(&xerr)\n\n\tretryErr := retry.WhileUnsuccessful(\n\t\tfunc() error {\n\t\t\thostTmp, innerXErr := s.InspectHost(ahf)\n\t\t\tif innerXErr != nil {\n\t\t\t\tswitch innerXErr.(type) {\n\t\t\t\tcase *fail.ErrNotFound:\n\t\t\t\t\treturn retry.StopRetryError(innerXErr)\n\t\t\t\tdefault:\n\t\t\t\t\treturn innerXErr\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tahf = hostTmp\n\n\t\t\tif hostTmp.CurrentState == hoststate.Error {\n\t\t\t\tinnerXErr = retry.StopRetryError(fail.NewError(\"last state: %s\", hostTmp.CurrentState.String()), \"error waiting for host in ready state\")\n\t\t\t\treturn innerXErr\n\t\t\t}\n\n\t\t\tif hostTmp.CurrentState != hoststate.Started {\n\t\t\t\tinnerXErr = fail.NewError(\"not in ready state (current state: %s)\", ahf.CurrentState.String())\n\t\t\t\treturn innerXErr\n\t\t\t}\n\t\t\treturn nil\n\t\t},\n\t\ttemporal.GetDefaultDelay(),\n\t\ttimeout,\n\t)\n\tif retryErr != nil {\n\t\tswitch retryErr.(type) {\n\t\tcase *retry.ErrStopRetry:\n\t\t\treturn nullAHC, fail.Wrap(fail.Cause(retryErr), \"stopping retries\")\n\t\tcase *retry.ErrTimeout:\n\t\t\treturn nullAHC, fail.Wrap(fail.Cause(retryErr), \"timeout waiting to get host '%s' information after %v\", ahf.GetID(), timeout)\n\t\tdefault:\n\t\t\treturn nullAHC, retryErr\n\t\t}\n\t}\n\treturn ahf.Core, nil\n}", "title": "" }, { "docid": "570c86955b34945ab62c15baec073c5a", "score": "0.5514913", "text": "func (w *fakeWaiter) WaitForHealthyKubelet(_ time.Duration, _ string) error {\n\treturn nil\n}", "title": "" }, { "docid": "4dec0f03e6cae8156de1ac2ae22e2cb9", "score": "0.5511133", "text": "func (i ClusterInstance) waitUntilActive(log *logging.Logger) error {\n\tfor {\n\t\t// Attempt an SSH connection\n\t\tif _, err := i.GetMachineID(log); err == nil {\n\t\t\t// Success\n\t\t\treturn nil\n\t\t}\n\t\t// Wait a while\n\t\ttime.Sleep(time.Second * 5)\n\t}\n}", "title": "" }, { "docid": "452b90c727b33c03c7490741f9cda068", "score": "0.550924", "text": "func (s *service) CheckHealth() (err error) {\n\tprefix := \"rabbitmq healthcheck: \"\n\tdefer func() {\n\t\tif err != nil {\n\t\t\terr = errors.New(prefix + err.Error())\n\t\t}\n\t}()\n\tif s.conn == nil {\n\t\terr = errors.New(\"rabbitmq connection is closed\")\n\t\treturn err\n\t}\n\n\tif s.publishChan == nil {\n\t\terr = errors.New(\"rabbitmq channel is closed\")\n\t\treturn err\n\t}\n\tif !s.publishChan.IsConnected() {\n\t\terr = errors.New(fmt.Sprint(\"rabbitmq created channel failed:\", err))\n\t\treturn err\n\t}\n\n\tif !s.IsHealthy() {\n\t\terr = errors.New(fmt.Sprint(\"rabbitmq channel/s closed unexpetedly:\", err))\n\t\treturn err\n\t}\n\n\treturn nil\n}", "title": "" }, { "docid": "dbd013efd57bef5563c797aacf32e889", "score": "0.55058944", "text": "func (j *TestJig) WaitForLoadBalancer(ctx context.Context, timeout time.Duration) (*v1.Service, error) {\n\tframework.Logf(\"Waiting up to %v for service %q to have a LoadBalancer\", timeout, j.Name)\n\tservice, err := j.waitForCondition(ctx, timeout, \"have a load balancer\", func(svc *v1.Service) bool {\n\t\treturn len(svc.Status.LoadBalancer.Ingress) > 0\n\t})\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\tfor i, ing := range service.Status.LoadBalancer.Ingress {\n\t\tif ing.IP == \"\" && ing.Hostname == \"\" {\n\t\t\treturn nil, fmt.Errorf(\"unexpected Status.LoadBalancer.Ingress[%d] for service: %#v\", i, ing)\n\t\t}\n\t}\n\n\treturn j.sanityCheckService(service, v1.ServiceTypeLoadBalancer)\n}", "title": "" }, { "docid": "ffbc46374df58c6e95e62f112fd4a284", "score": "0.5501305", "text": "func (h *Health) Check(context.Context, *grpc_health_v1.HealthCheckRequest) (*grpc_health_v1.HealthCheckResponse, error) {\n\tif isStartReady == true {\n\t\treturn &grpc_health_v1.HealthCheckResponse{Status: grpc_health_v1.HealthCheckResponse_SERVING}, nil\n\t} else if isStartReady == false {\n\t\treturn &grpc_health_v1.HealthCheckResponse{Status: grpc_health_v1.HealthCheckResponse_NOT_SERVING}, nil\n\t} else {\n\t\treturn &grpc_health_v1.HealthCheckResponse{Status: grpc_health_v1.HealthCheckResponse_UNKNOWN}, nil\n\t}\n}", "title": "" }, { "docid": "58b9fb9a7eca14da5de236552fe76fe4", "score": "0.5495251", "text": "func waitUntilServerAvailable(ctx context.Context, c driver.Client) bool {\n\tinstanceUp := make(chan bool)\n\tgo func() {\n\t\tfor {\n\t\t\tverCtx, cancel := context.WithTimeout(ctx, time.Second*5)\n\t\t\tif _, err := c.Version(verCtx); err == nil {\n\t\t\t\tcancel()\n\t\t\t\tinstanceUp <- true\n\t\t\t\treturn\n\t\t\t} else {\n\t\t\t\tcancel()\n\t\t\t\ttime.Sleep(time.Second)\n\t\t\t}\n\t\t}\n\t}()\n\tselect {\n\tcase up := <-instanceUp:\n\t\treturn up\n\tcase <-ctx.Done():\n\t\treturn false\n\t}\n}", "title": "" }, { "docid": "dcd68aa0a6695160ce54f946b9efeeb2", "score": "0.5491933", "text": "func PingUntil200(t *testing.T, timeout time.Duration, pingURL string) {\n\t// once the server is ping-able, we can continue\n\tstart := time.Now()\n\tpingOK := false\n\tsleepMS := 1\n\tt.Logf(\"Pinging %v until service comes alive\", pingURL)\n\tfor time.Now().Sub(start) < time.Second {\n\t\tresp, err := http.DefaultClient.Get(pingURL)\n\t\tif resp != nil {\n\t\t\tdefer resp.Body.Close()\n\t\t}\n\t\tif err == nil && resp.StatusCode == 200 {\n\t\t\tpingOK = true\n\t\t\tbreak\n\t\t}\n\t\ttime.Sleep(time.Duration(sleepMS) * time.Millisecond)\n\t\tsleepMS *= 2\n\t}\n\tif !pingOK {\n\t\tt.Fatalf(\"Failed to ping server at %v after initial startup\", pingURL)\n\t}\n}", "title": "" }, { "docid": "80299363c8fb3530f8443ce3609f9476", "score": "0.54680514", "text": "func HealthCheck() int {\n\tvar OK = 0\n\n\t//try to ping core-data\n\t_, err := http.Get(\"http://localhost:48080/api/vi/ping\")\n\tif err != nil {\n\t\tlog.Fatal(err)\n\t\tOK = 1\n\t}\n\t//try to ping core-metadata\n\t_, err = http.Get(\"http://localhost:48081/api/v1/ping\")\n\tif err != nil {\n\t\tlog.Fatal(err)\n\t\tOK = 1\n\t}\n\t//check if parser set state to true\n\tstate := StateGet()\n\tif state == false {\n\t\tOK = 1\n\t}\n\n\treturn OK\n}", "title": "" }, { "docid": "1e314bbd64f598f31b1d671cdbb5926d", "score": "0.5448218", "text": "func (conn *cloudConnector) waitForActiveInstance(id string) error {\n\tattempt := 0\n\treturn wait.PollImmediate(RetryInterval, RetryTimeout, func() (bool, error) {\n\t\tattempt++\n\n\t\tserver, err := conn.client.GetServer(id)\n\t\tif err != nil {\n\t\t\treturn false, nil\n\t\t}\n\t\tLogger(conn.ctx).Infof(\"Attempt %v: Instance `%v` is in status `%s`\", attempt, id, server.Status)\n\t\tif strings.ToLower(server.Status) == \"active\" && server.PowerStatus == \"running\" {\n\t\t\treturn true, nil\n\t\t}\n\t\treturn false, nil\n\t})\n}", "title": "" }, { "docid": "b24dce1a7bf7da65754477d7c4210875", "score": "0.5440028", "text": "func (c *Checker) checkHTTP(result chan bool) {\n\t// Enter network namespace only if we are running in bridge mode\n\tif c.TaskInfo.GetContainer().GetDocker().GetNetwork() == mesos.ContainerInfo_DockerInfo_BRIDGE {\n\t\tdefer namespace.ExitNetworkNamespace() // No matter what happen, we must return into executor namespace and unlock thread\n\n\t\t// Enter container network namespace\n\t\terr := namespace.EnterNetworkNamespace(c.Pid)\n\t\tif err != nil {\n\t\t\tlogger.GetInstance().Debug(\"Error while getting container namespace\",\n\t\t\t\tzap.Error(err),\n\t\t\t)\n\n\t\t\tresult <- false\n\n\t\t\treturn\n\t\t}\n\t}\n\n\t// Prepare raw TCP request\n\t// We can't use net/http package here because transport RoundTripper\n\t// would make the call on another goroutine, making the network namespace\n\t// to be switched to another one that we don't care.\n\tport := c.TaskInfo.GetHealthCheck().GetHTTP().GetPort()\n\tpath := c.TaskInfo.GetHealthCheck().GetHTTP().GetPath()\n\tconn, err := net.DialTimeout(\"tcp\", fmt.Sprintf(\"localhost:%d\", port), time.Duration(c.TaskInfo.GetHealthCheck().GetTimeoutSeconds())*time.Second)\n\tif err != nil {\n\t\tlogger.GetInstance().Error(\"Error while connecting to health check socket\",\n\t\t\tzap.Error(err),\n\t\t)\n\n\t\tresult <- false\n\n\t\treturn\n\t}\n\tdefer conn.Close()\n\n\t// Do raw HTTP request and get status\n\t// Then, parse it into an HTTP response in order\n\t// to be able to easily manipulate it\n\tfmt.Fprintf(conn, fmt.Sprintf(\"GET %s HTTP/1.0\\r\\n\\r\\n\", path))\n\tstatus := bufio.NewReader(conn)\n\tresponse, err := http.ReadResponse(status, nil)\n\tif err != nil {\n\t\tlogger.GetInstance().Error(\"Error while reading HTTP response\",\n\t\t\tzap.Error(err),\n\t\t)\n\n\t\tresult <- false\n\n\t\treturn\n\t}\n\n\t// Check status code: should be between 200 and 399\n\tif response.StatusCode < 200 || response.StatusCode > 399 {\n\t\tlogger.GetInstance().Error(\"Unexpected status code\",\n\t\t\tzap.Int(\"code\", response.StatusCode),\n\t\t)\n\n\t\tresult <- false\n\n\t\treturn\n\t}\n\n\tresult <- true\n}", "title": "" }, { "docid": "d0c5e4f63ef10979e273008b22342284", "score": "0.54376656", "text": "func (cmdctx *CommandContext) WaitForReady() error {\n\n\tlogPrefix := fmt.Sprintf(\"Command(%d/%d):\", cmdctx.Seq, len(cmdList))\n\n\tif cmdctx.OperationType == \"show\" || cmdctx.OperationType == \"list\" ||\n\t\t(cmdctx.ResourceType == \"loadbalancer\" && cmdctx.OperationType == \"create\") {\n\t\treturn nil\n\t}\n\n\tlogger.Printf(\"%s Confirm %s is not pending\", logPrefix, cmdctx.LoadBalancer)\n\n\tmaxErrTries := 3\n\terrTried := 0\n\tfor retries := maxCheckTimes; retries > 0; retries-- {\n\t\tvar status string\n\t\tvar err error\n\t\tif dbConn != nil {\n\t\t\tstatus, err = LBStatusFromDB(cmdctx.LoadBalancer)\n\t\t} else {\n\t\t\tstatus, err = LBStatusFromCmd(cmdctx.LoadBalancer)\n\t\t}\n\n\t\tif err != nil {\n\t\t\tlogger.Printf(\"%s Checking loadbalancer(%s) status failed: %s\",\n\t\t\t\tlogPrefix, cmdctx.LoadBalancer, err.Error())\n\t\t\terrTried++\n\t\t\tif errTried >= maxErrTries {\n\t\t\t\treturn fmt.Errorf(\"Loadbalancer %s status check fails for %d times, last failure: %s\",\n\t\t\t\t\tcmdctx.LoadBalancer, maxErrTries, err.Error())\n\t\t\t}\n\t\t} else {\n\t\t\terrTried = 0\n\t\t}\n\n\t\tlogger.Printf(\"%s Checked loadbalancer %s status %s\",\n\t\t\tlogPrefix, cmdctx.LoadBalancer, status)\n\n\t\tif strings.HasPrefix(status, \"PENDING_\") {\n\t\t\ttime.Sleep(time.Duration(1) * time.Second)\n\t\t\tcontinue\n\t\t} else {\n\t\t\treturn nil\n\t\t}\n\t}\n\n\treturn fmt.Errorf(\"Loadbalancer %s is still PENDING after %d times' check\", cmdctx.LoadBalancer, maxCheckTimes)\n}", "title": "" }, { "docid": "7bb9fbfc38fffbe748320e362fa7b8a5", "score": "0.5434546", "text": "func (httpAPI *API) Health(params martini.Params, r render.Render, req *http.Request) {\n\thealth, err := process.HealthTest()\n\tif err != nil {\n\t\tRespond(r, &APIResponse{Code: ERROR, Message: fmt.Sprintf(\"Application node is unhealthy %+v\", err), Details: health})\n\t\treturn\n\t}\n\n\tRespond(r, &APIResponse{Code: OK, Message: \"Application node is healthy\", Details: health})\n\n}", "title": "" }, { "docid": "f4255c401ba2ca594a88825c8fb20a9b", "score": "0.5434131", "text": "func HealthCheck() {\n\tvar opts []grpc.DialOption\n\topts = append(opts, grpc.WithInsecure())\n\n\tconn, err := grpc.Dial(serverAddr, opts...)\n\n\tif err != nil {\n\t\tlog.Fatal(err)\n\t\tos.Exit(1)\n\t}\n\n\tclient := NewAdminServiceClient(conn)\n\n\tctx, cancel := context.WithTimeout(context.Background(), 10*time.Second)\n\tdefer cancel()\n\n\tres, err := client.HealthCheck(ctx, &GoogleProtobuf_Empty{})\n\n\tif err != nil {\n\t\tlog.Fatal(err)\n\t\tos.Exit(1)\n\t}\n\n\tfmt.Printf(\"received response: %v\", res)\n\n\tdefer conn.Close()\n}", "title": "" }, { "docid": "6d8e22c64ce32f3ce090fd1bbfe70333", "score": "0.5433081", "text": "func checkHostHealth(h *host.Host) bool {\n\tif h.Status == evergreen.HostRunning {\n\t\treturn false\n\t}\n\n\t// User data can start anytime after the instance is created, so the app\n\t// server may not have marked it as running yet.\n\tif h.Distro.BootstrapSettings.Method == distro.BootstrapMethodUserData && h.Status == evergreen.HostStarting {\n\t\treturn false\n\t}\n\n\tgrip.Info(message.Fields{\n\t\t\"message\": \"host is not running, so agent should exit\",\n\t\t\"status\": h.Status,\n\t\t\"bootstrap_method\": h.Distro.BootstrapSettings.Method,\n\t\t\"bootstrap_communication\": h.Distro.BootstrapSettings.Communication,\n\t\t\"host_id\": h.Id,\n\t})\n\n\treturn true\n}", "title": "" }, { "docid": "e753d0ec0e6e95695f93528be12c44f5", "score": "0.5432244", "text": "func checkHealthService() {\n\tfor {\n\t\ttime.Sleep(util.HEALTH_CHECK_INTERVAL * time.Second)\n\n\t\t//Stop trying to connect after #numberOfRetry attempts.\n\t\tnumberOfRetry := 0\n\n\t\tif !peers.contains(util.Config.BootstrapIpport) {\n\t\t\tp, err := initiateNewClientConnection(util.Config.BootstrapIpport)\n\t\t\tif p == nil || err != nil {\n\t\t\t\tlogger.Printf(\"%v\\n\", err)\n\t\t\t} else {\n\t\t\t\tgo minerConn(p)\n\t\t\t}\n\t\t}\n\n\t\t//Periodically check if we are well-connected\n\t\tif len(peers.minerConns) >= util.MIN_MINERS {\n\t\t\tcontinue\n\t\t}\n\n\t\t//The only goto in the code (I promise), but best solution here IMHO.\n\tRETRY:\n\t\tselect {\n\t\t//iplistChan gets filled with every incoming neighborRes, they're consumed here.\n\t\tcase ipaddr := <-iplistChan:\n\t\t\tp, err := initiateNewClientConnection(ipaddr)\n\t\t\tif err != nil {\n\t\t\t\tlogger.Printf(\"%v\\n\", err)\n\t\t\t}\n\n\t\t\tif p == nil || err != nil {\n\t\t\t\tif numberOfRetry < 3 {\n\t\t\t\t\tnumberOfRetry++\n\t\t\t\t\tgoto RETRY\n\t\t\t\t} else {\n\t\t\t\t\tbreak\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tgo minerConn(p)\n\t\t\tbreak\n\t\tdefault:\n\t\t\t//In case we don't have any ip addresses in the channel left, make a request to the network.\n\t\t\tneighborReq()\n\t\t\tbreak\n\t\t}\n\t}\n}", "title": "" }, { "docid": "c2f168e776ea5465c3ad843dbf09827c", "score": "0.5426969", "text": "func cephNanoS3Health(containerName string, rgwPort string) {\n\t// setting timeout\n\ttimeout := 20\n\tpoll := 0\n\tips, _ := getInterfaceIPv4s()\n\t// Taking the first IP is probably not ideal\n\t// IMHO, using the interface with most of the traffic is better\n\turl := \"http://\" + ips[0].String() + \":\" + rgwPort\n\n\tfor poll < timeout {\n\t\tif curlTestURL(url) {\n\t\t\treturn\n\t\t}\n\t\ttime.Sleep(time.Second * 1)\n\t\tpoll++\n\t}\n\tcontainerNameToShow := containerName[len(containerNamePrefix):]\n\tlog.Println(\"Timeout while trying to reach: \" + url)\n\tlog.Println(\"S3 gateway for cluster \" + containerNameToShow + \" is not responding. Showing S3 logs (if any):\")\n\tshowS3Logs(containerName)\n\tlog.Fatal(\"Please open an issue at: https://github.com/ceph/cn.\")\n}", "title": "" }, { "docid": "f80667fee371375a82291772da4fea42", "score": "0.54175067", "text": "func Health(w http.ResponseWriter, r *http.Request, _ httprouter.Params) {\n\tw.WriteHeader(http.StatusOK)\n\tw.Write([]byte(\"Up and running!\\n\"))\n}", "title": "" }, { "docid": "c0a2b672c8a9cda4f33ee3c53c10be2c", "score": "0.54114705", "text": "func WaitUntilExistsStatus(ctx context.Context, tconn *chrome.TestConn, params FindParams, exists bool, timeout time.Duration) error {\n\tif exists {\n\t\treturn WaitUntilExists(ctx, tconn, params, timeout)\n\t}\n\n\treturn WaitUntilGone(ctx, tconn, params, timeout)\n}", "title": "" }, { "docid": "128c00a7743d5f4b08d7f917a4d826ad", "score": "0.54055107", "text": "func (c *Project) Wait(seconds int, services ...string) error {\n\thealthy := false\n\ttimeout := time.Now().Add(time.Duration(seconds) * time.Second)\n\tfor !healthy && time.Now().Before(timeout) {\n\t\thealthy = true\n\n\t\tservicesStatus, err := c.getServices(services...)\n\t\tif err != nil {\n\t\t\treturn err\n\t\t}\n\n\t\tif len(servicesStatus) == 0 {\n\t\t\thealthy = false\n\t\t}\n\n\t\tfor _, s := range servicesStatus {\n\t\t\tif !s.Healthy {\n\t\t\t\thealthy = false\n\t\t\t\tbreak\n\t\t\t}\n\t\t}\n\n\t\ttime.Sleep(1 * time.Second)\n\t}\n\n\tif !healthy {\n\t\treturn errors.New(\"Timeout waiting for services to be healthy\")\n\t}\n\treturn nil\n}", "title": "" }, { "docid": "8255c35bccba5edd6ce51b5671d1038e", "score": "0.53985703", "text": "func (s *Checks) Health(w http.ResponseWriter, r *http.Request) error {\n\n\tvar response struct {\n\t\tStatus string `json:\"status\"`\n\t}\n\n\t// Check if the database is ready.\n\tif err := database.StatusCheck(r.Context(), s.db); err != nil {\n\n\t\t// If the database is not ready we will tell the client and use a 500\n\t\t// status. Do not respond by just returning an error because further up in\n\t\t// the call stack will interpret that as an unhandled error.\n\t\tresponse.Status = \"not ready\"\n\t\treturn web.Respond(w, response, http.StatusInternalServerError)\n\t}\n\n\tresponse.Status = \"ok\"\n\treturn web.Respond(w, response, http.StatusOK)\n}", "title": "" }, { "docid": "4f6a7fdd1f73b66506530d15a55da058", "score": "0.5397748", "text": "func (self *HttpRunner) waitPingResponse() error {\n\tvar (\n\t\ttickCh = time.NewTicker(time.Second / 2).C\n\t\texpireCh = time.NewTicker(time.Second * 5).C\n\t\tclient = http.Client{Timeout: time.Second}\n\t)\n\n\treq, err := http.NewRequest(http.MethodGet, fmt.Sprintf(\"http://127.0.0.1:%d/%s\", self.port, \"ping\"), nil)\n\tif err != nil {\n\t\treturn err\n\t}\n\n\tfor {\n\t\tselect {\n\t\tcase <-expireCh:\n\t\t\treturn errors.New(\"HTTP ticker does not response to ping request\")\n\t\tcase <-tickCh:\n\t\t\trsp, dErr := client.Do(req)\n\t\t\tif dErr != nil {\n\t\t\t\tlog.Printf(\"HTTP server is returning an error: %s, retrying\", dErr.Error())\n\t\t\t\tbreak\n\t\t\t}\n\t\t\tif rsp.StatusCode == http.StatusOK {\n\t\t\t\tlog.Print(\"HTTP ticker server is ready\")\n\t\t\t\treturn nil\n\t\t\t}\n\t\t}\n\t}\n}", "title": "" }, { "docid": "f204e8d2aa895d49d223c98c522a23da", "score": "0.53859025", "text": "func intializeHealthChecker() {\n\t//validParams := map[string]bool{}\n\n\tvar healthChecker instanceHealthChecker\n\tvalidParams := make(map[string]string)\n\tconf := strings.Split(*props.healthCheckConf, \";\")\n\tfor _, prop := range conf {\n\t\tkv := strings.Split(prop, \"=\")\n\t\tif len(kv) != 2 {\n\t\t\tcontinue //invalid prop\n\t\t}\n\t\tvalidParams[kv[0]] = kv[1]\n\t}\n\t//assuming all the things are working\n\t//suppressing input validation\n\tport, err := strconv.ParseUint(validParams[\"port\"], 10, 32)\n\tif err != nil {\n\t\tport = 80\n\n\t}\n\tthres, err := strconv.ParseFloat(validParams[\"threshold\"], 32)\n\tif err != nil {\n\t\tthres = 0.5\n\t}\n\n\ttimeout, err := time.ParseDuration(validParams[\"timeout\"])\n\tif err != nil {\n\t\ttimeout = time.Second * 5\n\t}\n\tinterval, err := time.ParseDuration(validParams[\"interval\"])\n\tif err != nil {\n\t\tinterval = time.Second * 30\n\t}\n\tswitch validParams[\"method\"] {\n\n\tcase \"tcp\":\n\tcase \"udp\":\n\t\tx := tcporudphealthcheck{}\n\t\tx.port = uint(port)\n\t\tx.timeout = timeout\n\t\tx.interval = interval\n\t\tx.threshold = float32(thres)\n\t\tif validParams[\"method\"] == \"udp\" {\n\t\t\tx.protocol = 1\n\t\t} else {\n\t\t\tx.protocol = 0\n\t\t}\n\t\thealthChecker = x\n\tcase \"http\":\n\t\tx := httphealthchecker{}\n\t\tx.port = uint(port)\n\t\tx.timeout = timeout\n\t\tx.interval = interval\n\t\tx.threshold = float32(thres)\n\t\tif httpmethod, ok := validParams[\"httpmethod\"]; ok {\n\t\t\tx.method = httpmethod\n\t\t} else {\n\t\t\tx.method = \"get\" //default request method\n\t\t}\n\t\tniceStatus, err := strconv.ParseInt(validParams[\"niceStatus\"], 10, 16)\n\t\tif err != nil {\n\t\t\tniceStatus = 200 //default http response\n\t\t}\n\t\tpath, ok := validParams[\"path\"]\n\t\tif ok {\n\t\t\tx.path = path\n\t\t} else {\n\t\t\tx.path = \"/index.html\" //default path\n\t\t}\n\t\tx.niceStatus = int(niceStatus)\n\t\thealthChecker = x\n\tdefault:\n\t}\n\n\tglobalHealthCheckerCh = healthChecker //setting global health checker\n\n}", "title": "" }, { "docid": "63750b56ced5ab706577817b6bff8ca7", "score": "0.5382769", "text": "func (t *LivenessTarget) Wait() {\n\ttime.Sleep(t.LivenessInterval)\n}", "title": "" }, { "docid": "7053b9d1710766c882e38d5999126346", "score": "0.5380961", "text": "func HealthCheck() {\n\tt := time.NewTicker(time.Minute * 1)\n\tfor range t.C {\n\t\tlogger.LogInfo(\"Starting health check...\")\n\t\tServerPool.HealthCheck()\n\t\tlogger.LogInfo(\"Health check completed\")\n\t}\n}", "title": "" }, { "docid": "1f1bdb55e9aace00cf4373b8b80c3d5f", "score": "0.53777367", "text": "func WaitForInstallationAvailability(dns string, log logrus.FieldLogger) error {\n\terr := WaitForFunc(NewWaitConfig(20*time.Minute, 20*time.Second, 2, log), func() (bool, error) {\n\t\terr := PingInstallation(dns)\n\t\tif err != nil {\n\t\t\tlog.WithError(err).Errorf(\"Error while making ping request to Installation %s\", dns)\n\t\t\treturn false, nil\n\t\t}\n\t\treturn true, nil\n\t})\n\n\treturn err\n}", "title": "" }, { "docid": "f2e6c9dabdb51feb178a2e671da26211", "score": "0.5372053", "text": "func ConsoleHealth(client *http.Client, endpoint string) ServiceStatus {\n\tstatus := ServiceStatus{\n\t\tInstance: endpoint,\n\t\tReady: false,\n\t}\n\n\t// Tectonic Console health endpoint must return {\"status\": \"ok\"}\n\tif client == nil {\n\t\tclient = defaultStatusClient\n\t}\n\tresp, err := client.Get(fmt.Sprintf(\"https://%s/health\", endpoint))\n\tif err != nil {\n\t\tstatus.Message = err.Error()\n\t\treturn status\n\t}\n\tdefer resp.Body.Close()\n\n\ttype health struct {\n\t\tStatus string `json:\"status\"`\n\t}\n\th := new(health)\n\terr = json.NewDecoder(resp.Body).Decode(h)\n\tif err != nil {\n\t\tstatus.Message = err.Error()\n\t\treturn status\n\t}\n\n\tif h.Status == \"ok\" {\n\t\tstatus.Ready = true\n\t}\n\treturn status\n}", "title": "" }, { "docid": "177ed3fa2b18ea9af8a5154b405c9b7c", "score": "0.53712004", "text": "func WaitUntilServing(ctx context.Context, machine Machine, server net.IP, port int) error {\n\tvar logger testutil.DefaultLogger = \"util\"\n\tnetcat := machine.GetNativeContainer(ctx, logger)\n\tdefer netcat.CleanUp(ctx)\n\n\tcmd := fmt.Sprintf(\"while ! wget -q --spider http://%s:%d; do true; done\", server, port)\n\t_, err := netcat.Run(ctx, dockerutil.RunOpts{\n\t\tImage: \"benchmarks/util\",\n\t}, \"sh\", \"-c\", cmd)\n\treturn err\n}", "title": "" }, { "docid": "8b15ebc8b8de68180a3c3e11fee287cc", "score": "0.53653866", "text": "func WaitForHibernation(client *model.Client, installationID string, log logrus.FieldLogger) error {\n\terr := WaitForFunc(NewWaitConfig(5*time.Minute, 10*time.Second, 2, log), func() (bool, error) {\n\t\tinstallation, err := client.GetInstallation(installationID, &model.GetInstallationRequest{})\n\t\tif err != nil {\n\t\t\treturn false, errors.Wrap(err, \"while waiting for hibernation\")\n\t\t}\n\n\t\tif installation.State == model.InstallationStateHibernating {\n\t\t\treturn true, nil\n\t\t}\n\t\tlog.Infof(\"Installation %s not hibernated: %s\", installationID, installation.State)\n\t\treturn false, nil\n\t})\n\treturn err\n}", "title": "" }, { "docid": "ec9bb8dbbe0b90e68bbea3d569f31a41", "score": "0.5349362", "text": "func (c *CLI) AwaitReady() error {\n\tif !c.enabled {\n\t\treturn nil\n\t}\n\n\tfor {\n\t\t// Get the onos-topo deployment\n\t\tdep, err := c.kubeClient.AppsV1().Deployments(c.namespace).Get(cliService, metav1.GetOptions{})\n\t\tif err != nil {\n\t\t\treturn err\n\t\t}\n\n\t\t// Return once the all replicas in the deployment are ready\n\t\tif dep.Status.ReadyReplicas > 0 {\n\t\t\treturn nil\n\t\t}\n\t\ttime.Sleep(100 * time.Millisecond)\n\t}\n}", "title": "" }, { "docid": "7ab74b4e123f28b441315e23cfda6484", "score": "0.53479385", "text": "func (s *HealthcheckTestSuite) TestCheckHTTP() {\n\t// Prepare struct\n\tpath := \"/\"\n\ts.taskInfo.HealthCheck.HTTP = &mesos.HealthCheck_HTTPCheckInfo{\n\t\tPath: &path,\n\t}\n\n\t// Patch namespace enter/exit function to simulate it\n\tnsenter := false\n\tnsexit := false\n\tmonkey.Patch(namespace.EnterNetworkNamespace, func(_ int) error {\n\t\tnsenter = true\n\n\t\treturn nil\n\t})\n\tmonkey.Patch(namespace.ExitNetworkNamespace, func() error {\n\t\tnsexit = true\n\n\t\treturn nil\n\t})\n\n\t// Bridge mode (namespace management)\n\ts.taskInfo.Container = &mesos.ContainerInfo{\n\t\tDocker: &mesos.ContainerInfo_DockerInfo{\n\t\t\tNetwork: mesos.ContainerInfo_DockerInfo_BRIDGE.Enum(),\n\t\t},\n\t}\n\tgo s.checker.checkHTTP(s.result)\n\t<-s.result\n\tassert.Equal(s.T(), true, nsenter) // Should enter in the namespace\n\tassert.Equal(s.T(), true, nsexit) // Should exit the namespace\n\n\t// Host mode (no namespace management)\n\tnsenter = false\n\tnsexit = false\n\ts.taskInfo.Container.Docker.Network = mesos.ContainerInfo_DockerInfo_HOST.Enum()\n\tgo s.checker.checkHTTP(s.result)\n\t<-s.result\n\tassert.Equal(s.T(), false, nsenter) // Should not enter in the namespace\n\tassert.Equal(s.T(), false, nsexit) // Should not exit the namespace\n\n\t// Server is not accessible\n\tgo s.checker.checkHTTP(s.result)\n\tassert.Equal(s.T(), false, <-s.result) // Should be unhealthy\n\n\t// Server is accessible but returns a wrong HTTP code\n\tserver := httptest.NewServer(http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) {\n\t\tw.WriteHeader(http.StatusNotFound) // 404\n\t}))\n\tserverURL, _ := url.Parse(server.URL)\n\tportString := strings.Split(serverURL.Host, \":\")\n\tport, _ := strconv.Atoi(portString[1])\n\ts.taskInfo.HealthCheck.HTTP.Port = uint32(port)\n\tgo s.checker.checkHTTP(s.result)\n\tassert.Equal(s.T(), false, <-s.result) // Should be unhealthy\n\tserver.Close()\n\n\t// Nominal case\n\tserver = httptest.NewServer(http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) {\n\t\tw.WriteHeader(http.StatusOK)\n\t}))\n\tserverURL, _ = url.Parse(server.URL)\n\tportString = strings.Split(serverURL.Host, \":\")\n\tport, _ = strconv.Atoi(portString[1])\n\ts.taskInfo.HealthCheck.HTTP.Port = uint32(port)\n\tgo s.checker.checkHTTP(s.result)\n\tassert.Equal(s.T(), true, <-s.result) // Should be unhealthy\n\tserver.Close()\n}", "title": "" }, { "docid": "ac8e0be7c2aa522508a5fe94e7d9a2f7", "score": "0.534189", "text": "func (t *Test) WaitServiceStatus(expectedStatus string) {\n\twaiting := true\n\ttry := 0\n\tfor waiting {\n\t\ttime.Sleep(1 * time.Minute) // TODO\n\t\ttry++\n\t\ts := cfc.Cf(\"service\", t.ServiceIns)\n\t\tEventuallyWithOffset(1, s).Should(Exit(0))\n\t\tstatus := string(regexp.MustCompile(`status:\\s+(.+)\\s+`).FindSubmatch(s.Out.Contents())[1])\n\t\tGinkgoWriter.Write([]byte(fmt.Sprintf(\"Status is %s (try #%d)\", status, try)))\n\t\tif status == expectedStatus {\n\t\t\twaiting = false\n\t\t\tGinkgoWriter.Write([]byte(\"Finish waiting. Succeed.\"))\n\t\t}\n\t\tif try > 30 { // TODO req?\n\t\t\twaiting = false\n\t\t\tGinkgoWriter.Write([]byte(\"Finish waiting. Timeout\"))\n\t\t\tExpectWithOffset(1, true).Should(Equal(false)) // TODO call fail\n\t\t}\n\t}\n}", "title": "" }, { "docid": "34e8274a24b79d922e35e5782597842b", "score": "0.533767", "text": "func (k TestKubernetes) WaitForExternalService(ispn *ispnv1.Infinispan, timeout time.Duration, client HTTPClient) HTTPClient {\n\terr := wait.Poll(DefaultPollPeriod, timeout, func() (done bool, err error) {\n\t\tvar hostAndPort string\n\t\tswitch ispn.GetExposeType() {\n\t\tcase ispnv1.ExposeTypeNodePort, ispnv1.ExposeTypeLoadBalancer:\n\t\t\trouteList := &corev1.ServiceList{}\n\t\t\terr = k.Kubernetes.ResourcesList(ispn.Namespace, ispn.ExternalServiceSelectorLabels(), routeList, context.TODO())\n\t\t\tExpectNoError(err)\n\n\t\t\tif len(routeList.Items) > 0 {\n\t\t\t\tswitch ispn.GetExposeType() {\n\t\t\t\tcase ispnv1.ExposeTypeNodePort:\n\t\t\t\t\thost, err := k.Kubernetes.GetNodeHost(log, context.TODO())\n\t\t\t\t\tExpectNoError(err)\n\t\t\t\t\thostAndPort = fmt.Sprintf(\"%s:%d\", host, getNodePort(&routeList.Items[0]))\n\t\t\t\tcase ispnv1.ExposeTypeLoadBalancer:\n\t\t\t\t\thostAndPort = k.Kubernetes.GetExternalAddress(&routeList.Items[0])\n\t\t\t\t}\n\t\t\t}\n\t\tcase ispnv1.ExposeTypeRoute:\n\t\t\trouteList := &routev1.RouteList{}\n\t\t\terr = k.Kubernetes.ResourcesList(ispn.Namespace, ispn.ExternalServiceSelectorLabels(), routeList, context.TODO())\n\t\t\tExpectNoError(err)\n\t\t\tif len(routeList.Items) > 0 {\n\t\t\t\thostAndPort = routeList.Items[0].Spec.Host\n\t\t\t}\n\t\t}\n\t\tif hostAndPort == \"\" {\n\t\t\treturn false, nil\n\t\t}\n\t\tclient.SetHostAndPort(hostAndPort)\n\t\treturn CheckExternalAddress(client), nil\n\t})\n\tExpectNoError(err)\n\treturn client\n}", "title": "" }, { "docid": "89282c0bf5ed9e883ed54fc271da1fd2", "score": "0.53332824", "text": "func (c *Check) Health(ctxt context.Context, w http.ResponseWriter, r *http.Request) error {\n\n\tvar health struct {\n\t\tStatus string `json:\"status\"`\n\t}\n\n\tif err := database.StatusCheck(ctxt, c.DB); err != nil {\n\t\thealth.Status = \"DB is not ready\"\n\t\treturn web.Respond(ctxt, w, health, http.StatusInternalServerError)\n\t}\n\thealth.Status = \"OK\"\n\treturn web.Respond(ctxt, w, health, http.StatusOK)\n}", "title": "" }, { "docid": "1fff5e546adf66b1d59af261a5e24887", "score": "0.53324556", "text": "func (r *Router) Check(ctx context.Context, in *pbhealth.HealthCheckRequest) (*pbhealth.HealthCheckResponse, error) {\n\tstatus := pbhealth.HealthCheckResponse_NOT_SERVING\n\n\tif r.ready.Load() && !derr.IsShuttingDown() {\n\t\tstatus = pbhealth.HealthCheckResponse_SERVING\n\t}\n\n\treturn &pbhealth.HealthCheckResponse{\n\t\tStatus: status,\n\t}, nil\n\n}", "title": "" }, { "docid": "84502e57fe91f4de220be4038951e61b", "score": "0.53285676", "text": "func WaitForPort(host, port string, timeOut time.Duration) error {\n\tvar depChan = make(chan struct{})\n\tvar wg sync.WaitGroup\n\twg.Add(1)\n\tgo func() {\n\t\tgo func(address string) {\n\t\t\tdefer wg.Done()\n\t\t\tfor {\n\t\t\t\tt := &http.Transport{TLSClientConfig: &tls.Config{InsecureSkipVerify: true}}\n\t\t\t\tclient := &http.Client{Transport: t, Timeout: 10 * time.Second}\n\t\t\t\tr, err := client.Get(fmt.Sprintf(\"https://%s/readyz\", address))\n\t\t\t\tif err == nil && r.StatusCode == 200 {\n\t\t\t\t\treturn\n\t\t\t\t}\n\t\t\t\ttime.Sleep(1 * time.Second)\n\t\t\t}\n\t\t}(net.JoinHostPort(host, port))\n\n\t\twg.Wait()\n\t\tclose(depChan)\n\t}()\n\n\tselect {\n\tcase <-depChan: // ready\n\t\treturn nil\n\tcase <-time.After(timeOut):\n\t\treturn fmt.Errorf(\"%s not ready in %s\", net.JoinHostPort(host, port), timeOut)\n\t}\n}", "title": "" }, { "docid": "cbb76b97645249e5f621f21551eda4a6", "score": "0.53101516", "text": "func (i ClusterInstance) waitUntilInternetConnection(log *logging.Logger) error {\n\tfor {\n\t\t// Attempt an SSH connection\n\t\tif s, err := i.Connect(); err == nil {\n\t\t\tif _, err := s.Run(log, \"ping -c 3 -w 60 8.8.8.8\", \"\", true); err == nil {\n\t\t\t\t// Success\n\t\t\t\ts.Close()\n\t\t\t\treturn nil\n\t\t\t}\n\t\t\ts.Close()\n\t\t}\n\t\t// Wait a while\n\t\ttime.Sleep(time.Second * 2)\n\t}\n}", "title": "" }, { "docid": "e3f1d681aa508bd1ab133a7b839c277f", "score": "0.5304928", "text": "func (m *ManagerService) WaitStart(name string, duration time.Duration) bool {\n\tmax := time.Now().Add(duration)\n\tt := time.Tick(time.Second * 3)\n\tfor {\n\t\tif time.Now().After(max) {\n\t\t\treturn false\n\t\t}\n\t\tstatus, err := m.healthyManager.GetCurrentServiceHealthy(name)\n\t\tif err != nil {\n\t\t\tlogrus.Errorf(\"Can not get %s service current status: %v\", name, err)\n\t\t\t<-t\n\t\t\tcontinue\n\t\t}\n\t\tlogrus.Debugf(\"Check service %s current status: %s\", name, status.Status)\n\t\tif status.Status == service.Stat_healthy {\n\t\t\treturn true\n\t\t}\n\t\t<-t\n\t}\n}", "title": "" }, { "docid": "b26e42d8eb373622bfbe687470fcda6d", "score": "0.53016704", "text": "func (c *TestContext) WaitForStatus(nodes []Gravity, expected statusValidator) error {\n\tb := backoff.NewExponentialBackOff()\n\tb.MaxElapsedTime = c.timeouts.ClusterStatus\n\n\texpectStatus := func() (err error) {\n\t\tstatuses, err := c.Status(nodes)\n\t\tif err != nil {\n\t\t\treturn trace.Wrap(err)\n\t\t}\n\t\tfor _, status := range statuses {\n\t\t\terr = expected(status)\n\t\t\tif err != nil {\n\t\t\t\tc.Logger().WithError(err).WithField(\"status\", status).Warn(\"Unexpected Status.\")\n\t\t\t\treturn trace.Wrap(err)\n\t\t\t}\n\t\t}\n\t\treturn nil\n\t}\n\n\terr := wait.RetryWithInterval(c.ctx, b, expectStatus, c.Logger())\n\n\treturn trace.Wrap(err)\n\n}", "title": "" }, { "docid": "b86b18656e688dae0c9a684df042d03e", "score": "0.5300172", "text": "func healthCheck(c *gin.Context) {\n\tc.JSON(200, gin.H{\n\t\t\"status\": \"UP\",\n\t})\n}", "title": "" }, { "docid": "cf8361b9d8e6c34ded8747b5befc5af3", "score": "0.52990454", "text": "func (c *controller) healthCheck(r *web.Request) (*web.Response, error) {\n\tctx := r.Context()\n\tlogger := log.C(ctx)\n\tlogger.Debugf(\"Performing health check with %s...\", c.indicator.Name())\n\thealthResult := c.indicator.Health()\n\tvar status int\n\tif healthResult.Status == health.StatusUp {\n\t\tstatus = http.StatusOK\n\t} else {\n\t\tstatus = http.StatusServiceUnavailable\n\t}\n\treturn util.NewJSONResponse(status, healthResult)\n}", "title": "" }, { "docid": "a2f065200f86413ce1b732199e7e9d3b", "score": "0.5297524", "text": "func healthCheck(vaultPool types.VaultPool) {\n\n\tversionLogger.Info(\"Starting health check...\")\n\tvaultPool.HealthCheck()\n\tversionLogger.Info(\"Health check completed\")\n}", "title": "" }, { "docid": "a5a80bfe43c3c70e82a3d8190fea22d6", "score": "0.5291813", "text": "func pingRegistry() {\n response, err := http.Get(\"http://localhost:5000/v2\")\n\n if err != nil {\n log.Println(\"Error: \",err)\n os.Exit(1)\n }\n log.Println(\"Ping Registry: Status %d\",response.StatusCode)\n}", "title": "" }, { "docid": "de939b602ccf3510204b8dfe0aaa9c94", "score": "0.52848524", "text": "func (ei *EngineInstance) waitReady(ctx context.Context) error {\n\tselect {\n\tcase <-ctx.Done(): // propagated harness exit\n\t\treturn ctx.Err()\n\tcase ready := <-ei.awaitDrpcReady():\n\t\tif err := ei.finishStartup(ctx, ready); err != nil {\n\t\t\treturn err\n\t\t}\n\t\treturn nil\n\t}\n}", "title": "" }, { "docid": "87cd480da4d78c97603853cb60e91008", "score": "0.52805084", "text": "func HealthCheck(c *gin.Context) {\n\tc.JSON(http.StatusOK, healthCheckResponse{Status: \"UP\", Hostname: getHostname()})\n}", "title": "" }, { "docid": "df977bc71e535113facf3fbac7f110e0", "score": "0.5277635", "text": "func (n *Node) initHealthAPI() error {\n\tif !n.Config.HealthAPIEnabled {\n\t\tn.Log.Info(\"skipping health API initialization because it has been disabled\")\n\t\treturn nil\n\t}\n\tn.Log.Info(\"initializing Health API\")\n\tservice := health.NewService(n.Log)\n\tif err := service.RegisterHeartbeat(\"network.validators.heartbeat\", n.Net, 5*time.Minute); err != nil {\n\t\treturn fmt.Errorf(\"couldn't register heartbeat health check: %w\", err)\n\t}\n\tisBootstrappedFunc := func() (interface{}, error) {\n\t\tif pChainID, err := n.chainManager.Lookup(\"P\"); err != nil {\n\t\t\treturn nil, errors.New(\"P-Chain not created\")\n\t\t} else if !n.chainManager.IsBootstrapped(pChainID) {\n\t\t\treturn nil, errors.New(\"P-Chain not bootstrapped\")\n\t\t}\n\t\tif xChainID, err := n.chainManager.Lookup(\"X\"); err != nil {\n\t\t\treturn nil, errors.New(\"X-Chain not created\")\n\t\t} else if !n.chainManager.IsBootstrapped(xChainID) {\n\t\t\treturn nil, errors.New(\"X-Chain not bootstrapped\")\n\t\t}\n\t\tif cChainID, err := n.chainManager.Lookup(\"C\"); err != nil {\n\t\t\treturn nil, errors.New(\"C-Chain not created\")\n\t\t} else if !n.chainManager.IsBootstrapped(cChainID) {\n\t\t\treturn nil, errors.New(\"C-Chain not bootstrapped\")\n\t\t}\n\t\treturn nil, nil\n\t}\n\t// Passes if the P, X and C chains are finished bootstrapping\n\tif err := service.RegisterMonotonicCheckFunc(\"chains.default.bootstrapped\", isBootstrappedFunc); err != nil {\n\t\treturn err\n\t}\n\thandler, err := service.Handler()\n\tif err != nil {\n\t\treturn err\n\t}\n\treturn n.APIServer.AddRoute(handler, &sync.RWMutex{}, \"health\", \"\", n.HTTPLog)\n}", "title": "" }, { "docid": "b81e74a7d58f1d6e1c0fb354b834e44e", "score": "0.52762175", "text": "func (h *Health) health() (err error) {\n\th.Type = healthType\n\th.TimeStampUTC = time.Now().UTC()\n\th.LastStartTimeUTC = TimeStampUTC\n\n\th.OutboundConnectionStatus = GetOutboundConnectionStatus(h.ConnMethods, h.ServiceName)\n\th.Status = GetHealthStatus(h.OutboundConnectionStatus)\n\n\th.NetworkInterfaces, err = GetNetworkInterfaces(h.ListenURL)\n\tif err != nil {\n\t\tlogger.Get().Error(\"\", \"health:NetworkInterfaces\", \"Health.init: \", err)\n\t\treturn\n\t}\n\treturn\n}", "title": "" }, { "docid": "5d6dc8844feb9ca617e64f371217e37c", "score": "0.52739125", "text": "func (s *ServerT) Health(health string) error {\n\tswitch health {\n\tcase \"up\", \"stopping\", \"down\":\n\tdefault:\n\t\treturn errors.New(\"health has wrong value, must be \\\"up\\\", \\\"stopping\\\" or \\\"down\\\"\")\n\t}\n\n\tout, err := s.q(\"health \" + health)\n\tif err != nil {\n\t\treturn err\n\t}\n\tif out == \"\" {\n\t\treturn nil\n\t}\n\treturn errors.New(out)\n}", "title": "" }, { "docid": "eac157680a43a89fe748aa3a6ca2fb48", "score": "0.5270685", "text": "func (k *KeKahu) Health() {\n\ttrace(\"executing system health check\")\n\n\t// Get the health check form the system\n\thealth, err := HealthCheck(true)\n\tif err != nil {\n\t\t// TODO: should we really be logging these errors if we're going to fail?\n\t\tk.echan <- err\n\t\treturn\n\t}\n\n\t// Create encoder and buffer\n\tbody, err := encodeRequest(health)\n\tif err != nil {\n\t\tk.echan <- err\n\t\treturn\n\t}\n\n\t// Create the request and post\n\treq, err := k.newRequest(http.MethodPost, HealthEndpoint, body)\n\tif err != nil {\n\t\tk.echan <- err\n\t\treturn\n\t}\n\n\t// Perform the request\n\tres, err := k.doRequest(req)\n\tif err != nil {\n\t\tk.echan <- err\n\t\treturn\n\t}\n\n\t// Log the response if in debug mode\n\tdebug(\"health status report: %d %s\", res.StatusCode, res.Status)\n\n}", "title": "" }, { "docid": "63bf287d5de34f0d1afbe6aebeea50f7", "score": "0.5270365", "text": "func (instance *TerrariumInstance) IsHealthy() (bool, error) {\n\thttpClient := http.Client{Timeout: Config().HTTPClientTimeout}\n\turl, err := instance.URL()\n\tif err != nil {\n\t\treturn false, err\n\t}\n\turl.Path = HealthPath\n\theader := map[string][]string{\"User-Agent\": {UserAgent}}\n\treq := &http.Request{\n\t\tMethod: \"GET\",\n\t\tURL: url,\n\t\tHeader: header,\n\t\tClose: false,\n\t}\n\tresp, err := httpClient.Do(req)\n\tif err != nil {\n\t\treturn false, err\n\t}\n\tif resp.StatusCode != 200 || resp.ContentLength == 0 {\n\t\tdlog.Debug(\"Unexpected response from health check endpoint\")\n\t\treturn false, nil\n\t}\n\treturn true, nil\n}", "title": "" }, { "docid": "ac7cf0901331098ca6404474417a8120", "score": "0.52660805", "text": "func (s *service) CheckHealth() *Health {\n\treturn &Health{\n\t\tVersion: version.Version,\n\t\tStorage: s.storage.IsAlive(),\n\t\tSecurity: s.security.IsAlive(),\n\t}\n}", "title": "" }, { "docid": "0a69bf265dbc7c44ea0a502301204b7a", "score": "0.526377", "text": "func (resp *ActionVpsDeployPublicKeyResponse) WaitForOperation(timeout float64) (*ActionActionStatePollResponse, error) {\n\treq := resp.Action.Client.ActionState.Poll.Prepare()\n\treq.SetPathParamInt(\"action_state_id\", resp.Response.Meta.ActionStateId)\n\n\tinput := req.NewInput()\n\tinput.SetTimeout(timeout)\n\n\treturn req.Call()\n}", "title": "" }, { "docid": "6e0e764165ce32ee80c29872ea9979a6", "score": "0.52628636", "text": "func HealthCheck(c *gin.Context) {\n\tc.JSON(http.StatusOK, healthCheckResponse{Status: \"UP\", Hostname: utils.GetHostname()})\n}", "title": "" }, { "docid": "01ecb4c23fa7f1ccda79aecffa322243", "score": "0.5252782", "text": "func GetHealth(r *http.Request) (interface{}, error) {\n\treturn map[string]bool{\"ok\": true}, nil\n}", "title": "" }, { "docid": "79ec0f95d223a7a78532a6e640a941d0", "score": "0.5247689", "text": "func healthCheck() error {\n\tresp, err := http.Get(\"http://\" + *host + *healthCheckPath)\n\tif err != nil {\n\t\tlog.Printf(\"Health Check request failed: %s\", err.Error())\n\t\treturn err\n\t}\n\tdefer resp.Body.Close()\n\tif resp.StatusCode != 200 {\n\t\tlog.Printf(\"Health Check request had non-200 status code: %d\", resp.StatusCode)\n\t\treturn fmt.Errorf(\"Bad Health Check Response Code: %s\", resp.Status)\n\t}\n\treturn nil\n}", "title": "" }, { "docid": "ec35efe6a6abe6107ded84ac39b766a0", "score": "0.5241715", "text": "func checkHealthService() {\n\n\tfor {\n\t\t//Periodically check if we are well-connected\n\t\tif len(peers.peerConns) >= MIN_MINERS {\n\t\t\ttime.Sleep(2 * HEALTH_CHECK_INTERVAL * time.Minute)\n\t\t\tcontinue\n\t\t} else {\n\t\t\t//This delay is needed to prevent sending neighbor requests like a maniac\n\t\t\ttime.Sleep(HEALTH_CHECK_INTERVAL * time.Second)\n\t\t}\n\n\t\t//The only goto in the code (I promise), but best solution here IMHO\n\tRETRY:\n\t\tselect {\n\t\t//iplistChan gets filled with every incoming neighborRes, they're consumed here\n\t\tcase ipaddr := <-iplistChan:\n\t\t\tp, err := initiateNewMinerConnection(ipaddr)\n\t\t\tif err != nil {\n\t\t\t\tlogger.Printf(\"%v\\n\", err)\n\t\t\t}\n\t\t\tif p == nil || err != nil {\n\t\t\t\tgoto RETRY\n\t\t\t}\n\t\t\tgo minerConn(p)\n\t\t\tbreak\n\t\tdefault:\n\t\t\t//In case we don't have any ip addresses in the channel left, make a request to the network\n\t\t\tneighborReq()\n\t\t\tbreak\n\t\t}\n\t}\n}", "title": "" }, { "docid": "c2bc346fbd70d173e094cd3bcc3878ce", "score": "0.52405655", "text": "func (r *Client) WaitFor(resource *types.Resource, output interface{}, transitioning func() string) error {\n\treturn backoff(2*time.Minute, fmt.Sprintf(\"Time out waiting for %s:%s to become active\", resource.Type, resource.ID), func() (bool, error) {\n\t\terr := r.client.Reload(resource, output)\n\t\tif err != nil {\n\t\t\treturn false, err\n\t\t}\n\t\tif transitioning() != \"yes\" {\n\t\t\treturn true, nil\n\t\t}\n\t\treturn false, nil\n\t})\n}", "title": "" }, { "docid": "f6adf15b422c3c94fce4e10b86a95f6d", "score": "0.5239461", "text": "func doHealth(sdk *sdk.SDK, ctx context.Context) {\n\ttick := time.Tick(2 * time.Second)\n\tfor {\n\t\tlog.Printf(\"Health Ping\")\n\t\terr := sdk.Health()\n\t\tif err != nil {\n\t\t\tlog.Fatalf(\"Could not send health ping, %v\", err)\n\t\t}\n\t\tselect {\n\t\tcase <-ctx.Done():\n\t\t\tlog.Print(\"Stopped health pings\")\n\t\t\treturn\n\t\tcase <-tick:\n\t\t}\n\t}\n}", "title": "" }, { "docid": "4b7895dea33c2bec0c8a85699740fccc", "score": "0.52347213", "text": "func (s *Service) Healthcheck() error {\n\treturn nil\n}", "title": "" } ]
0ee53fb97dc850a1c02e200252003813
Exists check quote exists
[ { "docid": "510f3327fddeac0b59ed59d45af86106", "score": "0.56128883", "text": "func (s Cos) Exists(exchange exchanges.Exchange, date time.Time) (bool, error) {\n\t_, err := s.client.Object.Head(context.Background(), s.storePath(exchange, date), nil)\n\treturn err == nil, nil\n}", "title": "" } ]
[ { "docid": "88b5b6a57354ba5caa8956976f1d9a9f", "score": "0.7934351", "text": "func (q *Quote) Exists(db *sql.DB) (res bool, err error) {\n\tif err := q.FindByText(db); err != nil {\n\t\treturn false, err\n\t}\n\tif q.ID == 0 {\n\t\treturn false, nil\n\t}\n\treturn true, nil\n}", "title": "" }, { "docid": "b63b7b2bd65ee0e7de62b39e50f5c1ba", "score": "0.63451165", "text": "func StockPubExists(exec boil.Executor, stockPubID int) (bool, error) {\n\tvar exists bool\n\n\tsql := \"select exists(select 1 from \\\"stock_pub\\\" where \\\"stock_pub_id\\\"=$1 limit 1)\"\n\n\tif boil.DebugMode {\n\t\tfmt.Fprintln(boil.DebugWriter, sql)\n\t\tfmt.Fprintln(boil.DebugWriter, stockPubID)\n\t}\n\n\trow := exec.QueryRow(sql, stockPubID)\n\n\terr := row.Scan(&exists)\n\tif err != nil {\n\t\treturn false, errors.Wrap(err, \"chado: unable to check if stock_pub exists\")\n\t}\n\n\treturn exists, nil\n}", "title": "" }, { "docid": "496bb15a643f30ec3b5e6c5e19ebf3b1", "score": "0.61672246", "text": "func (q trustlineQuery) Exists(exec boil.Executor) (bool, error) {\n\tvar count int64\n\n\tqueries.SetCount(q.Query)\n\tqueries.SetLimit(q.Query, 1)\n\n\terr := q.Query.QueryRow(exec).Scan(&count)\n\tif err != nil {\n\t\treturn false, errors.Wrap(err, \"stellarcore: failed to check if trustlines exists\")\n\t}\n\n\treturn count > 0, nil\n}", "title": "" }, { "docid": "12d3a4466b9cb805d4c08c922c8eaaf5", "score": "0.60571104", "text": "func (q stockPubQuery) Exists() (bool, error) {\n\tvar count int64\n\n\tqueries.SetCount(q.Query)\n\tqueries.SetLimit(q.Query, 1)\n\n\terr := q.Query.QueryRow().Scan(&count)\n\tif err != nil {\n\t\treturn false, errors.Wrap(err, \"chado: failed to check if stock_pub exists\")\n\t}\n\n\treturn count > 0, nil\n}", "title": "" }, { "docid": "3d21f7e6a457b7c3c8c50b846935e96e", "score": "0.60186094", "text": "func (q cartQuery) Exists(ctx context.Context, exec boil.ContextExecutor) (bool, error) {\n\tvar count int64\n\n\tqueries.SetSelect(q.Query, nil)\n\tqueries.SetCount(q.Query)\n\tqueries.SetLimit(q.Query, 1)\n\n\terr := q.Query.QueryRowContext(ctx, exec).Scan(&count)\n\tif err != nil {\n\t\treturn false, errors.Wrap(err, \"orm: failed to check if carts exists\")\n\t}\n\n\treturn count > 0, nil\n}", "title": "" }, { "docid": "caa4d3688cbfca46a9ca8a193d230f31", "score": "0.5984321", "text": "func (trq *TradeRecordQuery) Exist(ctx context.Context) (bool, error) {\n\tctx = newQueryContext(ctx, TypeTradeRecord, \"Exist\")\n\tswitch _, err := trq.FirstID(ctx); {\n\tcase IsNotFound(err):\n\t\treturn false, nil\n\tcase err != nil:\n\t\treturn false, fmt.Errorf(\"ent: check existence: %w\", err)\n\tdefault:\n\t\treturn true, nil\n\t}\n}", "title": "" }, { "docid": "2247d79009ec4f38b5a32c7ff679ce51", "score": "0.59644413", "text": "func ContractExists(db *sql.DB, regnum, published string) bool {\n\tvar c bool\n\n\terr := db.QueryRow(`\n\t\tSELECT EXISTS(\n\t\t\tSELECT *\n\t\t\tFROM contracts_` + shards.GetByRegnum(regnum) + `\n\t\t\tWHERE regnum = $1)\n\t`, regnum).Scan(&c)\n\tif err != nil {\n\t\tlog.Println(\"ContractExists err: \", err)\n\t}\n\n\treturn c\n}", "title": "" }, { "docid": "28545689e575475b2d9dd7707b57eb1c", "score": "0.5892308", "text": "func (p *RedisProvider) Exist(sid string) bool {\n\thas, err := p.client.Exists(p.options.Prefix + sid).Result()\n\tif err != nil {\n\t\treturn false\n\t}\n\treturn has\n}", "title": "" }, { "docid": "5c9f21a4aee08e582c93eeb9c7c29a13", "score": "0.58484215", "text": "func (repo *tweetItemRepository) Exists(ctx context.Context, id string) bool {\n\t_, err := repo.Find(ctx, id)\n\treturn err == nil\n}", "title": "" }, { "docid": "086ed5dc6d1c69ece749ccce9412fdb9", "score": "0.5835258", "text": "func CartExists(ctx context.Context, exec boil.ContextExecutor, iD int64) (bool, error) {\n\tvar exists bool\n\tsql := \"select exists(select 1 from \\\"carts\\\" where \\\"id\\\"=$1 limit 1)\"\n\n\tif boil.IsDebug(ctx) {\n\t\twriter := boil.DebugWriterFrom(ctx)\n\t\tfmt.Fprintln(writer, sql)\n\t\tfmt.Fprintln(writer, iD)\n\t}\n\trow := exec.QueryRowContext(ctx, sql, iD)\n\n\terr := row.Scan(&exists)\n\tif err != nil {\n\t\treturn false, errors.Wrap(err, \"orm: unable to check if carts exists\")\n\t}\n\n\treturn exists, nil\n}", "title": "" }, { "docid": "a1f30f72c0473c55f9c613df1a1907e9", "score": "0.5834151", "text": "func (p *Postgres) Exists(chatID int64, bucketName string) (bool, error) {\n\tquery := `SELECT * FROM buckets WHERE chat_id = $1 AND id = $2`\n\trows, err := p.Conn.Query(query, strconv.FormatInt(chatID, 10), bucketName)\n\tif err != nil {\n\t\treturn false, err\n\t}\n\tdefer rows.Close()\n\n\treturn rows.Next(), nil\n}", "title": "" }, { "docid": "80bb60d01dec86cda01a656a8a3d8ae4", "score": "0.5829628", "text": "func hasQuotePrefix(src []byte) (prefix byte, isQuored bool) {\n\tif len(src) == 0 {\n\t\treturn 0, false\n\t}\n\n\tswitch prefix := src[0]; prefix {\n\tcase prefixDoubleQuote, prefixSingleQuote:\n\t\treturn prefix, true\n\tdefault:\n\t\treturn 0, false\n\t}\n}", "title": "" }, { "docid": "e86f674066c746a0078686ac21974444", "score": "0.582757", "text": "func (q sharedNoteQuery) Exists(ctx context.Context, exec boil.ContextExecutor) (bool, error) {\n\tvar count int64\n\n\tqueries.SetSelect(q.Query, nil)\n\tqueries.SetCount(q.Query)\n\tqueries.SetLimit(q.Query, 1)\n\n\terr := q.Query.QueryRowContext(ctx, exec).Scan(&count)\n\tif err != nil {\n\t\treturn false, errors.Wrap(err, \"models: failed to check if SharedNotes exists\")\n\t}\n\n\treturn count > 0, nil\n}", "title": "" }, { "docid": "dcfc467eb5ebd70cffb5207e1a913ce2", "score": "0.58226407", "text": "func (q pubsubQuery) Exists(exec boil.Executor) (bool, error) {\n\tvar count int64\n\n\tqueries.SetCount(q.Query)\n\tqueries.SetLimit(q.Query, 1)\n\n\terr := q.Query.QueryRow(exec).Scan(&count)\n\tif err != nil {\n\t\treturn false, errors.Wrap(err, \"stellarcore: failed to check if pubsub exists\")\n\t}\n\n\treturn count > 0, nil\n}", "title": "" }, { "docid": "94f2b698af9e319ec17613afb457e69c", "score": "0.58164364", "text": "func (o *Order) Exists() bool { //orders\n\treturn o._exists\n}", "title": "" }, { "docid": "a9dda3a655f237397fa1c4af64d23bd2", "score": "0.58147293", "text": "func (q cartItemQuery) Exists(ctx context.Context, exec boil.ContextExecutor) (bool, error) {\n\tvar count int64\n\n\tqueries.SetSelect(q.Query, nil)\n\tqueries.SetCount(q.Query)\n\tqueries.SetLimit(q.Query, 1)\n\n\terr := q.Query.QueryRowContext(ctx, exec).Scan(&count)\n\tif err != nil {\n\t\treturn false, errors.Wrap(err, \"orm: failed to check if cart_items exists\")\n\t}\n\n\treturn count > 0, nil\n}", "title": "" }, { "docid": "2c8e82f309047fb10747ecd83f907ee8", "score": "0.5803048", "text": "func (sdiq *SysDictItemQuery) Exist(ctx context.Context) (bool, error) {\n\tif err := sdiq.prepareQuery(ctx); err != nil {\n\t\treturn false, err\n\t}\n\treturn sdiq.sqlExist(ctx)\n}", "title": "" }, { "docid": "8ea5fb4469a974b34b727e4193ece96d", "score": "0.57626873", "text": "func (p *RedisProvider) Exist(sid string) bool {\n\tv, err := p.c.Exists(graceful.GetManager().HammerContext(), p.prefix+sid).Result()\n\treturn err == nil && v == 1\n}", "title": "" }, { "docid": "408f5936f978db3324867bd598609261", "score": "0.5761292", "text": "func (q retroQuery) Exists(exec boil.Executor) (bool, error) {\n\tvar count int64\n\n\tqueries.SetSelect(q.Query, nil)\n\tqueries.SetCount(q.Query)\n\tqueries.SetLimit(q.Query, 1)\n\n\terr := q.Query.QueryRow(exec).Scan(&count)\n\tif err != nil {\n\t\treturn false, errors.Wrap(err, \"models: failed to check if retros exists\")\n\t}\n\n\treturn count > 0, nil\n}", "title": "" }, { "docid": "d74ad4d30da4fe33890fad84b4179bb1", "score": "0.57580066", "text": "func StockRelationshipExists(exec boil.Executor, stockRelationshipID int) (bool, error) {\n\tvar exists bool\n\n\tsql := \"select exists(select 1 from \\\"stock_relationship\\\" where \\\"stock_relationship_id\\\"=$1 limit 1)\"\n\n\tif boil.DebugMode {\n\t\tfmt.Fprintln(boil.DebugWriter, sql)\n\t\tfmt.Fprintln(boil.DebugWriter, stockRelationshipID)\n\t}\n\n\trow := exec.QueryRow(sql, stockRelationshipID)\n\n\terr := row.Scan(&exists)\n\tif err != nil {\n\t\treturn false, errors.Wrap(err, \"chado: unable to check if stock_relationship exists\")\n\t}\n\n\treturn exists, nil\n}", "title": "" }, { "docid": "376752f2fd3765543082328fe75f5e5f", "score": "0.5752343", "text": "func (b *Backend) Exists(ctx context.Context, p string) (bool, error) {\n\ttype result struct {\n\t\tval bool\n\t\terr error\n\t}\n\n\tresCh := make(chan *result)\n\n\tgo func() {\n\t\tdefer close(resCh)\n\n\t\tbkt := b.client.Bucket(b.bucket)\n\t\tobj := bkt.Object(p)\n\n\t\tif b.encryption != \"\" {\n\t\t\tobj = obj.Key([]byte(b.encryption))\n\t\t}\n\n\t\tattrs, err := obj.Attrs(ctx)\n\t\tif err != nil && !errors.Is(err, gcstorage.ErrObjectNotExist) {\n\t\t\tresCh <- &result{err: fmt.Errorf(\"get the object attrs, %w\", err)}\n\n\t\t\treturn\n\t\t}\n\n\t\tresCh <- &result{val: err == nil && attrs.Deleted.IsZero()}\n\t}()\n\n\tselect {\n\tcase res := <-resCh:\n\t\treturn res.val, res.err\n\tcase <-ctx.Done():\n\t\t// nolint: wrapcheck\n\t\treturn false, ctx.Err()\n\t}\n}", "title": "" }, { "docid": "0d615e4ebfcffb76eaecda2d11a45055", "score": "0.5725116", "text": "func (bs *GCSBlobstore) Exists(ctx context.Context, key string) (bool, error) {\n\tabsKey := path.Join(bs.prefix, key)\n\toh := bs.bucket.Object(absKey)\n\t_, err := oh.Attrs(ctx)\n\n\tif err == storage.ErrObjectNotExist {\n\t\treturn false, nil\n\t}\n\n\treturn err == nil, err\n}", "title": "" }, { "docid": "b047c2dede004ab2cef6cf70be9ceb0f", "score": "0.57222587", "text": "func IsQuote(c byte) bool { return IsQuoteFilter(c) }", "title": "" }, { "docid": "02c52a48ce5d83441881fd85842192a4", "score": "0.57213646", "text": "func Exists(tx *Tx, bktName []byte) bool {\n\treturn tx.Bucket(bktName) != nil\n}", "title": "" }, { "docid": "4de6d8539ff2ac7627c6af9fe502b129", "score": "0.57077926", "text": "func (q volumeCitationQuery) Exists() (bool, error) {\n\tvar count int64\n\n\tqueries.SetCount(q.Query)\n\tqueries.SetLimit(q.Query, 1)\n\n\terr := q.Query.QueryRow().Scan(&count)\n\tif err != nil {\n\t\treturn false, errors.Wrap(err, \"models: failed to check if volume_citation exists\")\n\t}\n\n\treturn count > 0, nil\n}", "title": "" }, { "docid": "e93f1ae89e3fa5700046b90c2664d9c7", "score": "0.57071257", "text": "func (ciq *CarInspectionQuery) Exist(ctx context.Context) (bool, error) {\n\tif err := ciq.prepareQuery(ctx); err != nil {\n\t\treturn false, err\n\t}\n\treturn ciq.sqlExist(ctx)\n}", "title": "" }, { "docid": "2c42236f56b54226a33fd3fe6ce74f83", "score": "0.5696234", "text": "func Exists(id int) bool {\n\texists, err := ExistsProduct(id)\n\tif err != nil {\n\t\tfmt.Printf(\"Error when try chek if product exists. %s\\n\", err)\n\t\treturn true\n\t}\n\n\treturn exists\n}", "title": "" }, { "docid": "da09ae25a464e5c01f9ec35a4e32b0da", "score": "0.5692606", "text": "func (kps *KeepPartStock) Exists() bool { //keep_part_stock\n\treturn kps._exists\n}", "title": "" }, { "docid": "730eb88c396a63c4954c81d97cb76d24", "score": "0.5689502", "text": "func (bq *BouncerQuery) Exist(ctx context.Context) (bool, error) {\n\tif err := bq.prepareQuery(ctx); err != nil {\n\t\treturn false, err\n\t}\n\treturn bq.sqlExist(ctx)\n}", "title": "" }, { "docid": "44f40e9c06ddc4d5c2cd7de23bd4253e", "score": "0.5689487", "text": "func (ps PreparedStatements) Exists(name string) bool {\n\t_, ok := ps.Get(name)\n\treturn ok\n}", "title": "" }, { "docid": "9970a32f3a76babfb69a56bdbe707c44", "score": "0.5688278", "text": "func (q storageQuery) Exists(exec boil.Executor) (bool, error) {\n\tvar count int64\n\n\tqueries.SetSelect(q.Query, nil)\n\tqueries.SetCount(q.Query)\n\tqueries.SetLimit(q.Query, 1)\n\n\terr := q.Query.QueryRow(exec).Scan(&count)\n\tif err != nil {\n\t\treturn false, errors.Wrap(err, \"models: failed to check if storages exists\")\n\t}\n\n\treturn count > 0, nil\n}", "title": "" }, { "docid": "e3396087faaf7deb0b6133447dad8c35", "score": "0.56807095", "text": "func (q authFullpubkeyQuery) Exists(ctx context.Context, exec boil.ContextExecutor) (bool, error) {\n\tvar count int64\n\n\tqueries.SetSelect(q.Query, nil)\n\tqueries.SetCount(q.Query)\n\tqueries.SetLimit(q.Query, 1)\n\n\terr := q.Query.QueryRowContext(ctx, exec).Scan(&count)\n\tif err != nil {\n\t\treturn false, errors.Wrap(err, \"models: failed to check if auth_fullpubkey exists\")\n\t}\n\n\treturn count > 0, nil\n}", "title": "" }, { "docid": "29e4829597bfc7d8b86c18393c55bcb4", "score": "0.5674875", "text": "func CvtermpathExists(exec boil.Executor, cvtermpathID int) (bool, error) {\n\tvar exists bool\n\n\tsql := \"select exists(select 1 from \\\"cvtermpath\\\" where \\\"cvtermpath_id\\\"=$1 limit 1)\"\n\n\tif boil.DebugMode {\n\t\tfmt.Fprintln(boil.DebugWriter, sql)\n\t\tfmt.Fprintln(boil.DebugWriter, cvtermpathID)\n\t}\n\n\trow := exec.QueryRow(sql, cvtermpathID)\n\n\terr := row.Scan(&exists)\n\tif err != nil {\n\t\treturn false, errors.Wrap(err, \"chado: unable to check if cvtermpath exists\")\n\t}\n\n\treturn exists, nil\n}", "title": "" }, { "docid": "66e784fec2321113b1a4ddd8ef8f61ae", "score": "0.567102", "text": "func (sq *ShopQuery) Exist(ctx context.Context) (bool, error) {\n\tif err := sq.prepareQuery(ctx); err != nil {\n\t\treturn false, err\n\t}\n\treturn sq.sqlExist(ctx)\n}", "title": "" }, { "docid": "1fcf87bf8f65d2ea379cf56f26ed77fa", "score": "0.5663943", "text": "func (woq *WorkOrderQuery) Exist(ctx context.Context) (bool, error) {\n\treturn woq.sqlExist(ctx)\n}", "title": "" }, { "docid": "96957b46b68cce876d54bdd4ec8e258e", "score": "0.56555605", "text": "func (q contentUnitQuery) Exists(exec boil.Executor) (bool, error) {\n\tvar count int64\n\n\tqueries.SetSelect(q.Query, nil)\n\tqueries.SetCount(q.Query)\n\tqueries.SetLimit(q.Query, 1)\n\n\terr := q.Query.QueryRow(exec).Scan(&count)\n\tif err != nil {\n\t\treturn false, errors.Wrap(err, \"mdbmodels: failed to check if content_units exists\")\n\t}\n\n\treturn count > 0, nil\n}", "title": "" }, { "docid": "9febed4f5f7d99e399eddfd5bf7013e3", "score": "0.5641141", "text": "func (br *BuyRequest) Exists() bool {\n\treturn br._exists\n}", "title": "" }, { "docid": "397c69f07d05ea3720c49aa9131b99f4", "score": "0.5626848", "text": "func (o *Order) Exists() bool {\n\treturn o._exists\n}", "title": "" }, { "docid": "397c69f07d05ea3720c49aa9131b99f4", "score": "0.5626848", "text": "func (o *Order) Exists() bool {\n\treturn o._exists\n}", "title": "" }, { "docid": "59d47bd65eda884403bb0335273eede5", "score": "0.5625024", "text": "func (rq *ReplyQuery) Exist(ctx context.Context) (bool, error) {\n\tctx = setContextOp(ctx, rq.ctx, \"Exist\")\n\tswitch _, err := rq.FirstID(ctx); {\n\tcase IsNotFound(err):\n\t\treturn false, nil\n\tcase err != nil:\n\t\treturn false, fmt.Errorf(\"ent: check existence: %w\", err)\n\tdefault:\n\t\treturn true, nil\n\t}\n}", "title": "" }, { "docid": "a25f31dbd6e80ceff35b1493dd02dc2c", "score": "0.5624414", "text": "func (ogsr *OrderGoodsSubRelation) Exists() bool { //order_goods_sub_relation\n\treturn ogsr._exists\n}", "title": "" }, { "docid": "fedbe9487b95546141eb1953f2f07d21", "score": "0.562332", "text": "func (q cmfPaidprogramOrderQuery) Exists(ctx context.Context, exec boil.ContextExecutor) (bool, error) {\n\tvar count int64\n\n\tqueries.SetSelect(q.Query, nil)\n\tqueries.SetCount(q.Query)\n\tqueries.SetLimit(q.Query, 1)\n\n\terr := q.Query.QueryRowContext(ctx, exec).Scan(&count)\n\tif err != nil {\n\t\treturn false, errors.Wrap(err, \"models: failed to check if cmf_paidprogram_order exists\")\n\t}\n\n\treturn count > 0, nil\n}", "title": "" }, { "docid": "73312300f5d8856af20086b94934f59d", "score": "0.56173056", "text": "func isQuote(c byte) bool {\n\treturn c == '\"' || c == '`' || c == '\\''\n}", "title": "" }, { "docid": "bc267e09667c627e6bc55b01db9cffd3", "score": "0.5615424", "text": "func exist(ctx context.Context, conn dialect.ExecQuerier, query string, args ...any) (bool, error) {\n\trows := &sql.Rows{}\n\tif err := conn.Query(ctx, query, args, rows); err != nil {\n\t\treturn false, fmt.Errorf(\"reading schema information %w\", err)\n\t}\n\tdefer rows.Close()\n\tn, err := sql.ScanInt(rows)\n\tif err != nil {\n\t\treturn false, err\n\t}\n\treturn n > 0, nil\n}", "title": "" }, { "docid": "bb669ad325f407fd764b61b1a933c994", "score": "0.5611959", "text": "func (si *Item) Exists() bool {\n\treturn (len(si.Word) > 0) || (len(si.S) > 0)\n}", "title": "" }, { "docid": "f58e6ffaa5519fb4d52e3b4284d50541", "score": "0.56100756", "text": "func (s *Service) Exists(id string) bool {\n\tif s.clients == nil {\n\t\treturn false\n\t}\n\tif _, ok := s.clients[id]; !ok {\n\t\treturn false\n\t}\n\treturn true\n}", "title": "" }, { "docid": "f0eccbec2dc7d9dc18a22dd6cf776ea3", "score": "0.5607427", "text": "func (cq *CommentQuery) Exist(ctx context.Context) (bool, error) {\n\tctx = setContextOp(ctx, cq.ctx, \"Exist\")\n\tswitch _, err := cq.FirstID(ctx); {\n\tcase IsNotFound(err):\n\t\treturn false, nil\n\tcase err != nil:\n\t\treturn false, fmt.Errorf(\"ent: check existence: %w\", err)\n\tdefault:\n\t\treturn true, nil\n\t}\n}", "title": "" }, { "docid": "b012c6e7cbf2adf971dc3906675c5bc2", "score": "0.5606286", "text": "func (r *repository) Exists(ctx context.Context, id string) (bool, error) {\n\treturn r.existQuerierGlobal.ExistsGlobal(ctx, repo.Conditions{repo.NewEqualCondition(idColumn, id)})\n}", "title": "" }, { "docid": "519e593b46aabbc11c95d2c6b01d8b65", "score": "0.56055784", "text": "func (fq *FormulaQuery) Exist(ctx context.Context) (bool, error) {\n\tif err := fq.prepareQuery(ctx); err != nil {\n\t\treturn false, err\n\t}\n\treturn fq.sqlExist(ctx)\n}", "title": "" }, { "docid": "20c3671a3690b062884488b4341d4914", "score": "0.56045985", "text": "func (q stockPubQuery) ExistsP() bool {\n\te, err := q.Exists()\n\tif err != nil {\n\t\tpanic(boil.WrapErr(err))\n\t}\n\n\treturn e\n}", "title": "" }, { "docid": "2ac6a8fd454ca5307b2251ca0557bce2", "score": "0.5594197", "text": "func UpepCodonExists(exec boil.Executor, id int64) (bool, error) {\n\tvar exists bool\n\tsql := \"select exists(select 1 from \\\"upep\\\".\\\"upep_codon\\\" 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 upep_codon exists\")\n\t}\n\n\treturn exists, nil\n}", "title": "" }, { "docid": "0ad2f06205c03f71aaef2c7fe59067a5", "score": "0.5587541", "text": "func (wodq *WorkOrderDefinitionQuery) Exist(ctx context.Context) (bool, error) {\n\treturn wodq.sqlExist(ctx)\n}", "title": "" }, { "docid": "927b5b48213c3e9238c22a4252dbaea9", "score": "0.5586728", "text": "func (op *PhysicalOp) Exists(db *sql.DB) (err error) {\n\tvar count int64\n\terr = db.QueryRow(`SELECT count(1) from physical_op WHERE id = $1`, op.ID).Scan(&count)\n\tif err != nil {\n\t\treturn err\n\t}\n\tif count != 1 {\n\t\treturn errors.New(\"Opération introuvable\")\n\t}\n\treturn nil\n}", "title": "" }, { "docid": "50068fa6b1c44fad8521a46c5493580d", "score": "0.55837905", "text": "func (q cvtermpathQuery) Exists() (bool, error) {\n\tvar count int64\n\n\tqueries.SetCount(q.Query)\n\tqueries.SetLimit(q.Query, 1)\n\n\terr := q.Query.QueryRow().Scan(&count)\n\tif err != nil {\n\t\treturn false, errors.Wrap(err, \"chado: failed to check if cvtermpath exists\")\n\t}\n\n\treturn count > 0, nil\n}", "title": "" }, { "docid": "247d18a3af85464a20c61b71a6f03ca5", "score": "0.5581351", "text": "func (q recipeFragranceQuery) Exists(ctx context.Context, exec boil.ContextExecutor) (bool, error) {\n\tvar count int64\n\n\tqueries.SetSelect(q.Query, nil)\n\tqueries.SetCount(q.Query)\n\tqueries.SetLimit(q.Query, 1)\n\n\terr := q.Query.QueryRowContext(ctx, exec).Scan(&count)\n\tif err != nil {\n\t\treturn false, errors.Wrap(err, \"models: failed to check if recipe_fragrance exists\")\n\t}\n\n\treturn count > 0, nil\n}", "title": "" }, { "docid": "e275aecaa00fe5f6ecc971ddab583c68", "score": "0.55806106", "text": "func (q cmfCashRecordQuery) Exists(ctx context.Context, exec boil.ContextExecutor) (bool, error) {\n\tvar count int64\n\n\tqueries.SetSelect(q.Query, nil)\n\tqueries.SetCount(q.Query)\n\tqueries.SetLimit(q.Query, 1)\n\n\terr := q.Query.QueryRowContext(ctx, exec).Scan(&count)\n\tif err != nil {\n\t\treturn false, errors.Wrap(err, \"models: failed to check if cmf_cash_record exists\")\n\t}\n\n\treturn count > 0, nil\n}", "title": "" }, { "docid": "91b168f2a135cc25686fcab2869fafd0", "score": "0.55786043", "text": "func (rc *RabbitConnection) QExists(q *RabbitQ) bool {\n\treturn true\n}", "title": "" }, { "docid": "7718bbd247803b3cf900abf090de56df", "score": "0.557723", "text": "func (q volumeCitationQuery) ExistsP() bool {\n\te, err := q.Exists()\n\tif err != nil {\n\t\tpanic(boil.WrapErr(err))\n\t}\n\n\treturn e\n}", "title": "" }, { "docid": "ac374da3c8c667eb34701f9b18453b84", "score": "0.55745465", "text": "func PubsubExists(exec boil.Executor, resid string) (bool, error) {\n\tvar exists bool\n\tsql := \"select exists(select 1 from \\\"pubsub\\\" where \\\"resid\\\"=$1 limit 1)\"\n\n\tif boil.DebugMode {\n\t\tfmt.Fprintln(boil.DebugWriter, sql)\n\t\tfmt.Fprintln(boil.DebugWriter, resid)\n\t}\n\n\trow := exec.QueryRow(sql, resid)\n\n\terr := row.Scan(&exists)\n\tif err != nil {\n\t\treturn false, errors.Wrap(err, \"stellarcore: unable to check if pubsub exists\")\n\t}\n\n\treturn exists, nil\n}", "title": "" }, { "docid": "b98a32f867fb9d185ef8292396ba9c82", "score": "0.5574383", "text": "func (s *Supplier) Exists() bool {\n\treturn s._exists\n}", "title": "" }, { "docid": "7450cd15ace2e62d0f1317fa5cbf65cc", "score": "0.5573111", "text": "func (sc *ScComment) Exists() bool {\n\treturn sc._exists\n}", "title": "" }, { "docid": "c3a25cffce33f1417e366663303689cb", "score": "0.5571496", "text": "func (q additiveQuery) Exists(ctx context.Context, exec boil.ContextExecutor) (bool, error) {\n\tvar count int64\n\n\tqueries.SetSelect(q.Query, nil)\n\tqueries.SetCount(q.Query)\n\tqueries.SetLimit(q.Query, 1)\n\n\terr := q.Query.QueryRowContext(ctx, exec).Scan(&count)\n\tif err != nil {\n\t\treturn false, errors.Wrap(err, \"models: failed to check if additive exists\")\n\t}\n\n\treturn count > 0, nil\n}", "title": "" }, { "docid": "26094a79172ff91bb8d587a72c626c75", "score": "0.5569896", "text": "func (client *ZKCli) Exists(path string) bool {\n\texists, _, _ := client.conn.Exists(path)\n\treturn exists\n}", "title": "" }, { "docid": "0cbef9c1c36609ba5d2b3f63a2fcf786", "score": "0.55669665", "text": "func (q originChannelQuery) Exists(ctx context.Context, exec boil.ContextExecutor) (bool, error) {\n\tvar count int64\n\n\tqueries.SetSelect(q.Query, nil)\n\tqueries.SetCount(q.Query)\n\tqueries.SetLimit(q.Query, 1)\n\n\terr := q.Query.QueryRowContext(ctx, exec).Scan(&count)\n\tif err != nil {\n\t\treturn false, errors.Wrap(err, \"models: failed to check if origin_channels exists\")\n\t}\n\n\treturn count > 0, nil\n}", "title": "" }, { "docid": "f8d1dd463340b59c040e05cafe767f58", "score": "0.5564067", "text": "func (p *retryProvider) Exist(sid string) bool {\n\treturn p.provider.Exist(sid)\n}", "title": "" }, { "docid": "5ffd18e29d3b3acc7513e3fbe74d6be9", "score": "0.55607736", "text": "func recipeAlreadyExist(name string) bool {\n\trow := db.QueryRow(\"SELECT name FROM recipes WHERE name = ?\", name)\n\tswitch err := row.Scan(&name); err {\n\tcase sql.ErrNoRows:\n\t\treturn false\n\tcase nil: // Recipe exists\n\t\treturn true\n\tdefault:\n\t\tpanic(err.Error())\n\t}\n}", "title": "" }, { "docid": "f019725d1121b8518fd593f93d0e8bf7", "score": "0.5559008", "text": "func (s *Store) Exists(ctx context.Context, name string) bool {\n\t_, err := s.Get(ctx, name)\n\treturn err == nil\n}", "title": "" }, { "docid": "d45a6dce3798a75fd650c0066ad3fef0", "score": "0.5556485", "text": "func (biq *BinaryItemQuery) Exist(ctx context.Context) (bool, error) {\n\tif err := biq.prepareQuery(ctx); err != nil {\n\t\treturn false, err\n\t}\n\treturn biq.sqlExist(ctx)\n}", "title": "" }, { "docid": "8db309053ccea3264b5c5781c95fe5a6", "score": "0.55550534", "text": "func AccountExists(acctName string) bool {\n\tresults, err := execRead(\"MATCH (a:account) WHERE toLower(a.name)=toLower($acctName) RETURN a\",\n\t\tmap[string]interface{}{\n\t\t\t\"acctName\": acctName,\n\t\t},\n\t)\n\tif err != nil {\n\t\tlog.Println(err)\n\t\treturn false\n\t}\n\tif len(results) < 1 {\n\t\treturn false\n\t} else {\n\t\treturn true\n\t}\n}", "title": "" }, { "docid": "91de334e9d533684aefd177fca76bdae", "score": "0.5553552", "text": "func (blq *BlobLinkQuery) Exist(ctx context.Context) (bool, error) {\n\tctx = setContextOp(ctx, blq.ctx, \"Exist\")\n\tswitch _, err := blq.First(ctx); {\n\tcase IsNotFound(err):\n\t\treturn false, nil\n\tcase err != nil:\n\t\treturn false, fmt.Errorf(\"ent: check existence: %w\", err)\n\tdefault:\n\t\treturn true, nil\n\t}\n}", "title": "" }, { "docid": "6ee996df892f4afb0d2dfbef5269d89a", "score": "0.5547723", "text": "func (pq *PointpendinglbtransactionQuery) Exist(ctx context.Context) (bool, error) {\n\tif err := pq.prepareQuery(ctx); err != nil {\n\t\treturn false, err\n\t}\n\treturn pq.sqlExist(ctx)\n}", "title": "" }, { "docid": "4738e76e84f2314fd5d44e3e63340f74", "score": "0.55437136", "text": "func (q transactionAddressQuery) Exists(exec boil.Executor) (bool, error) {\n\tvar count int64\n\n\tqueries.SetSelect(q.Query, nil)\n\tqueries.SetCount(q.Query)\n\tqueries.SetLimit(q.Query, 1)\n\n\terr := q.Query.QueryRow(exec).Scan(&count)\n\tif err != nil {\n\t\treturn false, errors.Wrap(err, \"model: failed to check if transaction_address exists\")\n\t}\n\n\treturn count > 0, nil\n}", "title": "" }, { "docid": "122ccd582405b643928cc13d2cd232e8", "score": "0.554064", "text": "func (c *clientImpl) Exists(databaseName string) (bool, error) {\n\treturn c.client.Exists(databaseName)\n}", "title": "" }, { "docid": "9ce5ece4d12b3f8197f63b1cfc6ffe9c", "score": "0.5540382", "text": "func (q cmfShopOrderMessageQuery) Exists(ctx context.Context, exec boil.ContextExecutor) (bool, error) {\n\tvar count int64\n\n\tqueries.SetSelect(q.Query, nil)\n\tqueries.SetCount(q.Query)\n\tqueries.SetLimit(q.Query, 1)\n\n\terr := q.Query.QueryRowContext(ctx, exec).Scan(&count)\n\tif err != nil {\n\t\treturn false, errors.Wrap(err, \"models: failed to check if cmf_shop_order_message exists\")\n\t}\n\n\treturn count > 0, nil\n}", "title": "" }, { "docid": "92ae6a227c1d80a7b5dabd7fd5417c20", "score": "0.55384016", "text": "func (q featurePubQuery) Exists() (bool, error) {\n\tvar count int64\n\n\tqueries.SetCount(q.Query)\n\tqueries.SetLimit(q.Query, 1)\n\n\terr := q.Query.QueryRow().Scan(&count)\n\tif err != nil {\n\t\treturn false, errors.Wrap(err, \"chado: failed to check if feature_pub exists\")\n\t}\n\n\treturn count > 0, nil\n}", "title": "" }, { "docid": "7868fbd5dd47a60a648ba07388943204", "score": "0.55378723", "text": "func StoreExists(exec boil.Executor, storeID uint8) (bool, error) {\n\tvar exists bool\n\tsql := \"select exists(select 1 from `store` where `store_id`=? limit 1)\"\n\n\tif boil.DebugMode {\n\t\tfmt.Fprintln(boil.DebugWriter, sql)\n\t\tfmt.Fprintln(boil.DebugWriter, storeID)\n\t}\n\n\trow := exec.QueryRow(sql, storeID)\n\n\terr := row.Scan(&exists)\n\tif err != nil {\n\t\treturn false, errors.Wrap(err, \"sqlboiler: unable to check if store exists\")\n\t}\n\n\treturn exists, nil\n}", "title": "" }, { "docid": "ec518c2ecae0e23e4a02555819618125", "score": "0.5532781", "text": "func checkOrderExists(conn *redigo.Conn, orderId string) (bool, error) {\n\treturn redis.Exists(conn, DB_ORDER_PREFIX+orderId)\n}", "title": "" }, { "docid": "e70e2cfe04a42c5a61d7b75b9cadc2e5", "score": "0.5530805", "text": "func (q transactionAddressQuery) ExistsP(exec boil.Executor) bool {\n\te, err := q.Exists(exec)\n\tif err != nil {\n\t\tpanic(boil.WrapErr(err))\n\t}\n\n\treturn e\n}", "title": "" }, { "docid": "93e7e6c06ff221ec207f84e4c815a305", "score": "0.5529172", "text": "func (copl *ComponentOrderProcessLog) Exists() bool { //component_order_process_log\n\treturn copl._exists\n}", "title": "" }, { "docid": "385e7ce88057d3553ad54659ddb133a8", "score": "0.55286884", "text": "func FeaturePubExists(exec boil.Executor, featurePubID int) (bool, error) {\n\tvar exists bool\n\n\tsql := \"select exists(select 1 from \\\"feature_pub\\\" where \\\"feature_pub_id\\\"=$1 limit 1)\"\n\n\tif boil.DebugMode {\n\t\tfmt.Fprintln(boil.DebugWriter, sql)\n\t\tfmt.Fprintln(boil.DebugWriter, featurePubID)\n\t}\n\n\trow := exec.QueryRow(sql, featurePubID)\n\n\terr := row.Scan(&exists)\n\tif err != nil {\n\t\treturn false, errors.Wrap(err, \"chado: unable to check if feature_pub exists\")\n\t}\n\n\treturn exists, nil\n}", "title": "" }, { "docid": "8591df6bd51f2edbef8515f2e5c1edb1", "score": "0.5517134", "text": "func (q jobQuery) Exists(ctx context.Context, exec boil.ContextExecutor) (bool, error) {\n\tvar count int64\n\n\tqueries.SetSelect(q.Query, nil)\n\tqueries.SetCount(q.Query)\n\tqueries.SetLimit(q.Query, 1)\n\n\terr := q.Query.QueryRowContext(ctx, exec).Scan(&count)\n\tif err != nil {\n\t\treturn false, errors.Wrap(err, \"models: failed to check if job exists\")\n\t}\n\n\treturn count > 0, nil\n}", "title": "" }, { "docid": "8128388d7dd9d7a71f7d184c2670f1e4", "score": "0.5513421", "text": "func (mq *MusicQuery) Exist(ctx context.Context) (bool, error) {\n\treturn mq.sqlExist(ctx)\n}", "title": "" }, { "docid": "e11aa1c5f99d204ae1b5d14fffc902ae", "score": "0.55098486", "text": "func (q transactionQuery) Exists(exec boil.Executor) (bool, error) {\n\tvar count int64\n\n\tqueries.SetCount(q.Query)\n\tqueries.SetLimit(q.Query, 1)\n\n\terr := q.Query.QueryRow(exec).Scan(&count)\n\tif err != nil {\n\t\treturn false, errors.Wrap(err, \"models: failed to check if transactions exists\")\n\t}\n\n\treturn count > 0, nil\n}", "title": "" }, { "docid": "8987c82605b411a23c78dd94253b4ec4", "score": "0.5507167", "text": "func (q upepCodonQuery) Exists() (bool, error) {\n\tvar count int64\n\n\tqueries.SetCount(q.Query)\n\tqueries.SetLimit(q.Query, 1)\n\n\terr := q.Query.QueryRow().Scan(&count)\n\tif err != nil {\n\t\treturn false, errors.Wrap(err, \"models: failed to check if upep_codon exists\")\n\t}\n\n\treturn count > 0, nil\n}", "title": "" }, { "docid": "82ec3a99efe05a6355b3e6e39188f98a", "score": "0.5504377", "text": "func (q sampleQuery) Exists(ctx context.Context, exec boil.ContextExecutor) (bool, error) {\n\tvar count int64\n\n\tqueries.SetSelect(q.Query, nil)\n\tqueries.SetCount(q.Query)\n\tqueries.SetLimit(q.Query, 1)\n\n\terr := q.Query.QueryRowContext(ctx, exec).Scan(&count)\n\tif err != nil {\n\t\treturn false, errors.Wrap(err, \"models: failed to check if sample exists\")\n\t}\n\n\treturn count > 0, nil\n}", "title": "" }, { "docid": "db1394f09cba3a6a1cb66bef49b9247b", "score": "0.5500728", "text": "func (q featurePhenotypeQuery) Exists() (bool, error) {\n\tvar count int64\n\n\tqueries.SetCount(q.Query)\n\tqueries.SetLimit(q.Query, 1)\n\n\terr := q.Query.QueryRow().Scan(&count)\n\tif err != nil {\n\t\treturn false, errors.Wrap(err, \"chado: failed to check if feature_phenotype exists\")\n\t}\n\n\treturn count > 0, nil\n}", "title": "" }, { "docid": "a82b4fc4c57319be291985c2f8495fd8", "score": "0.5500486", "text": "func ConfidenceExists(exec boil.Executor, id int) (bool, error) {\n\tvar exists bool\n\tsql := \"select exists(select 1 from \\\"confidences\\\" 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 confidences exists\")\n\t}\n\n\treturn exists, nil\n}", "title": "" }, { "docid": "6b4f41443a9ba7d808a11077daabf843", "score": "0.54971325", "text": "func (q revokedtokenQuery) Exists(ctx context.Context, exec boil.ContextExecutor) (bool, error) {\n\tvar count int64\n\n\tqueries.SetSelect(q.Query, nil)\n\tqueries.SetCount(q.Query)\n\tqueries.SetLimit(q.Query, 1)\n\n\terr := q.Query.QueryRowContext(ctx, exec).Scan(&count)\n\tif err != nil {\n\t\treturn false, errors.Wrap(err, \"models: failed to check if revokedtokens exists\")\n\t}\n\n\treturn count > 0, nil\n}", "title": "" }, { "docid": "a76d0c4e9c19e47fd3f821ccafb19c4c", "score": "0.5496907", "text": "func FeaturePhenotypeExists(exec boil.Executor, featurePhenotypeID int) (bool, error) {\n\tvar exists bool\n\n\tsql := \"select exists(select 1 from \\\"feature_phenotype\\\" where \\\"feature_phenotype_id\\\"=$1 limit 1)\"\n\n\tif boil.DebugMode {\n\t\tfmt.Fprintln(boil.DebugWriter, sql)\n\t\tfmt.Fprintln(boil.DebugWriter, featurePhenotypeID)\n\t}\n\n\trow := exec.QueryRow(sql, featurePhenotypeID)\n\n\terr := row.Scan(&exists)\n\tif err != nil {\n\t\treturn false, errors.Wrap(err, \"chado: unable to check if feature_phenotype exists\")\n\t}\n\n\treturn exists, nil\n}", "title": "" }, { "docid": "c5415628fffc064e76cef322d2ded8d1", "score": "0.54968125", "text": "func (q stockRelationshipQuery) Exists() (bool, error) {\n\tvar count int64\n\n\tqueries.SetCount(q.Query)\n\tqueries.SetLimit(q.Query, 1)\n\n\terr := q.Query.QueryRow().Scan(&count)\n\tif err != nil {\n\t\treturn false, errors.Wrap(err, \"chado: failed to check if stock_relationship exists\")\n\t}\n\n\treturn count > 0, nil\n}", "title": "" }, { "docid": "0f0500d49b1a8e3c19085aed96bfd10b", "score": "0.54960555", "text": "func (q abnormalClaimQuery) Exists(exec boil.Executor) (bool, error) {\n\tvar count int64\n\n\tqueries.SetSelect(q.Query, nil)\n\tqueries.SetCount(q.Query)\n\tqueries.SetLimit(q.Query, 1)\n\n\terr := q.Query.QueryRow(exec).Scan(&count)\n\tif err != nil {\n\t\treturn false, errors.Wrap(err, \"model: failed to check if abnormal_claim exists\")\n\t}\n\n\treturn count > 0, nil\n}", "title": "" }, { "docid": "220566fab1d76eff850345fe0e14d113", "score": "0.5494426", "text": "func (r *WarehouseRepository) SkuExists(sku string) (exists bool, err error) {\n\tc, err := redis.Dial(\"tcp\", r.redisDialString)\n\tif err != nil {\n\t\treturn false, err\n\t}\n\tdefer func() {\n\t\terr = c.Close()\n\t}()\n\twarehouseKey := fmt.Sprintf(\"warehouse:%s\", sku)\n\texists, err = redis.Bool(c.Do(\"EXISTS\", warehouseKey))\n\treturn exists, err\n}", "title": "" }, { "docid": "b8ab7a57b9141d419d19f07d537b9045", "score": "0.5493264", "text": "func TicketExists(exec boil.Executor, iD int) (bool, error) {\n\tvar exists bool\n\tsql := \"select exists(select 1 from \\\"tickets\\\" 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 tickets exists\")\n\t}\n\n\treturn exists, nil\n}", "title": "" }, { "docid": "992b50b311989c745df5be3f95ea241d", "score": "0.5492058", "text": "func (uqt *UsersQrTrace) Exists() bool { //users_qr_trace\n\treturn uqt._exists\n}", "title": "" }, { "docid": "ad03a9196592dfaec2cfe4db219b7638", "score": "0.5488788", "text": "func (aq *AccountQuery) Exist(ctx context.Context) (bool, error) {\n\tctx = setContextOp(ctx, aq.ctx, \"Exist\")\n\tswitch _, err := aq.FirstID(ctx); {\n\tcase IsNotFound(err):\n\t\treturn false, nil\n\tcase err != nil:\n\t\treturn false, fmt.Errorf(\"ent: check existence: %w\", err)\n\tdefault:\n\t\treturn true, nil\n\t}\n}", "title": "" }, { "docid": "5021e1aeb1e0d52fbe50b01df89d841e", "score": "0.5483786", "text": "func (siq *ServiceInfoQuery) Exist(ctx context.Context) (bool, error) {\n\tif err := siq.prepareQuery(ctx); err != nil {\n\t\treturn false, err\n\t}\n\treturn siq.sqlExist(ctx)\n}", "title": "" }, { "docid": "675de7f126ba96e9a8e1770f334e9fe0", "score": "0.5474886", "text": "func (q dividendQuery) Exists(exec boil.Executor) (bool, error) {\n\tvar count int64\n\n\tqueries.SetCount(q.Query)\n\tqueries.SetLimit(q.Query, 1)\n\n\terr := q.Query.QueryRow(exec).Scan(&count)\n\tif err != nil {\n\t\treturn false, errors.Wrap(err, \"models: failed to check if dividend exists\")\n\t}\n\n\treturn count > 0, nil\n}", "title": "" }, { "docid": "a177ac447120cf1f2a186b04ef003581", "score": "0.5471026", "text": "func (ap *AgPay) Exists() bool {\n\treturn ap._exists\n}", "title": "" }, { "docid": "4839076b6af39c11ed903f61986bebdb", "score": "0.54707074", "text": "func (s *Sigchains) Exists(kid ID) (bool, error) {\n\treturn s.ds.Exists(context.TODO(), dstore.Path(\"sigchain\", StatementID(kid, 1)))\n}", "title": "" }, { "docid": "0ee9da2f10fa97e1e3bb71eaaf607cd5", "score": "0.5470628", "text": "func (dp *DatosPrestacione) Exists() bool {\n\treturn dp._exists\n}", "title": "" } ]
f8b08054a8d050361a635a4f37d1e406
MarshalEasyJSON supports easyjson.Marshaler interface
[ { "docid": "2eb47397681d1132ee6546770cf9e4c6", "score": "0.0", "text": "func (v SimpleService_TransHeadersNoReq_Args) MarshalEasyJSON(w *jwriter.Writer) {\n\teasyjson1bcb5839EncodeGithubComUberZanzibarExamplesExampleGatewayBuildGenCodeEndpointsBazBazSimpleServiceTransHeadersNoReq1(w, v)\n}", "title": "" } ]
[ { "docid": "73fc734c4657977d7fbe635606176413", "score": "0.7616857", "text": "func (v Bft) MarshalEasyJSON(w *jwriter.Writer) {\n\teasyjson69c461c7EncodeCita20(w, v)\n}", "title": "" }, { "docid": "5af962f75999959b93c329c7ee63af7c", "score": "0.7610837", "text": "func (v BodyTrue) MarshalEasyJSON(w *jwriter.Writer) {\n\teasyjson69c461c7EncodeCita18(w, v)\n}", "title": "" }, { "docid": "298aa7ecda808ffbb71b827bb69df567", "score": "0.7565983", "text": "func (v Subscriber) MarshalEasyJSON(w *jwriter.Writer) {\n\teasyjson639f989aEncodeCodeCloudfoundryOrgGorouterMbus1(w, v)\n}", "title": "" }, { "docid": "59001fb2d3c4568808c677606934cbde", "score": "0.75537556", "text": "func (v BaseObjectWithName) MarshalEasyJSON(w *jwriter.Writer) {\n\teasyjsonC7452bc1EncodeGithubComStek29Vk86(w, v)\n}", "title": "" }, { "docid": "d20e76d663e1434dcacc788828f3d98f", "score": "0.7548898", "text": "func (v easyType) MarshalEasyJSON(w *jwriter.Writer) {\n\teasyjson42239ddeEncodeGithubComLibforJson(w, v)\n}", "title": "" }, { "docid": "15194165523bcec97b9dce46d294f3bc", "score": "0.7535158", "text": "func (v Post) MarshalEasyJSON(w *jwriter.Writer) {\n\teasyjsonC7452bc1EncodeGithubComStek29Vk23(w, v)\n}", "title": "" }, { "docid": "9891245bd9cbecc715735c35a906e215", "score": "0.75257105", "text": "func (v Response) MarshalEasyJSON(w *jwriter.Writer) {\n\teasyjson69c461c7EncodeCita10(w, v)\n}", "title": "" }, { "docid": "fc85ffce8283492d5458cfc933cc2af3", "score": "0.7517627", "text": "func (v BaseObject) MarshalEasyJSON(w *jwriter.Writer) {\n\teasyjsonC7452bc1EncodeGithubComStek29Vk87(w, v)\n}", "title": "" }, { "docid": "c68ddd4939c700cfd9a03138c5db0d2b", "score": "0.7510763", "text": "func (v Gift) MarshalEasyJSON(w *jwriter.Writer) {\n\teasyjsonC7452bc1EncodeGithubComStek29Vk63(w, v)\n}", "title": "" }, { "docid": "b9fb14c7d39ec50229992612ac992439", "score": "0.75008154", "text": "func (v User) MarshalEasyJSON(w *jwriter.Writer) {\n\teasyjson3486653aEncodeCourseraHw3Bench(w, v)\n}", "title": "" }, { "docid": "d71899ac67c5d025bf826791abcb95f7", "score": "0.74906015", "text": "func (v MyBody) MarshalEasyJSON(w *jwriter.Writer) {\n\teasyjson635ef9aeEncodeGithubComUberZanzibarRuntime(w, v)\n}", "title": "" }, { "docid": "10b3bc6a2a81123fef692606c02bf7b1", "score": "0.7483495", "text": "func (v Request) MarshalEasyJSON(w *jwriter.Writer) {\n\teasyjson69c461c7EncodeCita11(w, v)\n}", "title": "" }, { "docid": "a9e2543fa6cc41ac3700d6efa1136079", "score": "0.74731606", "text": "func (v CallRequest) MarshalEasyJSON(w *jwriter.Writer) {\n\teasyjson69c461c7EncodeCita17(w, v)\n}", "title": "" }, { "docid": "366eda580d734e4e62cffa06d65bf172", "score": "0.74681354", "text": "func (v MediumPayload) MarshalEasyJSON(w *jwriter.Writer) {\n\teasyjson8ca7813eEncodeGithubComSapphiRedJsonConstantiaterBenchmarks(w, v)\n}", "title": "" }, { "docid": "83ae689be7d7373c762c721eb24bf64a", "score": "0.7456953", "text": "func (v ResultMetaData) MarshalEasyJSON(w *jwriter.Writer) {\n\teasyjson69c461c7EncodeCita6(w, v)\n}", "title": "" }, { "docid": "649cb74e752aa682017f499e74520011", "score": "0.7455989", "text": "func (v Module) MarshalEasyJSON(w *jwriter.Writer) {\n\teasyjsonC5a4559bEncodeGithubComChromedpCdprotoMemory7(w, v)\n}", "title": "" }, { "docid": "2589d2d10893d88a4b72844798caf683", "score": "0.74258506", "text": "func (v User) MarshalEasyJSON(w *jwriter.Writer) {\n\teasyjson84c0690eEncodeHighloadcup3(w, v)\n}", "title": "" }, { "docid": "0a11fd1ee8fb7aac33c8a0fc4968f74b", "score": "0.7421453", "text": "func (v Validator) MarshalEasyJSON(w *jwriter.Writer) {\n\teasyjsonD2b7633eEncodeGithubComJopoleonMinterTestPps(w, v)\n}", "title": "" }, { "docid": "6f058b99c3a5e1132815105d4b33db75", "score": "0.74168277", "text": "func (v Payload) MarshalEasyJSON(w *jwriter.Writer) {\n\teasyjsonC1cedd36EncodeGithubComHumansNetGoApnsApns1(w, v)\n}", "title": "" }, { "docid": "790f909239f6c184addbbfb5e76d8dfb", "score": "0.7384411", "text": "func (v tag) MarshalEasyJSON(w *jwriter.Writer) {\n\teasyjson1c889379EncodeGithubComToomoreLazyflickrgoJsonstruct1(w, v)\n}", "title": "" }, { "docid": "d81d4be13a17cfd690ae240f6b35fc25", "score": "0.7384356", "text": "func (v Sticker) MarshalEasyJSON(w *jwriter.Writer) {\n\teasyjsonC7452bc1EncodeGithubComStek29Vk22(w, v)\n}", "title": "" }, { "docid": "2bcda4dcf16ed29e3b08fd116c499e9c", "score": "0.73824656", "text": "func (v ResultTransaction) MarshalEasyJSON(w *jwriter.Writer) {\n\teasyjson69c461c7EncodeCita3(w, v)\n}", "title": "" }, { "docid": "478db70ffd9958c0ae097bd65a335fda", "score": "0.7372061", "text": "func (v Sample) MarshalEasyJSON(w *jwriter.Writer) {\n\teasyjson9def2ecdEncodeGithubComLoadimpactK6StatsCloud8(w, v)\n}", "title": "" }, { "docid": "980d9bd0180cd6338ccd35cf9531feaf", "score": "0.73673934", "text": "func (v Result) MarshalEasyJSON(w *jwriter.Writer) {\n\teasyjsonD2b7633eEncodeGithubComJopoleonMinterTestPps4(w, v)\n}", "title": "" }, { "docid": "452da23ada9a281fdd15d4d1c2d0cbf7", "score": "0.7366161", "text": "func (v ResultVersion) MarshalEasyJSON(w *jwriter.Writer) {\n\teasyjson69c461c7EncodeCita1(w, v)\n}", "title": "" }, { "docid": "03949ad501cfbe8c1bcbae9d4529c506", "score": "0.73658067", "text": "func (v ValMsg) MarshalEasyJSON(w *jwriter.Writer) {\n\teasyjson8d5c760EncodeGithubComSzyhfGoSerializeBenchmarkInternalEasyjson(w, v)\n}", "title": "" }, { "docid": "af5a47fa558e4ad67406c0a8ae46b8b5", "score": "0.7357556", "text": "func (v SendSummary) MarshalEasyJSON(w *jwriter.Writer) {\n\teasyjsonF381ebcaEncodeJoblessnessHahaModelsBase3(w, v)\n}", "title": "" }, { "docid": "df2395fe68c8538f801b63118361e753", "score": "0.73487246", "text": "func (v Experience) MarshalEasyJSON(w *jwriter.Writer) {\n\teasyjsonF381ebcaEncodeJoblessnessHahaModelsBase5(w, v)\n}", "title": "" }, { "docid": "ac436ed5d57d43c57a62b97116c485d1", "score": "0.7344211", "text": "func (v Author) MarshalEasyJSON(w *jwriter.Writer) {\n\teasyjsonF381ebcaEncodeJoblessnessHahaModelsBase7(w, v)\n}", "title": "" }, { "docid": "75d17083555f0936efbab1710d7df26e", "score": "0.7343668", "text": "func (v MyBodyClient) MarshalEasyJSON(w *jwriter.Writer) {\n\teasyjson635ef9aeEncodeGithubComUberZanzibarRuntime1(w, v)\n}", "title": "" }, { "docid": "e6d201ea21a0473c70b14aab2d7da0f7", "score": "0.7325977", "text": "func (v BidRequest) MarshalEasyJSON(w *jwriter.Writer) {\n\teasyjson89fe9b30EncodeOpenrtb(w, v)\n}", "title": "" }, { "docid": "7dd9b46ee3375b195327ea7fb7463a60", "score": "0.7324629", "text": "func (v MarketItem) MarshalEasyJSON(w *jwriter.Writer) {\n\teasyjsonC7452bc1EncodeGithubComStek29Vk47(w, v)\n}", "title": "" }, { "docid": "c0af6004468fc03d1008e1f0cd9b8eab", "score": "0.732154", "text": "func (v BaseImage) MarshalEasyJSON(w *jwriter.Writer) {\n\teasyjsonC7452bc1EncodeGithubComStek29Vk88(w, v)\n}", "title": "" }, { "docid": "73f95af707ee3c85c893b3ec0a805132", "score": "0.7306768", "text": "func (v ResultBlockTrue) MarshalEasyJSON(w *jwriter.Writer) {\n\teasyjson69c461c7EncodeCita8(w, v)\n}", "title": "" }, { "docid": "da615942ae37e75ebfc24e87578715e8", "score": "0.73040146", "text": "func (v Error) MarshalEasyJSON(w *jwriter.Writer) {\n\teasyjson69c461c7EncodeCita16(w, v)\n}", "title": "" }, { "docid": "a775040029ddb53d47107efcf505799a", "score": "0.7302061", "text": "func (v Common) MarshalEasyJSON(w *jwriter.Writer) {\n\teasyjson1c889379EncodeGithubComToomoreLazyflickrgoJsonstruct25(w, v)\n}", "title": "" }, { "docid": "64e04aa3f3a3eced5180742b9a30a3c0", "score": "0.7289192", "text": "func (v Post) MarshalEasyJSON(w *jwriter.Writer) {\n\teasyjsonD2b7633eEncodeGithubComvladimirsukiasyanTpDbInternalModels11(w, v)\n}", "title": "" }, { "docid": "d684c1d56a78aedf541a8577a15e4124", "score": "0.72891337", "text": "func (v Device) MarshalEasyJSON(w *jwriter.Writer) {\n\teasyjson3073ac56EncodeGithubComVungleVungoOpenrtb(w, v)\n}", "title": "" }, { "docid": "07b055f862fb081e73887d7243fd283c", "score": "0.72835577", "text": "func (s JSONMapItem) MarshalEasyJSON(w *jwriter.Writer) {\n\tw.String(s.Key)\n\tw.RawByte(':')\n\tw.Raw(WriteJSON(s.Value))\n}", "title": "" }, { "docid": "5ef440851af90f20e5a563aafd55b4e2", "score": "0.72822154", "text": "func (v UserExtended) MarshalEasyJSON(w *jwriter.Writer) {\n\teasyjsonD2b7633eEncodeWaveInternalModels1(w, v)\n}", "title": "" }, { "docid": "807d8244e236aed746622912c9c7c938", "score": "0.7279925", "text": "func (v Proof) MarshalEasyJSON(w *jwriter.Writer) {\n\teasyjson69c461c7EncodeCita12(w, v)\n}", "title": "" }, { "docid": "ccb4573e18cbc019208b21a1fb67f8ab", "score": "0.7278748", "text": "func (v Filter) MarshalEasyJSON(w *jwriter.Writer) {\n\teasyjson69c461c7EncodeCita15(w, v)\n}", "title": "" }, { "docid": "79733e7868165a5617473261bb078e14", "score": "0.72787017", "text": "func (v User) MarshalEasyJSON(w *jwriter.Writer) {\n\teasyjsonC7452bc1EncodeGithubComStek29Vk19(w, v)\n}", "title": "" }, { "docid": "0512af057ee094e7359b88011b76b026", "score": "0.72761047", "text": "func (v Todo) MarshalEasyJSON(w *jwriter.Writer) {\n\teasyjson794297d0EncodeGithubComAbhi2109TodoAPIData3(w, v)\n}", "title": "" }, { "docid": "f6add849104f8b33f6a44aa9f842f55e", "score": "0.72671485", "text": "func (v ResultLogs) MarshalEasyJSON(w *jwriter.Writer) {\n\teasyjson69c461c7EncodeCita7(w, v)\n}", "title": "" }, { "docid": "786b17c3d335a7c1f86e15786358de38", "score": "0.7266618", "text": "func (v User) MarshalEasyJSON(w *jwriter.Writer) {\n\teasyjson9e1087fdEncodeSandboxHw3BenchData(w, v)\n}", "title": "" }, { "docid": "1c10c6cd677d48b48e3477fc3d35c467", "score": "0.7264069", "text": "func (v Tag) MarshalEasyJSON(w *jwriter.Writer) {\n\teasyjsonD2b7633eEncodeGithubComJopoleonMinterTestPps3(w, v)\n}", "title": "" }, { "docid": "61e826de247a84cba7e0120d87eb907b", "score": "0.72570264", "text": "func (v Tags) MarshalEasyJSON(w *jwriter.Writer) {\n\teasyjson1c889379EncodeGithubComToomoreLazyflickrgoJsonstruct4(w, v)\n}", "title": "" }, { "docid": "96191d240316a2fcb1469586f05b53f7", "score": "0.725575", "text": "func (v WatchBuy) MarshalEasyJSON(w *jwriter.Writer) {\n\teasyjson7be57abeEncodeGithubComForrestSuGoLearnHelloWorldAdvance05Benchmark(w, v)\n}", "title": "" }, { "docid": "d62c0499d1c290378cb1838a466dd15f", "score": "0.7252341", "text": "func (v Applications) MarshalEasyJSON(w *jwriter.Writer) {\n\teasyjsonD2b7633eEncodeWaveInternalModels12(w, v)\n}", "title": "" }, { "docid": "3830d5f360b1e62813379c9e472646d6", "score": "0.7251036", "text": "func (v TransactionParser) MarshalEasyJSON(w *jwriter.Writer) {\n\teasyjson461f4b12EncodeGithubComKamaiuOandaGoModel2(w, v)\n}", "title": "" }, { "docid": "87d68ebc0653b8ffb006c26b62b69cab", "score": "0.7250214", "text": "func (v A) MarshalEasyJSON(w *jwriter.Writer) {\n\teasyjsonB0f55b16EncodeGithubComAlecthomasGoSerializationBenchmarks2(w, v)\n}", "title": "" }, { "docid": "9ed55c233c742788ecfbb7bd9b8b9692", "score": "0.72488755", "text": "func (v Document) MarshalEasyJSON(w *jwriter.Writer) {\n\teasyjsonC7452bc1EncodeGithubComStek29Vk69(w, v)\n}", "title": "" }, { "docid": "2e3165534f0aef3776a1b6363d928037", "score": "0.7245528", "text": "func (v Actor) MarshalEasyJSON(w *jwriter.Writer) {\n\teasyjsonA97f39aeEncodeGithubComGoParkMailRu20202JigglypufInternalPkgModels8(w, v)\n}", "title": "" }, { "docid": "3068b28d349204367295a66afedc7ddc", "score": "0.72451437", "text": "func (v BodyFalse) MarshalEasyJSON(w *jwriter.Writer) {\n\teasyjson69c461c7EncodeCita19(w, v)\n}", "title": "" }, { "docid": "473ed4a262a7a0fd14840718104a2514", "score": "0.7232442", "text": "func (v Application) MarshalEasyJSON(w *jwriter.Writer) {\n\teasyjsonD2b7633eEncodeWaveInternalModels13(w, v)\n}", "title": "" }, { "docid": "cb8a48e9eef7066d3847ce6d401cb942", "score": "0.7219166", "text": "func (v Photo) MarshalEasyJSON(w *jwriter.Writer) {\n\teasyjsonC7452bc1EncodeGithubComStek29Vk34(w, v)\n}", "title": "" }, { "docid": "c2eebd514a9c785fcc236e3a2e0b68da", "score": "0.72173005", "text": "func (v Logs) MarshalEasyJSON(w *jwriter.Writer) {\n\teasyjson69c461c7EncodeCita13(w, v)\n}", "title": "" }, { "docid": "1293bee21889a6cdc91b0a3e144d1d77", "score": "0.72105384", "text": "func (v Genre) MarshalEasyJSON(w *jwriter.Writer) {\n\teasyjsonA97f39aeEncodeGithubComGoParkMailRu20202JigglypufInternalPkgModels7(w, v)\n}", "title": "" }, { "docid": "b35fa1139704351720ef1b90448875a1", "score": "0.71949863", "text": "func (v User) MarshalEasyJSON(w *jwriter.Writer) {\n\teasyjson794297d0EncodeGithubComAbhi2109TodoAPIData1(w, v)\n}", "title": "" }, { "docid": "475d962e342c5567b85b9a11100642f3", "score": "0.7189967", "text": "func (v Field) MarshalEasyJSON(w *jwriter.Writer) {\n\teasyjson6615c02eEncodeGithubComGoParkMailRu20191EscapadeInternalConfig8(w, v)\n}", "title": "" }, { "docid": "75953f9ee64851a30b89b1d39f35aa61", "score": "0.71890694", "text": "func (v Message) MarshalEasyJSON(w *jwriter.Writer) {\n\teasyjsonC7452bc1EncodeGithubComStek29Vk46(w, v)\n}", "title": "" }, { "docid": "715e6026c867b41787066d2c2278b737", "score": "0.7188552", "text": "func (v Transactions) MarshalEasyJSON(w *jwriter.Writer) {\n\teasyjson69c461c7EncodeCita(w, v)\n}", "title": "" }, { "docid": "28ffa40578fd9215a3c7234222d2de2e", "score": "0.71873146", "text": "func (v Error) MarshalEasyJSON(w *jwriter.Writer) {\n\teasyjson794297d0EncodeGithubComAbhi2109TodoAPIData4(w, v)\n}", "title": "" }, { "docid": "d4ec8d94ee8b51de63479e92ff6dea70", "score": "0.7185875", "text": "func (v PostCharactersAffiliation200Ok) MarshalEasyJSON(w *jwriter.Writer) {\n\teasyjson2003668EncodeGithubComAntihaxGoesiEsi1(w, v)\n}", "title": "" }, { "docid": "5688f93c82b99e81b8be88ab2aa1a324", "score": "0.7182054", "text": "func (v Education) MarshalEasyJSON(w *jwriter.Writer) {\n\teasyjsonF381ebcaEncodeJoblessnessHahaModelsBase6(w, v)\n}", "title": "" }, { "docid": "1924883e01c0611e354d7629d1d23096", "score": "0.7181146", "text": "func (v MessageAllow) MarshalEasyJSON(w *jwriter.Writer) {\n\teasyjsonC7452bc1EncodeGithubComStek29Vk45(w, v)\n}", "title": "" }, { "docid": "6b1fd249ef56b1d1f4a659899973cda3", "score": "0.7180675", "text": "func (v WS) MarshalEasyJSON(w *jwriter.Writer) {\n\teasyjson559270aeEncodeGithubComGoParkMailRu20202ExtraSafeInternalModels(w, v)\n}", "title": "" }, { "docid": "48642568fa5dad4b3060abf1b412b69e", "score": "0.7175672", "text": "func (v Transaction) MarshalEasyJSON(w *jwriter.Writer) {\n\teasyjsonD2b7633eEncodeGithubComJopoleonMinterTestPps2(w, v)\n}", "title": "" }, { "docid": "dc6f4a37c471f8ef95ab2ff39def7fba", "score": "0.7169981", "text": "func (v Note) MarshalEasyJSON(w *jwriter.Writer) {\n\teasyjsonC7452bc1EncodeGithubComStek29Vk36(w, v)\n}", "title": "" }, { "docid": "27d5c78ac89e1fdec102b9239e459282", "score": "0.7167365", "text": "func (v RegistryMessage) MarshalEasyJSON(w *jwriter.Writer) {\n\teasyjson639f989aEncodeCodeCloudfoundryOrgGorouterMbus2(w, v)\n}", "title": "" }, { "docid": "e5aa01e40e6de2deb28d01fadc956923", "score": "0.7163134", "text": "func (v CreateTransaction) MarshalEasyJSON(w *jwriter.Writer) {\n\teasyjson461f4b12EncodeGithubComKamaiuOandaGoModel36(w, v)\n}", "title": "" }, { "docid": "75ea51ff9f68c6e508de114a85eddcc9", "score": "0.7162499", "text": "func (v BaseResponse) MarshalEasyJSON(w *jwriter.Writer) {\n\teasyjsonC5a4559bEncodeBattleshipAppGeneratedModels14(w, v)\n}", "title": "" }, { "docid": "314470c5854d1f220c4af5953ca12c29", "score": "0.7152078", "text": "func (v AidCache) MarshalEasyJSON(w *jwriter.Writer) {\n\teasyjson7be57abeEncodeGithubComForrestSuGoLearnHelloWorldAdvance05Benchmark1(w, v)\n}", "title": "" }, { "docid": "8f82ef55fbc520a9b3e95e74390ba9fb", "score": "0.71517664", "text": "func (v SubscribeResp) MarshalEasyJSON(w *jwriter.Writer) {\n\teasyjsonCd93bc43EncodeGithubComFedorkolmykowAvitoexpPkgApi(w, v)\n}", "title": "" }, { "docid": "ce1f9d1c658260a8c82e4ac3753de38f", "score": "0.7149481", "text": "func (v ResultPeerInfo) MarshalEasyJSON(w *jwriter.Writer) {\n\teasyjson69c461c7EncodeCita5(w, v)\n}", "title": "" }, { "docid": "976f9fd0a98efb4c6929f7bf0741ad1d", "score": "0.71454245", "text": "func (v NewsfeedItem) MarshalEasyJSON(w *jwriter.Writer) {\n\teasyjsonC7452bc1EncodeGithubComStek29Vk37(w, v)\n}", "title": "" }, { "docid": "beecf01260c9143fafc0662289fdf0dc", "score": "0.71446025", "text": "func (v PhotoNew) MarshalEasyJSON(w *jwriter.Writer) {\n\teasyjsonC7452bc1EncodeGithubComStek29Vk29(w, v)\n}", "title": "" }, { "docid": "ed6ef79dccde4f520aa222a3015f63f7", "score": "0.7144068", "text": "func (v TransStruct) MarshalEasyJSON(w *jwriter.Writer) {\n\teasyjson1bcb5839EncodeGithubComUberZanzibarExamplesExampleGatewayBuildGenCodeEndpointsBazBaz(w, v)\n}", "title": "" }, { "docid": "ea987637e05e37e0e1e72447645064a0", "score": "0.7144043", "text": "func (v MessageNew) MarshalEasyJSON(w *jwriter.Writer) {\n\teasyjsonC7452bc1EncodeGithubComStek29Vk42(w, v)\n}", "title": "" }, { "docid": "1b523eea8f48cc58cfaa844ec33b4ee3", "score": "0.71405405", "text": "func (v Link) MarshalEasyJSON(w *jwriter.Writer) {\n\teasyjsonC7452bc1EncodeGithubComStek29Vk54(w, v)\n}", "title": "" }, { "docid": "99fecc5f6ac33bdc8a791701e0dc2d86", "score": "0.7139232", "text": "func (v APIError) MarshalEasyJSON(w *jwriter.Writer) {\n\teasyjsonC7452bc1EncodeGithubComStek29Vk93(w, v)\n}", "title": "" }, { "docid": "a29ee76e0854fa171fd374cccb226872", "score": "0.7132195", "text": "func (v Album) MarshalEasyJSON(w *jwriter.Writer) {\n\teasyjsonC7452bc1EncodeGithubComStek29Vk91(w, v)\n}", "title": "" }, { "docid": "6d465a4347f9c20b9d1b3cf09178b691", "score": "0.7129653", "text": "func (v PhotosetInfo) MarshalEasyJSON(w *jwriter.Writer) {\n\teasyjson1c889379EncodeGithubComToomoreLazyflickrgoJsonstruct8(w, v)\n}", "title": "" }, { "docid": "4cea406f9c752d29ea3ebbd01fbd072e", "score": "0.71265954", "text": "func (v Posts) MarshalEasyJSON(w *jwriter.Writer) {\n\teasyjsonMarshalPosts(w, v)\n}", "title": "" }, { "docid": "9712019d8acc0daf6ca5eb5ffb198a97", "score": "0.7123834", "text": "func (v MiniLink) MarshalEasyJSON(w *jwriter.Writer) {\n\teasyjsonC7452bc1EncodeGithubComStek29Vk39(w, v)\n}", "title": "" }, { "docid": "9dbed5a0f1c9ecbca7025345d7d63112", "score": "0.71230435", "text": "func (v UserStruct) MarshalEasyJSON(w *jwriter.Writer) {\n\teasyjson97766e5aEncodeMyProjectsGoMailruPart1Week3Hw3BenchEasy(w, v)\n}", "title": "" }, { "docid": "ee48a3c020eb6c6080ace0a4c4729ac8", "score": "0.71217084", "text": "func (v User) MarshalEasyJSON(w *jwriter.Writer) {\n\teasyjson1c889379EncodeGithubComToomoreLazyflickrgoJsonstruct2(w, v)\n}", "title": "" }, { "docid": "b2e5ca18b5df5617583e610be1697d11", "score": "0.712032", "text": "func (v ResponseTag) MarshalEasyJSON(w *jwriter.Writer) {\n\teasyjson559270aeEncodeGithubComGoParkMailRu20202ExtraSafeInternalModels7(w, v)\n}", "title": "" }, { "docid": "e0a9a8f68de127e5ff9a4d930bd1a8d0", "score": "0.7119669", "text": "func (v VacancyResponse) MarshalEasyJSON(w *jwriter.Writer) {\n\teasyjsonF381ebcaEncodeJoblessnessHahaModelsBase(w, v)\n}", "title": "" }, { "docid": "fcf3ae598354ea4ce5530621c82894bf", "score": "0.71105653", "text": "func (v ChangedStringValue) MarshalEasyJSON(w *jwriter.Writer) {\n\teasyjsonC7452bc1EncodeGithubComStek29Vk77(w, v)\n}", "title": "" }, { "docid": "e183a052f61df0d4ec5cee3f7d9bdf65", "score": "0.7107095", "text": "func (v GeoServe) MarshalEasyJSON(w *jwriter.Writer) {\n\teasyjsonD2b7633eEncodeGitlabComLadyDascalieEarthquakesDbModels(w, v)\n}", "title": "" }, { "docid": "ef8f9f2f408608c1c7bcb6fc2d51ca02", "score": "0.71065575", "text": "func (v Error) MarshalEasyJSON(w *jwriter.Writer) {\n\teasyjsonD2b7633eEncodeGithubComJopoleonMinterTestPps5(w, v)\n}", "title": "" }, { "docid": "a253485a83c259a569defd70f1b6252f", "score": "0.7103793", "text": "func (v MetricExpandItem) MarshalEasyJSON(w *jwriter.Writer) {\n\teasyjson10066a7fEncodeCadentServerSchemasIndexer2(w, v)\n}", "title": "" }, { "docid": "ff8d71cd272ec5cac6c80d632266e3e6", "score": "0.710128", "text": "func (v APIResponse) MarshalEasyJSON(w *jwriter.Writer) {\n\teasyjsonC7452bc1EncodeGithubComStek29Vk92(w, v)\n}", "title": "" }, { "docid": "2e6200afd215f4141b3aea6fe1d8d8c1", "score": "0.70973134", "text": "func (v UserApplication) MarshalEasyJSON(w *jwriter.Writer) {\n\teasyjsonD2b7633eEncodeWaveInternalModels7(w, v)\n}", "title": "" }, { "docid": "2a90efeb1a5e85532ef0c0a818a7e3d8", "score": "0.70956796", "text": "func (v PrepareForLeakDetectionParams) MarshalEasyJSON(w *jwriter.Writer) {\n\teasyjsonC5a4559bEncodeGithubComChromedpCdprotoMemory6(w, v)\n}", "title": "" }, { "docid": "faa8fe46dd29af737fe40f85f528f2b2", "score": "0.7093736", "text": "func (v Users) MarshalEasyJSON(w *jwriter.Writer) {\n\teasyjsonMarshalUsers(w, v)\n}", "title": "" }, { "docid": "74c5f4a8896b739908355040d486d90a", "score": "0.7089785", "text": "func (v workersHandlerItem) MarshalEasyJSON(w *jwriter.Writer) {\n\teasyjsonE6f1d0abEncodeGithubComKihamoBoggartComponentsBoggartInternalHandlers(w, v)\n}", "title": "" }, { "docid": "c763093850110e50e2ecdc290b17e55a", "score": "0.7089165", "text": "func (v Header) MarshalEasyJSON(w *jwriter.Writer) {\n\teasyjson69c461c7EncodeCita14(w, v)\n}", "title": "" }, { "docid": "806a1a4042e6eb40bbd596102623530f", "score": "0.7085456", "text": "func (v PostParams) MarshalEasyJSON(w *jwriter.Writer) {\n\teasyjsonD2b7633eEncodeForumApplicationModels9(w, v)\n}", "title": "" } ]
99db01f9bb7d8aa6f04a8587847d86f0
New will create a debuglogger.Logger with the standard options.
[ { "docid": "8f3daacb083a856f9c7c6e8e8a0576a2", "score": "0.8549114", "text": "func New() *debuglogger.Logger {\n\treturn newLogger(stdOptions)\n}", "title": "" } ]
[ { "docid": "7a84466d341624cae4d501e95d2fb3f3", "score": "0.82424", "text": "func New(debug bool) *Logger {\n\treturn &Logger{\n\t\t// logger: stdlog.New(os.Stderr, \"\", stdlog.LstdFlags),\n\t\tlogger: stdlog.New(os.Stderr, \"\", stdlog.LstdFlags|stdlog.Lshortfile),\n\t\tdebug: debug,\n\t}\n}", "title": "" }, { "docid": "cc47721baae070c8b6d0e8a8d1791cfd", "score": "0.796286", "text": "func New(w io.Writer, options ...Option) *Logger {\n\tdl := &Logger{envkey: \"DEBUG\"}\n\tdl.logger = log.New(w, \"[DEBUG] \", 0)\n\n\tfor _, option := range options {\n\t\toption(dl)\n\t}\n\n\tif len(os.Getenv(dl.envkey)) != 0 {\n\t\tdl.debug = true\n\t}\n\n\treturn dl\n}", "title": "" }, { "docid": "4c3b0eefabe975db3ed2091d3d473ae1", "score": "0.7937258", "text": "func New(name string) *Logger {\r\n\tl := &Logger{\r\n\t\tname: name,\r\n\t\tflag: LstdFlags,\r\n\t\tlevel: Level_Debug,\r\n\t\tdepth: 3,\r\n\t}\r\n\r\n\tadd(l)\r\n\r\n\treturn l\r\n}", "title": "" }, { "docid": "c386e3130df955df8be4073a13e6a5be", "score": "0.7915995", "text": "func New(ctx context.Context, debug bool) (*Logger, error) {\n\tconfig := zap.NewProductionConfig()\n\tconfig.Encoding = \"console\"\n\tif !debug {\n\t\tconfig.DisableStacktrace = true\n\t\tconfig.EncoderConfig.CallerKey = \"\"\n\t\tconfig.EncoderConfig.TimeKey = \"\"\n\t}\n\tlogger, err := config.Build()\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\treturn &Logger{\n\t\tctx: ctx,\n\t\tlogger: logger,\n\t\tfields: make([]zap.Field, 0),\n\t}, nil\n}", "title": "" }, { "docid": "cf686473a1395e7453ec61d48db14b14", "score": "0.7605076", "text": "func NewWithOptions(options Options) *debuglogger.Logger {\n\treturn newLogger(options)\n}", "title": "" }, { "docid": "f1bbbbd8de7d9b39ac1122b6fbd81987", "score": "0.75879455", "text": "func New(verbose bool) Logger {\n\treturn defautlLogger{verbose: verbose}\n}", "title": "" }, { "docid": "a0467ff9c8496307f63b3d1bdb1d17e6", "score": "0.75754654", "text": "func New(opts ...Option) (*Logger, error) {\n\tl := &Logger{\n\t\tdebug: (os.Getenv(\"DEBUG\") != \"\"),\n\t\tfields: make(map[string]string),\n\t\tlock: new(sync.RWMutex),\n\t\twriters: []message.Writer{},\n\t}\n\n\t// Apply variadic options\n\tfor _, opt := range opts {\n\t\tif err := opt(l); err != nil {\n\t\t\treturn nil, err\n\t\t}\n\t}\n\n\t// Add default writer\n\tif len(l.writers) == 0 {\n\t\tkv, err := kv.New(kv.SetOutput(os.Stderr))\n\t\tif err != nil {\n\t\t\treturn nil, err\n\t\t}\n\t\tl.writers = []message.Writer{kv}\n\t}\n\treturn l, nil\n}", "title": "" }, { "docid": "044d20ea10eb02a19ffb96370194cdcd", "score": "0.75601673", "text": "func New(isDebug bool) log_api.Logger {\n\treturn NewWithOptions(defaultOutputBuffer, \"\", isDebug)\n}", "title": "" }, { "docid": "23d3e3dadc12d44b3537ff553d014a04", "score": "0.75556827", "text": "func New(name string) Logger {\n\tl := Logger(&logger{\n\t\tlevel: levels.DEBUG,\n\t\tname: name,\n\t\tenabled: make(map[levels.LogLevel]bool),\n\t\tappender: appenders.Console(),\n\t\tchildren: make([]Logger, 0),\n\t\tparent: nil,\n\t\tExitOnFatal: true,\n\t})\n\tl.SetLevel(levels.DEBUG)\n\treturn l\n}", "title": "" }, { "docid": "4159e09df2e437adb17c3024a7982f27", "score": "0.7508672", "text": "func New(opts ...Options) *Logger {\n\tvar o Options\n\tif len(opts) == 0 {\n\t\to = Options{}\n\t} else {\n\t\to = opts[0]\n\t}\n\n\t// Determine message.\n\tif len(o.Message) == 0 {\n\t\to.Message = \"Request received\"\n\t}\n\n\t// Determine output logger.\n\tif o.Logger == nil {\n\t\t// Default is logrus Standard Logger.\n\t\to.Logger = logrus.StandardLogger()\n\t}\n\n\treturn &Logger{\n\t\topt: o,\n\t}\n}", "title": "" }, { "docid": "b73f03811c5073bd978acff41ced4f5d", "score": "0.7504564", "text": "func New(level string, traceMode, debugMode bool, opts ...Opt) log.Logger {\n\tlog.SetTraceMode(traceMode)\n\tlog.SetDebugMode(debugMode)\n\t// ll := cmdr.GetStringR(\"logger.level\", \"info\")\n\tlvl, _ := log.ParseLevel(level)\n\tif log.GetDebugMode() {\n\t\tif lvl < log.DebugLevel {\n\t\t\tlvl = log.DebugLevel\n\t\t\tlevel = \"debug\"\n\t\t}\n\t}\n\tif log.GetTraceMode() {\n\t\tif lvl < log.TraceLevel {\n\t\t\tlvl = log.TraceLevel\n\t\t\tlevel = \"debug\"\n\t\t}\n\t}\n\n\tzl := initLogger(log.NewLoggerConfig())\n\n\tfor _, opt := range opts {\n\t\topt(zl)\n\t}\n\n\tlogger := &dzl{zl, zl.Sugar(), nil}\n\tlogger.Setup()\n\tlog.SetLogger(logger)\n\treturn logger\n}", "title": "" }, { "docid": "80a24dd848d91805322e0f5825ff7790", "score": "0.7409693", "text": "func New() *Logger {\n\treturn &Logger{\n\t\tDebugLog: log.New(ioutil.Discard, \"[DEBUG] \", log.LstdFlags),\n\t\tInfoLog: log.New(os.Stdout, \"[INFO] \", log.LstdFlags),\n\t\tErrorLog: log.New(os.Stdout, \"[ERROR] \", log.LstdFlags),\n\t\tHTTPLog: log.New(os.Stdout, \"\", log.LstdFlags),\n\t\tlogs: &Logs{},\n\t}\n}", "title": "" }, { "docid": "3ac5b6778cb58193c88a531e016ad4f5", "score": "0.7374619", "text": "func New(customPrefix string, flags int) *Logger {\n\tif flags < 0 || flags > 255 {\n\t\tflags = FlagsDefault\n\t}\n\tl := Logger{}\n\tl.outWriter = OutDefault\n\tl.errWriter = ErrDefault\n\tl.calldepth = 3 // as for log.Logger\n\tl.SetPrefix(customPrefix)\n\tl.SetFlags(flags)\n\treturn &l\n}", "title": "" }, { "docid": "63794030475b3dcc0cb7843178529b56", "score": "0.73724777", "text": "func New(cfg zap.Config, opts ...zap.Option) (*Logger, error) {\n\tlevel := cfg.Level\n\n\tif level == emptyLevel {\n\t\tlevel = zap.NewAtomicLevelAt(zap.DebugLevel)\n\t}\n\n\tcfg.Level = level\n\n\traw, err := cfg.Build(opts...)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\treturn &Logger{\n\t\traw: raw,\n\t\tSugaredLogger: raw.Sugar(),\n\t\tAtomicLevel: level,\n\t}, nil\n}", "title": "" }, { "docid": "27b52c8944fe54b6ffe22fa01e352081", "score": "0.73500043", "text": "func New(s Sink) *Logger {\n\toption := new(Option)\n\t*option = *defaultOption // copy default option\n\tcaller := xruntime.CaptureCaller()\n\treturn &Logger{\n\t\tOption: option,\n\t\tsink: s,\n\t\tkey: caller.PackageName,\n\t\tctx: nil,\n\t}\n}", "title": "" }, { "docid": "5c273a062dcf8bd70e6cf863ca979be9", "score": "0.7332259", "text": "func New(options ...Option) (*logger, error) {\n\n\tlogger := &logger{\n\t\tformat: AUTO,\n\t\tlevel: InfoLevel,\n\t\tout: os.Stdout,\n\t\trollbarMinLevel: ErrorLevel,\n\t}\n\n\tfor _, opt := range options {\n\t\topt.apply(logger)\n\t}\n\tif logger.name == \"\" {\n\t\tlogger.name = \"root\"\n\t}\n\tlogger.initWrappedLogger()\n\n\treturn logger, nil\n}", "title": "" }, { "docid": "e61f912ba567072f78a2df785d76cc71", "score": "0.73163056", "text": "func New(opt Options) Logger {\n\tl := log.New()\n\thandlers := []log.Handler{}\n\n\tlvl := log.LvlInfo\n\tif opt.Verbose {\n\t\tlvl = log.LvlDebug\n\t}\n\thandlers = append(handlers, log.LvlFilterHandler(lvl, log.StdoutHandler))\n\n\tl.SetHandler(log.MultiHandler(handlers...))\n\treturn l\n}", "title": "" }, { "docid": "12963b965c605eccb46881fe67bd32a3", "score": "0.7254579", "text": "func New() logr.Logger {\n\treturn NewWithOptions(Options{})\n}", "title": "" }, { "docid": "b19663766dbf60bd5db7c48b23537a53", "score": "0.7182402", "text": "func New() *Logger {\n\treturn &Logger{\n\t\tcallDepth: 1,\n\t\tlowestLevel: LevelFatal,\n\t\twg: new(sync.WaitGroup),\n\t\tmsg: make(chan *message, 4096),\n\t\tflush: make(chan *sync.WaitGroup, 1),\n\t\tbufPool: NewBufPool(),\n\t\tquitCh: make(chan struct{}, 1),\n\t\tsyncWrite: true,\n\t\tshowLocation: true,\n\t}\n}", "title": "" }, { "docid": "58b54eedaf1ed0282cfae22a46d4bff8", "score": "0.7174533", "text": "func NewLogger(channelLen int) *BaseLogger {\n\tlog := new(BaseLogger)\n\tlog.level = LevelDebug\n\tlog.loggerFuncCallDepth = 2\n\tlog.enableFuncCallDepth = false\n\tlog.msgChan = make(chan *logMsg, channelLen)\n\tlog.singalChan = make(chan string, 1)\n\tlog.async = false\n\treturn log\n}", "title": "" }, { "docid": "a386a4cffa9ab53283d7933b98049c73", "score": "0.71622795", "text": "func New() *Logger {\n\tonce.Do(func() {\n\t\t// all of the levels\n\t\tlowPriority := zap.LevelEnablerFunc(func(lvl zapcore.Level) bool {\n\t\t\treturn lvl >= zapcore.DebugLevel\n\t\t})\n\n\t\tappName := getAppName()\n\t\tif _, err := os.Stat(logFolder); os.IsNotExist(err) {\n\t\t\t// does not exist\n\t\t\tos.MkdirAll(logFolder, os.ModePerm)\n\t\t}\n\n\t\tfileRotateHook := zapcore.AddSync(&lumberjack.Logger{\n\t\t\tFilename: logFolder + string(os.PathSeparator) + appName + \".log\",\n\t\t\tMaxSize: 1, // MB\n\t\t\tMaxBackups: logRotateCount,\n\t\t\tMaxAge: 30, // day\n\t\t\tCompress: false,\n\t\t})\n\t\tconsoleHook := zapcore.Lock(os.Stdout)\n\n\t\tconsoleEncoder := customConsoleEncoder()\n\n\t\tcore := zapcore.NewTee(\n\t\t\tzapcore.NewCore(consoleEncoder, fileRotateHook, lowPriority),\n\t\t\tzapcore.NewCore(consoleEncoder, consoleHook, lowPriority))\n\n\t\tinstance = &Logger{zap.New(core, zap.AddCaller())}\n\t})\n\n\treturn instance\n}", "title": "" }, { "docid": "6518afc061ee95e47d9d355dbb4cf94e", "score": "0.7147976", "text": "func New(options ...Option) *Logger {\n\n\tres := Logger{\n\t\tnow: time.Now,\n\t\tfatal: func() { os.Exit(1) },\n\t\tstdout: os.Stdout,\n\t\tstderr: os.Stderr,\n\t\tcallerDepth: 0,\n\t}\n\tfor _, opt := range options {\n\t\topt(&res)\n\t}\n\n\tvar err error\n\tif res.format == \"\" {\n\t\tres.format = res.templateFromOptions()\n\t}\n\n\tres.templ, err = template.New(\"lgr\").Parse(res.format)\n\tif err != nil {\n\t\tfmt.Printf(\"invalid template %s, error %v. switched to %s\\n\", res.format, err, Short)\n\t\tres.format = Short\n\t\tres.templ = template.Must(template.New(\"lgrDefault\").Parse(Short))\n\t}\n\n\tbuf := bytes.Buffer{}\n\tif err = res.templ.Execute(&buf, layout{}); err != nil {\n\t\tfmt.Printf(\"failed to execute template %s, error %v. switched to %s\\n\", res.format, err, Short)\n\t\tres.format = Short\n\t\tres.templ = template.Must(template.New(\"lgrDefault\").Parse(Short))\n\t}\n\n\tres.callerOn = strings.Contains(res.format, \"{{.Caller\")\n\tres.levelBracesOn = strings.Contains(res.format, \"[{{.Level}}]\")\n\treturn &res\n}", "title": "" }, { "docid": "ba40d9efb07e904cfcd3c3ab51d81b46", "score": "0.7135272", "text": "func New(f LogFunc) Logger {\n\tlog := Logger{\n\t\tf: f,\n\t\tverbosity: 1000,\n\t}\n\treturn log\n}", "title": "" }, { "docid": "c4dff06caeda62637c9733b868f9bc77", "score": "0.7094318", "text": "func New() *Logger {\n\treturn &Logger{\n\t\tOut: os.Stderr,\n\t\tLevel: InfoLevel,\n\t\tDate: \"2006-01-02 15:04:05.00000\",\n\t}\n}", "title": "" }, { "docid": "5aff0cc55e69ff7fa7e781ae858a65c2", "score": "0.7087414", "text": "func New() Logger {\n\treturn &loggerImpl{\n\t\t// NOTE: differs from std logging in that default is standard output\n\t\t// not standard error. This is consistent with 12 factor app, but\n\t\t// is it the appropriate default.\n\t\tout: os.Stdout,\n\t\tminLevel: LevelInfo,\n\t}\n}", "title": "" }, { "docid": "11ada52524884e0f9f6999d850d9f32e", "score": "0.7080516", "text": "func New(levelStr string) error {\n\tlog.SetFlags(log.LstdFlags | log.Lshortfile)\n\tlevel, ok := levels[levelStr]\n\tif !ok {\n\t\tlog.Printf(\"log level must debug/info/error, you given %q\\n\", levelStr)\n\t\tlevel = InfoLevel\n\t}\n\tcli = &Logger{\n\t\tlevel: level,\n\t\tcaller: true,\n\t}\n\treturn nil\n}", "title": "" }, { "docid": "92abd6923e479ab400a5f0631ee8c98c", "score": "0.70644", "text": "func New(c Configuration) (l *Logger) {\n\t// Create\n\tl = &Logger{\n\t\tc: c,\n\t\tcreatedAt: now(),\n\t\tfs: make(map[string]interface{}),\n\t\tmf: &sync.RWMutex{},\n\t}\n\n\t// Add app name field\n\tif c.AppName != \"\" {\n\t\tl.WithField(\"app_name\", c.AppName)\n\t}\n\n\t// Set writer\n\tl.setWriter(c)\n\n\t// Set level\n\tl.setLevel(c)\n\n\t// Set formatter\n\tl.setFormatter(c, l.createdAt)\n\treturn\n}", "title": "" }, { "docid": "18b21111f57fcf9f2d7d53d7862fb1fb", "score": "0.7062458", "text": "func NewLogger() *Logger {\n\tl := &Logger{\n\t\tLevel: DebugLevel,\n\t}\n\treturn l\n}", "title": "" }, { "docid": "bd4b2ff0bd2a7ee0f4f2432c2524cdc5", "score": "0.7056515", "text": "func New() *Logger {\n logger := &Logger {\n file : gDEFAULT_FILE_FORMAT,\n flags : F_TIME_STD,\n level : LEVEL_ALL,\n btStatus : 1,\n headerPrint : true,\n stdoutPrint : true,\n }\n return logger\n}", "title": "" }, { "docid": "e8b212c9ed8b5e528e90690c1f017a6b", "score": "0.7038046", "text": "func New(env string) *Logger {\n\tl := golog.New()\n\tif env != \"development\" {\n\t\tl.SetVerbosity(golog.DefaultVerbosity &^ golog.Debug)\n\t}\n\n\tl.SetFlags(log.Ldate | log.Ltime | log.Lmicroseconds | log.LUTC)\n\n\treturn &Logger{l}\n}", "title": "" }, { "docid": "3b8b515e821bb8f199f5891d3e950056", "score": "0.7022354", "text": "func NewLogger(w io.Writer, debug bool) Logger {\n\treturn &logger{\n\t\twriter: w,\n\t\tdebug: debug,\n\t}\n}", "title": "" }, { "docid": "cbabcaadc9965d50850888be8320b563", "score": "0.70090145", "text": "func New() *Logger {\n\tlogger := &Logger{\n\t\tfile: gDEFAULT_FILE_FORMAT,\n\t\tflags: F_TIME_STD,\n\t\tlevel: LEVEL_ALL,\n\t\tstStatus: 1,\n\t\theaderPrint: true,\n\t\tstdoutPrint: true,\n\t}\n\treturn logger\n}", "title": "" }, { "docid": "3d4eca3725d7cf972d916e3664ff8e44", "score": "0.6993639", "text": "func New(level level, streams ...io.Writer) (obj *Logger) {\n\ttmpl := template.Must(template.New(\"default\").Funcs(funcMap).Parse(logFmt))\n\tobj = &Logger{\n\t\tids: make(map[string]int),\n\t\tstreams: streams,\n\t\tdateFormat: defaultDate,\n\t\tflags: LstdFlags,\n\t\tlevel: level,\n\t\ttemplate: tmpl,\n\t\tseperator: defaultSeperatorColor,\n\t\ttabStop: 4,\n\t\tindentLevel: -1,\n\t}\n\treturn\n}", "title": "" }, { "docid": "d825f03c003cbbe81e5a021be1bf817f", "score": "0.69891274", "text": "func NewLogger(debug bool, zapfOpts ...zapf.Opts) *Logger {\n\topts := make([]zapf.Opts, 0, len(zapfOpts)+4) // +3 is JSONEncoder, Level, StacktraceLevel and RawZapOpts\n\n\tlvl := zap.NewAtomicLevelAt(zapcore.InfoLevel)\n\tstacktracelvl := zap.NewAtomicLevelAt(zapcore.ErrorLevel)\n\trawOpts := []zap.Option{zap.WithCaller(debug), zap.AddCallerSkip(1)}\n\n\tif debug {\n\t\topts = make([]zapf.Opts, 0, len(zapfOpts)+5) // lazy optimize\n\t\topts = append(opts, zapf.UseDevMode(true))\n\n\t\tlvl = zap.NewAtomicLevelAt(zapcore.DebugLevel)\n\t\tstacktracelvl = zap.NewAtomicLevelAt(zapcore.WarnLevel)\n\t}\n\n\topts = append(opts,\n\t\tzapf.JSONEncoder(EncoderConfigs()...),\n\t\tzapf.Level(lvl),\n\t\tzapf.StacktraceLevel(stacktracelvl),\n\t\tzapf.RawZapOpts(rawOpts...),\n\t)\n\n\t// append zapfOpts variadic args to end of opts\n\topts = append(opts, zapfOpts...)\n\n\treturn &Logger{\n\t\tlogr: zapf.New(opts...),\n\t}\n}", "title": "" }, { "docid": "dd223df8f07197546d82e2d8224db48f", "score": "0.69841826", "text": "func newLogger(dir string, prefix string, opt *LogOptions) *zap.Logger {\n\tif opt == nil {\n\t\topt = &LogOptions{}\n\t}\n\n\tif opt.Level < 1 {\n\t\topt.Level = LLvlProduction\n\t}\n\n\tif opt.Time == nil {\n\t\topt.Time, _ = time.LoadLocation(LStdLocation)\n\t}\n\ttimeLocation = opt.Time\n\n\tif dir != \"\" {\n\t\tfilename = opt.makeLogFile(create(dir), prefix)\n\t}\n\n\tlogger, err := opt.newConfig(filename).Build()\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\tdefer logger.Sync()\n\n\treturn logger\n}", "title": "" }, { "docid": "88b2f58a63cac475f3edeb1fced353fe", "score": "0.6984123", "text": "func NewWithOptions(outputBuffer io.Writer, prefix string, isDebug bool) log_api.Logger {\n\treturn &Logger{\n\t\tBackingLogger: stdlib_log.New(outputBuffer, \"\", stdlib_log.LstdFlags),\n\t\tIsDebug: isDebug,\n\t\tprefix: prefix,\n\t}\n}", "title": "" }, { "docid": "d0529a88d3fe5cf89b71af8720fb2bbc", "score": "0.69827366", "text": "func New() (*Logger, error) {\n\tprodLogger, err := zap.NewProduction()\n\tif err != nil {\n\t\treturn &Logger{}, fmt.Errorf(\"Cannot initialize logger. Error: %s\", err)\n\t}\n\n\tdefer prodLogger.Sync()\n\n\tvar logger = &Logger{prodLogger}\n\n\treturn logger, nil\n}", "title": "" }, { "docid": "70e47138d50fdd723ead84e5e96f65bd", "score": "0.69716316", "text": "func New(config *config.Config) *Logger {\n\n\tzerolog.TimeFieldFormat = zerolog.TimeFormatUnix\n\n\tlogLevel := zerolog.InfoLevel\n\n\tif config.Debug {\n\t\tlogLevel = zerolog.DebugLevel\n\t}\n\n\tzerolog.SetGlobalLevel(logLevel)\n\n\tlogger := zerolog.New(os.Stdout).With().Timestamp().Logger()\n\n\treturn &Logger{logger: &logger}\n}", "title": "" }, { "docid": "60d53fab62484e5fa67a15b36ca9bbed", "score": "0.6968852", "text": "func New(out io.Writer, params *Parameters) *Logger {\n\tif params.Name == \"\" {\n\t\tparams.Name = DefaultName\n\t}\n\tif params.MinLevel == illegalLogLevel {\n\t\tparams.MinLevel = DefaultMinLevel\n\t}\n\tif params.TimeFormat == \"\" {\n\t\tparams.TimeFormat = DefaultTimeFormat\n\t}\n\treturn &Logger{\n\t\tout: out,\n\t\tparams: params,\n\t}\n}", "title": "" }, { "docid": "0659034cf00272380e6da1dad2744985", "score": "0.6964576", "text": "func New(out io.Writer, err io.Writer, prefix string, flag int) *Logger {\n\tl := new(Logger)\n\n\tl.lInfo = log.New(out, prefix+\" \"+InfoPrefix, flag)\n\tl.lDebug = log.New(err, prefix+\" \"+DebugPrefix, flag)\n\tl.lError = log.New(err, prefix+\" \"+ErrorPrefix, flag)\n\n\tl.infoLogEnabled.Set(true)\n\tl.debugLogEnabled.Set(true)\n\tl.errorLogEnabled.Set(true)\n\treturn l\n}", "title": "" }, { "docid": "b53b0d430d8ba888b77348c6f619be05", "score": "0.69379026", "text": "func NewLogger(prefix string, debug bool) *Logger {\n\treturn &Logger{\n\t\tdebug: debug,\n\t\tprefix: prefix,\n\t}\n}", "title": "" }, { "docid": "8fae46cd496ad5d12ff8e77d7dc95e62", "score": "0.6920334", "text": "func New(w *bufio.Writer, l []level, t bool, f Formatter) Logger {\n\treturn Logger{w, l, t, f}\n}", "title": "" }, { "docid": "25b1ffa5ea6c6df2dc07fe045b809f25", "score": "0.6914979", "text": "func NewLogger(options ...func(*LogOptions) error) (Logger, error) {\n\n\t// start by setting sane defaults\n\tlog_options := LogOptions{\n\t\tOutWriter: os.Stderr, // write logging to standard error\n\t\tDebug: true, // write debug messages\n\t\tInfo: true, // write info messages\n\t\tflags: log.Ldate | log.Ltime, // start lines with date and time\n\t}\n\n\t// now loop over options and set any values needed\n\tfor _, option := range options {\n\t\terr := option(&log_options)\n\t\tif err != nil {\n\t\t\treturn Logger{}, err\n\t\t}\n\t}\n\n\t// now that we have all the options set, we can create our loggers\n\t// based on defaults + any options set\n\tlogger := Logger{}\n\n\tlogger.Banner = log.New(log_options.OutWriter, \"\", 0)\n\tif log_options.OutWriter == os.Stderr && runtime.GOOS != \"windows\" {\n\t\tlogger.Error = log.New(log_options.OutWriter, \"\\033[1;31mERROR: \\033[0m\", log_options.flags|log.Lshortfile)\n\t} else {\n\t\tlogger.Error = log.New(log_options.OutWriter, \"ERROR: \", log_options.flags|log.Lshortfile)\n\t}\n\tif log_options.Info {\n\t\tlogger.Info = log.New(log_options.OutWriter, \"INFO: \", log_options.flags)\n\t} else {\n\t\tlog.New(ioutil.Discard, \"\", 0)\n\t}\n\tif log_options.Debug {\n\t\tlogger.Debug = log.New(log_options.OutWriter, \"DEBUG: \", log_options.flags|log.Lshortfile)\n\t} else {\n\t\tlogger.Debug = log.New(ioutil.Discard, \"\", 0)\n\t}\n\n\treturn logger, nil\n}", "title": "" }, { "docid": "5afec4c9f2358c5639dbc4005f4c8b72", "score": "0.6906806", "text": "func NewLogger(channellen int64) *Logger {\n\tbl := new(Logger)\n\tbl.level = LevelDebug\n\tbl.loggerFuncCallDepth = 2\n\tbl.EnableFuncCallDepth(true)\n\tbl.msg = make(chan *logMsg, channellen)\n\tbl.outputs = make(map[string]LoggerInterface)\n\tbl.SetLogger(\"console\", \"\") // default output to console\n\tgo bl.startLogger()\n\treturn bl\n}", "title": "" }, { "docid": "08afd4d5df83f84df4772a5da8fd27bd", "score": "0.69003177", "text": "func New(serviceName string, production bool) *Logger {\n\n\tif production {\n\t\tl, _ := zap.NewProduction()\n\t\treturn &Logger{l.Sugar().With(zap.String(\"service\", serviceName))}\n\t} else {\n\t\tl, _ := zap.NewDevelopment()\n\t\treturn &Logger{l.Sugar().With(zap.String(\"service\", serviceName))}\n\t}\n}", "title": "" }, { "docid": "ca87374fb198ebf6369989df070ae69a", "score": "0.68948525", "text": "func NewLogger(debugger bool) *Logger {\n\tresult := &Logger{\n\t\tlog.New(os.Stderr, \"\", 0),\n\t\tlog.New(os.Stdout, \"\", 0),\n\t\tlog.New(os.Stderr, \"\", 0),\n\t\tdebugger,\n\t}\n\tresult.Debug(\"Debugger Logging: %t\", debugger)\n\treturn result\n}", "title": "" }, { "docid": "a38b4491c7b8778fd33419bd492ef345", "score": "0.6894503", "text": "func New(opts ...Opts) *zap.Logger {\n\to := &options{}\n\tfor _, opt := range opts {\n\t\topt(o)\n\t}\n\to.addDefaults()\n\tsink := zapcore.AddSync(o.outputDest)\n\to.zapOptions = append(o.zapOptions, zap.AddCallerSkip(o.callerSkip), zap.ErrorOutput(sink))\n\tlog := zap.New(zapcore.NewCore(o.encoder, sink, *o.level))\n\tlog = log.WithOptions(o.zapOptions...)\n\treturn log\n}", "title": "" }, { "docid": "e8293670a8867cac05ccd368ab32e848", "score": "0.689141", "text": "func New(t *testing.T) *Logger {\n\tres := Logger{t: t}\n\tres.Logger = stdr.New(log.New(&res.buffer, \"\", 0))\n\treturn &res\n}", "title": "" }, { "docid": "86340a0c63850df0b7454f51d9b45456", "score": "0.68838054", "text": "func New() Logger {\n\tl := &loggerImpl{\n\t\tLogger: stdlog.Logger{},\n\t}\n\tl.SetOutput(os.Stdout)\n\tl.SetFlags(stdlog.LstdFlags | log.LUTC)\n\treturn l\n}", "title": "" }, { "docid": "98f7dc117f9c670d14bc8d34530a583d", "score": "0.6873462", "text": "func New(level string, debugMode bool, opts ...zap.Option) (*Logger, error) {\n\tvar err error\n\n\tlg := &Logger{}\n\n\tencoderConfig := zapcore.EncoderConfig{\n\t\tMessageKey: \"msg\",\n\t\tLevelKey: \"level\",\n\t\tTimeKey: \"ts\",\n\t\tNameKey: \"logger\",\n\t\tCallerKey: \"caller\",\n\t\tStacktraceKey: \"stacktrace\",\n\t\tLineEnding: zapcore.DefaultLineEnding,\n\t\tEncodeLevel: zapcore.LowercaseLevelEncoder,\n\t\tEncodeTime: zapcore.EpochTimeEncoder,\n\t\tEncodeDuration: zapcore.SecondsDurationEncoder,\n\t\tEncodeCaller: zapcore.ShortCallerEncoder,\n\t}\n\n\tlg.level = zap.NewAtomicLevel()\n\tlg.level.SetLevel(convertStringLevelToZap(level))\n\n\tconfig := zap.Config{\n\t\tLevel: lg.level,\n\t\tDevelopment: false,\n\t\tDisableCaller: true,\n\t\tDisableStacktrace: true,\n\t\tSampling: &zap.SamplingConfig{\n\t\t\tInitial: 100,\n\t\t\tThereafter: 100,\n\t\t},\n\t\tEncoding: \"json\",\n\t\tEncoderConfig: encoderConfig,\n\t\tOutputPaths: []string{\"stderr\"},\n\t\tErrorOutputPaths: []string{\"stderr\"},\n\t\tInitialFields: nil,\n\t}\n\n\tif debugMode {\n\t\tconfig.EncoderConfig.EncodeLevel = zapcore.CapitalColorLevelEncoder\n\t\tconfig.EncoderConfig.EncodeCaller = zapcore.FullCallerEncoder\n\t\tconfig.EncoderConfig.EncodeTime = zapcore.ISO8601TimeEncoder\n\t\tconfig.EncoderConfig.EncodeDuration = zapcore.StringDurationEncoder\n\t\tconfig.Encoding = \"console\"\n\t\tconfig.Development = true\n\t\tconfig.Sampling = nil\n\t\tconfig.DisableCaller = false\n\t\tconfig.DisableStacktrace = false\n\t}\n\n\tlg.logger, err = config.Build(opts...)\n\n\treturn lg, err\n}", "title": "" }, { "docid": "2ce113a89ea364e0bfb05b08ac7e736f", "score": "0.686221", "text": "func New(app string, sync ...bool) *Logger {\n\t// Get Host\n\thost, err := getHost()\n\tif err != nil {\n\t\thandleErr(errors.New(\"Fetching Host failed\"))\n\t}\n\n\tsyncVal := false\n\tif len(sync) == 1 {\n\t\tsyncVal = sync[0]\n\t}\n\n\t// Instantiate Logger\n\treturn &Logger{\n\t\tapp: app,\n\t\thost: host,\n\t\tsync: syncVal,\n\t}\n}", "title": "" }, { "docid": "04d680843cf82f5b933d3f1ba46921c9", "score": "0.6832392", "text": "func New(tag ...string) Logger {\n\tconf := defaultConf\n\tconf.Tag = strings.Join(tag, \".\")\n\treturn NewLogger(conf)\n}", "title": "" }, { "docid": "5cf574b289e1e55b89905a18290b5341", "score": "0.6821612", "text": "func New(out io.Writer, minLevel Level) *Logger {\n\treturn &Logger{\n\t\tout: out,\n\t\tminLevel: minLevel,\n\t}\n}", "title": "" }, { "docid": "1e693739d224561390ff0db3ef5add0e", "score": "0.68208075", "text": "func New(logLevel, logFormat int, levelMap map[int]string) *Flogger {\n return &Flogger{ fd: os.Stdout,\n level: logLevel,\n logForm: logFormat,\n log : log.New(os.Stderr, \"\", FLOG_FORMAT),\n lvlMap: levelMap }\n}", "title": "" }, { "docid": "9d579390f067cd4d9b77f7090d7c73b3", "score": "0.6814214", "text": "func NewLogger(fileName string, debug bool) *Logger {\n\t// log enablers\n\tminLevel := zap.NewAtomicLevelAt(zap.DebugLevel)\n\tnormalLevelEnabler := zap.LevelEnablerFunc(func(lvl zapcore.Level) bool {\n\t\treturn lvl < zapcore.ErrorLevel && lvl >= minLevel.Level()\n\t})\n\terrorLevelEnabler := zap.LevelEnablerFunc(func(lvl zapcore.Level) bool {\n\t\treturn lvl >= zapcore.ErrorLevel && lvl >= minLevel.Level()\n\t})\n\n\t// log level encoder\n\tencoder := consoleColorEncoder\n\tif yos.IsOnWindows() {\n\t\tencoder = consoleMonoEncoder\n\t}\n\n\t// combine core for logger\n\tcores := []zapcore.Core{\n\t\tzapcore.NewCore(encoder, writeStdout, normalLevelEnabler),\n\t\tzapcore.NewCore(encoder, writeStderr, errorLevelEnabler),\n\t}\n\t// set log file path as per parameters\n\tif logPath := strings.TrimSpace(fileName); len(logPath) > 0 {\n\t\tlogFile := zapcore.AddSync(&lj.Logger{\n\t\t\tFilename: logPath,\n\t\t\tMaxSize: 10, // megabytes\n\t\t})\n\t\tcores = append(cores, zapcore.NewCore(jsonEncoder, logFile, allLevelEnabler))\n\t}\n\n\t// combine option for logger\n\toptions := []zap.Option{\n\t\tzap.AddCaller(),\n\t\tzap.AddStacktrace(zap.ErrorLevel),\n\t}\n\t// set debug mode as per parameters\n\tif debug {\n\t\toptions = append(options, zap.Development())\n\t}\n\n\t// build the logger\n\tlogL := zap.New(zapcore.NewTee(cores...), options...)\n\treturn &Logger{\n\t\tlogL: logL,\n\t\tlogS: logL.Sugar(),\n\t\tminLevel: &minLevel,\n\t}\n}", "title": "" }, { "docid": "eb10fefdf7a14295fe1e2fce20db446f", "score": "0.68112266", "text": "func NewDebugLogger(logger Logger, debug bool) Logger {\n\treturn debugLogger{\n\t\tLogger: logger,\n\t\tdebug: debug,\n\t}\n}", "title": "" }, { "docid": "1930926a0f09e4518c2c0d1083e0a913", "score": "0.68052626", "text": "func New(out OutRouter, formater Formater) *Logger {\n\tif formater == nil {\n\t\tformater = DefaultFormater{}\n\t}\n\tif out == nil {\n\t\tout = NewDefaultOutRouter(os.Stdout, os.Stderr)\n\t}\n\treturn &Logger{output: out, formater: formater}\n}", "title": "" }, { "docid": "78af7b7f751a3cccc95fc8e8be88cd6a", "score": "0.6767888", "text": "func newDebugLog(log *log.Logger, mask LogMask) *debugLog {\n\tif log == nil {\n\t\tlog = DefaultLogger\n\t}\n\treturn &debugLog{log, mask}\n}", "title": "" }, { "docid": "1b2af68b59b9b0785a6224a255265580", "score": "0.6761981", "text": "func New(root string, errorFile string, verbosity int) *Logger {\n\topts := funcr.Options{\n\t\tLogCaller: funcr.All,\n\t\tLogTimestamp: true,\n\t\tVerbosity: verbosity,\n\t}\n\tinner := funcr.NewJSON(func(obj string) { fmt.Fprintln(os.Stderr, obj) }, opts)\n\treturn &Logger{Logger: inner, root: root, errorFile: errorFile}\n}", "title": "" }, { "docid": "e9895d60c6d145f502f16d7f04e043e2", "score": "0.6761811", "text": "func newLogger(level int, name string, stfields ...interface{}) *Log {\n\tif level < DisabledLevel || level > ErrorLevel {\n\t\tlevel = InfoLevel\n\t}\n\n\tstdl := zerolog.New(os.Stdout).With().Timestamp().Logger()\n\terrl := zerolog.New(os.Stderr).With().Timestamp().Logger()\n\n\tsetLogLevel(&stdl, level)\n\tsetLogLevel(&errl, level)\n\n\tl := &Log{\n\t\tLevel: level,\n\t\tStdLog: stdl,\n\t\tErrLog: errl,\n\t}\n\n\tif len(stfields) > 1 && !cfg.configured {\n\t\tsetup(name, stfields)\n\t}\n\n\treturn l\n}", "title": "" }, { "docid": "b3a278ed44e5e7364ae94f1e5f292d00", "score": "0.6752136", "text": "func New(name, logPath string, mute bool) (*Logger, error) {\n\tlogger := Logger{\n\t\tname: name,\n\t\tlogPath: logPath,\n\t\tprint: logPath == \"\",\n\t\tmute: mute,\n\t}\n\n\treturn logger.init()\n}", "title": "" }, { "docid": "ce9372c59a987ac9f6a55e2d8e432d2b", "score": "0.6740029", "text": "func New(name string) Logger {\n\treturn Logger{\n\t\tName: name,\n\t\tOut: os.Stdout,\n\t}\n}", "title": "" }, { "docid": "4864ab37d62f093d7db702b4b1613d14", "score": "0.6735953", "text": "func New() *Logger {\n\treturn &Logger{\n\t\tLevel: INFO,\n\t\tFormat: new(simpleFormat),\n\t\tOutput: os.Stdout,\n\t}\n}", "title": "" }, { "docid": "08eb802eb0e5e91488d6fc784a38bd61", "score": "0.673319", "text": "func New(logger zerolog.Logger) *Logger {\n\treturn &Logger{\n\t\tlogger: logger,\n\t}\n}", "title": "" }, { "docid": "0160823e285dabb700ee29de36d7c68c", "score": "0.67303294", "text": "func newLogger(options ...zap.Option) *zap.SugaredLogger {\n\tlevel := viper.GetString(\"log-level\")\n\tl := zap.DebugLevel\n\tl.Set(level)\n\n\tcfg := zap.NewDevelopmentConfig()\n\tcfg.Development = false\n\tcfg.Level = zap.NewAtomicLevelAt(l)\n\tlogger, err := cfg.Build(options...)\n\tif err != nil {\n\t\tgolog.Fatalf(\"cannot initialize ZAP logger: %v\", err)\n\t}\n\n\t// Make controller-runtime log using our logger\n\tcrlog.SetLogger(zapr.NewLogger(logger.Named(\"cr\")))\n\n\treturn logger.Sugar()\n}", "title": "" }, { "docid": "af657e770d4bd47d4ee82e4bdbb018fb", "score": "0.6727351", "text": "func New(name string, level string) *Logger {\n\tif _, ok := manager.loggers[name]; ok {\n\t\tpanic(fmt.Sprintf(\"duplicate logger name, %q\", name))\n\t}\n\tsev := severityFromName(level)\n\tlogger := &Logger{\n\t\tlevel: sev,\n\t\tname: name,\n\t\tappenders: []Appender{ConsoleAppender},\n\t\tcallDepth: 2,\n\t\tproperties: make(map[string]interface{}),\n\t}\n\tmanager.loggers[name] = logger\n\treturn logger\n}", "title": "" }, { "docid": "4dcc758483990b4446bc5d214c25dcae", "score": "0.67186993", "text": "func New() Logger { return &logger{os.Stdout} }", "title": "" }, { "docid": "06bc9ed098818e89e4d6322788457550", "score": "0.67178357", "text": "func New() *zap.Logger {\n\tconfig := zap.NewProductionConfig()\n\tconfig.EncoderConfig = stackdriver.EncoderConfig\n\n\tlogger, _ := config.Build()\n\treturn logger\n}", "title": "" }, { "docid": "31930f39e374735d5c979950b19313b4", "score": "0.67152405", "text": "func New(w io.Writer, color bool) *Logger {\n\treturn &Logger{out: &lineWriter{w: w}, color: color}\n}", "title": "" }, { "docid": "072228f11ea452d8d1e0953d84c22362", "score": "0.6715058", "text": "func New(ctx ...interface{}) log.Logger {\n\treturn &logger{logger: zap.L().With(convertCtx(ctx)...)}\n}", "title": "" }, { "docid": "20747fe8f11aba04b24e22de42edf23b", "score": "0.67142767", "text": "func New(out io.Writer, prefix string) *Logger {\n\tif out == nil {\n\t\tout = os.Stdout\n\t}\n\n\tvar flags int\n\n\t// If prefix is not empty - we want add time information to log.\n\tif prefix != \"\" {\n\t\tflags = log.LstdFlags\n\t}\n\n\treturn &Logger{\n\t\tout: log.New(out, prefix, flags),\n\t\tprefix: prefix,\n\t\tdebug: false,\n\t}\n}", "title": "" }, { "docid": "d459caad292048ff003632bd7549339d", "score": "0.6710726", "text": "func New(out io.Writer, prefix string, flag int, priority int) *Logger {\n\treturn &Logger{\n\t\tpriority: priority,\n\t\tprefix: prefix,\n\t\tlogger: log.New(out, prefix, flag),\n\t}\n}", "title": "" }, { "docid": "1a23739de55cdb039833b03805945bd2", "score": "0.67002946", "text": "func New(name string) *Logger {\r\n\t// return &Logger{enable: true, name: name, sink: NewAsyncLoggerSink(1024, time.Millisecond*500)}\r\n\treturn &Logger{enable: true, name: name, sink: NewAsyncLoggerSink(1024, time.Millisecond*500)}\r\n}", "title": "" }, { "docid": "13b87f73815ecd95f71a02cd548e4bef", "score": "0.66979307", "text": "func New(name string) Logger {\n\treturn NewLogger(colorableStdout, name)\n}", "title": "" }, { "docid": "71d03f0b93f1387f7c491b5cdfe8e649", "score": "0.66963995", "text": "func New(level string, options ...zap.Option) *zap.SugaredLogger {\n\treturn newLogger(level, options...).Sugar()\n}", "title": "" }, { "docid": "187cf9b2466c859b38856f8b35705943", "score": "0.6690551", "text": "func New(c gtx.Context) *Logger {\n\tif c == nil {\n\t\tc = gtx.TODO()\n\t}\n\treturn &Logger{\n\t\tc: c,\n\t}\n}", "title": "" }, { "docid": "442a4e224abb5cd8c21854101989963c", "score": "0.6686873", "text": "func New() Logger {\n\treturn logger{entry: logrus.NewEntry(origLogger)}\n}", "title": "" }, { "docid": "cb43a8e92a5a52bb0788dfdaa1d09425", "score": "0.66844374", "text": "func NewLogger(w io.Writer) log.Logger {\n\tlogger := log.With(\n\t\tlog.NewLogfmtLogger(log.NewSyncWriter(w)),\n\t\t\"ts\", log.DefaultTimestampUTC,\n\t)\n\tif debug() {\n\t\tlogger = level.NewFilter(logger, level.AllowAll())\n\t} else {\n\t\tlogger = level.NewFilter(logger, level.AllowInfo())\n\t}\n\tstdlog.SetFlags(0)\n\tstdlog.SetOutput(log.NewStdlibAdapter(logger))\n\treturn logger\n}", "title": "" }, { "docid": "38544ddae1a364615654bb32f8b9d82b", "score": "0.66799676", "text": "func NewLogger(level LogLevel) Logger {\n\tflags := log.Ldate | log.Ltime | log.LUTC\n\tl := &basicLogger{\n\t\tdebug: log.New(io.Discard, \"D \", flags),\n\t\tinfo: log.New(io.Discard, \"I \", flags),\n\t\twarning: log.New(io.Discard, \"W \", flags),\n\t\terror: log.New(io.Discard, \"E \", flags),\n\t}\n\n\tif level <= Debug {\n\t\tl.debug.SetOutput(os.Stderr)\n\t}\n\n\tif level <= Info {\n\t\tl.info.SetOutput(os.Stderr)\n\t}\n\n\tif level <= Warning {\n\t\tl.warning.SetOutput(os.Stderr)\n\t}\n\n\tif level <= Error {\n\t\tl.error.SetOutput(os.Stderr)\n\t}\n\n\treturn l\n}", "title": "" }, { "docid": "0f74f672543f28ac03d44e2269c46777", "score": "0.66745967", "text": "func New(writer io.Writer, logLevel LogLevel, stdOut bool) *Logger {\n\treturn &Logger{\n\t\twriter: writer,\n\t\tlogLevel: logLevel,\n\t\tstdOut: stdOut,\n\t\tformatter: TextFormatter{},\n\t\tfields: Fields{},\n\t}\n}", "title": "" }, { "docid": "0ffad6a4b50ae34ad0dccdb567cba543", "score": "0.66616315", "text": "func New(o *Options) (*zap.Logger, error) {\n\tvar (\n\t\terr error\n\t\tlevel = zap.NewAtomicLevel()\n\t\tlogger *zap.Logger\n\t)\n\n\terr = level.UnmarshalText([]byte(o.Level))\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\tfw := zapcore.AddSync(&lumberjack.Logger{\n\t\tFilename: o.Filename,\n\t\tMaxSize: o.MaxSize, // megabytes\n\t\tMaxBackups: o.MaxBackups,\n\t\tMaxAge: o.MaxAge, // days\n\t})\n\n\tcw := zapcore.Lock(os.Stdout)\n\n\t// file core 采用jsonEncoder\n\tcores := make([]zapcore.Core, 0, 2)\n\tje := zapcore.NewJSONEncoder(zap.NewProductionEncoderConfig())\n\tcores = append(cores, zapcore.NewCore(je, fw, level))\n\n\t// stdout core 采用 ConsoleEncoder\n\tif o.Stdout {\n\t\tce := zapcore.NewConsoleEncoder(zap.NewDevelopmentEncoderConfig())\n\t\tcores = append(cores, zapcore.NewCore(ce, cw, level))\n\t}\n\n\tcore := zapcore.NewTee(cores...)\n\tlogger = zap.New(core)\n\n\tzap.ReplaceGlobals(logger)\n\n\treturn logger, err\n}", "title": "" }, { "docid": "12ad3ea738e7f6d47e6a5793781c1233", "score": "0.66491157", "text": "func New() Logger {\n\treturn NewWithWriters(os.Stdout, os.Stderr, \"\", 0)\n}", "title": "" }, { "docid": "ed95eb4b59fc245090f8e9db5c5e9784", "score": "0.6646691", "text": "func New(config Config) (Logger, error) {\n\tif config.empty() {\n\t\treturn NewNopLogger(), nil\n\t}\n\tvar cfg zap.Config\n\tswitch config.Format {\n\tcase \"json\":\n\t\tcfg = zap.NewProductionConfig()\n\tcase \"console\":\n\t\tcfg = zap.NewDevelopmentConfig()\n\tdefault:\n\t\treturn nil, fmt.Errorf(\"unrecognized format: %q\", config.Format)\n\t}\n\tcfg.Level = zap.NewAtomicLevelAt(zapcore.Level(config.Level))\n\tlogger, err := cfg.Build(zap.AddStacktrace(zap.DPanicLevel))\n\tif err != nil {\n\t\treturn nil, fmt.Errorf(\"building logger: %w\", err)\n\t}\n\treturn NewDefaultLogger(logger), nil\n}", "title": "" }, { "docid": "0829b44b219a6a613b06e5d290a8eb7c", "score": "0.6645502", "text": "func (f *Factory) NewLogger(name ...string) *Logger {\n n := f.registerLoggerName(name...)\n return f.newLoggerFromLeveledPrinter(f.Config.Copy().SetName(n))\n}", "title": "" }, { "docid": "aff4697726c51c85be140ad4198e69a4", "score": "0.66406345", "text": "func New(withConfs ...WithConfiguration) (golog.Logger, error) {\n\tlog := zerolog.New(os.Stderr).With().Timestamp().Logger()\n\treturn newZeroLogger(log, withConfs...)\n}", "title": "" }, { "docid": "69c7b27019f70c7050e52c420bd540ae", "score": "0.662294", "text": "func New(config *log.LoggerConfig) log.Logger {\n\tl, _ := log.ParseLevel(config.Level)\n\tif l == log.OffLevel {\n\t\treturn log.NewDummyLogger()\n\t}\n\n\tif bf, ok := builders[config.Backend]; ok {\n\t\treturn bf(config)\n\t}\n\n\tvar logger log.Logger\n\tswitch config.Backend {\n\tcase \"dummy\", \"none\", \"off\":\n\t\tlogger = log.NewDummyLogger()\n\tcase \"std\", \"standard\":\n\t\tlogger = log.NewStdLogger()\n\tcase \"logrus\":\n\t\tlogger = logrus.NewWithConfig(config)\n\tcase \"sugar\":\n\t\tlogger = sugar.NewWithConfig(config)\n\tdefault:\n\t\tlogger = zap.NewWithConfig(config)\n\t\t//logger = zap.New(config.Level, config.TraceMode, config.DebugMode)\n\t}\n\treturn logger\n}", "title": "" }, { "docid": "8f2cbc221b17bdf26e1d41bdcf420e47", "score": "0.6622906", "text": "func NewLogger() *Logger {\n\tminLevel := viper.GetString(\"logging.level\")\n\treturn &Logger{minLevel: levelMap[minLevel]}\n}", "title": "" }, { "docid": "cd9e9976987c43cad18803f7ce9cc99a", "score": "0.6618513", "text": "func New(t LogPrinter, prefix string, flag int) *log.Logger {\n\treturn log.New(os.Stderr, prefix, flag)\n}", "title": "" }, { "docid": "25f16778011392318fd8fcb51a2b416d", "score": "0.6612663", "text": "func New(out io.Writer, prefix string, flag int) *Logger {\n\treturn &Logger{\n\t\tlog.New(out, prefix, flag),\n\t}\n}", "title": "" }, { "docid": "d630eacc663ae9226191b76327d6fc5c", "score": "0.66058147", "text": "func New(level Level, out, err io.Writer) Logger {\n\tif level == Silent {\n\t\treturn silent(0)\n\t}\n\n\tl := &writer{}\n\tswitch level {\n\tcase Debug:\n\t\tl.debug = log.New(out, \"DEBUG \", log.LstdFlags)\n\t\tfallthrough\n\tcase Info:\n\t\tl.info = log.New(out, \"INFO \", log.LstdFlags)\n\t\tfallthrough\n\tcase Error:\n\t\tl.err = log.New(err, \"ERROR \", log.LstdFlags)\n\t}\n\treturn l\n}", "title": "" }, { "docid": "5e4b0618217a3242f500c7c1f26065d7", "score": "0.6605745", "text": "func New(ctx ...interface{}) Logger {\n\treturn root.New(ctx...)\n}", "title": "" }, { "docid": "2ba5c24d959eeffbf3adb5cfbc9e8381", "score": "0.6604642", "text": "func New() *SimpleLogger {\n\treturn &SimpleLogger{}\n}", "title": "" }, { "docid": "5668f53fc42c8d20419383fb2e052707", "score": "0.6598634", "text": "func NewLogger(debugEnabled bool, debugOut, infoOut, warningOut, errorOut io.Writer) *Logger {\n\treturn &Logger{\n\t\tdebugEnabled: debugEnabled,\n\t\tdebugLog: log.New(debugOut, \"[DEBUG] \", log.Ldate|log.Ltime),\n\t\tinfoLog: log.New(infoOut, \"[INFO] \", log.Ldate|log.Ltime),\n\t\tprintLog: log.New(infoOut, \"\", 0),\n\t\twarningLog: log.New(warningOut, \"[WARN] \", log.Ldate|log.Ltime),\n\t\terrorLog: log.New(errorOut, \"[ERROR] \", log.Ldate|log.Ltime),\n\t}\n}", "title": "" }, { "docid": "01ce59e3699acee92a62a86537281218", "score": "0.6592793", "text": "func NewLogger(options ...Option) (*Logger, error) {\n\toptions = append(options, logr.StackFilter(logr.GetPackageName(\"NewLogger\")))\n\n\tlgr, err := logr.New(options...)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\tlog := lgr.NewLogger()\n\tvar lockConfig int32\n\n\treturn &Logger{\n\t\tlog: &log,\n\t\tlockConfig: &lockConfig,\n\t}, nil\n}", "title": "" }, { "docid": "20486727b14ff3bba5ded5e34a070111", "score": "0.6590108", "text": "func NewDebugLogger(dest io.Writer) *DefaultDebugLogger {\n\treturn &DefaultDebugLogger{\n\t\tbaseLogger{\n\t\t\tdest: dest,\n\t\t\tlog: log.New(dest, \"DEBUG \", debugLogFlags),\n\t\t},\n\t}\n}", "title": "" }, { "docid": "d9c4b3d3f9444fc3bea103088e619828", "score": "0.6589198", "text": "func New(logger *log.Logger) logr.Logger {\n\tl := *logger\n\treturn logr.New(logSink{\"\", nil, &l})\n}", "title": "" }, { "docid": "f57e064fbecc830245ea29d7190eab77", "score": "0.65880316", "text": "func New(out io.Writer) *Logger {\n\tlogger := zerolog.New(out).Level(zerolog.InfoLevel)\n\treturn &Logger{\n\t\tinternal: logger,\n\t\tkeys: frozen.NewSet[string](\"level\", \"message\"), // prevents these fields from being duplicated\n\t\tcodeLinks: false,\n\t}\n}", "title": "" }, { "docid": "b40cc208d6f7327a04e1ef7a2a6c4dfd", "score": "0.6587042", "text": "func New(c Config) Logger {\n\tif c.Output == nil {\n\t\tc.Output = os.Stdout\n\t}\n\tzerolog.CallerFieldName = \"file\"\n\tzerolog.CallerSkipFrameCount = 5\n\tzerolog.TimeFieldFormat = time.RFC3339Nano\n\tvar l = zerolog.New(c.Output).With().Caller().Timestamp().Logger().Level(levelFromString(c.Level))\n\tif c.HumanReadable {\n\t\tl = l.Output(zerolog.ConsoleWriter{Out: os.Stdout})\n\t}\n\treturn &logger{\n\t\tc: c,\n\t\tl: l,\n\t\tfields: &sync.Map{},\n\t}\n}", "title": "" }, { "docid": "c194011616198112265e2a584481cfe9", "score": "0.6583534", "text": "func New(c *Config) Logger {\n\treturn NewWithWriter(nil, c)\n}", "title": "" }, { "docid": "7b1126ef75d6a5fa911fc3805ffef78f", "score": "0.6582751", "text": "func New(stream io.Writer, config Config) Modular {\n\tif !config.JSONFormat {\n\t\tconfig.Format = \"deprecated\"\n\t}\n\n\tlogger := Logger{\n\t\tstream: stream,\n\t\tconfig: config,\n\t\tlevel: logLevelToInt(config.LogLevel),\n\t}\n\n\tlogger.formatter, _ = getFormatter(config)\n\tif logger.formatter == nil {\n\t\tlogger.formatter = deprecatedFormatter(config)\n\t}\n\treturn &logger\n}", "title": "" } ]
5e25e852e751e484a4773eb1f75e04cf
Node implements response to request for 'node' field.
[ { "docid": "9d512398f8a8e732e8fb24e4362b756f", "score": "0.6511744", "text": "func (r *queryImpl) Node(p schema.QueryNodeFieldResolverParams) (interface{}, error) {\n\tresolver := r.nodeResolver\n\treturn resolver.Find(p.Context, p.Args.ID, p.Info)\n}", "title": "" } ]
[ { "docid": "f3aa7cd9a347fd5f27c2e18b802c2811", "score": "0.711266", "text": "func (c *Catalog) Node(node string, q *QueryOptions) (*CatalogNode, *QueryMeta, error) {\n\tr := c.c.newRequest(\"GET\", \"/v1/catalog/node/\"+node)\n\tr.setQueryOptions(q)\n\trtt, resp, err := c.c.doRequest(r)\n\tif err != nil {\n\t\treturn nil, nil, err\n\t}\n\tdefer closeResponseBody(resp)\n\tif err := requireOK(resp); err != nil {\n\t\treturn nil, nil, err\n\t}\n\n\tqm := &QueryMeta{}\n\tparseQueryMeta(resp, qm)\n\tqm.RequestTime = rtt\n\n\tvar out *CatalogNode\n\tif err := decodeBody(resp, &out); err != nil {\n\t\treturn nil, nil, err\n\t}\n\treturn out, qm, nil\n}", "title": "" }, { "docid": "d39d3bdf985ac0654df9b77fd7eff29b", "score": "0.7093514", "text": "func NodeGet(w http.ResponseWriter, r *http.Request) {\n\tw.Header().Set(\"Content-Type\", \"application/json; charset=UTF-8\")\n\n\tif &node != nil {\n\t\tw.WriteHeader(200)\n\t\tif err := json.NewEncoder(w).Encode(node); err != nil {\n\t\t\tpanic(err)\n\t\t}\n\t} else {\n\t\tparamError := swl.ParamError{\n\t\t\tError: \"Node not found\",\n\t\t}\n\t\tw.WriteHeader(404)\n\t\tif err := json.NewEncoder(w).Encode(paramError); err != nil {\n\t\t\tpanic(err)\n\t\t}\n\t}\n}", "title": "" }, { "docid": "a9e90dafaf1e1769f052d2beac62a40b", "score": "0.6929861", "text": "func nodeResponse(name string, hasError bool, children []map[string]interface{}) *visitResponse {\n\tif hasError {\n\t\treturn &visitResponse{\n\t\t\tnode: parentNode(name, errorColor, children),\n\t\t\tfailed: true,\n\t\t}\n\t}\n\n\treturn &visitResponse{\n\t\tnode: parentNode(name, successColor, children),\n\t\tfailed: false,\n\t}\n}", "title": "" }, { "docid": "895b65a650a608e6ad07edbf5efddeaa", "score": "0.68445086", "text": "func (r *queryResolver) Node(ctx context.Context, id int) (ent.Noder, error) {\n\treturn ent.FromContext(ctx).Noder(ctx, id)\n}", "title": "" }, { "docid": "69b4a5ea4fb7ad50a0a6817312217393", "score": "0.6827251", "text": "func (a API) Node(cmd *btcjson.NodeCmd) (e error) {\n\tRPCHandlers[\"node\"].Call <-API{a.Ch, cmd, nil}\n\treturn\n}", "title": "" }, { "docid": "875678518b8d55460536f2a1de1b2fa6", "score": "0.6650975", "text": "func (s *FutureTree) Node() *restic.Node {\n\treturn s.res.node\n}", "title": "" }, { "docid": "690768935034cf3ae73afb7786e9d912", "score": "0.6551846", "text": "func (u *uploader) Node(req UploadRequest) proto.Message {\n\tkey := req.Path.String() + req.Exclude.String()\n\tn, ok := u.nodeCache.Load(key)\n\tif !ok {\n\t\treturn nil\n\t}\n\tnode, ok := n.(proto.Message)\n\tif !ok {\n\t\treturn nil\n\t}\n\treturn node\n}", "title": "" }, { "docid": "3fa8b7c5e167e4fff3f928dcc9a98094", "score": "0.63244605", "text": "func (api APIv1) NodeHandler(w http.ResponseWriter, r *http.Request) {\n\twr := &HTTPResponder{w, r, \"application/json\"}\n\tpath := r.URL.Path[len(\"/api/v1/tree/\"):]\n\n\tif err := checkSafePath(path, api.tree.path); err != nil {\n\t\twr.Error(HTTPErrUnsafePath, err)\n\t\treturn\n\t}\n\n\tok, n, err := api.tree.Get(path)\n\tif err != nil {\n\t\twr.Error(HTTPErr, err)\n\t\treturn\n\t}\n\tif !ok {\n\t\twr.Error(HTTPErrNoSuchNode, nil)\n\t\treturn\n\t}\n\n\tif wr.Cached(n.Hash) {\n\t\treturn\n\t}\n\n\tan, err := api.NewNode(n)\n\tif err != nil {\n\t\twr.Error(HTTPErr, err)\n\t\treturn\n\t}\n\twr.Cache(n.Hash)\n\twr.OK(an)\n}", "title": "" }, { "docid": "b0f1949ae8d48596707d5d2a12185014", "score": "0.6230033", "text": "func Node(jsonData []byte, model interface{}) error {\n\tvar result struct {\n\t\tData []json.RawMessage\n\t}\n\n\tif err := json.Unmarshal(jsonData, &result); err != nil {\n\t\treturn err\n\t}\n\n\tif len(result.Data) == 0 {\n\t\treturn ErrNodeNotFound\n\t}\n\n\tval := result.Data[0]\n\tif err := json.Unmarshal(val, model); err != nil {\n\t\treturn err\n\t}\n\n\treturn nil\n}", "title": "" }, { "docid": "e5024846b1b5dbb3f49d6dd4c7e6c1bd", "score": "0.615902", "text": "func (c *Composite) Node() *js.Object {\n\treturn c.Body.Node()\n}", "title": "" }, { "docid": "d956be5bf5a5f4a5bdd77220907773c2", "score": "0.6147863", "text": "func (a API) NodeGetRes() (out *None, e error) {\n\tout, _ = a.Result.(*None)\n\te, _ = a.Result.(error)\n\treturn \n}", "title": "" }, { "docid": "1bd6a6449325f74684f6d6f5c096009f", "score": "0.6146334", "text": "func (n *NodeInfo) Node() *v1.Node {\n\tif n == nil {\n\t\treturn nil\n\t}\n\treturn n.node\n}", "title": "" }, { "docid": "ea0316f9e36fb00372ca0fa2e0775864", "score": "0.61372656", "text": "func (n *nodeImpl) Node(args ...string) error {\n\treturn n.command(n.getNodePath(), args...)\n}", "title": "" }, { "docid": "75b87fc840d3428ad7a502a0cb6ad0d7", "score": "0.6093787", "text": "func (s *SimulationPaxosProtocol) Node(config *onet.SimulationConfig) error {\n\tindex, _ := config.Roster.Search(config.Server.ServerIdentity.ID)\n\tif index < 0 {\n\t\tlog.Fatal(\"Didn't find this node in roster\")\n\t}\n\tlog.Lvl3(\"Initializing node-index\", index)\n\treturn s.SimulationBFTree.Node(config)\n}", "title": "" }, { "docid": "1400914dfa80138ef80452ed7a999a8f", "score": "0.6091909", "text": "func (c *DOM) RequestNode(objectId string) (int, error) {\n\tvar v DOMRequestNodeParams\n\tv.ObjectId = objectId\n\treturn c.RequestNodeWithParams(&v)\n}", "title": "" }, { "docid": "0a5db530b8604f03618088be81d8bdf0", "score": "0.6039172", "text": "func (s *Server) GetNode(w http.ResponseWriter, req *http.Request) {\n\tnode := req.Context().Value(\"node\").(*peer.Node)\n\n\ts.JSON(w, http.StatusOK, node.ID)\n}", "title": "" }, { "docid": "d43c93cb0d1d76f24a3ce7e74788541e", "score": "0.6015148", "text": "func GetNode(id int) NodeResponse {\n\tvar node NodeResponse\n\tresponse := network.Get(fmt.Sprintf(\"admin/nodes/%d\", id))\n\tjson.Unmarshal(response, &node)\n\n\treturn node\n}", "title": "" }, { "docid": "8fc9933fcc99f36b5c17dc64367c3841", "score": "0.5992362", "text": "func (rb *ShardsRecordBuilder) Node(node string) *ShardsRecordBuilder {\n\trb.v.Node = node\n\treturn rb\n}", "title": "" }, { "docid": "963c5e738fc24569970f1fcf52a99feb", "score": "0.5986597", "text": "func (c *instance) Node(call NodeCall) error {\n\to := bind.NewKeyedTransactor(c.key)\n\n\t// gateway redirect to private chain\n\tclient, err := ethclient.Dial(config.ETHAddr())\n\tif err != nil {\n\t\treturn err\n\t}\n\tdefer client.Close()\n\tinstance, err := node.NewAccelerateNode(c.nodeAddr, client)\n\tif err != nil {\n\t\treturn err\n\t}\n\n\treturn call(instance, o)\n}", "title": "" }, { "docid": "1f274be6b9b64daf14d97622eeafbf3c", "score": "0.5969217", "text": "func (n *NameService) RequestNodeStatus(nodeID fred.NodeID) (kgs []fred.Item) {\n\n}", "title": "" }, { "docid": "a8320f7215d2394b48adebe14d87317d", "score": "0.59348726", "text": "func (n *Node) getNode() (*Node, error) {\n\tres, err := n.Talk(\"/node\", false, nil)\n\tif err != nil {\n\t\terr := errors.New(fmt.Sprintln(\"/node\", n.Nodestr, \"error\"))\n\t\treturn nil, err\n\t}\n\tif len(res) == 0 {\n\t\treturn nil, errors.New(\"no response\")\n\t}\n\treturn newNode(res[0])\n}", "title": "" }, { "docid": "58f5d3b04a4e097ad4691d98c6da849c", "score": "0.59291303", "text": "func NodeUpdate(w http.ResponseWriter, r *http.Request) {\n\tvar n swl.Node\n\tvar nameChanged bool\n\tvar ipChanged bool\n\n\tbody, err := ioutil.ReadAll(io.LimitReader(r.Body, 1048576))\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\tif err := r.Body.Close(); err != nil {\n\t\tpanic(err)\n\t}\n\n\tif !swl.ValidateAndUnmarshalJSON(body, &n, w) {\n\t\treturn\n\t}\n\n\tif n.Name != nil {\n\t\tnameChanged = true\n\t}\n\n\tif n.IP != nil {\n\t\tif !swl.ValidateParamRegex(\"ip\", node.IP,\n\t\t\t\"\\\\b((25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)(\\\\.|$)){4}\\\\b\", w) {\n\t\t\treturn\n\t\t}\n\t\tipChanged = true\n\t}\n\n\tif nameChanged {\n\t\tnode.Name = n.Name\n\t}\n\tif ipChanged {\n\t\tnode.IP = n.IP\n\t}\n\tw.Header().Set(\"Content-Type\", \"appliation/json; charset=UTF-8\")\n\tw.WriteHeader(200)\n\tif err := json.NewEncoder(w).Encode(node); err != nil {\n\t\tpanic(err)\n\t}\n}", "title": "" }, { "docid": "66b2d69812d0eaf15ec09648fef6af50", "score": "0.5928399", "text": "func (c *Client) NodeInfo() (*NodeInfoResponse, error) {\n\tbody := apiRequest{\n\t\tVersion: c.version,\n\t\tMethod: \"node.info\",\n\t}\n\n\tvar reply NodeInfoResponse\n\tif err := c.call(body, &reply); err != nil {\n\t\treturn nil, err\n\t}\n\n\treturn &reply, nil\n}", "title": "" }, { "docid": "8a15f9c2dabaf120a666898fb2e96a77", "score": "0.5916142", "text": "func Test(w http.ResponseWriter, r *http.Request) {\n\tfmt.Fprintln(w, \"Node is up\")\n\tn := GetNode()\n\tfmt.Printf(\"ID: %d\", n.ID)\n\tfmt.Printf(\"Name: %s\", *n.Name)\n\tfmt.Printf(\"IP: %s\", *n.IP)\n\tfmt.Printf(\"Enabled: %t\", n.Enabled)\n\tfmt.Printf(\"Clients: %d\", n.Clients)\n\tfmt.Printf(\"Added: %v\", n.Added)\n}", "title": "" }, { "docid": "e86c8d5b26bb3d0b895ed094d3ead229", "score": "0.58995205", "text": "func (d *nodeService) NodeGetInfo(ctx context.Context, req *csi.NodeGetInfoRequest) (*csi.NodeGetInfoResponse, error) {\n\tklog.V(6).Infof(\"NodeGetInfo: called with args %+v\", req)\n\n\treturn &csi.NodeGetInfoResponse{\n\t\tNodeId: d.nodeID,\n\t}, nil\n}", "title": "" }, { "docid": "7a2c91f4b2f2cfce1556c8c6f92561c2", "score": "0.5893991", "text": "func (e *Element) Node() *js.Object {\n\treturn e.node\n}", "title": "" }, { "docid": "1a6d5663ce9374ed4590c001c1a46587", "score": "0.58831245", "text": "func (fh *DirHandle) Node() Node {\n\treturn fh.d\n}", "title": "" }, { "docid": "5225df0f2ad03e01ec38be2751fad30f", "score": "0.5853935", "text": "func nodeHandler(w http.ResponseWriter, r *http.Request, gos *Gossiper) {\n\t// If GET send the peers in json format\n\tif r.Method == \"GET\" {\n\t\tgos.mutexs.peersMutex.Lock()\n\t\tpeers := NodesResponse{gos.peers}\n\t\tgos.mutexs.peersMutex.Unlock()\n\n\t\tjs, err := json.Marshal(peers)\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\tw.Write(js)\n\n\t\t// If POST get the ID and if it's new add it to the list of peers of the gossiper and send 200\n\t} else if r.Method == \"POST\" {\n\t\treqBody, err := ioutil.ReadAll(r.Body)\n\t\tif err != nil {\n\t\t\tlog.Fatal(err)\n\t\t}\n\n\t\taddr := string(reqBody)\n\n\t\t// If peer is new add it to the gossiper's peerster list\n\t\tgos.mutexs.peersMutex.Lock()\n\t\tif !strings.Contains(gos.peers, addr) {\n\t\t\tif gos.peers == \"\" {\n\t\t\t\tgos.peers = addr\n\t\t\t} else {\n\t\t\t\tauxPeers := strings.Split(gos.peers, \",\")\n\t\t\t\tauxPeers = append(auxPeers, addr)\n\t\t\t\tgos.peers = strings.Join(auxPeers, \",\")\n\t\t\t}\n\t\t}\n\t\tgos.mutexs.peersMutex.Unlock()\n\n\t\tw.WriteHeader(http.StatusOK)\n\t\tw.Write([]byte(\"200 OK\"))\n\n\t}\n}", "title": "" }, { "docid": "496efb45d278e94d4a17e2fdb7bc09b1", "score": "0.5835032", "text": "func doNode(w http.ResponseWriter, r *http.Request) {\n\ts, err := newServerCGI(w, r)\n\tif err != nil {\n\t\tlog.Println(err)\n\t\treturn\n\t}\n\tif s.NodeManager.ListLen() > 0 {\n\t\tfmt.Fprintln(w, s.NodeManager.GetNodestrSliceInTable(\"\")[0])\n\t} else {\n\t\tfmt.Fprintln(w, s.InitNode.GetData()[0])\n\t}\n}", "title": "" }, { "docid": "55059baf8b8217afbcdd4e2ee17de881", "score": "0.5826597", "text": "func (ec *executionContext) _Node(ctx context.Context, sel ast.SelectionSet, obj *Node) graphql.Marshaler {\n\tswitch obj := (*obj).(type) {\n\tcase nil:\n\t\treturn graphql.Null\n\t\t\tcase Individual:\n\t\t\t\treturn ec._Individual(ctx, sel, &obj)\n\t\tcase *Individual:\n\t\t\treturn ec._Individual(ctx, sel, obj)\n\tdefault:\n\t\tpanic(fmt.Errorf(\"unexpected type %T\", obj))\n\t}\n}", "title": "" }, { "docid": "82eda33b96077bbe0f2e7d821b198043", "score": "0.5817639", "text": "func (t T) Node() *node.T { return t.n }", "title": "" }, { "docid": "2b990306ff1268a019d5773263cb44c7", "score": "0.57910097", "text": "func (c *Client) queryNode(miniProtocol multiplex.MiniProtocol, dataItems []cbor.DataItem) (*multiplex.ServiceDataUnit, error) {\n\n\t// Step 1: Create message for the request\n\tsdu := multiplex.NewServiceDataUnit(miniProtocol, multiplex.MessageModeInitiator, dataItems)\n\tif log.IsLevelEnabled(log.DebugLevel) {\n\t\tlog.Debug(\"Multiplexed Request:\")\n\t\tfmt.Println(\">>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>> R E Q U E S T >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>\")\n\t\tfmt.Println(sdu.Debug())\n\t}\n\n\t// Step 2: Send the request\n\tmessageResponse, err := c.socket.Write(sdu.Bytes())\n\tif err != nil && err != io.EOF {\n\t\treturn nil, fmt.Errorf(\"Error writing to socket %w\", err)\n\t}\n\tif log.IsLevelEnabled(log.DebugLevel) && messageResponse != nil {\n\t\tlog.Debug(\"Multiplexed Response:\")\n\t\tfmt.Println(\"<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<< R E S P O N S E <<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<\")\n\t\tfmt.Println(messageResponse.Debug())\n\t}\n\n\treturn messageResponse, nil\n}", "title": "" }, { "docid": "e1b3b51be445582e3ccd29e5ac3751e4", "score": "0.5787686", "text": "func (o CatalogEntryOutput) Node() pulumi.StringOutput {\n\treturn o.ApplyT(func(v *CatalogEntry) pulumi.StringOutput { return v.Node }).(pulumi.StringOutput)\n}", "title": "" }, { "docid": "66d322e508f3dbdaf380c128041a7815", "score": "0.57715654", "text": "func (s *Store) Node(id uint64) (ni *NodeInfo, err error) {\n\terr = s.read(func(data *Data) error {\n\t\tni = data.Node(id)\n\t\tif ni == nil {\n\t\t\treturn errInvalidate\n\t\t}\n\t\treturn nil\n\t})\n\treturn\n}", "title": "" }, { "docid": "7756d3dd99a46dea15c6b8a37568fa8b", "score": "0.5768336", "text": "func (ns *NodeServer) NodeGetInfo(ctx context.Context, req *csi.NodeGetInfoRequest) (*csi.NodeGetInfoResponse, error) {\n\treturn &csi.NodeGetInfoResponse{\n\t\tNodeId: ns.Driver.nodeID,\n\t}, nil\n}", "title": "" }, { "docid": "103f8b11d09e3b179016a94980010c6b", "score": "0.576017", "text": "func (ec *executionContext) _Node(ctx context.Context, sel ast.SelectionSet, obj model.Node) graphql.Marshaler {\n\tswitch obj := (obj).(type) {\n\tcase nil:\n\t\treturn graphql.Null\n\tcase model.Brand:\n\t\treturn ec._Brand(ctx, sel, &obj)\n\tcase *model.Brand:\n\t\tif obj == nil {\n\t\t\treturn graphql.Null\n\t\t}\n\t\treturn ec._Brand(ctx, sel, obj)\n\tcase model.Car:\n\t\treturn ec._Car(ctx, sel, &obj)\n\tcase *model.Car:\n\t\tif obj == nil {\n\t\t\treturn graphql.Null\n\t\t}\n\t\treturn ec._Car(ctx, sel, obj)\n\tdefault:\n\t\tpanic(fmt.Errorf(\"unexpected type %T\", obj))\n\t}\n}", "title": "" }, { "docid": "39f1d79c1d97b8b90083ec60dc5097c4", "score": "0.5719026", "text": "func (c *Conn) GetNode(path ...NodeName) (Node, error) {\n\tvar node Node\n\terr := c.Request(\"get\", &node, pathToArgs(path)...)\n\treturn node, err\n}", "title": "" }, { "docid": "09511f4756beab7dc8029b747e41dd62", "score": "0.57079685", "text": "func (p *Plugin) NodeGetInfo(\n\tctx context.Context,\n\treq *csi.NodeGetInfoRequest) (\n\t*csi.NodeGetInfoResponse, error) {\n\n\tglog.Info(\"start to GetNodeInfo\")\n\tdefer glog.Info(\"end to GetNodeInfo\")\n\n\tif client == nil {\n\t\tmsg := \"client is nil\"\n\t\tglog.Error(msg)\n\t\treturn nil, status.Error(codes.InvalidArgument, msg)\n\t}\n\n\thostName, err := connector.GetHostName()\n\tif err != nil {\n\t\tmsg := fmt.Sprintf(\"failed to get node name %v\", err)\n\t\tglog.Error(msg)\n\t\treturn nil, status.Error(codes.FailedPrecondition, msg)\n\t}\n\n\tvar initiators []string\n\n\tvolDriverTypes := []string{connector.FcDriver, connector.IscsiDriver}\n\n\tfor _, volDriverType := range volDriverTypes {\n\t\tvolDriver := connector.NewConnector(volDriverType)\n\t\tif volDriver == nil {\n\t\t\tglog.Errorf(\"unsupport volDriver: %s\", volDriverType)\n\t\t\tcontinue\n\t\t}\n\n\t\tinitiator, err := volDriver.GetInitiatorInfo()\n\t\tif err != nil {\n\t\t\tglog.Errorf(\"cannot get initiator for driver volume type %s, err: %v\", volDriverType, err)\n\t\t\tcontinue\n\t\t}\n\n\t\tinitiators = append(initiators, initiator)\n\t}\n\n\tif len(initiators) == 0 {\n\t\tmsg := fmt.Sprintf(\"cannot get any initiator for host %s\", hostName)\n\t\tglog.Error(msg)\n\t\treturn nil, status.Error(codes.FailedPrecondition, msg)\n\t}\n\n\tnodeId := hostName + \",\" + strings.Join(initiators, \",\")\n\n\tglog.Infof(\"node info is %s\", nodeId)\n\n\treturn &csi.NodeGetInfoResponse{\n\t\tNodeId: nodeId,\n\t}, nil\n}", "title": "" }, { "docid": "125f19ba2ee8318766ee3d9bc8210816", "score": "0.5682157", "text": "func (network *Network) handleNodeLookupResponse(sender *KademliaID, message *NetworkMessage.ValueResponse) {\n\tshortlist := network.nodeLookupTable.Pop(NewKademliaID(message.RandomId))\n\tfmt.Println(\"Handline Node/Value lookup response from \" + sender.String())\n\tif shortlist != nil {\n\t\tshortlist.HandleResponse(network, sender, message)\n\t} else {\n\t\tfmt.Println(\"Tried to handle the response from \" + sender.String() + \" but nodeLookupTable returned nil.\")\n\t}\n\n}", "title": "" }, { "docid": "7b5ce8e9766cbf51482bd31744e9ce9a", "score": "0.5661295", "text": "func print_node(node *Node) {\n fmt.Printf(\"%v\\n\", node)\n}", "title": "" }, { "docid": "3b45782e3d94882fde51e73b5a4f9452", "score": "0.5654964", "text": "func (g *Graph) Node(gvk schema.GroupVersionKind, obj metav1.Object) *Node {\n\tapiVersion, kind := gvk.ToAPIVersionAndKind()\n\tnode := &Node{\n\t\tTypeMeta: metav1.TypeMeta{\n\t\t\tAPIVersion: apiVersion,\n\t\t\tKind: kind,\n\t\t},\n\t\tObjectMeta: metav1.ObjectMeta{\n\t\t\tUID: obj.GetUID(),\n\t\t\tNamespace: obj.GetNamespace(),\n\t\t\tName: obj.GetName(),\n\t\t\tAnnotations: FilterByValue(obj.GetAnnotations(), func(v string) bool {\n\t\t\t\treturn !strings.HasPrefix(v, \"{\") && !strings.HasPrefix(v, \"[\")\n\t\t\t}),\n\t\t\tLabels: obj.GetLabels(),\n\t\t},\n\t}\n\n\tif n, ok := g.Nodes[obj.GetUID()]; ok {\n\t\tif len(n.GetAnnotations()) != 0 {\n\t\t\tnode.SetAnnotations(n.GetAnnotations())\n\t\t}\n\t\tif len(n.GetLabels()) != 0 {\n\t\t\tnode.SetLabels(n.GetLabels())\n\t\t}\n\t}\n\n\tg.Nodes[obj.GetUID()] = node\n\n\tfor _, ownerRef := range obj.GetOwnerReferences() {\n\t\towner := g.Node(\n\t\t\tschema.FromAPIVersionAndKind(ownerRef.APIVersion, ownerRef.Kind),\n\t\t\t&metav1.ObjectMeta{\n\t\t\t\tUID: ownerRef.UID,\n\t\t\t\tName: ownerRef.Name,\n\t\t\t\tNamespace: obj.GetNamespace(),\n\t\t\t},\n\t\t)\n\t\tg.Relationship(owner, kind, node)\n\t}\n\n\treturn node\n}", "title": "" }, { "docid": "1e28cd8633b95571e573ffebf5f65910", "score": "0.5653276", "text": "func (a *FileStorageApiService) GetNodeExecute(r ApiGetNodeRequest) (SingleNode, *_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 SingleNode\n\t)\n\n\tlocalBasePath, err := a.client.cfg.ServerURLWithContext(r.Ctx, \"FileStorageApiService.GetNode\")\n\tif localBasePath == \"/\" {\n\t localBasePath = \"\"\n\t}\n\tif err != nil {\n\t\treturn localVarReturnValue, nil, GenericOpenAPIError{error: err.Error()}\n\t}\n\n\tlocalVarPath := localBasePath + \"/v2/file_storage/buckets/{bucket_id}/nodes/{node_id}\"\n\tlocalVarPath = strings.Replace(localVarPath, \"{\"+\"bucket_id\"+\"}\", _neturl.PathEscape(parameterToString(r.P_bucketId, \"\")) , -1)\n\tlocalVarPath = strings.Replace(localVarPath, \"{\"+\"node_id\"+\"}\", _neturl.PathEscape(parameterToString(r.P_nodeId, \"\")) , -1)\n\n\tlocalVarHeaderParams := make(map[string]string)\n\tlocalVarQueryParams := _neturl.Values{}\n\tlocalVarFormParams := _neturl.Values{}\n\n\tif r.P_directorySize != nil {\n\t\tlocalVarQueryParams.Add(\"directory_size\", parameterToString(*r.P_directorySize, \"\"))\n\t}\n\t// to determine the Content-Type header\n\tlocalVarHTTPContentTypes := []string{}\n\n\t// set Content-Type header\n\tlocalVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes)\n\tif localVarHTTPContentType != \"\" {\n\t\tlocalVarHeaderParams[\"Content-Type\"] = localVarHTTPContentType\n\t}\n\n\t// to determine the Accept header\n\tlocalVarHTTPHeaderAccepts := []string{\"application/json\"}\n\n\t// set Accept header\n\tlocalVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts)\n\tif localVarHTTPHeaderAccept != \"\" {\n\t\tlocalVarHeaderParams[\"Accept\"] = localVarHTTPHeaderAccept\n\t}\n\treq, err := a.client.prepareRequest(r.Ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes)\n\tif err != nil {\n\t\treturn localVarReturnValue, nil, err\n\t}\n\n\tlocalVarHTTPResponse, err := a.client.callAPI(req)\n\tif err != nil || localVarHTTPResponse == nil {\n\t\treturn localVarReturnValue, localVarHTTPResponse, err\n\t}\n\n\tlocalVarBody, err := _ioutil.ReadAll(localVarHTTPResponse.Body)\n\tlocalVarHTTPResponse.Body.Close()\n\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": "8a6f90a34a6df76307c9c8b5c25ba288", "score": "0.56298804", "text": "func (s *NodeService) Status(ctx context.Context) (*GetNodeStatus, *http.Response, error) {\n\tvar responseStruct *GetNodeStatus\n\tresp, err := s.client.SendRequest(ctx, \"GET\", \"node/status\", nil, nil, &responseStruct)\n\n\tif err != nil {\n\t\treturn nil, resp, err\n\t}\n\n\treturn responseStruct, resp, err\n}", "title": "" }, { "docid": "ecfe48dd87dfbc30f60a1e648e70bc07", "score": "0.56268686", "text": "func (ec *executionContext) _Node(ctx context.Context, sel ast.SelectionSet, obj ent.Noder) graphql.Marshaler {\n\tswitch obj := (obj).(type) {\n\tcase nil:\n\t\treturn graphql.Null\n\tcase *ent.Location:\n\t\tif obj == nil {\n\t\t\treturn graphql.Null\n\t\t}\n\t\treturn ec._Location(ctx, sel, obj)\n\tcase *ent.LocationType:\n\t\tif obj == nil {\n\t\t\treturn graphql.Null\n\t\t}\n\t\treturn ec._LocationType(ctx, sel, obj)\n\tcase *ent.File:\n\t\tif obj == nil {\n\t\t\treturn graphql.Null\n\t\t}\n\t\treturn ec._File(ctx, sel, obj)\n\tcase *ent.Comment:\n\t\tif obj == nil {\n\t\t\treturn graphql.Null\n\t\t}\n\t\treturn ec._Comment(ctx, sel, obj)\n\tcase *ent.Equipment:\n\t\tif obj == nil {\n\t\t\treturn graphql.Null\n\t\t}\n\t\treturn ec._Equipment(ctx, sel, obj)\n\tcase *ent.EquipmentType:\n\t\tif obj == nil {\n\t\t\treturn graphql.Null\n\t\t}\n\t\treturn ec._EquipmentType(ctx, sel, obj)\n\tcase *ent.EquipmentPositionDefinition:\n\t\tif obj == nil {\n\t\t\treturn graphql.Null\n\t\t}\n\t\treturn ec._EquipmentPositionDefinition(ctx, sel, obj)\n\tcase *ent.EquipmentPosition:\n\t\tif obj == nil {\n\t\t\treturn graphql.Null\n\t\t}\n\t\treturn ec._EquipmentPosition(ctx, sel, obj)\n\tcase *ent.EquipmentPortType:\n\t\tif obj == nil {\n\t\t\treturn graphql.Null\n\t\t}\n\t\treturn ec._EquipmentPortType(ctx, sel, obj)\n\tcase *ent.EquipmentPortDefinition:\n\t\tif obj == nil {\n\t\t\treturn graphql.Null\n\t\t}\n\t\treturn ec._EquipmentPortDefinition(ctx, sel, obj)\n\tcase *ent.EquipmentPort:\n\t\tif obj == nil {\n\t\t\treturn graphql.Null\n\t\t}\n\t\treturn ec._EquipmentPort(ctx, sel, obj)\n\tcase *ent.PropertyType:\n\t\tif obj == nil {\n\t\t\treturn graphql.Null\n\t\t}\n\t\treturn ec._PropertyType(ctx, sel, obj)\n\tcase *ent.Property:\n\t\tif obj == nil {\n\t\t\treturn graphql.Null\n\t\t}\n\t\treturn ec._Property(ctx, sel, obj)\n\tcase *ent.Link:\n\t\tif obj == nil {\n\t\t\treturn graphql.Null\n\t\t}\n\t\treturn ec._Link(ctx, sel, obj)\n\tcase *ent.WorkOrderDefinition:\n\t\tif obj == nil {\n\t\t\treturn graphql.Null\n\t\t}\n\t\treturn ec._WorkOrderDefinition(ctx, sel, obj)\n\tcase *ent.WorkOrderType:\n\t\tif obj == nil {\n\t\t\treturn graphql.Null\n\t\t}\n\t\treturn ec._WorkOrderType(ctx, sel, obj)\n\tcase *ent.WorkOrder:\n\t\tif obj == nil {\n\t\t\treturn graphql.Null\n\t\t}\n\t\treturn ec._WorkOrder(ctx, sel, obj)\n\tcase *ent.ProjectType:\n\t\tif obj == nil {\n\t\t\treturn graphql.Null\n\t\t}\n\t\treturn ec._ProjectType(ctx, sel, obj)\n\tcase *ent.Project:\n\t\tif obj == nil {\n\t\t\treturn graphql.Null\n\t\t}\n\t\treturn ec._Project(ctx, sel, obj)\n\tcase *ent.Customer:\n\t\tif obj == nil {\n\t\t\treturn graphql.Null\n\t\t}\n\t\treturn ec._Customer(ctx, sel, obj)\n\tcase *ent.ServiceEndpoint:\n\t\tif obj == nil {\n\t\t\treturn graphql.Null\n\t\t}\n\t\treturn ec._ServiceEndpoint(ctx, sel, obj)\n\tcase *ent.Service:\n\t\tif obj == nil {\n\t\t\treturn graphql.Null\n\t\t}\n\t\treturn ec._Service(ctx, sel, obj)\n\tcase *ent.ServiceType:\n\t\tif obj == nil {\n\t\t\treturn graphql.Null\n\t\t}\n\t\treturn ec._ServiceType(ctx, sel, obj)\n\tcase *ent.Survey:\n\t\tif obj == nil {\n\t\t\treturn graphql.Null\n\t\t}\n\t\treturn ec._Survey(ctx, sel, obj)\n\tcase *ent.FloorPlan:\n\t\tif obj == nil {\n\t\t\treturn graphql.Null\n\t\t}\n\t\treturn ec._FloorPlan(ctx, sel, obj)\n\tcase *ent.SurveyTemplateQuestion:\n\t\tif obj == nil {\n\t\t\treturn graphql.Null\n\t\t}\n\t\treturn ec._SurveyTemplateQuestion(ctx, sel, obj)\n\tcase *ent.SurveyTemplateCategory:\n\t\tif obj == nil {\n\t\t\treturn graphql.Null\n\t\t}\n\t\treturn ec._SurveyTemplateCategory(ctx, sel, obj)\n\tcase *ent.SurveyQuestion:\n\t\tif obj == nil {\n\t\t\treturn graphql.Null\n\t\t}\n\t\treturn ec._SurveyQuestion(ctx, sel, obj)\n\tcase *ent.SurveyWiFiScan:\n\t\tif obj == nil {\n\t\t\treturn graphql.Null\n\t\t}\n\t\treturn ec._SurveyWiFiScan(ctx, sel, obj)\n\tcase *ent.SurveyCellScan:\n\t\tif obj == nil {\n\t\t\treturn graphql.Null\n\t\t}\n\t\treturn ec._SurveyCellScan(ctx, sel, obj)\n\tcase *ent.ActionsRule:\n\t\tif obj == nil {\n\t\t\treturn graphql.Null\n\t\t}\n\t\treturn ec._ActionsRule(ctx, sel, obj)\n\tdefault:\n\t\tpanic(fmt.Errorf(\"unexpected type %T\", obj))\n\t}\n}", "title": "" }, { "docid": "3994874584758de64453eebd3029881a", "score": "0.5602186", "text": "func (d *Driver) NodeGetInfo(ctx context.Context, request *csi.NodeGetInfoRequest) (*csi.NodeGetInfoResponse, error) {\n\td.log.WithField(\"method\", \"node_get_info\").Info(\"node get info called\")\n\treturn &csi.NodeGetInfoResponse{\n\t\tNodeId: d.nodeId,\n\t\tMaxVolumesPerNode: _defaultMaxAzureVolumeLimit,\n\n\t\t// make sure that the driver works on this particular region only\n\t\tAccessibleTopology: &csi.Topology{\n\t\t\tSegments: map[string]string{\n\t\t\t\t\"location\": d.az.Location,\n\t\t\t},\n\t\t},\n\t}, nil\n}", "title": "" }, { "docid": "1a30c79fbfa017073bb3092eda9cb5c5", "score": "0.5591793", "text": "func (ns *nodeServer) NodeGetInfo(ctx context.Context, req *csi.NodeGetInfoRequest) (*csi.NodeGetInfoResponse, error) {\n\ttopology := &csi.Topology{\n\t\tSegments: map[string]string{TopologyKeyNode: ns.nodeID},\n\t}\n\n\treturn &csi.NodeGetInfoResponse{\n\t\tNodeId: \tns.nodeID,\n\t\tMaxVolumesPerNode: ns.maxVolumePerNode,\n\t\tAccessibleTopology: topology,\n\t}, nil\n}", "title": "" }, { "docid": "b003a4de62f88039190cbfb8f691cbf1", "score": "0.5581323", "text": "func RequestNodeInfo(node *Node, name ...string) (map[string]string, error) {\n\tconn, err := node.GetConnection(_DEFAULT_TIMEOUT)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\tresponse, err := RequestInfo(conn, name...)\n\tif err != nil {\n\t\tconn.Close()\n\t\treturn nil, err\n\t}\n\tnode.PutConnection(conn)\n\treturn response, nil\n}", "title": "" }, { "docid": "21c9fa5f1b1515da6b288b0480561e0c", "score": "0.558132", "text": "func Node(n audio.Node) Option {\n\treturn func(args *Options) {\n\t\targs.Nodes = append(args.Nodes, n)\n\t}\n}", "title": "" }, { "docid": "e41377eadf7b7a49b1a488f3a8e74b36", "score": "0.5580955", "text": "func (g *nodeGraph) Node(id nodeID) *node {\n\treturn g.nodeContainer.getNode(id)\n}", "title": "" }, { "docid": "d9012177843420ed10ce84bb7dd17761", "score": "0.5571288", "text": "func (r *queryImpl) WrappedNode(p schema.QueryWrappedNodeFieldResolverParams) (interface{}, error) {\n\tresolver := r.nodeResolver\n\tres, err := resolver.Find(p.Context, p.Args.ID, p.Info)\n\tif rres, ok := res.(corev2.Resource); ok {\n\t\treturn types.WrapResource(rres), err\n\t}\n\treturn nil, err\n}", "title": "" }, { "docid": "5edfe41e03017b1f158f6988ee2c5dfa", "score": "0.5560214", "text": "func getNode(nd *wssdcloud.Node) *cloud.Node {\n\treturn &cloud.Node{\n\t\tName: &nd.Name,\n\t\tLocation: &nd.LocationName,\n\t\tNodeProperties: &cloud.NodeProperties{\n\t\t\tFQDN: &nd.Fqdn,\n\t\t\tPort: &nd.Port,\n\t\t\tAuthorizerPort: &nd.AuthorizerPort,\n\t\t\tCertificate: &nd.Certificate,\n\t\t\tStatuses: getNodeStatuses(nd),\n\t\t},\n\t\tVersion: &nd.Status.Version.Number,\n\t}\n}", "title": "" }, { "docid": "08af5c9f6fb07f2caaaee40f0118263f", "score": "0.5558242", "text": "func NodeHandler(ctx context.Context, node *corev1.Node, options Options) (component.Component, error) {\n\to := NewObject(node)\n\n\tnh, err := newNodeHandler(node, o)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\tif err := nh.Config(options); err != nil {\n\t\treturn nil, errors.Wrap(err, \"print node configuration\")\n\t}\n\tif err := nh.Addresses(options); err != nil {\n\t\treturn nil, errors.Wrap(err, \"print node addresses\")\n\t}\n\tif err := nh.Resources(options); err != nil {\n\t\treturn nil, errors.Wrap(err, \"print node resources\")\n\t}\n\tif err := nh.Conditions(options); err != nil {\n\t\treturn nil, errors.Wrap(err, \"print node conditions\")\n\t}\n\tif err := nh.Images(options); err != nil {\n\t\treturn nil, errors.Wrap(err, \"print node images\")\n\t}\n\treturn o.ToComponent(ctx, options)\n}", "title": "" }, { "docid": "aed61eafac61ff84e717fc8aa100db05", "score": "0.5546407", "text": "func (d *Document) Node(id uint) Node {\n\treturn Node{id, d.rev, d}\n}", "title": "" }, { "docid": "a44cadb34de556f728dc7b0a8715a34f", "score": "0.554002", "text": "func (d *Driver) NodeGetInfo(ctx context.Context, req *csi.NodeGetInfoRequest) (*csi.NodeGetInfoResponse, error) {\n\td.log.WithField(\"method\", \"node_get_info\").Info(\"node get info called\")\n\treturn &csi.NodeGetInfoResponse{\n\t\tNodeId: d.hostID(),\n\t\tMaxVolumesPerNode: maxVolumesPerNode,\n\n\t\t// make sure that the driver works on this particular region only\n\t\tAccessibleTopology: &csi.Topology{\n\t\t\tSegments: map[string]string{\n\t\t\t\t\"region\": d.region,\n\t\t\t},\n\t\t},\n\t}, nil\n}", "title": "" }, { "docid": "bb1f154172e889dc0003b7839dfa9c72", "score": "0.5536742", "text": "func (a *Client) NodeInspect(params *NodeInspectParams) (*NodeInspectOK, error) {\n\t// TODO: Validate the params before sending\n\tif params == nil {\n\t\tparams = NewNodeInspectParams()\n\t}\n\n\tresult, err := a.transport.Submit(&runtime.ClientOperation{\n\t\tID: \"NodeInspect\",\n\t\tMethod: \"GET\",\n\t\tPathPattern: \"/nodes/{id}\",\n\t\tProducesMediaTypes: []string{\"application/json\", \"text/plain\"},\n\t\tConsumesMediaTypes: []string{\"application/json\", \"text/plain\"},\n\t\tSchemes: []string{\"http\", \"https\"},\n\t\tParams: params,\n\t\tReader: &NodeInspectReader{formats: a.formats},\n\t\tContext: params.Context,\n\t\tClient: params.HTTPClient,\n\t})\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\treturn result.(*NodeInspectOK), nil\n\n}", "title": "" }, { "docid": "b8dd249b5be78506ab302d0d34db1061", "score": "0.55307996", "text": "func (g Undirect) Node(id int64) Node { return g.G.Node(id) }", "title": "" }, { "docid": "5649f5e56b8a476af089f4c2044198ae", "score": "0.5522522", "text": "func (p *peer) NodeInfo() NodeInfo {\r\n\treturn p.nodeInfo\r\n}", "title": "" }, { "docid": "c7e23fd098fa8d3598aa2587b0ddd3a6", "score": "0.5489857", "text": "func getNode(ctx context.Context, client client.Interface, nodeName string) *libapi.Node {\n\tnode, err := client.Nodes().Get(ctx, nodeName, options.GetOptions{})\n\tif err != nil {\n\t\tif _, ok := err.(cerrors.ErrorResourceDoesNotExist); !ok {\n\t\t\tlog.WithError(err).WithField(\"Name\", nodeName).Info(\"Unable to query node configuration\")\n\t\t\tlog.Warn(\"Unable to access datastore to query node configuration\")\n\t\t\tutils.Terminate()\n\t\t}\n\n\t\tlog.WithField(\"Name\", nodeName).Info(\"Building new node resource\")\n\t\tnode = libapi.NewNode()\n\t\tnode.Name = nodeName\n\t}\n\n\treturn node\n}", "title": "" }, { "docid": "39294f87f0570fc99057ee652eaab313", "score": "0.5489636", "text": "func (gen *Db) node(id string) (*data.Node, error) {\n\tvar node *data.Node\n\terr := gen.store.View(func(tx *genji.Tx) error {\n\t\tvar err error\n\t\tnode, err = txNode(tx, id)\n\t\treturn err\n\t})\n\treturn node, err\n}", "title": "" }, { "docid": "94460e83775908b904a1bab4e1197b53", "score": "0.54890746", "text": "func getNode(ex SessionExecutor, msg CommonMessage) (rep CommonReply) {\n\tnodeMsg := msg.(nodeMessage)\n\n\tselectNodeTmpl := ex.getQuery(selectNodeOp)\n\tcn := newNode()\n\trows, err := ex.Query(fmt.Sprintf(selectNodeTmpl, nodeMsg.GetNodeTable()))\n\tif err != nil {\n\t\tdbLogger.Errorf(\"getNode query error:%s\", err)\n\t\treturn newNodeReply(nil, err)\n\t}\n\tdefer closeRowsAndLog(rows)\n\n\tfor rows.Next() {\n\t\terr := rows.Scan(&cn.name, &cn.ip, &cn.isCollector, &cn.duration, &cn.description, &cn.coords, &cn.address)\n\t\tif err != nil {\n\t\t\tdbLogger.Errorf(\"getNode fetch node row:%s\", err)\n\t\t\treturn newNodeReply(nil, err)\n\t\t}\n\t\t// Try to match the node.\n\t\tdbLogger.Infof(\"trying node matching with name:%s ip:%s\", cn.name, cn.ip)\n\t\tname, ip := nodeMsg.getNodeName(), nodeMsg.getNodeIP()\n\t\tif (name == cn.name && name != \"\") || (ip == cn.ip && ip != \"\") {\n\t\t\treturn newNodeReply(cn, nil)\n\t\t}\n\t}\n\n\treturn newNodeReply(nil, errNoNode)\n}", "title": "" }, { "docid": "d946e019da5a3369fd67728574b6e563", "score": "0.5484288", "text": "func (s *server) GetNode(context.Context, *goblinpb.GetNodeRequest) (*goblinpb.GetNodeResponse, error) {\n\treturn &goblinpb.GetNodeResponse{\n\t\tName: s.pool.GetName(),\n\t\tAddr: s.pool.GetMemberlistAddress(),\n\t}, nil\n}", "title": "" }, { "docid": "71d6aa0932923a23763946c4225e10da", "score": "0.54659605", "text": "func (g *Gomap) NodeHandler(id int64) (*osm.OSM, error) {\n\tids, err := g.db.SelectNodes(id)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\tif len(ids) == 0 {\n\t\treturn nil, ErrElementNotFound\n\t}\n\n\tfor i := range ids {\n\t\tisVisible, err := g.db.IsNodeVisible(ids[i])\n\t\tif err != nil {\n\t\t\treturn nil, err\n\t\t}\n\t\tif !isVisible {\n\t\t\treturn nil, ErrElementDeleted\n\t\t}\n\t}\n\n\tnodes, err := g.db.ExtractNodes(ids)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\tresp := osm.New()\n\tresp.Nodes = nodes\n\treturn resp, nil\n}", "title": "" }, { "docid": "c101a676dead4b9911f10b5e07ce9cda", "score": "0.54587394", "text": "func (s *Server) StartNode(w http.ResponseWriter, req *http.Request) {\n\tnode := req.Context().Value(\"node\").(*peer.Node)\n\n\tif err := s.network.Start(node.ID); err != nil {\n\t\thttp.Error(w, err.Error(), http.StatusInternalServerError)\n\t\treturn\n\t}\n\n\ts.JSON(w, http.StatusOK, node.ID)\n}", "title": "" }, { "docid": "8fc8cc965509acc03e219dab4aab682f", "score": "0.54560786", "text": "func (c *client) getNode(name string) (result, error) {\n\tnode, err := c.queryEndpoint(APINodesEndpoint, name+\"?memory=true\")\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\tif len(node) > 1 {\n\t\treturn nil, fmt.Errorf(\"Error: more than one result returned\")\n\t}\n\treturn node[0], nil\n}", "title": "" }, { "docid": "ff80175a0ce7277902c30b29ab45e08c", "score": "0.5455272", "text": "func (d *Dao) NodeTree(c context.Context, token, bu, team string) (nodes []*model.Node, err error) {\n\tvar (\n\t\treq *http.Request\n\t\tnode string\n\t)\n\tif len(bu) != 0 {\n\t\tnode = \".\" + bu\n\t}\n\tif len(team) != 0 {\n\t\tnode = \".\" + team\n\t}\n\tif len(node) == 0 {\n\t\tnodes = append(nodes, &model.Node{Name: \"main\", Path: \"main\"})\n\t\tnodes = append(nodes, &model.Node{Name: \"ai\", Path: \"ai\"})\n\t\treturn\n\t}\n\tif req, err = http.NewRequest(\"GET\", fmt.Sprintf(nodeURI, node), nil); err != nil {\n\t\tlog.Error(\"Status url(%s) error(%v)\", dataURI, err)\n\t\treturn\n\t}\n\treq.Header.Set(\"X-Authorization-Token\", token)\n\treq.Header.Set(\"Content-Type\", \"application/json\")\n\tvar res struct {\n\t\tCode int `json:\"code\"`\n\t\tData *model.Res `json:\"data\"`\n\t\tMessage string `json:\"message\"`\n\t\tStatus int `json:\"status\"`\n\t}\n\tif err = d.client.Do(c, req, &res); err != nil {\n\t\tlog.Error(\"d.Status url(%s) res($s) err(%v)\", dataURI, res, err)\n\t\treturn\n\t}\n\tif res.Code != 90000 {\n\t\terr = fmt.Errorf(\"error code :%d\", res.Code)\n\t\tlog.Error(\"Status url(%s) error(%v)\", dataURI, err)\n\t\treturn\n\t}\n\tfor _, tnode := range res.Data.Data {\n\t\tif bytes.Equal(prefix, []byte(tnode.Path)[0:9]) {\n\t\t\ttnode.Path = string([]byte(tnode.Path)[9:])\n\t\t}\n\t\tnodes = append(nodes, &model.Node{Name: tnode.Name, Path: tnode.Path})\n\t}\n\treturn\n}", "title": "" }, { "docid": "7263aac0b4f980430b828e586a3f9709", "score": "0.5432542", "text": "func (sn *SimNode) Node() *discover.Node {\n\treturn discover.NewNode(sn.ID, net.IP{127, 0, 0, 1}, 10909, 10909)\n}", "title": "" }, { "docid": "fbf166a22b53ec03140cf11285e725c0", "score": "0.54317856", "text": "func (d *dataHandlerWays) ReadNode(n gosmparse.Node) {\n\n}", "title": "" }, { "docid": "018c275bf7f6438b10770287ebbb6f13", "score": "0.5407919", "text": "func (c *Client) NodeID() uint64 { return c.nodeID }", "title": "" }, { "docid": "f5154408b7c5d6dde80330fc70c9d5d0", "score": "0.5400273", "text": "func (d FSSNodeDriver) NodeGetInfo(ctx context.Context, req *csi.NodeGetInfoRequest) (*csi.NodeGetInfoResponse, error) {\n\tad, err := d.util.LookupNodeAvailableDomain(d.KubeClient, d.nodeID)\n\n\tif err != nil {\n\t\td.logger.With(zap.Error(err)).With(\"nodeId\", d.nodeID, \"availableDomain\", ad).Error(\"Available domain of node missing.\")\n\t}\n\n\td.logger.With(\"nodeId\", d.nodeID, \"availableDomain\", ad).Info(\"Available domain of node identified.\")\n\treturn &csi.NodeGetInfoResponse{\n\t\tNodeId: d.nodeID,\n\t\t// make sure that the driver works on this particular AD only\n\t\tAccessibleTopology: &csi.Topology{\n\t\t\tSegments: map[string]string{\n\t\t\t\tkubeAPI.LabelZoneFailureDomain: ad,\n\t\t\t},\n\t\t},\n\t}, nil\n}", "title": "" }, { "docid": "85515f9f36397d5731169a2c8bc2a847", "score": "0.53956515", "text": "func Node(i Index, r Layer) (p Pos) {\n\tp.i = i\n\tp.r = r\n\tp.assertValid()\n\treturn\n}", "title": "" }, { "docid": "827e0455e5ddcbcff182c1e502d1edb2", "score": "0.5394242", "text": "func NodeInitStatus(w http.ResponseWriter, r *http.Request) {\n\n}", "title": "" }, { "docid": "d6020702d3039b4836044e10a0d66404", "score": "0.5390628", "text": "func (g *testExpectedGraph) Node(id int64) graph.Node {\n\treturn g.nodes[id]\n}", "title": "" }, { "docid": "0c562fd7c024ed3ea8833ac4c372126e", "score": "0.5388108", "text": "func StopNode() client.RpcMethod {\n\treq := &client.TemplateRpcMethod{}\n\t_ = json.Unmarshal([]byte(\"{\\\"MethodName\\\":\\\"StopNode\\\",\\\"Desc\\\":\\\"Stops the node\\\",\\\"Method\\\":\\\"POST\\\",\\\"Url\\\":\\\"stop_node\\\",\\\"JsonTemplate\\\":\\\"{}\\\",\\\"ValInfo\\\":null}\"), req)\n\treturn req\n}", "title": "" }, { "docid": "64d8eab955700e3396d4cce27692e209", "score": "0.5384597", "text": "func (*Node) Descriptor() ([]byte, []int) {\n\treturn file_external_cfgmgmt_response_nodes_proto_rawDescGZIP(), []int{0}\n}", "title": "" }, { "docid": "cdc6a0a58a6ad75bcd0388520989a59f", "score": "0.5379664", "text": "func (c *Client) InventoryNode(node string) (*InventoryNode, error) {\n\tpayload := &InventoryNode{}\n\treq := c.resty.R().\n\t\tSetResult(payload).\n\t\tSetPathParams(map[string]string{\n\t\t\t\"node\": node,\n\t\t})\n\tr, err := req.Get(orchInventoryNode)\n\tinventoryNode := strings.ReplaceAll(orchInventoryNode, \"{node}\", node)\n\n\tif err = ProcessError(r, err, fmt.Sprintf(\"%s error: %s\", inventoryNode, r.Status())); err != nil {\n\t\treturn nil, err\n\t}\n\n\treturn payload, nil\n}", "title": "" }, { "docid": "230a887a2c125991a364ccc5d098a1c6", "score": "0.5376952", "text": "func (c Node) NodeFile() string {\n\treturn c.nodeFile\n}", "title": "" }, { "docid": "16f509df7e6cda2a007ff2d2bed82d00", "score": "0.5376912", "text": "func (g *metadataGraph) node(path string) *metadataNode {\n\tcur := g.root\n\tif path != \"\" {\n\t\tfor _, elem := range strings.Split(path, \"/\") {\n\t\t\tcur = cur.child(elem)\n\t\t}\n\t}\n\treturn cur\n}", "title": "" }, { "docid": "26bfecd7fe105d22690fe5edf9d5e0d2", "score": "0.53708875", "text": "func (n *Node) NodeInfo() *p2p.NodeInfo {\n\treturn n.adapter.NodeInfo()\n}", "title": "" }, { "docid": "5514a96e2c67092b6cc884645d115448", "score": "0.5358337", "text": "func (h *Hsc) getNodeInfo() (NodeInfo, error) {\n\tendpoint := fmt.Sprintf(\"%s/node_info\", h.LcdEndpoint)\n\tresp, err := http.Get(endpoint)\n\tif err != nil {\n\t\treturn NodeInfo{}, err\n\t}\n\n\tvar nodeInfo NodeInfo\n\tjdec := json.NewDecoder(resp.Body)\n\terr = jdec.Decode(&nodeInfo)\n\tif err != nil {\n\t\treturn NodeInfo{}, err\n\t}\n\n\treturn nodeInfo, nil\n}", "title": "" }, { "docid": "b74d51b67b6c5c64b90f5d4fccf015e9", "score": "0.5353497", "text": "func (d *NodeDriver) NodeGetInfo(ctx context.Context, req *csi.NodeGetInfoRequest) (*csi.NodeGetInfoResponse, error) {\n\tad, err := d.util.lookupNodeAvailableDomain(d.KubeClient, d.nodeID)\n\n\tif err != nil {\n\t\td.logger.With(zap.Error(err)).With(\"nodeId\", d.nodeID, \"availableDomain\", ad).Error(\"Available domain of node missing.\")\n\t}\n\n\td.logger.With(\"nodeId\", d.nodeID, \"availableDomain\", ad).Info(\"Available domain of node identified.\")\n\treturn &csi.NodeGetInfoResponse{\n\t\tNodeId: d.nodeID,\n\t\tMaxVolumesPerNode: maxVolumesPerNode,\n\n\t\t// make sure that the driver works on this particular AD only\n\t\tAccessibleTopology: &csi.Topology{\n\t\t\tSegments: map[string]string{\n\t\t\t\tkubeAPI.LabelZoneFailureDomain: ad,\n\t\t\t},\n\t\t},\n\t}, nil\n}", "title": "" }, { "docid": "a70b1f129b309f784dc5d06be6fe4141", "score": "0.5343463", "text": "func (page TransactionNodeCollectionPage) Response() TransactionNodeCollection {\n\treturn page.tnc\n}", "title": "" }, { "docid": "8dc61e543ab7b96597861def5c80097b", "score": "0.53387773", "text": "func (a API) NodeChk() (isNew bool) {\n\tselect {\n\tcase o := <-a.Ch.(chan NodeRes):\n\t\tif o.Err != nil {\n\t\t\ta.Result = o.Err\n\t\t} else {\n\t\t\ta.Result = o.Res\n\t\t}\n\t\tisNew = true\n\tdefault:\n\t}\n\treturn\n}", "title": "" }, { "docid": "f59b93d4eb89ca001faae507aa2f3826", "score": "0.53375095", "text": "func (*FindEnabledNodeResponse) Descriptor() ([]byte, []int) {\n\treturn file_service_node_proto_rawDescGZIP(), []int{13}\n}", "title": "" }, { "docid": "b4a9a7aa0304e2fe314875773a680c6f", "score": "0.53117776", "text": "func (m *manager) NodeUpdated(n nodeTypes.Node) {\n\tlog.Debugf(\"Received node update event from %s: %#v\", n.Source, n)\n\n\tnodeIdentifier := n.Identity()\n\tdpUpdate := true\n\tvar nodeIP netip.Addr\n\tif nIP := n.GetNodeIP(false); nIP != nil {\n\t\t// GH-24829: Support IPv6-only nodes.\n\n\t\t// Skip returning the error here because at this level, we assume that\n\t\t// the IP is valid as long as it's coming from nodeTypes.Node. This\n\t\t// object is created either from the node discovery (K8s) or from an\n\t\t// event from the kvstore.\n\t\tnodeIP, _ = ip.AddrFromIP(nIP)\n\t}\n\n\tresource := ipcacheTypes.NewResourceID(ipcacheTypes.ResourceKindNode, \"\", n.Name)\n\tnodeLabels, nodeIdentityOverride := m.nodeIdentityLabels(n)\n\n\tvar nodeIPsAdded, healthIPsAdded, ingressIPsAdded []netip.Prefix\n\n\tfor _, address := range n.IPAddresses {\n\t\tif option.Config.NodeIpsetNeeded() && address.Type == addressing.NodeInternalIP {\n\t\t\tiptables.AddToNodeIpset(address.IP)\n\t\t}\n\n\t\tif m.nodeAddressSkipsIPCache(address) {\n\t\t\tcontinue\n\t\t}\n\n\t\tvar tunnelIP netip.Addr\n\t\tif m.nodeAddressHasTunnelIP(address) {\n\t\t\ttunnelIP = nodeIP\n\t\t}\n\n\t\tvar key uint8\n\t\tif m.nodeAddressHasEncryptKey(address) {\n\t\t\tkey = n.EncryptionKey\n\t\t}\n\n\t\tprefix := ip.IPToNetPrefix(address.IP)\n\t\t// We expect the node manager to have a source of either Kubernetes,\n\t\t// CustomResource, or KVStore. Prioritize the KVStore source over the\n\t\t// rest as it is the strongest source, i.e. only trigger datapath\n\t\t// updates if the information we receive takes priority.\n\t\t//\n\t\t// The only exception are kube-apiserver entries. In that case,\n\t\t// we still want to inform subscribers about changes in auxiliary\n\t\t// data such as for example the health endpoint.\n\t\texisting := m.ipcache.GetMetadataByPrefix(prefix).Source()\n\t\toverwrite := source.AllowOverwrite(existing, n.Source)\n\t\tif !overwrite && existing != source.KubeAPIServer {\n\t\t\tdpUpdate = false\n\t\t}\n\n\t\t// Always associate the prefix with metadata, even though this may not\n\t\t// end up in an ipcache entry.\n\t\tm.ipcache.UpsertMetadata(prefix, n.Source, resource,\n\t\t\tnodeLabels,\n\t\t\tipcacheTypes.TunnelPeer{Addr: tunnelIP},\n\t\t\tipcacheTypes.EncryptKey(key))\n\t\tif nodeIdentityOverride {\n\t\t\tm.ipcache.OverrideIdentity(prefix, nodeLabels, n.Source, resource)\n\t\t}\n\t\tnodeIPsAdded = append(nodeIPsAdded, prefix)\n\t}\n\n\tfor _, address := range []net.IP{n.IPv4HealthIP, n.IPv6HealthIP} {\n\t\thealthIP := ip.IPToNetPrefix(address)\n\t\tif !healthIP.IsValid() {\n\t\t\tcontinue\n\t\t}\n\t\tif !source.AllowOverwrite(m.ipcache.GetMetadataByPrefix(healthIP).Source(), n.Source) {\n\t\t\tdpUpdate = false\n\t\t}\n\n\t\tm.ipcache.UpsertMetadata(healthIP, n.Source, resource,\n\t\t\tlabels.LabelHealth,\n\t\t\tipcacheTypes.TunnelPeer{Addr: nodeIP},\n\t\t\tipcacheTypes.EncryptKey(n.EncryptionKey))\n\t\thealthIPsAdded = append(healthIPsAdded, healthIP)\n\t}\n\n\tfor _, address := range []net.IP{n.IPv4IngressIP, n.IPv6IngressIP} {\n\t\tingressIP := ip.IPToNetPrefix(address)\n\t\tif !ingressIP.IsValid() {\n\t\t\tcontinue\n\t\t}\n\t\tif !source.AllowOverwrite(m.ipcache.GetMetadataByPrefix(ingressIP).Source(), n.Source) {\n\t\t\tdpUpdate = false\n\t\t}\n\n\t\tm.ipcache.UpsertMetadata(ingressIP, n.Source, resource,\n\t\t\tlabels.LabelIngress,\n\t\t\tipcacheTypes.TunnelPeer{Addr: nodeIP},\n\t\t\tipcacheTypes.EncryptKey(n.EncryptionKey))\n\t\tingressIPsAdded = append(ingressIPsAdded, ingressIP)\n\t}\n\n\tm.mutex.Lock()\n\tentry, oldNodeExists := m.nodes[nodeIdentifier]\n\tif oldNodeExists {\n\t\tm.metrics.EventsReceived.WithLabelValues(\"update\", string(n.Source)).Inc()\n\n\t\tif !source.AllowOverwrite(entry.node.Source, n.Source) {\n\t\t\t// Done; skip node-handler updates and label injection\n\t\t\t// triggers below. Includes case where the local host\n\t\t\t// was discovered locally and then is subsequently\n\t\t\t// updated by the k8s watcher.\n\t\t\tm.mutex.Unlock()\n\t\t\treturn\n\t\t}\n\n\t\tentry.mutex.Lock()\n\t\tm.mutex.Unlock()\n\t\toldNode := entry.node\n\t\tentry.node = n\n\t\tif dpUpdate {\n\t\t\tm.Iter(func(nh datapath.NodeHandler) {\n\t\t\t\tif err := nh.NodeUpdate(oldNode, entry.node); err != nil {\n\t\t\t\t\tlog.WithFields(logrus.Fields{\n\t\t\t\t\t\t\"handler\": nh.Name(),\n\t\t\t\t\t\t\"node\": entry.node.Name,\n\t\t\t\t\t}).WithError(err).\n\t\t\t\t\t\tError(\"Failed to handle node update event while applying handler. Cilium may be have degraded functionality. See error message for details.\")\n\t\t\t\t}\n\t\t\t})\n\t\t}\n\n\t\tm.removeNodeFromIPCache(oldNode, resource, nodeIPsAdded, healthIPsAdded, ingressIPsAdded)\n\n\t\tentry.mutex.Unlock()\n\t} else {\n\t\tm.metrics.EventsReceived.WithLabelValues(\"add\", string(n.Source)).Inc()\n\t\tm.metrics.NumNodes.Inc()\n\n\t\tentry = &nodeEntry{node: n}\n\t\tentry.mutex.Lock()\n\t\tm.nodes[nodeIdentifier] = entry\n\t\tm.mutex.Unlock()\n\t\tif dpUpdate {\n\t\t\tm.Iter(func(nh datapath.NodeHandler) {\n\t\t\t\tif err := nh.NodeAdd(entry.node); err != nil {\n\t\t\t\t\tlog.WithFields(logrus.Fields{\n\t\t\t\t\t\t\"node\": entry.node.Name,\n\t\t\t\t\t\t\"handler\": nh.Name(),\n\t\t\t\t\t}).WithError(err).\n\t\t\t\t\t\tError(\"Failed to handle node update event while applying handler. Cilium may be have degraded functionality. See error message for details.\")\n\t\t\t\t}\n\t\t\t})\n\t\t}\n\t\tentry.mutex.Unlock()\n\t}\n}", "title": "" }, { "docid": "ea116fc22cd56f143002042daed84ba4", "score": "0.5309712", "text": "func (c *CAPI) AddNode(req *btcjson.AddNodeCmd, resp None) (e error) {\n\tnrh := RPCHandlers\n\tres := nrh[\"addnode\"].Result()\n\tres.Params = req\n\tnrh[\"addnode\"].Call <- res\n\tselect {\n\tcase resp = <-res.Ch.(chan None):\n\tcase <-time.After(c.Timeout):\n\tcase <-c.quit.Wait():\n\t} \n\treturn \n}", "title": "" }, { "docid": "708d6d33fb4d3f5a3d15b99ad25440f9", "score": "0.53013504", "text": "func newResponseNode(model string, hash string, version *big.Int, sim *backends.SimulatedBackend) {\n\topts := mqtt.NewClientOptions().AddBroker(\"tcp://localhost:1883\")\n\tclient := mqtt.NewClient(opts)\n\ttoken := client.Connect()\n\tif token.Wait() && token.Error() != nil {\n\t\tlog.Fatalln(token.Error())\n\t}\n\n\tvar messageHandler mqtt.MessageHandler = func(client mqtt.Client, msg mqtt.Message) {\n\t\tcontract, _ := contracts.NewVerifier(common.HexToAddress(string(msg.Payload())), sim)\n\t\tsendResponse(sim, contract, hash, version)\n\t}\n\ttoken = client.Subscribe(model, 0, messageHandler)\n\tif token.Wait() && token.Error() != nil {\n\t\tlog.Fatalln(token.Error())\n\t}\n}", "title": "" }, { "docid": "2fe72990d491f381f55a496155f62250", "score": "0.5297591", "text": "func printNode(n *node) {\n\tvar buf bytes.Buffer\n\n\tbuf.WriteString(fmt.Sprintf(\"[prefix: %s] \", n.Prefix))\n\tif n.Children != nil {\n\t\tbuf.WriteString(fmt.Sprintf(\"[child: %s] \", n.Children.Prefix))\n\t}\n\tif n.Next != nil {\n\t\tbuf.WriteString(fmt.Sprintf(\"[next: %s] \", n.Next.Prefix))\n\t}\n\tif n.Leaf != nil {\n\t\tbuf.WriteString(fmt.Sprintf(\"[value(key): %s]\", n.Leaf.Key))\n\t}\n\n\tprint(buf.String())\n}", "title": "" }, { "docid": "3c616755457aaa1ec97cc980811955b7", "score": "0.52950174", "text": "func node(n graph.Node) *cfg.Node {\n\tif n, ok := n.(*cfg.Node); ok {\n\t\treturn n\n\t}\n\tpanic(fmt.Errorf(\"invalid node type; expected *cfg.Node, got %T\", n))\n}", "title": "" }, { "docid": "94f420ae69db2e97f6083319cdbc5a42", "score": "0.52941626", "text": "func (r *Record) Node() *dag.Node {\n\treturn r.nd\n}", "title": "" }, { "docid": "9b64c354cf046b68e928a3f2cac62db4", "score": "0.5290482", "text": "func (o *CommitteeNode) GetNode() PeeringNodeStatusResponse {\n\tif o == nil {\n\t\tvar ret PeeringNodeStatusResponse\n\t\treturn ret\n\t}\n\n\treturn o.Node\n}", "title": "" }, { "docid": "a746c8dcc9d4339fb72e36a0ec882b79", "score": "0.5288149", "text": "func (d *Dice) NodeInfo(nodeRef entity.NodeReference) (types.NodeInfoOutput, error) {\n\tnode, err := d.findNode(nodeRef)\n\n\tif err != nil {\n\t\treturn types.NodeInfoOutput{}, err\n\t} else if node == nil {\n\t\treturn types.NodeInfoOutput{}, ErrNodeNotFound\n\t}\n\n\tnodeInfo := types.NodeInfoOutput{\n\t\tID: node.ID,\n\t\tName: node.Name,\n\t\tIsAttached: node.IsAttached,\n\t\tIsAlive: node.IsAlive,\n\t}\n\n\treturn nodeInfo, nil\n}", "title": "" }, { "docid": "d45d90dd216101c8a2251517992817e3", "score": "0.5287313", "text": "func (fm *FingerprintManager) getNode() *structs.Node {\n\tfm.nodeLock.Lock()\n\tdefer fm.nodeLock.Unlock()\n\treturn fm.node\n}", "title": "" }, { "docid": "97d65ce569373495f66dbe7e6b892cf0", "score": "0.52865505", "text": "func (c *nodes) Get(name string) (*api.Node, error) {\n\tresult := &api.Node{}\n\terr := c.r.Get().Resource(c.resourceName()).Name(name).Do().Into(result)\n\treturn result, err\n}", "title": "" }, { "docid": "37471ace7f01dcaa4dbcb52002ea9c1a", "score": "0.5285317", "text": "func (o *GetNodeReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) {\n\tswitch response.Code() {\n\tcase 200:\n\t\tresult := NewGetNodeOK()\n\t\tif err := result.readResponse(response, consumer, o.formats); err != nil {\n\t\t\treturn nil, err\n\t\t}\n\t\treturn result, nil\n\tcase 400:\n\t\tresult := NewGetNodeBadRequest()\n\t\tif err := result.readResponse(response, consumer, o.formats); err != nil {\n\t\t\treturn nil, err\n\t\t}\n\t\treturn nil, result\n\tcase 401:\n\t\tresult := NewGetNodeUnauthorized()\n\t\tif err := result.readResponse(response, consumer, o.formats); err != nil {\n\t\t\treturn nil, err\n\t\t}\n\t\treturn nil, result\n\tcase 403:\n\t\tresult := NewGetNodeForbidden()\n\t\tif err := result.readResponse(response, consumer, o.formats); err != nil {\n\t\t\treturn nil, err\n\t\t}\n\t\treturn nil, result\n\tcase 404:\n\t\tresult := NewGetNodeNotFound()\n\t\tif err := result.readResponse(response, consumer, o.formats); err != nil {\n\t\t\treturn nil, err\n\t\t}\n\t\treturn nil, result\n\tcase 422:\n\t\tresult := NewGetNodeUnprocessableEntity()\n\t\tif err := result.readResponse(response, consumer, o.formats); err != nil {\n\t\t\treturn nil, err\n\t\t}\n\t\treturn nil, result\n\tcase 500:\n\t\tresult := NewGetNodeInternalServerError()\n\t\tif err := result.readResponse(response, consumer, o.formats); err != nil {\n\t\t\treturn nil, err\n\t\t}\n\t\treturn nil, result\n\n\tdefault:\n\t\treturn nil, runtime.NewAPIError(\"unknown error\", response, response.Code())\n\t}\n}", "title": "" }, { "docid": "9e5bd567a55cd22d9598a6743151e704", "score": "0.52843493", "text": "func nodeProxyRequest(c *client.Client, node, endpoint string) client.Result {\n\treturn c.Get().\n\t\tPrefix(\"proxy\").\n\t\tResource(\"nodes\").\n\t\tName(fmt.Sprintf(\"%v:%v\", node, ports.KubeletPort)).\n\t\tSuffix(endpoint).\n\t\tDo()\n}", "title": "" }, { "docid": "799e938e51575c3e84e4858bba087ff1", "score": "0.5283937", "text": "func (c *Cursor) Node() AST { return c.node }", "title": "" }, { "docid": "0b4446f02de9c30eeb951f371b6d0875", "score": "0.52813417", "text": "func (Task) IsNode() {}", "title": "" }, { "docid": "def0a6a1c70acb9c499fa7afb33d0f87", "score": "0.52809995", "text": "func (k *Ketama) Node(key string) string {\n\t//keyPos := hashVal(digest, 0)\n\t//keyPos := MurMurHash2(key)\n\tidx := searchLeft(k.nodes, MurMurHash2(key))\n\n\tpos := k.nodes[0]\n\tif idx != len(k.nodes) {\n\t\tpos = k.nodes[idx]\n\t}\n\n\treturn k.nodesMapping[pos]\n}", "title": "" }, { "docid": "35198542ea30fd351aeda8dbf38027ba", "score": "0.5279568", "text": "func (ed *NodesEndpoint) Get(ctx context.Context, in *pb.NodesRequest) (*pb.NodesReply, error) {\n\tkey, err := ed.getKey(in, ctx)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\tdata, err := ed.wch.Get(key)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\tobj, _, err := ed.make(key, data)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\treturn obj, nil\n}", "title": "" }, { "docid": "b8de2461be20e848a9f1e2a7b019e439", "score": "0.52770317", "text": "func (f SingleWorkerID) Node() int64 {\n\treturn int64(f) & nodeMask >> nodeIdShift\n}", "title": "" } ]
56b1a8735e0de6a40506916852010624
Deprecated: Use Auth_Claims_UserInfo.ProtoReflect.Descriptor instead.
[ { "docid": "e2824ed23d3a906c613888e043151342", "score": "0.7412924", "text": "func (*Auth_Claims_UserInfo) Descriptor() ([]byte, []int) {\n\treturn file_proto_auth_proto_rawDescGZIP(), []int{0, 0, 0}\n}", "title": "" } ]
[ { "docid": "871e8c9270cac6aad7d4d77be6d2379b", "score": "0.6915204", "text": "func (*UserInfo) Descriptor() ([]byte, []int) {\n\treturn file_api_proto_auth_proto_rawDescGZIP(), []int{11}\n}", "title": "" }, { "docid": "8e003d4b3e96bd1ce50b472d8682680c", "score": "0.6911696", "text": "func (*ChangeUserInfoRequest) Descriptor() ([]byte, []int) {\n\treturn file_proto_library_checker_proto_rawDescGZIP(), []int{9}\n}", "title": "" }, { "docid": "f58511d607efaf8fc5c15fe99c2a9115", "score": "0.6782973", "text": "func (*UserInfo) Descriptor() ([]byte, []int) {\n\treturn file_api_kratosdemouser_kratosDemoUser_proto_rawDescGZIP(), []int{2}\n}", "title": "" }, { "docid": "e89ef79cf33e1cbf2e2d6908cf2d94db", "score": "0.669214", "text": "func (*UserInfo) Descriptor() ([]byte, []int) {\n\treturn file_api_v1_user_proto_rawDescGZIP(), []int{1}\n}", "title": "" }, { "docid": "f2d4b8f021d8360f68bb25e8aa032dd3", "score": "0.6663125", "text": "func (*UserInfo) Descriptor() ([]byte, []int) {\n\treturn file_userInfo_proto_rawDescGZIP(), []int{2}\n}", "title": "" }, { "docid": "842196ea08425edce6536df6bd803a95", "score": "0.6620733", "text": "func (*UserInfoRequest) Descriptor() ([]byte, []int) {\n\treturn file_userInfo_proto_rawDescGZIP(), []int{0}\n}", "title": "" }, { "docid": "d228f294e41399d025d169b17d710ee9", "score": "0.6616285", "text": "func (*UserInfoRequest) Descriptor() ([]byte, []int) {\n\treturn file_proto_user_user_proto_rawDescGZIP(), []int{4}\n}", "title": "" }, { "docid": "d228f294e41399d025d169b17d710ee9", "score": "0.6616285", "text": "func (*UserInfoRequest) Descriptor() ([]byte, []int) {\n\treturn file_proto_user_user_proto_rawDescGZIP(), []int{4}\n}", "title": "" }, { "docid": "28aca9078ef6b465f269ac3fc1b50012", "score": "0.6611732", "text": "func (*ChangeUserInfoResponse) Descriptor() ([]byte, []int) {\n\treturn file_proto_library_checker_proto_rawDescGZIP(), []int{10}\n}", "title": "" }, { "docid": "a82620d3b767fec813c4825eb0a4f8c0", "score": "0.66096175", "text": "func (*UserInfo) Descriptor() ([]byte, []int) {\n\treturn file_mall_users_proto_users_users_proto_rawDescGZIP(), []int{41}\n}", "title": "" }, { "docid": "b74abfb421bf2a1a4ff0b574fa1b9ee9", "score": "0.660166", "text": "func (*UserInfo) Descriptor() ([]byte, []int) {\n\treturn file_user_proto_user_proto_rawDescGZIP(), []int{8}\n}", "title": "" }, { "docid": "d40c7c18ae54b25247f55d2c456aa9e8", "score": "0.65985674", "text": "func (*UserInfoRequest) Descriptor() ([]byte, []int) {\n\treturn file_proto_library_checker_proto_rawDescGZIP(), []int{5}\n}", "title": "" }, { "docid": "88ebf15123f13cef6cc803d2a033f42d", "score": "0.6591655", "text": "func (*GetUserInfoRequest) Descriptor() ([]byte, []int) {\n\treturn file_mall_users_proto_users_users_proto_rawDescGZIP(), []int{40}\n}", "title": "" }, { "docid": "41d99bdac1a1f738b3a5ca48b89772b9", "score": "0.65867716", "text": "func (*UserInfo) Descriptor() ([]byte, []int) {\n\treturn file_pkg_sysapi_sysapi_proto_rawDescGZIP(), []int{2}\n}", "title": "" }, { "docid": "eb2043ec7c770e8cacd501b1995d8316", "score": "0.65751827", "text": "func (*UserInfoRequest) Descriptor() ([]byte, []int) {\n\treturn file_proto_user_proto_rawDescGZIP(), []int{0}\n}", "title": "" }, { "docid": "01f13e261d608233767f48b528cc159f", "score": "0.6551032", "text": "func (*UserInfoRequest) Descriptor() ([]byte, []int) {\n\treturn file_user_info_proto_rawDescGZIP(), []int{0}\n}", "title": "" }, { "docid": "49d7259d5e2483cd41a8f3279902b131", "score": "0.6506711", "text": "func (*UpdateUserInfoRequest) Descriptor() ([]byte, []int) {\n\treturn file_userpb_service_proto_rawDescGZIP(), []int{22}\n}", "title": "" }, { "docid": "4c64c75cba33bf7eefe50c9495f5753b", "score": "0.649744", "text": "func (*GetUserInfoReq) Descriptor() ([]byte, []int) {\n\treturn file_api_sso_sso_proto_rawDescGZIP(), []int{29}\n}", "title": "" }, { "docid": "4e8efdf7ce012140575bbd2bf97ee5bd", "score": "0.6475635", "text": "func (*UserInfo) Descriptor() ([]byte, []int) {\n\treturn file_user_proto_rawDescGZIP(), []int{14}\n}", "title": "" }, { "docid": "55d605e0a34290a5bd493c57331c8aea", "score": "0.646027", "text": "func (*DeviceInfo) Descriptor() ([]byte, []int) {\n\treturn file_api_proto_auth_SignIn_proto_rawDescGZIP(), []int{0}\n}", "title": "" }, { "docid": "dd1e18ec7e5ae4310e5b2b5de2b4a86f", "score": "0.64486873", "text": "func (*ListUserInfoRequest) Descriptor() ([]byte, []int) {\n\treturn file_mall_users_proto_users_users_proto_rawDescGZIP(), []int{52}\n}", "title": "" }, { "docid": "19d87bb9fbe36fd7046978dae897859c", "score": "0.6447226", "text": "func (*UserInfo) Descriptor() ([]byte, []int) {\n\treturn file_authenticator_auth_proto_rawDescGZIP(), []int{0}\n}", "title": "" }, { "docid": "44a7e63c2b97d95eedca07aa0b90e54a", "score": "0.6442054", "text": "func (*UserRequest) Descriptor() ([]byte, []int) {\n\treturn file_proto_userinfo_proto_rawDescGZIP(), []int{0}\n}", "title": "" }, { "docid": "6c1fc7dc6a3b5aa0124de8b1376adc80", "score": "0.64403826", "text": "func (*UserInfo) Descriptor() ([]byte, []int) {\n\treturn file_uac_UACService_proto_rawDescGZIP(), []int{6}\n}", "title": "" }, { "docid": "6ccb22802950a77eaffbd4482c23af7b", "score": "0.64300686", "text": "func (*GetUserInfoReq) Descriptor() ([]byte, []int) {\n\treturn file_message_proto_rawDescGZIP(), []int{3}\n}", "title": "" }, { "docid": "d72ee3c27252f667f773d2d6d51a504b", "score": "0.6417309", "text": "func (*UpdateUserInfo) Descriptor() ([]byte, []int) {\n\treturn file_mod_disco_models_proto_rawDescGZIP(), []int{2}\n}", "title": "" }, { "docid": "e97fa3fb4c8e70333e40737cb1f5721e", "score": "0.6413826", "text": "func (*UserInfo) Descriptor() ([]byte, []int) {\n\treturn file_game_proto_rawDescGZIP(), []int{19}\n}", "title": "" }, { "docid": "de7313037d3f6730da87cf282ece804d", "score": "0.6401908", "text": "func (*UserInfo) Descriptor() ([]byte, []int) {\n\treturn file_mod_disco_models_proto_rawDescGZIP(), []int{0}\n}", "title": "" }, { "docid": "12deaf250d4b53bd76e011f3c60c044e", "score": "0.64010227", "text": "func (*GetUserInfoByPhoneRequest) Descriptor() ([]byte, []int) {\n\treturn file_mall_users_proto_users_users_proto_rawDescGZIP(), []int{38}\n}", "title": "" }, { "docid": "f4d8f94bf8a9f357cf0d6c2031884bde", "score": "0.6399016", "text": "func (*UserInfo) Descriptor() ([]byte, []int) {\n\treturn file_user_proto_rawDescGZIP(), []int{0}\n}", "title": "" }, { "docid": "08c4ca1d58f9e57ef5c36bbb168f5704", "score": "0.6371286", "text": "func (*GetUserInfoResp) Descriptor() ([]byte, []int) {\n\treturn file_api_sso_sso_proto_rawDescGZIP(), []int{30}\n}", "title": "" }, { "docid": "a8cd9fe65473570490800c830acab3bd", "score": "0.63608944", "text": "func (*GetUserInfoRes) Descriptor() ([]byte, []int) {\n\treturn file_message_proto_rawDescGZIP(), []int{4}\n}", "title": "" }, { "docid": "bc43a0876a9f3eb90b10aa220f8fcab1", "score": "0.6357175", "text": "func (*NewUserInfo) Descriptor() ([]byte, []int) {\n\treturn file_mod_disco_models_proto_rawDescGZIP(), []int{1}\n}", "title": "" }, { "docid": "25aadb61eed7673b2a7b8240fe98ed52", "score": "0.6340678", "text": "func (*BatchGetUserInfoRequest) Descriptor() ([]byte, []int) {\n\treturn file_proto_user_proto_rawDescGZIP(), []int{3}\n}", "title": "" }, { "docid": "9ff48bca61e77b842e70b9664105a02b", "score": "0.6336267", "text": "func (*NewUserInfo) Descriptor() ([]byte, []int) {\n\treturn file_server_auth_proto_rawDescGZIP(), []int{0}\n}", "title": "" }, { "docid": "381a43c0c2eb48b61a3b1b966e50a3ab", "score": "0.6325271", "text": "func (*Auth_Claims) Descriptor() ([]byte, []int) {\n\treturn file_proto_auth_proto_rawDescGZIP(), []int{0, 0}\n}", "title": "" }, { "docid": "3302d8b13045f9bb84a8404ad5956fd4", "score": "0.63109493", "text": "func (*CheckUserIdentityRequest) Descriptor() ([]byte, []int) {\n\treturn file_mall_users_proto_users_users_proto_rawDescGZIP(), []int{22}\n}", "title": "" }, { "docid": "6f26792f141f306645df5d7754c8f660", "score": "0.6310169", "text": "func (*UserInfoResponse) Descriptor() ([]byte, []int) {\n\treturn file_proto_library_checker_proto_rawDescGZIP(), []int{6}\n}", "title": "" }, { "docid": "94e5bcef2e72e0bc1a02c09c9ffbedaf", "score": "0.63098705", "text": "func (*GetUserInfoResponse) Descriptor() ([]byte, []int) {\n\treturn file_mall_users_proto_users_users_proto_rawDescGZIP(), []int{42}\n}", "title": "" }, { "docid": "2139c0158a4c9969fba24497c6963e95", "score": "0.63089985", "text": "func (*UserInfo) Descriptor() ([]byte, []int) {\n\treturn file_chatbot_proto_rawDescGZIP(), []int{1}\n}", "title": "" }, { "docid": "65bd714bdb69fd08acda876bb9b288de", "score": "0.63050026", "text": "func (*User) Descriptor() ([]byte, []int) {\n\treturn file_UserInfo_proto_rawDescGZIP(), []int{0}\n}", "title": "" }, { "docid": "03b2d5cf91837c9e91940727ea7f1356", "score": "0.6300729", "text": "func (*FindUserInfoRequest) Descriptor() ([]byte, []int) {\n\treturn file_mall_users_proto_users_users_proto_rawDescGZIP(), []int{6}\n}", "title": "" }, { "docid": "169326ff3fc807d3262826b9373b0cd0", "score": "0.6298206", "text": "func (*AddAndUpdateUserInfoResp) Descriptor() ([]byte, []int) {\n\treturn file_gin_mani_user_proto_rawDescGZIP(), []int{1}\n}", "title": "" }, { "docid": "17c1f1fd590b2efd9f78c37df7449fde", "score": "0.62964123", "text": "func (*AddAndUpdateUserInfoReq) Descriptor() ([]byte, []int) {\n\treturn file_gin_mani_user_proto_rawDescGZIP(), []int{0}\n}", "title": "" }, { "docid": "1755b5d70167fef8a1b2c68965e80db4", "score": "0.62952244", "text": "func (*UserInfoValues) Descriptor() ([]byte, []int) {\n\treturn file_mod_disco_models_proto_rawDescGZIP(), []int{3}\n}", "title": "" }, { "docid": "37c29d0f26cd2b79e7b864c27a71318d", "score": "0.6276528", "text": "func (*UpdatePermissionRequest) Descriptor() ([]byte, []int) {\n\treturn file_dictybase_user_user_proto_rawDescGZIP(), []int{16}\n}", "title": "" }, { "docid": "1fef275d40639c07973ae50a95e8ec44", "score": "0.6269637", "text": "func (*CS_UserInfo_Req) Descriptor() ([]byte, []int) {\n\treturn file_pb_user_proto_rawDescGZIP(), []int{2}\n}", "title": "" }, { "docid": "7fbe77331cce8a539905529219329fe2", "score": "0.6237696", "text": "func (*UpdateUserInfoResponse) Descriptor() ([]byte, []int) {\n\treturn file_userpb_service_proto_rawDescGZIP(), []int{23}\n}", "title": "" }, { "docid": "eea276390620b971aa715febf2796535", "score": "0.62312776", "text": "func (*UserinfoRequest) Descriptor() ([]byte, []int) {\n\treturn file_user_proto_rawDescGZIP(), []int{2}\n}", "title": "" }, { "docid": "23ef606575db137906892bad5d76a554", "score": "0.62229383", "text": "func (*SC_UserInfo_Resp) Descriptor() ([]byte, []int) {\n\treturn file_pb_user_proto_rawDescGZIP(), []int{3}\n}", "title": "" }, { "docid": "f2c8f11878521e0c96642cf1bec2c6db", "score": "0.6202647", "text": "func (*UserInfoResponse) Descriptor() ([]byte, []int) {\n\treturn file_proto_user_proto_rawDescGZIP(), []int{1}\n}", "title": "" }, { "docid": "bd123f501f9151b672d52d31e64968c0", "score": "0.6192444", "text": "func (*UpdateUserInfoRequest) Descriptor() ([]byte, []int) {\n\treturn file_server_gate_gate_proto_rawDescGZIP(), []int{4}\n}", "title": "" }, { "docid": "280274f747295d1bf3529d5090f9776c", "score": "0.61774683", "text": "func (*UserInfoResponse) Descriptor() ([]byte, []int) {\n\treturn file_proto_user_user_proto_rawDescGZIP(), []int{5}\n}", "title": "" }, { "docid": "280274f747295d1bf3529d5090f9776c", "score": "0.61774683", "text": "func (*UserInfoResponse) Descriptor() ([]byte, []int) {\n\treturn file_proto_user_user_proto_rawDescGZIP(), []int{5}\n}", "title": "" }, { "docid": "101b416029a4efb791994db0b1a2cc63", "score": "0.6172277", "text": "func (*VertaUserInfo) Descriptor() ([]byte, []int) {\n\treturn file_uac_UACService_proto_rawDescGZIP(), []int{5}\n}", "title": "" }, { "docid": "91582ba21e8c765c96ef11639773068f", "score": "0.6169623", "text": "func (*UserLoginInfo) Descriptor() ([]byte, []int) {\n\treturn file_admin_login_proto_rawDescGZIP(), []int{2}\n}", "title": "" }, { "docid": "6d1001c001804d31da5437fda25312b4", "score": "0.616798", "text": "func (*UserInfoResponse) Descriptor() ([]byte, []int) {\n\treturn file_user_info_proto_rawDescGZIP(), []int{1}\n}", "title": "" }, { "docid": "477406373b9127f5478c080e2bb0567c", "score": "0.6162187", "text": "func (*UserInfo) Descriptor() ([]byte, []int) {\n\treturn file_test_proto_rawDescGZIP(), []int{0}\n}", "title": "" }, { "docid": "0333692401ecf9da7256b8ba30606be1", "score": "0.61606926", "text": "func (*CurrentUserRequest) Descriptor() ([]byte, []int) {\n\treturn file_determined_api_v1_auth_proto_rawDescGZIP(), []int{2}\n}", "title": "" }, { "docid": "3c45fc7bfa94a589d6ed7c41d971b41d", "score": "0.6133702", "text": "func (*UpdateUserRequest) Descriptor() ([]byte, []int) {\n\treturn file_api_proto_auth_proto_rawDescGZIP(), []int{12}\n}", "title": "" }, { "docid": "a3139a67fe5fde78d608609b09cd08cb", "score": "0.61271906", "text": "func (*UserResponse) Descriptor() ([]byte, []int) {\n\treturn file_proto_userinfo_proto_rawDescGZIP(), []int{1}\n}", "title": "" }, { "docid": "cce75cae37fec3f8c4ffebf07f6ad1c6", "score": "0.61200154", "text": "func (*ConnectRequest_UserInfo) Descriptor() ([]byte, []int) {\n\treturn file_edgectl_rpc_daemon_proto_rawDescGZIP(), []int{0, 0}\n}", "title": "" }, { "docid": "43b4bbcb562efb2342718d216f8b71f1", "score": "0.6117919", "text": "func (*ListUserInfoResponse) Descriptor() ([]byte, []int) {\n\treturn file_mall_users_proto_users_users_proto_rawDescGZIP(), []int{53}\n}", "title": "" }, { "docid": "0448fff34df6bff42fcc9f0a51f62219", "score": "0.61178184", "text": "func (*UpdateUserRequest) Descriptor() ([]byte, []int) {\n\treturn file_internal_proto_files_identity_proto_rawDescGZIP(), []int{4}\n}", "title": "" }, { "docid": "7aa607b6cb579eead97c4a1565a5cde6", "score": "0.6116888", "text": "func (*UserID) Descriptor() ([]byte, []int) {\n\treturn file_UserInfo_proto_rawDescGZIP(), []int{1}\n}", "title": "" }, { "docid": "41fa61b2f9c9c9105c43f8ea9f3a14b7", "score": "0.6113182", "text": "func (*UserLoginRequest) Descriptor() ([]byte, []int) {\n\treturn file_proto_user_proto_rawDescGZIP(), []int{4}\n}", "title": "" }, { "docid": "2742b4ebc75cbb085133e3ee9e5579b9", "score": "0.61089575", "text": "func (*GetCurrentUserRequest) Descriptor() ([]byte, []int) {\n\treturn file_toit_api_user_proto_rawDescGZIP(), []int{6}\n}", "title": "" }, { "docid": "4f3bfc847fb22a6b3485e9d37858bbdd", "score": "0.61060953", "text": "func (*UpdatePermissionRequest_Data) Descriptor() ([]byte, []int) {\n\treturn file_dictybase_user_user_proto_rawDescGZIP(), []int{16, 0}\n}", "title": "" }, { "docid": "b4c2cac5c808c5c3d5f7ce1be7bf5ab6", "score": "0.6104936", "text": "func (*LoginInfo) Descriptor() ([]byte, []int) {\n\treturn file_user_proto_rawDescGZIP(), []int{0}\n}", "title": "" }, { "docid": "0f914cb2dacab41ab37584bfe913c580", "score": "0.6102853", "text": "func (*GetClaimNameByIdRequest) Descriptor() ([]byte, []int) {\n\treturn file_MServiceAccount_proto_rawDescGZIP(), []int{43}\n}", "title": "" }, { "docid": "37201622ec3c91903522eefd269f77fe", "score": "0.60966617", "text": "func (*CheckUserIdentityResponse) Descriptor() ([]byte, []int) {\n\treturn file_mall_users_proto_users_users_proto_rawDescGZIP(), []int{23}\n}", "title": "" }, { "docid": "89c84a039ea1c694a7b2119cb473a886", "score": "0.60966563", "text": "func (*NickInfo) Descriptor() ([]byte, []int) {\n\treturn file_proto3_user_proto_rawDescGZIP(), []int{1}\n}", "title": "" }, { "docid": "93087c89fe2e164d219302345ce43423", "score": "0.60942024", "text": "func (*BatchGetUserInfoResponse) Descriptor() ([]byte, []int) {\n\treturn file_proto_user_proto_rawDescGZIP(), []int{4}\n}", "title": "" }, { "docid": "a27c56ede3eec2d46040b1fdd6056e05", "score": "0.60939336", "text": "func (*UpdateUserRequest) Descriptor() ([]byte, []int) {\n\treturn file_toit_api_user_proto_rawDescGZIP(), []int{20}\n}", "title": "" }, { "docid": "3388d5a2cb0d9b8ea30b1f56510002e9", "score": "0.6087732", "text": "func (*UserDetail) Descriptor() ([]byte, []int) {\n\treturn file_internal_protobufs_user_domain_proto_rawDescGZIP(), []int{1}\n}", "title": "" }, { "docid": "07d1016f779b546e225bc3418190a387", "score": "0.6081911", "text": "func (*ModifyUserDeliveryInfoRequest) Descriptor() ([]byte, []int) {\n\treturn file_mall_users_proto_users_users_proto_rawDescGZIP(), []int{11}\n}", "title": "" }, { "docid": "01eb2c8747131de6e9ca4076d75122f8", "score": "0.60818535", "text": "func (*UserInfoMain) Descriptor() ([]byte, []int) {\n\treturn file_mall_users_proto_users_users_proto_rawDescGZIP(), []int{7}\n}", "title": "" }, { "docid": "079300e4813d07d32da65360fb49c5fc", "score": "0.60791355", "text": "func (*RetrieveTokenInformationRequest) Descriptor() ([]byte, []int) {\n\treturn file_auth_proto_rawDescGZIP(), []int{4}\n}", "title": "" }, { "docid": "d772ac5ba42f9bb4dc6a4a17a82d303a", "score": "0.6078914", "text": "func (*UserAccountInfo) Descriptor() ([]byte, []int) {\n\treturn file_mall_users_proto_users_users_proto_rawDescGZIP(), []int{20}\n}", "title": "" }, { "docid": "3a051894f802337f4a211bf043dbbf4b", "score": "0.6077677", "text": "func (*TokenIntrospectionRequest) Descriptor() ([]byte, []int) {\n\treturn file_oidc_core_v1_introspection_api_proto_rawDescGZIP(), []int{0}\n}", "title": "" }, { "docid": "c0aea3e540f2b60ef9d7d85545fb069f", "score": "0.6073386", "text": "func (*ComplexUsecaseRequest_UserInfoGen) Descriptor() ([]byte, []int) {\n\treturn file_complex_v1_complex_usecase_proto_rawDescGZIP(), []int{0, 1}\n}", "title": "" }, { "docid": "1b1c31794d84bd547ff462934bd5db85", "score": "0.6064443", "text": "func (*UpdateClaimValueRequest) Descriptor() ([]byte, []int) {\n\treturn file_MServiceAccount_proto_rawDescGZIP(), []int{49}\n}", "title": "" }, { "docid": "040ca719034422b24000f1bf9071b22b", "score": "0.6060792", "text": "func (*UserLoginRequest) Descriptor() ([]byte, []int) {\n\treturn file_proto_user_user_proto_rawDescGZIP(), []int{2}\n}", "title": "" }, { "docid": "040ca719034422b24000f1bf9071b22b", "score": "0.6060792", "text": "func (*UserLoginRequest) Descriptor() ([]byte, []int) {\n\treturn file_proto_user_user_proto_rawDescGZIP(), []int{2}\n}", "title": "" }, { "docid": "8adaf78865314f505c2417b8185285d9", "score": "0.60598874", "text": "func (*GetInfoRequest) Descriptor() ([]byte, []int) {\n\treturn file_userpb_service_proto_rawDescGZIP(), []int{4}\n}", "title": "" }, { "docid": "864f220d2f090f19173d5c15ad6496a1", "score": "0.605614", "text": "func (*AuthUserRequest) Descriptor() ([]byte, []int) {\n\treturn file_internal_proto_user_user_proto_rawDescGZIP(), []int{0}\n}", "title": "" }, { "docid": "df779c4ee9eeb3a365112cef3e573b70", "score": "0.605473", "text": "func (*UpdateUserRequest) Descriptor() ([]byte, []int) {\n\treturn file_go_chromium_org_luci_analysis_internal_bugs_monorail_api_proto_users_proto_rawDescGZIP(), []int{3}\n}", "title": "" }, { "docid": "d4525465a529f570481bf59fce3e57b3", "score": "0.60526943", "text": "func (*Permission) Descriptor() ([]byte, []int) {\n\treturn file_dictybase_user_user_proto_rawDescGZIP(), []int{18}\n}", "title": "" }, { "docid": "6e0c6238e954da32d2dd04d0a03ab46d", "score": "0.60522586", "text": "func (*UserChange) Descriptor() ([]byte, []int) {\n\treturn file_toit_api_user_proto_rawDescGZIP(), []int{19}\n}", "title": "" }, { "docid": "c71eb82ef6e5641d537424c0b13fa58d", "score": "0.6045602", "text": "func (*QueryUserInfoByIdsReq) Descriptor() ([]byte, []int) {\n\treturn file_gin_mani_user_proto_rawDescGZIP(), []int{2}\n}", "title": "" }, { "docid": "797bbe556f8c835955d09c97c71737b6", "score": "0.604423", "text": "func (*GetClaimValueByIdRequest) Descriptor() ([]byte, []int) {\n\treturn file_MServiceAccount_proto_rawDescGZIP(), []int{53}\n}", "title": "" }, { "docid": "038e9ca5ccd0fc71b31663559bc53418", "score": "0.60435694", "text": "func (*UpdateUserRequest) Descriptor() ([]byte, []int) {\n\treturn file_dictybase_user_user_proto_rawDescGZIP(), []int{0}\n}", "title": "" }, { "docid": "b1e5c517d7865b2682c946b547c7e33c", "score": "0.6037667", "text": "func (*GetAccountUserByIdRequest) Descriptor() ([]byte, []int) {\n\treturn file_MServiceAccount_proto_rawDescGZIP(), []int{31}\n}", "title": "" }, { "docid": "b4610479339143902721f1dcfb20dd5b", "score": "0.60367155", "text": "func (*UserChangeRequest) Descriptor() ([]byte, []int) {\n\treturn file_userFirestore_v1_userFirestore_proto_rawDescGZIP(), []int{5}\n}", "title": "" }, { "docid": "69a832c8a1cb78c8037d49ef7ee48f0a", "score": "0.60364634", "text": "func (*CreatePermissionRequest) Descriptor() ([]byte, []int) {\n\treturn file_dictybase_user_user_proto_rawDescGZIP(), []int{17}\n}", "title": "" }, { "docid": "1cb2ca544f76f046468db578c016b73b", "score": "0.60340315", "text": "func (*User) Descriptor() ([]byte, []int) {\n\treturn file_golang_pkg_proto_auth_auth_proto_rawDescGZIP(), []int{2}\n}", "title": "" }, { "docid": "da2083e5fa3c6778fff1b42594363165", "score": "0.60261524", "text": "func (*FindUserInfoResponse) Descriptor() ([]byte, []int) {\n\treturn file_mall_users_proto_users_users_proto_rawDescGZIP(), []int{8}\n}", "title": "" }, { "docid": "af47ada71f8066c1aa68adb8511df295", "score": "0.60177153", "text": "func (*LoginTokenInfo) Descriptor() ([]byte, []int) {\n\treturn file_admin_login_proto_rawDescGZIP(), []int{5}\n}", "title": "" }, { "docid": "3d9abe218b1ad1106e53c39e5b44e439", "score": "0.601363", "text": "func (*Info) Descriptor() ([]byte, []int) {\n\treturn file_proto3_user_proto_rawDescGZIP(), []int{0}\n}", "title": "" }, { "docid": "7155aee46490689690271a8ce432b6ef", "score": "0.60079813", "text": "func (*GetUserRequest) Descriptor() ([]byte, []int) {\n\treturn file_go_chromium_org_luci_analysis_internal_bugs_monorail_api_proto_users_proto_rawDescGZIP(), []int{0}\n}", "title": "" } ]
1d652776067d99a9caace928a0926d9a
SetOverwriteMode is a wrapper around the C function gtk_entry_set_overwrite_mode.
[ { "docid": "85b26d43974c4b85fe94971d4eb8c20c", "score": "0.8782222", "text": "func (recv *Entry) SetOverwriteMode(overwrite bool) {\n\tc_overwrite :=\n\t\tboolToGboolean(overwrite)\n\n\tC.gtk_entry_set_overwrite_mode((*C.GtkEntry)(recv.native), c_overwrite)\n\n\treturn\n}", "title": "" } ]
[ { "docid": "ebf0a2bc61ec454f9e109eb7161cef57", "score": "0.6851995", "text": "func (s *Options) SetOverwrite(key string, val interface{}) {\n\tk := wrapWithRxxtPrefix(key)\n\ts.setNxOverwrite(k, val)\n}", "title": "" }, { "docid": "7c84c6a9dbd6d2cbc4f4f51337379832", "score": "0.6686846", "text": "func (recv *TextView) SetOverwrite(overwrite bool) {\n\tc_overwrite :=\n\t\tboolToGboolean(overwrite)\n\n\tC.gtk_text_view_set_overwrite((*C.GtkTextView)(recv.native), c_overwrite)\n\n\treturn\n}", "title": "" }, { "docid": "6f763376753e472df4b30d682219b393", "score": "0.64888257", "text": "func (recv *Entry) GetOverwriteMode() bool {\n\tretC := C.gtk_entry_get_overwrite_mode((*C.GtkEntry)(recv.native))\n\tretGo := retC == C.TRUE\n\n\treturn retGo\n}", "title": "" }, { "docid": "bab9b69d85afcfe544523f1075f9b74d", "score": "0.6389696", "text": "func (fm *Form) SetOverwrite(b bool) *Form {\n\tfor _, c := range fm.ctrls {\n\t\tif p, ok := c.(overwriter); ok {\n\t\t\tp.setOverwrite(b)\n\t\t}\n\t}\n\treturn fm\n}", "title": "" }, { "docid": "5786c80f60eb7cece45f548930efaf59", "score": "0.6208339", "text": "func (b *Board) SetOverwriteFlag(canOverwrite bool) {\n\tb.m.Lock()\n\tb.canOverwrite = canOverwrite\n\tb.m.Unlock()\n}", "title": "" }, { "docid": "2d515a9cc607595df3069a842605e733", "score": "0.60807145", "text": "func (recv *FileChooser) SetDoOverwriteConfirmation(doOverwriteConfirmation bool) {\n\tc_do_overwrite_confirmation :=\n\t\tboolToGboolean(doOverwriteConfirmation)\n\n\tC.gtk_file_chooser_set_do_overwrite_confirmation((*C.GtkFileChooser)(recv.native), c_do_overwrite_confirmation)\n\n\treturn\n}", "title": "" }, { "docid": "2a6d47ebac8872389a6e6d7b5780bced", "score": "0.5721647", "text": "func (s *Options) SetNxOverwrite(key string, val interface{}) {\n\ts.setNxOverwrite(key, val)\n}", "title": "" }, { "docid": "9714bc6b284d55412cd345cb69bba4f4", "score": "0.57150006", "text": "func (gob *genericObject) SetOverwrite(name string, value PropertyValue) {\n\tobj := gob.Object()\n\towner, _ := obj.Property(name)\n\tif owner != nil {\n\t\towner.Set(name, value)\n\t}\n}", "title": "" }, { "docid": "4ae38af79f7bd92b4b5b122115766354", "score": "0.5510491", "text": "func (s *Options) SetRawOverwrite(key string, val interface{}) {\n\ts.setNxOverwrite(key, val)\n}", "title": "" }, { "docid": "2c33b7f1753cf9050e33ce732b42a901", "score": "0.5311071", "text": "func ConfirmOverwrite() Option {\n\treturn funcOption(func(o *options) { o.confirmOverwrite = true })\n}", "title": "" }, { "docid": "dd96f78204ee09e29ef7188492f3aef7", "score": "0.5285207", "text": "func (attr *Launcher) SetMode(mode Mode) {\n\tif attr == nil {\n\t\treturn\n\t}\n\tattr.mu.Lock()\n\tdefer attr.mu.Unlock()\n\tattr.changeMode = true\n\tattr.mode = mode\n}", "title": "" }, { "docid": "a982d5c078afc0c356ce7477d28aed06", "score": "0.5247934", "text": "func (o *ProjectedObject) SetModeEx(ctx context.Context, m os.FileMode) error {\n\terr := o.fs.localFs.Chmod(o.Name(), m)\n\tif nil != err {\n\t\treturn err\n\t}\n\terr = o.Sync()\n\treturn err\n}", "title": "" }, { "docid": "2c545bcb3fed02228e488cc495b1f5bf", "score": "0.5186169", "text": "func (r *Record) AllowOverwrite() pulumi.BoolOutput {\n\treturn (pulumi.BoolOutput)(r.s.State[\"allowOverwrite\"])\n}", "title": "" }, { "docid": "fae527df9ff17ec634333df58c066c02", "score": "0.51787704", "text": "func (o *UserSavePreferencesParams) SetOverwrite(overwrite *bool) {\n\to.Overwrite = overwrite\n}", "title": "" }, { "docid": "08200b4f6ce9dc25a7b86ce62031e218", "score": "0.51514053", "text": "func (recv *Window) SetDecorated(setting bool) {\n\tc_setting :=\n\t\tboolToGboolean(setting)\n\n\tC.gtk_window_set_decorated((*C.GtkWindow)(recv.native), c_setting)\n\n\treturn\n}", "title": "" }, { "docid": "ddb30f3166e64a4a75eabb5a12cc2ec1", "score": "0.51389104", "text": "func (recv *Entry) ConnectToggleOverwrite(callback EntrySignalToggleOverwriteCallback) int {\n\tsignalEntryToggleOverwriteLock.Lock()\n\tdefer signalEntryToggleOverwriteLock.Unlock()\n\n\tsignalEntryToggleOverwriteId++\n\tinstance := C.gpointer(recv.native)\n\thandlerID := C.Entry_signal_connect_toggle_overwrite(instance, C.gpointer(uintptr(signalEntryToggleOverwriteId)))\n\n\tdetail := signalEntryToggleOverwriteDetail{callback, handlerID}\n\tsignalEntryToggleOverwriteMap[signalEntryToggleOverwriteId] = detail\n\n\treturn signalEntryToggleOverwriteId\n}", "title": "" }, { "docid": "8dcc4359a280ac81be4c6bd06e75aa4a", "score": "0.51030016", "text": "func (ChannelOverwriteUpdate) EntryType() EntryType { return EntryTypeChannelOverwriteUpdate }", "title": "" }, { "docid": "176d7b8ab61ce9b12736fcc8391973af", "score": "0.5048768", "text": "func (recv *TextView) ConnectToggleOverwrite(callback TextViewSignalToggleOverwriteCallback) int {\n\tsignalTextViewToggleOverwriteLock.Lock()\n\tdefer signalTextViewToggleOverwriteLock.Unlock()\n\n\tsignalTextViewToggleOverwriteId++\n\tinstance := C.gpointer(recv.native)\n\thandlerID := C.TextView_signal_connect_toggle_overwrite(instance, C.gpointer(uintptr(signalTextViewToggleOverwriteId)))\n\n\tdetail := signalTextViewToggleOverwriteDetail{callback, handlerID}\n\tsignalTextViewToggleOverwriteMap[signalTextViewToggleOverwriteId] = detail\n\n\treturn signalTextViewToggleOverwriteId\n}", "title": "" }, { "docid": "a6bb6e0acbf2bbe545f31ab22492e4b9", "score": "0.5046389", "text": "func (o RecordOutput) AllowOverwrite() pulumi.BoolOutput {\n\treturn o.ApplyT(func(v *Record) pulumi.BoolOutput { return v.AllowOverwrite }).(pulumi.BoolOutput)\n}", "title": "" }, { "docid": "4bec42c65f5aa3e6014d97e34e73293d", "score": "0.49938697", "text": "func (recv *TextView) GetOverwrite() bool {\n\tretC := C.gtk_text_view_get_overwrite((*C.GtkTextView)(recv.native))\n\tretGo := retC == C.TRUE\n\n\treturn retGo\n}", "title": "" }, { "docid": "1895473cc42f1cee385b21365e9ac222", "score": "0.49848345", "text": "func (series *Series) Overwrite(newThing manager.Thing) error {\n\treturn errors.New(\"Overwrite not implemented for series\", errors.NotImplemented, \"series.Overwrite\", true)\n}", "title": "" }, { "docid": "e27b55fbbce9f25c732779ba794f8a64", "score": "0.49762672", "text": "func NewOverwrite(storage storageInterface, config *Config) *Overwrite {\n\treturn &Overwrite{storage: storage, config: config}\n}", "title": "" }, { "docid": "9027dd0ff7d404076410cddfa2d70eda", "score": "0.49422738", "text": "func (w *TextView) SetEditable(setting bool) {\n\tw.Candy().Guify(\"gtk_text_view_set_editable\", w, setting)\n}", "title": "" }, { "docid": "c5e440ab37486c1495fbccf4b9407f2f", "score": "0.49393678", "text": "func (o *ProjectedObject) SetMode(m os.FileMode) error {\n\tctx, _ := o.ctxGen(\"SetMode\", deadlineKeyMetadataWrite)\n\treturn o.SetModeEx(ctx, m)\n}", "title": "" }, { "docid": "e8cba6c07b06974272d1a5a6aa857026", "score": "0.4923687", "text": "func (w *TextView) SetWrapMode(wrapMode WrapMode) {\n\tw.Candy().Guify(\"gtk_text_view_set_wrap_mode\", w, wrapMode)\n}", "title": "" }, { "docid": "e309329c20fb9819a0644262ccb6282a", "score": "0.490822", "text": "func SaveOverride(encoder Encoder, fs afero.Fs, root string, o *Override) error {\n\tif o == nil {\n\t\treturn errors.New(\"override was nil\")\n\t}\n\n\to.APIVersion = overrideVersion\n\to.Kind = overrideKind\n\n\tf, err := fs.OpenFile(overridePath(root), os.O_WRONLY|os.O_CREATE, DefaultFilePermissions)\n\tif err != nil {\n\t\treturn err\n\t}\n\n\tif err := encoder.Encode(o, f); err != nil {\n\t\treturn errors.Wrap(err, \"encoding override\")\n\t}\n\n\treturn nil\n}", "title": "" }, { "docid": "bcc9935733089376f92940f47b40ac06", "score": "0.48829055", "text": "func (recv *TextView) SetWrapMode(wrapMode WrapMode) {\n\tc_wrap_mode := (C.GtkWrapMode)(wrapMode)\n\n\tC.gtk_text_view_set_wrap_mode((*C.GtkTextView)(recv.native), c_wrap_mode)\n\n\treturn\n}", "title": "" }, { "docid": "07fcb3301ab0fb4e8281899c44f2c9b3", "score": "0.48819366", "text": "func (s *Stream) SetOverride(attr rich.Attr) *Stream {\n\treturn s.append(s.Editor.SetOverride(attr))\n}", "title": "" }, { "docid": "bf16f71a64365e4ace26baef476ff1d7", "score": "0.4858732", "text": "func (recv *TextView) SetEditable(setting bool) {\n\tc_setting :=\n\t\tboolToGboolean(setting)\n\n\tC.gtk_text_view_set_editable((*C.GtkTextView)(recv.native), c_setting)\n\n\treturn\n}", "title": "" }, { "docid": "d9ff9466fc9d067ab9bc93e264bff657", "score": "0.48336968", "text": "func overrideModeHelper(tmpMode string) func() {\n\tbackupMode := mode\n\tmode = tmpMode\n\treturn func() {\n\t\tmode = backupMode\n\t}\n}", "title": "" }, { "docid": "aba3408f11f6e8a8487cd2745b0a6d61", "score": "0.48055348", "text": "func (o *PostAPI24VolumesParams) SetOverwrite(overwrite *bool) {\n\to.Overwrite = overwrite\n}", "title": "" }, { "docid": "ccb562365b6036d9c65f05920083130d", "score": "0.47933838", "text": "func (m *HybridAgentUpdaterConfiguration) SetAllowUpdateConfigurationOverride(value *bool)() {\n err := m.GetBackingStore().Set(\"allowUpdateConfigurationOverride\", value)\n if err != nil {\n panic(err)\n }\n}", "title": "" }, { "docid": "c5bf621c9f4249b8d44b0b2de4bd7572", "score": "0.47685438", "text": "func (o ConfigurationSettingPtrOutput) AllowModuleOverwrite() pulumi.StringPtrOutput {\n\treturn o.ApplyT(func(v *ConfigurationSetting) *string {\n\t\tif v == nil {\n\t\t\treturn nil\n\t\t}\n\t\treturn v.AllowModuleOverwrite\n\t}).(pulumi.StringPtrOutput)\n}", "title": "" }, { "docid": "9fa8a569f9c8d8871f9aa0f9f2ff1ed9", "score": "0.47665596", "text": "func (o ConfigurationSettingOutput) AllowModuleOverwrite() pulumi.StringPtrOutput {\n\treturn o.ApplyT(func(v ConfigurationSetting) *string { return v.AllowModuleOverwrite }).(pulumi.StringPtrOutput)\n}", "title": "" }, { "docid": "33d6be3813729132d5404f33928078ee", "score": "0.47647378", "text": "func (recv *ToolPalette) SetExclusive(group *ToolItemGroup, exclusive bool) {\n\tc_group := (*C.GtkToolItemGroup)(C.NULL)\n\tif group != nil {\n\t\tc_group = (*C.GtkToolItemGroup)(group.ToC())\n\t}\n\n\tc_exclusive :=\n\t\tboolToGboolean(exclusive)\n\n\tC.gtk_tool_palette_set_exclusive((*C.GtkToolPalette)(recv.native), c_group, c_exclusive)\n\n\treturn\n}", "title": "" }, { "docid": "b696dd14b94c0519d808271777a766ed", "score": "0.47576472", "text": "func (o ConfigurationSettingResponsePtrOutput) AllowModuleOverwrite() pulumi.StringPtrOutput {\n\treturn o.ApplyT(func(v *ConfigurationSettingResponse) *string {\n\t\tif v == nil {\n\t\t\treturn nil\n\t\t}\n\t\treturn v.AllowModuleOverwrite\n\t}).(pulumi.StringPtrOutput)\n}", "title": "" }, { "docid": "f296fefd4f8f9f75a5e3a7f9179c076b", "score": "0.47387484", "text": "func (recv *TextView) DisconnectToggleOverwrite(connectionID int) {\n\tsignalTextViewToggleOverwriteLock.Lock()\n\tdefer signalTextViewToggleOverwriteLock.Unlock()\n\n\tdetail, exists := signalTextViewToggleOverwriteMap[connectionID]\n\tif !exists {\n\t\treturn\n\t}\n\n\tinstance := C.gpointer(recv.native)\n\tC.g_signal_handler_disconnect(instance, detail.handlerID)\n\tdelete(signalTextViewToggleOverwriteMap, connectionID)\n}", "title": "" }, { "docid": "630098f9e0b2518aa649e3bb8ba2c185", "score": "0.4730305", "text": "func SetMode(mode Mode) error {\n\tkey, _, err := registry.CreateKey(registry.CURRENT_USER, \"Control Panel\\\\Desktop\", registry.SET_VALUE)\n\tif err != nil {\n\t\treturn err\n\t}\n\tdefer key.Close()\n\n\tvar tile string\n\tif mode == Tile {\n\t\ttile = \"1\"\n\t} else {\n\t\ttile = \"0\"\n\t}\n\terr = key.SetStringValue(\"TileWallpaper\", tile)\n\tif err != nil {\n\t\treturn err\n\t}\n\n\tvar style string\n\tswitch mode {\n\tcase Center, Tile:\n\t\tstyle = \"0\"\n\tcase Fit:\n\t\tstyle = \"6\"\n\tcase Span:\n\t\tstyle = \"22\"\n\tcase Stretch:\n\t\tstyle = \"2\"\n\tcase Crop:\n\t\tstyle = \"10\"\n\tdefault:\n\t\tpanic(\"invalid wallpaper mode\")\n\t}\n\terr = key.SetStringValue(\"WallpaperStyle\", style)\n\tif err != nil {\n\t\treturn err\n\t}\n\n\t// updates wallpaper\n\tpath, err := Get()\n\tif err != nil {\n\t\treturn err\n\t}\n\n\treturn SetFromFile(path)\n}", "title": "" }, { "docid": "9b7902e5a1c4f30fd0a6401350424bea", "score": "0.47118914", "text": "func (recv *Editable) SetPosition(position int32) {\n\tc_position := (C.gint)(position)\n\n\tC.gtk_editable_set_position((*C.GtkEditable)(recv.native), c_position)\n\n\treturn\n}", "title": "" }, { "docid": "3c9583dfc2744cab9027ccb1e8302b01", "score": "0.47038257", "text": "func (o ConfigurationSettingResponseOutput) AllowModuleOverwrite() pulumi.StringPtrOutput {\n\treturn o.ApplyT(func(v ConfigurationSettingResponse) *string { return v.AllowModuleOverwrite }).(pulumi.StringPtrOutput)\n}", "title": "" }, { "docid": "797bc7c314477c6d53f4ab13ec3cb295", "score": "0.46974534", "text": "func (recv *Entry) DisconnectToggleOverwrite(connectionID int) {\n\tsignalEntryToggleOverwriteLock.Lock()\n\tdefer signalEntryToggleOverwriteLock.Unlock()\n\n\tdetail, exists := signalEntryToggleOverwriteMap[connectionID]\n\tif !exists {\n\t\treturn\n\t}\n\n\tinstance := C.gpointer(recv.native)\n\tC.g_signal_handler_disconnect(instance, detail.handlerID)\n\tdelete(signalEntryToggleOverwriteMap, connectionID)\n}", "title": "" }, { "docid": "acbc42a05cbf60150abaef84cb0cb98c", "score": "0.46952665", "text": "func (l *Lora) SetMode(mode int) (string, error) {\n\treturn l.tx(fmt.Sprintf(\"mode=%d\", mode), readline)\n}", "title": "" }, { "docid": "5323aef52e662786686f5d21ab7967dc", "score": "0.46949792", "text": "func (ChannelOverwriteCreate) EntryType() EntryType { return EntryTypeChannelOverwriteCreate }", "title": "" }, { "docid": "8cd5b158dbca0bdbeb19bd12af9030a5", "score": "0.46747336", "text": "func (v *Editable) SetEditable(isEditable bool) {\n\tC.gtk_editable_set_editable(v.native(), gbool(isEditable))\n}", "title": "" }, { "docid": "4f243ecb69d06628640f4ab240e60b29", "score": "0.46625873", "text": "func (tx *DisplayTransform) SetLooksOverride(looks string) {\n\tc_str := C.CString(looks)\n\n\tdefer C.free(unsafe.Pointer(c_str))\n\tC.DisplayTransform_setLooksOverride(tx.ptr, c_str)\n\truntime.KeepAlive(tx)\n\truntime.KeepAlive(c_str)\n}", "title": "" }, { "docid": "31bd37caf48520e32bd8363f2cfa37f9", "score": "0.46612808", "text": "func (recv *Editable) SetEditable(isEditable bool) {\n\tc_is_editable :=\n\t\tboolToGboolean(isEditable)\n\n\tC.gtk_editable_set_editable((*C.GtkEditable)(recv.native), c_is_editable)\n\n\treturn\n}", "title": "" }, { "docid": "7fac30ac582db931943ee25b06ae47c1", "score": "0.4616486", "text": "func (o *CopyDirectoryParams) SetOverwrite(overwrite *bool) {\n\to.Overwrite = overwrite\n}", "title": "" }, { "docid": "cf2b193e25b9aa069b51737b8c8a9eb4", "score": "0.4612789", "text": "func (sm *SettingsManager) Overwrite(settings *models.Settings) (*models.Settings, error) {\n\texistingSettings, _ := sm.getDefault()\n\n\t// get system info\n\tsysInfo, err := sm.GetSystemInfo()\n\tif err != nil {\n\t\tg.Log.Error(\"failed to retrieve system info\", err)\n\t\treturn nil, err\n\t}\n\n\tif existingSettings != nil {\n\t\tsysInfo.GatewayID = existingSettings.GatewayID\n\t\tsysInfo.RegistryID = existingSettings.RegistryID\n\t}\n\n\tupdSettings, err := sm.updateSettingsWithMQTTCredentials(sysInfo, settings)\n\tif err != nil {\n\t\tg.Log.Error(\"failed to update settings\", err)\n\t\treturn nil, err\n\t}\n\n\treturn updSettings, nil\n}", "title": "" }, { "docid": "dbd201d47ee76ba6e2c83c3964c967ed", "score": "0.45987722", "text": "func (_this *SourceBuffer) SetMode(value AppendMode) {\n\tinput := value.JSValue()\n\t_this.Value_JS.Set(\"mode\", input)\n}", "title": "" }, { "docid": "645613288c3d4196cd47ad950f9f935d", "score": "0.45678762", "text": "func (tx *DisplayTransform) SetLooksOverrideEnabled(enabled bool) {\n\tC.DisplayTransform_setLooksOverrideEnabled(tx.ptr, C.bool(enabled))\n\truntime.KeepAlive(tx)\n}", "title": "" }, { "docid": "93e0ba74322d2ec8f0ade1906f458d68", "score": "0.45570153", "text": "func (v *Editable) SetPosition(position int) {\n\tC.gtk_editable_set_position(v.native(), C.gint(position))\n}", "title": "" }, { "docid": "cbe6845adb2000c0e8ee1b2b0736a77c", "score": "0.45448318", "text": "func OverwritesForbidden() ChestOption {\n\treturn newFuncOption(func(o *ChestOptions) {\n\t\to.overwrites = false\n\t})\n}", "title": "" }, { "docid": "2e097e88326df4ba5d84a7143a6198d8", "score": "0.45410585", "text": "func (b *Board) GetOverwriteFlag() (canOverwrite bool) {\n\tb.m.Lock()\n\tcanOverwrite = b.canOverwrite\n\tb.m.Unlock()\n\n\treturn\n}", "title": "" }, { "docid": "3faa5949dcc7efd7abe5f5e66dece191", "score": "0.45231897", "text": "func (m *Mate) SetMode(mode string) {\n\tm.mode = mode\n}", "title": "" }, { "docid": "65510b54291033b7f2f00909bc895b9e", "score": "0.4497892", "text": "func (cli *Client) SetEmacs() {\n\tif cli.readline.IsVimMode() {\n\t\tcli.readline.SetVimMode(false)\n\t\tprintln(\"mode changed to emacs\")\n\t} else {\n\t\tprintln(\"mode already is emacs\")\n\t}\n}", "title": "" }, { "docid": "b1a8d231776acdd9cdaa7f799bb0451e", "score": "0.44946346", "text": "func (e *MultilineEntry) SetReadOnly(ro bool) {\n\tC.uiMultilineEntrySetReadOnly(e.e, frombool(ro))\n}", "title": "" }, { "docid": "d8e903b9da25b5cef7524230b3bddc83", "score": "0.44838306", "text": "func (t *Txn) SetReadOnlyMode(mode bool) {\n\tif mode {\n\t\tt.put(metaBucket, readOnlyKey, nil, defaultFillPct)\n\t} else {\n\t\tt.delete(metaBucket, readOnlyKey)\n\t}\n}", "title": "" }, { "docid": "4ce2fcbf5b7ec16b0b56117151d0b92e", "score": "0.4481364", "text": "func (m *OnPremisesConditionalAccessSettings) SetOverrideDefaultRule(value *bool)() {\n err := m.GetBackingStore().Set(\"overrideDefaultRule\", value)\n if err != nil {\n panic(err)\n }\n}", "title": "" }, { "docid": "65d9550c2006836c4ebaf63fe45fd909", "score": "0.44796956", "text": "func (recv *TextBuffer) SetModified(setting bool) {\n\tc_setting :=\n\t\tboolToGboolean(setting)\n\n\tC.gtk_text_buffer_set_modified((*C.GtkTextBuffer)(recv.native), c_setting)\n\n\treturn\n}", "title": "" }, { "docid": "343822fc71d1aaccc3c49f0bba150620", "score": "0.44748983", "text": "func MergeWithOverwrite(dst, src interface{}) error {\n\treturn merge(dst, src, true)\n}", "title": "" }, { "docid": "bff0dfcad2b8d9b39cf3455effd557d8", "score": "0.44720668", "text": "func (recv *FileChooser) GetDoOverwriteConfirmation() bool {\n\tretC := C.gtk_file_chooser_get_do_overwrite_confirmation((*C.GtkFileChooser)(recv.native))\n\tretGo := retC == C.TRUE\n\n\treturn retGo\n}", "title": "" }, { "docid": "878200f8022db55334fd9d5a0ccc50fc", "score": "0.446083", "text": "func (m *OnPremisesDirectorySynchronizationFeature) SetFopeConflictResolutionEnabled(value *bool)() {\n err := m.GetBackingStore().Set(\"fopeConflictResolutionEnabled\", value)\n if err != nil {\n panic(err)\n }\n}", "title": "" }, { "docid": "c409e32ad1941501c1fd2792021fe813", "score": "0.44523096", "text": "func (h *HostActionMute) SetOverride(v bool) {\n\th.Override = &v\n}", "title": "" }, { "docid": "672456649a5677d667292af2f59b0fda", "score": "0.44332752", "text": "func (m *SimpleManager) Overwrite(thing Thing) (Thing, error) {\n\tif err := thing.Check(); err != nil {\n\t\treturn nil, errors.Wrap(err, \"simpleManager.Overwrite\")\n\t}\n\toldThing, err := m.Get(thing.GetID())\n\tif err != nil {\n\t\treturn nil, errors.Wrap(err, \"simpleManager.Overwrite (\"+thing.Type()+\")\")\n\t}\n\toldThing.Overwrite(thing)\n\treturn oldThing, m.Save(oldThing)\n}", "title": "" }, { "docid": "204ae2a7f585f8a87f484641b26a9e64", "score": "0.440246", "text": "func (m *Windows10CompliancePolicy) SetDefenderVersion(value *string)() {\n err := m.GetBackingStore().Set(\"defenderVersion\", value)\n if err != nil {\n panic(err)\n }\n}", "title": "" }, { "docid": "c135aa85fcb73034da726d0c22a9766e", "score": "0.43798968", "text": "func GetOverwrite(channel *discordgo.Channel, target interface{}) *discordgo.PermissionOverwrite {\n\tvar id Snowflake\n\tvar typ string\n\n\tswitch t := target.(type) {\n\tcase *discordgo.Role:\n\t\tid = t.ID\n\t\ttyp = \"role\"\n\tcase *discordgo.Member:\n\t\tid = t.User.ID\n\t\ttyp = \"user\"\n\tcase *discordgo.User:\n\t\tid = t.ID\n\t\ttyp = \"user\"\n\tdefault:\n\t\tpanic(errors.New(\"invalid overwrite target type\"))\n\t}\n\n\treturn GetOverwriteByID(channel, id, typ)\n}", "title": "" }, { "docid": "5a783f8d1bc678fdade60811a08bb4d9", "score": "0.43715462", "text": "func (gob *genericObject) DeleteOverwrite(name string) {\n\tobj := gob.Object()\n\towner, _ := obj.Property(name)\n\tif owner == nil {\n\t\treturn\n\t}\n\towner.Delete(name)\n}", "title": "" }, { "docid": "f76a3cad1a9fabb61fd45f8cfcdd2968", "score": "0.43681842", "text": "func (ChannelOverwriteDelete) EntryType() EntryType { return EntryTypeChannelOverwriteDelete }", "title": "" }, { "docid": "d6639e521cf9aab2e263ddafd9b8dfb6", "score": "0.4348548", "text": "func (l *Locker) overwriteLock(c context.Context, key *datastore.Key, entity Lockable, requestID string) error {\n\tlog.Debugf(c, \"overwriteLock %s %s\", key.String(), requestID)\n\tif l.AlertOnOverwrite {\n\t\tif err := alertAdmins(c, key, entity, \"Lock overwrite\"); err != nil {\n\t\t\tlog.Errorf(c, \"failed to send alert email for lock overwrite: %v\", err)\n\t\t}\n\t}\n\terr := datastore.RunInTransaction(c, func(tc context.Context) error {\n\t\tif err := datastore.Get(tc, key, entity); err != nil {\n\t\t\treturn err\n\t\t}\n\t\tlock := entity.getLock()\n\t\tlock.Timestamp = getTime()\n\t\tlock.RequestID = requestID\n\t\tif _, err := datastore.Put(tc, key, entity); err != nil {\n\t\t\treturn err\n\t\t}\n\t\treturn nil\n\t}, nil)\n\treturn err\n}", "title": "" }, { "docid": "600ff538a0e3323d7c7911f93e81d133", "score": "0.4347034", "text": "func (m *Map) SetFallback(mode string, handler func(ivo.Context, []ivo.Key)) {\n\tnode := m.mode(mode)\n\tnode.handler = handler\n}", "title": "" }, { "docid": "ede87678db9f82e469d3f8a29eb967f7", "score": "0.43432215", "text": "func (o ParameterOutput) Overwrite() pulumi.BoolPtrOutput {\n\treturn o.ApplyT(func(v *Parameter) pulumi.BoolPtrOutput { return v.Overwrite }).(pulumi.BoolPtrOutput)\n}", "title": "" }, { "docid": "c94895e44844570c04a1d97d10a4b8e6", "score": "0.4326562", "text": "func (w *Window) SetCharModsCallback(cbfun CharModsCallback) (previous CharModsCallback) {\n\tprevious = w.fCharModsHolder\n\tw.fCharModsHolder = cbfun\n\tif cbfun == nil {\n\t\tC.glfwSetCharModsCallback(w.data, nil)\n\t} else {\n\t\tC.glfwSetCharModsCallbackCB(w.data)\n\t}\n\tpanicError()\n\treturn previous\n}", "title": "" }, { "docid": "06959601fed263156c10ffa3a7c4aba5", "score": "0.43262336", "text": "func (p *PID) SetMode(mode int16) {\n\tvar newIsAuto = bool(mode == Auto)\n\n\tif newIsAuto != p.modeAuto {\n\t\tp.Initialize()\n\t}\n\tp.modeAuto = newIsAuto\n}", "title": "" }, { "docid": "1b05b4f6b92bc89dad6f073de320176f", "score": "0.4316933", "text": "func (m *HybridAgentUpdaterConfiguration) SetUpdateWindow(value UpdateWindowable)() {\n err := m.GetBackingStore().Set(\"updateWindow\", value)\n if err != nil {\n panic(err)\n }\n}", "title": "" }, { "docid": "a59984c0f29dc9ff01feefc10d70ccca", "score": "0.43122685", "text": "func (recv *Window) SetDeletable(setting bool) {\n\tc_setting :=\n\t\tboolToGboolean(setting)\n\n\tC.gtk_window_set_deletable((*C.GtkWindow)(recv.native), c_setting)\n\n\treturn\n}", "title": "" }, { "docid": "30160049f37060b63986b35e626f5621", "score": "0.43052655", "text": "func (b *Bundler) setMode(m mode) error {\n\tb.mu.Lock()\n\tdefer b.mu.Unlock()\n\tif b.mode == m || b.mode == none {\n\t\tb.mode = m\n\t\treturn nil\n\t}\n\treturn errMixedMethods\n}", "title": "" }, { "docid": "64960d403c3eaa82cffaf055e1aa197f", "score": "0.43035072", "text": "func (a *Archive) SetMode(mode func(name string, m fs.FileMode) fs.FileMode) {\n\tfor i := range a.Files {\n\t\ta.Files[i].Mode = mode(a.Files[i].Name, a.Files[i].Mode)\n\t}\n}", "title": "" }, { "docid": "26b8611fe42ec4ef1f838ce19161e80c", "score": "0.43024138", "text": "func (v *SourceGutterRenderer) SetAlignmentMode(amode SourceGutterRendererAlignmentMode) {\n\tC.gtk_source_gutter_renderer_set_alignment_mode(\n\t\tv.native(), C.GtkSourceGutterRendererAlignmentMode(amode))\n}", "title": "" }, { "docid": "47f04271d7fb061a9a9807c70851c6db", "score": "0.4295717", "text": "func (f *Pekwm) SetMode(mode string) {\n\tf.mode = mode\n}", "title": "" }, { "docid": "b1feab010897265fa571718441f7ad25", "score": "0.42894965", "text": "func (m *Windows10EndpointProtectionConfiguration) SetDefenderSecurityCenterBlockExploitProtectionOverride(value *bool)() {\n err := m.GetBackingStore().Set(\"defenderSecurityCenterBlockExploitProtectionOverride\", value)\n if err != nil {\n panic(err)\n }\n}", "title": "" }, { "docid": "7de2860bd49160370db50a3323db9b65", "score": "0.42777663", "text": "func (recv *AppChooserWidget) SetShowFallback(setting bool) {\n\tc_setting :=\n\t\tboolToGboolean(setting)\n\n\tC.gtk_app_chooser_widget_set_show_fallback((*C.GtkAppChooserWidget)(recv.native), c_setting)\n\n\treturn\n}", "title": "" }, { "docid": "d0242a35b7a4fa95115cb9e105a022f7", "score": "0.42694995", "text": "func (w *Window) SetInputMode(mode InputMode, value int) {\n\tC.glfwSetInputMode(w.data, C.int(mode), C.int(value))\n\tpanicError()\n}", "title": "" }, { "docid": "d388c35656f102db3d64d80e20c52a25", "score": "0.42678237", "text": "func (opts *Options) SetInplaceUpdateSupport(value bool) {\n\tC.rocksdb_options_set_inplace_update_support(opts.c, boolToChar(value))\n}", "title": "" }, { "docid": "4b14094ece9d34e0c4e19ac0a001ab33", "score": "0.42646682", "text": "func MarkEOW(t bool) FuncOpt {\n\treturn func(m *funcMod) {\n\t\tm.markEOW = t\n\t}\n}", "title": "" }, { "docid": "adf9aa1d8ab21fcbab257a02bb4f3c40", "score": "0.42585108", "text": "func (recv *Entry) SetActivatesDefault(setting bool) {\n\tc_setting :=\n\t\tboolToGboolean(setting)\n\n\tC.gtk_entry_set_activates_default((*C.GtkEntry)(recv.native), c_setting)\n\n\treturn\n}", "title": "" }, { "docid": "420b7e78719b08c4438ccee8710db4b5", "score": "0.4253581", "text": "func parseOverwrite(s string) (overwriteMode, error) {\n\tswitch strings.ToLower(s) {\n\tcase OverwriteNone:\n\t\treturn modeOverwriteNone, nil\n\tcase OverwriteAll:\n\t\treturn modeOverwriteAll, nil\n\tcase OverwriteOld:\n\t\treturn modeOverwriteOld, nil\n\t}\n\treturn modeOverwriteNone, ErrInvalidOverwrite\n}", "title": "" }, { "docid": "d10ed1a3d01907955cd5c16d7ecbd266", "score": "0.42505553", "text": "func (af *aggFunction) SetMode(mode AggFunctionMode) {\n\taf.mode = mode\n}", "title": "" }, { "docid": "cda39601b713235ba77d0b165fcc2d7e", "score": "0.42469463", "text": "func SetBlendMode(mode int32) {\n\tcmode := C.int(mode)\n\tC.rlSetBlendMode(cmode)\n}", "title": "" }, { "docid": "b0be036734ab4b87f53d2f3b6330e680", "score": "0.42373565", "text": "func (m *Group) SetOnenote(value Onenoteable)() {\n err := m.GetBackingStore().Set(\"onenote\", value)\n if err != nil {\n panic(err)\n }\n}", "title": "" }, { "docid": "d3d2bab917af792cb0fd8d741996f8b4", "score": "0.42301735", "text": "func (c *Client) SetMode(location, mode, nick string) {\n\tfmt.Fprintf(c.Connection, MODE+\" %s %s %s\\r\\n\", location, mode, nick)\n}", "title": "" }, { "docid": "1be2eeafb2232ce16566c40d75cc43cc", "score": "0.4225586", "text": "func (s *ImportSourceCredentialsInput) SetShouldOverwrite(v bool) *ImportSourceCredentialsInput {\n\ts.ShouldOverwrite = &v\n\treturn s\n}", "title": "" }, { "docid": "33d50d85dac44e4a64a116d217e263f1", "score": "0.42148548", "text": "func (m *TranslationPreferences) SetLanguageOverrides(value []TranslationLanguageOverrideable)() {\n err := m.GetBackingStore().Set(\"languageOverrides\", value)\n if err != nil {\n panic(err)\n }\n}", "title": "" }, { "docid": "3a3063891a9f37fcacde15b0e6eb1be2", "score": "0.4207871", "text": "func UserConfirmedOverwrite(resourceType string, ignoringConfirmed bool) bool {\n\tif !ignoringConfirmed {\n\t\tmessage := fmt.Sprintf(\"overwrite the %s\", resourceType)\n\t\terr := AskForConfirm(message)\n\t\tif err != nil {\n\t\t\treturn false\n\t\t}\n\t}\n\n\treturn true\n}", "title": "" }, { "docid": "2096ab22f5f2af6f1901dde214491651", "score": "0.42039755", "text": "func (l *Locks) SetProviderOverridden(addr addrs.Provider) {\n\tif l.overriddenProviders == nil {\n\t\tl.overriddenProviders = make(map[addrs.Provider]struct{})\n\t}\n\tl.overriddenProviders[addr] = struct{}{}\n}", "title": "" }, { "docid": "81d0e5130a2bfa3abaa1251c7b400581", "score": "0.41969192", "text": "func (recv *ToggleButton) SetMode(drawIndicator bool) {\n\tc_draw_indicator :=\n\t\tboolToGboolean(drawIndicator)\n\n\tC.gtk_toggle_button_set_mode((*C.GtkToggleButton)(recv.native), c_draw_indicator)\n\n\treturn\n}", "title": "" }, { "docid": "1fe8edda28cfd2abac1f3dc77c668d41", "score": "0.41941002", "text": "func (s *ConsistencyWithMeta) TestReadOverwriteOperation() {\n\tstorage := s.newStorage()\n\tReadOverwriteOperation(s.t, storage, RandomValue(10, 20), true)\n}", "title": "" }, { "docid": "8d78279690e8d347e3734dd916d449e9", "score": "0.41919175", "text": "func _setfilemode(path string, mode os.FileMode) {\n\terr := os.Chmod(path, mode)\n\tif err != nil {\n\t\tpanic(err)\n\t}\n}", "title": "" }, { "docid": "6b67278b32ad3d6d4ea2e8db61ccaa47", "score": "0.41909108", "text": "func (store Store) SetMode(id int64, mode Mode) error {\n\terr := store.db.Update(func(tx *bolt.Tx) error {\n\t\treturn tx.Bucket(bucket.Modes).Put(itob(id), itob(int64(mode)))\n\t})\n\tif err != nil {\n\t\treturn fmt.Errorf(\"[id=%d,mode=%v] failed to set mode: %v\", id, mode, err)\n\t}\n\treturn nil\n}", "title": "" }, { "docid": "7ec5fc734959cfe1cd984bcb75f0ed38", "score": "0.41871163", "text": "func SetInputMode(mode InputMode) InputMode {\n\tif mode != InputCurrent {\n\t\tinput_mode = mode\n\t}\n\treturn input_mode\n}", "title": "" }, { "docid": "3ca4aaa81736262b017b9449ee194154", "score": "0.41805387", "text": "func (btn *ToggleButton) SetMode(drawIndicator bool) {\n\tbtn.Candy().Guify(\"gtk_toggle_button_set_mode\", btn, drawIndicator)\n}", "title": "" } ]
9c095f76b5331d85868f32e973b60ad9
AsChatParticipantAdmin returns copy with only ChatParticipantAdmin constructors.
[ { "docid": "f5e28a97bcd83b4923a6fb441e4c7b66", "score": "0.6918058", "text": "func (s ChatParticipantClassArray) AsChatParticipantAdmin() (to ChatParticipantAdminArray) {\n\tfor _, elem := range s {\n\t\tvalue, ok := elem.(*ChatParticipantAdmin)\n\t\tif !ok {\n\t\t\tcontinue\n\t\t}\n\t\tto = append(to, *value)\n\t}\n\n\treturn to\n}", "title": "" } ]
[ { "docid": "cececa2128f62d803046753eaeac92cc", "score": "0.6120856", "text": "func (c ChatParticipantAdmin) construct() ChatParticipantClass { return &c }", "title": "" }, { "docid": "b776366a609b7902f1297d3c017b3b2d", "score": "0.54616827", "text": "func (*ChatParticipantAdmin) TypeName() string {\n\treturn \"chatParticipantAdmin\"\n}", "title": "" }, { "docid": "70e4905088b33443f682e896e2cb58cb", "score": "0.50899684", "text": "func (pc *PeerClient) Admin() (pb.AdminClient, error) {\n\tconn, err := pc.commonClient.NewConnection(pc.address, pc.sn)\n\tif err != nil {\n\t\treturn nil, errors.WithMessage(err,\n\t\t\tfmt.Sprintf(\"admin client failed to connect to %s\", pc.address))\n\t}\n\treturn pb.NewAdminClient(conn), nil\n}", "title": "" }, { "docid": "5616333a8da44fd1ee8d8dce530130a6", "score": "0.5042347", "text": "func (s ChatParticipantClassArray) AsChatParticipant() (to ChatParticipantArray) {\n\tfor _, elem := range s {\n\t\tvalue, ok := elem.(*ChatParticipant)\n\t\tif !ok {\n\t\t\tcontinue\n\t\t}\n\t\tto = append(to, *value)\n\t}\n\n\treturn to\n}", "title": "" }, { "docid": "5f649722b243cadcaa95868a84554610", "score": "0.50131744", "text": "func (c ChatParticipant) construct() ChatParticipantClass { return &c }", "title": "" }, { "docid": "0d56a256fd4a195f6c2605c585d6363f", "score": "0.4992581", "text": "func (c ChannelsChannelParticipantsNotModified) construct() ChannelsChannelParticipantsClass {\n\treturn &c\n}", "title": "" }, { "docid": "3315003bfd5febe3680727636aedc814", "score": "0.49895096", "text": "func (c ChatParticipantCreator) construct() ChatParticipantClass { return &c }", "title": "" }, { "docid": "4166f77d465bd2e5b473425bd9ad6fb6", "score": "0.49111098", "text": "func (b *GetParticipantsQueryBuilder) Admins() *GetParticipantsQueryBuilder {\n\tb.req.Filter = &tg.ChannelParticipantsAdmins{}\n\treturn b\n}", "title": "" }, { "docid": "4b95044bc42d189b9a0fb7bce0878f57", "score": "0.4899241", "text": "func (s ChatParticipantClassArray) AsChatParticipantCreator() (to ChatParticipantCreatorArray) {\n\tfor _, elem := range s {\n\t\tvalue, ok := elem.(*ChatParticipantCreator)\n\t\tif !ok {\n\t\t\tcontinue\n\t\t}\n\t\tto = append(to, *value)\n\t}\n\n\treturn to\n}", "title": "" }, { "docid": "3e715b121354d945750cd7dc96f0a946", "score": "0.482121", "text": "func NewRoomAdminRpcClient(client *liverpc.Client) RoomAdmin {\n\treturn &roomAdminRpcClient{\n\t\tclient: client,\n\t}\n}", "title": "" }, { "docid": "1c2123732765045f3d4e92b5a119f141", "score": "0.4778347", "text": "func (newAdmin *NewAdmin) ToAdmin() (*Admin, error) {\n\n\t// Construct a Admin based on NewAdmin.\n\tadmin := &Admin{\n\t\tID: bson.NewObjectId(),\n\t\tUserName: newAdmin.UserName,\n\t\tFirstName: newAdmin.FirstName,\n\t\tLastName: newAdmin.LastName,\n\t}\n\n\t// Trim leading and trailing whitespace from an email address.\n\temail := strings.TrimSpace(newAdmin.Email)\n\n\t// Force all characters in the email to be lower-case.\n\temail = strings.ToLower(email)\n\n\t// Update Email field.\n\tadmin.Email = email\n\n\t// md5 hash the final email string.\n\th := md5.New()\n\tio.WriteString(h, email)\n\tresult := hex.EncodeToString(h.Sum(nil))\n\n\t// Set the PhotoURL field of the new Admin to\n\t// the Gravatar PhotoURL for the admin's email address.\n\tphotoURL := gravatarBasePhotoURL + result\n\tadmin.PhotoURL = photoURL\n\n\t// Call .SetPassword() to set the PassHash\n\t// field of the Admin to a hash of the NewAdmin.Password.\n\terr := admin.SetPassword(newAdmin.Password)\n\tif err != nil {\n\t\treturn nil, fmt.Errorf(\"error setting password hash of the Admin: %v\", err)\n\t}\n\n\treturn admin, nil\n}", "title": "" }, { "docid": "ea6f42acab58aa19190e9b7357115777", "score": "0.47402066", "text": "func (c ChannelsChannelParticipants) construct() ChannelsChannelParticipantsClass { return &c }", "title": "" }, { "docid": "15ee66f8dcb4ba63b3572caf814e898c", "score": "0.47378558", "text": "func (b *Bot) GetChatAdministrators(request axon.O) (result axon.A, err error) {\n\tvar response interface{}\n\tif response, err = b.doPost(\"getChatAdministrators\", request); err == nil {\n\t\tresult = response.([]interface{})\n\t}\n\treturn\n}", "title": "" }, { "docid": "c52ee1f68385c683f4e4de722859e49b", "score": "0.47277898", "text": "func (*ChatParticipantAdmin) TypeID() uint32 {\n\treturn ChatParticipantAdminTypeID\n}", "title": "" }, { "docid": "11ef901a28e134cc9473c044aabb6af9", "score": "0.46662647", "text": "func NewAdmin(addrs []string, options *AdminOptions, log logr.Logger) IAdmin {\n\ta := &Admin{\n\t\thashMaxSlots: DefaultHashMaxSlots,\n\t\tlog: log.WithName(\"redis_util\"),\n\t}\n\n\t// perform initial connections\n\ta.cnx = NewAdminConnections(addrs, options, log)\n\n\treturn a\n}", "title": "" }, { "docid": "44a734bf91d6224217ef0db8a957c9df", "score": "0.46454576", "text": "func NewAdmin(creator string, opts ...Options) (*Permission, error) {\n\tif creator == \"\" {\n\t\treturn nil, fmt.Errorf(\"permission creator cannot be an empty string\")\n\t}\n\n\tp := &Permission{\n\t\tUsername: util.RandStr(),\n\t\tPassword: uuid.New().String(),\n\t\tOwner: creator,\n\t\tCreator: creator,\n\t\tCategories: adminCategories,\n\t\tOps: adminOps,\n\t\tIndices: []string{\"*\"},\n\t\tSources: []string{\"0.0.0.0/0\"},\n\t\tReferers: []string{\"*\"},\n\t\tCreatedAt: time.Now().Format(time.RFC3339),\n\t\tTTL: -1,\n\t\tLimits: &defaultAdminLimits,\n\t}\n\n\t// run the options on it\n\tfor _, option := range opts {\n\t\tif err := option(p); err != nil {\n\t\t\treturn nil, err\n\t\t}\n\t}\n\n\t// set the acls if not set by options explicitly\n\tif p.ACLs == nil {\n\t\tp.ACLs = category.ACLsFor(p.Categories...)\n\t}\n\n\treturn p, nil\n}", "title": "" }, { "docid": "c74c0fc355ef5bf2988205b3d17b0f28", "score": "0.4644021", "text": "func NewMeetingParticipants()(*MeetingParticipants) {\n m := &MeetingParticipants{\n }\n m.SetAdditionalData(make(map[string]interface{}));\n return m\n}", "title": "" }, { "docid": "1f198fedf0f61f30058701bc6c5adb1b", "score": "0.45762292", "text": "func (i InlineQueryPeerTypeChat) construct() InlineQueryPeerTypeClass { return &i }", "title": "" }, { "docid": "8bc607e85c046ba82b9ef4b5c10f2703", "score": "0.45731452", "text": "func NewChat(client *rpc.Client, selfID peer.ID, contentTopic string, useV1Payload bool, nickname string) (*Chat, error) {\n\tvar defaultTopic = \"/waku/2/default-waku/proto\"\n\t// join the default waku topic and subscribe to it\n\t_, err := nwaku.PostWakuRelaySubscriptions(client, []string{defaultTopic})\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\tc := &Chat{\n\t\t//node: n,\n\t\tclient: client,\n\t\t// XXX Not used directly anymore\n\t\t//sub: sub,\n\t\tpubsubTopic: defaultTopic,\n\t\tself: selfID,\n\t\tcontentTopic: contentTopic,\n\t\tnick: nickname,\n\t\tuseV1Payload: useV1Payload,\n\t\tMessages: make(chan *pb.Chat2Message, 1024),\n\t}\n\n\t// start reading messages from the subscription in a loop\n\tgo c.readLoop()\n\n\treturn c, nil\n}", "title": "" }, { "docid": "d8aa9387c2ff955ed2364d829f5e7d6c", "score": "0.45700994", "text": "func (pq *ParticipantQuery) Clone() *ParticipantQuery {\n\treturn &ParticipantQuery{\n\t\tconfig: pq.config,\n\t\tlimit: pq.limit,\n\t\toffset: pq.offset,\n\t\torder: append([]OrderFunc{}, pq.order...),\n\t\tunique: append([]string{}, pq.unique...),\n\t\tpredicates: append([]predicate.Participant{}, pq.predicates...),\n\t\t// clone intermediate query.\n\t\tsql: pq.sql.Clone(),\n\t\tpath: pq.path,\n\t}\n}", "title": "" }, { "docid": "5ea6451245478b732964c7c856463240", "score": "0.45083433", "text": "func (du *DatumUpdate) ClearParticipant() *DatumUpdate {\n\tdu.mutation.ClearParticipant()\n\treturn du\n}", "title": "" }, { "docid": "a04f6a83084f63fc7e4b7239313d8567", "score": "0.45035383", "text": "func (e EncryptedChatDiscarded) construct() EncryptedChatClass { return &e }", "title": "" }, { "docid": "d6da04fa45eaecaf8598a8fed885a8f2", "score": "0.44778922", "text": "func ContainerazureAlphaClusterAuthorizationAdminUsersToProto(o *alpha.ClusterAuthorizationAdminUsers) *alphapb.ContainerazureAlphaClusterAuthorizationAdminUsers {\n\tif o == nil {\n\t\treturn nil\n\t}\n\tp := &alphapb.ContainerazureAlphaClusterAuthorizationAdminUsers{}\n\tp.SetUsername(dcl.ValueOrEmptyString(o.Username))\n\treturn p\n}", "title": "" }, { "docid": "3dd9e4a50c6d20825427afe4b6e2ae60", "score": "0.44775283", "text": "func (e EncryptedChat) construct() EncryptedChatClass { return &e }", "title": "" }, { "docid": "e1b4057f9fb174a40a9e09e18d7fb656", "score": "0.44722858", "text": "func (c *baseClient) GetChatAdministrators(ctx context.Context, chatID ChatID) ([]ChatMember, error) {\n\tbody := new(httpf.Form).\n\t\tSet(\"chat_id\", chatID.queryParam())\n\tmembers := make([]ChatMember, 0)\n\treturn members, c.Execute(ctx, \"getChatAdministrators\", body, &members)\n}", "title": "" }, { "docid": "ddda991c19c06f5ad77630d44d10320d", "score": "0.44606355", "text": "func (m *TestFixClient) ToAdmin(msg *fix.Message, sessionID fix.SessionID) {\n\tmsgType, err := msg.MsgType()\n\tif err != nil {\n\t\treturn\n\t}\n\tif \"A\" == msgType {\n\t\tmsg.Body.SetString(fix.Tag(20000), m.APIKey)\n\t\tmsg.Body.SetString(fix.Tag(20001), m.APISecret)\n\t\tmsg.Body.SetString(fix.Tag(20002), m.BfxUserID)\n\t\tif m.CancelOnDisconnect {\n\t\t\tmsg.Body.SetBool(fix.Tag(8013), true)\n\t\t}\n\t}\n\tlog.Printf(\"[FIX %s] MockFix.ToAdmin (outgoing): %s\", m.name, fixString(msg))\n}", "title": "" }, { "docid": "e1f0c2be58c0de1341db08d4324bd34a", "score": "0.44346073", "text": "func (i Identity) WhoisAdmin(room *chat.Room) string {\n\tip, _, _ := net.SplitHostPort(i.RemoteAddr().String())\n\tfingerprint := \"(no public key)\"\n\tif i.PublicKey() != nil {\n\t\tfingerprint = sshd.Fingerprint(i.PublicKey())\n\t}\n\n\tout := strings.Builder{}\n\tout.WriteString(\"name: \" + i.Name() + message.Newline +\n\t\t\" > ip: \" + ip + message.Newline +\n\t\t\" > fingerprint: \" + fingerprint + message.Newline +\n\t\t\" > client: \" + sanitize.Data(string(i.ClientVersion()), 64) + message.Newline +\n\t\t\" > joined: \" + humantime.Since(i.created) + \" ago\")\n\n\tif member, ok := room.MemberByID(i.ID()); ok {\n\t\t// Add room-specific whois\n\t\tif isAway, awaySince, awayMessage := member.GetAway(); isAway {\n\t\t\tfmt.Fprintf(&out, message.Newline+\" > away: (%s ago) %s\", humantime.Since(awaySince), awayMessage)\n\t\t}\n\t\t// FIXME: Should these always be present, even if they're false? Maybe\n\t\t// change that once we add room context to Whois() above.\n\t\tif !member.LastMsg().IsZero() {\n\t\t\tout.WriteString(message.Newline + \" > room/messaged: \" + humantime.Since(member.LastMsg()) + \" ago\")\n\t\t}\n\t\tif room.IsOp(member.User) {\n\t\t\tout.WriteString(message.Newline + \" > room/op: true\")\n\t\t}\n\t}\n\n\treturn out.String()\n}", "title": "" }, { "docid": "8f40e8263f0ef367d1ccbc9438a78101", "score": "0.4431849", "text": "func NewTwitchChat(j TwitchJoinHandler) *TwitchChat {\n\tc := &TwitchChat{\n\t\tdialer: websocket.Dialer{HandshakeTimeout: SocketHandshakeTimeout},\n\t\theaders: http.Header{\"Origin\": []string{GetConfig().Twitch.OriginURL}},\n\t\tmessages: make(map[string]chan *Message, 0),\n\t\tchannels: make([]string, 0),\n\t\tjoinHandler: j,\n\t\tadmins: make(map[string]bool, len(GetConfig().Twitch.Admins)),\n\t\tevicted: make(chan string, 0),\n\t}\n\n\tfor _, u := range GetConfig().Twitch.Admins {\n\t\tc.admins[u] = true\n\t}\n\n\td, err := ioutil.ReadFile(GetConfig().Twitch.ChannelListPath)\n\tif err != nil {\n\t\tlog.Fatalf(\"unable to read channels %s\", err)\n\t}\n\tif err := json.Unmarshal(d, &c.channels); err != nil {\n\t\tlog.Fatalf(\"unable to read channels %s\", err)\n\t}\n\tsort.Strings(c.channels)\n\tgo c.runEvictHandler()\n\treturn c\n}", "title": "" }, { "docid": "011b335450a9faf67bff8b942531df1c", "score": "0.43787974", "text": "func (b *Bot) RestrictChatMember() (ok bool, err error) {\n\treturn false, nil\n}", "title": "" }, { "docid": "6b1dddf0de9220c4a07ca371099a4580", "score": "0.43771487", "text": "func (s EncryptedChatClassArray) AsEncryptedChat() (to EncryptedChatArray) {\n\tfor _, elem := range s {\n\t\tvalue, ok := elem.(*EncryptedChat)\n\t\tif !ok {\n\t\t\tcontinue\n\t\t}\n\t\tto = append(to, *value)\n\t}\n\n\treturn to\n}", "title": "" }, { "docid": "ea7fadab9722c60780001cc24f941a73", "score": "0.43603703", "text": "func ProtoToContainerazureAlphaClusterAuthorizationAdminUsers(p *alphapb.ContainerazureAlphaClusterAuthorizationAdminUsers) *alpha.ClusterAuthorizationAdminUsers {\n\tif p == nil {\n\t\treturn nil\n\t}\n\tobj := &alpha.ClusterAuthorizationAdminUsers{\n\t\tUsername: dcl.StringOrNil(p.GetUsername()),\n\t}\n\treturn obj\n}", "title": "" }, { "docid": "a8bb70ff6fc11132b6984b25caf55c57", "score": "0.43315193", "text": "func ContainerawsAlphaAwsClusterAuthorizationAdminUsersToProto(o *alpha.AwsClusterAuthorizationAdminUsers) *alphapb.ContainerawsAlphaAwsClusterAuthorizationAdminUsers {\n\tif o == nil {\n\t\treturn nil\n\t}\n\tp := &alphapb.ContainerawsAlphaAwsClusterAuthorizationAdminUsers{\n\t\tUsername: dcl.ValueOrEmptyString(o.Username),\n\t}\n\treturn p\n}", "title": "" }, { "docid": "053d6bc11273bc1e664535e8922535f4", "score": "0.43275055", "text": "func (duo *DatumUpdateOne) ClearParticipant() *DatumUpdateOne {\n\tduo.mutation.ClearParticipant()\n\treturn duo\n}", "title": "" }, { "docid": "c17e315de589bdaf9a69ce38a66a3dc7", "score": "0.43009984", "text": "func (e EncryptedChatRequested) construct() EncryptedChatClass { return &e }", "title": "" }, { "docid": "6aff804466c956431386bcece5d6b0d5", "score": "0.42626482", "text": "func (e EncryptedChatEmpty) construct() EncryptedChatClass { return &e }", "title": "" }, { "docid": "ef48ce2414de50270f064e959ad176e8", "score": "0.42302552", "text": "func (b *Bot) GetChatAdministrators(chatID int) ([]*ChatMember, error) {\n\tparams := map[string]string{\n\t\t\"chat_id\": strconv.Itoa(chatID),\n\t}\n\tresult, err := b.call(\"getChatAdministrators\", params)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\tvar admins []*ChatMember\n\tfor _, v := range *result.(*[]ChatMember) {\n\t\tadmins = append(admins, &v)\n\t}\n\n\treturn admins, nil\n}", "title": "" }, { "docid": "cd69f2cc21efc0f1d43787d7c048bdee", "score": "0.42067492", "text": "func (b *Bot) RestrictChatMember(request axon.O) (result bool, err error) {\n\tvar response interface{}\n\tif response, err = b.doPost(\"restrictChatMember\", request); err == nil {\n\t\tresult = response.(bool)\n\t}\n\treturn\n}", "title": "" }, { "docid": "9c20c50eb94612269cb473471f6254a4", "score": "0.41961914", "text": "func NewChatAuth(\n\tstorage Storage,\n\tpasswordOrNil Password,\n\tconfigPrefix string,\n\tconfig *viper.Viper,\n) *ChatAuth {\n\tvar (\n\t\tuserCollKey = configPrefix + \".userColl\"\n\t\taclCollKey = configPrefix + \".aclColl\"\n\t\tgameIDKey = configPrefix + \".gameId\"\n\t)\n\n\tconfig.SetDefault(userCollKey, \"mqtt_user\")\n\tconfig.SetDefault(aclCollKey, \"mqtt_acl\")\n\n\tif passwordOrNil == nil {\n\t\tpasswordOrNil = &PasswordPBKDF2{}\n\t}\n\n\treturn &ChatAuth{\n\t\tstorage: storage,\n\t\tpassword: passwordOrNil,\n\t\tuserColl: config.GetString(userCollKey),\n\t\taclColl: config.GetString(aclCollKey),\n\t\tgameID: config.GetString(gameIDKey),\n\t}\n}", "title": "" }, { "docid": "91131cfec46271e2d1565c8781340ec2", "score": "0.4171955", "text": "func (e *UserJoinedConversation) Copy() eventlog.Payload {\n\tcp := *e\n\treturn &cp\n}", "title": "" }, { "docid": "70fefaf1b356d7cef776e8a33c7bafe0", "score": "0.41561496", "text": "func (c *ChannelsChannelParticipantsNotModified) AsModified() (*ChannelsChannelParticipants, bool) {\n\treturn nil, false\n}", "title": "" }, { "docid": "389f3c832fad0f67cecbcca9bc875986", "score": "0.41471583", "text": "func (i InlineQueryPeerTypeSameBotPM) construct() InlineQueryPeerTypeClass { return &i }", "title": "" }, { "docid": "9819c9063d8b3be04bedb2b75ae10a07", "score": "0.41387635", "text": "func DecodeChatParticipant(buf *bin.Buffer) (ChatParticipantClass, error) {\n\tid, err := buf.PeekID()\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\tswitch id {\n\tcase ChatParticipantTypeID:\n\t\t// Decoding chatParticipant#c8d7493e.\n\t\tv := ChatParticipant{}\n\t\tif err := v.Decode(buf); err != nil {\n\t\t\treturn nil, fmt.Errorf(\"unable to decode ChatParticipantClass: %w\", err)\n\t\t}\n\t\treturn &v, nil\n\tcase ChatParticipantCreatorTypeID:\n\t\t// Decoding chatParticipantCreator#da13538a.\n\t\tv := ChatParticipantCreator{}\n\t\tif err := v.Decode(buf); err != nil {\n\t\t\treturn nil, fmt.Errorf(\"unable to decode ChatParticipantClass: %w\", err)\n\t\t}\n\t\treturn &v, nil\n\tcase ChatParticipantAdminTypeID:\n\t\t// Decoding chatParticipantAdmin#e2d6e436.\n\t\tv := ChatParticipantAdmin{}\n\t\tif err := v.Decode(buf); err != nil {\n\t\t\treturn nil, fmt.Errorf(\"unable to decode ChatParticipantClass: %w\", err)\n\t\t}\n\t\treturn &v, nil\n\tdefault:\n\t\treturn nil, fmt.Errorf(\"unable to decode ChatParticipantClass: %w\", bin.NewUnexpectedID(id))\n\t}\n}", "title": "" }, { "docid": "1556301d088ea7d89b83fc142ec45dcf", "score": "0.41356894", "text": "func NewTChanReplicatorAdminClient(client thrift.TChanClient) TChanReplicatorAdmin {\n\treturn NewTChanReplicatorAdminInheritedClient(\"ReplicatorAdmin\", client)\n}", "title": "" }, { "docid": "89b2d49ca659fd8cd07fe92343cdaf1b", "score": "0.41285595", "text": "func NewAdminClient(rslvr resolver.Interface, opts ...Option) (AdminClient, error) {\n\tc := &adminClient{\n\t\tr: rslvr,\n\t}\n\n\tfor _, o := range opts {\n\t\to(c)\n\t}\n\n\tif err := c.connect(\"\"); err != nil {\n\t\treturn nil, err\n\t}\n\n\treturn c, nil\n}", "title": "" }, { "docid": "178a52f8c15b7571ad4ebc33e9d4dbf7", "score": "0.41145658", "text": "func NewTChanReplicatorAdminServer(handler TChanReplicatorAdmin) thrift.TChanServer {\n\treturn &tchanReplicatorAdminServer{\n\t\thandler,\n\t}\n}", "title": "" }, { "docid": "9db1e7780dbeeb59c176b580ad655f97", "score": "0.41122237", "text": "func (_Bindings *BindingsFilterer) WatchNewAdmin(opts *bind.WatchOpts, sink chan<- *BindingsNewAdmin) (event.Subscription, error) {\n\n\tlogs, sub, err := _Bindings.contract.WatchLogs(opts, \"NewAdmin\")\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\treturn event.NewSubscription(func(quit <-chan struct{}) error {\n\t\tdefer sub.Unsubscribe()\n\t\tfor {\n\t\t\tselect {\n\t\t\tcase log := <-logs:\n\t\t\t\t// New log arrived, parse the event and forward to the user\n\t\t\t\tevent := new(BindingsNewAdmin)\n\t\t\t\tif err := _Bindings.contract.UnpackLog(event, \"NewAdmin\", log); err != nil {\n\t\t\t\t\treturn err\n\t\t\t\t}\n\t\t\t\tevent.Raw = log\n\n\t\t\t\tselect {\n\t\t\t\tcase sink <- event:\n\t\t\t\tcase err := <-sub.Err():\n\t\t\t\t\treturn err\n\t\t\t\tcase <-quit:\n\t\t\t\t\treturn nil\n\t\t\t\t}\n\t\t\tcase err := <-sub.Err():\n\t\t\t\treturn err\n\t\t\tcase <-quit:\n\t\t\t\treturn nil\n\t\t\t}\n\t\t}\n\t}), nil\n}", "title": "" }, { "docid": "24e899744b5a6841a3fb780f769b670e", "score": "0.41072276", "text": "func (user *User) SetAsParticipant() {\n\tuser.Role = UserRoleParticipant\n}", "title": "" }, { "docid": "cbd1c896acd40b76e74970e6e97771f9", "score": "0.41001284", "text": "func NewAdminClient(ctx context.Context, project, instance string, opts ...option.ClientOption) (*AdminClient, error) {\n\to, err := btopt.DefaultClientOptions(adminAddr, AdminScope, clientUserAgent)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\to = append(o, opts...)\n\tconn, err := transport.DialGRPC(ctx, o...)\n\tif err != nil {\n\t\treturn nil, fmt.Errorf(\"dialing: %v\", err)\n\t}\n\treturn &AdminClient{\n\t\tconn: conn,\n\t\ttClient: btapb.NewBigtableTableAdminClient(conn),\n\t\tproject: project,\n\t\tinstance: instance,\n\t\tmd: metadata.Pairs(resourcePrefixHeader, fmt.Sprintf(\"projects/%s/instances/%s\", project, instance)),\n\t}, nil\n}", "title": "" }, { "docid": "97e8d633f7ed78c64e67eef7701e2b63", "score": "0.40980837", "text": "func (_EtherDelta *EtherDeltaCallerSession) Admin() (common.Address, error) {\n\treturn _EtherDelta.Contract.Admin(&_EtherDelta.CallOpts)\n}", "title": "" }, { "docid": "852f231792fa253cd64cd9d22de9f9a1", "score": "0.4084875", "text": "func (s ChatParticipantAdminArray) Sort(less func(a, b ChatParticipantAdmin) bool) ChatParticipantAdminArray {\n\tsort.Slice(s, func(i, j int) bool {\n\t\treturn less(s[i], s[j])\n\t})\n\treturn s\n}", "title": "" }, { "docid": "bdf3096a050ba4aaa86101a9efbe85bd", "score": "0.40767622", "text": "func newPermissionMutation(c config, op Op, opts ...permissionOption) *PermissionMutation {\n\tm := &PermissionMutation{\n\t\tconfig: c,\n\t\top: op,\n\t\ttyp: TypePermission,\n\t\tclearedFields: make(map[string]struct{}),\n\t}\n\tfor _, opt := range opts {\n\t\topt(m)\n\t}\n\treturn m\n}", "title": "" }, { "docid": "11321af6f77acc707e08510e4d072a34", "score": "0.40751877", "text": "func NewAdminCommand(buf []byte) *AdminCommand {\n\tif buf == nil {\n\t\tbuf = make([]byte, 10*1024)\n\t}\n\treturn &AdminCommand{\n\t\tdataBuffer: buf,\n\t\tdataOffset: 8,\n\t}\n}", "title": "" }, { "docid": "94a132d28311c826ec6c5a614e8627e8", "score": "0.40742272", "text": "func (*ChatParticipant) TypeName() string {\n\treturn \"chatParticipant\"\n}", "title": "" }, { "docid": "04605ceba7f6f51ca2d4af783a3596ca", "score": "0.40738848", "text": "func (action *Action) AdminChannelClient() (apifabclient.Channel, error) {\n\treturn action.OrgAdminChannelClient(action.OrgID())\n}", "title": "" }, { "docid": "7acbc1f66f3062ab3637ead5ca3031ce", "score": "0.40737215", "text": "func (s SteamId) ClanToChat() SteamId {\r\n\tif s.GetAccountType() == int32(7) { //EAccountType_Clan\r\n\t\ts = s.SetAccountInstance(uint32(Clan))\r\n\t\ts = s.SetAccountType(8) //EAccountType_Chat\r\n\t}\r\n\treturn s\r\n}", "title": "" }, { "docid": "010c6642d6f4698aaca8c8aba60bdd26", "score": "0.40704218", "text": "func NewAadUserConversationMember()(*AadUserConversationMember) {\n m := &AadUserConversationMember{\n ConversationMember: *NewConversationMember(),\n }\n odataTypeValue := \"#microsoft.graph.aadUserConversationMember\";\n m.SetOdataType(&odataTypeValue);\n return m\n}", "title": "" }, { "docid": "929555f6f5fc0ab024392a58c53453fb", "score": "0.40611413", "text": "func ReorderParticipants(mctx libkb.MetaContext, g libkb.UIDMapperContext, umapper libkb.UIDMapper,\n\ttlfName string, verifiedMembers []string, activeList []gregor1.UID) (writerNames []chat1.ConversationLocalParticipant, err error) {\n\tsrcWriterNames, _, _, err := splitAndNormalizeTLFNameCanonicalize(mctx, tlfName, false)\n\tif err != nil {\n\t\treturn writerNames, err\n\t}\n\tactiveKuids := make([]keybase1.UID, 0, len(activeList))\n\tfor _, a := range activeList {\n\t\tactiveKuids = append(activeKuids, keybase1.UID(a.String()))\n\t}\n\tallowedWriters := make(map[string]bool, len(verifiedMembers)+len(srcWriterNames))\n\tfor _, user := range verifiedMembers {\n\t\tallowedWriters[user] = true\n\t}\n\tconvNameUsers := make(map[string]bool, len(srcWriterNames))\n\tfor _, user := range srcWriterNames {\n\t\tconvNameUsers[user] = true\n\t\tallowedWriters[user] = true\n\t}\n\n\tpackages, err := umapper.MapUIDsToUsernamePackages(mctx.Ctx(), g, activeKuids, time.Hour*24,\n\t\t10*time.Second, true)\n\tactiveMap := make(map[string]chat1.ConversationLocalParticipant)\n\tif err == nil {\n\t\tfor i := 0; i < len(activeKuids); i++ {\n\t\t\tpart := UsernamePackageToParticipant(packages[i])\n\t\t\tpart.InConvName = convNameUsers[part.Username]\n\t\t\tactiveMap[activeKuids[i].String()] = part\n\t\t}\n\t}\n\n\t// Fill from the active list first.\n\tfor _, uid := range activeList {\n\t\tkbUID := keybase1.UID(uid.String())\n\t\tp, ok := activeMap[kbUID.String()]\n\t\tif !ok {\n\t\t\tcontinue\n\t\t}\n\t\tif allowed := allowedWriters[p.Username]; allowed {\n\t\t\twriterNames = append(writerNames, p)\n\t\t\t// Allow only one occurrence.\n\t\t\tallowedWriters[p.Username] = false\n\t\t}\n\t}\n\n\t// Include participants even if they weren't in the active list, in stable order.\n\tvar leftOvers []chat1.ConversationLocalParticipant\n\tfor user, available := range allowedWriters {\n\t\tif !available {\n\t\t\tcontinue\n\t\t}\n\t\tpart := UsernamePackageToParticipant(libkb.UsernamePackage{\n\t\t\tNormalizedUsername: libkb.NewNormalizedUsername(user),\n\t\t\tFullName: nil,\n\t\t})\n\t\tpart.InConvName = convNameUsers[part.Username]\n\t\tleftOvers = append(leftOvers, part)\n\t\tallowedWriters[user] = false\n\t}\n\tsort.Slice(leftOvers, func(i, j int) bool {\n\t\treturn strings.Compare(leftOvers[i].Username, leftOvers[j].Username) < 0\n\t})\n\twriterNames = append(writerNames, leftOvers...)\n\n\treturn writerNames, nil\n}", "title": "" }, { "docid": "5e8fca9e575ae2fc745be448f38b2590", "score": "0.4058061", "text": "func TestCreateNewCampaignAsAdmin(t *testing.T) {\n\ttstSetup(tstValidConfigurationPath)\n\tdefer tstShutdown()\n\n\tConvey(\"Given an authenticated user with the admin role\", t, func() {\n\t\ttoken := tstAuthAdmin()\n\n\t\tConvey(\"When they try to create a campaign\", func() {\n\t\t\tcampaignSent := tstBuildValidCampaign(\"campaign-create-admin\")\n\t\t\tresponse, err := tstPerformPut(\"/api/rest/v1/campaigns\", tstRenderJson(campaignSent), token)\n\n\t\t\tConvey(\"Then the campaign is successfully created\", func() {\n\t\t\t\tSo(err, ShouldEqual, nil)\n\t\t\t\tSo(response.status, ShouldEqual, http.StatusCreated)\n\t\t\t\tSo(response.location, ShouldMatchRegex, \"^\\\\/api\\\\/rest\\\\/v1\\\\/campaigns\\\\/[1-9][0-9]*$\")\n\n\t\t\t\tConvey(\"And the same campaign can be read again\", func() {\n\t\t\t\t\tcampaignReadAgain, err := tstReadCampaign(response.location)\n\t\t\t\t\tSo(err, ShouldEqual, nil)\n\t\t\t\t\tSo(campaignReadAgain, ShouldDeepEqual, campaignSent)\n\t\t\t\t})\n\t\t\t})\n\t\t})\n\t})\n}", "title": "" }, { "docid": "e972ea32b818e7f686a59356ddbd021a", "score": "0.40495384", "text": "func OptParticipant() parameter.Parameter {\n\treturn Other(\"OPT-PARTICIPANT\")\n}", "title": "" }, { "docid": "da51adbf00a79abcdd70ed7b4740a5a2", "score": "0.40469277", "text": "func (chatRoom ChatRoom) getOwner() *Guest {\n return &chatRoom.owner\n}", "title": "" }, { "docid": "30c34af0928384b57d994fba8d1ece96", "score": "0.4043878", "text": "func (bot *BotAPI) RestrictChatMember(groupID int64, userID int64, duration time.Duration) (APIResponse, error) {\n\treturn bot.Do(RestrictChatMemberConfig{\n\t\tChatMemberConfig: ChatMemberConfig{\n\t\t\tGroupID: groupID,\n\t\t\tUserID: userID,\n\t\t},\n\t\tDuration: duration,\n\t})\n}", "title": "" }, { "docid": "db0f58b5ae10c2e0b4c1a0a9f4819cd2", "score": "0.4034828", "text": "func (in *Admin) DeepCopy() *Admin {\n\tif in == nil {\n\t\treturn nil\n\t}\n\tout := new(Admin)\n\tin.DeepCopyInto(out)\n\treturn out\n}", "title": "" }, { "docid": "612c78ec97a0702c6d01436a1018cd15", "score": "0.40317285", "text": "func GetAdminClient() (pb.AdminClient, error) {\n\tpeerClient, err := NewPeerClientFromEnv()\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\treturn peerClient.Admin()\n}", "title": "" }, { "docid": "0b26e10956551c8e352a6d28b1fa8e3f", "score": "0.40283778", "text": "func (_Contract *ContractCallerSession) Admin() (common.Address, error) {\n\treturn _Contract.Contract.Admin(&_Contract.CallOpts)\n}", "title": "" }, { "docid": "ba5a73fc2bb62ba6b10d36af565f41d3", "score": "0.40258083", "text": "func (du *DatumUpdate) SetParticipant(p *Participant) *DatumUpdate {\n\treturn du.SetParticipantID(p.ID)\n}", "title": "" }, { "docid": "1cd7184dbda442dca7f7acc41b3b412e", "score": "0.4021473", "text": "func (_Bindings *BindingsFilterer) FilterNewAdmin(opts *bind.FilterOpts) (*BindingsNewAdminIterator, error) {\n\n\tlogs, sub, err := _Bindings.contract.FilterLogs(opts, \"NewAdmin\")\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\treturn &BindingsNewAdminIterator{contract: _Bindings.contract, event: \"NewAdmin\", logs: logs, sub: sub}, nil\n}", "title": "" }, { "docid": "74b8bd3f225175b4731a2e19f48b47d5", "score": "0.40199518", "text": "func (c *ChannelsChannelParticipants) AsModified() (*ChannelsChannelParticipants, bool) {\n\treturn c, true\n}", "title": "" }, { "docid": "51115ed4f5b11fe710630e173bef5a18", "score": "0.40180817", "text": "func (e Elem) Participants(raw *tg.Client) (*participants.GetParticipantsQueryBuilder, bool) {\n\tchannel, ok := peer.ToInputChannel(e.Peer)\n\tif !ok {\n\t\treturn nil, false\n\t}\n\treturn participants.NewQueryBuilder(raw).GetParticipants(channel), true\n}", "title": "" }, { "docid": "63fcbb15cbf7e1b18a040043907758a9", "score": "0.4016289", "text": "func (me TxsdContactRole) IsAdmin() bool { return me.String() == \"admin\" }", "title": "" }, { "docid": "5b7a22e4f18cac5aa9df682fcdffc05a", "score": "0.40063137", "text": "func NewChatMessage()(*ChatMessage) {\n m := &ChatMessage{\n Entity: *NewEntity(),\n }\n return m\n}", "title": "" }, { "docid": "93ab4c960634247d8f65da1781f17d69", "score": "0.399915", "text": "func (_EtherDelta *EtherDeltaSession) Admin() (common.Address, error) {\n\treturn _EtherDelta.Contract.Admin(&_EtherDelta.CallOpts)\n}", "title": "" }, { "docid": "25c5b97d9ac5d36a6dfe46dec272ec3c", "score": "0.39987615", "text": "func (_TellorMesosphere *TellorMesosphereTransactorSession) AddAdmin(_admin_address common.Address) (*types.Transaction, error) {\n\treturn _TellorMesosphere.Contract.AddAdmin(&_TellorMesosphere.TransactOpts, _admin_address)\n}", "title": "" }, { "docid": "9c7fa3ac4453254711f4ecbd28b45097", "score": "0.399714", "text": "func (s *Subscribe) GetAdmins() []*Subscriber {\n\tvar subs []*Subscriber\n\n\tfor _, sub := range s.Subscribers {\n\t\tif sub.Admin {\n\t\t\tsubs = append(subs, sub)\n\t\t}\n\t}\n\n\treturn subs\n}", "title": "" }, { "docid": "4b0f376573ad85da3b9296c3650202cb", "score": "0.39967966", "text": "func NewChatrooms(l hclog.Logger, pdb *data.ChatroomsDB) *Chatrooms {\n\treturn &Chatrooms{l, pdb}\n}", "title": "" }, { "docid": "579a24f18aa1cfcf808183a33de123da", "score": "0.39946106", "text": "func (m *TeamMemberSettings) SetAllowCreatePrivateChannels(value *bool)() {\n m.allowCreatePrivateChannels = value\n}", "title": "" }, { "docid": "83483be7a3c06437e173413dfe306783", "score": "0.39936024", "text": "func CloneRefOfOtherAdmin(n *OtherAdmin) *OtherAdmin {\n\tif n == nil {\n\t\treturn nil\n\t}\n\tout := *n\n\treturn &out\n}", "title": "" }, { "docid": "541ab7d7e4cd79063940f383c901287b", "score": "0.39912045", "text": "func (e EncryptedChatWaiting) construct() EncryptedChatClass { return &e }", "title": "" }, { "docid": "51e4a6dd3cb21a80a34ecf5ef402d6c6", "score": "0.3990888", "text": "func (duo *DatumUpdateOne) SetParticipant(p *Participant) *DatumUpdateOne {\n\treturn duo.SetParticipantID(p.ID)\n}", "title": "" }, { "docid": "e399799fc2c6a8e7b232697c501bdd22", "score": "0.39865977", "text": "func NewChatAdapter(c glados.Context) glados.ChatAdapter {\n\tslackClient := slack.New(c.Env(\"GLADOS_SLACK_BOT_UAER_TOKEN\", \"\"))\n\trtm := slackClient.NewRTM()\n\tadapter := &slackChatAdapter{\n\t\tusers: make(map[string]*slack.User),\n\t\tchannels: make(map[string]*slack.Channel),\n\t\tcontext: c,\n\t\tclient: slackClient,\n\t\trtm: rtm,\n\t}\n\tgo rtm.ManageConnection()\n\tgo adapter.handleRTMEvent()\n\treturn adapter\n}", "title": "" }, { "docid": "6ca2bf08868c574b59a216a89afb7516", "score": "0.39845687", "text": "func (client *Client) RestrictChatMember(chatId interface{}, userId int64) *VoidResponse {\n\tbody := JSON{\n\t\t\"chat_id\": chatId,\n\t\t\"user_id\": userId,\n\t}\n\tendpoint := client.baseURL + fmt.Sprintf(EndpointRestrictChatMember, client.accessToken)\n\trequest := gorequest.New().Type(gorequest.TypeJSON).Post(endpoint).Set(UserAgentHeader, UserAgent+\"/\"+Version).Send(body)\n\n\treturn &VoidResponse{\n\t\tClient: client,\n\t\tRequest: request,\n\t}\n}", "title": "" }, { "docid": "b8f60e77e0a1383f256494d05c73cd9d", "score": "0.39785287", "text": "func (i InlineQueryPeerTypeBotPM) construct() InlineQueryPeerTypeClass { return &i }", "title": "" }, { "docid": "715275c253226f98628bc648350a8126", "score": "0.3973355", "text": "func (m *GraphBaseServiceClient) Admin()(*i7c9d1b36ac198368c1d8bed014b43e2a518b170ee45bf02c8bbe64544a50539a.AdminRequestBuilder) {\n return i7c9d1b36ac198368c1d8bed014b43e2a518b170ee45bf02c8bbe64544a50539a.NewAdminRequestBuilderInternal(m.pathParameters, m.requestAdapter);\n}", "title": "" }, { "docid": "715275c253226f98628bc648350a8126", "score": "0.3973355", "text": "func (m *GraphBaseServiceClient) Admin()(*i7c9d1b36ac198368c1d8bed014b43e2a518b170ee45bf02c8bbe64544a50539a.AdminRequestBuilder) {\n return i7c9d1b36ac198368c1d8bed014b43e2a518b170ee45bf02c8bbe64544a50539a.NewAdminRequestBuilderInternal(m.pathParameters, m.requestAdapter);\n}", "title": "" }, { "docid": "f41d39745ffb9483f426b15a73ab8af1", "score": "0.39707673", "text": "func (m *TeamMemberSettings) GetAllowCreatePrivateChannels()(*bool) {\n return m.allowCreatePrivateChannels\n}", "title": "" }, { "docid": "0f39989e3c62e6f2c348149c1892d54b", "score": "0.3960518", "text": "func (u *User) MeetingsAsParticipant(tx *pop.Connection) ([]Meeting, error) {\n\tm := Meetings{}\n\tif err := tx.\n\t\tWhere(\"meeting_participants.user_id=?\", u.ID).\n\t\tJoin(\"meeting_participants\", \"meeting_participants.meeting_id=meetings.id\").\n\t\tAll(&m); err != nil {\n\t\treturn m, err\n\t}\n\treturn m, nil\n}", "title": "" }, { "docid": "d3f94d8ba959ac06b7c61ab6034e5774", "score": "0.3959636", "text": "func NewSetRoleAsAdminForbidden() *SetRoleAsAdminForbidden {\n\treturn &SetRoleAsAdminForbidden{}\n}", "title": "" }, { "docid": "f11aa5df52940a3b1d6553791a5316ab", "score": "0.39550206", "text": "func (s ChatParticipantAdminArray) Last() (v ChatParticipantAdmin, ok bool) {\n\tif len(s) < 1 {\n\t\treturn\n\t}\n\treturn s[len(s)-1], true\n}", "title": "" }, { "docid": "3a2ad02d02e2c0a39dfac6abfa26cf0b", "score": "0.39531106", "text": "func (_Contract *ContractSession) Admin() (common.Address, error) {\n\treturn _Contract.Contract.Admin(&_Contract.CallOpts)\n}", "title": "" }, { "docid": "da327529f9ae57bb336db2ab7734684f", "score": "0.39496067", "text": "func NewAdminClient(conf *ConfigMap) (*AdminClient, error) {\n\n\terr := versionCheck()\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\ta := &AdminClient{}\n\ta.handle = &handle{}\n\n\t// Convert ConfigMap to librdkafka conf_t\n\tcConf, err := conf.convert()\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\tcErrstr := (*C.char)(C.malloc(C.size_t(256)))\n\tdefer C.free(unsafe.Pointer(cErrstr))\n\n\tC.rd_kafka_conf_set_events(cConf, C.RD_KAFKA_EVENT_STATS|C.RD_KAFKA_EVENT_ERROR|C.RD_KAFKA_EVENT_OAUTHBEARER_TOKEN_REFRESH)\n\n\t// Create librdkafka producer instance. The Producer is somewhat cheaper than\n\t// the consumer, but any instance type can be used for Admin APIs.\n\ta.handle.rk = C.rd_kafka_new(C.RD_KAFKA_PRODUCER, cConf, cErrstr, 256)\n\tif a.handle.rk == nil {\n\t\treturn nil, newErrorFromCString(C.RD_KAFKA_RESP_ERR__INVALID_ARG, cErrstr)\n\t}\n\n\ta.isDerived = false\n\ta.handle.setup()\n\n\ta.isClosed = 0\n\n\treturn a, nil\n}", "title": "" }, { "docid": "ae58013f8fdd97ca338e0c16c86e2d90", "score": "0.39470375", "text": "func CreateChatsSupervisor() *Supervisor {\n\tchannels := &common.Channels{\n\t\tChatsChannel: make(chan common.ChatMessage),\n\t\tSuscriptionsChannel: make(chan common.SubscriptionMessage),\n\t}\n\treturn &Supervisor{\n\t\tchats: make(map[string]*Chat),\n\t\tChannels: channels,\n\t}\n}", "title": "" }, { "docid": "acf34ea7170c108278a503048b1c3eb5", "score": "0.39460945", "text": "func NewTwitchChat(username string, oauth string) *TwitchChat {\n\treturn &TwitchChat{\n\t\tUsername: username,\n\t\tOAuth: oauth,\n\t\tsend: make(chan string),\n\t\tpart: make(chan string),\n\t\tchannels: make(map[string]*Channel),\n\t}\n}", "title": "" }, { "docid": "9839505dc29d40ad972f8accef994f9a", "score": "0.3941085", "text": "func (cb CommitteeBits) FilterParticipants(committee []ValidatorIndex) []ValidatorIndex {\n\tbitLen := cb.BitLen()\n\tout := committee[:0]\n\tif bitLen != uint64(len(committee)) {\n\t\tpanic(\"committee mismatch, bitfield length does not match\")\n\t}\n\tfor i := uint64(0); i < bitLen; i++ {\n\t\tif cb.GetBit(i) {\n\t\t\tout = append(out, committee[i])\n\t\t}\n\t}\n\treturn out\n}", "title": "" }, { "docid": "967e660edf63396281f1d51a46a9ca2f", "score": "0.39343327", "text": "func (_TellorMesosphere *TellorMesosphereTransactor) AddAdmin(opts *bind.TransactOpts, _admin_address common.Address) (*types.Transaction, error) {\n\treturn _TellorMesosphere.contract.Transact(opts, \"addAdmin\", _admin_address)\n}", "title": "" }, { "docid": "042f5656a8af64d8b1d13d64c1d6dd63", "score": "0.39339024", "text": "func (s *ChatParticipantAdminArray) Pop() (v ChatParticipantAdmin, ok bool) {\n\tif s == nil || len(*s) < 1 {\n\t\treturn\n\t}\n\n\ta := *s\n\tv = a[len(a)-1]\n\ta = a[:len(a)-1]\n\t*s = a\n\n\treturn v, true\n}", "title": "" }, { "docid": "168aefca313b1791d034fc196a1c8165", "score": "0.3930884", "text": "func newJeeekUserCollectionViewAdmin(res JeeekUserCollection) userviews.JeeekUserCollectionView {\n\tvres := make(userviews.JeeekUserCollectionView, len(res))\n\tfor i, n := range res {\n\t\tvres[i] = newJeeekUserViewAdmin(n)\n\t}\n\treturn vres\n}", "title": "" }, { "docid": "ee1aa56c389d8ab3bf23d643c68a9f32", "score": "0.39286432", "text": "func newChat(l int64) *chat {\n\treturn &chat{latency: l}\n}", "title": "" }, { "docid": "1cd185a87dc2e3174bf96749bbcafabc", "score": "0.39178774", "text": "func ProtoToContainerawsAlphaAwsClusterAuthorizationAdminUsers(p *alphapb.ContainerawsAlphaAwsClusterAuthorizationAdminUsers) *alpha.AwsClusterAuthorizationAdminUsers {\n\tif p == nil {\n\t\treturn nil\n\t}\n\tobj := &alpha.AwsClusterAuthorizationAdminUsers{\n\t\tUsername: dcl.StringOrNil(p.Username),\n\t}\n\treturn obj\n}", "title": "" }, { "docid": "8271c6a88e22d61301876bb4cfe03182", "score": "0.39105964", "text": "func newJeeekUserCollectionAdmin(vres userviews.JeeekUserCollectionView) JeeekUserCollection {\n\tres := make(JeeekUserCollection, len(vres))\n\tfor i, n := range vres {\n\t\tres[i] = newJeeekUserAdmin(n)\n\t}\n\treturn res\n}", "title": "" }, { "docid": "40939473d9f816b87a593cc345fa5569", "score": "0.39091423", "text": "func (a AttachMenuBotsNotModified) construct() AttachMenuBotsClass { return &a }", "title": "" }, { "docid": "00edede0168009dfa19631c524236214", "score": "0.3906639", "text": "func NewAdminClient(c config) *AdminClient {\n\treturn &AdminClient{config: c}\n}", "title": "" } ]
c1a9d69e01ea9384b5259998a67fff97
Add adds a new item to the cache
[ { "docid": "60bb87997aa7f6adf6837f47cd2bc589", "score": "0.0", "text": "func (cache *Cache) Add(filePath string, width int, height int, color []byte) *CacheEntry {\n\t// @TODO write me\n\treturn nil\n}", "title": "" } ]
[ { "docid": "977b9e3693ed672ef17b725e7665999b", "score": "0.8064789", "text": "func (c *LFU) Add(key string, value interface{}) error {\n\treturn c.Cache.Set(key, value)\n}", "title": "" }, { "docid": "8dbc660e9b85506180962057c1d25b4d", "score": "0.7971983", "text": "func (c *LRU) Add(key string, value interface{}) error {\n\tc.Cache.Add(key, value)\n\treturn nil\n}", "title": "" }, { "docid": "0762dfac85b40108ecbf159510532067", "score": "0.7934073", "text": "func (c *Cache) Add(i Item) {\n\tit := c.value[i.ID]\n\tif it == nil {\n\t\tlog.Println(aurora.Sprintf(aurora.BrightBlue(\"Story %d is not cached. Putting to cache...\"), i.ID))\n\t\tc.value[i.ID] = &cachedItem{Item: i, CreationDate: time.Now()}\n\t\ttime.AfterFunc(c.ExpirationDuration, func() {\n\t\t\tc.Invalidate(i.ID)\n\t\t})\n\t} else {\n\t\tlog.Println(aurora.Sprintf(aurora.BrightBlack(\"Story %d has already been cached. Updating its date...\"), i.ID))\n\t\tit.CreationDate = time.Now()\n\t}\n}", "title": "" }, { "docid": "39bf7d87749fc779002c1725bd1aff49", "score": "0.78572595", "text": "func (c *Cache) Add(key string, value interface{}) {\n\tc.Lock()\n\tdefer c.Unlock()\n\n\tif c.size > c.maxSize {\n\t\tfor k, v := range c.cache {\n\t\t\tif time.Now().Unix()-v.lastAccess > c.maxTTL/2 {\n\t\t\t\tdelete(c.cache, k)\n\t\t\t}\n\t\t}\n\t}\n\tc.cache[key] = cacheItem{\n\t\tvalue: value,\n\t\tlastAccess: time.Now().Unix(),\n\t}\n\tc.size++\n}", "title": "" }, { "docid": "df2b6e850dec1283db37d660a807f538", "score": "0.7829295", "text": "func (c *Cache) Add(key string, value interface{}) {\n\tc.Lock()\n\tdefer c.Unlock()\n\t//fmt.Println(\"Add\", value)\n\tif c.cache == nil {\n\t\tc.cache = make(map[string]*entry)\n\t}\n\tif ee, ok := c.cache[key]; ok {\n\t\tee.Value = value\n\t\tee.Born = time.Now().Unix()\n\t\tee.State = ready\n\t\treturn\n\t}\n\tc.cache[key] = &entry{\n\t\tKey: key,\n\t\tValue: value,\n\t\tBorn: time.Now().Unix(),\n\t\tState: ready,\n\t}\n}", "title": "" }, { "docid": "932124cbbd3ae6e5a565008b39122d8e", "score": "0.78242815", "text": "func (c *Cache) Add(key, value interface{}) {\n\tif c.cache == nil {\n\t\treturn\n\t}\n\tc.cache.Add(key, c.newEntry(value))\n}", "title": "" }, { "docid": "4392ecd08ed4bb3754bafa63afb5210d", "score": "0.77789295", "text": "func (c *Cache) Add(key string, value interface{}, duration time.Duration) error {\n\tc.mu.Lock()\n\t_, found := c.get(key)\n\n\tif found {\n\t\tc.mu.Unlock()\n\t\treturn fmt.Errorf(\"Item %s already exists\", key)\n\t}\n\n\tc.set(key, value, duration)\n\tc.mu.Unlock()\n\n\treturn nil\n}", "title": "" }, { "docid": "1d0a6b123c751b1a2fb0cc7364d77bcc", "score": "0.7772144", "text": "func (c *Cache) Add(key string, value []byte) error {\n\tlastAccess := time.Now().UnixNano()\n\t// Check for existing item\n\tsize := int64(len(value))\n\tif elm, ok := c.items[key]; ok {\n\t\tc.evict.MoveToFront(elm)\n\t\tc.currentSize += size - elm.Value.(*element).size\n\t\telm.Value.(*element).size = size\n\t\telm.Value.(*element).lastAccess = lastAccess\n\t\treturn c.doEviction()\n\t}\n\n\t// Add new item\n\telm := &element{key, size, lastAccess}\n\tentry := c.evict.PushFront(elm)\n\tc.items[key] = entry\n\tc.currentSize += size\n\tif err := ioutil.WriteFile(filepath.Join(c.path, key), value, 0600); err != nil {\n\t\treturn err\n\t}\n\n\treturn c.doEviction()\n}", "title": "" }, { "docid": "f2f44e9773a4bc0d19fb57bee0c77b88", "score": "0.76649654", "text": "func (l *LRUCache) Add(key string, value interface{}) {\r\n\tl.lock.Lock()\r\n\tdefer l.lock.Unlock()\r\n\tl.adjust()\r\n\tl.currentAge++\r\n\tval := &trackValue{\r\n\t\tvalue: value,\r\n\t\tage: l.currentAge,\r\n\t}\r\n\tl.store[key] = val\r\n}", "title": "" }, { "docid": "92a98491d034a01ac061cf6b70eb33ae", "score": "0.75989217", "text": "func (c *Cache) Add(key string, value []byte) {\n\tc.content[key] = value\n}", "title": "" }, { "docid": "35abfffe39bd3f01d5a28418316a4df2", "score": "0.75885403", "text": "func (c *Cache) Add(key string, param Param) {\n\tc.Lock()\n\tdefer c.Unlock()\n\n\tc.val[key] = param\n}", "title": "" }, { "docid": "35abfffe39bd3f01d5a28418316a4df2", "score": "0.75885403", "text": "func (c *Cache) Add(key string, param Param) {\n\tc.Lock()\n\tdefer c.Unlock()\n\n\tc.val[key] = param\n}", "title": "" }, { "docid": "5a45bacae10c110d3b6dbcae61198147", "score": "0.7586466", "text": "func (cache *Cache) Add(args request.CacheRequest) response.CacheResponse {\n\tkey := args.Gobj.Key\n\tvalue := args.Gobj.Value\n\tttl := args.Gobj.TTL\n\n\tcache.Mux.Lock()\n\t_, ok := cache.Hashtable[key]\n\tcache.Mux.Unlock()\n\tif ok {\n\t\treturn response.NewResponseFromMessage(NotStored, 0)\n\t}\n\tif !cache.Full {\n\t\tinCache := keyInCache(cache, key)\n\n\t\tnewNode, _ := Insert(cache.DLL, key, value, ttl)\n\n\t\tinsertIntoHashtable(cache, key, newNode)\n\n\t\tif !inCache {\n\t\t\tatomic.AddInt32(&cache.Count, 1)\n\t\t}\n\n\t\tif cache.Count == cache.Size {\n\t\t\tcache.Full = true\n\t\t}\n\t} else {\n\t\tn, _ := RemoveLast(cache.DLL)\n\t\tdeleteFromHashtable(cache, n.Key)\n\n\t\tnewNode, _ := Insert(cache.DLL, key, value, ttl)\n\t\tinsertIntoHashtable(cache, key, newNode)\n\t}\n\treturn response.NewResponseFromMessage(STORED, 1)\n}", "title": "" }, { "docid": "0848c8b3bd9a543a11b0e56718ad6695", "score": "0.75659406", "text": "func (c *Cache) Add(ctx context.Context, hash string, query string) {\n\tc.client.Set(apqPrefix+hash, query, c.ttl)\n}", "title": "" }, { "docid": "e1c01faba94c90d9e58606cb0539fd3c", "score": "0.75408727", "text": "func (c *Cache) Add(h Hash, id int) {\n\tc.mu.Lock()\n\tdefer c.mu.Unlock()\n\tc.store[h] = id\n}", "title": "" }, { "docid": "47f7652183072f9b2fa2e056a008cc28", "score": "0.7531564", "text": "func (c *InMemoryStore) Add(key string, value interface{}, expires time.Duration) error {\n\terr := c.Cache.Add(key, value, expires)\n\tif err == cache.ErrKeyExists {\n\t\treturn ErrNotStored\n\t}\n\treturn err\n}", "title": "" }, { "docid": "5d1d93d6c39fb8d6e38a5e8689fd3795", "score": "0.7480628", "text": "func (m MapCache) Add(_ context.Context, key string, value interface{}) { m[key] = value }", "title": "" }, { "docid": "9e104b7d3c479deb56ac33f7d63a4571", "score": "0.73896277", "text": "func (c *Cache) Add(s Secret) {\n\tc.secretMap.Put(s.Name, s, time.Time{})\n}", "title": "" }, { "docid": "ea13254007933a1d3f55ff015e2c86be", "score": "0.738555", "text": "func (rc *RegistryCache) Add(serviceName string, info registry.ServiceInfo) {\n\tentry := cacheEntry{\n\t\tInfo: info,\n\t\tExpiry: time.Now().Add(rc.ttl),\n\t}\n\trc.mux.Lock()\n\trc.data[serviceName] = entry\n\trc.mux.Unlock()\n}", "title": "" }, { "docid": "24c4417e4d49dda8afc1863623666195", "score": "0.7380512", "text": "func (c *lruCache) Add(id, n uint64) {\n\tc.cache.Add(id, n)\n\tc.counts[id] = n\n}", "title": "" }, { "docid": "cc9963c41f89fa1e379086648f958176", "score": "0.73740375", "text": "func (cache *Cache)Add(key string, value Value) {\n\tif ele, ok := cache.cache[key]; ok {\n\t\tcache.ll.MoveToBack(ele)\n\t\tkv := ele.Value.(*entry)\n\t\tkv.value = value\n\t\treturn\n\t}\n\tele := cache.ll.PushBack(&entry{key, value})\n\tcache.cache[key] = ele\n\tcache.nbytes += int64(len(key)) + int64(value.Len())\n\n\tfor cache.maxBytes != 0 && cache.maxBytes < cache.nbytes {\n\t\tcache.RemoveOldest()\n\t}\n}", "title": "" }, { "docid": "fe9ab3292b14e6d610c1d830a9789d97", "score": "0.7372081", "text": "func (c *Cache) Add(key string, value Value) {\n\tif ele, ok := c.cache[key]; ok {\n\t\t// if the key has already existed, update its value and push it to the front of the list\n\t\tc.ll.MoveToFront(ele)\n\t\tkv := ele.Value.(*entry)\n\t\tc.nBytes += int64(value.Len()) - int64(kv.value.Len())\n\t\tkv.value = value\n\t} else {\n\t\t// if the key does not exist, push a new element to the front of the list\n\t\tele := c.ll.PushFront(&entry{key, value})\n\t\tc.cache[key] = ele\n\t\tc.nBytes += int64(value.Len())\n\t}\n\t// if cache consumes bytes more than the maxBytes, remove old element from the list till less than maxBytes\n\t// if maxBytes is 0, there is no constriction of the space cache can use and it's dangerous!\n\tfor c.maxBytes > 0 && c.maxBytes < c.nBytes {\n\t\tc.RemoveOldest()\n\t}\n}", "title": "" }, { "docid": "20d96e70fc8f59d243d2f28ed0ab2847", "score": "0.7356628", "text": "func (c *Cache) Add(key string, value Value) {\n\tif ele, ok := c.cache[key]; ok {\n\t\tc.ll.MoveToFront(ele)\n\t\tkv := ele.Value.(*entry)\n\t\tc.nbytes += int64(value.Len()) - int64(kv.value.Len())\n\t\tkv.value = value\n\t} else {\n\t\tele := c.ll.PushFront(&entry{key, value})\n\t\tc.cache[key] = ele\n\t\tc.nbytes += int64(len(key)) + int64(value.Len())\n\t}\n\tfor c.maxBytes != 0 && c.maxBytes < c.nbytes {\n\t\tc.RemoveOldest()\n\t}\n}", "title": "" }, { "docid": "f4a5f364a03212ae65fcb7973c5b43b3", "score": "0.735108", "text": "func (c *Cache) Add(buildid int64, hash string) {\n\tc.mutex.Lock()\n\tdefer c.mutex.Unlock()\n\n\tc.hashes[buildid] = hash\n}", "title": "" }, { "docid": "99eabff5dbc6ed50230cb10e2b37c531", "score": "0.734206", "text": "func (c *Cache) Add(plaintext string, ciphertext []byte) error {\n\tc.mutex.Lock()\n\tdefer c.mutex.Unlock()\n\terr := c.add(plaintext, ciphertext)\n\tif err != nil {\n\t\treturn fmt.Errorf(\"Error adding item to cache: %w\", err)\n\t}\n\treturn nil\n}", "title": "" }, { "docid": "6d40b168cc3e06a28deee40b55ebe4f4", "score": "0.7340518", "text": "func (c Redis) Add(ctx context.Context, key string, value interface{}, expire time.Duration) error {\n\tif !c.conn.SetNX(ctx, key, value, expire).Val() {\n\t\treturn cache.ErrNotStored\n\t}\n\treturn nil\n}", "title": "" }, { "docid": "26b359e5ec44e0e358706c047e7d1a56", "score": "0.73388666", "text": "func (c *LRUCache) Add(key string, value interface{}) {\n\tc.Lock()\n\tdefer c.Unlock()\n\tif ent, hit := c.items[key]; hit {\n\t\tc.cacheList.MoveToFront(ent)\n\t\tent.Value.(*entry).value = value\n\t\treturn\n\t}\n\tent := &entry{\n\t\tkey: key,\n\t\tvalue: value,\n\t}\n\tentry := c.cacheList.PushFront(ent)\n\tc.items[key] = entry\n\n\tif c.maxEntries > 0 && c.cacheList.Len() > c.maxEntries {\n\t\tc.removeOldestElement()\n\t}\n}", "title": "" }, { "docid": "332fa3c904f6785cafb05f8c096f0d47", "score": "0.7316444", "text": "func (tc *Tagcache) Add(ctx context.Context, item *memcache.Item) (err error) {\n\tconn := tc.conn\n\terr = conn.AddContext(ctx, item)\n\tconn.Close()\n\treturn\n}", "title": "" }, { "docid": "0ab1e1c87e3722e6c0bab6a96cece2b5", "score": "0.7313964", "text": "func (tc *TimeCache) Add(item string) bool {\n\ttc.mutex.Lock()\n\tdefer tc.mutex.Unlock()\n\n\t_, ok := tc.cache[item]\n\tif ok {\n\t\treturn false\n\t}\n\n\ttc.sweep()\n\n\ttc.cache[item] = time.Now()\n\ttc.indexer.PushFront(item)\n\treturn true\n}", "title": "" }, { "docid": "74a06aeaf680d419d9755a13404a24e0", "score": "0.72648376", "text": "func (ttlCache *Cache) Add(key interface{}, val interface{}) bool {\n\tttlCache.mu.Lock()\n\tdefer ttlCache.mu.Unlock()\n\n\treturn ttlCache.Cacher.Add(key, &timeToLiveItem{\n\t\tValue: val,\n\t\tLastTouch: time.Now(),\n\t})\n}", "title": "" }, { "docid": "434cfac30f0230b0a9609e7e656f7e1f", "score": "0.7257283", "text": "func(c *Cache) Add(key string,value Value) {\n\tif ele,ok :=c.cache[key];ok{\n\t\tc.ll.MoveToFront(ele) //如果键存在,则更新对应节点的值,并将该节点移到队尾\n\t\tkv:=ele.Value.(*entry)\n\t\tc.nbytes+=int64(value.Len())-int64(kv.value.Len())\n\t\tkv.value=value\n\t\treturn\n\t}\n\tele:=c.ll.PushFront(&entry{key,value}) //不存在在队尾添加新节点\n\tc.cache[key]=ele //在字典中添加key和新节点的映射关系\n\tc.nbytes+=int64(len(key))+int64(value.Len())\n\tfor c.maxBytes !=0&&c.maxBytes<c.nbytes{ //如果超过了设定的最大值 c.maxBytes,则移除最少访问的节点\n\t\tc.RemoveOldest()\n\t}\n}", "title": "" }, { "docid": "7b4ea79e96e4360db403c12787bb2151", "score": "0.7243892", "text": "func (c *Cache) Add(key []byte, val TimestampValue) {\n\tc.AddRange(key, key, 0, val)\n}", "title": "" }, { "docid": "7225371a2ae407c3deeaec7353d8b04a", "score": "0.7219455", "text": "func (lru *LRU) Add(key, value interface{}) {\n\tlru.mu.Lock()\n\tdefer lru.mu.Unlock()\n\n\t// Already in cache?\n\tif ee, ok := lru.cache[key]; ok {\n\t\tlru.ll.MoveToFront(ee)\n\t\tee.Value = entry{key, value, time.Now()}\n\t\treturn\n\t}\n\n\t// Add to cache if not present\n\tele := lru.ll.PushFront(entry{key, value, time.Now()})\n\tlru.cache[key] = ele\n\n\tif lru.ll.Len() > lru.maxEntries {\n\t\tlru.removeOldest()\n\t}\n}", "title": "" }, { "docid": "0ad21d7305bbb6c09a43d103d522c943", "score": "0.7215203", "text": "func (c *Cache) Add(ctx context.Context, hash string, query interface{}) {\n\tblob, err := json.Marshal(query)\n\tif err != nil {\n\t\tlog.Errorw(\"could not marshal query\", zap.Error(err))\n\t}\n\n\t_, err = db.ExecContext(\n\t\tctx,\n\t\t`\nINSERT INTO cache(key, value, modified_at)\nVALUES ($1, $2, $3)\nON CONFLICT (key) DO UPDATE\nSET (value, modified_at) = ($2, $3)\nWHERE cache.key = $1;\n`,\n\t\thash,\n\t\tblob,\n\t\ttime.Now())\n\n\tif err != nil {\n\t\tlog.Errorw(\"could not insert key\", zap.Error(err))\n\t}\n}", "title": "" }, { "docid": "97e5d8f0934dc0b438e79bdd7e6d3bd0", "score": "0.71875286", "text": "func (c *Cache) Add(rev *Revocation) {\n\tvar hash string\n\tswitch rev.Type {\n\tcase REVOCATION_TYPE_TOKEN:\n\t\tif _, ok := rev.Data[\"token_hash\"]; !ok {\n\t\t\tlog.Println(\"Error adding revocation to cache: missing token_hash.\")\n\t\t\treturn\n\t\t}\n\t\thash = rev.Data[\"token_hash\"].(string)\n\tcase REVOCATION_TYPE_CLAIM:\n\t\tif _, ok := rev.Data[\"names\"]; !ok {\n\t\t\tlog.Println(\"Error adding revocation to cache: missing claim names.\")\n\t\t\treturn\n\t\t}\n\t\tif _, ok := rev.Data[\"value_hash\"]; !ok {\n\t\t\tlog.Println(\"Error adding revocation to cache: missing claim values hash.\")\n\t\t\treturn\n\t\t}\n\t\thash = rev.Data[\"value_hash\"].(string)\n\tcase REVOCATION_TYPE_GLOBAL:\n\t\thash = REVOCATION_TYPE_GLOBAL\n\tcase REVOCATION_TYPE_FORCEREFRESH:\n\t\thash = REVOCATION_TYPE_FORCEREFRESH\n\tdefault:\n\t\tlog.Printf(\"Error adding revocation to cache. Unknown revocation type: %s\", rev.Type)\n\t\treturn\n\t}\n\tc.set <- &request{key: hash, val: rev}\n}", "title": "" }, { "docid": "3dfb00baa08ce8b5c2baa8132567c165", "score": "0.7183217", "text": "func (cache *MemoryCache) Add(cacheKey string, cacheData string) {\n\tcache.Lock()\n\tdefer cache.Unlock()\n\n\tif len(cache.cacheKeys) >= cache.MaxCount && len(cache.cacheKeys) > 1 {\n\t\tdelete(cache.cacheHolder, cache.cacheKeys[0]) // delete first item\n\t\tcache.cacheKeys = append(cache.cacheKeys[1:]) // pop first one\n\t}\n\n\tcache.cacheHolder[cacheKey] = cacheData\n\tcache.cacheKeys = append(cache.cacheKeys, cacheKey)\n}", "title": "" }, { "docid": "e6bf742e17e61edd11533db002ba53b6", "score": "0.7139536", "text": "func (c *LRUCache) Add(key interface{}, value interface{}) bool {\n\tif c.items == nil {\n\t\tc.items = make(map[interface{}]*list.Element)\n\t\tc.evictList = list.New()\n\t}\n\texpireAt := time.Now().Add(c.expiration).Unix()\n\tif ee, ok := c.items[key]; ok {\n\t\tc.evictList.MoveToFront(ee)\n\t\tkv := ee.Value.(*cache.Entry)\n\t\tkv.Value = value\n\t\tkv.Timestamp = expireAt\n\t\t//atomic.StoreInt64(&kv.timestamp, expireAt)\n\t\treturn true\n\t}\n\tele := c.evictList.PushFront(&cache.Entry{key, value, expireAt})\n\tc.items[key] = ele\n\tif c.size != 0 && uint32(c.evictList.Len()) > c.size {\n\t\tc.RemoveOldest()\n\t}\n\treturn true\n}", "title": "" }, { "docid": "63fcabde19a7924efb09b0afc5809a0b", "score": "0.712034", "text": "func (c *SimpleCache) Add(container, path string, node Node) {\n\tc.changes[c.key(container, path)] = node\n}", "title": "" }, { "docid": "63b83b3dfcd4c180cf4cf1bb2230e654", "score": "0.71084833", "text": "func Add(c appengine.Context, item *Item) os.Error {\n\treturn set(c, []*Item{item}, nil, pb.MemcacheSetRequest_ADD)[0]\n}", "title": "" }, { "docid": "813affa312cbef04a286354b9e37ca97", "score": "0.70785177", "text": "func (d *ResultCache) Add(id string, result *Result) {\n\td.lock.Lock()\n\tdefer d.lock.Unlock()\n\t_, ok := d.lookup[id]\n\tif ok {\n\t\treturn\n\t}\n\tif d.lookup == nil {\n\t\td.lookup = make(map[string]*Result)\n\t}\n\td.lookup[id] = result\n\td.buffer.PushBack(id)\n\tif d.buffer.Len() > d.size {\n\t\te := d.buffer.Front()\n\t\td.buffer.Remove(e)\n\t\tdelete(d.lookup, e.Value.(string))\n\t}\n}", "title": "" }, { "docid": "13aa055d1a1bacb9c3144c5c8f3ea3a9", "score": "0.70662194", "text": "func (table *CacheTable) Add(key string, data interface{}) *CacheItem {\n\treturn table.AddExpiry(key, table.expiryTime, data)\n}", "title": "" }, { "docid": "09acc770fd71c3a266644feb3f11a66f", "score": "0.7060691", "text": "func AddToCache(key, value string) {\n\n\tC.Set(key, value, cache.NoExpiration)\n}", "title": "" }, { "docid": "c02b28d4c8863e2398844aa76783c15f", "score": "0.7007531", "text": "func (c *Cache) add(plaintext string, ciphertext []byte) error {\n\terr := c.young.Put(plaintextToKey(plaintext), ciphertext)\n\tif err != nil {\n\t\treturn err\n\t}\n\treturn c.young.Put(ciphertextToKey(ciphertext), []byte(plaintext))\n}", "title": "" }, { "docid": "f80c757fcffbb7615c08e4ff1f5daee1", "score": "0.6998148", "text": "func (c *Cached) Add(id machine.ID, addr machine.Addr) error {\n\tc.mu.Lock()\n\tdefer c.mu.Unlock()\n\n\tif err := c.addresses.Add(id, addr); err != nil {\n\t\treturn err\n\t}\n\n\treturn c.st.SetValue(storageKey, c.addresses.all())\n}", "title": "" }, { "docid": "f9688498dd350df8f1f3fa8ad31699ce", "score": "0.6961541", "text": "func (c *CacheAPI) Add(request string, resp *http.Response) error {\n\tresChan := make(chan error, 0)\n\n\tres, reqs := cache.HTTPResponseToResponse(resp)\n\tif reqs == nil {\n\t\treqs = &cache.Request{Path: request, Method: \"GET\"}\n\t}\n\n\tresObj := ResponseToJSResponse(res)\n\n\tc.Call(\"put\", reqs, resObj).Call(\"catch\", func(err *js.Object) {\n\t\tgo func() {\n\t\t\tresChan <- errors.New(err.String())\n\t\t}()\n\t})\n\n\treturn <-resChan\n}", "title": "" }, { "docid": "25630c75138f8be2298a800af301e3c2", "score": "0.69532007", "text": "func (c *assetCache) add(name string, data []byte) error {\n\tc.m.Lock()\n\tdefer c.m.Unlock()\n\n\tk := md5Sum(name)\n\te := &assetCacheEntry{\n\t\texp: time.Now().Add(c.ttl),\n\t}\n\te.filepath = filepath.Join(c.dir, fmt.Sprintf(\"%s_%d\", k, e.exp.Unix()))\n\tc.entries[k] = e\n\n\treturn ioutil.WriteFile(e.filepath, data, 0755)\n}", "title": "" }, { "docid": "af8410116339f4ff9cd21ed37128d15d", "score": "0.69373757", "text": "func (c *LRUExpireCache) Add(\n\tkey string,\n\tvalue interface{},\n\tttl time.Duration,\n) {\n\tc.lock.Lock()\n\tdefer c.lock.Unlock()\n\n\toldElement, ok := c.entries[key]\n\tif ok {\n\t\tc.evictionList.MoveToFront(oldElement)\n\t\toldElement.Value.(*cacheEntry).value = value\n\t\toldElement.Value.(*cacheEntry).expireTime = time.Now()\n\t\treturn\n\t}\n\n\tif c.evictionList.Len() >= c.maxSize {\n\t\ttoEvict := c.evictionList.Back()\n\t\tc.evictionList.Remove(toEvict)\n\t\tdelete(c.entries, toEvict.Value.(*cacheEntry).key)\n\t}\n\n\telement := c.evictionList.PushFront(&cacheEntry{\n\t\tkey: key,\n\t\tvalue: value,\n\t\texpireTime: time.Now().Add(ttl),\n\t})\n\tc.entries[key] = element\n}", "title": "" }, { "docid": "ad98bca86123117859be1f63d8e186df", "score": "0.69320357", "text": "func (fc *FeatureCache) Add(feature *Feature) {\n\tfc.lock.Lock()\n\tdefer fc.lock.Unlock()\n\n\tfc.features[feature.Name] = feature\n}", "title": "" }, { "docid": "c72be1fafa5c04202111c912c37a27fe", "score": "0.6917017", "text": "func AddToCache(name string, module Module) error {\n\treturn nil\n}", "title": "" }, { "docid": "8bc908c24bb6a7d245c064a7bd72f2d1", "score": "0.6901232", "text": "func (ilic *inmemoryLayerInfoCache) Add(ctx context.Context, repo string, dgst digest.Digest) error {\n\tmembers, ok := ilic.membership[repo]\n\tif !ok {\n\t\tmembers = make(map[digest.Digest]struct{})\n\t\tilic.membership[repo] = members\n\t}\n\n\tmembers[dgst] = struct{}{}\n\n\treturn nil\n}", "title": "" }, { "docid": "fde23100b110cf3e93ebad50cc622ee9", "score": "0.6896543", "text": "func (c *Cache) Add(result *Results) []*Results {\n\tc.lock.Lock()\n\tdefer c.lock.Unlock()\n\n\treturn c.get(result.BlockNumber).add(result)\n}", "title": "" }, { "docid": "26a5d8657e90f87ed772299b6dec218c", "score": "0.6895991", "text": "func (ac *_dbCache) add(name string, al *alias) (added bool) {\n\tac.mux.Lock()\n\tdefer ac.mux.Unlock()\n\tif _, ok := ac.cache[name]; !ok {\n\t\tac.cache[name] = al\n\t\tadded = true\n\t}\n\treturn\n}", "title": "" }, { "docid": "b5d6cac50c79284a077d6abfe64354a8", "score": "0.68381596", "text": "func (c *relayCache) Add(p hashable) {\n\tc.Lock()\n\tdefer c.Unlock()\n\n\th := p.Hash()\n\tif c.elems[h] != nil {\n\t\treturn\n\t}\n\n\tif c.queue.Len() >= c.maxCap {\n\t\tfirst := c.queue.Front()\n\t\tc.queue.Remove(first)\n\t\tdelete(c.elems, first.Value.(hashable).Hash())\n\t}\n\n\te := c.queue.PushBack(p)\n\tc.elems[h] = e\n}", "title": "" }, { "docid": "a6e435e0544e1ffe5ff6fdc5b1829b20", "score": "0.68311304", "text": "func (cache *URLCache) Add(url string) {\n\tcache.mux.Lock()\n\tcache.urls[url] = true\n\tcache.mux.Unlock()\n}", "title": "" }, { "docid": "1bf9f472dcc683bc9d41f0ccf40d0bed", "score": "0.6812346", "text": "func (c *TokenCache) Add(token string, claims UserClaims) error {\n\tc.mu.Lock()\n\tdefer c.mu.Unlock()\n\tc.Entries[token] = claims\n\treturn nil\n}", "title": "" }, { "docid": "ee493b03386e5bb573bb6a72df95f619", "score": "0.67912745", "text": "func (ima *InMemoryAPIKeyAccess) Add(token string) {\n\tima.Lock()\n\tima.token[token] = time.Now().Add(ima.ttl).Unix()\n\tima.Unlock()\n}", "title": "" }, { "docid": "1bf1f4d18b58ea498853e49648f63734", "score": "0.67852175", "text": "func (m memoryCache) Put(u *url.URL, e *Entry) error {\n\tm.mutex.Lock()\n\tdefer m.mutex.Unlock()\n\tm.Cache.Add(u.String(), e)\n\treturn nil\n}", "title": "" }, { "docid": "4daed9560270b3e947187f5fc831ec3b", "score": "0.6779593", "text": "func (n *Neo4jCache) Add(a, b string, value float64) {\n\tvar buffer bytes.Buffer\n\tif a < b {\n\t\tbuffer.WriteString(a)\n\t\tbuffer.WriteString(b)\n\t} else {\n\t\tbuffer.WriteString(b)\n\t\tbuffer.WriteString(a)\n\t}\n\n\tn.cache[buffer.String()] = value\n}", "title": "" }, { "docid": "cc6698deebfccc0ea419bd28f978e246", "score": "0.6778369", "text": "func AddToCache(name string, module Module) error {\n\treturn cache.Add(name, module)\n}", "title": "" }, { "docid": "7d9e08f7b677bbdc3080bc5a53d339b7", "score": "0.6774872", "text": "func (c *Cache) Put(key, value string) {\n\tif len(c.data) == c.size {\n\t\tdelete(c.data, c.lst.Back().Value.(*Item).key)\n\t\tc.lst.Remove(c.lst.Back())\n\t}\n\tc.data[key] = c.lst.PushFront(&Item{key, value})\n}", "title": "" }, { "docid": "46cc0294b881693956346093f1264c3f", "score": "0.67602193", "text": "func (cache *FileCache) addItem(name string) (err error) {\n\tif cache.isCacheNull() {\n\t\treturn\n\t}\n\tok := cache.InCache(name)\n\texpired := cache.itemExpired(name)\n\tif ok && !expired {\n\t\treturn nil\n\t} else if ok {\n\t\tdelete(cache.items, name)\n\t}\n\n\titm, err := cacheFile(name, cache.MaxSize)\n\tif cache.items != nil && itm != nil {\n\t\tcache.lock()\n\t\tcache.items[name] = itm\n\t\tcache.unlock()\n\t} else {\n\t\treturn\n\t}\n\tif !cache.InCache(name) {\n\t\treturn ItemNotInCache\n\t}\n\treturn nil\n}", "title": "" }, { "docid": "40d33e85aaa178cf54eb69c86926bb75", "score": "0.6741409", "text": "func (c *LRUCache) Add(key interface{}, value interface{}) {\n\t// check nil\n\tif c.hashMap == nil {\n\t\tc.hashMap = make(map[interface{}]*list.Element)\n\t\tc.doubleLinkedList = list.New()\n\t}\n\n\t// update value of exist key\n\tif entry, ok := c.hashMap[key]; ok {\n\t\tc.doubleLinkedList.MoveToFront(entry)\n\t\tentry.Value.(*cacheEntry).value = value\n\t\treturn\n\t}\n\n\t// add new key\n\tnewEntry := c.doubleLinkedList.PushFront(&cacheEntry{key, value})\n\tc.hashMap[key] = newEntry\n\n\t// remove oldest if reach the capacity\n\tif c.capacity != 0 && c.doubleLinkedList.Len() > c.capacity {\n\t\tremoveEntry := c.doubleLinkedList.Back()\n\t\tc.doubleLinkedList.Remove(removeEntry)\n\t\tdelete(c.hashMap, removeEntry.Value.(*cacheEntry).key)\n\t}\n}", "title": "" }, { "docid": "475d497cc20d16fe6c57002557ec90c7", "score": "0.67323905", "text": "func (s *Storage) Add(ctx context.Context, bucket entities.Bucket, key interface{}) error {\n\ts.mx.Lock()\n\tdefer s.mx.Unlock()\n\ts.m[key] = bucket\n\n\treturn nil\n}", "title": "" }, { "docid": "5490b5497ace76ea50f7a762e95c5220", "score": "0.67262304", "text": "func (w *Wrapper) Add(ctx context.Context, k string, x interface{}, d time.Duration) (err error) {\n\tif AllowTrace(ctx, w.options.Add, w.options.AllowRoot) {\n\t\tspan := StartSpan(ctx, \"go.cache.add\", w.options)\n\t\tif span != nil {\n\t\t\tdefer func() {\n\t\t\t\tspan.EndSpanWithErr(err)\n\t\t\t}()\n\t\t}\n\t}\n\tvar statsFunc = recordCallErrorStatus(ctx, \"go.cache.add\", w.options.InstanceName)\n\tdefer func() {\n\t\tstatsFunc(err)\n\t}()\n\n\terr = w.Cache.Add(k, x, d)\n\n\treturn\n}", "title": "" }, { "docid": "3fe9ca1bb24b3982b8e290fca87dfd9b", "score": "0.672606", "text": "func (c *LRUCache) Add(key Key, value interface{}) interface{} {\n\tif c.cache == nil {\n\t\tc.cache = make(map[interface{}]*list.Element)\n\t\tc.ll = list.New()\n\t}\n\tif e, ok := c.cache[key]; ok {\n\t\tc.ll.MoveToFront(e)\n\t\tvalue, e.Value.(*entry).value = e.Value.(*entry).value, value\n\t\treturn value\n\t}\n\te := c.ll.PushFront(&entry{key, value})\n\tc.cache[key] = e\n\tif c.Size != 0 && uint(c.ll.Len()) > c.Size {\n\t\tv := c.ll.Remove(c.ll.Back())\n\t\tdelete(c.cache, v.(*entry).key)\n\t}\n\treturn nil\n}", "title": "" }, { "docid": "99ab7163ac6d4e3df59b46bbad8efcd5", "score": "0.6723886", "text": "func (client *Client) Add(vb uint16, key string, flags int, exp int,\n\tbody []byte) (gomemcached.MCResponse, error) {\n\treturn client.store(gomemcached.ADD, vb, key, flags, exp, body)\n}", "title": "" }, { "docid": "68bccf52828d645e39fb97623624132a", "score": "0.67080575", "text": "func (c *LRU) Add(key, value interface{}) bool {\n\tkeyStr, ok := key.(string)\n\tif !ok {\n\t\treturn false // TODO: Report error, but interface does not have it\n\t}\n\n\tv := c.items.Upsert(keyStr, value,\n\t\tfunc(exist bool, valueInMap, newValue interface{}) interface{} {\n\t\t\tif exist {\n\t\t\t\t// TODO: I think it would be better if the items were immutable\n\t\t\t\t// Update existing node\n\t\t\t\tv := valueInMap.(item)\n\t\t\t\t// If the move to front fails, the item is being evicted,\n\t\t\t\t// so insert a new item instead.\n\t\t\t\tif c.evict.MoveToFront(v.evictElement) {\n\t\t\t\t\tv.value = newValue\n\t\t\t\t\treturn &v\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t// Create new node\n\t\t\tv := item{\n\t\t\t\tkey: keyStr,\n\t\t\t\tvalue: newValue,\n\t\t\t\tevictElement: nil,\n\t\t\t}\n\t\t\treturn &v\n\t\t}).(*item)\n\tif v.evictElement == nil {\n\t\t// new element inserted, count it and add to evict list\n\t\tc.cleanup.L.Lock()\n\t\tn := int(atomic.AddInt64(&c.len, 1))\n\t\tc.cleanup.L.Unlock()\n\t\tv.evictElement = c.evict.PushFront(v)\n\t\tif n > c.capacity {\n\t\t\t// actual cleanup happens in the background\n\t\t\tc.cleanup.Signal()\n\t\t\treturn true\n\t\t}\n\t}\n\n\treturn false\n}", "title": "" }, { "docid": "187cb8a12d3afe2984a3fb781a6a9b2c", "score": "0.6706822", "text": "func (c *bounded) Add(key string, content []byte) {\n\tif i, ok := c.data[key]; ok {\n\t\t// key already exists: update content and return\n\t\ti.content = content\n\t\ti.lastAccessTime = time.Now()\n\t\theap.Fix(c.insertionQueue, i.index)\n\t\treturn\n\t}\n\n\tif len(c.data) >= maxItems {\n\t\t// remove least recently used element\n\t\tx := heap.Pop(c.insertionQueue)\n\t\ti := x.(*item)\n\t\tlog.Printf(\"Content for key %s has been replaced\", i.key)\n\t\tdelete(c.data, i.key)\n\t}\n\n\t// add new element\n\ti := item{\n\t\tkey: key,\n\t\tcontent: content,\n\t}\n\theap.Push(c.insertionQueue, &i)\n\tc.data[key] = &i\n}", "title": "" }, { "docid": "c71a4e5bf942fbe12cf664c2b02f40d5", "score": "0.66973054", "text": "func (cmc *cacheMutationCheck) Add(o runtime.Object) {\n\tcmc.objects = append(cmc.objects, cacheObject{\n\t\toriginal: o,\n\t\tdeepCopy: o.DeepCopyObject(),\n\t})\n}", "title": "" }, { "docid": "c71a4e5bf942fbe12cf664c2b02f40d5", "score": "0.66973054", "text": "func (cmc *cacheMutationCheck) Add(o runtime.Object) {\n\tcmc.objects = append(cmc.objects, cacheObject{\n\t\toriginal: o,\n\t\tdeepCopy: o.DeepCopyObject(),\n\t})\n}", "title": "" }, { "docid": "501f4fddbe6b7044a0bd197e3b1f1d44", "score": "0.66921556", "text": "func (c *Cache) Add(int1, int2, limit int, str1, str2 string) (float64, error) {\n\n\t// add a member in the ZSET or update the score of this member\n\tmember := makeKey(int1, int2, limit, str1, str2)\n\treturn c.client.ZIncr(\n\t\tZSetKey,\n\t\tredis.Z{\n\t\t\tScore: 1,\n\t\t\tMember: member,\n\t\t},\n\t).Result()\n}", "title": "" }, { "docid": "77d3ebdbc83c248f82d62b66443123fe", "score": "0.6688", "text": "func (i *InMemoryQueue) Add(item HitInterface) {\n\ti.Mux.Lock()\n\ti.Queue = append(i.Queue, item)\n\ti.Mux.Unlock()\n}", "title": "" }, { "docid": "3f14377eecba1063030cda41c3c95002", "score": "0.6679196", "text": "func (tc *TimedCache) Put(key string, content interface{}, duration time.Duration) {\n tc.mu.Lock()\n tc.items[key] = cacheItem {\n Content: content,\n ExpiresAt: time.Now().UTC().Add(duration),\n KeepRefreshing: false,\n }\n tc.mu.Unlock()\n}", "title": "" }, { "docid": "811ab295d605236dd64f772476cf6489", "score": "0.66784924", "text": "func (m *CacheMiddleware) put(key string, ent *entry) {\n\tm.mutex.Lock()\n\tdefer m.mutex.Unlock()\n\tm.cache.Add(key, ent)\n}", "title": "" }, { "docid": "b557d56c5817c9dd9d162cf40c1e4a48", "score": "0.66660595", "text": "func (r *Redis) Add(key string, resource string, now time.Time) (int, error) {\n\treturn 0, nil\n}", "title": "" }, { "docid": "baef222221e540004c4f8ac979af9133", "score": "0.66591144", "text": "func (cc *colorCache) Add(url string, resp imgResponse) {\n\t// Lock the cache while we're adding\n\tcc.mutex.Lock()\n\n\tif cc.count >= cc.max {\n\t\t// If we've exceeded the max size, we must remove the oldest\n\t\t// element\n\n\t\t// Find the last element\n\t\tback := cc.exp.Back()\n\n\t\t// Remove it from the cache\n\t\tdelete(cc.hmap, back.Value.(string))\n\n\t\t// Also remove it from the exp list\n\t\tcc.exp.Remove(back)\n\t} else {\n\n\t\t// Otherwise, we didn't remove anything so increment count\n\t\tcc.count++\n\t}\n\n\t// Add new url to be last to expire\n\tcc.exp.PushFront(url)\n\n\t// Save its value\n\tcc.hmap[url] = resp\n\n\t// Done locking\n\tcc.mutex.Unlock()\n}", "title": "" }, { "docid": "0845ea3c32b1e3b26c68e7a3891bfa3c", "score": "0.6656957", "text": "func (c *StringCache) Add(key string, intervalSeconds float64, refresh StringCacheRefreshFunc) {\n\tc.storage[key] = &StringCacheItem{\n\t\tinterval: intervalSeconds,\n\t\trefresh: refresh,\n\t}\n\tc.Get(key)\n}", "title": "" }, { "docid": "b1e4e2722693fd90f841fd55ee698916", "score": "0.6656852", "text": "func (m *CacheMock) Add(item *memcache.Item) error {\n\targs := m.Called(item)\n\treturn args.Error(0)\n}", "title": "" }, { "docid": "6d82aa0a0492226d93f2d9cd9fa9b3a2", "score": "0.66389424", "text": "func (l *LRU) Add(key, value interface{}) {\n\tif f, o := l.items[key]; o {\n\t\tl.l.MoveToFront(f)\n\t\tif v, ok := f.Value.(*item); ok {\n\t\t\tv.value = value\n\t\t}\n\t\treturn\n\t}\n\n\tnewItem := &item{key, value}\n\titemList := l.l.PushFront(newItem)\n\tl.items[key] = itemList\n\tif l.Len() > l.Cap {\n\t\tl.removeOldestEntry()\n\t}\n}", "title": "" }, { "docid": "5b4309e6b1f9a924b5f3452c6d52fe74", "score": "0.6626481", "text": "func (this *LRUCache146) add(node *Node146) {\n\tthis.NodeMap[node.Key] = node\n\tif this.Size == 0 {\n\t\tthis.Head = node\n\t\tthis.Tail = node\n\t} else {\n\t\tnode.Prev = this.Tail\n\t\tthis.Tail.Next = node\n\t\tthis.Tail = node\n\t}\n\tthis.Size++\n}", "title": "" }, { "docid": "466d281c8014068c02663f0d96f206c1", "score": "0.662149", "text": "func (lruCache *LRUCache) Put(key, val int) {\n\tif lruCache.hasKey(key) {\n\t\t// if key exists in store\n\t\t// update the value at the specified key\n\t\t// move it to front of the list\n\n\t\titem := lruCache.store[key]\n\t\titem.value = val\n\n\t\tlruCache.moveToFront(item)\n\t} else {\n\t\t// if key doesn't exist in store\n\t\t// write it to the store\n\t\t// move it to the front\n\t\t// if size exceeds capacity, remove last cache item\n\t\t// increment current size\n\n\t\tnewItem := &cacheItem{key: key, value: val}\n\t\tnewItem = lruCache.addToFront(newItem)\n\n\t\t// fmt.Printf(\"adding item %v \\n\", newItem)\n\t\tlruCache.store[key] = newItem\n\t\tlruCache.Size++\n\n\t\tif lruCache.Size > lruCache.Capacity {\n\t\t\t// fmt.Println(\"removing last item\")\n\t\t\tlastItem := lruCache.removeLastItem()\n\t\t\t// fmt.Printf(\"deleting last item %v \\n\", lastItem)\n\t\t\tdelete(lruCache.store, lastItem.key)\n\t\t}\n\t}\n}", "title": "" }, { "docid": "1dcecde30cfb6d405cdeec9cef2e7178", "score": "0.6614388", "text": "func (lru *lruCache) add(newItem *Item) (_ *Item, evicted bool) {\n\tif lru.ll.Len() < lru.cap {\n\t\tlru.data[newItem.Key] = lru.ll.PushFront(newItem)\n\t\treturn nil, false\n\t}\n\n\t// reuse the tail item\n\tval := lru.ll.Back()\n\titem := val.Value.(*Item)\n\n\tdelete(lru.data, item.Key)\n\n\toldItem := *item\n\t*item = *newItem\n\n\tlru.data[item.Key] = val\n\tlru.ll.MoveToFront(val)\n\n\treturn &oldItem, true\n}", "title": "" }, { "docid": "e280b4d087651910adf46ee5b6de5970", "score": "0.659674", "text": "func (c *cacheMap) addCacheEntry(ie *zstypes.InsCacheInfo) {\n\tbi := c.hash(ie.AName, ie.IName)\n\n\tzlog.Debug(\"Adding cache entry: account %s instance %s to bucket %d\\n\", ie.AName, ie.IName, bi)\n\n\tie.Next = c.bkts[bi]\n\tsptr := (*reflect.SliceHeader)(unsafe.Pointer(&c.bkts))\n\tbarrPtr := (*[4294967295]*zstypes.InsCacheInfo)(unsafe.Pointer(sptr.Data))\n\tfor !atomic.CompareAndSwapPointer((*unsafe.Pointer)(unsafe.Pointer(&barrPtr[bi])), unsafe.Pointer(ie.Next), unsafe.Pointer(ie)) {\n\t\tie.Next = c.bkts[bi]\n\t}\n\tatomic.AddInt32(&c.nr, 1)\n\tzlog.Debug(\"Done adding cache entry: account %s instance %s to bucket %d ninuse %d\\n\", ie.AName, ie.IName, bi, atomic.LoadInt32(&c.nr))\n}", "title": "" }, { "docid": "70d2260bb77fa44a099318585d2d8270", "score": "0.6572825", "text": "func (m *Storage) Add(short, long string) (urlID int64) {\n\treturn m.cache.Add(long, short)\n}", "title": "" }, { "docid": "efb7de34d1a322ff22e7c39c1b8ce36b", "score": "0.6563375", "text": "func (s *Set) Add(item interface{}) {\n\ts.lock.Lock()\n\tdefer s.lock.Unlock()\n\ts.items[item] = struct{}{}\n}", "title": "" }, { "docid": "26327bb42677ac3f78d46de37913627b", "score": "0.65474737", "text": "func (cache *DecayingLRUCache) Add(key string, val interface{}) {\n\tcache.lock.Lock()\n\tdefer cache.lock.Unlock()\n\n\telement := &cacheElement{key, val, time.Now()}\n\tLogger.Infow(\"Adding key.\", \"key\", key)\n\t// Append to our time-ordered log\n\tcache.log.PushBack(element)\n\n\t// Update both the hashmap and doubly linked list for the element.\n\tref, exists := cache.hashmap[key]\n\tif exists {\n\t\tcache.elements.MoveToFront(ref)\n\t\tref.Value = element\n\t} else {\n\t\tlistElement := cache.elements.PushFront(element)\n\t\tcache.hashmap[key] = listElement\n\t}\n\n\t// Handle eviction. Could be more DRY.\n\tif cache.elements.Len() > cache.capacity {\n\t\tlru := cache.elements.Back()\n\t\tif lru != nil {\n\t\t\tlruKey := lru.Value.(*cacheElement).Key\n\t\t\tLogger.Infow(\"Evicting key due to capacity.\",\n\t\t\t\t\"key\", lruKey,\n\t\t\t\t\"size\", cache.elements.Len())\n\t\t\tcache.elements.Remove(lru)\n\t\t\tdelete(cache.hashmap, lruKey)\n\t\t}\n\t}\n}", "title": "" }, { "docid": "afaf44f69636a480df2c3c9b05c20564", "score": "0.6510425", "text": "func (m *ClientManager) Add(client *Client) {\n\tm.initInternals()\n\tm.mu.Lock()\n\tdefer m.mu.Unlock()\n\n\tkey := cacheKey(client.Certificate)\n\tnow := time.Now()\n\tif ele, hit := m.cache[key]; hit {\n\t\titem := ele.Value.(*managerItem)\n\t\titem.client = client\n\t\titem.lastUsed = now\n\t\tm.ll.MoveToFront(ele)\n\t\treturn\n\t}\n\tele := m.ll.PushFront(&managerItem{key, client, now})\n\tm.cache[key] = ele\n\tif m.MaxSize != 0 && m.ll.Len() > m.MaxSize {\n\t\tm.mu.Unlock()\n\t\tm.removeOldest()\n\t\tm.mu.Lock()\n\t}\n}", "title": "" }, { "docid": "5706e09878922e97c320ee3ba86ba485", "score": "0.6506656", "text": "func (cm *ConcurrentMap) Add(key string, value interface{}) {\n\tcm.lock.Lock()\n\tdefer cm.lock.Unlock()\n\tcm.m[key] = value\n}", "title": "" }, { "docid": "c4c2c05232b420248ed45da0ee526e1e", "score": "0.650337", "text": "func (m *memoryCache) Put(u *url.URL, data []byte) error {\n\tm.Lock()\n\tdefer m.Unlock()\n\tm.Cache.Add(u.String(), &entry{data, time.Now()})\n\treturn nil\n}", "title": "" }, { "docid": "f89ddefb8167204085e5f3e99a4f9b95", "score": "0.64898384", "text": "func (r *Repo) Add(url, subkey, ref string) error {\n\t// Do clone\n\tif err := r.cacheUpdate(url, subkey, ref); err != nil {\n\t\treturn errors.Wrap(err, \"add/clone\")\n\t}\n\n\t// Get SHA\n\tsha, err := r.lookupSHA(subkey, ref)\n\tif err != nil {\n\t\treturn err\n\t}\n\n\t// Gen locked info\n\tlocked := monofile.LockedRepo{\n\t\tRepo: monofile.Repo{\n\t\t\tURL: url,\n\t\t\tPath: subkey,\n\t\t\tRef: ref,\n\t\t},\n\t\tSHA: sha,\n\t}\n\n\t// Do checkout\n\tif err := r.checkoutsub(locked); err != nil {\n\t\treturn errors.Wrap(err, \"add/checkout\")\n\t}\n\n\t// Add to lockfile\n\terr = r.updateLockfile(locked.Repo, locked.SHA)\n\tif err != nil {\n\t\treturn err\n\t}\n\n\treturn nil\n}", "title": "" }, { "docid": "ad2659dbac025b447f7c6ad289c2d0c3", "score": "0.6478491", "text": "func (s *Store) Add(key string, val interface{}) error {\n\terr := make(chan error)\n\tgo func() {\n\t\ts.ops <- func(data map[string]interface{}) {\n\t\t\tdefer close(err)\n\t\t\tif _, ok := data[key]; ok {\n\t\t\t\terr <- fmt.Errorf(\"key %s already exists\", key)\n\t\t\t\treturn\n\t\t\t}\n\n\t\t\tdata[key] = val\n\t\t\terr <- nil\n\t\t}\n\t}()\n\treturn <-err\n}", "title": "" }, { "docid": "ae1b1e1841ce1c705dc77ae8ed0847bc", "score": "0.6473724", "text": "func (pc *policyCache) Add(policy *kyverno.ClusterPolicy) {\n\tpc.pMap.add(policy)\n\tpc.Logger.V(4).Info(\"policy is added to cache\", \"name\", policy.GetName())\n}", "title": "" }, { "docid": "69a66232a218f8404d1e0d6455dee594", "score": "0.6472082", "text": "func (c *Cache) Put(key int, value int) {\n\t// Check for existing item\n\tif ent, ok := c.items[key]; ok {\n\t\tc.evictList.MoveToFront(ent)\n\t\tent.Value.(*entry).value = value\n\t\treturn\n\t}\n\n\t// Add new item\n\tent := &entry{key, value}\n\tentry := c.evictList.PushFront(ent)\n\tc.items[key] = entry\n\n\tevict := c.evictList.Len() > c.size\n\t// Verify size not exceeded\n\tif evict {\n\t\tent := c.evictList.Back()\n\t\tif ent != nil {\n\t\t\tc.removeElement(ent)\n\t\t}\n\t}\n}", "title": "" }, { "docid": "ef906aa8afbc9377fe700480039dac5e", "score": "0.64557594", "text": "func (d *Dao) AddUserPackCache(c context.Context, id int64, u *unicom.UserPack) (err error) {\n\tvar (\n\t\tkey = keyUserPack(id)\n\t\tconn = d.mc.Get(c)\n\t)\n\tif err = conn.Set(&memcache.Item{Key: key, Object: u, Flags: memcache.FlagJSON, Expiration: d.flowKeyExpired}); err != nil {\n\t\tlog.Error(\"AddUserPackCache d.mc.Set(%s,%v) error(%v)\", key, u, err)\n\t}\n\tconn.Close()\n\treturn\n}", "title": "" }, { "docid": "7d5f42edd19894e309f62510064567a0", "score": "0.64405537", "text": "func (d *Dao) AddCDCache(ctx context.Context, app, mid int64) (err error) {\n\tvar (\n\t\tconn = d.mc.Get(ctx)\n\t\tkey = cdKey(app, mid)\n\t\titem = &memcache.Item{Key: key, Value: []byte{}, Expiration: d.mcCDExpire}\n\t)\n\tdefer conn.Close()\n\tif err = conn.Set(item); err != nil {\n\t\tPromError(\"mc:add cd\")\n\t\tlog.Error(\"AddCDCache() conn.Set(%+v) error(%v)\", item, err)\n\t}\n\treturn\n}", "title": "" }, { "docid": "3da9ba369f871e71d9420ee4b862d7c0", "score": "0.6440191", "text": "func (s *SwitchPool) Add(sw *Switch) {\n\ts.cache.Add(sw.ID, sw, s.ttl)\n}", "title": "" }, { "docid": "c439740f1b4aa72c594eb30d0135a5b0", "score": "0.64060116", "text": "func (c *Cache) Put(id models.Id, item models.Item, expire bool) {\n\tvar timeout time.Duration\n\tif expire {\n\t\ttimeout = config.CacheTimeout\n\t} else {\n\t\ttimeout = cache.NoExpiration\n\t}\n\tc.cache.Set(string(id), item, timeout)\n}", "title": "" }, { "docid": "e8356b5f6792ea7a41e701c17bf6d4b2", "score": "0.63982", "text": "func (bc *MemoryCache) Put(name string, value interface{}) error {\n\tbc.Lock()\n\tdefer bc.Unlock()\n\tbc.items[name] = &MemoryItem{\n\t\tval: value,\n\t\tcreatedTime: time.Now(),\n\t}\n\treturn nil\n}", "title": "" }, { "docid": "227c720f447545ff736cf401ca53fbc9", "score": "0.6397755", "text": "func (d *Dao) AddCacheHotspot(c context.Context, id int64, val *model.Hotspot) (err error) {\n\tif val == nil {\n\t\treturn\n\t}\n\tconn := d.mc.Get(c)\n\tdefer conn.Close()\n\tkey := mcHotspotKey(id)\n\titem := &memcache.Item{Key: key, Object: val, Expiration: d.mcHotspotExpire, Flags: memcache.FlagJSON}\n\tif err = conn.Set(item); err != nil {\n\t\tprom.BusinessErrCount.Incr(\"mc:AddCacheHotspot\")\n\t\tlog.Errorv(c, log.KV(\"AddCacheHotspot\", fmt.Sprintf(\"%+v\", err)), log.KV(\"key\", key))\n\t\treturn\n\t}\n\treturn\n}", "title": "" }, { "docid": "d94e57cddeec2f348c3e482afee83a3e", "score": "0.6390908", "text": "func (d *Dao) AddCacheTimemachine(c context.Context, id int64, val *timemachine.Item) (err error) {\n\tif val == nil {\n\t\treturn\n\t}\n\tconn := d.mc.Get(c)\n\tdefer conn.Close()\n\tkey := timemachineKey(id)\n\titem := &memcache.Item{Key: key, Object: val, Expiration: d.mcTmExpire, Flags: memcache.FlagProtobuf}\n\tif err = conn.Set(item); err != nil {\n\t\tprom.BusinessErrCount.Incr(\"mc:AddCacheTimemachine\")\n\t\tlog.Errorv(c, log.KV(\"AddCacheTimemachine\", fmt.Sprintf(\"%+v\", err)), log.KV(\"key\", key))\n\t\treturn\n\t}\n\treturn\n}", "title": "" }, { "docid": "9b76ce3eaa2c23da0074a9b6dae20fa8", "score": "0.63371307", "text": "func (c *Cache) Set(key uint64, value interface{}, ttl time.Duration) {\n\tcacheItem := item{\n\t\tdeadline: time.Now().UnixNano() + int64(ttl),\n\t\tvalue: value,\n\t}\n\n\tc.mu.Lock()\n\tc.items[key] = cacheItem\n\tc.mu.Unlock()\n}", "title": "" } ]
bffc943847fc249aae74643163c58956
List is a testspy implementation of Instances.List. It adds an entry "list" into the internal method call record.
[ { "docid": "91e03eb40127e6872d235a45c6bc0c94", "score": "0.0", "text": "func (f *MatchboxCloud) ListInstances(clusterName string, network *cluster.Network, selector map[string]string) ([]string, []*cluster.InstanceStatus, error) {\n\tf.addCall(\"list\")\n\tresult := make([]string, 0)\n\tinstances := make([]*cluster.InstanceStatus, 0)\n\tfor k, v := range f.FakeInstances {\n\t\tresult = append(result, k)\n\t\tinstances = append(instances, v.status)\n\t}\n\treturn result, instances, f.Err\n}", "title": "" } ]
[ { "docid": "390af1bb6966cb185be1dacc8dd724cc", "score": "0.7117941", "text": "func (m *Mock) List() {\n\tm.RLock()\n\tdefer m.RUnlock()\n\n\tgolog.Infof(\"Mocks list: \")\n\tfor x := range m.Items {\n\t\tgolog.Infof(\"\\t - %s %s %s\", x.Method, x.URL.String(), x.URL.Query().Encode())\n\t}\n}", "title": "" }, { "docid": "d100aa4e2a3ae6f3f0f81a9982f9d01a", "score": "0.6938703", "text": "func (f *FFXInstance) List(ctx context.Context, args ...string) error {\n\treturn f.Run(ctx, append([]string{\"target\", \"list\"}, args...)...)\n}", "title": "" }, { "docid": "d95c816eabbaa31f5884f0c00346eefd", "score": "0.6914768", "text": "func List(v interface{}) gr.Modifier {\n\treturn gr.Prop(\"list\", v)\n}", "title": "" }, { "docid": "394991f4cb68c43163694eff849f20b1", "score": "0.675191", "text": "func (k *K8Client) List(ctx context.Context, list runtime.Object, opts ...client.ListOption) error {\n\targs := k.Mock.Called(ctx, list, opts)\n\treturn args.Error(0)\n}", "title": "" }, { "docid": "6f3559ef588bc03c4b2176d919616402", "score": "0.67061543", "text": "func List() []Info { return singleton.List() }", "title": "" }, { "docid": "ff532f2cc7f9dfd52ba164c76028533a", "score": "0.66057336", "text": "func (b *ListBuilder[T]) List() *List[T] {\n\tassert(b.list != nil, \"immutable.ListBuilder.List(): duplicate call to fetch list\")\n\tlist := b.list\n\tb.list = nil\n\treturn list\n}", "title": "" }, { "docid": "43adb1409565937e63b42386fb5a30e6", "score": "0.652384", "text": "func (e *element) List() *list {\n\treturn e.list\n}", "title": "" }, { "docid": "d3845dc6afd337dca5454adc68cc3f28", "score": "0.6519564", "text": "func (mr *MockClientAPIMockRecorder) List(arg0 interface{}) *gomock.Call {\n\tmr.mock.ctrl.T.Helper()\n\treturn mr.mock.ctrl.RecordCallWithMethodType(mr.mock, \"List\", reflect.TypeOf((*MockClientAPI)(nil).List), arg0)\n}", "title": "" }, { "docid": "72bb620ee6bebb84cd698331643bbb2d", "score": "0.65104485", "text": "func (b *ListBuilder) List() *List {\n\tlist := b.list\n\tb.mutable = false\n\treturn list\n}", "title": "" }, { "docid": "26afa5a5a362f9286c76d3c61ca68880", "score": "0.65069014", "text": "func List(ctx context.Context, p Parent) (map[string]Entry, error) {\n\tsubmitMethodInvocation(ctx, p, \"List\")\n\treturn CachedList(ctx, p)\n}", "title": "" }, { "docid": "e05015ec5d4d9f773a80ad5c4047d3ac", "score": "0.6495239", "text": "func (mr *MockVirtualMachineScaleSetsClientMockRecorder) List(arg0, arg1 interface{}) *gomock.Call {\n\tmr.mock.ctrl.T.Helper()\n\treturn mr.mock.ctrl.RecordCallWithMethodType(mr.mock, \"List\", reflect.TypeOf((*MockVirtualMachineScaleSetsClient)(nil).List), arg0, arg1)\n}", "title": "" }, { "docid": "fafc126fad54b1ee6067414625c3f681", "score": "0.6494011", "text": "func (mr *FakeListerMockRecorder) List(arg0 ...interface{}) *gomock.Call {\n\tmr.mock.ctrl.T.Helper()\n\treturn mr.mock.ctrl.RecordCallWithMethodType(mr.mock, \"List\", reflect.TypeOf((*FakeLister)(nil).List), arg0...)\n}", "title": "" }, { "docid": "0714167a1a3a49b9c95aa762a21ce1e6", "score": "0.64735246", "text": "func NewList() List {\n\tlink := List{}\n\treturn link\n}", "title": "" }, { "docid": "e600bf80f9337626467688f4cbb274d4", "score": "0.64690226", "text": "func (mr *FakeVirtualServiceInterfaceMockRecorder) List(arg0 interface{}) *gomock.Call {\n\tmr.mock.ctrl.T.Helper()\n\treturn mr.mock.ctrl.RecordCallWithMethodType(mr.mock, \"List\", reflect.TypeOf((*FakeVirtualServiceInterface)(nil).List), arg0)\n}", "title": "" }, { "docid": "c94f07efa3d45dd6bf69f6a5cecd0790", "score": "0.6463228", "text": "func (p *Proxy) List(req ResourceRequest, pred *store.SelectionPredicate) (WrapList, error) {\n\tp.mu.RLock()\n\tdefer p.mu.RUnlock()\n\treturn p.impl.List(req, pred)\n}", "title": "" }, { "docid": "8c60e4cd32f30009c24a03d9e44aa203", "score": "0.64585155", "text": "func (m *MockStore) List(v0 context.Context, v1 store.ListOpts) ([]shared.Policy, error) {\n\tr0, r1 := m.ListFunc.nextHook()(v0, v1)\n\tm.ListFunc.appendCall(StoreListFuncCall{v0, v1, r0, r1})\n\treturn r0, r1\n}", "title": "" }, { "docid": "eac799626af14bdf5c8aeb70f2fbe77b", "score": "0.6443786", "text": "func (i *instrumentedListerWatcher) List(options metav1.ListOptions) (runtime.Object, error) {\n\ti.listTotal.Inc()\n\tret, err := i.next.List(options)\n\tif err != nil {\n\t\ti.listFailed.Inc()\n\t}\n\treturn ret, err\n}", "title": "" }, { "docid": "9f97ba218affe0440cc35f456d918984", "score": "0.6425997", "text": "func (mr *MockPrivateLinkServicesClientMockRecorder) List(arg0, arg1 interface{}) *gomock.Call {\n\tmr.mock.ctrl.T.Helper()\n\treturn mr.mock.ctrl.RecordCallWithMethodType(mr.mock, \"List\", reflect.TypeOf((*MockPrivateLinkServicesClient)(nil).List), arg0, arg1)\n}", "title": "" }, { "docid": "00582a0036412e65ee7a5d5e38dce504", "score": "0.641579", "text": "func (mr *MockUsageClientMockRecorder) List(arg0, arg1 interface{}) *gomock.Call {\n\tmr.mock.ctrl.T.Helper()\n\treturn mr.mock.ctrl.RecordCallWithMethodType(mr.mock, \"List\", reflect.TypeOf((*MockUsageClient)(nil).List), arg0, arg1)\n}", "title": "" }, { "docid": "00582a0036412e65ee7a5d5e38dce504", "score": "0.641579", "text": "func (mr *MockUsageClientMockRecorder) List(arg0, arg1 interface{}) *gomock.Call {\n\tmr.mock.ctrl.T.Helper()\n\treturn mr.mock.ctrl.RecordCallWithMethodType(mr.mock, \"List\", reflect.TypeOf((*MockUsageClient)(nil).List), arg0, arg1)\n}", "title": "" }, { "docid": "1f964c9acc1a7c76306c3e7d621d1ddf", "score": "0.6387401", "text": "func (mr *MockDisksClientAPIMockRecorder) List(arg0 interface{}) *gomock.Call {\n\tmr.mock.ctrl.T.Helper()\n\treturn mr.mock.ctrl.RecordCallWithMethodType(mr.mock, \"List\", reflect.TypeOf((*MockDisksClientAPI)(nil).List), arg0)\n}", "title": "" }, { "docid": "1c7625662f5d4764e838db2a1360f5b4", "score": "0.6376542", "text": "func (mr *MockResourceSkusClientAPIMockRecorder) List(arg0, arg1 interface{}) *gomock.Call {\n\tmr.mock.ctrl.T.Helper()\n\treturn mr.mock.ctrl.RecordCallWithMethodType(mr.mock, \"List\", reflect.TypeOf((*MockResourceSkusClientAPI)(nil).List), arg0, arg1)\n}", "title": "" }, { "docid": "84333137cf1da8a5a2343d09bd3c9bd2", "score": "0.6375506", "text": "func (mr *MockSecurityGroupsClientMockRecorder) List(arg0, arg1 interface{}) *gomock.Call {\n\tmr.mock.ctrl.T.Helper()\n\treturn mr.mock.ctrl.RecordCallWithMethodType(mr.mock, \"List\", reflect.TypeOf((*MockSecurityGroupsClient)(nil).List), arg0, arg1)\n}", "title": "" }, { "docid": "6a50e7ba1150e6f0ea5d6c21ae04746d", "score": "0.6371136", "text": "func (mr *MockClientMockRecorder) List() *gomock.Call {\n\tmr.mock.ctrl.T.Helper()\n\treturn mr.mock.ctrl.RecordCallWithMethodType(mr.mock, \"List\", reflect.TypeOf((*MockClient)(nil).List))\n}", "title": "" }, { "docid": "c979dc9122507123fb1c4fcd635213be", "score": "0.6362362", "text": "func (c *Client) List(list crclient.ObjectList, opts ...ListOption) (err error) {\n\tdefer logBeginEnd(\"List\", list, &err)()\n\tctx, cancel := context.WithTimeout(c.ctx, c.timeout)\n\tdefer cancel()\n\treturn c.c.List(ctx, list, opts...)\n}", "title": "" }, { "docid": "d906403ea19b412d59dd926c96b36f9f", "score": "0.6356772", "text": "func (mr *MockVirtualMachineScaleSetVMsClientMockRecorder) List(arg0, arg1, arg2, arg3, arg4, arg5 interface{}) *gomock.Call {\n\tmr.mock.ctrl.T.Helper()\n\treturn mr.mock.ctrl.RecordCallWithMethodType(mr.mock, \"List\", reflect.TypeOf((*MockVirtualMachineScaleSetVMsClient)(nil).List), arg0, arg1, arg2, arg3, arg4, arg5)\n}", "title": "" }, { "docid": "a59e5ea351ba35623559a1287b21757b", "score": "0.63543606", "text": "func (s *NodeStore) List() []interface{} { return nil }", "title": "" }, { "docid": "9428f738cd53f5ed421ebf61acdd448f", "score": "0.63400394", "text": "func (mr *MockResourcesMockRecorder) List(set, list interface{}, opts ...interface{}) *gomock.Call {\n\tmr.mock.ctrl.T.Helper()\n\tvarargs := append([]interface{}{set, list}, opts...)\n\treturn mr.mock.ctrl.RecordCallWithMethodType(mr.mock, \"List\", reflect.TypeOf((*MockResources)(nil).List), varargs...)\n}", "title": "" }, { "docid": "7b801d5fc2def0f1c16c583bbabe76de", "score": "0.63283575", "text": "func (mr *MockNodeListerMockRecorder) List(arg0 interface{}) *gomock.Call {\n\tmr.mock.ctrl.T.Helper()\n\treturn mr.mock.ctrl.RecordCallWithMethodType(mr.mock, \"List\", reflect.TypeOf((*MockNodeLister)(nil).List), arg0)\n}", "title": "" }, { "docid": "0c1df9567206f94a313ceca8c2064437", "score": "0.6324994", "text": "func list(v ...interface{}) []interface{} {\n\treturn v\n}", "title": "" }, { "docid": "d2080e2f31f2203cb705e0ab8910be1e", "score": "0.63112986", "text": "func (mr *MockVirtualMachinesClientMockRecorder) List(arg0, arg1 interface{}) *gomock.Call {\n\tmr.mock.ctrl.T.Helper()\n\treturn mr.mock.ctrl.RecordCallWithMethodType(mr.mock, \"List\", reflect.TypeOf((*MockVirtualMachinesClient)(nil).List), arg0, arg1)\n}", "title": "" }, { "docid": "e9106f0935e507e6ae76621e97c0ed4c", "score": "0.6308405", "text": "func (mr *MockArticleClientMockRecorder) List(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, \"List\", reflect.TypeOf((*MockArticleClient)(nil).List), varargs...)\n}", "title": "" }, { "docid": "eb78d1ad6a7bbdf1858ab9df0cb884a5", "score": "0.62976205", "text": "func (mr *MockArticleServerMockRecorder) List(arg0, arg1 interface{}) *gomock.Call {\n\tmr.mock.ctrl.T.Helper()\n\treturn mr.mock.ctrl.RecordCallWithMethodType(mr.mock, \"List\", reflect.TypeOf((*MockArticleServer)(nil).List), arg0, arg1)\n}", "title": "" }, { "docid": "c5a04adddf8f2156f49a55055ffac2c7", "score": "0.6291833", "text": "func newList() *list { return new(list).Init() }", "title": "" }, { "docid": "01430c728e48c4fd496e5eebb1c96fbf", "score": "0.6279002", "text": "func (mr *MockClusterInterfaceMockRecorder) List(opts interface{}) *gomock.Call {\n\tmr.mock.ctrl.T.Helper()\n\treturn mr.mock.ctrl.RecordCallWithMethodType(mr.mock, \"List\", reflect.TypeOf((*MockClusterInterface)(nil).List), opts)\n}", "title": "" }, { "docid": "659650f8fcdaf7f8dcf93014569ca715", "score": "0.6275245", "text": "func NewList() *list {\n\treturn &list{}\n}", "title": "" }, { "docid": "71a6212f915b6ab727ff9a1612c6a24d", "score": "0.62715924", "text": "func (mr *MockResourceSkusClientMockRecorder) List(arg0, arg1 interface{}) *gomock.Call {\n\tmr.mock.ctrl.T.Helper()\n\treturn mr.mock.ctrl.RecordCallWithMethodType(mr.mock, \"List\", reflect.TypeOf((*MockResourceSkusClient)(nil).List), arg0, arg1)\n}", "title": "" }, { "docid": "7909f90e69025d7d2324b28e12354c7b", "score": "0.62227756", "text": "func (mr *MockPublicIPAddressesClientMockRecorder) List(arg0, arg1 interface{}) *gomock.Call {\n\tmr.mock.ctrl.T.Helper()\n\treturn mr.mock.ctrl.RecordCallWithMethodType(mr.mock, \"List\", reflect.TypeOf((*MockPublicIPAddressesClient)(nil).List), arg0, arg1)\n}", "title": "" }, { "docid": "dc3ebdea791459178dbf321e1264d96f", "score": "0.6219246", "text": "func New() *list.List", "title": "" }, { "docid": "005d7001d374df42b926afb9a66fae75", "score": "0.620899", "text": "func (mr *MockMeshPolicyClientMockRecorder) List(opts interface{}) *gomock.Call {\n\tmr.mock.ctrl.T.Helper()\n\treturn mr.mock.ctrl.RecordCallWithMethodType(mr.mock, \"List\", reflect.TypeOf((*MockMeshPolicyClient)(nil).List), opts)\n}", "title": "" }, { "docid": "3f2741e134728beae4a7a662c39ff231", "score": "0.6199984", "text": "func NewList(eng *engine.Engine) *List {\n\treturn &List{eng: eng}\n}", "title": "" }, { "docid": "663505c5c2924ffa6a838ef376bf0399", "score": "0.61989075", "text": "func List(z *html.Tokenizer, startToken html.Token) renderer.List {\n\treturn renderer.List{\n\t\tContent: parseEntries(z, startToken),\n\t}\n}", "title": "" }, { "docid": "7d67ffabcc61ca1649622afbecd399c3", "score": "0.6190863", "text": "func (mr *MockAgentInterfaceMockRecorder) List(opts interface{}) *gomock.Call {\n\tmr.mock.ctrl.T.Helper()\n\treturn mr.mock.ctrl.RecordCallWithMethodType(mr.mock, \"List\", reflect.TypeOf((*MockAgentInterface)(nil).List), opts)\n}", "title": "" }, { "docid": "b3e2b601a5e758821be22039d55f2b26", "score": "0.6177934", "text": "func (mr *MockNamespaceableResourceInterfaceMockRecorder) List(arg0, arg1 interface{}) *gomock.Call {\n\tmr.mock.ctrl.T.Helper()\n\treturn mr.mock.ctrl.RecordCallWithMethodType(mr.mock, \"List\", reflect.TypeOf((*MockNamespaceableResourceInterface)(nil).List), arg0, arg1)\n}", "title": "" }, { "docid": "d52a483e795d21481dececbcefdeed0f", "score": "0.6168226", "text": "func List(collection Getter) func(ctx context.Context) ([]interface{}, error) {\n\treturn func(ctx context.Context) ([]interface{}, error) {\n\t\ttestplans := []TestPlan{}\n\t\terr := collection.GetAll(ctx, &testplans)\n\t\tif err != nil {\n\t\t\treturn nil, err\n\t\t}\n\t\titems := make([]interface{}, len(testplans))\n\t\tfor i, v := range testplans {\n\t\t\titems[i] = v\n\t\t}\n\t\treturn items, nil\n\t}\n}", "title": "" }, { "docid": "2f7c7213d3ffd8293ce0698487542ee2", "score": "0.61643517", "text": "func InstanceList() []specs.State {\n\treturn nil\n}", "title": "" }, { "docid": "9cf22a64f8e39f7dee1251c4991e3b8b", "score": "0.61590457", "text": "func (mr *MockDomainsServiceMockRecorder) List() *gomock.Call {\n\tmr.mock.ctrl.T.Helper()\n\treturn mr.mock.ctrl.RecordCallWithMethodType(mr.mock, \"List\", reflect.TypeOf((*MockDomainsService)(nil).List))\n}", "title": "" }, { "docid": "d7e7124b4793639bb02c8fe4b9e4ab02", "score": "0.6156291", "text": "func (l ListerWatcherFunc) List(ctx context.Context) ([]string, error) {\n\tif l.WatchFunc == nil {\n\t\treturn nil, errors.New(\"list function can't be nil\")\n\t}\n\treturn l.ListFunc(ctx)\n}", "title": "" }, { "docid": "a491f85a2f1e3c5499239e73837d63c6", "score": "0.61508757", "text": "func (mr *MockFarmInterfaceMockRecorder) List(opts interface{}) *gomock.Call {\n\tmr.mock.ctrl.T.Helper()\n\treturn mr.mock.ctrl.RecordCallWithMethodType(mr.mock, \"List\", reflect.TypeOf((*MockFarmInterface)(nil).List), opts)\n}", "title": "" }, { "docid": "56adf1949980c11f509ffec7e8cc5dc7", "score": "0.61454207", "text": "func (mr *MockPetServiceMockRecorder) List() *gomock.Call {\n\tmr.mock.ctrl.T.Helper()\n\treturn mr.mock.ctrl.RecordCallWithMethodType(mr.mock, \"List\", reflect.TypeOf((*MockPetService)(nil).List))\n}", "title": "" }, { "docid": "a3b8eec175b7200a3e0a72c44c8e3d95", "score": "0.61430675", "text": "func (mr *MockServerInterfaceMockRecorder) List(opts interface{}) *gomock.Call {\n\tmr.mock.ctrl.T.Helper()\n\treturn mr.mock.ctrl.RecordCallWithMethodType(mr.mock, \"List\", reflect.TypeOf((*MockServerInterface)(nil).List), opts)\n}", "title": "" }, { "docid": "ddf316a18ff9a1e2893d2d563ebe9e18", "score": "0.6142824", "text": "func List(items ...interface{}) Values {\n\treturn Values{Items: items}\n}", "title": "" }, { "docid": "2a2b214e8b2e1530439ff128d814d271", "score": "0.6142114", "text": "func (s *Statement) List(items ...Code) *Statement {\n\tg := &Group{\n\t\tclose: \"\",\n\t\titems: items,\n\t\tmulti: false,\n\t\tname: \"list\",\n\t\topen: \"\",\n\t\tseparator: \",\",\n\t}\n\t*s = append(*s, g)\n\treturn s\n}", "title": "" }, { "docid": "611f3166b931289f3d56554f5e2d885d", "score": "0.61163765", "text": "func (f *Fixture) recordList() *[]Record {\n\trecords := make([]Record, 0, len(f.Records))\n\tfor _, r := range f.Records {\n\t\trecords = append(records, r)\n\t}\n\treturn &records\n}", "title": "" }, { "docid": "023d0fd7fb5da7bcb73bf0caf3828891", "score": "0.6112069", "text": "func (b *listBuilder) List() *CSPList {\n\treturn b.list\n}", "title": "" }, { "docid": "3f767f6ae01d6bff45bfe3503ae49ac0", "score": "0.6099627", "text": "func List(of Node) Node {\n\treturn listNode{Group{\"list\": Repeated(Group{\"element\": of})}}\n}", "title": "" }, { "docid": "6eec0fe9f82612fd19bf0b0f028dc1ca", "score": "0.6098248", "text": "func (c *testClient) List(p ListParameters) ([]storage.Release, error) {\n\t// Return with keys (release names) sorted alphabetically to have\n\t// a stable order.\n\tvar keys []string\n\tfor k := range c.releases {\n\t\tkeys = append(keys, k)\n\t}\n\tsort.Strings(keys)\n\tvar releases []storage.Release\n\tfor _, k := range keys {\n\t\treleases = append(releases, c.releases[k])\n\t}\n\treturn releases, nil\n}", "title": "" }, { "docid": "393736a4ab0ab6d145b2f920662ea5c9", "score": "0.60918885", "text": "func (o SparseEnforcerRefreshsList) List() elemental.IdentifiablesList {\n\n\tout := make(elemental.IdentifiablesList, len(o))\n\tfor i := 0; i < len(o); i++ {\n\t\tout[i] = o[i]\n\t}\n\n\treturn out\n}", "title": "" }, { "docid": "9ce856ef8fdea2cb5a3cd53039f5daba", "score": "0.6088157", "text": "func initializeList() {\n\tlist = []Todo{}\n}", "title": "" }, { "docid": "fcd76c3613aa48253bbdd8c8ac722ce9", "score": "0.6082123", "text": "func (mr *MockManagerMockRecorder) List() *gomock.Call {\n\tmr.mock.ctrl.T.Helper()\n\treturn mr.mock.ctrl.RecordCallWithMethodType(mr.mock, \"List\", reflect.TypeOf((*MockManager)(nil).List))\n}", "title": "" }, { "docid": "82e2a5e86e1165d9bdfc742f04ae35c2", "score": "0.6078885", "text": "func (mr *MockClientMockRecorder) List(ctx, opts interface{}) *gomock.Call {\n\tmr.mock.ctrl.T.Helper()\n\treturn mr.mock.ctrl.RecordCallWithMethodType(mr.mock, \"List\", reflect.TypeOf((*MockClient)(nil).List), ctx, opts)\n}", "title": "" }, { "docid": "380061964dd25d6e2887588fe6520743", "score": "0.6076475", "text": "func (srv *testCheckindServer) List(\n\tctx context.Context, networkId *protos.NetworkID) (*protos.IDList, error) {\n\n\tsrv.lastClientIdentity =\n\t\tproto.Clone(protos.GetClientIdentity(ctx)).(*protos.Identity)\n\treturn new(protos.IDList), nil\n}", "title": "" }, { "docid": "8b678334e7d6775f86abec0fb510afcf", "score": "0.607475", "text": "func (ftp *FakeThingProxy) List(authorization string) ([]*entities.Thing, error) {\n\targs := ftp.Called(authorization)\n\treturn args.Get(0).([]*entities.Thing), args.Error(1)\n}", "title": "" }, { "docid": "72ae12a51dd870ad4e4368953a15d17b", "score": "0.60646594", "text": "func (mr *MockReaderMockRecorder) List() *gomock.Call {\n\tmr.mock.ctrl.T.Helper()\n\treturn mr.mock.ctrl.RecordCallWithMethodType(mr.mock, \"List\", reflect.TypeOf((*MockReader)(nil).List))\n}", "title": "" }, { "docid": "dc5735a5a27dea5815c820ab2d5cd01c", "score": "0.60565877", "text": "func (mr *KetchupStoreMockRecorder) List(ctx, page, last interface{}) *gomock.Call {\n\tmr.mock.ctrl.T.Helper()\n\treturn mr.mock.ctrl.RecordCallWithMethodType(mr.mock, \"List\", reflect.TypeOf((*KetchupStore)(nil).List), ctx, page, last)\n}", "title": "" }, { "docid": "86115c9c29e5ce27684ea4c01f78c498", "score": "0.60542834", "text": "func (m *FakeLister) List(arg0 ...kf.ListOption) ([]v1alpha1.Service, error) {\n\tm.ctrl.T.Helper()\n\tvarargs := []interface{}{}\n\tfor _, a := range arg0 {\n\t\tvarargs = append(varargs, a)\n\t}\n\tret := m.ctrl.Call(m, \"List\", varargs...)\n\tret0, _ := ret[0].([]v1alpha1.Service)\n\tret1, _ := ret[1].(error)\n\treturn ret0, ret1\n}", "title": "" }, { "docid": "b45457cd759472b19ec2977d5b4d24ed", "score": "0.6052451", "text": "func (e *Tags) List(ctx context.Context, req *tags.ListRequest, rsp *tags.ListResponse) error {\n\n\treturn nil\n}", "title": "" }, { "docid": "c41c63ebb328ebc161a7a0fb2ff82545", "score": "0.60423553", "text": "func NewList(t Type) Type {\n\treturn &List{\n\t\tName: \"List\",\n\t\tDescription: \"Built-in 'List' type\",\n\t\tWrapped: t,\n\t}\n}", "title": "" }, { "docid": "e7331e9c4f97c435f9519f47dae1bbfa", "score": "0.60400224", "text": "func (mr *MockInvoicesServiceMockRecorder) List() *gomock.Call {\n\tmr.mock.ctrl.T.Helper()\n\treturn mr.mock.ctrl.RecordCallWithMethodType(mr.mock, \"List\", reflect.TypeOf((*MockInvoicesService)(nil).List))\n}", "title": "" }, { "docid": "439a3489b058fb4e12ea18822bf5ca31", "score": "0.6033409", "text": "func (client *Client) List(g Listable) ([]interface{}, error) {\n\tctx, cancel := context.WithTimeout(context.Background(), client.Timeout)\n\tdefer cancel()\n\n\treturn client.ListWithContext(ctx, g)\n}", "title": "" }, { "docid": "37e160de2df56dad1f823f683c6b1474", "score": "0.60303587", "text": "func (mock *CrontabParserMock) ListCalls() []struct {\n} {\n\tvar calls []struct {\n\t}\n\tmock.lockList.RLock()\n\tcalls = mock.calls.List\n\tmock.lockList.RUnlock()\n\treturn calls\n}", "title": "" }, { "docid": "518cf65069170ba2bbc2a487d19c07e2", "score": "0.60299987", "text": "func List(\n\titem ItemS,\n\tvalues ...interface{},\n) VarS {\n\treturn VarS{item, values}\n}", "title": "" }, { "docid": "d963ac181624e116b915f90eca1123a3", "score": "0.602796", "text": "func (m *Mock) List() []string {\n\tvar events []string\n\n\tfor _, event := range m.events {\n\t\tevents = append(events, event.Message)\n\t}\n\n\treturn events\n}", "title": "" }, { "docid": "e5cf3152d54ed7fe9f85b1af3031b296", "score": "0.6024076", "text": "func (g *Group) List(items ...Code) *Statement {\n\ts := List(items...)\n\tg.items = append(g.items, s)\n\treturn s\n}", "title": "" }, { "docid": "6b3d72cbc65bc92e4ecab1ae81977c1b", "score": "0.59918743", "text": "func (m *KetchupStore) List(ctx context.Context, page uint, last string) ([]model0.Ketchup, uint64, error) {\n\tm.ctrl.T.Helper()\n\tret := m.ctrl.Call(m, \"List\", ctx, page, last)\n\tret0, _ := ret[0].([]model0.Ketchup)\n\tret1, _ := ret[1].(uint64)\n\tret2, _ := ret[2].(error)\n\treturn ret0, ret1, ret2\n}", "title": "" }, { "docid": "9d8912a205a8adc81f700cd22a02b5b5", "score": "0.59895647", "text": "func (mr *RepositoryServiceMockRecorder) List(arg0, arg1, arg2 interface{}) *gomock.Call {\n\tmr.mock.ctrl.T.Helper()\n\treturn mr.mock.ctrl.RecordCallWithMethodType(mr.mock, \"List\", reflect.TypeOf((*RepositoryService)(nil).List), arg0, arg1, arg2)\n}", "title": "" }, { "docid": "e48d747d8efd1606c08f5f6f2a127ded", "score": "0.59817207", "text": "func (mr *MockMockResourceClientMockRecorder) List(namespace, opts interface{}) *gomock.Call {\n\tmr.mock.ctrl.T.Helper()\n\treturn mr.mock.ctrl.RecordCallWithMethodType(mr.mock, \"List\", reflect.TypeOf((*MockMockResourceClient)(nil).List), namespace, opts)\n}", "title": "" }, { "docid": "d1572a4bef195adb73b3ff96258e5701", "score": "0.5979549", "text": "func (mr *MockSizesServiceMockRecorder) List() *gomock.Call {\n\tmr.mock.ctrl.T.Helper()\n\treturn mr.mock.ctrl.RecordCallWithMethodType(mr.mock, \"List\", reflect.TypeOf((*MockSizesService)(nil).List))\n}", "title": "" }, { "docid": "e0aba2bd7a87b9b3f82438e60dfd6a05", "score": "0.59758747", "text": "func (r ResourceEventHandlerFuncs) OnList(obj []interface{}) {\n\tif r.ListFunc != nil {\n\t\tr.ListFunc(obj)\n\t}\n}", "title": "" }, { "docid": "2f3c7afc5bf188dd1eedaba28e28cb0d", "score": "0.5974976", "text": "func List(client *golangsdk.ServiceClient) (r ListResult) {\n\t_, r.Err = client.Get(listURL(client), &r.Body, openstack.StdRequestOpts())\n\treturn\n}", "title": "" }, { "docid": "a410b570262a0bd907d5febd9d4a2b6b", "score": "0.59720486", "text": "func (r *RetryClient) List(ctx context.Context, list runtime.Object, opts ...client.ListOption) error {\n\treturn Retry(ctx, func(ctx context.Context) error {\n\t\treturn r.Client.List(ctx, list, opts...)\n\t}, IsJSONSyntaxError)\n}", "title": "" }, { "docid": "4eb8e55efe0263dcd7f638e8a1d8017c", "score": "0.5963309", "text": "func makeList(args ...interface{}) []interface{} {\n\treturn args\n}", "title": "" }, { "docid": "1cde6d5a104c388e038e36b445e0db0e", "score": "0.5961018", "text": "func (s *APIService) List() (*APIs, *http.Response, error) {\n\tapis := new(APIs)\n\tresp, err := s.sling.New().ReceiveSuccess(apis)\n\treturn apis, resp, err\n}", "title": "" }, { "docid": "685d71fb78a6f41feeb103eb74918296", "score": "0.59483194", "text": "func NewList(h ...Hitter) List {\n\treturn List{HH: h}\n}", "title": "" }, { "docid": "4c96aa18d23d2124fd9db7393398f05e", "score": "0.5948212", "text": "func (ner *NamespacedEndpointSliceReflector) List() ([]interface{}, error) {\n\tlistEps, err := virtualkubelet.List[virtualkubelet.Lister[*discoveryv1.EndpointSlice], *discoveryv1.EndpointSlice](\n\t\tner.localEndpointSlices,\n\t)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\tlistSeps, err := virtualkubelet.List[virtualkubelet.Lister[*vkv1alpha1.ShadowEndpointSlice], *vkv1alpha1.ShadowEndpointSlice](\n\t\tner.remoteShadowEndpointSlices,\n\t)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\treturn append(listEps, listSeps...), nil\n}", "title": "" }, { "docid": "d520d7979c2599c4a288d8817737b1a0", "score": "0.594621", "text": "func MakeList() *List {\n\treturn &List{}\n}", "title": "" }, { "docid": "456fcdbcd47584f87986074f9d27c77d", "score": "0.5942899", "text": "func (mr *MockHTTPRouteGroupClientMockRecorder) List(namespace, opts interface{}) *gomock.Call {\n\tmr.mock.ctrl.T.Helper()\n\treturn mr.mock.ctrl.RecordCallWithMethodType(mr.mock, \"List\", reflect.TypeOf((*MockHTTPRouteGroupClient)(nil).List), namespace, opts)\n}", "title": "" }, { "docid": "3bc58d61dca674045c97896c28cc6462", "score": "0.5939355", "text": "func NewList() List {\n\tlist := List{}\n\tlist.Tasks = []Task{}\n\treturn list\n}", "title": "" }, { "docid": "85d595b25de466ad234fb24b22fe6137", "score": "0.5935092", "text": "func (mr *KetchupServiceMockRecorder) List(ctx, pageSize, last interface{}) *gomock.Call {\n\tmr.mock.ctrl.T.Helper()\n\treturn mr.mock.ctrl.RecordCallWithMethodType(mr.mock, \"List\", reflect.TypeOf((*KetchupService)(nil).List), ctx, pageSize, last)\n}", "title": "" }, { "docid": "040db5eb3c476ec784e998cbadeb879e", "score": "0.5933915", "text": "func (o EnforcerRefreshsList) List() elemental.IdentifiablesList {\n\n\tout := make(elemental.IdentifiablesList, len(o))\n\tfor i := 0; i < len(o); i++ {\n\t\tout[i] = o[i]\n\t}\n\n\treturn out\n}", "title": "" }, { "docid": "254bde7b17d3f60e049fcae895f467ea", "score": "0.5930642", "text": "func initList(start *State) *StateList {\n\tlist := make(StateList, 0, 1)\n\t// fmt.Printf(\"initList: list = %v; start = %v\\n\", list, start)\n\tlistId++\n\tlist.addState(start)\n\t//fmt.Printf(\"initList, addState: list = %v\\n\", list)\n\treturn &list\n}", "title": "" }, { "docid": "c9900b3eafa0b26ed5eee64b68e75920", "score": "0.59201944", "text": "func (v *OVirtCloud) List(filter string) ([]string, error) {\n\tinstances, err := v.fetchAllInstances()\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\treturn instances.ListSortedNames(), nil\n}", "title": "" }, { "docid": "b0b13cb6200796bea2295223280d40c2", "score": "0.5908019", "text": "func (mock *InterfaceMock) ListCalls() []struct {\n} {\n\tvar calls []struct {\n\t}\n\tlockInterfaceMockList.RLock()\n\tcalls = mock.calls.List\n\tlockInterfaceMockList.RUnlock()\n\treturn calls\n}", "title": "" }, { "docid": "595850900f57b1d8b9a3983d27e02fea", "score": "0.59061444", "text": "func List() []Command {\n\treturn list\n}", "title": "" }, { "docid": "c75fc07d765f617b35ad522762fa7afe", "score": "0.59016937", "text": "func New() *List { return new(List).Init() }", "title": "" }, { "docid": "c75fc07d765f617b35ad522762fa7afe", "score": "0.59016937", "text": "func New() *List { return new(List).Init() }", "title": "" }, { "docid": "088786a8340c291bc1c3a2640a129c9b", "score": "0.58951813", "text": "func List(params *stripe.SKUListParams) *Iter {\n\treturn getC().List(params)\n}", "title": "" }, { "docid": "80e4f6833e131b921fd91324660f7e73", "score": "0.5894268", "text": "func (b *ListBuilder) List() *UpgradeResultList {\n\treturn b.list\n}", "title": "" }, { "docid": "f3e40a808519b7fda87c4e91f9cc3605", "score": "0.58911353", "text": "func (a Actions) List(fields ...string) ([]Test, error) {\n\tif len(fields) == 0 {\n\t\tfields = TestFields[:]\n\t}\n\tresp, err := a.down.ListActions(listMask(a.ctx, fields...), &resultstore.ListActionsRequest{\n\t\tParent: a.configuredTarget,\n\t})\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\tvar ret []Test\n\tfor _, r := range resp.Actions {\n\t\tret = append(ret, fromTest(r))\n\t}\n\treturn ret, nil\n}", "title": "" }, { "docid": "54c39810bf338cffcf85e92173e65d80", "score": "0.5880349", "text": "func (f FakeServiceLister) List(opts v1.ListOptions) (*v1.ServiceList, error) {\n\treturn f.SvcList, f.Err\n}", "title": "" }, { "docid": "04233ed417da6a3acca08ccd7e5865a4", "score": "0.58783925", "text": "func (cust Customers) List(params ...ListParams) ([]Customer, error) {\n\treturn nil, nil\n}", "title": "" } ]
1ea7ddb47ea7914fb967dfd9988c0224
Validate inspects the fields of the type to determine if they are valid.
[ { "docid": "f49a837715527b5d4a36c96808f6f3ea", "score": "0.0", "text": "func (s *ResourceCollection) Validate() error {\n\tinvalidParams := request.ErrInvalidParams{Context: \"ResourceCollection\"}\n\tif s.Tags != nil {\n\t\tfor i, v := range s.Tags {\n\t\t\tif v == nil {\n\t\t\t\tcontinue\n\t\t\t}\n\t\t\tif err := v.Validate(); err != nil {\n\t\t\t\tinvalidParams.AddNested(fmt.Sprintf(\"%s[%v]\", \"Tags\", i), err.(request.ErrInvalidParams))\n\t\t\t}\n\t\t}\n\t}\n\n\tif invalidParams.Len() > 0 {\n\t\treturn invalidParams\n\t}\n\treturn nil\n}", "title": "" } ]
[ { "docid": "d9761ce53dc9f5c62af476f4f16c479a", "score": "0.6572075", "text": "func (gr *Generate) Validate() error {\n\tif len(gr.Type) == 0 {\n\t\treturn errors.New(\"type field is required\")\n\t}\n\tif gr.Length == 0 {\n\t\treturn errors.New(\"length field should be not zero\")\n\t}\n\n\treturn nil\n}", "title": "" }, { "docid": "452033918ac0fdae0327976955e2f389", "score": "0.6410849", "text": "func isValidFields(fields map[string]string) error {\n\tif len(fields) == 0 {\n\t\treturn errors.New(\"fields cannot be empty\")\n\t}\n\tfor fieldName, fieldType := range fields {\n\t\tif ok := isAllowedFieldType(fieldType); !ok {\n\t\t\treturn errors.New(fmt.Sprintf(\"unknown field type '%v' in '%v'\", fieldType, fieldName))\n\t\t}\n\t}\n\n\treturn nil\n}", "title": "" }, { "docid": "f596dfdd653ed45580ef2926bf3d9edb", "score": "0.6272651", "text": "func (s *Struct) Validate() (err error) {\n\terrPrefix := \"failed to validate struct \" + s.Name + \": \"\n\n\tif err = ValidateName(s.Name, \"struct name\"); err != nil {\n\t\treturn errors.New(errPrefix + err.Error())\n\t}\n\n\tfor _, v := range s.Fields {\n\t\tif err = v.Validate(); err != nil {\n\t\t\treturn errors.New(errPrefix + err.Error())\n\t\t}\n\t}\n\treturn\n}", "title": "" }, { "docid": "54ee83a5f74bd991bd754a054bc0d53a", "score": "0.618077", "text": "func (expr *Expression) Validate(types FieldTypeMap) error {\n\t_, err := validateTypes(expr.ast, types)\n\treturn err\n}", "title": "" }, { "docid": "f875a2db7c03eb623006c26837045c1a", "score": "0.6166287", "text": "func (expr *Expression) Validate(types FieldTypeMap) error {\n\t_, err := validateTypes(expr.tree, types)\n\treturn err\n}", "title": "" }, { "docid": "57be5772758b05cff7da80c326ce248c", "score": "0.6148266", "text": "func ValidateFields(fields []*FieldData) error {\n\terrors := make(map[string]string)\n\tfor _, field := range fields {\n\t\tif field.Type == \"string\" {\n\t\t\tvalAsString, ok := field.Value.(string)\n\t\t\tif !ok {\n\t\t\t\terrors[field.Name] = microappError.ErrorCodeStringExpected\n\t\t\t} else if field.Required && strings.TrimSpace(valAsString) == \"\" {\n\t\t\t\terrors[field.Name] = microappError.ErrorCodeRequired\n\t\t\t} else if strings.TrimSpace(valAsString) != \"\" && len(field.Constraints) > 0 {\n\t\t\t\tfor _, constraint := range field.Constraints {\n\t\t\t\t\tok, _ = ValidateString(valAsString, constraint.Type, constraint.ConstraintData)\n\t\t\t\t\tif !ok {\n\t\t\t\t\t\terrors[field.Name] = microappError.ErrorCodeInvalidValue\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\tif len(errors) > 0 {\n\t\treturn microappError.NewInvalidFieldsError(errors)\n\t}\n\treturn nil\n}", "title": "" }, { "docid": "b17d3039b96b96131d9cd873ce810101", "score": "0.6125354", "text": "func validateFields(req *logical.Request, data *framework.FieldData) error {\n\tvar unknownFields []string\n\tfor k := range req.Data {\n\t\tif _, ok := data.Schema[k]; !ok {\n\t\t\tunknownFields = append(unknownFields, k)\n\t\t}\n\t}\n\n\tif len(unknownFields) > 0 {\n\t\t// Sort since this is a human error\n\t\tsort.Strings(unknownFields)\n\n\t\treturn fmt.Errorf(\"unknown fields: %q\", unknownFields)\n\t}\n\n\treturn nil\n}", "title": "" }, { "docid": "2f2e78791af04feeecd725f7416c6e23", "score": "0.61246985", "text": "func (field *ModelField) Validate() error {\n\t// length\n\tif tuple, ok := field.ValidateTags[\"len\"]; ok {\n\t\ts, ok := field.String()\n\t\tif ok {\n\t\t\tif err := validateLen(s, tuple, field.Name); err != nil {\n\t\t\t\treturn err\n\t\t\t}\n\t\t}\n\t}\n\t// range\n\tif tuple, ok := field.ValidateTags[\"range\"]; ok {\n\t\ti, ok := field.Int()\n\t\tif ok {\n\t\t\tif err := validateRange(i, tuple, field.Name); err != nil {\n\t\t\t\treturn err\n\t\t\t}\n\t\t}\n\t}\n\t// presence\n\tif _, ok := field.ValidateTags[\"presence\"]; ok {\n\t\tif field.Zero() {\n\t\t\treturn NewValidationError(ValidationErrorValueNotSet, field.Name)\n\t\t}\n\t}\n\n\t// regexp\n\tif reg, ok := field.ValidateTags[\"regexp\"]; ok {\n\t\ts, ok := field.String()\n\t\tif ok {\n\t\t\tif err := validateRegexp(s, reg, field.Name); err != nil {\n\t\t\t\treturn err\n\t\t\t}\n\t\t}\n\t}\n\n\treturn nil\n}", "title": "" }, { "docid": "1263919bcf29a0e7242453d06020254d", "score": "0.60818726", "text": "func (p *Package) CheckTypeFields(d *ast.GenDecl, hasUnexportedField bool, hasUnexportedFieldPtr bool, hasUnexportedInterfaceField bool) bool {\n\tinterfaceNames, _ := p.FilterCommon(Interface)\n\tswitch d.Tok {\n\tcase token.TYPE:\n\t\tfor _, sp := range d.Specs {\n\t\t\tts := sp.(*ast.TypeSpec)\n\t\t\tswitch t := ts.Type.(type) {\n\t\t\tcase *ast.StructType:\n\t\t\t\tfor _, field := range t.Fields.List {\n\t\t\t\t\tfor _, name := range field.Names {\n\t\t\t\t\t\tif !ast.IsExported(name.Name) {\n\t\t\t\t\t\t\tif hasUnexportedField {\n\t\t\t\t\t\t\t\treturn true\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tif hasUnexportedFieldPtr {\n\t\t\t\t\t\t\t\ttyp := p.nodeString(field.Type)\n\t\t\t\t\t\t\t\tif strings.HasPrefix(typ, \"*\") {\n\t\t\t\t\t\t\t\t\treturn true\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tif hasUnexportedInterfaceField {\n\t\t\t\t\t\t\t\ttyp := p.nodeString(field.Type)\n\t\t\t\t\t\t\t\tfor _, iname := range interfaceNames {\n\t\t\t\t\t\t\t\t\tif typ == iname {\n\t\t\t\t\t\t\t\t\t\treturn true\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\tdefault:\n\t\t\t\tbreak\n\t\t\t}\n\t\t}\n\t}\n\treturn false\n}", "title": "" }, { "docid": "7a60dcaac0b6282ebf6a1e9a1ff534cd", "score": "0.6056758", "text": "func validate(obj interface{}, format string) error {\n\tval := reflect.ValueOf(obj).Elem()\n\n\tfor i := 0; i < val.NumField(); i++ {\n\t\ttag := val.Type().Field(i).Tag\n\t\tname := tag.Get(format)\n\t\tfield := val.Field(i)\n\n\t\tif err := validateField(field, tag); err != nil {\n\t\t\treturn fmt.Errorf(\"%s: %s\", name, err.Error())\n\t\t}\n\t}\n\treturn nil\n}", "title": "" }, { "docid": "53532daaa38813c0dc9062812c168f25", "score": "0.60334677", "text": "func (e *RequiredValidator) Validate(s interface{}) error {\n\tif e.RequiredTagName == \"\" {\n\t\te.RequiredTagName = \"required\"\n\t}\n\n\tfor _, field := range structs.Fields(s) {\n\t\tif err := e.processField(\"\", field); err != nil {\n\t\t\treturn err\n\t\t}\n\t}\n\n\treturn nil\n}", "title": "" }, { "docid": "50e2d2b9e2f3706763f0aac6a572deb8", "score": "0.60249317", "text": "func (r *AuthRequest) ValidateFields() []error {\n\tvar err = make([]error, 0)\n\tr.CardDetails.Number = strings.Replace(r.CardDetails.Number, \" \", \"\", -1)\n\tif !isCardNumberValid(r.CardDetails.Number) {\n\t\terr = append(err, errors.New(error_constant.InvalidCardNumber))\n\t}\n\tr.CardDetails.ExpiryDate = strings.Replace(r.CardDetails.ExpiryDate, \" \", \"\", -1)\n\tif !common_validation.IsExpiryDateValid(r.CardDetails.ExpiryDate) {\n\t\terr = append(err, errors.New(error_constant.InvalidCardExpiryDate))\n\t}\n\tr.CardDetails.Cvv = strings.Replace(r.CardDetails.Cvv, \" \", \"\", -1)\n\tif !isCvvValid(r.CardDetails.Cvv) {\n\t\terr = append(err, errors.New(error_constant.InvalidCvv))\n\t}\n\tif !common_validation.IsAmountValid(r.Amount) {\n\t\terr = append(err, errors.New(error_constant.InvalidAmount))\n\t}\n\tif !isCurrencyCodeValid(r.Currency) {\n\t\terr = append(err, errors.New(error_constant.InvalidCurrencyCode))\n\t}\n\treturn err\n}", "title": "" }, { "docid": "b5b08c4dc47e32a4f7cf4f196583b564", "score": "0.6020625", "text": "func (p Harvest) Validate() error {\n\tfor _, f := range requiredFields {\n\t\tif found, ok := p[f]; !ok || found == \"\" {\n\t\t\treturn fmt.Errorf(\"missing field %q\", f)\n\t\t}\n\t}\n\treturn nil\n}", "title": "" }, { "docid": "b73a7cacacc26b7586ab692dadab1d0e", "score": "0.6020328", "text": "func (u *User) Validate() error {\n\t// TODO: return all validation errors, not just the first one\n\tswitch {\n\n\tcase u.Name == nil:\n\t\treturn errors.New(\".name mandatory field is missing\")\n\n\tcase u.Surname == nil:\n\t\treturn errors.New(\".surname mandatory field is missing\")\n\n\tcase u.Email == nil:\n\t\treturn errors.New(\".email mandatory field is missing\")\n\tcase !strings.Contains(*u.Email, \"@\"):\n\t\t// TODO: also verify there's something before '@' and after '@'\n\t\t// TODO: consider more advanced validation, though this is tricky; if\n\t\t// applicable, consider sending confirmation email instead\n\t\treturn errors.New(\".email is not a valid email address\")\n\n\tcase u.Password == nil:\n\t\treturn errors.New(\".password mandatory field is missing\")\n\n\tcase u.Birthday == nil:\n\t\treturn errors.New(\".birthday mandatory field is missing\")\n\t// TODO: .birthday probably shouldn't be in future\n\n\tcase u.Address == nil:\n\t\treturn errors.New(\".address mandatory field is missing\")\n\n\t// TODO: validate .phone contents format if field provided (there's some pkg for this IIRC)\n\n\tcase u.Technology == nil:\n\t\treturn errors.New(\".technology mandatory field is missing\")\n\tcase !validTechnology[*u.Technology]:\n\t\treturn errors.New(\".technology must be one of: go java js php\")\n\n\tcase u.Deleted != nil:\n\t\treturn errors.New(\".deleted must be empty\")\n\n\tdefault:\n\t\treturn nil\n\t}\n\t// TODO: arguably, non-optional fields should also be non-empty, though\n\t// question is how far we want to go with validation, e.g. is \"x\" a\n\t// valid address?\n}", "title": "" }, { "docid": "256f7b1848fa24ab614bea59d9d1e268", "score": "0.5990146", "text": "func (schema Schema) Validate() error {\n\tvalidaters := []validater{}\n\tfor _, s := range schema.AllOf {\n\t\tvalidaters = append(validaters, s)\n\t}\n\tfor _, s := range schema.OneOf {\n\t\tvalidaters = append(validaters, s)\n\t}\n\tfor _, s := range schema.AnyOf {\n\t\tvalidaters = append(validaters, s)\n\t}\n\tif schema.Not != nil {\n\t\tvalidaters = append(validaters, schema.Not)\n\t}\n\tif schema.Items != nil {\n\t\tvalidaters = append(validaters, schema.Items)\n\t}\n\tif schema.Discriminator != nil {\n\t\tvalidaters = append(validaters, schema.Discriminator)\n\t}\n\tif schema.XML != nil {\n\t\tvalidaters = append(validaters, schema.XML)\n\t}\n\tif schema.ExternalDocs != nil {\n\t\tvalidaters = append(validaters, schema.ExternalDocs)\n\t}\n\tfor _, property := range schema.Properties {\n\t\tvalidaters = append(validaters, property)\n\t}\n\tif e, ok := schema.Example.(validater); ok {\n\t\tvalidaters = append(validaters, e)\n\t}\n\treturn validateAll(validaters)\n}", "title": "" }, { "docid": "2a8225b87349245386e07549e93c0876", "score": "0.59755284", "text": "func Valid(inst ValidatedModeler) error {\n\t//loop over our required fields\n\tfor _, requiredField := range inst.RequiredFields() {\n\t\t\n\t\t//grab the field\n\t\tfield := reflect.ValueOf(inst).Elem().FieldByName(requiredField)\n\n\t\t//check if this is an invalid field\n\t\tif field == reflect.ValueOf(nil){\n\t\t\t//kill at compile time. no reason to let it become a runtime issue\n\t\t\tlog.Fatalf(\"mgomodel.Valid Error: invalid requiredField defined: %s\", requiredField)\n\t\t}\n\n\t\t//check if the type is nil\n\t\tswitch field.Kind() {\n\t\t\tcase reflect.Array, reflect.Map, reflect.Slice, reflect.String:\n\t\t\t\tif field.Len() == 0 {\n\t\t\t\t\treturn errors.New(\"required field isn't set: \"+requiredField)\n\t\t\t\t}\n\t\t\tcase reflect.Interface, reflect.Ptr:\n\t\t\t\tif field.IsNil() {\n\t\t\t\t\treturn errors.New(\"required field isn't set: \"+requiredField)\n\t\t\t\t}\n\t\t}\n\n\t}\n\n\t//loop over our user defined validator funcs\n\tfor _, validator := range inst.Validators() {\n\t\t//run the validator\n\t\terr := validator(inst)\n\t\t\n\t\t//run the validator\n\t\tif err != nil{\n\t\t\t//print the error\n\t\t\tlog.Println(err.Error())\n\n\t\t\t//if validator is false return false\n\t\t\treturn err\n\t\t}\n\t}\n\n\t//everything is skippy\n\treturn nil\n\n}", "title": "" }, { "docid": "6a0e7f261da80bfc8087b03d345da37e", "score": "0.5958057", "text": "func (args Args) Validate(accepted map[string]bool) error {\n\tfor name := range args.fields {\n\t\tif !accepted[name] {\n\t\t\treturn errors.New(\"invalid filter \" + name)\n\t\t}\n\t}\n\treturn nil\n}", "title": "" }, { "docid": "48bd321bd50cd3c8de537b2383d631d6", "score": "0.59485763", "text": "func (s *StructInfo) Validate() error {\n\n\treturn nil\n}", "title": "" }, { "docid": "dfb2426b3f76a3af3adcb1b91292404a", "score": "0.5939628", "text": "func (u *User) Validate() error {\n\treturn validation.ValidateStruct(u,\n\t\tvalidation.Field(&u.Email, validation.Required, is.Email),\n\t\tvalidation.Field(&u.BirthDate, validation.Required, validation.Date(\"Monday, January 02, 2006 3:04 PM\")),\n\t)\n\n}", "title": "" }, { "docid": "41ff0008124d2e39c7eff64b6fffd294", "score": "0.58754206", "text": "func (u UserRef) ValidateFields(validator validation.Validator) {\n\t// Require the Domain and Organization to be set\n\tif len(u.Domain) == 0 {\n\t\tvalidator.Required(\"Domain\")\n\t}\n\tif len(u.UserLogin) == 0 {\n\t\tvalidator.Required(\"UserLogin\")\n\t}\n}", "title": "" }, { "docid": "316c61501ec652289b64307fac7cf242", "score": "0.5871323", "text": "func (a *Adapter) Validate(data interface{}) map[string]string {\n\tif isSlice(data) {\n\t\treturn a.validateSliceOfStructs(convertToSlice(data))\n\t}\n\n\treturn a.validateStruct(data)\n}", "title": "" }, { "docid": "0aee233f67551417cce1192f669042e9", "score": "0.5863164", "text": "func (mt *Checktype) Validate() (err error) {\n\tif mt.Checktype == nil {\n\t\terr = goa.MergeErrors(err, goa.MissingAttributeError(`response`, \"checktype\"))\n\t}\n\tif mt.Checktype != nil {\n\t\tif err2 := mt.Checktype.Validate(); err2 != nil {\n\t\t\terr = goa.MergeErrors(err, err2)\n\t\t}\n\t}\n\treturn\n}", "title": "" }, { "docid": "0aee233f67551417cce1192f669042e9", "score": "0.5863164", "text": "func (mt *Checktype) Validate() (err error) {\n\tif mt.Checktype == nil {\n\t\terr = goa.MergeErrors(err, goa.MissingAttributeError(`response`, \"checktype\"))\n\t}\n\tif mt.Checktype != nil {\n\t\tif err2 := mt.Checktype.Validate(); err2 != nil {\n\t\t\terr = goa.MergeErrors(err, err2)\n\t\t}\n\t}\n\treturn\n}", "title": "" }, { "docid": "e066466ae64b5e46841c5b07e3f97302", "score": "0.5862858", "text": "func Validation(obj interface{}) []error {\n\tvar result []error = nil\n\tif obj != nil {\n\t\tif val := reflect.Indirect(reflect.ValueOf(obj)); val.IsValid() {\n\t\t\tt := val.Type()\n\t\t\tif k := t.Kind(); k != reflect.Array && k != reflect.Slice {\n\t\t\t\t// Перебираем поля модели\n\t\t\t\tfor i := 0; i < t.NumField(); i++ {\n\t\t\t\t\tif field := t.Field(i); len(field.Tag) > 0 && !field.Anonymous {\n\t\t\t\t\t\t// Получаем инструкции валидации\n\t\t\t\t\t\tif str, ok := field.Tag.Lookup(\"valid\"); ok && len(str) > 0 {\n\t\t\t\t\t\t\tfor _, instruction := range strings.Split(str, \";\") {\n\t\t\t\t\t\t\t\tvar err error = nil\n\t\t\t\t\t\t\t\t// Убираем пробелы\n\t\t\t\t\t\t\t\tinstruction = strings.TrimSpace(instruction)\n\t\t\t\t\t\t\t\t// Проводим анализ\n\t\t\t\t\t\t\t\tfieldKind := field.Type.Kind()\n\t\t\t\t\t\t\t\tswitch fieldKind {\n\t\t\t\t\t\t\t\t// Для целых чисел (min,max)\n\t\t\t\t\t\t\t\tcase reflect.Int, reflect.Int8, reflect.Int16, reflect.Int32, reflect.Int64:\n\t\t\t\t\t\t\t\t\terr = validationInt(val.Field(i).Int(), instruction)\n\t\t\t\t\t\t\t\tcase reflect.Uint, reflect.Uint8, reflect.Uint16, reflect.Uint32, reflect.Uint64:\n\t\t\t\t\t\t\t\t\terr = validationUnsignedInt(val.Field(i).Uint(), instruction)\n\t\t\t\t\t\t\t\tcase reflect.Float32, reflect.Float64:\n\t\t\t\t\t\t\t\t\terr = validationFloat(val.Field(i).Float(), instruction)\n\t\t\t\t\t\t\t\tcase reflect.String:\n\t\t\t\t\t\t\t\t\terr = validationString(val.Field(i).String(), instruction)\n\t\t\t\t\t\t\t\tdefault:\n\t\t\t\t\t\t\t\t\terr = errors.New(\"unsupported validator\")\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\tif err != nil {\n\t\t\t\t\t\t\t\t\tif result == nil {\n\t\t\t\t\t\t\t\t\t\tresult = make([]error, 0)\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\tresult = append(result, &ValidationError{\n\t\t\t\t\t\t\t\t\t\tField: field.Name,\n\t\t\t\t\t\t\t\t\t\tMessage: err.Error(),\n\t\t\t\t\t\t\t\t\t})\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\treturn result\n}", "title": "" }, { "docid": "bba0c7a09c61a896bf4cad695d8426c9", "score": "0.5844586", "text": "func (m FieldError) Validate() error {\n\treturn validation.Errors{\n\t\t\"errors\": validation.Validate(\n\t\t\tm.Errors, validation.NotNil,\n\t\t),\n\t}.Filter()\n}", "title": "" }, { "docid": "a5a0ce1df7d59d4d75e98745d19dbd31", "score": "0.5843004", "text": "func (mt *Checktypes) Validate() (err error) {\n\tif mt.Checktypes == nil {\n\t\terr = goa.MergeErrors(err, goa.MissingAttributeError(`response`, \"checktypes\"))\n\t}\n\tfor _, e := range mt.Checktypes {\n\t\tif e != nil {\n\t\t\tif err2 := e.Validate(); err2 != nil {\n\t\t\t\terr = goa.MergeErrors(err, err2)\n\t\t\t}\n\t\t}\n\t}\n\treturn\n}", "title": "" }, { "docid": "a5a0ce1df7d59d4d75e98745d19dbd31", "score": "0.5843004", "text": "func (mt *Checktypes) Validate() (err error) {\n\tif mt.Checktypes == nil {\n\t\terr = goa.MergeErrors(err, goa.MissingAttributeError(`response`, \"checktypes\"))\n\t}\n\tfor _, e := range mt.Checktypes {\n\t\tif e != nil {\n\t\t\tif err2 := e.Validate(); err2 != nil {\n\t\t\t\terr = goa.MergeErrors(err, err2)\n\t\t\t}\n\t\t}\n\t}\n\treturn\n}", "title": "" }, { "docid": "ee9bc29ebfcafa85d198395f3e90bff0", "score": "0.5828839", "text": "func Validate(s interface{}) []models.FieldSpec {\n\tvar fieldSpecs []models.FieldSpec\n\n\tv := reflect.ValueOf(s)\n\n\tfor i := 0; i < v.NumField(); i++ {\n\t\t// tag := v.Type().Field(i).Tag.Get(constants.Validate)\n\t\t// if tag == constants.Empty || tag == constants.Hyphen {\n\t\t// \tcontinue\n\t\t// }\n\t\tjsonName := v.Type().Field(i).Tag.Get(constants.JSON)\n\n\t\t// logic to validate nested struct\n\t\tif v.Type().Field(i).Tag.Get(constants.Validate) == constants.StructTag {\n\t\t\tvalidateNestedStruct(v.Field(i), &fieldSpecs, jsonName)\n\t\t}\n\n\t\t// logic to validate nested struct array\n\t\tif v.Type().Field(i).Tag.Get(constants.Validate) == \"struct_array\" {\n\t\t\tnestedArray := reflect.ValueOf(v.Field(i).Interface())\n\t\t\tfor k := 0; k < nestedArray.Len(); k++ {\n\t\t\t\tvalidateNestedArrayStruct(nestedArray.Index(k), &fieldSpecs, jsonName, k)\n\t\t\t}\n\t\t}\n\n\t\t// logic to validate struct fields\n\t\tvalidator := getValidatorFromTag(v.Type().Field(i))\n\t\tvalid, err := validator.Validate(v.Field(i).Interface())\n\t\tif !valid && err != nil {\n\t\t\tfieldSpecs = append(fieldSpecs, models.GenerateFieldSpec(v.Type().Field(i), v.Field(i).Interface(), err))\n\t\t}\n\t}\n\treturn fieldSpecs\n}", "title": "" }, { "docid": "01ca42d9240667494c07c6c09f589661", "score": "0.5809238", "text": "func (fv fieldValidator) Validate(sess Session, model Model) error {\n\tfield, err := ModelGetField(model, fv.Field())\n\tif err != nil {\n\t\treturn err\n\t}\n\treturn fv.Func(sess, model, field, fv.Args...)\n}", "title": "" }, { "docid": "77bf15aacaa98f8db1a92fcda6c5a99d", "score": "0.5809157", "text": "func Validate(a interface{}) error {\n\terr := val.Struct(a)\n\t// translate all error at once\n\tif err != nil {\n\t\terrs := err.(validator.ValidationErrors)\n\t\tvar errMsg []string\n\t\tfor _, e := range errs {\n\t\t\terrMsg = append(errMsg, getErrorMessage(e))\n\t\t}\n\t\treturn fmt.Errorf(\"expected validation: %s\", strings.Join(errMsg, \"; \"))\n\t}\n\treturn nil\n}", "title": "" }, { "docid": "9e5bb221c53dbaab9642536d694e1c72", "score": "0.5807736", "text": "func (m *TestFieldData) Validate(formats strfmt.Registry) error {\n\treturn nil\n}", "title": "" }, { "docid": "60f9fab145d64b30b96334382b8d3bd0", "score": "0.5776163", "text": "func (fe *fieldExtract) validate() error {\n\t// If we have any of the required fields, we must have all of the required fields.\n\tif fe.has.HasAny(dateRequiredFields) && !fe.has.HasAll(dateRequiredFields) {\n\t\treturn inputErrorf(\"missing required date fields\")\n\t}\n\n\tif (fe.isDB2 && !fe.has.HasAll(db2TimeRequiredFields)) || (fe.has.HasAny(timeRequiredFields) && !fe.has.HasAll(timeRequiredFields)) {\n\t\treturn inputErrorf(\"missing required time fields\")\n\t}\n\tif !fe.has.HasAll(fe.required) {\n\t\treturn inputErrorf(\"missing required fields in input\")\n\t}\n\n\tif year, ok := fe.Get(fieldYear); ok {\n\t\tif year == 0 {\n\t\t\treturn outOfRangeError(\"year\", year)\n\t\t}\n\t\t// Update for BC dates.\n\t\tif era, ok := fe.Get(fieldEra); ok && era < 0 {\n\t\t\t// No year 0\n\t\t\tif year <= 0 {\n\t\t\t\treturn inputErrorf(\"no year 0 in AD/BC notation\")\n\t\t\t}\n\t\t\t// Normalize to a negative year\n\t\t\tif err := fe.Reset(fieldYear, 1-year); err != nil {\n\t\t\t\treturn err\n\t\t\t}\n\t\t} else if fe.tweakYear {\n\t\t\tif year < 0 {\n\t\t\t\treturn inputErrorf(\"negative year not allowed\")\n\t\t\t}\n\t\t\tif year < 70 {\n\t\t\t\tyear += 2000\n\t\t\t} else if year < 100 {\n\t\t\t\tyear += 1900\n\t\t\t}\n\t\t\tif err := fe.Reset(fieldYear, year); err != nil {\n\t\t\t\treturn err\n\t\t\t}\n\t\t}\n\n\t\tif month, ok := fe.Get(fieldMonth); ok {\n\t\t\tif month < 1 || month > 12 {\n\t\t\t\treturn outOfRangeError(\"month\", month)\n\t\t\t}\n\n\t\t\tif day, ok := fe.Get(fieldDay); ok {\n\t\t\t\tvar maxDay int\n\t\t\t\tif isLeap(year) {\n\t\t\t\t\tmaxDay = daysInMonth[1][month]\n\t\t\t\t} else {\n\t\t\t\t\tmaxDay = daysInMonth[0][month]\n\t\t\t\t}\n\t\t\t\tif day < 1 || day > maxDay {\n\t\t\t\t\treturn outOfRangeError(\"day\", day)\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\n\tif hour, ok := fe.Get(fieldHour); ok {\n\t\thasDate := fe.has.HasAny(dateRequiredFields)\n\n\t\tmeridian, _ := fe.Get(fieldMeridian)\n\t\tswitch meridian {\n\t\tcase fieldValueAM:\n\t\t\tswitch {\n\t\t\tcase hour < 0 || hour > 12:\n\t\t\t\treturn outOfRangeError(\"hour\", hour)\n\t\t\tcase hour == 12:\n\t\t\t\tif err := fe.Reset(fieldHour, 0); err != nil {\n\t\t\t\t\treturn err\n\t\t\t\t}\n\t\t\t}\n\n\t\tcase fieldValuePM:\n\t\t\tswitch {\n\t\t\tcase hour < 0 || hour > 12:\n\t\t\t\treturn outOfRangeError(\"hour\", hour)\n\t\t\tcase hour == 12:\n\t\t\t\t// 12 PM -> 12\n\t\t\tdefault:\n\t\t\t\t// 1 PM -> 13\n\t\t\t\tif err := fe.Reset(fieldHour, hour+12); err != nil {\n\t\t\t\t\treturn err\n\t\t\t\t}\n\t\t\t}\n\n\t\tdefault:\n\t\t\t// 24:00:00 is the maximum-allowed value\n\t\t\tif hour < 0 || (hasDate && hour > 24) || (!hasDate && hour > 23) {\n\t\t\t\treturn outOfRangeError(\"hour\", hour)\n\t\t\t}\n\t\t}\n\n\t\tminute, _ := fe.Get(fieldMinute)\n\t\tif minute < 0 || minute > 59 {\n\t\t\treturn outOfRangeError(\"minute\", minute)\n\t\t}\n\n\t\tsecond, _ := fe.Get(fieldSecond)\n\t\tif second < 0 || (hasDate && second > 60) || (!hasDate && second > 59) {\n\t\t\treturn outOfRangeError(\"second\", second)\n\t\t}\n\n\t\tnanos, _ := fe.Get(fieldNanos)\n\t\tif nanos < 0 {\n\t\t\treturn outOfRangeError(\"nanos\", nanos)\n\t\t}\n\n\t\tx := time.Duration(hour)*time.Hour +\n\t\t\ttime.Duration(minute)*time.Minute +\n\t\t\ttime.Duration(second)*time.Second +\n\t\t\ttime.Duration(nanos)*time.Nanosecond\n\t\tif x > 24*time.Hour {\n\t\t\treturn inputErrorf(\"time out of range: %d\", x)\n\t\t}\n\t}\n\n\treturn nil\n}", "title": "" }, { "docid": "f16989232231c13e2e7a3e98ac48343f", "score": "0.57713807", "text": "func (m *AlumnType) Validate() error {\n\tif m == nil {\n\t\treturn nil\n\t}\n\n\t// no validation rules for Adult\n\n\t// no validation rules for Special\n\n\t// no validation rules for Normal\n\n\treturn nil\n}", "title": "" }, { "docid": "53c5f339df34308a9dec741cd0aaa082", "score": "0.5756815", "text": "func assertValidType(name string, fields []string) {\n\tif name == \"\" {\n\t\tFailf(\"type has empty name\")\n\t}\n\tfieldsCopy := make([]string, len(fields))\n\tfor i := 0; i < len(fields); i++ {\n\t\tif fields[i] == \"\" {\n\t\t\tFailf(\"field has empty name for type %q\", name)\n\t\t}\n\t\tfieldsCopy[i] = fields[i]\n\t}\n\tsort.Slice(fieldsCopy, func(i, j int) bool {\n\t\treturn fieldsCopy[i] < fieldsCopy[j]\n\t})\n\tfor i := range fieldsCopy {\n\t\tif i > 0 && fieldsCopy[i-1] == fieldsCopy[i] {\n\t\t\tFailf(\"duplicate field %q for type %s\", fieldsCopy[i], name)\n\t\t}\n\t}\n}", "title": "" }, { "docid": "772ed808195b7f4d51ef8b2ddb5fe7ae", "score": "0.5751142", "text": "func validate(instance map[string]interface{}, mandatoryFields []string) error {\n\tfor _, k := range mandatoryFields {\n\t\tif _, ok := instance[k]; !ok {\n\t\t\treturn fmt.Errorf(\"mandatory field %q missing from instance: %v\", k, instance)\n\t\t}\n\t\tif _, ok := instance[k].(string); !ok {\n\t\t\treturn fmt.Errorf(\"value for %q should be a string, got %T\", k, instance[k])\n\t\t}\n\t}\n\treturn nil\n}", "title": "" }, { "docid": "b883f13b0d34399c1bafd2900ccd5ca2", "score": "0.5746325", "text": "func (c *CustomerSchema) Validate() error {\n return validation.ValidateStruct(c,\n validation.Field(&c.Id, validation.In(nil).Error(\"Cannot update id\")),\n validation.Field(&c.FirstName, is.Alpha),\n validation.Field(&c.LastName, is.Alpha),\n )\n}", "title": "" }, { "docid": "ec4c1275fd5b0c4a33bbf6c10bf54b43", "score": "0.5740181", "text": "func (m *FieldAuthorizationInfo) Validate(formats strfmt.Registry) error {\n\treturn nil\n}", "title": "" }, { "docid": "485ee13567a1b7c94a98e43dadc36f16", "score": "0.5737436", "text": "func (s *ColumnStatisticsData) Validate() error {\n\tinvalidParams := request.ErrInvalidParams{Context: \"ColumnStatisticsData\"}\n\tif s.Type == nil {\n\t\tinvalidParams.Add(request.NewErrParamRequired(\"Type\"))\n\t}\n\tif s.BinaryColumnStatisticsData != nil {\n\t\tif err := s.BinaryColumnStatisticsData.Validate(); err != nil {\n\t\t\tinvalidParams.AddNested(\"BinaryColumnStatisticsData\", err.(request.ErrInvalidParams))\n\t\t}\n\t}\n\tif s.BooleanColumnStatisticsData != nil {\n\t\tif err := s.BooleanColumnStatisticsData.Validate(); err != nil {\n\t\t\tinvalidParams.AddNested(\"BooleanColumnStatisticsData\", err.(request.ErrInvalidParams))\n\t\t}\n\t}\n\tif s.DateColumnStatisticsData != nil {\n\t\tif err := s.DateColumnStatisticsData.Validate(); err != nil {\n\t\t\tinvalidParams.AddNested(\"DateColumnStatisticsData\", err.(request.ErrInvalidParams))\n\t\t}\n\t}\n\tif s.DecimalColumnStatisticsData != nil {\n\t\tif err := s.DecimalColumnStatisticsData.Validate(); err != nil {\n\t\t\tinvalidParams.AddNested(\"DecimalColumnStatisticsData\", err.(request.ErrInvalidParams))\n\t\t}\n\t}\n\tif s.DoubleColumnStatisticsData != nil {\n\t\tif err := s.DoubleColumnStatisticsData.Validate(); err != nil {\n\t\t\tinvalidParams.AddNested(\"DoubleColumnStatisticsData\", err.(request.ErrInvalidParams))\n\t\t}\n\t}\n\tif s.LongColumnStatisticsData != nil {\n\t\tif err := s.LongColumnStatisticsData.Validate(); err != nil {\n\t\t\tinvalidParams.AddNested(\"LongColumnStatisticsData\", err.(request.ErrInvalidParams))\n\t\t}\n\t}\n\tif s.StringColumnStatisticsData != nil {\n\t\tif err := s.StringColumnStatisticsData.Validate(); err != nil {\n\t\t\tinvalidParams.AddNested(\"StringColumnStatisticsData\", err.(request.ErrInvalidParams))\n\t\t}\n\t}\n\n\tif invalidParams.Len() > 0 {\n\t\treturn invalidParams\n\t}\n\treturn nil\n}", "title": "" }, { "docid": "ff32f49a3148e7b379b5e7cd11b8a56b", "score": "0.57334745", "text": "func (m CreateAdRequest) Validate() map[string]error {\n\tfieldErrs := make(map[string]error)\n\tif m.Title == \"\" {\n\t\tfieldErrs[\"title\"] = ErrIsEmpty\n\t}\n\tif len(m.Title) > 200 {\n\t\tfieldErrs[\"title\"] = ErrMaxLen\n\t}\n\tif len(m.Description) >1000 {\n\t\tfieldErrs[\"description\"] = ErrMaxLen\n\t}\n\tif len(m.PhotoLinks) >3 {\n\t\tfieldErrs[\"photo_links\"] = ErrMaxLen\n\t}\n\tif m.Price < 1 {\n\t\tfieldErrs[\"price\"] = ErrIsEmpty\n\t}\n\n\tif len(fieldErrs) == 0 {\n\t\treturn nil\n\t}\n\treturn fieldErrs\n}", "title": "" }, { "docid": "cda49128e9054f39e45d503d4eab98d5", "score": "0.5725888", "text": "func (rr *ResolutionRequest) Validate(ctx context.Context) (errs *apis.FieldError) {\n\terrs = errs.Also(validateTypeLabel(rr))\n\treturn errs.Also(rr.Spec.Validate(ctx).ViaField(\"spec\"))\n}", "title": "" }, { "docid": "61c19da454e3a5a6bb91f994f41799e2", "score": "0.5722657", "text": "func (m *PaymentTypeInformation) Validate() error {\n\tif m == nil {\n\t\treturn nil\n\t}\n\n\t// no validation rules for ServiceLevel\n\n\t// no validation rules for LocalInstrument\n\n\t// no validation rules for PaymentChannel\n\n\treturn nil\n}", "title": "" }, { "docid": "624ca7447533bd0d9ed0e548a940a975", "score": "0.5720981", "text": "func (d *Developer) Validate() error {\n\tvar valid = true\n\tvar err error\n\n\tbs := bytes.NewBufferString(\"Fields with invalid content: \")\n\n\tif !d.validateEmail() {\n\t\tvalid = false\n\t\tbs.WriteString(\"Email \")\n\t}\n\n\tif !d.validateFirstName() {\n\t\tvalid = false\n\t\tbs.WriteString(\"FirstName \")\n\t}\n\n\tif !d.validateLastName() {\n\t\tvalid = false\n\t\tbs.WriteString(\"LastName \")\n\t}\n\n\tif !valid {\n\t\terr = errors.New(bs.String())\n\t}\n\n\treturn err\n}", "title": "" }, { "docid": "90c3649dfb2c83f04e4bed174ef3853a", "score": "0.5711303", "text": "func FieldsOnCorrectTypeRule(context *ValidationContext) *ValidationRuleInstance {\n\tvisitorOpts := &visitor.VisitorOptions{\n\t\tKindFuncMap: map[string]visitor.NamedVisitFuncs{\n\t\t\tkinds.Field: {\n\t\t\t\tKind: func(p visitor.VisitFuncParams) (string, interface{}) {\n\t\t\t\t\tvar action = visitor.ActionNoChange\n\t\t\t\t\tvar result interface{}\n\t\t\t\t\tif node, ok := p.Node.(*ast.Field); ok {\n\t\t\t\t\t\tttype := context.ParentType()\n\n\t\t\t\t\t\tif ttype != nil {\n\t\t\t\t\t\t\tfieldDef := context.FieldDef()\n\t\t\t\t\t\t\tif fieldDef == nil {\n\t\t\t\t\t\t\t\t// This isn't valid. Let's find suggestions, if any.\n\t\t\t\t\t\t\t\tsuggestedTypes := []string{}\n\n\t\t\t\t\t\t\t\tnodeName := \"\"\n\t\t\t\t\t\t\t\tif node.Name != nil {\n\t\t\t\t\t\t\t\t\tnodeName = node.Name.Value\n\t\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t\tif ttype, ok := ttype.(Abstract); ok && IsAbstractType(ttype) {\n\t\t\t\t\t\t\t\t\tsiblingInterfaces := getSiblingInterfacesIncludingField(context.Schema(), ttype, nodeName)\n\t\t\t\t\t\t\t\t\timplementations := getImplementationsIncludingField(context.Schema(), ttype, nodeName)\n\t\t\t\t\t\t\t\t\tsuggestedMaps := map[string]bool{}\n\t\t\t\t\t\t\t\t\tfor _, s := range siblingInterfaces {\n\t\t\t\t\t\t\t\t\t\tif _, ok := suggestedMaps[s]; !ok {\n\t\t\t\t\t\t\t\t\t\t\tsuggestedMaps[s] = true\n\t\t\t\t\t\t\t\t\t\t\tsuggestedTypes = append(suggestedTypes, s)\n\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\tfor _, s := range implementations {\n\t\t\t\t\t\t\t\t\t\tif _, ok := suggestedMaps[s]; !ok {\n\t\t\t\t\t\t\t\t\t\t\tsuggestedMaps[s] = true\n\t\t\t\t\t\t\t\t\t\t\tsuggestedTypes = append(suggestedTypes, s)\n\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t\tmessage := UndefinedFieldMessage(nodeName, ttype.Name(), suggestedTypes)\n\n\t\t\t\t\t\t\t\treportError(\n\t\t\t\t\t\t\t\t\tcontext,\n\t\t\t\t\t\t\t\t\tmessage,\n\t\t\t\t\t\t\t\t\t[]ast.Node{node},\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\treturn action, result\n\t\t\t\t},\n\t\t\t},\n\t\t},\n\t}\n\treturn &ValidationRuleInstance{\n\t\tVisitorOpts: visitorOpts,\n\t}\n}", "title": "" }, { "docid": "ee7f63233c5cb870b3bcd4d5cad70325", "score": "0.57076293", "text": "func (ts *testStruct) Validate(firstName, lastName string, age int, city, state, notes string) (err error) {\n\tif ts.FirstName != firstName {\n\t\treturn fmt.Errorf(\"invalid name, expected %s and received %s\", firstName, ts.FirstName)\n\t}\n\n\tif ts.LastName != lastName {\n\t\treturn fmt.Errorf(\"invalid name, expected %s and received %s\", lastName, ts.LastName)\n\t}\n\n\tif ts.Age != age {\n\t\treturn fmt.Errorf(\"invalid name, expected %d and received %d\", age, ts.Age)\n\t}\n\n\tif ts.City != city {\n\t\treturn fmt.Errorf(\"invalid name, expected %s and received %s\", city, ts.City)\n\t}\n\n\tif ts.State != state {\n\t\treturn fmt.Errorf(\"invalid name, expected \\\"%s\\\" and received \\\"%s\\\"\", state, ts.State)\n\t}\n\n\tif ts.Notes != notes {\n\t\treturn fmt.Errorf(\"invalid notes, expected \\\"%s\\\" and received \\\"%s\\\" / %d / %d\", notes, ts.Notes, len(notes), len(ts.Notes))\n\t}\n\n\treturn\n}", "title": "" }, { "docid": "fe1261b4edfa886b36eac82462a893e4", "score": "0.56895036", "text": "func needsValidation(n *gen.Type) bool {\n\tfor _, f := range n.Fields {\n\t\tif f.Validators > 0 {\n\t\t\treturn true\n\t\t}\n\t}\n\t// TODO: Edges\n\n\treturn false\n}", "title": "" }, { "docid": "f13d976f94e049840b906ae99bfcb6db", "score": "0.5666657", "text": "func (m *S3MetaData) validate() error {\n\tif m.SchemaName == nil {\n\t\treturn fmt.Errorf(invalidFieldErrorTemplate, \"schema\")\n\t}\n\tif m.TableName == nil {\n\t\treturn fmt.Errorf(invalidFieldErrorTemplate, \"table name\")\n\t}\n\tif m.FieldNames == nil || len(m.Fields) == 0 {\n\t\treturn fmt.Errorf(invalidFieldErrorTemplate, \"field names\")\n\t}\n\tif m.FieldTypes == nil {\n\t\treturn fmt.Errorf(invalidFieldErrorTemplate, \"field types\")\n\t}\n\n\tif len(strings.Split(*m.FieldNames, comma)) != len(strings.Split(*m.FieldTypes, comma)) {\n\t\treturn fmt.Errorf(\"field configuration mismatch. names: %s, types: %s\", *m.FieldNames, *m.FieldTypes)\n\t}\n\n\treturn nil\n}", "title": "" }, { "docid": "95cf53340c2c1b795882e3c27e44a6db", "score": "0.5656407", "text": "func validateStruct(errors Errors, obj interface{}) Errors {\n\ttyp := reflect.TypeOf(obj)\n\tval := reflect.ValueOf(obj)\n\n\tif typ.Kind() == reflect.Ptr {\n\t\ttyp = typ.Elem()\n\t\tval = val.Elem()\n\t}\n\n\tfor i := 0; i < typ.NumField(); i++ {\n\t\tfield := typ.Field(i)\n\n\t\t// Allow ignored fields in the struct\n\t\tif field.Tag.Get(\"form\") == \"-\" || !val.Field(i).CanInterface() {\n\t\t\tcontinue\n\t\t}\n\n\t\tfieldVal := val.Field(i)\n\t\tfieldValue := fieldVal.Interface()\n\t\tzero := reflect.Zero(field.Type).Interface()\n\n\t\t// Validate nested and embedded structs (if pointer, only do so if not nil)\n\t\tif field.Type.Kind() == reflect.Struct ||\n\t\t\t(field.Type.Kind() == reflect.Ptr && !reflect.DeepEqual(zero, fieldValue) &&\n\t\t\t\tfield.Type.Elem().Kind() == reflect.Struct) {\n\t\t\terrors = validateStruct(errors, fieldValue)\n\t\t}\n\n\tVALIDATE_RULES:\n\t\tfor _, rule := range strings.Split(field.Tag.Get(\"binding\"), \";\") {\n\t\t\tif len(rule) == 0 {\n\t\t\t\tcontinue\n\t\t\t}\n\n\t\t\tswitch {\n\t\t\tcase rule == \"Required\":\n\t\t\t\tif reflect.DeepEqual(zero, fieldValue) {\n\t\t\t\t\terrors.Add([]string{field.Name}, ERR_REQUIRED, \"Required\")\n\t\t\t\t\tbreak VALIDATE_RULES\n\t\t\t\t}\n\t\t\tcase rule == \"AlphaDash\":\n\t\t\t\tif alphaDashPattern.MatchString(fmt.Sprintf(\"%v\", fieldValue)) {\n\t\t\t\t\terrors.Add([]string{field.Name}, ERR_ALPHA_DASH, \"AlphaDash\")\n\t\t\t\t\tbreak VALIDATE_RULES\n\t\t\t\t}\n\t\t\tcase rule == \"AlphaDashDot\":\n\t\t\t\tif alphaDashDotPattern.MatchString(fmt.Sprintf(\"%v\", fieldValue)) {\n\t\t\t\t\terrors.Add([]string{field.Name}, ERR_ALPHA_DASH_DOT, \"AlphaDashDot\")\n\t\t\t\t\tbreak VALIDATE_RULES\n\t\t\t\t}\n\t\t\tcase strings.HasPrefix(rule, \"MinSize(\"):\n\t\t\t\tmin, _ := strconv.Atoi(rule[8 : len(rule)-1])\n\t\t\t\tif str, ok := fieldValue.(string); ok && utf8.RuneCountInString(str) < min {\n\t\t\t\t\terrors.Add([]string{field.Name}, ERR_MIN_SIZE, \"MinSize\")\n\t\t\t\t\tbreak VALIDATE_RULES\n\t\t\t\t}\n\t\t\t\tv := reflect.ValueOf(fieldValue)\n\t\t\t\tif v.Kind() == reflect.Slice && v.Len() < min {\n\t\t\t\t\terrors.Add([]string{field.Name}, ERR_MIN_SIZE, \"MinSize\")\n\t\t\t\t\tbreak VALIDATE_RULES\n\t\t\t\t}\n\t\t\tcase strings.HasPrefix(rule, \"MaxSize(\"):\n\t\t\t\tmax, _ := strconv.Atoi(rule[8 : len(rule)-1])\n\t\t\t\tif str, ok := fieldValue.(string); ok && utf8.RuneCountInString(str) > max {\n\t\t\t\t\terrors.Add([]string{field.Name}, ERR_MAX_SIZE, \"MaxSize\")\n\t\t\t\t\tbreak VALIDATE_RULES\n\t\t\t\t}\n\t\t\t\tv := reflect.ValueOf(fieldValue)\n\t\t\t\tif v.Kind() == reflect.Slice && v.Len() > max {\n\t\t\t\t\terrors.Add([]string{field.Name}, ERR_MAX_SIZE, \"MaxSize\")\n\t\t\t\t\tbreak VALIDATE_RULES\n\t\t\t\t}\n\t\t\tcase strings.HasPrefix(rule, \"Range(\"):\n\t\t\t\tnums := strings.Split(rule[6:len(rule)-1], \",\")\n\t\t\t\tif len(nums) != 2 {\n\t\t\t\t\tbreak VALIDATE_RULES\n\t\t\t\t}\n\t\t\t\tval := com.StrTo(fmt.Sprintf(\"%v\", fieldValue)).MustInt()\n\t\t\t\tif val < com.StrTo(nums[0]).MustInt() || val > com.StrTo(nums[1]).MustInt() {\n\t\t\t\t\terrors.Add([]string{field.Name}, ERR_RANGE, \"Range\")\n\t\t\t\t\tbreak VALIDATE_RULES\n\t\t\t\t}\n\t\t\tcase rule == \"Email\":\n\t\t\t\tif !emailPattern.MatchString(fmt.Sprintf(\"%v\", fieldValue)) {\n\t\t\t\t\terrors.Add([]string{field.Name}, ERR_EMAIL, \"Email\")\n\t\t\t\t\tbreak VALIDATE_RULES\n\t\t\t\t}\n\t\t\tcase rule == \"Url\":\n\t\t\t\tstr := fmt.Sprintf(\"%v\", fieldValue)\n\t\t\t\tif len(str) == 0 {\n\t\t\t\t\tcontinue\n\t\t\t\t} else if !urlPattern.MatchString(str) {\n\t\t\t\t\terrors.Add([]string{field.Name}, ERR_URL, \"Url\")\n\t\t\t\t\tbreak VALIDATE_RULES\n\t\t\t\t}\n\t\t\tcase strings.HasPrefix(rule, \"In(\"):\n\t\t\t\tif !in(fieldValue, rule[3:len(rule)-1]) {\n\t\t\t\t\terrors.Add([]string{field.Name}, ERR_IN, \"In\")\n\t\t\t\t\tbreak VALIDATE_RULES\n\t\t\t\t}\n\t\t\tcase strings.HasPrefix(rule, \"NotIn(\"):\n\t\t\t\tif in(fieldValue, rule[6:len(rule)-1]) {\n\t\t\t\t\terrors.Add([]string{field.Name}, ERR_NOT_INT, \"NotIn\")\n\t\t\t\t\tbreak VALIDATE_RULES\n\t\t\t\t}\n\t\t\tcase strings.HasPrefix(rule, \"Include(\"):\n\t\t\t\tif !strings.Contains(fmt.Sprintf(\"%v\", fieldValue), rule[8:len(rule)-1]) {\n\t\t\t\t\terrors.Add([]string{field.Name}, ERR_INCLUDE, \"Include\")\n\t\t\t\t\tbreak VALIDATE_RULES\n\t\t\t\t}\n\t\t\tcase strings.HasPrefix(rule, \"Exclude(\"):\n\t\t\t\tif strings.Contains(fmt.Sprintf(\"%v\", fieldValue), rule[8:len(rule)-1]) {\n\t\t\t\t\terrors.Add([]string{field.Name}, ERR_EXCLUDE, \"Exclude\")\n\t\t\t\t\tbreak VALIDATE_RULES\n\t\t\t\t}\n\t\t\tcase strings.HasPrefix(rule, \"Default(\"):\n\t\t\t\tif reflect.DeepEqual(zero, fieldValue) {\n\t\t\t\t\tif fieldVal.CanAddr() {\n\t\t\t\t\t\tsetWithProperType(field.Type.Kind(), rule[8:len(rule)-1], fieldVal, field.Tag.Get(\"form\"), errors)\n\t\t\t\t\t} else {\n\t\t\t\t\t\terrors.Add([]string{field.Name}, ERR_EXCLUDE, \"Default\")\n\t\t\t\t\t\tbreak VALIDATE_RULES\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\tdefault:\n\t\t\t\t// Apply custom validation rules.\n\t\t\t\tfor i := range ruleMapper {\n\t\t\t\t\tif ruleMapper[i].IsMatch(rule) && !ruleMapper[i].IsValid(errors, field.Name, fieldValue) {\n\t\t\t\t\t\tbreak VALIDATE_RULES\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\treturn errors\n}", "title": "" }, { "docid": "f93cdbd3b2d2de8929f8867d197c418a", "score": "0.56548464", "text": "func (field *RelationalFieldDefinition) Validate() *dslengine.ValidationErrors {\n\tfmt.Println(\"Validing Field\")\n\tverr := new(dslengine.ValidationErrors)\n\n\tif field.Parent == nil {\n\t\tverr.Add(field, \"missing relational model parent\")\n\t}\n\tif field.FieldName == \"\" {\n\t\tverr.Add(field, \"field name not defined\")\n\t}\n\treturn verr.AsError()\n}", "title": "" }, { "docid": "3afa3f4bcadf06cab55ebc0bed1bbd34", "score": "0.5650654", "text": "func (tg *Generate) Validate() (err error) {\n\tif tg.Project == \"\" {\n\t\treturn errors.New(\"Project name is missing\")\n\t}\n\n\t// Validate whether Project name is proper identifier\n\n\tif tg.Kind == \"\" || (tg.Kind != \"http\" && tg.Kind != \"grpc\" && tg.Kind != \"cloudEvent\" && tg.Kind != \"cli\") {\n\t\treturn errors.New(\" Project type must be http | grpc | cloudEvent | cli\")\n\t}\n\tif tg.DatabaseSpec.Kind == \"\" || (tg.DatabaseSpec.Kind != \"mongo\" && tg.DatabaseSpec.Kind != \"sql\") {\n\t\treturn errors.New(\" Databas type (DB) must be mongo | sql \")\n\t}\n\t// The following are supported types\n\tbasicSupportedTypes := []string{\"bool\", \"string\", \"int\", \"int8\", \"int16\", \"int32\", \"int64\", \"uint\", \"uint8\", \"uint16\", \"uint32\", \"uint64\", \"float32\", \"float64\"}\n\n\t// checking duplicate models and fields\n\tmodelMap := make(map[string]string)\n\tfor i, m := range tg.Models {\n\t\t_, ok := modelMap[strings.ToLower(m.Name)]\n\t\tif ok {\n\t\t\treturn errors.New(\" Duplicate model names:\" + m.Name)\n\t\t}\n\t\tmodelMap[strings.ToLower(m.Name)] = \"noted\"\n\t\tfieldMap := make(map[string]string)\n\t\tfor _, f := range m.Fields {\n\t\t\t_, ok := fieldMap[strings.ToLower(f.Name)]\n\t\t\tif ok {\n\t\t\t\treturn errors.New(\" Duplicate field names:\" + f.Name)\n\t\t\t}\n\t\t\tfieldMap[strings.ToLower(f.Name)] = \"noted\"\n\n\t\t\t// Validate field types\n\t\t\tif !strings.Contains(strings.Join(basicSupportedTypes, \",\"), strings.ToLower(f.Type)) {\n\t\t\t\treturn errors.New(\"Not supported field type:\" + f.Type)\n\t\t\t}\n\t\t}\n\t\tif tg.DatabaseSpec.Kind == \"mongo\" {\n\t\t\t_, ok := fieldMap[\"id\"]\n\t\t\tif !ok {\n\t\t\t\tid := Field{Name: \"ID\", Type: \"string\"}\n\t\t\t\ttg.Models[i].Fields = append(tg.Models[i].Fields, id)\n\t\t\t}\n\t\t\t//\tif ok{\n\t\t\t// todo if the type of the field for id is not string .. it has to be string\n\t\t\t//\t}\n\t\t}\n\t\tif tg.DatabaseSpec.Kind == \"sql\" {\n\t\t\t_, ok := fieldMap[\"id\"]\n\t\t\tif !ok {\n\t\t\t\tid := Field{Name: \"ID\", Type: \"int\"}\n\t\t\t\ttg.Models[i].Fields = append(tg.Models[i].Fields, id)\n\t\t\t}\n\t\t\t//\tif ok{\n\t\t\t// todo if the type of the field for id is not int .. it has to be int\n\t\t\t//\t}\n\t\t}\n\t}\n\n\treturn err\n}", "title": "" }, { "docid": "ebf83881b4647429c4ffc009f3d18126", "score": "0.56286216", "text": "func (fm *FieldModelStructSimple) Verify() bool { return fm.VerifyType(true) }", "title": "" }, { "docid": "1707e8aad55180fd9c0de8a4b80d38a7", "score": "0.562821", "text": "func (s *CreateCollaborationInput) Validate() error {\n\tinvalidParams := request.ErrInvalidParams{Context: \"CreateCollaborationInput\"}\n\tif s.CreatorDisplayName == nil {\n\t\tinvalidParams.Add(request.NewErrParamRequired(\"CreatorDisplayName\"))\n\t}\n\tif s.CreatorDisplayName != nil && len(*s.CreatorDisplayName) < 1 {\n\t\tinvalidParams.Add(request.NewErrParamMinLen(\"CreatorDisplayName\", 1))\n\t}\n\tif s.CreatorMemberAbilities == nil {\n\t\tinvalidParams.Add(request.NewErrParamRequired(\"CreatorMemberAbilities\"))\n\t}\n\tif s.Description == nil {\n\t\tinvalidParams.Add(request.NewErrParamRequired(\"Description\"))\n\t}\n\tif s.Description != nil && len(*s.Description) < 1 {\n\t\tinvalidParams.Add(request.NewErrParamMinLen(\"Description\", 1))\n\t}\n\tif s.Members == nil {\n\t\tinvalidParams.Add(request.NewErrParamRequired(\"Members\"))\n\t}\n\tif s.Name == nil {\n\t\tinvalidParams.Add(request.NewErrParamRequired(\"Name\"))\n\t}\n\tif s.Name != nil && len(*s.Name) < 1 {\n\t\tinvalidParams.Add(request.NewErrParamMinLen(\"Name\", 1))\n\t}\n\tif s.QueryLogStatus == nil {\n\t\tinvalidParams.Add(request.NewErrParamRequired(\"QueryLogStatus\"))\n\t}\n\tif s.DataEncryptionMetadata != nil {\n\t\tif err := s.DataEncryptionMetadata.Validate(); err != nil {\n\t\t\tinvalidParams.AddNested(\"DataEncryptionMetadata\", err.(request.ErrInvalidParams))\n\t\t}\n\t}\n\tif s.Members != nil {\n\t\tfor i, v := range s.Members {\n\t\t\tif v == nil {\n\t\t\t\tcontinue\n\t\t\t}\n\t\t\tif err := v.Validate(); err != nil {\n\t\t\t\tinvalidParams.AddNested(fmt.Sprintf(\"%s[%v]\", \"Members\", i), err.(request.ErrInvalidParams))\n\t\t\t}\n\t\t}\n\t}\n\n\tif invalidParams.Len() > 0 {\n\t\treturn invalidParams\n\t}\n\treturn nil\n}", "title": "" }, { "docid": "b458547742077a3f932abcf6521bdab5", "score": "0.5625451", "text": "func (status Status) Validate() error {\n\treturn validation.ValidateStruct(&status,\n\t\tvalidation.Field(&status.MerchantCode, validation.Required),\n\t\tvalidation.Field(&status.MerchantRefNum, validation.Required),\n\t)\n}", "title": "" }, { "docid": "d199811ffc86e7a420802ed62c3c6f82", "score": "0.5618533", "text": "func (m *User) ValidateFields(paths ...string) error {\n\tif m == nil {\n\t\treturn nil\n\t}\n\n\tif len(paths) == 0 {\n\t\tpaths = UserFieldPathsNested\n\t}\n\n\tfor name, subs := range _processPaths(append(paths[:0:0], paths...)) {\n\t\t_ = subs\n\t\tswitch name {\n\t\tcase \"ids\":\n\n\t\t\tif m.GetIds() == nil {\n\t\t\t\treturn UserValidationError{\n\t\t\t\t\tfield: \"ids\",\n\t\t\t\t\treason: \"value is required\",\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tif v, ok := interface{}(m.GetIds()).(interface{ ValidateFields(...string) error }); ok {\n\t\t\t\tif err := v.ValidateFields(subs...); err != nil {\n\t\t\t\t\treturn UserValidationError{\n\t\t\t\t\t\tfield: \"ids\",\n\t\t\t\t\t\treason: \"embedded message failed validation\",\n\t\t\t\t\t\tcause: err,\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\n\t\tcase \"created_at\":\n\n\t\t\tif v, ok := interface{}(m.GetCreatedAt()).(interface{ ValidateFields(...string) error }); ok {\n\t\t\t\tif err := v.ValidateFields(subs...); err != nil {\n\t\t\t\t\treturn UserValidationError{\n\t\t\t\t\t\tfield: \"created_at\",\n\t\t\t\t\t\treason: \"embedded message failed validation\",\n\t\t\t\t\t\tcause: err,\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\n\t\tcase \"updated_at\":\n\n\t\t\tif v, ok := interface{}(m.GetUpdatedAt()).(interface{ ValidateFields(...string) error }); ok {\n\t\t\t\tif err := v.ValidateFields(subs...); err != nil {\n\t\t\t\t\treturn UserValidationError{\n\t\t\t\t\t\tfield: \"updated_at\",\n\t\t\t\t\t\treason: \"embedded message failed validation\",\n\t\t\t\t\t\tcause: err,\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\n\t\tcase \"deleted_at\":\n\n\t\t\tif v, ok := interface{}(m.GetDeletedAt()).(interface{ ValidateFields(...string) error }); ok {\n\t\t\t\tif err := v.ValidateFields(subs...); err != nil {\n\t\t\t\t\treturn UserValidationError{\n\t\t\t\t\t\tfield: \"deleted_at\",\n\t\t\t\t\t\treason: \"embedded message failed validation\",\n\t\t\t\t\t\tcause: err,\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\n\t\tcase \"name\":\n\n\t\t\tif utf8.RuneCountInString(m.GetName()) > 50 {\n\t\t\t\treturn UserValidationError{\n\t\t\t\t\tfield: \"name\",\n\t\t\t\t\treason: \"value length must be at most 50 runes\",\n\t\t\t\t}\n\t\t\t}\n\n\t\tcase \"description\":\n\n\t\t\tif utf8.RuneCountInString(m.GetDescription()) > 2000 {\n\t\t\t\treturn UserValidationError{\n\t\t\t\t\tfield: \"description\",\n\t\t\t\t\treason: \"value length must be at most 2000 runes\",\n\t\t\t\t}\n\t\t\t}\n\n\t\tcase \"attributes\":\n\n\t\t\tif len(m.GetAttributes()) > 10 {\n\t\t\t\treturn UserValidationError{\n\t\t\t\t\tfield: \"attributes\",\n\t\t\t\t\treason: \"value must contain no more than 10 pair(s)\",\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tfor key, val := range m.GetAttributes() {\n\t\t\t\t_ = val\n\n\t\t\t\tif utf8.RuneCountInString(key) > 36 {\n\t\t\t\t\treturn UserValidationError{\n\t\t\t\t\t\tfield: fmt.Sprintf(\"attributes[%v]\", key),\n\t\t\t\t\t\treason: \"value length must be at most 36 runes\",\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\tif !_User_Attributes_Pattern.MatchString(key) {\n\t\t\t\t\treturn UserValidationError{\n\t\t\t\t\t\tfield: fmt.Sprintf(\"attributes[%v]\", key),\n\t\t\t\t\t\treason: \"value does not match regex pattern \\\"^[a-z0-9](?:[-]?[a-z0-9]){2,}$\\\"\",\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\tif utf8.RuneCountInString(val) > 200 {\n\t\t\t\t\treturn UserValidationError{\n\t\t\t\t\t\tfield: fmt.Sprintf(\"attributes[%v]\", key),\n\t\t\t\t\t\treason: \"value length must be at most 200 runes\",\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t}\n\n\t\tcase \"contact_info\":\n\n\t\t\tif len(m.GetContactInfo()) > 10 {\n\t\t\t\treturn UserValidationError{\n\t\t\t\t\tfield: \"contact_info\",\n\t\t\t\t\treason: \"value must contain no more than 10 item(s)\",\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tfor idx, item := range m.GetContactInfo() {\n\t\t\t\t_, _ = idx, item\n\n\t\t\t\tif v, ok := interface{}(item).(interface{ ValidateFields(...string) error }); ok {\n\t\t\t\t\tif err := v.ValidateFields(subs...); err != nil {\n\t\t\t\t\t\treturn UserValidationError{\n\t\t\t\t\t\t\tfield: fmt.Sprintf(\"contact_info[%v]\", idx),\n\t\t\t\t\t\t\treason: \"embedded message failed validation\",\n\t\t\t\t\t\t\tcause: err,\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t}\n\n\t\tcase \"primary_email_address\":\n\n\t\t\tif err := m._validateEmail(m.GetPrimaryEmailAddress()); err != nil {\n\t\t\t\treturn UserValidationError{\n\t\t\t\t\tfield: \"primary_email_address\",\n\t\t\t\t\treason: \"value must be a valid email address\",\n\t\t\t\t\tcause: err,\n\t\t\t\t}\n\t\t\t}\n\n\t\tcase \"primary_email_address_validated_at\":\n\n\t\t\tif v, ok := interface{}(m.GetPrimaryEmailAddressValidatedAt()).(interface{ ValidateFields(...string) error }); ok {\n\t\t\t\tif err := v.ValidateFields(subs...); err != nil {\n\t\t\t\t\treturn UserValidationError{\n\t\t\t\t\t\tfield: \"primary_email_address_validated_at\",\n\t\t\t\t\t\treason: \"embedded message failed validation\",\n\t\t\t\t\t\tcause: err,\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\n\t\tcase \"password\":\n\n\t\t\tif utf8.RuneCountInString(m.GetPassword()) > 1000 {\n\t\t\t\treturn UserValidationError{\n\t\t\t\t\tfield: \"password\",\n\t\t\t\t\treason: \"value length must be at most 1000 runes\",\n\t\t\t\t}\n\t\t\t}\n\n\t\tcase \"password_updated_at\":\n\n\t\t\tif v, ok := interface{}(m.GetPasswordUpdatedAt()).(interface{ ValidateFields(...string) error }); ok {\n\t\t\t\tif err := v.ValidateFields(subs...); err != nil {\n\t\t\t\t\treturn UserValidationError{\n\t\t\t\t\t\tfield: \"password_updated_at\",\n\t\t\t\t\t\treason: \"embedded message failed validation\",\n\t\t\t\t\t\tcause: err,\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\n\t\tcase \"require_password_update\":\n\t\t\t// no validation rules for RequirePasswordUpdate\n\t\tcase \"state\":\n\n\t\t\tif _, ok := State_name[int32(m.GetState())]; !ok {\n\t\t\t\treturn UserValidationError{\n\t\t\t\t\tfield: \"state\",\n\t\t\t\t\treason: \"value must be one of the defined enum values\",\n\t\t\t\t}\n\t\t\t}\n\n\t\tcase \"state_description\":\n\n\t\t\tif utf8.RuneCountInString(m.GetStateDescription()) > 128 {\n\t\t\t\treturn UserValidationError{\n\t\t\t\t\tfield: \"state_description\",\n\t\t\t\t\treason: \"value length must be at most 128 runes\",\n\t\t\t\t}\n\t\t\t}\n\n\t\tcase \"admin\":\n\t\t\t// no validation rules for Admin\n\t\tcase \"temporary_password\":\n\n\t\t\tif utf8.RuneCountInString(m.GetTemporaryPassword()) > 1000 {\n\t\t\t\treturn UserValidationError{\n\t\t\t\t\tfield: \"temporary_password\",\n\t\t\t\t\treason: \"value length must be at most 1000 runes\",\n\t\t\t\t}\n\t\t\t}\n\n\t\tcase \"temporary_password_created_at\":\n\n\t\t\tif v, ok := interface{}(m.GetTemporaryPasswordCreatedAt()).(interface{ ValidateFields(...string) error }); ok {\n\t\t\t\tif err := v.ValidateFields(subs...); err != nil {\n\t\t\t\t\treturn UserValidationError{\n\t\t\t\t\t\tfield: \"temporary_password_created_at\",\n\t\t\t\t\t\treason: \"embedded message failed validation\",\n\t\t\t\t\t\tcause: err,\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\n\t\tcase \"temporary_password_expires_at\":\n\n\t\t\tif v, ok := interface{}(m.GetTemporaryPasswordExpiresAt()).(interface{ ValidateFields(...string) error }); ok {\n\t\t\t\tif err := v.ValidateFields(subs...); err != nil {\n\t\t\t\t\treturn UserValidationError{\n\t\t\t\t\t\tfield: \"temporary_password_expires_at\",\n\t\t\t\t\t\treason: \"embedded message failed validation\",\n\t\t\t\t\t\tcause: err,\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\n\t\tcase \"profile_picture\":\n\n\t\t\tif v, ok := interface{}(m.GetProfilePicture()).(interface{ ValidateFields(...string) error }); ok {\n\t\t\t\tif err := v.ValidateFields(subs...); err != nil {\n\t\t\t\t\treturn UserValidationError{\n\t\t\t\t\t\tfield: \"profile_picture\",\n\t\t\t\t\t\treason: \"embedded message failed validation\",\n\t\t\t\t\t\tcause: err,\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\n\t\tdefault:\n\t\t\treturn UserValidationError{\n\t\t\t\tfield: name,\n\t\t\t\treason: \"invalid field path\",\n\t\t\t}\n\t\t}\n\t}\n\treturn nil\n}", "title": "" }, { "docid": "29cb2344a05fee6b3ebe747e5bf10ade", "score": "0.5618184", "text": "func (s *CreateDataSourceInput) Validate() error {\n\tinvalidParams := request.ErrInvalidParams{Context: \"CreateDataSourceInput\"}\n\tif s.ApiId == nil {\n\t\tinvalidParams.Add(request.NewErrParamRequired(\"ApiId\"))\n\t}\n\tif s.ApiId != nil && len(*s.ApiId) < 1 {\n\t\tinvalidParams.Add(request.NewErrParamMinLen(\"ApiId\", 1))\n\t}\n\tif s.Name == nil {\n\t\tinvalidParams.Add(request.NewErrParamRequired(\"Name\"))\n\t}\n\tif s.Name != nil && len(*s.Name) < 1 {\n\t\tinvalidParams.Add(request.NewErrParamMinLen(\"Name\", 1))\n\t}\n\tif s.Type == nil {\n\t\tinvalidParams.Add(request.NewErrParamRequired(\"Type\"))\n\t}\n\tif s.DynamodbConfig != nil {\n\t\tif err := s.DynamodbConfig.Validate(); err != nil {\n\t\t\tinvalidParams.AddNested(\"DynamodbConfig\", err.(request.ErrInvalidParams))\n\t\t}\n\t}\n\tif s.ElasticsearchConfig != nil {\n\t\tif err := s.ElasticsearchConfig.Validate(); err != nil {\n\t\t\tinvalidParams.AddNested(\"ElasticsearchConfig\", err.(request.ErrInvalidParams))\n\t\t}\n\t}\n\tif s.EventBridgeConfig != nil {\n\t\tif err := s.EventBridgeConfig.Validate(); err != nil {\n\t\t\tinvalidParams.AddNested(\"EventBridgeConfig\", err.(request.ErrInvalidParams))\n\t\t}\n\t}\n\tif s.HttpConfig != nil {\n\t\tif err := s.HttpConfig.Validate(); err != nil {\n\t\t\tinvalidParams.AddNested(\"HttpConfig\", err.(request.ErrInvalidParams))\n\t\t}\n\t}\n\tif s.LambdaConfig != nil {\n\t\tif err := s.LambdaConfig.Validate(); err != nil {\n\t\t\tinvalidParams.AddNested(\"LambdaConfig\", err.(request.ErrInvalidParams))\n\t\t}\n\t}\n\tif s.OpenSearchServiceConfig != nil {\n\t\tif err := s.OpenSearchServiceConfig.Validate(); err != nil {\n\t\t\tinvalidParams.AddNested(\"OpenSearchServiceConfig\", err.(request.ErrInvalidParams))\n\t\t}\n\t}\n\n\tif invalidParams.Len() > 0 {\n\t\treturn invalidParams\n\t}\n\treturn nil\n}", "title": "" }, { "docid": "ac0591c46df76d56735c94921c194fce", "score": "0.56064665", "text": "func (s *CreateResolverInput) Validate() error {\n\tinvalidParams := request.ErrInvalidParams{Context: \"CreateResolverInput\"}\n\tif s.ApiId == nil {\n\t\tinvalidParams.Add(request.NewErrParamRequired(\"ApiId\"))\n\t}\n\tif s.ApiId != nil && len(*s.ApiId) < 1 {\n\t\tinvalidParams.Add(request.NewErrParamMinLen(\"ApiId\", 1))\n\t}\n\tif s.Code != nil && len(*s.Code) < 1 {\n\t\tinvalidParams.Add(request.NewErrParamMinLen(\"Code\", 1))\n\t}\n\tif s.DataSourceName != nil && len(*s.DataSourceName) < 1 {\n\t\tinvalidParams.Add(request.NewErrParamMinLen(\"DataSourceName\", 1))\n\t}\n\tif s.FieldName == nil {\n\t\tinvalidParams.Add(request.NewErrParamRequired(\"FieldName\"))\n\t}\n\tif s.FieldName != nil && len(*s.FieldName) < 1 {\n\t\tinvalidParams.Add(request.NewErrParamMinLen(\"FieldName\", 1))\n\t}\n\tif s.RequestMappingTemplate != nil && len(*s.RequestMappingTemplate) < 1 {\n\t\tinvalidParams.Add(request.NewErrParamMinLen(\"RequestMappingTemplate\", 1))\n\t}\n\tif s.ResponseMappingTemplate != nil && len(*s.ResponseMappingTemplate) < 1 {\n\t\tinvalidParams.Add(request.NewErrParamMinLen(\"ResponseMappingTemplate\", 1))\n\t}\n\tif s.TypeName == nil {\n\t\tinvalidParams.Add(request.NewErrParamRequired(\"TypeName\"))\n\t}\n\tif s.TypeName != nil && len(*s.TypeName) < 1 {\n\t\tinvalidParams.Add(request.NewErrParamMinLen(\"TypeName\", 1))\n\t}\n\tif s.CachingConfig != nil {\n\t\tif err := s.CachingConfig.Validate(); err != nil {\n\t\t\tinvalidParams.AddNested(\"CachingConfig\", err.(request.ErrInvalidParams))\n\t\t}\n\t}\n\tif s.Runtime != nil {\n\t\tif err := s.Runtime.Validate(); err != nil {\n\t\t\tinvalidParams.AddNested(\"Runtime\", err.(request.ErrInvalidParams))\n\t\t}\n\t}\n\n\tif invalidParams.Len() > 0 {\n\t\treturn invalidParams\n\t}\n\treturn nil\n}", "title": "" }, { "docid": "14e3ffd34f731694dd0d3f6de6fd64df", "score": "0.560271", "text": "func (opts *fieldOptions) validate(ctx *Context) error {\n\ttagError := func(class string) error {\n\t\treturn syntaxError(ctx,\n\t\t\t\"A tag must be specified when \\\"%s\\\" is used.\", class)\n\t}\n\tif opts.universal && opts.tag == nil {\n\t\treturn tagError(\"universal\")\n\t}\n\tif opts.application && opts.tag == nil {\n\t\treturn tagError(\"application\")\n\t}\n\treturn nil\n}", "title": "" }, { "docid": "7bb924e91457c2ea32aa0ca7a00bbffc", "score": "0.5597315", "text": "func (cv *CustomValidator) Validate(i interface{}) error {\n\t// cv.Init()\n\treturn cv.Validator.Struct(i)\n}", "title": "" }, { "docid": "58e436dfb03528e555c22f333ccc3ee9", "score": "0.5586385", "text": "func (m *AggregatedDutyCycleValue) ValidateFields(paths ...string) error {\n\tif m == nil {\n\t\treturn nil\n\t}\n\n\tif len(paths) == 0 {\n\t\tpaths = AggregatedDutyCycleValueFieldPathsNested\n\t}\n\n\tfor name, subs := range _processPaths(append(paths[:0:0], paths...)) {\n\t\t_ = subs\n\t\tswitch name {\n\t\tcase \"value\":\n\n\t\t\tif _, ok := AggregatedDutyCycle_name[int32(m.GetValue())]; !ok {\n\t\t\t\treturn AggregatedDutyCycleValueValidationError{\n\t\t\t\t\tfield: \"value\",\n\t\t\t\t\treason: \"value must be one of the defined enum values\",\n\t\t\t\t}\n\t\t\t}\n\n\t\tdefault:\n\t\t\treturn AggregatedDutyCycleValueValidationError{\n\t\t\t\tfield: name,\n\t\t\t\treason: \"invalid field path\",\n\t\t\t}\n\t\t}\n\t}\n\treturn nil\n}", "title": "" }, { "docid": "cc0c13cd3498597e1a73092e7f7afad6", "score": "0.558081", "text": "func (s *CreateTableInput) Validate() error {\n\tinvalidParams := request.ErrInvalidParams{Context: \"CreateTableInput\"}\n\tif s.CatalogId != nil && len(*s.CatalogId) < 1 {\n\t\tinvalidParams.Add(request.NewErrParamMinLen(\"CatalogId\", 1))\n\t}\n\tif s.DatabaseName == nil {\n\t\tinvalidParams.Add(request.NewErrParamRequired(\"DatabaseName\"))\n\t}\n\tif s.DatabaseName != nil && len(*s.DatabaseName) < 1 {\n\t\tinvalidParams.Add(request.NewErrParamMinLen(\"DatabaseName\", 1))\n\t}\n\tif s.TableInput == nil {\n\t\tinvalidParams.Add(request.NewErrParamRequired(\"TableInput\"))\n\t}\n\tif s.TransactionId != nil && len(*s.TransactionId) < 1 {\n\t\tinvalidParams.Add(request.NewErrParamMinLen(\"TransactionId\", 1))\n\t}\n\tif s.OpenTableFormatInput != nil {\n\t\tif err := s.OpenTableFormatInput.Validate(); err != nil {\n\t\t\tinvalidParams.AddNested(\"OpenTableFormatInput\", err.(request.ErrInvalidParams))\n\t\t}\n\t}\n\tif s.PartitionIndexes != nil {\n\t\tfor i, v := range s.PartitionIndexes {\n\t\t\tif v == nil {\n\t\t\t\tcontinue\n\t\t\t}\n\t\t\tif err := v.Validate(); err != nil {\n\t\t\t\tinvalidParams.AddNested(fmt.Sprintf(\"%s[%v]\", \"PartitionIndexes\", i), err.(request.ErrInvalidParams))\n\t\t\t}\n\t\t}\n\t}\n\tif s.TableInput != nil {\n\t\tif err := s.TableInput.Validate(); err != nil {\n\t\t\tinvalidParams.AddNested(\"TableInput\", err.(request.ErrInvalidParams))\n\t\t}\n\t}\n\n\tif invalidParams.Len() > 0 {\n\t\treturn invalidParams\n\t}\n\treturn nil\n}", "title": "" }, { "docid": "afabae04546a04078ba9428960eac107", "score": "0.55794144", "text": "func (s *UpdateDataSourceInput) Validate() error {\n\tinvalidParams := request.ErrInvalidParams{Context: \"UpdateDataSourceInput\"}\n\tif s.ApiId == nil {\n\t\tinvalidParams.Add(request.NewErrParamRequired(\"ApiId\"))\n\t}\n\tif s.ApiId != nil && len(*s.ApiId) < 1 {\n\t\tinvalidParams.Add(request.NewErrParamMinLen(\"ApiId\", 1))\n\t}\n\tif s.Name == nil {\n\t\tinvalidParams.Add(request.NewErrParamRequired(\"Name\"))\n\t}\n\tif s.Name != nil && len(*s.Name) < 1 {\n\t\tinvalidParams.Add(request.NewErrParamMinLen(\"Name\", 1))\n\t}\n\tif s.Type == nil {\n\t\tinvalidParams.Add(request.NewErrParamRequired(\"Type\"))\n\t}\n\tif s.DynamodbConfig != nil {\n\t\tif err := s.DynamodbConfig.Validate(); err != nil {\n\t\t\tinvalidParams.AddNested(\"DynamodbConfig\", err.(request.ErrInvalidParams))\n\t\t}\n\t}\n\tif s.ElasticsearchConfig != nil {\n\t\tif err := s.ElasticsearchConfig.Validate(); err != nil {\n\t\t\tinvalidParams.AddNested(\"ElasticsearchConfig\", err.(request.ErrInvalidParams))\n\t\t}\n\t}\n\tif s.EventBridgeConfig != nil {\n\t\tif err := s.EventBridgeConfig.Validate(); err != nil {\n\t\t\tinvalidParams.AddNested(\"EventBridgeConfig\", err.(request.ErrInvalidParams))\n\t\t}\n\t}\n\tif s.HttpConfig != nil {\n\t\tif err := s.HttpConfig.Validate(); err != nil {\n\t\t\tinvalidParams.AddNested(\"HttpConfig\", err.(request.ErrInvalidParams))\n\t\t}\n\t}\n\tif s.LambdaConfig != nil {\n\t\tif err := s.LambdaConfig.Validate(); err != nil {\n\t\t\tinvalidParams.AddNested(\"LambdaConfig\", err.(request.ErrInvalidParams))\n\t\t}\n\t}\n\tif s.OpenSearchServiceConfig != nil {\n\t\tif err := s.OpenSearchServiceConfig.Validate(); err != nil {\n\t\t\tinvalidParams.AddNested(\"OpenSearchServiceConfig\", err.(request.ErrInvalidParams))\n\t\t}\n\t}\n\n\tif invalidParams.Len() > 0 {\n\t\treturn invalidParams\n\t}\n\treturn nil\n}", "title": "" }, { "docid": "79b0f052bb8785d7bc467bb98cd36a7e", "score": "0.5573919", "text": "func Validate(model interface{}) Errors {\n\treturn validate(reflect.ValueOf(model))\n}", "title": "" }, { "docid": "905ca0dbfd94359e72e87632b89f5a17", "score": "0.5570425", "text": "func (m *Model18) Validate(formats strfmt.Registry) error {\n\tvar res []error\n\n\tif err := m.validateData(formats); err != nil {\n\t\tres = append(res, err)\n\t}\n\n\tif err := m.validateMatches(formats); err != nil {\n\t\tres = append(res, err)\n\t}\n\n\tif err := m.validateType(formats); err != nil {\n\t\tres = append(res, err)\n\t}\n\n\tif len(res) > 0 {\n\t\treturn errors.CompositeValidationError(res...)\n\t}\n\treturn nil\n}", "title": "" }, { "docid": "884a67621e5c86865ce07233a12623cf", "score": "0.55668795", "text": "func (s *CreateAccessInput) Validate() error {\n\tinvalidParams := request.ErrInvalidParams{Context: \"CreateAccessInput\"}\n\tif s.ExternalId == nil {\n\t\tinvalidParams.Add(request.NewErrParamRequired(\"ExternalId\"))\n\t}\n\tif s.ExternalId != nil && len(*s.ExternalId) < 1 {\n\t\tinvalidParams.Add(request.NewErrParamMinLen(\"ExternalId\", 1))\n\t}\n\tif s.HomeDirectoryMappings != nil && len(s.HomeDirectoryMappings) < 1 {\n\t\tinvalidParams.Add(request.NewErrParamMinLen(\"HomeDirectoryMappings\", 1))\n\t}\n\tif s.Role == nil {\n\t\tinvalidParams.Add(request.NewErrParamRequired(\"Role\"))\n\t}\n\tif s.Role != nil && len(*s.Role) < 20 {\n\t\tinvalidParams.Add(request.NewErrParamMinLen(\"Role\", 20))\n\t}\n\tif s.ServerId == nil {\n\t\tinvalidParams.Add(request.NewErrParamRequired(\"ServerId\"))\n\t}\n\tif s.ServerId != nil && len(*s.ServerId) < 19 {\n\t\tinvalidParams.Add(request.NewErrParamMinLen(\"ServerId\", 19))\n\t}\n\tif s.HomeDirectoryMappings != nil {\n\t\tfor i, v := range s.HomeDirectoryMappings {\n\t\t\tif v == nil {\n\t\t\t\tcontinue\n\t\t\t}\n\t\t\tif err := v.Validate(); err != nil {\n\t\t\t\tinvalidParams.AddNested(fmt.Sprintf(\"%s[%v]\", \"HomeDirectoryMappings\", i), err.(request.ErrInvalidParams))\n\t\t\t}\n\t\t}\n\t}\n\tif s.PosixProfile != nil {\n\t\tif err := s.PosixProfile.Validate(); err != nil {\n\t\t\tinvalidParams.AddNested(\"PosixProfile\", err.(request.ErrInvalidParams))\n\t\t}\n\t}\n\n\tif invalidParams.Len() > 0 {\n\t\treturn invalidParams\n\t}\n\treturn nil\n}", "title": "" }, { "docid": "bc7b6f849b7099ea41f1961d05e112d1", "score": "0.55598235", "text": "func (s *UpdateResolverInput) Validate() error {\n\tinvalidParams := request.ErrInvalidParams{Context: \"UpdateResolverInput\"}\n\tif s.ApiId == nil {\n\t\tinvalidParams.Add(request.NewErrParamRequired(\"ApiId\"))\n\t}\n\tif s.ApiId != nil && len(*s.ApiId) < 1 {\n\t\tinvalidParams.Add(request.NewErrParamMinLen(\"ApiId\", 1))\n\t}\n\tif s.Code != nil && len(*s.Code) < 1 {\n\t\tinvalidParams.Add(request.NewErrParamMinLen(\"Code\", 1))\n\t}\n\tif s.DataSourceName != nil && len(*s.DataSourceName) < 1 {\n\t\tinvalidParams.Add(request.NewErrParamMinLen(\"DataSourceName\", 1))\n\t}\n\tif s.FieldName == nil {\n\t\tinvalidParams.Add(request.NewErrParamRequired(\"FieldName\"))\n\t}\n\tif s.FieldName != nil && len(*s.FieldName) < 1 {\n\t\tinvalidParams.Add(request.NewErrParamMinLen(\"FieldName\", 1))\n\t}\n\tif s.RequestMappingTemplate != nil && len(*s.RequestMappingTemplate) < 1 {\n\t\tinvalidParams.Add(request.NewErrParamMinLen(\"RequestMappingTemplate\", 1))\n\t}\n\tif s.ResponseMappingTemplate != nil && len(*s.ResponseMappingTemplate) < 1 {\n\t\tinvalidParams.Add(request.NewErrParamMinLen(\"ResponseMappingTemplate\", 1))\n\t}\n\tif s.TypeName == nil {\n\t\tinvalidParams.Add(request.NewErrParamRequired(\"TypeName\"))\n\t}\n\tif s.TypeName != nil && len(*s.TypeName) < 1 {\n\t\tinvalidParams.Add(request.NewErrParamMinLen(\"TypeName\", 1))\n\t}\n\tif s.CachingConfig != nil {\n\t\tif err := s.CachingConfig.Validate(); err != nil {\n\t\t\tinvalidParams.AddNested(\"CachingConfig\", err.(request.ErrInvalidParams))\n\t\t}\n\t}\n\tif s.Runtime != nil {\n\t\tif err := s.Runtime.Validate(); err != nil {\n\t\t\tinvalidParams.AddNested(\"Runtime\", err.(request.ErrInvalidParams))\n\t\t}\n\t}\n\n\tif invalidParams.Len() > 0 {\n\t\treturn invalidParams\n\t}\n\treturn nil\n}", "title": "" }, { "docid": "d31749b615b5401864c3d68d6883bc17", "score": "0.5556252", "text": "func (doc Document) Validate() error {\n\tif err := doc.validateRequiredFields(); err != nil {\n\t\treturn err\n\t}\n\tif err := doc.validateOASVersion(); err != nil {\n\t\treturn err\n\t}\n\treturn doc.validateFields()\n}", "title": "" }, { "docid": "5dc26571d1cc465e4e08bfc49135ecb6", "score": "0.55561525", "text": "func (BeeStrategy) Validate(ctx context.Context, obj runtime.Object) field.ErrorList {\n\to := obj.(*insect.Bee)\n\tlog.Printf(\"Validating fields for Bee %s\\n\", o.Name)\n\terrors := field.ErrorList{}\n\t// perform validation here and add to errors using field.Invalid\n\treturn errors\n}", "title": "" }, { "docid": "3806b70ba9274f26db4f6e1074c91e8c", "score": "0.5554029", "text": "func (v *Validation) Valid(obj interface{}) (b bool, err error) {\n\tobjT := reflect.TypeOf(obj)\n\tobjV := reflect.ValueOf(obj)\n\tswitch {\n\tcase isStruct(objT):\n\tcase isStructPtr(objT):\n\t\tobjT = objT.Elem()\n\t\tobjV = objV.Elem()\n\tdefault:\n\t\terr = fmt.Errorf(\"%v must be a struct or a struct pointer\", obj)\n\t\treturn\n\t}\n\n\tfor i := 0; i < objT.NumField(); i++ {\n\t\tvar vfs []ValidFunc\n\t\tif vfs, err = getValidFuncs(objT.Field(i)); err != nil {\n\t\t\treturn\n\t\t}\n\n\t\tvar hasRequired bool\n\t\tfor _, vf := range vfs {\n\t\t\tif vf.Name == \"Required\" {\n\t\t\t\thasRequired = true\n\t\t\t}\n\n\t\t\tcurrentField := objV.Field(i).Interface()\n\t\t\tif objV.Field(i).Kind() == reflect.Ptr {\n\t\t\t\tif objV.Field(i).IsNil() {\n\t\t\t\t\tcurrentField = \"\"\n\t\t\t\t} else {\n\t\t\t\t\tcurrentField = objV.Field(i).Elem().Interface()\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tchk := Required{\"\"}.IsSatisfied(currentField)\n\t\t\tif !hasRequired && v.RequiredFirst && !chk {\n\t\t\t\tif _, ok := CanSkipFuncs[vf.Name]; ok {\n\t\t\t\t\tcontinue\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tif _, err = funcs.Call(vf.Name,\n\t\t\t\tmergeParam(v, objV.Field(i).Interface(), vf.Params)...); err != nil {\n\t\t\t\treturn\n\t\t\t}\n\t\t}\n\t}\n\n\tif !v.HasErrors() {\n\t\tif form, ok := obj.(ValidFormer); ok {\n\t\t\tform.Valid(v)\n\t\t}\n\t}\n\n\treturn !v.HasErrors(), nil\n}", "title": "" }, { "docid": "4ffed4340b221036c1dd6c3a3c5c8fc4", "score": "0.55526555", "text": "func (m Type1) Validate(formats strfmt.Registry) error {\n\tvar res []error\n\n\t// value enum\n\tif err := m.validateType1Enum(\"\", \"body\", m); err != nil {\n\t\treturn err\n\t}\n\n\tif len(res) > 0 {\n\t\treturn errors.CompositeValidationError(res...)\n\t}\n\treturn nil\n}", "title": "" }, { "docid": "b24206f307bd4d6205e00d043cb6ea27", "score": "0.55525726", "text": "func (a *RelationalModelDefinition) Validate() *dslengine.ValidationErrors {\n\tfmt.Println(\"Validating Model\")\n\tverr := new(dslengine.ValidationErrors)\n\tif a.ModelName == \"\" {\n\t\tverr.Add(a, \"model name not defined\")\n\t}\n\tif a.Parent == nil {\n\t\tverr.Add(a, \"missing relational store parent\")\n\t}\n\ta.IterateFields(func(field *RelationalFieldDefinition) error {\n\t\tverr.Merge(field.Validate())\n\t\treturn nil\n\t})\n\n\treturn verr.AsError()\n}", "title": "" }, { "docid": "489bbfef38195f2c72209be94524ce8d", "score": "0.5552324", "text": "func (u User) Validate() error {\n\treturn validation.ValidateStruct(&u,\n\t\tvalidation.Field(&u.Nome, validation.Required, validation.Length(0, 120)),\n\t\tvalidation.Field(&u.Usuario, validation.Required, validation.Length(0, 120)),\n\t)\n}", "title": "" }, { "docid": "28471f6855e8ae07c7476cb399ae1ae7", "score": "0.5550507", "text": "func (cv *CustomValidator) Validate(i interface{}) error {\n\treturn cv.Validator.Struct(i)\n}", "title": "" }, { "docid": "28471f6855e8ae07c7476cb399ae1ae7", "score": "0.5550507", "text": "func (cv *CustomValidator) Validate(i interface{}) error {\n\treturn cv.Validator.Struct(i)\n}", "title": "" }, { "docid": "781ba74530f6db7b248ed9631e6cedba", "score": "0.554914", "text": "func (o OrganizationRef) ValidateFields(validator validation.Validator) {\n\t// Require the Domain and Organization to be set\n\tif len(o.Domain) == 0 {\n\t\tvalidator.Required(\"Domain\")\n\t}\n\tif len(o.Organization) == 0 {\n\t\tvalidator.Required(\"Organization\")\n\t}\n}", "title": "" }, { "docid": "d7ba397bdca030a29f7af6f8efd5aa5a", "score": "0.5548598", "text": "func (m *GenerateDevAddrResponse) ValidateFields(paths ...string) error {\n\tif m == nil {\n\t\treturn nil\n\t}\n\n\tif len(paths) == 0 {\n\t\tpaths = GenerateDevAddrResponseFieldPathsNested\n\t}\n\n\tfor name, subs := range _processPaths(append(paths[:0:0], paths...)) {\n\t\t_ = subs\n\t\tswitch name {\n\t\tcase \"dev_addr\":\n\n\t\t\tif len(m.GetDevAddr()) > 0 {\n\n\t\t\t\tif len(m.GetDevAddr()) != 4 {\n\t\t\t\t\treturn GenerateDevAddrResponseValidationError{\n\t\t\t\t\t\tfield: \"dev_addr\",\n\t\t\t\t\t\treason: \"value length must be 4 bytes\",\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t}\n\n\t\tdefault:\n\t\t\treturn GenerateDevAddrResponseValidationError{\n\t\t\t\tfield: name,\n\t\t\t\treason: \"invalid field path\",\n\t\t\t}\n\t\t}\n\t}\n\treturn nil\n}", "title": "" }, { "docid": "4514ddcbdab199d035d3d0893b49bd6d", "score": "0.5544321", "text": "func (m *Details) Validate(formats strfmt.Registry) error {\n\tvar res []error\n\n\tif err := m.validateNorm(formats); err != nil {\n\t\tres = append(res, err)\n\t}\n\n\tif err := m.validatePeriod(formats); err != nil {\n\t\tres = append(res, err)\n\t}\n\n\tif err := m.validateScore(formats); err != nil {\n\t\tres = append(res, err)\n\t}\n\n\tif len(res) > 0 {\n\t\treturn errors.CompositeValidationError(res...)\n\t}\n\treturn nil\n}", "title": "" }, { "docid": "618b80d36d432ca89d85365f2d520cd0", "score": "0.5543062", "text": "func (s *Address) Validate() error {\n\tinvalidParams := request.ErrInvalidParams{Context: \"Address\"}\n\tif s.AddressLine1 == nil {\n\t\tinvalidParams.Add(request.NewErrParamRequired(\"AddressLine1\"))\n\t}\n\tif s.AddressLine1 != nil && len(*s.AddressLine1) < 1 {\n\t\tinvalidParams.Add(request.NewErrParamMinLen(\"AddressLine1\", 1))\n\t}\n\tif s.City == nil {\n\t\tinvalidParams.Add(request.NewErrParamRequired(\"City\"))\n\t}\n\tif s.City != nil && len(*s.City) < 1 {\n\t\tinvalidParams.Add(request.NewErrParamMinLen(\"City\", 1))\n\t}\n\tif s.ContactName != nil && len(*s.ContactName) < 1 {\n\t\tinvalidParams.Add(request.NewErrParamMinLen(\"ContactName\", 1))\n\t}\n\tif s.ContactPhoneNumber != nil && len(*s.ContactPhoneNumber) < 1 {\n\t\tinvalidParams.Add(request.NewErrParamMinLen(\"ContactPhoneNumber\", 1))\n\t}\n\tif s.CountryCode == nil {\n\t\tinvalidParams.Add(request.NewErrParamRequired(\"CountryCode\"))\n\t}\n\tif s.CountryCode != nil && len(*s.CountryCode) < 2 {\n\t\tinvalidParams.Add(request.NewErrParamMinLen(\"CountryCode\", 2))\n\t}\n\tif s.DistrictOrCounty != nil && len(*s.DistrictOrCounty) < 1 {\n\t\tinvalidParams.Add(request.NewErrParamMinLen(\"DistrictOrCounty\", 1))\n\t}\n\tif s.PostalCode == nil {\n\t\tinvalidParams.Add(request.NewErrParamRequired(\"PostalCode\"))\n\t}\n\tif s.PostalCode != nil && len(*s.PostalCode) < 1 {\n\t\tinvalidParams.Add(request.NewErrParamMinLen(\"PostalCode\", 1))\n\t}\n\tif s.StateOrRegion == nil {\n\t\tinvalidParams.Add(request.NewErrParamRequired(\"StateOrRegion\"))\n\t}\n\tif s.StateOrRegion != nil && len(*s.StateOrRegion) < 1 {\n\t\tinvalidParams.Add(request.NewErrParamMinLen(\"StateOrRegion\", 1))\n\t}\n\n\tif invalidParams.Len() > 0 {\n\t\treturn invalidParams\n\t}\n\treturn nil\n}", "title": "" }, { "docid": "12681bd5a96f8b48ac785d554ccd4b02", "score": "0.5534314", "text": "func (a Account) Validate() error {\n\treturn validation.ValidateStruct(&a,\n\t\tvalidation.Field(&a.Address, validation.Required),\n\t)\n}", "title": "" }, { "docid": "2b49628de3ff90fe381f14669cc26b59", "score": "0.5530551", "text": "func (l *Live) Validate() error {\n\tif l.ClusterClient() == nil {\n\t\treturn errors.New(\"cluster client is nil\")\n\t}\n\n\tif l.crdWatcher == nil {\n\t\treturn errors.New(\"crd watcher is nil\")\n\t}\n\n\tif l.logger == nil {\n\t\treturn errors.New(\"logger is nil\")\n\t}\n\n\tif l.moduleManager == nil {\n\t\treturn errors.New(\"module manager is nil\")\n\t}\n\n\tif l.objectStore == nil {\n\t\treturn errors.New(\"object store is nil\")\n\t}\n\n\tif l.pluginManager == nil {\n\t\treturn errors.New(\"plugin manager is nil\")\n\t}\n\n\tif l.portForwarder == nil {\n\t\treturn errors.New(\"port forwarder is nil\")\n\t}\n\n\treturn nil\n}", "title": "" }, { "docid": "bc92d7a6d5a20bc1c5abce8eb2ea1e5b", "score": "0.55270106", "text": "func Validate(schema interface{}, errors []map[string]interface{}) {\r\n\t/**\r\n\t * create validator instance\r\n\t */\r\n\t// NOTE: ommitting allot of error checking for brevity\r\n\r\n\t// this is usually know or extracted from http 'Accept-Language' header\r\n\t// also see uni.FindTranslator(...)\r\n\r\n\t// validate = validator.New()\r\n\tvalidate.RegisterTagNameFunc(func(fld reflect.StructField) string {\r\n\t\tname := strings.SplitN(fld.Tag.Get(\"json\"), \",\", 2)[0]\r\n\t\tif name == \"-\" {\r\n\t\t\treturn \"\"\r\n\t\t}\r\n\t\treturn name\r\n\t})\r\n\ten_translations.RegisterDefaultTranslations(validate, trans)\r\n\r\n\tif err := validate.Struct(schema); err != nil {\r\n\t\tif _, ok := err.(*validator.InvalidValidationError); ok {\r\n\t\t\terrors = append(errors, map[string]interface{}{\r\n\t\t\t\t\"message\": fmt.Sprint(err), \"flag\": \"INVALID_BODY\"},\r\n\t\t\t)\r\n\t\t}\r\n\r\n\t\tfor _, err := range err.(validator.ValidationErrors) {\r\n\t\t\terrors = append(errors, map[string]interface{}{\r\n\t\t\t\t\"field\": fmt.Sprint(err.Field()),\r\n\t\t\t\t\"message\": fmt.Sprint(err.Translate(trans)), \"flag\": \"INVALID_BODY\"},\r\n\t\t\t)\r\n\t\t}\r\n\t\texception.BadRequest(\"Validation error\", errors)\r\n\t}\r\n\tif errors != nil {\r\n\t\texception.BadRequest(\"Validation error\", errors)\r\n\t}\r\n}", "title": "" }, { "docid": "cbab7984d73879217be79484cfe3cd70", "score": "0.55236036", "text": "func (s *CreateMLTransformInput) Validate() error {\n\tinvalidParams := request.ErrInvalidParams{Context: \"CreateMLTransformInput\"}\n\tif s.GlueVersion != nil && len(*s.GlueVersion) < 1 {\n\t\tinvalidParams.Add(request.NewErrParamMinLen(\"GlueVersion\", 1))\n\t}\n\tif s.InputRecordTables == nil {\n\t\tinvalidParams.Add(request.NewErrParamRequired(\"InputRecordTables\"))\n\t}\n\tif s.Name == nil {\n\t\tinvalidParams.Add(request.NewErrParamRequired(\"Name\"))\n\t}\n\tif s.Name != nil && len(*s.Name) < 1 {\n\t\tinvalidParams.Add(request.NewErrParamMinLen(\"Name\", 1))\n\t}\n\tif s.Parameters == nil {\n\t\tinvalidParams.Add(request.NewErrParamRequired(\"Parameters\"))\n\t}\n\tif s.Role == nil {\n\t\tinvalidParams.Add(request.NewErrParamRequired(\"Role\"))\n\t}\n\tif s.Timeout != nil && *s.Timeout < 1 {\n\t\tinvalidParams.Add(request.NewErrParamMinValue(\"Timeout\", 1))\n\t}\n\tif s.InputRecordTables != nil {\n\t\tfor i, v := range s.InputRecordTables {\n\t\t\tif v == nil {\n\t\t\t\tcontinue\n\t\t\t}\n\t\t\tif err := v.Validate(); err != nil {\n\t\t\t\tinvalidParams.AddNested(fmt.Sprintf(\"%s[%v]\", \"InputRecordTables\", i), err.(request.ErrInvalidParams))\n\t\t\t}\n\t\t}\n\t}\n\tif s.Parameters != nil {\n\t\tif err := s.Parameters.Validate(); err != nil {\n\t\t\tinvalidParams.AddNested(\"Parameters\", err.(request.ErrInvalidParams))\n\t\t}\n\t}\n\tif s.TransformEncryption != nil {\n\t\tif err := s.TransformEncryption.Validate(); err != nil {\n\t\t\tinvalidParams.AddNested(\"TransformEncryption\", err.(request.ErrInvalidParams))\n\t\t}\n\t}\n\n\tif invalidParams.Len() > 0 {\n\t\treturn invalidParams\n\t}\n\treturn nil\n}", "title": "" }, { "docid": "bf20348b0ede5b833d5b6b2c59d2e0ff", "score": "0.55235684", "text": "func (s *UpdatePipeSourceParameters) Validate() error {\n\tinvalidParams := request.ErrInvalidParams{Context: \"UpdatePipeSourceParameters\"}\n\tif s.ActiveMQBrokerParameters != nil {\n\t\tif err := s.ActiveMQBrokerParameters.Validate(); err != nil {\n\t\t\tinvalidParams.AddNested(\"ActiveMQBrokerParameters\", err.(request.ErrInvalidParams))\n\t\t}\n\t}\n\tif s.DynamoDBStreamParameters != nil {\n\t\tif err := s.DynamoDBStreamParameters.Validate(); err != nil {\n\t\t\tinvalidParams.AddNested(\"DynamoDBStreamParameters\", err.(request.ErrInvalidParams))\n\t\t}\n\t}\n\tif s.KinesisStreamParameters != nil {\n\t\tif err := s.KinesisStreamParameters.Validate(); err != nil {\n\t\t\tinvalidParams.AddNested(\"KinesisStreamParameters\", err.(request.ErrInvalidParams))\n\t\t}\n\t}\n\tif s.ManagedStreamingKafkaParameters != nil {\n\t\tif err := s.ManagedStreamingKafkaParameters.Validate(); err != nil {\n\t\t\tinvalidParams.AddNested(\"ManagedStreamingKafkaParameters\", err.(request.ErrInvalidParams))\n\t\t}\n\t}\n\tif s.RabbitMQBrokerParameters != nil {\n\t\tif err := s.RabbitMQBrokerParameters.Validate(); err != nil {\n\t\t\tinvalidParams.AddNested(\"RabbitMQBrokerParameters\", err.(request.ErrInvalidParams))\n\t\t}\n\t}\n\tif s.SelfManagedKafkaParameters != nil {\n\t\tif err := s.SelfManagedKafkaParameters.Validate(); err != nil {\n\t\t\tinvalidParams.AddNested(\"SelfManagedKafkaParameters\", err.(request.ErrInvalidParams))\n\t\t}\n\t}\n\tif s.SqsQueueParameters != nil {\n\t\tif err := s.SqsQueueParameters.Validate(); err != nil {\n\t\t\tinvalidParams.AddNested(\"SqsQueueParameters\", err.(request.ErrInvalidParams))\n\t\t}\n\t}\n\n\tif invalidParams.Len() > 0 {\n\t\treturn invalidParams\n\t}\n\treturn nil\n}", "title": "" }, { "docid": "2f6b7009e0b5dbc01dbfabacb5c374ae", "score": "0.55224", "text": "func (p *PaymentType) Validate() error {\n\tif p.Name == \"\" || len(p.Name) > 255 {\n\t\treturn errors.New(\"Name incorrect\")\n\t}\n\treturn nil\n}", "title": "" }, { "docid": "632e9af6e8ab4dba41fd50eb5871ae1d", "score": "0.5521497", "text": "func (v *Validation) Validate(i interface{}) ValidationErrors {\n\n\t// Custom validate struct to wrap validation errors that expose field error\n\tvErr := v.validate.Struct(i)\n\tif vErr != nil {\n\t\tvar returnErrs []ValidationError\n\t\tfor _, err := range vErr.(validator.ValidationErrors) {\n\t\t\tve := ValidationError{err.(validator.FieldError)}\n\t\t\treturnErrs = append(returnErrs, ve)\n\t\t}\n\t\treturn returnErrs\n\t}\n\n\treturn nil\n\n\t// vErr := v.validate.Struct(i).(validator.ValidationErrors)\n\n\t// if len(vErr) == 0 {\n\t// \treturn nil\n\t// }\n\n\t// var returnErrs []ValidationError\n\t// for _, err := range vErr {\n\t// \tve := ValidationError{err.(validator.FieldError)}\n\t// \treturnErrs = append(returnErrs, ve)\n\t// }\n\t// return returnErrs\n}", "title": "" }, { "docid": "ba0c472aa07f2ab85db7314c26e9e9a7", "score": "0.55146635", "text": "func TestModelFields(t *testing.T) {\r\n\t// Model fields\r\n\tif !checkStructProperties(\"Model\", \"Name\", \"string\") {\r\n\t\tt.Error(\"Did not define `Name` field in `Model` with the proper type\")\r\n\t}\r\n\r\n\tif !checkStructProperties(\"Model\", \"Feedback\", \"[]string\") {\r\n\t\tt.Error(\"Did not define `Feedback` field in `Model` with the proper type\")\r\n\t}\r\n}", "title": "" }, { "docid": "5f24fd179c93159141d1c60749e6b23f", "score": "0.55135447", "text": "func (s *CreatePipelineInput) Validate() error {\n\tinvalidParams := request.ErrInvalidParams{Context: \"CreatePipelineInput\"}\n\tif s.MaxUnits == nil {\n\t\tinvalidParams.Add(request.NewErrParamRequired(\"MaxUnits\"))\n\t}\n\tif s.MaxUnits != nil && *s.MaxUnits < 1 {\n\t\tinvalidParams.Add(request.NewErrParamMinValue(\"MaxUnits\", 1))\n\t}\n\tif s.MinUnits == nil {\n\t\tinvalidParams.Add(request.NewErrParamRequired(\"MinUnits\"))\n\t}\n\tif s.MinUnits != nil && *s.MinUnits < 1 {\n\t\tinvalidParams.Add(request.NewErrParamMinValue(\"MinUnits\", 1))\n\t}\n\tif s.PipelineConfigurationBody == nil {\n\t\tinvalidParams.Add(request.NewErrParamRequired(\"PipelineConfigurationBody\"))\n\t}\n\tif s.PipelineConfigurationBody != nil && len(*s.PipelineConfigurationBody) < 1 {\n\t\tinvalidParams.Add(request.NewErrParamMinLen(\"PipelineConfigurationBody\", 1))\n\t}\n\tif s.PipelineName == nil {\n\t\tinvalidParams.Add(request.NewErrParamRequired(\"PipelineName\"))\n\t}\n\tif s.PipelineName != nil && len(*s.PipelineName) < 3 {\n\t\tinvalidParams.Add(request.NewErrParamMinLen(\"PipelineName\", 3))\n\t}\n\tif s.LogPublishingOptions != nil {\n\t\tif err := s.LogPublishingOptions.Validate(); err != nil {\n\t\t\tinvalidParams.AddNested(\"LogPublishingOptions\", err.(request.ErrInvalidParams))\n\t\t}\n\t}\n\tif s.Tags != nil {\n\t\tfor i, v := range s.Tags {\n\t\t\tif v == nil {\n\t\t\t\tcontinue\n\t\t\t}\n\t\t\tif err := v.Validate(); err != nil {\n\t\t\t\tinvalidParams.AddNested(fmt.Sprintf(\"%s[%v]\", \"Tags\", i), err.(request.ErrInvalidParams))\n\t\t\t}\n\t\t}\n\t}\n\tif s.VpcOptions != nil {\n\t\tif err := s.VpcOptions.Validate(); err != nil {\n\t\t\tinvalidParams.AddNested(\"VpcOptions\", err.(request.ErrInvalidParams))\n\t\t}\n\t}\n\n\tif invalidParams.Len() > 0 {\n\t\treturn invalidParams\n\t}\n\treturn nil\n}", "title": "" }, { "docid": "71a79083d32bfccc2e2b6ed7951683bc", "score": "0.55133307", "text": "func (m *PropertyDTO) Validate(formats strfmt.Registry) error {\n\treturn nil\n}", "title": "" }, { "docid": "5fc1cdcba613e03340482703a0c511fd", "score": "0.5513264", "text": "func (a Account) Validate() error {\n\treturn validation.ValidateStruct(\n\t\t&a,\n\t\tvalidation.Field(&a.ID, validation.Required),\n\t\tvalidation.Field(&a.Email, validation.Required, is.Email),\n\t\tvalidation.Field(&a.LastRequestAt, validation.Required),\n\t)\n}", "title": "" }, { "docid": "6569790b6b88ba07e2e0f42e084b6230", "score": "0.55108494", "text": "func (s *UpdateAccessInput) Validate() error {\n\tinvalidParams := request.ErrInvalidParams{Context: \"UpdateAccessInput\"}\n\tif s.ExternalId == nil {\n\t\tinvalidParams.Add(request.NewErrParamRequired(\"ExternalId\"))\n\t}\n\tif s.ExternalId != nil && len(*s.ExternalId) < 1 {\n\t\tinvalidParams.Add(request.NewErrParamMinLen(\"ExternalId\", 1))\n\t}\n\tif s.HomeDirectoryMappings != nil && len(s.HomeDirectoryMappings) < 1 {\n\t\tinvalidParams.Add(request.NewErrParamMinLen(\"HomeDirectoryMappings\", 1))\n\t}\n\tif s.Role != nil && len(*s.Role) < 20 {\n\t\tinvalidParams.Add(request.NewErrParamMinLen(\"Role\", 20))\n\t}\n\tif s.ServerId == nil {\n\t\tinvalidParams.Add(request.NewErrParamRequired(\"ServerId\"))\n\t}\n\tif s.ServerId != nil && len(*s.ServerId) < 19 {\n\t\tinvalidParams.Add(request.NewErrParamMinLen(\"ServerId\", 19))\n\t}\n\tif s.HomeDirectoryMappings != nil {\n\t\tfor i, v := range s.HomeDirectoryMappings {\n\t\t\tif v == nil {\n\t\t\t\tcontinue\n\t\t\t}\n\t\t\tif err := v.Validate(); err != nil {\n\t\t\t\tinvalidParams.AddNested(fmt.Sprintf(\"%s[%v]\", \"HomeDirectoryMappings\", i), err.(request.ErrInvalidParams))\n\t\t\t}\n\t\t}\n\t}\n\tif s.PosixProfile != nil {\n\t\tif err := s.PosixProfile.Validate(); err != nil {\n\t\t\tinvalidParams.AddNested(\"PosixProfile\", err.(request.ErrInvalidParams))\n\t\t}\n\t}\n\n\tif invalidParams.Len() > 0 {\n\t\treturn invalidParams\n\t}\n\treturn nil\n}", "title": "" }, { "docid": "f28b012e80fa37515d2019f3fcb88da2", "score": "0.5507382", "text": "func (m *MetricType) Validate() error {\n\tif m == nil {\n\t\treturn nil\n\t}\n\n\t// no validation rules for Name\n\n\t// no validation rules for Description\n\n\t// no validation rules for Href\n\n\t// no validation rules for TypeId\n\n\treturn nil\n}", "title": "" }, { "docid": "ff08ec207d154ee01924006e16cdd9df", "score": "0.55024004", "text": "func (tv TypeValidator) Validate(msg Message) error {\n\tvs := tv.m[msg.MessageType()]\n\tif vs == nil {\n\t\treturn tv.defaultValidator.Validate(msg)\n\t}\n\n\treturn vs.Validate(msg)\n}", "title": "" }, { "docid": "66543f632903197935784dd62b3ca4c8", "score": "0.549579", "text": "func (v *Validator) Validate(i interface{}) error {\n\treturn v.validator.Struct(i)\n}", "title": "" }, { "docid": "d68b8d614c671095fd2072988ec32dac", "score": "0.54944515", "text": "func (pTypeDef *Rect) Validate() error {\n\tif pTypeDef.P1 == nil {\n\t\treturn fmt.Errorf(\"Rect: Missing required field: p1\")\n\t}\n\tif pTypeDef.P2 == nil {\n\t\treturn fmt.Errorf(\"Rect: Missing required field: p2\")\n\t}\n\treturn nil\n}", "title": "" }, { "docid": "bddec8ac61b4d4ccaf35e73eb7852462", "score": "0.5493673", "text": "func (v Validator) Validate() error {\n\tif len(v.Moniker) > 64 {\n\t\treturn ErrInvalidMonikerLength\n\t}\n\n\tif len(v.Website) > 64 {\n\t\treturn ErrInvalidWebsiteLength\n\t}\n\n\tif len(v.Social) > 64 {\n\t\treturn ErrInvalidSocialLength\n\t}\n\n\tif len(v.Identity) > 64 {\n\t\treturn ErrInvalidIdentityLength\n\t}\n\n\treturn nil\n}", "title": "" }, { "docid": "ec5b81264e4d4b2ad14681af10ff2f16", "score": "0.5493112", "text": "func (s *CreateImageBuilderInput) Validate() error {\n\tinvalidParams := request.ErrInvalidParams{Context: \"CreateImageBuilderInput\"}\n\tif s.AccessEndpoints != nil && len(s.AccessEndpoints) < 1 {\n\t\tinvalidParams.Add(request.NewErrParamMinLen(\"AccessEndpoints\", 1))\n\t}\n\tif s.AppstreamAgentVersion != nil && len(*s.AppstreamAgentVersion) < 1 {\n\t\tinvalidParams.Add(request.NewErrParamMinLen(\"AppstreamAgentVersion\", 1))\n\t}\n\tif s.ImageName != nil && len(*s.ImageName) < 1 {\n\t\tinvalidParams.Add(request.NewErrParamMinLen(\"ImageName\", 1))\n\t}\n\tif s.InstanceType == nil {\n\t\tinvalidParams.Add(request.NewErrParamRequired(\"InstanceType\"))\n\t}\n\tif s.InstanceType != nil && len(*s.InstanceType) < 1 {\n\t\tinvalidParams.Add(request.NewErrParamMinLen(\"InstanceType\", 1))\n\t}\n\tif s.Name == nil {\n\t\tinvalidParams.Add(request.NewErrParamRequired(\"Name\"))\n\t}\n\tif s.Tags != nil && len(s.Tags) < 1 {\n\t\tinvalidParams.Add(request.NewErrParamMinLen(\"Tags\", 1))\n\t}\n\tif s.AccessEndpoints != nil {\n\t\tfor i, v := range s.AccessEndpoints {\n\t\t\tif v == nil {\n\t\t\t\tcontinue\n\t\t\t}\n\t\t\tif err := v.Validate(); err != nil {\n\t\t\t\tinvalidParams.AddNested(fmt.Sprintf(\"%s[%v]\", \"AccessEndpoints\", i), err.(request.ErrInvalidParams))\n\t\t\t}\n\t\t}\n\t}\n\n\tif invalidParams.Len() > 0 {\n\t\treturn invalidParams\n\t}\n\treturn nil\n}", "title": "" }, { "docid": "462116fda8f3e7ae0162fd8de56b377f", "score": "0.549099", "text": "func (m APIType) Validate(formats strfmt.Registry) error {\n\tvar res []error\n\n\t// value enum\n\tif err := m.validateAPITypeEnum(\"\", \"body\", m); err != nil {\n\t\treturn err\n\t}\n\n\tif len(res) > 0 {\n\t\treturn errors.CompositeValidationError(res...)\n\t}\n\treturn nil\n}", "title": "" }, { "docid": "4c9fb936525c4727ab27cb011b6a2f4c", "score": "0.5490277", "text": "func (s *ColumnStatistics) Validate() error {\n\tinvalidParams := request.ErrInvalidParams{Context: \"ColumnStatistics\"}\n\tif s.AnalyzedTime == nil {\n\t\tinvalidParams.Add(request.NewErrParamRequired(\"AnalyzedTime\"))\n\t}\n\tif s.ColumnName == nil {\n\t\tinvalidParams.Add(request.NewErrParamRequired(\"ColumnName\"))\n\t}\n\tif s.ColumnName != nil && len(*s.ColumnName) < 1 {\n\t\tinvalidParams.Add(request.NewErrParamMinLen(\"ColumnName\", 1))\n\t}\n\tif s.ColumnType == nil {\n\t\tinvalidParams.Add(request.NewErrParamRequired(\"ColumnType\"))\n\t}\n\tif s.StatisticsData == nil {\n\t\tinvalidParams.Add(request.NewErrParamRequired(\"StatisticsData\"))\n\t}\n\tif s.StatisticsData != nil {\n\t\tif err := s.StatisticsData.Validate(); err != nil {\n\t\t\tinvalidParams.AddNested(\"StatisticsData\", err.(request.ErrInvalidParams))\n\t\t}\n\t}\n\n\tif invalidParams.Len() > 0 {\n\t\treturn invalidParams\n\t}\n\treturn nil\n}", "title": "" }, { "docid": "4a27e476ac92f398b62458320150c713", "score": "0.5489748", "text": "func (s *Join) Validate() error {\n\tinvalidParams := request.ErrInvalidParams{Context: \"Join\"}\n\tif s.Columns == nil {\n\t\tinvalidParams.Add(request.NewErrParamRequired(\"Columns\"))\n\t}\n\tif s.Columns != nil && len(s.Columns) < 2 {\n\t\tinvalidParams.Add(request.NewErrParamMinLen(\"Columns\", 2))\n\t}\n\tif s.Inputs == nil {\n\t\tinvalidParams.Add(request.NewErrParamRequired(\"Inputs\"))\n\t}\n\tif s.Inputs != nil && len(s.Inputs) < 2 {\n\t\tinvalidParams.Add(request.NewErrParamMinLen(\"Inputs\", 2))\n\t}\n\tif s.JoinType == nil {\n\t\tinvalidParams.Add(request.NewErrParamRequired(\"JoinType\"))\n\t}\n\tif s.Name == nil {\n\t\tinvalidParams.Add(request.NewErrParamRequired(\"Name\"))\n\t}\n\tif s.Columns != nil {\n\t\tfor i, v := range s.Columns {\n\t\t\tif v == nil {\n\t\t\t\tcontinue\n\t\t\t}\n\t\t\tif err := v.Validate(); err != nil {\n\t\t\t\tinvalidParams.AddNested(fmt.Sprintf(\"%s[%v]\", \"Columns\", i), err.(request.ErrInvalidParams))\n\t\t\t}\n\t\t}\n\t}\n\n\tif invalidParams.Len() > 0 {\n\t\treturn invalidParams\n\t}\n\treturn nil\n}", "title": "" }, { "docid": "2e424dfbb80ee8777065b41d5d1e4f83", "score": "0.54893047", "text": "func (s *TimestreamConfiguration) Validate() error {\n\tinvalidParams := request.ErrInvalidParams{Context: \"TimestreamConfiguration\"}\n\tif s.DatabaseName == nil {\n\t\tinvalidParams.Add(request.NewErrParamRequired(\"DatabaseName\"))\n\t}\n\tif s.DimensionMappings == nil {\n\t\tinvalidParams.Add(request.NewErrParamRequired(\"DimensionMappings\"))\n\t}\n\tif s.MixedMeasureMappings != nil && len(s.MixedMeasureMappings) < 1 {\n\t\tinvalidParams.Add(request.NewErrParamMinLen(\"MixedMeasureMappings\", 1))\n\t}\n\tif s.TableName == nil {\n\t\tinvalidParams.Add(request.NewErrParamRequired(\"TableName\"))\n\t}\n\tif s.TimeColumn == nil {\n\t\tinvalidParams.Add(request.NewErrParamRequired(\"TimeColumn\"))\n\t}\n\tif s.DimensionMappings != nil {\n\t\tfor i, v := range s.DimensionMappings {\n\t\t\tif v == nil {\n\t\t\t\tcontinue\n\t\t\t}\n\t\t\tif err := v.Validate(); err != nil {\n\t\t\t\tinvalidParams.AddNested(fmt.Sprintf(\"%s[%v]\", \"DimensionMappings\", i), err.(request.ErrInvalidParams))\n\t\t\t}\n\t\t}\n\t}\n\tif s.MixedMeasureMappings != nil {\n\t\tfor i, v := range s.MixedMeasureMappings {\n\t\t\tif v == nil {\n\t\t\t\tcontinue\n\t\t\t}\n\t\t\tif err := v.Validate(); err != nil {\n\t\t\t\tinvalidParams.AddNested(fmt.Sprintf(\"%s[%v]\", \"MixedMeasureMappings\", i), err.(request.ErrInvalidParams))\n\t\t\t}\n\t\t}\n\t}\n\tif s.MultiMeasureMappings != nil {\n\t\tif err := s.MultiMeasureMappings.Validate(); err != nil {\n\t\t\tinvalidParams.AddNested(\"MultiMeasureMappings\", err.(request.ErrInvalidParams))\n\t\t}\n\t}\n\n\tif invalidParams.Len() > 0 {\n\t\treturn invalidParams\n\t}\n\treturn nil\n}", "title": "" }, { "docid": "9ea284dd59816bb05f9f3d0468e20da0", "score": "0.5484582", "text": "func (s *ArtifactsConcatenationConfiguration) Validate() error {\n\tinvalidParams := request.ErrInvalidParams{Context: \"ArtifactsConcatenationConfiguration\"}\n\tif s.Audio == nil {\n\t\tinvalidParams.Add(request.NewErrParamRequired(\"Audio\"))\n\t}\n\tif s.CompositedVideo == nil {\n\t\tinvalidParams.Add(request.NewErrParamRequired(\"CompositedVideo\"))\n\t}\n\tif s.Content == nil {\n\t\tinvalidParams.Add(request.NewErrParamRequired(\"Content\"))\n\t}\n\tif s.DataChannel == nil {\n\t\tinvalidParams.Add(request.NewErrParamRequired(\"DataChannel\"))\n\t}\n\tif s.MeetingEvents == nil {\n\t\tinvalidParams.Add(request.NewErrParamRequired(\"MeetingEvents\"))\n\t}\n\tif s.TranscriptionMessages == nil {\n\t\tinvalidParams.Add(request.NewErrParamRequired(\"TranscriptionMessages\"))\n\t}\n\tif s.Video == nil {\n\t\tinvalidParams.Add(request.NewErrParamRequired(\"Video\"))\n\t}\n\tif s.Audio != nil {\n\t\tif err := s.Audio.Validate(); err != nil {\n\t\t\tinvalidParams.AddNested(\"Audio\", err.(request.ErrInvalidParams))\n\t\t}\n\t}\n\tif s.CompositedVideo != nil {\n\t\tif err := s.CompositedVideo.Validate(); err != nil {\n\t\t\tinvalidParams.AddNested(\"CompositedVideo\", err.(request.ErrInvalidParams))\n\t\t}\n\t}\n\tif s.Content != nil {\n\t\tif err := s.Content.Validate(); err != nil {\n\t\t\tinvalidParams.AddNested(\"Content\", err.(request.ErrInvalidParams))\n\t\t}\n\t}\n\tif s.DataChannel != nil {\n\t\tif err := s.DataChannel.Validate(); err != nil {\n\t\t\tinvalidParams.AddNested(\"DataChannel\", err.(request.ErrInvalidParams))\n\t\t}\n\t}\n\tif s.MeetingEvents != nil {\n\t\tif err := s.MeetingEvents.Validate(); err != nil {\n\t\t\tinvalidParams.AddNested(\"MeetingEvents\", err.(request.ErrInvalidParams))\n\t\t}\n\t}\n\tif s.TranscriptionMessages != nil {\n\t\tif err := s.TranscriptionMessages.Validate(); err != nil {\n\t\t\tinvalidParams.AddNested(\"TranscriptionMessages\", err.(request.ErrInvalidParams))\n\t\t}\n\t}\n\tif s.Video != nil {\n\t\tif err := s.Video.Validate(); err != nil {\n\t\t\tinvalidParams.AddNested(\"Video\", err.(request.ErrInvalidParams))\n\t\t}\n\t}\n\n\tif invalidParams.Len() > 0 {\n\t\treturn invalidParams\n\t}\n\treturn nil\n}", "title": "" }, { "docid": "c8679d677ccfb73f9e5ba256cbc0bd09", "score": "0.5484494", "text": "func (s *CreateUserInput) Validate() error {\n\tinvalidParams := request.ErrInvalidParams{Context: \"CreateUserInput\"}\n\tif s.HomeDirectoryMappings != nil && len(s.HomeDirectoryMappings) < 1 {\n\t\tinvalidParams.Add(request.NewErrParamMinLen(\"HomeDirectoryMappings\", 1))\n\t}\n\tif s.Role == nil {\n\t\tinvalidParams.Add(request.NewErrParamRequired(\"Role\"))\n\t}\n\tif s.Role != nil && len(*s.Role) < 20 {\n\t\tinvalidParams.Add(request.NewErrParamMinLen(\"Role\", 20))\n\t}\n\tif s.ServerId == nil {\n\t\tinvalidParams.Add(request.NewErrParamRequired(\"ServerId\"))\n\t}\n\tif s.ServerId != nil && len(*s.ServerId) < 19 {\n\t\tinvalidParams.Add(request.NewErrParamMinLen(\"ServerId\", 19))\n\t}\n\tif s.Tags != nil && len(s.Tags) < 1 {\n\t\tinvalidParams.Add(request.NewErrParamMinLen(\"Tags\", 1))\n\t}\n\tif s.UserName == nil {\n\t\tinvalidParams.Add(request.NewErrParamRequired(\"UserName\"))\n\t}\n\tif s.UserName != nil && len(*s.UserName) < 3 {\n\t\tinvalidParams.Add(request.NewErrParamMinLen(\"UserName\", 3))\n\t}\n\tif s.HomeDirectoryMappings != nil {\n\t\tfor i, v := range s.HomeDirectoryMappings {\n\t\t\tif v == nil {\n\t\t\t\tcontinue\n\t\t\t}\n\t\t\tif err := v.Validate(); err != nil {\n\t\t\t\tinvalidParams.AddNested(fmt.Sprintf(\"%s[%v]\", \"HomeDirectoryMappings\", i), err.(request.ErrInvalidParams))\n\t\t\t}\n\t\t}\n\t}\n\tif s.PosixProfile != nil {\n\t\tif err := s.PosixProfile.Validate(); err != nil {\n\t\t\tinvalidParams.AddNested(\"PosixProfile\", err.(request.ErrInvalidParams))\n\t\t}\n\t}\n\tif s.Tags != nil {\n\t\tfor i, v := range s.Tags {\n\t\t\tif v == nil {\n\t\t\t\tcontinue\n\t\t\t}\n\t\t\tif err := v.Validate(); err != nil {\n\t\t\t\tinvalidParams.AddNested(fmt.Sprintf(\"%s[%v]\", \"Tags\", i), err.(request.ErrInvalidParams))\n\t\t\t}\n\t\t}\n\t}\n\n\tif invalidParams.Len() > 0 {\n\t\treturn invalidParams\n\t}\n\treturn nil\n}", "title": "" }, { "docid": "30c77449707848cd84c112cd200bf9a6", "score": "0.54806316", "text": "func (s *PipeSourceParameters) Validate() error {\n\tinvalidParams := request.ErrInvalidParams{Context: \"PipeSourceParameters\"}\n\tif s.ActiveMQBrokerParameters != nil {\n\t\tif err := s.ActiveMQBrokerParameters.Validate(); err != nil {\n\t\t\tinvalidParams.AddNested(\"ActiveMQBrokerParameters\", err.(request.ErrInvalidParams))\n\t\t}\n\t}\n\tif s.DynamoDBStreamParameters != nil {\n\t\tif err := s.DynamoDBStreamParameters.Validate(); err != nil {\n\t\t\tinvalidParams.AddNested(\"DynamoDBStreamParameters\", err.(request.ErrInvalidParams))\n\t\t}\n\t}\n\tif s.KinesisStreamParameters != nil {\n\t\tif err := s.KinesisStreamParameters.Validate(); err != nil {\n\t\t\tinvalidParams.AddNested(\"KinesisStreamParameters\", err.(request.ErrInvalidParams))\n\t\t}\n\t}\n\tif s.ManagedStreamingKafkaParameters != nil {\n\t\tif err := s.ManagedStreamingKafkaParameters.Validate(); err != nil {\n\t\t\tinvalidParams.AddNested(\"ManagedStreamingKafkaParameters\", err.(request.ErrInvalidParams))\n\t\t}\n\t}\n\tif s.RabbitMQBrokerParameters != nil {\n\t\tif err := s.RabbitMQBrokerParameters.Validate(); err != nil {\n\t\t\tinvalidParams.AddNested(\"RabbitMQBrokerParameters\", err.(request.ErrInvalidParams))\n\t\t}\n\t}\n\tif s.SelfManagedKafkaParameters != nil {\n\t\tif err := s.SelfManagedKafkaParameters.Validate(); err != nil {\n\t\t\tinvalidParams.AddNested(\"SelfManagedKafkaParameters\", err.(request.ErrInvalidParams))\n\t\t}\n\t}\n\tif s.SqsQueueParameters != nil {\n\t\tif err := s.SqsQueueParameters.Validate(); err != nil {\n\t\t\tinvalidParams.AddNested(\"SqsQueueParameters\", err.(request.ErrInvalidParams))\n\t\t}\n\t}\n\n\tif invalidParams.Len() > 0 {\n\t\treturn invalidParams\n\t}\n\treturn nil\n}", "title": "" } ]
7f1c6b27b1eed7779a7e5a2c5d64aa1a
Bit24 alias of the RGB()
[ { "docid": "9638c5931655d72d760f6ef85092a5d0", "score": "0.8114112", "text": "func Bit24(r, g, b uint8, isBg ...bool) RGBColor { return RGB(r, g, b, isBg...) }", "title": "" } ]
[ { "docid": "176ddc39da8a8c8f262c4c829eed3bf0", "score": "0.72577673", "text": "func colorLayer24Bit(layerAlias string, foregroundColor int32, backgroundColor int32) {\n\tlayerEntry := memory.GetLayer(layerAlias)\n\tlayerEntry.DefaultAttribute.ForegroundColor = foregroundColor\n\tlayerEntry.DefaultAttribute.BackgroundColor = backgroundColor\n}", "title": "" }, { "docid": "33b8b13148d261133cc5217b77aa7861", "score": "0.63527066", "text": "func (s * Surface) RawBlendPixel24(x, y int, color uint32, alpha uint8) {\n format := s.surface.format \n rptr, gptr, bptr, aptr := s.pixelptr24(x, y)\n oldr := *rptr\n oldg := *gptr\n oldb := *bptr\n olda := *aptr\n colr := uint8((color >> uint32(format.Rshift)) & 0xff)\n colg := uint8((color >> uint32(format.Gshift)) & 0xff)\n colb := uint8((color >> uint32(format.Bshift)) & 0xff)\n cola := uint8((color >> uint32(format.Ashift)) & 0xff)\n newr := helpBlendComponent(oldr, colr, alpha)\n newg := helpBlendComponent(oldg, colg, alpha)\n newb := helpBlendComponent(oldb, colb, alpha)\n newa := helpBlendComponent(olda, cola, alpha)\n *rptr = uint8(newr)\n *gptr = uint8(newg)\n *bptr = uint8(newb)\n *aptr = uint8(newa) \n}", "title": "" }, { "docid": "ba8881a26741de54ecf78c186b8281f9", "score": "0.63435143", "text": "func (s * Surface) pixelptr24(x, y int) (*byte, *byte, *byte, *byte) {\n surface:= s.surface\n format := surface.format \n pixels := uintptr(ptr(surface.pixels))\n offset := uintptr(y*(int(surface.pitch)) + x*3)\n ptrbase:= pixels + offset\n rptr := (*uint8)(ptr(ptrbase + uintptr(format.Rshift >> 3))) \n gptr := (*uint8)(ptr(ptrbase + uintptr(format.Gshift >> 3)))\n bptr := (*uint8)(ptr(ptrbase + uintptr(format.Bshift >> 3)))\n aptr := (*uint8)(ptr(ptrbase + uintptr(format.Ashift >> 3)))\n return rptr, gptr, bptr, aptr\n}", "title": "" }, { "docid": "e5669d35764d4659da3a0d24144b5b97", "score": "0.62204593", "text": "func (s * Surface) RawGetPixel24(x, y int) (color uint32) {\n format := s.surface.format \n rptr, gptr, bptr, aptr := s.pixelptr24(x, y)\n color = uint32(*rptr) << uint32(format.Rshift)\n color |= uint32(*gptr) << uint32(format.Gshift)\n color |= uint32(*bptr) << uint32(format.Bshift)\n color |= uint32(*aptr) << uint32(format.Ashift)\n return color\n}", "title": "" }, { "docid": "961ac90d67b283eb69a437a2f8ba0391", "score": "0.61649185", "text": "func Alpha16RGBA(c color.Alpha16,) (uint32, uint32, uint32, uint32)", "title": "" }, { "docid": "883e1c5d25431c846b495f69db05ec3f", "score": "0.61546576", "text": "func (s * Surface) RawPutPixel24(x, y int, color uint32) {\n format := s.surface.format\n rptr, gptr, bptr, aptr := s.pixelptr24(x, y)\n *rptr = uint8(color >> uint32(format.Rshift))\n *gptr = uint8(color >> uint32(format.Gshift))\n *bptr = uint8(color >> uint32(format.Bshift))\n *aptr = uint8(color >> uint32(format.Ashift))\n}", "title": "" }, { "docid": "92ee50e0950809cd85b163f360c38071", "score": "0.6110777", "text": "func Gray16RGBA(c color.Gray16,) (uint32, uint32, uint32, uint32)", "title": "" }, { "docid": "6e6e7013bacab0233348f33e62ce7ca5", "score": "0.5671526", "text": "func CMYKToRGB(c, m, y, k uint8) (uint8, uint8, uint8)", "title": "" }, { "docid": "d49dce5f16abc5ca1644e6224a6aaf28", "score": "0.56324595", "text": "func (s * Surface) InGetPixel24(x, y int) (color uint32) {\n if s.PixelOutside(x, y) { return 0 }\n return s.RawGetPixel24(x, y)\n}", "title": "" }, { "docid": "636617a160bb7cddb9511a047a19f46a", "score": "0.56304604", "text": "func getUint24(b []byte) uint32 {\n\treturn uint32(b[0]) |\n\t\tuint32(b[1])<<8 |\n\t\tuint32(b[2])<<16\n}", "title": "" }, { "docid": "b23970bc32ad90e46b27f0b2c4381d57", "score": "0.5596917", "text": "func TrueColor(r, g, b uint8) Color { return trueColor{r, g, b} }", "title": "" }, { "docid": "5e9758b072c0ef579db631dc62448abe", "score": "0.5593425", "text": "func (format * PixelFormat) MapRGB(r, g, b uint8) uint32 {\n return mapRGB(format.format, r, g, b)\n}", "title": "" }, { "docid": "da0d5d23fe85b0a61f67c9dd805825ca", "score": "0.55587053", "text": "func ConvertPalette8ToPacked24(s, d *uint8, px int, p *uint8) {\n\tC.sws_convertPalette8ToPacked24((*C.uint8_t)(s), (*C.uint8_t)(d), C.int(px), (*C.uint8_t)(p))\n}", "title": "" }, { "docid": "f63026085bf40ede27ca386ad5b88dba", "score": "0.5556853", "text": "func (s * Surface) InBlendPixel24(x, y int, color uint32, alpha uint8) {\n if s.PixelOutside(x, y) { return }\n s.RawBlendPixel24(x, y, color, alpha)\n}", "title": "" }, { "docid": "7009014da153f886d9ecaa4199d99870", "score": "0.5545662", "text": "func (surface * Surface) MapRGB(r, g, b uint8) uint32 {\n return mapRGB(surface.surface.format, r, g, b)\n}", "title": "" }, { "docid": "ed17d70e6f09e75c53c5102f89ca645b", "score": "0.55267364", "text": "func (surface * Surface) BitsPerPixel() uint8 {\n return uint8(surface.surface.format.BitsPerPixel)\n}", "title": "" }, { "docid": "a2058ff8b66cfe363215316e3373e12b", "score": "0.5449518", "text": "func (c RGBColor) C16() Color { return c.Basic() }", "title": "" }, { "docid": "54c49ad2211caa6e6a450b25f5fb6fe3", "score": "0.5440137", "text": "func MapRGB(format *PixelFormat, r, g, b uint8) uint32 {\n\treturn (uint32)(C.SDL_MapRGB((*C.SDL_PixelFormat)(cast(format)), (C.Uint8)(r), (C.Uint8)(g), (C.Uint8)(b)))\n}", "title": "" }, { "docid": "dd9ab32e410c2ad70ca2ba0fb1d0fe99", "score": "0.541704", "text": "func (c SRGB8) RGBA() (r, g, b, a uint32) {\n\tr = uint32((float64(c.R) / float64(0xFF)) * float64(0xFFFF))\n\tg = uint32((float64(c.G) / float64(0xFF)) * float64(0xFFFF))\n\tb = uint32((float64(c.B) / float64(0xFF)) * float64(0xFFFF))\n\ta = uint32(0xFFFF)\n\treturn r, g, b, a\n}", "title": "" }, { "docid": "20efe006159b084d450a4c1bc606822e", "score": "0.5404233", "text": "func ColorLayerRGB(layerAlias string, foregroundRed int32, foregroundGreen int32, foregroundBlue int32, backgroundRed int32, backgroundGreen int32, backgroundBlue int32) {\n\tforegroundColor := GetRGBColor(foregroundRed, foregroundGreen, foregroundBlue)\n\tbackgroundColor := GetRGBColor(backgroundRed, backgroundGreen, backgroundBlue)\n\tcolorLayer24Bit(layerAlias, foregroundColor, backgroundColor)\n}", "title": "" }, { "docid": "a223573d381ff456706d069aa5fe7523", "score": "0.5403339", "text": "func (s * Surface) InPutPixel24(x, y int, color uint32) {\n if s.PixelOutside(x, y) { return }\n s.RawPutPixel24(x, y, color)\n}", "title": "" }, { "docid": "efa6fdc246f7384d1d6349082efd99ca", "score": "0.53454936", "text": "func RGB(r, g, b int) *Color {\n\treturn RGBA(r, g, b, 255)\n}", "title": "" }, { "docid": "02eeb61d4da162a2e3caf60f229f3fa5", "score": "0.5344978", "text": "func IntFromRGB(r, g, b int) int {\n return (r << 16) + (g << 8) + b\n}", "title": "" }, { "docid": "b8766fa5ad8ffca8c42259e7cf5bfea6", "score": "0.533778", "text": "func RGB(r, g, b uint8, isBg ...bool) RGBColor {\n\trgb := RGBColor{r, g, b}\n\tif len(isBg) > 0 && isBg[0] {\n\t\trgb[3] = AsBg\n\t}\n\n\treturn rgb\n}", "title": "" }, { "docid": "5691416aa7fea0173aae8dc4c6781942", "score": "0.53360426", "text": "func (atlas *Atlas) Format() uint32 {\n\treturn uint32(format.RGB888)\n}", "title": "" }, { "docid": "93e98ec7957dae6e94cc3fb5e09e88d0", "score": "0.5322352", "text": "func (i *Int24) Set(n int32) {\n\t(*i)[0], (*i)[1], (*i)[2] = byte(n&0xff), byte((n&0xff00)>>8), byte((n&0xff0000)>>16)\n}", "title": "" }, { "docid": "4b8b89b67d542099a66e0c2ac1ed37b9", "score": "0.53187543", "text": "func putUint24(b []byte, v uint32) {\n\tb[0] = byte(v)\n\tb[1] = byte(v >> 8)\n\tb[2] = byte(v >> 16)\n}", "title": "" }, { "docid": "a197a73509db6e2394cbb960ad93bd2f", "score": "0.52751714", "text": "func bigEndianUint24(raw []byte) uint32 {\n\tif len(raw) < 3 {\n\t\treturn 0\n\t}\n\n\trawCopy := make([]byte, 4)\n\tcopy(rawCopy[1:], raw)\n\treturn binary.BigEndian.Uint32(rawCopy)\n}", "title": "" }, { "docid": "e5d88c4788106249d337203886eee0f6", "score": "0.52622014", "text": "func RGBFromInt(clr int) (r int, g int, b int) {\n r = clr >> 16\n g = (clr - (r << 16)) >> 8\n b = clr - ((clr >> 8) << 8)\n return\n}", "title": "" }, { "docid": "65c4fc6e14041dcca27a4edd37e177a5", "score": "0.52613735", "text": "func (i Int24) Get() int32 {\n\tn := int32(i[0]) | int32(i[1])<<8 | int32(i[2])<<16\n\tif n&0x800000 != 0 {\n\t\tn |= ^0xffffff\n\t}\n\treturn n\n}", "title": "" }, { "docid": "5d07656243cb2f201e26debaa4403c1a", "score": "0.5258857", "text": "func GrayRGBA(c color.Gray,) (uint32, uint32, uint32, uint32)", "title": "" }, { "docid": "9521008e6f95c77cd9361bb69f6b4779", "score": "0.52503026", "text": "func (self Color) R() float32 {\n return float32(self.r)\n}", "title": "" }, { "docid": "ea29e27e1ce88a47f900ab5ec17887bd", "score": "0.52180445", "text": "func (s * Surface) ColorMasks() (uint32, uint32, uint32, uint32) {\n f := s.surface.format\n return uint32(f.Rmask), uint32(f.Gmask), \n uint32(f.Bmask), uint32(f.Amask)\n}", "title": "" }, { "docid": "64415fda4fe9a622c925b389feed4e1e", "score": "0.5210628", "text": "func (surface * Surface) GetRGB(color uint32) (r, g, b uint8) {\n return getRGB(surface.surface.format, color)\n}", "title": "" }, { "docid": "24b3356931555838f10757a8d141140b", "score": "0.5199242", "text": "func RGB(r, g, b int) *Color {\n\treturn &Color{r, g, b, OPAQUE, \"\"}\n}", "title": "" }, { "docid": "03480f7eb14ffdb8ab6027fb50480ed9", "score": "0.5192893", "text": "func (c SRGBnA8) RGBA() (r, g, b, a uint32) {\n\talpha := float64(c.A) / float64(0xFF)\n\tr = uint32(alpha * float64(c.A) * (float64(c.R) / float64(0xFF)) * float64(0xFFFF))\n\tg = uint32(alpha * float64(c.A) * (float64(c.G) / float64(0xFF)) * float64(0xFFFF))\n\tb = uint32(alpha * float64(c.A) * (float64(c.B) / float64(0xFF)) * float64(0xFFFF))\n\ta = uint32(alpha * float64(0xFFFF))\n\treturn r, g, b, a\n}", "title": "" }, { "docid": "869f53d33fd14d616a8933298d6ec122", "score": "0.51834697", "text": "func (c Color3uint8) Alias() types.Value {\n\treturn types.Color3(c)\n}", "title": "" }, { "docid": "1cffe447bdada1bbfad4220b204784d8", "score": "0.5183016", "text": "func GetRGBId2(ih Ihandle, name string, lin, col int) (r, g, b uint8) {\n\tc_name := C.CString(name)\n\tdefer C.free(unsafe.Pointer(c_name))\n\n\t//void IupGetRGBId2(Ihandle *ih, const char* name, int lin, int col, unsigned char *r, unsigned char *g, unsigned char *b);\n\tC.IupGetRGBId2(ih.ptr(), c_name, C.int(lin), C.int(col), (*C.uchar)(unsafe.Pointer(&r)), (*C.uchar)(unsafe.Pointer(&g)), (*C.uchar)(unsafe.Pointer(&b)))\n\treturn\n}", "title": "" }, { "docid": "19ef77ce0319b164049eef6f917c550f", "score": "0.5182262", "text": "func RGBToCMYK(r, g, b uint8) (uint8, uint8, uint8, uint8)", "title": "" }, { "docid": "25663d5b6da04e3244c0cb1609e9eca5", "score": "0.517039", "text": "func WriteUint24(u24 int) []byte {\n\treturn []byte{\n\t\tbyte((u24 & 0xff) >> 0),\n\t\tbyte((u24 & 0xff00) >> 8),\n\t\tbyte((u24 & 0xff0000) >> 16),\n\t}\n}", "title": "" }, { "docid": "6f9c86811c8c771174df19a595cc268d", "score": "0.515193", "text": "func RGBARGBA(c color.RGBA,) (uint32, uint32, uint32, uint32)", "title": "" }, { "docid": "5bbb84f245a1f69f266b2eb7e9e3feda", "score": "0.51440954", "text": "func (format * PixelFormat) GetRGB(color uint32) (r, g, b uint8) {\n return getRGB(format.format, color)\n}", "title": "" }, { "docid": "385922076e4db2545263eeea9fb48b94", "score": "0.51374346", "text": "func blend(bottom, top, topAlpha uint8) uint8 {\n\tif is16bit {\n\t\t// Version optimized for AVR.\n\t\tbottomPart := uint16(bottom) * uint16(255-topAlpha)\n\t\ttopPart := uint16(top) * uint16(topAlpha)\n\t\treturn uint8((bottomPart + topPart + 255) / 256)\n\t}\n\t// Version optimized for 32-bit and higher.\n\tbottomPart := int(bottom) * (255 - int(topAlpha))\n\ttopPart := int(top) * int(topAlpha)\n\treturn uint8((bottomPart + topPart + 255) / 256)\n}", "title": "" }, { "docid": "eb3155b5dd739df6685d38bcc4bf758d", "score": "0.5132827", "text": "func (surface * Surface) MapRGBA(r, g, b, a uint8) uint32 {\n return mapRGBA(surface.surface.format, r, g, b, a)\n}", "title": "" }, { "docid": "a0d385dc3c6c6acf7669dbbfff763143", "score": "0.5110263", "text": "func (p Uint24) AsInt() int {\n\treturn int(p[0])<<16 + int(p[1])<<8 + int(p[2])\n}", "title": "" }, { "docid": "acc4161f67eb13d301081108b6c0ecb7", "score": "0.51057935", "text": "func RGB(r, g, b float32) Color {\n\treturn Color{r, g, b, 1}\n}", "title": "" }, { "docid": "eecdad361f1a226ea627511e7f18f363", "score": "0.5097802", "text": "func (s * Surface) RawBlendPixel8(x, y int, \n color uint32, alpha uint8) { \n ptr := s.pixelptr8(x, y)\n old := uint32(*ptr)\n oldr, oldg, oldb := s.GetRGB(old)\n // Messing with the palette would probably be faster, \n // but it's cleaner to do it like this.\n colr, colg, colb := s.GetRGB(color)\n newr := helpBlendComponent(oldr, colr, alpha)\n newg := helpBlendComponent(oldg, colg, alpha)\n newb := helpBlendComponent(oldb, colb, alpha) \n newcol := s.MapRGB(newr, newg, newb)\n // And we have to do the same for the new color anyway, so... \n *ptr = uint8(newcol)\n}", "title": "" }, { "docid": "5ecc7532b1978eb79ce1153353f88a17", "score": "0.5096129", "text": "func (self Color) G() float32 {\n return float32(self.g)\n}", "title": "" }, { "docid": "7c14c5abb176f01d05cb1cead19ca7be", "score": "0.5094764", "text": "func GetRGB(ih Ihandle, name string) (r, g, b uint8) {\n\tc_name := C.CString(name)\n\tdefer C.free(unsafe.Pointer(c_name))\n\n\t//void IupGetRGB (Ihandle *ih, const char* name, unsigned char *r, unsigned char *g, unsigned char *b);\n\tC.IupGetRGB(ih.ptr(), c_name, (*C.uchar)(unsafe.Pointer(&r)), (*C.uchar)(unsafe.Pointer(&g)), (*C.uchar)(unsafe.Pointer(&b)))\n\treturn\n}", "title": "" }, { "docid": "b0aeb72ca6ecf139aef1cf055c1d6270", "score": "0.50940144", "text": "func (p *BGRA) ColorModel() color.Model { return color.RGBAModel }", "title": "" }, { "docid": "4aa1affe84f6ccca12e7b4dd6f390d0f", "score": "0.50837165", "text": "func NRGBA(byteOrder binary.ByteOrder, values ...color.NRGBA) []byte {\n\tle := getByteOrder(byteOrder)\n\twidth := 16\n\tarr := make([]byte, width*len(values))\n\tfor i, c := range values {\n\t\tr := math.Float32bits(float32(c.R) / 255.0)\n\t\tg := math.Float32bits(float32(c.G) / 255.0)\n\t\tb := math.Float32bits(float32(c.B) / 255.0)\n\t\ta := math.Float32bits(float32(c.A) / 255.0)\n\t\tif le {\n\t\t\tarr[width*i+0] = byte(r >> 0)\n\t\t\tarr[width*i+1] = byte(r >> 8)\n\t\t\tarr[width*i+2] = byte(r >> 16)\n\t\t\tarr[width*i+3] = byte(r >> 24)\n\t\t\tarr[width*i+4] = byte(g >> 0)\n\t\t\tarr[width*i+5] = byte(g >> 8)\n\t\t\tarr[width*i+6] = byte(g >> 16)\n\t\t\tarr[width*i+7] = byte(g >> 24)\n\t\t\tarr[width*i+8] = byte(b >> 0)\n\t\t\tarr[width*i+9] = byte(b >> 8)\n\t\t\tarr[width*i+10] = byte(b >> 16)\n\t\t\tarr[width*i+11] = byte(b >> 24)\n\t\t\tarr[width*i+12] = byte(a >> 0)\n\t\t\tarr[width*i+13] = byte(a >> 8)\n\t\t\tarr[width*i+14] = byte(a >> 16)\n\t\t\tarr[width*i+15] = byte(a >> 24)\n\t\t} else {\n\t\t\tarr[width*i+0] = byte(r >> 24)\n\t\t\tarr[width*i+1] = byte(r >> 16)\n\t\t\tarr[width*i+2] = byte(r >> 8)\n\t\t\tarr[width*i+3] = byte(r >> 0)\n\t\t\tarr[width*i+4] = byte(g >> 24)\n\t\t\tarr[width*i+5] = byte(g >> 16)\n\t\t\tarr[width*i+6] = byte(g >> 8)\n\t\t\tarr[width*i+7] = byte(g >> 0)\n\t\t\tarr[width*i+8] = byte(b >> 24)\n\t\t\tarr[width*i+9] = byte(b >> 16)\n\t\t\tarr[width*i+10] = byte(b >> 8)\n\t\t\tarr[width*i+11] = byte(b >> 0)\n\t\t\tarr[width*i+12] = byte(a >> 24)\n\t\t\tarr[width*i+13] = byte(a >> 16)\n\t\t\tarr[width*i+14] = byte(a >> 8)\n\t\t\tarr[width*i+15] = byte(a >> 0)\n\t\t}\n\t}\n\treturn arr\n}", "title": "" }, { "docid": "47ae6f5b00515089dd7260538244e43f", "score": "0.5075523", "text": "func (surface * Surface) H16() int16 {\n return int16(surface.surface.w)\n}", "title": "" }, { "docid": "4cfc32c631a629e17b9efb48d670079e", "score": "0.5075149", "text": "func (s * Surface) RawBlendPixel16(x, y int, \n color uint32, alpha uint8) {\n rmask, gmask, bmask, amask := s.ColorMasks() \n ptr := s.pixelptr16(x, y)\n old := uint32(*ptr)\n newcol := helpBlend(old, color, rmask,\n gmask, bmask, amask, uint32(alpha))\n *ptr = uint16(newcol)\n}", "title": "" }, { "docid": "3db775d153f4b3c8a87aeb6d786b8a0c", "score": "0.5064808", "text": "func RGBBytes(r, g, b int) []byte {\n\trs := strconv.FormatInt(int64(r), 16)\n\tgs := strconv.FormatInt(int64(g), 16)\n\tbs := strconv.FormatInt(int64(g), 16)\n\tif len(rs) == 1 && len(gs) == 1 && len(bs) == 1 {\n\t\t// short form\n\t\treturn []byte(\"#\" + rs + gs + bs)\n\t}\n\t// long form\n\treturn []byte(fmt.Sprintf(\"#%02x%02x%02x\", r, g, b))\n}", "title": "" }, { "docid": "ba80afa00490839d9b364fb5181f69f3", "score": "0.5063926", "text": "func (self *BitmapData) GetPixelRGBI(args ...interface{}) interface{}{\n return self.Object.Call(\"getPixelRGB\", args)\n}", "title": "" }, { "docid": "fd72d905b2b92da2732d8f3ccb594b68", "score": "0.5061143", "text": "func parseUint24(b []byte) rune {\n\t_ = b[2] // BCE\n\treturn rune(b[0])<<16 | rune(b[1])<<8 | rune(b[2])\n}", "title": "" }, { "docid": "567c13f7ab1ac9a0ac2ef255a6762413", "score": "0.50509864", "text": "func (c SRGBnA8) Linear() (r, g, b, a float32) {\n\ta = float32(c.A) / float32(0xFF)\n\tr = srgbToLinear(a * float32(c.R) / float32(0xFF))\n\tg = srgbToLinear(a * float32(c.G) / float32(0xFF))\n\tb = srgbToLinear(a * float32(c.B) / float32(0xFF))\n\treturn r, g, b, a\n}", "title": "" }, { "docid": "5d81ab81adf06045d473ff956f379be6", "score": "0.5039894", "text": "func (c SRGB8) Linear() (r, g, b, a float32) {\n\tr = srgbToLinear(float32(c.R) / float32(0xFF))\n\tg = srgbToLinear(float32(c.G) / float32(0xFF))\n\tb = srgbToLinear(float32(c.B) / float32(0xFF))\n\ta = 1\n\treturn r, g, b, a\n}", "title": "" }, { "docid": "59798eb78d1a16d7b3ca5358bcbd18c0", "score": "0.50331324", "text": "func (lpd *LPD8806) SingleToColor(b byte) {\n\n}", "title": "" }, { "docid": "12c79738a4e154e9c802100691c7477e", "score": "0.5030675", "text": "func ParseUint24(array []byte, offset int) uint32 {\r\n\treturn uint32(array[offset])<<16 | uint32(array[offset+1])<<8 | uint32(array[offset+2])\r\n}", "title": "" }, { "docid": "b14c42dbdbc60f75013241ea83aebe9a", "score": "0.5026607", "text": "func RGB(r, g, b uint8) (*RGBColor, error) {\n\treturn &RGBColor{R: r, G: g, B: b}, nil\n}", "title": "" }, { "docid": "80d31f2bd09802ad67133fff5fb2becd", "score": "0.5020498", "text": "func RGBA64RGBA(c color.RGBA64,) (uint32, uint32, uint32, uint32)", "title": "" }, { "docid": "ff9b77ef2a933e103c7034e71cc31b8f", "score": "0.50105876", "text": "func readUint24(r io.Reader) (uint32, error) {\n\tvar buf [3]byte\n\tif _, err := io.ReadFull(r, buf[:]); err != nil {\n\t\treturn 0, err\n\t}\n\treturn uint32(buf[0])<<16 | uint32(buf[1])<<8 | uint32(buf[2]), nil\n}", "title": "" }, { "docid": "83663e5a3ed638a3ba7693d63549a9f4", "score": "0.50083965", "text": "func NRGBARGBA(c color.NRGBA,) (uint32, uint32, uint32, uint32)", "title": "" }, { "docid": "a3f5a01a7eeb13453d0ffa137b7bb49e", "score": "0.49889022", "text": "func (c Color) R() uint8 {\n\treturn float32touint8(c.r)\n}", "title": "" }, { "docid": "9ea2b99ca050ab8911c11e536f7f2ad2", "score": "0.49874672", "text": "func CMYKRGBA(c color.CMYK,) (uint32, uint32, uint32, uint32)", "title": "" }, { "docid": "ba09ee93098a4528dac4ad4a264e5300", "score": "0.49868146", "text": "func (selector *ContractFunctionSelector) AddUint24() *ContractFunctionSelector {\n\treturn selector._AddParam(_Solidity{\n\t\tty: aUint24,\n\t\tarray: false,\n\t})\n}", "title": "" }, { "docid": "b0cadacc5ef9380872d05827b52017c0", "score": "0.49710742", "text": "func AlphaRGBA(c color.Alpha,) (uint32, uint32, uint32, uint32)", "title": "" }, { "docid": "c5679b5a439ea7e65375076089e3d156", "score": "0.49654925", "text": "func (format * PixelFormat) MapRGBA(r, g, b, a uint8) uint32 {\n return mapRGBA(format.format, r, g, b, a)\n}", "title": "" }, { "docid": "58809e7d6fce8b6344016ab61ac4b28e", "score": "0.4960349", "text": "func (c RGBColor) Color() Color { return c.Basic() }", "title": "" }, { "docid": "775638b881054269e802649041f3bf77", "score": "0.49540114", "text": "func (m *RgbColor) GetR()(*byte) {\n return m.r\n}", "title": "" }, { "docid": "9ebfff862a276fdab04868f2aacea32d", "score": "0.4951852", "text": "func Rgb(r, g, b uint8, isBg ...bool) RGBColor { return RGB(r, g, b, isBg...) }", "title": "" }, { "docid": "e0915ac36f8153fd8167f84b3cfb2c42", "score": "0.49360844", "text": "func (m *RgbColor) SetR(value *byte)() {\n m.r = value\n}", "title": "" }, { "docid": "5fa9cd8cf66b80f0825e24c6cffa1512", "score": "0.49327874", "text": "func (s * Surface) RawGetPixel16(x, y int) (color uint32) {\n ptr := s.pixelptr16(x, y)\n return uint32(*ptr) \n}", "title": "" }, { "docid": "1685b724b74cb41845b38079b82b2b2e", "score": "0.49272764", "text": "func (s * Surface) RawBlendPixel32(x, y int, \n color uint32, alpha uint8) {\n rmask, gmask, bmask, amask := s.ColorMasks() \n ptr := s.pixelptr32(x, y)\n old := *ptr\n newcol := helpBlend(old, color, rmask,\n gmask, bmask, amask, uint32(alpha)) \n *ptr = newcol\n}", "title": "" }, { "docid": "2f2b6356bb47a47d58223da6a5d41809", "score": "0.49228922", "text": "func (self Color) A() float32 {\n return float32(self.a)\n}", "title": "" }, { "docid": "ea90d8c77fd06b15eb33b6ba6340a3b1", "score": "0.49169692", "text": "func (self *BitmapData) SetPixel32(x int, y int, red int, green int, blue int, alpha int) *BitmapData{\n return &BitmapData{self.Object.Call(\"setPixel32\", x, y, red, green, blue, alpha)}\n}", "title": "" }, { "docid": "081c1e0da441b484846339ab68305549", "score": "0.49168575", "text": "func (surface * Surface) W16() int16 {\n return int16(surface.surface.w)\n}", "title": "" }, { "docid": "58576d0016da0748cf2c9e314e07e617", "score": "0.49162254", "text": "func (self *BitmapData) GetPixelRGB2O(x int, y int, out interface{}, hsl bool) interface{}{\n return self.Object.Call(\"getPixelRGB\", x, y, out, hsl)\n}", "title": "" }, { "docid": "5b0fdb97bec455f23a7403e42ea04aa4", "score": "0.4915551", "text": "func (c Pixel) RGBA() (r, g, b, a uint32) {\n\tif c == Black {\n\t\treturn 0, 0, 0, 0xffff\n\t}\n\treturn 0xffff, 0xffff, 0xffff, 0xffff\n}", "title": "" }, { "docid": "8a2f0c64a400d41658e3b991ac78b294", "score": "0.4915023", "text": "func (surface * Surface) Format() (*PixelFormat) {\n return wrapPixelFormat(surface.surface.format)\n}", "title": "" }, { "docid": "43edc70926d3ae0b5711ae5e09f0e72b", "score": "0.49083668", "text": "func (s * Surface) pixelptr16(x, y int) (* uint16) {\n surface:= s.surface \n pixels := uintptr(ptr(surface.pixels)) \n offset := uintptr((y*(int(surface.pitch)) + x<<1))\n return (* uint16)(ptr(pixels + offset))\n}", "title": "" }, { "docid": "db7f539ef3fd15ebab7b4288f168ff26", "score": "0.4900665", "text": "func (self *BitmapData) GetPixelRGB3O(x int, y int, out interface{}, hsl bool, hsv bool) interface{}{\n return self.Object.Call(\"getPixelRGB\", x, y, out, hsl, hsv)\n}", "title": "" }, { "docid": "36d49f37611b7086122486099729f200", "score": "0.49005687", "text": "func (s * Surface) pixelptr32(x, y int) (*uint32) {\n surface:= s.surface \n pixels := uintptr(ptr(surface.pixels)) \n offset := uintptr((y*(int(surface.pitch)) + x<<2)) \n // y * int(self.pitch) + x*4, so we use x << 2\n //fmt.Printf(\"pixelptr32: %p %d, %d %d, %d %d\\n\", pixels, offset, \n //surface.pitch, x, y)\n return (* uint32)(ptr(pixels + offset))\n}", "title": "" }, { "docid": "6e39ecc53d8d481e4a500486d024c3ab", "score": "0.48876107", "text": "func rgbaToPixel(r uint32, g uint32, b uint32, a uint32) Pixel {\n\treturn Pixel{int(r / 257), int(g / 257), int(b / 257), int(a / 257)}\n}", "title": "" }, { "docid": "fc6908f21f37bc59b53d7e33d1b8d447", "score": "0.4879948", "text": "func (self Color) B() float32 {\n return float32(self.b)\n}", "title": "" }, { "docid": "b74f2a5c9e0f2048f4c117929dbfaa28", "score": "0.48797822", "text": "func ColorRGBAToUInt32RGB(c color.RGBA) uint32 {\r\n\tvar Color uint32 = 0\r\n\tColor = Color | (uint32(c.R) << 16)\r\n\tColor = Color | (uint32(c.G) << 8)\r\n\tColor = Color | (uint32(c.B) << 0)\r\n\treturn Color\r\n}", "title": "" }, { "docid": "ac00c4eebd194957c997cf25b9f61e3d", "score": "0.4867966", "text": "func (s * Surface) RawPutPixel16(x, y int, color uint32) {\n ptr := s.pixelptr16(x, y) \n *ptr = uint16(color)\n}", "title": "" }, { "docid": "0df574d6a81f327dbe8726ad3286c36a", "score": "0.48648968", "text": "func NewUint24(v int) (n Uint24, err error) {\n\tif v < 0 {\n\t\terr = errNegativeNumber\n\t\treturn\n\t}\n\tif v > MaxUint24 {\n\t\terr = errExceedMaxUint24\n\t}\n\tn[0] = byte(v >> 16)\n\tn[1] = byte(v >> 8)\n\tn[2] = byte(v)\n\treturn\n}", "title": "" }, { "docid": "56cc2d7969c4ee86cfe06e2cdb3b908c", "score": "0.4862658", "text": "func Unpack(rgb uint32) (r, g, b uint32) {\n\tr = (rgb & 0xff0000) >> 16\n\tg = (rgb & 0xff00) >> 8\n\tb = (rgb & 0xff)\n\n\treturn\n}", "title": "" }, { "docid": "1ea9815e61dec480ab74c210454ee058", "score": "0.48573494", "text": "func (self *BitmapData) GetPixelRGB1O(x int, y int, out interface{}) interface{}{\n return self.Object.Call(\"getPixelRGB\", x, y, out)\n}", "title": "" }, { "docid": "641287e484e730f0051c4fead9cba54e", "score": "0.48538813", "text": "func crc24(crc uint32, d []byte) uint32 {\n\tfor _, b := range d {\n\t\tcrc ^= uint32(b) << 16\n\t\tfor i := 0; i < 8; i++ {\n\t\t\tcrc <<= 1\n\t\t\tif crc&0x1000000 != 0 {\n\t\t\t\tcrc ^= crc24Poly\n\t\t\t}\n\t\t}\n\t}\n\treturn crc\n}", "title": "" }, { "docid": "2fcf90cf3ee93b7564243798074db9aa", "score": "0.48408857", "text": "func hslToNRGB(h, s, l float64) (uint8, uint8, uint8) {\n\tif s == 0 {\n\t\treturn clampUint8(uint8(roundFloat64(l*255.0)), 0, 255), clampUint8(uint8(roundFloat64(l*255.0)), 0, 255), clampUint8(uint8(roundFloat64(l*255.0)), 0, 255)\n\t}\n\n\tvar (\n\t\tr, g, b float64\n\t\tt1, t2 float64\n\t\ttr, tg, tb float64\n\t)\n\n\tif l < 0.5 {\n\t\tt1 = l * (1.0 + s)\n\t} else {\n\t\tt1 = l + s - l*s\n\t}\n\n\tt2 = 2*l - t1\n\th = h / 360\n\ttr = h + 1.0/3.0\n\ttg = h\n\ttb = h - 1.0/3.0\n\n\tif tr < 0 {\n\t\ttr++\n\t}\n\tif tr > 1 {\n\t\ttr--\n\t}\n\tif tg < 0 {\n\t\ttg++\n\t}\n\tif tg > 1 {\n\t\ttg--\n\t}\n\tif tb < 0 {\n\t\ttb++\n\t}\n\tif tb > 1 {\n\t\ttb--\n\t}\n\n\t// Red\n\tif 6*tr < 1 {\n\t\tr = t2 + (t1-t2)*6*tr\n\t} else if 2*tr < 1 {\n\t\tr = t1\n\t} else if 3*tr < 2 {\n\t\tr = t2 + (t1-t2)*(2.0/3.0-tr)*6\n\t} else {\n\t\tr = t2\n\t}\n\n\t// Green\n\tif 6*tg < 1 {\n\t\tg = t2 + (t1-t2)*6*tg\n\t} else if 2*tg < 1 {\n\t\tg = t1\n\t} else if 3*tg < 2 {\n\t\tg = t2 + (t1-t2)*(2.0/3.0-tg)*6\n\t} else {\n\t\tg = t2\n\t}\n\n\t// Blue\n\tif 6*tb < 1 {\n\t\tb = t2 + (t1-t2)*6*tb\n\t} else if 2*tb < 1 {\n\t\tb = t1\n\t} else if 3*tb < 2 {\n\t\tb = t2 + (t1-t2)*(2.0/3.0-tb)*6\n\t} else {\n\t\tb = t2\n\t}\n\n\treturn clampUint8(uint8(roundFloat64(r*255.0)), 0, 255), clampUint8(uint8(roundFloat64(g*255.0)), 0, 255), clampUint8(uint8(roundFloat64(b*255.0)), 0, 255)\n}", "title": "" }, { "docid": "84acc395cc04ee54ef9037794b7095c7", "score": "0.48302707", "text": "func ColorRGB(foregroundRedIndex int32, foregroundGreenIndex int32, foregroundBlueIndex int32, backgroundRedIndex int32, backgroundGreenIndex int32, backgroundBlueIndex int32) {\n\tColorLayerRGB(commonResource.layerAlias, foregroundRedIndex, foregroundGreenIndex, foregroundBlueIndex, backgroundRedIndex, backgroundGreenIndex, backgroundBlueIndex)\n}", "title": "" }, { "docid": "c85bdfb36bfa9e4015fbeb82e0b47265", "score": "0.4812364", "text": "func (image *Image3D) GetRGB(x, y, z int) (uint8, uint8, uint8) {\n\treturn image.data[z].GetRGB(x, y)\n}", "title": "" }, { "docid": "d4106b747726b7fa2c424ed706dec99f", "score": "0.48117915", "text": "func (self *BitmapData) SetPixel32I(args ...interface{}) *BitmapData{\n return &BitmapData{self.Object.Call(\"setPixel32\", args)}\n}", "title": "" }, { "docid": "386fc71dd5eea8a43758722a6290a479", "score": "0.4803228", "text": "func RGB(r, g, b string) string {\n\t//return color[:len(color)-2] + \";5;1m\"\n\treturn \"\"\n}", "title": "" }, { "docid": "266699858e69f091eace2b04b48eb017", "score": "0.47998166", "text": "func (self *BitmapData) GetPixelRGB(x int, y int) interface{}{\n return self.Object.Call(\"getPixelRGB\", x, y)\n}", "title": "" }, { "docid": "4af7aeee532ed0e9b5b24c83dc189935", "score": "0.47995767", "text": "func YCbCrRGBA(c color.YCbCr,) (uint32, uint32, uint32, uint32)", "title": "" }, { "docid": "ed6f52e7efab8e3f1a0b62e904d7f714", "score": "0.4799267", "text": "func MapRGBA(format *PixelFormat, r, g, b, a uint8) uint32 {\n\treturn (uint32)(C.SDL_MapRGBA((*C.SDL_PixelFormat)(cast(format)), (C.Uint8)(r), (C.Uint8)(g), (C.Uint8)(b), (C.Uint8)(a)))\n}", "title": "" } ]
2f8905ea2fd086c76955a67eee49792d
DoneFsDataSSlice returns a channel which will receive a slice of all the FsDataSs received on inp channel before close. Unlike DoneFsDataS, a full slice is sent once, not just an event.
[ { "docid": "deda64bec85136ffc0f22dcfced07df9", "score": "0.7983619", "text": "func DoneFsDataSSlice(inp <-chan fs.FsDataS) (done <-chan ([]fs.FsDataS)) {\n\tcha := make(chan ([]fs.FsDataS))\n\tgo doitFsDataSSlice(cha, inp)\n\treturn cha\n}", "title": "" } ]
[ { "docid": "b60dc328173b3bd4af9d8dfd2188c5f5", "score": "0.7060657", "text": "func DoneFsDataS(inp <-chan fs.FsDataS) (done <-chan struct{}) {\n\tcha := make(chan struct{})\n\tgo doitFsDataS(cha, inp)\n\treturn cha\n}", "title": "" }, { "docid": "817edc53767f027cbb2f300b8b4bcf8a", "score": "0.6540398", "text": "func JoinFsDataSSlice(out chan<- fs.FsDataS, inp ...[]fs.FsDataS) (done <-chan struct{}) {\n\tcha := make(chan struct{})\n\tgo joinFsDataSSlice(cha, out, inp...)\n\treturn cha\n}", "title": "" }, { "docid": "0670519770723f58db26e0677751bc69", "score": "0.64894426", "text": "func ChanFsDataSSlice(inp ...[]fs.FsDataS) (out <-chan fs.FsDataS) {\n\tcha := make(chan fs.FsDataS)\n\tgo sendFsDataSSlice(cha, inp...)\n\treturn cha\n}", "title": "" }, { "docid": "fa0fcce10e26660e89123406383fcc5e", "score": "0.64113945", "text": "func DoneFsDataSFunc(inp <-chan fs.FsDataS, act func(a fs.FsDataS)) (out <-chan struct{}) {\n\tcha := make(chan struct{})\n\tif act == nil {\n\t\tact = func(a fs.FsDataS) { return }\n\t}\n\tgo doitFsDataSFunc(cha, inp, act)\n\treturn cha\n}", "title": "" }, { "docid": "42ce8a408ad7a14ae49b425aaa369a7e", "score": "0.6228137", "text": "func DoneFsFileSlice(inp <-chan *fs.FsFile) (done <-chan ([]*fs.FsFile)) {\n\tcha := make(chan ([]*fs.FsFile))\n\tgo doitFsFileSlice(cha, inp)\n\treturn cha\n}", "title": "" }, { "docid": "09a6a951b7f43d44bb12947c2acc29a5", "score": "0.5786177", "text": "func FsDataSDaisy(inp <-chan fs.FsDataS, tube FsDataSTube) (out <-chan fs.FsDataS) {\n\tcha := make(chan fs.FsDataS)\n\tgo tube(inp, cha)\n\treturn cha\n}", "title": "" }, { "docid": "7048247d6cf78abd7e0455d4718aa79d", "score": "0.5745306", "text": "func DoneByteReaderSlice(inp <-chan io.ByteReader) chan []io.ByteReader {\n\tdone := make(chan []io.ByteReader)\n\tgo func() {\n\t\tdefer close(done)\n\t\tByteReaderS := []io.ByteReader{}\n\t\tfor i := range inp {\n\t\t\tByteReaderS = append(ByteReaderS, i)\n\t\t}\n\t\tdone <- ByteReaderS\n\t}()\n\treturn done\n}", "title": "" }, { "docid": "744a9e928b9ad64ca0ac79fea232b2f0", "score": "0.56341714", "text": "func JoinFsDataSChan(out chan<- fs.FsDataS, inp <-chan fs.FsDataS) (done <-chan struct{}) {\n\tcha := make(chan struct{})\n\tgo joinFsDataSChan(cha, out, inp)\n\treturn cha\n}", "title": "" }, { "docid": "500d8a4d0b10d4ec45c7273a45841141", "score": "0.56035066", "text": "func FsDataSDaisyChain(inp <-chan fs.FsDataS, tubes ...FsDataSTube) (out <-chan fs.FsDataS) {\n\tcha := inp\n\tfor i := range tubes {\n\t\tcha = FsDataSDaisy(cha, tubes[i])\n\t}\n\treturn cha\n}", "title": "" }, { "docid": "a77739bca3897a03e63736409f8c8aa7", "score": "0.54765904", "text": "func PipeFsDataSFunc(inp <-chan fs.FsDataS, act func(a fs.FsDataS) fs.FsDataS) (out <-chan fs.FsDataS) {\n\tcha := make(chan fs.FsDataS)\n\tif act == nil {\n\t\tact = func(a fs.FsDataS) fs.FsDataS { return a }\n\t}\n\tgo pipeFsDataSFunc(cha, inp, act)\n\treturn cha\n}", "title": "" }, { "docid": "911f84d7c19df23cc91bb86d83272921", "score": "0.54648376", "text": "func (inp anyThingFrom) DoneSlice() (done <-chan []anyThing) {\n\tsig := make(chan []anyThing)\n\tgo inp.doneSlice(sig)\n\treturn sig\n}", "title": "" }, { "docid": "1a0eff15ccf04ff9631ee7f1c403769b", "score": "0.5450847", "text": "func DoneByteReader(inp <-chan io.ByteReader) chan struct{} {\n\tdone := make(chan struct{})\n\tgo func() {\n\t\tdefer close(done)\n\t\tfor i := range inp {\n\t\t\t_ = i // Drain inp\n\t\t}\n\t\tdone <- struct{}{}\n\t}()\n\treturn done\n}", "title": "" }, { "docid": "af0d72ed166760841b7f34a676c795b9", "score": "0.5403561", "text": "func JoinFsDataS(out chan<- fs.FsDataS, inp ...fs.FsDataS) (done <-chan struct{}) {\n\tcha := make(chan struct{})\n\tgo joinFsDataS(cha, out, inp...)\n\treturn cha\n}", "title": "" }, { "docid": "59db40ac7e63b20c0592a63cacc27452", "score": "0.5387498", "text": "func DoneBufferSlice(inp <-chan bytes.Buffer) (done <-chan []bytes.Buffer) {\n\tcha := make(chan []bytes.Buffer)\n\tgo func(inp <-chan bytes.Buffer, done chan<- []bytes.Buffer) {\n\t\tdefer close(done)\n\t\tBufferS := []bytes.Buffer{}\n\t\tfor i := range inp {\n\t\t\tBufferS = append(BufferS, i)\n\t\t}\n\t\tdone <- BufferS\n\t}(inp, cha)\n\treturn cha\n}", "title": "" }, { "docid": "d9b58d17d2033e38db325a9a5ff8ec62", "score": "0.5303604", "text": "func ChanFsDataS(inp ...fs.FsDataS) (out <-chan fs.FsDataS) {\n\tcha := make(chan fs.FsDataS)\n\tgo sendFsDataS(cha, inp...)\n\treturn cha\n}", "title": "" }, { "docid": "2fe828e76af75f111f54f9a1b5d75be1", "score": "0.527303", "text": "func PipeFsDataSBuffer(inp <-chan fs.FsDataS, cap int) (out <-chan fs.FsDataS) {\n\tcha := make(chan fs.FsDataS, cap)\n\tgo pipeFsDataSBuffer(cha, inp)\n\treturn cha\n}", "title": "" }, { "docid": "167cb9a71d92ccfe6a828cefe7d0a175", "score": "0.51074415", "text": "func PipeFsDataSFork(inp <-chan fs.FsDataS) (out1, out2 <-chan fs.FsDataS) {\n\tcha1 := make(chan fs.FsDataS)\n\tcha2 := make(chan fs.FsDataS)\n\tgo pipeFsDataSFork(cha1, cha2, inp)\n\treturn cha1, cha2\n}", "title": "" }, { "docid": "858abccb993895f01fc7815fa7b07d7a", "score": "0.50656027", "text": "func DoneHeaderSlice(inp <-chan *tar.Header) chan []*tar.Header {\n\tdone := make(chan []*tar.Header)\n\tgo func() {\n\t\tdefer close(done)\n\t\tHeaderS := []*tar.Header{}\n\t\tfor i := range inp {\n\t\t\tHeaderS = append(HeaderS, i)\n\t\t}\n\t\tdone <- HeaderS\n\t}()\n\treturn done\n}", "title": "" }, { "docid": "7ebacd074313ee6c13459a6313ac30b2", "score": "0.49909103", "text": "func ChanFsDataSFuncErr(act func() (fs.FsDataS, error)) (out <-chan fs.FsDataS) {\n\tcha := make(chan fs.FsDataS)\n\tgo chanFsDataSFuncErr(cha, act)\n\treturn cha\n}", "title": "" }, { "docid": "62d4cea2648e9d8dcd71b81ea3bbca19", "score": "0.49454406", "text": "func ChanFsDataSFuncNil(act func() fs.FsDataS) (out <-chan fs.FsDataS) {\n\tcha := make(chan fs.FsDataS)\n\tgo chanFsDataSFuncNil(cha, act)\n\treturn cha\n}", "title": "" }, { "docid": "39062bb0234bca1f2bcfc0a190c2c209", "score": "0.4926814", "text": "func DoneBuffer(inp <-chan bytes.Buffer) (done <-chan struct{}) {\n\tcha := make(chan struct{})\n\tgo func(done chan<- struct{}, inp <-chan bytes.Buffer) {\n\t\tdefer close(done)\n\t\tfor i := range inp {\n\t\t\t_ = i // Drain inp\n\t\t}\n\t\tdone <- struct{}{}\n\t}(cha, inp)\n\treturn cha\n}", "title": "" }, { "docid": "b64a32555037ba719c87495a93dcb036", "score": "0.48534244", "text": "func DoneByteReaderFunc(inp <-chan io.ByteReader, act func(a io.ByteReader)) chan struct{} {\n\tdone := make(chan struct{})\n\tif act == nil {\n\t\tact = func(a io.ByteReader) { return }\n\t}\n\tgo func() {\n\t\tdefer close(done)\n\t\tfor i := range inp {\n\t\t\tact(i) // Apply action\n\t\t}\n\t\tdone <- struct{}{}\n\t}()\n\treturn done\n}", "title": "" }, { "docid": "244705965e19a3afe4a8a346d184a5d9", "score": "0.48173788", "text": "func ForEach(in *Stream, f DoFunc) chan interface{} {\n\tdone := make(chan interface{})\n\n\tgo func() {\n\t\tfor {\n\t\t\tselect {\n\t\t\tcase e, ok := <-in.Data:\n\t\t\t\tif ok {\n\t\t\t\t\tf(e)\n\t\t\t\t} else {\n\t\t\t\t\tclose(done)\n\t\t\t\t\treturn\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}()\n\n\treturn done\n}", "title": "" }, { "docid": "d4af525b3f3ba2b2b4710c67ad020afc", "score": "0.47715074", "text": "func (s *StackStreamer) Done() <-chan struct{} {\n\treturn s.done\n}", "title": "" }, { "docid": "261aeab79c217da128451990109c2d76", "score": "0.47141704", "text": "func DoneFsFile(inp <-chan *fs.FsFile) (done <-chan struct{}) {\n\tcha := make(chan struct{})\n\tgo doitFsFile(cha, inp)\n\treturn cha\n}", "title": "" }, { "docid": "ca55ea5815e8a6985597a63f316ecf43", "score": "0.4712363", "text": "func (fio *FakeIO) Done() (stdout, stderr []byte, err error) {\n\tif fio == nil {\n\t\terr = errors.New(\"FakeIO.Done - nil pointer\")\n\t\treturn\n\t}\n\n\tfio.Lock()\n\tif fio.finished {\n\t\terr = errors.New(\"FakeIO.Done - already called\")\n\t}\n\tfio.finished = true\n\tfio.Unlock()\n\n\tfio.stdinWriter.Close()\n\n\tos.Stdout.Close()\n\tstdout = <-fio.stdoutCh\n\tif tmpErr, ok := <-fio.stdoutErrCh; ok {\n\t\terr = tmpErr\n\t}\n\n\tos.Stderr.Close()\n\tstderr = <-fio.stderrCh\n\tif tmpErr, ok := <-fio.stderrErrCh; ok {\n\t\terr = errors.Join(err, tmpErr)\n\t}\n\n\tif tmpErr, ok := <-fio.stdinErrCh; ok && !errors.Is(tmpErr, os.ErrClosed) {\n\t\terr = errors.Join(err, tmpErr)\n\t}\n\n\tfio.stdinWriter.Close()\n\tfio.stdoutReader.Close()\n\tfio.stderrReader.Close()\n\n\tfio.stdinWriter = nil\n\tfio.stdoutReader = nil\n\tfio.stderrReader = nil\n\n\tfio.resetFakeIO()\n\n\treturn\n}", "title": "" }, { "docid": "454e25a4b72f401230bc61acfeb8103d", "score": "0.46778864", "text": "func (inp anyThingFrom) FiniSlice() func(inp anyThingFrom) (done <-chan []anyThing) {\n\n\treturn func(inp anyThingFrom) (done <-chan []anyThing) {\n\t\treturn inp.DoneSlice()\n\t}\n}", "title": "" }, { "docid": "f7b90b5a6e34a66890fb7b88ad4b752e", "score": "0.46463415", "text": "func (cs *CSVStreamer) Done() Dstream {\n\treturn cs\n}", "title": "" }, { "docid": "c1233fb1ba56e04b697e2637f767b315", "score": "0.4624135", "text": "func ChanFsDataSFuncNok(act func() (fs.FsDataS, bool)) (out <-chan fs.FsDataS) {\n\tcha := make(chan fs.FsDataS)\n\tgo chanFsDataSFuncNok(cha, act)\n\treturn cha\n}", "title": "" }, { "docid": "f6b7ac20d0d7a4f039a891026a510f85", "score": "0.46221426", "text": "func DoneHeader(inp <-chan *tar.Header) chan struct{} {\n\tdone := make(chan struct{})\n\tgo func() {\n\t\tdefer close(done)\n\t\tfor i := range inp {\n\t\t\t_ = i // Drain inp\n\t\t}\n\t\tdone <- struct{}{}\n\t}()\n\treturn done\n}", "title": "" }, { "docid": "c019ecf0dbec68853376c7513ef8e329", "score": "0.46175966", "text": "func (c *SpanCollector) Done() <-chan struct{} {\n\treturn c.done\n}", "title": "" }, { "docid": "184041c2c1ff8dc739288c78b6777dd6", "score": "0.45995474", "text": "func (c *SubscribeStream) Done() <-chan struct{} {\n\treturn c.ctx.Done()\n}", "title": "" }, { "docid": "4e0714cc8f75edb598ddf2a5cc48c71c", "score": "0.4567047", "text": "func Do(in *Stream, f DoFunc) *Stream {\n\tdata := make(chan interface{}, config.Sensor.ChannelBufferLength)\n\n\tgo func() {\n\t\tdefer close(data)\n\n\t\tfor {\n\t\t\tselect {\n\t\t\tcase e, ok := <-in.Data:\n\t\t\t\tif ok {\n\t\t\t\t\tf(e)\n\t\t\t\t\tdata <- e\n\t\t\t\t} else {\n\t\t\t\t\treturn\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}()\n\n\treturn &Stream{\n\t\tCtrl: in.Ctrl,\n\t\tData: data,\n\t}\n}", "title": "" }, { "docid": "2edfb8e7be11eb3b27ada9888e09cf41", "score": "0.45619938", "text": "func OrDone(ctx context.Context, inputStream Stream) Stream {\n\toutputStream := make(chan PipelineData)\n\tgo func() {\n\t\tdefer close(outputStream)\n\t\tfor {\n\t\t\tselect {\n\t\t\tcase <-ctx.Done(): // exit as soon as the context is done\n\t\t\t\tselect {\n\t\t\t\tcase outputStream <- PipelineData{Err: ctx.Err()}:\n\t\t\t\t\treturn\n\t\t\t\tcase <-time.After(time.Second): // safeguard in case no routines are listening to the outputStream\n\t\t\t\t\treturn\n\t\t\t\t}\n\t\t\tcase v, ok := <-inputStream:\n\t\t\t\tif !ok { // ok == false means the input channel was closed\n\t\t\t\t\treturn\n\t\t\t\t}\n\n\t\t\t\tWriteOrDone(ctx, v, outputStream)\n\t\t\t}\n\t\t}\n\t}()\n\n\treturn outputStream\n}", "title": "" }, { "docid": "d936f21a23c866da6120c469881c1c75", "score": "0.4537991", "text": "func Reduce(in *Stream, initVal interface{}, f ReduceFunc) chan interface{} {\n\tdata := make(chan interface{}, config.Sensor.ChannelBufferLength)\n\n\tgo func() {\n\t\tacc := initVal\n\t\tfor {\n\t\t\tselect {\n\t\t\tcase e, ok := <-in.Data:\n\t\t\t\tif ok {\n\t\t\t\t\tacc = f(acc, e)\n\t\t\t\t} else {\n\t\t\t\t\tdata <- acc\n\t\t\t\t\tclose(data)\n\t\t\t\t\treturn\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}()\n\n\treturn data\n}", "title": "" }, { "docid": "7ade5715febc22e3bcac618a41fb6786", "score": "0.45342535", "text": "func (s *stream) EofSlice(o int64, l int) ([]byte, error) {\n\t// block until the EOF is available or we quit\n\tselect {\n\tcase <-s.b.Quit:\n\t\treturn nil, ErrQuit\n\tcase <-s.eofc:\n\t}\n\tif o >= s.sz {\n\t\treturn nil, io.EOF\n\t}\n\tvar err error\n\tif o+int64(l) > s.sz {\n\t\tl = int(s.sz - o)\n\t\terr = io.EOF\n\t}\n\tslc, serr := s.Slice(s.sz-o-int64(l), l)\n\tif serr != nil {\n\t\terr = serr\n\t}\n\treturn slc, err\n}", "title": "" }, { "docid": "de2f533170a25e9dd53ab495481e60c7", "score": "0.45303386", "text": "func (inp anyThingFrom) Done(ops ...func(a anyThing)) (done <-chan struct{}) {\n\tsig := make(chan struct{})\n\tgo inp.done(sig, ops...)\n\treturn sig\n}", "title": "" }, { "docid": "20edd6d59fbe5f0f4d1a94f973d47c13", "score": "0.45274383", "text": "func (ms *Server) trySplice(header []byte, req *request, fdData *readResultFd) error {\n\tvar err error\n\n\t// Get a pair of connected pipes\n\tpair1, err := splice.Get()\n\tif err != nil {\n\t\treturn err\n\t}\n\tdefer splice.Done(pair1)\n\n\t// Grow buffer pipe to requested size + one extra page\n\t// Without the extra page the kernel will block once the pipe is almost full\n\tpair1Sz := fdData.Size() + os.Getpagesize()\n\tif err := pair1.Grow(pair1Sz); err != nil {\n\t\treturn err\n\t}\n\n\t// Read data from file\n\tpayloadLen, err := pair1.LoadFromAt(fdData.Fd, fdData.Size(), fdData.Off)\n\n\tif err != nil {\n\t\t// TODO - extract the data from splice.\n\t\treturn err\n\t}\n\n\t// Get another pair of connected pipes\n\tpair2, err := splice.Get()\n\tif err != nil {\n\t\treturn err\n\t}\n\tdefer splice.Done(pair2)\n\n\t// Grow pipe to header + actually read size + one extra page\n\t// Without the extra page the kernel will block once the pipe is almost full\n\theader = req.serializeHeader(payloadLen)\n\ttotal := len(header) + payloadLen\n\tpair2Sz := total + os.Getpagesize()\n\tif err := pair2.Grow(pair2Sz); err != nil {\n\t\treturn err\n\t}\n\n\t// Write header into pair2\n\tn, err := pair2.Write(header)\n\tif err != nil {\n\t\treturn err\n\t}\n\tif n != len(header) {\n\t\treturn fmt.Errorf(\"Short write into splice: wrote %d, want %d\", n, len(header))\n\t}\n\n\t// Write data into pair2\n\tn, err = pair2.LoadFrom(pair1.ReadFd(), payloadLen)\n\tif err != nil {\n\t\treturn err\n\t}\n\tif n != payloadLen {\n\t\treturn fmt.Errorf(\"Short splice: wrote %d, want %d\", n, payloadLen)\n\t}\n\n\t// Write header + data to /dev/fuse\n\t_, err = pair2.WriteTo(uintptr(ms.mountFd), total)\n\tif err != nil {\n\t\treturn err\n\t}\n\n\treturn nil\n}", "title": "" }, { "docid": "d2e52a15906adfbb811339e7e5b3e9a7", "score": "0.44522634", "text": "func (serSD *SerialSD) SendByteSlice(byteslice []byte, DestFilename string) error {\n\tresumeAfter := serSD.sio.IsRunning()\n\n\tif serSD.sio.IsRunning() {\n\t\tserSD.sio.Pause()\n\t}\n\tif serSD.siu.ExternalInUse() {\n\t\tc := serSD.siu.JoinLine()\n\t\t<-c\n\t\tc = nil\n\t}\n\tserSD.siu.PreformingTask()\n\n\tserSD.logger.Debugf(\"Sending bytes to the SD Card with %q as the file name\", DestFilename)\n\tserSD.sio.WriteStringLine(serSD.logger, \"deej.modules.sd.send\")\n\n\tserSD.sio.WriteStringLine(serSD.logger, DestFilename)\n\n\tserSD.sio.WriteBytes(serSD.logger, byteslice)\n\tserSD.sio.WriteStringLine(serSD.logger, \"EOF\")\n\n\t//clear status messages\n\tlineChannel := serSD.sio.ReadLine(serSD.logger)\n\n\t// Watch for done message since this is time intensive\n\t// If it takes to long exit\nLoop:\n\tfor {\n\t\tselect {\n\t\tcase <-time.After(500 * time.Millisecond):\n\t\t\tlineChannel = nil\n\n\t\t\tif resumeAfter {\n\t\t\t\tserSD.sio.Start()\n\t\t\t}\n\t\t\treturn errors.New(\"Timeout (waiting for arduino)\")\n\t\tcase msg := <-lineChannel:\n\t\t\tmsg = strings.TrimSuffix(msg, \"\\r\\n\")\n\t\t\tif msg == \"DONE\" {\n\t\t\t\tbreak Loop\n\t\t\t} else if msg == \"\" {\n\t\t\t} else {\n\t\t\t\tserSD.logger.Info(msg)\n\t\t\t}\n\t\t}\n\t}\n\n\tlineChannel = nil\n\n\tif serSD.cmddelay > (time.Microsecond * 1) {\n\t\ttime.Sleep(serSD.cmddelay)\n\t}\n\n\tif resumeAfter {\n\t\tserSD.sio.Start()\n\t}\n\tserSD.siu.Done()\n\treturn nil\n}", "title": "" }, { "docid": "7bfcabcbe72030a0fe51c0b28131b5f0", "score": "0.44490543", "text": "func (St *SteamCsv) ReadSteamTime(Done chan struct{}, ErrCh chan error) chan nt.ScapeDataD {\n\tOut := make(chan nt.ScapeDataD)\n\tScapeDataChInside := make(chan nt.ScapeDataD)\n\tDoneInside := make(chan struct{})\n\ttimer1 := time.NewTimer(St.Dur)\n\tgo func() {\n\t\tdefer func() {\n\t\t\tclose(Out)\n\t\t\tclose(ScapeDataChInside)\n\t\t\tclose(DoneInside)\n\t\t}()\n\t\t// !!!!nead add new done chanel for exit St.Read\n\t\tgo St.Read(ScapeDataChInside, DoneInside, Done, ErrCh)\n\t\t//St.Wg.Add(1)\n\t\tfor {\n\t\t\tselect {\n\t\t\tcase <-timer1.C:\n\t\t\t\t{\n\t\t\t\t\tselect {\n\t\t\t\t\tcase Out <- <-ScapeDataChInside: //St.Log.Debugf(\"SendScapeData\")\n\n\t\t\t\t\tdefault:\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t//case <-ErrCh:\n\t\t\t//\t{\n\t\t\t//\t\ttimer1.Stop()\n\t\t\t//\t\treturn\n\t\t\t//\t}\n\t\t\tcase <-DoneInside:\n\t\t\t\t{\n\t\t\t\t\ttimer1.Stop()\n\t\t\t\t\t//St.Wg.Done()\n\t\t\t\t\treturn\n\t\t\t\t}\n\t\t\tdefault:\n\t\t\t}\n\t\t}\n\t}()\n\treturn Out\n}", "title": "" }, { "docid": "a1caaa7e5cc3d876c40540db83672c9c", "score": "0.44473913", "text": "func DoneBufferFunc(inp <-chan bytes.Buffer, act func(a bytes.Buffer)) (out <-chan struct{}) {\n\tcha := make(chan struct{})\n\tif act == nil {\n\t\tact = func(a bytes.Buffer) { return }\n\t}\n\tgo func(done chan<- struct{}, inp <-chan bytes.Buffer, act func(a bytes.Buffer)) {\n\t\tdefer close(done)\n\t\tfor i := range inp {\n\t\t\tact(i) // Apply action\n\t\t}\n\t\tdone <- struct{}{}\n\t}(cha, inp, act)\n\treturn cha\n}", "title": "" }, { "docid": "c660d4080f36e3678ececc612a1a8d8e", "score": "0.4443671", "text": "func (bs *BlockStreamer) Done() <-chan struct{} {\n\treturn bs.ctx.Done()\n}", "title": "" }, { "docid": "dd4cbf2568b72fdf0432712a6c72d8a1", "score": "0.4420216", "text": "func (d *doneContext) Done() <-chan struct{} {\n\treturn d.done\n}", "title": "" }, { "docid": "62442e0e9693f08f5e85e4030599036f", "score": "0.44144294", "text": "func (s *csvSource) DataChan() chan Listing {\n\treturn s.outchan\n}", "title": "" }, { "docid": "cac5d837527ef75c8b8dff38dbef4da8", "score": "0.44031233", "text": "func (s *supervisor) Done() <-chan struct{} {\n\treturn s.done\n}", "title": "" }, { "docid": "d0eb4b9e4f5f1cf1d2298a82b85ad84e", "score": "0.43918815", "text": "func (b *B) DataDone() {\n\tsema := b.dataSema.Add(-1)\n\tif sema == 0 {\n\t\tclose(b.DataWait)\n\t}\n}", "title": "" }, { "docid": "242d7e3f9d10678358a814f5a1d9d014", "score": "0.43782887", "text": "func Splice(ctx context.Context, dst, src *VFSPipeFD, count int64) (int64, error) {\n\treturn spliceOrTee(ctx, dst, src, count, true /* removeFromSrc */)\n}", "title": "" }, { "docid": "eef18ba3100c2ae1fed3c1c345e85972", "score": "0.43747622", "text": "func (wh *WorkerHelper) ConsumeDataInBatches(name string, size int) ([]interface{}, error) {\n\tif _, exists := wh.worker.p.dataChannels[name]; !exists {\n\t\treturn nil, errors.New(\"Data channel does not exist\")\n\t}\n\tdataBatch := make([]interface{}, size)\n\tfor i := 0; i < size; i++ {\n\t\tdata, open := <-wh.worker.p.dataChannels[name]\n\t\tif !open {\n\t\t\treturn dataBatch, errors.New(\"Data channel closed\")\n\t\t}\n\t\tdataBatch[i] = data\n\t}\n\treturn dataBatch, nil\n}", "title": "" }, { "docid": "c08432ba3a980a52e476483a608946db", "score": "0.4373769", "text": "func (pd *Device) DoneC() <-chan struct{} { return pd.doneC }", "title": "" }, { "docid": "e5c2b17c2457d2da77106a94416f255f", "score": "0.43736333", "text": "func (fe firstError) Done() <-chan struct{} {\n\treturn fe.done\n}", "title": "" }, { "docid": "991cc5be5d487bb1dd6be497d46081d5", "score": "0.43281144", "text": "func (s *Session) Done() <-chan struct{} { return s.donec }", "title": "" }, { "docid": "303b79a6a2c89c5193eea810ff6e81c9", "score": "0.4319919", "text": "func reduceChan(mapOut dataSource, reduce func(*chunk) *chunk) (err interface{}) {\r\n\tif cs, ok := mapOut.(*chanSource); ok {\r\n\t\t_, err := forEachChan(cs, cs.chunkChan, func(c *chunk) (result interface{}, beEnded bool, err error) {\r\n\t\t\treduce(c)\r\n\t\t\treturn nil, false, nil\r\n\t\t})\r\n\t\treturn err\r\n\t} else {\r\n\t\tfunc() {\r\n\t\t\tdefer func() {\r\n\t\t\t\tif e := recover(); e != nil {\r\n\t\t\t\t\terr = newErrorWithStacks(err)\r\n\t\t\t\t}\r\n\t\t\t}()\r\n\t\t\tls, _ := mapOut.(*listSource)\r\n\t\t\tc := &chunk{Data: ls.data}\r\n\t\t\treduce(c)\r\n\t\t}()\r\n\t\treturn\r\n\t}\r\n}", "title": "" }, { "docid": "16bda6b20c7c22bab52200e6dacdbc16", "score": "0.43199053", "text": "func (rw *RowWorkerPool) Consume() <-chan []string {\n\treturn rw.outStream\n}", "title": "" }, { "docid": "10a8293c82f7d71b4f4cffd3d0196d42", "score": "0.43085045", "text": "func (s *Signaller) Done() <-chan struct{} {\n\treturn s.closeChannel\n}", "title": "" }, { "docid": "68a2652aa5540323210c9a94ca76bd7b", "score": "0.43021044", "text": "func (fd *VFSPipeFD) SpliceToNonPipe(ctx context.Context, out *vfs.FileDescription, off, count int64) (int64, error) {\n\tfd.pipe.mu.Lock()\n\n\t// Cap the sequence at number of bytes actually available.\n\tif count > fd.pipe.size {\n\t\tcount = fd.pipe.size\n\t}\n\tsrc := usermem.IOSequence{\n\t\tIO: fd,\n\t\tAddrs: hostarch.AddrRangeSeqOf(hostarch.AddrRange{0, hostarch.Addr(count)}),\n\t}\n\n\tvar (\n\t\tn int64\n\t\terr error\n\t)\n\tif off == -1 {\n\t\tn, err = out.Write(ctx, src, vfs.WriteOptions{})\n\t} else {\n\t\tn, err = out.PWrite(ctx, src, off, vfs.WriteOptions{})\n\t}\n\tif n > 0 {\n\t\tfd.pipe.consumeLocked(n)\n\t}\n\n\tfd.pipe.mu.Unlock()\n\n\tif n > 0 {\n\t\tfd.pipe.queue.Notify(waiter.WritableEvents)\n\t}\n\treturn n, err\n}", "title": "" }, { "docid": "ce145581426b48046af7203be78a0469", "score": "0.43010238", "text": "func JoinFsFileSlice(out chan<- *fs.FsFile, inp ...[]*fs.FsFile) (done <-chan struct{}) {\n\tcha := make(chan struct{})\n\tgo joinFsFileSlice(cha, out, inp...)\n\treturn cha\n}", "title": "" }, { "docid": "0012ebd6f47768906f623efcda69138e", "score": "0.4300789", "text": "func (cc *CallContext) Done() <-chan struct{} {\n\treturn cc.us.done()\n}", "title": "" }, { "docid": "38649757dde4f748c7833402eb311161", "score": "0.42987683", "text": "func (q *fifo) Done(c context.Context, id string) error {\n\treturn q.Error(c, id, nil)\n}", "title": "" }, { "docid": "33fcb921974e3640cfd971882d746ba4", "score": "0.42937917", "text": "func TestCloseFeedWorksInChain(t *testing.T) {\n\n\tfor c := 0; c < 4; c++ {\n\t\ts := make([]api.Stream, 4)\n\n\t\ts[0] = EmptyStream(1024)\n\t\ts[1] = s[0].Skip(16)\n\t\ts[2] = s[1].Map(func(i int) int { return i + 1 })\n\t\ts[3] = s[2].Reduce(func(a, b int) int { return a + b })\n\n\t\tfor i := 0; i < len(s); i++ {\n\t\t\tif s[i].IsClosed() {\n\t\t\t\tt.Fatal()\n\t\t\t}\n\t\t}\n\n\t\tfor i := 0; i < 100; i++ {\n\t\t\ts[c].Feed(i)\n\t\t}\n\t\tgo s[c].Close() // close the c'th in the chain so it can be fully consumed\n\n\t\ts[3].Count() // consumes so it should be closed fully\n\n\t\tfor i := 0; i < len(s); i++ {\n\t\t\tif !s[i].IsClosed() {\n\t\t\t\tt.Fatal()\n\t\t\t}\n\t\t}\n\t}\n\n}", "title": "" }, { "docid": "53fcbd368c967d6973e3c50136e8d6af", "score": "0.42899108", "text": "func (s *Server) Done() <-chan struct{} {\n\treturn s.doneC\n}", "title": "" }, { "docid": "303c727de3ef7233c876a38dac3be284", "score": "0.4287609", "text": "func (c *Interruption) Done() <-chan struct{} {\n\treturn c.ch\n}", "title": "" }, { "docid": "7c82b88da5a9aaee931bb0bad8a1898d", "score": "0.42716905", "text": "func OrDone1(done <-chan struct{}, c <-chan Data) <-chan Data {\n\tvalStream := make(chan Data)\n\tgo func() {\n\t\tdefer close(valStream)\n\t\tfor {\n\t\t\tselect {\n\t\t\tcase <-done:\n\t\t\t\treturn\n\t\t\tcase v, ok := <-c:\n\t\t\t\tif ok == false {\n\t\t\t\t\treturn\n\t\t\t\t}\n\t\t\t\tselect {\n\t\t\t\tcase valStream <- v:\n\t\t\t\tcase <-done:\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}()\n\treturn valStream\n}", "title": "" }, { "docid": "382eafdf50c104d0279e1c1544799159", "score": "0.42643332", "text": "func (fw *FileWatcher) Done() <-chan struct{} {\n\treturn fw.done\n}", "title": "" }, { "docid": "5c675805d871760868803319a6cd177e", "score": "0.42623904", "text": "func (s *splicePipe) writeTo(dst *netFD) error {\n\tif s.inbuf == 0 {\n\t\treturn nil\n\t}\n\n\t// we don't need to set SPLICE_F_NONBLOCK,\n\t// because if there's data in the pipe, then\n\t// EAGAIN will only occur if the socket would block\n\tflags := fSpliceMove\n\t// if we have more data to write, hint w/ SPLICE_F_MORE\n\t// disable fSpliceMore for response time\n\t//\tif s.toread != 0 {\n\t//\t\tflags |= fSpliceMore\n\t//\t}\n\nwrite:\n\tn, eno := rawsplice(s.rfd, dst.sysfd, int(s.inbuf), flags)\n\tif eno == syscall.EAGAIN {\n\t\tif err := dst.pd.WaitWrite(); err != nil {\n\t\t\treturn err\n\t\t}\n\t\tgoto write\n\t}\n\tvar err error\n\tif eno != 0 {\n\t\terr = eno\n\t}\n\ts.inbuf -= n\n\ts.written += n\n\treturn err\n}", "title": "" }, { "docid": "6f341f90bf72c06ff5e907ae7783f580", "score": "0.4260543", "text": "func ChanFsFileSlice(inp ...[]*fs.FsFile) (out <-chan *fs.FsFile) {\n\tcha := make(chan *fs.FsFile)\n\tgo sendFsFileSlice(cha, inp...)\n\treturn cha\n}", "title": "" }, { "docid": "4648db747f2d7012e7b5170f424d5a2d", "score": "0.4250992", "text": "func (client *Client) DescribeDataFlowsWithChan(request *DescribeDataFlowsRequest) (<-chan *DescribeDataFlowsResponse, <-chan error) {\n\tresponseChan := make(chan *DescribeDataFlowsResponse, 1)\n\terrChan := make(chan error, 1)\n\terr := client.AddAsyncTask(func() {\n\t\tdefer close(responseChan)\n\t\tdefer close(errChan)\n\t\tresponse, err := client.DescribeDataFlows(request)\n\t\tif err != nil {\n\t\t\terrChan <- err\n\t\t} else {\n\t\t\tresponseChan <- response\n\t\t}\n\t})\n\tif err != nil {\n\t\terrChan <- err\n\t\tclose(responseChan)\n\t\tclose(errChan)\n\t}\n\treturn responseChan, errChan\n}", "title": "" }, { "docid": "9c85b7705bc3433df44474384c3c900f", "score": "0.42447078", "text": "func (s *Signal) Done() <-chan struct{} {\n\treturn s.load()\n}", "title": "" }, { "docid": "6c0dc3d2252c14c22403f153cc16f399", "score": "0.4236872", "text": "func (q *fifo) Done(_ context.Context, id string, exitStatus model.StatusValue) error {\n\treturn q.finished([]string{id}, exitStatus, nil)\n}", "title": "" }, { "docid": "9fd0e77b901dc139fea2ca22042ac8ec", "score": "0.42342713", "text": "func (cq *ChannelQueue[T]) bufferData() {\n\tvar buffer deque.Deque[T]\n\tvar output chan T\n\tvar next, zero T\n\tinputChan := cq.input\n\tinput := inputChan\n\n\tfor input != nil || output != nil {\n\t\tselect {\n\t\tcase elem, open := <-input:\n\t\t\tif open {\n\t\t\t\t// Push data from input chan to buffer.\n\t\t\t\tbuffer.PushBack(elem)\n\t\t\t} else {\n\t\t\t\t// Input chan closed; do not select input chan.\n\t\t\t\tinput = nil\n\t\t\t\tinputChan = nil\n\t\t\t}\n\t\tcase output <- next:\n\t\t\t// Wrote buffered data to output chan. Remove item from buffer.\n\t\t\tbuffer.PopFront()\n\t\tcase cq.length <- buffer.Len():\n\t\t}\n\n\t\tif buffer.Len() == 0 {\n\t\t\t// No buffered data; do not select output chan.\n\t\t\toutput = nil\n\t\t\tnext = zero // set to zero to GC value\n\t\t} else {\n\t\t\t// Try to write it to output chan.\n\t\t\toutput = cq.output\n\t\t\tnext = buffer.Front()\n\t\t}\n\n\t\tif cq.capacity != -1 {\n\t\t\t// If buffer at capacity, then stop accepting input.\n\t\t\tif buffer.Len() >= cq.capacity {\n\t\t\t\tinput = nil\n\t\t\t} else {\n\t\t\t\tinput = inputChan\n\t\t\t}\n\t\t}\n\t}\n\n\tclose(cq.output)\n\tclose(cq.length)\n}", "title": "" }, { "docid": "6f87ed2d6209ebfab94c045fd481bf29", "score": "0.42237458", "text": "func (ch *Chunk) Done() {\n\tif !ch.IsFullyRead() {\n\t\tch.drain()\n\t}\n}", "title": "" }, { "docid": "aa274e2000e73e6d28c907bbcf17015b", "score": "0.42211217", "text": "func orDone(done, c <-chan interface{}) <-chan interface{} {\n\tvalStream := make(chan interface{})\n\tgo func() {\n\t\tdefer close(valStream)\n\t\tfor {\n\t\t\tselect {\n\t\t\tcase <-done:\n\t\t\t\treturn\n\t\t\tcase v, ok := <-c:\n\t\t\t\tif ok == false {\n\t\t\t\t\treturn\n\t\t\t\t}\n\t\t\t\tselect {\n\t\t\t\tcase valStream <- v:\n\t\t\t\tcase <-done:\n\t\t\t\t}\n\t\t\tcase <-time.After(10 * time.Second):\n\t\t\t\treturn\n\t\t\t}\n\t\t}\n\t}()\n\treturn valStream\n}", "title": "" }, { "docid": "e1f57a4f60dd64585f509d9fa3203931", "score": "0.42177582", "text": "func (ch *ChannelIn) Read() (out []byte) {\n\tfor frameNr := uint64(0); ; frameNr++ {\n\t\tdata, ok := ch.inputs[frameNr]\n\t\tif !ok {\n\t\t\treturn\n\t\t}\n\t\tout = append(out, data...)\n\t}\n}", "title": "" }, { "docid": "94fbcbbb53db271d90d01052d9441295", "score": "0.42079353", "text": "func (p Pipeline) Done() <-chan struct{} {\n\treturn p.tail.done\n}", "title": "" }, { "docid": "198603c76a8ab7554bfb04bfc34e9362", "score": "0.42020145", "text": "func (d *doer) Done() <-chan struct{} {\n\treturn d.done\n}", "title": "" }, { "docid": "5246a492e1846cb92670c21f43b42f17", "score": "0.4194322", "text": "func FanOut(input <-chan iot.IotEvent, n int) []chan iot.IotEvent {\n\tworkers := make([]chan iot.IotEvent, 0)\n\tfor i := 0; i < n; i++ {\n\t\tworkers = append(workers, make(chan iot.IotEvent))\n\t}\n\n\tgo func() {\n\t\t// Close all n worker channels when the input is closed\n\t\tdefer func() {\n\t\t\tfor _, worker := range workers {\n\t\t\t\tclose(worker)\n\t\t\t}\n\t\t}()\n\n\t\t// Distribute input events in round-robin fashion between workers\n\t\tfor {\n\t\t\tfor _, worker := range workers {\n\t\t\t\tselect {\n\t\t\t\tcase event, ok := <-input:\n\t\t\t\t\tif !ok {\n\t\t\t\t\t\treturn\n\t\t\t\t\t}\n\t\t\t\t\tworker <- event\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}()\n\n\treturn workers // return worker channels\n}", "title": "" }, { "docid": "977c5b4691df9a4138cefb3e7211ba23", "score": "0.41820377", "text": "func (c *regularResourceComponent) Done() <-chan struct{} {\n\treturn c.done\n}", "title": "" }, { "docid": "6d3a5ff606993514b0f607b099db777d", "score": "0.41784528", "text": "func (lc *listenerHandle) Done() <-chan struct{} {\n\treturn lc.ctx.Done()\n}", "title": "" }, { "docid": "16f455b9f8d28adf7faee37768ead772", "score": "0.41778272", "text": "func (s *headlessAuthenticationSubscriber) Done() <-chan struct{} {\n\treturn s.closed\n}", "title": "" }, { "docid": "39a7792752cba667029949ab655051d6", "score": "0.41742885", "text": "func (s *Stream) CloseRead() {\n\tif s.IsWriteOnly() {\n\t\treturn\n\t}\n\ts.ingate.lock()\n\tdefer s.inUnlock()\n\tif s.inset.isrange(0, s.insize) || s.inresetcode != -1 {\n\t\t// We've already received all data from the peer,\n\t\t// so there's no need to send STOP_SENDING.\n\t\t// This is the same as saying we sent one and they got it.\n\t\ts.inclosed.setReceived()\n\t} else {\n\t\ts.inclosed.set()\n\t}\n\ts.in.discardBefore(s.in.end)\n}", "title": "" }, { "docid": "75c65fedc50d1d3b0f815874a6cbf372", "score": "0.41721776", "text": "func (s *Session) recvLoop() {\n\tbuffer := make([]byte, 130*1024)\n\toff := 0\n\tfor {\n\t\tfor atomic.LoadInt32(&s.bucket) <= 0 && !s.IsClosed() {\n\t\t\t<-s.bucketNotify\n\t\t}\n\n\t\tn, _ := s.conn.Read(buffer[off:])\n\t\tif n <= 0 {\n\t\t\ts.Close()\n\t\t\treturn\n\t\t}\n\t\toff += n\n\n\t\tatomic.StoreInt32(&s.dataReady, 1)\n\n\t\tdataBuf := buffer[:off]\n\t\tdataLen := len(dataBuf)\n\t\tfor {\n\t\t\tf, ok, err := s.decodeFrame(&dataBuf)\n\t\t\tif err != nil {\n\t\t\t\ts.Close()\n\t\t\t\treturn\n\t\t\t}\n\t\t\tif !ok {\n\t\t\t\tbreak\n\t\t\t}\n\n\t\t\th := rawHeader(f.header[:])\n\t\t\tswitch h.Cmd() {\n\t\t\tcase cmdNOP:\n\t\t\tcase cmdSYN:\n\t\t\t\ts.streamLock.Lock()\n\t\t\t\tif _, ok := s.streams[h.StreamID()]; !ok {\n\t\t\t\t\tstream := newStream(h.StreamID(), s.config.MaxFrameSize, s)\n\t\t\t\t\ts.streams[h.StreamID()] = stream\n\t\t\t\t\tselect {\n\t\t\t\t\tcase s.chAccepts <- stream:\n\t\t\t\t\tcase <-s.die:\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\ts.streamLock.Unlock()\n\t\t\tcase cmdFIN:\n\t\t\t\ts.streamLock.Lock()\n\t\t\t\tif stream, ok := s.streams[h.StreamID()]; ok {\n\t\t\t\t\tstream.markRST()\n\t\t\t\t\tstream.notifyReadEvent()\n\t\t\t\t}\n\t\t\t\ts.streamLock.Unlock()\n\t\t\tcase cmdPSH:\n\t\t\t\ts.streamLock.Lock()\n\t\t\t\tif stream, ok := s.streams[h.StreamID()]; ok {\n\t\t\t\t\tatomic.AddInt32(&s.bucket, -int32(len(f.data)))\n\t\t\t\t\tstream.pushBytes(f.data)\n\t\t\t\t\tstream.notifyReadEvent()\n\t\t\t\t}\n\t\t\t\ts.streamLock.Unlock()\n\t\t\tdefault:\n\t\t\t\ts.Close()\n\t\t\t\treturn\n\t\t\t}\n\t\t}\n\n\t\tremains := len(dataBuf)\n\t\tif remains > 0 {\n\t\t\tif remains != dataLen {\n\t\t\t\tcopy(buffer, dataBuf)\n\t\t\t\toff = remains\n\t\t\t}\n\t\t} else {\n\t\t\toff = 0\n\t\t}\n\t}\n}", "title": "" }, { "docid": "9ebe225fac1dee0b0a2dcb8c87b7058c", "score": "0.4164212", "text": "func (l *RemoteEventsPublisher) Done() <-chan struct{} {\n\treturn l.closed\n}", "title": "" }, { "docid": "839bb65f54308c384b58459f4c8d51af", "score": "0.41492608", "text": "func (s *Sinker) DataChan() chan []byte {\n\treturn s.dataChan\n}", "title": "" }, { "docid": "7ce3810f254ff4006bf332845ffe90ff", "score": "0.41432717", "text": "func (s *server) Done() <-chan struct{} {\n\treturn s.done\n}", "title": "" }, { "docid": "0e147dd461f33969d5924ea1b98c3971", "score": "0.4142897", "text": "func (s *WSServer) Done() {\n\tclose(s.doneCh)\n}", "title": "" }, { "docid": "493f28a6adba81c549a358e812eb3e0a", "score": "0.4141587", "text": "func (p *Pipeline) Done() {\n\tclose(p.reqs)\n}", "title": "" }, { "docid": "301c1040c8a277d770bb26b51c7dfda6", "score": "0.41401148", "text": "func (fd *VFSPipeFD) SpliceFromNonPipe(ctx context.Context, in *vfs.FileDescription, off, count int64) (int64, error) {\n\tdst := usermem.IOSequence{\n\t\tIO: fd,\n\t\tAddrs: hostarch.AddrRangeSeqOf(hostarch.AddrRange{0, hostarch.Addr(count)}),\n\t}\n\n\tvar (\n\t\tn int64\n\t\terr error\n\t)\n\tfd.pipe.mu.Lock()\n\tif off == -1 {\n\t\tn, err = in.Read(ctx, dst, vfs.ReadOptions{})\n\t} else {\n\t\tn, err = in.PRead(ctx, dst, off, vfs.ReadOptions{})\n\t}\n\tfd.pipe.mu.Unlock()\n\n\tif n > 0 {\n\t\tfd.pipe.queue.Notify(waiter.ReadableEvents)\n\t}\n\treturn n, err\n}", "title": "" }, { "docid": "dd7c5c90b233add18010644ed1b1cbae", "score": "0.41391954", "text": "func (e *Extraction) Done() <-chan struct{} {\n\tch := make(chan struct{})\n\n\tgo func() {\n\t\tif e.finished {\n\t\t\tclose(ch)\n\t\t} else {\n\t\t\t<-e.doneCh\n\t\t\tclose(ch)\n\t\t}\n\t}()\n\n\treturn ch\n}", "title": "" }, { "docid": "4c1f348838548912d79ca7ef5d70dc8c", "score": "0.41363817", "text": "func (cce *ClientCleanupEvent) Done() {\n\tcce.once.Do(func() {\n\t\tclose(cce.ch)\n\t})\n}", "title": "" }, { "docid": "15f27b9134c3d1b39b8902cf78d0b6e8", "score": "0.4133464", "text": "func Wait(in *Stream) chan interface{} {\n\tdone := make(chan interface{})\n\n\tgo func() {\n\t\tfor {\n\t\t\tselect {\n\t\t\tcase _, ok := <-in.Data:\n\t\t\t\tif !ok {\n\t\t\t\t\tclose(done)\n\t\t\t\t\treturn\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}()\n\n\treturn done\n}", "title": "" }, { "docid": "9faf54f09892580220a41b5d0cd6fd85", "score": "0.4133387", "text": "func (is IFSlice) Len() int { return len(is) }", "title": "" }, { "docid": "437dcd1d04ef4afdfd61e21729565833", "score": "0.4131005", "text": "func (sr *SyncReader) Read(p []byte) (n int, err error) {\n\tif sr.ctx.Err() != nil {\n\t\t// Error if we're already closed\n\t\treturn 0, io.ErrClosedPipe\n\t}\n\t// Don't need to re-assign the starvation window for each iteration\n\tstarver := sr.starveAfter()\n\tstarving := false\n\tfor n == 0 && (err == nil || err == ErrStarveEOF) {\n\t\tn, err = sr.r.Read(p)\n\n\t\t// We only want to proceed on in this function if the underlying\n\t\t// Reader has returned the right error\n\t\tif err != ErrStarveEOF {\n\t\t\tcontinue\n\t\t}\n\n\t\t// If we've just done our last post-starve check, and there's\n\t\t// still nothing to deliver, then we can FULLY call starved.\n\t\tif starving {\n\t\t\treturn 0, io.ErrUnexpectedEOF\n\t\t}\n\n\t\tselect {\n\t\tcase <-starver:\n\t\t\t// Go thru one more time, just to make sure we didn't\n\t\t\t// miss some stimulus\n\t\t\tstarving = true\n\t\t\tcontinue\n\t\tcase <-sr.ctx.Done():\n\t\t\treturn 0, io.ErrClosedPipe\n\t\tcase _, ok := <-sr.stim:\n\t\t\tif !ok {\n\t\t\t\treturn 0, io.ErrClosedPipe\n\t\t\t}\n\n\t\t\tif !sr.skipDrain {\n\t\t\t\t// It's possible for stimulus items to pile up, and\n\t\t\t\t// in order to reduce the number of ineffective network\n\t\t\t\t// hits, we want to drain the queue.\n\t\t\t\tempty := false\n\t\t\t\tfor !empty {\n\t\t\t\t\tselect {\n\t\t\t\t\tcase _, ok := <-sr.stim:\n\t\t\t\t\t\tif !ok {\n\t\t\t\t\t\t\treturn 0, io.ErrClosedPipe\n\t\t\t\t\t\t}\n\t\t\t\t\tdefault:\n\t\t\t\t\t\t// There's no further stimulus waiting\n\t\t\t\t\t\tempty = true\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t\t// A positive stimululs tells us to pass through the loop again\n\t\t\tcontinue\n\t\t}\n\t}\n\treturn n, err\n}", "title": "" }, { "docid": "43c7d9fa4d4e0f962955fb61a4dd1d77", "score": "0.41263452", "text": "func (rc *RowChannel) ProducerDone() {\n\tclose(rc.dataChan)\n}", "title": "" }, { "docid": "55de76dec6f7fe3b7d43a8855c16809a", "score": "0.41236377", "text": "func (ch *channel) Done() <-chan struct{} {\n\tif ch.mux.halt != nil {\n\t\treturn ch.mux.halt.ReqStopChan()\n\t}\n\treturn nil\n}", "title": "" }, { "docid": "e86ef90b2667a50559bd32ebdc7cac0d", "score": "0.4120291", "text": "func (b *QuerySnipBroadcaster) Done() <-chan bool {\n\treturn b.done\n}", "title": "" }, { "docid": "ac94265cefa15e9ddf6dadea37dcc1ac", "score": "0.41185808", "text": "func (cq *ChannelQueue[T]) oneBufferData() {\n\tvar bufLen int\n\tvar output chan T\n\tvar next, zero T\n\tinput := cq.input\n\n\tfor input != nil || output != nil {\n\t\tselect {\n\t\tcase elem, open := <-input:\n\t\t\tif open {\n\t\t\t\t// Push data from input chan to buffer.\n\t\t\t\tnext = elem\n\t\t\t\tbufLen = 1\n\t\t\t\t// Try to write it to output chan.\n\t\t\t\toutput = cq.output\n\t\t\t} else {\n\t\t\t\t// Input chan closed; do not select input chan.\n\t\t\t\tinput = nil\n\t\t\t}\n\t\tcase output <- next:\n\t\t\t// Wrote buffered data to output chan. Remove item from buffer.\n\t\t\tbufLen = 0\n\t\t\tnext = zero // set to zero to GC value\n\t\t\t// No buffered data; do not select output chan.\n\t\t\toutput = nil\n\t\tcase cq.length <- bufLen:\n\t\t}\n\t}\n\n\tclose(cq.output)\n\tclose(cq.length)\n}", "title": "" }, { "docid": "32bb5d5004f84f1c9f1f58e0953ab382", "score": "0.41158146", "text": "func (d *Dataset) Output(f func(io.Reader) error) *Dataset {\n\tstep := d.FlowContext.AddAllToOneStep(d, nil)\n\tstep.IsOnDriverSide = true\n\tstep.Name = \"Output\"\n\tstep.Function = func(task *Task) {\n\t\tvar wg sync.WaitGroup\n\t\tfor _, inChan := range task.InputChans {\n\t\t\twg.Add(1)\n\t\t\tgo func(inChan *util.Piper) {\n\t\t\t\tdefer wg.Done()\n\t\t\t\tf(inChan.Reader)\n\t\t\t\tinChan.Reader.Close()\n\t\t\t}(inChan)\n\t\t}\n\t\twg.Wait()\n\t}\n\treturn d\n}", "title": "" }, { "docid": "024abdaa93933e5385aca3ac6f649db6", "score": "0.4115749", "text": "func (server *dataServer) receiveFinalizedCuts(stream om.Order_ReportClient, sendTicker *time.Ticker) {\n\tfor {\n\t\tin, err := stream.Recv()\n\t\tif err == io.EOF {\n\t\t\treturn\n\t\t}\n\t\tif err != nil {\n\t\t\tlogger.Panicf(err.Error())\n\t\t}\n\t\tif len(in.CommittedCuts) != len(server.serverBuffers) {\n\t\t\tlogger.Panicf(\n\t\t\t\tfmt.Sprintf(\n\t\t\t\t\t\"[Data] Received cut is of irregular length (%d vs %d)\",\n\t\t\t\t\tlen(in.CommittedCuts),\n\t\t\t\t\tlen(server.serverBuffers),\n\t\t\t\t),\n\t\t\t)\n\t\t}\n\n\t\t// We should no longer receive or send requests to the ordering layer.\n\t\t// We should also label ourselves as finalized so that the discovery layer\n\t\t// does not advertise this pod again. No writes should be sent out.\n\t\tif in.Finalized {\n\t\t\t// Stop serving further Append requests\n\t\t\tserver.isFinalized = true\n\t\t\t// Stop sending tentative cuts to the ordering layer\n\t\t\tsendTicker.Stop()\n\t\t\t// Prevent discovery layer from finding this pod ever again\n\t\t\tserver.labelPodAsFinalized()\n\t\t\t// Upon returning, stop receiving cuts from the ordering layer\n\n\t\t\treturn\n\t\t}\n\n\t\tgsn := int(in.StartGlobalSequenceNum)\n\t\tfor idx, cut := range in.CommittedCuts {\n\t\t\toffset := int(in.Offsets[idx])\n\t\t\tnumLogs := int(cut) - offset\n\n\t\t\tfor i := 0; i < numLogs; i++ {\n\t\t\t\tserver.serverBuffers[idx][offset+i].gsn = int32(gsn)\n\t\t\t\tserver.stableStorage.WriteLog(gsn, server.serverBuffers[idx][offset+i].record)\n\t\t\t\t// If you were the one who received this client req, you should respond to it\n\t\t\t\tif idx == server.replicaID {\n\t\t\t\t\tserver.serverBuffers[idx][offset+i].commitResp <- gsn\n\t\t\t\t}\n\t\t\t\tgsn++\n\t\t\t}\n\t\t}\n\t}\n}", "title": "" }, { "docid": "9948f276c5be5187ec9bc714679157f0", "score": "0.41155005", "text": "func (d *DiscardRecorder) Done() <-chan struct{} {\n\treturn d.done\n}", "title": "" }, { "docid": "41ead1011db5a2721ff967d9247e3ddd", "score": "0.4111617", "text": "func (e *Event) Done() { close(e.done) }", "title": "" }, { "docid": "91743176d7d992dc261b6bcaeccc87cc", "score": "0.410781", "text": "func (m *ManagedClient) Done() <-chan struct{} {\n\treturn m.donec\n}", "title": "" } ]
03a1d3d9b4545a7440ef5f81a04a25be
All executes the query and returns a list of ImmunocompromisedGroupsSlice.
[ { "docid": "908d018c8de123cd412710b4ed40ea70", "score": "0.7725472", "text": "func (igq *ImmunocompromisedGroupsQuery) All(ctx context.Context) ([]*ImmunocompromisedGroups, error) {\n\tif err := igq.prepareQuery(ctx); err != nil {\n\t\treturn nil, err\n\t}\n\treturn igq.sqlAll(ctx)\n}", "title": "" } ]
[ { "docid": "6888b14709c53fb5a2e97d27ecf61bf3", "score": "0.6972303", "text": "func (q adminGroupQuery) All(exec boil.Executor) (AdminGroupSlice, error) {\n\tvar o []*AdminGroup\n\n\terr := q.Bind(nil, exec, &o)\n\tif err != nil {\n\t\treturn nil, errors.Wrap(err, \"models: failed to assign all query results to AdminGroup slice\")\n\t}\n\n\tif len(adminGroupAfterSelectHooks) != 0 {\n\t\tfor _, obj := range o {\n\t\t\tif err := obj.doAfterSelectHooks(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": "73a316744b5c93a4c6d0d24e02ac3690", "score": "0.65107554", "text": "func (ctrl GroupController) All(c *gin.Context) {\n\tuser := c.MustGet(cUser).(common.User)\n\tparser := util.NewQueryParser(c)\n\tmatch := bson.M{}\n\tmatch = parser.Match([]string{\"source\", \"has_active_failures\"}, match)\n\tmatch = parser.Lookups([]string{\"name\", \"description\"}, match)\n\tquery := db.Groups().Find(match)\n\torder := parser.OrderBy()\n\tif order != \"\" {\n\t\tquery.Sort(order)\n\t}\n\n\troles := new(rbac.Inventory)\n\tvar groups []ansible.Group\n\titer := query.Iter()\n\tvar tmpGroup ansible.Group\n\tfor iter.Next(&tmpGroup) {\n\t\tif !roles.ReadByID(user, tmpGroup.InventoryID) {\n\t\t\tcontinue\n\t\t}\n\t\tmetadata.GroupMetadata(&tmpGroup)\n\t\tgroups = append(groups, tmpGroup)\n\t}\n\tif err := iter.Close(); err != nil {\n\t\tAbortWithError(LogFields{Context: c, Status: http.StatusGatewayTimeout,\n\t\t\tMessage: \"Error while getting Groups\",\n\t\t\tLog: logrus.Fields{\"Error\": err.Error()},\n\t\t})\n\t\treturn\n\t}\n\n\tcount := len(groups)\n\tpgi := util.NewPagination(c, count)\n\tif pgi.HasPage() {\n\t\tAbortWithError(LogFields{Context: c, Status: http.StatusNotFound,\n\t\t\tMessage: \"#\" + strconv.Itoa(pgi.Page()) + \" page contains no results.\",\n\t\t})\n\t\treturn\n\t}\n\n\tc.JSON(http.StatusOK, common.Response{\n\t\tCount: count,\n\t\tNext: pgi.NextPage(),\n\t\tPrevious: pgi.PreviousPage(),\n\t\tData: groups[pgi.Skip():pgi.End()],\n\t})\n}", "title": "" }, { "docid": "98b63b73d145c841935c89d1c4075e55", "score": "0.63781124", "text": "func (s *SmartContract) queryAllGroups(APIstub shim.ChaincodeStubInterface) sc.Response {\n\n\tstartKey := \"0\"\n\tendKey := \"9999\"\n\n\tresultsIterator, err := APIstub.GetStateByRange(startKey, endKey)\n\tif err != nil {\n\t\treturn shim.Error(err.Error())\n\t}\n\tdefer resultsIterator.Close()\n\n\t// buffer is a JSON array containing QueryResults\n\tvar buffer bytes.Buffer\n\tbuffer.WriteString(\"[\")\n\n\tbArrayMemberAlreadyWritten := false\n\tfor resultsIterator.HasNext() {\n\t\tqueryResponse, err := resultsIterator.Next()\n\t\tif err != nil {\n\t\t\treturn shim.Error(err.Error())\n\t\t}\n\t\t// Add comma before array members,suppress it for the first array member\n\t\tif bArrayMemberAlreadyWritten == true {\n\t\t\tbuffer.WriteString(\",\")\n\t\t}\n\t\tbuffer.WriteString(\"{\\\"Key\\\":\")\n\t\tbuffer.WriteString(\"\\\"\")\n\t\tbuffer.WriteString(queryResponse.Key)\n\t\tbuffer.WriteString(\"\\\"\")\n\n\t\tbuffer.WriteString(\", \\\"Record\\\":\")\n\t\t// Record is a JSON object, so we write as-is\n\t\tbuffer.WriteString(string(queryResponse.Value))\n\t\tbuffer.WriteString(\"}\")\n\t\tbArrayMemberAlreadyWritten = true\n\t}\n\tbuffer.WriteString(\"]\")\n\n\tfmt.Printf(\"- queryAllGroups:\\n%s\\n\", buffer.String())\n\n\treturn shim.Success(buffer.Bytes())\n}", "title": "" }, { "docid": "93fd2c598ef3561b12162332c0d36075", "score": "0.6328201", "text": "func (q usersInGroupQuery) All(ctx context.Context, exec boil.ContextExecutor) (UsersInGroupSlice, error) {\n\tvar o []*UsersInGroup\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 UsersInGroup slice\")\n\t}\n\n\tif len(usersInGroupAfterSelectHooks) != 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": "5834e31bf25ef29640ff4c5e51437625", "score": "0.62964576", "text": "func (q divisionQuery) All(ctx context.Context, exec boil.ContextExecutor) (DivisionSlice, error) {\n\tvar o []*Division\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 Division slice\")\n\t}\n\n\tif len(divisionAfterSelectHooks) != 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": "574ffb25b8a8d892f5dab6aa57bb0edb", "score": "0.62499446", "text": "func (o *AdminGroupSlice) ReloadAll(exec boil.Executor) error {\n\tif o == nil || len(*o) == 0 {\n\t\treturn nil\n\t}\n\n\tslice := AdminGroupSlice{}\n\tvar args []interface{}\n\tfor _, obj := range *o {\n\t\tpkeyArgs := queries.ValuesFromMapping(reflect.Indirect(reflect.ValueOf(obj)), adminGroupPrimaryKeyMapping)\n\t\targs = append(args, pkeyArgs...)\n\t}\n\n\tsql := \"SELECT \\\"admin_group\\\".* FROM \\\"admin_group\\\" WHERE \" +\n\t\tstrmangle.WhereClauseRepeated(string(dialect.LQ), string(dialect.RQ), 1, adminGroupPrimaryKeyColumns, len(*o))\n\n\tq := queries.Raw(sql, args...)\n\n\terr := q.Bind(nil, exec, &slice)\n\tif err != nil {\n\t\treturn errors.Wrap(err, \"models: unable to reload all in AdminGroupSlice\")\n\t}\n\n\t*o = slice\n\n\treturn nil\n}", "title": "" }, { "docid": "843611548648e385cf87bce02ca3ec56", "score": "0.6234504", "text": "func (q groupLogQuery) All(ctx context.Context, exec boil.ContextExecutor) (GroupLogSlice, error) {\n\tvar o []*GroupLog\n\n\terr := q.Bind(ctx, exec, &o)\n\tif err != nil {\n\t\treturn nil, errors.Wrap(err, \"dbmodel: failed to assign all query results to GroupLog slice\")\n\t}\n\n\tif len(groupLogAfterSelectHooks) != 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": "a6d6b4859c49b5a06ff5201cd9ef96f5", "score": "0.61445135", "text": "func (igq *ImmunocompromisedGroupsQuery) AllX(ctx context.Context) []*ImmunocompromisedGroups {\n\tnodes, err := igq.All(ctx)\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\treturn nodes\n}", "title": "" }, { "docid": "cb3c09042ef25b2540b1b3a27d5a06a3", "score": "0.60762274", "text": "func (s *pgService) FindAll() ([]domain.Group, error) {\n\tres := []domain.Group{}\n\treturn res, s.db.Find(&res).Error\n}", "title": "" }, { "docid": "85fd91b44fd15593096aa6c0188978c6", "score": "0.6052829", "text": "func (q networkSnapshotQuery) All(ctx context.Context, exec boil.ContextExecutor) (NetworkSnapshotSlice, error) {\n\tvar o []*NetworkSnapshot\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 NetworkSnapshot slice\")\n\t}\n\n\treturn o, nil\n}", "title": "" }, { "docid": "8afd79e5269be59f0a17ffd98caee25e", "score": "0.59885955", "text": "func (o *UsersInGroupSlice) ReloadAll(ctx context.Context, exec boil.ContextExecutor) error {\n\tif o == nil || len(*o) == 0 {\n\t\treturn nil\n\t}\n\n\tslice := UsersInGroupSlice{}\n\tvar args []interface{}\n\tfor _, obj := range *o {\n\t\tpkeyArgs := queries.ValuesFromMapping(reflect.Indirect(reflect.ValueOf(obj)), usersInGroupPrimaryKeyMapping)\n\t\targs = append(args, pkeyArgs...)\n\t}\n\n\tsql := \"SELECT `users_in_groups`.* FROM `users_in_groups` WHERE \" +\n\t\tstrmangle.WhereClauseRepeated(string(dialect.LQ), string(dialect.RQ), 0, usersInGroupPrimaryKeyColumns, len(*o))\n\n\tq := queries.Raw(sql, args...)\n\n\terr := q.Bind(ctx, exec, &slice)\n\tif err != nil {\n\t\treturn errors.Wrap(err, \"models: unable to reload all in UsersInGroupSlice\")\n\t}\n\n\t*o = slice\n\n\treturn nil\n}", "title": "" }, { "docid": "902e9ce2906c23cfdf15a6cb08b4f6c9", "score": "0.59606", "text": "func (g GitlabLazyQuerier) Groups() []string {\n\treturn util.ToStringSlice(g.groups)\n}", "title": "" }, { "docid": "3eab198cfed9de30e891363107e134f4", "score": "0.595613", "text": "func (q authGroupPermissionQuery) All(ctx context.Context, exec boil.ContextExecutor) (AuthGroupPermissionSlice, error) {\n\tvar o []*AuthGroupPermission\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 AuthGroupPermission slice\")\n\t}\n\n\tif len(authGroupPermissionAfterSelectHooks) != 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": "a60614343a65b68697820df0df2b7d1a", "score": "0.58840567", "text": "func (vi VoiceIt2) GetAllGroups() ([]byte, error) {\n\treq, err := http.NewRequest(\"GET\", vi.BaseUrl+\"/groups\"+vi.NotificationUrl, nil)\n\tif err != nil {\n\t\treturn []byte{}, errors.New(\"GetAllGroups Exception: \" + err.Error())\n\t}\n\treq.SetBasicAuth(vi.APIKey, vi.APIToken)\n\treq.Header.Add(\"platformId\", PlatformId)\n\treq.Header.Add(\"platformVersion\", PlatformVersion)\n\n\tclient := &http.Client{}\n\tresp, err := client.Do(req)\n\tif err != nil {\n\t\treturn []byte{}, errors.New(\"GetAllGroups Exception: \" + err.Error())\n\t}\n\tdefer resp.Body.Close()\n\treply, err := ioutil.ReadAll(resp.Body)\n\tif err != nil {\n\t\treturn []byte{}, errors.New(\"GetAllGroups Exception: \" + err.Error())\n\t}\n\treturn reply, nil\n}", "title": "" }, { "docid": "9e6caf74f3b8a9be7d509c7af744ce66", "score": "0.5846952", "text": "func (g *Groups) ListAll(rw http.ResponseWriter, r *http.Request) {\n\tg.l.Println(\"get all groups\")\n\n\tgroups := data.GetGroups(g.Db)\n\n\terr := data.ToJSON(&groups, rw)\n\tif err != nil {\n\t\tg.l.Println(\"error encoding groups\")\n\t}\n}", "title": "" }, { "docid": "4a1b2724aa026b8682f839d0eba23584", "score": "0.5846207", "text": "func (q cardQuery) All(ctx context.Context, exec boil.ContextExecutor) (CardSlice, error) {\n\tvar o []*Card\n\n\terr := q.Bind(ctx, exec, &o)\n\tif err != nil {\n\t\treturn nil, errors.Wrap(err, \"model: failed to assign all query results to Card slice\")\n\t}\n\n\tif len(cardAfterSelectHooks) != 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": "6511022fe49a6328d20687d3bc1cc3b4", "score": "0.58085036", "text": "func (vi *VoiceIt2) GetAllGroups() string {\n\n body := &bytes.Buffer{}\n writer := multipart.NewWriter(body)\n writer.Close()\n\n req, _ := http.NewRequest(\"GET\", vi.BaseUrl + \"/groups\", body)\n req.SetBasicAuth(vi.ApiKey, vi.ApiToken)\n req.Header.Add(\"Content-Type\", writer.FormDataContentType())\n\n client := &http.Client{}\n resp, _ := client.Do(req)\n defer resp.Body.Close()\n reply, _ := ioutil.ReadAll(resp.Body)\n return string(reply)\n}", "title": "" }, { "docid": "559862cd6e47be7bd63003cc31cc3234", "score": "0.57667595", "text": "func (o *GroupLogSlice) ReloadAll(ctx context.Context, exec boil.ContextExecutor) error {\n\tif o == nil || len(*o) == 0 {\n\t\treturn nil\n\t}\n\n\tslice := GroupLogSlice{}\n\tvar args []interface{}\n\tfor _, obj := range *o {\n\t\tpkeyArgs := queries.ValuesFromMapping(reflect.Indirect(reflect.ValueOf(obj)), groupLogPrimaryKeyMapping)\n\t\targs = append(args, pkeyArgs...)\n\t}\n\n\tsql := \"SELECT \\\"group_logs\\\".* FROM \\\"group_logs\\\" WHERE \" +\n\t\tstrmangle.WhereClauseRepeated(string(dialect.LQ), string(dialect.RQ), 0, groupLogPrimaryKeyColumns, len(*o))\n\n\tq := queries.Raw(sql, args...)\n\n\terr := q.Bind(ctx, exec, &slice)\n\tif err != nil {\n\t\treturn errors.Wrap(err, \"dbmodel: unable to reload all in GroupLogSlice\")\n\t}\n\n\t*o = slice\n\n\treturn nil\n}", "title": "" }, { "docid": "25396e38e2cc5762fffcaf246a381cfe", "score": "0.57640874", "text": "func (q authorizeQuery) All() (AuthorizeSlice, error) {\n\tvar o AuthorizeSlice\n\n\terr := q.Bind(&o)\n\tif err != nil {\n\t\treturn nil, errors.Wrap(err, \"public: failed to assign all query results to Authorize slice\")\n\t}\n\n\tif len(authorizeAfterSelectHooks) != 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": "b4b93cb6bf306b6f2d15bf1849e12d2a", "score": "0.5759888", "text": "func (a *GroupApiService) AllGroups(ctx _context.Context, localVarOptionals *AllGroupsOpts) ([]Group, *_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 []Group\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\tif localVarOptionals != nil && localVarOptionals.Fields.IsSet() {\n\t\tlocalVarQueryParams.Add(\"fields\", parameterToString(localVarOptionals.Fields.Value(), \"\"))\n\t}\n\tif localVarOptionals != nil && localVarOptionals.Page.IsSet() {\n\t\tlocalVarQueryParams.Add(\"page\", parameterToString(localVarOptionals.Page.Value(), \"\"))\n\t}\n\tif localVarOptionals != nil && localVarOptionals.PerPage.IsSet() {\n\t\tlocalVarQueryParams.Add(\"per_page\", parameterToString(localVarOptionals.PerPage.Value(), \"\"))\n\t}\n\tif localVarOptionals != nil && localVarOptionals.Sorts.IsSet() {\n\t\tlocalVarQueryParams.Add(\"sorts\", parameterToString(localVarOptionals.Sorts.Value(), \"\"))\n\t}\n\tif localVarOptionals != nil && localVarOptionals.Ids.IsSet() {\n\t\tlocalVarQueryParams.Add(\"ids\", parameterToString(localVarOptionals.Ids.Value(), \"csv\"))\n\t}\n\tif localVarOptionals != nil && localVarOptionals.ContentMetadataId.IsSet() {\n\t\tlocalVarQueryParams.Add(\"content_metadata_id\", parameterToString(localVarOptionals.ContentMetadataId.Value(), \"\"))\n\t}\n\tif localVarOptionals != nil && localVarOptionals.CanAddToContentMetadata.IsSet() {\n\t\tlocalVarQueryParams.Add(\"can_add_to_content_metadata\", parameterToString(localVarOptionals.CanAddToContentMetadata.Value(), \"\"))\n\t}\n\t// to determine the Content-Type header\n\tlocalVarHTTPContentTypes := []string{}\n\n\t// set Content-Type header\n\tlocalVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes)\n\tif localVarHTTPContentType != \"\" {\n\t\tlocalVarHeaderParams[\"Content-Type\"] = localVarHTTPContentType\n\t}\n\n\t// to determine the Accept header\n\tlocalVarHTTPHeaderAccepts := []string{\"application/json\"}\n\n\t// set Accept header\n\tlocalVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts)\n\tif localVarHTTPHeaderAccept != \"\" {\n\t\tlocalVarHeaderParams[\"Accept\"] = localVarHTTPHeaderAccept\n\t}\n\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 == 200 {\n\t\t\tvar v []Group\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 == 400 {\n\t\t\tvar v Error\n\t\t\terr = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get(\"Content-Type\"))\n\t\t\tif err != nil {\n\t\t\t\tnewErr.error = err.Error()\n\t\t\t\treturn localVarReturnValue, localVarHTTPResponse, newErr\n\t\t\t}\n\t\t\tnewErr.model = v\n\t\t\treturn localVarReturnValue, localVarHTTPResponse, newErr\n\t\t}\n\t\tif localVarHTTPResponse.StatusCode == 404 {\n\t\t\tvar v Error\n\t\t\terr = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get(\"Content-Type\"))\n\t\t\tif err != nil {\n\t\t\t\tnewErr.error = err.Error()\n\t\t\t\treturn localVarReturnValue, localVarHTTPResponse, newErr\n\t\t\t}\n\t\t\tnewErr.model = v\n\t\t}\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": "76381e7377c1d1b6849cfedd44804f7a", "score": "0.57559216", "text": "func (inv *Inv) queryGroups() ([]*spreadsheet.Payload, error) {\n\tdefer logDuration()()\n\treturn inv.walkAccounts(func(account string, cred *credentials.Credentials, sess *session.Session) (*spreadsheet.Payload, error) {\n\t\tsvc := helpers.IamSvc{\n\t\t\tClient: iam.New(sess, &aws.Config{Credentials: cred}),\n\t\t}\n\t\tgroups, err := svc.Groups()\n\t\tif err != nil {\n\t\t\treturn nil, newQueryErrorf(err, \"failed to get Groups for account: %s -> %v\", account, err)\n\t\t}\n\t\tvar items []interface{}\n\t\tfor _, g := range groups {\n\t\t\titems = append(items, g)\n\t\t}\n\t\treturn &spreadsheet.Payload{Static: []string{account}, Items: items}, nil\n\t})\n}", "title": "" }, { "docid": "6aab4cd8bf0dd11605bff0b0c007cd84", "score": "0.5732023", "text": "func dbGroupSlice(c buffalo.Context) (*groupSlice, error) {\n\tdbGroups, err := models.Groups().All(c, modelext.GetTx(c))\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\tgroups := make(groupSlice, len(dbGroups))\n\tfor i, group := range dbGroups {\n\t\tgroups[i] = &innerGroup{\n\t\t\tID: &group.ID,\n\t\t\tName: &group.Name,\n\t\t\tZoomLink: &group.ZoomLink,\n\t\t\tPublished: &group.Published,\n\t\t\tArchived: &group.Archived,\n\t\t}\n\t}\n\treturn &groups, nil\n}", "title": "" }, { "docid": "33d717049bbe652ff0757be8abf30137", "score": "0.57292795", "text": "func (q volumeQuery) All() (VolumeSlice, error) {\n\tvar o VolumeSlice\n\n\terr := q.Bind(&o)\n\tif err != nil {\n\t\treturn nil, errors.Wrap(err, \"public: failed to assign all query results to Volume slice\")\n\t}\n\n\tif len(volumeAfterSelectHooks) != 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": "b0ebbd335b51841bb92686f6cf0e79c1", "score": "0.5722505", "text": "func (l *Loader) AllGroups(logger log.Logger, seed *api.ContentsDefinition) ([]*api.Group, error) {\n\tif seed == nil {\n\t\treturn nil, errors.New(\"no seed provided\")\n\t}\n\tgroups, err := l.Groups(logger, seed.GroupKeys)\n\tif err != nil {\n\t\treturn nil, errors.Wrap(err, \"loading groups recursively\")\n\t}\n\tif len(seed.Items) > 0 {\n\t\tgroups = append(groups, &api.Group{\n\t\t\tName: \"Individual Items\",\n\t\t\tContents: &api.ContentsDefinition{\n\t\t\t\tItems: seed.Items,\n\t\t\t},\n\t\t})\n\t}\n\treturn groups, nil\n}", "title": "" }, { "docid": "fbf020675b8252394945a4d3243ea2eb", "score": "0.5710796", "text": "func (s *Service) AllGroups(ctx context.Context, userContext am.UserContext, groupFilter *am.ScanGroupFilter) (groups []*am.ScanGroup, err error) {\n\tif !s.IsAuthorized(ctx, userContext, am.RNScanGroupAllGroups, \"read\") {\n\t\treturn nil, am.ErrUserNotAuthorized\n\t}\n\n\tvar rows *pgx.Rows\n\n\tserviceLog := log.With().\n\t\tInt(\"UserID\", userContext.GetUserID()).\n\t\tInt(\"OrgID\", userContext.GetOrgID()).\n\t\tStr(\"TraceID\", userContext.GetTraceID()).Logger()\n\n\tserviceLog.Info().Msg(\"Retrieving All Groups\")\n\n\tif val, ok := groupFilter.Filters.Bool(\"paused\"); ok {\n\t\tserviceLog.Info().Bool(\"paused\", val).Msg(\"querying with paused\")\n\t\trows, err = s.pool.Query(\"allScanGroupsWithPaused\", val)\n\t} else {\n\t\tserviceLog.Info().Msg(\"querying all scan groups\")\n\t\trows, err = s.pool.Query(\"allScanGroups\")\n\t}\n\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\tdefer rows.Close()\n\n\tgroups = make([]*am.ScanGroup, 0)\n\tfor rows.Next() {\n\t\tvar createTime time.Time\n\t\tvar modifyTime time.Time\n\t\tvar pausedTime time.Time\n\n\t\tgroup := &am.ScanGroup{}\n\t\tif err := rows.Scan(&group.OrgID, &group.GroupID, &group.GroupName, &createTime, &group.CreatedBy,\n\t\t\t&group.CreatedByID, &modifyTime, &group.ModifiedBy, &group.ModifiedByID, &group.OriginalInputS3URL,\n\t\t\t&group.ModuleConfigurations, &group.Paused, &group.Deleted, &pausedTime, &group.ArchiveAfterDays); err != nil {\n\t\t\treturn nil, err\n\t\t}\n\t\tgroup.CreationTime = createTime.UnixNano()\n\t\tgroup.ModifiedTime = modifyTime.UnixNano()\n\t\tgroup.LastPausedTime = pausedTime.UnixNano()\n\n\t\tgroups = append(groups, group)\n\t}\n\n\treturn groups, nil\n}", "title": "" }, { "docid": "39dd98a4826304b2ae3d101ff3b2dc5b", "score": "0.5709812", "text": "func (q adminGroupQuery) AllG() (AdminGroupSlice, error) {\n\treturn q.All(boil.GetDB())\n}", "title": "" }, { "docid": "9df586b68c98559d2a827b4ab3d85182", "score": "0.570742", "text": "func (q mcontentQuery) All(ctx context.Context, exec boil.ContextExecutor) (McontentSlice, error) {\n\tvar o []*Mcontent\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 Mcontent slice\")\n\t}\n\n\tif len(mcontentAfterSelectHooks) != 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": "4a4b31f82c37589f51fd1ff0d1f27995", "score": "0.56936", "text": "func (q volumeAccessQuery) All() (VolumeAccessSlice, error) {\n\tvar o VolumeAccessSlice\n\n\terr := q.Bind(&o)\n\tif err != nil {\n\t\treturn nil, errors.Wrap(err, \"public: failed to assign all query results to VolumeAccess slice\")\n\t}\n\n\tif len(volumeAccessAfterSelectHooks) != 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": "927016e4d652d3963809d7fe2d803ae9", "score": "0.5692161", "text": "func (o *DivisionSlice) ReloadAll(ctx context.Context, exec boil.ContextExecutor) error {\n\tif o == nil || len(*o) == 0 {\n\t\treturn nil\n\t}\n\n\tslice := DivisionSlice{}\n\tvar args []interface{}\n\tfor _, obj := range *o {\n\t\tpkeyArgs := queries.ValuesFromMapping(reflect.Indirect(reflect.ValueOf(obj)), divisionPrimaryKeyMapping)\n\t\targs = append(args, pkeyArgs...)\n\t}\n\n\tsql := \"SELECT `division`.* FROM `division` WHERE \" +\n\t\tstrmangle.WhereClauseRepeated(string(dialect.LQ), string(dialect.RQ), 0, divisionPrimaryKeyColumns, len(*o))\n\n\tq := queries.Raw(sql, args...)\n\n\terr := q.Bind(ctx, exec, &slice)\n\tif err != nil {\n\t\treturn errors.Wrap(err, \"models: unable to reload all in DivisionSlice\")\n\t}\n\n\t*o = slice\n\n\treturn nil\n}", "title": "" }, { "docid": "4fc4cdd7701a1cbc85beff7fdeeb32ce", "score": "0.566451", "text": "func (g *GroupsRepo) GetGroups() ([]*models.Group, error) {\n var groups []*models.Group\n err := g.DB.Model(&groups).Order(\"id\").Select()\n if err != nil {\n return nil, err\n }\n return groups, nil\n}", "title": "" }, { "docid": "a8b887c0308ad50c8127f7f2de5634f0", "score": "0.5617805", "text": "func (q channelQuery) All(ctx context.Context, exec boil.ContextExecutor) (ChannelSlice, error) {\n\tvar o []*Channel\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 Channel slice\")\n\t}\n\n\tif len(channelAfterSelectHooks) != 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": "63dcffefbe19665b501a4a6fb084d4e7", "score": "0.5616537", "text": "func (q cmfLevelQuery) All(ctx context.Context, exec boil.ContextExecutor) (CMFLevelSlice, error) {\n\tvar o []*CMFLevel\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 CMFLevel slice\")\n\t}\n\n\tif len(cmfLevelAfterSelectHooks) != 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": "1df395ac65ae393a3441259c57c3dfe3", "score": "0.5608946", "text": "func (q gameStatQuery) All(ctx context.Context, exec boil.ContextExecutor) (GameStatSlice, error) {\n\tvar o []*GameStat\n\n\terr := q.Bind(ctx, exec, &o)\n\tif err != nil {\n\t\treturn nil, errors.Wrap(err, \"datamodels_raw: failed to assign all query results to GameStat slice\")\n\t}\n\n\tif len(gameStatAfterSelectHooks) != 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": "7ac5e1a1c758d3ac6e3f725e28e0e16b", "score": "0.5597539", "text": "func (o *AuthGroupPermissionSlice) ReloadAll(ctx context.Context, exec boil.ContextExecutor) error {\n\tif o == nil || len(*o) == 0 {\n\t\treturn nil\n\t}\n\n\tslice := AuthGroupPermissionSlice{}\n\tvar args []interface{}\n\tfor _, obj := range *o {\n\t\tpkeyArgs := queries.ValuesFromMapping(reflect.Indirect(reflect.ValueOf(obj)), authGroupPermissionPrimaryKeyMapping)\n\t\targs = append(args, pkeyArgs...)\n\t}\n\n\tsql := \"SELECT \\\"auth_group_permissions\\\".* FROM \\\"auth_group_permissions\\\" WHERE \" +\n\t\tstrmangle.WhereClauseRepeated(string(dialect.LQ), string(dialect.RQ), 1, authGroupPermissionPrimaryKeyColumns, len(*o))\n\n\tq := queries.Raw(sql, args...)\n\n\terr := q.Bind(ctx, exec, &slice)\n\tif err != nil {\n\t\treturn errors.Wrap(err, \"models: unable to reload all in AuthGroupPermissionSlice\")\n\t}\n\n\t*o = slice\n\n\treturn nil\n}", "title": "" }, { "docid": "0a77605945acfa7a7a19947bcc2387ea", "score": "0.5594248", "text": "func (d *Dao) All(ctx context.Context) ([]*region.Region, error) {\n\trows, err := d.get.Query(ctx)\n\tif err != nil {\n\t\tlog.Error(\"mysqlDB.Query error(%v)\", err)\n\t\treturn nil, err\n\t}\n\tdefer rows.Close()\n\tapps := []*region.Region{}\n\tfor rows.Next() {\n\t\ta := &region.Region{}\n\t\tif err = rows.Scan(&a.Rid, &a.Reid, &a.Name, &a.Logo, &a.Rank, &a.Goto, &a.Param, &a.Plat, &a.Area, &a.Build, &a.Condition, &a.URI, &a.Islogo, &a.Rtype, &a.Entrance, &a.Language); err != nil {\n\t\t\tlog.Error(\"row.Scan error(%v)\", err)\n\t\t\treturn nil, err\n\t\t}\n\t\tapps = append(apps, a)\n\t}\n\treturn apps, err\n}", "title": "" }, { "docid": "d35e06ef06553e928346a56b0be2ad2b", "score": "0.5587674", "text": "func (s *GroupsService) ListAll(ctx context.Context, opts *ListOptions) (*GroupsResponse, error) {\n\tu := msgraph.URL(Groups).Options(opts).Build()\n\treq, err := s.client.NewRequest(http.MethodGet, u, nil)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\tvar groupsResponse GroupsResponse\n\t_, err = s.client.Do(ctx, req, &groupsResponse)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\treturn &groupsResponse, nil\n}", "title": "" }, { "docid": "e7e7e96d470222f544c3727e325bb2cc", "score": "0.55853933", "text": "func (q recordQuery) All() (RecordSlice, error) {\n\tvar o RecordSlice\n\n\terr := q.Bind(&o)\n\tif err != nil {\n\t\treturn nil, errors.Wrap(err, \"public: failed to assign all query results to Record slice\")\n\t}\n\n\tif len(recordAfterSelectHooks) != 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": "5f914bcd1e145c19253fa5e6b9c2843c", "score": "0.55832946", "text": "func (q passengerQuery) All(ctx context.Context, exec boil.ContextExecutor) (PassengerSlice, error) {\n\tvar o []*Passenger\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 Passenger slice\")\n\t}\n\n\tif len(passengerAfterSelectHooks) != 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": "680b35ef77932206174ac69cbbf28bd1", "score": "0.5576196", "text": "func (r *DefaultGroupsRepo) FindAll() (t types.Groups, err error) {\n\terr = r.coll.Find(nil).All(&t)\n\treturn t, err\n}", "title": "" }, { "docid": "f47a4300a0ea978ba6618ae6ce2faa9a", "score": "0.55518883", "text": "func ListAllGroup(w http.ResponseWriter, r *http.Request) {\n\tfLog := groupMgmtLog.WithField(\"func\", \"ListAllGroup\").WithField(\"RequestID\", r.Context().Value(constants.RequestID)).WithField(\"path\", r.URL.Path).WithField(\"method\", r.Method)\n\n\tiauthctx := r.Context().Value(constants.HansipAuthentication)\n\tif iauthctx == nil {\n\t\thelper.WriteHTTPResponse(r.Context(), w, http.StatusUnauthorized, \"You are not authorized to access this resource\", nil, nil)\n\t\treturn\n\t}\n\n\tparams, err := helper.ParsePathParams(fmt.Sprintf(\"%s/management/tenant/{tenantRecId}/groups\", apiPrefix), r.URL.Path)\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\n\ttenant, err := TenantRepo.GetTenantByRecID(r.Context(), params[\"tenantRecId\"])\n\tif err != nil {\n\t\tfLog.Errorf(\"TenantRepo.GetTenantByRecID got %s\", err.Error())\n\t\thelper.WriteHTTPResponse(r.Context(), w, http.StatusInternalServerError, err.Error(), nil, nil)\n\t\treturn\n\t}\n\tif tenant == nil {\n\t\thelper.WriteHTTPResponse(r.Context(), w, http.StatusNotFound, fmt.Sprintf(\"Tenant %s not found\", params[\"tenantRecId\"]), nil, nil)\n\t\treturn\n\t}\n\n\tauthCtx := iauthctx.(*hansipcontext.AuthenticationContext)\n\tif !authCtx.IsAdminOfDomain(tenant.Domain) {\n\t\thelper.WriteHTTPResponse(r.Context(), w, http.StatusForbidden, \"You don't have the right to access group with the specified domain\", nil, nil)\n\t\treturn\n\t}\n\n\tpageRequest, err := helper.NewPageRequestFromRequest(r)\n\tif err != nil {\n\t\tfLog.Errorf(\"helper.NewPageRequestFromRequest got %s\", err.Error())\n\t\thelper.WriteHTTPResponse(r.Context(), w, http.StatusBadRequest, err.Error(), nil, nil)\n\t\treturn\n\t}\n\tgroups, page, err := GroupRepo.ListGroups(r.Context(), tenant, pageRequest)\n\tif err != nil {\n\t\tfLog.Errorf(\"GroupRepo.ListGroups got %s\", err.Error())\n\t\thelper.WriteHTTPResponse(r.Context(), w, http.StatusInternalServerError, err.Error(), nil, nil)\n\t\treturn\n\t}\n\tret := make(map[string]interface{})\n\tret[\"groups\"] = groups\n\tret[\"page\"] = page\n\thelper.WriteHTTPResponse(r.Context(), w, http.StatusOK, \"List of all user paginated\", nil, ret)\n}", "title": "" }, { "docid": "978c0ebe95f99f13da9fb8abe9292919", "score": "0.5545425", "text": "func (gsq *GameServerQuery) All(ctx context.Context) ([]*GameServer, error) {\n\tif err := gsq.prepareQuery(ctx); err != nil {\n\t\treturn nil, err\n\t}\n\treturn gsq.sqlAll(ctx)\n}", "title": "" }, { "docid": "3c9e64c82192419f71bce1591cdd66fb", "score": "0.5532275", "text": "func (r *GroupRead) list(q *msg.Request, mr *msg.Result) {\n\tvar (\n\t\tgroupID, groupName, bucketID string\n\t\trows *sql.Rows\n\t\terr error\n\t)\n\n\tif rows, err = r.stmtList.Query(\n\t\tq.Section,\n\t\tq.Action,\n\t\tq.AuthUser,\n\t\tq.Bucket.ID,\n\t); err != nil {\n\t\tmr.ServerError(err, q.Section)\n\t\treturn\n\t}\n\n\tfor rows.Next() {\n\t\tif err = rows.Scan(\n\t\t\t&groupID,\n\t\t\t&groupName,\n\t\t\t&bucketID,\n\t\t); err != nil {\n\t\t\trows.Close()\n\t\t\tmr.ServerError(err, q.Section)\n\t\t\treturn\n\t\t}\n\t\tmr.Group = append(mr.Group, proto.Group{\n\t\t\tID: groupID,\n\t\t\tName: groupName,\n\t\t\tBucketID: bucketID,\n\t\t})\n\t}\n\tif err = rows.Err(); err != nil {\n\t\tmr.ServerError(err, q.Section)\n\t\treturn\n\t}\n\tmr.OK()\n}", "title": "" }, { "docid": "fbf4bd8038672870f3491f126aedd4ed", "score": "0.55174804", "text": "func (c *client) Groups() ([]Group) {\n\tres := c.newSearchRequest(\"type:group\")\n\n\t// Decode results \n\tgroups := make([]Group, res.Count)\n\tjson.Unmarshal(res.Results, &groups)\n\t\n\treturn groups\n}", "title": "" }, { "docid": "edacaaaf132406d4d8e024978d826c0a", "score": "0.5496529", "text": "func getGroups(e echo.Context) error {\n\tdb := e.Get(\"database\").(*mgo.Database)\n\tif db == nil {\n\t\treturn fmt.Errorf(\"Bad database session\")\n\t}\n\n\t// uuid, err := uuid.FromString(e.QueryParam(\"siteUuid\"))\n\t// if err != nil {\n\t// \treturn fmt.Errorf(\"Bad parameters\")\n\t// }\n\n\tg := models.Groups{\n\t\tGroups: []models.Group{},\n\t}\n\n\terr := db.C(\"Groups\").Find(nil).All(&g.Groups)\n\tif err != nil {\n\t\treturn e.NoContent(http.StatusNotFound)\n\t}\n\treturn e.JSON(http.StatusOK, g)\n}", "title": "" }, { "docid": "67ff8ccea60f3e95d7f35f938f457e55", "score": "0.5490406", "text": "func (q judgementPrincipleQuery) All(ctx context.Context, exec boil.ContextExecutor) (JudgementPrincipleSlice, error) {\n\tvar o []*JudgementPrinciple\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 JudgementPrinciple slice\")\n\t}\n\n\treturn o, nil\n}", "title": "" }, { "docid": "29ea9f4440e5f9359cc081a2d2b34d19", "score": "0.54750866", "text": "func (o *CardSlice) ReloadAll(ctx context.Context, exec boil.ContextExecutor) error {\n\tif o == nil || len(*o) == 0 {\n\t\treturn nil\n\t}\n\n\tslice := CardSlice{}\n\tvar args []interface{}\n\tfor _, obj := range *o {\n\t\tpkeyArgs := queries.ValuesFromMapping(reflect.Indirect(reflect.ValueOf(obj)), cardPrimaryKeyMapping)\n\t\targs = append(args, pkeyArgs...)\n\t}\n\n\tsql := \"SELECT `cards`.* FROM `cards` WHERE \" +\n\t\tstrmangle.WhereClauseRepeated(string(dialect.LQ), string(dialect.RQ), 0, cardPrimaryKeyColumns, len(*o))\n\n\tq := queries.Raw(sql, args...)\n\n\terr := q.Bind(ctx, exec, &slice)\n\tif err != nil {\n\t\treturn errors.Wrap(err, \"model: unable to reload all in CardSlice\")\n\t}\n\n\t*o = slice\n\n\treturn nil\n}", "title": "" }, { "docid": "cbb0560b5cb79ba89ae08e7d40906d86", "score": "0.54685706", "text": "func (q migMigrationQuery) All() (MigMigrationSlice, error) {\n\tvar o []*MigMigration\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 MigMigration slice\")\n\t}\n\n\tif len(migMigrationAfterSelectHooks) != 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": "cc535b8e1b754136504b7d24ea7c53e6", "score": "0.54640204", "text": "func (c *CheckEngine) GetAllCheckgroups() (error,[]byte) {\n env.Output.WriteChDebug(\"(CheckEngine::GetAllCheckgroups)\")\n var groups *Checkgroups\n\n if groups = c.GetCheckgroups(); groups == nil {\n msg := \"(CheckEngine::GetAllCheckgroups) There are no check groups defined.\"\n env.Output.WriteChDebug(msg)\n return errors.New(msg), nil\n }\n\n return utils.ObjectToJsonByte(groups)\n}", "title": "" }, { "docid": "3db51916b95bbe6e5d713f92cb09fa3e", "score": "0.54527664", "text": "func (q collectionsContentUnitQuery) All(exec boil.Executor) (CollectionsContentUnitSlice, error) {\n\tvar o []*CollectionsContentUnit\n\n\terr := q.Bind(nil, exec, &o)\n\tif err != nil {\n\t\treturn nil, errors.Wrap(err, \"mdbmodels: failed to assign all query results to CollectionsContentUnit slice\")\n\t}\n\n\treturn o, nil\n}", "title": "" }, { "docid": "b5aa2cc1d4d22f27bab612d6ee9c97ae", "score": "0.54394746", "text": "func (cs *Mock) All() container.Containers {\n\tcs.containers.Sort()\n\tcs.containers.Filter()\n\treturn cs.containers\n}", "title": "" }, { "docid": "44c8052a452b5c899268e77e00a87a4b", "score": "0.542975", "text": "func (o *AdminGroupSlice) ReloadAllG() error {\n\tif o == nil {\n\t\treturn errors.New(\"models: empty AdminGroupSlice provided for reload all\")\n\t}\n\n\treturn o.ReloadAll(boil.GetDB())\n}", "title": "" }, { "docid": "eba64e866316031af4ee9da79f72443f", "score": "0.5417903", "text": "func apiGroupAll(c *ctx.Context, g *grouper, w http.ResponseWriter, r *http.Request) {\n\tstart := intParamFrom(r, \"start\", 0)\n\tlimit := intParamFrom(r, \"limit\", 10)\n\ttmp, err := getTmpGroups(c, g, start, limit)\n\tif err != nil {\n\t\tlog.Panic(err)\n\t}\n\thrt, err := getHrtGroups(c, g, start, limit)\n\tif err != nil {\n\t\tlog.Panic(err)\n\t}\n\n\tres := struct {\n\t\tTmp []tmpGroup\n\t\tHrt []hrtGroup\n\t}{\n\t\ttmp,\n\t\thrt,\n\t}\n\n\tMust(WriteJSON(w, &res))\n}", "title": "" }, { "docid": "d8911e8ff6ef743a35226d966d7be709", "score": "0.5416238", "text": "func (q imageQuery) All(ctx context.Context, exec boil.ContextExecutor) (ImageSlice, error) {\n\tvar o []*Image\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 Image slice\")\n\t}\n\n\tif len(imageAfterSelectHooks) != 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": "5ffde7ca80b56349f10e9f14d912a2e3", "score": "0.5400154", "text": "func (o *McontentSlice) ReloadAll(ctx context.Context, exec boil.ContextExecutor) error {\n\tif o == nil || len(*o) == 0 {\n\t\treturn nil\n\t}\n\n\tslice := McontentSlice{}\n\tvar args []interface{}\n\tfor _, obj := range *o {\n\t\tpkeyArgs := queries.ValuesFromMapping(reflect.Indirect(reflect.ValueOf(obj)), mcontentPrimaryKeyMapping)\n\t\targs = append(args, pkeyArgs...)\n\t}\n\n\tsql := \"SELECT \\\"mcontents\\\".* FROM \\\"mcontents\\\" WHERE \" +\n\t\tstrmangle.WhereClauseRepeated(string(dialect.LQ), string(dialect.RQ), 1, mcontentPrimaryKeyColumns, len(*o))\n\n\tq := queries.Raw(sql, args...)\n\n\terr := q.Bind(ctx, exec, &slice)\n\tif err != nil {\n\t\treturn errors.Wrap(err, \"models: unable to reload all in McontentSlice\")\n\t}\n\n\t*o = slice\n\n\treturn nil\n}", "title": "" }, { "docid": "6ce754d93f89d03ec558c866f9a256fb", "score": "0.53815097", "text": "func (a *GroupApiService) AllGroupGroups(ctx _context.Context, groupId int64, localVarOptionals *AllGroupGroupsOpts) ([]Group, *_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 []Group\n\t)\n\n\t// create path and map variables\n\tlocalVarPath := a.client.cfg.BasePath + \"/groups/{group_id}/groups\"\n\tlocalVarPath = strings.Replace(localVarPath, \"{\"+\"group_id\"+\"}\", _neturl.QueryEscape(parameterToString(groupId, \"\")) , -1)\n\n\tlocalVarHeaderParams := make(map[string]string)\n\tlocalVarQueryParams := _neturl.Values{}\n\tlocalVarFormParams := _neturl.Values{}\n\n\tif localVarOptionals != nil && localVarOptionals.Fields.IsSet() {\n\t\tlocalVarQueryParams.Add(\"fields\", parameterToString(localVarOptionals.Fields.Value(), \"\"))\n\t}\n\t// to determine the Content-Type header\n\tlocalVarHTTPContentTypes := []string{}\n\n\t// set Content-Type header\n\tlocalVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes)\n\tif localVarHTTPContentType != \"\" {\n\t\tlocalVarHeaderParams[\"Content-Type\"] = localVarHTTPContentType\n\t}\n\n\t// to determine the Accept header\n\tlocalVarHTTPHeaderAccepts := []string{\"application/json\"}\n\n\t// set Accept header\n\tlocalVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts)\n\tif localVarHTTPHeaderAccept != \"\" {\n\t\tlocalVarHeaderParams[\"Accept\"] = localVarHTTPHeaderAccept\n\t}\n\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 == 200 {\n\t\t\tvar v []Group\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 == 400 {\n\t\t\tvar v Error\n\t\t\terr = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get(\"Content-Type\"))\n\t\t\tif err != nil {\n\t\t\t\tnewErr.error = err.Error()\n\t\t\t\treturn localVarReturnValue, localVarHTTPResponse, newErr\n\t\t\t}\n\t\t\tnewErr.model = v\n\t\t\treturn localVarReturnValue, localVarHTTPResponse, newErr\n\t\t}\n\t\tif localVarHTTPResponse.StatusCode == 404 {\n\t\t\tvar v Error\n\t\t\terr = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get(\"Content-Type\"))\n\t\t\tif err != nil {\n\t\t\t\tnewErr.error = err.Error()\n\t\t\t\treturn localVarReturnValue, localVarHTTPResponse, newErr\n\t\t\t}\n\t\t\tnewErr.model = v\n\t\t}\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": "99cdcabba21eb481e426997f402150b6", "score": "0.53794557", "text": "func (s *Summaries) All() ([]*IntervalReport, error) {\n\ts.mtx.RLock()\n\tdefer s.mtx.RUnlock()\n\tif s.Len() == 0 {\n\t\treturn nil, errors.New(\"zero summaries currently available\")\n\t}\n\tl := make([]*IntervalReport, s.Len())\n\tvar c = 0\n\tfor role := range s.m {\n\t\t// l = append(l, s.safeIntervalReport(role))\n\t\tl[c] = s.safeIntervalReport(role)\n\t\tfmt.Printf(\"role => %v\\n\", role)\n\t\tc++\n\t}\n\treturn l, nil\n}", "title": "" }, { "docid": "f5d5bde2cdf8da8505d5254495dad409", "score": "0.5370231", "text": "func (database *Database) AllGroups() map[string]int64 {\n\tgroups := make(map[string]int64)\n\trows, err := database.Database.Query(\"SELECT id_group, name FROM groups\")\n\tif err != nil {\n\t\tlog.Fatal(err)\n\t}\n\tdefer rows.Close()\n\tfor rows.Next() {\n\t\tvar id int64\n\t\tvar name string\n\t\terr = rows.Scan(&id, &name)\n\t\tif err != nil {\n\t\t\tlog.Fatal(err)\n\t\t}\n\t\tgroups[name] = id\n\t}\n\terr = rows.Err()\n\tif err != nil {\n\t\tlog.Fatal(err)\n\t}\n\treturn groups\n}", "title": "" }, { "docid": "1d139f29c8f1677675332df19883f113", "score": "0.5366299", "text": "func (q teamMemberQuery) All(ctx context.Context, exec boil.ContextExecutor) (TeamMemberSlice, error) {\n\tvar o []*TeamMember\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 TeamMember slice\")\n\t}\n\n\tif len(teamMemberAfterSelectHooks) != 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": "e5e6bb321ecc8615912355cd8d1b9d40", "score": "0.5363427", "text": "func (o *NetworkSnapshotSlice) ReloadAll(ctx context.Context, exec boil.ContextExecutor) error {\n\tif o == nil || len(*o) == 0 {\n\t\treturn nil\n\t}\n\n\tslice := NetworkSnapshotSlice{}\n\tvar args []interface{}\n\tfor _, obj := range *o {\n\t\tpkeyArgs := queries.ValuesFromMapping(reflect.Indirect(reflect.ValueOf(obj)), networkSnapshotPrimaryKeyMapping)\n\t\targs = append(args, pkeyArgs...)\n\t}\n\n\tsql := \"SELECT \\\"network_snapshot\\\".* FROM \\\"network_snapshot\\\" WHERE \" +\n\t\tstrmangle.WhereClauseRepeated(string(dialect.LQ), string(dialect.RQ), 1, networkSnapshotPrimaryKeyColumns, len(*o))\n\n\tq := queries.Raw(sql, args...)\n\n\terr := q.Bind(ctx, exec, &slice)\n\tif err != nil {\n\t\treturn errors.Wrap(err, \"models: unable to reload all in NetworkSnapshotSlice\")\n\t}\n\n\t*o = slice\n\n\treturn nil\n}", "title": "" }, { "docid": "2670cc7e995f9e99f08345ff3a18be36", "score": "0.5348325", "text": "func getHostGroups(ctx context.Context, id, hgname string, limit, offset int) ([]define.HostGroup, int, error) {\n\thgs := []define.HostGroup{}\n\tgetsql := `SELECT \n\t\t\t\t\thg.id,\n\t\t\t\t\thg.name,\n\t\t\t\t\thg.remark,\n\t\t\t\t\thg.hostIDs,\n\t\t\t\t\thg.createByID,\n\t\t\t\t\tu.name,\n\t\t\t\t\thg.createTime,\n\t\t\t\t\thg.updateTime \n\t\t\t\tFROM \n\t\t\t\t\tcrocodile_hostgroup as hg,crocodile_user as u\n\t\t\t\tWHERE\n\t\t\t\t\thg.createByID = u.id`\n\tvar count int\n\targs := []interface{}{}\n\tif id != \"\" {\n\t\tgetsql += \" AND hg.id=?\"\n\t\targs = append(args, id)\n\t}\n\tif hgname != \"\" {\n\t\tgetsql += \" AND hg.name=?\"\n\t\targs = append(args, hgname)\n\t}\n\tif limit > 0 {\n\t\tvar err error\n\t\tcount, err = countColums(ctx, getsql, args...)\n\t\tif err != nil {\n\t\t\treturn hgs, 0, fmt.Errorf(\"countColums failed: %w\", err)\n\t\t}\n\t\tgetsql += \" LIMIT ? OFFSET ?\"\n\t\targs = append(args, limit, offset)\n\t}\n\n\tconn, err := db.GetConn(ctx)\n\tif err != nil {\n\t\treturn hgs, 0, fmt.Errorf(\"db.Db.GetConn failed: %w\", err)\n\t}\n\tdefer conn.Close()\n\tstmt, err := conn.PrepareContext(ctx, getsql)\n\tdefer stmt.Close()\n\tif err != nil {\n\t\treturn hgs, 0, fmt.Errorf(\"conn.PrepareContext failed: %w\", err)\n\t}\n\trows, err := stmt.QueryContext(ctx, args...)\n\tif err != nil {\n\t\treturn hgs, 0, fmt.Errorf(\"stmt.QueryContext failed: %w\", err)\n\t}\n\tfor rows.Next() {\n\t\tvar (\n\t\t\thg define.HostGroup\n\t\t\taddrs string\n\t\t\tcreateTime, updateTime int64\n\t\t)\n\t\terr := rows.Scan(&hg.ID, &hg.Name, &hg.Remark,\n\t\t\t&addrs, &hg.CreateByUID, &hg.CreateBy, &createTime, &updateTime)\n\t\tif err != nil {\n\t\t\tlog.Info(\"Scan result failed\", zap.Error(err))\n\t\t\tcontinue\n\t\t}\n\t\thg.HostsID = []string{}\n\t\tif addrs != \"\" {\n\t\t\thg.HostsID = append(hg.HostsID, strings.Split(addrs, \",\")...)\n\n\t\t}\n\t\thg.CreateTime = utils.UnixToStr(createTime)\n\t\thg.UpdateTime = utils.UnixToStr(updateTime)\n\n\t\thgs = append(hgs, hg)\n\t}\n\treturn hgs, count, nil\n}", "title": "" }, { "docid": "0c88fb2b803f3c6bba996e48e4b3e7f7", "score": "0.5347963", "text": "func (q genotypeQuery) All() (GenotypeSlice, error) {\n\tvar o GenotypeSlice\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 Genotype slice\")\n\t}\n\n\tif len(genotypeAfterSelectHooks) != 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": "cb4be89d88bc831523e25668cbfa36aa", "score": "0.5333781", "text": "func (o *ChannelSlice) ReloadAll(ctx context.Context, exec boil.ContextExecutor) error {\n\tif o == nil || len(*o) == 0 {\n\t\treturn nil\n\t}\n\n\tslice := ChannelSlice{}\n\tvar args []interface{}\n\tfor _, obj := range *o {\n\t\tpkeyArgs := queries.ValuesFromMapping(reflect.Indirect(reflect.ValueOf(obj)), channelPrimaryKeyMapping)\n\t\targs = append(args, pkeyArgs...)\n\t}\n\n\tsql := \"SELECT `channels`.* FROM `channels` WHERE \" +\n\t\tstrmangle.WhereClauseRepeated(string(dialect.LQ), string(dialect.RQ), 0, channelPrimaryKeyColumns, len(*o))\n\n\tq := queries.Raw(sql, args...)\n\n\terr := q.Bind(ctx, exec, &slice)\n\tif err != nil {\n\t\treturn errors.Wrap(err, \"models: unable to reload all in ChannelSlice\")\n\t}\n\n\t*o = slice\n\n\treturn nil\n}", "title": "" }, { "docid": "afa719ffe3628cfdec76ca74a280b20e", "score": "0.53315747", "text": "func (q icoQuery) All(exec boil.Executor) (IcoSlice, error) {\n\tvar o []*Ico\n\n\terr := q.Bind(nil, exec, &o)\n\tif err != nil {\n\t\treturn nil, errors.Wrap(err, \"models: failed to assign all query results to Ico slice\")\n\t}\n\n\tif len(icoAfterSelectHooks) != 0 {\n\t\tfor _, obj := range o {\n\t\t\tif err := obj.doAfterSelectHooks(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": "4b9a5b868b26722cdf59ba6f1e1038f9", "score": "0.53218216", "text": "func (rr *ReadRepository) All() ([]*Cluster, error) {\n\tresults, err := rr.r.All()\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\tvar clusters []*Cluster\n\tfor _, d := range results {\n\t\tclusters = append(clusters, d.(*Cluster))\n\t}\n\treturn clusters, nil\n}", "title": "" }, { "docid": "fa415f4a549c2e27ca6249167c3abb4a", "score": "0.5320293", "text": "func (o *Netscaler) FetchAllServiceGroups() (r []Data, err error) {\r\n\tserviceGroups, err := o.Client.GetServicegroups()\r\n\tif err != nil {\r\n\t\treturn\r\n\t}\r\n\tfor _, val := range serviceGroups {\r\n\t\tdata := new(Data)\r\n\t\terr = o.etlFetchServiceGroup(&val, data)\r\n\t\tif err != nil {\r\n\t\t\treturn\r\n\t\t}\r\n\t\tr = append(r, *data)\r\n\t}\r\n\treturn\r\n}", "title": "" }, { "docid": "cc08fa0ea35585a4410cc411dc3f5222", "score": "0.53185457", "text": "func (a *App) DisplayAllGroups() {\n\tgroups := a.getAllGroups()\n\tfor _, g := range groups {\n\t\tname := a.getGroupName(g.ID)\n\t\tfmt.Println(name) // consisntency group name\n\t\tcopySettings := a.getGroupCopiesSettings(g.ID)\n\t\tfor _, cs := range copySettings {\n\t\t\tfmt.Printf(\"\\t%s (%s)\\n\", cs.Name, cs.RoleInfo.Role)\n\t\t}\n\t}\n}", "title": "" }, { "docid": "ff3ef2577109094767803d2256bf94fd", "score": "0.53178626", "text": "func (q collectionsContentUnitQuery) All() (CollectionsContentUnitSlice, error) {\n\tvar o []*CollectionsContentUnit\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 CollectionsContentUnit slice\")\n\t}\n\n\treturn o, nil\n}", "title": "" }, { "docid": "4d68637229b8aa627e79b46b7b76b5f0", "score": "0.5314459", "text": "func (o *CollectionsContentUnitSlice) ReloadAll(exec boil.Executor) error {\n\tif o == nil || len(*o) == 0 {\n\t\treturn nil\n\t}\n\n\tslice := CollectionsContentUnitSlice{}\n\tvar args []interface{}\n\tfor _, obj := range *o {\n\t\tpkeyArgs := queries.ValuesFromMapping(reflect.Indirect(reflect.ValueOf(obj)), collectionsContentUnitPrimaryKeyMapping)\n\t\targs = append(args, pkeyArgs...)\n\t}\n\n\tsql := \"SELECT \\\"collections_content_units\\\".* FROM \\\"collections_content_units\\\" WHERE \" +\n\t\tstrmangle.WhereClauseRepeated(string(dialect.LQ), string(dialect.RQ), 1, collectionsContentUnitPrimaryKeyColumns, len(*o))\n\n\tq := queries.Raw(sql, args...)\n\n\terr := q.Bind(nil, exec, &slice)\n\tif err != nil {\n\t\treturn errors.Wrap(err, \"mdbmodels: unable to reload all in CollectionsContentUnitSlice\")\n\t}\n\n\t*o = slice\n\n\treturn nil\n}", "title": "" }, { "docid": "f5d0c5bc64391e68eb4961c0bc2b619b", "score": "0.5309449", "text": "func (c idContainer) All() []Entity {\n\tallContainers := make([]Entity, 0)\n\n\tranger := func(key, value interface{}) bool {\n\t\tif ec, ok := value.(Container); ok {\n\t\t\tallContainers = append(allContainers, ec.Get())\n\t\t}\n\t\treturn true\n\t}\n\n\tc.internal.Range(ranger)\n\treturn allContainers\n}", "title": "" }, { "docid": "f6d89fa422d2e335e5d113127653b4bd", "score": "0.5301804", "text": "func (o *VolumeAccessSlice) ReloadAll(exec boil.Executor) error {\n\tif o == nil || len(*o) == 0 {\n\t\treturn nil\n\t}\n\n\tvolumeAccesses := VolumeAccessSlice{}\n\tvar args []interface{}\n\tfor _, obj := range *o {\n\t\tpkeyArgs := queries.ValuesFromMapping(reflect.Indirect(reflect.ValueOf(obj)), volumeAccessPrimaryKeyMapping)\n\t\targs = append(args, pkeyArgs...)\n\t}\n\n\tquery := fmt.Sprintf(\n\t\t\"SELECT \\\"volume_access\\\".* FROM \\\"volume_access\\\" WHERE (%s) IN (%s)\",\n\t\tstrings.Join(strmangle.IdentQuoteSlice(dialect.LQ, dialect.RQ, volumeAccessPrimaryKeyColumns), \",\"),\n\t\tstrmangle.Placeholders(dialect.IndexPlaceholders, len(*o)*len(volumeAccessPrimaryKeyColumns), 1, len(volumeAccessPrimaryKeyColumns)),\n\t)\n\n\tq := queries.Raw(exec, query, args...)\n\n\terr := q.Bind(&volumeAccesses)\n\tif err != nil {\n\t\treturn errors.Wrap(err, \"public: unable to reload all in VolumeAccessSlice\")\n\t}\n\n\t*o = volumeAccesses\n\n\treturn nil\n}", "title": "" }, { "docid": "eda677c7529f71530e54b578c5872b7e", "score": "0.52993435", "text": "func (q escrowQuery) All(ctx context.Context, exec boil.ContextExecutor) (EscrowSlice, error) {\n\tvar o []*Escrow\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 Escrow slice\")\n\t}\n\n\tif len(escrowAfterSelectHooks) != 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": "729529caaa49f42416f6e15b2bf7e816", "score": "0.52725005", "text": "func (q studentQuery) All(ctx context.Context, exec boil.ContextExecutor) (StudentSlice, error) {\n\tvar o []*Student\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 Student slice\")\n\t}\n\n\treturn o, nil\n}", "title": "" }, { "docid": "0bca6ff4da638fa530a3a4efd1b02a8a", "score": "0.5263038", "text": "func (o *VolumeSlice) ReloadAll(exec boil.Executor) error {\n\tif o == nil || len(*o) == 0 {\n\t\treturn nil\n\t}\n\n\tvolumes := VolumeSlice{}\n\tvar args []interface{}\n\tfor _, obj := range *o {\n\t\tpkeyArgs := queries.ValuesFromMapping(reflect.Indirect(reflect.ValueOf(obj)), volumePrimaryKeyMapping)\n\t\targs = append(args, pkeyArgs...)\n\t}\n\n\tquery := fmt.Sprintf(\n\t\t\"SELECT \\\"volume\\\".* FROM \\\"volume\\\" WHERE (%s) IN (%s)\",\n\t\tstrings.Join(strmangle.IdentQuoteSlice(dialect.LQ, dialect.RQ, volumePrimaryKeyColumns), \",\"),\n\t\tstrmangle.Placeholders(dialect.IndexPlaceholders, len(*o)*len(volumePrimaryKeyColumns), 1, len(volumePrimaryKeyColumns)),\n\t)\n\n\tq := queries.Raw(exec, query, args...)\n\n\terr := q.Bind(&volumes)\n\tif err != nil {\n\t\treturn errors.Wrap(err, \"public: unable to reload all in VolumeSlice\")\n\t}\n\n\t*o = volumes\n\n\treturn nil\n}", "title": "" }, { "docid": "b654efd8c5a2b886849891f0bc798fa2", "score": "0.52460086", "text": "func (s *GoHomeServer) commandGetAllGroups(user providers.IAuthenticatedUser) []*knownGroup {\n\tdevices := s.commandGetAllDevices(user)\n\tresponse := make([]*knownGroup, 0)\n\tfor _, v := range devices {\n\t\tif v.Type != enums.DevGroup {\n\t\t\tcontinue\n\t\t}\n\n\t\tg, ok := s.groups[v.ID]\n\t\tif !ok {\n\t\t\tcontinue\n\t\t}\n\n\t\tgroup := &knownGroup{\n\t\t\tID: v.ID,\n\t\t\tName: v.Name,\n\t\t\tDevices: make([]string, 0),\n\t\t}\n\n\t\tfor _, dev := range g.Devices() {\n\t\t\td := s.state.GetDevice(dev)\n\t\t\tif nil == d || !user.DeviceGet(v.ID) {\n\t\t\t\tcontinue\n\t\t\t}\n\n\t\t\tgroup.Devices = append(group.Devices, dev)\n\t\t}\n\n\t\tif 0 != len(group.Devices) {\n\t\t\tsort.Strings(group.Devices)\n\t\t\tresponse = append(response, group)\n\t\t}\n\t}\n\n\tsort.Slice(response, func(i, j int) bool {\n\t\treturn response[i].Name < response[j].Name\n\t})\n\treturn response\n}", "title": "" }, { "docid": "822506907f89a1cd6a9f9cbfadf34fca", "score": "0.5242513", "text": "func (q seqhashlinkQuery) All(ctx context.Context, exec boil.ContextExecutor) (SeqhashlinkSlice, error) {\n\tvar o []*Seqhashlink\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 Seqhashlink slice\")\n\t}\n\n\tif len(seqhashlinkAfterSelectHooks) != 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": "2e6f1f916ff86692dcce2e0869da863c", "score": "0.522802", "text": "func (c *Client) GroupsListAll(filter ListFilter) ([]Group, error) {\n\tif filter.MaxItems > 100 {\n\t\treturn nil, fmt.Errorf(\"MaxItems must be between 1 and 100\")\n\t}\n\n\tgroups := []Group{}\n\n\tfor {\n\t\tresp, err := c.groupsList(filter)\n\t\tif err != nil {\n\t\t\treturn nil, err\n\t\t}\n\n\t\tgroups = append(groups, resp.Groups...)\n\t\tfilter.StartFrom = resp.NextID\n\n\t\tif len(filter.StartFrom) == 0 {\n\t\t\treturn groups, nil\n\t\t}\n\t}\n}", "title": "" }, { "docid": "f2c07349473ccf14bf659f5586f03235", "score": "0.52269304", "text": "func (o *TeamMemberSlice) ReloadAll(ctx context.Context, exec boil.ContextExecutor) error {\n\tif o == nil || len(*o) == 0 {\n\t\treturn nil\n\t}\n\n\tslice := TeamMemberSlice{}\n\tvar args []interface{}\n\tfor _, obj := range *o {\n\t\tpkeyArgs := queries.ValuesFromMapping(reflect.Indirect(reflect.ValueOf(obj)), teamMemberPrimaryKeyMapping)\n\t\targs = append(args, pkeyArgs...)\n\t}\n\n\tsql := \"SELECT `team_members`.* FROM `team_members` WHERE \" +\n\t\tstrmangle.WhereClauseRepeated(string(dialect.LQ), string(dialect.RQ), 0, teamMemberPrimaryKeyColumns, len(*o))\n\n\tq := queries.Raw(sql, args...)\n\n\terr := q.Bind(ctx, exec, &slice)\n\tif err != nil {\n\t\treturn errors.Wrap(err, \"models: unable to reload all in TeamMemberSlice\")\n\t}\n\n\t*o = slice\n\n\treturn nil\n}", "title": "" }, { "docid": "67ea973a861fd78bf887a15f9344fc2d", "score": "0.5225176", "text": "func (Groupasdam _SDAMGroupApis) groups(w http.ResponseWriter, req *http.Request) {\n\tlogger.Logging(logger.DEBUG, \"[GROUP] Get All SDA Groups\")\n\tresult, resp, err := sdamGroupController.GetGroups()\n\tcommon.MakeResponse(w, result, common.ChangeToJson(resp), err)\n}", "title": "" }, { "docid": "32aa6ef2ccdd6eea5518d6e18f67087e", "score": "0.5222125", "text": "func (q mastCompanyQuery) All(ctx context.Context, exec boil.ContextExecutor) (MastCompanySlice, error) {\n\tvar o []*MastCompany\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 MastCompany slice\")\n\t}\n\n\tif len(mastCompanyAfterSelectHooks) != 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": "b6362b29835065086c66562a52e89830", "score": "0.52152723", "text": "func (q authUserProviderQuery) All() (AuthUserProviderSlice, error) {\n\tvar o AuthUserProviderSlice\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 AuthUserProvider slice\")\n\t}\n\n\tif len(authUserProviderAfterSelectHooks) != 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": "ee70d6f231663060ab720d0f3f378c49", "score": "0.52114767", "text": "func (q braceletBraceletcolorQuery) All() (BraceletBraceletcolorSlice, error) {\n\tvar o BraceletBraceletcolorSlice\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 BraceletBraceletcolor slice\")\n\t}\n\n\treturn o, nil\n}", "title": "" }, { "docid": "5053fc58176b4db9639a69d806636207", "score": "0.5208514", "text": "func (d *Dao) AllList(ctx context.Context) ([]*region.Region, error) {\n\trows, err := d.list.Query(ctx)\n\tif err != nil {\n\t\tlog.Error(\"mysqlDB.Query error(%v)\", err)\n\t\treturn nil, err\n\t}\n\tdefer rows.Close()\n\tapps := []*region.Region{}\n\tfor rows.Next() {\n\t\ta := &region.Region{}\n\t\tif err = rows.Scan(&a.ID, &a.Rid, &a.Reid, &a.Name, &a.Logo, &a.Rank, &a.Goto, &a.Param, &a.Plat, &a.Area, &a.URI, &a.Islogo, &a.Rtype, &a.Language); err != nil {\n\t\t\tlog.Error(\"row.Scan error(%v)\", err)\n\t\t\treturn nil, err\n\t\t}\n\t\tapps = append(apps, a)\n\t}\n\treturn apps, err\n}", "title": "" }, { "docid": "4629ff7c44c7aacc05dc03a2a981fe5a", "score": "0.52051103", "text": "func (b Store) List(_ context.Context) (groups []string, err error) {\n\terr = b.db.View(func(tx *bolt.Tx) error {\n\t\tbucket := tx.Bucket([]byte(b.bucket))\n\t\tif bucket == nil {\n\t\t\treturn nil\n\t\t}\n\n\t\treturn bucket.ForEach(func(k, _ []byte) error {\n\t\t\tgroups = append(groups, string(k))\n\t\t\treturn nil\n\t\t})\n\t})\n\treturn\n}", "title": "" }, { "docid": "df286fbdf4fd4914c2c5b1be9aaf0e6f", "score": "0.52019215", "text": "func (pq *PharmacistQuery) All(ctx context.Context) ([]*Pharmacist, error) {\n\tif err := pq.prepareQuery(ctx); err != nil {\n\t\treturn nil, err\n\t}\n\treturn pq.sqlAll(ctx)\n}", "title": "" }, { "docid": "66cedced3516d11a70e50b323d31b7e6", "score": "0.51946044", "text": "func (o *CollectionsContentUnitSlice) ReloadAll(exec boil.Executor) error {\n\tif o == nil || len(*o) == 0 {\n\t\treturn nil\n\t}\n\n\tcollectionsContentUnits := CollectionsContentUnitSlice{}\n\tvar args []interface{}\n\tfor _, obj := range *o {\n\t\tpkeyArgs := queries.ValuesFromMapping(reflect.Indirect(reflect.ValueOf(obj)), collectionsContentUnitPrimaryKeyMapping)\n\t\targs = append(args, pkeyArgs...)\n\t}\n\n\tsql := \"SELECT \\\"collections_content_units\\\".* FROM \\\"collections_content_units\\\" WHERE \" +\n\t\tstrmangle.WhereClauseRepeated(string(dialect.LQ), string(dialect.RQ), 1, collectionsContentUnitPrimaryKeyColumns, len(*o))\n\n\tq := queries.Raw(exec, sql, args...)\n\n\terr := q.Bind(&collectionsContentUnits)\n\tif err != nil {\n\t\treturn errors.Wrap(err, \"mdbmdbmodels: unable to reload all in CollectionsContentUnitSlice\")\n\t}\n\n\t*o = collectionsContentUnits\n\n\treturn nil\n}", "title": "" }, { "docid": "035b0eee1b1f97229103e0b9e17c9776", "score": "0.5194502", "text": "func (o *CMFLevelSlice) ReloadAll(ctx context.Context, exec boil.ContextExecutor) error {\n\tif o == nil || len(*o) == 0 {\n\t\treturn nil\n\t}\n\n\tslice := CMFLevelSlice{}\n\tvar args []interface{}\n\tfor _, obj := range *o {\n\t\tpkeyArgs := queries.ValuesFromMapping(reflect.Indirect(reflect.ValueOf(obj)), cmfLevelPrimaryKeyMapping)\n\t\targs = append(args, pkeyArgs...)\n\t}\n\n\tsql := \"SELECT `cmf_level`.* FROM `cmf_level` WHERE \" +\n\t\tstrmangle.WhereClauseRepeated(string(dialect.LQ), string(dialect.RQ), 0, cmfLevelPrimaryKeyColumns, len(*o))\n\n\tq := queries.Raw(sql, args...)\n\n\terr := q.Bind(ctx, exec, &slice)\n\tif err != nil {\n\t\treturn errors.Wrap(err, \"models: unable to reload all in CMFLevelSlice\")\n\t}\n\n\t*o = slice\n\n\treturn nil\n}", "title": "" }, { "docid": "bae4ef51e118baf9488d17449e1db816", "score": "0.5190359", "text": "func (service groupMembershipService) GetAll(params helpers.ParamsGetAll, groupID int64, myUserID int64) ([]models.GroupMembership, error) {\n\n\tvar stmt string\n\tvar paramsQuery neoism.Props\n\tvar role = -1\n\tif params.Properties[\"role\"] != nil {\n\t\tif params.Properties[\"role\"].(string) == configs.SAdmin {\n\t\t\trole = 2\n\t\t} else if params.Properties[\"role\"].(string) == configs.SBlocked {\n\t\t\trole = 4\n\t\t} else if params.Properties[\"role\"].(string) == configs.SCreator {\n\t\t\trole = 3\n\t\t} else if params.Properties[\"role\"].(string) == configs.SMember {\n\t\t\trole = 1\n\t\t} else if params.Properties[\"role\"].(string) == configs.SPending {\n\t\t\trole = 0\n\t\t}\n\t}\n\tif role >= 1 && role <= 3 { // member/admin/creator\n\t\tstmt = fmt.Sprintf(`\n\t\t\t\tMATCH (me:User) WHERE ID(me) = {myUserID}\n\t\t\t\tMATCH (g:Group)<-[r:JOIN{role: {role} }]-(u:User)\n\t\t\t\tWHERE ID(g) = {groupID}\n\t\t\t\tWITH\n\t\t\t\t\tr{id:ID(r), .*,\n\t\t\t\t\t\tuser: u{id:ID(u), .username, .full_name, .avatar},\n\t\t\t\t\t\tcan_edit:\n\t\t\t\t\t\tCASE r.role WHEN 1 THEN CASE WHEN exists((me)-[:JOIN{role:2}]->(g)) THEN true\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t WHEN exists((me)-[:JOIN{role:3}]->(g)) THEN true\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tEND\n\t\t\t\t\t\t\t\t\t\t\t\tWHEN 2 THEN CASE WHEN exists((me)-[:JOIN{role:3}]->(g)) THEN true\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tEND\n\t\t\t\t\t\t\t\t\t\t\t\tWHEN 4 THEN CASE WHEN exists((me)-[:JOIN{role:2}]->(g)) THEN true\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t WHEN exists((me)-[:JOIN{role:3}]->(g)) THEN true\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tEND\n\t\t\t\t\t\t\t\t\t\t\t\tELSE false\n\t\t\t\t\t\tEND,\n\t\t\t\t\t\tcan_delete:\n\t\t\t\t\t\tCASE r.role WHEN 1 THEN CASE WHEN exists((me)-[:JOIN{role:2}]->(g)) THEN true\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tWHEN exists((me)-[:JOIN{role:3}]->(g)) THEN true\n\t\t \t\t\t\t\t\t\t\t\t \t\t\t\t\t\t\tEND\n\t\t\t\t\t\t\t\t\t\t\t\tWHEN 2 THEN CASE WHEN exists((me)-[:JOIN{role:3}]->(g)) THEN true\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tEND\n\t\t\t\t\t\t\t\t\t\t\t\tWHEN 4 THEN CASE WHEN exists((me)-[:JOIN{role:2}]->(g)) THEN true\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tWHEN exists((me)-[:JOIN{role:3}]->(g)) THEN true\n\t\t \t\t\t\t\t\t\t\t\t \t\t\t\t\t\t\tEND\n\n\t\t\t\t\t\t\t\t\t\t\t\tELSE false\n\t\t\t\t\t\tEND\n\n\t\t\t\t\t} AS membership\n\t\t\t\tORDER BY %s\n\t\t\t\tSKIP {skip}\n\t\t\t\tLIMIT {limit}\n\t\t\t\tRETURN collect(membership) AS memberships\n\t\t\t\t`, \"membership.\"+params.Sort)\n\n\t\tparamsQuery = map[string]interface{}{\n\t\t\t\"myUserID\": myUserID,\n\t\t\t\"groupID\": groupID,\n\t\t\t\"skip\": params.Skip,\n\t\t\t\"limit\": params.Limit,\n\t\t\t\"role\": role,\n\t\t}\n\t} else if role == 4 { // blocked\n\t\tstmt = fmt.Sprintf(`\n\t\tMATCH (me:User) WHERE ID(me) = {myUserID}\n\t\tMATCH (g:Group)<-[r:JOIN{role:4}]-(u:User)\n\t\tWHERE ID(g) = {groupID} AND r.status = 1\n\t\tWITH\n\t\t\tr{id:ID(r), .*,\n\t\t\t\tuser: u{id:ID(u), .username, .full_name, .avatar},\n\t\t\t\tcan_edit:\n\t\t\t\tCASE WHEN exists((me)-[:JOIN{role:2}]->(g)) THEN true\n\t\t\t\t\t\t WHEN exists((me)-[:JOIN{role:3}]->(g)) THEN true\n\t\t\t\t\t\t ELSE false\n\t\t\t\tEND,\n\t\t\t\tcan_delete:\n\t\t\t\tCASE WHEN exists((me)-[:JOIN{role:2}]->(g)) THEN true\n\t\t\t\t\t\t WHEN exists((me)-[:JOIN{role:3}]->(g)) THEN true\n\t\t\t\t\t\t WHEN ID(me) = ID(u) THEN true\n\t\t\t\t\t\t ELSE false\n\t\t\t\tEND\n\n\t\t\t} AS membership\n\t\tORDER BY %s\n\t\tSKIP {skip}\n\t\tLIMIT {limit}\n\t\tRETURN collect(membership) AS memberships\n\t\t`, \"membership.\"+params.Sort)\n\t\tparamsQuery = map[string]interface{}{\n\t\t\t\"myUserID\": myUserID,\n\t\t\t\"groupID\": groupID,\n\t\t\t\"skip\": params.Skip,\n\t\t\t\"limit\": params.Limit,\n\t\t}\n\t} else if role == 0 { // pending request\n\t\tstmt = fmt.Sprintf(`\n\t\tMATCH (me:User) WHERE ID(me) = {myUserID}\n\t\tMATCH (g:Group)<-[r:JOIN{status: 0}]-(u:User)\n\t\tWHERE ID(g) = {groupID}\n\t\tWITH\n\t\t\tr{id:ID(r), .*,\n\t\t\t\tuser: u{id:ID(u), .username, .full_name, .avatar},\n\t\t\t\tcan_edit:\n\t\t\t\tCASE WHEN exists((me)-[:JOIN{role:2}]->(g)) THEN true\n\t\t\t\t\t\t WHEN exists((me)-[:JOIN{role:3}]->(g)) THEN true\n\t\t\t\t\t\t ELSE false\n\t\t\t\tEND,\n\t\t\t\tcan_delete:\n\t\t\t\tCASE WHEN exists((me)-[:JOIN{role:2}]->(g)) THEN true\n\t\t\t\t\t\t WHEN exists((me)-[:JOIN{role:3}]->(g)) THEN true\n\t\t\t\t\t\t WHEN ID(me) = ID(u) THEN true\n\t\t\t\t\t\t ELSE false\n\t\t\t\tEND\n\n\t\t\t} AS membership\n\t\tORDER BY %s\n\t\tSKIP {skip}\n\t\tLIMIT {limit}\n\t\tRETURN collect(membership) AS memberships\n\t\t`, \"membership.\"+params.Sort)\n\t\tparamsQuery = map[string]interface{}{\n\t\t\t\"myUserID\": myUserID,\n\t\t\t\"groupID\": groupID,\n\t\t\t\"skip\": params.Skip,\n\t\t\t\"limit\": params.Limit,\n\t\t}\n\t} else { // all member (include admin/creator)\n\t\tstmt = fmt.Sprintf(`\n\t\t\t\tMATCH (me:User) WHERE ID(me) = {myUserID}\n\t\t\t\tMATCH (g:Group)<-[r:JOIN]-(u:User)\n\t\t\t\tWHERE ID(g) = {groupID} AND r.role <>4 AND r.status = 1\n\t\t\t\tWITH\n\t\t\t\t\tr{id:ID(r), .*,\n\t\t\t\t\t\tuser: u{id:ID(u), .username, .full_name, .avatar},\n\t\t\t\t\t\tcan_edit:\n\t\t\t\t\t\tCASE r.role WHEN 1 THEN CASE WHEN exists((me)-[:JOIN{role:2}]->(g)) THEN true\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t WHEN exists((me)-[:JOIN{role:3}]->(g)) THEN true\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tEND\n\t\t\t\t\t\t\t\t\t\t\t\tWHEN 2 THEN CASE WHEN exists((me)-[:JOIN{role:3}]->(g)) THEN true\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tEND\n\t\t\t\t\t\t\t\t\t\t\t\tWHEN 4 THEN CASE WHEN exists((me)-[:JOIN{role:2}]->(g)) THEN true\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t WHEN exists((me)-[:JOIN{role:3}]->(g)) THEN true\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tEND\n\t\t\t\t\t\t\t\t\t\t\t\tELSE false\n\t\t\t\t\t\tEND,\n\t\t\t\t\t\tcan_delete:\n\t\t\t\t\t\tCASE r.role WHEN 1 THEN CASE WHEN exists((me)-[:JOIN{role:2}]->(g)) THEN true\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tWHEN exists((me)-[:JOIN{role:3}]->(g)) THEN true\n\t\t \t\t\t\t\t\t\t\t\t \t\t\t\t\t\t\tEND\n\t\t\t\t\t\t\t\t\t\t\t\tWHEN 2 THEN CASE WHEN exists((me)-[:JOIN{role:3}]->(g)) THEN true\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tEND\n\t\t\t\t\t\t\t\t\t\t\t\tWHEN 4 THEN CASE WHEN exists((me)-[:JOIN{role:2}]->(g)) THEN true\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tWHEN exists((me)-[:JOIN{role:3}]->(g)) THEN true\n\t\t \t\t\t\t\t\t\t\t\t \t\t\t\t\t\t\tEND\n\t\t\t\t\t\t\t\t\t\t\t\tELSE false\n\t\t\t\t\t\tEND\n\n\t\t\t\t\t} AS membership\n\t\t\t\tORDER BY %s\n\t\t\t\tSKIP {skip}\n\t\t\t\tLIMIT {limit}\n\t\t\t\tRETURN collect(membership) AS memberships\n\t\t\t\t`, \"membership.\"+params.Sort)\n\n\t\tparamsQuery = map[string]interface{}{\n\t\t\t\"myUserID\": myUserID,\n\t\t\t\"groupID\": groupID,\n\t\t\t\"skip\": params.Skip,\n\t\t\t\"limit\": params.Limit,\n\t\t\t\"role\": role,\n\t\t}\n\t}\n\tres := []struct {\n\t\tMemberships []models.GroupMembership `json:\"memberships\"`\n\t}{}\n\tcq := neoism.CypherQuery{\n\t\tStatement: stmt,\n\t\tParameters: paramsQuery,\n\t\tResult: &res,\n\t}\n\terr := conn.Cypher(&cq)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\tif len(res) > 0 {\n\t\treturn res[0].Memberships, nil\n\t}\n\treturn nil, nil\n}", "title": "" }, { "docid": "cfcb18a39e84c7bc8ba60e2c46eb1495", "score": "0.51883125", "text": "func (q versionQuery) All(ctx context.Context, exec boil.ContextExecutor) (VersionSlice, error) {\n\tvar o []*Version\n\n\terr := q.Bind(ctx, exec, &o)\n\tif err != nil {\n\t\treturn nil, errors.Wrap(err, \"contenttype: failed to assign all query results to Version slice\")\n\t}\n\n\tif len(versionAfterSelectHooks) != 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": "ab053b4f3e0dca470fb9f2e2b5d1bc82", "score": "0.51847255", "text": "func All() []Project {\n\tps, err := deserialize()\n\tif err != nil {\n\t\tps = make([]Project, 0)\n\t} else {\n\t\tsort.Sort(byCreationDate(ps))\n\t}\n\treturn ps\n}", "title": "" }, { "docid": "00389b174dea4d58f8dc52114410e1d0", "score": "0.5168239", "text": "func (o *ImageSlice) ReloadAll(ctx context.Context, exec boil.ContextExecutor) error {\n\tif o == nil || len(*o) == 0 {\n\t\treturn nil\n\t}\n\n\tslice := ImageSlice{}\n\tvar args []interface{}\n\tfor _, obj := range *o {\n\t\tpkeyArgs := queries.ValuesFromMapping(reflect.Indirect(reflect.ValueOf(obj)), imagePrimaryKeyMapping)\n\t\targs = append(args, pkeyArgs...)\n\t}\n\n\tsql := \"SELECT `image`.* FROM `image` WHERE \" +\n\t\tstrmangle.WhereClauseRepeated(string(dialect.LQ), string(dialect.RQ), 0, imagePrimaryKeyColumns, len(*o))\n\n\tq := queries.Raw(sql, args...)\n\n\terr := q.Bind(ctx, exec, &slice)\n\tif err != nil {\n\t\treturn errors.Wrap(err, \"models: unable to reload all in ImageSlice\")\n\t}\n\n\t*o = slice\n\n\treturn nil\n}", "title": "" }, { "docid": "c70b85b325329c721005ea1d2454010f", "score": "0.5163802", "text": "func (cq *ClubapplicationQuery) All(ctx context.Context) ([]*Clubapplication, error) {\n\tif err := cq.prepareQuery(ctx); err != nil {\n\t\treturn nil, err\n\t}\n\treturn cq.sqlAll(ctx)\n}", "title": "" }, { "docid": "2b4d1db3ff440f38c53d2e394ec19443", "score": "0.5155975", "text": "func (s *StaticLocator) All() []*SupernodeGroup {\n\tif s.Group == nil {\n\t\treturn nil\n\t}\n\treturn []*SupernodeGroup{s.Group}\n}", "title": "" }, { "docid": "fbc931cfa0a98a6ab5a78b62070a96f7", "score": "0.5151591", "text": "func (q hospitalQuery) All(ctx context.Context, exec boil.ContextExecutor) (HospitalSlice, error) {\n\tvar o []*Hospital\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 Hospital slice\")\n\t}\n\n\tif len(hospitalAfterSelectHooks) != 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": "1f24543bd10314e58a50cf1875c96771", "score": "0.5148921", "text": "func (cm *Docker) All() (containers container.Containers) {\n\tcm.lock.Lock()\n\tfor _, c := range cm.containers {\n\t\tcontainers = append(containers, c)\n\t}\n\tcontainers.Sort()\n\tcontainers.Filter()\n\tcm.lock.Unlock()\n\treturn containers\n}", "title": "" }, { "docid": "285babb7dd915b384cb3157635e16abe", "score": "0.51460063", "text": "func (a *App) ListGroups() {\n\tgroups := a.getAllGroups()\n\tfor _, g := range groups {\n\t\tname := a.getGroupName(g.ID)\n\t\tfmt.Println(name) // consisntency group name\n\t}\n}", "title": "" }, { "docid": "c4b5ecbc6bccc7b4b7f6b664a68ee654", "score": "0.5144604", "text": "func GetGroupIds(w http.ResponseWriter, r *http.Request) {\n\tresults := RepoGetGroupIds()\n\tresultsText := \"\"\n\t\n\tfor _, result := range results {\n\t\tresultsText += strconv.Itoa(result) + \" \"\n\t}\n\n\tw.Write([]byte(\"Currently defined replica groups: \" + resultsText))\n}", "title": "" }, { "docid": "c42152e2cd2a745583cdb335266c3622", "score": "0.5140778", "text": "func (q bookQuery) All() (BookSlice, error) {\n\tvar o BookSlice\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 Book slice\")\n\t}\n\n\tif len(bookAfterSelectHooks) != 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": "3a9940d9b0cbfe47c023a281d115bdf6", "score": "0.51404", "text": "func (o *MigMigrationSlice) ReloadAll(exec boil.Executor) error {\n\tif o == nil || len(*o) == 0 {\n\t\treturn nil\n\t}\n\n\tmigMigrations := MigMigrationSlice{}\n\tvar args []interface{}\n\tfor _, obj := range *o {\n\t\tpkeyArgs := queries.ValuesFromMapping(reflect.Indirect(reflect.ValueOf(obj)), migMigrationPrimaryKeyMapping)\n\t\targs = append(args, pkeyArgs...)\n\t}\n\n\tsql := \"SELECT \\\"mig_migrations\\\".* FROM \\\"mig_migrations\\\" WHERE \" +\n\t\tstrmangle.WhereClauseRepeated(string(dialect.LQ), string(dialect.RQ), 1, migMigrationPrimaryKeyColumns, len(*o))\n\n\tq := queries.Raw(exec, sql, args...)\n\n\terr := q.Bind(&migMigrations)\n\tif err != nil {\n\t\treturn errors.Wrap(err, \"models: unable to reload all in MigMigrationSlice\")\n\t}\n\n\t*o = migMigrations\n\n\treturn nil\n}", "title": "" }, { "docid": "0d5c253cc5f9dac850c77a9057e73d07", "score": "0.51365316", "text": "func (s *elasticacheReplicationGroupLister) List(selector labels.Selector) (ret []*v1alpha1.ElasticacheReplicationGroup, err error) {\n\terr = cache.ListAll(s.indexer, selector, func(m interface{}) {\n\t\tret = append(ret, m.(*v1alpha1.ElasticacheReplicationGroup))\n\t})\n\treturn ret, err\n}", "title": "" }, { "docid": "5e1f7256d1db0c4aca45bd1b736011e2", "score": "0.5132159", "text": "func AllGroups() (g []string) {\n\tfile, err := os.Open(\"/etc/group\")\n\tCheck(\"Error getting current groups: \", err)\n\tscanner := bufio.NewScanner(file)\n\n\tfor scanner.Scan() {\n\t\tline := scanner.Text()\n\t\tgroup := strings.Split(line, \":\")[0]\n\t\tg = append(g, group)\n\t}\n\treturn\n}", "title": "" } ]
d4051b44cbb63455cbc4afb42e3aef2b
WhereDate applies the entql time.Time predicate on the date field.
[ { "docid": "c6b6ecc84f4f20dc7fbb5ff2bb1debb7", "score": "0.73018336", "text": "func (f *JobHistoryFilter) WhereDate(p entql.TimeP) {\n\tf.Where(p.Field(jobhistory.FieldDate))\n}", "title": "" } ]
[ { "docid": "a5d71d1b09663402e958b3350405b0eb", "score": "0.7196398", "text": "func Date(v time.Time) predicate.Checksymptom {\n\treturn predicate.Checksymptom(func(s *sql.Selector) {\n\t\ts.Where(sql.EQ(s.C(FieldDate), v))\n\t})\n}", "title": "" }, { "docid": "c296af9b228781afb16aef1f1d302cc7", "score": "0.70678633", "text": "func (f *FieldTypeFilter) WhereDatetime(p entql.TimeP) {\n\tf.Where(p.Field(fieldtype.FieldDatetime))\n}", "title": "" }, { "docid": "3b4d806816dab2a0fd1b0eb732f0407f", "score": "0.6700803", "text": "func Date(v time.Time) predicate.MarketHours {\n\treturn predicate.MarketHours(sql.FieldEQ(FieldDate, v))\n}", "title": "" }, { "docid": "7d1a51eae2d26363a9e1c310c1e196dd", "score": "0.6696193", "text": "func Datetime(v time.Time) predicate.Carservice {\n\treturn predicate.Carservice(func(s *sql.Selector) {\n\t\ts.Where(sql.EQ(s.C(FieldDatetime), v))\n\t})\n}", "title": "" }, { "docid": "c780b2270ddc08b2bf965a295c42458a", "score": "0.64302033", "text": "func Date(v time.Time) predicate.Warning {\n\treturn predicate.Warning(func(s *sql.Selector) {\n\t\ts.Where(sql.EQ(s.C(FieldDate), v))\n\t})\n}", "title": "" }, { "docid": "69d83f9a987af201b47235670401918f", "score": "0.63748276", "text": "func Date(v string) predicate.Mealplan {\n\treturn predicate.Mealplan(func(s *sql.Selector) {\n\t\ts.Where(sql.EQ(s.C(FieldDate), v))\n\t})\n}", "title": "" }, { "docid": "5539f11121d33c709aabb5d0d8811bc4", "score": "0.63338476", "text": "func (f *CardFilter) WhereCreateTime(p entql.TimeP) {\n\tf.Where(p.Field(card.FieldCreateTime))\n}", "title": "" }, { "docid": "294af2af0eeeae25aed1db5d61dd3010", "score": "0.6308193", "text": "func (f *SystemFilter) WhereCreateTime(p entql.TimeP) {\n\tf.Where(p.Field(system.FieldCreateTime))\n}", "title": "" }, { "docid": "e9dc625d3d9b0ccb9d6e22fb1ada223b", "score": "0.6286963", "text": "func Datetime(v time.Time) predicate.DispenseMedicine {\n\treturn predicate.DispenseMedicine(func(s *sql.Selector) {\n\t\ts.Where(sql.EQ(s.C(FieldDatetime), v))\n\t})\n}", "title": "" }, { "docid": "45f9e71a4a366059cebdf8eaa99d97f1", "score": "0.62200165", "text": "func (f *UserFilter) WhereCreateTime(p entql.TimeP) {\n\tf.Where(p.Field(user.FieldCreateTime))\n}", "title": "" }, { "docid": "38da6498593f1f8899bfb3664835346c", "score": "0.61318785", "text": "func (f *LicenseFilter) WhereCreateTime(p entql.TimeP) {\n\tf.Where(p.Field(license.FieldCreateTime))\n}", "title": "" }, { "docid": "069c66f9c3b9be246d3fadfc4dcf59c0", "score": "0.61190635", "text": "func (f *OrgUnitFilter) WhereCreateTime(p entql.TimeP) {\n\tf.Where(p.Field(orgunit.FieldCreateTime))\n}", "title": "" }, { "docid": "d1160ed4ab16abc66ae38dbf16a12b64", "score": "0.6072771", "text": "func (f *OrganizationFilter) WhereCreateTime(p entql.TimeP) {\n\tf.Where(p.Field(organization.FieldCreateTime))\n}", "title": "" }, { "docid": "f961989f7332dd515707185b4813dc1d", "score": "0.60079074", "text": "func DateEQ(v time.Time) predicate.MarketHours {\n\treturn predicate.MarketHours(sql.FieldEQ(FieldDate, v))\n}", "title": "" }, { "docid": "77c4b25bb37519b1057d3c905903089c", "score": "0.59239346", "text": "func Date(d time.Time) *Query {\n\treturn &Query{\n\t\tdate: d,\n\t}\n}", "title": "" }, { "docid": "80a464ab6ce8897032a22e3d75ee0f90", "score": "0.58878547", "text": "func (f *JobHistoryFilter) WhereCreateTime(p entql.TimeP) {\n\tf.Where(p.Field(jobhistory.FieldCreateTime))\n}", "title": "" }, { "docid": "df556deeaf308d3ebce86625f8b41181", "score": "0.5878934", "text": "func DateEQ(v time.Time) predicate.Checksymptom {\n\treturn predicate.Checksymptom(func(s *sql.Selector) {\n\t\ts.Where(sql.EQ(s.C(FieldDate), v))\n\t})\n}", "title": "" }, { "docid": "1319229b85011438c92195019b4caded", "score": "0.5853537", "text": "func (f *OrgUnitMemberFilter) WhereCreateTime(p entql.TimeP) {\n\tf.Where(p.Field(orgunitmember.FieldCreateTime))\n}", "title": "" }, { "docid": "03f79915f30be4fa0fe1caa179d1258d", "score": "0.57932997", "text": "func (f *OrgUnitPositionFilter) WhereCreateTime(p entql.TimeP) {\n\tf.Where(p.Field(orgunitposition.FieldCreateTime))\n}", "title": "" }, { "docid": "846df3ce46bf551d5b02f8f92d5e1317", "score": "0.5571296", "text": "func DateEQ(v time.Time) predicate.Warning {\n\treturn predicate.Warning(func(s *sql.Selector) {\n\t\ts.Where(sql.EQ(s.C(FieldDate), v))\n\t})\n}", "title": "" }, { "docid": "82818e0570c101278022ea12f6c8e3be", "score": "0.5500997", "text": "func (f *CardFilter) WhereUpdateTime(p entql.TimeP) {\n\tf.Where(p.Field(card.FieldUpdateTime))\n}", "title": "" }, { "docid": "de37869ad2f194f0592f0700f5a092e5", "score": "0.5497048", "text": "func (f *SystemFilter) WhereUpdateTime(p entql.TimeP) {\n\tf.Where(p.Field(system.FieldUpdateTime))\n}", "title": "" }, { "docid": "4c0a0831576598b812f3aec07c3a4748", "score": "0.54834825", "text": "func DatetimeEQ(v time.Time) predicate.Carservice {\n\treturn predicate.Carservice(func(s *sql.Selector) {\n\t\ts.Where(sql.EQ(s.C(FieldDatetime), v))\n\t})\n}", "title": "" }, { "docid": "c9807d874d1aa0890e2a56031c2efe11", "score": "0.5479576", "text": "func DateContains(v string) predicate.Mealplan {\n\treturn predicate.Mealplan(func(s *sql.Selector) {\n\t\ts.Where(sql.Contains(s.C(FieldDate), v))\n\t})\n}", "title": "" }, { "docid": "6410cc389b5090b330036cf74d3267e8", "score": "0.5424986", "text": "func Time(v time.Time) predicate.Stock {\n\treturn predicate.Stock(func(s *sql.Selector) {\n\t\ts.Where(sql.EQ(s.C(FieldTime), v))\n\t})\n}", "title": "" }, { "docid": "984ed6568d5bdd62b387995c0d6a4ee3", "score": "0.5411635", "text": "func (f *UserFilter) WhereUpdateTime(p entql.TimeP) {\n\tf.Where(p.Field(user.FieldUpdateTime))\n}", "title": "" }, { "docid": "e296ae3cfe20bb561c26a21a63405e18", "score": "0.54097074", "text": "func DateEQ(v string) predicate.Mealplan {\n\treturn predicate.Mealplan(func(s *sql.Selector) {\n\t\ts.Where(sql.EQ(s.C(FieldDate), v))\n\t})\n}", "title": "" }, { "docid": "1eccdcc9932f8f5109d6378881d55d15", "score": "0.5379452", "text": "func DateTime(v time.Time) predicate.DrugAllergy {\n\treturn predicate.DrugAllergy(func(s *sql.Selector) {\n\t\ts.Where(sql.EQ(s.C(FieldDateTime), v))\n\t})\n}", "title": "" }, { "docid": "ad70c957aaed69926e5d7bcf592d6145", "score": "0.53663033", "text": "func (f *TaskFilter) WhereCreatedAt(p entql.TimeP) {\n\tf.Where(p.Field(enttask.FieldCreatedAt))\n}", "title": "" }, { "docid": "2254c6d3ef31d898ef668b0b3ebd5be9", "score": "0.5348027", "text": "func Time(v time.Time) predicate.IssueX1355 {\n\treturn predicate.IssueX1355(func(s *sql.Selector) {\n\t\ts.Where(sql.EQ(s.C(FieldTime), v))\n\t})\n}", "title": "" }, { "docid": "17ff5ea0c66fd3012f24a1f9fcfdf650", "score": "0.53404546", "text": "func (f *LicenseFilter) WhereUpdateTime(p entql.TimeP) {\n\tf.Where(p.Field(license.FieldUpdateTime))\n}", "title": "" }, { "docid": "8112910f5f832817523ea81ffcbb5f73", "score": "0.5235527", "text": "func DateIn(vs ...time.Time) predicate.MarketHours {\n\treturn predicate.MarketHours(sql.FieldIn(FieldDate, vs...))\n}", "title": "" }, { "docid": "ea4a5bce8d0064779c8b6c86d255eaef", "score": "0.52345705", "text": "func (f *OrganizationFilter) WhereUpdateTime(p entql.TimeP) {\n\tf.Where(p.Field(organization.FieldUpdateTime))\n}", "title": "" }, { "docid": "349a202dbf758159a9a8edea874ef023", "score": "0.52066", "text": "func DateOf(t time.Time) Date {\n\ty, m, d := t.Date()\n\tt = time.Date(y, m, d, 0, 0, 0, 0, time.UTC)\n\treturn dbtype.Date(t)\n}", "title": "" }, { "docid": "d5acffd64b8cf4327d1ef32159a0bd6f", "score": "0.51829576", "text": "func DateGTE(v time.Time) predicate.Checksymptom {\n\treturn predicate.Checksymptom(func(s *sql.Selector) {\n\t\ts.Where(sql.GTE(s.C(FieldDate), v))\n\t})\n}", "title": "" }, { "docid": "2f4b6856833520c39a6c3b0377d1724e", "score": "0.51771986", "text": "func DateContainsFold(v string) predicate.Mealplan {\n\treturn predicate.Mealplan(func(s *sql.Selector) {\n\t\ts.Where(sql.ContainsFold(s.C(FieldDate), v))\n\t})\n}", "title": "" }, { "docid": "b39a34d7af5ed20b08fd2191176e15e1", "score": "0.5157576", "text": "func DatetimeEQ(v time.Time) predicate.DispenseMedicine {\n\treturn predicate.DispenseMedicine(func(s *sql.Selector) {\n\t\ts.Where(sql.EQ(s.C(FieldDatetime), v))\n\t})\n}", "title": "" }, { "docid": "88669ec28827375ecf5d3a1d7a732f51", "score": "0.5151116", "text": "func (t *Table) WhereDay(field, day string) *Table {\n\treturn t.Clone().Search.Where(WhereTimeParse(field, day, 0, 0, 1)).table\n}", "title": "" }, { "docid": "ec138b4ccf93793614179f4471a4b43f", "score": "0.5143202", "text": "func (m *Meetings) FindOnDate(tx *pop.Connection, timeInFocus time.Time) error {\n\tdate := timeInFocus.Format(domain.DateTimeFormat)\n\twhere := \"start_date <= ? and end_date >= ?\"\n\n\tif err := getOrdered(m, tx.Where(where, date, date)); err != nil {\n\t\treturn fmt.Errorf(\"error finding meeting with start_date and end_date straddling %s ... %s\",\n\t\t\tdate, err.Error())\n\t}\n\n\treturn nil\n}", "title": "" }, { "docid": "bedfd40230fceb007dba5493ada61ce4", "score": "0.5140428", "text": "func (m *Meetings) FindOnDate(timeInFocus time.Time) error {\n\tdate := timeInFocus.Format(domain.DateTimeFormat)\n\twhere := \"start_date <= ? and end_date >= ?\"\n\n\tif err := getOrdered(m, DB.Where(where, date, date)); err != nil {\n\t\treturn fmt.Errorf(\"error finding meeting with start_date and end_date straddling %s ... %s\",\n\t\t\tdate, err.Error())\n\t}\n\n\treturn nil\n}", "title": "" }, { "docid": "212533ad5973efe317bb8e687622f32c", "score": "0.5132774", "text": "func UpdateDate(v time.Time) predicate.Configpoint {\n\treturn predicate.Configpoint(func(s *sql.Selector) {\n\t\ts.Where(sql.EQ(s.C(FieldUpdateDate), v))\n\t})\n}", "title": "" }, { "docid": "f61af79d68b96d8a85de2037d803c95c", "score": "0.51235557", "text": "func queryFilterDate(db *gorm.DB, startDate string, endDate string) (*gorm.DB, error) {\n\n\t// startDate string (query) The date (in ISO-8601 format) from which we want to get short URLs.\n\tif startDate != \"\" {\n\t\tdate, err := utils.ParseDateString(startDate)\n\t\tif err != nil {\n\t\t\treturn db, err\n\t\t}\n\t\tdb = db.Where(\"short_urls.created_at >= ?\", date)\n\t}\n\n\t// endDate string (query)\n\tif endDate != \"\" {\n\t\tdate, err := utils.ParseDateString(endDate)\n\t\tif err != nil {\n\t\t\treturn db, err\n\t\t}\n\t\tdb = db.Where(\"short_urls.created_at <= ?\", date)\n\t}\n\treturn db, nil\n}", "title": "" }, { "docid": "0436958afb52a432a0830ff71cd76368", "score": "0.5105486", "text": "func (f *OrgUnitFilter) WhereUpdateTime(p entql.TimeP) {\n\tf.Where(p.Field(orgunit.FieldUpdateTime))\n}", "title": "" }, { "docid": "6ff7bea7e83390b567b6482972f6b8e9", "score": "0.50753945", "text": "func DateLT(v time.Time) predicate.MarketHours {\n\treturn predicate.MarketHours(sql.FieldLT(FieldDate, v))\n}", "title": "" }, { "docid": "229bf0ac1d1f954f64499d46586610bd", "score": "0.5050597", "text": "func DateNotIn(vs ...time.Time) predicate.MarketHours {\n\treturn predicate.MarketHours(sql.FieldNotIn(FieldDate, vs...))\n}", "title": "" }, { "docid": "20658336bde3931f9a1e1beb9ff26795", "score": "0.50440145", "text": "func DateLTE(v time.Time) predicate.Checksymptom {\n\treturn predicate.Checksymptom(func(s *sql.Selector) {\n\t\ts.Where(sql.LTE(s.C(FieldDate), v))\n\t})\n}", "title": "" }, { "docid": "81c281812a7d695d53c481b5b8a96895", "score": "0.5011474", "text": "func DateIn(vs ...time.Time) predicate.Checksymptom {\n\tv := make([]interface{}, len(vs))\n\tfor i := range v {\n\t\tv[i] = vs[i]\n\t}\n\treturn predicate.Checksymptom(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(FieldDate), v...))\n\t})\n}", "title": "" }, { "docid": "b6da763ea47a5a3e8fc1da7fa9cc84d2", "score": "0.49756077", "text": "func DateLT(v time.Time) predicate.Checksymptom {\n\treturn predicate.Checksymptom(func(s *sql.Selector) {\n\t\ts.Where(sql.LT(s.C(FieldDate), v))\n\t})\n}", "title": "" }, { "docid": "b07aaf56e3bfeb13d92e4d26ecaa8ee9", "score": "0.49218935", "text": "func (qs EventQuerySet) TimeEq(time uint) EventQuerySet {\n\treturn qs.w(qs.db.Where(\"time = ?\", time))\n}", "title": "" }, { "docid": "ed91e68339edab2912d8b911c644059a", "score": "0.4908545", "text": "func DateLTE(v time.Time) predicate.MarketHours {\n\treturn predicate.MarketHours(sql.FieldLTE(FieldDate, v))\n}", "title": "" }, { "docid": "c3380f06fa174a7654ed1aaad23a875f", "score": "0.48927048", "text": "func (_OrgsData *OrgsDataFilterer) FilterOnSetTime(opts *bind.FilterOpts) (*OrgsDataOnSetTimeIterator, error) {\n\n\tlogs, sub, err := _OrgsData.contract.FilterLogs(opts, \"onSetTime\")\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\treturn &OrgsDataOnSetTimeIterator{contract: _OrgsData.contract, event: \"onSetTime\", logs: logs, sub: sub}, nil\n}", "title": "" }, { "docid": "a80b716e3ccc88a96e604aefd8eb7c28", "score": "0.48726532", "text": "func ExpireDate(v time.Time) predicate.Configpoint {\n\treturn predicate.Configpoint(func(s *sql.Selector) {\n\t\ts.Where(sql.EQ(s.C(FieldExpireDate), v))\n\t})\n}", "title": "" }, { "docid": "5910ace87b4005c8022667fd858b85aa", "score": "0.4857138", "text": "func (dao TransactionDao) SearchByDate(date time.Time) (t []model.Transaction, err error) {\n\terr = dao.DB.\n\t\tPreload(\"Account.User\").\n\t\tPreload(\"Account.Bank\").\n\t\tPreload(\"TransactionType\").\n\t\tPreload(\"Account\").\n\t\t// FIXME : format date to force unckeck hours to_char ?\n\t\tWhere(\"posteddate = ? or userdate = ?\", date, date).\n\t\tOrder(\"posteddate desc\").\n\t\tFind(&t).Error\n\treturn\n}", "title": "" }, { "docid": "bc344a681d3dba4bdf1ee9dd7daae4c5", "score": "0.48207495", "text": "func (f *OrgUnitMemberFilter) WhereUpdateTime(p entql.TimeP) {\n\tf.Where(p.Field(orgunitmember.FieldUpdateTime))\n}", "title": "" }, { "docid": "e3f49107505a4ab817c6c7252a09217c", "score": "0.48198837", "text": "func DatetimeIn(vs ...time.Time) predicate.Carservice {\n\tv := make([]interface{}, len(vs))\n\tfor i := range v {\n\t\tv[i] = vs[i]\n\t}\n\treturn predicate.Carservice(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(FieldDatetime), v...))\n\t})\n}", "title": "" }, { "docid": "298a1f70cd0f657e25cd068db8cf586f", "score": "0.48031136", "text": "func (f *UserFilter) WhereBirthday(p entql.TimeP) {\n\tf.Where(p.Field(user.FieldBirthday))\n}", "title": "" }, { "docid": "e3446bde58705341130c1595ef303676", "score": "0.47981417", "text": "func (report ReportEntryList) Filter(date string) ReportEntryList {\n\tvar reportForDate ReportEntryList\n\t// 0123 45 67\n\t// 2016 06 01\n\t// 2016-06-01\n\tdate = date[:4] + \"-\" + date[4:6] + \"-\" + date[6:8]\n\n\tfor _, entry := range report {\n\t\tif strings.Contains(entry.ts, date) {\n\t\t\treportForDate = append(reportForDate, entry)\n\t\t}\n\t}\n\n\treturn reportForDate\n}", "title": "" }, { "docid": "dea9631c244e9456722f308feecae64c", "score": "0.47885275", "text": "func Time(v int64) predicate.SensorData {\n\treturn predicate.SensorData(func(s *sql.Selector) {\n\t\ts.Where(sql.EQ(s.C(FieldTime), v))\n\t})\n}", "title": "" }, { "docid": "b551bf078d30c98188fab34098a333c3", "score": "0.47869402", "text": "func Date(date string) func(*QueryOptions) {\n\treturn func(opts *QueryOptions) {\n\t\t(*opts)[\"date\"] = date\n\t}\n}", "title": "" }, { "docid": "b057a973b8e9aa876e9ca58cf6342ebe", "score": "0.47818947", "text": "func DueDate(v time.Time) predicate.Assignment {\n\treturn predicate.Assignment(func(s *sql.Selector) {\n\t\ts.Where(sql.EQ(s.C(FieldDueDate), v))\n\t})\n}", "title": "" }, { "docid": "8a49095700b04af40e83c2fc04dd8ac8", "score": "0.47771686", "text": "func (f *FieldTypeFilter) WhereSensitive(p entql.BytesP) {\n\tf.Where(p.Field(fieldtype.FieldSensitive))\n}", "title": "" }, { "docid": "2159fe0a6982473911d1309f65ece00d", "score": "0.47751296", "text": "func (f *FileTypeFilter) WhereType(p entql.StringP) {\n\tf.Where(p.Field(filetype.FieldType))\n}", "title": "" }, { "docid": "fe9a85f3a242cab96e540367f5cdf8b9", "score": "0.4763914", "text": "func DateGTE(v time.Time) predicate.MarketHours {\n\treturn predicate.MarketHours(sql.FieldGTE(FieldDate, v))\n}", "title": "" }, { "docid": "47e595c8c768252f5ee6cd49b1ec3929", "score": "0.47449827", "text": "func DateGTE(v time.Time) predicate.Warning {\n\treturn predicate.Warning(func(s *sql.Selector) {\n\t\ts.Where(sql.GTE(s.C(FieldDate), v))\n\t})\n}", "title": "" }, { "docid": "c01071b3a852ad30dfc489e0c3c61755", "score": "0.4741998", "text": "func DateEqualFold(v string) predicate.Mealplan {\n\treturn predicate.Mealplan(func(s *sql.Selector) {\n\t\ts.Where(sql.EqualFold(s.C(FieldDate), v))\n\t})\n}", "title": "" }, { "docid": "d72242ca01af92005b2fa70115ac442f", "score": "0.47200885", "text": "func DatetimeGTE(v time.Time) predicate.Carservice {\n\treturn predicate.Carservice(func(s *sql.Selector) {\n\t\ts.Where(sql.GTE(s.C(FieldDatetime), v))\n\t})\n}", "title": "" }, { "docid": "f8cb60ea15ee3a741b6005b9dea081ad", "score": "0.47194275", "text": "func (f *ResourceFilter) WhereType(p entql.StringP) {\n\tf.Where(p.Field(resource.FieldType))\n}", "title": "" }, { "docid": "d928438e29b320e23c47101743bbadbe", "score": "0.4702505", "text": "func DateLTE(v time.Time) predicate.Warning {\n\treturn predicate.Warning(func(s *sql.Selector) {\n\t\ts.Where(sql.LTE(s.C(FieldDate), v))\n\t})\n}", "title": "" }, { "docid": "0a9fd35f4760ee84d49679cb98356179", "score": "0.4689446", "text": "func DateFilter(data []InputRecord, start time.Time) []InputRecord {\n\tresult := make([]InputRecord, 0)\n\tfor _, record := range data {\n\t\tif record.Date.After(start) {\n\t\t\tresult = append(result, record)\n\t\t}\n\t}\n\treturn result\n}", "title": "" }, { "docid": "85375f3d38cab1caa43374d51d682dd8", "score": "0.46742272", "text": "func DateTimeEQ(v time.Time) predicate.DrugAllergy {\n\treturn predicate.DrugAllergy(func(s *sql.Selector) {\n\t\ts.Where(sql.EQ(s.C(FieldDateTime), v))\n\t})\n}", "title": "" }, { "docid": "8754ce8a497b68c3f6d130a716f6052e", "score": "0.4672592", "text": "func (f *FieldTypeFilter) WhereDeletedAt(p entql.TimeP) {\n\tf.Where(p.Field(fieldtype.FieldDeletedAt))\n}", "title": "" }, { "docid": "c433560f694e2014cd72c61aceb726c3", "score": "0.46719927", "text": "func (f *OrgUnitPositionFilter) WhereUpdateTime(p entql.TimeP) {\n\tf.Where(p.Field(orgunitposition.FieldUpdateTime))\n}", "title": "" }, { "docid": "2e71b38dee71316f5c8db34452f9fe60", "score": "0.46680003", "text": "func UploadDate(v string) predicate.Student {\n\treturn predicate.Student(func(s *sql.Selector) {\n\t\ts.Where(sql.EQ(s.C(FieldUploadDate), v))\n\t})\n}", "title": "" }, { "docid": "90c2218316c68e5aec2f25678cdf56f9", "score": "0.46675554", "text": "func DateLTE(v string) predicate.Mealplan {\n\treturn predicate.Mealplan(func(s *sql.Selector) {\n\t\ts.Where(sql.LTE(s.C(FieldDate), v))\n\t})\n}", "title": "" }, { "docid": "2932b876a18b42f91f08370262cbdb9c", "score": "0.46620488", "text": "func GetEntriesByDate(start time.Time, end time.Time, db *gorm.DB) []Entry {\n\tvar entries []Entry\n\tdb.Where(\"created_at >= ? and created_at <= ?\", start, end).Find(&entries)\n\treturn entries\n}", "title": "" }, { "docid": "a6e9724fea94fef43887c73e5bfbfff8", "score": "0.4660366", "text": "func Date(t time.Time, others ...time.Time) DateTimeValue {\n\treturn DateTimeValue{\n\t\tParameters: parameter.Parameters{value.Date()},\n\t\tValue: t,\n\t\tOthers: others,\n\t\tincludeTime: false,\n\t}\n}", "title": "" }, { "docid": "1d5459802753bca24963ddc50a649ae5", "score": "0.46451825", "text": "func DateLT(v time.Time) predicate.Warning {\n\treturn predicate.Warning(func(s *sql.Selector) {\n\t\ts.Where(sql.LT(s.C(FieldDate), v))\n\t})\n}", "title": "" }, { "docid": "70846c919d57f334176ba2f082366d9c", "score": "0.4634332", "text": "func (f *FileTypeFilter) Where(p entql.P) {\n\tf.addPredicate(func(s *sql.Selector) {\n\t\tif err := schemaGraph.EvalP(schemaGraph.Nodes[5].Type, p, s); err != nil {\n\t\t\ts.AddError(err)\n\t\t}\n\t})\n}", "title": "" }, { "docid": "f9f1cf6e6dce209e02b92402fec49289", "score": "0.46335104", "text": "func DateGTE(v string) predicate.Mealplan {\n\treturn predicate.Mealplan(func(s *sql.Selector) {\n\t\ts.Where(sql.GTE(s.C(FieldDate), v))\n\t})\n}", "title": "" }, { "docid": "f67280408c85ab48ca228d87d3d7b7d3", "score": "0.4631641", "text": "func (i *Datetime) Filter(entry *Entry) (validEntry *Entry) {\n\tval, err := entry.Field(i.Field)\n\tif err != nil {\n\t\t// TODO handle error\n\t\treturn\n\t}\n\tt, err := time.Parse(i.Format, val)\n\tif err != nil {\n\t\t// TODO handle error\n\t\treturn\n\t}\n\tif i.withinBounds(t) {\n\t\tvalidEntry = entry\n\t}\n\treturn\n}", "title": "" }, { "docid": "0b52939390ddafb05c4d5190273c659d", "score": "0.46274477", "text": "func DateNEQ(v time.Time) predicate.MarketHours {\n\treturn predicate.MarketHours(sql.FieldNEQ(FieldDate, v))\n}", "title": "" }, { "docid": "374b74afe626be52c48a0df73800a4bb", "score": "0.46227664", "text": "func TimeEQ(v time.Time) predicate.Stock {\n\treturn predicate.Stock(func(s *sql.Selector) {\n\t\ts.Where(sql.EQ(s.C(FieldTime), v))\n\t})\n}", "title": "" }, { "docid": "f92a8d43c455689596b09fc84a37ee79", "score": "0.46226573", "text": "func DatetimeLTE(v time.Time) predicate.Carservice {\n\treturn predicate.Carservice(func(s *sql.Selector) {\n\t\ts.Where(sql.LTE(s.C(FieldDatetime), v))\n\t})\n}", "title": "" }, { "docid": "3e930be285111ad5424cb5b9c8c5a441", "score": "0.4615964", "text": "func RETURNDATE(v time.Time) predicate.Equipmentrental {\n\treturn predicate.Equipmentrental(func(s *sql.Selector) {\n\t\ts.Where(sql.EQ(s.C(FieldRETURNDATE), v))\n\t})\n}", "title": "" }, { "docid": "9811f8c8051c01be8df331fb1072e233", "score": "0.4615078", "text": "func (f *FieldTypeFilter) Where(p entql.P) {\n\tf.addPredicate(func(s *sql.Selector) {\n\t\tif err := schemaGraph.EvalP(schemaGraph.Nodes[3].Type, p, s); err != nil {\n\t\t\ts.AddError(err)\n\t\t}\n\t})\n}", "title": "" }, { "docid": "7106d09117812b3e9011d214b32236d9", "score": "0.4614958", "text": "func DateNEQ(v time.Time) predicate.Checksymptom {\n\treturn predicate.Checksymptom(func(s *sql.Selector) {\n\t\ts.Where(sql.NEQ(s.C(FieldDate), v))\n\t})\n}", "title": "" }, { "docid": "269d6acb919adbc85618a63cd0a38dba", "score": "0.46146512", "text": "func UpdateTime(v time.Time) predicate.Article {\n\treturn predicate.Article(func(s *sql.Selector) {\n\t\ts.Where(sql.EQ(s.C(FieldUpdateTime), v))\n\t})\n}", "title": "" }, { "docid": "e00a2033c817b65f9251c2eea869e93f", "score": "0.46066815", "text": "func (t *Table) Date(name string, options ...ColumnOption) {\n\tt.Column(name, Date, options...)\n}", "title": "" }, { "docid": "f152b0f5feb3fd8d4d57143837f0eb21", "score": "0.45909214", "text": "func DatetimeIn(vs ...time.Time) predicate.DispenseMedicine {\n\tv := make([]interface{}, len(vs))\n\tfor i := range v {\n\t\tv[i] = vs[i]\n\t}\n\treturn predicate.DispenseMedicine(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(FieldDatetime), v...))\n\t})\n}", "title": "" }, { "docid": "bbfd7106efc49526b7403485bc693aa2", "score": "0.45844012", "text": "func DateNotIn(vs ...time.Time) predicate.Checksymptom {\n\tv := make([]interface{}, len(vs))\n\tfor i := range v {\n\t\tv[i] = vs[i]\n\t}\n\treturn predicate.Checksymptom(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(FieldDate), v...))\n\t})\n}", "title": "" }, { "docid": "f4df7e5b0595c1e7510c36d4d10330b8", "score": "0.4572693", "text": "func OnDate(targetTime time.Time) R {\n\treturn RFunc(func(t time.Time) functional.Stream {\n\t\tif targetTime.After(t) {\n\t\t\treturn functional.NewStreamFromValues([]time.Time{targetTime}, nil)\n\t\t}\n\t\treturn functional.NilStream()\n\t})\n}", "title": "" }, { "docid": "d525e2f7eb35b7187f2a6d9b34fcb694", "score": "0.4556096", "text": "func StartDateTime(v time.Time) predicate.Rule {\n\treturn predicate.Rule(func(s *sql.Selector) {\n\t\ts.Where(sql.EQ(s.C(FieldStartDateTime), v))\n\t})\n}", "title": "" }, { "docid": "d41f4305bfa2581b6550c8532ca0dc11", "score": "0.45515028", "text": "func (f *CommentFilter) WhereTable(p entql.StringP) {\n\tf.Where(p.Field(comment.FieldTable))\n}", "title": "" }, { "docid": "102d7c772e3c2db2960c53be2547af04", "score": "0.4547229", "text": "func UpdateTime(v time.Time) predicate.Employee {\n\treturn predicate.Employee(func(s *sql.Selector) {\n\t\ts.Where(sql.EQ(s.C(FieldUpdateTime), v))\n\t})\n}", "title": "" }, { "docid": "961e9e9fbd6614bde6794c3f7a0d817d", "score": "0.45452598", "text": "func (o *With) SetQueryDate(v bool) {\n\to.QueryDate = &v\n}", "title": "" }, { "docid": "f01a706f8b3998e4ec5caf1b56dc612e", "score": "0.45398584", "text": "func DatetimeLT(v time.Time) predicate.Carservice {\n\treturn predicate.Carservice(func(s *sql.Selector) {\n\t\ts.Where(sql.LT(s.C(FieldDatetime), v))\n\t})\n}", "title": "" }, { "docid": "8ae5f90840781da28105fa3bde32cd61", "score": "0.45323187", "text": "func DateIn(vs ...time.Time) predicate.Warning {\n\tv := make([]interface{}, len(vs))\n\tfor i := range v {\n\t\tv[i] = vs[i]\n\t}\n\treturn predicate.Warning(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(FieldDate), v...))\n\t})\n}", "title": "" }, { "docid": "9d319bc21b3bbb02a170aafdc677def3", "score": "0.45282102", "text": "func (f *NodeFilter) WhereUpdatedAt(p entql.TimeP) {\n\tf.Where(p.Field(node.FieldUpdatedAt))\n}", "title": "" }, { "docid": "0523a5c246cddf2189486e9db733b3e0", "score": "0.45228073", "text": "func DateLT(v string) predicate.Mealplan {\n\treturn predicate.Mealplan(func(s *sql.Selector) {\n\t\ts.Where(sql.LT(s.C(FieldDate), v))\n\t})\n}", "title": "" }, { "docid": "a7578c6c8beda458f353f8758b264d4f", "score": "0.45188946", "text": "func macroTimeFilter(query *Query, args []string) (string, error) {\n\tif len(args) != 1 {\n\t\treturn \"\", fmt.Errorf(\"%w: expected 1 argument, received %d\", ErrorBadArgumentCount, len(args))\n\t}\n\n\tvar (\n\t\tcolumn = args[0]\n\t\tfrom = query.TimeRange.From.UTC().Format(time.RFC3339)\n\t\tto = query.TimeRange.To.UTC().Format(time.RFC3339)\n\t)\n\n\treturn fmt.Sprintf(\"%s >= '%s' AND %s <= '%s'\", column, from, column, to), nil\n}", "title": "" } ]
b577aa4590300c7de680a6faa976ba5f
Append appends the raw input to the current value.
[ { "docid": "f2241ba51ea6cb2b5be91db76ba4d9b1", "score": "0.811282", "text": "func Append(input []byte, current *Value) error {\n\tcurrent.reset()\n\tcurrent.Raw = append(current.Raw, input...)\n\treturn nil\n}", "title": "" } ]
[ { "docid": "f69e0b66e64a2dd4d8890b0429695813", "score": "0.6743561", "text": "func (s *MemoryStreams) InputAppend(text string) {\n\ts.InputReset(s.InputRead() + text)\n}", "title": "" }, { "docid": "44113a4e21175b8a3c06d9b60378d05b", "score": "0.64484763", "text": "func (i *Input) Append(c rune) string {\n\tif len(i.buffer) < MaxLength {\n\t\ti.buffer += string(c)\n\t}\n\treturn i.buffer\n}", "title": "" }, { "docid": "12956cc58ba2af26442adb80bdaaa99d", "score": "0.6440233", "text": "func (req *Request) Append(p []byte) {\n\treq.value = append(req.value, p...)\n}", "title": "" }, { "docid": "b95543a80af57f5e9c431172318e3d64", "score": "0.63170654", "text": "func AppendValue(buffer []byte, in interface{}) []byte {\n\tvar value []byte\n\n\t// convert input to []byte\n\tswitch concrete := in.(type) {\n\tcase []byte:\n\t\tvalue = concrete\n\n\tcase string:\n\t\tvalue = []byte(concrete)\n\tcase int64:\n\t\tvalue = []byte(strconv.FormatInt(concrete, 10))\n\tcase bool:\n\t\tvalue = []byte(strconv.FormatBool(concrete))\n\tcase float64:\n\t\tvalue = []byte(strconv.FormatFloat(concrete, 'e', 3, 64))\n\t}\n\n\tbuffer = append(buffer, value...)\n\treturn buffer\n}", "title": "" }, { "docid": "d1f3c834fcc167685c71b918f76d2748", "score": "0.62304443", "text": "func (buf *Buffer) Append(value interface{}) {\n\tbuf.commands <- bufferCommand{\n\t\tcommand: AppendCommand,\n\t\tvalue: value,\n\t}\n}", "title": "" }, { "docid": "a960d65959f0a438fe2b085614ec1909", "score": "0.59579813", "text": "func (v *TVector) Append(value interface{}) *TVector {\n\tv.ensureEditable()\n\tv.makeModifiable()\n\tswitch {\n\tcase v.roomInTail():\n\t\tv.tail.assoc(v.count&mask, value)\n\tcase v.overflowsRoot():\n\t\tnewroot := vnodeNew(v.root.edit)\n\t\tnewroot.array[0] = v.root\n\t\tnewroot.array[1] = newPath(v.root.edit, v.shift,\n\t\t\tvnodeNewFromArray(v.root.edit, v.tail))\n\t\tv.root = newroot\n\t\tv.shift = v.shift + bits\n\t\tv.tail = new(array).assoc(0, value)\n\tdefault:\n\t\tv.root = v.pushTail(v.shift, v.root,\n\t\t\tvnodeNewFromArray(v.root.edit, v.tail))\n\t\tv.tail = new(array).assoc(0, value)\n\t}\n\n\tv.count = v.count + 1\n\treturn v\n}", "title": "" }, { "docid": "4fa0e6f473cba1ab5f5da6e3c181559c", "score": "0.5890375", "text": "func (aof *AOF) Append(v Value) error {\n\treturn aof.AppendMulti([]Value{v})\n}", "title": "" }, { "docid": "bbd99f9380be714d8bf5a0aee535913e", "score": "0.585248", "text": "func (u *Update) Append(fld string, val ...RValue) *Update {\n\treturn u.add(AppendOperation{field: fld, values: val})\n}", "title": "" }, { "docid": "483b8df1aade8f5a21120c16310dd2da", "score": "0.56845915", "text": "func (self A) Append(buf []byte) []byte {\n\tfor _, val := range self {\n\t\tbuf = val.Append(buf)\n\t}\n\treturn buf\n}", "title": "" }, { "docid": "7ac59ac7d3fbbe27e746794902b10baf", "score": "0.5656055", "text": "func (pkt *Packet) Append(input []byte) error {\n\tcount := len(input)\n\tif count == 0 {\n\t\treturn nil\n\t}\n\n\troom := C.rte_pktmbuf_append(pkt.ptr(), C.uint16_t(count))\n\tif room == nil {\n\t\treturn fmt.Errorf(\"insufficient tailroom %d\", pkt.Tailroom())\n\t}\n\tC.rte_memcpy(unsafe.Pointer(room), unsafe.Pointer(&input[0]), C.size_t(count))\n\treturn nil\n}", "title": "" }, { "docid": "fa6ced69624ce11d398fc96e0021f8d4", "score": "0.5602274", "text": "func (v *Vector) Append(value interface{}) *Vector {\n\tif v == nil {\n\t\treturn Empty().Append(value)\n\t}\n\tswitch {\n\tcase v.roomInTail():\n\t\treturn &Vector{\n\t\t\tcount: v.count + 1,\n\t\t\tshift: v.shift,\n\t\t\troot: v.root,\n\t\t\ttail: v.tail.appendExact(value),\n\t\t}\n\tcase v.overflowsRoot():\n\t\troot := vnodeNew(v.root.edit)\n\t\troot.array[0] = v.root\n\t\troot.array[1] = newPath(v.root.edit, v.shift,\n\t\t\tvnodeNewFromSlice(v.root.edit, v.tail))\n\t\treturn &Vector{\n\t\t\tcount: v.count + 1,\n\t\t\tshift: v.shift + bits,\n\t\t\troot: root,\n\t\t\ttail: make(slice, 1).assoc(0, value),\n\t\t}\n\tdefault:\n\t\treturn &Vector{\n\t\t\tcount: v.count + 1,\n\t\t\tshift: v.shift,\n\t\t\troot: v.pushTail(v.shift, v.root,\n\t\t\t\tvnodeNewFromSlice(v.root.edit, v.tail)),\n\t\t\ttail: make(slice, 1).assoc(0, value),\n\t\t}\n\t}\n}", "title": "" }, { "docid": "fbeef8d6cdc748ef6b6f1436ba01bdf1", "score": "0.55646336", "text": "func (rn *RaftNode) Append(data []byte) {\n\trn.AppEvent <- Append{Data: data}\n}", "title": "" }, { "docid": "e602ed3d2fdeccca7b9b04c20b2bbbe7", "score": "0.5559305", "text": "func (op TextOp) Append(comp Component) {\n op = append(op, comp)\n}", "title": "" }, { "docid": "71b82dfd87d4ab856d413f5ed13d1121", "score": "0.55460674", "text": "func (r *Ramen) Append(name string, value interface{}) {\n\ti := ingredient{name, value}\n\tr.ingredients = append(r.ingredients, i)\n}", "title": "" }, { "docid": "5df9ff3bc05d7afc8621603e2e504afa", "score": "0.5524413", "text": "func (ml *MutableList) Append(val interface{}) error {\n\t// NOTE: It could be an optimization here to serializing val and appending\n\t// it directly to .raw if .decoded is nil. Seems like overkill.\n\tif !ml.ty.ListType.IsValid(val) {\n\t\treturn ErrSchema\n\t}\n\n\t_, er := ml.decode()\n\tif er != nil {\n\t\treturn er\n\t}\n\n\tif len(ml.decoded) == ml.ty.MaxLen {\n\t\treturn ErrSchema\n\t}\n\n\tml.decoded = append(ml.decoded, val)\n\treturn nil\n}", "title": "" }, { "docid": "0ced00e67ecb7a0508513c5f1ca94afb", "score": "0.54991835", "text": "func (b *Builder) Add(s string) {\n\tb.buf = append(b.buf, s...)\n}", "title": "" }, { "docid": "04a4de499ace9ecba9909f4600a5d123", "score": "0.54816806", "text": "func (c *Base[T]) Append(v ...T) {\n\tc.values = append(c.values, v...)\n\tc.numRow += len(v)\n}", "title": "" }, { "docid": "44946c6c6adbeb191e3fd7d541e6eca1", "score": "0.54772604", "text": "func (b *Bytes) AppendVal(v []byte) {\n\tif b.isWindow {\n\t\tpanic(\"AppendVal is called on a window into Bytes\")\n\t}\n\tb.maybeBackfillOffsets(b.Len())\n\tb.data = append(b.data[:b.offsets[b.Len()]], v...)\n\tb.maxSetIndex = b.Len()\n\tb.offsets = append(b.offsets, int32(len(b.data)))\n}", "title": "" }, { "docid": "18b019ad4c56f3d7c17e64fc3f4346a7", "score": "0.5457535", "text": "func (self Attr) Append(buf []byte) []byte {\n\tif self == (Attr{}) {\n\t\treturn buf\n\t}\n\n\tkey, val := self.Name(), self.Value()\n\tvalidAttr(key)\n\n\tif Bool.Has(key) {\n\t\t// Dumb hack. Should revise.\n\t\tif val == \"false\" {\n\t\t\treturn buf\n\t\t}\n\t\tval = \"\"\n\t}\n\n\tbuf = append(buf, ` `...)\n\tbuf = append(buf, key...)\n\tbuf = append(buf, `=\"`...)\n\t_, _ = (*AttrWri)(&buf).WriteString(val)\n\tbuf = append(buf, `\"`...)\n\treturn buf\n}", "title": "" }, { "docid": "b777d4067ec4c66aaaf98ba5a9f37912", "score": "0.5434937", "text": "func (data *Data) Append(b []byte) {\n\tdata.b = append(data.b, b...)\n}", "title": "" }, { "docid": "c2f7d464792dcf4b8f625d4e7e0eca53", "score": "0.5428772", "text": "func (str Strings) Append(ctx context.Context, key, value string) (int64, error) {\n\treq := newRequest(\"*3\\r\\n$6\\r\\nAPPEND\\r\\n$\")\n\treq.addString2(key, value)\n\treturn str.c.cmdInt(ctx, req)\n}", "title": "" }, { "docid": "5f7ac2b05894a84fde085efa43af9e7e", "score": "0.541194", "text": "func (p *Updater) AddInput(txInput *transaction.TxInput) {\n\tp.Data.UnsignedTx.AddInput(txInput)\n\tp.Data.Inputs = append(p.Data.Inputs, PInput{})\n}", "title": "" }, { "docid": "44a78f5afe2e29f1f6926fddf2b0be8b", "score": "0.540936", "text": "func Append(buf *bytes.Buffer, data ...[]byte) *bytes.Buffer {\n\n\tfor _, b := range data {\n\t\tbuf.Write(b)\n\t}\n\treturn buf\n}", "title": "" }, { "docid": "891d2c9fa3f039c00128094dcbb8a0fe", "score": "0.5365587", "text": "func (b *Builder) Append(s string) *Builder {\n\tswitch {\n\tcase len(s) == 0:\n\tdefault:\n\t\tb.WriteString(s)\n\t}\n\n\treturn b\n}", "title": "" }, { "docid": "7dcbb8ef6115fda89b1da3ea780b4ed1", "score": "0.53546894", "text": "func (ck *Clerk) Append(key string, value string) {\n\tck.PutAppend(key, value, \"Append\")\n}", "title": "" }, { "docid": "8287e2f8b133f4f0499d32222b02131a", "score": "0.53392816", "text": "func (sa *SafeArray) Append(v interface{}) {\n\tsa.m.Lock()\n\tdefer sa.m.Unlock()\n\n\tif sa.limit == 0 {\n\t} else if len(sa.array) > sa.limit {\n\t\tsa.array = sa.array[1:]\n\t}\n\n\tsa.array = append(sa.array, v)\n}", "title": "" }, { "docid": "65dc0f1310478b1bf1752036e470d509", "score": "0.5316187", "text": "func (rc *RaftClient) Append(key string, value string) {\n\trc.PutAppend(key, value, \"Append\")\n}", "title": "" }, { "docid": "9c1a9a77879cded1737e972ac4660cdd", "score": "0.53130925", "text": "func (b *BloomFilter) Append(value []byte) (err error) {\n\tb.RLock()\n\tdefer b.RUnlock()\n\tif b.cache != nil {\n\t\tb.cache.Load(value)\n\t}\n\treturn b.storage.Append(value)\n}", "title": "" }, { "docid": "1e6af37c1c8e99ae0526d0b7b7bdaf0c", "score": "0.5279507", "text": "func add(originalValue, newValue []byte) []byte {\n\treturn append(originalValue, newValue...)\n}", "title": "" }, { "docid": "91f0c564d6e99292bdbadd1c2357087d", "score": "0.5262826", "text": "func (d *D) Append(name string, value interface{}) {\n\t*d = append(*d, DocItem{name, value})\n}", "title": "" }, { "docid": "6667d1c9ea714f4d8d25ddc78ff163ca", "score": "0.52473825", "text": "func (eb *EncodingBuffer) Append(f Field) {\n\tif eb.err != nil {\n\t\treturn\n\t}\n\teb.b, eb.err = f.Encode(eb.b)\n}", "title": "" }, { "docid": "77196b106a0530ec5f28c86db9fab83a", "score": "0.5241202", "text": "func (in *SystemScanList) AppendRaw(dAtA []byte) error {\n\tcv := NewSystemScan()\n\tif err := json.Unmarshal(dAtA, cv); err != nil {\n\t\treturn err\n\t}\n\tin.Members = append(in.Members, *cv)\n\treturn nil\n}", "title": "" }, { "docid": "8909b74cc384256e94de2e1e9b9af2d6", "score": "0.5211061", "text": "func (n Node) Append(values ...Node) {\n\tif len(values) == 0 {\n\t\treturn\n\t}\n\tif nn := n.get(); nn != nil && nn.info.IsArray() {\n\t\tvv := nn.values\n\t\tfor _, v := range values {\n\t\t\tvv = append(vv, V{\n\t\t\t\tid: n.doc.copyOrAdopt(v.Document(), v.ID(), n.id),\n\t\t\t\tkey: \"\",\n\t\t\t})\n\t\t}\n\t\t// copyOrAdopt might grow nodes array invalidating nn pointer\n\t\tn.doc.nodes[n.id].values = vv\n\t}\n}", "title": "" }, { "docid": "afa64fa60d405a82820b989e2739039c", "score": "0.5209393", "text": "func (g *Godis) Append(key string, value string) int64 {\n\treturn g.cmdInt(\"APPEND\", key, value)\n}", "title": "" }, { "docid": "2bbb0ca3b06799bc80af47226c2db956", "score": "0.51794887", "text": "func (c *CollectionBinary) Append(key string, val []byte, opts *AppendOptions) (mutOut *MutationResult, errOut error) {\n\tif opts == nil {\n\t\topts = &AppendOptions{}\n\t}\n\n\tspan := c.startKvOpTrace(opts.ParentSpanContext, \"BinaryAppend\")\n\tdefer span.Finish()\n\n\t// Only update ctx if necessary, this means that the original ctx.Done() signal will be triggered as expected\n\tctx, cancel := c.context(opts.Context, opts.Timeout)\n\tif cancel != nil {\n\t\tdefer cancel()\n\t}\n\n\tres, err := c.append(ctx, span.Context(), key, val, *opts)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\treturn res, nil\n}", "title": "" }, { "docid": "08888e96665aa05a01313391c552d02e", "score": "0.5175376", "text": "func (column *ColumnString) Append(value string) {\n\tcolumn.data = append(column.data, value)\n}", "title": "" }, { "docid": "764123f1a25b04f50889fb424ca1f8f7", "score": "0.5166177", "text": "func (q *SearchQuery) Append(name, value string) {\n\tq.queries = append(q.queries, searchQueryElement{name, value})\n}", "title": "" }, { "docid": "ef7490caeb6254830f7ace8677e78fc6", "score": "0.5156924", "text": "func (t *Text) Append(str string) {\n\tt.sb.WriteString(str)\n}", "title": "" }, { "docid": "f91f3dddafbaac8c3fa4ebabb4d34607", "score": "0.51455355", "text": "func (v *V) Append(child *V) *Append {\n\tif nil == child {\n\t\tchild = NewNull()\n\t}\n\treturn &Append{\n\t\tv: v,\n\t\tc: child,\n\t}\n}", "title": "" }, { "docid": "c0c542c489167fa06bb15a1b6eaf6e40", "score": "0.51298326", "text": "func (h Handler) Append(cmd common.SetRequest) error {\n\tif err := binprot.WriteAppendCmd(h.rw.Writer, cmd.Key, cmd.Flags, cmd.Exptime, uint32(len(cmd.Data)), 0); err != nil {\n\t\treturn err\n\t}\n\treturn h.handleSetCommon(cmd)\n}", "title": "" }, { "docid": "92b553f8661f38f55e90e01ff623532e", "score": "0.5124786", "text": "func (in *HostOperationList) AppendRaw(dAtA []byte) error {\n\tcv := NewHostOperation()\n\tif err := json.Unmarshal(dAtA, cv); err != nil {\n\t\treturn err\n\t}\n\tin.Members = append(in.Members, *cv)\n\treturn nil\n}", "title": "" }, { "docid": "908c8ea6eb36f6eec6de7d82d023bed7", "score": "0.5098916", "text": "func (na *NodeArray) Append(node Node) {\n\tna.Value = append(na.Value, node)\n}", "title": "" }, { "docid": "35ae68d01dbd555c10772a04ce1b4ce1", "score": "0.5082936", "text": "func (x *Decimal) Append(buf []byte, fmt byte, prec int) []byte {\n\t// TODO: implement\n\treturn []byte{0}\n}", "title": "" }, { "docid": "96ce81160651274feaf17a107749f960", "score": "0.50797766", "text": "func (ck *Clerk) PutAppend(key string, value string, op string) {\n\t// You will have to modify this function.\n}", "title": "" }, { "docid": "965521751fe853c89d7c523ab8fa2a52", "score": "0.50770605", "text": "func (builder *Builder) Add(value interface{}) {\n\t*builder = append(*builder, value)\n}", "title": "" }, { "docid": "259e27f403a6de57f70f838997435587", "score": "0.50606173", "text": "func (r *SpreadsheetsValuesService) Append(spreadsheetId string, range_ string, valuerange *ValueRange) *SpreadsheetsValuesAppendCall {\n\tc := &SpreadsheetsValuesAppendCall{s: r.s, urlParams_: make(gensupport.URLParams)}\n\tc.spreadsheetId = spreadsheetId\n\tc.range_ = range_\n\tc.valuerange = valuerange\n\treturn c\n}", "title": "" }, { "docid": "d46cf4966b35b98fe14618efa8415dd2", "score": "0.5060071", "text": "func (r *fileRecorder) Append(data []byte) {\n\tdefer r.mu.Unlock()\n\tr.mu.Lock()\n\n\tvar frame = r.process(newWriteOp(r.fnode, r.offset, int64(len(data))), nil)\n\n\t// Perform an atomic write of the operation and its data.\n\tr.recordFromReader(io.MultiReader(\n\t\tbytes.NewReader(frame),\n\t\tbytes.NewReader(data)))\n\n\tr.offset += int64(len(data))\n}", "title": "" }, { "docid": "1c8e86cf7ecb11071441639c386b6d82", "score": "0.5051533", "text": "func (i *Iter) Append(data collections.Data) {\n\ti.values = append(i.values, data)\n}", "title": "" }, { "docid": "f4a5982e1d8c2c662f2f666fe9de30ca", "score": "0.5051142", "text": "func (kv *KVPaxos) PutAppend(args *PutAppendArgs, reply *PutAppendReply) error {\n\t//fmt.Println(\"KV Server PutAppend! key %s value %s on %d\", args.Key, args.Value, kv.me)\n\n\t// create operation\n\toperation := new(Op)\n\toperation.Key = args.Key\n\toperation.Value = args.Value\n\toperation.Cmd = args.Op\n\toperation.Hash = args.Hash\n\n\tkv.doPaxos(operation)\n\n\treply.Err = OK\n\n\treturn nil\n}", "title": "" }, { "docid": "6d759ad16f35f4562049a17687a63ddc", "score": "0.50485843", "text": "func (s *Slice) Append(value int) error {\n\tif s.used == cap(s.values) {\n\t\treturn errors.New(\"Index is full cannot append\")\n\t}\n\tind := s.trueIndex(s.start, s.used) // next index is same as num written\n\tif s.debug {\n\t\tfmt.Println(\"ind to write to \", ind)\n\t}\n\ts.values[ind] = value\n\ts.used++\n\treturn nil\n}", "title": "" }, { "docid": "0a03be5b435047cb739817aef0ccd1e3", "score": "0.5047158", "text": "func (list *LinkedList) AppendValue(value interface{}) {\n\tnode := NewNode(value)\n\tlist.AppendNode(node)\n}", "title": "" }, { "docid": "a23df6485cdd175bf1828259e5e04a95", "score": "0.5025872", "text": "func (p *Query) Append(queryString string) *Query {\n\tp.queryString += \" \" + queryString\n\treturn p\n}", "title": "" }, { "docid": "ca3e917291ab23860edad2d20a687c16", "score": "0.5023898", "text": "func (v *Vector[T]) Append(x T) {\n\t*v = append(*v, x)\n}", "title": "" }, { "docid": "7aaa94f436b5490f8aaf4d47e857118b", "score": "0.5005741", "text": "func (c *Calculator) Append(c1 *Calculator) {\n\tc.Cs.Append(c1.Cs)\n\tc.Cr.Append(c1.Cr)\n\tc.Ct.Append(c1.Ct)\n}", "title": "" }, { "docid": "aa730d0ba16f812d6bdfc2ab9dbd071a", "score": "0.49971873", "text": "func (fr *frame) callAppend(a, b *govalue) *govalue {\n\tbptr := fr.builder.CreateExtractValue(b.value, 0, \"\")\n\tblen := fr.builder.CreateExtractValue(b.value, 1, \"\")\n\telemsizeInt64 := fr.types.Sizeof(a.Type().Underlying().(*types.Slice).Elem())\n\telemsize := llvm.ConstInt(fr.target.IntPtrType(), uint64(elemsizeInt64), false)\n\tresult := fr.runtime.append.call(fr, a.value, bptr, blen, elemsize)[0]\n\treturn newValue(result, a.Type())\n}", "title": "" }, { "docid": "e20b1d74d5210d4e926739a3893316ca", "score": "0.49921846", "text": "func (neuron *Neuron) AddInput(input *Neuron, w Data) {\n\tinput.AddOutput(&Connection{c: neuron.input, weight: w})\n\tch := make(chan string)\n\tneuron.command <- message{message: AddInput, payload: input, reply: ch}\n\t_ = <-ch\n}", "title": "" }, { "docid": "27f1c1bc0e45f5122906b85453508e54", "score": "0.4987676", "text": "func (b *block) Append(slot int, value float64) bool {\n\tif slot > b.end {\n\t\treturn true\n\t}\n\tif slot < b.start {\n\t\treturn false\n\t}\n\tb.values.SetValue(slot, value)\n\treturn false\n}", "title": "" }, { "docid": "2455675880157b695281a2e61a3c5c52", "score": "0.4984936", "text": "func (s *MemoryStreams) InputAppendLine(line string) {\n\ts.InputAppend(line + \"\\n\")\n}", "title": "" }, { "docid": "63eaf071484285ba9219565f8505a427", "score": "0.49790847", "text": "func (ck *Clerk) PutAppend(key string, value string, op OPCode) {\n\t\n\tr := ck.RpcCallAndWait(key, value, op)\n\treply := r.(PutAppendReply)\n\t\n\tif(reply.Err != Err_Success) {\n\t\tfmt.Printf(\">> client, Failed to PutAppend [%v]=[%v] ,%v\\n\", \n\t\t\tkey, value, reply.Err)\n\t\t\n\t\treturn\n\t}\n\t\n\tfmt.Printf(\">> client, server PutAppend [%v] = %v\\n\", \n\t\tkey, value)\n\t\t\n\treturn\n}", "title": "" }, { "docid": "207a86f94b2fd6630db051db89546df1", "score": "0.4970948", "text": "func (tp *TsPacket) Append(buf []byte) {\n\ttp.buf = append(tp.buf, buf...)\n}", "title": "" }, { "docid": "d272e9d66b77ce44ade4641c427fed8a", "score": "0.49669144", "text": "func (bl *blist) Append(toadd *buffer) *buffer {\n\tres := bl.InsertAfter(bl.Last(), toadd)\n\treturn res\n}", "title": "" }, { "docid": "079f1d2bbcc549fff05a4e60eb55f226", "score": "0.49602887", "text": "func (w *wrapBuffer) candidateAppend(run Output) {\n\tw.alt = append(w.alt, run)\n\tw.altAdvance = w.altAdvance + run.Advance\n}", "title": "" }, { "docid": "75c5cce52836ae02342f91741d75355b", "score": "0.4958622", "text": "func (b *ArrayBasedBytesValues) Add(v []byte) error {\n\tif b.closed {\n\t\treturn errBytesValuesBuilderAlreadyClosed\n\t}\n\tif !b.initDone {\n\t\tb.min = v\n\t\tb.max = v\n\t\tb.initDone = true\n\t} else {\n\t\tif bytes.GreaterThan(b.min, v) {\n\t\t\tb.min = v\n\t\t} else if bytes.LessThan(b.max, v) {\n\t\t\tb.max = v\n\t\t}\n\t}\n\tb.vals.Append(v)\n\treturn nil\n}", "title": "" }, { "docid": "26b995eea30fd0217fbe9a4f1869672d", "score": "0.4955563", "text": "func (log *Log) Append(op *Change) error {\n\tenc := gob.NewEncoder(log.source)\n\tif err := enc.Encode(op); err != nil {\n\t\treturn err\n\t}\n\treturn nil\n}", "title": "" }, { "docid": "0a3e30b4539da779f9f54d45f2808e85", "score": "0.4954681", "text": "func (b *Bucket) Append(val float64) {\n\tb.Points = append(b.Points, val)\n\tb.Count++\n}", "title": "" }, { "docid": "f29edf2719f051dcd6011529cd3032ad", "score": "0.49514964", "text": "func (spec MutateInSpec) ArrayAppend(path string, bytes []byte, opts *MutateInSpecArrayAppendOptions) (*MutateInOp, error) {\n\tif opts == nil {\n\t\topts = &MutateInSpecArrayAppendOptions{}\n\t}\n\tvar flags SubdocFlag\n\tif opts.CreateParents {\n\t\tflags |= SubdocFlagCreatePath\n\t}\n\tif opts.IsXattr {\n\t\tflags |= SubdocFlagXattr\n\t}\n\n\top := gocbcore.SubDocOp{\n\t\tOp: gocbcore.SubDocOpArrayPushLast,\n\t\tPath: path,\n\t\tFlags: gocbcore.SubdocFlag(flags),\n\t\tValue: bytes,\n\t}\n\n\treturn &MutateInOp{op: op}, nil\n}", "title": "" }, { "docid": "03d0145470383f3a7dd0616fd8cd5b4f", "score": "0.4946611", "text": "func (bv *bitVector) append(bit uint8) {\n\tif bv.n%8 == 0 {\n\t\tbv.data = append(bv.data, 0)\n\t}\n\tbv.data[bv.n/8] |= bit << (bv.n % 8)\n\tbv.n++\n}", "title": "" }, { "docid": "e4a766749378ecaf5b96e54d214b1145", "score": "0.49450514", "text": "func (pw *PrometheusWrapper) Append(sample *model.Sample) error {\n\treturn nil\n}", "title": "" }, { "docid": "0cc2365745c3dd51c86d22b02ecca2b1", "score": "0.49391553", "text": "func (s *Session) Append(data []byte) (_ modules.RenterContract, _ crypto.Hash, err error) {\n\trc, err := s.Write([]modules.LoopWriteAction{{Type: modules.WriteActionAppend, Data: data}})\n\treturn rc, crypto.MerkleRoot(data), err\n}", "title": "" }, { "docid": "13b039e2480ee6d5486fd5d64caa9ebf", "score": "0.49383366", "text": "func (v *Vector) Append(elem interface{}) *Vector {\n\tif v.count-v.tailOffset() < uint64(vectorWidth) {\n\t\tlenTail := len(v.tail.values)\n\t\ttail := v.tail.cloneWithLen(lenTail + 1)\n\t\ttail.values[lenTail] = elem\n\t\treturn &Vector{v.count + 1, v.shift, v.root, tail, 0}\n\t}\n\n\tvar root *node\n\ttail := v.tail\n\tshift := v.shift\n\tif (v.count >> vectorBits) > (1 << v.shift) {\n\t\troot = &node{make([]interface{}, vectorWidth)}\n\t\troot.values[0] = v.root\n\t\troot.values[1] = newPath(tail)\n\t\tshift += uint(vectorBits)\n\t} else {\n\t\troot = v.pushTail(shift, v.root, tail)\n\t}\n\n\ttail = &node{[]interface{}{elem}}\n\treturn &Vector{v.count + 1, shift, root, tail, 0}\n}", "title": "" }, { "docid": "38921088580cd5d5b9868f3adae9dd3f", "score": "0.49358246", "text": "func (cl *CommandLog) Append(term uint32, payload []byte) (prev *LogEntry, curr *LogEntry) {\n\n\tn := len(cl.data)\n\n\tcl.lock.Lock()\n\tdefer cl.lock.Unlock()\n\n\tif n != 0 {\n\t\tprev = &cl.data[n-1]\n\t}\n\tnewLogEntry := LogEntry{term, cl.Index, payload}\n\n\tcl.data = append(cl.data, newLogEntry)\n\tcl.Index++\n\tcurr = &cl.data[len(cl.data)-1]\n\n\t// persist\n\tif cl.file != nil {\n\t\t// append entry to file\n\t\terr := cl.encoder.Encode(newLogEntry)\n\t\tif err != nil {\n\t\t\tlog.Fatalf(\"failed to persist log entry, %s\", err.Error())\n\t\t}\n\t\terr = cl.file.Sync()\n\t\tif err != nil {\n\t\t\tlog.Fatalf(\"failed flashing log file, %s\", err.Error())\n\t\t}\n\t}\n\n\treturn prev, curr\n}", "title": "" }, { "docid": "42b4019f8730b271a5172c15a382114e", "score": "0.49233603", "text": "func (u *BlobUploader) Append(ctx context.Context, r io.Reader) error {\n\tif u.reading {\n\t\treturn errWriteAfterRead\n\t}\n\n\toffset, err := u.file.Seek(0, io.SeekEnd)\n\tif err != nil {\n\t\treturn err\n\t}\n\tif offset != u.BytesReceived {\n\t\treturn errOffsetMissmatch\n\t}\n\n\tn, err := io.Copy(io.MultiWriter(u.file, u.MultiHasher), r)\n\tif err != nil {\n\t\treturn err\n\t}\n\n\t// fast path if nothing was written\n\tif n == 0 {\n\t\treturn nil\n\t}\n\n\tu.BytesReceived += n\n\n\tu.HashStateBytes, err = u.MultiHasher.MarshalBinary()\n\tif err != nil {\n\t\treturn err\n\t}\n\n\treturn packages_model.UpdateBlobUpload(ctx, u.PackageBlobUpload)\n}", "title": "" }, { "docid": "b8a807d7d62356ac7bd1672d5e1cf3a7", "score": "0.49222627", "text": "func Append(b []byte, x interface{}, flags AppendFlags) ([]byte, error) {\n\tif x == nil {\n\t\t// Special case for nil values because it makes the rest of the code\n\t\t// simpler to assume that it won't be seeing nil pointers.\n\t\treturn append(b, \"null\"...), nil\n\t}\n\n\tt := reflect.TypeOf(x)\n\tp := (*iface)(unsafe.Pointer(&x)).ptr\n\n\tcache := cacheLoad()\n\tc, found := cache[typeid(t)]\n\n\tif !found {\n\t\tc = constructCachedCodec(t, cache)\n\t}\n\n\tb, err := c.encode(encoder{flags: flags}, b, p)\n\truntime.KeepAlive(x)\n\treturn b, err\n}", "title": "" }, { "docid": "3152dc89d2f3156c4dec6d9238d94bdc", "score": "0.49202663", "text": "func Append(p *Pair, key, value interface{}) *Pair {\n\treturn p.Append(key, value)\n}", "title": "" }, { "docid": "41e98c11f2519d3a65ef28782352646d", "score": "0.49166614", "text": "func AppendMarshal(buf *bytes.Buffer, v any, indent int) error {\n\tm := marshaler{\n\t\tindent: indent,\n\t\tbuf: buf,\n\t}\n\treturn m.marshal(v)\n}", "title": "" }, { "docid": "d8f63c37a09c8707865491bc4dfcbc04", "score": "0.49114454", "text": "func (w *Window) Append(offset int, val float64) {\n\tw.buckets[offset%w.size].Append(val)\n}", "title": "" }, { "docid": "55c4aa16e4486c6fcafda4cbaac93a88", "score": "0.4905297", "text": "func (rb *Buffer) Add(entry string) {\n\tif rb.len == rb.size {\n\t\trb.readPointer++\n\t\tif rb.readPointer >= rb.size {\n\t\t\trb.readPointer %= rb.size\n\t\t}\n\t} else {\n\t\trb.len++\n\t}\n\n\trb.buf[rb.writePointer] = entry\n\trb.writePointer++\n\tif rb.writePointer >= rb.size {\n\t\trb.writePointer %= rb.size\n\t}\n}", "title": "" }, { "docid": "305e6e06762cc4a5f046f3c7d7769124", "score": "0.49006566", "text": "func (j *JSONArrayBuf) Append(v interface{}) error {\n\tb, err := json.Marshal(v)\n\tif err != nil {\n\t\treturn err\n\t}\n\n\tif j.buf.Len() == 0 {\n\t\tj.buf.WriteByte('[')\n\t} else {\n\t\tj.buf.WriteByte(',')\n\t}\n\n\t// err is always nil for a bytes.Buffer\n\t_, _ = j.buf.Write(b)\n\n\tif j.buf.Len() >= j.FlushSize {\n\t\treturn j.Flush()\n\t}\n\treturn nil\n}", "title": "" }, { "docid": "f1fffef71125ddacdc3eed6f5fda0d8c", "score": "0.49003556", "text": "func (s *MemoryStreams) InputAppendBoolAnswer(answer bool) {\n\tvar line string\n\tif answer {\n\t\tline = \"yes\"\n\t} else {\n\t\tline = \"no\"\n\t}\n\ts.InputAppendLine(line)\n}", "title": "" }, { "docid": "bd2f7cf2079c742a7ffd08bc92a3b0eb", "score": "0.4887978", "text": "func (r *ListOSResponse) UnsafeAppend(res interface{}) (uint32, error) {\n\tresults, ok := res.(*ListOSResponse)\n\tif !ok {\n\t\treturn 0, errors.New(\"%T type cannot be appended to type %T\", res, r)\n\t}\n\n\tr.Os = append(r.Os, results.Os...)\n\tr.TotalCount += uint32(len(results.Os))\n\treturn uint32(len(results.Os)), nil\n}", "title": "" }, { "docid": "3f50289a0e6a5c3634bb703ac2adf3c8", "score": "0.4885005", "text": "func (h *Handler) cmdAppendTo(c *parser.Cmd) *Status {\n\tvalue, err := h.prepareValue(c.Args[1], nil)\n\tif err != nil {\n\t\treturn convertError(err)\n\t}\n\tif err := h.ls.AppendTo(asString(c.Args[0]), value); err != nil {\n\t\treturn convertError(err)\n\t}\n\treturn &Status{\"APPEND\"}\n}", "title": "" }, { "docid": "0d4a350c50d1f9a917025d1a19354b53", "score": "0.48821238", "text": "func (list *List) append(val interface{}) {\n\n\tl := list.lastNode\n\tnewNode := initNode(l, val, nil)\n\tlist.lastNode = newNode\n\tif l == nil {\n\t\tlist.firstNode = newNode\n\t} else {\n\t\tl.next = newNode\n\t}\n\tlist.incrementSize(1)\n}", "title": "" }, { "docid": "7a3359fea791b2934e2bcf42a3e7958c", "score": "0.48707855", "text": "func (s *LogSource) AddInput(input string) {\n\ts.lock.Lock()\n\ts.inputs[input] = true\n\ts.lock.Unlock()\n}", "title": "" }, { "docid": "85ad9870ea7b6fe63abc761e68628de6", "score": "0.48682404", "text": "func (c *Client) Append(key, val string, ocas uint64) (cas uint64, err error) {\n\t// Variants: [R] Append [Q]\n\t// Request : MUST key, value; MUST NOT extras\n\t// Response: MUST NOT key, value, extras\n\tm := &msg{\n\t\theader: header{\n\t\t\tOp: opAppend,\n\t\t\tCAS: ocas,\n\t\t},\n\t\tkey: key,\n\t\tval: val,\n\t}\n\n\terr = c.perform(m)\n\treturn m.CAS, err\n}", "title": "" }, { "docid": "f34bd4a5161aa01303246d456fd517e5", "score": "0.4854541", "text": "func (m *Message) Append(text string) {\n\tm.msg += text\n}", "title": "" }, { "docid": "7d0c83f111ee71b1340a4b6ef70107d6", "score": "0.48494908", "text": "func (list *List) Append(values ...interface{}) {\n\tlist.Add(values...)\n}", "title": "" }, { "docid": "ab5100c92d505e6fd0be2ebaa4bf96f3", "score": "0.4845133", "text": "func (list *LinkedList) AppendValue(n int) {\n\tlist.Append(&Node{Data: n})\n}", "title": "" }, { "docid": "47225197ea56e6f8f9bfcf679c779f45", "score": "0.484278", "text": "func (c *Byte) Append(items ...byte) *Byte {\n\tc.items = append(c.items, items...)\n\treturn c\n}", "title": "" }, { "docid": "2b57e93ffe34e276422e15432f04add7", "score": "0.48411614", "text": "func (p *Pair) Append(key, val interface{}) *Pair {\n\treturn &Pair{\n\t\tprev: p,\n\t\tkey: key,\n\t\tvalue: val,\n\t}\n}", "title": "" }, { "docid": "c802de7472d540a26e728d836bf81e37", "score": "0.48403853", "text": "func (o *Mbuf) Append(d []byte) {\n\tlast := o.LastSeg()\n\toff := last.dataOff + last.dataLen\n\tn := last.bufLen - off\n\tvar size uint16\n\tsize = uint16(len(d))\n\tif size > n {\n\t\ts := fmt.Sprintf(\" append %d to mbuf remain size %d\", size, n)\n\t\tpanic(s)\n\t}\n\n\tcopy(last.data[off:], d)\n\to.pktLen += uint32(size)\n\tlast.dataLen += size\n}", "title": "" }, { "docid": "8e453a22545f4424d0593beaffeec1f9", "score": "0.48364764", "text": "func (l *ListData) Append(data ...Data) error {\n\tif err := l.valid(data...); err != nil {\n\t\treturn err\n\t}\n\tl.data = append(l.data, data...)\n\treturn nil\n}", "title": "" }, { "docid": "dfcb836c3b464d7cc1dca4cfa42bee6f", "score": "0.48350397", "text": "func (list *PlayList) Append(v int64) {\n\tlist.lock.Lock()\n\tlist.list = append(list.list, v)\n\tlist.lock.Unlock()\n}", "title": "" }, { "docid": "966e2c9b5e0a278bcfd77363cf5d5d69", "score": "0.48335484", "text": "func (ck *Clerk) PutAppend(key string, value string, op string) {\n\tck.mu.Lock()\n\tck.requestNo++\n\targs := PutAppendArgs{Key: key, Value: value, Op: op,\n\t\tClientId: ck.clientId, RequestNo: ck.requestNo}\n\tck.mu.Unlock()\n\t//fmt.Println(\"Clerk: \", ck.clientId, op, \": k:\", key, \" v:\", value)\n\treply := PutAppendReply{}\n\tfor {\n\t\t//fmt.Println(\"In: \", ck.clientId, op, \": k:\", key, \" v:\", value)\n\t\tok := ck.servers[ck.lastLeader].Call(\"RaftKV.PutAppend\", &args, &reply)\n\t\tif !ok {\n\t\t\tck.lastLeader = nrand() % int64(len(ck.servers))\n\t\t\tcontinue\n\t\t}\n\t\tif reply.Err == OK {\n\t\t\t//fmt.Println(\"DONE \", ck.clientId, op, \": k:\", key, \" v:\", value)\n\t\t\treturn\n\t\t}\n\t\tck.lastLeader = nrand() % int64(len(ck.servers))\n\t}\n}", "title": "" }, { "docid": "ee425b8362680f71ae6280ea152d707b", "score": "0.48334783", "text": "func (stream *Stream) Append(data []byte) error {\n\terr := stream.Buf.Append(data)\n\tif err != nil {\n\t\treturn err\n\t}\n\n\tif stream.MaxDataInStream > 0 && stream.Buf.Total() > stream.MaxDataInStream {\n\t\treturn ErrStreamTooLarge\n\t}\n\treturn nil\n}", "title": "" }, { "docid": "830033717f6c2f25f53e54b9f4f1279d", "score": "0.48298737", "text": "func AppendQuery(u url.URL, q url.Values) url.URL {\n\tuq := u.Query()\n\tfor k, vv := range q {\n\t\tfor _, v := range vv {\n\t\t\tuq.Add(k, v)\n\t\t}\n\t}\n\tu.RawQuery = uq.Encode()\n\treturn u\n}", "title": "" }, { "docid": "e744ff39dea9e8179896fcbc8d06a18d", "score": "0.48283577", "text": "func (buf *abstractAppendingLongBuffer) Add(l int64) {\n\tassert2(buf.pending != nil, \"This buffer is frozen\")\n\tif buf.pendingOff == len(buf.pending) {\n\t\t// check size\n\t\tif len(buf.values) == buf.valuesOff {\n\t\t\tnewLength := util.Oversize(buf.valuesOff+1, 8)\n\t\t\tbuf.spi.grow(newLength)\n\t\t}\n\t\tbuf.spi.packPendingValues()\n\t\tbuf.valuesBytes += buf.values[buf.valuesOff].RamBytesUsed()\n\t\tbuf.valuesOff++\n\t\t// reset pending buffer\n\t\tbuf.pendingOff = 0\n\t}\n\tbuf.pending[buf.pendingOff] = l\n\tbuf.pendingOff++\n}", "title": "" }, { "docid": "c0c8d021c8423f2a6175577732feb6c4", "score": "0.48235738", "text": "func (s *MutableString) AppendString(str string) { s.vec = append(s.vec, str...) }", "title": "" }, { "docid": "1b42a95f1043e446db168301a0b73e40", "score": "0.48153466", "text": "func (cb *CyclicBuffer) Append(d interface{}) int {\n\tcb.mutex.Lock()\n\tdefer cb.mutex.Unlock()\n\tvar index = cb.index\n\tcb.data[index] = d\n\tindex++\n\tif index >= cb.size {\n\t\tindex = 0\n\t\tcb.full = true\n\t}\n\tcb.index = index\n\treturn index\n}", "title": "" }, { "docid": "10859d1a94c94861fa14bbbe53d6af71", "score": "0.4815294", "text": "func (b *BufferFloat64) Add(value float64) {\n\tb.Cursor++\n\tif b.Cursor == len(b.Buf) {\n\t\tb.Cursor = 0\n\t\tif !b.Full {\n\t\t\tb.Full = true\n\t\t}\n\t}\n\tb.Buf[b.Cursor] = value\n}", "title": "" }, { "docid": "40a56dee042ae1e01534f0c105700f53", "score": "0.48045057", "text": "func (b *Batch) Append(item interface{}) {\n\tb.items <- item\n}", "title": "" } ]
0352fd3194e763f0b4654c0c82668d20
GetAddress returns the Address field value if set, zero value otherwise.
[ { "docid": "3e8f8d7342f353caedf012bb2370ab0d", "score": "0.6513119", "text": "func (o *LinkDeliveryCommunicationMethod) GetAddress() string {\n\tif o == nil || o.Address == nil {\n\t\tvar ret string\n\t\treturn ret\n\t}\n\treturn *o.Address\n}", "title": "" } ]
[ { "docid": "52643ae76dbaf0ae89321e6a9801f450", "score": "0.7623509", "text": "func GetAddress() string {\n\treturn *address\n}", "title": "" }, { "docid": "6715c22e5bbb49e430c8395da77c048d", "score": "0.73466724", "text": "func (o *Employer) GetAddress() AddressDataNullable {\n\tif o == nil || o.Address.Get() == nil {\n\t\tvar ret AddressDataNullable\n\t\treturn ret\n\t}\n\n\treturn *o.Address.Get()\n}", "title": "" }, { "docid": "84e699b04a65893c672d40895276c862", "score": "0.7232294", "text": "func (c *Config) GetAddress() string {\n\tif c == nil {\n\t\treturn DefaultConfig.Address\n\t}\n\treturn c.Address\n}", "title": "" }, { "docid": "e94159a35a1dc22832de495d9f004fbd", "score": "0.722386", "text": "func (w *Worker) GetAddress() string {\n\t// return zero value if Worker type or Address field is nil\n\tif w == nil || w.Address == nil {\n\t\treturn \"\"\n\t}\n\n\treturn *w.Address\n}", "title": "" }, { "docid": "f60888e4aa1fd0005439df29643680d2", "score": "0.7201531", "text": "func (o *Led) GetAddress() string {\n\tif o == nil || o.Address.Get() == nil {\n\t\tvar ret string\n\t\treturn ret\n\t}\n\treturn *o.Address.Get()\n}", "title": "" }, { "docid": "8b13a79d99acbe61e8151a910401459e", "score": "0.7140606", "text": "func (m *Settings_ConsulConfiguration) GetAddress() string {\n\tif m != nil {\n\t\treturn m.Address\n\t}\n\treturn \"\"\n}", "title": "" }, { "docid": "8b13a79d99acbe61e8151a910401459e", "score": "0.7140606", "text": "func (m *Settings_ConsulConfiguration) GetAddress() string {\n\tif m != nil {\n\t\treturn m.Address\n\t}\n\treturn \"\"\n}", "title": "" }, { "docid": "5b6fd8a9850b27bade0a149fd3936f90", "score": "0.70604277", "text": "func GetAddress() string {\n\tn := getLedger()\n\toneAddr, err := n.GetAddress()\n\tif err != nil {\n\t\tlog.Fatalln(\"Couldn't get one address:\", err)\n\t\tos.Exit(-1)\n\t}\n\n\treturn oneAddr\n}", "title": "" }, { "docid": "4ee5bec0799eb0b7af5c633700289de3", "score": "0.7042096", "text": "func (m *EducationSchool) GetAddress()(PhysicalAddressable) {\n val, err := m.GetBackingStore().Get(\"address\")\n if err != nil {\n panic(err)\n }\n if val != nil {\n return val.(PhysicalAddressable)\n }\n return nil\n}", "title": "" }, { "docid": "9a95751b4e3d2b5c30ebf25560d927bb", "score": "0.7037342", "text": "func (o *Employer) GetAddressOk() (*AddressDataNullable, bool) {\n\tif o == nil {\n\t\treturn nil, false\n\t}\n\treturn o.Address.Get(), o.Address.IsSet()\n}", "title": "" }, { "docid": "ca52e15c377101bedf9da2e0d3740c1c", "score": "0.70029753", "text": "func (o *MicrosoftGraphScoredEmailAddress) GetAddress() string {\n\tif o == nil || o.Address == nil {\n\t\tvar ret string\n\t\treturn ret\n\t}\n\treturn *o.Address\n}", "title": "" }, { "docid": "a206f6d711d54d125bcf069c16831f91", "score": "0.6981028", "text": "func (o *JsonNetworkInterface) GetAddress() string {\n\tif o == nil || o.Address == nil {\n\t\tvar ret string\n\t\treturn ret\n\t}\n\treturn *o.Address\n}", "title": "" }, { "docid": "960f2d9a69b142583e12c87ee97fa363", "score": "0.6976256", "text": "func (d *DecryptedMessageMediaVenue) GetAddress() (value string) {\n\tif d == nil {\n\t\treturn\n\t}\n\treturn d.Address\n}", "title": "" }, { "docid": "9ed1a9b36463a3496ceac8bc2fae7784", "score": "0.69647664", "text": "func (o *ConstitutionComponent) GetAddress() string {\n\tif o == nil || o.Address.Get() == nil {\n\t\tvar ret string\n\t\treturn ret\n\t}\n\treturn *o.Address.Get()\n}", "title": "" }, { "docid": "87b9fa7750067655feae56fc7d1e2b81", "score": "0.69609797", "text": "func (account *Account) GetAddress() crypto.Address {\n\treturn account.address\n}", "title": "" }, { "docid": "ab22ac3fde2f06f688c3b33c678daeb5", "score": "0.69522345", "text": "func (a *Address) GetAddress() []byte {\n\tif a.publicKey != nil && len(a.publicKey) == ed25519.PublicKeySize {\n\t\treturn []byte(a.publicKey)\n\t} else if a.privateKey != nil && len(a.privateKey) == ed25519.PrivateKeySize {\n\t\tif publicKey, ok := a.privateKey.Public().(ed25519.PublicKey); ok {\n\t\t\ta.publicKey = publicKey\n\t\t}\n\t\treturn []byte(a.publicKey)\n\t}\n\treturn nil\n}", "title": "" }, { "docid": "ba0800895f9ffc5ec4847c6c2f144573", "score": "0.6909521", "text": "func (o *NFSv3AccessControlEntry) GetAddress() string {\n\tif o == nil {\n\t\tvar ret string\n\t\treturn ret\n\t}\n\n\treturn o.Address\n}", "title": "" }, { "docid": "a9e4b3b13fa6d90c8e83b0218c71493f", "score": "0.68546325", "text": "func (h *HostAddress) GetAddress() (string, error) {\n\tvar b []byte\n\t_, err := asn1.Unmarshal(h.Address, &b)\n\treturn string(b), err\n}", "title": "" }, { "docid": "be5913b379b8cc3365e868dd814c3205", "score": "0.6846327", "text": "func (acc BaseAccount) GetAddress() sdk.AccAddress {\n\treturn acc.Address\n}", "title": "" }, { "docid": "170aa2b8d926136f86fe44272773f22b", "score": "0.68192655", "text": "func GetAddress(addr string) *model.Address {\n\tdefer util.TimeTrack(time.Now(), \"GetAddress\", \"mysqlprofile\")\n\taddrMatch := qm.Where(model.AddressColumns.Address+\"=?\", addr)\n\n\tif model.Addresses(addrMatch).ExistsGP() {\n\n\t\taddress, err := model.Addresses(addrMatch).OneG()\n\t\tif err != nil {\n\t\t\tlogrus.Error(\"Datastore(GETADDRESS): \", err)\n\t\t}\n\t\treturn address\n\t}\n\n\treturn nil\n}", "title": "" }, { "docid": "4c3c297c7671980657ebb2c4b0b115ab", "score": "0.68154234", "text": "func (o *MicrosoftGraphWindows10NetworkProxyServer) GetAddress() string {\n\tif o == nil || o.Address == nil {\n\t\tvar ret string\n\t\treturn ret\n\t}\n\treturn *o.Address\n}", "title": "" }, { "docid": "7c57a3ff9264cc0a4218b026569d4a7b", "score": "0.68076324", "text": "func (wallet *Wallet) GetAddress() []byte {\n\treturn GetAddressFromPublicKey(wallet.PublicKey)\n}", "title": "" }, { "docid": "474f18195b149e0800fbce30949d7f9d", "score": "0.679719", "text": "func (o *PaymentInitiationRecipientCreateRequest) GetAddress() PaymentInitiationAddress {\n\tif o == nil || o.Address.Get() == nil {\n\t\tvar ret PaymentInitiationAddress\n\t\treturn ret\n\t}\n\treturn *o.Address.Get()\n}", "title": "" }, { "docid": "1c9d7bbac780dd1ce1ce1eec892a8d18", "score": "0.678378", "text": "func (hi HostInfo) GetAddress() string {\n\treturn hi.addr\n}", "title": "" }, { "docid": "e411e1e4f0c743a376d13a6679bc175c", "score": "0.67585444", "text": "func GetAddress(node *v1.Node) (string, error) {\n\treturn GetAddressFromNodeList([]v1.Node{\n\t\t*node,\n\t})\n}", "title": "" }, { "docid": "0316e912e2ea166671f0a245eda13e43", "score": "0.6739709", "text": "func (o *CustomerFiscalEntitiesDataResponse) GetAddress() CustomerFiscalEntitiesRequestAddress {\n\tif o == nil {\n\t\tvar ret CustomerFiscalEntitiesRequestAddress\n\t\treturn ret\n\t}\n\n\treturn o.Address\n}", "title": "" }, { "docid": "9da7b270534d1f3b943249b6a9eb2dfd", "score": "0.6736395", "text": "func (o *Option) GetAddress() string {\n\treturn o.ip + \":\" + o.port\n}", "title": "" }, { "docid": "cf6718237a01f257b51132e92fb4caf7", "score": "0.66683877", "text": "func (p *PubKey) GetAddress() string {\n\treturn p.address\n}", "title": "" }, { "docid": "62a8650464466353b411ed944dab40ca", "score": "0.666552", "text": "func (o *MicrosoftGraphScoredEmailAddress) GetAddressOk() (string, bool) {\n\tif o == nil || o.Address == nil {\n\t\tvar ret string\n\t\treturn ret, false\n\t}\n\treturn *o.Address, true\n}", "title": "" }, { "docid": "bfb694e82302f3098b42e393586e8c8b", "score": "0.66299903", "text": "func GetAddress(address string) (addr Address, err error) {\n\tif len(address) == 0 {\n\t\treturn addr, errors.New(\"must use provide address\")\n\t}\n\tbz, err := hex.DecodeString(address)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\treturn Address(bz), nil\n}", "title": "" }, { "docid": "d90aaa73948af8c098f54266364c1131", "score": "0.66121954", "text": "func (s *Server) GetAddress() string {\n\treturn s.address\n}", "title": "" }, { "docid": "96f5c63af44c2b17c9aec6b66b4bf21f", "score": "0.65876275", "text": "func (c *CXO) GetAddress() string {\n\treturn c.node.Pool().Address()\n}", "title": "" }, { "docid": "241311d4a7d07b9b46beaaedf1fe3328", "score": "0.65491486", "text": "func (t *TrackerServer) GetAddress() net.Addr {\n\treturn t.addr\n}", "title": "" }, { "docid": "c011fb574879430f8dce6a5d69d45739", "score": "0.652324", "text": "func (s *SketchInfo) GetAddress() string {\n\treturn s.meta.GetAddress()\n}", "title": "" }, { "docid": "7ca2bd3447253804e30501d8c1730996", "score": "0.65231293", "text": "func (m *Windows10NetworkProxyServer) GetAddress()(*string) {\n val, err := m.GetBackingStore().Get(\"address\")\n if err != nil {\n panic(err)\n }\n if val != nil {\n return val.(*string)\n }\n return nil\n}", "title": "" }, { "docid": "df8a413674a3d7442f9cf282e91fc620", "score": "0.6522873", "text": "func (o *IpamAliasDataData) GetAddressAddr() string {\n\tif o == nil || o.AddressAddr == nil {\n\t\tvar ret string\n\t\treturn ret\n\t}\n\treturn *o.AddressAddr\n}", "title": "" }, { "docid": "2663d15be73aeba3dcf05a27d55d1c75", "score": "0.6514562", "text": "func (a *AddrManager) GetAddress() *KnownAddress {\n\t// Protect concurrent access.\n\ta.mtx.Lock()\n\tdefer a.mtx.Unlock()\n\n\tvar knownAddress *KnownAddress\n\tif a.localSubnetworkID == nil {\n\t\tknownAddress = a.getAddress(&a.addrTriedFullNodes, a.nTriedFullNodes,\n\t\t\t&a.addrNewFullNodes, a.nNewFullNodes)\n\t} else {\n\t\tsubnetworkID := *a.localSubnetworkID\n\t\tknownAddress = a.getAddress(a.addrTried[subnetworkID], a.nTried[subnetworkID],\n\t\t\ta.addrNew[subnetworkID], a.nNew[subnetworkID])\n\t}\n\n\treturn knownAddress\n\n}", "title": "" }, { "docid": "abc8fbd41c49663e1b7bbd911ad511f7", "score": "0.6507731", "text": "func (o *ConstitutionComponent) GetAddressOk() (*string, bool) {\n\tif o == nil {\n\t\treturn nil, false\n\t}\n\treturn o.Address.Get(), o.Address.IsSet()\n}", "title": "" }, { "docid": "9cc81dd7aff5d4587f6c42845e2aa2c3", "score": "0.6455947", "text": "func (o *Led) GetAddressOk() (*string, bool) {\n\tif o == nil {\n\t\treturn nil, false\n\t}\n\treturn o.Address.Get(), o.Address.IsSet()\n}", "title": "" }, { "docid": "20572a8b572576dcf0038f012237ddff", "score": "0.64372206", "text": "func (o *Credit1099Recipient) GetAddress() CreditPayStubAddress {\n\tif o == nil || o.Address == nil {\n\t\tvar ret CreditPayStubAddress\n\t\treturn ret\n\t}\n\treturn *o.Address\n}", "title": "" }, { "docid": "54dea8bc1fa71139899f2a4d8aa5b910", "score": "0.64159477", "text": "func (p *grpcConfig) GetAddress() string {\n\treturn p.IP + \":\" + p.Port.GetValue()\n}", "title": "" }, { "docid": "1d7a1e734862c2be9a0597ed05563ce4", "score": "0.6411293", "text": "func (p *grpcConfig) GetAddress() string {\n\treturn p.IP + \":\" + strconv.Itoa(p.Port)\n}", "title": "" }, { "docid": "f3efabe4270f197fc042b23895624d9b", "score": "0.6382634", "text": "func (ab *addressBook) GetAddress(id string) (Address, error) {\n\tab.Lock()\n\tdefer ab.Unlock()\n\n\tfor i := range ab.Addresses {\n\t\tif ab.Addresses[i].ID == id {\n\t\t\treturn ab.Addresses[i], nil\n\t\t}\n\t}\n\n\treturn Address{}, errors.New(\"Address not found\")\n}", "title": "" }, { "docid": "550e8ba711180354aec35dc3d15181f1", "score": "0.6375741", "text": "func (w Wallet) GetAddress() []byte {\n\tpubKeyHash := HashPubKey(w.PublicKey)\n\tversionPayload := append([]byte{WalletVersion}, pubKeyHash...)\n\tchecksum := checksum(versionPayload)\n\tfullPayload := append(versionPayload, checksum...)\n\taddress := util.Base58Encode(fullPayload)\n\treturn address\n}", "title": "" }, { "docid": "65f18010642ca2eeb92c86b480820e8b", "score": "0.63722515", "text": "func (r *AddressesService) Get(project string, region string, address string) *AddressesGetCall {\n\tc := &AddressesGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}\n\tc.project = project\n\tc.region = region\n\tc.address = address\n\treturn c\n}", "title": "" }, { "docid": "a14c7093880119289ea9c0509d6a20d2", "score": "0.6370832", "text": "func (o *CustomerFiscalEntitiesDataResponse) GetAddressOk() (*CustomerFiscalEntitiesRequestAddress, bool) {\n\tif o == nil {\n\t\treturn nil, false\n\t}\n\treturn &o.Address, true\n}", "title": "" }, { "docid": "70248a969bccf2f9520b8e61c3b2bb9c", "score": "0.6362581", "text": "func (t *Token) GetAddress() string {\n\treturn t.GetKeypair().Address()\n}", "title": "" }, { "docid": "2ae041de8162b88d58c61a050648e6a6", "score": "0.6338992", "text": "func (o *NFSv3AccessControlEntry) GetAddressOk() (*string, bool) {\n\tif o == nil {\n\t\treturn nil, false\n\t}\n\treturn &o.Address, true\n}", "title": "" }, { "docid": "0d072433daae8f1db70ce8443c38251b", "score": "0.6298126", "text": "func (o *IpamAliasDataData) GetAddressAddrOk() (*string, bool) {\n\tif o == nil || o.AddressAddr == nil {\n\t\treturn nil, false\n\t}\n\treturn o.AddressAddr, true\n}", "title": "" }, { "docid": "c12753b5aec61d1bf656c4033f433bef", "score": "0.62851", "text": "func (o *MicrosoftGraphWindows10NetworkProxyServer) GetAddressOk() (string, bool) {\n\tif o == nil || o.Address == nil {\n\t\tvar ret string\n\t\treturn ret, false\n\t}\n\treturn *o.Address, true\n}", "title": "" }, { "docid": "28a171d07690d7c8a53b49932d022d56", "score": "0.6281217", "text": "func GetAddress(lat float64, lon float64) (string, error) {\n\tgeocoder.SetAPIKey(\"X3XD20Z6CoOItFBqhZHp8Moxo1st3YAz\")\n\taddress, err := geocoder.ReverseGeocode(lat, lon)\n\tif err != nil || address == nil {\n\t\treturn \"\", err\n\t}\n\treturn address.Street + \" \" + address.City, nil\n}", "title": "" }, { "docid": "0fec4b507e2a6de8aa2d0715c634a170", "score": "0.6277047", "text": "func (m *Yggdrasil) GetAddressString() string {\n\tip := m.core.Address()\n\treturn ip.String()\n}", "title": "" }, { "docid": "ea708ca3f8ecc56aec36ab1367b68f9e", "score": "0.62716717", "text": "func (o *PaymentInitiationRecipientCreateRequest) GetAddressOk() (*PaymentInitiationAddress, bool) {\n\tif o == nil {\n\t\treturn nil, false\n\t}\n\treturn o.Address.Get(), o.Address.IsSet()\n}", "title": "" }, { "docid": "2bd4ca4c92eaaf8d791cb50464c223db", "score": "0.6265542", "text": "func (r *GlobalAddressesService) Get(project string, address string) *GlobalAddressesGetCall {\n\tc := &GlobalAddressesGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}\n\tc.project = project\n\tc.address = address\n\treturn c\n}", "title": "" }, { "docid": "f3fb280b212899ec535b9573c5e4769c", "score": "0.6228681", "text": "func (s ServiceInfo) GetAddress() string {\n\treturn fmt.Sprintf(\"http://%s:%d/metrics\", s.Host, s.Port)\n}", "title": "" }, { "docid": "1c370138a2f86659086024ef0f51c756", "score": "0.6223486", "text": "func (c *DestinationAddress) Address() Address {\n\treturn c.address\n}", "title": "" }, { "docid": "5819238814b51b2a217a1225449f418c", "score": "0.6222688", "text": "func Address(a string) Option { return Option(addr(a)) }", "title": "" }, { "docid": "76b75a87cf38391190cb0e38a177476c", "score": "0.6208566", "text": "func (o *ViewCompany) GetAddressOne() string {\n\tif o == nil || o.AddressOne == nil {\n\t\tvar ret string\n\t\treturn ret\n\t}\n\treturn *o.AddressOne\n}", "title": "" }, { "docid": "fc7befd9d47d68d81ae758274dca675f", "score": "0.6206602", "text": "func (o *Credit1099Recipient) GetAddressOk() (*CreditPayStubAddress, bool) {\n\tif o == nil || o.Address == nil {\n\t\treturn nil, false\n\t}\n\treturn o.Address, true\n}", "title": "" }, { "docid": "d7acb216b63828e3fcf64b3f091c6ae1", "score": "0.6206271", "text": "func (recv *InetSocketAddress) GetAddress() *InetAddress {\n\tretC := C.g_inet_socket_address_get_address((*C.GInetSocketAddress)(recv.native))\n\tretGo := InetAddressNewFromC(unsafe.Pointer(retC))\n\n\treturn retGo\n}", "title": "" }, { "docid": "9bd68ad6b05c91d57536bab92549bee7", "score": "0.61789703", "text": "func (o *JsonNetworkInterface) GetAddressOk() (*string, bool) {\n\tif o == nil || o.Address == nil {\n\t\treturn nil, false\n\t}\n\treturn o.Address, true\n}", "title": "" }, { "docid": "7d68151748d033296b4d7d718b1a4775", "score": "0.61469465", "text": "func (c *ContractProxy) GetContractAddress(ctx context.Context, txHash common.Hash) (common.Address, error) {\n\tpanic(\"implement me\")\n}", "title": "" }, { "docid": "34b3b406f943eff21b30c9c03af0d4c9", "score": "0.61379844", "text": "func GetAddress(address string, port uint32) *xds_core.Address {\n\treturn &xds_core.Address{\n\t\tAddress: &xds_core.Address_SocketAddress{\n\t\t\tSocketAddress: &xds_core.SocketAddress{\n\t\t\t\tProtocol: xds_core.SocketAddress_TCP,\n\t\t\t\tAddress: address,\n\t\t\t\tPortSpecifier: &xds_core.SocketAddress_PortValue{\n\t\t\t\t\tPortValue: port,\n\t\t\t\t},\n\t\t\t},\n\t\t},\n\t}\n}", "title": "" }, { "docid": "6ba3368d0e415dfc21001f8b29cce4a6", "score": "0.612239", "text": "func (m *contactMethodAllOf1) Address() *string {\n\treturn m.addressField\n}", "title": "" }, { "docid": "8e5e299b9696af4e68f110441b43581f", "score": "0.6099616", "text": "func (m *PostalAddressType) GetStreet()(*string) {\n val, err := m.GetBackingStore().Get(\"street\")\n if err != nil {\n panic(err)\n }\n if val != nil {\n return val.(*string)\n }\n return nil\n}", "title": "" }, { "docid": "41d28533a3f018b8cd065fe542b3ae05", "score": "0.60779583", "text": "func (m *PurchaseInvoice) GetPayToAddress()(PostalAddressTypeable) {\n val, err := m.GetBackingStore().Get(\"payToAddress\")\n if err != nil {\n panic(err)\n }\n if val != nil {\n return val.(PostalAddressTypeable)\n }\n return nil\n}", "title": "" }, { "docid": "a52daa99bcdd76adc0a30d361c847bc4", "score": "0.6057436", "text": "func (c *Client) RetrieveAddress(objectID string) (*models.Address, error) {\n\tif objectID == \"\" {\n\t\treturn nil, errors.New(\"Empty object ID\")\n\t}\n\n\toutput := &models.Address{}\n\terr := c.do(http.MethodGet, \"/addresses/\"+objectID, nil, output)\n\treturn output, err\n}", "title": "" }, { "docid": "f9c2c806f55d92f6e450af4d42cc64fb", "score": "0.60425884", "text": "func GetAddress(host string, port int) string {\n\treturn fmt.Sprintf(\"%s:%d\", host, port)\n}", "title": "" }, { "docid": "8c60b7b6e6c8275e45f9894870a989c1", "score": "0.60174274", "text": "func (_e *MockSALMonitorTag_Expecter) GetAddressString() *MockSALMonitorTag_GetAddressString_Call {\n\treturn &MockSALMonitorTag_GetAddressString_Call{Call: _e.mock.On(\"GetAddressString\")}\n}", "title": "" }, { "docid": "07207f0c3121e010b4319ec2cfd59255", "score": "0.60055053", "text": "func (c *UDPClient) GetAddr() (*net.UDPAddr, error) {\n\treturn net.ResolveUDPAddr(\"udp\", c.Addr)\n}", "title": "" }, { "docid": "235698c73a523107c83bb603e9129467", "score": "0.59958106", "text": "func (o *LinkDeliveryCommunicationMethod) GetAddressOk() (*string, bool) {\n\tif o == nil || o.Address == nil {\n\t\treturn nil, false\n\t}\n\treturn o.Address, true\n}", "title": "" }, { "docid": "2b3b181f84f19812a30e0eb4a84603da", "score": "0.5992616", "text": "func (result ContractFunctionResult) GetAddress(index uint64) []byte {\n\treturn result.ContractCallResult[(index*32)+12 : (index*32)+32]\n}", "title": "" }, { "docid": "47a91937b71e4f2e3ea5f86e0921b8f7", "score": "0.5987663", "text": "func (c Client) GetAddr() *net.UDPAddr {\n\treturn c.clientAddr\n}", "title": "" }, { "docid": "29ed43708bedc45973897386cf2c1219", "score": "0.5968518", "text": "func (x *fastReflection_NetAddress) Get(descriptor protoreflect.FieldDescriptor) protoreflect.Value {\n\tswitch descriptor.FullName() {\n\tcase \"tendermint.p2p.NetAddress.id\":\n\t\tvalue := x.Id\n\t\treturn protoreflect.ValueOfString(value)\n\tcase \"tendermint.p2p.NetAddress.ip\":\n\t\tvalue := x.Ip\n\t\treturn protoreflect.ValueOfString(value)\n\tcase \"tendermint.p2p.NetAddress.port\":\n\t\tvalue := x.Port\n\t\treturn protoreflect.ValueOfUint32(value)\n\tdefault:\n\t\tif descriptor.IsExtension() {\n\t\t\tpanic(fmt.Errorf(\"proto3 declared messages do not support extensions: tendermint.p2p.NetAddress\"))\n\t\t}\n\t\tpanic(fmt.Errorf(\"message tendermint.p2p.NetAddress does not contain field %s\", descriptor.FullName()))\n\t}\n}", "title": "" }, { "docid": "057b20f867fc1ae83d16deb8711bc17d", "score": "0.5962327", "text": "func (a *AddrManager) GetAddress(pid [33]byte) net.Addr {\n\t// Protect concurrent access.\n\ta.mtx.Lock()\n\tdefer a.mtx.Unlock()\n\n\treturn a.addrIndex[pid]\n}", "title": "" }, { "docid": "54ee2601e9ac1fbefccc9eb880dc95af", "score": "0.5934714", "text": "func (a *Adapter) Address(ctx context.Context) (string, error) {\n\tvalue, err := dbusutil.Property(ctx, a.obj, addressProp)\n\tif err != nil {\n\t\treturn \"\", err\n\t}\n\taddress, ok := value.(string)\n\tif !ok {\n\t\treturn \"\", errors.New(\"address property not a string\")\n\t}\n\treturn address, nil\n}", "title": "" }, { "docid": "d7eb4d0520b070c3e12883cb79b49d77", "score": "0.59322834", "text": "func getAddress(t *testing.T, baseUrl string, addressIdStr string) *data.Address {\n\turl := baseUrl + \"/address/\" + addressIdStr\n\tclient := &http.Client{}\n\treq, err := http.NewRequest(\"GET\", url, nil)\n\trequire.Nil(t, err)\n\tres, err := client.Do(req)\n\trequire.Nil(t, err)\n\trequire.True(t, res.StatusCode == 200)\n\tresult, err := ioutil.ReadAll(res.Body)\n\trequire.Nil(t, err)\n\taddress := new(data.Address)\n\terr = json.Unmarshal(result, &address)\n\trequire.Nil(t, err)\n\treturn address\n}", "title": "" }, { "docid": "dcc54c090fba7577d5e0dd8069360bb4", "score": "0.59152675", "text": "func (o *DeviceDeviceAddInput) GetDeviceAddressAddr() string {\n\tif o == nil || o.DeviceAddressAddr == nil {\n\t\tvar ret string\n\t\treturn ret\n\t}\n\treturn *o.DeviceAddressAddr\n}", "title": "" }, { "docid": "66ff604c20c3d68e122eb2f8fb33f904", "score": "0.59073293", "text": "func (c *Container) GetAddress(t *testing.T) string {\n\tif c.address != \"\" {\n\t\treturn c.address\n\t}\n\tcontainer := c.parentContainer\n\tif container == \"\" {\n\t\tcontainer = c.container\n\t}\n\tresult := icmd.RunCommand(dockerCli.path, \"port\", container, strconv.Itoa(c.privatePort)).Assert(t, icmd.Success)\n\tc.address = fmt.Sprintf(\"127.0.0.1:%v\", strings.Trim(strings.Split(result.Stdout(), \":\")[1], \" \\r\\n\"))\n\treturn c.address\n}", "title": "" }, { "docid": "2441b140811426039c79d1565189af9c", "score": "0.5876558", "text": "func (pv *FilePV) GetAddress() ethCmn.Address {\n\treturn pv.Key.Address\n}", "title": "" }, { "docid": "56f0b952a8ac8a5428ed12b5851fb67b", "score": "0.58492315", "text": "func (c *ConnReq) GetAddr() net.Addr {\n\tc.stateMtx.RLock()\n\taddr := c.Addr\n\tc.stateMtx.RUnlock()\n\treturn addr\n}", "title": "" }, { "docid": "027794e21fb172c5fdfad41029f6c6b6", "score": "0.5841715", "text": "func (self MsgNetworkConn) GetAddr() NetAddr {\n\treturn NetAddrFromC(C.msgnetwork_conn_get_addr(self.inner))\n}", "title": "" }, { "docid": "771c07e5cb3e3984b91f4a9f2fbd8b8c", "score": "0.5830656", "text": "func (o *RecoveryAddress) GetValue() string {\n\tif o == nil {\n\t\tvar ret string\n\t\treturn ret\n\t}\n\n\treturn o.Value\n}", "title": "" }, { "docid": "996d78fc85041f9194dcdeb6a7bcbf68", "score": "0.58298206", "text": "func (srv *Server) GetAddress(in *GetAddressRequest, stream Miner_GetAddressServer) error {\n\tfor addr := range ConnectedNodes {\n\t\tif err := stream.Send(&GetAddressResponse{Address: addr}); err != nil {\n\t\t\treturn err\n\t\t}\n\t}\n\treturn nil\n}", "title": "" }, { "docid": "f4e277dfb638475a9335134caaacc873", "score": "0.58218044", "text": "func (nl *NetListener) GetAddr() string {\n\treturn nl.address\n}", "title": "" }, { "docid": "ab914ed94018c3299eb99094bf4f1d39", "score": "0.58171874", "text": "func (o *BillingAddress1) GetStreet() string {\n\tif o == nil || o.Street == nil {\n\t\tvar ret string\n\t\treturn ret\n\t}\n\treturn *o.Street\n}", "title": "" }, { "docid": "6c843e56be3845fc9c89484efa86c345", "score": "0.57900345", "text": "func (c *CAS) GetAddr() string {\n\treturn c.Config[\"host\"] + \":\" + c.Config[\"port\"]\n}", "title": "" }, { "docid": "870256c374a2527de4d38f87f66d490d", "score": "0.5789253", "text": "func (ar AccountRef) Address() bgmcommon.Address { return (bgmcommon.Address)(ar) }", "title": "" }, { "docid": "514be2ff43267d64bbb1f68e80443b74", "score": "0.5784701", "text": "func (m *ValidatorInfo) GetAccountAddress() (x []byte) {\n\tif m == nil {\n\t\treturn x\n\t}\n\treturn m.AccountAddress\n}", "title": "" }, { "docid": "cf49352d35ecd7c45a21ffd178754af0", "score": "0.5776278", "text": "func GetTxAddress(txID uint64, addrID uint64) *model.TransactionAddress {\n\tdefer util.TimeTrack(time.Now(), \"GetTxAddress\", \"mysqlprofile\")\n\tif model.TransactionAddressExistsGP(txID, addrID) {\n\t\ttxAddress, err := model.FindTransactionAddressG(txID, addrID)\n\t\tif err != nil {\n\t\t\tlogrus.Error(\"Datastore(GETTXADDRESS): \", err)\n\t\t}\n\t\treturn txAddress\n\t}\n\treturn nil\n}", "title": "" }, { "docid": "0a61ba949b4a57ba7da21cdf48d5e7c6", "score": "0.57728404", "text": "func (o *Object) Address() string {\n\treturn o.address\n}", "title": "" }, { "docid": "0a61ba949b4a57ba7da21cdf48d5e7c6", "score": "0.57728404", "text": "func (o *Object) Address() string {\n\treturn o.address\n}", "title": "" }, { "docid": "66fc5707dee2a6ffd5b743002a36da79", "score": "0.57631147", "text": "func (m *PurchaseInvoice) GetBuyFromAddress()(PostalAddressTypeable) {\n val, err := m.GetBackingStore().Get(\"buyFromAddress\")\n if err != nil {\n panic(err)\n }\n if val != nil {\n return val.(PostalAddressTypeable)\n }\n return nil\n}", "title": "" }, { "docid": "a7f6fbfc3dba7aab431d39f793bd682b", "score": "0.57612556", "text": "func (o PhoneNumberOutput) Address() pulumi.StringOutput {\n\treturn o.ApplyT(func(v *PhoneNumber) pulumi.StringOutput { return v.Address }).(pulumi.StringOutput)\n}", "title": "" }, { "docid": "0f358a7d338cc326abd258482067ef19", "score": "0.5759228", "text": "func (_e *MockCALGetStatusTag_Expecter) GetAddressString() *MockCALGetStatusTag_GetAddressString_Call {\n\treturn &MockCALGetStatusTag_GetAddressString_Call{Call: _e.mock.On(\"GetAddressString\")}\n}", "title": "" }, { "docid": "7a42cdb77ea167c31ef581b2607692c9", "score": "0.57523984", "text": "func (o GetLoadBalancersResultOutput) Address() pulumi.StringPtrOutput {\n\treturn o.ApplyT(func(v GetLoadBalancersResult) *string { return v.Address }).(pulumi.StringPtrOutput)\n}", "title": "" }, { "docid": "6ff1fbd680b8b96a6defd756c19a8b3a", "score": "0.5744201", "text": "func (g *Gateway) Address() modules.NetAddress {\n\tcounter := g.mu.RLock()\n\tdefer g.mu.RUnlock(counter)\n\treturn g.myAddr\n}", "title": "" }, { "docid": "589e7e5579cdb71ff590fe06c5f5cc5d", "score": "0.5728441", "text": "func (p *dnsCrypt) Address() string { return p.addr.String() }", "title": "" }, { "docid": "4f094d33599982b192e1e9f8153f4b8d", "score": "0.57186246", "text": "func (cPtr *Contract) Address() bgmcommon.Address {\n\treturn cPtr.self.Address()\n}", "title": "" }, { "docid": "b19ba3328a4d4690eea70b9432295197", "score": "0.5709548", "text": "func (m *PurchaseInvoice) GetShipToAddress()(PostalAddressTypeable) {\n val, err := m.GetBackingStore().Get(\"shipToAddress\")\n if err != nil {\n panic(err)\n }\n if val != nil {\n return val.(PostalAddressTypeable)\n }\n return nil\n}", "title": "" } ]
3b4d2cafb4e4fdecaaf279fe53e725cf
JSONString read the json content from valid json string
[ { "docid": "97966bfa5cc874c83dd0b0da4de5454f", "score": "0.66166484", "text": "func (j *JSONQ) JSONString(json string) *JSONQ {\n\tj.raw = []byte(json)\n\treturn j.decode() // handle error\n}", "title": "" } ]
[ { "docid": "4807433f3b7a93b2a57faa9060674bf0", "score": "0.66655654", "text": "func (b Body) JSONString() string {\n\treturn string(*b.Content)\n}", "title": "" }, { "docid": "071571fe1e057192c3ef7ca3113ba286", "score": "0.6496722", "text": "func LoadJson(jsonString string, i interface{}) error {\n\treturn json.Unmarshal([]byte(jsonString), i)\n}", "title": "" }, { "docid": "2ba140b58b1dd3219077d49a8952ce23", "score": "0.6461507", "text": "func (k *Kazaam) TransformJSONString(data string) ([]byte, error) {\n\t// read in the arbitrary input data\n\td := make([]byte, len(data))\n\tcopy(d, []byte(data))\n\td, err := k.TransformInPlace(d)\n\tif err != nil {\n\t\treturn []byte{}, err\n\t}\n\treturn d, err\n}", "title": "" }, { "docid": "ec4970ab7e7880819e5e03dc944b7fe8", "score": "0.6448669", "text": "func IsJSON(testString string) bool {\n\tif testString == \"\" {\n\t\treturn false\n\t}\n\trunes := []rune(strings.TrimSpace(testString))\n\tif runes[0] == '{' && runes[len(runes)-1] == '}' {\n\t\treturn true\n\t}\n\treturn false\n}", "title": "" }, { "docid": "981738546899b48ea0b1834404fc9849", "score": "0.64044374", "text": "func (cj *JSONGo) LoadString(src string) {\n\tjson.Unmarshal([]byte(src), &cj.raw)\n}", "title": "" }, { "docid": "252380786cedcbf5f1b7ceaa67e004fb", "score": "0.6329092", "text": "func NewJsonFromStr(jsonStr string) (*Json) {\n\ta, err := NewJson([]byte(jsonStr))\n\tif err!=nil{\n\t\tlog.Println(`NewJsonFromStr`,err,jsonStr)\n\t}\n\treturn a\n}", "title": "" }, { "docid": "8b034eb7cb7f9ef711f73dc98d2e5707", "score": "0.6321935", "text": "func IsJSONString(b []byte) bool {\n\tb = trim(b)\n\tif len(b) == 0 {\n\t\treturn false\n\t}\n\n\tif len(b) == 2 && b[0] == '\"' && b[1] == '\"' {\n\t\treturn true\n\t}\n\n\t// No quotes after trim\n\tif b[0] != '\"' || b[len(b)-1] != '\"' {\n\t\treturn false\n\t}\n\n\tif len(b) <= 1 {\n\t\treturn isStringCharacters(b)\n\t}\n\n\treturn isStringCharacters(b[1 : len(b)-1])\n}", "title": "" }, { "docid": "4718ba55458dc588fcdf436713523416", "score": "0.63003427", "text": "func ParseStringToJson(jsonString string) (string, error) {\n\n\tjsonParsed, err := gabs.ParseJSON([]byte(jsonString))\n\n\tif err != nil {\n\t\tboot.Log.Error(\" Erro ao fazer parse response json : \", err)\n\t\treturn \"\", err\n\t}\n\treturn jsonParsed.String(), nil\n}", "title": "" }, { "docid": "790bf2919144892007904fe3d0806712", "score": "0.62762624", "text": "func (r *RayEntry) JSONString(jsonString string) *RayEntry {\n\tpayload := payloads.NewJSONString(jsonString)\n\n\treturn r.sendRequest(payload)\n}", "title": "" }, { "docid": "9df4892dfecd872828135d0ea6c3d227", "score": "0.625951", "text": "func isJSON(s string) bool {\n\tvar js json.RawMessage\n\treturn json.Unmarshal([]byte(s), &js) == nil\n}", "title": "" }, { "docid": "8839c5fe103bb8eb8119ef7f3211786c", "score": "0.62285477", "text": "func (r *ExpandCfwVerticalResponse) FromJsonString(s string) error {\n\treturn json.Unmarshal([]byte(s), &r)\n}", "title": "" }, { "docid": "0331e25f419aa1763464e660685f16f5", "score": "0.62262547", "text": "func (p *Person) ReadFrom(strJson string) {\n\tstrReader := strings.NewReader(strJson)\n\tjson.NewDecoder(strReader).Decode(p)\n}", "title": "" }, { "docid": "0dcf00bffedf0614da3c257a846d2238", "score": "0.6185318", "text": "func (r *DeleteLiveWatermarkResponse) FromJsonString(s string) error {\n\treturn json.Unmarshal([]byte(s), &r)\n}", "title": "" }, { "docid": "ee6016b72c028f259c2ab52541eded3d", "score": "0.6170676", "text": "func (j jsonString) String() string {\n\tbytes, _ := json.Marshal(j)\n\treturn strings.TrimSpace(hack.String(bytes))\n}", "title": "" }, { "docid": "72fdf30162d0f5e2175bcdd183dbacae", "score": "0.6163843", "text": "func ParseString(data string) JSON {\n\treturn Parse([]byte(data))\n}", "title": "" }, { "docid": "a40188acb42738df371d42ba7b134bd1", "score": "0.6137745", "text": "func (r *ModifyRuleResponse) FromJsonString(s string) error {\n\treturn json.Unmarshal([]byte(s), &r)\n}", "title": "" }, { "docid": "1b2d17fd15b3f739984dd31f60153d89", "score": "0.61241525", "text": "func (r *AddLiveWatermarkResponse) FromJsonString(s string) error {\n\treturn json.Unmarshal([]byte(s), &r)\n}", "title": "" }, { "docid": "05b98dbf1f95833b406b74312551b8ab", "score": "0.61154675", "text": "func ParseJSON(jsonStr []byte) (JSONObject, error) {\n\tdata := make(JSONObject)\n\terr := json.Unmarshal(jsonStr, &data)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\treturn data, nil\n}", "title": "" }, { "docid": "2b9b28fb237c1e3d3cdb3f267cae19a5", "score": "0.6114414", "text": "func (d *Data) JSONString() (jsonStr string, err error) {\n\tm, err := json.Marshal(d)\n\tif err != nil {\n\t\treturn \"\", err\n\t}\n\treturn string(m), nil\n}", "title": "" }, { "docid": "2b9b28fb237c1e3d3cdb3f267cae19a5", "score": "0.6114414", "text": "func (d *Data) JSONString() (jsonStr string, err error) {\n\tm, err := json.Marshal(d)\n\tif err != nil {\n\t\treturn \"\", err\n\t}\n\treturn string(m), nil\n}", "title": "" }, { "docid": "5f450471e0992da7bd9508d1d668c9df", "score": "0.6111741", "text": "func (r *ModifyBlockTopResponse) FromJsonString(s string) error {\n\treturn json.Unmarshal([]byte(s), &r)\n}", "title": "" }, { "docid": "40bb3f59f3b370a7eaee639f318617c0", "score": "0.60972995", "text": "func WriteJsonString(buf, s []byte) []byte {\n\tconst hex = \"0123456789abcdef\"\n\tbuf = append(buf, '\"')\n\tstart := 0\n\tfor i := 0; i < len(s); {\n\t\tif b := s[i]; b < utf8.RuneSelf {\n\t\t\tif 0x20 <= b && b != '\\\\' && b != '\"' && b != '<' && b != '>' && b != '&' {\n\t\t\t\ti++\n\t\t\t\tcontinue\n\t\t\t}\n\t\t\tif start < i {\n\t\t\t\tbuf = append(buf, s[start:i]...)\n\t\t\t}\n\t\t\tswitch b {\n\t\t\tcase '\\\\', '\"':\n\t\t\t\tbuf = append(buf, '\\\\', b)\n\t\t\tcase '\\n':\n\t\t\t\tbuf = append(buf, '\\\\', 'n')\n\t\t\tcase '\\r':\n\t\t\t\tbuf = append(buf, '\\\\', 'r')\n\t\t\tdefault:\n\t\t\t\t// This encodes bytes < 0x20 except for \\n and \\r,\n\t\t\t\t// as well as < and >. The latter are escaped because they\n\t\t\t\t// can lead to security holes when user-controlled strings\n\t\t\t\t// are rendered into JSON and served to some browsers.\n\t\t\t\tbuf = append(buf, []byte(`\\u00`)...)\n\t\t\t\tbuf = append(buf, hex[b>>4], hex[b&0xF])\n\t\t\t}\n\t\t\ti++\n\t\t\tstart = i\n\t\t\tcontinue\n\t\t}\n\n\t\tc, size := utf8.DecodeRune(s[i:])\n\t\tif c == utf8.RuneError && size == 1 {\n\t\t\tif start < i {\n\t\t\t\tbuf = append(buf, s[start:i]...)\n\t\t\t}\n\t\t\tbuf = append(buf, []byte(`\\ufffd`)...)\n\t\t\ti += size\n\t\t\tstart = i\n\t\t\tcontinue\n\t\t}\n\t\t// U+2028 is LINE SEPARATOR.\n\t\t// U+2029 is PARAGRAPH SEPARATOR.\n\t\t// They are both technically valid characters in JSON strings,\n\t\t// but don't work in JSONP, which has to be evaluated as JavaScript,\n\t\t// and can lead to security holes there. It is valid JSON to\n\t\t// escape them, so we do so unconditionally.\n\t\t// See http://timelessrepo.com/json-isnt-a-javascript-subset for discussion.\n\t\tif c == '\\u2028' || c == '\\u2029' {\n\t\t\tif start < i {\n\t\t\t\tbuf = append(buf, s[start:i]...)\n\t\t\t}\n\t\t\tbuf = append(buf, []byte(`\\u202`)...)\n\t\t\tbuf = append(buf, hex[c&0xF])\n\t\t\ti += size\n\t\t\tstart = i\n\t\t\tcontinue\n\t\t}\n\t\ti += size\n\t}\n\tif start < len(s) {\n\t\tbuf = append(buf, s[start:]...)\n\t}\n\treturn append(buf, '\"')\n}", "title": "" }, { "docid": "9395b39add7461fb54cd681f15610484", "score": "0.6097082", "text": "func IsJSON(s string) bool {\n\tvar js json.RawMessage\n\treturn json.Unmarshal([]byte(s), &js) == nil\n}", "title": "" }, { "docid": "fa15f9092795edea156b907db897622b", "score": "0.60889643", "text": "func JSONToString(b []byte) (s string, err error) {\n\terr = json.Unmarshal(b, &s)\n\treturn\n}", "title": "" }, { "docid": "6844475825b33aa788489e0c25c2fa41", "score": "0.60617983", "text": "func ParseJSON(jsonTsum string) error {\n\tvar d interface{}\n\treadJSON := strings.NewReader(jsonTsum)\n\tdecode := json.NewDecoder(readJSON)\n\tfor {\n\t\ttok, errTok := decode.Token()\n\t\tif errTok != nil && errTok != io.EOF {\n\t\t\treturn fmt.Errorf(\"Error func ParseJSON method Token:__ %s\", errTok)\n\t\t} else if errTok == io.EOF {\n\t\t\tbreak\n\t\t}\n\t\tswitch tok := tok.(type) {\n\t\tcase string:\n\t\t\tif strings.Contains(tok, jsonURLSelection) || strings.Contains(tok, jsonURLSection) {\n\t\t\t\terr := decode.Decode(&d)\n\t\t\t\tif err != nil {\n\t\t\t\t\treturn fmt.Errorf(\"Error func ParseJSON method Decode:__ %s\", errTok)\n\t\t\t\t}\n\t\t\t\tswitch d := d.(map[string]interface{})[\"body\"].(type) {\n\t\t\t\tcase []interface{}:\n\t\t\t\t\tfor _, val := range d {\n\t\t\t\t\t\tswitch d := val.(map[string]interface{})[\"photos\"].(type) {\n\t\t\t\t\t\tcase []interface{}:\n\t\t\t\t\t\t\tfor key, val := range d {\n\t\t\t\t\t\t\t\tif key == 0 {\n\t\t\t\t\t\t\t\t\tjsonSRC = append(jsonSRC, val.(map[string]interface{})[\"small\"].(string))\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\t//fmt.Printf(\"%T\\n\", d.(map[string]interface{})[\"body\"])\n\t/*\n\t\tswitch reflect.TypeOf(d.(map[string]interface{})[\"body\"]).Kind() {\n\t\tcase reflect.Slice:\n\t\t\ts := reflect.ValueOf(d.(map[string]interface{})[\"body\"])\n\n\t\t\tfor i := 0; i < s.Len(); i++ {\n\t\t\t\tfmt.Printf(\"%v\\n\", s.Index(i).Interface().(map[string]interface{})[\"photos\"])\n\t\t\t}\n\t\t}\n\t*/\n\treturn nil\n}", "title": "" }, { "docid": "08d5b72324a314dd0847908136657583", "score": "0.60498583", "text": "func (r *DeleteLiveWatermarkRuleResponse) FromJsonString(s string) error {\n\treturn json.Unmarshal([]byte(s), &r)\n}", "title": "" }, { "docid": "4cabfbbb44b9732fb0a4cf1c3df8a7bb", "score": "0.6044667", "text": "func (r *UpdateLiveWatermarkResponse) FromJsonString(s string) error {\n\treturn json.Unmarshal([]byte(s), &r)\n}", "title": "" }, { "docid": "67ab1806028e586ce1e39474b68d4dfd", "score": "0.60412335", "text": "func (r *PrepareFlowsResponse) FromJsonString(s string) error {\n\treturn json.Unmarshal([]byte(s), &r)\n}", "title": "" }, { "docid": "92ca97a5c4f06d4232bb0abdf73d087f", "score": "0.6025937", "text": "func (r *ForbidLiveStreamResponse) FromJsonString(s string) error {\n\treturn json.Unmarshal([]byte(s), &r)\n}", "title": "" }, { "docid": "bddc395d36184672ace3dee7be009497", "score": "0.60220003", "text": "func (j *Json) String() (string, error) {\n\tif s, ok := (j.data).(string); ok {\n\t\treturn s, nil\n\t}\n\treturn \"\", errors.New(\"type assertion to string failed\")\n}", "title": "" }, { "docid": "1c2c2e2c25c787748c2d187ffe6f74f7", "score": "0.60022", "text": "func (r *DropLiveStreamResponse) FromJsonString(s string) error {\n\treturn json.Unmarshal([]byte(s), &r)\n}", "title": "" }, { "docid": "b8431322c39c36c212772df1105d666a", "score": "0.5990138", "text": "func ReadJSON(c *Conn, opitions *ReadOoptions, v interface{}) error {}", "title": "" }, { "docid": "84fdcaa71fbfd1dc6d202a7051a7ee9b", "score": "0.59898466", "text": "func (r *ModifySequenceRulesResponse) FromJsonString(s string) error {\n\treturn json.Unmarshal([]byte(s), &r)\n}", "title": "" }, { "docid": "b6271b598d50b0511f737dc556386e82", "score": "0.598697", "text": "func (r *GetMonitorDataResponse) FromJsonString(s string) error {\n\treturn json.Unmarshal([]byte(s), &r)\n}", "title": "" }, { "docid": "1c974ba4bc218993acbfdbdac47f6caa", "score": "0.597104", "text": "func (r *CreateCommonMixStreamResponse) FromJsonString(s string) error {\n\treturn json.Unmarshal([]byte(s), &r)\n}", "title": "" }, { "docid": "4b6a27682dcd7a641f46def037aee860", "score": "0.5966015", "text": "func (r *ModifyLiveCallbackTemplateResponse) FromJsonString(s string) error {\n\treturn json.Unmarshal([]byte(s), &r)\n}", "title": "" }, { "docid": "bc0ef2f1b9a7eacbe5539fb8c82c2c6e", "score": "0.59628105", "text": "func (r *DownloadL4LogsResponse) FromJsonString(s string) error {\n\treturn json.Unmarshal([]byte(s), &r)\n}", "title": "" }, { "docid": "626dacf18a0ba1ff1eb9b69a6afe828f", "score": "0.59571594", "text": "func (r *CreateLiveWatermarkRuleResponse) FromJsonString(s string) error {\n\treturn json.Unmarshal([]byte(s), &r)\n}", "title": "" }, { "docid": "2350a134fcf264c9dae8aeb87ecc3301", "score": "0.5952126", "text": "func (r *RemoveAcRuleResponse) FromJsonString(s string) error {\n\treturn json.Unmarshal([]byte(s), &r)\n}", "title": "" }, { "docid": "5deea7154e4674d18f0815861a5cb43f", "score": "0.5945003", "text": "func (r *ModifyRunSyncAssetResponse) FromJsonString(s string) error {\n\treturn json.Unmarshal([]byte(s), &r)\n}", "title": "" }, { "docid": "9773ce96b2051c2258fcb57b8ae2eb20", "score": "0.59400564", "text": "func isValidJSON(obj string) interface{} {\n\tvar out interface{}\n\terr := json.Unmarshal([]byte(obj), &out)\n\tif err != nil {\n\t\tlog.Debug(\"invalid JSON: %s\", err)\n\t\treturn nil\n\t}\n\treturn out\n}", "title": "" }, { "docid": "93131c8a2e0c000b783ac8a7bbb3eef3", "score": "0.5934783", "text": "func (r *EnableGrafanaInternetResponse) FromJsonString(s string) error {\n\treturn json.Unmarshal([]byte(s), &r)\n}", "title": "" }, { "docid": "fec55fcd7236bdb84194d3cc839e97cc", "score": "0.59299517", "text": "func parseJSON(s string) (value interface{}, err error) {\n\tvar autoquote bool\n\tif s == \"null\" ||\n\t\t(s[0] == '\"' && s[len(s)-1] == '\"') ||\n\t\t(s[0] == '[' && s[len(s)-1] == ']') ||\n\t\t(s[0] == '{' && s[len(s)-1] == '}') {\n\t\tautoquote = false\n\t} else if _, err := strconv.ParseFloat(s, 64); err == nil {\n\t\tautoquote = false\n\t} else {\n\t\tautoquote = true\n\t}\n\tif autoquote {\n\t\ts = fmt.Sprintf(\"\\\"%s\\\"\", s)\n\t}\n\n\t// we have to json-unmarshal the value in order to ensure that\n\t// we set the right datatype\n\terr = json.Unmarshal([]byte(s), &value)\n\tif err != nil {\n\t\terr = errors.Wrap(err, \"interpreting value as JSON\")\n\t}\n\treturn\n}", "title": "" }, { "docid": "b586471488941a37c899895c3dd0ad34", "score": "0.59276676", "text": "func ReadConfigFromJsonString(config *viper.Viper, json string) error {\n\tconfig.SetConfigType(\"json\")\n\treturn config.ReadConfig(strings.NewReader(json))\n}", "title": "" }, { "docid": "2019f1d1e9db92c4201a9f773972e41c", "score": "0.5925279", "text": "func (r *ModifyLivePullStreamTaskResponse) FromJsonString(s string) error {\n\treturn json.Unmarshal([]byte(s), &r)\n}", "title": "" }, { "docid": "15d30b64e3da3a8c65961c6c3f18ef84", "score": "0.59232366", "text": "func JsonString(source interface{}) string {\n\t//jsonString, err := json.Marshal(source)\n\tbytes, err := json.MarshalIndent(source, \"\", \" \")\n\tif err != nil {\n\t\treturn err.Error()\n\t}\n\treturn string(bytes)\n}", "title": "" }, { "docid": "639efb7384fc21ebbf2a7d516d82c301", "score": "0.5921447", "text": "func LoadJSON(c context.Context, s string, o *Options) error {\n\treturn Load(c, strings.NewReader(s), o)\n}", "title": "" }, { "docid": "599f5d0b8b830eec24620e9f64ae7df3", "score": "0.5917807", "text": "func (r *ModifyAcRuleResponse) FromJsonString(s string) error {\n\treturn json.Unmarshal([]byte(s), &r)\n}", "title": "" }, { "docid": "8a946c7a927a1229b8ed0f32adeac684", "score": "0.59177774", "text": "func isJSON(s []byte) bool {\n\tvar js map[string]interface{}\n\treturn json.Unmarshal(s, &js) == nil\n}", "title": "" }, { "docid": "5eb77483d1ec0417717b335443bba005", "score": "0.5914804", "text": "func (j JSONText) String() string {\n\treturn string(j)\n}", "title": "" }, { "docid": "10061be2512ea4d71cf309965ed32f67", "score": "0.59129524", "text": "func (r *ModifyPrometheusTempResponse) FromJsonString(s string) error {\n\treturn json.Unmarshal([]byte(s), &r)\n}", "title": "" }, { "docid": "179d002c75d8a2212de6b878cb1de32b", "score": "0.5906956", "text": "func (j JSON) String() string {\n\treturn string(j)\n}", "title": "" }, { "docid": "42a530cd83c513ed2cc10b1ad1bb4ff8", "score": "0.590203", "text": "func IsJSON(s string) bool {\n\tvar js map[string]interface{}\n\treturn json.Unmarshal([]byte(s), &js) == nil\n}", "title": "" }, { "docid": "9ee9c223f3cd9301c73aa0971dda57b4", "score": "0.58988756", "text": "func (r *DescribeOriginProtectionResponse) FromJsonString(s string) error {\n\treturn json.Unmarshal([]byte(s), &r)\n}", "title": "" }, { "docid": "2d738f80273539539a7eb1194b1e1e73", "score": "0.5888133", "text": "func (r *ResumeLiveStreamResponse) FromJsonString(s string) error {\n\treturn json.Unmarshal([]byte(s), &r)\n}", "title": "" }, { "docid": "6db16d6b3b612376375595ea8c27f310", "score": "0.58847976", "text": "func JsonReadRulesFromString(jsonString string) (error_ret bool, rules Rules) {\n\n\terror_ret = false\n\terr := json.Unmarshal([]byte(jsonString), &rules)\n\tif err != nil {\n\t\tlog.Printf(\"Error parsing rules JSON: %v\", err)\n\t\terror_ret = true\n\t}\n\n\tConvertFieldsToRegexManyRules(&rules)\n\t//testFieldsForIP(&rules)\n\tConvertConditionStringToIntFloatRegexManyRules(&rules)\n\n\treturn error_ret, rules\n}", "title": "" }, { "docid": "fc50244751c6e742fd06085381c7f6a7", "score": "0.58813167", "text": "func (r *CreateLiveCallbackTemplateResponse) FromJsonString(s string) error {\n\treturn json.Unmarshal([]byte(s), &r)\n}", "title": "" }, { "docid": "3920ffc472588c10f53ed1dc739aa376", "score": "0.5879142", "text": "func (r *ResumeDelayLiveStreamResponse) FromJsonString(s string) error {\n\treturn json.Unmarshal([]byte(s), &r)\n}", "title": "" }, { "docid": "048e459056446e360d92f09c5155e715", "score": "0.58773166", "text": "func (r *SyncPrometheusTempResponse) FromJsonString(s string) error {\n\treturn json.Unmarshal([]byte(s), &r)\n}", "title": "" }, { "docid": "008d594042b99e75bdb833c9f2536349", "score": "0.58740705", "text": "func (r *UnBindLiveDomainCertResponse) FromJsonString(s string) error {\n\treturn json.Unmarshal([]byte(s), &r)\n}", "title": "" }, { "docid": "9dedb9c1fe8ea69d8235ffa6c8f8cd98", "score": "0.58732224", "text": "func (r *CreateScreenshotTaskResponse) FromJsonString(s string) error {\n\treturn json.Unmarshal([]byte(s), &r)\n}", "title": "" }, { "docid": "c52bc03f737cd5b4087a80e843ce82d5", "score": "0.58698815", "text": "func (r *ModifyAssetScanResponse) FromJsonString(s string) error {\n\treturn json.Unmarshal([]byte(s), &r)\n}", "title": "" }, { "docid": "b5c777ad2dd98db1ae2a550961fafda5", "score": "0.5867169", "text": "func (r *ModifyLiveSnapshotTemplateResponse) FromJsonString(s string) error {\n\treturn json.Unmarshal([]byte(s), &r)\n}", "title": "" }, { "docid": "775d5db07634f934bfc51722b8bb3dac", "score": "0.58643687", "text": "func (r *CancelCommonMixStreamResponse) FromJsonString(s string) error {\n\treturn json.Unmarshal([]byte(s), &r)\n}", "title": "" }, { "docid": "a13d4465fb17a0cce2d28ef257a005eb", "score": "0.5858084", "text": "func (r *DescribeLiveWatermarkResponse) FromJsonString(s string) error {\n\treturn json.Unmarshal([]byte(s), &r)\n}", "title": "" }, { "docid": "a0fb33f2dec3b856d8129426e9e8525a", "score": "0.58547145", "text": "func ValidJSON(str string) bool {\n\tvar js json.RawMessage\n\treturn json.Unmarshal([]byte(str), &js) == nil\n}", "title": "" }, { "docid": "211f4255d645cc18e6b4d155ae426048", "score": "0.5853038", "text": "func (r *ImageModerationResponse) FromJsonString(s string) error {\n\treturn json.Unmarshal([]byte(s), &r)\n}", "title": "" }, { "docid": "663079c652ea74c20502b2fecb4430f7", "score": "0.5847936", "text": "func (r *AddDelayLiveStreamResponse) FromJsonString(s string) error {\n\treturn json.Unmarshal([]byte(s), &r)\n}", "title": "" }, { "docid": "5d4a7e018781d8faae44951093f75432", "score": "0.58473086", "text": "func (r *ModifyLiveTranscodeTemplateResponse) FromJsonString(s string) error {\n\treturn json.Unmarshal([]byte(s), &r)\n}", "title": "" }, { "docid": "7b5ef4d208fd9adbb757f4aa77c4e626", "score": "0.58438027", "text": "func (r *DeleteRulesResponse) FromJsonString(s string) error {\n\treturn json.Unmarshal([]byte(s), &r)\n}", "title": "" }, { "docid": "64b6d5fd6ee54b75469fce70e47a8c49", "score": "0.5839824", "text": "func (r *DeletePrometheusTempResponse) FromJsonString(s string) error {\n\treturn json.Unmarshal([]byte(s), &r)\n}", "title": "" }, { "docid": "e95733c3622d5ef750680199b9ff5818", "score": "0.5838612", "text": "func (r *DeleteLiveCallbackTemplateResponse) FromJsonString(s string) error {\n\treturn json.Unmarshal([]byte(s), &r)\n}", "title": "" }, { "docid": "d774feaa92eb2696f37fbbbf027337bd", "score": "0.5837824", "text": "func (r *ModifyLiveRecordTemplateResponse) FromJsonString(s string) error {\n\treturn json.Unmarshal([]byte(s), &r)\n}", "title": "" }, { "docid": "ca4d42b010bab5672cf83238570c4d4c", "score": "0.5836524", "text": "func (r *CreateRuleResponse) FromJsonString(s string) error {\n\treturn json.Unmarshal([]byte(s), &r)\n}", "title": "" }, { "docid": "d2e1f92602982628de61f2eb8d3e9be3", "score": "0.5831252", "text": "func (j jsonObject) String() string {\n\tbytes, _ := json.Marshal(j)\n\treturn strings.TrimSpace(hack.String(bytes))\n}", "title": "" }, { "docid": "6911a8a910845aea1c4d738e5f6e1284", "score": "0.58249736", "text": "func (r *DeleteLiveTranscodeRuleResponse) FromJsonString(s string) error {\n\treturn json.Unmarshal([]byte(s), &r)\n}", "title": "" }, { "docid": "9006f599b61476376397074c398fbdf5", "score": "0.5822218", "text": "func (r *DescribeUsageResponse) FromJsonString(s string) error {\n\treturn json.Unmarshal([]byte(s), &r)\n}", "title": "" }, { "docid": "94286251c7172d76d43c1d0faf908adb", "score": "0.58186173", "text": "func (r *CreateLiveSnapshotTemplateResponse) FromJsonString(s string) error {\n\treturn json.Unmarshal([]byte(s), &r)\n}", "title": "" }, { "docid": "5153dfedea14e16967a052dad8dc9838", "score": "0.5810563", "text": "func (r *CreateLiveTranscodeRuleResponse) FromJsonString(s string) error {\n\treturn json.Unmarshal([]byte(s), &r)\n}", "title": "" }, { "docid": "aff9b9d24c2bf39d506711b4ac2a68c9", "score": "0.5804493", "text": "func (r *BindZoneToPlanResponse) FromJsonString(s string) error {\n\treturn json.Unmarshal([]byte(s), &r)\n}", "title": "" }, { "docid": "e9b750b088ecc3fb4cd3ded160f4b8f2", "score": "0.5803755", "text": "func (r *ModifyAllRuleStatusResponse) FromJsonString(s string) error {\n\treturn json.Unmarshal([]byte(s), &r)\n}", "title": "" }, { "docid": "a170163e9afb18d9e27d05b253fa98a0", "score": "0.5803255", "text": "func (r *ModifyStorageSettingResponse) FromJsonString(s string) error {\n\treturn json.Unmarshal([]byte(s), &r)\n}", "title": "" }, { "docid": "1ed213a263cc5c34edeea1a578d1a9bd", "score": "0.5800564", "text": "func (r *ModifyZoneResponse) FromJsonString(s string) error {\n\treturn json.Unmarshal([]byte(s), &r)\n}", "title": "" }, { "docid": "64c59f0570a74f04a21185f0f128a8e9", "score": "0.57995427", "text": "func (r *ModifyRunSyncAssetRequest) 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, \"Type\")\n\tif len(f) > 0 {\n\t\treturn tcerr.NewTencentCloudSDKError(\"ClientError.BuildRequestError\", \"ModifyRunSyncAssetRequest has unknown keys!\", \"\")\n\t}\n\treturn json.Unmarshal([]byte(s), &r)\n}", "title": "" }, { "docid": "bcb5e92779bb423aa4c46bd49b7f78b8", "score": "0.57947993", "text": "func (r *ForbidLiveDomainResponse) FromJsonString(s string) error {\n\treturn json.Unmarshal([]byte(s), &r)\n}", "title": "" }, { "docid": "f3af8e89ae5556e8f915546b61878076", "score": "0.57938427", "text": "func (r *DescribeSourceAssetResponse) FromJsonString(s string) error {\n\treturn json.Unmarshal([]byte(s), &r)\n}", "title": "" }, { "docid": "fe876647eb4a5253ca6b7ab031337d89", "score": "0.5792223", "text": "func (r *CreateLiveCallbackRuleResponse) FromJsonString(s string) error {\n\treturn json.Unmarshal([]byte(s), &r)\n}", "title": "" }, { "docid": "ae984dbe229c5a559df5f9b166ee7903", "score": "0.57822263", "text": "func (r *DeleteLiveWatermarkRequest) 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, \"WatermarkId\")\n\tif len(f) > 0 {\n\t\treturn tcerr.NewTencentCloudSDKError(\"ClientError.BuildRequestError\", \"DeleteLiveWatermarkRequest has unknown keys!\", \"\")\n\t}\n\treturn json.Unmarshal([]byte(s), &r)\n}", "title": "" }, { "docid": "898e4731e425c6d99c9db5b6176309ab", "score": "0.5774554", "text": "func (r *BindingPolicyObjectResponse) FromJsonString(s string) error {\n\treturn json.Unmarshal([]byte(s), &r)\n}", "title": "" }, { "docid": "0c7fb90d6943dcb5e184ef0be4de18ac", "score": "0.5774126", "text": "func (r *DeleteLiveSnapshotTemplateResponse) FromJsonString(s string) error {\n\treturn json.Unmarshal([]byte(s), &r)\n}", "title": "" }, { "docid": "7a253d3c24bd305d7d4895b07ca6012e", "score": "0.57718104", "text": "func (r *SyncProxyOrganizationResponse) FromJsonString(s string) error {\n\treturn json.Unmarshal([]byte(s), &r)\n}", "title": "" }, { "docid": "b53ab663ae25d57b49aca44e4b3a46d9", "score": "0.5771322", "text": "func (r *StopLiveRecordResponse) FromJsonString(s string) error {\n\treturn json.Unmarshal([]byte(s), &r)\n}", "title": "" }, { "docid": "03747e018922ab53c2c539e945da1514", "score": "0.57675344", "text": "func (r *DescribeLiveCertResponse) FromJsonString(s string) error {\n\treturn json.Unmarshal([]byte(s), &r)\n}", "title": "" }, { "docid": "e0d21c3003f3b883e995da27961f032d", "score": "0.5766634", "text": "func (r *CreateLiveRecordResponse) FromJsonString(s string) error {\n\treturn json.Unmarshal([]byte(s), &r)\n}", "title": "" }, { "docid": "facf3ba9f56cd42b75803840e873c7e0", "score": "0.576593", "text": "func (e *Extracter) Json() *Extracter {\n\tif e.jsonStr == \"\" {\n\t\treturn nil\n\t}\n\n\treader := bytes.NewBufferString(e.jsonStr)\n\tif err := json.NewDecoder(reader).Decode(&e.codes); err != nil {\n\t\treturn nil\n\t}\n\treturn e\n}", "title": "" }, { "docid": "f8e59ae09fedc12ed2de498938d531e6", "score": "0.576489", "text": "func (r *CreateLiveTranscodeTemplateResponse) FromJsonString(s string) error {\n\treturn json.Unmarshal([]byte(s), &r)\n}", "title": "" }, { "docid": "5139f4003bb7126ccbaf0ae6ae4d7a8d", "score": "0.5764487", "text": "func (r *ModifyLivePlayDomainResponse) FromJsonString(s string) error {\n\treturn json.Unmarshal([]byte(s), &r)\n}", "title": "" }, { "docid": "6939c81b3be4912ae4af60224817d0a6", "score": "0.5764013", "text": "func (r *DescribeLiveSnapshotTemplateRequest) 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, \"TemplateId\")\n\tif len(f) > 0 {\n\t\treturn tcerr.NewTencentCloudSDKError(\"ClientError.BuildRequestError\", \"DescribeLiveSnapshotTemplateRequest has unknown keys!\", \"\")\n\t}\n\treturn json.Unmarshal([]byte(s), &r)\n}", "title": "" }, { "docid": "6ff06080f4f4739fa2a7445df163c472", "score": "0.5761655", "text": "func (r *DeleteLiveCallbackRuleResponse) FromJsonString(s string) error {\n\treturn json.Unmarshal([]byte(s), &r)\n}", "title": "" }, { "docid": "a80ae87e994f1eee69c1cc94cbc62d7d", "score": "0.57589686", "text": "func (r *DescribeContentQuotaResponse) FromJsonString(s string) error {\n\treturn json.Unmarshal([]byte(s), &r)\n}", "title": "" } ]
a205a90d11598ea89f92900a9a9d5ec5
ListNetworkChanges mocks base method
[ { "docid": "2afd922bb9a79e980cb4044110ff6500", "score": "0.77799493", "text": "func (m *MockChangeServiceServer) ListNetworkChanges(arg0 *ListNetworkChangeRequest, arg1 ChangeService_ListNetworkChangesServer) error {\n\tm.ctrl.T.Helper()\n\tret := m.ctrl.Call(m, \"ListNetworkChanges\", arg0, arg1)\n\tret0, _ := ret[0].(error)\n\treturn ret0\n}", "title": "" } ]
[ { "docid": "3e472530a8628f659d555bfe1c1fc3a0", "score": "0.7500144", "text": "func (m *MockChangeServiceClient) ListNetworkChanges(ctx context.Context, in *ListNetworkChangeRequest, opts ...grpc.CallOption) (ChangeService_ListNetworkChangesClient, 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, \"ListNetworkChanges\", varargs...)\n\tret0, _ := ret[0].(ChangeService_ListNetworkChangesClient)\n\tret1, _ := ret[1].(error)\n\treturn ret0, ret1\n}", "title": "" }, { "docid": "a373bda4237292e2957d3b5488992b88", "score": "0.6509246", "text": "func (m *MockNetworkClient) List(arg0 context.Context, arg1 hcloud.NetworkListOpts) ([]*hcloud.Network, *hcloud.Response, error) {\n\tm.ctrl.T.Helper()\n\tret := m.ctrl.Call(m, \"List\", arg0, arg1)\n\tret0, _ := ret[0].([]*hcloud.Network)\n\tret1, _ := ret[1].(*hcloud.Response)\n\tret2, _ := ret[2].(error)\n\treturn ret0, ret1, ret2\n}", "title": "" }, { "docid": "55b6cd3b234fcb62e2eec2c004fdd767", "score": "0.64268035", "text": "func (m *MockAPIClient) NetworkList(arg0 context.Context, arg1 types.NetworkListOptions) ([]types.NetworkResource, error) {\n\tm.ctrl.T.Helper()\n\tret := m.ctrl.Call(m, \"NetworkList\", arg0, arg1)\n\tret0, _ := ret[0].([]types.NetworkResource)\n\tret1, _ := ret[1].(error)\n\treturn ret0, ret1\n}", "title": "" }, { "docid": "0cd4216b779ab361dd5eff1acd4250ad", "score": "0.63554615", "text": "func (m *MockClient) ListNetworks(arg0 string, arg1 ...daisyCompute.ListCallOption) ([]*v1.Network, error) {\n\tm.ctrl.T.Helper()\n\tvarargs := []interface{}{arg0}\n\tfor _, a := range arg1 {\n\t\tvarargs = append(varargs, a)\n\t}\n\tret := m.ctrl.Call(m, \"ListNetworks\", varargs...)\n\tret0, _ := ret[0].([]*v1.Network)\n\tret1, _ := ret[1].(error)\n\treturn ret0, ret1\n}", "title": "" }, { "docid": "3de5853af41ac1f7094fa2c33c25f2b1", "score": "0.6238521", "text": "func (mr *MockChangeServiceServerMockRecorder) ListNetworkChanges(arg0, arg1 interface{}) *gomock.Call {\n\tmr.mock.ctrl.T.Helper()\n\treturn mr.mock.ctrl.RecordCallWithMethodType(mr.mock, \"ListNetworkChanges\", reflect.TypeOf((*MockChangeServiceServer)(nil).ListNetworkChanges), arg0, arg1)\n}", "title": "" }, { "docid": "198c6e613a34fe22d37a21182fc33179", "score": "0.62012076", "text": "func (mr *MockChangeServiceClientMockRecorder) ListNetworkChanges(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, \"ListNetworkChanges\", reflect.TypeOf((*MockChangeServiceClient)(nil).ListNetworkChanges), varargs...)\n}", "title": "" }, { "docid": "ed787accd4e47bf102a9378e92d49579", "score": "0.6151677", "text": "func (mock *ProjectNetworkPolicyListerMock) ListCalls() []struct {\n\tNamespace string\n\tSelector labels.Selector\n} {\n\tvar calls []struct {\n\t\tNamespace string\n\t\tSelector labels.Selector\n\t}\n\tlockProjectNetworkPolicyListerMockList.RLock()\n\tcalls = mock.calls.List\n\tlockProjectNetworkPolicyListerMockList.RUnlock()\n\treturn calls\n}", "title": "" }, { "docid": "6bb5278516760c3cb6ca15b7f263d8ca", "score": "0.6150011", "text": "func (mock *ProjectNetworkPolicyInterfaceMock) ListCalls() []struct {\n\tOpts metav1.ListOptions\n} {\n\tvar calls []struct {\n\t\tOpts metav1.ListOptions\n\t}\n\tlockProjectNetworkPolicyInterfaceMockList.RLock()\n\tcalls = mock.calls.List\n\tlockProjectNetworkPolicyInterfaceMockList.RUnlock()\n\treturn calls\n}", "title": "" }, { "docid": "d2d7285ca5df76e354a999a4fa14323f", "score": "0.6101942", "text": "func (m *MockNetworkServiceIface) ListNetworks(p *ListNetworksParams) (*ListNetworksResponse, error) {\n\tm.ctrl.T.Helper()\n\tret := m.ctrl.Call(m, \"ListNetworks\", p)\n\tret0, _ := ret[0].(*ListNetworksResponse)\n\tret1, _ := ret[1].(error)\n\treturn ret0, ret1\n}", "title": "" }, { "docid": "7b289648f0831dc3fde0981a6db546fd", "score": "0.59689397", "text": "func (m *MockChangeServiceServer) ListDeviceChanges(arg0 *ListDeviceChangeRequest, arg1 ChangeService_ListDeviceChangesServer) error {\n\tm.ctrl.T.Helper()\n\tret := m.ctrl.Call(m, \"ListDeviceChanges\", arg0, arg1)\n\tret0, _ := ret[0].(error)\n\treturn ret0\n}", "title": "" }, { "docid": "10b92cb2207c7528d110436e85162a41", "score": "0.5964655", "text": "func NewMockChangeService_ListNetworkChangesClient(ctrl *gomock.Controller) *MockChangeService_ListNetworkChangesClient {\n\tmock := &MockChangeService_ListNetworkChangesClient{ctrl: ctrl}\n\tmock.recorder = &MockChangeService_ListNetworkChangesClientMockRecorder{mock}\n\treturn mock\n}", "title": "" }, { "docid": "59ca30090038be90850f8e3d5539565f", "score": "0.5945717", "text": "func (m *MockChangeService_ListNetworkChangesClient) Recv() (*ListNetworkChangeResponse, error) {\n\tm.ctrl.T.Helper()\n\tret := m.ctrl.Call(m, \"Recv\")\n\tret0, _ := ret[0].(*ListNetworkChangeResponse)\n\tret1, _ := ret[1].(error)\n\treturn ret0, ret1\n}", "title": "" }, { "docid": "440a21ecbd2221c92c1d7b144cf0c4cb", "score": "0.59169936", "text": "func (m *MockContractRepository) List(arg0 int64, arg1 string) ([]model.Contract, error) {\n\tm.ctrl.T.Helper()\n\tret := m.ctrl.Call(m, \"List\", arg0, arg1)\n\tret0, _ := ret[0].([]model.Contract)\n\tret1, _ := ret[1].(error)\n\treturn ret0, ret1\n}", "title": "" }, { "docid": "d3713b0fe9b1675f45a1ed84a2749c03", "score": "0.5898705", "text": "func (client *NimbusClient) diffNetworks(objList *netproto.NetworkList, reactor NetworkReactor, ostream *NetworkOStream) {\n\t// build a map of objects\n\tobjmap := make(map[string]*netproto.Network)\n\tfor _, obj := range objList.Networks {\n\t\tkey := obj.ObjectMeta.GetKey()\n\t\tobjmap[key] = obj\n\t}\n\n\t// see if we need to delete any locally found object\n\to := netproto.Network{\n\t\tTypeMeta: api.TypeMeta{Kind: \"Network\"},\n\t}\n\n\tlocalObjs, err := reactor.HandleNetwork(types.List, o)\n\tif err != nil {\n\t\tlog.Error(errors.Wrapf(types.ErrNimbusHandling, \"Op: %s | Kind: Network | Err: %v\", types.Operation(types.List), err))\n\t}\n\tfor _, lobj := range localObjs {\n\t\tctby, ok := lobj.ObjectMeta.Labels[\"CreatedBy\"]\n\t\tif ok && ctby == \"Venice\" {\n\t\t\tkey := lobj.ObjectMeta.GetKey()\n\t\t\tif nobj, ok := objmap[key]; !ok {\n\t\t\t\tevt := netproto.NetworkEvent{\n\t\t\t\t\tEventType: api.EventType_DeleteEvent,\n\n\t\t\t\t\tNetwork: lobj,\n\t\t\t\t}\n\t\t\t\tlog.Infof(\"diffNetworks(): Deleting object %+v\", lobj.ObjectMeta)\n\t\t\t\tclient.lockObject(evt.Network.GetObjectKind(), evt.Network.ObjectMeta)\n\t\t\t\tclient.processNetworkEvent(evt, reactor, ostream)\n\t\t\t} else if ok && (nobj.GenerationID == lobj.GenerationID) {\n\t\t\t\t//Delete it so that we don't add/update\n\t\t\t\tdelete(objmap, key)\n\t\t\t}\n\t\t} else {\n\t\t\tlog.Infof(\"Not deleting non-venice object %+v\", lobj.ObjectMeta)\n\t\t}\n\t}\n\n\t// add/update all new objects\n\tfor _, obj := range objmap {\n\t\tevt := netproto.NetworkEvent{\n\t\t\tEventType: api.EventType_UpdateEvent,\n\n\t\t\tNetwork: *obj,\n\t\t}\n\t\tclient.lockObject(evt.Network.GetObjectKind(), evt.Network.ObjectMeta)\n\t\tclient.processNetworkEvent(evt, reactor, ostream)\n\t}\n}", "title": "" }, { "docid": "d0e71df26dbc730f51b217a340b3e1bc", "score": "0.58715266", "text": "func (mock *nodeListenerMock) onChangeCalls() []struct {\n\tNodes []nodeInfo\n} {\n\tvar calls []struct {\n\t\tNodes []nodeInfo\n\t}\n\tmock.lockonChange.RLock()\n\tcalls = mock.calls.onChange\n\tmock.lockonChange.RUnlock()\n\treturn calls\n}", "title": "" }, { "docid": "98aafdb8b20948986be2f3981705cce4", "score": "0.5866327", "text": "func (m *MockClient) ListSubnetworks(arg0, arg1 string, arg2 ...daisyCompute.ListCallOption) ([]*v1.Subnetwork, 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, \"ListSubnetworks\", varargs...)\n\tret0, _ := ret[0].([]*v1.Subnetwork)\n\tret1, _ := ret[1].(error)\n\treturn ret0, ret1\n}", "title": "" }, { "docid": "ab51c7e1bb130b54f317382212012bb7", "score": "0.5809351", "text": "func getChanges(t *testing.T, repo *NotaryRepository) []changelist.Change {\n\tchangeList, err := repo.GetChangelist()\n\tassert.NoError(t, err)\n\treturn changeList.List()\n}", "title": "" }, { "docid": "0afd9cac35160bf56d76ff70c1ff2512", "score": "0.5808651", "text": "func (m *MockKubeManager) List(arg0 context.Context) ([]subnet.Subnet, error) {\n\tm.ctrl.T.Helper()\n\tret := m.ctrl.Call(m, \"List\", arg0)\n\tret0, _ := ret[0].([]subnet.Subnet)\n\tret1, _ := ret[1].(error)\n\treturn ret0, ret1\n}", "title": "" }, { "docid": "1656ab415b8d44f8978c0b1e31900e14", "score": "0.57984895", "text": "func (cl *MockDockerClient) NetworkList(context.Context, dockerTypes.NetworkListOptions) ([]dockerTypes.NetworkResource, error) {\n\treturn nil, fmt.Errorf(\"NetworkList %w\", errNotImplemented)\n}", "title": "" }, { "docid": "2e107d5094f2e5603203748666ad6b7b", "score": "0.5787036", "text": "func (m *MockChangeServiceClient) ListDeviceChanges(ctx context.Context, in *ListDeviceChangeRequest, opts ...grpc.CallOption) (ChangeService_ListDeviceChangesClient, 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, \"ListDeviceChanges\", varargs...)\n\tret0, _ := ret[0].(ChangeService_ListDeviceChangesClient)\n\tret1, _ := ret[1].(error)\n\treturn ret0, ret1\n}", "title": "" }, { "docid": "efced673b3c62b9df95ed01bfc17ac7e", "score": "0.57807934", "text": "func (mock *EventListerMock) ListCalls() []struct {\n\tNamespace string\n\tSelector labels.Selector\n} {\n\tvar calls []struct {\n\t\tNamespace string\n\t\tSelector labels.Selector\n\t}\n\tlockEventListerMockList.RLock()\n\tcalls = mock.calls.List\n\tlockEventListerMockList.RUnlock()\n\treturn calls\n}", "title": "" }, { "docid": "ff1689da56d6a0aff4c102b7ee3c9639", "score": "0.5766632", "text": "func (m *MockChangeService_ListNetworkChangesClient) EXPECT() *MockChangeService_ListNetworkChangesClientMockRecorder {\n\treturn m.recorder\n}", "title": "" }, { "docid": "dae8a0d9a2f7893f93c490783e1977a0", "score": "0.5757957", "text": "func TestGetChangelist(t *testing.T) {\n\ttestGetChangelist(t, data.ECDSAKey)\n\tif !testing.Short() {\n\t\ttestGetChangelist(t, data.RSAKey)\n\t}\n}", "title": "" }, { "docid": "e9d33758b66bbe643f40c713883ed621", "score": "0.5733925", "text": "func (m *MockCNI) DelNetworkList(arg0 *libcni.NetworkConfigList, arg1 *libcni.RuntimeConf) error {\n\tret := m.ctrl.Call(m, \"DelNetworkList\", arg0, arg1)\n\tret0, _ := ret[0].(error)\n\treturn ret0\n}", "title": "" }, { "docid": "1c0f7aeaa49425f064d4556b18481a98", "score": "0.572581", "text": "func (m *MockVirtualNetworksClient) List(arg0 context.Context, arg1 string) (network.VirtualNetworkListResultPage, error) {\n\tm.ctrl.T.Helper()\n\tret := m.ctrl.Call(m, \"List\", arg0, arg1)\n\tret0, _ := ret[0].(network.VirtualNetworkListResultPage)\n\tret1, _ := ret[1].(error)\n\treturn ret0, ret1\n}", "title": "" }, { "docid": "2cbf466992896920c0b4b60446703cea", "score": "0.5721745", "text": "func (mock *EventInterfaceMock) ListCalls() []struct {\n\tOpts metav1.ListOptions\n} {\n\tvar calls []struct {\n\t\tOpts metav1.ListOptions\n\t}\n\tlockEventInterfaceMockList.RLock()\n\tcalls = mock.calls.List\n\tlockEventInterfaceMockList.RUnlock()\n\treturn calls\n}", "title": "" }, { "docid": "80d82a5c24c5eb870f0602aaf4894d4f", "score": "0.5699348", "text": "func (m *MockEventBridgeAPI) ListConnections(arg0 *eventbridge.ListConnectionsInput) (*eventbridge.ListConnectionsOutput, error) {\n\tm.ctrl.T.Helper()\n\tret := m.ctrl.Call(m, \"ListConnections\", arg0)\n\tret0, _ := ret[0].(*eventbridge.ListConnectionsOutput)\n\tret1, _ := ret[1].(error)\n\treturn ret0, ret1\n}", "title": "" }, { "docid": "c47a9a61bc82bbb9ebdb8ffacf959bcc", "score": "0.56992555", "text": "func (m *MockChangeService_ListNetworkChangesServer) Send(arg0 *ListNetworkChangeResponse) error {\n\tm.ctrl.T.Helper()\n\tret := m.ctrl.Call(m, \"Send\", arg0)\n\tret0, _ := ret[0].(error)\n\treturn ret0\n}", "title": "" }, { "docid": "7f038072f9bcc8fe0ad1fe818b561136", "score": "0.5688122", "text": "func (m *ProxyInbound) Network() []net.Network {\n\tm.ctrl.T.Helper()\n\tret := m.ctrl.Call(m, \"Network\")\n\tret0, _ := ret[0].([]net.Network)\n\treturn ret0\n}", "title": "" }, { "docid": "a55a7b8b2ffbdce50b4bb41a27a2236c", "score": "0.5673514", "text": "func (m *MockNetworkServiceIface) ListNetworkPermissions(p *ListNetworkPermissionsParams) (*ListNetworkPermissionsResponse, error) {\n\tm.ctrl.T.Helper()\n\tret := m.ctrl.Call(m, \"ListNetworkPermissions\", p)\n\tret0, _ := ret[0].(*ListNetworkPermissionsResponse)\n\tret1, _ := ret[1].(error)\n\treturn ret0, ret1\n}", "title": "" }, { "docid": "341f9918a1526e180026f87d910f819e", "score": "0.5668429", "text": "func TestChangeEvent(t *testing.T) {\n\tfor _, l := range changeEventTestTbl {\n\t\trunTest(t, func(s *res.Service) {\n\t\t\ts.Handle(\"model\",\n\t\t\t\tres.GetModel(func(r res.ModelRequest) {\n\t\t\t\t\tr.NotFound()\n\t\t\t\t}),\n\t\t\t\tres.Call(\"method\", func(r res.CallRequest) {\n\t\t\t\t\tr.ChangeEvent(l.Payload)\n\t\t\t\t\tr.OK(nil)\n\t\t\t\t}),\n\t\t\t)\n\t\t}, func(s *restest.Session) {\n\t\t\treq := s.Call(\"test.model\", \"method\", nil)\n\t\t\ts.GetMsg().\n\t\t\t\tAssertChangeEvent(\"test.model\", l.Payload)\n\t\t\treq.Response()\n\t\t})\n\t}\n}", "title": "" }, { "docid": "bca75802ff924bce03042c7e3526806d", "score": "0.5642229", "text": "func (mock *RancherUserNotificationListerMock) ListCalls() []struct {\n\tNamespace string\n\tSelector labels.Selector\n} {\n\tvar calls []struct {\n\t\tNamespace string\n\t\tSelector labels.Selector\n\t}\n\tlockRancherUserNotificationListerMockList.RLock()\n\tcalls = mock.calls.List\n\tlockRancherUserNotificationListerMockList.RUnlock()\n\treturn calls\n}", "title": "" }, { "docid": "197c24aed392935ff74e4a4c31d8bfc9", "score": "0.562949", "text": "func (m *MockRepository) StatesChangedAfter(network types.Network, level int64) ([]bmd.BigMapState, error) {\n\tm.ctrl.T.Helper()\n\tret := m.ctrl.Call(m, \"StatesChangedAfter\", network, level)\n\tret0, _ := ret[0].([]bmd.BigMapState)\n\tret1, _ := ret[1].(error)\n\treturn ret0, ret1\n}", "title": "" }, { "docid": "57899eaf882982d38585233b8ef64da4", "score": "0.5624042", "text": "func (m *MockCNI) AddNetworkList(arg0 *libcni.NetworkConfigList, arg1 *libcni.RuntimeConf) (types.Result, error) {\n\tret := m.ctrl.Call(m, \"AddNetworkList\", arg0, arg1)\n\tret0, _ := ret[0].(types.Result)\n\tret1, _ := ret[1].(error)\n\treturn ret0, ret1\n}", "title": "" }, { "docid": "8f01f48e878f22b22e2d27bea65a5bf5", "score": "0.5619178", "text": "func (m *MockNetworkServiceIface) ListNetworkIsolationMethods(p *ListNetworkIsolationMethodsParams) (*ListNetworkIsolationMethodsResponse, error) {\n\tm.ctrl.T.Helper()\n\tret := m.ctrl.Call(m, \"ListNetworkIsolationMethods\", p)\n\tret0, _ := ret[0].(*ListNetworkIsolationMethodsResponse)\n\tret1, _ := ret[1].(error)\n\treturn ret0, ret1\n}", "title": "" }, { "docid": "385d9fedcac7012a4e2ec4db8ea89142", "score": "0.5604347", "text": "func NewMockChangeService_ListNetworkChangesServer(ctrl *gomock.Controller) *MockChangeService_ListNetworkChangesServer {\n\tmock := &MockChangeService_ListNetworkChangesServer{ctrl: ctrl}\n\tmock.recorder = &MockChangeService_ListNetworkChangesServerMockRecorder{mock}\n\treturn mock\n}", "title": "" }, { "docid": "cfa8fd05f91bd5aae4d951c7b64728e2", "score": "0.5597115", "text": "func (m *MockOperationsManager) List(ctx context.Context, params *ListParams) (chan *entities.WalletOperation, error) {\n\tm.ctrl.T.Helper()\n\tret := m.ctrl.Call(m, \"List\", ctx, params)\n\tret0, _ := ret[0].(chan *entities.WalletOperation)\n\tret1, _ := ret[1].(error)\n\treturn ret0, ret1\n}", "title": "" }, { "docid": "6fec95bb8c9b02f2c510013fc4cc03f1", "score": "0.5595199", "text": "func WatchNetworkChange(checkIntlSec int, change chan bool) {\n\tvar existingIPs []LocalIPAddr\n\tfor {\n\t\ttime.Sleep(time.Duration(checkIntlSec) * time.Second)\n\t\tcurIPs, err := GetLocalIPs()\n\t\tif err != nil {\n\t\t\tlogger.LogError(\"Error while getting local IPs\")\n\t\t\tcontinue\n\t\t}\n\t\tif existingIPs == nil {\n\t\t\t// First time. Lets store it.\n\t\t\texistingIPs = curIPs\n\t\t\tcontinue\n\t\t}\n\n\t\tif len(existingIPs) != len(curIPs) {\n\t\t\tchange <- true\n\t\t} else {\n\t\t\tfor i, _ := range curIPs {\n\t\t\t\tif !curIPs[i].IP.Equal(existingIPs[i].IP) {\n\t\t\t\t\tchange <- true\n\t\t\t\t\tbreak\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\texistingIPs = curIPs\n\t}\n}", "title": "" }, { "docid": "8b891a8c13cc83aaf778e460c83c59bb", "score": "0.5590425", "text": "func (mock *RancherUserNotificationInterfaceMock) ListCalls() []struct {\n\tOpts metav1.ListOptions\n} {\n\tvar calls []struct {\n\t\tOpts metav1.ListOptions\n\t}\n\tlockRancherUserNotificationInterfaceMockList.RLock()\n\tcalls = mock.calls.List\n\tlockRancherUserNotificationInterfaceMockList.RUnlock()\n\treturn calls\n}", "title": "" }, { "docid": "b0abd2c8a2f04f3515fc0244c2383425", "score": "0.55866355", "text": "func (m *MockNodeOps) List(arg0 context.Context, arg1 node.NodeListParams) ([]*models.Node, error) {\n\tm.ctrl.T.Helper()\n\tret := m.ctrl.Call(m, \"List\", arg0, arg1)\n\tret0, _ := ret[0].([]*models.Node)\n\tret1, _ := ret[1].(error)\n\treturn ret0, ret1\n}", "title": "" }, { "docid": "b99722cb23043719aa310526cee3813e", "score": "0.55650526", "text": "func (mock *ProjectNetworkPolicyListerMock) GetCalls() []struct {\n\tNamespace string\n\tName string\n} {\n\tvar calls []struct {\n\t\tNamespace string\n\t\tName string\n\t}\n\tlockProjectNetworkPolicyListerMockGet.RLock()\n\tcalls = mock.calls.Get\n\tlockProjectNetworkPolicyListerMockGet.RUnlock()\n\treturn calls\n}", "title": "" }, { "docid": "57e8859a1298a79201a4afb1f128ada6", "score": "0.5559399", "text": "func (mock *CisBenchmarkVersionListerMock) ListCalls() []struct {\n\tNamespace string\n\tSelector labels.Selector\n} {\n\tvar calls []struct {\n\t\tNamespace string\n\t\tSelector labels.Selector\n\t}\n\tlockCisBenchmarkVersionListerMockList.RLock()\n\tcalls = mock.calls.List\n\tlockCisBenchmarkVersionListerMockList.RUnlock()\n\treturn calls\n}", "title": "" }, { "docid": "8874dbd6d8cd73c87251c73f689b1f41", "score": "0.5556367", "text": "func (m *MockNetworkACLServiceIface) UpdateNetworkACLList(p *UpdateNetworkACLListParams) (*UpdateNetworkACLListResponse, error) {\n\tm.ctrl.T.Helper()\n\tret := m.ctrl.Call(m, \"UpdateNetworkACLList\", p)\n\tret0, _ := ret[0].(*UpdateNetworkACLListResponse)\n\tret1, _ := ret[1].(error)\n\treturn ret0, ret1\n}", "title": "" }, { "docid": "1790d14ab404b2b0c44eedab421d04ff", "score": "0.5549509", "text": "func (mock *GlobalDnsInterfaceMock) ListCalls() []struct {\n\tOpts metav1.ListOptions\n} {\n\tvar calls []struct {\n\t\tOpts metav1.ListOptions\n\t}\n\tlockGlobalDnsInterfaceMockList.RLock()\n\tcalls = mock.calls.List\n\tlockGlobalDnsInterfaceMockList.RUnlock()\n\treturn calls\n}", "title": "" }, { "docid": "e81fb59eae142230f004f23173aa7660", "score": "0.55451196", "text": "func (m *MockNetworkDeviceServiceIface) ListNetworkDevice(p *ListNetworkDeviceParams) (*ListNetworkDeviceResponse, error) {\n\tm.ctrl.T.Helper()\n\tret := m.ctrl.Call(m, \"ListNetworkDevice\", p)\n\tret0, _ := ret[0].(*ListNetworkDeviceResponse)\n\tret1, _ := ret[1].(error)\n\treturn ret0, ret1\n}", "title": "" }, { "docid": "7229b80336b888954f2c76a8e70396e1", "score": "0.5542705", "text": "func (mock *PublicDomainClientMock) ListCalls() []struct {\n\tNamespace string\n\tOpts v1b.ListOptions\n} {\n\tvar calls []struct {\n\t\tNamespace string\n\t\tOpts v1b.ListOptions\n\t}\n\tlockPublicDomainClientMockList.RLock()\n\tcalls = mock.calls.List\n\tlockPublicDomainClientMockList.RUnlock()\n\treturn calls\n}", "title": "" }, { "docid": "fb9ec5ce608f4eb5dcbca6acc462e0d8", "score": "0.55375165", "text": "func (mock *GlobalDnsListerMock) ListCalls() []struct {\n\tNamespace string\n\tSelector labels.Selector\n} {\n\tvar calls []struct {\n\t\tNamespace string\n\t\tSelector labels.Selector\n\t}\n\tlockGlobalDnsListerMockList.RLock()\n\tcalls = mock.calls.List\n\tlockGlobalDnsListerMockList.RUnlock()\n\treturn calls\n}", "title": "" }, { "docid": "b859a7ad8700e5a403e61c8ce86e364d", "score": "0.5518078", "text": "func TestUpdateNoChangelist(t *testing.T) {\n\tunittest.SmallTest(t)\n\n\tmc := &mock_codereview.Client{}\n\n\tcommits := makeCommits()[2:]\n\tmc.On(\"GetChangelistIDForCommit\", testutils.AnyContext, commits[0]).Return(\"\", code_review.ErrNotFound)\n\n\tu := New(nil, []clstore.ReviewSystem{\n\t\t{\n\t\t\tID: githubCRS,\n\t\t\tClient: mc,\n\t\t\t// Store and URLTemplate not used here\n\t\t},\n\t\t{\n\t\t\tID: gerritCRS,\n\t\t\tClient: mc,\n\t\t\t// Store and URLTemplate not used here\n\t\t},\n\t})\n\terr := u.UpdateChangelistsAsLanded(context.Background(), commits)\n\trequire.NoError(t, err)\n}", "title": "" }, { "docid": "bb94a103c575e2258cb1bc0e9744fcdf", "score": "0.5507658", "text": "func (m *MockNetworkACLServiceIface) ListNetworkACLLists(p *ListNetworkACLListsParams) (*ListNetworkACLListsResponse, error) {\n\tm.ctrl.T.Helper()\n\tret := m.ctrl.Call(m, \"ListNetworkACLLists\", p)\n\tret0, _ := ret[0].(*ListNetworkACLListsResponse)\n\tret1, _ := ret[1].(error)\n\treturn ret0, ret1\n}", "title": "" }, { "docid": "095111dc8cc876fdad5ee7116993fcb9", "score": "0.5496062", "text": "func (mock *HelmChartClientMock) ListCalls() []struct {\n\tNamespace string\n\tOpts v1b.ListOptions\n} {\n\tvar calls []struct {\n\t\tNamespace string\n\t\tOpts v1b.ListOptions\n\t}\n\tlockHelmChartClientMockList.RLock()\n\tcalls = mock.calls.List\n\tlockHelmChartClientMockList.RUnlock()\n\treturn calls\n}", "title": "" }, { "docid": "90fa4d685f22ad7675a0249b3ca15de2", "score": "0.5493625", "text": "func (mock *ClusterAlertGroupInterfaceMock) ListCalls() []struct {\n\tOpts metav1.ListOptions\n} {\n\tvar calls []struct {\n\t\tOpts metav1.ListOptions\n\t}\n\tlockClusterAlertGroupInterfaceMockList.RLock()\n\tcalls = mock.calls.List\n\tlockClusterAlertGroupInterfaceMockList.RUnlock()\n\treturn calls\n}", "title": "" }, { "docid": "d29b329cbaa08379f280c15c141f23c5", "score": "0.54928917", "text": "func (mock *PublicDomainCacheMock) ListCalls() []struct {\n\tNamespace string\n\tSelector labels.Selector\n} {\n\tvar calls []struct {\n\t\tNamespace string\n\t\tSelector labels.Selector\n\t}\n\tlockPublicDomainCacheMockList.RLock()\n\tcalls = mock.calls.List\n\tlockPublicDomainCacheMockList.RUnlock()\n\treturn calls\n}", "title": "" }, { "docid": "493bbfc2f4ac1da1ec988694df7152bc", "score": "0.54927325", "text": "func (m *MockConfig) NetworkPeers() ([]apiconfig.NetworkPeer, error) {\n\tret := m.ctrl.Call(m, \"NetworkPeers\")\n\tret0, _ := ret[0].([]apiconfig.NetworkPeer)\n\tret1, _ := ret[1].(error)\n\treturn ret0, ret1\n}", "title": "" }, { "docid": "8eb1a0b7f867b77d9e03466355db07c8", "score": "0.5484597", "text": "func (mock *ClusterAlertGroupListerMock) ListCalls() []struct {\n\tNamespace string\n\tSelector labels.Selector\n} {\n\tvar calls []struct {\n\t\tNamespace string\n\t\tSelector labels.Selector\n\t}\n\tlockClusterAlertGroupListerMockList.RLock()\n\tcalls = mock.calls.List\n\tlockClusterAlertGroupListerMockList.RUnlock()\n\treturn calls\n}", "title": "" }, { "docid": "88b22f1b6a5a5c3aae30964612c30e1d", "score": "0.54635715", "text": "func (mock *HelmChartCacheMock) ListCalls() []struct {\n\tNamespace string\n\tSelector labels.Selector\n} {\n\tvar calls []struct {\n\t\tNamespace string\n\t\tSelector labels.Selector\n\t}\n\tlockHelmChartCacheMockList.RLock()\n\tcalls = mock.calls.List\n\tlockHelmChartCacheMockList.RUnlock()\n\treturn calls\n}", "title": "" }, { "docid": "f7074c0a7cb1ded589313f331531702a", "score": "0.5462056", "text": "func (m *MockHost) Network() network.Network {\n\tm.ctrl.T.Helper()\n\tret := m.ctrl.Call(m, \"Network\")\n\tret0, _ := ret[0].(network.Network)\n\treturn ret0\n}", "title": "" }, { "docid": "679cdd843ebdb8606331f1a016072757", "score": "0.54571426", "text": "func (m *MockNetworkServiceIface) ListPaloAltoFirewallNetworks(p *ListPaloAltoFirewallNetworksParams) (*ListPaloAltoFirewallNetworksResponse, error) {\n\tm.ctrl.T.Helper()\n\tret := m.ctrl.Call(m, \"ListPaloAltoFirewallNetworks\", p)\n\tret0, _ := ret[0].(*ListPaloAltoFirewallNetworksResponse)\n\tret1, _ := ret[1].(error)\n\treturn ret0, ret1\n}", "title": "" }, { "docid": "0408c13ecc1aaac8ff3ddd9c638e7dcf", "score": "0.545069", "text": "func (m *MockChangeService_ListNetworkChangesServer) EXPECT() *MockChangeService_ListNetworkChangesServerMockRecorder {\n\treturn m.recorder\n}", "title": "" }, { "docid": "33348ec1b4c04ebed6aa335da708d0d6", "score": "0.5448619", "text": "func (mock *PrometheusListerMock) ListCalls() []struct {\n\tNamespace string\n\tSelector labels.Selector\n} {\n\tvar calls []struct {\n\t\tNamespace string\n\t\tSelector labels.Selector\n\t}\n\tlockPrometheusListerMockList.RLock()\n\tcalls = mock.calls.List\n\tlockPrometheusListerMockList.RUnlock()\n\treturn calls\n}", "title": "" }, { "docid": "c7245fd846f7eb3cacbe78151e80f0c4", "score": "0.5443203", "text": "func (mock *PrometheusInterfaceMock) ListCalls() []struct {\n\tOpts metav1.ListOptions\n} {\n\tvar calls []struct {\n\t\tOpts metav1.ListOptions\n\t}\n\tlockPrometheusInterfaceMockList.RLock()\n\tcalls = mock.calls.List\n\tlockPrometheusInterfaceMockList.RUnlock()\n\treturn calls\n}", "title": "" }, { "docid": "aadb1a89f7ccceb4785e58c0151dc756", "score": "0.5440724", "text": "func (mock *FeatureClientMock) ListCalls() []struct {\n\tNamespace string\n\tOpts v1b.ListOptions\n} {\n\tvar calls []struct {\n\t\tNamespace string\n\t\tOpts v1b.ListOptions\n\t}\n\tlockFeatureClientMockList.RLock()\n\tcalls = mock.calls.List\n\tlockFeatureClientMockList.RUnlock()\n\treturn calls\n}", "title": "" }, { "docid": "15de40f77b2878cd3b0a5d36955bd8d3", "score": "0.54398346", "text": "func (mock *ProjectNetworkPolicyInterfaceMock) WatchCalls() []struct {\n\tOpts metav1.ListOptions\n} {\n\tvar calls []struct {\n\t\tOpts metav1.ListOptions\n\t}\n\tlockProjectNetworkPolicyInterfaceMockWatch.RLock()\n\tcalls = mock.calls.Watch\n\tlockProjectNetworkPolicyInterfaceMockWatch.RUnlock()\n\treturn calls\n}", "title": "" }, { "docid": "e73b3df8d8c69776292d8eaf3d755088", "score": "0.54370195", "text": "func (mock *PublicDomainControllerMock) ListCalls() []struct {\n\tNamespace string\n\tOpts v1b.ListOptions\n} {\n\tvar calls []struct {\n\t\tNamespace string\n\t\tOpts v1b.ListOptions\n\t}\n\tlockPublicDomainControllerMockList.RLock()\n\tcalls = mock.calls.List\n\tlockPublicDomainControllerMockList.RUnlock()\n\treturn calls\n}", "title": "" }, { "docid": "06f2927d0e3502e12b73e2461c3a8685", "score": "0.5433609", "text": "func (m *MockStore) List() []interface{} {\n\tm.ctrl.T.Helper()\n\tret := m.ctrl.Call(m, \"List\")\n\tret0, _ := ret[0].([]interface{})\n\treturn ret0\n}", "title": "" }, { "docid": "5758f7bcb73424a3105ace0c911cf150", "score": "0.54325354", "text": "func (mock *RoleListerMock) ListCalls() []struct {\n\tNamespace string\n\tSelector labels.Selector\n} {\n\tvar calls []struct {\n\t\tNamespace string\n\t\tSelector labels.Selector\n\t}\n\tlockRoleListerMockList.RLock()\n\tcalls = mock.calls.List\n\tlockRoleListerMockList.RUnlock()\n\treturn calls\n}", "title": "" }, { "docid": "9921c352c13ef3196968c7fb2880a416", "score": "0.5431855", "text": "func (client *Client) ListChanges(ctx context.Context, in *gerritpb.ListChangesRequest, opts ...grpc.CallOption) (*gerritpb.ListChangesResponse, error) {\n\tclient.f.recordRequest(in)\n\tif in.GetOffset() != 0 {\n\t\treturn nil, status.New(codes.Unimplemented, \"Offset is not supported by GerritFake\").Err()\n\t}\n\tq, err := parseListChangesQuery(in.GetQuery())\n\tif err != nil {\n\t\treturn nil, status.New(codes.InvalidArgument, err.Error()).Err()\n\t}\n\tclient.f.m.Lock()\n\tdefer client.f.m.Unlock()\n\n\tchanges := make([]*gerritpb.ChangeInfo, 0, len(client.f.cs))\n\tfor _, ch := range client.f.cs {\n\t\tswitch {\n\t\tcase ch.Host != client.host:\n\t\tcase ch.ACLs(OpRead, client.luciProject).Code() != codes.OK:\n\t\tcase !q.matches(ch):\n\t\tdefault:\n\t\t\tchanges = append(changes, applyChangeOpts(ch, in.GetOptions()))\n\t\t}\n\t}\n\t// Sort from the most recently to least recently updated,\n\t// and if equal, deterministically disambiguate on change number to avoid\n\t// flaky tests.\n\tsort.Slice(changes, func(i, j int) bool {\n\t\tl := changes[i].GetUpdated().AsTime()\n\t\tr := changes[j].GetUpdated().AsTime()\n\t\tswitch {\n\t\tcase l.Before(r):\n\t\t\treturn false\n\t\tcase l.After(r):\n\t\t\treturn true\n\t\tdefault:\n\t\t\treturn changes[i].GetNumber() > changes[j].GetNumber()\n\t\t}\n\t})\n\tres := &gerritpb.ListChangesResponse{Changes: changes}\n\tif in.GetLimit() > 0 && int64(len(changes)) > in.GetLimit() {\n\t\tres.Changes = changes[:in.GetLimit()]\n\t\tres.MoreChanges = true\n\t}\n\treturn res, nil\n}", "title": "" }, { "docid": "e45e75d443c350977eaa1dcab43e81a9", "score": "0.5428242", "text": "func networksMock() func(req *http.Request) (*http.Response, error) {\n\treturn func(req *http.Request) (*http.Response, error) {\n\t\tif !strings.HasPrefix(req.URL.Path, \"/v1.21/networks\") {\n\t\t\treturn nil, fmt.Errorf(\"Only expecting /v1.21/networks requests, got %s\", req.URL.Path)\n\t\t}\n\n\t\theader := http.Header{}\n\t\theader.Set(\"Content-Type\", \"application/json\")\n\n\t\tbody, err := json.Marshal(&dTypes.NetworkResource{\n\t\t\tName: \"12345\",\n\t\t\tID: \"1234\",\n\t\t\tScope: \"global\",\n\t\t\tDriver: \"cilium-net\",\n\t\t\tEnableIPv6: true,\n\t\t\tIPAM: dNetwork.IPAM{},\n\t\t\tInternal: false,\n\t\t\t// this map contains all endpoints except 259\n\t\t\tContainers: map[string]dTypes.EndpointResource{\n\t\t\t\t\"603e047d2268a57f5a5f93f7f9e1263e9207e348a06654bf64948def00100256\": {\n\t\t\t\t\tEndpointID: \"93529fda8c401a071d21d6bd46fdf5499b9014dcb5a35f2e3efaa8d800200256\",\n\t\t\t\t},\n\t\t\t\t\"603e047d2268a57f5a5f93f7f9e1263e9207e348a06654bf64948def00100257\": {\n\t\t\t\t\tEndpointID: \"93529fda8c401a071d21d6bd46fdf5499b9014dcb5a35f2e3efaa8d800200257\",\n\t\t\t\t},\n\t\t\t\t\"603e047d2268a57f5a5f93f7f9e1263e9207e348a06654bf64948def00100258\": {\n\t\t\t\t\tEndpointID: \"93529fda8c401a071d21d6bd46fdf5499b9014dcb5a35f2e3efaa8d800100258\",\n\t\t\t\t},\n\t\t\t},\n\t\t\tOptions: map[string]string{},\n\t\t\tLabels: map[string]string{},\n\t\t})\n\t\tif err != nil {\n\t\t\treturn nil, err\n\t\t}\n\n\t\treturn &http.Response{\n\t\t\tStatusCode: 200,\n\t\t\tBody: ioutil.NopCloser(bytes.NewReader(body)),\n\t\t\tHeader: header,\n\t\t}, nil\n\t}\n}", "title": "" }, { "docid": "e33323b7b1bba8fffd73334c062afab7", "score": "0.5427468", "text": "func (mock *ProjectCatalogListerMock) ListCalls() []struct {\n\tNamespace string\n\tSelector labels.Selector\n} {\n\tvar calls []struct {\n\t\tNamespace string\n\t\tSelector labels.Selector\n\t}\n\tlockProjectCatalogListerMockList.RLock()\n\tcalls = mock.calls.List\n\tlockProjectCatalogListerMockList.RUnlock()\n\treturn calls\n}", "title": "" }, { "docid": "d0e7e53c63f6bb7e970a917a3eef5976", "score": "0.54203033", "text": "func (mock *HelmChartControllerMock) ListCalls() []struct {\n\tNamespace string\n\tOpts v1b.ListOptions\n} {\n\tvar calls []struct {\n\t\tNamespace string\n\t\tOpts v1b.ListOptions\n\t}\n\tlockHelmChartControllerMockList.RLock()\n\tcalls = mock.calls.List\n\tlockHelmChartControllerMockList.RUnlock()\n\treturn calls\n}", "title": "" }, { "docid": "8082f69cafac0435402ea831a52e0901", "score": "0.5409771", "text": "func (m *MockNetworkACLServiceIface) ListNetworkACLs(p *ListNetworkACLsParams) (*ListNetworkACLsResponse, error) {\n\tm.ctrl.T.Helper()\n\tret := m.ctrl.Call(m, \"ListNetworkACLs\", p)\n\tret0, _ := ret[0].(*ListNetworkACLsResponse)\n\tret1, _ := ret[1].(error)\n\treturn ret0, ret1\n}", "title": "" }, { "docid": "f2479a6d56b4e3f5b2a66f929bf653a2", "score": "0.5395854", "text": "func (mock *ProjectCatalogInterfaceMock) ListCalls() []struct {\n\tOpts metav1.ListOptions\n} {\n\tvar calls []struct {\n\t\tOpts metav1.ListOptions\n\t}\n\tlockProjectCatalogInterfaceMockList.RLock()\n\tcalls = mock.calls.List\n\tlockProjectCatalogInterfaceMockList.RUnlock()\n\treturn calls\n}", "title": "" }, { "docid": "6c10b22824d21d1bcf60b38463228370", "score": "0.5394976", "text": "func (m *MockNetworkServiceIface) NewListNetworksParams() *ListNetworksParams {\n\tm.ctrl.T.Helper()\n\tret := m.ctrl.Call(m, \"NewListNetworksParams\")\n\tret0, _ := ret[0].(*ListNetworksParams)\n\treturn ret0\n}", "title": "" }, { "docid": "e499d9058637d202766a55f81f1396ce", "score": "0.53882277", "text": "func (m *MockEventBridgeAPI) ListConnectionsRequest(arg0 *eventbridge.ListConnectionsInput) (*request.Request, *eventbridge.ListConnectionsOutput) {\n\tm.ctrl.T.Helper()\n\tret := m.ctrl.Call(m, \"ListConnectionsRequest\", arg0)\n\tret0, _ := ret[0].(*request.Request)\n\tret1, _ := ret[1].(*eventbridge.ListConnectionsOutput)\n\treturn ret0, ret1\n}", "title": "" }, { "docid": "d67206fd647ffcfcf4448251abdb186c", "score": "0.53861725", "text": "func (mock *RoleInterfaceMock) ListCalls() []struct {\n\tOpts metav1.ListOptions\n} {\n\tvar calls []struct {\n\t\tOpts metav1.ListOptions\n\t}\n\tlockRoleInterfaceMockList.RLock()\n\tcalls = mock.calls.List\n\tlockRoleInterfaceMockList.RUnlock()\n\treturn calls\n}", "title": "" }, { "docid": "c3b496ffaeef81a168b353be129f4807", "score": "0.53829885", "text": "func (mock *CisBenchmarkVersionInterfaceMock) ListCalls() []struct {\n\tOpts v1.ListOptions\n} {\n\tvar calls []struct {\n\t\tOpts v1.ListOptions\n\t}\n\tlockCisBenchmarkVersionInterfaceMockList.RLock()\n\tcalls = mock.calls.List\n\tlockCisBenchmarkVersionInterfaceMockList.RUnlock()\n\treturn calls\n}", "title": "" }, { "docid": "b26ab7fda4334c9f4d8e1694ecc088b2", "score": "0.53800964", "text": "func (m *MockRefreshTokenManager) List(arg0 string) ([]db.RefreshToken, error) {\n\tret := m.ctrl.Call(m, \"List\", arg0)\n\tret0, _ := ret[0].([]db.RefreshToken)\n\tret1, _ := ret[1].(error)\n\treturn ret0, ret1\n}", "title": "" }, { "docid": "5dbce7f137c7c6cdf6cd7ebccc3035ff", "score": "0.53770524", "text": "func (mock *ProjectNetworkPolicyInterfaceMock) ListNamespacedCalls() []struct {\n\tNamespace string\n\tOpts metav1.ListOptions\n} {\n\tvar calls []struct {\n\t\tNamespace string\n\t\tOpts metav1.ListOptions\n\t}\n\tlockProjectNetworkPolicyInterfaceMockListNamespaced.RLock()\n\tcalls = mock.calls.ListNamespaced\n\tlockProjectNetworkPolicyInterfaceMockListNamespaced.RUnlock()\n\treturn calls\n}", "title": "" }, { "docid": "3b14effbd60102bc8a49cfbaaa0d013c", "score": "0.53680587", "text": "func (m *MockNetworkServiceIface) UpdateNetwork(p *UpdateNetworkParams) (*UpdateNetworkResponse, error) {\n\tm.ctrl.T.Helper()\n\tret := m.ctrl.Call(m, \"UpdateNetwork\", p)\n\tret0, _ := ret[0].(*UpdateNetworkResponse)\n\tret1, _ := ret[1].(error)\n\treturn ret0, ret1\n}", "title": "" }, { "docid": "a091a0f7fecaa9fce0cfa8ace8f45dd5", "score": "0.536689", "text": "func (m *MockNetworkServiceIface) ListPhysicalNetworks(p *ListPhysicalNetworksParams) (*ListPhysicalNetworksResponse, error) {\n\tm.ctrl.T.Helper()\n\tret := m.ctrl.Call(m, \"ListPhysicalNetworks\", p)\n\tret0, _ := ret[0].(*ListPhysicalNetworksResponse)\n\tret1, _ := ret[1].(error)\n\treturn ret0, ret1\n}", "title": "" }, { "docid": "1c301b5f0510aab664150a61211480c8", "score": "0.53459597", "text": "func (m *MockVirtualNetworksPeeringsClient) List(arg0 context.Context, arg1, arg2 string) (network.VirtualNetworkPeeringListResultPage, error) {\n\tm.ctrl.T.Helper()\n\tret := m.ctrl.Call(m, \"List\", arg0, arg1, arg2)\n\tret0, _ := ret[0].(network.VirtualNetworkPeeringListResultPage)\n\tret1, _ := ret[1].(error)\n\treturn ret0, ret1\n}", "title": "" }, { "docid": "5a768686a67f33420748370e99196cfd", "score": "0.53451097", "text": "func (m *MockNetworkClient) All(arg0 context.Context) ([]*hcloud.Network, error) {\n\tm.ctrl.T.Helper()\n\tret := m.ctrl.Call(m, \"All\", arg0)\n\tret0, _ := ret[0].([]*hcloud.Network)\n\tret1, _ := ret[1].(error)\n\treturn ret0, ret1\n}", "title": "" }, { "docid": "32a0ae02f81026b22ebe04e1082a6f5f", "score": "0.53435975", "text": "func (m *MockSaldoHistoryUC) List(arg0 request.ListSaldoHistory) ([]entity.SaldoHistory, error) {\n\tm.ctrl.T.Helper()\n\tret := m.ctrl.Call(m, \"List\", arg0)\n\tret0, _ := ret[0].([]entity.SaldoHistory)\n\tret1, _ := ret[1].(error)\n\treturn ret0, ret1\n}", "title": "" }, { "docid": "01da75ac9c389ea2f55010119a667cdc", "score": "0.5343058", "text": "func (m *MockDatabase) List(arg0 Query) ([]*Blob, error) {\n\tret := m.ctrl.Call(m, \"List\", arg0)\n\tret0, _ := ret[0].([]*Blob)\n\tret1, _ := ret[1].(error)\n\treturn ret0, ret1\n}", "title": "" }, { "docid": "ee24bd0916183a64eadb6a5b3cb202bc", "score": "0.53364277", "text": "func (m *MockFirewallsService) List(arg0 string) client.FirewallsListCall {\n\tm.ctrl.T.Helper()\n\tret := m.ctrl.Call(m, \"List\", arg0)\n\tret0, _ := ret[0].(client.FirewallsListCall)\n\treturn ret0\n}", "title": "" }, { "docid": "0ec6a61aebfd6ca7e0067da7673113d9", "score": "0.5335185", "text": "func (m *MockNetworkServiceIface) ListSupportedNetworkServices(p *ListSupportedNetworkServicesParams) (*ListSupportedNetworkServicesResponse, error) {\n\tm.ctrl.T.Helper()\n\tret := m.ctrl.Call(m, \"ListSupportedNetworkServices\", p)\n\tret0, _ := ret[0].(*ListSupportedNetworkServicesResponse)\n\tret1, _ := ret[1].(error)\n\treturn ret0, ret1\n}", "title": "" }, { "docid": "0c04352f4d5ea32ae8c06169cfa0449a", "score": "0.5334157", "text": "func (m *MockFirewallsService) List(arg0 string) gcp.FirewallsListCall {\n\tm.ctrl.T.Helper()\n\tret := m.ctrl.Call(m, \"List\", arg0)\n\tret0, _ := ret[0].(gcp.FirewallsListCall)\n\treturn ret0\n}", "title": "" }, { "docid": "18b6fbb5ae5d4c1df7f8ecf1cc6615ec", "score": "0.53243667", "text": "func (m *MockEndpointConfig) NetworkPeers() []fab.NetworkPeer {\n\tm.ctrl.T.Helper()\n\tret := m.ctrl.Call(m, \"NetworkPeers\")\n\tret0, _ := ret[0].([]fab.NetworkPeer)\n\treturn ret0\n}", "title": "" }, { "docid": "1b3a21000a637359f41e8cf1f6c2079e", "score": "0.5323519", "text": "func (mock *UserInterfaceMock) ListCalls() []struct {\n\tOpts metav1.ListOptions\n} {\n\tvar calls []struct {\n\t\tOpts metav1.ListOptions\n\t}\n\tlockUserInterfaceMockList.RLock()\n\tcalls = mock.calls.List\n\tlockUserInterfaceMockList.RUnlock()\n\treturn calls\n}", "title": "" }, { "docid": "c350d6f52b8081c1033f179d0ec42d4b", "score": "0.5315764", "text": "func (m *MockTopoClient) List(ctx context.Context, in *topo.ListRequest, opts ...grpc.CallOption) (*topo.ListResponse, 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, \"List\", varargs...)\n\tret0, _ := ret[0].(*topo.ListResponse)\n\tret1, _ := ret[1].(error)\n\treturn ret0, ret1\n}", "title": "" }, { "docid": "27251ca1554c3c12a244f1295e14b701", "score": "0.5307518", "text": "func (mock *FeatureControllerMock) ListCalls() []struct {\n\tNamespace string\n\tOpts v1b.ListOptions\n} {\n\tvar calls []struct {\n\t\tNamespace string\n\t\tOpts v1b.ListOptions\n\t}\n\tlockFeatureControllerMockList.RLock()\n\tcalls = mock.calls.List\n\tlockFeatureControllerMockList.RUnlock()\n\treturn calls\n}", "title": "" }, { "docid": "f3d9ed5551500f828cb017009cd291fe", "score": "0.5305843", "text": "func (mock *ProjectNetworkPolicyControllerMock) ListerCalls() []struct {\n} {\n\tvar calls []struct {\n\t}\n\tlockProjectNetworkPolicyControllerMockLister.RLock()\n\tcalls = mock.calls.Lister\n\tlockProjectNetworkPolicyControllerMockLister.RUnlock()\n\treturn calls\n}", "title": "" }, { "docid": "13159dbad8d848bbcf9b6afe3a35366a", "score": "0.52953315", "text": "func (mock *FeatureCacheMock) ListCalls() []struct {\n\tNamespace string\n\tSelector labels.Selector\n} {\n\tvar calls []struct {\n\t\tNamespace string\n\t\tSelector labels.Selector\n\t}\n\tlockFeatureCacheMockList.RLock()\n\tcalls = mock.calls.List\n\tlockFeatureCacheMockList.RUnlock()\n\treturn calls\n}", "title": "" }, { "docid": "451c70dd7af3b759f6181d9b2be3ae2d", "score": "0.5285518", "text": "func (mr *MockAPIClientMockRecorder) NetworkList(arg0, arg1 interface{}) *gomock.Call {\n\tmr.mock.ctrl.T.Helper()\n\treturn mr.mock.ctrl.RecordCallWithMethodType(mr.mock, \"NetworkList\", reflect.TypeOf((*MockAPIClient)(nil).NetworkList), arg0, arg1)\n}", "title": "" }, { "docid": "54f6b08298eab66c86a203027d64c4b6", "score": "0.52776206", "text": "func (m *MockInstancesRepository) List(arg0 string) (map[string]*Instance, error) {\n\tret := m.ctrl.Call(m, \"List\", arg0)\n\tret0, _ := ret[0].(map[string]*Instance)\n\tret1, _ := ret[1].(error)\n\treturn ret0, ret1\n}", "title": "" }, { "docid": "fc221321c98beeba5c8d277f05242368", "score": "0.5275653", "text": "func (mock *RoleTemplateListerMock) ListCalls() []struct {\n\tNamespace string\n\tSelector labels.Selector\n} {\n\tvar calls []struct {\n\t\tNamespace string\n\t\tSelector labels.Selector\n\t}\n\tlockRoleTemplateListerMockList.RLock()\n\tcalls = mock.calls.List\n\tlockRoleTemplateListerMockList.RUnlock()\n\treturn calls\n}", "title": "" }, { "docid": "ef135e4574c952f95e917077c6159fff", "score": "0.5275054", "text": "func (mock *UserListerMock) ListCalls() []struct {\n\tNamespace string\n\tSelector labels.Selector\n} {\n\tvar calls []struct {\n\t\tNamespace string\n\t\tSelector labels.Selector\n\t}\n\tlockUserListerMockList.RLock()\n\tcalls = mock.calls.List\n\tlockUserListerMockList.RUnlock()\n\treturn calls\n}", "title": "" }, { "docid": "50b3f9f54252926250637f2225c4c4f5", "score": "0.52654296", "text": "func (m *MockNetworkServiceIface) ListNetworkServiceProviders(p *ListNetworkServiceProvidersParams) (*ListNetworkServiceProvidersResponse, error) {\n\tm.ctrl.T.Helper()\n\tret := m.ctrl.Call(m, \"ListNetworkServiceProviders\", p)\n\tret0, _ := ret[0].(*ListNetworkServiceProvidersResponse)\n\tret1, _ := ret[1].(error)\n\treturn ret0, ret1\n}", "title": "" }, { "docid": "4f82af52fbabc1e92871b04f7a91ccb3", "score": "0.52652663", "text": "func (m *MockNicServiceIface) ListNics(p *ListNicsParams) (*ListNicsResponse, error) {\n\tm.ctrl.T.Helper()\n\tret := m.ctrl.Call(m, \"ListNics\", p)\n\tret0, _ := ret[0].(*ListNicsResponse)\n\tret1, _ := ret[1].(error)\n\treturn ret0, ret1\n}", "title": "" }, { "docid": "241f5c908cab4d45e2dc210ac2caf63a", "score": "0.5263075", "text": "func (m *MockEndpointConfig) NetworkConfig() *fab.NetworkConfig {\n\tm.ctrl.T.Helper()\n\tret := m.ctrl.Call(m, \"NetworkConfig\")\n\tret0, _ := ret[0].(*fab.NetworkConfig)\n\treturn ret0\n}", "title": "" }, { "docid": "6d102bbcba6ec2ffece6f40b3013e947", "score": "0.52622557", "text": "func (m *MockEventBridgeAPI) ListEventSources(arg0 *eventbridge.ListEventSourcesInput) (*eventbridge.ListEventSourcesOutput, error) {\n\tm.ctrl.T.Helper()\n\tret := m.ctrl.Call(m, \"ListEventSources\", arg0)\n\tret0, _ := ret[0].(*eventbridge.ListEventSourcesOutput)\n\tret1, _ := ret[1].(error)\n\treturn ret0, ret1\n}", "title": "" } ]
0789010fadf0a81085160d2132647803
SaveStats saves the stats in memory to file
[ { "docid": "2094a0cf377347821ee840f2adaf7be2", "score": "0.80589247", "text": "func SaveStats() error {\n\tstatsfile := StatsFile{}\n\tif _, err := os.Stat(DataFile); os.IsNotExist(err) {\n\t\tos.Create(DataFile)\n\t}\n\tfile, err := os.Open(DataFile)\n\tif err != nil {\n\t\treturn err\n\t}\n\tdefer file.Close()\n\n\tstatsfile.Paths = Paths\n\tstatsfile.Referers = Referers\n\tstatsfile.Bytes = BytesServed\n\tstatsfile.Requests = RequestsServed\n\n\tout, err := json.MarshalIndent(statsfile, \"\", \" \")\n\tif err != nil {\n\t\treturn err\n\t}\n\treturn ioutil.WriteFile(DataFile, out, os.ModePerm)\n}", "title": "" } ]
[ { "docid": "10fa6f6f7bb93c30627d14a5e901249f", "score": "0.7492833", "text": "func saveRunnerStats(runnerStats RunnerStats) error {\n\terr := ioutil.WriteFile(makeStatsFile(runnerStats, \".json\"), runnerStats.Stats, 0644)\n\tif err != nil {\n\t\treturn err\n\t}\n\n\tcsv, err := cruncher.Crunch(cruncher.NewCSVCruncher(), runnerStats.Stats)\n\tif err != nil {\n\t\treturn err\n\t}\n\n\treturn ioutil.WriteFile(makeStatsFile(runnerStats, \".csv\"), csv, os.ModePerm)\n}", "title": "" }, { "docid": "9a7f211fec8a68be9703e6006a8dfd8e", "score": "0.70698553", "text": "func (s *Statistic) SaveToDiskFile(outPath string) error {\n\toutMap := map[string]interface{}{\n\t\t\"PeerId\": s.PeerId,\n\t\t\"NumBlockSend\": s.NumBlockSend,\n\t\t\"NumBlockRecv\":s.NumBlockRecv,\n\t\t\"NumDupBlock\": s.NumDupBlock,\n\t}\n\tjs := utils.Map2json(outMap)\n\t_, err := utils.WriteBytes(outPath, []byte(js))\n\tif err != nil {\n\t\treturn err\n\t}\n\treturn nil\n}", "title": "" }, { "docid": "96ccde0ea3141f88bd2ae257496b5de3", "score": "0.6873399", "text": "func (p *plugin) saveFile() {\n\tp.m.RLock()\n\terr := util.WriteFile(p.file, p.users, true)\n\tp.m.RUnlock()\n\n\tif err != nil {\n\t\tlog.Println(\"[stats] save:\", err)\n\t}\n}", "title": "" }, { "docid": "b50377abe1fcb93b945f0151e52848d7", "score": "0.67795694", "text": "func WriteStats(path string, hot, cold []int64) error {\n\t// Copy before sort.\n\tcold = append([]int64{}, cold...)\n\thot = append([]int64{}, hot...)\n\n\tsort.Slice(cold, func(i, j int) bool { return cold[i] < cold[j] })\n\tsort.Slice(hot, func(i, j int) bool { return hot[i] < hot[j] })\n\n\tpackedCold, err := Pack(cold)\n\tif err != nil {\n\t\treturn errors.Annotate(err, \"failed to pack uploaded items\").Err()\n\t}\n\n\tpackedHot, err := Pack(hot)\n\tif err != nil {\n\t\treturn errors.Annotate(err, \"failed to pack not uploaded items\").Err()\n\t}\n\n\tstatsJSON, err := json.Marshal(struct {\n\t\tItemsCold []byte `json:\"items_cold\"`\n\t\tItemsHot []byte `json:\"items_hot\"`\n\t}{\n\t\tItemsCold: packedCold,\n\t\tItemsHot: packedHot,\n\t})\n\tif err != nil {\n\t\treturn errors.Annotate(err, \"failed to marshal stats json\").Err()\n\t}\n\tif err := ioutil.WriteFile(path, statsJSON, 0600); err != nil {\n\t\treturn errors.Annotate(err, \"failed to write stats json\").Err()\n\t}\n\n\treturn nil\n}", "title": "" }, { "docid": "72759107bac710db477f1d32fbecc052", "score": "0.6767174", "text": "func statsToFile(stats string, dir string) error {\n\n\t// Create a directory using current date\n\t// get current date\n\tdt := time.Now()\n\n\t// forge base dir\n\tbasedir := fmt.Sprintf(\"%s/%s\", dir, dt.Format(\"2006-01-02\"))\n\t// create base dir if not exists\n\tif _, err := os.Stat(basedir); os.IsNotExist(err) {\n\t\tos.Mkdir(basedir, 0755)\n\t}\n\n\t// Create file\n\tf, err := os.Create(fmt.Sprintf(\"%s/stats\", basedir))\n\tif err != nil {\n\t\treturn err\n\t}\n\t// Ensure file is closed at the end of the func\n\tdefer f.Close()\n\n\t// Write stuff and return err\n\t_, err = f.WriteString(stats)\n\n\treturn err\n\n}", "title": "" }, { "docid": "011b79b7c576561b2868f27b9ffee118", "score": "0.66039664", "text": "func (s *Statistic) SaveToDisk(outDir string) error {\n\tok, err := utils.PathExists(outDir)\n\tif err != nil {\n\t\treturn err\n\t}\n\tif !ok {\n\t\terr = os.Mkdir(outDir, os.ModePerm); if err != nil {return err}\n\t}\n\n\tfilePath := path.Join(outDir, s.PeerId + \".json\")\n\terr = s.SaveToDiskFile(filePath)\n\tif err != nil {\n\t\treturn err\n\t}\n\treturn nil\n}", "title": "" }, { "docid": "214b2f7140fd226a4118e7cff7315eef", "score": "0.6555297", "text": "func writeStats(to *os.File, final bool, s, t stats.Stats) {\n\tp := fmt.Fprintf\n\tpn := prettyNumber\n\tpb := prettyNumBytes\n\tpl := prettyLatency\n\tpt := prettyTimeStamp\n\tif final {\n\t\twriteStatsHeader(to)\n\t\tp(to, statsPrintHeader, pt(), \"Put\",\n\t\t\tpn(t.TotalPuts()),\n\t\t\tpb(t.TotalPutBytes()),\n\t\t\tpl(t.MinPutLatency(), t.AvgPutLatency(), t.MaxPutLatency()),\n\t\t\tpb(t.PutThroughput(time.Now())),\n\t\t\tpn(t.TotalErrPuts()))\n\t\tp(to, statsPrintHeader, pt(), \"Get\",\n\t\t\tpn(t.TotalGets()),\n\t\t\tpb(t.TotalGetBytes()),\n\t\t\tpl(t.MinGetLatency(), t.AvgGetLatency(), t.MaxGetLatency()),\n\t\t\tpb(t.GetThroughput(time.Now())),\n\t\t\tpn(t.TotalErrGets()))\n\t} else {\n\t\t// show interval stats; some fields are shown of both interval and total, for example, gets, puts, etc\n\t\tif s.TotalPuts() != 0 {\n\t\t\tp(to, statsPrintHeader, pt(), \"Put\",\n\t\t\t\tpn(s.TotalPuts())+\"(\"+pn(t.TotalPuts())+\")\",\n\t\t\t\tpb(s.TotalPutBytes())+\"(\"+pb(t.TotalPutBytes())+\")\",\n\t\t\t\tpl(s.MinPutLatency(), s.AvgPutLatency(), s.MaxPutLatency()),\n\t\t\t\tpb(s.PutThroughput(time.Now()))+\"(\"+pb(t.PutThroughput(time.Now()))+\")\",\n\t\t\t\tpn(s.TotalErrPuts())+\"(\"+pn(t.TotalErrPuts())+\")\")\n\t\t}\n\t\tif s.TotalGets() != 0 {\n\t\t\tp(to, statsPrintHeader, pt(), \"Get\",\n\t\t\t\tpn(s.TotalGets())+\"(\"+pn(t.TotalGets())+\")\",\n\t\t\t\tpb(s.TotalGetBytes())+\"(\"+pb(t.TotalGetBytes())+\")\",\n\t\t\t\tpl(s.MinGetLatency(), s.AvgGetLatency(), s.MaxGetLatency()),\n\t\t\t\tpb(s.GetThroughput(time.Now()))+\"(\"+pb(t.GetThroughput(time.Now()))+\")\",\n\t\t\t\tpn(s.TotalErrGets())+\"(\"+pn(t.TotalErrGets())+\")\")\n\t\t}\n\t}\n}", "title": "" }, { "docid": "0f6880747616c882443c0f2e9992e0c6", "score": "0.63355786", "text": "func (s *StressReport) Save(filename string, name string) error {\n\tvar reports StressReports\n\tif err := reports.Load(filename); err != nil {\n\t\treports = map[string]*StressReport{\n\t\t\tname: s,\n\t\t}\n\t} else {\n\t\treports[name] = s\n\t}\n\n\tfmt.Printf(\"Writing reports in %s\\n\", filename)\n\n\tj, _ := json.Marshal(reports)\n\treturn os.WriteFile(filename, j, 0644)\n}", "title": "" }, { "docid": "929d10943ea62d929c1c4c21527c39f8", "score": "0.6331411", "text": "func (v *visitor) saveFile(\n\tctx context.Context,\n\tn *fsNode) (scores []blob.Score, err error) {\n\t// Can we short circuit here using the score map?\n\tscoreMapKey := makeScoreMapKey(n, v.clock)\n\tif scoreMapKey != nil {\n\t\tscores = v.scoreMap.Get(*scoreMapKey)\n\t\tif scores != nil {\n\t\t\treturn\n\t\t}\n\t}\n\n\t// Ensure that our result will be non-nil, even for the empty list.\n\tscores = make([]blob.Score, 0, 1)\n\n\t// Open the file for reading.\n\tf, err := os.Open(path.Join(v.basePath, n.RelPath))\n\tif err != nil {\n\t\terr = fmt.Errorf(\"Open: %v\", err)\n\t\treturn\n\t}\n\n\tdefer f.Close()\n\n\t// Process a chunk at a time.\n\tfor {\n\t\tvar s blob.Score\n\t\ts, err = v.saveFileChunk(ctx, f)\n\n\t\tif err == io.EOF {\n\t\t\terr = nil\n\t\t\tbreak\n\t\t}\n\n\t\tif err != nil {\n\t\t\treturn\n\t\t}\n\n\t\tscores = append(scores, s)\n\t}\n\n\t// Update the score map if the file is eligible.\n\tif scoreMapKey != nil {\n\t\tv.scoreMap.Set(*scoreMapKey, scores)\n\t}\n\n\treturn\n}", "title": "" }, { "docid": "2fa336aa89914e8d2bec03b653de4653", "score": "0.63016105", "text": "func writeStatsToFile(posts []model.RedditPost) error {\n\n\tgroupedPosts := groupBySubreddit(posts)\n\n\tcountList := [][]model.RedditPost{}\n\n\t// convert to list\n\tfor _, v := range groupedPosts {\n\t\tcountList = append(countList, v)\n\t}\n\n\t// sort by post count\n\tsort.Slice(countList, func(i, j int) bool {\n\t\treturn len(countList[i]) > len(countList[j])\n\t})\n\n\tdata := [][]string{}\n\n\tfor _, v := range countList {\n\t\tescapedTitle := strings.ReplaceAll(v[0].Title, \"|\", \"\\\\|\")\n\t\ttitle := \"[\" + escapedTitle + \"]\" + \"(https://www.reddit.com\" + v[0].Permalink + \")\"\n\t\tdata = append(data, []string{v[0].Subreddit, strconv.Itoa(len(v)), title, strconv.Itoa(v[0].Score)})\n\t}\n\n\tfile, _ := os.Create(\"README.md\")\n\n\ttable := tablewriter.NewWriter(file)\n\ttable.SetAutoWrapText(false)\n\ttable.SetHeader([]string{\"Subreddit\", \"Total\", \"Top Post\", \"Score\"})\n\ttable.SetBorders(tablewriter.Border{Left: true, Top: false, Right: true, Bottom: false})\n\ttable.SetCenterSeparator(\"|\")\n\ttable.AppendBulk(data) // Add Bulk Data\n\ttable.Render()\n\n\treturn nil\n}", "title": "" }, { "docid": "9454bba329f9c056e20296ba0b4dd65c", "score": "0.61022526", "text": "func (hist *Histogram) WriteStatsTo(w io.Writer) (int64, error) {\n\tn, err := fmt.Fprintf(w, \" avg %v; min %v; p50 %v; max %v;\\n p90 %v; p99 %v; p999 %v; p9999 %v;\\n\",\n\t\ttime.Duration(truncate(hist.Average, 3)),\n\t\ttime.Duration(truncate(hist.Minimum, 3)),\n\t\ttime.Duration(truncate(hist.P50, 3)),\n\t\ttime.Duration(truncate(hist.Maximum, 3)),\n\n\t\ttime.Duration(truncate(hist.P90, 3)),\n\t\ttime.Duration(truncate(hist.P99, 3)),\n\t\ttime.Duration(truncate(hist.P999, 3)),\n\t\ttime.Duration(truncate(hist.P9999, 3)),\n\t)\n\treturn int64(n), err\n}", "title": "" }, { "docid": "4726338ba9fe53288be7cec72dc3cf50", "score": "0.6088107", "text": "func (bi *BridgerInfo) writeStatsFile(fpath string, ins *zstypes.InsCacheInfo) (map[string]string, uint64, uint64, error) {\n\ttbytes := uint64(0)\n\n\tfp, err := os.OpenFile(fpath, os.O_WRONLY|os.O_CREATE, 0644)\n\tvar ntstamps = uint64(0)\n\tif err != nil {\n\t\treturn nil, ntstamps, tbytes, err\n\t}\n\tdefer func() {\n\t\terr := fp.Close()\n\t\tif err != nil {\n\t\t\tzlog.Error(\"Failed to close file %s, err %s\", fpath, err)\n\t\t}\n\t}()\n\n\tw, err := gzip.NewWriterLevel(fp, gzip.BestSpeed)\n\tif err != nil {\n\t\tzlog.Error(\"Could not create gzip writer for file %s err %s\", fpath, err)\n\t\treturn nil, ntstamps, tbytes, err\n\t}\n\n\tclblsMap := make(map[string]string) // Common labels map.\n\tif len(ins.Samples) > 0 {\n\t\tfor i := 0; i < len(ins.Samples[0].Ls); i++ {\n\t\t\tclblsMap[ins.Samples[0].Ls[i].Name] = ins.Samples[0].Ls[i].Value\n\t\t}\n\t}\n\tfor _, s := range ins.Samples {\n\t\ttbytes += uint64(len(s.Help) + len(s.Type) + 16)\n\t\tfor _, clbl := range s.Ls {\n\t\t\ttbytes += uint64(len(clbl.Name) + len(clbl.Value))\n\t\t\tval, isok := clblsMap[clbl.Name]\n\t\t\tif isok && val != clbl.Value {\n\t\t\t\tdelete(clblsMap, clbl.Name)\n\t\t\t}\n\t\t}\n\t}\n\n\tlmName := \"\"\n\tfor _, s := range ins.Samples {\n\t\toname := s.Ls.Get(labels.MetricName)\n\t\tif len(oname) == 0 {\n\t\t\tzlog.Warn(\"Missing metric name for sample %v\", s)\n\t\t\tcontinue\n\t\t}\n\t\tname, slabel := bi.adjustMetricName(oname, s.Ls, s.Type)\n\t\tif len(slabel) > 0 {\n\t\t\tdelete(clblsMap, slabel)\n\t\t}\n\n\t\tbaseMname := name\n\t\tif s.Type == \"summary\" {\n\t\t\tif strings.HasSuffix(baseMname, \"_sum\") {\n\t\t\t\tbaseMname = strings.TrimSuffix(baseMname, \"_sum\")\n\t\t\t} else if strings.HasSuffix(baseMname, \"_count\") {\n\t\t\t\tbaseMname = strings.TrimSuffix(baseMname, \"_count\")\n\t\t\t}\n\t\t} else if s.Type == \"histogram\" {\n\t\t\tif strings.HasSuffix(baseMname, \"_sum\") {\n\t\t\t\tbaseMname = strings.TrimSuffix(baseMname, \"_sum\")\n\t\t\t} else if strings.HasSuffix(baseMname, \"_count\") {\n\t\t\t\tbaseMname = strings.TrimSuffix(baseMname, \"_count\")\n\t\t\t} else if strings.HasSuffix(baseMname, \"_bucket\") {\n\t\t\t\tbaseMname = strings.TrimSuffix(baseMname, \"_bucket\")\n\t\t\t}\n\t\t}\n\n\t\tif lmName != baseMname {\n\t\t\tfmt.Fprintf(w, \"# HELP %s %s\\n\", baseMname, s.Help)\n\t\t\tif s.Type == \"unknown\" {\n\t\t\t\tfmt.Fprintf(w, \"# TYPE %s %s\\n\", baseMname, \"untyped\")\n\t\t\t} else {\n\t\t\t\tfmt.Fprintf(w, \"# TYPE %s %s\\n\", baseMname, s.Type)\n\t\t\t}\n\t\t}\n\t\tif s.Ts != ins.DTs {\n\t\t\tntstamps++\n\t\t\tfmt.Fprintf(w, \"%s%s %f %d\\n\", name, bi.getLocalLabelsString(clblsMap, s.Ls, slabel), s.Val, s.Ts)\n\t\t} else {\n\t\t\tfmt.Fprintf(w, \"%s%s %f\\n\", name, bi.getLocalLabelsString(clblsMap, s.Ls, slabel), s.Val)\n\t\t}\n\n\t\tlmName = baseMname\n\t}\n\n\terr = w.Close()\n\tif err != nil {\n\t\tzlog.Error(\"Could not close gzip writer for file %s err %s\", fpath, err)\n\t\treturn nil, ntstamps, tbytes, err\n\t}\n\n\treturn clblsMap, ntstamps, tbytes, err\n}", "title": "" }, { "docid": "823783bf3cf18d506a6688a6b2feac16", "score": "0.60042906", "text": "func (m *settings) saveToDisk() error {\n\tb, err := json.Marshal(m.redirects)\n\tif err != nil {\n\t\tlog.Printf(\"Error marshalling %s\", err)\n\t\treturn fmt.Errorf(\"error marshalling %s\", err)\n\t}\n\n\tif err := ioutil.WriteFile(m.filename, b, 0644); err != nil {\n\t\treturn fmt.Errorf(\"unable to open file %s\", err)\n\t}\n\tlog.Printf(\"saving to disk.\")\n\treturn nil\n}", "title": "" }, { "docid": "cd500f45d1cbb01aec9ddf0eb580559d", "score": "0.5999009", "text": "func (self *botStats) save(t db.Table, index int) error {\n\tkey := fmt.Sprintf(\"%s-%2d\",botStatsRecordKey,index)\n\treturn t.Put(key,self)\n}", "title": "" }, { "docid": "c009188a8f3d3a174aaab88d0142b294", "score": "0.59981173", "text": "func (r *RepoGob) Save(s *models.Counter) error {\n\n\tif s == nil {\n\t\treturn errors.New(\"counter struct not specified\")\n\t}\n\n\tbuf := new(bytes.Buffer)\n\tenc := gob.NewEncoder(buf)\n\terr := enc.Encode(s)\n\tif err != nil {\n\t\treturn err\n\t}\n\n\terr = ioutil.WriteFile(r.path, buf.Bytes(), 0600)\n\tif err != nil {\n\t\treturn err\n\t}\n\n\treturn nil\n}", "title": "" }, { "docid": "3045873f62f6e4ba16b347be37969c51", "score": "0.5987562", "text": "func (m *Nitro) DumpStats() string {\n\treturn m.aggrStoreStats().String()\n}", "title": "" }, { "docid": "d18c78bd6bc926ecaeef3d178cfc4df8", "score": "0.5880325", "text": "func (m *metricsMap) save(id string, metrics *docker.ContainerStats) {\n\tm.Lock()\n\tdefer m.Unlock()\n\n\tm.metrics[id] = metrics\n}", "title": "" }, { "docid": "612380bb72ae1b3d75c25cd1de2a0b7e", "score": "0.5866505", "text": "func writeStatsHeader(to *os.File) {\n\tfmt.Fprintln(to)\n\tfmt.Fprintf(to, statsPrintHeader,\n\t\t\"Time\", \"OP\", \"Count\", \"Total Bytes\", \"Latency(min, avg, max)\", \"Throughput\", \"Error\")\n}", "title": "" }, { "docid": "ef044df92ca79e3f365f3b7616f1a008", "score": "0.5863062", "text": "func (fcb *FileCacheBackend) Save(ob types.OutgoingBatch) error {\n\tfilename := fcb.getFilename(fcb.getCacheFilename(ob))\n\tlog.Printf(\"Saving to %s\", filename)\n\tfile, err := os.OpenFile(filename, os.O_CREATE|os.O_WRONLY|os.O_EXCL, 0600)\n\tif err != nil {\n\t\treturn fmt.Errorf(\"Unable to save to %s - %s\", filename, err)\n\t}\n\tdefer file.Close()\n\tfor _, item := range ob.Values {\n\t\tfile.WriteString(item + \"\\n\")\n\t}\n\treturn nil\n}", "title": "" }, { "docid": "6a2b4c09db15ad69b452a130a2398d6c", "score": "0.5843589", "text": "func (st *Store) SaveBaseStats(bucket []byte, dateKey []byte, data Stats) error {\n\t// TODO: needs error checking\n\t//sorted := data.ToSlice(0)\n\n\treturn st.db.Batch(func(tx *bolt.Tx) error {\n\t\tb := tx.Bucket(bucket)\n\t\traw := b.Get(dateKey)\n\n\t\tworker := Stats{}\n\t\tjson.Unmarshal(raw, &worker)\n\n\t\t// walk through the new data\n\t\tfor key, value := range data {\n\t\t\t// if stored worker[i] exists, I need to add data[i] value to it.\n\t\t\tif wVal, ok := worker[key]; ok {\n\t\t\t\tworker[key] = wVal + value\n\t\t\t} else { // if it doesn't exist, I need to create it\n\t\t\t\tworker[key] = value\n\t\t\t}\n\t\t}\n\n\t\t// save stats back up and insert it into the dtabase\n\t\tbuf, err := json.Marshal(worker)\n\t\tif err != nil {\n\t\t\treturn err\n\t\t}\n\n\t\tb.Put(dateKey, buf)\n\n\t\treturn nil\n\t})\n}", "title": "" }, { "docid": "766c5ee2a9c4394daed0494aa443bcbf", "score": "0.58129203", "text": "func (store Store) WriteStat(w io.Writer) error {\n\treturn store.db.View(func(tx *bolt.Tx) error {\n\t\tusers := tx.Bucket(bucket.RegisterDates).Stats().KeyN\n\t\tsubscriptions := tx.Bucket(bucket.Subscriptions).Stats().KeyN\n\t\tdbSize := float64(tx.Size()) / 1024.0 / 1024.0 // in mb\n\n\t\tphrasesTotal := tx.Bucket(bucket.Phrases).Stats().KeyN\n\t\tphrasesAvg := phrasesTotal / users\n\n\t\tscoretotal, err := sum(tx.Bucket(bucket.Scoretotals), simplesum)\n\t\tif err != nil {\n\t\t\treturn err\n\t\t}\n\t\tscoretotalAvg := scoretotal / users\n\n\t\tstudiesTotal := tx.Bucket(bucket.Studies).Stats().KeyN\n\t\tstudiesAvg := studiesTotal / users\n\n\t\tnow := itob(time.Now().Unix())\n\t\tdueStudiesTotal, err := sum(tx.Bucket(bucket.Studytimes), func(v []byte) int {\n\t\t\tif bytes.Compare(v, now) < 1 {\n\t\t\t\treturn 1\n\t\t\t}\n\t\t\treturn 0\n\t\t})\n\t\tif err != nil {\n\t\t\treturn err\n\t\t}\n\t\tdueStudiesAvg := dueStudiesTotal / users\n\n\t\timportsTotal, err := sum(tx.Bucket(bucket.Imports), simplesum)\n\t\tif err != nil {\n\t\t\treturn err\n\t\t}\n\t\timportsAvg := importsTotal / users\n\n\t\tnotifiesTotal, err := sum(tx.Bucket(bucket.Notifies), simplesum)\n\t\tif err != nil {\n\t\t\treturn err\n\t\t}\n\t\tnotifiesAvg := notifiesTotal / users\n\n\t\tzeroscore, err := sum(tx.Bucket(bucket.Zeroscores), simplesum)\n\t\tif err != nil {\n\t\t\treturn err\n\t\t}\n\t\tzeroscoreAvg := zeroscore / users\n\n\t\tnewphrasesTotal, err := sum(tx.Bucket(bucket.NewPhrases), count64)\n\t\tif err != nil {\n\t\t\treturn err\n\t\t}\n\t\tnewphrasesAvg := newphrasesTotal / users\n\n\t\twarnings := \"\"\n\t\tnotNewPhrases := phrasesTotal - newphrasesTotal\n\t\tif n := tx.Bucket(bucket.Studytimes).Stats().KeyN; n != notNewPhrases {\n\t\t\twarnings += fmt.Sprintf(\"\\nWARNING: Number of studytimes (%d) does not match phrases - newphrases (%d).\\n\", n, notNewPhrases)\n\t\t}\n\t\tif n := tx.Bucket(bucket.PhraseAddTimes).Stats().KeyN; n != phrasesTotal {\n\t\t\twarnings += fmt.Sprintf(\"\\nWARNING: Number of phraseaddtimes (%d) does not match number of phrases (%d).\\n\", n, phrasesTotal)\n\t\t}\n\n\t\tfmt.Fprintf(\n\t\t\tw, statmsg, users, subscriptions, dbSize,\n\t\t\tphrasesTotal, phrasesAvg,\n\t\t\tscoretotal, scoretotalAvg,\n\t\t\tstudiesTotal, studiesAvg,\n\t\t\tdueStudiesTotal, dueStudiesAvg,\n\t\t\timportsTotal, importsAvg,\n\t\t\tnotifiesTotal, notifiesAvg,\n\t\t\tzeroscore, zeroscoreAvg,\n\t\t\tnewphrasesTotal, newphrasesAvg,\n\t\t\twarnings,\n\t\t)\n\t\treturn nil\n\t})\n}", "title": "" }, { "docid": "aa910b3f4a6b47f8458a7e54c74edfc2", "score": "0.57858515", "text": "func (d deck) saveToFile(fileName string) error {\n\treturn ioutil.WriteFile(fileName, []byte(d.toString()), 0776)\n}", "title": "" }, { "docid": "0d10c8e3c24e5519a0186fe8964f885d", "score": "0.5741439", "text": "func saveValues(v map[float64]float64) {\n\tvar data []byte\n\tfor t, y := range v {\n\t\tdata = append(data, []byte(fmt.Sprintf(\"%f, %f\\n\", t, y))...)\n\t}\n\tioutil.WriteFile(*filename, data, 0644)\n}", "title": "" }, { "docid": "5014816e4f7983be9573887c9a07a619", "score": "0.57091343", "text": "func (a *Network) Save(path string) {\n\tioutil.WriteFile(path, []byte(a.outputFormat()), 0666)\n}", "title": "" }, { "docid": "42fabfddbb8d1eb4aa222991607ef6f2", "score": "0.5689898", "text": "func (d deck) saveToFile(filename string) error {\n\treturn ioutil.WriteFile(filename, []byte(d.toString()), 0666)\n}", "title": "" }, { "docid": "42fabfddbb8d1eb4aa222991607ef6f2", "score": "0.5689898", "text": "func (d deck) saveToFile(filename string) error {\n\treturn ioutil.WriteFile(filename, []byte(d.toString()), 0666)\n}", "title": "" }, { "docid": "42fabfddbb8d1eb4aa222991607ef6f2", "score": "0.5689898", "text": "func (d deck) saveToFile(filename string) error {\n\treturn ioutil.WriteFile(filename, []byte(d.toString()), 0666)\n}", "title": "" }, { "docid": "42fabfddbb8d1eb4aa222991607ef6f2", "score": "0.5689898", "text": "func (d deck) saveToFile(filename string) error {\n\treturn ioutil.WriteFile(filename, []byte(d.toString()), 0666)\n}", "title": "" }, { "docid": "b8128dafbad6a17e5003f7ae2ae339d7", "score": "0.56824845", "text": "func (sm *ShardMaster) writeScores(scores [NShards]int, heard map[int64]int){\n\ttoWrite := JSONScore{Scores: scores}\n\tnewHeard := make(map[string]int)\n\tfor gid, val := range heard {\n\t\tnewHeard[strconv.FormatInt(gid, 10)] = val\n\t}\n\ttoWrite.Heard = newHeard\n\n\tb, err := json.Marshal(toWrite)\n\tif err != nil {\n\t\tlog.Fatal(err)\n\t}\n\tf, err2 := os.OpenFile(sm.scoreFile, os.O_WRONLY|os.O_CREATE, 0666)\n\tif err2 != nil {\n\t\tlog.Fatal(err2)\n\t}\n\tdefer f.Close()\n\t_, err = f.WriteString(string(b))\n}", "title": "" }, { "docid": "32accd14967791c785277f02d8462144", "score": "0.5682152", "text": "func savingFile(states AllStates, ID string) {\n\tfile, err := os.Create(\"elevator_states.txt\") //Creates file that will only contain latest data\n\t//checks for errors and saves to file as JSON\n\tcheck(err)\n\te := json.NewEncoder(file).Encode(states) //saves the AllStates struct to file\n\tcheck(e)\n}", "title": "" }, { "docid": "e6b1b5a79ee9bd7745506f1a71410f91", "score": "0.5674926", "text": "func (d deck) saveToFile(filename string) error {\n\treturn ioutil.WriteFile(filename, []byte(d.toString()), 0666) //0666 is a default permission\n}", "title": "" }, { "docid": "f2b8bea7820ded8734e8a1471b57f582", "score": "0.56556755", "text": "func (s *Store) Stats() []byte {\n\tb, _ := json.Marshal(s.BasicStats)\n\treturn b\n}", "title": "" }, { "docid": "e874a58c2c6adfe7a667e7f9d8166aa6", "score": "0.5655575", "text": "func (d deck) saveToFile(fileName string) error{\n\n\t// WriteFile (filename, [] byte, permission)\n\treturn ioutil.WriteFile(fileName, []byte (d.toString()), 0666)\n}", "title": "" }, { "docid": "bb43b05ac635bd663404e9a81e8930a5", "score": "0.56507933", "text": "func (s *server) saveMetrics() error {\n\n\tDefaultLogger.log(\"Save portfolio metrics\")\n\t// live metrics\n\tif err := DefaultMetrics.SavePortfolioMetrics(s.livePortfolio); err != nil {\n\t\treturn err\n\t}\n\n\t// simulated portfolio metrics\n\tfor _, simulation := range s.simulations {\n\t\tif err := DefaultMetrics.SavePortfolioMetrics(simulation.portfolio); err != nil {\n\t\t\treturn err\n\t\t}\n\t}\n\n\treturn nil\n}", "title": "" }, { "docid": "641df7e2d0806a861a457d2d6ac8ead6", "score": "0.5648948", "text": "func SaveTimeline(file *os.File, run *int, NInfected *int) {\n\tfmt.Fprintf(file, \"%v,%v\\n\", *run, *NInfected)\n\treturn\n}", "title": "" }, { "docid": "d6059c1185d1f52da83fcbfb1a05a513", "score": "0.5640328", "text": "func (s store) Save() {\n\ts.writeToDisk()\n}", "title": "" }, { "docid": "1dc685502cfdf4b8473348a25b98b908", "score": "0.5631282", "text": "func (d deck) saveToFile(filename string) error {\n\treturn ioutil.WriteFile(filename, []byte(d.toString()), 0755)\n}", "title": "" }, { "docid": "a21784f5d79bdbe15fde8a0f8630b43e", "score": "0.5615712", "text": "func Save(jsonfile string, m map[string][]PimpMiner) {\n\tjson, err := json.Marshal(m)\n\tcheckErr(err)\n\tf, err := os.Create(jsonfile)\n\tcheckErr(err)\n\tdefer f.Close()\n\tout := []byte(PrettyPrint(string(json)))\n\tf.Write(out)\n}", "title": "" }, { "docid": "a09538ca318f7b3395019c16017fb388", "score": "0.5606177", "text": "func (d deck) saveToFile(filename string) error {\n\t//convert the d deck to single string (toString) and then convert to []byte slice and finally WritesFile create the file\n\treturn ioutil.WriteFile(filename, []byte(d.toString()), 0666)\n}", "title": "" }, { "docid": "8b8dabfa1e164a1b4a6d3d51fcd6f8e7", "score": "0.5602978", "text": "func (db *Database) SaveKeyServerStats(stats *KeyServerStats) error {\n\treturn db.db.Save(stats).Error\n}", "title": "" }, { "docid": "1b06a8fddf854cf7ed02a86cb9856465", "score": "0.5601559", "text": "func (d deck) saveTofile(filename string) error {\n\treturn ioutil.WriteFile(filename, []byte(d.toString()), 0666)\n}", "title": "" }, { "docid": "d4f692581035d8133b70d0574ac2f3c9", "score": "0.5585973", "text": "func (cm *ClosestMatch) Save(filename string) error {\n\tf, err := os.Create(filename)\n\tif err != nil {\n\t\treturn err\n\t}\n\tdefer f.Close()\n\tenc := gob.NewEncoder(f)\n\treturn enc.Encode(cm)\n}", "title": "" }, { "docid": "fc42041245b82983606a1978b542395a", "score": "0.55810404", "text": "func (h *Handle) DumpStatsToJSON(dbName string, tableInfo *model.TableInfo) (*JSONTable, error) {\n\ttbl, err := h.tableStatsFromStorage(tableInfo, true)\n\tif err != nil {\n\t\treturn nil, errors.Trace(err)\n\t}\n\tjsonTbl := &JSONTable{\n\t\tDatabaseName: dbName,\n\t\tTableName: tableInfo.Name.L,\n\t\tColumns: make(map[string]*jsonColumn, len(tbl.Columns)),\n\t\tIndices: make(map[string]*jsonColumn, len(tbl.Indices)),\n\t\tCount: tbl.Count,\n\t\tModifyCount: tbl.ModifyCount,\n\t\tVersion: tbl.Version,\n\t}\n\tfor _, col := range tbl.Columns {\n\t\thist, err := col.ConvertTo(new(stmtctx.StatementContext), types.NewFieldType(mysql.TypeBlob))\n\t\tif err != nil {\n\t\t\treturn nil, errors.Trace(err)\n\t\t}\n\t\tjsonTbl.Columns[col.Info.Name.L] = dumpJSONCol(hist, col.CMSketch)\n\t}\n\n\tfor _, idx := range tbl.Indices {\n\t\tjsonTbl.Indices[idx.Info.Name.L] = dumpJSONCol(&idx.Histogram, idx.CMSketch)\n\t}\n\treturn jsonTbl, nil\n}", "title": "" }, { "docid": "75235032a8d518f9102c9a51b45bab8b", "score": "0.5568677", "text": "func printStats(stats []statisic, hash string) {\n\tw := tabwriter.NewWriter(os.Stdout, 0, 0, 1, ' ', tabwriter.AlignRight|tabwriter.Debug)\n\n\tfmt.Fprintf(w, \"%s(w=%d):\\n\", hash, sketchWidth)\n\tfmt.Fprintf(w, \"data set\\tmax. abs.\\tavg. abs.\\tmax. rel.\\tavg. rel.\\t# exact\\n\")\n\n\tfor i := 0; i < len(stats); i++ {\n\t\tstat := stats[i]\n\t\tfmt.Fprintf(w, \"%s\\t%d\\t%d\\t%.2f\\t%.2f\\t%d\\n\", filePaths[i], stat.maxAbs, stat.avgAbs, stat.maxRel, stat.avgRel, 100-stat.misses)\n\t}\n\tfmt.Fprintln(w)\n\tw.Flush()\n}", "title": "" }, { "docid": "aba0edcedd88b4f4271b90478e856838", "score": "0.5547512", "text": "func (file *File) Save() error {\n\tif file.path == \":memory:\" {\n\t\treturn nil\n\t}\n\n\t// Maybe an easier way is to use ioutil.WriteFile\n\tfp, err := os.OpenFile(file.path, os.O_TRUNC|os.O_WRONLY|os.O_CREATE, 0644)\n\tif err != nil {\n\t\treturn err\n\t}\n\tdefer fp.Close()\n\n\tif len(file.cache) == 0 {\n\t\tfp.WriteString(\"\\n\")\n\t\treturn nil\n\t}\n\n\tfor _, alias := range file.cache {\n\t\tfp.WriteString(alias.String() + \"\\n\")\n\t}\n\n\treturn nil\n}", "title": "" }, { "docid": "09b7943a77833ea735d9f65899ea5105", "score": "0.55367625", "text": "func (d deck) saveToFile(filename string) error {\n\ts := d.toString()\n\tdeckAsByteSlice := []byte(s)\n\treturn ioutil.WriteFile(filename, deckAsByteSlice, 0666)\n}", "title": "" }, { "docid": "23377e847d41fdb1051b04323f0ebd70", "score": "0.55334324", "text": "func (znp *Znp) SysZDiagsSaveStatsToNv() (rsp *SysZDiagsSaveStatsToNvResponse, err error) {\n\terr = znp.ProcessRequest(unp.C_SREQ, unp.S_SYS, 0x1B, nil, &rsp)\n\treturn\n}", "title": "" }, { "docid": "9b45fa031d02df09ce8e964404973fb2", "score": "0.5530352", "text": "func Serialize(stts *structs.DiskStats) (p []byte, err error) {\n\tstdMu.Lock()\n\tdefer stdMu.Unlock()\n\tif std == nil {\n\t\tstd, err = NewProfiler()\n\t\tif err != nil {\n\t\t\treturn nil, err\n\t\t}\n\t}\n\treturn std.Serialize(stts), nil\n}", "title": "" }, { "docid": "77391a9abcffb52a94829ceff3525d57", "score": "0.5528785", "text": "func (h *History) WriteFile(path string) error {\n\tfile, err := os.Create(path + \".csv\")\n\tif err != nil {\n\t\treturn err\n\t}\n\tdefer file.Close()\n\n\tw := bufio.NewWriter(file)\n\th.RLock()\n\tdefer h.RUnlock()\n\n\tsort.Sort(byTime(h.operations))\n\n\tlatency := 0.0\n\tthroughput := 0\n\ts := 1.0\n\tfor _, o := range h.operations {\n\t\tstart := float64(o.start) / 1000000000.0\n\t\tend := float64(o.end) / 1000000000.0\n\t\tfmt.Fprintf(w, \"%v,%v,%f,%f\\n\", o.input, o.output, start, end)\n\t\tlatency += end - start\n\t\tthroughput++\n\t\tif end > s {\n\t\t\tfmt.Fprintf(w, \"PerSecond %f %d\\n\", latency/float64(throughput)*1000.0, throughput)\n\t\t\tlatency = 0\n\t\t\tthroughput = 0\n\t\t\ts++\n\t\t}\n\n\t\t// fmt.Fprintln(w, o)\n\t}\n\n\t// for k, ops := range h.shard {\n\t// \tfmt.Fprintf(w, \"key=%d\\n\", k)\n\t// \tfor _, o := range ops {\n\t// \t\tfmt.Fprintln(w, o)\n\t// \t}\n\t// }\n\treturn w.Flush()\n}", "title": "" }, { "docid": "77391a9abcffb52a94829ceff3525d57", "score": "0.5528785", "text": "func (h *History) WriteFile(path string) error {\n\tfile, err := os.Create(path + \".csv\")\n\tif err != nil {\n\t\treturn err\n\t}\n\tdefer file.Close()\n\n\tw := bufio.NewWriter(file)\n\th.RLock()\n\tdefer h.RUnlock()\n\n\tsort.Sort(byTime(h.operations))\n\n\tlatency := 0.0\n\tthroughput := 0\n\ts := 1.0\n\tfor _, o := range h.operations {\n\t\tstart := float64(o.start) / 1000000000.0\n\t\tend := float64(o.end) / 1000000000.0\n\t\tfmt.Fprintf(w, \"%v,%v,%f,%f\\n\", o.input, o.output, start, end)\n\t\tlatency += end - start\n\t\tthroughput++\n\t\tif end > s {\n\t\t\tfmt.Fprintf(w, \"PerSecond %f %d\\n\", latency/float64(throughput)*1000.0, throughput)\n\t\t\tlatency = 0\n\t\t\tthroughput = 0\n\t\t\ts++\n\t\t}\n\n\t\t// fmt.Fprintln(w, o)\n\t}\n\n\t// for k, ops := range h.shard {\n\t// \tfmt.Fprintf(w, \"key=%d\\n\", k)\n\t// \tfor _, o := range ops {\n\t// \t\tfmt.Fprintln(w, o)\n\t// \t}\n\t// }\n\treturn w.Flush()\n}", "title": "" }, { "docid": "07c54ee05e88f19bae780871dd2203f8", "score": "0.55258346", "text": "func (d deck) saveToFile (filename string) error {\n\t\treturn ioutil.WriteFile(filename, []byte (d.toString()), 0666)\n}", "title": "" }, { "docid": "261c758072c769ffdbcc3bcd558198f9", "score": "0.5521646", "text": "func Save(fileName string, dst interface{}) error {\n\t// Create all directories\n\tif err := os.MkdirAll(filepath.Dir(fileName), os.ModePerm); err != nil {\n\t\treturn err\n\t}\n\tfile, err := os.Create(fileName)\n\tif err != nil {\n\t\treturn err\n\t}\n\tdefer file.Close()\n\tif err == nil {\n\t\tencoder := gob.NewEncoder(file)\n\t\tif err = encoder.Encode(dst); err != nil {\n\t\t\treturn err\n\t\t}\n\t}\n\treturn nil\n}", "title": "" }, { "docid": "dadcbc5248549678c0326ac9c853a176", "score": "0.5518316", "text": "func (m *Measurement) PrintStats(w io.Writer) {\n\ttype Hist struct {\n\t\t*Result\n\t\t*hrtime.Histogram\n\t}\n\n\thists := []Hist{}\n\tfor _, result := range m.Results {\n\t\thists = append(hists, Hist{\n\t\t\tResult: result,\n\t\t\tHistogram: hrtime.NewDurationHistogram(result.Durations, &hrtime.HistogramOptions{\n\t\t\t\tBinCount: 10,\n\t\t\t\tNiceRange: true,\n\t\t\t\tClampMaximum: 0,\n\t\t\t\tClampPercentile: 0.999,\n\t\t\t}),\n\t\t})\n\t}\n\n\tmsec := func(ns float64) string {\n\t\treturn fmt.Sprintf(\"%.2f\", ns/1e6)\n\t}\n\n\tfor _, hist := range hists {\n\t\tfmt.Fprintf(w, \"%v\\t%v\\t%v\\t%v\\t%v\\t%v\\t%v\\t%v\\n\",\n\t\t\tm.Parts, m.Segments, hist.Name,\n\t\t\tmsec(hist.Average),\n\t\t\tmsec(hist.Maximum),\n\t\t\tmsec(hist.P50),\n\t\t\tmsec(hist.P90),\n\t\t\tmsec(hist.P99),\n\t\t)\n\t}\n}", "title": "" }, { "docid": "4d6b7821e91f1b7a5ba61e463c1d1bda", "score": "0.5490268", "text": "func writeHeapToFile(h *minHeap, filename string) {\n\tfile, err := os.OpenFile(filename, os.O_WRONLY|os.O_CREATE|os.O_TRUNC, os.ModePerm)\n\tdefer file.Close()\n\tif err != nil {\n\t\tlog.Fatal(err.Error())\n\t}\n\turlCntMap := make(map[string]int)\n\tfor i := 0; i < h.cap; i++ {\n\t\tpair, err := h.getNode(i)\n\t\tif err != nil {\n\t\t\tcontinue\n\t\t}\n\t\turlCntMap[pair.url] = pair.cnt\n\t}\n\tgenResult(filename, urlCntMap, h.cap)\n}", "title": "" }, { "docid": "1b3e43ed3ccfc751ed5e05780624a1b5", "score": "0.548636", "text": "func (s *InfluxDBSink) WriteStats(stats []StatResult) error {\n\tbp, err := client.NewBatchPoints(s.bpConfig)\n\tif err != nil {\n\t\treturn fmt.Errorf(\"unable to create InfluxDB batch points - %v\", err.Error())\n\t}\n\tfor _, stat := range stats {\n\t\tvar pts []*client.Point\n\t\tvar fa []ptFields\n\t\tvar ta []ptTags\n\n\t\tif stat.ErrorCode != 0 {\n\t\t\tif !s.badStats.Contains(stat.Key) {\n\t\t\t\tlog.Warningf(\"Unable to retrieve stat %v from cluster %v, error %v\", stat.Key, s.cluster, stat.ErrorString)\n\t\t\t}\n\t\t\t// add it to the set of bad (unavailable) stats\n\t\t\ts.badStats.Add(stat.Key)\n\t\t\tcontinue\n\t\t}\n\t\tfa, ta, err = DecodeStat(s.cluster, stat)\n\t\tif err != nil {\n\t\t\t// TODO consider trying to recover/handle errors\n\t\t\tlog.Panicf(\"Failed to decode stat %+v: %s\\n\", stat, err)\n\t\t}\n\t\tfor i, f := range fa {\n\t\t\tvar pt *client.Point\n\t\t\tpt, err = client.NewPoint(stat.Key, ta[i], f, time.Unix(stat.UnixTime, 0).UTC())\n\t\t\tif err != nil {\n\t\t\t\tlog.Warningf(\"failed to create point %q:%v\", stat.Key, stat.Value)\n\t\t\t\tcontinue\n\t\t\t}\n\t\t\tpts = append(pts, pt)\n\t\t}\n\t\tif len(pts) > 0 {\n\t\t\tbp.AddPoints(pts)\n\t\t}\n\t}\n\t// write the batch\n\terr = s.c.Write(bp)\n\tif err != nil {\n\t\treturn fmt.Errorf(\"failed to write batch of points - %v\", err.Error())\n\t}\n\treturn nil\n}", "title": "" }, { "docid": "6361f789bdcde834747db159510ba2c8", "score": "0.54845953", "text": "func writeMetrics(filePath string, metrics pmetric.Metrics) error {\n\tsortMetrics(metrics)\n\tnormalizeTimestamps(metrics)\n\tb, err := MarshalMetricsYAML(metrics)\n\tif err != nil {\n\t\treturn err\n\t}\n\treturn os.WriteFile(filePath, b, 0600)\n}", "title": "" }, { "docid": "28b65d2e7ac0feaee2c2073e22ee87d5", "score": "0.5480982", "text": "func (w *TLasWarnings) SaveWarningToFile(oFile *os.File) int {\n\tif oFile == nil {\n\t\treturn 0\n\t}\n\tif w.Count() == 0 {\n\t\treturn 0\n\t}\n\tfor i, wrn := range *w {\n\t\tfmt.Fprintf(oFile, \"%d, %s\\n\", i, wrn)\n\t}\n\treturn w.Count()\n}", "title": "" }, { "docid": "958852b0780de08b55dc844fe5c0fa08", "score": "0.54699636", "text": "func (f *File) Save(fileName string, offset int64, xestatus string) error {\n\tif f.file == nil {\n\t\treturn errors.New(\"state file not open\")\n\t}\n\n\terr := writeState(f.file, fileName, offset, xestatus)\n\tif err != nil {\n\t\treturn errors.Wrap(err, \"writeStatus\")\n\t}\n\n\treturn nil\n}", "title": "" }, { "docid": "a16abed2e321a6cfccc19681446428a4", "score": "0.5460532", "text": "func Save(obj any, file string) error {\n\tfp, err := os.Create(file)\n\tdefer fp.Close()\n\tif err != nil {\n\t\tlog.Println(err)\n\t\treturn err\n\t}\n\tbw := bufio.NewWriter(fp)\n\terr = Write(obj, bw)\n\tif err != nil {\n\t\tlog.Println(err)\n\t\treturn err\n\t}\n\terr = bw.Flush()\n\tif err != nil {\n\t\tlog.Println(err)\n\t}\n\treturn err\n}", "title": "" }, { "docid": "94561ad81fdfdef1b8f099080822462e", "score": "0.5449223", "text": "func (r *Router) SaveStatHandler(c *gin.Context) {\n\n\ttype request struct {\n\t\tDate string `json:\"date\" binding:\"required,valid_date\"`\n\t\tViews uint `json:\"views,omitempty\"`\n\t\tClicks uint `json:\"clicks,omitempty\"`\n\t\tCost float64 `json:\"cost,omitempty\" binding:\"min=0\"`\n\t}\n\n\treq := request{}\n\tif err := c.ShouldBindJSON(&req); err != nil {\n\t\trespond(c, http.StatusBadRequest, \"\", err.Error())\n\t\treturn\n\t}\n\n\tdate, err := time.Parse(LAYOUT, req.Date)\n\tif err != nil {\n\t\trespond(c, http.StatusInternalServerError, \"\", err.Error())\n\t\treturn\n\t}\n\n\tstat := models.Statistics{\n\t\tDate: date,\n\t\tViews: req.Views,\n\t\tClicks: req.Clicks,\n\t\tCost: req.Cost,\n\t}\n\n\tif err := r.store.Stat().Save(&stat); err != nil {\n\t\trespond(c, http.StatusInternalServerError, \"\", \"Ошибка, статистика за эту дату уже записана\")\n\t\treturn\n\t}\n\n\trespond(c, http.StatusOK, \"готово\", \"\")\n}", "title": "" }, { "docid": "8ebf1cf171856db3647b61f4bbf4aad2", "score": "0.5447094", "text": "func (d deck) saveToFile(fileName string) error {\n\t//folosesc functia din package respectiv, apoi ca al doilea arg\n\t// convertesc in []byte ce rezulta din functia CUSTOM toString()\n\treturn ioutil.WriteFile(fileName, []byte(d.toString()), 0666)\n}", "title": "" }, { "docid": "e0fe15bb1bdf517c3c94fbfb36795810", "score": "0.542262", "text": "func saveStatus() {\n\tfile, err := os.Create(\"status.csv\")\n\tif err != nil {\n\t\tlog.Fatal(err)\n\t}\n\tdefer file.Close()\n\tstatus := make([]string, len(exchanges)+1)\n\tfor i, exg := range exchanges {\n\t\tstatus[i] = fmt.Sprintf(\"%f\", exg.Position())\n\t}\n\tstatus[len(exchanges)] = fmt.Sprintf(\"%f\", pl)\n\twriter := csv.NewWriter(file)\n\terr = writer.Write(status)\n\tif err != nil {\n\t\tlog.Fatal(err)\n\t}\n\twriter.Flush()\n}", "title": "" }, { "docid": "56758b881c65a65979cf6462c9251016", "score": "0.54006875", "text": "func (stats *APTQueueStats) DumpToFile(pathToFile string) error {\n\t// Matches .json, or tempfile with random ending, like .json43272\n\tfileNameLooksSafe, err := regexp.MatchString(\"\\\\.json\\\\d*$\", pathToFile)\n\tif err != nil {\n\t\treturn fmt.Errorf(\"DumpToFile(): path '%s'?? : %v\", pathToFile, err)\n\t}\n\tif fileutil.FileExists(pathToFile) && !fileNameLooksSafe {\n\t\treturn fmt.Errorf(\"DumpToFile() will not overwrite existing file \"+\n\t\t\t\"'%s' because that might be dangerous. Give your output file a .json \"+\n\t\t\t\"extension to be safe.\", pathToFile)\n\t}\n\n\tjsonData, err := json.MarshalIndent(stats, \"\", \" \")\n\tif err != nil {\n\t\treturn err\n\t}\n\n\toutputFile, err := os.Create(pathToFile)\n\tif err != nil {\n\t\treturn err\n\t}\n\tdefer outputFile.Close()\n\toutputFile.Write(jsonData)\n\treturn nil\n}", "title": "" }, { "docid": "b0ac45beabbebf19e5db051a0a588a44", "score": "0.5383338", "text": "func (settings *Settings) Save(path string) error {\n\tcontent, err := json.Marshal(settings)\n\tif err != nil {\n\t\treturn err\n\t}\n\n\treturn ioutil.WriteFile(path, content, 0644)\n}", "title": "" }, { "docid": "5697f1dd0258ccb5ea23d6fdd5ab6570", "score": "0.5382143", "text": "func SaveToEndFile(loadFileName string, saveFileName string, run int, m *Malaria) {\n\tcsvFile, errTemp := os.Open(loadFileName)\n\tcheck(errTemp)\n\tdefer csvFile.Close()\n\treader := csv.NewReader(bufio.NewReader(csvFile))\n\tvar d []float64\n\n\tlineNumber := 0\n\n\tfor {\n\t\tline, err := reader.Read()\n\t\tif err == io.EOF {\n\t\t\tbreak\n\t\t} else if err != nil {\n\t\t\tlog.Fatal(err)\n\t\t}\n\t\tif lineNumber > 0 {\n\t\t\tfloatTemp, _ := strconv.ParseFloat(line[1], 64)\n\t\t\td = append(d, floatTemp)\n\t\t}\n\t\tlineNumber++\n\t}\n\n\tfile, err := os.OpenFile(path+saveFileName, os.O_APPEND|os.O_CREATE|os.O_WRONLY, 0644)\n\tcheck(err)\n\tdefer file.Close()\n\n\t//mean, variance := CalcMeanAndVar(d)\n\thalfMean, halfVariance := CalcMeanAndVar(d[len(d)/2 : len(d)])\n\n\tfmt.Fprintf(file, \"%v,%f,%f,%f,%v\\n\", run, halfMean, halfVariance, CountAverageResistances(m), CountCurrentNumberOfStrains(m.StrainCounter)) // Important, must be the same order as the header.\n\n\treturn\n}", "title": "" }, { "docid": "3eee6b3baf64490a5c621cc7ca91fc21", "score": "0.5376508", "text": "func (o *Object) SaveToFile(filename string) {\n\tobjJson, _ := json.Marshal(o)\n\tioutil.WriteFile(filename, objJson, 0644)\n}", "title": "" }, { "docid": "d103b4006eaf513673e15345101c9c8c", "score": "0.5371935", "text": "func (s *ServiceState) save() {\n\tlog.Lvl3(\"Saving service\")\n\tb, err := network.Marshal(s.Storage)\n\tif err != nil {\n\t\tlog.Error(\"Couldn't marshal service:\", err)\n\t} else {\n\t\terr = ioutil.WriteFile(s.path+\"/prifi.bin\", b, 0660)\n\t\tif err != nil {\n\t\t\tlog.Error(\"Couldn't save file:\", err)\n\t\t}\n\t}\n}", "title": "" }, { "docid": "ff6809bb4fa49fddf31fa64a9c3fbc43", "score": "0.5371106", "text": "func (w *Worker) save() (n int, err error) {\n\tif w.position == 0 {\n\t\treturn 0, nil\n\t}\n\tif w.fileExists() {\n\t\tn, err = w.fileRoot.Write(w.buffer[0:w.position])\n\t\tif err == nil {\n\t\t\tw.position = 0\n\t\t}\n\t} else {\n\t\tw.errorCallback()\n\t}\n\treturn n, err\n}", "title": "" }, { "docid": "406d4bb9aa7bde3b4feccfb1987cca9d", "score": "0.5358537", "text": "func saveGame(board *chess.Board, name string) {\n\tname = strings.Trim(name, \"\\n\")\n\tfile, _ := os.Create(name)\n\twriter := bufio.NewWriter(file)\n\tfmt.Println(\"Name: \", name)\n\tfor i, v := range board.History {\n\t\twriter.WriteString(strconv.Itoa(i+1) + \": \")\n\t\twriter.WriteString(v)\n\t\twriter.WriteString(\"\\n\")\n\t}\n\twriter.Flush()\n\tfile.Close()\n\n}", "title": "" }, { "docid": "da625549b5153022cdb13ee3ab6578fc", "score": "0.53483367", "text": "func (p *DefaultParser) Save(buf *bytes.Buffer, filename string) error {\n\terr := ioutil.WriteFile(filename, buf.Bytes(), 0644)\n\tif err != nil {\n\t\treturn err\n\t}\n\treturn nil\n}", "title": "" }, { "docid": "842a71d7b9ce68d04055ef03b23bea81", "score": "0.5346286", "text": "func SaveMemProfile(profileDir, identifier string) error {\n\tmemLock.Lock()\n\tif memActive {\n\t\tmemLock.Unlock()\n\t\treturn errors.New(\"cannot start memory profiler, a memory profiler is already running\")\n\t}\n\tmemActive = true\n\tmemLock.Unlock()\n\n\t// Save the memory profile.\n\tmemFile, err := os.Create(filepath.Join(profileDir, \"mem-profile-\"+identifier+\"-\"+time.Now().Format(time.RFC3339Nano)+\".prof\"))\n\tif err != nil {\n\t\treturn err\n\t}\n\tpprof.WriteHeapProfile(memFile)\n\n\tmemLock.Lock()\n\tmemActive = false\n\tmemLock.Unlock()\n\treturn nil\n}", "title": "" }, { "docid": "a8b712f127df3a85609f7db9f6d82bc5", "score": "0.534415", "text": "func (g *Glove) Save(outputPath string) error {\n\textractDir := func(path string) string {\n\t\te := strings.Split(path, \"/\")\n\t\treturn strings.Join(e[:len(e)-1], \"/\")\n\t}\n\n\tdir := extractDir(outputPath)\n\n\tif err := os.MkdirAll(\".\"+string(filepath.Separator)+dir, 0777); err != nil {\n\t\treturn err\n\t}\n\n\tfile, err := os.Create(outputPath)\n\n\tif err != nil {\n\t\treturn err\n\t}\n\tw := bufio.NewWriter(file)\n\n\tdefer func() {\n\t\tw.Flush()\n\t\tfile.Close()\n\t}()\n\n\tvar buf bytes.Buffer\n\tfor i := 0; i < g.Corpus.Size(); i++ {\n\t\tword, _ := g.Word(i)\n\t\tfmt.Fprintf(&buf, \"%v \", word)\n\t\tfor j := 0; j < g.Dimension; j++ {\n\t\t\tl1 := i * (g.Dimension + 1)\n\t\t\tl2 := (i + g.Corpus.Size()) * (g.Dimension + 1)\n\t\t\tfmt.Fprintf(&buf, \"%v \", g.weight[l1+j]+g.weight[l2+j])\n\t\t}\n\t\tfmt.Fprintln(&buf)\n\t}\n\tw.WriteString(fmt.Sprintf(\"%v\", buf.String()))\n\treturn nil\n}", "title": "" }, { "docid": "d05ff552639509d15daa8427c608b94f", "score": "0.53432316", "text": "func reportStats(writer http.ResponseWriter, request *http.Request) {\r\n\r\n\terr := json.NewEncoder(writer).Encode(myReport)\r\n\tif err != nil {\r\n\t\tlog.Fatal(err)\r\n\t}\r\n}", "title": "" }, { "docid": "13598afd2d0146a42f96c702ebf85977", "score": "0.5338848", "text": "func (file *File) Save() {\n\tif file.autoFmt {\n\t\terr := file.Fmt()\n\t\tif err != nil {\n\t\t\tfile.NotifyUser(err.Error())\n\t\t}\n\t}\n\tfile.SnapshotSaved()\n\tcontents := []byte(file.ToString())\n\terr := ioutil.WriteFile(file.Name, contents, file.fileMode)\n\tif err != nil {\n\t\tfile.NotifyUser(\"Save Failed: \" + err.Error())\n\t} else {\n\t\tfile.savedBuffer.ReplaceBuffer(file.buffer.DeepDup())\n\t\tfile.NotifyUser(\"Saved.\")\n\t\tfile.modTime = time.Now()\n\t\tfile.md5sum = md5.Sum(contents)\n\t}\n}", "title": "" }, { "docid": "6f175a993e3e038be9923c35921248fc", "score": "0.5336416", "text": "func (nv *NetView) SaveWeights(filename gi.FileName) {\n\tnv.Net.SaveWtsJSON(filename)\n}", "title": "" }, { "docid": "691ccaad492ebe5e829f07ca88472ae6", "score": "0.5333367", "text": "func Save() {\n\tdata := Savedata{\n\t\tName: GS.current.name,\n\t\tGamestate: GS.current,\n\t}\n\n\tf, err := json.MarshalIndent(data, \"\", \" \")\n\tcheck(err)\n\tioutil.WriteFile(\"data/savegame.json\", f, 0644)\n}", "title": "" }, { "docid": "f1ff123d61c68470728dd7ebfc6f3fba", "score": "0.5331932", "text": "func (d *dataUsageCache) save(ctx context.Context, store objectIO, name string) error {\n\tpr, pw := io.Pipe()\n\tgo func() {\n\t\tpw.CloseWithError(d.serializeTo(pw))\n\t}()\n\tdefer pr.Close()\n\n\tr, err := hash.NewReader(pr, -1, \"\", \"\", -1)\n\tif err != nil {\n\t\treturn err\n\t}\n\n\t// Abandon if more than 5 minutes, so we don't hold up scanner.\n\tctx, cancel := context.WithTimeout(ctx, 5*time.Minute)\n\tdefer cancel()\n\t_, err = store.PutObject(ctx,\n\t\tdataUsageBucket,\n\t\tname,\n\t\tNewPutObjReader(r),\n\t\tObjectOptions{})\n\tif isErrBucketNotFound(err) {\n\t\treturn nil\n\t}\n\treturn err\n}", "title": "" }, { "docid": "5a754522f5b967e3f0a73f898453216c", "score": "0.53305614", "text": "func writeFile(values *[]*model.SampleStream, fileNum uint) error {\n\tif len(*values) == 0 {\n\t\treturn nil\n\t}\n\tfilename := fmt.Sprintf(\"%s.%05d\", *out, fileNum)\n\tvaluesJSON, err := json.Marshal(values)\n\tif err != nil {\n\t\treturn err\n\t}\n\treturn ioutil.WriteFile(filename, valuesJSON, 0644)\n}", "title": "" }, { "docid": "c7f97b93a9fdebf24475578af9f6de53", "score": "0.5320888", "text": "func (d *OnDiskFlusher) Flush(stats StatsRecorder) (err error) {\n\tfor name, stat := range stats {\n\t\tentries, err := stat.Reset()\n\t\tif err != nil {\n\t\t\tlog.Printf(\"Error while resetting entry for %s.\\n\", name)\n\t\t\tcontinue\n\t\t}\n\t\tsort.Slice(entries, func(i int, i1 int) bool { return entries[i].time.Before(entries[i1].time) })\n\n\t\tvar roundedTime time.Time\n\t\tvar writer io.WriteCloser\n\t\tfor _, evt := range entries {\n\t\t\troundedEventTime := evt.time.UTC().Round(time.Hour * 24)\n\t\t\tif roundedEventTime != roundedTime {\n\t\t\t\tif writer != nil {\n\t\t\t\t\twriter.Close()\n\t\t\t\t}\n\t\t\t\tfullPath := filepath.Join(d.flusherRoot, name, fmt.Sprintf(\"%d\", roundedEventTime.Unix()))\n\t\t\t\tfileMode := os.O_WRONLY | os.O_APPEND | os.O_CREATE\n\t\t\t\twriter, err = os.OpenFile(fullPath, fileMode, 0644)\n\t\t\t\t// This may mean the directory doesn't exist, so create it and see if the error goes away.\n\t\t\t\tif os.IsNotExist(err) {\n\t\t\t\t\terr = os.MkdirAll(filepath.Dir(fullPath), 0744)\n\t\t\t\t\tif err != nil {\n\t\t\t\t\t\tlog.Printf(\"Failed to created new directory to record stats for %s.\\n\", name)\n\t\t\t\t\t\tcontinue\n\t\t\t\t\t}\n\t\t\t\t\twriter, err = os.OpenFile(fullPath, fileMode, 0644)\n\t\t\t\t}\n\t\t\t\tif err != nil {\n\t\t\t\t\tlog.Printf(\"Not able to open file %s to record stats for %s. %s\", fullPath, name, err)\n\t\t\t\t\tcontinue\n\t\t\t\t}\n\t\t\t}\n\t\t\twriter.Write([]byte(fmt.Sprintf(\"%d %d\", evt.time.Unix(), evt.value)))\n\t\t}\n\t}\n\treturn err\n}", "title": "" }, { "docid": "a772d840f1a54c04a107c40f923e014b", "score": "0.5318673", "text": "func (m *LoadManager) WriteLastSuccess(handleName string, ts int64) {\n\tlastSuccessFile := filepath.Join(m.ReportDir, handleName+\"_last\")\n\tcreateFileIfNotExists(lastSuccessFile)\n\terr := ioutil.WriteFile(lastSuccessFile, []byte(strconv.Itoa(int(ts))), 0777)\n\tif err != nil {\n\t\tlog.Fatal(err)\n\t}\n}", "title": "" }, { "docid": "4734d529fe47b86e6f03312ddcc51be1", "score": "0.53113765", "text": "func (p *Page) save() error {\n\tbody := fmt.Sprintf(\"<!-- Ingredients -->\\n%s\\n<!-- Instructions -->\\n%s\", p.Ingredients, p.Instructions)\n\treturn ioutil.WriteFile(filepath.Join(pagesDir, p.Filename+\".txt\"), []byte(body), 0600)\n}", "title": "" }, { "docid": "1170fe3c7bd123d1de06cc3fbb6a5183", "score": "0.5302128", "text": "func (s *BrytonSmy) Export(outFileName string) error {\n\n\tvar err error\n\tvar binaryBuffer bytes.Buffer\n\n\tlayout := []interface{}{int16(0x01), s.coordinateCount, s.bboxLatNe, s.bboxLatSw, s.bboxLonNe, s.bboxLonSw, s.totalDst}\n\n\tfor _, entry := range layout {\n\t\terr = binary.Write(&binaryBuffer, binary.LittleEndian, entry)\n\t\tif err != nil {\n\t\t\tpanic(err)\n\t\t}\n\t}\n\n\terr = storeToFile(binaryBuffer, adjustFilename(outFileName, \".smy\"))\n\n\treturn err\n}", "title": "" }, { "docid": "082abb7bb8ddfac28bae41a679cc8d2d", "score": "0.52988327", "text": "func writeToFile() {\n\tplayers := team{\"Messi\", \"Pele\", \"Maradona\", \"Zidane\", \"Platini\"}\n\n\terr := ioutil.WriteFile(fileName, []byte(players.toString()), 0666)\n\n\tif err != nil {\n\t\tfmt.Println(\"Error:\", err)\n\t} else {\n\t\tfmt.Printf(\"Wrote the following to file: %v \\n\", players.toString())\n\t}\n}", "title": "" }, { "docid": "6d413403078e33475f0b6a5772729da1", "score": "0.5294141", "text": "func WriteMetrics(t *testing.T, filePath string, metrics pmetric.Metrics) error {\n\tif err := writeMetrics(filePath, metrics); err != nil {\n\t\treturn err\n\t}\n\tt.Logf(\"Golden file successfully written to %s.\", filePath)\n\tt.Log(\"NOTE: The WriteMetrics call must be removed in order to pass the test.\")\n\tt.Fail()\n\treturn nil\n}", "title": "" }, { "docid": "96cb77d232fb8e50d2e2662d2e776559", "score": "0.5293857", "text": "func (m *Matrix) Save(path string) error {\n\tbs, err := m.Compress()\n\tif err != nil {\n\t\treturn err\n\t}\n\treturn ioutil.WriteFile(path, bs, 0644)\n}", "title": "" }, { "docid": "32587b19ad2f7863cd83a0e299736f69", "score": "0.5293233", "text": "func SaveFile(name string, v interface{}) error {\n\tdata, err := json.Marshal(v)\n\tif err != nil {\n\t\treturn err\n\t}\n\n\tp := filepath.Join(path, name)\n\terr = ioutil.WriteFile(p, data, 0740)\n\tif err != nil {\n\t\treturn err\n\t}\n\n\treturn nil\n}", "title": "" }, { "docid": "6cddb2b6f8195a1387f2f3093db19382", "score": "0.52895075", "text": "func (rcv *Storage) Save(data []byte, filename string, strategy string, offset int) {\n\tlog.Printf(\"Save file %s with strategy %s and offset %d\", filename, strategy, offset)\n\tchunks := rcv.splitter.Split(data, filename, strategy, offset)\n\n\tfor _, c := range chunks {\n\t\trcv.saveChunk(c)\n\t}\n\t//TODO add logic to handle table\n}", "title": "" }, { "docid": "46729b1338a4cebb02093e78418cb731", "score": "0.52880883", "text": "func WriteScrapeResults(visitedMap map[string]struct{}, repos []GoRepo, filename string) {\n\tfile, err := os.OpenFile(filename, os.O_WRONLY|os.O_APPEND|os.O_RDWR, 0666)\n\tdefer file.Close()\n\tif err != nil {\n\t\tlog.Fatalf(\"could not open file %v\", err)\n\t}\n\toutput := csv.NewWriter(file)\n\tvar results [][]string\n\tfor _, repo := range repos {\n\t\tif _, ok := visitedMap[repo.ID()]; ok {\n\t\t\tcontinue\n\t\t}\n\t\tresults = append(results, []string{\n\t\t\trepo.Owner,\n\t\t\trepo.Repo,\n\t\t\tfmt.Sprintf(\"%s\", repo.CreatedAt.Format(time.RFC3339)),\n\t\t})\n\t\tvisitedMap[repo.ID()] = struct{}{}\n\t}\n\terr = output.WriteAll(results)\n\tif err != nil {\n\t\tlog.Fatalf(\"Could not write to file %s: %v\", filename, err)\n\t}\n}", "title": "" }, { "docid": "802f9ced488b7eb9e4b228107d2c98c8", "score": "0.5287782", "text": "func (xsml *XfileServiceMetricLog) Save(db XODB) error {\n\tif xsml.Exists() {\n\t\treturn xsml.Update(db)\n\t}\n\n\treturn xsml.Replace(db)\n}", "title": "" }, { "docid": "228cfb154e4f35302e20f72efbfa6282", "score": "0.52848864", "text": "func writeOutputSizes(sizes OutputReport, outPath string) error {\n\tf, err := os.Create(outPath)\n\tif err != nil {\n\t\treturn fmt.Errorf(\"failed to create %s: %s\", outPath, err)\n\t}\n\n\tencoder := json.NewEncoder(f)\n\tencoder.SetIndent(\"\", \" \")\n\tsimpleSizes := make(map[string]interface{})\n\tbudgetSuffix := \".budget\"\n\tcreepBudgetSuffix := \".creepBudget\"\n\t// Owner/context links to provide shortcut to component specific size stats.\n\townerSuffix := \".owner\"\n\tfor name, cs := range sizes {\n\t\tsimpleSizes[name] = cs.Size\n\t\tsimpleSizes[name+budgetSuffix] = cs.Budget\n\t\tsimpleSizes[name+creepBudgetSuffix] = cs.CreepBudget\n\t\tsimpleSizes[name+ownerSuffix] = \"http://go/fuchsia-size-stats/single_component/?f=component:in:\" + url.QueryEscape(name)\n\t}\n\tif err := encoder.Encode(&simpleSizes); err != nil {\n\t\t_ = f.Close()\n\t\treturn fmt.Errorf(\"failed to encode simpleSizes: %s\", err)\n\t}\n\treturn f.Close()\n}", "title": "" }, { "docid": "fa2323c8f839dbbf2622691963753b3b", "score": "0.52825373", "text": "func (m *Manifest) save() error {\n\tblob, err := m.manifest.MarshalJSON()\n\tif err != nil {\n\t\treturn err\n\t}\n\n\tmanFile, err := os.OpenFile(path.Join(m.aciPath, aci.ManifestFile), os.O_RDWR, 0644)\n\tif err != nil {\n\t\treturn err\n\t}\n\tdefer manFile.Close()\n\n\terr = manFile.Truncate(0)\n\tif err != nil {\n\t\treturn err\n\t}\n\n\t_, err = manFile.Write(blob)\n\tif err != nil {\n\t\treturn err\n\t}\n\n\treturn nil\n}", "title": "" }, { "docid": "0fc4887b2f7921d1fac28a3314393ec6", "score": "0.5273012", "text": "func Save(path string, v interface{}, opts Options) (err error) {\n\tvar (\n\t\tfile *os.File\n\t\ttmp = path + \".tmp.\" + cmn.GenTie()\n\t)\n\tif file, err = cmn.CreateFile(tmp); err != nil {\n\t\treturn\n\t}\n\tdefer func() {\n\t\t_ = file.Close()\n\t\tif err != nil {\n\t\t\tos.Remove(tmp)\n\t\t}\n\t}()\n\tif err = Encode(file, v, opts); err != nil {\n\t\treturn\n\t}\n\tif err = file.Close(); err != nil {\n\t\treturn\n\t}\n\terr = os.Rename(tmp, path)\n\treturn\n}", "title": "" }, { "docid": "a0a720125dcba11a95afbd5eb348c4de", "score": "0.52724105", "text": "func saveResults(hostname string, output []byte) bool {\n\ttimestamp := time.Now().Unix()\n\n\terr := ioutil.WriteFile(fmt.Sprintf(\"/tmp/%s-%d.log\", hostname, timestamp), output, 0644)\n\tif err != nil {\n\t\treturn false\n\t}\n\treturn true\n}", "title": "" }, { "docid": "146ad3f440e7f45a357233a5c016437b", "score": "0.52722174", "text": "func (ws *WalletStore) Save() {\n\tvar buffer bytes.Buffer\n\tgob.Register(elliptic.P256())\n\tencoder := gob.NewEncoder(&buffer)\n\terr := encoder.Encode(ws.Wallets)\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\tfile := ws.Config.GetWalletStoreFile(ws.NodeID)\n\terr = ioutil.WriteFile(file, buffer.Bytes(), 0644)\n\tif err != nil {\n\t\tpanic(err)\n\t}\n}", "title": "" }, { "docid": "fd030a70a79c59ae5bb53782a0fef8ae", "score": "0.5269627", "text": "func SaveFiles() {\n\tlog.Printf(\"Storing structures\")\n\terr := util.Store(users, \"/tmp/users.gob\")\n\tif err != nil {\n\t\tlog.Fatalln(\"The file users.gob cant be created\")\n\t}\n\terr = util.Store(userIndex, \"/tmp/userIndex.gob\")\n\tif err != nil {\n\t\tlog.Println(\"The file userIndex.gob cant be created\")\n\t}\n}", "title": "" }, { "docid": "89a014bf27e13103e530bd5a32fac84b", "score": "0.52674127", "text": "func GetAndInsertToonStats(t Toon, env *Env, blizzard Blizzard, wg *sync.WaitGroup) {\n\tdefer wg.Done()\n\n\tmyJson, err := blizzard.GetToonJson(t)\n\tif err != nil {\n\t\tlog.Printf(\"Could not get stats for %s: %v\\n\", t.Name, err)\n\t\treturn\n\t}\n\n\tstats := ParseStatsFromJson(myJson)\n\tstats.ToonID = t.ID\n\terr = env.db.InsertStats(&stats)\n\tif err != nil {\n\t\tlog.Printf(\"Error inserting stats for %v: %v\\n\", t.Name, err)\n\t\treturn\n\t} else {\n\t\tif !opts.Quiet {\n\t\t\tlog.Printf(\"Inserted record for %v: Level: [%v] Ilevel: [%v]\", t.Name, stats.Level, stats.ItemLevel)\n\t\t}\n\t}\n\n\tif env.config.ArchiveStats {\n\n\t\tdir := filepath.Join(env.config.ArchiveDir, fmt.Sprintf(\"%s-%s\", t.Name, t.Realm))\n\t\terr = os.MkdirAll(dir, 0755)\n\t\tif err != nil {\n\t\t\tlog.Printf(\"Could not create directory %s: %v\\n\", dir, err)\n\t\t\t// May as well return now since we can't write to the directory\n\t\t\treturn\n\t\t}\n\n\t\tcurrentTime := time.Now().Local().Format(\"2006-01-02\")\n\t\tfileName := filepath.Join(dir, fmt.Sprintf(\"%s-%s-%s.json.gz\", t.Name, t.Realm, currentTime))\n\n\t\t// This is just for myself in the off chance I ever want to look at it, pretty print the JSON\n\t\tvar pretty bytes.Buffer\n\t\t_ = json.Indent(&pretty, []byte(myJson), \"\", \" \")\n\n\t\t// Now we save it off as a gzip file\n\t\tvar gzipBuffer bytes.Buffer\n\t\tvar gzipWriter = gzip.NewWriter(&gzipBuffer)\n\t\t_, err = gzipWriter.Write(pretty.Bytes())\n\t\tif err != nil {\n\t\t\tlog.Printf(\"Could not write JSON to buffer: %v\\n\", err)\n\t\t}\n\t\terr = gzipWriter.Close()\n\t\tif err != nil {\n\t\t\tlog.Printf(\"Could not close gzip writer: %v\\n\", err)\n\t\t}\n\n\t\terr = ioutil.WriteFile(fileName, gzipBuffer.Bytes(), 0644)\n\t\tif err != nil {\n\t\t\tlog.Printf(\"Could not write file %s: %v\\n\", fileName, err)\n\t\t}\n\t}\n}", "title": "" }, { "docid": "ae200b5891e071cf6da3d66564c2130f", "score": "0.5262946", "text": "func (n *NoOP) SaveSnapshot(w io.Writer,\n\tfileCollection statemachine.ISnapshotFileCollection,\n\tdone <-chan struct{}) (uint64, error) {\n\tdata, err := json.Marshal(n)\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\n\t_, err = w.Write(data)\n\tif err != nil {\n\t\treturn 0, err\n\t}\n\n\treturn uint64(len(data)), nil\n}", "title": "" }, { "docid": "b700d529d5a1ca6ab0b047ea9bea6dec", "score": "0.5259876", "text": "func (j *ReplayJob) saveReplay() error {\n\tpath := filepath.Join(DirOsr, fmt.Sprintf(\"%d.osr\", j.Id()))\n\tosr, err := base64.StdEncoding.DecodeString(j.Replay.Osr)\n\tif err != nil {\n\t\treturn err\n\t}\n\tj.Logger().Println(\"Saving replay to\", path)\n\tif err = ioutil.WriteFile(path, osr, 0644); err != nil {\n\t\treturn err\n\t}\n\tj.runtime.Osr = path\n\treturn nil\n}", "title": "" }, { "docid": "7f62184396a6e4f97c9ce1fe8b04b2f6", "score": "0.5255737", "text": "func (l Level) save(path string) error {\n\tf, err := os.OpenFile(path, os.O_CREATE|os.O_WRONLY|os.O_TRUNC, 0777)\n\tif err != nil {\n\t\treturn fmt.Errorf(\"open file to save level: %w\", err)\n\t}\n\tdefer f.Close()\n\tencoder := json.NewEncoder(f)\n\tencoder.SetIndent(\"\", \" \")\n\terr = encoder.Encode(l)\n\tif err != nil {\n\t\treturn fmt.Errorf(\"save level: %w\", err)\n\t}\n\treturn nil\n}", "title": "" }, { "docid": "40e206af1980d7a65c1685d4f949e73d", "score": "0.5236854", "text": "func (s *Spectrum) WriteFile(path string, fmt string, perm os.FileMode) error {\n\tvar strFunc func() string\n\tif fmt == \"ascii\" {\n\t\tstrFunc = s.String\n\t}\n\t// if fmt == \"tsv\" { strFunc = s.TSVString }\n\t// if fmt == \"csv\" { strFunc = s.CSVString }\n\t// if fmt == \"matlab\" { strFunc = s.MATLABString }\n\t// if fmt == \"json\" { strFunc = s.JSONString }\n\treturn ioutil.WriteFile(path, []byte(strFunc()), perm)\n}", "title": "" } ]
1dab691f1311c4e656e1ecbf69c84ed8
String returns the string representation
[ { "docid": "577312586632b3f9ed5e55b2601a32a2", "score": "0.0", "text": "func (s DeletePlacementGroupInput) String() string {\n\treturn awsutil.Prettify(s)\n}", "title": "" } ]
[ { "docid": "1286182fc5221612af4ee87407404633", "score": "0.72964144", "text": "func (t *BinaryTree) String() string {\n\tformat := \"---\\n\"\n\t//format += fmt.Sprintf(\"ROOT %d\\n\", t.root.data)\n\tformat += t.Root.Stringify(0)\n\tformat += \"---\\n\"\n\treturn format\n}", "title": "" }, { "docid": "1e43f6c070cc544374daaa292daafb52", "score": "0.7166947", "text": "func (s ReEncryptOutput) String() string {\n\treturn awsutil.Prettify(s)\n}", "title": "" }, { "docid": "0448d5d94fe8348509d4418af6748c87", "score": "0.7165459", "text": "func (s CreateLedgerOutput) String() string {\n\treturn awsutil.Prettify(s)\n}", "title": "" }, { "docid": "6baa2274958b012004318288788a7657", "score": "0.71498066", "text": "func (t Tools) String() string {\n\tjt, _ := json.Marshal(t)\n\treturn string(jt)\n}", "title": "" }, { "docid": "4955e4413b6a4d8ebd7ffb3c53c1493b", "score": "0.71183026", "text": "func (o *Qualityauditlogmessage) String() string {\n \n \n \n \n \n o.RemoteIps = []string{\"\"} \n \n \n \n \n \n \n \n \n o.PropertyChanges = []Propertychange{{}} \n o.Context = map[string]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": "b1ab7200deceeb2f5dd65427566b37e0", "score": "0.71119636", "text": "func (s CreateTrailOutput) String() string {\n\treturn awsutil.Prettify(s)\n}", "title": "" }, { "docid": "a85ac297c393ccb00b089c821039d9bf", "score": "0.7085249", "text": "func (c *Class) String() string {\n\tf := format.NewASCII()\n\treturn c.FormatString(f)\n}", "title": "" }, { "docid": "dd82ce7210987d9dc4f91b945e879ac9", "score": "0.7066521", "text": "func (binCollection *BinCollectionImpl) String() string {\n\tjsonString, _ := json.MarshalIndent(binCollection, \"\", \" \")\n\treturn string(jsonString)\n}", "title": "" }, { "docid": "e4d044ce9f310af45a3195e6dc60ebf9", "score": "0.7047809", "text": "func (c Couriers) String() string {\n\tjc, _ := json.Marshal(c)\n\treturn string(jc)\n}", "title": "" }, { "docid": "cf540ccb5da69b13c29148490ead233f", "score": "0.7018895", "text": "func (s CreateAssessmentFrameworkOutput) String() string {\n\treturn awsutil.Prettify(s)\n}", "title": "" }, { "docid": "30183426a3dcb51b534a77168939e861", "score": "0.70143974", "text": "func (b Binary) String() string {\n\treturn fmt.Sprintf(\"%v-%s-%s\", b.Number, b.Series, b.Arch)\n}", "title": "" }, { "docid": "51dd6026fdd2edf9e8d42d59a79637f3", "score": "0.7000387", "text": "func (s CreateAssessmentOutput) String() string {\n\treturn awsutil.Prettify(s)\n}", "title": "" }, { "docid": "8decef95a4e8b9e6ba1e5f40d086ea59", "score": "0.69962347", "text": "func (s stringBSR) String() string {\n return fmt.Sprintf(\"%s,%d,%d,%d - %s\", &s.Symbols, s.leftExtent, s.pivot,\n s.rightExtent, s.set.lex.GetString(s.LeftExtent(), s.RightExtent()))\n}", "title": "" }, { "docid": "1b74e76ef8e4b76e195fd8fc3f890a09", "score": "0.6993856", "text": "func (s CreateTrustOutput) String() string {\n\treturn awsutil.Prettify(s)\n}", "title": "" }, { "docid": "fedd246c8156035b04abf19a17064de7", "score": "0.69623244", "text": "func (s EvaluateExpressionOutput) String() string {\n\treturn awsutil.Prettify(s)\n}", "title": "" }, { "docid": "bee3f4dd4e529d8cc2070aa23916daf1", "score": "0.6962011", "text": "func (s StartMetadataModelConversionOutput) String() string {\n\treturn awsutil.Prettify(s)\n}", "title": "" }, { "docid": "7d0e7c023fac2dd9b29d6248fe70a4a4", "score": "0.6948465", "text": "func (o *Postoutputcontract) String() string {\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": "5fc9138f7da9056810c7b0f71ac73226", "score": "0.694029", "text": "func (s CreateDatastoreOutput) String() string {\n\treturn awsutil.Prettify(s)\n}", "title": "" }, { "docid": "ccfb9cd8f8f9425fbbc4afc2d87bf8c1", "score": "0.6940058", "text": "func (s CreateRegistryOutput) 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": "53da424ddfd66edc586c234353fdb946", "score": "0.6939724", "text": "func (s CreateStackOutput) String() string {\n\treturn awsutil.Prettify(s)\n}", "title": "" }, { "docid": "2593b889da7f2c6a165254f08bf7e6ee", "score": "0.69332045", "text": "func (slf *Pubrel) String() string {\n\tb, _ := json.Marshal(slf)\n\treturn string(b)\n}", "title": "" }, { "docid": "7f79e31a4abcda8b626d10d4d629d0f1", "score": "0.6925539", "text": "func (p *Parameters) String() string {\n\treturn p.buildString(false)\n}", "title": "" }, { "docid": "6c6cc36e980634a06a1293177ab03e14", "score": "0.69209343", "text": "func (s LayerVersionContentOutput) String() string {\n\treturn awsutil.Prettify(s)\n}", "title": "" }, { "docid": "4289cc8455f8f6094a3a56497d8bc17e", "score": "0.69181406", "text": "func (s CreateRoomOutput) String() string {\n\treturn awsutil.Prettify(s)\n}", "title": "" }, { "docid": "e819d939ec4395f19afad9e0f0c34ed9", "score": "0.69095993", "text": "func (rc RocketComponent) String() string {\r\n\treturn fmt.Sprintf(\"(Code = %s, Position = %f, Ignition = %s, Model = {%s})\", rc.Code, rc.Position, rc.Ignition, rc.Model)\r\n}", "title": "" }, { "docid": "c7b28830138ec71f64ffc63011643b2e", "score": "0.68923444", "text": "func (s ReloadTablesOutput) String() string {\n\treturn awsutil.Prettify(s)\n}", "title": "" }, { "docid": "3aad9005760fdaf03c048b7b9e45b6f4", "score": "0.6886647", "text": "func (s CreateFlowOutput) 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": "f3a24fb66dda715f28800694e906457c", "score": "0.6884039", "text": "func String() string {\n\ts := \"{\"\n\ts += fmt.Sprintf(\"cmd:%q,\", cmd)\n\ts += fmt.Sprintf(\"dataPath:%q,\", dataPath)\n\ts += fmt.Sprintf(\"Debug:%v,\", defns[\"Debug\"])\n\ts += fmt.Sprintf(\"Force:%v,\", defns[\"Force\"])\n\ts += fmt.Sprintf(\"mainPath:%q,\", mainPath)\n\ts += fmt.Sprintf(\"mdlDir:%q,\", mdlDir)\n\ts += fmt.Sprintf(\"Noop:%v,\", defns[\"Noop\"])\n\ts += fmt.Sprintf(\"outDir:%q,\", outDir)\n\ts += fmt.Sprintf(\"Quiet:%v,\", defns[\"Quiet\"])\n\ts += fmt.Sprintf(\"Time:%q,\", defns[\"Time\"])\n\ts += \"}\"\n\treturn s\n}", "title": "" }, { "docid": "343aacf8e9d1cc4e1f5ac20e26b14746", "score": "0.6882691", "text": "func (s DeleteTrailOutput) String() string {\n\treturn awsutil.Prettify(s)\n}", "title": "" }, { "docid": "343aacf8e9d1cc4e1f5ac20e26b14746", "score": "0.6882691", "text": "func (s DeleteTrailOutput) String() string {\n\treturn awsutil.Prettify(s)\n}", "title": "" }, { "docid": "61d64ccea9292f9e21a381606e8c0fe1", "score": "0.6880919", "text": "func (s DeleteStudioOutput) String() string {\n\treturn awsutil.Prettify(s)\n}", "title": "" }, { "docid": "54d1d5e3af00400c1c8cd430b6ad37f4", "score": "0.6875959", "text": "func (s GetAssessmentFrameworkOutput) String() string {\n\treturn awsutil.Prettify(s)\n}", "title": "" }, { "docid": "d0215beb45b524075b7ad2982760b5b4", "score": "0.68677104", "text": "func (s CreateProjectOutput) String() string {\n\treturn awsutil.Prettify(s)\n}", "title": "" }, { "docid": "d0215beb45b524075b7ad2982760b5b4", "score": "0.68677104", "text": "func (s CreateProjectOutput) String() string {\n\treturn awsutil.Prettify(s)\n}", "title": "" }, { "docid": "6299f8fe27de71d3440eed48affe332a", "score": "0.6864682", "text": "func (s PostToConnectionOutput) String() string {\n\treturn awsutil.Prettify(s)\n}", "title": "" }, { "docid": "06778100a2a08fa9ddf6c9eafd7a4621", "score": "0.68611807", "text": "func (f *MockedNetwork) String() string {\n\treturn ``\n}", "title": "" }, { "docid": "ecad84b66118f83193752b095a3e83e0", "score": "0.6860249", "text": "func (n ID) String() string {\n\tif n.BitLen() == 0 {\n\t\treturn \"[]\"\n\t}\n\tpath := fmt.Sprintf(\"%08b\", []byte(n.path))\n\tpath = path[1 : len(path)-1] // Trim the brackets.\n\tif len(path) > 0 {\n\t\tpath += \" \"\n\t}\n\treturn fmt.Sprintf(\"[%s%0*b]\", path, n.bits, n.last>>(8-n.bits))\n}", "title": "" }, { "docid": "12ab39dc41a2c06b9653f99c6db3c002", "score": "0.6859677", "text": "func (r *Resource) String() string {\n\tbuf, _ := json.Marshal(r.m)\n\treturn string(buf)\n\n}", "title": "" }, { "docid": "8b10ca310fea77d2505aa01bffa38f65", "score": "0.6855903", "text": "func (s CreateStudioOutput) String() string {\n\treturn awsutil.Prettify(s)\n}", "title": "" }, { "docid": "0aef21b940f4b08beb17bcb08626f130", "score": "0.68493044", "text": "func (p Pizzas) String() string {\n\tjp, _ := json.Marshal(p)\n\treturn string(jp)\n}", "title": "" }, { "docid": "d2712a38499da01706f86b783f71b6ab", "score": "0.6844018", "text": "func (i Imprint) String() string {\n\tif i.IsValid() != true {\n\t\treturn \"\"\n\t}\n\tvar b strings.Builder\n\tb.WriteString(Algorithm(i[0]).String())\n\tb.WriteString(\":\")\n\tb.WriteString(hex.EncodeToString(i[1:]))\n\treturn b.String()\n}", "title": "" }, { "docid": "d9449697b82bbaa13fa4d751f16a54a6", "score": "0.6843053", "text": "func (v Version) String() string {\n\treturn v.raw\n}", "title": "" }, { "docid": "b7d1dfac1f5819e1746ea14d6a9e75fb", "score": "0.6841638", "text": "func (s CreateHsmOutput) String() string {\n\treturn awsutil.Prettify(s)\n}", "title": "" }, { "docid": "3bbb441c948dd64b26a37963d561e98f", "score": "0.6839815", "text": "func (s CreateComponentOutput) String() string {\n\treturn awsutil.Prettify(s)\n}", "title": "" }, { "docid": "82bb868902a6c087ac8835e90c9f5a2d", "score": "0.683131", "text": "func (o *Keyperformanceindicatorassessment) String() 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": "ac8e45c181b9ddcb4bf16278c8e7c284", "score": "0.6831189", "text": "func (i ID) String() string {\n\tvar builder strings.Builder\n\tbuilder.WriteString(`{\"public_key\": \"`)\n\tbuilder.WriteString(hex.EncodeToString(i.PubKey[:]))\n\tbuilder.WriteString(`\", \"address\": \"`)\n\tbuilder.WriteString(i.Address)\n\tbuilder.WriteString(`\"}`)\n\treturn builder.String()\n}", "title": "" }, { "docid": "a2f662a18633b1aa0051cae052d35e3f", "score": "0.68295026", "text": "func (s TestIdentityProviderOutput) String() string {\n\treturn awsutil.Prettify(s)\n}", "title": "" }, { "docid": "a2f662a18633b1aa0051cae052d35e3f", "score": "0.68295026", "text": "func (s TestIdentityProviderOutput) String() string {\n\treturn awsutil.Prettify(s)\n}", "title": "" }, { "docid": "7c410f7aa74b661bbce07184a32cf96d", "score": "0.68291926", "text": "func (s GetFieldLevelEncryptionOutput) String() string {\n\treturn awsutil.Prettify(s)\n}", "title": "" }, { "docid": "f80d75ae1f7673169eabe749e0562999", "score": "0.6828604", "text": "func (s CreateFileSystemOutput) String() string {\n\treturn awsutil.Prettify(s)\n}", "title": "" }, { "docid": "2801878fd57b9725f8ddf531fc3bb051", "score": "0.6827936", "text": "func (s DeleteAssessmentFrameworkOutput) String() string {\n\treturn awsutil.Prettify(s)\n}", "title": "" }, { "docid": "70157fc239daa6317001f9631f91b5ac", "score": "0.6823788", "text": "func (s ResolveRoomOutput) String() string {\n\treturn awsutil.Prettify(s)\n}", "title": "" }, { "docid": "34592df635a33eac10bfb5cc390bd7fa", "score": "0.6823228", "text": "func (s DescribeLedgerOutput) String() string {\n\treturn awsutil.Prettify(s)\n}", "title": "" }, { "docid": "bd9320208c76405dad6252e5d59d531a", "score": "0.6823128", "text": "func (t *tree) String() string {\n\treturn DumpNode(t.root)\n}", "title": "" }, { "docid": "3c747da91e080bcc2a2dbb64bd89b55d", "score": "0.68210477", "text": "func (o *Scimmetadata) String() 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": "73013592325ebff81ce472a0c86e0ad7", "score": "0.6820817", "text": "func (r *Result) String() string {\n\treturn fmt.Sprintf(\"%s\", *r)\n}", "title": "" }, { "docid": "a2c156c1e2fc41aa35af47f911fddec2", "score": "0.68160325", "text": "func (e gain) String() string {\n\treturn fmt.Sprintf(\"%s %s\", name, string(e))\n}", "title": "" }, { "docid": "effbf3effd8c70311836ab617542b10c", "score": "0.6815236", "text": "func (s DeleteRoomOutput) String() string {\n\treturn awsutil.Prettify(s)\n}", "title": "" }, { "docid": "20d663990825c172b78efc638d65e990", "score": "0.6814498", "text": "func (r revision) String() string {\n\treturn r.identity + \":\" + strconv.Itoa(r.generation)\n}", "title": "" }, { "docid": "86653f9c98301f56fe077d84baf44813", "score": "0.6814378", "text": "func (s CreateDataIntegrationOutput) String() string {\n\treturn awsutil.Prettify(s)\n}", "title": "" }, { "docid": "9b3a1925b5919898eef945fdb1864abc", "score": "0.68141735", "text": "func (e ProblemDetails) String() string {\n\tb, _ := json.Marshal(e)\n\treturn string(b)\n}", "title": "" }, { "docid": "4911d14a8bd38fdb0ab3d6cdc570274f", "score": "0.68135107", "text": "func (s CreatePipelineOutput) String() string {\n\treturn awsutil.Prettify(s)\n}", "title": "" }, { "docid": "f055a6814db03601fb5659981099a175", "score": "0.681294", "text": "func (o *Locationcreatedefinition) String() string {\n \n \n \n o.Path = []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": "20c07b1ede815dfda0e0e402b25d597b", "score": "0.6809557", "text": "func (s CreateDataProviderOutput) String() string {\n\treturn awsutil.Prettify(s)\n}", "title": "" }, { "docid": "d8816314a9db2bc7c2225c3d363702b7", "score": "0.6809057", "text": "func (number Version) String() string {\n\tv := number.Base64()\n\treturn string(v[:])\n}", "title": "" }, { "docid": "2bf1073c65d9c3ae0c51812b8c151d26", "score": "0.6808808", "text": "func (s Struct) String() string {\n\tb, _ := json.MarshalIndent(s, \"\", \" \")\n\treturn string(b)\n}", "title": "" }, { "docid": "c57ffacc1452380f2de8a397a1048f76", "score": "0.680692", "text": "func (s CreateSAMLProviderOutput) String() string {\n\treturn awsutil.Prettify(s)\n}", "title": "" }, { "docid": "8d19b1f30b08f9578fb75e7ead607b10", "score": "0.68063885", "text": "func (alg SignatureAlgorithm) String() string {\n\treturn string(alg)\n}", "title": "" }, { "docid": "50ff42c2d20f85d15012846ef28baad7", "score": "0.6803856", "text": "func ToString() string {\n\treturn fmt.Sprintf(\"Version: %s, Build Date: %s, Git Commit: %s\", Version, BuildDate, GitHash)\n}", "title": "" }, { "docid": "b212f621523dc31154cbad1f30505483", "score": "0.68025297", "text": "func (s CreateAddressBookOutput) String() string {\n\treturn awsutil.Prettify(s)\n}", "title": "" }, { "docid": "156d845e20eb6b69f69b2c27288dc0fe", "score": "0.68017775", "text": "func (c Clientes) String() string {\n\tjc, _ := json.Marshal(c)\n\treturn string(jc)\n}", "title": "" }, { "docid": "2cd1448c1877adbdbd4f1a73d8a206f8", "score": "0.68012583", "text": "func (s CreateDataCatalogOutput) String() string {\n\treturn awsutil.Prettify(s)\n}", "title": "" }, { "docid": "097fdd3633146b5dacc1de2dc02b9f27", "score": "0.68010616", "text": "func (p Program) String() (o string) {\n\to = fmt.Sprintf(\"[%d] - Map ID: %d\", p.ID, p.MapID)\n\tfor _, d := range p.Descriptors {\n\t\to += fmt.Sprintf(\" - %s\", d)\n\t}\n\tfor _, s := range p.Streams {\n\t\to += fmt.Sprintf(\"\\n * %s\", s.String())\n\t}\n\treturn\n}", "title": "" }, { "docid": "5645b98d27ab43fcddf45cf0f14ffaee", "score": "0.68010473", "text": "func (v Version) String() string {\n\tjv, _ := json.Marshal(v)\n\treturn string(jv)\n}", "title": "" }, { "docid": "ce6bd3509128200ec8e6ca5c5d65d6ee", "score": "0.6800626", "text": "func (s StartMetadataModelAssessmentOutput) String() string {\n\treturn awsutil.Prettify(s)\n}", "title": "" }, { "docid": "6d97cd095fa8309e35f434a092fd8008", "score": "0.6799956", "text": "func (t *TCAP) String() string {\n\treturn fmt.Sprintf(\"{Transaction: %v, Dialogue: %v, Components: %v}\",\n\t\tt.Transaction,\n\t\tt.Dialogue,\n\t\tt.Components,\n\t)\n}", "title": "" }, { "docid": "09b4e971f70da12d92b94dd018b1048d", "score": "0.6798273", "text": "func (s CreateCertificateAuthorityOutput) String() string {\n\treturn awsutil.Prettify(s)\n}", "title": "" }, { "docid": "ec652038b213fabe50f2f52936d90db6", "score": "0.6797251", "text": "func (s ExportMetadataModelAssessmentOutput) String() string {\n\treturn awsutil.Prettify(s)\n}", "title": "" }, { "docid": "2279d3fcc7d1c453502fdda6ec20bab3", "score": "0.6793422", "text": "func (s DeleteLedgerOutput) String() string {\n\treturn awsutil.Prettify(s)\n}", "title": "" }, { "docid": "2279d3fcc7d1c453502fdda6ec20bab3", "score": "0.6793422", "text": "func (s DeleteLedgerOutput) String() string {\n\treturn awsutil.Prettify(s)\n}", "title": "" }, { "docid": "b48abd2f2142329f0552374ee14fdf37", "score": "0.6785722", "text": "func (s AssessmentFramework) String() string {\n\treturn awsutil.Prettify(s)\n}", "title": "" }, { "docid": "ad38829b26630de4cd62149ef8a6360f", "score": "0.6785052", "text": "func (s DescribeExpressionsOutput) String() string {\n\treturn awsutil.Prettify(s)\n}", "title": "" }, { "docid": "9a6b562dd31e0c1f2fbcb60a725048b5", "score": "0.6782907", "text": "func (t TransactionEssenceVersion) String() string {\n\treturn \"TransactionEssenceVersion(\" + strconv.Itoa(int(t)) + \")\"\n}", "title": "" }, { "docid": "999a23eff10dc1fd6841257a5d20b823", "score": "0.67816514", "text": "func (t Tool) String() string {\n\tjt, _ := json.Marshal(t)\n\treturn string(jt)\n}", "title": "" }, { "docid": "d2140ebfe40f29095ad495a763e547f8", "score": "0.6781409", "text": "func (s ParticipantDetails) String() string {\n\treturn awsutil.Prettify(s)\n}", "title": "" }, { "docid": "0c1ad5c67ec983f7d17783ea7e7dc22c", "score": "0.6781328", "text": "func (o *Analyticssurvey) 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": "b82d8af21c6a02b286100ca1f3fef1ae", "score": "0.6779874", "text": "func (s StartFlowOutput) String() string {\n\treturn awsutil.Prettify(s)\n}", "title": "" }, { "docid": "bdc727b29fa867bc600d2138b9b231aa", "score": "0.6779785", "text": "func (s Questions) String() string {\n\tres := make([]string, 4)\n\tres[0] = \"ID: \" + reform.Inspect(s.ID, true)\n\tres[1] = \"Question: \" + reform.Inspect(s.Question, true)\n\tres[2] = \"TrueAnswer: \" + reform.Inspect(s.TrueAnswer, true)\n\tres[3] = \"FkTicket: \" + reform.Inspect(s.FkTicket, true)\n\treturn strings.Join(res, \", \")\n}", "title": "" }, { "docid": "fa6cf2c6259f9e29ac76dd2026850b47", "score": "0.6779412", "text": "func (t Topology) String() string { return string(t) }", "title": "" }, { "docid": "b24acf842e93f00673d9ab271fadce8f", "score": "0.677804", "text": "func (s CreatePublicKeyOutput) String() string {\n\treturn awsutil.Prettify(s)\n}", "title": "" }, { "docid": "0a3c8640dd39f9ab1c6cd0148d8f81d6", "score": "0.6776526", "text": "func (s CreateSamplingRuleOutput) String() string {\n\treturn awsutil.Prettify(s)\n}", "title": "" }, { "docid": "2dac5b070761820e481030c5e14cf9f2", "score": "0.67762464", "text": "func (i *ChainInfo) String() string {\n\treturn fmt.Sprintf(\"{source=%s sender:%s height=%d head=%s}\", i.Source, i.Sender, i.Head.Height(), i.Head.Key())\n}", "title": "" }, { "docid": "97bdefa311af856da3e76d3a4cf1abeb", "score": "0.677564", "text": "func (s CreateWebhookOutput) String() string {\n\treturn awsutil.Prettify(s)\n}", "title": "" }, { "docid": "150e21a10c5d7576aaa9ad2922ebd7fe", "score": "0.6774399", "text": "func (s CreateParticipantConnectionOutput) String() string {\n\treturn awsutil.Prettify(s)\n}", "title": "" }, { "docid": "1a654a3dc8ce54970542fd5a703b4cb0", "score": "0.67741984", "text": "func (s CreatePolicyVersionOutput) String() string {\n\treturn awsutil.Prettify(s)\n}", "title": "" }, { "docid": "cbb840c74a6e7183c1d634cc6b295def", "score": "0.67729044", "text": "func (s UpdateAssessmentFrameworkOutput) String() string {\n\treturn awsutil.Prettify(s)\n}", "title": "" }, { "docid": "d1ca054a99cccdfd8ab1d441d326d111", "score": "0.6770808", "text": "func (s ExportCertificateOutput) String() string {\n\treturn awsutil.Prettify(s)\n}", "title": "" }, { "docid": "d8c127ca0e83e806b1a90db73f35f9a5", "score": "0.67707455", "text": "func (s ResyncMFADeviceOutput) String() string {\n\treturn awsutil.Prettify(s)\n}", "title": "" }, { "docid": "d8c127ca0e83e806b1a90db73f35f9a5", "score": "0.6769905", "text": "func (s ResyncMFADeviceOutput) String() string {\n\treturn awsutil.Prettify(s)\n}", "title": "" } ]
1dab691f1311c4e656e1ecbf69c84ed8
String returns the string representation
[ { "docid": "d7f44fd5d8a4877e8cb88d194df9992e", "score": "0.0", "text": "func (s DBParameterGroup) String() string {\n\treturn awsutil.Prettify(s)\n}", "title": "" } ]
[ { "docid": "863aca310ae2a721297f83cb8f15b2c5", "score": "0.7213589", "text": "func String() string {\n\tres := \"\"\n\tres = res + fmt.Sprintf(\"Git Tag : %s\\n\", GitTag)\n\tres = res + fmt.Sprintf(\"Build User: %s\\n\", BuildUser)\n\tres = res + fmt.Sprintf(\"Version : %s\\n\", Version)\n\tres = res + fmt.Sprintf(\"BuildDate : %s\\n\", BuildDate)\n\treturn res\n}", "title": "" }, { "docid": "1afbc735f94211658629c79783a11571", "score": "0.713315", "text": "func (o *Queueutilizationdiagnostic) String() 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": "5dddf20e38d60d9b70e305f0661b5f6f", "score": "0.7125982", "text": "func (s CreateRelationalDatabaseOutput) String() string {\n\treturn awsutil.Prettify(s)\n}", "title": "" }, { "docid": "347fbfa59b17027317d5078499a4f04d", "score": "0.70625675", "text": "func (o *Outcomeprobabilitycondition) 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": "6aeb8ffe3906b9ae2ead06ebb5f38a3b", "score": "0.7061703", "text": "func (o *Program) String() string {\n \n \n \n o.Topics = []Basetopicentitiy{{}} \n o.Tags = []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": "148aa301efd08346cca6b0913535f1be", "score": "0.7040253", "text": "func (ns *namespace) String() string {\n\tprops := map[string]interface{}{\n\t\t\"id\": ns.ID(),\n\t\t\"dev\": ns.DeviceName(),\n\t\t\"mode\": ns.Mode(),\n\t\t\"size\": ns.Size(),\n\t\t\"enabled\": ns.Enabled(),\n\t\t\"uuid\": ns.UUID(),\n\t\t\"name\": ns.Name(),\n\t}\n\n\tif mode := ns.Mode(); mode != DaxMode {\n\t\tprops[\"blockdev\"] = ns.BlockDeviceName()\n\t}\n\n\tif location := ns.Location(); location != \"none\" {\n\t\tprops[\"map\"] = location\n\t}\n\n\treturn marshal(props)\n}", "title": "" }, { "docid": "11cdf17e6fe89733a333c08633738811", "score": "0.70320153", "text": "func (s CreateObjectOutput) String() string {\n\treturn awsutil.Prettify(s)\n}", "title": "" }, { "docid": "dda10c07d1a80e6bc5ba6240a66c7ba9", "score": "0.70222133", "text": "func (s CreateMultiplexProgramOutput) String() string {\n\treturn awsutil.Prettify(s)\n}", "title": "" }, { "docid": "0b0adf2a2f3bb903a762c6aa17af1f15", "score": "0.70175666", "text": "func (s RecordOutput) String() string {\n\treturn awsutil.Prettify(s)\n}", "title": "" }, { "docid": "f40788c2f368832d94044c0f54581f5d", "score": "0.70164025", "text": "func (s CreateDatabaseOutput) String() string {\n\treturn awsutil.Prettify(s)\n}", "title": "" }, { "docid": "7d3f3e80ba9c8a4869ab492d35f20ee3", "score": "0.7013148", "text": "func (s CreateEvaluationOutput) String() string {\n\treturn awsutil.Prettify(s)\n}", "title": "" }, { "docid": "ccf3ec955e2fe75bb1a127d473f18b37", "score": "0.6998205", "text": "func (v dump) String() string {\n\treturn v.dump\n}", "title": "" }, { "docid": "fb84d3f9857a61f1092f341aecde0d50", "score": "0.6998154", "text": "func (o *Learningmodulerequest) String() string {\n \n \n \n o.InformSteps = []Learningmoduleinformsteprequest{{}} \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": "d111c0ef2387ea3ae8829f27a5305484", "score": "0.6995001", "text": "func (r Rope) String() string {\n\tvar buf bytes.Buffer\n\tr.WriteTo(&buf)\n\treturn buf.String()\n}", "title": "" }, { "docid": "1b74e76ef8e4b76e195fd8fc3f890a09", "score": "0.6993856", "text": "func (s CreateTrustOutput) String() string {\n\treturn awsutil.Prettify(s)\n}", "title": "" }, { "docid": "1ed2f7a5a423781a712852f19a37c266", "score": "0.6991212", "text": "func (s FsxProtocol) String() string {\n\treturn awsutil.Prettify(s)\n}", "title": "" }, { "docid": "dec2839f5f304a30a1795fa7a04d353f", "score": "0.6983884", "text": "func (e Escolas) String() string {\n\tje, _ := json.Marshal(e)\n\treturn string(je)\n}", "title": "" }, { "docid": "4c9fd39ff4783e295cf0f9bf9259b4e0", "score": "0.6982112", "text": "func (s CreateVoiceTemplateOutput) String() string {\n\treturn awsutil.Prettify(s)\n}", "title": "" }, { "docid": "f9a3eeadae69c0845fc111ba14e14c09", "score": "0.69775337", "text": "func (c Class) String() string {\n\treturn string([]byte{byte(c)})\n}", "title": "" }, { "docid": "5de8d93588a575881aeb07d7b492d9e6", "score": "0.69715405", "text": "func (s StartLendingAnalysisOutput) String() string {\n\treturn awsutil.Prettify(s)\n}", "title": "" }, { "docid": "50ba652e5aabf9c23504c632960021d2", "score": "0.6963326", "text": "func (s TestFailoverOutput) String() string {\n\treturn awsutil.Prettify(s)\n}", "title": "" }, { "docid": "50ba652e5aabf9c23504c632960021d2", "score": "0.6963326", "text": "func (s TestFailoverOutput) String() string {\n\treturn awsutil.Prettify(s)\n}", "title": "" }, { "docid": "40f158007d3dd1f129db0d7bcac762a9", "score": "0.6953885", "text": "func (c CertificateObject) String() string {\n\treturn fmt.Sprintf(\"{%d %d %d %s}\", c.Type, c.Usage, c.HashAlgo, hex.EncodeToString(c.Data))\n}", "title": "" }, { "docid": "29019f14555d95920239967cd6376932", "score": "0.6952852", "text": "func (o *Digitalaction) 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": "f4e90f2280e5d2d6e532407796de9f8b", "score": "0.6946349", "text": "func (o *Flowversion) String() string {\n \n \n \n \n \n \n \n \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": "748863c7577d41dca8b16db590c79da0", "score": "0.6945013", "text": "func (o *Testmoderesults) 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": "eac19428c321502e3bf90d472a2481a8", "score": "0.6944967", "text": "func (s FsxProtocolNfs) 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": "f494d39994d6f07f8b146851cbe88cce", "score": "0.6931277", "text": "func (o *Directrouting) String() string {\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": "b73a7c843b890fc061c0b718d8e5c91e", "score": "0.6925653", "text": "func (o *Evaluationquestionscore) 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": "acef5de97659b0bff60c49c3d6b40217", "score": "0.6922656", "text": "func (o *Learningmodulereassignsummary) String() string {\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": "c87807b6e8f3c15d1b1f1f700f78c1fa", "score": "0.69187677", "text": "func (s DeleteRelationalDatabaseOutput) String() string {\n\treturn awsutil.Prettify(s)\n}", "title": "" }, { "docid": "4289cc8455f8f6094a3a56497d8bc17e", "score": "0.69181406", "text": "func (s CreateRoomOutput) String() string {\n\treturn awsutil.Prettify(s)\n}", "title": "" }, { "docid": "9eaff19473c2d9dc58c22044d225388d", "score": "0.6917165", "text": "func (o *Analyticsevaluation) 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": "2a7047abe98f55cdae1f8f9737cdce8d", "score": "0.6910465", "text": "func (s GetRawMessageContentOutput) String() string {\n\treturn awsutil.Prettify(s)\n}", "title": "" }, { "docid": "33a6b27a525148386f63ddac870a37b7", "score": "0.69097185", "text": "func String(tree Tree) string {\n\tvar buffer bytes.Buffer\n\tWrite(tree, &buffer)\n\treturn buffer.String()\n}", "title": "" }, { "docid": "3ea6e3d53abe9cfcd07ed387ccb74755", "score": "0.69094145", "text": "func (o *Createqueuerequest) 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": "8ffa68628935e3980766a0aee03ae7ec", "score": "0.6903258", "text": "func (o *Learningassignmentstep) 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": "37f25e4aae11ed056cf0f341cf2b6a6d", "score": "0.6902293", "text": "func (c *Capabilities) String() string {\n\tif *c == 0 {\n\t\treturn \"(unknown)\"\n\t}\n\tvar str strings.Builder\n\tc.write(&str, false)\n\treturn str.String()\n}", "title": "" }, { "docid": "b3d00897060dcec7154507e9406f8a73", "score": "0.6893509", "text": "func (c SandstormCore) String() string {\n\treturn fmt.Sprintf(\"%T(%v)\", c, capnp.Client(c))\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": "d745b5e1da305f616943dde0a460e35e", "score": "0.68924487", "text": "func (o *Analyticssurvey) String() string {\n \n \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": "f57cce8a80729632f7fc697c6b968a9f", "score": "0.68920684", "text": "func (s CreateLayerOutput) String() string {\n\treturn awsutil.Prettify(s)\n}", "title": "" }, { "docid": "0b4f4c3fd97e541cf47ccc8964ee0ea4", "score": "0.68903863", "text": "func (s DeleteMLTransformOutput) String() string {\n\treturn awsutil.Prettify(s)\n}", "title": "" }, { "docid": "380f3e6253e1bb9c34311b63d029c4dc", "score": "0.6888122", "text": "func (g *Generic) String() string {\n\treturn fmt.Sprintf(\n\t\t\"Header: %v, Payload: %s\",\n\t\tg.Header,\n\t\tg.Header.Payload,\n\t)\n}", "title": "" }, { "docid": "15ee5444eb458f817fda321b89a634b0", "score": "0.6887011", "text": "func (s CreateKeyspaceOutput) String() string {\n\treturn awsutil.Prettify(s)\n}", "title": "" }, { "docid": "390fa81ea59016742f1bcab95ec10d3c", "score": "0.6885775", "text": "func (o *Messageinfo) String() string {\n \n \n \n o.MessageParams = map[string]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": "c50750ae8ca4ac8cad54efbe03fcd467", "score": "0.68851185", "text": "func (s PathToObjectIdentifiers) String() string {\n\treturn awsutil.Prettify(s)\n}", "title": "" }, { "docid": "da0011896c8394dc706f43e5b0e17048", "score": "0.6884449", "text": "func (e Escola) String() string {\n\tje, _ := json.Marshal(e)\n\treturn string(je)\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": "328d864c8b9c74ecafe47e27d4ad016f", "score": "0.68789667", "text": "func (s CreateModelOutput) String() string {\n\treturn awsutil.Prettify(s)\n}", "title": "" }, { "docid": "18fadef9389f732d82c64887f149e57e", "score": "0.6878946", "text": "func (mtsk *MTSK) String() string {\n\treturn fmt.Sprintf(\"%x\", mtsk.serialize())\n}", "title": "" }, { "docid": "6ab74ae88a33a0c36428aad10ae837d2", "score": "0.6878146", "text": "func (o *Learningmodulereassignsummary) 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": "38167540dad3daaaa2851aa7c2116d55", "score": "0.6871602", "text": "func (s CreateCodeRepositoryOutput) String() string {\n\treturn awsutil.Prettify(s)\n}", "title": "" }, { "docid": "59522761982e47413976c92ca3188a0b", "score": "0.6868744", "text": "func (sys *SampleEngine) String() string {\n if err, str := utils.ObjectToJsonString(sys); err != nil{\n return err.Error()\n } else{\n return str\n }\n}", "title": "" }, { "docid": "d0215beb45b524075b7ad2982760b5b4", "score": "0.68677104", "text": "func (s CreateProjectOutput) String() string {\n\treturn awsutil.Prettify(s)\n}", "title": "" }, { "docid": "d0215beb45b524075b7ad2982760b5b4", "score": "0.68677104", "text": "func (s CreateProjectOutput) String() string {\n\treturn awsutil.Prettify(s)\n}", "title": "" }, { "docid": "e1b8904f2e188421e49596025bb4c89f", "score": "0.6867701", "text": "func (r1cs R1CS) String() string {\n\n\tres := \"\"\n\n\t// display the wire tracker\n\tres += \"wire tracker:\\n\"\n\tfor _, c := range r1cs.WireTracker {\n\t\tres += c.String()\n\t\tres += \", \"\n\t}\n\tres = res[:len(res)-2]\n\tres += \"\\n\\n\"\n\n\t// display the Constraints\n\tres += \"computational gaph:\\n\"\n\tfor _, c := range r1cs.GraphOrdering {\n\t\tres = res + r1cs.ComputationalGraph[c].String(r1cs)\n\t}\n\tres += \"\\nconstraints gaph:\\n\"\n\tfor _, c := range r1cs.Constraints {\n\t\tres = res + c.String(r1cs)\n\t}\n\n\t// display the ordering\n\tres += \"\\nGraph ordering:\\n\"\n\tfor _, c := range r1cs.GraphOrdering {\n\t\tres += strconv.Itoa(int(c)) + \", \"\n\t}\n\tres = res[:len(res)-2]\n\n\treturn res\n}", "title": "" }, { "docid": "1a09669a96583cfa55bf5dc70fb6cd4f", "score": "0.686712", "text": "func (s StartMatchmakingOutput) String() string {\n\treturn awsutil.Prettify(s)\n}", "title": "" }, { "docid": "1a09669a96583cfa55bf5dc70fb6cd4f", "score": "0.686712", "text": "func (s StartMatchmakingOutput) 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": "d497dc52eaf04d976d81f450fb539a78", "score": "0.68651193", "text": "func (s GetMLTransformOutput) String() string {\n\treturn awsutil.Prettify(s)\n}", "title": "" }, { "docid": "6299f8fe27de71d3440eed48affe332a", "score": "0.6864682", "text": "func (s PostToConnectionOutput) String() string {\n\treturn awsutil.Prettify(s)\n}", "title": "" }, { "docid": "339b4b6dc2688019e2d2260d64cae2ad", "score": "0.6861979", "text": "func (s EnableRadiusOutput) String() string {\n\treturn awsutil.Prettify(s)\n}", "title": "" }, { "docid": "f06a75d93f441015c4758f8a1044e47e", "score": "0.6861716", "text": "func (p *Perform) String() string {\n\tbuf := make([]byte, 64)\n\thex.Encode(buf[0:2], []byte{p.Length})\n\thex.Encode(buf[2:62], p.Data[:])\n\thex.Encode(buf[62:64], []byte{p.U1})\n\treturn string(buf)\n}", "title": "" }, { "docid": "95ffd06439e03b7f4a66b4905c46ee88", "score": "0.68608975", "text": "func (o *Agentownedrouting) 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": "a96ee478e46a33bba77515844bb8ca3c", "score": "0.6860692", "text": "func (o *Binary) String() string {\n\treturn fmt.Sprintf(\"(%s %s %s)\", o.Left, o.Op, o.Right)\n}", "title": "" }, { "docid": "c3e7f6c6d91141eed550007c1cfb0bd1", "score": "0.6858985", "text": "func (a ArInternalMetadatum) String() string {\n\tja, _ := json.Marshal(a)\n\treturn string(ja)\n}", "title": "" }, { "docid": "d40ec5ba7a0ee645a5c049425aaadf9a", "score": "0.6856373", "text": "func (of OutputFormat) String() string {\n\treturn string(of)\n}", "title": "" }, { "docid": "d1b728927ec483528cc79c81b19f0e3b", "score": "0.6856152", "text": "func (s *Spectateur) ToString() string {\n\tret, _ := s.Marshal()\n\treturn string(ret)\n}", "title": "" }, { "docid": "e8c5c3979af5ca2c2230bc5dbab2e676", "score": "0.684556", "text": "func (p *signature) String() string {\n\ts := \"{signature:\\n\"\n\ts += \"Suite => \" + p.suite.String() + \",\\n\"\n\ts += \"Signature => \" + hex.EncodeToString(p.signature) + \"\\n\"\n\ts += \"}\\n\"\n\treturn s\n}", "title": "" }, { "docid": "9d7e735823adb0fa5f19d2b75c0c33e3", "score": "0.6843598", "text": "func (o *Mediapolicies) 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": "ade613480a4d21e19bbe2808b702aeda", "score": "0.68419415", "text": "func (s HumanLoopActivationOutput) String() string {\n\treturn awsutil.Prettify(s)\n}", "title": "" }, { "docid": "71d501622c10eb6a665a4ef7cac6ef25", "score": "0.68415034", "text": "func (s TestDiscoveryRequiredOutput) String() string {\n\treturn awsutil.Prettify(s)\n}", "title": "" }, { "docid": "3bbb441c948dd64b26a37963d561e98f", "score": "0.6839815", "text": "func (s CreateComponentOutput) String() string {\n\treturn awsutil.Prettify(s)\n}", "title": "" }, { "docid": "3d0732fbe6c9dd64e383381993ee4382", "score": "0.6838164", "text": "func (encoding Encoding) String() string {\n\treturn string(encoding)\n}", "title": "" }, { "docid": "3f9b7565d74fd67a8a708782935ff8ce", "score": "0.68373114", "text": "func (e *entity) String() string {\n\tf := format.NewASCII()\n\treturn e.FormatString(f)\n}", "title": "" }, { "docid": "9e02b410726e603391050dc45b25c1be", "score": "0.68363225", "text": "func (s CreateIntegrationOutput) String() string {\n\treturn awsutil.Prettify(s)\n}", "title": "" }, { "docid": "9e02b410726e603391050dc45b25c1be", "score": "0.68362904", "text": "func (s CreateIntegrationOutput) String() string {\n\treturn awsutil.Prettify(s)\n}", "title": "" }, { "docid": "4708f1687e4e3cd53f7ca04b8a3eee60", "score": "0.6834452", "text": "func (ro RecordOutput) String() string {\n\treturn fmt.Sprintf(\"%s - %s\", ro.Hash, ro.Status)\n}", "title": "" }, { "docid": "ca380eb191facf0e1616f987cd289b82", "score": "0.6831359", "text": "func (o *Interactionstatsrule) 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": "77f878d2109819aea480ddc0a17cdfe5", "score": "0.68300116", "text": "func (s CreateDBProxyOutput) String() string {\n\treturn awsutil.Prettify(s)\n}", "title": "" }, { "docid": "692f2714f56841c2f85f4db07e57075c", "score": "0.6826267", "text": "func (n *Nodes) String() string {\n\treturn fmt.Sprintf(\"%s\", *n)\n}", "title": "" }, { "docid": "50403e1d2bd1ca84473d3b9ad4f6d9bf", "score": "0.68254817", "text": "func (t Todoes) String() string {\n\tjt, _ := json.Marshal(t)\n\treturn string(jt)\n}", "title": "" }, { "docid": "70157fc239daa6317001f9631f91b5ac", "score": "0.6823788", "text": "func (s ResolveRoomOutput) String() string {\n\treturn awsutil.Prettify(s)\n}", "title": "" }, { "docid": "3cc4e5900cc86f4d6f8dc28ce2d6c065", "score": "0.68178856", "text": "func (d *s3ObjectInfo) String() string {\n\tsrc, err := json.Marshal(d.Info)\n\tif err != nil {\n\t\treturn fmt.Sprintf(\"%+v\", d.Info)\n\t}\n\treturn string(src)\n}", "title": "" }, { "docid": "8d1276cecf0b480b6dd7dbe9b7b029b6", "score": "0.68175054", "text": "func (s GetObjectInformationOutput) String() string {\n\treturn awsutil.Prettify(s)\n}", "title": "" }, { "docid": "0c4cea2da6b29455e1c44cf3d0391ccf", "score": "0.68173057", "text": "func (s CreateLFTagOutput) String() string {\n\treturn awsutil.Prettify(s)\n}", "title": "" }, { "docid": "69f02d20647f50cc4588654ec293e515", "score": "0.68172234", "text": "func (s RestoreDBClusterToPointInTimeOutput) String() string {\n\treturn awsutil.Prettify(s)\n}", "title": "" }, { "docid": "79d6c1a44d56953ae72df955f486ea35", "score": "0.6815926", "text": "func (s AddFacetToObjectOutput) String() string {\n\treturn awsutil.Prettify(s)\n}", "title": "" }, { "docid": "effbf3effd8c70311836ab617542b10c", "score": "0.6815236", "text": "func (s DeleteRoomOutput) String() string {\n\treturn awsutil.Prettify(s)\n}", "title": "" }, { "docid": "788fd66b2e75add93f49434f4f6cd932", "score": "0.68138856", "text": "func (s CreateImageBuilderOutput) String() string {\n\treturn awsutil.Prettify(s)\n}", "title": "" }, { "docid": "426b92905a136a5cfa7043198c3593ce", "score": "0.68135405", "text": "func (s CreateMeshOutput) 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": "9f6cf6e77f9d0d6ae7315d0ae851c115", "score": "0.6810905", "text": "func (h Binary) String() string {\n\treturn fmt.Sprintf(\"%v\", []byte(h))\n}", "title": "" }, { "docid": "90f5a73033b004b8f41fc31de9c0b67f", "score": "0.6810585", "text": "func (s CacheEngineVersion) String() string {\n\treturn awsutil.Prettify(s)\n}", "title": "" }, { "docid": "c57ffacc1452380f2de8a397a1048f76", "score": "0.680692", "text": "func (s CreateSAMLProviderOutput) String() string {\n\treturn awsutil.Prettify(s)\n}", "title": "" }, { "docid": "8d19b1f30b08f9578fb75e7ead607b10", "score": "0.68063885", "text": "func (alg SignatureAlgorithm) String() string {\n\treturn string(alg)\n}", "title": "" }, { "docid": "7f214fed39a29a4ec330a6d77752c708", "score": "0.6803408", "text": "func (m Record) String() string {\n\tvar parts []string\n\n\tparts = append(parts, m.SrcName(false))\n\tparts = append(parts, fmt.Sprintf(\"%06d\", m.SeqNumber()))\n\tparts = append(parts, string(m.DataQualityIndicator))\n\tparts = append(parts, fmt.Sprintf(\"%d\", m.BlockSize()))\n\tparts = append(parts, fmt.Sprintf(\"%d samples\", m.NumberOfSamples))\n\tparts = append(parts, fmt.Sprintf(\"%g Hz\", m.SampleRate()))\n\tparts = append(parts, m.StartTime().Format(\"2006,002,15:04:05.000000\"))\n\n\treturn strings.Join(parts, \", \")\n}", "title": "" }, { "docid": "777bb879e4bcbecfb1b5e68162f15da3", "score": "0.68019754", "text": "func (s VerifyTrustOutput) String() string {\n\treturn awsutil.Prettify(s)\n}", "title": "" }, { "docid": "2c0fe60f747b916642f13c059f703e54", "score": "0.68013126", "text": "func (o *Burescheduleagentscheduleresult) 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": "" } ]
ade5991300fb092143088a73ed726fc8
DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new AutoKill.
[ { "docid": "d1e84b5379b540cae3d1948df954729d", "score": "0.91069484", "text": "func (in *AutoKill) DeepCopy() *AutoKill {\n\tif in == nil {\n\t\treturn nil\n\t}\n\tout := new(AutoKill)\n\tin.DeepCopyInto(out)\n\treturn out\n}", "title": "" } ]
[ { "docid": "f274d9d383c8679d586d90b1ac1950bb", "score": "0.75435436", "text": "func (in *AutoKillList) DeepCopy() *AutoKillList {\n\tif in == nil {\n\t\treturn nil\n\t}\n\tout := new(AutoKillList)\n\tin.DeepCopyInto(out)\n\treturn out\n}", "title": "" }, { "docid": "31a06d94fed3ab4af5f4cf2769fc756a", "score": "0.74673265", "text": "func (in *AutoKillSpec) DeepCopy() *AutoKillSpec {\n\tif in == nil {\n\t\treturn nil\n\t}\n\tout := new(AutoKillSpec)\n\tin.DeepCopyInto(out)\n\treturn out\n}", "title": "" }, { "docid": "0b3a27d04cb5ac7c122d97044d6ecd53", "score": "0.7127884", "text": "func (in *AutoKillStatus) DeepCopy() *AutoKillStatus {\n\tif in == nil {\n\t\treturn nil\n\t}\n\tout := new(AutoKillStatus)\n\tin.DeepCopyInto(out)\n\treturn out\n}", "title": "" }, { "docid": "0fd0a8003b404c3427ba7dcf5a9c2057", "score": "0.5634341", "text": "func (in *AutoManagement) DeepCopy() *AutoManagement {\n\tif in == nil {\n\t\treturn nil\n\t}\n\tout := new(AutoManagement)\n\tin.DeepCopyInto(out)\n\treturn out\n}", "title": "" }, { "docid": "91b0bcbff7be7adb859fef50547df83d", "score": "0.5084066", "text": "func (in *AutoKill) DeepCopyObject() runtime.Object {\n\tif c := in.DeepCopy(); c != nil {\n\t\treturn c\n\t}\n\treturn nil\n}", "title": "" }, { "docid": "ddcda0d9ff1fe724e29a8dd4fdb25e93", "score": "0.49900275", "text": "func (a *App) Kill() {\n\ta.cmd.Kill()\n}", "title": "" }, { "docid": "f8f97a86fd90616de5a569c124e0a6f7", "score": "0.4768907", "text": "func (d *Driver) Kill() error {\n\tlog.Debug(\"Killing...\")\n\t//TODO: implement power off , is there a force?\n\treturn nil\n}", "title": "" }, { "docid": "36d13e9d9660455b68e5ce40481c7c70", "score": "0.47510102", "text": "func (oplist *OptionsList) Kill() {\n\toplist.killed = true\n}", "title": "" }, { "docid": "1a05af64d03fb0776e12b4a78ff04b2b", "score": "0.46673313", "text": "func Kill(taskID, agentID string) *scheduler.Call {\n\treturn &scheduler.Call{\n\t\tType: scheduler.Call_KILL.Enum(),\n\t\tKill: &scheduler.Call_Kill{\n\t\t\tTaskID: mesos.TaskID{Value: taskID},\n\t\t\tAgentID: optionalAgentID(agentID),\n\t\t},\n\t}\n}", "title": "" }, { "docid": "88f8edd96b81ef695a70e4084fe55d14", "score": "0.4649623", "text": "func (m *TimeServiceManager) Kill() {\n\tif len(m.Instances) > 0 {\n\t\tn := rand.Intn(len(m.Instances))\n\t\tclose(m.Instances[n].Dead)\n\t\tm.Instances = append(m.Instances[:n], m.Instances[n+1:]...)\n\t}\n}", "title": "" }, { "docid": "88f8edd96b81ef695a70e4084fe55d14", "score": "0.4649623", "text": "func (m *TimeServiceManager) Kill() {\n\tif len(m.Instances) > 0 {\n\t\tn := rand.Intn(len(m.Instances))\n\t\tclose(m.Instances[n].Dead)\n\t\tm.Instances = append(m.Instances[:n], m.Instances[n+1:]...)\n\t}\n}", "title": "" }, { "docid": "940b19c7fcbb738b25b6445b41e60918", "score": "0.46474195", "text": "func (g *Game) ExecuteKill(value *VoteCommandValue) {\n\tif value == nil {\n\t\treturn\n\t}\n\n\tcmd := InGameCommand{\n\t\tType: Kill,\n\t\tMember: g.Members[value.Value],\n\t}\n\n\t// kill command should be first, heal last to remove a kill by the heal\n\tg.Commands = append([]InGameCommand{cmd}, g.Commands...)\n}", "title": "" }, { "docid": "6ec355ebda5a45539a515ee3f44b4194", "score": "0.46100786", "text": "func (d *Driver) Kill() error {\n\treturn d.Stop()\n\treturn nil\n}", "title": "" }, { "docid": "c8a6de1204755f47b68b3f2f8c954ff9", "score": "0.45984036", "text": "func (_NXlottery *NXlotteryTransactor) Kill(opts *bind.TransactOpts) (*types.Transaction, error) {\n\treturn _NXlottery.contract.Transact(opts, \"kill\")\n}", "title": "" }, { "docid": "fe578e0ac546305a232ae57a47e5ffc9", "score": "0.4593954", "text": "func (d *Driver) Kill() error {\n\treturn d.Stop()\n}", "title": "" }, { "docid": "6fc72f4a978562797c11fa76f9d35dce", "score": "0.45713627", "text": "func (b *Boomer) SetAutoStart() {\n\tb.masterRunner.autoStart = true\n}", "title": "" }, { "docid": "7238affd7ec3aed11df3b9a82fad69d7", "score": "0.45641148", "text": "func (in *MachinePoolAutoscaling) DeepCopy() *MachinePoolAutoscaling {\n\tif in == nil {\n\t\treturn nil\n\t}\n\tout := new(MachinePoolAutoscaling)\n\tin.DeepCopyInto(out)\n\treturn out\n}", "title": "" }, { "docid": "5cac1c33033a382ba549a6b752df0d2d", "score": "0.45615858", "text": "func (k Killer) Kill() {\n\tselect {\n\tcase <-k.c:\n\t\t// Already sent a kill signal. Do nothing.\n\tdefault:\n\t\tclose(k.c)\n\t}\n}", "title": "" }, { "docid": "11055198837e10dab503f1c656db610a", "score": "0.45377842", "text": "func (p *Person) Kill() {\n\tif !p.isAlive {\n\t\tpanic(fmt.Errorf(\"Cannot kill already dead person at position: %d\", p.position))\n\t}\n\tp.isAlive = false\n}", "title": "" }, { "docid": "5bef9bcfecf70011d6a394bd348f4d48", "score": "0.4532601", "text": "func (d *Driver) Kill() error {\n\tlog.Debug(\"Killing...\")\n\t_, err := d.getClient().ShutdownInstance(context.TODO(), d.InstanceID)\n\treturn err\n}", "title": "" }, { "docid": "33b33cf2b2f57093b21f344fa0dd49a8", "score": "0.45267433", "text": "func (in *ScheduledBehavior) DeepCopy() *ScheduledBehavior {\n\tif in == nil {\n\t\treturn nil\n\t}\n\tout := new(ScheduledBehavior)\n\tin.DeepCopyInto(out)\n\treturn out\n}", "title": "" }, { "docid": "f020fdf5a0a8abcba154d1597334a8ea", "score": "0.45019436", "text": "func (in *AutoKill) DeepCopyInto(out *AutoKill) {\n\t*out = *in\n\tout.TypeMeta = in.TypeMeta\n\tin.ObjectMeta.DeepCopyInto(&out.ObjectMeta)\n\tout.Spec = in.Spec\n\tout.Status = in.Status\n\treturn\n}", "title": "" }, { "docid": "5fd69e96b72b4d95a94ef4a86edf2518", "score": "0.4501338", "text": "func (o EcsInstanceSetOutput) AutoReleaseTime() pulumi.StringPtrOutput {\n\treturn o.ApplyT(func(v *EcsInstanceSet) pulumi.StringPtrOutput { return v.AutoReleaseTime }).(pulumi.StringPtrOutput)\n}", "title": "" }, { "docid": "4cbc9c02d34c411ddf9b86c1d1d8566e", "score": "0.44770545", "text": "func (s *Service) UnregisterAutoExecute() error {\n\treturn s.disableExecute()\n}", "title": "" }, { "docid": "1aa1734161a67a916b48ec2da12a3b4b", "score": "0.4476334", "text": "func Kill(cmd *exec.Cmd) error {\n\treturn kill.Kill(cmd)\n}", "title": "" }, { "docid": "eb3319fda60ceed12afec57661bd4109", "score": "0.4475953", "text": "func (_NXlottery *NXlotterySession) Kill() (*types.Transaction, error) {\n\treturn _NXlottery.Contract.Kill(&_NXlottery.TransactOpts)\n}", "title": "" }, { "docid": "197a413f36604a37e045dac2c3905e2b", "score": "0.44746256", "text": "func (r *Routines) Kill(force bool) {\n\tr.killMU.Lock()\n\tdefer r.killMU.Unlock()\n\tr.kill = true\n}", "title": "" }, { "docid": "2e234e5fa7852be85d6956214a988903", "score": "0.4472498", "text": "func (room *RClient) Kill(conn *Connection, action int32) {\n\troom.s.DoWithOther(conn, func() {\n\t\tif !room.p.isAlive(conn) {\n\t\t\treturn\n\t\t}\n\n\t\troom.p.SetFinished(conn)\n\t\troom.re.Kill(conn, action, room.isDeathMatch)\n\t\troom.e.tryFinish()\n\t})\n}", "title": "" }, { "docid": "c0c8a092abd717523bb9eb4c79576b76", "score": "0.44691336", "text": "func (_NXlottery *NXlotteryTransactorSession) Kill() (*types.Transaction, error) {\n\treturn _NXlottery.Contract.Kill(&_NXlottery.TransactOpts)\n}", "title": "" }, { "docid": "5c7712be4566fa8256b44b9ba6d76dd5", "score": "0.4466785", "text": "func (in *NodepoolAutoscaling) DeepCopy() *NodepoolAutoscaling {\n\tif in == nil {\n\t\treturn nil\n\t}\n\tout := new(NodepoolAutoscaling)\n\tin.DeepCopyInto(out)\n\treturn out\n}", "title": "" }, { "docid": "2b580ce557700be918127b1f22d5a708", "score": "0.44472712", "text": "func (d *Driver) Kill() error {\n\n\tif d.ApplicationID == \"\" {\n\t\tlog.Warnf(\"ApplicationId is not set.\")\n\t\treturn nil\n\t}\n\n\t_, err := application.Application(d.ComposeClient, d.ApplicationID)\n\n\tif err != nil {\n\t\tlog.Warnf(\"Application having id [%s] does not exists\", d.ApplicationID)\n\t\treturn nil\n\t}\n\n\t_, err = Delete(d.ComposeClient, d.ApplicationID)\n\tif err != nil {\n\t\tlog.Warnf(\"Error while killing application [%s]\", d.ApplicationID)\n\t\treturn nil\n\t}\n\treturn err\n}", "title": "" }, { "docid": "5db698b58a18b8843b99c3163aeea978", "score": "0.44331864", "text": "func (r *RunRunc) Kill(log lager.Logger, handle string) error {\n\tlog = log.Session(\"kill\", lager.Data{\"handle\": handle})\n\n\tlog.Info(\"started\")\n\tdefer log.Info(\"finished\")\n\n\tif err := r.commandRunner.Run(r.runc.KillCommand(handle, \"KILL\")); err != nil {\n\t\tlog.Error(\"run-failed\", err)\n\t\treturn err\n\t}\n\n\treturn nil\n}", "title": "" }, { "docid": "13fe961dd2ae314d49b631a30e2c521d", "score": "0.44111255", "text": "func (r *Runner) Kill() {\n\tif r == nil {\n\t\treturn\n\t}\n\tr.ticker.Stop()\n\tclose(r.stop)\n\tr.cancelF()\n\t<-r.loopFinished\n\tr.metric.Event(metrics.EventKill)\n}", "title": "" }, { "docid": "b70384d1dd74d7884a66d5409a869043", "score": "0.4403845", "text": "func (d *Driver) Kill() error {\n\tvapp, err := d.getVApp()\n\tif err != nil {\n\t\treturn err\n\t}\n\n\ttask, err := vapp.PowerOff()\n\tif err != nil {\n\t\treturn err\n\t}\n\tif err = task.WaitTaskCompletion(); err != nil {\n\t\treturn err\n\t}\n\n\treturn nil\n}", "title": "" }, { "docid": "3d26f0a0a9bd5196dd08ea877117555c", "score": "0.4375525", "text": "func (_Mortal *MortalTransactor) Kill(opts *bind.TransactOpts) (*types.Transaction, error) {\n\treturn _Mortal.contract.Transact(opts, \"kill\")\n}", "title": "" }, { "docid": "833beb41e0af402744442b2e5ee931e3", "score": "0.43699047", "text": "func (_MetaContract *MetaContractTransactor) Kill(opts *bind.TransactOpts) (*types.Transaction, error) {\n\treturn _MetaContract.contract.Transact(opts, \"kill\")\n}", "title": "" }, { "docid": "d30d6e521583d69a1028f7373c7dc756", "score": "0.43685454", "text": "func (pm *PM) Kill(cmdID string) {\n\tv, o := pm.runners[cmdID]\n\tif o {\n\t\tv.Kill()\n\t}\n}", "title": "" }, { "docid": "3b5b2d145a89ea1898edda5ed16eb004", "score": "0.4353627", "text": "func (r DeleteAutomaticTapeCreationPolicyRequest) Send(ctx context.Context) (*DeleteAutomaticTapeCreationPolicyResponse, 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 := &DeleteAutomaticTapeCreationPolicyResponse{\n\t\tDeleteAutomaticTapeCreationPolicyOutput: r.Request.Data.(*DeleteAutomaticTapeCreationPolicyOutput),\n\t\tresponse: &aws.Response{Request: r.Request},\n\t}\n\n\treturn resp, nil\n}", "title": "" }, { "docid": "d23bfa8bf00c3ee4763f499ef163f2b2", "score": "0.43406916", "text": "func (in *AutoKillList) DeepCopyObject() runtime.Object {\n\tif c := in.DeepCopy(); c != nil {\n\t\treturn c\n\t}\n\treturn nil\n}", "title": "" }, { "docid": "6791dede4b57df0a570d1ed066b75db8", "score": "0.43325126", "text": "func (o InstanceBootDiskOutput) AutoDelete() pulumi.BoolPtrOutput {\n\treturn o.ApplyT(func(v InstanceBootDisk) *bool { return v.AutoDelete }).(pulumi.BoolPtrOutput)\n}", "title": "" }, { "docid": "f454cb4160b004514ab93d228cb5747c", "score": "0.4332062", "text": "func (j *Job) Kill() *Job {\n\tj.begin(j.ctx, \"Kill()\")\n\tjob, jobArray, err := j.jobCheck()\n\tif err != nil {\n\t\tj.lastError = err\n\t\treturn j\n\t}\n\tif job != nil {\n\t\tj.lastError = job.Terminate()\n\t\treturn j\n\t}\n\tj.lastError = jobArray.Terminate()\n\treturn j\n}", "title": "" }, { "docid": "bb905b547afaf4bfa0998cd9870e46d9", "score": "0.4321444", "text": "func (o SubscriptionOutput) AutoDeleteOnIdle() pulumi.StringOutput {\n\treturn o.ApplyT(func(v *Subscription) pulumi.StringOutput { return v.AutoDeleteOnIdle }).(pulumi.StringOutput)\n}", "title": "" }, { "docid": "50ddb01027865d35c6b7ee53ef742b48", "score": "0.43128097", "text": "func (o InstanceBootDiskPtrOutput) AutoDelete() pulumi.BoolPtrOutput {\n\treturn o.ApplyT(func(v *InstanceBootDisk) *bool {\n\t\tif v == nil {\n\t\t\treturn nil\n\t\t}\n\t\treturn v.AutoDelete\n\t}).(pulumi.BoolPtrOutput)\n}", "title": "" }, { "docid": "6b5ca964c4087c1b216419976b879550", "score": "0.4295326", "text": "func (in *ClusterNodePoolAutoConfig) DeepCopy() *ClusterNodePoolAutoConfig {\n\tif in == nil {\n\t\treturn nil\n\t}\n\tout := new(ClusterNodePoolAutoConfig)\n\tin.DeepCopyInto(out)\n\treturn out\n}", "title": "" }, { "docid": "93900bc807367927fdb974406acf1a98", "score": "0.42870036", "text": "func (b *ContainerBuilder) AutoRemove(v bool) *ContainerBuilder {\n\tb.HostConfig.AutoRemove = v\n\n\treturn b\n}", "title": "" }, { "docid": "dec6a47ded437c9b1411024f60cef68c", "score": "0.42863697", "text": "func Kill(pid int) error {\n\treturn Signal(pid, 9)\n}", "title": "" }, { "docid": "9fa36c5f13f62d0728186e23fb7dd333", "score": "0.428454", "text": "func (in *ClusterAutoscaling) DeepCopy() *ClusterAutoscaling {\n\tif in == nil {\n\t\treturn nil\n\t}\n\tout := new(ClusterAutoscaling)\n\tin.DeepCopyInto(out)\n\treturn out\n}", "title": "" }, { "docid": "f1cee2e76a433a05525850d8291ad9ad", "score": "0.4281027", "text": "func (o InstanceTemplateDiskOutput) AutoDelete() pulumi.BoolPtrOutput {\n\treturn o.ApplyT(func(v InstanceTemplateDisk) *bool { return v.AutoDelete }).(pulumi.BoolPtrOutput)\n}", "title": "" }, { "docid": "f8fa4a1ff91a1a38771d7e8391708460", "score": "0.42737514", "text": "func (o InstanceOutput) AutoReleaseTime() pulumi.StringPtrOutput {\n\treturn o.ApplyT(func(v *Instance) pulumi.StringPtrOutput { return v.AutoReleaseTime }).(pulumi.StringPtrOutput)\n}", "title": "" }, { "docid": "b5ffe37de40e6d3c5b32834061dab9a1", "score": "0.42668912", "text": "func (o ReservationOutput) Autoscale() ReservationAutoscalePtrOutput {\n\treturn o.ApplyT(func(v *Reservation) ReservationAutoscalePtrOutput { return v.Autoscale }).(ReservationAutoscalePtrOutput)\n}", "title": "" }, { "docid": "d300e1b13907a41a642e5774aa74dd8e", "score": "0.42546415", "text": "func (c *ClientReal) ScriptKill() StatusCmd {\n\treturn &StatusCmdReal{statusCmd: c.client.ScriptKill()}\n}", "title": "" }, { "docid": "be3f13b370504e0d42c3c89d6f28b231", "score": "0.42477515", "text": "func (m *Data) Kill(inst instance, plr player) {\n\tinst.RemoveMob(m.spawnID, 0x0)\n\tplr.GiveEXP(m.exp, true, false)\n}", "title": "" }, { "docid": "be3f13b370504e0d42c3c89d6f28b231", "score": "0.42477515", "text": "func (m *Data) Kill(inst instance, plr player) {\n\tinst.RemoveMob(m.spawnID, 0x0)\n\tplr.GiveEXP(m.exp, true, false)\n}", "title": "" }, { "docid": "f0067fa5aa0f343887b4cd081553f88d", "score": "0.42412573", "text": "func (rf *Raft) Kill() {\n\tatomic.StoreInt32(&rf.dead, 1)\n}", "title": "" }, { "docid": "f0067fa5aa0f343887b4cd081553f88d", "score": "0.42412573", "text": "func (rf *Raft) Kill() {\n\tatomic.StoreInt32(&rf.dead, 1)\n}", "title": "" }, { "docid": "67264786a88eb682a0b36ce706ace8d2", "score": "0.42318228", "text": "func Auto() Generator {\n\treturn Func(func() interface{} {\n\t\treturn auto{}\n\t})\n}", "title": "" }, { "docid": "f341ed7333e0e8bef1f69fb311db9b82", "score": "0.42154136", "text": "func (o GetInstanceBootDiskOutput) AutoDelete() pulumi.BoolOutput {\n\treturn o.ApplyT(func(v GetInstanceBootDisk) bool { return v.AutoDelete }).(pulumi.BoolOutput)\n}", "title": "" }, { "docid": "ecb40f0ed25557d88342e2ea2f0c14a8", "score": "0.421265", "text": "func (in *ClusterHorizontalPodAutoscaling) DeepCopy() *ClusterHorizontalPodAutoscaling {\n\tif in == nil {\n\t\treturn nil\n\t}\n\tout := new(ClusterHorizontalPodAutoscaling)\n\tin.DeepCopyInto(out)\n\treturn out\n}", "title": "" }, { "docid": "66f3647a31e13ee8842d6451e872b62a", "score": "0.42081997", "text": "func (o InstanceSchedulingOutput) AutomaticRestart() pulumi.BoolPtrOutput {\n\treturn o.ApplyT(func(v InstanceScheduling) *bool { return v.AutomaticRestart }).(pulumi.BoolPtrOutput)\n}", "title": "" }, { "docid": "376d30295adc3c498922cd41ad32d72c", "score": "0.42011783", "text": "func (in *DataprocAutoscalingPolicy) DeepCopy() *DataprocAutoscalingPolicy {\n\tif in == nil {\n\t\treturn nil\n\t}\n\tout := new(DataprocAutoscalingPolicy)\n\tin.DeepCopyInto(out)\n\treturn out\n}", "title": "" }, { "docid": "4edae2514f136ce8e7ae585f757d2d8f", "score": "0.41969615", "text": "func (rf *Raft) Kill() {\n\t// Your code here, if desired.\n\trf.killed <- 1\n}", "title": "" }, { "docid": "bdfe4c4c8e1a46bbb146020f7fff6a6a", "score": "0.4189826", "text": "func (o LookupTopicResultOutput) AutoDeleteOnIdle() pulumi.StringOutput {\n\treturn o.ApplyT(func(v LookupTopicResult) string { return v.AutoDeleteOnIdle }).(pulumi.StringOutput)\n}", "title": "" }, { "docid": "1c2b85f6df16c9e0e660f8feb8fefc8c", "score": "0.417628", "text": "func (i *Instance) Kill() error {\n\tvar err error\n\tif i.piped != nil {\n\t\terr = i.piped.Process.Kill()\n\t}\n\tif err2 := i.cmd.Process.Kill(); err2 != nil {\n\t\treturn err2\n\t}\n\treturn err\n}", "title": "" }, { "docid": "1592f60f9f83a0db0a9d8022cb250e1a", "score": "0.41622263", "text": "func (in *AutoScalingSpec) DeepCopy() *AutoScalingSpec {\n\tif in == nil {\n\t\treturn nil\n\t}\n\tout := new(AutoScalingSpec)\n\tin.DeepCopyInto(out)\n\treturn out\n}", "title": "" }, { "docid": "6471fb755b6bf50ea099f7ca3635c799", "score": "0.41570064", "text": "func (sm *ShardMaster) Kill() {\n\tsm.dead = true\n\tsm.l.Close()\n\tsm.px.Kill()\n}", "title": "" }, { "docid": "9cab9efddaef0c14db32c130316454af", "score": "0.4152463", "text": "func (e *ExchangeDeclare) SetAutoDelete(autoDelete bool) *ExchangeDeclare {\n\te.AutoDelete = autoDelete\n\treturn e\n}", "title": "" }, { "docid": "697185ecef8ec5cfaa6f1e6fe66e1c8a", "score": "0.41501746", "text": "func (kv *ShardKV) Kill() {\n\tkv.rf.Kill()\n\tselect {\n\tcase <-kv.killChan:\n\tdefault:\n\t}\n\tkv.killChan <- true\n}", "title": "" }, { "docid": "d171737f4d31bf60e3f28a418402d246", "score": "0.4141815", "text": "func (_MetaContract *MetaContractTransactorSession) Kill() (*types.Transaction, error) {\n\treturn _MetaContract.Contract.Kill(&_MetaContract.TransactOpts)\n}", "title": "" }, { "docid": "e8b466edbc6eace0683d6561170497c1", "score": "0.41382885", "text": "func (_Mortal *MortalTransactorSession) Kill() (*types.Transaction, error) {\n\treturn _Mortal.Contract.Kill(&_Mortal.TransactOpts)\n}", "title": "" }, { "docid": "613b1356e49f35a5385b42b28ca1abc7", "score": "0.41291982", "text": "func (sm *ShardMaster) Kill() {\n\tatomic.StoreInt32(&sm.dead, 1)\n\tsm.l.Close()\n\tsm.px.Kill()\n}", "title": "" }, { "docid": "613b1356e49f35a5385b42b28ca1abc7", "score": "0.41291982", "text": "func (sm *ShardMaster) Kill() {\n\tatomic.StoreInt32(&sm.dead, 1)\n\tsm.l.Close()\n\tsm.px.Kill()\n}", "title": "" }, { "docid": "613b1356e49f35a5385b42b28ca1abc7", "score": "0.41291982", "text": "func (sm *ShardMaster) Kill() {\n\tatomic.StoreInt32(&sm.dead, 1)\n\tsm.l.Close()\n\tsm.px.Kill()\n}", "title": "" }, { "docid": "4c0c57895784900e6b3e7e16391c3cb5", "score": "0.4127592", "text": "func (s *Stream) SetKillDelay(killDelay time.Duration) {\n\t// Validate the kill delay time.\n\tif killDelay < 0 {\n\t\tpanic(\"negative kill delay specified\")\n\t}\n\n\t// Lock and defer release of the kill delay lock.\n\ts.killDelayLock.Lock()\n\tdefer s.killDelayLock.Unlock()\n\n\t// Set the kill delay.\n\ts.killDelay = killDelay\n}", "title": "" }, { "docid": "9c40309763bb4b9fe996c8cc692b13f3", "score": "0.41235977", "text": "func (d *Client) SetAutoAttach() *SetAutoAttachRequest {\n\treturn &SetAutoAttachRequest{opts: make(map[string]interface{}), client: d.Client}\n}", "title": "" }, { "docid": "722c48ba54f8b807b5740aea942ecb1b", "score": "0.4109419", "text": "func (o InstanceTemplateSchedulingOutput) AutomaticRestart() pulumi.BoolPtrOutput {\n\treturn o.ApplyT(func(v InstanceTemplateScheduling) *bool { return v.AutomaticRestart }).(pulumi.BoolPtrOutput)\n}", "title": "" }, { "docid": "183ca690dff9cbeb8f64b1103b97da6e", "score": "0.4108219", "text": "func (o InstanceSchedulingPtrOutput) AutomaticRestart() pulumi.BoolPtrOutput {\n\treturn o.ApplyT(func(v *InstanceScheduling) *bool {\n\t\tif v == nil {\n\t\t\treturn nil\n\t\t}\n\t\treturn v.AutomaticRestart\n\t}).(pulumi.BoolPtrOutput)\n}", "title": "" }, { "docid": "804b9488994c2e3a85fe8713e54880a7", "score": "0.41029054", "text": "func (in *ClusterAutoProvisioningDefaults) DeepCopy() *ClusterAutoProvisioningDefaults {\n\tif in == nil {\n\t\treturn nil\n\t}\n\tout := new(ClusterAutoProvisioningDefaults)\n\tin.DeepCopyInto(out)\n\treturn out\n}", "title": "" }, { "docid": "f21ba55d189e17069c5cf2f59661aed1", "score": "0.40935424", "text": "func (rf *Raft) Kill() {\n\trf.logger.L(logger.RaftShutdown, \"raft killed #######\\n\")\n\tatomic.StoreInt32(&rf.dead, 1)\n\t// Your code here, if desired.\n}", "title": "" }, { "docid": "9a352bdf68110c435b708911e496ba7d", "score": "0.40916738", "text": "func (_Mortal *MortalSession) Kill() (*types.Transaction, error) {\n\treturn _Mortal.Contract.Kill(&_Mortal.TransactOpts)\n}", "title": "" }, { "docid": "35f1054e42113c1cd880c89c04f2b8b4", "score": "0.40902698", "text": "func (e EndpointsMonitoringV1Server) AutoDeleteMirrorSession(ctx context.Context, in MirrorSession) (MirrorSession, error) {\n\tresp, err := e.AutoDeleteMirrorSessionEndpoint(ctx, in)\n\tif err != nil {\n\t\treturn MirrorSession{}, err\n\t}\n\treturn *resp.(*MirrorSession), nil\n}", "title": "" }, { "docid": "a8b86666fa10fd0a9af5b5d3e211b91c", "score": "0.40874544", "text": "func (rf *Raft) Kill() {\n\t// atomic.StoreInt32(&rf.dead, 1)\n\t// Your code here, if desired.\n\trf.mu.Lock()\n\trf.dead = 1\n\trf.mu.Unlock()\n}", "title": "" }, { "docid": "5e61430fcbdbcddf08e54de12b520ce2", "score": "0.40860662", "text": "func (e EndpointsMonitoringV1Client) AutoDeleteMirrorSession(ctx context.Context, in *MirrorSession) (*MirrorSession, error) {\n\tresp, err := e.AutoDeleteMirrorSessionEndpoint(ctx, in)\n\tif err != nil {\n\t\treturn &MirrorSession{}, err\n\t}\n\treturn resp.(*MirrorSession), nil\n}", "title": "" }, { "docid": "20de040438f43e628c626d45885ae429", "score": "0.40624428", "text": "func (o *Disk) SetAutoDelete(v *bool) *Disk {\n\tif o.AutoDelete = v; o.AutoDelete == nil {\n\t\to.nullFields = append(o.nullFields, \"AutoDelete\")\n\t}\n\treturn o\n}", "title": "" }, { "docid": "769e5e149f9fce8152ed64be637d6746", "score": "0.40610564", "text": "func (s *sig) Kill() {\n\tatomic.StoreInt32(&s.keepAlive, 0)\n\ts.interrupt <- os.Kill\n\n\t// Block and wait for the program to exit\n\tblock := make(chan struct{})\n\t<-block\n}", "title": "" }, { "docid": "36da052be3055268c309c5aaca96175a", "score": "0.40597284", "text": "func (sm *ShardMaster) Kill() {\n\tsm.rf.Kill()\n\t// Your code here, if desired.\n\tatomic.StoreInt32(&sm.dead, 1)\n}", "title": "" }, { "docid": "a70b1fcb2860d4a9e6fff19417135ecf", "score": "0.4051783", "text": "func (_MetaContract *MetaContractSession) Kill() (*types.Transaction, error) {\n\treturn _MetaContract.Contract.Kill(&_MetaContract.TransactOpts)\n}", "title": "" }, { "docid": "f4cedd03a8700c0adba066f4f69f47c2", "score": "0.40510017", "text": "func (rf *Raft) Kill() {\n\tatomic.StoreInt32(&rf.dead, 1)\n\t// Your code here, if desired.\n}", "title": "" }, { "docid": "f4cedd03a8700c0adba066f4f69f47c2", "score": "0.40510017", "text": "func (rf *Raft) Kill() {\n\tatomic.StoreInt32(&rf.dead, 1)\n\t// Your code here, if desired.\n}", "title": "" }, { "docid": "f4cedd03a8700c0adba066f4f69f47c2", "score": "0.40510017", "text": "func (rf *Raft) Kill() {\n\tatomic.StoreInt32(&rf.dead, 1)\n\t// Your code here, if desired.\n}", "title": "" }, { "docid": "f4cedd03a8700c0adba066f4f69f47c2", "score": "0.40510017", "text": "func (rf *Raft) Kill() {\n\tatomic.StoreInt32(&rf.dead, 1)\n\t// Your code here, if desired.\n}", "title": "" }, { "docid": "f4cedd03a8700c0adba066f4f69f47c2", "score": "0.40510017", "text": "func (rf *Raft) Kill() {\n\tatomic.StoreInt32(&rf.dead, 1)\n\t// Your code here, if desired.\n}", "title": "" }, { "docid": "f4cedd03a8700c0adba066f4f69f47c2", "score": "0.40510017", "text": "func (rf *Raft) Kill() {\n\tatomic.StoreInt32(&rf.dead, 1)\n\t// Your code here, if desired.\n}", "title": "" }, { "docid": "f4cedd03a8700c0adba066f4f69f47c2", "score": "0.40510017", "text": "func (rf *Raft) Kill() {\n\tatomic.StoreInt32(&rf.dead, 1)\n\t// Your code here, if desired.\n}", "title": "" }, { "docid": "f4cedd03a8700c0adba066f4f69f47c2", "score": "0.40510017", "text": "func (rf *Raft) Kill() {\n\tatomic.StoreInt32(&rf.dead, 1)\n\t// Your code here, if desired.\n}", "title": "" }, { "docid": "30477fc8fd94ad830e35cfca40cfb810", "score": "0.4044167", "text": "func (sm *ShardMaster) Kill() {\n\tsm.rf.Kill()\n\t// Your code here, if desired.\n\tsm.killCh <- true\n}", "title": "" }, { "docid": "9f299de4101f11bbcf5f6236034c5a76", "score": "0.4041864", "text": "func (rf *Raft) Kill() {\n\t// Your code here, if desired.\n\trf.mu.Lock()\n\trf.isKilled = true\n\trf.mu.Unlock()\n\tclose(rf.isKilledChan)\n}", "title": "" }, { "docid": "449a65bbf11480b981fad1ec54584ee8", "score": "0.40412027", "text": "func (rf *Raft) Kill() {\n\t// Your code here, if desired.\n\trf.mu.Lock()\n\trf.killed = true\n\trf.mu.Unlock()\n}", "title": "" }, { "docid": "ab49c445f5d0b100171f3e1fb0ab9670", "score": "0.4039323", "text": "func (o InstanceTemplateSchedulingPtrOutput) AutomaticRestart() pulumi.BoolPtrOutput {\n\treturn o.ApplyT(func(v *InstanceTemplateScheduling) *bool {\n\t\tif v == nil {\n\t\t\treturn nil\n\t\t}\n\t\treturn v.AutomaticRestart\n\t}).(pulumi.BoolPtrOutput)\n}", "title": "" }, { "docid": "ad4a9756ddfd7e6440c7240f94f43253", "score": "0.4022301", "text": "func (in *TektonTargetReapPolicy) DeepCopy() *TektonTargetReapPolicy {\n\tif in == nil {\n\t\treturn nil\n\t}\n\tout := new(TektonTargetReapPolicy)\n\tin.DeepCopyInto(out)\n\treturn out\n}", "title": "" }, { "docid": "2b921b7cef7d5aa463ea7539ae14ea35", "score": "0.4021329", "text": "func (e EndpointsMonitoringV1Client) AutoDeleteAlertDestination(ctx context.Context, in *AlertDestination) (*AlertDestination, error) {\n\tresp, err := e.AutoDeleteAlertDestinationEndpoint(ctx, in)\n\tif err != nil {\n\t\treturn &AlertDestination{}, err\n\t}\n\treturn resp.(*AlertDestination), nil\n}", "title": "" } ]
582bf7af2e95c24959891b48721a9c85
Render must be called at the end of rendering.
[ { "docid": "83e58518d5da4af789c631a6d5fc1a46", "score": "0.64728403", "text": "func (context *Context) Render() {\n\timgui.Render()\n\tcontext.renderDrawData(imgui.RenderedDrawData())\n}", "title": "" } ]
[ { "docid": "356f17187a3011a9b7bc4a09341b25fb", "score": "0.691963", "text": "func (r *Ris) Render() {\n\tr.render()\n}", "title": "" }, { "docid": "22afcd40e50d96946e31ae96c491fd91", "score": "0.6604884", "text": "func (e *entry) Render() {\n\tsw := util.Start()\n\te.button.Render()\n\tif e.list != nil && e.enabled {\n\t\te.list.Render()\n\t}\n\tsw.StopRecordAverage(e.String() + \".Render\")\n}", "title": "" }, { "docid": "443a2ba80333839a5bf8f370bc14fae0", "score": "0.6409419", "text": "func (ctx *Context) Render(bytes []byte) {\n\t//debug\n\t//fmt.Println(\"response msg = \", string(bytes))\n\tctx.Writer.WriteHeader(200)\n\t_, err := ctx.Writer.Write(bytes)\n\tif err != nil {\n\t\tpanic(err)\n\t}\n}", "title": "" }, { "docid": "b35b226e86bac875f89f363d3f53ef91", "score": "0.640148", "text": "func (c *Component) OnRender() {\n\t// Logger.Trace().Str(\"component\", c.GetName()).Msg(\"OnRender\")\n}", "title": "" }, { "docid": "6baa12d80d0447a34ae1842ec0186749", "score": "0.6373327", "text": "func (w *Window) Render() {\n\t// Signal to the graphics loop to render a frame.\n\tw.render <- struct{}{}\n\n\t// Wait for the render to complete.\n\t<-w.render\n}", "title": "" }, { "docid": "b74b90f135feface2cd330e97bb45e46", "score": "0.63611066", "text": "func (ob *Object) Render() {\n\tob.image.Draw(ob.x, ob.y, allegro.FLIP_NONE)\n}", "title": "" }, { "docid": "246d2eb0ba2d93af142e8ab6b7500e74", "score": "0.63600624", "text": "func (rd *ScheduleResponse) Render(w http.ResponseWriter, r *http.Request) error {\n\t// Pre-processing before a response is marshalled and sent across the wire\n\treturn nil\n}", "title": "" }, { "docid": "207e75b60e2b1aa092254aab599847d7", "score": "0.6342066", "text": "func (r *Renderer) Render() {\n\tgl.DrawArrays(gl.TRIANGLES, 0, int32(len(r.RawRenderer)*4))\n}", "title": "" }, { "docid": "c277e8bd0fd10a64511781afcdf07e33", "score": "0.6311119", "text": "func (gm *GraphicsManager) Render(compsToSend *common.Vector) {\n\thandlerIndex := 0\n\tdefer gm.handleClosedGraphicsHandler(handlerIndex)\n\n\t//common.LogInfo.Println(compsToSend)\n\tfor handlerIndex = range gm.graphicsHandlersLink {\n\t\tif gm.graphicsHandlersLink[handlerIndex] == nil {\n\t\t\tcontinue\n\t\t}\n\t\tgm.graphicsHandlersLink[handlerIndex] <- compsToSend\n\t}\n}", "title": "" }, { "docid": "5d86d32c560b75bef52e51260008e0bd", "score": "0.6290279", "text": "func (tr *TradeResponse) Render(w http.ResponseWriter, r *http.Request) error {\n\treturn nil\n}", "title": "" }, { "docid": "05e847b4e7a5a3537fb4786be0ec02ec", "score": "0.62852794", "text": "func Render(w http.ResponseWriter, r *http.Request, v Renderer) error {\n\tif err := renderer(w, r, v); err != nil {\n\t\treturn err\n\t}\n\tRespond(w, r, v)\n\treturn nil\n}", "title": "" }, { "docid": "234f28a42a029ac05546b728fd9424e0", "score": "0.62723035", "text": "func (rd *DeleteResponse) Render(w http.ResponseWriter, r *http.Request) error {\n\t// Pre-processing before a response is marshalled and sent across the wire\n\treturn nil\n}", "title": "" }, { "docid": "a469dc665edf7e8992af91b31a63bc74", "score": "0.62491995", "text": "func (rd *MasterScheduleResponse) Render(w http.ResponseWriter, r *http.Request) error {\n\t// Pre-processing before a response is marshalled and sent across the wire\n\treturn nil\n}", "title": "" }, { "docid": "b6a357ef9d9870f41b7510424509e9ce", "score": "0.6247598", "text": "func (r *JSONRenderer) Render(out io.Writer, st *papers.Stats, unread, read papers.AggPapers) {\n\tr.render(out, st, unread, read)\n}", "title": "" }, { "docid": "abbe840a91c2e03bdb711972feeeb217", "score": "0.62252307", "text": "func Render(c Compo) {\n\tUI(func() { render(c) })\n}", "title": "" }, { "docid": "d4c23163fb15598ef26f17a0cc917507", "score": "0.622172", "text": "func (m KubedgeBaseManager) Render(ctx context.Context) (*av1.SubResourceList, error) {\n\treturn m.Renderer.RenderFile(m.PhaseName, m.PhaseNamespace, m.Source.Location)\n}", "title": "" }, { "docid": "887385c48fa4e12e49c2423894ca460d", "score": "0.62106544", "text": "func (c *cartridge) Render() {\n\tc.Cls()\n\tc.PrintAt(fmt.Sprintf(\"counter:%d\", c.counter), c.x, c.y)\n}", "title": "" }, { "docid": "253e0f54624cf55b6cefc38f327046ff", "score": "0.61965835", "text": "func (c *SceneController) OnRender() {\n}", "title": "" }, { "docid": "1b392d881f0d2df30563cb7dd8e244d1", "score": "0.61760944", "text": "func (view *View) Render() {\n\tif view.model.restoreFocus {\n\t\timgui.SetNextWindowFocus()\n\t\tview.model.restoreFocus = false\n\t\tview.model.windowOpen = true\n\t}\n\tif view.model.windowOpen {\n\t\timgui.SetNextWindowSizeV(imgui.Vec2{X: 400 * view.guiScale, Y: 300 * view.guiScale}, imgui.ConditionFirstUseEver)\n\t\tif imgui.BeginV(\"Texts\", view.WindowOpen(), imgui.WindowFlagsNoCollapse) {\n\t\t\tview.renderContent()\n\t\t}\n\t\timgui.End()\n\t}\n}", "title": "" }, { "docid": "8fd66d3a9363a6b1b730f3843f0f0de5", "score": "0.617472", "text": "func (srv *Server) Render() {\n\tsrv.mu.Lock()\n\tdefer srv.mu.Unlock()\n\tif srv.debounce {\n\t\treturn\n\t}\n\tsrv.debounce = true\n\tgo func() {\n\t\t<-time.After(1 * time.Millisecond)\n\t\tsrv.doRender(false)\n\t}()\n}", "title": "" }, { "docid": "9e4097370acd4b315ed6d46cee1c66d9", "score": "0.6164781", "text": "func (r *renderer) Render(w http.ResponseWriter, p ViewModel) {\n\tif r.config.Debug {\n\t\terr := r.initTemplates()\n\t\tif err != nil {\n\t\t\tlog.Printf(err.Error())\n\t\t}\n\t}\n\terr := r.templates.ExecuteTemplate(w, templateName, p)\n\tif err != nil {\n\t\tlog.Fatalln(err.Error())\n\t}\n}", "title": "" }, { "docid": "dd0997ea36c90b60f8a8517b166f7ec7", "score": "0.61565524", "text": "func (c *Board) OnRender() {\n}", "title": "" }, { "docid": "0f74a6ac7e64ee09aa1aef24f9100217", "score": "0.6142529", "text": "func (c *Ctx) Render(code int, b []byte) {\n\tc.W.WriteHeader(code)\n\tc.W.Write(b)\n}", "title": "" }, { "docid": "d0ff2dec3236e799b71b1dfceeacec6e", "score": "0.61380255", "text": "func (tr *UserTradesResponse) Render(w http.ResponseWriter, r *http.Request) error {\n\treturn nil\n}", "title": "" }, { "docid": "f47119f6d43d227b4dbc3c86c4c45292", "score": "0.612788", "text": "func (c *Controller) Render() error {\n\tif !c.EnableRender {\n\t\treturn nil\n\t}\n\trb, err := c.RenderBytes()\n\tif err != nil {\n\t\treturn err\n\t}\n\n\tif c.Ctx.ResponseWriter.Header().Get(\"Content-Type\") == \"\" {\n\t\tc.Ctx.Output.Header(\"Content-Type\", \"text/html; charset=utf-8\")\n\t}\n\n\treturn c.Ctx.Output.Body(rb)\n}", "title": "" }, { "docid": "c4f75e5c88bc5227f12e87c2a2f9c970", "score": "0.6126635", "text": "func (ctx *RecordContext) Render(v interface{}) error {\n\tctx.Renders = append(ctx.Renders, v)\n\treturn ctx.Context.Render(v)\n}", "title": "" }, { "docid": "680da1a2da8b8e386e9f203913a0fcab", "score": "0.6119778", "text": "func (b *Baa) Render() Renderer {\n\treturn b.GetDI(\"render\").(Renderer)\n}", "title": "" }, { "docid": "1e9eed7766b13b6c7528cec5df277918", "score": "0.60952693", "text": "func (h *htmlRender) Render(w io.Writer) error {\n\tif h.Template == nil {\n\t\treturn errors.New(\"template is nil\")\n\t}\n\n\tif h.Layout == \"\" {\n\t\treturn h.Template.Execute(w, h.ViewArgs)\n\t}\n\n\treturn h.Template.ExecuteTemplate(w, h.Layout, h.ViewArgs)\n}", "title": "" }, { "docid": "cab3dce3589b714bc350e0a97941ea13", "score": "0.60951877", "text": "func (c *Context) Render(status int, r Renderer) error {\n\tr.Header(c.response.Header())\n\tc.response.WriteHeader(status)\n\treturn r.Render(c.response)\n}", "title": "" }, { "docid": "166ef20bef93fe8dc38647202e03380f", "score": "0.6080945", "text": "func (c *Context) Render(content string) {\n\t// Write response\n\tc.Response.Write([]byte(content))\n}", "title": "" }, { "docid": "856482d457e5873a15ea2b20b75ba500", "score": "0.6076221", "text": "func (r ErrorRenderer) Render(_ io.Writer, _ interface{}) error { return r.Error }", "title": "" }, { "docid": "f4c50bca3ca5800e78eaf0f37972b376", "score": "0.60699743", "text": "func (c *ZeroContext) Render(s markup.Sync) {\n\tlog.Infof(\"%v rendering: %v\", s.Scope, s.Node.Markup())\n}", "title": "" }, { "docid": "9f1e9ca9c08831bf620dff633e4787c6", "score": "0.6068206", "text": "func (p *PlayScreen) Render() {\n\tp.displayMessages()\n\tp.drawMap(p.world.CurMap, NewPoint(0, 0))\n\tBorder(p.stats, \"Stats\")\n\tBorder(p.info, \"Info\")\n\tBorder(p.skls, \"Skills\")\n\n}", "title": "" }, { "docid": "af4045ec543fbcd0b94fddba9e9dd5ad", "score": "0.60520446", "text": "func (e *Entity) Render() (string, error) {\n\treturn \"\", nil\n}", "title": "" }, { "docid": "a3386c91abc04414c1fc4bddc3363d76", "score": "0.6042123", "text": "func postrender(c *gin.Context) {\n\tvar r Render\n\terr := c.ShouldBind(&r)\n\tfmt.Println(r, err)\n\tb, _ := json.Marshal(r)\n\tview.Save(r.Name, b)\n\t//if render_active {\n\trender_chan <- r\n\trender_update <- r\n\t//}\n}", "title": "" }, { "docid": "d38321c53db7aa90e3705fd3f4aae87c", "score": "0.603672", "text": "func (is *MenuPage) Render(mainWindowSurface *sdl.Surface) {\n\n}", "title": "" }, { "docid": "3b45ab90cc66330ec45bffeb2e193ebc", "score": "0.6020143", "text": "func render(c *gin.Context) {\n\t// fill up the list with the current store listing\n\tfmt.Println(\"RENDER ATTACHED\")\n\t// render_active = true\n\tc.Stream(func(w io.Writer) bool {\n\t\tselect {\n\t\tcase msg := <-render_chan:\n\t\t\tdata, _ := json.Marshal(msg)\n\t\t\tc.SSEvent(\"render\", string(data))\n\t\t}\n\t\treturn true\n\t})\n\t// render_active = false\n\tfmt.Println(\"RENDERER DETACHED\")\n}", "title": "" }, { "docid": "89176b3969ff9d7510f154c1b03be537", "score": "0.6015829", "text": "func (v *View) Render(w http.ResponseWriter, r *http.Request, yield interface{}, ErrorMessages []string) {\n\tw.Header().Set(\"Content-Type\", \"text/html\")\n\n\tvar vd Data\n\tvd.User.ID = r.Header.Get(\"userID\")\n\tadmin, err := strconv.ParseBool(r.Header.Get(\"admin\"))\n\tif err != nil {\n\t\tvd.User.Admin = false\n\t} else {\n\t\tvd.User.Admin = admin\n\t}\n\tvd.ErrorMessages = ErrorMessages\n\tvd.Yield = yield\n\tvd.Messages.Success = flash.GetFlash(w, r, constant.Flash.Success)\n\tvd.Messages.Info = flash.GetFlash(w, r, constant.Flash.Info)\n\n\tv.Template.ExecuteTemplate(w, v.Layout, vd)\n}", "title": "" }, { "docid": "bef65b81626714b8ac25899e25b55c02", "score": "0.6014334", "text": "func (b *BaseElement) RenderPost() {\n}", "title": "" }, { "docid": "c80041ce480cf78772052b1ddfc3641c", "score": "0.5983812", "text": "func Render(c Compo) {\n\tdriver.CallOnUIGoroutine(func() {\n\t\tdriver.Render(c)\n\t})\n}", "title": "" }, { "docid": "28a6a1e1b55c49a435b4ad88f9489ef7", "score": "0.5978023", "text": "func (v *Validation) Render(w http.ResponseWriter, r *http.Request) error {\n\trender.Status(r, v.Status)\n\n\treturn nil\n}", "title": "" }, { "docid": "a1523678253451bf0e35e03ee7053b93", "score": "0.5970583", "text": "func Render(comp Component, container *js.Object) {\n\tcomp.Reconcile(nil)\n\tcontainer.Call(\"appendChild\", comp.Node())\n}", "title": "" }, { "docid": "a347b7b399a55576952a371e8069156c", "score": "0.59434247", "text": "func (v *View) Render(w http.ResponseWriter, r *http.Request, data interface{}) {\n\tw.Header().Set(\"Content-Type\", \"text/html\")\n\tvar vd Data\n\tswitch d := data.(type) {\n\tcase Data:\n\t\tvd = d\n\tdefault:\n\t\tvd = Data{\n\t\t\tYield: data,\n\t\t}\n\t}\n\tvd.User = context.User(r.Context())\n\tvar buf bytes.Buffer\n\terr := v.Template.ExecuteTemplate(&buf, v.Layout, vd)\n\tif err != nil {\n\t\thttp.Error(w, \"Something went wrong. If the problem persists, please \"+\n\t\t\t\"email support@lenslocked.com\", http.StatusInternalServerError)\n\t\treturn\n\t}\n\t// If we get here that means our template executed correctly and we can coy\n\t// the buffer to the ResponseWriter.\n\tio.Copy(w, &buf)\n}", "title": "" }, { "docid": "b1d463b8fc6d238ec4e413f29d39be8e", "score": "0.5942921", "text": "func (b *BaseElement) Render() {\n\t// Sort by ZIndex before rendering. FIXME: This should only be resorted when Z indices actually change.\n\tsort.Slice(b.Children, func(i, j int) bool {\n\t\treturn b.Children[i].GetZIndex() < b.Children[j].GetZIndex()\n\t})\n\t// Render.\n\tfor _, child := range b.VisibleChildren() {\n\t\tchild.Render()\n\t}\n\tb.RenderPost()\n\tb.Dirty = false\n}", "title": "" }, { "docid": "328c9f471a0204f8878d9239d0751f36", "score": "0.5941631", "text": "func (e *ErrResponse) Render(w http.ResponseWriter, r *http.Request) error {\n\trender.Status(r, e.HTTPStatusCode)\n\treturn nil\n}", "title": "" }, { "docid": "328c9f471a0204f8878d9239d0751f36", "score": "0.5941631", "text": "func (e *ErrResponse) Render(w http.ResponseWriter, r *http.Request) error {\n\trender.Status(r, e.HTTPStatusCode)\n\treturn nil\n}", "title": "" }, { "docid": "328c9f471a0204f8878d9239d0751f36", "score": "0.5941631", "text": "func (e *ErrResponse) Render(w http.ResponseWriter, r *http.Request) error {\n\trender.Status(r, e.HTTPStatusCode)\n\treturn nil\n}", "title": "" }, { "docid": "328c9f471a0204f8878d9239d0751f36", "score": "0.5941631", "text": "func (e *ErrResponse) Render(w http.ResponseWriter, r *http.Request) error {\n\trender.Status(r, e.HTTPStatusCode)\n\treturn nil\n}", "title": "" }, { "docid": "78c11246ae93559463cac2b4fbc0e4d8", "score": "0.5927093", "text": "func (msg *Message) Render() string {\n\treturn msg.RenderBuffer().String()\n}", "title": "" }, { "docid": "10f98c939ebbd4f7495c7b5ca50030b6", "score": "0.59175885", "text": "func (obj *graphicsObject) renderSelf(self GraphicsObject) {\n\tobj.ifNotRendered(func() {\n\t\tobj.page.render(self)\n\t\tobj.rendered = true\n\t})\n}", "title": "" }, { "docid": "ca4994c75f28a4067f3e312f552fa5b2", "score": "0.59146494", "text": "func (e *ErrResponse) Render(w http.ResponseWriter, r *http.Request) error {\n\trender.Status(r, e.StatusCode)\n\treturn nil\n}", "title": "" }, { "docid": "d1b4fab2615cd241b1771e1c74572c04", "score": "0.5901366", "text": "func (game *Game) Render() {\n\tallegro.ClearToColor(allegro.MapRGB(0, 0, 0))\n\tallegro.HoldBitmapDrawing(true)\n\tgame.background.Draw(0, 0, allegro.FLIP_NONE)\n\tgame.gopher.Render()\n\tallegro.HoldBitmapDrawing(false)\n\tallegro.FlipDisplay()\n}", "title": "" }, { "docid": "7950b0e1ac047cfe9d7942bafee8638b", "score": "0.5896008", "text": "func (r *Renderer) Render() {\n\tsx, sz, sy := r.c.Bounds()\n\tsxf := float64(sx - 1)\n\tsyf := float64(sy - 1)\n\tszf := float64(sz - 1)\n\tfor z := 0; z < sz; z++ {\n\t\tfor y := 0; y < sy; y++ {\n\t\t\tfor x := 0; x < sx; x++ {\n\t\t\t\tvar lr, lg, lb, _ uint32\n\t\t\t\tn := uint32(0)\n\t\t\t\tfor _, o := range r.objects {\n\t\t\t\t\tr, g, b, _ := o.At(float64(x)/sxf, float64(y)/syf, float64(z)/szf).RGBA()\n\t\t\t\t\tlr += r >> 8\n\t\t\t\t\tlg += g >> 8\n\t\t\t\t\tlb += b >> 8\n\t\t\t\t\tn++\n\t\t\t\t}\n\t\t\t\tr.c.Set(x, y, z, color.RGBA{uint8(lr/n), uint8(lg/n), uint8(lb/n), 255})\n\t\t\t}\n\t\t}\n\t}\n\tr.c.Render()\n}", "title": "" }, { "docid": "af52983dfdf6cba21577f425d7a4fe51", "score": "0.58883256", "text": "func (c *Context) Render(status int, name string, data interface{}) (err error) {\n\tif c.router.Renderer == nil {\n\t\treturn errors.New(\"renderer not registered\")\n\t}\n\n\tvar buf = new(bytes.Buffer)\n\tif err = c.router.Renderer.Render(buf, name, data, c); err != nil {\n\t\treturn err\n\t}\n\n\tc.HTML(status, buf.Bytes())\n\treturn\n}", "title": "" }, { "docid": "0f05a15b07e9eb4555a6dbd42f757022", "score": "0.5886327", "text": "func (c *CaptureResponse) Render(w http.ResponseWriter, r *http.Request) error {\n\tc.Price = c.c.Price\n\tc.Status = c.c.Status.String()\n\n\treturn nil\n}", "title": "" }, { "docid": "3940305d954579b9584a2a698b7ed82d", "score": "0.5878007", "text": "func (e *rawData) Render(w io.Writer) (int, error) { return w.Write([]byte(e.content)) }", "title": "" }, { "docid": "83ebda9fb87f8daefcc999caf5b2e66a", "score": "0.58646756", "text": "func (m *Manager) Render(name string, w io.Writer, data interface{}) error {\n\tif w == nil {\n\t\treturn ErrWriterRequired\n\t}\n\tm.m.RLock()\n\tv, ok := m.views[name]\n\tm.m.RUnlock()\n\tif !ok {\n\t\treturn fmt.Errorf(\"view: View \\\"%s\\\" doesn't exist\", name)\n\t}\n\tb := m.buffers.Get()\n\t// trade-off:\n\t// when Render causes a panic, the buffer will not be reused\n\t// but the runtime overhead of defer is avoided\n\terr := v.Execute(b, data)\n\tif err != nil {\n\t\tm.buffers.Put(b)\n\t\treturn err\n\t}\n\t_, err = b.WriteTo(w)\n\tm.buffers.Put(b)\n\treturn err\n}", "title": "" }, { "docid": "69452fb07c26325bc6bf9b1cce74962a", "score": "0.5864018", "text": "func Render(w http.ResponseWriter, r *http.Request, v Renderer) error {\n\treturn defaultCtrl.Render(w, r, v)\n}", "title": "" }, { "docid": "95b10ee5f7fcc2c38a8868646779c608", "score": "0.58633596", "text": "func (s *Server) Render(w ResponseWriter, r *http.Request) {\n\tif w.Written() {\n\t\treturn\n\t}\n\tif err := s.renderTemplate(w, r); err != nil {\n\t\tw.Header().Set(\"Content-Type\", \"text/plain; charset=utf-8\")\n\t\tw.WriteHeader(http.StatusInternalServerError)\n\t\tfmt.Fprintf(w, \"Error executing template: %s\\n\", err)\n\t}\n}", "title": "" }, { "docid": "af30cc6e845051e3c0f212c826ec9a0d", "score": "0.58527267", "text": "func (page *Page) Render(w http.ResponseWriter) {\n\tWriteJSON(w, http.StatusOK, page)\n}", "title": "" }, { "docid": "2721ab1120d623af5088af674374b57b", "score": "0.58506477", "text": "func (t *Renderer) Render(\n\tw io.Writer,\n\tname string,\n\tdata interface{},\n\tc echo.Context,\n) error {\n\tif t.debug {\n\t\tt.ReloadTemplates()\n\t}\n\n\treturn t.template.ExecuteTemplate(w, name, data)\n}", "title": "" }, { "docid": "3a20b41ab85f88cb6d5cd7b42f00b8cf", "score": "0.58506143", "text": "func (mock TemplateRendererMock) Render(txt string, data interface{}) (string, error) {\n\tmethodName := \"Render\" // nolint: goconst\n\tif mock.impl.Render != nil {\n\t\treturn mock.impl.Render(txt, data)\n\t}\n\tif mock.callbackNotImplemented != nil {\n\t\tmock.callbackNotImplemented(mock.t, mock.name, methodName)\n\t} else {\n\t\tgomic.DefaultCallbackNotImplemented(mock.t, mock.name, methodName)\n\t}\n\treturn mock.fakeZeroRender(txt, data)\n}", "title": "" }, { "docid": "a90b5f72ef9b4169f26e5dd10f1483b4", "score": "0.5842859", "text": "func (c *Context) Render(code int, r render.Render) {\n\tif code > 0 {\n\t\tc.Status(code)\n\t}\n\tr.WriteContentType(c.ResponseWriter)\n\tif !bodyAllowedForStatus(code) {\n\t\treturn\n\t}\n\n\tif err := r.Render(c.ResponseWriter); err != nil {\n\t\tc.Error(err)\n\t\treturn\n\t}\n}", "title": "" }, { "docid": "f54074954676b763a6889796867d15e7", "score": "0.58358955", "text": "func (c *Context) Render(code int, r render.Render) {\n\t// 设置response的content-type\n\tr.WriteContentType(c.Writer)\n\t// lt 0 不设置 http status\n\tif code > 0 {\n\t\tc.Status(code)\n\t}\n\t// 是否允许设置body\n\tif !bodyAllowForStatus(code) {\n\t\treturn\n\t}\n\t// 写上body\n\tif err := r.Render(c.Writer); err != nil {\n\t\tc.Error = err\n\t\treturn\n\t}\n}", "title": "" }, { "docid": "6621a29e72b6fcf694aab8bec273982d", "score": "0.58266705", "text": "func (rd *FileDirsResponse) Render(w http.ResponseWriter, r *http.Request) error {\n\t// Pre-processing before a response is marshalled and sent across the wire\n\treturn nil\n}", "title": "" }, { "docid": "210014b4f2818a6ed0df71bba736bda2", "score": "0.581657", "text": "func (c *stackComponent) Render(out io.Writer) (numLines int, err error) {\n\tc.mu.Lock()\n\tdefer c.mu.Unlock()\n\n\treturn renderComponents(out, c.resources)\n}", "title": "" }, { "docid": "639e6e66abb259e25c717cfaa64bdf21", "score": "0.58108217", "text": "func (a ArithmeticPage) Render(w http.ResponseWriter, req *http.Request) {\n\tRenderPage(a, w, req, true)\n}", "title": "" }, { "docid": "e7f9270cb2e4842642a8267a961574f6", "score": "0.5799211", "text": "func (v *Filter) Render() error {\n\tlogrus.Tracef(\"view.Render() %s\", v.Name())\n\n\tv.gui.Update(func(g *gocui.Gui) error {\n\t\t_, err := fmt.Fprintln(v.header, format.Header(v.labelStr))\n\t\tif err != nil {\n\t\t\tlogrus.Error(\"unable to write to buffer: \", err)\n\t\t}\n\t\treturn err\n\t})\n\treturn nil\n}", "title": "" }, { "docid": "4d57cafc1c0bd1066b41091dc712146e", "score": "0.5797436", "text": "func (c *Collection) Render() error {\n\tfor _, p := range c.Pages() {\n\t\terr := p.Render()\n\t\tif err != nil {\n\t\t\treturn err\n\t\t}\n\t}\n\treturn nil\n}", "title": "" }, { "docid": "3b36a4205db6e3a6dcbe335c67f2c981", "score": "0.5792536", "text": "func (e *ApiError) Render(w http.ResponseWriter, r *http.Request) error {\n\tpc := make([]uintptr, 5) // maximum 5 levels to go\n\truntime.Callers(1, pc)\n\tframes := runtime.CallersFrames(pc)\n\tnext := false\n\tfor {\n\t\tframe, more := frames.Next()\n\t\tif next {\n\t\t\te.Location = fmt.Sprintf(\"%s:%d\", frame.File, frame.Line)\n\t\t}\n\t\tif strings.Contains(frame.File, \"api/renderer.go\") {\n\t\t\tnext = true\n\t\t}\n\t\tif !more {\n\t\t\tbreak\n\t\t}\n\t}\n\tw.WriteHeader(e.StatusCode)\n\treturn nil\n}", "title": "" }, { "docid": "29fca7836b2af7829eacfe364cacbfe0", "score": "0.5788394", "text": "func (s *Spinner) Render() error {\n\tif len(s.frames) == 0 {\n\t\treturn errors.New(\"no frames available to to render\")\n\t}\n\n\ts.step = s.step % len(s.frames)\n\tpreviousLen := len(s.previousFrame)\n\ts.previousFrame = fmt.Sprintf(\"%s%s\", s.separator, s.frames[s.step])\n\tnewLen := len(s.previousFrame)\n\n\t// We need to clean the previous message\n\tif previousLen > newLen {\n\t\tr := previousLen - newLen\n\t\tsuffix := strings.Repeat(\" \", r)\n\t\ts.previousFrame = s.previousFrame + suffix\n\t}\n\n\tfmt.Fprint(s.Writer, s.previousFrame)\n\ts.step++\n\treturn nil\n}", "title": "" }, { "docid": "7e10466c73506c40e060338e65e3f71a", "score": "0.5773266", "text": "func (sh *ShaderStd) PostRender() error { return nil }", "title": "" }, { "docid": "e2cf553c5b150dc266ac380ba774c9dd", "score": "0.5763454", "text": "func (m *MockInterface) Render(client.RenderOptions) ([]byte, error) {\n\treturn nil, nil\n}", "title": "" }, { "docid": "760f7a72e8085abcfa437c8f7c006be4", "score": "0.57576084", "text": "func (r *renderer) Render(w io.Writer, m list.Model, index int, item list.Item) {\n\ti, ok := item.(candidateItem)\n\tif !ok {\n\t\treturn\n\t}\n\ts := i.Title()\n\tiw := rw.StringWidth(s)\n\tif iw < r.width {\n\t\ts += strings.Repeat(\" \", r.width-iw)\n\t}\n\tst := &r.m.Styles\n\tfn := st.Item.Render\n\tif r.m.selectedList == r.listIdx && index == m.Index() {\n\t\tfn = st.SelectedItem.Render\n\t}\n\tfmt.Fprint(w, fn(s))\n}", "title": "" }, { "docid": "164cb62e7c5b30c1b87c5638d54f2592", "score": "0.575069", "text": "func (v *View) Render(w http.ResponseWriter, r *http.Request, data interface{}) {\n\tw.Header().Set(\"Content-Type\", \"text/html\")\n\tvar vd Data\n\tswitch d := data.(type) {\n\tcase Data:\n\t\tvd = d\n\tdefault:\n\t\tvd = Data{\n\t\t\tYield: data,\n\t\t}\n\t}\n\t// if alert := getAlert(r); alert != nil && vd.Alert == nil {\n\tif alert := getAlert(r); alert != nil {\n\t\tvd.Alert = alert\n\t\tclearAlert(w)\n\t}\n\tvd.User = context.User(r.Context())\n\tvar buf bytes.Buffer\n\tcsrfField := csrf.TemplateField(r)\n\ttpl := v.Template.Funcs(template.FuncMap{\n\t\t\"csrfField\": func() template.HTML {\n\t\t\treturn csrfField\n\t\t},\n\t})\n\tif err := tpl.ExecuteTemplate(&buf, v.Layout, vd); err != nil {\n\t\tlog.Println(err)\n\t\thttp.Error(w, \"Something went wrong. Please email support\", http.StatusInternalServerError)\n\t\treturn\n\t}\n\tio.Copy(w, &buf)\n}", "title": "" }, { "docid": "e1519cd9a2f015993eecb91600cee609", "score": "0.575007", "text": "func (rf RendererFunc) Render(w io.Writer, v interface{}) error { return rf(w, v) }", "title": "" }, { "docid": "eb401b2b56cf32fe4cc88dc2d2e72337", "score": "0.5724828", "text": "func (self *Graphics) _renderCanvas(renderSession *RenderSession) {\n self.Object.Call(\"_renderCanvas\", renderSession)\n}", "title": "" }, { "docid": "c847bc8c9c25af9fa2bd8528e2ab9f09", "score": "0.5719683", "text": "func (p *Home) Render() vecty.ComponentOrHTML {\n\treturn elem.Body(p.perspectiveList)\n}", "title": "" }, { "docid": "44c5a7cfcb946aa1a32d4a3ba6ebc701", "score": "0.57166547", "text": "func (b *renderSystem) Render(dt float64) {\n\n\tb.renderer.Clear()\n\n\tfor i := 0; i < 100; i++ {\n\t\tl := b.layers[i]\n\t\tif l != nil {\n\t\t\tfor _, renderable := range *l {\n\t\t\t\trenderable.Paint(b.renderer)\n\t\t\t}\n\t\t}\n\t}\n\n\tb.renderer.Present()\n}", "title": "" }, { "docid": "11c5bc67c0d2f688e9c39f242360f45f", "score": "0.57156223", "text": "func (g *Graph) Render() *ebiten.Image {\n\tif g.simulation.IsPaused() {\n\t\treturn g.graphImage\n\t}\n\n\tvar img *ebiten.Image\n\tif g.shouldRefresh() {\n\t\timg = g.renderAll()\n\t} else if g.shouldAddBar() {\n\t\timg = g.renderNewBar()\n\t} else {\n\t\treturn g.graphImage\n\t}\n\n\tg.graphImage = ebiten.NewImage(realGraphWidth, realGraphHeight)\n\tg.graphImage.DrawImage(img, nil)\n\n\treturn img\n}", "title": "" }, { "docid": "b4b52e310028281617791081e682a4a3", "score": "0.5715029", "text": "func (app *RotatingCubeApp) Render() {\n\n\t//Update matrix\n\tn.GL.UniformMatrix4fv(app.uModelMatrixLoc, app.moveMatrix)\n\n\t//Clear\n\tn.GL.BindBuffer(n.GlElementArrayBuffer, app.indexBuffer)\n\tn.GL.Enable(n.GlDepthTest)\n\tn.GL.Clear(n.GlColorBufferBit | n.GlDepthBufferBit)\n\n\t// Draw the cube\n\tn.GL.DrawElements(n.GlTriangles, len(rotCubeTris), n.GlUnsignedShort, 0)\n}", "title": "" }, { "docid": "8988f1ef4d23c90d504c65a6add81125", "score": "0.5697515", "text": "func (app *UIApp) Render() {\n\tn.GL.ClearColor(1, 1, 1, 1)\n\tn.GL.Clear(n.GlColorBufferBit)\n\n\tapp.batch.Begin()\n\tfor _, box := range app.boxs {\n\t\tapp.batch.SetSprite(box.sprite)\n\t\tapp.batch.Draw(box.rect, n.White)\n\t}\n\n\t//mouse := n.Input().GetMousePosition()\n\t//t := n.NewTransform2D(mouse, 0, Vector2{1, 1})\n\t//app.batch.Draw(app.cursor, Vector2{0.5, 0.5}, t, 0xffffff, 1)\n\n\t//app.batch.Draw(app.sprite, Vector2{0, 0}, Vector2{0, 0}, Vector2{1, 1}, 0, 0xffffff, 1)\n\tapp.batch.End()\n}", "title": "" }, { "docid": "2aefbacec5da9607f0478adefb896697", "score": "0.5683582", "text": "func (st *Stemplate) Render(w *http.ResponseWriter, templateName string) {\n\n\tif !st.LiveReload {\n\t\tst.templates[templateName].ExecuteTemplate(*w, \"base\", st.data)\n\t} else {\n\t\tst.loadTemplate(templateName).ExecuteTemplate(*w, \"base\", st.data)\n\t}\n\n}", "title": "" }, { "docid": "bd62da7969344fc7db4b02fb2448837c", "score": "0.56820303", "text": "func (e *Entity) Render(dest *sdl.Surface) {\n\n\tt := EntityTransform{0, 0, dest.W, dest.H}\n\n\te.renderRecursive(dest, t)\n}", "title": "" }, { "docid": "392b4e96dc1b49928cce32176a8fe2ca", "score": "0.56813025", "text": "func (f *binaryRender) Render(w io.Writer) error {\n\tif f.Reader != nil {\n\t\tdefer ess.CloseQuietly(f.Reader)\n\t\t_, err := io.Copy(w, f.Reader)\n\t\treturn err\n\t}\n\n\tfile, err := os.Open(f.Path)\n\tif err != nil {\n\t\treturn err\n\t}\n\tdefer ess.CloseQuietly(file)\n\n\tfi, err := file.Stat()\n\tif err != nil {\n\t\treturn err\n\t}\n\n\tif fi.IsDir() {\n\t\treturn fmt.Errorf(\"'%s' is a directory\", f.Path)\n\t}\n\n\t_, err = io.Copy(w, file)\n\treturn err\n}", "title": "" }, { "docid": "67f6b588532a6401fa4a5f834f8847a8", "score": "0.56785464", "text": "func (self *CircularTrack) Render(render chan Object) {\n\trender <- self\n\tfor _, val := range self.Childs() {\n\t\trender <- val\n\t}\n}", "title": "" }, { "docid": "a1dd7adea4d262121c49da92ef0a3975", "score": "0.5657042", "text": "func (g *Game) Render() Frame {\n\tf := NewFrame()\n\tg.renderLetters(&f)\n\tg.renderCards(&f)\n\tg.renderScore(&f)\n\treturn f\n}", "title": "" }, { "docid": "0765ca0a54d42607218621788bd21d2a", "score": "0.56472695", "text": "func Render(w http.ResponseWriter, name string, d map[string]interface{}) {\n\tif e := tpl.ExecuteTemplate(w, name, d); e != nil {\n\t\thttp.Error(w, e.Error(), http.StatusInternalServerError)\n\t\treturn\n\t}\n}", "title": "" }, { "docid": "02be04db9d86c1b82069e567f90dfe45", "score": "0.5647149", "text": "func (r *R) Render(w http.ResponseWriter) {\n\tWriteJSON(w, r.Code, r)\n}", "title": "" }, { "docid": "ebf912cffc7458b02c500ae010d1893f", "score": "0.5647135", "text": "func (w *Window) Render(compo app.Component) error {\n\tsyncs, err := w.markup.Update(compo)\n\tif err != nil {\n\t\treturn err\n\t}\n\n\tfor _, sync := range syncs {\n\t\tif sync.Replace {\n\t\t\terr = w.render(sync)\n\t\t} else {\n\t\t\terr = w.renderAttributes(sync)\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": "14626226f51ec7a6527caf30767a2ea6", "score": "0.56457895", "text": "func (renderer *SimpleMatrixRenderer) Render() {\n\trenderer.renderCharacter(\"\\n\")\n\n\tfor row := 0; row < renderer.Matrix.Height; row++ {\n\t\tfor col := 0; col < renderer.Matrix.Width; col++ {\n\t\t\tif !renderer.Matrix.IsFieldOccupied(row, col) {\n\t\t\t\trenderer.renderUnoccupiedField()\n\t\t\t} else {\n\t\t\t\trenderer.renderOccupiedFieldAtCurrentCursorPos(row, col)\n\t\t\t}\n\t\t}\n\n\t\trenderer.renderCharacter(\"\\n\")\n\t}\n\n\trenderer.renderCharacter(\"\\n\")\n}", "title": "" }, { "docid": "ff03e7a90c4f085d4d81c61c4dc3f594", "score": "0.56436557", "text": "func (e *errContext) Render(w io.Writer) {\n\terr := errTemplate.Execute(w, e)\n\tif err != nil {\n\t\tpanic(fmt.Errorf(\"errhtml: %q\", err))\n\t}\n}", "title": "" }, { "docid": "f28f2bd99bd58e69ac582b4ef964da41", "score": "0.5643054", "text": "func (self *StraightLineTrack) Render(render chan Object) {\n\tfor _, val := range self.Childs() {\n\t\trender <- val\n\t}\n}", "title": "" }, { "docid": "41757cdd3915b04567cc0a18645a2e23", "score": "0.5637098", "text": "func (t tag) Render() string {\n return t.render()\n}", "title": "" }, { "docid": "699f815749ed8d06d7b2d4d1bc4efbf6", "score": "0.56253624", "text": "func (r *innerRenderer) Render(w io.Writer, data interface{}, ctx Context, tpl ...string) error {\n\tt, err := r.parseFiles(tpl...)\n\tif err != nil {\n\t\treturn err\n\t}\n\treturn t.Execute(w, data)\n}", "title": "" }, { "docid": "b547ccc6d5a37aa32abe5dc98ea3b415", "score": "0.5623469", "text": "func (r *syncResponse) Render(w http.ResponseWriter) error {\n\t// Set an appropriate ETag header\n\tif r.eTag != nil {\n\t\tif eTag, err := etag.Hash(r.eTag); err == nil {\n\t\t\tw.Header().Set(\"ETag\", eTag)\n\t\t}\n\t}\n\n\tstatus := http.StatusOK\n\tif !r.success {\n\t\tstatus = http.StatusBadRequest\n\t}\n\n\tif r.headers != nil {\n\t\tfor h, v := range r.headers {\n\t\t\tw.Header().Set(h, v)\n\t\t}\n\t}\n\n\tif r.location != \"\" {\n\t\tw.Header().Set(\"Location\", r.location)\n\t\tif r.code == 0 {\n\t\t\tw.WriteHeader(201)\n\t\t} else {\n\t\t\tw.WriteHeader(r.code)\n\t\t}\n\t}\n\n\treturn json.Write(w, client.ResponseRaw{\n\t\tType: client.SyncResponse,\n\t\tStatus: http.StatusText(status),\n\t\tStatusCode: status,\n\t\tMetadata: r.metadata,\n\t}, false, r.logger)\n}", "title": "" }, { "docid": "7a03f543a495a52923fea1e34dd93742", "score": "0.56222934", "text": "func (e *Element) Render() string {\n\treturn strings.Join(e.renderConnections(), \"\\n\")\n}", "title": "" }, { "docid": "1807f0db0e1fd052606da6a6e96feb00", "score": "0.5616265", "text": "func (ls *LightString) Render() {\n\tlog.Debug(\"Rendering string\")\n}", "title": "" }, { "docid": "920bff80f795b4202fa89b840d4c9027", "score": "0.5614708", "text": "func (v *Layer) Render() error {\n\tlogrus.Tracef(\"view.Render() %s\", v.Name())\n\n\t// indicate when selected\n\ttitle := \"Layers\"\n\tisSelected := v.gui.CurrentView() == v.view\n\n\tv.gui.Update(func(g *gocui.Gui) error {\n\t\t// update header\n\t\tv.header.Clear()\n\t\twidth, _ := g.Size()\n\t\theaderStr := format.RenderHeader(title, width, isSelected)\n\t\theaderStr += fmt.Sprintf(\"Cmp\"+image.LayerFormat, \"Size\", \"Command\")\n\t\t_, err := fmt.Fprintln(v.header, headerStr)\n\t\tif err != nil {\n\t\t\treturn err\n\t\t}\n\n\t\t// update contents\n\t\tv.view.Clear()\n\t\tfor idx, layer := range v.Layers {\n\n\t\t\tlayerStr := layer.String()\n\t\t\tcompareBar := v.renderCompareBar(idx)\n\n\t\t\tif idx == v.LayerIndex {\n\t\t\t\t_, err = fmt.Fprintln(v.view, compareBar+\" \"+format.Selected(layerStr))\n\t\t\t} else {\n\t\t\t\t_, err = fmt.Fprintln(v.view, compareBar+\" \"+layerStr)\n\t\t\t}\n\n\t\t\tif err != nil {\n\t\t\t\tlogrus.Debug(\"unable to write to buffer: \", err)\n\t\t\t\treturn err\n\t\t\t}\n\n\t\t}\n\t\treturn nil\n\t})\n\treturn nil\n}", "title": "" }, { "docid": "c0132697a632af39bd415e0bc42870c5", "score": "0.56128883", "text": "func Render(w io.Writer, template string, data interface{}) error {\n\tif err := renderer.HTML(w, 0, template, data); err != nil {\n\t\treturn err\n\t}\n\n\treturn nil\n}", "title": "" } ]
6898eead486c242a2986c88b326bf952
Get retrieves the ScyllaDBMonitoring from the indexer for a given namespace and name.
[ { "docid": "e14973788cadff7374c02d7f710a0ada", "score": "0.7886802", "text": "func (s scyllaDBMonitoringNamespaceLister) Get(name string) (*v1alpha1.ScyllaDBMonitoring, error) {\n\tobj, exists, err := s.indexer.GetByKey(s.namespace + \"/\" + name)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\tif !exists {\n\t\treturn nil, errors.NewNotFound(v1alpha1.Resource(\"scylladbmonitoring\"), name)\n\t}\n\treturn obj.(*v1alpha1.ScyllaDBMonitoring), nil\n}", "title": "" } ]
[ { "docid": "31b2a400295ee08875ee9fe22e38bf70", "score": "0.58889717", "text": "func (s monitorMetricAlertruleNamespaceLister) Get(name string) (*v1alpha1.MonitorMetricAlertrule, error) {\n\tobj, exists, err := s.indexer.GetByKey(s.namespace + \"/\" + name)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\tif !exists {\n\t\treturn nil, errors.NewNotFound(v1alpha1.Resource(\"monitormetricalertrule\"), name)\n\t}\n\treturn obj.(*v1alpha1.MonitorMetricAlertrule), nil\n}", "title": "" }, { "docid": "960b79c03c4283abc6ac464a7903fcc1", "score": "0.5846436", "text": "func (s appsyncDatasourceNamespaceLister) Get(name string) (*v1alpha1.AppsyncDatasource, error) {\n\tobj, exists, err := s.indexer.GetByKey(s.namespace + \"/\" + name)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\tif !exists {\n\t\treturn nil, errors.NewNotFound(v1alpha1.Resource(\"appsyncdatasource\"), name)\n\t}\n\treturn obj.(*v1alpha1.AppsyncDatasource), nil\n}", "title": "" }, { "docid": "0f26c3eb8f1403ae653a30db3116c787", "score": "0.5649469", "text": "func (s postgresqlDatabaseNamespaceLister) Get(name string) (*v1alpha1.PostgresqlDatabase, error) {\n\tobj, exists, err := s.indexer.GetByKey(s.namespace + \"/\" + name)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\tif !exists {\n\t\treturn nil, errors.NewNotFound(v1alpha1.Resource(\"postgresqldatabase\"), name)\n\t}\n\treturn obj.(*v1alpha1.PostgresqlDatabase), nil\n}", "title": "" }, { "docid": "0d5b55b4eebad606dadaa420b38f3b61", "score": "0.56489724", "text": "func (s scyllaDBMonitoringNamespaceLister) List(selector labels.Selector) (ret []*v1alpha1.ScyllaDBMonitoring, err error) {\n\terr = cache.ListAllByNamespace(s.indexer, s.namespace, selector, func(m interface{}) {\n\t\tret = append(ret, m.(*v1alpha1.ScyllaDBMonitoring))\n\t})\n\treturn ret, err\n}", "title": "" }, { "docid": "98a7933c25a30e8a1f8e2f5c99282d88", "score": "0.56183606", "text": "func (s postgresqlServerNamespaceLister) Get(name string) (*v1alpha1.PostgresqlServer, error) {\n\tobj, exists, err := s.indexer.GetByKey(s.namespace + \"/\" + name)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\tif !exists {\n\t\treturn nil, errors.NewNotFound(v1alpha1.Resource(\"postgresqlserver\"), name)\n\t}\n\treturn obj.(*v1alpha1.PostgresqlServer), nil\n}", "title": "" }, { "docid": "d5e410b9595af73f96555dcfbaa5aee3", "score": "0.5612707", "text": "func (nsi namespaceIndex) Get(name string) *namespaceData {\n\tdata := nsi[name]\n\tif data != nil {\n\t\treturn data\n\t}\n\tdata = &namespaceData{}\n\tnsi[name] = data\n\treturn data\n}", "title": "" }, { "docid": "439d46d8e170d0e4874373cac242ed5b", "score": "0.55993056", "text": "func (s dnsRecordSetNamespaceLister) Get(name string) (*v1alpha1.DnsRecordSet, error) {\n\tobj, exists, err := s.indexer.GetByKey(s.namespace + \"/\" + name)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\tif !exists {\n\t\treturn nil, errors.NewNotFound(v1alpha1.Resource(\"dnsrecordset\"), name)\n\t}\n\treturn obj.(*v1alpha1.DnsRecordSet), nil\n}", "title": "" }, { "docid": "bc324007b102558dd5bbba0ea3a971fb", "score": "0.55525076", "text": "func (s prometheusAgentNamespaceLister) Get(name string) (*v1alpha1.PrometheusAgent, error) {\n\tobj, exists, err := s.indexer.GetByKey(s.namespace + \"/\" + name)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\tif !exists {\n\t\treturn nil, errors.NewNotFound(v1alpha1.Resource(\"prometheusagent\"), name)\n\t}\n\treturn obj.(*v1alpha1.PrometheusAgent), nil\n}", "title": "" }, { "docid": "ea995e223fee5974962523e55a5fa3a7", "score": "0.55236006", "text": "func (s databaseClusterNamespaceLister) Get(name string) (*v1alpha1.DatabaseCluster, error) {\n\tobj, exists, err := s.indexer.GetByKey(s.namespace + \"/\" + name)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\tif !exists {\n\t\treturn nil, errors.NewNotFound(v1alpha1.Resource(\"databasecluster\"), name)\n\t}\n\treturn obj.(*v1alpha1.DatabaseCluster), nil\n}", "title": "" }, { "docid": "2ccb1c1901ac1ca3cb7cb1015d65828f", "score": "0.55115175", "text": "func (s *DatastoreStore) Get(r *http.Request, name string) (*sessions.Session,\n\terror) {\n\treturn sessions.GetRegistry(r).Get(s, name)\n}", "title": "" }, { "docid": "1b2b61a237921343b6e5bef3844e0bb9", "score": "0.55094284", "text": "func (c *OperatorDNS) Get(bucket string) (srvRecords []SrvRecord, err error) {\n\treturn nil, ErrNotImplemented\n}", "title": "" }, { "docid": "ba9b620190da17f643075e301d78a8a0", "score": "0.55020165", "text": "func (this *DbAdapter) Get(dest interface{}, query string, args ...interface{}) error {\n\tstarted := time.Now()\n\tdbMonitoring := this.Slave()\n\terr := dbMonitoring.Db.Get(dest, query, args...)\n\tdbMonitoring.addRequest(err, started)\n\treturn err\n}", "title": "" }, { "docid": "5d8d1d934581b01cb000317fbce82807", "score": "0.54683185", "text": "func (s seaOtterNamespaceLister) Get(name string) (*v1alpha1.SeaOtter, error) {\n\tobj, exists, err := s.indexer.GetByKey(s.namespace + \"/\" + name)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\tif !exists {\n\t\treturn nil, errors.NewNotFound(v1alpha1.Resource(\"seaotter\"), name)\n\t}\n\treturn obj.(*v1alpha1.SeaOtter), nil\n}", "title": "" }, { "docid": "4dfe24ccc8521617c3424c529ef4e1b3", "score": "0.5422647", "text": "func (s dynamoDBNamespaceLister) Get(name string) (*v1alpha1.DynamoDB, error) {\n\tobj, exists, err := s.indexer.GetByKey(s.namespace + \"/\" + name)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\tif !exists {\n\t\treturn nil, errors.NewNotFound(v1alpha1.Resource(\"dynamodb\"), name)\n\t}\n\treturn obj.(*v1alpha1.DynamoDB), nil\n}", "title": "" }, { "docid": "424d17d114f9c745bd4858f6619c595a", "score": "0.54012626", "text": "func (s dataFactoryDatasetMysqlNamespaceLister) Get(name string) (*v1alpha1.DataFactoryDatasetMysql, error) {\n\tobj, exists, err := s.indexer.GetByKey(s.namespace + \"/\" + name)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\tif !exists {\n\t\treturn nil, errors.NewNotFound(v1alpha1.Resource(\"datafactorydatasetmysql\"), name)\n\t}\n\treturn obj.(*v1alpha1.DataFactoryDatasetMysql), nil\n}", "title": "" }, { "docid": "560483ce3f270aef484365dc1f3abd9f", "score": "0.53937465", "text": "func (s vulnerabilityNamespaceLister) Get(name string) (*v1alpha1.Vulnerability, error) {\n\tobj, exists, err := s.indexer.GetByKey(s.namespace + \"/\" + name)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\tif !exists {\n\t\treturn nil, errors.NewNotFound(v1alpha1.Resource(\"vulnerability\"), name)\n\t}\n\treturn obj.(*v1alpha1.Vulnerability), nil\n}", "title": "" }, { "docid": "d1159f8221ca4bd5fa5a424293faf80e", "score": "0.5390306", "text": "func (s *DgraphStore) Get(r *http.Request, name string) (*sessions.Session, error) {\n\treturn sessions.GetRegistry(r).Get(s, name)\n}", "title": "" }, { "docid": "afb5c03aeaa397e91be2bdde83848714", "score": "0.5357475", "text": "func (s store) Get(index string) (db.Connection, bool) {\n\tvar (\n\t\tconn db.Connection\n\t\texist bool\n\t)\n\n\trunThreadSafe(func() {\n\t\tconn, exist = s[index]\n\t\tfmt.Println(s)\n\t})\n\n\treturn conn, exist\n}", "title": "" }, { "docid": "8f1281e60e55e50793b0cb9d7552e509", "score": "0.5348222", "text": "func Get(name string) (AlertClient, error) {\n\tlock.RLock()\n\tdefer lock.RUnlock()\n\n\tif v, ok := instances[name]; ok {\n\t\treturn v, nil\n\t}\n\treturn nil, ErrAlertClientNotFound\n}", "title": "" }, { "docid": "788d776e39216116232a02b7a8c3f389", "score": "0.5343939", "text": "func Get(name string) *DB {\n\tdbMutex.Lock()\n\tdefer dbMutex.Unlock()\n\n\tdb := dataSources[name]\n\tif db == nil {\n\t\tdb = &DB{\n\t\t\ttypes: make(map[string]interface{}),\n\t\t\tdynamicers: make(map[string]Dynamicer),\n\t\t}\n\t\tdataSources[name] = db\n\t}\n\treturn db\n}", "title": "" }, { "docid": "b65865a408f80bb40be6dc95d452a49c", "score": "0.5331619", "text": "func (m *MongoDBStore) Get(r *http.Request, name string) (*sessions.Session, error) {\n\treturn sessions.GetRegistry(r).Get(m, name)\n}", "title": "" }, { "docid": "59230d14e445b6ac891963db56629616", "score": "0.5319324", "text": "func (c *MultiClusterController) Get(clusterName, namespace, name string) (interface{}, error) {\n\tcluster := c.GetCluster(clusterName)\n\tif cluster == nil {\n\t\treturn nil, errors.NewClusterNotFound(clusterName)\n\t}\n\tinstance := utilscheme.Scheme.NewObject(c.objectType)\n\tdelegatingClient, err := cluster.GetDelegatingClient()\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\terr = delegatingClient.Get(context.TODO(), client.ObjectKey{\n\t\tNamespace: namespace,\n\t\tName: name,\n\t}, instance)\n\treturn instance, err\n}", "title": "" }, { "docid": "7acf91821dc0a7a8ffe504b1f15c56a6", "score": "0.5307764", "text": "func (r *StatsIndexDatasourcesService) Get(name string) *StatsIndexDatasourcesGetCall {\n\tc := &StatsIndexDatasourcesGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}\n\tc.name = name\n\treturn c\n}", "title": "" }, { "docid": "fa52a4a36f74589408051cd0c25edbfd", "score": "0.53041416", "text": "func (s sMBNamespaceLister) Get(name string) (*v1.SMB, error) {\n\tobj, exists, err := s.indexer.GetByKey(s.namespace + \"/\" + name)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\tif !exists {\n\t\treturn nil, errors.NewNotFound(v1.Resource(\"smb\"), name)\n\t}\n\treturn obj.(*v1.SMB), nil\n}", "title": "" }, { "docid": "10ea927f7db4efcd92babc95b820be80", "score": "0.52673155", "text": "func (s democrdNamespaceLister) Get(name string) (*v1.Democrd, error) {\n\tobj, exists, err := s.indexer.GetByKey(s.namespace + \"/\" + name)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\tif !exists {\n\t\treturn nil, errors.NewNotFound(v1.Resource(\"democrd\"), name)\n\t}\n\treturn obj.(*v1.Democrd), nil\n}", "title": "" }, { "docid": "215e828dc3c07b5a0db1d866de323c39", "score": "0.5250727", "text": "func (s *MultiBasic) Get(gvk schema.GroupVersionKind, namespace, name string) (obj runtime.Object, exists bool, e error) {\n\tvar informer cache.SharedIndexInformer\n\tfunc() {\n\t\ts.mx.RLock()\n\t\tdefer s.mx.RUnlock()\n\t\tinformer = s.informers[gvk]\n\t}()\n\tif informer == nil {\n\t\treturn nil, false, errors.Errorf(\"no informer for %s is registered\", gvk)\n\t}\n\treturn s.getFromIndexer(informer.GetIndexer(), gvk, namespace, name)\n}", "title": "" }, { "docid": "00d4c44056b2a68ef3dad00e1942772c", "score": "0.52497077", "text": "func (s genericNamespaceLister) Get(name string) (*v1alpha1.Generic, error) {\n\tobj, exists, err := s.indexer.GetByKey(s.namespace + \"/\" + name)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\tif !exists {\n\t\treturn nil, errors.NewNotFound(v1alpha1.Resource(\"generic\"), name)\n\t}\n\treturn obj.(*v1alpha1.Generic), nil\n}", "title": "" }, { "docid": "bd5e1f583cbe44615e94bb0fb994350b", "score": "0.5239397", "text": "func Get(name string) (Driver, error) {\n\tif d, ok := schedulers[name]; ok {\n\t\treturn d, nil\n\t}\n\treturn nil, &errors.ErrNotFound{\n\t\tID: name,\n\t\tType: \"Scheduler\",\n\t}\n}", "title": "" }, { "docid": "e79c28e128428027947bde433ed6e99e", "score": "0.52267396", "text": "func (s *scyllaDBMonitoringLister) List(selector labels.Selector) (ret []*v1alpha1.ScyllaDBMonitoring, err error) {\n\terr = cache.ListAll(s.indexer, selector, func(m interface{}) {\n\t\tret = append(ret, m.(*v1alpha1.ScyllaDBMonitoring))\n\t})\n\treturn ret, err\n}", "title": "" }, { "docid": "540ff1e74637a4b65d9628ed7f5add67", "score": "0.52169335", "text": "func (s rabbitmqSourceNamespaceLister) Get(name string) (*v1alpha1.RabbitmqSource, error) {\n\tobj, exists, err := s.indexer.GetByKey(s.namespace + \"/\" + name)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\tif !exists {\n\t\treturn nil, errors.NewNotFound(v1alpha1.Resource(\"rabbitmqsource\"), name)\n\t}\n\treturn obj.(*v1alpha1.RabbitmqSource), nil\n}", "title": "" }, { "docid": "b86ce992de7ca1e93d10d59d475ee6fc", "score": "0.5212896", "text": "func (s knativeEventingNamespaceLister) Get(name string) (*v1beta1.KnativeEventing, error) {\n\tobj, exists, err := s.indexer.GetByKey(s.namespace + \"/\" + name)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\tif !exists {\n\t\treturn nil, errors.NewNotFound(v1beta1.Resource(\"knativeeventing\"), name)\n\t}\n\treturn obj.(*v1beta1.KnativeEventing), nil\n}", "title": "" }, { "docid": "7950efc06ac1c9f7024428486319c0cc", "score": "0.52076614", "text": "func (s awsWafregionalSqlInjectionMatchSetNamespaceLister) Get(name string) (*v1.AwsWafregionalSqlInjectionMatchSet, error) {\n\tobj, exists, err := s.indexer.GetByKey(s.namespace + \"/\" + name)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\tif !exists {\n\t\treturn nil, errors.NewNotFound(v1.Resource(\"awswafregionalsqlinjectionmatchset\"), name)\n\t}\n\treturn obj.(*v1.AwsWafregionalSqlInjectionMatchSet), nil\n}", "title": "" }, { "docid": "f2d567d559d7b20b630031222431d995", "score": "0.52056557", "text": "func (s kogitoSourceNamespaceLister) Get(name string) (*v1alpha1.KogitoSource, error) {\n\tobj, exists, err := s.indexer.GetByKey(s.namespace + \"/\" + name)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\tif !exists {\n\t\treturn nil, errors.NewNotFound(v1alpha1.Resource(\"kogitosource\"), name)\n\t}\n\treturn obj.(*v1alpha1.KogitoSource), nil\n}", "title": "" }, { "docid": "28526436acc8b97d636f7055d1bdf8f9", "score": "0.5204993", "text": "func (s crdExampleNamespaceLister) Get(name string) (*v1.CrdExample, error) {\n\tobj, exists, err := s.indexer.GetByKey(s.namespace + \"/\" + name)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\tif !exists {\n\t\treturn nil, errors.NewNotFound(v1.Resource(\"crdexample\"), name)\n\t}\n\treturn obj.(*v1.CrdExample), nil\n}", "title": "" }, { "docid": "f6b74cfa8f24e2681b542106937edd5f", "score": "0.52048445", "text": "func Get(name string) (clusterapi.ClusterAPI, error) {\n\ttenant, err := utils.GetCurrentTenant()\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\tinstance, err := readDefinition(tenant, name)\n\tif err != nil {\n\t\treturn nil, fmt.Errorf(\"failed to get Cluster '%s': %s\", name, err.Error())\n\t}\n\tif instance == nil {\n\t\treturn nil, nil\n\t}\n\t_, err = instance.GetState()\n\tif err != nil {\n\t\treturn nil, fmt.Errorf(\"failed to get state of the cluster: %s\", err.Error())\n\t}\n\treturn instance, nil\n}", "title": "" }, { "docid": "61dd69742f64be131ad5e0956c62e19c", "score": "0.5200494", "text": "func (s elasticDLJobNamespaceLister) Get(name string) (*v1alpha1.ElasticDLJob, error) {\n\tobj, exists, err := s.indexer.GetByKey(s.namespace + \"/\" + name)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\tif !exists {\n\t\treturn nil, errors.NewNotFound(v1alpha1.Resource(\"elasticdljob\"), name)\n\t}\n\treturn obj.(*v1alpha1.ElasticDLJob), nil\n}", "title": "" }, { "docid": "2612776449c4457907f427b5a1e0cffd", "score": "0.5199584", "text": "func (s eventProviderNamespaceLister) Get(name string) (*v1alpha1.EventProvider, error) {\n\tobj, exists, err := s.indexer.GetByKey(s.namespace + \"/\" + name)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\tif !exists {\n\t\treturn nil, errors.NewNotFound(v1alpha1.Resource(\"eventprovider\"), name)\n\t}\n\treturn obj.(*v1alpha1.EventProvider), nil\n}", "title": "" }, { "docid": "fc4f09dbfe2e2ca0aa6d08e1577828f4", "score": "0.5194277", "text": "func (s messagingInfrastructureNamespaceLister) Get(name string) (*v1.MessagingInfrastructure, error) {\n\tobj, exists, err := s.indexer.GetByKey(s.namespace + \"/\" + name)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\tif !exists {\n\t\treturn nil, errors.NewNotFound(v1.Resource(\"messaginginfrastructure\"), name)\n\t}\n\treturn obj.(*v1.MessagingInfrastructure), nil\n}", "title": "" }, { "docid": "4aa6f79ea8fe1839af5142feb731628f", "score": "0.51840705", "text": "func (c Client) Get(name string) (string, error) {\n\treturn c.Store.Get(c.ctx, name)\n}", "title": "" }, { "docid": "1ebc7bc4ccff551471a9420beb5e475c", "score": "0.5182073", "text": "func (s *fsStore) Get(typ namespace.Type, name string) (*namespace.Namespace, error) {\n\tif !s.Exists(typ, name) {\n\t\treturn nil, store.ErrNotExists\n\t}\n\ttrgt := s.targetPath(name, typ)\n\treturn namespace.FromPath(trgt)\n}", "title": "" }, { "docid": "4d9e62d898262941f81279c1a9be6b92", "score": "0.5160057", "text": "func (s trialNamespaceLister) Get(name string) (*v1beta1.Trial, error) {\n\tobj, exists, err := s.indexer.GetByKey(s.namespace + \"/\" + name)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\tif !exists {\n\t\treturn nil, errors.NewNotFound(v1beta1.Resource(\"trial\"), name)\n\t}\n\treturn obj.(*v1beta1.Trial), nil\n}", "title": "" }, { "docid": "9bb1098d39eaa85e66910cbcc123167e", "score": "0.5154064", "text": "func (s *StatusService) Get(ctx context.Context, region Region) (*Shard, error) {\n\tshard := new(Shard)\n\n\terr := s.client.getResource(\n\t\tctx,\n\t\tstatusPathPart,\n\t\tmapRegionToString(region),\n\t\tnil,\n\t\tshard,\n\t)\n\treturn shard, err\n}", "title": "" }, { "docid": "096813486e8f7e4d14f6d16e32012a0c", "score": "0.5136937", "text": "func (ds *DashboardsService) Get(ctx context.Context, slug string) (*grafana.Dashboard, error) {\n\tu := fmt.Sprintf(\"/api/dashboards/db/%s\", slug)\n\treq, err := ds.client.NewRequest(ctx, \"GET\", u, nil)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\tvar dResp dashboardGetResponse\n\tif resp, err := ds.client.Do(req, &dResp); err != nil {\n\t\tif resp != nil {\n\t\t\tif resp.StatusCode == http.StatusNotFound {\n\t\t\t\treturn nil, ErrDashboardNotFound\n\t\t\t}\n\t\t}\n\t\treturn nil, err\n\t}\n\n\td := dResp.Dashboard\n\td.Meta = dResp.Meta\n\treturn &d, nil\n}", "title": "" }, { "docid": "7423cba31cf3dfb7206582fe01c41d93", "score": "0.51267153", "text": "func (s redisTriggerNamespaceLister) Get(name string) (*v1beta1.RedisTrigger, error) {\n\tobj, exists, err := s.indexer.GetByKey(s.namespace + \"/\" + name)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\tif !exists {\n\t\treturn nil, errors.NewNotFound(v1beta1.Resource(\"redistrigger\"), name)\n\t}\n\treturn obj.(*v1beta1.RedisTrigger), nil\n}", "title": "" }, { "docid": "ca8a0f1343aa993be01ab1203a97ec90", "score": "0.5117148", "text": "func (s *NamespaceStorage) Get(ctx context.Context, name string) (*types.Namespace, error) {\n\n\tlog.V(logLevel).Debugf(\"storage:etcd:namespace:> get by name: %s\", name)\n\n\tconst filter = `\\b.+` + namespaceStorage + `\\/.+\\/(meta|spec)\\b`\n\n\tif len(name) == 0 {\n\t\terr := errors.New(\"name can not be empty\")\n\t\tlog.V(logLevel).Errorf(\"storage:etcd:namespace:> get by name err: %s\", err.Error())\n\t\treturn nil, err\n\t}\n\n\tclient, destroy, err := getClient(ctx)\n\tif err != nil {\n\t\tlog.V(logLevel).Errorf(\"storage:etcd:namespace:> get by name err: %s\", err.Error())\n\t\treturn nil, err\n\t}\n\tdefer destroy()\n\n\tnamespace := new(types.Namespace)\n\tkey := keyDirCreate(namespaceStorage, name)\n\n\tif err := client.Map(ctx, key, filter, namespace); err != nil {\n\t\tlog.V(logLevel).Errorf(\"storage:etcd:namespace:> get by name err: %s\", err.Error())\n\t\treturn nil, err\n\t}\n\n\treturn namespace, nil\n}", "title": "" }, { "docid": "540dd3d5edb452ca10259ccbad081332", "score": "0.5109093", "text": "func (r *StatusREST) Get(ctx context.Context, name string, options *metav1.GetOptions) (runtime.Object, error) {\n\treturn r.store.Get(ctx, name, options)\n}", "title": "" }, { "docid": "52c8d317b93c14575d738934f24bed77", "score": "0.5103003", "text": "func (s awsElasticsearchDomainNamespaceLister) Get(name string) (*v1.AwsElasticsearchDomain, error) {\n\tobj, exists, err := s.indexer.GetByKey(s.namespace + \"/\" + name)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\tif !exists {\n\t\treturn nil, errors.NewNotFound(v1.Resource(\"awselasticsearchdomain\"), name)\n\t}\n\treturn obj.(*v1.AwsElasticsearchDomain), nil\n}", "title": "" }, { "docid": "aff4aa8c4aaf5b083a9d5e17b0001da0", "score": "0.5100397", "text": "func (counts *Counts) get(ctx context.Context, name string) (*Count, error) {\n\titr := counts.Where(nameKey, eqOp, name).Documents(ctx)\n\tsnaps, err := itr.GetAll()\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\tif len(snaps) == 0 {\n\t\treturn nil, nil\n\t}\n\tif len(snaps) > 1 {\n\t\tvar paths []string\n\t\tfor _, k := range snaps {\n\t\t\tpaths = append(paths, k.Ref.Path)\n\t\t}\n\t\treturn nil, fmt.Errorf(\"fatal: query of %s/{%s=%s} yielded >1 document at: %s\", countsPath, nameKey, name, strings.Join(paths, \", \"))\n\t}\n\treturn &Count{\n\t\tDocumentSnapshot: *snaps[0],\n\t\tclient: counts.client,\n\t}, nil\n}", "title": "" }, { "docid": "52971f024d295a2fe99f5cb2ddbd84a6", "score": "0.5098413", "text": "func Get() rethink.Term {\n\treturn rethink.DB(Name)\n}", "title": "" }, { "docid": "a4eb96dae3b71fbe7a033d5a23248e5c", "score": "0.50930893", "text": "func (s postgresqlConfigurationNamespaceLister) Get(name string) (*v1alpha1.PostgresqlConfiguration, error) {\n\tobj, exists, err := s.indexer.GetByKey(s.namespace + \"/\" + name)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\tif !exists {\n\t\treturn nil, errors.NewNotFound(v1alpha1.Resource(\"postgresqlconfiguration\"), name)\n\t}\n\treturn obj.(*v1alpha1.PostgresqlConfiguration), nil\n}", "title": "" }, { "docid": "7b00ccc9c383a43477df7177e6709103", "score": "0.5085956", "text": "func (client DatabasesClient) Get(resourceGroupName string, serverName string, databaseName string, expand string) (result Database, err error) {\n\treq, err := client.GetPreparer(resourceGroupName, serverName, databaseName, expand)\n\tif err != nil {\n\t\terr = autorest.NewErrorWithError(err, \"sql.DatabasesClient\", \"Get\", nil, \"Failure preparing request\")\n\t\treturn\n\t}\n\n\tresp, err := client.GetSender(req)\n\tif err != nil {\n\t\tresult.Response = autorest.Response{Response: resp}\n\t\terr = autorest.NewErrorWithError(err, \"sql.DatabasesClient\", \"Get\", resp, \"Failure sending request\")\n\t\treturn\n\t}\n\n\tresult, err = client.GetResponder(resp)\n\tif err != nil {\n\t\terr = autorest.NewErrorWithError(err, \"sql.DatabasesClient\", \"Get\", resp, \"Failure responding to request\")\n\t}\n\n\treturn\n}", "title": "" }, { "docid": "545d113f5eb05f78787c57e7f2e90d90", "score": "0.5082319", "text": "func GetMysql(c *gin.Context) {\n\tns := c.Param(\"ns\")\n\tname := c.Param(\"name\")\n\n\tmysql, err := cli.KubedbClientSet.MySQLs(ns).Get(name, metav1.GetOptions{})\n\tif err != nil {\n\t\tpanic(err.Error())\n\t}\n\n\tc.JSON(http.StatusOK, gin.H{\n\t\t\"message\": fmt.Sprintf(\"mysql instance %s running on cluster %s\", mysql.GetName(), mysql.GetClusterName()),\n\t})\n}", "title": "" }, { "docid": "660eac67e4a6217f9b48d68003689feb", "score": "0.5075528", "text": "func (s *scyllaDBMonitoringLister) ScyllaDBMonitorings(namespace string) ScyllaDBMonitoringNamespaceLister {\n\treturn scyllaDBMonitoringNamespaceLister{indexer: s.indexer, namespace: namespace}\n}", "title": "" }, { "docid": "cbe38bdda9e6e385dc026a52ec1a4097", "score": "0.50666296", "text": "func (s *Index) Get() IndexSnapshot {\n\ts.lock.Lock()\n\tdefer s.lock.Unlock()\n\tii := IndexSnapshot{\n\t\tTipSetKey: s.index.TipSetKey,\n\t\tMiners: make(map[string]Slashes, len(s.index.Miners)),\n\t}\n\tfor addr, v := range s.index.Miners {\n\t\thistory := make([]uint64, len(v.Epochs))\n\t\tcopy(history, v.Epochs)\n\t\tii.Miners[addr] = Slashes{\n\t\t\tEpochs: history,\n\t\t}\n\t}\n\treturn ii\n}", "title": "" }, { "docid": "96f218b4d1532f1ca2da9076d8281d53", "score": "0.50496083", "text": "func (s eCRRepositoryNamespaceLister) Get(name string) (*v1alpha1.ECRRepository, error) {\n\tobj, exists, err := s.indexer.GetByKey(s.namespace + \"/\" + name)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\tif !exists {\n\t\treturn nil, errors.NewNotFound(v1alpha1.Resource(\"ecrrepository\"), name)\n\t}\n\treturn obj.(*v1alpha1.ECRRepository), nil\n}", "title": "" }, { "docid": "2114272ebfdf37dceb5a516c7cc8fec5", "score": "0.50487334", "text": "func (s wafregionalRuleNamespaceLister) Get(name string) (*v1alpha1.WafregionalRule, error) {\n\tobj, exists, err := s.indexer.GetByKey(s.namespace + \"/\" + name)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\tif !exists {\n\t\treturn nil, errors.NewNotFound(v1alpha1.Resource(\"wafregionalrule\"), name)\n\t}\n\treturn obj.(*v1alpha1.WafregionalRule), nil\n}", "title": "" }, { "docid": "e0618d37720cf9cfe683d299c315525f", "score": "0.504342", "text": "func (s tektonListenerNamespaceLister) Get(name string) (*v1alpha1.TektonListener, error) {\n\tobj, exists, err := s.indexer.GetByKey(s.namespace + \"/\" + name)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\tif !exists {\n\t\treturn nil, errors.NewNotFound(v1alpha1.Resource(\"tektonlistener\"), name)\n\t}\n\treturn obj.(*v1alpha1.TektonListener), nil\n}", "title": "" }, { "docid": "1a7bc98ed8914e5cc6e09952d936b096", "score": "0.50312686", "text": "func (d *DI) Get(name string) interface{} {\n\td.mutex.RLock()\n\tv := d.store[name]\n\td.mutex.RUnlock()\n\treturn v\n}", "title": "" }, { "docid": "8eb3abdd4f8dc9ce1093fb0ef78037f4", "score": "0.5027117", "text": "func (s blueGreenDeploymentNamespaceLister) Get(name string) (*v1.BlueGreenDeployment, error) {\n\tobj, exists, err := s.indexer.GetByKey(s.namespace + \"/\" + name)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\tif !exists {\n\t\treturn nil, errors.NewNotFound(v1.Resource(\"bluegreendeployment\"), name)\n\t}\n\treturn obj.(*v1.BlueGreenDeployment), nil\n}", "title": "" }, { "docid": "9f6e137d8167a194aade537078159bc6", "score": "0.50260794", "text": "func (s backendConfigNamespaceLister) Get(name string) (*v1.BackendConfig, error) {\n\tobj, exists, err := s.indexer.GetByKey(s.namespace + \"/\" + name)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\tif !exists {\n\t\treturn nil, errors.NewNotFound(v1.Resource(\"backendconfig\"), name)\n\t}\n\treturn obj.(*v1.BackendConfig), nil\n}", "title": "" }, { "docid": "a0b69c920ce438088a3e79a29a5539cf", "score": "0.49918717", "text": "func (s guarddutyThreatintelsetNamespaceLister) Get(name string) (*v1alpha1.GuarddutyThreatintelset, error) {\n\tobj, exists, err := s.indexer.GetByKey(s.namespace + \"/\" + name)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\tif !exists {\n\t\treturn nil, errors.NewNotFound(v1alpha1.Resource(\"guarddutythreatintelset\"), name)\n\t}\n\treturn obj.(*v1alpha1.GuarddutyThreatintelset), nil\n}", "title": "" }, { "docid": "40303c57fc537f6cfd5222948b6f5902", "score": "0.49860606", "text": "func (r *SettingsDatasourcesService) Get(name string) *SettingsDatasourcesGetCall {\n\tc := &SettingsDatasourcesGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}\n\tc.name = name\n\treturn c\n}", "title": "" }, { "docid": "cd447d509fdd8d037eeb8f94596fb047", "score": "0.4968578", "text": "func (obs *Observer) Get(name string, options metav1.GetOptions, subresources ...string) (*unstructured.Unstructured, error) {\n\treturn obs.client.Namespace(obs.namespace).Get(name, options, subresources...)\n}", "title": "" }, { "docid": "8748ae49a1e3141e6315f1537aad7d54", "score": "0.49662593", "text": "func (s testRunNamespaceLister) Get(name string) (*v1alpha1.TestRun, error) {\n\tobj, exists, err := s.indexer.GetByKey(s.namespace + \"/\" + name)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\tif !exists {\n\t\treturn nil, errors.NewNotFound(v1alpha1.Resource(\"testrun\"), name)\n\t}\n\treturn obj.(*v1alpha1.TestRun), nil\n}", "title": "" }, { "docid": "7790bfd623012a9665febb387397f2bf", "score": "0.4960412", "text": "func (w *wireguardServerConfig) Get(name string) (*api.WireguardServerConfig, error) {\n\tkey := path.Join(w.prefix, name)\n\tdata, err := w.store.Get(key)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\tif data == nil {\n\t\treturn nil, nil\n\t}\n\tvar obj api.WireguardServerConfig\n\treturn &obj, json.Unmarshal(data, &obj)\n}", "title": "" }, { "docid": "406e990fa928523216848dfaff99c3bd", "score": "0.49570176", "text": "func (s *clusterDomainsStatusLister) Get(name string) (*v1alpha1.ClusterDomainsStatus, error) {\n\tobj, exists, err := s.indexer.GetByKey(name)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\tif !exists {\n\t\treturn nil, errors.NewNotFound(v1alpha1.Resource(\"clusterdomainsstatus\"), name)\n\t}\n\treturn obj.(*v1alpha1.ClusterDomainsStatus), nil\n}", "title": "" }, { "docid": "76a4fc6fe193840497eb61519ccc742e", "score": "0.49519998", "text": "func (s horusecManagerNamespaceLister) Get(name string) (*v1alpha1.HorusecManager, error) {\n\tobj, exists, err := s.indexer.GetByKey(s.namespace + \"/\" + name)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\tif !exists {\n\t\treturn nil, errors.NewNotFound(v1alpha1.Resource(\"horusecmanager\"), name)\n\t}\n\treturn obj.(*v1alpha1.HorusecManager), nil\n}", "title": "" }, { "docid": "9ffee5d6c8235d79b695a03be6ce49cd", "score": "0.49467236", "text": "func (c *releaseClient) Get(name string) (*Release, error) {\n\tlist, err := c.config.Releases.List(func(r *release.Release) bool {\n\t\treturn r.Namespace == c.config.Namespace() && r.Name == name\n\t})\n\tif err != nil {\n\t\treturn nil, err\n\t} else if len(list) == 0 {\n\t\treturn nil, errors.New(\"release not found\")\n\t} else if len(list) > 1 {\n\t\treturn nil, errors.New(\"release is ambiguous\")\n\t}\n\treturn getRelease(c.config, list[0])\n}", "title": "" }, { "docid": "08fe05168721861f80c00682a6eb9980", "score": "0.49386463", "text": "func (m *Manager) Get(base int64) *TimestampBuffering {\n\t// m.mutex.Lock()\n\t// defer m.mutex.Unlock()\n\n\t// get now\n\tindex := m.GetCurrentIndex(base)\n\tfmt.Printf(\"get current index :%d\\n\",index)\n\n\n\treturn m.targets[index]\n\n\t// return nil\n}", "title": "" }, { "docid": "04434936726eaec8174dcab679743c0d", "score": "0.4928137", "text": "func (s *calicoNodeStatusLister) Get(name string) (*v3.CalicoNodeStatus, error) {\n\tobj, exists, err := s.indexer.GetByKey(name)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\tif !exists {\n\t\treturn nil, errors.NewNotFound(v3.Resource(\"caliconodestatus\"), name)\n\t}\n\treturn obj.(*v3.CalicoNodeStatus), nil\n}", "title": "" }, { "docid": "73895bf161eeb1d78efed8d72539a16f", "score": "0.49257362", "text": "func (s beeNamespaceLister) Get(name string) (*v1beta1.Bee, error) {\n\tobj, exists, err := s.indexer.GetByKey(s.namespace + \"/\" + name)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\tif !exists {\n\t\treturn nil, errors.NewNotFound(v1beta1.Resource(\"bee\"), name)\n\t}\n\treturn obj.(*v1beta1.Bee), nil\n}", "title": "" }, { "docid": "8de799a976ee86bcb470aadce96db7b8", "score": "0.49070644", "text": "func (s storagegatewayWorkingStorageNamespaceLister) Get(name string) (*v1alpha1.StoragegatewayWorkingStorage, error) {\n\tobj, exists, err := s.indexer.GetByKey(s.namespace + \"/\" + name)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\tif !exists {\n\t\treturn nil, errors.NewNotFound(v1alpha1.Resource(\"storagegatewayworkingstorage\"), name)\n\t}\n\treturn obj.(*v1alpha1.StoragegatewayWorkingStorage), nil\n}", "title": "" }, { "docid": "7256b832ad6b283db00f3cc27fb38d56", "score": "0.49068367", "text": "func Get(k8sClient client.Client, obj client.Object, name, namespace string) error {\n\treturn k8sClient.Get(\n\t\tcontext.TODO(),\n\t\ttypes.NamespacedName{\n\t\t\tName: name,\n\t\t\tNamespace: namespace,\n\t\t},\n\t\tobj,\n\t)\n}", "title": "" }, { "docid": "c6a9e42ca6e66ee8d6eaf9b12e3e3394", "score": "0.48992538", "text": "func (s bundleNamespaceLister) Get(name string) (*v1alpha1.Bundle, error) {\n\tobj, exists, err := s.indexer.GetByKey(s.namespace + \"/\" + name)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\tif !exists {\n\t\treturn nil, errors.NewNotFound(v1alpha1.Resource(\"bundle\"), name)\n\t}\n\treturn obj.(*v1alpha1.Bundle), nil\n}", "title": "" }, { "docid": "f7c9fa28c67163b34f95e6c77dfc401f", "score": "0.4897007", "text": "func (in *Client) GetDashboard(namespace, name string) (*v1alpha1.MonitoringDashboard, error) {\n\tresult := v1alpha1.MonitoringDashboard{}\n\terr := in.client.Get().Namespace(namespace).Resource(\"monitoringdashboards\").SubResource(name).Do().Into(&result)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\treturn &result, err\n}", "title": "" }, { "docid": "011d16ebfb52645a134a11108c915715", "score": "0.48909193", "text": "func (s *GrpcServer) Get(cont context.Context, in *Empty) (*ClusterInfo, error) {\n\treturn s.driver.Get()\n}", "title": "" }, { "docid": "3444219b2199952b8ab4a61362423f2a", "score": "0.48741734", "text": "func (sr *Registry) Get(name string) Suite {\n\ts, found := sr.registry[name]\n\tif !found {\n\t\tlog.Fatal(fmt.Sprintf(\"The suite %s does not exist\", name))\n\t}\n\n\treturn s\n}", "title": "" }, { "docid": "7096cf67f755faf22f2487164fd6a3e5", "score": "0.4870639", "text": "func (s elasticacheClusterNamespaceLister) Get(name string) (*v1alpha1.ElasticacheCluster, error) {\n\tobj, exists, err := s.indexer.GetByKey(s.namespace + \"/\" + name)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\tif !exists {\n\t\treturn nil, errors.NewNotFound(v1alpha1.Resource(\"elasticachecluster\"), name)\n\t}\n\treturn obj.(*v1alpha1.ElasticacheCluster), nil\n}", "title": "" }, { "docid": "d0184f60294b61aa990006d01d4be336", "score": "0.48675668", "text": "func (s hTTPCheckNamespaceLister) Get(name string) (*v1alpha1.HTTPCheck, error) {\n\tobj, exists, err := s.indexer.GetByKey(s.namespace + \"/\" + name)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\tif !exists {\n\t\treturn nil, errors.NewNotFound(v1alpha1.Resource(\"httpcheck\"), name)\n\t}\n\treturn obj.(*v1alpha1.HTTPCheck), nil\n}", "title": "" }, { "docid": "38692b886aa022b0f4c7ce4fd2fe2e5e", "score": "0.48672822", "text": "func (ng *Engine) GetStore(indexName string, databaseName string) (store.KVStore, error) {\n\tvar (\n\t\terr error\n\t\tstorekv store.KVStore\n\t)\n\n\tstorekv, err = ng.open(indexName, databaseName)\n\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\treturn storekv, nil\n}", "title": "" }, { "docid": "76bf12ab166d7e3f5017542227c2df88", "score": "0.48644096", "text": "func (s *RedisStore) Get(r *http.Request, name string) (*sessions.Session, error) {\n\treturn sessions.GetRegistry(r).Get(s, name)\n}", "title": "" }, { "docid": "9fc1cd1856d7a68ddc113004659b9c94", "score": "0.4861095", "text": "func (s cognitoResourceServerNamespaceLister) Get(name string) (*v1alpha1.CognitoResourceServer, error) {\n\tobj, exists, err := s.indexer.GetByKey(s.namespace + \"/\" + name)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\tif !exists {\n\t\treturn nil, errors.NewNotFound(v1alpha1.Resource(\"cognitoresourceserver\"), name)\n\t}\n\treturn obj.(*v1alpha1.CognitoResourceServer), nil\n}", "title": "" }, { "docid": "d228e59636980d199eb272d26afd2b79", "score": "0.48505443", "text": "func (store *Store) Get(\n\tindex string,\n\tstart time.Time,\n\tend time.Time,\n\tenvelopeTypes []logcache_v1.EnvelopeType,\n\tnameFilter *regexp.Regexp,\n\tlimit int,\n\tdescending bool,\n) []*loggregator_v2.Envelope {\n\ttree, ok := store.storageIndex.Load(index)\n\tif !ok {\n\t\treturn nil\n\t}\n\n\ttree.(*storage).RLock()\n\tdefer tree.(*storage).RUnlock()\n\n\ttraverser := store.treeAscTraverse\n\tif descending {\n\t\ttraverser = store.treeDescTraverse\n\t}\n\n\tvar res []*loggregator_v2.Envelope\n\ttraverser(tree.(*storage).Root, start.UnixNano(), end.UnixNano(), func(e *loggregator_v2.Envelope) bool {\n\t\te = store.filterByName(e, nameFilter)\n\t\tif e == nil {\n\t\t\treturn false\n\t\t}\n\n\t\tif store.validEnvelopeType(e, envelopeTypes) {\n\t\t\tres = append(res, e)\n\t\t}\n\n\t\t// Return true to stop traversing\n\t\treturn len(res) >= limit\n\t})\n\n\tstore.metrics.egress.Add(float64(len(res)))\n\treturn res\n}", "title": "" }, { "docid": "9a01ce1b0317a90321d4e1b1e78da43d", "score": "0.48480895", "text": "func Get() []Metric {\n\tsingleton.mu.Lock()\n\thosts := singleton.hosts\n\tsingleton.mu.Unlock()\n\n\treturn hosts\n}", "title": "" }, { "docid": "0e0c322939b56edf4c0b90f2f8cf7ffd", "score": "0.4847897", "text": "func (s *compassConnectionLister) Get(name string) (*v1alpha1.CompassConnection, error) {\n\tobj, exists, err := s.indexer.GetByKey(name)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\tif !exists {\n\t\treturn nil, errors.NewNotFound(v1alpha1.Resource(\"compassconnection\"), name)\n\t}\n\treturn obj.(*v1alpha1.CompassConnection), nil\n}", "title": "" }, { "docid": "25a8a9739d9255b1e0a5b14b39961506", "score": "0.48418602", "text": "func (s healthcareServiceNamespaceLister) Get(name string) (*v1alpha1.HealthcareService, error) {\n\tobj, exists, err := s.indexer.GetByKey(s.namespace + \"/\" + name)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\tif !exists {\n\t\treturn nil, errors.NewNotFound(v1alpha1.Resource(\"healthcareservice\"), name)\n\t}\n\treturn obj.(*v1alpha1.HealthcareService), nil\n}", "title": "" }, { "docid": "cede3515e362f50e8372fa2dc7c95faa", "score": "0.48409635", "text": "func (s oIDCProviderConfigNamespaceLister) Get(name string) (*v1alpha1.OIDCProviderConfig, error) {\n\tobj, exists, err := s.indexer.GetByKey(s.namespace + \"/\" + name)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\tif !exists {\n\t\treturn nil, errors.NewNotFound(v1alpha1.Resource(\"oidcproviderconfig\"), name)\n\t}\n\treturn obj.(*v1alpha1.OIDCProviderConfig), nil\n}", "title": "" }, { "docid": "a95859fdf217529b172da5deeeeb3bcb", "score": "0.48368055", "text": "func (client Client) Get(resourceGroupName string, name string) (result ResourceType, err error) {\n\treq, err := client.GetPreparer(resourceGroupName, name)\n\tif err != nil {\n\t\treturn result, autorest.NewErrorWithError(err, \"redis.Client\", \"Get\", nil, \"Failure preparing request\")\n\t}\n\n\tresp, err := client.GetSender(req)\n\tif err != nil {\n\t\tresult.Response = autorest.Response{Response: resp}\n\t\treturn result, autorest.NewErrorWithError(err, \"redis.Client\", \"Get\", resp, \"Failure sending request\")\n\t}\n\n\tresult, err = client.GetResponder(resp)\n\tif err != nil {\n\t\terr = autorest.NewErrorWithError(err, \"redis.Client\", \"Get\", resp, \"Failure responding to request\")\n\t}\n\n\treturn\n}", "title": "" }, { "docid": "55a95a319f3388fcecb08e8ccadcdcf9", "score": "0.4834895", "text": "func (c *client) Monitoring() (*Monitoring, error) {\n\tres, err := c.baseRequest(http.MethodGet, routes.monitor, nil)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\tvar m monitoringResponse\n\tres.JSON(&m)\n\treturn &m.Ocs.Data, nil\n}", "title": "" }, { "docid": "6d52c37b13c4c4f62aa2b334b76a096d", "score": "0.4831935", "text": "func (s targetNamespaceLister) Get(name string) (*v1alpha1.Target, error) {\n\tobj, exists, err := s.indexer.GetByKey(s.namespace + \"/\" + name)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\tif !exists {\n\t\treturn nil, errors.NewNotFound(v1alpha1.Resource(\"target\"), name)\n\t}\n\treturn obj.(*v1alpha1.Target), nil\n}", "title": "" }, { "docid": "9eaa14eafb47424dc7a15751abdb0156", "score": "0.4821594", "text": "func (s salesforceSourceNamespaceLister) Get(name string) (*v1alpha1.SalesforceSource, error) {\n\tobj, exists, err := s.indexer.GetByKey(s.namespace + \"/\" + name)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\tif !exists {\n\t\treturn nil, errors.NewNotFound(v1alpha1.Resource(\"salesforcesource\"), name)\n\t}\n\treturn obj.(*v1alpha1.SalesforceSource), nil\n}", "title": "" }, { "docid": "c4f0142a058bb9e5c642bdfe12437ecd", "score": "0.4819714", "text": "func NewScyllaDBMonitoringLister(indexer cache.Indexer) ScyllaDBMonitoringLister {\n\treturn &scyllaDBMonitoringLister{indexer: indexer}\n}", "title": "" }, { "docid": "0ae54d931af00b845d691bd4d646ac2d", "score": "0.48100218", "text": "func (s JiraAggregateStore) Get(id string, data *models.JiraAggregate) error {\n\tif err := s.db.Read(s.name, id, data); err != nil {\n\t\treturn fmt.Errorf(\"error retrieving Jira aggregate: %s\",\n\t\t\terr.Error())\n\t}\n\n\treturn nil\n}", "title": "" }, { "docid": "0b694d56735a16d0d67825cd8999fd69", "score": "0.48099282", "text": "func (s clientViewNamespaceLister) Get(name string) (*v1alpha.ClientView, error) {\n\tobj, exists, err := s.indexer.GetByKey(s.namespace + \"/\" + name)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\tif !exists {\n\t\treturn nil, errors.NewNotFound(v1alpha.Resource(\"clientview\"), name)\n\t}\n\treturn obj.(*v1alpha.ClientView), nil\n}", "title": "" }, { "docid": "3230ea9035b460458eab9075c4f3535c", "score": "0.48071137", "text": "func (c *Dg) Get(name string) (Entry, error) {\n c.con.LogQuery(\"(get) device group %q\", name)\n return c.details(c.con.Get, name)\n}", "title": "" }, { "docid": "4bbc428f56d80922ab3386bffcdb56a5", "score": "0.48048344", "text": "func (s deepOneNamespaceLister) Get(name string) (*v1.DeepOne, error) {\n\tobj, exists, err := s.indexer.GetByKey(s.namespace + \"/\" + name)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\tif !exists {\n\t\treturn nil, errors.NewNotFound(v1.Resource(\"deepone\"), name)\n\t}\n\treturn obj.(*v1.DeepOne), nil\n}", "title": "" }, { "docid": "d58ce7fbb9efb584e6e4afedf9a50e7b", "score": "0.47968605", "text": "func (s icecreamNamespaceLister) Get(name string) (*v1alpha1.Icecream, error) {\n\tobj, exists, err := s.indexer.GetByKey(s.namespace + \"/\" + name)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\tif !exists {\n\t\treturn nil, errors.NewNotFound(v1alpha1.Resource(\"icecream\"), name)\n\t}\n\treturn obj.(*v1alpha1.Icecream), nil\n}", "title": "" }, { "docid": "2924769c294940320cf4fc406e2d3aaa", "score": "0.47938958", "text": "func (c APIClient) GetMonitoringJob(id string) (MonitoringJob, error) {\n\tvar mj MonitoringJob\n\t_, err := c.doHTTPUnmarshal(\"GET\", fmt.Sprintf(\"https://api.nsone.net/v1/monitoring/jobs/%s\", id), nil, &mj)\n\treturn mj, err\n}", "title": "" }, { "docid": "f55941379e6bc1c09912d52997c1c284", "score": "0.4788013", "text": "func GetDB(name string) DB {\n\treturn data.dbDict[name]\n}", "title": "" }, { "docid": "33e38454cf0365bec886c6d459ae744e", "score": "0.47818694", "text": "func (spy *StoreSpy) Get(r *http.Request, name string) (*sessions.Session, error) {\n\tspy.GetCalls++\n\treturn spy.Session, nil\n}", "title": "" } ]
e87746d012f2afdcc8c4ee08cb6233db
SetFilePaths sets the FilePaths field's value.
[ { "docid": "24e8ba6366d99e960c7570a0f03eb274", "score": "0.70409715", "text": "func (s *BatchDescribeMergeConflictsInput) SetFilePaths(v []*string) *BatchDescribeMergeConflictsInput {\n\ts.FilePaths = v\n\treturn s\n}", "title": "" } ]
[ { "docid": "35ec6b631d25a721527b30682db578a5", "score": "0.6212703", "text": "func SetPaths(p pgs.Parameters, pt PathType) { p.SetStr(pathTypeKey, string(pt)) }", "title": "" }, { "docid": "564b2d74b71c0d72d0a7387202c962ff", "score": "0.621027", "text": "func OptPaths(paths ...string) Option {\n\treturn func(co *ConfigOptions) error {\n\t\tco.FilePaths = paths\n\t\treturn nil\n\t}\n}", "title": "" }, { "docid": "6ad0ff209bf55c9caa6040d4192e725a", "score": "0.6114556", "text": "func (o HDInsightStreamingActivityResponseOutput) FilePaths() pulumi.ArrayOutput {\n\treturn o.ApplyT(func(v HDInsightStreamingActivityResponse) []interface{} { return v.FilePaths }).(pulumi.ArrayOutput)\n}", "title": "" }, { "docid": "a81e507ee619a15121644cdf52bf8e99", "score": "0.61137074", "text": "func (o HDInsightStreamingActivityOutput) FilePaths() pulumi.ArrayOutput {\n\treturn o.ApplyT(func(v HDInsightStreamingActivity) []interface{} { return v.FilePaths }).(pulumi.ArrayOutput)\n}", "title": "" }, { "docid": "32f4bb0a32aa568ec4bf3c465db2ebe4", "score": "0.5984679", "text": "func (k *Kilde) SetFilePath(filepath string) {\n\tk.filepath = filepath\n}", "title": "" }, { "docid": "ac92427b15a2248f303a82770e3d054d", "score": "0.59591496", "text": "func SetFiles(bin []byte, checksum, version string) {\n\trawBinary = bin\n\trawChecksum = checksum\n\trawVersion = version\n}", "title": "" }, { "docid": "8da2576e4004f3356d8817d96c75089c", "score": "0.59552187", "text": "func WithFilepaths(filepaths []string) Option {\n\treturn func(o *opts) error {\n\t\to.Filepaths = filepaths\n\t\to.Platforms = nil\n\t\treturn nil\n\t}\n}", "title": "" }, { "docid": "78d20ab912612e5dfc6717b30ef0c36a", "score": "0.57441205", "text": "func WithPaths(path ...string) Option {\n\treturn func(option *watcherOptions) {\n\t\tfor _, p := range path {\n\t\t\toption.paths = append(option.paths, p)\n\t\t}\n\t}\n}", "title": "" }, { "docid": "63c37e952f633b4ae3aa8762bc55cd73", "score": "0.5716968", "text": "func (lg *logger) SetFilePath(filePath string) {\n\tlg.filePath = filePath\n\tlg.handler = lg.NewHandler()\n}", "title": "" }, { "docid": "68c56e9b5a8eb5240139e4d497abd819", "score": "0.57113916", "text": "func (d *domainClient) SetFileInputFiles(ctx context.Context, args *SetFileInputFilesArgs) (err error) {\n\tif args != nil {\n\t\terr = rpcc.Invoke(ctx, \"DOM.setFileInputFiles\", args, nil, d.conn)\n\t} else {\n\t\terr = rpcc.Invoke(ctx, \"DOM.setFileInputFiles\", nil, nil, d.conn)\n\t}\n\tif err != nil {\n\t\terr = &internal.OpError{Domain: \"DOM\", Op: \"SetFileInputFiles\", Err: err}\n\t}\n\treturn\n}", "title": "" }, { "docid": "e299f4792c07a6f34ee7b4ad589cf7f3", "score": "0.56199133", "text": "func SetUploadFiles(sel interface{}, files []string, opts ...QueryOption) QueryAction {\n\treturn QueryAfter(sel, func(ctx context.Context, execCtx runtime.ExecutionContextID, nodes ...*cdp.Node) error {\n\t\tif len(nodes) < 1 {\n\t\t\treturn fmt.Errorf(\"selector %q did not return any nodes\", sel)\n\t\t}\n\n\t\treturn dom.SetFileInputFiles(files).WithNodeID(nodes[0].NodeID).Do(ctx)\n\t}, opts...)\n}", "title": "" }, { "docid": "5f7428151afd2950b2287e395c97ce74", "score": "0.5617884", "text": "func (o *CreateFileParams) SetFilePath(filePath string) {\n\to.FilePath = filePath\n}", "title": "" }, { "docid": "8ac15c4a3982f62f2fa3fb1a0413a3af", "score": "0.56030273", "text": "func (f *Finder) WithPaths(paths []string) *Finder { return f.IncludePath(paths...) }", "title": "" }, { "docid": "13324813e026170bbab3575f418112ee", "score": "0.5577636", "text": "func OptAddFilePaths(paths ...string) Option {\n\treturn OptAddPaths(paths...)\n}", "title": "" }, { "docid": "9c1c36558711bfe69f4f5aeb2f7c46ef", "score": "0.5548548", "text": "func (o *GetFileAttributesParams) SetFilePath(filePath string) {\n\to.FilePath = filePath\n}", "title": "" }, { "docid": "0d6899550fe68491dfea2cda06dda57a", "score": "0.54753584", "text": "func SetCookiesFilePath(s string) {\n\tdefaultCookiesFilePath = s\n}", "title": "" }, { "docid": "da0a2dba2083697e2bb6beda62ddaaae", "score": "0.53690225", "text": "func (m *Windows10GeneralConfiguration) SetFindMyFiles(value *Enablement)() {\n err := m.GetBackingStore().Set(\"findMyFiles\", value)\n if err != nil {\n panic(err)\n }\n}", "title": "" }, { "docid": "2e344809b57f8e8c40edebe373a12e44", "score": "0.53096515", "text": "func (o *ContentUnit) SetFiles(exec boil.Executor, insert bool, related ...*File) error {\n\tquery := \"update \\\"files\\\" set \\\"content_unit_id\\\" = null where \\\"content_unit_id\\\" = $1\"\n\tvalues := []interface{}{o.ID}\n\tif boil.DebugMode {\n\t\tfmt.Fprintln(boil.DebugWriter, query)\n\t\tfmt.Fprintln(boil.DebugWriter, values)\n\t}\n\t_, err := exec.Exec(query, values...)\n\tif err != nil {\n\t\treturn errors.Wrap(err, \"failed to remove relationships before set\")\n\t}\n\n\tif o.R != nil {\n\t\tfor _, rel := range o.R.Files {\n\t\t\tqueries.SetScanner(&rel.ContentUnitID, nil)\n\t\t\tif rel.R == nil {\n\t\t\t\tcontinue\n\t\t\t}\n\n\t\t\trel.R.ContentUnit = nil\n\t\t}\n\n\t\to.R.Files = nil\n\t}\n\treturn o.AddFiles(exec, insert, related...)\n}", "title": "" }, { "docid": "1d39cb7612266af2ad4f4e26d039acc9", "score": "0.5294631", "text": "func (ao *ApplyOptions) SetSourceFiles(fileNames []string) {\n\tao.ApplyOptions.DeleteOptions.Filenames = fileNames\n}", "title": "" }, { "docid": "50cb8d3349635d69d3bc9f0c963f2f9c", "score": "0.5266814", "text": "func FilePaths(checksums []FileChecksum) []string {\n\tvar result []string\n\tfor _, checksum := range checksums {\n\t\tresult = append(result, checksum.Path)\n\t}\n\treturn result\n}", "title": "" }, { "docid": "d764e913a32644dd4d62b8e2c5fdaf81", "score": "0.52360094", "text": "func (c *Config) Paths() []string { return c.paths }", "title": "" }, { "docid": "6f08d2ef4d1e20a21b634b4742a5e647", "score": "0.52212906", "text": "func (s *Server) SetKeyFilePath(path string) {\n\ts.keyFilePath = path\n}", "title": "" }, { "docid": "bec49bf5c9d36b00d16e32359d29eed8", "score": "0.5211128", "text": "func (self *RoutingDatabase) setPaths(paths map[int]map[int]string) {\n\tfor i := range paths {\n\t\tfor j := range paths[i] {\n\t\t\tself.connection.Do(\"HSET\", self.name, fmt.Sprintf(\"{%d:%d}\", i, j), paths[i][j])\n\t\t}\n\t}\n}", "title": "" }, { "docid": "4055e46bbd0a169a8180d2a2f8b43b01", "score": "0.52030253", "text": "func (b *HealerBuilder) ConfigFiles(paths []string) *HealerBuilder {\n\tif len(paths) > 0 {\n\t\tfor _, path := range paths {\n\t\t\tb.ConfigFile(path)\n\t\t}\n\t}\n\treturn b\n}", "title": "" }, { "docid": "b96ff9f4446186805a0e5b431d6abff6", "score": "0.5198657", "text": "func AppendFilePaths(basePath string, fileOrFolders ...string) string {\n\tvar rtvl string\n\tif !strings.HasSuffix(basePath, OSPathSeparator) {\n\t\trtvl = basePath\n\t} else {\n\t\trtvl = basePath[0 : len(basePath)-2]\n\t}\n\tfor _, thePath := range fileOrFolders {\n\t\trtvl = rtvl + OSPathSeparator + thePath\n\t}\n\treturn rtvl\n\n}", "title": "" }, { "docid": "bd474199b8c8ddd572d90508660c1e70", "score": "0.5190368", "text": "func (b *MessageUpdateBuilder) SetFiles(files ...restclient.File) *MessageUpdateBuilder {\n\tb.Files = files\n\tb.updateFlags |= updateFlagFiles\n\treturn b\n}", "title": "" }, { "docid": "bfbbb82089a90cb5a91a52dcfe334764", "score": "0.5137536", "text": "func SetPathParams(params map[string]string) Option {\n\treturn func(o *Options) {\n\t\to.PathParams = params\n\t}\n}", "title": "" }, { "docid": "a6fcc813e9924f1ebe4698e35088cc2e", "score": "0.51347697", "text": "func (c *Config) SetPath(path string) error {\n\tisDir := false\n\trealPath := \"\"\n\tif file := qn_res.Get(path); file != nil {\n\t\trealPath = path\n\t\tisDir = file.FileInfo().IsDir()\n\t} else {\n\t\t// Absolute path.\n\t\trealPath = qn_file.RealPath(path)\n\t\tif realPath == \"\" {\n\t\t\t// Relative path.\n\t\t\tc.paths.RLockFunc(func(array []string) {\n\t\t\t\tfor _, v := range array {\n\t\t\t\t\tif path, _ := qn.spath.Search(v, path); path != \"\" {\n\t\t\t\t\t\trealPath = path\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\t\tif realPath != \"\" {\n\t\t\tisDir = qn_file.IsDir(realPath)\n\t\t}\n\t}\n\t// Path not exist.\n\tif realPath == \"\" {\n\t\tbuffer := bytes.NewBuffer(nil)\n\t\tif c.paths.Len() > 0 {\n\t\t\tbuffer.WriteString(fmt.Sprintf(\"[qn_cfg] SetPath failed: cannot find directory \\\"%s\\\" in following paths:\", path))\n\t\t\tc.paths.RLockFunc(func(array []string) {\n\t\t\t\tfor k, v := range array {\n\t\t\t\t\tbuffer.WriteString(fmt.Sprintf(\"\\n%d. %s\", k+1, v))\n\t\t\t\t}\n\t\t\t})\n\t\t} else {\n\t\t\tbuffer.WriteString(fmt.Sprintf(`[qn_cfg] SetPath failed: path \"%s\" does not exist`, path))\n\t\t}\n\t\terr := errors.New(buffer.String())\n\t\tif errorPrint() {\n\t\t\tqn_log.Error(err)\n\t\t}\n\t\treturn err\n\t}\n\t// Should be a directory.\n\tif !isDir {\n\t\terr := fmt.Errorf(`[qn_cfg] SetPath failed: path \"%s\" should be directory type`, path)\n\t\tif errorPrint() {\n\t\t\tqn_log.Error(err)\n\t\t}\n\t\treturn err\n\t}\n\t// Repeated path check.\n\tif c.paths.Search(realPath) != -1 {\n\t\treturn nil\n\t}\n\tc.jsons.Clear()\n\tc.paths.Clear()\n\tc.paths.Append(realPath)\n\treturn nil\n}", "title": "" }, { "docid": "cd4ea339b19e8e0b52d2b740f41da31b", "score": "0.5129911", "text": "func WatchPaths(paths, excludePatterns []string, reloader livereload.Reloader, log termlog.Logger) error {\n\tch := make(chan []string, 1)\n\tfor _, path := range paths {\n\t\tabsPath, err := filepath.Abs(path)\n\t\tif err != nil {\n\t\t\treturn err\n\t\t}\n\t\tif absPath[len(absPath)-1] != filepath.Separator {\n\t\t\tabsPath += string(filepath.Separator)\n\t\t}\n\n\t\tpathchan := make(chan string, 1)\n\n\t\terr = watch(path, pathchan)\n\t\tif err != nil {\n\t\t\treturn err\n\t\t}\n\n\t\tgo func() {\n\t\t\tfor files := range batch(batchTime, pathchan) {\n\t\t\t\tfiles = filterFiles(absPath, files, excludePatterns, log)\n\n\t\t\t\tif len(files) > 0 {\n\t\t\t\t\tch <- files\n\t\t\t\t}\n\t\t\t}\n\t\t}()\n\t}\n\tgo reloader.Watch(ch)\n\treturn nil\n}", "title": "" }, { "docid": "9e81acd21c6dfeefc05c3678993279fd", "score": "0.51169944", "text": "func (b *ImageSourceApplyConfiguration) WithPaths(values ...*ImageSourcePathApplyConfiguration) *ImageSourceApplyConfiguration {\n\tfor i := range values {\n\t\tif values[i] == nil {\n\t\t\tpanic(\"nil value passed to WithPaths\")\n\t\t}\n\t\tb.Paths = append(b.Paths, *values[i])\n\t}\n\treturn b\n}", "title": "" }, { "docid": "0defdb4a222ac997fa43764b65c4a9c6", "score": "0.5114751", "text": "func (c Core) SetOptionAlertOverridesFilePath(filepath string) (map[string]interface{}, error) {\n\tm := map[string]string{\n\t\t\"filePath\": filepath,\n\t}\n\treturn c.c.Request(\"core/action/setOptionAlertOverridesFilePath/\", m)\n}", "title": "" }, { "docid": "5768b36bfac6178992101ec82cf34af3", "score": "0.50800943", "text": "func (s *sourcefiles) Set(value string) error {\n\tsrcFlagCalled = true\n\tfor _, file := range strings.Split(value, \",\") {\n\t\tisGoFile := strings.HasSuffix(file, \".go\")\n\t\tif !isGoFile {\n\t\t\terrorMessage := file + \"is not a .go file\"\n\t\t\treturn errors.New(errorMessage)\n\t\t}\n\t\t*s = append(*s, file)\n\t}\n\treturn nil\n}", "title": "" }, { "docid": "a2e6f7d47a8dc6ae4331e789ee584c66", "score": "0.50649023", "text": "func (p *PathGlobs) Paths() []string {\n\tall, err := p.all()\n\tif err != nil {\n\t\t// Error should have already been returned during Validate()\n\t\tpanic(err)\n\t}\n\treturn all\n}", "title": "" }, { "docid": "ad6f8383b91e5d96502e870b6d7d56fa", "score": "0.5051974", "text": "func (p *Option) SetConfigFilePath(path string) {\n\tif len(path) > 0 {\n\t\tp.configFilePath = path\n\t}\n}", "title": "" }, { "docid": "b4cba912088cc84c997779326fac1627", "score": "0.5034056", "text": "func InitPaths(cfg *Path) error {\n\treturn Paths.InitPaths(cfg)\n}", "title": "" }, { "docid": "3f685324e6d577925a085c01a280cb66", "score": "0.5025706", "text": "func OptAddPaths(paths ...string) Option {\n\treturn func(co *ConfigOptions) error {\n\t\tco.FilePaths = append(co.FilePaths, paths...)\n\t\treturn nil\n\t}\n}", "title": "" }, { "docid": "c80284d7071eaf4f5a2f9dd7fce0e192", "score": "0.5016215", "text": "func SetPidfilePath(p string) {\n\t*pidfile = p\n}", "title": "" }, { "docid": "5bdd1d4328362e01a87cc46fa82c861f", "score": "0.5009835", "text": "func (c *Context) Files(files ...string) error {\n\tfor i := range files {\n\t\tif err := c.conf.parse(files[i]); err != nil {\n\t\t\treturn err\n\t\t}\n\t}\n\treturn nil\n}", "title": "" }, { "docid": "8a2dafc0548a2bd810a4f20c0166dcb8", "score": "0.49909082", "text": "func (e *EchoTestContext) SetPath(p string) {\n\te.SetPathRequestValues = append(e.SetPathRequestValues, p)\n\n}", "title": "" }, { "docid": "cfb3de904e0f986e3d3e9cf554ece7ce", "score": "0.4961636", "text": "func SetStates(pattern string, state FileState) error {\n\tr, err := regexp.Compile(pattern)\n\tif err != nil {\n\t\treturn err\n\t}\n\treturn filepath.Walk(\".\", func(path string, fi os.FileInfo, err error) error {\n\t\tif err != nil {\n\t\t\treturn err\n\t\t}\n\t\tif !r.MatchString(path) || hasIgnore(path) {\n\t\t\treturn nil\n\t\t}\n\t\tSetState(path, state)\n\t\treturn nil\n\t})\n}", "title": "" }, { "docid": "99318ab45b0effd6fdc116745296ba4f", "score": "0.495965", "text": "func OptSetStreamPaths(streamsPaths ...string) OptFunc {\n\treturn func(r *Reader) {\n\t\tr.streamsPaths = streamsPaths\n\t\tr.streamsMode = true\n\t}\n}", "title": "" }, { "docid": "0599fb447ed5184b93a3db6f08bc660a", "score": "0.4957985", "text": "func (s *SourceFileSpecifier) SetFilePath(v string) *SourceFileSpecifier {\n\ts.FilePath = &v\n\treturn s\n}", "title": "" }, { "docid": "e67f972320e3abbc8a6bb62a7bf99da3", "score": "0.49516276", "text": "func (o *FileversionResponseIncluded) SetFiles(v map[string]ViewProjectFile) {\n\to.Files = &v\n}", "title": "" }, { "docid": "ad296d2af856572781e1b2293a6898c9", "score": "0.49434054", "text": "func (r *Router) ServeFiles(path string, root http.FileSystem) {\n\tif len(path) < 10 || path[len(path)-10:] != \"/*filepath\" {\n\t\tpanic(\"path must end with /*filepath\")\n\t}\n\n\tfileServer := http.FileServer(root)\n\n\tr.GET(path, func(w http.ResponseWriter, req *http.Request, vars map[string]string) {\n\t\treq.URL.Path = vars[\"filepath\"]\n\t\tfileServer.ServeHTTP(w, req)\n\t})\n}", "title": "" }, { "docid": "6fe5698f898e8521702f01de1774544d", "score": "0.49399513", "text": "func (fdb *FlatFileDB) SetFollowers(followers models.Followers) error {\n\tfdb.mtx.Lock()\n\tdefer fdb.mtx.Unlock()\n\n\tout, err := json.MarshalIndent(followers, \"\", \" \")\n\tif err != nil {\n\t\treturn err\n\t}\n\n\treturn ioutil.WriteFile(path.Join(fdb.rootDir, FollowersFile), out, os.ModePerm)\n}", "title": "" }, { "docid": "f45b6464efa823964884fd83d816c835", "score": "0.4935804", "text": "func OptUnsetPaths() Option {\n\treturn func(co *ConfigOptions) error {\n\t\tco.FilePaths = nil\n\t\treturn nil\n\t}\n}", "title": "" }, { "docid": "90edad02a6cc552132a50f09ae2cd0dd", "score": "0.490975", "text": "func (paths *Path) InitPaths(cfg *Path) error {\n\terr := paths.initPaths(cfg)\n\tif err != nil {\n\t\treturn err\n\t}\n\n\t// make sure the data path exists\n\terr = os.MkdirAll(paths.Data, 0750)\n\tif err != nil {\n\t\treturn fmt.Errorf(\"Failed to create data path %s: %v\", paths.Data, err)\n\t}\n\n\treturn nil\n}", "title": "" }, { "docid": "7594e8c40f436916ed2f020a2729df63", "score": "0.49072826", "text": "func SetAPIPaths(router *gin.Engine) {\n\tobjectFactory := CreateObjectFactory()\n\tobjectGateWay := CreateObjectGateway()\n\n\taddObjectAPI := CreateAddObjectAPI(objectFactory, objectGateWay)\n\tgetObjectAPI := CreateGetObjectAPI(objectGateWay)\n\tupdateObjectAPI := CreateUpdateObjectAPI(objectFactory, objectGateWay)\n\tdeleteObjectAPI := CreateDeleteObjectAPI(objectGateWay)\n\n\tapiGroup := router.Group(\"/api\")\n\t{\n\t\tapiGroup.POST(\"/objects/:objectName\", addObjectAPI.Add)\n\t\tapiGroup.GET(\"/objects\", getObjectAPI.GetAllObjectNames)\n\t\tapiGroup.GET(\"/objects/:objectName\", getObjectAPI.Get)\n\t\tapiGroup.GET(\"/objects/:objectName/:objectId\", getObjectAPI.GetByObjectID)\n\t\tapiGroup.PUT(\"/objects/:objectName/:objectId\", updateObjectAPI.Update)\n\t\tapiGroup.DELETE(\"/objects/:objectName/:objectId\", deleteObjectAPI.Delete)\n\t}\n}", "title": "" }, { "docid": "0b3df93bfc01b6ea0ad98b75d88cd86f", "score": "0.4900401", "text": "func (b *Builder) Files(files []string) *Builder {\n\tif files != nil {\n\t\tfor _, file := range files {\n\t\t\tb.files = append(b.files, file)\n\t\t}\n\t}\n\treturn b\n}", "title": "" }, { "docid": "8f2b276a31be5397fbc3520d38cf5e0b", "score": "0.48985943", "text": "func SetAllowAllFiles(ok bool) Setting {\n\treturn func(source string) string {\n\t\treturn boolSetting(source, \"allowAllFiles\", ok)\n\t}\n}", "title": "" }, { "docid": "18961c9a72aa61c04d5e0708f74c3032", "score": "0.48809403", "text": "func (l *DefaultLayout) Paths() (dirs []string) {\n\tfor _, p := range defaultLayoutPaths {\n\t\tdirs = append(dirs, l.Join(l.Path, p))\n\t}\n\n\t// also add subdirs\n\tfor i := 0; i < 256; i++ {\n\t\tsubdir := hex.EncodeToString([]byte{byte(i)})\n\t\tdirs = append(dirs, l.Join(l.Path, defaultLayoutPaths[restic.DataFile], subdir))\n\t}\n\n\treturn dirs\n}", "title": "" }, { "docid": "201e991d97ce24a386b248d858bea109", "score": "0.48800492", "text": "func FallBackOnFiles(spec v1alpha1.LiveUpdateSpec) model.PathSet {\n\treturn model.NewPathSet(spec.StopPaths, spec.BasePath)\n}", "title": "" }, { "docid": "4ff109ac3129bde402be6dfc067fb11f", "score": "0.48744714", "text": "func (c *Config) AddFilepath(filepath string) {\n\tc.filepaths = append(c.filepaths, filepath)\n}", "title": "" }, { "docid": "b0bcf5b9bd78aa431369383a89a5126c", "score": "0.48725957", "text": "func SetTemplates(path string) error {\n\tvar err error\n\ttemplates, err = template.ParseGlob(path)\n\treturn err\n}", "title": "" }, { "docid": "b4c7857044f7642300ee20089925e2e6", "score": "0.48676002", "text": "func (c *Config) FilePath(file ...string) (path string) {\n\tname := c.name\n\tif len(file) > 0 {\n\t\tname = file[0]\n\t}\n\t// Searching resource manager.\n\tif !qn_res.IsEmpty() {\n\t\tfor _, v := range resourceTryFiles {\n\t\t\tif file := qn_res.Get(v + name); file != nil {\n\t\t\t\tpath = file.Name()\n\t\t\t\treturn\n\t\t\t}\n\t\t}\n\t\tc.paths.RLockFunc(func(array []string) {\n\t\t\tfor _, prefix := range array {\n\t\t\t\tfor _, v := range resourceTryFiles {\n\t\t\t\t\tif file := qn_res.Get(prefix + v + name); file != nil {\n\t\t\t\t\t\tpath = file.Name()\n\t\t\t\t\t\treturn\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t})\n\t}\n\t// Searching the file system.\n\tc.paths.RLockFunc(func(array []string) {\n\t\tfor _, prefix := range array {\n\t\t\tprefix = qn.str.TrimRight(prefix, `\\/`)\n\t\t\tif path, _ = qn.spath.Search(prefix, name); path != \"\" {\n\t\t\t\treturn\n\t\t\t}\n\t\t\tif path, _ = qn.spath.Search(prefix+qn_file.Separator+\"config\", name); path != \"\" {\n\t\t\t\treturn\n\t\t\t}\n\t\t}\n\t})\n\treturn\n}", "title": "" }, { "docid": "99a20ea0d23e7575199babec97419be2", "score": "0.48630658", "text": "func (_m *IOnodeIface) SetPath(s string) {\n\t_m.Called(s)\n}", "title": "" }, { "docid": "eb23bb225f6409c748d8ad509bad3361", "score": "0.48617584", "text": "func (c *Config) setSiteSettingsPaths(appType string) {\n\tsettingsFileBasePath := filepath.Join(c.AppRoot, c.Docroot)\n\tvar settingsFilePath, localSettingsFilePath string\n\tswitch appType {\n\tcase \"drupal8\":\n\t\tfallthrough\n\tcase \"drupal7\":\n\t\tsettingsFilePath = filepath.Join(settingsFileBasePath, \"sites\", \"default\", \"settings.php\")\n\t\tlocalSettingsFilePath = filepath.Join(settingsFileBasePath, \"sites\", \"default\", \"settings.local.php\")\n\tcase \"wordpress\":\n\t\tsettingsFilePath = filepath.Join(settingsFileBasePath, \"wp-config.php\")\n\t\tlocalSettingsFilePath = filepath.Join(settingsFileBasePath, \"wp-config-local.php\")\n\t}\n\n\tc.SiteSettingsPath = settingsFilePath\n\tc.SiteLocalSettingsPath = localSettingsFilePath\n}", "title": "" }, { "docid": "ea773b41c5bf89fd363391a68c28af29", "score": "0.48506308", "text": "func (r *Router) ServeFiles(path string, root http.FileSystem) {\n\tif len(path) < 10 || path[len(path)-10:] != \"/*filepath\" {\n\t\tpanic(\"path must end with /*filepath in path '\" + path + \"'\")\n\t}\n\n\tfileServer := http.FileServer(root)\n\n\tr.GET(path, func(c *goa.Context) {\n\t\tc.URL.Path = c.Param(\"filepath\")\n\t\tfileServer.ServeHTTP(c.ResponseWriter, c.Request)\n\t\tc.Handled = true\n\t})\n}", "title": "" }, { "docid": "b4a642b8b918dd58d633c962b8caea71", "score": "0.4846784", "text": "func setfaclDirPathsTraversal(\n\tdir string,\n\tpaths []string,\n\tfsGroup string,\n) error {\n\treturn runBashXargs(\n\t\tsetfaclDirPathsTraversalSh,\n\t\tstruct {\n\t\t\tDir string\n\t\t\tGroup string\n\t\t}{\n\t\t\tDir: dir,\n\t\t\tGroup: fsGroup,\n\t\t},\n\t\tpaths,\n\t)\n}", "title": "" }, { "docid": "c94a0e71fe313217f14eb493e099a088", "score": "0.4846587", "text": "func (rc *RC) SetPath(configPath string) {\n\trc.Config.Path = configPath\n}", "title": "" }, { "docid": "cece531ea85a8955b6817ed54cb61a32", "score": "0.4845756", "text": "func (o *Targets) SetGroupPaths(v []GroupPath) {\n\to.GroupPaths = &v\n}", "title": "" }, { "docid": "c93076e723746d89c51679a2ae39a979", "score": "0.48372975", "text": "func (c *controller) Paths() []*framework.Path {\n\treturn framework.PathAppend(\n\t\t[]*framework.Path{\n\t\t\tc.pathAccounts(),\n\t\t\tc.pathAccount(),\n\t\t\tc.pathNamespaces(),\n\t\t\tc.pathSignPayload(),\n\t\t},\n\t)\n}", "title": "" }, { "docid": "0eac1a75fda3e4d48ea0c7bfed3432b4", "score": "0.48359177", "text": "func SetFileSystem(fs afero.Fs) {\n fileConfig.FileSystem = fs\n}", "title": "" }, { "docid": "265d010162da89f87d19f2fcca620231", "score": "0.4818402", "text": "func (s *ListFileCommitHistoryInput) SetFilePath(v string) *ListFileCommitHistoryInput {\n\ts.FilePath = &v\n\treturn s\n}", "title": "" }, { "docid": "ed1dbf797d4a3d362057dd58934e2d0c", "score": "0.48140672", "text": "func (s *Server) SetCrtFilePath(path string) {\n\ts.crtFilePath = path\n}", "title": "" }, { "docid": "1864912510fcd13a2c3387adf6e5c05f", "score": "0.48089442", "text": "func (paths *Path) initPaths(cfg *Path) error {\n\t*paths = *cfg\n\n\t// default for config path\n\tif paths.Config == \"\" {\n\t\tpaths.Config = paths.Home\n\t}\n\n\t// default for data path\n\tif paths.Data == \"\" {\n\t\tpaths.Data = filepath.Join(paths.Home, \"data\")\n\t}\n\n\t// default for logs path\n\tif paths.Logs == \"\" {\n\t\tpaths.Logs = filepath.Join(paths.Home, \"logs\")\n\t}\n\n\treturn nil\n}", "title": "" }, { "docid": "2641cf9b5c4b0c35a47d829416546f64", "score": "0.4803254", "text": "func Paths() []string { return c.Paths() }", "title": "" }, { "docid": "c3b84655c0813f07f16a4f14023bccb7", "score": "0.4788739", "text": "func (b *Bundle) WatchFiles(watch bool) *Bundle {\n\tif watch && b.err == nil && b.watcher == nil {\n\t\tb.watcher, b.err = fsnotify.NewWatcher()\n\t}\n\treturn b\n}", "title": "" }, { "docid": "9b3e101d7fcbe8cdc2751bc493b71084", "score": "0.4788137", "text": "func GetFilePaths(filePattern string) (paths []string, err error) {\n\tfilePaths := []string{}\n\twd, err := os.Getwd()\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\twalkFn := func(path string, info os.FileInfo, err error) error {\n\t\tif err != nil {\n\t\t\treturn err\n\t\t}\n\t\tpaths, err := filepath.Glob(path + filePattern)\n\t\tif err != nil {\n\t\t\treturn err\n\t\t}\n\t\tfilePaths = append(filePaths, paths...)\n\t\treturn nil\n\t}\n\tfilepath.Walk(wd, walkFn)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\treturn filePaths, nil\n}", "title": "" }, { "docid": "2b90e27080f7914e399985454a70b8cb", "score": "0.47753987", "text": "func WithFilepathsAndPlatforms(filepaths, platforms []string) Option {\n\treturn func(o *opts) error {\n\t\tif len(filepaths) != len(platforms) {\n\t\t\treturn fmt.Errorf(\n\t\t\t\t`\"filepaths\" length (%d) must match \"platforms\" length (%d): %w`,\n\t\t\t\tlen(filepaths),\n\t\t\t\tlen(platforms),\n\t\t\t\tErrMismatchFilepathAndPlatform,\n\t\t\t)\n\t\t}\n\t\to.Filepaths = filepaths\n\t\to.Platforms = platforms\n\t\treturn nil\n\t}\n}", "title": "" }, { "docid": "679e47e56c93c35100019f07ed24b8c6", "score": "0.47600442", "text": "func (config *Config) ExpandFilePaths() {\n\texpanded, err := ExpandTilde(config.TarDirectory)\n\tif err == nil {\n\t\tconfig.TarDirectory = expanded\n\t}\n\texpanded, err = ExpandTilde(config.LogDirectory)\n\tif err == nil {\n\t\tconfig.LogDirectory = expanded\n\t}\n\texpanded, err = ExpandTilde(config.RestoreDirectory)\n\tif err == nil {\n\t\tconfig.RestoreDirectory = expanded\n\t}\n\texpanded, err = ExpandTilde(config.ReplicationDirectory)\n\tif err == nil {\n\t\tconfig.ReplicationDirectory = expanded\n\t}\n\texpanded, err = ExpandTilde(config.DPNStagingDirectory)\n\tif err == nil {\n\t\tconfig.DPNStagingDirectory = expanded\n\t}\n\texpanded, err = ExpandTilde(config.DPNHomeDirectory)\n\tif err == nil {\n\t\tconfig.DPNHomeDirectory = expanded\n\t}\n}", "title": "" }, { "docid": "c8b19e203645b5c83792601bb97f3e49", "score": "0.47594798", "text": "func (mr *MockRaftConfigMockRecorder) SetConfigFilePath(arg0 interface{}) *gomock.Call {\n\tmr.mock.ctrl.T.Helper()\n\treturn mr.mock.ctrl.RecordCallWithMethodType(mr.mock, \"SetConfigFilePath\", reflect.TypeOf((*MockRaftConfig)(nil).SetConfigFilePath), arg0)\n}", "title": "" }, { "docid": "7a4f4ade60fdfadc2149029603cb56c3", "score": "0.4743721", "text": "func ProxyFiles(txt string) RunOption {\n\treturn optionSetter(func(opts *runConfig) {\n\t\topts.sandbox.ProxyFiles = txt\n\t})\n}", "title": "" }, { "docid": "e0bfe7ef1d275c4d1c7362b92e5beed4", "score": "0.47378308", "text": "func (c *client) SetValidateConfigFiles(before, after []string) {\n\tc.clientMu.Lock()\n\tdefer c.clientMu.Unlock()\n\tc.Transaction.ValidateConfigFilesBefore = before\n\tc.Transaction.ValidateConfigFilesAfter = after\n}", "title": "" }, { "docid": "e553c5bc4cdee7be348e029fdae3fd65", "score": "0.4730807", "text": "func (i *ListOfFile) Set(value string) error {\n\t*i = append(*i, value)\n\treturn nil\n}", "title": "" }, { "docid": "4d0f0e2a10536fc58c01b779b518c46f", "score": "0.47259188", "text": "func SetPath(path string) Config {\n\treturn func(c *Client) {\n\t\tc.path = path\n\t}\n}", "title": "" }, { "docid": "24ec8267f57979254eb78c5e4772355c", "score": "0.47162774", "text": "func (options *UpdateLoggingConfigOptions) SetAppLogPaths(appLogPaths []string) *UpdateLoggingConfigOptions {\n\toptions.AppLogPaths = appLogPaths\n\treturn options\n}", "title": "" }, { "docid": "3fe6676e69ce0b31f29dd8ee9c703f3f", "score": "0.47152558", "text": "func (adp *fileStorage) Files(ctx context.Context, ptn string) ([]string, error) {\n\tmatches, err := filepath.Glob(adp.dsn.Join(ptn))\n\tif err != nil {\n\t\tlogger.Printf(\"Failed to retrieve list files %s\", err)\n\t\treturn []string{}, err\n\t}\n\n\tfiles := []string{}\n\tfor _, file := range matches {\n\t\tfiles = append(files, fmt.Sprintf(\"file://%s\", file))\n\t}\n\n\treturn files, nil\n}", "title": "" }, { "docid": "cd22ee92ad9efab6ae6c49dfaa8587b8", "score": "0.47079578", "text": "func fsPaths(paths []string) []string {\n\tif len(paths) == 0 {\n\t\tpaths = append(paths, \".\")\n\t}\n\tvar fsp []string\n\tfor _, path := range paths {\n\t\tfsp = append(fsp, fsPath(path))\n\t}\n\treturn fsp\n}", "title": "" }, { "docid": "ac2fea7b4e387968597eed124d5b2276", "score": "0.46949714", "text": "func (s *SetFileModeEntry) SetFilePath(v string) *SetFileModeEntry {\n\ts.FilePath = &v\n\treturn s\n}", "title": "" }, { "docid": "be1e9b4c2515df2be431bd896d0e3e59", "score": "0.46795607", "text": "func FindFilePaths(path string) (paths []string) {\n\tcfg := &packages.Config{Mode: packages.NeedFiles | packages.NeedSyntax}\n\tpkgs, err := packages.Load(cfg, path)\n\tif err != nil {\n\t\tpanic(fmt.Errorf(\"load: %w\", err))\n\t}\n\n\tif packages.PrintErrors(pkgs) > 0 {\n\t\tos.Exit(1)\n\t}\n\n\tfor _, pkg := range pkgs {\n\t\tpaths = append(paths, pkg.GoFiles...)\n\t}\n\treturn\n}", "title": "" }, { "docid": "f72e3047e71ee81a2147ebd17e3f0ba0", "score": "0.46727717", "text": "func (c *client) WithFiles(f []string) compiler.Engine {\n\tif f != nil {\n\t\tc.files = f\n\t}\n\n\treturn c\n}", "title": "" }, { "docid": "36661bafe91547dbb5631230b86d492e", "score": "0.467202", "text": "func (s *BatchDescribeMergeConflictsError) SetFilePath(v string) *BatchDescribeMergeConflictsError {\n\ts.FilePath = &v\n\treturn s\n}", "title": "" }, { "docid": "bd8cbedc6f6771df86657fe4c4aa0dea", "score": "0.4671575", "text": "func SetLogFiles(newLogFiles LogFiles) {\n\tlogFiles = newLogFiles\n}", "title": "" }, { "docid": "e0fdae83a97e529bfc5569d6ae0c8628", "score": "0.46540907", "text": "func (options *CreateLoggingConfigOptions) SetAppLogPaths(appLogPaths []string) *CreateLoggingConfigOptions {\n\toptions.AppLogPaths = appLogPaths\n\treturn options\n}", "title": "" }, { "docid": "f83cc3e51ca27d96619a15c11f33531c", "score": "0.46501267", "text": "func (fp FlagPrefix) FilePath(s ...string) string {\n\tfor _, v := range s {\n\t\tv = FilePath(os.Getenv(string(fp) + v + \"_FILE\"))\n\t\tif len(v) > 0 {\n\t\t\treturn v\n\t\t}\n\t}\n\treturn \"\"\n}", "title": "" }, { "docid": "4ab370f3bc69fec08dc561226d920c48", "score": "0.4647648", "text": "func ResolvePaths(refs []*string, base string) error {\n\tfor _, ref := range refs {\n\t\t// Don't resolve empty paths\n\t\tif len(*ref) > 0 {\n\t\t\t// Don't resolve absolute paths\n\t\t\tif !filepath.IsAbs(*ref) {\n\t\t\t\t*ref = filepath.Join(base, *ref)\n\t\t\t}\n\t\t}\n\t}\n\treturn nil\n}", "title": "" }, { "docid": "5aa797668513c14a9a18fd4d7387dda3", "score": "0.46456152", "text": "func FilesToPaths(files []File) []string {\n\tpaths := make([]string, len(files))\n\tfor i, file := range files {\n\t\tpaths[i] = file.Path()\n\t}\n\treturn paths\n}", "title": "" }, { "docid": "10cdd15fb06598d51537ab88d9079d23", "score": "0.46348822", "text": "func (p ProjectFile) AbsolutePaths(prjPath string) ProjectFile {\n\tfor i := range p.Expenses {\n\t\tp.Expenses[i].Path = absolutPath(prjPath, p.Expenses[i].Path)\n\t}\n\tfor i := range p.Invoices {\n\t\tp.Invoices[i].Path = absolutPath(prjPath, p.Invoices[i].Path)\n\t}\n\treturn p\n}", "title": "" }, { "docid": "032495a7239cfb12b4a72e35f883ac1a", "score": "0.4627409", "text": "func (a *Analyzer) Paths() []string {\n\tpaths := make([]string, 0, len(a.packages))\n\tfor _, pkg := range a.packages {\n\t\tpaths = append(paths, pkg.PkgPath)\n\t}\n\treturn paths\n}", "title": "" }, { "docid": "ad59e59bcdd2807b155f725a67df9328", "score": "0.46226475", "text": "func (m *UrlMatchInfo) SetBaseUrls(value []string)() {\n err := m.GetBackingStore().Set(\"baseUrls\", value)\n if err != nil {\n panic(err)\n }\n}", "title": "" }, { "docid": "34d4743b9382b2a4caadb4050772c109", "score": "0.46222705", "text": "func (s *GetFileInput) SetFilePath(v string) *GetFileInput {\n\ts.FilePath = &v\n\treturn s\n}", "title": "" }, { "docid": "39271d9eb0802bd708230cacf1d9028f", "score": "0.46184427", "text": "func (client filesystemClient) ListPaths(ctx context.Context, recursive bool, filesystem string, directory *string, continuation *string, maxResults *int32, upn *bool, xMsClientRequestID *string, timeout *int32, xMsDate *string) (*PathList, error) {\n\tif err := validate([]validation{\n\t\t{targetValue: maxResults,\n\t\t\tconstraints: []constraint{{target: \"maxResults\", name: null, rule: false,\n\t\t\t\tchain: []constraint{{target: \"maxResults\", name: inclusiveMinimum, rule: 1, chain: nil}}}}},\n\t\t{targetValue: filesystem,\n\t\t\tconstraints: []constraint{{target: \"filesystem\", name: maxLength, rule: 63, chain: nil},\n\t\t\t\t{target: \"filesystem\", name: minLength, rule: 3, chain: nil},\n\t\t\t\t{target: \"filesystem\", name: pattern, rule: `^[$a-z0-9][-a-z0-9]{1,61}[a-z0-9]$`, chain: nil}}},\n\t\t{targetValue: xMsClientRequestID,\n\t\t\tconstraints: []constraint{{target: \"xMsClientRequestID\", name: null, rule: false,\n\t\t\t\tchain: []constraint{{target: \"xMsClientRequestID\", name: pattern, rule: `^[{(]?[0-9a-f]{8}[-]?([0-9a-f]{4}[-]?){3}[0-9a-f]{12}[)}]?$`, chain: nil}}}}},\n\t\t{targetValue: timeout,\n\t\t\tconstraints: []constraint{{target: \"timeout\", name: null, rule: false,\n\t\t\t\tchain: []constraint{{target: \"timeout\", name: inclusiveMinimum, rule: 1, chain: nil}}}}}}); err != nil {\n\t\treturn nil, err\n\t}\n\treq, err := client.listPathsPreparer(recursive, filesystem, directory, continuation, maxResults, upn, xMsClientRequestID, timeout, xMsDate)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\tresp, err := client.Pipeline().Do(ctx, responderPolicyFactory{responder: client.listPathsResponder}, req)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\treturn resp.(*PathList), err\n}", "title": "" }, { "docid": "4ca87ce200a7154430141b26e9db9822", "score": "0.46090415", "text": "func (s *Set) Files() []File {\n\tout := make([]File, 0, len(s.files))\n\ts.Enumerate(func(f File) error {\n\t\tout = append(out, f)\n\t\treturn nil\n\t})\n\treturn out\n}", "title": "" }, { "docid": "feadd81c96cddc621fa3a688ae4bce0a", "score": "0.46005356", "text": "func (s *PutFileInput) SetFilePath(v string) *PutFileInput {\n\ts.FilePath = &v\n\treturn s\n}", "title": "" }, { "docid": "4ff34bd6c90ec91effb0c0247e15a8ad", "score": "0.4599715", "text": "func (s *DeleteFileInput) SetFilePath(v string) *DeleteFileInput {\n\ts.FilePath = &v\n\treturn s\n}", "title": "" }, { "docid": "b55cd148c99053694130f59edd638c02", "score": "0.45887068", "text": "func SetLines(filename string, lines []string) error {\n\tfile, err := os.Create(filename)\n\tif err != nil {\n\t\treturn err\n\t}\n\tdefer file.Close()\n\n\tw := bufio.NewWriter(file)\n\tfor _, line := range lines {\n\t\tfmt.Fprintln(w, line)\n\t}\n\treturn w.Flush()\n}", "title": "" }, { "docid": "d0a6a60cbe473e465403495854b0a15e", "score": "0.4587432", "text": "func (c *ConfigParser) AddConfigPaths(cfgPaths ...string) {\n\tc.configPaths = append(c.configPaths, cfgPaths...)\n}", "title": "" }, { "docid": "ab403639315370143486d2a78cda01cc", "score": "0.4583559", "text": "func (s *Service) SetCertificateFilePath(path string) {\n\ts.cert = path\n}", "title": "" }, { "docid": "de05ccbc7fc7a27d3a6385c2b9efaad3", "score": "0.458125", "text": "func (b *Bundle) BasePaths() []string {\n\tpaths := []string{}\n\tfor p := range b.filesByBasepath {\n\t\tpaths = append(paths, p)\n\t}\n\treturn paths\n}", "title": "" } ]
eb6e7d254063eadb0252ac7a06198133
Deprecated: Use CsrfPolicy.ProtoReflect.Descriptor instead.
[ { "docid": "a3e4b6c0d5dc8fd15f1fbfb93a7db462", "score": "0.69610244", "text": "func (*CsrfPolicy) Descriptor() ([]byte, []int) {\n\treturn file_github_com_solo_io_gloo_projects_gloo_api_external_envoy_extensions_filters_http_csrf_v3_csrf_proto_rawDescGZIP(), []int{0}\n}", "title": "" } ]
[ { "docid": "13638c05b1cad4c1fcc81f947d877481", "score": "0.58435655", "text": "func (*ValidatePolicyRequest) Descriptor() ([]byte, []int) {\n\treturn file_proto_v1alpha1_rode_policy_proto_rawDescGZIP(), []int{5}\n}", "title": "" }, { "docid": "8e75fcf56c8d6b74444d272622e0fd09", "score": "0.5786464", "text": "func (*ValidateTokenRequest) Descriptor() ([]byte, []int) {\n\treturn file_permission_service_proto_rawDescGZIP(), []int{0}\n}", "title": "" }, { "docid": "4d3d241b837f6e572e1d201b763e4196", "score": "0.577358", "text": "func (*RefreshTokenRequest) Descriptor() ([]byte, []int) {\n\treturn file_proto_jwt_jwt_proto_rawDescGZIP(), []int{4}\n}", "title": "" }, { "docid": "8b18181fbc623746e0994df1a38abba2", "score": "0.56610924", "text": "func (*VerifyTokenRequest) Descriptor() ([]byte, []int) {\n\treturn file_proto_jwt_jwt_proto_rawDescGZIP(), []int{2}\n}", "title": "" }, { "docid": "073bf9cd490fd14e413fab86d9d78927", "score": "0.56145185", "text": "func (*SecureToken) Descriptor() ([]byte, []int) {\n\treturn file_types_proto_rawDescGZIP(), []int{4}\n}", "title": "" }, { "docid": "10fda31d4527b9fab712b58c91ca841b", "score": "0.5585852", "text": "func (*DomainClaimsCheckRequest) Descriptor() ([]byte, []int) {\n\treturn file_domain_domain_proto_rawDescGZIP(), []int{4}\n}", "title": "" }, { "docid": "f7b979cdadd72d359f066752c04a01de", "score": "0.5583806", "text": "func (*ValidateJWTRequest) Descriptor() ([]byte, []int) {\n\treturn file_userservice_proto_rawDescGZIP(), []int{13}\n}", "title": "" }, { "docid": "646fa0dceeac0d7f4924d05b8e9698a1", "score": "0.5563588", "text": "func (*RefreshTokenRequest) Descriptor() ([]byte, []int) {\n\treturn file_meeting_auth_proto_rawDescGZIP(), []int{4}\n}", "title": "" }, { "docid": "d77a05b14ccf6bfbc83ee8a4959ddd2e", "score": "0.55488485", "text": "func (*DeleteRuleReq) Descriptor() ([]byte, []int) {\n\treturn file_external_iam_v2_request_rules_proto_rawDescGZIP(), []int{5}\n}", "title": "" }, { "docid": "058fd1745ebfa7d31e1bd5bb1bc73a52", "score": "0.5545177", "text": "func (*RefreshTokenRequest) Descriptor() ([]byte, []int) {\n\treturn file_payeet_proto_rawDescGZIP(), []int{8}\n}", "title": "" }, { "docid": "97ca24b26acaf93f24217e6552befa08", "score": "0.55090725", "text": "func (*AlsoDoublySecureRequest) Descriptor() ([]byte, []int) {\n\treturn file_goadesign_goagen_secured_service_proto_rawDescGZIP(), []int{6}\n}", "title": "" }, { "docid": "337a79a3c308f3e408efe67a8c03eaec", "score": "0.5492414", "text": "func (*SecureRequest) Descriptor() ([]byte, []int) {\n\treturn file_goadesign_goagen_secured_service_proto_rawDescGZIP(), []int{2}\n}", "title": "" }, { "docid": "0cf0fdc43c5ff9059eb7a9bf68a079b6", "score": "0.546751", "text": "func (*DeletePolicyRequest) Descriptor() ([]byte, []int) {\n\treturn file_proto_v1alpha1_rode_policy_proto_rawDescGZIP(), []int{8}\n}", "title": "" }, { "docid": "af4d18a9cf918cdf52c32f7b20859aa5", "score": "0.5464682", "text": "func (*PrivacyRequest) Descriptor() ([]byte, []int) {\n\treturn file_privacy_proto_rawDescGZIP(), []int{5}\n}", "title": "" }, { "docid": "49867d1e2f8438175b98ba2bbedb1ac2", "score": "0.5459675", "text": "func (*DoublySecureRequest) Descriptor() ([]byte, []int) {\n\treturn file_goadesign_goagen_secured_service_proto_rawDescGZIP(), []int{4}\n}", "title": "" }, { "docid": "78d9513fda9ebc6f56a39be3d80cf7a8", "score": "0.5447338", "text": "func (*DeletePolicyRequest) Descriptor() ([]byte, []int) {\n\treturn file_pkg_policy_pb_request_proto_rawDescGZIP(), []int{3}\n}", "title": "" }, { "docid": "87ae2d57e6315c210ef346ae5a7fe216", "score": "0.54471153", "text": "func (*ValidateRequest) Descriptor() ([]byte, []int) {\n\treturn file_service_app_token_agent_cmd_grpcserver_proto_api_app_token_proto_rawDescGZIP(), []int{12}\n}", "title": "" }, { "docid": "0f02ff19b41b1ed835a5e72cdd1760d2", "score": "0.5434662", "text": "func (*AuthorizeTokenRequest) Descriptor() ([]byte, []int) {\n\treturn file_authorize_token_proto_rawDescGZIP(), []int{0}\n}", "title": "" }, { "docid": "c46fbeaf4342cb9d4796c32234d9a619", "score": "0.5418409", "text": "func (*TokenRequest) Descriptor() ([]byte, []int) {\n\treturn file_internal_tracker_tracker_proto_rawDescGZIP(), []int{0}\n}", "title": "" }, { "docid": "d3dc9827c18b618543d8c4ceb19722f8", "score": "0.5408239", "text": "func (*UpdatePolicyRequest) Descriptor() ([]byte, []int) {\n\treturn file_proto_v1alpha1_rode_policy_proto_rawDescGZIP(), []int{13}\n}", "title": "" }, { "docid": "62a32c00abf61df08419767a589ac860", "score": "0.53988636", "text": "func (*TokenRequest) Descriptor() ([]byte, []int) {\n\treturn file_thor_service_proto_rawDescGZIP(), []int{0}\n}", "title": "" }, { "docid": "5b1dd13af35a1fa61b70c416507c0cbf", "score": "0.53829134", "text": "func (*SecurityPolicy) Descriptor() ([]byte, []int) {\n\treturn file_ligato_vpp_ipsec_ipsec_proto_rawDescGZIP(), []int{1}\n}", "title": "" }, { "docid": "8213f13ab3d137c17fdbc706eee1fa02", "score": "0.53801423", "text": "func (*ApplyRulesCancelReq) Descriptor() ([]byte, []int) {\n\treturn file_external_iam_v2_request_rules_proto_rawDescGZIP(), []int{7}\n}", "title": "" }, { "docid": "673d0a271770202e1dae67d903c560ec", "score": "0.5379075", "text": "func (*ValidateTokenResponse) Descriptor() ([]byte, []int) {\n\treturn file_permission_service_proto_rawDescGZIP(), []int{1}\n}", "title": "" }, { "docid": "ea472e6b335c82fc7a57a2384563dad0", "score": "0.5375039", "text": "func (*SignaturePolicy) Descriptor() ([]byte, []int) {\n\treturn file_common_policies_proto_rawDescGZIP(), []int{2}\n}", "title": "" }, { "docid": "c31415bb06de35832f1875e074332a43", "score": "0.53640074", "text": "func (*AuthTokenRevokeRequest) Descriptor() ([]byte, []int) {\n\treturn file_kstash_proto_rawDescGZIP(), []int{10}\n}", "title": "" }, { "docid": "8727ae98e41e9e1b35ee712f33988651", "score": "0.5362448", "text": "func (*GetJWTTokenRequest) Descriptor() ([]byte, []int) {\n\treturn file_proto_users_proto_rawDescGZIP(), []int{12}\n}", "title": "" }, { "docid": "30d81b7bccf170c1766fd13aa4695df7", "score": "0.53507996", "text": "func (*RequestIdPrivacy) Descriptor() ([]byte, []int) {\n\treturn file_privacy_proto_rawDescGZIP(), []int{7}\n}", "title": "" }, { "docid": "61c72705295ff849726959a0d7473e58", "score": "0.5349538", "text": "func (*DeleteWebhookRequest) Descriptor() ([]byte, []int) {\n\treturn file_buf_alpha_registry_v1alpha1_webhook_proto_rawDescGZIP(), []int{2}\n}", "title": "" }, { "docid": "317bd7a1464492c6ad4583259730f380", "score": "0.53483284", "text": "func (*EvaluatePolicyViolation) Descriptor() ([]byte, []int) {\n\treturn file_proto_v1alpha1_rode_policy_proto_rawDescGZIP(), []int{3}\n}", "title": "" }, { "docid": "4333618930e6c8d9cdd6f22d61d5846e", "score": "0.53446776", "text": "func (*DeleteWebhookRequest) Descriptor() ([]byte, []int) {\n\treturn file_determined_api_v1_webhook_proto_rawDescGZIP(), []int{6}\n}", "title": "" }, { "docid": "7cf4a5e90daeb2c74f4dcd3dca61336e", "score": "0.5343878", "text": "func (*InValidateRequest) Descriptor() ([]byte, []int) {\n\treturn file_service_app_token_agent_cmd_grpcserver_proto_api_app_token_proto_rawDescGZIP(), []int{14}\n}", "title": "" }, { "docid": "1937e4ac4ce713bad706f71853ac5227", "score": "0.53353727", "text": "func (*EvaluatePolicyRequest) Descriptor() ([]byte, []int) {\n\treturn file_proto_v1alpha1_rode_policy_proto_rawDescGZIP(), []int{0}\n}", "title": "" }, { "docid": "5e79aedb2cfd3cf9a1ebe557ebecc7bd", "score": "0.53327626", "text": "func (*GetPolicyRequest) Descriptor() ([]byte, []int) {\n\treturn file_proto_v1alpha1_rode_policy_proto_rawDescGZIP(), []int{7}\n}", "title": "" }, { "docid": "3b7bfdf5685fd856a0894a9a2638d07b", "score": "0.5332252", "text": "func (*URLValidationRequest) Descriptor() ([]byte, []int) {\n\treturn file_interservice_notifications_service_rules_proto_rawDescGZIP(), []int{7}\n}", "title": "" }, { "docid": "849f7a40c520384065a0575add597f20", "score": "0.5329056", "text": "func (*AuthRoleRevokePermissionRequest) Descriptor() ([]byte, []int) {\n\treturn file_rpc_proto_rawDescGZIP(), []int{59}\n}", "title": "" }, { "docid": "cad7771ba83cff42e27f48c5923e8de6", "score": "0.53274816", "text": "func (*ValueSetDeprecated) Descriptor() ([]byte, []int) {\n\treturn file_proto_google_fhir_proto_r4_core_extensions_proto_rawDescGZIP(), []int{365}\n}", "title": "" }, { "docid": "3b33f9e845055b7b9c9368692c2bc93d", "score": "0.53108644", "text": "func (*CreatePrivacyRequest) Descriptor() ([]byte, []int) {\n\treturn file_privacy_proto_rawDescGZIP(), []int{2}\n}", "title": "" }, { "docid": "e2f83718f021bf3ae1ec61d87b4aabd8", "score": "0.53086793", "text": "func (*TokenRequest) Descriptor() ([]byte, []int) {\n\treturn file_server_proto_rawDescGZIP(), []int{0}\n}", "title": "" }, { "docid": "55cbc0aad96c14b37b91b4b62241ce1b", "score": "0.5307754", "text": "func (*FieldSecurityAnnotation) Descriptor() ([]byte, []int) {\n\treturn file_udpa_annotations_security_proto_rawDescGZIP(), []int{0}\n}", "title": "" }, { "docid": "a3c8548bec5ed4d4fc854d71919402ad", "score": "0.5307519", "text": "func (*Policy) Descriptor() ([]byte, []int) {\n\treturn file_proto_v1alpha1_rode_policy_proto_rawDescGZIP(), []int{14}\n}", "title": "" }, { "docid": "0a5fa89bde6390bd4e21f1c4879696c0", "score": "0.530368", "text": "func (*Request) Descriptor() ([]byte, []int) {\n\treturn file_getCaptcha_proto_rawDescGZIP(), []int{0}\n}", "title": "" }, { "docid": "b075e79af0377e0c7fbedfa80019cad3", "score": "0.5302117", "text": "func (*ValidatePolicyResponse) Descriptor() ([]byte, []int) {\n\treturn file_proto_v1alpha1_rode_policy_proto_rawDescGZIP(), []int{6}\n}", "title": "" }, { "docid": "e4047954dcf7a09f9fc6b10d17fdcc66", "score": "0.5294242", "text": "func (*SignCSRRequest) Descriptor() ([]byte, []int) {\n\treturn file_apis_kms_v1_messages_proto_rawDescGZIP(), []int{14}\n}", "title": "" }, { "docid": "c797fbfa7d33fc748a03392ded4dec88", "score": "0.52902424", "text": "func (*DeleteBearerRequest) Descriptor() ([]byte, []int) {\n\treturn file_lte_protos_spgw_service_proto_rawDescGZIP(), []int{2}\n}", "title": "" }, { "docid": "7f9b92267d2c09cc570f8956116b0c23", "score": "0.5283262", "text": "func (*RevokeStorageClassClaimRequest) Descriptor() ([]byte, []int) {\n\treturn file_provider_proto_rawDescGZIP(), []int{13}\n}", "title": "" }, { "docid": "64f9703e5514ef774a03dc3f0fe0d96a", "score": "0.5282637", "text": "func (*ValueSetDeprecated) Descriptor() ([]byte, []int) {\n\treturn file_proto_google_fhir_proto_r5_core_extensions_proto_rawDescGZIP(), []int{385}\n}", "title": "" }, { "docid": "2ae4783cd5ba50d76d42d3b25bd85351", "score": "0.52764994", "text": "func (*SmscdRequest) Descriptor() ([]byte, []int) {\n\treturn file_getCaptcha_proto_rawDescGZIP(), []int{2}\n}", "title": "" }, { "docid": "49b5a04be7e5fc78508e8af61a074490", "score": "0.5274539", "text": "func (*UpdateRuleReq) Descriptor() ([]byte, []int) {\n\treturn file_external_iam_v2_request_rules_proto_rawDescGZIP(), []int{1}\n}", "title": "" }, { "docid": "27fc51788c657bbb0295620bb593792b", "score": "0.52685", "text": "func (*ValidateTrustRequest) Descriptor() ([]byte, []int) {\n\treturn file_google_cloud_managedidentities_v1_managed_identities_service_proto_rawDescGZIP(), []int{12}\n}", "title": "" }, { "docid": "007c725bb7c468c62143cd3d627e048b", "score": "0.5258244", "text": "func (*ValidationRequestMessage) Descriptor() ([]byte, []int) {\n\treturn file_go_chromium_org_luci_common_proto_config_service_config_proto_rawDescGZIP(), []int{13}\n}", "title": "" }, { "docid": "007c725bb7c468c62143cd3d627e048b", "score": "0.5258244", "text": "func (*ValidationRequestMessage) Descriptor() ([]byte, []int) {\n\treturn file_go_chromium_org_luci_common_proto_config_service_config_proto_rawDescGZIP(), []int{13}\n}", "title": "" }, { "docid": "f7abc514c6d769d85b9af44adf0ed542", "score": "0.5252102", "text": "func (*CreateTokenRequest) Descriptor() ([]byte, []int) {\n\treturn file_api_proto_rawDescGZIP(), []int{5}\n}", "title": "" }, { "docid": "b2b8ed155ceb2b0e4a123456f906b969", "score": "0.52468985", "text": "func (*DescribePolicyRequest) Descriptor() ([]byte, []int) {\n\treturn file_pkg_policy_pb_request_proto_rawDescGZIP(), []int{2}\n}", "title": "" }, { "docid": "026f3743ff6c065419bc1facf382c625", "score": "0.524087", "text": "func (*RequestSigVerified) Descriptor() ([]byte, []int) {\n\treturn file_eventpb_eventpb_proto_rawDescGZIP(), []int{14}\n}", "title": "" }, { "docid": "978375590872c011a0fb9a03e6ac3bda", "score": "0.5239887", "text": "func (x *fastReflection_ValidatorSigner) Descriptor() protoreflect.MessageDescriptor {\n\treturn md_ValidatorSigner\n}", "title": "" }, { "docid": "82bd0a232dc84951b6a3386719c3d406", "score": "0.5232867", "text": "func (*ResetAuthorizationCodeRequest) Descriptor() ([]byte, []int) {\n\treturn file_google_cloud_domains_v1beta1_domains_proto_rawDescGZIP(), []int{22}\n}", "title": "" }, { "docid": "ab10bb798c3186a0e3e00cb963b7e40e", "score": "0.52290183", "text": "func (*CreatePolicyRequest) Descriptor() ([]byte, []int) {\n\treturn file_pkg_policy_pb_request_proto_rawDescGZIP(), []int{0}\n}", "title": "" }, { "docid": "deb02bc826a7977b4a4e698ca7f3b452", "score": "0.5218813", "text": "func (*CreateRuleReq) Descriptor() ([]byte, []int) {\n\treturn file_external_iam_v2_request_rules_proto_rawDescGZIP(), []int{0}\n}", "title": "" }, { "docid": "0d1f35d9f30e5fd161c25b757af4a8a7", "score": "0.5215745", "text": "func decodeGRPCRemoveFilteredPolicyRequest(_ context.Context, grpcReq interface{}) (interface{}, error) {\n\treq := grpcReq.(*pb.FilteredPolicyRequest)\n\treturn endpoints.RemoveFilteredPolicyRequest{Enforcer: req.Enforcer, FieldIndex: int(req.FieldIndex), FieldValues: req.FieldValues}, nil\n}", "title": "" }, { "docid": "1f1d9211659261db061970babd2a149a", "score": "0.520611", "text": "func (*CancellationPolicy) Descriptor() ([]byte, []int) {\n\treturn file_v1_proto_rawDescGZIP(), []int{7}\n}", "title": "" }, { "docid": "3d4c3963b52a2198c6ae3e60af15276d", "score": "0.5203605", "text": "func (*DeletePolicyAssignmentRequest) Descriptor() ([]byte, []int) {\n\treturn file_proto_v1alpha1_rode_policy_proto_rawDescGZIP(), []int{23}\n}", "title": "" }, { "docid": "a75fdfc9c2a8d070f8bfd21f84027027", "score": "0.51948583", "text": "func (*Policy) Descriptor() ([]byte, []int) {\n\treturn file_cerbos_policy_v1_policy_proto_rawDescGZIP(), []int{0}\n}", "title": "" }, { "docid": "14443b8dea993ca1182fe2284154d42e", "score": "0.5183921", "text": "func (*DeleteLifecyclePolicyRequest) Descriptor() ([]byte, []int) {\n\treturn file_yandex_cloud_containerregistry_v1_lifecycle_policy_service_proto_rawDescGZIP(), []int{5}\n}", "title": "" }, { "docid": "e54fbca614a7d09dd6669927a64cd571", "score": "0.51815975", "text": "func (*ExpireSliceRequest) Descriptor() ([]byte, []int) {\n\treturn file_go_chromium_org_luci_swarming_proto_internals_rbe_proto_rawDescGZIP(), []int{7}\n}", "title": "" }, { "docid": "b011066a403c93e45cacfd90d32c3a0f", "score": "0.5181343", "text": "func (*TokensRequest) Descriptor() ([]byte, []int) {\n\treturn file_client_proto_rawDescGZIP(), []int{16}\n}", "title": "" }, { "docid": "741bc624efb59515ba14f4c125892d99", "score": "0.51769114", "text": "func (*CreateTokensRequest) Descriptor() ([]byte, []int) {\n\treturn file_proto_jwt_jwt_proto_rawDescGZIP(), []int{0}\n}", "title": "" }, { "docid": "9f0daa2c3e9f73e0199bcf92459d48cc", "score": "0.5175582", "text": "func (*GetRuleReq) Descriptor() ([]byte, []int) {\n\treturn file_external_iam_v2_request_rules_proto_rawDescGZIP(), []int{2}\n}", "title": "" }, { "docid": "d420e99e258559252b76f76cecefa4a1", "score": "0.5173036", "text": "func (*VerifyRequestSig) Descriptor() ([]byte, []int) {\n\treturn file_eventpb_eventpb_proto_rawDescGZIP(), []int{13}\n}", "title": "" }, { "docid": "d0fd8aa9d80431a32bf2ba271ac316d8", "score": "0.5168108", "text": "func (*ScheduleVersionDestructionRequest) Descriptor() ([]byte, []int) {\n\treturn file_yandex_cloud_lockbox_v1_secret_service_proto_rawDescGZIP(), []int{18}\n}", "title": "" }, { "docid": "b8f2aa3a00c4ccc7076178156834075c", "score": "0.51563036", "text": "func (*SetupPolicyRequest) Descriptor() ([]byte, []int) {\n\treturn file_lte_protos_pipelined_proto_rawDescGZIP(), []int{3}\n}", "title": "" }, { "docid": "c3dfdd02946281eae2f997355048c045", "score": "0.51557505", "text": "func (*SetTrustedKeysRequest) Descriptor() ([]byte, []int) {\n\treturn file_spacex_api_device_device_proto_rawDescGZIP(), []int{21}\n}", "title": "" }, { "docid": "d38fdd7bdf35b15cdbd30d872c807897", "score": "0.5154316", "text": "func (*DomainTrademarkCheckRequest) Descriptor() ([]byte, []int) {\n\treturn file_domain_domain_proto_rawDescGZIP(), []int{5}\n}", "title": "" }, { "docid": "1a50778a9bb2f091a7a4ea4eab068204", "score": "0.5150705", "text": "func (*PermissionChange_Removed) Descriptor() ([]byte, []int) {\n\treturn edgelq_iam_proto_v1alpha_permission_change_proto_rawDescGZIP(), []int{0, 3}\n}", "title": "" }, { "docid": "d9ed428bcfe3e0f30272354ad56b5ae8", "score": "0.51483786", "text": "func (*AppTokenValidateRequest) Descriptor() ([]byte, []int) {\n\treturn file_yandex_cloud_datasphere_v1_app_token_service_proto_rawDescGZIP(), []int{0}\n}", "title": "" }, { "docid": "0e1954b04fcbabf798df4657c3756ea7", "score": "0.5145864", "text": "func (*NewRequest_Credentials) Descriptor() ([]byte, []int) {\n\treturn file_chrome_service_proto_rawDescGZIP(), []int{0, 0}\n}", "title": "" }, { "docid": "b31421846c4a5c4c974a0910162c8df9", "score": "0.5145804", "text": "func (*MakePassTokenReq) Descriptor() ([]byte, []int) {\n\treturn file_proto_room_room_proto_rawDescGZIP(), []int{15}\n}", "title": "" }, { "docid": "b3597f794c17d9f4af63d143361ebc3b", "score": "0.5142718", "text": "func (*CreateTokenRequest) Descriptor() ([]byte, []int) {\n\treturn file_userauthn_userauthnpb_userauthnservice_proto_rawDescGZIP(), []int{2}\n}", "title": "" }, { "docid": "1b22bff684d01a6843c70bf728f02ae2", "score": "0.51413655", "text": "func (*RemoveControlRequest) Descriptor() ([]byte, []int) {\n\treturn file_google_cloud_retail_v2_serving_config_service_proto_rawDescGZIP(), []int{7}\n}", "title": "" }, { "docid": "e71953a364725c75381e1953dc988c78", "score": "0.51409113", "text": "func (*AccessTokenRequest) Descriptor() ([]byte, []int) {\n\treturn file_proto_jwt_jwt_proto_rawDescGZIP(), []int{5}\n}", "title": "" }, { "docid": "ee09bbe3e750845d01863161a1a89de0", "score": "0.5140892", "text": "func decodeGRPCGetFilteredPolicyRequest(_ context.Context, grpcReq interface{}) (interface{}, error) {\n\treq := grpcReq.(*pb.FilteredPolicyRequest)\n\treturn endpoints.GetFilteredPolicyRequest{Enforcer: req.Enforcer, FieldIndex: int(req.FieldIndex), FieldValues: req.FieldValues}, nil\n}", "title": "" }, { "docid": "c1bae1ad2e860ca16fdf1f91cb7b3447", "score": "0.51388013", "text": "func (*VerifyTokenResponse) Descriptor() ([]byte, []int) {\n\treturn file_proto_jwt_jwt_proto_rawDescGZIP(), []int{3}\n}", "title": "" }, { "docid": "a1a5ff38da224d99971cdfd0973597cb", "score": "0.5135951", "text": "func decodeGRPCRemoveFilteredNamedPolicyRequest(_ context.Context, grpcReq interface{}) (interface{}, error) {\n\treq := grpcReq.(*pb.FilteredPolicyRequest)\n\treturn endpoints.RemoveFilteredNamedPolicyRequest{Enforcer: req.Enforcer, PType: req.PType, FieldIndex: int(req.FieldIndex), FieldValues: req.FieldValues}, nil\n}", "title": "" }, { "docid": "95d66bd719782e43046b93dfb77e9bf9", "score": "0.51348346", "text": "func (*CIMAuthTokenReq) Descriptor() ([]byte, []int) {\n\treturn file_CIM_Login_proto_rawDescGZIP(), []int{0}\n}", "title": "" }, { "docid": "695a02e20732b14035380b6018ad4d63", "score": "0.51310796", "text": "func (*DeletePolicyGroupRequest) Descriptor() ([]byte, []int) {\n\treturn file_proto_v1alpha1_rode_policy_proto_rawDescGZIP(), []int{18}\n}", "title": "" }, { "docid": "00a89aa9cdd52d7939dfa9af3d70a2ae", "score": "0.5130507", "text": "func (*GetWithoutCallbackLimitRiskControlReq) Descriptor() ([]byte, []int) {\n\treturn file_ams_ams_risk_control_proto_rawDescGZIP(), []int{6}\n}", "title": "" }, { "docid": "b4ee3509b564461a0348dc37e0107ef2", "score": "0.5126818", "text": "func (*DeleteRegistrationRequest) Descriptor() ([]byte, []int) {\n\treturn file_google_cloud_domains_v1beta1_domains_proto_rawDescGZIP(), []int{20}\n}", "title": "" }, { "docid": "6f25dade2d8c1a247de3431b8289c9cc", "score": "0.5126069", "text": "func (*Validator) Descriptor() ([]byte, []int) {\n\treturn file_go_chromium_org_luci_common_proto_config_service_config_proto_rawDescGZIP(), []int{12}\n}", "title": "" }, { "docid": "6f25dade2d8c1a247de3431b8289c9cc", "score": "0.5126069", "text": "func (*Validator) Descriptor() ([]byte, []int) {\n\treturn file_go_chromium_org_luci_common_proto_config_service_config_proto_rawDescGZIP(), []int{12}\n}", "title": "" }, { "docid": "d8c2984ee56d5e33fb6e6000a8847d8c", "score": "0.5123578", "text": "func (*ConstraintViolation) Descriptor() ([]byte, []int) {\n\treturn file_validation_proto_rawDescGZIP(), []int{0}\n}", "title": "" }, { "docid": "f03005bff61cbb9eb6d846fb76bd557b", "score": "0.5122466", "text": "func (*Policy) Descriptor() ([]byte, []int) {\n\treturn file_common_policies_proto_rawDescGZIP(), []int{0}\n}", "title": "" }, { "docid": "2efa8da4b1fa6f87d08f44f832f72170", "score": "0.5120113", "text": "func (*CancelVersionDestructionRequest) Descriptor() ([]byte, []int) {\n\treturn file_yandex_cloud_lockbox_v1_secret_service_proto_rawDescGZIP(), []int{20}\n}", "title": "" }, { "docid": "c32355fd9b84091d8a9ef6706681feed", "score": "0.51191074", "text": "func (*UpdateProvisioningPolicyRequest_CAS) Descriptor() ([]byte, []int) {\n\treturn edgelq_devices_proto_v1alpha_provisioning_policy_service_proto_rawDescGZIP(), []int{10, 0}\n}", "title": "" }, { "docid": "2ae28b2165d74a6a4d49c7175b33e5aa", "score": "0.5116115", "text": "func (*DeleteProvisioningPolicyRequest) Descriptor() ([]byte, []int) {\n\treturn edgelq_devices_proto_v1alpha_provisioning_policy_service_proto_rawDescGZIP(), []int{11}\n}", "title": "" }, { "docid": "e2f26a43c651c1b4c5491ff966b65c66", "score": "0.5115132", "text": "func (*DeleteRegistrationRequest) Descriptor() ([]byte, []int) {\n\treturn file_isuxportal_services_registration_session_proto_rawDescGZIP(), []int{4}\n}", "title": "" }, { "docid": "6164c7ab856b9698ad5cd97d34d498f7", "score": "0.51071006", "text": "func (*RemovePermissionRequest) Descriptor() ([]byte, []int) {\n\treturn file_systera_proto_rawDescGZIP(), []int{49}\n}", "title": "" }, { "docid": "6d607760aac1083219019f065023ce39", "score": "0.5106411", "text": "func (*RegenerateDomainKeyRequest) Descriptor() ([]byte, []int) {\n\treturn file_proto_api_proto_rawDescGZIP(), []int{3}\n}", "title": "" }, { "docid": "2dd090505e6e666537f57428b6e9537f", "score": "0.51040375", "text": "func (*EmptyRequestPrivacy) Descriptor() ([]byte, []int) {\n\treturn file_privacy_proto_rawDescGZIP(), []int{9}\n}", "title": "" }, { "docid": "93964c6f8763f546c81ea99fc90e7ad8", "score": "0.51008874", "text": "func (*PolicyInfo) Descriptor() ([]byte, []int) {\n\treturn file_external_annotations_iam_policy_proto_rawDescGZIP(), []int{0}\n}", "title": "" }, { "docid": "6e6f3342fff7e08cc52854e1783c93fc", "score": "0.5100056", "text": "func (*ExtensionRequest) Descriptor() ([]byte, []int) {\n\treturn file_grpc_reflection_v1alpha_reflection_proto_rawDescGZIP(), []int{1}\n}", "title": "" } ]
b21c4cb12bee8c645f5dda1954c44207
DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object.
[ { "docid": "68cdaf66636800b89623b109f32a4902", "score": "0.0", "text": "func (in *Issuer) DeepCopyObject() runtime.Object {\n\tif c := in.DeepCopy(); c != nil {\n\t\treturn c\n\t}\n\treturn nil\n}", "title": "" } ]
[ { "docid": "ec0312c6393fc2c1fe2ffe9da0a65f72", "score": "0.7256851", "text": "func (in *KameletBinding) DeepCopyObject() runtime.Object {\n\tif c := in.DeepCopy(); c != nil {\n\t\treturn c\n\t}\n\treturn nil\n}", "title": "" }, { "docid": "a7f29d8f4aac1ae3e3632a24f43cc728", "score": "0.7102634", "text": "func (in *denier) DeepCopyObject() runtime.Object {\n\tif c := in.DeepCopy(); c != nil {\n\t\treturn c\n\t}\n\n\treturn nil\n}", "title": "" }, { "docid": "8bea899071433eee30c261819694a176", "score": "0.709809", "text": "func (in *Console) DeepCopyObject() runtime.Object {\n\tif c := in.DeepCopy(); c != nil {\n\t\treturn c\n\t}\n\treturn nil\n}", "title": "" }, { "docid": "8bea899071433eee30c261819694a176", "score": "0.709809", "text": "func (in *Console) DeepCopyObject() runtime.Object {\n\tif c := in.DeepCopy(); c != nil {\n\t\treturn c\n\t}\n\treturn nil\n}", "title": "" }, { "docid": "af539fa8d6c27fbcded493dff9d265e1", "score": "0.7072484", "text": "func (m *Managed) DeepCopyObject() runtime.Object {\n\tout := &Managed{}\n\tj, err := json.Marshal(m)\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\t_ = json.Unmarshal(j, out)\n\treturn out\n}", "title": "" }, { "docid": "21cbfd2584e847f4087af6094895c42c", "score": "0.7067021", "text": "func (in *Binding) DeepCopyObject() runtime.Object {\n\tif c := in.DeepCopy(); c != nil {\n\t\treturn c\n\t}\n\treturn nil\n}", "title": "" }, { "docid": "27ee10212391e99ce7aae661d76774d0", "score": "0.70068747", "text": "func (in *Kamelet) DeepCopyObject() runtime.Object {\n\tif c := in.DeepCopy(); c != nil {\n\t\treturn c\n\t}\n\treturn nil\n}", "title": "" }, { "docid": "27ee10212391e99ce7aae661d76774d0", "score": "0.70068747", "text": "func (in *Kamelet) DeepCopyObject() runtime.Object {\n\tif c := in.DeepCopy(); c != nil {\n\t\treturn c\n\t}\n\treturn nil\n}", "title": "" }, { "docid": "6cb1131c00623f1328682cb6c70927fb", "score": "0.69915617", "text": "func (h HelmRes) DeepCopyObject() runtime.Object {\n\treturn h\n}", "title": "" }, { "docid": "9adad2433549cf25a32a8ea99adf2f0a", "score": "0.698485", "text": "func (in *L2CRun) DeepCopyObject() runtime.Object {\n\tif c := in.DeepCopy(); c != nil {\n\t\treturn c\n\t}\n\treturn nil\n}", "title": "" }, { "docid": "a1d4c6527b916e54ba0777a054d7629a", "score": "0.6968264", "text": "func (in *Extension) DeepCopyObject() runtime.Object {\n\tif c := in.DeepCopy(); c != nil {\n\t\treturn c\n\t}\n\treturn nil\n}", "title": "" }, { "docid": "5a2342c7e82cea1548658ae246d5921f", "score": "0.6964475", "text": "func (in *Underthedome) DeepCopyObject() runtime.Object {\n\tif c := in.DeepCopy(); c != nil {\n\t\treturn c\n\t}\n\treturn nil\n}", "title": "" }, { "docid": "c05ada3674d7b22522c0a60a878d6711", "score": "0.6953901", "text": "func (in *KameletBindingList) DeepCopyObject() runtime.Object {\n\tif c := in.DeepCopy(); c != nil {\n\t\treturn c\n\t}\n\treturn nil\n}", "title": "" }, { "docid": "0b9e0281df1782e3f0c6c9fdd803674d", "score": "0.69536334", "text": "func (in *fluentd) DeepCopyObject() runtime.Object {\n\tif c := in.DeepCopy(); c != nil {\n\t\treturn c\n\t}\n\n\treturn nil\n}", "title": "" }, { "docid": "8f0dc49a4cba14c2b12a3fdc4b382c81", "score": "0.6949782", "text": "func (in *InferenceService) DeepCopyObject() runtime.Object {\n\tif c := in.DeepCopy(); c != nil {\n\t\treturn c\n\t}\n\treturn nil\n}", "title": "" }, { "docid": "2edc16f30f0a7e90ae4feb4002b91259", "score": "0.6947026", "text": "func (m *Target) DeepCopyObject() runtime.Object {\n\tout := &Target{}\n\tj, err := json.Marshal(m)\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\t_ = json.Unmarshal(j, out)\n\treturn out\n}", "title": "" }, { "docid": "2532a0fc2b3f337dcaf07b387fa6d090", "score": "0.69384223", "text": "func (in *VPCLink) DeepCopyObject() runtime.Object {\n\tif c := in.DeepCopy(); c != nil {\n\t\treturn c\n\t}\n\treturn nil\n}", "title": "" }, { "docid": "7d8dd4120b5d118c43c5fde06cb0d640", "score": "0.6936584", "text": "func (in *Runner) DeepCopyObject() runtime.Object {\n\tif c := in.DeepCopy(); c != nil {\n\t\treturn c\n\t}\n\treturn nil\n}", "title": "" }, { "docid": "4a33b60661873629d815a1609725228b", "score": "0.6927391", "text": "func (in *MobileDeveloperConsole) DeepCopyObject() runtime.Object {\n\tif c := in.DeepCopy(); c != nil {\n\t\treturn c\n\t}\n\treturn nil\n}", "title": "" }, { "docid": "a4d42f7d8e9c1877994b821acdf47574", "score": "0.6894665", "text": "func (in *BundleBinding) DeepCopyObject() runtime.Object {\n\tif c := in.DeepCopy(); c != nil {\n\t\treturn c\n\t}\n\treturn nil\n}", "title": "" }, { "docid": "5e7ee69df6bdc2e1188b91b72425e7db", "score": "0.68922085", "text": "func (in *JointInferenceService) DeepCopyObject() runtime.Object {\n\tif c := in.DeepCopy(); c != nil {\n\t\treturn c\n\t}\n\treturn nil\n}", "title": "" }, { "docid": "b1ef561a8a602cdcafa8754c294d68d8", "score": "0.68848306", "text": "func (in *RelayCore) DeepCopyObject() runtime.Object {\n\tif c := in.DeepCopy(); c != nil {\n\t\treturn c\n\t}\n\treturn nil\n}", "title": "" }, { "docid": "336ab76d8cd618ef49515f49dbb88277", "score": "0.68833905", "text": "func (in *Dataplane) DeepCopyObject() runtime.Object {\n\tif c := in.DeepCopy(); c != nil {\n\t\treturn c\n\t}\n\treturn nil\n}", "title": "" }, { "docid": "cf3283b9ab2cedfcbf775744cddff516", "score": "0.688194", "text": "func (in *BuildPack) DeepCopyObject() runtime.Object {\n\tif c := in.DeepCopy(); c != nil {\n\t\treturn c\n\t}\n\treturn nil\n}", "title": "" }, { "docid": "906af924710dad4249ffaaa42e94562f", "score": "0.6881793", "text": "func (in *JavaAgent) DeepCopyObject() runtime.Object {\n\tif c := in.DeepCopy(); c != nil {\n\t\treturn c\n\t}\n\treturn nil\n}", "title": "" }, { "docid": "8b96a45606e9942c2523c3e0433186ac", "score": "0.68811864", "text": "func (in *QuayRegistry) DeepCopyObject() runtime.Object {\n\tif c := in.DeepCopy(); c != nil {\n\t\treturn c\n\t}\n\treturn nil\n}", "title": "" }, { "docid": "a88624402d2024c18059072a85735b4d", "score": "0.6871446", "text": "func (in *Common) DeepCopyObject() runtime.Object {\n\tif c := in.DeepCopy(); c != nil {\n\t\treturn c\n\t}\n\treturn nil\n}", "title": "" }, { "docid": "699f0069b953e871b4a09e2992ac26c0", "score": "0.68653595", "text": "func (in *Launcher) DeepCopyObject() runtime.Object {\n\tif c := in.DeepCopy(); c != nil {\n\t\treturn c\n\t}\n\treturn nil\n}", "title": "" }, { "docid": "5735f86d576a39ee2ea96ed92fba38e1", "score": "0.6854898", "text": "func (in *ConsoleList) DeepCopyObject() runtime.Object {\n\tif c := in.DeepCopy(); c != nil {\n\t\treturn c\n\t}\n\treturn nil\n}", "title": "" }, { "docid": "5735f86d576a39ee2ea96ed92fba38e1", "score": "0.6854898", "text": "func (in *ConsoleList) DeepCopyObject() runtime.Object {\n\tif c := in.DeepCopy(); c != nil {\n\t\treturn c\n\t}\n\treturn nil\n}", "title": "" }, { "docid": "f90539d4ea1a40df391bb4d9eb14b3cc", "score": "0.6850879", "text": "func (in *HelmChartInstall) DeepCopyObject() runtime.Object {\n\tif c := in.DeepCopy(); c != nil {\n\t\treturn c\n\t}\n\treturn nil\n}", "title": "" }, { "docid": "8930b1fdd2549ccb6fc862dbe87945f2", "score": "0.6845263", "text": "func (in *Receiver) DeepCopyObject() runtime.Object {\n\tif c := in.DeepCopy(); c != nil {\n\t\treturn c\n\t}\n\treturn nil\n}", "title": "" }, { "docid": "a8d33dd81dacf295edab61cd250b1c62", "score": "0.68439615", "text": "func (in *Meven) DeepCopyObject() runtime.Object {\n\tif c := in.DeepCopy(); c != nil {\n\t\treturn c\n\t}\n\treturn nil\n}", "title": "" }, { "docid": "97745bb095a88dcdc4e423dd6fd37074", "score": "0.6842961", "text": "func ObjDeepCopy(src interface{}) *XPDeepCPImpl {\n\treturn DeepCopy(src)\n}", "title": "" }, { "docid": "6c5bc76a65e2ae38d6a7bfd459a6a652", "score": "0.6835026", "text": "func (s *Stack) DeepCopyObject() runtime.Object {\n\treturn s.clone()\n}", "title": "" }, { "docid": "ece655b7be66e422716b0facc811d19a", "score": "0.68300694", "text": "func (in *denierList) DeepCopyObject() runtime.Object {\n\tif c := in.DeepCopy(); c != nil {\n\t\treturn c\n\t}\n\n\treturn nil\n}", "title": "" }, { "docid": "b40d62941763c1d416e9d31ab26c911f", "score": "0.6828011", "text": "func (in *Redis) DeepCopyObject() runtime.Object {\n\tif c := in.DeepCopy(); c != nil {\n\t\treturn c\n\t}\n\treturn nil\n}", "title": "" }, { "docid": "662cc69dc31cab4e7bde2e440db71c6a", "score": "0.6821241", "text": "func (in *ServiceBinding) DeepCopyObject() runtime.Object {\n\tif c := in.DeepCopy(); c != nil {\n\t\treturn c\n\t}\n\treturn nil\n}", "title": "" }, { "docid": "83056bd8e9f4acbc13e40da079d9c12b", "score": "0.68178403", "text": "func (in *IMInstall) DeepCopyObject() runtime.Object {\n\tif c := in.DeepCopy(); c != nil {\n\t\treturn c\n\t}\n\treturn nil\n}", "title": "" }, { "docid": "46ed08d1706c881f3c52fb0289ad675d", "score": "0.68129396", "text": "func (in *Csrx) DeepCopyObject() runtime.Object {\n\tif c := in.DeepCopy(); c != nil {\n\t\treturn c\n\t}\n\treturn nil\n}", "title": "" }, { "docid": "4822180f22fb1a0b0bbf11b54663340e", "score": "0.68026567", "text": "func (in *RhpamDev) DeepCopyObject() runtime.Object {\n\tif c := in.DeepCopy(); c != nil {\n\t\treturn c\n\t}\n\treturn nil\n}", "title": "" }, { "docid": "2c44c89b03d7f128cfa1b6b4f402e11b", "score": "0.6799742", "text": "func (in *Wildfly) DeepCopyObject() runtime.Object {\n\tif c := in.DeepCopy(); c != nil {\n\t\treturn c\n\t}\n\treturn nil\n}", "title": "" }, { "docid": "2428276fd929db0a4c8d3b1ee6fcd2b7", "score": "0.67979896", "text": "func (in *Result) DeepCopyObject() runtime.Object {\n\tif c := in.DeepCopy(); c != nil {\n\t\treturn c\n\t}\n\treturn nil\n}", "title": "" }, { "docid": "0f936adf1444bb69e5d47891f6949824", "score": "0.6794504", "text": "func (in *KeyRing) DeepCopyObject() runtime.Object {\n\tif c := in.DeepCopy(); c != nil {\n\t\treturn c\n\t}\n\treturn nil\n}", "title": "" }, { "docid": "e15fd2bccc6af929b6998c7e477e5067", "score": "0.6791864", "text": "func (in *CommonWebUI) DeepCopyObject() runtime.Object {\n\tif c := in.DeepCopy(); c != nil {\n\t\treturn c\n\t}\n\treturn nil\n}", "title": "" }, { "docid": "e15fd2bccc6af929b6998c7e477e5067", "score": "0.6790521", "text": "func (in *CommonWebUI) DeepCopyObject() runtime.Object {\n\tif c := in.DeepCopy(); c != nil {\n\t\treturn c\n\t}\n\treturn nil\n}", "title": "" }, { "docid": "e8d3edbc4aafe3a0e94ec1c46a354361", "score": "0.67896837", "text": "func (in *ExtensionList) DeepCopyObject() runtime.Object {\n\tif c := in.DeepCopy(); c != nil {\n\t\treturn c\n\t}\n\treturn nil\n}", "title": "" }, { "docid": "6bba529c437c45cfe4a96f73a11f136a", "score": "0.6788551", "text": "func (in *Proxy) DeepCopyObject() runtime.Object {\n\tif c := in.DeepCopy(); c != nil {\n\t\treturn c\n\t}\n\treturn nil\n}", "title": "" }, { "docid": "3b3b9ea2bcdf7e9e1d9cfe1e83aad516", "score": "0.678376", "text": "func (in *ServiceMeshExtension) DeepCopyObject() runtime.Object {\n\tif c := in.DeepCopy(); c != nil {\n\t\treturn c\n\t}\n\treturn nil\n}", "title": "" }, { "docid": "d6900073bb9dba10f25779b0e5033099", "score": "0.6783188", "text": "func (in *DexClient) DeepCopyObject() runtime.Object {\n\tif c := in.DeepCopy(); c != nil {\n\t\treturn c\n\t}\n\treturn nil\n}", "title": "" }, { "docid": "d75c69a3d991687c08e1f9e6097d0d5f", "score": "0.6782172", "text": "func (in *NiceService) DeepCopyObject() runtime.Object {\n\tif c := in.DeepCopy(); c != nil {\n\t\treturn c\n\t}\n\treturn nil\n}", "title": "" }, { "docid": "5ec7b32fb0bcb59b2e6207ec0052ef19", "score": "0.6781977", "text": "func (in *ChaosMonkey) DeepCopyObject() runtime.Object {\n\tif c := in.DeepCopy(); c != nil {\n\t\treturn c\n\t}\n\treturn nil\n}", "title": "" }, { "docid": "fa377ac23eca5e7316b38cf15a7d7d0d", "score": "0.6778088", "text": "func (in *fluentdList) DeepCopyObject() runtime.Object {\n\tif c := in.DeepCopy(); c != nil {\n\t\treturn c\n\t}\n\n\treturn nil\n}", "title": "" }, { "docid": "25a155b2a12099e23ed2847a7c8cff50", "score": "0.67779684", "text": "func (in *Addon) DeepCopyObject() runtime.Object {\n\tif c := in.DeepCopy(); c != nil {\n\t\treturn c\n\t}\n\treturn nil\n}", "title": "" }, { "docid": "25a155b2a12099e23ed2847a7c8cff50", "score": "0.67779684", "text": "func (in *Addon) DeepCopyObject() runtime.Object {\n\tif c := in.DeepCopy(); c != nil {\n\t\treturn c\n\t}\n\treturn nil\n}", "title": "" }, { "docid": "800a4088214846a0dd1fe2285a5be0a7", "score": "0.6776353", "text": "func (in *DAQApplicationList) DeepCopyObject() runtime.Object {\n\tif c := in.DeepCopy(); c != nil {\n\t\treturn c\n\t}\n\treturn nil\n}", "title": "" }, { "docid": "6240d51615118fbc2cfe474515d0c520", "score": "0.67725474", "text": "func (in *kubernetesenv) DeepCopyObject() runtime.Object {\n\tif c := in.DeepCopy(); c != nil {\n\t\treturn c\n\t}\n\n\treturn nil\n}", "title": "" }, { "docid": "b0afdd2d9be69d6d612fd6a4c62b4229", "score": "0.6771972", "text": "func (in *MyCRD) DeepCopyObject() runtime.Object {\n\tif c := in.DeepCopy(); c != nil {\n\t\treturn c\n\t}\n\treturn nil\n}", "title": "" }, { "docid": "1eb80a8539b35674f9c203120e467032", "score": "0.67687416", "text": "func (in *Idler) DeepCopyObject() runtime.Object {\n\tif c := in.DeepCopy(); c != nil {\n\t\treturn c\n\t} else {\n\t\treturn nil\n\t}\n}", "title": "" }, { "docid": "5884cf4be95f33abeb1548f45b0d68ae", "score": "0.6768069", "text": "func (in *VirtualService) DeepCopyObject() runtime.Object {\n\tif c := in.DeepCopy(); c != nil {\n\t\treturn c\n\t}\n\treturn nil\n}", "title": "" }, { "docid": "5884cf4be95f33abeb1548f45b0d68ae", "score": "0.6768069", "text": "func (in *VirtualService) DeepCopyObject() runtime.Object {\n\tif c := in.DeepCopy(); c != nil {\n\t\treturn c\n\t}\n\treturn nil\n}", "title": "" }, { "docid": "2a65e77991955609b9017a0a0cda3b5b", "score": "0.6766524", "text": "func (in *listentry) DeepCopyObject() runtime.Object {\n\tif c := in.DeepCopy(); c != nil {\n\t\treturn c\n\t}\n\n\treturn nil\n}", "title": "" }, { "docid": "2a65e77991955609b9017a0a0cda3b5b", "score": "0.6766524", "text": "func (in *listentry) DeepCopyObject() runtime.Object {\n\tif c := in.DeepCopy(); c != nil {\n\t\treturn c\n\t}\n\n\treturn nil\n}", "title": "" }, { "docid": "0acdce218cdee64125a614b487b993b9", "score": "0.6766082", "text": "func (in *QuayRegistryList) DeepCopyObject() runtime.Object {\n\tif c := in.DeepCopy(); c != nil {\n\t\treturn c\n\t}\n\treturn nil\n}", "title": "" }, { "docid": "55c9664518a5d5df47fbfb8b3e75f365", "score": "0.6762033", "text": "func (in *Render) DeepCopyObject() runtime.Object {\n\tif c := in.DeepCopy(); c != nil {\n\t\treturn c\n\t}\n\treturn nil\n}", "title": "" }, { "docid": "66ce1d4accebd19a48302159d6a812fc", "score": "0.67540824", "text": "func (in *UI) DeepCopyObject() runtime.Object {\n\tif c := in.DeepCopy(); c != nil {\n\t\treturn c\n\t}\n\treturn nil\n}", "title": "" }, { "docid": "02a926879e9460455d5c8baa5793aefd", "score": "0.67538834", "text": "func (in *InferenceServiceList) DeepCopyObject() runtime.Object {\n\tif c := in.DeepCopy(); c != nil {\n\t\treturn c\n\t}\n\treturn nil\n}", "title": "" }, { "docid": "afbba2acb46b593f86d558e22cf9dd51", "score": "0.6753669", "text": "func (in *GitService) DeepCopyObject() runtime.Object {\n\tif c := in.DeepCopy(); c != nil {\n\t\treturn c\n\t}\n\treturn nil\n}", "title": "" }, { "docid": "7e974cc82055e03ed1e1219290a0f949", "score": "0.6750873", "text": "func (in *Polkadot) DeepCopyObject() runtime.Object {\n\tif c := in.DeepCopy(); c != nil {\n\t\treturn c\n\t}\n\treturn nil\n}", "title": "" }, { "docid": "9b3748c3b1ce3887bd08f5bbd274b129", "score": "0.6750771", "text": "func (in *HyperMachine) DeepCopyObject() runtime.Object {\n\tif c := in.DeepCopy(); c != nil {\n\t\treturn c\n\t}\n\treturn nil\n}", "title": "" }, { "docid": "223cc12ccb30abd399d7202df99a099d", "score": "0.6743718", "text": "func (in *BindableKinds) DeepCopyObject() runtime.Object {\n\tif c := in.DeepCopy(); c != nil {\n\t\treturn c\n\t}\n\treturn nil\n}", "title": "" }, { "docid": "85147f7002cec4a366a67a1568529349", "score": "0.6743161", "text": "func (in *ClassicLoadBalance) DeepCopyObject() runtime.Object {\r\n\tif c := in.DeepCopy(); c != nil {\r\n\t\treturn c\r\n\t}\r\n\treturn nil\r\n}", "title": "" }, { "docid": "f9a8c3e1101326cc84345d76a2004394", "score": "0.67421865", "text": "func (in *VPCLinkList) DeepCopyObject() runtime.Object {\n\tif c := in.DeepCopy(); c != nil {\n\t\treturn c\n\t}\n\treturn nil\n}", "title": "" }, { "docid": "d7f46ad4bf2ca8b98565be28d01d6ce8", "score": "0.6741187", "text": "func (in *Logging) DeepCopyObject() runtime.Object {\n\tif c := in.DeepCopy(); c != nil {\n\t\treturn c\n\t}\n\treturn nil\n}", "title": "" }, { "docid": "5c945cfa7cf79f74c3a2638c8bc000fe", "score": "0.6740525", "text": "func (in *BareMetalHost) DeepCopyObject() runtime.Object {\n\tif c := in.DeepCopy(); c != nil {\n\t\treturn c\n\t}\n\treturn nil\n}", "title": "" }, { "docid": "d26f8c596806044695a33e5ea50c68c0", "score": "0.6740192", "text": "func (in *QService) DeepCopyObject() runtime.Object {\n\tif c := in.DeepCopy(); c != nil {\n\t\treturn c\n\t}\n\treturn nil\n}", "title": "" }, { "docid": "6ffb7ee075d003d884c6708fc7694c95", "score": "0.67388374", "text": "func (in *User) DeepCopyObject() runtime.Object {\n\tif c := in.DeepCopy(); c != nil {\n\t\treturn c\n\t}\n\treturn nil\n}", "title": "" }, { "docid": "6ffb7ee075d003d884c6708fc7694c95", "score": "0.67388374", "text": "func (in *User) DeepCopyObject() runtime.Object {\n\tif c := in.DeepCopy(); c != nil {\n\t\treturn c\n\t}\n\treturn nil\n}", "title": "" }, { "docid": "6ffb7ee075d003d884c6708fc7694c95", "score": "0.67388374", "text": "func (in *User) DeepCopyObject() runtime.Object {\n\tif c := in.DeepCopy(); c != nil {\n\t\treturn c\n\t}\n\treturn nil\n}", "title": "" }, { "docid": "6ffb7ee075d003d884c6708fc7694c95", "score": "0.67388374", "text": "func (in *User) DeepCopyObject() runtime.Object {\n\tif c := in.DeepCopy(); c != nil {\n\t\treturn c\n\t}\n\treturn nil\n}", "title": "" }, { "docid": "25868959a01886aba604bda97e86feb8", "score": "0.67314196", "text": "func (in *GitRepository) DeepCopyObject() runtime.Object {\n\tif c := in.DeepCopy(); c != nil {\n\t\treturn c\n\t}\n\treturn nil\n}", "title": "" }, { "docid": "aac72bc31b665911d836b3801b632cb6", "score": "0.6730502", "text": "func (m *Class) DeepCopyObject() runtime.Object {\n\tout := &Class{}\n\tj, err := json.Marshal(m)\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\t_ = json.Unmarshal(j, out)\n\treturn out\n}", "title": "" }, { "docid": "20986c2271614ac062e026acef32e687", "score": "0.6727781", "text": "func (in *Bundle) DeepCopyObject() runtime.Object {\n\tif c := in.DeepCopy(); c != nil {\n\t\treturn c\n\t}\n\treturn nil\n}", "title": "" }, { "docid": "20986c2271614ac062e026acef32e687", "score": "0.6727781", "text": "func (in *Bundle) DeepCopyObject() runtime.Object {\n\tif c := in.DeepCopy(); c != nil {\n\t\treturn c\n\t}\n\treturn nil\n}", "title": "" }, { "docid": "44a77fa4ba40fba09cd27830bd44497e", "score": "0.6725539", "text": "func (in *listchecker) DeepCopyObject() runtime.Object {\n\tif c := in.DeepCopy(); c != nil {\n\t\treturn c\n\t}\n\n\treturn nil\n}", "title": "" }, { "docid": "28e4639bd3f364681da14a33d7dd3054", "score": "0.6724093", "text": "func (in *QEgressList) DeepCopyObject() runtime.Object {\n\tif c := in.DeepCopy(); c != nil {\n\t\treturn c\n\t}\n\treturn nil\n}", "title": "" }, { "docid": "f1ae492b5af1e6f9af82fec556ec8137", "score": "0.6722446", "text": "func (t *Trait) DeepCopyObject() runtime.Object {\n\tout := &Trait{}\n\tj, err := json.Marshal(t)\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\t_ = json.Unmarshal(j, out)\n\treturn out\n}", "title": "" }, { "docid": "1868863fc59e7bd565dd75adc8a51272", "score": "0.6722384", "text": "func (in *Fact) DeepCopyObject() runtime.Object {\n\tif c := in.DeepCopy(); c != nil {\n\t\treturn c\n\t}\n\treturn nil\n}", "title": "" }, { "docid": "f042634df362987f1f2258825c573063", "score": "0.6721956", "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": "95f27103fc09b7bc20d4aa844d627e06", "score": "0.6721293", "text": "func (in *DatadogAgent) DeepCopyObject() runtime.Object {\n\tif c := in.DeepCopy(); c != nil {\n\t\treturn c\n\t}\n\treturn nil\n}", "title": "" }, { "docid": "3453d4c20c15e5a98700d5691c54ba94", "score": "0.67206407", "text": "func (in *Registry) DeepCopyObject() runtime.Object {\n\tif c := in.DeepCopy(); c != nil {\n\t\treturn c\n\t}\n\treturn nil\n}", "title": "" }, { "docid": "3453d4c20c15e5a98700d5691c54ba94", "score": "0.67206407", "text": "func (in *Registry) DeepCopyObject() runtime.Object {\n\tif c := in.DeepCopy(); c != nil {\n\t\treturn c\n\t}\n\treturn nil\n}", "title": "" }, { "docid": "87ab2e01f041d5e258d27c01af260e91", "score": "0.6718348", "text": "func (in *BundleBindingList) DeepCopyObject() runtime.Object {\n\tif c := in.DeepCopy(); c != nil {\n\t\treturn c\n\t}\n\treturn nil\n}", "title": "" }, { "docid": "14c5176041696252e0620d4c35074839", "score": "0.6716591", "text": "func (in *ExtendedSecret) DeepCopyObject() runtime.Object {\n\tif c := in.DeepCopy(); c != nil {\n\t\treturn c\n\t}\n\treturn nil\n}", "title": "" }, { "docid": "90243db3ad13bd2b9d468ef763582174", "score": "0.6712819", "text": "func (in *RestService) DeepCopyObject() runtime.Object {\n\tif c := in.DeepCopy(); c != nil {\n\t\treturn c\n\t}\n\treturn nil\n}", "title": "" }, { "docid": "002ffa5f785b81e0b3e7ac1e793b5b30", "score": "0.67119086", "text": "func (in *KameletList) DeepCopyObject() runtime.Object {\n\tif c := in.DeepCopy(); c != nil {\n\t\treturn c\n\t}\n\treturn nil\n}", "title": "" }, { "docid": "002ffa5f785b81e0b3e7ac1e793b5b30", "score": "0.67119086", "text": "func (in *KameletList) DeepCopyObject() runtime.Object {\n\tif c := in.DeepCopy(); c != nil {\n\t\treturn c\n\t}\n\treturn nil\n}", "title": "" }, { "docid": "1a3e6787e7b01897fc8c68343625781e", "score": "0.67059976", "text": "func (in *Step) DeepCopyObject() runtime.Object {\n\tif c := in.DeepCopy(); c != nil {\n\t\treturn c\n\t}\n\treturn nil\n}", "title": "" }, { "docid": "013f41279cfa7cbae55ade004f609ccd", "score": "0.6705732", "text": "func (in *Software) DeepCopyObject() runtime.Object {\n\tif c := in.DeepCopy(); c != nil {\n\t\treturn c\n\t}\n\treturn nil\n}", "title": "" }, { "docid": "9feea8da603ba80b95670d948b285248", "score": "0.67052186", "text": "func (in *Mirror) DeepCopyObject() runtime.Object {\n\tif c := in.DeepCopy(); c != nil {\n\t\treturn c\n\t}\n\treturn nil\n}", "title": "" }, { "docid": "5868d81cdbdee4dfdadfe70139a4ba41", "score": "0.6704296", "text": "func (in *KfUpgrade) DeepCopyObject() runtime.Object {\n\tif c := in.DeepCopy(); c != nil {\n\t\treturn c\n\t}\n\treturn nil\n}", "title": "" } ]
32f5d28a2ebe2ebff100a8222b004e45
ChargeUser charges the user for job jUUID
[ { "docid": "ac3e1a066e8192bf09cdd86aac63de62", "score": "0.8046755", "text": "func ChargeUser(r *http.Request, stripeInvoiceItemC *invoiceitem.Client, jUUID uuid.UUID) {\n\taUUID, err := db.GetJobOwner(r, jUUID)\n\tif err != nil {\n\t\tlog.Sugar.Errorw(\"error getting job owner\",\n\t\t\t\"method\", r.Method,\n\t\t\t\"url\", r.URL,\n\t\t\t\"err\", err.Error(),\n\t\t\t\"jID\", jUUID,\n\t\t)\n\t\treturn\n\t}\n\n\tstripeCustomerID, err := db.GetAccountStripeCustomerID(r, aUUID)\n\tif err != nil {\n\t\tlog.Sugar.Errorw(\"error getting stripe customer ID\",\n\t\t\t\"method\", r.Method,\n\t\t\t\"url\", r.URL,\n\t\t\t\"err\", err.Error(),\n\t\t\t\"jID\", jUUID,\n\t\t)\n\t\treturn\n\t}\n\n\tstripeSubscriptionID, err := db.GetAccountStripeSubscriptionID(r, aUUID)\n\tif err != nil {\n\t\tlog.Sugar.Errorw(\"error getting stripe subscription ID\",\n\t\t\t\"method\", r.Method,\n\t\t\t\"url\", r.URL,\n\t\t\t\"err\", err.Error(),\n\t\t\t\"jID\", jUUID,\n\t\t)\n\t\treturn\n\t}\n\n\tjobAmount, err := getJobAmount(jUUID)\n\tif err != nil {\n\t\tlog.Sugar.Errorw(\"error getting job amount\",\n\t\t\t\"method\", r.Method,\n\t\t\t\"url\", r.URL,\n\t\t\t\"err\", err.Error(),\n\t\t\t\"jID\", jUUID,\n\t\t)\n\t\treturn\n\t}\n\n\tcredit, err := db.GetAccountCredit(aUUID)\n\tif err != nil {\n\t\tlog.Sugar.Errorw(\"error getting account credit\",\n\t\t\t\"method\", r.Method,\n\t\t\t\"url\", r.URL,\n\t\t\t\"err\", err.Error(),\n\t\t\t\"jID\", jUUID,\n\t\t)\n\t\treturn\n\t}\n\n\tif credit >= jobAmount {\n\t\tcredit -= jobAmount\n\t\tif err := db.SetAccountCredit(aUUID, credit); err != nil {\n\t\t\tlog.Sugar.Errorw(\"error setting account credit\",\n\t\t\t\t\"method\", r.Method,\n\t\t\t\t\"url\", r.URL,\n\t\t\t\t\"err\", err.Error(),\n\t\t\t\t\"jID\", jUUID,\n\t\t\t)\n\t\t\treturn\n\t\t}\n\n\t\tif err := db.SetPaymentsUserCharged(jUUID, \"\", 0, jobAmount); err != nil {\n\t\t\tlog.Sugar.Errorw(\"error setting payments user charged\",\n\t\t\t\t\"method\", r.Method,\n\t\t\t\t\"url\", r.URL,\n\t\t\t\t\"err\", err.Error(),\n\t\t\t\t\"jID\", jUUID,\n\t\t\t)\n\t\t\treturn\n\t\t}\n\n\t\treturn\n\t} else if credit > 0 {\n\t\tjobAmount -= credit\n\t\tif err := db.SetAccountCredit(aUUID, 0); err != nil {\n\t\t\tlog.Sugar.Errorw(\"error setting account credit\",\n\t\t\t\t\"method\", r.Method,\n\t\t\t\t\"url\", r.URL,\n\t\t\t\t\"err\", err.Error(),\n\t\t\t\t\"jID\", jUUID,\n\t\t\t)\n\t\t\treturn\n\t\t}\n\t}\n\n\tparams := &stripe.InvoiceItemParams{\n\t\tCustomer: stripe.String(stripeCustomerID),\n\t\tSubscription: stripe.String(stripeSubscriptionID),\n\t\tAmount: stripe.Int64(jobAmount),\n\t\tCurrency: stripe.String(string(stripe.CurrencyUSD)),\n\t\tDescription: stripe.String(fmt.Sprintf(\"Payment for job %s\", jUUID.String())),\n\t}\n\tparams.SetIdempotencyKey(uuid.NewV4().String())\n\n\tctx := context.Background()\n\tii := &stripe.InvoiceItem{}\n\toperation := func() error {\n\t\tvar err error\n\t\tii, err = stripeInvoiceItemC.New(params)\n\t\treturn err\n\t}\n\texpBackOff := backoff.NewExponentialBackOff()\n\texpBackOff.MaxElapsedTime = maxBackoffElapsedTime\n\tif err := backoff.RetryNotify(operation,\n\t\tbackoff.WithContext(expBackOff, ctx),\n\t\tfunc(err error, t time.Duration) {\n\t\t\tlog.Sugar.Errorw(\"error creating user invoice, retrying\",\n\t\t\t\t\"method\", r.Method,\n\t\t\t\t\"url\", r.URL,\n\t\t\t\t\"err\", err.Error(),\n\t\t\t\t\"jID\", jUUID,\n\t\t\t)\n\t\t}); err != nil {\n\t\tlog.Sugar.Errorw(\"error creating user invoice--aborting\",\n\t\t\t\"method\", r.Method,\n\t\t\t\"url\", r.URL,\n\t\t\t\"err\", err.Error(),\n\t\t\t\"jID\", jUUID,\n\t\t)\n\t\treturn\n\t}\n\n\tif err := db.SetPaymentsUserCharged(jUUID, ii.ID, ii.Amount, credit); err != nil {\n\t\tlog.Sugar.Errorw(\"error setting payments user charged\",\n\t\t\t\"method\", r.Method,\n\t\t\t\"url\", r.URL,\n\t\t\t\"err\", err.Error(),\n\t\t\t\"jID\", jUUID,\n\t\t)\n\t\treturn\n\t}\n}", "title": "" } ]
[ { "docid": "a75e8ed8732e5666f0e4767bd42c11cd", "score": "0.59857446", "text": "func (o *CMFChargeUser) Delete(ctx context.Context, exec boil.ContextExecutor) (int64, error) {\n\tif o == nil {\n\t\treturn 0, errors.New(\"models: no CMFChargeUser provided for delete\")\n\t}\n\n\tif err := o.doBeforeDeleteHooks(ctx, exec); err != nil {\n\t\treturn 0, err\n\t}\n\n\targs := queries.ValuesFromMapping(reflect.Indirect(reflect.ValueOf(o)), cmfChargeUserPrimaryKeyMapping)\n\tsql := \"DELETE FROM `cmf_charge_user` WHERE `id`=?\"\n\n\tif boil.IsDebug(ctx) {\n\t\twriter := boil.DebugWriterFrom(ctx)\n\t\tfmt.Fprintln(writer, sql)\n\t\tfmt.Fprintln(writer, args...)\n\t}\n\tresult, err := exec.ExecContext(ctx, sql, args...)\n\tif err != nil {\n\t\treturn 0, errors.Wrap(err, \"models: unable to delete from cmf_charge_user\")\n\t}\n\n\trowsAff, err := result.RowsAffected()\n\tif err != nil {\n\t\treturn 0, errors.Wrap(err, \"models: failed to get rows affected by delete for cmf_charge_user\")\n\t}\n\n\tif err := o.doAfterDeleteHooks(ctx, exec); err != nil {\n\t\treturn 0, err\n\t}\n\n\treturn rowsAff, nil\n}", "title": "" }, { "docid": "67b361f72a42adfb80fd8454026c09a3", "score": "0.57669765", "text": "func (s *Service) PurgeUser(c context.Context, mid int64, action string) (err error) {\n\tui, err := s.UserInfoAsyn(c, mid)\n\tif err != nil {\n\t\tlog.Error(\"purge user(%d) failed\", mid)\n\t\treturn\n\t}\n\tif ui == nil || ui.State == _banned {\n\t\tlog.Error(\"ui not fund or banned:%v\", ui)\n\t\treturn\n\t}\n\tvar effect string\n\tswitch action {\n\tcase _unBindTel:\n\t\teffect = \"解除绑定手机\"\n\tcase _updateTel:\n\t\teffect = \"更新绑定手机\"\n\tcase _updateEmail:\n\t\teffect = \"更新绑定邮箱\"\n\tcase _updateUname, _updateFace:\n\t\teffect = \"修改账号资料\"\n\tcase _updateIDEN:\n\t\teffect = \"完成实名认证\"\n\tdefault:\n\t\tlog.Error(\"unhandle action(%s) for mid(%d)\", action, mid)\n\t}\n\tip := metadata.String(c, metadata.RemoteIP)\n\ts.updatescore(func() {\n\t\ts.UpdateUserScore(context.TODO(), mid, ip, effect)\n\t})\n\treturn\n}", "title": "" }, { "docid": "c746d38ea383da20af3377ac548e1ebe", "score": "0.5435441", "text": "func CMFChargeUserExists(ctx context.Context, exec boil.ContextExecutor, iD uint) (bool, error) {\n\tvar exists bool\n\tsql := \"select exists(select 1 from `cmf_charge_user` where `id`=? limit 1)\"\n\n\tif boil.IsDebug(ctx) {\n\t\twriter := boil.DebugWriterFrom(ctx)\n\t\tfmt.Fprintln(writer, sql)\n\t\tfmt.Fprintln(writer, iD)\n\t}\n\trow := exec.QueryRowContext(ctx, sql, iD)\n\n\terr := row.Scan(&exists)\n\tif err != nil {\n\t\treturn false, errors.Wrap(err, \"models: unable to check if cmf_charge_user exists\")\n\t}\n\n\treturn exists, nil\n}", "title": "" }, { "docid": "75faedf7fd66f2b559090b186ba45f67", "score": "0.53689885", "text": "func FindCMFChargeUser(ctx context.Context, exec boil.ContextExecutor, iD uint, selectCols ...string) (*CMFChargeUser, error) {\n\tcmfChargeUserObj := &CMFChargeUser{}\n\n\tsel := \"*\"\n\tif len(selectCols) > 0 {\n\t\tsel = strings.Join(strmangle.IdentQuoteSlice(dialect.LQ, dialect.RQ, selectCols), \",\")\n\t}\n\tquery := fmt.Sprintf(\n\t\t\"select %s from `cmf_charge_user` where `id`=?\", sel,\n\t)\n\n\tq := queries.Raw(query, iD)\n\n\terr := q.Bind(ctx, exec, cmfChargeUserObj)\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, \"models: unable to select from cmf_charge_user\")\n\t}\n\n\treturn cmfChargeUserObj, nil\n}", "title": "" }, { "docid": "bd4ce96d842a636270e04a5c5ce0513f", "score": "0.5273706", "text": "func PackUserDelete(c *gin.Context) {\n\tform := &model.PackUserParams{}\n\n\tif err := c.BindJSON(&form); err != nil {\n\t\tlogrus.Warnf(\"Failed to bind pack user data. %s\", err)\n\n\t\tc.JSON(\n\t\t\thttp.StatusPreconditionFailed,\n\t\t\tgin.H{\n\t\t\t\t\"status\": http.StatusPreconditionFailed,\n\t\t\t\t\"message\": \"Failed to bind pack user data\",\n\t\t\t},\n\t\t)\n\n\t\tc.Abort()\n\t\treturn\n\t}\n\n\tform.Pack = c.Param(\"pack\")\n\n\tassigned := store.GetPackHasUser(\n\t\tc,\n\t\tform,\n\t)\n\n\tif !assigned {\n\t\tc.JSON(\n\t\t\thttp.StatusPreconditionFailed,\n\t\t\tgin.H{\n\t\t\t\t\"status\": http.StatusPreconditionFailed,\n\t\t\t\t\"message\": \"User is not assigned\",\n\t\t\t},\n\t\t)\n\n\t\tc.Abort()\n\t\treturn\n\t}\n\n\terr := store.DeletePackUser(\n\t\tc,\n\t\tform,\n\t)\n\n\tif err != nil {\n\t\tlogrus.Warnf(\"Failed to delete pack user. %s\", err)\n\n\t\tc.JSON(\n\t\t\thttp.StatusInternalServerError,\n\t\t\tgin.H{\n\t\t\t\t\"status\": http.StatusInternalServerError,\n\t\t\t\t\"message\": \"Failed to unlink user\",\n\t\t\t},\n\t\t)\n\n\t\tc.Abort()\n\t\treturn\n\t}\n\n\tc.JSON(\n\t\thttp.StatusOK,\n\t\tgin.H{\n\t\t\t\"status\": http.StatusOK,\n\t\t\t\"message\": \"Successfully unlinked user\",\n\t\t},\n\t)\n}", "title": "" }, { "docid": "2c86204a3a6f03c8cd41faa09f2cb9ed", "score": "0.5249142", "text": "func (o *CMFChargeUser) Insert(ctx context.Context, exec boil.ContextExecutor, columns boil.Columns) error {\n\tif o == nil {\n\t\treturn errors.New(\"models: no cmf_charge_user provided for insertion\")\n\t}\n\n\tvar err error\n\n\tif err := o.doBeforeInsertHooks(ctx, exec); err != nil {\n\t\treturn err\n\t}\n\n\tnzDefaults := queries.NonZeroDefaultSet(cmfChargeUserColumnsWithDefault, o)\n\n\tkey := makeCacheKey(columns, nzDefaults)\n\tcmfChargeUserInsertCacheMut.RLock()\n\tcache, cached := cmfChargeUserInsertCache[key]\n\tcmfChargeUserInsertCacheMut.RUnlock()\n\n\tif !cached {\n\t\twl, returnColumns := columns.InsertColumnSet(\n\t\t\tcmfChargeUserAllColumns,\n\t\t\tcmfChargeUserColumnsWithDefault,\n\t\t\tcmfChargeUserColumnsWithoutDefault,\n\t\t\tnzDefaults,\n\t\t)\n\n\t\tcache.valueMapping, err = queries.BindMapping(cmfChargeUserType, cmfChargeUserMapping, wl)\n\t\tif err != nil {\n\t\t\treturn err\n\t\t}\n\t\tcache.retMapping, err = queries.BindMapping(cmfChargeUserType, cmfChargeUserMapping, returnColumns)\n\t\tif err != nil {\n\t\t\treturn err\n\t\t}\n\t\tif len(wl) != 0 {\n\t\t\tcache.query = fmt.Sprintf(\"INSERT INTO `cmf_charge_user` (`%s`) %%sVALUES (%s)%%s\", strings.Join(wl, \"`,`\"), strmangle.Placeholders(dialect.UseIndexPlaceholders, len(wl), 1, 1))\n\t\t} else {\n\t\t\tcache.query = \"INSERT INTO `cmf_charge_user` () VALUES ()%s%s\"\n\t\t}\n\n\t\tvar queryOutput, queryReturning string\n\n\t\tif len(cache.retMapping) != 0 {\n\t\t\tcache.retQuery = fmt.Sprintf(\"SELECT `%s` FROM `cmf_charge_user` WHERE %s\", strings.Join(returnColumns, \"`,`\"), strmangle.WhereClause(\"`\", \"`\", 0, cmfChargeUserPrimaryKeyColumns))\n\t\t}\n\n\t\tcache.query = fmt.Sprintf(cache.query, queryOutput, queryReturning)\n\t}\n\n\tvalue := reflect.Indirect(reflect.ValueOf(o))\n\tvals := queries.ValuesFromMapping(value, 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, vals)\n\t}\n\tresult, err := exec.ExecContext(ctx, cache.query, vals...)\n\n\tif err != nil {\n\t\treturn errors.Wrap(err, \"models: unable to insert into cmf_charge_user\")\n\t}\n\n\tvar lastID int64\n\tvar identifierCols []interface{}\n\n\tif len(cache.retMapping) == 0 {\n\t\tgoto CacheNoHooks\n\t}\n\n\tlastID, err = result.LastInsertId()\n\tif err != nil {\n\t\treturn ErrSyncFail\n\t}\n\n\to.ID = uint(lastID)\n\tif lastID != 0 && len(cache.retMapping) == 1 && cache.retMapping[0] == cmfChargeUserMapping[\"id\"] {\n\t\tgoto CacheNoHooks\n\t}\n\n\tidentifierCols = []interface{}{\n\t\to.ID,\n\t}\n\n\tif boil.IsDebug(ctx) {\n\t\twriter := boil.DebugWriterFrom(ctx)\n\t\tfmt.Fprintln(writer, cache.retQuery)\n\t\tfmt.Fprintln(writer, identifierCols...)\n\t}\n\terr = exec.QueryRowContext(ctx, cache.retQuery, identifierCols...).Scan(queries.PtrsFromMapping(value, cache.retMapping)...)\n\tif err != nil {\n\t\treturn errors.Wrap(err, \"models: unable to populate default values for cmf_charge_user\")\n\t}\n\nCacheNoHooks:\n\tif !cached {\n\t\tcmfChargeUserInsertCacheMut.Lock()\n\t\tcmfChargeUserInsertCache[key] = cache\n\t\tcmfChargeUserInsertCacheMut.Unlock()\n\t}\n\n\treturn o.doAfterInsertHooks(ctx, exec)\n}", "title": "" }, { "docid": "cca42c61db4a1b45545591f2f8647d75", "score": "0.5223308", "text": "func (o *CMFChargeUser) 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\tcmfChargeUserUpdateCacheMut.RLock()\n\tcache, cached := cmfChargeUserUpdateCache[key]\n\tcmfChargeUserUpdateCacheMut.RUnlock()\n\n\tif !cached {\n\t\twl := columns.UpdateColumnSet(\n\t\t\tcmfChargeUserAllColumns,\n\t\t\tcmfChargeUserPrimaryKeyColumns,\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(\"models: unable to update cmf_charge_user, could not build whitelist\")\n\t\t}\n\n\t\tcache.query = fmt.Sprintf(\"UPDATE `cmf_charge_user` SET %s WHERE %s\",\n\t\t\tstrmangle.SetParamNames(\"`\", \"`\", 0, wl),\n\t\t\tstrmangle.WhereClause(\"`\", \"`\", 0, cmfChargeUserPrimaryKeyColumns),\n\t\t)\n\t\tcache.valueMapping, err = queries.BindMapping(cmfChargeUserType, cmfChargeUserMapping, append(wl, cmfChargeUserPrimaryKeyColumns...))\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, \"models: unable to update cmf_charge_user row\")\n\t}\n\n\trowsAff, err := result.RowsAffected()\n\tif err != nil {\n\t\treturn 0, errors.Wrap(err, \"models: failed to get rows affected by update for cmf_charge_user\")\n\t}\n\n\tif !cached {\n\t\tcmfChargeUserUpdateCacheMut.Lock()\n\t\tcmfChargeUserUpdateCache[key] = cache\n\t\tcmfChargeUserUpdateCacheMut.Unlock()\n\t}\n\n\treturn rowsAff, o.doAfterUpdateHooks(ctx, exec)\n}", "title": "" }, { "docid": "a789fe3a0ae6034c07b809247fce9636", "score": "0.5165435", "text": "func (m *Handler) deleteUser(w http.ResponseWriter, r *http.Request, p httprouter.Params, ctx *AuthContext) (interface{}, error) {\n\terr := ctx.Operator.DeleteUser(r.Context(), clusterKey(ctx, p), p.ByName(\"username\"))\n\tif err != nil {\n\t\treturn nil, trace.Wrap(err)\n\t}\n\treturn httplib.OK(), nil\n}", "title": "" }, { "docid": "2b793fdc4a36b033b834ca863f2c198d", "score": "0.51596075", "text": "func DeleteUser(ctx *context.APIContext) {\n\t// swagger:operation DELETE /admin/users/{username} admin adminDeleteUser\n\t// ---\n\t// summary: Delete a user\n\t// produces:\n\t// - application/json\n\t// parameters:\n\t// - name: username\n\t// in: path\n\t// description: username of user to delete\n\t// type: string\n\t// required: true\n\t// - name: purge\n\t// in: query\n\t// description: purge the user from the system completely\n\t// type: boolean\n\t// responses:\n\t// \"204\":\n\t// \"$ref\": \"#/responses/empty\"\n\t// \"403\":\n\t// \"$ref\": \"#/responses/forbidden\"\n\t// \"404\":\n\t// \"$ref\": \"#/responses/notFound\"\n\t// \"422\":\n\t// \"$ref\": \"#/responses/validationError\"\n\n\tif ctx.ContextUser.IsOrganization() {\n\t\tctx.Error(http.StatusUnprocessableEntity, \"\", fmt.Errorf(\"%s is an organization not a user\", ctx.ContextUser.Name))\n\t\treturn\n\t}\n\n\t// admin should not delete themself\n\tif ctx.ContextUser.ID == ctx.Doer.ID {\n\t\tctx.Error(http.StatusUnprocessableEntity, \"\", fmt.Errorf(\"you cannot delete yourself\"))\n\t\treturn\n\t}\n\n\tif err := user_service.DeleteUser(ctx, ctx.ContextUser, ctx.FormBool(\"purge\")); err != nil {\n\t\tif models.IsErrUserOwnRepos(err) ||\n\t\t\tmodels.IsErrUserHasOrgs(err) ||\n\t\t\tmodels.IsErrUserOwnPackages(err) {\n\t\t\tctx.Error(http.StatusUnprocessableEntity, \"\", err)\n\t\t} else {\n\t\t\tctx.Error(http.StatusInternalServerError, \"DeleteUser\", err)\n\t\t}\n\t\treturn\n\t}\n\tlog.Trace(\"Account deleted by admin(%s): %s\", ctx.Doer.Name, ctx.ContextUser.Name)\n\n\tctx.Status(http.StatusNoContent)\n}", "title": "" }, { "docid": "aa0faa38769ccd58e607234c20e40bc4", "score": "0.5148501", "text": "func (d *DbParameter) DeleteUser(ctx context.Context, id strfmt.UUID) (state int, e error) {\n\n\tl.Trace.Printf(\"[DB] [USER] Attempting to delete the user with id %v.\\n\", id)\n\n\tauthzData := ctx.Value(restapi.AuthKey).(map[string]string)\n\n\tvar u models.User\n\n\tstate = statusOK\n\n\ttx := d.Db.Begin()\n\n\tif r := d.Db.Where(&models.User{ID: id}).First(&u).Error; errors.Is(r, gorm.ErrRecordNotFound) {\n\n\t\tl.Warning.Printf(\"[DB] [USER] Unable to fetch existing record for user [ %v ], check with administrator.\\n\", id)\n\n\t\tstate = statusMissing\n\n\t\treturn\n\n\t} else {\n\n\t\tl.Info.Printf(\"[DB] [USER] Found existing record for user [ %v ] successfully, proceeding to delete it.\\n\", u.FirstName)\n\n\t\tif !d.isUserAllowed(u.OrganizationID.String(), \"\", \"IAM_WRITE\", authzData) {\n\n\t\t\tl.Warning.Printf(\"[DB] [USER] The user [ %v ] is not allowed to remove users from organization [ %v ]! \\n\", authzData[SEC_USER], u.OrganizationID)\n\n\t\t\te = fmt.Errorf(\"user doesn't have enough permissions in this organization - IAM_WRITE\")\n\n\t\t\tstate = statusForbidden\n\n\t\t\treturn\n\n\t\t}\n\n\t\tif e := tx.Delete(&u).Error; e != nil {\n\n\t\t\tl.Warning.Printf(\"[DB] [USER] Unable to delete existing record for user [ %v ] from the system, check with administrator.\\n\", id)\n\n\t\t\tstate = statusFail\n\n\t\t} else {\n\n\t\t\tl.Info.Printf(\"[DB] [USER] Existing record for user [ %v ] deleted successfully.\\n\", id)\n\n\t\t\t_, token := kclib.GetToken()\n\n\t\t\tif token != \"\" {\n\n\t\t\t\tstatus := kclib.DeleteUser(token, u.ID.String())\n\n\t\t\t\tif status.IsSuccess() {\n\n\t\t\t\t\tl.Info.Printf(\"[DB] [USER] User [ %v ] added successfully to Organization [ %v ] in Keycloak: [ %v ] - [ %v ]\\n\", u.ID.String(), u.OrganizationID.String(), status.StatusCode, status.Message)\n\n\t\t\t\t} else {\n\n\t\t\t\t\tl.Warning.Printf(\"[DB] [USER] User [ %v ] couldn't be added to Organization [ %v ] in Keycloak: [ %v ] - [ %v ]\\n\", u.ID.String(), u.OrganizationID.String(), status.StatusCode, status.Message)\n\n\t\t\t\t\te = fmt.Errorf(\"not able to remove user from Keycloak - KC-lib\")\n\n\t\t\t\t\tstate = statusFail\n\n\t\t\t\t}\n\n\t\t\t} else {\n\n\t\t\t\tl.Warning.Printf(\"[DB] [USER] The interaction with Keycloak couldn't be stablished, please check with administrator\\n\")\n\n\t\t\t\te = fmt.Errorf(\"not able to interact with Keycloak - KC-lib\")\n\n\t\t\t\tstate = statusFail\n\n\t\t\t}\n\n\t\t}\n\n\t}\n\n\tif state == statusFail {\n\n\t\te = tx.Rollback().Error\n\n\t} else {\n\n\t\te = tx.Commit().Error\n\n\t}\n\n\treturn\n\n}", "title": "" }, { "docid": "0c7b692823f35a5fe28aa471590cf8cd", "score": "0.5113361", "text": "func (c *C7000) applyUserParams(cfg *cfgresources.User) (err error) {\n\n\tif cfg.Name == \"\" {\n\t\tlog.WithFields(log.Fields{\n\t\t\t\"step\": \"applyUserParams\",\n\t\t\t\"Model\": c.BmcType(),\n\t\t}).Fatal(\"User resource expects parameter: Name.\")\n\t}\n\n\tif cfg.Password == \"\" {\n\t\tlog.WithFields(log.Fields{\n\t\t\t\"step\": \"applyUserParams\",\n\t\t\t\"Model\": c.BmcType(),\n\t\t}).Fatal(\"User resource expects parameter: Password.\")\n\t}\n\n\tif c.isRoleValid(cfg.Role) == false {\n\t\tlog.WithFields(log.Fields{\n\t\t\t\"step\": \"applyUserParams\",\n\t\t\t\"Model\": c.BmcType(),\n\t\t\t\"Role\": cfg.Role,\n\t\t}).Fatal(\"User resource Role must be declared and a valid role: admin.\")\n\t}\n\n\tusername := Username{Text: cfg.Name}\n\tpassword := Password{Text: cfg.Password}\n\n\t//if user account is disabled, remove the user\n\tif cfg.Enable == false {\n\t\tpayload := RemoveUser{Username: username}\n\t\tstatusCode, _, _ := c.postXML(payload)\n\n\t\t//user doesn't exist\n\t\tif statusCode != 400 {\n\t\t\treturn err\n\t\t}\n\n\t\tlog.WithFields(log.Fields{\n\t\t\t\"IP\": c.ip,\n\t\t\t\"Model\": c.BmcType(),\n\t\t\t\"Serial\": c.serial,\n\t\t\t\"User\": cfg.Name,\n\t\t}).Debug(\"User removed.\")\n\n\t\t//user exists and was removed.\n\t\treturn err\n\t}\n\n\tpayload := AddUser{Username: username, Password: password}\n\tstatusCode, _, err := c.postXML(payload)\n\tif err != nil {\n\t\treturn err\n\t}\n\n\t//user exists\n\tif statusCode == 400 {\n\t\tlog.WithFields(log.Fields{\n\t\t\t\"step\": \"applyUserParams\",\n\t\t\t\"user\": cfg.Name,\n\t\t\t\"IP\": c.ip,\n\t\t\t\"Model\": c.BmcType(),\n\t\t\t\"Serial\": c.serial,\n\t\t\t\"Return code\": statusCode,\n\t\t}).Debug(\"User already exists, setting password.\")\n\n\t\t//update user password\n\t\terr := c.setUserPassword(cfg.Name, cfg.Password)\n\t\tif err != nil {\n\t\t\treturn err\n\t\t}\n\n\t\t//update user acl\n\t\terr = c.setUserAcl(cfg.Name, cfg.Role)\n\t\tif err != nil {\n\t\t\treturn err\n\t\t}\n\n\t\t//updates user blade bay access acls\n\t\terr = c.applyAddUserBayAccess(cfg.Name)\n\t\tif err != nil {\n\t\t\treturn err\n\t\t}\n\n\t}\n\n\tlog.WithFields(log.Fields{\n\t\t\"IP\": c.ip,\n\t\t\"Model\": c.BmcType(),\n\t\t\"Serial\": c.serial,\n\t\t\"user\": cfg.Name,\n\t}).Debug(\"User cfg applied.\")\n\treturn err\n}", "title": "" }, { "docid": "0761be779f1940b26a498e6c8e5f2a55", "score": "0.50861937", "text": "func DeleteUser(w http.ResponseWriter, r *http.Request, ps httprouter.Params) {\n\treq := rpc.DeleteRequest{UserId: ps.ByName(\"id\")}\n\tres, err := us.Delete(ctx, &req)\n\tThrowError(err)\n\tif res != nil {\n\t\tfmt.Fprint(w, \"Da xoa user voi id = \", res.UserId)\n\t}\n}", "title": "" }, { "docid": "2c86babfce393012dbd7da87c7a81a2a", "score": "0.5013549", "text": "func CMFChargeUsers(mods ...qm.QueryMod) cmfChargeUserQuery {\n\tmods = append(mods, qm.From(\"`cmf_charge_user`\"))\n\treturn cmfChargeUserQuery{NewQuery(mods...)}\n}", "title": "" }, { "docid": "f09f2c6bbf5c186142672c9d5c629d67", "score": "0.500935", "text": "func (t *SimpleChaincode) deleteUser(stub shim.ChaincodeStubInterface, args []string) pb.Response {\n\tvar jsonResp string\n\tvar userJSON User\n\tif len(args) != 1 {\n\t\treturn shim.Error(\"Incorrect number of arguments. Expecting 1\")\n\t}\n\n\tmsp , err := cid.GetMSPID(stub)\n\tif err != nil {\n\t\treturn shim.Error(\"In DELETEUSER: Error: Failed to get MSPID\")\n\t}\n\tfmt.Printf(\"MSPID = %s\", msp)\n\n\teid := args[0]\n\n\t//Check if invoker MSP == user.MSP\n\tvalAsbytes, err := stub.GetState(eid) //get the marble from chaincode state\n\tif err != nil {\n\t\tjsonResp = \"{\\\"Error\\\":\\\"Failed to get state for user with EID = \" + eid + \"\\\"}\"\n\t\treturn shim.Error(jsonResp)\n\t} else if valAsbytes == nil {\n\t\tjsonResp = \"{\\\"Error\\\":\\\"User with this EID does not exist: \" + eid + \"\\\"}\"\n\t\treturn shim.Error(jsonResp)\n\t}\n\n\terr = json.Unmarshal([]byte(valAsbytes), &userJSON)\n\tif err != nil {\n\t\tjsonResp = \"{\\\"Error\\\":\\\"Failed to decode JSON of user: \" + eid + \"\\\"}\"\n\t\treturn shim.Error(jsonResp)\n\t}\n\n\tif userJSON.MSP != msp {\n\t\tfmt.Printf(\"User MSP = %s is different from invoker MSP = %s\", userJSON.MSP, msp)\n\t\tjsonResp = \"{\\\"Error\\\":\\\"User MSP:\"+ userJSON.MSP +\" != invoker MSP: \" + msp + \"\\\"}\"\n\t\treturn shim.Error(jsonResp)\n\t}\n\n\t// Delete the key from the state in ledger\n\terr = stub.DelState(eid)\n\tif err != nil {\n\t\treturn shim.Error(\"Failed to delete state\")\n\t}\n\t/*indexName := \"msp~pki\"\n\tmspPkiIndexKey, err := stub.CreateCompositeKey(indexName, []string{user.MSP, pki})\n\tif err != nil {\n\t\treturn shim.Error(err.Error())\n\t}\n\tstub.DelState(mspPkiIndexKey)*/\n\n\treturn shim.Success(nil)\n}", "title": "" }, { "docid": "437651031a20bb51e3afbbdacd793f66", "score": "0.5003046", "text": "func DeleteUser(w http.ResponseWriter, r *http.Request, params denco.Params) {\n\t// some actual stuff should happen in here\n}", "title": "" }, { "docid": "010d10bfe37c59d38653a01513d4f21e", "score": "0.49786314", "text": "func DeleteUser(c *gin.Context) {\n\tvar user model.User\n\tuserID := c.Param(\"id\")\n\n\t// Check exist user\n\terr := DB.First(&user, userID).Error\n\tif err != nil && !errors.Is(err, gorm.ErrRecordNotFound) {\n\t\tLog.Debug(\"Getting error when check exist user\", \"error\", err.Error())\n\t\tc.JSON(http.StatusInternalServerError, gin.H{\"status\": http.StatusInternalServerError, \"message\": err.Error()})\n\t\treturn\n\t}\n\n\tif user.ID == 0 {\n\t\tc.JSON(http.StatusNotFound, gin.H{\"status\": http.StatusNotFound, \"message\": \"ID not found!\"})\n\t\treturn\n\t}\n\n\terr = DB.Delete(&user).Error\n\tif err != nil {\n\t\tLog.Debug(\"Getting error when delete user\", \"error\", err.Error())\n\t\tc.JSON(http.StatusInternalServerError, gin.H{\"status\": http.StatusInternalServerError, \"message\": err.Error()})\n\t\treturn\n\t}\n\n\t// Remove Cache Redis\n\tclient.Del(\"AllUser\")\n\tclient.Del(\"User\" + userID)\n\n\tc.JSON(http.StatusOK, gin.H{\"status\": http.StatusOK, \"message\": \"User deleted successfully!\"})\n}", "title": "" }, { "docid": "f5cdea3a52da780e748078119648e0ac", "score": "0.49766806", "text": "func DeleteUser(db *gorm.DB, w http.ResponseWriter, r *http.Request) {\n\tvars := r.URL.Query()\n\tid, ok := strconv.Atoi(vars[\"u_id\"][0])\n\tif ok != nil {\n\t\trespondWithError(w, http.StatusBadRequest, \"Invalid User ID\")\n\t\treturn\n\t}\n\n\tp := models.User{ID: id}\n\tif GetUserByID(db, &p, w) == 0 {\n\t\treturn\n\t}\n\n\tif err := p.DeleteUser(db); err != nil {\n\t\trespondWithError(w, http.StatusInternalServerError, err.Error())\n\t\treturn\n\t}\n\n\trespondWithJSON(w, http.StatusOK, map[string]string{\"result\": \"success\"})\n}", "title": "" }, { "docid": "903cfca7e5df8a38957381676339fb59", "score": "0.496666", "text": "func OnDeleteUser(command *commander.Command) *commander.Event {\n\treq := models.UserDeleteCommand{}\n\terr := json.Unmarshal(command.Data, &req)\n\n\tif err != nil {\n\t\treturn command.NewErrorEvent(\"DataParseError\", nil)\n\t}\n\n\tuser := models.UserModel{\n\t\tID: req.ID,\n\t}\n\n\tcommon.Database.Delete(&user)\n\n\treturn command.NewEvent(\"Deleted\", 1, command.Key, nil)\n}", "title": "" }, { "docid": "08f1a85c3d81a3c92e0ba42eb8840891", "score": "0.49633047", "text": "func killUser(uid int32, userID *[ptttype.IDLEN + 1]byte) error {\n\tif uid <= 0 || userID == nil {\n\t\treturn ptttype.ErrInvalidUserID\n\t}\n\n\terr := friendDeleteAll(userID, ptttype.FRIEND_ALOHA)\n\tif err != nil {\n\t\tlog.Errorf(\"killUser: unable to friend-delete-all: uid: %v e: %v\", uid, err)\n\t}\n\n\terr = tryDeleteHomePath(userID)\n\tif err != nil {\n\t\tlog.Errorf(\"killUser: unable to delete home-path: userID: %v e: %v\", userID, err)\n\t}\n\n\temptyUser := &ptttype.UserecRaw{}\n\terr = passwdSyncUpdate(uid, emptyUser)\n\tif err != nil {\n\t\tlog.Errorf(\"killUser: unable to passwd-sync-update emptyUser: uid: %v e: %v\", uid, err)\n\t}\n\n\treturn nil\n}", "title": "" }, { "docid": "f8499f5f71a44d0161d9e838dd16fffe", "score": "0.49452433", "text": "func DeleteUser(c *fiber.Ctx) {\n\tuserID, userErr := getUserID(c.Params(\"user_id\"))\n\tif userErr != nil {\n\t\tc.Status(userErr.Status)\n\t\tc.JSON(userErr)\n\t\treturn\n\t}\n\n\tif err := services.UserServices.DeleteUser(userID); err != nil {\n\t\tc.Status(userErr.Status)\n\t\tc.JSON(userErr)\n\t\treturn\n\t}\n\n\tc.Status(http.StatusOK)\n\tc.JSON(map[string]string{\"Status\": \"success\"})\n}", "title": "" }, { "docid": "27efa1239eeb35c0bd928a1bfd7de766", "score": "0.49444193", "text": "func (b *Binder) KickUser(userID string, timeout time.Duration) error {\n\tselect {\n\tcase b.exitChan <- userID:\n\tcase <-time.After(timeout):\n\t\treturn ErrTimeout\n\t}\n\treturn nil\n}", "title": "" }, { "docid": "c08c3548c1df292f594add56fe342ffe", "score": "0.49359006", "text": "func banUserHandler(request *http.Request, resp http.ResponseWriter, redis *models.RedisLogger, form banUserForm) {\n\tif ok, err := checkToken(redis, form.Token); !ok {\n\t\twriteResponse(resp, err)\n\t\treturn\n\t}\n\n\tuser := &models.Account{}\n\tif find, err := user.FindByUserid(form.Userid); !find {\n\t\tif err == nil {\n\t\t\terr = errors.NewError(errors.NotExistsError, \"user '\"+form.Userid+\"' not exists\")\n\t\t\twriteResponse(resp, err)\n\t\t\treturn\n\t\t}\n\t\twriteResponse(resp, errors.NewError(errors.NotExistsError))\n\t\treturn\n\t}\n\n\t// ws push\n\tevent := &models.Event{\n\t\tType: models.EventStatus,\n\t\tData: models.EventData{\n\t\t\tType: models.EventBan,\n\t\t},\n\t}\n\n\tif form.Duration == 0 {\n\t\tuser.TimeLimit = 0\n\t\tevent.Data.Type = models.EventUnban\n\t} else if form.Duration < 0 {\n\t\tuser.TimeLimit = -1\n\t\tevent.Data.Type = models.EventLock\n\t} else {\n\t\tuser.TimeLimit = time.Now().Unix() + form.Duration\n\t\tevent.Data.Type = models.EventBan\n\t}\n\n\terr := user.UpdateBanTime(user.TimeLimit)\n\tif err != nil {\n\t\twriteResponse(resp, err)\n\t\treturn\n\t}\n\n\tredis.PubMsg(event.Type, user.Id, event.Bytes())\n\n\trespData := map[string]interface{}{\n\t\t\"ban\": form.Duration,\n\t}\n\twriteResponse(resp, respData)\n}", "title": "" }, { "docid": "8da2a24375efbad55942a20471bb8f5a", "score": "0.4914385", "text": "func userDelete(context *gin.Context){\n\tisStatusOK := true //exit flag\n\tuuid := context.Query(\"uuid\")\n\n\t//db execution\n\t_, err := db.Exec(\"delete from tb_user where uuid=?\", uuid)\n\tif err != nil {\n\t\tfmt.Printf(\"user delete faied, error:[%v]\", err.Error())\n\t\tisStatusOK = false\n\t}\n\n\t//response\n\tif isStatusOK == true{\n\t\tcontext.JSON(http.StatusOK,gin.H{\n\t\t\t\"code\": 200,\n\t\t\t\"msg\": \"delete success\",\n\t\t})\n\t}else{ ////isStatusOK == false\n\t\tcontext.JSON(http.StatusBadRequest,gin.H{\n\t\t\t\"code\": 400,\n\t\t\t\"msg\": \"delete failed\",\n\t\t})\n\t}\n}", "title": "" }, { "docid": "d1fdd1846a087a91e20c5923305a8e43", "score": "0.49134687", "text": "func UserHandler(c echo.Context) error {\n\tctx, reqID := prepareReqID(c)\n\n\tvar req UserRequest\n\terr := c.Bind(&req)\n\tif err != nil {\n\t\tlog.WithFields(log.Fields{\n\t\t\t\"Error\": err,\n\t\t\tconstant.ReqID: reqID,\n\t\t}).Debugf(\"Error in %v when bind request\", userHandler)\n\t\terr := errors.BadRequest.New(err)\n\t\treturn ErrorResponse(c, err)\n\t}\n\n\tdb, err := postgree.GetDB()\n\tif err != nil {\n\t\tlog.WithFields(log.Fields{\n\t\t\t\"Error\": err,\n\t\t\tconstant.ReqID: reqID,\n\t\t}).Debugf(\"Error in %v when get pg instance\", userHandler)\n\t\terr := errors.DataBaseError.New(err)\n\t\treturn ErrorResponse(c, err)\n\t}\n\trepo := stores.InitUserStore(db)\n\n\tswitch c.Request().Method {\n\tcase http.MethodGet:\n\t\tuser, err := services.UserGet(ctx, req.ID, repo)\n\t\tif err != nil {\n\t\t\treturn ErrorResponse(c, err)\n\t\t}\n\t\treturn SuccessResponse(c, user, req.ID, http.StatusOK)\n\tcase http.MethodPost:\n\t\tid, err := services.UserCreate(ctx, req.User, repo)\n\t\tif err != nil {\n\t\t\tnewUsersErrorMetric.Inc()\n\t\t\treturn ErrorResponse(c, err)\n\t\t}\n\t\tnewUsersMetric.Inc()\n\t\treturn SuccessResponse(c, nil, &id, http.StatusCreated)\n\tcase http.MethodPut:\n\t\terr := services.UserUpdate(ctx, req.User, req.ID, repo)\n\t\tif err != nil {\n\t\t\treturn ErrorResponse(c, err)\n\t\t}\n\t\treturn SuccessResponse(c, req.User, req.ID, http.StatusOK)\n\t}\n\treturn ErrorResponse(c, errors.BadMethod)\n}", "title": "" }, { "docid": "aae51f02dd6c142956645e71fe106fbc", "score": "0.48997617", "text": "func ChargeAccount(datab *sql.DB, accountID string, chargeAmount float32, vendorID string, date string) {\n\t//(transactionID TEXT PRIMARY KEY, ammount REAL, vendorid TEXT, accountid TEXT, date TEXT)\n\t_, _, _, ballance := GetAccountByAccountID(datab, accountID)\n\tprintln(ballance)\n\tnewBalance := ballance - chargeAmount\n\tprintln(newBalance)\n\tprintln(accountID)\n\tprintln(chargeAmount)\n\tprintln(vendorID)\n\tprintln(date)\n\tUpdateAccount(datab, accountID, newBalance)\n\tstatement, _ := datab.Prepare(\"INSERT INTO transactions (transactionID, accountid, vendorid, ammount, date) VALUES (?,?,?,?,?)\")\n\trslt, _ := statement.Exec(GenUUID(), accountID, vendorID, chargeAmount, date)\n\trowaff, _ := rslt.RowsAffected()\n\tprintln(rowaff)\n\n}", "title": "" }, { "docid": "8ea10425ee63efe54fd4a1bb1de8f3f1", "score": "0.48992935", "text": "func (a *Client) ModifyUser(params *ModifyUserParams, authInfo runtime.ClientAuthInfoWriter) (*ModifyUserOK, error) {\n\t// TODO: Validate the params before sending\n\tif params == nil {\n\t\tparams = NewModifyUserParams()\n\t}\n\n\tresult, err := a.transport.Submit(&runtime.ClientOperation{\n\t\tID: \"ModifyUser\",\n\t\tMethod: \"PUT\",\n\t\tPathPattern: \"/api/billing/{userId}/modify-balance/{amount}\",\n\t\tProducesMediaTypes: []string{\"application/json\", \"text/json\", \"text/plain\"},\n\t\tConsumesMediaTypes: []string{\"application/json\"},\n\t\tSchemes: []string{\"http\"},\n\t\tParams: params,\n\t\tReader: &ModifyUserReader{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.(*ModifyUserOK)\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 ModifyUser: API contract not enforced by server. Client expected to get an error, but got: %T\", result)\n\tpanic(msg)\n}", "title": "" }, { "docid": "b671082e5d428b248298e4955842129b", "score": "0.48962727", "text": "func DeleteUser(c *gin.Context) {\n\tc.JSON(200, gin.H{\n\t\t\"success\": true,\n\t})\n\treturn\n}", "title": "" }, { "docid": "4b1c40cc44e195d2c911434bac006696", "score": "0.48927718", "text": "func (m *DBRepo) DeleteUser(id int) error {\n\tctx, cancel := context.WithTimeout(context.Background(), 3*time.Second)\n\tdefer cancel()\n\n\tstmt := `update users set deleted_at = $1 where id = $2`\n\n\t_, err := m.DB.ExecContext(ctx, stmt, time.Now(), id)\n\tif err != nil {\n\t\tlog.Println(err)\n\t\treturn err\n\t}\n\n\treturn nil\n}", "title": "" }, { "docid": "b46913a7c0009e1ec7a5be4320fa3bbc", "score": "0.48859632", "text": "func (a *UserAPI) deleteUser(rc *wrapper.RequestContext, w http.ResponseWriter, r *http.Request) {\n\tuserID := rc.GetUserID()\n\tif _, err := a.App.DeleteUser(userID); err != nil {\n\t\trc.SetError(\"User object get failed.\", http.StatusInternalServerError)\n\t\treturn\n\t}\n\trc.SetAppResponse(\"{'response': 'OK'}\", http.StatusOK)\n}", "title": "" }, { "docid": "c4d8689fd54f0034509e31d2089be6f9", "score": "0.4859629", "text": "func (tm *TaskDataMapperPostgreSQL) UserDelete(u *User) error {\n\n // if the user has never been saved then no work to here\n if !tm.loaded {\n return nil\n }\n\n // delete this user\n _, err := dbExec(env, \"DELETE FROM users WHERE id = $1\", u.GetId())\n if err != nil {\n err = errors.New(fmt.Sprintf(\"tdmp.Delete(): Unable to remove user %s with id %d: %s\", u.GetEmail(), u.GetId(), err))\n return err\n }\n\n // clean in-memory tm structures\n tm.loaded = false\n return nil\n}", "title": "" }, { "docid": "75f46c349f67d0027d602b267713d50a", "score": "0.48541903", "text": "func (js JsonStorage) UserDelete(w http.ResponseWriter, r *http.Request, userid string) {\n\tif userid != \"\" {\n\t\tJRepo.uLock.Lock()\n\t\tdefer JRepo.uLock.Unlock() \n\t\tif u, ok := JRepo.js.Repo[userid]; ok {\n\t\t\tfor _, v := range u.Groups {\n\t\t\t\tremoveItem(v, userid)\n\t\t\t}\n\t\t\tdelete(JRepo.js.Repo, userid)\n\t\t\tdata.ServerResponse(w, r, http.StatusOK, data.STRING_DATA, \"User \"+userid+\" was sucessfully deleted\")\n\t\t} else {\n\t\t\tdata.ServerResponse(w, r, http.StatusNotFound, data.STRING_DATA, http.StatusText(http.StatusNotFound))\n\t\t}\n\t\t\n\t} else {\n\t\tdata.ServerResponse(w, r, http.StatusBadRequest, data.STRING_DATA, http.StatusText(http.StatusBadRequest))\n\t}\n}", "title": "" }, { "docid": "f6f4c9453eac37eda448f5aa01929e74", "score": "0.48535815", "text": "func (q cmfChargeUserQuery) One(ctx context.Context, exec boil.ContextExecutor) (*CMFChargeUser, error) {\n\to := &CMFChargeUser{}\n\n\tqueries.SetLimit(q.Query, 1)\n\n\terr := q.Bind(ctx, exec, 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, \"models: failed to execute a one query for cmf_charge_user\")\n\t}\n\n\tif err := o.doAfterSelectHooks(ctx, exec); err != nil {\n\t\treturn o, err\n\t}\n\n\treturn o, nil\n}", "title": "" }, { "docid": "c120b31177be76443fb266769806e934", "score": "0.48521185", "text": "func (s *OnboardService) onboardUser(ctx context.Context, req *influxdb.OnboardingRequest, permFn func(orgID, userID platform.ID) []influxdb.Permission) (*influxdb.OnboardingResults, error) {\n\tif req == nil {\n\t\treturn nil, &errors.Error{\n\t\t\tCode: errors.EEmptyValue,\n\t\t\tMsg: \"onboarding failed: no request body provided\",\n\t\t}\n\t}\n\n\tvar missingFields []string\n\tif req.User == \"\" {\n\t\tmissingFields = append(missingFields, \"username\")\n\t}\n\tif req.Org == \"\" {\n\t\tmissingFields = append(missingFields, \"org\")\n\t}\n\tif req.Bucket == \"\" {\n\t\tmissingFields = append(missingFields, \"bucket\")\n\t}\n\tif len(missingFields) > 0 {\n\t\treturn nil, &errors.Error{\n\t\t\tCode: errors.EUnprocessableEntity,\n\t\t\tMsg: fmt.Sprintf(\"onboarding failed: missing required fields [%s]\", strings.Join(missingFields, \",\")),\n\t\t}\n\t}\n\n\tresult := &influxdb.OnboardingResults{}\n\n\t// create a user\n\tuser := &influxdb.User{\n\t\tName: req.User,\n\t\tStatus: influxdb.Active,\n\t}\n\n\tif err := s.service.CreateUser(ctx, user); err != nil {\n\t\treturn nil, err\n\t}\n\n\t// create users password\n\tif req.Password != \"\" {\n\t\tif err := s.service.SetPassword(ctx, user.ID, req.Password); err != nil {\n\t\t\t// Try to clean up.\n\t\t\tif cleanupErr := s.service.DeleteUser(ctx, user.ID); cleanupErr != nil {\n\t\t\t\ts.log.Error(\n\t\t\t\t\t\"couldn't clean up user after failing to set password\",\n\t\t\t\t\tzap.String(\"user\", user.Name),\n\t\t\t\t\tzap.String(\"user_id\", user.ID.String()),\n\t\t\t\t\tzap.Error(cleanupErr),\n\t\t\t\t)\n\t\t\t}\n\t\t\treturn nil, err\n\t\t}\n\t}\n\n\t// set the new user in the context\n\tctx = icontext.SetAuthorizer(ctx, &influxdb.Authorization{\n\t\tUserID: user.ID,\n\t})\n\n\t// create users org\n\torg := &influxdb.Organization{\n\t\tName: req.Org,\n\t}\n\n\tif err := s.service.CreateOrganization(ctx, org); err != nil {\n\t\treturn nil, err\n\t}\n\n\t// create orgs buckets\n\tub := &influxdb.Bucket{\n\t\tOrgID: org.ID,\n\t\tName: req.Bucket,\n\t\tType: influxdb.BucketTypeUser,\n\t\tRetentionPeriod: req.RetentionPeriod(),\n\t}\n\n\tif err := s.service.CreateBucket(ctx, ub); err != nil {\n\t\treturn nil, err\n\t}\n\n\tresult.User = user\n\tresult.Org = org\n\tresult.Bucket = ub\n\n\t// bolt doesn't lock per collection or record so we have to close our transaction\n\t// before we can reach out to the auth service.\n\tresult.Auth = &influxdb.Authorization{\n\t\tDescription: fmt.Sprintf(\"%s's Token\", req.User),\n\t\tPermissions: permFn(result.Org.ID, result.User.ID),\n\t\tToken: req.Token,\n\t\tUserID: result.User.ID,\n\t\tOrgID: result.Org.ID,\n\t}\n\n\treturn result, s.authSvc.CreateAuthorization(ctx, result.Auth)\n}", "title": "" }, { "docid": "a656a280b3fde251f4d8325c6b34c7b8", "score": "0.48434147", "text": "func PostUser(con *sql.DB) echo.HandlerFunc {\n\treturn func(c echo.Context) error {\n\t\tvar user models.ActionUser\n\n\t\tc.Bind(&user)\n\t\tresult, err := models.PostUser(con, user.UserCode, user.Username, user.PrivilegeCode, user.GrpCode, user.Pwd, user.ExpDt, user.NotifyInd, user.HasQiscusAccount, user.AvatarImage, user.DeviceId, user.CreateBy, user.CreateDt)\n\n\t\tif err != nil {\n\t\t\treturn c.JSON(http.StatusCreated, result)\n\t\t} else {\n\t\t\treturn err\n\t\t}\n\t}\n}", "title": "" }, { "docid": "fe70f0e125d47ff18537bf32a71def35", "score": "0.48333016", "text": "func UserDelete(u models.User, m *models.Message) {\n\tm.Code = http.StatusBadRequest\n\tif u.ID <= 0 {\n\t\tm.Message = \"especifique usuario\"\n\t\treturn\n\t}\n\tdb := configuration.GetConnection()\n\tdefer db.Close()\n\ttx := db.Begin()\n\tvar err error\n\tm.Message = \"no se pudo Borrado Usuario\"\n\tfor _, tel := range u.UserTel {\n\t\terr = deleteUserTel(&tel, tx)\n\t\tif err != nil {\n\t\t\ttx.Rollback()\n\t\t\treturn\n\t\t}\n\t}\n\terr = getUser(&u, tx)\n\tif err != nil {\n\t\ttx.Rollback()\n\t\treturn\n\t}\n\terr = deleteUser(&u, tx)\n\tif err != nil {\n\t\ttx.Rollback()\n\t\treturn\n\t}\n\ttx.Commit()\n\tm.Code = http.StatusOK\n\tm.Message = \"Usuario Borrado\"\n\tm.Data = u\n}", "title": "" }, { "docid": "eca3b75dce213216d1c0f5ddeaf390a1", "score": "0.48160392", "text": "func DeleteUser(c *gin.Context) {\r\n\tuserID, userErr := getUserID(c.Param(\"id\"))\r\n\tif userErr != nil {\r\n\t\tc.JSON(userErr.Status, userErr)\r\n\t\treturn\r\n\t}\r\n\r\n\tdeleteErr := services.UserService.DeleteUser(userID)\r\n\r\n\tif deleteErr != nil {\r\n\t\tc.JSON(deleteErr.Status, deleteErr)\r\n\t\treturn\r\n\t}\r\n\tc.JSON(http.StatusOK, gin.H{\r\n\t\t\"status\": 1,\r\n\t\t\"msg\": \"User deleted\",\r\n\t})\r\n\r\n}", "title": "" }, { "docid": "ed1d01aabb5279bd1f225b8c4df407ad", "score": "0.48100686", "text": "func UserDeleteAction(req *http.Request) (interface{}, error) {\n\tparam, err := newUserNameParam(req)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\treturn nil, userDeleteActionProcess(req, param)\n}", "title": "" }, { "docid": "8644879e0b94057057f421586360d75b", "score": "0.47871464", "text": "func (a *app) deleteUser(id string) {\n\ta.db.Exec(\"DELETE FROM credential WHERE id = $1\", id)\n}", "title": "" }, { "docid": "ba8d3ea57d86c298d4cb67cd81fa4bf6", "score": "0.47860584", "text": "func (op *Operations) user(username string) {}", "title": "" }, { "docid": "56a53f7305937525df9abd77408f3a12", "score": "0.47742185", "text": "func (i instrument) DeleteUser(w http.ResponseWriter, r *http.Request) {\n\ti.next.DeleteUser(w, r)\n}", "title": "" }, { "docid": "00ecd87e75e07991510ba718fe4fd8e8", "score": "0.47716573", "text": "func (_Bridge *BridgeCaller) UserNonceMinted(opts *bind.CallOpts, arg0 common.Address) (*big.Int, error) {\n\tvar out []interface{}\n\terr := _Bridge.contract.Call(opts, &out, \"userNonceMinted\", arg0)\n\n\tif err != nil {\n\t\treturn *new(*big.Int), err\n\t}\n\n\tout0 := *abi.ConvertType(out[0], new(*big.Int)).(**big.Int)\n\n\treturn out0, err\n\n}", "title": "" }, { "docid": "09084c7b4669dfbcb96cc2a0c115af76", "score": "0.4768476", "text": "func DeleteUser(c *fiber.Ctx) error {\n\tuserToken := c.Locals(\"user\").(*jwt.Token)\n\tclaims := userToken.Claims.(jwt.MapClaims)\n\tuserO := (claims[\"user\"].(map[string]interface{}))\n\n\tdb := database.DBConn\n\tid := c.Params(\"id\")\n\tuser := new(User)\n\tdb.First(&user, id)\n\n\tif len(user.Role) == 0 {\n\t\tfiberutils.SendJSONMessage(c, \"No User exists\", false, 404)\n\t\treturn nil\n\t}\n\n\tif userO[\"role\"] == \"admin\" || fmt.Sprintf(\"%v\", userO[\"id\"]) == fmt.Sprintf(\"%d\", user.Id) {\n\t\tdb.Delete(&user)\n\t\tfiberutils.SendJSONMessage(c, \"User Successfully Deleted\", true, 200)\n\t} else {\n\t\tfiberutils.SendJSONMessage(c, \"No permission to delete\", false, 401)\n\t}\n\treturn nil\n}", "title": "" }, { "docid": "fedec3d764b384d042b71f36951a0948", "score": "0.47627", "text": "func DeleteUser(c *gin.Context) {\n\tvar user entities.User\n\tid := c.Params.ByName(\"id\")\n\terr := services.DeleteUser(&user, id)\n\tif err != nil {\n\t\tc.AbortWithStatus(http.StatusNotFound)\n\t} else {\n\t\tc.JSON(http.StatusOK, gin.H{\"id\" + id: \"is deleted\"})\n\t}\n}", "title": "" }, { "docid": "cc758a148090338c4ec065e5bab723bc", "score": "0.47622216", "text": "func HandleDeleteUser_v0(w http.ResponseWriter, req *http.Request, ctx domain.IContext) {\n\tr := ctx.GetRendererCtx(req)\n\tdb := ctx.GetDbCtx(req)\n\tparams := mux.Vars(req)\n\tid := params[\"id\"]\n\n\trepo := repositories.UserRepository{db}\n\n\terr := repo.DeleteUser(id)\n\tif err != nil {\n\t\tcontrollers.RenderErrorResponseHelper(w, req, r, err.Error())\n\t\treturn\n\t}\n\n\tr.JSON(w, http.StatusOK, DeleteUserResponse_v0{\n\t\tMessage: \"User deleted\",\n\t\tSuccess: true,\n\t})\n}", "title": "" }, { "docid": "02e6d18c48991d5f6c595018028670a5", "score": "0.4762109", "text": "func (handler *restHandler) deleteUser(w http.ResponseWriter, r *http.Request) {\n\tid := chi.URLParam(r, \"id\")\n\tuser, _ := models.FindPlanetUser(r.Context(), handler.db, id)\n\n\tif user != nil {\n\t\tgroups, err := user.GroupPlanetGroups().All(r.Context(), handler.db)\n\t\tif err != nil {\n\t\t\twriteErr(w, err, http.StatusInternalServerError)\n\t\t}\n\t\tuser.RemoveGroupPlanetGroups(r.Context(), handler.db, groups...)\n\t\t_, err = user.Delete(r.Context(), handler.db)\n\t\tif err != nil {\n\t\t\twriteErr(w, err, http.StatusInternalServerError)\n\t\t\treturn\n\t\t}\n\t\tw.WriteHeader(http.StatusNoContent)\n\t}\n\tw.WriteHeader(http.StatusNotFound)\n}", "title": "" }, { "docid": "d49c10b7ddd863b09b8e9580615a96d3", "score": "0.47595415", "text": "func (_MicroPaySystem *MicroPaySystemFilterer) WatchUserRecharge(opts *bind.WatchOpts, sink chan<- *MicroPaySystemUserRecharge, from []common.Address, to []common.Address) (event.Subscription, error) {\n\n\tvar fromRule []interface{}\n\tfor _, fromItem := range from {\n\t\tfromRule = append(fromRule, fromItem)\n\t}\n\tvar toRule []interface{}\n\tfor _, toItem := range to {\n\t\ttoRule = append(toRule, toItem)\n\t}\n\n\tlogs, sub, err := _MicroPaySystem.contract.WatchLogs(opts, \"UserRecharge\", fromRule, toRule)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\treturn event.NewSubscription(func(quit <-chan struct{}) error {\n\t\tdefer sub.Unsubscribe()\n\t\tfor {\n\t\t\tselect {\n\t\t\tcase log := <-logs:\n\t\t\t\t// New log arrived, parse the event and forward to the user\n\t\t\t\tevent := new(MicroPaySystemUserRecharge)\n\t\t\t\tif err := _MicroPaySystem.contract.UnpackLog(event, \"UserRecharge\", log); err != nil {\n\t\t\t\t\treturn err\n\t\t\t\t}\n\t\t\t\tevent.Raw = log\n\n\t\t\t\tselect {\n\t\t\t\tcase sink <- event:\n\t\t\t\tcase err := <-sub.Err():\n\t\t\t\t\treturn err\n\t\t\t\tcase <-quit:\n\t\t\t\t\treturn nil\n\t\t\t\t}\n\t\t\tcase err := <-sub.Err():\n\t\t\t\treturn err\n\t\t\tcase <-quit:\n\t\t\t\treturn nil\n\t\t\t}\n\t\t}\n\t}), nil\n}", "title": "" }, { "docid": "5abbeb4c6ebaaa7766a69cdd77b4f717", "score": "0.47417092", "text": "func (b *Service) UserPromote(ctx context.Context, BattleID string, UserID string, EventValue string) ([]byte, error, bool) {\n\tleaders, err := b.BattleService.AddFacilitator(BattleID, EventValue)\n\tif err != nil {\n\t\treturn nil, err, false\n\t}\n\tleadersJson, _ := json.Marshal(leaders)\n\n\tmsg := createSocketEvent(\"leaders_updated\", string(leadersJson), \"\")\n\n\treturn msg, nil, false\n}", "title": "" }, { "docid": "d1824f62463479b43d8a625e955acf62", "score": "0.47377393", "text": "func (m *MuninRunner) applyCommandUser(command *exec.Cmd, username string, cache *CredentialCache) error {\n\tuid, err := cache.LookupUser(username)\n\tif err != nil {\n\t\treturn err\n\t}\n\n\tuidInt, _ := strconv.ParseUint(uid, 10, 32)\n\tcommand.SysProcAttr.Credential.Uid = uint32(uidInt)\n\n\tlog.Debug(\"[%s] Uid: %d\", m.name, uint32(uidInt))\n\n\treturn nil\n}", "title": "" }, { "docid": "f240251cdec13a0e05f7ad5b550d9e8b", "score": "0.47358656", "text": "func (s *userssrvc) DeleteUser(ctx context.Context, p *users.DeleteUserPayload) (err error) {\n\ts.logger.Print(\"users.Delete\")\n\tstmt, err := s.DB.Prepare(\"DELETE FROM users WHERE id=?\")\n\tdefer stmt.Close()\n\tif err != nil {\n\t\treturn\n\t}\n\t_, err = stmt.Exec(p.ID)\n\tif err != nil {\n\t\treturn\n\t}\n\ts.logger.Printf(\"DELETE: Id: %s\", p.ID)\n\treturn\n}", "title": "" }, { "docid": "0e5310fb7908c0bd1bdca1c60023ab18", "score": "0.47251523", "text": "func (r *UserPostgres) DeleteUser(id int) error {\n\tlog.Printf(\"DB: Delete user start\")\n\tdefer log.Printf(\"DB: Delete user end\")\n\n\tsql := fmt.Sprintf(\"DELETE FROM %s WHERE id=$1\", usersTable)\n\n\t_, err := r.db.Exec(sql, id)\n\tif err != nil {\n\t\tlog.Printf(\"DB: Delete query: %v\", err)\n\t\treturn err\n\t}\n\treturn nil\n}", "title": "" }, { "docid": "a715c8fa7e785174c6c8eed68b22dd57", "score": "0.4723209", "text": "func (r *Refs) Allow(username string) {\n\tpUser, err := r.GetPendingUserByUsername(username)\n\tif err != nil {\n\t\tmessage := tgbotapi.NewMessage(userAdministrator, \"User @\"+username+\" not found.\")\n\t\t_, err = botInstance.Send(message)\n\t\tcheckError(err)\n\t\treturn\n\t}\n\n\t// compose the \"welcome\" message\n\tmessage := tgbotapi.NewMessage(pUser.ChatID, Accepted)\n\t_, err = botInstance.Send(message)\n\tcheckError(err)\n\n\t// add a new user and delete it from the pending list\n\tr.SaveNewRefCode(pUser)\n\tr.RemovePendingUser(username)\n\n}", "title": "" }, { "docid": "283d5644a98c6d16f220151edb87d208", "score": "0.47223112", "text": "func (uh *UserHandler) DeleteUser(w http.ResponseWriter, r *http.Request, ps httprouter.Params) {\n\tfmt.Println(\" i amabout to delete \")\n\tid, err := strconv.Atoi(ps.ByName(\"id\"))\n\tfmt.Println(id)\n\n\tif err != nil {\n\t\tw.Header().Set(\"Content-Type\", \"application/json\")\n\t\thttp.Error(w, http.StatusText(http.StatusNotFound), http.StatusNotFound)\n\t\treturn\n\t}\n\n\t_, errs := uh.userService.DeleteUser(uint(id))\n\n\tif len(errs) > 0 {\n\t\tw.Header().Set(\"Content-Type\", \"application/json\")\n\t\thttp.Error(w, http.StatusText(http.StatusNotFound), http.StatusNotFound)\n\t\treturn\n\t}\n\n\tw.Header().Set(\"Content-Type\", \"application/json\")\n\tw.WriteHeader(http.StatusNoContent)\n\treturn\n}", "title": "" }, { "docid": "d1e681254ff75ec425dbc4aed0e5711d", "score": "0.47203848", "text": "func DeleteUser(id int64) error {\n\t_, err := RRdb.Prepstmt.DeleteUser.Exec(id)\n\tif err != nil {\n\t\tUlog(\"Error deleting User id=%d error: %v\\n\", id, err)\n\t}\n\treturn err\n}", "title": "" }, { "docid": "bce459fcc154c770030d2dd18066554c", "score": "0.4717898", "text": "func (c *pidsController) Charge(t *kernel.Task, d *kernfs.Dentry, res kernel.CgroupResourceType, value int64) error {\n\tif res != kernel.CgroupResourcePID {\n\t\tpanic(fmt.Sprintf(\"cgroupfs: pids controller invalid resource type %v\", res))\n\t}\n\n\tc.mu.Lock()\n\tdefer c.mu.Unlock()\n\n\t// Negative charge.\n\tif value < 0 {\n\t\tif c.pendingTotal+value < 0 {\n\t\t\tpanic(fmt.Sprintf(\"cgroupfs: pids controller pending pool would be negative if charge was allowed: current pool: %d, proposed charge: %d, path: %q, task: %p\", c.pendingTotal, value, d.FSLocalPath(), t))\n\t\t}\n\n\t\tpending, ok := c.pendingPool[t]\n\t\tif !ok {\n\t\t\tpanic(fmt.Sprintf(\"cgroupfs: pids controller attempted to remove pending charge for Task %p, but task didn't have pending charges, path: %q\", t, d.FSLocalPath()))\n\t\t}\n\t\tif pending+value < 0 {\n\t\t\tpanic(fmt.Sprintf(\"cgroupfs: pids controller attempted to remove pending charge for Task %p, but task didn't have enough pending charges; current charges: %d, proposed charge: %d, path: %q\", t, pending, value, d.FSLocalPath()))\n\n\t\t}\n\n\t\tc.pendingPool[t] += value\n\t\tc.pendingTotal += value\n\t\treturn nil\n\t}\n\n\t// Positive charge.\n\tnew := c.committed + c.pendingTotal + value\n\tif new > c.max {\n\t\tlog.Debugf(\"cgroupfs: pids controller charge denied due to limit: path: %q, requested: %d, current: %d (pending: %v, committed: %v), max: %v\",\n\t\t\td.FSLocalPath(), value, c.committed+c.pendingTotal, c.pendingTotal, c.committed, c.max)\n\t\treturn linuxerr.EAGAIN\n\t}\n\n\tc.pendingPool[t] += value\n\tc.pendingTotal += value\n\treturn nil\n}", "title": "" }, { "docid": "f7c76fcbd7737797b726c0c6a52b604c", "score": "0.4707303", "text": "func (c *Client) RegisterUser(username, orgName, secret, identityTypeUser string) (string, bool) {\n\t// Register the new user\n\tlog.Printf(\"User not found, registering new user: %v\", username)\n\ttestAttributes := []clientMSP.Attribute{\n\t\t{\n\t\t\tName: GenerateRandomID(),\n\t\t\tValue: fmt.Sprintf(\"%s:ecert\", GenerateRandomID()),\n\t\t\tECert: true,\n\t\t},\n\t\t{\n\t\t\tName: GenerateRandomID(),\n\t\t\tValue: fmt.Sprintf(\"%s:ecert\", GenerateRandomID()),\n\t\t\tECert: true,\n\t\t},\n\t}\n\t_, err := c.mc.Register(&clientMSP.RegistrationRequest{\n\t\tName: username,\n\t\tType: identityTypeUser,\n\t\tAttributes: testAttributes,\n\t\tAffiliation: orgName,\n\t\tSecret: secret, // Is ready to get hash?\n\t})\n\tif err != nil {\n\t\treturn username + err.Error(), false\n\t}\n\t//signingIdentity, err := mspClient.GetSigningIdentity(username)\n\t//log.Printf(\"%s: %s\", signingIdentity.Identifier().ID, string(signingIdentity.EnrollmentCertificate()[:]))\n\treturn username + \" register Successfully\", true\n\n}", "title": "" }, { "docid": "5c2f933db5084182dd5539482ca85fc1", "score": "0.47030768", "text": "func DeleteUser(w http.ResponseWriter, r *http.Request) {\n\tuserIDParam := chi.URLParam(r, \"id\") // from a route like /users/{id}\n\tuserID, err := strconv.ParseUint(userIDParam, 10, 32)\n\tif err != nil {\n\t\t_response.Error(w, http.StatusBadRequest, err)\n\t\treturn\n\t}\n\tdb, err := database.Connect()\n\tif err != nil {\n\t\t_response.Error(w, http.StatusUnprocessableEntity, err)\n\t\treturn\n\t}\n\n\trepo := crud.NewRepositoryUsersCRUD(db)\n\n\tfunc(userRepository repository.UserRepository) {\n\t\t_, err := userRepository.Delete(uint32(userID))\n\t\tif err != nil {\n\t\t\t_response.Error(w, http.StatusUnprocessableEntity, err)\n\t\t\treturn\n\t\t}\n\t\tw.Header().Set(\"Entity\", fmt.Sprintf(\"%d\", userID))\n\t\t_response.JSON(w, http.StatusNoContent, \"\")\n\t}(repo)\n}", "title": "" }, { "docid": "a21328acdac2cf16444d0c34ee31fe31", "score": "0.46998632", "text": "func AddCMFChargeUserHook(hookPoint boil.HookPoint, cmfChargeUserHook CMFChargeUserHook) {\n\tswitch hookPoint {\n\tcase boil.BeforeInsertHook:\n\t\tcmfChargeUserBeforeInsertHooks = append(cmfChargeUserBeforeInsertHooks, cmfChargeUserHook)\n\tcase boil.BeforeUpdateHook:\n\t\tcmfChargeUserBeforeUpdateHooks = append(cmfChargeUserBeforeUpdateHooks, cmfChargeUserHook)\n\tcase boil.BeforeDeleteHook:\n\t\tcmfChargeUserBeforeDeleteHooks = append(cmfChargeUserBeforeDeleteHooks, cmfChargeUserHook)\n\tcase boil.BeforeUpsertHook:\n\t\tcmfChargeUserBeforeUpsertHooks = append(cmfChargeUserBeforeUpsertHooks, cmfChargeUserHook)\n\tcase boil.AfterInsertHook:\n\t\tcmfChargeUserAfterInsertHooks = append(cmfChargeUserAfterInsertHooks, cmfChargeUserHook)\n\tcase boil.AfterSelectHook:\n\t\tcmfChargeUserAfterSelectHooks = append(cmfChargeUserAfterSelectHooks, cmfChargeUserHook)\n\tcase boil.AfterUpdateHook:\n\t\tcmfChargeUserAfterUpdateHooks = append(cmfChargeUserAfterUpdateHooks, cmfChargeUserHook)\n\tcase boil.AfterDeleteHook:\n\t\tcmfChargeUserAfterDeleteHooks = append(cmfChargeUserAfterDeleteHooks, cmfChargeUserHook)\n\tcase boil.AfterUpsertHook:\n\t\tcmfChargeUserAfterUpsertHooks = append(cmfChargeUserAfterUpsertHooks, cmfChargeUserHook)\n\t}\n}", "title": "" }, { "docid": "b97908e2b480cfb3a0e8795eeff2c8ea", "score": "0.46997997", "text": "func (server *Server) DeleteUser(c *gin.Context) {\n\tvar w http.ResponseWriter = c.Writer\n\tvar r *http.Request = c.Request\n\n\tuser := models.User{}\n\n\tuid, err := strconv.ParseUint(c.Param(\"id\"), 10, 32)\n\tif err != nil {\n\t\tutils.ERROR(w, http.StatusBadRequest, err)\n\t\treturn\n\t}\n\ttokenID, err := auth.ExtractTokenID(r)\n\tif err != nil {\n\t\tutils.ERROR(w, http.StatusUnauthorized, errors.New(\"Unauthorized\"))\n\t\treturn\n\t}\n\tif tokenID != 0 && tokenID != uint32(uid) {\n\t\tutils.ERROR(w, http.StatusUnauthorized, errors.New(http.StatusText(http.StatusUnauthorized)))\n\t\treturn\n\t}\n\t_, err = user.DeleteUser(server.DB, uint32(uid))\n\tif err != nil {\n\t\tutils.ERROR(w, http.StatusInternalServerError, err)\n\t\treturn\n\t}\n\tw.Header().Set(\"Entity\", fmt.Sprintf(\"%d\", uid))\n\tutils.JSON(w, http.StatusNoContent, \"\")\n}", "title": "" }, { "docid": "fa2cd89105c88bf292336f46632a338d", "score": "0.46983775", "text": "func DeleteUser(c *gin.Context) {\n\n\tuserID := c.Param(\"id\")\n\n\tif bson.IsObjectIdHex(userID) != true {\n\t\tmessage := \"Invalid User ID \"\n\t\tc.JSON(http.StatusBadRequest, gin.H{\"status\": http.StatusBadRequest, \"message\": message})\n\t\treturn\n\t}\n\n\terror := db.Collection.RemoveId(bson.ObjectIdHex(userID))\n\n\tif error != nil {\n\t\tmessage := \"User \" + error.Error()\n\t\tc.JSON(http.StatusNotFound, gin.H{\"status\": http.StatusNotFound, \"message\": message})\n\t\treturn\n\t}\n\n\tc.JSON(http.StatusOK, gin.H{\"status\": http.StatusOK, \"message\": \"User deleted successfully!\"})\n}", "title": "" }, { "docid": "95d9820ff69660c45e9b9997770c9a91", "score": "0.4694128", "text": "func (s *confirmServer) SendConfirmUser(w http.ResponseWriter, r *http.Request) {\n\tuid, err := rest.GetUserID(r)\n\tif err != nil {\n\t\ts.ResponseCode(w, http.StatusBadRequest, err)\n\t\treturn\n\t}\n\tu, err := s.GetAuthenticatedUser(uid)\n\tif err != nil {\n\t\ts.ResponseCode(w, http.StatusUnauthorized, err)\n\t\treturn\n\t}\n\tctx := rest.FromRequest(r)\n\terr = s.API.SendConfirmUser(ctx, u.ID)\n\tif errors.Is(err, config.ErrRateLimitExceeded) {\n\t\ts.ResponseCode(w, http.StatusTooEarly, err)\n\t\treturn\n\t}\n\ts.ResponseError(w, err)\n}", "title": "" }, { "docid": "9107d49b6859f1318eb5ba974529f489", "score": "0.4690353", "text": "func DeleteUser(w http.ResponseWriter, r *http.Request) {\n\tuserID, err := getUserID(r)\n\tif err != nil {\n\t\tresponses.Error(w, http.StatusBadRequest, err)\n\t\treturn\n\t}\n\n\tuserIDfromToken, err := authentication.GetUserID(r)\n\tif err != nil {\n\t\tresponses.Error(w, http.StatusUnauthorized, err)\n\t\treturn\n\t}\n\n\tif userID != userIDfromToken {\n\t\tresponses.Error(w, http.StatusForbidden, errors.New(\"Invalid user\"))\n\t\treturn\n\t}\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.NewUsersRepository(db)\n\tif err = repository.Delete(userID); err != nil {\n\t\tresponses.Error(w, http.StatusInternalServerError, err)\n\t\treturn\n\t}\n\n\tresponses.JSON(w, http.StatusNoContent, nil)\n}", "title": "" }, { "docid": "207c3977eeaec4f2f1bbb468522e88e6", "score": "0.46900728", "text": "func DeleteUser(c *gin.Context) {\n\tf := li.GetFile()\n\tvar err error\n\tvar standardLogger = li.NewLogger()\n\tstandardLogger.SetOutput(f)\n\tuserID, err := strconv.ParseUint(c.Param(\"id\"), 10, 64)\n\tif err != nil {\n\t\tc.JSON(http.StatusBadRequest, gin.H{\"error\": constants.Errors().InvalidID})\n\t\treturn\n\t}\n\tuser, err := users.GetUserWithID(uint64(userID))\n\tif err == gorm.ErrRecordNotFound {\n\t\tc.JSON(http.StatusBadRequest, gin.H{\"error\": constants.Errors().IDNotInRecords})\n\t\treturn\n\t} else if err != nil {\n\t\tc.JSON(http.StatusInternalServerError, gin.H{\"error\": constants.Errors().InternalError})\n\t\tstandardLogger.InternalServerError(err.Error())\n\t\treturn\n\t}\n\n\terr = users.DeleteUser(user)\n\tif err != nil {\n\t\tc.JSON(http.StatusInternalServerError, gin.H{\"error\": constants.Errors().InternalError})\n\t\tstandardLogger.InternalServerError(err.Error())\n\t\treturn\n\t}\n\tlogs.AddLogs(constants.InfoLog, fmt.Sprintf(\"User with email %s deleted\", user.Email))\n\tc.JSON(http.StatusOK, gin.H{\"status\": \"ok\"})\n}", "title": "" }, { "docid": "df4acba77bc9a06c9fc49c05ce6b5096", "score": "0.46852854", "text": "func DeleteUser(params users.DeleteUserParams) model.User {\n\tdb := dbpkg.Connect()\n\tdefer db.Close()\n\n\tvar user model.User\n\tuser.ID = params.ID\n\n\tdb.Delete(&user)\n\n\treturn user\n\n}", "title": "" }, { "docid": "57e3f95bd42002a5c879ede26c7ac33d", "score": "0.46811235", "text": "func (c *Client) UserDelete(passkey string) error {\n\tresp, err := h.DoRequest(c.client, \"DELETE\", c.u(fmt.Sprintf(\"/user/pk/%s\", passkey)), nil, c.headers())\n\tif err != nil {\n\t\treturn err\n\t}\n\tif resp.StatusCode != http.StatusOK {\n\t\treturn readStatus(resp)\n\t}\n\tlog.Debugf(\"User deleted successfully: %s\", passkey)\n\treturn nil\n}", "title": "" }, { "docid": "7b9029d45140e151330df0a807a43a5f", "score": "0.46796772", "text": "func PostTheUser(w http.ResponseWriter, r *http.Request) {\n\t//var posted bool\n\tvar errs []string\n\tvar gocqlUUID gocql.UUID\n\n\tuser, errs := ProcessUserFrom(r)\n\n\tif len(errs) == 0 && Auth.AuthCheck(w, r) {\n\t\tfmt.Println(Cass.LogTime() + \", Creating an user..\")\n\t\tgocqlUUID = gocql.TimeUUID()\n\t\t// cassandra writing\n\t\tif err := Cass.Session.Query(`\n INSERT INTO users (id, name, lastname, email, birthyear, city ) VALUES (?, ?, ?, ?, ?, ?)`,\n\t\t\tgocqlUUID, user.Name, user.LastName, user.Email, user.BirthYear, user.City).Exec(); err != nil {\n\t\t\terrs = append(errs, err.Error())\n\t\t} else {\n\t\t\t//\tposted = true\n\t\t\tjson.NewEncoder(w).Encode(GetNewUser{ID: gocqlUUID})\n\t\t\tfmt.Println(Cass.LogTime()+\", Created user with id: \", gocqlUUID)\n\t\t}\n\t} else if !Auth.AuthCheck(w, r) {\n\t\tjson.NewEncoder(w).Encode(ResponseStatus{Status: \"Unauthorized\", Code: 401})\n\t\tfmt.Println(Cass.LogTime() + \", Post User Request - Unauthorized\")\n\t\treturn\n\t} else {\n\t\tfmt.Println(Cass.LogTime()+\", Something went amiss: \", errs)\n\t\tjson.NewEncoder(w).Encode(ErrorResponse{Errors: errs})\n\t}\n}", "title": "" }, { "docid": "547daa76a3dfc24d9cdd6f52385743ad", "score": "0.46795726", "text": "func DeleteUser(username string) {\n\tsession := CF(\"delete-user\", username, \"-f\")\n\tEventually(session).Should(Exit(0))\n}", "title": "" }, { "docid": "b4d284b575d837d6d030e6f4380b711d", "score": "0.46788982", "text": "func (u *RootResolver) DeleteUser(ctx context.Context, args *struct{ ID graphql.ID }) (*string, error) {\n\tid, _ := strconv.ParseInt(string(args.ID), 10, 32)\n\n\tif _, err := u.db.DeleteUser(uint(id)); err != nil {\n\t\tlogger.Warn.Printf(\"user with id %d could not be deleted\", id)\n\t\treturn nil, fmt.Errorf(\"user with id %d could not be deleted\", id)\n\n\t}\n\n\tmessage := fmt.Sprintf(\"User wit id %d has been deleted\", id)\n\n\treturn &message, nil\n}", "title": "" }, { "docid": "e25eec89b921c9fe5706d5cc40b32e72", "score": "0.46735933", "text": "func (u UserResource) Delete(id string, r api2go.Request) (api2go.Responder, error) {\n\n\t// metrics collection. Need to be careful to capture return code before returning\n\tstart := time.Now()\n\tcode := http.StatusInternalServerError\n\tdefer userDeleteDurationSeconds.WithLabelValues(fmt.Sprintf(\"%d\", code)).Observe(time.Since(start).Seconds())\n\n\trequestingUser, err := getRequestUser(r, u.TokenVerifier, u.UserStorage)\n\tif err != nil {\n\t\tcode = http.StatusForbidden\n\t\treturn &Response{}, api2go.NewHTTPError(fmt.Errorf(\"error deleting user, %s\", err), http.StatusText(code), code)\n\t}\n\n\ttargetUser, err := u.UserStorage.GetOne(id, r.Context)\n\tswitch err {\n\tcase nil:\n\t\tbreak\n\tcase storage.ErrNotFound:\n\t\tcode = http.StatusBadRequest\n\t\treturn &Response{}, api2go.NewHTTPError(\n\t\t\tfmt.Errorf(\"error deleting user, target user %s not found\", id),\n\t\t\tfmt.Sprintf(\"error retrieving target user, %s\", err),\n\t\t\tcode,\n\t\t)\n\tdefault:\n\t\tcode = http.StatusInternalServerError\n\t\treturn &Response{}, api2go.NewHTTPError(\n\t\t\tfmt.Errorf(\"error deleting user, error retrieving target user %s, %s\", id, err),\n\t\t\tfmt.Sprintf(\"error retrieving target user, %s\", err),\n\t\t\tcode,\n\t\t)\n\t}\n\n\t// not allowing firebase users to be deleted. This might be added in future, but we would need to cascade the delete so it won't be a straight forward operation\n\tif targetUser.FirebaseUID != \"\" {\n\t\tcode = http.StatusForbidden\n\t\treturn &Response{}, api2go.NewHTTPError(\n\t\t\tfmt.Errorf(\"error deleting user, user %s attempting to delete firebase user %s\", requestingUser.GetID(), targetUser.GetID()),\n\t\t\t\"unable to delete users linked to Firebase\",\n\t\t\tcode,\n\t\t)\n\t}\n\n\tcarShare, err := u.CarShareStorage.GetOne(targetUser.LinkedCarShareID, r.Context)\n\tif err != nil {\n\t\tcode = http.StatusForbidden\n\t\treturn &Response{}, api2go.NewHTTPError(\n\t\t\tfmt.Errorf(\"error deleting user, error retrieving target user %s linked car share %s, %s\", targetUser.GetID(), targetUser.LinkedCarShareID, err),\n\t\t\tfmt.Sprintf(\"error retrieving target user linked car share, %s\", err),\n\t\t\tcode,\n\t\t)\n\t}\n\n\tif !isAdmin(requestingUser, carShare) {\n\t\tcode = http.StatusForbidden\n\t\treturn &Response{}, api2go.NewHTTPError(\n\t\t\tfmt.Errorf(\"error deleting user, user %s attempting to delete user %s linked to car share %s, but isn't an admin\", requestingUser.GetID(), targetUser.GetID(), targetUser.LinkedCarShareID),\n\t\t\tfmt.Sprintf(\"only admins for car share %s can delete user %s\", targetUser.LinkedCarShareID, targetUser.GetID()),\n\t\t\tcode,\n\t\t)\n\t}\n\n\tfor i, memberID := range carShare.MemberIDs {\n\t\tif memberID == targetUser.GetID() {\n\t\t\tcarShare.MemberIDs = append(carShare.MemberIDs[:i], carShare.MemberIDs[i+1:]...)\n\t\t\terr = u.CarShareStorage.Update(carShare, r.Context)\n\t\t\tif err != nil {\n\t\t\t\tcode = http.StatusInternalServerError\n\t\t\t\treturn &Response{}, api2go.NewHTTPError(\n\t\t\t\t\tfmt.Errorf(\"error deleting user, error removing user %s from carshare %s member list, %v\", targetUser.GetID(), carShare.GetID(), err),\n\t\t\t\t\tfmt.Sprintf(\"error removing user %s from carshare %s member list, %v\", targetUser.GetID(), carShare.GetID(), err),\n\t\t\t\t\tcode,\n\t\t\t\t)\n\t\t\t}\n\t\t\tbreak\n\t\t}\n\t}\n\n\terr = u.UserStorage.Delete(id, r.Context)\n\tswitch err {\n\tcase nil:\n\t\tbreak\n\tcase storage.ErrNotFound:\n\t\tcode = http.StatusNotFound\n\t\treturn &Response{}, api2go.NewHTTPError(fmt.Errorf(\"unable to find trip %s to user\", id), http.StatusText(code), code)\n\tdefault:\n\t\terrMsg := fmt.Sprintf(\"Error occurred while deleting user %s\", id)\n\t\tcode = http.StatusInternalServerError\n\t\treturn &Response{}, api2go.NewHTTPError(fmt.Errorf(\"%s, %s\", errMsg, err), errMsg, code)\n\t}\n\n\tcode = http.StatusOK\n\treturn &Response{Code: code}, err\n}", "title": "" }, { "docid": "831aefae6b09cbc50256f13dffebfe56", "score": "0.4672113", "text": "func user(\n\tctx context.Context,\n\twg *sync.WaitGroup,\n\trc *Client,\n\tchainContext signature.Context,\n\tsigner signature.Signer,\n) {\n\tlogger := logger.With(\"side\", \"user\")\n\n\tdefer func() {\n\t\tlogger.Info(\"done\")\n\t\twg.Done()\n\t}()\n\n\t// Subscribe to blocks.\n\tblkCh, blkSub, err := rc.WatchBlocks(ctx)\n\tif err != nil {\n\t\tlogger.Error(\"failed to subscribe to runtime blocks\",\n\t\t\t\"err\", err,\n\t\t)\n\t\treturn\n\t}\n\tdefer blkSub.Close()\n\n\t// Get nonce.\n\tnonce, err := rc.Accounts.Nonce(ctx, client.RoundLatest, types.NewAddress(signer.Public()))\n\tif err != nil {\n\t\tlogger.Error(\"failed to fetch account nonce\",\n\t\t\t\"err\", err,\n\t\t)\n\t\treturn\n\t}\n\n\t// Submit Lock.\n\tlogger.Info(\"submitting lock transaction\")\n\ttx := types.NewTransaction(&types.Fee{\n\t\tAmount: types.NewBaseUnits(*quantity.NewFromUint64(4), types.NativeDenomination),\n\t\tGas: 2,\n\t}, \"bridge.Lock\", Lock{\n\t\tTarget: NewRemoteAddressFromHex(\"0000000000000000000000000000000000000000\"),\n\t\tAmount: types.NewBaseUnits(*quantity.NewFromUint64(10), types.NativeDenomination),\n\t})\n\ttx.AppendAuthSignature(signer.Public(), nonce)\n\ttb := tx.PrepareForSigning()\n\tif err = tb.AppendSign(chainContext, signer); err != nil {\n\t\tlogger.Error(\"failed to sign lock transaction\",\n\t\t\t\"err\", err,\n\t\t)\n\t\treturn\n\t}\n\traw, err := rc.SubmitTx(ctx, tb.UnverifiedTransaction())\n\tif err != nil {\n\t\tlogger.Error(\"failed to submit lock transaction\",\n\t\t\t\"err\", err,\n\t\t)\n\t\treturn\n\t}\n\n\t// Deserialize call result and extract id.\n\tvar lockResult LockResult\n\tif err = cbor.Unmarshal(raw, &lockResult); err != nil {\n\t\tlogger.Error(\"failed to unmarshal lock result\",\n\t\t\t\"err\", err,\n\t\t)\n\t\treturn\n\t}\n\tlockID := lockResult.ID\n\n\t// Wait for a WitnessesSigned event.\n\tfor {\n\t\tselect {\n\t\tcase <-ctx.Done():\n\t\t\treturn\n\t\tcase blk, ok := <-blkCh:\n\t\t\tif !ok {\n\t\t\t\treturn\n\t\t\t}\n\t\t\tlogger.Debug(\"seen new block\",\n\t\t\t\t\"round\", blk.Block.Header.Round,\n\t\t\t)\n\n\t\t\tevents, err := rc.GetEvents(ctx, blk.Block.Header.Round)\n\t\t\tif err != nil {\n\t\t\t\tlogger.Error(\"failed to get events\",\n\t\t\t\t\t\"err\", err,\n\t\t\t\t\t\"round\", blk.Block.Header.Round,\n\t\t\t\t)\n\t\t\t\treturn\n\t\t\t}\n\n\t\t\tfor _, ev := range events {\n\t\t\t\t// TODO: Have wrappers for converting events.\n\t\t\t\tlogger.Debug(\"got event\",\n\t\t\t\t\t\"key\", base64.StdEncoding.EncodeToString(ev.Key),\n\t\t\t\t\t\"value\", base64.StdEncoding.EncodeToString(ev.Value),\n\t\t\t\t)\n\n\t\t\t\tswitch {\n\t\t\t\tcase WitnessesSignedEventKey.IsEqual(ev.Key):\n\t\t\t\t\tvar witnessEv WitnessesSignedEvent\n\t\t\t\t\tif err = cbor.Unmarshal(ev.Value, &witnessEv); err != nil {\n\t\t\t\t\t\tlogger.Error(\"failed to unmarshal witnesses signed event\",\n\t\t\t\t\t\t\t\"err\", err,\n\t\t\t\t\t\t)\n\t\t\t\t\t\tcontinue\n\t\t\t\t\t}\n\n\t\t\t\t\tlogger.Debug(\"got witnesses signed event\",\n\t\t\t\t\t\t\"id\", witnessEv.ID,\n\t\t\t\t\t)\n\n\t\t\t\t\tif witnessEv.ID == lockID {\n\t\t\t\t\t\t// Our lock has been witnessed.\n\t\t\t\t\t\t// TODO: Take the signatures and submit to the other side.\n\t\t\t\t\t\tlogger.Info(\"got witness signatures\",\n\t\t\t\t\t\t\t\"sigs\", witnessEv.Signatures,\n\t\t\t\t\t\t)\n\t\t\t\t\t\treturn\n\t\t\t\t\t}\n\t\t\t\tdefault:\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n}", "title": "" }, { "docid": "74db443ff8dd627f365df717823b5c67", "score": "0.46638137", "text": "func (a *UsersApiService) LockUserExecute(r ApiLockUserRequest) (*_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)\n\n\tlocalBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, \"UsersApiService.LockUser\")\n\tif err != nil {\n\t\treturn nil, GenericOpenAPIError{error: err.Error()}\n\t}\n\n\tlocalVarPath := localBasePath + \"/v1/users/{guid}/lock\"\n\tlocalVarPath = strings.Replace(localVarPath, \"{\"+\"guid\"+\"}\", _neturl.PathEscape(parameterToString(r.guid, \"\")), -1)\n\n\tlocalVarHeaderParams := make(map[string]string)\n\tlocalVarQueryParams := _neturl.Values{}\n\tlocalVarFormParams := _neturl.Values{}\n\tif r.request == nil {\n\t\treturn nil, reportError(\"request 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.request\n\tif r.ctx != nil {\n\t\t// API Key Authentication\n\t\tif auth, ok := r.ctx.Value(ContextAPIKeys).(map[string]APIKey); ok {\n\t\t\tif apiKey, ok := auth[\"apiKey\"]; ok {\n\t\t\t\tvar key string\n\t\t\t\tif apiKey.Prefix != \"\" {\n\t\t\t\t\tkey = apiKey.Prefix + \" \" + apiKey.Key\n\t\t\t\t} else {\n\t\t\t\t\tkey = apiKey.Key\n\t\t\t\t}\n\t\t\t\tlocalVarHeaderParams[\"Authorization\"] = key\n\t\t\t}\n\t\t}\n\t}\n\treq, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\tlocalVarHTTPResponse, err := a.client.callAPI(req)\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\tlocalVarHTTPResponse.Body = _ioutil.NopCloser(bytes.NewBuffer(localVarBody))\n\tif err != nil {\n\t\treturn 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 APIError\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 localVarHTTPResponse, newErr\n\t\t\t}\n\t\t\tnewErr.model = v\n\t\t\treturn localVarHTTPResponse, newErr\n\t\t}\n\t\tif localVarHTTPResponse.StatusCode == 401 {\n\t\t\tvar v APIError\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 localVarHTTPResponse, newErr\n\t\t\t}\n\t\t\tnewErr.model = v\n\t\t\treturn localVarHTTPResponse, newErr\n\t\t}\n\t\tif localVarHTTPResponse.StatusCode == 403 {\n\t\t\tvar v APIError\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 localVarHTTPResponse, newErr\n\t\t\t}\n\t\t\tnewErr.model = v\n\t\t\treturn localVarHTTPResponse, newErr\n\t\t}\n\t\tif localVarHTTPResponse.StatusCode == 404 {\n\t\t\tvar v APIError\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 localVarHTTPResponse, newErr\n\t\t\t}\n\t\t\tnewErr.model = v\n\t\t\treturn localVarHTTPResponse, newErr\n\t\t}\n\t\t\tvar v APIError\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 localVarHTTPResponse, newErr\n\t\t\t}\n\t\t\tnewErr.model = v\n\t\treturn localVarHTTPResponse, newErr\n\t}\n\n\treturn localVarHTTPResponse, nil\n}", "title": "" }, { "docid": "7859460369d0d82ead58c4e211e7cc6f", "score": "0.46627623", "text": "func (cmd *RegisterUserCmd) Do(ctx context.Context, conn *grpc.ClientConn) {\n\n\tclient := usercontroller.NewUserClient(conn)\n\n\tif *cmd.name == \"\" || *cmd.password == \"\" {\n\t\tlog.Fatal(\"Account, name and password parameters are required\")\n\t}\n\n\trequest := usercontroller.UserRegisterRequest{\n\t\tName: *cmd.name,\n\t\tPassword: *cmd.password,\n\t}\n\n\tresp, err := client.RegisterUser(ctx, &request)\n\n\tif err != nil {\n\t\tlog.Fatalf(\"Error registering user %v\", err)\n\t}\n\n\tlog.Println(\"User ID: \", resp.Id)\n}", "title": "" }, { "docid": "039c218c3d0bf4739400f88a717f3b31", "score": "0.46609166", "text": "func DeleteUser() (err error) {\n\tlogger.Println(\"[userEntity] try performing delete user request\")\n\tvar code int\n\tif code, err = request(\"DELETE\", \"/api/user/self\", nil, nil); err != nil {\n\t\treturn\n\t}\n\tif code == http.StatusOK {\n\t\treturn\n\t}\n\terr = fmt.Errorf(\"%d\", code)\n\treturn\n}", "title": "" }, { "docid": "a539820abe1ca1bb6ab51800508a9f3f", "score": "0.46583733", "text": "func DeleteUser(c *gin.Context) {\n\tuserID, userErr := getUserID(c.Param(\"user_id\"))\n\tif userErr != nil {\n\t\tc.JSON(http.StatusNotFound, userErr)\n\t\treturn\n\t}\n\n\tif deleteErr := services.UserService.DeleteUser(userID); deleteErr != nil {\n\t\tc.JSON(deleteErr.Status, deleteErr)\n\t\treturn\n\t}\n\n\tc.JSON(http.StatusOK, map[string]string{\"status\": \"deleted\"})\n}", "title": "" }, { "docid": "253bd4cc388610d1e4221e71f744c935", "score": "0.46527746", "text": "func (c Client) DeleteUser(userId string) error {\n\turl := c.Config.APIURL + UsersAPIV1BasePath + fmt.Sprintf(\"/%s\", userId)\n\trequest, err := signer.CreateJSONRequest(http.MethodDelete, url, nil)\n\tif err != nil {\n\t\treturn err\n\t}\n\treturn c.Do(request, nil)\n}", "title": "" }, { "docid": "4ed0012010e0c39fd5237ca3c21cac6f", "score": "0.46522993", "text": "func UserHandler(w http.ResponseWriter, r *http.Request) {\n\n\tif r.Method == http.MethodPost {\n\t\tvar user types.User\n\t\tjson.NewDecoder(r.Body).Decode(&user)\n\n\t\tif user.Name == \"\" {\n\t\t\tw.WriteHeader(http.StatusBadRequest)\n\t\t\tw.Write([]byte(\"The json was malformed\"))\n\t\t\treturn\n\t\t}\n\n\t\tret, err := crud.Insert(\"users\", user, w)\n\t\tif err != nil {\n\t\t\treturn\n\t\t}\n\n\t\tjson.NewEncoder(w).Encode(ret)\n\n\t}\n\n\tif r.Method == http.MethodGet {\n\t\tparams := mux.Vars(r)\n\t\tID := params[\"id\"]\n\t\tLoanID := params[\"loanId\"]\n\n\t\trawUser, err := crud.GetOne(\"users\", ID, w)\n\t\tif err != nil {\n\t\t\treturn\n\t\t}\n\n\t\tuser := types.User{}\n\t\tjson.Unmarshal(rawUser, &user)\n\n\t\tuserLoan := user.Loan[LoanID]\n\t\tasched := userLoan.CalculateASchedule()\n\n\t\taschedRaw, _ := json.MarshalIndent(asched, \"\", \" \")\n\t\tw.Write(aschedRaw)\n\n\t}\n}", "title": "" }, { "docid": "2ec367918903e2060d5460d315975e26", "score": "0.46488705", "text": "func (h *UserHandler) UserDelete(c *gin.Context) {\n\n\tid := c.Param(\"id\")\n\n\tdata, statusCode, err := h.UserUsecase.Delete(id)\n\n\tif data == nil || err != nil {\n\t\tresponse = helpers.Result{Status: \"Warning\", StatusCode: statusCode, Message: helpers.MessageErr(err)}\n\t\th.Status = statusCode\n\t\th.Result = gin.H{\n\t\t\t\"result\": response,\n\t\t}\n\t\thelpers.ReturnHandler(h.Status, err)\n\t} else {\n\t\tresponse = helpers.Result{Status: \"Sukses\", StatusCode: http.StatusOK, Message: \"Data User Berhasil Dihapus\", Data: data}\n\t\th.Status = http.StatusOK\n\t\th.Result = gin.H{\n\t\t\t\"result\": response,\n\t\t}\n\t}\n\n\tc.JSON(h.Status, h.Result)\n}", "title": "" }, { "docid": "0ff8ed198ac054fbacd77a41503acfbb", "score": "0.46455076", "text": "func DeleteUserHandler(req events.APIGatewayProxyRequest) (events.APIGatewayProxyResponse, error) {\n\tid := req.PathParameters[\"ID\"]\n\terr := user.DeleteUser(id)\n\tif err != nil {\n\t\terrorBody := ErrorBody{aws.String(err.Error())}\n\t\treturn apiResponse(http.StatusBadRequest, errorBody)\n\t}\n\treturn apiResponse(http.StatusOK, nil)\n}", "title": "" }, { "docid": "386a8f2a2f18a97e0e4bd44502787557", "score": "0.4641647", "text": "func DeleteUser(user models.User, id string) (res structs.Response, err error) {\n\tconfig.DB.Where(\"id = ?\", id).Delete(&user)\n\tres.Message = \"user delete success\"\n\treturn\n}", "title": "" }, { "docid": "cf8205a918af558644609a7afe9197c1", "score": "0.46277508", "text": "func disableUser(configInfo *ConfigInfo, user string) (err error) {\n\terr = checkAuth(configInfo)\n if err != nil {\n\t\treturn\n }\n\tpatchRequest := PatchRequest{}\n\tpatchOp := PatchOp{\n\t\tOp: \"replace\",\n\t\tPath: \"password\",\n\t\tValue: \"{SHA256}passwordDisabled\",\n\t}\n\tpatchRequest.Operations = append(patchRequest.Operations, patchOp)\n\tpatchRequest.Schemas = append(patchRequest.Schemas, \"urn:ietf:params:scim:api:messages:2.0:PatchOp\")\n\tpatchBody, err := json.Marshal(patchRequest)\n\tif err != nil {\n\t\tfmt.Fprintf(os.Stderr, \"Received error %s marshalling patchRequest\\n%v\\n\", err, patchRequest)\n\t\tfailures++\n\t\treturn\n\t}\n\tcompleteURL := \"https://\" + configInfo.tenantHostname + \"/v2.0/Users/\" + user\n\tif configInfo.logLevel > 0 {\n\t\tfmt.Printf(\"Calling %s\\n\", completeURL)\n\t}\n\tclient := &http.Client{\n\t\tTimeout: time.Second * 200,\n\t}\n\treq, err := http.NewRequest(\"PATCH\", completeURL, bytes.NewBuffer([]byte(patchBody)))\n\tif err != nil {\n\t\tfmt.Fprintf(os.Stderr, \"Received error %s creating new request from URL %s\\n\", err, completeURL)\n\t\tfailures++\n\t\treturn\n\t}\n\treq.Header.Add(\"Authorization\", \"Bearer \"+configInfo.accessToken)\n\treq.Header.Add(\"Accept\", \"application/scim+json\")\n\treq.Header.Add(\"Content-Type\", \"application/scim+json\")\n\tresp, err := client.Do(req)\n\tif err != nil {\n\t\tfmt.Fprintf(os.Stderr, \"Received error %s from server\\n%s\\n\", err, configInfo.tenantHostname)\n\t\tfailures++\n\t\treturn\n\t}\n\tdefer resp.Body.Close()\n\n\tif configInfo.logLevel > 0 {\n\t\tfmt.Printf(\"Received %d from %s\\n\", resp.StatusCode, configInfo.tenantHostname)\n\t}\n\n\tcontents, err := ioutil.ReadAll(resp.Body)\n\tif err != nil {\n\t\tfmt.Fprintf(os.Stderr, \"Received error %s from server\\n%s\\n\", err, configInfo.tenantHostname)\n\t\tfailures++\n\t\treturn\n\t}\n\n\tif resp.StatusCode != 200 {\n\t\tfmt.Fprintf(os.Stderr, \"Received response code %d from server %s\\n%s\\n\", resp.StatusCode, configInfo.tenantHostname, contents)\n\t\tfailures++\n\t\treturn\n\t}\n\n\tif configInfo.logLevel > 1 {\n\t\tfmt.Printf(\"%s\\n\", contents)\n\t}\n\tsuccesses++\n\treturn\n}", "title": "" }, { "docid": "48c4b3c923eece0831bd694fed873f63", "score": "0.46258426", "text": "func DeleteUser(iq IQ, username string) error {\n\tendpoint := fmt.Sprintf(restUsers, username)\n\tif resp, err := iq.Del(endpoint); err != nil && resp.StatusCode != http.StatusNoContent {\n\t\treturn err\n\t}\n\treturn nil\n}", "title": "" }, { "docid": "24847a05b950a92102819216b4a5588b", "score": "0.46220347", "text": "func (_HoQuStorage *HoQuStorageTransactor) SetUser(opts *bind.TransactOpts, id [16]byte, role string, ownerAddress common.Address, kycLevel uint8, pubKey string, status uint8) (*types.Transaction, error) {\n\treturn _HoQuStorage.contract.Transact(opts, \"setUser\", id, role, ownerAddress, kycLevel, pubKey, status)\n}", "title": "" }, { "docid": "cda6047333adf4f007bfb94deebbbc90", "score": "0.4620636", "text": "func DeleteUser(w http.ResponseWriter, r *http.Request) {\n\tlog.Print(\"DeleteUser called\")\n\tparams := mux.Vars(r)\n\tuserid, _ := strconv.Atoi(params[\"userid\"])\n\terr := business.DeleteUser(userid)\n\n\tif err != nil {\n\t\tw.WriteHeader(http.StatusNotFound)\n\t\treturn\n\t}\n\tw.WriteHeader(http.StatusOK)\n}", "title": "" }, { "docid": "29c23fb5a759cd47d01ac9acc758702d", "score": "0.46128076", "text": "func (h *Handler) DeleteUser(targetID uint) error {\n\tif row := h.DB.Where(\"user_id = ?\", targetID).Delete(models.User{}).RowsAffected; row == 0 {\n\t\treturn errors.New(\"User does not exist in DB\")\n\t}\n\treturn nil\n}", "title": "" }, { "docid": "2aee0c76a1bd9a1fada63f10e2876579", "score": "0.46123344", "text": "func (c *client) DeleteUser(id int64) error {\n\tlogrus.Tracef(\"Deleting user %d from the database\", id)\n\n\t// send query to the database\n\treturn c.Database.\n\t\tTable(constants.TableUser).\n\t\tExec(c.DML.UserService.Delete, id).Error\n}", "title": "" }, { "docid": "d5e5a402906c8ff9134b552c87f8c11c", "score": "0.46112072", "text": "func DeleteUser(db *sql.DB, userID string) error {\n\tvar err error\n\tvar ex *sql.Stmt\n\n\tex, err = db.Prepare(\"DELETE FROM memefy.user WHERE user_id = ?\")\n\t_, err = ex.Exec(userID)\n\tif err != nil {\n\t\terr := errors.New(\"failed to make a DB query\")\n\t\treturn err\n\t}\n\treturn nil\n}", "title": "" }, { "docid": "d6729e1d3bf86d1fee161e3c19974a05", "score": "0.46087515", "text": "func (dal *impl) DeleteUser(tx util.Transaction, userID string) error {\n\t_, err := tx.Exec(deleteUser, userID)\n\tif err != nil {\n\t\treturn errors.WithStack(err)\n\t}\n\treturn nil\n}", "title": "" }, { "docid": "93a1477e0646adf14a7639bedc15565d", "score": "0.46067232", "text": "func (client Client) DeleteUser(params UserWhereUniqueInput) *UserExec {\n\n\tstack := make([]Instruction, 0)\n\tvar args []GraphQLArg\n\n\targs = append(args, GraphQLArg{\n\t\tName: \"where\",\n\t\tKey: \"where\",\n\t\tTypeName: \"UserWhereUniqueInput!\",\n\t\tValue: params,\n\t})\n\n\tstack = append(stack, Instruction{\n\t\tName: \"deleteUser\",\n\t\tField: GraphQLField{\n\t\t\tName: \"deleteUser\",\n\t\t\tTypeName: \"User\",\n\t\t\tTypeFields: []string{\"id\", \"name\"},\n\t\t},\n\t\tOperation: \"mutation\",\n\t\tArgs: args,\n\t})\n\n\treturn &UserExec{\n\t\tclient: client,\n\t\tstack: stack,\n\t}\n}", "title": "" }, { "docid": "22512964ec05787812706db1b29c0d51", "score": "0.46048135", "text": "func (h *V1Handler) DeleteUser(clients *common.ClientContainer, ID int) error {\n\terr := clients.Grafana.DoLogon()\n\tif err != nil {\n\t\tv1handlers.LoginErrorCheck(err)\n\t\treturn err\n\t}\n\terr = clients.Grafana.DeleteUser(ID)\n\n\treturn err\n}", "title": "" }, { "docid": "71004bf1ac9ea0f325af1872b31b8c95", "score": "0.46020886", "text": "func DeleteUser(w http.ResponseWriter, r *http.Request, db *sql.DB) {\n\trespondWithError(w, http.StatusInternalServerError, fail, \"Not implemented\")\n}", "title": "" }, { "docid": "c2153dfe6ebe3fefe3bf55298562506c", "score": "0.46006954", "text": "func HandleConfirmUser_v0(w http.ResponseWriter, req *http.Request, ctx domain.IContext) {\n\tr := ctx.GetRendererCtx(req)\n\tdb := ctx.GetDbCtx(req)\n\tparams := mux.Vars(req)\n\tid := params[\"id\"]\n\tcode := req.FormValue(\"code\")\n\n\trepo := repositories.UserRepository{db}\n\tuser, err := repo.GetUserById(id)\n\tif err != nil {\n\t\tcontrollers.RenderErrorResponseHelper(w, req, r, err.Error())\n\t\treturn\n\t}\n\n\tif user.Status != domain.StatusPending {\n\t\tcontrollers.RenderErrorResponseHelper(w, req, r, \"User not pending confirmation\")\n\t\treturn\n\t}\n\n\tif !user.IsCodeVerified(code) {\n\t\tcontrollers.RenderErrorResponseHelper(w, req, r, \"Invalid code\")\n\t\treturn\n\t}\n\n\t// set user status to `active`\n\tuser, err = repo.UpdateUser(id, &domain.User{\n\t\tStatus: domain.StatusActive,\n\t\tRoles: domain.Roles{domain.RoleUser},\n\t})\n\tif err != nil {\n\t\tcontrollers.RenderErrorResponseHelper(w, req, r, err.Error())\n\t\treturn\n\t}\n\n\t// run a post-confirmation hook\n\thooks := ctx.GetControllerHooksMapCtx(req)\n\tif hooks.PostConfirmUserHook != nil {\n\t\terr = hooks.PostConfirmUserHook(req, ctx, &domain.PostUserConfirmationHookPayload{\n\t\t\tUser: user,\n\t\t})\n\t\tif err != nil {\n\t\t\tcontrollers.RenderErrorResponseHelper(w, req, r, err.Error())\n\t\t\treturn\n\t\t}\n\t}\n\n\tr.JSON(w, http.StatusOK, ConfirmUserResponse_v0{\n\t\tCode: code,\n\t\tUser: *user,\n\t\tMessage: \"User confirmed\",\n\t\tSuccess: true,\n\t})\n}", "title": "" }, { "docid": "87efacc97cbcaaacab966f0016c25304", "score": "0.45970032", "text": "func (r *repo) DeleteUser(id string) error {\n\t_, err := r.db.NamedExec(`delete from users where _id=:id`, map[string]interface{}{\n\t\t\"id\": id,\n\t})\n\tif err != nil {\n\t\treturn err\n\t}\n\n\treturn nil\n}", "title": "" }, { "docid": "d8677d51477772ca5bec5541f4197e6c", "score": "0.4596238", "text": "func (uc UserController) DeleteUser(w http.ResponseWriter, r *http.Request, p httprouter.Params) {\n\tid := p.ByName(\"id\")\n\n\tif !bson.IsObjectIdHex(id) {\n\t\tw.WriteHeader(404)\n\t\treturn\n\t}\n\n\toid := bson.ObjectIdHex(id)\n\n\t// Delete user\n\t//if err := uc.session.DB(\"go-web-dev-db\").C(\"users\").RemoveId(oid); err != nil {\n\t//\tw.WriteHeader(404)\n\t//\treturn\n\t//}\n\n\tw.WriteHeader(http.StatusOK) // 200\n\tfmt.Fprint(w, \"Deleted user\", oid, \"\\n\")\n}", "title": "" }, { "docid": "1d0fc0c6bc4e9dfbb7cbab60d5205155", "score": "0.45925596", "text": "func (b CassandraAuthBackend) DeleteUser(username string) error {\n session := b.session\n //Probably a better way to do this in one query\n if _, err := b.User(username); err != nil {\n if err = session.Query(`DELETE from users WHERE username = ?`, username).Exec(); err != nil {\n log.Fatal(\"DeleteUser: \"+err.Error())\n return err\n }\n } else {\n return ErrDeleteNull\n }\n return nil\n}", "title": "" }, { "docid": "dfb9cb6626b22708008315211260ec1d", "score": "0.45900953", "text": "func (ln *LocalNode) UserRegistrationHandler(ctx context.Context, r *protocol.Request) protocol.Response {\n\t// store the user's public key in the DHT\n\treturn protocol.Response{}\n}", "title": "" }, { "docid": "7ffc2d31a6eb232573e4df92d7e16752", "score": "0.45872033", "text": "func deleteUser(ctx context.Context, tx *Tx, id int) error {\n\t// Verify object exists.\n\tif user, err := findUserByID(ctx, tx, id); err != nil {\n\t\treturn err\n\t} else if user.ID != wtf.UserIDFromContext(ctx) {\n\t\treturn wtf.Errorf(wtf.EUNAUTHORIZED, \"You are not allowed to delete this user.\")\n\t}\n\n\t// Remove row from database.\n\tif _, err := tx.ExecContext(ctx, `DELETE FROM users WHERE id = ?`, id); err != nil {\n\t\treturn FormatError(err)\n\t}\n\treturn nil\n}", "title": "" }, { "docid": "675a5a74eb40795b2486cf8364f66a0e", "score": "0.45845604", "text": "func CheckUser(username string, log *common.TransactionLogInfo) (bool, error) {\n\n\ttoken, err := GetAuthToken(log)\n\tif err != nil {\n\t\treturn false, err\n\t}\n\n\tendpoint := config.Setting.App.GameURI\n\tendpoint = fmt.Sprintf(\"%s/account/check-created-account/%s/%s\", endpoint, token, username)\n\n\trequestLog := *log\n\trequestLog.Body = \"\"\n\trequestLog.Input = \"\"\n\trequestLog.URL = endpoint\n\trequestLog.Method = \"GET\"\n\trequestLog.LogWriter()\n\n\tresp, err := http.Get(endpoint)\n\tif err != nil {\n\t\treturn false, err\n\t}\n\n\tdefer resp.Body.Close()\n\n\tbodyResp, err := ioutil.ReadAll(resp.Body)\n\tif err != nil {\n\t\treturn false, err\n\t}\n\n\trespLog := *log\n\trequestLog.Body = \"\"\n\trequestLog.Input = \"\"\n\trespLog.Output = string(bodyResp)\n\trespLog.Method = fmt.Sprint(resp.StatusCode)\n\trespLog.LogWriter()\n\n\tif resp.StatusCode != http.StatusOK {\n\t\treturn false, fmt.Errorf(\"check user fail : %s\", string(bodyResp))\n\t}\n\n\tout := OutCabal{}\n\terr = json.Unmarshal(bodyResp, &out)\n\tif err != nil {\n\t\treturn false, fmt.Errorf(\"check user unmarshal fail : %s\", err.Error())\n\t}\n\n\tif out.Result != 0 {\n\t\treturn false, nil\n\t}\n\n\treturn true, nil\n}", "title": "" }, { "docid": "99cd24ddc913e219fc5dda1d2e4d4686", "score": "0.4582768", "text": "func (u *UserServiceImpl) DeleteUser(context.Context, *pb.DeleteUserRequest) (*pb.DeleteUserResponse, error) {\n\treturn nil, errors.New(\"implement me\")\n}", "title": "" }, { "docid": "07daff35e538b218d9d7b4f19ebb3074", "score": "0.4577181", "text": "func charge() (int, error) {\n\t// Now\n\tnow, err := readInt(path(\"energy_now\"))\n\tif err != nil {\n\t\treturn 0, err\n\t}\n\n\t// Full\n\tfull, err := readInt(path(\"energy_full\"))\n\tif err != nil {\n\t\treturn 0, err\n\t}\n\treturn 100 * now / full, nil\n}", "title": "" }, { "docid": "efcba2cab52a4d7a885ee0366a56b53b", "score": "0.4575025", "text": "func (a *UsersApiService) DeleteUser(ctx context.Context, userGUID string) (*http.Response, error) {\n\tvar (\n\t\tlocalVarHttpMethod = strings.ToUpper(\"Delete\")\n\t\tlocalVarPostBody interface{}\n\t\tlocalVarFileName string\n\t\tlocalVarFileBytes []byte\n\t)\n\n\t// create path and map variables\n\tlocalVarPath := a.client.cfg.BasePath + \"/users/{user_guid}\"\n\tlocalVarPath = strings.Replace(localVarPath, \"{\"+\"user_guid\"+\"}\", fmt.Sprintf(\"%v\", userGUID), -1)\n\n\tlocalVarHeaderParams := make(map[string]string)\n\tlocalVarQueryParams := url.Values{}\n\tlocalVarFormParams := url.Values{}\n\n\t// to determine the Content-Type header\n\tlocalVarHttpContentTypes := []string{}\n\n\t// set Content-Type header\n\tlocalVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes)\n\tif localVarHttpContentType != \"\" {\n\t\tlocalVarHeaderParams[\"Content-Type\"] = localVarHttpContentType\n\t}\n\n\t// to determine the Accept header\n\tlocalVarHttpHeaderAccepts := []string{\"application/vnd.mx.atrium.v1+json\"}\n\n\t// set Accept header\n\tlocalVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts)\n\tif localVarHttpHeaderAccept != \"\" {\n\t\tlocalVarHeaderParams[\"Accept\"] = localVarHttpHeaderAccept\n\t}\n\tif ctx != nil {\n\t\t// API Key Authentication\n\t\tif auth, ok := ctx.Value(ContextAPIKey).(APIKey); ok {\n\t\t\tvar key string\n\t\t\tif auth.Prefix != \"\" {\n\t\t\t\tkey = auth.Prefix + \" \" + auth.Key\n\t\t\t} else {\n\t\t\t\tkey = auth.Key\n\t\t\t}\n\t\t\tlocalVarHeaderParams[\"MX-API-Key\"] = key\n\n\t\t}\n\t}\n\tif ctx != nil {\n\t\t// API Key Authentication\n\t\tif auth, ok := ctx.Value(ContextAPIKey).(APIKey); ok {\n\t\t\tvar key string\n\t\t\tif auth.Prefix != \"\" {\n\t\t\t\tkey = auth.Prefix + \" \" + auth.Key\n\t\t\t} else {\n\t\t\t\tkey = auth.Key\n\t\t\t}\n\t\t\tlocalVarHeaderParams[\"MX-Client-ID\"] = key\n\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 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 := GenericError{\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": "174324516570c182d2b57ded095a8614", "score": "0.45685908", "text": "func (_YieldFarmContinuous *YieldFarmContinuousCaller) UserMultiplier(opts *bind.CallOpts, arg0 common.Address) (*big.Int, error) {\n\tvar out []interface{}\n\terr := _YieldFarmContinuous.contract.Call(opts, &out, \"userMultiplier\", arg0)\n\n\tif err != nil {\n\t\treturn *new(*big.Int), err\n\t}\n\n\tout0 := *abi.ConvertType(out[0], new(*big.Int)).(**big.Int)\n\n\treturn out0, err\n\n}", "title": "" } ]
fb6942ad013008d5297f1b9e499b8114
Deprecated: Use Type_Constraint_Resolution.ProtoReflect.Descriptor instead.
[ { "docid": "9d3b0e13f2885e91a62f7bfc43813747", "score": "0.70165354", "text": "func (*Type_Constraint_Resolution) Descriptor() ([]byte, []int) {\n\treturn file_sysl_proto_rawDescGZIP(), []int{17, 8, 2}\n}", "title": "" } ]
[ { "docid": "ec87761622169bce2e4f9546cd4ccb33", "score": "0.70842135", "text": "func (*Type_Constraint) Descriptor() ([]byte, []int) {\n\treturn file_sysl_proto_rawDescGZIP(), []int{17, 8}\n}", "title": "" }, { "docid": "00f843f67d55dd9fc99bfea2451bb759", "score": "0.6858384", "text": "func (*DynamicParameterConstraints) Descriptor() ([]byte, []int) {\n\treturn file_envoy_service_discovery_v3_discovery_proto_rawDescGZIP(), []int{6}\n}", "title": "" }, { "docid": "f99bc3a98ae6a6f9b9b4ba6ae969f895", "score": "0.67760247", "text": "func (*Constraint) Descriptor() ([]byte, []int) {\n\treturn file_graphik_proto_rawDescGZIP(), []int{24}\n}", "title": "" }, { "docid": "a952e2ea8b48b3b3c03f423eb7c19707", "score": "0.6767746", "text": "func (*ServerReflectionRequest) Descriptor() ([]byte, []int) {\n\treturn file_grpc_reflection_v1alpha_reflection_proto_rawDescGZIP(), []int{0}\n}", "title": "" }, { "docid": "080cfd30af17d030518ffc44915ae847", "score": "0.67277884", "text": "func (*Constraint) Descriptor() ([]byte, []int) {\n\treturn file_pkg_api_v1_scdpb_scd_proto_rawDescGZIP(), []int{6}\n}", "title": "" }, { "docid": "880bfd5a9507c7430f9ab027c7a68f30", "score": "0.66894716", "text": "func (*DynamicParameterConstraints_ConstraintList) Descriptor() ([]byte, []int) {\n\treturn file_envoy_service_discovery_v3_discovery_proto_rawDescGZIP(), []int{6, 1}\n}", "title": "" }, { "docid": "6e6f3342fff7e08cc52854e1783c93fc", "score": "0.6666417", "text": "func (*ExtensionRequest) Descriptor() ([]byte, []int) {\n\treturn file_grpc_reflection_v1alpha_reflection_proto_rawDescGZIP(), []int{1}\n}", "title": "" }, { "docid": "f13e537b89ec54b28c391102d901b994", "score": "0.66103464", "text": "func (*GroupDTO_ConstraintInfo) Descriptor() ([]byte, []int) {\n\treturn file_CommonDTO_proto_rawDescGZIP(), []int{5, 2}\n}", "title": "" }, { "docid": "0de9901f1047b87212d6b6a04197ec90", "score": "0.6584551", "text": "func (*ConstraintDetails) Descriptor() ([]byte, []int) {\n\treturn file_pkg_api_v1_scdpb_scd_proto_rawDescGZIP(), []int{7}\n}", "title": "" }, { "docid": "7aa36ceec04bd293f152c0ca1e0877db", "score": "0.65339947", "text": "func (*Constraints) Descriptor() ([]byte, []int) {\n\treturn file_graphik_proto_rawDescGZIP(), []int{25}\n}", "title": "" }, { "docid": "a53d2b2c5489d17bf041b07f2d7d5a42", "score": "0.65246755", "text": "func (*ConstraintReference) Descriptor() ([]byte, []int) {\n\treturn file_pkg_api_v1_scdpb_scd_proto_rawDescGZIP(), []int{9}\n}", "title": "" }, { "docid": "79a82df97ccfcf4c26acd4f2496757d8", "score": "0.65222055", "text": "func (*DistributionConstraints) Descriptor() ([]byte, []int) {\n\treturn file_tensorflow_metadata_proto_v0_schema_proto_rawDescGZIP(), []int{9}\n}", "title": "" }, { "docid": "a3b4ad1b103247bd69c466bab353cdc1", "score": "0.6505742", "text": "func (x *fastReflection_MsgCreateValidator) Descriptor() protoreflect.MessageDescriptor {\n\treturn md_MsgCreateValidator\n}", "title": "" }, { "docid": "e6e2dc682f3310dd414d249e0b0c3d71", "score": "0.6490846", "text": "func (*UpdateConstraintReferenceRequest) Descriptor() ([]byte, []int) {\n\treturn file_pkg_api_v1_scdpb_scd_proto_rawDescGZIP(), []int{66}\n}", "title": "" }, { "docid": "557e7f8b4e02cb7b53cabf61ae3c4e51", "score": "0.64854366", "text": "func (m *MethodDescriptor) AsProtoreflectDescriptor() *desc.MethodDescriptor {\n\treturn m.MethodDescriptor\n}", "title": "" }, { "docid": "41081dfe386fc5ea46595c289931f495", "score": "0.64792556", "text": "func (*Listener_DeprecatedV1) Descriptor() ([]byte, []int) {\n\treturn file_envoy_config_listener_v4alpha_listener_proto_rawDescGZIP(), []int{1, 0}\n}", "title": "" }, { "docid": "c188a6af16882844ef211c8a0b821e22", "score": "0.6474508", "text": "func (*GetConstraintReferenceRequest) Descriptor() ([]byte, []int) {\n\treturn file_pkg_api_v1_scdpb_scd_proto_rawDescGZIP(), []int{22}\n}", "title": "" }, { "docid": "94e77ffb131778ff83d4b77e8db43ba5", "score": "0.6458771", "text": "func (*DynamicParameterConstraints_SingleConstraint) Descriptor() ([]byte, []int) {\n\treturn file_envoy_service_discovery_v3_discovery_proto_rawDescGZIP(), []int{6, 0}\n}", "title": "" }, { "docid": "9394905936b1a76827a57709aa81f5ec", "score": "0.6458555", "text": "func (*Validator) Descriptor() ([]byte, []int) {\n\treturn file_core_abci_tendermint_types_types_proto_rawDescGZIP(), []int{14}\n}", "title": "" }, { "docid": "0dc818443edf2e4caa0f842f93fa6b97", "score": "0.6433405", "text": "func (*FileDescriptorResponse) Descriptor() ([]byte, []int) {\n\treturn file_grpc_reflection_v1alpha_reflection_proto_rawDescGZIP(), []int{3}\n}", "title": "" }, { "docid": "d06e13c12e19611479538a6976d4b30e", "score": "0.64163476", "text": "func (GroupDTO_ConstraintType) EnumDescriptor() ([]byte, []int) {\n\treturn file_CommonDTO_proto_rawDescGZIP(), []int{5, 1}\n}", "title": "" }, { "docid": "8ed0cada97dd5e080e56087f98c9dab7", "score": "0.64101756", "text": "func (*Type_Foreign) Descriptor() ([]byte, []int) {\n\treturn file_sysl_proto_rawDescGZIP(), []int{17, 7}\n}", "title": "" }, { "docid": "b23da3023513f4f4aa73e8265f024efe", "score": "0.6408297", "text": "func (*DeprecatedMessage) Descriptor() ([]byte, []int) {\n\treturn file_cmd_protoc_gen_go_peptide_testdata_comments_deprecated_proto_rawDescGZIP(), []int{0}\n}", "title": "" }, { "docid": "69730ee6939acaab3e36e06a8c3a637c", "score": "0.6395969", "text": "func (x *fastReflection_MsgEditValidator) Descriptor() protoreflect.MessageDescriptor {\n\treturn md_MsgEditValidator\n}", "title": "" }, { "docid": "2cf397ff83ece74192cd84524c054297", "score": "0.63915956", "text": "func (*PermissionChange) Descriptor() ([]byte, []int) {\n\treturn edgelq_iam_proto_v1alpha_permission_change_proto_rawDescGZIP(), []int{0}\n}", "title": "" }, { "docid": "902075e7024a87fcecd96d5cea322df1", "score": "0.63896996", "text": "func (*NamedSchema) Descriptor() ([]byte, []int) {\n\treturn file_discovery_discovery_proto_rawDescGZIP(), []int{11}\n}", "title": "" }, { "docid": "cd15ee33f87bfa094be99e9554bab918", "score": "0.63746387", "text": "func (*DeltaDiscoveryRequest) Descriptor() ([]byte, []int) {\n\treturn file_envoy_service_discovery_v3_discovery_proto_rawDescGZIP(), []int{4}\n}", "title": "" }, { "docid": "fdbc293fa324cfcb746d46ccf3ffc192", "score": "0.6360799", "text": "func (*RequiredMessageTypeRequest) Descriptor() ([]byte, []int) {\n\treturn file_examples_internal_proto_examplepb_a_bit_of_everything_proto_rawDescGZIP(), []int{13}\n}", "title": "" }, { "docid": "b81a9853121b26c01e9bd74f36a5d999", "score": "0.6351528", "text": "func (*DatasetConstraints) Descriptor() ([]byte, []int) {\n\treturn file_tensorflow_metadata_proto_v0_schema_proto_rawDescGZIP(), []int{4}\n}", "title": "" }, { "docid": "df5187a7a50b46904deb2b27230469c0", "score": "0.63436604", "text": "func (x *fastReflection_MsgUpdateParams) Descriptor() protoreflect.MessageDescriptor {\n\treturn md_MsgUpdateParams\n}", "title": "" }, { "docid": "22300d9e09a07a4cbc7641487e2e36a8", "score": "0.63338083", "text": "func (*AbstractTypeResolver) Descriptor() ([]byte, []int) {\n\treturn file_github_com_solo_io_gloo_projects_gloo_api_external_envoy_extensions_graphql_graphql_proto_rawDescGZIP(), []int{7}\n}", "title": "" }, { "docid": "c556f421b032bf83bcf2017a31267ecb", "score": "0.6319251", "text": "func (*Schema) Descriptor() ([]byte, []int) {\n\treturn file_discovery_discovery_proto_rawDescGZIP(), []int{22}\n}", "title": "" }, { "docid": "77c57f0324b8f90488d2cf3f6fc25a97", "score": "0.6318246", "text": "func (*CreateConstraintReferenceRequest) Descriptor() ([]byte, []int) {\n\treturn file_pkg_api_v1_scdpb_scd_proto_rawDescGZIP(), []int{10}\n}", "title": "" }, { "docid": "2714c75ed34cd9cf5cae069d3ac0187b", "score": "0.6317919", "text": "func (*StructDomain) Descriptor() ([]byte, []int) {\n\treturn file_tensorflow_metadata_proto_v0_schema_proto_rawDescGZIP(), []int{12}\n}", "title": "" }, { "docid": "5023950c81474a26865c1b1d589ac246", "score": "0.63114077", "text": "func (x *fastReflection_AllowedClassCreator) Descriptor() protoreflect.MessageDescriptor {\n\treturn md_AllowedClassCreator\n}", "title": "" }, { "docid": "df910ba746c2bbb11fc15bf8d70891a9", "score": "0.6302147", "text": "func (*StringDomain) Descriptor() ([]byte, []int) {\n\treturn file_tensorflow_metadata_proto_v0_schema_proto_rawDescGZIP(), []int{13}\n}", "title": "" }, { "docid": "f617a0ac6bc9274ff7693dec19b0e400", "score": "0.6299822", "text": "func (*OperationMetadata) Descriptor() ([]byte, []int) {\n\treturn file_google_cloud_domains_v1beta1_domains_proto_rawDescGZIP(), []int{26}\n}", "title": "" }, { "docid": "dab52baf94215899a42e1bf9145ce160", "score": "0.628687", "text": "func (*QueryConstraintReferencesRequest) Descriptor() ([]byte, []int) {\n\treturn file_pkg_api_v1_scdpb_scd_proto_rawDescGZIP(), []int{50}\n}", "title": "" }, { "docid": "d8c2984ee56d5e33fb6e6000a8847d8c", "score": "0.6286599", "text": "func (*ConstraintViolation) Descriptor() ([]byte, []int) {\n\treturn file_validation_proto_rawDescGZIP(), []int{0}\n}", "title": "" }, { "docid": "817feba5a88fd613834519631f1f968b", "score": "0.62761265", "text": "func (*ChangeConstraintReferenceResponse) Descriptor() ([]byte, []int) {\n\treturn file_pkg_api_v1_scdpb_scd_proto_rawDescGZIP(), []int{3}\n}", "title": "" }, { "docid": "3703e8c029722a09ea779ee60c4ef278", "score": "0.62628204", "text": "func (x *fastReflection_SayHelloRequest) Descriptor() protoreflect.MessageDescriptor {\n\treturn md_SayHelloRequest\n}", "title": "" }, { "docid": "a350ad1ac139d9f4d1f45de47896a2ec", "score": "0.6262035", "text": "func (x *fastReflection_MsgCreateValidatorResponse) Descriptor() protoreflect.MessageDescriptor {\n\treturn md_MsgCreateValidatorResponse\n}", "title": "" }, { "docid": "b8d0737050dca72a7fc3115c5ddd4962", "score": "0.6257852", "text": "func (*ProtoFileDescriptorRequest) Descriptor() ([]byte, []int) {\n\treturn file_ligato_generic_meta_proto_rawDescGZIP(), []int{1}\n}", "title": "" }, { "docid": "6fb94b218917303822997fb169427003", "score": "0.625715", "text": "func (*SimpleValidator) Descriptor() ([]byte, []int) {\n\treturn file_core_abci_tendermint_types_types_proto_rawDescGZIP(), []int{15}\n}", "title": "" }, { "docid": "034e6db756cb5385fb0ad17b7f4682b0", "score": "0.62498266", "text": "func (x *fastReflection_ProtocolVersion) Descriptor() protoreflect.MessageDescriptor {\n\treturn md_ProtocolVersion\n}", "title": "" }, { "docid": "034e6db756cb5385fb0ad17b7f4682b0", "score": "0.62498266", "text": "func (x *fastReflection_ProtocolVersion) Descriptor() protoreflect.MessageDescriptor {\n\treturn md_ProtocolVersion\n}", "title": "" }, { "docid": "dd56f0153a185150519bd651c2ccd270", "score": "0.6245749", "text": "func (*ServerReflectionResponse) Descriptor() ([]byte, []int) {\n\treturn file_grpc_reflection_v1alpha_reflection_proto_rawDescGZIP(), []int{2}\n}", "title": "" }, { "docid": "1a50778a9bb2f091a7a4ea4eab068204", "score": "0.62405604", "text": "func (*PermissionChange_Removed) Descriptor() ([]byte, []int) {\n\treturn edgelq_iam_proto_v1alpha_permission_change_proto_rawDescGZIP(), []int{0, 3}\n}", "title": "" }, { "docid": "4de17869d8e22b870a4721d89048c6c2", "score": "0.6240171", "text": "func (*Resolution) Descriptor() ([]byte, []int) {\n\treturn file_github_com_solo_io_gloo_projects_gloo_api_external_envoy_extensions_graphql_graphql_proto_rawDescGZIP(), []int{10}\n}", "title": "" }, { "docid": "49b5a04be7e5fc78508e8af61a074490", "score": "0.62339", "text": "func (*UpdateRuleReq) Descriptor() ([]byte, []int) {\n\treturn file_external_iam_v2_request_rules_proto_rawDescGZIP(), []int{1}\n}", "title": "" }, { "docid": "e4701394fe9e27e222ee253abafda792", "score": "0.62333244", "text": "func (*ConstraintProviderAssociation) Descriptor() ([]byte, []int) {\n\treturn file_pkg_api_v1_scdpb_scd_proto_rawDescGZIP(), []int{8}\n}", "title": "" }, { "docid": "2d6846a621e4ab91e57e58cf5062fb70", "score": "0.6231863", "text": "func (x *fastReflection_MsgCancelUnbondingDelegation) Descriptor() protoreflect.MessageDescriptor {\n\treturn md_MsgCancelUnbondingDelegation\n}", "title": "" }, { "docid": "19d573e5717ae4dc55b280f0462fb8ea", "score": "0.62316406", "text": "func (x *fastReflection_MsgUndelegate) Descriptor() protoreflect.MessageDescriptor {\n\treturn md_MsgUndelegate\n}", "title": "" }, { "docid": "29e75a6f5a9534fa7c3e9f665bc256f3", "score": "0.6228785", "text": "func (*ToBeExtended) Descriptor() ([]byte, []int) {\n\treturn file_reflection_grpc_testing_proto2_proto_rawDescGZIP(), []int{0}\n}", "title": "" }, { "docid": "cad7771ba83cff42e27f48c5923e8de6", "score": "0.62263703", "text": "func (*ValueSetDeprecated) Descriptor() ([]byte, []int) {\n\treturn file_proto_google_fhir_proto_r4_core_extensions_proto_rawDescGZIP(), []int{365}\n}", "title": "" }, { "docid": "f135d45091375c0f6761567561631b5e", "score": "0.6216959", "text": "func (*TypeReq) Descriptor() ([]byte, []int) {\n\treturn file_proto_racklot_racklot_proto_rawDescGZIP(), []int{34}\n}", "title": "" }, { "docid": "eb2bc170bd5a2b63ef7ce1984a3398d3", "score": "0.6216698", "text": "func (x *fastReflection_PeerInfo) Descriptor() protoreflect.MessageDescriptor {\n\treturn md_PeerInfo\n}", "title": "" }, { "docid": "64f9703e5514ef774a03dc3f0fe0d96a", "score": "0.62080485", "text": "func (*ValueSetDeprecated) Descriptor() ([]byte, []int) {\n\treturn file_proto_google_fhir_proto_r5_core_extensions_proto_rawDescGZIP(), []int{385}\n}", "title": "" }, { "docid": "935cbe0b45869d90c6632e77041a201a", "score": "0.62025136", "text": "func (x *fastReflection_NetAddress) Descriptor() protoreflect.MessageDescriptor {\n\treturn md_NetAddress\n}", "title": "" }, { "docid": "6f25dade2d8c1a247de3431b8289c9cc", "score": "0.6196321", "text": "func (*Validator) Descriptor() ([]byte, []int) {\n\treturn file_go_chromium_org_luci_common_proto_config_service_config_proto_rawDescGZIP(), []int{12}\n}", "title": "" }, { "docid": "6f25dade2d8c1a247de3431b8289c9cc", "score": "0.6196321", "text": "func (*Validator) Descriptor() ([]byte, []int) {\n\treturn file_go_chromium_org_luci_common_proto_config_service_config_proto_rawDescGZIP(), []int{12}\n}", "title": "" }, { "docid": "64297800e00b596599a8f54205ef8d2b", "score": "0.61934423", "text": "func (*ValidateResourceTypeConfig_Request) Descriptor() ([]byte, []int) {\n\treturn file_tfplugin5_proto_rawDescGZIP(), []int{9, 0}\n}", "title": "" }, { "docid": "a7330013919184d8b6362d2693262330", "score": "0.6191698", "text": "func (*GetConstraintReferenceResponse) Descriptor() ([]byte, []int) {\n\treturn file_pkg_api_v1_scdpb_scd_proto_rawDescGZIP(), []int{23}\n}", "title": "" }, { "docid": "90d289f11784b6f52648b81dd5948fe0", "score": "0.61880606", "text": "func (*PermissionChange_Added) Descriptor() ([]byte, []int) {\n\treturn edgelq_iam_proto_v1alpha_permission_change_proto_rawDescGZIP(), []int{0, 0}\n}", "title": "" }, { "docid": "2e1221aa43aed6afb9693fac1810f4ca", "score": "0.6186944", "text": "func (*GetProviderSchema_Request) Descriptor() ([]byte, []int) {\n\treturn file_tfplugin5_proto_rawDescGZIP(), []int{6, 0}\n}", "title": "" }, { "docid": "b1e1405b3b43aa2e375d667dc3f45ff3", "score": "0.61845887", "text": "func (*Type_Constraint_Range) Descriptor() ([]byte, []int) {\n\treturn file_sysl_proto_rawDescGZIP(), []int{17, 8, 0}\n}", "title": "" }, { "docid": "a93b01c44fa609d77eb110d8b968ad15", "score": "0.6184425", "text": "func (*ValidationP3Wrappers) Descriptor() ([]byte, []int) {\n\treturn file_validation_proto3_proto_rawDescGZIP(), []int{2}\n}", "title": "" }, { "docid": "37c32c80c8beafbd686aedea65589155", "score": "0.61792123", "text": "func (*DiscoveryRequest) Descriptor() ([]byte, []int) {\n\treturn file_envoy_service_discovery_v3_discovery_proto_rawDescGZIP(), []int{2}\n}", "title": "" }, { "docid": "f04abda9dad3e6308c553e571afdf0ee", "score": "0.6177853", "text": "func (*DiscoveryRequest) Descriptor() ([]byte, []int) {\n\treturn file_discover_proto_message_proto_rawDescGZIP(), []int{2}\n}", "title": "" }, { "docid": "4861f72eab683cced03d3677c98995ec", "score": "0.6175424", "text": "func (*PermissionsRequest) Descriptor() ([]byte, []int) {\n\treturn file_go_chromium_org_luci_swarming_proto_api_v2_swarming_proto_rawDescGZIP(), []int{50}\n}", "title": "" }, { "docid": "eca3779cc5a01e530041996b5934d5f6", "score": "0.6171323", "text": "func (x *fastReflection_MsgDelegate) Descriptor() protoreflect.MessageDescriptor {\n\treturn md_MsgDelegate\n}", "title": "" }, { "docid": "86d42f2e159ffd19ab1d5198e2b5aa14", "score": "0.6170568", "text": "func (Permission_Constraint) EnumDescriptor() ([]byte, []int) {\n\treturn file_settings_proto_rawDescGZIP(), []int{37, 1}\n}", "title": "" }, { "docid": "357d0be5770317e94ed364a3e2c112a6", "score": "0.6169228", "text": "func (*URLDomain) Descriptor() ([]byte, []int) {\n\treturn file_tensorflow_metadata_proto_v0_schema_proto_rawDescGZIP(), []int{18}\n}", "title": "" }, { "docid": "73df57008b7f61183a81d597cd6b2760", "score": "0.6168541", "text": "func (DeprecatedEnum) EnumDescriptor() ([]byte, []int) {\n\treturn file_cmd_protoc_gen_go_peptide_testdata_comments_deprecated_proto_rawDescGZIP(), []int{0}\n}", "title": "" }, { "docid": "978375590872c011a0fb9a03e6ac3bda", "score": "0.61659265", "text": "func (x *fastReflection_ValidatorSigner) Descriptor() protoreflect.MessageDescriptor {\n\treturn md_ValidatorSigner\n}", "title": "" }, { "docid": "410bee446d18016c8df150d9c042e751", "score": "0.6165763", "text": "func (x *fastReflection_BadSigner) Descriptor() protoreflect.MessageDescriptor {\n\treturn md_BadSigner\n}", "title": "" }, { "docid": "cf1c5e74bdd026fafed4a473b310807e", "score": "0.61634165", "text": "func (*GetTeamRequest) Descriptor() ([]byte, []int) {\n\treturn file_xsuportal_services_admin_teams_proto_rawDescGZIP(), []int{2}\n}", "title": "" }, { "docid": "8002843b8f2781506be17d823045226d", "score": "0.6160236", "text": "func (*PlanResourceChange_Request) Descriptor() ([]byte, []int) {\n\treturn file_tfplugin5_proto_rawDescGZIP(), []int{13, 0}\n}", "title": "" }, { "docid": "17a56d75442c284c977f46e54a5b48e7", "score": "0.6158166", "text": "func (*ReloadSchemaRequest) Descriptor() ([]byte, []int) {\n\treturn file_vtctldata_proto_rawDescGZIP(), []int{126}\n}", "title": "" }, { "docid": "2ff20368d20f09451f341535c19055b1", "score": "0.6157092", "text": "func (x *fastReflection_CreditType) Descriptor() protoreflect.MessageDescriptor {\n\treturn md_CreditType\n}", "title": "" }, { "docid": "78dccb7f2ccd068bdcec65eaf804cbb5", "score": "0.6151993", "text": "func (*IntDomain) Descriptor() ([]byte, []int) {\n\treturn file_tensorflow_metadata_proto_v0_schema_proto_rawDescGZIP(), []int{10}\n}", "title": "" }, { "docid": "9997beaca74c1bf16f6ae2a7e2adda87", "score": "0.61513704", "text": "func (*Protocols) Descriptor() ([]byte, []int) {\n\treturn file_discovery_discovery_proto_rawDescGZIP(), []int{16}\n}", "title": "" }, { "docid": "bf2f6a9b561d7b9f417c67789e938215", "score": "0.6150141", "text": "func (x *fastReflection_BIP44Params) Descriptor() protoreflect.MessageDescriptor {\n\treturn md_BIP44Params\n}", "title": "" }, { "docid": "4f09c09d4d7a5bfe6a63ac477582daf4", "score": "0.6150031", "text": "func (*SettingsPacketProtocol18Request) Descriptor() ([]byte, []int) {\n\treturn file_grpcadder_proto_rawDescGZIP(), []int{6}\n}", "title": "" }, { "docid": "09244f76c61cb2c0f9ee3d871f3c0c17", "score": "0.61495715", "text": "func (x *fastReflection_BatchContract) Descriptor() protoreflect.MessageDescriptor {\n\treturn md_BatchContract\n}", "title": "" }, { "docid": "43409bdb591d009ba3236c7799839a48", "score": "0.61473334", "text": "func (*Fact) Descriptor() ([]byte, []int) {\n\treturn file_kythe_proto_schema_proto_rawDescGZIP(), []int{2}\n}", "title": "" }, { "docid": "960d0827936fb2ab9e8eeec012e64e59", "score": "0.6144991", "text": "func (*CheckCompatibilityRequest) Descriptor() ([]byte, []int) {\n\treturn file_google_analytics_data_v1beta_analytics_data_api_proto_rawDescGZIP(), []int{0}\n}", "title": "" }, { "docid": "dfb21172a661209150d7dfd2f0a1d0a5", "score": "0.6144983", "text": "func (ContactPrivacy) EnumDescriptor() ([]byte, []int) {\n\treturn file_google_cloud_domains_v1beta1_domains_proto_rawDescGZIP(), []int{0}\n}", "title": "" }, { "docid": "8656a15c318d41805e5046df62a224cf", "score": "0.6143173", "text": "func (*ValidationReport) Descriptor() ([]byte, []int) {\n\treturn file_google_cloud_migrationcenter_v1_migrationcenter_proto_rawDescGZIP(), []int{128}\n}", "title": "" }, { "docid": "deb02bc826a7977b4a4e698ca7f3b452", "score": "0.6142174", "text": "func (*CreateRuleReq) Descriptor() ([]byte, []int) {\n\treturn file_external_iam_v2_request_rules_proto_rawDescGZIP(), []int{0}\n}", "title": "" }, { "docid": "2ef0036624d44afa4438de7dab7006c7", "score": "0.61391217", "text": "func (*ResourceName) Descriptor() ([]byte, []int) {\n\treturn file_envoy_service_discovery_v3_discovery_proto_rawDescGZIP(), []int{1}\n}", "title": "" }, { "docid": "b45dacf73c7656718804df1160eb90aa", "score": "0.6135592", "text": "func (*ApplyResourceChange_Request) Descriptor() ([]byte, []int) {\n\treturn file_tfplugin5_proto_rawDescGZIP(), []int{14, 0}\n}", "title": "" }, { "docid": "32d666204f2a65ec902e9a0f9609f8fb", "score": "0.6130183", "text": "func (*ReplaceLabelsRequest) Descriptor() ([]byte, []int) {\n\treturn file_label_proto_rawDescGZIP(), []int{3}\n}", "title": "" }, { "docid": "e1253c1e0e5246f379e9fcfe1e7f1811", "score": "0.61267275", "text": "func (*TransitionToObserverRequestProto) Descriptor() ([]byte, []int) {\n\treturn file_HAServiceProtocol_proto_rawDescGZIP(), []int{7}\n}", "title": "" }, { "docid": "49ae9bf4d7325bedd4a3283e0261ffac", "score": "0.61250407", "text": "func (*FitDescriptor) Descriptor() ([]byte, []int) {\n\treturn file_google_cloud_migrationcenter_v1_migrationcenter_proto_rawDescGZIP(), []int{123}\n}", "title": "" }, { "docid": "536c18a8f4fe2df8760b89bb794efb28", "score": "0.6124747", "text": "func (*Domain) Descriptor() ([]byte, []int) {\n\treturn file_proto_api_proto_rawDescGZIP(), []int{4}\n}", "title": "" }, { "docid": "7b1229da5556762d590981c19573c120", "score": "0.61236054", "text": "func (*PermissionChange_Modified) Descriptor() ([]byte, []int) {\n\treturn edgelq_iam_proto_v1alpha_permission_change_proto_rawDescGZIP(), []int{0, 1}\n}", "title": "" }, { "docid": "799f4a6be7d4b17eee3d112538815aeb", "score": "0.6120685", "text": "func (x *fastReflection_MsgEditValidatorResponse) Descriptor() protoreflect.MessageDescriptor {\n\treturn md_MsgEditValidatorResponse\n}", "title": "" }, { "docid": "9f0daa2c3e9f73e0199bcf92459d48cc", "score": "0.6119511", "text": "func (*GetRuleReq) Descriptor() ([]byte, []int) {\n\treturn file_external_iam_v2_request_rules_proto_rawDescGZIP(), []int{2}\n}", "title": "" }, { "docid": "ce962dede8c81d2415b7b65689543d4b", "score": "0.61193454", "text": "func (*ProtocolPort) Descriptor() ([]byte, []int) {\n\treturn file_grpc_grpc_proto_rawDescGZIP(), []int{39}\n}", "title": "" } ]
198bfaa7d6e076ef17882d1c728d8daa
GetMenuTreesByP6AndP8 Get MenuTrees via P6AndP8
[ { "docid": "859ebef350b3dbd0a50c2b0167793449", "score": "0.83346844", "text": "func GetMenuTreesByP6AndP8(offset int, limit int, P6_ int, P8_ int) (*[]*MenuTree, error) {\n\tvar _MenuTree = new([]*MenuTree)\n\terr := Engine.Table(\"menu_tree\").Where(\"p6 = ? and p8 = ?\", P6_, P8_).Limit(limit, offset).Find(_MenuTree)\n\treturn _MenuTree, err\n}", "title": "" } ]
[ { "docid": "fd66cd65b62610eb077ed2091c951b12", "score": "0.82467973", "text": "func GetMenuTreesByDepthAndP6AndP8(offset int, limit int, Depth_ int, P6_ int, P8_ int) (*[]*MenuTree, error) {\n\tvar _MenuTree = new([]*MenuTree)\n\terr := Engine.Table(\"menu_tree\").Where(\"depth = ? and p6 = ? and p8 = ?\", Depth_, P6_, P8_).Limit(limit, offset).Find(_MenuTree)\n\treturn _MenuTree, err\n}", "title": "" }, { "docid": "7c48aedf64bf1c9042f9b8f5c72132e3", "score": "0.81320876", "text": "func GetMenuTreesByOptionsAndP6AndP8(offset int, limit int, Options_ []byte, P6_ int, P8_ int) (*[]*MenuTree, error) {\n\tvar _MenuTree = new([]*MenuTree)\n\terr := Engine.Table(\"menu_tree\").Where(\"options = ? and p6 = ? and p8 = ?\", Options_, P6_, P8_).Limit(limit, offset).Find(_MenuTree)\n\treturn _MenuTree, err\n}", "title": "" }, { "docid": "5f3b369e9073ed6e436711991dcd2b7e", "score": "0.8095159", "text": "func GetMenuTreesByP1AndP6AndP8(offset int, limit int, P1_ int, P6_ int, P8_ int) (*[]*MenuTree, error) {\n\tvar _MenuTree = new([]*MenuTree)\n\terr := Engine.Table(\"menu_tree\").Where(\"p1 = ? and p6 = ? and p8 = ?\", P1_, P6_, P8_).Limit(limit, offset).Find(_MenuTree)\n\treturn _MenuTree, err\n}", "title": "" }, { "docid": "92ae98420d5473ac6095881c499ffc90", "score": "0.80590194", "text": "func GetMenuTreesByEnabledAndP6AndP8(offset int, limit int, Enabled_ int, P6_ int, P8_ int) (*[]*MenuTree, error) {\n\tvar _MenuTree = new([]*MenuTree)\n\terr := Engine.Table(\"menu_tree\").Where(\"enabled = ? and p6 = ? and p8 = ?\", Enabled_, P6_, P8_).Limit(limit, offset).Find(_MenuTree)\n\treturn _MenuTree, err\n}", "title": "" }, { "docid": "883390ad4b9b5416e03aa4fe9f0321ff", "score": "0.80131114", "text": "func GetMenuTreesByP2AndP6AndP8(offset int, limit int, P2_ int, P6_ int, P8_ int) (*[]*MenuTree, error) {\n\tvar _MenuTree = new([]*MenuTree)\n\terr := Engine.Table(\"menu_tree\").Where(\"p2 = ? and p6 = ? and p8 = ?\", P2_, P6_, P8_).Limit(limit, offset).Find(_MenuTree)\n\treturn _MenuTree, err\n}", "title": "" }, { "docid": "fdf6658150c009357fb6f89c6d750d06", "score": "0.7981639", "text": "func GetMenuTreesByParentAndP6AndP8(offset int, limit int, Parent_ string, P6_ int, P8_ int) (*[]*MenuTree, error) {\n\tvar _MenuTree = new([]*MenuTree)\n\terr := Engine.Table(\"menu_tree\").Where(\"parent = ? and p6 = ? and p8 = ?\", Parent_, P6_, P8_).Limit(limit, offset).Find(_MenuTree)\n\treturn _MenuTree, err\n}", "title": "" }, { "docid": "c71261b08f2626f7fbb2d7d76251c361", "score": "0.7974624", "text": "func GetMenuTreesByP6AndP7AndP8(offset int, limit int, P6_ int, P7_ int, P8_ int) (*[]*MenuTree, error) {\n\tvar _MenuTree = new([]*MenuTree)\n\terr := Engine.Table(\"menu_tree\").Where(\"p6 = ? and p7 = ? and p8 = ?\", P6_, P7_, P8_).Limit(limit, offset).Find(_MenuTree)\n\treturn _MenuTree, err\n}", "title": "" }, { "docid": "70e99f93ab992f4fb06f32eda9896e87", "score": "0.7965574", "text": "func GetMenuTreesByHasChildrenAndP6AndP8(offset int, limit int, HasChildren_ int, P6_ int, P8_ int) (*[]*MenuTree, error) {\n\tvar _MenuTree = new([]*MenuTree)\n\terr := Engine.Table(\"menu_tree\").Where(\"has_children = ? and p6 = ? and p8 = ?\", HasChildren_, P6_, P8_).Limit(limit, offset).Find(_MenuTree)\n\treturn _MenuTree, err\n}", "title": "" }, { "docid": "bff0840130b15d18fd9c2029a6f62cee", "score": "0.79640216", "text": "func GetMenuTreesByProviderAndP6AndP8(offset int, limit int, Provider_ string, P6_ int, P8_ int) (*[]*MenuTree, error) {\n\tvar _MenuTree = new([]*MenuTree)\n\terr := Engine.Table(\"menu_tree\").Where(\"provider = ? and p6 = ? and p8 = ?\", Provider_, P6_, P8_).Limit(limit, offset).Find(_MenuTree)\n\treturn _MenuTree, err\n}", "title": "" }, { "docid": "5083d05ccf6b1cbf924a794bdb19ac49", "score": "0.79269964", "text": "func GetMenuTreesByTitleAndP6AndP8(offset int, limit int, Title_ []byte, P6_ int, P8_ int) (*[]*MenuTree, error) {\n\tvar _MenuTree = new([]*MenuTree)\n\terr := Engine.Table(\"menu_tree\").Where(\"title = ? and p6 = ? and p8 = ?\", Title_, P6_, P8_).Limit(limit, offset).Find(_MenuTree)\n\treturn _MenuTree, err\n}", "title": "" }, { "docid": "9e7976ee40b8f5fcaa071521b0babd3b", "score": "0.79153585", "text": "func GetMenuTreesByClassAndP6AndP8(offset int, limit int, Class_ string, P6_ int, P8_ int) (*[]*MenuTree, error) {\n\tvar _MenuTree = new([]*MenuTree)\n\terr := Engine.Table(\"menu_tree\").Where(\"class = ? and p6 = ? and p8 = ?\", Class_, P6_, P8_).Limit(limit, offset).Find(_MenuTree)\n\treturn _MenuTree, err\n}", "title": "" }, { "docid": "3ee2b686e94cb9ef3af901f7f5f84359", "score": "0.7885806", "text": "func GetMenuTreesByP3AndP6AndP8(offset int, limit int, P3_ int, P6_ int, P8_ int) (*[]*MenuTree, error) {\n\tvar _MenuTree = new([]*MenuTree)\n\terr := Engine.Table(\"menu_tree\").Where(\"p3 = ? and p6 = ? and p8 = ?\", P3_, P6_, P8_).Limit(limit, offset).Find(_MenuTree)\n\treturn _MenuTree, err\n}", "title": "" }, { "docid": "16d381968a48b2b5ae3aab45cb452657", "score": "0.78801763", "text": "func GetMenuTreesByUrlAndP6AndP8(offset int, limit int, Url_ string, P6_ int, P8_ int) (*[]*MenuTree, error) {\n\tvar _MenuTree = new([]*MenuTree)\n\terr := Engine.Table(\"menu_tree\").Where(\"url = ? and p6 = ? and p8 = ?\", Url_, P6_, P8_).Limit(limit, offset).Find(_MenuTree)\n\treturn _MenuTree, err\n}", "title": "" }, { "docid": "e7bf03a56fc7346ab38b0e3507166c13", "score": "0.7879505", "text": "func GetMenuTreesByDepthAndP6(offset int, limit int, Depth_ int, P6_ int) (*[]*MenuTree, error) {\n\tvar _MenuTree = new([]*MenuTree)\n\terr := Engine.Table(\"menu_tree\").Where(\"depth = ? and p6 = ?\", Depth_, P6_).Limit(limit, offset).Find(_MenuTree)\n\treturn _MenuTree, err\n}", "title": "" }, { "docid": "f712338819c7a8d6bcd32ccb4f586fee", "score": "0.7873338", "text": "func GetMenuTreesByParentAndOptionsAndP6(offset int, limit int, Parent_ string, Options_ []byte, P6_ int) (*[]*MenuTree, error) {\n\tvar _MenuTree = new([]*MenuTree)\n\terr := Engine.Table(\"menu_tree\").Where(\"parent = ? and options = ? and p6 = ?\", Parent_, Options_, P6_).Limit(limit, offset).Find(_MenuTree)\n\treturn _MenuTree, err\n}", "title": "" }, { "docid": "fdef81789ee0a67474b5a56f320a7c99", "score": "0.7868532", "text": "func GetMenuTreesViaP6(offset int, limit int, P6_ int, field string) (*[]*MenuTree, error) {\n\tvar _MenuTree = new([]*MenuTree)\n\terr := Engine.Table(\"menu_tree\").Where(\"p6 = ?\", P6_).Limit(limit, offset).Desc(field).Find(_MenuTree)\n\treturn _MenuTree, err\n}", "title": "" }, { "docid": "b30d5aefb9d26d93c75cb2dafbea55c5", "score": "0.78610533", "text": "func GetMenuTreesByIdAndP6AndP8(offset int, limit int, Id_ string, P6_ int, P8_ int) (*[]*MenuTree, error) {\n\tvar _MenuTree = new([]*MenuTree)\n\terr := Engine.Table(\"menu_tree\").Where(\"id = ? and p6 = ? and p8 = ?\", Id_, P6_, P8_).Limit(limit, offset).Find(_MenuTree)\n\treturn _MenuTree, err\n}", "title": "" }, { "docid": "54abc88c230dcbf269135e211aa38932", "score": "0.78548557", "text": "func GetMenuTreesByParentAndEnabledAndP6(offset int, limit int, Parent_ string, Enabled_ int, P6_ int) (*[]*MenuTree, error) {\n\tvar _MenuTree = new([]*MenuTree)\n\terr := Engine.Table(\"menu_tree\").Where(\"parent = ? and enabled = ? and p6 = ?\", Parent_, Enabled_, P6_).Limit(limit, offset).Find(_MenuTree)\n\treturn _MenuTree, err\n}", "title": "" }, { "docid": "6024826c8b75907610956f1886157cf5", "score": "0.7851752", "text": "func GetMenuTreesByParentAndP6(offset int, limit int, Parent_ string, P6_ int) (*[]*MenuTree, error) {\n\tvar _MenuTree = new([]*MenuTree)\n\terr := Engine.Table(\"menu_tree\").Where(\"parent = ? and p6 = ?\", Parent_, P6_).Limit(limit, offset).Find(_MenuTree)\n\treturn _MenuTree, err\n}", "title": "" }, { "docid": "9ee61ca10135bcf5fc0cfba93767664b", "score": "0.7847113", "text": "func GetMenuTreesByMenuNameAndP6AndP8(offset int, limit int, MenuName_ string, P6_ int, P8_ int) (*[]*MenuTree, error) {\n\tvar _MenuTree = new([]*MenuTree)\n\terr := Engine.Table(\"menu_tree\").Where(\"menu_name = ? and p6 = ? and p8 = ?\", MenuName_, P6_, P8_).Limit(limit, offset).Find(_MenuTree)\n\treturn _MenuTree, err\n}", "title": "" }, { "docid": "1715dfc74c56d622b1cf2ea6a3c45de0", "score": "0.7834877", "text": "func GetMenuTreesByP4AndP6AndP8(offset int, limit int, P4_ int, P6_ int, P8_ int) (*[]*MenuTree, error) {\n\tvar _MenuTree = new([]*MenuTree)\n\terr := Engine.Table(\"menu_tree\").Where(\"p4 = ? and p6 = ? and p8 = ?\", P4_, P6_, P8_).Limit(limit, offset).Find(_MenuTree)\n\treturn _MenuTree, err\n}", "title": "" }, { "docid": "a85bce74d86230170d96338e2232b1e7", "score": "0.7803998", "text": "func GetMenuTreesByExpandedAndP6AndP8(offset int, limit int, Expanded_ int, P6_ int, P8_ int) (*[]*MenuTree, error) {\n\tvar _MenuTree = new([]*MenuTree)\n\terr := Engine.Table(\"menu_tree\").Where(\"expanded = ? and p6 = ? and p8 = ?\", Expanded_, P6_, P8_).Limit(limit, offset).Find(_MenuTree)\n\treturn _MenuTree, err\n}", "title": "" }, { "docid": "6c2cca8d38506f7fb00698b701a1248d", "score": "0.78024787", "text": "func GetMenuTreesByDiscoveredAndP6AndP8(offset int, limit int, Discovered_ int, P6_ int, P8_ int) (*[]*MenuTree, error) {\n\tvar _MenuTree = new([]*MenuTree)\n\terr := Engine.Table(\"menu_tree\").Where(\"discovered = ? and p6 = ? and p8 = ?\", Discovered_, P6_, P8_).Limit(limit, offset).Find(_MenuTree)\n\treturn _MenuTree, err\n}", "title": "" }, { "docid": "6efcabdd6e5e1c1bc4073b1125701eb3", "score": "0.7796255", "text": "func GetMenuTreesByRouteNameAndP6AndP8(offset int, limit int, RouteName_ string, P6_ int, P8_ int) (*[]*MenuTree, error) {\n\tvar _MenuTree = new([]*MenuTree)\n\terr := Engine.Table(\"menu_tree\").Where(\"route_name = ? and p6 = ? and p8 = ?\", RouteName_, P6_, P8_).Limit(limit, offset).Find(_MenuTree)\n\treturn _MenuTree, err\n}", "title": "" }, { "docid": "15aaec4ee9125d4a4078306680dc36f1", "score": "0.7787144", "text": "func GetMenuTreesByOptionsAndP6(offset int, limit int, Options_ []byte, P6_ int) (*[]*MenuTree, error) {\n\tvar _MenuTree = new([]*MenuTree)\n\terr := Engine.Table(\"menu_tree\").Where(\"options = ? and p6 = ?\", Options_, P6_).Limit(limit, offset).Find(_MenuTree)\n\treturn _MenuTree, err\n}", "title": "" }, { "docid": "5630e74ac60e24d5cd75efafb1467316", "score": "0.7783005", "text": "func GetMenuTreesByMlidAndP6AndP8(offset int, limit int, Mlid_ int, P6_ int, P8_ int) (*[]*MenuTree, error) {\n\tvar _MenuTree = new([]*MenuTree)\n\terr := Engine.Table(\"menu_tree\").Where(\"mlid = ? and p6 = ? and p8 = ?\", Mlid_, P6_, P8_).Limit(limit, offset).Find(_MenuTree)\n\treturn _MenuTree, err\n}", "title": "" }, { "docid": "159556a5571a148ecebf467f3806a822", "score": "0.77777976", "text": "func GetMenuTreesByParentAndDepthAndP6(offset int, limit int, Parent_ string, Depth_ int, P6_ int) (*[]*MenuTree, error) {\n\tvar _MenuTree = new([]*MenuTree)\n\terr := Engine.Table(\"menu_tree\").Where(\"parent = ? and depth = ? and p6 = ?\", Parent_, Depth_, P6_).Limit(limit, offset).Find(_MenuTree)\n\treturn _MenuTree, err\n}", "title": "" }, { "docid": "758de986abaa7dbf05c3e50e77750e9c", "score": "0.77571136", "text": "func GetMenuTreesByDescriptionAndP6AndP8(offset int, limit int, Description_ []byte, P6_ int, P8_ int) (*[]*MenuTree, error) {\n\tvar _MenuTree = new([]*MenuTree)\n\terr := Engine.Table(\"menu_tree\").Where(\"description = ? and p6 = ? and p8 = ?\", Description_, P6_, P8_).Limit(limit, offset).Find(_MenuTree)\n\treturn _MenuTree, err\n}", "title": "" }, { "docid": "d47fb6628deffd9195e8b71942bfd23e", "score": "0.7750879", "text": "func GetMenuTreesByP1AndP6(offset int, limit int, P1_ int, P6_ int) (*[]*MenuTree, error) {\n\tvar _MenuTree = new([]*MenuTree)\n\terr := Engine.Table(\"menu_tree\").Where(\"p1 = ? and p6 = ?\", P1_, P6_).Limit(limit, offset).Find(_MenuTree)\n\treturn _MenuTree, err\n}", "title": "" }, { "docid": "69e75c516d5656f50eeaf3b376b2713a", "score": "0.7748031", "text": "func GetMenuTreesByEnabledAndP6(offset int, limit int, Enabled_ int, P6_ int) (*[]*MenuTree, error) {\n\tvar _MenuTree = new([]*MenuTree)\n\terr := Engine.Table(\"menu_tree\").Where(\"enabled = ? and p6 = ?\", Enabled_, P6_).Limit(limit, offset).Find(_MenuTree)\n\treturn _MenuTree, err\n}", "title": "" }, { "docid": "455cdc64687449cf62ef9443c5579a4a", "score": "0.77311087", "text": "func GetMenuTreesByOptionsAndDepthAndP6(offset int, limit int, Options_ []byte, Depth_ int, P6_ int) (*[]*MenuTree, error) {\n\tvar _MenuTree = new([]*MenuTree)\n\terr := Engine.Table(\"menu_tree\").Where(\"options = ? and depth = ? and p6 = ?\", Options_, Depth_, P6_).Limit(limit, offset).Find(_MenuTree)\n\treturn _MenuTree, err\n}", "title": "" }, { "docid": "fe4984938f837caaaa28a51d43147622", "score": "0.7715537", "text": "func GetMenuTreesByParentAndP2AndP6(offset int, limit int, Parent_ string, P2_ int, P6_ int) (*[]*MenuTree, error) {\n\tvar _MenuTree = new([]*MenuTree)\n\terr := Engine.Table(\"menu_tree\").Where(\"parent = ? and p2 = ? and p6 = ?\", Parent_, P2_, P6_).Limit(limit, offset).Find(_MenuTree)\n\treturn _MenuTree, err\n}", "title": "" }, { "docid": "1ee1193d260c4b003670808d0413fce2", "score": "0.7713169", "text": "func GetMenuTreesByP6AndP7(offset int, limit int, P6_ int, P7_ int) (*[]*MenuTree, error) {\n\tvar _MenuTree = new([]*MenuTree)\n\terr := Engine.Table(\"menu_tree\").Where(\"p6 = ? and p7 = ?\", P6_, P7_).Limit(limit, offset).Find(_MenuTree)\n\treturn _MenuTree, err\n}", "title": "" }, { "docid": "3133e458974a407e7991c1e5cab6e74d", "score": "0.7706847", "text": "func GetMenuTreesByDepthAndP1AndP6(offset int, limit int, Depth_ int, P1_ int, P6_ int) (*[]*MenuTree, error) {\n\tvar _MenuTree = new([]*MenuTree)\n\terr := Engine.Table(\"menu_tree\").Where(\"depth = ? and p1 = ? and p6 = ?\", Depth_, P1_, P6_).Limit(limit, offset).Find(_MenuTree)\n\treturn _MenuTree, err\n}", "title": "" }, { "docid": "02a59697fbf972ac32e54cdf33727c1f", "score": "0.770159", "text": "func GetMenuTreesByP1AndP2AndP6(offset int, limit int, P1_ int, P2_ int, P6_ int) (*[]*MenuTree, error) {\n\tvar _MenuTree = new([]*MenuTree)\n\terr := Engine.Table(\"menu_tree\").Where(\"p1 = ? and p2 = ? and p6 = ?\", P1_, P2_, P6_).Limit(limit, offset).Find(_MenuTree)\n\treturn _MenuTree, err\n}", "title": "" }, { "docid": "4f42cbcdf9279efba714a221b5a4a336", "score": "0.76799464", "text": "func GetMenuTreesByDepthAndP6AndP7(offset int, limit int, Depth_ int, P6_ int, P7_ int) (*[]*MenuTree, error) {\n\tvar _MenuTree = new([]*MenuTree)\n\terr := Engine.Table(\"menu_tree\").Where(\"depth = ? and p6 = ? and p7 = ?\", Depth_, P6_, P7_).Limit(limit, offset).Find(_MenuTree)\n\treturn _MenuTree, err\n}", "title": "" }, { "docid": "bc68d1fd515ee9746b8c594c1ae5a812", "score": "0.7671329", "text": "func GetMenuTreesByParentAndDiscoveredAndP6(offset int, limit int, Parent_ string, Discovered_ int, P6_ int) (*[]*MenuTree, error) {\n\tvar _MenuTree = new([]*MenuTree)\n\terr := Engine.Table(\"menu_tree\").Where(\"parent = ? and discovered = ? and p6 = ?\", Parent_, Discovered_, P6_).Limit(limit, offset).Find(_MenuTree)\n\treturn _MenuTree, err\n}", "title": "" }, { "docid": "1025b337e36a6115de59984771306944", "score": "0.7669149", "text": "func GetMenuTreesByRouteParametersAndP6AndP8(offset int, limit int, RouteParameters_ []byte, P6_ int, P8_ int) (*[]*MenuTree, error) {\n\tvar _MenuTree = new([]*MenuTree)\n\terr := Engine.Table(\"menu_tree\").Where(\"route_parameters = ? and p6 = ? and p8 = ?\", RouteParameters_, P6_, P8_).Limit(limit, offset).Find(_MenuTree)\n\treturn _MenuTree, err\n}", "title": "" }, { "docid": "bf4c74611db228f071b70667e206ccdb", "score": "0.7658186", "text": "func GetMenuTreesByOptionsAndEnabledAndP6(offset int, limit int, Options_ []byte, Enabled_ int, P6_ int) (*[]*MenuTree, error) {\n\tvar _MenuTree = new([]*MenuTree)\n\terr := Engine.Table(\"menu_tree\").Where(\"options = ? and enabled = ? and p6 = ?\", Options_, Enabled_, P6_).Limit(limit, offset).Find(_MenuTree)\n\treturn _MenuTree, err\n}", "title": "" }, { "docid": "330785f289dc264ff8455a05cc3cfa71", "score": "0.76480645", "text": "func GetMenuTreesByP2AndP6(offset int, limit int, P2_ int, P6_ int) (*[]*MenuTree, error) {\n\tvar _MenuTree = new([]*MenuTree)\n\terr := Engine.Table(\"menu_tree\").Where(\"p2 = ? and p6 = ?\", P2_, P6_).Limit(limit, offset).Find(_MenuTree)\n\treturn _MenuTree, err\n}", "title": "" }, { "docid": "274f634a7d05315b727331cc25704a0a", "score": "0.76472926", "text": "func GetMenuTreesByEnabledAndDepthAndP6(offset int, limit int, Enabled_ int, Depth_ int, P6_ int) (*[]*MenuTree, error) {\n\tvar _MenuTree = new([]*MenuTree)\n\terr := Engine.Table(\"menu_tree\").Where(\"enabled = ? and depth = ? and p6 = ?\", Enabled_, Depth_, P6_).Limit(limit, offset).Find(_MenuTree)\n\treturn _MenuTree, err\n}", "title": "" }, { "docid": "cacabab84c11aff7469d3a9e773c972a", "score": "0.7639775", "text": "func GetMenuTreesByEnabledAndDiscoveredAndP6(offset int, limit int, Enabled_ int, Discovered_ int, P6_ int) (*[]*MenuTree, error) {\n\tvar _MenuTree = new([]*MenuTree)\n\terr := Engine.Table(\"menu_tree\").Where(\"enabled = ? and discovered = ? and p6 = ?\", Enabled_, Discovered_, P6_).Limit(limit, offset).Find(_MenuTree)\n\treturn _MenuTree, err\n}", "title": "" }, { "docid": "4bdc5f069b114eec370d05e4c7334564", "score": "0.76385367", "text": "func GetMenuTreesByMetadataAndP6AndP8(offset int, limit int, Metadata_ []byte, P6_ int, P8_ int) (*[]*MenuTree, error) {\n\tvar _MenuTree = new([]*MenuTree)\n\terr := Engine.Table(\"menu_tree\").Where(\"metadata = ? and p6 = ? and p8 = ?\", Metadata_, P6_, P8_).Limit(limit, offset).Find(_MenuTree)\n\treturn _MenuTree, err\n}", "title": "" }, { "docid": "2cbdaebd9568f786ef64b6d07505f098", "score": "0.7632719", "text": "func GetMenuTreesByDepthAndP2AndP6(offset int, limit int, Depth_ int, P2_ int, P6_ int) (*[]*MenuTree, error) {\n\tvar _MenuTree = new([]*MenuTree)\n\terr := Engine.Table(\"menu_tree\").Where(\"depth = ? and p2 = ? and p6 = ?\", Depth_, P2_, P6_).Limit(limit, offset).Find(_MenuTree)\n\treturn _MenuTree, err\n}", "title": "" }, { "docid": "7e6e574af2e905bc636dcfa27945a5d2", "score": "0.7630501", "text": "func GetMenuTreesByOptionsAndHasChildrenAndP6(offset int, limit int, Options_ []byte, HasChildren_ int, P6_ int) (*[]*MenuTree, error) {\n\tvar _MenuTree = new([]*MenuTree)\n\terr := Engine.Table(\"menu_tree\").Where(\"options = ? and has_children = ? and p6 = ?\", Options_, HasChildren_, P6_).Limit(limit, offset).Find(_MenuTree)\n\treturn _MenuTree, err\n}", "title": "" }, { "docid": "edcc4b8092978e0f0a209076b035c06e", "score": "0.763021", "text": "func GetMenuTreesByParentAndHasChildrenAndP6(offset int, limit int, Parent_ string, HasChildren_ int, P6_ int) (*[]*MenuTree, error) {\n\tvar _MenuTree = new([]*MenuTree)\n\terr := Engine.Table(\"menu_tree\").Where(\"parent = ? and has_children = ? and p6 = ?\", Parent_, HasChildren_, P6_).Limit(limit, offset).Find(_MenuTree)\n\treturn _MenuTree, err\n}", "title": "" }, { "docid": "c29f0636e913d054e4b35f27adb6c0f0", "score": "0.7625132", "text": "func GetMenuTreesByEnabledAndHasChildrenAndP6(offset int, limit int, Enabled_ int, HasChildren_ int, P6_ int) (*[]*MenuTree, error) {\n\tvar _MenuTree = new([]*MenuTree)\n\terr := Engine.Table(\"menu_tree\").Where(\"enabled = ? and has_children = ? and p6 = ?\", Enabled_, HasChildren_, P6_).Limit(limit, offset).Find(_MenuTree)\n\treturn _MenuTree, err\n}", "title": "" }, { "docid": "3792dd8ef2c7d44de36d74fd4fd64aef", "score": "0.7623817", "text": "func GetMenuTreesByParentAndP1AndP6(offset int, limit int, Parent_ string, P1_ int, P6_ int) (*[]*MenuTree, error) {\n\tvar _MenuTree = new([]*MenuTree)\n\terr := Engine.Table(\"menu_tree\").Where(\"parent = ? and p1 = ? and p6 = ?\", Parent_, P1_, P6_).Limit(limit, offset).Find(_MenuTree)\n\treturn _MenuTree, err\n}", "title": "" }, { "docid": "4d039e235e0ae5b404e5be72f6165475", "score": "0.76066005", "text": "func GetMenuTreesByDepthAndP7AndP8(offset int, limit int, Depth_ int, P7_ int, P8_ int) (*[]*MenuTree, error) {\n\tvar _MenuTree = new([]*MenuTree)\n\terr := Engine.Table(\"menu_tree\").Where(\"depth = ? and p7 = ? and p8 = ?\", Depth_, P7_, P8_).Limit(limit, offset).Find(_MenuTree)\n\treturn _MenuTree, err\n}", "title": "" }, { "docid": "259d2448323012bdb86df068441b5a15", "score": "0.76019007", "text": "func GetMenuTreesByParentAndP6AndP7(offset int, limit int, Parent_ string, P6_ int, P7_ int) (*[]*MenuTree, error) {\n\tvar _MenuTree = new([]*MenuTree)\n\terr := Engine.Table(\"menu_tree\").Where(\"parent = ? and p6 = ? and p7 = ?\", Parent_, P6_, P7_).Limit(limit, offset).Find(_MenuTree)\n\treturn _MenuTree, err\n}", "title": "" }, { "docid": "fc531f46938f931dc7d2753c95128747", "score": "0.75991595", "text": "func GetMenuTreesByParentAndProviderAndP6(offset int, limit int, Parent_ string, Provider_ string, P6_ int) (*[]*MenuTree, error) {\n\tvar _MenuTree = new([]*MenuTree)\n\terr := Engine.Table(\"menu_tree\").Where(\"parent = ? and provider = ? and p6 = ?\", Parent_, Provider_, P6_).Limit(limit, offset).Find(_MenuTree)\n\treturn _MenuTree, err\n}", "title": "" }, { "docid": "d061d60413482a51526ec277b34f0f1a", "score": "0.75988215", "text": "func GetMenuTreesByP1AndP6AndP7(offset int, limit int, P1_ int, P6_ int, P7_ int) (*[]*MenuTree, error) {\n\tvar _MenuTree = new([]*MenuTree)\n\terr := Engine.Table(\"menu_tree\").Where(\"p1 = ? and p6 = ? and p7 = ?\", P1_, P6_, P7_).Limit(limit, offset).Find(_MenuTree)\n\treturn _MenuTree, err\n}", "title": "" }, { "docid": "86c05695e84f2cf4407586732841e4f2", "score": "0.75931454", "text": "func GetMenuTreesByParentAndMetadataAndP6(offset int, limit int, Parent_ string, Metadata_ []byte, P6_ int) (*[]*MenuTree, error) {\n\tvar _MenuTree = new([]*MenuTree)\n\terr := Engine.Table(\"menu_tree\").Where(\"parent = ? and metadata = ? and p6 = ?\", Parent_, Metadata_, P6_).Limit(limit, offset).Find(_MenuTree)\n\treturn _MenuTree, err\n}", "title": "" }, { "docid": "35e8fb64332be8a914ee611f5503b393", "score": "0.75926226", "text": "func GetMenuTreesByWeightAndP6AndP8(offset int, limit int, Weight_ int, P6_ int, P8_ int) (*[]*MenuTree, error) {\n\tvar _MenuTree = new([]*MenuTree)\n\terr := Engine.Table(\"menu_tree\").Where(\"weight = ? and p6 = ? and p8 = ?\", Weight_, P6_, P8_).Limit(limit, offset).Find(_MenuTree)\n\treturn _MenuTree, err\n}", "title": "" }, { "docid": "28cc3c749f2fc6b68fbb85489a081f22", "score": "0.75901645", "text": "func GetMenuTreeViaP6(iP6 int) (*MenuTree, error) {\n\tvar _MenuTree = &MenuTree{P6: iP6}\n\thas, err := Engine.Get(_MenuTree)\n\tif has {\n\t\treturn _MenuTree, err\n\t} else {\n\t\treturn nil, err\n\t}\n}", "title": "" }, { "docid": "477d96412b9ccea00ae8c7e1f8921943", "score": "0.7587842", "text": "func GetMenuTreesByP5AndP6AndP8(offset int, limit int, P5_ int, P6_ int, P8_ int) (*[]*MenuTree, error) {\n\tvar _MenuTree = new([]*MenuTree)\n\terr := Engine.Table(\"menu_tree\").Where(\"p5 = ? and p6 = ? and p8 = ?\", P5_, P6_, P8_).Limit(limit, offset).Find(_MenuTree)\n\treturn _MenuTree, err\n}", "title": "" }, { "docid": "6d61a1730e0f0efff2e1b95dec8e19e9", "score": "0.7580726", "text": "func GetMenuTreesByOptionsAndP1AndP6(offset int, limit int, Options_ []byte, P1_ int, P6_ int) (*[]*MenuTree, error) {\n\tvar _MenuTree = new([]*MenuTree)\n\terr := Engine.Table(\"menu_tree\").Where(\"options = ? and p1 = ? and p6 = ?\", Options_, P1_, P6_).Limit(limit, offset).Find(_MenuTree)\n\treturn _MenuTree, err\n}", "title": "" }, { "docid": "8c010f7de4c66deba5010504a90d16e8", "score": "0.75768095", "text": "func GetMenuTreesByParentAndDescriptionAndP6(offset int, limit int, Parent_ string, Description_ []byte, P6_ int) (*[]*MenuTree, error) {\n\tvar _MenuTree = new([]*MenuTree)\n\terr := Engine.Table(\"menu_tree\").Where(\"parent = ? and description = ? and p6 = ?\", Parent_, Description_, P6_).Limit(limit, offset).Find(_MenuTree)\n\treturn _MenuTree, err\n}", "title": "" }, { "docid": "da317931834e0666dee1df7ed840d825", "score": "0.757386", "text": "func GetMenuTreesByP1AndP7AndP8(offset int, limit int, P1_ int, P7_ int, P8_ int) (*[]*MenuTree, error) {\n\tvar _MenuTree = new([]*MenuTree)\n\terr := Engine.Table(\"menu_tree\").Where(\"p1 = ? and p7 = ? and p8 = ?\", P1_, P7_, P8_).Limit(limit, offset).Find(_MenuTree)\n\treturn _MenuTree, err\n}", "title": "" }, { "docid": "e07a142a5f8cdd3c283b1a593ee01d1b", "score": "0.75696456", "text": "func GetMenuTreesByOptionsAndDiscoveredAndP6(offset int, limit int, Options_ []byte, Discovered_ int, P6_ int) (*[]*MenuTree, error) {\n\tvar _MenuTree = new([]*MenuTree)\n\terr := Engine.Table(\"menu_tree\").Where(\"options = ? and discovered = ? and p6 = ?\", Options_, Discovered_, P6_).Limit(limit, offset).Find(_MenuTree)\n\treturn _MenuTree, err\n}", "title": "" }, { "docid": "95d3350eaa3bc6cc384d025ae2f55f78", "score": "0.75675005", "text": "func GetMenuTreesByP6AndP8AndP9(offset int, limit int, P6_ int, P8_ int, P9_ int) (*[]*MenuTree, error) {\n\tvar _MenuTree = new([]*MenuTree)\n\terr := Engine.Table(\"menu_tree\").Where(\"p6 = ? and p8 = ? and p9 = ?\", P6_, P8_, P9_).Limit(limit, offset).Find(_MenuTree)\n\treturn _MenuTree, err\n}", "title": "" }, { "docid": "f5d542ec216ee57abb5692fb7f7aba37", "score": "0.75584126", "text": "func GetMenuTreesByP6AndP9(offset int, limit int, P6_ int, P9_ int) (*[]*MenuTree, error) {\n\tvar _MenuTree = new([]*MenuTree)\n\terr := Engine.Table(\"menu_tree\").Where(\"p6 = ? and p9 = ?\", P6_, P9_).Limit(limit, offset).Find(_MenuTree)\n\treturn _MenuTree, err\n}", "title": "" }, { "docid": "a0506b4fabbcc8d08571c4552441b6cd", "score": "0.7558205", "text": "func GetMenuTreesByOptionsAndP2AndP6(offset int, limit int, Options_ []byte, P2_ int, P6_ int) (*[]*MenuTree, error) {\n\tvar _MenuTree = new([]*MenuTree)\n\terr := Engine.Table(\"menu_tree\").Where(\"options = ? and p2 = ? and p6 = ?\", Options_, P2_, P6_).Limit(limit, offset).Find(_MenuTree)\n\treturn _MenuTree, err\n}", "title": "" }, { "docid": "9511277c35aeb6a5b21cf86bb4b5e90f", "score": "0.7553766", "text": "func GetMenuTreesByDepthAndP8(offset int, limit int, Depth_ int, P8_ int) (*[]*MenuTree, error) {\n\tvar _MenuTree = new([]*MenuTree)\n\terr := Engine.Table(\"menu_tree\").Where(\"depth = ? and p8 = ?\", Depth_, P8_).Limit(limit, offset).Find(_MenuTree)\n\treturn _MenuTree, err\n}", "title": "" }, { "docid": "8a91dcc5e40fb271de25411ba0236961", "score": "0.7550998", "text": "func GetMenuTreesByParentAndUrlAndP6(offset int, limit int, Parent_ string, Url_ string, P6_ int) (*[]*MenuTree, error) {\n\tvar _MenuTree = new([]*MenuTree)\n\terr := Engine.Table(\"menu_tree\").Where(\"parent = ? and url = ? and p6 = ?\", Parent_, Url_, P6_).Limit(limit, offset).Find(_MenuTree)\n\treturn _MenuTree, err\n}", "title": "" }, { "docid": "855f3e7c8ee129a78807716da642fbbd", "score": "0.75501466", "text": "func GetMenuTreesByDiscoveredAndP6(offset int, limit int, Discovered_ int, P6_ int) (*[]*MenuTree, error) {\n\tvar _MenuTree = new([]*MenuTree)\n\terr := Engine.Table(\"menu_tree\").Where(\"discovered = ? and p6 = ?\", Discovered_, P6_).Limit(limit, offset).Find(_MenuTree)\n\treturn _MenuTree, err\n}", "title": "" }, { "docid": "37b6f7ae5e61c820fae99eabacb5df9c", "score": "0.75477946", "text": "func GetMenuTreesByProviderAndP6(offset int, limit int, Provider_ string, P6_ int) (*[]*MenuTree, error) {\n\tvar _MenuTree = new([]*MenuTree)\n\terr := Engine.Table(\"menu_tree\").Where(\"provider = ? and p6 = ?\", Provider_, P6_).Limit(limit, offset).Find(_MenuTree)\n\treturn _MenuTree, err\n}", "title": "" }, { "docid": "b657921b4ae95666bb4abef9bcee88d6", "score": "0.7545564", "text": "func GetMenuTreesByP2AndP6AndP7(offset int, limit int, P2_ int, P6_ int, P7_ int) (*[]*MenuTree, error) {\n\tvar _MenuTree = new([]*MenuTree)\n\terr := Engine.Table(\"menu_tree\").Where(\"p2 = ? and p6 = ? and p7 = ?\", P2_, P6_, P7_).Limit(limit, offset).Find(_MenuTree)\n\treturn _MenuTree, err\n}", "title": "" }, { "docid": "5463caadf5f5d24e8d0980bc27f5aa1d", "score": "0.75454557", "text": "func GetMenuTreesByP3AndP6(offset int, limit int, P3_ int, P6_ int) (*[]*MenuTree, error) {\n\tvar _MenuTree = new([]*MenuTree)\n\terr := Engine.Table(\"menu_tree\").Where(\"p3 = ? and p6 = ?\", P3_, P6_).Limit(limit, offset).Find(_MenuTree)\n\treturn _MenuTree, err\n}", "title": "" }, { "docid": "bd886d8cb9047a2adabcc5381e70baef", "score": "0.7542969", "text": "func GetMenuTreesByDiscoveredAndHasChildrenAndP6(offset int, limit int, Discovered_ int, HasChildren_ int, P6_ int) (*[]*MenuTree, error) {\n\tvar _MenuTree = new([]*MenuTree)\n\terr := Engine.Table(\"menu_tree\").Where(\"discovered = ? and has_children = ? and p6 = ?\", Discovered_, HasChildren_, P6_).Limit(limit, offset).Find(_MenuTree)\n\treturn _MenuTree, err\n}", "title": "" }, { "docid": "a5db70dbbd2b50b52aa3a5089033e268", "score": "0.75414944", "text": "func GetMenuTreesByP6AndP8AndFormClass(offset int, limit int, P6_ int, P8_ int, FormClass_ string) (*[]*MenuTree, error) {\n\tvar _MenuTree = new([]*MenuTree)\n\terr := Engine.Table(\"menu_tree\").Where(\"p6 = ? and p8 = ? and form_class = ?\", P6_, P8_, FormClass_).Limit(limit, offset).Find(_MenuTree)\n\treturn _MenuTree, err\n}", "title": "" }, { "docid": "9973969ef5ce9c9a751f8dee037e3ce3", "score": "0.75400674", "text": "func GetMenuTreesByProviderAndDepthAndP6(offset int, limit int, Provider_ string, Depth_ int, P6_ int) (*[]*MenuTree, error) {\n\tvar _MenuTree = new([]*MenuTree)\n\terr := Engine.Table(\"menu_tree\").Where(\"provider = ? and depth = ? and p6 = ?\", Provider_, Depth_, P6_).Limit(limit, offset).Find(_MenuTree)\n\treturn _MenuTree, err\n}", "title": "" }, { "docid": "6d8c6633aaf1db8c23cb2bf8c26bbc27", "score": "0.7537397", "text": "func GetMenuTreesByRouteParamKeyAndP6AndP8(offset int, limit int, RouteParamKey_ string, P6_ int, P8_ int) (*[]*MenuTree, error) {\n\tvar _MenuTree = new([]*MenuTree)\n\terr := Engine.Table(\"menu_tree\").Where(\"route_param_key = ? and p6 = ? and p8 = ?\", RouteParamKey_, P6_, P8_).Limit(limit, offset).Find(_MenuTree)\n\treturn _MenuTree, err\n}", "title": "" }, { "docid": "9d4e342c6cc4677f18ef7343ee5a7160", "score": "0.753442", "text": "func GetMenuTreesByP7AndP8(offset int, limit int, P7_ int, P8_ int) (*[]*MenuTree, error) {\n\tvar _MenuTree = new([]*MenuTree)\n\terr := Engine.Table(\"menu_tree\").Where(\"p7 = ? and p8 = ?\", P7_, P8_).Limit(limit, offset).Find(_MenuTree)\n\treturn _MenuTree, err\n}", "title": "" }, { "docid": "6719b02b3cf9b01eddf3a0cb4e41e019", "score": "0.7533061", "text": "func GetMenuTreesByOptionsAndP6AndP7(offset int, limit int, Options_ []byte, P6_ int, P7_ int) (*[]*MenuTree, error) {\n\tvar _MenuTree = new([]*MenuTree)\n\terr := Engine.Table(\"menu_tree\").Where(\"options = ? and p6 = ? and p7 = ?\", Options_, P6_, P7_).Limit(limit, offset).Find(_MenuTree)\n\treturn _MenuTree, err\n}", "title": "" }, { "docid": "cf0dd0c3feac6061d60c55fcafd77d6e", "score": "0.75326705", "text": "func GetMenuTreesByIdAndP6(offset int, limit int, Id_ string, P6_ int) (*[]*MenuTree, error) {\n\tvar _MenuTree = new([]*MenuTree)\n\terr := Engine.Table(\"menu_tree\").Where(\"id = ? and p6 = ?\", Id_, P6_).Limit(limit, offset).Find(_MenuTree)\n\treturn _MenuTree, err\n}", "title": "" }, { "docid": "eb2e084d45c3050406aab267f59bfbf7", "score": "0.75277114", "text": "func GetMenuTreesByEnabledAndP6AndP7(offset int, limit int, Enabled_ int, P6_ int, P7_ int) (*[]*MenuTree, error) {\n\tvar _MenuTree = new([]*MenuTree)\n\terr := Engine.Table(\"menu_tree\").Where(\"enabled = ? and p6 = ? and p7 = ?\", Enabled_, P6_, P7_).Limit(limit, offset).Find(_MenuTree)\n\treturn _MenuTree, err\n}", "title": "" }, { "docid": "ae53ddd63f189a0cae24938bd0a987f7", "score": "0.75276273", "text": "func GetMenuTreesByMenuNameAndParentAndP6(offset int, limit int, MenuName_ string, Parent_ string, P6_ int) (*[]*MenuTree, error) {\n\tvar _MenuTree = new([]*MenuTree)\n\terr := Engine.Table(\"menu_tree\").Where(\"menu_name = ? and parent = ? and p6 = ?\", MenuName_, Parent_, P6_).Limit(limit, offset).Find(_MenuTree)\n\treturn _MenuTree, err\n}", "title": "" }, { "docid": "368169af0251840aad68f592fe50be35", "score": "0.75260705", "text": "func GetMenuTreesByOptionsAndProviderAndP6(offset int, limit int, Options_ []byte, Provider_ string, P6_ int) (*[]*MenuTree, error) {\n\tvar _MenuTree = new([]*MenuTree)\n\terr := Engine.Table(\"menu_tree\").Where(\"options = ? and provider = ? and p6 = ?\", Options_, Provider_, P6_).Limit(limit, offset).Find(_MenuTree)\n\treturn _MenuTree, err\n}", "title": "" }, { "docid": "bc11a2d6db9135e38545c21616c708e8", "score": "0.7523975", "text": "func GetMenuTreesByParentAndTitleAndP6(offset int, limit int, Parent_ string, Title_ []byte, P6_ int) (*[]*MenuTree, error) {\n\tvar _MenuTree = new([]*MenuTree)\n\terr := Engine.Table(\"menu_tree\").Where(\"parent = ? and title = ? and p6 = ?\", Parent_, Title_, P6_).Limit(limit, offset).Find(_MenuTree)\n\treturn _MenuTree, err\n}", "title": "" }, { "docid": "e86f08d9cd7eee49bfe534470eb9601a", "score": "0.7511782", "text": "func GetMenuTreesByIdAndParentAndP6(offset int, limit int, Id_ string, Parent_ string, P6_ int) (*[]*MenuTree, error) {\n\tvar _MenuTree = new([]*MenuTree)\n\terr := Engine.Table(\"menu_tree\").Where(\"id = ? and parent = ? and p6 = ?\", Id_, Parent_, P6_).Limit(limit, offset).Find(_MenuTree)\n\treturn _MenuTree, err\n}", "title": "" }, { "docid": "cfe07a181862328b153c6f562b06d301", "score": "0.7508539", "text": "func GetMenuTreesByOptionsAndHasChildrenAndP8(offset int, limit int, Options_ []byte, HasChildren_ int, P8_ int) (*[]*MenuTree, error) {\n\tvar _MenuTree = new([]*MenuTree)\n\terr := Engine.Table(\"menu_tree\").Where(\"options = ? and has_children = ? and p8 = ?\", Options_, HasChildren_, P8_).Limit(limit, offset).Find(_MenuTree)\n\treturn _MenuTree, err\n}", "title": "" }, { "docid": "2483e69e2e3f3a7a109decf8ce05d221", "score": "0.75069964", "text": "func GetMenuTreesByMenuNameAndOptionsAndP6(offset int, limit int, MenuName_ string, Options_ []byte, P6_ int) (*[]*MenuTree, error) {\n\tvar _MenuTree = new([]*MenuTree)\n\terr := Engine.Table(\"menu_tree\").Where(\"menu_name = ? and options = ? and p6 = ?\", MenuName_, Options_, P6_).Limit(limit, offset).Find(_MenuTree)\n\treturn _MenuTree, err\n}", "title": "" }, { "docid": "6492a3f5cd21b91112d91451647c91c2", "score": "0.75007313", "text": "func GetMenuTreesByOptionsAndP7AndP8(offset int, limit int, Options_ []byte, P7_ int, P8_ int) (*[]*MenuTree, error) {\n\tvar _MenuTree = new([]*MenuTree)\n\terr := Engine.Table(\"menu_tree\").Where(\"options = ? and p7 = ? and p8 = ?\", Options_, P7_, P8_).Limit(limit, offset).Find(_MenuTree)\n\treturn _MenuTree, err\n}", "title": "" }, { "docid": "0720716051ea3f0233f16a7b0e11be66", "score": "0.75005037", "text": "func GetMenuTreesByParentAndClassAndP6(offset int, limit int, Parent_ string, Class_ string, P6_ int) (*[]*MenuTree, error) {\n\tvar _MenuTree = new([]*MenuTree)\n\terr := Engine.Table(\"menu_tree\").Where(\"parent = ? and class = ? and p6 = ?\", Parent_, Class_, P6_).Limit(limit, offset).Find(_MenuTree)\n\treturn _MenuTree, err\n}", "title": "" }, { "docid": "12a4026a3a5f0818bc6919be22e00ec3", "score": "0.7488959", "text": "func GetMenuTreesByP1AndP2AndP8(offset int, limit int, P1_ int, P2_ int, P8_ int) (*[]*MenuTree, error) {\n\tvar _MenuTree = new([]*MenuTree)\n\terr := Engine.Table(\"menu_tree\").Where(\"p1 = ? and p2 = ? and p8 = ?\", P1_, P2_, P8_).Limit(limit, offset).Find(_MenuTree)\n\treturn _MenuTree, err\n}", "title": "" }, { "docid": "7b40424409dc3f7d13976de2a7611c02", "score": "0.74828744", "text": "func GetMenuTreesByP2AndP3AndP6(offset int, limit int, P2_ int, P3_ int, P6_ int) (*[]*MenuTree, error) {\n\tvar _MenuTree = new([]*MenuTree)\n\terr := Engine.Table(\"menu_tree\").Where(\"p2 = ? and p3 = ? and p6 = ?\", P2_, P3_, P6_).Limit(limit, offset).Find(_MenuTree)\n\treturn _MenuTree, err\n}", "title": "" }, { "docid": "a11687d1ca6ad83d272d54f4e8a2573f", "score": "0.74797195", "text": "func GetMenuTreesByMetadataAndDepthAndP6(offset int, limit int, Metadata_ []byte, Depth_ int, P6_ int) (*[]*MenuTree, error) {\n\tvar _MenuTree = new([]*MenuTree)\n\terr := Engine.Table(\"menu_tree\").Where(\"metadata = ? and depth = ? and p6 = ?\", Metadata_, Depth_, P6_).Limit(limit, offset).Find(_MenuTree)\n\treturn _MenuTree, err\n}", "title": "" }, { "docid": "c424883506d566f1072cc92b73cebf8a", "score": "0.74753934", "text": "func GetMenuTreesByDepthAndP1AndP8(offset int, limit int, Depth_ int, P1_ int, P8_ int) (*[]*MenuTree, error) {\n\tvar _MenuTree = new([]*MenuTree)\n\terr := Engine.Table(\"menu_tree\").Where(\"depth = ? and p1 = ? and p8 = ?\", Depth_, P1_, P8_).Limit(limit, offset).Find(_MenuTree)\n\treturn _MenuTree, err\n}", "title": "" }, { "docid": "cd2a11b64138cde1ccb62152a227f221", "score": "0.7473878", "text": "func GetMenuTreesByEnabledAndHasChildrenAndP8(offset int, limit int, Enabled_ int, HasChildren_ int, P8_ int) (*[]*MenuTree, error) {\n\tvar _MenuTree = new([]*MenuTree)\n\terr := Engine.Table(\"menu_tree\").Where(\"enabled = ? and has_children = ? and p8 = ?\", Enabled_, HasChildren_, P8_).Limit(limit, offset).Find(_MenuTree)\n\treturn _MenuTree, err\n}", "title": "" }, { "docid": "eda94601edff9c06f4e9aab2ac94e85c", "score": "0.7472625", "text": "func GetMenuTreesByOptionsAndDepthAndP8(offset int, limit int, Options_ []byte, Depth_ int, P8_ int) (*[]*MenuTree, error) {\n\tvar _MenuTree = new([]*MenuTree)\n\terr := Engine.Table(\"menu_tree\").Where(\"options = ? and depth = ? and p8 = ?\", Options_, Depth_, P8_).Limit(limit, offset).Find(_MenuTree)\n\treturn _MenuTree, err\n}", "title": "" }, { "docid": "9e86218c61fa25550f4641e084bf718f", "score": "0.7472177", "text": "func GetMenuTreesByHasChildrenAndP6(offset int, limit int, HasChildren_ int, P6_ int) (*[]*MenuTree, error) {\n\tvar _MenuTree = new([]*MenuTree)\n\terr := Engine.Table(\"menu_tree\").Where(\"has_children = ? and p6 = ?\", HasChildren_, P6_).Limit(limit, offset).Find(_MenuTree)\n\treturn _MenuTree, err\n}", "title": "" }, { "docid": "3c090ddbfd7924563f9c4c0281bb49e0", "score": "0.7468951", "text": "func GetMenuTreesByIdAndDepthAndP6(offset int, limit int, Id_ string, Depth_ int, P6_ int) (*[]*MenuTree, error) {\n\tvar _MenuTree = new([]*MenuTree)\n\terr := Engine.Table(\"menu_tree\").Where(\"id = ? and depth = ? and p6 = ?\", Id_, Depth_, P6_).Limit(limit, offset).Find(_MenuTree)\n\treturn _MenuTree, err\n}", "title": "" }, { "docid": "23a9b50f60133d1d350dae136797d383", "score": "0.7468414", "text": "func GetMenuTreesByP1AndP8(offset int, limit int, P1_ int, P8_ int) (*[]*MenuTree, error) {\n\tvar _MenuTree = new([]*MenuTree)\n\terr := Engine.Table(\"menu_tree\").Where(\"p1 = ? and p8 = ?\", P1_, P8_).Limit(limit, offset).Find(_MenuTree)\n\treturn _MenuTree, err\n}", "title": "" }, { "docid": "0ef4e701d1147be1db8eb028d5e6b0eb", "score": "0.7468301", "text": "func GetMenuTreesByDiscoveredAndDepthAndP6(offset int, limit int, Discovered_ int, Depth_ int, P6_ int) (*[]*MenuTree, error) {\n\tvar _MenuTree = new([]*MenuTree)\n\terr := Engine.Table(\"menu_tree\").Where(\"discovered = ? and depth = ? and p6 = ?\", Discovered_, Depth_, P6_).Limit(limit, offset).Find(_MenuTree)\n\treturn _MenuTree, err\n}", "title": "" }, { "docid": "01ef050919a5202943fa147f0f4d80c0", "score": "0.74676347", "text": "func GetMenuTreesByParentAndWeightAndP6(offset int, limit int, Parent_ string, Weight_ int, P6_ int) (*[]*MenuTree, error) {\n\tvar _MenuTree = new([]*MenuTree)\n\terr := Engine.Table(\"menu_tree\").Where(\"parent = ? and weight = ? and p6 = ?\", Parent_, Weight_, P6_).Limit(limit, offset).Find(_MenuTree)\n\treturn _MenuTree, err\n}", "title": "" }, { "docid": "67c58359a7602794d37fbf775d4b1295", "score": "0.7466207", "text": "func GetMenuTreesByP2AndP7AndP8(offset int, limit int, P2_ int, P7_ int, P8_ int) (*[]*MenuTree, error) {\n\tvar _MenuTree = new([]*MenuTree)\n\terr := Engine.Table(\"menu_tree\").Where(\"p2 = ? and p7 = ? and p8 = ?\", P2_, P7_, P8_).Limit(limit, offset).Find(_MenuTree)\n\treturn _MenuTree, err\n}", "title": "" }, { "docid": "78e74ca7e83091f060b26613bde612d2", "score": "0.74629116", "text": "func GetMenuTreesByMlidAndParentAndP6(offset int, limit int, Mlid_ int, Parent_ string, P6_ int) (*[]*MenuTree, error) {\n\tvar _MenuTree = new([]*MenuTree)\n\terr := Engine.Table(\"menu_tree\").Where(\"mlid = ? and parent = ? and p6 = ?\", Mlid_, Parent_, P6_).Limit(limit, offset).Find(_MenuTree)\n\treturn _MenuTree, err\n}", "title": "" }, { "docid": "c79f36397dc8cdbf17daa161b45c8adc", "score": "0.74617535", "text": "func GetMenuTreesByHasChildrenAndDepthAndP6(offset int, limit int, HasChildren_ int, Depth_ int, P6_ int) (*[]*MenuTree, error) {\n\tvar _MenuTree = new([]*MenuTree)\n\terr := Engine.Table(\"menu_tree\").Where(\"has_children = ? and depth = ? and p6 = ?\", HasChildren_, Depth_, P6_).Limit(limit, offset).Find(_MenuTree)\n\treturn _MenuTree, err\n}", "title": "" }, { "docid": "8abae70359d3b20e1217bba1264ecd30", "score": "0.74571544", "text": "func GetMenuTreesByProviderAndEnabledAndP6(offset int, limit int, Provider_ string, Enabled_ int, P6_ int) (*[]*MenuTree, error) {\n\tvar _MenuTree = new([]*MenuTree)\n\terr := Engine.Table(\"menu_tree\").Where(\"provider = ? and enabled = ? and p6 = ?\", Provider_, Enabled_, P6_).Limit(limit, offset).Find(_MenuTree)\n\treturn _MenuTree, err\n}", "title": "" } ]
c3f583b980043bef6e48db7730176200
pickRecommendedInstanceTypeE returns the first instance type from instanceTypeOptions that is available in all the AZs in availabilityZones based on the availability data in instanceTypeOfferings. If none of the instance types are available in all AZs, this function returns an error.
[ { "docid": "2637634d836eba6572f764475bd6b46b", "score": "0.89155734", "text": "func pickRecommendedInstanceTypeE(availabilityZones []string, instanceTypeOfferings []*ec2.InstanceTypeOffering, instanceTypeOptions []string) (string, error) {\n\t// O(n^3) for the win!\n\tfor _, instanceType := range instanceTypeOptions {\n\t\tif instanceTypeExistsInAllAzs(instanceType, availabilityZones, instanceTypeOfferings) {\n\t\t\treturn instanceType, nil\n\t\t}\n\t}\n\n\treturn \"\", NoInstanceTypeError{InstanceTypeOptions: instanceTypeOptions, Azs: availabilityZones}\n}", "title": "" } ]
[ { "docid": "3c9854daeaac801722b9d86704e9fde5", "score": "0.7157439", "text": "func GetRecommendedInstanceTypeWithClientE(t testing.TestingT, ec2Client *ec2.EC2, instanceTypeOptions []string) (string, error) {\n\tavailabilityZones, err := getAllAvailabilityZonesE(ec2Client)\n\tif err != nil {\n\t\treturn \"\", err\n\t}\n\n\tinstanceTypeOfferings, err := getInstanceTypeOfferingsE(ec2Client, instanceTypeOptions)\n\tif err != nil {\n\t\treturn \"\", err\n\t}\n\n\treturn pickRecommendedInstanceTypeE(availabilityZones, instanceTypeOfferings, instanceTypeOptions)\n}", "title": "" }, { "docid": "62c86878bdbf8c8e944911a99eea8aa6", "score": "0.70967185", "text": "func GetRecommendedInstanceTypeE(t testing.TestingT, region string, instanceTypeOptions []string) (string, error) {\n\tclient, err := NewEc2ClientE(t, region)\n\tif err != nil {\n\t\treturn \"\", err\n\t}\n\treturn GetRecommendedInstanceTypeWithClientE(t, client, instanceTypeOptions)\n}", "title": "" }, { "docid": "b559eaf88001a9847a2d83b0ef540317", "score": "0.69471014", "text": "func getInstanceTypeOfferingsE(client *ec2.EC2, instanceTypeOptions []string) ([]*ec2.InstanceTypeOffering, error) {\n\tinput := ec2.DescribeInstanceTypeOfferingsInput{\n\t\tLocationType: aws.String(ec2.LocationTypeAvailabilityZone),\n\t\tFilters: []*ec2.Filter{\n\t\t\t{\n\t\t\t\tName: aws.String(\"instance-type\"),\n\t\t\t\tValues: aws.StringSlice(instanceTypeOptions),\n\t\t\t},\n\t\t},\n\t}\n\n\tout, err := client.DescribeInstanceTypeOfferings(&input)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\treturn out.InstanceTypeOfferings, nil\n}", "title": "" }, { "docid": "141a49ecdbfbc72bb8a2e0c6cc49b67e", "score": "0.68822473", "text": "func GetRecommendedInstanceType(t testing.TestingT, region string, instanceTypeOptions []string) string {\n\tout, err := GetRecommendedInstanceTypeE(t, region, instanceTypeOptions)\n\trequire.NoError(t, err)\n\treturn out\n}", "title": "" }, { "docid": "e9d784e6ba6543ed7f3e8c1ff9f4675f", "score": "0.6238481", "text": "func InstanceType(need reflow.Resources, spot bool) (string, reflow.Resources) {\n\terr := initOnce.Do(func() error {\n\t\tvar configs []instanceConfig\n\t\tfor _, config := range instanceTypes {\n\t\t\tconfigs = append(configs, config)\n\t\t}\n\t\tif len(configs) == 0 {\n\t\t\treturn fmt.Errorf(\"no configured instance types\")\n\t\t}\n\t\tallInstancesState = newInstanceState(configs, time.Millisecond, \"us-west-2\")\n\t\treturn nil\n\t})\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\n\tconfig, _ := allInstancesState.MinAvailable(need, spot)\n\treturn config.Type, config.Resources\n}", "title": "" }, { "docid": "d8958709ab4a5c6e40175897a66258ca", "score": "0.5801071", "text": "func (s *instanceState) MinAvailable(need reflow.Resources, spot bool) (instanceConfig, bool) {\n\ts.mu.Lock()\n\tdefer s.mu.Unlock()\n\tvar (\n\t\tprice float64\n\t\tbest instanceConfig\n\t\tbestPrice = math.MaxFloat64\n\t\tfound, ok bool\n\t\tviable []instanceConfig\n\t)\n\tfor _, config := range s.configs {\n\t\tif time.Since(s.unavailable[config.Type]) < s.sleepTime || (spot && !config.SpotOk) {\n\t\t\tcontinue\n\t\t}\n\t\tif !config.Resources.Available(need) {\n\t\t\tcontinue\n\t\t}\n\t\tif price, ok = config.Price[s.region]; !ok {\n\t\t\tcontinue\n\t\t}\n\t\tviable = append(viable, config)\n\t\tif price < bestPrice {\n\t\t\tbestPrice = price\n\t\t\tbest = config\n\t\t}\n\t}\n\t// Choose a higher cost but better EBS throughput instance type if applicable.\n\tfor _, config := range viable {\n\t\tprice = config.Price[s.region]\n\t\t// Prefer a reasonably more expensive one with higher EBS throughput\n\t\tif !found &&\n\t\t\t(price < bestPrice+ebsThroughputPremiumCost ||\n\t\t\t\tprice < bestPrice*(1.0+ebsThroughputPremiumPct/100)) &&\n\t\t\tconfig.EBSThroughput > best.EBSThroughput*(1.0+ebsThroughputBenefitPct/100) {\n\t\t\tbestPrice = price\n\t\t\tbest = config\n\t\t\tfound = true\n\t\t}\n\t\t// Prefer a cheaper one with same EBS throughput.\n\t\tif found && price < bestPrice && config.EBSThroughput >= best.EBSThroughput {\n\t\t\tbestPrice = price\n\t\t\tbest = config\n\t\t}\n\t}\n\treturn best, best.Resources.Available(need)\n}", "title": "" }, { "docid": "b3bf6248210b65ea04d72b0675c03279", "score": "0.5585422", "text": "func (o ReservedInstanceOutput) OfferingType() pulumi.StringOutput {\n\treturn o.ApplyT(func(v *ReservedInstance) pulumi.StringOutput { return v.OfferingType }).(pulumi.StringOutput)\n}", "title": "" }, { "docid": "434de103cf3851cdbb2ee316ca6ed223", "score": "0.5416783", "text": "func hasOffering(instanceTypeOfferings []*ec2.InstanceTypeOffering, availabilityZone string, instanceType string) bool {\n\tfor _, offering := range instanceTypeOfferings {\n\t\tif aws.StringValue(offering.InstanceType) == instanceType && aws.StringValue(offering.Location) == availabilityZone {\n\t\t\treturn true\n\t\t}\n\t}\n\n\treturn false\n}", "title": "" }, { "docid": "ee763b78ddf40343bc10552371118dd0", "score": "0.52356344", "text": "func (o GetInstanceTypeOfferingsBrokerInstanceOptionOutput) HostInstanceType() pulumi.StringOutput {\n\treturn o.ApplyT(func(v GetInstanceTypeOfferingsBrokerInstanceOption) string { return v.HostInstanceType }).(pulumi.StringOutput)\n}", "title": "" }, { "docid": "762c350d65c1858790ae53cb1207d9de", "score": "0.51755047", "text": "func (e EMR) getEMRInstanceTypes(version semver.Version) ([]string, error) {\n\tinstanceTypes := []string{}\n\n\tfor _, instanceType := range e.getAllEMRInstanceTypes() {\n\t\tif semver.MustParseRange(\">=5.33.0\")(version) {\n\t\t\tinstanceTypes = append(instanceTypes, instanceType)\n\t\t} else if semver.MustParseRange(\">=5.25.0 <5.33.0\")(version) {\n\t\t\tif e.isOnlyEMR_5_33_0_plus(instanceType) {\n\t\t\t\tcontinue\n\t\t\t}\n\t\t\tinstanceTypes = append(instanceTypes, instanceType)\n\t\t} else if semver.MustParseRange(\">=5.20.0 <5.25.0\")(version) {\n\t\t\tif e.isOnlyEMR_5_25_0_plus(instanceType) {\n\t\t\t\tcontinue\n\t\t\t}\n\t\t\tif e.isOnlyEMR_5_33_0_plus(instanceType) {\n\t\t\t\tcontinue\n\t\t\t}\n\t\t\tinstanceTypes = append(instanceTypes, instanceType)\n\t\t} else if semver.MustParseRange(\">=5.15.0 <5.20.0\")(version) {\n\t\t\tif instanceType == \"c1.medium\" {\n\t\t\t\tcontinue\n\t\t\t}\n\t\t\tif e.isOnlyEMR_5_20_0_plus(instanceType) {\n\t\t\t\tcontinue\n\t\t\t}\n\t\t\tif e.isOnlyEMR_5_25_0_plus(instanceType) {\n\t\t\t\tcontinue\n\t\t\t}\n\t\t\tif e.isOnlyEMR_5_33_0_plus(instanceType) {\n\t\t\t\tcontinue\n\t\t\t}\n\t\t\tinstanceTypes = append(instanceTypes, instanceType)\n\t\t} else if semver.MustParseRange(\">=5.13.0 <5.15.0\")(version) {\n\t\t\tif e.isOnlyEMR_5_20_0_plus(instanceType) {\n\t\t\t\tcontinue\n\t\t\t}\n\t\t\tif e.isOnlyEMR_5_25_0_plus(instanceType) {\n\t\t\t\tcontinue\n\t\t\t}\n\t\t\tif e.isOnlyEMR_5_33_0_plus(instanceType) {\n\t\t\t\tcontinue\n\t\t\t}\n\t\t\tinstanceTypes = append(instanceTypes, instanceType)\n\t\t} else if semver.MustParseRange(\">=5.9.0 <5.13.0\")(version) {\n\t\t\tif e.isEMR_5_13_0_plus(instanceType) {\n\t\t\t\tcontinue\n\t\t\t}\n\t\t\tif e.isOnlyEMR_5_20_0_plus(instanceType) {\n\t\t\t\tcontinue\n\t\t\t}\n\t\t\tif e.isOnlyEMR_5_25_0_plus(instanceType) {\n\t\t\t\tcontinue\n\t\t\t}\n\t\t\tif e.isOnlyEMR_5_33_0_plus(instanceType) {\n\t\t\t\tcontinue\n\t\t\t}\n\t\t\tinstanceTypes = append(instanceTypes, instanceType)\n\t\t} else {\n\t\t\tif e.isEMR_5_13_0_plus(instanceType) {\n\t\t\t\tcontinue\n\t\t\t}\n\t\t\tif e.isOnlyEMR_5_20_0_plus(instanceType) {\n\t\t\t\tcontinue\n\t\t\t}\n\t\t\tif e.isOnlyEMR_5_25_0_plus(instanceType) {\n\t\t\t\tcontinue\n\t\t\t}\n\t\t\tif e.isOnlyEMR_5_33_0_plus(instanceType) {\n\t\t\t\tcontinue\n\t\t\t}\n\t\t\tif strings.HasPrefix(instanceType, \"i3\") {\n\t\t\t\tcontinue\n\t\t\t}\n\t\t\tinstanceTypes = append(instanceTypes, instanceType)\n\t\t}\n\t}\n\treturn instanceTypes, nil\n}", "title": "" }, { "docid": "f4b8b2b51cf600429a308fce848edab7", "score": "0.5162926", "text": "func (o SpotFleetRequestLaunchTemplateConfigOverrideOutput) InstanceType() pulumi.StringPtrOutput {\n\treturn o.ApplyT(func(v SpotFleetRequestLaunchTemplateConfigOverride) *string { return v.InstanceType }).(pulumi.StringPtrOutput)\n}", "title": "" }, { "docid": "5250d82bb28290bed2aef884a608f3d9", "score": "0.51586914", "text": "func instanceTypeExistsInAllAzs(instanceType string, availabilityZones []string, instanceTypeOfferings []*ec2.InstanceTypeOffering) bool {\n\tif len(availabilityZones) == 0 || len(instanceTypeOfferings) == 0 {\n\t\treturn false\n\t}\n\n\tfor _, az := range availabilityZones {\n\t\tif !hasOffering(instanceTypeOfferings, az, instanceType) {\n\t\t\treturn false\n\t\t}\n\t}\n\n\treturn true\n}", "title": "" }, { "docid": "b229b5276a0291bd3ad55d89f7e22c13", "score": "0.51113003", "text": "func WithInstanceType(instanceType string) func(args []string) []string {\n\treturn func(args []string) []string {\n\t\targs = append(args, \"--instance-type\")\n\t\targs = append(args, \"t2.medium\")\n\t\treturn args\n\t}\n}", "title": "" }, { "docid": "808fd5e0f9bf69b1445be23a89fc4b52", "score": "0.50413954", "text": "func (in *InstanceTypeOffering) DeepCopy() *InstanceTypeOffering {\n\tif in == nil {\n\t\treturn nil\n\t}\n\tout := new(InstanceTypeOffering)\n\tin.DeepCopyInto(out)\n\treturn out\n}", "title": "" }, { "docid": "17687bb4c8ecc2dc5ef730f49bc7aad5", "score": "0.5034964", "text": "func (o Ipv6EgressRuleOutput) InstanceType() pulumi.StringOutput {\n\treturn o.ApplyT(func(v *Ipv6EgressRule) pulumi.StringOutput { return v.InstanceType }).(pulumi.StringOutput)\n}", "title": "" }, { "docid": "3b98285f6f1d75b5583accf85d443a25", "score": "0.5026367", "text": "func (o SpotFleetRequestLaunchSpecificationOutput) InstanceType() pulumi.StringOutput {\n\treturn o.ApplyT(func(v SpotFleetRequestLaunchSpecification) string { return v.InstanceType }).(pulumi.StringOutput)\n}", "title": "" }, { "docid": "4efb7143fbba8cf3f7717b5f90b27634", "score": "0.5006058", "text": "func (o GetInstanceTypeOfferingsBrokerInstanceOptionOutput) EngineType() pulumi.StringOutput {\n\treturn o.ApplyT(func(v GetInstanceTypeOfferingsBrokerInstanceOption) string { return v.EngineType }).(pulumi.StringOutput)\n}", "title": "" }, { "docid": "a54f4c6f0f417e6c860a27e56a699d09", "score": "0.5002588", "text": "func (s *instanceState) MaxAvailable(need reflow.Resources, spot bool) (instanceConfig, bool) {\n\ts.mu.Lock()\n\tdefer s.mu.Unlock()\n\tvar (\n\t\tbest instanceConfig\n\t\tdistance = -math.MaxFloat64\n\t)\n\tfor _, config := range s.configs {\n\t\tif time.Since(s.unavailable[config.Type]) < s.sleepTime || (spot && !config.SpotOk) {\n\t\t\tcontinue\n\t\t}\n\t\tif !config.Resources.Available(need) {\n\t\t\tcontinue\n\t\t}\n\t\tif d := config.Resources.ScaledDistance(need); d > distance {\n\t\t\tdistance = d\n\t\t\tbest = config\n\t\t}\n\t}\n\treturn best, best.Resources.Available(need)\n}", "title": "" }, { "docid": "fa87688a2d65ba242f34afd285ede9f5", "score": "0.49377653", "text": "func (p *InstanceProvider) Create(ctx context.Context,\n\tlaunchTemplate *ec2.LaunchTemplate,\n\tinstanceTypeOptions []string,\n\tzonalSubnetOptions map[string][]*ec2.Subnet,\n) (*string, error) {\n\t// 1. Construct override options.\n\tvar overrides []*ec2.FleetLaunchTemplateOverridesRequest\n\tfor _, instanceType := range instanceTypeOptions {\n\t\tfor zone, subnets := range zonalSubnetOptions {\n\t\t\toverrides = append(overrides, &ec2.FleetLaunchTemplateOverridesRequest{\n\t\t\t\tAvailabilityZone: aws.String(zone),\n\t\t\t\tInstanceType: aws.String(instanceType),\n\t\t\t\t// FleetAPI cannot span subnets from the same AZ, so randomize.\n\t\t\t\tSubnetId: aws.String(*subnets[rand.Intn(len(subnets))].SubnetId),\n\t\t\t})\n\t\t}\n\t}\n\n\t// 2. Create fleet\n\tcreateFleetOutput, err := p.ec2.CreateFleetWithContext(ctx, &ec2.CreateFleetInput{\n\t\tType: aws.String(ec2.FleetTypeInstant),\n\t\tTargetCapacitySpecification: &ec2.TargetCapacitySpecificationRequest{\n\t\t\tDefaultTargetCapacityType: aws.String(ec2.DefaultTargetCapacityTypeOnDemand),\n\t\t\tTotalTargetCapacity: aws.Int64(1),\n\t\t},\n\t\tLaunchTemplateConfigs: []*ec2.FleetLaunchTemplateConfigRequest{{\n\t\t\tLaunchTemplateSpecification: &ec2.FleetLaunchTemplateSpecificationRequest{\n\t\t\t\tLaunchTemplateName: launchTemplate.LaunchTemplateName,\n\t\t\t\tVersion: aws.String(\"$Default\"),\n\t\t\t},\n\t\t\tOverrides: overrides,\n\t\t}},\n\t})\n\tif err != nil {\n\t\treturn nil, fmt.Errorf(\"creating fleet %w\", err)\n\t}\n\t// TODO aggregate errors\n\tif count := len(createFleetOutput.Errors); count > 0 {\n\t\treturn nil, fmt.Errorf(\"errors while creating fleet, %v\", createFleetOutput.Errors)\n\t}\n\tif count := len(createFleetOutput.Instances); count != 1 {\n\t\treturn nil, fmt.Errorf(\"expected 1 instance, but got %d\", count)\n\t}\n\tif count := len(createFleetOutput.Instances[0].InstanceIds); count != 1 {\n\t\treturn nil, fmt.Errorf(\"expected 1 instance ids, but got %d\", count)\n\t}\n\treturn createFleetOutput.Instances[0].InstanceIds[0], nil\n}", "title": "" }, { "docid": "f710ec3a916f822f4131b6766021e20e", "score": "0.4908229", "text": "func (o LaunchTemplateInstanceMarketOptionsSpotOptionsOutput) SpotInstanceType() pulumi.StringPtrOutput {\n\treturn o.ApplyT(func(v LaunchTemplateInstanceMarketOptionsSpotOptions) *string { return v.SpotInstanceType }).(pulumi.StringPtrOutput)\n}", "title": "" }, { "docid": "52d5043ad29463c6b7883169f88334ec", "score": "0.4840764", "text": "func (o LookupEnvironmentResultOutput) InstanceType() pulumi.StringPtrOutput {\n\treturn o.ApplyT(func(v LookupEnvironmentResult) *string { return v.InstanceType }).(pulumi.StringPtrOutput)\n}", "title": "" }, { "docid": "62993b62e210bc0c048beeaa7b567b2b", "score": "0.48186225", "text": "func PossibleInstanceTypeValues() []InstanceType {\n\treturn []InstanceType{InstanceTypeDatabases, InstanceTypeMigrateEventProperties, InstanceTypeServers}\n}", "title": "" }, { "docid": "19c7de723d1fe45ce6a8ef56cafa7b60", "score": "0.4815135", "text": "func UnmarshalOfferingInstance(m map[string]json.RawMessage, result interface{}) (err error) {\n\tobj := new(OfferingInstance)\n\terr = core.UnmarshalPrimitive(m, \"id\", &obj.ID)\n\tif err != nil {\n\t\treturn\n\t}\n\terr = core.UnmarshalPrimitive(m, \"_rev\", &obj.Rev)\n\tif err != nil {\n\t\treturn\n\t}\n\terr = core.UnmarshalPrimitive(m, \"url\", &obj.URL)\n\tif err != nil {\n\t\treturn\n\t}\n\terr = core.UnmarshalPrimitive(m, \"crn\", &obj.CRN)\n\tif err != nil {\n\t\treturn\n\t}\n\terr = core.UnmarshalPrimitive(m, \"label\", &obj.Label)\n\tif err != nil {\n\t\treturn\n\t}\n\terr = core.UnmarshalPrimitive(m, \"catalog_id\", &obj.CatalogID)\n\tif err != nil {\n\t\treturn\n\t}\n\terr = core.UnmarshalPrimitive(m, \"offering_id\", &obj.OfferingID)\n\tif err != nil {\n\t\treturn\n\t}\n\terr = core.UnmarshalPrimitive(m, \"kind_format\", &obj.KindFormat)\n\tif err != nil {\n\t\treturn\n\t}\n\terr = core.UnmarshalPrimitive(m, \"version\", &obj.Version)\n\tif err != nil {\n\t\treturn\n\t}\n\terr = core.UnmarshalPrimitive(m, \"cluster_id\", &obj.ClusterID)\n\tif err != nil {\n\t\treturn\n\t}\n\terr = core.UnmarshalPrimitive(m, \"cluster_region\", &obj.ClusterRegion)\n\tif err != nil {\n\t\treturn\n\t}\n\terr = core.UnmarshalPrimitive(m, \"cluster_namespaces\", &obj.ClusterNamespaces)\n\tif err != nil {\n\t\treturn\n\t}\n\terr = core.UnmarshalPrimitive(m, \"cluster_all_namespaces\", &obj.ClusterAllNamespaces)\n\tif err != nil {\n\t\treturn\n\t}\n\terr = core.UnmarshalPrimitive(m, \"schematics_workspace_id\", &obj.SchematicsWorkspaceID)\n\tif err != nil {\n\t\treturn\n\t}\n\terr = core.UnmarshalPrimitive(m, \"resource_group_id\", &obj.ResourceGroupID)\n\tif err != nil {\n\t\treturn\n\t}\n\terr = core.UnmarshalPrimitive(m, \"install_plan\", &obj.InstallPlan)\n\tif err != nil {\n\t\treturn\n\t}\n\terr = core.UnmarshalPrimitive(m, \"channel\", &obj.Channel)\n\tif err != nil {\n\t\treturn\n\t}\n\terr = core.UnmarshalPrimitive(m, \"metadata\", &obj.Metadata)\n\tif err != nil {\n\t\treturn\n\t}\n\terr = core.UnmarshalModel(m, \"last_operation\", &obj.LastOperation, UnmarshalOfferingInstanceLastOperation)\n\tif err != nil {\n\t\treturn\n\t}\n\treflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj))\n\treturn\n}", "title": "" }, { "docid": "26aeac3a25c8ca67d867a4f4a282213f", "score": "0.47736782", "text": "func (o ClusterNodePoolNodeConfigReservationAffinityOutput) ConsumeReservationType() pulumi.StringOutput {\n\treturn o.ApplyT(func(v ClusterNodePoolNodeConfigReservationAffinity) string { return v.ConsumeReservationType }).(pulumi.StringOutput)\n}", "title": "" }, { "docid": "8b24ff03ffaa7fd86f9f9677ca2a5555", "score": "0.47433442", "text": "func (o EndpointConfigurationProductionVariantOutput) InstanceType() pulumi.StringOutput {\n\treturn o.ApplyT(func(v EndpointConfigurationProductionVariant) string { return v.InstanceType }).(pulumi.StringOutput)\n}", "title": "" }, { "docid": "703ca1e2e254b4f1f09fc92aec99b7d3", "score": "0.4686533", "text": "func (o FleetLaunchTemplateConfigOverrideInstanceRequirementsOutput) AllowedInstanceTypes() pulumi.StringArrayOutput {\n\treturn o.ApplyT(func(v FleetLaunchTemplateConfigOverrideInstanceRequirements) []string { return v.AllowedInstanceTypes }).(pulumi.StringArrayOutput)\n}", "title": "" }, { "docid": "a1083146771991ed6590fd1e8bfb838a", "score": "0.46844217", "text": "func (o GetInstanceTypeResultOutput) FreeTierEligible() pulumi.BoolOutput {\n\treturn o.ApplyT(func(v GetInstanceTypeResult) bool { return v.FreeTierEligible }).(pulumi.BoolOutput)\n}", "title": "" }, { "docid": "2c1dee21b62b6c1b0c0e701fa214e825", "score": "0.46784654", "text": "func (o ClusterNodeConfigReservationAffinityOutput) ConsumeReservationType() pulumi.StringOutput {\n\treturn o.ApplyT(func(v ClusterNodeConfigReservationAffinity) string { return v.ConsumeReservationType }).(pulumi.StringOutput)\n}", "title": "" }, { "docid": "dfc96a8473018ff5e072977f27583652", "score": "0.46779197", "text": "func ec2Instances(ctx context.Context, cfg *Config, sess *session.Session, status *QStatus) (instances []instanceDetails, err kv.Error) {\n\n\tsvc := ec2.New(sess)\n\n\tmaxResults := MaxResults\n\topts := ec2.DescribeInstanceTypesInput{\n\t\tMaxResults: &maxResults,\n\t}\n\n\tcandidates := []instanceDetails{}\n\n\t// First go through excluding the instances that simply dont have enough resources.\n\tfor {\n\t\ttypes, errGo := svc.DescribeInstanceTypes(&opts)\n\t\tif errGo != nil {\n\t\t\treturn instances, kv.Wrap(errGo).With(\"stack\", stack.Trace().TrimRuntime())\n\t\t}\n\t\tfor _, info := range types.InstanceTypes {\n\t\t\tif info.InstanceType == nil || len(*info.InstanceType) == 0 {\n\t\t\t\tcontinue\n\t\t\t}\n\n\t\t\tinst := instanceDetails{\n\t\t\t\tname: *info.InstanceType,\n\t\t\t}\n\n\t\t\t// Get the slots value for the resource\n\t\t\tif status.Resource.Gpus != 0 {\n\t\t\t\tif info.GpuInfo == nil {\n\t\t\t\t\tcontinue\n\t\t\t\t}\n\t\t\t\tmem, errGo := humanize.ParseBytes(status.Resource.GpuMem)\n\t\t\t\tif errGo != nil {\n\t\t\t\t\tlogger.Warn(\"Invalid GPU RAM amount\", \"Queue\", status.name, \"GPU RAM value\", status.Resource.GpuMem, \"stack\", stack.Trace().TrimRuntime())\n\t\t\t\t\tcontinue\n\t\t\t\t}\n\n\t\t\t\tif len(info.GpuInfo.Gpus) != 1 {\n\t\t\t\t\tlogger.Trace(\"heterogenous GPUs unsupported\", info.InstanceType, \"stack\", stack.Trace().TrimRuntime())\n\t\t\t\t\tcontinue\n\t\t\t\t}\n\t\t\t\tgpuInfo := *info.GpuInfo.Gpus[0]\n\n\t\t\t\tif gpuInfo.MemoryInfo == nil || gpuInfo.MemoryInfo.SizeInMiB == nil {\n\t\t\t\t\tlogger.Trace(\"GPUs memory size was unsupported\", info.InstanceType, \"stack\", stack.Trace().TrimRuntime())\n\t\t\t\t\tcontinue\n\t\t\t\t}\n\n\t\t\t\tmemNeededMiB := int64(mem / 1024 / 1024)\n\t\t\t\tif *gpuInfo.MemoryInfo.SizeInMiB < memNeededMiB {\n\t\t\t\t\tlogger.Trace(\"insufficent GPU mem\", info.InstanceType, status.Resource.GpuMem,\n\t\t\t\t\t\thumanize.Bytes(uint64(*gpuInfo.MemoryInfo.SizeInMiB)*1024*1024), \"stack\", stack.Trace().TrimRuntime())\n\t\t\t\t\tcontinue\n\t\t\t\t}\n\t\t\t\t// Determine if there are multiple cards and if so divide up the requested slots appropriately\n\t\t\t\t// before doing a query\n\t\t\t\tslotsPerCard := uint(status.Resource.Gpus) / uint(*gpuInfo.Count)\n\t\t\t\tif logger.IsTrace() {\n\t\t\t\t\tlogger.Trace(\"Looking at instance \", spew.Sdump(*info.GpuInfo), \"slotsPerCard\", slotsPerCard, \"stack\", stack.Trace().TrimRuntime())\n\t\t\t\t}\n\n\t\t\t\tdevices, err := cuda.GetDevices(slotsPerCard)\n\t\t\t\tif err != nil {\n\t\t\t\t\tlogger.Trace(err.Error(), \"stack\", stack.Trace().TrimRuntime())\n\t\t\t\t\tcontinue\n\t\t\t\t}\n\t\t\t\tdevName := *gpuInfo.Manufacturer + \" \" + *gpuInfo.Name\n\n\t\t\t\tfound := false\n\t\t\t\tfor _, device := range devices {\n\t\t\t\t\tif devName == device {\n\t\t\t\t\t\tfound = true\n\t\t\t\t\t\tbreak\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tif !found {\n\t\t\t\t\tlogger.Trace(\"GPU not supported\", info.InstanceType, devName, \"stack\", stack.Trace().TrimRuntime())\n\t\t\t\t\tcontinue\n\t\t\t\t}\n\n\t\t\t\t// Having obtained the device name we can now search out DB of know cards and make sure\n\t\t\t\t// this specific machine type has the capacity\n\t\t\t} else {\n\t\t\t\tif info.GpuInfo != nil {\n\t\t\t\t\t// Dont waste GPU instances on non GPU activities\n\t\t\t\t\tlogger.Trace(\"GPU not needed\", info.InstanceType, \"stack\", stack.Trace().TrimRuntime())\n\t\t\t\t\tcontinue\n\t\t\t\t}\n\t\t\t\tlogger.Trace(\"CPU workload\", info.InstanceType, \"stack\", stack.Trace().TrimRuntime())\n\t\t\t}\n\n\t\t\t// Check the machine RAM ensure we dont get a machine too small or large\n\t\t\tif len(status.Resource.Ram) != 0 {\n\t\t\t\tram, errGo := humanize.ParseBytes(status.Resource.Ram)\n\t\t\t\tif errGo != nil {\n\t\t\t\t\tlogger.Warn(\"Invalid RAM amount\", \"Queue\", status.name, \"RAM value\", status.Resource.Ram, \"stack\", stack.Trace().TrimRuntime())\n\t\t\t\t\tcontinue\n\t\t\t\t}\n\t\t\t\t// When we check for RAM make sure we have about 512MiB for overhead\n\t\t\t\tmachineRam := uint64(*info.MemoryInfo.SizeInMiB)\n\t\t\t\tramNeededMiB := uint64(ram/1024/1024 + 512)\n\n\t\t\t\tif ramNeededMiB > machineRam {\n\t\t\t\t\tlogger.Trace(\"ram too small\", info.InstanceType, status.Resource.Ram, humanize.Bytes(uint64(*info.MemoryInfo.SizeInMiB)*1024*1024))\n\t\t\t\t\tcontinue\n\t\t\t\t}\n\t\t\t}\n\t\t\tif logger.IsTrace() {\n\t\t\t\tlogger.Trace(\"kept\", inst.name, status.Resource.Ram, humanize.Bytes(uint64(*info.MemoryInfo.SizeInMiB)*1024*1024), \"stack\", stack.Trace().TrimRuntime())\n\t\t\t}\n\t\t\t// Build a resource structure to resemble the instance\n\t\t\t// Remove the overhead of the daemonsets etc that we expected, heuristic only\n\t\t\t// Validate it against the job and see if it schedules\n\t\t\t// If not discard it\n\n\t\t\t// EbsInfo *EbsInfo\n\t\t\t// GpuInfo *GpuInfo\n\t\t\t// InstanceStorageInfo *InstanceStorageInfo\n\t\t\t// MemoryInfo *MemoryInfo\n\t\t\t// ProcessorInfo *ProcessorInfo\n\t\t\t// VCpuInfo *VCpuInfo\n\t\t\t// Remove some cpu and memory as overhead for the daemonsets etc\n\t\t\tavailableRam := humanize.Bytes(uint64(*info.MemoryInfo.SizeInMiB-1024) * 1024 * 1024)\n\t\t\tavailableCpus := *info.VCpuInfo.DefaultVCpus - 1\n\t\t\tinst.resource = &server.Resource{\n\t\t\t\tCpus: uint(availableCpus),\n\t\t\t\tGpus: 0,\n\t\t\t\tHdd: \"1024 GB\", // HDD is dynamic so we go big when doing matching of resources\n\t\t\t\tRam: availableRam,\n\t\t\t\tGpuMem: \"0 GB\",\n\t\t\t\tGpuCount: 0,\n\t\t\t}\n\t\t\tif info.GpuInfo != nil {\n\t\t\t\tif len(info.GpuInfo.Gpus) != 0 {\n\t\t\t\t\tif inst.resource.Gpus, err = cuda.GetSlots(*info.GpuInfo.Gpus[0].Manufacturer + \" \" + *info.GpuInfo.Gpus[0].Name); err != nil {\n\t\t\t\t\t\tlogger.Trace(\"unrecognized GPU present\", info.InstanceType, *info.GpuInfo.Gpus[0].Manufacturer+\" \"+*info.GpuInfo.Gpus[0].Name, \"stack\", stack.Trace().TrimRuntime())\n\t\t\t\t\t\tcontinue\n\t\t\t\t\t}\n\t\t\t\t\tif err != nil {\n\t\t\t\t\t\tlogger.Trace(err.Error(), \"stack\", stack.Trace().TrimRuntime())\n\t\t\t\t\t\tcontinue\n\t\t\t\t\t}\n\t\t\t\t\tinst.resource.GpuMem = humanize.Bytes(uint64(*info.GpuInfo.Gpus[0].MemoryInfo.SizeInMiB) * 1024 * 1024)\n\t\t\t\t\tinst.resource.GpuCount = uint(*info.GpuInfo.Gpus[0].Count)\n\t\t\t\t}\n\t\t\t}\n\t\t\tcandidates = append(candidates, inst)\n\t\t}\n\n\t\tif types.NextToken == nil || len(*types.NextToken) == 0 {\n\t\t\tbreak\n\t\t}\n\t\topts.NextToken = types.NextToken\n\t}\n\n\tlogger.Debug(\"getting pricing, this takes a few moments\", \"region\", cfg.region, \"stack\", stack.Trace().TrimRuntime())\n\tpricing, errGo := price.NewPricing(cfg.region)\n\tif errGo != nil {\n\t\treturn nil, kv.Wrap(errGo).With(\"region\", cfg.region).With(\"stack\", stack.Trace().TrimRuntime())\n\t}\n\n\tinstances = []instanceDetails{}\n\n\texpensive := [][]string{}\n\terrors := [][]string{}\n\n\tprices := map[string]*price.Instance{}\n\tdetail, errGo := pricing.GetInstances(cfg.region)\n\tif errGo != nil {\n\t\treturn nil, kv.Wrap(errGo).With(\"region\", cfg.region).With(\"stack\", stack.Trace().TrimRuntime())\n\t}\n\n\tfor _, instance := range detail {\n\t\tprices[instance.Type] = instance\n\t}\n\n\tlogger.Debug(\"pricing completed\", \"region\", cfg.region, \"stack\", stack.Trace().TrimRuntime())\n\n\t// Now get the least cost machines even if they are much larger than needed\n\tfor _, instance := range candidates {\n\t\tdetail, isPresent := prices[instance.name]\n\t\tif !isPresent {\n\t\t\terrors = append(errors, []string{\"instance not priced\", \"instance\", fmt.Sprint(instance), \"stack\", stack.Trace().TrimRuntime().String()})\n\t\t\tcontinue\n\t\t}\n\t\tcost, err := parseMoney(fmt.Sprint(detail.Price))\n\t\tif err != nil {\n\t\t\terrors = append(errors, []string{err.Error(), \"instance\", fmt.Sprint(instance), \"stack\", stack.Trace().TrimRuntime().String()})\n\t\t\tcontinue\n\t\t}\n\t\tisLess, errGo := cfg.maxCost.LessThan(cost)\n\t\tif errGo != nil {\n\t\t\terrors = append(errors, []string{errGo.Error(), \"instance\", fmt.Sprint(instance), \"stack\", stack.Trace().TrimRuntime().String()})\n\t\t\tcontinue\n\t\t}\n\t\tif isLess {\n\t\t\tif logger.IsTrace() {\n\t\t\t\texpensive = append(expensive, []string{fmt.Sprint(instance), cost.Display()})\n\t\t\t}\n\t\t\tcontinue\n\t\t}\n\t\tinstance.cost = detail\n\t\tinstances = append(instances, instance)\n\t}\n\n\tif len(errors) != 0 {\n\t\tdetails := []interface{}{}\n\t\tfor _, msgItems := range errors {\n\t\t\tfor _, msgItem := range msgItems {\n\t\t\t\tdetails = append(details, msgItem)\n\t\t\t}\n\t\t}\n\t\tlogger.Warn(details[0].(string), details[1:]...)\n\t}\n\tif len(expensive) != 0 {\n\t\tdetails := []interface{}{}\n\t\tfor _, msgItems := range expensive {\n\t\t\tfor _, msgItem := range msgItems {\n\t\t\t\tdetails = append(details, msgItem)\n\t\t\t}\n\t\t}\n\t\tlogger.Trace(\"too expensive\", details...)\n\t}\n\n\tsort.Slice(instances, func(i, j int) bool { return instances[i].cost.Price < instances[j].cost.Price })\n\n\treturn instances, nil\n}", "title": "" }, { "docid": "16c99096c1687c2ac7e93289c8d11f8f", "score": "0.4664742", "text": "func (o LaunchTemplateInstanceMarketOptionsSpotOptionsPtrOutput) SpotInstanceType() pulumi.StringPtrOutput {\n\treturn o.ApplyT(func(v *LaunchTemplateInstanceMarketOptionsSpotOptions) *string {\n\t\tif v == nil {\n\t\t\treturn nil\n\t\t}\n\t\treturn v.SpotInstanceType\n\t}).(pulumi.StringPtrOutput)\n}", "title": "" }, { "docid": "ae5932a6aeb56dc9befd9d8a337d06d8", "score": "0.46630388", "text": "func (n *NodeGroupService) ExpandInstanceSelectorOptions(nodePools []api.NodePool, clusterAZs []string) error {\n\tinstanceTypesMatch := func(a, b []string) bool {\n\t\treturn reflect.DeepEqual(a, b)\n\t}\n\n\tinstanceTypesMismatchErr := func(ng *api.NodeGroupBase, path string) error {\n\t\treturn errors.Errorf(\"instance types matched by instance selector criteria do not match %s.instanceTypes for nodegroup %q; either remove instanceSelector or instanceTypes and retry the operation\", path, ng.Name)\n\t}\n\n\tfor _, np := range nodePools {\n\t\tbaseNG := np.BaseNodeGroup()\n\t\tif baseNG.InstanceSelector == nil || baseNG.InstanceSelector.IsZero() {\n\t\t\tcontinue\n\t\t}\n\n\t\tazs := clusterAZs\n\t\tif len(baseNG.AvailabilityZones) != 0 {\n\t\t\tazs = baseNG.AvailabilityZones\n\t\t}\n\t\tinstanceTypes, err := n.expandInstanceSelector(baseNG.InstanceSelector, azs)\n\t\tif err != nil {\n\t\t\treturn errors.Wrapf(err, \"error expanding instance selector options for nodegroup %q\", baseNG.Name)\n\t\t}\n\n\t\tif len(instanceTypes) > maxInstanceTypes {\n\t\t\treturn errors.Errorf(\"instance selector filters resulted in %d instance types, which is greater than the maximum of %d, please set more selector options\", len(instanceTypes), maxInstanceTypes)\n\t\t}\n\n\t\tswitch ng := np.(type) {\n\t\tcase *api.NodeGroup:\n\t\t\tif ng.InstancesDistribution == nil {\n\t\t\t\tng.InstancesDistribution = &api.NodeGroupInstancesDistribution{}\n\t\t\t}\n\t\t\tif len(ng.InstancesDistribution.InstanceTypes) > 0 {\n\t\t\t\tif !instanceTypesMatch(ng.InstancesDistribution.InstanceTypes, instanceTypes) {\n\t\t\t\t\treturn instanceTypesMismatchErr(baseNG, \"nodeGroup.instancesDistribution\")\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\tng.InstancesDistribution.InstanceTypes = instanceTypes\n\t\t\t}\n\n\t\tcase *api.ManagedNodeGroup:\n\t\t\tif len(ng.InstanceTypes) > 0 {\n\t\t\t\tif !instanceTypesMatch(ng.InstanceTypes, instanceTypes) {\n\t\t\t\t\treturn instanceTypesMismatchErr(baseNG, \"managedNodeGroup.instanceTypes\")\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\tng.InstanceTypes = instanceTypes\n\t\t\t}\n\n\t\tdefault:\n\t\t\treturn errors.Errorf(\"unhandled NodePool type %T\", np)\n\t\t}\n\t}\n\treturn nil\n}", "title": "" }, { "docid": "c7f1d12a6f06c42c17e587f0050e340c", "score": "0.4643635", "text": "func (o AwsNodePoolConfigOutput) InstanceType() pulumi.StringPtrOutput {\n\treturn o.ApplyT(func(v AwsNodePoolConfig) *string { return v.InstanceType }).(pulumi.StringPtrOutput)\n}", "title": "" }, { "docid": "fa067844a22b2d5a4232c781a89f8c2a", "score": "0.45863172", "text": "func PickRandomInstance(group grp.InstanceGroup, cfg chaosmonkey.AppConfig, dep deploy.Deployment) (chaosmonkey.Instance, bool) {\n\tinstances, err := eligible.Instances(group, cfg.Exceptions, dep)\n\tif err != nil {\n\t\tlog.Printf(\"WARNING: eligible.Instances failed for %s: %v\", group, err)\n\t\treturn nil, false\n\t}\n\tif len(instances) == 0 {\n\t\treturn nil, false\n\t}\n\n\tr := rand.New(rand.NewSource(time.Now().UnixNano()))\n\tindex := r.Intn(len(instances))\n\treturn instances[index], true\n}", "title": "" }, { "docid": "ea18c63ebc563a19da750ffac770ed45", "score": "0.45816445", "text": "func (o SpotFleetRequestLaunchTemplateConfigOverrideInstanceRequirementsPtrOutput) AllowedInstanceTypes() pulumi.StringArrayOutput {\n\treturn o.ApplyT(func(v *SpotFleetRequestLaunchTemplateConfigOverrideInstanceRequirements) []string {\n\t\tif v == nil {\n\t\t\treturn nil\n\t\t}\n\t\treturn v.AllowedInstanceTypes\n\t}).(pulumi.StringArrayOutput)\n}", "title": "" }, { "docid": "b39dd184e18f792420e19c54ff0ed60f", "score": "0.45736498", "text": "func (i *awsInstance) getInstanceType() *awsInstanceType {\n\t// TODO: Make this real\n\tawsInstanceType := &awsInstanceType{}\n\treturn awsInstanceType\n}", "title": "" }, { "docid": "a7998f28388f0fdd21e61845ecd6de45", "score": "0.45716494", "text": "func (o LaunchConfigurationOutput) InstanceType() pulumi.StringOutput {\n\treturn o.ApplyT(func(v *LaunchConfiguration) pulumi.StringOutput { return v.InstanceType }).(pulumi.StringOutput)\n}", "title": "" }, { "docid": "3441a1031c99e528d020ec63feb9aba3", "score": "0.45319623", "text": "func (o GetInstanceTypeOfferingsBrokerInstanceOptionAvailabilityZoneOutput) Name() pulumi.StringOutput {\n\treturn o.ApplyT(func(v GetInstanceTypeOfferingsBrokerInstanceOptionAvailabilityZone) string { return v.Name }).(pulumi.StringOutput)\n}", "title": "" }, { "docid": "a95d9960a792ddd1ddfd482ca6e1a5e9", "score": "0.45253205", "text": "func (o GetInstanceTypeOfferingsBrokerInstanceOptionOutput) AvailabilityZones() GetInstanceTypeOfferingsBrokerInstanceOptionAvailabilityZoneArrayOutput {\n\treturn o.ApplyT(func(v GetInstanceTypeOfferingsBrokerInstanceOption) []GetInstanceTypeOfferingsBrokerInstanceOptionAvailabilityZone {\n\t\treturn v.AvailabilityZones\n\t}).(GetInstanceTypeOfferingsBrokerInstanceOptionAvailabilityZoneArrayOutput)\n}", "title": "" }, { "docid": "522744027296f981059dadaceb270ffe", "score": "0.45169556", "text": "func (o FleetLaunchTemplateConfigOverrideInstanceRequirementsPtrOutput) AllowedInstanceTypes() pulumi.StringArrayOutput {\n\treturn o.ApplyT(func(v *FleetLaunchTemplateConfigOverrideInstanceRequirements) []string {\n\t\tif v == nil {\n\t\t\treturn nil\n\t\t}\n\t\treturn v.AllowedInstanceTypes\n\t}).(pulumi.StringArrayOutput)\n}", "title": "" }, { "docid": "aed034874765f82c1df0a4d7a87c6ae9", "score": "0.45003468", "text": "func (p *AWSProfile) SetInstanceType(instanceType string) {\n\tExpect(instanceType).NotTo(BeEmpty(), \"should have a valid instance type\")\n\tcssSelector := fmt.Sprintf(\"%v .grv-installer-aws-instance-type\", getProfileCSSSelector(p.index))\n\tutils.SetDropdownValue(p.page, cssSelector, instanceType)\n}", "title": "" }, { "docid": "9e3d884d2b9d90ff79bf9425978d5255", "score": "0.44997066", "text": "func (o ClusterNodePoolNodeConfigReservationAffinityPtrOutput) ConsumeReservationType() pulumi.StringPtrOutput {\n\treturn o.ApplyT(func(v *ClusterNodePoolNodeConfigReservationAffinity) *string {\n\t\tif v == nil {\n\t\t\treturn nil\n\t\t}\n\t\treturn &v.ConsumeReservationType\n\t}).(pulumi.StringPtrOutput)\n}", "title": "" }, { "docid": "082cd6262ee984febc16b90fee4200a0", "score": "0.44936487", "text": "func (i *Instances) InstanceType(name types.NodeName) (string, error) {\n\treturn \"\", nil\n}", "title": "" }, { "docid": "1b9c6c896172bacb04751203ecaa380d", "score": "0.4493645", "text": "func (m *MachineInfo) GetInstanceType() string {\n\t//TODO: add implementation\n\treturn \"\"\n}", "title": "" }, { "docid": "77089e602f5b5fa57dc5b8fe6280bc64", "score": "0.44891304", "text": "func (o SpotFleetRequestLaunchTemplateConfigOverrideInstanceRequirementsOutput) AllowedInstanceTypes() pulumi.StringArrayOutput {\n\treturn o.ApplyT(func(v SpotFleetRequestLaunchTemplateConfigOverrideInstanceRequirements) []string {\n\t\treturn v.AllowedInstanceTypes\n\t}).(pulumi.StringArrayOutput)\n}", "title": "" }, { "docid": "33845d0c98cb25911bb12b829766bf0d", "score": "0.44817784", "text": "func (o ClusterHostGroupOutput) InstanceType() pulumi.StringPtrOutput {\n\treturn o.ApplyT(func(v ClusterHostGroup) *string { return v.InstanceType }).(pulumi.StringPtrOutput)\n}", "title": "" }, { "docid": "8ff019d91c89d17577e11e211816deaf", "score": "0.44734627", "text": "func (o AwsClusterControlPlaneOutput) InstanceType() pulumi.StringPtrOutput {\n\treturn o.ApplyT(func(v AwsClusterControlPlane) *string { return v.InstanceType }).(pulumi.StringPtrOutput)\n}", "title": "" }, { "docid": "9b135d6cf43b95665dcc1f9bb5f45cb0", "score": "0.44582188", "text": "func (as *availabilitySet) GetInstanceTypeByNodeName(name string) (string, error) {\n\tmachine, err := as.getVirtualMachine(types.NodeName(name), azcache.CacheReadTypeUnsafe)\n\tif err != nil {\n\t\tklog.Errorf(\"as.GetInstanceTypeByNodeName(%s) failed: as.getVirtualMachine(%s) err=%v\", name, name, err)\n\t\treturn \"\", err\n\t}\n\n\treturn string(machine.HardwareProfile.VMSize), nil\n}", "title": "" }, { "docid": "be43f0c9d68e191c87a7fdf04f8338df", "score": "0.44516236", "text": "func (o GetInstanceTypeResultOutput) SupportedPlacementStrategies() pulumi.StringArrayOutput {\n\treturn o.ApplyT(func(v GetInstanceTypeResult) []string { return v.SupportedPlacementStrategies }).(pulumi.StringArrayOutput)\n}", "title": "" }, { "docid": "735b178d22945294a88afcb19397b202", "score": "0.44430435", "text": "func (o TairInstanceOutput) InstanceType() pulumi.StringOutput {\n\treturn o.ApplyT(func(v *TairInstance) pulumi.StringOutput { return v.InstanceType }).(pulumi.StringOutput)\n}", "title": "" }, { "docid": "c2607003dfe7f72be9843896f1417bc1", "score": "0.44226804", "text": "func (l *leastwaste) BestOptions(expansionOptions []expander.Option, nodeInfo map[string]*schedulerframework.NodeInfo) []expander.Option {\n\tvar leastWastedScore float64\n\tvar leastWastedOptions []expander.Option\n\n\tfor _, option := range expansionOptions {\n\t\trequestedCPU, requestedMemory := resourcesForPods(option.Pods)\n\t\tnode, found := nodeInfo[option.NodeGroup.Id()]\n\t\tif !found {\n\t\t\tklog.Errorf(\"No node info for: %s\", option.NodeGroup.Id())\n\t\t\tcontinue\n\t\t}\n\n\t\tnodeCPU, nodeMemory := resourcesForNode(node.Node())\n\t\tavailCPU := nodeCPU.MilliValue() * int64(option.NodeCount)\n\t\tavailMemory := nodeMemory.Value() * int64(option.NodeCount)\n\t\twastedCPU := float64(availCPU-requestedCPU.MilliValue()) / float64(availCPU)\n\t\twastedMemory := float64(availMemory-requestedMemory.Value()) / float64(availMemory)\n\t\twastedScore := wastedCPU + wastedMemory\n\n\t\tklog.V(1).Infof(\"Expanding Node Group %s would waste %0.2f%% CPU, %0.2f%% Memory, %0.2f%% Blended\\n\", option.NodeGroup.Id(), wastedCPU*100.0, wastedMemory*100.0, wastedScore*50.0)\n\n\t\tif wastedScore == leastWastedScore {\n\t\t\tleastWastedOptions = append(leastWastedOptions, option)\n\t\t}\n\n\t\tif leastWastedOptions == nil || wastedScore < leastWastedScore {\n\t\t\tleastWastedScore = wastedScore\n\t\t\tleastWastedOptions = []expander.Option{option}\n\t\t}\n\t}\n\n\tif len(leastWastedOptions) == 0 {\n\t\treturn nil\n\t}\n\n\treturn leastWastedOptions\n}", "title": "" }, { "docid": "a0af4d139942ae2c776178b457b082f6", "score": "0.4415514", "text": "func (o ClusterNodeConfigReservationAffinityPtrOutput) ConsumeReservationType() pulumi.StringPtrOutput {\n\treturn o.ApplyT(func(v *ClusterNodeConfigReservationAffinity) *string {\n\t\tif v == nil {\n\t\t\treturn nil\n\t\t}\n\t\treturn &v.ConsumeReservationType\n\t}).(pulumi.StringPtrOutput)\n}", "title": "" }, { "docid": "f3955e0d536079bdf4d23387ad810849", "score": "0.4402978", "text": "func (o GetInstanceTypeResultOutput) EbsOptimizedSupport() pulumi.StringOutput {\n\treturn o.ApplyT(func(v GetInstanceTypeResult) string { return v.EbsOptimizedSupport }).(pulumi.StringOutput)\n}", "title": "" }, { "docid": "ffb3d249ce1acbc1ea0e16b5662cae1a", "score": "0.4402436", "text": "func GetInstance(ctx *pulumi.Context,\n\tname string, id pulumi.ID, state *InstanceState, opts ...pulumi.ResourceOpt) (*Instance, error) {\n\tinputs := make(map[string]interface{})\n\tif state != nil {\n\t\tinputs[\"agentVersion\"] = state.AgentVersion\n\t\tinputs[\"amiId\"] = state.AmiId\n\t\tinputs[\"architecture\"] = state.Architecture\n\t\tinputs[\"autoScalingType\"] = state.AutoScalingType\n\t\tinputs[\"availabilityZone\"] = state.AvailabilityZone\n\t\tinputs[\"createdAt\"] = state.CreatedAt\n\t\tinputs[\"deleteEbs\"] = state.DeleteEbs\n\t\tinputs[\"deleteEip\"] = state.DeleteEip\n\t\tinputs[\"ebsBlockDevices\"] = state.EbsBlockDevices\n\t\tinputs[\"ebsOptimized\"] = state.EbsOptimized\n\t\tinputs[\"ec2InstanceId\"] = state.Ec2InstanceId\n\t\tinputs[\"ecsClusterArn\"] = state.EcsClusterArn\n\t\tinputs[\"elasticIp\"] = state.ElasticIp\n\t\tinputs[\"ephemeralBlockDevices\"] = state.EphemeralBlockDevices\n\t\tinputs[\"hostname\"] = state.Hostname\n\t\tinputs[\"infrastructureClass\"] = state.InfrastructureClass\n\t\tinputs[\"installUpdatesOnBoot\"] = state.InstallUpdatesOnBoot\n\t\tinputs[\"instanceProfileArn\"] = state.InstanceProfileArn\n\t\tinputs[\"instanceType\"] = state.InstanceType\n\t\tinputs[\"lastServiceErrorId\"] = state.LastServiceErrorId\n\t\tinputs[\"layerIds\"] = state.LayerIds\n\t\tinputs[\"os\"] = state.Os\n\t\tinputs[\"platform\"] = state.Platform\n\t\tinputs[\"privateDns\"] = state.PrivateDns\n\t\tinputs[\"privateIp\"] = state.PrivateIp\n\t\tinputs[\"publicDns\"] = state.PublicDns\n\t\tinputs[\"publicIp\"] = state.PublicIp\n\t\tinputs[\"registeredBy\"] = state.RegisteredBy\n\t\tinputs[\"reportedAgentVersion\"] = state.ReportedAgentVersion\n\t\tinputs[\"reportedOsFamily\"] = state.ReportedOsFamily\n\t\tinputs[\"reportedOsName\"] = state.ReportedOsName\n\t\tinputs[\"reportedOsVersion\"] = state.ReportedOsVersion\n\t\tinputs[\"rootBlockDevices\"] = state.RootBlockDevices\n\t\tinputs[\"rootDeviceType\"] = state.RootDeviceType\n\t\tinputs[\"rootDeviceVolumeId\"] = state.RootDeviceVolumeId\n\t\tinputs[\"securityGroupIds\"] = state.SecurityGroupIds\n\t\tinputs[\"sshHostDsaKeyFingerprint\"] = state.SshHostDsaKeyFingerprint\n\t\tinputs[\"sshHostRsaKeyFingerprint\"] = state.SshHostRsaKeyFingerprint\n\t\tinputs[\"sshKeyName\"] = state.SshKeyName\n\t\tinputs[\"stackId\"] = state.StackId\n\t\tinputs[\"state\"] = state.State\n\t\tinputs[\"status\"] = state.Status\n\t\tinputs[\"subnetId\"] = state.SubnetId\n\t\tinputs[\"tenancy\"] = state.Tenancy\n\t\tinputs[\"virtualizationType\"] = state.VirtualizationType\n\t}\n\ts, err := ctx.ReadResource(\"aws:opsworks/instance:Instance\", name, id, inputs, opts...)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\treturn &Instance{s: s}, nil\n}", "title": "" }, { "docid": "ac9647cce8b8b7a1ab914a4497af9b7f", "score": "0.4396694", "text": "func (np *IMDSNodeProvider) InstanceType(ctx context.Context, name types.NodeName) (string, error) {\n\treturn np.azure.InstanceType(ctx, name)\n}", "title": "" }, { "docid": "dbd21d307226c2525e88ab907756f098", "score": "0.43689904", "text": "func (o TransitRouterGrantAttachmentOutput) InstanceType() pulumi.StringOutput {\n\treturn o.ApplyT(func(v *TransitRouterGrantAttachment) pulumi.StringOutput { return v.InstanceType }).(pulumi.StringOutput)\n}", "title": "" }, { "docid": "0c8367707873dc852344659ba5ca0ff2", "score": "0.43688062", "text": "func (p *DescribeReservedElasticsearchInstanceOfferingsPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*DescribeReservedElasticsearchInstanceOfferingsOutput, error) {\n\tif !p.HasMorePages() {\n\t\treturn nil, fmt.Errorf(\"no more pages available\")\n\t}\n\n\tparams := *p.params\n\tparams.NextToken = p.nextToken\n\n\tparams.MaxResults = p.options.Limit\n\n\tresult, err := p.client.DescribeReservedElasticsearchInstanceOfferings(ctx, &params, optFns...)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\tp.firstPage = false\n\n\tprevToken := p.nextToken\n\tp.nextToken = result.NextToken\n\n\tif p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken {\n\t\tp.nextToken = nil\n\t}\n\n\treturn result, nil\n}", "title": "" }, { "docid": "c8eb2bd88f298c1b8b122f622f3d5e4d", "score": "0.43679395", "text": "func pickFlavor(clientNova *gophercloud.ServiceClient, diskMB int, memoryMB int) (*flavors.Flavor, error) {\n\tif diskMB <= 0 {\n\t\treturn nil, errors.New(\"Please specify disk size.\", nil)\n\t}\n\n\tflavs, err := listFlavors(clientNova, int(math.Ceil(float64(diskMB)/1024)), memoryMB)\n\tif err != nil {\n\t\treturn nil, errors.New(\"listing flavors\", err)\n\t}\n\n\t// Find smallest flavor for given conditions.\n\tlogrus.WithField(\"flavors\", flavs).Infof(\"Find smallest flavor for conditions: diskMB >= %d AND memoryMB >= %d\\n\", diskMB, memoryMB)\n\n\tvar bestFlavor flavors.Flavor\n\tvar minDiffDisk int = -1\n\tvar minDiffMem int = -1\n\tfor _, f := range flavs {\n\t\tdiffDisk := f.Disk*1024 - diskMB\n\t\tvar diffMem int = 0 // 0 is best value\n\t\tif memoryMB > 0 {\n\t\t\tdiffMem = f.RAM - memoryMB\n\t\t}\n\n\t\tif diffDisk >= 0 && // disk is big enough\n\t\t\t(minDiffDisk == -1 || minDiffDisk > diffDisk) && // disk is smaller than current best, but still big enough\n\t\t\tdiffMem >= 0 && // memory is big enough\n\t\t\t(minDiffMem == -1 || minDiffMem >= diffMem) { // memory is smaller than current best, but still big enough\n\t\t\tbestFlavor, minDiffDisk, minDiffMem = f, diffDisk, diffMem\n\t\t}\n\t}\n\tif minDiffDisk == -1 {\n\t\treturn nil, errors.New(fmt.Sprintf(\"No flavor fits required conditions: diskMB >= %d AND memoryMB >= %d\\n\", diskMB, memoryMB), nil)\n\t}\n\treturn &bestFlavor, nil\n}", "title": "" }, { "docid": "7f4b7fd75d78018ac44c80fc0e20987b", "score": "0.43541148", "text": "func (ts *CloudServiceImpl) GetInstanceInfoByType(instanceType string) (*InstanceInfo, error) {\n\tif ts.cvmClient == nil {\n\t\treturn nil, fmt.Errorf(\"cvmClient is not initialized\")\n\t}\n\n\t// DescribeZoneInstanceConfigInfos\n\tinstanceTypeRequest := cvm.NewDescribeInstanceTypeConfigsRequest()\n\tinstanceTypeRequest.Filters = []*cvm.Filter{\n\t\t{\n\t\t\tName: common.StringPtr(\"instance-type\"),\n\t\t\tValues: []*string{&instanceType},\n\t\t},\n\t}\n\n\tresp, err := ts.cvmClient.DescribeInstanceTypeConfigs(instanceTypeRequest)\n\tmetrics.RegisterCloudAPIInvoked(\"cvm\", \"DescribeInstanceTypeConfigs\", err)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\tif resp == nil ||\n\t\tresp.Response == nil ||\n\t\tresp.Response.InstanceTypeConfigSet == nil ||\n\t\tlen(resp.Response.InstanceTypeConfigSet) < 1 ||\n\t\tresp.Response.InstanceTypeConfigSet[0].CPU == nil ||\n\t\tresp.Response.InstanceTypeConfigSet[0].Memory == nil ||\n\t\tresp.Response.InstanceTypeConfigSet[0].GPU == nil ||\n\t\tresp.Response.InstanceTypeConfigSet[0].InstanceFamily == nil ||\n\t\tresp.Response.InstanceTypeConfigSet[0].InstanceType == nil ||\n\t\tresp.Response.InstanceTypeConfigSet[0].Zone == nil {\n\t\treturn nil, fmt.Errorf(\"DescribeInstanceTypeConfigs returned a invalid response\")\n\t}\n\n\treturn &InstanceInfo{\n\t\t*resp.Response.InstanceTypeConfigSet[0].CPU,\n\t\t*resp.Response.InstanceTypeConfigSet[0].Memory,\n\t\t*resp.Response.InstanceTypeConfigSet[0].GPU,\n\t\t*resp.Response.InstanceTypeConfigSet[0].InstanceFamily,\n\t\t*resp.Response.InstanceTypeConfigSet[0].InstanceType,\n\t}, nil\n}", "title": "" }, { "docid": "9b6f9e8ab324f8efc88cf50de1f4a17f", "score": "0.43540248", "text": "func (o AwsNodePoolConfigPtrOutput) InstanceType() pulumi.StringPtrOutput {\n\treturn o.ApplyT(func(v *AwsNodePoolConfig) *string {\n\t\tif v == nil {\n\t\t\treturn nil\n\t\t}\n\t\treturn v.InstanceType\n\t}).(pulumi.StringPtrOutput)\n}", "title": "" }, { "docid": "8b54b9fd223cbd03d3a01b11a26c3713", "score": "0.43421957", "text": "func (f *Cloud) InstanceType(ctx context.Context, instance types.NodeName) (string, error) {\n\tf.addCall(\"instance-type\")\n\treturn f.InstanceTypes[instance], nil\n}", "title": "" }, { "docid": "21cf5f4570c9cfc70245ad2ed764dd3e", "score": "0.4336786", "text": "func (o HaVipv2Output) AssociatedInstanceType() pulumi.StringOutput {\n\treturn o.ApplyT(func(v *HaVipv2) pulumi.StringOutput { return v.AssociatedInstanceType }).(pulumi.StringOutput)\n}", "title": "" }, { "docid": "ce219ef7738fab9e5b4234dc5f76799d", "score": "0.4335972", "text": "func Windows10EditionTypePNotConfigured() *Windows10EditionType {\n\tv := Windows10EditionTypeVNotConfigured\n\treturn &v\n}", "title": "" }, { "docid": "cafa40eceff41342f874a9787660ac9c", "score": "0.43191686", "text": "func (o HAVipAttachmentOutput) InstanceType() pulumi.StringOutput {\n\treturn o.ApplyT(func(v *HAVipAttachment) pulumi.StringOutput { return v.InstanceType }).(pulumi.StringOutput)\n}", "title": "" }, { "docid": "f9affafaa39c714f77d95135b46c7b96", "score": "0.4291267", "text": "func (this *CreateInstanceRequest) SetInstanceType(v string) {\n\tthis.Set(\"InstanceType\", v)\n}", "title": "" }, { "docid": "73427ead7955228ba09aabe8d83f177b", "score": "0.42873067", "text": "func (r *Instance) InstanceType() pulumi.StringOutput {\n\treturn (pulumi.StringOutput)(r.s.State[\"instanceType\"])\n}", "title": "" }, { "docid": "2b65d3e50a71191ee985f06184813f25", "score": "0.42780164", "text": "func (o DdrInstanceOutput) InstanceType() pulumi.StringOutput {\n\treturn o.ApplyT(func(v *DdrInstance) pulumi.StringOutput { return v.InstanceType }).(pulumi.StringOutput)\n}", "title": "" }, { "docid": "5c563e53d870c9d4122dc63acaea1bcf", "score": "0.4263364", "text": "func (base *SLXBase) GetEvpnInstance(client *client.NetconfClient) (operation.ConfigEVPNRespone, error) {\n\tresponse := operation.ConfigEVPNRespone{}\n\tresp, err := client.GetConfig(\"/routing-system/evpn-config\")\n\tdoc := etree.NewDocument()\n\n\tif err := doc.ReadFromBytes([]byte(resp)); err != nil {\n\t\tfmt.Println(err)\n\t\treturn response, err\n\t}\n\n\tif elem := doc.FindElement(\"//instance-name\"); elem != nil {\n\t\tresponse.Name = elem.Text()\n\t}\n\tif elem := doc.FindElement(\"//duplicate-mac-timer-value\"); elem != nil {\n\t\tresponse.DuplicageMacTimerValue = elem.Text()\n\t}\n\tif elem := doc.FindElement(\"//max-count\"); elem != nil {\n\t\tresponse.MaxCount = elem.Text()\n\t}\n\tif elem := doc.FindElement(\"//target-community\"); elem != nil {\n\t\tresponse.TargetCommunity = elem.Text()\n\t}\n\tif elem := doc.FindElement(\"//route-target/both\"); elem != nil {\n\t\tresponse.RouteTargetBoth = \"true\"\n\t}\n\tif elem := doc.FindElement(\"//ignore-as\"); elem != nil {\n\t\tresponse.IgnoreAs = \"true\"\n\t}\n\n\treturn response, err\n\n}", "title": "" }, { "docid": "a022e67f206a0f9f0859b2e0ae9bc852", "score": "0.4226977", "text": "func (o LaunchTemplateInstanceRequirementsOutput) AllowedInstanceTypes() pulumi.StringArrayOutput {\n\treturn o.ApplyT(func(v LaunchTemplateInstanceRequirements) []string { return v.AllowedInstanceTypes }).(pulumi.StringArrayOutput)\n}", "title": "" }, { "docid": "ec718663771ae8a3a98fea4734bf53f6", "score": "0.42220956", "text": "func (o InstanceOutput) InstanceType() pulumi.StringPtrOutput {\n\treturn o.ApplyT(func(v *Instance) pulumi.StringPtrOutput { return v.InstanceType }).(pulumi.StringPtrOutput)\n}", "title": "" }, { "docid": "d369315e49ff0618bbc78bb6b1c614d8", "score": "0.42200276", "text": "func (catalogManagement *CatalogManagementV1) GetOfferingInstanceWithContext(ctx context.Context, getOfferingInstanceOptions *GetOfferingInstanceOptions) (result *OfferingInstance, response *core.DetailedResponse, err error) {\n\terr = core.ValidateNotNil(getOfferingInstanceOptions, \"getOfferingInstanceOptions cannot be nil\")\n\tif err != nil {\n\t\treturn\n\t}\n\terr = core.ValidateStruct(getOfferingInstanceOptions, \"getOfferingInstanceOptions\")\n\tif err != nil {\n\t\treturn\n\t}\n\n\tpathParamsMap := map[string]string{\n\t\t\"instance_identifier\": *getOfferingInstanceOptions.InstanceIdentifier,\n\t}\n\n\tbuilder := core.NewRequestBuilder(core.GET)\n\tbuilder = builder.WithContext(ctx)\n\tbuilder.EnableGzipCompression = catalogManagement.GetEnableGzipCompression()\n\t_, err = builder.ResolveRequestURL(catalogManagement.Service.Options.URL, `/instances/offerings/{instance_identifier}`, pathParamsMap)\n\tif err != nil {\n\t\treturn\n\t}\n\n\tfor headerName, headerValue := range getOfferingInstanceOptions.Headers {\n\t\tbuilder.AddHeader(headerName, headerValue)\n\t}\n\n\tsdkHeaders := common.GetSdkHeaders(\"catalog_management\", \"V1\", \"GetOfferingInstance\")\n\tfor headerName, headerValue := range sdkHeaders {\n\t\tbuilder.AddHeader(headerName, headerValue)\n\t}\n\tbuilder.AddHeader(\"Accept\", \"application/json\")\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 = catalogManagement.Service.Request(request, &rawResponse)\n\tif err != nil {\n\t\treturn\n\t}\n\tif rawResponse != nil {\n\t\terr = core.UnmarshalModel(rawResponse, \"\", &result, UnmarshalOfferingInstance)\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": "13f79e866a3c97b1f45a2ca9fae2f3b0", "score": "0.4219971", "text": "func (i *instances) InstanceType(ctx context.Context, name types.NodeName) (string, error) {\n\tinstanceID := instanceIDFromNodeName(string(name))\n\treturn i.instanceTypeByInstanceID(ctx, instanceID)\n}", "title": "" }, { "docid": "c4c4fa82e780a4ac35fca1dc22881fa0", "score": "0.42196444", "text": "func (o GetInstanceTypeResultOutput) EfaSupported() pulumi.BoolOutput {\n\treturn o.ApplyT(func(v GetInstanceTypeResult) bool { return v.EfaSupported }).(pulumi.BoolOutput)\n}", "title": "" }, { "docid": "6543c25b1e0fe33911595b135eff5c6a", "score": "0.42154464", "text": "func instanceMatchReservation(instanceReport ec2.InstanceReport, reservationReport riEc2.ReservationReport) bool {\n\tif (getRegionName(instanceReport.Instance.Region) == reservationReport.Reservation.Region ||\n\t\tinstanceReport.Instance.Region == reservationReport.Reservation.AvailabilityZone) &&\n\t\tinstanceReport.Instance.Type == reservationReport.Reservation.Type &&\n\t\tinstanceReport.Instance.Platform == reservationReport.Reservation.ProductDescription {\n\t\treturn true\n\t}\n\treturn false\n}", "title": "" }, { "docid": "c76ab877533aacef96611bf969c49912", "score": "0.41961735", "text": "func (s SupportedInstanceType) String() string {\n\treturn awsutil.Prettify(s)\n}", "title": "" }, { "docid": "3fd1a6a0f715ee876d9886b6d7047e1a", "score": "0.41901252", "text": "func HowManyServersNeededForAsg(serverType string, resourcesNeeded ResourceSizes) int64 {\n\tinstanceSpecs, valid := InstanceTypes[serverType]\n\tif !valid {\n\t\tlog.Fatalln(\"Invalid server type provided:\", serverType)\n\t}\n\n\tif resourcesNeeded.LargestMemory > instanceSpecs.MemoryMb {\n\t\tlog.Fatalf(\"Configured instance type is not large enough. Available memory is %d, but largest task needs %d\",\n\t\t\tinstanceSpecs.MemoryMb, resourcesNeeded.LargestMemory)\n\t}\n\n\tif resourcesNeeded.LargestCPU > instanceSpecs.CPUUnits {\n\t\tlog.Fatalf(\"Configured instance type is not large enough. Available CPU is %d, but largest task needs %d\",\n\t\t\tinstanceSpecs.CPUUnits, resourcesNeeded.LargestCPU)\n\t}\n\n\t// Some memory in each instance cannot be used because no container can be placed in the last portion available.\n\t// This assumes the best-case container placement.\n\tusableMemory := max(1, instanceSpecs.MemoryMb-resourcesNeeded.SmallestMemory)\n\tusableCPU := max(1, instanceSpecs.CPUUnits-resourcesNeeded.SmallestCPU)\n\n\tneededForMem := divideAndRoundUp(resourcesNeeded.TotalMemory, usableMemory)\n\tneededForCPU := divideAndRoundUp(resourcesNeeded.TotalCPU, usableCPU)\n\n\tserversNeeded := max(neededForCPU, neededForMem)\n\tif serversNeeded > 100 {\n\t\tlog.Fatalf(\"Calculated need of %d instances, which is over the predefined threshold. Exiting.\", serversNeeded)\n\t}\n\n\treturn serversNeeded\n}", "title": "" }, { "docid": "d06b63cf6f819c8a32b9f0f003cc9d31", "score": "0.4188443", "text": "func AcceleratorType_Of(acceleratorClass AcceleratorClass, instanceSize awsec2.InstanceSize) AcceleratorType {\n\t_init_.Initialize()\n\n\tvar returns AcceleratorType\n\n\t_jsii_.StaticInvoke(\n\t\t\"monocdk.aws_stepfunctions_tasks.AcceleratorType\",\n\t\t\"of\",\n\t\t[]interface{}{acceleratorClass, instanceSize},\n\t\t&returns,\n\t)\n\n\treturn returns\n}", "title": "" }, { "docid": "3e7916ac3fe27d86c821fa39f740bfd2", "score": "0.4182666", "text": "func (t TLV) AWSVPCEType() bool {\n\treturn t.Type.AWS() && t.Length >= 1 && t.Value[0] == PP2_SUBTYPE_AWS_VPCE_ID\n}", "title": "" }, { "docid": "6ea74d5e1d2ba79befd7c210c3830528", "score": "0.41771853", "text": "func (o GetInstanceTypeOfferingsBrokerInstanceOptionOutput) StorageType() pulumi.StringOutput {\n\treturn o.ApplyT(func(v GetInstanceTypeOfferingsBrokerInstanceOption) string { return v.StorageType }).(pulumi.StringOutput)\n}", "title": "" }, { "docid": "47ab74855139b8578bff8ab00ffd6af8", "score": "0.41735354", "text": "func (o SpotFleetRequestLaunchTemplateConfigOverrideOutput) AvailabilityZone() pulumi.StringPtrOutput {\n\treturn o.ApplyT(func(v SpotFleetRequestLaunchTemplateConfigOverride) *string { return v.AvailabilityZone }).(pulumi.StringPtrOutput)\n}", "title": "" }, { "docid": "3bda29ab7ed793f51bb487ff4f10e6d9", "score": "0.41723904", "text": "func (a *AmazonInfo) GetMachineTypesWithFilter(filter *components.InstanceFilter) (map[string]components.MachineType, error) {\n\t// todo NOTE: until aws sdk dont support getting instance types\n\tresponse := make(map[string]components.MachineType)\n\tresponse[filter.Location] = []string{\n\t\t\"t2.nano\",\n\t\t\"t2.micro\",\n\t\t\"t2.small\",\n\t\t\"t2.medium\",\n\t\t\"t2.large\",\n\t\t\"t2.xlarge\",\n\t\t\"t2.2xlarge\",\n\t\t\"m5.large\",\n\t\t\"m5.xlarge\",\n\t\t\"m5.2xlarge\",\n\t\t\"m5.4xlarge\",\n\t\t\"m5.12xlarge\",\n\t\t\"m5.24xlarge\",\n\t\t\"m4.large\",\n\t\t\"m4.xlarge\",\n\t\t\"m4.2xlarge\",\n\t\t\"m4.4xlarge\",\n\t\t\"m4.10xlarge\",\n\t\t\"m4.16xlarge\",\n\t\t\"c5.large\",\n\t\t\"c5.xlarge\",\n\t\t\"c5.2xlarge\",\n\t\t\"c5.4xlarge\",\n\t\t\"c5.9xlarge\",\n\t\t\"c5.18xlarge\",\n\t\t\"c4.large\",\n\t\t\"c4.xlarge\",\n\t\t\"c4.2xlarge\",\n\t\t\"c4.4xlarge\",\n\t\t\"c4.8xlarge\",\n\t\t\"g3.4xlarge\",\n\t\t\"g3.16xlarge\",\n\t\t\"p2.xlarge\",\n\t\t\"p2.8xlarge\",\n\t\t\"p2.16xlarge\",\n\t\t\"p3.2xlarge\",\n\t\t\"p3.8xlarge\",\n\t\t\"p3.16xlarge\",\n\t\t\"r4.large\",\n\t\t\"r4.xlarge\",\n\t\t\"r4.2xlarge\",\n\t\t\"r4.4xlarge\",\n\t\t\"r4.8xlarge\",\n\t\t\"r4.16xlarge\",\n\t\t\"x1.16xlarge\",\n\t\t\"x1.32xlarge\",\n\t\t\"d2.xlarge\",\n\t\t\"d2.2xlarge\",\n\t\t\"d2.4xlarge\",\n\t\t\"d2.8xlarge\",\n\t\t\"i2.xlarge\",\n\t\t\"i2.2xlarge\",\n\t\t\"i2.4xlarge\",\n\t\t\"i2.8xlarge\",\n\t\t\"h1.2xlarge\",\n\t\t\"h1.4xlarge\",\n\t\t\"h1.8xlarge\",\n\t\t\"h1.16xlarge\",\n\t\t\"i3.large\",\n\t\t\"i3.xlarge\",\n\t\t\"i3.2xlarge\",\n\t\t\"i3.4xlarge\",\n\t\t\"i3.8xlarge\",\n\t\t\"i3.16xlarge\",\n\t}\n\treturn response, nil\n}", "title": "" }, { "docid": "b61536e2812388f006b37c3fe2ac2264", "score": "0.4169892", "text": "func expandInstanceGuestAccelerators(d tpgresource.TerraformResourceData, config *transport_tpg.Config) ([]*compute.AcceleratorConfig, error) {\n\tconfigs, ok := d.GetOk(\"guest_accelerator\")\n\tif !ok {\n\t\treturn nil, nil\n\t}\n\taccels := configs.([]interface{})\n\tguestAccelerators := make([]*compute.AcceleratorConfig, 0, len(accels))\n\tfor _, raw := range accels {\n\t\tdata := raw.(map[string]interface{})\n\t\tif data[\"count\"].(int) == 0 {\n\t\t\tcontinue\n\t\t}\n\t\tat, err := tpgresource.ParseAcceleratorFieldValue(data[\"type\"].(string), d, config)\n\t\tif err != nil {\n\t\t\treturn nil, fmt.Errorf(\"cannot parse accelerator type: %v\", err)\n\t\t}\n\t\tguestAccelerators = append(guestAccelerators, &compute.AcceleratorConfig{\n\t\t\tAcceleratorCount: int64(data[\"count\"].(int)),\n\t\t\tAcceleratorType: at.RelativeLink(),\n\t\t})\n\t}\n\n\treturn guestAccelerators, nil\n}", "title": "" }, { "docid": "1cf5113d3d5c47d906ad440648403d4a", "score": "0.41629052", "text": "func (b *ResourceBuilder) AvailabilityZoneType(value string) *ResourceBuilder {\n\tb.availabilityZoneType = &value\n\treturn b\n}", "title": "" }, { "docid": "07985f3f04f8db789c616118cebfab76", "score": "0.41547802", "text": "func (a *ASG) filterClosestHourQ(newQ types.Quantity) (types.Quantity, error) {\n\t// Before anything check if we reached to the maximum of tries without downscaling due to this filter\n\tif a.remainingNoDownscaleC >= a.maxTimesRemainingNoDownscale {\n\t\ta.remainingNoDownscaleC = 0\n\t\ta.log.Warningf(\"Closest hour limit didn't downscale in %d times, reached maximum limit of no downscaling limit\", a.maxTimesRemainingNoDownscale)\n\t\treturn newQ, nil\n\t}\n\n\tgroup, err := a.getAutoscalingGroup()\n\tif err != nil {\n\t\treturn newQ, err\n\t}\n\n\t// Get current instances\n\tinstIDs := make([]*string, len(group.Instances))\n\tfor i, inst := range group.Instances {\n\t\tinstIDs[i] = inst.InstanceId\n\t}\n\n\tvar validDownInsts, currentInst int64\n\tparams := &ec2.DescribeInstancesInput{\n\t\tInstanceIds: instIDs,\n\t}\n\tfor {\n\t\tresp, err := a.ec2Client.DescribeInstances(params)\n\t\tif err != nil {\n\t\t\treturn newQ, err\n\t\t}\n\n\t\tfor _, r := range resp.Reservations {\n\t\t\tfor _, i := range r.Instances {\n\t\t\t\t// Only valid instance if are in running or pending state\n\t\t\t\t// (pending state ones will be running in few minutes)\n\t\t\t\tist := aws.StringValue(i.State.Name)\n\t\t\t\tif ist == ec2.InstanceStateNamePending || ist == ec2.InstanceStateNameRunning {\n\t\t\t\t\tcurrentInst++\n\t\t\t\t\t// Get the run minutes from the last billing hour\n\t\t\t\t\ttRunning := time.Now().UTC().Sub(aws.TimeValue(i.LaunchTime))\n\t\t\t\t\trlbh := tRunning % (1 * time.Hour) // run last billing hour\n\t\t\t\t\t// if the instance has run at least N time in the last billing hour then\n\t\t\t\t\t// allow to destroy\n\t\t\t\t\tif rlbh >= ((1 * time.Hour) - a.remainingClosestHourLimit) {\n\t\t\t\t\t\tvalidDownInsts++\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\tif resp.NextToken == nil || aws.StringValue(resp.NextToken) == \"\" {\n\t\t\tbreak\n\t\t}\n\t\tparams.NextToken = resp.NextToken\n\t}\n\n\t// if there are too much instances to take down then set the current number to\n\t//only take down the number of instances that can remove\n\twantDown := currentInst - newQ.Q\n\tif wantDown > validDownInsts {\n\t\tnewQLim := types.Quantity{Q: currentInst - validDownInsts}\n\t\ta.log.Infof(\"Filtered instances by closest hour limit running time(%s) from %s to %s\", a.remainingClosestHourLimit, newQ, newQLim)\n\n\t\t// If the filter decided to not downscale, then increase the counter\n\t\tif newQLim.Q == currentInst {\n\t\t\ta.remainingNoDownscaleC++\n\t\t}\n\t\treturn newQLim, nil\n\t}\n\n\t// Reset counter\n\ta.remainingNoDownscaleC = 0\n\treturn newQ, nil\n}", "title": "" }, { "docid": "84cd706d84faf0b2290e02eb07296bf0", "score": "0.4149734", "text": "func (o OceanLaunchSpecOutput) PreferredSpotTypes() pulumi.StringArrayOutput {\n\treturn o.ApplyT(func(v *OceanLaunchSpec) pulumi.StringArrayOutput { return v.PreferredSpotTypes }).(pulumi.StringArrayOutput)\n}", "title": "" }, { "docid": "f0b3aeda5af567c1a904cd1a1c6203c7", "score": "0.41489017", "text": "func AutoscalingPeers(ctx context.Context, supplimental ...string) (peers []ec2.Instance, err error) {\n\tvar (\n\t\tsess *session.Session\n\t\tident ec2metadata.EC2InstanceIdentityDocument\n\t\tasgs *autoscaling.AutoScaling\n\t\tiao *autoscaling.DescribeAutoScalingInstancesOutput\n\t\tasg *autoscaling.DescribeAutoScalingGroupsOutput\n\t\tec2io *ec2.DescribeInstancesOutput\n\t)\n\n\tif sess, err = session.NewSession(); err != nil {\n\t\treturn peers, errors.WithStack(err)\n\t}\n\n\tmd := ec2metadata.New(sess)\n\n\tactx, done := context.WithTimeout(ctx, time.Second)\n\tdefer done()\n\t// if unavailable just return an empty set.\n\tif !md.AvailableWithContext(actx) {\n\t\treturn peers, nil\n\t}\n\n\tif ident, err = md.GetInstanceIdentityDocument(); err != nil {\n\t\treturn peers, errors.WithStack(err)\n\t}\n\n\tsess = sess.Copy(&aws.Config{\n\t\tRegion: aws.String(ident.Region),\n\t})\n\n\tasgs = autoscaling.New(sess)\n\n\tif iao, err = asgs.DescribeAutoScalingInstances(&autoscaling.DescribeAutoScalingInstancesInput{InstanceIds: []*string{&ident.InstanceID}}); err != nil {\n\t\treturn peers, errors.WithStack(err)\n\t}\n\n\tif len(iao.AutoScalingInstances) == 0 {\n\t\treturn peers, errors.Errorf(\"no autoscaling instance found for: %s\", ident.InstanceID)\n\t}\n\n\tagn := make([]string, 0, len(supplimental)+len(iao.AutoScalingInstances))\n\tfor _, instance := range iao.AutoScalingInstances {\n\t\tagn = append(agn, aws.StringValue(instance.AutoScalingGroupName))\n\t}\n\tlog.Println(\"discovered groups\", agn)\n\tlog.Println(\"supplimental groups\", supplimental)\n\tagn = append(agn, supplimental...)\n\n\tdasgi := &autoscaling.DescribeAutoScalingGroupsInput{\n\t\tAutoScalingGroupNames: aws.StringSlice(agn),\n\t}\n\n\tif asg, err = asgs.DescribeAutoScalingGroups(dasgi); err != nil {\n\t\treturn peers, errors.WithStack(err)\n\t}\n\n\tfor _, group := range asg.AutoScalingGroups {\n\t\tpeersID := make([]*string, 0, len(group.Instances))\n\t\tfor _, i := range group.Instances {\n\t\t\tpeersID = append(peersID, i.InstanceId)\n\t\t}\n\n\t\tif ec2io, err = ec2.New(sess).DescribeInstances(&ec2.DescribeInstancesInput{InstanceIds: peersID}); err != nil {\n\t\t\treturn peers, errors.WithStack(err)\n\t\t}\n\n\t\tfor _, r := range ec2io.Reservations {\n\t\t\tfor _, i := range r.Instances {\n\t\t\t\tpeers = append(peers, *i)\n\t\t\t}\n\t\t}\n\t}\n\n\treturn peers, nil\n}", "title": "" }, { "docid": "53770e7a72dc61725b9ee3a9663bb23b", "score": "0.41249245", "text": "func (o SpotFleetRequestLaunchTemplateConfigOverrideInstanceRequirementsPtrOutput) ExcludedInstanceTypes() pulumi.StringArrayOutput {\n\treturn o.ApplyT(func(v *SpotFleetRequestLaunchTemplateConfigOverrideInstanceRequirements) []string {\n\t\tif v == nil {\n\t\t\treturn nil\n\t\t}\n\t\treturn v.ExcludedInstanceTypes\n\t}).(pulumi.StringArrayOutput)\n}", "title": "" }, { "docid": "66685b030655bce1a85b48bfc0e84a48", "score": "0.41231975", "text": "func (c *Client) DescribeReservedElasticsearchInstanceOfferings(ctx context.Context, params *DescribeReservedElasticsearchInstanceOfferingsInput, optFns ...func(*Options)) (*DescribeReservedElasticsearchInstanceOfferingsOutput, error) {\n\tif params == nil {\n\t\tparams = &DescribeReservedElasticsearchInstanceOfferingsInput{}\n\t}\n\n\tresult, metadata, err := c.invokeOperation(ctx, \"DescribeReservedElasticsearchInstanceOfferings\", params, optFns, addOperationDescribeReservedElasticsearchInstanceOfferingsMiddlewares)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\tout := result.(*DescribeReservedElasticsearchInstanceOfferingsOutput)\n\tout.ResultMetadata = metadata\n\treturn out, nil\n}", "title": "" }, { "docid": "35e28e6ff26c64173b991f474a03e747", "score": "0.4122141", "text": "func (o FleetLaunchTemplateConfigOverrideInstanceRequirementsOutput) ExcludedInstanceTypes() pulumi.StringArrayOutput {\n\treturn o.ApplyT(func(v FleetLaunchTemplateConfigOverrideInstanceRequirements) []string { return v.ExcludedInstanceTypes }).(pulumi.StringArrayOutput)\n}", "title": "" }, { "docid": "e9a4eb2250b7bf52e487a8b47f7ab77d", "score": "0.41181138", "text": "func (m *MultishareOpsManager) runEligibleInstanceCheck(ctx context.Context, req *csi.CreateVolumeRequest, ops []*OpInfo, target *file.MultishareInstance, regions []string) ([]*file.MultishareInstance, error) {\n\tklog.Infof(\"ListMultishareInstances call initiated for request %+v.\", req)\n\tinstances, err := m.listMatchedInstances(ctx, req, target, regions)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\tklog.Infof(\"ListMultishareInstances call returned successfully with %d instances for request %+v.\", len(instances), req)\n\t// An instance is considered as eligible if and only if the state is 'READY', and there's no ops running against it.\n\tvar readyEligibleInstances []*file.MultishareInstance\n\t// An instance is considered as non-ready if any of the following conditions are met:\n\t// 1. The instance state is \"CREATING\" or \"REPAIRING\".\n\t// 2. The instance state is 'READY', but running ops are found on it.\n\tvar nonReadyEligibleInstances []*file.MultishareInstance\n\n\tfor _, instance := range instances {\n\t\tklog.Infof(\"Found multishare instance %s/%s/%s with state %s and max share count %d\", instance.Project, instance.Location, instance.Name, instance.State, instance.MaxShareCount)\n\t\tif instance.State == \"CREATING\" || instance.State == \"REPAIRING\" {\n\t\t\tklog.Infof(\"Instance %s/%s/%s with state %s is not ready\", instance.Project, instance.Location, instance.Name, instance.State)\n\t\t\tnonReadyEligibleInstances = append(nonReadyEligibleInstances, instance)\n\t\t\tcontinue\n\t\t}\n\t\tif instance.State != \"READY\" {\n\t\t\tklog.Infof(\"Instance %s/%s/%s with state %s is not eligible\", instance.Project, instance.Location, instance.Name, instance.State)\n\t\t\tcontinue\n\t\t\t// TODO: If we saw instance states other than \"CREATING\" and \"READY\", we may need to do some special handlding in the future.\n\t\t}\n\n\t\top, err := containsOpWithInstanceTargetPrefix(instance, ops)\n\t\tif err != nil {\n\t\t\tklog.Errorf(\"failed to check eligibility of instance %s\", instance.Name)\n\t\t\treturn nil, err\n\t\t}\n\n\t\tif op == nil {\n\t\t\tshares, err := m.cloud.File.ListShares(ctx, &file.ListFilter{Project: instance.Project, Location: instance.Location, InstanceName: instance.Name})\n\t\t\tif err != nil {\n\t\t\t\tklog.Errorf(\"Failed to list shares of instance %s/%s/%s, err:%v\", instance.Project, instance.Location, instance.Name, err.Error())\n\t\t\t\treturn nil, err\n\t\t\t}\n\n\t\t\t// If we encounter a scenario where the configurable shares per Filestore instance feature is disabled, CSI driver will continue to place max 10 shares per instance, irrespective of the actual max shares the Filestore instance can support.\n\t\t\t// Alternately, if CSI max share features is enabled, but filestore disables the feature, the create volume may continue to fail beyond 10 shares per instance.\n\t\t\tmaxShareCount := util.MaxSharesPerInstance\n\t\t\tif m.msControllerServer != nil && m.msControllerServer.featureMaxSharePerInstance {\n\t\t\t\tmaxShareCount = instance.MaxShareCount\n\t\t\t}\n\t\t\tif len(shares) >= maxShareCount {\n\t\t\t\tcontinue\n\t\t\t}\n\n\t\t\treadyEligibleInstances = append(readyEligibleInstances, instance)\n\t\t\tklog.Infof(\"Adding instance %s to eligible list\", instance.String())\n\t\t\tcontinue\n\t\t}\n\n\t\tklog.Infof(\"Instance %s/%s/%s with state %s is not ready with ongoing operation %s type %s\", instance.Project, instance.Location, instance.Name, instance.State, op.Id, op.Type.String())\n\t\tnonReadyEligibleInstances = append(nonReadyEligibleInstances, instance)\n\n\t\t// TODO: If we see > 1 instances with 0 shares (these could be possibly leaked instances where the driver hit timeout during creation op was in progress), should we trigger delete op for such instances? Possibly yes. Given that instance create/delete and share create/delete is serialized, maybe yes.\n\t}\n\n\tif len(readyEligibleInstances) == 0 && len(nonReadyEligibleInstances) > 0 {\n\t\terrorString := \"All eligible filestore instances are busy.\\n\"\n\n\t\tfor _, instance := range nonReadyEligibleInstances {\n\t\t\top, err := containsOpWithInstanceTargetPrefix(instance, ops) // Error for this call is already checked above\n\t\t\tif err != nil {\n\t\t\t\tklog.Errorf(\"failed to check eligibility of instance %s\", instance.Name)\n\t\t\t\treturn nil, err\n\t\t\t}\n\t\t\tif op != nil {\n\t\t\t\terrorString = fmt.Sprintf(\"%s Instance %s busy with operation type %s\\n\", errorString, instance.Name, op.Type)\n\t\t\t} else {\n\t\t\t\terrorString = fmt.Sprintf(\"%s Instance %s is in state %s\\n\", errorString, instance.Name, instance.State)\n\t\t\t}\n\t\t}\n\n\t\treturn nil, status.Errorf(codes.Aborted, errorString)\n\n\t}\n\n\treturn readyEligibleInstances, nil\n}", "title": "" }, { "docid": "686ca2cfacb4bbc15be0c6c5cefaeaa7", "score": "0.41114423", "text": "func (o LaunchTemplateInstanceMarketOptionsOutput) MarketType() pulumi.StringPtrOutput {\n\treturn o.ApplyT(func(v LaunchTemplateInstanceMarketOptions) *string { return v.MarketType }).(pulumi.StringPtrOutput)\n}", "title": "" }, { "docid": "0679df3853e2cd81297fba239e174357", "score": "0.41060632", "text": "func (o AwsClusterControlPlanePtrOutput) InstanceType() pulumi.StringPtrOutput {\n\treturn o.ApplyT(func(v *AwsClusterControlPlane) *string {\n\t\tif v == nil {\n\t\t\treturn nil\n\t\t}\n\t\treturn v.InstanceType\n\t}).(pulumi.StringPtrOutput)\n}", "title": "" }, { "docid": "82ae9f58743b581ab64422e1f667c16d", "score": "0.41029713", "text": "func Windows10EditionTypePWindows10ProfessionalWorkstation() *Windows10EditionType {\n\tv := Windows10EditionTypeVWindows10ProfessionalWorkstation\n\treturn &v\n}", "title": "" }, { "docid": "1e295bfeb7bbef51fbb6515250c58faa", "score": "0.40985525", "text": "func (s *Fleet) SetInstanceType(v string) *Fleet {\n\ts.InstanceType = &v\n\treturn s\n}", "title": "" }, { "docid": "10029923829b782dd31ee93232714b86", "score": "0.40976605", "text": "func (o GetInstanceTypeOfferingsBrokerInstanceOptionOutput) SupportedEngineVersions() pulumi.StringArrayOutput {\n\treturn o.ApplyT(func(v GetInstanceTypeOfferingsBrokerInstanceOption) []string { return v.SupportedEngineVersions }).(pulumi.StringArrayOutput)\n}", "title": "" }, { "docid": "c786e582d3841fa2964480ec5c604b94", "score": "0.40908062", "text": "func Provisioner() terraform.ResourceProvisioner {\n\treturn &schema.Provisioner{\n\t\tSchema: map[string]*schema.Schema{\n\t\t\tschemaAsgName: {\n\t\t\t\tType: schema.TypeString,\n\t\t\t\tRequired: true,\n\t\t\t\tDescription: \"The name of the AutoScaling Group to manage\",\n\t\t\t},\n\t\t\tschemaRegion: {\n\t\t\t\tType: schema.TypeString,\n\t\t\t\tOptional: true,\n\t\t\t\tDescription: \"The AWS region, if not specified look up value from environment or profile\",\n\t\t\t},\n\t\t\tschemaAccessKey: {\n\t\t\t\tType: schema.TypeString,\n\t\t\t\tOptional: true,\n\t\t\t\tDescription: \"The AWS access key, if not specified look up value from environment or profile\",\n\t\t\t},\n\t\t\tschemaSecretKey: {\n\t\t\t\tType: schema.TypeString,\n\t\t\t\tOptional: true,\n\t\t\t\tDescription: \"The AWS secret key, if not specified look up value from environment or profile\",\n\t\t\t},\n\t\t\tschemaToken: {\n\t\t\t\tType: schema.TypeString,\n\t\t\t\tOptional: true,\n\t\t\t\tDescription: \"The AWS session token, if not specified look up value from environment or profile\",\n\t\t\t},\n\t\t\tschemaProfile: {\n\t\t\t\tType: schema.TypeString,\n\t\t\t\tOptional: true,\n\t\t\t\tDescription: \"The AWS profile name as set in the shared configuration file\",\n\t\t\t},\n\t\t\tschemaBatchSize: {\n\t\t\t\tType: schema.TypeInt,\n\t\t\t\tOptional: true,\n\t\t\t\tDefault: 1,\n\t\t\t\tDescription: \"The maximum number of instances that the provisioner updates in a single pass\",\n\t\t\t},\n\t\t\tschemaMIIS: {\n\t\t\t\tType: schema.TypeInt,\n\t\t\t\tOptional: true,\n\t\t\t\tDefault: 0,\n\t\t\t\tDescription: \"The minimum number of instances that must be in service within the Auto Scaling group while the provisioner updates old instances\",\n\t\t\t},\n\t\t\tschemaPauseTime: {\n\t\t\t\tType: schema.TypeString,\n\t\t\t\tOptional: true,\n\t\t\t\tDefault: \"0s\",\n\t\t\t\tDescription: \"The amount of time the provisioner pauses after making a change to a batch of instances. Format is golang duration string\",\n\t\t\t\tValidateFunc: validateDuration,\n\t\t\t},\n\t\t\tschemaASGNewTime: {\n\t\t\t\tType: schema.TypeString,\n\t\t\t\tOptional: true,\n\t\t\t\tDefault: \"2m\",\n\t\t\t\tDescription: \"The amount of time after the ASG creation date that the provisioner will consider the ASG new and not execute. Format is golang duration string\",\n\t\t\t\tValidateFunc: validateDuration,\n\t\t\t},\n\t\t},\n\n\t\tApplyFunc: applyFn,\n\t\tValidateFunc: validateFn,\n\t}\n}", "title": "" }, { "docid": "e139e7e2123a896c6e9ea4f552225fa2", "score": "0.4088922", "text": "func (o FleetLaunchTemplateConfigOverrideOutput) AvailabilityZone() pulumi.StringPtrOutput {\n\treturn o.ApplyT(func(v FleetLaunchTemplateConfigOverride) *string { return v.AvailabilityZone }).(pulumi.StringPtrOutput)\n}", "title": "" }, { "docid": "e07d56b40bddb9f348d3ced9b7bbf7b6", "score": "0.4084883", "text": "func (vs *VSphere) InstanceTypeByProviderID(ctx context.Context, providerID string) (string, error) {\n\treturn \"\", nil\n}", "title": "" }, { "docid": "63d7aa1d53dcadeda859391c09a82080", "score": "0.4080027", "text": "func Windows10EditionTypePWindows10HomeN() *Windows10EditionType {\n\tv := Windows10EditionTypeVWindows10HomeN\n\treturn &v\n}", "title": "" }, { "docid": "eaa5837314ca0c01f4082a82d1aaa73e", "score": "0.40753374", "text": "func NewDescribeReservedElasticsearchInstanceOfferingsPaginator(client DescribeReservedElasticsearchInstanceOfferingsAPIClient, params *DescribeReservedElasticsearchInstanceOfferingsInput, optFns ...func(*DescribeReservedElasticsearchInstanceOfferingsPaginatorOptions)) *DescribeReservedElasticsearchInstanceOfferingsPaginator {\n\tif params == nil {\n\t\tparams = &DescribeReservedElasticsearchInstanceOfferingsInput{}\n\t}\n\n\toptions := DescribeReservedElasticsearchInstanceOfferingsPaginatorOptions{}\n\tif params.MaxResults != 0 {\n\t\toptions.Limit = params.MaxResults\n\t}\n\n\tfor _, fn := range optFns {\n\t\tfn(&options)\n\t}\n\n\treturn &DescribeReservedElasticsearchInstanceOfferingsPaginator{\n\t\toptions: options,\n\t\tclient: client,\n\t\tparams: params,\n\t\tfirstPage: true,\n\t}\n}", "title": "" }, { "docid": "841be8b8932a1dcedad42fa2504f5439", "score": "0.40738735", "text": "func (d *descriptor) Price(instanceType string, availabilityZones ...string) (float64, error) {\n\tif len(availabilityZones) == 0 {\n\t\treturn 0, errors.New(\"no availability zone given\")\n\t}\n\tinfo, err := d.service.DescribeInstanceInfo(instanceType, availabilityZones[0])\n\tif err != nil {\n\t\treturn 0, fmt.Errorf(\"failed to obtain instance info for %s in zone %s: %v\", instanceType, availabilityZones[0], err)\n\t}\n\n\treturn info.OnDemandPrice, nil\n}", "title": "" } ]
77e30a66134b80e997812faa2b03dabe
SetTags sets the Tags field's value.
[ { "docid": "5291a6f8682f20ea3c578c64c3ac1600", "score": "0.0", "text": "func (s *DescribeSnapshotScheduleOutput) SetTags(v []*Tag) *DescribeSnapshotScheduleOutput {\n\ts.Tags = v\n\treturn s\n}", "title": "" } ]
[ { "docid": "c007f03c17f6fe745a80fa2df4dbb20b", "score": "0.846207", "text": "func (o *GSLB) SetTags(v []string) {\n\to.Tags = v\n}", "title": "" }, { "docid": "6890df6e2c002e24e3e4beb9c347cf14", "score": "0.8234821", "text": "func (o *GSLBUpdateRequest) SetTags(v []string) {\n\to.Tags = v\n}", "title": "" }, { "docid": "4e530c74915f7b340cf872893b7f9c3f", "score": "0.82101595", "text": "func (o *Switch) SetTags(v []string) {\n\to.Tags = v\n}", "title": "" }, { "docid": "ee044304d1e78d628a964830f871cfb5", "score": "0.8128309", "text": "func (o *FiltersVm) SetTags(v []string) {\n\to.Tags = &v\n}", "title": "" }, { "docid": "e4594a925b37d4714e429cd4c00b95c3", "score": "0.81163204", "text": "func (o *SIM) SetTags(v []string) {\n\to.Tags = v\n}", "title": "" }, { "docid": "4c587f8ee193da8980829315475cc550", "score": "0.8116034", "text": "func (o *GSLBCreateRequest) SetTags(v []string) {\n\to.Tags = v\n}", "title": "" }, { "docid": "33bdd40c50f7b1d190f9946a59345f46", "score": "0.80772567", "text": "func (o *CDROM) SetTags(v []string) {\n\to.Tags = v\n}", "title": "" }, { "docid": "77005476f56b6f61ea340a9d47f5e5ed", "score": "0.80769897", "text": "func (o *Disk) SetTags(v []string) {\n\to.Tags = v\n}", "title": "" }, { "docid": "c237b7d5209115111d4e7db731a2d981", "score": "0.79973084", "text": "func (o *Server) SetTags(v []string) {\n\to.Tags = v\n}", "title": "" }, { "docid": "a6c8d2437bbf2e855e9daab61f718fc3", "score": "0.79804105", "text": "func (o *DeviceDeletedFilter) SetTags(v [][]string) {\n\to.Tags = &v\n}", "title": "" }, { "docid": "2d51a34a72e4d2a4dcccc8a9f2acef8c", "score": "0.79608935", "text": "func (o *Archive) SetTags(v []string) {\n\to.Tags = v\n}", "title": "" }, { "docid": "dc5b5b118686e8532a23014000309813", "score": "0.7933445", "text": "func (o *DAG) SetTags(v []Tag) {\n\to.Tags = v\n}", "title": "" }, { "docid": "f493445fe03f422f534a32dc59cfc8fb", "score": "0.7904234", "text": "func (s *S3Object) SetTags(v []*KeyValuePair) *S3Object {\n\ts.Tags = v\n\treturn s\n}", "title": "" }, { "docid": "ff88fe3d1c8df313afd9da6317737dda", "score": "0.788235", "text": "func (o *VPCRouter) SetTags(v []string) {\n\to.Tags = v\n}", "title": "" }, { "docid": "ac4fe17698470ef8a6c45cc9df52ca28", "score": "0.7866916", "text": "func (o *Internet) SetTags(v []string) {\n\to.Tags = v\n}", "title": "" }, { "docid": "f3b11b4af3e924b4ccea4ebe0bc536c3", "score": "0.78409255", "text": "func (o *NFSCreateRequest) SetTags(v []string) {\n\to.Tags = v\n}", "title": "" }, { "docid": "9b3e3ea8b397285b508e3c8a1234ba6a", "score": "0.7807093", "text": "func (o *SwitchInfo) SetTags(v []string) {\n\to.Tags = v\n}", "title": "" }, { "docid": "40e003cd2260b1f5b929f60cae636b57", "score": "0.7803239", "text": "func (o *SwitchCreateRequest) SetTags(v []string) {\n\to.Tags = v\n}", "title": "" }, { "docid": "f81a2869f3155cfa960f374ebe53c50f", "score": "0.7799465", "text": "func (o *LdapCertificateProvider) SetTags(v []string) {\n\to.Tags = v\n}", "title": "" }, { "docid": "01b0e4ce641398e18b2588d3ddde99ef", "score": "0.77926356", "text": "func (o *MonitorType) SetTags(v []string) {\n\to.Tags = v\n}", "title": "" }, { "docid": "df41f0b30fdfeee7e70c14c2880c64e2", "score": "0.7778997", "text": "func (o *Note) SetTags(v []string) {\n\to.Tags = v\n}", "title": "" }, { "docid": "e58cfb773e666db77fbeab8ed429ff61", "score": "0.77640086", "text": "func (s *GetFindingsFilterOutput) SetTags(v map[string]*string) *GetFindingsFilterOutput {\n\ts.Tags = v\n\treturn s\n}", "title": "" }, { "docid": "0f5e3a9b9ae20e45ade262fc98900563", "score": "0.7751574", "text": "func (o *CDROMCreateRequest) SetTags(v []string) {\n\to.Tags = v\n}", "title": "" }, { "docid": "7efdcc00f2819eb8296a36f2a5e13ee4", "score": "0.77463675", "text": "func (o *ServerCreateRequest) SetTags(v []string) {\n\to.Tags = v\n}", "title": "" }, { "docid": "b9bc6feb52df45d00c6f97fcfd48b837", "score": "0.77326816", "text": "func (o *SwitchUpdateRequest) SetTags(v []string) {\n\to.Tags = v\n}", "title": "" }, { "docid": "be7a0fedcfb66334a805ee2d6f555312", "score": "0.7732616", "text": "func (s *CreateFindingsFilterInput) SetTags(v map[string]*string) *CreateFindingsFilterInput {\n\ts.Tags = v\n\treturn s\n}", "title": "" }, { "docid": "4973883646756f2c747e7ea052e0fea7", "score": "0.7726969", "text": "func (o *LoadBalancer) SetTags(v []string) {\n\to.Tags = v\n}", "title": "" }, { "docid": "00cdf9d8bdb1da84cb91c66b0f1cc433", "score": "0.7721545", "text": "func (o *InlineResponse20092) SetTags(v []InlineResponse2002Column) {\n\to.Tags = &v\n}", "title": "" }, { "docid": "d2595a1c222d96230ab7275fe929dd0b", "score": "0.77044743", "text": "func (s *S3Bucket) SetTags(v []*KeyValuePair) *S3Bucket {\n\ts.Tags = v\n\treturn s\n}", "title": "" }, { "docid": "e325caf8ac180f413c6997f7356dcd05", "score": "0.77025455", "text": "func (o *NFS) SetTags(v []string) {\n\to.Tags = v\n}", "title": "" }, { "docid": "30eadc442611cb519cf4c39f6a756559", "score": "0.77018905", "text": "func (o *AssetUpdateReqWeb) SetTags(v []string) {\n\to.Tags = &v\n}", "title": "" }, { "docid": "834e9872ffc5d4306404c0aa3bb88845", "score": "0.76929647", "text": "func (i *Info) SetTags(tags ...string) {\n\ti.tags = tags\n}", "title": "" }, { "docid": "46fe12c40bccbfffa2fb624d386e6bf5", "score": "0.7685935", "text": "func (o *Appliance) SetTags(v []string) {\n\to.Tags = v\n}", "title": "" }, { "docid": "c1a2a6eadf0014a70cf832bae9d28e4f", "score": "0.76848775", "text": "func (o *SIMCreateRequest) SetTags(v []string) {\n\to.Tags = v\n}", "title": "" }, { "docid": "1c311944cd8774e6f3120d71ddcc7d0a", "score": "0.768435", "text": "func (o *VPCRouterUpdateRequest) SetTags(v []string) {\n\to.Tags = v\n}", "title": "" }, { "docid": "ae7deaae88c41a72c546da5c3dec4d15", "score": "0.76828384", "text": "func (o *NFSUpdateRequest) SetTags(v []string) {\n\to.Tags = v\n}", "title": "" }, { "docid": "039f56f2299da29855c45ae1fbf544aa", "score": "0.7681299", "text": "func (o *CDROMUpdateRequest) SetTags(v []string) {\n\to.Tags = v\n}", "title": "" }, { "docid": "06625c943579f93abde71dea13eec333", "score": "0.7680554", "text": "func (s *Filter) SetTags(v map[string]*string) *Filter {\n\ts.Tags = v\n\treturn s\n}", "title": "" }, { "docid": "8d42cf40fa111e4a9219a839af9a101d", "score": "0.767963", "text": "func (o *ServerUpdateRequest) SetTags(v []string) {\n\to.Tags = v\n}", "title": "" }, { "docid": "9e31ed02a2603db2f30600f607569233", "score": "0.7678995", "text": "func (m *EdiscoveryCase) SetTags(value []EdiscoveryReviewTagable)() {\n m.tags = value\n}", "title": "" }, { "docid": "c24c2f69caa031938d2d20694905b2eb", "score": "0.76625514", "text": "func (o *VPCRouterCreateRequest) SetTags(v []string) {\n\to.Tags = v\n}", "title": "" }, { "docid": "e3e67b05fde0fb86d5b6b604641f2d97", "score": "0.76590484", "text": "func (o *DiskCreateRequest) SetTags(v []string) {\n\to.Tags = v\n}", "title": "" }, { "docid": "125b13d3e367dd26a8c14f7c95fe1260", "score": "0.765182", "text": "func (s *FindingsFilterListItem) SetTags(v map[string]*string) *FindingsFilterListItem {\n\ts.Tags = v\n\treturn s\n}", "title": "" }, { "docid": "83d2b6477ec18d31642695f2296dc1a3", "score": "0.76316893", "text": "func (s *CreateDashboardInput) SetTags(v map[string]*string) *CreateDashboardInput {\n\ts.Tags = v\n\treturn s\n}", "title": "" }, { "docid": "bd70a7fae63a01167bf716b195f0ef8b", "score": "0.76204485", "text": "func (o *ArchiveCreateRequest) SetTags(v []string) {\n\to.Tags = v\n}", "title": "" }, { "docid": "81edbc9e67cf6c0c390d790501c3fada", "score": "0.7619935", "text": "func (o *InternetCreateRequest) SetTags(v []string) {\n\to.Tags = v\n}", "title": "" }, { "docid": "4eb99004dc19da1884bfa4d23d964494", "score": "0.7616455", "text": "func (s *GetCustomDataIdentifierOutput) SetTags(v map[string]*string) *GetCustomDataIdentifierOutput {\n\ts.Tags = v\n\treturn s\n}", "title": "" }, { "docid": "affa8072398ca0b3fec5894a3b0ecba2", "score": "0.7613073", "text": "func (o *ArchiveCreateBlankRequest) SetTags(v []string) {\n\to.Tags = v\n}", "title": "" }, { "docid": "f0222675890571d2e90826c09af56614", "score": "0.7608639", "text": "func (s *CreateFilterInput) SetTags(v map[string]*string) *CreateFilterInput {\n\ts.Tags = v\n\treturn s\n}", "title": "" }, { "docid": "2a55416da1ac21396a1fd25ab4c5a8d9", "score": "0.760241", "text": "func (a *Alert) SetTags(tags []string) error {\n\tif len(tags) == 0 {\n\t\treturn fmt.Errorf(\"tags could not be empty\")\n\t}\n\ta.Tags = tags\n\treturn nil\n}", "title": "" }, { "docid": "b3f4ace0e14848fcb2ebe97878aeb27a", "score": "0.75873375", "text": "func (o *LoadBalancerCreateRequest) SetTags(v []string) {\n\to.Tags = v\n}", "title": "" }, { "docid": "5c147bcb596cd820c5d6103835c6056a", "score": "0.7582087", "text": "func (o *InternetUpdateRequest) SetTags(v []string) {\n\to.Tags = v\n}", "title": "" }, { "docid": "81ef9bb3b3b0a661b255cb44d306005e", "score": "0.75766027", "text": "func (s *CreatePlaceIndexInput) SetTags(v map[string]*string) *CreatePlaceIndexInput {\n\ts.Tags = v\n\treturn s\n}", "title": "" }, { "docid": "e00406eb3adf2b1ac51739f2a5f9fde6", "score": "0.75750667", "text": "func (o *ServiceConfigurationSpec) SetTags(v map[string]string) {\n\to.Tags = &v\n}", "title": "" }, { "docid": "f51b545199280082380d65dcb5a8820c", "score": "0.75746715", "text": "func (o *LoadBalancerUpdateRequest) SetTags(v []string) {\n\to.Tags = v\n}", "title": "" }, { "docid": "fc009b123f5b83e4421f782eb9327c28", "score": "0.75716734", "text": "func (o *StoredDataMessage) SetTags(v []string) {\n\to.Tags = &v\n}", "title": "" }, { "docid": "f30e449057804221b31a1ceeaadaf0ed", "score": "0.756854", "text": "func (s *GetAllowListOutput) SetTags(v map[string]*string) *GetAllowListOutput {\n\ts.Tags = v\n\treturn s\n}", "title": "" }, { "docid": "34826b2ef3918ae13dfbbd758cbe4e60", "score": "0.7558243", "text": "func (o *DiskUpdateRequest) SetTags(v []string) {\n\to.Tags = v\n}", "title": "" }, { "docid": "fd5fce0ea32e48349b919e3f546729fa", "score": "0.75579375", "text": "func (s *CreateAssetModelInput) SetTags(v map[string]*string) *CreateAssetModelInput {\n\ts.Tags = v\n\treturn s\n}", "title": "" }, { "docid": "45fee034dc871eae90770a90561c7f52", "score": "0.75529915", "text": "func (s *GetQuantumTaskOutput) SetTags(v map[string]*string) *GetQuantumTaskOutput {\n\ts.Tags = v\n\treturn s\n}", "title": "" }, { "docid": "48e69c0c100a3d9d450a20786182b10d", "score": "0.7548704", "text": "func (o *SIMUpdateRequest) SetTags(v []string) {\n\to.Tags = v\n}", "title": "" }, { "docid": "a4572b9fdd60e0e4656110f02581bd59", "score": "0.7547718", "text": "func (o *EventCreateRequest) SetTags(v []string) {\n\to.Tags = v\n}", "title": "" }, { "docid": "3c1dadc161a4aabc1fb6204fa207faf8", "score": "0.754089", "text": "func (o *ArchiveUpdateRequest) SetTags(v []string) {\n\to.Tags = v\n}", "title": "" }, { "docid": "f839302c3826a1a0b8d412a9f0267a07", "score": "0.75384426", "text": "func (s *CreateRouteCalculatorInput) SetTags(v map[string]*string) *CreateRouteCalculatorInput {\n\ts.Tags = v\n\treturn s\n}", "title": "" }, { "docid": "67aa1a35222837e4a0a33f043b4b8421", "score": "0.75379866", "text": "func (s *CreateMetricSetInput) SetTags(v map[string]*string) *CreateMetricSetInput {\n\ts.Tags = v\n\treturn s\n}", "title": "" }, { "docid": "47b5bb3a7ea73b4902c5e71c48e2212e", "score": "0.7528707", "text": "func (s *BucketMetadata) SetTags(v []*KeyValuePair) *BucketMetadata {\n\ts.Tags = v\n\treturn s\n}", "title": "" }, { "docid": "15ae56dec83afefd0b86ffe7af2dda75", "score": "0.752612", "text": "func (o *NoteCreateRequest) SetTags(v []string) {\n\to.Tags = v\n}", "title": "" }, { "docid": "864b4f562a0d88d0fa122f8409bf9901", "score": "0.7521117", "text": "func (s *GetMemberOutput) SetTags(v map[string]*string) *GetMemberOutput {\n\ts.Tags = v\n\treturn s\n}", "title": "" }, { "docid": "774eab56c7d8509f6d4fa726c1b79523", "score": "0.7517421", "text": "func (s *AnalyticsAndOperator) SetTags(v []*Tag) *AnalyticsAndOperator {\n\ts.Tags = v\n\treturn s\n}", "title": "" }, { "docid": "d38815361e9e67ea8a8518ce309ade47", "score": "0.7513231", "text": "func (s *App) SetTags(v map[string]*string) *App {\n\ts.Tags = v\n\treturn s\n}", "title": "" }, { "docid": "e0c297237a3597ada032909c7f7be747", "score": "0.7510968", "text": "func (s *PlaybackConfiguration) SetTags(v map[string]*string) *PlaybackConfiguration {\n\ts.Tags = v\n\treturn s\n}", "title": "" }, { "docid": "2d5d9fec321084025b1f7813066b4209", "score": "0.750716", "text": "func (s *MetricsAndOperator) SetTags(v []*Tag) *MetricsAndOperator {\n\ts.Tags = v\n\treturn s\n}", "title": "" }, { "docid": "c842a1ad539d3a78846ecbbe7b356259", "score": "0.74957144", "text": "func (o *MetricTagConfigurationAttributes) SetTags(v []string) {\n\to.Tags = v\n}", "title": "" }, { "docid": "335c5907f82d901be70a4571e5f2ef24", "score": "0.749034", "text": "func (o *Host) SetTags(v []TagInfo) {\n\to.Tags = &v\n}", "title": "" }, { "docid": "d21149e813888ba0b268d5ae12f6bbf8", "score": "0.747642", "text": "func (s *GetPlaybackConfigurationOutput) SetTags(v map[string]*string) *GetPlaybackConfigurationOutput {\n\ts.Tags = v\n\treturn s\n}", "title": "" }, { "docid": "22961217e4e8a107ef66b91b1bcfdae7", "score": "0.74759", "text": "func (s *AssetShallow) SetTags(v map[string]*string) *AssetShallow {\n\ts.Tags = v\n\treturn s\n}", "title": "" }, { "docid": "7bd0d77be9b53e79179b6ba0a0cd86c6", "score": "0.747587", "text": "func (s *Member) SetTags(v map[string]*string) *Member {\n\ts.Tags = v\n\treturn s\n}", "title": "" }, { "docid": "f3fd435de22cd76888830c63a9be2c2e", "score": "0.7472663", "text": "func (o *GetIPAMDNSRecordsParams) SetTags(tags *string) {\n\to.Tags = tags\n}", "title": "" }, { "docid": "4ed2e9706d6cb2ed5da4259892ea04b0", "score": "0.74707067", "text": "func (o *NoteUpdateRequest) SetTags(v []string) {\n\to.Tags = v\n}", "title": "" }, { "docid": "0a1ec47e2ab946ab7f5ebcbbffcd0b66", "score": "0.7462953", "text": "func (s *ListTagsForResourceOutput) SetTags(v map[string]*string) *ListTagsForResourceOutput {\n\ts.Tags = v\n\treturn s\n}", "title": "" }, { "docid": "0a1ec47e2ab946ab7f5ebcbbffcd0b66", "score": "0.7462953", "text": "func (s *ListTagsForResourceOutput) SetTags(v map[string]*string) *ListTagsForResourceOutput {\n\ts.Tags = v\n\treturn s\n}", "title": "" }, { "docid": "0a1ec47e2ab946ab7f5ebcbbffcd0b66", "score": "0.7462953", "text": "func (s *ListTagsForResourceOutput) SetTags(v map[string]*string) *ListTagsForResourceOutput {\n\ts.Tags = v\n\treturn s\n}", "title": "" }, { "docid": "0a1ec47e2ab946ab7f5ebcbbffcd0b66", "score": "0.7462953", "text": "func (s *ListTagsForResourceOutput) SetTags(v map[string]*string) *ListTagsForResourceOutput {\n\ts.Tags = v\n\treturn s\n}", "title": "" }, { "docid": "0a1ec47e2ab946ab7f5ebcbbffcd0b66", "score": "0.7462953", "text": "func (s *ListTagsForResourceOutput) SetTags(v map[string]*string) *ListTagsForResourceOutput {\n\ts.Tags = v\n\treturn s\n}", "title": "" }, { "docid": "0a1ec47e2ab946ab7f5ebcbbffcd0b66", "score": "0.7462953", "text": "func (s *ListTagsForResourceOutput) SetTags(v map[string]*string) *ListTagsForResourceOutput {\n\ts.Tags = v\n\treturn s\n}", "title": "" }, { "docid": "0a1ec47e2ab946ab7f5ebcbbffcd0b66", "score": "0.7462953", "text": "func (s *ListTagsForResourceOutput) SetTags(v map[string]*string) *ListTagsForResourceOutput {\n\ts.Tags = v\n\treturn s\n}", "title": "" }, { "docid": "0a1ec47e2ab946ab7f5ebcbbffcd0b66", "score": "0.7462953", "text": "func (s *ListTagsForResourceOutput) SetTags(v map[string]*string) *ListTagsForResourceOutput {\n\ts.Tags = v\n\treturn s\n}", "title": "" }, { "docid": "0a1ec47e2ab946ab7f5ebcbbffcd0b66", "score": "0.7462953", "text": "func (s *ListTagsForResourceOutput) SetTags(v map[string]*string) *ListTagsForResourceOutput {\n\ts.Tags = v\n\treturn s\n}", "title": "" }, { "docid": "0a1ec47e2ab946ab7f5ebcbbffcd0b66", "score": "0.7461098", "text": "func (s *ListTagsForResourceOutput) SetTags(v map[string]*string) *ListTagsForResourceOutput {\n\ts.Tags = v\n\treturn s\n}", "title": "" }, { "docid": "0a1ec47e2ab946ab7f5ebcbbffcd0b66", "score": "0.7459561", "text": "func (s *ListTagsForResourceOutput) SetTags(v map[string]*string) *ListTagsForResourceOutput {\n\ts.Tags = v\n\treturn s\n}", "title": "" }, { "docid": "779bda44615d37738f5960f755b148fc", "score": "0.7456234", "text": "func (o *PostIPAMIpsParams) SetTags(tags *string) {\n\to.Tags = tags\n}", "title": "" }, { "docid": "6765d7a01ded16acf8961535ba965b58", "score": "0.7444921", "text": "func (s *PackagingGroup) SetTags(v map[string]*string) *PackagingGroup {\n\ts.Tags = v\n\treturn s\n}", "title": "" }, { "docid": "23ba6976a2fc148624889639f6c38762", "score": "0.7440071", "text": "func (o *UpdateVmTemplateRequest) SetTags(v []ResourceTag) {\n\to.Tags = &v\n}", "title": "" }, { "docid": "aab0c730dcbd0024d6625e18d6205395", "score": "0.74353766", "text": "func (s *CreatePortalInput) SetTags(v map[string]*string) *CreatePortalInput {\n\ts.Tags = v\n\treturn s\n}", "title": "" }, { "docid": "191aac7c2677d549b9ee6ca5efb2bbd9", "score": "0.74353355", "text": "func (s *CreateCustomDataIdentifierInput) SetTags(v map[string]*string) *CreateCustomDataIdentifierInput {\n\ts.Tags = v\n\treturn s\n}", "title": "" }, { "docid": "e723e3da36914ab7d17a2fd990331ccc", "score": "0.74260855", "text": "func (s *DescribePlaceIndexOutput) SetTags(v map[string]*string) *DescribePlaceIndexOutput {\n\ts.Tags = v\n\treturn s\n}", "title": "" }, { "docid": "8d3ce77a67d4220096f922abe2d7df7c", "score": "0.7419504", "text": "func (o *GetIPAMIpsParams) SetTags(tags *string) {\n\to.Tags = tags\n}", "title": "" }, { "docid": "cf4011ae9a7b3d3e03e2d12fffe6cbaa", "score": "0.7417179", "text": "func (s *CreateAppInput) SetTags(v map[string]*string) *CreateAppInput {\n\ts.Tags = v\n\treturn s\n}", "title": "" }, { "docid": "5ec4dfb67855121f3aebbece3fac8081", "score": "0.7413775", "text": "func (s *CreateStreamInput) SetTags(v map[string]*string) *CreateStreamInput {\n\ts.Tags = v\n\treturn s\n}", "title": "" }, { "docid": "31314b166c3fabcc10490594912bda5b", "score": "0.7411161", "text": "func (s *ReportGenerator) SetTags(v []*Tag) *ReportGenerator {\n\ts.Tags = v\n\treturn s\n}", "title": "" }, { "docid": "9350538d4a502b7126304fe7145066fc", "score": "0.7410752", "text": "func (s *CreateTapeWithBarcodeInput) SetTags(v []*Tag) *CreateTapeWithBarcodeInput {\n\ts.Tags = v\n\treturn s\n}", "title": "" } ]
7d0cfc0d217398263e8f188545633054
NewEmptyARMValue returns an empty ARM value suitable for deserializing into
[ { "docid": "1c6ddb1b6c436d0295273ef57b2a65db", "score": "0.0", "text": "func (requirements *ResourceRequirements_STATUS) NewEmptyARMValue() genruntime.ARMResourceStatus {\n\treturn &ResourceRequirements_STATUS_ARM{}\n}", "title": "" } ]
[ { "docid": "ce5e8895ecc8aff9fb290463cc4958b6", "score": "0.8127869", "text": "func (field *JsonField) NewEmptyARMValue() genruntime.ARMResourceStatus {\n\treturn &JsonField_ARM{}\n}", "title": "" }, { "docid": "e6587eee85952c8068e26187c1ff35ab", "score": "0.80511826", "text": "func (withDefault *JsonFieldWithDefault) NewEmptyARMValue() genruntime.ARMResourceStatus {\n\treturn &JsonFieldWithDefault_ARM{}\n}", "title": "" }, { "docid": "7c029a1bfea28d1abae0e1f66214c7ef", "score": "0.7999822", "text": "func (mapping *JsonInputSchemaMapping) NewEmptyARMValue() genruntime.ARMResourceStatus {\n\treturn &JsonInputSchemaMapping_ARM{}\n}", "title": "" }, { "docid": "941b297f0e4c1d4c7ab2a9658f31822e", "score": "0.7919985", "text": "func (factory *DataFactory) NewEmptyARMValue() genruntime.ARMResourceStatus {\n\treturn &DataFactory_ARM{}\n}", "title": "" }, { "docid": "976dc3d798446503799b1d65d8fe208f", "score": "0.79098934", "text": "func (kubernetes *Kubernetes) NewEmptyARMValue() genruntime.ARMResourceStatus {\n\treturn &Kubernetes_ARM{}\n}", "title": "" }, { "docid": "c1caccc39cefbc007679fc802bf07259", "score": "0.78836656", "text": "func (databricks *Databricks) NewEmptyARMValue() genruntime.ARMResourceStatus {\n\treturn &Databricks_ARM{}\n}", "title": "" }, { "docid": "266b6504f917ff16cb746e4c21ec4c57", "score": "0.78345996", "text": "func (mapping *JsonInputSchemaMapping_STATUS) NewEmptyARMValue() genruntime.ARMResourceStatus {\n\treturn &JsonInputSchemaMapping_STATUS_ARM{}\n}", "title": "" }, { "docid": "83f7737956369738061ae1a98ea9403c", "score": "0.7811369", "text": "func (enterprise *RedisEnterprise_Spec) NewEmptyARMValue() genruntime.ARMResourceStatus {\n\treturn &RedisEnterprise_Spec_ARM{}\n}", "title": "" }, { "docid": "7b2ba0526608d16e406bc9f4148e47b5", "score": "0.7789646", "text": "func (withDefault *JsonFieldWithDefault_STATUS) NewEmptyARMValue() genruntime.ARMResourceStatus {\n\treturn &JsonFieldWithDefault_STATUS_ARM{}\n}", "title": "" }, { "docid": "a43018a26a33ac7ede998afc5daa64cb", "score": "0.7770166", "text": "func (signalR *SignalR_Spec) NewEmptyARMValue() genruntime.ARMResourceStatus {\n\treturn &SignalR_Spec_ARM{}\n}", "title": "" }, { "docid": "d4e2a8cd0f77c9070c2cd4886f5eeec8", "score": "0.7734112", "text": "func (properties *DatabricksProperties) NewEmptyARMValue() genruntime.ARMResourceStatus {\n\treturn &DatabricksProperties_ARM{}\n}", "title": "" }, { "docid": "e4d306d56e5bae3bea80b369037bf202", "score": "0.77303374", "text": "func (iotHub *IotHub_Spec) NewEmptyARMValue() genruntime.ARMResourceStatus {\n\treturn &IotHub_Spec_ARM{}\n}", "title": "" }, { "docid": "d26067151e6b42300fb34c410f8ec9c7", "score": "0.77275246", "text": "func (schema *InstanceTypeSchema) NewEmptyARMValue() genruntime.ARMResourceStatus {\n\treturn &InstanceTypeSchema_ARM{}\n}", "title": "" }, { "docid": "d9b5421540d3ee945cb216010e3d4f0d", "score": "0.77196825", "text": "func (namespace *Namespace_Spec) NewEmptyARMValue() genruntime.ARMResourceStatus {\n\treturn &Namespace_Spec_ARM{}\n}", "title": "" }, { "docid": "e208d3f5ccced346cf0fe05bfbdf6bb6", "score": "0.7716446", "text": "func (container *Container) NewEmptyARMValue() genruntime.ARMResourceStatus {\n\treturn &Container_ARM{}\n}", "title": "" }, { "docid": "5e3edae43dbb5b0e97a062ddb9370b66", "score": "0.77112746", "text": "func (domain *Domain_Spec) NewEmptyARMValue() genruntime.ARMResourceStatus {\n\treturn &Domain_Spec_ARM{}\n}", "title": "" }, { "docid": "ea35f45715976e86096a8d55c6e28b59", "score": "0.768273", "text": "func (spark *SynapseSpark) NewEmptyARMValue() genruntime.ARMResourceStatus {\n\treturn &SynapseSpark_ARM{}\n}", "title": "" }, { "docid": "e2051553e7470e527c573e45d0c27ba9", "score": "0.7675527", "text": "func (mapping *InputSchemaMapping) NewEmptyARMValue() genruntime.ARMResourceStatus {\n\treturn &InputSchemaMapping_ARM{}\n}", "title": "" }, { "docid": "1ca6b1d156fe66e7d356125093d189fd", "score": "0.7672022", "text": "func (feature *SignalRFeature) NewEmptyARMValue() genruntime.ARMResourceStatus {\n\treturn &SignalRFeature_ARM{}\n}", "title": "" }, { "docid": "c4b2f39cd18c07c6b88f4036f6a8b6ee", "score": "0.7658132", "text": "func (compute *Workspaces_Compute_Spec) NewEmptyARMValue() genruntime.ARMResourceStatus {\n\treturn &Workspaces_Compute_Spec_ARM{}\n}", "title": "" }, { "docid": "e6d161b9ae663d12a4dfc352c3106324", "score": "0.7655459", "text": "func (aks *AKS) NewEmptyARMValue() genruntime.ARMResourceStatus {\n\treturn &AKS_ARM{}\n}", "title": "" }, { "docid": "839e1d35a5e003590cbee50bcb4280dd", "score": "0.7654559", "text": "func (compute *Compute) NewEmptyARMValue() genruntime.ARMResourceStatus {\n\treturn &Compute_ARM{}\n}", "title": "" }, { "docid": "32b6c7b56cadfb11d0fe70d34e010142", "score": "0.764546", "text": "func (definition *InitContainerDefinition) NewEmptyARMValue() genruntime.ARMResourceStatus {\n\treturn &InitContainerDefinition_ARM{}\n}", "title": "" }, { "docid": "0f3615f7199472ab36da13e325afdcff", "score": "0.76431495", "text": "func (machine *VirtualMachine) NewEmptyARMValue() genruntime.ARMResourceStatus {\n\treturn &VirtualMachine_ARM{}\n}", "title": "" }, { "docid": "355aedbefd08d3283292bbc39cfcabff", "score": "0.76371473", "text": "func (databricks *Databricks_STATUS) NewEmptyARMValue() genruntime.ARMResourceStatus {\n\treturn &Databricks_STATUS_ARM{}\n}", "title": "" }, { "docid": "5e97baf96333780d9a499e9972126655", "score": "0.76301146", "text": "func (settings *CosmosDbSettings) NewEmptyARMValue() genruntime.ARMResourceStatus {\n\treturn &CosmosDbSettings_ARM{}\n}", "title": "" }, { "docid": "287674bf509d4888243b645c72dd8fbf", "score": "0.7622744", "text": "func (field *JsonField_STATUS) NewEmptyARMValue() genruntime.ARMResourceStatus {\n\treturn &JsonField_STATUS_ARM{}\n}", "title": "" }, { "docid": "7db634475755ed82b596e6b42f7d4e8b", "score": "0.76220435", "text": "func (image *Image_Spec) NewEmptyARMValue() genruntime.ARMResourceStatus {\n\treturn &Image_Spec_ARM{}\n}", "title": "" }, { "docid": "d6ea56ce1ae8faa4c2de238bbdbc050e", "score": "0.7618415", "text": "func (factory *DataFactory_STATUS) NewEmptyARMValue() genruntime.ARMResourceStatus {\n\treturn &DataFactory_STATUS_ARM{}\n}", "title": "" }, { "docid": "59396fcd751d41527103374e5fe08a7a", "score": "0.76148844", "text": "func (patchSettings *PatchSettings) CreateEmptyARMValue() genruntime.ARMResourceStatus {\n\treturn &PatchSettingsARM{}\n}", "title": "" }, { "docid": "cd028cc58b3d71629849de1491603288", "score": "0.76123595", "text": "func (properties *SynapseSpark_Properties) NewEmptyARMValue() genruntime.ARMResourceStatus {\n\treturn &SynapseSpark_Properties_ARM{}\n}", "title": "" }, { "docid": "63dfb3664c2b7524feded42e5e6251ef", "score": "0.7611345", "text": "func (insight *HDInsight) NewEmptyARMValue() genruntime.ARMResourceStatus {\n\treturn &HDInsight_ARM{}\n}", "title": "" }, { "docid": "9e612dbd21b21f90f082995c9b08b30b", "score": "0.7609846", "text": "func (workspace *Workspace_Spec) NewEmptyARMValue() genruntime.ARMResourceStatus {\n\treturn &Workspace_Spec_ARM{}\n}", "title": "" }, { "docid": "54d4874962ea6fe811c7ffc90ed8a6d3", "score": "0.7608883", "text": "func (info *NotebookResourceInfo_STATUS) NewEmptyARMValue() genruntime.ARMResourceStatus {\n\treturn &NotebookResourceInfo_STATUS_ARM{}\n}", "title": "" }, { "docid": "b78f6e1830c79bba337ae626d9abd9b5", "score": "0.7599001", "text": "func (vault *BackupVault_Spec) NewEmptyARMValue() genruntime.ARMResourceStatus {\n\treturn &BackupVault_Spec_ARM{}\n}", "title": "" }, { "docid": "f774599079e320ea04e93c41f01053ec", "score": "0.75966245", "text": "func (info *IotHubSkuInfo) NewEmptyARMValue() genruntime.ARMResourceStatus {\n\treturn &IotHubSkuInfo_ARM{}\n}", "title": "" }, { "docid": "c8516877923d822fd49cec556babd51b", "score": "0.75953764", "text": "func (settings *FeatureSettings) NewEmptyARMValue() genruntime.ARMResourceStatus {\n\treturn &FeatureSettings_ARM{}\n}", "title": "" }, { "docid": "e8f202b3eb3db09a886bd1ee90650525", "score": "0.75840694", "text": "func (mapping *InputSchemaMapping_STATUS) NewEmptyARMValue() genruntime.ARMResourceStatus {\n\treturn &InputSchemaMapping_STATUS_ARM{}\n}", "title": "" }, { "docid": "c1b47141e88bfbc895cb07b09f57f49b", "score": "0.75724435", "text": "func (template *UpstreamTemplate) NewEmptyARMValue() genruntime.ARMResourceStatus {\n\treturn &UpstreamTemplate_ARM{}\n}", "title": "" }, { "docid": "8d86529260f00015f6fe1c509490cab0", "score": "0.75716174", "text": "func (properties *AutoScaleProperties) NewEmptyARMValue() genruntime.ARMResourceStatus {\n\treturn &AutoScaleProperties_ARM{}\n}", "title": "" }, { "docid": "8fdb3bf9975ca5f604254c831b220916", "score": "0.7566711", "text": "func (encryption *Encryption) NewEmptyARMValue() genruntime.ARMResourceStatus {\n\treturn &Encryption_ARM{}\n}", "title": "" }, { "docid": "105ec2841effd1434557af9fef5bd6e9", "score": "0.75665396", "text": "func (volume *Volume) NewEmptyARMValue() genruntime.ARMResourceStatus {\n\treturn &Volume_ARM{}\n}", "title": "" }, { "docid": "db2d3046e4416fc678cbe7b29411a33d", "score": "0.7565045", "text": "func (data *SystemData) NewEmptyARMValue() genruntime.ARMResourceStatus {\n\treturn &SystemData_ARM{}\n}", "title": "" }, { "docid": "f99e92576aa0b5108ba0c1e14bfabaed", "score": "0.7560422", "text": "func (identity *ArmIdentity) NewEmptyARMValue() genruntime.ARMResourceStatus {\n\treturn &ArmIdentity_ARM{}\n}", "title": "" }, { "docid": "8b968adfe8d9733ac6cd0ae547d18c36", "score": "0.7552873", "text": "func (forCmk *IdentityForCmk) NewEmptyARMValue() genruntime.ARMResourceStatus {\n\treturn &IdentityForCmk_ARM{}\n}", "title": "" }, { "docid": "5d7b26d1c1ea6915332cadf2981ce988", "score": "0.75496024", "text": "func (properties *DatabricksProperties_STATUS) NewEmptyARMValue() genruntime.ARMResourceStatus {\n\treturn &DatabricksProperties_STATUS_ARM{}\n}", "title": "" }, { "docid": "9269cdf89e7e11a1adbfef0a144ca473", "score": "0.75486976", "text": "func (reference *ScriptReference) NewEmptyARMValue() genruntime.ARMResourceStatus {\n\treturn &ScriptReference_ARM{}\n}", "title": "" }, { "docid": "6de3f73428eb2d0b12e6b3267934b856", "score": "0.7546758", "text": "func (group *ContainerGroup_Spec) NewEmptyARMValue() genruntime.ARMResourceStatus {\n\treturn &ContainerGroup_Spec_ARM{}\n}", "title": "" }, { "docid": "7fefe93e1868bf40ec90b545028253ee", "score": "0.7541583", "text": "func (resourceSku *ResourceSku) NewEmptyARMValue() genruntime.ARMResourceStatus {\n\treturn &ResourceSku_ARM{}\n}", "title": "" }, { "docid": "313da9babb2db549ba08ae8e8adbe93f", "score": "0.7541078", "text": "func (resources *InstanceTypeSchema_Resources) NewEmptyARMValue() genruntime.ARMResourceStatus {\n\treturn &InstanceTypeSchema_Resources_ARM{}\n}", "title": "" }, { "docid": "65235d574e0c1cb9b4894c870f8d2a95", "score": "0.75391567", "text": "func (sku *Sku) NewEmptyARMValue() genruntime.ARMResourceStatus {\n\treturn &Sku_ARM{}\n}", "title": "" }, { "docid": "65235d574e0c1cb9b4894c870f8d2a95", "score": "0.75391567", "text": "func (sku *Sku) NewEmptyARMValue() genruntime.ARMResourceStatus {\n\treturn &Sku_ARM{}\n}", "title": "" }, { "docid": "65235d574e0c1cb9b4894c870f8d2a95", "score": "0.75391567", "text": "func (sku *Sku) NewEmptyARMValue() genruntime.ARMResourceStatus {\n\treturn &Sku_ARM{}\n}", "title": "" }, { "docid": "5d672dd89a273d06037f7a3db1f2e0b5", "score": "0.7533885", "text": "func (resource *SubResource) NewEmptyARMValue() genruntime.ARMResourceStatus {\n\treturn &SubResource_ARM{}\n}", "title": "" }, { "docid": "7e8a5b0efbe38b4b3afb39087a8110c1", "score": "0.7525446", "text": "func (properties *KubernetesProperties) NewEmptyARMValue() genruntime.ARMResourceStatus {\n\treturn &KubernetesProperties_ARM{}\n}", "title": "" }, { "docid": "f0b02343b2796077b9adf333ce5ca31b", "score": "0.7524402", "text": "func (identity *Identity) NewEmptyARMValue() genruntime.ARMResourceStatus {\n\treturn &Identity_ARM{}\n}", "title": "" }, { "docid": "f0b02343b2796077b9adf333ce5ca31b", "score": "0.7524402", "text": "func (identity *Identity) NewEmptyARMValue() genruntime.ARMResourceStatus {\n\treturn &Identity_ARM{}\n}", "title": "" }, { "docid": "f8c3fec27b43d47b85d5122a1fc13bb8", "score": "0.7522949", "text": "func (queue *Namespaces_Queue_Spec) NewEmptyARMValue() genruntime.ARMResourceStatus {\n\treturn &Namespaces_Queue_Spec_ARM{}\n}", "title": "" }, { "docid": "2a9f185426a8e98d8c80ba329d9e36ce", "score": "0.75214916", "text": "func (vault *BackupVaultSpec) NewEmptyARMValue() genruntime.ARMResourceStatus {\n\treturn &BackupVaultSpec_ARM{}\n}", "title": "" }, { "docid": "69f25581524eb59d190d8a29a20cbde5", "score": "0.7520076", "text": "func (resourceId *ResourceId) NewEmptyARMValue() genruntime.ARMResourceStatus {\n\treturn &ResourceId_ARM{}\n}", "title": "" }, { "docid": "b6f0781dad65f59c20bffd811b63ab20", "score": "0.7513453", "text": "func (header *HttpHeader) NewEmptyARMValue() genruntime.ARMResourceStatus {\n\treturn &HttpHeader_ARM{}\n}", "title": "" }, { "docid": "d7e3ddd6d2a6416567461405426066b7", "score": "0.7507826", "text": "func (settings *BgpSettings) NewEmptyARMValue() genruntime.ARMResourceStatus {\n\treturn &BgpSettings_ARM{}\n}", "title": "" }, { "docid": "8b0e9db3fc75ee65b72597ef7499550e", "score": "0.7505312", "text": "func (analytics *DataLakeAnalytics) NewEmptyARMValue() genruntime.ARMResourceStatus {\n\treturn &DataLakeAnalytics_ARM{}\n}", "title": "" }, { "docid": "90dc320fcbe0701fe9e1334b2f6578a1", "score": "0.75015646", "text": "func (instance *ComputeInstance) NewEmptyARMValue() genruntime.ARMResourceStatus {\n\treturn &ComputeInstance_ARM{}\n}", "title": "" }, { "docid": "fc22c0340ad16f27c322768136eca95c", "score": "0.7501251", "text": "func (settings *SignalRCorsSettings) NewEmptyARMValue() genruntime.ARMResourceStatus {\n\treturn &SignalRCorsSettings_ARM{}\n}", "title": "" }, { "docid": "8a257c01f111501ff145cc97e8525acf", "score": "0.7496835", "text": "func (properties *EventHubProperties) NewEmptyARMValue() genruntime.ARMResourceStatus {\n\treturn &EventHubProperties_ARM{}\n}", "title": "" }, { "docid": "c1c3aa693d3ed69368cfa26c22a9a9c3", "score": "0.7496432", "text": "func (compute *AmlCompute) NewEmptyARMValue() genruntime.ARMResourceStatus {\n\treturn &AmlCompute_ARM{}\n}", "title": "" }, { "docid": "ab636ffe5e8838db08b568286506a1f8", "score": "0.7496127", "text": "func (kubernetes *Kubernetes_STATUS) NewEmptyARMValue() genruntime.ARMResourceStatus {\n\treturn &Kubernetes_STATUS_ARM{}\n}", "title": "" }, { "docid": "35ca1ab3e4ece73ddcf8a735adc50c2d", "score": "0.7495369", "text": "func (exec *ContainerExec) NewEmptyARMValue() genruntime.ARMResourceStatus {\n\treturn &ContainerExec_ARM{}\n}", "title": "" }, { "docid": "edacd1c386d29da383327063333e0a60", "score": "0.7493414", "text": "func (properties *KeyVaultProperties) NewEmptyARMValue() genruntime.ARMResourceStatus {\n\treturn &KeyVaultProperties_ARM{}\n}", "title": "" }, { "docid": "edacd1c386d29da383327063333e0a60", "score": "0.7493414", "text": "func (properties *KeyVaultProperties) NewEmptyARMValue() genruntime.ARMResourceStatus {\n\treturn &KeyVaultProperties_ARM{}\n}", "title": "" }, { "docid": "7019de417b420f892d96889e65909f2c", "score": "0.7492255", "text": "func (settings *SignalRTlsSettings) NewEmptyARMValue() genruntime.ARMResourceStatus {\n\treturn &SignalRTlsSettings_ARM{}\n}", "title": "" }, { "docid": "633b6fd41dfe07b5bb2ae6d5f19959c0", "score": "0.7491359", "text": "func (linuxPatchSettings *LinuxPatchSettings) CreateEmptyARMValue() genruntime.ARMResourceStatus {\n\treturn &LinuxPatchSettingsARM{}\n}", "title": "" }, { "docid": "f326be9101d75454928b0fd799f8e710", "score": "0.7482093", "text": "func (settings *ScaleSettings) NewEmptyARMValue() genruntime.ARMResourceStatus {\n\treturn &ScaleSettings_ARM{}\n}", "title": "" }, { "docid": "ef7ba76defd4d427f6f07e83d3c21208", "score": "0.7482075", "text": "func (properties *IotHubProperties) NewEmptyARMValue() genruntime.ARMResourceStatus {\n\treturn &IotHubProperties_ARM{}\n}", "title": "" }, { "docid": "7f9b4676d09093f01225489c7ca53327", "score": "0.74793077", "text": "func (schema *InstanceTypeSchema_STATUS) NewEmptyARMValue() genruntime.ARMResourceStatus {\n\treturn &InstanceTypeSchema_STATUS_ARM{}\n}", "title": "" }, { "docid": "405217bfb147beef62b66f3ff93f0278", "score": "0.7474965", "text": "func (port *Port) NewEmptyARMValue() genruntime.ARMResourceStatus {\n\treturn &Port_ARM{}\n}", "title": "" }, { "docid": "3055deb868864cbfe02f20a29bf34d87", "score": "0.74743235", "text": "func (enterprise *RedisEnterprise_STATUS) NewEmptyARMValue() genruntime.ARMResourceStatus {\n\treturn &RedisEnterprise_STATUS_ARM{}\n}", "title": "" }, { "docid": "5ff33babaef928787390e1405677e767", "score": "0.7474215", "text": "func (setting *StorageSetting) NewEmptyARMValue() genruntime.ARMResourceStatus {\n\treturn &StorageSetting_ARM{}\n}", "title": "" }, { "docid": "3fc12ab2a2372ef08219843e207ef5d0", "score": "0.7473498", "text": "func (plan *Plan) CreateEmptyARMValue() genruntime.ARMResourceStatus {\n\treturn &PlanARM{}\n}", "title": "" }, { "docid": "85414c4ec8b312ddbb68735d73371b86", "score": "0.74720544", "text": "func (settings *FeatureSettings_STATUS) NewEmptyARMValue() genruntime.ARMResourceStatus {\n\treturn &FeatureSettings_STATUS_ARM{}\n}", "title": "" }, { "docid": "5a44beafe495340b821d9c3a3d82296c", "score": "0.74695617", "text": "func (analytics *LogAnalytics) NewEmptyARMValue() genruntime.ARMResourceStatus {\n\treturn &LogAnalytics_ARM{}\n}", "title": "" }, { "docid": "4a89ca03f5001fd90610565f1fa074c9", "score": "0.74666363", "text": "func (configuration *DnsConfiguration) NewEmptyARMValue() genruntime.ARMResourceStatus {\n\treturn &DnsConfiguration_ARM{}\n}", "title": "" }, { "docid": "ec4d5dd4a3080fb023371884c7a46712", "score": "0.74659413", "text": "func (requirements *ResourceRequirements) NewEmptyARMValue() genruntime.ARMResourceStatus {\n\treturn &ResourceRequirements_ARM{}\n}", "title": "" }, { "docid": "7cc1baa94de741098ccdd8881366b40c", "score": "0.7464063", "text": "func (signalR *SignalR_STATUS) NewEmptyARMValue() genruntime.ARMResourceStatus {\n\treturn &SignalR_STATUS_ARM{}\n}", "title": "" }, { "docid": "5fd2a747331c7f778e4f88837048f0a2", "score": "0.7461261", "text": "func (resource *ThroughputSettingsResource) NewEmptyARMValue() genruntime.ARMResourceStatus {\n\treturn &ThroughputSettingsResource_ARM{}\n}", "title": "" }, { "docid": "d1857af85fa688e863a27ded5a7945df", "score": "0.7458308", "text": "func (properties *CloudToDeviceProperties) NewEmptyARMValue() genruntime.ARMResourceStatus {\n\treturn &CloudToDeviceProperties_ARM{}\n}", "title": "" }, { "docid": "ea15c83b4d8ca7e578860020fa5ab0ef", "score": "0.7457311", "text": "func (error *NotebookPreparationError_STATUS) NewEmptyARMValue() genruntime.ARMResourceStatus {\n\treturn &NotebookPreparationError_STATUS_ARM{}\n}", "title": "" }, { "docid": "4fac03e7d6499504bd5cced34158a6c1", "score": "0.7449266", "text": "func (properties *EnrichmentProperties) NewEmptyARMValue() genruntime.ARMResourceStatus {\n\treturn &EnrichmentProperties_ARM{}\n}", "title": "" }, { "docid": "cca7688a9d28251566fa068cc90cdb90", "score": "0.74488574", "text": "func (winRMConfiguration *WinRMConfiguration) CreateEmptyARMValue() genruntime.ARMResourceStatus {\n\treturn &WinRMConfigurationARM{}\n}", "title": "" }, { "docid": "0fb3a8dfc1c457d1effd601ad237a402", "score": "0.744629", "text": "func (additionalCapabilities *AdditionalCapabilities) CreateEmptyARMValue() genruntime.ARMResourceStatus {\n\treturn &AdditionalCapabilitiesARM{}\n}", "title": "" }, { "docid": "f8c6ea3c7a44b4f7c00a058cd0fb9900", "score": "0.7443966", "text": "func (gateway *VirtualNetworkGateway_Spec) NewEmptyARMValue() genruntime.ARMResourceStatus {\n\treturn &VirtualNetworkGateway_Spec_ARM{}\n}", "title": "" }, { "docid": "6e7b112ce18fb58b8f9105d729891e39", "score": "0.74436736", "text": "func (info *ErrorAdditionalInfo_STATUS) NewEmptyARMValue() genruntime.ARMResourceStatus {\n\treturn &ErrorAdditionalInfo_STATUS_ARM{}\n}", "title": "" }, { "docid": "415384ea660e7cc0264ce735a03d3d82", "score": "0.744045", "text": "func (patchSettingsStatus *PatchSettings_Status) CreateEmptyARMValue() genruntime.ARMResourceStatus {\n\treturn &PatchSettings_StatusARM{}\n}", "title": "" }, { "docid": "5a6e69dab86f2fe1719d89cd6f6d1ca2", "score": "0.74377084", "text": "func (info *IotHubSkuInfo_STATUS) NewEmptyARMValue() genruntime.ARMResourceStatus {\n\treturn &IotHubSkuInfo_STATUS_ARM{}\n}", "title": "" }, { "docid": "7c83b768bf94216a987dea1e88e9a776", "score": "0.74371964", "text": "func (probe *ContainerProbe) NewEmptyARMValue() genruntime.ARMResourceStatus {\n\treturn &ContainerProbe_ARM{}\n}", "title": "" }, { "docid": "56ffffc3d010420dd3b10eaa04f340eb", "score": "0.7437157", "text": "func (properties *AutoScaleProperties_STATUS) NewEmptyARMValue() genruntime.ARMResourceStatus {\n\treturn &AutoScaleProperties_STATUS_ARM{}\n}", "title": "" }, { "docid": "3455c9509376b206dfbb66bb863ccd71", "score": "0.7436275", "text": "func (reference *ScriptReference_STATUS) NewEmptyARMValue() genruntime.ARMResourceStatus {\n\treturn &ScriptReference_STATUS_ARM{}\n}", "title": "" }, { "docid": "caea99157cc654a0dc3c8dfe49bf342c", "score": "0.74354136", "text": "func (windowsConfiguration *WindowsConfiguration) CreateEmptyARMValue() genruntime.ARMResourceStatus {\n\treturn &WindowsConfigurationARM{}\n}", "title": "" }, { "docid": "1e26e220a15310e19acf6bd1c95db142", "score": "0.74333805", "text": "func (upgradePolicy *UpgradePolicy) CreateEmptyARMValue() genruntime.ARMResourceStatus {\n\treturn &UpgradePolicyARM{}\n}", "title": "" }, { "docid": "bf7ef3b8376a33d378f8e5b5152a976a", "score": "0.7432404", "text": "func (scripts *SetupScripts) NewEmptyARMValue() genruntime.ARMResourceStatus {\n\treturn &SetupScripts_ARM{}\n}", "title": "" } ]
eca8144a4e1db30bf1b711413c865c00
IsRedirect returns true when this cifs search path create created response has a 3xx status code
[ { "docid": "6659c3aa7390630e12446b8413223b9b", "score": "0.65596086", "text": "func (o *CifsSearchPathCreateCreated) IsRedirect() bool {\n\treturn false\n}", "title": "" } ]
[ { "docid": "ae5c4edce844690966e1d1f763c43f45", "score": "0.702576", "text": "func (o *CifsSearchPathCreateDefault) IsRedirect() bool {\n\treturn o._statusCode/100 == 3\n}", "title": "" }, { "docid": "c2ea7d0e2be1baf1e6e52822e3a7df21", "score": "0.68170506", "text": "func (o *FileMoveCreateDefault) IsRedirect() bool {\n\treturn o._statusCode/100 == 3\n}", "title": "" }, { "docid": "d5d465617b94faf48c274e9cc9152731", "score": "0.67720544", "text": "func (o *FileDirectorySecurityACLCreateDefault) IsRedirect() bool {\n\treturn o._statusCode/100 == 3\n}", "title": "" }, { "docid": "79ebaecc3f3fd1946fbf9ff505e3dcfc", "score": "0.65542644", "text": "func (o *QtreeCreateDefault) IsRedirect() bool {\n\treturn o._statusCode/100 == 3\n}", "title": "" }, { "docid": "ddabf1215e8e7ba35e4eef8118ffa1d9", "score": "0.6524542", "text": "func (o *S3ServiceCreateDefault) IsRedirect() bool {\n\treturn o._statusCode/100 == 3\n}", "title": "" }, { "docid": "5fe7f44a55f5b0edbe57390abfa00fbe", "score": "0.65241385", "text": "func (o *NvmeSubsystemCreateDefault) IsRedirect() bool {\n\treturn o._statusCode/100 == 3\n}", "title": "" }, { "docid": "9a998367706c08638236e6f504865bf6", "score": "0.6482556", "text": "func (o *CreatePresetDefault) IsRedirect() bool {\n\treturn o._statusCode/100 == 3\n}", "title": "" }, { "docid": "0d0e7ec06da2cb23e2c0af90f9b6a432", "score": "0.64740753", "text": "func (o *SnaplockRetentionOperationCreateDefault) IsRedirect() bool {\n\treturn o._statusCode/100 == 3\n}", "title": "" }, { "docid": "67f016650c3673269b9527b960d022e5", "score": "0.64603895", "text": "func (o *SnapmirrorRelationshipTransferCreateDefault) IsRedirect() bool {\n\treturn o._statusCode/100 == 3\n}", "title": "" }, { "docid": "70ec2b496829cda0e31de85db8b47d9e", "score": "0.64181733", "text": "func (o *CreateDefault) IsRedirect() bool {\n\treturn o._statusCode/100 == 3\n}", "title": "" }, { "docid": "85571d39e5cd1ffc55926e3b63d13b37", "score": "0.6395496", "text": "func (o *FcZoneGetDefault) IsRedirect() bool {\n\treturn o._statusCode/100 == 3\n}", "title": "" }, { "docid": "e52020022a012fcbd0bf632deaabd196", "score": "0.6374019", "text": "func (o *FabricGetDefault) IsRedirect() bool {\n\treturn o._statusCode/100 == 3\n}", "title": "" }, { "docid": "e6e6e6567020179334216b7f92c4e40b", "score": "0.6349685", "text": "func (o *SvmCreateDefault) IsRedirect() bool {\n\treturn o._statusCode/100 == 3\n}", "title": "" }, { "docid": "39fca180d9f3abd269c0837f96845cc7", "score": "0.6348661", "text": "func (o *GetFileThumbnailDefault) IsRedirect() bool {\n\treturn o._statusCode/100 == 3\n}", "title": "" }, { "docid": "fcfdbc0c86432a64ce87563b0b889368", "score": "0.6331204", "text": "func (o *CreatePeerFolderInternalServerError) IsRedirect() bool {\n\treturn false\n}", "title": "" }, { "docid": "08525bf1827b0eb57d86cb85c0010853", "score": "0.6305409", "text": "func (o *RTRDeletePutFilesNotFound) IsRedirect() bool {\n\treturn false\n}", "title": "" }, { "docid": "0ede3ec3168a692434a812afc81d8841", "score": "0.6288599", "text": "func (o *CifsSearchPathCreateDefault) IsSuccess() bool {\n\treturn o._statusCode/100 == 2\n}", "title": "" }, { "docid": "e1dbe27097f577cc3e6156414da5f79b", "score": "0.6285583", "text": "func (o *CreateVersionDefault) IsRedirect() bool {\n\treturn o._statusCode/100 == 3\n}", "title": "" }, { "docid": "4f6667b1b5e2c63454a028bd13a48a50", "score": "0.6272419", "text": "func (o *PublickeyCreateDefault) IsRedirect() bool {\n\treturn o._statusCode/100 == 3\n}", "title": "" }, { "docid": "7d2ae4d0fefdafae5cc5337436c5b58e", "score": "0.6229808", "text": "func (o *GetOpenstackMetadataDefault) IsRedirect() bool {\n\treturn o._statusCode/100 == 3\n}", "title": "" }, { "docid": "d61b1fa6b9ce705cedea32075c62130c", "score": "0.6209294", "text": "func (o *IscsiServiceCollectionGetDefault) IsRedirect() bool {\n\treturn o._statusCode/100 == 3\n}", "title": "" }, { "docid": "ecafb42094990a846c897415eec14d62", "score": "0.6203724", "text": "func (o *FcZoneGetOK) IsRedirect() bool {\n\treturn false\n}", "title": "" }, { "docid": "3619796abcffc00bd298795f84c77c59", "score": "0.62022454", "text": "func (o *CloudStoreCreateDefault) IsRedirect() bool {\n\treturn o._statusCode/100 == 3\n}", "title": "" }, { "docid": "2ddfc25bff05f2ac019df275ccba0286", "score": "0.6193575", "text": "func (o *BatchGetCmdStatusNotFound) IsRedirect() bool {\n\treturn false\n}", "title": "" }, { "docid": "c61aaac2510f8ffff4b9dc070e8b2bba", "score": "0.61897725", "text": "func (o *CreatePeerFolderNotFound) IsRedirect() bool {\n\treturn false\n}", "title": "" }, { "docid": "15a1dd428933808fd223b4a14a5de137", "score": "0.6184401", "text": "func (o *FileDirectorySecurityACLCreateAccepted) IsRedirect() bool {\n\treturn false\n}", "title": "" }, { "docid": "a6d8c50f05236230b3838c54678bef5b", "score": "0.6169494", "text": "func (o *VscanServerStatusGetDefault) IsRedirect() bool {\n\treturn o._statusCode/100 == 3\n}", "title": "" }, { "docid": "9ac3e48ab6d3048403d05f04f695418e", "score": "0.6155905", "text": "func (o *ClusterGetDefault) IsRedirect() bool {\n\treturn o._statusCode/100 == 3\n}", "title": "" }, { "docid": "44c34b030c44d8c6713d9c2d7c8b940f", "score": "0.6150742", "text": "func (o *RTRDeletePutFilesOK) IsRedirect() bool {\n\treturn false\n}", "title": "" }, { "docid": "cb24684aef8b81359d229bb33c057a02", "score": "0.6144079", "text": "func (o *VscanServerStatusGetOK) IsRedirect() bool {\n\treturn false\n}", "title": "" }, { "docid": "425c10da1705ed04701d8b98a998830b", "score": "0.6143414", "text": "func (o *GetNetworkDomainNotFound) IsRedirect() bool {\n\treturn false\n}", "title": "" }, { "docid": "d58695c43a909a6e5fa240884a6205c7", "score": "0.61388457", "text": "func (o *FcInterfaceGetDefault) IsRedirect() bool {\n\treturn o._statusCode/100 == 3\n}", "title": "" }, { "docid": "be825c2c546f9907727b5896ff81ae2e", "score": "0.6138741", "text": "func (o *GetSocks5ServerNotFound) IsRedirect() bool {\n\treturn false\n}", "title": "" }, { "docid": "3d595cdb6fad6425db741e8b8d54bef5", "score": "0.61353934", "text": "func (o *SnaplockRetentionPolicyCreateDefault) IsRedirect() bool {\n\treturn o._statusCode/100 == 3\n}", "title": "" }, { "docid": "f11584ddb7864aa3136b199788b1afb1", "score": "0.6126657", "text": "func (o *CifsSearchPathCreateCreated) IsSuccess() bool {\n\treturn true\n}", "title": "" }, { "docid": "088812b4130e573d2127f79596e25490", "score": "0.61221987", "text": "func (o *ConfigurationBackupFileCollectionGetDefault) IsRedirect() bool {\n\treturn o._statusCode/100 == 3\n}", "title": "" }, { "docid": "ab33311920d761007fedb2fea9ad2c53", "score": "0.61118746", "text": "func (o *CreateLdapServerCreated) IsRedirect() bool {\n\treturn false\n}", "title": "" }, { "docid": "c262b05fc2f336a2e9e122321e2487d4", "score": "0.61058515", "text": "func (o *FcpServiceModifyDefault) IsRedirect() bool {\n\treturn o._statusCode/100 == 3\n}", "title": "" }, { "docid": "e8886d127b0787e67e7f9dc074e3032c", "score": "0.6103849", "text": "func (o *RTRDeletePutFilesBadRequest) IsRedirect() bool {\n\treturn false\n}", "title": "" }, { "docid": "d09bce89db36b851928e78ca71bf210f", "score": "0.6103146", "text": "func (o *CreateLdapServerUnauthorized) IsRedirect() bool {\n\treturn false\n}", "title": "" }, { "docid": "0dca41451cb6025cb4a679ef4640a9ad", "score": "0.6101637", "text": "func (o *GetClusterNotFound) IsRedirect() bool {\n\treturn false\n}", "title": "" }, { "docid": "87ddc5defff252915feca0ce3cfd8470", "score": "0.6100465", "text": "func (o *PcloudTenantsSshkeysGetNotFound) IsRedirect() bool {\n\treturn false\n}", "title": "" }, { "docid": "28d24542e4bf8f82a189552d65cbf3a7", "score": "0.60992676", "text": "func (o *BackupsRestoreStatusNotFound) IsRedirect() bool {\n\treturn false\n}", "title": "" }, { "docid": "49ae4b509cfee04ef57679503c01eddb", "score": "0.6094756", "text": "func (o *S3ServiceCreateCreated) IsRedirect() bool {\n\treturn false\n}", "title": "" }, { "docid": "43d9c172af361a4be90fe01ca20f3c4f", "score": "0.60938406", "text": "func (o *TransferRunDefault) IsRedirect() bool {\n\treturn o._statusCode/100 == 3\n}", "title": "" }, { "docid": "b0f7a45d9cc2eff845f6ec4c6f7b0790", "score": "0.6091439", "text": "func (o *PcloudImagesGetNotFound) IsRedirect() bool {\n\treturn false\n}", "title": "" }, { "docid": "7e241c4000863e991774c114bcca5cec", "score": "0.60834706", "text": "func (o *GetBlockDeviceNotFound) IsRedirect() bool {\n\treturn false\n}", "title": "" }, { "docid": "44b091c25974c102b0c430cf8b1ed7f9", "score": "0.60832477", "text": "func (o *S3PolicyCreateDefault) IsRedirect() bool {\n\treturn o._statusCode/100 == 3\n}", "title": "" }, { "docid": "3e11dbe951371c66cf9787ea4dc3c482", "score": "0.6073035", "text": "func (o *ClusterGetOK) IsRedirect() bool {\n\treturn false\n}", "title": "" }, { "docid": "bdae43ea8ce74f3b40bd14b31bb2b1c9", "score": "0.6071189", "text": "func (o *CreateTokenDefault) IsRedirect() bool {\n\treturn o._statusCode/100 == 3\n}", "title": "" }, { "docid": "2d0a22aabe37cb920a643dc0a274942d", "score": "0.60708493", "text": "func (o *GetIntelRuleFileInternalServerError) IsRedirect() bool {\n\treturn false\n}", "title": "" }, { "docid": "695cf03da0be29c02c4685eac44d0dbc", "score": "0.6068463", "text": "func (o *ExportPolicyCreateDefault) IsRedirect() bool {\n\treturn o._statusCode/100 == 3\n}", "title": "" }, { "docid": "c88a10b1e2d694edb5dc7aa31773a102", "score": "0.606368", "text": "func (o *CreateOrganizationDefault) IsRedirect() bool {\n\treturn o._statusCode/100 == 3\n}", "title": "" }, { "docid": "3254463f075c8371fd336e84e08ff22a", "score": "0.6060557", "text": "func (o *VolumeEfficiencyPolicyModifyDefault) IsRedirect() bool {\n\treturn o._statusCode/100 == 3\n}", "title": "" }, { "docid": "fecccc503073b582b33c79c2c93cfe59", "score": "0.60587674", "text": "func (o *PatchAgentNotFound) IsRedirect() bool {\n\treturn false\n}", "title": "" }, { "docid": "191ebd371f37dba1ff01cd14266c8eb4", "score": "0.60579073", "text": "func (o *StoragePortModifyDefault) IsRedirect() bool {\n\treturn o._statusCode/100 == 3\n}", "title": "" }, { "docid": "f56dadb0e87a8be26845fe2836c91164", "score": "0.60578185", "text": "func (o *CreateVersionNotFound) IsRedirect() bool {\n\treturn false\n}", "title": "" }, { "docid": "63f6b624426ca6d8cbdefabcd7b28b87", "score": "0.6056517", "text": "func (o *ConsistencyGroupSnapshotCreateDefault) IsRedirect() bool {\n\treturn o._statusCode/100 == 3\n}", "title": "" }, { "docid": "067304e6c4198acde58e0b5ad988d599", "score": "0.6051135", "text": "func (o *CifsShareModifyDefault) IsRedirect() bool {\n\treturn o._statusCode/100 == 3\n}", "title": "" }, { "docid": "4013f6cacc52401bf192888bbe2f72f8", "score": "0.60493296", "text": "func (o *CreatePeerFolderOK) IsRedirect() bool {\n\treturn false\n}", "title": "" }, { "docid": "3eb20dac0c37cd1f21090532419448ca", "score": "0.6042974", "text": "func (o *StoragePoolModifyDefault) IsRedirect() bool {\n\treturn o._statusCode/100 == 3\n}", "title": "" }, { "docid": "a67883ad9dfd3507e67aad952abdb280", "score": "0.60384166", "text": "func (o *SoftwareGetDefault) IsRedirect() bool {\n\treturn o._statusCode/100 == 3\n}", "title": "" }, { "docid": "bfa10c4370e37b0680be7461e58a1ac2", "score": "0.6036896", "text": "func (o *GetContactsContactFidPhonesDefault) IsRedirect() bool {\n\treturn o._statusCode/100 == 3\n}", "title": "" }, { "docid": "384cf3208bd35c79d5702fbb1aaac320", "score": "0.6029198", "text": "func (o *GetScanHostMetadataByIdsNotFound) IsRedirect() bool {\n\treturn false\n}", "title": "" }, { "docid": "3ce2b848d93c880966087954ac8b8772", "score": "0.60263675", "text": "func (o *GetClusterOK) IsRedirect() bool {\n\treturn false\n}", "title": "" }, { "docid": "a271b4c2d54b2bf9771d3ce775589716", "score": "0.6024743", "text": "func (o *CreateOrganizationNotFound) IsRedirect() bool {\n\treturn false\n}", "title": "" }, { "docid": "40020128f669fc965f90ec8b47a152d9", "score": "0.6022721", "text": "func (o *CreatePeerFolderUnauthorized) IsRedirect() bool {\n\treturn false\n}", "title": "" }, { "docid": "f58f29574f444b5822ee4ea20f0cb14b", "score": "0.6018923", "text": "func (o *FileMoveCreateCreated) IsRedirect() bool {\n\treturn false\n}", "title": "" }, { "docid": "31c7d24670a0039b07c688610b6d81a7", "score": "0.6017457", "text": "func (o *BatchGetCmdStatusInternalServerError) IsRedirect() bool {\n\treturn false\n}", "title": "" }, { "docid": "d8853173ce71e9dd7976b393501e462d", "score": "0.601584", "text": "func (o *GetOpenstackMetadataOK) IsRedirect() bool {\n\treturn false\n}", "title": "" }, { "docid": "57164e8f2f74bbd23348c037673185a1", "score": "0.6013275", "text": "func (o *PcloudVolumegroupsGetDetailsNotFound) IsRedirect() bool {\n\treturn false\n}", "title": "" }, { "docid": "bc2c07394268e259040678c3ced5fe9a", "score": "0.6013261", "text": "func (o *CreateDashboardDefault) IsRedirect() bool {\n\treturn o._statusCode/100 == 3\n}", "title": "" }, { "docid": "43d4253e9b3cd64859d6c7f2b163241f", "score": "0.6013031", "text": "func (o *PatchAgentDefault) IsRedirect() bool {\n\treturn o._statusCode/100 == 3\n}", "title": "" }, { "docid": "a0b9b098f2ebd2558d8d7ea0593e6877", "score": "0.60118574", "text": "func (o *GetIntelRuleFileNotFound) IsRedirect() bool {\n\treturn false\n}", "title": "" }, { "docid": "24e402c6d345793ca6dbd6a1476e152c", "score": "0.6010008", "text": "func (o *FabricGetOK) IsRedirect() bool {\n\treturn false\n}", "title": "" }, { "docid": "5c008116aa4344333d56afb5eee76006", "score": "0.60058683", "text": "func (o *MultiAdminVerifyRuleCreateDefault) IsRedirect() bool {\n\treturn o._statusCode/100 == 3\n}", "title": "" }, { "docid": "e0c3831841d6ebaab4f3b71ea44cc84b", "score": "0.60033864", "text": "func (o *SnapmirrorRelationshipGetDefault) IsRedirect() bool {\n\treturn o._statusCode/100 == 3\n}", "title": "" }, { "docid": "c547a96a3fa943e17fb4293dd2c70ebf", "score": "0.6002237", "text": "func (o *GetClusterInternalServerError) IsRedirect() bool {\n\treturn false\n}", "title": "" }, { "docid": "8672169cd1fe631f05691f6176e28852", "score": "0.6001728", "text": "func (o *AddServerNotFound) IsRedirect() bool {\n\treturn false\n}", "title": "" }, { "docid": "6905e97780c02a4ded640b7b31676851", "score": "0.59988916", "text": "func (o *GetAgreementNotFound) IsRedirect() bool {\n\treturn false\n}", "title": "" }, { "docid": "cef2130ec4ee4f65cf847c4a5eec55c0", "score": "0.5997885", "text": "func (o *CreateRepository15Unauthorized) IsRedirect() bool {\n\treturn false\n}", "title": "" }, { "docid": "0d9e3961b5cc7af5c351d1af234e952e", "score": "0.5994668", "text": "func (o *ApplicationSnapshotCreateDefault) IsRedirect() bool {\n\treturn o._statusCode/100 == 3\n}", "title": "" }, { "docid": "a2a4e37c889cd98f7a83c2b957087d4b", "score": "0.5991495", "text": "func (o *BackupsRestoreStatusInternalServerError) IsRedirect() bool {\n\treturn false\n}", "title": "" }, { "docid": "b94d230fc955a7f0a2c6a6bbc5b1af3f", "score": "0.5989309", "text": "func (o *CreateVersionStageDefault) IsRedirect() bool {\n\treturn o._statusCode/100 == 3\n}", "title": "" }, { "docid": "a4cd87af45425e77c7e34bd232b2ce2b", "score": "0.5987374", "text": "func (o *PcloudTenantsSshkeysGetInternalServerError) IsRedirect() bool {\n\treturn false\n}", "title": "" }, { "docid": "29e7fb0882dbb385da2c0627ed605fb0", "score": "0.5987156", "text": "func (o *GetBlockDeviceOK) IsRedirect() bool {\n\treturn false\n}", "title": "" }, { "docid": "09a1c8f98efd62f346f30814f69ff246", "score": "0.59842145", "text": "func (o *IscsiServiceCollectionGetOK) IsRedirect() bool {\n\treturn false\n}", "title": "" }, { "docid": "44ae29a7866074412c65141a9c914e19", "score": "0.59826446", "text": "func (o *GetDiscoverCloudAzureTenantIDsInternalServerError) IsRedirect() bool {\n\treturn false\n}", "title": "" }, { "docid": "e31222895fcce4afaf0e8e73471053d9", "score": "0.59825027", "text": "func (o *CreateCaseOK) IsRedirect() bool {\n\treturn false\n}", "title": "" }, { "docid": "2560b854d78fae5c5a8286b2dd61d3cc", "score": "0.5981172", "text": "func (o *FcInterfaceModifyDefault) IsRedirect() bool {\n\treturn o._statusCode/100 == 3\n}", "title": "" }, { "docid": "97c05ef52c82f1cb19b94f90d7592160", "score": "0.59701633", "text": "func (o *ArchiveRunDefault) IsRedirect() bool {\n\treturn o._statusCode/100 == 3\n}", "title": "" }, { "docid": "4bd8aaeff62a59a5927885a3ec4c96ca", "score": "0.59695464", "text": "func (o *CreateTokenNotFound) IsRedirect() bool {\n\treturn false\n}", "title": "" }, { "docid": "4915dd2104b416e9a3d56f443196ef1e", "score": "0.5969284", "text": "func (o *TransferOrganizationRunsDefault) IsRedirect() bool {\n\treturn o._statusCode/100 == 3\n}", "title": "" }, { "docid": "2762b9f711f3ed0b950caa374beec4b6", "score": "0.5967709", "text": "func (o *GetTerraformVersionUsingGETNotFound) IsRedirect() bool {\n\treturn false\n}", "title": "" }, { "docid": "d80fdba6317f24391677db1c0defe179", "score": "0.59670126", "text": "func (o *NdmpNodeModifyDefault) IsRedirect() bool {\n\treturn o._statusCode/100 == 3\n}", "title": "" }, { "docid": "dcf07f07032efd2e1f3f862653ad5f4d", "score": "0.5962294", "text": "func (o *SearchWorkspacesInternalServerError) IsRedirect() bool {\n\treturn false\n}", "title": "" }, { "docid": "e915b22ec0aad044dec1f4bee8d703b1", "score": "0.59619015", "text": "func (o *DeleteDeploymentStatelessResourceNotFound) IsRedirect() bool {\n\treturn false\n}", "title": "" }, { "docid": "0f2e767cc203f375235b3e201fd404f2", "score": "0.5961731", "text": "func (o *AutosupportModifyDefault) IsRedirect() bool {\n\treturn o._statusCode/100 == 3\n}", "title": "" }, { "docid": "42ada17e9f3790edbc6b03eeefe97c6e", "score": "0.59617114", "text": "func (o *ListTCPLbInternalServerError) IsRedirect() bool {\n\treturn false\n}", "title": "" }, { "docid": "e683baf390189cb6a4754a7d1816c052", "score": "0.59589547", "text": "func (o *ClusterNtpServersModifyDefault) IsRedirect() bool {\n\treturn o._statusCode/100 == 3\n}", "title": "" } ]
be5860949e81d565d28786a86514d79a
Default sets up the defaults for the object
[ { "docid": "3d0ecf73be4e83e1f85573603b4b6f67", "score": "0.0", "text": "func (m *AutoMsgCouponWatchHelper) Defaults(ver string) bool {\n\treturn false\n}", "title": "" } ]
[ { "docid": "561305d3206153b39256e2efc12faed0", "score": "0.7351115", "text": "func SetDefaults() {}", "title": "" }, { "docid": "7e21075a62f4bcfe1ba0a0a863d6a1f2", "score": "0.7123533", "text": "func (c *Config) Defaultize() {\n\tif c.Updater.Period == 0 {\n\t\tc.Updater.Period = defaultUpdatePeriod\n\t}\n\n\tif c.Backuper.Period == 0 {\n\t\tc.Backuper.Period = defaultBackupPeriod\n\t}\n\tif c.Backuper.MaxBackups == 0 {\n\t\tc.Backuper.MaxBackups = defaulMaxBackups\n\t}\n\n\tif c.Storage == nil {\n\t\tc.Storage = memory.New()\n\t}\n\n\tif c.Logger == nil {\n\t\tc.Logger = &logger.NilLogger{}\n\t}\n}", "title": "" }, { "docid": "6f7bd92fe923cb8355a2c42550cace0f", "score": "0.7107547", "text": "func InitDefaults() error { return c.InitDefaults() }", "title": "" }, { "docid": "54c8b1fe52f414fb42dd5640a215e869", "score": "0.6884407", "text": "func InitDefault(o interface{}) {\n\tt := reflect.TypeOf(o).Elem()\n\tv := reflect.ValueOf(o).Elem()\n\n\tfieldCount := t.NumField()\n\n\tfor i := 0; i < fieldCount; i++ {\n\t\tfield := t.Field(i)\n\n\t\tif v.Field(i).Kind() == reflect.Struct {\n\t\t\tInitDefault(v.Field(i).Addr().Interface())\n\t\t\tcontinue\n\t\t}\n\n\t\tif defaultValue, ok := field.Tag.Lookup(\"default\"); ok {\n\n\t\t\tswitch defaultValue {\n\t\t\tcase \"UNSETFLOAT\":\n\t\t\t\tv.Field(i).SetFloat(UNSETFLOAT)\n\t\t\tcase \"UNSETINT\":\n\t\t\t\tv.Field(i).SetInt(UNSETINT)\n\t\t\tcase \"-1\":\n\t\t\t\tv.Field(i).SetInt(-1)\n\t\t\tcase \"true\":\n\t\t\t\tv.Field(i).SetBool(true)\n\t\t\tdefault:\n\t\t\t\tpanic(\"Unknown defaultValue:\")\n\t\t\t}\n\t\t}\n\n\t}\n}", "title": "" }, { "docid": "b7d06099dfe34f8553f646682559f316", "score": "0.68806946", "text": "func (r *AWSClusterStaticIdentity) Default() {\n\tSetDefaults_Labels(&r.ObjectMeta)\n}", "title": "" }, { "docid": "3e872b0f19ed3776a32e89d1c2e5bfc0", "score": "0.68426067", "text": "func (s *CustomStrategy) SetDefaults() {}", "title": "" }, { "docid": "58fae1cacdfb67d6814d38f88a19a677", "score": "0.682395", "text": "func (ac *ArticleCreate) defaults() {\n\tif _, ok := ac.mutation.CreateTime(); !ok {\n\t\tv := article.DefaultCreateTime()\n\t\tac.mutation.SetCreateTime(v)\n\t}\n\tif _, ok := ac.mutation.UpdateTime(); !ok {\n\t\tv := article.DefaultUpdateTime()\n\t\tac.mutation.SetUpdateTime(v)\n\t}\n\tif _, ok := ac.mutation.IsDel(); !ok {\n\t\tv := article.DefaultIsDel\n\t\tac.mutation.SetIsDel(v)\n\t}\n\tif _, ok := ac.mutation.Desc(); !ok {\n\t\tv := article.DefaultDesc\n\t\tac.mutation.SetDesc(v)\n\t}\n\tif _, ok := ac.mutation.Content(); !ok {\n\t\tv := article.DefaultContent\n\t\tac.mutation.SetContent(v)\n\t}\n\tif _, ok := ac.mutation.IsAvailable(); !ok {\n\t\tv := article.DefaultIsAvailable\n\t\tac.mutation.SetIsAvailable(v)\n\t}\n}", "title": "" }, { "docid": "d3dbcaba406b39a88c084d0dcb95a8f0", "score": "0.68147206", "text": "func (sc *StudentCreate) defaults() {\n\tif _, ok := sc.mutation.ChineseScore(); !ok {\n\t\tv := student.DefaultChineseScore\n\t\tsc.mutation.SetChineseScore(v)\n\t}\n\tif _, ok := sc.mutation.MathScore(); !ok {\n\t\tv := student.DefaultMathScore\n\t\tsc.mutation.SetMathScore(v)\n\t}\n\tif _, ok := sc.mutation.EnglishScore(); !ok {\n\t\tv := student.DefaultEnglishScore\n\t\tsc.mutation.SetEnglishScore(v)\n\t}\n\tif _, ok := sc.mutation.TotalScore(); !ok {\n\t\tv := student.DefaultTotalScore\n\t\tsc.mutation.SetTotalScore(v)\n\t}\n\tif _, ok := sc.mutation.ClassRate(); !ok {\n\t\tv := student.DefaultClassRate\n\t\tsc.mutation.SetClassRate(v)\n\t}\n\tif _, ok := sc.mutation.SchoolRate(); !ok {\n\t\tv := student.DefaultSchoolRate\n\t\tsc.mutation.SetSchoolRate(v)\n\t}\n\tif _, ok := sc.mutation.StepRank(); !ok {\n\t\tv := student.DefaultStepRank\n\t\tsc.mutation.SetStepRank(v)\n\t}\n\tif _, ok := sc.mutation.IsDeleted(); !ok {\n\t\tv := student.DefaultIsDeleted\n\t\tsc.mutation.SetIsDeleted(v)\n\t}\n\tif _, ok := sc.mutation.DeleteTime(); !ok {\n\t\tv := student.DefaultDeleteTime\n\t\tsc.mutation.SetDeleteTime(v)\n\t}\n}", "title": "" }, { "docid": "4443862e0228d15bb560880dbf5b8642", "score": "0.681044", "text": "func (in *MongoDBAutoscaler) Default() {\n\tmongoLog.Info(\"defaulting\", \"name\", in.Name)\n\tin.setDefaults()\n}", "title": "" }, { "docid": "855c820e0b6f79e82037d8b9d76e4a9c", "score": "0.67458344", "text": "func (wc *WalletCreate) defaults() {\n\tif _, ok := wc.mutation.CreateTime(); !ok {\n\t\tv := wallet.DefaultCreateTime()\n\t\twc.mutation.SetCreateTime(v)\n\t}\n\tif _, ok := wc.mutation.UpdateTime(); !ok {\n\t\tv := wallet.DefaultUpdateTime()\n\t\twc.mutation.SetUpdateTime(v)\n\t}\n\tif _, ok := wc.mutation.Version(); !ok {\n\t\tv := wallet.DefaultVersion\n\t\twc.mutation.SetVersion(v)\n\t}\n\tif _, ok := wc.mutation.Lock(); !ok {\n\t\tv := wallet.DefaultLock\n\t\twc.mutation.SetLock(v)\n\t}\n\tif _, ok := wc.mutation.Balance(); !ok {\n\t\tv := wallet.DefaultBalance\n\t\twc.mutation.SetBalance(v)\n\t}\n}", "title": "" }, { "docid": "ddfc680da3aa5d70e1a3986dd76e42f7", "score": "0.6735134", "text": "func (ac *AgentCreate) defaults() {\n\tif _, ok := ac.mutation.CreatedAt(); !ok {\n\t\tv := agent.DefaultCreatedAt()\n\t\tac.mutation.SetCreatedAt(v)\n\t}\n\tif _, ok := ac.mutation.UpdatedAt(); !ok {\n\t\tv := agent.DefaultUpdatedAt()\n\t\tac.mutation.SetUpdatedAt(v)\n\t}\n\tif _, ok := ac.mutation.DeletedAt(); !ok {\n\t\tv := agent.DefaultDeletedAt()\n\t\tac.mutation.SetDeletedAt(v)\n\t}\n\tif _, ok := ac.mutation.LastContact(); !ok {\n\t\tv := agent.DefaultLastContact()\n\t\tac.mutation.SetLastContact(v)\n\t}\n}", "title": "" }, { "docid": "c0be902afe10797865b02af817cbf007", "score": "0.67329353", "text": "func (vc *VeterinarianCreate) defaults() {\n\tif _, ok := vc.mutation.CreatedAt(); !ok {\n\t\tv := veterinarian.DefaultCreatedAt()\n\t\tvc.mutation.SetCreatedAt(v)\n\t}\n\tif _, ok := vc.mutation.UpdatedAt(); !ok {\n\t\tv := veterinarian.DefaultUpdatedAt()\n\t\tvc.mutation.SetUpdatedAt(v)\n\t}\n\tif _, ok := vc.mutation.ID(); !ok {\n\t\tv := veterinarian.DefaultID()\n\t\tvc.mutation.SetID(v)\n\t}\n}", "title": "" }, { "docid": "fcc60603507dc6f8db42124de50fce40", "score": "0.66813946", "text": "func (this *Help) Default(value any) (rv *Help) {\n\t*this = append(*this, yaml.MapItem{Key: \"default\", Value: value})\n\treturn this\n}", "title": "" }, { "docid": "eeb3c6fe04df2840dc7ca475ab9bb13d", "score": "0.66763246", "text": "func (r *AWSClusterControllerIdentity) Default() {\n\tSetDefaults_Labels(&r.ObjectMeta)\n}", "title": "" }, { "docid": "ca5826791b15610555fc09f859f3cf58", "score": "0.6668857", "text": "func setDefaults() {\n\t// api\n\tapi.Name = OwncloudNamespace + \"api\"\n\tapi.Namespace = OwncloudNamespace + \"api\"\n\tapi.HeaderPrefix = \"X-Micro-Owncloud-\"\n\n\t// web\n\tweb.Name = OwncloudNamespace + \"web\"\n\tweb.Namespace = OwncloudNamespace + \"web\"\n\n\t// registry\n\tregistry.Name = OwncloudNamespace + \"registry\"\n}", "title": "" }, { "docid": "00b5c797d36b808a1a8bb263ffc20b7f", "score": "0.66669065", "text": "func (stc *ServiceTypeCreate) defaults() {\n\tif _, ok := stc.mutation.CreateTime(); !ok {\n\t\tv := servicetype.DefaultCreateTime()\n\t\tstc.mutation.SetCreateTime(v)\n\t}\n\tif _, ok := stc.mutation.UpdateTime(); !ok {\n\t\tv := servicetype.DefaultUpdateTime()\n\t\tstc.mutation.SetUpdateTime(v)\n\t}\n\tif _, ok := stc.mutation.HasCustomer(); !ok {\n\t\tv := servicetype.DefaultHasCustomer\n\t\tstc.mutation.SetHasCustomer(v)\n\t}\n\tif _, ok := stc.mutation.IsDeleted(); !ok {\n\t\tv := servicetype.DefaultIsDeleted\n\t\tstc.mutation.SetIsDeleted(v)\n\t}\n\tif _, ok := stc.mutation.DiscoveryMethod(); !ok {\n\t\tv := servicetype.DefaultDiscoveryMethod\n\t\tstc.mutation.SetDiscoveryMethod(v)\n\t}\n}", "title": "" }, { "docid": "6c264b442f37521961a5111b18c7515b", "score": "0.66524595", "text": "func Default(def interface{}) {\n\tdsl.Default(def)\n}", "title": "" }, { "docid": "25231fc57febd2f3b0f5673de5d544b5", "score": "0.6649281", "text": "func (kdsc *K8sDaemonSetCreate) defaults() {\n\tif _, ok := kdsc.mutation.CreatedAt(); !ok {\n\t\tv := k8sdaemonset.DefaultCreatedAt()\n\t\tkdsc.mutation.SetCreatedAt(v)\n\t}\n\tif _, ok := kdsc.mutation.UpdatedAt(); !ok {\n\t\tv := k8sdaemonset.DefaultUpdatedAt()\n\t\tkdsc.mutation.SetUpdatedAt(v)\n\t}\n\tif _, ok := kdsc.mutation.DeletedAt(); !ok {\n\t\tv := k8sdaemonset.DefaultDeletedAt()\n\t\tkdsc.mutation.SetDeletedAt(v)\n\t}\n}", "title": "" }, { "docid": "eebede46bf235e7ad0d8a699e24306d6", "score": "0.66402286", "text": "func (tdc *TradeDateCreate) defaults() {\n\tif _, ok := tdc.mutation.CreateAt(); !ok {\n\t\tv := tradedate.DefaultCreateAt\n\t\ttdc.mutation.SetCreateAt(v)\n\t}\n\tif _, ok := tdc.mutation.UpdateAt(); !ok {\n\t\tv := tradedate.DefaultUpdateAt\n\t\ttdc.mutation.SetUpdateAt(v)\n\t}\n\tif _, ok := tdc.mutation.XueqiuCommentCount(); !ok {\n\t\tv := tradedate.DefaultXueqiuCommentCount\n\t\ttdc.mutation.SetXueqiuCommentCount(v)\n\t}\n\tif _, ok := tdc.mutation.Bull(); !ok {\n\t\tv := tradedate.DefaultBull\n\t\ttdc.mutation.SetBull(v)\n\t}\n\tif _, ok := tdc.mutation.Short(); !ok {\n\t\tv := tradedate.DefaultShort\n\t\ttdc.mutation.SetShort(v)\n\t}\n}", "title": "" }, { "docid": "6898ef3bd82c06ad46b3ff3372b0c3c2", "score": "0.6639129", "text": "func (ecc *EquipmentCategoryCreate) defaults() {\n\tif _, ok := ecc.mutation.CreateTime(); !ok {\n\t\tv := equipmentcategory.DefaultCreateTime()\n\t\tecc.mutation.SetCreateTime(v)\n\t}\n\tif _, ok := ecc.mutation.UpdateTime(); !ok {\n\t\tv := equipmentcategory.DefaultUpdateTime()\n\t\tecc.mutation.SetUpdateTime(v)\n\t}\n}", "title": "" }, { "docid": "b4ea521f58ba80408463ae4c9d002ce5", "score": "0.66340536", "text": "func (r *Machine) Default() {\n\tmachinelog.Info(\"default\", \"name\", r.Name)\n\n\tif r.Spec.DockerPort == 0 {\n\t\tif r.Spec.DockerTLS {\n\t\t\tr.Spec.DockerPort = 2376\n\t\t} else {\n\t\t\tr.Spec.DockerPort = 2375\n\t\t}\n\t}\n\n\tif r.Spec.Reserve == nil {\n\t\tr.Spec.Reserve = new(ReserveResources)\n\t}\n\n\tif r.Spec.Reserve.Cores == 0 {\n\t\tr.Spec.Reserve.Cores = 1\n\t}\n\n\tif r.Spec.Reserve.Memory == \"\" {\n\t\tr.Spec.Reserve.Memory = util.Size(1 * units.GiB)\n\t}\n\n\tif r.Spec.DockerVersion == \"\" {\n\t\tr.Spec.DockerVersion = \"1.25\"\n\t}\n\t// TODO(user): fill in your defaulting logic.\n}", "title": "" }, { "docid": "d8e149a8c2a87c710462f6954a78edc7", "score": "0.6628738", "text": "func (u *User) setDefault() {\n\tu.CreatedOn = Now().UTC()\n\tu.UpdatedOn = Now().UTC()\n}", "title": "" }, { "docid": "e0d0cf89086c9e4191c3bd59f05e9413", "score": "0.6598411", "text": "func (r *Peer) Default() {\n\tpeerlog.Info(\"default\", \"name\", r.Name)\n\n\tif r.Spec.Routing == \"\" {\n\t\tr.Spec.Routing = DefaultRoutingMode\n\t}\n\n\tif r.Spec.APIPort == 0 {\n\t\tr.Spec.APIPort = DefaultAPIPort\n\t}\n\n\tif r.Spec.APIHost == \"\" {\n\t\tr.Spec.APIHost = DefaultHost\n\t}\n\n\tif r.Spec.GatewayPort == 0 {\n\t\tr.Spec.GatewayPort = DefaultGatewayPort\n\t}\n\n\tif r.Spec.GatewayHost == \"\" {\n\t\tr.Spec.GatewayHost = DefaultHost\n\t}\n\n\tif len(r.Spec.InitProfiles) == 0 {\n\t\tr.Spec.InitProfiles = []Profile{DefaultDatastoreProfile}\n\t}\n\n\tr.DefaultPeerResources()\n\n}", "title": "" }, { "docid": "2daeafd166debd0ca21ee3306ed01e43", "score": "0.6598166", "text": "func setDefault(v interface{}, d ...interface{}) {\n\tvar rc reflect.Value\n\tvar rt reflect.Type\n\t// switch v.(type) {\n\t// case reflect.Value:\n\t// default:\n\trc = reflect.ValueOf(v)\n\trt = reflect.TypeOf(v)\n\t// }\n\tif rc.Kind() == reflect.Ptr {\n\t\trc = rc.Elem()\n\t\trt = rt.Elem()\n\t}\n\tvar fieldsCount int = 0\n\n\tif rc.IsValid() {\n\t\tfieldsCount = rc.NumField()\n\t}\n\tfor r := 0; r < fieldsCount; r++ {\n\t\tswitch rc.Field(r).Kind() {\n\t\tcase reflect.String:\n\t\t\tif b, f := rt.Field(r).Tag.Lookup(\"default\"); f && rc.Field(r).IsZero() {\n\t\t\t\trc.Field(r).SetString(b)\n\t\t\t}\n\t\tcase reflect.Interface:\n\t\t\t// include nil value\n\t\t\t// fmt.Printf(\"%v\", rc.Field(r).Elem())\n\t\tcase reflect.Ptr:\n\t\t\tif b, f := rt.Field(r).Tag.Lookup(\"default\"); f && rc.Field(r).Type().String() == \"*bool\" {\n\t\t\t\tif fv, fe := strconv.ParseBool(b); fe == nil && rc.Field(r).IsNil() {\n\t\t\t\t\trc.Field(r).Set(reflect.ValueOf(&fv))\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\tsetDefault(rc.Field(r).Interface())\n\t\t\t}\n\t\tcase reflect.Struct:\n\t\t\tsetDefault(rc.Field(r).Interface())\n\t\tcase reflect.Float32:\n\t\t\tif b, f := rt.Field(r).Tag.Lookup(\"default\"); f && rc.Field(r).IsZero() {\n\t\t\t\tif fv, fe := strconv.ParseFloat(b, 32); fe == nil {\n\t\t\t\t\trc.Field(r).SetFloat(fv)\n\t\t\t\t}\n\t\t\t}\n\t\tcase reflect.Float64:\n\t\t\tif b, f := rt.Field(r).Tag.Lookup(\"default\"); f && rc.Field(r).IsZero() {\n\t\t\t\tif fv, fe := strconv.ParseFloat(b, 64); fe == nil {\n\t\t\t\t\trc.Field(r).SetFloat(fv)\n\t\t\t\t}\n\t\t\t}\n\t\tcase reflect.Uint32:\n\t\t\tif b, f := rt.Field(r).Tag.Lookup(\"default\"); f && rc.Field(r).IsZero() {\n\t\t\t\tif fv, fe := strconv.ParseUint(b, 10, 32); fe == nil {\n\t\t\t\t\trc.Field(r).SetUint(fv)\n\t\t\t\t}\n\t\t\t}\n\t\tcase reflect.Uint16:\n\t\t\tif b, f := rt.Field(r).Tag.Lookup(\"default\"); f && rc.Field(r).IsZero() {\n\t\t\t\tif fv, fe := strconv.ParseUint(b, 10, 16); fe == nil {\n\t\t\t\t\trc.Field(r).SetUint(fv)\n\t\t\t\t}\n\t\t\t}\n\t\tcase reflect.Int:\n\t\t\tif b, f := rt.Field(r).Tag.Lookup(\"default\"); f && rc.Field(r).IsZero() {\n\t\t\t\tif fv, fe := strconv.ParseInt(b, 10, 0); fe == nil {\n\t\t\t\t\trc.Field(r).SetInt(fv)\n\t\t\t\t}\n\t\t\t}\n\t\tcase reflect.Int32:\n\t\t\tif b, f := rt.Field(r).Tag.Lookup(\"default\"); f && rc.Field(r).IsZero() {\n\t\t\t\tif fv, fe := strconv.ParseInt(b, 10, 32); fe == nil {\n\t\t\t\t\trc.Field(r).SetInt(fv)\n\t\t\t\t}\n\t\t\t}\n\t\t// ignore bool value, due to false could been re-write to true\n\t\t// case reflect.Bool:\n\t\t// \tif b, f := rt.Field(r).Tag.Lookup(\"default\"); f && rc.Field(r).IsZero() {\n\t\t// \t\tif fv, fe := strconv.ParseBool(b); fe == nil {\n\t\t// \t\t\trc.Field(r).SetBool(fv)\n\t\t// \t\t}\n\t\t// \t}\n\t\tcase reflect.Array, reflect.Slice:\n\t\t\tfor ari := 0; ari < rc.Field(r).Len(); ari++ {\n\t\t\t\tsetDefault(rc.Field(r).Index(ari).Interface())\n\t\t\t}\n\t\t}\n\t}\n}", "title": "" }, { "docid": "6bcf385a1b4efdce5e6e886a27fc5182", "score": "0.6595256", "text": "func (gc *GroupCreate) defaults() {\n\tif _, ok := gc.mutation.Active(); !ok {\n\t\tv := group.DefaultActive\n\t\tgc.mutation.SetActive(v)\n\t}\n\tif _, ok := gc.mutation.MaxUsers(); !ok {\n\t\tv := group.DefaultMaxUsers\n\t\tgc.mutation.SetMaxUsers(v)\n\t}\n}", "title": "" }, { "docid": "2986f52c78215d95f2f1e3d0c3fcc15d", "score": "0.65830487", "text": "func (d *Descriptor) Default() {\n}", "title": "" }, { "docid": "6d0076bb0d8e6fa39687ada4f71079e6", "score": "0.6553576", "text": "func (s *ChaosSpec) SetDefaults() {\n\tif s.GetInterval() == 0 {\n\t\ts.Interval = util.NewType[time.Duration](time.Minute)\n\t}\n\tif s.GetKillPodProbability() == 0 {\n\t\ts.KillPodProbability = NewPercent(50)\n\t}\n}", "title": "" }, { "docid": "42bbb26541a2026668aaa3c65ff1170c", "score": "0.65500176", "text": "func (c *Control) Defaults() *Control {\n\tc.NoTiming = false // Implied.\n\tc.Verbosity = DefaultVerbosity\n\tc.CheckForFactExpiration = true\n\tc.MaxFacts = 1000\n\tc.BindingsWarningLimit = 20\n\tc.UseDefaultVariableValue = true\n\tc.DefaultVariableValue = \"undefined\"\n\treturn c\n}", "title": "" }, { "docid": "dcab3d23ee5c34f8d68de90a5b5f089d", "score": "0.65445083", "text": "func (c *Config) defaults() {\n\tif c.Seed == 0 {\n\t\tc.Seed = rng.Int()\n\t}\n\tif c.Binary == \"\" {\n\t\tc.Binary = \"pokemon-showdown\"\n\t}\n\tif c.Format == \"\" {\n\t\tc.Format = \"[Gen 8] Anything Goes\"\n\t}\n}", "title": "" }, { "docid": "c32d5531acf9e20740cf1f183865a6c8", "score": "0.6537422", "text": "func (w *BareMetalHardwareWebhook) Default(obj runtime.Object) {\n\tr := obj.(*baremetalv1alpha1.BareMetalHardware)\n\n\tbaremetalhardwarelog.Info(\"default\", \"name\", r.Name)\n\n\tif r.DeletionTimestamp.IsZero() {\n\t\t// add the finalizer\n\t\tif baremetalapi.HasFinalizer(r, baremetalv1alpha1.BareMetalHardwareFinalizer) == false {\n\t\t\tr.Finalizers = append(r.Finalizers, baremetalv1alpha1.BareMetalHardwareFinalizer)\n\t\t}\n\n\t\t// set the default nic bond mode\n\t\tfor _, nic := range r.Spec.NICS {\n\t\t\tif nic.Bond != nil {\n\t\t\t\tif len(nic.Bond.Mode) == 0 {\n\t\t\t\t\tnic.Bond.Mode = baremetalv1alpha1.BondModeBalanceRR\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n}", "title": "" }, { "docid": "26a7528d8314aba37c687bed02e44695", "score": "0.65198696", "text": "func (c *Config) Default() {\n\tif c.Address == \"\" && len(c.Addresses) == 0 {\n\t\tc.Address = DefaultRedisAddress\n\t\tc.Addresses = []string{DefaultRedisAddress}\n\t}\n\n\tif c.MaxRetries <= 0 {\n\t\tc.MaxRetries = DefaultMaxRetries\n\t}\n\n\tif c.PoolSize <= 0 {\n\t\tc.PoolSize = DefaultPoolSize\n\t}\n\n\tif c.DB <= 0 {\n\t\tc.DB = 0\n\t}\n\n\tif c.RetryAfter <= 0 {\n\t\tc.RetryAfter = DefaultRetryAfter\n\t}\n}", "title": "" }, { "docid": "d289c0b662513619d2279ba6b4bcab22", "score": "0.6510993", "text": "func (dc *DecisionCreate) defaults() {\n\tif _, ok := dc.mutation.CreatedAt(); !ok {\n\t\tv := decision.DefaultCreatedAt()\n\t\tdc.mutation.SetCreatedAt(v)\n\t}\n\tif _, ok := dc.mutation.UpdatedAt(); !ok {\n\t\tv := decision.DefaultUpdatedAt()\n\t\tdc.mutation.SetUpdatedAt(v)\n\t}\n\tif _, ok := dc.mutation.Simulated(); !ok {\n\t\tv := decision.DefaultSimulated\n\t\tdc.mutation.SetSimulated(v)\n\t}\n}", "title": "" }, { "docid": "d48dbf43ac4a5c2fff3b48f150e51611", "score": "0.65074", "text": "func (pc *PostCreate) defaults() error {\n\tif _, ok := pc.mutation.CreateTime(); !ok {\n\t\tif post.DefaultCreateTime == nil {\n\t\t\treturn fmt.Errorf(\"ent: uninitialized post.DefaultCreateTime (forgotten import ent/runtime?)\")\n\t\t}\n\t\tv := post.DefaultCreateTime()\n\t\tpc.mutation.SetCreateTime(v)\n\t}\n\tif _, ok := pc.mutation.UpdateTime(); !ok {\n\t\tif post.DefaultUpdateTime == nil {\n\t\t\treturn fmt.Errorf(\"ent: uninitialized post.DefaultUpdateTime (forgotten import ent/runtime?)\")\n\t\t}\n\t\tv := post.DefaultUpdateTime()\n\t\tpc.mutation.SetUpdateTime(v)\n\t}\n\tif _, ok := pc.mutation.PublishedAt(); !ok {\n\t\tif post.DefaultPublishedAt == nil {\n\t\t\treturn fmt.Errorf(\"ent: uninitialized post.DefaultPublishedAt (forgotten import ent/runtime?)\")\n\t\t}\n\t\tv := post.DefaultPublishedAt()\n\t\tpc.mutation.SetPublishedAt(v)\n\t}\n\tif _, ok := pc.mutation.ViewCount(); !ok {\n\t\tv := post.DefaultViewCount\n\t\tpc.mutation.SetViewCount(v)\n\t}\n\tif _, ok := pc.mutation.Public(); !ok {\n\t\tv := post.DefaultPublic\n\t\tpc.mutation.SetPublic(v)\n\t}\n\treturn nil\n}", "title": "" }, { "docid": "d4e21edbe4af674ec9b89f2f1ec2f506", "score": "0.6501344", "text": "func (o *GetBulletinBoardParams) SetDefaults() {\n\t// no default values defined for this parameter\n}", "title": "" }, { "docid": "d84d092b6401892dd3cdf5f87fb24e09", "score": "0.64975524", "text": "func (cc *ContainerCreate) defaults() {\n\tif _, ok := cc.mutation.CreatedAt(); !ok {\n\t\tv := container.DefaultCreatedAt()\n\t\tcc.mutation.SetCreatedAt(v)\n\t}\n\tif _, ok := cc.mutation.UpdatedAt(); !ok {\n\t\tv := container.DefaultUpdatedAt()\n\t\tcc.mutation.SetUpdatedAt(v)\n\t}\n\tif _, ok := cc.mutation.DeletedAt(); !ok {\n\t\tv := container.DefaultDeletedAt()\n\t\tcc.mutation.SetDeletedAt(v)\n\t}\n}", "title": "" }, { "docid": "bfd04dc811cd778a706f243a29d37e5b", "score": "0.64913815", "text": "func (cfg *Config) Default() error {\n\tcfg.MetricTTL = DefaultMetricTTL\n\tcfg.Tags = DefaultTags\n\treturn nil\n}", "title": "" }, { "docid": "ac8e35bdd32beb7958fc367c4221efa9", "score": "0.64906883", "text": "func (n *Node) Default() {\n\tnodelog.Info(\"default\", \"name\", n.Name)\n\n\tnerpa := n.Spec.Network == NerpaNetwork\n\tmainnet := n.Spec.Network == MainNetwork\n\tcalibration := n.Spec.Network == CalibrationNetwork\n\n\tif n.Spec.API {\n\t\tif n.Spec.APIPort == 0 {\n\t\t\tn.Spec.APIPort = DefaultAPIPort\n\t\t}\n\t\tif n.Spec.APIHost == \"\" {\n\t\t\tn.Spec.APIHost = DefaultHost\n\t\t}\n\t\tif n.Spec.APIRequestTimeout == 0 {\n\t\t\tn.Spec.APIRequestTimeout = DefaultAPIRequestTimeout\n\t\t}\n\t}\n\n\tif n.Spec.P2PPort == 0 {\n\t\tn.Spec.P2PPort = DefaultP2PPort\n\t}\n\tif n.Spec.P2PHost == \"\" {\n\t\tn.Spec.P2PHost = DefaultHost\n\t}\n\n\tif n.Spec.Resources.CPU == \"\" {\n\t\tif nerpa {\n\t\t\tn.Spec.CPU = DefaultNerpaNodeCPURequest\n\t\t}\n\t\tif mainnet {\n\t\t\tn.Spec.CPU = DefaultMainnetNodeCPURequest\n\t\t}\n\t\tif calibration {\n\t\t\tn.Spec.CPU = DefaultCalibrationNodeCPURequest\n\t\t}\n\t}\n\n\tif n.Spec.CPULimit == \"\" {\n\t\tif nerpa {\n\t\t\tn.Spec.CPULimit = DefaultNerpaNodeCPULimit\n\t\t}\n\t\tif mainnet {\n\t\t\tn.Spec.CPULimit = DefaultMainnetNodeCPULimit\n\t\t}\n\t\tif calibration {\n\t\t\tn.Spec.CPULimit = DefaultCalibrationNodeCPULimit\n\t\t}\n\t}\n\n\tif n.Spec.Memory == \"\" {\n\t\tif nerpa {\n\t\t\tn.Spec.Memory = DefaultNerpaNodeMemoryRequest\n\t\t}\n\t\tif mainnet {\n\t\t\tn.Spec.Memory = DefaultMainnetNodeMemoryRequest\n\t\t}\n\t\tif calibration {\n\t\t\tn.Spec.Memory = DefaultCalibrationNodeMemoryRequest\n\t\t}\n\t}\n\n\tif n.Spec.MemoryLimit == \"\" {\n\t\tif nerpa {\n\t\t\tn.Spec.MemoryLimit = DefaultNerpaNodeMemoryLimit\n\t\t}\n\t\tif mainnet {\n\t\t\tn.Spec.MemoryLimit = DefaultMainnetNodeMemoryLimit\n\t\t}\n\t\tif calibration {\n\t\t\tn.Spec.MemoryLimit = DefaultCalibrationNodeMemoryLimit\n\t\t}\n\t}\n\n\tif n.Spec.Storage == \"\" {\n\t\tif nerpa {\n\t\t\tn.Spec.Storage = DefaultNerpaNodeStorageRequest\n\t\t}\n\t\tif mainnet {\n\t\t\tn.Spec.Storage = DefaultMainnetNodeStorageRequest\n\t\t}\n\t\tif calibration {\n\t\t\tn.Spec.Storage = DefaultCalibrationNodeStorageRequest\n\t\t}\n\t}\n\n}", "title": "" }, { "docid": "0c610400e3b07fa9996062caf29f0398", "score": "0.6487977", "text": "func Default(c *gin.Context) Vars {\n\treturn New(\n\t\tKeys(c),\n\t\tParams(c),\n\t)\n}", "title": "" }, { "docid": "5bef577bb803af88b7f8b537f6136d2d", "score": "0.6464738", "text": "func (this *Help) SetDefault(value any) (rv *Help) { return this.Default(value) }", "title": "" }, { "docid": "c7fe2f1bae87f2b4e2595c96b332c18b", "score": "0.64542514", "text": "func (o *PostPunchInParams) SetDefaults() {\n\t// no default values defined for this parameter\n}", "title": "" }, { "docid": "840345dcf7c9d06838d2a19829991b46", "score": "0.64513946", "text": "func (base base) setDefaults(obj deploy.KubeObject) {\n\tsetMetaDefaults(obj, base.defaults)\n}", "title": "" }, { "docid": "74fa3f1b0170bf9e8604a13457c31139", "score": "0.6449621", "text": "func (ic *ItemCreate) defaults() {\n\tif _, ok := ic.mutation.Quantity(); !ok {\n\t\tv := item.DefaultQuantity\n\t\tic.mutation.SetQuantity(v)\n\t}\n\tif _, ok := ic.mutation.CategoryID(); !ok {\n\t\tv := item.DefaultCategoryID\n\t\tic.mutation.SetCategoryID(v)\n\t}\n\tif _, ok := ic.mutation.Complete(); !ok {\n\t\tv := item.DefaultComplete\n\t\tic.mutation.SetComplete(v)\n\t}\n}", "title": "" }, { "docid": "5365fec0845403aea0091a2b86dc2dca", "score": "0.6447632", "text": "func (s *RocksDBSpec) SetDefaults() {\n\t// Nothing needed\n}", "title": "" }, { "docid": "9a016689b4714b136de4273004b83a8e", "score": "0.642444", "text": "func (s *ExternalAccessSpec) SetDefaults() {\n}", "title": "" }, { "docid": "fe26d64a89e2590095839d39755993fe", "score": "0.64186925", "text": "func (cluster *ManagedCluster) Default() {\n\tcluster.defaultImpl()\n\tvar temp any = cluster\n\tif runtimeDefaulter, ok := temp.(genruntime.Defaulter); ok {\n\t\truntimeDefaulter.CustomDefault()\n\t}\n}", "title": "" }, { "docid": "4625825891887485357c1bf5648dfd65", "score": "0.64170915", "text": "func (group *PrivateEndpointsPrivateDnsZoneGroup) Default() {\n\tgroup.defaultImpl()\n\tvar temp any = group\n\tif runtimeDefaulter, ok := temp.(genruntime.Defaulter); ok {\n\t\truntimeDefaulter.CustomDefault()\n\t}\n}", "title": "" }, { "docid": "aee3b3b31b5fce42e836f64e642b3532", "score": "0.6413478", "text": "func (kdc *K8sDeploymentCreate) defaults() {\n\tif _, ok := kdc.mutation.CreatedAt(); !ok {\n\t\tv := k8sdeployment.DefaultCreatedAt()\n\t\tkdc.mutation.SetCreatedAt(v)\n\t}\n\tif _, ok := kdc.mutation.UpdatedAt(); !ok {\n\t\tv := k8sdeployment.DefaultUpdatedAt()\n\t\tkdc.mutation.SetUpdatedAt(v)\n\t}\n\tif _, ok := kdc.mutation.DeletedAt(); !ok {\n\t\tv := k8sdeployment.DefaultDeletedAt()\n\t\tkdc.mutation.SetDeletedAt(v)\n\t}\n}", "title": "" }, { "docid": "cd5719ce47de9faa3d6cab6737669325", "score": "0.6411105", "text": "func (omd *OperatorManagedDatabase) SetDefaults() {\n\tif omd.Type == \"\" {\n\t\tomd.Type = DefaultMattermostDatabaseType\n\t}\n\tif omd.StorageSize == \"\" {\n\t\tomd.StorageSize = DefaultStorageSize\n\t}\n\tif omd.Version == \"\" {\n\t\tomd.Version = DefaultDatabaseVersion\n\t}\n}", "title": "" }, { "docid": "2885c9d6eef2f06c91ada3402d9346c6", "score": "0.6407053", "text": "func ExampleNewDefault() {\n\tdefer destroyBSyslog()\n\n\t// a \"loggable\" struct\n\tts := testStruct{\"hidden\", \"public\"}\n\n\t// default values\n\tlogger := New(\"syslog\", \"\", \"\", \"test app new\")\n\tlogger.Info(\"Test logging message ** to SYSLOG using default\", Map{\"testStruct\": &ts})\n}", "title": "" }, { "docid": "e79d7d21af1b38bc66b4bf84029c3574", "score": "0.63982284", "text": "func (ec *EthnicityCreate) defaults() error {\n\tif _, ok := ec.mutation.CreatedAt(); !ok {\n\t\tif ethnicity.DefaultCreatedAt == nil {\n\t\t\treturn fmt.Errorf(\"ent: uninitialized ethnicity.DefaultCreatedAt (forgotten import ent/runtime?)\")\n\t\t}\n\t\tv := ethnicity.DefaultCreatedAt()\n\t\tec.mutation.SetCreatedAt(v)\n\t}\n\tif _, ok := ec.mutation.UpdatedAt(); !ok {\n\t\tif ethnicity.DefaultUpdatedAt == nil {\n\t\t\treturn fmt.Errorf(\"ent: uninitialized ethnicity.DefaultUpdatedAt (forgotten import ent/runtime?)\")\n\t\t}\n\t\tv := ethnicity.DefaultUpdatedAt()\n\t\tec.mutation.SetUpdatedAt(v)\n\t}\n\treturn nil\n}", "title": "" }, { "docid": "12cf45505db863d025f7d3cdb2148052", "score": "0.63782245", "text": "func (r *UI) Default() {\n\tuilog.Info(\"default\", \"name\", r.Name)\n\n\tif r.Spec.Image == \"\" {\n\t\tr.Spec.Image = fmt.Sprintf(\"apache/skywalking-ui:%s\", r.Spec.Version)\n\t}\n\n\tr.Spec.Service.Template.Default()\n\tif r.Spec.OAPServerAddress == \"\" {\n\t\tr.Spec.OAPServerAddress = fmt.Sprintf(\"http://%s-oap.%s:12800\", r.Name, r.Namespace)\n\t}\n}", "title": "" }, { "docid": "a15c748992b7a1cbb893f982f38f455c", "score": "0.63756526", "text": "func (obj *Drifter) InitDefaults(position mgl32.Vec3) {\n\tobj.Position = position\n\tobj.Speed = 0.5\n\tobj.Drag = 0.5\n\tobj.rotationSpeed = 0.001\n\tobj.rotation = mgl32.Vec2{math.Pi / 2, math.Pi * 2}\n\t//\tobj.Facing = position.Add(mgl32.Vec3{0, 0, 1})\n\tobj.Tick()\n}", "title": "" }, { "docid": "e2f388268e33b6faef5d31a284e821ee", "score": "0.6374461", "text": "func (obj *RabbitUser) Default() {\n\trabbitUserLog.Info(\"default\", \"name\", obj.Name, \"namespace\", obj.Namespace)\n\n\tif obj.Spec.Username == \"\" {\n\t\tobj.Spec.Username = obj.Name\n\t}\n}", "title": "" }, { "docid": "854ab92a35abd1aacb1ec652b2c87cb5", "score": "0.63731325", "text": "func (self *RESTConf) Default() {\n\terr := self.Validate()\n\tif err != nil {\n\t\terrs := err.(validator.ErrorMap)\n\t\tfor fieldName := range errs {\n\t\t\tif ok, _ := defaults.HasDefault(self, fieldName); ok {\n\t\t\t\tglog.Infof(\"Using default for RESTConf.%s\", fieldName)\n\t\t\t\tdefaults.SetDefault(self, fieldName)\n\t\t\t}\n\t\t}\n\t}\n}", "title": "" }, { "docid": "8b37667f10791e8633c76312c0afc01c", "score": "0.63730514", "text": "func (c *Config) setDefaults() {\n\tc.Service.setDefaults()\n\tc.Watson.setDefaults()\n}", "title": "" }, { "docid": "137a1d88cf2b0c3c904cc2a1d5dded38", "score": "0.63711536", "text": "func (gc *GroupsCreate) defaults() {\n\tif _, ok := gc.mutation.GIsIntOrg(); !ok {\n\t\tv := groups.DefaultGIsIntOrg\n\t\tgc.mutation.SetGIsIntOrg(v)\n\t}\n\tif _, ok := gc.mutation.GIsSuperAdmin(); !ok {\n\t\tv := groups.DefaultGIsSuperAdmin\n\t\tgc.mutation.SetGIsSuperAdmin(v)\n\t}\n\tif _, ok := gc.mutation.GCreatedAt(); !ok {\n\t\tv := groups.DefaultGCreatedAt()\n\t\tgc.mutation.SetGCreatedAt(v)\n\t}\n}", "title": "" }, { "docid": "3769b4789d844e955b49cbf341e8b3c3", "score": "0.63636345", "text": "func (ec *EntryCreate) defaults() {\n\tif _, ok := ec.mutation.Content(); !ok {\n\t\tv := entry.DefaultContent\n\t\tec.mutation.SetContent(v)\n\t}\n\tif _, ok := ec.mutation.CreatedAt(); !ok {\n\t\tv := entry.DefaultCreatedAt()\n\t\tec.mutation.SetCreatedAt(v)\n\t}\n}", "title": "" }, { "docid": "1c30897a4544d300a325e88e7bd843fe", "score": "0.63623273", "text": "func (t Term) Default(args ...interface{}) Term {\n\treturn constructMethodTerm(t, \"Default\", p.Term_DEFAULT, args, map[string]interface{}{})\n}", "title": "" }, { "docid": "e08f63c644748410ce6fa1dd61706bcc", "score": "0.63547486", "text": "func setDefaults() {\n\tviper.SetDefault(\"Address\", \"127.0.0.1\")\n\tviper.SetDefault(\"Port\", \"8000\")\n\tviper.SetDefault(\"Prefix\", \"\")\n\tviper.SetDefault(\"Dir\", \"/tmp\")\n\tviper.SetDefault(\"Users\", nil)\n\tviper.SetDefault(\"TLS\", nil)\n\tviper.SetDefault(\"Realm\", \"dave\")\n\tviper.SetDefault(\"Log.Error\", true)\n\tviper.SetDefault(\"Log.Create\", false)\n\tviper.SetDefault(\"Log.Read\", false)\n\tviper.SetDefault(\"Log.Update\", false)\n\tviper.SetDefault(\"Log.Delete\", false)\n\tviper.SetDefault(\"Cors.Credentials\", false)\n}", "title": "" }, { "docid": "0344b109a4b60462d616012646e726d8", "score": "0.6346864", "text": "func Default() Root {\n\treturn Root{\n\t\tMainSettings: mainSettings{\n\t\t\tServerFile: \"minecraft_server.jar\",\n\t\t\tServerName: \"Server 1\",\n\t\t\tMaxLogs: 10,\n\t\t\tMaxAge: 7,\n\t\t},\n\n\t\tJavaSettings: javaSettings{\n\t\t\tStartingMemory: \"2G\",\n\t\t\tMaxMemory: \"2G\",\n\t\t\tFlags: &[]string{},\n\t\t},\n\n\t\tServerSettings: serverSettings{\n\t\t\tFlags: &[]string{\"nogui\"},\n\t\t},\n\n\t\tBackupSettings: backupSettings{\n\t\t\tBackupDir: \"backups\",\n\t\t\tExcludedPaths: &[]string{},\n\t\t\tMaxBackups: 10,\n\t\t\tMaxAge: 7,\n\t\t},\n\t}\n}", "title": "" }, { "docid": "01af8eaa92a7c4bcc4d1695053ce0578", "score": "0.63421845", "text": "func defaultOptions() interface{} {\n\treturn &options{}\n}", "title": "" }, { "docid": "1b9434e079565e501b9b566a74364226", "score": "0.6330689", "text": "func (drc *DNSBLResponseCreate) defaults() {\n\tif _, ok := drc.mutation.CreatedAt(); !ok {\n\t\tv := dnsblresponse.DefaultCreatedAt()\n\t\tdrc.mutation.SetCreatedAt(v)\n\t}\n\tif _, ok := drc.mutation.UpdatedAt(); !ok {\n\t\tv := dnsblresponse.DefaultUpdatedAt()\n\t\tdrc.mutation.SetUpdatedAt(v)\n\t}\n\tif _, ok := drc.mutation.ID(); !ok {\n\t\tv := dnsblresponse.DefaultID()\n\t\tdrc.mutation.SetID(v)\n\t}\n}", "title": "" }, { "docid": "8bef554405a6d456315149d65061c30d", "score": "0.63272655", "text": "func (r *PathFinder) Default() {\n\tpathfinderlog.Info(\"default\", \"name\", r.Name)\n\t// TODO(user): fill in your defaulting logic.\n}", "title": "" }, { "docid": "2f215f875baeeb7c92dcfb4463f91afd", "score": "0.6317297", "text": "func (h *Host) SetDefaults() {\n\th.set.Do(func() {\n\t\tif h.Hostname == \"\" {\n\t\t\th.Hostname = DefaultHost\n\t\t}\n\t\tif h.BasePath == \"\" {\n\t\t\th.BasePath = DefaultBasePath\n\t\t}\n\t\tif h.ApiKey == \"\" {\n\t\t\th.ApiKey = defaultApiKey\n\t\t}\n\t\th.rateLimits = make(map[string]RateLimitInfo)\n\t\th.rateLimitLock = new(sync.RWMutex)\n\t\th.callToBucket = make(map[string]string)\n\t})\n}", "title": "" }, { "docid": "c5430cd28037372636027c8db90e5317", "score": "0.6313784", "text": "func (dcc *DeathCertifierCreate) defaults() error {\n\tif _, ok := dcc.mutation.CreatedAt(); !ok {\n\t\tif deathcertifier.DefaultCreatedAt == nil {\n\t\t\treturn fmt.Errorf(\"ent: uninitialized deathcertifier.DefaultCreatedAt (forgotten import ent/runtime?)\")\n\t\t}\n\t\tv := deathcertifier.DefaultCreatedAt()\n\t\tdcc.mutation.SetCreatedAt(v)\n\t}\n\tif _, ok := dcc.mutation.UpdatedAt(); !ok {\n\t\tif deathcertifier.DefaultUpdatedAt == nil {\n\t\t\treturn fmt.Errorf(\"ent: uninitialized deathcertifier.DefaultUpdatedAt (forgotten import ent/runtime?)\")\n\t\t}\n\t\tv := deathcertifier.DefaultUpdatedAt()\n\t\tdcc.mutation.SetUpdatedAt(v)\n\t}\n\treturn nil\n}", "title": "" }, { "docid": "3900dab77feed5725938ff6d5e63e0fc", "score": "0.63129425", "text": "func (o *GetVersionParams) SetDefaults() {\n\t// no default values defined for this parameter\n}", "title": "" }, { "docid": "e1c38af3d26fd502066763dd4b9631ec", "score": "0.63082445", "text": "func (r *Application) Default() {\n\tapplicationlog.Info(\"default\", \"name\", r.Name)\n\n\tif r.Spec.Type == \"\" {\n\t\tr.Spec.Type = Helm\n\t}\n}", "title": "" }, { "docid": "49a1d185bc9ae03fe5cd119657fef1f4", "score": "0.6303148", "text": "func (assessment *ServersDatabasesVulnerabilityAssessment) Default() {\n\tassessment.defaultImpl()\n\tvar temp any = assessment\n\tif runtimeDefaulter, ok := temp.(genruntime.Defaulter); ok {\n\t\truntimeDefaulter.CustomDefault()\n\t}\n}", "title": "" }, { "docid": "d3350d05ffea8fd47358fb0e7e643d40", "score": "0.6301855", "text": "func (wodc *WorkOrderDefinitionCreate) defaults() {\n\tif _, ok := wodc.mutation.CreateTime(); !ok {\n\t\tv := workorderdefinition.DefaultCreateTime()\n\t\twodc.mutation.SetCreateTime(v)\n\t}\n\tif _, ok := wodc.mutation.UpdateTime(); !ok {\n\t\tv := workorderdefinition.DefaultUpdateTime()\n\t\twodc.mutation.SetUpdateTime(v)\n\t}\n}", "title": "" }, { "docid": "d953547fd482c1e8b634134a16953f51", "score": "0.6294911", "text": "func (epc *EquipmentPortCreate) defaults() {\n\tif _, ok := epc.mutation.CreateTime(); !ok {\n\t\tv := equipmentport.DefaultCreateTime()\n\t\tepc.mutation.SetCreateTime(v)\n\t}\n\tif _, ok := epc.mutation.UpdateTime(); !ok {\n\t\tv := equipmentport.DefaultUpdateTime()\n\t\tepc.mutation.SetUpdateTime(v)\n\t}\n}", "title": "" }, { "docid": "95909589a77807b55dec7477e0df75ca", "score": "0.62920743", "text": "func (k *Kubeclient) withDefaults() {\n\tif k.getClientset == nil {\n\t\tk.getClientset = defaultGetClientset\n\t}\n\tif k.getClientsetForPath == nil {\n\t\tk.getClientsetForPath = defaultGetClientsetForPath\n\t}\n\tif k.get == nil {\n\t\tk.get = defaultGet\n\t}\n\tif k.list == nil {\n\t\tk.list = defaultList\n\t}\n\tif k.del == nil {\n\t\tk.del = defaultDel\n\t}\n\tif k.create == nil {\n\t\tk.create = defaultCreate\n\t}\n\tif k.update == nil {\n\t\tk.update = defaultUpdate\n\t}\n}", "title": "" }, { "docid": "e3baa70f0b19150bf4065bc928ca2361", "score": "0.6291878", "text": "func (spec *ClusterAutoscalerSpec) Default(cfg *Config) {\n\tif spec.CloudProvider == \"\" {\n\t\tspec.CloudProvider = CloudProviderKubemark\n\t}\n\tif spec.MinNodes == 0 {\n\t\tspec.MinNodes = 1\n\t}\n\tif spec.MaxNodes == 0 {\n\t\tspec.MaxNodes = 100\n\t}\n\tif spec.ScaleDownDelay == \"\" {\n\t\tspec.ScaleDownDelay = \"30s\"\n\t}\n\tspec.Image = spec.defaultImage()\n}", "title": "" }, { "docid": "0f6a8bb140561fb470a639f39a378d56", "score": "0.62889254", "text": "func (uc *UserCreate) defaults() {\n\tif _, ok := uc.mutation.CreateTime(); !ok {\n\t\tv := user.DefaultCreateTime()\n\t\tuc.mutation.SetCreateTime(v)\n\t}\n\tif _, ok := uc.mutation.UpdateTime(); !ok {\n\t\tv := user.DefaultUpdateTime()\n\t\tuc.mutation.SetUpdateTime(v)\n\t}\n}", "title": "" }, { "docid": "c4e8641ae6ecc71924ee47cc25deff17", "score": "0.62862885", "text": "func (m *Model) setDefault() error {\n\tif m.Name == \"\" {\n\t\treturn errors.New(\"model name missing\")\n\t}\n\n\tif m.FileName == \"\" {\n\t\treturn errors.New(\"filename missing. use -f to specify one\")\n\t}\n\n\tif m.PackageName == \"\" {\n\t\treturn errors.New(\"package name missing. use -p to specify one\")\n\t}\n\n\tif m.Table == \"\" {\n\t\tm.Table = snaker.CamelToSnake(m.Name)\n\t}\n\n\tpwd, err := os.Getwd()\n\tif err != nil {\n\t\treturn err\n\t}\n\tm.FullPath = path.Join(pwd, m.FileName)\n\treturn nil\n}", "title": "" }, { "docid": "5ac7242be3c77a6fd860baa565c665be", "score": "0.62854755", "text": "func (DefaultBackupSchemeFns) DefaultingFunction(o interface{}) {\n\tobj := o.(*DefaultBackup)\n\t// set default field values here\n\tlog.Printf(\"Defaulting fields for DefaultBackup %s\\n\", obj.Name)\n}", "title": "" }, { "docid": "d65ede4ea9252e27c0e0d73de368ad90", "score": "0.6278688", "text": "func (pic *PlayerIdentifierCreate) defaults() error {\n\tif _, ok := pic.mutation.CreatedAt(); !ok {\n\t\tif playeridentifier.DefaultCreatedAt == nil {\n\t\t\treturn fmt.Errorf(\"ent: uninitialized playeridentifier.DefaultCreatedAt (forgotten import ent/runtime?)\")\n\t\t}\n\t\tv := playeridentifier.DefaultCreatedAt()\n\t\tpic.mutation.SetCreatedAt(v)\n\t}\n\tif _, ok := pic.mutation.UpdatedAt(); !ok {\n\t\tif playeridentifier.DefaultUpdatedAt == nil {\n\t\t\treturn fmt.Errorf(\"ent: uninitialized playeridentifier.DefaultUpdatedAt (forgotten import ent/runtime?)\")\n\t\t}\n\t\tv := playeridentifier.DefaultUpdatedAt()\n\t\tpic.mutation.SetUpdatedAt(v)\n\t}\n\treturn nil\n}", "title": "" }, { "docid": "42002b3636b3b9e2782e4b29defd4203", "score": "0.6255735", "text": "func (version *EstafetteVersion) setDefaults() {\n\tif version.Custom == nil && version.SemVer == nil {\n\t\tversion.SemVer = &EstafetteSemverVersion{}\n\t}\n\n\t// if version is semver set defaults\n\tif version.SemVer != nil {\n\t\tif version.SemVer.Patch == \"\" {\n\t\t\tversion.SemVer.Patch = \"{{auto}}\"\n\t\t}\n\t\tif version.SemVer.LabelTemplate == \"\" {\n\t\t\tversion.SemVer.LabelTemplate = \"{{branch}}\"\n\t\t}\n\t\tif len(version.SemVer.ReleaseBranch.Values) == 0 {\n\t\t\tversion.SemVer.ReleaseBranch.Values = []string{\"master\"}\n\t\t}\n\t}\n\n\t// if version is custom set defaults\n\tif version.Custom != nil {\n\t\tif version.Custom.LabelTemplate == \"\" {\n\t\t\tversion.Custom.LabelTemplate = \"{{revision}}\"\n\t\t}\n\t}\n}", "title": "" }, { "docid": "797ad300452ee0f8c19b966b7bae2ab7", "score": "0.62535614", "text": "func (c *Config) InitDefaults() error { return setDefaults(c.elem) }", "title": "" }, { "docid": "fe0fa02897cce974445aee5dbc5ed05d", "score": "0.6253466", "text": "func Default(v interface{}) gr.Modifier {\n\treturn gr.Prop(\"default\", v)\n}", "title": "" }, { "docid": "c80b4fc01136115a11e145b989384b97", "score": "0.6251974", "text": "func (krsuo *K8sReplicaSetUpdateOne) defaults() {\n\tif _, ok := krsuo.mutation.UpdatedAt(); !ok {\n\t\tv := k8sreplicaset.UpdateDefaultUpdatedAt()\n\t\tkrsuo.mutation.SetUpdatedAt(v)\n\t}\n\tif _, ok := krsuo.mutation.DeletedAt(); !ok {\n\t\tv := k8sreplicaset.UpdateDefaultDeletedAt()\n\t\tkrsuo.mutation.SetDeletedAt(v)\n\t}\n}", "title": "" }, { "docid": "1712bb394b4310eebd3d13815e1a144e", "score": "0.625006", "text": "func (wc *WechatCreate) defaults() {\n\tif _, ok := wc.mutation.CreateTime(); !ok {\n\t\tv := wechat.DefaultCreateTime()\n\t\twc.mutation.SetCreateTime(v)\n\t}\n\tif _, ok := wc.mutation.UpdateTime(); !ok {\n\t\tv := wechat.DefaultUpdateTime()\n\t\twc.mutation.SetUpdateTime(v)\n\t}\n}", "title": "" }, { "docid": "4dc500cd9d5763347c2e8251bf1fcfff", "score": "0.62498516", "text": "func (bird * Bird) SetDefault(){\n\tif bird.Visible == nil {\n\t\tbird.Visible = new(bool)\n\t\t*bird.Visible = false\n\t}\n\n\tif bird.Added == nil {\n\t\tbird.Added = new(string)\n\t\t*bird.Added = time.Now().UTC().Format(time.UnixDate)\n\t}\n}", "title": "" }, { "docid": "430ac39320ef7aefdbc277e710b1faf9", "score": "0.6249697", "text": "func (schedule *RedisPatchSchedule) Default() {\n\tschedule.defaultImpl()\n\tvar temp any = schedule\n\tif runtimeDefaulter, ok := temp.(genruntime.Defaulter); ok {\n\t\truntimeDefaulter.CustomDefault()\n\t}\n}", "title": "" }, { "docid": "23f60a66711c30baa0a7deeca90011dd", "score": "0.62445986", "text": "func (r *Simple) Default() {\n\tsimplelog.Info(\"default\", \"name\", r.Name)\n\n\tif r.Spec.LessSillyName == \"\" {\n\t\tr.Spec.LessSillyName = \"a good default\"\n\t}\n}", "title": "" }, { "docid": "a9574924243c5acf172ecfc88d702d76", "score": "0.6241195", "text": "func setMetaDefaults(obj deploy.KubeObject, defaults kube.ObjectMeta) {\n\tmeta := obj.GetObjectMeta()\n\n\t// if namespace is not set, use default\n\tnamespace := kube.NamespaceDefault\n\tif len(defaults.Namespace) > 0 {\n\t\tnamespace = defaults.Namespace\n\t}\n\n\tif len(meta.GetNamespace()) == 0 {\n\t\tmeta.SetNamespace(namespace)\n\t}\n\n\t// if name and generateName are not set use default generateName\n\tif len(defaults.GenerateName) > 0 && len(meta.GetName()) == 0 && len(meta.GetGenerateName()) == 0 {\n\t\tmeta.SetGenerateName(defaults.GenerateName)\n\t}\n\n\t// set default labels\n\tlabels := map[string]string{}\n\tif defaults.Labels != nil {\n\t\tlabels = defaults.Labels\n\t}\n\tfor k, v := range meta.GetLabels() {\n\t\tlabels[k] = v\n\t}\n\tmeta.SetLabels(labels)\n\n\t// set default annotations\n\tannotations := map[string]string{}\n\tif defaults.Annotations != nil {\n\t\tannotations = defaults.Annotations\n\t}\n\tfor k, v := range meta.GetAnnotations() {\n\t\tannotations[k] = v\n\t}\n\tmeta.SetAnnotations(annotations)\n}", "title": "" }, { "docid": "a99b89d3b65eb6025121a434ca7e75f5", "score": "0.62394184", "text": "func (network *VirtualNetwork) Default() {\n\tnetwork.defaultImpl()\n\tvar temp any = network\n\tif runtimeDefaulter, ok := temp.(genruntime.Defaulter); ok {\n\t\truntimeDefaulter.CustomDefault()\n\t}\n}", "title": "" }, { "docid": "e23ff2fbc94d4ce31a745ceeaa1f827e", "score": "0.6238788", "text": "func (host *BastionHost) Default() {\n\thost.defaultImpl()\n\tvar temp any = host\n\tif runtimeDefaulter, ok := temp.(genruntime.Defaulter); ok {\n\t\truntimeDefaulter.CustomDefault()\n\t}\n}", "title": "" }, { "docid": "ee3a37462ab0cc0d2fc2859bed968072", "score": "0.623357", "text": "func (b *Bitfinex) SetDefaults() {\n\tb.Name = \"Bitfinex\"\n\tb.Enabled = false\n\tb.Verbose = false\n\tb.Websocket = false\n\tb.RESTPollingDelay = 10\n\tb.WebsocketSubdChannels = make(map[int]WebsocketChanInfo)\n\tb.RequestCurrencyPairFormat.Delimiter = \"\"\n\tb.RequestCurrencyPairFormat.Uppercase = true\n\tb.ConfigCurrencyPairFormat.Delimiter = \"\"\n\tb.ConfigCurrencyPairFormat.Uppercase = true\n\tb.AssetTypes = []string{ticker.Spot}\n\tb.Orderbooks = orderbook.Init()\n\tb.rateLimits = map[string]int64{}\n\tb.lastBalances = []Balance{}\n\tb.lastActiveOrders = []Order{}\n}", "title": "" }, { "docid": "b6ddd0ffc694015330b12ebe8a97c8cb", "score": "0.6232265", "text": "func Default() L { return def }", "title": "" }, { "docid": "a084467ecd8ce5caa30dc5059d886021", "score": "0.6223853", "text": "func defaultOptions() *options {\n\treturn &options{}\n}", "title": "" }, { "docid": "1e6edf4739156b1a9708a686ad7a796f", "score": "0.6220612", "text": "func (pc *ParticipantCreate) defaults() {\n\tif _, ok := pc.mutation.CreatedAt(); !ok {\n\t\tv := participant.DefaultCreatedAt()\n\t\tpc.mutation.SetCreatedAt(v)\n\t}\n\tif _, ok := pc.mutation.UpdatedAt(); !ok {\n\t\tv := participant.DefaultUpdatedAt()\n\t\tpc.mutation.SetUpdatedAt(v)\n\t}\n}", "title": "" }, { "docid": "8c5e3e02f1a4ab8c3b2dd29f6fe342f0", "score": "0.6218636", "text": "func (r *MariaDBDatabase) Default() {\n\tmariadbdatabaselog.Info(\"default\", \"name\", r.Name)\n\n\tif r.Spec.Init != nil {\n\t\tif r.Spec.Init.Snapshot != nil {\n\t\t\tif r.Spec.Init.Snapshot.SnapshotID == \"\" {\n\t\t\t\tr.Spec.Init.Snapshot.SnapshotID = \"latest\"\n\t\t\t}\n\t\t}\n\t}\n\tif r.Spec.Database.Config.CharacterSet == \"\" {\n\t\tr.Spec.Database.Config.CharacterSet = \"utf8mb4\"\n\t}\n}", "title": "" }, { "docid": "4403e1097f591a9f4060533b71b0cacd", "score": "0.62145007", "text": "func (s *SenderTest) Default(cant bool) {\n\ts.CantAccept = cant\n\ts.CantSendGetStateSummaryFrontier = cant\n\ts.CantSendStateSummaryFrontier = cant\n\ts.CantSendGetAcceptedStateSummary = cant\n\ts.CantSendAcceptedStateSummary = cant\n\ts.CantSendGetAcceptedFrontier = cant\n\ts.CantSendAcceptedFrontier = cant\n\ts.CantSendGetAccepted = cant\n\ts.CantSendAccepted = cant\n\ts.CantSendGet = cant\n\ts.CantSendGetAccepted = cant\n\ts.CantSendPut = cant\n\ts.CantSendAncestors = cant\n\ts.CantSendPullQuery = cant\n\ts.CantSendPushQuery = cant\n\ts.CantSendChits = cant\n\ts.CantSendGossip = cant\n\ts.CantSendAppRequest = cant\n\ts.CantSendAppResponse = cant\n\ts.CantSendAppGossip = cant\n\ts.CantSendAppGossipSpecific = cant\n\ts.CantSendCrossChainAppRequest = cant\n\ts.CantSendCrossChainAppResponse = cant\n}", "title": "" }, { "docid": "41195177575e5ca3dd65bde9e7b4e4c1", "score": "0.6213986", "text": "func (irc *InstanceRuntimeCreate) defaults() {\n\tif _, ok := irc.mutation.ID(); !ok {\n\t\tv := instanceruntime.DefaultID()\n\t\tirc.mutation.SetID(v)\n\t}\n}", "title": "" }, { "docid": "733f0483102eac601dc474f16a4db025", "score": "0.6213597", "text": "func (c *Configuration) InitializeDefaults(path string, targetPath string) {\n\tc.IndexCfg = fsindex.DefaultSettings\n\n\t// initialize model array and map.\n\tmodels = []fsindex.Model{}\n\tmdlMap = make(map[string]*fsindex.Model)\n\n\t// println(\"==> Configuring\")\n\tc.Server.initServerConfig()\n\tc.Root = RootConfig{\n\t\tPath: constRootPathDefault,\n\t\tDirectory: constRootDirectoryDefault,\n\t\tFiles: strings.Split(constRootFilesDefault, \",\"),\n\t\tDefault: constRootIndexDefault,\n\t\tAliasDefault: strings.Split(constRootAliasDefault, \",\"),\n\t}\n\tc.Locations = []StaticPath{\n\t\tStaticPath{\n\t\t\tSource: constImagesSourceDefault,\n\t\t\tTarget: constImagesTargetDefault,\n\t\t},\n\t\tStaticPath{\n\t\t\tSource: constStaticSourceDefault,\n\t\t\tTarget: constStaticTargetDefault,\n\t\t\tBrowsable: true,\n\t\t},\n\t}\n\tc.Indexes = []IndexPath{\n\t\t// FIXME: this particular path is to be associated with indexing.\n\t\tIndexPath{\n\t\t\tSource: path,\n\t\t\tTarget: util.Wrapper(\"/\", targetPath),\n\t\t\tBrowsable: true,\n\t\t\tServable: true,\n\t\t\tExtensions: []string{\"Media\"},\n\t\t\tIgnorePaths: []string{},\n\t\t\tpath: \"\",\n\t\t},\n\t}\n\tc.Extensions = []fsindex.FileSpec{\n\t\tfsindex.FileSpec{\n\t\t\tName: \"Media\",\n\t\t\tExtensions: strings.Split(constExtDefaultMedia, \",\"),\n\t\t},\n\t\tfsindex.FileSpec{\n\t\t\tName: \"Markdown\",\n\t\t\tExtensions: strings.Split(constExtDefaultMMD, \",\"),\n\t\t},\n\t}\n\tc.Pandoc = pandoc.Settings{\n\t\tExecutable: \"data/pandoc/pandoc.exe\",\n\t\tHTMLTemplate: \"data/pandoc/md-tpl.htm\",\n\t\tMetaTemplate: \"data/pandoc/md-meta.htm\",\n\t\tFlags: \"-N\", // numbered headers\n\t\tExtensions: \"+abbreviations+auto_identifiers+autolink_bare_uris+backtick_code_blocks+bracketed_spans+definition_lists+emoji+escaped_line_breaks+example_lists+fancy_lists+fenced_code_attributes+fenced_divs+footnotes+header_attributes+inline_code_attributes+implicit_figures+implicit_header_references+inline_notes+link_attributes+mmd_title_block+multiline_tables+raw_tex+simple_tables+smart+startnum+strikeout+table_captions+yaml_metadata_block\",\n\t}\n\t// c.info()\n\tc.Prepare()\n}", "title": "" }, { "docid": "6e2ef441e08e64fdfc3b7326affeb018", "score": "0.62106526", "text": "func (o *AddParams) SetDefaults() {\n\t// no default values defined for this parameter\n}", "title": "" }, { "docid": "5f42995b1bbb4879d3892a7ce4bdb6f6", "score": "0.62036145", "text": "func (r *Recorder) NewDefault(kind, field Named, value interface{}) {\n\t// horses height 5.\n\tr.cache.Must(eph_default, kind, field, value)\n}", "title": "" }, { "docid": "ed144186c2e60cf01bf2cb226969a6aa", "score": "0.6200435", "text": "func (c *VConf) InitDefaults() {\n\t/*\n\t\tviper.SetDefault(\"ContentDir\", \"content\")\n\t\tviper.SetDefault(\"LayoutDir\", \"layouts\")\n\t\tviper.SetDefault(\"Taxonomies\", map[string]string{\"tag\": \"tags\", \"category\": \"categories\"})\n\t\tviper.Set(\"Verbose\", true)\n\t*/\n\n\tviper.SetDefault(\"tracing\", \"go\")\n\tviper.SetDefault(\"tracingonline\", true)\n\tviper.SetDefault(\"tracingequations\", \"Error\")\n\tviper.SetDefault(\"tracingsyntax\", \"Error\")\n\tviper.SetDefault(\"tracingcommands\", \"Error\")\n\tviper.SetDefault(\"tracinginterpreter\", \"Error\")\n\tviper.SetDefault(\"tracinggraphics\", \"Error\")\n\n\tviper.SetDefault(\"tracingcapsules\", \"Error\")\n\tviper.SetDefault(\"tracingrestores\", \"Error\")\n\tviper.SetDefault(\"tracingchoices\", true)\n}", "title": "" }, { "docid": "4d7c108b5bc024ba9f97bfb4a722fcfe", "score": "0.61927557", "text": "func (fdc *FlowDraftCreate) defaults() {\n\tif _, ok := fdc.mutation.CreateTime(); !ok {\n\t\tv := flowdraft.DefaultCreateTime()\n\t\tfdc.mutation.SetCreateTime(v)\n\t}\n\tif _, ok := fdc.mutation.UpdateTime(); !ok {\n\t\tv := flowdraft.DefaultUpdateTime()\n\t\tfdc.mutation.SetUpdateTime(v)\n\t}\n\tif _, ok := fdc.mutation.SameAsFlow(); !ok {\n\t\tv := flowdraft.DefaultSameAsFlow\n\t\tfdc.mutation.SetSameAsFlow(v)\n\t}\n}", "title": "" }, { "docid": "43959b4516bc8ba20c6e1cf9667a2ae6", "score": "0.61905044", "text": "func (r *Qserv) Default() {\n\tlog.Info(\"default\", \"name\", r.Name)\n\n\t// TODO(user): fill in your defaulting logic.\n}", "title": "" }, { "docid": "c5259c88ebfaf7f2907373a932722fb0", "score": "0.61829036", "text": "func Defaults() (*ice.MagicBag, jsonconfig.Schema) {\n\tbag := ice.NewMagicBag()\n\tbag.PutMany(\n\t\tfunc(scope endpoints.StatScope) stats.StatsReceiver {\n\t\t\treturn endpoints.MakeStatsReceiver(scope).Precision(time.Millisecond)\n\t\t},\n\t\tMakeServer,\n\t\tNewHandler,\n\t\tmakeServers,\n\t\tsaga.MakeSagaCoordinator,\n\t\tsagalogs.MakeInMemorySagaLog,\n\t\tscheduler.NewStatefulSchedulerFromCluster,\n\t\tthrift.NewTTransportFactory,\n\t\tfunc() thrift.TProtocolFactory {\n\t\t\treturn thrift.NewTBinaryProtocolFactoryDefault()\n\t\t},\n\t)\n\n\tschema := jsonconfig.Schema(map[string]jsonconfig.Implementations{\n\t\t\"Cluster\": {\n\t\t\t\"memory\": &scootconfig.ClusterMemoryConfig{},\n\t\t\t\"local\": &scootconfig.ClusterLocalConfig{},\n\t\t\t\"\": &scootconfig.ClusterMemoryConfig{\n\t\t\t\tType: \"memory\",\n\t\t\t\tCount: 10,\n\t\t\t},\n\t\t},\n\t\t\"Workers\": {\n\t\t\t\"local\": &scootconfig.WorkersLocalConfig{},\n\t\t\t\"rpc\": &scootconfig.WorkersThriftConfig{},\n\t\t\t\"\": &scootconfig.WorkersLocalConfig{Type: \"local\"},\n\t\t},\n\t\t\"SchedulerConfig\": {\n\t\t\t\"stateful\": &scootconfig.StatefulSchedulerConfig{},\n\t\t\t\"\": &scootconfig.StatefulSchedulerConfig{Type: \"stateful\", MaxRetriesPerTask: 0},\n\t\t},\n\t})\n\n\treturn bag, schema\n}", "title": "" } ]
18eb474cf55339800a3568f95f869869
CompressedEncodedString compress, then base64 encode the xml document
[ { "docid": "80a42e075c2ee44283cb06c10365b356", "score": "0.7327633", "text": "func CompressedEncodedString(data interface{}) (string, error) {\n\tsaml, err := String(data)\n\tif err != nil {\n\t\treturn \"\", err\n\t}\n\n\tb64XML := DeflateAndEncodeString([]byte(saml))\n\treturn b64XML, nil\n}", "title": "" } ]
[ { "docid": "2c3329a76b1a280dcb5d5e120dacf0c6", "score": "0.72760624", "text": "func CompressedEncodedSignedString(data interface{}, privateKeyPath string) (string, error) {\n\tsigned, err := SignedString(data, privateKeyPath)\n\tif err != nil {\n\t\treturn \"\", err\n\t}\n\n\tb64XML := DeflateAndEncodeString([]byte(signed))\n\treturn b64XML, nil\n}", "title": "" }, { "docid": "d08fca58d8e031d75cfe144c28ce3c88", "score": "0.6437014", "text": "func CompressedEncodedSignedStringFromKey(data interface{}, key string) (string, error) {\n\tstr, err := String(data)\n\tif err != nil {\n\t\treturn \"\", err\n\t}\n\n\tsigned, err := SignWithKey(str, key)\n\tif err != nil {\n\t\treturn \"\", err\n\t}\n\n\tb64XML := DeflateAndEncodeString([]byte(signed))\n\treturn b64XML, nil\n}", "title": "" }, { "docid": "a5b7829f8543cdf4fb7c822319e49bdc", "score": "0.60845846", "text": "func (m *AlertMannager) gzipBase64(message interface{}) string {\r\n\tvar gzipBuf bytes.Buffer\r\n\tmessageJsonByte, err := json.Marshal(message)\r\n\tif err != nil {\r\n\t\tlog.Println(err)\r\n\t}\r\n\tgzipWriter := gzip.NewWriter(&gzipBuf)\r\n\tdefer gzipWriter.Close()\r\n\tgzipWriter.Write(messageJsonByte)\r\n\tgzipWriter.Close()\r\n\tmessageGzipBase64 := base64.URLEncoding.EncodeToString(gzipBuf.Bytes())\r\n\treturn messageGzipBase64\r\n}", "title": "" }, { "docid": "bacbe11aa5e76b689f7eedbe70944a20", "score": "0.57266045", "text": "func Compress(file *os.File, outputName string) {\n\t// gerar a arvore a partir da frequencia dos caracteres do texto\n\troot := Harvest(GetMap(file))\n\n\t// gerar dicionario\n\tdict := make(map[string]string)\n\n\tif root.IsLeaf() {\n\t\tdict[root.Value] = \"0\"\n\t} else {\n\t\tcreateDict(root, dict, \"\")\n\t}\n\n\t//Resetar cursor\n\tfile.Seek(0, 0)\n\t//Escrever Árvore\n\toutputFile, _ := os.Create(outputName)\n\twriter := bit.NewWriter(outputFile)\n\twriteNode(root, writer)\n\n\t// Codificar\n\n\twriteCodified(file, dict, writer)\n}", "title": "" }, { "docid": "308fe11d34363feec14e91caee4165ee", "score": "0.56538266", "text": "func compress(chars []byte) int {\n \n}", "title": "" }, { "docid": "d4aaad585b4dc137840826ed23c04696", "score": "0.56370944", "text": "func Compress(uncompressed *vector.Vector) *vector.Vector {\n\tbyteFrequencies := createFrequencyTable(uncompressed)\n\tprefixTree := buildPrefixTree(byteFrequencies)\n\n\tcodes := dictionary.New()\n\tbuildCodes(prefixTree, vector.New(), codes)\n\n\tcompressedPrefixTree := vector.New()\n\tcompressPrefixTree(prefixTree, compressedPrefixTree)\n\n\tencodedBytes := encodeToHuffmanCodes(uncompressed, codes)\n\n\tcompressedCodes, lastByteInBits := compressHuffmanCodes(encodedBytes)\n\n\t// Reserve space for the last byte size, prefix tree and huffman codes\n\tcompressed := vector.New(0, 1+uint(compressedPrefixTree.Size()+compressedCodes.Size()))\n\tcompressed.Append(byte(lastByteInBits))\n\n\tfor i := 0; i < compressedPrefixTree.Size(); i++ {\n\t\tcompressed.Append(compressedPrefixTree.MustGet(i))\n\t}\n\n\tfor i := 0; i < compressedCodes.Size(); i++ {\n\t\tcompressed.Append(compressedCodes.MustGet(i))\n\t}\n\n\treturn compressed\n}", "title": "" }, { "docid": "5f2e27c45acae3b61db0719d84a6fb55", "score": "0.5634073", "text": "func Base64Transaction(tx []byte) (bs string) {\n jtx, _ := json.Marshal(tx)\n bs = base64.StdEncoding.EncodeToString(jtx)\n return bs\n}", "title": "" }, { "docid": "4c02f0ab7bb66e8c8998b49b67a5c62a", "score": "0.5572378", "text": "func (stringEntry *String) CompressToBytes() []byte {\n\treturn stringEntry.Base.compressToBytes()\n}", "title": "" }, { "docid": "fb1124192b4b3c028ea8e446df32ad03", "score": "0.5553163", "text": "func ZipAndEncode(contents string) (string, error) {\n\t// Zip the string\n\tvar buf bytes.Buffer\n\tgzWriter := gzip.NewWriter(&buf)\n\n\t_, err := gzWriter.Write([]byte(contents))\n\tif err != nil {\n\t\treturn \"\", err\n\t}\n\tif err := gzWriter.Flush(); err != nil {\n\t\treturn \"\", err\n\t}\n\tif err := gzWriter.Close(); err != nil {\n\t\treturn \"\", err\n\t}\n\n\t// Encode using base64\n\tencode := base64.StdEncoding.EncodeToString(buf.Bytes())\n\treturn encode, nil\n}", "title": "" }, { "docid": "d4465cd0d042f96162c8d6b205d297de", "score": "0.55441064", "text": "func (comp *Compressor) Compress(uncompressed string) {\n\tcomp.DictSize = 256\n\tcomp.Dictionary = make(map[string]byte, comp.DictSize)\n\tfor i := 0; i < comp.DictSize; i++ {\n\t\t// encoding to utf8\n\t\tcomp.Dictionary[string([]byte{byte(i)})] = byte(i)\n\t}\n\n\tvar result []byte\n\tvar w []byte\n\tfor i := 0; i < len(uncompressed); i++ {\n\t\tch := uncompressed[i]\n\t\tappended := append(w, ch)\n\t\tif _, flag := comp.Dictionary[string(appended)]; flag {\n\t\t\tw = appended\n\t\t} else {\n\t\t\tresult = append(result, comp.Dictionary[string(w)])\n\t\t\t// Add appended to the dictionary.\n\t\t\tcomp.Dictionary[string(appended)] = byte(comp.DictSize)\n\t\t\tcomp.DictSize++\n\t\t\t//w = []byte{ch}, but re-using appended\n\t\t\tappended[0] = ch\n\t\t\tw = appended[:1]\n\t\t}\n\t}\n\tif len(w) > 0 {\n\t\tresult = append(result, comp.Dictionary[string(w)])\n\t}\n\tcomp.Yield = append(comp.Yield, result...)\n}", "title": "" }, { "docid": "c51e1b43ce875618a203df1538776227", "score": "0.55386436", "text": "func Prepare(payloadDat string) string {\n\tvar buf bytes.Buffer\n\terr := compress(&buf, []byte(payloadDat))\n\tif err != nil {\n\t\tlog.Fatal(err)\n\t}\n\tif DEBUG {\n\t\tlog.Printf(\"Payload --> %.*s...\\t(%d bytes)\", 10, payloadDat, len(payloadDat))\n\t\tlog.Printf(\"PayloadPrepared --> %.*s...\\t\\t(%d bytes)\", 10, buf.String(), len(buf.String()))\n\t}\n\treturn base64.StdEncoding.EncodeToString([]byte(buf.String()))\n}", "title": "" }, { "docid": "5286cfe5834b097b746a845b07fdb96c", "score": "0.5531651", "text": "func Compress(d []byte) (*bytes.Buffer, error) {\n\tif len(d) == 0 {\n\t\treturn nil, errors.New(\"utils: empty data\")\n\t}\n\n\tvar buf bytes.Buffer\n\n\tw := gzip.NewWriter(&buf)\n\t_, err := w.Write(d)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\t_ = w.Close()\n\n\treturn &buf, nil\n}", "title": "" }, { "docid": "09530cf68ab240110aaa2d78e726042e", "score": "0.5517151", "text": "func compress_helper(chars []byte) [] byte {\n if len(chars) <= 1 {\n //base case\n return chars \n }\n \n w := chars[0]\n var count int = 1 \n var i int \n //get repetitions for the character\n for i=1; i<len(chars);i++ {\n if chars[i] == w {\n count++\n } else {\n break\n } \n } \n var res []byte = make([]byte, 0) \n if count == 1 {\n //a\n res = append(res, w)\n } else {\n //a3\n res = append([]byte{w}, []byte(strconv.Itoa(count))...)\n }\n //make recursive call to compress rest of the string\n res = append(res, compress_helper(chars[i:])...)\n for k, v := range res {\n chars[k] = v\n }\n \n chars = chars[:len(res)] \n return chars \n}", "title": "" }, { "docid": "9acf91f4d013ae0638e65ee00a32c95b", "score": "0.55013937", "text": "func (key *PublicKey) SerializeCompressed() []byte {\n\tb := make([]byte, 0, PubKeyBytesLenCompressed)\n\tformat := pubKeyCompressed\n\tif isOdd(key.Y) {\n\t\tformat |= 0x1\n\t}\n\tb = append(b, format)\n\treturn bytes.PaddedAppend(b, 32, key.X.Bytes())\n}", "title": "" }, { "docid": "62108386db17fef54c974c0b90617870", "score": "0.54827625", "text": "func (d *digest) compress() {\n\tvar m, v [16]uint32\n\tfor i := 0; i < 16; i++ {\n\t\tm[i] = binary.LittleEndian.Uint32(d.buf[i*4:])\n\t}\n\tfor i := 0; i < 8; i++ {\n\t\tv[i] = d.h[i]\n\t}\n\tv[8] = iv[0]\n\tv[9] = iv[1]\n\tv[10] = iv[2]\n\tv[11] = iv[3]\n\tv[12] = d.t[0] ^ iv[4]\n\tv[13] = d.t[1] ^ iv[5]\n\tv[14] = d.f[0] ^ iv[6]\n\tv[15] = d.f[1] ^ iv[7]\n\n\trotr32 := func (w uint32, c uint32) uint32 {\n\t\treturn (w>>c) | (w<<(32-c))\n\t}\n\tG := func(r, i, a, b, c, d int) {\n\t\tv[a] = v[a] + v[b] + m[sigma[r][2*i+0]]\n\t\tv[d] = rotr32(v[d] ^ v[a], 16)\n\t\tv[c] = v[c] + v[d]\n\t\tv[b] = rotr32(v[b] ^ v[c], 12)\n\t\tv[a] = v[a] + v[b] + m[sigma[r][2*i+1]]\n\t\tv[d] = rotr32(v[d] ^ v[a], 8)\n\t\tv[c] = v[c] + v[d]\n\t\tv[b] = rotr32(v[b] ^ v[c], 7)\n\t}\n\tfor i := 0; i < 10; i++ {\n\t\tG(i, 0, 0, 4, 8, 12);\n\t\tG(i, 1, 1, 5, 9, 13);\n\t\tG(i, 2, 2, 6, 10, 14);\n\t\tG(i, 3, 3, 7, 11, 15);\n\t\tG(i, 4, 0, 5, 10, 15);\n\t\tG(i, 5, 1, 6, 11, 12);\n\t\tG(i, 6, 2, 7, 8, 13);\n\t\tG(i, 7, 3, 4, 9, 14);\n\t}\n\tfor i := 0; i < 8; i++ {\n\t\td.h[i] = d.h[i] ^ v[i] ^ v[i+8]\n\t}\n}", "title": "" }, { "docid": "54fc42d97a4d3d52e035140c6cd6a1a0", "score": "0.5482662", "text": "func __b64encode(out *[]byte, src *[]byte, mode int)", "title": "" }, { "docid": "051b48f8481a1e1b22232748454af4ea", "score": "0.54733753", "text": "func EncodedSignedString(data interface{}, privateKeyPath string) (string, error) {\n\tsigned, err := SignedString(data, privateKeyPath)\n\tif err != nil {\n\t\treturn \"\", err\n\t}\n\n\tb64XML := EncodeString([]byte(signed))\n\treturn b64XML, nil\n}", "title": "" }, { "docid": "3c5f8174ff6539195c010d062a9be981", "score": "0.5456381", "text": "func gzipCompress(rawData []byte) ([]byte, error) {\n\tif len(rawData) == 0 {\n\t\treturn nil, errors.New(\"gzip compress data gets invalid input data\")\n\t}\n\tvar b bytes.Buffer\n\tgz := gzip.NewWriter(&b)\n\tdefer gz.Close() //nolint\n\t_, err := gz.Write(rawData)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\tif err = gz.Flush(); err != nil {\n\t\treturn nil, err\n\t}\n\treturn b.Bytes(), nil\n}", "title": "" }, { "docid": "b204e0c5a3f06d0cf7a6467b8e7a4da8", "score": "0.54521513", "text": "func compress(src []byte, dest io.Writer, level int) {\n\tcompressor, _ := flate.NewWriter(dest, level)\n\tcompressor.Write(src)\n\tcompressor.Close()\n}", "title": "" }, { "docid": "1a2f99bfcc2f8594785426134b98bbe3", "score": "0.54364806", "text": "func compressGZ(d []byte) ([]byte, error) {\n\tbuf := bytes.Buffer{}\n\tzw := gzip.NewWriter(&buf)\n\tif _, err := zw.Write(d); err != nil {\n\t\treturn nil, err\n\t}\n\tif err := zw.Close(); err != nil {\n\t\treturn nil, err\n\t}\n\treturn buf.Bytes(), nil\n}", "title": "" }, { "docid": "6cc00b80f3b91a15c35b3a2dfbcb1854", "score": "0.5409969", "text": "func Compress(data []byte) []byte {\n\t// apply zlib compression\n\tvar b bytes.Buffer\n\tw := zlib.NewWriter(&b)\n\t_, err := w.Write(data)\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\tw.Close()\n\n\treturn b.Bytes()\n}", "title": "" }, { "docid": "77963e2bc6bd1f254e26261ca5bb5890", "score": "0.53804463", "text": "func (g G1) BytesCompressed() []byte { return g.encodeBytes(true) }", "title": "" }, { "docid": "3e70cb2a544df55dfbe888a25bb10780", "score": "0.5356578", "text": "func (me TCryptoBinary) String() string { return xsdt.Base64Binary(me).String() }", "title": "" }, { "docid": "898f45784e0335a6b0628196bb9e227f", "score": "0.52504414", "text": "func encode(fs http.FileSystem) (string, error) {\n\t// storage is an object that contains all filesystem information.\n\tstorage := newFSStorage()\n\n\t// Walk the provided filesystem, and add all its content to storage.\n\twalker := fsutil.Walk(fs, \"\")\n\tfor walker.Step() {\n\t\tpath := walker.Path()\n\t\tif path == \"\" {\n\t\t\tcontinue\n\t\t}\n\t\tif walker.Stat().IsDir() {\n\t\t\tstorage.Dirs[path] = true\n\t\t} else {\n\t\t\tb, err := readFile(fs, path)\n\t\t\tif err != nil {\n\t\t\t\treturn \"\", err\n\t\t\t}\n\t\t\tstorage.Files[path] = b\n\t\t}\n\t\tlog.Printf(\"Encoded path: %s\", path)\n\t}\n\tif err := walker.Err(); err != nil {\n\t\treturn \"\", errors.Wrap(err, \"walking filesystem\")\n\t}\n\n\t// Encode the storage object into a string.\n\t// storage object -> GOB -> gzip -> base64.\n\tvar buf bytes.Buffer\n\tw := gzip.NewWriter(&buf)\n\terr := gob.NewEncoder(w).Encode(storage)\n\tif err != nil {\n\t\treturn \"\", errors.Wrap(err, \"encoding gob\")\n\t}\n\terr = w.Close()\n\tif err != nil {\n\t\treturn \"\", errors.Wrap(err, \"close gzip\")\n\t}\n\ts := base64.StdEncoding.EncodeToString(buf.Bytes())\n\tlog.Printf(\"Encoded size: %d\", len(s))\n\treturn s, err\n}", "title": "" }, { "docid": "1451da8207fee8c43e59a0240d876e92", "score": "0.5246943", "text": "func Base64Encode(operand string) string { return base64.StdEncoding.EncodeToString([]byte(operand)) }", "title": "" }, { "docid": "c45148cb9de253a23ad35a2515164890", "score": "0.52048373", "text": "func compressString(s string) string {\n\tvar r strings.Builder\n\tr.WriteByte(s[0])\n\tcount := 1\n\tfor i := 1; i < len(s); i++ {\n\t\tif r.Len() >= len(s) {\n\t\t\treturn s\n\t\t}\n\n\t\tif s[i] == s[i-1] {\n\t\t\tcount++\n\t\t} else {\n\t\t\tr.WriteString(strconv.Itoa(count))\n\t\t\tr.WriteByte(s[i])\n\t\t\tcount = 1\n\t\t}\n\t}\n\n\tif count != 0 {\n\t\tr.WriteString(strconv.Itoa(count))\n\t}\n\n\treturn r.String()\n}", "title": "" }, { "docid": "37c775a8f44c4d862ac11129185949e1", "score": "0.5198195", "text": "func DataCompress(data []byte) []byte {\n\tvar zlipBuffer bytes.Buffer\n\n\tzlibWriter := zlib.NewWriter(&zlipBuffer)\n\tdefer zlibWriter.Close()\n\n\tzlibWriter.Write(data)\n\treturn zlipBuffer.Bytes()\n}", "title": "" }, { "docid": "a671e77e5612f1e66669e955bfcab571", "score": "0.5195257", "text": "func compress(s string) string {\n\tif len(s) <= 2 {\n\t\treturn s\n\t}\n\n\tresult := make([]byte, len(s)-1) // the resulting string must be smaller than the original\n\tprev := s[0]\n\tprevCount := 1\n\tvar c byte\n\tj := 0\n\n\taddNumber := func() bool {\n\t\tresult[j] = prev\n\t\tj++\n\t\tif prevCount > 9 {\n\t\t\tprevCountString := strconv.Itoa(prevCount)\n\t\t\tif j+len(prevCountString) > len(result) {\n\t\t\t\treturn false\n\t\t\t}\n\t\t\tcopy(result[j:], prevCountString)\n\t\t\tj += len(prevCountString)\n\t\t} else {\n\t\t\tif j+1 > len(result) {\n\t\t\t\treturn false\n\t\t\t}\n\t\t\tresult[j] = byte(prevCount + 48)\n\t\t\tj++\n\t\t}\n\t\tprev = c\n\t\tprevCount = 1\n\t\treturn true\n\t}\n\n\tfor i := 1; i < len(s); i++ {\n\t\tc = s[i]\n\t\tif c == prev {\n\t\t\tprevCount++\n\t\t} else {\n\t\t\tif !addNumber() {\n\t\t\t\treturn s\n\t\t\t}\n\t\t}\n\t}\n\tif !addNumber() {\n\t\treturn s\n\t}\n\n\treturn string(result[:j])\n}", "title": "" }, { "docid": "8496fcd413375e462c8d4edecfa223fd", "score": "0.5181972", "text": "func Compress(uncompressed *vector.Vector) (*vector.Vector, error) {\n\treturn CompressWithDictSize(uncompressed, XL)\n}", "title": "" }, { "docid": "3e7bb328cf788c1f76e20aaf51fd2c6a", "score": "0.5181821", "text": "func Encode(obj interface{}) string {\n\tb, err := json.Marshal(obj)\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\n\tif compress {\n\t\tb = zip(b)\n\t}\n\n\treturn base64.StdEncoding.EncodeToString(b)\n}", "title": "" }, { "docid": "be7dbb92a5295ad1fad4dfd0ab2a9a17", "score": "0.5166508", "text": "func Compress() otto.Middleware {\n\treturn func(next otto.HandlerFunc) otto.HandlerFunc {\n\t\treturn func(ctx otto.Context) (err error) {\n\t\t\tif ctx.Request().Header.Get(otto.HeaderAcceptEncoding) != gzipSchema {\n\t\t\t\treturn next(ctx)\n\t\t\t}\n\n\t\t\tres := ctx.Response()\n\t\t\trw := res.ResponseWriter\n\n\t\t\tctx.Response().Header().Set(otto.HeaderContentEncoding, gzipSchema)\n\n\t\t\tw, err := gzip.NewWriterLevel(rw, gzip.BestSpeed)\n\t\t\tif err != nil {\n\t\t\t\treturn ctx.Error(500, errors.Wrap(err, \"failed to create a new gzip writer\"))\n\t\t\t}\n\n\t\t\tdefer func() {\n\t\t\t\tif res.Size() == 0 {\n\t\t\t\t\tif res.Header().Get(otto.HeaderContentEncoding) == gzipSchema {\n\t\t\t\t\t\tres.Header().Del(otto.HeaderContentEncoding)\n\t\t\t\t\t}\n\n\t\t\t\t\tres.ResponseWriter = rw\n\t\t\t\t\tw.Reset(ioutil.Discard)\n\t\t\t\t}\n\t\t\t\tif err = w.Close(); err != nil {\n\t\t\t\t\terr = ctx.Error(500, errors.Wrap(err, \"could not close gzip writer\"))\n\t\t\t\t}\n\t\t\t}()\n\n\t\t\tgrw := &gzipResponseWriter{Writer: w, ResponseWriter: rw}\n\t\t\tres.ResponseWriter = grw\n\n\t\t\treturn next(ctx)\n\t\t}\n\t}\n}", "title": "" }, { "docid": "e8e201a0d55796edefdd8f32a8141747", "score": "0.51512694", "text": "func (me TCryptoBinary) ToXsdtBase64Binary() xsdt.Base64Binary { return xsdt.Base64Binary(me) }", "title": "" }, { "docid": "8126376ac53f98741d3365255a0deffd", "score": "0.51461524", "text": "func compressString(origStr string) string {\n\n\torigLen := len(origStr)\n\tvar compStr string\n\n\tif origLen < 2 {\n\t\treturn origStr\n\t}\n\n\tcount := 1\n\tfor idx := 1; idx < origLen; idx++ {\n\n\t\tif origStr[idx-1] == origStr[idx] {\n\t\t\tcount++\n\t\t} else {\n\t\t\tcompStr += string(origStr[idx-1]) + strconv.Itoa(count)\n\t\t\tcount = 1\n\t\t}\n\t\tif len(compStr) >= origLen {\n\t\t\treturn origStr\n\t\t}\n\t}\n\tcompStr += string(origStr[origLen-1]) + strconv.Itoa(count)\n\n\tif len(compStr) >= origLen {\n\t\treturn origStr\n\t}\n\treturn compStr\n}", "title": "" }, { "docid": "bea07386b31b87e0dedde92a3a309891", "score": "0.51288605", "text": "func (self Codec) Compress(input []byte) ([]byte, error) {\n\treturn self.compression.Compress(input)\n}", "title": "" }, { "docid": "a59618074f6a97da6efd25c8b2dd1582", "score": "0.5126928", "text": "func (w *RotateWriter) compress(source string) (err error) {\n\t// Read uncompressed file.\n\trawfile, err := os.Open(source)\n\tif err != nil {\n\t\treturn err\n\t}\n\tdefer rawfile.Close()\n\n\t// Calculate the buffer size.\n\tinfo, _ := rawfile.Stat()\n\trawbytes := make([]byte, info.Size())\n\n\t// Read rawfile content into buffer.\n\tbuffer := bufio.NewReader(rawfile)\n\t_, err = buffer.Read(rawbytes)\n\tif err != nil {\n\t\treturn err\n\t}\n\n\tvar buf bytes.Buffer\n\twriter := gzip.NewWriter(&buf)\n\twriter.Write(rawbytes)\n\twriter.Close()\n\n\terr = ioutil.WriteFile(source+\".gz\", buf.Bytes(), info.Mode())\n\tif err != nil {\n\t\treturn err\n\t}\n\n\t// Remove uncompressed.\n\tgo os.Remove(source)\n\n\treturn nil\n}", "title": "" }, { "docid": "79660b32e68069b9f2e4bfcc118bb190", "score": "0.5054862", "text": "func Encode(data []byte) string {\n\t// Factorio\n\tvar b bytes.Buffer\n\tencoder := base64.NewEncoder(base64.StdEncoding, &b)\n\tcompress := zlib.NewWriter(encoder)\n\tcompress.Write(data)\n\tcompress.Close()\n\tencoder.Close()\n\treturn b.String()\n}", "title": "" }, { "docid": "7ba1e0dccad40f0b2cf8ddc3335255c5", "score": "0.5047642", "text": "func (pk *PublicKey) Compress() *CompressedPublicKey {\n\n\t// Serialize X Coordinate\n\tcpk := new(CompressedPublicKey)\n\tcopy(cpk[1:], pk[:CoordinateSize])\n\n\t// Set header byte depending on parity of Y coordinate\n\tyIsEven := pk[PublicSize-1]%2 == 0\n\tif yIsEven {\n\t\tcpk[0] = HeaderCompressedEven\n\t} else {\n\t\tcpk[0] = HeaderCompressedOdd\n\t}\n\n\treturn cpk\n}", "title": "" }, { "docid": "5073416a8eec81297db469e22aa01754", "score": "0.5046583", "text": "func DeflateAndEncodeString(data []byte) string {\n\tcompressed := util.Compress(data)\n\treturn EncodeString(compressed)\n}", "title": "" }, { "docid": "ff63ac97e96790ef38427d8b728530a5", "score": "0.5038131", "text": "func Compress(str string) string {\n\tif len(str) < 3 {\n\t\treturn str\n\t}\n\tc := str[0]\n\tcount := 1\n\tres := string(c)\n\tfor i := 1; i < len(str); i++ {\n\t\tif str[i] == c {\n\t\t\tcount++\n\t\t} else {\n\t\t\tc = str[i]\n\t\t\tres += strconv.Itoa(count) + string(c)\n\t\t\tcount = 1\n\t\t}\n\t}\n\tres += strconv.Itoa(count)\n\tif len(str) <= len(res) {\n\t\treturn str\n\t}\n\treturn res\n}", "title": "" }, { "docid": "2660c75649613b12eb195cfceed46989", "score": "0.5030472", "text": "func Compress(data []byte, name string) ([]byte, error) {\n\tbuf := new(bytes.Buffer)\n\tw := zip.NewWriter(buf)\n\n\t//w.RegisterCompressor(zip.Deflate, func(out io.Writer) (io.WriteCloser, error) {\n\t//\treturn flate.NewWriter(out, flate.BestCompression)\n\t//})\n\n\tz, err := w.Create(name)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\t_, err = z.Write(data)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\terr = w.Close()\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\treturn buf.Bytes(), nil\n}", "title": "" }, { "docid": "780861ec0ca6c0022ae319357146ea83", "score": "0.50260824", "text": "func compressPrefixTree(root *huffmanTreeNode, to *vector.Vector) {\n\tswitch isLeafNode(root) {\n\tcase true:\n\t\tto.Append(byte(1))\n\t\tto.Append(root.value)\n\tcase false:\n\t\tto.Append(byte(0))\n\t\tcompressPrefixTree(root.left, to)\n\t\tcompressPrefixTree(root.right, to)\n\t}\n}", "title": "" }, { "docid": "82562627353c6d8896281c505f099f59", "score": "0.5008957", "text": "func Compress(input []byte) []byte {\n\tout := make([]byte, 0, len(input)/2) // estimate output size\n\tvar verb []byte\n\n\tfor len(input) > 0 {\n\t\tprefixLen := 0\n\t\tvar code byte\n\t\tn := &codeTrie\n\t\tfor i, c := range input {\n\t\t\tnext := n.branches[int(c)]\n\t\t\tif next == nil {\n\t\t\t\tbreak\n\t\t\t}\n\t\t\tn = next\n\t\t\tif n.terminal {\n\t\t\t\tprefixLen = i + 1\n\t\t\t\tcode = n.val\n\t\t\t}\n\t\t}\n\n\t\tif prefixLen > 0 {\n\t\t\tinput = input[prefixLen:]\n\t\t\tout = flushVerb(out, verb)\n\t\t\tverb = verb[:0]\n\t\t\tout = append(out, code)\n\t\t} else {\n\t\t\tverb = append(verb, input[0])\n\t\t\tinput = input[1:]\n\t\t}\n\t}\n\treturn flushVerb(out, verb)\n}", "title": "" }, { "docid": "016b0da9c21a95b7ed6d329fb7590c93", "score": "0.49999505", "text": "func base64encode(src []byte) string {\n\tvar buf bytes.Buffer\n\tencoder := base64.NewEncoder(base64.StdEncoding, &buf)\n\tencoder.Write(src)\n\tencoder.Close()\n\treturn buf.String()\n}", "title": "" }, { "docid": "e290341c0e3012443011be8d07cb940c", "score": "0.496848", "text": "func FileCompress(fd *os.File) ([]byte, error) {\n\tvar zlibBuffer bytes.Buffer\n\tzlibWriter, err := zlib.NewWriterLevel(&zlibBuffer, zlib.BestCompression)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\tdefer zlibWriter.Close()\n\t_, err = bufio.NewReader(fd).WriteTo(zlibWriter)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\tzlibWriter.Flush()\n\treturn zlibBuffer.Bytes(), nil\n}", "title": "" }, { "docid": "5956df9d66f2d7ded89777f8487109df", "score": "0.49609074", "text": "func bzipCompress(d []byte) ([]byte, error) {\n\tvar out bytes.Buffer\n\tcmd := exec.Command(\"bzip2\", \"-c\", \"-9\")\n\tcmd.Stdin = bytes.NewBuffer(d)\n\tcmd.Stdout = &out\n\terr := cmd.Run()\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\treturn out.Bytes(), nil\n}", "title": "" }, { "docid": "5cd98aa1c829d00c10c8002aa9063911", "score": "0.49573916", "text": "func DecodeAndInflateString(data string) ([]byte, error) {\n\tcompressedXML, err := DecodeString(data)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\tbXML := util.Decompress(compressedXML)\n\treturn bXML, nil\n}", "title": "" }, { "docid": "88d7fcd9536feec4df06cad4a090869d", "score": "0.49572417", "text": "func ZstdCompressBytes(src, dst []byte) []byte {\n\treturn globalZstdCompressor.EncodeAll(src, dst)\n}", "title": "" }, { "docid": "1c03704ab07d2bf6d8c3d5eac764069d", "score": "0.4951136", "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": "308964fa4aa1ec42ea8bca72f890f2d8", "score": "0.49483216", "text": "func (f genHelperEncoder) EncEncodeComplex128(v complex128) { f.e.encodeComplex128(v) }", "title": "" }, { "docid": "9f6e58b45949ec47dd1ee93c919f9e64", "score": "0.4937892", "text": "func base64Encode(src interface{}) (string, error) {\n\tif src == nil {\n\t\treturn \"\", consts.ErrNilInterface\n\t}\n\tsrcMarshal, err := json.Marshal(src)\n\tif err != nil {\n\t\treturn \"\", err\n\t}\n\tsrcString := string(srcMarshal)\n\t// TODO maybe use Trim\n\treturn strings.TrimRight(base64.URLEncoding.EncodeToString([]byte(srcString)), \"=\"), nil\n}", "title": "" }, { "docid": "f40c8b9899f9a256d6b124d195bba12d", "score": "0.49363938", "text": "func (s *Snappy) CompressBlob(ctx context.Context, data []byte) ([]byte, error) {\n\treturn gs.Encode(nil, data), nil\n}", "title": "" }, { "docid": "923e03e1806a0139a49f334da24df704", "score": "0.49159482", "text": "func compress(publicKey []byte) ([]byte, error) {\n\tif len(publicKey) == pubKeyBytesLenUncompressed-1 && publicKey[0] != compressedKeyPrefix {\n\t\tpublicKey = append([]byte{compressedKeyPrefix}, publicKey...)\n\t}\n\tif len(publicKey) != pubKeyBytesLenUncompressed {\n\t\treturn nil, errors.Errorf(\"length of uncompressed public key is invalid\")\n\t}\n\tx, y := elliptic.Unmarshal(ecies.DefaultCurve, publicKey)\n\n\treturn secp256k1.CompressPubkey(x, y), nil\n}", "title": "" }, { "docid": "55210c0f43d60f7fd8af3ef715c62adf", "score": "0.49077684", "text": "func main() {\n\tstr := []string{\"aabcccccaaa\", \"AAADFDFGFFGGGYYYY\", \"\", \"aa\", \"b\", \"bcc\", \"cdef\", \"ffggg\"}\n\tfor _, s := range str {\n\t\tcs := try1.Compress(s)\n\t\tfmt.Printf(\"%s compressed to %s\\n\", s, cs)\n\t}\n}", "title": "" }, { "docid": "0a5a377f4a193a66071c88f945203202", "score": "0.48996386", "text": "func Base64MimeEncoder(b string) (m string) {\n\n\tm = base64.StdEncoding.EncodeToString([]byte(b))\n\tthe_len := len(m)\n\n\tif (the_len <= maxLen) {\n\t\treturn m\n\t}\n\n\tnew_m := []byte(m)\n\n\t// set the slice capacity to the slice len + each newline delimiters\n\tm1 := make([]byte, 0, the_len+(len(delimiter)*int(the_len/maxLen)))\n\tii := 0\n\tfor i := 0; i < int(the_len/maxLen); i++ {\n\t\tm1 = append(m1, new_m[i*maxLen:(i+1)*maxLen]...)\n\t\tm1 = append(m1, delimiter...)\n\t\tii++\n\t}\n\tm1 = append(m1, new_m[ii*maxLen:the_len]...)\n\tm = string(m1)\n\treturn m\n}", "title": "" }, { "docid": "ca90418a75570f0d77251655704e090a", "score": "0.48928672", "text": "func Compress(inPath string, tmpDir string) (string, error) {\n\t// create a temporary file with a unique name compress it -- multiple files\n\t// are named 000: pg_notify/0000, pg_subtrans/0000\n\toutFile, err := ioutil.TempFile(tmpDir, \"pgCarpenter.\")\n\tif err != nil {\n\t\treturn \"\", err\n\t}\n\n\t// open input file\n\tinFile, err := os.Open(inPath)\n\tif err != nil {\n\t\treturn \"\", err\n\t}\n\t// we open this for read only, and this process exists after a finite (short)\n\t// period of time; there's no need to throw an error if closing it fails\n\tdefer inFile.Close()\n\n\t// buffer read from the input file and lz4 writer\n\tr := bufio.NewReader(inFile)\n\tw := lz4.NewWriter(outFile)\n\n\t// read 4k at a time\n\tbuf := make([]byte, 4096)\n\tfor {\n\t\tn, err := r.Read(buf)\n\t\tif err != nil && err != io.EOF {\n\t\t\treturn \"\", err\n\t\t}\n\n\t\t// we're done\n\t\tif n == 0 {\n\t\t\tbreak\n\t\t}\n\n\t\t// write the 4k chunk\n\t\tif _, err := w.Write(buf[:n]); err != nil {\n\t\t\treturn \"\", err\n\t\t}\n\t}\n\n\t// flush any pending compressed data\n\tif err = w.Flush(); err != nil {\n\t\treturn \"\", err\n\t}\n\n\t// make sure we successfully close the compressed file\n\tif err := outFile.Close(); err != nil {\n\t\treturn \"\", err\n\t}\n\n\treturn outFile.Name(), nil\n}", "title": "" }, { "docid": "2fe9aff676789f4242bc9eda21ba94cc", "score": "0.48825917", "text": "func ExportAsBase64String(insta *goinsta.Instagram) (string, error) {\n\tbytes, err := ExportAsBytes(insta)\n\tif err != nil {\n\t\treturn \"\", err\n\t}\n\n\tsEnc := base64.StdEncoding.EncodeToString(bytes)\n\treturn sEnc, nil\n}", "title": "" }, { "docid": "06f93b7404560323744c4d40a30075c6", "score": "0.48822173", "text": "func (o *Minifier) Minify(m *minify.M, w io.Writer, r io.Reader, _ map[string]string) error {\n\tvar tag svg.Hash\n\tdefaultStyleType := \"text/css\"\n\tdefaultInlineStyleType := \"text/css;inline=1\"\n\n\tminifyBuffer := buffer.NewWriter(make([]byte, 0, 64))\n\tattrByteBuffer := make([]byte, 0, 64)\n\n\tl := xml.NewLexer(r)\n\ttb := NewTokenBuffer(l)\n\tfor {\n\t\tt := *tb.Shift()\n\tSWITCH:\n\t\tswitch t.TokenType {\n\t\tcase xml.ErrorToken:\n\t\t\tif l.Err() == io.EOF {\n\t\t\t\treturn nil\n\t\t\t}\n\t\t\treturn l.Err()\n\t\tcase xml.TextToken:\n\t\t\tt.Data = parse.ReplaceMultipleWhitespace(parse.TrimWhitespace(t.Data))\n\t\t\tif tag == svg.Style && len(t.Data) > 0 {\n\t\t\t\tif err := m.Minify(defaultStyleType, w, buffer.NewReader(t.Data)); err != nil {\n\t\t\t\t\tif err == minify.ErrNotExist { // no minifier, write the original\n\t\t\t\t\t\tif _, err := w.Write(t.Data); err != nil {\n\t\t\t\t\t\t\treturn err\n\t\t\t\t\t\t}\n\t\t\t\t\t} else {\n\t\t\t\t\t\treturn err\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t} else if _, err := w.Write(t.Data); err != nil {\n\t\t\t\treturn err\n\t\t\t}\n\t\tcase xml.CDATAToken:\n\t\t\tif tag == svg.Style {\n\t\t\t\tminifyBuffer.Reset()\n\t\t\t\tif err := m.Minify(defaultStyleType, minifyBuffer, buffer.NewReader(t.Text)); err != nil && err != minify.ErrNotExist {\n\t\t\t\t\treturn err\n\t\t\t\t} else if err != minify.ErrNotExist {\n\t\t\t\t\tt.Data = append(t.Data[:9], minifyBuffer.Bytes()...)\n\t\t\t\t\tt.Text = t.Data[9:]\n\t\t\t\t\tt.Data = append(t.Data, cdataEndBytes...)\n\t\t\t\t}\n\t\t\t}\n\t\t\tvar useText bool\n\t\t\tif t.Text, useText = xml.EscapeCDATAVal(&attrByteBuffer, t.Text); useText {\n\t\t\t\tt.Text = parse.ReplaceMultipleWhitespace(parse.TrimWhitespace(t.Text))\n\t\t\t\tif _, err := w.Write(t.Text); err != nil {\n\t\t\t\t\treturn err\n\t\t\t\t}\n\t\t\t} else if _, err := w.Write(t.Data); err != nil {\n\t\t\t\treturn err\n\t\t\t}\n\t\tcase xml.StartTagPIToken:\n\t\t\tfor {\n\t\t\t\tif t := *tb.Shift(); t.TokenType == xml.StartTagClosePIToken || t.TokenType == xml.ErrorToken {\n\t\t\t\t\tbreak\n\t\t\t\t}\n\t\t\t}\n\t\tcase xml.StartTagToken:\n\t\t\ttag = t.Hash\n\t\t\tif containerTagMap[t.Hash] { // skip empty containers\n\t\t\t\ti := 0\n\t\t\t\tfor {\n\t\t\t\t\tnext := tb.Peek(i)\n\t\t\t\t\ti++\n\t\t\t\t\tif next.TokenType == xml.EndTagToken && next.Hash == t.Hash || next.TokenType == xml.StartTagCloseVoidToken || next.TokenType == xml.ErrorToken {\n\t\t\t\t\t\tfor j := 0; j < i; j++ {\n\t\t\t\t\t\t\ttb.Shift()\n\t\t\t\t\t\t}\n\t\t\t\t\t\tbreak SWITCH\n\t\t\t\t\t} else if next.TokenType != xml.AttributeToken && next.TokenType != xml.StartTagCloseToken {\n\t\t\t\t\t\tbreak\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t} else if t.Hash == svg.Metadata {\n\t\t\t\tfor {\n\t\t\t\t\tif next := *tb.Shift(); (next.TokenType == xml.EndTagToken || next.TokenType == xml.StartTagCloseVoidToken) && next.Hash == t.Hash || next.TokenType == xml.ErrorToken {\n\t\t\t\t\t\tbreak\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tbreak\n\t\t\t}\n\t\t\tif _, err := w.Write(t.Data); err != nil {\n\t\t\t\treturn err\n\t\t\t}\n\t\tcase xml.AttributeToken:\n\t\t\tif len(t.AttrVal) == 0 {\n\t\t\t\tcontinue\n\t\t\t}\n\t\t\tattr := t.Hash\n\t\t\tval := t.AttrVal\n\t\t\tif tag == svg.Svg && attr == svg.Version {\n\t\t\t\tcontinue\n\t\t\t}\n\n\t\t\tif _, err := w.Write(spaceBytes); err != nil {\n\t\t\t\treturn err\n\t\t\t}\n\t\t\tif _, err := w.Write(t.Text); err != nil {\n\t\t\t\treturn err\n\t\t\t}\n\t\t\tif _, err := w.Write(isBytes); err != nil {\n\t\t\t\treturn err\n\t\t\t}\n\n\t\t\tif tag == svg.Svg && attr == svg.ContentStyleType {\n\t\t\t\tval = minify.ContentType(val)\n\t\t\t\tdefaultStyleType = string(val)\n\t\t\t\tdefaultInlineStyleType = defaultStyleType + \";inline=1\"\n\t\t\t} else if attr == svg.Style {\n\t\t\t\tminifyBuffer.Reset()\n\t\t\t\tif m.Minify(defaultInlineStyleType, minifyBuffer, buffer.NewReader(val)) == nil {\n\t\t\t\t\tval = minifyBuffer.Bytes()\n\t\t\t\t}\n\t\t\t} else if attr == svg.D {\n\t\t\t\tval = shortenPathData(val)\n\t\t\t} else if attr == svg.ViewBox {\n\t\t\t\tj := 0\n\t\t\t\tnewVal := val[:0]\n\t\t\t\tfor i := 0; i < 4; i++ {\n\t\t\t\t\tif i != 0 {\n\t\t\t\t\t\tif j >= len(val) || val[j] != ' ' && val[j] != ',' {\n\t\t\t\t\t\t\tnewVal = append(newVal, val[j:]...)\n\t\t\t\t\t\t\tbreak\n\t\t\t\t\t\t}\n\t\t\t\t\t\tnewVal = append(newVal, ' ')\n\t\t\t\t\t\tj++\n\t\t\t\t\t}\n\t\t\t\t\tif dim, n := shortenDimension(val[j:]); n > 0 {\n\t\t\t\t\t\tnewVal = append(newVal, dim...)\n\t\t\t\t\t\tj += n\n\t\t\t\t\t} else {\n\t\t\t\t\t\tnewVal = append(newVal, val[j:]...)\n\t\t\t\t\t\tbreak\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tval = newVal\n\t\t\t} else if colorAttrMap[attr] && len(val) > 0 {\n\t\t\t\tparse.ToLower(val)\n\t\t\t\tif val[0] == '#' {\n\t\t\t\t\tif name, ok := minifyCSS.ShortenColorHex[string(val)]; ok {\n\t\t\t\t\t\tval = name\n\t\t\t\t\t} else if len(val) == 7 && val[1] == val[2] && val[3] == val[4] && val[5] == val[6] {\n\t\t\t\t\t\tval[2] = val[3]\n\t\t\t\t\t\tval[3] = val[5]\n\t\t\t\t\t\tval = val[:4]\n\t\t\t\t\t}\n\t\t\t\t} else if hex, ok := minifyCSS.ShortenColorName[css.ToHash(val)]; ok {\n\t\t\t\t\tval = hex\n\t\t\t\t} else if len(val) > 5 && parse.Equal(val[:4], []byte(\"rgb(\")) && val[len(val)-1] == ')' {\n\t\t\t\t\t// TODO: handle rgb(x, y, z) and hsl(x, y, z)\n\t\t\t\t}\n\t\t\t} else if n, m := parse.Dimension(val); n+m == len(val) { // TODO: inefficient, temporary measure\n\t\t\t\tval, _ = shortenDimension(val)\n\t\t\t}\n\n\t\t\t// prefer single or double quotes depending on what occurs more often in value\n\t\t\tval = xml.EscapeAttrVal(&attrByteBuffer, val)\n\t\t\tif _, err := w.Write(val); err != nil {\n\t\t\t\treturn err\n\t\t\t}\n\t\tcase xml.StartTagCloseToken:\n\t\t\tnext := tb.Peek(0)\n\t\t\tskipExtra := false\n\t\t\tif next.TokenType == xml.TextToken && parse.IsAllWhitespace(next.Data) {\n\t\t\t\tnext = tb.Peek(1)\n\t\t\t\tskipExtra = true\n\t\t\t}\n\t\t\tif next.TokenType == xml.EndTagToken {\n\t\t\t\t// collapse empty tags to single void tag\n\t\t\t\ttb.Shift()\n\t\t\t\tif skipExtra {\n\t\t\t\t\ttb.Shift()\n\t\t\t\t}\n\t\t\t\tif _, err := w.Write(voidBytes); err != nil {\n\t\t\t\t\treturn err\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\tif _, err := w.Write(t.Data); err != nil {\n\t\t\t\t\treturn err\n\t\t\t\t}\n\t\t\t}\n\t\tcase xml.StartTagCloseVoidToken:\n\t\t\ttag = 0\n\t\t\tif _, err := w.Write(t.Data); err != nil {\n\t\t\t\treturn err\n\t\t\t}\n\t\tcase xml.EndTagToken:\n\t\t\ttag = 0\n\t\t\tif len(t.Data) > 2+len(t.Text) {\n\t\t\t\tt.Data[2+len(t.Text)] = '>'\n\t\t\t\tif _, err := w.Write(t.Data[:2+len(t.Text)+1]); err != nil {\n\t\t\t\t\treturn err\n\t\t\t\t}\n\t\t\t} else if _, err := w.Write(t.Data); err != nil {\n\t\t\t\treturn err\n\t\t\t}\n\t\t}\n\t}\n}", "title": "" }, { "docid": "a7348e6b347a45cd3b9211a54b7714ed", "score": "0.48732793", "text": "func CompressIndex(ctx context.Context, dbo Database) error {\n\tdb := dbo.(*database)\n\tsql := db.getRawDB()\n\n\tconn, err := sql.Conn(ctx)\n\tif err != nil {\n\t\treturn err\n\t}\n\tdefer conn.Close()\n\n\ttx, err := conn.BeginTx(ctx, nil)\n\tif err != nil {\n\t\treturn err\n\t}\n\tdefer func() {\n\t\tif tx != nil {\n\t\t\ttx.Rollback()\n\t\t}\n\t}()\n\n\t_, err = tx.ExecContext(ctx, `update docs set txt=compress(txt) where not iscompressed(txt)`)\n\tif err != nil {\n\t\treturn err\n\t}\n\n\terr = tx.Commit()\n\tif err != nil {\n\t\treturn err\n\t}\n\n\ttx = nil\n\treturn nil\n}", "title": "" }, { "docid": "624a5d7ad73f565bfdcf7824ae3e8edf", "score": "0.48625368", "text": "func (c *ZstdCompressor) Compress(in io.Reader) error {\n\t_, err := io.Copy(c.encoder, in)\n\tif err != nil {\n\t\tc.encoder.Close()\n\t\treturn err\n\t}\n\n\treturn nil\n}", "title": "" }, { "docid": "986128f1cc05b3af022f84c9eeea54af", "score": "0.48623365", "text": "func compressByte(src []byte) []byte {\n\tcompressedData := new(bytes.Buffer)\n\tcompress(src, compressedData, 9)\n\treturn compressedData.Bytes()\n}", "title": "" }, { "docid": "183387e717976d84dd3ead866853b9a8", "score": "0.48550874", "text": "func ZstdCompress(in io.Reader, out io.Writer, opts ...zstd.EOption) error {\n\tenc, err := NewZstdCompressor(out, opts...)\n\tif err != nil {\n\t\treturn err\n\t}\n\n\tif err = enc.Compress(in); err != nil {\n\t\tenc.Close()\n\t\treturn err\n\t}\n\n\treturn enc.Close()\n}", "title": "" }, { "docid": "6d0356e302cb06289b93e3ecbafa756f", "score": "0.4851863", "text": "func (b *Builder) compressData(data []byte) ([]byte, error) {\n\tswitch b.opts.Compression {\n\tcase options.None:\n\t\treturn data, nil\n\tcase options.Snappy:\n\t\tsz := snappy.MaxEncodedLen(len(data))\n\t\tdst := b.alloc.Allocate(sz)\n\t\treturn snappy.Encode(dst, data), nil\n\tcase options.ZSTD:\n\t\tsz := y.ZSTDCompressBound(len(data))\n\t\tdst := b.alloc.Allocate(sz)\n\t\treturn y.ZSTDCompress(dst, data, b.opts.ZSTDCompressionLevel)\n\t}\n\treturn nil, errors.New(\"Unsupported compression type\")\n}", "title": "" }, { "docid": "eb1c29db1b2d550423ff45e8ecd1ed32", "score": "0.48450172", "text": "func (k *PublicKey) StringUncompressed() (string, error) {\n\tp, err := k.Point()\n\tif err != nil {\n\t\treturn \"\", err\n\t}\n\treturn hexutil.Encode(LongMarshal(p)), nil\n}", "title": "" }, { "docid": "3351d507c80a8213b88156b1087a18d9", "score": "0.4833663", "text": "func (s *server) compressedKey(prefix string, digest *pb.Digest, compressed bool) string {\n\tif compressed {\n\t\treturn s.key(\"zstd_\"+prefix, digest)\n\t}\n\treturn s.key(prefix, digest)\n}", "title": "" }, { "docid": "d54afc9c4899874ef2cbcf5fb7c077d6", "score": "0.48314947", "text": "func textify(src []byte) string {\n\treturn base64.StdEncoding.EncodeToString(src)\n}", "title": "" }, { "docid": "8e070f2e096ce03dc814197dedc0a420", "score": "0.4824438", "text": "func Base64Encoder(asBytes Bytes16) string {\n\treturn base64.StdEncoding.EncodeToString(asBytes[:])\n}", "title": "" }, { "docid": "e5317b7c72507eace05db0c8f9d85fcc", "score": "0.48227018", "text": "func (s Signature) Base64() ([]byte, error) {\n\treturn jose.Base64Encode(s), nil\n}", "title": "" }, { "docid": "b76038eaa7d281d719e904e7502f0795", "score": "0.48168755", "text": "func (c *compress) String() string {\n\treturn fmt.Sprint(*c)\n}", "title": "" }, { "docid": "62f22f77b75536b5cc86551a45dc346b", "score": "0.48166043", "text": "func writeCompressedToHTTP(compression string, data []byte, subvol *dvid.Subvolume, w http.ResponseWriter) error {\n\tvar err error\n\tw.Header().Set(\"Content-type\", \"application/octet-stream\")\n\tswitch compression {\n\tcase \"\":\n\t\t_, err = w.Write(data)\n\t\tif err != nil {\n\t\t\treturn err\n\t\t}\n\tcase \"lz4\":\n\t\tcompressed := make([]byte, lz4.CompressBound(data))\n\t\tvar n, outSize int\n\t\tif outSize, err = lz4.Compress(data, compressed); err != nil {\n\t\t\treturn err\n\t\t}\n\t\tcompressed = compressed[:outSize]\n\t\tif n, err = w.Write(compressed); err != nil {\n\t\t\treturn err\n\t\t}\n\t\tif n != outSize {\n\t\t\terrmsg := fmt.Sprintf(\"Only able to write %d of %d lz4 compressed bytes\\n\", n, outSize)\n\t\t\tdvid.Errorf(errmsg)\n\t\t\treturn err\n\t\t}\n\tcase \"gzip\":\n\t\tgw := gzip.NewWriter(w)\n\t\tif _, err = gw.Write(data); err != nil {\n\t\t\treturn err\n\t\t}\n\t\tif err = gw.Close(); err != nil {\n\t\t\treturn err\n\t\t}\n\tcase \"google\", \"googlegzip\": // see neuroglancer for details of compressed segmentation format\n\t\tdatagoogle, err := compressGoogle(data, subvol)\n\t\tif err != nil {\n\t\t\treturn err\n\t\t}\n\t\tif compression == \"googlegzip\" {\n\t\t\tw.Header().Set(\"Content-encoding\", \"gzip\")\n\t\t\tgw := gzip.NewWriter(w)\n\t\t\tif _, err = gw.Write(datagoogle); err != nil {\n\t\t\t\treturn err\n\t\t\t}\n\t\t\tif err = gw.Close(); err != nil {\n\t\t\t\treturn err\n\t\t\t}\n\n\t\t} else {\n\t\t\t_, err = w.Write(datagoogle)\n\t\t\tif err != nil {\n\t\t\t\treturn err\n\t\t\t}\n\t\t}\n\tdefault:\n\t\treturn fmt.Errorf(\"unknown compression type %q\", compression)\n\t}\n\treturn nil\n}", "title": "" }, { "docid": "5fe36bee4e4784d92ce60fdf770b5542", "score": "0.48096094", "text": "func Base64(str []byte, alphaSet ...string) string {\n\tencoding := base64.StdEncoding\n\tif len(alphaSet) != 0 && alphaSet[0] != \"\" {\n\t\tencoding = base64.NewEncoding(alphaSet[0])\n\t}\n\treturn encoding.EncodeToString(str)\n}", "title": "" }, { "docid": "17d4e0505c4975dce3889f27eb66278c", "score": "0.48048466", "text": "func compress(file_path string) error {\n\n\tfile, err := os.Open(file_path)\n\n\tif err != nil {\n\t\treturn err\n\t}\n\n\tdefer file.Close()\n\n\tnewFile, err := os.Create(file_path + \".gz\")\n\n\tif err != nil {\n\t\treturn err\n\t}\n\n\tdefer newFile.Close()\n\n\tgzipOut := gzip.NewWriter(newFile)\n\n\t_, err = io.Copy(newFile, file)\n\n\tgzipOut.Close()\n\n\treturn err\n\n}", "title": "" }, { "docid": "42cb93ffaac4fd134f64d9cc0ba7cfe2", "score": "0.48024952", "text": "func compress(fileName string) string {\n\tzipper := new(archivex.ZipFile)\n\tzipper.Create(fileName)\n\n\t// Setting permissions on file to os.ModePerm or 0777 doesn't seem to keep the proper permissions.\n\t// So use the file's own?\n\t// aegisAppFileInfo, _ := os.Stat(aegisAppName)\n\n\t// Create a header for aegis_app to retain permissions?\n\theader := &zip.FileHeader{\n\t\tName: \"aegis_app\",\n\t\tMethod: zip.Store,\n\t\tModifiedTime: uint16(time.Now().UnixNano()),\n\t\tModifiedDate: uint16(time.Now().UnixNano()),\n\t}\n\t// os.ModePerm = -rwxrwxrwx\n\theader.SetMode(os.ModePerm)\n\t// log.Println(\"aegis_app file mode:\", aegisAppFileInfo.Mode())\n\t// header.SetMode(aegisAppFileInfo.Mode())\n\tzipWriter, _ := zipper.Writer.CreateHeader(header)\n\t// log.Println(\"zip header\", header)\n\n\tcontent, err := ioutil.ReadFile(aegisAppName)\n\tif err == nil {\n\t\tzipWriter.Write(content)\n\t}\n\n\t// Add the compiled Go app\n\t// zipper.AddFile(aegisAppName) <-- maybe this is writing w/o the header... have to use the writer returned by CreateHeader()??\n\tzipper.Close()\n\n\tpwd, _ := os.Getwd()\n\tbuiltZip := filepath.Join(pwd, fileName)\n\t// Set the config\n\tcfg.Lambda.SourceZip = builtZip\n\n\treturn builtZip\n}", "title": "" }, { "docid": "66931ca66d9611766b174dde9a322ead", "score": "0.4800583", "text": "func compress(filename string) error {\n\tin, err := os.Open(filename)\n\tif err != nil {\n\t\treturn err\n\t}\n\tdefer in.Close()\n\n\tout, err := os.Create(filename + \".gz\")\n\tif err != nil {\n\t\treturn err\n\t}\n\tdefer out.Close()\n\n\tgzout := gzip.NewWriter(out)\n\t_, err = io.Copy(gzout, in)\n\tgzout.Close()\n\n\treturn err\n}", "title": "" }, { "docid": "fb81b5af080f88732537ad861dcf08a0", "score": "0.47929585", "text": "func (q *CompoundQuery) GetCompressedQuery() []byte {\n\treturn flateCompressor.MustCompressString(\n\t\tojson.MarshalJSON(q),\n\t)\n}", "title": "" }, { "docid": "c887a32d7a8695d3244130dc0ffdf77e", "score": "0.4787343", "text": "func enc(data interface{}) []byte {\n\tvar buf bytes.Buffer\n\twriter := gzip.NewWriter(&buf)\n\tec := gob.NewEncoder(writer)\n\tif err := ec.Encode(data); err != nil {\n\t\tpanic(err)\n\t}\n\tif err := writer.Close(); err != nil {\n\t\tpanic(err)\n\t}\n\treturn buf.Bytes()\n}", "title": "" }, { "docid": "a6dec191a84e8a834802555b5629fc70", "score": "0.47869146", "text": "func EncodedString(data interface{}) (string, error) {\n\tsaml, err := String(data)\n\tif err != nil {\n\t\treturn \"\", err\n\t}\n\n\tb64XML := EncodeString([]byte(saml))\n\treturn b64XML, nil\n}", "title": "" }, { "docid": "76159f30693070fba6bc8e5ddd117d8e", "score": "0.4776", "text": "func base64Encode(src []byte) string {\n\tbuf := make([]byte, base64EncodedLen(len(src)))\n\n\t// mehhhhh actually base64 encoding is a bit more involved\n\t// and it feels like not a good use of time to implement it myself right now,\n\t// I should come back to it. Basically you take 3 bytes of input,\n\t// and then break it into 4 groups of 6 bits, and then encode that\n\t// to produce 4 bytes of base64\n\tbase64.StdEncoding.Encode(buf, src)\n\treturn string(buf)\n}", "title": "" }, { "docid": "86e1936bf9d6431d05f7f9c0963af0f8", "score": "0.47736123", "text": "func (f genHelperEncoder) EncBinaryMarshal(iv encoding.BinaryMarshaler) {\n\tbs, fnerr := iv.MarshalBinary()\n\tf.e.marshalRaw(bs, fnerr)\n}", "title": "" }, { "docid": "a5b0dada8c669419568d0415d8442f40", "score": "0.47669727", "text": "func CompressBytes(data []byte) []byte {\n\tif len(data) == 0 {\n\t\treturn []byte{}\n\t}\n\t// zip data in standard manner\n\tvar b bytes.Buffer\n\tw := zlib.NewWriter(&b)\n\t_, err := w.Write(data)\n\tw.Close()\n\t//\n\t// log any problem\n\tconst ERRM = \"Failed compressing data with zlib:\"\n\tif err != nil {\n\t\tmod.Error(ERRM, err)\n\t\treturn []byte{}\n\t}\n\tret := b.Bytes()\n\tif len(ret) < 3 {\n\t\tmod.Error(ERRM, \"length < 3\")\n\t\treturn []byte{}\n\t}\n\treturn ret\n}", "title": "" }, { "docid": "79ecc84ffa64e4bfc5564cf1841ae049", "score": "0.47653788", "text": "func (m *Matrix) Compress() ([]byte, error) {\n\treturn cmp.CompressBytes(m.ToBytes())\n}", "title": "" }, { "docid": "2ce48f86bde6534173b51191354bad4c", "score": "0.4726183", "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": "6dbffd44a0c448e0dc261b8d2e9abf50", "score": "0.47191224", "text": "func compress(n uint64) ([]byte, error) {\n\t/* Output buffer */\n\tbuf := &bytes.Buffer{}\n\t/* Compressor, which stores to buf */\n\tzw, err := gzip.NewWriterLevel(buf, gzip.BestCompression)\n\tif nil != err {\n\t\treturn nil, err\n\t}\n\t/* Write zeros to the compressor */\n\tvar (\n\t\tzeros = make([]byte, COMPRESSCHUNK) /* Zeros to compress */\n\t\ttot = uint64(0) /* Number written */\n\t)\n\tfor tot < n {\n\t\t/* For the last chunk, only write as many zeros as we need */\n\t\tif uint64(len(zeros)) > n-tot {\n\t\t\tzeros = zeros[:n-tot]\n\t\t}\n\t\t/* Write zeros to the compressor */\n\t\tnw, err := zw.Write(zeros)\n\t\tif nil != err {\n\t\t\treturn nil, err\n\t\t}\n\t\ttot += uint64(nw)\n\t}\n\tif err := zw.Close(); nil != err {\n\t\treturn nil, err\n\t}\n\treturn buf.Bytes(), nil\n}", "title": "" }, { "docid": "2f68de600d36d7bb31c4664a3646a36d", "score": "0.47099185", "text": "func bytesEncode(data *encryptedData) ([]byte, error) {\n\tif err := data.verify(); err != nil {\n\t\treturn nil, errors.WithMessage(err, \"encrypted data is invalid\")\n\t}\n\tcompressedKey, err := compress(data.EphemeralPublicKey)\n\tif err != nil {\n\t\treturn nil, errors.WithMessage(err, \"could not compress EphemeralPublicKey\")\n\t}\n\tencodedData := make([]byte, 1+len(data.InitializationVector)+len(compressedKey)+len(data.MessageAuthenticationCode)+len(data.Ciphertext))\n\tencodedData[0] = cipher.AES256CBC\n\tcopy(encodedData[1:], data.InitializationVector)\n\tcopy(encodedData[1+len(data.InitializationVector):], compressedKey)\n\tcopy(encodedData[1+len(data.InitializationVector)+len(compressedKey):], data.MessageAuthenticationCode)\n\tcopy(encodedData[1+len(data.InitializationVector)+len(compressedKey)+len(data.MessageAuthenticationCode):], data.Ciphertext)\n\treturn encodedData, nil\n}", "title": "" }, { "docid": "cb9b0401b46d31fd6eb1bc1e5b66e2af", "score": "0.47072276", "text": "func genZIP(debug, logger *log.Logger, noMtime, noCompress bool, src string) (string, error) {\n\tbuf := &bytes.Buffer{}\n\n\tw := zip.NewWriter(buf)\n\terr := filepath.Walk(src, func(path string, fi os.FileInfo, err error) error {\n\t\tif err != nil {\n\t\t\treturn err\n\t\t}\n\t\t// Ignore directories and hidden files.\n\t\t// No entry is needed for directories in a zip file.\n\t\t// Each file is represented with a path, no directory\n\t\t// entities are required to build the hierarchy.\n\t\tif fi.IsDir() || strings.HasPrefix(fi.Name(), \".\") {\n\t\t\treturn nil\n\t\t}\n\t\trelPath, err := filepath.Rel(src, path)\n\t\tif err != nil {\n\t\t\treturn err\n\t\t}\n\t\t/* #nosec */\n\t\tb, err := ioutil.ReadFile(path)\n\t\tif err != nil {\n\t\t\treturn err\n\t\t}\n\t\tfHeader, err := zip.FileInfoHeader(fi)\n\t\tif err != nil {\n\t\t\treturn err\n\t\t}\n\t\tif noMtime {\n\t\t\t// Always use the same modification time so that\n\t\t\t// the output is deterministic with respect to the file contents.\n\t\t\tfHeader.SetModTime(mtimeDate)\n\t\t}\n\t\tfHeader.Name = filepath.ToSlash(relPath)\n\t\tif !noCompress {\n\t\t\tfHeader.Method = zip.Deflate\n\t\t}\n\t\tf, err := w.CreateHeader(fHeader)\n\t\tif err != nil {\n\t\t\treturn err\n\t\t}\n\t\t_, err = f.Write(b)\n\t\treturn err\n\t})\n\tif err != nil {\n\t\treturn \"\", err\n\t}\n\terr = w.Close()\n\ts := &strings.Builder{}\n\tfor _, b := range buf.Bytes() {\n\t\tif b == '\\n' {\n\t\t\t_, err = s.WriteString(`\\n`)\n\t\t\tif err != nil {\n\t\t\t\tlogger.Println(\"Error writing to output string\")\n\t\t\t\tos.Exit(exSoftware)\n\t\t\t}\n\t\t\tcontinue\n\t\t}\n\t\tif b == '\\\\' {\n\t\t\t_, err = s.WriteString(`\\\\`)\n\t\t\tif err != nil {\n\t\t\t\tlogger.Println(\"Error writing to output string\")\n\t\t\t\tos.Exit(exSoftware)\n\t\t\t}\n\t\t\tcontinue\n\t\t}\n\t\tif b == '\"' {\n\t\t\t_, err = s.WriteString(`\\\"`)\n\t\t\tif err != nil {\n\t\t\t\tlogger.Println(\"Error writing to output string\")\n\t\t\t\tos.Exit(exSoftware)\n\t\t\t}\n\t\t\tcontinue\n\t\t}\n\t\tif (b >= 32 && b <= 126) || b == '\\t' {\n\t\t\terr = s.WriteByte(b)\n\t\t\tif err != nil {\n\t\t\t\tlogger.Println(\"Error writing byte to output string\")\n\t\t\t\tos.Exit(exSoftware)\n\t\t\t}\n\t\t\tcontinue\n\t\t}\n\t\tfmt.Fprintf(s, \"\\\\x%02x\", b)\n\t}\n\treturn s.String(), err\n}", "title": "" }, { "docid": "766ad0a3ae04b6b9f5f3db9e3d5b86cd", "score": "0.4700035", "text": "func encodeBase64(source []byte) string {\n\t// make a byte slice just big enough for the result of the encode operation\n\tdest := make([]byte, base64.StdEncoding.EncodedLen(len(source)))\n\t// encode it\n\tbase64.StdEncoding.Encode(dest, source)\n\t// convert this byte buffer to a string\n\treturn bytes.NewBuffer(dest).String()\n}", "title": "" }, { "docid": "433aee9f3c1cf4c4029b603f79e664b1", "score": "0.46970284", "text": "func (c *compressor) compress(data io.Reader) (io.Reader, error) {\n\tif c.writer == nil {\n\t\treturn data, nil\n\t}\n\n\tvar dataBytes bytes.Buffer\n\tif _, err := dataBytes.ReadFrom(data); err != nil {\n\t\treturn nil, err\n\t}\n\n\t// Reset c.buf to start with empty message\n\tc.buf.Reset()\n\tc.writer.Reset(&c.buf)\n\n\tif _, err := c.writer.Write(dataBytes.Bytes()); err != nil {\n\t\treturn nil, err\n\t}\n\n\tif err := c.writer.Close(); err != nil {\n\t\treturn nil, err\n\t}\n\n\treturn bytes.NewReader(c.buf.Bytes()), nil\n}", "title": "" }, { "docid": "a519230b8de8e74dd24ed9e25879d756", "score": "0.46959063", "text": "func (f genHelperEncoder) EncEncodeComplex64(v complex64) { f.e.encodeComplex64(v) }", "title": "" }, { "docid": "b0dbd3b129f0cdbbf66860540499d348", "score": "0.46909803", "text": "func (c *ZstdCompressor) CompressBytes(src []byte, dst []byte) []byte {\n\treturn c.encoder.EncodeAll(src, dst)\n}", "title": "" }, { "docid": "e575936fd668ecb64a18cf6a19862d3d", "score": "0.4689878", "text": "func (m *AlertMannager) unGzipBase64(message string) interface{} {\r\n\tvar messageStruct interface{}\r\n\tgzipByte, err := base64.URLEncoding.DecodeString(message)\r\n\tif err != nil {\r\n\t\tlog.Println(err)\r\n\t}\r\n\treader := bytes.NewReader(gzipByte)\r\n\tgzipReader, _ := gzip.NewReader(reader)\r\n\tdefer gzipReader.Close()\r\n\tjsonByte, _ := ioutil.ReadAll(gzipReader)\r\n\tjson.Unmarshal(jsonByte, &messageStruct)\r\n\treturn messageStruct\r\n}", "title": "" }, { "docid": "d5a82db61d4747e2d2cbb4a66e0d463b", "score": "0.46888152", "text": "func (r *Registry) Compress(alg string, data []byte) ([]byte, error) {\n\t// resolve compression algorithm\n\talgorithm, err := r.resolveAlgorithm(alg)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\t// compress data using specified algorithm\n\tresult, err := algorithm.Compress(data)\n\tif err != nil {\n\t\treturn nil, fmt.Errorf(\"compression failed for algorithm[%s]: %s\", alg, err.Error())\n\t}\n\n\treturn result, nil\n}", "title": "" }, { "docid": "39952c7d60c8a5c328fee7fbba57358e", "score": "0.46879455", "text": "func base64encode(v string) string {\n\treturn base64.StdEncoding.EncodeToString([]byte(v))\n}", "title": "" }, { "docid": "1ababfe9550ba8432a4c306d8f860e4a", "score": "0.46863955", "text": "func (o JobExtractOutput) Compression() pulumi.StringPtrOutput {\n\treturn o.ApplyT(func(v JobExtract) *string { return v.Compression }).(pulumi.StringPtrOutput)\n}", "title": "" }, { "docid": "e66f9edf133c919b655b772283fb5e7c", "score": "0.4682927", "text": "func base64Encode(src string) string {\n\treturn strings.\n\t\tTrimRight(base64.URLEncoding.\n\t\t\tEncodeToString([]byte(src)), \"=\")\n}", "title": "" }, { "docid": "302137921e440c92415ef2d7fc24cf07", "score": "0.46816388", "text": "func Base64Encode(src string) string {\n\treturn base64.StdEncoding.EncodeToString([]byte(src))\n}", "title": "" }, { "docid": "564730380cb835a59b85299cb48e3c25", "score": "0.46813092", "text": "func (c *Context) compressedJSON(code int, response interface{}) {\n\t// create header\n\tc.SetHeader(contentEncoding, gzipContentEncoding)\n\t// Gzip data\n\tc.Status(code)\n\n\tgz := c.HandlerContext.Mint.gzipWriterPool.Get().(*gzip.Writer)\n\tbytes := c.HandlerContext.Mint.bufferPool.Get()\n\tgz.Reset(c.Res)\n\terr := json.NewEncoder(bytes).Encode(response)\n\tif err != nil {\n\t\tc.Error(err)\n\t}\n\tsize, err := gz.Write(bytes.Bytes())\n\tc.HandlerContext.Mint.bufferPool.Put(bytes)\n\n\tif err != nil {\n\t\tc.Errors(err)\n\t}\n\tc.setSize(size)\n\tsize, err = gz.Write(newLine)\n\tc.setSize(size)\n\n\tif err != nil {\n\t\tc.Errors(err)\n\t}\n\tgz.Close()\n\tc.HandlerContext.Mint.gzipWriterPool.Put(gz)\n}", "title": "" }, { "docid": "21177343c13a4f780f16a63fef9a5c07", "score": "0.46754345", "text": "func Base64Encode(src []byte) []byte {\n\treturn DefaultEncoding.Base64Encode(src)\n}", "title": "" }, { "docid": "08e7eb50550a886dbc12523f00b88e5d", "score": "0.4673457", "text": "func runtimeEncodeBase64(ic *interop.Context) error {\n\tsrc := ic.VM.Estack().Pop().Bytes()\n\tresult := base64.StdEncoding.EncodeToString(src)\n\tic.VM.Estack().PushVal([]byte(result))\n\treturn nil\n}", "title": "" }, { "docid": "7bbd7621b4a7d8e4435287546f963261", "score": "0.4672053", "text": "func (s *segment) Compress() error {\n\tif s.gReader != nil {\n\t\treturn ErrImmutableSegment // segment is already compressed and is immutable\n\t}\n\ts.appender.Close()\n\tif s.gReader != nil {\n\t\ts.gReader.Close()\n\t}\n\tf, err := os.OpenFile(s.path+CompressedExt, os.O_CREATE|os.O_WRONLY, 0600)\n\tif err != nil {\n\t\treturn err\n\t}\n\tgWriter := gzip.NewWriter(f)\n\t_, err = s.rFile.Seek(0, 0)\n\tif err != nil {\n\t\treturn err\n\t}\n\t_, err = io.Copy(gWriter, s.rFile)\n\tif err != nil {\n\t\treturn err\n\t}\n\terr = gWriter.Flush()\n\tif err != nil {\n\t\treturn err\n\t}\n\tgWriter.Close()\n\ts.rFile.Close()\n\ts.appender.Close()\n\treturn os.Remove(s.filename)\n}", "title": "" }, { "docid": "71aba403bd4c22021c5aeb9ba5d50038", "score": "0.4670417", "text": "func collate(xdrList []string) string {\n // we will use collated to collate all the transactions\n collated := decodeFromBase64(xdrList[0])\n\n for _, xdr := range xdrList[1:] {\n tx := decodeFromBase64(xdr)\n // implementations should take precautions before combining signatures, including but not limited to: deduping signatures, verifying signatures, checking that the transactions are the same, etc.\n collated.E.Signatures = append(collated.E.Signatures, tx.E.Signatures...)\n }\n\n collatedXdr, e := collated.Base64()\n if e != nil {\n log.Fatal(\"failed to convert to base64:\", e)\n }\n return collatedXdr\n}", "title": "" }, { "docid": "34e8f74bc5bbc67588e5f9c84de5bc53", "score": "0.46638525", "text": "func (g *GRPC) compressHandler(next http.Handler) http.Handler {\n\treturn http.HandlerFunc(\n\t\tfunc(w http.ResponseWriter, r *http.Request) {\n\t\t\t// Certainly types of return content, indicated by file extentions, should not get gzip compression as\n\t\t\t// they are already compressed.\n\t\t\tif doNotCompress[strings.ToLower(path.Ext(r.URL.Path))] {\n\t\t\t\tnext.ServeHTTP(w, r)\n\t\t\t\treturn\n\t\t\t}\n\t\t\tif contentEncoding := r.Header.Get(\"Content-Encoding\"); contentEncoding != \"\" {\n\t\t\t\tif compressorFn, ok := g.httpCompressors[contentEncoding]; ok {\n\t\t\t\t\tw.Header().Add(\"Content-Encoding\", contentEncoding)\n\t\t\t\t\trw := compressorFn(w)\n\t\t\t\t\tdefer rw.Close()\n\t\t\t\t\tnext.ServeHTTP(rw, r)\n\t\t\t\t\treturn\n\t\t\t\t}\n\t\t\t}\n\t\t\tfor _, acceptEncoding := range r.Header.Values(\"Accept-Encoding\") {\n\t\t\t\tif compressorFn, ok := g.httpCompressors[acceptEncoding]; ok {\n\t\t\t\t\tw.Header().Add(\"Content-Encoding\", acceptEncoding)\n\t\t\t\t\trw := compressorFn(w)\n\t\t\t\t\tdefer rw.Close()\n\t\t\t\t\tnext.ServeHTTP(rw, r)\n\t\t\t\t\treturn\n\t\t\t\t}\n\t\t\t}\n\t\t},\n\t)\n}", "title": "" } ]
b2f697da8d7e39a8b1267985e1de942b
Create a file in tmpdir and write data to it. Panics on any error.
[ { "docid": "b4b6ef9015a32a6f28f4753e4e17c496", "score": "0.5495181", "text": "func Mkfile(tmpdir string, basename string, data string) string {\n\tfn := filepath.Join(tmpdir, basename)\n\terr := ioutil.WriteFile(fn, []byte(data), 0644)\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\treturn fn\n}", "title": "" } ]
[ { "docid": "625b225308a64f1a97500f6a38b6765a", "score": "0.66068923", "text": "func writeTempFile(dir string) error {\n\tfh, err := ioutil.TempFile(dir, \".permtest-\")\n\tif err != nil {\n\t\tif os.IsPermission(err) {\n\t\t\treturn fmt.Errorf(ErrDenied, dir)\n\t\t}\n\t\treturn err\n\t}\n\tdefer fh.Close()\n\tdefer os.Remove(fh.Name())\n\treturn nil\n}", "title": "" }, { "docid": "eda805d929465fae0f84f9699858c581", "score": "0.65321076", "text": "func writeToTempDir(src io.Reader, tempDir string, relFileName string, perm os.FileMode) (err error) {\n\t// write data to new file, creating and directories as needed\n\tvar newDirname string\n\tnewDirname, _ = filepath.Split(relFileName)\n\tif len(newDirname) != 0 {\n\t\tif err = os.MkdirAll(filepath.Join(tempDir, newDirname), 0777); err != nil {\n\t\t\treturn\n\t\t}\n\t}\n\n\tvar dstF *os.File\n\n\tdstF, err = os.OpenFile(filepath.Join(tempDir, relFileName), os.O_CREATE|os.O_WRONLY|os.O_TRUNC, perm)\n\tif err == nil {\n\t\tdefer dstF.Close()\n\n\t\t_, err = io.Copy(dstF, src)\n\t}\n\n\treturn\n}", "title": "" }, { "docid": "71571f195741e9e7fb893ccf068125d2", "score": "0.6455447", "text": "func writeTempFile(content []byte) (*os.File, error) {\n\ttmpfile, err := ioutil.TempFile(\"\", \"tmp\")\n\tif err != nil {\n\t\treturn tmpfile, fmt.Errorf(\"failed to create temporary file: %s\", err)\n\t}\n\n\tif _, err := tmpfile.Write(content); err != nil {\n\t\treturn tmpfile, fmt.Errorf(\"failed to write temporary file: %s\", err)\n\t}\n\n\tif err := tmpfile.Close(); err != nil {\n\t\treturn tmpfile, fmt.Errorf(\"failed to close temporary file: %s\", err)\n\t}\n\n\treturn tmpfile, nil\n}", "title": "" }, { "docid": "9da7ad93eaf66c8a2a87dc78a3d95062", "score": "0.64380777", "text": "func main() {\n\tpanic(\"some error occurred\")\n\n\t_, err := os.Create(\"/tmp/file\")\n\tif err != nil {\n\t\tpanic(err)\n\t}\n}", "title": "" }, { "docid": "e91e4829281af51dd5bbaf6e18ed6ec2", "score": "0.6373675", "text": "func WriteTempFile(name string, content string) (path string) {\n\ttempDir := GinkgoT().TempDir()\n\tpath = filepath.Join(tempDir, name)\n\terr := os.WriteFile(path, []byte(content), 0666)\n\tExpect(err).ToNot(HaveOccurred())\n\treturn path\n}", "title": "" }, { "docid": "3e5336422eac201c4f9bd414b47d7541", "score": "0.6313114", "text": "func WriteToNewTempFile(t *testing.T, s string) *os.File {\n\tfp, err := ioutil.TempFile(os.TempDir(), \"cosmos_cli_test_\")\n\trequire.Nil(t, err)\n\t_, err = fp.WriteString(s)\n\trequire.Nil(t, err)\n\treturn fp\n}", "title": "" }, { "docid": "c840dfca102c4a4ead43ff830ec0bab5", "score": "0.6246441", "text": "func CreateTempFile(dir, name string, content string) (string, error) {\n\tvar file *os.File\n\tvar err error\n\tfile, err = os.Create(dir + \"/\" + name)\n\tif err != nil { return \"\", err }\n\tvar bytes []byte = []byte(content)\n\tvar mode os.FileMode = os.ModeTemporary | os.ModePerm\n\terr = ioutil.WriteFile(file.Name(), bytes, mode)\n\treturn file.Name(), err\n}", "title": "" }, { "docid": "a84f8573ea2967796d52d322a38eee96", "score": "0.61423314", "text": "func createAndWriteFile(fs afero.Fs, filename, data string) error {\n\tfileHandle, err := fs.Create(filename)\n\tif err != nil {\n\t\treturn err\n\t}\n\tdefer fileHandle.Close()\n\t_, err = fileHandle.Write([]byte(data))\n\treturn err\n}", "title": "" }, { "docid": "662335837e41df7d69bd8e7ab1bc1516", "score": "0.6130126", "text": "func createTmpFile(tmpDirPath string) (*os.File, error) {\n\ttmpFilePrefix := \"switch_file.\"\n\ttmpFile, err := ioutil.TempFile(tmpDirPath, tmpFilePrefix)\n\treturn tmpFile, err\n}", "title": "" }, { "docid": "865a19bd3ee0b03731f7a36dcd18e45b", "score": "0.61162513", "text": "func writeFile(t *testing.T, filename, contents string) {\n\tt.Helper()\n\tdirPath := filepath.Dir(filename)\n\tif _, err := os.Stat(dirPath); os.IsNotExist(err) {\n\t\terr = os.MkdirAll(dirPath, 0777)\n\t\tif err != nil {\n\t\t\tt.Fatalf(\"Unable to create directory %s: %s\", dirPath, err)\n\t\t}\n\t}\n\n\terr := ioutil.WriteFile(filename, []byte(contents), 0777)\n\tif err != nil {\n\t\tt.Fatalf(\"Unable to write %s: %s\", filename, err)\n\t}\n}", "title": "" }, { "docid": "8533e044ce59a672bb8cee074ec4ff99", "score": "0.6078066", "text": "func TempFile(dir, format string) (f *os.File, err error) {\n\tif dir == \"\" {\n\t\tdir = os.TempDir()\n\t}\n\n\tnconflict := 0\n\tfor i := 0; i < 10000; i++ {\n\t\tname := fmt.Sprintf(format, nextSuffix())\n\t\tname = filepath.Join(dir, name)\n\t\tf, err = os.OpenFile(name, os.O_RDWR|os.O_CREATE|os.O_EXCL, 0o600)\n\t\tif os.IsExist(err) {\n\t\t\tif nconflict++; nconflict > 10 {\n\t\t\t\trand = reseed()\n\t\t\t}\n\t\t\tcontinue\n\t\t}\n\t\tbreak\n\t}\n\treturn\n}", "title": "" }, { "docid": "1a264bf3ee440e74e5244eaea311fdbf", "score": "0.6076664", "text": "func touch(td *testutil.TempDir, file string) {\n\ttd.Write(file, nil)\n}", "title": "" }, { "docid": "17d2c70c8148d09ffb0c7c1215cfea79", "score": "0.60737354", "text": "func writeTempFile(content string) (string, error) {\n\tisFile, err := ioutil.TempFile(\"\", \"*\")\n\n\tif err != nil {\n\t\treturn \"\", err\n\t}\n\n\tpath := isFile.Name()\n\n\terr = ioutil.WriteFile(path, []byte(content), 0600)\n\n\treturn path, err\n}", "title": "" }, { "docid": "ec7102fbddd4878b18e0c85fb7840c9d", "score": "0.60609347", "text": "func createFile(filepath string, data []byte, op string, requuid string) error {\n\tchecksum := md5.Sum(data)\n\n\t// open the tmp file\n\tfile, err := os.OpenFile(filepath, tmpFileOpenFlag, utils.DefaultFileMode)\n\tif err != nil {\n\t\tglog.Errorln(op, \"open file\", filepath, \"error\", err, \"requuid\", requuid)\n\t\treturn err\n\t}\n\tdefer file.Close()\n\n\t// write checksum to the head of the file\n\tn, err := file.Write(checksum[:])\n\tif err != nil {\n\t\tglog.Errorln(op, \"write checksum to file\", filepath, \"error\", err, \"requuid\", requuid)\n\t\treturn err\n\t}\n\tif n != len(checksum) {\n\t\tglog.Errorln(op, \"write checksum to file\", filepath, \"error short write, requuid\", requuid)\n\t\treturn io.ErrShortWrite\n\t}\n\n\t// append the device data to the file\n\tn, err = file.Write(data)\n\tif err != nil {\n\t\tglog.Errorln(op, \"write device data to file\", filepath, \"error\", err, \"requuid\", requuid)\n\t\treturn err\n\t}\n\tif n != len(data) {\n\t\tglog.Errorln(op, \"write device data to file\", filepath, \"error short write, requuid\", requuid)\n\t\treturn io.ErrShortWrite\n\t}\n\n\terr = file.Sync()\n\tif err != nil {\n\t\tglog.Errorln(op, \"sync data to file\", filepath, \"error\", err, \"requuid\", requuid)\n\t\treturn err\n\t}\n\n\tglog.Infoln(op, \"create file done\", filepath, \"requuid\", requuid)\n\treturn nil\n}", "title": "" }, { "docid": "4a145a570379b638c0dae5f01737c580", "score": "0.59843975", "text": "func CreateTestFile(file string, mode os.FileMode, content []byte, t *testing.T) {\n\t_, err := os.Stat(file)\n\tif !os.IsNotExist(err) {\n\t\tfmt.Printf(\"File already exists: %q\\n\", file)\n\t\treturn\n\t}\n\n\terr = ioutil.WriteFile(file, content, mode)\n\tCheck(err, t)\n\n\t_, err = os.Stat(file)\n\tif os.IsNotExist(err) {\n\t\tt.Fatalf(\"Creating file %q failed. Error: %q\\n\", file, err)\n\t} else {\n\t\tfmt.Printf(\"File created: %q\\n\", file)\n\t}\n}", "title": "" }, { "docid": "0c844db64fbd4095320d7919127b4249", "score": "0.5952423", "text": "func writeFile(path string, data interface{}) error {\n\treturn openAndWriteFile(path, os.O_RDWR|os.O_CREATE|os.O_TRUNC, data)\n}", "title": "" }, { "docid": "44202d70239d4a10cf3eccaeb72373e7", "score": "0.59372544", "text": "func createTempFile(name, ext string) (*os.File, error) {\n\ttFile, err := ioutil.TempFile(\"\", name)\n\tif err != nil {\n\t\tlog.Println(\"Failed to create temp file: \", err)\n\t\treturn nil, err\n\t}\n\tdefer os.Remove(tFile.Name())\n\tfile, err := os.Create(fmt.Sprintf(\"%s.%s\", tFile.Name(), ext))\n\tif err != nil {\n\t\tlog.Println(\"Failed to create file: \", err)\n\t\treturn nil, err\n\t}\n\treturn file, err\n}", "title": "" }, { "docid": "a91815e18bdf087595e40263cb86c63e", "score": "0.5936806", "text": "func createTmpDir(dir string) (string, error) {\n\ttmpDir := os.TempDir()\n\tdataDir := filepath.Join(tmpDir, dir)\n\terr := ensureDirectory(dataDir)\n\treturn dataDir, err\n}", "title": "" }, { "docid": "6b55215597fdd04eab48e6fbeb94e7ed", "score": "0.5927821", "text": "func createLogFile(localPath, out string) {\n\t_, err := os.Stat(strings.Replace(filepath.Dir(filepath.Join(localPath, out)), \"\\\\\", \"/\", -1))\n\tif err != nil && os.IsNotExist(err) {\n\t\terr := os.MkdirAll(strings.Replace(filepath.Dir(filepath.Join(localPath, out)), \"\\\\\", \"/\", -1), os.ModePerm)\n\t\tif err != nil {\n\t\t\tpanic(err)\n\t\t}\n\t} else if err != nil {\n\t\tpanic(err)\n\t}\n\tf, err := os.OpenFile(strings.Replace(filepath.Join(localPath, out), \"\\\\\", \"/\", -1), os.O_CREATE, 0640)\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\tdefer f.Close()\n}", "title": "" }, { "docid": "0ef648ca5950dd9b085348e7af016731", "score": "0.5923837", "text": "func CreateTmpFile(content []byte, name string, dir string) (string, error) {\n\ttmpfile, err := ioutil.TempFile(dir, name)\n\tif err != nil {\n\t\treturn \"\", err\n\t}\n\n\tif _, err := tmpfile.Write(content); err != nil {\n\t\treturn \"\", err\n\t}\n\n\tif err := tmpfile.Close(); err != nil {\n\t\treturn \"\", err\n\t}\n\n\treturn tmpfile.Name(), nil\n}", "title": "" }, { "docid": "1582aea71a97586ebf0bdb52a1fb2b07", "score": "0.5914208", "text": "func TempFile(t *testing.T, content string) string {\n\tt.Helper()\n\n\tfilename := filepath.Join(t.TempDir(), strconv.Itoa(rand.Int()))\n\n\tif err := os.WriteFile(filename, []byte(content), 0600); err != nil {\n\t\tt.Fatal(err)\n\t}\n\n\tt.Logf(\"created %s\", filename)\n\n\treturn filename\n}", "title": "" }, { "docid": "e8e36809ed216e09bde01b7421da8576", "score": "0.59057206", "text": "func writeTmpFile(content io.Reader) (string, error) {\n\tf, err := ioutil.TempFile(\"\", \"\")\n\tif err != nil {\n\t\treturn \"\", err\n\t}\n\n\tio.Copy(f, content)\n\tf.Close()\n\treturn f.Name(), nil\n}", "title": "" }, { "docid": "bfe2740400ab7efef3d624d27d1eeb9d", "score": "0.5902947", "text": "func writeTmpFile(content io.Reader) (string, error) {\n\tf, err := ioutil.TempFile(\"\", \"\")\n\n\tif err != nil {\n\t\treturn \"\", err\n\t}\n\n\tio.Copy(f, content)\n\tf.Close()\n\treturn f.Name(), nil\n}", "title": "" }, { "docid": "ef1b44f881281e9ec130659a2ed6e124", "score": "0.5870919", "text": "func RecordTempDir(recordPath, tempPath string) error {\n\t// If the file does not exist, create it, or append to the file.\n\tf, err := os.OpenFile(recordPath, os.O_APPEND|os.O_CREATE|os.O_WRONLY, 0644)\n\tif err != nil {\n\t\treturn err\n\t}\n\tdefer f.Close()\n\n\t// Record tempPath to the record file.\n\t_, err = f.Write(append([]byte(tempPath), '\\n'))\n\treturn err\n}", "title": "" }, { "docid": "62648898235e93a902bc622ab8bc712c", "score": "0.58511734", "text": "func WriteTempFile(contents []byte) (string, error) {\n\tf, err := os.CreateTemp(os.TempDir(), \"sdkcommon-\")\n\tif err != nil {\n\t\treturn \"\", err\n\t}\n\tdefer f.Close()\n\tpath := f.Name()\n\tif _, err = f.Write(contents); err != nil {\n\t\treturn \"\", err\n\t}\n\treturn path, nil\n}", "title": "" }, { "docid": "30d5a31655e981d651e4cb2ea9d6b225", "score": "0.5847369", "text": "func (self articleStore) CreateTempFile(messageID string) io.WriteCloser {\n fname := self.GetTempFilename(messageID)\n if CheckFile(fname) {\n log.Println(fname, \"already open\")\n return nil\n }\n file, err := os.Create(fname)\n if err != nil {\n log.Println(\"cannot open file\", fname)\n return nil\n }\n return file\n}", "title": "" }, { "docid": "dd06b880a75e34b619b97068b6328e8a", "score": "0.5847326", "text": "func newTmpFile(t *testing.T) string {\n\treturn t.TempDir() + string(os.PathSeparator) + \"tmp\"\n}", "title": "" }, { "docid": "56e56006a85173e542796e07e2be372c", "score": "0.5829792", "text": "func SafeWriteToFile(fs vfs.FS, dir string, filename string, b []byte) error {\n\ttempName := filename + \".crdbtmp\"\n\tf, err := fs.Create(tempName)\n\tif err != nil {\n\t\tfmt.Printf(\"%v\\n\", err)\n\t\treturn err\n\t}\n\tbReader := bytes.NewReader(b)\n\tif _, err = io.Copy(f, bReader); err != nil {\n\t\tf.Close()\n\t\treturn err\n\t}\n\tif err = f.Close(); err != nil {\n\t\treturn err\n\t}\n\tif err = fs.Rename(tempName, filename); err != nil {\n\t\treturn err\n\t}\n\tfdir, err := fs.OpenDir(dir)\n\tif err != nil {\n\t\treturn err\n\t}\n\tdefer fdir.Close()\n\treturn fdir.Sync()\n}", "title": "" }, { "docid": "4b12595fcaee8a9f76d5e3d2616ec0cd", "score": "0.5820584", "text": "func main() {\n\tdpath := \"./newdir\"\n\tfname := \"file.txt\"\n\n\t_ = os.MkdirAll(dpath, 0777)\n\tfpath := filepath.Join(dpath, fname)\n\tfile, err := os.Create(fpath)\n\tif err != nil {\n\t\tfmt.Printf(\"Error caught %v\", err)\n\t}\n\n\tfile.Close()\n}", "title": "" }, { "docid": "6b9a29840b8e21d21fdbede9b552698d", "score": "0.5816817", "text": "func newfile(t *testing.T) *os.File {\n\tt.Helper()\n\tf, err := ioutil.TempFile(dir, \"file\")\n\tif err != nil {\n\t\tt.Errorf(\"Failed to create temp file: %v\", err)\n\t}\n\n\tt.Log(\"Created file:\", f.Name())\n\treturn f\n}", "title": "" }, { "docid": "b780bc3c8148fe132ac06912fe377854", "score": "0.5813213", "text": "func createFile(localPath, outputpath string) {\n\t_, err := os.Stat(strings.Replace(filepath.Dir(filepath.Join(localPath, outputpath)), \"\\\\\", \"/\", -1))\n\tif err != nil && os.IsNotExist(err) {\n\t\tos.MkdirAll(strings.Replace(filepath.Dir(filepath.Join(localPath, outputpath)), \"\\\\\", \"/\", -1), os.ModePerm)\n\t} else if err != nil {\n\t\tpanic(err)\n\t}\n\tf, err := os.OpenFile(strings.Replace(filepath.Join(localPath, outputpath), \"\\\\\", \"/\", -1), os.O_CREATE, os.ModePerm)\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\tdefer f.Close()\n}", "title": "" }, { "docid": "6b3d5d702a5ae107913ed01fcd4b1702", "score": "0.58086944", "text": "func createTempFile(prefix, extension string) (*os.File, error) {\n\ttempFile, err := ioutil.TempFile(\"\", prefix)\n\n\tif err != nil {\n\t\treturn nil, fmt.Errorf(\"primitive.createTempFile.TempFile:: %v\", err)\n\t}\n\n\tdefer func(name string) {\n\t\t_ = os.Remove(name)\n\t}(tempFile.Name())\n\n\tfileToCreate := fmt.Sprintf(\"%s.%s\", tempFile.Name(), extension)\n\n\tfile, err := os.Create(fileToCreate)\n\n\tif err != nil {\n\t\treturn nil, fmt.Errorf(\"primitive.createTempFile.OSCreate:: %v\", err)\n\t}\n\n\treturn file, nil\n}", "title": "" }, { "docid": "c2ad8eb401a612ca4d8433de50c7dd6f", "score": "0.5786424", "text": "func (storer *APTStorer) createTempFile(reader io.Reader, gf *models.GenericFile, attemptNumber int) error {\n\tfilePath := storer.getTempFilePath(gf)\n\tstorer.Context.MessageLog.Info(\"Copying file %s (size: %d) to %s \"+\n\t\t\"before uploading. (Attempt %d)\", gf.Identifier, gf.Size, filePath,\n\t\tattemptNumber)\n\terr := os.MkdirAll(filepath.Dir(filePath), 0755)\n\tif err != nil {\n\t\treturn fmt.Errorf(\"MkdirAll failed: %v\", err)\n\t}\n\t// PT #143660373: S3 zero-size file bug. Lots of checks here...\n\ttempFile, err := os.Create(filePath)\n\tif err != nil {\n\t\treturn fmt.Errorf(\"Cannot create file: %v\", err)\n\t}\n\tdefer tempFile.Close()\n\n\tbytesCopied, err := io.Copy(tempFile, reader)\n\tif err != nil {\n\t\treturn fmt.Errorf(\"Error copying data from tar file: %v\", err)\n\t}\n\tif bytesCopied != gf.Size {\n\t\treturn fmt.Errorf(\"Copied only %d of %d bytes for file %s\", bytesCopied, gf.Size, gf.Identifier)\n\t} else {\n\t\tstorer.Context.MessageLog.Info(\"Copied %d bytes for %s to %s\", bytesCopied, gf.Identifier, filePath)\n\t}\n\tfinfo, err := tempFile.Stat()\n\tif err != nil {\n\t\treturn fmt.Errorf(\"Can't stat tempFile %s at %s\", gf.Identifier, filePath)\n\t}\n\tif finfo.Size() != gf.Size {\n\t\treturn fmt.Errorf(\"Temp file has only %d of %d bytes for file %s\",\n\t\t\tfinfo.Size(), gf.Size, gf.Identifier)\n\t}\n\treturn nil\n}", "title": "" }, { "docid": "30d4d880c5f2583664724a06c741ccc3", "score": "0.578356", "text": "func writeNonEmptyTempFile(data []byte, filename string) (string, error) {\n\tif len(data) == 0 && filename != \"\" {\n\t\tdir, err := ioutil.TempDir(\"\", \"control-tower\")\n\t\tif err != nil {\n\t\t\treturn \"\", fmt.Errorf(\"Error generating temp directory: %v\", err)\n\t\t}\n\t\treturn filepath.Join(dir, filename), nil\n\t}\n\n\treturn writeTempFile(data)\n}", "title": "" }, { "docid": "d8aa563c97d0ae3c77c877eefc0a5b94", "score": "0.5762125", "text": "func TempFile(dir, prefix, suffix string) (f *os.File, err error) {\n\tif dir == \"\" {\n\t\tdir = os.TempDir()\n\t}\n\n\tnconflict := 0\n\tfor i := 0; i < 10000; i++ {\n\t\tname := filepath.Join(dir, prefix+nextInfix()+suffix)\n\t\tf, err = os.OpenFile(name, os.O_RDWR|os.O_CREATE|os.O_EXCL, 0600)\n\t\tif os.IsExist(err) {\n\t\t\tif nconflict++; nconflict > 10 {\n\t\t\t\trandmu.Lock()\n\t\t\t\trand = reseed()\n\t\t\t\trandmu.Unlock()\n\t\t\t}\n\t\t\tcontinue\n\t\t}\n\t\tbreak\n\t}\n\treturn\n}", "title": "" }, { "docid": "bbd60baad19094ef3113ee925cc142a8", "score": "0.5757806", "text": "func storeFile(file FileData) {\n\tpath := \"../Files/\"\n\terr := os.MkdirAll(path, 0777)\n\tcheckError(err)\n\tf, er := os.Create(path + file.FileName)\n\tcheckError(er)\n\tn, error := f.Write(file.Data)\n\tcheckError(error)\n\tprintln(\"bytes written to file: \", n)\n\tf.Close()\n}", "title": "" }, { "docid": "3273a312f415c71cd8f575dbf7e270a8", "score": "0.57507384", "text": "func TempFile(data string) *os.File {\n\tf, err := ioutil.TempFile(\"\", \"prefix\")\n\tif err != nil {\n\t\tlog.Logger.Fatal(err)\n\t}\n\n\t_, err = f.WriteString(data)\n\tif err != nil {\n\t\tlog.Logger.Fatal(err)\n\t}\n\n\treturn f\n}", "title": "" }, { "docid": "53901f2a663a95e839e6a6fd68b0e14f", "score": "0.57354164", "text": "func createFileHook(filename, tmpDir string) *os.File {\n\tif logCreatedFiles {\n\t\tif strings.HasPrefix(filename, tmpDir) {\n\t\t\tlog.Println(logFilePrefix + \"$TMP\" + filename[len(tmpDir):])\n\t\t} else {\n\t\t\tlog.Println(logFilePrefix + filename)\n\t\t}\n\t}\n\tfile, err := os.Create(filename)\n\texitIfErr(err)\n\treturn file\n}", "title": "" }, { "docid": "5e7a4b8ca3fc1ee1090ac0719190a57d", "score": "0.57312727", "text": "func TestWriteDBBackupToFileCreateError(t *testing.T) {\n\ttestutils.SmallTest(t)\n\tb, cancel := getMockedDBBackup(t, nil)\n\tdefer cancel()\n\n\ttempdir, err := ioutil.TempDir(\"\", \"backups_test\")\n\tassert.NoError(t, err)\n\tdefer testutils.RemoveAll(t, tempdir)\n\n\tfilename := path.Join(tempdir, \"nonexistant_dir\", \"foo.bdb\")\n\terr = b.writeDBBackupToFile(filename)\n\tassert.Error(t, err)\n\tassert.Contains(t, err.Error(), \"Could not create temp file to write DB backup\")\n}", "title": "" }, { "docid": "96e49fb093a2e2b4d5447082ef465b95", "score": "0.57300335", "text": "func createRandFile(path string, size int) error {\n\tdata, err := crypto.RandBytes(size)\n\tif err != nil {\n\t\treturn err\n\t}\n\treturn ioutil.WriteFile(path, data, 0600)\n}", "title": "" }, { "docid": "09751cc7a2ef5c37637ff5850b826682", "score": "0.57252073", "text": "func writeFileRoot(path string, data []byte, root string) error {\n\tpath = filepath.Join(root, path)\n\tdir := filepath.Dir(path)\n\tif err := os.MkdirAll(dir, 0755); err != nil {\n\t\treturn fmt.Errorf(\"failed to make directory %s: %w\", dir, err)\n\t}\n\tif err := os.WriteFile(path, data, 0666); err != nil {\n\t\treturn fmt.Errorf(\"failed to write file %s: %w\", path, err)\n\t}\n\treturn nil\n}", "title": "" }, { "docid": "531b67b1ed6c2222a112b016104f1ab5", "score": "0.57086277", "text": "func WriteFile(filename string, data []byte, perm os.FileMode) error {\n f, err := FS.OpenFile(CTX, filename, os.O_WRONLY|os.O_CREATE|os.O_TRUNC, perm)\n if err != nil {\n return err\n }\n n, err := f.Write(data)\n if err == nil && n < len(data) {\n err = io.ErrShortWrite\n }\n if err1 := f.Close(); err == nil {\n err = err1\n }\n return err\n}", "title": "" }, { "docid": "daee33ecd21f6e0df1dee4062550af18", "score": "0.57035327", "text": "func mkCookieFile(path string) error {\n\tdir := filepath.Dir(path)\n\n\t// make dir if not exsit\n\tif _, err := os.Stat(dir); err != nil && os.IsNotExist(err) {\n\t\tif err := os.MkdirAll(dir, os.ModePerm); err != nil {\n\t\t\treturn err\n\t\t}\n\t}\n\n\t// create file if not exsit\n\tif _, err := os.Stat(path); err != nil && os.IsNotExist(err) {\n\t\tif _, err := os.Create(path); err != nil {\n\t\t\treturn err\n\t\t}\n\t}\n\n\treturn nil\n}", "title": "" }, { "docid": "df41c9a33eb267adc9255adc496fff69", "score": "0.56975013", "text": "func createRawDataFile(fileName string, content string) {\n\tf, _ := os.OpenFile(fileName, os.O_CREATE|os.O_WRONLY, DefaultFilePerm)\n\tf.WriteString(content)\n\tf.Sync()\n\tf.Close()\n}", "title": "" }, { "docid": "4d13931b339689287369b0307b6cc629", "score": "0.568196", "text": "func (suite *YamlTestSuite) writeToTempFile(contents string) string {\n\ttmpfile, err := ioutil.TempFile(\"/tmp\", \"yaml\")\n\tsuite.Nil(err)\n\n\t_, err = tmpfile.Write([]byte(contents))\n\tsuite.Nil(err)\n\n\terr = tmpfile.Close()\n\tsuite.Nil(err)\n\n\treturn tmpfile.Name()\n}", "title": "" }, { "docid": "698b21cfef62ef1d3f0045369b3198fd", "score": "0.5671925", "text": "func writeFileToTestDir(fname, content string) {\n\ttestDirPath := \".\" + string(filepath.Separator) + TEST_DIR\n\ttestFilePath := testDirPath + string(filepath.Separator) + fname\n\n\t_ = os.MkdirAll(testDirPath, 0755)\n\t_ = ioutil.WriteFile(testFilePath, []byte(content), os.ModePerm)\n}", "title": "" }, { "docid": "275ff4dfa35ba34b7efdbcf2c367233b", "score": "0.5671842", "text": "func write(data string, fileName string) {\n //create file message\n fmt.Printf(\"\\nCreating output file with name '%s'...\\n\\n\", fileName)\n\n //create file using given filename\n file, createErr := os.Create(fileName)\n check(createErr)\n\n defer file.Close()\n\n //write data to newly created file\n _, writeErr:= io.WriteString(file, data)\n check(writeErr)\n\n //isssue a sync to flush writes to stable storage\n file.Sync()\n}", "title": "" }, { "docid": "bd2f7fa87a84f456084cc2a7b46c66a1", "score": "0.566794", "text": "func (sfs *SuiteFS) TestTempFile(t *testing.T, testDir string) {\n\tvfs := sfs.vfsTest\n\n\tif !vfs.HasFeature(avfs.FeatBasicFs) || vfs.HasFeature(avfs.FeatReadOnly) {\n\t\t_, err := vfs.TempFile(testDir, \"\")\n\t\tif err.(*os.PathError).Err != avfs.ErrPermDenied {\n\t\t\tt.Errorf(\"TempFile : want error to be %v, got %v\", avfs.ErrPermDenied, err)\n\t\t}\n\n\t\treturn\n\t}\n\n\texistingFile := sfs.EmptyFile(t, testDir)\n\n\tt.Run(\"TempFileOnFile\", func(t *testing.T) {\n\t\t_, err := vfs.TempFile(existingFile, \"\")\n\n\t\te, ok := err.(*os.PathError)\n\t\tif !ok {\n\t\t\tt.Fatalf(\"TempFile : want error type *os.PathError, got %v\", reflect.TypeOf(err))\n\t\t}\n\n\t\tconst op = \"open\"\n\t\twantErr := avfs.ErrNotADirectory\n\t\tif e.Op != op || vfs.Dir(e.Path) != existingFile || e.Err != wantErr {\n\t\t\twantPathErr := &os.PathError{Op: op, Path: existingFile + \"/<random number>\", Err: wantErr}\n\t\t\tt.Errorf(\"TempDir : want error to be %v, got %v\", wantPathErr, err)\n\t\t}\n\t})\n}", "title": "" }, { "docid": "b5b80a2b954e28f6054df7aeba88c6cf", "score": "0.56631815", "text": "func main() {\n\tcontent := []byte(\"temporary file's content\")\n\ttmpfile, err := ioutil.TempFile(\"\", \"example\")\n\tif err != nil {\n\t\tlog.Fatal(err)\n\t}\n\n\tdefer os.Remove(tmpfile.Name()) // clean up\n\n\tif _, err := tmpfile.Write(content); err != nil {\n\t\tlog.Fatal(err)\n\t}\n\tif err := tmpfile.Close(); err != nil {\n\t\tlog.Fatal(err)\n\t}\n}", "title": "" }, { "docid": "d19e417a788a0b55ccd6c97d866d09f7", "score": "0.56419927", "text": "func WriteOrUpdateFile(filePath string, fileContent []byte) {\n var file *os.File // Define file as an os.File\n file, fileCreateError := os.Create(filePath) // Create a file (or truncate if it exists), returning os.File and any error\n\n if fileCreateError != nil { // If there was a non-nil error passed\n os.MkdirAll(filepath.Dir(filePath), 0755) // Create the necessary directories that were in the path of filePath\n file, _ = os.Create(filePath) // Re-create the file\n }\n\n file.Write(fileContent) // Write the content\n file.Close() // Close the file after writing\n}", "title": "" }, { "docid": "f573af7e387e756d9a0484f8fbc5361f", "score": "0.56393176", "text": "func safeWriteToFileOnce(g SafeWriteLogger, t SafeWriter, mode os.FileMode) (err error) {\n\tfn := t.GetFilename()\n\tg.Debug(\"+ SafeWriteToFile(%q)\", fn)\n\tdefer func() {\n\t\tg.Debug(\"- SafeWriteToFile(%q) -> %s\", fn, ErrToOk(err))\n\t}()\n\n\ttmpfn, tmp, err := OpenTempFile(fn, \"\", mode)\n\tif err != nil {\n\t\treturn err\n\t}\n\tg.Debug(\"| Temporary file generated: %s\", tmpfn)\n\tdefer tmp.Close()\n\tdefer func() { _ = ShredFile(tmpfn) }()\n\n\tg.Debug(\"| WriteTo %s\", tmpfn)\n\tn, err := t.WriteTo(tmp)\n\tif err != nil {\n\t\tg.Errorf(\"| Error writing temporary file %s: %s\", tmpfn, err)\n\t\treturn err\n\t}\n\tif n != 0 {\n\t\t// unfortunately, some implementations always return 0 for the number\n\t\t// of bytes written, so not much info there, but will log it when\n\t\t// it isn't 0.\n\t\tg.Debug(\"| bytes written to temporary file %s: %d\", tmpfn, n)\n\t}\n\n\tif err := tmp.Sync(); err != nil {\n\t\tg.Errorf(\"| Error syncing temporary file %s: %s\", tmpfn, err)\n\t\treturn err\n\t}\n\n\tif err := tmp.Close(); err != nil {\n\t\tg.Errorf(\"| Error closing temporary file %s: %s\", tmpfn, err)\n\t\treturn err\n\t}\n\n\tg.Debug(\"| Renaming temporary file %s -> permanent file %s\", tmpfn, fn)\n\tif err := os.Rename(tmpfn, fn); err != nil {\n\t\tg.Errorf(\"| Error renaming temporary file %s -> permanent file %s: %s\", tmpfn, fn, err)\n\t\treturn err\n\t}\n\n\tif runtime.GOOS == \"android\" {\n\t\tg.Debug(\"| Android extra checks in safeWriteToFile\")\n\t\tinfo, err := os.Stat(fn)\n\t\tif err != nil {\n\t\t\tg.Errorf(\"| Error os.Stat(%s): %s\", fn, err)\n\t\t\treturn err\n\t\t}\n\t\tg.Debug(\"| File info: name = %s\", info.Name())\n\t\tg.Debug(\"| File info: size = %d\", info.Size())\n\t\tg.Debug(\"| File info: mode = %s\", info.Mode())\n\t\tg.Debug(\"| File info: mod time = %s\", info.ModTime())\n\n\t\tg.Debug(\"| Android extra checks done\")\n\t}\n\n\tg.Debug(\"| Done writing to file %s\", fn)\n\n\treturn nil\n}", "title": "" }, { "docid": "510cb1a8a0bb01d3763ce3eef46e1147", "score": "0.56371236", "text": "func MustCreateTempFile(t testing.TB, data string) string {\n\tt.Helper()\n\n\tf, err := ioutil.TempFile(\"\", \"fs-test\")\n\tif err != nil {\n\t\tt.Fatalf(\"failed to create temp file: %v\", err)\n\t} else if _, err := f.WriteString(data); err != nil {\n\t\tt.Fatal(err)\n\t} else if err := f.Close(); err != nil {\n\t\tt.Fatal(err)\n\t}\n\treturn f.Name()\n}", "title": "" }, { "docid": "6952c73684f12006e06d792d0fef76bd", "score": "0.5636645", "text": "func writeFileData() {\n\t// Create new file\n\tf, err := os.Create(\"os_create.txt\")\n\thandleErr(err)\n\t// Close file afterwards\n\tdefer f.Close()\n\t// Print name of generated file\n\tfmt.Println(\"File generated:\", f.Name())\n\t// Write string to file\n\tf.WriteString(\"This is some text\\n\")\n\t// Write bytes to file\n\t//data2 := []byte(\"This some more text\\n\")\n\tdata2 := []byte{'v', 'w', 'x', 'y', 'z', '\\n'}\n\tf.Write(data2)\n\t// Sync everything to disk\n\tf.Sync()\n}", "title": "" }, { "docid": "9c47f97975d06bddd308057129af760f", "score": "0.56323755", "text": "func createFile(path string) error {\n\tvar _, err = os.Stat(path)\n\n\tif os.IsNotExist(err) {\n\t\tfile, err := os.Create(path)\n\n\t\tif err != nil {\n\t\t\treturn err\n\t\t}\n\t\tdefer file.Close()\n\t}\n\treturn nil\n}", "title": "" }, { "docid": "6685b78c6061afb2a48f0853acfe7c28", "score": "0.5630593", "text": "func createFile() {\n f, err := os.Create(\"testfile1.txt\")\n u.ErrNil(err, \"Unable to create file\")\n defer f.Close()\n log.Printf(\"Created %s\\n\", f.Name())\n}", "title": "" }, { "docid": "9ecc4f387e564aca4821cdc39d317b36", "score": "0.5626695", "text": "func (f *TempDirFixture) WriteFile(path string, contents string) string {\n\tfullPath := f.JoinPath(path)\n\tbase := filepath.Dir(fullPath)\n\terr := os.MkdirAll(base, os.FileMode(0o777))\n\tif err != nil {\n\t\tf.t.Fatal(err)\n\t}\n\terr = os.WriteFile(fullPath, []byte(contents), os.FileMode(0o777))\n\tif err != nil {\n\t\tf.t.Fatal(err)\n\t}\n\treturn fullPath\n}", "title": "" }, { "docid": "7f9803fa06844cfb89b1ec74e4abb27b", "score": "0.562564", "text": "func (writer FileWriter) Create(dest string, data []byte) error {\n\tif err := ioutil.WriteFile(dest, data, 0644); err != nil {\n\t\treturn errors.Wrap(err, fmt.Sprintf(\"failed to create test file: %s\", dest))\n\t}\n\treturn nil\n}", "title": "" }, { "docid": "14fe5fc8cfacb74f1a3f7f39dae9fec8", "score": "0.5613303", "text": "func ToTempFile(file, pattern string) (*os.File, error) {\n\tt, err := ioutil.TempFile(os.TempDir(), pattern)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\tz := gzip.NewWriter(t)\n\tz.Name = file\n\tz.ModTime = time.Now()\n\n\tc, err := ioutil.ReadFile(file)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\t_, err = z.Write(c)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\tif err := z.Close(); err != nil {\n\t\treturn nil, err\n\t}\n\n\treturn t, nil\n}", "title": "" }, { "docid": "e8e8bc5a80f3b82a89177a036b842387", "score": "0.5605228", "text": "func tempfile(prefix, ext string) (*os.File, error) {\n\tin, err := ioutil.TempFile(\"\", prefix)\n\tif err != nil {\n\t\treturn nil, errors.New(\"primitive: failed to create temporary file\")\n\t}\n\tdefer os.Remove(in.Name())\n\treturn os.Create(fmt.Sprintf(\"%s.%s\", in.Name(), ext))\n}", "title": "" }, { "docid": "46eebda7c4019abb8def8f2323e75488", "score": "0.5592259", "text": "func createFile(path string, r io.Reader) error {\n\tf, err := renameio.TempFile(\"\", path)\n\tif err != nil {\n\t\treturn err\n\t}\n\tdefer f.Cleanup()\n\tif _, err := io.Copy(f, r); err != nil {\n\t\treturn err\n\t}\n\treturn f.CloseAtomicallyReplace()\n}", "title": "" }, { "docid": "af73d083b7becda1e397bf3031a2a219", "score": "0.5587789", "text": "func (storage PlaintextStorage) WriteFile(path string, data []byte) error {\n\tfilename := filepath.Clean(storage.root + \"/\" + path)\n\tif err := os.MkdirAll(filepath.Dir(filename), os.ModePerm); err != nil {\n\t\treturn err\n\t}\n\tfd, err := syscall.Open(filename, syscall.O_CREAT|syscall.O_WRONLY|syscall.O_TRUNC|syscall.O_NONBLOCK, 0600)\n\tif err != nil {\n\t\treturn err\n\t}\n\tdefer func() {\n\t\tsyscall.Close(fd)\n\t\tsyscall.Fsync(fd)\n\t}()\n\tif err = syscall.Flock(fd, syscall.LOCK_EX); err != nil {\n\t\treturn err\n\t}\n\tdefer syscall.Flock(fd, syscall.LOCK_UN)\n\tif _, err := syscall.Write(fd, data); err != nil {\n\t\treturn err\n\t}\n\treturn nil\n}", "title": "" }, { "docid": "08218c7d6ca520c0840b76236f8fac14", "score": "0.55845946", "text": "func createFile(path string, size uint32) error {\n\tfile, err := os.OpenFile(path, os.O_RDWR|os.O_CREATE|os.O_TRUNC, 0644)\n\tif err != nil {\n\t\treturn err\n\t}\n\tdefer file.Close()\n\n\treturn syscall.Ftruncate(syscall.Handle(file.Fd()), int64(size))\n}", "title": "" }, { "docid": "dbcc03fb3a3e99044b9f566299b13b69", "score": "0.5575479", "text": "func CreateFile(path, data string, uid int, mode os.FileMode) {\n\tif err := ioutil.WriteFile(path, []byte(data), mode); err != nil {\n\t\tpanic(fmt.Sprintf(\"Failed to create %v containing %q: %v\", path, data, err))\n\t}\n\tif err := os.Chown(path, uid, 0); err != nil {\n\t\tpanic(fmt.Sprintf(\"Failed to chown %v to %v: %v\", path, uid, err))\n\t}\n\tif err := os.Chmod(path, mode); err != nil {\n\t\tpanic(fmt.Sprintf(\"Failed to chmod %v to %#o: %v\", path, mode, err))\n\t}\n}", "title": "" }, { "docid": "b3c44f26e39cf8f0a0009e2c2fa18f79", "score": "0.557462", "text": "func flushToFile(outputPath string, data bytes.Buffer) error {\n\tfile, err := os.Create(outputPath)\n\tif err != nil {\n\t\treturn OrbitError.NewOrbitErrorf(\"unable to create the output file %s. Details:\\n%s\", outputPath, err)\n\t}\n\n\tdefer file.Close()\n\n\t_, err = file.Write(data.Bytes())\n\tif err != nil {\n\t\treturn OrbitError.NewOrbitErrorf(\"unable to flushToFile into the output file %s. Details:\\n%s\", outputPath, err)\n\t}\n\n\tlogger.Infof(\"output file %s has been created\", outputPath)\n\n\treturn nil\n}", "title": "" }, { "docid": "82cb9ba3150677dddb9ffcac48b770c4", "score": "0.5555586", "text": "func (sfs *SuiteFS) TestTempDir(t *testing.T, testDir string) {\n\tvfs := sfs.vfsTest\n\n\tif !vfs.HasFeature(avfs.FeatBasicFs) || vfs.HasFeature(avfs.FeatReadOnly) {\n\t\t_, err := vfs.TempDir(testDir, \"\")\n\t\tif err.(*os.PathError).Err != avfs.ErrPermDenied {\n\t\t\tt.Errorf(\"TempDir : want error to be %v, got %v\", avfs.ErrPermDenied, err)\n\t\t}\n\n\t\treturn\n\t}\n\n\texistingFile := sfs.EmptyFile(t, testDir)\n\n\tt.Run(\"TempDirOnFile\", func(t *testing.T) {\n\t\t_, err := vfs.TempDir(existingFile, \"\")\n\n\t\te, ok := err.(*os.PathError)\n\t\tif !ok {\n\t\t\tt.Fatalf(\"TempDir : want error type *os.PathError, got %v\", reflect.TypeOf(err))\n\t\t}\n\n\t\tconst op = \"mkdir\"\n\t\twantErr := avfs.ErrNotADirectory\n\t\tif e.Op != op || vfs.Dir(e.Path) != existingFile || e.Err != wantErr {\n\t\t\twantPathErr := &os.PathError{Op: op, Path: existingFile + \"/<random number>\", Err: wantErr}\n\t\t\tt.Errorf(\"TempDir : want error to be %v, got %v\", wantPathErr, err)\n\t\t}\n\t})\n}", "title": "" }, { "docid": "2305937b2c888350f79c4360bb4561ec", "score": "0.5553279", "text": "func CreateTestFile(name string) {\n\trec := []byte(\"012345678Z\\nabcdZfghij\\nklmnopqrsZ\\n\")\n\n\tfh, err := os.Create(tfile)\n\tif err != nil {\n\t\tlog.Fatalf(\"testfile: %s\\n\", err)\n\t\tos.Exit(1)\n\t}\n\tdefer fh.Close()\n\tfh.Write(rec)\n}", "title": "" }, { "docid": "14f1769d585eb898c7bf271164fada0c", "score": "0.5551985", "text": "func MakeTempDir(name string, perms os.FileMode) func() {\n\terr := os.Mkdir(name, os.ModePerm)\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\n\terr = os.Chmod(name, perms&os.ModePerm)\n\tif err != nil {\n\t\t_ = os.Remove(name)\n\t\tpanic(err)\n\t}\n\n\treturn func() { _ = os.Remove(name) }\n}", "title": "" }, { "docid": "5a6aa50552316970de0ad7609db54028", "score": "0.5548344", "text": "func atomicallyCreateFile(filename string) error {\n\t// no need to check this, we only really care about the file creation error\n\tos.MkdirAll(filepath.Dir(filename), 0700)\n\tf, err := os.OpenFile(filename, os.O_CREATE|os.O_EXCL, 0644)\n\tif err == nil {\n\t\tf.Close()\n\t}\n\treturn err\n}", "title": "" }, { "docid": "29feac1a13fc03fd6457a28731261d92", "score": "0.5542401", "text": "func StoreFile(path, content string) error {\n\tdir := filepath.Dir(path)\n\n\terr := os.MkdirAll(dir, 0775)\n\n\tif err != nil {\n\t\treturn err\n\t}\n\n\tf, err := os.Create(path)\n\n\tif err != nil {\n\t\treturn err\n\t}\n\n\tdefer f.Close()\n\n\t_, err = f.WriteString(content)\n\n\treturn err\n}", "title": "" }, { "docid": "6a55658aea73f373f571702794be603a", "score": "0.5539919", "text": "func writeToFile(filePath, data string) error {\n\tif filePath == \"\" {\n\t\treturn fmt.Errorf(\"invalid filename\")\n\t}\n\tf, err := os.Create(filePath)\n\tif err != nil {\n\t\tframework.Logf(\"Error: %v\", err)\n\t\treturn err\n\t}\n\t_, err = f.WriteString(data)\n\tif err != nil {\n\t\tframework.Logf(\"Error: %v\", err)\n\t\tf.Close()\n\t\treturn err\n\t}\n\terr = f.Close()\n\tif err != nil {\n\t\tframework.Logf(\"Error: %v\", err)\n\t\treturn err\n\t}\n\treturn nil\n}", "title": "" }, { "docid": "f03f7c50a9d3dc6d9582379fe4da4376", "score": "0.5539826", "text": "func createFile(d, s string) (*os.File, error) {\n\treturn os.OpenFile(\n\t\tpath.Join(d, s),\n\t\tos.O_RDWR|os.O_CREATE|os.O_APPEND,\n\t\t0666,\n\t)\n}", "title": "" }, { "docid": "332a20b40d0698c8788df1e4fe33635a", "score": "0.55353874", "text": "func writeToFileHelper(foldername string, ident int, data []byte) {\n\tstr := consts.DirPath + consts.LocalPath + foldername + \"/\" + foldername + \"_\" + strconv.Itoa(ident)\n\terr := ioutil.WriteFile(str, data, 0777)\n\tutility.CheckError(err)\n}", "title": "" }, { "docid": "fd2a5623437385f421b346befa270549", "score": "0.5535055", "text": "func (file) WriteTemp(content []byte) (string, error) {\n\ttmpFile, err := ioutil.TempFile(\"\", \"pyos_\")\n\tif err != nil {\n\t\treturn \"\", err\n\t}\n\tdefer func() {\n\t\tif tmpFile == nil {\n\t\t\treturn\n\t\t}\n\t\tif err := tmpFile.Close(); err != nil {\n\t\t\tlog.Fatal(err)\n\t\t}\n\t}()\n\tif _, err := tmpFile.Write(content); err != nil {\n\t\treturn \"\", err\n\t}\n\treturn tmpFile.Name(), nil\n}", "title": "" }, { "docid": "7e3ab98353ddaaa39394c11214c3a287", "score": "0.552865", "text": "func (ta *testAPI) createNewFileInsideDirectory(t *testing.T, toEncrypt bool) {\n\tdat, err := ta.initSubtest(\"createNewFileInsideDirectory\")\n\tif err != nil {\n\t\tt.Fatalf(\"Couldn't initialize subtest dirs: %v\", err)\n\t}\n\tdefer os.RemoveAll(dat.testDir)\n\n\tdat.toEncrypt = toEncrypt\n\tdat.testUploadDir = filepath.Join(dat.testDir, \"createinsidedir-upload\")\n\tdat.testMountDir = filepath.Join(dat.testDir, \"createinsidedir-mount\")\n\tdat.files = make(map[string]fileInfo)\n\tdat.files[\"one/1.txt\"] = fileInfo{0700, 333, 444, testutil.RandomBytes(1, 10)}\n\n\tdat, err = ta.uploadAndMount(dat, t)\n\tif err != nil {\n\t\tt.Fatalf(\"Error during upload of files to swarm / mount of swarm dir: %v\", err)\n\t}\n\tdefer dat.swarmfs.Stop()\n\n\t// Create a new file inside a existing dir and check\n\tdirToCreate := filepath.Join(dat.testMountDir, \"one\")\n\tactualPath := filepath.Join(dirToCreate, \"2.txt\")\n\td, err1 := os.OpenFile(actualPath, os.O_RDWR|os.O_CREATE, os.FileMode(0665))\n\tif err1 != nil {\n\t\tt.Fatalf(\"Could not create file %s : %v\", actualPath, err1)\n\t}\n\tdefer d.Close()\n\tlog.Debug(\"File opened\")\n\tcontents := testutil.RandomBytes(1, 11)\n\tlog.Debug(\"Content read\")\n\t_, err = d.Write(contents)\n\tif err != nil {\n\t\tt.Fatalf(\"Error writing random bytes into file %v\", err)\n\t}\n\tlog.Debug(\"Content written\")\n\terr = d.Close()\n\tif err != nil {\n\t\tt.Fatalf(\"Error closing file %v\", err)\n\t}\n\tlog.Debug(\"File closed\")\n\n\tmi, err2 := dat.swarmfs.Unmount(dat.testMountDir)\n\tif err2 != nil {\n\t\tt.Fatalf(\"Could not unmount %v\", err2)\n\t}\n\tlog.Debug(\"Directory unmounted\")\n\n\ttestMountDir2, err3 := addDir(dat.testDir, \"createinsidedir-mount2\")\n\tif err3 != nil {\n\t\tt.Fatalf(\"Error creating mount dir2: %v\", err3)\n\t}\n\t// mount again and see if things are okay\n\tdat.files[\"one/2.txt\"] = fileInfo{0700, 333, 444, contents}\n\t_ = mountDir(t, ta.api, dat.files, mi.LatestManifest, testMountDir2)\n\tlog.Debug(\"Directory mounted again\")\n\n\tcheckFile(t, testMountDir2, \"one/2.txt\", contents)\n\t_, err = dat.swarmfs.Unmount(testMountDir2)\n\tif err != nil {\n\t\tt.Fatalf(\"could not unmount %v\", dat.bzzHash)\n\t}\n\tlog.Debug(\"subtest terminated\")\n}", "title": "" }, { "docid": "745bda029790f8c690115e12cb25f295", "score": "0.55135983", "text": "func (ip *InformationPacket) WriteTempFile(dat []byte) {\n\terr := ioutil.WriteFile(ip.GetTempPath(), dat, 0644)\n\tCheck(err, \"Could not write to temp file: \"+ip.GetTempPath())\n}", "title": "" }, { "docid": "8c3b335727c1b788a85371d513041195", "score": "0.55088097", "text": "func MkTempDir(name string) string {\n\tdir := randFile(os.TempDir(), name, \"\")\n\tif err := os.Mkdir(dir, 0755); err != nil {\n\t\tpanic(\"could not create temp directory \" + dir)\n\t}\n\treturn dir\n}", "title": "" }, { "docid": "59d375c72d02d1ad6be8f6b25ce38b94", "score": "0.5500937", "text": "func WriteToTempFile(content string) (string, error) {\n\n\ttmpFile, err := ioutil.TempFile(os.TempDir(), \"densify-\")\n\n\ttext := []byte(content)\n\tif _, err = tmpFile.Write(text); err != nil {\n\t\treturn tmpFile.Name(), err\n\t}\n\n\t// Close the file\n\tif err := tmpFile.Close(); err != nil {\n\t\treturn tmpFile.Name(), err\n\t}\n\n\treturn tmpFile.Name(), nil\n\n}", "title": "" }, { "docid": "125edec1ff6d38eff4eb4ef2a63528d2", "score": "0.54984516", "text": "func WriteStringToTempFile(t *testing.T, data string) string {\n\tescapedTestName := url.PathEscape(t.Name())\n\ttmpfile, err := ioutil.TempFile(\"\", escapedTestName)\n\trequire.NoError(t, err)\n\tdefer tmpfile.Close()\n\tif data != \"\" {\n\t\t_, err := tmpfile.WriteString(data)\n\t\trequire.NoError(t, err)\n\t}\n\treturn tmpfile.Name()\n}", "title": "" }, { "docid": "4fafdc04b0cc995c0a25c9be0fd1923a", "score": "0.54925483", "text": "func (l *LocalStorage) WriteFile(filename string, content io.Reader) (err error) {\n\tfullPath, err := l.prependExternalIODir(filename)\n\tif err != nil {\n\t\treturn err\n\t}\n\n\ttargetDir := filepath.Dir(fullPath)\n\tif err = os.MkdirAll(targetDir, 0755); err != nil {\n\t\treturn errors.Wrapf(err, \"creating target local directory %q\", targetDir)\n\t}\n\n\t// We generate the temporary file in the desired target directory.\n\t// This has two purposes:\n\t// - it avoids relying on the system-wide temporary directory, which\n\t// may not be large enough to receive the file.\n\t// - it avoids a cross-filesystem rename in the common case.\n\t// (There can still be cross-filesystem renames in very\n\t// exotic edge cases, hence the use fileutil.Move below.)\n\t// See the explanatory comment for ioutil.TempFile to understand\n\t// what the \"*\" in the suffix means.\n\ttmpFile, err := ioutil.TempFile(targetDir, filepath.Base(fullPath)+\"*.tmp\")\n\tif err != nil {\n\t\treturn errors.Wrap(err, \"creating temporary file\")\n\t}\n\ttmpFileFullName := tmpFile.Name()\n\tdefer func() {\n\t\tif err != nil {\n\t\t\t// When an error occurs, we need to clean up the newly created\n\t\t\t// temporary file.\n\t\t\t_ = os.Remove(tmpFileFullName)\n\t\t\t//\n\t\t\t// TODO(someone): in the special case where an attempt is made\n\t\t\t// to upload to a sub-directory of the ext i/o dir for the first\n\t\t\t// time (MkdirAll above did create the sub-directory), and the\n\t\t\t// copy/rename fails, we're now left with a newly created but empty\n\t\t\t// sub-directory.\n\t\t\t//\n\t\t\t// We cannot safely remove that target directory here, because\n\t\t\t// perhaps there is another concurrent operation that is also\n\t\t\t// targeting it. A more principled approach could be to use a\n\t\t\t// mutex lock on directory accesses, and/or occasionally prune\n\t\t\t// empty sub-directories upon node start-ups.\n\t\t}\n\t}()\n\n\t// Copy the data into the temp file. We use a closure here to\n\t// ensure the temp file is closed after the copy is done.\n\tif err = func() error {\n\t\tdefer tmpFile.Close()\n\t\tif _, err := io.Copy(tmpFile, content); err != nil {\n\t\t\treturn errors.Wrapf(err, \"writing to temporary file %q\", tmpFileFullName)\n\t\t}\n\t\treturn errors.Wrapf(tmpFile.Sync(), \"flushing temporary file %q\", tmpFileFullName)\n\t}(); err != nil {\n\t\treturn err\n\t}\n\n\t// Finally put the file to its final location.\n\treturn errors.Wrapf(\n\t\tfileutil.Move(tmpFileFullName, fullPath),\n\t\t\"moving temporary file to final location %q\", fullPath)\n}", "title": "" }, { "docid": "ecf48086a0f518c610ac93acc3929999", "score": "0.54916406", "text": "func TestMkdir(t *testing.T) {\n\ttmpdir, err := ioutil.TempDir(\"\", \"com.bengfort.urfs-\")\n\tif err != nil {\n\t\tt.Error(err.Error())\n\t}\n\n\tdefer os.RemoveAll(tmpdir)\n\n\t// create a random directory path\n\tpath := filepath.Join(tmpdir, \"testing123\")\n\n\t// check the path does not exist\n\tif _, err := os.Stat(path); !os.IsNotExist(err) {\n\t\tt.Errorf(\"%s alaready exists\", path)\n\t}\n\n\t// create the directory\n\tif err := Mkdir(path); err != nil {\n\t\tt.Fatal(err.Error())\n\t}\n\n\t// check the path does exist\n\tif _, err := os.Stat(path); os.IsNotExist(err) {\n\t\tt.Fatalf(\"%s not correctly created\", path)\n\t}\n\n\t// create again, but no error should occur\n\tif err := Mkdir(path); err != nil {\n\t\tt.Fatal(err.Error())\n\t}\n\n\t// check the path does exist\n\tif _, err := os.Stat(path); os.IsNotExist(err) {\n\t\tt.Fatalf(\"%s not correctly created\", path)\n\t}\n}", "title": "" }, { "docid": "99916f06c7ff0a9156d33125278461da", "score": "0.5485306", "text": "func write(filePath string, data []byte) error {\n\twriteFile, err := os.Create(filePath)\n\tif err != nil {\n\t\treturn err\n\t}\n\n\tdefer closeFile(writeFile)\n\n\t_, err = writeFile.Write(data)\n\tif err != nil {\n\t\treturn err\n\t}\n\n\terr = writeFile.Sync()\n\tif err != nil {\n\t\treturn err\n\t}\n\n\treturn nil\n}", "title": "" }, { "docid": "f98bfa8cd121cc263d3a167320b42195", "score": "0.54842526", "text": "func TempFile(prefix string, perm os.FileMode) (f *os.File, err error) {\n\n\tnconflict := 0\n\tfor i := 0; i < 10000; i++ {\n\t\tname := filepath.Join(os.TempDir(), prefix+nextRandom())\n\t\tf, err = os.OpenFile(name, os.O_RDWR|os.O_CREATE|os.O_EXCL, perm)\n\t\tif os.IsExist(err) {\n\t\t\tif nconflict++; nconflict > 10 {\n\t\t\t\trandmu.Lock()\n\t\t\t\trand = reseed()\n\t\t\t\trandmu.Unlock()\n\t\t\t}\n\t\t\tcontinue\n\t\t}\n\t\tbreak\n\t}\n\treturn\n}", "title": "" }, { "docid": "7bd12a1926846e45fa12654fdfc7881e", "score": "0.54752314", "text": "func CreateTempDir() (string, error) {\n\tvar path string\n\tvar err error\n\tpath, err = ioutil.TempDir(\"\", \"\")\n\tif err != nil { return \"\", err }\n\tfmt.Println(\"Creating test directory \" + path)\n\treturn path, err\n}", "title": "" }, { "docid": "a9bc9987390c7a42148c0cf01ab3bcef", "score": "0.54735315", "text": "func createTempFile(size int64) (string, []byte, error) {\n\tdata := make([]byte, size)\n\trand.Read(data)\n\n\tf, err := ioutil.TempFile(\"\", \"\")\n\tif err != nil {\n\t\treturn \"\", nil, err\n\t}\n\tdefer f.Close()\n\tif _, err := f.Write(data); err != nil {\n\t\treturn \"\", nil, err\n\t}\n\n\tf.Seek(0, 0)\n\th := md5.New()\n\tif _, err := io.Copy(h, f); err != nil {\n\t\treturn f.Name(), nil, err\n\t}\n\n\treturn f.Name(), h.Sum(nil), nil\n}", "title": "" }, { "docid": "9c3316602f6654cb6ecd9881d55e7770", "score": "0.5463998", "text": "func writeFile(filename string, data []byte, perm os.FileMode) error {\n\tf, err := run.os.OpenFile(filename, os.O_WRONLY|os.O_CREATE|os.O_TRUNC, perm)\n\tif err != nil {\n\t\terr = run.os.Remove(filename)\n\t\tif err != nil {\n\t\t\treturn err\n\t\t}\n\t\tf, err = run.os.OpenFile(filename, os.O_WRONLY|os.O_CREATE, perm)\n\t\tif err != nil {\n\t\t\treturn err\n\t\t}\n\t}\n\tn, err := f.Write(data)\n\tif err == nil && n < len(data) {\n\t\terr = io.ErrShortWrite\n\t}\n\tif err1 := f.Close(); err == nil {\n\t\terr = err1\n\t}\n\treturn err\n}", "title": "" }, { "docid": "91afb3e4fb61dcdfee5b44e37eba72b5", "score": "0.5463978", "text": "func tempFile(t *testing.T, data []byte) string {\n\ttmp, err := os.CreateTemp(\"\", \"kubeconfig\")\n\tif err != nil {\n\t\tt.Fatal(err)\n\t}\n\n\tif len(data) > 0 {\n\t\tif _, err := tmp.Write(data); err != nil {\n\t\t\tt.Fatal(err)\n\t\t}\n\t}\n\n\tif err := tmp.Close(); err != nil {\n\t\tt.Fatal(err)\n\t}\n\n\treturn tmp.Name()\n}", "title": "" }, { "docid": "595311073b334b7d843dc2118bfa2e5b", "score": "0.5460206", "text": "func (ta *testAPI) createNewFileInsideNewDirectory(t *testing.T, toEncrypt bool) {\n\tdat, err := ta.initSubtest(\"createNewFileInsideNewDirectory\")\n\tif err != nil {\n\t\tt.Fatalf(\"Couldn't initialize subtest dirs: %v\", err)\n\t}\n\tdefer os.RemoveAll(dat.testDir)\n\n\tdat.toEncrypt = toEncrypt\n\tdat.testUploadDir = filepath.Join(dat.testDir, \"createinsidenewdir-upload\")\n\tdat.testMountDir = filepath.Join(dat.testDir, \"createinsidenewdir-mount\")\n\tdat.files = make(map[string]fileInfo)\n\tdat.files[\"1.txt\"] = fileInfo{0700, 333, 444, testutil.RandomBytes(1, 10)}\n\n\tdat, err = ta.uploadAndMount(dat, t)\n\tif err != nil {\n\t\tt.Fatalf(\"Error during upload of files to swarm / mount of swarm dir: %v\", err)\n\t}\n\tdefer dat.swarmfs.Stop()\n\n\t// Create a new file inside a existing dir and check\n\tdirToCreate, err2 := addDir(dat.testMountDir, \"one\")\n\tif err2 != nil {\n\t\tt.Fatalf(\"Error creating mount dir2: %v\", err2)\n\t}\n\tactualPath := filepath.Join(dirToCreate, \"2.txt\")\n\td, err1 := os.OpenFile(actualPath, os.O_RDWR|os.O_CREATE, os.FileMode(0665))\n\tif err1 != nil {\n\t\tt.Fatalf(\"Could not create file %s : %v\", actualPath, err1)\n\t}\n\tdefer d.Close()\n\tlog.Debug(\"File opened\")\n\tcontents := testutil.RandomBytes(1, 11)\n\tlog.Debug(\"content read\")\n\t_, err = d.Write(contents)\n\tif err != nil {\n\t\tt.Fatalf(\"Error writing to file: %v\", err)\n\t}\n\tlog.Debug(\"content written\")\n\terr = d.Close()\n\tif err != nil {\n\t\tt.Fatalf(\"Error closing file: %v\", err)\n\t}\n\tlog.Debug(\"File closed\")\n\n\tmi, err2 := dat.swarmfs.Unmount(dat.testMountDir)\n\tif err2 != nil {\n\t\tt.Fatalf(\"Could not unmount %v\", err2)\n\t}\n\tlog.Debug(\"Directory unmounted\")\n\n\t// mount again and see if things are okay\n\tdat.files[\"one/2.txt\"] = fileInfo{0700, 333, 444, contents}\n\t_ = mountDir(t, ta.api, dat.files, mi.LatestManifest, dat.testMountDir)\n\tlog.Debug(\"Directory mounted again\")\n\n\tcheckFile(t, dat.testMountDir, \"one/2.txt\", contents)\n\t_, err2 = dat.swarmfs.Unmount(dat.testMountDir)\n\tif err2 != nil {\n\t\tt.Fatalf(\"Could not unmount %v\", err2)\n\t}\n\tlog.Debug(\"subtest terminated\")\n}", "title": "" }, { "docid": "119bb32e1764a636fda13c2ce29cf651", "score": "0.5457867", "text": "func generateFile(filePath string, data []byte) (int, error) {\n\tos.MkdirAll(path.Dir(filePath), os.ModePerm)\n\tfw, err := os.Create(filePath)\n\tif err != nil {\n\t\treturn 0, err\n\t}\n\tdefer fw.Close()\n\treturn fw.Write(data)\n}", "title": "" }, { "docid": "119bb32e1764a636fda13c2ce29cf651", "score": "0.5457867", "text": "func generateFile(filePath string, data []byte) (int, error) {\n\tos.MkdirAll(path.Dir(filePath), os.ModePerm)\n\tfw, err := os.Create(filePath)\n\tif err != nil {\n\t\treturn 0, err\n\t}\n\tdefer fw.Close()\n\treturn fw.Write(data)\n}", "title": "" }, { "docid": "83782d502a4b587a0be3b49f0fe07408", "score": "0.5453747", "text": "func write(name string, b []byte) (err error) {\n\ttmp, err := ioutil.TempFile(filepath.Dir(name), filepath.Base(name)+\".\")\n\tif err != nil {\n\t\treturn\n\t}\n\tpanicked := true\n\tdefer func() {\n\t\tif panicked || err != nil {\n\t\t\ttmp.Close()\n\t\t\tos.Remove(tmp.Name())\n\t\t}\n\t}()\n\tif _, err = tmp.Write(b); err == nil {\n\t\tif err = tmp.Close(); err == nil {\n\t\t\terr = os.Rename(tmp.Name(), name)\n\t\t}\n\t}\n\tpanicked = false\n\treturn\n}", "title": "" }, { "docid": "05a5bb9d82af5f7a536e5bd369aa82ce", "score": "0.5446035", "text": "func CreateTempDir(parentDir, prefix string, stopper *stop.Stopper) (string, error) {\n\t// We generate a unique temporary directory with the specified prefix.\n\ttempPath, err := ioutil.TempDir(parentDir, prefix)\n\tif err != nil {\n\t\treturn \"\", err\n\t}\n\n\t// TempDir creates a directory with permissions 0700. Manually change the\n\t// permissions to be 0755 like every other directory created by cockroach.\n\tif err := os.Chmod(tempPath, 0755); err != nil {\n\t\treturn \"\", err\n\t}\n\n\tabsPath, err := filepath.Abs(tempPath)\n\tif err != nil {\n\t\treturn \"\", err\n\t}\n\n\t// Create a lock file.\n\tflock, err := lockFile(filepath.Join(absPath, lockFilename))\n\tif err != nil {\n\t\treturn \"\", errors.Wrapf(err, \"could not create lock on new temporary directory\")\n\t}\n\tstopper.AddCloser(stop.CloserFn(func() {\n\t\tif err := unlockFile(flock); err != nil {\n\t\t\tlog.Errorf(context.TODO(), \"could not unlock file lock on temporary directory: %s\", err.Error())\n\t\t}\n\t}))\n\n\treturn absPath, nil\n}", "title": "" }, { "docid": "3fbbb68e8af4318426761a2de846a5d4", "score": "0.54300106", "text": "func createTempFile(filename string) *os.File {\n\textension := filepath.Ext(filename)\n\tbasename := strings.TrimSuffix(filename, extension)\n\n\t// Create the file\n\ttempFile, err := ioutil.TempFile(\"\", basename+\"-\")\n\tif err != nil {\n\t\texitf(\"Failed to create temporary file \\\"%s\\\" (%s)\", filename, err)\n\t}\n\n\t// Do we need to rename the file?\n\tif extension != \"\" {\n\t\t// Close the currently open tempfile\n\t\ttempFile.Close()\n\n\t\t// Rename it\n\t\tnewTempFileName := tempFile.Name() + extension\n\t\terr = os.Rename(tempFile.Name(), newTempFileName)\n\t\tif err != nil {\n\t\t\texitf(\"Failed to rename \\\"%s\\\" to \\\"%s\\\" (%s)\", tempFile.Name(), newTempFileName, err)\n\t\t}\n\n\t\t// Open it again\n\t\ttempFile, err = os.OpenFile(newTempFileName, os.O_RDWR|os.O_EXCL, 0600)\n\t\tif err != nil {\n\t\t\texitf(\"Failed to open temporary file \\\"%s\\\" (%s)\", newTempFileName, err)\n\t\t}\n\t}\n\n\treturn tempFile\n}", "title": "" }, { "docid": "966595f4a62d998f124ebd99fd6d1ac8", "score": "0.5429547", "text": "func (m *manager) writeFile(location string, b []byte) error {\n\tfullPath := m.makeFilePath(location)\n\ttmpfile := fmt.Sprintf(\"%s.tmp\", fullPath)\n\tif err := ioutil.WriteFile(tmpfile, b, 0644); err != nil {\n\t\treturn fmt.Errorf(\"error writing to %s: %s\", tmpfile, err)\n\t}\n\tif err := os.Rename(tmpfile, fullPath); err != nil {\n\t\treturn fmt.Errorf(\"error renaming %s to %s: %s\", tmpfile, fullPath, err)\n\t}\n\treturn nil\n}", "title": "" }, { "docid": "36d21b10e24cfc5d69afd9c239966d73", "score": "0.5418911", "text": "func writeToTempConfigFile(cmd *nuget.Cmd, tempDirPath string) (*os.File, error) {\n\tconfigFile, err := ioutil.TempFile(tempDirPath, \"jfrog.cli.nuget.\")\n\tif err != nil {\n\t\treturn nil, errorutils.CheckError(err)\n\t}\n\tlog.Debug(\"Nuget config file created at:\", configFile.Name())\n\n\tdefer configFile.Close()\n\n\tcmd.CommandFlags = append(cmd.CommandFlags, \"-ConfigFile\", configFile.Name())\n\n\t// Set Artifactory repo as source\n\tcontent := nuget.ConfigFileTemplate\n\t_, err = configFile.WriteString(content)\n\tif err != nil {\n\t\treturn nil, errorutils.CheckError(err)\n\t}\n\treturn configFile, nil\n}", "title": "" }, { "docid": "0f4b3e2da0c49a49cc091d2d4fea159f", "score": "0.5416467", "text": "func TempFdOrFatal(fPattern, contents string, t *testing.T) *os.File {\n\tfd, err := ioutil.TempFile(\"\", fPattern)\n\tif err != nil {\n\t\tt.Fatal(err)\n\t}\n\tif _, err := fd.Write([]byte(contents)); err != nil {\n\t\tt.Fatal(err)\n\t}\n\tif err := fd.Close(); err != nil {\n\t\tt.Fatal(err)\n\t}\n\n\treturn fd\n}", "title": "" }, { "docid": "c6d5d9118681e3783cc8f0e7bbd207d4", "score": "0.54120386", "text": "func WriteFile(filename string, data []byte, perm os.FileMode) error {\n\tdir, name := filepath.Split(filename)\n\tf, err := ioutil.TempFile(dir, name)\n\tif err != nil {\n\t\treturn err\n\t}\n\tdefer closeOrPanic(f)\n\n\tname = f.Name()\n\tdefer func() {\n\t\t// Ensure tempfile is deleted\n\t\tif err := os.Remove(name); err != nil {\n\t\t\tif !os.IsNotExist(err) {\n\t\t\t\tlog.Printf(\"[ERROR] tempfile: %v\", err)\n\t\t\t}\n\t\t}\n\t}()\n\n\tif err := ioutil.WriteFile(name, data, perm); err != nil {\n\t\treturn err\n\t}\n\n\treturn os.Rename(name, filename)\n}", "title": "" }, { "docid": "dd08b6e3db207be8285fe239e5fdda27", "score": "0.5390496", "text": "func createFile(lines []string, pth string, created time.Time) {\n\tw, _ := file.NewWriter(pth, nil)\n\n\tfor _, ln := range lines {\n\t\tw.WriteLine([]byte(ln))\n\t}\n\tw.Close()\n\tpth = w.Stats().Path // full path\n\n\t// set created date\n\tos.Chtimes(pth, created, created)\n}", "title": "" }, { "docid": "b3216954a08a264c389e6c11d82c51d1", "score": "0.53902495", "text": "func FileWriter(t *testing.T) (*os.File, error) {\n\t// the ReplaceAll ensures no nested directories are needed when sub-tests are used\n\tfilename := strings.ReplaceAll(fmt.Sprintf(\"%s.log\", t.Name()), \"/\", \"_\")\n\n\treturn os.OpenFile(filename, os.O_APPEND|os.O_WRONLY|os.O_CREATE, 0600)\n}", "title": "" }, { "docid": "8fe0bb24acbb4970f171234e3632f281", "score": "0.53888315", "text": "func toFile(path string, data []byte) error {\n\treturn ioutil.WriteFile(path, data, 0644)\n}", "title": "" }, { "docid": "ec3d34e8ef8086ddd8cc7390f6760443", "score": "0.53830737", "text": "func atomicWriteFile(path string, b []byte) error {\n\ttmp, err := os.CreateTemp(filepath.Dir(path), filepath.Base(path))\n\tif err != nil {\n\t\treturn fmt.Errorf(\"failed to create temporary file %s: %w\", path, err)\n\t}\n\tdefer func() { contract.Ignore(os.Remove(tmp.Name())) }()\n\n\tif err = tmp.Chmod(0o600); err != nil {\n\t\treturn fmt.Errorf(\"failed to set temporary file permission: %w\", err)\n\t}\n\tif _, err = tmp.Write(b); err != nil {\n\t\treturn fmt.Errorf(\"failed to write to temporary file: %w\", err)\n\t}\n\tif err = tmp.Sync(); err != nil {\n\t\treturn err\n\t}\n\tif err = tmp.Close(); err != nil {\n\t\treturn err\n\t}\n\treturn os.Rename(tmp.Name(), path)\n}", "title": "" } ]
534105659f6cca487ee437336eeba3f3
SubBalance is a paid mutator transaction binding the contract method 0xcf8eeb7e. Solidity: function subBalance(address key, uint256 value) returns()
[ { "docid": "899b1bf3583a51260e333fe8e3d8be1e", "score": "0.80320185", "text": "func (_ReserveDollarEternalStorage *ReserveDollarEternalStorageTransactorSession) SubBalance(key common.Address, value *big.Int) (*types.Transaction, error) {\n\treturn _ReserveDollarEternalStorage.Contract.SubBalance(&_ReserveDollarEternalStorage.TransactOpts, key, value)\n}", "title": "" } ]
[ { "docid": "4f1e6175bc01859a0b35a06e7364b363", "score": "0.81449497", "text": "func (_ReserveDollarEternalStorage *ReserveDollarEternalStorageTransactor) SubBalance(opts *bind.TransactOpts, key common.Address, value *big.Int) (*types.Transaction, error) {\n\treturn _ReserveDollarEternalStorage.contract.Transact(opts, \"subBalance\", key, value)\n}", "title": "" }, { "docid": "7262ec40c83a932cb8a5d1fe0699d300", "score": "0.800835", "text": "func (_ReserveDollarEternalStorage *ReserveDollarEternalStorageSession) SubBalance(key common.Address, value *big.Int) (*types.Transaction, error) {\n\treturn _ReserveDollarEternalStorage.Contract.SubBalance(&_ReserveDollarEternalStorage.TransactOpts, key, value)\n}", "title": "" }, { "docid": "ccaa26b7af73eb2abe0fcb69111de300", "score": "0.7621918", "text": "func (s *stateAccount) SubBalance(coinSymbol types.CoinSymbol, amount *big.Int) {\n\tif amount.Sign() == 0 {\n\t\treturn\n\t}\n\ts.SetBalance(coinSymbol, new(big.Int).Sub(s.Balance(coinSymbol), amount))\n}", "title": "" }, { "docid": "7811e5c42236b209bf1eedd52b54b4bf", "score": "0.75432277", "text": "func (c *stateObject) SubBalance(amount *big.Int) {\n\tif amount.Sign() == 0 {\n\t\treturn\n\t}\n\tc.SetBalance(new(big.Int).Sub(c.Balance(), amount))\n}", "title": "" }, { "docid": "7ecd1add83de7cfc4055d0d2f602bc2c", "score": "0.7488977", "text": "func (s *stateObject) SubBalance(amount *big.Int) {\n\tif amount.Sign() == 0 {\n\t\treturn\n\t}\n\ts.SetBalance(new(big.Int).Sub(s.Balance(), amount))\n}", "title": "" }, { "docid": "ea2e7abd783b8a64822145936773cad6", "score": "0.74356645", "text": "func (state *Object) SubBalance(amount uint64) {\n\tif amount == 0 {\n\t\treturn\n\t}\n\tstate.SetBalance(state.Balance() - amount)\n}", "title": "" }, { "docid": "d8cbd0701dede1201755aa76a3658628", "score": "0.68641704", "text": "func Sub(conn *sqlite.Conn,\n\tadr *factom.FAAddress, sub uint64) (id int64, txErr, err error) {\n\tif sub == 0 {\n\t\t// Allow tx's with zeros to result in an INSERT.\n\t\tid, err = Add(conn, adr, 0)\n\t\treturn id, nil, err\n\t}\n\tid, err = SelectID(conn, adr)\n\tif err != nil {\n\t\tif err.Error() == sqlitexNoResultsErr {\n\t\t\treturn id, fmt.Errorf(\"insufficient balance: %v\", adr), nil\n\t\t}\n\t\treturn id, nil, err\n\t}\n\tif id < 0 {\n\t\treturn id, fmt.Errorf(\"insufficient balance: %v\", adr), nil\n\t}\n\tstmt := conn.Prep(\n\t\t`UPDATE \"address\" SET \"balance\" = \"balance\" - ? WHERE \"rowid\" = ?;`)\n\tstmt.BindInt64(1, int64(sub))\n\tstmt.BindInt64(2, id)\n\tif _, err := stmt.Step(); err != nil {\n\t\tif sqlite.ErrCode(err) == sqlite.SQLITE_CONSTRAINT_CHECK {\n\t\t\treturn id, fmt.Errorf(\"insufficient balance: %v\", adr), nil\n\t\t}\n\t\treturn id, nil, err\n\t}\n\tif conn.Changes() == 0 {\n\t\tpanic(\"no balances updated\")\n\t}\n\treturn id, nil, nil\n}", "title": "" }, { "docid": "ed34239b75f7c4ca24adb72efcd4d7b1", "score": "0.65361714", "text": "func (bal Balance) Sub(other Balance) Balance {\n\tif other.Coins > bal.Coins || other.Hours > bal.Hours {\n\t\tlogger.Panic(\"Cannot subtract balances, second balance is too large\")\n\t}\n\treturn Balance{\n\t\tCoins: bal.Coins - other.Coins,\n\t\tHours: bal.Hours - other.Hours,\n\t}\n}", "title": "" }, { "docid": "f5f953eac54b5cd979718d563df1916a", "score": "0.64952785", "text": "func (b Bitcoin) Sub(v Bitcoin) Bitcoin {\n\treturn b.sub(v).(Bitcoin)\n}", "title": "" }, { "docid": "4c2350fcd60519a0fcc885696adf8192", "score": "0.64540786", "text": "func (m *MockStateFactory) SubBalance(addr *iotxaddress.Address, amount *big.Int) error {\n\tret := m.ctrl.Call(m, \"SubBalance\", addr, amount)\n\tret0, _ := ret[0].(error)\n\treturn ret0\n}", "title": "" }, { "docid": "58d165278b761c769aebf3d4e4698eb5", "score": "0.6448166", "text": "func (self *accountObject) SubBalance_gas(amount *big.Int) {\n\tif amount.Sign() == 0 {\n\t\treturn\n\t}\n\tself.SetBalance_gas(new(big.Int).Sub(self.GetBalance(), amount))\n}", "title": "" }, { "docid": "ee7186913b6c1bbd251ba615def2a6e4", "score": "0.63362384", "text": "func (bs *BalanceState) TrySubBalance(value *math.BigInt) error {\n\ttotalspent := math.NewBigInt(0)\n\ttotalspent.Value.Add(bs.spent.Value, value.Value)\n\t// check if (already spent + new spent) > confirmed balance\n\tif totalspent.Value.Cmp(bs.originBalance.Value) > 0 {\n\t\treturn fmt.Errorf(\"balance not enough\")\n\t}\n\tbs.spent.Value = totalspent.Value\n\treturn nil\n}", "title": "" }, { "docid": "1f2a29b77c6f9435fc898bc693fd5917", "score": "0.613635", "text": "func (_Bmat *BmatCallerSession) Bsub(a *big.Int, b *big.Int) (*big.Int, error) {\n\treturn _Bmat.Contract.Bsub(&_Bmat.CallOpts, a, b)\n}", "title": "" }, { "docid": "196b0204274bbf138c567b163ef3c667", "score": "0.6134355", "text": "func (m *Money) Sub(subtractVal Money) {\r\n\tsubtractVal.ToggleSign()\r\n\tm.Add(subtractVal)\r\n}", "title": "" }, { "docid": "4fbd6609b547c46ca0258c8e0765fcd7", "score": "0.6095538", "text": "func (p Price) Sub(sub Price) (Price, error) {\n\tnewPrice, err := p.currencyGuard(sub)\n\tif err != nil {\n\t\treturn newPrice, err\n\t}\n\tnewPrice.amount.Sub(&p.amount, &sub.amount)\n\treturn newPrice, nil\n}", "title": "" }, { "docid": "467b902b48e606ca8c2c196056c2857e", "score": "0.5998724", "text": "func (_Bmat *BmatSession) Bsub(a *big.Int, b *big.Int) (*big.Int, error) {\n\treturn _Bmat.Contract.Bsub(&_Bmat.CallOpts, a, b)\n}", "title": "" }, { "docid": "542575529abf6e8cc4b6c7381d5fb871", "score": "0.58883953", "text": "func (z *BytesAmount) Sub(y *BytesAmount) *BytesAmount {\n\tensureBytesAmounts(&z, &y)\n\tnewVal := big.NewInt(0)\n\tnewVal.Sub(z.val, y.val)\n\tnewZ := BytesAmount{val: newVal}\n\treturn &newZ\n}", "title": "" }, { "docid": "56eae45abb7eeeceb09f93de75a89c8c", "score": "0.5867481", "text": "func (h UIHash) Sub(b UIHash) UIHash {\n\treturn h.Add(b.Neg())\n}", "title": "" }, { "docid": "0f2b28315cc4ffed7023e32dc62412eb", "score": "0.57969964", "text": "func (_Mortgage *MortgageTransactor) SubFunds(opts *bind.TransactOpts) (*types.Transaction, error) {\n\treturn _Mortgage.contract.Transact(opts, \"subFunds\")\n}", "title": "" }, { "docid": "09bb14ad3096d027a91c738a0e56df91", "score": "0.57900876", "text": "func (t *TokenChaincode) balanceOf(APIstub shim.ChaincodeStubInterface, args []string) pb.Response {\n\t// Check we have a valid number of args\n\tif len(args) != 1 {\n\t\treturn shim.Error(\"Incorrect number of arguments, expecting 1\")\n\t}\n\n\taccount := strings.TrimSpace(args[0])\n\tif len(account) == 0 {\n\t\treturn shim.Error(\"Account must not be empty\")\n\t}\n\n\t// Get all deltas for the variable\n\tdeltaResultsIterator, deltaErr := APIstub.GetStateByPartialCompositeKey(compositeIndexName, []string{account})\n\tif deltaErr != nil {\n\t\treturn shim.Error(fmt.Sprintf(\"Could not retrieve value for %s: %s\", account, deltaErr.Error()))\n\t}\n\tdefer deltaResultsIterator.Close()\n\n\t// Check the variable existed\n\tif !deltaResultsIterator.HasNext() {\n\t\treturn shim.Error(fmt.Sprintf(\"No variable by the account %s exists\", account))\n\t}\n\n\t// Iterate through result set and compute final value\n\tvar finalVal float64\n\tvar i int\n\tfor i = 0; deltaResultsIterator.HasNext(); i++ {\n\t\t// Get the next row\n\t\tresponseRange, nextErr := deltaResultsIterator.Next()\n\t\tif nextErr != nil {\n\t\t\treturn shim.Error(nextErr.Error())\n\t\t}\n\n\t\t// Split the composite key into its component parts\n\t\t_, keyParts, splitKeyErr := APIstub.SplitCompositeKey(responseRange.Key)\n\t\tif splitKeyErr != nil {\n\t\t\treturn shim.Error(splitKeyErr.Error())\n\t\t}\n\n\t\t// Retrieve the values\n\t\tamountStr := keyParts[1]\n\t\top := keyParts[2]\n\n\t\t// Convert the amount string and perform the operation\n\t\tamount, convErr := strconv.ParseFloat(amountStr, 64)\n\t\tif convErr != nil {\n\t\t\treturn shim.Error(convErr.Error())\n\t\t}\n\n\t\tswitch op {\n\t\tcase \"+\":\n\t\t\tfinalVal += amount\n\t\tcase \"-\":\n\t\t\tfinalVal -= amount\n\t\tdefault:\n\t\t\treturn shim.Error(fmt.Sprintf(\"operation was not recognized: %s\", op))\n\t\t}\n\t}\n\n\treturn shim.Success([]byte(strconv.FormatFloat(finalVal, 'f', -1, 64)))\n}", "title": "" }, { "docid": "3f74b4f69f208a82902ce28883f1d2cc", "score": "0.5789866", "text": "func (c *chequebookContract) Balance(ctx context.Context) (*big.Int, error) {\n\t//callData, err := chequebookABI.Pack(\"balance\")\n\t//if err != nil {\n\t//\treturn nil, err\n\t//}\n\n\ttype CallData struct {\n\t\tCallApi string `json:\"CallApi\"`\n\t\tCallArgs string `json:\"CallArgs\"`\n\t}\n\n\tvar callData CallData\n\tcallData.CallApi = \"balance\"\n\tcallData.CallArgs = \"\"\n\n\tcallDataBytes, err := json.Marshal(callData)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\toutput, err := c.transactionService.Call(ctx, &transaction.TxRequest{\n\t\tTo: &c.address,\n\t\tData: callDataBytes,\n\t})\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\tbalance, ok := big.NewInt(0).SetString(string(output), 10)\n\tif !ok {\n\t\treturn nil, errors.New(\"invalid balance value\")\n\t}\n\n\treturn balance, nil\n}", "title": "" }, { "docid": "6e7127726ad1aa7ed9a4e6c2cd30a213", "score": "0.5745198", "text": "func GetBalance(conmap map[string]string) structures.Transaction {\n\n // owner := himitsu.HashPublicKey(conmap[\"pubkey\"])\n // ownair := himitsu.BaseDER(conmap[\"pubkey\"])\n owner := conmap[\"pubhash\"]\n ownair := conmap[\"pubder\"]\n thinair := structures.Coin{0, \"0\", \"0\", ownair}\n inputs := []structures.Coin{ thinair }\n thickair := structures.Coin{0, \"0\", \"0\", owner}\n outputs := []structures.Coin{ thickair }\n sig := methods.DoSign(conmap, outputs)\n tx := structures.Transaction{0, \"Balance\", inputs, outputs, sig}\n return tx\n\n}", "title": "" }, { "docid": "9f629cd1a6bb102572909144a0adcc4a", "score": "0.5682482", "text": "func (t *SimpleAsset) getBalance(stub shim.ChaincodeStubInterface, args []string) peer.Response {\n if len(args) != 1 {\n return shim.Error(\"Incorrect arguments. Expecting a key (client ID)\")\n }\n //client\n clientBytes, err := stub.GetState(args[0])\n if err != nil {\n \treturn shim.Error(err.Error())\n }\n c := client{}\n err = json.Unmarshal(clientBytes,&c) \n\tif err != nil {\n \treturn shim.Error(err.Error())\n }\n \n value := c.Balance\n name := c.Name\n log := fmt.Sprintf(\"%s Balance= %0.2f\" ,name, value)\n\tfmt.Println(log)\n return shim.Success([]byte(log))\n}", "title": "" }, { "docid": "67dceadc6a9f9da99c165379dc1a3658", "score": "0.5672334", "text": "func (_Bmat *BmatCaller) Bsub(opts *bind.CallOpts, a *big.Int, b *big.Int) (*big.Int, error) {\n\tvar out []interface{}\n\terr := _Bmat.contract.Call(opts, &out, \"bsub\", a, b)\n\n\tif err != nil {\n\t\treturn *new(*big.Int), err\n\t}\n\n\tout0 := *abi.ConvertType(out[0], new(*big.Int)).(**big.Int)\n\n\treturn out0, err\n\n}", "title": "" }, { "docid": "de20890a2de701c66e5be3380678e1de", "score": "0.5665796", "text": "func balance(contract *Power, user common.Address) *big.Int {\n\tb, _ := contract.BalanceOf(nil, user)\n\treturn b\n}", "title": "" }, { "docid": "5e1c85aaf86a5d8ba804a5162d769d3a", "score": "0.56504506", "text": "func (_ReserveDollarEternalStorage *ReserveDollarEternalStorageCaller) Balance(opts *bind.CallOpts, arg0 common.Address) (*big.Int, error) {\n\tvar (\n\t\tret0 = new(*big.Int)\n\t)\n\tout := ret0\n\terr := _ReserveDollarEternalStorage.contract.Call(opts, out, \"balance\", arg0)\n\treturn *ret0, err\n}", "title": "" }, { "docid": "1b128a2b03d64bcf723a0bd4de29cbef", "score": "0.55913717", "text": "func (_ERC20SimpleSwap *ERC20SimpleSwapCaller) Balance(opts *bind.CallOpts) (*big.Int, error) {\n\tvar (\n\t\tret0 = new(*big.Int)\n\t)\n\tout := ret0\n\terr := _ERC20SimpleSwap.contract.Call(opts, out, \"balance\")\n\treturn *ret0, err\n}", "title": "" }, { "docid": "442904137f35fcce1cac6877c273cdf3", "score": "0.55896795", "text": "func (flr *BlockFollower) getChildBalance(fa *model.FollowAsset) (string, error) {\n\n\tbuf, err := flr.requester.PostJson(\"balanceof\", fa)\n\tif err != nil {\n\t\treturn \"\", err\n\t}\n\n\ttmp := struct {\n\t\tData struct {\n\t\t\tData string `json:\"data\"`\n\t\t}\n\t\tErr string\n\t}{}\n\n\ter := json.Unmarshal(buf, &tmp)\n\n\tif er != nil {\n\t\treturn \"\", er\n\t}\n\n\tif tmp.Err != \"\" {\n\t\treturn \"\", errors.New(tmp.Err)\n\t}\n\n\treturn tmp.Data.Data, nil\n}", "title": "" }, { "docid": "c06ee181cbf8200358f696cdc420366c", "score": "0.55697364", "text": "func (cli *CLI) getBalance(address string) {\n\tif !wallets.ValidateAddress(address) {\n\t\tlog.Panic(\"ERROR: Address is not valid\")\n\t}\n\tbc := blockchain.NewBlockchain()\n\tUTXOSet := blockchain.UTXOSet{bc}\n\n\tbalance := 0\n\tpubKeyHash := utils.Base58Decode([]byte(address))\n\tpubKeyHash = pubKeyHash[1 : len(pubKeyHash)-4]\n\tUTXOs := UTXOSet.FindUTXO(pubKeyHash)\n\n\tfor _, out := range UTXOs {\n\t\tbalance += out.Value\n\t}\n\n\tfmt.Printf(\"Balance of '%s': %d\\n\", address, balance)\n\n\terr := bc.Db.Close()\n\tif err != nil {\n\t\tlog.Panic(err)\n\t}\n}", "title": "" }, { "docid": "1483d139aaca6d89eeb79feda74efcef", "score": "0.5520438", "text": "func (_ContractCar *ContractCarCaller) Balance(opts *bind.CallOpts) (uint16, error) {\n\tvar (\n\t\tret0 = new(uint16)\n\t)\n\tout := ret0\n\terr := _ContractCar.contract.Call(opts, out, \"balance\")\n\treturn *ret0, err\n}", "title": "" }, { "docid": "de75fd2bf03b33cc6675399ab9bee254", "score": "0.5518828", "text": "func GetBalance(this js.Value, args []js.Value) interface{} {\n\tfmt.Println(\"GetBalance started\")\n\tbalance, err := Client.BalanceAt(context.Background(), common.HexToAddress(\"0x263C3Ab7E4832eDF623fBdD66ACee71c028Ff591\"), nil)\n\tif err != nil {\n\t\tlog.Fatalln(\"Error getting balance. \", err.Error())\n\t\treturn \"0\"\n\t}\n\treturn balance.String()\n}", "title": "" }, { "docid": "1c14a685dcb6466bd3118de2945359e6", "score": "0.5515136", "text": "func (m MasterKey) SubKey(id string, size int) ([]byte, error) {\n\tmaterial := make([]byte, size)\n\tkdf := hkdf.New(sha256.New, m.material, nil, []byte(id))\n\tif _, err := io.ReadFull(kdf, material); err != nil {\n\t\treturn nil, err\n\t}\n\treturn material, nil\n}", "title": "" }, { "docid": "30401e3d8ba787071e0e1447dd08bca7", "score": "0.54958886", "text": "func (b *Builder) Sub(x, y *Value) *Value {\n\tassertTypesEqual(x.Type(), y.Type())\n\tty := Scalar(x.Type())\n\tswitch {\n\tcase IsInteger(ty):\n\t\treturn b.val(x.Type(), b.llvm.CreateSub(x.llvm, y.llvm, x.Name()+\"-\"+y.Name()))\n\tcase IsFloat(ty):\n\t\treturn b.val(x.Type(), b.llvm.CreateFSub(x.llvm, y.llvm, x.Name()+\"-\"+y.Name()))\n\tdefault:\n\t\tpanic(fmt.Errorf(\"Cannot subtract values of type %v\", ty))\n\t}\n}", "title": "" }, { "docid": "b511d8a22e8a831206607950b31c9b32", "score": "0.5471525", "text": "func (self *Backend) Balance(ctx context.Context, address common.Address) (*big.Int, error) {\n\tvar value *big.Int\n\terr := utils.Retry(ctx, 5, 2*time.Second, func() (err error) {\n\t\tvalue, err = self.goClient.BalanceAt(ctx, address, nil /* latest */)\n\t\treturn err\n\t})\n\treturn value, err\n}", "title": "" }, { "docid": "fbad75155b3cfbec29b9643cc3c8756f", "score": "0.5467456", "text": "func (pk *PubKey) Sub(ct1, ct2 *big.Int) *big.Int {\n\tneg := new(big.Int).ModInverse(ct2, pk.NN)\n\tneg.Mul(ct1, neg)\n\treturn neg.Mod(neg, pk.NN)\n}", "title": "" }, { "docid": "c66e4fe8a25da35c993dcce5d0be9aab", "score": "0.5448194", "text": "func (mr *MockStateFactoryMockRecorder) SubBalance(addr, amount interface{}) *gomock.Call {\n\treturn mr.mock.ctrl.RecordCallWithMethodType(mr.mock, \"SubBalance\", reflect.TypeOf((*MockStateFactory)(nil).SubBalance), addr, amount)\n}", "title": "" }, { "docid": "5a654ae1f12071a603ef8640331eb940", "score": "0.5439632", "text": "func (cli *CLI) getBalance(address, nodeID string) {\n\tif !ValidateAddress(address) {\n\t\tlog.Panic(\"ERROR: Address is not valid\")\n\t}\n\tbc := NewBlockchain(nodeID)\n\tUTXOSet := UTXOSet{bc}\n\tdefer bc.db.Close()\n\n\tbalance := 0\n\tpubKeyHash := Base58Decode([]byte(address))\n\tpubKeyHash = pubKeyHash[1 : len(pubKeyHash)-4]\n\tUTXOs := UTXOSet.FindUTXO(pubKeyHash)\n\n\tfor _, out := range UTXOs {\n\t\tbalance += out.Value\n\t}\n\n\tfmt.Printf(\"Balance of '%s': %d\\n\", address, balance)\n}", "title": "" }, { "docid": "ff01283001186faec571dbee9cf8ea15", "score": "0.54273653", "text": "func (_BaasROI *BaasROICaller) Balance(opts *bind.CallOpts) (*big.Int, error) {\n\tvar (\n\t\tret0 = new(*big.Int)\n\t)\n\tout := ret0\n\terr := _BaasROI.contract.Call(opts, out, \"balance\")\n\treturn *ret0, err\n}", "title": "" }, { "docid": "f767b63b75160dc77f18dadebeb9dbac", "score": "0.54250103", "text": "func (_ReserveDollarV2 *ReserveDollarV2Caller) BalanceOf(opts *bind.CallOpts, holder common.Address) (*big.Int, error) {\n\tvar (\n\t\tret0 = new(*big.Int)\n\t)\n\tout := ret0\n\terr := _ReserveDollarV2.contract.Call(opts, out, \"balanceOf\", holder)\n\treturn *ret0, err\n}", "title": "" }, { "docid": "d16d7e57b59ae431fa428592fe8b2f19", "score": "0.54228985", "text": "func (_ReserveDollarEternalStorage *ReserveDollarEternalStorageSession) Balance(arg0 common.Address) (*big.Int, error) {\n\treturn _ReserveDollarEternalStorage.Contract.Balance(&_ReserveDollarEternalStorage.CallOpts, arg0)\n}", "title": "" }, { "docid": "3d25ff1217929f7d4f8a5a0ccd091b26", "score": "0.53890663", "text": "func (_Mortgage *MortgageSession) SubFunds() (*types.Transaction, error) {\n\treturn _Mortgage.Contract.SubFunds(&_Mortgage.TransactOpts)\n}", "title": "" }, { "docid": "7a6dfed4a12c1ec7d0d766d5053254fa", "score": "0.53809315", "text": "func (e *P256Element) Sub(t1, t2 *P256Element) *P256Element {\n\tp256Sub(&e.x, &t1.x, &t2.x)\n\treturn e\n}", "title": "" }, { "docid": "52ad71911fad8d0b63edeecaff37a716", "score": "0.53680825", "text": "func (_ReserveDollarV2 *ReserveDollarV2CallerSession) BalanceOf(holder common.Address) (*big.Int, error) {\n\treturn _ReserveDollarV2.Contract.BalanceOf(&_ReserveDollarV2.CallOpts, holder)\n}", "title": "" }, { "docid": "34018b212c711e1eed7e77e36faf633c", "score": "0.5366912", "text": "func (_Gauge *GaugeCaller) DerivedBalance(opts *bind.CallOpts, account common.Address) (*big.Int, error) {\n\tvar out []interface{}\n\terr := _Gauge.contract.Call(opts, &out, \"derivedBalance\", account)\n\n\tif err != nil {\n\t\treturn *new(*big.Int), err\n\t}\n\n\tout0 := *abi.ConvertType(out[0], new(*big.Int)).(**big.Int)\n\n\treturn out0, err\n\n}", "title": "" }, { "docid": "a9eafbba9d69910bc1e4aa5be9828f80", "score": "0.53630465", "text": "func (w *PowergateWalletBackend) Balance(address string, userToken string) (*big.Int, error) {\n\treturn w.balance(address, userToken)\n}", "title": "" }, { "docid": "700f39f0530f720f0c46207a12220bca", "score": "0.5361154", "text": "func substract(stub shim.ChaincodeStubInterface, index string, value int) (int, error) {\n\tlog.Printf(\"-----> Substract\")\n\ta, err := stub.GetState(index)\n\tif err != nil {\n\t\treturn 0, fmt.Errorf(\"0_3_0 Couldn't access the state of %s : %s\", index, err)\n\t}\n\tlog.Printf(\" Value of the index %s before modification : %s\", index, a)\n\taInt, err := strconv.Atoi(string(a))\n\tif err != nil {\n\t\treturn 0, fmt.Errorf(\"0_3_1 Couldn't transform the value to int : %s\", err)\n\t}\n\tnewA := aInt - value\n\tif newA > 0 {\n\t\tif err := stub.PutState(index, []byte(strconv.Itoa(newA))); err != nil {\n\t\t\treturn 0, fmt.Errorf(\"0_3_2 Couldn't write the new value in the chaincode : s%s\", err)\n\t\t}\n\t\tlog.Printf(\" Value of the index after modification : %d\", newA)\n\t\tlog.Printf(\" END Substract\")\n\t\treturn newA, nil\n\t}\n\treturn 0, fmt.Errorf(\"0/3/4 Couldn't substract as not enough token\")\n}", "title": "" }, { "docid": "cf6b2f0b6378400dc065f639d0d12576", "score": "0.5350361", "text": "func (_AastraVault *AastraVaultCaller) BalanceOf(opts *bind.CallOpts, account common.Address) (*big.Int, error) {\n\tvar out []interface{}\n\terr := _AastraVault.contract.Call(opts, &out, \"balanceOf\", account)\n\n\tif err != nil {\n\t\treturn *new(*big.Int), err\n\t}\n\n\tout0 := *abi.ConvertType(out[0], new(*big.Int)).(**big.Int)\n\n\treturn out0, err\n\n}", "title": "" }, { "docid": "340e7a47380e14cf858d9bc5db57f363", "score": "0.5350018", "text": "func (_ReserveDollarEternalStorage *ReserveDollarEternalStorageCallerSession) Balance(arg0 common.Address) (*big.Int, error) {\n\treturn _ReserveDollarEternalStorage.Contract.Balance(&_ReserveDollarEternalStorage.CallOpts, arg0)\n}", "title": "" }, { "docid": "a224b7d2f4fb5fe42a357e5b2ed54044", "score": "0.5348279", "text": "func bSub(f *Forth) error {\n\tops, err := popNInt(&f.ds, 2)\n\tif err != nil {\n\t\treturn err\n\t}\n\tf.ds.Push(ops[1] - ops[0])\n\treturn nil\n}", "title": "" }, { "docid": "05ab28ca037988b04194df2469e2c87e", "score": "0.5348171", "text": "func GetAccountBalanceAtSnapshot(tezosAddr string, cycle int) (float64, error){\n snapShot, err := GetSnapShot(cycle)\n if (err != nil){\n return 0, errors.New(\"Could not get balance at snapshot for \" + tezosAddr + \": GetSnapShot(cycle int) failed: \" + err.Error())\n }\n\n hash, err := GetBlockLevelHash(snapShot.AssociatedBlock)\n //fmt.Println(hash)\n if (err != nil){\n return 0, errors.New(\"Could not get hash for block \" + strconv.Itoa(snapShot.AssociatedBlock) + \": GetBlockLevelHead() failed: \" + err.Error())\n }\n\n balanceCmdStr := \"/chains/main/blocks/\" + hash + \"/context/contracts/\" + tezosAddr + \"/balance\"\n\n s, err := TezosRPCGet(balanceCmdStr)\n if (err != nil){\n return 0, errors.New(\"Could not get balance at snapshot for \" + tezosAddr + \": TezosRPCGet(arg string) failed: \" + err.Error())\n }\n\n var returnBalance float64\n var regGetBalance []string\n\n if (strings.Contains(s,\"No service found at this URL\")){\n returnBalance = 0\n } else{\n regGetBalance = reGetBalance.FindStringSubmatch(s)\n if (regGetBalance == nil){\n return 0, errors.New(\"Could not parse balance for \" + s)\n }\n }\n\n if (len(regGetBalance) < 1){\n returnBalance = 0\n } else{\n floatBalance, _ := strconv.ParseFloat(regGetBalance[1], 64) //TODO error checking\n returnBalance = floatBalance\n }\n\n return returnBalance / 1000000, nil\n}", "title": "" }, { "docid": "3c73c21ed4b3b968f41cf2ef09a48f1d", "score": "0.53461283", "text": "func (s *Service) Balance(c context.Context, mid int64, ip string) (data *model.Balance, err error) {\n\tif data, err = s.elec.Balance(c, mid, ip); err != nil {\n\t\tlog.Error(\"s.elec.Balance error(%d, %v)\", mid, err)\n\t}\n\treturn\n}", "title": "" }, { "docid": "4916a1119e3c4dfb6331ad18d9476552", "score": "0.5343935", "text": "func (b *MockBackend) Balance(p wallet.Address, a channel.Asset) *big.Int {\n\tb.mu.Lock()\n\tdefer b.mu.Unlock()\n\treturn b.balance(p, a)\n}", "title": "" }, { "docid": "baabb641a71e5212f1aeff17322fe8a4", "score": "0.5327652", "text": "func (_Gauge *GaugeSession) DerivedBalance(account common.Address) (*big.Int, error) {\n\treturn _Gauge.Contract.DerivedBalance(&_Gauge.CallOpts, account)\n}", "title": "" }, { "docid": "24909236f80ba626fbcc73e0d0b46c05", "score": "0.53233385", "text": "func (_StandaloneERC20 *StandaloneERC20Caller) BalanceOf(opts *bind.CallOpts, account common.Address) (*big.Int, error) {\n\tvar (\n\t\tret0 = new(*big.Int)\n\t)\n\tout := ret0\n\terr := _StandaloneERC20.contract.Call(opts, out, \"balanceOf\", account)\n\treturn *ret0, err\n}", "title": "" }, { "docid": "b6ebef53e63d013e2fea9cc3a95117de", "score": "0.53233325", "text": "func (x Money) Sub(y Money) Money {\n\tvar (\n\t\twhole uint\n\t\tpart uint\n\t)\n\tif x.Part < y.Part {\n\t\twhole = x.Whole - y.Whole - 1\n\t\tpart = 100 + x.Part - y.Part\n\t} else {\n\t\twhole = x.Whole - y.Whole\n\t\tpart = x.Part - y.Part\n\t}\n\treturn Money{whole, part}\n}", "title": "" }, { "docid": "1671ef1de9da404ec6a4d6fd840afb0e", "score": "0.5321882", "text": "func (_Gauge *GaugeCallerSession) DerivedBalance(account common.Address) (*big.Int, error) {\n\treturn _Gauge.Contract.DerivedBalance(&_Gauge.CallOpts, account)\n}", "title": "" }, { "docid": "4be9d8c59b0ee987b78370aeacdb09ef", "score": "0.5321731", "text": "func (_Mortgage *MortgageTransactorSession) SubFunds() (*types.Transaction, error) {\n\treturn _Mortgage.Contract.SubFunds(&_Mortgage.TransactOpts)\n}", "title": "" }, { "docid": "0dd4e40fc286c368fc408848d23ba563", "score": "0.5311904", "text": "func (_Jifen *JifenCallerSession) BalanceOf(arg0 [32]byte) (*big.Int, error) {\n\treturn _Jifen.Contract.BalanceOf(&_Jifen.CallOpts, arg0)\n}", "title": "" }, { "docid": "9af898979a2734435d431924ca67dbd7", "score": "0.5300238", "text": "func Test_crcy_Currency_SubInt_(t *testing.T) {\n\tTBegin(t)\n\t//\n\t// (n Currency) SubInt(nums...int) Currency\n\t//\n\ttest := func(n Currency, nums []int, expect Currency) {\n\t\tcurIntOpTest(t, \"SubInt\", n.SubInt, n, nums, expect, 0)\n\t}\n\ttest(cur(0), arI(0), cur(0))\n\t// TODO: more unit test cases\n}", "title": "" }, { "docid": "20e7317454096a212822f9879003db10", "score": "0.5291429", "text": "func (_IUniswapV2Pair *IUniswapV2PairCallerSession) BalanceOf(owner common.Address) (*big.Int, error) {\n\treturn _IUniswapV2Pair.Contract.BalanceOf(&_IUniswapV2Pair.CallOpts, owner)\n}", "title": "" }, { "docid": "a91c4f4f8eee9520bdc789054ab0e202", "score": "0.5291162", "text": "func (_AastraVault *AastraVaultCallerSession) BalanceOf(account common.Address) (*big.Int, error) {\n\treturn _AastraVault.Contract.BalanceOf(&_AastraVault.CallOpts, account)\n}", "title": "" }, { "docid": "12ee9b12042ba6070826c3375c69af74", "score": "0.52900434", "text": "func (_IUniswapV2Pair *IUniswapV2PairCaller) BalanceOf(opts *bind.CallOpts, owner common.Address) (*big.Int, error) {\n\tvar out []interface{}\n\terr := _IUniswapV2Pair.contract.Call(opts, &out, \"balanceOf\", owner)\n\n\tif err != nil {\n\t\treturn *new(*big.Int), err\n\t}\n\n\tout0 := *abi.ConvertType(out[0], new(*big.Int)).(**big.Int)\n\n\treturn out0, err\n\n}", "title": "" }, { "docid": "c79d581cb7fb03c3709c3f9be91fa32c", "score": "0.52892053", "text": "func (c *Client) GetBalance(usage string, owner *[ed25519.PublicKeySize]byte) int64 {\n\treturn c.walletStore.GetBalance(usage, owner)\n}", "title": "" }, { "docid": "ba2c0e0a08067f898202d5f659e236b2", "score": "0.528586", "text": "func (_ReserveDollarEternalStorage *ReserveDollarEternalStorageSession) SetBalance(key common.Address, value *big.Int) (*types.Transaction, error) {\n\treturn _ReserveDollarEternalStorage.Contract.SetBalance(&_ReserveDollarEternalStorage.TransactOpts, key, value)\n}", "title": "" }, { "docid": "3ff31947e8ed6ab53e90d9d0431cd525", "score": "0.5283976", "text": "func (u *Uint128) Sub(value Uint128) {\n\tu.Lo -= value.Lo\n\tif u.Lo > value.Lo {\n\t\tu.Hi--\n\t}\n\tu.Hi -= value.Hi\n}", "title": "" }, { "docid": "9e405fff0f1c9f3034436392fac1ba67", "score": "0.5283947", "text": "func (_Bmat *BmatSession) BsubSign(a *big.Int, b *big.Int) (*big.Int, bool, error) {\n\treturn _Bmat.Contract.BsubSign(&_Bmat.CallOpts, a, b)\n}", "title": "" }, { "docid": "8949843576532241e7927efa68485283", "score": "0.5280094", "text": "func (_ReserveDollarEternalStorage *ReserveDollarEternalStorageTransactorSession) SetBalance(key common.Address, value *big.Int) (*types.Transaction, error) {\n\treturn _ReserveDollarEternalStorage.Contract.SetBalance(&_ReserveDollarEternalStorage.TransactOpts, key, value)\n}", "title": "" }, { "docid": "8ae5b5c12d8d99f77b76aa43e8bb19d4", "score": "0.527869", "text": "func Test_crcy_Currency_Sub_(t *testing.T) {\n\tTBegin(t)\n\t//\n\t// (n Currency) Sub(nums... Currency) Currency\n\t//\n\ttest := func(n Currency, nums []Currency, expect Currency) {\n\t\tcurOpTest(t, \"Sub\", n.Sub, n, nums, expect, 0)\n\t}\n\t//\n\t// test subtractions within range of Currency:\n\t//\n\ttest(cur(0), arC(0), cur(0))\n\ttest(cur(0.0001), arC(0.0001), cur(0))\n\ttest(cur(0), arC(0.0001), cur(-0.0001))\n\ttest(cur(1), arC(1), cur(0))\n\ttest(cur(10), arC(1, 2, 3), cur(4))\n\ttest(cur(int64(1234567891234)), arC(67891234), cur(int64(1234500000000)))\n\ttest(cur(2), arC(1), cur(1))\n\ttest(cur(2000), arC(1000), cur(1000))\n\ttest(cur(-2), arC(-1), cur(-1))\n\t//\n\t// multiple subtractions:\n\ttest(cur(11.1234), arC(4.0004, 3.003, 2.02, 1.1), cur(1))\n\t//\n\t// test subtraction close to the limits of Currency:\n\t//\n\t// largest - largest number: must be to zero\n\ttest(\n\t\tCurrency{MaxCurrencyI64}, // 9223372036854769999\n\t\tarC(Currency{MaxCurrencyI64}), // 9223372036854769999\n\t\tCurrency{0},\n\t)\n\t// -922337203685476.9999 - -0.9999 = -922337203685476\n\ttest(\n\t\tCurrency{-9223372036854769999},\n\t\tarC(Currency{-9999}),\n\t\tCurrency{-9223372036854760000},\n\t)\n\ttest(\n\t\tCurrency{MinCurrencyI64},\n\t\tarC(Currency{-9223372036854760000}),\n\t\tCurrency{-9999},\n\t)\n\t// -922337203685476.9999 - -922337203685476.9998 = -0.0001\n\ttest(\n\t\tCurrency{MinCurrencyI64},\n\t\tarC(Currency{-9223372036854769998}),\n\t\tCurrency{-1},\n\t)\n\t// -922337203685476.9999 - 0.0001 = -922337203685476.9998\n\ttest(\n\t\tCurrency{MinCurrencyI64},\n\t\tarC(Currency{-1}),\n\t\tCurrency{-9223372036854769998},\n\t)\n\t// 922337203685476.9999 - 922337203685476 = 0.9999\n\ttest(\n\t\tCurrency{MaxCurrencyI64},\n\t\tarC(Currency{9223372036854760000}),\n\t\tCurrency{9999},\n\t)\n\t// 922337203685476.9999 - -0.9999 = 922337203685476\n\ttest(\n\t\tCurrency{9223372036854760000},\n\t\tarC(Currency{-9999}),\n\t\tCurrency{MaxCurrencyI64},\n\t)\n\t// 922337203685476.9999 - 922337203685476.9998 = 0.0001\n\ttest(\n\t\tCurrency{MaxCurrencyI64},\n\t\tarC(Currency{9223372036854769998}),\n\t\tCurrency{1},\n\t)\n\t// 922337203685476.9999 - 0.0001 = 922337203685476.9998\n\ttest(\n\t\tCurrency{MaxCurrencyI64},\n\t\tarC(Currency{1}),\n\t\tCurrency{9223372036854769998},\n\t)\n\t// test subtraction that will overflow Currency:\n\tDisableErrors()\n\ttest = func(n Currency, nums []Currency, expect Currency) {\n\t\tcurOpTest(t, \"Sub\", n.Sub, n, nums, expect, 1)\n\t}\n\t// subtracting 0.0001 from the smallest number must overflow\n\ttest(\n\t\tCurrency{MinCurrencyI64}, // -922337203685476.9999\n\t\tarC(Currency{1}), // -0.0001\n\t\tCurrency{math.MinInt64},\n\t)\n\t// subtracting -0.0001 from the largest number must overflow\n\ttest(\n\t\tCurrency{MaxCurrencyI64}, // 922337203685476.9999\n\t\tarC(Currency{-1}), // 0.0001\n\t\tCurrency{math.MaxInt64},\n\t)\n\t// subtracting largest from smallest number must overflow\n\ttest(\n\t\tCurrency{MinCurrencyI64}, // -922337203685476.9999\n\t\tarC(Currency{MaxCurrencyI64}), // 922337203685476.9999\n\t\tCurrency{math.MinInt64},\n\t)\n\t// subtracting smallest from largest number must overflow\n\ttest(\n\t\tCurrency{MaxCurrencyI64}, // 922337203685476.9999\n\t\tarC(Currency{MinCurrencyI64}), // -922337203685476.9999\n\t\tCurrency{math.MaxInt64},\n\t)\n\tEnableErrors()\n}", "title": "" }, { "docid": "de854290c75e31e523dafb24dc6763bd", "score": "0.5276968", "text": "func (_ERC20SimpleSwap *ERC20SimpleSwapCallerSession) Balance() (*big.Int, error) {\n\treturn _ERC20SimpleSwap.Contract.Balance(&_ERC20SimpleSwap.CallOpts)\n}", "title": "" }, { "docid": "8d48f2c04fe0c4d480a034e08d28a9b8", "score": "0.52736866", "text": "func (_Jifen *JifenSession) BalanceOf(arg0 [32]byte) (*big.Int, error) {\n\treturn _Jifen.Contract.BalanceOf(&_Jifen.CallOpts, arg0)\n}", "title": "" }, { "docid": "f27e38252735514bb006bd7527a1a086", "score": "0.52614415", "text": "func (_ERC20SimpleSwap *ERC20SimpleSwapSession) Balance() (*big.Int, error) {\n\treturn _ERC20SimpleSwap.Contract.Balance(&_ERC20SimpleSwap.CallOpts)\n}", "title": "" }, { "docid": "9ae0bcd513d55da37bc4f121a5376288", "score": "0.52607006", "text": "func (_Store *StoreCaller) Getbalance(opts *bind.CallOpts, fromtoken common.Address) (*big.Int, error) {\n\tvar out []interface{}\n\terr := _Store.contract.Call(opts, &out, \"getbalance\", fromtoken)\n\n\tif err != nil {\n\t\treturn *new(*big.Int), err\n\t}\n\n\tout0 := *abi.ConvertType(out[0], new(*big.Int)).(**big.Int)\n\n\treturn out0, err\n\n}", "title": "" }, { "docid": "60f6034bdfc9a7f34736bbbdc436ff48", "score": "0.5259676", "text": "func (_ERC20Pausable *ERC20PausableCaller) BalanceOf(opts *bind.CallOpts, account common.Address) (*big.Int, error) {\n\tvar (\n\t\tret0 = new(*big.Int)\n\t)\n\tout := ret0\n\terr := _ERC20Pausable.contract.Call(opts, out, \"balanceOf\", account)\n\treturn *ret0, err\n}", "title": "" }, { "docid": "776c45fc390cbc8c58687ef935f2ff6b", "score": "0.52576685", "text": "func (rd *RootDomain) GetBalance(reference string) uint {\n\tw := wallet.GetImplementationFrom(core.NewRefFromBase58(reference))\n\treturn w.GetTotalBalance()\n}", "title": "" }, { "docid": "6ce0f409c0c0121f933d0856def64b56", "score": "0.5252943", "text": "func (_ERC20Mintable *ERC20MintableCaller) BalanceOf(opts *bind.CallOpts, account common.Address) (*big.Int, error) {\n\tvar (\n\t\tret0 = new(*big.Int)\n\t)\n\tout := ret0\n\terr := _ERC20Mintable.contract.Call(opts, out, \"balanceOf\", account)\n\treturn *ret0, err\n}", "title": "" }, { "docid": "764c99ed06cfe99ddc9a1e762d65b791", "score": "0.52514166", "text": "func (_Vault *VaultCaller) BalanceOf(opts *bind.CallOpts) (*big.Int, error) {\n\tvar out []interface{}\n\terr := _Vault.contract.Call(opts, &out, \"balanceOf\")\n\n\tif err != nil {\n\t\treturn *new(*big.Int), err\n\t}\n\n\tout0 := *abi.ConvertType(out[0], new(*big.Int)).(**big.Int)\n\n\treturn out0, err\n\n}", "title": "" }, { "docid": "fd2757ca99431d1502efa08e575e0b99", "score": "0.52485186", "text": "func (kr *kiwiRedis) SubKey(key string) string {\n\tkr.lock.Lock()\n\tdefer kr.lock.Unlock()\n\n\tif v, ok := kr.v[key]; ok {\n\t\treturn v\n\t}\n\tres := aredis.Client.HGet(kr.key, key)\n\tif res.Err() != nil {\n\t\treturn \"\"\n\t}\n\n\tr, err := res.Result()\n\tif err != nil {\n\t\treturn \"\"\n\t}\n\n\treturn r\n}", "title": "" }, { "docid": "2ab7b649ad0809d56f39b4b3947827cf", "score": "0.524394", "text": "func (api *KrakenApi) Balance() (*BalanceResponse, error) {\n\tresp, err := api.queryPrivate(\"Balance\", url.Values{}, &BalanceResponse{})\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\treturn resp.(*BalanceResponse), nil\n}", "title": "" }, { "docid": "b686002aa7d26eff97ac0cae90e5f181", "score": "0.522963", "text": "func Sub(a, b *Node) (retVal *Node, err error) {\n\top := newElemBinOp(subOpType, a, b)\n\treturn binOpNode(op, a, b)\n}", "title": "" }, { "docid": "6ec0ea8b833d98942b1e09ca3e2218c2", "score": "0.52271235", "text": "func BalanceV2() int {\n\tsema <- struct{}{} // The capture of the marker\n\tb := balance\n\t<-sema // The release of the marker\n\treturn b\n}", "title": "" }, { "docid": "789b6045a266cd1542c27c94f38447d9", "score": "0.52225703", "text": "func (_StandardToken *StandardTokenCaller) BalanceOf(opts *bind.CallOpts, _owner common.Address) (*big.Int, error) {\n\tvar out []interface{}\n\terr := _StandardToken.contract.Call(opts, &out, \"balanceOf\", _owner)\n\n\tif err != nil {\n\t\treturn *new(*big.Int), err\n\t}\n\n\tout0 := *abi.ConvertType(out[0], new(*big.Int)).(**big.Int)\n\n\treturn out0, err\n\n}", "title": "" }, { "docid": "08b64960828ebe3eec1004c653f10e37", "score": "0.5215594", "text": "func (_StandardToken *StandardTokenCaller) BalanceOf(opts *bind.CallOpts, _owner common.Address) (*big.Int, error) {\n\tvar (\n\t\tret0 = new(*big.Int)\n\t)\n\tout := ret0\n\terr := _StandardToken.contract.Call(opts, out, \"balanceOf\", _owner)\n\treturn *ret0, err\n}", "title": "" }, { "docid": "08b64960828ebe3eec1004c653f10e37", "score": "0.5215594", "text": "func (_StandardToken *StandardTokenCaller) BalanceOf(opts *bind.CallOpts, _owner common.Address) (*big.Int, error) {\n\tvar (\n\t\tret0 = new(*big.Int)\n\t)\n\tout := ret0\n\terr := _StandardToken.contract.Call(opts, out, \"balanceOf\", _owner)\n\treturn *ret0, err\n}", "title": "" }, { "docid": "5c4d4af96113577d66d51abad22299c1", "score": "0.52133083", "text": "func (_AastraVault *AastraVaultSession) BalanceOf(account common.Address) (*big.Int, error) {\n\treturn _AastraVault.Contract.BalanceOf(&_AastraVault.CallOpts, account)\n}", "title": "" }, { "docid": "8509df5ddfcc28adbcdea7b86831f99c", "score": "0.521127", "text": "func (_Levtoken *LevtokenCaller) BalanceOf(opts *bind.CallOpts, account common.Address) (*big.Int, error) {\n\tvar out []interface{}\n\terr := _Levtoken.contract.Call(opts, &out, \"balanceOf\", account)\n\n\tif err != nil {\n\t\treturn *new(*big.Int), err\n\t}\n\n\tout0 := *abi.ConvertType(out[0], new(*big.Int)).(**big.Int)\n\n\treturn out0, err\n\n}", "title": "" }, { "docid": "785daf6e74f4ebea638764c13469b9a2", "score": "0.52089477", "text": "func GetBalance(c *gin.Context) {\n\n\tconfiguration, ok := c.MustGet(\"configuration\").(*configs.ViperConfiguration)\n\tif !ok {\n\t\tc.JSON(http.StatusInternalServerError, gin.H{\"error\": \"failed to get the configuration\"})\n\t\treturn\n\t}\n\n\t// get my address\n\tarWallet := arweave.NewWallet()\n\terr := arWallet.LoadKeyFromFile(configuration.Get(\"walletFile\"))\n\tif err != nil {\n\t\tc.JSON(http.StatusInternalServerError, gin.H{\"error\": err.Error()})\n\t\treturn\n\t}\n\n\toutput, _, err := utils.GetRequest(configuration.Get(\"nodeURL\") + \"/wallet/\" + arWallet.Address() + \"/balance\")\n\n\tif err != nil {\n\t\tc.JSON(http.StatusBadRequest, gin.H{\"error\": err.Error()})\n\t\treturn\n\t}\n\n\tfBalance := new(big.Float)\n\tfBalance.SetString(string(output))\n\tarBalance := new(big.Float).Quo(fBalance, big.NewFloat(math.Pow10(12)))\n\n\tc.JSON(http.StatusOK, gin.H{\"winston\": string(output), \"ar\": arBalance.String()})\n}", "title": "" }, { "docid": "4d1c71d0daa9a9a8ba7c865c50408b27", "score": "0.5202248", "text": "func (_UniswapStaking *UniswapStakingCaller) BalanceOf(opts *bind.CallOpts, account common.Address) (*big.Int, error) {\n\tvar (\n\t\tret0 = new(*big.Int)\n\t)\n\tout := ret0\n\terr := _UniswapStaking.contract.Call(opts, out, \"balanceOf\", account)\n\treturn *ret0, err\n}", "title": "" }, { "docid": "ce048cfbd6d624978753df53f00add9f", "score": "0.52005994", "text": "func (s *service) Balance(ctx context.Context) (*big.Int, error) {\n\treturn s.contract.Balance(ctx)\n}", "title": "" }, { "docid": "4839a9846b128576eefb7cb7f8f60967", "score": "0.5199495", "text": "func (_DebtEngine *DebtEngineCallerSession) GetBalance(_id [32]byte) (*big.Int, error) {\n\treturn _DebtEngine.Contract.GetBalance(&_DebtEngine.CallOpts, _id)\n}", "title": "" }, { "docid": "43ff9281eb44a13c2314c46fd59c44d3", "score": "0.5197157", "text": "func (_Token *TokenCaller) BalanceOf(opts *bind.CallOpts, arg0 common.Address) (*big.Int, error) {\n\tvar (\n\t\tret0 = new(*big.Int)\n\t)\n\tout := ret0\n\terr := _Token.contract.Call(opts, out, \"balanceOf\", arg0)\n\treturn *ret0, err\n}", "title": "" }, { "docid": "be5a99aebb161292ebd15ed9c475e340", "score": "0.51905173", "text": "func (_WETH *WETHCaller) BalanceOf(opts *bind.CallOpts, account common.Address) (*big.Int, error) {\n\tvar out []interface{}\n\terr := _WETH.contract.Call(opts, &out, \"balanceOf\", account)\n\n\tif err != nil {\n\t\treturn *new(*big.Int), err\n\t}\n\n\tout0 := *abi.ConvertType(out[0], new(*big.Int)).(**big.Int)\n\n\treturn out0, err\n\n}", "title": "" }, { "docid": "dda8fb1a705a544450beed7cd2e31a31", "score": "0.51895565", "text": "func (_IUniswapV2Pair *IUniswapV2PairSession) BalanceOf(owner common.Address) (*big.Int, error) {\n\treturn _IUniswapV2Pair.Contract.BalanceOf(&_IUniswapV2Pair.CallOpts, owner)\n}", "title": "" }, { "docid": "54fc355ed641c2f0591bf32a44c4e955", "score": "0.51870096", "text": "func (_BaasROI *BaasROICallerSession) Balance() (*big.Int, error) {\n\treturn _BaasROI.Contract.Balance(&_BaasROI.CallOpts)\n}", "title": "" }, { "docid": "a449ec51d298a3116e2aebd8ea86e1de", "score": "0.5183665", "text": "func (r * router) getBalance(address string) {\n\tif !walletpkg.ValidateAddress(address) {\n\t\tlog.Panic(\"invalid address\")\n\t}\n\n\tbalance := 0\n\n\tpubKeyHash := base58.DecodeBase58([]byte(address))\n\tpubKeyHash = pubKeyHash[1 : len(pubKeyHash) - 4]\n\n\tunspentTxOutputs := r.blockchain.FindUnspentTxOutputs(pubKeyHash)\n\n\tfor _, out := range unspentTxOutputs {\n\t\tbalance += len(out.Value)\n\t}\n\n\tfmt.Printf(\"Balance of '%s': %d\\n\", address, balance)\n}", "title": "" }, { "docid": "5f962feafccb8c35be19d425d23ae65c", "score": "0.51834035", "text": "func (_Token *TokenCaller) BalanceOf(opts *bind.CallOpts, arg0 common.Address) (*big.Int, error) {\n\tvar out []interface{}\n\terr := _Token.contract.Call(opts, &out, \"balanceOf\", arg0)\n\n\tif err != nil {\n\t\treturn *new(*big.Int), err\n\t}\n\n\tout0 := *abi.ConvertType(out[0], new(*big.Int)).(**big.Int)\n\n\treturn out0, err\n\n}", "title": "" }, { "docid": "518eb473fec86977925bb2537317d05a", "score": "0.5178467", "text": "func (_Bmat *BmatCallerSession) BsubSign(a *big.Int, b *big.Int) (*big.Int, bool, error) {\n\treturn _Bmat.Contract.BsubSign(&_Bmat.CallOpts, a, b)\n}", "title": "" }, { "docid": "41eb9dbe86202a934043f2d7b5a0e7a0", "score": "0.5177858", "text": "func (_Token *TokenCaller) BalanceOf(opts *bind.CallOpts, a common.Address) (*big.Int, error) {\n\tvar (\n\t\tret0 = new(*big.Int)\n\t)\n\tout := ret0\n\terr := _Token.contract.Call(opts, out, \"balanceOf\", a)\n\treturn *ret0, err\n}", "title": "" }, { "docid": "899a3369256007251d6425c9dd9f5222", "score": "0.5175219", "text": "func (_ReserveDollarV2 *ReserveDollarV2Session) BalanceOf(holder common.Address) (*big.Int, error) {\n\treturn _ReserveDollarV2.Contract.BalanceOf(&_ReserveDollarV2.CallOpts, holder)\n}", "title": "" }, { "docid": "77044fb6b3b896fe8ba6c87b5d19e818", "score": "0.5168589", "text": "func (_ContractCar *ContractCarSession) Balance() (uint16, error) {\n\treturn _ContractCar.Contract.Balance(&_ContractCar.CallOpts)\n}", "title": "" }, { "docid": "6daf5b18e933349818e050aac051e094", "score": "0.5165295", "text": "func (_UniswapStaking *UniswapStakingCallerSession) BalanceOf(account common.Address) (*big.Int, error) {\n\treturn _UniswapStaking.Contract.BalanceOf(&_UniswapStaking.CallOpts, account)\n}", "title": "" } ]
22bfc53b80c270d8012b4204f949eb38
Deprecated: Use AggregatedListTargetHttpsProxiesRequest.ProtoReflect.Descriptor instead.
[ { "docid": "1cbe82ab245ed2e2b54db2d2e3c9e424", "score": "0.78101236", "text": "func (*AggregatedListTargetHttpsProxiesRequest) Descriptor() ([]byte, []int) {\n\treturn file_google_cloud_compute_v1_compute_proto_rawDescGZIP(), []int{63}\n}", "title": "" } ]
[ { "docid": "0c5af409bee20b46a72f2fd4970e5cc5", "score": "0.7809034", "text": "func (*ListTargetHttpsProxiesRequest) Descriptor() ([]byte, []int) {\n\treturn file_google_cloud_compute_v1_compute_proto_rawDescGZIP(), []int{712}\n}", "title": "" }, { "docid": "76cd6f20d6cdc655d6297dd9a7bcf3bd", "score": "0.7516706", "text": "func (*ListTargetSslProxiesRequest) Descriptor() ([]byte, []int) {\n\treturn file_google_cloud_compute_v1_compute_proto_rawDescGZIP(), []int{715}\n}", "title": "" }, { "docid": "ffd2843367d0d8346f0599b019e0243a", "score": "0.74381846", "text": "func (*ListRegionTargetHttpsProxiesRequest) Descriptor() ([]byte, []int) {\n\treturn file_google_cloud_compute_v1_compute_proto_rawDescGZIP(), []int{696}\n}", "title": "" }, { "docid": "db4e5046bafc70c47d1690594cb51ac9", "score": "0.72922516", "text": "func (*ListTargetHttpProxiesRequest) Descriptor() ([]byte, []int) {\n\treturn file_google_cloud_compute_v1_compute_proto_rawDescGZIP(), []int{711}\n}", "title": "" }, { "docid": "9376b25bdece80bcb8dc45d207929f54", "score": "0.7214759", "text": "func (*TargetHttpsProxiesScopedList) Descriptor() ([]byte, []int) {\n\treturn file_google_cloud_compute_v1_compute_proto_rawDescGZIP(), []int{1161}\n}", "title": "" }, { "docid": "aa286a37c904df256f870a249fbc96da", "score": "0.7128678", "text": "func (*ListTargetGrpcProxiesRequest) Descriptor() ([]byte, []int) {\n\treturn file_google_cloud_compute_v1_compute_proto_rawDescGZIP(), []int{710}\n}", "title": "" }, { "docid": "ad80561c17cfac1cd00dc29f304fdb7a", "score": "0.70965046", "text": "func (*AggregatedListTargetHttpProxiesRequest) Descriptor() ([]byte, []int) {\n\treturn file_google_cloud_compute_v1_compute_proto_rawDescGZIP(), []int{62}\n}", "title": "" }, { "docid": "d7d1bd94700cf1986b149ce0ab84f79d", "score": "0.7002981", "text": "func (*TargetHttpsProxyList) Descriptor() ([]byte, []int) {\n\treturn file_google_cloud_compute_v1_compute_proto_rawDescGZIP(), []int{1167}\n}", "title": "" }, { "docid": "2efd05bbb1ad78acd54e72d29a71f6ec", "score": "0.6849496", "text": "func (*SetSslPolicyTargetHttpsProxyRequest) Descriptor() ([]byte, []int) {\n\treturn file_google_cloud_compute_v1_compute_proto_rawDescGZIP(), []int{1099}\n}", "title": "" }, { "docid": "1279ff78eaaa196f4fd4d4e1550542eb", "score": "0.67955655", "text": "func (*ListTargetTcpProxiesRequest) Descriptor() ([]byte, []int) {\n\treturn file_google_cloud_compute_v1_compute_proto_rawDescGZIP(), []int{716}\n}", "title": "" }, { "docid": "4c4aff614f418d16ce547e745b177ddc", "score": "0.67361164", "text": "func (*SetSslCertificatesTargetHttpsProxyRequest) Descriptor() ([]byte, []int) {\n\treturn file_google_cloud_compute_v1_compute_proto_rawDescGZIP(), []int{1097}\n}", "title": "" }, { "docid": "6d0ca8e26d1978172ecef0bef0768c8c", "score": "0.6711651", "text": "func (*ListRegionTargetHttpProxiesRequest) Descriptor() ([]byte, []int) {\n\treturn file_google_cloud_compute_v1_compute_proto_rawDescGZIP(), []int{695}\n}", "title": "" }, { "docid": "676e65e22ce4c715eeb3bc700eeffaca", "score": "0.6706613", "text": "func (*TargetHttpProxiesScopedList) Descriptor() ([]byte, []int) {\n\treturn file_google_cloud_compute_v1_compute_proto_rawDescGZIP(), []int{1157}\n}", "title": "" }, { "docid": "64c073f8625425fcaaab0f1596233f40", "score": "0.66907966", "text": "func (*SetUrlMapTargetHttpsProxyRequest) Descriptor() ([]byte, []int) {\n\treturn file_google_cloud_compute_v1_compute_proto_rawDescGZIP(), []int{1109}\n}", "title": "" }, { "docid": "db1d8c563928115f7a931b7828d74a4d", "score": "0.6681721", "text": "func (*TargetHttpsProxiesSetSslCertificatesRequest) Descriptor() ([]byte, []int) {\n\treturn file_google_cloud_compute_v1_compute_proto_rawDescGZIP(), []int{1164}\n}", "title": "" }, { "docid": "c94915290872be915e9e012d544372f8", "score": "0.6658596", "text": "func (*TargetSslProxyList) Descriptor() ([]byte, []int) {\n\treturn file_google_cloud_compute_v1_compute_proto_rawDescGZIP(), []int{1187}\n}", "title": "" }, { "docid": "2f0a56dce65081550e6ba20ec8927644", "score": "0.66430414", "text": "func (*GetTargetHttpsProxyRequest) Descriptor() ([]byte, []int) {\n\treturn file_google_cloud_compute_v1_compute_proto_rawDescGZIP(), []int{410}\n}", "title": "" }, { "docid": "d9718363da98a24dc06774c4adda9f16", "score": "0.65760624", "text": "func (*TargetHttpsProxyAggregatedList) Descriptor() ([]byte, []int) {\n\treturn file_google_cloud_compute_v1_compute_proto_rawDescGZIP(), []int{1166}\n}", "title": "" }, { "docid": "2c183cc4b4b331046ee6bdb2430c6a4e", "score": "0.65078056", "text": "func (*RegionTargetHttpsProxiesSetSslCertificatesRequest) Descriptor() ([]byte, []int) {\n\treturn file_google_cloud_compute_v1_compute_proto_rawDescGZIP(), []int{919}\n}", "title": "" }, { "docid": "1a0fd213257150f1bd4cac9ab34468b3", "score": "0.6451911", "text": "func (*SetSslPolicyTargetSslProxyRequest) Descriptor() ([]byte, []int) {\n\treturn file_google_cloud_compute_v1_compute_proto_rawDescGZIP(), []int{1100}\n}", "title": "" }, { "docid": "c74101dd865168446b1643c1cfb0a46e", "score": "0.64415675", "text": "func (*SetCertificateMapTargetHttpsProxyRequest) Descriptor() ([]byte, []int) {\n\treturn file_google_cloud_compute_v1_compute_proto_rawDescGZIP(), []int{1036}\n}", "title": "" }, { "docid": "e5253a26c058033b5d5ebfbea45d44cb", "score": "0.6420578", "text": "func (*SetSslCertificatesTargetSslProxyRequest) Descriptor() ([]byte, []int) {\n\treturn file_google_cloud_compute_v1_compute_proto_rawDescGZIP(), []int{1098}\n}", "title": "" }, { "docid": "1d73a7967a3ae45fba18e0f3ceb308cc", "score": "0.6413987", "text": "func (*PatchTargetHttpsProxyRequest) Descriptor() ([]byte, []int) {\n\treturn file_google_cloud_compute_v1_compute_proto_rawDescGZIP(), []int{861}\n}", "title": "" }, { "docid": "7960664d3b14dcefb866d520cecc5b66", "score": "0.64106506", "text": "func (*GetTargetSslProxyRequest) Descriptor() ([]byte, []int) {\n\treturn file_google_cloud_compute_v1_compute_proto_rawDescGZIP(), []int{413}\n}", "title": "" }, { "docid": "711b2e0ce013518cbb5ece66a621d40b", "score": "0.6371578", "text": "func (*TargetSslProxiesSetSslCertificatesRequest) Descriptor() ([]byte, []int) {\n\treturn file_google_cloud_compute_v1_compute_proto_rawDescGZIP(), []int{1185}\n}", "title": "" }, { "docid": "b149df63062a29a8d0a4f4d1e020b931", "score": "0.6371196", "text": "func (*SetBackendServiceTargetSslProxyRequest) Descriptor() ([]byte, []int) {\n\treturn file_google_cloud_compute_v1_compute_proto_rawDescGZIP(), []int{1033}\n}", "title": "" }, { "docid": "5960decc91948f875fb3ae664f64c7f4", "score": "0.6370601", "text": "func (*DeleteTargetHttpsProxyRequest) Descriptor() ([]byte, []int) {\n\treturn file_google_cloud_compute_v1_compute_proto_rawDescGZIP(), []int{224}\n}", "title": "" }, { "docid": "fb2990b759dfa3d2230d14462f7392d7", "score": "0.63605976", "text": "func (*SetQuicOverrideTargetHttpsProxyRequest) Descriptor() ([]byte, []int) {\n\treturn file_google_cloud_compute_v1_compute_proto_rawDescGZIP(), []int{1091}\n}", "title": "" }, { "docid": "6e256d62b81ef95561b8a1ff5be00419", "score": "0.63267124", "text": "func (*DeleteTargetSslProxyRequest) Descriptor() ([]byte, []int) {\n\treturn file_google_cloud_compute_v1_compute_proto_rawDescGZIP(), []int{227}\n}", "title": "" }, { "docid": "341c9d25b064967cc63ab324b52e526b", "score": "0.6322594", "text": "func (*TargetHttpsProxy) Descriptor() ([]byte, []int) {\n\treturn file_google_cloud_compute_v1_compute_proto_rawDescGZIP(), []int{1165}\n}", "title": "" }, { "docid": "dd1a08dfe14749f8f9e677b6b185c4ff", "score": "0.631751", "text": "func (*TargetHttpsProxiesSetCertificateMapRequest) Descriptor() ([]byte, []int) {\n\treturn file_google_cloud_compute_v1_compute_proto_rawDescGZIP(), []int{1162}\n}", "title": "" }, { "docid": "438363cde466c143c4c689e5b3e4c023", "score": "0.62906575", "text": "func (*SetSslCertificatesRegionTargetHttpsProxyRequest) Descriptor() ([]byte, []int) {\n\treturn file_google_cloud_compute_v1_compute_proto_rawDescGZIP(), []int{1096}\n}", "title": "" }, { "docid": "e6f673d119c61032b9808fe81b48f5ae", "score": "0.62856835", "text": "func (*ListRegionTargetTcpProxiesRequest) Descriptor() ([]byte, []int) {\n\treturn file_google_cloud_compute_v1_compute_proto_rawDescGZIP(), []int{697}\n}", "title": "" }, { "docid": "f20639fe8d4915677ff8a49078421dfa", "score": "0.62535536", "text": "func (*InsertTargetHttpsProxyRequest) Descriptor() ([]byte, []int) {\n\treturn file_google_cloud_compute_v1_compute_proto_rawDescGZIP(), []int{526}\n}", "title": "" }, { "docid": "e337f818215198d1dd71d3a153a3deec", "score": "0.6247272", "text": "func (*SetCertificateMapTargetSslProxyRequest) Descriptor() ([]byte, []int) {\n\treturn file_google_cloud_compute_v1_compute_proto_rawDescGZIP(), []int{1037}\n}", "title": "" }, { "docid": "3510bdf42cff3d50db4090d3e187a211", "score": "0.6189474", "text": "func (*TargetHttpProxyList) Descriptor() ([]byte, []int) {\n\treturn file_google_cloud_compute_v1_compute_proto_rawDescGZIP(), []int{1160}\n}", "title": "" }, { "docid": "cb4723389f7177f13028786e4b624091", "score": "0.61837506", "text": "func (*TargetSslProxiesSetProxyHeaderRequest) Descriptor() ([]byte, []int) {\n\treturn file_google_cloud_compute_v1_compute_proto_rawDescGZIP(), []int{1184}\n}", "title": "" }, { "docid": "71cf39e3a7f62e3136247d8779cd4cd1", "score": "0.61686593", "text": "func (g *GCEBetaTargetHttpsProxies) List(ctx context.Context, fl *filter.F) ([]*beta.TargetHttpsProxy, error) {\n\tklog.V(5).Infof(\"GCEBetaTargetHttpsProxies.List(%v, %v) called\", ctx, fl)\n\tprojectID := g.s.ProjectRouter.ProjectID(ctx, \"beta\", \"TargetHttpsProxies\")\n\trk := &RateLimitKey{\n\t\tProjectID: projectID,\n\t\tOperation: \"List\",\n\t\tVersion: meta.Version(\"beta\"),\n\t\tService: \"TargetHttpsProxies\",\n\t}\n\tif err := g.s.RateLimiter.Accept(ctx, rk); err != nil {\n\t\treturn nil, err\n\t}\n\tklog.V(5).Infof(\"GCEBetaTargetHttpsProxies.List(%v, %v): projectID = %v, rk = %+v\", ctx, fl, projectID, rk)\n\tcall := g.s.Beta.TargetHttpsProxies.List(projectID)\n\tif fl != filter.None {\n\t\tcall.Filter(fl.String())\n\t}\n\tvar all []*beta.TargetHttpsProxy\n\tf := func(l *beta.TargetHttpsProxyList) error {\n\t\tklog.V(5).Infof(\"GCEBetaTargetHttpsProxies.List(%v, ..., %v): page %+v\", ctx, fl, l)\n\t\tall = append(all, l.Items...)\n\t\treturn nil\n\t}\n\tif err := call.Pages(ctx, f); err != nil {\n\t\tklog.V(4).Infof(\"GCEBetaTargetHttpsProxies.List(%v, ..., %v) = %v, %v\", ctx, fl, nil, err)\n\t\treturn nil, err\n\t}\n\n\tif klog.V(4).Enabled() {\n\t\tklog.V(4).Infof(\"GCEBetaTargetHttpsProxies.List(%v, ..., %v) = [%v items], %v\", ctx, fl, len(all), nil)\n\t} else if klog.V(5).Enabled() {\n\t\tvar asStr []string\n\t\tfor _, o := range all {\n\t\t\tasStr = append(asStr, fmt.Sprintf(\"%+v\", o))\n\t\t}\n\t\tklog.V(5).Infof(\"GCEBetaTargetHttpsProxies.List(%v, ..., %v) = %v, %v\", ctx, fl, asStr, nil)\n\t}\n\n\treturn all, nil\n}", "title": "" }, { "docid": "2efddd10d62a7b05ac76da79cdb261db", "score": "0.6156745", "text": "func (*SetProxyHeaderTargetSslProxyRequest) Descriptor() ([]byte, []int) {\n\treturn file_google_cloud_compute_v1_compute_proto_rawDescGZIP(), []int{1089}\n}", "title": "" }, { "docid": "59cc1101b4d47262b1c4addeceef039f", "score": "0.6140033", "text": "func (*TargetSslProxiesSetCertificateMapRequest) Descriptor() ([]byte, []int) {\n\treturn file_google_cloud_compute_v1_compute_proto_rawDescGZIP(), []int{1183}\n}", "title": "" }, { "docid": "71915ffe90a186a1c6eb525fc734bef5", "score": "0.6131303", "text": "func (*SetUrlMapRegionTargetHttpsProxyRequest) Descriptor() ([]byte, []int) {\n\treturn file_google_cloud_compute_v1_compute_proto_rawDescGZIP(), []int{1107}\n}", "title": "" }, { "docid": "41f48bbad22013d47a2b4fbba4864b82", "score": "0.613108", "text": "func (*TargetSslProxiesSetBackendServiceRequest) Descriptor() ([]byte, []int) {\n\treturn file_google_cloud_compute_v1_compute_proto_rawDescGZIP(), []int{1182}\n}", "title": "" }, { "docid": "281726bc3c7ca400bf3813656c1ac595", "score": "0.6109973", "text": "func (*TargetGrpcProxyList) Descriptor() ([]byte, []int) {\n\treturn file_google_cloud_compute_v1_compute_proto_rawDescGZIP(), []int{1156}\n}", "title": "" }, { "docid": "1054e9430fb282075cfb683d34a79cdf", "score": "0.6088767", "text": "func (*InsertTargetSslProxyRequest) Descriptor() ([]byte, []int) {\n\treturn file_google_cloud_compute_v1_compute_proto_rawDescGZIP(), []int{529}\n}", "title": "" }, { "docid": "b76d30c5c8531d232f10968d4f84a29c", "score": "0.6024658", "text": "func (*PatchRegionTargetHttpsProxyRequest) Descriptor() ([]byte, []int) {\n\treturn file_google_cloud_compute_v1_compute_proto_rawDescGZIP(), []int{848}\n}", "title": "" }, { "docid": "12481a4d9929878126059195bc3efbe2", "score": "0.6012716", "text": "func (*SetUrlMapTargetHttpProxyRequest) Descriptor() ([]byte, []int) {\n\treturn file_google_cloud_compute_v1_compute_proto_rawDescGZIP(), []int{1108}\n}", "title": "" }, { "docid": "a3aedcc8c6cf7e0722f1d7304e792c43", "score": "0.60074705", "text": "func (*ListTargetVpnGatewaysRequest) Descriptor() ([]byte, []int) {\n\treturn file_google_cloud_compute_v1_compute_proto_rawDescGZIP(), []int{717}\n}", "title": "" }, { "docid": "46b0dcddc1d21627e2493baa0a7d7d4f", "score": "0.5972624", "text": "func (g *GCETargetHttpsProxies) List(ctx context.Context, fl *filter.F) ([]*ga.TargetHttpsProxy, error) {\n\tklog.V(5).Infof(\"GCETargetHttpsProxies.List(%v, %v) called\", ctx, fl)\n\tprojectID := g.s.ProjectRouter.ProjectID(ctx, \"ga\", \"TargetHttpsProxies\")\n\trk := &RateLimitKey{\n\t\tProjectID: projectID,\n\t\tOperation: \"List\",\n\t\tVersion: meta.Version(\"ga\"),\n\t\tService: \"TargetHttpsProxies\",\n\t}\n\tif err := g.s.RateLimiter.Accept(ctx, rk); err != nil {\n\t\treturn nil, err\n\t}\n\tklog.V(5).Infof(\"GCETargetHttpsProxies.List(%v, %v): projectID = %v, rk = %+v\", ctx, fl, projectID, rk)\n\tcall := g.s.GA.TargetHttpsProxies.List(projectID)\n\tif fl != filter.None {\n\t\tcall.Filter(fl.String())\n\t}\n\tvar all []*ga.TargetHttpsProxy\n\tf := func(l *ga.TargetHttpsProxyList) error {\n\t\tklog.V(5).Infof(\"GCETargetHttpsProxies.List(%v, ..., %v): page %+v\", ctx, fl, l)\n\t\tall = append(all, l.Items...)\n\t\treturn nil\n\t}\n\tif err := call.Pages(ctx, f); err != nil {\n\t\tklog.V(4).Infof(\"GCETargetHttpsProxies.List(%v, ..., %v) = %v, %v\", ctx, fl, nil, err)\n\t\treturn nil, err\n\t}\n\n\tif klog.V(4).Enabled() {\n\t\tklog.V(4).Infof(\"GCETargetHttpsProxies.List(%v, ..., %v) = [%v items], %v\", ctx, fl, len(all), nil)\n\t} else if klog.V(5).Enabled() {\n\t\tvar asStr []string\n\t\tfor _, o := range all {\n\t\t\tasStr = append(asStr, fmt.Sprintf(\"%+v\", o))\n\t\t}\n\t\tklog.V(5).Infof(\"GCETargetHttpsProxies.List(%v, ..., %v) = %v, %v\", ctx, fl, asStr, nil)\n\t}\n\n\treturn all, nil\n}", "title": "" }, { "docid": "5d60592d7b448ee0c2e3fc0622877bb0", "score": "0.5960847", "text": "func (r *GCPReader) ListTargetHTTPSProxies(ctx context.Context, filter string) ([]compute.TargetHttpsProxy, error) {\n\tservice := compute.NewTargetHttpsProxiesService(r.compute)\n\n\tresources := make([]compute.TargetHttpsProxy, 0)\n\n\tif err := service.List(r.project).\n\t\tFilter(filter).\n\t\tMaxResults(int64(r.maxResults)).\n\t\tPages(ctx, func(list *compute.TargetHttpsProxyList) 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}); err != nil {\n\t\treturn nil, errors.Wrap(err, \"unable to list compute TargetHttpsProxy from google APIs\")\n\t}\n\n\treturn resources, nil\n\n}", "title": "" }, { "docid": "a585e48b10186931fc80a8f6c11636ac", "score": "0.5935938", "text": "func (*GetRegionTargetHttpsProxyRequest) Descriptor() ([]byte, []int) {\n\treturn file_google_cloud_compute_v1_compute_proto_rawDescGZIP(), []int{386}\n}", "title": "" }, { "docid": "22af5ed65dfe96185a12ea505605bd44", "score": "0.59103864", "text": "func (*GetTargetGrpcProxyRequest) Descriptor() ([]byte, []int) {\n\treturn file_google_cloud_compute_v1_compute_proto_rawDescGZIP(), []int{408}\n}", "title": "" }, { "docid": "a3d37faeb7728f3e181a46ecbcfb9441", "score": "0.5860653", "text": "func (*AggregatedListTargetVpnGatewaysRequest) Descriptor() ([]byte, []int) {\n\treturn file_google_cloud_compute_v1_compute_proto_rawDescGZIP(), []int{66}\n}", "title": "" }, { "docid": "4d305660f6bb7e2a40bc39e79c47ed16", "score": "0.5859871", "text": "func (*TargetSslProxy) Descriptor() ([]byte, []int) {\n\treturn file_google_cloud_compute_v1_compute_proto_rawDescGZIP(), []int{1186}\n}", "title": "" }, { "docid": "6e2c39c5bb687a4dc00aff614d1247fd", "score": "0.5859814", "text": "func (*GetTargetHttpProxyRequest) Descriptor() ([]byte, []int) {\n\treturn file_google_cloud_compute_v1_compute_proto_rawDescGZIP(), []int{409}\n}", "title": "" }, { "docid": "2100e9fba37394dc709face7c667e0e4", "score": "0.5858431", "text": "func (*ListTargetPoolsRequest) Descriptor() ([]byte, []int) {\n\treturn file_google_cloud_compute_v1_compute_proto_rawDescGZIP(), []int{714}\n}", "title": "" }, { "docid": "f5f9a2015ed28fb5efb34e1218ea6404", "score": "0.5855898", "text": "func (*PatchTargetGrpcProxyRequest) Descriptor() ([]byte, []int) {\n\treturn file_google_cloud_compute_v1_compute_proto_rawDescGZIP(), []int{859}\n}", "title": "" }, { "docid": "d3fcd5eb43c36cc87271f33b738c8e96", "score": "0.58265543", "text": "func (*PatchTargetHttpProxyRequest) Descriptor() ([]byte, []int) {\n\treturn file_google_cloud_compute_v1_compute_proto_rawDescGZIP(), []int{860}\n}", "title": "" }, { "docid": "5f803adaf17e13df2f9b733a269aaa0a", "score": "0.5793686", "text": "func (*DeleteTargetHttpProxyRequest) Descriptor() ([]byte, []int) {\n\treturn file_google_cloud_compute_v1_compute_proto_rawDescGZIP(), []int{223}\n}", "title": "" }, { "docid": "d47c89a2978aaae7fe68c161540732fa", "score": "0.5792779", "text": "func (*TargetHttpsProxiesSetQuicOverrideRequest) Descriptor() ([]byte, []int) {\n\treturn file_google_cloud_compute_v1_compute_proto_rawDescGZIP(), []int{1163}\n}", "title": "" }, { "docid": "abb6d036237eeeb1b6bd4dba85fdcd01", "score": "0.57899433", "text": "func (*TargetHttpProxyAggregatedList) Descriptor() ([]byte, []int) {\n\treturn file_google_cloud_compute_v1_compute_proto_rawDescGZIP(), []int{1159}\n}", "title": "" }, { "docid": "8664b72b47ce6497ad92f124839a0293", "score": "0.5789939", "text": "func (*DeleteTargetGrpcProxyRequest) Descriptor() ([]byte, []int) {\n\treturn file_google_cloud_compute_v1_compute_proto_rawDescGZIP(), []int{222}\n}", "title": "" }, { "docid": "5861287e9d0bf8271a5120fa3d151974", "score": "0.5776942", "text": "func (*DeleteRegionTargetHttpsProxyRequest) Descriptor() ([]byte, []int) {\n\treturn file_google_cloud_compute_v1_compute_proto_rawDescGZIP(), []int{207}\n}", "title": "" }, { "docid": "91ff30e72fd6c3c7cd81334c07902c02", "score": "0.5752756", "text": "func (*TargetTcpProxyList) Descriptor() ([]byte, []int) {\n\treturn file_google_cloud_compute_v1_compute_proto_rawDescGZIP(), []int{1191}\n}", "title": "" }, { "docid": "c4cad8cb036e86be85814b3f9ee9e1f4", "score": "0.5752454", "text": "func (g *GCEAlphaTargetHttpsProxies) List(ctx context.Context, fl *filter.F) ([]*alpha.TargetHttpsProxy, error) {\n\tklog.V(5).Infof(\"GCEAlphaTargetHttpsProxies.List(%v, %v) called\", ctx, fl)\n\tprojectID := g.s.ProjectRouter.ProjectID(ctx, \"alpha\", \"TargetHttpsProxies\")\n\trk := &RateLimitKey{\n\t\tProjectID: projectID,\n\t\tOperation: \"List\",\n\t\tVersion: meta.Version(\"alpha\"),\n\t\tService: \"TargetHttpsProxies\",\n\t}\n\tif err := g.s.RateLimiter.Accept(ctx, rk); err != nil {\n\t\treturn nil, err\n\t}\n\tklog.V(5).Infof(\"GCEAlphaTargetHttpsProxies.List(%v, %v): projectID = %v, rk = %+v\", ctx, fl, projectID, rk)\n\tcall := g.s.Alpha.TargetHttpsProxies.List(projectID)\n\tif fl != filter.None {\n\t\tcall.Filter(fl.String())\n\t}\n\tvar all []*alpha.TargetHttpsProxy\n\tf := func(l *alpha.TargetHttpsProxyList) error {\n\t\tklog.V(5).Infof(\"GCEAlphaTargetHttpsProxies.List(%v, ..., %v): page %+v\", ctx, fl, l)\n\t\tall = append(all, l.Items...)\n\t\treturn nil\n\t}\n\tif err := call.Pages(ctx, f); err != nil {\n\t\tklog.V(4).Infof(\"GCEAlphaTargetHttpsProxies.List(%v, ..., %v) = %v, %v\", ctx, fl, nil, err)\n\t\treturn nil, err\n\t}\n\n\tif klog.V(4).Enabled() {\n\t\tklog.V(4).Infof(\"GCEAlphaTargetHttpsProxies.List(%v, ..., %v) = [%v items], %v\", ctx, fl, len(all), nil)\n\t} else if klog.V(5).Enabled() {\n\t\tvar asStr []string\n\t\tfor _, o := range all {\n\t\t\tasStr = append(asStr, fmt.Sprintf(\"%+v\", o))\n\t\t}\n\t\tklog.V(5).Infof(\"GCEAlphaTargetHttpsProxies.List(%v, ..., %v) = %v, %v\", ctx, fl, asStr, nil)\n\t}\n\n\treturn all, nil\n}", "title": "" }, { "docid": "cfc054fc7d18e90d63133d7aa9f80a2a", "score": "0.5712578", "text": "func (*ListFirewallsRequest) Descriptor() ([]byte, []int) {\n\treturn file_google_cloud_compute_v1_compute_proto_rawDescGZIP(), []int{638}\n}", "title": "" }, { "docid": "032bbd35294d96deb6136e75fd9a7788", "score": "0.5658265", "text": "func TargetSslProxyToProto(resource *compute.TargetSslProxy) *computepb.ComputeTargetSslProxy {\n\tp := &computepb.ComputeTargetSslProxy{\n\t\tId: dcl.ValueOrEmptyInt64(resource.Id),\n\t\tName: dcl.ValueOrEmptyString(resource.Name),\n\t\tDescription: dcl.ValueOrEmptyString(resource.Description),\n\t\tSelfLink: dcl.ValueOrEmptyString(resource.SelfLink),\n\t\tService: dcl.ValueOrEmptyString(resource.Service),\n\t\tProxyHeader: ComputeTargetSslProxyProxyHeaderEnumToProto(resource.ProxyHeader),\n\t\tSslPolicy: dcl.ValueOrEmptyString(resource.SslPolicy),\n\t\tProject: dcl.ValueOrEmptyString(resource.Project),\n\t}\n\tfor _, r := range resource.SslCertificates {\n\t\tp.SslCertificates = append(p.SslCertificates, r)\n\t}\n\n\treturn p\n}", "title": "" }, { "docid": "9b7b44ed79c3919aeedbd36e55b63a00", "score": "0.56527764", "text": "func (*AggregatedListTargetPoolsRequest) Descriptor() ([]byte, []int) {\n\treturn file_google_cloud_compute_v1_compute_proto_rawDescGZIP(), []int{65}\n}", "title": "" }, { "docid": "64abf74406b8edc2f9cbf4293b55b3e2", "score": "0.565024", "text": "func (*ListSSLCertsRequest) Descriptor() ([]byte, []int) {\n\treturn file_service_ssl_cert_proto_rawDescGZIP(), []int{7}\n}", "title": "" }, { "docid": "1e09d650e09ac7722c5ee934cc56f8b6", "score": "0.55988824", "text": "func (*TargetVpnGatewaysScopedList) Descriptor() ([]byte, []int) {\n\treturn file_google_cloud_compute_v1_compute_proto_rawDescGZIP(), []int{1195}\n}", "title": "" }, { "docid": "a3d591e916e10f1ba0ce603b3f2f15d5", "score": "0.55921274", "text": "func (*ListSinksRequest) Descriptor() ([]byte, []int) {\n\treturn file_yandex_cloud_logging_v1_sink_service_proto_rawDescGZIP(), []int{1}\n}", "title": "" }, { "docid": "48c769e5969d5e76da93458bb1cca8b8", "score": "0.5582562", "text": "func (*InsertRegionTargetHttpsProxyRequest) Descriptor() ([]byte, []int) {\n\treturn file_google_cloud_compute_v1_compute_proto_rawDescGZIP(), []int{511}\n}", "title": "" }, { "docid": "3d34662fce9347d1b0eb5587283de2e2", "score": "0.55693793", "text": "func (*UpdateHTTPWebRedirectToHTTPSRequest) Descriptor() ([]byte, []int) {\n\treturn file_service_http_web_proto_rawDescGZIP(), []int{20}\n}", "title": "" }, { "docid": "86184003d8412f2a97d12d24def1796a", "score": "0.5560586", "text": "func ProtoToTargetSslProxy(p *computepb.ComputeTargetSslProxy) *compute.TargetSslProxy {\n\tobj := &compute.TargetSslProxy{\n\t\tId: dcl.Int64OrNil(p.Id),\n\t\tName: dcl.StringOrNil(p.Name),\n\t\tDescription: dcl.StringOrNil(p.Description),\n\t\tSelfLink: dcl.StringOrNil(p.SelfLink),\n\t\tService: dcl.StringOrNil(p.Service),\n\t\tProxyHeader: ProtoToComputeTargetSslProxyProxyHeaderEnum(p.GetProxyHeader()),\n\t\tSslPolicy: dcl.StringOrNil(p.SslPolicy),\n\t\tProject: dcl.StringOrNil(p.Project),\n\t}\n\tfor _, r := range p.GetSslCertificates() {\n\t\tobj.SslCertificates = append(obj.SslCertificates, r)\n\t}\n\treturn obj\n}", "title": "" }, { "docid": "69ef7f5b567bc0efd10f34ed672e12ca", "score": "0.55596495", "text": "func (*TargetTcpProxiesSetProxyHeaderRequest) Descriptor() ([]byte, []int) {\n\treturn file_google_cloud_compute_v1_compute_proto_rawDescGZIP(), []int{1189}\n}", "title": "" }, { "docid": "c0f051c0af362cef438ad6ef7e437d21", "score": "0.55518305", "text": "func (g *GCEBetaTargetHttpProxies) List(ctx context.Context, fl *filter.F) ([]*beta.TargetHttpProxy, error) {\n\tklog.V(5).Infof(\"GCEBetaTargetHttpProxies.List(%v, %v) called\", ctx, fl)\n\tprojectID := g.s.ProjectRouter.ProjectID(ctx, \"beta\", \"TargetHttpProxies\")\n\trk := &RateLimitKey{\n\t\tProjectID: projectID,\n\t\tOperation: \"List\",\n\t\tVersion: meta.Version(\"beta\"),\n\t\tService: \"TargetHttpProxies\",\n\t}\n\tif err := g.s.RateLimiter.Accept(ctx, rk); err != nil {\n\t\treturn nil, err\n\t}\n\tklog.V(5).Infof(\"GCEBetaTargetHttpProxies.List(%v, %v): projectID = %v, rk = %+v\", ctx, fl, projectID, rk)\n\tcall := g.s.Beta.TargetHttpProxies.List(projectID)\n\tif fl != filter.None {\n\t\tcall.Filter(fl.String())\n\t}\n\tvar all []*beta.TargetHttpProxy\n\tf := func(l *beta.TargetHttpProxyList) error {\n\t\tklog.V(5).Infof(\"GCEBetaTargetHttpProxies.List(%v, ..., %v): page %+v\", ctx, fl, l)\n\t\tall = append(all, l.Items...)\n\t\treturn nil\n\t}\n\tif err := call.Pages(ctx, f); err != nil {\n\t\tklog.V(4).Infof(\"GCEBetaTargetHttpProxies.List(%v, ..., %v) = %v, %v\", ctx, fl, nil, err)\n\t\treturn nil, err\n\t}\n\n\tif klog.V(4).Enabled() {\n\t\tklog.V(4).Infof(\"GCEBetaTargetHttpProxies.List(%v, ..., %v) = [%v items], %v\", ctx, fl, len(all), nil)\n\t} else if klog.V(5).Enabled() {\n\t\tvar asStr []string\n\t\tfor _, o := range all {\n\t\t\tasStr = append(asStr, fmt.Sprintf(\"%+v\", o))\n\t\t}\n\t\tklog.V(5).Infof(\"GCEBetaTargetHttpProxies.List(%v, ..., %v) = %v, %v\", ctx, fl, asStr, nil)\n\t}\n\n\treturn all, nil\n}", "title": "" }, { "docid": "13e8218551f1f66baa4ffe9f7dd5b320", "score": "0.5549289", "text": "func (TargetSslProxiesSetProxyHeaderRequest_ProxyHeader) EnumDescriptor() ([]byte, []int) {\n\treturn file_google_cloud_compute_v1_compute_proto_rawDescGZIP(), []int{1184, 0}\n}", "title": "" }, { "docid": "530c67e643f52894ed95c2c2ffd848f4", "score": "0.5548521", "text": "func (g *GCEBetaRegionTargetHttpsProxies) List(ctx context.Context, region string, fl *filter.F) ([]*beta.TargetHttpsProxy, error) {\n\tklog.V(5).Infof(\"GCEBetaRegionTargetHttpsProxies.List(%v, %v, %v) called\", ctx, region, fl)\n\tprojectID := g.s.ProjectRouter.ProjectID(ctx, \"beta\", \"RegionTargetHttpsProxies\")\n\trk := &RateLimitKey{\n\t\tProjectID: projectID,\n\t\tOperation: \"List\",\n\t\tVersion: meta.Version(\"beta\"),\n\t\tService: \"RegionTargetHttpsProxies\",\n\t}\n\tif err := g.s.RateLimiter.Accept(ctx, rk); err != nil {\n\t\treturn nil, err\n\t}\n\tklog.V(5).Infof(\"GCEBetaRegionTargetHttpsProxies.List(%v, %v, %v): projectID = %v, rk = %+v\", ctx, region, fl, projectID, rk)\n\tcall := g.s.Beta.RegionTargetHttpsProxies.List(projectID, region)\n\tif fl != filter.None {\n\t\tcall.Filter(fl.String())\n\t}\n\tvar all []*beta.TargetHttpsProxy\n\tf := func(l *beta.TargetHttpsProxyList) error {\n\t\tklog.V(5).Infof(\"GCEBetaRegionTargetHttpsProxies.List(%v, ..., %v): page %+v\", ctx, fl, l)\n\t\tall = append(all, l.Items...)\n\t\treturn nil\n\t}\n\tif err := call.Pages(ctx, f); err != nil {\n\t\tklog.V(4).Infof(\"GCEBetaRegionTargetHttpsProxies.List(%v, ..., %v) = %v, %v\", ctx, fl, nil, err)\n\t\treturn nil, err\n\t}\n\n\tif klog.V(4).Enabled() {\n\t\tklog.V(4).Infof(\"GCEBetaRegionTargetHttpsProxies.List(%v, ..., %v) = [%v items], %v\", ctx, fl, len(all), nil)\n\t} else if klog.V(5).Enabled() {\n\t\tvar asStr []string\n\t\tfor _, o := range all {\n\t\t\tasStr = append(asStr, fmt.Sprintf(\"%+v\", o))\n\t\t}\n\t\tklog.V(5).Infof(\"GCEBetaRegionTargetHttpsProxies.List(%v, ..., %v) = %v, %v\", ctx, fl, asStr, nil)\n\t}\n\n\treturn all, nil\n}", "title": "" }, { "docid": "4e6f9c0394d98c60e9bbf36941cfc9d2", "score": "0.55234545", "text": "func (*ListSinksRequest) Descriptor() ([]byte, []int) {\n\treturn file_google_logging_v2_logging_config_proto_rawDescGZIP(), []int{17}\n}", "title": "" }, { "docid": "065f17086f84876ba96c256a3fb30f7b", "score": "0.55174285", "text": "func (*ListVpnTunnelsRequest) Descriptor() ([]byte, []int) {\n\treturn file_google_cloud_compute_v1_compute_proto_rawDescGZIP(), []int{721}\n}", "title": "" }, { "docid": "0ec81e9c432f2140a042e60f652dbbf0", "score": "0.55141413", "text": "func (*DeleteTargetTcpProxyRequest) Descriptor() ([]byte, []int) {\n\treturn file_google_cloud_compute_v1_compute_proto_rawDescGZIP(), []int{228}\n}", "title": "" }, { "docid": "10aaa443d192b9b49786520f3a7ab23a", "score": "0.5513085", "text": "func (*TargetTcpProxiesSetBackendServiceRequest) Descriptor() ([]byte, []int) {\n\treturn file_google_cloud_compute_v1_compute_proto_rawDescGZIP(), []int{1188}\n}", "title": "" }, { "docid": "098bfa2c67fb162343de6cbbfc823ff3", "score": "0.54935557", "text": "func (gce *GCE) TargetHttpsProxies() TargetHttpsProxies {\n\treturn gce.gceTargetHttpsProxies\n}", "title": "" }, { "docid": "5c56e2d9d36a4fefd1d8a2beda83367b", "score": "0.5470389", "text": "func (*GetTargetTcpProxyRequest) Descriptor() ([]byte, []int) {\n\treturn file_google_cloud_compute_v1_compute_proto_rawDescGZIP(), []int{414}\n}", "title": "" }, { "docid": "07f477079cc1b419476737a318b6237b", "score": "0.54683197", "text": "func (*SetBackendServiceTargetTcpProxyRequest) Descriptor() ([]byte, []int) {\n\treturn file_google_cloud_compute_v1_compute_proto_rawDescGZIP(), []int{1034}\n}", "title": "" }, { "docid": "cbe2daeeb50b79a2d9c756146c2175d5", "score": "0.54618573", "text": "func (*InsertTargetHttpProxyRequest) Descriptor() ([]byte, []int) {\n\treturn file_google_cloud_compute_v1_compute_proto_rawDescGZIP(), []int{525}\n}", "title": "" }, { "docid": "5d864a0e42f39bab9064f0a4e00d7053", "score": "0.5431708", "text": "func (*SetTargetForwardingRuleRequest) Descriptor() ([]byte, []int) {\n\treturn file_google_cloud_compute_v1_compute_proto_rawDescGZIP(), []int{1102}\n}", "title": "" }, { "docid": "ccbd727a53ed34a464f1421f1264505c", "score": "0.5429336", "text": "func (*ListSslCertificatesRequest) Descriptor() ([]byte, []int) {\n\treturn file_google_cloud_compute_v1_compute_proto_rawDescGZIP(), []int{707}\n}", "title": "" }, { "docid": "9af3eae8255ce7af1cf3dc973ee05288", "score": "0.5410228", "text": "func (mock *MockGCE) TargetHttpsProxies() TargetHttpsProxies {\n\treturn mock.MockTargetHttpsProxies\n}", "title": "" }, { "docid": "c1d0e433671e8252aef7ced2a4d70473", "score": "0.5404393", "text": "func (*ListSinkOperationsRequest) Descriptor() ([]byte, []int) {\n\treturn file_yandex_cloud_logging_v1_sink_service_proto_rawDescGZIP(), []int{9}\n}", "title": "" }, { "docid": "88c75825e6951051266ff7271640c09c", "score": "0.539815", "text": "func (*AggregatedListVpnTunnelsRequest) Descriptor() ([]byte, []int) {\n\treturn file_google_cloud_compute_v1_compute_proto_rawDescGZIP(), []int{69}\n}", "title": "" }, { "docid": "f247b06121cc5bfd2bc411ff9f927012", "score": "0.53963035", "text": "func (*InsertTargetGrpcProxyRequest) Descriptor() ([]byte, []int) {\n\treturn file_google_cloud_compute_v1_compute_proto_rawDescGZIP(), []int{524}\n}", "title": "" }, { "docid": "44f0eb2fcd781c8646222f702f3f507c", "score": "0.53948164", "text": "func (*TargetHttpProxy) Descriptor() ([]byte, []int) {\n\treturn file_google_cloud_compute_v1_compute_proto_rawDescGZIP(), []int{1158}\n}", "title": "" }, { "docid": "36e956cb9fe58897191a4e9ca2965208", "score": "0.5390604", "text": "func (*PatchSslPolicyRequest) Descriptor() ([]byte, []int) {\n\treturn file_google_cloud_compute_v1_compute_proto_rawDescGZIP(), []int{857}\n}", "title": "" }, { "docid": "05f3066318df4608bdd1edc774506995", "score": "0.5389384", "text": "func (r *GCPReader) ListTargetHTTPProxies(ctx context.Context, filter string) ([]compute.TargetHttpProxy, error) {\n\tservice := compute.NewTargetHttpProxiesService(r.compute)\n\n\tresources := make([]compute.TargetHttpProxy, 0)\n\n\tif err := service.List(r.project).\n\t\tFilter(filter).\n\t\tMaxResults(int64(r.maxResults)).\n\t\tPages(ctx, func(list *compute.TargetHttpProxyList) 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}); err != nil {\n\t\treturn nil, errors.Wrap(err, \"unable to list compute TargetHttpProxy from google APIs\")\n\t}\n\n\treturn resources, nil\n\n}", "title": "" }, { "docid": "c0d50edea95a88a9b57227708f7e86e3", "score": "0.537014", "text": "func (*ListWebhookRequest) Descriptor() ([]byte, []int) {\n\treturn file_canis_apiserver_proto_rawDescGZIP(), []int{38}\n}", "title": "" }, { "docid": "6ffafa450123f385be0607d05d89a27d", "score": "0.53693604", "text": "func (*SetUrlMapRegionTargetHttpProxyRequest) Descriptor() ([]byte, []int) {\n\treturn file_google_cloud_compute_v1_compute_proto_rawDescGZIP(), []int{1106}\n}", "title": "" }, { "docid": "162e34eb7983743032a8c603b8e97484", "score": "0.5368903", "text": "func (*UpdateSSLCertRequest) Descriptor() ([]byte, []int) {\n\treturn file_service_ssl_cert_proto_rawDescGZIP(), []int{2}\n}", "title": "" }, { "docid": "d7d78ccf3731085bd79787256b0f38fe", "score": "0.5365086", "text": "func (g *GCERegionTargetHttpsProxies) List(ctx context.Context, region string, fl *filter.F) ([]*ga.TargetHttpsProxy, error) {\n\tklog.V(5).Infof(\"GCERegionTargetHttpsProxies.List(%v, %v, %v) called\", ctx, region, fl)\n\tprojectID := g.s.ProjectRouter.ProjectID(ctx, \"ga\", \"RegionTargetHttpsProxies\")\n\trk := &RateLimitKey{\n\t\tProjectID: projectID,\n\t\tOperation: \"List\",\n\t\tVersion: meta.Version(\"ga\"),\n\t\tService: \"RegionTargetHttpsProxies\",\n\t}\n\tif err := g.s.RateLimiter.Accept(ctx, rk); err != nil {\n\t\treturn nil, err\n\t}\n\tklog.V(5).Infof(\"GCERegionTargetHttpsProxies.List(%v, %v, %v): projectID = %v, rk = %+v\", ctx, region, fl, projectID, rk)\n\tcall := g.s.GA.RegionTargetHttpsProxies.List(projectID, region)\n\tif fl != filter.None {\n\t\tcall.Filter(fl.String())\n\t}\n\tvar all []*ga.TargetHttpsProxy\n\tf := func(l *ga.TargetHttpsProxyList) error {\n\t\tklog.V(5).Infof(\"GCERegionTargetHttpsProxies.List(%v, ..., %v): page %+v\", ctx, fl, l)\n\t\tall = append(all, l.Items...)\n\t\treturn nil\n\t}\n\tif err := call.Pages(ctx, f); err != nil {\n\t\tklog.V(4).Infof(\"GCERegionTargetHttpsProxies.List(%v, ..., %v) = %v, %v\", ctx, fl, nil, err)\n\t\treturn nil, err\n\t}\n\n\tif klog.V(4).Enabled() {\n\t\tklog.V(4).Infof(\"GCERegionTargetHttpsProxies.List(%v, ..., %v) = [%v items], %v\", ctx, fl, len(all), nil)\n\t} else if klog.V(5).Enabled() {\n\t\tvar asStr []string\n\t\tfor _, o := range all {\n\t\t\tasStr = append(asStr, fmt.Sprintf(\"%+v\", o))\n\t\t}\n\t\tklog.V(5).Infof(\"GCERegionTargetHttpsProxies.List(%v, ..., %v) = %v, %v\", ctx, fl, asStr, nil)\n\t}\n\n\treturn all, nil\n}", "title": "" }, { "docid": "ae734196d76325f2fc732af2d9efe96c", "score": "0.5363486", "text": "func (*TargetPoolsScopedList) Descriptor() ([]byte, []int) {\n\treturn file_google_cloud_compute_v1_compute_proto_rawDescGZIP(), []int{1180}\n}", "title": "" }, { "docid": "5477323e58e28a47da20b7da9b88871c", "score": "0.53543293", "text": "func (*AggregatedListSslCertificatesRequest) Descriptor() ([]byte, []int) {\n\treturn file_google_cloud_compute_v1_compute_proto_rawDescGZIP(), []int{59}\n}", "title": "" } ]
c4e8099734657977d841a01eb7ca735a
Insert adds topic to the index.
[ { "docid": "9f377df56e1f0e128d6db3064fc96566", "score": "0.56556857", "text": "func (i SubscribeTopicIndex) Index(topicName string, topic *SubscribeTopic) {\r\n\ti[topicName] = *topic\r\n}", "title": "" } ]
[ { "docid": "3611f440e74705a1bb12e2caf9965842", "score": "0.6701398", "text": "func (api *API) InsertNewTopic(topicInfo Topic) error {\n\tif topicCount := api.GetTopicCount(topicInfo); topicCount == 0 {\n\t\tstmtIns, err := api.db.Prepare(\"insert into Topic values( ? )\")\n\t\tif err != nil {\n\t\t\tlog.Println(err.Error())\n\t\t\treturn err\n\t\t}\n\n\t\tif _, err = stmtIns.Exec(topicInfo.Topic.String); err != nil {\n\t\t\tlog.Println(err.Error())\n\t\t\treturn err\n\t\t}\n\t\tdefer stmtIns.Close()\n\t}\n\treturn nil\n}", "title": "" }, { "docid": "3486401beb63c5812617644a9295edd9", "score": "0.6591149", "text": "func (r *CommunityTopicsService) Insert(communityId int64, communitytopic *CommunityTopic) *CommunityTopicsInsertCall {\n\tc := &CommunityTopicsInsertCall{s: r.s, opt_: make(map[string]interface{})}\n\tc.communityId = communityId\n\tc.communitytopic = communitytopic\n\treturn c\n}", "title": "" }, { "docid": "3262b50b1c5f2d2cd86b202695b400c0", "score": "0.65813535", "text": "func (e *ElasticSearch) Insert(term string) error {\n\tq := struct {\n\t\tCompletion *elastic.SuggestField `json:\"completion_suggest\"`\n\t}{\n\t\telastic.NewSuggestField().Input(term).Weight(0),\n\t}\n\n\t_, err := e.Client.Index().\n\t\tIndex(e.Index).\n\t\tType(e.Type).\n\t\tId(term).\n\t\tBodyJson(&q).\n\t\tDo(context.TODO())\n\n\treturn err\n}", "title": "" }, { "docid": "339684fe94517b3b82b5a3c9d4269b58", "score": "0.60842067", "text": "func (client *Elasticsearch) Insert(index, doctype string) *Insert {\n\turl := fmt.Sprintf(\"http://%s/%s/%s\", client.Addr, index, doctype)\n\treturn &Insert{\n\t\tclient: client,\n\t\tparser: &InsertResultParser{},\n\t\turl: url,\n\t}\n}", "title": "" }, { "docid": "f3fa478e3de61f43c7b5f07efc15ff28", "score": "0.60519266", "text": "func (storage *Storage) AddTopic(topic entity.TopicInterface) (result entity.TopicInterface, err error) {\n\tconst addTopicSQL = `\n\t\tINSERT INTO topic (\n\t\t\tuser_id\n\t\t\t, name\n\t\t\t, is_active\n\t\t) VALUES (\n\t\t\t$1, $2, $3\n\t\t) RETURNING \n\t\t\ttopic_id\n\t\t\t, user_id\n\t\t\t, name\n\t\t\t, created_at\n\t\t\t, is_active\n\t`\n\ttx, err := storage.connPool.Begin()\n\tif err != nil {\n\t\treturn nil, pgError(err)\n\t}\n\tdefer func() {\n\t\tif err != nil {\n\t\t\tpgRollback(tx)\n\t\t}\n\t}()\n\n\tcreatedTopic := entity.Topic{}\n\tif err := tx.QueryRow(\n\t\t\taddTopicSQL,\n\t\t\ttopic.GetUserID(),\n\t\t\ttopic.GetName(),\n\t\t\ttopic.GetIsActive(),\n\t\t).Scan(\n\t\t\t&createdTopic.ID,\n\t\t\t&createdTopic.UserID,\n\t\t\t&createdTopic.Name,\n\t\t\t&createdTopic.CreatedAt,\n\t\t\t&createdTopic.IsActive,\n\t\t); err != nil {\n\t\treturn nil, pgError(err)\n\t}\n\n\tif err := tx.Commit(); err != nil {\n\t\treturn nil, pgError(err)\n\t}\n\n\tresult = &createdTopic\n\n\treturn result, nil\n}", "title": "" }, { "docid": "68d52b3bfec1c63934ff7862d08d1722", "score": "0.60392654", "text": "func (api *API) InsertPostTopic(topicInfo Topic) error {\n\tstmtIns, err := api.db.Prepare(\"insert into PostTopic values( ?, ?)\")\n\tif err != nil {\n\t\tlog.Print(err.Error())\n\t\treturn err\n\t}\n\tif _, err = stmtIns.Exec(\n\t\ttopicInfo.PostID,\n\t\ttopicInfo.Topic); err != nil {\n\t\tlog.Print(err.Error())\n\t}\n\n\tdefer stmtIns.Close()\n\treturn err\n}", "title": "" }, { "docid": "3349f9cb05746691df984c85a2d3dfb0", "score": "0.6009576", "text": "func addNewTopic(topic string) {\n\tdb.Update(func(tx *bolt.Tx) error {\n\t\t_, err := tx.CreateBucketIfNotExists([]byte(topic))\n\t\tif err != nil {\n\t\t\treturn err\n\t\t}\n\t\treturn nil\n\t})\n}", "title": "" }, { "docid": "04e0ed480734dcbd9b41f6e5104b8acf", "score": "0.5971054", "text": "func (d *Dao) EventTopicAdd(param *show.EventTopicAP) (err error) {\n\tif err = d.DB.Create(param).Error; err != nil {\n\t\tlog.Error(\"dao.show.EventTopicAdd error(%v)\", err)\n\t\treturn\n\t}\n\treturn\n}", "title": "" }, { "docid": "bab83ccbe8e0fa71193bae6f6edd4740", "score": "0.59629506", "text": "func AddTopic(name, creator string) (string, error) {\n\tdefer SetLastUpdateTopicPost()\n\tdate := time.Now().Unix()\n\tr, err := db.Exec(\"INSERT INTO topic (name, creator, created, lastmodified) VALUES (?, ?, ?, ?)\", name, creator, date, date)\n\tif err != nil {\n\t\treturn \"\", errors.New(fmt.Sprintln(\"Database error:\", err))\n\t}\n\n\tid, err := r.LastInsertId()\n\tif err != nil {\n\t\treturn \"\", errors.New(fmt.Sprintln(\"Database id error:\", err))\n\t}\n\n\treturn strconv.FormatInt(id, 10), nil\n}", "title": "" }, { "docid": "7fd922bb7a917384a72679b0da2f0c9a", "score": "0.5887257", "text": "func (s *defaultTweetStore) Insert(ctx context.Context, tweet *Tweet) error {\n\tctx, span := startSpan(ctx, \"insert\")\n\tdefer span.End()\n\n\tm, err := spanner.InsertStruct(s.TableName(), tweet)\n\tif err != nil {\n\t\treturn fmt.Errorf(\"failed spanner.InsertStruct: %w\", err)\n\t}\n\tms := []*spanner.Mutation{\n\t\tm,\n\t}\n\n\t_, err = s.sc.Apply(ctx, ms, spanners.AppTransactionTagApplyOption())\n\tif err != nil {\n\t\treturn fmt.Errorf(\"failed spanner.Apply: %w\", err)\n\t}\n\n\treturn nil\n}", "title": "" }, { "docid": "b3d9aaca2939a73ea34f1cbb5988593b", "score": "0.5826802", "text": "func (d *Dao) Insert(id uint64, content string, forceUpdate bool) {\n\td.searcher.Index(id, types.DocData{Content: content}, forceUpdate)\n}", "title": "" }, { "docid": "61f2eeecc11e4a55131905c5b0c7ce78", "score": "0.57197064", "text": "func (s *Simple) Insert(term string) error {\n\ts.all = append(s.all, term)\n\ts.db.Insert(term, term, []uint64{uint64(len(term))})\n\treturn nil\n}", "title": "" }, { "docid": "d7638cececb5855f89216e851798909f", "score": "0.5670234", "text": "func (trie *Trie) Insert(id string, doc interface{}, text string) {\n\ttokens := Tokenize(text)\n\ttrie.Lock()\n\tdefer trie.Unlock()\n\tfor _, token := range tokens {\n\t\ttrie.Count += trie.Root.insert(id, doc, Runify(token))\n\t}\n}", "title": "" }, { "docid": "64ad403ac0acf8836a2357ca052a66f8", "score": "0.5644031", "text": "func (c *Collection) Insert(docs ...interface{}) error {\n\tspan := newChildSpanFromContext(c.cfg, c.tags)\n\terr := c.Collection.Insert(docs...)\n\tspan.Finish(tracer.WithError(err))\n\treturn err\n}", "title": "" }, { "docid": "605725ae18e5222bc4868d9ae7dceacd", "score": "0.5628129", "text": "func Insert(ctx context.Context, beans ...any) error {\n\t_, err := GetEngine(ctx).Insert(beans...)\n\treturn err\n}", "title": "" }, { "docid": "865e880f585cb17b9a1fa71935323b94", "score": "0.56038517", "text": "func (s *Subscriber) AddTopic(topic uint64) {\n\ts.topics[topic] = true\n}", "title": "" }, { "docid": "b3d50c5097ef9e1abec7ec948dea1361", "score": "0.5579385", "text": "func (kc *KafkaCluster) InsertRecord(ctx context.Context, namespace string) error {\n\tforwarder, err := K8SServicePortForward(ctx, bridgeServiceName, namespace, bridgeServicePort)\n\tif err != nil {\n\t\treturn err\n\t}\n\tdefer forwarder.Close()\n\tports, err := forwarder.GetPorts()\n\tif err != nil {\n\t\treturn err\n\t}\n\turi := \"http://localhost:\" + fmt.Sprint(ports[0].Local)\n\n\tdata := InsertPayload{\n\t\tRecords: []Records{\n\t\t\t{\n\t\t\t\tValue: \"sales-lead-0001\",\n\t\t\t},\n\t\t},\n\t}\n\tpayloadBytes, err := json.Marshal(data)\n\tif err != nil {\n\t\treturn err\n\t}\n\tbody := bytes.NewReader(payloadBytes)\n\n\treq, err := http.NewRequest(\"POST\", uri+\"/topics/\"+topic, body)\n\tif err != nil {\n\t\treturn err\n\t}\n\n\treq.Header.Set(\"Content-Type\", \"application/vnd.kafka.json.v2+json\")\n\n\tresp, err := http.DefaultClient.Do(req)\n\tif err != nil {\n\t\treturn err\n\t}\n\tif resp.StatusCode != 200 {\n\t\treturn errors.New(\"Error inserting records in topic\")\n\t}\n\tdefer resp.Body.Close()\n\tbytes, err := io.ReadAll(resp.Body)\n\tif err != nil {\n\t\treturn err\n\t}\n\tlog.Debug().Print(string(bytes))\n\treturn nil\n}", "title": "" }, { "docid": "ca0791fbd9fd1cb37c5abe5388e7ad23", "score": "0.55703443", "text": "func CreateTopic(c *gin.Context) {\n\tuser := c.MustGet(\"user\").(models.User)\n\n\tvar topic models.Topic\n\terr := c.BindJSON(&topic)\n\tif err != nil {\n\t\tc.String(400, err.Error())\n\t\treturn\n\t}\n\tif topic.Title == \"\" {\n\t\tc.String(400, \"标题不能为空\")\n\t\treturn\n\t}\n\n\ttopic.UserID = user.ID\n\terr = proxy.Topic.Create(&topic)\n\tif err != nil {\n\t\tc.String(400, err.Error())\n\t\treturn\n\t}\n\tc.JSON(http.StatusOK, gin.H{\n\t\t\"error\": 0,\n\t\t\"errmsg\":\"保存成功\",\n\t})\n}", "title": "" }, { "docid": "7ea34083a7e8dd39a87e70cfed5f8d05", "score": "0.5559989", "text": "func CreateTopic(topicID int) {\n\n}", "title": "" }, { "docid": "826c176e5baa2a459fff08dc6e608303", "score": "0.5546773", "text": "func (d *dispatcher) AddTopic(name string) error {\n\tmutex.Lock()\n\td.topics[name] = make([]types.Listener, 0)\n\tmutex.Unlock()\n\n\treturn nil\n}", "title": "" }, { "docid": "3815bd79fa55ef161ffb3b5f5926e383", "score": "0.5540557", "text": "func (mr *MockstorerMockRecorder) Insert(topic, value interface{}) *gomock.Call {\n\tmr.mock.ctrl.T.Helper()\n\treturn mr.mock.ctrl.RecordCallWithMethodType(mr.mock, \"Insert\", reflect.TypeOf((*Mockstorer)(nil).Insert), topic, value)\n}", "title": "" }, { "docid": "3815bd79fa55ef161ffb3b5f5926e383", "score": "0.5540557", "text": "func (mr *MockstorerMockRecorder) Insert(topic, value interface{}) *gomock.Call {\n\tmr.mock.ctrl.T.Helper()\n\treturn mr.mock.ctrl.RecordCallWithMethodType(mr.mock, \"Insert\", reflect.TypeOf((*Mockstorer)(nil).Insert), topic, value)\n}", "title": "" }, { "docid": "b98ddbbc5b2fb79c420697b10b71f921", "score": "0.548469", "text": "func (s *Store) Insert(handle UpstreamHandle) {\n\ts.getShard(handle.Hello().ServerID).insert(handle)\n}", "title": "" }, { "docid": "bbb2af6b9f70c3051324df24ad3ed602", "score": "0.5480929", "text": "func (api *API) AddFollowedTopic(userId string, topic string) error {\n\tstmtIns, err := api.db.Prepare(\"insert into FollowTopic values( ?, ?)\")\n\tif _, err := stmtIns.Exec(userId, topic); err != nil {\n\t\tlog.Println(err)\n\t}\n\treturn err\n}", "title": "" }, { "docid": "f665e4a5643aee5b084a410198488442", "score": "0.5453546", "text": "func (r *CreateTopicsRequest) AddTopic(topic string, partitions int32, replicationFactor int16) error {\n\tfor _, rr := range r.CreateTopicRequests {\n\t\tif rr.Topic == topic {\n\t\t\treturn errorDumplicatedTopic\n\t\t}\n\t}\n\n\tcreateTopicRequest := &CreateTopicRequest{\n\t\tTopic: topic,\n\t\tNumPartitions: partitions,\n\t\tReplicationFactor: replicationFactor,\n\t}\n\tr.CreateTopicRequests = append(r.CreateTopicRequests, createTopicRequest)\n\treturn nil\n}", "title": "" }, { "docid": "428c14dde989c9b3361f01e9d06c00fc", "score": "0.54533434", "text": "func (s *MentionStore) Insert(record *Mention) error {\n\n\tif err := record.BeforeSave(); err != nil {\n\t\treturn err\n\t}\n\n\treturn s.Store.Insert(Schema.Mention.BaseSchema, record)\n\n}", "title": "" }, { "docid": "285db70f170ac3dd21f663ecefc1d2da", "score": "0.5443256", "text": "func (s *Session) AddTopic(topic string, qos byte) error {\n\ts.mu.Lock()\n\tdefer s.mu.Unlock()\n\n\tif !s.initted {\n\t\treturn fmt.Errorf(\"Session not yet initialized\")\n\t}\n\n\ts.topics[topic] = qos\n\n\treturn nil\n}", "title": "" }, { "docid": "c178b7ba50ad70fa056c5650ffa7351d", "score": "0.54181653", "text": "func (r *Bleve) Insert(record metadata.Record) error {\n\trecord.Properties.Geocatalogo.Inserted = time.Now()\n\treturn r.Index.Index(record.Properties.Identifier, record)\n}", "title": "" }, { "docid": "88a37607c9608d103cdd5ec699f78f7f", "score": "0.54062057", "text": "func insertIndex(kind, property string) error {\n\tglog.V(4).Info(\"Inserting index\")\n\tquery := SanitizeQuery(\"CREATE INDEX ON :%s(%s)\", kind, property) //CREATE INDEX ON :Pod(_uid)\"\n\t_, err := Store.Query(query)\n\tglog.V(4).Info(\"Insert index query: \", query)\n\treturn err\n}", "title": "" }, { "docid": "ce0fdc5865b7397835c8025d96be3653", "score": "0.54038113", "text": "func (this *Trie) Insert(word string) {\n\tthis.root.insert(word)\n}", "title": "" }, { "docid": "1738a89bda75ee897c1f95a4047c315b", "score": "0.5397485", "text": "func EnqueueTopic(impl *controller.Impl, topicLister listers.TopicLister) cache.ResourceEventHandler {\n\treturn controller.HandleAll(func(obj interface{}) {\n\t\tobject, err := kmeta.DeletionHandlingAccessor(obj)\n\t\tif err != nil {\n\t\t\treturn\n\t\t}\n\t\t// Get topics which are in the same namespace as the object.\n\t\ttopicList, err := topicLister.Topics(object.GetNamespace()).List(labels.Everything())\n\t\tif err != nil {\n\t\t\treturn\n\t\t}\n\t\t// Convert topics with qualified serviceAccountName into namespace/name strings, and pass them to EnqueueKey.\n\t\tfor _, t := range topicList {\n\t\t\tif t.Spec.ServiceAccountName == object.GetName() {\n\t\t\t\timpl.EnqueueKey(types.NamespacedName{Namespace: object.GetNamespace(), Name: t.Name})\n\t\t\t}\n\t\t}\n\t})\n}", "title": "" }, { "docid": "ae4913bc9a64813c6bbea220aff89f66", "score": "0.5395852", "text": "func (s *Shortener) Insert() error {\n\tid, _ := store.bucket.NextSequence()\n\ts.ID = int(id)\n\n\tshorturl, err := basex.Encode(strconv.Itoa(s.ID + index))\n\tif err != nil {\n\t\treturn err\n\t}\n\ts.ShortURL = shorturl\n\n\t// Marshal shortner data into bytes.\n\tbuf, err := json.Marshal(s)\n\tif err != nil {\n\t\treturn err\n\t}\n\n\t// Persist bytes to users bucket.\n\tif err := store.bucket.Put(itob(int(id)), buf); err != nil {\n\t\treturn err\n\t}\n\treturn nil\n\n}", "title": "" }, { "docid": "cc12a14e668c192f0a8d90e229d04132", "score": "0.5390723", "text": "func (user *User) CreateTopic(mctx *Context, title, body, categoryID string) (*Topic, error) {\n\tctx := mctx.context\n\ttitle, body = strings.TrimSpace(title), strings.TrimSpace(body)\n\tif len(title) < minTitleSize {\n\t\treturn nil, session.BadDataError(ctx)\n\t}\n\n\tt := time.Now()\n\ttopic := &Topic{\n\t\tTopicID: uuid.Must(uuid.NewV4()).String(),\n\t\tTitle: title,\n\t\tBody: body,\n\t\tUserID: user.UserID,\n\t\tCreatedAt: t,\n\t\tUpdatedAt: t,\n\t}\n\tvar err error\n\ttopic.ShortID, err = generateShortID(\"topics\", t)\n\tif err != nil {\n\t\treturn nil, session.ServerError(ctx, err)\n\t}\n\n\terr = mctx.database.RunInTransaction(ctx, func(tx *sql.Tx) error {\n\t\tcategory, err := findCategory(ctx, tx, categoryID)\n\t\tif err != nil {\n\t\t\treturn err\n\t\t}\n\t\tif category == nil {\n\t\t\treturn session.BadDataError(ctx)\n\t\t}\n\t\ttopic.CategoryID = category.CategoryID\n\t\tcategory.LastTopicID = sql.NullString{String: topic.TopicID, Valid: true}\n\t\tcount, err := topicsCountByCategory(ctx, tx, category.CategoryID)\n\t\tif err != nil {\n\t\t\treturn err\n\t\t}\n\t\tcategory.TopicsCount, category.UpdatedAt = count+1, time.Now()\n\t\tcols, params := durable.PrepareColumnsWithValues(topicColumns)\n\t\t_, err = tx.ExecContext(ctx, fmt.Sprintf(\"INSERT INTO topics(%s) VALUES (%s)\", cols, params), topic.values()...)\n\t\tif err != nil {\n\t\t\treturn err\n\t\t}\n\t\tccols, cparams := durable.PrepareColumnsWithValues([]string{\"last_topic_id\", \"topics_count\", \"updated_at\"})\n\t\tcvals := []interface{}{category.LastTopicID, category.TopicsCount, category.UpdatedAt}\n\t\t_, err = tx.ExecContext(ctx, fmt.Sprintf(\"UPDATE categories SET (%s)=(%s) WHERE category_id='%s'\", ccols, cparams, category.CategoryID), cvals...)\n\t\tif err != nil {\n\t\t\treturn err\n\t\t}\n\t\t_, err = upsertStatistic(ctx, tx, \"topics\")\n\t\treturn err\n\t})\n\tif err != nil {\n\t\tif _, ok := err.(session.Error); ok {\n\t\t\treturn nil, err\n\t\t}\n\t\treturn nil, session.TransactionError(ctx, err)\n\t}\n\treturn topic, nil\n}", "title": "" }, { "docid": "bfee79b34a403f436620d792b0240598", "score": "0.53822285", "text": "func (t *topics) CreateTopic() gin.HandlerFunc {\n\t// TODO: implement\n\treturn func(ctx *gin.Context) {}\n}", "title": "" }, { "docid": "4ed24967e3068e6c1798cdecb7434d91", "score": "0.538221", "text": "func (t *FHQTreap) Insert(index int, value int) {\r\n\tn := t.Size()\r\n\tif index < 0 {\r\n\t\tindex += n\r\n\t}\r\n\r\n\tvar x, y int\r\n\tt.splitByRank(t.root, index, &x, &y)\r\n\tt.root = t.merge(t.merge(x, t.newNode(value)), y)\r\n}", "title": "" }, { "docid": "4a7d885971210d9a1c194283ac611273", "score": "0.5380253", "text": "func RegisterTopic(topic DSTopic) error {\n\ttopicName := topic.GetTopic()\n\tif _, ok := dsTopics[topicName]; ok {\n\t\treturn fmt.Errorf(\"duplicated topic '%s'\", topicName)\n\t}\n\n\tdsTopics[topicName] = topic\n\n\t// start listen\n\tgo topicListener(topic)\n\treturn nil\n}", "title": "" }, { "docid": "c0dad54a52b2066e4df7f07d1ab549cc", "score": "0.53767765", "text": "func (tm *transactionManager) insert(trans *transaction) {\n\ttm.Lock()\n\tdefer tm.Unlock()\n\n\ttm.transactions.Set(trans.id, trans)\n\ttm.index.Set(tm.genIndexKeyByTrans(trans), trans)\n}", "title": "" }, { "docid": "37fce41e2d85734d66816cc32fcb01a5", "score": "0.5370554", "text": "func (b *btreeIndex) Insert(doc document.Document) error {\n\tkey, err := createItem(doc.Get(b.field), nil)\n\tif err != nil {\n\t\treturn err\n\t}\n\n\tnewItem, err := createItem(doc.Get(b.field), []document.ObjectID{doc.ID()})\n\tif err != nil {\n\t\treturn err\n\t}\n\n\tfound := b.btree.Get(key)\n\tif found != nil {\n\t\tlist := found.(*btreeItem).ids\n\t\tnewItem.ids = append(list, newItem.ids...)\n\t}\n\n\tb.btree.ReplaceOrInsert(newItem)\n\n\treturn nil\n}", "title": "" }, { "docid": "1f45bba907a6be308d8d667c192488ba", "score": "0.5369614", "text": "func (t *Thread) Insert(db XODB) error {\n\tvar err error\n\n\t// if already exist, bail\n\tif t._exists {\n\t\treturn errors.New(\"insert failed: already exists\")\n\t}\n\n\t// sql insert query, primary key must be provided\n\tconst sqlstr = `INSERT INTO go_keijiban.threads (` +\n\t\t`id, title, created_at` +\n\t\t`) VALUES (` +\n\t\t`?, ?, ?` +\n\t\t`)`\n\n\t// run query\n\tXOLog(sqlstr, t.ID, t.Title, t.CreatedAt)\n\t_, err = db.Exec(sqlstr, t.ID, t.Title, t.CreatedAt)\n\tif err != nil {\n\t\treturn err\n\t}\n\n\t// set existence\n\tt._exists = true\n\n\treturn nil\n}", "title": "" }, { "docid": "c404eb66f8a74f78ab53c4e8e2de3aba", "score": "0.5366968", "text": "func (index *Index[K, F]) Insert(f F) error {\n\tbounds := f.Bounds()\n\tindex.rtree.Insert(bounds.Min, bounds.Max, f)\n\tindex.featureByKey[f.Key()] = f\n\treturn nil\n}", "title": "" }, { "docid": "9a9ea166e33c941b9838c345996d29f7", "score": "0.53618234", "text": "func (m *MongoDbConn) InsertArticle(b *Article) error { return m.adminArticle(DBCmdInsert, b) }", "title": "" }, { "docid": "59319d66ed63b892530f67c177bb4ec0", "score": "0.5344585", "text": "func (ks *CollectionsKeyspace) Insert(inserts []value.Pair, context QueryContext) ([]value.Pair, errors.Error) {\n\treturn nil, errors.NewNotImplemented(\"CollectionsKeyspace.Insert()\")\n}", "title": "" }, { "docid": "95011e6eaac951d634ee5a80eca35d9a", "score": "0.5330621", "text": "func insertTweet(tweet schema.Tweet, subject news.Subject, insertStmt *sql.Stmt) error {\n\t_, err := insertStmt.Exec(\n\t\ttweet.ID,\n\t\ttweet.User.ID,\n\t\ttweet.GetDate(),\n\t\ttweet.Text,\n\t\tsubject.Ticker,\n\t\ttweet.Language,\n\t\ttweet.User.Followers)\n\treturn err\n}", "title": "" }, { "docid": "5b25f858abf91c4a96296d1865df2b16", "score": "0.5329732", "text": "func (client *Client) AddTopicEx(request *AddTopicRequest, headers map[string]*string, runtime *util.RuntimeOptions) (_result *AddTopicResponse, _err error) {\n\t_err = util.ValidateModel(request)\n\tif _err != nil {\n\t\treturn _result, _err\n\t}\n\t_result = &AddTopicResponse{}\n\t_body, _err := client.DoRequest(tea.String(\"2.0\"), tea.String(\"sofa.mq.topic.add\"), tea.String(\"HTTPS\"), tea.String(\"POST\"), tea.String(\"/gateway.do\"), tea.ToMap(request), headers, runtime)\n\tif _err != nil {\n\t\treturn _result, _err\n\t}\n\t_err = tea.Convert(_body, &_result)\n\treturn _result, _err\n}", "title": "" }, { "docid": "2fd9e60f731512d55ac0501c18a11c9d", "score": "0.53251827", "text": "func (client *Client) AddTopic(request *AddTopicRequest) (_result *AddTopicResponse, _err error) {\n\truntime := &util.RuntimeOptions{}\n\theaders := make(map[string]*string)\n\t_result = &AddTopicResponse{}\n\t_body, _err := client.AddTopicEx(request, headers, runtime)\n\tif _err != nil {\n\t\treturn _result, _err\n\t}\n\t_result = _body\n\treturn _result, _err\n}", "title": "" }, { "docid": "d60229d8e613334dd1e8a494e6885632", "score": "0.5305939", "text": "func (index *LshForest) Insert(point Point, id string) {\n\t// Apply hash functions.\n\thvs := index.hash(point)\n\t// Parallel insert\n\tvar wg sync.WaitGroup\n\twg.Add(len(index.tables))\n\tfor i := range index.tables {\n\t\thv := hvs[i]\n\t\ttable := index.tables[i]\n\t\tgo func(table *leveldb.DB, hv hashTableKey) {\n\t\t\tkey := IntsToBytes(hv)\n\t\t\tif i, e := table.Has(key, nil); i && e == nil {\n\t\t\t\tif e := ListAdd(table, key, id); e != nil {\n\t\t\t\t\tpanic(e)\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\tif e := table.Put(key, StringIn(id), &opt.WriteOptions{Sync: true}); e != nil {\n\t\t\t\t\tpanic(e)\n\t\t\t\t}\n\t\t\t}\n\t\t\twg.Done()\n\t\t}(table, hv)\n\t}\n\twg.Wait()\n}", "title": "" }, { "docid": "8afce0fe8227fc8f76a89370797b808f", "score": "0.5304212", "text": "func (t *Text) Insert(ctx context.Context) *spanner.Mutation {\n\treturn spanner.Insert(\"Texts\", TextColumns(), []interface{}{\n\t\tt.TextID, t.Body, t.CreatedAt,\n\t})\n}", "title": "" }, { "docid": "ef392ce5d16cf778d452f8ab92733389", "score": "0.5293626", "text": "func (r *GroupsAliasesService) Insert(groupKey string, alias *Alias) *GroupsAliasesInsertCall {\n\tc := &GroupsAliasesInsertCall{s: r.s, urlParams_: make(gensupport.URLParams)}\n\tc.groupKey = groupKey\n\tc.alias = alias\n\treturn c\n}", "title": "" }, { "docid": "03ef242c12bc53c8cd99c16234ddda9c", "score": "0.528764", "text": "func (cc *Channels) Insert(c *VirtioChannel, idx int) error {\n\tif idx < 0 {\n\t\treturn fmt.Errorf(\"Invalid channel index: %d\", idx)\n\t}\n\t*cc = append(*cc, VirtioChannel{})\n\tcopy((*cc)[idx+1:], (*cc)[idx:])\n\t(*cc)[idx] = *c\n\treturn nil\n}", "title": "" }, { "docid": "fca235c796ba4619e4b94441bf8a40b0", "score": "0.5283343", "text": "func (c *client) InsertDocument(indexName, documentType string, data []byte) (bool, error) {\n\tesUrl := c.Host.String() + \"/\" + indexName + \"/\" + documentType\n\treader := bytes.NewBuffer(data)\n\t_, err := sendHTTPRequest(\"POST\", esUrl, reader)\n\tif err != nil {\n\t\treturn false, err\n\t}\n\n\treturn true, nil\n}", "title": "" }, { "docid": "3c385802411bba5e16d797f0ce9ee8cd", "score": "0.5265041", "text": "func (r *ElasticRepository) InsertMeow(ctx context.Context, meow schema.Meow) error {\n\t_, err := r.client.Index().\n\t\tIndex(\"meow\").\n\t\tType(\"meow\").\n\t\tId(meow.ID).\n\t\tBodyJson(meow).\n\t\tRefresh(\"wait_for\").\n\t\tDo(ctx)\n\treturn err\n}", "title": "" }, { "docid": "2853bff6c9c7710e6884c5d95ece0d07", "score": "0.52598965", "text": "func (r *StorelayoutclustersService) Insert(enterpriseId string, pageId string, storecluster *StoreCluster) *StorelayoutclustersInsertCall {\n\tc := &StorelayoutclustersInsertCall{s: r.s, urlParams_: make(gensupport.URLParams)}\n\tc.enterpriseId = enterpriseId\n\tc.pageId = pageId\n\tc.storecluster = storecluster\n\treturn c\n}", "title": "" }, { "docid": "9ff67aff5c71d88875de134c8c5b0d7e", "score": "0.5256866", "text": "func (s FizzbuzzTweetService) Insert(ft *model.FizzbuzzTweet) error {\n\tnow := time.Now().UTC()\n\tsql, args, err := sq.Insert(model.FizzbuzzTweetTableName).Columns(\n\t\t\"number\", \"is_fizz\", \"is_buzz\", \"tweet\", \"updated_at\", \"created_at\").\n\t\tValues(ft.Number, ft.IsFizz, ft.IsBuzz, ft.Tweet, now, now).ToSql()\n\tif err != nil {\n\t\treturn err\n\t}\n\n\t_, err = s.pe.Exec(sql, args...)\n\tif err != nil {\n\t\treturn err\n\t}\n\n\treturn nil\n}", "title": "" }, { "docid": "f33642cf6a18dce5094315fc0488f894", "score": "0.5256658", "text": "func (s *MentionStore) Insert(record *Mention) error {\n\trecord.SetSaving(true)\n\tdefer record.SetSaving(false)\n\n\trecord.CreatedAt = record.CreatedAt.Truncate(time.Microsecond)\n\trecord.UpdatedAt = record.UpdatedAt.Truncate(time.Microsecond)\n\n\tif err := record.BeforeSave(); err != nil {\n\t\treturn err\n\t}\n\n\treturn s.Store.Insert(Schema.Mention.BaseSchema, record)\n}", "title": "" }, { "docid": "5ac800e51be60249f842334f6333b5d0", "score": "0.52558213", "text": "func (lA *LinkActive) RegisterTopic(topicName string) {\n\tlA.commandCh <- cmdActiveLink{\n\t\tcmd: registerTopicActive,\n\t\tmsg: []byte(topicName),\n\t}\n}", "title": "" }, { "docid": "bd7a38c696ad411b60df08c1c767f1a5", "score": "0.52535", "text": "func (ps *service) Insert(probe Probe) error {\n\terr := runValidators(probe, nameInvalid, urlInvalid, delayInvalid)\n\tif err != nil {\n\t\treturn err\n\t}\n\n\tentity, err := ps.persister.Get(probe.Name)\n\tif err != nil {\n\t\treturn err\n\t}\n\tif entity != nil && entity.Name != \"\" {\n\t\treturn ErrProbeAlreadyExist\n\t}\n\n\tentity = persistence.NewEntity(probe.Name, probe.URL, probe.Delay)\n\terr = ps.persister.Insert(entity)\n\tif err != nil {\n\t\treturn err\n\t}\n\n\tps.probes[probe.Name] = &probe\n\tgo ps.runner.Run(&probe)\n\n\tlog.Printf(\"Probe [%s] has been successfuly created.\\n\", probe.Name)\n\treturn nil\n}", "title": "" }, { "docid": "2bdb27d885e44eeb381420096f9beb3e", "score": "0.5228329", "text": "func (s *Sublist) Insert(sub *subscription) error {\n\n\ttokens, err := SubscribeTopicCheckAndSpilt(sub.topic)\n\tif err != nil {\n\t\treturn err\n\t}\n\ts.Lock()\n\n\tl := s.root\n\tvar n *node\n\tfor _, t := range tokens {\n\t\tn = l.nodes[t]\n\t\tif n == nil {\n\t\t\tn = newNode()\n\t\t\tl.nodes[t] = n\n\t\t}\n\t\tif n.next == nil {\n\t\t\tn.next = newLevel()\n\t\t}\n\t\tl = n.next\n\t}\n\tif sub.queue {\n\t\t//check qsub is already exist\n\t\tfor i := range n.qsubs {\n\t\t\tif equal(n.qsubs[i], sub) {\n\t\t\t\tn.qsubs[i] = sub\n\t\t\t\treturn nil\n\t\t\t}\n\t\t}\n\t\tn.qsubs = append(n.qsubs, sub)\n\t} else {\n\t\t//check psub is already exist\n\t\tfor i := range n.psubs {\n\t\t\tif equal(n.psubs[i], sub) {\n\t\t\t\tn.psubs[i] = sub\n\t\t\t\treturn nil\n\t\t\t}\n\t\t}\n\t\tn.psubs = append(n.psubs, sub)\n\t}\n\n\ttopic := string(sub.topic)\n\ts.addToCache(topic, sub)\n\ts.Unlock()\n\treturn nil\n}", "title": "" }, { "docid": "4b0d81243c695b1869f6775111a19ae7", "score": "0.521776", "text": "func (s *Store) Insert(key string, value []byte) error {\n\treturn s.store.Insert(key, value)\n}", "title": "" }, { "docid": "7229d5eed43dc078cfce67547a518190", "score": "0.5209111", "text": "func (m *TikitsDAO) Insert(tikit Tikit) error {\r\n\terr := tikitdb.C(GLy_COLLECTION).Insert(&tikit)\r\n\treturn err\r\n}", "title": "" }, { "docid": "c4a632c704f6bb3fd9eef38ee1482fc3", "score": "0.5203676", "text": "func (s *Storage) Insert(m *models.Message) error {\n\terr := s.db.Create(m).Error\n\tif err != nil {\n\t\treturn fmt.Errorf(\"storage: unable to insert data: %v\", err)\n\t}\n\treturn nil\n}", "title": "" }, { "docid": "797c2bbfa5945e33086fb0abceb61ffc", "score": "0.52035576", "text": "func (t *temp) Insert(key, value string, expires time.Duration) (err error) {\n\tif len(key) == 0 {\n\t\terr = ErrKeyRequired\n\t\treturn\n\t}\n\n\tif len(value) == 0 {\n\t\terr = ErrValueRequired\n\t\treturn\n\t}\n\n\tk := fmt.Sprint(\"tempDB:\", key)\n\terr = t.Set(k, value, expires).Err()\n\n\treturn\n}", "title": "" }, { "docid": "a7350fc997542ed227e2a5d999618935", "score": "0.51955366", "text": "func (mk *MemeKeyword) Insert(db XODB) error {\n\tvar err error\n\n\t// if already exist, bail\n\tif mk._exists {\n\t\treturn errors.New(\"insert failed: already exists\")\n\t}\n\n\t// sql query\n\tconst sqlstr = `INSERT INTO alpha.meme_keyword (` +\n\t\t`meme_id, keyword, weight` +\n\t\t`) VALUES (` +\n\t\t`?, ?, ?` +\n\t\t`)`\n\n\t// run query\n\tXOLog(sqlstr, mk.MemeID, mk.Keyword, mk.Weight)\n\tres, err := db.Exec(sqlstr, mk.MemeID, mk.Keyword, mk.Weight)\n\tif err != nil {\n\t\treturn err\n\t}\n\n\t// retrieve id\n\tid, err := res.LastInsertId()\n\tif err != nil {\n\t\treturn err\n\t}\n\n\t// set primary key and existence\n\tmk.WordType = WordType(id)\n\tmk._exists = true\n\n\treturn nil\n}", "title": "" }, { "docid": "9e2d95ded10ad23637856fed0eb86c6c", "score": "0.5193866", "text": "func (c *Cluster) CreateTopic(name string) *Topic {\n\tt := newTopic(name)\n\t// We need to append it to the raft\n\n\tc.topics[name] = t\n\treturn t\n}", "title": "" }, { "docid": "b3698aab067cec5e1ce97600f1e7e323", "score": "0.51921254", "text": "func (c *CuckooIndex) insert(key unsafe.Pointer, v memCom.RecordID, eventTime uint32) bool {\n\tadded, hashResults := c.addNew(key, v, eventTime)\n\tif !added {\n\t\treturn c.cuckooAdd(key, v, eventTime, hashResults)\n\t}\n\treturn true\n}", "title": "" }, { "docid": "6c565b8659acf3df6f2243b0eeed8937", "score": "0.51897496", "text": "func (col *Col) Insert(doc map[string]interface{}) (id uint64, err error) {\n\t// Allocate an ID to the document\n\tid = uid.NextUID()\n\tdoc[uid.PK_NAME] = strconv.FormatUint(id, 10)\n\tnum := id % col.NumChunksI64\n\t// Lock the chunk while inserting the document\n\tlock := col.ChunkMutexes[num]\n\tlock.Lock()\n\tif _, err = col.Chunks[num].Insert(doc); err != nil {\n\t\tlock.Unlock()\n\t\treturn\n\t}\n\tcol.indexDoc(id, doc)\n\tlock.Unlock()\n\treturn\n}", "title": "" }, { "docid": "6aca0e267695316370e59729b36b28af", "score": "0.51894224", "text": "func (c *Chart) Insert(index int, val float64, col Color, text ...string) {\n\tlabelStr := cStringOpt(text)\n\tdefer C.free(unsafe.Pointer(labelStr))\n\n\tC.go_fltk_Chart_insert((*C.Fl_Chart)(c.ptr()), C.int(index), C.double(val), labelStr, C.uint(col))\n}", "title": "" }, { "docid": "66f4a310974094d709874b498967b3d9", "score": "0.5183698", "text": "func (c *MNewsDAO) Insert(News models.News) error {\r\n\terr := db.C(COLLECTION).Insert(&News)\r\n\treturn err\r\n}", "title": "" }, { "docid": "1e16c5eb21e0756c7f1e9b8172a7bcfd", "score": "0.5182292", "text": "func (r *SimpleRetriever) Insert(id string, embedding *embedding.Embedding) bool {\n\tr.mtx.Lock()\n\tdefer r.mtx.Unlock()\n\tif len(r.embeddings) >= r.maxSize {\n\t\treturn false\n\t}\n\tr.embeddings[id] = embedding\n\treturn true\n}", "title": "" }, { "docid": "f80c005f081d75749da930d504a14b6a", "score": "0.5171292", "text": "func (this *Trie) Insert(word string) {\n\tthis.ret[word] = true\n}", "title": "" }, { "docid": "c934edd0c4dfe73fd068ac46e6e541ab", "score": "0.51693535", "text": "func (r *CommunityMessagesService) Insert(communityId int64, topicId int64, communitymessage *CommunityMessage) *CommunityMessagesInsertCall {\n\tc := &CommunityMessagesInsertCall{s: r.s, opt_: make(map[string]interface{})}\n\tc.communityId = communityId\n\tc.topicId = topicId\n\tc.communitymessage = communitymessage\n\treturn c\n}", "title": "" }, { "docid": "b2bbaa6355335f058da5be093bc7b4ba", "score": "0.5169056", "text": "func Insert(todo viewmodels.Todo) error {\n\ttodoDB := context.Connect()\n\tfmt.Printf(\"------Insert--------- \\n\")\n\terr := todoDB.C(collectionTodo).Insert(&todo)\n\treturn err\n}", "title": "" }, { "docid": "e55f9281673860684d15940c6c736aa7", "score": "0.516011", "text": "func (s *SqlStore) Insert(streamID int64, substream string, startindex int64, da DatapointArray) error {\n\treturn s.stmtInsert(s.inserter, streamID, substream, startindex, da)\n}", "title": "" }, { "docid": "e56be11d8ebe06bb6fff8599a32a2d77", "score": "0.5158643", "text": "func Insert(timestamp time.Time, keyvalues map[string]interface{}) {\n\tc, err := client.NewHTTPClient(client.HTTPConfig{\n\t\tAddr: \"http://localhost:8086\",\n\t})\n\tif err != nil {\n\t\tlog.Fatal(err)\n\t}\n\tdefer c.Close()\n\n\t// Create a new point batch\n\tbp, err := client.NewBatchPoints(client.BatchPointsConfig{\n\t\tDatabase: MyDB,\n\t\tPrecision: \"s\",\n\t})\n\tif err != nil {\n\t\tlog.Fatal(err)\n\t}\n\n\t// Create a point and add to batch\n\ttags := map[string]string{\"type\": keyvalues[\"type\"].(string)}\n\tfields := keyvalues\n\n\tpt, err := client.NewPoint(\"energy_usage\", tags, fields, timestamp)\n\tif err != nil {\n\t\tlog.Fatal(err)\n\t}\n\tbp.AddPoint(pt)\n\n\t// Write the batch\n\tif err := c.Write(bp); err != nil {\n\t\tlog.Fatal(err)\n\t}\n\n\t// Close client resources\n\tif err := c.Close(); err != nil {\n\t\tlog.Fatal(err)\n\t}\n}", "title": "" }, { "docid": "905ca6e88089767735d121f7d2ea28fb", "score": "0.51547766", "text": "func (wft *WsubFinderTaxonomy) Insert(db XODB) error {\n\tvar err error\n\n\t// if already exist, bail\n\tif wft._exists {\n\t\treturn errors.New(\"insert failed: already exists\")\n\t}\n\n\t// sql insert query, primary key provided by autoincrement\n\tconst sqlstr = `INSERT INTO jlabo.wsub_finder_taxonomy (` +\n\t\t`parent_id, title, state, access, ordering` +\n\t\t`) VALUES (` +\n\t\t`?, ?, ?, ?, ?` +\n\t\t`)`\n\n\t// run query\n\tXOLog(sqlstr, wft.ParentID, wft.Title, wft.State, wft.Access, wft.Ordering)\n\tres, err := db.Exec(sqlstr, wft.ParentID, wft.Title, wft.State, wft.Access, wft.Ordering)\n\tif err != nil {\n\t\treturn err\n\t}\n\n\t// retrieve id\n\tid, err := res.LastInsertId()\n\tif err != nil {\n\t\treturn err\n\t}\n\n\t// set primary key and existence\n\twft.ID = uint(id)\n\twft._exists = true\n\n\treturn nil\n}", "title": "" }, { "docid": "e39d919ca599d5cae607b7c11d8b2bb1", "score": "0.5150013", "text": "func (this *Trie) Insert(word string) {\n insert(this.root,word)\n}", "title": "" }, { "docid": "4b3ff04030af14a4ac017627a11e6749", "score": "0.5149665", "text": "func (this *Trie) Insert(word string) {\n\tif len(word) == 0 {\n\t\tthis.exists = true\n\t\treturn\n\t}\n\tb, rest := word[0], word[1:]\n\tif _, ok := this.sub[b]; !ok {\n\t\ts := Constructor()\n\t\tthis.sub[b] = &s\n\t}\n\tthis.sub[b].Insert(rest)\n}", "title": "" }, { "docid": "b40a41c61c98dbb61fdfab4f78882c33", "score": "0.5145581", "text": "func (ht *hashTable) Insert(key string) error {\n\tindex := hashFunc(key)\n\terr := ht.bucket[index].insert(key)\n\tif err != nil {\n\t\treturn err\n\t}\n\treturn nil\n}", "title": "" }, { "docid": "8d62fc3e53b29b9dfcf6a795099508af", "score": "0.51365334", "text": "func (datahub *DataHub) CreateTopic(topic *Topic) error {\n\tpath := fmt.Sprintf(TOPIC, topic.ProjectName, topic.TopicName)\n\terr := datahub.Client.Post(path, topic)\n\treturn err\n}", "title": "" }, { "docid": "822bf6d57e31dd3110b1deb94af5f545", "score": "0.51329046", "text": "func (sm *StoreMongodb) Insert(srt entities.Shorten) error {\n\t_, err := sm.collection.InsertOne(sm.ctx, srt)\n\tif err != nil {\n\t\treturn err\n\t}\n\terr = sm.Disconnect()\n\tif err != nil {\n\t\treturn err\n\t}\n\treturn nil\n}", "title": "" }, { "docid": "b51d0cc2f856d8611cd5808389f1e3c7", "score": "0.5132263", "text": "func (tl *TestLog) Insert() error {\n\ttl.Id = mgobson.NewObjectId().Hex()\n\tif err := tl.Validate(); err != nil {\n\t\treturn errors.Wrap(err, \"invalid test log\")\n\t}\n\treturn errors.WithStack(db.Insert(TestLogCollection, tl))\n}", "title": "" }, { "docid": "54449a08028f681cbc1265033cb10425", "score": "0.5131292", "text": "func (tt *Index) Push(recs ...*types.Log) error {\n\tfor _, rec := range recs {\n\t\tif len(rec.Topics) > MaxCount {\n\t\t\treturn ErrTooManyTopics\n\t\t}\n\t\tcount := posToBytes(uint8(len(rec.Topics)))\n\n\t\tid := NewID(rec.BlockNumber, rec.TxHash, rec.Index)\n\n\t\tfor pos, topic := range rec.Topics {\n\t\t\tkey := topicKey(topic, uint8(pos), id)\n\t\t\terr := tt.table.Topic.Put(key, count)\n\t\t\tif err != nil {\n\t\t\t\treturn err\n\t\t\t}\n\n\t\t\tkey = otherKey(id, uint8(pos))\n\t\t\terr = tt.table.Other.Put(key, topic.Bytes())\n\t\t\tif err != nil {\n\t\t\t\treturn err\n\t\t\t}\n\t\t}\n\n\t\terr := tt.table.Logrec.Put(id.Bytes(), append(rec.Data, rec.Address[:]...))\n\t\tif err != nil {\n\t\t\treturn err\n\t\t}\n\t}\n\n\treturn nil\n}", "title": "" }, { "docid": "a4021ce5a0b2aa08c91996934302a2f2", "score": "0.5128375", "text": "func (p *PostController) AddTopicsToPost(ctx *fiber.Ctx) {\n\ttopics, err := p.postService.AddTopicsToPost(ctx)\n\tif err != nil {\n\t\tctx.Next(err)\n\n\t\treturn\n\t}\n\n\tr := utils.NewResponse()\n\tr.JSONResponse(ctx, true, fiber.StatusCreated, \"[INFO]: Resource created\", topics)\n}", "title": "" }, { "docid": "e9f99392825e46767b87b404b1c5d831", "score": "0.51243657", "text": "func (n *NotesDAO) Insert(note Note) error {\n\terr := db.C(COLLECTION).Insert(&note)\n\treturn err\n}", "title": "" }, { "docid": "4d404013259b6d3b22340e52275e697a", "score": "0.5122975", "text": "func (b *Board) AddTopic(p BoardAddTopicParams) (int, error) {\n\tparams := map[string]string{\n\t\t\"group_id\": fmt.Sprint(p.GroupID),\n\t\t\"title\": p.Title,\n\t\t\"text\": p.Text,\n\t\t\"from_group\": boolConverter(p.FromGroup),\n\t\t\"attachments\": p.Attachments,\n\t}\n\tresp, err := b.vk.Request(\"board.addTopic\", params)\n\tif err != nil {\n\t\treturn 0, err\n\t}\n\ttopicID, err := strconv.Atoi(string(resp))\n\tif err != nil {\n\t\treturn 0, err\n\t}\n\treturn int(topicID), nil\n}", "title": "" }, { "docid": "d1f641c36c2be5873206b351338a16e9", "score": "0.5118122", "text": "func (t *Treap) Insert(key, val interface{}) {\n\tx := &Node{\n\t\tKey: key,\n\t\tVal: val,\n\t\tsize: 1,\n\t\tt: rand.Int(),\n\t}\n\tt.insertNode(x)\n}", "title": "" }, { "docid": "f4244c7a597b8524827b7a35f6a6d62a", "score": "0.5117661", "text": "func (t Trigger) Insert() error {\n\ttoken := auth.NewToken()\n\tpayload, err := json.Marshal(t)\n\tif err != nil {\n\t\tlog.Fatal(err)\n\t}\n\n\treq, err := http.NewRequest(\"POST\", viper.GetString(\"baseurl\")+\"/events/event-triggers\", bytes.NewBuffer(payload))\n\tif err != nil {\n\t\tlog.Fatal(err)\n\t}\n\n\treq.Header.Add(\"Content-Type\", \"application/json\")\n\treq.Header.Add(\"Authorization\", \"Bearer \"+token.Val)\n\n\tresponse, err := http.DefaultClient.Do(req)\n\tif err != nil {\n\t\tlog.Fatal(err)\n\t}\n\tdefer response.Body.Close()\n\n\tif response.StatusCode != 201 {\n\t\tbody, err := ioutil.ReadAll(response.Body)\n\t\tif err != nil {\n\t\t\tlog.Fatal(err)\n\t\t}\n\t\tlog.Fatal(string(body))\n\t}\n\n\treturn nil\n}", "title": "" }, { "docid": "1d825c30d9f25c2e730be99050347604", "score": "0.51113635", "text": "func (subscription *Subscription) Insert(db *dbhelper.DBhelper) error {\n\tsubscription.SubscriptionID = gaw.RandString(32)\n\t_, err := db.Insert(subscription, &dbhelper.InsertOption{\n\t\tTableName: TableSubscriptions,\n\t\tSetPK: true,\n\t})\n\treturn err\n}", "title": "" }, { "docid": "b9dea268aaa8f5f6e6af275d851beb05", "score": "0.51062244", "text": "func (ht *HashTable) Insert(v Keyer) {\n\tsk := v.Key()\n\tpos := ht.hash(sk)\n\tl := &ht.table[pos]\n\tnode, err := l.Search(func(v interface{}) bool {\n\t\treturn v.(Keyer).Key() == sk\n\t})\n\tif err != nil {\n\t\t//fmt.Println(\"Insert\")\n\t\tl.Push(v)\n\t} else {\n\t\t//fmt.Println(\"Insert-Update\")\n\t\tnode.value = v\n\t}\n}", "title": "" }, { "docid": "b5a5166d6db4e1d4a59420f89084f340", "score": "0.50990415", "text": "func (t *Task) Insert() error {\n\treturn db.Insert(Collection, t)\n}", "title": "" }, { "docid": "7437739bd6011aa5e93abb53dafd76c9", "score": "0.5085796", "text": "func (s *Server) Insert(k string, p *Plugin) {\n\ts.mu.Lock()\n\ts.m[k] = p\n\ts.mu.Unlock()\n}", "title": "" }, { "docid": "94c092e9cc45f5a61acacb8244cf6704", "score": "0.50843346", "text": "func (pWC *WhereClause) Insert(p *Expr, wtFlags byte) (idx int) {\n\tpWC.Terms = append(pWC.Terms, &WhereTerm{ pExpr: p, wtFlags: wtFlags, pWC: pWC, iParent: -1 })\n\treturn idx\n}", "title": "" }, { "docid": "7dc7fce1274794998f98835a5dcdf8e2", "score": "0.50795454", "text": "func (bq *BigQuery) Insert(dataSchema *schema.Table, fact events.Fact) (err error) {\n\tdbSchema, err := bq.tableHelper.EnsureTable(bq.Name(), dataSchema)\n\tif err != nil {\n\t\treturn err\n\t}\n\n\tif err := bq.schemaProcessor.ApplyDBTypingToObject(dbSchema, fact); err != nil {\n\t\treturn err\n\t}\n\n\treturn bq.bqAdapter.Insert(dataSchema, fact)\n}", "title": "" }, { "docid": "84083f8639f2741c2a417db073b12e35", "score": "0.507848", "text": "func (user *User) AddFavoriteTopic(topic string) error {\n\tif user.containsFavoriteTopic(topic) {\n\t\treturn fmt.Errorf(\"AddFavoriteTopic not possible, %s is already a favorite topic\", topic)\n\t}\n\n\terr := Store().clUsers.Update(\n\t\tbson.M{\"_id\": user.ID},\n\t\tbson.M{\"$push\": bson.M{\"favoritesTopics\": topic}})\n\tif err != nil {\n\t\treturn err\n\t}\n\treturn nil\n}", "title": "" }, { "docid": "0f3939e75a9ace80b34a5b9539ef6f6e", "score": "0.5075252", "text": "func (c *s3Client) Insert(ctx context.Context, table string, key string, values map[string][]byte) error {\n\tvar bucket string\n\tif c.p.randomKey {\n\t\tkey = key + strconv.FormatInt(time.Now().UnixNano(), 10)\n\t}\n\tif c.p.randomBucket {\n\t\tpre := string(BucketPrefix[rand.Int()%len(BucketPrefix)])\n\t\tbucket = pre + c.p.bucket\n\t} else {\n\t\tbucket = c.p.bucket\n\t}\n\n\tstate := ctx.Value(stateKey).(*s3State)\n\tclient := state.c\n\tinput := &s3.PutObjectInput{\n\t\tBucket: aws.String(bucket),\n\t\tKey: aws.String(key),\n\t\tStorageClass: aws.String(c.p.storageClass),\n\t\tBody: bytes.NewReader(state.d),\n\t}\n\t_, err := client.PutObject(input)\n\tif err != nil {\n\t\treturn err\n\t}\n\treturn nil\n}", "title": "" }, { "docid": "02184d568de55bd4d956beeb7bbd32c3", "score": "0.5070914", "text": "func (s *LocalStorage) Insert(prefix []byte, kv KVPair) error {\n\ttxn := s.db.NewTransaction(true)\n\tdefer txn.Discard()\n\n\tkey := concatSlices(prefix, kv.Key)\n\n\t_, err := txn.Get(key)\n\tif err != badger.ErrKeyNotFound {\n\t\treturn ErrAlreadyExists\n\t}\n\n\terr = txn.Set(key, kv.Val)\n\tif err != nil {\n\t\treturn err\n\t}\n\treturn txn.Commit()\n}", "title": "" }, { "docid": "38d814df7d3b1fe481687feb79b16aeb", "score": "0.5063709", "text": "func (this *Trie) Insert(word string) {\n \n}", "title": "" }, { "docid": "38d814df7d3b1fe481687feb79b16aeb", "score": "0.5063709", "text": "func (this *Trie) Insert(word string) {\n \n}", "title": "" }, { "docid": "ea018b440b4ff3a754ba9b7f1c9a4258", "score": "0.5060651", "text": "func (obj *DB) Insert(table string, key interface{}, val []byte) error {\n\terr := obj.base.Update(func(tx *bolt.Tx) error {\n\t\tb, err := tx.CreateBucketIfNotExists([]byte(table))\n\t\tif err != nil {\n\t\t\treturn fmt.Errorf(\"create table: %s\", err)\n\t\t}\n\t\terr = b.Put(Assert(key), val)\n\t\tif err != nil {\n\t\t\treturn fmt.Errorf(\"insert key: %s\", err)\n\t\t}\n\t\treturn nil\n\t})\n\treturn err\n}", "title": "" }, { "docid": "8d005c24d62e8d1f7e2d426ca0144d8d", "score": "0.5052331", "text": "func (h *handler) Insert(c echo.Context) error {\n\tresp, err := h.Usecase.Insert(c)\n\tif err != nil {\n\t\treturn c.JSON(errors.RespondError(err))\n\t}\n\n\treturn c.JSON(http.StatusOK, resp)\n}", "title": "" }, { "docid": "9e629fc4c160d1bc485f47b72636b56a", "score": "0.50499874", "text": "func (r *MembersService) Insert(groupKey string, member *Member) *MembersInsertCall {\n\tc := &MembersInsertCall{s: r.s, urlParams_: make(gensupport.URLParams)}\n\tc.groupKey = groupKey\n\tc.member = member\n\treturn c\n}", "title": "" } ]
dd43132b227bb7269518a75272fe025d
GetEncSecretName returns the name of the secret NOTE: The user can just inform the name and namespace of the Secret which is already applied in the cluster OR the data required for the operator be able to create one in the same namespace where the backup is applied
[ { "docid": "75843676bef11e669502028cb520746c", "score": "0.7429176", "text": "func GetEncSecretName(bkp *v1alpha1.Backup) string {\n\tif IsEncKeySetupByName(bkp) {\n\t\treturn bkp.Spec.EncryptKeySecretName\n\t}\n\treturn EncSecretPrefix + bkp.Name\n}", "title": "" } ]
[ { "docid": "854ab1a2964b785adfb435fb0c452075", "score": "0.6771569", "text": "func GetEncSecretNamespace(bkp *v1alpha1.Backup) string {\n\tif IsEncKeySetupByNameAndNamespace(bkp) {\n\t\treturn bkp.Spec.EncryptKeySecretNamespace\n\t}\n\treturn bkp.Namespace\n}", "title": "" }, { "docid": "8c61befdcc8987f8b128571b2b767207", "score": "0.65508604", "text": "func (o DatadogAgentSpecClusterChecksRunnerConfigVolumesAzureFileOutput) SecretName() pulumi.StringOutput {\n\treturn o.ApplyT(func(v DatadogAgentSpecClusterChecksRunnerConfigVolumesAzureFile) string { return v.SecretName }).(pulumi.StringOutput)\n}", "title": "" }, { "docid": "606a43cc5c3d62128e61b37d1c18a477", "score": "0.6544394", "text": "func (o ClusterIssuerSpecCaOutput) SecretName() pulumi.StringOutput {\n\treturn o.ApplyT(func(v ClusterIssuerSpecCa) string { return v.SecretName }).(pulumi.StringOutput)\n}", "title": "" }, { "docid": "0dbeaebdcc9318a50fb14700a04e365d", "score": "0.6542751", "text": "func (o DatadogAgentSpecClusterChecksRunnerConfigVolumesSecretOutput) SecretName() pulumi.StringPtrOutput {\n\treturn o.ApplyT(func(v DatadogAgentSpecClusterChecksRunnerConfigVolumesSecret) *string { return v.SecretName }).(pulumi.StringPtrOutput)\n}", "title": "" }, { "docid": "0f4da77df642d7de89186ed6dabcef73", "score": "0.6501805", "text": "func (o CertificateSpecOutput) SecretName() pulumi.StringOutput {\n\treturn o.ApplyT(func(v CertificateSpec) string { return v.SecretName }).(pulumi.StringOutput)\n}", "title": "" }, { "docid": "aebdafb2c9b401a8405e9ef8563e56c2", "score": "0.6472779", "text": "func (o DatadogAgentSpecClusterAgentConfigVolumesSecretOutput) SecretName() pulumi.StringPtrOutput {\n\treturn o.ApplyT(func(v DatadogAgentSpecClusterAgentConfigVolumesSecret) *string { return v.SecretName }).(pulumi.StringPtrOutput)\n}", "title": "" }, { "docid": "7af6ba0e21d4760c6a540efee30af8b8", "score": "0.6465889", "text": "func (o IssuerSpecCaOutput) SecretName() pulumi.StringOutput {\n\treturn o.ApplyT(func(v IssuerSpecCa) string { return v.SecretName }).(pulumi.StringOutput)\n}", "title": "" }, { "docid": "97c5e9c37fe51d065d19cbd8a8a498c8", "score": "0.64507383", "text": "func (o DatadogAgentSpecClusterAgentConfigVolumesAzureFileOutput) SecretName() pulumi.StringOutput {\n\treturn o.ApplyT(func(v DatadogAgentSpecClusterAgentConfigVolumesAzureFile) string { return v.SecretName }).(pulumi.StringOutput)\n}", "title": "" }, { "docid": "fc271d9657880a2da72200bba738614c", "score": "0.6426502", "text": "func (o IngressTLSOutput) SecretName() pulumi.StringPtrOutput {\n\treturn o.ApplyT(func(v IngressTLS) *string { return v.SecretName }).(pulumi.StringPtrOutput)\n}", "title": "" }, { "docid": "1889c3b57fba39358b074a6427abc804", "score": "0.6424357", "text": "func (o DatadogAgentSpecCredentialsAppSecretOutput) SecretName() pulumi.StringOutput {\n\treturn o.ApplyT(func(v DatadogAgentSpecCredentialsAppSecret) string { return v.SecretName }).(pulumi.StringOutput)\n}", "title": "" }, { "docid": "7726239be746ba2dda5a8c4a7dfad76a", "score": "0.64142185", "text": "func (o DatadogAgentSpecAgentConfigVolumesSecretOutput) SecretName() pulumi.StringPtrOutput {\n\treturn o.ApplyT(func(v DatadogAgentSpecAgentConfigVolumesSecret) *string { return v.SecretName }).(pulumi.StringPtrOutput)\n}", "title": "" }, { "docid": "69de81f5012277b2a89bb47065800b08", "score": "0.6406746", "text": "func (o DatadogAgentSpecAgentConfigVolumesAzureFileOutput) SecretName() pulumi.StringOutput {\n\treturn o.ApplyT(func(v DatadogAgentSpecAgentConfigVolumesAzureFile) string { return v.SecretName }).(pulumi.StringOutput)\n}", "title": "" }, { "docid": "ef288e53ace2bf37a7441cb43a2531bb", "score": "0.6387335", "text": "func (o DatadogAgentSpecClusterChecksRunnerConfigVolumesAzureFilePtrOutput) SecretName() pulumi.StringPtrOutput {\n\treturn o.ApplyT(func(v *DatadogAgentSpecClusterChecksRunnerConfigVolumesAzureFile) *string {\n\t\tif v == nil {\n\t\t\treturn nil\n\t\t}\n\t\treturn &v.SecretName\n\t}).(pulumi.StringPtrOutput)\n}", "title": "" }, { "docid": "4ce0e16e64cb43528198830aa0e8c9b9", "score": "0.6364583", "text": "func (o DatadogAgentSpecCredentialsApiSecretOutput) SecretName() pulumi.StringOutput {\n\treturn o.ApplyT(func(v DatadogAgentSpecCredentialsApiSecret) string { return v.SecretName }).(pulumi.StringOutput)\n}", "title": "" }, { "docid": "014ea37d6a3e580e5cdada74c7ad4339", "score": "0.6315988", "text": "func (o DatadogAgentSpecClusterChecksRunnerConfigVolumesSecretPtrOutput) SecretName() pulumi.StringPtrOutput {\n\treturn o.ApplyT(func(v *DatadogAgentSpecClusterChecksRunnerConfigVolumesSecret) *string {\n\t\tif v == nil {\n\t\t\treturn nil\n\t\t}\n\t\treturn v.SecretName\n\t}).(pulumi.StringPtrOutput)\n}", "title": "" }, { "docid": "81f6bb522939f6eab0afe27330e3f21b", "score": "0.6285947", "text": "func (o DatadogAgentSpecClusterAgentConfigVolumesAzureFilePtrOutput) SecretName() pulumi.StringPtrOutput {\n\treturn o.ApplyT(func(v *DatadogAgentSpecClusterAgentConfigVolumesAzureFile) *string {\n\t\tif v == nil {\n\t\t\treturn nil\n\t\t}\n\t\treturn &v.SecretName\n\t}).(pulumi.StringPtrOutput)\n}", "title": "" }, { "docid": "7ec5d5c497b8bfe994feb3578879d819", "score": "0.6274768", "text": "func (b *Builder) secretName() string {\n\treturn fmt.Sprintf(\"%s-creds-secret\", encode(b.flow.Name))\n}", "title": "" }, { "docid": "b3dfe7e71d5849ef76bafec83f500274", "score": "0.6201012", "text": "func (o DatadogAgentSpecAgentConfigVolumesAzureFilePtrOutput) SecretName() pulumi.StringPtrOutput {\n\treturn o.ApplyT(func(v *DatadogAgentSpecAgentConfigVolumesAzureFile) *string {\n\t\tif v == nil {\n\t\t\treturn nil\n\t\t}\n\t\treturn &v.SecretName\n\t}).(pulumi.StringPtrOutput)\n}", "title": "" }, { "docid": "420458534a3444c2fddf71f965da03de", "score": "0.61984", "text": "func (o DatadogAgentSpecClusterAgentConfigVolumesSecretPtrOutput) SecretName() pulumi.StringPtrOutput {\n\treturn o.ApplyT(func(v *DatadogAgentSpecClusterAgentConfigVolumesSecret) *string {\n\t\tif v == nil {\n\t\t\treturn nil\n\t\t}\n\t\treturn v.SecretName\n\t}).(pulumi.StringPtrOutput)\n}", "title": "" }, { "docid": "399bdbfc34f5cde780c322f5b8e5b306", "score": "0.6189693", "text": "func Secretname(s *dag.Secret) string {\n\thash := sha1.Sum(s.Cert())\n\tns := s.Namespace()\n\tname := s.Name()\n\treturn hashname(60, ns, name, fmt.Sprintf(\"%x\", hash[:5]))\n}", "title": "" }, { "docid": "0b522c27312f728984c073f331b56119", "score": "0.6185745", "text": "func GetSecretName(cr *qservv1alpha1.Qserv, containerName constants.ContainerName) string {\n\treturn fmt.Sprintf(\"%s-%s\", GetSecretVolumeName(containerName), cr.Name)\n}", "title": "" }, { "docid": "b09c52b055a1336cf36de881fe2c0cec", "score": "0.61309385", "text": "func (s *Secret) GetName() string { return s.Name }", "title": "" }, { "docid": "983289fa40f4a8b78eb0c52011bebccf", "score": "0.6112162", "text": "func (o DatadogAgentSpecAgentConfigVolumesSecretPtrOutput) SecretName() pulumi.StringPtrOutput {\n\treturn o.ApplyT(func(v *DatadogAgentSpecAgentConfigVolumesSecret) *string {\n\t\tif v == nil {\n\t\t\treturn nil\n\t\t}\n\t\treturn v.SecretName\n\t}).(pulumi.StringPtrOutput)\n}", "title": "" }, { "docid": "6620aa42399bccf4f8135cf5f63941b2", "score": "0.60592794", "text": "func (o DatadogAgentSpecCredentialsAppSecretPtrOutput) SecretName() pulumi.StringPtrOutput {\n\treturn o.ApplyT(func(v *DatadogAgentSpecCredentialsAppSecret) *string {\n\t\tif v == nil {\n\t\t\treturn nil\n\t\t}\n\t\treturn &v.SecretName\n\t}).(pulumi.StringPtrOutput)\n}", "title": "" }, { "docid": "d9b00d00fec0411f14229810c253c62c", "score": "0.60554224", "text": "func (o ClusterIssuerSpecCaPtrOutput) SecretName() pulumi.StringPtrOutput {\n\treturn o.ApplyT(func(v *ClusterIssuerSpecCa) *string {\n\t\tif v == nil {\n\t\t\treturn nil\n\t\t}\n\t\treturn &v.SecretName\n\t}).(pulumi.StringPtrOutput)\n}", "title": "" }, { "docid": "73541b6dea9b30e3c21a8f1092716035", "score": "0.6042477", "text": "func (o GetSecretVersionsResultOutput) SecretName() pulumi.StringOutput {\n\treturn o.ApplyT(func(v GetSecretVersionsResult) string { return v.SecretName }).(pulumi.StringOutput)\n}", "title": "" }, { "docid": "a4526e072f69f4ad17c06c5f4feb01f8", "score": "0.60115397", "text": "func (o IngressTLSPatchOutput) SecretName() pulumi.StringPtrOutput {\n\treturn o.ApplyT(func(v IngressTLSPatch) *string { return v.SecretName }).(pulumi.StringPtrOutput)\n}", "title": "" }, { "docid": "7ecdec0cd415f5f4c2ce1a01b0309919", "score": "0.6005702", "text": "func Secret(name string, namespace string) *corev1.Secret {\n\treturn &corev1.Secret{\n\t\tObjectMeta: metav1.ObjectMeta{\n\t\t\tNamespace: namespace,\n\t\t\tName: name,\n\t\t},\n\t}\n}", "title": "" }, { "docid": "02aa9177f07b12c3b8e1a09299ccab22", "score": "0.600148", "text": "func (o DatadogAgentSpecCredentialsApiSecretPtrOutput) SecretName() pulumi.StringPtrOutput {\n\treturn o.ApplyT(func(v *DatadogAgentSpecCredentialsApiSecret) *string {\n\t\tif v == nil {\n\t\t\treturn nil\n\t\t}\n\t\treturn &v.SecretName\n\t}).(pulumi.StringPtrOutput)\n}", "title": "" }, { "docid": "dfd24236cc7ce419f48db1efa06de448", "score": "0.597908", "text": "func (o ClusterIssuerSpecVenafiCloudApiTokenSecretRefOutput) Name() pulumi.StringOutput {\n\treturn o.ApplyT(func(v ClusterIssuerSpecVenafiCloudApiTokenSecretRef) string { return v.Name }).(pulumi.StringOutput)\n}", "title": "" }, { "docid": "4a170e0d3ae327b2cd996184f60b575e", "score": "0.5970254", "text": "func (o IssuerSpecCaPtrOutput) SecretName() pulumi.StringPtrOutput {\n\treturn o.ApplyT(func(v *IssuerSpecCa) *string {\n\t\tif v == nil {\n\t\t\treturn nil\n\t\t}\n\t\treturn &v.SecretName\n\t}).(pulumi.StringPtrOutput)\n}", "title": "" }, { "docid": "c85959f10d1395d0cf425c0c9725775c", "score": "0.58951443", "text": "func (o CertificateSpecPtrOutput) SecretName() pulumi.StringPtrOutput {\n\treturn o.ApplyT(func(v *CertificateSpec) *string {\n\t\tif v == nil {\n\t\t\treturn nil\n\t\t}\n\t\treturn &v.SecretName\n\t}).(pulumi.StringPtrOutput)\n}", "title": "" }, { "docid": "f711c01b694b95b21f24f68ca02ae8af", "score": "0.5895101", "text": "func (o DatadogAgentSpecCredentialsAppSecretOutput) KeyName() pulumi.StringPtrOutput {\n\treturn o.ApplyT(func(v DatadogAgentSpecCredentialsAppSecret) *string { return v.KeyName }).(pulumi.StringPtrOutput)\n}", "title": "" }, { "docid": "3880babb75ac1280352c627f873c0a94", "score": "0.5870854", "text": "func GetSecretVolumeName(containerName constants.ContainerName) string {\n\treturn fmt.Sprintf(\"secret-%s\", containerName)\n}", "title": "" }, { "docid": "1538e8da9d342875a917cea177a2d806", "score": "0.5867176", "text": "func (o ClusterIssuerSpecVaultAuthKubernetesSecretRefOutput) Name() pulumi.StringOutput {\n\treturn o.ApplyT(func(v ClusterIssuerSpecVaultAuthKubernetesSecretRef) string { return v.Name }).(pulumi.StringOutput)\n}", "title": "" }, { "docid": "5414f686cf2f9720195ea445de8df833", "score": "0.5844827", "text": "func (o ClusterIssuerSpecAcmeSolversDns01Rfc2136TsigSecretSecretRefOutput) Name() pulumi.StringOutput {\n\treturn o.ApplyT(func(v ClusterIssuerSpecAcmeSolversDns01Rfc2136TsigSecretSecretRef) string { return v.Name }).(pulumi.StringOutput)\n}", "title": "" }, { "docid": "ce8d07b7173af46b9d3ab733331926bb", "score": "0.5817226", "text": "func KfInjectedEnvSecretName(app *v1alpha1.App) string {\n\treturn fmt.Sprintf(\"kf-injected-envs-%s\", app.Name)\n}", "title": "" }, { "docid": "833179418e7e695cf25e80ed51267d38", "score": "0.5813622", "text": "func ConfigSecret(clusterName string) string {\n\treturn clusterName\n}", "title": "" }, { "docid": "457a07c6acab3b0577f1efa7e2bd8376", "score": "0.5781204", "text": "func (s *Secret) GetKeyName() string {\n\treturn fmt.Sprintf(\"dev-secret-%s\", filepath.Base(s.RemotePath))\n}", "title": "" }, { "docid": "e5adb67b00fb6894dff02d244cfc0351", "score": "0.57761335", "text": "func (t *AzureCloudProviderSecret) Name() string {\n\treturn \"AzureCloudProviderSecret\"\n}", "title": "" }, { "docid": "3bfa75cec18eeadb0efab6fb492cc306", "score": "0.5759691", "text": "func Secret(name string, description string) string {\n\treturn DefaultEnv.Secret(name, description)\n}", "title": "" }, { "docid": "813bd314dea04f3afbb613ce17ad7a74", "score": "0.57596", "text": "func secretRef(name string) (kubeSecretName, key string) {\n\treturn \"kelda-\" + fmt.Sprintf(\"%x\", sha1.Sum([]byte(name))), \"value\"\n}", "title": "" }, { "docid": "f2af5c45f2d455257cd17d69da90c13f", "score": "0.5740072", "text": "func toSecretResourceName(name, pluginNamespace string) string {\n\tif name == \"\" {\n\t\treturn \"\"\n\t}\n\t// Convert user provided secret name to secret resource name.\n\trn := credentials.ToResourceName(name)\n\t// Parse the secret resource name.\n\tsr, err := credentials.ParseResourceName(rn, pluginNamespace, \"\", \"\")\n\tif err != nil {\n\t\tlog.Debugf(\"Failed to parse wasm secret resource name %v\", err)\n\t\treturn \"\"\n\t}\n\t// Forcely rewrite secret namespace to plugin namespace, since we require secret resource\n\t// referenced by WasmPlugin co-located with WasmPlugin in the same namespace.\n\tsr.Namespace = pluginNamespace\n\treturn sr.KubernetesResourceName()\n}", "title": "" }, { "docid": "4bd38553af2ee183eca1559730617473", "score": "0.5725207", "text": "func EncryptionLabel(namespace, name string, scope SealingScope) []byte {\n\tvar l string\n\tswitch scope {\n\tcase ClusterWideScope:\n\t\tl = \"\"\n\tcase NamespaceWideScope:\n\t\tl = namespace\n\tcase StrictScope:\n\t\tfallthrough\n\tdefault:\n\t\tl = fmt.Sprintf(\"%s/%s\", namespace, name)\n\t}\n\treturn []byte(l)\n}", "title": "" }, { "docid": "c6964bd23f319f0f86fc2bcd7ac19959", "score": "0.5708641", "text": "func (o ClusterIssuerSpecAcmePrivateKeySecretRefOutput) Name() pulumi.StringOutput {\n\treturn o.ApplyT(func(v ClusterIssuerSpecAcmePrivateKeySecretRef) string { return v.Name }).(pulumi.StringOutput)\n}", "title": "" }, { "docid": "bf58c064938c9ad78ff751099b4ecf10", "score": "0.5701895", "text": "func (o ClusterIssuerSpecAcmeExternalAccountBindingKeySecretRefOutput) Name() pulumi.StringOutput {\n\treturn o.ApplyT(func(v ClusterIssuerSpecAcmeExternalAccountBindingKeySecretRef) string { return v.Name }).(pulumi.StringOutput)\n}", "title": "" }, { "docid": "ff27446cd71dfc59d61d9406cfc19026", "score": "0.56894004", "text": "func (specConfig *SpecConfig) getOperatorSecret() *horizoncomponents.Secret {\n\t// create a secret\n\tsynopsysOperatorSecret := horizoncomponents.NewSecret(horizonapi.SecretConfig{\n\t\tAPIVersion: \"v1\",\n\t\tName: \"blackduck-secret\",\n\t\tNamespace: specConfig.Namespace,\n\t\tType: horizonapi.SecretTypeOpaque,\n\t})\n\tsynopsysOperatorSecret.AddData(map[string][]byte{\n\t\t\"SEAL_KEY\": []byte(specConfig.SealKey),\n\t})\n\n\tsynopsysOperatorSecret.AddLabels(map[string]string{\"app\": \"synopsys-operator\", \"component\": \"operator\"})\n\treturn synopsysOperatorSecret\n}", "title": "" }, { "docid": "e0b25ecf1fb6aca0ed7290a8651c4712", "score": "0.56883025", "text": "func (o ClusterIssuerSpecAcmeSolversDns01CloudDNSServiceAccountSecretRefOutput) Name() pulumi.StringOutput {\n\treturn o.ApplyT(func(v ClusterIssuerSpecAcmeSolversDns01CloudDNSServiceAccountSecretRef) string { return v.Name }).(pulumi.StringOutput)\n}", "title": "" }, { "docid": "a2301be39ce1e017bf252f12091047fb", "score": "0.56740785", "text": "func secretName(brokerName string) string {\n\treturn fmt.Sprintf(\"%s-broker-rabbit\", brokerName)\n}", "title": "" }, { "docid": "8beec81a4b036228677c699b6f09e437", "score": "0.56556976", "text": "func (o ClusterIssuerSpecAcmeSolversDns01Route53SecretAccessKeySecretRefOutput) Name() pulumi.StringOutput {\n\treturn o.ApplyT(func(v ClusterIssuerSpecAcmeSolversDns01Route53SecretAccessKeySecretRef) string { return v.Name }).(pulumi.StringOutput)\n}", "title": "" }, { "docid": "d3cca1aea0578ae50d6a4128bfc3d1a4", "score": "0.56541145", "text": "func (o IssuerSpecVenafiCloudApiTokenSecretRefOutput) Name() pulumi.StringOutput {\n\treturn o.ApplyT(func(v IssuerSpecVenafiCloudApiTokenSecretRef) string { return v.Name }).(pulumi.StringOutput)\n}", "title": "" }, { "docid": "cebdf2898aad4c4768ee3523cafe2458", "score": "0.5629655", "text": "func (o ClusterIssuerSpecVaultAuthAppRoleSecretRefOutput) Name() pulumi.StringOutput {\n\treturn o.ApplyT(func(v ClusterIssuerSpecVaultAuthAppRoleSecretRef) string { return v.Name }).(pulumi.StringOutput)\n}", "title": "" }, { "docid": "d56c0082b8f244367ae328632bc82ff7", "score": "0.5623548", "text": "func (o IssuerSpecVaultAuthKubernetesSecretRefOutput) Name() pulumi.StringOutput {\n\treturn o.ApplyT(func(v IssuerSpecVaultAuthKubernetesSecretRef) string { return v.Name }).(pulumi.StringOutput)\n}", "title": "" }, { "docid": "b6f8c4838364b01937aba2cd9cf62e92", "score": "0.5614911", "text": "func (o DatadogAgentSpecCredentialsAppSecretPtrOutput) KeyName() pulumi.StringPtrOutput {\n\treturn o.ApplyT(func(v *DatadogAgentSpecCredentialsAppSecret) *string {\n\t\tif v == nil {\n\t\t\treturn nil\n\t\t}\n\t\treturn v.KeyName\n\t}).(pulumi.StringPtrOutput)\n}", "title": "" }, { "docid": "fc8cdf5cbf97b3c5a263b89769c5af0f", "score": "0.56135005", "text": "func GetVersionedSecretName(versionedSecretIdentifier string, version string) string {\n\treturn fmt.Sprintf(versionedSecretNameTemplateStr, versionedSecretIdentifier, version)\n}", "title": "" }, { "docid": "abd4e89d34e524862f1ed6a882f2d3d5", "score": "0.5610643", "text": "func (o ClusterIssuerSpecAcmeSolversDns01AzureDNSClientSecretSecretRefOutput) Name() pulumi.StringOutput {\n\treturn o.ApplyT(func(v ClusterIssuerSpecAcmeSolversDns01AzureDNSClientSecretSecretRef) string { return v.Name }).(pulumi.StringOutput)\n}", "title": "" }, { "docid": "7fc63804fa0a923c217371e4ed8c7e11", "score": "0.56011206", "text": "func (o DatadogAgentSpecCredentialsApiSecretOutput) KeyName() pulumi.StringPtrOutput {\n\treturn o.ApplyT(func(v DatadogAgentSpecCredentialsApiSecret) *string { return v.KeyName }).(pulumi.StringPtrOutput)\n}", "title": "" }, { "docid": "ffa17bfa977d904cd6242d725d06d878", "score": "0.5581768", "text": "func SecretNameFunc() function.Function {\n\treturn function.New(&function.Spec{\n\t\tParams: []function.Parameter{\n\t\t\t{\n\t\t\t\tName: \"name\",\n\t\t\t\tType: cty.String,\n\t\t\t},\n\t\t},\n\n\t\tType: function.StaticReturnType(k8s.ObjectReferenceCty),\n\t\tImpl: secretNameFuncImpl,\n\t})\n}", "title": "" }, { "docid": "229f11a0752bb1ce5c029bb621d66c7a", "score": "0.5576702", "text": "func secretKey(tls v1alpha1.IngressTLS) string {\n\treturn fmt.Sprintf(\"%s/%s\", tls.SecretNamespace, tls.SecretName)\n}", "title": "" }, { "docid": "820975aaf235ee7a86e8961ce8bef3d9", "score": "0.5572445", "text": "func GetBackupCredentialsSecretName(jenkins *virtuslabv1alpha1.Jenkins) string {\n\treturn fmt.Sprintf(\"%s-backup-credentials-%s\", constants.OperatorName, jenkins.Name)\n}", "title": "" }, { "docid": "49e0b1cdb26fa5c06f2d1f343e44d9b6", "score": "0.55640554", "text": "func (o SecretV2Output) Name() pulumi.StringOutput {\n\treturn o.ApplyT(func(v *SecretV2) pulumi.StringOutput { return v.Name }).(pulumi.StringOutput)\n}", "title": "" }, { "docid": "ac921cf56a389fefa94e4537628cfbfc", "score": "0.55520874", "text": "func (o ClusterIssuerSpecAcmeSolversDns01Rfc2136TsigSecretSecretRefPtrOutput) Name() pulumi.StringPtrOutput {\n\treturn o.ApplyT(func(v *ClusterIssuerSpecAcmeSolversDns01Rfc2136TsigSecretSecretRef) *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": "5fb96b89ee7a54e588456b9387488d22", "score": "0.5548254", "text": "func FrameCredSecretName(dataExportName, blName string) string {\n\treturn dataExportName + \"-\" + blName\n}", "title": "" }, { "docid": "594c36c9ed8acaf4e1c9653db30a17bb", "score": "0.5547868", "text": "func (o ClusterIssuerSpecAcmeSolversDns01AkamaiClientTokenSecretRefOutput) Name() pulumi.StringOutput {\n\treturn o.ApplyT(func(v ClusterIssuerSpecAcmeSolversDns01AkamaiClientTokenSecretRef) string { return v.Name }).(pulumi.StringOutput)\n}", "title": "" }, { "docid": "7431d7f6b9c502a25cf0a6803e9483e0", "score": "0.5543049", "text": "func (o CertificateSpecKeystoresJksPasswordSecretRefOutput) Name() pulumi.StringOutput {\n\treturn o.ApplyT(func(v CertificateSpecKeystoresJksPasswordSecretRef) string { return v.Name }).(pulumi.StringOutput)\n}", "title": "" }, { "docid": "e016408ca4ac99f1400937cf524acc7e", "score": "0.5540029", "text": "func (s k8sStore) GetSecret(name, namespace string) (*v1.Secret, error) {\n\treturn s.listers.Secret.GetWithKey(getStoreKey(name, namespace))\n}", "title": "" }, { "docid": "0e5735b9776874a10e2e651594a4c9fa", "score": "0.55352235", "text": "func (self *secretSynchronizer) Name() string {\n\treturn fmt.Sprintf(\"%s-%s\", self.name, self.namespace)\n}", "title": "" }, { "docid": "0e5735b9776874a10e2e651594a4c9fa", "score": "0.55352235", "text": "func (self *secretSynchronizer) Name() string {\n\treturn fmt.Sprintf(\"%s-%s\", self.name, self.namespace)\n}", "title": "" }, { "docid": "3c12de82b013a8afbf7a4abc6d6c0c81", "score": "0.553368", "text": "func (o ClusterIssuerSpecAcmeSolversDns01AkamaiClientSecretSecretRefOutput) Name() pulumi.StringOutput {\n\treturn o.ApplyT(func(v ClusterIssuerSpecAcmeSolversDns01AkamaiClientSecretSecretRef) string { return v.Name }).(pulumi.StringOutput)\n}", "title": "" }, { "docid": "3d7d215ec309c8190f0a0bd7b5a56339", "score": "0.5513162", "text": "func GetAWSSecretName(bkp *v1alpha1.Backup) string {\n\tif IsAwsKeySetupByName(bkp) {\n\t\treturn bkp.Spec.AwsSecretName\n\t}\n\treturn AwsSecretPrefix + bkp.Name\n}", "title": "" }, { "docid": "43e9079f532da8af9ffcfe81ce108293", "score": "0.55075693", "text": "func (o CertificateSpecKeystoresPkcs12PasswordSecretRefOutput) Name() pulumi.StringOutput {\n\treturn o.ApplyT(func(v CertificateSpecKeystoresPkcs12PasswordSecretRef) string { return v.Name }).(pulumi.StringOutput)\n}", "title": "" }, { "docid": "87b06faa2428e621db5b76019ff0e1a3", "score": "0.54988414", "text": "func (m MongoDBCommunity) TLSOperatorSecretNamespacedName() types.NamespacedName {\n\treturn types.NamespacedName{Name: m.Name + \"-server-certificate-key\", Namespace: m.Namespace}\n}", "title": "" }, { "docid": "f5106dc81b1c4e4100685fbad7ead4a0", "score": "0.5498009", "text": "func NewSecretName(name string) string {\n\treturn fmt.Sprint(path.Join(SecretPrefix(), projectName, name, utility.RandomString()))\n}", "title": "" }, { "docid": "f0f6c5c8f77bce60fca20ae313f3580f", "score": "0.5475189", "text": "func (o ClusterIssuerSpecAcmeSolversDns01DigitaloceanTokenSecretRefOutput) Name() pulumi.StringOutput {\n\treturn o.ApplyT(func(v ClusterIssuerSpecAcmeSolversDns01DigitaloceanTokenSecretRef) string { return v.Name }).(pulumi.StringOutput)\n}", "title": "" }, { "docid": "61ab999f15289d5e368fa20f0e4ff7f1", "score": "0.54734844", "text": "func GetKeyVaultName(instance runtime.Object) string {\n\tkeyVaultName := \"\"\n\ttarget := &v1alpha1.GenericResource{}\n\tserial, err := json.Marshal(instance)\n\tif err != nil {\n\t\treturn keyVaultName\n\t}\n\t_ = json.Unmarshal(serial, target)\n\treturn target.Spec.KeyVaultToStoreSecrets\n}", "title": "" }, { "docid": "830bbc4325c2fa5d5b843b08d0e67a8c", "score": "0.54526794", "text": "func (o ClusterIssuerSpecAcmeSolversDns01CloudflareApiTokenSecretRefOutput) Name() pulumi.StringOutput {\n\treturn o.ApplyT(func(v ClusterIssuerSpecAcmeSolversDns01CloudflareApiTokenSecretRef) string { return v.Name }).(pulumi.StringOutput)\n}", "title": "" }, { "docid": "f9aa1541b8253ea67de3234dd5260ea5", "score": "0.54505914", "text": "func (o DatadogAgentSpecClusterAgentConfigVolumesCephfsSecretRefOutput) Name() pulumi.StringPtrOutput {\n\treturn o.ApplyT(func(v DatadogAgentSpecClusterAgentConfigVolumesCephfsSecretRef) *string { return v.Name }).(pulumi.StringPtrOutput)\n}", "title": "" }, { "docid": "dde11fa14a3a1ff2dcf8221b0cf70775", "score": "0.5442696", "text": "func (o IssuerSpecAcmePrivateKeySecretRefOutput) Name() pulumi.StringOutput {\n\treturn o.ApplyT(func(v IssuerSpecAcmePrivateKeySecretRef) string { return v.Name }).(pulumi.StringOutput)\n}", "title": "" }, { "docid": "44af5cb181e3dffbbcac93e73e7be871", "score": "0.5440478", "text": "func (cs *ContainerSecret) Name() string {\n\treturn fmt.Sprintf(\"%s_%s\", cs.containerName, aws.StringValue(cs.secret.Name))\n}", "title": "" }, { "docid": "aabc94d58f94f7847597a09bd1654a37", "score": "0.5435312", "text": "func (o DatadogAgentSpecClusterChecksRunnerConfigVolumesCephfsSecretRefOutput) Name() pulumi.StringPtrOutput {\n\treturn o.ApplyT(func(v DatadogAgentSpecClusterChecksRunnerConfigVolumesCephfsSecretRef) *string { return v.Name }).(pulumi.StringPtrOutput)\n}", "title": "" }, { "docid": "90ed11cf5adef2ac85dcb91152f9edb9", "score": "0.54333246", "text": "func (o DatadogAgentSpecAgentConfigVolumesCephfsSecretRefOutput) Name() pulumi.StringPtrOutput {\n\treturn o.ApplyT(func(v DatadogAgentSpecAgentConfigVolumesCephfsSecretRef) *string { return v.Name }).(pulumi.StringPtrOutput)\n}", "title": "" }, { "docid": "d11d61f438b87913c0d85fff31db1208", "score": "0.5429508", "text": "func (o ClusterIssuerSpecVaultAuthTokenSecretRefOutput) Name() pulumi.StringOutput {\n\treturn o.ApplyT(func(v ClusterIssuerSpecVaultAuthTokenSecretRef) string { return v.Name }).(pulumi.StringOutput)\n}", "title": "" }, { "docid": "4f38f3410c59e54fb5575da74420d13f", "score": "0.54216635", "text": "func (o ClusterIssuerSpecAcmeSolversDns01Route53SecretAccessKeySecretRefPtrOutput) Name() pulumi.StringPtrOutput {\n\treturn o.ApplyT(func(v *ClusterIssuerSpecAcmeSolversDns01Route53SecretAccessKeySecretRef) *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": "ac891ffb46e8e569bfa22f3dc3b09219", "score": "0.54157495", "text": "func SecretPrefix() string {\n\treturn os.Getenv(\"AWS_SECRET_PREFIX\")\n}", "title": "" }, { "docid": "90ce975254b8f357307377d4e4afc712", "score": "0.54123443", "text": "func GetNamespaceScopedSecretName(namespace string) string {\n\treturn fmt.Sprintf(namespaceScopedSecretNameTemplateStr, namespace)\n}", "title": "" }, { "docid": "d174bba20acf18ffffe296d2fdc95f14", "score": "0.5409065", "text": "func (o IssuerSpecAcmeExternalAccountBindingKeySecretRefOutput) Name() pulumi.StringOutput {\n\treturn o.ApplyT(func(v IssuerSpecAcmeExternalAccountBindingKeySecretRef) string { return v.Name }).(pulumi.StringOutput)\n}", "title": "" }, { "docid": "1239aaaa06fa623967b06ee79e57fca1", "score": "0.5383133", "text": "func (o DatadogAgentSpecClusterAgentConfigVolumesRbdSecretRefOutput) Name() pulumi.StringPtrOutput {\n\treturn o.ApplyT(func(v DatadogAgentSpecClusterAgentConfigVolumesRbdSecretRef) *string { return v.Name }).(pulumi.StringPtrOutput)\n}", "title": "" }, { "docid": "b0213555df70b9cc38fee3c962630872", "score": "0.53818065", "text": "func (o ClusterIssuerSpecVenafiCloudApiTokenSecretRefPtrOutput) Name() pulumi.StringPtrOutput {\n\treturn o.ApplyT(func(v *ClusterIssuerSpecVenafiCloudApiTokenSecretRef) *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": "3675b7b2254696c2ae62e9afd0d8d63b", "score": "0.53779763", "text": "func ResourceSecretName(r *metagraf.Resource) string {\n\tif len(r.User) > 0 && len(r.Secret) == 0 {\n\t\t// When an implicit secret is created it's resource name will\n\t\t// prepended to the user. They resourcename + user will get treated as a global secret.\n\t\treturn strings.ToLower(strings.Replace(r.Name, \"_\", \"-\", -1)) + \"-\" + strings.ToLower(r.User)\n\t} else if len(r.User) == 0 && len(r.Secret) > 0 {\n\t\t// Explicit secret name generation\n\t\treturn strings.ToLower(r.Secret)\n\t} else {\n\t\treturn strings.ToLower(r.Name)\n\t}\n}", "title": "" }, { "docid": "65ae71fdc50eaa56c4da397e0a88a992", "score": "0.53659695", "text": "func (o ClusterIssuerSpecAcmeSolversDns01CloudflareApiKeySecretRefOutput) Name() pulumi.StringOutput {\n\treturn o.ApplyT(func(v ClusterIssuerSpecAcmeSolversDns01CloudflareApiKeySecretRef) string { return v.Name }).(pulumi.StringOutput)\n}", "title": "" }, { "docid": "082a79dde70e7307740f41fc433cca3b", "score": "0.5364153", "text": "func (s *Backend) Get(key string, version string) (string, error) {\n\t_ = version\n\n\tinput := &secretsmanager.GetSecretValueInput{\n\t\tSecretId: aws.String(key),\n\t}\n\terr := input.Validate()\n\tif err != nil {\n\t\treturn \"\", err\n\t}\n\n\tif s.SecretsManager == nil {\n\t\tlog.Error(fmt.Errorf(\"error\"), \"backend not initialized\")\n\t\treturn \"\", fmt.Errorf(\"backend not initialized\")\n\t}\n\n\tresult, err := s.SecretsManager.GetSecretValue(input)\n\tif err != nil {\n\t\tlog.Error(err, \"Error getting secret value\")\n\t\treturn \"\", err\n\t}\n\n\t// https: //docs.aws.amazon.com/secretsmanager/latest/apireference/API_CreateSecret.html\n\t// TLDR: Either SecretString or SecretBinary must have a value, but not both. They cannot both be empty.\n\tvar secretValue string\n\tif result.SecretString != nil {\n\t\tsecretValue = *result.SecretString\n\t} else {\n\t\tdecodedBinarySecretBytes := make([]byte, base64.StdEncoding.DecodedLen(len(result.SecretBinary)))\n\t\tlen, err := base64.StdEncoding.Decode(decodedBinarySecretBytes, result.SecretBinary)\n\t\tif err != nil {\n\t\t\tlog.Error(err, \"Base64 Decode Error:\")\n\t\t\treturn \"\", err\n\t\t}\n\t\tsecretValue = string(decodedBinarySecretBytes[:len])\n\t}\n\treturn secretValue, nil\n}", "title": "" }, { "docid": "865de8014cb3b3e770b95c789c4006c3", "score": "0.5361539", "text": "func (o DatadogAgentSpecCredentialsApiSecretPtrOutput) KeyName() pulumi.StringPtrOutput {\n\treturn o.ApplyT(func(v *DatadogAgentSpecCredentialsApiSecret) *string {\n\t\tif v == nil {\n\t\t\treturn nil\n\t\t}\n\t\treturn v.KeyName\n\t}).(pulumi.StringPtrOutput)\n}", "title": "" }, { "docid": "70d6479c89ed884aaaeffa7681adde63", "score": "0.53590584", "text": "func (o DatadogAgentSpecAgentSecurityEnvValueFromSecretKeyRefOutput) Name() pulumi.StringPtrOutput {\n\treturn o.ApplyT(func(v DatadogAgentSpecAgentSecurityEnvValueFromSecretKeyRef) *string { return v.Name }).(pulumi.StringPtrOutput)\n}", "title": "" }, { "docid": "020cf4b5504ed8af2dfc9f1bf7d65174", "score": "0.5350811", "text": "func (o IssuerSpecAcmeSolversDns01Rfc2136TsigSecretSecretRefOutput) Name() pulumi.StringOutput {\n\treturn o.ApplyT(func(v IssuerSpecAcmeSolversDns01Rfc2136TsigSecretSecretRef) string { return v.Name }).(pulumi.StringOutput)\n}", "title": "" }, { "docid": "c2fb0024c336ec6d410e3408f437b2e2", "score": "0.53435296", "text": "func (o IssuerSpecAcmeSolversDns01AzureDNSClientSecretSecretRefOutput) Name() pulumi.StringOutput {\n\treturn o.ApplyT(func(v IssuerSpecAcmeSolversDns01AzureDNSClientSecretSecretRef) string { return v.Name }).(pulumi.StringOutput)\n}", "title": "" }, { "docid": "ea2bbe6c79820412d8b20b7e00f8a509", "score": "0.5343289", "text": "func (r OCRKeysBundleResource) GetName() string {\n\treturn \"encryptedKeyBundles\"\n}", "title": "" }, { "docid": "e8e8cfa255fdff3876b325a40868e909", "score": "0.53397536", "text": "func GetFromNamespacedName(ctx context.Context, c client.Reader, clusterName client.ObjectKey, purpose Purpose) (*corev1.Secret, error) {\n\tsecret := &corev1.Secret{}\n\tsecretKey := client.ObjectKey{\n\t\tNamespace: clusterName.Namespace,\n\t\tName: Name(clusterName.Name, purpose),\n\t}\n\n\tif err := c.Get(ctx, secretKey, secret); err != nil {\n\t\treturn nil, err\n\t}\n\n\treturn secret, nil\n}", "title": "" }, { "docid": "93a1220c8c45ca1ce5b68a0de13925c5", "score": "0.5335399", "text": "func secretPath(secretName string) string {\n\treturn \"secret/\" + secretName\n}", "title": "" }, { "docid": "05f1c740d1cdfb588f6cb2a8a7949f24", "score": "0.53272915", "text": "func (o IssuerSpecVaultAuthAppRoleSecretRefOutput) Name() pulumi.StringOutput {\n\treturn o.ApplyT(func(v IssuerSpecVaultAuthAppRoleSecretRef) string { return v.Name }).(pulumi.StringOutput)\n}", "title": "" }, { "docid": "e3b2d560861afbec7edf342591b1414c", "score": "0.53234404", "text": "func (o IssuerSpecAcmeSolversDns01CloudDNSServiceAccountSecretRefOutput) Name() pulumi.StringOutput {\n\treturn o.ApplyT(func(v IssuerSpecAcmeSolversDns01CloudDNSServiceAccountSecretRef) string { return v.Name }).(pulumi.StringOutput)\n}", "title": "" } ]
c9735dcd926712dfc257b0dea01f06d3
Bytes returns the byte data that this PatchRecord represents
[ { "docid": "3eb82c1aa49cc80cda3da5e88ce7f2e1", "score": "0.8161832", "text": "func (pr *PatchRecord) Bytes() []byte {\n\tdata := make([]byte, 0)\n\tsize := make([]byte, 2)\n\tbinary.BigEndian.PutUint16(size, pr.size)\n\n\tdata = append(data, pr.offset...)\n\tif pr.isRLE {\n\t\tdata = append(data, []byte{0, 0}...)\n\t}\n\tdata = append(data, size...)\n\tdata = append(data, pr.data...)\n\treturn data\n}", "title": "" } ]
[ { "docid": "6120da6df795696e164a827b1d1f5d68", "score": "0.6920616", "text": "func (p *Packet) Bytes() []byte {\n\treturn p.b\n}", "title": "" }, { "docid": "782bcff9f3953cd4bfe58ba97a103929", "score": "0.6823225", "text": "func (d *Datum) GetBytes() []byte {\n\treturn d.b\n}", "title": "" }, { "docid": "0036b3e224622cdd2dde2c074d08ec7c", "score": "0.6695417", "text": "func (p VerifiableCredentialPacketData) GetBytes() ([]byte) {\n return sdk.MustSortJSON(ModuleCdc.MustMarshalJSON(&p))\n}", "title": "" }, { "docid": "78d60a0fc4413f4af87e16f1e68e7250", "score": "0.66695875", "text": "func (buf *basePacketBuffer) Bytes() []byte {\n\treturn buf.data\n}", "title": "" }, { "docid": "818d7de17f53bbe9df41bf45d1f9c1bb", "score": "0.66576463", "text": "func (b *ByteBuffer) Bytes() []byte { return b.b }", "title": "" }, { "docid": "2765524f42edfd8409b46aa1c5ae5180", "score": "0.66436714", "text": "func (w *fixedWriter) Bytes() []byte {\n\treturn w.b\n}", "title": "" }, { "docid": "2d679fb517836c053db872bd20c7fa88", "score": "0.66168696", "text": "func (p Patch) Bytes() ([]byte, error) {\n\treturn docutil.MarshalCanonical(p)\n}", "title": "" }, { "docid": "70ff3fbc067336a76642ac26cd1ffbf9", "score": "0.66068304", "text": "func (entry *EntryBase) GetDataBytes() []byte {\n\treturn entry.DataBytes\n}", "title": "" }, { "docid": "1d55f03cbcd0974784240d2287745f48", "score": "0.6584722", "text": "func (pk *publicKey448) Bytes() []byte {\n\treturn pk.raw[:]\n}", "title": "" }, { "docid": "c675c032d381c443bdbb6934dac1a31b", "score": "0.6578257", "text": "func (c ConnACKPayload) Bytes() []byte {\n\tb := make([]byte, 1)\n\tb[0] = c.ReturnCode\n\treturn b\n}", "title": "" }, { "docid": "90176014e657918cda82c9460cb6dc0a", "score": "0.65603936", "text": "func (s *Signature) Bytes() []byte {\n\treturn s.raw\n}", "title": "" }, { "docid": "08a4114aaa8cc110d488cc9cc7efcb4a", "score": "0.65266615", "text": "func (pkt *Packet) Bytes() []byte {\n\tb := make([]byte, pkt.Len())\n\tif len(b) > 0 {\n\t\tC.Mbuf_CopyTo(pkt.ptr(), unsafe.Pointer(&b[0]))\n\t}\n\treturn b\n}", "title": "" }, { "docid": "efc9b0b44f43465de7afbf3af87945ec", "score": "0.65066946", "text": "func (this *Buffer) Bytes() []byte { return this.data }", "title": "" }, { "docid": "eef9ecd2d111cef82c00c9a5d29e2c8b", "score": "0.6502836", "text": "func (p PongPayload) Bytes() (b []byte) {\n\tb = make([]byte, 2)\n\tb[0] = byte(p.ID >> 8)\n\tb[1] = byte(p.ID)\n\n\treturn b\n}", "title": "" }, { "docid": "b36d4aa9eaf8cddc4a6d2d216eb7a67c", "score": "0.65026647", "text": "func (pk *privateKey448) Bytes() []byte {\n\treturn pk.raw[:]\n}", "title": "" }, { "docid": "24aeb149b88e52c0621a92892d5f7a29", "score": "0.64684016", "text": "func (p *Point) Bytes() []byte {\n\treturn p.e().Ristretto()\n}", "title": "" }, { "docid": "9fcc2784131ce73079a659ada3fac0ce", "score": "0.64373916", "text": "func (b *memBuffer) bytes() []byte { return b.buf[:b.len] }", "title": "" }, { "docid": "5cb6305373ddcddde67755280e09a55e", "score": "0.6418994", "text": "func (d *Dictionary) GetBytes() []byte {\n\td.write(\"e\")\n\tb := d.buf\n\n\treturn b\n}", "title": "" }, { "docid": "8f4b07a3e44c1d03b40de856403def08", "score": "0.6416928", "text": "func (b Blob) Bytes() []byte {\n\treturn b.data\n}", "title": "" }, { "docid": "7e3f6b8e80c58632ea7779288a3dbd2d", "score": "0.6385464", "text": "func (b *Buffer) Bytes() []byte {\n\treturn b.b\n}", "title": "" }, { "docid": "f8babe212521d91815996c80a69357c7", "score": "0.6360667", "text": "func (vp *cVectorParty) GetBytes() int64 {\n\tvar bytes int64\n\tif vp.values != nil {\n\t\tbytes += int64(vp.values.Bytes)\n\t}\n\n\tif vp.nulls != nil {\n\t\tbytes += int64(vp.nulls.Bytes)\n\t}\n\n\tif vp.counts != nil {\n\t\tbytes += int64(vp.counts.Bytes)\n\t}\n\treturn bytes\n}", "title": "" }, { "docid": "f097f89ca040e8847f7d86298389eae2", "score": "0.63484657", "text": "func (b *Buffer) Bytes() []byte {\n\treturn b.v[b.start:b.end]\n}", "title": "" }, { "docid": "a0c2a080e352a5f6eb06f0a46d5c7db7", "score": "0.6344033", "text": "func (msg MsgReportData) GetSignBytes() []byte {\n\tbz := ModuleCdc.MustMarshalJSON(msg)\n\treturn sdk.MustSortJSON(bz)\n}", "title": "" }, { "docid": "830e0931f1ba1374dc625890f56d2988", "score": "0.63316065", "text": "func (evt *Event) Bytes() []byte {\n\treturn evt.bytes\n}", "title": "" }, { "docid": "a821d6e0a162353995b3aa9cd1a41dc4", "score": "0.633145", "text": "func (signature Signature) Bytes() []byte {\n\treturn signature[:]\n}", "title": "" }, { "docid": "1951268d35a5b08fd9166d9064011c4f", "score": "0.6317345", "text": "func (rw *ReadWriteBuffer) Bytes() []byte {\n\treturn rw.d\n}", "title": "" }, { "docid": "115d43581f6c62bd9bb25cb4c1f43afc", "score": "0.6313696", "text": "func (msg *message) Bytes() []byte { return msg.bytes }", "title": "" }, { "docid": "f556f9c4f39d45a50f3431e9b7de0f08", "score": "0.63135844", "text": "func (m *MessageOpMsg) GetBytes() []byte {\n\treturn m.bytes\n}", "title": "" }, { "docid": "2b26f44a21eef39197bba41214b451ea", "score": "0.6313481", "text": "func (m *TaskFileAttachment) GetContentBytes()([]byte) {\n return m.contentBytes\n}", "title": "" }, { "docid": "107db53780a3655fb636f30bc7550856", "score": "0.63078845", "text": "func (buf *Buffer) Bytes() []byte {\n\treturn buf.b.Bytes()\n}", "title": "" }, { "docid": "008aef576ab717cddedf687ac9bea869", "score": "0.63039607", "text": "func (block ComponentUnpaddedBlock) Bytes() ([]byte, error) {\n\treturn block.Value, nil\n}", "title": "" }, { "docid": "69d7bbb386a68426f5dfdcc3054b9e63", "score": "0.6299936", "text": "func (bz HexBytes) Bytes() []byte {\n\treturn bz\n}", "title": "" }, { "docid": "197dd54a4a1e31ea5e7466292fddfdc1", "score": "0.62980783", "text": "func (b *ByteBuffer) Bytes() []byte {\n\treturn b.B\n}", "title": "" }, { "docid": "623df842f6bc78f50b0a2c436ebb450c", "score": "0.6286939", "text": "func (dc DataChunk) Bytes() []byte {\n\tout := bytes.NewBuffer([]byte{})\n\n\tout.WriteString(dc.ChunkID)\n\n\tbinary.Write(out, binary.LittleEndian, dc.ChunkSize)\n\n\tbinary.Write(out, binary.LittleEndian, dc.WaveData)\n\n\treturn out.Bytes()\n}", "title": "" }, { "docid": "138da9655a5112ce17d165ee63239179", "score": "0.6262634", "text": "func (p SendResponsePayload) Bytes() []byte {\n\tmsgID := make([]byte, 2)\n\tbinary.BigEndian.PutUint16(msgID, p.ID)\n\n\t// Optimize size\n\tb := make([]byte, 0)\n\tb = append(b, msgID...)\n\tb = append(b, p.Data...)\n\n\treturn b\n}", "title": "" }, { "docid": "33a7f03898ce7a833baae44d0983db55", "score": "0.62555736", "text": "func (bb *BytesBuilder) Bytes() []byte {\n\treturn bb.bytes\n}", "title": "" }, { "docid": "90593e63a915eeb1af2af6fcc3575819", "score": "0.6252165", "text": "func (vector *BitVector) Bytes() []byte {\n\treturn vector.data\n}", "title": "" }, { "docid": "58ee285c0badf709a22ab75511951b62", "score": "0.62520003", "text": "func (z *Zip) Bytes() []byte {\n\tret := make([]byte, len(z.raw))\n\tcopy(ret, z.raw)\n\treturn ret\n}", "title": "" }, { "docid": "c1933942dfdff1c4ad8bc4915d104865", "score": "0.62503344", "text": "func (proposal *Proposal) Bytes() ([]byte, error) {\n\treturn proposal.bytes, nil\n}", "title": "" }, { "docid": "404cf67882bf5d805f7dbfdb6e5fbb45", "score": "0.624518", "text": "func (ob *Bytes) GetBytes() []byte {\n\treturn ob.ar\n}", "title": "" }, { "docid": "f834001060cc68e5e65f2a95503c4edf", "score": "0.62423927", "text": "func (p *PacketOut) Bytes() (b []byte) { return Bytes(p) }", "title": "" }, { "docid": "cfae34f968e9ab29c246360820d6625b", "score": "0.62311155", "text": "func (e *Entry) ToBytes() []byte {\n\tvar buff = bytes.NewBuffer(nil)\n\n\tfor _, field := range e.fields {\n\t\tvar fBytes = field.data\n\t\tbuff.Write(fBytes)\n\t\tbuff.Write(SPACE)\n\t}\n\n\treturn buff.Bytes()\n}", "title": "" }, { "docid": "60689f3998479bb7c840c37336b9281e", "score": "0.62305367", "text": "func (p PeerID) Bytes() []byte {\n\treturn p[:]\n}", "title": "" }, { "docid": "e6b79dd89bf252e485491c943ce19ca5", "score": "0.6230053", "text": "func (f *ZB) Bytes() ([]byte, error) {\n\treturn f.buffer.Bytes(), nil\n}", "title": "" }, { "docid": "cff22770cef6b75971de682dda09652f", "score": "0.6227051", "text": "func (id BlockID) Bytes() []byte { return id.AsHash32().Bytes() }", "title": "" }, { "docid": "0c421c5796444e8cb1d505a6c136b99a", "score": "0.6226303", "text": "func (a Address) Bytes() []byte { return a[:] }", "title": "" }, { "docid": "29f05de8178d31480b18b77ec8af902d", "score": "0.6225132", "text": "func (f *FieldWriter) Bytes() ([]byte, int) {\n\treturn f.data, int(f.fieldCount)\n}", "title": "" }, { "docid": "135b1e405b4c206a81169dc20245f99a", "score": "0.6223483", "text": "func (msg MsgCreatePost) GetSignBytes() []byte {\n\tbz := ModuleCdc.MustMarshalJSON(msg)\n\treturn sdk.MustSortJSON(bz)\n}", "title": "" }, { "docid": "70cab39ec73925cacb14a47ba887f4b9", "score": "0.62107825", "text": "func (msg MsgUnjail) GetSignBytes() []byte {\n\treturn sdk.MustSortJSON(msgCdc.MustMarshalJSON(msg))\n}", "title": "" }, { "docid": "bd904b9cbe6435a6fcc182e26c0ad786", "score": "0.620769", "text": "func (packet *Packet) GetBytes() []byte {\n\tpSize := make([]byte, 2)\n\tbinary.LittleEndian.PutUint16(pSize, uint16(len(packet.buffer))) // +2 for packet type\n\n\treturn append(pSize, packet.buffer...)\n}", "title": "" }, { "docid": "71eae5b88d5c5a952d1852227fc48f3f", "score": "0.62076354", "text": "func (m VerifiableCredential) GetBytes() []byte {\n\tdAtA, _ := m.Marshal()\n\treturn dAtA\n}", "title": "" }, { "docid": "2ab694bb4e91dfb5f8abae6175597002", "score": "0.62004966", "text": "func (m *MessageMetadata) Bytes() []byte {\n\treturn byteutils.ConcatBytes(m.ObjectStorageKey(), m.ObjectStorageValue())\n}", "title": "" }, { "docid": "2ab694bb4e91dfb5f8abae6175597002", "score": "0.62004966", "text": "func (m *MessageMetadata) Bytes() []byte {\n\treturn byteutils.ConcatBytes(m.ObjectStorageKey(), m.ObjectStorageValue())\n}", "title": "" }, { "docid": "2ab694bb4e91dfb5f8abae6175597002", "score": "0.62004966", "text": "func (m *MessageMetadata) Bytes() []byte {\n\treturn byteutils.ConcatBytes(m.ObjectStorageKey(), m.ObjectStorageValue())\n}", "title": "" }, { "docid": "aad6bb436339ec6e604e9c57cf02c695", "score": "0.6191218", "text": "func (msg MsgEditDataSource) GetSignBytes() []byte {\n\tbz := ModuleCdc.MustMarshalJSON(msg)\n\treturn sdk.MustSortJSON(bz)\n}", "title": "" }, { "docid": "ae66209a4fbcd6b0aec7dc89b5f77c9e", "score": "0.61873835", "text": "func (msg MsgEditTestCase) GetSignBytes() []byte {\n\treturn sdk.MustSortJSON(ModuleCdc.MustMarshalJSON(&msg))\n\n}", "title": "" }, { "docid": "7a187d0aef998a9457a17788e4fc870a", "score": "0.6186952", "text": "func (msg MsgUpdateDescription) GetSignBytes() []byte {\n\tbz := ModuleCdc.MustMarshalJSON(msg)\n\treturn sdk.MustSortJSON(bz)\n}", "title": "" }, { "docid": "c23abd76c65a3bd933729197fd8c68e1", "score": "0.6182095", "text": "func (b *encbuf) Bytes() []byte { return b.buf[:b.end] }", "title": "" }, { "docid": "1ce5a4b34457e4716ac085c86c7dd76e", "score": "0.6174471", "text": "func (sig Signature) Bytes() []byte {\n\treturn []byte(sig)\n}", "title": "" }, { "docid": "ff1607b76a5afa5643d5d6f77c7cd338", "score": "0.6148858", "text": "func (m *Modulus) Bytes() []byte {\n\treturn m.nat.Bytes()\n}", "title": "" }, { "docid": "b2f1dab959583b96b09b5774d61fd010", "score": "0.61436737", "text": "func (msg MsgRequestData) GetSignBytes() []byte {\n\tbz := ModuleCdc.MustMarshalJSON(msg)\n\treturn sdk.MustSortJSON(bz)\n}", "title": "" }, { "docid": "69e3c4402d9517627f32b2d3db1c4393", "score": "0.61278516", "text": "func (msg MsgDebug) GetSignBytes() []byte {\n\tb, err := json.Marshal(msg)\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\n\treturn sdk.MustSortJSON(b)\n}", "title": "" }, { "docid": "ca0b07e779a414e6ac5c00ddb13de552", "score": "0.6118417", "text": "func (b *Buffer) Bytes() []byte {\n\treturn b.data[b.position:b.limit]\n}", "title": "" }, { "docid": "04f2737b329076d91c953dbdf971b102", "score": "0.6111783", "text": "func (b ByteArray) Bytes() []byte {\n\treturn byteArrayToByteSlice(b)\n}", "title": "" }, { "docid": "9946d0ce6929d4cc2c35e80404e8ef0f", "score": "0.61090887", "text": "func (bl *BitList) GetBytes() []byte {\r\n\tlen := bl.count >> 3\r\n\tif (bl.count % 8) != 0 {\r\n\t\tlen++\r\n\t}\r\n\tresult := make([]byte, len)\r\n\tfor i := 0; i < len; i++ {\r\n\t\tshift := (3 - (i % 4)) * 8\r\n\t\tresult[i] = (byte)((bl.data[i/4] >> uint(shift)) & 0xFF)\r\n\t}\r\n\treturn result\r\n}", "title": "" }, { "docid": "11fb4a54648c911f5693a9ab6b9336b5", "score": "0.6102477", "text": "func (f StartupFrame) Bytes() []byte {\n\treturn f\n}", "title": "" }, { "docid": "d338a177c0af69ebdb5e9e6c383bd87b", "score": "0.6102296", "text": "func (p *Printer) Bytes() []byte {\n\treturn p.buffer.Bytes()\n}", "title": "" }, { "docid": "0bad1f9679cc40243cd817e23708848f", "score": "0.6098821", "text": "func (mb *MappedBuffer) Bytes() []byte {\n\tvar header reflect.SliceHeader\n\theader.Data = uintptr(mb.pointer)\n\tsize := int(mb.size)\n\theader.Len = size\n\theader.Cap = size\n\treturn *(*[]byte)(unsafe.Pointer(&header))\n}", "title": "" }, { "docid": "cf645b914654a0fb68d57ebbe899258e", "score": "0.6092481", "text": "func (msg MsgCreateDataSource) GetSignBytes() []byte {\n\tbz := ModuleCdc.MustMarshalJSON(msg)\n\treturn sdk.MustSortJSON(bz)\n}", "title": "" }, { "docid": "904286bf244912c753a06947460969c5", "score": "0.60908914", "text": "func (this *Variation) GetDataBytes() []byte {\n\tif this.Data == nil {\n\t\treturn nil\n\t}\n\tmime, _ := imaging.GetMime4mExt(this.Extension)\n\tdatabytes, e := imaging.GetBytes4mImage(this.Data, mime)\n\tif e != nil {\n\t\tfmt.Printf(e.Error())\n\t}\n\treturn databytes\n}", "title": "" }, { "docid": "b4c86178ff7287e7e9872255c3fda98c", "score": "0.6083883", "text": "func (aa HeimdallAddress) Bytes() []byte {\n\treturn aa[:]\n}", "title": "" }, { "docid": "4501ec73fb06254920462e2b9f04c5d0", "score": "0.60724205", "text": "func (m *Macaroon) packetBytes(p packet) []byte {\n\treturn m.data[p.start : p.start+int32(p.totalLen)]\n}", "title": "" }, { "docid": "97b1ebb1c0f2f1afd4a407599fc08989", "score": "0.60716516", "text": "func (b *Buffer) Bytes() []byte {\n\treturn b.buf\n}", "title": "" }, { "docid": "fe64f96a62cc652dba1ca0acf1cb6ceb", "score": "0.6067695", "text": "func (bbuf *ByteBuffer) Bytes() []byte {\n\treturn bbuf.buffer.Bytes()[:bbuf.len]\n}", "title": "" }, { "docid": "7873e923358126acdbf222435d32f426", "score": "0.606423", "text": "func (cbr *Cbor) Bytes() []byte {\n\treturn cbr.data[:cbr.n]\n}", "title": "" }, { "docid": "13b64c69401e9b0a4ed5bec6fd050d76", "score": "0.60609967", "text": "func (tx *Transaction) Bytes() []byte {\n\treturn tx.rawBytes\n}", "title": "" }, { "docid": "8b601ef2ac09a5ecc341d1b689b42d9b", "score": "0.60578555", "text": "func (v NotifyEvent) Bytes() []byte {\n\tbuf := make([]byte, 32)\n\tb := 0\n\n\t// write event number\n\tbuf[b] = 0\n\tb += 1\n\n\tbuf[b] = byte(v.ShapeKind)\n\tb += 1\n\n\tb += 2 // skip sequence number\n\n\txgb.Put32(buf[b:], uint32(v.AffectedWindow))\n\tb += 4\n\n\txgb.Put16(buf[b:], uint16(v.ExtentsX))\n\tb += 2\n\n\txgb.Put16(buf[b:], uint16(v.ExtentsY))\n\tb += 2\n\n\txgb.Put16(buf[b:], v.ExtentsWidth)\n\tb += 2\n\n\txgb.Put16(buf[b:], v.ExtentsHeight)\n\tb += 2\n\n\txgb.Put32(buf[b:], uint32(v.ServerTime))\n\tb += 4\n\n\tif v.Shaped {\n\t\tbuf[b] = 1\n\t} else {\n\t\tbuf[b] = 0\n\t}\n\tb += 1\n\n\tb += 11 // padding\n\n\treturn buf\n}", "title": "" }, { "docid": "628e36fba9c1486ebab0f1857f606626", "score": "0.605563", "text": "func (g *Group) Byte() ([]byte, error) {\n\treturn json.Marshal(g)\n}", "title": "" }, { "docid": "8641ee48c6ecc92475b7b44e4fec4680", "score": "0.6053641", "text": "func (v BytesID) Bytes() []byte {\n\treturn v\n}", "title": "" }, { "docid": "5f86b66244746f9c81ee3ede9a959114", "score": "0.6049", "text": "func (writer BinaryBufferWriter) Bytes() []byte {\n\treturn writer.buffer.Bytes()\n}", "title": "" }, { "docid": "14c2b13f1b8318e22d3e433b8ea199a4", "score": "0.60440546", "text": "func (l *SyncLog) Bytes() []byte {\n\tl.Lock()\n\tdefer l.Unlock()\n\treturn l.buf.Bytes()\n}", "title": "" }, { "docid": "aafb49af27da27aa7a5c9b84b9e3324b", "score": "0.6042219", "text": "func (msg ClaimMsg) GetSignBytes() []byte {\n\tb, err := json.Marshal(msg)\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\treturn b\n}", "title": "" }, { "docid": "5a89982479850a7989aad078353711bf", "score": "0.6042074", "text": "func (m *MPI) Bytes() []byte {\n\treturn m.bytes\n}", "title": "" }, { "docid": "f386183904cc7f74fca869d8fb52d239", "score": "0.6039702", "text": "func (msg *MsgCreateTestCase) GetSignBytes() []byte {\n\treturn sdk.MustSortJSON(ModuleCdc.MustMarshalJSON(msg))\n\n}", "title": "" }, { "docid": "3003804b8d181a90e9c101624f241df0", "score": "0.6038415", "text": "func (msg MsgIngestDifficultyChange) GetSignBytes() []byte {\n\treturn sdk.MustSortJSON(ModuleCdc.MustMarshalJSON(msg))\n}", "title": "" }, { "docid": "05237c5fda74cef3d45159d63b5ebc03", "score": "0.60364115", "text": "func (msg MsgBurn) GetSignBytes() []byte {\n\treturn sdk.MustSortJSON(ModuleCdc.MustMarshalJSON(msg))\n}", "title": "" }, { "docid": "b15d41f339c4de1f8d9e8cbb4c88f148", "score": "0.6030375", "text": "func (s *UploadSaveFilePartRequest) GetBytes() (value []byte) {\n\tif s == nil {\n\t\treturn\n\t}\n\treturn s.Bytes\n}", "title": "" }, { "docid": "5084314987ca8a57f7545d64af4a0dda", "score": "0.60232145", "text": "func (msg MsgEvaluate) GetSignBytes() []byte {\n\treturn sdk.MustSortJSON(ModuleCdc.MustMarshalJSON(msg))\n}", "title": "" }, { "docid": "c47042491db70e07aa36431574a907b0", "score": "0.60202724", "text": "func (sig *Signature) Bytes() []byte {\n\treturn append(sig.Signature.Bytes(), sig.HashType)\n}", "title": "" }, { "docid": "1c76193fc8dbdf6f0c1640ba1403621a", "score": "0.6009268", "text": "func (m MsgCreateClass) GetSignBytes() []byte {\n\treturn sdk.MustSortJSON(ModuleCdc.MustMarshalJSON(&m))\n}", "title": "" }, { "docid": "964b62c8ee085469260780680662eaae", "score": "0.6006382", "text": "func GetBytes(s interface{}) []byte {\n\tb, _ := json.Marshal(s)\n\treturn b\n}", "title": "" }, { "docid": "ecd275bb9449d218f914bbec4ed9a8e9", "score": "0.5998655", "text": "func (t Telegram) Bytes() []byte {\n\tcommandInfo := []byte{byte(t.Type), byte(t.Command)}\n\treturn append(commandInfo, t.Message...)\n}", "title": "" }, { "docid": "dd76167c425b06c7ec639add28896eaf", "score": "0.5996626", "text": "func (stream ByteStream) Bytes() []byte {\n\treturn stream.data[:stream.writeOffset]\n}", "title": "" }, { "docid": "11f4dc109ac40b34444af40c5f0ad6a3", "score": "0.59955937", "text": "func (p *Payload) Bytes() []byte {\n\tif p == nil {\n\t\treturn nil\n\t}\n\tbuf := make([]byte, len(*p))\n\tfor i, v := range *p {\n\t\tbuf[i] = v\n\t}\n\treturn buf\n}", "title": "" }, { "docid": "9ad9ca7e8cd744047b7de5b8a183263d", "score": "0.59944075", "text": "func (msg MsgProvision) GetSignBytes() []byte {\n\treturn sdk.MustSortJSON(ModuleCdc.MustMarshalJSON(msg))\n}", "title": "" }, { "docid": "665ad7a36dc18437f5d40f62c8ef4f85", "score": "0.59922355", "text": "func (db DataBasic) Bytes() ([]byte, error) {\n\tvar (\n\t\tlength int\n\t\terr error\n\t)\n\n\tbBlocks := make([][]byte, len(db.Components))\n\tbBlockLength := make([][]byte, len(db.Components))\n\n\t// calculate length\n\tfor i, component := range db.Components {\n\t\t// length key type length field = 1 and length key check value length field = 1\n\t\tlength += 2\n\n\t\tbBlocks[i], err = component.Block.Bytes()\n\t\tif err != nil {\n\t\t\treturn nil, errors.Wrap(err, fmt.Sprintf(\"invalid key component block %d/%d\", i, len(db.Components)))\n\t\t}\n\n\t\tbBlockLength[i], err = util.BuildGPBerLength(uint(len(bBlocks[i])))\n\t\tif err != nil {\n\t\t\treturn nil, errors.Wrap(err, fmt.Sprintf(\"build BER length for Key Components %d/%d\", i, len(db.Components)))\n\t\t}\n\n\t\tlength += len(bBlockLength[i])\n\t\tlength += len(bBlocks[i])\n\t\tlength += len(component.KCV)\n\t}\n\n\tbytes := make([]byte, 0, length)\n\n\tfor i, com := range db.Components {\n\t\tbytes = append(bytes, com.Type)\n\t\tbytes = append(bytes, bBlockLength[i]...)\n\t\tbytes = append(bytes, bBlocks[i]...)\n\t\tbytes = append(bytes, byte(len(com.KCV)))\n\t\tbytes = append(bytes, com.KCV...)\n\t}\n\n\treturn bytes, nil\n}", "title": "" }, { "docid": "7c9ae6a4c6e082f7935055a5e78a75cb", "score": "0.59916294", "text": "func Bytes(key string, value []byte) Field {\n\treturn zap.ByteString(key, value)\n}", "title": "" }, { "docid": "b56433685215c73aa252fb9f5de85bd2", "score": "0.5987595", "text": "func (m RawMessage) Bytes(protocol Protocol) ([]byte, error) {\n\treturn m, nil\n}", "title": "" }, { "docid": "7fef673c9bf5962b6f4e99383459ef81", "score": "0.59804595", "text": "func (a Address) Bytes() []byte {\n\treturn []byte(a.str)\n}", "title": "" }, { "docid": "384c5aba7b38f6c4ca4ac6937f44f5af", "score": "0.5972787", "text": "func (av *ArrayValue) GetSerBytes() int {\n\tif av.GetLength() == 0 {\n\t\t// we always align to 8 bytes in upsertbatch\n\t\treturn 8\n\t}\n\treturn CalculateListElementBytes(av.DataType, av.GetLength())\n}", "title": "" } ]
6eb829a96cf26d1cfa1ec91ac888ae96
modPool_CountMatches uses multicores (with throttle to nCPU) when > 2 cores available It does not list by default but will if Verbose Uses worker pool
[ { "docid": "6269995d931ae0ccb750fb41469dc622", "score": "0.7909633", "text": "func modPool_CountMatches(fname string) {\n\tstartTime := time.Now()\n\tfmt.Printf(\"Doing modPool_CountMatches()\\n\")\n\tvar wg sync.WaitGroup\n\tallTargets := getTargets(fname)\n\tfmt.Printf(\"searching %d different targets\\n\", len(allTargets))\n\tnCPU := runtime.NumCPU()\n\truntime.GOMAXPROCS(nCPU)\n\tworkers := make(chan int, nCPU)\n\tfmt.Printf(\"using %d cores\\n\", nCPU)\n\tfor _, t := range allTargets {\n\t\tif quitTime {\n\t\t\tfmt.Printf(\"Returning from quit signal\\n\")\n\t\t\treturn\n\t\t}\n\t\tworkers <- 1 // blocks if no workers available\n\t\tVerbose.Printf(\"goroutine starting with regexp %s\\n\", t)\n\t\twg.Add(1)\n\t\tgo func(target string) {\n\t\t\tdefer wg.Done()\n\t\t\tre, err := regexp.Compile(target)\n\t\t\tif err != nil {\n\t\t\t\tfmt.Printf(\"!Err ---> can't compile regexp : %s \\n\", target)\n\t\t\t\t<-workers // free a worker core\n\t\t\t\treturn\n\t\t\t}\n\t\t\tvar matchCt = int64(0)\n\t\t\tvar matchBytes = int64(0)\n\t\t\tfor _, r := range g_nameList {\n\t\t\t\tif re.MatchString(r.Name) {\n\t\t\t\t\tmatchCt++\n\t\t\t\t\tmatchBytes += r.Size\n\t\t\t\t}\n\t\t\t}\n\t\t\tshowMatchCounts(matchBytes, matchCt, target)\n\t\t\tg_tmMutex.Lock()\n\t\t\tg_totalMatches += matchCt\n\t\t\tg_totalBytes += matchBytes\n\t\t\tg_tmMutex.Unlock()\n\t\t\t<-workers // free a worker core\n\t\t}(t)\n\t}\n\twg.Wait()\n\telapsedTime := time.Now().Sub(startTime)\n\t//elapsedSeconds := elapsedTime.Seconds()\n\tfmt.Printf(\"# modPool run time is %s\\n\", mdr.HumanTime(elapsedTime))\n}", "title": "" } ]
[ { "docid": "d360aed299b34f8faae5d390acab481a", "score": "0.721007", "text": "func modSplit_CountMatches(fname string) {\n\tstartTime := time.Now()\n\tfmt.Printf(\"Doing modSplit_CountMatches()\\n\")\n\tvar wg sync.WaitGroup\n\tallTargets := getTargets(fname)\n\tnCPU := runtime.NumCPU()\n\tfmt.Printf(\"searching %d different targets with %d CPUs\\n\", len(allTargets), nCPU)\n\truntime.GOMAXPROCS(nCPU)\n\tsplits := mdr.JobSplit(len(g_nameList), nCPU)\n\tfor _, target := range allTargets {\n\t\tif quitTime {\n\t\t\tfmt.Printf(\"Returning from quit signal\\n\")\n\t\t\treturn\n\t\t}\n\t\tVerbose.Printf(\"goroutine starting with regexp %s\\n\", target)\n\t\tre, err := regexp.Compile(target)\n\t\tif err != nil {\n\t\t\tfmt.Printf(\"!Err ---> can't compile regexp : %s \\n\", target)\n\t\t\tcontinue\n\t\t}\n\t\tvar matchCt = int64(0)\n\t\tvar matchBytes = int64(0)\n\t\tfor j := 0; j < nCPU; j++ {\n\t\t\twg.Add(1)\n\t\t\tgo func(lo, hi int) {\n\t\t\t\tdefer wg.Done()\n\t\t\t\tvar fileCt = int64(0)\n\t\t\t\tvar byteCt = int64(0)\n\t\t\t\tfor i := lo; i <= hi; i++ {\n\t\t\t\t\tr := g_nameList[i]\n\t\t\t\t\tif re.MatchString(r.Name) {\n\t\t\t\t\t\tfileCt++\n\t\t\t\t\t\tbyteCt += r.Size\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tg_tmMutex.Lock()\n\t\t\t\tmatchCt += fileCt\n\t\t\t\tmatchBytes += byteCt\n\t\t\t\tg_tmMutex.Unlock()\n\t\t\t}(splits[j].X, splits[j].Y)\n\t\t}\n\t\twg.Wait()\n\t\tshowMatchCounts(matchBytes, matchCt, target)\n\t\tg_totalMatches += matchCt\n\t\tg_totalBytes += matchBytes\n\t}\n\telapsedTime := time.Now().Sub(startTime)\n\t//elapsedSeconds := elapsedTime.Seconds()\n\tfmt.Printf(\"# modSplit run time is %s\\n\", mdr.HumanTime(elapsedTime))\n}", "title": "" }, { "docid": "9dc998672be5d5fe0fb6fb5d7a17aa25", "score": "0.68406165", "text": "func modGort_CountMatches(fname string) {\n\tstartTime := time.Now()\n\tfmt.Printf(\"Doing modGort_CountMatches()\\n\")\n\tvar wg sync.WaitGroup\n\tallTargets := getTargets(fname)\n\tnCPU := runtime.NumCPU()\n\tfmt.Printf(\"search ing %d different targets with %d CPUs\\n\", len(allTargets), nCPU)\n\t// test passes, throttles down when nCPU >= 2\n\truntime.GOMAXPROCS(nCPU)\n\tfor _, t := range allTargets {\n\t\tif quitTime {\n\t\t\tfmt.Printf(\"Returning from quit signal\\n\")\n\t\t\treturn\n\t\t}\n\t\tVerbose.Printf(\"goroutine starting with regexp %s\\n\", t)\n\t\twg.Add(1)\n\t\tgo func(target string) {\n\t\t\tdefer wg.Done()\n\t\t\tre, err := regexp.Compile(target)\n\t\t\tif err != nil {\n\t\t\t\tlog.Fatalf(\"can't compile regexp - crashed here\\n\")\n\t\t\t}\n\t\t\tvar matchCt = int64(0)\n\t\t\tvar matchBytes = int64(0)\n\t\t\tfor _, r := range g_nameList {\n\t\t\t\tif re.MatchString(r.Name) {\n\t\t\t\t\tmatchCt++\n\t\t\t\t\tmatchBytes += r.Size\n\t\t\t\t}\n\t\t\t}\n\t\t\tshowMatchCounts(matchBytes, matchCt, target)\n\t\t\tg_tmMutex.Lock()\n\t\t\tg_totalMatches += matchCt\n\t\t\tg_totalBytes += matchBytes\n\t\t\tg_tmMutex.Unlock()\n\t\t}(t)\n\t}\n\twg.Wait()\n\telapsedTime := time.Now().Sub(startTime)\n\t//elapsedSeconds := elapsedTime.Seconds()\n\tfmt.Printf(\"# modGort run time is %s\\n\", mdr.HumanTime(elapsedTime))\n}", "title": "" }, { "docid": "41f61dfe53adb9f3cd24b69e02931abd", "score": "0.62885994", "text": "func workerCount() int", "title": "" }, { "docid": "5baaf7b108aefc156b9ccdcd9a6483c2", "score": "0.6189908", "text": "func poolSize(dependencyCount int) int {\n\tvar poolSize = runtime.NumCPU()\n\tif poolSize == 1 {\n\t\tpoolSize = 2\n\t}\n\tif dependencyCount < poolSize {\n\t\tpoolSize = dependencyCount\n\t}\n\treturn poolSize\n}", "title": "" }, { "docid": "da19f1b4492378e725e2b16dc7167642", "score": "0.59858817", "text": "func NumCores() int { return 2 }", "title": "" }, { "docid": "d1f5a2ac38e92c742efe47b0ecf941a0", "score": "0.57897305", "text": "func mod_ListMatches(fname string) {\n\tstartTime := time.Now()\n\tfmt.Printf(\"Doing ListMatches()\\n\")\n\tallTargets := getTargets(fname)\n\tfmt.Printf(\"searching %d different targets\\n\", len(allTargets))\n\n\tfor _, target := range allTargets {\n\t\tmatchCt := int64(0)\n\t\tmatchBytes := int64(0)\n\t\tre, err := regexp.Compile(target)\n\t\tif err != nil {\n\t\t\tlog.Fatalf(\"can't compile regexp - crashed here\\n\")\n\t\t}\n\t\tfor _, r := range g_nameList {\n\t\t\tif re.MatchString(r.Name) {\n\t\t\t\tfmt.Printf(\"%16s bytes : %s\\n\", mdr.CommaFmtInt64(r.Size), r.Name)\n\t\t\t\tmatchCt++\n\t\t\t\tmatchBytes += r.Size\n\t\t\t}\n\t\t}\n\t\tshowMatchCounts(matchBytes, matchCt, target)\n\t\tg_totalMatches += matchCt\n\t\tg_totalBytes += matchBytes\n\t}\n\telapsedTime := time.Now().Sub(startTime)\n\t//elapsedSeconds := elapsedTime.Seconds()\n\tfmt.Printf(\"# modList run time is %s\\n\", mdr.HumanTime(elapsedTime))\n}", "title": "" }, { "docid": "d8c1f39dad02f0a4d06f365eb692b258", "score": "0.57298225", "text": "func calcNumThreads(maxChunkSize int64) int {\n\tnumCPUs := runtime.NumCPU()\n\thwMemoryBytes := memorySizeBytes()\n\n\tfmt.Printf(\"number of machine cores: %d\\n\", numCPUs)\n\tfmt.Printf(\"memory size: %d GiB\\n\", hwMemoryBytes/GiB)\n\n\tnumThreads := MinInt(numCPUs, maxNumThreads)\n\tmemoryCostPerThread := 3 * int64(maxChunkSize)\n\n\tfor numThreads > minNumThreads {\n\t\tprojectedMemoryUseBytes := memoryCostPerThread * int64(numThreads)\n\t\tif projectedMemoryUseBytes < (hwMemoryBytes - GiB) {\n\t\t\treturn numThreads\n\t\t}\n\t\tnumThreads -= 2\n\t}\n\treturn minNumThreads\n}", "title": "" }, { "docid": "c524246be09b840c6fb0ba403a30a9eb", "score": "0.5699159", "text": "func threadedFriendlyCountOf(wordList []string) int {\n\tg := groupWords(wordList)\n\tvar c []chan int\n\tfor i := 0; i < len(g); i++ {\n\t\tc = append(c, make(chan int))\n\t}\n\tfor i := 0; i < len(g); i++ {\n\t\tgo func(wl []string, index int) {\n\t\t\tc[index] <- friendlyCountof(wl)\n\t\t}(g[i], i)\n\t}\n\tcount := 0\n\tfor i := 0; i < len(c); i++ {\n\t\tcount += <-c[i]\n\t}\n\treturn count\n}", "title": "" }, { "docid": "b09294f5879fee3e646ba22391f396e3", "score": "0.5676852", "text": "func NumParallel() int {\n\treturn (goruntime.NumCPU() / 2) + 1\n}", "title": "" }, { "docid": "5983ff9dbb7a6ae79e57ab1ebc43b469", "score": "0.5559189", "text": "func (t *Tracker) playerCount(pool int) int {\n\tt.mutex.RLock()\n\tdefer t.mutex.RUnlock()\n\n\treturn len(t.pools[pool])\n}", "title": "" }, { "docid": "6a6fdbe4b66935947ce25ff5209df9e8", "score": "0.55471575", "text": "func poolCount(p *config.Pool) int64 {\n\tvar total int64\n\tfor _, cidr := range p.CIDR {\n\t\to, b := cidr.Mask.Size()\n\t\tif b-o >= 62 {\n\t\t\t// An enormous ipv6 range is allocated which will never run out.\n\t\t\t// Just return max to avoid any math errors.\n\t\t\treturn math.MaxInt64\n\t\t}\n\t\tsz := int64(math.Pow(2, float64(b-o)))\n\n\t\tcur := ipaddr.NewCursor([]ipaddr.Prefix{*ipaddr.NewPrefix(cidr)})\n\t\tfirstIP := cur.First().IP\n\t\tlastIP := cur.Last().IP\n\n\t\tif p.AvoidBuggyIPs {\n\t\t\tif o <= 24 {\n\t\t\t\t// A pair of buggy IPs occur for each /24 present in the range.\n\t\t\t\tbuggies := int64(math.Pow(2, float64(24-o))) * 2\n\t\t\t\tsz -= buggies\n\t\t\t} else {\n\t\t\t\t// Ranges smaller than /24 contain 1 buggy IP if they\n\t\t\t\t// start/end on a /24 boundary, otherwise they contain\n\t\t\t\t// none.\n\t\t\t\tif ipConfusesBuggyFirmwares(firstIP) {\n\t\t\t\t\tsz--\n\t\t\t\t}\n\t\t\t\tif ipConfusesBuggyFirmwares(lastIP) {\n\t\t\t\t\tsz--\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\ttotal += sz\n\t}\n\treturn total\n}", "title": "" }, { "docid": "b1bc9e5d7fa409a140a61d741dbdf2d2", "score": "0.54911214", "text": "func (c *MRCluster) NWorkers() int { return c.nWorkers }", "title": "" }, { "docid": "9f943e0aaaf4e49466ccbef15c13c6ef", "score": "0.5367602", "text": "func (p *Pool) ActiveCount() int {\n p.mu.Lock()\n active := p.active\n p.mu.Unlock()\n return active\n}", "title": "" }, { "docid": "336863df4b7d18bd5e7adc4ca1df3665", "score": "0.5351118", "text": "func countNumOfMatches(memOneSl, memTwoSl []int) int {\n\tnum := 0\n\tfor i := range memTwoSl {\n\t\tfor j := range memOneSl {\n\t\t\tif memTwoSl[i] == memOneSl[j] {\n\t\t\t\tnum++\n\t\t\t}\n\t\t}\n\t}\n\treturn num\n}", "title": "" }, { "docid": "143e7bfa57bb53b6a3678cf0c9e306b2", "score": "0.5283992", "text": "func (p *pool) Count() int {\n\tp.RLock()\n\tdefer p.RUnlock()\n\treturn len(p.plugins)\n}", "title": "" }, { "docid": "f4f9a98162a60b9c70e520e454ee90d2", "score": "0.52453095", "text": "func basicMatch(w *Worker, r *TaskRequest) matchLevel {\n\tif w.Labels.Contains(r.BaseLabels) {\n\t\tquality := len(r.BaseLabels)\n\t\treturn matchLevel{true, quality}\n\t}\n\treturn matchLevel{false, 0}\n}", "title": "" }, { "docid": "dff2d65a5be8bf69454a5807015c9bc0", "score": "0.5241512", "text": "func (miner *XmrStak) getCPUThreadcount() uint16 {\n\tconfigPath := filepath.Join(miner.Base.executablePath, \"cpu.txt\")\n\tconfigFileBytes, err := ioutil.ReadFile(configPath)\n\t// If config file doesn't exist, return 0 as the threadcount\n\tif err != nil {\n\t\treturn 0\n\t}\n\t// xmr-stak uses a strange JSON-like format, I haven't found a Go library\n\t// that can parse the file, so we're doing some basic string matches\n\tlines := strings.Split(string(configFileBytes), \"\\n\")\n\tvar validLines string\n\tfor _, line := range lines {\n\t\tfor _, char := range line {\n\t\t\t// This is a very very very basic check if this line is actually a comment\n\t\t\tif string(char) == \"/\" || string(char) == \"*\" {\n\t\t\t\t// Skip this line\n\t\t\t\tbreak\n\t\t\t} else {\n\t\t\t\tvalidLines += string(char)\n\t\t\t}\n\t\t}\n\t}\n\n\tvar threadcount uint16\n\t// Match anything enclosed in {} for JSON object\n\tvar re = regexp.MustCompile(`{*}`)\n\tfor _ = range re.FindAllString(validLines, -1) {\n\t\tthreadcount++\n\t}\n\treturn threadcount\n}", "title": "" }, { "docid": "c8f900736549cde435adc7605206c040", "score": "0.5237716", "text": "func (s *webServer) count() int {\n\twindowStartPoint := time.Now().Add(-1 * time.Minute)\n\ts.reqInfoPool.ClearRecord(windowStartPoint)\n\treturn s.reqInfoPool.Count()\n}", "title": "" }, { "docid": "85e09d1b6939a2850d3a1ffc12e29018", "score": "0.5227396", "text": "func ParallelWordCount() {\n\tstarttime := time.Now()\n\tfmt.Println(\"Processing . . .\")\n\n\tinput := getFilesConcurrent(\"D:\\\\Facultate\\\\go_course\\\\repo\\\\sabinpruna\")\n\n\t// this will start the map reduce work\n\tresults := mapReduce(mapper, reducer, input)\n\n\tfilehandle, err := os.Create(\"D:\\\\Facultate\\\\go_course\\\\repo\\\\sabinpruna\" + \"/processed.csv\")\n\tdefer filehandle.Close()\n\tif err != nil {\n\t\tfmt.Println(\"Error writing to file: \", err)\n\t\treturn\n\t}\n\tfmt.Println(\"Writing to file:\", filehandle.Name())\n\n\twriter := bufio.NewWriter(filehandle)\n\n\tfor word, frequency := range results.(map[string]int) {\n\t\tfmt.Fprintln(writer, word+\",\"+strconv.Itoa(frequency))\n\t}\n\tdefer writer.Flush()\n\tdefer filehandle.Close()\n\n\telapsedtime := time.Since(starttime)\n\tfmt.Println(\"Complete\")\n\tfmt.Println(\"Time taken:\", elapsedtime)\n}", "title": "" }, { "docid": "bd4938f7f25dc54e5d2fc09536dcc81c", "score": "0.52154464", "text": "func (p *simpleResourcePool) NumActive() int32 {\n\treturn atomic.LoadInt32(p.numActive)\n}", "title": "" }, { "docid": "d8b0789cb493e0438ae71eb7126559e3", "score": "0.5209759", "text": "func (s *Server) Count(ctx context.Context, times *pb.Times) (*pb.Sum, error) {\n\t// totalSum := int32(0)\n\twg := &sync.WaitGroup{}\n\n\tjobSize := 100000\n\tnumWorkers := 5\n\tcountMutex := &countMutex{\n\t\tmu: &sync.Mutex{},\n\t\tcount: 0,\n\t}\n\tjobChan := make(chan int, 100)\n\tfor i := 0; i < numWorkers; i++ {\n\t\tgo CountWorker(countMutex, wg, jobChan)\n\t}\n\n\tnumJobs := int(times.Times) / jobSize\n\tif jobSize > int(times.Times) {\n\t\tnumJobs = 1\n\t\tjobSize = int(times.Times)\n\t}\n\n\tfor w := 0; w < numJobs; w++ {\n\t\twg.Add(1)\n\t\tjobChan <- jobSize\n\t}\n\tclose(jobChan)\n\twg.Wait()\n\n\treturn &pb.Sum{\n\t\tSum: countMutex.count,\n\t}, nil\n}", "title": "" }, { "docid": "5381fd9879bc4e3e7e5607bbb2988b89", "score": "0.51530296", "text": "func (c *nomadClient) calculatePoolCapacity(capacity *structs.ClusterCapacity,\n\tworkerPool *structs.WorkerPool) (err error) {\n\n\tfor _, node := range workerPool.Nodes {\n\t\tcapacity.NodeCount++\n\t\tcapacity.NodeList = append(capacity.NodeList, node.ID)\n\n\t\tcapacity.TotalCapacity.CPUMHz += *node.Resources.CPU\n\t\tcapacity.TotalCapacity.MemoryMB += *node.Resources.MemoryMB\n\t\tcapacity.TotalCapacity.DiskMB += *node.Resources.DiskMB\n\t}\n\n\treturn\n}", "title": "" }, { "docid": "557ed25e79e87a47ac781e744b94af45", "score": "0.5131829", "text": "func mrChanneledCounter(workers int, inputs []string) wordCounts {\n\tresultSet := make([]wordCounts, workers)\n\n\t// a go-routineable func for wordcounting inputs on a channel\n\tf := func(idx int, wg *sync.WaitGroup, inputCh chan string) {\n\t\tlocalResults := make(wordCounts)\n\t\tdefer func() {\n\t\t\tresultSet[idx] = localResults\n\t\t\twg.Done()\n\t\t}()\n\t\tfor in := range inputCh {\n\t\t\tassign(localResults, mrWordCount(in))\n\t\t}\n\t}\n\n\t// spin up all the goroutines and feed in the inputs\n\twg := new(sync.WaitGroup)\n\twg.Add(workers)\n\tinputFeed := make(chan string)\n\tfor i := 0; i < workers; i++ {\n\t\tgo f(i, wg, inputFeed)\n\t}\n\tfor _, input := range inputs {\n\t\tinputFeed <- input\n\t}\n\n\t// wait for all the goroutines to complete\n\tclose(inputFeed)\n\twg.Wait()\n\n\t// aggregate the results\n\tresults := make(wordCounts)\n\tfor _, r := range resultSet {\n\t\tassign(results, r)\n\t}\n\treturn results\n}", "title": "" }, { "docid": "e522c9f4c5449e374e2d5cc28f5280bf", "score": "0.51317006", "text": "func setNoOfCPUCores(cpuCorePer float64) {\n\tcorePer := config.GlobalAppConfig.Performance.UseCorePercentage\n\tif corePer <= 0 {\n\t\tfmt.Printf(\"No of Cpu Core to be Used = 1\\n\")\n\t\treturn\n\t}\n\ttotalCpus := float64(runtime.NumCPU())\n\tcpuCore := totalCpus * (corePer / 100)\n\tif cpuCore <= 0 {\n\t\tfmt.Printf(\"No of Cpu Core to be Used = 1\\n\")\n\t\treturn\n\t}\n\n\tif cpuCore > totalCpus {\n\t\tcpuCore = totalCpus\n\t}\n\tfmt.Printf(\"No of Cpu Core to be Used = %d\\n\", int(cpuCore))\n\truntime.GOMAXPROCS(int(cpuCore))\n}", "title": "" }, { "docid": "987b2816070c1b838a2aa89e6f403f45", "score": "0.51234543", "text": "func (m *Manager) numJobsToRequest(p provider.Provider, d time.Duration) int {\n\n\t// count = target jobs per second * time we have to do those jobs\n\tcount := p.Target() * d.Seconds()\n\n\t// if we can't handle the target load, hard limit on our maximum\n\tif m.capasityByProvider(p) < p.Target() {\n\t\tcount = m.capasityByProvider(p)\n\t}\n\n\treturn int(count)\n}", "title": "" }, { "docid": "4458c007bcb408cbb87dc8ab1599231e", "score": "0.51195025", "text": "func NumCPU() int {\n\treturn int(ncpu)\n}", "title": "" }, { "docid": "fdf47f30432eacb4bc96ac0576110bb5", "score": "0.5099279", "text": "func (s *redisStore) Count(ctx context.Context, mods ...rq.Modifier) (int, error) {\n\tconn, err := s.pool.GetContext(ctx)\n\tif err != nil {\n\t\treturn 0, errors.Wrap(err, \"failed to acquire a connection\")\n\t}\n\tdefer conn.Close()\n\n\tcmd, err := s.injectKeyPrefix(rq.Count(mods...)).Build()\n\tif err != nil {\n\t\treturn 0, errors.WithStack(err)\n\t}\n\n\tcnt, err := redis.Int(conn.Do(cmd.Name, cmd.Args...))\n\tif err != nil {\n\t\treturn 0, errors.Wrapf(err, \"faild to execute %v\", cmd)\n\t}\n\treturn cnt, nil\n}", "title": "" }, { "docid": "9927b99058754f44929f0b2b564f8188", "score": "0.5096257", "text": "func countMatchingLabels(policy *v1alpha1.MigrationPolicy, vmiLabels, namespaceLabels map[string]string) (doesMatch bool, score migrationPolicyMatchScore) {\n\tvar matchingVMILabels, matchingNSLabels int\n\tdoesMatch = true\n\n\tif policy.Spec.Selectors == nil {\n\t\treturn false, score\n\t}\n\n\tcountLabelsHelper := func(policyLabels, labelsToMatch map[string]string) (matchingLabels int) {\n\t\tfor policyKey, policyValue := range policyLabels {\n\t\t\tvalue, exists := labelsToMatch[policyKey]\n\t\t\tif exists && value == policyValue {\n\t\t\t\tmatchingLabels++\n\t\t\t} else {\n\t\t\t\tdoesMatch = false\n\t\t\t\treturn\n\t\t\t}\n\t\t}\n\t\treturn matchingLabels\n\t}\n\n\tareSelectorsAndLabelsNotNil := func(selector v1alpha1.LabelSelector, labels map[string]string) bool {\n\t\treturn selector != nil && labels != nil\n\t}\n\n\tif areSelectorsAndLabelsNotNil(policy.Spec.Selectors.VirtualMachineInstanceSelector, vmiLabels) {\n\t\tmatchingVMILabels = countLabelsHelper(policy.Spec.Selectors.VirtualMachineInstanceSelector, vmiLabels)\n\t}\n\n\tif doesMatch && areSelectorsAndLabelsNotNil(policy.Spec.Selectors.NamespaceSelector, vmiLabels) {\n\t\tmatchingNSLabels = countLabelsHelper(policy.Spec.Selectors.NamespaceSelector, namespaceLabels)\n\t}\n\n\tif doesMatch {\n\t\tscore = migrationPolicyMatchScore{matchingVMILabels: matchingVMILabels, matchingNSLabels: matchingNSLabels}\n\t}\n\n\treturn doesMatch, score\n}", "title": "" }, { "docid": "831c73ac1e16d1e9e859b500f88ad9c9", "score": "0.5089979", "text": "func setNumWorkers(upper uint64) int {\n count := 1\n if upper > MIN_JOB_PER_WORKER {\n var countTmp float64\n if upper < FUNC_CHANGER {\n //Computes de division between the upper value and the minimum amount of jobs per worker\n countTmp = float64(upper) / float64(MIN_JOB_PER_WORKER)\n } else {\n //Computes logarithm base 2 of upper value\n countTmp = math.Log2(float64(upper))\n }\n //Ceils the value obtain during the calc\n count = int(math.Ceil(countTmp))\n }\n return count\n}", "title": "" }, { "docid": "787ab0fe0c016df486a876cd981e2814", "score": "0.50834846", "text": "func (wc *WCount) runConCount() {\n\tvar wg sync.WaitGroup\n\tvar mu sync.Mutex\n\n\twcMaps := make([]map[string]int, 0, len(wc.files))\n\n\tfor _, file := range wc.files {\n\t\twg.Add(1)\n\t\tgo func(file string) {\n\t\t\twcMap := wc.syncCount(file)\n\t\t\tmu.Lock()\n\t\t\twcMaps = append(wcMaps, wcMap)\n\t\t\tdefer mu.Unlock()\n\t\t\tdefer wg.Done()\n\t\t}(file)\n\t}\n\n\twg.Wait()\n\n\tcumMap := map[string]int{}\n\tfor _, wcMap := range wcMaps {\n\t\tcombineMaps(cumMap, wcMap)\n\t}\n\n\twc.wcMap = cumMap\n}", "title": "" }, { "docid": "e957828d84377b65d80060ee72e3ca42", "score": "0.50796205", "text": "func checkCPUs(log logging.Logger, numSSDs, coresPerNUMA int) (int, int, error) {\n\tvar numTargets int\n\tif numSSDs == 0 {\n\t\tnumTargets = defaultTargetCount\n\t\tif numTargets >= coresPerNUMA {\n\t\t\treturn coresPerNUMA - 1, 0, nil\n\t\t}\n\n\t\treturn numTargets, calcHelpers(log, numTargets, coresPerNUMA), nil\n\t}\n\n\tif numSSDs >= coresPerNUMA {\n\t\treturn 0, 0, errors.Errorf(\"need more cores than ssds, got %d want %d\",\n\t\t\tcoresPerNUMA, numSSDs)\n\t}\n\n\tfor tgts := numSSDs; tgts < coresPerNUMA; tgts += numSSDs {\n\t\tnumTargets = tgts\n\t}\n\n\tlog.Debugf(\"%d targets assigned with %d ssds\", numTargets, numSSDs)\n\n\treturn numTargets, calcHelpers(log, numTargets, coresPerNUMA), nil\n}", "title": "" }, { "docid": "82f771dfa999670307a5358e1c1fdf1d", "score": "0.5065645", "text": "func (sp *Pool) NumAvailConns() int {\n\treturn len(sp.pool)\n}", "title": "" }, { "docid": "68387009b08837f84f99999a47f01e52", "score": "0.504585", "text": "func (s *Store) execBMCount(id uint64, req *raftcmdpb.Request) *raftcmdpb.Response {\n\tcmd := redis.Command(req.Cmd)\n\targs := cmd.Args()\n\n\tif len(args) != 1 {\n\t\trsp := pool.AcquireResponse()\n\t\trsp.ErrorResult = redis.ErrInvalidCommandResp\n\n\t\treturn rsp\n\t}\n\n\tvalue, err := s.getKVEngine(id).Get(args[0])\n\tif err != nil {\n\t\trsp := pool.AcquireResponse()\n\t\trsp.ErrorResult = hack.StringToSlice(err.Error())\n\t\treturn rsp\n\t}\n\n\trsp := pool.AcquireResponse()\n\tif len(value) == 0 {\n\t\tn := int64(0)\n\t\trsp.IntegerResult = &n\n\t} else {\n\t\tbm := acquireBitmap()\n\t\t_, _, err := bm.ImportRoaringBits(value, false, false, 0)\n\t\tif err != nil {\n\t\t\trsp.ErrorResult = hack.StringToSlice(err.Error())\n\t\t\treleaseBitmap(bm)\n\t\t\treturn rsp\n\t\t}\n\n\t\tn := int64(bm.Count())\n\t\trsp.IntegerResult = &n\n\t\treleaseBitmap(bm)\n\t}\n\n\treturn rsp\n}", "title": "" }, { "docid": "2474e9eae6bd47e6622cd08477fddb9b", "score": "0.50418466", "text": "func (c *siftClient)Match(ie1 *ImageEntity, ie2 *ImageEntity) bool {\n\n\tvar features1, features2 *featureData\n\tvar ok1, ok2 bool\n\tvar wg *sync.WaitGroup = new(sync.WaitGroup)\n\t/*\n\tif many coroutine come into this place and check the cache,they all don't get it.\n\tand they all load the real data,lt's not friend to concurrency.\n\tTODO design a flag for spin lock,the after coroutine wait and retry until done?\n\tTODO how to deal with a dead lock when exception?\n\t*/\n\tfeatures1, ok1 = c.getCache(ie1)\n\tfeatures2, ok2 = c.getCache(ie2)\n\tif !ok1 {\n\t\twg.Add(1)\n\t\tgo func() {\n\t\t\tfeatures1 = loadFeatureData(ie1)\n\t\t\t//c.setCache(ie1, features1)\n\t\t\twg.Done()\n\t\t}()\n\n\t}\n\n\tif !ok2 {\n\t\twg.Add(1)\n\t\tgo func() {\n\t\t\tfeatures2 = loadFeatureData(ie2)\n\t\t\tc.setCache(ie2, features2)\n\t\t\twg.Done()\n\t\t}()\n\n\t}\n\n\twg.Wait()\n\tres := compareFeatureData(features1, features2)\n\tif c.tf != nil {\n\t\treturn c.tf(features1.Count, features2.Count, res)\n\t}else {\n\t\treturn DEFAULT_THRESHOLDFUNC(features1.Count, features2.Count, res)\n\t}\n}", "title": "" }, { "docid": "71181e24d8d5e80d7cc1e65c3222e3dc", "score": "0.50356627", "text": "func NumOfInstances() int {\n\treturn len(instances)\n}", "title": "" }, { "docid": "a2e1696b581a3ddd2977ac5781673180", "score": "0.50356", "text": "func mod_KillMatches(fname string) {\n\tstartTime := time.Now()\n\tfmt.Printf(\"Doing KillMatches()\\n\")\n\tallTargets := getTargets(fname)\n\tfmt.Printf(\"searching %d different targets\\n\", len(allTargets))\n\tfor _, target := range allTargets {\n\t\tre, err := regexp.Compile(target)\n\t\tif err != nil {\n\t\t\tfmt.Printf(\"!Err ---> can't compile regexp : %s \\n\", target)\n\t\t\tcontinue\n\t\t}\n\t\tvar matchCt = int64(0)\n\t\tvar killCt = int64(0)\n\t\tvar matchBytes = int64(0)\n\t\tvar killBytes = int64(0)\n\t\tfor _, r := range g_nameList {\n\t\t\tif re.MatchString(r.Name) {\n\t\t\t\tmatchCt++\n\t\t\t\tmatchBytes += r.Size\n\t\t\t\tVerbose.Printf(\"\\tkilling %s\\n\", r.Name)\n\t\t\t\tif niceFlag > 0 {\n\t\t\t\t\ttime.Sleep(tok.Take(int64(niceFlag))) // rate limiter if used\n\t\t\t\t}\n\t\t\t\tif doReALLy {\n\t\t\t\t\terr := os.Remove(r.Name)\n\t\t\t\t\tif err != nil {\n\t\t\t\t\t\tif os.IsNotExist(err) == false {\n\t\t\t\t\t\t\tlog.Fatalf(\"Can't remove %s\\n\", r.Name)\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\tkillCt++\n\t\t\t\t\tkillBytes += r.Size\n\t\t\t\t\tg_totalKillCt++\n\t\t\t\t\tg_totalKillBytes += r.Size\n\t\t\t\t} else {\n\t\t\t\t\tfmt.Printf(\"need flag -doReALLy to actually remove %s\\n\", r.Name)\n\t\t\t\t}\n\t\t\t\tmatchCt++\n\t\t\t}\n\t\t}\n\t\tshowMatchCounts(matchBytes, matchCt, target)\n\t\tfmt.Printf(\"Kill %s had %d matches, %d files actually deleted with %s bytes\\n\",\n\t\t\ttarget, matchCt, killCt, mdr.CommaFmtInt64(killBytes))\n\t}\n\telapsedTime := time.Now().Sub(startTime)\n\t//elapsedSeconds := elapsedTime.Seconds()\n\tfmt.Printf(\"# modKill run time is %s\\n\", mdr.HumanTime(elapsedTime))\n}", "title": "" }, { "docid": "db513ba264a8bcbb6e4e5a0d8923f8ab", "score": "0.5030404", "text": "func (r *RPC) MempoolCount(ctx context.Context, kind string) (int, error) {\n\tconst op errors.Op = \"dcrd.MempoolCount\"\n\t// This is rather inefficient, as only the count is needed, not all\n\t// matching hashes.\n\tvar hashStrings []string\n\terr := r.Call(ctx, \"getrawmempool\", &hashStrings, false, kind)\n\tif err != nil {\n\t\treturn 0, errors.E(op, err)\n\t}\n\treturn len(hashStrings), nil\n}", "title": "" }, { "docid": "05184aaaa92be759e7b50abca632453a", "score": "0.50293064", "text": "func copReadChunkPoolSize() int {\n\treturn 10 * int(variable.GetDDLReorgWorkerCounter())\n}", "title": "" }, { "docid": "7b0c9245ea41b379a0c6992db1d6fdc5", "score": "0.5026661", "text": "func (ps *PoolSet) getPoolSize(pool string) int {\n\tp := ps.pools[pool]\n\n\treturn p.shared.Size() + p.pinned.Size()\n}", "title": "" }, { "docid": "3b893e8dd1512262a14e16ad1a22998b", "score": "0.5021446", "text": "func countMatchingLabels(policy *MigrationPolicy, vmiLabels, namespaceLabels map[string]string) (doesMatch bool, matchingLabels int) {\n\tdoesMatch = true\n\n\tif policy.Spec.Selectors == nil {\n\t\treturn false, 0\n\t}\n\n\tcountLabelsHelper := func(policyLabels, labelsToMatch map[string]string) {\n\t\tfor policyKey, policyValue := range policyLabels {\n\t\t\tvalue, exists := labelsToMatch[policyKey]\n\t\t\tif exists && value == policyValue {\n\t\t\t\tmatchingLabels++\n\t\t\t} else {\n\t\t\t\tdoesMatch = false\n\t\t\t\treturn\n\t\t\t}\n\t\t}\n\t}\n\n\tareSelectorsAndLabelsNotNil := func(selector *metav1.LabelSelector, labels map[string]string) bool {\n\t\treturn selector != nil && selector.MatchLabels != nil && labels != nil\n\t}\n\n\tif areSelectorsAndLabelsNotNil(policy.Spec.Selectors.VirtualMachineInstanceSelector, vmiLabels) {\n\t\tcountLabelsHelper(policy.Spec.Selectors.VirtualMachineInstanceSelector.MatchLabels, vmiLabels)\n\t}\n\n\tif !doesMatch {\n\t\treturn\n\t}\n\n\tif areSelectorsAndLabelsNotNil(policy.Spec.Selectors.NamespaceSelector, vmiLabels) {\n\t\tcountLabelsHelper(policy.Spec.Selectors.NamespaceSelector.MatchLabels, namespaceLabels)\n\t}\n\n\treturn\n}", "title": "" }, { "docid": "d33a808c364f5cb58a4d248c887c802c", "score": "0.5012515", "text": "func (c Counter) Count() int { return len(c.ParamCount) }", "title": "" }, { "docid": "ffe3842e25dbfd8fb53ce9859d3aa67a", "score": "0.49820465", "text": "func countMatchingPods(namespace string, selector labels.Selector, nodeInfo *schedulernodeinfo.NodeInfo) int {\n\tif nodeInfo.Pods() == nil || len(nodeInfo.Pods()) == 0 || selector.Empty() {\n\t\treturn 0\n\t}\n\tcount := 0\n\tfor _, pod := range nodeInfo.Pods() {\n\t\t// Ignore pods being deleted for spreading purposes\n\t\t// Similar to how it is done for SelectorSpreadPriority\n\t\tif namespace == pod.Namespace && pod.DeletionTimestamp == nil {\n\t\t\tif selector.Matches(labels.Set(pod.Labels)) {\n\t\t\t\tcount++\n\t\t\t}\n\t\t}\n\t}\n\treturn count\n}", "title": "" }, { "docid": "ab2cf63f37f7eb11f5e0023d64f88b04", "score": "0.49789906", "text": "func logStats(ctx context.Context, p *local.Pool, log *log.Logger, d time.Duration) {\n\titer := time.NewTicker(d)\n\tfor {\n\t\ttot, free := p.Resources(), p.Available()\n\t\tfreeFrac := free.Div(tot)\n\t\tvar usedPcts []string\n\t\tfor _, k := range []string{\"cpu\", \"mem\"} {\n\t\t\tusedPcts = append(usedPcts, fmt.Sprintf(\"%s: %.1f%%\", k, 100.0-math.Round(100*freeFrac[k])))\n\t\t}\n\t\tlog.Printf(\"Allocated resources %s; total %s free %s\", strings.Join(usedPcts, \" \"), tot, free)\n\n\t\tselect {\n\t\tcase <-ctx.Done():\n\t\t\treturn\n\t\tcase <-iter.C:\n\t\t}\n\t}\n}", "title": "" }, { "docid": "2401459c8513d9894b0a62f09573a3bb", "score": "0.49623057", "text": "func depsCount() {\n\targsWithoutProg := os.Args[1:]\n\tm := make(map[string]int)\n\tcount := crawlAndMap(argsWithoutProg[0], m)\n\tfmt.Printf(\"Number of build found: %d\\n\", count)\n\tdepsCount := 0\n\tfor key, value := range m {\n\t\t//if value > 15 {\n\t\tfmt.Println(\"Key:\", key, \"Value:\", value)\n\t\t//}\n\t\tdepsCount++\n\t}\n\tfmt.Printf(\"Number of distinct deps: %d\\n\", depsCount)\n}", "title": "" }, { "docid": "7ee8eef0c6dca7d53aa41509ec01494f", "score": "0.49570197", "text": "func Count(server, key string) error{\n\tinfo:=countInfoPool.Get().(*countInfo)\n\tinfo.reset(server,key)\n\tqueueTask.EnQueue(info)\n\treturn nil\n}", "title": "" }, { "docid": "7366dad9aa208707a1237b7c3d0a5d41", "score": "0.49546972", "text": "func TestGetObjectCount(t *testing.T) {\n\tpool := new_pool(t)\n\tdefer pool.Close()\n\n\tobject_active_count := 10\n\tobject_idle_count := 10\n\tobject_active := make([]*objectHolder, 10)\n object_idle := make([]*objectHolder, 10)\n\tfor idx := 0; idx < object_active_count; idx += 1 {\n\t\tobject_active[idx] = get_object_and_check(t, pool)\n\t}\n\n\tfor idx := 0; idx < object_idle_count; idx += 1 {\n\t\tobject_idle[idx] = get_object_and_check(t, pool)\n\n\t}\n for _, object_holder := range object_idle {\n\t\terr := pool.ReturnObject(object_holder)\n if err != nil {\n t.Fatalf(\"return object failed, err:%s\", err)\n }\n }\n\n\t// check\n\tif int(pool.GetIdleObjectCount()) != object_idle_count {\n\t\tt.Fatalf(\"idle object count invalid, expect:%d, get:%d\", object_idle_count, pool.GetIdleObjectCount())\n\t}\n\n\tif int(pool.GetObjectCount()) != object_idle_count + object_active_count {\n\t\tt.Fatalf(\"total object count invalid, expect:%d, get:%d\", object_idle_count + object_active_count, pool.GetObjectCount())\n\t}\n\n sleep_time, _ := time.ParseDuration(\"100ms\")\n time.Sleep(sleep_time)\n\tif int(server_active_conn_count) != object_idle_count + object_active_count {\n\t\tt.Fatalf(\"server_active_conn_count:%d, object_idle_count:%d, object_active_count:%d\",\n\t\t\tserver_active_conn_count, object_idle_count, object_active_count)\n\t}\n\n\t// clean up\n\tfor _, object_holder := range object_active {\n\t\tpool.ReturnObject(object_holder)\n\t}\n\n\tif int(pool.GetIdleObjectCount()) != object_idle_count + object_active_count {\n\t\tt.Fatalf(\"idle object count invalid, expect:%d, get:%d\", object_idle_count + object_active_count, pool.GetIdleObjectCount())\n\t}\n}", "title": "" }, { "docid": "a12c04fce9da113b413288e9c695d68c", "score": "0.4951708", "text": "func getMaxWorkerThreadsToReconcileCnsVolumeMetadata(ctx context.Context) int {\n\tlog := logger.GetLogger(ctx)\n\tworkerThreads := defaultMaxWorkerThreadsToProcessCnsVolumeMetadata\n\tif v := os.Getenv(\"WORKER_THREADS_VOLUME_METADATA\"); v != \"\" {\n\t\tif value, err := strconv.Atoi(v); err == nil {\n\t\t\tif value <= 0 {\n\t\t\t\tlog.Warnf(\"Maximum number of worker threads to run set in env variable WORKER_THREADS_VOLUME_METADATA %s is \"+\n\t\t\t\t\t\"less than 1, will use the default value %d\", v, defaultMaxWorkerThreadsToProcessCnsVolumeMetadata)\n\t\t\t} else if value > defaultMaxWorkerThreadsToProcessCnsVolumeMetadata {\n\t\t\t\tlog.Warnf(\"Maximum number of worker threads to run set in env variable WORKER_THREADS_VOLUME_METADATA %s \"+\n\t\t\t\t\t\"is greater than %d, will use the default value %d\",\n\t\t\t\t\tv, defaultMaxWorkerThreadsToProcessCnsVolumeMetadata, defaultMaxWorkerThreadsToProcessCnsVolumeMetadata)\n\t\t\t} else {\n\t\t\t\tworkerThreads = value\n\t\t\t\tlog.Debugf(\"Maximum number of worker threads to run is set to %d\", workerThreads)\n\t\t\t}\n\t\t} else {\n\t\t\tlog.Warnf(\"Maximum number of worker threads to run set in env variable WORKER_THREADS_VOLUME_METADATA %s \"+\n\t\t\t\t\"is invalid, will use the default value %d\", v, defaultMaxWorkerThreadsToProcessCnsVolumeMetadata)\n\t\t}\n\t} else {\n\t\tlog.Debugf(\"WORKER_THREADS_VOLUME_METADATA is not set. Picking the default value %d\",\n\t\t\tdefaultMaxWorkerThreadsToProcessCnsVolumeMetadata)\n\t}\n\treturn workerThreads\n}", "title": "" }, { "docid": "a3d193ee8eb36bc3e18db19e875741ab", "score": "0.49503806", "text": "func (r *RateLimiterTest) TestSuccessfulRateLimitingWithHigherNumOfOps(c *C) {\n\n\t// Max 10 Entires per second\n\tlimiterInfo := &RateLimitInfo{\n\t\tToken: \"uniqueToken\",\n\t\tMaxRequests: 500,\n\t\tTimeInterval: 1000,\n\t}\n\n\trateLimiter, _ := NewLimiter(limiterInfo)\n\n\t// Tracking Begin Time\n\tbeginTime := unixInMilliseconds()\n\n\t// Sync the outcome\n\tvar wg sync.WaitGroup\n\n\tvar successCount uint64\n\tvar totalCount uint64 = 1001\n\tvar i uint64\n\tfor ; i < totalCount; i++ {\n\t\t// Increment the waitgroup by each event\n\t\twg.Add(1)\n\n\t\t// Dispath all of these asynchronously\n\t\tgo func() {\n\t\t\tdefer wg.Done()\n\t\t\t// Attempt to enter the group\n\t\t\terr := rateLimiter.Enter()\n\t\t\tatomic.AddUint64(&successCount, 1)\n\t\t\tc.Assert(err, IsNil)\n\t\t}()\n\n\t}\n\n\t// Wait here until we're done\n\twg.Wait()\n\n\t// Match the counts to make sure all completed\n\tc.Assert(successCount, Equals, totalCount)\n\n\t// Tracking End Time\n\t// This should be slightly over 2 seconds\n\tendTime := unixInMilliseconds()\n\ttotalTime := endTime - beginTime\n\tc.Assert(totalTime > 2000, Equals, true)\n\tc.Assert(totalTime < 3000, Equals, true)\n}", "title": "" }, { "docid": "f0ecdc6779a89fcde88d0b9c41c94aa6", "score": "0.49497896", "text": "func (m *metricSaphanaServiceThreadCount) updateCapacity() {\n\tif m.data.Sum().DataPoints().Len() > m.capacity {\n\t\tm.capacity = m.data.Sum().DataPoints().Len()\n\t}\n}", "title": "" }, { "docid": "649962162d94833915f4735fdc481686", "score": "0.49488956", "text": "func Count(c *cli.Context) error {\n\t// find device id and subsystem id of local GPU device\n\tvgpuDevices, err := GetVGPUDevices()\n\tif err != nil {\n\t\treturn fmt.Errorf(\"unable to search for vGPU devices on host: %v\", err)\n\t}\n\n\tfmt.Printf(\"NUM_OF_VGPU_DEVICES=%d\\n\", len(vgpuDevices))\n\treturn nil\n}", "title": "" }, { "docid": "dda09ec87b11825a373576a873341b9e", "score": "0.49343383", "text": "func GetNumberOfCoresFromCPUInfo(readBytes *bytes.Buffer) int {\n\tcount := 0\n\tfor _, str := range strings.Split(readBytes.String(), \"\\n\") {\n\t\tif len(str) >= 8 {\n\t\t\tif str[:9] == \"processor\" {\n\t\t\t\tcount++\n\t\t\t}\n\t\t} else {\n\t\t\tcontinue\n\t\t}\n\t}\n\treturn count\n}", "title": "" }, { "docid": "06f9b018dc9f20e9d59d3c03113784e9", "score": "0.49339622", "text": "func checkCPUCount(mgr HardwareClassificationManager, cpu bmh.CPU, expectedCPU *hwcc.Cpu, bmhName string) bool {\n\tif expectedCPU == nil {\n\t\treturn true\n\t}\n\tif expectedCPU.MaximumCount > 0 {\n\t\texpectedMaxCPUCount := expectedCPU.MaximumCount\n\t\tmgr.Log.Info(\"Maximum CPU Count\", \"BareMetalHost\", bmhName, \"Expected\", expectedMaxCPUCount, \"Actual\", cpu.Count)\n\t\tif expectedMaxCPUCount < cpu.Count {\n\t\t\tmgr.Log.Info(\"CPU Count Mismatched\", \"BareMetalHost\", bmhName)\n\t\t\treturn false\n\t\t}\n\t}\n\tif expectedCPU.MinimumCount > 0 {\n\t\texpectedMinCPUCount := expectedCPU.MinimumCount\n\t\tmgr.Log.Info(\"Minimum CPU Count\", \"BareMetalHost\", bmhName, \"Expected\", expectedMinCPUCount, \"Actual\", cpu.Count)\n\t\tif expectedMinCPUCount > cpu.Count {\n\t\t\tmgr.Log.Info(\"CPU Count Mismatched\", \"BareMetalHost\", bmhName)\n\t\t\treturn false\n\t\t}\n\t}\n\tif expectedCPU.MaximumSpeedMHz > 0 {\n\t\texpectedMaxSpeedHz := bmh.ClockSpeed(expectedCPU.MaximumSpeedMHz)\n\t\tmgr.Log.Info(\"Maximum CPU ClockSpeed\", \"BareMetalHost\", bmhName, \"Expected\", expectedMaxSpeedHz, \"Actual\", cpu.ClockMegahertz)\n\t\tif expectedMaxSpeedHz < cpu.ClockMegahertz {\n\t\t\tmgr.Log.Info(\"CPU ClockSpeed Mismatched\", \"BareMetalHost\", bmhName)\n\t\t\treturn false\n\t\t}\n\t}\n\tif expectedCPU.MinimumSpeedMHz > 0 {\n\t\texpectedMinSpeedHz := bmh.ClockSpeed(expectedCPU.MinimumSpeedMHz)\n\t\tmgr.Log.Info(\"Minimum CPU ClockSpeed\", \"BareMetalHost\", bmhName, \"Expected\", expectedMinSpeedHz, \"Actual\", cpu.ClockMegahertz)\n\t\tif expectedMinSpeedHz > cpu.ClockMegahertz {\n\t\t\tmgr.Log.Info(\"CPU ClockSpeed Mismatched\", \"BareMetalHost\", bmhName)\n\t\t\treturn false\n\t\t}\n\t}\n\treturn true\n}", "title": "" }, { "docid": "959cdcd852b1134f808c0a3e6369ff16", "score": "0.4932515", "text": "func (p *Pool) ActiveCount() int {\n\tp.guard.Lock()\n\tdefer p.guard.Unlock()\n\treturn len(p.workers) + int(atomic.LoadInt64(&p.spawnCount))\n}", "title": "" }, { "docid": "60e84214a40cc46d735fc113e8d83771", "score": "0.49208942", "text": "func calcBlocks(n, maxThreads int) int { return (n + maxThreads - 1) / maxThreads }", "title": "" }, { "docid": "cbc9f552c8f05d60a28c82001d111c7b", "score": "0.49145424", "text": "func computeWorkerMatch(w *Worker, requests requestList, mf matcher) []matchListItem {\n\tmatches := make([]matchListItem, 0, requests.Len())\n\tfor current := requests.Head(); current.Element != nil; current = current.Next() {\n\t\tm := mf(w, current.Value())\n\t\tif m.canMatch {\n\t\t\tmatches = append(matches, matchListItem{matchLevel: m, request: current.Value(), node: current})\n\t\t}\n\t}\n\tsort.SliceStable(matches, func(i, j int) bool {\n\t\treturn matches[i].quality > matches[j].quality\n\t})\n\treturn matches\n}", "title": "" }, { "docid": "d28f2f56e510ca315900cf07f07c3e76", "score": "0.48995847", "text": "func CountRedistributions(row []int) (steps int) {\n\toptions := make(map[string]bool)\n\toptions[arrayToString(row, \".\")] = true\n\n\tfor {\n\t\tRedistributeRow(row)\n\t\tsteps++\n\t\tasString := arrayToString(row, \".\")\n\t\tif options[asString] {\n\t\t\tbreak\n\t\t}\n\t\toptions[asString] = true\n\t}\n\n\treturn\n}", "title": "" }, { "docid": "a6f4fc0d58d08d5e54f925ff44b8de7a", "score": "0.4895841", "text": "func howManyThreads(threads int) int {\n\tmaxThreads := runtime.GOMAXPROCS(0)\n\tif threads == 0 {\n\t\treturn 1\n\t} else if threads > maxThreads {\n\t\tlog.Warnf(\"%d threads set too high, setting to system max, %d\", threads, maxThreads)\n\t\treturn maxThreads\n\t}\n\treturn threads\n}", "title": "" }, { "docid": "172d15c7d1d25933bf3b75a552678324", "score": "0.48865893", "text": "func (ps *PoolSet) getPoolCapacity(pool string) int64 {\n\tp := ps.pools[pool]\n\tn := p.shared.Size() + p.pinned.Size()\n\n\treturn int64(1000 * n)\n}", "title": "" }, { "docid": "9a3308d111bf9692f6e4ba0de12f2bbe", "score": "0.48838794", "text": "func TestCountNumOfMatchesTwo(t *testing.T) {\n\ts1 := []int{1, 2, 3}\n\ts2 := []int{1, 2, 6}\n\tn := CountNumOfMatches(s1, s2)\n\tif n != 2 {\n\t\tt.Error(\"For\", \"number of matches\",\n\t\t\t\"expected\", \"0\",\n\t\t\t\"got\", n)\n\t}\n}", "title": "" }, { "docid": "450e02f7e39ed1777a16bcd31588b966", "score": "0.48782375", "text": "func execCount(_ int, p *gop.Context) {\n\targs := p.GetArgs(2)\n\tret := bytes.Count(args[0].([]byte), args[1].([]byte))\n\tp.Ret(2, ret)\n}", "title": "" }, { "docid": "10201fd6390611beba450e44545418be", "score": "0.4865849", "text": "func IPMaskCount(m net.IPMask) int {\n\tones, bits := m.Size()\n\treturn 1 << (uint(bits - ones))\n}", "title": "" }, { "docid": "a0bb58cd21dcd301a89ca37df665754e", "score": "0.48645744", "text": "func main() {\n\t//we dont ave to set gomaxpro, by default 1\n\tfmt.Println(\"CPUs:\", runtime.NumCPU())\n\tfmt.Println(\"Goroutines: \", runtime.NumGoroutine())\n\tcounter := 0\n\tconst gs = 100\n\tvar wg sync.WaitGroup\n\twg.Add(gs)\n\n\tvar mu sync.Mutex\n\n\tfor i := 0; i < gs; i++ {\n\t\tgo func() {\n\t\t\tmu.Lock()\n\t\t\tv := counter //v has this scope only so, every go fct will be accessing different v but counter will be the same memory area\n\t\t\t//time.Sleep(time.Second) //if you want to send it to sleep\n\t\t\truntime.Gosched() //hey, go and run something else if you want\n\t\t\tv++\n\t\t\tcounter = v\n\t\t\tmu.Unlock() //this code got lock down\n\t\t\twg.Done()\n\t\t}()\n\t\tfmt.Println(\"Goroutines:\", runtime.NumGoroutine())\n\t}\n\twg.Wait()\n\tfmt.Println(\"Goroutines:\", runtime.NumGoroutine())\n\tfmt.Println(\"count: \", counter)\n}", "title": "" }, { "docid": "e2d9250e496a619bc8715880cd5bffc5", "score": "0.4855777", "text": "func (c Config) MaxCount() int { return 0 }", "title": "" }, { "docid": "e0d9dc886787493b9fecba6cb666533e", "score": "0.48494333", "text": "func (o NodePoolOutput) NodeCount() pulumi.IntOutput {\n\treturn o.ApplyT(func(v *NodePool) pulumi.IntOutput { return v.NodeCount }).(pulumi.IntOutput)\n}", "title": "" }, { "docid": "b49ea07a4b65d83280639aa5ffdcef54", "score": "0.48462254", "text": "func (i *Index) availableThreads() int {\n\tn := runtime.GOMAXPROCS(0)\n\tif len(i.partitions) < n {\n\t\treturn len(i.partitions)\n\t}\n\treturn n\n}", "title": "" }, { "docid": "0ac59499b292122ad6bbb835e98b3485", "score": "0.48457035", "text": "func (mp *mempool) Count() int {\n\tmp.mtx.RLock()\n\tdefer mp.mtx.RUnlock()\n\tcount := len(mp.pool)\n\n\treturn count\n}", "title": "" }, { "docid": "98fcb420c8805daf0c911eb3b6dfeb3d", "score": "0.48336485", "text": "func CountRedistributionsSingle(row []int) int {\n\tsteps := 0\n\toptions := make(map[string]int)\n\toptions[arrayToString(row, \".\")] = steps\n\n\tfor {\n\t\tRedistributeRow(row)\n\t\tsteps++\n\t\tasString := arrayToString(row, \".\")\n\t\tif _, ok := options[asString]; ok {\n\t\t\treturn steps - options[asString]\n\t\t}\n\t\toptions[asString] = steps\n\t}\n}", "title": "" }, { "docid": "51139230eb4a53065c33aacfa2d19da4", "score": "0.48330978", "text": "func main() {\n\tstart := time.Now()\n\tvar run func(ch chan struct{})\n\tvar count int\n\trun = func(ch chan struct{}) {\n\t\tcount++\n\t\tfor {\n\t\t\t// Number of goroutines we counted 1104686\n\t\t\t// panic: too many concurrent operations on a single file or socket (max 1048575)\n\t\t\t// fmt.Printf(\"%d %d\\n\", time.Since(start), count)\n\t\t\tch := make(chan struct{})\n\t\t\tgo run(ch)\n\t\t}\n\t}\n\tticker := time.NewTicker(5 * time.Second)\n\tfor {\n\t\tselect {\n\t\tcase <-ticker.C:\n\t\t\tfmt.Printf(\"%d %d\\n\", time.Since(start), count)\n\t\tdefault:\n\t\t\tch := make(chan struct{})\n\t\t\tgo run(ch)\n\t\t}\n\t}\n}", "title": "" }, { "docid": "85efa5df6a52724bfd4270425185847d", "score": "0.48302937", "text": "func (s *Rest) Count(w http.ResponseWriter, r *http.Request) {\n\tvar count int\n\ts.mu.Lock()\n\tfor _, limiter := range s.users {\n\t\tlimiterCopy := *limiter // get a copy to avoid one more countable request below\n\t\tif !limiterCopy.Allow() {\n\t\t\tcount++\n\t\t}\n\t}\n\ts.mu.Unlock()\n\trender.PlainText(w, r, strconv.Itoa(count))\n}", "title": "" }, { "docid": "e334a781f1eaa3c45228b5df5a49eef6", "score": "0.48268247", "text": "func findMatches() []Result {\n\t// local variables\n\ti := 0\n\tr := Result{} // empty result object\n\tvar r2 []Result // array of result objects\n\tj := len(validurls)\n\n\tfmt.Print(\"\\nProgress: \")\n\t// iterate urls\n\tfor _, url := range validurls {\n\t\t// iterate pcres\n\t\tk := 0\n\t\tif len(url) > 1000 {\n\t\t\tr.url = url[:1000]\n\t\t\tr.pcrestring = \"NA\"\n\t\t\tr.action = \"SKIPPED - TOO LONG\"\n\t\t\tr2 = append(r2, r)\n\t\t} else {\n\t\t\tfor _, p := range validpcres {\n\t\t\t\tk++\n\t\t\t\tm := pcre.MustCompile(p, 0).MatcherString(url, 0)\n\n\t\t\t\tif m.Matches() {\n\t\t\t\t\t// add result to result array\n\t\t\t\t\tr.url = url\n\t\t\t\t\tr.pcrestring = p\n\t\t\t\t\tr.action = \"FOUND\"\n\t\t\t\t\t//fmt.Println(p,\"-->\",url)\n\t\t\t\t\tr2 = append(r2, r)\t\t\t\t\t\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\tdisplayCounter(i,j)\n\t\ti++\t\t\n\t}\n\treturn r2 // returning list of matching URLs-PCREs\n}", "title": "" }, { "docid": "2a4fabfb9167147a2501e195791d51a2", "score": "0.48258868", "text": "func (e *Exporter) Collect(ch chan<- prometheus.Metric) {\n\tlogrus.Infof(\"Scraping core and metrics api for metrics\")\n\tpodCounts = make(map[string]int)\n\t// var totalCPU, totalMemory float64\n\tvar wg = sync.WaitGroup{}\n\n\t// Polling core API\n\tpods, err = clientset.CoreV1().Pods(watchNamespace).List(metav1.ListOptions{})\n\tif err != nil {\n\t\tlogrus.Error(err.Error())\n\t}\n\n\tpodCountNamespace := make(chan string)\n\n\tgetPodDefinedresource := func(pod corev1.Pod) {\n\t\tdefer wg.Done()\n\t\tfor _, container := range pod.Spec.Containers {\n\t\t\tcpuRequestFloat, _ := strconv.ParseFloat(container.Resources.Requests.Cpu().AsDec().String(), 64)\n\t\t\tch <- prometheus.MustNewConstMetric(e.cpuRequest, prometheus.GaugeValue, cpuRequestFloat, pod.Name, container.Name, pod.Namespace, fmt.Sprintf(\"%v \", pod.Status.Phase))\n\n\t\t\tmemoryRequestFloat, _ := strconv.ParseFloat(container.Resources.Requests.Memory().AsDec().String(), 64)\n\t\t\tch <- prometheus.MustNewConstMetric(e.memoryRequest, prometheus.GaugeValue, memoryRequestFloat, pod.Name, container.Name, pod.Namespace, fmt.Sprintf(\"%v \", pod.Status.Phase))\n\n\t\t\tcpuLimitFloat, _ := strconv.ParseFloat(container.Resources.Limits.Cpu().AsDec().String(), 64)\n\t\t\tch <- prometheus.MustNewConstMetric(e.cpuLimit, prometheus.GaugeValue, cpuLimitFloat, pod.Name, container.Name, pod.Namespace, fmt.Sprintf(\"%v \", pod.Status.Phase))\n\n\t\t\tmemoryLimitFloat, _ := strconv.ParseFloat(container.Resources.Limits.Memory().AsDec().String(), 64)\n\t\t\tch <- prometheus.MustNewConstMetric(e.memoryLimit, prometheus.GaugeValue, memoryLimitFloat, pod.Name, container.Name, pod.Namespace, fmt.Sprintf(\"%v \", pod.Status.Phase))\n\t\t}\n\t\tpodCountNamespace <- pod.Namespace\n\t}\n\n\tfor _, pod := range pods.Items {\n\t\twg.Add(1)\n\t\tgo getPodDefinedresource(pod)\n\t}\n\n\tgo setPodCount(podCountNamespace)\n\n\tpodMetrics, err := metricClientSet.MetricsV1beta1().PodMetricses(watchNamespace).List(metav1.ListOptions{})\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\tvar podMetric metricsTypes.PodMetrics\n\n\tgetPodUsageMetrics := func(pod metricsTypes.PodMetrics) {\n\t\tdefer wg.Done()\n\t\tfor _, container := range pod.Containers {\n\t\t\tcpuQuantityDec := container.Usage.Cpu().AsDec().String()\n\t\t\tcpuUsageFloat, _ := strconv.ParseFloat(cpuQuantityDec, 64)\n\t\t\tch <- prometheus.MustNewConstMetric(e.cpuUsage, prometheus.GaugeValue, cpuUsageFloat, pod.Name, container.Name, pod.Namespace)\n\n\t\t\tmemoryQuantityDec := container.Usage.Memory().AsDec().String()\n\t\t\tmemoryUsageFloat, _ := strconv.ParseFloat(memoryQuantityDec, 64)\n\t\t\tch <- prometheus.MustNewConstMetric(e.memoryUsage, prometheus.GaugeValue, memoryUsageFloat, pod.Name, container.Name, pod.Namespace)\n\t\t}\n\t}\n\n\tfor _, podMetric = range podMetrics.Items {\n\t\twg.Add(1)\n\t\tgo getPodUsageMetrics(podMetric)\n\t}\n\n\tgetPosNamespaceCount := func(namespace string, count int) {\n\t\tdefer wg.Done()\n\t\tch <- prometheus.MustNewConstMetric(e.totalPods, prometheus.CounterValue, float64(count), namespace)\n\t}\n\n\tfor namespace, count := range podCounts {\n\t\twg.Add(1)\n\t\tgo getPosNamespaceCount(namespace, count)\n\t}\n\twg.Wait()\n\tclose(podCountNamespace)\n}", "title": "" }, { "docid": "d942a133f73fa8809ca8e8b29bed8af6", "score": "0.4823299", "text": "func getTotalGpusCount(instanceType *instancetypes.Details) *int64 {\n\tgpusInfo := instanceType.GpuInfo\n\n\tif gpusInfo == nil {\n\t\treturn nil\n\t}\n\n\ttotal := aws.Int64(0)\n\tfor _, gpu := range gpusInfo.Gpus {\n\t\ttotal = aws.Int64(*total + *gpu.Count)\n\t}\n\n\treturn total\n}", "title": "" }, { "docid": "bf2555dc4080488d4c867378882b46ab", "score": "0.48225957", "text": "func (s *ContentBackChain) hashCount(APIstub shim.ChaincodeStubInterface, args []string) sc.Response {\n hashCountAsBytes, _ := APIstub.GetState(NUMBER_OF_HASHES)\n return shim.Success(hashCountAsBytes)\n}", "title": "" }, { "docid": "a9fe8e742233f3b52fcd07d21dfa5771", "score": "0.4819931", "text": "func (m *MysqlDriver) GetMatchesNum() (int64, error) {\n\treturn m.conn.Count(&model.Match{})\n}", "title": "" }, { "docid": "89935c1d42dfd7d2e308694126aa95e6", "score": "0.481781", "text": "func (m *CPUMiner) NumWorkers() int32 {\n\treturn int32(m.numWorkers.Load())\n}", "title": "" }, { "docid": "b0db6f69c47d8617818c15095d7d88f2", "score": "0.4817154", "text": "func main() {\n\tt := time.Now()\n\twg := sync.WaitGroup{}\n\n\twg.Add(1)\n\tgo func() {\n\t\tfor n := 0; n < 1000000000; n++ {\n\t\t}\n\t\twg.Done()\n\t}()\n\n\twg.Wait()\n\tfmt.Println(\"counted to 1000000000 in\", time.Since(t))\n}", "title": "" }, { "docid": "9bbbcc621bf477aa751912f077c84749", "score": "0.48168004", "text": "func (ps *PoolSet) getPoolUsage(pool string) int64 {\n\tp := ps.pools[pool]\n\n\treturn int64(1000*int64(p.pinned.Size()) + p.used)\n}", "title": "" }, { "docid": "7d6fdc16f6abd21ddefcf111cba81bfc", "score": "0.4812589", "text": "func mmxCPUSupport() bool", "title": "" }, { "docid": "4e094ee768d3b2298027d84b3239d599", "score": "0.4811429", "text": "func (m channelmodelmap) Count() int {\n\tcount := 0\n\tfor i := 0; i < channelModelShardCount; i++ {\n\t\tshard := m[i]\n\t\tshard.RLock()\n\t\tcount += len(shard.items)\n\t\tshard.RUnlock()\n\t}\n\treturn count\n}", "title": "" }, { "docid": "6df5a55d3cb7a6efbb8efede5d8d77be", "score": "0.48096195", "text": "func LogicalProcessors() int {\n\tcount, err := cpu.Counts(true)\n\tif err != nil {\n\t\treturn 0\t\t// Return 0 if there is an error\n\t}\n\treturn count\n}", "title": "" }, { "docid": "0b91fa0f354220e606fc973648ae6711", "score": "0.48096", "text": "func (c Crawler) ProxyPoolAmount() int {\r\n\treturn len(c.proxyURLPool)\r\n}", "title": "" }, { "docid": "3b24b14c34bf06d2a46c139ddf822c1c", "score": "0.4808321", "text": "func (s *StatisticManager) recordConnectPoolInuseCount(namespace string, slice string, addr string, count int64) {\n\tstatsKey := []string{s.clusterName, namespace, slice, addr}\n\ts.backendConnectPoolInUseCounts.Set(statsKey, count)\n}", "title": "" }, { "docid": "89dd33927050ec8ae84532551533156e", "score": "0.47929087", "text": "func (p *simpleResourcePool) NumIdle() int {\n\tp.mutex.Lock()\n\tdefer p.mutex.Unlock()\n\treturn len(p.idleHandles)\n}", "title": "" }, { "docid": "96722f971f12951212587be659ac5d69", "score": "0.47860286", "text": "func nvidiaHookCount(hooks *specs.Hooks) int {\n\tif hooks == nil {\n\t\treturn 0\n\t}\n\n\tcount := 0\n\tfor _, hook := range hooks.Prestart {\n\t\tif strings.Contains(hook.Path, nvidiaHook) {\n\t\t\tcount++\n\t\t}\n\t}\n\treturn count\n}", "title": "" }, { "docid": "3c3bb1b714e1393a73c2bb1283bef7a9", "score": "0.47838804", "text": "func calculateCPUCoreUsage(pidStatLines []*pidStatLine) map[int]float64 {\n\tresult := map[int]float64{}\n\tfor _, entry := range pidStatLines {\n\t\t// exclude 0 utilization to exclude unused cores\n\t\tif entry.TID == 0 || entry.CPU <= 0.0 {\n\t\t\tcontinue\n\t\t}\n\t\tif _, ok := result[entry.Core]; !ok {\n\t\t\tresult[entry.Core] = 0.0\n\t\t}\n\t\tresult[entry.Core] += entry.CPU\n\t}\n\n\treturn result\n}", "title": "" }, { "docid": "384b138fb72d610b4cc8c100a9b49bc6", "score": "0.47829202", "text": "func getCores() int {\n\t// NumOfPhysicalCores = NumOfVirtualCores / 2\n\treturn runtime.NumCPU() / 2\n}", "title": "" }, { "docid": "31ff252a95dbb8c98ab279b81b78a242", "score": "0.47759786", "text": "func initializeControllerWorkerCounts() {\n\tif Pgo.Pgo.ConfigMapWorkerCount == nil {\n\t\tlog.Debugf(\"ConfigMapWorkerCount not set, defaulting to %d worker(s)\",\n\t\t\tconfig.DefaultConfigMapWorkerCount)\n\t\tdefaultVal := int(config.DefaultConfigMapWorkerCount)\n\t\tPgo.Pgo.ConfigMapWorkerCount = &defaultVal\n\t} else {\n\t\tlog.Debugf(\"ConfigMapWorkerCount is set, using %d worker(s)\",\n\t\t\t*Pgo.Pgo.ConfigMapWorkerCount)\n\t}\n\n\tif Pgo.Pgo.NamespaceWorkerCount == nil {\n\t\tlog.Debugf(\"NamespaceWorkerCount not set, defaulting to %d worker(s)\",\n\t\t\tconfig.DefaultNamespaceWorkerCount)\n\t\tdefaultVal := int(config.DefaultNamespaceWorkerCount)\n\t\tPgo.Pgo.NamespaceWorkerCount = &defaultVal\n\t} else {\n\t\tlog.Debugf(\"NamespaceWorkerCount is set, using %d worker(s)\",\n\t\t\t*Pgo.Pgo.NamespaceWorkerCount)\n\t}\n\n\tif Pgo.Pgo.PGClusterWorkerCount == nil {\n\t\tlog.Debugf(\"PGClusterWorkerCount not set, defaulting to %d worker(s)\",\n\t\t\tconfig.DefaultPGClusterWorkerCount)\n\t\tdefaultVal := int(config.DefaultPGClusterWorkerCount)\n\t\tPgo.Pgo.PGClusterWorkerCount = &defaultVal\n\t} else {\n\t\tlog.Debugf(\"PGClusterWorkerCount is set, using %d worker(s)\",\n\t\t\t*Pgo.Pgo.PGClusterWorkerCount)\n\t}\n\n\tif Pgo.Pgo.PGReplicaWorkerCount == nil {\n\t\tlog.Debugf(\"PGReplicaWorkerCount not set, defaulting to %d worker(s)\",\n\t\t\tconfig.DefaultPGReplicaWorkerCount)\n\t\tdefaultVal := int(config.DefaultPGReplicaWorkerCount)\n\t\tPgo.Pgo.PGReplicaWorkerCount = &defaultVal\n\t} else {\n\t\tlog.Debugf(\"PGReplicaWorkerCount is set, using %d worker(s)\",\n\t\t\t*Pgo.Pgo.PGReplicaWorkerCount)\n\t}\n\n\tif Pgo.Pgo.PGTaskWorkerCount == nil {\n\t\tlog.Debugf(\"PGTaskWorkerCount not set, defaulting to %d worker(s)\",\n\t\t\tconfig.DefaultPGTaskWorkerCount)\n\t\tdefaultVal := int(config.DefaultPGTaskWorkerCount)\n\t\tPgo.Pgo.PGTaskWorkerCount = &defaultVal\n\t} else {\n\t\tlog.Debugf(\"PGTaskWorkerCount is set, using %d worker(s)\",\n\t\t\t*Pgo.Pgo.PGTaskWorkerCount)\n\t}\n}", "title": "" }, { "docid": "2a4d892cabab5c1464560c53c41113a3", "score": "0.47759306", "text": "func _TestBenchmarkPlayersCount(t *testing.T) {\n\tuseEncryption = false\n\n\tsession.WorldSocketCreator = func(logger *zerolog.Logger, addr string) (sockets.Socket, error) {\n\t\tq := connmock.NewDataQueue(\n\t\t\tfalse,\n\t\t\ttime.Millisecond*20,\n\t\t\t[]byte{0, 50, 221, 0, 217, 54, 189, 41, 48, 241, 0, 16, 11, 155, 68, 156, 142, 141, 197, 27, 71, 166, 65, 56, 0, 0, 0, 0, 0, 0, 0, 0, 49, 7, 0, 0, 1, 0, 0, 0, 152, 185, 154, 68, 244, 111, 141, 197, 200, 202, 165, 65},\n\t\t)\n\n\t\tq.SetLoopedPart(\n\t\t\t[]byte{3, 123, 111, 3, 2, 4, 1, 0, 6, 0, 192, 87, 1, 0, 56, 74, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 5, 1, 0, 6, 1, 16, 33, 1, 0, 166, 64, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 105, 0, 0, 0, 1, 0, 0, 1, 3, 0, 0, 0, 2, 0, 0, 1, 3, 0, 0, 0, 4, 0, 0, 1, 3, 0, 0, 0, 6, 0, 0, 1, 3, 0, 0, 0, 8, 0, 0, 1, 3, 0, 0, 0, 10, 0, 0, 1, 3, 0, 0, 0, 12, 0, 0, 1, 3, 0, 0, 0, 14, 0, 0, 1, 3, 0, 0, 0, 16, 0, 0, 1, 3, 0, 0, 0, 18, 0, 0, 1, 3, 0, 0, 0, 20, 0, 0, 1, 3, 0, 0, 0, 22, 0, 0, 1, 3, 0, 0, 0, 24, 0, 0, 1, 3, 0, 0, 0, 26, 0, 0, 1, 3, 0, 0, 0, 28, 0, 0, 1, 3, 0, 0, 0, 30, 0, 0, 1, 3, 0, 0, 0, 32, 0, 0, 1, 3, 0, 0, 0, 34, 0, 0, 1, 3, 0, 0, 0, 36, 0, 0, 1, 3, 0, 0, 0, 38, 0, 0, 1, 3, 0, 0, 0, 40, 0, 0, 1, 3, 0, 0, 0, 136, 0, 0, 1, 3, 0, 0, 0, 137, 0, 0, 1, 3, 0, 0, 0, 140, 0, 0, 1, 3, 0, 0, 0, 146, 0, 0, 1, 3, 0, 0, 0, 163, 0, 0, 1, 3, 0, 0, 0, 164, 0, 0, 1, 3, 0, 0, 0, 165, 0, 0, 1, 3, 0, 0, 0, 170, 0, 0, 1, 254, 3, 0, 0, 171, 0, 0, 1, 254, 3, 0, 0, 203, 0, 0, 1, 2, 0, 0, 0, 206, 0, 0, 1, 2, 0, 0, 0, 207, 0, 0, 1, 2, 0, 0, 0, 208, 0, 0, 1, 2, 0, 0, 0, 209, 0, 0, 1, 2, 0, 0, 0, 214, 0, 0, 1, 2, 0, 0, 0, 216, 0, 0, 1, 2, 0, 0, 0, 220, 0, 0, 1, 2, 0, 0, 0, 245, 0, 0, 1, 6, 0, 0, 0, 251, 0, 0, 1, 2, 0, 0, 0, 253, 0, 0, 1, 2, 0, 0, 0, 255, 0, 0, 1, 2, 0, 0, 0, 16, 1, 0, 1, 3, 0, 0, 0, 17, 1, 0, 1, 3, 0, 0, 0, 18, 1, 0, 1, 3, 0, 0, 0, 20, 1, 0, 1, 3, 0, 0, 0, 29, 1, 0, 1, 2, 0, 0, 0, 30, 1, 0, 1, 2, 0, 0, 0, 31, 1, 0, 1, 2, 0, 0, 0, 32, 1, 0, 1, 2, 0, 0, 0, 46, 0, 0, 2, 2, 0, 0, 0, 159, 0, 0, 2, 2, 0, 0, 0, 223, 0, 0, 2, 2, 0, 0, 0, 224, 0, 0, 2, 2, 0, 0, 0, 227, 0, 0, 2, 2, 0, 0, 0, 237, 0, 0, 2, 2, 0, 0, 0, 238, 0, 0, 2, 2, 0, 0, 0, 239, 0, 0, 2, 2, 0, 0, 0, 240, 0, 0, 2, 2, 0, 0, 0, 243, 0, 0, 2, 2, 0, 0, 0, 244, 0, 0, 2, 2, 0, 0, 0, 246, 0, 0, 2, 2, 0, 0, 0, 247, 0, 0, 2, 2, 0, 0, 0, 248, 0, 0, 2, 2, 0, 0, 0, 250, 0, 0, 2, 2, 0, 0, 0, 1, 1, 0, 2, 2, 0, 0, 0, 23, 1, 0, 2, 2, 0, 0, 0, 24, 1, 0, 2, 2, 0, 0, 0, 37, 1, 0, 2, 2, 0, 0, 0, 38, 1, 0, 2, 2, 0, 0, 0, 178, 0, 0, 5, 1, 4, 0, 0, 179, 0, 0, 5, 1, 4, 0, 0, 180, 0, 0, 5, 1, 4, 0, 0, 181, 0, 0, 5, 1, 4, 0, 0, 182, 0, 0, 5, 254, 3, 0, 0, 183, 0, 0, 5, 254, 3, 0, 0, 184, 0, 0, 5, 1, 4, 0, 0, 185, 0, 0, 5, 1, 4, 0, 0, 186, 0, 0, 5, 1, 4, 0, 0, 187, 0, 0, 5, 1, 4, 0, 0, 188, 0, 0, 5, 1, 4, 0, 0, 189, 0, 0, 5, 1, 4, 0, 0, 190, 0, 0, 5, 1, 4, 0, 0, 191, 0, 0, 5, 1, 4, 0, 0, 192, 0, 0, 5, 1, 4, 0, 0, 201, 0, 0, 5, 254, 3, 0, 0, 205, 0, 0, 5, 2, 0, 0, 0, 210, 0, 0, 5, 2, 0, 0, 0, 211, 0, 0, 5, 2, 0, 0, 0, 212, 0, 0, 5, 2, 0, 0, 0, 213, 0, 0, 5, 2, 0, 0, 0, 215, 0, 0, 5, 2, 0, 0, 0, 217, 0, 0, 5, 2, 0, 0, 0, 219, 0, 0, 5, 2, 0, 0, 0, 221, 0, 0, 5, 2, 0, 0, 0, 226, 0, 0, 5, 2, 0, 0, 0, 241, 0, 0, 5, 2, 0, 0, 0, 242, 0, 0, 5, 2, 0, 0, 0, 249, 0, 0, 5, 6, 0, 0, 0, 252, 0, 0, 5, 2, 0, 0, 0, 254, 0, 0, 5, 2, 0, 0, 0, 0, 1, 0, 5, 2, 0, 0, 0, 2, 1, 0, 6, 3, 0, 0, 0, 3, 1, 0, 6, 3, 0, 0, 0, 6, 1, 0, 6, 2, 0, 0, 0},\n\t\t\t[]byte{0, 50, 221, 0, 217, 54, 189, 41, 48, 241, 0, 16, 11, 155, 68, 156, 142, 141, 197, 27, 71, 166, 65, 56, 0, 0, 0, 0, 0, 0, 0, 0, 49, 7, 0, 0, 1, 0, 0, 0, 152, 185, 154, 68, 244, 111, 141, 197, 200, 202, 165, 65},\n\t\t\t[]byte{0, 50, 221, 0, 217, 52, 189, 41, 48, 241, 0, 40, 240, 156, 68, 184, 139, 141, 197, 125, 93, 166, 65, 22, 6, 0, 0, 0, 0, 0, 0, 0, 238, 4, 0, 0, 1, 0, 0, 0, 120, 249, 156, 68, 156, 114, 141, 197, 143, 221, 166, 65},\n\t\t)\n\n\t\tm := q.Mock()\n\n\t\treturn worldsocket.NewWorldSocketWithConnection(logger, m)\n\t}\n\n\tgorBefore := runtime.NumGoroutine()\n\tstart := time.Now()\n\twg := sync.WaitGroup{}\n\tfor i := 0; i < 15000; i++ {\n\t\twg.Add(1)\n\t\tgo func() {\n\t\t\tsimulateOnePlayer(t, 300)\n\t\t\twg.Done()\n\t\t}()\n\t}\n\twg.Wait()\n\n\tassert.Less(t, int64(time.Since(start)), int64(time.Second*25))\n\ttime.Sleep(time.Millisecond * 300)\n\tfmt.Println(\"Goroutines delta:\", runtime.NumGoroutine()-gorBefore)\n}", "title": "" }, { "docid": "9cdf2064abd1ffcb2405c551a5ae3f53", "score": "0.47752795", "text": "func (o InstanceAcceleratorConfigOutput) CoreCount() pulumi.IntOutput {\n\treturn o.ApplyT(func(v InstanceAcceleratorConfig) int { return v.CoreCount }).(pulumi.IntOutput)\n}", "title": "" }, { "docid": "44f9d16be383aacdb4d515993d4de344", "score": "0.47742805", "text": "func benchmarkGetNodes(ctx context.Context, b *testing.B, svc services.Presence, nodeCount int) {\n\tvar nodes []types.Server\n\tvar err error\n\tfor i := 0; i < b.N; i++ {\n\t\tnodes, err = svc.GetNodes(ctx, apidefaults.Namespace)\n\t\trequire.NoError(b, err)\n\t}\n\t// do *something* with the loop result. probably unnecessary since the loop\n\t// contains I/O, but I don't know enough about the optimizer to be 100% certain\n\t// about that.\n\trequire.Equal(b, nodeCount, len(nodes))\n}", "title": "" }, { "docid": "a05c5fbd37e5aee6babdcea779c0fff5", "score": "0.4764389", "text": "func Cores() int {\n\tcount, err := cpu.Counts(false)\n\tif err != nil {\n\t\treturn 0\t\t// Return 0 if there is an error\n\t}\n\treturn count\n}", "title": "" }, { "docid": "302e483f8e902563b74e99c37f2cd240", "score": "0.47558784", "text": "func (GroupCountResult) Count() int64 { return 0 }", "title": "" }, { "docid": "31a1af1e6bb8f3500864cfa93b1fcc30", "score": "0.4753473", "text": "func (p *pool) RestartCount() int {\n\treturn p.restartCount\n}", "title": "" }, { "docid": "a1894255675c1af29e3320ac3a5790ee", "score": "0.47509634", "text": "func nodesWithPoolLabel(ctx context.Context, f *framework.Framework, poolName string) int {\n\tnodeCount := 0\n\tnodeList, err := e2enode.GetReadySchedulableNodes(ctx, f.ClientSet)\n\tframework.ExpectNoError(err)\n\tfor _, node := range nodeList.Items {\n\t\tif poolLabel := node.Labels[\"cloud.google.com/gke-nodepool\"]; poolLabel == poolName {\n\t\t\tnodeCount++\n\t\t}\n\t}\n\treturn nodeCount\n}", "title": "" }, { "docid": "2d57fad5ec240cbe8a7ff784a3cd3082", "score": "0.47503766", "text": "func subgroupCount(groupLimit, childCount uint64) uint64 {\n\tgroupSize := subgroupSize(groupLimit, childCount)\n\treturn (childCount + groupSize - 1) / groupSize\n}", "title": "" }, { "docid": "0a0cb9104468875d84a496b397186891", "score": "0.47495195", "text": "func countGroupCombinations(group []int) int {\n\tif len(group) == 1 {\n\t\treturn 1\n\t}\n\n\t// the target is the rightmost element, that might already be in the cache\n\ttarget := group[len(group)-1]\n\tif v, ok := cache[target]; ok {\n\t\treturn v\n\t}\n\n\tvar combinations int\n\n\t// we count the combinations that can reach the target\n\tfor i := len(group) - 2; i >= 0 && target-group[i] <= 3; i-- {\n\t\tcombinations += countGroupCombinations(group[:i+1])\n\t}\n\tcache[target] = combinations\n\treturn combinations\n\n}", "title": "" }, { "docid": "a72196a8592a1850c0b2167c02247109", "score": "0.47437552", "text": "func GetExpectedNumWorkers(kubeClient *kube.Client, spec *ppsclient.ParallelismSpec) (int, error) {\n\tcoefficient := 0.0 // Used if [spec.Strategy == PROPORTIONAL] or [spec.Constant == 0]\n\tif spec == nil {\n\t\t// Unset ParallelismSpec is handled here. Currently we start one worker per\n\t\t// node\n\t\tcoefficient = 1.0\n\t} else if spec.Strategy == ppsclient.ParallelismSpec_CONSTANT {\n\t\tif spec.Constant > 0 {\n\t\t\treturn int(spec.Constant), nil\n\t\t}\n\t\t// Zero-initialized ParallelismSpec is handled here. Currently we start one\n\t\t// worker per node\n\t\tcoefficient = 1\n\t} else if spec.Strategy == ppsclient.ParallelismSpec_COEFFICIENT {\n\t\tcoefficient = spec.Coefficient\n\t} else {\n\t\treturn 0, fmt.Errorf(\"Unable to interpret ParallelismSpec strategy %s\", spec.Strategy)\n\t}\n\tif coefficient == 0.0 {\n\t\treturn 0, fmt.Errorf(\"Ended up with coefficient == 0 (no workers) after interpreting ParallelismSpec %s\", spec.Strategy)\n\t}\n\n\t// Start ('coefficient' * 'nodes') workers. Determine number of workers\n\tnodeList, err := kubeClient.Nodes().List(api.ListOptions{})\n\tif err != nil {\n\t\treturn 0, fmt.Errorf(\"unable to retrieve node list from k8s to determine parallelism: %v\", err)\n\t}\n\tif len(nodeList.Items) == 0 {\n\t\treturn 0, fmt.Errorf(\"pachyderm.pps.jobserver: no k8s nodes found\")\n\t}\n\tresult := math.Floor(coefficient * float64(len(nodeList.Items)))\n\treturn int(math.Max(result, 1)), nil\n}", "title": "" }, { "docid": "6677829438e0089eedfa1baed97d894b", "score": "0.4743711", "text": "func numberOfTasks(slave *Slave) int {\n\tc := 0\n\n\tfor _, r := range slave.Roles {\n\t\tc += len(r.Tasks)\n\t}\n\n\treturn c\n}", "title": "" }, { "docid": "629d068255aa8ff516432639925f385c", "score": "0.47342795", "text": "func (p *pool) getActiveWorkersCount() int {\n\treturn p.activeWorkers\n}", "title": "" }, { "docid": "fb0589b524df2eb48372cec860f46fdb", "score": "0.47225493", "text": "func cpuIntPerf(enabled bool) {\n\tif !enabled {\n\t\treturn\n\t}\n\ttestsSelected += 1\n\tfmt.Printf(\"Testing CPU integer performance\\n\")\n\n\tbuf := make([]byte, 32768)\n\tfor i := 0; i < len(buf); i++ {\n\t\tbuf[i] = byte(i & 255)\n\t}\n\tvar crcsum uint16 = 0xFFFF\n\n\tstartTime := time.Now()\n\tfor i := 0; i < 100; i++ {\n\t\tcrcsum = ccitt_crc16(buf, crcsum)\n\t}\n\tdelta1 := elapsed(startTime)\n\n\titer_1sec := int(100 / delta1)\n\tniter := 5 * iter_1sec\n\n\tstartTime = time.Now()\n\tfor i := 0; i < niter-100; i++ {\n\t\tcrcsum = ccitt_crc16(buf, crcsum)\n\t}\n\tdelta2 := elapsed(startTime)\n\n\tcrcsum ^= 0xFFFF\n\tcrcsum = (crcsum << 8) | (crcsum >> 8)\n\n\tper_sec := int(float64(niter) / (delta1 + delta2))\n\tfmt.Printf(\"ccitt_crc16 %02X: %d/second\\n\", crcsum, per_sec)\n}", "title": "" } ]
69655ecd6fddc74da617f7033ba7536a
////////////////////////////////////////////////////////////////////// main logic //////////////////////////////////////////////////////////////////////
[ { "docid": "6c5a4dd2ef89600b030d153b120decc6", "score": "0.0", "text": "func run() (err error) {\n\tif *fDir == \"\" {\n\t\terr = errors.New(\"You must set --dir.\")\n\t\treturn\n\t}\n\n\t// Create a temporary file.\n\tlog.Printf(\"Creating a temporary file in %s.\", *fDir)\n\n\tf, err := os.CreateTemp(*fDir, \"write_to_gcs\")\n\tif err != nil {\n\t\terr = fmt.Errorf(\"TempFile: %w\", err)\n\t\treturn\n\t}\n\n\tpath := f.Name()\n\n\t// Make sure we clean it up later.\n\tdefer func() {\n\t\tlog.Printf(\"Deleting %s.\", path)\n\t\tos.Remove(path)\n\t}()\n\n\t// Write the configured number of zeroes to the file, measuing the time\n\t// taken.\n\tlog.Println(\"Writing...\")\n\n\tbuf := make([]byte, *fWriteSize)\n\n\tvar bytesWritten int64\n\tstart := time.Now()\n\n\tfor bytesWritten < *fFileSize {\n\t\t// Decide how many bytes to write.\n\t\ttoWrite := *fFileSize - bytesWritten\n\t\tif toWrite > *fWriteSize {\n\t\t\ttoWrite = *fWriteSize\n\t\t}\n\n\t\t// Write them.\n\t\t_, err = f.Write(buf)\n\t\tif err != nil {\n\t\t\terr = fmt.Errorf(\"Write: %w\", err)\n\t\t\treturn\n\t\t}\n\n\t\tbytesWritten += toWrite\n\t}\n\n\twriteDuration := time.Since(start)\n\n\t// Close the file, measuring the time taken.\n\tlog.Println(\"Flushing...\")\n\n\tstart = time.Now()\n\terr = f.Close()\n\tcloseDuration := time.Since(start)\n\n\tif err != nil {\n\t\terr = fmt.Errorf(\"Close: %w\", err)\n\t\treturn\n\t}\n\n\t// Report.\n\t{\n\t\tseconds := float64(writeDuration) / float64(time.Second)\n\t\tbytesPerSec := float64(bytesWritten) / seconds\n\n\t\tfmt.Printf(\n\t\t\t\"Wrote %s in %v (%s/s)\\n\",\n\t\t\tformat.Bytes(float64(bytesWritten)),\n\t\t\twriteDuration,\n\t\t\tformat.Bytes(bytesPerSec))\n\t}\n\n\t{\n\t\tseconds := float64(closeDuration) / float64(time.Second)\n\t\tbytesPerSec := float64(bytesWritten) / seconds\n\n\t\tfmt.Printf(\n\t\t\t\"Flushed %s in %v (%s/s)\\n\",\n\t\t\tformat.Bytes(float64(bytesWritten)),\n\t\t\tcloseDuration,\n\t\t\tformat.Bytes(bytesPerSec))\n\t}\n\n\tfmt.Println()\n\treturn\n}", "title": "" } ]
[ { "docid": "c6d5de0c4601df56cb3a9550556b6dcd", "score": "0.6574917", "text": "func main() {\n\n\n}", "title": "" }, { "docid": "dadb76cc8e3fb7575a11e1a67d6f7e10", "score": "0.6424838", "text": "func main(){\n\n\tlogfile, err := os.OpenFile(\"querytool_logs.txt\",os.O_CREATE|os.O_APPEND|os.O_WRONLY,0644)\n\tif err != nil {\n\t\tlog.Fatal(err)\n\t}\n\n\tdefer logfile.Close()\n\tlog.SetOutput(logfile)\n\n\tif len(os.Args) < 2 {\n\t\tlog.Fatal(\"Missing first argument. Please include the path to feed_config.json.\")\n\t}\n\n\tfeedconfig := readFeedConfig(os.Args[1])\n\n\terr = checkRetriever()\n\tif err != nil{\n\t\tlog.Fatal(err)\n\t}\n\n\tsourcefiles := identifyFiles(feedconfig[\"root_jobs_dir\"],\".src\")\n\tsourceobjects := processSources(sourcefiles,feedconfig[\"parse_validate_map\"])\n\n\tconfigfiles := identifyFiles(feedconfig[\"root_jobs_dir\"],\".conf\")\n\tjobs := processConfigs(configfiles,sourceobjects)\n\n\tsendToReceiver(jobs)\n}", "title": "" }, { "docid": "8668c394c39681aa8d9f1e57b15cb6c0", "score": "0.6398376", "text": "func main() {\n\t//basic.RunBasic()\n\t//intermediate.RunIntermediate()\n\n\tscrap()\n}", "title": "" }, { "docid": "e9c6c8d1453bf9826e3d61b49b384daf", "score": "0.63929945", "text": "func main() {\n\t\t\n\t\n}", "title": "" }, { "docid": "787f9d2794924886d44da701c39bf07d", "score": "0.63754344", "text": "func main() {\n\t// userIO()\n\t// setLocalVariables()\n\t// runForLoops1()\n\t// runForLoops2()\n\t// setConditionals()\n\t// runWhileLoops()\n\t// checkFileExists1()\n\t// checkFileExists2()\n\t// readFile()\n\t// readLinesMain()\n\t// writeFile()\n\t// renameFile()\n\t// useStructs()]\n\t// useMaps()\n\t// useRandom()\n\t// useSlices()\n\t// useAddresses1()\n\t// useAddresses2()\n\t// useDefer()\n\t// x, y := useMultipleReturns()\n\t// fmt.Println(x)\n\t// fmt.Println(y)\n\t// useVariadicFunctions(2, 3, 4)\n\t// fmt.Println(useRecursion(5))\n\t//using go and channels\n}", "title": "" }, { "docid": "345c2c97702cc004244794bc7a2b95e2", "score": "0.6344463", "text": "func main() {\n\tcreateUpdate()\n\tgetAll()\n\tgetByTags()\n\tdelete()\n}", "title": "" }, { "docid": "abf64f1ff32dd1fffefe58189ed1fdc8", "score": "0.62764406", "text": "func main() {\n\t/*\n\t\tThe main function of our local module\n\t*/\n\thandleArgs()\n\n\t/**\n\t------------------\n\t */\n\n\tloggo.ConfigureLoggers(\"<root>=DEBUG\")\n\tvar log = loggo.GetLogger(\"main\")\n\n\tlog.Infof(\"Starting...\")\n\tdefer s.CloseConnection()\n\n\t// Create a collection of Users a fetch for each id from 0 to the length of the collection\n\tvar users = new([10]m.User)\n\n\tfor id := 0; id < len(users); id++ {\n\t\tusers[id] = s.GetUserById(id)\n\t\tlog.Infof(\"The user's with id %d (%d) has email : %s\", id, users[id].Id, users[id].Email)\n\t}\n\n\t// Count the total numbers of Users\n\tvar usersCount int = s.GetUsersCount()\n\tlog.Infof(\"The number of counted users in db is : %d\", usersCount)\n\n\t// Retrieve all the users\n\tvar usersCollection []m.User = s.GetUsers()\n\tlog.Infof(\"The number of users fetched from db is : %d\", len(usersCollection))\n\n\tlog.Infof(\"Done\")\n}", "title": "" }, { "docid": "114cfc1b5a6d8873d585ca68e4e299ac", "score": "0.6153187", "text": "func main() {\n\t// Generate the main README.md. Might have to just link to other READMEs if it gets too unwieldy\n\tif err := alternativeto.GenerateMainREADME(); err != nil {\n\t\tlog.Fatalln(err)\n\t}\n}", "title": "" }, { "docid": "bd8202c66eed33a584aad0cb624029ca", "score": "0.61510324", "text": "func main() {\n\twf.Run(run)\n}", "title": "" }, { "docid": "ea8f482929acc2cf61743bd65e250823", "score": "0.6149114", "text": "func main() {\n\tmethod, filename, key, serverURL := loadConfig()\n\n\tvar err error\n\n\tswitch method {\n\tcase GetMethod:\n\t\t// Requests the URL from the server that the client will use to download\n\t\t// the content from. The content will be written to the file pointed to\n\t\t// by filename. Creating it if the file does not exist. If filename is\n\t\t// not set the contents will be written to stdout.\n\t\terr = downloadFile(serverURL, key, filename)\n\tcase PutMethod:\n\t\t// Requests the URL from the service that the client will use to upload\n\t\t// content to. The content will be read from the file pointed to by the\n\t\t// filename. If the filename is not set, content will be read from stdin.\n\t\terr = uploadFile(serverURL, key, filename)\n\t}\n\n\tif err != nil {\n\t\texitError(err)\n\t}\n}", "title": "" }, { "docid": "d3a1dc54509b2616c68d6c1813b083fb", "score": "0.61462134", "text": "func main() {\n\tadapter.RunStage(split, chunk, join)\n}", "title": "" }, { "docid": "e28512a64506b94e21ffb03d77f66a5d", "score": "0.61225384", "text": "func Main() {\n\tmain()\n}", "title": "" }, { "docid": "71cbca0a970179bacbc828bdea901314", "score": "0.6120251", "text": "func main() {\n\tcreateCrds()\n\tcreateCrs()\n}", "title": "" }, { "docid": "97327a52c12ff1fd8d58ba48e6dc957f", "score": "0.6119992", "text": "func main() {\n\t// load application configurations\n\tconfig := config.MustLoadConfig()\n\n\t// creating logger\n\tlogger := initLogrus(config)\n\n\t// set decimal configs\n\tdecimal.DivisionPrecision = 2\n\tdecimal.MarshalJSONWithoutQuotes = true\n\n\t// DB Connection\n\tif err := datastores.SetupDatastore(string(config.DB.Dialect),\n\t\tconfig.DB.DSN,\n\t\tconfig.DB.MaxIdleConnections,\n\t\tconfig.DB.MaxOpenConnections,\n\t\tconfig.Debug,\n\t); err != nil {\n\t\tpanic(fmt.Errorf(\"api: error when loading database connection. %s\", err))\n\t}\n\tdefer datastores.Database.Close()\n\n\t// Setup cache\n\terr := handlers.SetupCache(config.Cache.DefaultExpire, config.Cache.DefaultPurge)\n\tif err != nil {\n\t\tpanic(fmt.Errorf(\"api: error when loading Cache : %s\", err))\n\t}\n\n\t// Init router\n\trouter := initRouter(config, logger)\n\n\t// start server\n\taddress := fmt.Sprintf(\"%v:%v\", config.Host, config.Port)\n\tlogger.Infof(\"Server version [%s] is started at %v\\n\", Version, address)\n\n\tpanic(router.Start(address))\n}", "title": "" }, { "docid": "2fae95d851b065f943052f9af017a74c", "score": "0.6097163", "text": "func main() {\n\t// make sure to capture version request and rescan depth\n\tversionRequest := flag.Bool(\"v\", false, \"get the application version\")\n\n\t// get the configuration to prepare the server\n\tcfg, err := config.Load()\n\tif nil != err {\n\t\tlog.Fatal(err)\n\t}\n\n\t// print the version information\n\tbuild.PrintVersion(cfg)\n\tif *versionRequest {\n\t\treturn\n\t}\n\n\t// make logger\n\tlg := logger.New(cfg)\n\n\t// create repository for data exchange with the blockchain full node and local persistent storage\n\trepository.SetConfig(cfg)\n\trepository.SetLogger(lg)\n\n\t// start the HTTP server\n\tstartHttpServer(cfg, lg)\n}", "title": "" }, { "docid": "bbe51c2a99d5266e77fa2ea1ffd8f55d", "score": "0.6079124", "text": "func main() {\n\tgimain.Main(func() {\n\t\tmainrun()\n\t})\n}", "title": "" }, { "docid": "bbe51c2a99d5266e77fa2ea1ffd8f55d", "score": "0.6079124", "text": "func main() {\n\tgimain.Main(func() {\n\t\tmainrun()\n\t})\n}", "title": "" }, { "docid": "bbe51c2a99d5266e77fa2ea1ffd8f55d", "score": "0.6079124", "text": "func main() {\n\tgimain.Main(func() {\n\t\tmainrun()\n\t})\n}", "title": "" }, { "docid": "bbe51c2a99d5266e77fa2ea1ffd8f55d", "score": "0.6079124", "text": "func main() {\n\tgimain.Main(func() {\n\t\tmainrun()\n\t})\n}", "title": "" }, { "docid": "bbe51c2a99d5266e77fa2ea1ffd8f55d", "score": "0.6079124", "text": "func main() {\n\tgimain.Main(func() {\n\t\tmainrun()\n\t})\n}", "title": "" }, { "docid": "01fd565c9c2e2264ae213d5546bdde80", "score": "0.60773396", "text": "func main() {\n\t// TODO: Call supply.Run here\n\t// err = supply.Run(&s)\n\t// if err != nil {\n\t// \tos.Exit(1)\n\t// }\n}", "title": "" }, { "docid": "c98357074bdee282ccd09184464f7c71", "score": "0.6025336", "text": "func main() {\n\t//rcv()\n\t//msgas()\n\t//subas()\n\t//suberroras()\n\t//send()\n\t//topicas()\n\ttopicerroras()\n}", "title": "" }, { "docid": "b9b1622fe6b674edd0cf1d58a5ce49b7", "score": "0.5981361", "text": "func main() {\n\n\t// Delegate this run to the SDK. InvokeMap takes a map of test case names\n\t// and test case functions, and dispatches accordingly depending on the test\n\t// case being run. The run.Invoke* functions are entrypoint functions.\n\trun.InvokeMap(testcases)\n}", "title": "" }, { "docid": "003567eda7ec3e98cb8d5178be9c372f", "score": "0.5977725", "text": "func main() {\n\tflag.Parse() // parse any command line flags...\n\n\tvar v1 *viper.Viper\n\tvar err error\n\n\t// Load the config file and set some defaults (config overrides)\n\tif isFlagPassed(\"cfg\") {\n\t\tv1, err = readConfig(viperVal, map[string]interface{}{\n\t\t\t\"sqlfile\": \"\",\n\t\t\t\"bucket\": \"\",\n\t\t\t\"minio\": map[string]string{\n\t\t\t\t\"address\": \"localhost\",\n\t\t\t\t\"port\": \"9000\",\n\t\t\t\t\"accesskey\": \"\",\n\t\t\t\t\"secretkey\": \"\",\n\t\t\t},\n\t\t})\n\t\tif err != nil {\n\t\t\tpanic(fmt.Errorf(\"error when reading config: %v\", err))\n\t\t}\n\t}\n\n\t// Set up the minio connector\n\tmc := common.MinioConnection(v1)\n\n\t// url := \"http://dx.doi.org/10.7288/V4/MAGIC/15032\" // magic\n\turl := \"https://dev.rvdata.us/search/fileset/100142\" // rvdata\n\tk := \"demo\"\n\t//var (\n\t//\tbuf bytes.Buffer\n\t//\tlogger = log.New(&buf, \"logger: \", log.Lshortfile)\n\t//)\n\t// setup the KV store to hold a record of indexed resources\n\tdb, err := bolt.Open(\"gleaner.db\", 0600, nil)\n\tif err != nil {\n\t\tlog.Fatal(err)\n\t}\n\tdefer db.Close()\n\trlogginer, _ := common.LogIssues(v1, k)\n\n\trunStats := common.NewRunStats()\n\trepostats := runStats.Add(k)\n\terr = acquire.PageRenderAndUpload(v1, mc, 45*time.Second, url, k, db, rlogginer, repostats)\n\tif err != nil {\n\t\tpanic(fmt.Errorf(\"error when reading config: %v\", err))\n\t}\n}", "title": "" }, { "docid": "a41b3f4bf70aab5c72772769567cf8e1", "score": "0.59623736", "text": "func main() {\n\thandleRequests()\n}", "title": "" }, { "docid": "22262302ea296ebbdd002525a773db59", "score": "0.595131", "text": "func main() {\n\t\n}", "title": "" }, { "docid": "22262302ea296ebbdd002525a773db59", "score": "0.595131", "text": "func main() {\n\t\n}", "title": "" }, { "docid": "22262302ea296ebbdd002525a773db59", "score": "0.595131", "text": "func main() {\n\t\n}", "title": "" }, { "docid": "22262302ea296ebbdd002525a773db59", "score": "0.595131", "text": "func main() {\n\t\n}", "title": "" }, { "docid": "22262302ea296ebbdd002525a773db59", "score": "0.595131", "text": "func main() {\n\t\n}", "title": "" }, { "docid": "565dffd6278e021212d38a7dfc591df2", "score": "0.5933595", "text": "func main() {\n\targs := os.Args\n\targs = parseArgs(args[1:])\n\tsetFunctions()\n\tsort.Slice(args, func(i, j int) bool { return args[i] < args[j] }) // r?\n\n\ttrash, files, dirs := separateArgs(args)\n\tprintTrash(trash)\n\tprintFiles(files)\n\terr := handleDirs(dirs)\n\tif err != nil {\n\t\tprintln(err)\n\t}\n}", "title": "" }, { "docid": "75ddd733f0670b3839cc9d3caf3c5bf8", "score": "0.59256536", "text": "func main() {\n\tAddWithIDsDontWorkOnFlatIndex()\n\tRemoveIDsOnFlatIndex()\n\tRemoveIDsOnHNSW()\n\tIVFRequiresTrain()\n\tIVFWithNprobe()\n}", "title": "" }, { "docid": "c90836f5f42d5b72fa1d4662fc807fe3", "score": "0.59025156", "text": "func main() {\n\tdb.Init()\n\tapi.Init()\n\tiamport.Init()\n}", "title": "" }, { "docid": "64111206cc427801bfd429d8303ebf1e", "score": "0.5902408", "text": "func main() {\n\n}", "title": "" }, { "docid": "d6b63afa51af3faa2f4b57c3c9e1255b", "score": "0.5902156", "text": "func main() {\n\tstart()\n}", "title": "" }, { "docid": "38728e63d36c07d1dc472349caf2ec5d", "score": "0.58965826", "text": "func main() {\n\n\tctx := context.Background()\n\tctx = H.SetLocationInfo(ctx, map[string]string{\n\t\t\"Pod\": \"Koalja_empty_pod\",\n\t\t\"Deployment\": \"Koalja query_history\", // insert instance data from env?\n\t\t\"Version\": \"0.1\",\n\t})\n\n\tm := H.SignPost(&ctx,\"Show process history\").\n\t\tPartOf(H.N(\"Koalja\"))\n\n\t// 1. test cellibrium - need an invariant name (non trivial in cloud)\n\n\tflag.Usage = usage\n\tflag.Parse()\n\targs := flag.Args()\n\n\tif len(args) < 1 {\n\t\tListProcesses();\n\t\tos.Exit(1);\n\t}\n\n\tfmt.Printf(\"opening /tmp/cellibrium/%s\\n\", args[0]);\n\t\n\tpath := fmt.Sprintf(\"/tmp/cellibrium/%s/\",args[0])\n\n\tfiles, err := ioutil.ReadDir(path)\n\n\tif err != nil {\n\t\tos.Exit(1)\n\t}\n\n\tm.Note(\"For each file, open\")\n\n\tfor _, file := range files {\n\t\tif strings.HasPrefix(file.Name(),\"transaction\") {\n\t\t\tShowFile(ctx,args[0],file.Name())\n\t\t}\n\t}\n}", "title": "" }, { "docid": "8b099a5fbfc060f09c763269e2d36694", "score": "0.58739406", "text": "func main() {\n\trunstring()\n\trunprogram()\n}", "title": "" }, { "docid": "c45a70722411fdcfcac90060539ee08e", "score": "0.5871933", "text": "func main() {\n\tvar ignored []string\n\tvar ready = make(chan int)\n\t//TODO:allow passing configuration file location\n\tgo getIgnored(\"/etc/pacman.conf\", &ignored, ready) //TODO:allow ignoring ignore pkgs\n\tpackages := getForeignPackages()\n\tgetAurVersions(packages)\n\t<-ready\n\tprintUpdates(packages, ignored)\n}", "title": "" }, { "docid": "72f3af738fb3d413f6b341740f1cbdff", "score": "0.58391017", "text": "func main() {\n\t/*counter := 1\n\tfor counter < 5{\n\t\tstart := time.Now()\n\t\terr := run(5 * time.Second, counter)\n\t\tt := time.Now()\n\t\tfmt.Printf(\"From local running server - elaspsed time: \"+t.Sub(start).String()+\"\\n\")\n\t\tif err != nil {\n\t\t\tlog.Fatal(err)\n\t\t}\n\n\t\tcounter += 1\n\t}*/\n\n\tfromLocalNodeFetch(5, mediumPage)\n\t//fromWebWithImageNText(5, mediumPage)\n\t//fromWSJWithImageNText(5, WSJ)\n\t\n}", "title": "" }, { "docid": "9bc6e1b605996ae5ab06eb109c741312", "score": "0.5838195", "text": "func main() {\n\tif len(os.Args) != 4 {\n\t\tfmt.Printf(\"%s: see usage comments in file\\n\", os.Args[0])\n\t} else if os.Args[1] == \"master\" {\n\t\tif os.Args[3] == \"sequential\" {\n\t\t\tmapreduce.RunSingle(5, 3, os.Args[2], Map, Reduce)\n\t\t} else {\n\t\t\tmr := mapreduce.MakeMapReduce(5, 3, os.Args[2], os.Args[3])\n\t\t\t// Wait until MR is done\n\t\t\t<-mr.DoneChannel\n\t\t}\n\t} else {\n\t\tmapreduce.RunWorker(os.Args[2], os.Args[3], Map, Reduce, 100)\n\t}\n\t//b := \"-\"\n\t//fmt.Println(unicode.IsLetter(rune(b[0])) || false)\n\n}", "title": "" }, { "docid": "5d3dae1f37297d69542748241070d97d", "score": "0.58288336", "text": "func main() {\n\tdefer exitOnPanic() // fatal error handler: log and exit\n\n\terr := mainBody(os.Args)\n\tif err != nil {\n\t\tomppLog.Log(err.Error())\n\t\tos.Exit(1)\n\t}\n\tomppLog.Log(\"Done.\") // compeleted OK\n}", "title": "" }, { "docid": "d24d20261bdb5d4e966f2f93ce9ca2c2", "score": "0.58164936", "text": "func main() {\n\t//connect db\n\tdb, err := sql.Open(\"mysql\", dsn(\"\"))\n\tif err != nil {\n\t\tlog.Printf(\"Error %s when opening DB\\n\", err)\n\t\treturn\n\t}\n\tdefer db.Close()\n\n\t// ensure that program does not get stuck in some cases\n\t//This method is used to execute a query without returning any rows\n\n\t//create fb\n\tctx, cancelfunc := context.WithTimeout(context.Background(), 5*time.Second)\n\tdefer cancelfunc()\n\n\tres, err := db.ExecContext(ctx, \"CREATE DATABASE IF NOT EXISTS \"+dbname)\n\tif err != nil {\n\t\tlog.Printf(\"Error %s when creating DB\\n\", err)\n\t\treturn\n\t}\n\tno, err := res.RowsAffected()\n\tif err != nil {\n\t\tlog.Printf(\"Error %s when fetching rows\", err)\n\t\treturn\n\t}\n\tlog.Printf(\"rows affected %d\\n\", no)\n\n\t//ping to db\n\terr = db.PingContext(ctx)\n\tif err != nil {\n\t\tlog.Printf(\"Errors %s pinging DB\", err)\n\t\treturn\n\t}\n\tlog.Printf(\"Connected to DB %s successfully\\n\", dbname)\n}", "title": "" }, { "docid": "ee72798c2f277624885f2b0563be9789", "score": "0.58069104", "text": "func start()", "title": "" }, { "docid": "65af2412bfefd3664bd8016b50a1cb5e", "score": "0.5800004", "text": "func main() {\n\t//使用多核cpu\n\truntime.GOMAXPROCS(runtime.NumCPU())\n\t//欢迎信息\n\towlsystem.DosSayHello()\n\t//初始化配置\n\towlconfig.ConfigInit()\n\t//初始化日志记录\n\towllog.LogInit()\n\t//定时任务服务\n\towljob.JobInit()\n\t//初始化数据库服务,核心组件\n\towlnetwork.BaseCacheDBInit()\n\t//守护包。用于保证程序的稳健、安全运行\n\towlaegis.AegisInit()\n}", "title": "" }, { "docid": "469b771523ca2d6e3ebfa7b89b42580a", "score": "0.57982546", "text": "func main() {\n\tfmt.Println(\"LeadStore Runing\")\n\tsqldb.Run(publicKey, databaseName)\n\tapis.Routerer()\n\n}", "title": "" }, { "docid": "24f650bc7f9396f126462b89b6fb8a0e", "score": "0.579591", "text": "func main() {\n\t//init db\n\tdb.InitDb(config.GetConfig().MysqlStr)\n\tdb.InitAutoDB() //auto create table\n\t//end init db\n\t//init routers\n\tschedules.StartAddOrderSchedule() //开启定时任务\n\troutes.Run() //启动\n}", "title": "" }, { "docid": "c4b656baeb7758875ed2ecb981e24d10", "score": "0.57953244", "text": "func main() {\n\tif authKey == \"\" {\n\t\tlog.Fatal(\"STARFIGHTER_API_KEY environment variable not set\")\n\t}\n\n\tflag.Parse()\n\n\ta = sfapi.NewAPI()\n\n\tif *stop {\n\t\ta.StopLastGame()\n\t} else if *start3 {\n\t\tgameLevel := a.StartLevel3()\n\t\ta.WriteGameLevel(gameLevel)\n\t} else if *start4 {\n\t\tgameLevel := a.StartLevel4()\n\t\ta.WriteGameLevel(gameLevel)\n\t} else if *start5 {\n\t\tgameLevel := a.StartLevel5()\n\t\ta.WriteGameLevel(gameLevel)\n\t} else if *start6 {\n\t\tgameLevel := a.StartLevel6()\n\t\ta.WriteGameLevel(gameLevel)\n\t} else if *restartInstanceId != -1 {\n\t\tgameLevel := a.RestartLevel(*restartInstanceId)\n\t\tlog.Printf(\"GameLevel: %+v\\n\", gameLevel)\n\t\tlog.Printf(\"%s\\n\", gameLevel.CopyPaste())\n\t} else if *submitEvidence {\n\t\tlog.Printf(\"submit evidence, instance: %d, account: \\\"%s\\\", link: %s, summary: %s\\n\", *evidenceInstance, *evidenceAccount, *evidenceLink, *evidenceSummary)\n\t\tev := sfapi.Evidence{Account: *evidenceAccount, Link: *evidenceLink, Summary: *evidenceSummary}\n\n\t\tresult := a.SubmitEvidence(ev, *evidenceInstance)\n\t\tlog.Printf(\"result of submission: %+v\\n\", result)\n\t} else {\n\t\tflag.Usage()\n\t\tos.Exit(1)\n\t}\n}", "title": "" }, { "docid": "2c0cf8a87451702db328d18448743fed", "score": "0.57838684", "text": "func main() {\r\n}", "title": "" }, { "docid": "05dfb1f8bd1cec231dc72d01a83bdd7b", "score": "0.5783705", "text": "func main() {\n\t//levantamos un nuevo chaincode y le enviamos la estructura\n\t//SmartContract, que devuelve 2 valores\n\tSC := new(SmartContract)\n\n\t// SC.TransactionContextHandler = new(CustomTransactionContextInterface)\n\tSC.beforeTransaction = BeforeTransaction\n\tSC.afterTransaction = AfterTransaction\n\n\tchaincode, err := contractapi.NewChaincode(SC)\n\t//chaincode, err := contractapi.NewChaincode(new(SmartContract))\n\t//verificamos si hay algun error\n\tif err != nil {\n\t\tfmt.Printf(\"Error create ppa chaincode: %s\", err.Error())\n\t\tpanic(err.Error())\n\t\t//y terminaria la ejecucion del codigo\n\t\t// return\n\t}\n\n\t//verificamos si hay algun error al ejecutar esta funcion\n\tif err := chaincode.Start(); err != nil {\n\t\tpanic(err.Error())\n\t\t// fmt.Printf(\"Error starting ppa chaincode: %s\", err.Error())\n\t}\n}", "title": "" }, { "docid": "c041a95d15e69ae7745df7c944394910", "score": "0.578181", "text": "func main() {\n\tproDir, err := utils.GetProDir()\n\tif err != nil {\n\t\tlog.Panicln(\"Get ProDir err: \" + err.Error())\n\t}\n\tconf.Init(proDir, constant.BUILD_TYPE_PROD)\n\tdb.InitDB(conf.App.DBHost, conf.App.DBPort, conf.App.DBUser, conf.App.DBPassword, conf.App.DBName, conf.App.DBDriver)\n\tcache.Init()\n\n\terr = logger.InitLogger(proDir)\n\n\tdefer db.Db.Close()\n\tgo http.ListenAndServe(\":80\", http.HandlerFunc(redirect))\n\t//defer logger.Close()\n\terr = http.ListenAndServeTLS(\":\"+conf.App.ServerPort, \"1_vingdream.cn_bundle.crt\", \"2_vingdream.cn.key\", routers.SetRouter())\n\n\t//err=http.ListenAndServe(\":80\",routers.SetRouter())\n\tif err == nil {\n\t\tlog.Println(err)\n\t}\n}", "title": "" }, { "docid": "ce6b7c9a0a171449b65946d5227b862c", "score": "0.57767904", "text": "func main() {\n\t//initDBConn()\n\t//defer db.DBConn.Close()\n\tinitClusterNodes()\n\tsetupRoutes()\n}", "title": "" }, { "docid": "c943d0633ef2230548836b5fbb736bff", "score": "0.57723933", "text": "func main() {\n\t// your code here\n}", "title": "" }, { "docid": "f4a37f5f248c51d21f827b48fa7cf2cf", "score": "0.5772179", "text": "func main() {\n\tif err := run(); err != nil {\n\t\tfmt.Println(err)\n\t\tos.Exit(1)\n\t}\n\n}", "title": "" }, { "docid": "55161ebedb24d7032ee9e466bea9f7da", "score": "0.57697296", "text": "func main(){\n\t\tservidor := NewServer(\":9990\")\n\t\tservidor.Handle(\"GET\",\"/\", HandleRoot)\n\t\tservidor.Handle(\"POST\",\"/create\", PostRequest)\n\t\tservidor.Handle(\"POST\",\"/auth\", UserPostRequest)\n\t \tfiles, err := ioutil.ReadDir(\"./services/\")\n \tif err != nil {\n \tfmt.Printf(\"%v+\",err)\n\t }\n\n\t for _, f := range files {\n\t \tservicio :=f.Name()\n\t \tservicio = strings.Replace(servicio,\".json\",\"\",-1)\n\t \tif servicio==\"buffer\"{\n\t \t\tcontinue\n\t \t}\n\t \tservicio =\"/api/\"+servicio\n\t \tservidor.Handle(\"POST\",servicio, servidor.AddMiddleware(HandleApi, CheckAuth()))//, LoG()))\n\t //fmt.Println(f.Name())\n\t }\n\t\t//servidor.Handle(\"POST\",\"/api/\", servidor.AddMiddleware(HandleApi, CheckAuth()))//, LoG()))\n\t\tservidor.Listen()\n}", "title": "" }, { "docid": "c41d5751b7d951979577c77303fa6182", "score": "0.5768836", "text": "func main() {\r\n\t// gin.DisableConsoleColor()\r\n\t// gin.SetMode(gin.ReleaseMode)\r\n\t// Logging to a file.\r\n\t// f, _ := os.Create(\"log/odoo_cmd.log\")\r\n\t// gin.DefaultWriter = io.MultiWriter(f)\r\n\r\n\tr := gin.Default()\r\n\tr.LoadHTMLGlob(\"assets/*.html\")\r\n\tr.Static(\"/js\", \"./assets/js\")\r\n\tr.Static(\"/css\", \"./assets/css\")\r\n\t// fs := assetfs.AssetFS{Asset: bindata.Asset, AssetDir: bindata.AssetDir, AssetInfo: bindata.AssetInfo, Prefix: \"assets\", Fallback: \"index.html\"}\r\n\t// r.StaticFS(\"/css\", &fs)\r\n\t// r.StaticFS(\"/js\", &fs)\r\n\r\n\tr.GET(\"/\", index)\r\n\tr.POST(\"/odoo/action\", odoo)\r\n\t// r.GET(\"/odoo/restart\", odooRestart)\r\n\t// r.GET(\"/odoo/gitpull\", gitPull)\r\n\t// r.GET(\"/odoo/escp\", escpRestart)\r\n\r\n\tdaemon.SdNotify(false, \"REEADY=1\")\r\n\r\n\tr.Run(\":3980\")\r\n}", "title": "" }, { "docid": "3c84a7ae188266834cbf332c649acaf1", "score": "0.5755693", "text": "func main() {\n\tresp, err := http.Get(\"http://google.com\")\n\tif err != nil {\n\t\tfmt.Println(\"Error:\", err)\n\t\tos.Exit(1)\n\t}\n\n\t//bs := make([]byte, 99999) //necessary to initialise a byte slice w large size to store stuff from read function\n\t//resp.Body.Read(bs)\n\t//fmt.Println(string(bs)) //reader interface\n\t//or\n\tlw := logWriter{}\n\tio.Copy(lw, resp.Body) //writer interface //writes to terminal, http file etc.etc.\n\t//func Copy(dst Writer, src Reader) (written int64, err error)\n}", "title": "" }, { "docid": "37e63731c8db7daba0b07f93fd620869", "score": "0.5746639", "text": "func main() {\n\tif len(os.Args) != 4 {\n\t\tfmt.Printf(\"%s: see usage comments in file\\n\", os.Args[0])\n\t} else if os.Args[1] == \"master\" {\n\t\tif os.Args[3] == \"sequential\" {\n\t\t\tmapreduce.RunSingle(5, 3, os.Args[2], Map, Reduce)\n\t\t} else {\n\t\t\tmr := mapreduce.MakeMapReduce(5, 3, os.Args[2], os.Args[3])\n\t\t\t// Wait until MR is done\n\t\t\t<-mr.DoneChannel\n\t\t}\n\t} else {\n\t\tmapreduce.RunWorker(os.Args[2], os.Args[3], Map, Reduce, 100)\n\t}\n}", "title": "" }, { "docid": "37e63731c8db7daba0b07f93fd620869", "score": "0.5746639", "text": "func main() {\n\tif len(os.Args) != 4 {\n\t\tfmt.Printf(\"%s: see usage comments in file\\n\", os.Args[0])\n\t} else if os.Args[1] == \"master\" {\n\t\tif os.Args[3] == \"sequential\" {\n\t\t\tmapreduce.RunSingle(5, 3, os.Args[2], Map, Reduce)\n\t\t} else {\n\t\t\tmr := mapreduce.MakeMapReduce(5, 3, os.Args[2], os.Args[3])\n\t\t\t// Wait until MR is done\n\t\t\t<-mr.DoneChannel\n\t\t}\n\t} else {\n\t\tmapreduce.RunWorker(os.Args[2], os.Args[3], Map, Reduce, 100)\n\t}\n}", "title": "" }, { "docid": "369b5c6767cdc754c45a65f267a6f856", "score": "0.57400113", "text": "func main() {\n\n\tflag.Usage = help\n\tflag.Parse()\n\n\t// Initialize an empty ScanResult slice, omitted from result if empty\n\tvar destArray []portscanner.ScanResult\n\tif *infilePtr != \"\" {\n\t\tpsArray := filereader.FileToStructArray(*infilePtr, *uLimit)\n\t\tdestArray = portscanner.Start(psArray, 500*time.Millisecond)\n\t}\n\n\tsuperSecrets := secparse.ParseSecrets(*secfilePtr)\n\trmqpassword := superSecrets.Rabbitmq.MorpheusPassword\n\n\t// Gather system stats into a si array\n\tsysStats := sysgatherer.SysGather()\n\n\t// Gather elasticsearch health and indices into structs for results\n\tesHealth := elasticing.ElasticHealth()\n\tesIndices := elasticing.ElasticIndices()\n\trabbitStuff := rabbiting.RabbitStats(\"morpheus\", rmqpassword)\n\n\tmorpheus, err := ioutil.ReadFile(*logfilePtr)\n\tif err != nil {\n\t\tlog.Fatalf(\"Error reading public key file: %s\", err)\n\t}\n\n\t// Create instance of results struct from packages returns\n\tresults := Results{\n\t\tElasticStats: esHealth,\n\t\tElasticIndices: esIndices,\n\t\tSystem: sysStats,\n\t\tScans: destArray,\n\t\tRabbitStatistics: rabbitStuff,\n\t\tMorphLogs: string(morpheus),\n\t}\n\n\tresultjson, err := json.MarshalIndent(results, \"\", \" \")\n\tif err != nil {\n\t\tlog.Fatal(\"Can't encode to JSON\", err)\n\t}\n\n\t//fmt.Fprintf(os.Stdout, \"%s\", resultjson)\n\t//FileWrtr(\"\\nULTIMATE:\\n\" + string(resultjson), *outfilePtr)\n\n\t// Base resultjson into Encryption package and write encrypted file and key\n\tnonSense := encryptText.EncryptItAll(*pubPtr, string(resultjson))\n\tnonText := nonSense.Ciphertext\n\tnonKey := nonSense.EncryptedKey\n\tFileWrtr(string(nonText), *outfilePtr)\n\tFileWrtr(string(nonKey), *keyfilePtr)\n\n\t// Bundle the whole shebang\n\tif err := archiver.Archive([]string{*outfilePtr, *keyfilePtr}, *bundlerPtr); err != nil {\n\t\tlog.Fatal(err)\n\t}\n}", "title": "" }, { "docid": "5092489eee24d43660b03ae25483effa", "score": "0.57336944", "text": "func main() {\n\tif len(os.Args) < 4 {\n\t\tfmt.Printf(\"%s: see usage comments in file\\n\", os.Args[0])\n\t} else if os.Args[1] == \"master\" {\n\t\tvar mr *mapreduce.Master\n\t\tif os.Args[2] == \"sequential\" {\n\t\t\tmr = mapreduce.Sequential(\"wcseq\", os.Args[3:], 3, mapF, reduceF)\n\t\t} else {\n\t\t\tmr = mapreduce.Distributed(\"wcseq\", os.Args[3:], 3, os.Args[2])\n\t\t}\n\t\tmr.Wait()\n\t} else {\n\t\tmapreduce.RunWorker(os.Args[2], os.Args[3], mapF, reduceF, 100)\n\t}\n}", "title": "" }, { "docid": "246ae2e2be039f9836ddf275a2ae15e3", "score": "0.5733579", "text": "func main() {\n\tif err := run(os.Args[1:]); err != nil {\n\t\tlog.Fatalf(\"!! %+v\", err)\n\t}\n}", "title": "" }, { "docid": "a1fce748f6a568ac9594fd0194125d51", "score": "0.5723283", "text": "func main() {\n\tvar c auto.Conf\n\n\t// Get config from yaml\n\tc.GetConf(\"user/conf.yaml\")\n\n\t// Kill the process built by c last time(\n\t//clear_build(c)\n\n\t// Modify nodes, transfer nodes file, start xchain && node_exporter\n\tauto_deploy(c)\n\n\t// Modify promethus && start\n\tstart_promethus(c)\n\n\t// Modify grafana && start\n\tstart_grafana(c)\n\n}", "title": "" }, { "docid": "fe37a56468760f9b7e2d909fa708e300", "score": "0.57107204", "text": "func main() {\n\n}", "title": "" }, { "docid": "fe37a56468760f9b7e2d909fa708e300", "score": "0.57107204", "text": "func main() {\n\n}", "title": "" }, { "docid": "fe37a56468760f9b7e2d909fa708e300", "score": "0.57107204", "text": "func main() {\n\n}", "title": "" }, { "docid": "fe37a56468760f9b7e2d909fa708e300", "score": "0.57107204", "text": "func main() {\n\n}", "title": "" }, { "docid": "fe37a56468760f9b7e2d909fa708e300", "score": "0.57107204", "text": "func main() {\n\n}", "title": "" }, { "docid": "fe37a56468760f9b7e2d909fa708e300", "score": "0.57107204", "text": "func main() {\n\n}", "title": "" }, { "docid": "fe37a56468760f9b7e2d909fa708e300", "score": "0.57107204", "text": "func main() {\n\n}", "title": "" }, { "docid": "fe37a56468760f9b7e2d909fa708e300", "score": "0.57107204", "text": "func main() {\n\n}", "title": "" }, { "docid": "fe37a56468760f9b7e2d909fa708e300", "score": "0.57107204", "text": "func main() {\n\n}", "title": "" }, { "docid": "fe37a56468760f9b7e2d909fa708e300", "score": "0.57107204", "text": "func main() {\n\n}", "title": "" }, { "docid": "fe37a56468760f9b7e2d909fa708e300", "score": "0.57107204", "text": "func main() {\n\n}", "title": "" }, { "docid": "fe37a56468760f9b7e2d909fa708e300", "score": "0.57107204", "text": "func main() {\n\n}", "title": "" }, { "docid": "fe37a56468760f9b7e2d909fa708e300", "score": "0.57107204", "text": "func main() {\n\n}", "title": "" }, { "docid": "fe37a56468760f9b7e2d909fa708e300", "score": "0.57107204", "text": "func main() {\n\n}", "title": "" }, { "docid": "fe37a56468760f9b7e2d909fa708e300", "score": "0.57107204", "text": "func main() {\n\n}", "title": "" }, { "docid": "fe37a56468760f9b7e2d909fa708e300", "score": "0.57107204", "text": "func main() {\n\n}", "title": "" }, { "docid": "fe37a56468760f9b7e2d909fa708e300", "score": "0.57107204", "text": "func main() {\n\n}", "title": "" }, { "docid": "fe37a56468760f9b7e2d909fa708e300", "score": "0.57107204", "text": "func main() {\n\n}", "title": "" }, { "docid": "fe37a56468760f9b7e2d909fa708e300", "score": "0.57107204", "text": "func main() {\n\n}", "title": "" }, { "docid": "fe37a56468760f9b7e2d909fa708e300", "score": "0.57107204", "text": "func main() {\n\n}", "title": "" }, { "docid": "fe37a56468760f9b7e2d909fa708e300", "score": "0.57107204", "text": "func main() {\n\n}", "title": "" }, { "docid": "fe37a56468760f9b7e2d909fa708e300", "score": "0.57107204", "text": "func main() {\n\n}", "title": "" }, { "docid": "fe37a56468760f9b7e2d909fa708e300", "score": "0.57107204", "text": "func main() {\n\n}", "title": "" }, { "docid": "fe37a56468760f9b7e2d909fa708e300", "score": "0.57107204", "text": "func main() {\n\n}", "title": "" }, { "docid": "fe37a56468760f9b7e2d909fa708e300", "score": "0.57107204", "text": "func main() {\n\n}", "title": "" }, { "docid": "fe37a56468760f9b7e2d909fa708e300", "score": "0.57107204", "text": "func main() {\n\n}", "title": "" }, { "docid": "fe37a56468760f9b7e2d909fa708e300", "score": "0.57107204", "text": "func main() {\n\n}", "title": "" }, { "docid": "c8f4c0be884335fff2087d5ac6f7dfb8", "score": "0.5709994", "text": "func main() {\n\t// read configuration\n\tconfiguration, err := readConfiguration(\"config\")\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\n\t// initialize colorizers\n\tcolorizer = aurora.NewAurora(*configuration.colors)\n\tcommands.SetColorizer(colorizer)\n\n\t// initialize REST API connection to service\n\tcontrollerURL := viper.GetString(\"CONTROLLER_URL\")\n\tapi = restapi.NewRestAPI(controllerURL)\n\n\t// start the command line\n\tif *configuration.useCompleter {\n\t\t// command line prompt with autocompleter\n\t\tp := prompt.New(executor, completer)\n\t\tp.Run()\n\t} else {\n\t\t// command line prompt without autocompleter\n\t\tscanner := bufio.NewScanner(os.Stdin)\n\t\tfmt.Print(\"> \")\n\t\tfor scanner.Scan() {\n\t\t\tline := scanner.Text()\n\t\t\texecutor(line)\n\t\t\tfmt.Print(\"> \")\n\t\t}\n\t}\n}", "title": "" }, { "docid": "3e2d9349f4ce10123016bccf6f624cca", "score": "0.5706521", "text": "func main() {\n\n\t// disconnect connection to database\n\tdefer mgo.Disconnect()\n\n\tLogger.Infof(\"host %s\", *host)\n\tLogger.Infof(\"port %d\", *port)\n\tLogger.Infof(\"Static dir %s\", *staticPath)\n\n\t// handle routers\n\tfor k, v := range routes {\n\t\thttp.HandleFunc(k, v)\n\t}\n\n\tgo serveHTTP(*host, *port)\n\tselect {}\n}", "title": "" }, { "docid": "538b0f1cb7bc9054c9c53edaba030dc2", "score": "0.5704594", "text": "func main() {\n\t// Initialize routes\n\tinitRoutes()\n}", "title": "" }, { "docid": "f72adff62590f5cb248be368d0914180", "score": "0.56997", "text": "func main() {\n\t// Inventory of old boards to remove, and the new boards\n\t// that will replace them.\n\tboards := []Board{\n\t\t// Rotted boards to be removed.\n\t\t{NailsDriven: 3},\n\t\t{NailsDriven: 1},\n\t\t{NailsDriven: 6},\n\n\t\t// Fresh boards to be fastened.\n\t\t{NailsNeeded: 6},\n\t\t{NailsNeeded: 9},\n\t\t{NailsNeeded: 4},\n\t}\n\n\t// Fill a toolbox.\n\ttb := Toolbox{\n\t\tNailDriver: Mallet{},\n\t\tNailPuller: Crowbar{},\n\t\tnails: 10,\n\t}\n\n\t// Display the current state of our toolbox and boards.\n\tdisplayState(&tb, boards)\n\n\t// Hire a Contractor and put our Contractor to work.\n\tvar c Contractor\n\tc.ProcessBoards(&tb, &tb.nails, boards)\n\n\t// Display the new state of our toolbox and boards.\n\tdisplayState(&tb, boards)\n}", "title": "" }, { "docid": "24a0f04a29139fc328e6561fa39e649b", "score": "0.5698278", "text": "func main() {\n\tparticiple.Init(model.Conf.DataFolder)\n\tdb.Init()\n\ttelegram.Init()\n\n\trouter := api.Router()\n\t// server := &http.Server{\n\t// \tAddr: model.Conf.ListenAddr,\n\t// \tHandler: router,\n\t// }\n\t// handleSignal(server)\n\t//\n\t// if err := server.ListenAndServe(); err != nil {\n\t// \tlog.Fatal(\"[Memo] server listen error\", zap.Error(err))\n\t// }\n\tif err := router.Run(model.Conf.ListenAddr); err != nil {\n\t\tlog.Fatal(\"[Memo] server listen error\", zap.Error(err))\n\t}\n}", "title": "" }, { "docid": "2972e2c13f101fc3714b059acc3c9aea", "score": "0.56916547", "text": "func logic() {\n\t// Read the config file\n\tjsonBytes, err := ioutil.ReadFile(\"versioninfo.json\")\n\tif err != nil {\n\t\tlog.Printf(\"Error reading versioninfo.json: %v\", err)\n\t\tos.Exit(1)\n\t}\n\n\t// Create a new container\n\tvi := &VersionInfo{}\n\n\t// Parse the config\n\tif err := vi.ParseJSON(jsonBytes); err != nil {\n\t\tlog.Printf(\"Could not parse the .json file: %v\", err)\n\t\tos.Exit(2)\n\t}\n\n\t// Fill the structures with config data\n\tvi.Build()\n\n\t// Write the data to a buffer\n\tvi.Walk()\n\n\t// Optionally, embed an icon by path\n\t// If the icon has multiple sizes, all of the sizes will be embedded\n\tvi.IconPath = \"icon.ico\"\n\n\t// Create the file\n\tif err := vi.WriteSyso(\"resource.syso\", \"386\"); err != nil {\n\t\tlog.Printf(\"Error writing syso: %v\", err)\n\t\tos.Exit(3)\n\t}\n}", "title": "" }, { "docid": "8ba0a28f4365694ec8df87c0f2b7f144", "score": "0.5685912", "text": "func main() {\n\terr := clientMain()\n\tif err != nil {\n\t\tpanic(err)\n\t}\n}", "title": "" }, { "docid": "2882f83b3b5d5364acbb50d607350bbc", "score": "0.56823254", "text": "func main() {\n\tex1()\n\tex2()\n}", "title": "" }, { "docid": "e0952d1e304d51b9e7fe90bed79c83f4", "score": "0.56813186", "text": "func main() {\n\tcheck_peers()\n\tcheck_header()\n}", "title": "" }, { "docid": "3ab3ffb200cb1a6f3aff57e19224397d", "score": "0.5681194", "text": "func main() {\n\tinitLists()\n\treadVolumes()\n\treadContainer()\n\tfor _, vol := range allvolumes {\n\t\tif vol.orphaned {\n\t\t\torphanedVolumes = append(orphanedVolumes, vol)\n\t\t}\n\t}\n}", "title": "" }, { "docid": "94319a80b5034efc6c6b84e05372cc2c", "score": "0.56776", "text": "func main() {\n\tflag.Parse()\n\tmanager.NewFHCManager(runCase).WaitEnd()\n}", "title": "" }, { "docid": "f9e40c291c1400e8de915cd28b038506", "score": "0.5677065", "text": "func main() {\n\tvar outMode string\n\tflag.StringVar(&outMode, \"outmode\", \"markdown\", \"set output mode to \\\"markdown\\\" or \\\"html\\\"\")\n\n\tvar opmlFilename string\n\tflag.StringVar(&opmlFilename, \"opml\", \"feeds.opml\", \"opml filename\")\n\n\tvar dbFilename string\n\tflag.StringVar(&dbFilename, \"db\", \"data.db\", \"database filename\")\n\n\tvar maxAgeHours uint\n\tflag.UintVar(&maxAgeHours, \"hours\", 48, \"output articles published within this many hours\")\n\n\tflag.Parse()\n\n\tvar mode int\n\n\tswitch outMode {\n\tcase \"html\":\n\t\tmode = output.HTMLOutputMode\n\tcase \"markdown\":\n\t\tmode = output.MarkdownOutputMode\n\tdefault:\n\t\tmode = output.UnknownOutputMode\n\t}\n\n\tdb, err := pebble.Open(dbFilename, nil)\n\tif err != nil {\n\t\tlog.Fatalf(\"failed to open database: %v\", err)\n\t}\n\tdefer func() { _ = db.Close() }()\n\n\tif err := processing.GetFeeds(db, opmlFilename); err != nil {\n\t\tlog.Fatalf(\"failed to get feeds: %v\", err)\n\t}\n\n\tif err := output.WriteItems(db, mode, time.Duration(int64(maxAgeHours)*int64(time.Hour))); err != nil {\n\t\tlog.Fatalf(\"failed to output items: %v\", err)\n\t}\n}", "title": "" } ]
eb71efa1a2962d64023d5d4afc01b0fa
Returns if there is any word in the trie that starts with the given prefix.
[ { "docid": "cf39fe255a387ea29e38c8795d1c48b9", "score": "0.7235364", "text": "func (this *Trie) StartsWith(prefix string) bool {\n\tif this == nil {\n\t\treturn false\n\t}\n\n\tp := this\n\tfor i := 0; i < len(prefix); i++ {\n\t\tindex := prefix[i] - 'a'\n\t\tif p.children[index] == nil {\n\t\t\treturn false\n\t\t}\n\t\tp = p.children[index]\n\t}\n\treturn p != nil\n}", "title": "" } ]
[ { "docid": "21f4feda2a0db9e99fb7a1304bdb45a1", "score": "0.7816482", "text": "func (this *Trie) StartsWith(prefix string) bool {\n\twords := []byte(prefix)\n\tif len(words) <= 0 {\n\t\treturn true\n\t}\n\tif this.StrCnt <= 0 {\n\t\treturn false\n\t}\n\ti := words[0] - 'a'\n\tif this.Root.NextMap[i] == nil {\n\t\treturn false\n\t}\n\n\tp := this.Root\n\tfor _, c := range words {\n\t\ti := c - 'a'\n\t\tif p == nil {\n\t\t\treturn false\n\t\t}\n\t\tp = p.NextMap[i]\n\t}\n\treturn p != nil\n}", "title": "" }, { "docid": "b6caa6881b352f7428c1088926618226", "score": "0.7671833", "text": "func (this *Trie) StartsWith(prefix string) bool {\n\tws := this.root\n\tfor i := 0; i < len(prefix); i++ {\n\t\tc := prefix[i]\n\t\tif ws.children[c-'a'] == nil {\n\t\t\treturn false\n\t\t} else {\n\t\t\tws = ws.children[c-'a']\n\t\t}\n\t}\n\treturn true\n\n}", "title": "" }, { "docid": "8ed3b4127e9e6a0ce585b79408d2df52", "score": "0.76705015", "text": "func (this *Trie) StartsWith(prefix string) bool {\n for _, c := range prefix {\n if _, ok := this.next[c]; !ok {\n return false\n }\n this = this.next[c]\n }\n return this != nil\n}", "title": "" }, { "docid": "1f52c7f507c98b587944b0e14c46d23c", "score": "0.76283926", "text": "func HasPrefix(m, prefix RO) bool { return strings.HasPrefix(m.str(), prefix.str()) }", "title": "" }, { "docid": "53644c359cbf8f35be379e63c830f034", "score": "0.7619623", "text": "func (this *Trie) StartsWith(prefix string) bool {\n\tcurNode := this\n\tfor _, w := range []byte(prefix) {\n\t\tif curNode.list[w-'a'] == nil {\n\t\t\treturn false\n\t\t}\n\t\tcurNode = curNode.list[w-'a']\n\t}\n\tfor i := 0; i < 26; i++ {\n\t\tif curNode.list[i] != nil {\n\t\t\treturn true\n\t\t}\n\t}\n\treturn curNode.isEnd\n}", "title": "" }, { "docid": "2168ea9b2af9c39edd9945e314848681", "score": "0.75610286", "text": "func (root *Trie) StartsWith(prefix string) bool {\n\tstart := root\n\tfor _, r := range prefix {\n\t\tif node := start.Children[r-'a']; node != nil {\n\t\t\tstart = node\n\t\t} else {\n\t\t\treturn false\n\t\t}\n\t}\n\treturn true\n}", "title": "" }, { "docid": "588f6370089a27c688292e9d08e30c45", "score": "0.7542369", "text": "func (this *Trie) StartsWith(prefix string) bool {\n\tincludes := false\n\tcurrLetter := string(prefix[0])\n\tcounter := len(prefix)\n\tprefix = prefix[1:]\n\tcounter--\n\tcurr := this.Children[currLetter]\n\tif curr == nil {\n\t\treturn includes\n\t}\n\n\tif curr.Letter+prefix == curr.Letter {\n\t\treturn true\n\t}\n\n\tfor counter > 0 && curr != nil {\n\t\tif curr != nil {\n\t\t\tcurrLetter = string(prefix[0])\n\t\t\tprefix = prefix[1:]\n\t\t\tcurr = curr.Children[currLetter]\n\t\t\tif counter == 1 && curr != nil {\n\t\t\t\tincludes = true\n\t\t\t}\n\t\t}\n\n\t\tcounter--\n\t}\n\n\treturn includes\n}", "title": "" }, { "docid": "27b8d52781aef39f7d2d6b0485dab761", "score": "0.75422066", "text": "func (this *Trie) StartsWith(prefix string) bool {\n\tcur := this.root\n\tfor _, s := range prefix {\n\t\tidx := byte(s) - byte('a')\n\t\tif cur.ch[idx] == nil {\n\t\t\treturn false\n\t\t}\n\t\tcur = cur.ch[idx]\n\t}\n\treturn true\n}", "title": "" }, { "docid": "9f0b0ff8b8c742ecb7e1dc28b5702fd0", "score": "0.7519651", "text": "func (this *Trie) StartsWith(prefix string) bool {\n\tcur := this.root\n\n\tfor _, v := range []rune(prefix) {\n\t\tc := string(v)\n\t\tif cur.next[c] == nil {\n\t\t\treturn false\n\t\t}\n\t\tcur = cur.next[c]\n\t}\n\treturn true\n}", "title": "" }, { "docid": "20a96074e11a2ffed3816ba22bc01207", "score": "0.7509479", "text": "func (this *Trie) StartsWith(prefix string) bool {\n\treturn this.findEndNode(prefix) != nil\n}", "title": "" }, { "docid": "e546a3b90e2a448b26aec927296156f4", "score": "0.7509198", "text": "func (this *Trie) StartsWith(prefix string) bool {\n\tnext := this\n\tfor _, v := range prefix {\n\t\tif next.W[v-'a'] == nil{\n\t\t\treturn false\n\t\t}\n\t\tnext = next.W[v-'a']\n\t}\n\treturn true\n}", "title": "" }, { "docid": "f831e1946fd0ca0096c98810ae517465", "score": "0.7499371", "text": "func (this *Trie) StartsWith(prefix string) bool {\n\tcur := this.root\n\tfor i := 0; i < len(prefix); i++ {\n\t\tif cur.children[prefix[i]-'a'] == nil {\n\t\t\treturn false\n\t\t}\n\t\tcur = cur.children[prefix[i]-'a']\n\t}\n\treturn true\n}", "title": "" }, { "docid": "fcb4eb204ccbee7aa22858aa83d06b52", "score": "0.74861544", "text": "func (this *Trie) StartsWith(prefix string) bool {\n\ttmp := this.node\n\tfor i := range prefix {\n\t\tif tmp.next[prefix[i]-'a'] == nil {\n\t\t\treturn false\n\t\t}\n\t\ttmp = tmp.next[prefix[i]-'a']\n\t}\n\treturn true\n}", "title": "" }, { "docid": "41c4c213af52d15ae96b822ac750ae2c", "score": "0.7480797", "text": "func (this *Trie) StartsWith(prefix string) bool {\n\tnode := this.find(prefix)\n\treturn node != nil\n}", "title": "" }, { "docid": "d258b7efa32ae5641feb0fd49f4e02e7", "score": "0.7478333", "text": "func (this *Trie) StartsWith(prefix string) bool {\n\troot := this.root\n\n\tfor i := range prefix {\n\t\troot = root.children[prefix[i]-'a']\n\t\tif root == nil {\n\t\t\treturn false\n\t\t}\n\t}\n\n\treturn true\n}", "title": "" }, { "docid": "3fcb0db729010a191e000dbe1631f1c1", "score": "0.74689466", "text": "func (this *Trie) StartsWith(prefix string) bool {\n for _, v := range prefix {\n index := v-'a'\n if this.children[index] == nil {\n return false\n }\n if this.children[index].letter != string(v) {\n return false\n }\n this = this.children[index]\n }\n return true\n}", "title": "" }, { "docid": "199d45cdfe2c62dfff6b1fa67a348829", "score": "0.7453202", "text": "func (this *Trie) StartsWith(prefix string) bool {\n\tif len(prefix) == 1 {\n\t\treturn this.tries[prefix[0]-'a'] != nil\n\t}\n\n\ti := prefix[0] - 'a'\n\tif this.tries[i] != nil {\n\t\treturn this.tries[i].StartsWith(prefix[1:])\n\t}\n\treturn false\n}", "title": "" }, { "docid": "3b18695a93994bd4911febad1c08cec1", "score": "0.74404466", "text": "func HasPrefix(s string, prefix string) bool { return strings.HasPrefix(s, prefix) }", "title": "" }, { "docid": "0323789d3de7a775d4a025a74068e488", "score": "0.74230856", "text": "func (t *Trie) StartsWith(prefix string) bool {\n\tnd := t.root\n\tfor i := 0; i < len(prefix); i++ {\n\t\tpos := int(prefix[i] - 'a')\n\t\tif nd.children[pos] == nil {\n\t\t\treturn false\n\t\t}\n\t\tnd = nd.children[pos]\n\t}\n\treturn true\n}", "title": "" }, { "docid": "4be079b401636ae1a882b6c5ec134171", "score": "0.7417552", "text": "func (this *Trie) StartsWith(prefix string) bool {\n\tif prefix == \"\" {\n\t\treturn true\n\t}\n\n\tch := prefix[0]\n\tindex := ch - 'a'\n\tif this.nodes[index] == nil {\n\t\treturn false\n\t}\n\n\treturn this.nodes[index].StartsWith(prefix[1:])\n}", "title": "" }, { "docid": "09e158ba15dee8a2c28331c9ac592ecb", "score": "0.7408884", "text": "func (t TrieList) StartsWith(prefix string) bool {\n\treturn t.search(prefix, false)\n}", "title": "" }, { "docid": "a7c36c3ba8cda7161cf8204185291492", "score": "0.7408494", "text": "func (this *Trie) StartsWith(prefix string) bool {\n\tt := this\n\tfor _, let := range prefix {\n\t\tif t.let[let-'a'] == nil {\n\t\t\treturn false\n\t\t}\n\t\tt = t.let[let-'a']\n\t}\n\treturn true\n}", "title": "" }, { "docid": "612ab7be1c5863ed60d2bfd9ddc975e2", "score": "0.74081695", "text": "func (this *Trie) StartsWith(prefix string) bool {\n\treturn searchStart(this.next, prefix, 0)\n}", "title": "" }, { "docid": "924a9ef36e725ecbf9478f2f5af8d947", "score": "0.74054337", "text": "func (this *Trie) StartsWith(prefix string) bool {\n\n\tif len(prefix) == 0 {\n\t\treturn false\n\t}\n\n\tif len(prefix) == 1 {\n\t\t_, leaveOk := this.leave[prefix[0]]\n\t\t_, indexOK := this.index[prefix[0]]\n\t\treturn leaveOk || indexOK\n\t}\n\n\tsub, ok := this.index[prefix[0]]\n\tif !ok {\n\t\treturn false\n\t}\n\treturn sub.StartsWith(prefix[1:])\n}", "title": "" }, { "docid": "a5e8682410517965827682ea3f1913e5", "score": "0.7402584", "text": "func (this *Trie) StartsWith(prefix string) bool {\n\ttree := this\n\tfor i := 0; i < len(prefix); i++ {\n\t\tnextTree, ok := tree.node[prefix[i]]\n\t\tif !ok {\n\t\t\treturn false\n\t\t} else {\n\t\t\ttree = nextTree\n\t\t}\n\t}\n\treturn true\n}", "title": "" }, { "docid": "b4b2dbee12b26de9a47232a6ff20b4de", "score": "0.738967", "text": "func (this *Trie) StartsWith(prefix string) bool {\n\tcur := this\n\tfor i := range prefix {\n\t\tif cur.children[int(prefix[i] - 'a')] == nil {\n\t\t\treturn false\n\t\t}\n\t\tcur = cur.children[int(prefix[i] - 'a')]\n\t}\n\treturn true\n}", "title": "" }, { "docid": "0e2dcc9de65c95b555c5b696dc51f037", "score": "0.7386049", "text": "func (this *Trie) StartsWith(prefix string) bool {\n\tt := this\n\tfor _, letter := range prefix {\n\t\tindex := int(letter - 'a')\n\t\tif t.next[index] != nil {\n\t\t\tt = t.next[index]\n\t\t} else {\n\t\t\treturn false\n\t\t}\n\t}\n\treturn true\n}", "title": "" }, { "docid": "6fd805c5e138a1ff7ef84890bdbcbff1", "score": "0.7381511", "text": "func (this *Trie) StartsWith(prefix string) bool {\n\troot := this.root\n\tfor _, c := range prefix {\n\t\ti := c - 'a'\n\t\tif root.child[i] == nil {\n\t\t\treturn false\n\t\t}\n\t\troot = root.child[i]\n\t}\n\treturn true\n}", "title": "" }, { "docid": "a59361328db3194301f0d4c41f9104fe", "score": "0.73812693", "text": "func (this *Trie) StartsWith(prefix string) bool {\n\tcurr := this\n\tfor i := 0; i < len(prefix); i++ {\n\t\tif curr.Next[prefix[i]-'a'] == nil {\n\t\t\treturn false\n\t\t}\n\t\tcurr = curr.Next[prefix[i]-'a']\n\t}\n\treturn true\n}", "title": "" }, { "docid": "401f7bd87e79af26f7a1020743afb289", "score": "0.737693", "text": "func (this *Trie) StartsWith(prefix string) bool {\n\tnode := &this.Root\n\tfor i := 0; i < len(prefix); i++ {\n\t\tj := prefix[i] - 'a'\n\t\tnode = node.Children[j]\n\t\tif node == nil {\n\t\t\treturn false\n\t\t}\n\t}\n\tif node.Exist {\n\t\treturn true\n\t}\n\tfor _, child := range node.Children {\n\t\tif child != nil {\n\t\t\treturn true\n\t\t}\n\t}\n\treturn false\n}", "title": "" }, { "docid": "3ed075ea36029815ddef8165d55220c0", "score": "0.7362358", "text": "func (this *Trie) StartsWith(prefix string) bool {\n\tcur := this\n\tfor _, c := range prefix {\n\t\tidx := c - 'a'\n\t\tif cur.Ch[idx] == nil {\n\t\t\treturn false\n\t\t} else {\n\t\t\tcur = cur.Ch[idx]\n\t\t}\n\t}\n\treturn true\n}", "title": "" }, { "docid": "3a11d0498ba862202932816ba8b8e820", "score": "0.7324879", "text": "func (this *Trie) StartsWith(prefix string) bool {\n\tthis.Search(prefix)\n\treturn this.startWith\n}", "title": "" }, { "docid": "568a13fbb8e9613bd3400ce76f772dd5", "score": "0.7314436", "text": "func (this *Trie) StartsWith(prefix string) bool {\n\tnode := this.root\n\tfor _, c := range prefix {\n\t\tindex := c - 'a'\n\t\tif node.childrens[index] == nil {\n\t\t\treturn false\n\t\t}\n\t\tnode = node.childrens[index]\n\t}\n\treturn true\n}", "title": "" }, { "docid": "5d006c481132fb2f845bc3325ffe8298", "score": "0.73120576", "text": "func HasPrefix(s, prefix []byte) bool", "title": "" }, { "docid": "600b46ee32119feb2c6889b7d24d34e2", "score": "0.7308053", "text": "func (this *Trie) StartsWith(prefix string) bool {\n\tif prefix == \"\" {\n\t\treturn false\n\t}\n\tt := this\n\n\tfor ix := range prefix {\n\t\tl := prefix[ix] - 'a'\n\t\tif t.children[l] == nil {\n\t\t\treturn false\n\t\t}\n\t\tt = t.children[l]\n\t}\n\treturn true\n}", "title": "" }, { "docid": "d18cb82f8f835531333a8a428a236065", "score": "0.730307", "text": "func (this *Trie) StartsWith(prefix string) bool {\n\tindexTrie := this\n\tfor _, char := range prefix {\n\t\tindexTrie = indexTrie.child[char - 'a']\n\t\tif (indexTrie == nil) {\n\t\t\treturn false\n\t\t}\n\t}\n\treturn true\n}", "title": "" }, { "docid": "61fb86c776c55fb8e72aae5704cb2bb0", "score": "0.7293699", "text": "func (this *WordDictionary) StartsWith(prefix string) bool {\n for _,c := range prefix{\n if this.have[c - 'a'] == nil{\n return false \n }\n this = this.have[c - 'a'] \n }\n return true \n}", "title": "" }, { "docid": "e06b335a01e196c5d4d024dfcc974f0a", "score": "0.72895217", "text": "func IsStartOf(s, prefix string) bool { return strings.HasPrefix(s, prefix) }", "title": "" }, { "docid": "c7864770b6cd44bcff07b2c8a0da1a8d", "score": "0.728239", "text": "func (t *Trie) FindStartWith(prefix string) bool {\n\treturn t._search(prefix, true, t.noop)\n}", "title": "" }, { "docid": "4c88b7efdba6938d432871927dfae91e", "score": "0.72550267", "text": "func (this *Trie) StartsWith(prefix string) bool {\n\tfor _, c := range prefix {\n\t\ti := c - 'a'\n\t\tif this.node[i] == nil {\n\t\t\treturn false\n\t\t}\n\t\tthis = this.node[i]\n\t}\n\treturn true\n}", "title": "" }, { "docid": "d8ad042962159bba7b9149f1e760ddf1", "score": "0.7230239", "text": "func (this *Trie) StartsWith(prefix string) bool {\n\tif len(prefix) == 0 {\n\t\treturn true\n\t}\n\tfor i := 0; i < len(prefix); i++ {\n\t\tc := prefix[i] - 'a'\n\t\tif this == nil || this.c == nil || this.c[c] == nil {\n\t\t\treturn false\n\t\t}\n\t\tthis = this.c[c]\n\t}\n\treturn true\n}", "title": "" }, { "docid": "f59c9b3c1fe88d2f7cd0b2ec58680bf3", "score": "0.7150572", "text": "func (t *Trie) StartsWith(prefix string) bool {\n\tnode := t\n\tfor _, c := range prefix {\n\t\tif _, ok := node.Nexts[c]; !ok {\n\t\t\treturn false\n\t\t}\n\t\tnode = node.Nexts[c]\n\t}\n\treturn true\n}", "title": "" }, { "docid": "6b58bf71eafd15970cc9e1543d776d97", "score": "0.7148969", "text": "func (this *Trie) StartsWith(prefix string) bool {\n\tnode := this\n\tfor i := 0; i < len(prefix); i++ {\n\t\tv, ok := node.children[prefix[i]]\n\t\tif !ok {\n\t\t\treturn false\n\t\t}\n\t\tnode = v\n\t}\n\treturn true\n}", "title": "" }, { "docid": "e69fa5828c92f6a20e8b423d68df6074", "score": "0.70809406", "text": "func (this *Trie) StartsWith(word string) bool {\n next := this\n for _, c := range word {\n i := c - 'a'\n //fmt.Println(next)\n if next.next[i] == nil {\n return false\n }\n next = next.next[i]\n }\n return true\n}", "title": "" }, { "docid": "29874d2acd4a497a2c31db0ad33060fb", "score": "0.7012085", "text": "func ContainsPrefix(a []string, prefix string) bool {\n\treturn IndexPrefix(a, prefix) >= 0\n}", "title": "" }, { "docid": "4c8a2b8ed2245e4247d987b8341475dd", "score": "0.6962122", "text": "func HasPrefix(s string) bool {\n\tprefixes := []string{\n\t\t`{\"Secret\":`,\n\t\t`{\"TestName\":`,\n\t\t`{\"Score\":`,\n\t\t`{\"MaxScore\":`,\n\t\t`{\"Weight\":`,\n\t}\n\ttrimmed := strings.TrimSpace(s)\n\tfor _, prefix := range prefixes {\n\t\tif strings.HasPrefix(trimmed, prefix) {\n\t\t\treturn true\n\t\t}\n\t}\n\treturn false\n}", "title": "" }, { "docid": "2ce4b26b466f0c232121226e09542567", "score": "0.6880817", "text": "func hasPrefix(s string, prefixes []string) bool {\n\tif len(s) == 0 || len(prefixes) == 0 {\n\t\treturn false\n\t}\n\n\tfor _, p := range prefixes {\n\t\tif strings.HasPrefix(s, p) {\n\t\t\treturn true\n\t\t}\n\t}\n\n\treturn false\n}", "title": "" }, { "docid": "054b4814e1c74f1c17e3acfb9d0dad37", "score": "0.6832996", "text": "func hasPrefix(s, prefix string) (string, bool) {\n\tvar (\n\t\ttoken tokener.Tokener\n\t\tsi, pi int\n\t)\n\tfor ; pi < len(prefix); pi++ {\n\t\ttoken.Visit(prefix[pi])\n\t\tlastQuote := !token.Escaped() && (prefix[pi] == '\"' || prefix[pi] == '\\'')\n\t\tif lastQuote {\n\t\t\tcontinue\n\t\t}\n\t\tif si == len(s) {\n\t\t\tbreak\n\t\t}\n\t\tif s[si] == ' ' && !token.Quoted() && token.Escaped() {\n\t\t\ts = s[:si] + \"\\\\\" + s[si:]\n\t\t}\n\t\tif s[si] != prefix[pi] {\n\t\t\treturn \"\", false\n\t\t}\n\t\tsi++\n\t}\n\n\tif pi < len(prefix) {\n\t\treturn \"\", false\n\t}\n\n\tfor ; si < len(s); si++ {\n\t\ttoken.Visit(s[si])\n\t}\n\n\treturn token.Closed(), true\n}", "title": "" }, { "docid": "e52b4283cf0cb3148bca159bc16c8fec", "score": "0.67930007", "text": "func anyMatchingPrefix(target string, prefixes []string) bool {\n\tfor _, prefix := range prefixes {\n\t\tif strings.HasPrefix(target, prefix) {\n\t\t\treturn true\n\t\t}\n\t}\n\treturn false\n}", "title": "" }, { "docid": "117db5590f8976a95a77e2d9a330fc13", "score": "0.6786322", "text": "func HasOnePrefix(s string, prefixes []string) bool {\n\tfor _, prefix := range prefixes {\n\t\tif strings.HasPrefix(s, prefix) {\n\t\t\treturn true\n\t\t}\n\t}\n\treturn false\n}", "title": "" }, { "docid": "bafff566ece5c2b08899affbcafaa217", "score": "0.6746001", "text": "func prefixCheck(in string, prefix []string) (bool, string) {\n\tinput := strings.ToLower(in)\n\tfor i := 0; i < len(prefix); i++ {\n\t\tif strings.HasPrefix(input, prefix[i]) {\n\t\t\treturn true, prefix[i]\n\t\t}\n\t}\n\treturn false, \"\"\n}", "title": "" }, { "docid": "c93e81bf01b547e5480e159ab7651041", "score": "0.6739297", "text": "func HasPrefixAny(s string, prefixes ...string) bool {\n\tfor _, prefix := range prefixes {\n\t\tif strings.HasPrefix(s, prefix) {\n\t\t\treturn true\n\t\t}\n\t}\n\treturn false\n}", "title": "" }, { "docid": "c5dc240691531ab35ad7ecdb1bbeaa73", "score": "0.6673507", "text": "func HasPrefix(msg string, prefixes []string) bool {\n\tmsg = strings.ToLower(msg)\n\tfor _, prefix := range prefixes {\n\t\tif strings.HasPrefix(msg, strings.ToLower(prefix)) {\n\t\t\treturn true\n\t\t}\n\t}\n\treturn false\n}", "title": "" }, { "docid": "53cd213d7c5a4fe81c839850becfe427", "score": "0.6658149", "text": "func HasAnyPrefix(s string, prefix []string) (bool, string) {\n\tfor _, p := range prefix {\n\t\tif strings.HasPrefix(s, p) {\n\t\t\treturn true, p\n\t\t}\n\t}\n\treturn false, \"\"\n}", "title": "" }, { "docid": "ea5ea31642c5586c1bde6596dd209970", "score": "0.66407436", "text": "func HasPrefix(substr string, str string) bool {\n\treturn strings.HasPrefix(str, substr)\n}", "title": "" }, { "docid": "2565a40ef8e0e0a6b888352dfad67f6e", "score": "0.659101", "text": "func HasPrefixFold(str, prefix string) bool {\n\treturn len(str) >= len(prefix) && strings.EqualFold(str[0:len(prefix)], prefix)\n}", "title": "" }, { "docid": "645016157e0e812d1044697ba63ca218", "score": "0.6585919", "text": "func (h *Hex) HasPrefix(data []byte) bool {\n\treturn bytes.HasPrefix(data, h.prefix) || bytes.HasPrefix(data, bytes.ToUpper(h.prefix))\n}", "title": "" }, { "docid": "efde79eeba27f7e8f84a3dcc920676d4", "score": "0.6564504", "text": "func (t *Trie) PrefixSearch(word []rune) ([]rune, interface{}) {\n\tprefixIndex := -1\n\tvar val interface{}\n\tnext := t\n\tfor i, w := range word {\n\t\tnext = next.Next[w]\n\t\tif next == nil {\n\t\t\tbreak\n\t\t}\n\t\tprefixIndex = i\n\t\tval = next.Value\n\t}\n\n\tif prefixIndex < 0 {\n\t\treturn []rune{}, nil\n\t}\n\n\treturn word[0 : prefixIndex+1], val\n}", "title": "" }, { "docid": "c8a41a77eba2db163464f550cf897ef3", "score": "0.6553493", "text": "func hasPrefix(str string) bool {\n\tif len(str) <= 0 {\n\t\treturn false\n\t}\n\treturn str[0] == ':'\n}", "title": "" }, { "docid": "ba6509cd342af5033092cb183ef552a0", "score": "0.6544227", "text": "func StartWith(input, prefix string) bool {\n\treturn len(input) >= len(prefix) && input[0:len(prefix)] == prefix\n}", "title": "" }, { "docid": "69f15ef798a2b0bbc2c207607c6ce4b5", "score": "0.6449372", "text": "func IsStartsOf(s string, prefixes []string) bool {\n\treturn HasOnePrefix(s, prefixes)\n}", "title": "" }, { "docid": "c6dd9f754429757f24866c92b2e7e466", "score": "0.64356446", "text": "func (ctx *Ctx) MatchPrefix() bool {\n\treturn HasAnyPrefix(strings.ToLower(ctx.Message.Content), ctx.Router.Prefixes...)\n}", "title": "" }, { "docid": "72c91cbe3285585735360da253c3c330", "score": "0.6430543", "text": "func HasAnyPrefix(text string, slice []string) bool {\n\tfor _, s := range slice {\n\t\tif strings.HasPrefix(text, s) {\n\t\t\treturn true\n\t\t}\n\t}\n\treturn false\n}", "title": "" }, { "docid": "cb7001e38a232bcaa500f527bdfcb9e3", "score": "0.64123034", "text": "func HasPrefix(s string, p ...string) bool {\n\tfor _, i := range p {\n\t\tif strings.HasPrefix(s, i) {\n\t\t\treturn true\n\t\t}\n\t}\n\n\treturn false\n}", "title": "" }, { "docid": "0a1ea8842e5d669c8c346483f8685772", "score": "0.6402595", "text": "func (c *client) matchesPrefix(key string, prefixes []string) bool {\n\tfor _, p := range prefixes {\n\t\tif strings.HasPrefix(key, p) {\n\t\t\treturn true\n\t\t}\n\t}\n\treturn false\n}", "title": "" }, { "docid": "750ebeddbaa49cec6706b72746b5cdcd", "score": "0.6358657", "text": "func hasPrefix(s []byte, prefix []byte, skip byte) (bool, int) {\n\tif len(s) < len(prefix) || len(s) == 0 || len(prefix) == 0 {\n\t\treturn false, 0\n\t}\n\tif prefix[0] != skip || s[0] != skip {\n\t\treturn bytes.HasPrefix(s, prefix), 0\n\t}\n\tfor i := 0; i < len(s); i++ {\n\t\tif s[i] != skip {\n\t\t\treturn bytes.HasPrefix(s[i-1:], prefix), i - 1\n\t\t}\n\t}\n\treturn false, 0\n}", "title": "" }, { "docid": "c78bf269c25235ab082902a7c851459b", "score": "0.6352968", "text": "func (lt *SafeTree[VT]) WalkPrefix(prefix string, fn WalkFn[VT]) bool {\n\tlt.m.RLock()\n\tdefer lt.m.RUnlock()\n\treturn lt.t.WalkPrefix(prefix, fn)\n}", "title": "" }, { "docid": "cd6b17f383ab8ab65566dbd662d5fdc1", "score": "0.63286126", "text": "func (i Item) HasPrefix(prefix string) bool {\n\tif i.Type != ItemText {\n\t\treturn false\n\t}\n\treturn strings.HasPrefix(i.Val, prefix)\n}", "title": "" }, { "docid": "aa4fa5936d48ddb1da0de43c07801650", "score": "0.631113", "text": "func (root *Trie) Search(word string) bool {\n\tstart := root\n\tfor _, r := range word {\n\t\tif node := start.Children[r-'a']; node != nil {\n\t\t\tstart = node\n\t\t} else {\n\t\t\treturn false\n\t\t}\n\t}\n\tif node := start.Children[26]; node != nil {\n\t\treturn true\n\t}\n\treturn false\n}", "title": "" }, { "docid": "295c019123cc14ca3876d17feed9f9bc", "score": "0.6252703", "text": "func (r RuleName) HasPrefix(prefix ...string) bool {\n\tprefixSegments := make([]string, 0, len(prefix))\n\n\tfor _, prefixSegment := range prefix {\n\t\tprefixSegments = append(prefixSegments, strings.Split(prefixSegment, \"::\")...)\n\t}\n\n\tprefixStr := strings.Join(prefixSegments, nameSeparator)\n\n\treturn string(r) == prefixStr || strings.HasPrefix(string(r), prefixStr+nameSeparator)\n}", "title": "" }, { "docid": "23358ff5c426aff18373b3bc08dd6793", "score": "0.6240741", "text": "func HasPrefix() predicate.Patient {\n\treturn predicate.Patient(func(s *sql.Selector) {\n\t\tstep := sqlgraph.NewStep(\n\t\t\tsqlgraph.From(Table, FieldID),\n\t\t\tsqlgraph.To(PrefixTable, FieldID),\n\t\t\tsqlgraph.Edge(sqlgraph.M2O, true, PrefixTable, PrefixColumn),\n\t\t)\n\t\tsqlgraph.HasNeighbors(s, step)\n\t})\n}", "title": "" }, { "docid": "24cefe470faa2f5252b0dd7bc775f990", "score": "0.6217249", "text": "func HasPrefixFold(s, pre string) (_ bool) {\n\tif len(s) < len(pre) {\n\t\treturn\n\t}\n\n\tvar pr, sr rune\n\tvar i int\n\n\tfor i, pr = range pre {\n\t\t_ = s[i]\n\t\tif pr < utf8.RuneSelf {\n\t\t\tif !asciiEq(byte(pr), s[i]) {\n\t\t\t\treturn\n\t\t\t}\n\t\t\tcontinue\n\t\t}\n\n\t\tif sr, _ = utf8.DecodeRuneInString(s[i:]); !runeEq(pr, sr) {\n\t\t\treturn\n\t\t}\n\t}\n\n\treturn true\n}", "title": "" }, { "docid": "0e5882d5f51f009a30cea78c80685611", "score": "0.6217034", "text": "func (this *Trie) Search(word string) bool {\n\tws := this.root\n\tfor i := 0; i < len(word); i++ {\n\t\tc := word[i]\n\t\tif ws.children[c-'a'] == nil {\n\t\t\treturn false\n\t\t}\n\t\tws = ws.children[c-'a']\n\t}\n\treturn ws.isWord\n\n}", "title": "" }, { "docid": "7e139c1445c20e942af1eeb9e25dcc0b", "score": "0.6213773", "text": "func (this *Trie) Search(word string) bool {\n for _, c := range word {\n if _, ok := this.next[c]; !ok {\n return false\n }\n this = this.next[c]\n }\n return this.isWord\n}", "title": "" }, { "docid": "6f8e5c36e62537c9b449cc040b12c459", "score": "0.6186233", "text": "func (tk Token) IsPrefix() bool {\n\treturn tk.IsOpener() || tk == NOT\n}", "title": "" }, { "docid": "c8c5e206dfcd04c6aca8ad6c16d3b09d", "score": "0.6176602", "text": "func (this *Trie) Search(word string) bool {\n\troot := this.root\n\tfor _, c := range word {\n\t\ti := c - 'a'\n\t\tif root.child[i] == nil {\n\t\t\treturn false\n\t\t}\n\t\troot = root.child[i]\n\t}\n\treturn root != nil && root.isLeaf\n}", "title": "" }, { "docid": "84624fb906f273d9911a6547ec8e1f80", "score": "0.61364716", "text": "func (this *Trie) Search(word string) bool {\n\tif word == \"\" {\n\t\treturn false\n\t}\n\tt := this\n\n\tfor ix := range word {\n\t\tl := word[ix] - 'a'\n\t\tif t.children[l] == nil {\n\t\t\treturn false\n\t\t}\n\t\tt = t.children[l]\n\t}\n\treturn t.isLeaf\n}", "title": "" }, { "docid": "25140f3137121e06d4fa92159d842f6f", "score": "0.612621", "text": "func (this *Trie) Search(word string) bool {\n\troot := this.root\n\n\tfor i := range word {\n\t\troot = root.children[word[i]-'a']\n\t\tif root == nil {\n\t\t\treturn false\n\t\t}\n\t}\n\n\treturn root.isWord\n}", "title": "" }, { "docid": "06ba520aa59f73f148006f2a937351e7", "score": "0.61256504", "text": "func (this *Trie) Search(word string) bool {\n\tfor _, c := range word {\n\t\ti := c - 'a'\n\t\tif this.node[i] == nil {\n\t\t\treturn false\n\t\t}\n\t\tthis = this.node[i]\n\t}\n\treturn this.isEnd == true\n}", "title": "" }, { "docid": "053f2ae791d933a3c9d9bdfe2db69b20", "score": "0.6123128", "text": "func (this *Trie) Search(word string) bool {\n\tcurNode := this\n\tfor _, w := range []byte(word) {\n\t\tif curNode.list[w-'a'] == nil {\n\t\t\treturn false\n\t\t}\n\t\tcurNode = curNode.list[w-'a']\n\t}\n\treturn curNode.isEnd\n}", "title": "" }, { "docid": "21b5302725964877caf4f967c5c03ba6", "score": "0.6110742", "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": "6cd9d193f74744465c0e1c6ef03e5198", "score": "0.6100971", "text": "func (t *Trie) Search(word string) bool {\n\tnd := t.root\n\tfor i := 0; i < len(word); i++ {\n\t\tpos := int(word[i] - 'a')\n\t\tif nd.children[pos] == nil {\n\t\t\treturn false\n\t\t}\n\t\tnd = nd.children[pos]\n\t}\n\treturn nd.isWord\n}", "title": "" }, { "docid": "18b945e0a6b1868fa82ebee18ab049a9", "score": "0.60959274", "text": "func (this *Trie) Search(word string) bool {\n\tindexTrie := this\n\tfor _, char := range word {\n\t\tindexTrie = indexTrie.child[char - 'a']\n\t\tif (indexTrie == nil) {\n\t\t\treturn false\n\t\t}\n\t}\n\treturn indexTrie.isEnd\n}", "title": "" }, { "docid": "70146e06d699778392cd7ffc1d76592e", "score": "0.6087484", "text": "func HasPrefix(col, prefix string) *Predicate {\n\treturn (&Predicate{}).HasPrefix(col, prefix)\n}", "title": "" }, { "docid": "77b4d8e90d8ccba757844b6d3ef49ba0", "score": "0.60840297", "text": "func (k Key) HasPrefix(pref Key) bool {\n\tif len(pref) == 0 {\n\t\treturn true\n\t} else if len(k) < len(pref) {\n\t\treturn false\n\t}\n\tfor i, p := range pref {\n\t\ts := k[i]\n\t\tif i == len(pref)-1 {\n\t\t\tif !bytes.HasPrefix(s, p) {\n\t\t\t\treturn false\n\t\t\t}\n\t\t} else {\n\t\t\tif !bytes.Equal(s, p) {\n\t\t\t\treturn false\n\t\t\t}\n\t\t}\n\t}\n\treturn true\n}", "title": "" }, { "docid": "dfa49423a23f6d186ffa1a0296f46198", "score": "0.60809535", "text": "func (this *Trie) Search(word string) bool {\n\tnode := this.root\n\tfor _, c := range word {\n\t\tindex := c - 'a'\n\t\tif node.childrens[index] == nil {\n\t\t\treturn false\n\t\t}\n\t\tnode = node.childrens[index]\n\t}\n\treturn node.isLeaf\n}", "title": "" }, { "docid": "747f58d256f1291dfbe76f77122d9a12", "score": "0.6061398", "text": "func (this *Trie) Search(word string) bool {\n\tif this == nil {\n\t\treturn false\n\t}\n\n\tp := this\n\tfor i := 0; i < len(word); i++ {\n\t\tindex := word[i] - 'a'\n\t\tif p.children[index] == nil {\n\t\t\treturn false\n\t\t}\n\t\tp = p.children[index]\n\t}\n\treturn p != nil && p.isEndOfWord\n}", "title": "" }, { "docid": "49fa11b5c5c0b30e005df79b24fc8692", "score": "0.60600483", "text": "func (p *Predicate) HasPrefix(col, prefix string) *Predicate {\n\treturn p.Like(col, prefix+\"%\")\n}", "title": "" }, { "docid": "bffc47ff53d0bf714b3784a6cdb256a4", "score": "0.60584116", "text": "func (this *Trie) Search(word string) bool {\n\tcur := this.root\n\tfor i := 0; i < len(word); i++ {\n\t\tif cur.children[word[i]-'a'] == nil {\n\t\t\treturn false\n\t\t}\n\t\tcur = cur.children[word[i]-'a']\n\t}\n\tif cur.isEnd {\n\t\treturn true\n\t}\n\treturn false\n}", "title": "" }, { "docid": "6d563df424df7d4d86b7c4d12b822cd8", "score": "0.60402095", "text": "func (this *Trie) Search(word string) bool {\n\tnext := this\n\tfor _, v := range word {\n\t\tif next.W[v-'a'] == nil{\n\t\t\treturn false\n\t\t}\n\t\tnext = next.W[v-'a']\n\t}\n\treturn next != nil && next.IsEnd\n}", "title": "" }, { "docid": "e8706fe162699456911b8ba770071957", "score": "0.6032632", "text": "func (this *Trie) Search(word string) bool {\n\tnode := &this.Root\n\tfor i := 0; i < len(word); i++ {\n\t\tj := word[i] - 'a'\n\t\tnode = node.Children[j]\n\t\tif node == nil {\n\t\t\treturn false\n\t\t}\n\t}\n\treturn node.Exist\n}", "title": "" }, { "docid": "7c294379331722a01ddaefa628a6b4d8", "score": "0.60293144", "text": "func (this *Trie) Search(word string) bool {\n\tcurr := this\n\tfor i := 0; i < len(word); i++ {\n\t\tif curr.Next[word[i]-'a'] == nil {\n\t\t\treturn false\n\t\t}\n\t\tcurr = curr.Next[word[i]-'a']\n\t}\n\tif curr.IsEnd == false {\n\t\treturn false\n\t}\n\treturn true\n}", "title": "" }, { "docid": "5c158474c2a2c62880c5e36342b7ff7b", "score": "0.60219294", "text": "func (t *Trie) Search(word string) bool {\n\tnode := t\n\tfor _, c := range word {\n\t\tif _, ok := node.Nexts[c]; !ok {\n\t\t\treturn false\n\t\t}\n\t\tnode = node.Nexts[c]\n\t}\n\treturn node.IsEnd\n}", "title": "" }, { "docid": "a5860c20c1fb784cb85947c963bc0cbb", "score": "0.5982043", "text": "func isPathInPrefixList(path string, prefix []string) bool {\n\tfor _, p := range prefix {\n\t\tif strings.HasPrefix(path, p+\"/\") {\n\t\t\treturn true\n\t\t}\n\t}\n\treturn false\n}", "title": "" }, { "docid": "13468a4f622dbd5f1b5696aa64482dda", "score": "0.5980842", "text": "func (this *Trie) Search(str string) bool {\n\tincludes := false\n\tcurrLetter := string(str[0])\n\tcounter := len(str)\n\tstr = str[1:]\n\tcounter--\n\tcurr := this.Children[currLetter]\n\tif curr == nil {\n\t\treturn includes\n\t}\n\n\tif curr.Letter+str == curr.Letter {\n\t\treturn true\n\t}\n\n\tfor counter > 0 && curr != nil {\n\t\tif curr != nil {\n\t\t\tcurrLetter = string(str[0])\n\t\t\tstr = str[1:]\n\t\t\tcurr = curr.Children[currLetter]\n\t\t\tif counter == 1 && curr != nil && curr.IsWord == true {\n\t\t\t\tincludes = true\n\t\t\t}\n\t\t}\n\n\t\tcounter--\n\t}\n\n\treturn includes\n}", "title": "" }, { "docid": "80323b53bae21090071826056407adec", "score": "0.5973877", "text": "func (this *Trie) Search(word string) bool {\n for _, v := range word {\n index := v-'a'\n if this.children[index] == nil {\n return false\n }\n if this.children[index].letter != string(v) {\n return false\n }\n this = this.children[index]\n }\n if this.isEnd {\n return true\n } else {\n return false\n }\n}", "title": "" }, { "docid": "ef1eb6426f5c84af100f58fadaf4a872", "score": "0.5962547", "text": "func (me TxsdTagClass) IsPrefix() bool { return me == \"prefix\" }", "title": "" }, { "docid": "242ea9ad69b3352b92fc7a65418ee099", "score": "0.5955909", "text": "func (this *Trie) Search(word string) bool {\n\ttmp := this.node\n\tfor i := range word {\n\t\tif tmp.next[word[i]-'a'] == nil {\n\t\t\treturn false\n\t\t}\n\t\ttmp = tmp.next[word[i]-'a']\n\t}\n\treturn tmp.next[26] != nil\n}", "title": "" }, { "docid": "94792513803504bb73f4adf53d3a32e6", "score": "0.5954862", "text": "func (this *Trie) Search(word string) bool {\n\tcur := this.root\n\tfor _, s := range word {\n\t\tidx := byte(s) - byte('a')\n\t\tif cur.ch[idx] == nil {\n\t\t\treturn false\n\t\t}\n\t\tcur = cur.ch[idx]\n\t}\n\treturn cur.leaf\n}", "title": "" }, { "docid": "c1a6168e1e4c8eda5d1245203dbec7e7", "score": "0.5938858", "text": "func (this *Trie) Search(word string) bool {\n\tt := this\n\tfor _, let := range word {\n\t\tif t.let[let-'a'] == nil {\n\t\t\treturn false\n\t\t}\n\t\tt = t.let[let-'a']\n\t}\n\treturn t.end\n}", "title": "" } ]
9b43c00cc3e7d51dc17ca01f1458617a
Acceleration returns the acceleration of the provided x, y, z
[ { "docid": "86d454b2bea1f7a2f2e641d9a36e95a7", "score": "0.6893252", "text": "func (h *MMA7660Driver) Acceleration(x, y, z float64) (ax, ay, az float64) {\n\treturn x / 21.0, y / 21.0, z / 21.0\n}", "title": "" } ]
[ { "docid": "bdc80ef20a30fe5085b175f280203546", "score": "0.6161874", "text": "func (s *State) Acceleration() (float64, float64, float64) {\n\treturn s.X / 21.0, s.Y / 21.0, s.Y / 21.0\n}", "title": "" }, { "docid": "746ffb48d007b649867b2cf3ab93756e", "score": "0.5918624", "text": "func NewAcceleration() Acceleration {\n\ta := acceleration{\n\t\trotational: mgl32.Vec3{0, 0, 0},\n\t\ttranslational: mgl32.Vec3{0, 0, 0},\n\t}\n\treturn &a\n}", "title": "" }, { "docid": "0298f65698faf6e129216a573a4d9ea4", "score": "0.5877331", "text": "func delta(z, x float64) float64 {\n return (z*z - x) / (2 * z)\n}", "title": "" }, { "docid": "e93755bbb3ef51feb7df22ba21f4eec8", "score": "0.5817357", "text": "func (p *Projectile) Acceleration() Vector {\n\treturn p.acc\n}", "title": "" }, { "docid": "85aa870ba45ce0fca011c2169b87776b", "score": "0.56008303", "text": "func (p *PhidgetAccelerometer) GetAcceleration() ([]float32, error) {\n\tvar r [3]C.double\n\tcerr := C.PhidgetAccelerometer_getAcceleration(p.handle, &r)\n\tif cerr != C.EPHIDGET_OK {\n\t\treturn nil, errors.New(p.getErrorDescription(cerr))\n\t}\n\tvar ret []float32 = []float32{ (float32)(r[0]), (float32)(r[1]), (float32)(r[2]) }\n\treturn ret, nil\n}", "title": "" }, { "docid": "4fa3b7841138446a329d990e85085a83", "score": "0.54857516", "text": "func (v Vec3) Z() float64 { return v[2] }", "title": "" }, { "docid": "18b2c071ef903ae8d03da70371d58082", "score": "0.5458424", "text": "func (v Vec3) Z() float32 {\n\treturn v[2]\n}", "title": "" }, { "docid": "a0e506300e9c0c380a5b333970c740b4", "score": "0.54375035", "text": "func (v *Vector3) Z() float64 {\n\treturn v.p.Get(\"z\").Float()\n}", "title": "" }, { "docid": "0a98e22bc4958976c6b115f2cb9d2720", "score": "0.5384365", "text": "func (obj Vec3) Z() float32 {\n\treturn obj[2]\n}", "title": "" }, { "docid": "f64648cb588fd3ed8fe1dd44814696c3", "score": "0.5343379", "text": "func (v Vec3) Z() float64 {\n\treturn v[2]\n}", "title": "" }, { "docid": "1e58c093d6509565619896896b549905", "score": "0.5286112", "text": "func (v *Vec3) Z() float64 {\n\treturn v.e[2]\n}", "title": "" }, { "docid": "2a5e0c0c1db7883076bd4f95af6dc552", "score": "0.5160239", "text": "func (o *PutPrinterHeadsHeadIDExtrudersExtruderIDFeederAccelerationParams) SetAcceleration(acceleration *float64) {\n\to.Acceleration = acceleration\n}", "title": "" }, { "docid": "0a01b8872876afe61dcf5c45612037ad", "score": "0.50815237", "text": "func (p *PhidgetAccelerometer) GetMinAcceleration() ([]float32, error) {\n\tvar r [3]C.double\n\tcerr := C.PhidgetAccelerometer_getMinAcceleration(p.handle, &r)\n\tif cerr != C.EPHIDGET_OK {\n\t\treturn nil, errors.New(p.getErrorDescription(cerr))\n\t}\n\tvar ret []float32 = []float32{ (float32)(r[0]), (float32)(r[1]), (float32)(r[2]) }\n\treturn ret, nil\n}", "title": "" }, { "docid": "ab94ae89cbae0847aa0ca4b1e74e8a9a", "score": "0.49953857", "text": "func (p *PhidgetAccelerometer) GetAccelerationChangeTrigger() (float32, error) {\n\tvar r C.double\n\tcerr := C.PhidgetAccelerometer_getAccelerationChangeTrigger(p.handle, &r)\n\tif cerr != C.EPHIDGET_OK {\n\t\treturn 0, errors.New(p.getErrorDescription(cerr))\n\t}\n\treturn cDoubleTofloat32(r), nil\n}", "title": "" }, { "docid": "bb6d11fa67af25aaff2cad37611b652d", "score": "0.4974978", "text": "func (t Triangle) Z(x, y float64) float64 {\n\tac := t.C.Sub(t.A)\n\tab := t.B.Sub(t.A)\n\n\tcp := ac.Cross(ab)\n\ta, b, c := cp.X, cp.Y, cp.Z\n\n\td := cp.Dot(t.C)\n\n\treturn (d - a*x - b*y) / c\n}", "title": "" }, { "docid": "e0c7c7b5686e1daafdb6bc0ffeaf5c2e", "score": "0.4938167", "text": "func (v *Vector3) X() float64 {\n\treturn v.p.Get(\"x\").Float()\n}", "title": "" }, { "docid": "2423369b2aadb0701de7ceef8586dc51", "score": "0.49276105", "text": "func (q *Quaternion) Z() float64 {\n\treturn q.p.Get(\"z\").Float()\n}", "title": "" }, { "docid": "f4c330b9f3a9ac6c139e0ba3c38e2e68", "score": "0.49052072", "text": "func (f *Float32) Get(x, y, z int) float32 {\n\treturn f.Data[(x+y*f.Width)*f.Depth+z]\n}", "title": "" }, { "docid": "3967c644e3737070007d00bd355bb53f", "score": "0.4857756", "text": "func (quat *Quaternion) Z() float32 {\n\n\treturn float32(C.quaternion_get_z(quat.cptr))\n}", "title": "" }, { "docid": "c6d36614a0a4b76fccc2d57b3bcbbd0d", "score": "0.48460287", "text": "func (p *Particle) Accelerate(accl *vec.Vec) {\n\tp.vel.Add(accl)\n\tl := p.vel.Magnitude()\n\n\t// Cap velocity to MAX_VELOCITY\n\tif l > MAX_VELOCITY {\n\t\tangle := p.vel.Angle()\n\t\tp.vel = vec.New(1, 0)\n\t\tp.vel.Rotate(angle)\n\t\tp.vel.Multiply(MAX_VELOCITY)\n\t}\n}", "title": "" }, { "docid": "fe175f016380781396f05aecce7616d4", "score": "0.4830243", "text": "func (v Vec3) X() float64 { return v[0] }", "title": "" }, { "docid": "838963c4d89f4fca4726fc1914064d32", "score": "0.47719482", "text": "func (obj Vec3) X() float32 {\n\treturn obj[0]\n}", "title": "" }, { "docid": "c947b7f6c0cd94e4e4a81b426dbab980", "score": "0.4749907", "text": "func (z *Float) Acc() big.Accuracy {\n\treturn z.l.Acc()\n}", "title": "" }, { "docid": "479147ebe22d4597986d03f7e7211209", "score": "0.46843922", "text": "func (v Vec3) X() float32 {\n\treturn v[0]\n}", "title": "" }, { "docid": "44cf279484da34d1d55e6867b489bf7c", "score": "0.46359265", "text": "func (v *Vec3) At(i int) float64 {\n\treturn v.e[i]\n}", "title": "" }, { "docid": "23de6b9242e7cac0e94d4d61d8f58b35", "score": "0.46304917", "text": "func (v *Vec3) X() float64 {\n\treturn v.e[0]\n}", "title": "" }, { "docid": "0634ad5cdb8e88eb71349f0a4ad933c3", "score": "0.46234137", "text": "func (p *PhidgetAccelerometer) GetMinAccelerationChangeTrigger() (float32, error) {\n\tvar r C.double\n\tcerr := C.PhidgetAccelerometer_getMinAccelerationChangeTrigger(p.handle, &r)\n\tif cerr != C.EPHIDGET_OK {\n\t\treturn 0, errors.New(p.getErrorDescription(cerr))\n\t}\n\treturn cDoubleTofloat32(r), nil\n}", "title": "" }, { "docid": "05d66fa08041eb19d4f8332a92fa646b", "score": "0.46202803", "text": "func (v Vec3) X() float64 {\n\treturn v[0]\n}", "title": "" }, { "docid": "c57226604272ec2174913588ee015a25", "score": "0.45819804", "text": "func (a V3) MinComponent() float64 {\n\treturn Min(Min(a.X, a.Y), a.Z)\n}", "title": "" }, { "docid": "a78b049578ccdae77a91bb3a50089ec9", "score": "0.45819572", "text": "func (a *acceleration) Rotational() mgl32.Vec3 {\n\ta.dataLock.RLock()\n\tdefer a.dataLock.RUnlock()\n\treturn a.rotational\n}", "title": "" }, { "docid": "5c1ad9f4a79d493538132498912bc99d", "score": "0.45618835", "text": "func (v Vec) Z() float64 {\n\treturn v[2]\n}", "title": "" }, { "docid": "a9df03b78df8ceb4de344d10c0d76961", "score": "0.45582008", "text": "func rotateX(v ivec3) ivec3 {\n\treturn ivec3{v[0], -v[2], v[1]}\n}", "title": "" }, { "docid": "a032cf33e90ca5857c54725a5cd29df9", "score": "0.45493394", "text": "func (v Vec4) Z() float64 {\n\treturn v[2]\n}", "title": "" }, { "docid": "e11dc543e92424ddbd44342eafae4052", "score": "0.4544648", "text": "func Aix(z complex128) complex128 {\n\tair, aii, _, _ := amos.ZAIRY(real(z), imag(z), 0, 2)\n\treturn complex(air, aii)\n}", "title": "" }, { "docid": "2811576647714febe32d2a3b0ab5d7ee", "score": "0.45133907", "text": "func (v Vec) Z() float64 {\n\treturn v.E[2]\n}", "title": "" }, { "docid": "2ad5bcc81f89650c74c780bf47892ae0", "score": "0.45086125", "text": "func m3(m1, m2, t1, t2 float64) float64 {\n\talpha := math.Pi - t1 + t2\n\treturn math.Sqrt(math.Pow(m1, 2) + math.Pow(m2, 2) - (2 * m1 * m2 * math.Cos(alpha)))\n}", "title": "" }, { "docid": "86e2d824e905f4b9c6f501a2c199ea6c", "score": "0.44872025", "text": "func (o *InterpCubic) G(x float64) float64 {\n\treturn 3.0*o.A*x*x + 2.0*o.B*x + o.C\n}", "title": "" }, { "docid": "9f4b538b92bfb31232c36ef3039d3a85", "score": "0.4478068", "text": "func Z_CDF_At(x float64) float64 {\n\tcdf := Normal_CDF(0, 1)\n\treturn cdf(x)\n}", "title": "" }, { "docid": "fab27c2dd68981f89f13b7960a90679c", "score": "0.4473329", "text": "func (a *acceleration) Type() string {\n\treturn TypeAcceleration\n}", "title": "" }, { "docid": "ab91a5b9c95c94db03b326d0e2eaa9df", "score": "0.44530073", "text": "func (a Vec) Ave() float64 {\n\treturn (a.X + a.Y + a.Z) / 3\n}", "title": "" }, { "docid": "bef80aabb3b4a9c335cc26ce332e5036", "score": "0.444821", "text": "func (c *Carver) get(x, y int) float64 {\n\tpx := x + y*c.Width\n\treturn c.Points[px]\n}", "title": "" }, { "docid": "11a89a84ba7e8d59222e9e3d8efe17fc", "score": "0.44458142", "text": "func (v Vec3) G() float64 { return v[1] }", "title": "" }, { "docid": "f4dfc8e58d01310908a9477870c71de9", "score": "0.44060475", "text": "func arb (a int, b int, c int) int {\n var y = 3\n y = y + 3.0\n y = y - 3.0\n y = y / 3.0\n y = y * 3.0\n\n return y\n}", "title": "" }, { "docid": "e192801fc2a4d1f3cab3cd909744b389", "score": "0.44033417", "text": "func (msg *InverterMsg) ACCurrent(channel int8) float32 {\n\tif channel < 0 || channel > 3 {\n\t\tchannel = 1\n\t}\n\n\tnum := 45 + (channel-1)*2\n\treturn msg.getShort(num, 10)\n}", "title": "" }, { "docid": "312d44ec663b89e131fd228e8f7fdcda", "score": "0.43823534", "text": "func (f XYZFunc) XYZ(i int) (float64, float64, float64) {\n\tif i >= f.steps {\n\t\tpanic(\"out of bounds\")\n\t}\n\tt := float64(i)*(f.end-f.start)/float64(f.steps) + f.start\n\treturn f.X(t), f.Y(t), f.Z(t)\n}", "title": "" }, { "docid": "8e57eeec1a0fc04ac2fceada907fb273", "score": "0.4374587", "text": "func GammaIncLower(s float64, z float64) float64 {\n var k, x, sum float64\n sum = 1\n x = 1\n for k = 1; k < 100; k++ {\n x *= z / (s + k)\n sum += x\n if (x / sum < gamma_epsilon) {\n break\n }\n }\n lgamma, _ := math.Lgamma(s + 1)\n result := math.Exp((s * math.Log(z)) - z - lgamma + math.Log(sum))\n return result\n}", "title": "" }, { "docid": "43ddf8aa75e0799d3a6a5ec046be4323", "score": "0.43574286", "text": "func (r *Ray) At(param float64) vector.Vector3 {\n\treturn vector.Add(r.origin, vector.Mul(r.direction, param))\n}", "title": "" }, { "docid": "0695a0b52ddae45294edd563146617ec", "score": "0.43328992", "text": "func fx_cos_cordic_optim_iter(delta fx, iter int32) fx {\n\t// výpočet funkce cos() pro zadaný úhel delta\n\tvar i int32\n\tvar K_fx fx = fx(0.6073 * float64(2<<uint64(16-1)))\n\t// nastavení počátečních podmínek\n\tvar x0 fx = int2fx(1)\n\tvar y0 fx = fx((0))\n\tvar xn fx\n\t{\n\t\t// iterační smyčka\n\t\tfor i = 0; i < iter; i++ {\n\t\t\tif delta < fx((0)) {\n\t\t\t\t// úhel je záporný =&gt; rotace doleva\n\t\t\t\t// místo násobení bitový posuv\n\t\t\t\txn = fx_add(x0, y0>>uint64(i))\n\t\t\t\ty0 = fx_sub(y0, x0>>uint64(i))\n\t\t\t\tdelta = fx_add(delta, atans[i])\n\t\t\t} else {\n\t\t\t\t// úhel je kladný =&gt; rotace doprava\n\t\t\t\txn = fx_sub(x0, y0>>uint64(i))\n\t\t\t\ty0 = fx_add(y0, x0>>uint64(i))\n\t\t\t\tdelta = fx_sub(delta, atans[i])\n\t\t\t}\n\t\t\tx0 = xn\n\t\t}\n\t}\n\t// opravit \"zesílení\" výsledku\n\treturn fx_mul(x0, K_fx)\n}", "title": "" }, { "docid": "fde33af66a6d004aea26cc93562bb46b", "score": "0.43214905", "text": "func (c *Core) AccelerationEstimate(oidB dex.Bytes, newFeeRate uint64) (uint64, error) {\n\toid, err := order.IDFromBytes(oidB)\n\tif err != nil {\n\t\treturn 0, err\n\t}\n\n\ttracker, err := c.findActiveOrder(oid)\n\tif err != nil {\n\t\treturn 0, err\n\t}\n\n\tif !tracker.wallets.fromWallet.traits.IsAccelerator() {\n\t\treturn 0, fmt.Errorf(\"the %s wallet is not an accelerator\", tracker.wallets.fromWallet.Symbol)\n\t}\n\n\ttracker.mtx.RLock()\n\tdefer tracker.mtx.RUnlock()\n\n\tswapCoins, accelerationCoins, changeCoin, requiredForRemainingSwaps, err := tracker.orderAccelerationParameters()\n\tif err != nil {\n\t\treturn 0, err\n\t}\n\n\taccelerationFee, err := tracker.wallets.fromWallet.accelerationEstimate(swapCoins, accelerationCoins, changeCoin, requiredForRemainingSwaps, newFeeRate)\n\tif err != nil {\n\t\treturn 0, err\n\t}\n\n\treturn accelerationFee, nil\n}", "title": "" }, { "docid": "17acadd015df7fb2aba50a46a292d715", "score": "0.4316239", "text": "func Gamma_CDF_At(k, θ, x float64) float64 {\n\tcdf := Gamma_CDF(k, θ)\n\treturn cdf(x)\n}", "title": "" }, { "docid": "088bbc0a0619cbcbd3be77bb8eed2bfe", "score": "0.43107784", "text": "func (c *Context) Uniform3f(location *UniformLocation, x, y, z float32) {\n\tc.Call(\"uniform3f\", location.Value, x, y, z)\n}", "title": "" }, { "docid": "f70ae7633fa1107c6bf5270793308dd1", "score": "0.43071404", "text": "func (e *Euler) XYZ() (x, y, z float64) {\n\treturn e.X, e.Y, e.Z\n}", "title": "" }, { "docid": "0d9c12623e5b78a63294e5e2350e6047", "score": "0.4295816", "text": "func (xyz XYZs) XYZ(i int) (float64, float64, float64) {\n\treturn xyz[i].X, xyz[i].Y, xyz[i].Z\n}", "title": "" }, { "docid": "154acfc1de72c4f6e3a1007fd9303504", "score": "0.42909443", "text": "func (q Quaternion) Forward() Vector3 {\n\tx, y, z, w := q.X, q.Y, q.Z, q.W\n\treturn Vector3{2 * (x*z - w*y), 2 * (y*z + w*x), 1 - 2*(x*x+y*y)}\n}", "title": "" }, { "docid": "e94ec3d71f5089edca051588ca1fb72e", "score": "0.42859656", "text": "func (o VpnConnectionOutput) EnableAcceleration() pulumi.BoolOutput {\n\treturn o.ApplyT(func(v *VpnConnection) pulumi.BoolOutput { return v.EnableAcceleration }).(pulumi.BoolOutput)\n}", "title": "" }, { "docid": "9f6e01c3854fec4273f8d7b4980a0e8d", "score": "0.42744994", "text": "func (vm *Machine) arc(x, y, z, i, j, k, rotations float64) {\n\tvar (\n\t\tsp Position = vm.curPos()\n\t\ts1, s2, s3, e1, e2, e3, c1, c2 float64\n\t\tadd func(x, y, z float64)\n\t\tclockwise bool = (vm.State.MoveMode == MoveModeCWArc)\n\t)\n\n\tif math.IsNaN(x) || math.IsNaN(y) || math.IsNaN(z) ||\n\t\tmath.IsNaN(i) || math.IsNaN(j) || math.IsNaN(k) {\n\t\tpanic(\"Internal failure: Arc attempted with NaN value\")\n\t}\n\n\tif rotations < 1 {\n\t\tpanic(\"Arc rotations < 1\")\n\t}\n\n\t// Ensure that we work on linear moves\n\toldState := vm.State.MoveMode\n\tvm.State.MoveMode = MoveModeLinear\n\tdefer func() {\n\t\tvm.State.MoveMode = oldState\n\t}()\n\n\t// Flip coordinate system for working in other planes\n\tswitch vm.MovePlane {\n\tcase PlaneXY:\n\t\ts1, s2, s3, e1, e2, e3, c1, c2 = sp.X, sp.Y, sp.Z, x, y, z, i, j\n\t\tadd = func(x, y, z float64) {\n\t\t\tvm.move(x, y, z)\n\t\t}\n\tcase PlaneXZ:\n\t\ts1, s2, s3, e1, e2, e3, c1, c2 = sp.Z, sp.X, sp.Y, z, x, y, k, i\n\t\tadd = func(x, y, z float64) {\n\t\t\tvm.move(y, z, x)\n\t\t}\n\tcase PlaneYZ:\n\t\ts1, s2, s3, e1, e2, e3, c1, c2 = sp.Y, sp.Z, sp.X, y, z, x, j, k\n\t\tadd = func(x, y, z float64) {\n\t\t\tvm.move(z, x, y)\n\t\t}\n\t}\n\n\t// Perform arc verification\n\tradius1 := math.Sqrt(math.Pow(c1-s1, 2) + math.Pow(c2-s2, 2))\n\tradius2 := math.Sqrt(math.Pow(c1-e1, 2) + math.Pow(c2-e2, 2))\n\tif radius1 == 0 || radius2 == 0 {\n\t\tpanic(\"Invalid arc statement\")\n\t}\n\n\tdeviation := math.Abs((radius2-radius1)/radius1) * 100\n\trDiff := math.Abs(radius2 - radius1)\n\n\tif (rDiff > 0.005 && deviation > 0.1) || rDiff > 0.5 {\n\t\tpanic(fmt.Sprintf(\"Radius deviation of %f percent and %f mm\", deviation, rDiff))\n\t}\n\n\t// Some preparatory math\n\ttheta1 := math.Atan2((s2 - c2), (s1 - c1))\n\ttheta2 := math.Atan2((e2 - c2), (e1 - c1))\n\n\tangleDiff := theta2 - theta1\n\tif angleDiff < 0 && !clockwise {\n\t\tangleDiff += 2 * math.Pi\n\t} else if angleDiff > 0 && clockwise {\n\t\tangleDiff -= 2 * math.Pi\n\t}\n\n\t// Rotations are provided as \"up to circle count\", but we need it as \"additional circle count\"\n\trotations--\n\tif clockwise {\n\t\tangleDiff -= rotations * 2 * math.Pi\n\t} else {\n\t\tangleDiff += rotations * 2 * math.Pi\n\t}\n\n\tsteps := 1\n\n\t// Enforce a maximum arc deviation\n\tif vm.MaxArcDeviation < radius1 {\n\t\tsteps = int(math.Ceil(math.Abs(angleDiff / (2 * math.Acos(1-vm.MaxArcDeviation/radius1)))))\n\t}\n\n\t// Enforce a minimum line length\n\tarcLen := math.Abs(angleDiff) * math.Sqrt(math.Pow(radius1, 2)+math.Pow((e3-s3)/angleDiff, 2))\n\tsteps2 := int(arcLen / vm.MinArcLineLength)\n\n\tif steps > steps2 {\n\t\tsteps = steps2\n\t}\n\n\tangle := 0.0\n\n\t// Execute arc approximation\n\tif steps > 0 {\n\t\tfor i := 0; i <= steps; i++ {\n\t\t\tangle = theta1 + angleDiff/float64(steps)*float64(i)\n\t\t\ta1, a2 := c1+radius1*math.Cos(angle), c2+radius1*math.Sin(angle)\n\t\t\ta3 := s3 + (e3-s3)/float64(steps)*float64(i)\n\t\t\tadd(a1, a2, a3)\n\t\t}\n\t}\n\n\tadd(e1, e2, e3)\n}", "title": "" }, { "docid": "882354bccf66246ff6fa781086463c5a", "score": "0.4263832", "text": "func fx_cos_cordic_optim(delta fx) fx {\n\t// výpočet funkce cos() pro zadaný úhel delta\n\tvar i int32\n\tvar K_fx fx = fx(0.6073 * float64(2<<uint64(16-1)))\n\t// nastavení počátečních podmínek\n\tvar x0 fx = int2fx(1)\n\tvar y0 fx = fx((0))\n\tvar xn fx\n\t{\n\t\t// iterační smyčka\n\t\tfor i = 0; i < 16; i++ {\n\t\t\tif delta < fx((0)) {\n\t\t\t\t// úhel je záporný =&gt; rotace doleva\n\t\t\t\t// místo násobení bitový posuv\n\t\t\t\txn = fx_add(x0, y0>>uint64(i))\n\t\t\t\ty0 = fx_sub(y0, x0>>uint64(i))\n\t\t\t\tdelta = fx_add(delta, atans[i])\n\t\t\t} else {\n\t\t\t\t// úhel je kladný =&gt; rotace doprava\n\t\t\t\txn = fx_sub(x0, y0>>uint64(i))\n\t\t\t\ty0 = fx_add(y0, x0>>uint64(i))\n\t\t\t\tdelta = fx_sub(delta, atans[i])\n\t\t\t}\n\t\t\tx0 = xn\n\t\t}\n\t}\n\t// opravit \"zesílení\" výsledku\n\treturn fx_mul(x0, K_fx)\n}", "title": "" }, { "docid": "dc8a0a70341da5f378eca1f62dce6b42", "score": "0.42475003", "text": "func Ai(z complex128) complex128 {\n\tair, aii, _, _ := amos.ZAIRY(real(z), imag(z), 0, 1)\n\treturn complex(air, aii)\n}", "title": "" }, { "docid": "88717dc5c2c2d53671f6e7160e5de592", "score": "0.42443004", "text": "func (a *acceleration) Translational() mgl32.Vec3 {\n\ta.dataLock.RLock()\n\tdefer a.dataLock.RUnlock()\n\treturn a.translational\n}", "title": "" }, { "docid": "08359d9db287cc697ec7a244cb210caf", "score": "0.42287382", "text": "func (v Vec3) Elem() (x, y, z float64) {\n\treturn v[0], v[1], v[2]\n}", "title": "" }, { "docid": "fb89d0dc69d67d1a8c01412b9f701f2c", "score": "0.42259634", "text": "func Real(z complex128) float64", "title": "" }, { "docid": "237eaf63ef26b96bcf7b1cedf18ee645", "score": "0.42242393", "text": "func (t *Tuple) GetZ() float64 {\n\treturn t.zAxis\n}", "title": "" }, { "docid": "f7c33c36cb757a467b7b519258d2f20f", "score": "0.42046618", "text": "func (m Metal) GetEmission() Vector3 {\n return NewVector3(0.0, 0.0, 0.0)\n}", "title": "" }, { "docid": "01803b0c64f44834c8049ca43259ed63", "score": "0.42044654", "text": "func (v Vec3) Min(w Vec3) Vec3 {\n\treturn Vec3{\n\t\tfloat32(math.Min(float64(v.X), float64(w.X))),\n\t\tfloat32(math.Min(float64(v.Y), float64(w.Y))),\n\t\tfloat32(math.Min(float64(v.Z), float64(w.Z))),\n\t}\n}", "title": "" }, { "docid": "fab9c12783abaed4008eb4126fe5e043", "score": "0.4197621", "text": "func (q *Quaternion) X() float64 {\n\treturn q.p.Get(\"x\").Float()\n}", "title": "" }, { "docid": "6bd3e2cb07905ad927406074ca38176d", "score": "0.41889405", "text": "func (v *Vector) GetRotationZ() (angle float64) {\n\tangle = 0\n\tif v.IsFilled() {\n\t\tif v.Y < 0 {\n\t\t\tangle = math.Atan(math.Abs(v.X)/-v.Y) / (math.Pi) * 180.0\n\t\t} else {\n\t\t\tangle = 90 + math.Atan(v.Y/math.Abs(v.X))/(math.Pi)*180.0\n\t\t}\n\t\tif v.X < 0 {\n\t\t\tangle = 360 - angle\n\t\t}\n\t}\n\treturn\n}", "title": "" }, { "docid": "0d9b91a833be62018976483998d642da", "score": "0.41852486", "text": "func (v *Vec3) Add(x *Vec3) {\n\tv.X += x.X\n\tv.Y += x.Y\n\tv.Z += x.Z\n}", "title": "" }, { "docid": "d30d1637c196c5242bfcc71b24ec4f42", "score": "0.4184314", "text": "func (p *PhidgetAccelerometer) SetAccelerationChangeTrigger(value float32) error {\n\tcerr := C.PhidgetAccelerometer_setAccelerationChangeTrigger(p.handle, float32ToCdouble(value))\n\tif cerr != C.EPHIDGET_OK {\n\t\treturn errors.New(p.getErrorDescription(cerr))\n\t}\n\treturn nil\n}", "title": "" }, { "docid": "ff477495c92ef42af3fc6866f4c84663", "score": "0.41811508", "text": "func (c *Core) PreAccelerateOrder(oidB dex.Bytes) (*PreAccelerate, error) {\n\toid, err := order.IDFromBytes(oidB)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\ttracker, err := c.findActiveOrder(oid)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\tif !tracker.wallets.fromWallet.traits.IsAccelerator() {\n\t\treturn nil, fmt.Errorf(\"the %s wallet is not an accelerator\", tracker.wallets.fromWallet.Symbol)\n\t}\n\n\tfeeSuggestion := c.feeSuggestionAny(tracker.fromAssetID)\n\n\ttracker.mtx.RLock()\n\tdefer tracker.mtx.RUnlock()\n\tswapCoinIDs, accelerationCoins, changeCoinID, requiredForRemainingSwaps, err := tracker.orderAccelerationParameters()\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\tcurrentRate, suggestedRange, earlyAcceleration, err :=\n\t\ttracker.wallets.fromWallet.preAccelerate(swapCoinIDs, accelerationCoins, changeCoinID, requiredForRemainingSwaps, feeSuggestion)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\tif suggestedRange == nil {\n\t\t// this should never happen\n\t\treturn nil, fmt.Errorf(\"suggested range is nil\")\n\t}\n\n\treturn &PreAccelerate{\n\t\tSwapRate: currentRate,\n\t\tSuggestedRate: feeSuggestion,\n\t\tSuggestedRange: *suggestedRange,\n\t\tEarlyAcceleration: earlyAcceleration,\n\t}, nil\n}", "title": "" }, { "docid": "d3825dbdaa95824ef92502a66ca81f48", "score": "0.41652572", "text": "func getAccel(n int, m *Measurement) (u *mat.Dense) {\n\tu = mat.NewDense(n, 1, nil)\n\tfor i := 0; i < n; i++ {\n\t\tu.Set(i, 0, m.accel[i])\n\t}\n\treturn\n}", "title": "" }, { "docid": "f5cb5018c8a34b1a4aad05d850597245", "score": "0.41648918", "text": "func getCMA(val, avg, n float64) float64 {\n\treturn (avg*n + val) / (n + 1.0)\n}", "title": "" }, { "docid": "b600af592332257b9c4165e98e5aa689", "score": "0.41525477", "text": "func (c CoordSys) Forward() Vec3 {\n\tswitch c {\n\tcase CoordSysZUpRight:\n\t\treturn Vec3{0, 1, 0}\n\n\tcase CoordSysZUpLeft:\n\t\treturn Vec3{0, -1, 0}\n\n\tcase CoordSysYUpRight:\n\t\treturn Vec3{0, 0, -1}\n\n\tcase CoordSysYUpLeft:\n\t\treturn Vec3{0, 0, 1}\n\t}\n\tpanic(fmt.Sprintf(\"Forward(): Invalid coordinate system %d\", c))\n}", "title": "" }, { "docid": "c16e2f2e188ad03da5b6b62757d7e8bb", "score": "0.41483027", "text": "func (v Vec4i) Z() int {\n\treturn v[2]\n}", "title": "" }, { "docid": "5d78e3043ea428da0e0464deb732270b", "score": "0.4146486", "text": "func (o BucketOutput) AccelerationStatus() pulumi.StringOutput {\n\treturn o.ApplyT(func(v *Bucket) pulumi.StringOutput { return v.AccelerationStatus }).(pulumi.StringOutput)\n}", "title": "" }, { "docid": "41e9b341bb914d5369e300a066602e78", "score": "0.41432422", "text": "func (c *Covariance) Increment(x, y float64) {\n\tc.XY += x * y\n\tc.X += x\n\tc.Y += y\n\tc.N++\n}", "title": "" }, { "docid": "68fc35f5f406e9825f6b0b4f5628e490", "score": "0.41388482", "text": "func (d Dielectric) GetEmission() Vector3 {\n return NewVector3(0.0, 0.0, 0.0)\n}", "title": "" }, { "docid": "019fbb217b3ba33b8ea67786919dcc19", "score": "0.41275394", "text": "func (f *Float32) Index(x, y, z int) int {\n\treturn (x+y*f.Width)*f.Depth + z\n}", "title": "" }, { "docid": "8062a6f08a3f1e22e88b4e12679405ed", "score": "0.4127088", "text": "func (r Ray) At(t float64) Vec3 {\n\treturn r.Orig.Add(r.Dir.Mul(t))\n}", "title": "" }, { "docid": "4e9b52236c1f0a2025e0d2bdc032e737", "score": "0.41060677", "text": "func (a *acceleration) Set(rotational, translational mgl32.Vec3) {\n\ta.dataLock.Lock()\n\tdefer a.dataLock.Unlock()\n\ta.rotational = rotational\n\ta.translational = translational\n}", "title": "" }, { "docid": "0fe407e47464c6dd7beacda471c544b8", "score": "0.4103802", "text": "func ComputeThreeIsogeny(x3 *ProjectivePoint) (ProjectiveCurveParameters, ThreeIsogeny) {\n\tvar isogeny ThreeIsogeny\n\tisogeny.x = x3.X\n\tisogeny.z = x3.Z\n\t// We want to compute\n\t// (A':C') = (Z^4 + 18X^2Z^2 - 27X^4 : 4XZ^3)\n\t// To do this, use the identity 18X^2Z^2 - 27X^4 = 9X^2(2Z^2 - 3X^2)\n\tvar codomain ProjectiveCurveParameters\n\tvar v0, v1, v2, v3 ExtensionFieldElement\n\tv1.Square(&x3.X) // = X^2\n\tv0.Add(&v1, &v1).Add(&v1, &v0) // = 3X^2\n\tv1.Add(&v0, &v0).Add(&v1, &v0) // = 9X^2\n\tv2.Square(&x3.Z) // = Z^2\n\tv3.Square(&v2) // = Z^4\n\tv2.Add(&v2, &v2) // = 2Z^2\n\tv0.Sub(&v2, &v0) // = 2Z^2 - 3X^2\n\tv1.Mul(&v1, &v0) // = 9X^2(2Z^2 - 3X^2)\n\tv0.Mul(&x3.X, &x3.Z) // = XZ\n\tv0.Add(&v0, &v0) // = 2XZ\n\tcodomain.A.Add(&v3, &v1) // = Z^4 + 9X^2(2Z^2 - 3X^2)\n\tcodomain.C.Mul(&v0, &v2) // = 4XZ^3\n\n\treturn codomain, isogeny\n}", "title": "" }, { "docid": "ae0f9a7cec0a5bad295f7667423d40b7", "score": "0.4099298", "text": "func (as *AudioService) KeyboardAccel(ctx context.Context, req *ui.AudioServiceRequest) (*empty.Empty, error) {\n\tif as.cr == nil {\n\t\treturn nil, errors.New(\"Chrome not available\")\n\t}\n\tkb, err := input.Keyboard(ctx)\n\tif err != nil {\n\t\treturn nil, errors.Wrap(err, \"failed to find keyboard\")\n\t}\n\tdefer kb.Close()\n\n\tif err := kb.Accel(ctx, req.Expr); err != nil {\n\t\treturn nil, errors.Wrapf(err, \"failed to press %q using keyboard\", req.Expr)\n\t}\n\treturn &empty.Empty{}, nil\n}", "title": "" }, { "docid": "e0fe778113df8dec365910345f953ffc", "score": "0.40955317", "text": "func acos(thread *starlark.Thread, _ *starlark.Builtin, args starlark.Tuple, kwargs []starlark.Tuple) (starlark.Value, error) {\n\treturn floatFunc(\"acos\", args, kwargs, math.Acos)\n}", "title": "" }, { "docid": "65a587b33f90063254d1aead2be4ffa9", "score": "0.40809196", "text": "func (p Point3) Vec3() Vec3 {\n\treturn Vec3{p.X, p.Y, p.Z}\n}", "title": "" }, { "docid": "775f03d4755c94b95b4b8fb43fc0be85", "score": "0.4078098", "text": "func (a Energy) Amplified(n float64) Energy {\n\treturn Energy{a.X * n, a.Y * n, a.Z * n}\n}", "title": "" }, { "docid": "dd1a2f9c09207dc03dddcdb8da01d5e8", "score": "0.4077903", "text": "func cos(thread *starlark.Thread, _ *starlark.Builtin, args starlark.Tuple, kwargs []starlark.Tuple) (starlark.Value, error) {\n\treturn floatFunc(\"cos\", args, kwargs, math.Cos)\n}", "title": "" }, { "docid": "4821d364f3f52fd484289c6746128e6e", "score": "0.4075246", "text": "func acosh(thread *starlark.Thread, _ *starlark.Builtin, args starlark.Tuple, kwargs []starlark.Tuple) (starlark.Value, error) {\n\treturn floatFunc(\"acosh\", args, kwargs, math.Acosh)\n}", "title": "" }, { "docid": "dfdeabb69dd4e0dbd9b3f1cb85f13fae", "score": "0.40680912", "text": "func (v Vec3) SetXYZ(x, y, z float32) {\n\tv[0] = x\n\tv[1] = y\n\tv[2] = z\n}", "title": "" }, { "docid": "47a056d1431fcd52188c85d706af1b2d", "score": "0.40656668", "text": "func (o BucketOutput) AccelerationStatus() pulumi.StringPtrOutput {\n\treturn o.ApplyT(func(v Bucket) *string { return v.AccelerationStatus }).(pulumi.StringPtrOutput)\n}", "title": "" }, { "docid": "68f9426b20828766ca120ca8cb483bbe", "score": "0.40610304", "text": "func vectorZ(bodies ...body) []int {\n\tv := make([]int, len(bodies)*2)\n\tfor i := range bodies {\n\t\tv[i] = bodies[i].z\n\t\tv[i+1] = bodies[i].velZ\n\t}\n\treturn v\n}", "title": "" }, { "docid": "f3702109f9a7ddc66312d9ccfa28009e", "score": "0.40517253", "text": "func (o BucketPtrOutput) AccelerationStatus() pulumi.StringPtrOutput {\n\treturn o.ApplyT(func(v *Bucket) *string {\n\t\tif v == nil {\n\t\t\treturn nil\n\t\t}\n\t\treturn v.AccelerationStatus\n\t}).(pulumi.StringPtrOutput)\n}", "title": "" }, { "docid": "aa7db04bd16eabec0733939b210daef1", "score": "0.40501872", "text": "func Acosh(x float32) float32 {\n\treturn float32(math.Acosh(float64(x)))\n}", "title": "" }, { "docid": "ff67a681aee60d1bcd81c41f9b63986b", "score": "0.40500185", "text": "func inc(x *float64) {\n\t*x++\n}", "title": "" }, { "docid": "c5e9cb9dd3e62c5e3c7048b13ea233f0", "score": "0.40497553", "text": "func (m Metal) GetAttenuation() Vector3 {\n return m.Attenuation\n}", "title": "" }, { "docid": "ca94cf37b745d7ee046f98b80eebeb66", "score": "0.40492132", "text": "func (l Float32List) At(i int) float32 {\n\taddr, err := l.primitiveElem(i, ObjectSize{DataSize: 4})\n\tif err != nil {\n\t\treturn 0\n\t}\n\treturn math.Float32frombits(l.seg.readUint32(addr))\n}", "title": "" }, { "docid": "103bdcc1dfca2f34e941e2bc9239645e", "score": "0.40470317", "text": "func (v Vector3) Add(op Vector3) Vector3 {\n\treturn Vector3{X: v.X + op.X, Y: v.Y + op.Y, Z: v.Z + op.Z}\n}", "title": "" }, { "docid": "01fe9cb87f869db61a2100eff36682fb", "score": "0.40459752", "text": "func iac(x float64, n int) float64 {\n\treturn -math.Pow(math.Sqrt(2/float64(n))*(x-float64(n)/2.0), 2.0) + float64(n)/2.0\n}", "title": "" }, { "docid": "50a28847775a9a70e41d5fb5920a1fe1", "score": "0.4038402", "text": "func (v *Vector3) Set(x, y, z float64) *Vector3 {\n\tv.p.Call(\"set\", x, y, z)\n\treturn v\n}", "title": "" }, { "docid": "2051bfb8fabf45c437807d77506eec41", "score": "0.40299058", "text": "func GG0(x uint32, y uint32, z uint32) uint32 {\n\treturn x ^ y ^ z\n}", "title": "" }, { "docid": "146f4e3667ee4685a2ead50d021dffc6", "score": "0.40237877", "text": "func (v *Vec3) G() float64 {\n\treturn v.e[1]\n}", "title": "" }, { "docid": "3c8fd1d8d7d21310ce2a604a50881634", "score": "0.40228963", "text": "func Acos(x float32) float32 {\n\treturn Pi/2 - Asin(x)\n}", "title": "" } ]
9647b873210526979d097a3177472b54
DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be nonnil.
[ { "docid": "fc5f053115e8561b483777179c90cb4f", "score": "0.0", "text": "func (in *IdentityObservation) DeepCopyInto(out *IdentityObservation) {\n\t*out = *in\n\tif in.Oidc != nil {\n\t\tin, out := &in.Oidc, &out.Oidc\n\t\t*out = make([]OidcObservation, 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": "1f57ffc651711a9d4e3c2aaf2c3fe0af", "score": "0.82304025", "text": "func (in *Result) DeepCopyInto(out *Result) {\n\t*out = *in\n}", "title": "" }, { "docid": "ad305ab191366a9506e5a265e8f598f7", "score": "0.8201859", "text": "func (in *Alibaba) DeepCopyInto(out *Alibaba) {\n\t*out = *in\n\treturn\n}", "title": "" }, { "docid": "a42f3277ccfd7290dba1d5fd8d6526a4", "score": "0.81997156", "text": "func (in *Memory) DeepCopyInto(out *Memory) {\n\t*out = *in\n\treturn\n}", "title": "" }, { "docid": "da106d983b586b057f03d7a4a40c0ad7", "score": "0.8176168", "text": "func (in *Info) DeepCopyInto(out *Info) {\n\t*out = *in\n}", "title": "" }, { "docid": "c49029c90a1c585ff59e9b461126fd3a", "score": "0.81664026", "text": "func (in *ExtractResults) DeepCopyInto(out *ExtractResults) {\n\t*out = *in\n}", "title": "" }, { "docid": "e0815fd5cf43267b351cded80677d403", "score": "0.81589115", "text": "func (in *MongosNode) DeepCopyInto(out *MongosNode) {\n\t*out = *in\n\treturn\n}", "title": "" }, { "docid": "e0815fd5cf43267b351cded80677d403", "score": "0.81589115", "text": "func (in *MongosNode) DeepCopyInto(out *MongosNode) {\n\t*out = *in\n\treturn\n}", "title": "" }, { "docid": "dc68efae3bbd1db624ff48f44f17a2a9", "score": "0.811768", "text": "func (in *Oss) DeepCopyInto(out *Oss) {\n\t*out = *in\n}", "title": "" }, { "docid": "c956ce3bd090743986ccc6cc2f33bdfd", "score": "0.81082815", "text": "func (in *Cerebro) DeepCopyInto(out *Cerebro) {\n\t*out = *in\n}", "title": "" }, { "docid": "294d32b697fb9265d694200a92e867f9", "score": "0.8103162", "text": "func (in *Swift) DeepCopyInto(out *Swift) {\n\t*out = *in\n}", "title": "" }, { "docid": "43bb5416c56822147844c8d692c5ce59", "score": "0.81024987", "text": "func (in *Arg) DeepCopyInto(out *Arg) {\n\t*out = *in\n\treturn\n}", "title": "" }, { "docid": "02b911176a8121b528f5a1355f4f7b15", "score": "0.808476", "text": "func (in *Step) DeepCopyInto(out *Step) {\n\t*out = *in\n\tif in.Args != nil {\n\t\tin, out := &in.Args, &out.Args\n\t\t*out = make([]string, len(*in))\n\t\tcopy(*out, *in)\n\t}\n\tif in.Env != nil {\n\t\tin, out := &in.Env, &out.Env\n\t\t*out = make([]string, len(*in))\n\t\tcopy(*out, *in)\n\t}\n\tif in.SecretEnv != nil {\n\t\tin, out := &in.SecretEnv, &out.SecretEnv\n\t\t*out = make([]string, len(*in))\n\t\tcopy(*out, *in)\n\t}\n\tif in.Volumes != nil {\n\t\tin, out := &in.Volumes, &out.Volumes\n\t\t*out = make([]Volumes, len(*in))\n\t\tcopy(*out, *in)\n\t}\n\tif in.WaitFor != nil {\n\t\tin, out := &in.WaitFor, &out.WaitFor\n\t\t*out = make([]string, len(*in))\n\t\tcopy(*out, *in)\n\t}\n\treturn\n}", "title": "" }, { "docid": "3c45d4691bffdd429c620d809132e9c6", "score": "0.8079251", "text": "func (in *MemNode) DeepCopyInto(out *MemNode) {\n\t*out = *in\n\treturn\n}", "title": "" }, { "docid": "9880d223d20120d641e38948a479e267", "score": "0.80629224", "text": "func (in *Curator) DeepCopyInto(out *Curator) {\n\t*out = *in\n}", "title": "" }, { "docid": "d86cd832a6b2a900f25a9926245ddc0c", "score": "0.80617553", "text": "func (in *CockroachDBNode) DeepCopyInto(out *CockroachDBNode) {\n\t*out = *in\n\treturn\n}", "title": "" }, { "docid": "41475496763ae4276f7015dae332c81a", "score": "0.8058953", "text": "func (in *MX) DeepCopyInto(out *MX) {\n\t*out = *in\n}", "title": "" }, { "docid": "a4140474dca433b376cb006f53ce01b8", "score": "0.80548596", "text": "func (in *FlavorNode) DeepCopyInto(out *FlavorNode) {\n\t*out = *in\n\treturn\n}", "title": "" }, { "docid": "d4907b7e87f96cc9f592e887afb9927d", "score": "0.80513793", "text": "func (in *Node) DeepCopyInto(out *Node) {\n\t*out = *in\n}", "title": "" }, { "docid": "9b47e574bb5be9efb098214692f31714", "score": "0.80500704", "text": "func (in *FilesystemInfo) DeepCopyInto(out *FilesystemInfo) {\n\t*out = *in\n\treturn\n}", "title": "" }, { "docid": "675bd2d929e6a218a6d73beb70c865e1", "score": "0.80485696", "text": "func (in *ExistPvc) DeepCopyInto(out *ExistPvc) {\n\t*out = *in\n\treturn\n}", "title": "" }, { "docid": "8efd0808623d9b730fb7e61f70087c8f", "score": "0.80483013", "text": "func (in *Container) DeepCopyInto(out *Container) {\n\t*out = *in\n}", "title": "" }, { "docid": "8bde41186e7e61e4e7741184e3d389ed", "score": "0.8039166", "text": "func (in *ResultRef) DeepCopyInto(out *ResultRef) {\n\t*out = *in\n\treturn\n}", "title": "" }, { "docid": "58f001a58f43a3e8e30a09873185f4d3", "score": "0.80366516", "text": "func (in *Results) DeepCopyInto(out *Results) {\n\t*out = *in\n\treturn\n}", "title": "" }, { "docid": "7e85ead0c8c714d276f5fb9452635d0d", "score": "0.8035343", "text": "func (in *Fake) DeepCopyInto(out *Fake) {\n\t*out = *in\n\treturn\n}", "title": "" }, { "docid": "9f8b8a23dcf73e6ba1910cae5ae70043", "score": "0.8034441", "text": "func (in *Value) DeepCopyInto(out *Value) {\n\t*out = *in\n\treturn\n}", "title": "" }, { "docid": "12aba946684ce7a45759b3de900e843d", "score": "0.8033727", "text": "func (d *Date) DeepCopyInto(out *Date) {\n\t*out = *d\n}", "title": "" }, { "docid": "bb11c9a990e7f490126a74be357aff79", "score": "0.80313784", "text": "func (in *ValueSelection) DeepCopyInto(out *ValueSelection) {\n\t*out = *in\n\treturn\n}", "title": "" }, { "docid": "685326535d53e4ba6971d394916fb76a", "score": "0.8028889", "text": "func (in *OutputRef) DeepCopyInto(out *OutputRef) {\n\t*out = *in\n\treturn\n}", "title": "" }, { "docid": "f484f0844458e8a703a8694a29b0e407", "score": "0.8020036", "text": "func (in *Var) DeepCopyInto(out *Var) {\n\t*out = *in\n}", "title": "" }, { "docid": "071025652c9144e1aceac0a90f385353", "score": "0.80165744", "text": "func (in *ACPI) DeepCopyInto(out *ACPI) {\n\t*out = *in\n\treturn\n}", "title": "" }, { "docid": "e9cb500ebbcbb1ec1b2276e4a6ad7c35", "score": "0.80160326", "text": "func (in *FileSystemInfo) DeepCopyInto(out *FileSystemInfo) {\n\t*out = *in\n\treturn\n}", "title": "" }, { "docid": "81b3fe61ed28b4b0fdd14116c4b2d1f5", "score": "0.801332", "text": "func (in *PandaproxyAPITLS) DeepCopyInto(out *PandaproxyAPITLS) {\n\t*out = *in\n}", "title": "" }, { "docid": "95970938421b1288bad93724e6d86347", "score": "0.80132526", "text": "func (in *HiddenNode) DeepCopyInto(out *HiddenNode) {\n\t*out = *in\n\treturn\n}", "title": "" }, { "docid": "e79a12a89d645ee17265ac1e9220920d", "score": "0.8011956", "text": "func (in *KeystoneDebug) DeepCopyInto(out *KeystoneDebug) {\n\t*out = *in\n}", "title": "" }, { "docid": "30324ad038726659a523150f3368d0f5", "score": "0.8010361", "text": "func (in *Container) DeepCopyInto(out *Container) {\n\t*out = *in\n\treturn\n}", "title": "" }, { "docid": "7c8c47fb388e239b1f56b93f3c3fcd75", "score": "0.80064476", "text": "func (in *FilesystemTarget) DeepCopyInto(out *FilesystemTarget) {\n\t*out = *in\n\treturn\n}", "title": "" }, { "docid": "24891879c3796e85357de6b6d3986a17", "score": "0.80022174", "text": "func (in *Empty) DeepCopyInto(out *Empty) {\n\t*out = *in\n}", "title": "" }, { "docid": "0e55f7e85b58f091b4c56d054b1a0f01", "score": "0.8002043", "text": "func (in *BIOS) DeepCopyInto(out *BIOS) {\n\t*out = *in\n\treturn\n}", "title": "" }, { "docid": "afb583f9d5ea7e3b6b4ab0c26a4563bd", "score": "0.799358", "text": "func (in *KubeovnCfg) DeepCopyInto(out *KubeovnCfg) {\n\t*out = *in\n}", "title": "" }, { "docid": "bd76d0c812c11347dc0586c794e13bbb", "score": "0.79911625", "text": "func (in *ObjectID) DeepCopyInto(out *ObjectID) {\n\t*out = *in\n\treturn\n}", "title": "" }, { "docid": "87cf7c6678a506b2791e1c30d1d4540c", "score": "0.7987149", "text": "func (in *ObjectRef) DeepCopyInto(out *ObjectRef) {\n\t*out = *in\n\treturn\n}", "title": "" }, { "docid": "b484ecb198d3d15da23105d7d1e0fce9", "score": "0.7982483", "text": "func (in *HostMemory) DeepCopyInto(out *HostMemory) {\n\t*out = *in\n}", "title": "" }, { "docid": "ac7c801f87efa15912e469730d600335", "score": "0.7981367", "text": "func (in *NUMACell) DeepCopyInto(out *NUMACell) {\n\t*out = *in\n\treturn\n}", "title": "" }, { "docid": "992d147304d6bad233da2be02fc7619d", "score": "0.79796785", "text": "func (in *Struct_ObjectAndObject) DeepCopyInto(out *Struct_ObjectAndObject) {\n\t*out = *in\n\treturn\n}", "title": "" }, { "docid": "083852392c5e9f16679610351c913068", "score": "0.7977777", "text": "func (in *Entry) DeepCopyInto(out *Entry) {\n\t*out = *in\n\treturn\n}", "title": "" }, { "docid": "55c1000e8c0cd2b29bcfd858b2050c26", "score": "0.7975866", "text": "func (in *ContainerInfo) DeepCopyInto(out *ContainerInfo) {\n\t*out = *in\n}", "title": "" }, { "docid": "308c47eab2a45025e0d70b6f63a70745", "score": "0.7971048", "text": "func (in *View) DeepCopyInto(out *View) {\n\t*out = *in\n\treturn\n}", "title": "" }, { "docid": "dc25f670b9ab6635efd1a7f707841646", "score": "0.7969739", "text": "func (in *ObjectReference) DeepCopyInto(out *ObjectReference) {\n\t*out = *in\n}", "title": "" }, { "docid": "dc25f670b9ab6635efd1a7f707841646", "score": "0.7969739", "text": "func (in *ObjectReference) DeepCopyInto(out *ObjectReference) {\n\t*out = *in\n}", "title": "" }, { "docid": "1f29957ddd8a3d29eefd9952908cbb3a", "score": "0.7966434", "text": "func (in *CleanupOptions) DeepCopyInto(out *CleanupOptions) {\n\t*out = *in\n\treturn\n}", "title": "" }, { "docid": "cc4346b3e9aec199385bc90140def4e1", "score": "0.7965026", "text": "func (in *Replicas) DeepCopyInto(out *Replicas) {\n\t*out = *in\n}", "title": "" }, { "docid": "cc4346b3e9aec199385bc90140def4e1", "score": "0.7965026", "text": "func (in *Replicas) DeepCopyInto(out *Replicas) {\n\t*out = *in\n}", "title": "" }, { "docid": "a7b378d1a6bd8758e11892764d752257", "score": "0.79637235", "text": "func (in *AccessRule) DeepCopyInto(out *AccessRule) {\n\t*out = *in\n\tif in.Services != nil {\n\t\tin, out := &in.Services, &out.Services\n\t\t*out = make([]string, len(*in))\n\t\tcopy(*out, *in)\n\t}\n\tif in.Methods != nil {\n\t\tin, out := &in.Methods, &out.Methods\n\t\t*out = make([]string, len(*in))\n\t\tcopy(*out, *in)\n\t}\n\tif in.Paths != nil {\n\t\tin, out := &in.Paths, &out.Paths\n\t\t*out = make([]string, len(*in))\n\t\tcopy(*out, *in)\n\t}\n\treturn\n}", "title": "" }, { "docid": "b6a38c245c68cf0a952d8cd3035f414b", "score": "0.7961561", "text": "func (in *Filesystem) DeepCopyInto(out *Filesystem) {\n\t*out = *in\n\treturn\n}", "title": "" }, { "docid": "cecf0e759895b3677c7ac21129d95d32", "score": "0.7959489", "text": "func (in *FederatedIdentity) DeepCopyInto(out *FederatedIdentity) {\n\t*out = *in\n\treturn\n}", "title": "" }, { "docid": "fcd61e82f34db96b76efba6276644908", "score": "0.7957314", "text": "func (in *ObjectSelector) DeepCopyInto(out *ObjectSelector) {\n\t*out = *in\n\treturn\n}", "title": "" }, { "docid": "fcd61e82f34db96b76efba6276644908", "score": "0.7957314", "text": "func (in *ObjectSelector) DeepCopyInto(out *ObjectSelector) {\n\t*out = *in\n\treturn\n}", "title": "" }, { "docid": "4cc4474c2a1333bf5f947b2294d0b027", "score": "0.79531795", "text": "func (in *Interface) DeepCopyInto(out *Interface) {\n\t*out = *in\n\treturn\n}", "title": "" }, { "docid": "39a471f5aadbdab5d9516ba227972d8a", "score": "0.7952031", "text": "func (in *Kubevirt) DeepCopyInto(out *Kubevirt) {\n\t*out = *in\n\treturn\n}", "title": "" }, { "docid": "2e969070a96b8b6d99bd7c0c3b07add8", "score": "0.79511935", "text": "func (in *K8sNode) DeepCopyInto(out *K8sNode) {\n\t*out = *in\n}", "title": "" }, { "docid": "3a50ec1b7050b7c2c74ee0d6b2e48f87", "score": "0.79469675", "text": "func (in *Kustomize) DeepCopyInto(out *Kustomize) {\n\t*out = *in\n}", "title": "" }, { "docid": "7dba8e650f835283d56250f2cdab85d5", "score": "0.79462737", "text": "func (in *Nats) DeepCopyInto(out *Nats) {\n\t*out = *in\n\treturn\n}", "title": "" }, { "docid": "62fdf0e0bb9afa2bdeb473e8512e55b9", "score": "0.7946217", "text": "func (in *MemoryBackingSource) DeepCopyInto(out *MemoryBackingSource) {\n\t*out = *in\n\treturn\n}", "title": "" }, { "docid": "3c51337658fc0e9d2966273bd3459022", "score": "0.7945869", "text": "func (in *ObjectReference) DeepCopyInto(out *ObjectReference) {\n\t*out = *in\n\treturn\n}", "title": "" }, { "docid": "98b9c2ac35cd52c9ce36fa4ac31a3620", "score": "0.79445064", "text": "func (in *Struct_Empty) DeepCopyInto(out *Struct_Empty) {\n\t*out = *in\n\treturn\n}", "title": "" }, { "docid": "1d3bd808397fc4e42919ba414a38653f", "score": "0.7944283", "text": "func (in *ExpectedNICS) DeepCopyInto(out *ExpectedNICS) {\n\t*out = *in\n}", "title": "" }, { "docid": "ef3955bb9c23ccc542ce27babb3ea911", "score": "0.79437953", "text": "func (in *Hetzner) DeepCopyInto(out *Hetzner) {\n\t*out = *in\n\treturn\n}", "title": "" }, { "docid": "c46e3263bd358d3ca2901f5e8dd6924d", "score": "0.7941932", "text": "func (in *InstancetemplateNodeAffinities) DeepCopyInto(out *InstancetemplateNodeAffinities) {\n\t*out = *in\n\tif in.Value != nil {\n\t\tin, out := &in.Value, &out.Value\n\t\t*out = new(InstancetemplateValue)\n\t\t**out = **in\n\t}\n\treturn\n}", "title": "" }, { "docid": "d138525ab73c7f982261d224991bb588", "score": "0.79410547", "text": "func (in *TestingSpec) DeepCopyInto(out *TestingSpec) {\n\t*out = *in\n}", "title": "" }, { "docid": "a62d2491925276d66a89576351b7bdb4", "score": "0.79405445", "text": "func (in *Replicas) DeepCopyInto(out *Replicas) {\n\t*out = *in\n\treturn\n}", "title": "" }, { "docid": "49f50463535cd497282b2d6d54eb1245", "score": "0.79376817", "text": "func (in *Notary) DeepCopyInto(out *Notary) {\n\t*out = *in\n}", "title": "" }, { "docid": "6ea8837cf2211c399b0e39da6ff0bb57", "score": "0.79356486", "text": "func (in *StepOutputConfig) DeepCopyInto(out *StepOutputConfig) {\n\t*out = *in\n\treturn\n}", "title": "" }, { "docid": "9823e89e5f174980848afc03c8a265ae", "score": "0.79354686", "text": "func (in *Reprovision) DeepCopyInto(out *Reprovision) {\n\t*out = *in\n\treturn\n}", "title": "" }, { "docid": "bf95c140cc2b3cece4116f02fe1e5066", "score": "0.7932914", "text": "func (in *ActionInfo) DeepCopyInto(out *ActionInfo) {\n\t*out = *in\n\treturn\n}", "title": "" }, { "docid": "6b8379fb1e79e083218be9b00ee3baf3", "score": "0.7930824", "text": "func (in *TaskResult) DeepCopyInto(out *TaskResult) {\n\t*out = *in\n\tif in.Properties != nil {\n\t\tin, out := &in.Properties, &out.Properties\n\t\t*out = make(map[string]PropertySpec, len(*in))\n\t\tfor key, val := range *in {\n\t\t\t(*out)[key] = val\n\t\t}\n\t}\n\treturn\n}", "title": "" }, { "docid": "cd8c19e9524321e2465ead0ebac86284", "score": "0.79304063", "text": "func (in *FilesFrom) DeepCopyInto(out *FilesFrom) {\n\t*out = *in\n}", "title": "" }, { "docid": "cd8c19e9524321e2465ead0ebac86284", "score": "0.79304063", "text": "func (in *FilesFrom) DeepCopyInto(out *FilesFrom) {\n\t*out = *in\n}", "title": "" }, { "docid": "59f6a3f0b5460ec14888a0e8c4a79965", "score": "0.79289705", "text": "func (in *FilesystemBinaryCache) DeepCopyInto(out *FilesystemBinaryCache) {\n\t*out = *in\n\treturn\n}", "title": "" }, { "docid": "4b6d2bbc6df0bd972bb04594e79b6919", "score": "0.7920473", "text": "func (in *Dependency) DeepCopyInto(out *Dependency) {\n\t*out = *in\n\tout.Locator = in.Locator\n\treturn\n}", "title": "" }, { "docid": "08470e00ca7aec496a2eb8d78ea93dc5", "score": "0.7918501", "text": "func (in *Struct_NonPointerExplicitObject) DeepCopyInto(out *Struct_NonPointerExplicitObject) {\n\t*out = *in\n\treturn\n}", "title": "" }, { "docid": "7cedeb486714dca831a785712c66168d", "score": "0.7918211", "text": "func (in *HugePage) DeepCopyInto(out *HugePage) {\n\t*out = *in\n\treturn\n}", "title": "" }, { "docid": "b60094f2df75404ce1882420fe3681dd", "score": "0.791726", "text": "func (in *Buildpack) DeepCopyInto(out *Buildpack) {\n\t*out = *in\n\treturn\n}", "title": "" }, { "docid": "5d6676976741906b273edf03cf097f8d", "score": "0.7914521", "text": "func (in *Identity) DeepCopyInto(out *Identity) {\n\t*out = *in\n}", "title": "" }, { "docid": "e0bb2ad74bf9d1068a03f6f414650b67", "score": "0.7912297", "text": "func (in *ConfigFile) DeepCopyInto(out *ConfigFile) {\n\t*out = *in\n\treturn\n}", "title": "" }, { "docid": "a22fa5fa094406e0db8b6a0f3a49d59b", "score": "0.79098386", "text": "func (in *Flavor) DeepCopyInto(out *Flavor) {\n\t*out = *in\n\tif in.Nodes != nil {\n\t\tin, out := &in.Nodes, &out.Nodes\n\t\t*out = make([]FlavorNode, len(*in))\n\t\tcopy(*out, *in)\n\t}\n\treturn\n}", "title": "" }, { "docid": "faa35b0f75770678ed636bddaa5d5721", "score": "0.7909532", "text": "func (in *NumaTuneMemory) DeepCopyInto(out *NumaTuneMemory) {\n\t*out = *in\n\treturn\n}", "title": "" }, { "docid": "f9ad912684ce7e3a3c56efaef710a7c5", "score": "0.79094714", "text": "func (in *Cleanup) DeepCopyInto(out *Cleanup) {\n\t*out = *in\n}", "title": "" }, { "docid": "353e8c0b6635af77f678a667b1cbf124", "score": "0.7909399", "text": "func (in *MemoryBackingAccess) DeepCopyInto(out *MemoryBackingAccess) {\n\t*out = *in\n\treturn\n}", "title": "" }, { "docid": "fa4eb90516f66dd6b17c28b9f3cab1cf", "score": "0.79093784", "text": "func (in *Openshift) DeepCopyInto(out *Openshift) {\n\t*out = *in\n\treturn\n}", "title": "" }, { "docid": "4c1282e68f39e312cb76684584edbb7f", "score": "0.7906816", "text": "func (in *Step) DeepCopyInto(out *Step) {\n\t*out = *in\n\tif in.Command != nil {\n\t\tin, out := &in.Command, &out.Command\n\t\t*out = make([]string, len(*in))\n\t\tcopy(*out, *in)\n\t}\n\tif in.Args != nil {\n\t\tin, out := &in.Args, &out.Args\n\t\t*out = make([]string, len(*in))\n\t\tcopy(*out, *in)\n\t}\n\tif in.DeprecatedPorts != nil {\n\t\tin, out := &in.DeprecatedPorts, &out.DeprecatedPorts\n\t\t*out = make([]corev1.ContainerPort, len(*in))\n\t\tcopy(*out, *in)\n\t}\n\tif in.EnvFrom != nil {\n\t\tin, out := &in.EnvFrom, &out.EnvFrom\n\t\t*out = make([]corev1.EnvFromSource, len(*in))\n\t\tfor i := range *in {\n\t\t\t(*in)[i].DeepCopyInto(&(*out)[i])\n\t\t}\n\t}\n\tif in.Env != nil {\n\t\tin, out := &in.Env, &out.Env\n\t\t*out = make([]corev1.EnvVar, len(*in))\n\t\tfor i := range *in {\n\t\t\t(*in)[i].DeepCopyInto(&(*out)[i])\n\t\t}\n\t}\n\tin.Resources.DeepCopyInto(&out.Resources)\n\tif in.VolumeMounts != nil {\n\t\tin, out := &in.VolumeMounts, &out.VolumeMounts\n\t\t*out = make([]corev1.VolumeMount, len(*in))\n\t\tfor i := range *in {\n\t\t\t(*in)[i].DeepCopyInto(&(*out)[i])\n\t\t}\n\t}\n\tif in.VolumeDevices != nil {\n\t\tin, out := &in.VolumeDevices, &out.VolumeDevices\n\t\t*out = make([]corev1.VolumeDevice, len(*in))\n\t\tcopy(*out, *in)\n\t}\n\tif in.DeprecatedLivenessProbe != nil {\n\t\tin, out := &in.DeprecatedLivenessProbe, &out.DeprecatedLivenessProbe\n\t\t*out = new(corev1.Probe)\n\t\t(*in).DeepCopyInto(*out)\n\t}\n\tif in.DeprecatedReadinessProbe != nil {\n\t\tin, out := &in.DeprecatedReadinessProbe, &out.DeprecatedReadinessProbe\n\t\t*out = new(corev1.Probe)\n\t\t(*in).DeepCopyInto(*out)\n\t}\n\tif in.DeprecatedStartupProbe != nil {\n\t\tin, out := &in.DeprecatedStartupProbe, &out.DeprecatedStartupProbe\n\t\t*out = new(corev1.Probe)\n\t\t(*in).DeepCopyInto(*out)\n\t}\n\tif in.DeprecatedLifecycle != nil {\n\t\tin, out := &in.DeprecatedLifecycle, &out.DeprecatedLifecycle\n\t\t*out = new(corev1.Lifecycle)\n\t\t(*in).DeepCopyInto(*out)\n\t}\n\tif in.SecurityContext != nil {\n\t\tin, out := &in.SecurityContext, &out.SecurityContext\n\t\t*out = new(corev1.SecurityContext)\n\t\t(*in).DeepCopyInto(*out)\n\t}\n\tif in.Timeout != nil {\n\t\tin, out := &in.Timeout, &out.Timeout\n\t\t*out = new(v1.Duration)\n\t\t**out = **in\n\t}\n\tif in.Workspaces != nil {\n\t\tin, out := &in.Workspaces, &out.Workspaces\n\t\t*out = make([]WorkspaceUsage, len(*in))\n\t\tcopy(*out, *in)\n\t}\n\tif in.StdoutConfig != nil {\n\t\tin, out := &in.StdoutConfig, &out.StdoutConfig\n\t\t*out = new(StepOutputConfig)\n\t\t**out = **in\n\t}\n\tif in.StderrConfig != nil {\n\t\tin, out := &in.StderrConfig, &out.StderrConfig\n\t\t*out = new(StepOutputConfig)\n\t\t**out = **in\n\t}\n\treturn\n}", "title": "" }, { "docid": "d2390e63ffae78df49dbee0849af5c53", "score": "0.79063445", "text": "func (in *ImageBuild) DeepCopyInto(out *ImageBuild) {\n\t*out = *in\n\treturn\n}", "title": "" }, { "docid": "3e72237bf229a54bf5fbc6a3bdab658f", "score": "0.7904928", "text": "func (in *MatchEntry) DeepCopyInto(out *MatchEntry) {\n\t*out = *in\n\tif in.Processes != nil {\n\t\tin, out := &in.Processes, &out.Processes\n\t\t*out = make([]string, len(*in))\n\t\tcopy(*out, *in)\n\t}\n\tif in.ExcludedNamespaces != nil {\n\t\tin, out := &in.ExcludedNamespaces, &out.ExcludedNamespaces\n\t\t*out = make([]wildcard.Wildcard, len(*in))\n\t\tcopy(*out, *in)\n\t}\n}", "title": "" }, { "docid": "a2c3ef4679aaffcf7bbbc9eca2211d29", "score": "0.79044276", "text": "func (in *Grafana) DeepCopyInto(out *Grafana) {\n\t*out = *in\n\treturn\n}", "title": "" }, { "docid": "bcf09a71293c9cee0c34c2fa367e656b", "score": "0.7904371", "text": "func (in *Path) DeepCopyInto(out *Path) {\n\t*out = *in\n\treturn\n}", "title": "" }, { "docid": "9b20ecbd2e5206a3078e0160815c4797", "score": "0.790394", "text": "func (in *CASpec) DeepCopyInto(out *CASpec) {\n\t*out = *in\n\treturn\n}", "title": "" }, { "docid": "846892e66bde8639901c45cc7e147cf9", "score": "0.79034203", "text": "func (in *Runtime) DeepCopyInto(out *Runtime) {\n\t*out = *in\n\tout.Locator = in.Locator\n\treturn\n}", "title": "" }, { "docid": "b969c40ddd2a12fda1ad0bcb52dedb0c", "score": "0.7900441", "text": "func (in *Db) DeepCopyInto(out *Db) {\n\t*out = *in\n\treturn\n}", "title": "" }, { "docid": "776b0984cdaf45a4f28e7a136be20e7a", "score": "0.789801", "text": "func (u *ULID) DeepCopyInto(out *ULID) {\n\t*out = *u\n}", "title": "" }, { "docid": "6eedbcd9f73915f1ee6c8e6061a288dd", "score": "0.78971326", "text": "func (in *DataCleanStrategy) DeepCopyInto(out *DataCleanStrategy) {\n\t*out = *in\n\tvar fields []Fields\n\tfor _, v := range in.Fields {\n\t\tfields = append(fields, v)\n\t}\n\tout.Fields = fields\n}", "title": "" }, { "docid": "8c510e4af6c6902777e1353712eb8de8", "score": "0.78962827", "text": "func (in *ComputevpntunnelValueFrom) DeepCopyInto(out *ComputevpntunnelValueFrom) {\n\t*out = *in\n\tout.SecretKeyRef = in.SecretKeyRef\n\treturn\n}", "title": "" }, { "docid": "564805f323fbadde55f67e46f75ac865", "score": "0.7895045", "text": "func (in *Destination) DeepCopyInto(out *Destination) {\n\t*out = *in\n}", "title": "" } ]
793dfbde0df4dd30f1d1c63b7ee7153b
traceDeviceNetnsUpdate Traces a device netns update
[ { "docid": "08a2ddc3572f65a1da13e825c043e0fc", "score": "0.8450348", "text": "func traceDeviceNetnsUpdate(data []byte, m *base.Monitor) {\n\tvar eventRaw model.DeviceNetnsUpdateRaw\n\tif err := binary.Read(bytes.NewBuffer(data), utils.GetHostByteOrder(), &eventRaw); err != nil {\n\t\tnetLogger.Errorf(\"failed to decode received data (DeviceNetnsUpdateRaw): %s\\n\", err)\n\t\treturn\n\t}\n\t// Prepare event\n\tevent := model.DeviceNetnsUpdate{\n\t\tEventBase: model.EventBase{\n\t\t\tEventMonitorName: m.Name,\n\t\t\tEventType: model.DeviceNetnsUpdateType,\n\t\t\tTimestamp: m.Nsp.GetBootTime().Add(time.Duration(eventRaw.Metadata.TimestampRaw) * time.Nanosecond),\n\t\t\tTTYName: C.GoString((*C.char)(unsafe.Pointer(&eventRaw.Metadata.TTYNameRaw))),\n\t\t},\n\t\tDeviceNetnsUpdateRaw: &eventRaw,\n\t\tDeviceName: C.GoString((*C.char)(unsafe.Pointer(&eventRaw.Device.NameRaw))),\n\t}\n\t// Dispatch event\n\tm.Nsp.DispatchEvent(&event)\n}", "title": "" } ]
[ { "docid": "898523aee74f41992595a913d57fe93b", "score": "0.6864458", "text": "func (proc *Proc) NodeNetworkUpdate(node *nm.Node, desc *model.MetricDesc, label *nm.MetricNetworkLables, Log logrus.FieldLogger) error {\n\n\tisExist := false\n\tfor idx, net := range node.Net.Devices {\n\t\tif net.Name == label.Device {\n\t\t\tLog.Debugf(\"Update Network Device[ %s ] Type[ %s ]\", label.Device, desc.FqName)\n\t\t\tisExist = true\n\t\t\tswitch desc.FqName {\n\t\t\tcase nm.MetricNameNetInfo:\n\t\t\tcase nm.MetricNameNetRecvBytes:\n\t\t\t\t// calc\n\t\t\t\tif net.PrevNetStatus.RxBytes != 0 {\n\t\t\t\t\tif net.PrevNetStatus.RxBytes > uint64(desc.Value) {\n\t\t\t\t\t\t// ( UINT64_MAX - prev ) + cur;\n\t\t\t\t\t\tnode.Net.Devices[idx].RxBytes = (math.MaxUint64 - net.PrevNetStatus.RxBytes) + uint64(desc.Value)\n\t\t\t\t\t} else {\n\t\t\t\t\t\t// cur - prev;\n\t\t\t\t\t\tnode.Net.Devices[idx].RxBytes = uint64(desc.Value) - net.PrevNetStatus.RxBytes\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\t// Save\n\t\t\t\tnode.Net.Devices[idx].PrevNetStatus.RxBytes = uint64(desc.Value)\n\t\t\tcase nm.MetricNameNetRecvPackets:\n\t\t\t\tif net.PrevNetStatus.RxPackets != 0 {\n\t\t\t\t\tif net.PrevNetStatus.RxPackets > uint64(desc.Value) {\n\t\t\t\t\t\tnode.Net.Devices[idx].RxPackets = (math.MaxUint64 - net.PrevNetStatus.RxPackets) + uint64(desc.Value)\n\t\t\t\t\t} else {\n\t\t\t\t\t\tnode.Net.Devices[idx].RxPackets = uint64(desc.Value) - net.PrevNetStatus.RxPackets\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\t// Save\n\t\t\t\tnode.Net.Devices[idx].PrevNetStatus.RxPackets = uint64(desc.Value)\n\t\t\tcase nm.MetricNameNetTransmitBytes:\n\t\t\t\tif net.PrevNetStatus.TxBytes != 0 {\n\t\t\t\t\tif net.PrevNetStatus.TxBytes > uint64(desc.Value) {\n\t\t\t\t\t\tnode.Net.Devices[idx].TxBytes = (math.MaxUint64 - net.PrevNetStatus.TxBytes) + uint64(desc.Value)\n\t\t\t\t\t} else {\n\t\t\t\t\t\tnode.Net.Devices[idx].TxBytes = uint64(desc.Value) - net.PrevNetStatus.TxBytes\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\t// Save\n\t\t\t\tnode.Net.Devices[idx].PrevNetStatus.TxBytes = uint64(desc.Value)\n\t\t\tcase nm.MetricNameNetTransmitPackets:\n\t\t\t\tif net.PrevNetStatus.TxPackets != 0 {\n\t\t\t\t\tif net.PrevNetStatus.TxPackets > uint64(desc.Value) {\n\t\t\t\t\t\tnode.Net.Devices[idx].TxPackets = (math.MaxUint64 - net.PrevNetStatus.TxPackets) + uint64(desc.Value)\n\t\t\t\t\t} else {\n\t\t\t\t\t\tnode.Net.Devices[idx].TxPackets = uint64(desc.Value) - net.PrevNetStatus.TxPackets\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\t// Save\n\t\t\t\tnode.Net.Devices[idx].PrevNetStatus.TxPackets = uint64(desc.Value)\n\t\t\t}\n\t\t\tbreak\n\t\t}\n\t}\n\tif !isExist {\n\t\tisExist := false\n\t\t// 수집 대상인지 확인\n\t\tfor _, name := range proc.config.CollectionConfig.NetDevices {\n\t\t\tif name == label.Device {\n\t\t\t\tisExist = true\n\t\t\t\tbreak\n\t\t\t}\n\t\t}\n\t\tif isExist {\n\t\t\tLog.Debugf(\"Add New Network Device[ %s ]\", label.Device)\n\t\t\tnd := nm.NetDevice{\n\t\t\t\tName: label.Device,\n\t\t\t\tStatus: \"up\",\n\t\t\t}\n\t\t\tswitch desc.FqName {\n\t\t\tcase nm.MetricNameNetInfo:\n\t\t\tcase nm.MetricNameNetRecvBytes:\n\t\t\t\tnd.PrevNetStatus.RxBytes = uint64(desc.Value / 1000)\n\t\t\tcase nm.MetricNameNetRecvPackets:\n\t\t\t\tnd.PrevNetStatus.RxPackets = uint64(desc.Value / 1000)\n\t\t\tcase nm.MetricNameNetTransmitBytes:\n\t\t\t\tnd.PrevNetStatus.TxBytes = uint64(desc.Value / 1000)\n\t\t\tcase nm.MetricNameNetTransmitPackets:\n\t\t\t\tnd.PrevNetStatus.TxPackets = uint64(desc.Value / 1000)\n\t\t\t}\n\t\t\tnode.Net.Devices = append(node.Net.Devices, nd)\n\t\t}\n\t}\n\treturn nil\n}", "title": "" }, { "docid": "e1b2c018c429d0d4ab63d41284220150", "score": "0.58675313", "text": "func updateNetworkDevice(c *gin.Context) {\n\tsession := getSession()\n\tdefer session.Close()\n\tvar n networkDevice\n\terr := c.ShouldBindJSON(&n)\n\tif err != nil {\n\t\tlog.Println(err.Error())\n\t\tc.JSON(http.StatusBadRequest, gin.H{\"error\": err.Error()})\n\t}\n\tel := session.DB(\"inventory\").C(\"network\")\n\tsn, haveSN := c.GetQuery(\"sn\")\n\tif haveSN {\n\t\terr = el.Update(bson.M{\"serialnumber\": sn}, &n)\n\t\tif err != nil {\n\t\t\tlog.Println(err)\n\t\t\tc.JSON(http.StatusBadRequest, gin.H{\"error\": err.Error()})\n\t\t} else {\n\t\t\tc.JSON(http.StatusOK, gin.H{\"error\": \"\"})\n\t\t}\n\t} else {\n\t\tc.JSON(http.StatusBadRequest, gin.H{\"error\": \"You have to specify device serial number\"})\n\t}\n}", "title": "" }, { "docid": "01c356214cfaec03fce53da380d3441b", "score": "0.5717443", "text": "func (rc *requestController) updateNodeNetConfig(ctx context.Context, nnc *v1alpha.NodeNetworkConfig) error {\n\t//nolint:wrapcheck\n\treturn rc.KubeClient.Update(ctx, nnc)\n}", "title": "" }, { "docid": "ecceb2cf344e5b5f88b23870b70274b4", "score": "0.5670901", "text": "func traceNewNetDevice(data []byte, m *base.Monitor) {\n\tvar eventRaw model.DeviceEventRaw\n\tif err := binary.Read(bytes.NewBuffer(data), utils.GetHostByteOrder(), &eventRaw); err != nil {\n\t\tnetLogger.Errorf(\"failed to decode received data (DeviceEventRaw): %s\\n\", err)\n\t\treturn\n\t}\n\t// Prepare event\n\tevent := model.DeviceEvent{\n\t\tEventBase: model.EventBase{\n\t\t\tEventMonitorName: m.Name,\n\t\t\tEventType: model.NewNetDeviceType,\n\t\t\tTimestamp: m.Nsp.GetBootTime().Add(time.Duration(eventRaw.Metadata.TimestampRaw) * time.Nanosecond),\n\t\t\tTTYName: C.GoString((*C.char)(unsafe.Pointer(&eventRaw.Metadata.TTYNameRaw))),\n\t\t},\n\t\tDeviceEventRaw: &eventRaw,\n\t\tDeviceName: C.GoString((*C.char)(unsafe.Pointer(&eventRaw.Device.NameRaw))),\n\t\tPeerName: C.GoString((*C.char)(unsafe.Pointer(&eventRaw.Peer.NameRaw))),\n\t}\n\tswitch event.EventFlag {\n\tcase model.DeviceRegistration:\n\t\t// Create a new Classifier for the new interface.\n\t\tm.Nsp.SetupDeviceMonitor(&event)\n\tcase model.DeviceUnregistration:\n\t\t// Delete monitor\n\t\tm.Nsp.StopDeviceMonitor(&event)\n\t}\n\t// Dispatch event\n\tm.Nsp.DispatchEvent(&event)\n}", "title": "" }, { "docid": "2e90ef1b9693be0aa0d6803998f1d7f0", "score": "0.5612222", "text": "func (c *nfsdCollector) updateNFSdNetworkStats(ch chan<- prometheus.Metric, s *nfs.Network) {\n\tpacketDesc := prometheus.NewDesc(\n\t\tprometheus.BuildFQName(namespace, nfsdSubsystem, \"packets_total\"),\n\t\t\"Total NFSd network packets (sent+received) by protocol type.\",\n\t\t[]string{\"proto\"},\n\t\tnil,\n\t)\n\tch <- prometheus.MustNewConstMetric(\n\t\tpacketDesc,\n\t\tprometheus.CounterValue,\n\t\tfloat64(s.UDPCount), \"udp\")\n\tch <- prometheus.MustNewConstMetric(\n\t\tpacketDesc,\n\t\tprometheus.CounterValue,\n\t\tfloat64(s.TCPCount), \"tcp\")\n\tch <- prometheus.MustNewConstMetric(\n\t\tprometheus.NewDesc(\n\t\t\tprometheus.BuildFQName(namespace, nfsdSubsystem, \"connections_total\"),\n\t\t\t\"Total number of NFSd TCP connections.\",\n\t\t\tnil,\n\t\t\tnil,\n\t\t),\n\t\tprometheus.CounterValue,\n\t\tfloat64(s.TCPConnect))\n}", "title": "" }, { "docid": "39acce07b1706fff39b1ce8c18da8aca", "score": "0.5598752", "text": "func (dp *DelphiDatapath) UpdateNetwork(nw *netproto.Network, uplinks []*netproto.Interface, vrf *netproto.Vrf) error {\n\tvar ifKeyHandles []*halproto.InterfaceKeyHandle\n\n\tfor _, uplink := range uplinks {\n\t\tifKeyHandle := halproto.InterfaceKeyHandle{\n\t\t\tKeyOrHandle: &halproto.InterfaceKeyHandle_InterfaceId{\n\t\t\t\tInterfaceId: uplink.Status.InterfaceID,\n\t\t\t},\n\t\t}\n\n\t\tifKeyHandles = append(ifKeyHandles, &ifKeyHandle)\n\t}\n\n\t// build l2 segment data\n\tseg := &halproto.L2SegmentSpec{\n\t\tKeyOrHandle: &halproto.L2SegmentKeyHandle{\n\t\t\tKeyOrHandle: &halproto.L2SegmentKeyHandle_SegmentId{\n\t\t\t\tSegmentId: nw.Status.NetworkID,\n\t\t\t},\n\t\t},\n\t\tMcastFwdPolicy: halproto.MulticastFwdPolicy_MULTICAST_FWD_POLICY_FLOOD,\n\t\tBcastFwdPolicy: halproto.BroadcastFwdPolicy_BROADCAST_FWD_POLICY_FLOOD,\n\t\tWireEncap: &halproto.EncapInfo{\n\t\t\tEncapType: halproto.EncapType_ENCAP_TYPE_DOT1Q,\n\t\t\tEncapValue: nw.Spec.VlanID,\n\t\t},\n\t\tTunnelEncap: &halproto.EncapInfo{\n\t\t\tEncapType: halproto.EncapType_ENCAP_TYPE_VXLAN,\n\t\t\tEncapValue: nw.Spec.VlanID,\n\t\t},\n\t\tIfKeyHandle: ifKeyHandles,\n\t}\n\n\terr := dp.delphiClient.SetObject(seg)\n\tif err != nil {\n\t\treturn err\n\t}\n\n\treturn nil\n}", "title": "" }, { "docid": "de2333d2e6af464d078cdc784e040487", "score": "0.5532853", "text": "func (c *nfsCollector) updateNFSNetworkStats(ch chan<- prometheus.Metric, s *nfs.Network) {\n\tch <- prometheus.MustNewConstMetric(c.nfsNetReadsDesc, prometheus.CounterValue,\n\t\tfloat64(s.UDPCount), \"udp\")\n\tch <- prometheus.MustNewConstMetric(c.nfsNetReadsDesc, prometheus.CounterValue,\n\t\tfloat64(s.TCPCount), \"tcp\")\n\tch <- prometheus.MustNewConstMetric(c.nfsNetConnectionsDesc, prometheus.CounterValue,\n\t\tfloat64(s.TCPConnect))\n}", "title": "" }, { "docid": "e9826d9a90289ccb92b7f74d15556ba4", "score": "0.53567326", "text": "func (cluster *OvnClusterController) watchNamespaceUpdate(node *kapi.Node,\n\tsubnet string) error {\n\t_, err := cluster.watchFactory.AddNamespaceHandler(\n\t\tcache.ResourceEventHandlerFuncs{\n\t\t\tUpdateFunc: func(old, newer interface{}) {\n\t\t\t\toldNs := old.(*kapi.Namespace)\n\t\t\t\toldMasterIP := oldNs.Annotations[MasterOverlayIP]\n\t\t\t\tnewNs := newer.(*kapi.Namespace)\n\t\t\t\tnewMasterIP := newNs.Annotations[MasterOverlayIP]\n\t\t\t\tif newMasterIP != oldMasterIP {\n\t\t\t\t\terr := cluster.updateOvnNode(newMasterIP, node, subnet)\n\t\t\t\t\tif err != nil {\n\t\t\t\t\t\tlogrus.Errorf(\"Failed to update OVN node with new \"+\n\t\t\t\t\t\t\t\"masterIP %s: %v\", newMasterIP, err)\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t},\n\t\t}, nil)\n\treturn err\n}", "title": "" }, { "docid": "c2f70446f374e4871188e381e89c5e18", "score": "0.5225221", "text": "func (daemon *Daemon) updateNetwork(cfg *config.Config, container *container.Container) error {\n\tvar (\n\t\tstart = time.Now()\n\t\tctrl = daemon.netController\n\t\tsid = container.NetworkSettings.SandboxID\n\t)\n\n\tsb, err := ctrl.SandboxByID(sid)\n\tif err != nil {\n\t\treturn fmt.Errorf(\"error locating sandbox id %s: %v\", sid, err)\n\t}\n\n\t// Find if container is connected to the default bridge network\n\tvar n *libnetwork.Network\n\tfor name, v := range container.NetworkSettings.Networks {\n\t\tsn, err := daemon.FindNetwork(getNetworkID(name, v.EndpointSettings))\n\t\tif err != nil {\n\t\t\tcontinue\n\t\t}\n\t\tif sn.Name() == runconfig.DefaultDaemonNetworkMode().NetworkName() {\n\t\t\tn = sn\n\t\t\tbreak\n\t\t}\n\t}\n\n\tif n == nil {\n\t\t// Not connected to the default bridge network; Nothing to do\n\t\treturn nil\n\t}\n\n\tsbOptions, err := daemon.buildSandboxOptions(cfg, container)\n\tif err != nil {\n\t\treturn fmt.Errorf(\"Update network failed: %v\", err)\n\t}\n\n\tif err := sb.Refresh(sbOptions...); err != nil {\n\t\treturn fmt.Errorf(\"Update network failed: Failure in refresh sandbox %s: %v\", sid, err)\n\t}\n\n\tnetworkActions.WithValues(\"update\").UpdateSince(start)\n\n\treturn nil\n}", "title": "" }, { "docid": "e3b65b673cae57159d66cea36f05425a", "score": "0.52233565", "text": "func niUpdateNIprobing(ctx *zedrouterContext, status *types.NetworkInstanceStatus) {\n\tpub := ctx.subDeviceNetworkStatus\n\titems := pub.GetAll()\n\tportList := getIfNameListForLLOrIfname(ctx, status.Logicallabel)\n\tlog.Functionf(\"niUpdateNIprobing: enter, type %v, number of ports %d\\n\", status.Type, len(portList))\n\tfor _, st := range items {\n\t\tdevStatus := st.(types.DeviceNetworkStatus)\n\n\t\tfor _, port := range portList {\n\t\t\tdevPort := getDevPort(&devStatus, port)\n\t\t\tif devPort == nil {\n\t\t\t\tlog.Functionf(\"niUpdateNIprobing: Port %s not found in DeviceNetworkStatus %+v\",\n\t\t\t\t\tport, devStatus)\n\t\t\t\tcontinue\n\t\t\t}\n\t\t\tif !isSharedPortLabel(status.Logicallabel) &&\n\t\t\t\tstatus.Logicallabel != devPort.Logicallabel {\n\t\t\t\tcontinue\n\t\t\t}\n\t\t\tniProbingUpdatePort(ctx, *devPort, status)\n\t\t}\n\t}\n\tcheckNIprobeUplink(ctx, status, \"\")\n}", "title": "" }, { "docid": "21a3858210953b4336674188e03edaa5", "score": "0.5160136", "text": "func (e *Endpoints) NetworkUpdateAddress(address string) error {\n\treturn e.newListener(network, e.NetworkAddress(), address)\n}", "title": "" }, { "docid": "8ee7af5b0827d88526765801333a5e5c", "score": "0.51500416", "text": "func (client AppsClient) UpdateVnetConnectionResponder(resp *http.Response) (result VnetInfo, err error) {\n\terr = autorest.Respond(\n\t\tresp,\n\t\tclient.ByInspecting(),\n\t\tazure.WithErrorUnlessStatusCode(http.StatusOK),\n\t\tautorest.ByUnmarshallingJSON(&result),\n\t\tautorest.ByClosing())\n\tresult.Response = autorest.Response{Response: resp}\n\treturn\n}", "title": "" }, { "docid": "f44ac6cd4484a0d28549a40cd80429b1", "score": "0.51058424", "text": "func (client AppsClient) UpdateVnetConnectionSender(req *http.Request) (*http.Response, error) {\n\treturn autorest.SendWithSender(client, req)\n}", "title": "" }, { "docid": "3c31c750065cc00759d132c9b28adbef", "score": "0.50817037", "text": "func (proc *Proc) NodeDiskUpdate(node *nm.Node, desc *model.MetricDesc, label *nm.MetricDiskLabel, Log logrus.FieldLogger) error {\n\n\tisExist := false\n\tfor idx, disk := range node.Disk.Devices {\n\t\tif disk.Device == label.Device {\n\t\t\tLog.Debugf(\"Update Disk Device[ %s ] Type[ %s ]\", label.Device, desc.FqName)\n\t\t\tisExist = true\n\t\t\tswitch desc.FqName {\n\t\t\tcase nm.MetricNameDiskReadTimeTotal:\n\t\t\t\tnode.Disk.Devices[idx].Second.ReadTimeTotal = desc.Value\n\t\t\tcase nm.MetricNameDiskReadCompletedTotal:\n\t\t\t\tnode.Disk.Devices[idx].Second.ReadCompletedTotal = desc.Value\n\t\t\tcase nm.MetricNameDiskWriteTimeTotal:\n\t\t\t\tnode.Disk.Devices[idx].Second.WriteTimeTotal = desc.Value\n\t\t\tcase nm.MetricNameDiskWriteCompletedTotal:\n\t\t\t\tnode.Disk.Devices[idx].Second.WriteCompletedTotal = desc.Value\n\t\t\t}\n\t\t\tbreak\n\t\t}\n\t}\n\tif !isExist {\n\t\t// 수집 대상인지 확인\n\t\tisExist := false\n\t\tfor _, name := range proc.config.CollectionConfig.DiskDevices {\n\t\t\tif name == label.Device {\n\t\t\t\tisExist = true\n\t\t\t\tbreak\n\t\t\t}\n\t\t}\n\t\tif isExist {\n\t\t\tLog.Debugf(\"Add New Disk Device[ %s ]\", label.Device)\n\t\t\tdd := nm.DiskDevice{\n\t\t\t\tDevice: label.Device,\n\t\t\t}\n\t\t\tswitch desc.FqName {\n\t\t\tcase nm.MetricNameDiskReadTimeTotal:\n\t\t\t\tdd.Second.ReadTimeTotal = desc.Value\n\t\t\tcase nm.MetricNameDiskReadCompletedTotal:\n\t\t\t\tdd.Second.ReadCompletedTotal = desc.Value\n\t\t\tcase nm.MetricNameDiskWriteTimeTotal:\n\t\t\t\tdd.Second.WriteTimeTotal = desc.Value\n\t\t\tcase nm.MetricNameDiskWriteCompletedTotal:\n\t\t\t\tdd.Second.WriteCompletedTotal = desc.Value\n\t\t\t}\n\t\t\tnode.Disk.Devices = append(node.Disk.Devices, dd)\n\t\t}\n\t}\n\treturn nil\n}", "title": "" }, { "docid": "42735ba902f8b36208166afc6e09c1df", "score": "0.50377977", "text": "func updateNetwork() {\n\tfor _, address := range State.peers {\n\t\t// Don't try to update yourself\n\t\tif address != State.NodeAddress {\n\t\t\tupdateSingleNode(address)\n\t\t}\n\t}\n}", "title": "" }, { "docid": "2c7baea6c0e0ba97697601f7d4b61f78", "score": "0.50277627", "text": "func (r *ReconcileInstall) updateServiceNetwork() error {\n\n\t// retrieve service networks for configuring egress traffic\n\tserviceNetwork := r.getServiceNetwork()\n\n\t// If service network is available, update config-network config map\n\tif len(serviceNetwork) > 0 {\n\n\t\tcm := &v1.ConfigMap{}\n\t\tu := r.config.Find(\"v1\", \"ConfigMap\", \"config-network\")\n\t\tkey := types.NamespacedName{Namespace: u.GetNamespace(), Name: u.GetName()}\n\t\tif err := r.client.Get(context.TODO(), key, cm); err != nil {\n\t\t\treturn err\n\t\t}\n\t\tcm.Data[\"istio.sidecar.includeOutboundIPRanges\"] = serviceNetwork\n\t\treturn r.client.Update(context.TODO(), cm)\n\n\t}\n\n\treturn nil\n}", "title": "" }, { "docid": "a147b0c72da04727d44be3ec64011133", "score": "0.5014692", "text": "func (h *HubClient) NatRuleUpdate(natRule NatRule) (err error) {\n\treturn h.client.setXPathValues(natRule.getUpdateActions(h.firmware.natRuleXPath()))\n}", "title": "" }, { "docid": "036eae3905cd912d0bcf9d68e8814ef6", "score": "0.4998413", "text": "func (e *Endpoints) NetworkUpdateCert(cert *cert.Info) error {\n\te.mutex.Lock()\n\tdefer e.mutex.Unlock()\n\n\te.cert = cert\n\tif listener, ok := e.listeners[network]; ok {\n\t\tlistener.(*networkListener).Config(cert)\n\t}\n\treturn nil\n}", "title": "" }, { "docid": "074080f4c2bca8ca9491c79580dcc853", "score": "0.49871296", "text": "func NetDevStats() (receive, transmit map[string]map[string]uint64, err error) {\n\treceive = make(map[string]map[string]uint64)\n\ttransmit = make(map[string]map[string]uint64)\n\tf, err := os.Open(\"/proc/net/dev\")\n\tif err != nil {\n\t\treturn nil, nil, err\n\t}\n\tdefer f.Close()\n\n\treader := bufio.NewReader(f)\n\theader, err := reader.ReadBytes('\\n')\n\tif err != nil {\n\t\treturn nil, nil, err\n\t}\n\tif !netDevHeader.Match(header) {\n\t\treturn nil, nil, errNetDev\n\t}\n\tcols, err := reader.ReadString('\\n')\n\tif err != nil {\n\t\treturn nil, nil, err\n\t}\n\tcolSections := strings.Split(cols, \"|\")\n\tif len(colSections) != 3 {\n\t\treturn nil, nil, errNetDev\n\t}\n\treceiveColNames := strings.Fields(colSections[1])\n\ttransmitColNames := strings.Fields(colSections[2])\n\tfor {\n\t\tline, err := reader.ReadString('\\n')\n\t\tif err != nil {\n\t\t\tif err == io.EOF {\n\t\t\t\tif len(receive) == 0 {\n\t\t\t\t\treturn nil, nil, errors.New(\"no devices\")\n\t\t\t\t}\n\t\t\t\tbreak\n\t\t\t}\n\t\t\treturn nil, nil, err\n\t\t}\n\n\t\tparts := strings.Split(line, \":\")\n\t\tif len(parts) != 2 {\n\t\t\treturn nil, nil, errNetDev\n\t\t}\n\t\tkey := string(strings.TrimSpace(parts[0]))\n\t\treceiveValue := make(map[string]uint64)\n\t\ttransmitValue := make(map[string]uint64)\n\t\tfields := strings.Fields(parts[1])\n\t\tif len(fields) != len(receiveColNames)+len(transmitColNames) {\n\t\t\treturn nil, nil, errNetDev\n\t\t}\n\t\tfor i, field := range fields {\n\t\t\tv, err := strconv.ParseUint(string(field), 10, 64)\n\t\t\tif err != nil {\n\t\t\t\treturn nil, nil, err\n\t\t\t}\n\t\t\tif i < len(receiveColNames) {\n\t\t\t\treceiveValue[receiveColNames[i]] = v\n\t\t\t} else {\n\t\t\t\ttransmitValue[transmitColNames[i-len(receiveColNames)]] = v\n\t\t\t}\n\t\t}\n\t\treceive[key] = receiveValue\n\t\ttransmit[key] = transmitValue\n\t}\n\n\treturn receive, transmit, nil\n}", "title": "" }, { "docid": "297d7360309c658af81ec51271a32b2b", "score": "0.49369842", "text": "func (nrc *NetworkRoutingController) OnServiceUpdate(objNew interface{}, objOld interface{}) {\n\tnrc.tryHandleServiceUpdate(objNew, \"Received update on service: %s/%s from watch API\")\n\n\t// This extra call needs to be here, because during the update the list of externalIPs may have changed and\n\t// externalIPs is the only service VIP field that is:\n\t// a) mutable after first creation\n\t// b) an array\n\t//\n\t// This means that while we only need to withdraw ClusterIP VIPs and LoadBalancer VIPs on delete, we may need\n\t// to withdraw ExternalIPs on update.\n\t//\n\t// As such, it needs to be handled differently as nrc.handleServiceUpdate only withdraws VIPs if the service\n\t// endpoint is no longer scheduled on this node and its a local type service.\n\tnrc.withdrawVIPs(nrc.getExternalIPsToWithdraw(getServiceObject(objOld), getServiceObject(objNew)))\n}", "title": "" }, { "docid": "73c95853c2c6aecd04ff62fc4b04b0c1", "score": "0.49367487", "text": "func (d *delegate)NotifyUpdate(n *memberlist.Node){\n\tif d.peer.event.NotifyUpdate!=nil{\n\t\td.peer.event.NotifyUpdate(n.Name)\n\t}\n}", "title": "" }, { "docid": "2975212a5afb79af59d0efef30ef6976", "score": "0.49327227", "text": "func (client AppsClient) UpdateVnetConnectionSlotSender(req *http.Request) (*http.Response, error) {\n\treturn autorest.SendWithSender(client, req)\n}", "title": "" }, { "docid": "3424d4438a6899c453cbe2e2ddc4ce62", "score": "0.4919309", "text": "func kubernetesUpdateNodeEventHandler(o, n interface{}) {\n\t// node, ok := n.(*v1.Node)\n\t_, ok := n.(*v1.Node)\n\tif !ok {\n\t\tlog.Printf(\"Error processing Update Event received for node(%s) \", n)\n\t\treturn\n\t}\n\n\t// Disable this for now, update events are sent every\n\t// 10 seconds per node, thus this could fill up the log\n\t// easily in very small amount of time.\n\t// log.Printf(\"Update Event received for node(%s) \",node.Name)\n}", "title": "" }, { "docid": "d82a43e36cc300851cf04ca0c99938e9", "score": "0.4918509", "text": "func (service *ContrailService) UpdateNetworkDeviceConfig(\n\tctx context.Context,\n\trequest *models.UpdateNetworkDeviceConfigRequest) (*models.UpdateNetworkDeviceConfigResponse, error) {\n\tmodel := request.NetworkDeviceConfig\n\tif model == nil {\n\t\treturn nil, common.ErrorBadRequest(\"Update body is empty\")\n\t}\n\tif err := common.DoInTransaction(\n\t\tservice.DB,\n\t\tfunc(tx *sql.Tx) error {\n\t\t\treturn db.UpdateNetworkDeviceConfig(ctx, tx, request)\n\t\t}); err != nil {\n\t\tlog.WithFields(log.Fields{\n\t\t\t\"err\": err,\n\t\t\t\"resource\": \"network_device_config\",\n\t\t}).Debug(\"db update failed\")\n\t\treturn nil, common.ErrorInternal\n\t}\n\treturn &models.UpdateNetworkDeviceConfigResponse{\n\t\tNetworkDeviceConfig: model,\n\t}, nil\n}", "title": "" }, { "docid": "e2f368f64cfaaa8de5a4abb3e6361e54", "score": "0.48956907", "text": "func (np *NaplesPlatformAgent) UpdateSmartNIC(nw *cluster.DistributedServiceCard) error {\n\treturn nil\n}", "title": "" }, { "docid": "430b66cf31a144cbdeb8fc44270d77e0", "score": "0.4884106", "text": "func (client AppsClient) UpdateVnetConnectionSlotResponder(resp *http.Response) (result VnetInfo, err error) {\n\terr = autorest.Respond(\n\t\tresp,\n\t\tclient.ByInspecting(),\n\t\tazure.WithErrorUnlessStatusCode(http.StatusOK),\n\t\tautorest.ByUnmarshallingJSON(&result),\n\t\tautorest.ByClosing())\n\tresult.Response = autorest.Response{Response: resp}\n\treturn\n}", "title": "" }, { "docid": "1db56925d7e8e201ba91bcf651e5dc59", "score": "0.48823395", "text": "func (k8s *K8SCtlProbe) updateNPLinks() {\n\tsort.Slice(k8s.k8sNPNEW, func(i, j int) bool {\n\t\treturn strings.Join([]string{k8s.k8sNPNEW[i].fromStr, k8s.k8sNPNEW[i].toStr}, \"\") > strings.Join([]string{k8s.k8sNPNEW[j].fromStr, k8s.k8sNPNEW[j].toStr}, \"\")\n\t})\n\n\tdeepequal := reflect.DeepEqual(k8s.k8sNPOLD, k8s.k8sNPNEW)\n\tlogging.GetLogger().Debugf(\"Is equal (OLD/NEW) = %v\", deepequal)\n\n\tif deepequal {\n\t\treturn\n\t}\n\n\tvar old int\n\tvar new int\n\tlogging.GetLogger().Debugf(\"k8sctl probe: OLD %v\", k8s.k8sNPOLD)\n\tlogging.GetLogger().Debugf(\"k8sctl probe: NEW %v\", k8s.k8sNPNEW)\n\n\tk8s.Graph.Lock()\n\n\tfor !(k8s.k8sNPOLD[old].from == \"\" && k8s.k8sNPNEW[new].from == \"\") {\n\t\tlogging.GetLogger().Debugf(\"k8s.k8sNPOLD[old].from = %s \\n k8s.k8sNPOLD[old].to = %s \\n k8s.k8sNPNEW[new].from = %s \\n k8s.k8sNPNEW[new].to = %s\", k8s.k8sNPOLD[old].from, k8s.k8sNPOLD[old].to, k8s.k8sNPNEW[new].from, k8s.k8sNPNEW[new].to)\n\n\t\tif k8s.k8sNPOLD[old].from == \"\" && k8s.k8sNPNEW[new].from != \"\" && k8s.k8sNPNEW[new].to != \"\" {\n\t\t\t// add new\n\t\t\tID := k8s.addNPEdge(k8s.k8sNPNEW[new])\n\t\t\tk8s.k8sNPNEW[new].e = ID\n\t\t\tnew++\n\n\t\t} else if k8s.k8sNPOLD[old].from != \"\" && k8s.k8sNPOLD[old].to != \"\" && k8s.k8sNPNEW[new].from == \"\" {\n\t\t\t// remove old\n\t\t\tlogging.GetLogger().Debugf(\"Remove Link %s to %s %s (%s)\", k8s.k8sNPOLD[old].fromStr, k8s.k8sNPOLD[old].toStr, k8s.k8sNPOLD[old].direction, k8s.k8sNPOLD[old].npText)\n\t\t\tedge := k8s.Graph.GetEdge(k8s.k8sNPOLD[old].e)\n\t\t\tif edge == nil {\n\t\t\t\tlogging.GetLogger().Debugf(\"Failed to Get Edge ID %s\", k8s.k8sNPOLD[old].e)\n\t\t\t} else {\n\t\t\t\tk8s.Graph.DelEdge(edge)\n\t\t\t}\n\t\t\told++\n\t\t} else {\n\n\t\t\tl := k8s.comapreNP(k8s.k8sNPOLD[old], k8s.k8sNPNEW[new])\n\n\t\t\tif l == AllEqual {\n\t\t\t\told++\n\t\t\t\tnew++\n\t\t\t} else if l == DirectionEqual {\n\t\t\t\t// update\n\t\t\t\tk8s.Graph.SetMetadata(k8s.k8sNPNEW[old].e, k8s.k8sNPNEW[new].m)\n\t\t\t\tk8s.k8sNPNEW[new].e = k8s.k8sNPNEW[old].e\n\t\t\t\tnew++\n\t\t\t\told++\n\t\t\t} else if l == NotEqual {\n\t\t\t\tif k8s.k8sNPOLD[old].fromStr < k8s.k8sNPNEW[new].fromStr {\n\t\t\t\t\t// new to be add\n\t\t\t\t\tID := k8s.addNPEdge(k8s.k8sNPNEW[new])\n\t\t\t\t\tk8s.k8sNPNEW[new].e = ID\n\t\t\t\t\tnew++\n\t\t\t\t} else {\n\t\t\t\t\t// old to be remove\n\t\t\t\t\tlogging.GetLogger().Debugf(\"Remove Link %s to %s %s (%s)\", k8s.k8sNPOLD[old].fromStr, k8s.k8sNPOLD[old].toStr, k8s.k8sNPOLD[old].direction, k8s.k8sNPOLD[old].npText)\n\t\t\t\t\tlogging.GetLogger().Debugf(\"Remove Edge %s\", k8s.k8sNPOLD[old].e)\n\t\t\t\t\tedge := k8s.Graph.GetEdge(k8s.k8sNPOLD[old].e)\n\t\t\t\t\tif edge == nil {\n\t\t\t\t\t\tlogging.GetLogger().Debugf(\"Failed to Get Edge ID %s\", k8s.k8sNPOLD[old].e)\n\t\t\t\t\t} else {\n\t\t\t\t\t\tk8s.Graph.DelEdge(edge)\n\t\t\t\t\t}\n\t\t\t\t\told++\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\tk8s.Graph.Unlock()\n}", "title": "" }, { "docid": "596de2b5d3a279669214da4c62c70857", "score": "0.48774397", "text": "func (r *MessageReceiver) updateTrace(mes *AntMes) {\n\tlogf.debugMes(mes, \"Updating trace with mes %v\\n\", mes)\n\ttarget := mes.Origin\n\tif len(mes.Path) < 2 {\n\t\t//logf.warn(\"Path too short to update trace\\n\")\n\t\treturn\n\t}\n\tlocalTarget, ok := r.gnode.targetMap[mes.Path[1]]\n\tif !ok {\n\t\tlogf.warn(\"Local target %s doesn't exist locally %s\\n\", mes.Path[1])\n\t\treturn\n\t}\n\tif trace, ok := r.gnode.traceMap[target]; ok {\n\t\tlogf.debugMes(mes, \"Confirm trace for target %s using local target %s : %d\\n\", target, localTarget.name, trace.persistence)\n\t\ttrace.persistence--\n\t\tif trace.persistence <= 0 {\n\t\t\tdelete(r.gnode.traceMap, target)\n\t\t}\n\t\treturn\n\t}\n\tlogf.debugMes(mes, \"create trace for target %s using local target %s\\n\", target, localTarget.name)\n\tr.gnode.traceMap[target] = &gnodeTrace{\n\t\tcreationTime: time.Now(),\n\t\tpersistence: config.tracePersistence,\n\t\ttarget: localTarget,\n\t}\n\n}", "title": "" }, { "docid": "39f9e7f3dc24ba4edea0057eb7eca033", "score": "0.48659658", "text": "func (*Player) NotifyUpdate(node *memberlist.Node) {\n\tlog.Println(\"Node updated\" + node.Name)\n\n}", "title": "" }, { "docid": "8b4e10177f3393c413fd0cac86dd972a", "score": "0.485493", "text": "func NicTrace(w http.ResponseWriter, r *http.Request) {\n\tw.Header().Set(\"Content-Type\", \"text/plain; charset=UTF-8\")\n\n\tvars := mux.Vars(r)\n\tnameOrID := vars[\"nameOrID\"]\n\tstateOnOff := vars[\"stateOnOff\"]\n\n\td := vbox.NewDriver(nameOrID, \"\")\n\toutPut, err := d.NicTrace(stateOnOff)\n\tif err != nil {\n\t\tw.WriteHeader(http.StatusInternalServerError)\n\t\tw.Write([]byte(err.Error()))\n\t}\n\n\tw.WriteHeader(http.StatusOK)\n\tw.Write([]byte(outPut))\n}", "title": "" }, { "docid": "4c41287444037449aefadfa98446804e", "score": "0.4831396", "text": "func GetNetInfo(ops HTTPOptions, cfg *config.Config, c client.Client) {\n\tbp, err := createBatchPoints(cfg.InfluxDB.Database)\n\tif err != nil {\n\t\treturn\n\t}\n\tvar pts []*client.Point\n\n\tresp, err := HitHTTPTarget(ops)\n\tif err != nil {\n\t\tlog.Printf(\"Error getting node_info: %v\", err)\n\t\treturn\n\t}\n\tvar ni NetInfo\n\terr = json.Unmarshal(resp.Body, &ni)\n\tif err != nil {\n\t\tlog.Printf(\"Error: %v\", err)\n\t\treturn\n\t}\n\n\tnumPeers, err := strconv.Atoi(ni.Result.NumPeers)\n\tif err != nil {\n\t\tlog.Printf(\"Error converting num_peers to int: %v\", err)\n\t\tnumPeers = 0\n\t} else if int64(numPeers) < cfg.NumPeersThreshold {\n\t\t_ = SendTelegramAlert(fmt.Sprintf(\"%s Number of peers connected to your validator has fallen below %d\", cfg.ValidatorName, cfg.NumPeersThreshold), cfg)\n\t\t_ = SendEmailAlert(fmt.Sprintf(\"%s Number of peers connected to your validator has fallen below %d\", cfg.ValidatorName, cfg.NumPeersThreshold), cfg)\n\t}\n\tp1, err := createDataPoint(\"vcf_num_peers\", map[string]string{}, map[string]interface{}{\"count\": numPeers})\n\tif err == nil {\n\t\tpts = append(pts, p1)\n\t}\n\n\tpeerAddrs := make([]string, len(ni.Result.Peers))\n\tfor i, peer := range ni.Result.Peers {\n\t\tpeerAddrs[i] = peer.RemoteIP + \" - \" + peer.NodeInfo.Moniker\n\t}\n\n\taddrs := strings.Join(peerAddrs[:], \", \")\n\tp2, err := createDataPoint(\"vcf_peer_addresses\", map[string]string{\"addresses_count\": strconv.Itoa(numPeers)}, map[string]interface{}{\"addresses\": addrs})\n\tif err == nil {\n\t\tpts = append(pts, p2)\n\t}\n\n\tbp.AddPoints(pts)\n\t_ = writeBatchPoints(c, bp)\n\tlog.Printf(\"No. of peers: %d \\n\", numPeers)\n}", "title": "" }, { "docid": "b60b4700f0378285447086a988cdd557", "score": "0.48250875", "text": "func (c *softnetCollector) Update(ch chan<- prometheus.Metric) error {\n\tstats, err := c.fs.NetSoftnetStat()\n\tif err != nil {\n\t\treturn fmt.Errorf(\"could not get softnet statistics: %w\", err)\n\t}\n\n\tfor cpuNumber, cpuStats := range stats {\n\t\tcpu := strconv.Itoa(cpuNumber)\n\n\t\tch <- prometheus.MustNewConstMetric(\n\t\t\tc.processed,\n\t\t\tprometheus.CounterValue,\n\t\t\tfloat64(cpuStats.Processed),\n\t\t\tcpu,\n\t\t)\n\t\tch <- prometheus.MustNewConstMetric(\n\t\t\tc.dropped,\n\t\t\tprometheus.CounterValue,\n\t\t\tfloat64(cpuStats.Dropped),\n\t\t\tcpu,\n\t\t)\n\t\tch <- prometheus.MustNewConstMetric(\n\t\t\tc.timeSqueezed,\n\t\t\tprometheus.CounterValue,\n\t\t\tfloat64(cpuStats.TimeSqueezed),\n\t\t\tcpu,\n\t\t)\n\t}\n\n\treturn nil\n}", "title": "" }, { "docid": "788245e4c118a79624e18e15e86a0f91", "score": "0.47852606", "text": "func (dh *DeviceHandler) DeviceProcStatusUpdate(dev_Event OnuDeviceEvent) {\n\tswitch dev_Event {\n\tcase MibDatabaseSync:\n\t\t{\n\t\t\tlogger.Infow(\"MibInSync event: update dev state to 'MibSync complete'\", log.Fields{\"deviceID\": dh.deviceID})\n\t\t\t//initiate DevStateUpdate\n\t\t\tif err := dh.coreProxy.DeviceReasonUpdate(context.TODO(), dh.deviceID, \"discovery-mibsync-complete\"); err != nil {\n\t\t\t\tlogger.Errorw(\"error-DeviceReasonUpdate to 'mibsync-complete'\", log.Fields{\n\t\t\t\t\t\"deviceID\": dh.deviceID, \"error\": err})\n\t\t\t}\n\t\t\tdh.deviceReason = \"discovery-mibsync-complete\"\n\n\t\t\tpDevEntry := dh.GetOnuDeviceEntry(false)\n\t\t\tunigMap, ok := pDevEntry.pOnuDB.meDb[me.UniGClassID]\n\t\t\tunigInstKeys := pDevEntry.pOnuDB.GetSortedInstKeys(unigMap)\n\t\t\ti := uint8(0) //UNI Port limit: see MaxUnisPerOnu (by now 16) (OMCI supports max 255 p.b.)\n\t\t\tif ok {\n\t\t\t\tfor _, mgmtEntityId := range unigInstKeys {\n\t\t\t\t\tlogger.Debugw(\"Add UNI port for stored UniG instance:\", log.Fields{\n\t\t\t\t\t\t\"deviceId\": dh.deviceID, \"UnigMe EntityID\": mgmtEntityId})\n\t\t\t\t\tdh.addUniPort(mgmtEntityId, i, UniPPTP)\n\t\t\t\t\ti++\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\tlogger.Debugw(\"No UniG instances found\", log.Fields{\"deviceId\": dh.deviceID})\n\t\t\t}\n\t\t\tveipMap, ok := pDevEntry.pOnuDB.meDb[me.VirtualEthernetInterfacePointClassID]\n\t\t\tveipInstKeys := pDevEntry.pOnuDB.GetSortedInstKeys(veipMap)\n\t\t\tif ok {\n\t\t\t\tfor _, mgmtEntityId := range veipInstKeys {\n\t\t\t\t\tlogger.Debugw(\"Add VEIP acc. to stored VEIP instance:\", log.Fields{\n\t\t\t\t\t\t\"deviceId\": dh.deviceID, \"VEIP EntityID\": mgmtEntityId})\n\t\t\t\t\tdh.addUniPort(mgmtEntityId, i, UniVEIP)\n\t\t\t\t\ti++\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\tlogger.Debugw(\"No VEIP instances found\", log.Fields{\"deviceId\": dh.deviceID})\n\t\t\t}\n\t\t\tif i == 0 {\n\t\t\t\tlogger.Warnw(\"No PPTP instances found\", log.Fields{\"deviceId\": dh.deviceID})\n\t\t\t}\n\n\t\t\t/* 200605: lock processing after initial MIBUpload removed now as the ONU should be in the lock state per default here\n\t\t\t * left the code here as comment in case such processing should prove needed unexpectedly\n\t\t\t\t\t// Init Uni Ports to Admin locked state\n\t\t\t\t\t// maybe not really needed here as UNI ports should be locked by default, but still left as available in python code\n\t\t\t\t\t// *** should generate UniLockStateDone event *****\n\t\t\t\t\tif dh.pLockStateFsm == nil {\n\t\t\t\t\t\tdh.createUniLockFsm(true, UniLockStateDone)\n\t\t\t\t\t} else { //LockStateFSM already init\n\t\t\t\t\t\tdh.pLockStateFsm.SetSuccessEvent(UniLockStateDone)\n\t\t\t\t\t\tdh.runUniLockFsm(true)\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\tcase UniLockStateDone:\n\t\t\t\t{\n\t\t\t\t\tlogger.Infow(\"UniLockStateDone event: Starting MIB download\", log.Fields{\"deviceID\": dh.deviceID})\n\t\t\t* lockState processing commented out\n\t\t\t*/\n\t\t\t/* Mib download procedure -\n\t\t\t***** should run over 'downloaded' state and generate MibDownloadDone event *****\n\t\t\t */\n\t\t\tpMibDlFsm := pDevEntry.pMibDownloadFsm.pFsm\n\t\t\tif pMibDlFsm != nil {\n\t\t\t\tif pMibDlFsm.Is(\"disabled\") {\n\t\t\t\t\tif err := pMibDlFsm.Event(\"start\"); err != nil {\n\t\t\t\t\t\tlogger.Errorw(\"MibDownloadFsm: Can't go to state starting\", log.Fields{\"err\": err})\n\t\t\t\t\t\t// maybe try a FSM reset and then again ... - TODO!!!\n\t\t\t\t\t} else {\n\t\t\t\t\t\tlogger.Debugw(\"MibDownloadFsm\", log.Fields{\"state\": string(pMibDlFsm.Current())})\n\t\t\t\t\t\t// maybe use more specific states here for the specific download steps ...\n\t\t\t\t\t\tif err := pMibDlFsm.Event(\"create_gal\"); err != nil {\n\t\t\t\t\t\t\tlogger.Errorw(\"MibDownloadFsm: Can't start CreateGal\", log.Fields{\"err\": err})\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\tlogger.Debugw(\"state of MibDownloadFsm\", log.Fields{\"state\": string(pMibDlFsm.Current())})\n\t\t\t\t\t\t\t//Begin MIB data download (running autonomously)\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t} else {\n\t\t\t\t\tlogger.Errorw(\"wrong state of MibDownloadFsm - want: disabled\", log.Fields{\"have\": string(pMibDlFsm.Current())})\n\t\t\t\t\t// maybe try a FSM reset and then again ... - TODO!!!\n\t\t\t\t}\n\t\t\t\t/***** Mib download started */\n\t\t\t} else {\n\t\t\t\tlogger.Errorw(\"MibDownloadFsm invalid - cannot be executed!!\", log.Fields{\"deviceID\": dh.deviceID})\n\t\t\t}\n\t\t}\n\tcase MibDownloadDone:\n\t\t{\n\t\t\tlogger.Infow(\"MibDownloadDone event: update dev state to 'Oper.Active'\", log.Fields{\"deviceID\": dh.deviceID})\n\t\t\t//initiate DevStateUpdate\n\t\t\tif err := dh.coreProxy.DeviceStateUpdate(context.TODO(), dh.deviceID,\n\t\t\t\tvoltha.ConnectStatus_REACHABLE, voltha.OperStatus_ACTIVE); err != nil {\n\t\t\t\tlogger.Errorw(\"error-updating-device-state\", log.Fields{\"deviceID\": dh.deviceID, \"error\": err})\n\t\t\t}\n\n\t\t\tlogger.Debug(\"MibDownloadDone Event: update dev reason to 'initial-mib-downloaded'\")\n\t\t\tif err := dh.coreProxy.DeviceReasonUpdate(context.TODO(), dh.deviceID, \"initial-mib-downloaded\"); err != nil {\n\t\t\t\tlogger.Errorw(\"error-DeviceReasonUpdate to 'initial-mib-downloaded'\",\n\t\t\t\t\tlog.Fields{\"deviceID\": dh.deviceID, \"error\": err})\n\t\t\t}\n\t\t\tdh.deviceReason = \"initial-mib-downloaded\"\n\n\t\t\t// *** should generate UniUnlockStateDone event *****\n\t\t\tif dh.pUnlockStateFsm == nil {\n\t\t\t\tdh.createUniLockFsm(false, UniUnlockStateDone)\n\t\t\t} else { //UnlockStateFSM already init\n\t\t\t\tdh.pUnlockStateFsm.SetSuccessEvent(UniUnlockStateDone)\n\t\t\t\tdh.runUniLockFsm(false)\n\t\t\t}\n\t\t}\n\tcase UniUnlockStateDone:\n\t\t{\n\t\t\tgo dh.enableUniPortStateUpdate() //cmp python yield self.enable_ports()\n\n\t\t\tlogger.Infow(\"UniUnlockStateDone event: Sending OnuUp event\", log.Fields{\"deviceID\": dh.deviceID})\n\t\t\traisedTs := time.Now().UnixNano()\n\t\t\tgo dh.sendOnuOperStateEvent(voltha.OperStatus_ACTIVE, dh.deviceID, raisedTs) //cmp python onu_active_event\n\t\t}\n\tdefault:\n\t\t{\n\t\t\tlogger.Warnw(\"unhandled-device-event\", log.Fields{\"deviceID\": dh.deviceID, \"event\": dev_Event})\n\t\t}\n\t} //switch\n}", "title": "" }, { "docid": "eebf5532bced1957d5390343848a9667", "score": "0.47570333", "text": "func updateDeviceLastReportedConnected(device string) {\n\t// Config set to skip update last reported\n\tif !configuration.Deviceupdatelastconnected {\n\t\tloggingClient.Debug(\"Skipping update of device connected/reported times for: \" + device)\n\t\treturn\n\t}\n\n\tt := time.Now().Unix()\n\n\t// Get the device by name\n\td, err := mdc.DeviceForName(device)\n\tif err != nil {\n\t\tloggingClient.Error(\"Error getting device \" + device + \": \" + err.Error())\n\t\treturn\n\t}\n\n\t// Couldn't find by name\n\tif &d == nil {\n\t\t// Get the device by ID\n\t\td, err = mdc.Device(device)\n\t\tif err != nil {\n\t\t\tloggingClient.Error(\"Error getting device \" + device + \": \" + err.Error())\n\t\t\treturn\n\t\t}\n\n\t\t// Couldn't find device\n\t\tif &d == nil {\n\t\t\tloggingClient.Error(\"Error updating device connected/reported times. Unknown device with identifier of: \" + device)\n\t\t\treturn\n\t\t}\n\n\t\t// Got device by ID, now update lastReported/Connected by ID\n\t\terr = mdc.UpdateLastConnected(d.Id.Hex(), t)\n\t\tif err != nil {\n\t\t\tloggingClient.Error(\"Problems updating last connected value for device: \" + d.Id.Hex())\n\t\t\treturn\n\t\t}\n\t\terr = mdc.UpdateLastReported(d.Id.Hex(), t)\n\t\tif err != nil {\n\t\t\tloggingClient.Error(\"Problems updating last reported value for device: \" + d.Id.Hex())\n\t\t}\n\t\treturn\n\t}\n\n\t// Found by name, now update lastReported\n\terr = mdc.UpdateLastConnectedByName(d.Name, t)\n\tif err != nil {\n\t\tloggingClient.Error(\"Problems updating last connected value for device: \" + d.Name)\n\t\treturn\n\t}\n\terr = mdc.UpdateLastReportedByName(d.Name, t)\n\tif err != nil {\n\t\tloggingClient.Error(\"Problems updating last reported value for device: \" + d.Name)\n\t}\n\treturn\n}", "title": "" }, { "docid": "5935665b232326ddd873e170a59de62d", "score": "0.4752517", "text": "func (m *MobileControlNacWifiNetworks) Update(client sophos.ClientInterface, options ...sophos.Option) (err error) {\n\treturn put(client, \"/api/nodes/mobile_control.nac.wifi_networks\", m.Value, options...)\n}", "title": "" }, { "docid": "a5d1cf63016c4f14c28d6b000bbc13a5", "score": "0.47254258", "text": "func (o *NdClientCtx) OnEvent(msg string, a, b interface{}) {\n\n\tswitch msg {\n\tcase core.MSG_UPDATE_DIPV6_ADDR:\n\t\toldIPv6 := a.(core.Ipv6Key)\n\t\tnewIPv6 := b.(core.Ipv6Key)\n\t\tif newIPv6 != oldIPv6 {\n\t\t\tif !oldIPv6.IsZero() {\n\t\t\t\to.removeMc(&oldIPv6)\n\t\t\t}\n\n\t\t\to.nsPlug.stats.eventsChangeDHCPSrc++\n\t\t\tif !newIPv6.IsZero() {\n\t\t\t\to.addMcCache(&newIPv6) // add it to MC\n\t\t\t\tvar l6 core.Ipv6Key\n\t\t\t\tl6 = newIPv6\n\t\t\t\t// send unsolicitate message\n\t\t\t\tpmac := &o.base.Client.Mac\n\t\t\t\to.SendUnsolicitedNaIpv6(&l6, nil, pmac)\n\t\t\t\to.SendNS(true, nil, &l6) // dad, not by RFC. assuming it is ok\n\t\t\t\to.AdvIPv6()\n\t\t\t}\n\t\t}\n\n\tcase core.MSG_UPDATE_IPV6_ADDR:\n\t\toldIPv6 := a.(core.Ipv6Key)\n\t\tnewIPv6 := b.(core.Ipv6Key)\n\t\tif !oldIPv6.IsZero() {\n\t\t\to.removeMc(&oldIPv6)\n\t\t}\n\t\tif newIPv6 != oldIPv6 {\n\t\t\to.nsPlug.stats.eventsChangeSrc++\n\t\t\tif !newIPv6.IsZero() {\n\t\t\t\to.addMcCache(&newIPv6)\n\t\t\t\to.SendUnsolicitedNA()\n\t\t\t\to.AdvIPv6()\n\t\t\t}\n\t\t}\n\n\tcase core.MSG_UPDATE_DGIPV6_ADDR:\n\t\toldIPv6 := a.(core.Ipv6Key)\n\t\tnewIPv6 := b.(core.Ipv6Key)\n\t\tif newIPv6 != oldIPv6 {\n\t\t\to.nsPlug.stats.eventsChangeDgIPv6++\n\t\t\to.OnChangeDGSrcIPv6(oldIPv6,\n\t\t\t\tnewIPv6)\n\t\t}\n\n\t}\n}", "title": "" }, { "docid": "fe4c126b2da06bb05642aa274743de52", "score": "0.47106868", "text": "func (a *APIHandler) patchDeviceHierarchy(device database.PbDevice, resp *logging.ResponseLogger, req *http.Request) {\n\tif device.ParentNode == nil { //can't do anything without a parent node specified\n\t\tresp.WriteLog(http.StatusBadRequest, \"Debug\", \"PATCH /device:: device does not have any parent node. Error in forming the request.\")\n\t\treturn\n\t}\n\trootnode, err := nodeComm.GetRootNode()\n\tif err != nil {\n\t\tresp.WriteLog(http.StatusBadRequest, \"Warning\", \"PATCH /device::Could not recover root node from database, cannot proceed\")\n\t\treturn\n\t}\n\toriginatingIP := strings.Split(req.RemoteAddr, \":\")[0] //where did the request come from\n\tdownstreamIP := \"Something not matching originatingIP\"\n\tdownstreamIPInfo := \"\"\n\tif rootnode.Id != *device.ParentNode { //if root node is not the parent of the device, some other node is, recover that nodes IP address\n\t\tdownstreamIPInfo, err = nodeComm.GetDownstreamNodeIP(*device.ParentNode)\n\t\tif err != nil {\n\t\t\tresp.WriteLog(http.StatusBadRequest, \"Warning\", \"PATCH /device::IP Address of the parent node for the device could not be recovered. Cannot proceed\")\n\t\t\treturn\n\t\t}\n\t\tdownstreamIP = strings.Split(downstreamIPInfo, \":\")[0]\n\t}\n\t//retrieve the device name from the database(in case name is changed, the Update upstream/downstream will fail)\n\tdbDev := database.PbDevice{Id: device.Id}\n\tif err = dbDev.Get(a.db); err != nil {\n\t\tresp.WriteLog(http.StatusBadRequest, \"Info\", \"PATCH /device:: Could not get existing device details from the database\")\n\t\treturn\n\t}\n\t// now the logic\n\tif rootnode.Id == *device.ParentNode || originatingIP == downstreamIP {\n\t\t//save to db\n\t\terr2 := device.Update(a.db)\n\t\t//update Repo\n\t\tif dbDev.Name != device.Name {\n\t\t\terr = a.renameDeviceConfigurationInRepo(dbDev.Name, device.Name)\n\t\t\tif err != nil {\n\t\t\t\ta.log.Warning(\"PATCH /device:: Was not able to rename the device configuration in the repository. Error:%s\", err.Error())\n\t\t\t}\n\t\t}\n\t\t//send it up\n\t\tupDevice := device //make a copy, UpdateDeviceUpstream could modify parentNode pointer, etc\n\t\tadd_to_q, err := nodeComm.UpdateDeviceUpstream(upDevice, dbDev.Name) //if error here put in queue\n\t\tif err != nil {\n\t\t\ta.log.Warning(\"PATCH /device::Was unable to update the device on the upstream node. OUT OF SYNC\")\n\t\t}\n\t\tif add_to_q {\n\t\t\tinternode.Qmutex.Lock()\n\t\t\tglobal.Queue.PushBack(internode.Qelement{\n\t\t\t\tFn_name: \"UpdateDeviceUpstream\",\n\t\t\t\tDevice: &device,\n\t\t\t\tParam: dbDev.Name,\n\t\t\t\tParam2: \"\",\n\t\t\t\tCfg: nil,\n\t\t\t})\n\t\t\tinternode.Qmutex.Unlock()\n\t\t}\n\t\tif err2 != nil { //db error at this level now what?\n\t\t\tresp.WriteLog(http.StatusBadRequest, \"Warning\", \"PATCH /device::Was unable to update the device in the database on this node. OUT OF SYNC\")\n\t\t\treturn\n\t\t}\n\t} else {\n\t\t//send it down\n\t\tdownDevice := device\n\t\tsuccess := nodeComm.UpdateDeviceDownstream(downDevice, dbDev.Name, downstreamIPInfo) //if error here tell user no can do\n\t\tif !success {\n\t\t\ta.log.Debug(\"Try again later !!!!!!\")\n\t\t\tresp.WriteLog(http.StatusBadRequest, \"Notice\", \"PATCH /device::Could not send the device change to the parent node of the device.\")\n\t\t\treturn\n\t\t}\n\t}\n\tresp.WriteHeader(http.StatusOK)\n}", "title": "" }, { "docid": "537624eee67f47665ab9a2945a4d8770", "score": "0.47106665", "text": "func parseAppNetwork(record []string, app *bspb.BatteryStats_App) (string, []error) {\n\tn := &bspb.BatteryStats_App_Network{}\n\twarn, errs := parseLine(networkData, record, n)\n\tif len(errs) > 0 {\n\t\treturn warn, errs\n\t}\n\t// MobileActiveTime is output in microseconds in the log, so we convert to milliseconds here.\n\tn.MobileActiveTimeMsec = proto.Float32(n.GetMobileActiveTimeMsec() / 1e3)\n\n\tpb := app.GetNetwork()\n\tif pb == nil {\n\t\tapp.Network = n\n\t\treturn warn, nil\n\t}\n\n\tif err := accumulate(pb, n); err != nil {\n\t\terrs = append(errs, err)\n\t}\n\treturn warn, errs\n}", "title": "" }, { "docid": "8edaca8ac5ef38846f0e49d0f601dcb7", "score": "0.4707014", "text": "func (a *AccdDevicesAllowedNetworks) Update(client sophos.ClientInterface, options ...sophos.Option) (err error) {\n\treturn put(client, \"/api/nodes/accd.devices.allowed_networks\", a.Value, options...)\n}", "title": "" }, { "docid": "920714bad6fc4c7cec8ca0044a927b66", "score": "0.46948305", "text": "func (client VirtualNetworkClient) updateVcn(ctx context.Context, request common.OCIRequest) (common.OCIResponse, error) {\n\thttpRequest, err := request.HTTPRequest(http.MethodPut, \"/vcns/{vcnId}\")\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\tvar response UpdateVcnResponse\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": "918a6915f613c884335b5f033f6c45ce", "score": "0.4693812", "text": "func (mr *MockContainerServerMockRecorder) UpdateNetwork(arg0, arg1, arg2 interface{}) *gomock.Call {\n\tmr.mock.ctrl.T.Helper()\n\treturn mr.mock.ctrl.RecordCallWithMethodType(mr.mock, \"UpdateNetwork\", reflect.TypeOf((*MockContainerServer)(nil).UpdateNetwork), arg0, arg1, arg2)\n}", "title": "" }, { "docid": "c356e703d5f0634acddb5532f68ca104", "score": "0.46923319", "text": "func (c *Collector) collectNetdevs(db *postgres.DB) (Netdevs, error) {\n\tstats, err := readNetdevs(db, c.config)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\tc.prevNetdevs = c.currNetdevs\n\tc.currNetdevs = stats\n\n\t// If number of network devices changed just replace previous snapshot with current one and continue.\n\tif len(c.prevNetdevs) != len(c.currNetdevs) {\n\t\tc.prevNetdevs = c.currNetdevs\n\t}\n\n\tusage := countNetdevsUsage(c.prevNetdevs, c.currNetdevs, c.config.ticks)\n\n\treturn usage, nil\n}", "title": "" }, { "docid": "430e0a4b89d0c05e826939ef109ff069", "score": "0.46790132", "text": "func (cont *AciController) snatCfgUpdate(oldObj, newObj interface{}) {\n\toldSnatcfg := oldObj.(*v1.ConfigMap)\n\tnewSnatcfg := newObj.(*v1.ConfigMap)\n\toldData := oldSnatcfg.Data\n\tnewData := newSnatcfg.Data\n\tif reflect.DeepEqual(oldData, newData) {\n\t\tcont.log.Info(\"ConfigMap is unchanged for: \", oldSnatcfg.Name)\n\t\treturn\n\t}\n\tcont.log.Infof(\"snatCfgUpdated from %+v to %+v: \", oldSnatcfg, newSnatcfg)\n\tstart, err1 := strconv.Atoi(newData[\"start\"])\n\tend, err2 := strconv.Atoi(newData[\"end\"])\n\tportsPerNode, err3 := strconv.Atoi(newData[\"ports-per-node\"])\n\tif err1 != nil || err2 != nil || err3 != nil ||\n\t\tstart < 5000 || end > 65000 || start > end || portsPerNode > end-start+1 {\n\t\tcont.log.Error(\"Invalid values provided for ConfigMap: \", newSnatcfg.Name)\n\t\treturn\n\t}\n\tvar portRange snatglobalinfo.PortRange\n\tportRange.Start = start\n\tportRange.End = end\n\tvar currPortRange []snatglobalinfo.PortRange\n\tcurrPortRange = append(currPortRange, portRange)\n\tcont.indexMutex.Lock()\n\tnodeInfoKeys := make(map[string]bool)\n\tfor name, info := range cont.snatPolicyCache {\n\t\tcont.clearSnatGlobalCache(name, \"\")\n\t\tinfo.ExpandedSnatPorts = util.ExpandPortRanges(currPortRange, portsPerNode)\n\t\tcont.getNodeInfoKeys(name, nodeInfoKeys)\n\t}\n\tcont.indexMutex.Unlock()\n\tfor key := range nodeInfoKeys {\n\t\tcont.queueNodeInfoUpdateByKey(key)\n\t}\n}", "title": "" }, { "docid": "868a2891a184b86967946b1c9ccd75ed", "score": "0.46601298", "text": "func(nsOp *sqliteNSOP)updateNSListLimitsOnAdd() error{\n log := logger.GetLoggerInstance()\n var parentObj *sqlData\n var err error\n err = nil\n if len(nsOp.dataObj.Puid) == 0 {\n //Something is wrong. Cannot find the parent for new node.\n log.Error(\"Invalid parent for record to update the NS list limits\")\n return appErrors.INVALID_INPUT\n }\n parentObj = new(sqlData)\n parentObj.Data = new(dataStore.Data)\n parentObj.Uid = nsOp.dataObj.Puid\n parentObj.Data, err = parentObj.GetdataById(nsOp.conn)\n if err != nil {\n log.Error(\"Failed to get the parent record err : %s\", err)\n return err\n }\n // Adding a new node with left and right id.\n // Update the record with limits.\n nsOp.dataObj.LftId = parentObj.RgtId\n nsOp.dataObj.RgtId = nsOp.dataObj.LftId + 1\n nsOp.pushNSLimitsForUpdate(nsOp.dataObj, nsOp.conn)\n err = nsOp.updateParentRecord(parentObj, 2)\n if err != nil {\n log.Error(\"Failed to update the parent records on adding new record\" +\n \" %s err : %s\", nsOp.dataObj.Uid, err)\n }\n //Update all other records in the table.\n err = nsOp.UpdateTreeOnAdd()\n return err\n}", "title": "" }, { "docid": "c65a6d6ec017f2b0547c913a82e434a4", "score": "0.46556643", "text": "func updateNetInstResource(ctx context.Context, d *schema.ResourceData, meta interface{}) diag.Diagnostics {\n\t// Warning or errors can be collected in a slice type\n\tvar diags diag.Diagnostics\n\n\tclient := (meta.(Client)).Client\n\tname := rdEntryStr(d, \"name\")\n\tid := rdEntryStr(d, \"id\")\n\terrMsgPrefix := getErrMsgPrefix(\"Network Instance\", name, id, \"Update\")\n\tif client == nil {\n\t\treturn diag.Errorf(\"%s nil Client\", errMsgPrefix)\n\t}\n\tcfg, err := getNetInstConfig(client, name, id)\n\tif err != nil {\n\t\treturn diag.Errorf(\"%s err: %s\", errMsgPrefix, err.Error())\n\t}\n\terr = rdUpdateNetInstConfig(d, cfg)\n\tif err != nil {\n\t\treturn diag.Errorf(\"%s %s\", errMsgPrefix, err.Error())\n\t}\n\tlog.Printf(\"[INFO] Updating NetInst: %s\", name)\n\tclient.XRequestIdPrefix = \"TF-nwinst-update\"\n\turlExtension := getNetInstUrl(name, id, \"update\")\n\trspData := &swagger_models.ZsrvResponse{}\n\t_, err = client.SendReq(\"PUT\", urlExtension, cfg, rspData)\n\tif err != nil {\n\t\treturn diag.Errorf(\"%s err: %s\", errMsgPrefix, err.Error())\n\t}\n\tlog.Printf(\"Network Instance Update Successful\")\n\treturn diags\n}", "title": "" }, { "docid": "5ee0541cf418864da5c7b01fcc3ba5e4", "score": "0.46547362", "text": "func (_Dospayment *DospaymentFilterer) WatchUpdateNetworkTokenAddress(opts *bind.WatchOpts, sink chan<- *DospaymentUpdateNetworkTokenAddress) (event.Subscription, error) {\n\n\tlogs, sub, err := _Dospayment.contract.WatchLogs(opts, \"UpdateNetworkTokenAddress\")\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\treturn event.NewSubscription(func(quit <-chan struct{}) error {\n\t\tdefer sub.Unsubscribe()\n\t\tfor {\n\t\t\tselect {\n\t\t\tcase log := <-logs:\n\t\t\t\t// New log arrived, parse the event and forward to the user\n\t\t\t\tevent := new(DospaymentUpdateNetworkTokenAddress)\n\t\t\t\tif err := _Dospayment.contract.UnpackLog(event, \"UpdateNetworkTokenAddress\", log); err != nil {\n\t\t\t\t\treturn err\n\t\t\t\t}\n\t\t\t\tevent.Raw = log\n\n\t\t\t\tselect {\n\t\t\t\tcase sink <- event:\n\t\t\t\tcase err := <-sub.Err():\n\t\t\t\t\treturn err\n\t\t\t\tcase <-quit:\n\t\t\t\t\treturn nil\n\t\t\t\t}\n\t\t\tcase err := <-sub.Err():\n\t\t\t\treturn err\n\t\t\tcase <-quit:\n\t\t\t\treturn nil\n\t\t\t}\n\t\t}\n\t}), nil\n}", "title": "" }, { "docid": "f95b1a094b56326ae2636d58d1b5eea8", "score": "0.46496072", "text": "func (elevNet *ElevNet_s) RefreshNetwork(){\n\televPingTimes:=make(map[string]time.Time)\n\tgo elevNet.intComs.pingTimer()\n\tgo elevNet.BroadCastPing()\n\t\n for{\n select{\n /*\n case newip := <-elevNet.intComs.newPinger:\n \tfmt.Println(\"got new ping ip\")\n addPinger(elevPingTimes, newip)\n fmt.Println(\"woho new elevator friend\")\n\t*/\n case msg := <-elevNet.ExtComs.PingMsg:\n\t\t\televNet.intComs.updatePingTime(elevPingTimes,msg) \n\t\t\t\t\t\t\n case <-elevNet.intComs.timerOut:\n\t\t\tgo elevNet.intComs.performTimeControl(elevPingTimes)\n\t\t\t\t\t\t\n case deadIp := <-elevNet.intComs.deadPinger:\n \tfmt.Println(\"ping case deadIP\")\n elevNet.intComs.deletePinger(elevPingTimes,deadIp)\n\t\tdefault:\n\t\t\ttime.Sleep(time.Millisecond*SLEEPTIME)\n \n }//end select\n }//end for\n}", "title": "" }, { "docid": "98c9b9b429e02711bc51f3352ef29c50", "score": "0.46461907", "text": "func (service *ContrailService) RESTUpdateNetworkDeviceConfig(c echo.Context) error {\n\t//id := c.Param(\"id\")\n\trequest := &models.UpdateNetworkDeviceConfigRequest{}\n\tif err := c.Bind(request); err != nil {\n\t\tlog.WithFields(log.Fields{\n\t\t\t\"err\": err,\n\t\t\t\"resource\": \"network_device_config\",\n\t\t}).Debug(\"bind failed on update\")\n\t\treturn echo.NewHTTPError(http.StatusBadRequest, \"Invalid JSON format\")\n\t}\n\tctx := c.Request().Context()\n\tresponse, err := service.UpdateNetworkDeviceConfig(ctx, request)\n\tif err != nil {\n\t\treturn common.ToHTTPError(err)\n\t}\n\treturn c.JSON(http.StatusOK, response)\n}", "title": "" }, { "docid": "afefe559f6e90d17d1aa4be0ab6607de", "score": "0.46459544", "text": "func (s state) updateNodes(newNodes nodes) {\n\tfor _, nn := range newNodes {\n\t\ton, exists := s.Nodes[nn.NodeId]\n\t\tif !exists {\n\t\t\tif debugging {\n\t\t\t\tfmt.Printf(\"Learned about new node %v\\n\", nn.NodeId)\n\t\t\t}\n\t\t\ts.Nodes[nn.NodeId] = nn\n\t\t} else {\n\t\t\tif debugging {\n\t\t\t\tfmt.Printf(\"Updating any stale info we had on node %v\\n\", nn.NodeId)\n\t\t\t\tfmt.Printf(\"Updating any stale info we had on old node %v to new %v\\n\", on, nn)\n\t\t\t}\n\t\t\tif on.Alias != \"\" && nn.Alias == \"\" {\n\t\t\t\t// Preserve alias if we knew it.\n\t\t\t\tnn.Alias = on.Alias\n\t\t\t}\n\t\t\tif on.Color != \"\" && nn.Color == \"\" {\n\t\t\t\t// Preserve color if we knew it.\n\t\t\t\tnn.Color = on.Color\n\t\t\t}\n\t\t\tif on.isPeer {\n\t\t\t\t// Note: We avoid marking peers as non-peers when listnodes returns with isPeer=false. This could be less hacky.\n\t\t\t\tnn.isPeer = true\n\t\t\t\tnn.Connected = on.Connected\n\t\t\t\tif len(nn.Channels) == 0 && len(on.Channels) > 0 {\n\t\t\t\t\tnn.Channels = on.Channels\n\t\t\t\t}\n\t\t\t}\n\t\t\t// TODO: may or may not want to update on.Addresses.\n\t\t\tif on.LastTimestamp.Time().After(nn.LastTimestamp.Time()) {\n\t\t\t\tnn.LastTimestamp = on.LastTimestamp\n\t\t\t}\n\t\t\ts.Nodes[nn.NodeId] = nn\n\t\t}\n\t}\n}", "title": "" }, { "docid": "4a49e5df6b27ebbd36c1aa2bc5ab5717", "score": "0.4619644", "text": "func (m *nfdMaster) nfdAPIUpdateHandler() {\n\t// We want to unconditionally update all nodes at startup if gRPC is\n\t// disabled (i.e. NodeFeature API is enabled)\n\tupdateAll := m.args.EnableNodeFeatureApi\n\tupdateNodes := make(map[string]struct{})\n\trateLimit := time.After(time.Second)\n\tfor {\n\t\tselect {\n\t\tcase <-m.nfdController.updateAllNodesChan:\n\t\t\tupdateAll = true\n\t\tcase nodeName := <-m.nfdController.updateOneNodeChan:\n\t\t\tupdateNodes[nodeName] = struct{}{}\n\t\tcase <-rateLimit:\n\t\t\terrUpdateAll := false\n\t\t\tif updateAll {\n\t\t\t\tif err := m.nfdAPIUpdateAllNodes(); err != nil {\n\t\t\t\t\tklog.ErrorS(err, \"failed to update nodes\")\n\t\t\t\t\terrUpdateAll = true\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\tfor nodeName := range updateNodes {\n\t\t\t\t\tm.nodeUpdaterPool.queue.Add(nodeName)\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t// Reset \"work queue\" and timer\n\t\t\tupdateAll = errUpdateAll\n\t\t\tupdateNodes = map[string]struct{}{}\n\t\t\trateLimit = time.After(time.Second)\n\t\t}\n\t}\n}", "title": "" }, { "docid": "bab3fccdc3319a1f0bab7d482b196623", "score": "0.46192318", "text": "func EC2NatGatewayUpdate(req Request) (string, map[string]string, error) {\n\treturn EC2NatGatewayCreate(req)\n}", "title": "" }, { "docid": "e077ae847cbaade320c78197fc08d140", "score": "0.46187842", "text": "func JoinNetNS(name string, nspath string) error {\n link, err := netlink.LinkByName(name)\n if err != nil {\n fmt.Fprintf(os.Stderr, \"[UNION CNI] failed to lookup %q: %v\\r\\n\", name, err)\n return err\n }\n \n // move link to specified namespace\n if nspath != \"\" {\n netns, err := ns.GetNS(nspath)\n if err != nil {\n fmt.Fprintf(os.Stderr, \"[UNION CNI] failed to open netns %q: %v\\r\\n\", nspath, err)\n return err\n }\n defer netns.Close()\n if err := netlink.LinkSetNsFd(link, int(netns.Fd())); err != nil {\n fmt.Fprintf(os.Stderr, \"[UNION CNI] failed to move link %q to netns: %v\\r\\n\", name, err) \n return err\n } \n // set up its namespace\n err = netns.Do(func (_ ns.NetNS) error {\n link, err := netlink.LinkByName(name)\n if err != nil {\n fmt.Fprintf(os.Stderr, \"[UNION CNI] failed to lookup %q in %q: %v\\r\\n\", name, netns.Path(), err) \n return err\n }\n \n if err = netlink.LinkSetUp(link); err != nil {\n fmt.Fprintf(os.Stderr, \"[UNION CNI] failed to set %q up: %v\\r\\n\", name, err)\n return err\n }\n return nil\n })\n } else {\n if err = netlink.LinkSetUp(link); err != nil {\n fmt.Fprintf(os.Stderr, \"[UNION CNI] failed to set %q up: %v\\r\\n\", name, err)\n return err\n }\n }\n \n if err != nil {\n fmt.Fprintf(os.Stderr, \"[UNION CNI] join link %q to namespace %q failed: %v\\r\\n\", name, nspath, err)\n }\n return err\n}", "title": "" }, { "docid": "f1295de659857074af91d2f60fe6022f", "score": "0.46109203", "text": "func (a *Agent) NotifyUpdate(n *memberlist.Node) {\n\ta.send(&NodeEvent{\n\t\tType: NodeUpdate,\n\t\tNode: n,\n\t})\n}", "title": "" }, { "docid": "d31dfeeba83043317a38360f714e5148", "score": "0.46105096", "text": "func (d *nicOVN) Update(oldDevices deviceConfig.Devices, isRunning bool) error {\n\toldConfig := oldDevices[d.name]\n\n\t// Populate device config with volatile fields if needed.\n\tnetworkVethFillFromVolatile(d.config, d.volatileGet())\n\n\t// If an IPv6 address has changed, if the instance is running we should bounce the host-side\n\t// veth interface to give the instance a chance to detect the change and re-apply for an\n\t// updated lease with new IP address.\n\tif d.config[\"ipv6.address\"] != oldConfig[\"ipv6.address\"] && d.config[\"host_name\"] != \"\" && network.InterfaceExists(d.config[\"host_name\"]) {\n\t\tlink := &ip.Link{Name: d.config[\"host_name\"]}\n\t\terr := link.SetDown()\n\t\tif err != nil {\n\t\t\treturn err\n\t\t}\n\n\t\terr = link.SetUp()\n\t\tif err != nil {\n\t\t\treturn err\n\t\t}\n\t}\n\n\t// Apply any changes needed when assigned ACLs change.\n\tif d.config[\"security.acls\"] != oldConfig[\"security.acls\"] {\n\t\t// Work out which ACLs have been removed and remove logical port from those groups.\n\t\toldACLs := shared.SplitNTrimSpace(oldConfig[\"security.acls\"], \",\", -1, true)\n\t\tnewACLs := shared.SplitNTrimSpace(d.config[\"security.acls\"], \",\", -1, true)\n\t\tremovedACLs := []string{}\n\t\tfor _, oldACL := range oldACLs {\n\t\t\tif !shared.StringInSlice(oldACL, newACLs) {\n\t\t\t\tremovedACLs = append(removedACLs, oldACL)\n\t\t\t}\n\t\t}\n\n\t\t// Setup the logical port with new ACLs if running.\n\t\tif isRunning {\n\t\t\t// Load uplink network config.\n\t\t\tuplinkNetworkName := d.network.Config()[\"network\"]\n\t\t\t_, uplink, _, err := d.state.DB.Cluster.GetNetworkInAnyState(project.Default, uplinkNetworkName)\n\t\t\tif err != nil {\n\t\t\t\treturn fmt.Errorf(\"Failed to load uplink network %q: %w\", uplinkNetworkName, err)\n\t\t\t}\n\n\t\t\t// Update OVN logical switch port for instance.\n\t\t\t_, _, err = d.network.InstanceDevicePortStart(&network.OVNInstanceNICSetupOpts{\n\t\t\t\tInstanceUUID: d.inst.LocalConfig()[\"volatile.uuid\"],\n\t\t\t\tDNSName: d.inst.Name(),\n\t\t\t\tDeviceName: d.name,\n\t\t\t\tDeviceConfig: d.config,\n\t\t\t\tUplinkConfig: uplink.Config,\n\t\t\t}, removedACLs)\n\t\t\tif err != nil {\n\t\t\t\treturn fmt.Errorf(\"Failed updating OVN port: %w\", err)\n\t\t\t}\n\t\t}\n\n\t\tif len(removedACLs) > 0 {\n\t\t\tclient, err := openvswitch.NewOVN(d.state)\n\t\t\tif err != nil {\n\t\t\t\treturn fmt.Errorf(\"Failed to get OVN client: %w\", err)\n\t\t\t}\n\n\t\t\terr = acl.OVNPortGroupDeleteIfUnused(d.state, d.logger, client, d.network.Project(), d.inst, d.name, newACLs...)\n\t\t\tif err != nil {\n\t\t\t\treturn fmt.Errorf(\"Failed removing unused OVN port groups: %w\", err)\n\t\t\t}\n\t\t}\n\t}\n\n\t// If an external address changed, update the BGP advertisements.\n\terr := bgpRemovePrefix(&d.deviceCommon, oldConfig)\n\tif err != nil {\n\t\treturn err\n\t}\n\n\terr = bgpAddPrefix(&d.deviceCommon, d.network, d.config)\n\tif err != nil {\n\t\treturn err\n\t}\n\n\treturn nil\n}", "title": "" }, { "docid": "75623d5816e0ac9010b0d767faaef0b9", "score": "0.46032658", "text": "func (c *NetworkChangeNotifier) OnNetworkChanged(f func(dataCFPropertyListRef uint64)) {\n\tuserCallbackLock.Lock()\n\tdefer userCallbackLock.Unlock()\n\tuserCallback = f\n\tncnRegisterCallback()\n}", "title": "" }, { "docid": "d521b112ff5371bef49a7032d9d91da9", "score": "0.45836148", "text": "func (s *Storage) NpcUpdate(ctx context.Context, req *pb.NpcUpdateRequest) (resp *pb.NpcUpdateResponse, err error) {\n\terr = fmt.Errorf(\"not yet supported\")\n\treturn\n}", "title": "" }, { "docid": "73b1dfd49cf4b8633b3b8000f73c8ad6", "score": "0.45819703", "text": "func (node node) updateNodeInfo() {\n\tticker := time.NewTicker(time.Second * PERIODUPDATETIME)\n\tquit := make(chan struct{})\n\tfor {\n\t\ttimer := time.NewTimer(time.Second * HEARTBEAT)\n\t\tselect {\n\t\tcase <-ticker.C:\n\t\t\t//GetHeaders process haven't finished yet. So comment it now.\n\t\t\tnode.SendPingToNbr()\n\t\t\tnode.GetBlkHdrs()\n\t\t\tnode.SyncBlk()\n\t\tcase <-quit:\n\t\t\tticker.Stop()\n\t\t\treturn\n\t\tcase <-timer.C:\n\t\t\tnode.HeartBeatMonitor()\n\t\t}\n\t}\n\t// TODO when to close the timer\n\t//close(quit)\n}", "title": "" }, { "docid": "b5585b3bd87aa4d150fedef3810b5a27", "score": "0.45787996", "text": "func NetnsLinkUp(netnsName string, linkName string) (netnsLinkUpCmd string) {\n\n\tnetnsLinkUpCmd = fmt.Sprintf(\"ip netns exec %s ip link set %s up\", netnsName, linkName)\n\n\treturn netnsLinkUpCmd\n}", "title": "" }, { "docid": "a1f640ccf77ced9ce03b1ae96068f27b", "score": "0.45599967", "text": "func updateDeviceServiceLastReportedConnected(device string) {\n\tif !configuration.Serviceupdatelastconnected {\n\t\tloggingClient.Debug(\"Skipping update of device service connected/reported times for: \" + device)\n\t\treturn\n\t}\n\n\tt := time.Now().Unix()\n\n\t// Get the device\n\td, err := mdc.DeviceForName(device)\n\tif err != nil {\n\t\tloggingClient.Error(\"Error getting device \" + device + \": \" + err.Error())\n\t\treturn\n\t}\n\n\t// Couldn't find by name\n\tif &d == nil {\n\t\td, err = mdc.Device(device)\n\t\tif err != nil {\n\t\t\tloggingClient.Error(\"Error getting device \" + device + \": \" + err.Error())\n\t\t\treturn\n\t\t}\n\t\t// Couldn't find device\n\t\tif &d == nil {\n\t\t\tloggingClient.Error(\"Error updating device connected/reported times. Unknown device with identifier of: \" + device)\n\t\t\treturn\n\t\t}\n\t}\n\n\t// Get the device service\n\ts := d.Service\n\tif &s == nil {\n\t\tloggingClient.Error(\"Error updating device service connected/reported times. Unknown device service in device: \" + d.Id.Hex())\n\t\treturn\n\t}\n\n\tmsc.UpdateLastConnected(s.Service.Id.Hex(), t)\n\tmsc.UpdateLastReported(s.Service.Id.Hex(), t)\n}", "title": "" }, { "docid": "8480e47cbb8d4baeb0887497e03642bf", "score": "0.45564893", "text": "func (Controller) Net(*core.Goploy) *core.Response {\n\tvar netList [][]string\n\tvar stdout bytes.Buffer\n\tvar stderr bytes.Buffer\n\tcmd := exec.Command(\"cat\", \"/proc/net/dev\")\n\tcmd.Stdout = &stdout\n\tcmd.Stderr = &stderr\n\tif err := cmd.Run(); err != nil {\n\t} else {\n\t\tfor _, line := range strings.Split(utils.ClearNewline(stdout.String()), \"\\n\")[2:] {\n\t\t\tfields := strings.Fields(line)\n\t\t\tif !strings.HasPrefix(fields[0], \"eth\") && !strings.HasPrefix(fields[0], \"lo\") {\n\t\t\t\tcontinue\n\t\t\t}\n\t\t\tnetList = append(netList, fields)\n\t\t}\n\n\t}\n\treturn &core.Response{\n\t\tData: netList,\n\t}\n}", "title": "" }, { "docid": "487f1680b04154477778431188c0134b", "score": "0.45558947", "text": "func UpdateNetwork(networkId string, record *mdprotos.MagmadNetworkRecord) error {\n\tmd, err := getMagmadClient()\n\tif err != nil {\n\t\treturn err\n\t}\n\t_, err = md.UpdateNetwork(context.Background(), &mdprotos.NetworkRecordRequest{Id: networkId, Record: record})\n\treturn err\n}", "title": "" }, { "docid": "e786e5d2119b0571287b750ef24be1ba", "score": "0.4544415", "text": "func (delegate *memberlistDelegate) NotifyUpdate(node *memberlist.Node) {\n\t// nothing to do\n}", "title": "" }, { "docid": "89a017fb88d3ee804881be361c83b552", "score": "0.45436716", "text": "func (n *NtpAllowedNetworks) Update(client sophos.ClientInterface, options ...sophos.Option) (err error) {\n\treturn put(client, \"/api/nodes/ntp.allowed_networks\", n.Value, options...)\n}", "title": "" }, { "docid": "ffad3f215161929130fc099867fb6c84", "score": "0.45427674", "text": "func DBNetworkUpdate(def shared.NetworkDef) error {\n\tsqls := `\n\t\tUPDATE network SET\n\t\t\tcidr = ?, gw = ?,\n\t\t\tdhcp_enabled = ?, dhcp_start = ?,\n\t\t\tdhcp_num = ?, dhcp_router = ?\n\t\tWHERE name = ?\n\t`\n\n\t_, err := DB.Exec(sqls,\n\t\tdef.CIDR,\n\t\tdef.GatewayIface,\n\t\tdef.DHCP.Enabled,\n\t\tdef.DHCP.StartIP,\n\t\tdef.DHCP.NumIP,\n\t\tdef.DHCP.Router,\n\t\tdef.Name,\n\t)\n\n\tif err != nil {\n\t\treturn err\n\t}\n\n\treturn nil\n}", "title": "" }, { "docid": "5a72456e09aa240b268b8b2dd72c125a", "score": "0.45276695", "text": "func (client AppsClient) UpdateVnetConnection(resourceGroupName string, name string, vnetName string, connectionEnvelope VnetInfo) (result VnetInfo, err error) {\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.NewErrorWithValidationError(err, \"web.AppsClient\", \"UpdateVnetConnection\")\n\t}\n\n\treq, err := client.UpdateVnetConnectionPreparer(resourceGroupName, name, vnetName, connectionEnvelope)\n\tif err != nil {\n\t\terr = autorest.NewErrorWithError(err, \"web.AppsClient\", \"UpdateVnetConnection\", nil, \"Failure preparing request\")\n\t\treturn\n\t}\n\n\tresp, err := client.UpdateVnetConnectionSender(req)\n\tif err != nil {\n\t\tresult.Response = autorest.Response{Response: resp}\n\t\terr = autorest.NewErrorWithError(err, \"web.AppsClient\", \"UpdateVnetConnection\", resp, \"Failure sending request\")\n\t\treturn\n\t}\n\n\tresult, err = client.UpdateVnetConnectionResponder(resp)\n\tif err != nil {\n\t\terr = autorest.NewErrorWithError(err, \"web.AppsClient\", \"UpdateVnetConnection\", resp, \"Failure responding to request\")\n\t}\n\n\treturn\n}", "title": "" }, { "docid": "a2482b2747367071053dea5b96d60a22", "score": "0.45266035", "text": "func (corePoint *CorePoint) updatePacketLogs(cov *COV) {\n\n\tcorePoint.PacketLogs.PushBack(cov.Clone()) // Enqueue\n\n\tif corePoint.PacketLogs.Len() > CorePacketLogQueueSize {\n\t\te := corePoint.PacketLogs.Front()\n\n\t\tif e != nil {\n\t\t\tcorePoint.PacketLogs.Remove(e)\n\t\t}\n\n\t}\n}", "title": "" }, { "docid": "e7a7de6da016173a7c4a2d5c0dea1c3a", "score": "0.45166108", "text": "func doNetNS(netNSPath string, cb func(ns.NetNS) error) error {\n\tn, err := ns.GetNS(netNSPath)\n\tif err != nil {\n\t\treturn err\n\t}\n\n\treturn n.Do(cb)\n}", "title": "" }, { "docid": "846177a208fcd0d3eef67ea3e81763bd", "score": "0.45100874", "text": "func runNet(rcvd chan RcvdData, xmt chan XmtData) {\n\n\tServerAddr, err := net.ResolveUDPAddr(\"udp\", \":10001\")\n\tif err != nil {\n\t\t//fmt.Println(\"error:\", err)\n\t}\n\n\t/* Now listen at selected port */\n\tConn, err := net.ListenUDP(\"udp\", ServerAddr)\n\tif err != nil {\n\t\t//fmt.Println(\"error:\", err)\n\t}\n\tdefer Conn.Close()\n\n\tgo func() { // network receive\n\t\tbuf := make([]byte, 10)\n\n\t\tfor {\n\t\t\t//n, addr, err := Conn.ReadFromUDP(buf)\n\t\t\t_, connAddr, err := Conn.ReadFromUDP(buf)\n\t\t\tif err != nil {\n\t\t\t\t//fmt.Println(\"Error: \", err)\n\t\t\t\tbreak\n\t\t\t}\n\t\t\taddr := connAddr.String()\n\t\t\tfmt.Println(\"player at\", addr, \"sent\", string(buf))\n\t\t\trcvd <- RcvdData{addr: addr, msg: string(buf)}\n\t\t}\n\t}()\n\n\t// Send arena updates to clients\n\tfor {\n\t\td := <-xmt\n\t\t//fmt.Println(\"upd:\", len(d.buf), \"to\", d.addr)\n\t\taddr, err := net.ResolveUDPAddr(\"udp\", d.addr)\n\t\tif err != nil {\n\t\t\tfmt.Println(\"Error: \", err)\n\t\t\tbreak\n\t\t}\n\t\tn, err := Conn.WriteToUDP(d.buf, addr)\n\t\tif err != nil {\n\t\t\tfmt.Println(\"Error: \", err)\n\t\t\tbreak\n\t\t}\n\t\tif n != len(d.buf) {\n\t\t\tfmt.Println(\"Did not send whole arena packet\")\n\t\t}\n\t}\n}", "title": "" }, { "docid": "2d9570bd1437491f2e6f92603eafde4e", "score": "0.4509781", "text": "func (client VirtualNetworkClient) updateInternalVnic(ctx context.Context, request common.OCIRequest) (common.OCIResponse, error) {\n\thttpRequest, err := request.HTTPRequest(http.MethodPut, \"/internalVnics/{internalVnicId}\")\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\tvar response UpdateInternalVnicResponse\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": "feae9aebf59097731a9c0b8a012e5933", "score": "0.45039314", "text": "func TestSetNDPConfigurations(t *testing.T) {\n\tconst nicID1 = 1\n\tconst nicID2 = 2\n\tconst nicID3 = 3\n\n\ttests := []struct {\n\t\tname string\n\t\tdupAddrDetectTransmits uint8\n\t\tretransmitTimer time.Duration\n\t\texpectedRetransmitTimer time.Duration\n\t}{\n\t\t{\n\t\t\t\"OK\",\n\t\t\t1,\n\t\t\ttime.Second,\n\t\t\ttime.Second,\n\t\t},\n\t\t{\n\t\t\t\"Invalid Retransmit Timer\",\n\t\t\t1,\n\t\t\t0,\n\t\t\ttime.Second,\n\t\t},\n\t}\n\n\tfor _, test := range tests {\n\t\tt.Run(test.name, func(t *testing.T) {\n\t\t\tndpDisp := ndpDispatcher{\n\t\t\t\tdadC: make(chan ndpDADEvent, 1),\n\t\t\t}\n\t\t\te := channel.New(0, 1280, linkAddr1)\n\t\t\tclock := faketime.NewManualClock()\n\t\t\ts := stack.New(stack.Options{\n\t\t\t\tNetworkProtocols: []stack.NetworkProtocolFactory{ipv6.NewProtocolWithOptions(ipv6.Options{\n\t\t\t\t\tNDPDisp: &ndpDisp,\n\t\t\t\t})},\n\t\t\t\tClock: clock,\n\t\t\t})\n\n\t\t\texpectDADSucceeded := func(nicID tcpip.NICID, addr tcpip.Address) {\n\t\t\t\tselect {\n\t\t\t\tcase e := <-ndpDisp.dadC:\n\t\t\t\t\tif diff := checkDADEvent(e, nicID, addr, &stack.DADSucceeded{}); diff != \"\" {\n\t\t\t\t\t\tt.Errorf(\"DAD event mismatch (-want +got):\\n%s\", diff)\n\t\t\t\t\t}\n\t\t\t\tdefault:\n\t\t\t\t\tt.Fatalf(\"expected DAD event for %s\", addr)\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t// This NIC(1)'s NDP configurations will be updated to\n\t\t\t// be different from the default.\n\t\t\tif err := s.CreateNIC(nicID1, e); err != nil {\n\t\t\t\tt.Fatalf(\"CreateNIC(%d, _) = %s\", nicID1, err)\n\t\t\t}\n\n\t\t\t// Created before updating NIC(1)'s NDP configurations\n\t\t\t// but updating NIC(1)'s NDP configurations should not\n\t\t\t// affect other existing NICs.\n\t\t\tif err := s.CreateNIC(nicID2, e); err != nil {\n\t\t\t\tt.Fatalf(\"CreateNIC(%d, _) = %s\", nicID2, err)\n\t\t\t}\n\n\t\t\t// Update the configurations on NIC(1) to use DAD.\n\t\t\tif ipv6Ep, err := s.GetNetworkEndpoint(nicID1, header.IPv6ProtocolNumber); err != nil {\n\t\t\t\tt.Fatalf(\"s.GetNetworkEndpoint(%d, %d): %s\", nicID1, header.IPv6ProtocolNumber, err)\n\t\t\t} else {\n\t\t\t\tdad := ipv6Ep.(stack.DuplicateAddressDetector)\n\t\t\t\tdad.SetDADConfigurations(stack.DADConfigurations{\n\t\t\t\t\tDupAddrDetectTransmits: test.dupAddrDetectTransmits,\n\t\t\t\t\tRetransmitTimer: test.retransmitTimer,\n\t\t\t\t})\n\t\t\t}\n\n\t\t\t// Created after updating NIC(1)'s NDP configurations\n\t\t\t// but the stack's default NDP configurations should not\n\t\t\t// have been updated.\n\t\t\tif err := s.CreateNIC(nicID3, e); err != nil {\n\t\t\t\tt.Fatalf(\"CreateNIC(%d, _) = %s\", nicID3, err)\n\t\t\t}\n\n\t\t\t// Add addresses for each NIC.\n\t\t\taddrWithPrefix1 := tcpip.AddressWithPrefix{Address: addr1, PrefixLen: defaultPrefixLen}\n\t\t\tprotocolAddr1 := tcpip.ProtocolAddress{\n\t\t\t\tProtocol: header.IPv6ProtocolNumber,\n\t\t\t\tAddressWithPrefix: addrWithPrefix1,\n\t\t\t}\n\t\t\taddr1Disp := addressDispatcher{\n\t\t\t\tnicid: nicID1,\n\t\t\t\taddr: addrWithPrefix1,\n\t\t\t\tchangedCh: make(chan addressChangedEvent, 1),\n\t\t\t\tremovedCh: make(chan stack.AddressRemovalReason, 1),\n\t\t\t}\n\t\t\tproperties1 := stack.AddressProperties{\n\t\t\t\tDisp: &addr1Disp,\n\t\t\t}\n\t\t\tif err := s.AddProtocolAddress(nicID1, protocolAddr1, properties1); err != nil {\n\t\t\t\tt.Fatalf(\"AddProtocolAddress(%d, %+v, %#v) = %s\", nicID1, protocolAddr1, properties1, err)\n\t\t\t}\n\t\t\tif err := addr1Disp.expectChanged(stack.AddressLifetimes{}, stack.AddressTentative); err != nil {\n\t\t\t\tt.Error(err)\n\t\t\t}\n\t\t\taddrWithPrefix2 := tcpip.AddressWithPrefix{Address: addr2, PrefixLen: defaultPrefixLen}\n\t\t\tprotocolAddr2 := tcpip.ProtocolAddress{\n\t\t\t\tProtocol: header.IPv6ProtocolNumber,\n\t\t\t\tAddressWithPrefix: addrWithPrefix2,\n\t\t\t}\n\t\t\taddr2Disp := addressDispatcher{\n\t\t\t\tnicid: nicID2,\n\t\t\t\taddr: addrWithPrefix2,\n\t\t\t\tchangedCh: make(chan addressChangedEvent, 1),\n\t\t\t\tremovedCh: make(chan stack.AddressRemovalReason, 1),\n\t\t\t}\n\t\t\tproperties2 := stack.AddressProperties{\n\t\t\t\tDisp: &addr2Disp,\n\t\t\t}\n\t\t\tif err := s.AddProtocolAddress(nicID2, protocolAddr2, properties2); err != nil {\n\t\t\t\tt.Fatalf(\"AddProtocolAddress(%d, %+v, %#v) = %s\", nicID2, protocolAddr2, properties2, err)\n\t\t\t}\n\t\t\texpectDADSucceeded(nicID2, addr2)\n\t\t\tif err := addr2Disp.expectChanged(stack.AddressLifetimes{}, stack.AddressAssigned); err != nil {\n\t\t\t\tt.Error(err)\n\t\t\t}\n\t\t\taddrWithPrefix3 := tcpip.AddressWithPrefix{Address: addr3, PrefixLen: defaultPrefixLen}\n\t\t\tprotocolAddr3 := tcpip.ProtocolAddress{\n\t\t\t\tProtocol: header.IPv6ProtocolNumber,\n\t\t\t\tAddressWithPrefix: addrWithPrefix3,\n\t\t\t}\n\t\t\taddr3Disp := addressDispatcher{\n\t\t\t\tnicid: nicID3,\n\t\t\t\taddr: addrWithPrefix3,\n\t\t\t\tchangedCh: make(chan addressChangedEvent, 1),\n\t\t\t\tremovedCh: make(chan stack.AddressRemovalReason, 1),\n\t\t\t}\n\t\t\tproperties3 := stack.AddressProperties{\n\t\t\t\tDisp: &addr3Disp,\n\t\t\t}\n\t\t\tif err := s.AddProtocolAddress(nicID3, protocolAddr3, properties3); err != nil {\n\t\t\t\tt.Fatalf(\"AddProtocolAddress(%d, %+v, %#v) = %s\", nicID3, protocolAddr3, properties3, err)\n\t\t\t}\n\t\t\texpectDADSucceeded(nicID3, addr3)\n\t\t\tif err := addr3Disp.expectChanged(stack.AddressLifetimes{}, stack.AddressAssigned); err != nil {\n\t\t\t\tt.Error(err)\n\t\t\t}\n\n\t\t\t// Address should not be considered bound to NIC(1) yet\n\t\t\t// (DAD ongoing).\n\t\t\tif err := checkGetMainNICAddress(s, nicID1, header.IPv6ProtocolNumber, tcpip.AddressWithPrefix{}); err != nil {\n\t\t\t\tt.Fatal(err)\n\t\t\t}\n\n\t\t\t// Should get the address on NIC(2) and NIC(3)\n\t\t\t// immediately since we should not have performed DAD on\n\t\t\t// it as the stack was configured to not do DAD by\n\t\t\t// default and we only updated the NDP configurations on\n\t\t\t// NIC(1).\n\t\t\tif err := checkGetMainNICAddress(s, nicID2, header.IPv6ProtocolNumber, addrWithPrefix2); err != nil {\n\t\t\t\tt.Fatal(err)\n\t\t\t}\n\t\t\tif err := checkGetMainNICAddress(s, nicID3, header.IPv6ProtocolNumber, addrWithPrefix3); err != nil {\n\t\t\t\tt.Fatal(err)\n\t\t\t}\n\n\t\t\t// Sleep until right before resolution to make sure the address didn't\n\t\t\t// resolve on NIC(1) yet.\n\t\t\tconst delta = 1\n\t\t\tclock.Advance(time.Duration(test.dupAddrDetectTransmits)*test.expectedRetransmitTimer - delta)\n\t\t\tif err := checkGetMainNICAddress(s, nicID1, header.IPv6ProtocolNumber, tcpip.AddressWithPrefix{}); err != nil {\n\t\t\t\tt.Fatal(err)\n\t\t\t}\n\n\t\t\t// Wait for DAD to resolve.\n\t\t\tclock.Advance(delta)\n\t\t\texpectDADSucceeded(nicID1, addr1)\n\t\t\tif err := addr1Disp.expectStateChanged(stack.AddressAssigned); err != nil {\n\t\t\t\tt.Error(err)\n\t\t\t}\n\t\t\tif err := checkGetMainNICAddress(s, nicID1, header.IPv6ProtocolNumber, addrWithPrefix1); err != nil {\n\t\t\t\tt.Fatal(err)\n\t\t\t}\n\t\t})\n\t}\n}", "title": "" }, { "docid": "72c7f88a154546228dcd174087e46e60", "score": "0.4502027", "text": "func winNetworkInit() {\n\tupdate := func() {\n\t\tvar dstNetworkAdapter []Win32_NetworkAdapter\n\t\tq := wmi.CreateQuery(&dstNetworkAdapter, \"WHERE PhysicalAdapter=True and MACAddress <> null\")\n\t\terr := queryWmi(q, &dstNetworkAdapter)\n\t\tif err != nil {\n\t\t\tslog.Error(err)\n\t\t\treturn\n\t\t}\n\t\tfor _, nic := range dstNetworkAdapter {\n\t\t\tvar iface = fmt.Sprint(\"Interface\", nic.InterfaceIndex)\n\t\t\t//Get PnPName using Win32_PnPEntity class\n\t\t\tvar pnpname = \"\"\n\t\t\tvar escapeddeviceid = strings.Replace(nic.PNPDeviceID, \"\\\\\", \"\\\\\\\\\", -1)\n\t\t\tvar filter = fmt.Sprintf(\"WHERE DeviceID='%s'\", escapeddeviceid)\n\t\t\tvar dstPnPName []Win32_PnPEntity\n\t\t\tq = wmi.CreateQuery(&dstPnPName, filter)\n\t\t\terr = queryWmi(q, &dstPnPName)\n\t\t\tif err != nil {\n\t\t\t\tslog.Error(err)\n\t\t\t\treturn\n\t\t\t}\n\t\t\tfor _, pnp := range dstPnPName { //Really should be a single item\n\t\t\t\tpnpname = pnp.Name\n\t\t\t}\n\t\t\tif pnpname == \"\" {\n\t\t\t\tslog.Errorf(\"%s cannot find Win32_PnPEntity %s\", iface, filter)\n\t\t\t\tcontinue\n\t\t\t}\n\n\t\t\t//Convert to instance name (see http://goo.gl/jfq6pq )\n\t\t\tinstanceName := winNetworkToInstanceName(pnpname)\n\t\t\tmNicInstanceNameToInterfaceIndex[instanceName] = iface\n\t\t}\n\t}\n\tupdate()\n\tgo func() {\n\t\tfor _ = range time.Tick(time.Minute * 5) {\n\t\t\tupdate()\n\t\t}\n\t}()\n}", "title": "" }, { "docid": "13644633c47cf97e43afe63d437ea6a0", "score": "0.4492084", "text": "func NetMgr(clientSet *kubernetes.Clientset, nodeIP string, kubeMgr *agent.Agent) error {\n\tvar err error\n\tvar interfaces []net.Interface\n\n\t// Create the default network instance\n\terr = srlinux.AddNetworkInstance(\"default\", \"default\")\n\tif err != nil {\n\t\tlog.Fatalf(\"Unable to create default network-instance: error %e\", err)\n\t}\n\n\tinterfaces = net.ListInterfaces()\n\tfor _, nic := range interfaces {\n\t\t// Bind the vfio driver\n\t\t//net.BindVFIO(nic.PCIAddress)\n\t\t// Create the interface in SR Linux\n\t\tsrlinux.AddInterface(nic.UdevName, \"nic\", \"routed\", \"default\")\n\t\t// Update the subinterface with the addressing we learned by probing Linux\n\t\taddresses := []srlinux.IPPrefix{}\n\t\tsubInterfaceIPs := []srlinux.SubInterfaceIP{}\n\t\tfor _, ipInfo := range nic.IPInfo {\n\t\t\t// TODO: Check if the IP is v4 or v6\n\t\t\taddresses = append(addresses, srlinux.IPPrefix{\n\t\t\t\tPrefix: ipInfo.IPCIDR,\n\t\t\t})\n\t\t}\n\t\t// Check if we got an address for the interface\n\t\tif len(addresses) < 1 {\n\t\t\t// We didn't find an address, allocate one\n\t\t\tlog.Infof(\"Didn't find address from passed through interface: %s, creating one myself...\", nic.UdevName)\n\t\t\toctets := strings.Split(nodeIP, \".\")\n\t\t\tunderLayIP := fmt.Sprintf(\"10.77.%s.%s\", octets[2], octets[3])\n\t\t\tunderLayCIDR := fmt.Sprintf(\"%s/24\", underLayIP)\n\t\t\tlog.Infof(\"Created address %s\", underLayCIDR)\n\t\t\taddresses = append(addresses, srlinux.IPPrefix{\n\t\t\t\tPrefix: underLayCIDR,\n\t\t\t})\n\t\t}\n\t\tsubInterfaceIPs = append(subInterfaceIPs, srlinux.SubInterfaceIP{\n\t\t\tAddresses: addresses,\n\t\t})\n\t\tout, err := json.MarshalIndent(subInterfaceIPs, \"\", \" \")\n\t\tif err != nil {\n\t\t\tlog.Infof(\"Unable to Marshal interface: %e\", err)\n\t\t}\n\t\t// Set the interface\n\t\tgnmiSubInterfacePath := fmt.Sprintf(\"/interface[name=%s]/subinterface[index=0]/ipv4\", nic.UdevName)\n\t\tgnmiSubInterface := &gpb.TypedValue{\n\t\t\tValue: &gpb.TypedValue_JsonIetfVal{\n\t\t\t\tJsonIetfVal: out,\n\t\t\t},\n\t\t}\n\t\tlog.Infof(\"Setting interface addresses for interface: %s, address: %v\", nic.UdevName, subInterfaceIPs)\n\t\t_, err = gnmi.Set(gnmiSubInterfacePath, gnmiSubInterface)\n\t\tif err != nil {\n\t\t\tlog.Errorf(\"Unable to set interface address: %e\", err)\n\t\t}\n\t}\n\n\tlog.Infof(\"Setting router ID for default network instance...\")\n\tdefaultInstance := srlinux.NetworkInstance{\n\t\t// TODO Change this later, only lets us run one instance of vSRL per node,\n\t\t// we could use the loopback CNI with whereabouts instead\n\t\tRouterID: nodeIP,\n\t}\n\tout, err := json.MarshalIndent(defaultInstance, \"\", \" \")\n\tif err != nil {\n\t\tlog.Fatalf(\"Unable to Marshal default network instance: %e\", err)\n\t}\n\tgnmiNetworkInstance := &gpb.TypedValue{\n\t\tValue: &gpb.TypedValue_JsonIetfVal{\n\t\t\tJsonIetfVal: out,\n\t\t},\n\t}\n\n\tgnmiNetworkInstancePath := fmt.Sprintf(\"/network-instance[name=%s]\", \"default\")\n\tlog.Infof(\"Update default network-instance: path %v, value %#v\", gnmiNetworkInstancePath, defaultInstance)\n\t_, err = gnmi.Set(gnmiNetworkInstancePath, gnmiNetworkInstance)\n\n\t// Add this vSRL instance to the list of underlay peers\n\t// err = storage.UnderlayPeerManagement()\n\treturn err\n}", "title": "" }, { "docid": "ad43960eda67fd852c084bf82d2481c9", "score": "0.44851354", "text": "func setup(targetNs ns.NetNS, status netStatus) error {\n\t// Get the status right\n\terr := targetNs.Do(func(_ ns.NetNS) error {\n\t\tfor _, dev := range status.Devices {\n\t\t\tlog.Printf(\"Adding dev %s\\n\", dev.Name)\n\t\t\tlink := &netlink.Dummy{LinkAttrs: netlink.LinkAttrs{Name: dev.Name}}\n\t\t\terr := netlink.LinkAdd(link)\n\t\t\tif err != nil {\n\t\t\t\treturn err\n\t\t\t}\n\n\t\t\terr = netlink.LinkSetUp(link)\n\t\t\tif err != nil {\n\t\t\t\treturn err\n\t\t\t}\n\n\t\t\tfor _, addr := range dev.Addrs {\n\t\t\t\tlog.Printf(\"Adding address %v to device %s\\n\", addr, dev.Name)\n\t\t\t\terr = netlink.AddrAdd(link, &netlink.Addr{IPNet: &addr})\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\tfor _, route := range dev.Routes {\n\t\t\t\tlog.Printf(\"Adding route %v to device %s\\n\", route, dev.Name)\n\t\t\t\troute.LinkIndex = link.Attrs().Index\n\t\t\t\terr = netlink.RouteAdd(&route)\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\treturn nil\n\t})\n\n\treturn err\n}", "title": "" }, { "docid": "3b87d4b719768e8b3deed945ecd66cb3", "score": "0.4483452", "text": "func (client VirtualNetworkClient) updateVnic(ctx context.Context, request common.OCIRequest) (common.OCIResponse, error) {\n\thttpRequest, err := request.HTTPRequest(http.MethodPut, \"/vnics/{vnicId}\")\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\tvar response UpdateVnicResponse\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": "0d95eae27e43e601764f3cfb89ee8315", "score": "0.4481509", "text": "func (mr *MockCommonAPIClientMockRecorder) NodeUpdate(ctx, nodeID, version, node interface{}) *gomock.Call {\n\tmr.mock.ctrl.T.Helper()\n\treturn mr.mock.ctrl.RecordCallWithMethodType(mr.mock, \"NodeUpdate\", reflect.TypeOf((*MockCommonAPIClient)(nil).NodeUpdate), ctx, nodeID, version, node)\n}", "title": "" }, { "docid": "eb7dfc28bc5f0dcc472f0476055c76a0", "score": "0.4477996", "text": "func networkChangeIPNew(iface net.Interface, address net.Addr) {\r\n\tlog.Printf(\"networkChangeIPNew new interface '%s' IP %s\\n\", iface.Name, address.String())\r\n\r\n\tnetworkStart(iface, []net.Addr{address})\r\n}", "title": "" }, { "docid": "3279ae88d49bb2a1ec4a099f2cc62aff", "score": "0.44767168", "text": "func (client AppsClient) UpdateVnetConnectionGatewaySlotSender(req *http.Request) (*http.Response, error) {\n\treturn autorest.SendWithSender(client, req)\n}", "title": "" }, { "docid": "44d841f15faaa0f698fdd941788022f0", "score": "0.44700074", "text": "func (n *Node) updateFingerTable(info *NodeInfo, i int32) error {\n\n\tn.RLock()\n\n\t//info.ID in [n.ID , n.fingers[i].node.ID)\n\tif info.isBetween(n.id, n.fingers[i].node.ID, intervLBounded) {\n\n\t\tn.RUnlock()\n\t\tn.Lock()\n\t\tn.fingers[i].node = info\n\t\tn.Unlock()\n\t\tlogger.Info.Printf(\"[updateFingerTable] %d-th finger updated: %v\", i, info)\n\n\t\tn.RLock()\n\t\tdefer n.RUnlock()\n\n\t\tif isSameNode(info, n.predecessor) {\n\t\t\tlogger.Warn.Print(\"[updateFingerTable] loopback update\")\n\t\t\treturn nil\n\t\t}\n\n\t\tif isSameNode(n.predecessor, n.info()) { //prevent dead loop\n\t\t\tlogger.Warn.Print(\"[updateFingerTable]: skip local rpc\")\n\t\t\treturn nil\n\t\t}\n\n\t\tconn, err := n.predecessor.dial()\n\t\tif err != nil {\n\t\t\treturn err\n\t\t}\n\t\tdefer conn.Close()\n\n\t\treturn updateFingerTableRPC(conn, &UpdateRequest{\n\t\t\tUpdater: info,\n\t\t\tI: i,\n\t\t})\n\n\t}\n\tn.RUnlock()\n\treturn nil\n}", "title": "" }, { "docid": "417785d4de1a817c0caafc5f6db06dbe", "score": "0.44673923", "text": "func (client AppsClient) UpdateVnetConnectionGatewaySender(req *http.Request) (*http.Response, error) {\n\treturn autorest.SendWithSender(client, req)\n}", "title": "" }, { "docid": "6ada81f45f4cf051b2a3b88613536586", "score": "0.44660333", "text": "func SetupTestNetNS(t *testing.T) func() {\n\truntime.LockOSThread()\n\tif err := syscall.Unshare(syscall.CLONE_NEWNET); err != nil {\n\t\tt.Fatalf(\"Failed to enter netns: %v\", err)\n\t}\n\n\tfd, err := syscall.Open(\"/proc/self/ns/net\", syscall.O_RDONLY, 0)\n\tif err != nil {\n\t\tt.Fatal(\"Failed to open netns file\")\n\t}\n\n\treturn func() {\n\t\tif err := syscall.Close(fd); err != nil {\n\t\t\tt.Logf(\"Warning: netns closing failed (%v)\", err)\n\t\t}\n\t\truntime.UnlockOSThread()\n\t}\n}", "title": "" }, { "docid": "b8c98421960e7ecf2ffdff3f9bb17743", "score": "0.44659296", "text": "func updateNetworkID(cmd *cobra.Command, args []string) {\n\tid := p2p.Testnet // default is testnet\n\tif len(args) > 0 {\n\t\tn, err := strconv.Atoi(args[0])\n\t\tif err != nil {\n\t\t\tfmt.Println(\"args[0] is not a uint32 number\")\n\t\t\treturn\n\t\t}\n\t\tid = uint32(n)\n\t}\n\tresp, err := rpcutil.RPCCall(rpcpb.NewAdminControlClient, \"UpdateNetworkID\",\n\t\t&rpcpb.UpdateNetworkIDRequest{Id: id}, common.GetRPCAddr())\n\tif err != nil {\n\t\tfmt.Printf(\"update network id %d error: %s\\n\", id, err)\n\t\treturn\n\t}\n\tresponse := resp.(*rpcpb.BaseResponse)\n\tif response.Code != 0 {\n\t\tfmt.Printf(\"update network id %d error: %s\\n\", id, err)\n\t\treturn\n\t}\n}", "title": "" }, { "docid": "f5fd6160b65069ba37e906ea74bae82a", "score": "0.44620022", "text": "func (client VirtualNetworkClient) updateTunnelCpeDeviceConfig(ctx context.Context, request common.OCIRequest) (common.OCIResponse, error) {\n\thttpRequest, err := request.HTTPRequest(http.MethodPut, \"/ipsecConnections/{ipscId}/tunnels/{tunnelId}/tunnelDeviceConfig\")\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\tvar response UpdateTunnelCpeDeviceConfigResponse\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": "1e109860a77ad9519163407c3b91d9c9", "score": "0.4457821", "text": "func (s *Snapshot) NetUsageKwh() float64 {\n\treturn *s.ConsumptionKwh + *s.ProductionKwh\n}", "title": "" }, { "docid": "f5dbc6e608c16f109637c84582785cb2", "score": "0.4451422", "text": "func (dscp *DynamicSubnetConfigurator) UpdateCBNetworkingRules(vmNetworkInfo dataobjects.HostNetworkInformation) {\n\tCBLogger.Debug(\"Start.........\")\n\n\t// Need to update? (A checking function is required)\n\t// if yes\n\t// update\n\t// if no\n\t// pass\n\n\t// To be updated below\n\ttempNetwork := fmt.Sprint(dscp.subnetIPs[dscp.seq], \"/\", dscp.subnetPrefix)\n\n\tdscp.NetworkingRules.AppendRule(strconv.Itoa(dscp.seq), tempNetwork, dscp.subnetIPs[dscp.seq], vmNetworkInfo.PublicIP)\n\tCBLogger.Infof(\"The updated networking rules: %s\", dscp.NetworkingRules)\n\tdscp.seq = (dscp.seq+1)%98 + 2\n\n\tCBLogger.Debug(\"End.........\")\n}", "title": "" }, { "docid": "4c96e6c40233a82268c2da8da13fdfe8", "score": "0.4450772", "text": "func (c *nfsCollector) updateNFSRequestsv2Stats(ch chan<- prometheus.Metric, s *nfs.V2Stats) {\n\tconst proto = \"2\"\n\n\tv := reflect.ValueOf(s).Elem()\n\tfor i := 0; i < v.NumField(); i++ {\n\t\tfield := v.Field(i)\n\n\t\tch <- prometheus.MustNewConstMetric(c.nfsProceduresDesc, prometheus.CounterValue,\n\t\t\tfloat64(field.Uint()), proto, v.Type().Field(i).Name)\n\t}\n}", "title": "" }, { "docid": "6d38f56c7089b667aa5e1bc1b49f2d64", "score": "0.444808", "text": "func (o Netscaler) UpdateNsip(req model.NsipUpdate) (r model.Nsip, err error) {\r\n\tresp := model.Response{}\r\n\terr = o.Session.Put(BaseURI+\"nsip\", req, &resp)\r\n\tif err != nil {\r\n\t\treturn\r\n\t}\r\n\tif resp.Errorcode != 0 {\r\n\t\terr = errors.New(resp.Message)\r\n\t\treturn\r\n\t}\r\n\treturn o.GetNsip(req.Nsip.Ipaddress)\r\n}", "title": "" }, { "docid": "2df4f639b42be515c1e995287136f8eb", "score": "0.4443334", "text": "func (c *nfsCollector) updateNFSRequestsv4Stats(ch chan<- prometheus.Metric, s *nfs.ClientV4Stats) {\n\tconst proto = \"4\"\n\n\tv := reflect.ValueOf(s).Elem()\n\tfor i := 0; i < v.NumField(); i++ {\n\t\tfield := v.Field(i)\n\n\t\tch <- prometheus.MustNewConstMetric(c.nfsProceduresDesc, prometheus.CounterValue,\n\t\t\tfloat64(field.Uint()), proto, v.Type().Field(i).Name)\n\t}\n}", "title": "" }, { "docid": "deb82891aaf627acc92ec7f31744b7cb", "score": "0.44419503", "text": "func (p *Proxy) UpdateNetworkPolicy(ep logger.EndpointUpdater, vis *policy.VisibilityPolicy, policy *policy.L4Policy, ingressPolicyEnforced, egressPolicyEnforced bool, wg *completion.WaitGroup) (error, func() error) {\n\treturn p.XDSServer.UpdateNetworkPolicy(ep, vis, policy, ingressPolicyEnforced, egressPolicyEnforced, wg)\n}", "title": "" }, { "docid": "279884081de7d8900229f0d54b7d27ce", "score": "0.44373593", "text": "func (rc *requestController) UpdateCRDSpec(ctx context.Context, nnc v1alpha.NodeNetworkConfigSpec) error {\n\tnodeNetworkConfig, err := rc.getNodeNetConfig(ctx, rc.nodeName, k8sNamespace)\n\tif err != nil {\n\t\tlogger.Errorf(\"[cns-rc] Error getting CRD when updating spec %v\", err)\n\t\treturn err\n\t}\n\n\tlogger.Printf(\"[cns-rc] Received update for IP count %+v\", nnc)\n\n\t// Update the CRD spec\n\tnnc.DeepCopyInto(&nodeNetworkConfig.Spec)\n\n\tlogger.Printf(\"[cns-rc] After deep copy %+v\", nodeNetworkConfig.Spec)\n\n\t// Send update to API server\n\tif err := rc.updateNodeNetConfig(ctx, nodeNetworkConfig); err != nil {\n\t\tlogger.Errorf(\"[cns-rc] Error updating CRD spec %v\", err)\n\t\treturn err\n\t}\n\n\t// record IP metrics\n\trequestedIPs.Set(float64(nnc.RequestedIPCount))\n\tunusedIPs.Set(float64(len(nnc.IPsNotInUse)))\n\treturn nil\n}", "title": "" }, { "docid": "1768245803466fe227818d8bcf04ce98", "score": "0.4434673", "text": "func (d *ApplicationCache) NetworkStateUpdated(ctx context.Context) (cdpevent.ApplicationCacheNetworkStateUpdatedClient, error) {\n\ts, err := rpcc.NewStream(ctx, cdpevent.ApplicationCacheNetworkStateUpdated.String(), d.conn)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\treturn &ApplicationCacheNetworkStateUpdatedClient{Stream: s}, nil\n}", "title": "" }, { "docid": "d1ac74a5bf0ae99e93267cbc1cc6985d", "score": "0.44324997", "text": "func (a *Client) UpdateNetworkGroupnet(params *UpdateNetworkGroupnetParams, authInfo runtime.ClientAuthInfoWriter) (*UpdateNetworkGroupnetNoContent, error) {\n\t// TODO: Validate the params before sending\n\tif params == nil {\n\t\tparams = NewUpdateNetworkGroupnetParams()\n\t}\n\n\tresult, err := a.transport.Submit(&runtime.ClientOperation{\n\t\tID: \"updateNetworkGroupnet\",\n\t\tMethod: \"PUT\",\n\t\tPathPattern: \"/platform/3/network/groupnets/{NetworkGroupnetId}\",\n\t\tProducesMediaTypes: []string{\"application/json\"},\n\t\tConsumesMediaTypes: []string{\"application/json\"},\n\t\tSchemes: []string{\"https\"},\n\t\tParams: params,\n\t\tReader: &UpdateNetworkGroupnetReader{formats: a.formats},\n\t\tAuthInfo: authInfo,\n\t\tContext: params.Context,\n\t\tClient: params.HTTPClient,\n\t})\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\treturn result.(*UpdateNetworkGroupnetNoContent), nil\n\n}", "title": "" }, { "docid": "74420a3b73b6762831d1749a1e272797", "score": "0.4428787", "text": "func (s *Sender) UpdateLastSentAt(data []byte) {\n\tvar envelope lastSentAtEnvelope\n\terr := json.Unmarshal(data, &envelope)\n\tif err != nil {\n\t\ts.node.Log(centrifuge.NewLogEntry(centrifuge.LogLevelError, \"usage stats: error decoding lastSentAtEnvelope\", map[string]any{\"error\": err.Error()}))\n\t\treturn\n\t}\n\ts.mu.Lock()\n\tdefer s.mu.Unlock()\n\tif envelope.LastSentAt > s.lastSentAt {\n\t\tif s.isDev() {\n\t\t\ts.node.Log(centrifuge.NewLogEntry(centrifuge.LogLevelDebug, \"usage stats: updating last sent to value from another node\", map[string]any{}))\n\t\t}\n\t\ts.lastSentAt = envelope.LastSentAt\n\t\ts.resetMaxValues()\n\t}\n}", "title": "" }, { "docid": "23647e6ec24ab8e9a376088754adf47b", "score": "0.4419766", "text": "func (r *Route) update() {\n\tnh := []*netlink.NexthopInfo{}\n\tfor _, i := range r.nhops {\n\t\tnh = append(nh, i)\n\t}\n\tr.r.MultiPath = nh\n\tif r.up {\n\t\tif len(nh) == 0 {\n\t\t\t// down the route\n\t\t\tif err := netlink.RouteDel(r.r); err != nil {\n\t\t\t\tl.ERROR(\"failed to delete route: %v\", err)\n\t\t\t\treturn\n\t\t\t}\n\t\t\tr.up = false\n\t\t\troutesUp.Down()\n\t\t\tl.INFO(\"route %s is down\", r.r.Dst.String())\n\t\t} else {\n\t\t\tif err := netlink.RouteReplace(r.r); err != nil {\n\t\t\t\tl.ERROR(\"failed to update route: %v\", err)\n\t\t\t\treturn\n\t\t\t}\n\t\t\tl.INFO(\"updated route %s\", r.r.Dst.String())\n\t\t}\n\t} else if len(nh) > 0 {\n\t\t// route is currently down, bring it up\n\t\tif err := netlink.RouteAdd(r.r); err != nil {\n\t\t\tl.ERROR(\"failed to add route: %v\", err)\n\t\t\treturn\n\t\t}\n\t\tr.up = true\n\t\troutesUp.Up()\n\t\tl.INFO(\"route %s is down\", r.r.Dst.String())\n\t}\n}", "title": "" }, { "docid": "c2b134813ac3c49c3bba1640edf4385e", "score": "0.44190106", "text": "func (n *Network) Update(host string, latencies ...time.Duration) {\n\tn.Lock()\n\tdefer n.Unlock()\n\tmetrics := n.get(host)\n\tmetrics.Update(latencies...)\n}", "title": "" }, { "docid": "9a654746fccdfbf975afa9c046948dd7", "score": "0.44163525", "text": "func (d *DevicesManager) UpdateNodeInfo(info *types.NodeInfo) {\n\tfor i, device := range d.Devices {\n\t\tif d.Operational[i] {\n\t\t\terr := device.UpdateNodeInfo(info)\n\t\t\tif err != nil {\n\t\t\t\tglog.Errorf(\"Unable to update device %s encounter error %v\", device.GetName(), err)\n\t\t\t}\n\t\t}\n\t}\n}", "title": "" }, { "docid": "1bdf793498ff5a35f23975b0b74212cd", "score": "0.44162205", "text": "func networkChangeInterfaceNew(iface net.Interface, addresses []net.Addr) {\r\n\tlog.Printf(\"networkChangeInterfaceNew new interface '%s' (%d IPs)\\n\", iface.Name, len(addresses))\r\n\r\n\tnetworkStart(iface, addresses)\r\n}", "title": "" }, { "docid": "9897f0fdd61cacb0eca84d8be0a1e5d7", "score": "0.44144267", "text": "func (c *nfsdCollector) updateNFSdThreadsStats(ch chan<- prometheus.Metric, s *nfs.Threads) {\n\tch <- prometheus.MustNewConstMetric(\n\t\tprometheus.NewDesc(\n\t\t\tprometheus.BuildFQName(namespace, nfsdSubsystem, \"server_threads\"),\n\t\t\t\"Total number of NFSd kernel threads that are running.\",\n\t\t\tnil,\n\t\t\tnil,\n\t\t),\n\t\tprometheus.GaugeValue,\n\t\tfloat64(s.Threads))\n}", "title": "" }, { "docid": "228fe9dfd596841d425fce0bda3c7543", "score": "0.44095373", "text": "func (c *Client) Trace(host string, requestType uint16, maxrecursion int) (*TraceData, error) {\n\tvar tracedata TraceData\n\thost = dns.CanonicalName(host)\n\tmsg := dns.Msg{}\n\tmsg.SetQuestion(host, requestType)\n\tservers := RootDNSServersIPv4\n\tseenNS := make(map[string]struct{})\n\tfor i := 1; i < maxrecursion; i++ {\n\t\tmsg.SetQuestion(host, requestType)\n\t\tdnsdatas, err := c.QueryParallel(host, requestType, servers)\n\t\tif err != nil {\n\t\t\treturn nil, err\n\t\t}\n\n\t\tfor _, server := range servers {\n\t\t\tseenNS[server] = struct{}{}\n\t\t}\n\n\t\tif len(dnsdatas) == 0 {\n\t\t\treturn &tracedata, nil\n\t\t}\n\n\t\tfor _, dnsdata := range dnsdatas {\n\t\t\tif dnsdata != nil && len(dnsdata.Resolver) > 0 {\n\t\t\t\ttracedata.DNSData = append(tracedata.DNSData, dnsdata)\n\t\t\t}\n\t\t}\n\n\t\tvar newNSResolvers []string\n\t\tvar nextCname string\n\t\tfor _, d := range dnsdatas {\n\t\t\t// Add ns records as new resolvers\n\t\t\tfor _, ns := range d.NS {\n\t\t\t\tips, err := net.LookupIP(ns)\n\t\t\t\tif err != nil {\n\t\t\t\t\tcontinue\n\t\t\t\t}\n\t\t\t\tfor _, ip := range ips {\n\t\t\t\t\tif ip.To4() != nil {\n\t\t\t\t\t\tnewNSResolvers = append(newNSResolvers, net.JoinHostPort(ip.String(), \"53\"))\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t\t// Follow CNAME - should happen at the final step of the trace\n\t\t\tfor _, cname := range d.CNAME {\n\t\t\t\tif nextCname == \"\" {\n\t\t\t\t\tnextCname = cname\n\t\t\t\t\tbreak\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\tnewNSResolvers = deduplicate(newNSResolvers)\n\n\t\t// if we have no new resolvers => return\n\t\tif len(newNSResolvers) == 0 {\n\t\t\tbreak\n\t\t}\n\n\t\t// Pick a random server\n\t\trandomServer := newNSResolvers[rand.Intn(len(newNSResolvers))]\n\t\t// If we pick the same resolver and we are not following any new cname => return\n\t\tif _, ok := seenNS[randomServer]; ok && nextCname == \"\" {\n\t\t\tbreak\n\t\t}\n\n\t\tservers = []string{randomServer}\n\n\t\t// follow cname if any\n\t\tif nextCname != \"\" {\n\t\t\thost = nextCname\n\t\t}\n\t}\n\n\treturn &tracedata, nil\n}", "title": "" }, { "docid": "dc17065d2a81c3dfca9313bc61f47aad", "score": "0.44059", "text": "func (c *nfsCollector) updateNFSClientRPCStats(ch chan<- prometheus.Metric, s *nfs.ClientRPC) {\n\tch <- prometheus.MustNewConstMetric(c.nfsRPCOperationsDesc, prometheus.CounterValue,\n\t\tfloat64(s.RPCCount))\n\tch <- prometheus.MustNewConstMetric(c.nfsRPCRetransmissionsDesc, prometheus.CounterValue,\n\t\tfloat64(s.Retransmissions))\n\tch <- prometheus.MustNewConstMetric(c.nfsRPCAuthenticationRefreshesDesc, prometheus.CounterValue,\n\t\tfloat64(s.AuthRefreshes))\n}", "title": "" }, { "docid": "912079f6dbf3d16aa753400866f7842d", "score": "0.4403438", "text": "func readback(targetNs ns.NetNS, devNames []string) (netStatus, error) {\n\t// Get the status right.\n\tvar retVal netStatus\n\n\terr := targetNs.Do(func(_ ns.NetNS) error {\n\t\tretVal.Devices = make([]Device, 2)\n\n\t\tfor i, name := range devNames {\n\t\t\tlog.Printf(\"Checking device %s\", name)\n\t\t\tretVal.Devices[i].Name = name\n\n\t\t\tlink, err := netlink.LinkByName(name)\n\t\t\tif err != nil {\n\t\t\t\treturn err\n\t\t\t}\n\n\t\t\t// Need to read all tables, so cannot use RouteList\n\t\t\trouteFilter := &netlink.Route{\n\t\t\t\tLinkIndex: link.Attrs().Index,\n\t\t\t\tTable: unix.RT_TABLE_UNSPEC,\n\t\t\t}\n\n\t\t\troutes, err := netlink.RouteListFiltered(netlink.FAMILY_ALL,\n\t\t\t\trouteFilter,\n\t\t\t\tnetlink.RT_FILTER_OIF|netlink.RT_FILTER_TABLE)\n\t\t\tif err != nil {\n\t\t\t\treturn err\n\t\t\t}\n\n\t\t\tfor _, route := range routes {\n\t\t\t\tlog.Printf(\"Got %s route %v\", name, route)\n\t\t\t}\n\n\t\t\tretVal.Devices[i].Routes = routes\n\t\t}\n\n\t\trules, err := netlink.RuleList(netlink.FAMILY_ALL)\n\t\tif err != nil {\n\t\t\treturn err\n\t\t}\n\n\t\tretVal.Rules = make([]netlink.Rule, 0, len(rules))\n\n\t\tfor _, rule := range rules {\n\t\t\t// Rules over 250 are the kernel defaults, that we ignore.\n\t\t\tif rule.Table < 250 {\n\t\t\t\tlog.Printf(\"Got interesting rule %v\", rule)\n\t\t\t\tretVal.Rules = append(retVal.Rules, rule)\n\t\t\t}\n\t\t}\n\n\t\treturn nil\n\t})\n\n\treturn retVal, err\n}", "title": "" } ]
1d0812c526df635a5b83f87418281d4a
lockRecord locks a record with default retry parameters.
[ { "docid": "dcc1cbe64abdd25bf9a5e1e7b77087dc", "score": "0.68236756", "text": "func (repo *repository) lockRecord(ctx context.Context, key string) redislock.RedisLockError {\n\tlog.Trace(\"repository.lockRecord(%v) called\", key)\n\n\treturn repo.keyLocker.ObtainLock(\n\t\tctx,\n\t\tkey,\n\t\tlockExpiration,\n\t\tlockTimeout,\n\t\tlockRetry,\n\t)\n}", "title": "" } ]
[ { "docid": "6aa281faa2868590f5e00c173b89bbde", "score": "0.5844881", "text": "func LockWithRetryDelay(retryDelay time.Duration) LockOption {\n\treturn func(lockOptions *lockOptions) {\n\t\tlockOptions.retryDelay = retryDelay\n\t}\n}", "title": "" }, { "docid": "75e3ec824b72b053fa3111e0d469b729", "score": "0.57083887", "text": "func (r Replicator) lock(lock kp.Lock, lockPath string, overrideLock bool) error {\n\terr := lock.Lock(lockPath)\n\n\tif _, ok := err.(kp.AlreadyLockedError); ok {\n\t\tholder, id, err := r.Store.LockHolder(lockPath)\n\t\tif err != nil {\n\t\t\treturn util.Errorf(\"Lock already held for %q, could not determine holder due to error: %s\", lockPath, err)\n\t\t} else if holder == \"\" {\n\t\t\t// we failed to acquire this lock, but there is no outstanding\n\t\t\t// holder\n\t\t\t// this indicates that the previous holder had a LockDelay,\n\t\t\t// which prevents other parties from acquiring the lock for a\n\t\t\t// limited time\n\t\t\treturn util.Errorf(\"Lock for %q is blocked due to delay by previous holder\", lockPath)\n\t\t} else if overrideLock {\n\t\t\terr = r.Store.DestroyLockHolder(id)\n\t\t\tif err != nil {\n\t\t\t\treturn util.Errorf(\"Unable to destroy the current lock holder (%s) for %q: %s\", holder, lockPath, err)\n\t\t\t}\n\n\t\t\t// try acquiring the lock again, but this time don't destroy holders so we don't try forever\n\t\t\treturn r.lock(lock, lockPath, false)\n\n\t\t} else {\n\t\t\treturn util.Errorf(\"Lock for %q already held by lock %q\", lockPath, holder)\n\t\t}\n\t}\n\n\treturn err\n}", "title": "" }, { "docid": "ebeb3c4859d15400fe5a949602729a93", "score": "0.5403522", "text": "func (rl *redisLocker) tryLock(ctx context.Context, key string, ttl time.Duration) RedisLockError {\n\n\tlockKey := lockKeyPrefix + key\n\tif rl.locked != nil {\n\t\tif rl.locked.Key != lockKey {\n\t\t\treturn UnlockRequired\n\t\t}\n\t\treturn Ok\n\t}\n\n\tif setRes := rl.redis.SetNX(ctx, lockKey, lockValue, ttl); setRes.Val() {\n\t\trl.locked = &lockInfo{\n\t\t\tKey: lockKey,\n\t\t\tCtx: ctx,\n\t\t}\n\t\treturn Ok\n\t}\n\n\treturn AlreadyLocked\n}", "title": "" }, { "docid": "389dd48628e5774402b3323df11390cc", "score": "0.540213", "text": "func retryWhileIncompatibleOperation(timeout time.Duration, lockKey string, f func() error) error {\n\treturn tpgresource.RetryWhileIncompatibleOperation(timeout, lockKey, f)\n}", "title": "" }, { "docid": "00e18ad6260acd23a30f4b3457c13694", "score": "0.53156793", "text": "func (m *Mutex) Lock() error {\n\tr := Get(m.pk)\n\tif r == nil {\n\t\treturn ErrRedisNotFound\n\t}\n\n\tvar (\n\t\tpv string\n\t\terr error\n\t)\n\n\tfor i := 0; i < m.tries; i++ {\n\t\tif pv, _, err = String(r.Do(\"SET\", m.key, m.value, \"EX\", m.ex.Seconds(), \"NX\")); pv != \"\" || err != nil {\n\t\t\tbreak\n\t\t}\n\t\ttime.Sleep(m.delay)\n\t}\n\n\tif err != nil {\n\t\treturn err\n\t} else if pv == \"\" {\n\t\treturn ErrFailed\n\t}\n\n\treturn nil\n}", "title": "" }, { "docid": "498c0b62e6f96eac0300419de18cdf7e", "score": "0.53035414", "text": "func RetryRecordMocked(t *testing.T, recordIn *types.Record) *types.Record {\n\n\tassert := assert.New(t)\n\n\t// wire up\n\tcs := &utils.MockConcertoService{}\n\tds, err := NewDomainService(cs)\n\tassert.Nil(err, \"Couldn't load domain service\")\n\tassert.NotNil(ds, \"Domain service not instanced\")\n\n\tmapIn := new(map[string]interface{})\n\n\t// to json\n\tdOut, err := json.Marshal(recordIn)\n\tassert.Nil(err, \"Record test data corrupted\")\n\n\t// call service\n\tcs.On(\"Put\", fmt.Sprintf(APIPathNetworkDnsRecordRetry, recordIn.ID), mapIn).Return(dOut, 200, nil)\n\trecordOut, err := ds.RetryRecord(recordIn.ID)\n\n\tassert.Nil(err, \"Error retrying record\")\n\tassert.Equal(recordIn, recordOut, \"RetryRecord returned different record\")\n\n\treturn recordOut\n}", "title": "" }, { "docid": "fbf600ed44122a22e81af702a8bde26c", "score": "0.5246895", "text": "func (m *Mutex) TryLock(key interface{}) (gotLock bool) {\n\tfor i := 0; i < m.maxRetry; i++ {\n\t\tm.m.Lock()\n\t\tif _, ok := m.locks[key]; ok { // if locked\n\t\t\tm.m.Unlock()\n\t\t\ttime.Sleep(m.backoff(i))\n\t\t} else { // if unlock, lockit\n\t\t\tm.locks[key] = struct{}{}\n\t\t\tm.m.Unlock()\n\t\t\treturn true\n\t\t}\n\t}\n\n\treturn false\n}", "title": "" }, { "docid": "93e9cb5b76d04fc7d1bb00427e23ee0e", "score": "0.5245752", "text": "func (_Locking *LockingTransactor) Lock(opts *bind.TransactOpts) (*types.Transaction, error) {\n\treturn _Locking.contract.Transact(opts, \"lock\")\n}", "title": "" }, { "docid": "b478f8d5abeddca7d4e92c01ea0b7b3c", "score": "0.52294177", "text": "func (_PolyNFTWrapper *PolyNFTWrapperTransactor) Lock(opts *bind.TransactOpts, fromAsset common.Address, toChainId uint64, toAddress common.Address, tokenId *big.Int, feeToken common.Address, fee *big.Int, id *big.Int) (*types.Transaction, error) {\n\treturn _PolyNFTWrapper.contract.Transact(opts, \"lock\", fromAsset, toChainId, toAddress, tokenId, feeToken, fee, id)\n}", "title": "" }, { "docid": "95ea5977618d10099f18b7be79a24aaf", "score": "0.5181832", "text": "func Lock(ctx context.Context, resource string, args ...interface{}) (Locker, error) {\n\tfor _, v := range args {\n\t\tresource = fmt.Sprintf(\"%s:%s\", resource, v)\n\t}\n\n\tlocker, err := mustGetDefaultLocksmith().Forge(resource)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\tc := make(chan error)\n\n\tgo func() {\n\t\terr := locker.Lock()\n\n\t\tselect {\n\t\tcase c <- err:\n\t\t\t// This is the normal case\n\t\tdefault:\n\t\t\t// There is no receiver which means the function\n\t\t\t// has already returned because the timeout was\n\t\t\t// reached. We don't need this lock anymore.\n\t\t\tlocker.Unlock()\n\t\t}\n\t}()\n\n\tselect {\n\tcase err := <-c:\n\t\tif err != nil {\n\t\t\treturn nil, oops.WithMessage(err, \"failed to acquire lock\")\n\t\t}\n\t\treturn locker, nil\n\tcase <-ctx.Done():\n\t\treturn nil, oops.WithMessage(ctx.Err(), \"failed to acquire lock in time\")\n\t}\n}", "title": "" }, { "docid": "82e29282b2cd968636dd53a9468de305", "score": "0.5152059", "text": "func (p *Pool) Lock(ctx context.Context, key string) error {\n\t// Unroll once through the loop to make sure we try asap.\n\tok, err := p.TryLock(ctx, key)\n\tif err != nil {\n\t\treturn fmt.Errorf(\"failed at attempting initial lock acquisition: %v\", err)\n\t}\n\tif ok {\n\t\treturn nil\n\t}\n\n\tt := time.NewTicker(p.retry)\n\tdefer t.Stop()\n\tfor !ok {\n\t\tselect {\n\t\tcase <-t.C:\n\t\t\tok, err = p.TryLock(ctx, key)\n\t\tcase <-ctx.Done():\n\t\t\treturn ctx.Err()\n\t\t}\n\t\tif err != nil {\n\t\t\treturn fmt.Errorf(\"failed at attempting lock acquisition: %v\", err)\n\t\t}\n\t}\n\treturn nil\n}", "title": "" }, { "docid": "040c61ad86965ed5d915ac8183b89a21", "score": "0.50783044", "text": "func (_PolyNFTWrapper *PolyNFTWrapperSession) Lock(fromAsset common.Address, toChainId uint64, toAddress common.Address, tokenId *big.Int, feeToken common.Address, fee *big.Int, id *big.Int) (*types.Transaction, error) {\n\treturn _PolyNFTWrapper.Contract.Lock(&_PolyNFTWrapper.TransactOpts, fromAsset, toChainId, toAddress, tokenId, feeToken, fee, id)\n}", "title": "" }, { "docid": "f1a521a295fb79a9e5a074df510de0b2", "score": "0.50695634", "text": "func lockedCall(lockKey string, f func() error) error {\n\treturn transport_tpg.LockedCall(lockKey, f)\n}", "title": "" }, { "docid": "c3937cc1d3b8eec8aec3a8928c4a760a", "score": "0.503172", "text": "func (_PolyNFTWrapper *PolyNFTWrapperTransactorSession) Lock(fromAsset common.Address, toChainId uint64, toAddress common.Address, tokenId *big.Int, feeToken common.Address, fee *big.Int, id *big.Int) (*types.Transaction, error) {\n\treturn _PolyNFTWrapper.Contract.Lock(&_PolyNFTWrapper.TransactOpts, fromAsset, toChainId, toAddress, tokenId, feeToken, fee, id)\n}", "title": "" }, { "docid": "4f5e7867c27a08bd6141fe048e5ee515", "score": "0.5019011", "text": "func (l *postgresLocker) Lock() {\n\tl.do(\"lock\")\n}", "title": "" }, { "docid": "e40af39b24108fdc4cbecd1a03f39865", "score": "0.49774057", "text": "func (t *batchTx) RLock() {\n\tpanic(\"unexpected RLock\")\n}", "title": "" }, { "docid": "d9ebe16752f4f191aa9ea9398da4ac08", "score": "0.4970714", "text": "func lock(urlStr string, mode minio.RetentionMode, validity uint64, unit minio.ValidityUnit, op string) error {\n\tclient, err := newClient(urlStr)\n\tif err != nil {\n\t\tfatalIf(err.Trace(), \"Unable to parse the provided url.\")\n\t}\n\n\tctx, cancelLock := context.WithCancel(globalContext)\n\tdefer cancelLock()\n\tif op == \"clear\" || mode != \"\" {\n\t\terr = client.SetObjectLockConfig(ctx, mode, validity, unit)\n\t\tfatalIf(err, \"Unable to enable object lock configuration on the specified bucket.\")\n\t} else {\n\t\tmode, validity, unit, err = client.GetObjectLockConfig(ctx)\n\t\tfatalIf(err, \"Unable to get object lock configuration on the specified bucket.\")\n\t}\n\n\tprintMsg(lockCmdMessage{\n\t\tEnabled: \"Enabled\",\n\t\tMode: mode,\n\t\tValidity: fmt.Sprintf(\"%d%s\", validity, unit),\n\t\tStatus: \"success\",\n\t})\n\n\treturn nil\n}", "title": "" }, { "docid": "c3a16b3a2dbd95da3c9a6bdcab504f28", "score": "0.49481243", "text": "func (_Locking *LockingTransactorSession) Lock() (*types.Transaction, error) {\n\treturn _Locking.Contract.Lock(&_Locking.TransactOpts)\n}", "title": "" }, { "docid": "0db43bf6edb5c79e6715d7ad086fb25d", "score": "0.49345818", "text": "func (locker *Locker) Lock(ctx context.Context, key string, ttl time.Duration) (LockResult, error) {\n\tr := LockResult{}\n\tvalue, err := locker.randomString()\n\tif err != nil {\n\t\treturn r, err\n\t}\n\tr.Lock = Lock{\n\t\tlocker: locker,\n\t\tkey: key,\n\t\tvalue: value,\n\t}\n\tr.Result, err = r.Lock.Lock(ctx, ttl)\n\treturn r, err\n}", "title": "" }, { "docid": "aa72742b7116d93bc2290342ccf3a991", "score": "0.49331823", "text": "func (repo *repository) unlockRecord() {\n\tlog.Trace(\"repository.ulockRecord() called\")\n\n\trepo.keyLocker.Unlock()\n}", "title": "" }, { "docid": "fa7b6bc09a52e9fdd843c758f95c6ef8", "score": "0.49117792", "text": "func doLock(ctx context.Context, svc pb.LockServiceServer, in *pb.LockRequest) (*pb.LockResponse, error) {\n\tstart := time.Now()\n\treq := &pb.TryLockRequest{\n\t\tLock: in.Lock,\n\t}\n\n\t_, err := svc.TryLock(ctx, req)\n\n\tswitch err {\n\tcase ErrLockBusy:\n\t\tbreak\n\tcase nil:\n\t\t// TODO(lobato): craft a response here.\n\t\treturn &pb.LockResponse{}, nil\n\t}\n\n\tdur, err := ptypes.Duration(in.Timeout)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\tfor {\n\t\t// Check if the maximum wait duration has expired.\n\t\tif time.Now().After(start.Add(dur)) {\n\t\t\treturn nil, ErrLockBusy\n\t\t}\n\n\t\t_, err := svc.TryLock(ctx, req)\n\n\t\tswitch err {\n\t\tcase ErrLockBusy:\n\t\t\tbreak\n\t\tcase nil:\n\t\t\treturn &pb.LockResponse{}, nil\n\t\tdefault:\n\t\t\treturn nil, err\n\t\t}\n\n\t\ttime.Sleep(time.Second)\n\t}\n}", "title": "" }, { "docid": "797831eab8bf9bf7ca375facdd81893e", "score": "0.48767605", "text": "func (l *locker) Lock(s state.State, reason string) error {\n\tl.mu.Lock()\n\tdefer l.mu.Unlock()\n\n\tl.state = s\n\n\tctx, cancel := context.WithTimeout(l.ctx, l.timeout)\n\tdefer cancel()\n\n\tlockInfo := state.NewLockInfo()\n\tlockInfo.Operation = reason\n\n\terr := slowmessage.Do(LockThreshold, func() error {\n\t\tid, err := state.LockWithContext(ctx, s, lockInfo)\n\t\tl.lockID = id\n\t\treturn err\n\t}, func() {\n\t\tif l.ui != nil {\n\t\t\tl.ui.Output(l.color.Color(LockMessage))\n\t\t}\n\t})\n\n\tif err != nil {\n\t\treturn errwrap.Wrapf(strings.TrimSpace(LockErrorMessage), err)\n\t}\n\n\treturn nil\n}", "title": "" }, { "docid": "37f40ffab94c226f2e31135aa07ab761", "score": "0.48596483", "text": "func (leaderElector *LeaderElector) tryAcquireOrRenew(ctx context.Context) bool {\n\tnow := metav1.Now()\n\tleaderElectionRecord := resourcelock.LeaderElectionRecord{\n\t\tHolderIdentity: leaderElector.config.Lock.Identity(),\n\t\tLeaseDurationSeconds: int(leaderElector.config.LeaseDuration / time.Second),\n\t\tAcquireTime: now,\n\t\tRenewTime: now,\n\t}\n\n\t// 1. obtain or create the ElectionRecord\n\toldLeaderElectionRecord, oldLeaderElectionRawRecord, err := leaderElector.config.Lock.Get(ctx)\n\tif err != nil {\n\t\tif !errors.IsNotFound(err) {\n\t\t\tklog.Errorf(\"error retrieving resource lock %v: %v\", leaderElector.config.Lock.Describe(), err)\n\t\t\treturn false\n\t\t}\n\n\t\tif err = leaderElector.config.Lock.Create(ctx, leaderElectionRecord); err != nil {\n\t\t\tklog.Errorf(\"error initially creating leader election record: %v\", err)\n\t\t\treturn false\n\t\t}\n\n\t\tleaderElector.observedRecord = leaderElectionRecord\n\t\tleaderElector.observedTime = leaderElector.clock.Now()\n\t\treturn true\n\t}\n\n\t// 2. Record obtained, check the Identity & Time\n\tif !bytes.Equal(leaderElector.observedRawRecord, oldLeaderElectionRawRecord) {\n\t\tleaderElector.observedRecord = *oldLeaderElectionRecord\n\t\tleaderElector.observedRawRecord = oldLeaderElectionRawRecord\n\t\tleaderElector.observedTime = leaderElector.clock.Now()\n\t}\n\n\t// 3. We're going to try to update. The leaderElectionRecord is set to it's default\n\t// here. Let's correct it before updating.\n\tif leaderElector.IsLeader() {\n\t\tleaderElectionRecord.AcquireTime = oldLeaderElectionRecord.AcquireTime\n\t\tleaderElectionRecord.LeaderTransitions = oldLeaderElectionRecord.LeaderTransitions\n\t} else {\n\t\tleaderElectionRecord.LeaderTransitions = oldLeaderElectionRecord.LeaderTransitions + 1\n\t}\n\n\t// update the lock itself\n\tif err = leaderElector.config.Lock.Update(ctx, leaderElectionRecord); err != nil {\n\t\tklog.Errorf(\"Failed to update lock: %v\", err)\n\t\treturn false\n\t}\n\n\tleaderElector.observedRecord = leaderElectionRecord\n\tleaderElector.observedTime = leaderElector.clock.Now()\n\n\treturn true\n}", "title": "" }, { "docid": "483bf848cd704fcb21dc9322f934b230", "score": "0.48569298", "text": "func (_Locking *LockingSession) Lock() (*types.Transaction, error) {\n\treturn _Locking.Contract.Lock(&_Locking.TransactOpts)\n}", "title": "" }, { "docid": "0372e1926a584c7ab5f3ef8c5e4b1392", "score": "0.48487777", "text": "func (i *internalKV) ExtendLock(ctx context.Context, key string, timeout int32) error {\n\tif i.svc.kvc == nil {\n\t\treturn errors.New(\"EventStore client is not connected\")\n\t}\n\n\tr := &eventstore.LockRequest{\n\t\tLocation: &eventstore.LocationType{\n\t\t\tScope: &eventstore.ScopeType{\n\t\t\t\tBridge: i.bridge,\n\t\t\t\tInstance: i.instance,\n\t\t\t},\n\t\t\tKey: key,\n\t\t\tLockKey: i.lock,\n\t\t},\n\t\tTimeout: timeout,\n\t}\n\n\tswitch {\n\tcase i.instance != \"\":\n\t\tr.Location.Scope.Type = eventstore.ScopeChoice_Instance\n\tcase i.bridge != \"\":\n\t\tr.Location.Scope.Type = eventstore.ScopeChoice_Bridge\n\tdefault:\n\t\tr.Location.Scope.Type = eventstore.ScopeChoice_Global\n\t}\n\n\tif err := r.Validate(); err != nil {\n\t\treturn err\n\t}\n\n\t_, err := i.svc.kvc.Lock(ctx, r)\n\treturn err\n}", "title": "" }, { "docid": "708517d0e6478197df5c5290eda950db", "score": "0.48384053", "text": "func (s *Store) tryLock(ctx context.Context, key int) (bool, error) {\n\tok, _, err := basestore.ScanFirstBool(s.Store.Query(ctx, sqlf.Sprintf(tryLockQuery, appLockKey, key)))\n\tif err != nil || !ok {\n\t\treturn false, err\n\t}\n\treturn true, nil\n}", "title": "" }, { "docid": "3e15f827809d43801aa7ea03f9dad594", "score": "0.4835137", "text": "func (d *DriverJunos) Lock(ds string) (*rpc.RPCReply, error) {\n\treply, err := d.Session.Exec(rpc.MethodLock(ds))\n\n\tif err != nil {\n\t\treturn reply, err\n\t}\n\n\treturn reply, nil\n}", "title": "" }, { "docid": "da712891241ed9f88dbfb49cf94a3f95", "score": "0.48305824", "text": "func (m *MutexWrapper) Lock( /*params ...bool*/ ) {\n\t/*if len(params) != 0 {\n\t\tm.lock.Lock()\n\t\tatomic.AddInt32(&m.count, 1)\n\t\treturn\n\t}\n\n\tpc := make([]uintptr, 10) // at least 1 entry needed\n\truntime.Callers(2, pc)\n\tf := runtime.FuncForPC(pc[0])\n\tfile, line := f.FileLine(pc[0])\n\ts := fmt.Sprintf(\"%s:%d %s\\n\", file, line, f.Name())\n\n\tlog.Infof(\"MutexWrapper before Lock %v %s\", atomic.LoadInt32(&m.count), s) */\n\tm.lock.Lock()\n\tatomic.AddInt32(&m.count, 1)\n\t/*log.Infof(\"MutexWrapper after Lock %v %s\", atomic.LoadInt32(&m.count), s) */\n}", "title": "" }, { "docid": "c1b64ec8eabaae5930ce1f987b622c15", "score": "0.48239145", "text": "func Lock(locks ...*TryLock) {\n\t// If no locks input, simply return\n\tif len(locks) == 0 {\n\t\treturn\n\t}\n\t// Pick the first lock as the hard lock.\n\t// Hard lock is the lock that is lock last check by other goroutine\n\t// So the hard lock is the first to check in lockHelper function\n\thardLock := 0\n\t// If the lockHelper function return -1, means that all locks are locked, return.\n\t// If not -1, the returned value is the index of the lock that cannot be locked.\n\t// assign the value to hard lock so that the locked lock will be the first to be\n\t// checked in the next iteration\n\tfor hardLock != -1 {\n\t\thardLock = lockHelper(locks, hardLock)\n\t}\n\treturn\n}", "title": "" }, { "docid": "c1ec6098a74741b36abf84027657acc6", "score": "0.4811321", "text": "func (t *batchTx) Lock() {\n\tValidateCalledInsideUnittest(t.backend.lg)\n\tt.lock()\n}", "title": "" }, { "docid": "24a9e9964c9248a2e9f123fad1299b69", "score": "0.48001605", "text": "func (conn StorageConn) Lock() {\n\tconn.actual.Lock()\n}", "title": "" }, { "docid": "540a1771bf81ba7a125d135aa1241a2e", "score": "0.47964653", "text": "func (jc *JobCreate) SetRetry(i int) *JobCreate {\n\tjc.mutation.SetRetry(i)\n\treturn jc\n}", "title": "" }, { "docid": "03711b952e663cfbff4c78877fe0f544", "score": "0.47878084", "text": "func (*Dummy) Lock() {}", "title": "" }, { "docid": "5f4581e8c857b9a295e814fa44a6642d", "score": "0.47877228", "text": "func Retry(v int) predicate.Job {\n\treturn predicate.Job(func(s *sql.Selector) {\n\t\ts.Where(sql.EQ(s.C(FieldRetry), v))\n\t})\n}", "title": "" }, { "docid": "21637040f32f53bb59675d961bb59646", "score": "0.47815123", "text": "func (b *RaftBackend) LockWith(key, value string) (physical.Lock, error) {\n\treturn &RaftLock{\n\t\tkey: key,\n\t\tvalue: []byte(value),\n\t\tb: b,\n\t}, nil\n}", "title": "" }, { "docid": "0a3f2dec3f49f759ea59e07787e6aa5b", "score": "0.47757557", "text": "func (m *MockMDServer) Lock(ctx context.Context, tlfID tlf.ID, lockID keybase1.LockID) error {\n\tm.ctrl.T.Helper()\n\tret := m.ctrl.Call(m, \"Lock\", ctx, tlfID, lockID)\n\tret0, _ := ret[0].(error)\n\treturn ret0\n}", "title": "" }, { "docid": "214a056a2d957f5dcb8e19c6d612dc70", "score": "0.476649", "text": "func (_m *MockMempool) Lock() {\n\t_m.Called()\n}", "title": "" }, { "docid": "e92ec1e51db74349b5807f92df10920a", "score": "0.47607893", "text": "func (site *Site) retryMeter(name string, meter api.Meter, power *float64) error {\n\tif meter == nil {\n\t\treturn nil\n\t}\n\n\terr := retry.Do(site.updateMeter(meter, power), retryOptions...)\n\n\tif err == nil {\n\t\tsite.log.DEBUG.Printf(\"%s power: %.0fW\", name, *power)\n\t\tsite.publish(name+\"Power\", *power)\n\t} else {\n\t\terr = fmt.Errorf(\"%s meter: %v\", name, err)\n\t\tsite.log.ERROR.Println(err)\n\t}\n\n\treturn err\n}", "title": "" }, { "docid": "e724d20fb10a3909f09f20698d4e6cfa", "score": "0.47509098", "text": "func (c *Client) retry(attempts int, sleep time.Duration, f func() ([]byte, error)) ([]byte, error) {\n\tr, err := f()\n\tif err != nil {\n\t\tif attempts--; attempts > 0 {\n\t\t\tc.error.Printf(\"Retry attempt %d of %d: %s\", c.cfg.maxRetry - attempts, c.cfg.maxRetry, err)\n\t\t\ttime.Sleep(sleep)\n\t\t\treturn c.retry(attempts, sleep, f)\n\t\t}\n\t}\n\treturn r, err\n}", "title": "" }, { "docid": "3d261512603da31c80a82377912cf07d", "score": "0.47417492", "text": "func (b *DownloadBuilder) Retry(cnt int32) *DownloadBuilder {\n\tb.object.Status.RetryCount = cnt\n\treturn b\n}", "title": "" }, { "docid": "8e4a008a5b6a8c93ce660de22c64319b", "score": "0.4740516", "text": "func (gid GoogleID) Lock(reason string) error {\n\tlog.Infow(\"RISC locking\", \"gid\", gid, \"reason\", reason)\n\tif _, err := db.Exec(\"UPDATE agent SET RISC = 1 WHERE gid = ?\", gid); err != nil {\n\t\tlog.Error(err)\n\t\treturn err\n\t}\n\treturn nil\n}", "title": "" }, { "docid": "f6b5465e2dbd762729683ffe0496b16e", "score": "0.47327396", "text": "func WithRetry(numRetries int) Option {\n\treturn func(d *Datum) {\n\t\td.numRetries = numRetries\n\t}\n}", "title": "" }, { "docid": "996a1dc9f12c8c25b7209a256090fe7c", "score": "0.4724113", "text": "func lwtLock(t *testing.T, session gocqlx.Session) {\n\terr := session.ExecStmt(`CREATE KEYSPACE IF NOT EXISTS examples WITH replication = {'class': 'SimpleStrategy', 'replication_factor': 1}`)\n\tif err != nil {\n\t\tt.Fatal(\"create keyspace:\", err)\n\t}\n\n\ttype Lock struct {\n\t\tName string\n\t\tOwner string\n\t\tTTL int64\n\t}\n\n\terr = session.ExecStmt(`CREATE TABLE examples.lock (name text PRIMARY KEY, owner text)`)\n\tif err != nil {\n\t\tt.Fatal(\"create table:\", err)\n\t}\n\n\textend := func(lock Lock) bool {\n\t\tq := qb.Update(\"examples.lock\").\n\t\t\tSet(\"owner\").\n\t\t\tWhere(qb.Eq(\"name\")).\n\t\t\tIf(qb.Eq(\"owner\")).\n\t\t\tTTLNamed(\"ttl\").\n\t\t\tQuery(session).\n\t\t\tSerialConsistency(gocql.Serial).\n\t\t\tBindStruct(lock)\n\n\t\tapplied, err := q.ExecCASRelease()\n\t\tif err != nil {\n\t\t\tt.Fatal(\"ExecCASRelease() failed:\", err)\n\t\t}\n\t\treturn applied\n\t}\n\n\tacquire := func(lock Lock) (applied bool) {\n\t\tvar prev Lock\n\n\t\tdefer func() {\n\t\t\tt.Logf(\"Acquire %+v applied %v owner %+v)\", lock, applied, prev)\n\t\t}()\n\n\t\tq := qb.Insert(\"examples.lock\").\n\t\t\tColumns(\"name\", \"owner\").\n\t\t\tTTLNamed(\"ttl\").\n\t\t\tUnique().\n\t\t\tQuery(session).\n\t\t\tSerialConsistency(gocql.Serial).\n\t\t\tBindStruct(lock)\n\n\t\tapplied, err = q.GetCASRelease(&prev)\n\t\tif err != nil {\n\t\t\tt.Fatal(\"GetCASRelease() failed:\", err)\n\t\t}\n\t\tif applied {\n\t\t\treturn true\n\t\t}\n\t\tif prev.Owner == lock.Owner {\n\t\t\treturn extend(lock)\n\t\t}\n\t\treturn false\n\t}\n\n\tconst (\n\t\tresource = \"acme\"\n\t\tttl = time.Second\n\t)\n\n\tl1 := Lock{\n\t\tName: resource,\n\t\tOwner: \"1\",\n\t\tTTL: qb.TTL(ttl),\n\t}\n\n\tl2 := Lock{\n\t\tName: resource,\n\t\tOwner: \"2\",\n\t\tTTL: qb.TTL(ttl),\n\t}\n\n\tif !acquire(l1) {\n\t\tt.Fatal(\"l1 failed to acquire lock\")\n\t}\n\tif acquire(l2) {\n\t\tt.Fatal(\"unexpectedly l2 acquired lock\")\n\t}\n\tif !acquire(l1) {\n\t\tt.Fatal(\"l1 failed to extend lock\")\n\t}\n\ttime.Sleep(time.Second)\n\tif !acquire(l2) {\n\t\tt.Fatal(\"l2 failed to acquire lock\")\n\t}\n\tif acquire(l1) {\n\t\tt.Fatal(\"unexpectedly l1 acquired lock\")\n\t}\n}", "title": "" }, { "docid": "89c4d506de2f417b5511f35cca481718", "score": "0.4710265", "text": "func Lock(awsc aws.Clients) interface{} {\n\treturn func(ctx context.Context, release *Release) (*Release, error) {\n\t\t// returns LockExistsError, LockError\n\t\treturn release, release.GrabLock(awsc.S3(nil, nil, nil))\n\t}\n}", "title": "" }, { "docid": "eb889bd4f5fe302ac6f32599bc9b8487", "score": "0.4702916", "text": "func (jc *JobCreate) SetNillableRetry(i *int) *JobCreate {\n\tif i != nil {\n\t\tjc.SetRetry(*i)\n\t}\n\treturn jc\n}", "title": "" }, { "docid": "5fb5d810530cec244988f67456fcbe0e", "score": "0.47004798", "text": "func (m *MockLock) Lock(id string, expiry time.Duration) (bool, error) {\n\tm.ctrl.T.Helper()\n\tret := m.ctrl.Call(m, \"Lock\", id, expiry)\n\tret0, _ := ret[0].(bool)\n\tret1, _ := ret[1].(error)\n\treturn ret0, ret1\n}", "title": "" }, { "docid": "35a2399a90b44d1403490688cc8faaab", "score": "0.46940506", "text": "func WithRetryParams(ctx context.Context, rp *RetryParams) context.Context {\n\treturn context.WithValue(ctx, retriesKey, rp)\n}", "title": "" }, { "docid": "31cd7462460f9d62e7d36f592773888f", "score": "0.46883455", "text": "func Lock(b []byte) error {\n\tif err := windows.VirtualLock(_getPtr(b), uintptr(len(b))); err != nil {\n\t\treturn fmt.Errorf(\"<memcall> could not acquire lock on %p, limit reached? [Err: %s]\", _getStartPtr(b), err)\n\t}\n\n\treturn nil\n}", "title": "" }, { "docid": "a552d4e36da0f9d25ba373b5c9bb3732", "score": "0.46877784", "text": "func (e *Pool) retryConnection(idx int) {\n\te.logger.Debug(fmt.Sprintf(\"Retrying to open a new connection #%d\", idx))\n\n\tfor {\n\t\te.mutex.RLock()\n\t\tclosed := e.closed\n\t\te.mutex.RUnlock()\n\n\t\t// If client is closed, cancel retry.\n\t\tif closed {\n\t\t\treturn\n\t\t}\n\n\t\t// Try to open a new connection.\n\t\tconnection, err := e.dialer.dial(idx)\n\t\tif err == nil {\n\t\t\te.mutex.Lock()\n\t\t\te.logger.Debug(fmt.Sprintf(\"Opened new connection #%d (%s)\", idx, connection.LocalAddr()))\n\t\t\te.connections[idx] = connection\n\t\t\te.listenOnCloseConnection(idx, connection)\n\t\t\te.mutex.Unlock()\n\t\t\treturn\n\t\t}\n\n\t\t// Schedule a retry between 200ms and 1s.\n\t\tretry := time.Duration((200 + rand.Intn(801))) * time.Millisecond\n\t\ttime.Sleep(retry)\n\t}\n}", "title": "" }, { "docid": "2c93ef93cdde33e9d2f928d4ae094838", "score": "0.46796435", "text": "func (r *Replica) requestLeaseLocked(timestamp hlc.Timestamp) <-chan *roachpb.Error {\n\t// Propose a Raft command to get a lease for this replica.\n\tdesc := r.mu.state.Desc\n\trepDesc, ok := desc.GetReplicaDescriptor(r.store.StoreID())\n\tif !ok {\n\t\tllChan := make(chan *roachpb.Error, 1)\n\t\tllChan <- roachpb.NewError(roachpb.NewRangeNotFoundError(r.RangeID))\n\t\treturn llChan\n\t}\n\tif r.store.IsDrainingLeadership() {\n\t\t// We've retired from active duty.\n\t\tllChan := make(chan *roachpb.Error, 1)\n\t\tllChan <- roachpb.NewError(r.newNotLeaderError(nil, r.store.StoreID(), r.mu.state.Desc))\n\t\treturn llChan\n\t}\n\treturn r.mu.pendingLeaseRequest.InitOrJoinRequest(\n\t\tr, repDesc, timestamp, desc.StartKey.AsRawKey())\n}", "title": "" }, { "docid": "1c247b4a2c75dae553e91b2e7071f7e4", "score": "0.4679015", "text": "func (r *Repo) Lock() {}", "title": "" }, { "docid": "b0a148a328c51275c1893a1ce7975de3", "score": "0.46719432", "text": "func Lock(ctx context.Context, store *coal.Store, value Value, timeout time.Duration) (bool, error) {\n\t// trace\n\tctx, span := xo.Trace(ctx, \"glut/Lock\")\n\tspan.Tag(\"timeout\", timeout.String())\n\tdefer span.End()\n\n\t// get meta\n\tmeta := GetMeta(value)\n\n\t// get base\n\tbase := value.GetBase()\n\n\t// get key\n\tkey, err := GetKey(value)\n\tif err != nil {\n\t\treturn false, err\n\t}\n\n\t// get deadline\n\tdeadline, err := GetDeadline(value)\n\tif err != nil {\n\t\treturn false, err\n\t}\n\n\t// ensure token\n\tif base.Token.IsZero() {\n\t\tbase.Token = coal.New()\n\t}\n\n\t// log key, deadline and token\n\tspan.Tag(\"key\", key)\n\tif deadline != nil {\n\t\tspan.Tag(\"deadline\", deadline.String())\n\t}\n\tspan.Tag(\"token\", base.Token.Hex())\n\n\t// check timeout\n\tif timeout == 0 {\n\t\treturn false, xo.F(\"missing timeout\")\n\t}\n\n\t// compute locked\n\tlocked := time.Now().Add(timeout)\n\tif deadline != nil && deadline.Before(locked) {\n\t\treturn false, xo.F(\"deadline before timeout\")\n\t}\n\n\t// prepare value\n\tmodel := Model{\n\t\tKey: key,\n\t\tData: nil,\n\t\tDeadline: deadline,\n\t\tLocked: &locked,\n\t\tToken: stick.P(base.Token),\n\t}\n\n\t// insert value if missing\n\tinserted, err := store.M(&Model{}).InsertIfMissing(ctx, bson.M{\n\t\t\"Key\": key,\n\t}, &model, false)\n\tif err != nil {\n\t\treturn false, err\n\t}\n\n\t// return if inserted\n\tif inserted {\n\t\treturn true, nil\n\t}\n\n\t// update value\n\tfound, err := store.M(&Model{}).UpdateFirst(ctx, &model, bson.M{\n\t\t\"$and\": []bson.M{\n\t\t\t{\n\t\t\t\t\"Key\": key,\n\t\t\t},\n\t\t\t{\n\t\t\t\t\"$or\": []bson.M{\n\t\t\t\t\t// unlocked\n\t\t\t\t\t{\n\t\t\t\t\t\t\"Token\": nil,\n\t\t\t\t\t},\n\t\t\t\t\t// lock timed out\n\t\t\t\t\t{\n\t\t\t\t\t\t\"Locked\": bson.M{\n\t\t\t\t\t\t\t\"$lt\": time.Now(),\n\t\t\t\t\t\t},\n\t\t\t\t\t},\n\t\t\t\t\t// we have the lock\n\t\t\t\t\t{\n\t\t\t\t\t\t\"Token\": base.Token,\n\t\t\t\t\t},\n\t\t\t\t},\n\t\t\t},\n\t\t},\n\t}, bson.M{\n\t\t\"$set\": bson.M{\n\t\t\t\"Deadline\": deadline,\n\t\t\t\"Locked\": locked,\n\t\t\t\"Token\": base.Token,\n\t\t},\n\t}, nil, false)\n\tif err != nil {\n\t\treturn false, err\n\t}\n\n\t// decode value\n\terr = model.Data.Unmarshal(value, meta.Coding)\n\tif err != nil {\n\t\treturn false, err\n\t}\n\n\t// validate value\n\terr = value.Validate()\n\tif err != nil {\n\t\treturn false, err\n\t}\n\n\treturn found, nil\n}", "title": "" }, { "docid": "4b5ab78a57e5c8f350548d4fac3bf540", "score": "0.46702686", "text": "func (a *ScratchAccount) Lock(_ context.Context) error {\n\ta.unlocked = false\n\treturn nil\n}", "title": "" }, { "docid": "cf3dd23514de6c50dab1cef170bf9f38", "score": "0.4663227", "text": "func (recv *RecMutex) Lock() {\n\tC.g_rec_mutex_lock((*C.GRecMutex)(recv.native))\n\n\treturn\n}", "title": "" }, { "docid": "4d15e23dcc3907e6cb2b747ed40bf362", "score": "0.46561378", "text": "func (wc *rpcClient) walletLock() error {\n\treturn wc.call(methodLock, nil, nil)\n}", "title": "" }, { "docid": "b53464d5b82ebdc2da415774a17e92a5", "score": "0.46548146", "text": "func (rl *redisLocker) Lock(ctx context.Context, key string, ttl time.Duration) RedisLockError {\n\n\tif rl == nil || rl.redis == nil {\n\t\treturn Uninitialized\n\t}\n\n\tif key == \"\" {\n\t\treturn EmptyKey\n\t}\n\n\trl.mutex.Lock()\n\tdefer rl.mutex.Unlock()\n\n\treturn rl.tryLock(ctx, key, ttl)\n}", "title": "" }, { "docid": "8d6586278c473ed1c075abee156cb031", "score": "0.46486145", "text": "func (m *MockmdServerLocal) Lock(ctx context.Context, tlfID tlf.ID, lockID keybase1.LockID) error {\n\tm.ctrl.T.Helper()\n\tret := m.ctrl.Call(m, \"Lock\", ctx, tlfID, lockID)\n\tret0, _ := ret[0].(error)\n\treturn ret0\n}", "title": "" }, { "docid": "e61fdd37391ae6ec3c77893e49503da3", "score": "0.4648051", "text": "func (_Htlc *HtlcCaller) LockPeriod(opts *bind.CallOpts) (*big.Int, error) {\n\tvar (\n\t\tret0 = new(*big.Int)\n\t)\n\tout := ret0\n\terr := _Htlc.contract.Call(opts, out, \"lockPeriod\")\n\treturn *ret0, err\n}", "title": "" }, { "docid": "5279dbee652b45e6ebc8286b6feaa5fc", "score": "0.4647584", "text": "func (sm *Mutex) Lock(ctx context.Context) {\n\tlogger := sm.LogFactory.For(ctx)\n\tsession := BaggageItem(ctx, sm.SessionBaggageKey)\n\tactiveSpan := trace.SpanFromContext(ctx)\n\tactiveSpan.SetAttributes(attribute.String(sm.SessionBaggageKey, session))\n\n\tsm.waitersLock.Lock()\n\tif waiting := len(sm.waiters); waiting > 0 && activeSpan != nil {\n\t\tlogger.Info(\n\t\t\tfmt.Sprintf(\"Waiting for lock behind %d transactions\", waiting),\n\t\t\tzap.String(\"blockers\", fmt.Sprintf(\"%v\", sm.waiters)),\n\t\t)\n\t}\n\tsm.waiters = append(sm.waiters, session)\n\tsm.waitersLock.Unlock()\n\n\tsm.realLock.Lock()\n\tsm.holder = session\n\n\tsm.waitersLock.Lock()\n\tbehindLen := len(sm.waiters) - 1\n\tbehindIDs := fmt.Sprintf(\"%v\", sm.waiters[1:]) // skip self\n\tsm.waitersLock.Unlock()\n\n\tlogger.Info(\n\t\tfmt.Sprintf(\"Acquired lock; %d transactions waiting behind\", behindLen),\n\t\tzap.String(\"waiters\", behindIDs),\n\t)\n}", "title": "" }, { "docid": "8abe91a6c2143021fe3bc23dfe1d2cc2", "score": "0.46451494", "text": "func (m *MongoBackend) Lock(info *backend.MasterInfo) error {\n\t// get the heartbeat first to see if there is one before inserting\n\toldMMI := &MongoMasterInfo{}\n\tt := time.Now()\n\tmmi := &MongoMasterInfo{\n\t\tID: MasterInfoID, // this is always the same. creates the lock\n\t\tMasterID: info.MasterID,\n\t\tVersion: info.Version,\n\t\tStartedAt: t,\n\t\tLastHeartbeat: t,\n\t}\n\n\terr := m.lock.Collection().FindId(MasterInfoID).One(oldMMI)\n\t// an error has occurred and it is not a NotFound\n\tif err != nil {\n\t\tif err == mgo.ErrNotFound {\n\t\t\t// perform an insert\n\t\t\tif err := m.lock.Collection().Insert(mmi); err != nil {\n\t\t\t\treturn fmt.Errorf(\"unable to insert initial lock: %v\", err)\n\t\t\t}\n\n\t\t\treturn nil\n\t\t}\n\n\t\terr = fmt.Errorf(\"failed to fetch current master info: %v\", err)\n\n\t\tm.log.Debug(\"attempting to refresh sessions in case of db issues\")\n\t\tm.refresh()\n\n\t\treturn err\n\t}\n\n\t// has not been long enough since the last valid heart beat\n\tif time.Since(oldMMI.LastHeartbeat) < m.heartBeatFreq*2 && oldMMI.MasterID != info.MasterID {\n\t\treturn fmt.Errorf(\"valid lock already in place\")\n\t}\n\n\tquery := bson.M{\"master_id\": oldMMI.MasterID, \"last_heartbeat\": oldMMI.LastHeartbeat}\n\n\tchange := mgo.Change{\n\t\tUpdate: mmi,\n\t\tReturnNew: true,\n\t}\n\n\tif _, err := m.lock.Collection().Find(query).Apply(change, mmi); err != nil {\n\t\terr = fmt.Errorf(\"unable to complete findModify: %v\", err)\n\t\treturn err\n\t}\n\n\treturn nil\n\n}", "title": "" }, { "docid": "70c6a0970e455eb9ef31f5560d80b22f", "score": "0.46446905", "text": "func (ls *LockServer) Lock(args *LockArgs, reply *LockReply) error {\n\tls.mu.Lock()\n\tdefer ls.mu.Unlock()\n\n\tif ls.am_primary {\n\t\tlog.Println(\"Primary: receive locking request\", args.Lockname)\n\t} else {\n\t\tlog.Println(\"Backup: receiving locking request \", args.Lockname)\n\t\tlog.Println(ls.saved)\n\t}\n\n\tif ls.am_primary == false {\n\t\tls.lockBackup(args, reply)\n\t} else {\n\t\tvar backup_reply LockReply\n\t\tok := call(ls.backup, \"LockServer.Lock\", args, &backup_reply)\n\t\tif ok == false {\n\t\t\treply.OK = tryToLock(args.Lockname, ls.locks)\n\t\t} else {\n\t\t\treply.OK = backup_reply.OK\n\t\t\tif reply.OK {\n\t\t\t\t//log.Println(\"locking \", args.Lockname, \" on primary\")\n\t\t\t\tassert(ls.locks[args.Lockname] == false)\n\t\t\t\tls.locks[args.Lockname] = true\n\t\t\t} else {\n\t\t\t\tassert(ls.locks[args.Lockname] == true)\n\t\t\t}\n\t\t}\n\t}\n\treturn nil\n}", "title": "" }, { "docid": "176951b64aa22461d0525af7334e3ac3", "score": "0.46391252", "text": "func (i *InmemHABackend) LockWith(key, value string) (physical.Lock, error) {\n\tl := &InmemLock{\n\t\tin: i,\n\t\tkey: key,\n\t\tvalue: value,\n\t}\n\treturn l, nil\n}", "title": "" }, { "docid": "f87d981dce80476e372f8e605eb7cd0f", "score": "0.46386632", "text": "func LockWithTimeout(timeout time.Duration) LockOption {\n\treturn func(lockOptions *lockOptions) {\n\t\tlockOptions.timeout = timeout\n\t}\n}", "title": "" }, { "docid": "0577aa7c830c0600a3778ec136134551", "score": "0.4636126", "text": "func (c *ConsulBackend) LockWith(key, value string) (physical.Lock, error) {\n\t// Create the lock\n\topts := &api.LockOptions{\n\t\tKey: c.path + key,\n\t\tValue: []byte(value),\n\t\tSessionName: \"Vault Lock\",\n\t\tMonitorRetries: 5,\n\t\tSessionTTL: c.sessionTTL,\n\t\tLockWaitTime: c.lockWaitTime,\n\t}\n\tlock, err := c.client.LockOpts(opts)\n\tif err != nil {\n\t\treturn nil, errwrap.Wrapf(\"failed to create lock: {{err}}\", err)\n\t}\n\tcl := &ConsulLock{\n\t\tclient: c.client,\n\t\tkey: c.path + key,\n\t\tlock: lock,\n\t\tconsistencyMode: c.consistencyMode,\n\t}\n\treturn cl, nil\n}", "title": "" }, { "docid": "cc6ec91ff62e6f8491038604946e7e49", "score": "0.4628063", "text": "func lockHelper(locks []*TryLock, hardLock int) int {\n\t// lock the hardLock\n\tlocks[hardLock].lock.Lock()\n\tfor i, lock := range locks {\n\t\t// Skip the hardLock\n\t\tif i == hardLock {\n\t\t\tcontinue\n\t\t}\n\t\t// Try to lock the lock. If cannot be locked, unlock all previously locked locks,\n\t\t// and return the blocked index.\n\t\tif !lock.TryLock() {\n\t\t\t// Previously we locked locks with index from 0 to i-1. Unlock them\n\t\t\tfor j := 0; j != i; j++ {\n\t\t\t\tlocks[j].lock.Unlock()\n\t\t\t}\n\t\t\t// If the hardLock index has not been looped, also unlock the hardLock\n\t\t\tif hardLock > i {\n\t\t\t\tlocks[hardLock].Unlock()\n\t\t\t}\n\t\t\t// return the index that is blocked for this function to be used in the\n\t\t\t// next iteration.\n\t\t\treturn i\n\t\t}\n\t}\n\t// All locks has been locked. Return -1 so that the Lock function could be returned.\n\treturn -1\n}", "title": "" }, { "docid": "7c4072b45359e2e81f13c66b9954badc", "score": "0.462704", "text": "func RetryRecordFailStatusMocked(t *testing.T, recordIn *types.Record) *types.Record {\n\n\tassert := assert.New(t)\n\n\t// wire up\n\tcs := &utils.MockConcertoService{}\n\tds, err := NewDomainService(cs)\n\tassert.Nil(err, \"Couldn't load domain service\")\n\tassert.NotNil(ds, \"Domain service not instanced\")\n\n\tmapIn := new(map[string]interface{})\n\n\t// to json\n\tdOut, err := json.Marshal(recordIn)\n\tassert.Nil(err, \"Record test data corrupted\")\n\n\t// call service\n\tcs.On(\"Put\", fmt.Sprintf(APIPathNetworkDnsRecordRetry, recordIn.ID), mapIn).Return(dOut, 499, nil)\n\trecordOut, err := ds.RetryRecord(recordIn.ID)\n\n\tassert.NotNil(err, \"We are expecting an status code error\")\n\tassert.Nil(recordOut, \"Expecting nil output\")\n\tassert.Contains(err.Error(), \"499\", \"Error should contain http code 499\")\n\n\treturn recordOut\n}", "title": "" }, { "docid": "a62149e17275959e49107f1dc7e9fd45", "score": "0.46191514", "text": "func (query Query) Lock(lock ...string) Query {\n\tif !query.repo.inTransaction {\n\t\treturn query\n\t}\n\n\tif len(lock) > 0 {\n\t\tquery.LockClause = lock[0]\n\t} else {\n\t\tquery.LockClause = \"FOR UPDATE\"\n\t}\n\n\treturn query\n}", "title": "" }, { "docid": "65b54eb8562ae175d15f2de8756aef81", "score": "0.46186534", "text": "func (recv *RecMutex) Trylock() bool {\n\tretC := C.g_rec_mutex_trylock((*C.GRecMutex)(recv.native))\n\tretGo := retC == C.TRUE\n\n\treturn retGo\n}", "title": "" }, { "docid": "1f44bae90974a29f1593197caea88561", "score": "0.46168128", "text": "func (c *Command) IncrementRetry() {\n\tc.Retries++\n}", "title": "" }, { "docid": "6640de552fcb3159660563b18b62afda", "score": "0.46167052", "text": "func (l *TryLock) Lock() error {\n\tif err := l.lock.Acquire(l.ctx, 1); err != nil {\n\t\treturn err\n\t}\n\treturn nil\n}", "title": "" }, { "docid": "28a6c25033de406acfa0f56b880ace12", "score": "0.4608118", "text": "func (tl *TryLock) Lock() {\n\ttl.lock.Lock()\n}", "title": "" }, { "docid": "271f2c377b766976b455c9ef6a221757", "score": "0.46014133", "text": "func (s *testCommitterSuite) TestAcquireFalseTimeoutLock() {\n\tatomic.StoreUint64(&transaction.ManagedLockTTL, 1000) // 1s\n\tdefer atomic.StoreUint64(&transaction.ManagedLockTTL, 3000) // restore default test value\n\n\t// k1 is the primary lock of txn1\n\tk1 := []byte(\"k1\")\n\t// k2 is a secondary lock of txn1 and a key txn2 wants to lock\n\tk2 := []byte(\"k2\")\n\n\ttxn1 := s.begin()\n\ttxn1.SetPessimistic(true)\n\t// lock the primary key\n\tlockCtx := &kv.LockCtx{ForUpdateTS: txn1.StartTS(), WaitStartTime: time.Now()}\n\terr := txn1.LockKeys(context.Background(), lockCtx, k1)\n\ts.Nil(err)\n\t// lock the secondary key\n\tlockCtx = &kv.LockCtx{ForUpdateTS: txn1.StartTS(), WaitStartTime: time.Now()}\n\terr = txn1.LockKeys(context.Background(), lockCtx, k2)\n\ts.Nil(err)\n\n\t// Heartbeats will increase the TTL of the primary key\n\n\t// wait until secondary key exceeds its own TTL\n\ttime.Sleep(time.Duration(atomic.LoadUint64(&transaction.ManagedLockTTL)) * time.Millisecond)\n\ttxn2 := s.begin()\n\ttxn2.SetPessimistic(true)\n\n\t// test no wait\n\tlockCtx = kv.NewLockCtx(txn2.StartTS(), kv.LockNoWait, time.Now())\n\terr = txn2.LockKeys(context.Background(), lockCtx, k2)\n\t// cannot acquire lock immediately thus error\n\ts.Equal(err.Error(), tikverr.ErrLockAcquireFailAndNoWaitSet.Error())\n\n\t// test for wait limited time (200ms)\n\tlockCtx = kv.NewLockCtx(txn2.StartTS(), 200, time.Now())\n\terr = txn2.LockKeys(context.Background(), lockCtx, k2)\n\t// cannot acquire lock in time thus error\n\ts.Equal(err.Error(), tikverr.ErrLockWaitTimeout.Error())\n}", "title": "" }, { "docid": "399c8a6efff1e2f976f7ab81c447b978", "score": "0.45959872", "text": "func LockWithContext(ctx context.Context, s Locker, info *LockInfo) (string, error) {\n\tdelay := time.Second\n\tmaxDelay := 16 * time.Second\n\tfor {\n\t\tid, err := s.Lock(info)\n\t\tif err == nil {\n\t\t\treturn id, nil\n\t\t}\n\n\t\tle, ok := err.(*LockError)\n\t\tif !ok {\n\t\t\t// not a lock error, so we can't retry\n\t\t\treturn \"\", err\n\t\t}\n\n\t\tif le == nil || le.Info == nil || le.Info.ID == \"\" {\n\t\t\t// If we don't have a complete LockError then there's something\n\t\t\t// wrong with the lock.\n\t\t\treturn \"\", err\n\t\t}\n\n\t\tif postLockHook != nil {\n\t\t\tpostLockHook()\n\t\t}\n\n\t\t// there's an existing lock, wait and try again\n\t\tselect {\n\t\tcase <-ctx.Done():\n\t\t\t// return the last lock error with the info\n\t\t\treturn \"\", err\n\t\tcase <-time.After(delay):\n\t\t\tif delay < maxDelay {\n\t\t\t\tdelay *= 2\n\t\t\t}\n\t\t}\n\t}\n}", "title": "" }, { "docid": "ca040db072c8910302219f12442b6032", "score": "0.45954666", "text": "func PgTryAdvisoryLockByIntegerAndInteger(ctx context.Context, db DB, p0, p1 int) (bool, error) {\n\t// call pg_catalog.pg_try_advisory_lock\n\tconst sqlstr = `SELECT * FROM pg_catalog.pg_try_advisory_lock($1, $2)`\n\t// run\n\tvar r0 bool\n\tlogf(sqlstr, p0, p1)\n\tif err := db.QueryRowContext(ctx, sqlstr, p0, p1).Scan(&r0); err != nil {\n\t\treturn false, logerror(err)\n\t}\n\treturn r0, nil\n}", "title": "" }, { "docid": "28372e96245459d13d70c97ae9897b58", "score": "0.45899418", "text": "func PgAdvisoryLockByIntegerAndInteger(ctx context.Context, db DB, p0, p1 int) error {\n\t// call pg_catalog.pg_advisory_lock\n\tconst sqlstr = `SELECT * FROM pg_catalog.pg_advisory_lock($1, $2)`\n\t// run\n\tlogf(sqlstr)\n\tif _, err := db.ExecContext(ctx, sqlstr, p0, p1); err != nil {\n\t\treturn logerror(err)\n\t}\n\treturn nil\n}", "title": "" }, { "docid": "d3600ec951e9f3499da6199aec939f54", "score": "0.4581617", "text": "func (seqno_obj *SeqnoWithLock) Lock() {\n\tseqno_obj.lock.Lock()\n}", "title": "" }, { "docid": "3dec032f059e920be88189b4b2acb0a5", "score": "0.4579079", "text": "func (c *conn) hijackLocked() (rwc net.Conn, buf *bufio.ReadWriter, err error) {\n\tif c.hijackedv {\n\t\treturn nil, nil, http.ErrHijacked\n\t}\n\tc.r.abortPendingRead()\n\n\tc.hijackedv = true\n\trwc = c.rwc\n\trwc.SetDeadline(time.Time{})\n\n\tbuf = bufio.NewReadWriter(c.bufr, bufio.NewWriter(rwc))\n\tif c.r.hasByte {\n\t\tif _, err := c.bufr.Peek(c.bufr.Buffered() + 1); err != nil {\n\t\t\treturn nil, nil, fmt.Errorf(\"unexpected Peek failure reading buffered byte: %v\", err)\n\t\t}\n\t}\n\tc.setState(rwc, http.StateHijacked)\n\treturn\n}", "title": "" }, { "docid": "20178cf6a7c3b212d718553d32e00509", "score": "0.45727396", "text": "func (r *ProjectRepo) Lock(p *Project) error {\n\t_, err := r.db.Model(p).Set(\"locked = TRUE\").WherePK().Update()\n\tif err != nil {\n\t\treturn err\n\t}\n\t_, err = r.db.Model((*Donation)(nil)).\n\t\tSet(\"locked = TRUE\").\n\t\tWhere(\"d.project_id = ?\", p.ID).\n\t\tUpdate()\n\n\treturn err\n}", "title": "" }, { "docid": "7bd56a340f0bde89f46e6c7e69d97507", "score": "0.45720458", "text": "func (manager *Manager) Lock(resource string) (*Reservation, error) {\n\tkey := redisKey(resource)\n\tval := fmt.Sprintf(\"%s-%s\", manager.owner, os.Getenv(\"JOB_ID\"))\n\n\t// Get connection\n\tconn := manager.pool.Get()\n\tdefer conn.Close()\n\n\t// Try to set the reservation\n\tsuccess, err := conn.Do(\n\t\t\"SET\", key, val,\n\t\t\"EX\", manager.TTL.Seconds(),\n\t\t\"NX\")\n\tif err != nil {\n\t\tmanager.lg.ErrorD(\"redis-error\", logger.M{\"key\": key, \"resource\": resource, \"err\": err.Error()})\n\t\treturn nil, fmt.Errorf(\"Error with SET command: %s\", err.Error())\n\t}\n\tif success == nil {\n\t\tmanager.lg.InfoD(\"reservation-exists\", logger.M{\"key\": key, \"resource\": resource})\n\t\treturn nil, fmt.Errorf(\"Reservation already exists for resource %s\", resource)\n\t}\n\n\t// Make new reservation\n\tres := &Reservation{\n\t\tkey: key,\n\t\tValue: val,\n\t\tgetConn: manager.pool.Get,\n\t\tttl: manager.TTL,\n\t\tlg: manager.lg,\n\t}\n\n\t// Set up heartbeat in background\n\tgo func() {\n\t\tfor range time.Tick(manager.Heartbeat) {\n\t\t\tif res.stopped {\n\t\t\t\tbreak\n\t\t\t}\n\t\t\t// Panic if err; no way to handle the error gracefully when this runs in the background\n\t\t\tsuccess, err := res.heartbeat()\n\t\t\tif err != nil {\n\t\t\t\tpanic(err)\n\t\t\t}\n\t\t\tif success != 1 {\n\t\t\t\tpanic(fmt.Errorf(\"Got code %d when attempting to extend reservation\", success))\n\t\t\t}\n\t\t}\n\t}()\n\n\treturn res, nil\n}", "title": "" }, { "docid": "c829f1b0d0de8f849b8ff93795aea120", "score": "0.45711517", "text": "func (m *MockMeyCoinRPCServiceClient) LockAccount(arg0 context.Context, arg1 *types.Personal, arg2 ...grpc.CallOption) (*types.Account, 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, \"LockAccount\", varargs...)\n\tret0, _ := ret[0].(*types.Account)\n\tret1, _ := ret[1].(error)\n\treturn ret0, ret1\n}", "title": "" }, { "docid": "a856e8f34f8d0916ba9ab5ae1ee40be5", "score": "0.45609826", "text": "func (retry *RetryRequest) Wrap(innerconnection uaa.Connection) uaa.Connection {\n\tretry.connection = innerconnection\n\treturn retry\n}", "title": "" }, { "docid": "1d34cd107459ee0ef232a56c7f167d2b", "score": "0.45548058", "text": "func (r *Reference) Retry(backOff *backoff.ExponentialBackOff) *Reference {\n\tresult := *r\n\tresult.retry = backOff\n\treturn &result\n}", "title": "" }, { "docid": "fd429ec2155b1c7d3440827b4664289f", "score": "0.45516947", "text": "func (l *fileLock) tryLock() (Unlocker, error) {\n\tl.mu.Lock()\n\terr := syscall.Flock(l.fd, syscall.LOCK_EX|syscall.LOCK_NB)\n\tswitch err {\n\tcase syscall.EWOULDBLOCK:\n\t\tl.mu.Unlock()\n\t\treturn nopUnlocker{}, nil\n\tcase nil:\n\t\treturn l, nil\n\tdefault:\n\t\tl.mu.Unlock()\n\t\treturn nil, err\n\t}\n}", "title": "" }, { "docid": "b297bae018f498a7d81cfd9f8381e914", "score": "0.4548072", "text": "func (_m *Mempool) Lock() {\n\t_m.Called()\n}", "title": "" }, { "docid": "2a27df72739bc3128fce11ee9a35e2a2", "score": "0.45467228", "text": "func TestTryRWMutexBasicTryLock(t *testing.T) {\n\t// Lock and then TryLock.\n\tvar tm TryRWMutex\n\ttm.Lock()\n\tif tm.TryLock() {\n\t\tt.Error(\"TryLock should have failed\")\n\t}\n\ttm.Unlock()\n\n\ttm.Lock()\n\ttm.Unlock()\n\n\t// TryLock and then TryLock.\n\tif !tm.TryLock() {\n\t\tt.Error(\"Could not get a blank lock\")\n\t}\n\tif tm.TryLock() {\n\t\tt.Error(\"should not have been able to get the lock\")\n\t}\n\ttm.Unlock()\n}", "title": "" }, { "docid": "54613655ae83f5be16ca0b1402706495", "score": "0.45463675", "text": "func (m *MockScanner) Lock(arg0 context.Context, arg1 string) error {\n\tm.ctrl.T.Helper()\n\tret := m.ctrl.Call(m, \"Lock\", arg0, arg1)\n\tret0, _ := ret[0].(error)\n\treturn ret0\n}", "title": "" }, { "docid": "8cb1d8480a78479f0c7387e9836e2f21", "score": "0.4544082", "text": "func (t *TestKV) Lock(ctx context.Context, key string) (func(), error) {\n\tif err := ctx.Err(); err != nil {\n\t\treturn func() {}, err\n\t}\n\n\tt.mu.Lock()\n\tlocker, exists := t.locks[key]\n\tif !exists {\n\t\tlocker = new(sync.Mutex)\n\t\tt.locks[key] = locker\n\t}\n\tt.mu.Unlock()\n\n\tlocker.Lock()\n\n\treturn locker.Unlock, nil\n}", "title": "" }, { "docid": "a4f03878589142ebae6639873e5b9601", "score": "0.45423737", "text": "func (m *RWMutex) Lock() {\n\tvar caller string\n\tif _, file, line, ok := runtime.Caller(1); ok {\n\t\tcaller = fmt.Sprintf(\"%s:%d\", file, line)\n\t}\n\tif m.log {\n\t\tastilog.Debugf(\"Requesting lock for %s at %s\", m.name, caller)\n\t}\n\tm.mutex.Lock()\n\tif m.log {\n\t\tastilog.Debugf(\"Lock acquired for %s at %s\", m.name, caller)\n\t}\n\tm.lastSuccessfulLockCaller = caller\n}", "title": "" }, { "docid": "d476ebe478bd0536a60bb9527c9b9e21", "score": "0.45375314", "text": "func (l *Mutex) Lock() (err error) {\n\tfor {\n\t\t// Check context error\n\t\tif l.ctx.Err() != nil {\n\t\t\terr = errors.Wrap(err, \"astiredis: context error\")\n\t\t\treturn\n\t\t}\n\n\t\t// Try to set the key\n\t\tvar ok bool\n\t\tif ok, err = l.c.SetNX(l.key, true, l.timeout); err != nil {\n\t\t\terr = errors.Wrapf(err, \"astiredis: setting mutex key %s failed\", l.key)\n\t\t\treturn\n\t\t}\n\n\t\t// Key already exists\n\t\tif !ok {\n\t\t\tastitime.Sleep(l.ctx, l.sleep)\n\t\t\tcontinue\n\t\t}\n\t\treturn\n\t}\n}", "title": "" }, { "docid": "5654ae096648ae913df57739d38360a8", "score": "0.4535441", "text": "func (s *Storage) Lock(resource string, gid uint64, locks ...meta.LockKey) (bool, string, error) {\n\ts.lock.Lock()\n\tdefer s.lock.Unlock()\n\n\tfor _, lock := range locks {\n\t\tkey := fmt.Sprintf(\"%s_%s\", resource, lock.Value())\n\t\tif value, ok := s.locks[key]; ok && value != gid {\n\t\t\treturn false, fmt.Sprintf(\"conflict with %d\", value), nil\n\t\t}\n\t}\n\n\tfor _, lock := range locks {\n\t\tkey := fmt.Sprintf(\"%s_%s\", resource, lock.Value())\n\t\ts.locks[key] = gid\n\t}\n\n\treturn true, \"\", nil\n}", "title": "" }, { "docid": "017518bb0d658c07459315e0b24e7852", "score": "0.45308372", "text": "func (rg *RecordGenerator) loadWrap(ip string, port string) (state.State, error) {\n\tvar err error\n\tvar sj state.State\n\n\tlogging.VeryVerbose.Println(\"reloading from master \" + ip)\n\tsj, err = rg.loadFromMaster(ip, port)\n\tif err != nil {\n\t\treturn state.State{}, err\n\t}\n\tif rip := leaderIP(sj.Leader); rip != ip {\n\t\tlogging.VeryVerbose.Println(\"Warning: master changed to \" + ip)\n\t\tsj, err = rg.loadFromMaster(rip, port)\n\t\treturn sj, err\n\t}\n\treturn sj, nil\n}", "title": "" }, { "docid": "dd136d5a7bbcac113c758bcdeec82c34", "score": "0.4523907", "text": "func (d *DMap) LockWithTimeout(key string, timeout, deadline time.Duration) (*LockContext, error) {\n\treq := protocol.NewDMapMessage(protocol.OpLockWithTimeout)\n\treq.SetDMap(d.name)\n\treq.SetKey(key)\n\treq.SetExtra(protocol.LockWithTimeoutExtra{\n\t\tTimeout: timeout.Nanoseconds(),\n\t\tDeadline: deadline.Nanoseconds(),\n\t})\n\tresp, err := d.request(req)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\terr = checkStatusCode(resp)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\tctx := &LockContext{\n\t\tname: d.name,\n\t\tkey: key,\n\t\ttoken: resp.Value(),\n\t\tdmap: d,\n\t}\n\treturn ctx, nil\n}", "title": "" }, { "docid": "c93733ae35f676acdf714eb72ec2fc80", "score": "0.45211864", "text": "func callmlock(_p0 uintptr, _lenp0 int) (r1 uintptr, e1 Errno) {\n\tr1 = uintptr(C.mlock(C.uintptr_t(_p0), C.size_t(_lenp0)))\n\te1 = syscall.GetErrno()\n\treturn\n}", "title": "" }, { "docid": "65090d8f0fac6d24cd03648e53a19100", "score": "0.4520682", "text": "func (_Proxy *ProxyCallerSession) LockAmount(arg0 common.Address) (*big.Int, error) {\n\treturn _Proxy.Contract.LockAmount(&_Proxy.CallOpts, arg0)\n}", "title": "" }, { "docid": "6555f766e2ae2c444b5b2329cd74c084", "score": "0.45206717", "text": "func (s *Store) Lock(ctx context.Context, key int, blocking bool) (locked bool, _ UnlockFunc, err error) {\n\tctx, endObservation := s.operations.lock.With(ctx, &err, observation.Args{LogFields: []log.Field{\n\t\tlog.Int(\"key\", key),\n\t\tlog.Bool(\"blocking\", blocking),\n\t}})\n\tdefer func() {\n\t\tendObservation(1, observation.Args{LogFields: []log.Field{\n\t\t\tlog.Bool(\"locked\", locked),\n\t\t}})\n\t}()\n\n\tif blocking {\n\t\tlocked, err = s.lock(ctx, key)\n\t} else {\n\t\tlocked, err = s.tryLock(ctx, key)\n\t}\n\n\tif err != nil || !locked {\n\t\treturn false, nil, err\n\t}\n\n\tunlock := func(err error) error {\n\t\tif unlockErr := s.unlock(key); unlockErr != nil {\n\t\t\terr = multierror.Append(err, unlockErr)\n\t\t}\n\n\t\treturn err\n\t}\n\n\treturn true, unlock, nil\n}", "title": "" }, { "docid": "75fdd43b95e69fdca7fc6b04c3a459e0", "score": "0.45197418", "text": "func DoWithRetry(actionDescription string, maxRetries int, sleepBetweenRetries time.Duration, logger *logrus.Entry, logLevel logrus.Level, action func() error) error {\n\tfor i := 0; i <= maxRetries; i++ {\n\t\tlogger.Logf(logLevel, actionDescription)\n\n\t\terr := action()\n\t\tif err == nil {\n\t\t\treturn nil\n\t\t}\n\n\t\tif _, isFatalErr := err.(FatalError); isFatalErr {\n\t\t\treturn err\n\t\t}\n\n\t\tlogger.Errorf(\"%s returned an error: %s. Sleeping for %s and will try again.\", actionDescription, err.Error(), sleepBetweenRetries)\n\t\ttime.Sleep(sleepBetweenRetries)\n\t}\n\n\treturn MaxRetriesExceeded{Description: actionDescription, MaxRetries: maxRetries}\n}", "title": "" }, { "docid": "d7eb2088e3b2f02792699123509de1ed", "score": "0.45167416", "text": "func (this *RavenReceiver) lockme() error {\n\tif this.lock == nil {\n\t\treturn nil\n\t}\n\t//\tfmt.Println(\"lock\")\n\tr := time.Now().Format(time.RFC3339)\n\tif err := this.lock.Acquire(r); err != nil {\n\t\treturn err\n\t}\n\treturn nil\n}", "title": "" }, { "docid": "670026c5fd152304abd64427c36164fa", "score": "0.4515137", "text": "func (l* ShardedLock) TryLock(key uint32) bool {\n idx := key % NShards\n loc := &l.shards[idx]\n swapped := atomic.CompareAndSwapUint32(loc, 0, 1)\n return swapped\n}", "title": "" }, { "docid": "b2dcaecd32677044935b223b6c6bd35f", "score": "0.45103282", "text": "func Lock(m *rwMutex) {\n\tdone := make(chan struct{})\n\tticker := time.NewTicker(time.Duration(1) * time.Second)\n\tstart := time.Now()\n\tgo func() {\n\t\tm.RWMutex.Lock()\n\t\tclose(done)\n\t}()\n\tselect {\n\tcase <-done:\n\t\tbreak\n\tcase <-ticker.C:\n\t\td := start.Sub(time.Now())\n\t\tlogger.Printf(\"Warning: Blocked for %d seconds waiting for lock\\n\", int(d.Seconds()))\n\t}\n}", "title": "" }, { "docid": "1a7da610465420b771962675ab0ec0bf", "score": "0.45097896", "text": "func TryLock[T interface{ TryLock() bool }](ctx context.Context, locker T, pollInterval time.Duration) (e error) {\n\tvar ticker = time.NewTicker(pollInterval)\n\tdefer ticker.Stop()\n\tfor range ticker.C {\n\t\tif e = ctx.Err(); e != nil {\n\t\t\tbreak\n\t\t}\n\t\tif locker.TryLock() {\n\t\t\tbreak\n\t\t}\n\t}\n\treturn\n}", "title": "" } ]
fdfa90cab4c382536fc712b059e83ca1
SetBody adds the body to the activate sim params
[ { "docid": "3c83ce9d7f0d83c4344ec2336ae43267", "score": "0.81365776", "text": "func (o *ActivateSimParams) SetBody(body *models.ActivateSimRequest) {\n\to.Body = body\n}", "title": "" } ]
[ { "docid": "96d250dfbbe728acdf82da7d19ca3b42", "score": "0.7334431", "text": "func (o *ActivateSimParams) WithBody(body *models.ActivateSimRequest) *ActivateSimParams {\n\to.SetBody(body)\n\treturn o\n}", "title": "" }, { "docid": "952d9ba91fe2362a5f67ceeddb3ef5d6", "score": "0.67812765", "text": "func (o *DevicesExecuteModuleComponentCommandParams) SetBody(body *models.DeviceCommand) {\n\to.Body = body\n}", "title": "" }, { "docid": "b9e7612b4281bb5ec6da6ea2c289d586", "score": "0.6644207", "text": "func (o *AddInvokeFunctionParams) SetBody(body *models.ModelAddInvokeFunctionStageRequest) {\n\to.Body = body\n}", "title": "" }, { "docid": "3e88812f162b69fc9e6d4fea41792790", "score": "0.655905", "text": "func (o *CreateApplicationsWebParams) SetBody(body *dynatrace.WebApplicationConfig) {\n\to.Body = body\n}", "title": "" }, { "docid": "159bffce2c49b4f9ea061860534a5f9e", "score": "0.65183616", "text": "func (o *CreateAndConfirmPreregParams) SetBody(body *models.DomainPrereg) {\n\to.Body = body\n}", "title": "" }, { "docid": "76080b63613ad269b988842ba803e833", "score": "0.6507062", "text": "func (o *PerformPreventionPoliciesActionParams) SetBody(body *models.MsaEntityActionRequestV2) {\n\to.Body = body\n}", "title": "" }, { "docid": "da3a2ad5da86e57ff6aa74d2a05a4e06", "score": "0.6491509", "text": "func (o *ProtectedDryRunTxsParams) SetBody(body *models.DryRunInput) {\n\to.Body = body\n}", "title": "" }, { "docid": "c3f0bb07637893f63ee6f34c75e85ae0", "score": "0.644002", "text": "func (o *PostWorkflowsParams) SetBody(body *models.WorkflowIntentInput) {\n\to.Body = body\n}", "title": "" }, { "docid": "88c905a1df14a44f807a14af8b7180a6", "score": "0.64387244", "text": "func (o *PostHyperflexServerModelsParams) SetBody(body *models.HyperflexServerModel) {\n\to.Body = body\n}", "title": "" }, { "docid": "e14b2a7f04ea1d7623476ccd495bf0bd", "score": "0.64219016", "text": "func (o *UpdateUserEntitlementsParams) SetBody(body *models.JSONPatchDocument) {\n\to.Body = body\n}", "title": "" }, { "docid": "a750391ce24b97dd5304304a6015826f", "score": "0.6416321", "text": "func (o *ModifyAddressParams) SetBody(body *models.ModifyAddressRequest) {\n\to.Body = body\n}", "title": "" }, { "docid": "88e06333ef66befd1c6afc76a1dd3ce6", "score": "0.640245", "text": "func (o *CreateCreditParams) SetBody(body *kbmodel.Credit) {\n\to.Body = body\n}", "title": "" }, { "docid": "b7f7753d2ad4487838d0d6b1708cf1fc", "score": "0.63908005", "text": "func (o *CreateServiceMqtTracingImsEntryQueueParams) SetBody(body *dynatrace.IbmMQImsEntryQueue) {\n\to.Body = body\n}", "title": "" }, { "docid": "37ecad67c040f45689cd9b4e4d9a7650", "score": "0.6378439", "text": "func (o *PostStackInWorkspaceV4InternalParams) SetBody(body *model.StackV4Request) {\n\to.Body = body\n}", "title": "" }, { "docid": "b649fe9a56656e7a3de31613304d423c", "score": "0.6362381", "text": "func (o *ReconfigureNatParams) SetBody(body *models.ReconfigureComputeNatSpecification) {\n\to.Body = body\n}", "title": "" }, { "docid": "aa4f61d493b2dafafacc2c5635920e69", "score": "0.6336177", "text": "func (o *TournamentServiceUpdateParams) SetBody(body *models.APITournament) {\n\to.Body = body\n}", "title": "" }, { "docid": "98a92ffb5ad1c97b0a240941fd2103d3", "score": "0.6335566", "text": "func (o *UpdateSteamIAPConfigParams) SetBody(body *platformclientmodels.SteamIAPConfigRequest) {\n\to.Body = body\n}", "title": "" }, { "docid": "fa536d6377d58d68a923aeabeba478f9", "score": "0.63279396", "text": "func (o *GenerateDryRunInvoiceParams) SetBody(body *kbmodel.InvoiceDryRun) {\n\to.Body = body\n}", "title": "" }, { "docid": "11dd9d23e11f8c79287ba08d0897db8e", "score": "0.63274664", "text": "func (c *CarBody) SetBody() {\n\tfmt.Fprintf(outputWriter, \" CarBody - SetBody\\n\")\n}", "title": "" }, { "docid": "3a49b71672721f13412bb73591af8545", "score": "0.632443", "text": "func (o *RTRExecuteCommandParams) SetBody(body *models.DomainCommandExecuteRequest) {\n\to.Body = body\n}", "title": "" }, { "docid": "9e00dae122e342adc7d4a809347df5c0", "score": "0.6270298", "text": "func (o *PatchNetscanParams) SetBody(body models.Netscan) {\n\to.Body = body\n}", "title": "" }, { "docid": "6afeb733a3ef610fa78052599ab0081d", "score": "0.62539446", "text": "func (o *ApproveParams) SetBody(body string) {\n\to.Body = body\n}", "title": "" }, { "docid": "09269642b1f0a5194ed73aa2f8e03d25", "score": "0.62383336", "text": "func SetBody(e Element) {\n\tgo func() {\n\t\tnewBody <- e\n\t}()\n}", "title": "" }, { "docid": "fc94c8835766d264b986afd1d0a1da0d", "score": "0.6208434", "text": "func (o *AddCallerIDParams) SetBody(body *models.SmsCallerIDRequest) {\n\to.Body = body\n}", "title": "" }, { "docid": "c5875da2e5a62e818c9a13b8e8f6e50f", "score": "0.6201481", "text": "func (o *PostAPIPublicV1IncidentsRerouteParams) SetBody(body *models.RerouteCollection) {\n\to.Body = body\n}", "title": "" }, { "docid": "cb939277c563759f83d8cddf415067d5", "score": "0.61743546", "text": "func (o *AddQANPostgreSQLPgStatementsAgentParams) SetBody(body AddQANPostgreSQLPgStatementsAgentBody) {\n\to.Body = body\n}", "title": "" }, { "docid": "3a78b070a6354d36092a6db9e9d370bc", "score": "0.6172479", "text": "func (o *PerformActionV2Params) SetBody(body *models.MsaEntityActionRequestV2) {\n\to.Body = body\n}", "title": "" }, { "docid": "6a96a8cc09524e69ff789f63aaf764c4", "score": "0.616839", "text": "func (o *RepoEditGitHookParams) SetBody(body *models.EditGitHookOption) {\n\to.Body = body\n}", "title": "" }, { "docid": "fbb14ed1abd813e19671c0182ee5f13c", "score": "0.61634856", "text": "func (c *Card) SetBody(body Component) {\n\tc.Config.Body = body\n}", "title": "" }, { "docid": "f1e974b7489cecfd9533dfa5a58bea2b", "score": "0.6150493", "text": "func (o *NodesPostSSHByIDParams) SetBody(body *models.SSHIbmServiceIbm) {\n\to.Body = body\n}", "title": "" }, { "docid": "f77afe8e6f28aad55afe871ec26367b8", "score": "0.61481446", "text": "func (o *LinkInventoryModelWithDriverVersionParams) SetBody(body *models.LinkInventoryModel2DriverVersion) {\n\to.Body = body\n}", "title": "" }, { "docid": "46c33d1e14292e8a9fb3896618f9637c", "score": "0.61463153", "text": "func (o *ValidateUpdateServiceMqtTracingImsEntryQueueParams) SetBody(body *dynatrace.IbmMQImsEntryQueue) {\n\to.Body = body\n}", "title": "" }, { "docid": "cd549fa597df9b75f6aa7565ebdf29f5", "score": "0.6146291", "text": "func (o *PatchPciDevicesMoidParams) SetBody(body *models.PciDevice) {\n\to.Body = body\n}", "title": "" }, { "docid": "39275112778519e2e131f13c69571f93", "score": "0.6119476", "text": "func (o *PostDevicesRefreshParams) SetBody(body *models.Model73) {\n\to.Body = body\n}", "title": "" }, { "docid": "5b729861f2a76e9a4594a877d86121b9", "score": "0.61066914", "text": "func (o *WeaviateThingsPropertiesUpdateParams) SetBody(body models.MultipleRef) {\n\to.Body = body\n}", "title": "" }, { "docid": "d19fab03627bff60909d22cb7f76c1cc", "score": "0.6103931", "text": "func (o *CreateModelVersionParams) SetBody(body *service_model.V1ModelVersion) {\n\to.Body = body\n}", "title": "" }, { "docid": "38b7ec46ae6bba60dce28ce2009eea6d", "score": "0.61020815", "text": "func (o *PostIamAPIKeysMoidParams) SetBody(body *models.IamAPIKey) {\n\to.Body = body\n}", "title": "" }, { "docid": "309e8187af18cb3b571810f7f92075b8", "score": "0.6100523", "text": "func (o *UpdateManagementZoneParams) SetBody(body *dynatrace.ManagementZone) {\n\to.Body = body\n}", "title": "" }, { "docid": "da1fa28fafe830077edf359000fc856f", "score": "0.6095163", "text": "func SetBody(aspects ...Aspect) {\n\tbody := js.Global.Get(\"document\").Call(\"createElement\", \"body\")\n\tGroup(aspects...).Apply(body, 0, 1)\n\tjs.Global.Get(\"document\").Set(\"body\", body)\n}", "title": "" }, { "docid": "c345ed1db05036b3c56aec1dd6758363", "score": "0.60930943", "text": "func (o *AddFaxSmsNotificationParams) SetBody(body *models.AddFaxSmsNotificationRequest) {\n\to.Body = body\n}", "title": "" }, { "docid": "b2554498591365002a8f2da3ce91a83b", "score": "0.6091053", "text": "func (a *Aidi) SetBody(body io.Reader) *Aidi {\n\ta.body = body\n\treturn a\n}", "title": "" }, { "docid": "3a032d9975d1d9149f49866d31d0ba55", "score": "0.607806", "text": "func (o *CreateanewUpnRewriteSetParams) SetBody(body string) {\n\to.Body = body\n}", "title": "" }, { "docid": "a81f76d49f464ab70ccf01e9139cdc98", "score": "0.6068301", "text": "func (o *ConfigUpdateParams) SetBody(body *models.ConfigSpec) {\n\to.Body = body\n}", "title": "" }, { "docid": "ae5e60ccb8a486de68fc4fa8df1f2adc", "score": "0.605987", "text": "func (o *UpdateCommodityGroupParams) SetBody(body *models.CommodityGroup) {\n\to.Body = body\n}", "title": "" }, { "docid": "0df439e3a6f2e5ba9d261cf1d61b95f7", "score": "0.60338575", "text": "func (r *HttpRequest) SetBody(body interface{}) *HttpRequest {\n\tr.impl.SetBody(body)\n\treturn r\n}", "title": "" }, { "docid": "647d7a60347c5063e28dd41d6d8eed0c", "score": "0.6033569", "text": "func (o *SetRunnerRolesParams) SetBody(body *models.RunnerRolesInfo) {\n\to.Body = body\n}", "title": "" }, { "docid": "82c0f01dc6662066bf34713eb1593e91", "score": "0.6029507", "text": "func (o *QueryByWiqlParams) SetBody(body *models.Wiql) {\n\to.Body = body\n}", "title": "" }, { "docid": "88597dcf827b17b00d3197bc93b8a8bb", "score": "0.6016922", "text": "func (o *SendJobCommandParams) SetBody(body SendJobCommandBody) {\n\to.Body = body\n}", "title": "" }, { "docid": "d8092a7401b1cd408c1baad00656d563", "score": "0.6012935", "text": "func (o *RestoreWebhooksParams) SetBody(body []string) {\n\to.Body = body\n}", "title": "" }, { "docid": "a6e83fb36db52f778bfb89fb8e4289c8", "score": "0.60085136", "text": "func (o *CustomerGatewaySetAddressHistoryParams) SetBody(body *models.V1SetAddressHistoryRequest) {\n\to.Body = body\n}", "title": "" }, { "docid": "f42ab150b9be665b32f73e59e6afc16e", "score": "0.60056275", "text": "func (o *CreateManagedNamespaceParams) SetBody(body *models.Namespace) {\n\to.Body = body\n}", "title": "" }, { "docid": "a967ae9434e19da1663b780877070254", "score": "0.60051936", "text": "func (o *AddCustomerOrdersParams) SetBody(body []*models.CustomerOrder) {\n\to.Body = body\n}", "title": "" }, { "docid": "84de14640457da72062ad789517aee39", "score": "0.59900534", "text": "func (tc *TokenCreate) SetBody(s string) *TokenCreate {\n\ttc.mutation.SetBody(s)\n\treturn tc\n}", "title": "" }, { "docid": "faa0ae5f967cd96ca82da2a94b989268", "score": "0.5982626", "text": "func (o *CreateDefaultConstraintParams) SetBody(body *models.ConstraintBody) {\n\to.Body = body\n}", "title": "" }, { "docid": "75eb77f93842afe38556154eda0e7cfc", "score": "0.59763724", "text": "func (o *UpdateSoftwarePackageParams) SetBody(body *models.UpdateSoftwarePackage) {\n\to.Body = body\n}", "title": "" }, { "docid": "8ab95831624b2140e074ed5cb685c7bb", "score": "0.5943796", "text": "func (o *UpdateBuildParams) SetBody(body *models.Build) {\n\to.Body = body\n}", "title": "" }, { "docid": "df5b5c2d1f2a3cf6373cc291cdf4866f", "score": "0.59377235", "text": "func (o *TransferVersionParams) SetBody(body *service_model.V1ProjectVersion) {\n\to.Body = body\n}", "title": "" }, { "docid": "580ccb1350380e1c72c1787a5edadd46", "score": "0.5930086", "text": "func (o *RenderMarkdownRawParams) SetBody(body string) {\n\to.Body = body\n}", "title": "" }, { "docid": "c4f7f88f62da8fb196041b8a9f970392", "score": "0.5923552", "text": "func (o *PostManagementControllersMoidParams) SetBody(body *models.ManagementController) {\n\to.Body = body\n}", "title": "" }, { "docid": "78f73076c8fdb855088c0ca506d6cb7d", "score": "0.5923452", "text": "func (o *PatchSMTPPoliciesMoidParams) SetBody(body *models.SMTPPolicy) {\n\to.Body = body\n}", "title": "" }, { "docid": "d491fa5a8a67f5ad6586c44e3e4ea09a", "score": "0.59173", "text": "func (o *ImportProcessTemplateParams) SetBody(body string) {\n\to.Body = body\n}", "title": "" }, { "docid": "8cb369fa09d61cfa011fe11ce58bfc7d", "score": "0.5915301", "text": "func (o *PostWorkflowWorkflowDefinitionsMoidParams) SetBody(body *models.WorkflowWorkflowDefinition) {\n\to.Body = body\n}", "title": "" }, { "docid": "80f89ad85257194f038b0c9ab18b8040", "score": "0.5915173", "text": "func (o *PostStoragePureArraysMoidParams) SetBody(body *models.StoragePureArray) {\n\to.Body = body\n}", "title": "" }, { "docid": "b2e51d1e50b74c32fee7995fd57a316c", "score": "0.5914814", "text": "func (o *UpdateAccountParams) SetBody(body *kbmodel.Account) {\n\to.Body = body\n}", "title": "" }, { "docid": "c7101fe6842bd47886e273d89abfd8a1", "score": "0.5906787", "text": "func (o *ChangeDeviceSettingsParams) SetBody(body *models.ChangeDeviceRequest) {\n\to.Body = body\n}", "title": "" }, { "docid": "c88caa86a0c9cb034d6c7335411259bd", "score": "0.58643895", "text": "func (o *UpdateAppleIAPConfigParams) SetBody(body *platformclientmodels.AppleIAPConfigRequest) {\n\to.Body = body\n}", "title": "" }, { "docid": "6e982751c34e08d1b596c5ad81e2628a", "score": "0.58632195", "text": "func (o *AddRemoteRDSNodeParams) SetBody(body AddRemoteRDSNodeBody) {\n\to.Body = body\n}", "title": "" }, { "docid": "8d27587051fb7a75460c3ed782ab6da6", "score": "0.58378863", "text": "func (o *AddPointOfSaleEndOfDayStatementsParams) SetBody(body []*models.EndOfDayStatement) {\n\to.Body = body\n}", "title": "" }, { "docid": "fa0cc6dacc891a1305918a719a29f40f", "score": "0.5819812", "text": "func (o *CreateNonSITAddressUpdateRequestParams) SetBody(body *primemessages.CreateNonSITAddressUpdateRequest) {\n\to.Body = body\n}", "title": "" }, { "docid": "f50f3679fa119f6cd840aeb3fd1b4fbf", "score": "0.5814195", "text": "func (o *HooksPatchByIDParams) SetBody(body *models.Hooks20HookBase) {\n\to.Body = body\n}", "title": "" }, { "docid": "2445f7b23a79281219cbd050a2fad41b", "score": "0.5811251", "text": "func (o *DeleteExternalSystemCallsParams) SetBody(body []*models.ExternalSystemCall) {\n\to.Body = body\n}", "title": "" }, { "docid": "0249c42df7c3bfa9ea4d6a4ffd7d6850", "score": "0.58106714", "text": "func (o *PostAPINotesSubdomainTargetNameRootDomainNameSubdomainNameParams) SetBody(body *models.NoteDto) {\n\to.Body = body\n}", "title": "" }, { "docid": "f6c8d81fc30c6bc9d023750919377568", "score": "0.5805649", "text": "func (o *DomainPreregListParams) SetBody(body *models.Query) {\n\to.Body = body\n}", "title": "" }, { "docid": "c5992f9201d3cbd5eed16e912721c8da", "score": "0.5792311", "text": "func (o *ResendOrganizationInvitationParams) SetBody(body *service_model.V1OrganizationMember) {\n\to.Body = body\n}", "title": "" }, { "docid": "bed45e9bc9f0193ba72c0d64973ad64e", "score": "0.5790617", "text": "func (o *ValidateCreateRemoteEnvironmentParams) SetBody(body *dynatrace.RemoteEnvironmentConfigDto) {\n\to.Body = body\n}", "title": "" }, { "docid": "5746493744859d4c74b52198acd7d333", "score": "0.5781174", "text": "func (o *PatchSDTByIDParams) SetBody(body models.SDT) {\n\to.Body = body\n}", "title": "" }, { "docid": "5712ebf073a7b4ccd2fcb86128369aab", "score": "0.5778063", "text": "func (o *CreateanewCFSourceSetParams) SetBody(body *models.CreateanewCFSourceSetRequest) {\n\to.Body = body\n}", "title": "" }, { "docid": "e0bd49cb00a8a04f9764f9eae28e3254", "score": "0.5767272", "text": "func (o *IntakebusinessCaseidPUT8Params) SetBody(body *models.Intake3) {\n\to.Body = body\n}", "title": "" }, { "docid": "75b6aca561bf8e938c8e52dfd052cad4", "score": "0.57454276", "text": "func (o *ModifyClusterAttributesParams) SetBody(body *models.OpenpitrixModifyClusterAttributesRequest) {\n\to.Body = body\n}", "title": "" }, { "docid": "954ed0d46304c79122aaf4fec8ad1533", "score": "0.574061", "text": "func (o *ReplaceChangeaspecificPbxDeviceParams) SetBody(body *Replace1changeaspecificPbxDeviceRequest) {\n\to.Body = body\n}", "title": "" }, { "docid": "fa56ba2534375269ae087645d1515996", "score": "0.57397974", "text": "func (o *UpdateOrganizationalUnitDayRatingsParams) SetBody(body []*models.DayRating) {\n\to.Body = body\n}", "title": "" }, { "docid": "f29b8a1d9cab2bc467376a9ef8179e83", "score": "0.5725601", "text": "func (o *ServiceInstanceUpdateParams) SetBody(body *models.ServiceInstanceUpdateRequest) {\n\to.Body = body\n}", "title": "" }, { "docid": "bdb4645a4440f4a0d952ed58ee338ef7", "score": "0.57236415", "text": "func (o *GrantUserRoleIdsParams) SetBody(body *models.DomainRoleIDs) {\n\to.Body = body\n}", "title": "" }, { "docid": "443c74491116f6387b0d6e9e39f46807", "score": "0.572214", "text": "func (o *SubmitParameterContextUpdateParams) SetBody(body *models.ParameterContextEntity) {\n\to.Body = body\n}", "title": "" }, { "docid": "2ece2b97fde1343eed860ba49e5e42a6", "score": "0.5714374", "text": "func (r *Request) SetBody(b interface{}) *Request {\n\tr.Body = b\n\treturn r\n}", "title": "" }, { "docid": "30a44e39ba8b18de10a1a23f5aeef9b5", "score": "0.57142", "text": "func (o *PatchSecretStorePathToSecretParams) SetBody(body *models.Secret) {\n\to.Body = body\n}", "title": "" }, { "docid": "5cc53f15da046c8fb2df884c1e26ad83", "score": "0.5700577", "text": "func (img *ReadImageOutput) SetBody(body []byte) *ReadImageOutput {\n\timg.Body = body\n\treturn img\n}", "title": "" }, { "docid": "66d1551e50d3433ddf1bc6a652abb038", "score": "0.56879234", "text": "func (p *Packet) SetBody(body interface{}) {\n\tp.body = body\n}", "title": "" }, { "docid": "4680c704c0c35acf06fbb075911d96b1", "score": "0.5686424", "text": "func (u *TokenUpsertOne) SetBody(v string) *TokenUpsertOne {\n\treturn u.Update(func(s *TokenUpsert) {\n\t\ts.SetBody(v)\n\t})\n}", "title": "" }, { "docid": "3e9689d9d998c12d7aab86d5519391b8", "score": "0.56735927", "text": "func (o *PostDocumentPaymentsParams) SetBody(body *models.DocumentPayment) {\n\to.Body = body\n}", "title": "" }, { "docid": "7e674b0c72d16476d7f674ff394f90b4", "score": "0.5671767", "text": "func (o *CopyProtectedEntityParams) SetBody(body *models.CopyParameters) {\n\to.Body = body\n}", "title": "" }, { "docid": "2c90d8ac4bcd59dba239305f14a87ca3", "score": "0.5665526", "text": "func (r *Request) SetBody(body io.Reader) *Request {\n\tr.body = body\n\treturn r\n}", "title": "" }, { "docid": "4b34d3094c223261375ba491d9715485", "score": "0.5655726", "text": "func (o *ChangeSubscriptionPlanParams) SetBody(body *kbmodel.Subscription) {\n\to.Body = body\n}", "title": "" }, { "docid": "c2ed4b28b3885bd5d851d600d05026c3", "score": "0.5641459", "text": "func (u *TokenUpsertBulk) SetBody(v string) *TokenUpsertBulk {\n\treturn u.Update(func(s *TokenUpsert) {\n\t\ts.SetBody(v)\n\t})\n}", "title": "" }, { "docid": "42daad4b32f9085af7ee139640b6fa87", "score": "0.5635069", "text": "func (o *PatchCatalogsByIDParams) SetBody(body *models.Catalog) {\n\to.Body = body\n}", "title": "" }, { "docid": "280ffbab824918f66f8e668fad93fce6", "score": "0.56247115", "text": "func (s *Shape) SetBody(b *Body) {\n\ts.bodyRef = b\n\tC.cpShapeSetBody(s.c, b.c)\n}", "title": "" }, { "docid": "79263f1c24928904c90801b2c2e7e388", "score": "0.56184304", "text": "func (o *PatchRoleByIDParams) SetBody(body *models.Role) {\n\to.Body = body\n}", "title": "" }, { "docid": "b7cc3d34f2a5c5b8900eb8dbf0b252fa", "score": "0.5616208", "text": "func (o *ReplaceMsgVpnAuthorizationGroupParams) SetBody(body *models.MsgVpnAuthorizationGroup) {\n\to.Body = body\n}", "title": "" }, { "docid": "1f4250fbd1ce9bfa1778194126e729a5", "score": "0.5614603", "text": "func (o *SetRoleUsersParams) SetBody(body []int64) {\n\to.Body = body\n}", "title": "" }, { "docid": "515108f73f68ed68072cef6ecdbd04db", "score": "0.560533", "text": "func (o *ConnectorHttpRequestAllOf) SetBody(v string) {\n\to.Body = &v\n}", "title": "" } ]
daeb4a5d6473d09043df81faf26a73d8
AddPorts adds the ports edges to EquipmentPort.
[ { "docid": "ed5adc6fc4cb304e663db7388587c5e4", "score": "0.754836", "text": "func (epdc *EquipmentPortDefinitionCreate) AddPorts(e ...*EquipmentPort) *EquipmentPortDefinitionCreate {\n\tids := make([]int, len(e))\n\tfor i := range e {\n\t\tids[i] = e[i].ID\n\t}\n\treturn epdc.AddPortIDs(ids...)\n}", "title": "" } ]
[ { "docid": "7d087bd33135b2cf3b74865029016d8c", "score": "0.74507093", "text": "func (ec *EquipmentCreate) AddPorts(e ...*EquipmentPort) *EquipmentCreate {\n\tids := make([]string, len(e))\n\tfor i := range e {\n\t\tids[i] = e[i].ID\n\t}\n\treturn ec.AddPortIDs(ids...)\n}", "title": "" }, { "docid": "f8f46f7e67044f0d0cb2bd19ce528d08", "score": "0.6169682", "text": "func (etu *EquipmentTypeUpdate) AddPortDefinitions(e ...*EquipmentPortDefinition) *EquipmentTypeUpdate {\n\tids := make([]string, len(e))\n\tfor i := range e {\n\t\tids[i] = e[i].ID\n\t}\n\treturn etu.AddPortDefinitionIDs(ids...)\n}", "title": "" }, { "docid": "42ca83f61b4bcb775d24dad7cb993f1c", "score": "0.6139309", "text": "func (etuo *EquipmentTypeUpdateOne) AddPortDefinitions(e ...*EquipmentPortDefinition) *EquipmentTypeUpdateOne {\n\tids := make([]string, len(e))\n\tfor i := range e {\n\t\tids[i] = e[i].ID\n\t}\n\treturn etuo.AddPortDefinitionIDs(ids...)\n}", "title": "" }, { "docid": "7151cb82a4c27f4bfcfa9863ef344d41", "score": "0.57915294", "text": "func (h *Host) AddPort(newPort Port) {\n\texisting := false\n\tfor _, p := range h.Ports {\n\t\tif p.Equal(newPort) {\n\t\t\texisting = true\n\t\t}\n\t}\n\tif existing == false {\n\t\th.Ports = append(h.Ports, newPort)\n\t}\n}", "title": "" }, { "docid": "9557b717713cb3719e31863c46156709", "score": "0.57804525", "text": "func (epdc *EquipmentPortDefinitionCreate) AddPortIDs(ids ...int) *EquipmentPortDefinitionCreate {\n\tepdc.mutation.AddPortIDs(ids...)\n\treturn epdc\n}", "title": "" }, { "docid": "e3c07c9ac1e921fcd5b3f18973a46837", "score": "0.56994134", "text": "func (ec *EquipmentCreate) AddPortIDs(ids ...string) *EquipmentCreate {\n\tif ec.ports == nil {\n\t\tec.ports = make(map[string]struct{})\n\t}\n\tfor i := range ids {\n\t\tec.ports[ids[i]] = struct{}{}\n\t}\n\treturn ec\n}", "title": "" }, { "docid": "f78a4c1982175184e4de4026a652b808", "score": "0.5634255", "text": "func (s *VirtualGatewayClientPolicyTls) SetPorts(v []*int64) *VirtualGatewayClientPolicyTls {\n\ts.Ports = v\n\treturn s\n}", "title": "" }, { "docid": "69c75d37e85276612a2ce037267c72ab", "score": "0.561704", "text": "func (escape *Escape) AddPortEdge(src, srcPort, dst, dstPort string, directed bool, attrs map[string]string) error {\n\treturn escape.Graph.AddPortEdge(esc(src), srcPort, esc(dst), dstPort, directed, escAttrs(attrs))\n}", "title": "" }, { "docid": "af83cb10df2c61407454ec2d2722f433", "score": "0.5543908", "text": "func AddPortsToPortGroup(nbClient libovsdbclient.Client, name string, ports ...string) error {\n\tops, err := AddPortsToPortGroupOps(nbClient, nil, name, ports...)\n\tif err != nil {\n\t\treturn err\n\t}\n\n\t_, err = TransactAndCheck(nbClient, ops)\n\treturn err\n}", "title": "" }, { "docid": "f93041935849b2caaf480a0e39aebcf2", "score": "0.54982054", "text": "func (s *ClientPolicyTls) SetPorts(v []*int64) *ClientPolicyTls {\n\ts.Ports = v\n\treturn s\n}", "title": "" }, { "docid": "34a0c6fab3422aeda071f83298fc3059", "score": "0.54552686", "text": "func (c *Conn) AddPort(zone string, port string, protocol string) (string, error) {\n\tvar r string\n\tvar err error\n\n\terr = c.object.Call(dbusInterface+\".zone.addPort\", 0, zone, port, protocol, 0).Store(&r)\n\tif err != nil {\n\t\treturn r, err\n\t}\n\n\treturn r, nil\n}", "title": "" }, { "docid": "2c795a66d6c674b1c4995ef367d1658b", "score": "0.53802836", "text": "func (npm NamedPortMap) AddPort(name string, port int, protocol string) error {\n\tname, err := ValidatePortName(name)\n\tif err != nil {\n\t\treturn err\n\t}\n\tpp, err := newPortProto(port, protocol)\n\tif err != nil {\n\t\treturn err\n\t}\n\tnpm[name] = pp\n\treturn nil\n}", "title": "" }, { "docid": "87b306e12f3c408b2416ad923d9aaffc", "score": "0.527117", "text": "func (f *JsonDB) CreateOrUpdatePorts(projectName string, ip string, ports []models.Port) error {\n\tfor _, port := range ports {\n\t\terr := f.CreateOrUpdatePort(projectName, ip, port)\n\t\tif err != nil {\n\t\t\treturn err\n\t\t}\n\t}\n\treturn nil\n}", "title": "" }, { "docid": "5c3fdc6bf15e4dfe85a76037b61946b3", "score": "0.52575856", "text": "func (o *PodInfo) SetPorts(v []PodPortInfo) {\n\to.Ports = v\n}", "title": "" }, { "docid": "a90da19d6853d5de4c376f546b44267a", "score": "0.5255815", "text": "func (obj *Service) SetPorts(ports []ServicePort) *Service {\n\tobjPorts := make([]v1.ServicePort, 0)\n\tfor _, data := range ports {\n\t\tobjPorts = append(objPorts, v1.ServicePort{\n\t\t\tName: data.Name,\n\t\t\tProtocol: data.Protocol.ToK8s(),\n\t\t\tPort: data.Port,\n\t\t\tTargetPort: FromInt(data.TargetPort),\n\t\t\tNodePort: data.NodePort,\n\t\t})\n\t}\n\tobj.svc.Spec.Ports = objPorts\n\treturn obj\n}", "title": "" }, { "docid": "8dcba7b4cdc64ad8f028686b2f5d2a97", "score": "0.5243765", "text": "func (etuo *EquipmentTypeUpdateOne) AddPortDefinitionIDs(ids ...string) *EquipmentTypeUpdateOne {\n\tif etuo.port_definitions == nil {\n\t\tetuo.port_definitions = make(map[string]struct{})\n\t}\n\tfor i := range ids {\n\t\tetuo.port_definitions[ids[i]] = struct{}{}\n\t}\n\treturn etuo\n}", "title": "" }, { "docid": "84bc5627a4d01a60d1776b06eb86ed7c", "score": "0.52385366", "text": "func (etu *EquipmentTypeUpdate) AddPortDefinitionIDs(ids ...string) *EquipmentTypeUpdate {\n\tif etu.port_definitions == nil {\n\t\tetu.port_definitions = make(map[string]struct{})\n\t}\n\tfor i := range ids {\n\t\tetu.port_definitions[ids[i]] = struct{}{}\n\t}\n\treturn etu\n}", "title": "" }, { "docid": "ec4db95a7df579c3bb99db4b0ea2fc02", "score": "0.5211696", "text": "func (c *Container) AddExposedPort(port int) {\n\tif !common.IsIntPresent(c.ExposedPorts, port) {\n\t\tc.ExposedPorts = append(c.ExposedPorts, port)\n\t}\n}", "title": "" }, { "docid": "e20ea127bce49878116f6e035a2ed3cb", "score": "0.52078027", "text": "func (s *Service) WithPorts(ports []corev1.ServicePort) *Service {\n\t// copy of original slice\n\tnewports := []corev1.ServicePort{}\n\tnewports = append(newports, ports...)\n\n\t// override\n\ts.Spec.Ports = newports\n\treturn s\n}", "title": "" }, { "docid": "b3f2b3053b72931ae6ab244a5de39b64", "score": "0.5200803", "text": "func (k *KfApp) SetContainerPorts(ports []corev1.ContainerPort) {\n\tk.getOrCreateContainer().Ports = ports\n}", "title": "" }, { "docid": "f83683440383d8a6253243a227daa7d3", "score": "0.51313955", "text": "func (sw *OvsSwitch) AddHostPort(intfName string, intfNum int, isHostNS bool) error {\n\tvar err error\n\n\t// some error checking\n\tif sw.netType != \"host\" {\n\t\tlog.Fatalf(\"Can not add host port to OVS type %s.\", sw.netType)\n\t}\n\n\tif sw.hostBridge == nil {\n\t\tlog.Fatalf(\"Cannot add host port -- no host bridge\")\n\t}\n\n\tovsPortType := \"\"\n\tovsPortName := getOvsPortName(intfName, isHostNS)\n\tif isHostNS {\n\t\tovsPortType = \"internal\"\n\t} else {\n\n\t\t// Create a Veth pair\n\t\terr := createVethPair(intfName, ovsPortName)\n\t\t// Set the OVS side of the port as up\n\t\terr = setLinkUp(ovsPortName)\n\t\tif err != nil {\n\t\t\tlog.Errorf(\"Error setting link %s up. Err: %v\", ovsPortName, err)\n\t\t\treturn err\n\t\t}\n\t}\n\n\tportID := \"host\" + intfName\n\n\t// If the port already exists in OVS, remove it first\n\tif sw.ovsdbDriver.IsPortNamePresent(ovsPortName) {\n\t\tlog.Debugf(\"Removing existing interface entry %s from OVS\", ovsPortName)\n\n\t\t// Delete it from ovsdb\n\t\terr := sw.ovsdbDriver.DeletePort(ovsPortName)\n\t\tif err != nil {\n\t\t\tlog.Errorf(\"Error deleting port %s from OVS. Err: %v\", ovsPortName, err)\n\t\t}\n\t}\n\n\t// Ask OVSDB driver to add the port as an access port\n\terr = sw.ovsdbDriver.CreatePort(ovsPortName, ovsPortType, portID, hostVLAN, 0, 0)\n\tif err != nil {\n\t\tlog.Errorf(\"Error adding hostport %s to OVS. Err: %v\", intfName, err)\n\t\treturn err\n\t}\n\n\t// Get the openflow port number for the interface\n\tofpPort, err := sw.ovsdbDriver.GetOfpPortNo(ovsPortName)\n\tif err != nil {\n\t\tlog.Errorf(\"Could not find the OVS port %s. Err: %v\", intfName, err)\n\t\treturn err\n\t}\n\n\t// Assign an IP based on the intfnumber\n\tipStr, macStr := netutils.PortToHostIPMAC(intfNum)\n\tmac, _ := net.ParseMAC(macStr)\n\tip := net.ParseIP(ipStr)\n\n\tportInfo := ofnet.EndpointInfo{\n\t\tPortNo: ofpPort,\n\t\tMacAddr: mac,\n\t\tIpAddr: ip,\n\t}\n\t// Add to ofnet if this is the hostNS port.\n\tnetutils.SetInterfaceMac(intfName, macStr)\n\tnetutils.SetInterfaceIP(intfName, ipStr)\n\terr = setLinkUp(intfName)\n\n\tif isHostNS {\n\t\terr = sw.hostBridge.AddHostPort(portInfo)\n\t\tif err != nil {\n\t\t\tlog.Errorf(\"Error adding host port %s. Err: %v\", intfName, err)\n\t\t\treturn err\n\t\t}\n\n\t\tlog.Infof(\"Added host port %s to OVS switch %s.\", intfName, sw.bridgeName)\n\t}\n\n\tdefer func() {\n\t\tif err != nil {\n\t\t\tsw.ovsdbDriver.DeletePort(intfName)\n\t\t}\n\t}()\n\n\treturn nil\n}", "title": "" }, { "docid": "5089f6a16c061aa13bfb2de835608942", "score": "0.51152915", "text": "func (portSet PortSet) ToPorts() (ports Ports) {\n\tports = Ports{}\n\tfor port := range portSet {\n\t\tports = append(ports, port)\n\t}\n\treturn\n}", "title": "" }, { "docid": "e36e460a36ba47be4bec98e2d8198131", "score": "0.50709873", "text": "func (n *Client) AddPortMapping(protocol string, internalPort, requestedExternalPort int, lifetime int) (result *AddPortMappingResult, err error) {\n\tvar opcode byte\n\tif protocol == \"udp\" {\n\t\topcode = 1\n\t} else if protocol == \"tcp\" {\n\t\topcode = 2\n\t} else {\n\t\terr = fmt.Errorf(\"unknown protocol %v\", protocol)\n\t\treturn\n\t}\n\tmsg := make([]byte, 12)\n\tmsg[0] = 0 // Version 0\n\tmsg[1] = opcode\n\t// [2:3] is reserved.\n\twriteNetworkOrderUint16(msg[4:6], uint16(internalPort))\n\twriteNetworkOrderUint16(msg[6:8], uint16(requestedExternalPort))\n\twriteNetworkOrderUint32(msg[8:12], uint32(lifetime))\n\tresponse, err := n.rpc(msg, 16)\n\tif err != nil {\n\t\treturn\n\t}\n\tresult = &AddPortMappingResult{}\n\tresult.SecondsSinceStartOfEpoc = readNetworkOrderUint32(response[4:8])\n\tresult.InternalPort = readNetworkOrderUint16(response[8:10])\n\tresult.MappedExternalPort = readNetworkOrderUint16(response[10:12])\n\tresult.PortMappingLifetimeInSeconds = readNetworkOrderUint32(response[12:16])\n\treturn\n}", "title": "" }, { "docid": "ee0d8c7c18712a8570b13a1f2ae4c9fd", "score": "0.5064035", "text": "func (epc *EquipmentPortCreate) AddEndpoints(s ...*ServiceEndpoint) *EquipmentPortCreate {\n\tids := make([]int, len(s))\n\tfor i := range s {\n\t\tids[i] = s[i].ID\n\t}\n\treturn epc.AddEndpointIDs(ids...)\n}", "title": "" }, { "docid": "9706b569656be79ab63602bba7489e42", "score": "0.49957633", "text": "func (l *LAG) WithPorts(ports ...*Port) *LAG {\n\tl.pb.Ports = nil\n\tfor _, p := range ports {\n\t\tl.pb.Ports = append(l.pb.Ports, p.Name())\n\t}\n\treturn l\n}", "title": "" }, { "docid": "ac24de92dad145a6f3e478ee974bf98d", "score": "0.4993986", "text": "func (epd *EquipmentPortDefinition) QueryPorts() *EquipmentPortQuery {\n\treturn (&EquipmentPortDefinitionClient{epd.config}).QueryPorts(epd)\n}", "title": "" }, { "docid": "c7274ae9b876ba2bb2d18112c9354356", "score": "0.4964561", "text": "func (r *RPCTask) ExecutorPorts(i int, ports []*tes.Ports) {\n\tr.updateExecutorLogs(&pbf.UpdateExecutorLogsRequest{\n\t\tId: r.taskID,\n\t\tStep: int64(i),\n\t\tLog: &tes.ExecutorLog{\n\t\t\tPorts: ports,\n\t\t},\n\t})\n}", "title": "" }, { "docid": "aaa16b545616588e86b136d3a0e1247c", "score": "0.49621886", "text": "func (portRange *PortRange) NumPorts() uint64 {\n\treturn portRange.End - portRange.Begin\n}", "title": "" }, { "docid": "f28d043037db289afc96680584a61d75", "score": "0.4952218", "text": "func insertPorts(rules []k8sfirewall.ChainRule, ports []pcn_types.ProtoPort) []k8sfirewall.ChainRule {\n\t// Don't make me go through this if there are no ports\n\tif len(ports) == 0 {\n\t\treturn rules\n\t}\n\n\tnewRules := make([]k8sfirewall.ChainRule, len(rules)*len(ports))\n\n\t// Finally, apply the ports that have been found\n\tt := 0\n\tfor i := 0; i < len(rules); i++ {\n\t\tfor _, generatedPort := range ports {\n\t\t\tnewRules[t] = rules[i]\n\t\t\tnewRules[t].Sport = generatedPort.SPort\n\t\t\tnewRules[t].Dport = generatedPort.DPort\n\t\t\tnewRules[t].L4proto = generatedPort.Protocol\n\t\t\tt++\n\t\t}\n\t}\n\n\treturn newRules\n}", "title": "" }, { "docid": "65448db9c9eb1ec95ede75c467a0a421", "score": "0.49456948", "text": "func (mr *MockInterfaceMockRecorder) AddNodePort(arg0, arg1, arg2 interface{}) *gomock.Call {\n\tmr.mock.ctrl.T.Helper()\n\treturn mr.mock.ctrl.RecordCallWithMethodType(mr.mock, \"AddNodePort\", reflect.TypeOf((*MockInterface)(nil).AddNodePort), arg0, arg1, arg2)\n}", "title": "" }, { "docid": "022c25a260838d593e6aaf6215cf3bde", "score": "0.4918152", "text": "func (builder *DesiredSystemdUnitBuilder) Ports(ports map[int]int) error {\n\tbuilder.unit.Ports = ports\n\treturn nil\n}", "title": "" }, { "docid": "d5661b93b5cc9edbef6867411681011b", "score": "0.48924512", "text": "func (c *ClientService) AddHostPort(portType, portAddress string, hostID int) (hostPort HostPort, err error) {\n\tklog.V(4).Infof(\"add port for hostID %s %d : \", portAddress, hostID)\n\turi := \"api/rest/hosts/\" + strconv.Itoa(hostID) + \"/ports?approved=true\"\n\tbody := map[string]interface{}{\"address\": portAddress, \"type\": portType}\n\tresp, err := c.getJSONResponse(http.MethodPost, uri, body, &hostPort)\n\tif err != nil {\n\t\tif strings.Contains(err.Error(), \"PORT_ALREADY_BELONGS_TO_HOST\") {\n\t\t\tklog.V(4).Infof(\"Success: No need to add port '%s' to host with ID %d, port already belongs to host\", portAddress, hostID)\n\t\t\treturn HostPort{}, nil\n\t\t} else {\n\t\t\tklog.Errorf(\"error adding port '%s' to host with ID %d, error: %+v\", portAddress, hostID, err)\n\t\t\treturn hostPort, err\n\t\t}\n\t}\n\tif reflect.DeepEqual(hostPort, (HostPort{})) {\n\t\tapiresp := resp.(client.ApiResponse)\n\t\thostPort, _ = apiresp.Result.(HostPort)\n\t}\n\n\tklog.V(4).Infof(\"created host port: %s\", hostPort.PortAddress)\n\treturn hostPort, nil\n}", "title": "" }, { "docid": "7595fd46ec3e3c27f93d0be616cfc18a", "score": "0.4812869", "text": "func (m *MockInterface) AddNodePort(arg0 []net.IP, arg1 uint16, arg2 openflow.Protocol) error {\n\tm.ctrl.T.Helper()\n\tret := m.ctrl.Call(m, \"AddNodePort\", arg0, arg1, arg2)\n\tret0, _ := ret[0].(error)\n\treturn ret0\n}", "title": "" }, { "docid": "06c77c7a838c2668aeb3949380d41b4a", "score": "0.48097146", "text": "func restAddPort(w *rest.ResponseWriter, r *rest.Request, client *node.ControlClient) {\n\tglog.V(1).Infof(\"Add PORT with %s %#v\", r.URL.Path, r)\n\n\tvar request portRequest\n\terr := r.DecodeJsonPayload(&request)\n\tif err != nil {\n\t\trestBadRequest(w, err)\n\t\treturn\n\t}\n\n\t// Validate the port number\n\tscrubbedPort := svc.ScrubPortString(request.PortName)\n\tportParts := strings.Split(scrubbedPort, \":\")\n\tif len(portParts) <= 1 {\n\t\terr := fmt.Errorf(\"Invalid port address. Port address be \\\":[PORT NUMBER]\\\" or \\\"[IP ADDRESS]:[PORT NUMBER]\\\"\")\n\t\tglog.Error(err)\n\t\trestServerError(w, err)\n\t\treturn\n\t}\n\tport, err := strconv.Atoi(portParts[1])\n\tif err != nil {\n\t\terr := fmt.Errorf(\"Port must be a number greater than 1024 and less then 65536\")\n\t\tglog.Error(err)\n\t\trestServerError(w, err)\n\t\treturn\n\t}\n\n\tif port < 1024 || port > 65535 {\n\t\terr := fmt.Errorf(\"Port must be greater than 1024 and less then 65536\")\n\t\tglog.Error(err)\n\t\trestServerError(w, err)\n\t\treturn\n\t}\n\n\tswitch port {\n\tcase 5000:\n\t\tfallthrough\n\tcase 8080:\n\t\terr := fmt.Errorf(\"Port %d is reserved\", port)\n\t\tglog.Error(err)\n\t\trestServerError(w, err)\n\t\treturn\n\t}\n\n\tvar services []svc.Service\n\tvar serviceRequest dao.ServiceRequest\n\tif err := client.GetServices(serviceRequest, &services); err != nil {\n\t\terr := fmt.Errorf(\"Could not get services: %v\", err)\n\t\tglog.Error(err)\n\t\trestServerError(w, err)\n\t\treturn\n\t}\n\n\tvar service *svc.Service\n\tfor _, _service := range services {\n\t\tif _service.ID == request.ServiceID {\n\t\t\tservice = &_service\n\t\t\tbreak\n\t\t}\n\t}\n\n\tif service == nil {\n\t\terr := fmt.Errorf(\"Could not find service: %s\", request.ServiceID)\n\t\tglog.Error(err)\n\t\trestServerError(w, err)\n\t\treturn\n\t}\n\n\t//checkout other ports for redundancy\n\tfor _, service := range services {\n\t\tif service.Endpoints == nil {\n\t\t\tcontinue\n\t\t}\n\n\t\tfor _, endpoint := range service.Endpoints {\n\t\t\tfor _, epPort := range endpoint.PortList {\n\t\t\t\tif scrubbedPort == epPort.PortAddr {\n\t\t\t\t\terr := fmt.Errorf(\"Port %s already defined for service: %s\", epPort.PortAddr, service.Name)\n\t\t\t\t\tglog.Error(err)\n\t\t\t\t\trestServerError(w, err)\n\t\t\t\t\treturn\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\n\t// Check to make sure the port is available. Don't allow adding a port if it's already being used.\n\terr = checkPort(\"tcp\", fmt.Sprintf(\"%s\", scrubbedPort))\n\tif err != nil {\n\t\tglog.Error(err)\n\t\trestServerError(w, err)\n\t\treturn\n\t}\n\n\terr = service.AddPort(request.Application, scrubbedPort)\n\tif err != nil {\n\t\tglog.Errorf(\"Error adding port to service (%s): %v\", service.Name, err)\n\t\trestServerError(w, err)\n\t\treturn\n\t}\n\n\tglog.V(2).Infof(\"Port (%s) added to service (%s)\", request.PortName, service.Name)\n\n\tvar unused int\n\terr = client.UpdateService(*service, &unused)\n\tif err != nil {\n\t\tglog.Errorf(\"Unexpected error adding port to service (%s): %v\", service.Name, err)\n\t\trestServerError(w, err)\n\t\treturn\n\t}\n\n\tglog.V(2).Infof(\"Service (%s) updated\", service.Name)\n\n\t// Restart the service if it is running\n\tif service.DesiredState == int(svc.SVCRun) || service.DesiredState == int(svc.SVCRestart) {\n\t\tif err = client.RestartService(dao.ScheduleServiceRequest{ServiceID: service.ID}, &unused); err != nil {\n\t\t\tglog.Errorf(\"Error restarting service %s: %s. Trying again in 10 seconds.\", service.Name, err)\n\t\t\ttime.Sleep(10 * time.Second)\n\t\t\tif err = client.RestartService(dao.ScheduleServiceRequest{ServiceID: service.ID}, &unused); err != nil {\n\t\t\t\tglog.Errorf(\"Error restarting service %s: %s. Aborting.\", service.Name, err)\n\t\t\t\terr = fmt.Errorf(\"Error restarting service %s. Service will need to be restarted manually.\", service.Name)\n\t\t\t\trestServerError(w, err)\n\t\t\t\treturn\n\t\t\t}\n\t\t}\n\t}\n\n\trestSuccess(w)\n}", "title": "" }, { "docid": "a2e41aea29586be7450c39562b29e5e3", "score": "0.48011494", "text": "func Port(name string, port int32) ObjectOption {\n\treturn func(object interface{}) {\n\t\tvar ports *[]corev1.ContainerPort\n\n\t\tswitch o := object.(type) {\n\t\tcase *corev1.Container:\n\t\t\tports = &o.Ports\n\t\tcase *appsv1.Deployment:\n\t\t\tports = &firstContainer(o).Ports\n\t\t}\n\n\t\t*ports = append(*ports, corev1.ContainerPort{\n\t\t\tName: name,\n\t\t\tContainerPort: port,\n\t\t})\n\t}\n}", "title": "" }, { "docid": "8a30d2df53c6ade98b18508d4e0aa5f7", "score": "0.47656643", "text": "func DecodePorts(ports []proto.Port) []api.Port {\n\tif ports == nil {\n\t\treturn nil\n\t}\n\n\tdecoded := make([]api.Port, len(ports))\n\tfor i, si := range ports {\n\t\tdecoded[i] = api.Port{\n\t\t\tPort: si.Port,\n\t\t\tProtocol: si.Protocol,\n\t\t\tSecure: si.Secure,\n\t\t}\n\t}\n\treturn decoded\n}", "title": "" }, { "docid": "e8ae973c769ef6468cf8a9d089eec3ec", "score": "0.47534457", "text": "func (r *FQDNNetworkPolicy) ValidatePorts() field.ErrorList {\n\tvar allErrs field.ErrorList\n\n\tfor ie, rule := range r.Spec.Egress {\n\t\tif rule.Ports != nil {\n\t\t\tfor ip, port := range rule.Ports {\n\t\t\t\tif port.Port.IntVal < 0 || port.Port.IntVal > 65535 {\n\t\t\t\t\tallErrs = append(allErrs, field.Invalid(field.NewPath(\"spec\").Child(\"egress\").\n\t\t\t\t\t\tIndex(ie).Child(\"ports\").Index(ip).Child(\"port\"),\n\t\t\t\t\t\tport.Port, \"Invalid port. Must be between 0 and 65535.\"))\n\t\t\t\t}\n\t\t\t\tif port.Port.IntVal == 0 {\n\t\t\t\t\tfqdnnetworkpolicylog.Info(\"port not set or set to 0, will match all ports\",\n\t\t\t\t\t\t\"name\", r.ObjectMeta.Name,\n\t\t\t\t\t\t\"namespace\", r.ObjectMeta.Namespace,\n\t\t\t\t\t\t\"resource\", field.NewPath(\"spec\").Child(\"egress\").\n\t\t\t\t\t\t\tIndex(ie).Child(\"ports\").Index(ip).Child(\"port\").String())\n\t\t\t\t}\n\t\t\t\tif *port.Protocol != v1.ProtocolTCP && *port.Protocol != v1.ProtocolUDP &&\n\t\t\t\t\t*port.Protocol != v1.ProtocolSCTP && *port.Protocol != \"\" {\n\t\t\t\t\tallErrs = append(allErrs, field.Invalid(field.NewPath(\"spec\").Child(\"egress\").\n\t\t\t\t\t\tIndex(ie).Child(\"ports\").Index(ip).Child(\"protocol\"),\n\t\t\t\t\t\tport.Port, \"Invalid protocol. Must be TCP, UDP, or SCTP.\"))\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\tif len(allErrs) == 0 {\n\t\treturn nil\n\t}\n\treturn allErrs\n}", "title": "" }, { "docid": "f1441fff09e98f70650e55dc3adb2141", "score": "0.47497168", "text": "func (m *DeviceMutation) AddDeviceSSHPort(i int) {\n\tif m.adddevice_ssh_port != nil {\n\t\t*m.adddevice_ssh_port += i\n\t} else {\n\t\tm.adddevice_ssh_port = &i\n\t}\n}", "title": "" }, { "docid": "3fe7bdd3fe6cbde2e496ae2711a7e8d3", "score": "0.47369343", "text": "func (f *JsonDB) CreatePort(projectName string, ip string, port models.Port) error {\n\treturn errors.New(\"Not implemented yet\")\n}", "title": "" }, { "docid": "ad4c19ce81255996a04b894399530ede", "score": "0.47367477", "text": "func (o *PostServicePortsParams) WithPort(port string) *PostServicePortsParams {\n\to.SetPort(port)\n\treturn o\n}", "title": "" }, { "docid": "270652309ea937a12a677671a29e8134", "score": "0.4735391", "text": "func EndpointPortsApply(ports []discoveryv1.EndpointPort) []*discoveryv1apply.EndpointPortApplyConfiguration {\n\tvar output []*discoveryv1apply.EndpointPortApplyConfiguration\n\n\tfor i := range ports {\n\t\tport := &ports[i]\n\t\toutput = append(output, &discoveryv1apply.EndpointPortApplyConfiguration{\n\t\t\tName: port.Name, Port: port.Port, Protocol: port.Protocol, AppProtocol: port.AppProtocol,\n\t\t})\n\t}\n\n\treturn output\n}", "title": "" }, { "docid": "28a7a453a48baace556d28d3470fa763", "score": "0.4706483", "text": "func (fm *Frame) growPorts(n int) {\n\tif len(fm.ports) >= n {\n\t\treturn\n\t}\n\tports := fm.ports\n\tfm.ports = make([]*Port, n)\n\tcopy(fm.ports, ports)\n}", "title": "" }, { "docid": "e636348ea92e07a3855a0393e092f525", "score": "0.45512226", "text": "func (s store) attachPort(p *core.Port) {\n\tif p.PrimitiveType() {\n\t\ts[p] = &storePipe{\n\t\t\tindex: 0,\n\t\t\titems: []interface{}{},\n\t\t}\n\t\tgo func() {\n\t\t\tfor !p.Operator().Stopped() {\n\t\t\t\ts[p].items = append(s[p].items, p.Pull())\n\t\t\t}\n\t\t}()\n\t} else if p.Type() == core.TYPE_MAP {\n\t\tfor _, sub := range p.MapEntryNames() {\n\t\t\ts.attachPort(p.Map(sub))\n\t\t}\n\t} else if p.Type() == core.TYPE_STREAM {\n\t\ts.attachPort(p.Stream())\n\t}\n}", "title": "" }, { "docid": "a50d6f0a91ddf83bcb5fe09c48f615fa", "score": "0.454396", "text": "func (s *Addr) PortAddr(withIP ...string) string {\n\tip0 := \"\"\n\tif len(withIP) == 1 {\n\t\tip0 = withIP[0]\n\t}\n\treturn net.JoinHostPort(ip0, s.Port())\n}", "title": "" }, { "docid": "589363821f4f5ffb7b5f677c49c33a95", "score": "0.45418143", "text": "func (c *Conn) AddPortPermanent(zone string, port string, protocol string) (string, error) {\n\tr, err := c.getZonePathbyName(zone)\n\tif err != nil {\n\t\treturn r, err\n\t}\n\n\tc.object = c.conn.Object(dbusInterface, dbus.ObjectPath(r))\n\terr = c.object.Call(dbusInterface+\".config.zone.addPort\", 0, port, protocol).Err\n\tif err != nil {\n\t\treturn r, err\n\t}\n\n\treturn r, nil\n}", "title": "" }, { "docid": "c86b1094f3de6d3cdc3dcb8e8b44d27f", "score": "0.454013", "text": "func (a *Application) AddPortForwardToDB(svcName string, port *profile.DevPortForward) error {\n\n\tprofileV2, err := profile.NewAppProfileV2ForUpdate(a.NameSpace, a.Name)\n\tif err != nil {\n\t\treturn err\n\t}\n\tdefer profileV2.CloseDb()\n\n\tsvcProfile := profileV2.FetchSvcProfileV2FromProfile(svcName)\n\tif svcProfile == nil {\n\t\treturn errors.New(\"Failed to get svc profile\")\n\t}\n\n\tsvcProfile.DevPortForwardList = append(svcProfile.DevPortForwardList, port)\n\treturn profileV2.Save()\n}", "title": "" }, { "docid": "0e8e15635cd5149e1cc2802c0dde261a", "score": "0.45335647", "text": "func (a *RouterApiService) CreateRouterPortsListByID(ctx context.Context, name string, ports []Ports) (*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 + \"/router/{name}/ports/\"\n\tlocalVarPath = strings.Replace(localVarPath, \"{\"+\"name\"+\"}\", fmt.Sprintf(\"%v\", name), -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 = &ports\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": "f0a21131a1d3c34d8f713788a75269c7", "score": "0.45150185", "text": "func (epc *EquipmentPortCreate) AddService(s ...*Service) *EquipmentPortCreate {\n\tids := make([]int, len(s))\n\tfor i := range s {\n\t\tids[i] = s[i].ID\n\t}\n\treturn epc.AddServiceIDs(ids...)\n}", "title": "" }, { "docid": "9c969a55dc4b7305ca986238abc15e0f", "score": "0.45138788", "text": "func (c *CLab) portsInit(nodeCfg *NodeConfig) (nat.PortSet, nat.PortMap, error) {\n\tif len(nodeCfg.Ports) != 0 {\n\t\tps, pb, err := nat.ParsePortSpecs(nodeCfg.Ports)\n\t\tif err != nil {\n\t\t\treturn nil, nil, err\n\t\t}\n\t\treturn ps, pb, nil\n\t}\n\treturn nil, nil, nil\n}", "title": "" }, { "docid": "bb69c159fc997a562280f2a93ce3f9df", "score": "0.45119935", "text": "func (r *Runner) AddPuzzle(day int, solver SolverFunc, solA string, solB string) {\n\tname := fmt.Sprintf(\"AOC %d.%d\", r.year, day)\n\tfilename := fmt.Sprintf(\"aoc/%d/day%d.txt\", r.year, day)\n\tr.puzzles = append(r.puzzles, puzzle{name, filename, solver, solA, solB})\n}", "title": "" }, { "docid": "8d0425fc13ba1822a302ac387556b31e", "score": "0.45062405", "text": "func (epc *EquipmentPortCreate) AddServiceIDs(ids ...int) *EquipmentPortCreate {\n\tepc.mutation.AddServiceIDs(ids...)\n\treturn epc\n}", "title": "" }, { "docid": "eefb53d272d0db42583d1606998d9c8e", "score": "0.44897833", "text": "func (f *IBMPINetworkClient) AttachPort(powerinstanceid, networkID, portID, description, pvminstanceid string, timeout time.Duration) (*models.NetworkPort, error) {\n\n\tvar body = models.NetworkPortUpdate{}\n\tif &description != nil {\n\t\tbody.Description = &description\n\t}\n\tif &pvminstanceid != nil {\n\t\tbody.PvmInstanceID = &pvminstanceid\n\t}\n\n\tparams := p_cloud_networks.NewPcloudNetworksPortsPutParamsWithTimeout(timeout).WithCloudInstanceID(powerinstanceid).WithNetworkID(networkID).WithPortID(portID).WithBody(&body)\n\tresp, err := f.session.Power.PCloudNetworks.PcloudNetworksPortsPut(params, ibmpisession.NewAuth(f.session, powerinstanceid))\n\tif err != nil || resp == nil || resp.Payload == nil {\n\t\treturn nil, fmt.Errorf(\"Failed to attach the port [%s] to network %s the pvminstance [%s]\", portID, networkID, pvminstanceid)\n\t}\n\treturn resp.Payload, nil\n}", "title": "" }, { "docid": "0cfe807dd3e36a62e6bcc36843faf647", "score": "0.44886866", "text": "func ParsePorts(ports []string) ([]ForwardedPort, error) {\n\tvar forwards []ForwardedPort\n\tfor _, portString := range ports {\n\t\tparts := strings.Split(portString, \":\")\n\t\tvar localString, remoteString string\n\t\tif len(parts) == 1 {\n\t\t\tlocalString = parts[0]\n\t\t\tremoteString = parts[0]\n\t\t} else if len(parts) == 2 {\n\t\t\tlocalString = parts[0]\n\t\t\tif localString == \"\" {\n\t\t\t\t// support :5000\n\t\t\t\tlocalString = \"0\"\n\t\t\t}\n\t\t\tremoteString = parts[1]\n\t\t} else {\n\t\t\treturn nil, fmt.Errorf(\"invalid port format '%s'\", portString)\n\t\t}\n\n\t\tlocalPort, err := strconv.ParseUint(localString, 10, 16)\n\t\tif err != nil {\n\t\t\treturn nil, fmt.Errorf(\"error parsing local port '%s': %s\", localString, err)\n\t\t}\n\n\t\tremotePort, err := strconv.ParseUint(remoteString, 10, 16)\n\t\tif err != nil {\n\t\t\treturn nil, fmt.Errorf(\"error parsing remote port '%s': %s\", remoteString, err)\n\t\t}\n\t\tif remotePort == 0 {\n\t\t\treturn nil, fmt.Errorf(\"remote port must be > 0\")\n\t\t}\n\n\t\tforwards = append(forwards, ForwardedPort{uint16(localPort), uint16(remotePort)})\n\t}\n\n\treturn forwards, nil\n}", "title": "" }, { "docid": "54507e32c53c88b923e1b72b072f4eae", "score": "0.446903", "text": "func PortPatch(name, protocol string, port, targetport int) []ServicePortSpec {\n\tportPatch := make([]ServicePortSpec, 1)\n\tportPatch[0].Name = name\n\tportPatch[0].Port = port\n\tportPatch[0].Protocol = protocol\n\tportPatch[0].TargetPort = targetport\n\n\treturn portPatch\n}", "title": "" }, { "docid": "ca71b17177b6b62be9d8e9eb77b22a98", "score": "0.44617552", "text": "func (o KibanaSpecHttpServiceSpecOutput) Ports() KibanaSpecHttpServiceSpecPortsArrayOutput {\n\treturn o.ApplyT(func(v KibanaSpecHttpServiceSpec) []KibanaSpecHttpServiceSpecPorts { return v.Ports }).(KibanaSpecHttpServiceSpecPortsArrayOutput)\n}", "title": "" }, { "docid": "7bbf50c23869a9916575f62b3de20500", "score": "0.44545755", "text": "func (epc *EquipmentPortCreate) AddEndpointIDs(ids ...int) *EquipmentPortCreate {\n\tepc.mutation.AddEndpointIDs(ids...)\n\treturn epc\n}", "title": "" }, { "docid": "37ef73db5594bfd0d850a4cb87ff5c24", "score": "0.44419864", "text": "func (pcic *PortChannelInterfaceCreate) AddInterfaces(n ...*NetInterface) *PortChannelInterfaceCreate {\n\tids := make([]int, len(n))\n\tfor i := range n {\n\t\tids[i] = n[i].ID\n\t}\n\treturn pcic.AddInterfaceIDs(ids...)\n}", "title": "" }, { "docid": "ea62eceafae0da10ba1ce7464576cdc6", "score": "0.44263387", "text": "func AssignPorts(\n\toffer Offer,\n\ttasks []Task,\n) []uint64 {\n\tavailablePortRanges := offer.AvailablePortRanges()\n\n\tvar selectedPorts []uint64\n\tfor _, taskEntity := range tasks {\n\t\tassignedPorts := uint64(0)\n\t\tneededPorts := taskEntity.GetPlacementNeeds().Ports\n\t\tdepletedRanges := []*PortRange{}\n\t\tfor portRange := range availablePortRanges {\n\t\t\tports := portRange.TakePorts(neededPorts - assignedPorts)\n\t\t\tassignedPorts += uint64(len(ports))\n\t\t\tselectedPorts = append(selectedPorts, ports...)\n\t\t\tif portRange.NumPorts() == 0 {\n\t\t\t\tdepletedRanges = append(depletedRanges, portRange)\n\t\t\t}\n\t\t\tif assignedPorts >= neededPorts {\n\t\t\t\tbreak\n\t\t\t}\n\t\t}\n\t\tfor _, portRange := range depletedRanges {\n\t\t\tdelete(availablePortRanges, portRange)\n\t\t}\n\t}\n\treturn selectedPorts\n}", "title": "" }, { "docid": "9bc0daf09fe8e0ff555db2a9e5ca2c5d", "score": "0.44203627", "text": "func (f *JsonDB) CreateOrUpdatePort(projectName string, ip string, portModel models.Port) error {\n\tportsFromFile, err := f.getPorts(projectName, ip)\n\tif err != nil {\n\t\treturn err\n\t}\n\n\tportJson := jsonPort{}\n\tportJson.FromModel(portModel)\n\n\tfound := false\n\tfor _, p := range portsFromFile {\n\t\tif p.Number == portModel.Number {\n\t\t\tfound = true\n\n\t\t\t// add missings fields if it already exist !\n\t\t\tportJson.PortType = p.PortType\n\t\t\tportJson.ID = p.ID\n\t\t\tp = portJson\n\t\t\tbreak\n\t\t}\n\t}\n\n\tif !found {\n\t\tportsFromFile = append(portsFromFile, portJson)\n\t}\n\n\treturn f.writePorts(projectName, ip, portsFromFile)\n}", "title": "" }, { "docid": "f2e5514d0d492cd1bc52c7aa2af87d41", "score": "0.43935084", "text": "func (rk Destination) Ports() []int {\n\ts := int(2 + rk[1]) // start position of ports\n\tn := (len(rk) - s) / 2 // number of ports\n\tif n > 0 {\n\t\tports := make([]int, n)\n\t\tfor i := 0; i < n; i++ {\n\t\t\tports[i] = int(rk[s])<<8 + int(rk[s+1])\n\t\t\ts += 2\n\t\t}\n\t\treturn ports\n\t}\n\treturn nil\n}", "title": "" }, { "docid": "eb9b5312a97abbbb9749015c31a36000", "score": "0.4379963", "text": "func (o SeldonDeploymentSpecPredictorsExplainerContainerSpecOutput) Ports() SeldonDeploymentSpecPredictorsExplainerContainerSpecPortsArrayOutput {\n\treturn o.ApplyT(func(v SeldonDeploymentSpecPredictorsExplainerContainerSpec) []SeldonDeploymentSpecPredictorsExplainerContainerSpecPorts {\n\t\treturn v.Ports\n\t}).(SeldonDeploymentSpecPredictorsExplainerContainerSpecPortsArrayOutput)\n}", "title": "" }, { "docid": "adbd5c874a9380ba933799e481ded142", "score": "0.43739623", "text": "func (c *Controller) ManagementPorts(addr string) model.PortList {\n\tlog.Infof(\"ManagementPorts addr=%s\", addr)\n\treturn nil\n}", "title": "" }, { "docid": "81c7dccd25ea8ddcb7128ebd968bcf79", "score": "0.43623838", "text": "func (o SeldonDeploymentSpecPredictorsComponentSpecsSpecContainersOutput) Ports() SeldonDeploymentSpecPredictorsComponentSpecsSpecContainersPortsArrayOutput {\n\treturn o.ApplyT(func(v SeldonDeploymentSpecPredictorsComponentSpecsSpecContainers) []SeldonDeploymentSpecPredictorsComponentSpecsSpecContainersPorts {\n\t\treturn v.Ports\n\t}).(SeldonDeploymentSpecPredictorsComponentSpecsSpecContainersPortsArrayOutput)\n}", "title": "" }, { "docid": "e889a291106b5c381d49715327607318", "score": "0.43598098", "text": "func (o ServiceSpecPtrOutput) Ports() ServicePortArrayOutput {\n\treturn o.ApplyT(func(v ServiceSpec) []ServicePort { return v.Ports }).(ServicePortArrayOutput)\n}", "title": "" }, { "docid": "e7081566b61d30b86fa14e6525e5671c", "score": "0.4348535", "text": "func (epc *EquipmentPortCreate) AddProperties(p ...*Property) *EquipmentPortCreate {\n\tids := make([]int, len(p))\n\tfor i := range p {\n\t\tids[i] = p[i].ID\n\t}\n\treturn epc.AddPropertyIDs(ids...)\n}", "title": "" }, { "docid": "1a94e3f09eabb5c922f68bf48eb67c09", "score": "0.43410397", "text": "func parsePorts(ports []slim_networkingv1.NetworkPolicyPort) []api.PortRule {\n\tportRules := []api.PortRule{}\n\tfor _, port := range ports {\n\t\tprotocol := api.ProtoTCP\n\t\tif port.Protocol != nil {\n\t\t\tprotocol, _ = api.ParseL4Proto(string(*port.Protocol))\n\t\t}\n\n\t\tportStr := \"0\"\n\t\tif port.Port != nil {\n\t\t\tportStr = port.Port.String()\n\t\t}\n\n\t\tportRule := api.PortRule{\n\t\t\tPorts: []api.PortProtocol{\n\t\t\t\t{Port: portStr, Protocol: protocol},\n\t\t\t},\n\t\t}\n\n\t\tportRules = append(portRules, portRule)\n\t}\n\n\treturn portRules\n}", "title": "" }, { "docid": "2577e4332a2c96105922ed1cdfd4b0c0", "score": "0.43261448", "text": "func (c *realContainer) assignPorts() error {\n\tif err := c.portDB.acquirePorts(c.ContainerConfig.Ports); err != nil {\n\t\treturn err\n\t}\n\tfor name, port := range c.ContainerConfig.Ports {\n\t\tportName := fmt.Sprintf(\"PORT_%s\", strings.ToUpper(name))\n\t\tc.ContainerConfig.Env[portName] = strconv.Itoa(int(port))\n\t}\n\treturn nil\n}", "title": "" }, { "docid": "f8cf3533158bd376f420af3f29847c92", "score": "0.43243098", "text": "func (o KibanaSpecHttpServiceSpecPtrOutput) Ports() KibanaSpecHttpServiceSpecPortsArrayOutput {\n\treturn o.ApplyT(func(v *KibanaSpecHttpServiceSpec) []KibanaSpecHttpServiceSpecPorts {\n\t\tif v == nil {\n\t\t\treturn nil\n\t\t}\n\t\treturn v.Ports\n\t}).(KibanaSpecHttpServiceSpecPortsArrayOutput)\n}", "title": "" }, { "docid": "3e2ed4975372238dc1d78fa6697d5ba1", "score": "0.4315071", "text": "func NewApplicationPortRequestPorts(internalPort int32, protocol string) *ApplicationPortRequestPorts {\n\tthis := ApplicationPortRequestPorts{}\n\tthis.InternalPort = internalPort\n\tthis.Protocol = protocol\n\treturn &this\n}", "title": "" }, { "docid": "7f705d8da7c2a8dbf545552cff17bd17", "score": "0.43121725", "text": "func (ports Ports) PortSet() (ps PortSet) {\n\tif len(ports) > 0 {\n\t\tps = make(PortSet)\n\t\tfor _, port := range ports {\n\t\t\tps[port] = true\n\t\t}\n\t}\n\treturn\n}", "title": "" }, { "docid": "a5ec19c3031c7b7ca54a29b6b08d8706", "score": "0.43011987", "text": "func (o ServiceSpecOutput) Ports() ServicePortArrayOutput {\n\treturn o.ApplyT(func(v ServiceSpec) []ServicePort { return v.Ports }).(ServicePortArrayOutput)\n}", "title": "" }, { "docid": "b98952638f2d8b3dd19b69d04b12408d", "score": "0.42941943", "text": "func EnterPorts() []string {\n\tvar portsStr string\n\tprompt := &survey.Input{\n\t\tMessage: \"Enter the ports you wish to set (for example: 8080,8100/tcp,9100/udp). Simply press 'Enter' to avoid setting them\",\n\t\tDefault: \"\",\n\t}\n\terr := survey.AskOne(prompt, &portsStr, validation.PortsValidator)\n\tui.HandleError(err)\n\n\treturn util.GetSplitValuesFromStr(portsStr)\n}", "title": "" }, { "docid": "a66dde180306514bd45fda8e3dd3e842", "score": "0.42845017", "text": "func (f *Firewall) AddContainer(containerID string, client *client.Client) error {\n\tinfo, err := client.ContainerInspect(context.Background(), containerID)\n\tif err != nil {\n\t\treturn err\n\t}\n\n\tvar ports []PortProto\n\n\tif labelports, ok := info.Config.Labels[\"whaleguard.port\"]; ok {\n\t\tfor _, p := range strings.Split(labelports, \",\") {\n\t\t\tpp, err := ParsePortProto(p)\n\t\t\tif err != nil {\n\t\t\t\tlog.Print(err.Error())\n\t\t\t\tcontinue\n\t\t\t}\n\t\t\tports = append(ports, *pp)\n\t\t}\n\t} else {\n\t\t// use exposed port\n\t\tfor k := range info.NetworkSettings.Ports {\n\t\t\tports = append(ports, PortProto{\n\t\t\t\tPort: k.Port(),\n\t\t\t\tProto: k.Proto(),\n\t\t\t})\n\t\t}\n\t}\n\n\tvar ips []string\n\n\tif info.NetworkSettings.GlobalIPv6Address != \"\" {\n\t\tips = append(ips, info.NetworkSettings.GlobalIPv6Address)\n\t}\n\n\t// add additional networks\n\tfor _, network := range info.NetworkSettings.Networks {\n\t\tif network.GlobalIPv6Address != \"\" {\n\t\t\tips = append(ips, network.GlobalIPv6Address)\n\t\t}\n\t}\n\n\tif len(ports) < 1 || len(ips) < 1 {\n\t\tlog.Printf(\"No Ipv6 address or port assigned to container '%s', '%v', '%v'\", containerID, ips, ports)\n\t\treturn nil\n\t}\n\n\tfor _, ip := range ips {\n\t\tfor _, pp := range ports {\n\t\t\terr := f.AddRule(info.ID, ip, pp)\n\t\t\tif err != nil {\n\t\t\t\tlog.Print(err)\n\t\t\t}\n\t\t}\n\t}\n\treturn nil\n}", "title": "" }, { "docid": "a138a6a79daee38a3d4f7e5fafe1abc5", "score": "0.42839897", "text": "func (o SeldonDeploymentSpecPredictorsExplainerContainerSpecPtrOutput) Ports() SeldonDeploymentSpecPredictorsExplainerContainerSpecPortsArrayOutput {\n\treturn o.ApplyT(func(v *SeldonDeploymentSpecPredictorsExplainerContainerSpec) []SeldonDeploymentSpecPredictorsExplainerContainerSpecPorts {\n\t\tif v == nil {\n\t\t\treturn nil\n\t\t}\n\t\treturn v.Ports\n\t}).(SeldonDeploymentSpecPredictorsExplainerContainerSpecPortsArrayOutput)\n}", "title": "" }, { "docid": "a982912d83c18b9bbc42ef53849e81cd", "score": "0.4273836", "text": "func exposedPorts(services map[int]serviceNamePort) nat.PortSet {\n\tvar exposedPorts = make(map[nat.Port]struct{})\n\tfor _, service := range services {\n\t\texposedPorts[service.port] = struct{}{}\n\t}\n\treturn exposedPorts\n}", "title": "" }, { "docid": "3dbcb565b1d84513d31707a64cefd14b", "score": "0.4259185", "text": "func (*protocol) ParsePorts(v buffer.View) (src, dst uint16, err *tcpip.Error) {\n\th := header.UDP(v)\n\treturn h.SourcePort(), h.DestinationPort(), nil\n}", "title": "" }, { "docid": "1a4178a89832c90b1d57a918a6382b0f", "score": "0.42559776", "text": "func (r *rangeAllocator) fillPorts(stopCh <-chan struct{}) {\n\tfor {\n\t\tport := r.nextFreePort()\n\t\tif port == -1 {\n\t\t\treturn\n\t\t}\n\t\tselect {\n\t\tcase <-stopCh:\n\t\t\treturn\n\t\tcase r.ports <- port:\n\t\t}\n\t}\n}", "title": "" }, { "docid": "f08c8c2e830c77e8ab7ef3c72d1dc7f7", "score": "0.42522365", "text": "func (sw *OvsSwitch) AddUplinkPort(intfName string) error {\n\tvar err error\n\n\t// some error checking\n\tif sw.netType != \"vlan\" {\n\t\tlog.Fatalf(\"Can not add uplink to OVS type %s.\", sw.netType)\n\t}\n\n\tuplinkID := \"uplink\" + intfName\n\n\t// Check if port is already part of the OVS and add it\n\tif !sw.ovsdbDriver.IsPortNamePresent(intfName) {\n\t\t// Ask OVSDB driver to add the port as a trunk port\n\t\terr = sw.ovsdbDriver.CreatePort(intfName, \"\", uplinkID, 0, 0, 0)\n\t\tif err != nil {\n\t\t\tlog.Errorf(\"Error adding uplink %s to OVS. Err: %v\", intfName, err)\n\t\t\treturn err\n\t\t}\n\t}\n\n\t// HACK: When an uplink is added to OVS, it disconnects the controller connection.\n\t// This is a hack to workaround this issue. We wait for the OVS to reconnect\n\t// to the controller.\n\t// Wait for a while for OVS switch to disconnect/connect to ofnet agent\n\ttime.Sleep(time.Second)\n\tsw.ofnetAgent.WaitForSwitchConnection()\n\n\t// Get the openflow port number for the interface\n\tofpPort, err := sw.ovsdbDriver.GetOfpPortNo(intfName)\n\tif err != nil {\n\t\tlog.Errorf(\"Could not find the OVS port %s. Err: %v\", intfName, err)\n\t\treturn err\n\t}\n\n\t// Add the master\n\terr = sw.ofnetAgent.AddUplink(ofpPort, intfName)\n\tif err != nil {\n\t\tlog.Errorf(\"Error adding uplink %s. Err: %v\", uplinkID, err)\n\t\treturn err\n\t}\n\tsw.mutex.Lock()\n\tsw.uplinkDb[intfName] = \"port\"\n\tsw.mutex.Unlock()\n\tlog.Infof(\"Added uplink %s to OVS switch %s.\", intfName, sw.bridgeName)\n\n\tdefer func() {\n\t\tif err != nil {\n\t\t\tsw.ovsdbDriver.DeletePort(intfName)\n\t\t}\n\t}()\n\n\treturn nil\n}", "title": "" }, { "docid": "a5aef19fc6a20f9ba9ca2ce8c94836ea", "score": "0.42441967", "text": "func (escape *Escape) AddEdge(src, dst string, directed bool, attrs map[string]string) error {\n\treturn escape.AddPortEdge(src, \"\", dst, \"\", directed, attrs)\n}", "title": "" }, { "docid": "15608179c9fe060d729796e66c956c46", "score": "0.42379946", "text": "func (a *RouterApiService) CreateRouterPortsByID(ctx context.Context, name string, portsName string, ports Ports) (*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 + \"/router/{name}/ports/{ports_name}/\"\n\tlocalVarPath = strings.Replace(localVarPath, \"{\"+\"name\"+\"}\", fmt.Sprintf(\"%v\", name), -1)\n\tlocalVarPath = strings.Replace(localVarPath, \"{\"+\"ports_name\"+\"}\", fmt.Sprintf(\"%v\", portsName), -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 = &ports\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": "be54b9156ac0119f4e779382e3edcd36", "score": "0.42349148", "text": "func (o KibanaSpecHttpServiceSpecPortsOutput) Port() pulumi.IntOutput {\n\treturn o.ApplyT(func(v KibanaSpecHttpServiceSpecPorts) int { return v.Port }).(pulumi.IntOutput)\n}", "title": "" }, { "docid": "b467b1cb5284c965f130544ab6ba9ba5", "score": "0.42326656", "text": "func (pl *NodePorts) EventsToRegister() []framework.ClusterEventWithHint {\n\treturn []framework.ClusterEventWithHint{\n\t\t// Due to immutable fields `spec.containers[*].ports`, pod update events are ignored.\n\t\t{Event: framework.ClusterEvent{Resource: framework.Pod, ActionType: framework.Delete}},\n\t\t{Event: framework.ClusterEvent{Resource: framework.Node, ActionType: framework.Add | framework.Update}},\n\t}\n}", "title": "" }, { "docid": "82bab6010e6d401b10d3fb9868961125", "score": "0.42284024", "text": "func (o *PostServicePortsParams) WithHTTPClient(client *http.Client) *PostServicePortsParams {\n\to.SetHTTPClient(client)\n\treturn o\n}", "title": "" }, { "docid": "5075ef0b41de86737a929fdfce1f875d", "score": "0.4224107", "text": "func (t *ThirdPartyServiceHanlder) AddEndpoints(sid string, d *model.AddEndpiontsReq) error {\n\taddress, port := convertAddressPort(d.Address)\n\tif port == 0 {\n\t\t//set default port by service port\n\t\tports, _ := t.dbmanager.TenantServicesPortDao().GetPortsByServiceID(sid)\n\t\tif len(ports) > 0 {\n\t\t\tport = ports[0].ContainerPort\n\t\t}\n\t}\n\tep := &dbmodel.Endpoint{\n\t\tUUID: util.NewUUID(),\n\t\tServiceID: sid,\n\t\tIP: address,\n\t\tPort: port,\n\t\tIsOnline: &d.IsOnline,\n\t}\n\tif err := t.dbmanager.EndpointsDao().AddModel(ep); err != nil {\n\t\treturn err\n\t}\n\n\tlogrus.Debugf(\"add new endpoint[address: %s, port: %d]\", address, port)\n\tt.statusCli.AddThirdPartyEndpoint(ep)\n\treturn nil\n}", "title": "" }, { "docid": "224a5c6d78351fbff9519f0012cfcb28", "score": "0.42233837", "text": "func AddNetInstanceAndPortPublish(subnetCidr, networkType, netInstanceName string, portPublish []string, uplinkAdapter string) ExpectationOption {\n\treturn func(expectation *AppExpectation) {\n\t\texpectation.netInstances = append(expectation.netInstances, &NetInstanceExpectation{\n\t\t\tname: netInstanceName,\n\t\t\tsubnet: subnetCidr,\n\t\t\tportsReceived: portPublish,\n\t\t\tports: make(map[int]int),\n\t\t\tnetInstType: networkType,\n\t\t\tuplinkAdapter: uplinkAdapter,\n\t\t})\n\t}\n}", "title": "" }, { "docid": "d8fc2ff2b5928cb1b9bcb3407a0f0d11", "score": "0.4220033", "text": "func (agent *Agent) getPorts(ctx context.Context, portType voltha.Port_PortType) *voltha.Ports {\n\tlogger.Debugw(ctx, \"getPorts\", log.Fields{\"device-id\": agent.deviceID, \"port-type\": portType})\n\tports := &voltha.Ports{}\n\tfor _, port := range agent.listDevicePorts() {\n\t\tif port.Type == portType {\n\t\t\tports.Items = append(ports.Items, port)\n\t\t}\n\t}\n\treturn ports\n}", "title": "" }, { "docid": "25312b0f44ebb77d6f2ad82635fd6f1c", "score": "0.4218687", "text": "func openPorts(ports map[string]struct{}) error {\n\tfor k := range ports {\n\t\tportAndProtocol := strings.Split(k, \"/\")\n\t\tif len(portAndProtocol) != 2 {\n\t\t\treturn fmt.Errorf(\"failed to parse port and protocol: got %s, expected [port]/[protocol] 80/tcp\", portAndProtocol)\n\t\t}\n\n\t\tport := portAndProtocol[0]\n\t\t_, err := strconv.ParseUint(port, 10, 16)\n\t\tif err != nil {\n\t\t\treturn fmt.Errorf(\"received invalid port number: %v, %w\", port, err)\n\t\t}\n\n\t\tprotocol := portAndProtocol[1]\n\t\tif protocol != \"tcp\" && protocol != \"udp\" {\n\t\t\treturn fmt.Errorf(\"received unknown protocol: got %s, expected tcp or udp\", protocol)\n\t\t}\n\n\t\t// This command will write a firewall rule to accept all INPUT packets for the given port/protocol.\n\t\tcmd := exec.Command(\"iptables\", \"-A\", \"INPUT\", \"-p\", protocol, \"--dport\", port, \"-j\", \"ACCEPT\")\n\t\tout, err := cmd.CombinedOutput()\n\t\tif err != nil {\n\t\t\treturn fmt.Errorf(\"failed to open port %s %s: %v %s\", port, protocol, err, out)\n\t\t}\n\t}\n\n\treturn nil\n}", "title": "" }, { "docid": "529f677d0d01f3e8755cad3602785ec2", "score": "0.42174357", "text": "func (d *Diagram) Add(r ...Renderable) {\n\td.renderables = append(d.renderables, r...)\n}", "title": "" }, { "docid": "d38606c712c54b9987ebdf8d86a6bf8d", "score": "0.4216833", "text": "func (o *V1ProtocolTcp) SetDestinationPorts(v []string) {\n\to.DestinationPorts = &v\n}", "title": "" }, { "docid": "f10c2d05ed65df60cf985ab0129f4d9b", "score": "0.42151168", "text": "func (epc *EquipmentPortCreate) AddPropertyIDs(ids ...int) *EquipmentPortCreate {\n\tepc.mutation.AddPropertyIDs(ids...)\n\treturn epc\n}", "title": "" }, { "docid": "3f24aac37117777930e8f063692026a1", "score": "0.42093647", "text": "func (o SeldonDeploymentSpecPredictorsComponentSpecsSpecEphemeralContainersOutput) Ports() SeldonDeploymentSpecPredictorsComponentSpecsSpecEphemeralContainersPortsArrayOutput {\n\treturn o.ApplyT(func(v SeldonDeploymentSpecPredictorsComponentSpecsSpecEphemeralContainers) []SeldonDeploymentSpecPredictorsComponentSpecsSpecEphemeralContainersPorts {\n\t\treturn v.Ports\n\t}).(SeldonDeploymentSpecPredictorsComponentSpecsSpecEphemeralContainersPortsArrayOutput)\n}", "title": "" }, { "docid": "6794e3d67abd74d3597df3bed503f371", "score": "0.42059505", "text": "func (nilu *NetInterfaceLayerUpdate) AddPoLayers(p ...*PortChannelInterface) *NetInterfaceLayerUpdate {\n\tids := make([]int, len(p))\n\tfor i := range p {\n\t\tids[i] = p[i].ID\n\t}\n\treturn nilu.AddPoLayerIDs(ids...)\n}", "title": "" }, { "docid": "68409aaa3b090a576680ac75c146f659", "score": "0.42041633", "text": "func (ab *dsAddrBook) AddAddrs(p peer.ID, addrs []ma.Multiaddr, ttl time.Duration) {\n\tif ttl <= 0 {\n\t\treturn\n\t}\n\taddrs = cleanAddrs(addrs, p)\n\tab.setAddrs(p, addrs, ttl, ttlExtend, false)\n}", "title": "" }, { "docid": "477f45ae7168838445c08831c751386c", "score": "0.419951", "text": "func parsePorts(ing parser.AnnotationInterface) ([]PortData, error) {\n\tlps := []PortData{}\n\tp, err := parser.GetStringAnnotation(\"listen-ports\", ing)\n\tif err != nil {\n\t\t// If port data is empty, default to port 80 or 443 contingent on whether a certArn was specified.\n\t\t_, err = parser.GetStringAnnotation(\"certificate-arn\", ing)\n\t\tif err != nil {\n\t\t\tlps = append(lps, PortData{int64(80), \"HTTP\"})\n\t\t} else {\n\t\t\tlps = append(lps, PortData{int64(443), \"HTTPS\"})\n\t\t}\n\t\treturn lps, nil\n\t}\n\n\t// Container to hold json in structured format after unmarshaling.\n\tc := []map[string]int64{}\n\terr = json.Unmarshal([]byte(*p), &c)\n\tif err != nil {\n\t\treturn nil, fmt.Errorf(\"listen-ports JSON structure was invalid: %s\", err.Error())\n\t}\n\n\t// Iterate over listeners in list. Validate port and protcol are correct, then inject them into\n\t// the list of ListenerPorts.\n\tfor _, l := range c {\n\t\tfor k, v := range l {\n\t\t\t// Verify port value is valid for ALB.\n\t\t\t// ALBS (from AWS): Ports need to be a number between 1 and 65535\n\t\t\tif v < 1 || v > 65535 {\n\t\t\t\treturn nil, fmt.Errorf(\"Invalid port provided. Must be between 1 and 65535. It was %d\", v)\n\t\t\t}\n\t\t\tswitch {\n\t\t\tcase k == \"HTTP\":\n\t\t\t\tlps = append(lps, PortData{v, k})\n\t\t\tcase k == \"HTTPS\":\n\t\t\t\tlps = append(lps, PortData{v, k})\n\t\t\tdefault:\n\t\t\t\treturn nil, fmt.Errorf(\"Invalid protocol provided. Must be HTTP or HTTPS and in order to use HTTPS you must have specified a certificate ARN\")\n\t\t\t}\n\t\t}\n\t}\n\n\treturn lps, nil\n}", "title": "" }, { "docid": "f404f9ada1503da348a21dc9d23297e6", "score": "0.41872725", "text": "func createPort(client *ovsdb.OvsdbClient, brName, portName string) error {\n\tifaceOperation := ovsdb.Operation{\n\t\tOp: \"insert\",\n\t\tTable: \"Interface\",\n\t\tRow: map[string]interface{}{\n\t\t\t\"name\": portName,\n\t\t},\n\t\tUUIDName: \"ifacedummy\",\n\t}\n\n\tportOperation := ovsdb.Operation{\n\t\tOp: \"insert\",\n\t\tTable: \"Port\",\n\t\tUUIDName: \"dummy\",\n\t\tRow: map[string]interface{}{\n\t\t\t\"name\": portName,\n\t\t\t\"interfaces\": ovsdb.UUID{GoUuid: \"ifacedummy\"},\n\t\t},\n\t}\n\n\tmutateOperation := ovsdb.Operation{\n\t\tOp: \"mutate\",\n\t\tTable: \"Bridge\",\n\t\tMutations: []interface{}{[]interface{}{\"ports\", \"insert\", ovsdb.UUID{GoUuid: \"dummy\"}}},\n\t\tWhere: []interface{}{[]interface{}{\"name\", \"==\", brName}},\n\t}\n\n\t_, err := ovsdbTransact(client, \"Open_vSwitch\", ifaceOperation, portOperation, mutateOperation)\n\treturn err\n}", "title": "" }, { "docid": "d99146a7d83f087a7135197c7430f512", "score": "0.41869694", "text": "func buildContainerPorts(userPort int32) []corev1.ContainerPort {\n\treturn []corev1.ContainerPort{{\n\t\tName: UserPortName,\n\t\tContainerPort: userPort,\n\t\tProtocol: corev1.ProtocolTCP,\n\t}}\n}", "title": "" }, { "docid": "888cb2a7725bd2441e76c806225d579e", "score": "0.41754496", "text": "func (service *Service) AddSchedule(endpointID portainer.EndpointID, schedule *portainer.EdgeSchedule) {\n\ttunnel := service.GetTunnelDetails(endpointID)\n\n\texistingScheduleIndex := -1\n\tfor idx, existingSchedule := range tunnel.Schedules {\n\t\tif existingSchedule.ID == schedule.ID {\n\t\t\texistingScheduleIndex = idx\n\t\t\tbreak\n\t\t}\n\t}\n\n\tif existingScheduleIndex == -1 {\n\t\ttunnel.Schedules = append(tunnel.Schedules, *schedule)\n\t} else {\n\t\ttunnel.Schedules[existingScheduleIndex] = *schedule\n\t}\n\n\tkey := strconv.Itoa(int(endpointID))\n\tservice.tunnelDetailsMap.Set(key, tunnel)\n}", "title": "" }, { "docid": "89f4e8830c159e999b974c2362ee6cdf", "score": "0.41684172", "text": "func CreatePortResources(portSet map[uint32]string) []*mesos.Resource {\n\tresources := []*mesos.Resource{}\n\tfor port, role := range portSet {\n\t\ttmp := uint64(port)\n\t\trs := NewMesosResourceBuilder().\n\t\t\tWithName(\"ports\").\n\t\t\tWithType(mesos.Value_RANGES).\n\t\t\tWithRole(role).\n\t\t\tWithRanges(&mesos.Value_Ranges{\n\t\t\t\tRange: []*mesos.Value_Range{\n\t\t\t\t\t{Begin: &tmp, End: &tmp},\n\t\t\t\t},\n\t\t\t}).\n\t\t\tBuild()\n\t\tresources = append(resources, rs)\n\t}\n\treturn resources\n}", "title": "" }, { "docid": "39a16ebf9dda5f57e8c2af7886cf5887", "score": "0.41668478", "text": "func (p *Proxy) AddRoute(ipPort string, dest Target) {\n\tp.addRoute(ipPort, fixedTarget{dest})\n}", "title": "" }, { "docid": "a78936b428d61752832b714204a8bd9f", "score": "0.41647834", "text": "func (puo *PropertyUpdateOne) SetEquipmentPort(e *EquipmentPort) *PropertyUpdateOne {\n\treturn puo.SetEquipmentPortID(e.ID)\n}", "title": "" } ]
6abee8d8c3b5be634830b37f98947b3a
validate returns nil if EFSVolumeConfiguration is configured correctly.
[ { "docid": "40d1c3d11789528fa1dcd6081c2c284d", "score": "0.7625969", "text": "func (e EFSVolumeConfiguration) validate() error {\n\tif e.IsEmpty() {\n\t\treturn nil\n\t}\n\tif !e.EmptyBYOConfig() && !e.EmptyUIDConfig() {\n\t\treturn &errFieldMutualExclusive{\n\t\t\tfirstField: \"uid/gid\",\n\t\t\tsecondField: \"id/root_dir/auth\",\n\t\t}\n\t}\n\tif e.UID != nil && e.GID == nil {\n\t\treturn &errFieldMustBeSpecified{\n\t\t\tmissingField: \"gid\",\n\t\t\tconditionalFields: []string{\"uid\"},\n\t\t}\n\t}\n\tif e.UID == nil && e.GID != nil {\n\t\treturn &errFieldMustBeSpecified{\n\t\t\tmissingField: \"uid\",\n\t\t\tconditionalFields: []string{\"gid\"},\n\t\t}\n\t}\n\tif e.UID != nil && *e.UID == 0 {\n\t\treturn fmt.Errorf(`\"uid\" must not be 0`)\n\t}\n\tif err := e.AuthConfig.validate(); err != nil {\n\t\treturn fmt.Errorf(`validate \"auth\": %w`, err)\n\t}\n\tif e.AuthConfig.AccessPointID != nil {\n\t\tif (aws.StringValue(e.RootDirectory) == \"\" || aws.StringValue(e.RootDirectory) == \"/\") &&\n\t\t\t(e.AuthConfig.IAM == nil || aws.BoolValue(e.AuthConfig.IAM)) {\n\t\t\treturn nil\n\t\t}\n\t\treturn fmt.Errorf(`\"root_dir\" must be either empty or \"/\" and \"auth.iam\" must be true when \"access_point_id\" is used`)\n\t}\n\tif e.RootDirectory != nil {\n\t\tif err := validateVolumePath(aws.StringValue(e.RootDirectory)); err != nil {\n\t\t\treturn fmt.Errorf(`validate \"root_dir\": %w`, err)\n\t\t}\n\t}\n\treturn nil\n}", "title": "" } ]
[ { "docid": "b6136764545b4c4bc6ff0a23a3f6da98", "score": "0.7009006", "text": "func (v Volume) validate() error {\n\tif err := v.EFS.validate(); err != nil {\n\t\treturn fmt.Errorf(`validate \"efs\": %w`, err)\n\t}\n\treturn v.MountPointOpts.validate()\n}", "title": "" }, { "docid": "8210ffc23fe15b1b41cd77fa2090f0f5", "score": "0.6714752", "text": "func (config DiskConfig) validate() error {\n\tswitch config {\n\tcase Auto, Manual:\n\t\treturn nil\n\tdefault:\n\t\treturn ErrInvalidDiskConfig\n\t}\n}", "title": "" }, { "docid": "399385be0eaa99ae0dbf8fb7b243c647", "score": "0.6588258", "text": "func (config *Configuration) validate() (isValid bool) {\n\tisValid = true // until proven otherwise\n\n\tmissing := func(str string) {\n\t\tfmt.Fprintf(os.Stderr, \"error: invalid config file: %s\\n\", str)\n\t\tisValid = false\n\t}\n\n\tif len(config.Spec) == 0 {\n\t\tmissing(\"no files/directories specified in the config file's spec.\")\n\t}\n\n\treturn\n}", "title": "" }, { "docid": "b8e8971e287f08c72b4e964f9848b119", "score": "0.65516824", "text": "func (e EFSConfigOrBool) validate() error {\n\tif e.IsEmpty() {\n\t\treturn nil\n\t}\n\treturn e.Advanced.validate()\n}", "title": "" }, { "docid": "af773104da90990fd95daee224fc4133", "score": "0.65194273", "text": "func (config StorageConfigStruct) Validate() error {\n\treturn nil\n}", "title": "" }, { "docid": "1d03e547fa65d37633af336cb5c530fb", "score": "0.64687747", "text": "func (a FIFOTopicAdvanceConfig) validate() error {\n\treturn nil\n}", "title": "" }, { "docid": "d08ecda6998932b897218f34273f98a1", "score": "0.639511", "text": "func (config *Config) Validate() error {\n\n\tif _, err := os.Stat(filepath.Join(config.KirdPath, config.KernelFile)); os.IsNotExist(err) {\n\t\treturn fmt.Errorf(\"kernel '%s' not found\", filepath.Join(config.KirdPath, config.KernelFile))\n\t}\n\tif _, err := os.Stat(filepath.Join(config.KirdPath, config.InitrdFile)); os.IsNotExist(err) {\n\t\treturn fmt.Errorf(\"initrd '%s' not found\", filepath.Join(config.KirdPath, config.InitrdFile))\n\t}\n\n\t// Ensure all the MappedVirtualDisks exist on the host\n\tfor _, mvd := range config.MappedVirtualDisks {\n\t\tif _, err := os.Stat(mvd.HostPath); err != nil {\n\t\t\treturn fmt.Errorf(\"mapped virtual disk '%s' not found\", mvd.HostPath)\n\t\t}\n\t\tif mvd.ContainerPath == \"\" {\n\t\t\treturn fmt.Errorf(\"mapped virtual disk '%s' requested without a container path\", mvd.HostPath)\n\t\t}\n\t}\n\n\treturn nil\n}", "title": "" }, { "docid": "86be821a0fd90343da9d0b34b89bd132", "score": "0.6202258", "text": "func (d *usb) validateConfig(instConf instance.ConfigReader) error {\n\tif !instanceSupported(instConf.Type(), instancetype.Container, instancetype.VM) {\n\t\treturn ErrUnsupportedDevType\n\t}\n\n\tif instConf.Architecture() == osarch.ARCH_64BIT_S390_BIG_ENDIAN {\n\t\treturn fmt.Errorf(\"USB devices aren't supported on s390x\")\n\t}\n\n\trules := map[string]func(string) error{\n\t\t\"vendorid\": validate.Optional(validate.IsDeviceID),\n\t\t\"productid\": validate.Optional(validate.IsDeviceID),\n\t\t\"uid\": unixValidUserID,\n\t\t\"gid\": unixValidUserID,\n\t\t\"mode\": unixValidOctalFileMode,\n\t\t\"required\": validate.Optional(validate.IsBool),\n\t}\n\n\terr := d.config.Validate(rules)\n\tif err != nil {\n\t\treturn err\n\t}\n\n\treturn nil\n}", "title": "" }, { "docid": "ad113f7240c8f5cb3a7585f79913e10d", "score": "0.6117641", "text": "func (s SidecarMountPoint) validate() error {\n\tif aws.StringValue(s.SourceVolume) == \"\" {\n\t\treturn &errFieldMustBeSpecified{\n\t\t\tmissingField: \"source_volume\",\n\t\t}\n\t}\n\treturn s.MountPointOpts.validate()\n}", "title": "" }, { "docid": "ddd2e8b4f35ff3f85ce250486a3abf4e", "score": "0.6112165", "text": "func (c Config) Validate() (err error) {\n\tvar fi os.FileInfo\n\n\t// validate key fingerprint\n\t_, err = HexStringToFingerprint(c.MasterKeyFingerprint)\n\tif err != nil {\n\t\treturn\n\t}\n\n\t// validate TLSCert\n\tif len(c.TLSCert) == 0 {\n\t\treturn errors.New(\"Missing config param: TLSCert\")\n\t}\n\tfi, err = os.Stat(c.TLSCert)\n\tif err != nil {\n\t\treturn fmt.Errorf(\"Config error in TLSCert '%s': %s\", c.TLSCert, err)\n\t}\n\tif fi.IsDir() {\n\t\treturn fmt.Errorf(\"Config error in TLSCert '%s': expected file path, got directory\", c.TLSCert)\n\t}\n\n\t// validate TLSKey\n\tif len(c.TLSKey) == 0 {\n\t\treturn errors.New(\"Missing config param: TLSKey\")\n\t}\n\tfi, err = os.Stat(c.TLSKey)\n\tif err != nil {\n\t\treturn fmt.Errorf(\"Config error in TLSKey '%s': %s\", c.TLSKey, err)\n\t}\n\tif fi.IsDir() {\n\t\treturn fmt.Errorf(\"Config error in TLSKey '%s': expected file path, got directory\", c.TLSKey)\n\t}\n\n\t// validate SecRing\n\tif len(c.SecRing) == 0 {\n\t\treturn errors.New(\"Missing config param: SecRing\")\n\t}\n\tfi, err = os.Stat(c.SecRing)\n\tif err != nil {\n\t\treturn fmt.Errorf(\"Config error in SecRing '%s': %s\", c.SecRing, err)\n\t}\n\tif fi.IsDir() {\n\t\treturn fmt.Errorf(\"Config error in SecRing '%s': expected file path, got directory\", c.SecRing)\n\t}\n\n\t// validate ProdSupportPubRing\n\tif len(c.ProdSupportPubRing) == 0 {\n\t\treturn errors.New(\"Missing config param: ProdSupportPubRing\")\n\t}\n\tfi, err = os.Stat(c.ProdSupportPubRing)\n\tif err != nil {\n\t\treturn fmt.Errorf(\"Config error in ProdSupportPubRing '%s': %s\", c.ProdSupportPubRing, err)\n\t}\n\tif fi.IsDir() {\n\t\treturn fmt.Errorf(\"Config error in ProdSupportPubRing '%s': expected file path, got directory\", c.ProdSupportPubRing)\n\t}\n\n\t// validate DataRoot\n\tif len(c.DataRoot) == 0 {\n\t\treturn errors.New(\"Missing config param: DataRoot\")\n\t}\n\tfi, err = os.Stat(c.DataRoot)\n\tif err != nil {\n\t\t// doesn't exist... can we create it?\n\t\tif err = os.MkdirAll(c.DataRoot, 0744); err != nil {\n\t\t\treturn fmt.Errorf(\"Config error in DataRoot '%s': %s\", c.DataRoot, err)\n\t\t}\n\t} else {\n\t\tif !fi.IsDir() {\n\t\t\treturn fmt.Errorf(\"Config error in DataRoot '%s': expected directory, got file path\", c.DataRoot)\n\t\t}\n\t}\n\n\t// validate ProdSupportDir\n\tif len(c.ProdSupportDir) == 0 {\n\t\treturn errors.New(\"Missing config param: ProdSupportDir\")\n\t}\n\tfi, err = os.Stat(c.ProdSupportDir)\n\tif err != nil {\n\t\t// doesn't exist... can we create it?\n\t\tif err = os.MkdirAll(c.ProdSupportDir, 0744); err != nil {\n\t\t\treturn fmt.Errorf(\"Config error in ProdSupportDir '%s': %s\", c.ProdSupportDir, err)\n\t\t}\n\t} else {\n\t\tif !fi.IsDir() {\n\t\t\treturn fmt.Errorf(\"Config error in ProdSupportDir '%s': expected directory, got file path\", c.ProdSupportDir)\n\t\t}\n\t}\n\n\t// validate KeyRoot\n\tif len(c.KeyRoot) == 0 {\n\t\treturn errors.New(\"Missing config param: KeyRoot\")\n\t}\n\tfi, err = os.Stat(c.KeyRoot)\n\tif err != nil {\n\t\t// doesn't exist... can we create it?\n\t\tif err = os.MkdirAll(c.KeyRoot, 0744); err != nil {\n\t\t\treturn fmt.Errorf(\"Config error in KeyRoot '%s': %s\", c.KeyRoot, err)\n\t\t}\n\t} else {\n\t\tif !fi.IsDir() {\n\t\t\treturn fmt.Errorf(\"Config error in KeyRoot '%s': expected directory, got file path\", c.KeyRoot)\n\t\t}\n\t}\n\n\t// validate MetaRoot\n\tif len(c.MetaRoot) == 0 {\n\t\treturn errors.New(\"Missing config param: MetaRoot\")\n\t}\n\tfi, err = os.Stat(c.MetaRoot)\n\tif err != nil {\n\t\t// doesn't exist... can we create it?\n\t\tif err = os.MkdirAll(c.MetaRoot, 0744); err != nil {\n\t\t\treturn fmt.Errorf(\"Config error in MetaRoot '%s': %s\", c.MetaRoot, err)\n\t\t}\n\t} else {\n\t\tif !fi.IsDir() {\n\t\t\treturn fmt.Errorf(\"Config error in MetaRoot '%s': expected directory, got file path\", c.MetaRoot)\n\t\t}\n\t}\n\n\t// validate HTTPLog\n\tif len(c.HTTPLog) > 0 {\n\t\tfi, err = os.Stat(filepath.Dir(c.HTTPLog))\n\t\tif err != nil {\n\t\t\t// doesn't exist... can we create it?\n\t\t\tif err = os.MkdirAll(filepath.Dir(c.HTTPLog), 0744); err != nil {\n\t\t\t\treturn fmt.Errorf(\"Config error in HTTPLog '%s': %s\", c.HTTPLog, err)\n\t\t\t}\n\t\t}\n\t}\n\n\t// validate HtpasswdFile\n\tif len(c.HtpasswdFile) == 0 {\n\t\treturn errors.New(\"Missing config param: HtpasswdFile\")\n\t}\n\tfi, err = os.Stat(c.HtpasswdFile)\n\tif err != nil {\n\t\treturn fmt.Errorf(\"Config error in HtpasswdFile '%s': %s\", c.HtpasswdFile, err)\n\t}\n\tif fi.IsDir() {\n\t\treturn fmt.Errorf(\"Config error in HtpasswdFile '%s': expected file path, got directory\", c.HtpasswdFile)\n\t}\n\n\tif len(c.MasterKeyPassphrase) == 0 {\n\t\tlog.Println(\"no passphrase specified for secure keyring\")\n\t}\n\n\treturn nil\n}", "title": "" }, { "docid": "1d59858217a04b5b0b176d1422125941", "score": "0.6052493", "text": "func (s SidecarConfig) validate() error {\n\tif err := s.validateImage(); err != nil {\n\t\treturn err\n\t}\n\tfor ind, mp := range s.MountPoints {\n\t\tif err := mp.validate(); err != nil {\n\t\t\treturn fmt.Errorf(`validate \"mount_points[%d]\": %w`, ind, err)\n\t\t}\n\t}\n\t_, protocol, err := ParsePortMapping(s.Port)\n\tif err != nil {\n\t\treturn err\n\t}\n\tif protocol != nil {\n\t\tprotocolVal := aws.StringValue(protocol)\n\t\tvar isValidProtocol bool\n\t\tfor _, valid := range validContainerProtocols {\n\t\t\tif strings.EqualFold(protocolVal, valid) {\n\t\t\t\tisValidProtocol = true\n\t\t\t\tbreak\n\t\t\t}\n\t\t}\n\t\tif !isValidProtocol {\n\t\t\treturn fmt.Errorf(`invalid protocol %s; valid protocols include %s`, protocolVal, english.WordSeries(validContainerProtocols, \"and\"))\n\t\t}\n\t}\n\tif err := s.HealthCheck.validate(); err != nil {\n\t\treturn fmt.Errorf(`validate \"healthcheck\": %w`, err)\n\t}\n\tif err := s.DependsOn.validate(); err != nil {\n\t\treturn fmt.Errorf(`validate \"depends_on\": %w`, err)\n\t}\n\tif s.EnvFile != nil {\n\t\tenvFile := aws.StringValue(s.EnvFile)\n\t\tif filepath.Ext(envFile) != envFileExt {\n\t\t\treturn fmt.Errorf(\"environment file %s must have a %s file extension\", envFile, envFileExt)\n\t\t}\n\t}\n\treturn s.ImageOverride.validate()\n}", "title": "" }, { "docid": "b25a2a2babeea1f2bce68980c5291cb0", "score": "0.601687", "text": "func (cfg *Config) Validate() error {\n\tif cfg.MetricTTL <= 0 {\n\t\treturn errors.New(\"disk.metric_ttl is invalid\")\n\t}\n\n\tif cfg.MetricType.String() == \"\" {\n\t\treturn errors.New(\"disk.metric_type is invalid\")\n\t}\n\treturn nil\n}", "title": "" }, { "docid": "54e6f5d866927d311e96f519eb55b032", "score": "0.6016121", "text": "func (v rdwsVpcConfig) validate() error {\n\tif v.isEmpty() {\n\t\treturn nil\n\t}\n\tif err := v.Placement.validate(); err != nil {\n\t\treturn fmt.Errorf(`validate \"placement\": %w`, err)\n\t}\n\treturn nil\n}", "title": "" }, { "docid": "dc6921e3e3ede002ecb23cf2db9e4230", "score": "0.59567136", "text": "func (config configuration) validate() error {\n\t_, err := govalidator.ValidateStruct(&config)\n\treturn err\n}", "title": "" }, { "docid": "27836cd6f03d96b551633de1d9bb3481", "score": "0.592475", "text": "func (c Config) Validate() error {\n\tif len(c.ClientID) == 0 {\n\t\treturn fmt.Errorf(\"error: ClientID missing\")\n\t}\n\n\tif c.VodID < 1 {\n\t\treturn fmt.Errorf(\"error: VodID missing\")\n\t}\n\n\ttimePattern := `\\d+ \\d+ \\d+`\n\ttimeRegex := regexp.MustCompile(timePattern)\n\tif c.StartTime != \"start\" && !timeRegex.MatchString(c.StartTime) {\n\t\treturn fmt.Errorf(\"error: StartTime must be 'start' or in format '%s'; got '%s'\", timePattern, c.StartTime)\n\t}\n\tif c.EndTime == \"\" && c.Length == \"\" {\n\t\treturn errors.New(\"error: must specify either EndTime or Length\")\n\t}\n\tif c.Length == \"\" && c.EndTime != \"end\" && !timeRegex.MatchString(c.EndTime) {\n\t\treturn fmt.Errorf(\"error: EndTime must be 'end' or in format '%s'; got '%s'\", timePattern, c.EndTime)\n\t}\n\tif c.EndTime == \"\" && c.Length != \"full\" && !timeRegex.MatchString(c.Length) {\n\t\treturn fmt.Errorf(\"error: Length must be 'full' or in format '%s'; got '%s'\", timePattern, c.Length)\n\t}\n\n\tqualityPattern := `\\d{3,4}p[36]0`\n\tqualityRegex := regexp.MustCompile(qualityPattern)\n\tif c.Quality != \"best\" && c.Quality != \"chunked\" && !qualityRegex.MatchString(c.Quality) {\n\t\treturn fmt.Errorf(\"error: Quality must be 'best', 'chunked', or in format '%s'; got '%s'\", qualityPattern, c.Quality)\n\t}\n\n\tif c.FilePrefix != \"\" && !isValidFilename(c.FilePrefix) {\n\t\treturn fmt.Errorf(\"error: FilePrefix contains invalid characters; got '%s'\", c.FilePrefix)\n\t}\n\n\tif c.Workers < 1 {\n\t\treturn fmt.Errorf(\"error: Worker must be an integer greater than 0; got '%d'\", c.Workers)\n\t}\n\n\treturn nil\n}", "title": "" }, { "docid": "cb90ef0f11bf4008e5670a32c3396db1", "score": "0.59229344", "text": "func (c *Config) validate() error {\n\tif c.iface == \"\" {\n\t\treturn errors.New(\"the iface must be set\")\n\t}\n\tif c.protocal != \"\" && c.protocal != \"tcp\" && c.protocal != \"udp\" {\n\t\treturn errors.New(\"the protocl must be set to tcp or udp or both\")\n\t}\n\treturn nil\n}", "title": "" }, { "docid": "7c63e8dc0c48464229c77d8794b38a1b", "score": "0.59143454", "text": "func (cfg *Config) Validate() error {\n\tif cfg.DisableValidation {\n\t\treturn nil\n\t}\n\n\tif _, err := os.Stat(cfg.KernelImagePath); err != nil {\n\t\treturn fmt.Errorf(\"failed to stat kernel image path, %q: %v\", cfg.KernelImagePath, err)\n\t}\n\n\tif cfg.InitrdPath != \"\" {\n\t\tif _, err := os.Stat(cfg.InitrdPath); err != nil {\n\t\t\treturn fmt.Errorf(\"failed to stat initrd image path, %q: %v\", cfg.InitrdPath, err)\n\t\t}\n\t}\n\n\tfor _, drive := range cfg.Drives {\n\t\tif BoolValue(drive.IsRootDevice) {\n\t\t\trootPath := StringValue(drive.PathOnHost)\n\t\t\tif _, err := os.Stat(rootPath); err != nil {\n\t\t\t\treturn fmt.Errorf(\"failed to stat host drive path, %q: %v\", rootPath, err)\n\t\t\t}\n\n\t\t\tbreak\n\t\t}\n\t}\n\n\t// Check the non-existence of some files:\n\tif _, err := os.Stat(cfg.SocketPath); err == nil {\n\t\treturn fmt.Errorf(\"socket %s already exists\", cfg.SocketPath)\n\t}\n\n\tif cfg.MachineCfg.VcpuCount == nil ||\n\t\tInt64Value(cfg.MachineCfg.VcpuCount) < 1 {\n\t\treturn fmt.Errorf(\"machine needs a nonzero VcpuCount\")\n\t}\n\tif cfg.MachineCfg.MemSizeMib == nil ||\n\t\tInt64Value(cfg.MachineCfg.MemSizeMib) < 1 {\n\t\treturn fmt.Errorf(\"machine needs a nonzero amount of memory\")\n\t}\n\tif cfg.MachineCfg.HtEnabled == nil {\n\t\treturn fmt.Errorf(\"machine needs a setting for ht_enabled\")\n\t}\n\treturn nil\n}", "title": "" }, { "docid": "c84032886a93ed6c283a3a2c2be9c4f7", "score": "0.5913741", "text": "func (c configuration) Validate() error {\n\tvar errs error\n\n\terrs = errors.Append(errs, c.Auth.Validate())\n\terrs = errors.Append(errs, c.Config.Validate())\n\n\tif c.Environment == \"\" {\n\t\terrs = errors.Append(errs, errors.New(\"environment is required\"))\n\t}\n\n\t// TODO: this config is only used here, so the validation is here too. Either the config or the validation should be moved somewhere else.\n\tif c.Distribution.PKE.Amazon.GlobalRegion == \"\" {\n\t\terrs = errors.Append(errs, errors.New(\"pke amazon global region is required\"))\n\t}\n\n\treturn errs\n}", "title": "" }, { "docid": "91713c30690623291364d1a04f965709", "score": "0.591249", "text": "func (c *configuration) validateConfig() error {\n\tif c.Provider == \"\" {\n\t\treturn errors.New(msgConfigNoProvider)\n\t}\n\n\tif len(c.Servers) == 0 {\n\t\treturn errors.New(msgConfigNoServers)\n\t}\n\n\tfor i, srv := range c.Servers {\n\t\tif srv.FabricIface == \"\" {\n\t\t\treturn errors.Errorf(\n\t\t\t\tmsgConfigServerNoIface+\" for I/O service %d\", i)\n\t\t}\n\t}\n\n\treturn nil\n}", "title": "" }, { "docid": "cb1c554b0877dec11bb34af50c112e79", "score": "0.59078395", "text": "func (c *RaftConfig) validate() error {\n\tif c.ID == 0 {\n\t\treturn errors.New(\"ID is required\")\n\t}\n\tif len(c.Peers) == 0 {\n\t\treturn errors.New(\"Peers is required\")\n\t}\n\t/*if c.Storage == nil {\n\t\treturn errors.New(\"Storage is required\")\n\t}\n\tif c.StateMachine == nil {\n\t\treturn errors.New(\"StateMachine is required\")\n\t}*/\n\n\treturn nil\n}", "title": "" }, { "docid": "5f119b74c475a7341db1d3fcdb9cddca", "score": "0.5888553", "text": "func (c Config) Validate() error {\n\tif c.PublicKeyPath == \"\" {\n\t\treturn errors.New(\"Public Key Path is required\")\n\t}\n\n\treturn nil\n}", "title": "" }, { "docid": "19140e9db4216881a769ec0172e9d7cb", "score": "0.5859276", "text": "func (cfg *Config) Validate() error {\n\tif cfg.Key == \"\" {\n\t\treturn errors.New(\"missing DigitalOcean access key\")\n\t}\n\n\treturn nil\n}", "title": "" }, { "docid": "0ac13322428eab1ff2de1dec11224d32", "score": "0.5831868", "text": "func (v *Volume) Validate() error {\n\tif v.Path == \"\" {\n\t\treturn maskAny(errgo.WithCausef(nil, ValidationError, \"path is empty\"))\n\t}\n\tif err := v.Type.Validate(); err != nil {\n\t\treturn maskAny(err)\n\t}\n\treturn nil\n}", "title": "" }, { "docid": "3389ab8ff05c77798f6955d4fafadab3", "score": "0.5821636", "text": "func (e ExecuteCommand) validate() error {\n\tif !e.Config.IsEmpty() {\n\t\treturn e.Config.validate()\n\t}\n\treturn nil\n}", "title": "" }, { "docid": "65866790c00a7bb3cd6c89ea1e809e64", "score": "0.5801755", "text": "func validateConfig() {\n\tvalidators := []*knf.Validator{\n\t\t{MAIN_RUN_USER, knfv.Empty, nil},\n\t\t{MAIN_RUN_GROUP, knfv.Empty, nil},\n\t\t{PATHS_WORKING_DIR, knfv.Empty, nil},\n\t\t{PATHS_HELPER_DIR, knfv.Empty, nil},\n\t\t{PATHS_SYSTEMD_DIR, knfv.Empty, nil},\n\t\t{PATHS_UPSTART_DIR, knfv.Empty, nil},\n\t\t{DEFAULTS_NPROC, knfv.Empty, nil},\n\t\t{DEFAULTS_NOFILE, knfv.Empty, nil},\n\t\t{DEFAULTS_RESPAWN_COUNT, knfv.Empty, nil},\n\t\t{DEFAULTS_RESPAWN_INTERVAL, knfv.Empty, nil},\n\t\t{DEFAULTS_KILL_TIMEOUT, knfv.Empty, nil},\n\n\t\t{DEFAULTS_NPROC, knfv.Less, 0},\n\t\t{DEFAULTS_NOFILE, knfv.Less, 0},\n\t\t{DEFAULTS_RESPAWN_COUNT, knfv.Less, 0},\n\t\t{DEFAULTS_RESPAWN_INTERVAL, knfv.Less, 0},\n\t\t{DEFAULTS_KILL_TIMEOUT, knfv.Less, 0},\n\n\t\t{MAIN_RUN_USER, knfs.User, nil},\n\t\t{MAIN_RUN_GROUP, knfs.Group, nil},\n\n\t\t{PATHS_WORKING_DIR, knff.Perms, \"DRWX\"},\n\t\t{PATHS_HELPER_DIR, knff.Perms, \"DRWX\"},\n\t}\n\n\tif knf.GetB(LOG_ENABLED, true) {\n\t\tvalidators = append(validators,\n\t\t\t&knf.Validator{LOG_DIR, knfv.Empty, nil},\n\t\t\t&knf.Validator{LOG_FILE, knfv.Empty, nil},\n\t\t\t&knf.Validator{LOG_DIR, knff.Perms, \"DWX\"},\n\t\t)\n\t}\n\n\terrs := knf.Validate(validators)\n\n\tif len(errs) != 0 {\n\t\tprintError(\"Errors while configuration validation:\")\n\n\t\tfor _, err := range errs {\n\t\t\tprintError(\" - %v\", err)\n\t\t}\n\n\t\tos.Exit(1)\n\t}\n}", "title": "" }, { "docid": "37592d974d74c15c9d7893b5e5f5a903", "score": "0.58000314", "text": "func validateVolume(volume *provider.Volume) (err error) {\n\tif volume == nil {\n\t\terr = userError.GetUserError(\"InvalidVolumeID\", nil, nil)\n\t\treturn\n\t}\n\n\tif IsValidVolumeIDFormat(volume.VolumeID) {\n\t\treturn nil\n\t}\n\terr = userError.GetUserError(\"InvalidVolumeID\", nil, volume.VolumeID)\n\treturn\n}", "title": "" }, { "docid": "9d930d552405d5208dc5e4ead85cbc2c", "score": "0.5792671", "text": "func (m MountPointOpts) validate() error {\n\tpath := aws.StringValue(m.ContainerPath)\n\tif path == \"\" {\n\t\treturn &errFieldMustBeSpecified{\n\t\t\tmissingField: \"path\",\n\t\t}\n\t}\n\tif err := validateVolumePath(path); err != nil {\n\t\treturn fmt.Errorf(`validate \"path\": %w`, err)\n\t}\n\treturn nil\n}", "title": "" }, { "docid": "6ef24b869c2934bf8ff39f8c2f86cfe6", "score": "0.57896435", "text": "func (cfg fromCFN) validate() error {\n\tif cfg.isEmpty() {\n\t\treturn nil\n\t}\n\tif len(aws.StringValue(cfg.Name)) == 0 {\n\t\treturn errors.New(\"name cannot be an empty string\")\n\t}\n\treturn nil\n}", "title": "" }, { "docid": "84b1da500fedc02a7d759c407c5a74f8", "score": "0.5769635", "text": "func ValidateVolumeSpec(volspec *api.VolumeSpecUpdate) error {\n\t// case of checking possible halevel flag combination\n\tif volspec.GetHaLevel() > 0 {\n\t\tif volspec.GetSize() > 0 || volspec.GetShared() || volspec.GetSticky() {\n\t\t\t// Please have unique msgs for each case so it's easy for use to identity the\n\t\t\t// flags mismatch combination.\n\t\t\treturn fmt.Errorf(\"Invalid halevel flag combination. Size, Shared or Sticky flag not supported \" +\n\t\t\t\t\"with halevel flag\")\n\t\t}\n\t}\n\treturn nil\n}", "title": "" }, { "docid": "e85a92625eddbf74f815f3ade1925ea4", "score": "0.57518864", "text": "func validateConfig(appConfig AppConfig) error {\n\n\treturn nil\n}", "title": "" }, { "docid": "2a369ad6a0d4e177d6362961de109aa3", "score": "0.5750115", "text": "func (v vpcConfig) validate() error {\n\tif v.isEmpty() {\n\t\treturn nil\n\t}\n\tif err := v.Placement.validate(); err != nil {\n\t\treturn fmt.Errorf(`validate \"placement\": %w`, err)\n\t}\n\tif err := v.SecurityGroups.validate(); err != nil {\n\t\treturn fmt.Errorf(`validate \"security_groups\": %w`, err)\n\t}\n\treturn nil\n}", "title": "" }, { "docid": "2d5fd490106396ebac4996c9ff3a731f", "score": "0.57345295", "text": "func (d *QemuDriver) Validate(config map[string]interface{}) error {\n\tfd := &fields.FieldData{\n\t\tRaw: config,\n\t\tSchema: map[string]*fields.FieldSchema{\n\t\t\t\"image_path\": {\n\t\t\t\tType: fields.TypeString,\n\t\t\t\tRequired: true,\n\t\t\t},\n\t\t\t\"accelerator\": {\n\t\t\t\tType: fields.TypeString,\n\t\t\t},\n\t\t\t\"graceful_shutdown\": {\n\t\t\t\tType: fields.TypeBool,\n\t\t\t\tRequired: false,\n\t\t\t},\n\t\t\t\"port_map\": {\n\t\t\t\tType: fields.TypeArray,\n\t\t\t},\n\t\t\t\"args\": {\n\t\t\t\tType: fields.TypeArray,\n\t\t\t},\n\t\t},\n\t}\n\n\tif err := fd.Validate(); err != nil {\n\t\treturn err\n\t}\n\n\treturn nil\n}", "title": "" }, { "docid": "487d3280472f5edcfa626010a1dc1565", "score": "0.5726651", "text": "func (c *Config) validate() error {\n\tif len(c.Port) == 0 {\n\t\treturn errors.New(\"missing port\")\n\t}\n\n\terr := c.BackendServerConfigs.validate()\n\tif err != nil {\n\t\treturn errors.Wrap(err, \"invalid backend servers configuration\")\n\t}\n\n\treturn nil\n}", "title": "" }, { "docid": "c5bce0e4178bb2e63e8ceaad7a88a2f9", "score": "0.5717045", "text": "func (c CheckpointStorageConfig) Validate() []error {\n\tm, err := c.ToModel()\n\n\tif err != nil {\n\t\treturn []error{\n\t\t\terr,\n\t\t}\n\t}\n\n\t// We cannot validate a SharedFSConfig until users have a chance to set\n\t// host_path.\n\tm.SharedFSConfig = nil\n\n\tif err := check.Validate(m); err != nil {\n\t\treturn []error{\n\t\t\terr,\n\t\t}\n\t}\n\n\treturn nil\n}", "title": "" }, { "docid": "e82396b688efd2ac65dc29d1b892f49e", "score": "0.57126707", "text": "func (d *DefaultDriver) ValidateVolumeSetup(vol *Volume) error {\n\treturn &errors.ErrNotSupported{\n\t\tType: \"Function\",\n\t\tOperation: \"ValidateVolumeSetup()\",\n\t}\n}", "title": "" }, { "docid": "610de3a71234852d1d68f83be7285c35", "score": "0.57100177", "text": "func (s Storage) validate() error {\n\tif s.IsEmpty() {\n\t\treturn nil\n\t}\n\tif s.Ephemeral != nil {\n\t\tephemeral := aws.IntValue(s.Ephemeral)\n\t\tif ephemeral < ephemeralMinValueGiB || ephemeral > ephemeralMaxValueGiB {\n\t\t\treturn fmt.Errorf(`validate \"ephemeral\": ephemeral storage must be between 20 GiB and 200 GiB`)\n\t\t}\n\t}\n\tvar hasManagedVolume bool\n\tfor k, v := range s.Volumes {\n\t\tif err := v.validate(); err != nil {\n\t\t\treturn fmt.Errorf(`validate \"volumes[%s]\": %w`, k, err)\n\t\t}\n\t\tif !v.EmptyVolume() && v.EFS.UseManagedFS() {\n\t\t\tif hasManagedVolume {\n\t\t\t\treturn fmt.Errorf(\"cannot specify more than one managed volume per service\")\n\t\t\t}\n\t\t\thasManagedVolume = true\n\t\t}\n\t}\n\treturn nil\n}", "title": "" }, { "docid": "a10873822307874e1b9d026546444f42", "score": "0.56902486", "text": "func (c *Config) Validate() error {\n\treturn nil\n}", "title": "" }, { "docid": "a10873822307874e1b9d026546444f42", "score": "0.56902486", "text": "func (c *Config) Validate() error {\n\treturn nil\n}", "title": "" }, { "docid": "a10873822307874e1b9d026546444f42", "score": "0.56902486", "text": "func (c *Config) Validate() error {\n\treturn nil\n}", "title": "" }, { "docid": "2278366100f1f95067db385d8e206e0f", "score": "0.56861883", "text": "func (o *VolumeCreateBody) Validate(formats strfmt.Registry) error {\n\treturn nil\n}", "title": "" }, { "docid": "d43240405ba409d23922c8ee7335984b", "score": "0.5685663", "text": "func (c *jsiiProxy_CfnVolume) Validate() *[]*string {\n\tvar returns *[]*string\n\n\t_jsii_.Invoke(\n\t\tc,\n\t\t\"validate\",\n\t\tnil, // no parameters\n\t\t&returns,\n\t)\n\n\treturn returns\n}", "title": "" }, { "docid": "dc17cc1d541ac2f7af5045931a7e9313", "score": "0.5684812", "text": "func (t *OpenconfigPlatform_Components_Component_Storage_Config) Validate(opts ...ygot.ValidationOption) error {\n\tif err := ytypes.Validate(SchemaTree[\"OpenconfigPlatform_Components_Component_Storage_Config\"], t, opts...); err != nil {\n\t\treturn err\n\t}\n\treturn nil\n}", "title": "" }, { "docid": "00e46147487549532e39a1e77012992a", "score": "0.56722486", "text": "func (l Logging) validate() error {\n\tif l.IsEmpty() {\n\t\treturn nil\n\t}\n\tif l.EnvFile != nil {\n\t\tenvFile := aws.StringValue(l.EnvFile)\n\t\tif filepath.Ext(envFile) != envFileExt {\n\t\t\treturn fmt.Errorf(\"environment file %s must have a %s file extension\", envFile, envFileExt)\n\t\t}\n\t}\n\treturn nil\n}", "title": "" }, { "docid": "fed1e60b5c3374e6b4574b504831b2c3", "score": "0.5654461", "text": "func (v *Config) Validate() error {\n\tctx := v.ctx\n\n\tif v.Log.Level == \"info\" {\n\t\tWarn.Println(ctx, \"info level hurts performance\")\n\t}\n\n\tif len(v.Stat.Disks) > 0 {\n\t\tWarn.Println(ctx, \"stat disks not support\")\n\t}\n\n\tif v.Workers < 0 || v.Workers > 64 {\n\t\treturn fmt.Errorf(\"workers must in [0, 64], actual is %v\", v.Workers)\n\t}\n\tif v.Listen <= 0 || v.Listen > 65535 {\n\t\treturn fmt.Errorf(\"listen must in (0, 65535], actual is %v\", v.Listen)\n\t}\n\tif v.ChunkSize < 128 || v.ChunkSize > 65535 {\n\t\treturn fmt.Errorf(\"chunk_size must in [128, 65535], actual is %v\", v.ChunkSize)\n\t}\n\n\tif v.Go.GcInterval < 0 || v.Go.GcInterval > 24*3600 {\n\t\treturn fmt.Errorf(\"go gc_interval must in [0, 24*3600], actual is %v\", v.Go.GcInterval)\n\t}\n\n\tif v.Log.Level != \"info\" && v.Log.Level != \"trace\" && v.Log.Level != \"warn\" && v.Log.Level != \"error\" {\n\t\treturn fmt.Errorf(\"log.leve must be info/trace/warn/error, actual is %v\", v.Log.Level)\n\t}\n\tif v.Log.Tank != \"console\" && v.Log.Tank != \"file\" {\n\t\treturn fmt.Errorf(\"log.tank must be console/file, actual is %v\", v.Log.Tank)\n\t}\n\tif v.Log.Tank == \"file\" && len(v.Log.File) == 0 {\n\t\treturn errors.New(\"log.file must not be empty for file tank\")\n\t}\n\n\tfor i, p := range v.Vhosts {\n\t\tif p.Name == \"\" {\n\t\t\treturn fmt.Errorf(\"the %v vhost is empty\", i)\n\t\t}\n\t}\n\n\treturn nil\n}", "title": "" }, { "docid": "36d8e640b64a2ed5de0abddb7e027b6e", "score": "0.56366414", "text": "func (m *FullVMConfiguration) Validate(formats strfmt.Registry) error {\n\tvar res []error\n\n\tif err := m.validateBalloon(formats); err != nil {\n\t\tres = append(res, err)\n\t}\n\n\tif err := m.validateBootSource(formats); err != nil {\n\t\tres = append(res, err)\n\t}\n\n\tif err := m.validateDrives(formats); err != nil {\n\t\tres = append(res, err)\n\t}\n\n\tif err := m.validateLogger(formats); err != nil {\n\t\tres = append(res, err)\n\t}\n\n\tif err := m.validateMachineConfig(formats); err != nil {\n\t\tres = append(res, err)\n\t}\n\n\tif err := m.validateMetrics(formats); err != nil {\n\t\tres = append(res, err)\n\t}\n\n\tif err := m.validateMmdsConfig(formats); err != nil {\n\t\tres = append(res, err)\n\t}\n\n\tif err := m.validateNetworkInterfaces(formats); err != nil {\n\t\tres = append(res, err)\n\t}\n\n\tif err := m.validateVsock(formats); err != nil {\n\t\tres = append(res, err)\n\t}\n\n\tif len(res) > 0 {\n\t\treturn errors.CompositeValidationError(res...)\n\t}\n\treturn nil\n}", "title": "" }, { "docid": "0f143dcffadad38da8dcab8566e6fd62", "score": "0.56235605", "text": "func (c *EtcdConfig) Validate() error {\n\t_, err := govalidator.ValidateStruct(c)\n\treturn err\n}", "title": "" }, { "docid": "c2b5d7ea3215060b518da91edf5c84f7", "score": "0.56108266", "text": "func (f FIFOTopicAdvanceConfigOrBool) validate() error {\n\tif f.IsEmpty() {\n\t\treturn nil\n\t}\n\treturn f.Advanced.validate()\n}", "title": "" }, { "docid": "bbcaf84f8873d63996e558af326ab23d", "score": "0.56070215", "text": "func validateConfig(conf *Config) {\n\t// Hopefully lxc package derives this correctly\n\tif conf.LXCPath == \"\" {\n\t\tconf.LXCPath = lxc.DefaultConfigPath()\n\t}\n\n\t// Generate \"Docker-style\" container names if it is not provided\n\tif conf.Name == \"\" {\n\t\tconf.Name = randomdata.SillyName()\n\t}\n}", "title": "" }, { "docid": "eb36da83e0c6d9cc52629897d012a686", "score": "0.5603885", "text": "func (c *Config) validate() error {\n\tif err := validation.ValidateStruct(c); err != nil {\n\t\treturn err\n\t}\n\n\tif c.EnableBuiltInFiltering != nil && !*c.EnableBuiltInFiltering {\n\t\treturn errors.New(\"enableBuiltInFiltering must be true or unset, false is no longer supported\")\n\t}\n\n\tif _, err := url.Parse(c.IngestURL); err != nil {\n\t\treturn fmt.Errorf(\"%s is not a valid ingest URL: %v\", c.IngestURL, err)\n\t}\n\n\tif _, err := url.Parse(c.APIURL); err != nil {\n\t\treturn fmt.Errorf(\"%s is not a valid API URL: %v\", c.APIURL, err)\n\t}\n\n\tif _, err := url.Parse(c.EventEndpointURL); err != nil {\n\t\treturn fmt.Errorf(\"%s is not a valid event endpoint URL: %v\", c.EventEndpointURL, err)\n\t}\n\n\tif c.TraceEndpointURL != \"\" {\n\t\tif _, err := url.Parse(c.TraceEndpointURL); err != nil {\n\t\t\treturn fmt.Errorf(\"%s is not a valid trace endpoint URL: %v\", c.TraceEndpointURL, err)\n\t\t}\n\t}\n\n\tif err := c.Collectd.Validate(); err != nil {\n\t\treturn err\n\t}\n\n\tfor i := range c.Monitors {\n\t\tif err := c.Monitors[i].Validate(); err != nil {\n\t\t\treturn fmt.Errorf(\"monitor config for type '%s' is invalid: %v\", c.Monitors[i].Type, err)\n\t\t}\n\t}\n\n\treturn c.Writer.Validate()\n}", "title": "" }, { "docid": "efed9239da4610182c258a42e34a9916", "score": "0.55933225", "text": "func (c *Config) Validate() error {\n\tif c.ServerConf.RestAPIPort < 0 || c.ServerConf.RestAPIPort > 65535 {\n\t\treturn errors.New(\"invalid restful port: \" + strconv.Itoa(c.ServerConf.RestAPIPort))\n\t}\n\n\t// remove \"/\"\n\tc.ZeekConf.LogDir = processDirName(c.ZeekConf.LogDir)\n\tc.ZeekConf.PcapDir = processDirName(c.ZeekConf.PcapDir)\n\tc.ZeekConf.ExtractedFileDir = processDirName(c.ZeekConf.ExtractedFileDir)\n\tc.SeaweedfsConf.ExtractedFileDir = processDirName(c.SeaweedfsConf.ExtractedFileDir)\n\n\tif c.SeaweedfsConf.Retries < 1 {\n\t\treturn errors.New(\"seaweedfs post retry times < 1\")\n\t}\n\treturn nil\n}", "title": "" }, { "docid": "588af0306b309106186379c19264acd2", "score": "0.5575115", "text": "func (c openIDConfiguration) Validate() error {\n\tswitch {\n\tcase c.Issuer == \"\":\n\t\treturn errors.New(\"issuer cannot be empty\")\n\tcase c.JWKSetURI == \"\":\n\t\treturn errors.New(\"jwks_uri cannot be empty\")\n\tdefault:\n\t\treturn nil\n\t}\n}", "title": "" }, { "docid": "708d323c845ac91e2db8391bdcba0a03", "score": "0.5562693", "text": "func (c Config) Validate() error {\n\tif c.Host == \"\" {\n\t\treturn errors.New(\"cadence host is required\")\n\t}\n\n\tif c.Port == 0 {\n\t\treturn errors.New(\"cadence port is required\")\n\t}\n\n\tif c.Domain == \"\" {\n\t\treturn errors.New(\"cadence domain is required\")\n\t}\n\n\treturn nil\n}", "title": "" }, { "docid": "0b66ee9ea452d4aafbfc4675f74ca8d6", "score": "0.55522066", "text": "func (cfg *Config) validate() error {\n\tif cfg.Range&^rangebits != 0 && cfg.Range != 1 {\n\t\treturn ErrBadRange\n\t}\n\treturn nil\n}", "title": "" }, { "docid": "8164459cec53cf466f9949c86cc16042", "score": "0.554278", "text": "func (c Config) Validate() error {\n\tif len(c.Project) == 0 {\n\t\treturn errors.New(\"missing project in configuration\")\n\t}\n\tif len(c.Bucket) == 0 {\n\t\treturn errors.New(\"missing bucket in configuration\")\n\t}\n\tif len(c.LastMigrationObjectName) == 0 {\n\t\treturn errors.New(\"missing state name in configuration\")\n\t}\n\treturn nil\n}", "title": "" }, { "docid": "18860330e0a9565a8a39ca17b987eda6", "score": "0.5539412", "text": "func (ExecuteCommandConfig) validate() error {\n\treturn nil\n}", "title": "" }, { "docid": "6f10774b7201c223813dcbc00e96064d", "score": "0.5534351", "text": "func (cfg *Config) Validate() error {\n\tif cfg.Engine != StorageEngineChunks && cfg.Engine != StorageEngineBlocks {\n\t\treturn errors.New(\"unsupported storage engine\")\n\t}\n\tif err := cfg.CassandraStorageConfig.Validate(); err != nil {\n\t\treturn errors.Wrap(err, \"invalid Cassandra Storage config\")\n\t}\n\tif err := cfg.GCPStorageConfig.Validate(util_log.Logger); err != nil {\n\t\treturn errors.Wrap(err, \"invalid GCP Storage Storage config\")\n\t}\n\tif err := cfg.Swift.Validate(); err != nil {\n\t\treturn errors.Wrap(err, \"invalid Swift Storage config\")\n\t}\n\tif err := cfg.IndexQueriesCacheConfig.Validate(); err != nil {\n\t\treturn errors.Wrap(err, \"invalid Index Queries Cache config\")\n\t}\n\tif err := cfg.AzureStorageConfig.Validate(); err != nil {\n\t\treturn errors.Wrap(err, \"invalid Azure Storage config\")\n\t}\n\tif err := cfg.AWSStorageConfig.Validate(); err != nil {\n\t\treturn errors.Wrap(err, \"invalid AWS Storage config\")\n\t}\n\treturn nil\n}", "title": "" }, { "docid": "f9de2bd0f771f06abbd9e17c5c9c7e6a", "score": "0.5534124", "text": "func (c *chainConfig) validate() error {\n\tswitch {\n\tcase c.NodeUrl == \"\":\n\t\treturn errors.New(\"empty node url\")\n\tcase c.BlockQueryDepth < 1 || c.BlockQueryDepth > 1000:\n\t\treturn errors.New(\"block query depth out of range\")\n\tdefault:\n\t\treturn nil\n\t}\n}", "title": "" }, { "docid": "9b9edb11f7867c317bae0413f84eddb5", "score": "0.5528067", "text": "func validateConfig(config ProvisionerConfig) error {\n\tswitch config.CloudProvider {\n\tcase constants.AWS, constants.Azure, constants.GCE, constants.Ops:\n\tdefault:\n\t\treturn trace.BadParameter(\"unknown cloud provider %s\", config.CloudProvider)\n\t}\n\n\terr := validator.New().Struct(&config)\n\tif err == nil {\n\t\treturn nil\n\t}\n\n\tvar errs []error\n\tif validationErrors, ok := err.(validator.ValidationErrors); ok {\n\t\tfor _, fieldError := range validationErrors {\n\t\t\terrs = append(errs,\n\t\t\t\ttrace.BadParameter(` * %s=\"%v\" fails \"%s\"`,\n\t\t\t\t\tfieldError.Field(), fieldError.Value(), fieldError.Tag()))\n\t\t}\n\t}\n\treturn trace.NewAggregate(errs...)\n}", "title": "" }, { "docid": "f0ba956ff7e89e6623ebe61be85f68f3", "score": "0.55262196", "text": "func (c *Config) validate() error {\n\tdataDir, err := filepath.Abs(c.DataDir)\n\tif err != nil {\n\t\treturn errors.WithStack(err)\n\t}\n\tlogFile, err := filepath.Abs(c.Log.File.Filename)\n\tif err != nil {\n\t\treturn errors.WithStack(err)\n\t}\n\trel, err := filepath.Rel(dataDir, filepath.Dir(logFile))\n\tif err != nil {\n\t\treturn errors.WithStack(err)\n\t}\n\tif !strings.HasPrefix(rel, \"..\") {\n\t\treturn errors.New(\"log directory shouldn't be the subdirectory of data directory\")\n\t}\n\n\treturn nil\n}", "title": "" }, { "docid": "af92b89f05d95e6ae406bf842b85a0d9", "score": "0.55248225", "text": "func (r RequestDrivenWebServiceConfig) validate() error {\n\tvar err error\n\tif err = r.ImageConfig.validate(); err != nil {\n\t\treturn fmt.Errorf(`validate \"image\": %w`, err)\n\t}\n\tif err = r.InstanceConfig.validate(); err != nil {\n\t\treturn err\n\t}\n\tif err = r.RequestDrivenWebServiceHttpConfig.validate(); err != nil {\n\t\treturn fmt.Errorf(`validate \"http\": %w`, err)\n\t}\n\tif err = r.PublishConfig.validate(); err != nil {\n\t\treturn fmt.Errorf(`validate \"publish\": %w`, err)\n\t}\n\tif err = r.Network.validate(); err != nil {\n\t\treturn fmt.Errorf(`validate \"network\": %w`, err)\n\t}\n\tif r.Network.VPC.Placement.PlacementString != nil &&\n\t\t*r.Network.VPC.Placement.PlacementString != PrivateSubnetPlacement {\n\t\treturn fmt.Errorf(`placement %q is not supported for %s`,\n\t\t\t*r.Network.VPC.Placement.PlacementString, manifestinfo.RequestDrivenWebServiceType)\n\t}\n\tif err = r.Observability.validate(); err != nil {\n\t\treturn fmt.Errorf(`validate \"observability\": %w`, err)\n\t}\n\treturn nil\n}", "title": "" }, { "docid": "4a8207f20d461b07a28442c0bf0ef151", "score": "0.5522626", "text": "func validateVdcConfigurationV97(vdcDefinition types.VdcConfiguration) error {\n\terr := validateVdcConfiguration(&vdcDefinition)\n\tif err != nil {\n\t\treturn err\n\t}\n\tif vdcDefinition.AllocationModel == \"Flex\" && vdcDefinition.IsElastic == nil {\n\t\treturn errors.New(\"VdcConfiguration missing required field: IsElastic\")\n\t}\n\tif vdcDefinition.AllocationModel == \"Flex\" && vdcDefinition.IncludeMemoryOverhead == nil {\n\t\treturn errors.New(\"VdcConfiguration missing required field: IncludeMemoryOverhead\")\n\t}\n\treturn nil\n}", "title": "" }, { "docid": "bbecbdce81bf66ac2841d66083030639", "score": "0.5518292", "text": "func (cfg *Config) Validate() error {\n\tif len(cfg.Key) == 0 {\n\t\treturn trace.BadParameter(`etcd: missing \"prefix\" parameter`)\n\t}\n\t// Make sure the prefix starts with a '/'.\n\tif cfg.Key[0] != '/' {\n\t\tcfg.Key = \"/\" + cfg.Key\n\t}\n\tif len(cfg.Nodes) == 0 {\n\t\treturn trace.BadParameter(`etcd: missing \"peers\" parameter`)\n\t}\n\tif !cfg.Insecure {\n\t\tif cfg.TLSCAFile == \"\" {\n\t\t\treturn trace.BadParameter(`etcd: missing \"tls_ca_file\" parameter`)\n\t\t}\n\t}\n\tif cfg.BufferSize == 0 {\n\t\tcfg.BufferSize = backend.DefaultBufferCapacity\n\t}\n\tif cfg.DialTimeout == 0 {\n\t\tcfg.DialTimeout = apidefaults.DefaultIOTimeout\n\t}\n\tif cfg.PasswordFile != \"\" {\n\t\tout, err := os.ReadFile(cfg.PasswordFile)\n\t\tif err != nil {\n\t\t\treturn trace.ConvertSystemError(err)\n\t\t}\n\t\t// trim newlines as passwords in files tend to have newlines\n\t\tcfg.Password = strings.TrimSpace(string(out))\n\t}\n\n\tif cfg.ClientPoolSize < 1 {\n\t\tcfg.ClientPoolSize = defaultClientPoolSize\n\t}\n\treturn nil\n}", "title": "" }, { "docid": "d1e546de1aa2f5db729336e51843d08a", "score": "0.5517135", "text": "func (config *Config) validateConfig() error {\n\tfor _, element := range config.AllowedEntries {\n\t\tif element.Width <= 0 && element.Height <= 0 {\n\t\t\treturn fmt.Errorf(\"The width and height of the configuration element with name \\\"%s\\\" are invalid.\", element.Name)\n\t\t}\n\n\t\tif element.Name == \"\" {\n\t\t\treturn fmt.Errorf(\"Name must be set\")\n\t\t}\n\n\t\tif element.Type == \"\" {\n\t\t\treturn fmt.Errorf(\"Type must be set\")\n\t\t}\n\n\t\ttypes := paint.GetAvailableTypes()\n\t\tif _, found := types[element.Type]; !found {\n\t\t\treturn fmt.Errorf(\"Type must be either %s, %s or %s at element \\\"%s\\\"\", paint.TypeCrop, paint.TypeResize, paint.TypeFit, element.Name)\n\t\t}\n\t}\n\n\treturn nil\n}", "title": "" }, { "docid": "b4e4d2c961b2c8f4b44eb7a2c96aba1b", "score": "0.54965234", "text": "func (c Config) Validate() error {\n\tif c.ServiceName == \"\" {\n\t\treturn xerrors.New(\"ocagent: service name must not be blank\")\n\t}\n\treturn nil\n}", "title": "" }, { "docid": "ebecea124ca8d6b976e7cabd12a1209e", "score": "0.5486891", "text": "func (c *Config) validate() error {\n\t/* Metrics */\n\n\t// Users can omit the metrics block entirely to disable metrics reporting.\n\tif c.Metrics != nil && c.Metrics.Statsd != nil {\n\t\tif c.Metrics.Statsd.Address == \"\" {\n\t\t\treturn fmt.Errorf(\"config: missing metrics statsd address\")\n\t\t}\n\n\t\tif c.Metrics.Statsd.SampleRate < 0 || c.Metrics.Statsd.SampleRate > 1 {\n\t\t\treturn fmt.Errorf(\"config: statsd sample rate must be in range [0.0, 1.0]\")\n\t\t}\n\t}\n\n\t/* Listener */\n\n\tif c.Listener == nil {\n\t\treturn fmt.Errorf(\"config: missing top-level listener config key\")\n\t}\n\n\tif c.Listener.TCP == nil && c.Listener.UDP == nil {\n\t\treturn fmt.Errorf(\"config: at least one TCP or UDP listener must be specified\")\n\t}\n\n\tif c.Listener.TCP != nil && c.Listener.TCP.Address == \"\" {\n\t\treturn fmt.Errorf(\"config: missing TCP server listening address\")\n\t}\n\n\tif c.Listener.UDP != nil && c.Listener.UDP.Address == \"\" {\n\t\treturn fmt.Errorf(\"config: missing UDP server listening address\")\n\t}\n\n\t/* Upstream */\n\n\tif c.Upstream == nil {\n\t\treturn fmt.Errorf(\"config: missing top-level upstream config key\")\n\t}\n\n\t// Validate the load balancing policy, only if provided (empty signifies default).\n\tif c.Upstream.LoadBalancingPolicy != \"\" {\n\t\tif _, ok := network.ParseLoadBalancingPolicy(c.Upstream.LoadBalancingPolicy); !ok {\n\t\t\treturn fmt.Errorf(\n\t\t\t\t\"config: unknown load balancing policy: policy=%s\",\n\t\t\t\tc.Upstream.LoadBalancingPolicy,\n\t\t\t)\n\t\t}\n\t}\n\n\tif len(c.Upstream.Servers) == 0 {\n\t\treturn fmt.Errorf(\"config: no upstream servers specified\")\n\t}\n\n\tfor idx, server := range c.Upstream.Servers {\n\t\tif server.Address == \"\" {\n\t\t\treturn fmt.Errorf(\"config: missing server address: idx=%d\", idx)\n\t\t}\n\n\t\tif server.ServerName == \"\" {\n\t\t\treturn fmt.Errorf(\"config: missing server TLS hostname: idx=%d\", idx)\n\t\t}\n\t}\n\n\treturn nil\n}", "title": "" }, { "docid": "87559eed1b9b4d1cf3ac4cc51135aff3", "score": "0.54867", "text": "func (SecurityGroupsConfig) validate() error {\n\treturn nil\n}", "title": "" }, { "docid": "be47f019073071ca43321df44fc4946b", "score": "0.5486202", "text": "func (c *Config) Validate() error {\n\t// TODO(felix): complete validates\n\treturn nil\n}", "title": "" }, { "docid": "2a81a1e0962a9aedc8ef408391656575", "score": "0.5484527", "text": "func (c *Config) Validate() error {\n\t// Resolve symlinks.\n\tfor i, p := range c.Paths {\n\t\tif evalPath, err := filepath.EvalSymlinks(p); err == nil {\n\t\t\tc.Paths[i] = evalPath\n\t\t}\n\t}\n\t// Sort and deduplicate.\n\tsort.Strings(c.Paths)\n\tc.Paths = deduplicate(c.Paths)\n\n\tvar errs multierror.Errors\n\tvar err error\n\nnextHash:\n\tfor _, ht := range c.HashTypes {\n\t\tht = HashType(strings.ToLower(string(ht)))\n\t\tfor _, validHash := range validHashes {\n\t\t\tif ht == validHash {\n\t\t\t\tcontinue nextHash\n\t\t\t}\n\t\t}\n\t\terrs = append(errs, errors.Errorf(\"invalid hash_types value '%v'\", ht))\n\t}\n\n\tc.MaxFileSizeBytes, err = humanize.ParseBytes(c.MaxFileSize)\n\tif err != nil {\n\t\terrs = append(errs, errors.Wrap(err, \"invalid max_file_size value\"))\n\t} else if c.MaxFileSizeBytes <= 0 {\n\t\terrs = append(errs, errors.Errorf(\"max_file_size value (%v) must be positive\", c.MaxFileSize))\n\t}\n\n\tc.ScanRateBytesPerSec, err = humanize.ParseBytes(c.ScanRatePerSec)\n\tif err != nil {\n\t\terrs = append(errs, errors.Wrap(err, \"invalid scan_rate_per_sec value\"))\n\t}\n\treturn errs.Err()\n}", "title": "" }, { "docid": "528995536ae447caf45d71fdf5cbcb6c", "score": "0.5481482", "text": "func validateCreateVolumeRequest(req *csi.CreateVolumeRequest) error {\n\tif req.GetName() == \"\" {\n\t\treturn errors.New(\"volume name cannot be empty\")\n\t}\n\n\treqCaps := req.GetVolumeCapabilities()\n\tif reqCaps == nil {\n\t\treturn errors.New(\"volume capabilities cannot be empty\")\n\t}\n\n\tfor _, cap := range reqCaps {\n\t\tif cap.GetBlock() != nil {\n\t\t\treturn errors.New(\"block access type not allowed\")\n\t\t}\n\t}\n\n\tif req.GetSecrets() == nil || len(req.GetSecrets()) == 0 {\n\t\treturn errors.New(\"secrets cannot be nil or empty\")\n\t}\n\n\treturn nil\n}", "title": "" }, { "docid": "b23cf51a032fd4a717f5214750c15fc8", "score": "0.54812", "text": "func (s *OpenconfigOfficeAp_VendorConfig) Validate() error {\n\tif err := ytypes.Validate(SchemaTree[\"OpenconfigOfficeAp_VendorConfig\"], s); err != nil {\n\t\treturn err\n\t}\n\treturn nil\n}", "title": "" }, { "docid": "cf15edf86afadc6d4e16954dffd19306", "score": "0.5477793", "text": "func (a AuthorizationConfig) validate() error {\n\tif a.IsEmpty() {\n\t\treturn nil\n\t}\n\treturn nil\n}", "title": "" }, { "docid": "88b24bc5f6a296f309bfdb691730cc4f", "score": "0.5476084", "text": "func (c *Configuration) Validate() error {\n\tif c.PeekMax < 0 {\n\t\treturn errors.New(\"The maximum peek depth for PipeScript must be > 0\")\n\t}\n\tif c.SplitMax < 0 {\n\t\treturn errors.New(\"The maximum data split size in PipeScript must be > 0\")\n\t}\n\tif c.StringMax < 0 {\n\t\treturn errors.New(\"The maximum string size in PipeScript must be > 0\")\n\t}\n\n\treturn nil\n}", "title": "" }, { "docid": "d392dd458c02ad623c4349f19bdcb892", "score": "0.5474207", "text": "func (config AppConfigStruct) Validate() error {\n\treturn nil\n}", "title": "" }, { "docid": "5892df58bd218ba3a674d4d6fd336546", "score": "0.54733896", "text": "func (r RequestDrivenWebServiceHttpConfig) validate() error {\n\tif err := r.HealthCheckConfiguration.validate(); err != nil {\n\t\treturn err\n\t}\n\treturn r.Private.validate()\n}", "title": "" }, { "docid": "ccc12c0944fe4274e70aa9efb0ffc7a3", "score": "0.5462922", "text": "func (o *StorageCreateOptions) Validate() (err error) {\n\tif o.isDevfile {\n\t\treturn\n\t}\n\t// validate storage path\n\treturn o.LocalConfigInfo.ValidateStorage(o.storageName, o.storagePath)\n}", "title": "" }, { "docid": "278ab33db769603a40b287e0fc21f865", "score": "0.54577947", "text": "func ensureVolumeOptions(v string) (vo cloudprovider.VolumeOptions) {\n\terr := json.Unmarshal([]byte(v), &vo)\n\tif err != nil {\n\t\tfatalf(\"Invalid json options: %s\", v)\n\t}\n\treturn\n}", "title": "" }, { "docid": "167882dff2f4cb56d5e5efe329a596e6", "score": "0.54549634", "text": "func (config *Configuration) Validate() error {\n\tvar errs []string\n\tvar undefinedErrs []string\n\n\tif config.HcloudAPIToken == \"\" {\n\t\tundefinedErrs = append(errs, \"hetzner cloud API token\")\n\t}\n\tif config.NodeName == \"\" {\n\t\tundefinedErrs = append(errs, \"kubernetes node name\")\n\t}\n\tif config.Namespace == \"\" {\n\t\tundefinedErrs = append(errs, \"kubernetes namespace\")\n\t}\n\n\tif config.LeaseDuration <= 0 {\n\t\terrs = append(errs, \"lease duration needs to be greater than 0\")\n\t}\n\tif config.LeaseRenewDeadline <= 0 {\n\t\terrs = append(errs, \"lease renew deadline needs to be greater than 0\")\n\t}\n\tif config.LeaseRenewDeadline >= config.LeaseDuration {\n\t\terrs = append(errs, \"lease renew deadline needs to be smaller than lease duration\")\n\t}\n\n\tif config.BackoffDuration == 0 {\n\t\terrs = append(errs, \"backoff duration is not a valid duration or 0\")\n\t}\n\n\tif config.BackoffFactor < 1 {\n\t\terrs = append(errs, \"backoff factor must be at least 1\")\n\t}\n\n\tif config.BackoffSteps < 0 {\n\t\terrs = append(errs, \"backoff steps need to be greater than 0\")\n\t}\n\n\tif len(undefinedErrs) > 0 {\n\t\terrs = append(errs, fmt.Sprintf(\"required configuration options not configured: %s\", strings.Join(undefinedErrs, \", \")))\n\t}\n\tif len(errs) > 0 {\n\t\treturn fmt.Errorf(\"%s\", strings.Join(errs, \", \"))\n\t}\n\treturn nil\n}", "title": "" }, { "docid": "518a2a380d507ffab30de5d9bf7e9005", "score": "0.54461837", "text": "func (c *Config) Validate() {\n\tif c.Global.TempDir == \"\" {\n\t\tc.Global.TempDir = \"/tmp/\"\n\t} else if !strings.HasSuffix(c.Global.TempDir, \"/\") {\n\t\tc.Global.TempDir += \"/\"\n\t}\n\tif c.Imessage.QueueSize < 20 {\n\t\tc.Imessage.QueueSize = 20\n\t}\n}", "title": "" }, { "docid": "1b440baec9f9fade60f0c2abd3d5a0f8", "score": "0.54372984", "text": "func Validate(e legacyconfigv1.ProjectConfig) error {\n\treturn nil\n}", "title": "" }, { "docid": "0023f171a3e6d53f610680a2c96b60b2", "score": "0.5432083", "text": "func validateConfig(config *ProviderConfig) error {\n\t// Validate the inputs\n\tif config == nil {\n\t\treturn fmt.Errorf(\"missing config\")\n\t}\n\tif config.Service == nil {\n\t\treturn fmt.Errorf(\"missing service\")\n\t}\n\tif config.Service.Service == \"\" {\n\t\treturn fmt.Errorf(\"missing service name\")\n\t}\n\tif config.Service.ServiceVersion == \"\" {\n\t\treturn fmt.Errorf(\"missing service version\")\n\t}\n\tif config.Service.ResourceType == \"\" {\n\t\treturn fmt.Errorf(\"missing service resource type\")\n\t}\n\tif config.Handlers == nil && len(config.Service.Capabilities) != 0 {\n\t\treturn fmt.Errorf(\"missing handlers\")\n\t}\n\tfor c := range config.Service.Capabilities {\n\t\tif _, ok := config.Handlers[c]; !ok {\n\t\t\treturn fmt.Errorf(\"missing handler for '%s' capability\", c)\n\t\t}\n\t}\n\tif config.ResourceGroup == \"\" {\n\t\treturn fmt.Errorf(\"missing resource group\")\n\t}\n\tif config.Token == \"\" {\n\t\tconfig.Token = os.Getenv(\"ATLAS_TOKEN\")\n\t}\n\tif config.Token == \"\" {\n\t\treturn fmt.Errorf(\"missing token\")\n\t}\n\n\t// Default the endpoint\n\tif config.Endpoint == \"\" {\n\t\tconfig.Endpoint = DefaultEndpoint\n\t\tif end := os.Getenv(\"SCADA_ENDPOINT\"); end != \"\" {\n\t\t\tconfig.Endpoint = end\n\t\t}\n\t}\n\treturn nil\n}", "title": "" }, { "docid": "a473e349bbfeadb9c8370bd6062201de", "score": "0.5428458", "text": "func (c *KubeadmConfigSpec) Validate(pathPrefix *field.Path) field.ErrorList {\n\tvar allErrs field.ErrorList\n\n\tallErrs = append(allErrs, c.validateFiles(pathPrefix)...)\n\tallErrs = append(allErrs, c.validateUsers(pathPrefix)...)\n\tallErrs = append(allErrs, c.validateIgnition(pathPrefix)...)\n\n\treturn allErrs\n}", "title": "" }, { "docid": "dd2c352cac9c5b6c317eebceff94630c", "score": "0.5427951", "text": "func (e ExternalService) validateConfig() error {\n\tsl := gojsonschema.NewSchemaLoader()\n\tsc, err := sl.Compile(gojsonschema.NewStringLoader(e.schema()))\n\tif err != nil {\n\t\treturn errors.Wrapf(err, \"failed to compile schema for external service of kind %q\", e.Kind)\n\t}\n\n\tnormalized, err := jsonc.Parse(e.Config)\n\tif err != nil {\n\t\treturn errors.Wrapf(err, \"failed to normalize JSON\")\n\t}\n\n\tres, err := sc.Validate(gojsonschema.NewBytesLoader(normalized))\n\tif err != nil {\n\t\treturn errors.Wrap(err, \"failed to validate config against schema\")\n\t}\n\n\terrs := new(multierror.Error)\n\tfor _, err := range res.Errors() {\n\t\terrs = multierror.Append(errs, errors.New(err.String()))\n\t}\n\n\treturn errs.ErrorOrNil()\n}", "title": "" }, { "docid": "c31d492c61852766def00b2acf51078c", "score": "0.5426168", "text": "func (cfg config) Validate() {\n\tif v, exists := cfg[\"tls_min_version\"]; exists {\n\t\tvar t tlsMinVersionOption\n\t\terr := t.Set(fmt.Sprintf(\"%v\", v))\n\t\tif err == nil {\n\t\t\tnewVal := fmt.Sprintf(\"%v\", t.Get())\n\t\t\tif newVal != \"0\" {\n\t\t\t\tcfg[\"tls_min_version\"] = newVal\n\t\t\t} else {\n\t\t\t\tdelete(cfg, \"tls_min_version\")\n\t\t\t}\n\t\t} else {\n\t\t\tlogFatal(\"failed parsing tls_min_version %+v\", v)\n\t\t}\n\t}\n\tif v, exists := cfg[\"log_level\"]; exists {\n\t\tvar t lg.LogLevel\n\t\terr := t.Set(fmt.Sprintf(\"%v\", v))\n\t\tif err == nil {\n\t\t\tcfg[\"log_level\"] = t\n\t\t} else {\n\t\t\tlogFatal(\"failed parsing log_level %+v\", v)\n\t\t}\n\t}\n}", "title": "" }, { "docid": "0787131771e803b48c35a341f5c3f896", "score": "0.54204124", "text": "func (JobFailureHandlerConfig) validate() error {\n\treturn nil\n}", "title": "" }, { "docid": "773d23f655dfaccc6f3cf52e8ac5d2e0", "score": "0.5414053", "text": "func (c *Configuration) Validate() error {\n\n\tif c.Database == \"\" {\n\t\treturn errors.EValidation(\"Missing Database\", nil)\n\t}\n\n\tif c.MongoURL == \"\" {\n\t\treturn errors.EValidation(\"Missing ConnectionString\", nil)\n\t}\n\n\treturn nil\n}", "title": "" }, { "docid": "72a46a87dd475af084e053bc5d241c8b", "score": "0.53965324", "text": "func (ec *EtcdConfig) Validate() error {\n\tif ec.Filepath != \"\" {\n\t\tec.clientNewType = \"file\"\n\t\treturn nil\n\t}\n\n\t// All tls related properties should be empty or all should be defined\n\ttlsPresent := ec.Cert != \"\" || ec.Key != \"\" || ec.CaCert != \"\"\n\ttlsMissing := ec.Cert == \"\" || ec.Key == \"\" || ec.CaCert == \"\"\n\tif tlsPresent {\n\t\tif tlsMissing {\n\t\t\tlog.WithFields(etcdLogFields).WithFields(log.Fields{\n\t\t\t\t\"error\": ErrIncompleteTLSConfig,\n\t\t\t\t\"cert\": ec.Cert,\n\t\t\t\t\"key\": ec.Key,\n\t\t\t\t\"caCert\": ec.CaCert,\n\t\t\t}).Error(ErrIncompleteTLSConfig)\n\t\t\treturn ErrIncompleteTLSConfig\n\t\t}\n\t\tec.clientNewType = \"tls\"\n\t}\n\treturn nil\n}", "title": "" }, { "docid": "029a6df9e5a7b427946b07baaa36b86b", "score": "0.53964037", "text": "func (config *IDConfig) validate() error {\n\tswitch config.idType {\n\tcase \"halo-id\", \"m200m\":\n\tdefault:\n\t\treturn fmt.Errorf(\"The 'IDType' variable is set to '%s', which I \"+\n\t\t\t\"don't recognize.\", config.idType)\n\t}\n\n\tswitch config.exclusionStrategy {\n\tcase \"none\", \"subhalo\", \"neighbor\":\n\tcase \"overlap\":\n\t\tif config.exclusionRadiusMult <= 0 {\n\t\t\treturn fmt.Errorf(\"The 'ExclusionRadiusMult' varaible is set to \"+\n\t\t\t\t\"%g, but it needs to be positive.\", config.exclusionRadiusMult)\n\t\t}\n\tdefault:\n\t\treturn fmt.Errorf(\"The 'ExclusionStrategy' variable is set to '%s', \"+\n\t\t\t\"which I don't recognize.\", config.exclusionStrategy)\n\t}\n\n\tswitch {\n\tcase config.snap == -1:\n\t\treturn fmt.Errorf(\"'Snap' variable not set.\")\n\tcase config.snap < 0:\n\t\treturn fmt.Errorf(\"'Snap' variable set to %d.\", config.snap)\n\t}\n\n\tif config.mult <= 0 {\n\t\treturn fmt.Errorf(\"'Mult' variable set to %d\", config.mult)\n\t}\n\n\tswitch {\n\tcase config.m200mMax < 0:\n\t\treturn fmt.Errorf(\"M200mStart set to %g\", config.m200mMax)\n\tcase config.m200mMax > config.m200mMin:\n\t\tfmt.Errorf(\"M200mEnd smaller than M200mStart\")\n\t}\n\n\treturn nil\n}", "title": "" }, { "docid": "b9b5c3a60d8df69a445420bb8904cc39", "score": "0.53911024", "text": "func (d *lvm) ValidateVolume(vol Volume, removeUnknownKeys bool) error {\n\terr := d.validateVolume(vol, d.commonVolumeRules(), removeUnknownKeys)\n\tif err != nil {\n\t\treturn err\n\t}\n\n\tif d.usesThinpool() && vol.config[\"lvm.stripes\"] != \"\" {\n\t\treturn fmt.Errorf(\"lvm.stripes cannot be used with thin pool volumes\")\n\t}\n\n\tif d.usesThinpool() && vol.config[\"lvm.stripes.size\"] != \"\" {\n\t\treturn fmt.Errorf(\"lvm.stripes.size cannot be used with thin pool volumes\")\n\t}\n\n\treturn nil\n}", "title": "" }, { "docid": "460dfdec1df7b82dd7813e970a6b7ed5", "score": "0.53727645", "text": "func (c *Config) Validate() liberr.Error {\n\tvar e = ErrorValidatorError.Error(nil)\n\n\tif err := libval.New().Struct(c); err != nil {\n\t\tif er, ok := err.(*libval.InvalidValidationError); ok {\n\t\t\te.Add(er)\n\t\t}\n\n\t\tfor _, er := range err.(libval.ValidationErrors) {\n\t\t\t//nolint #goerr113\n\t\t\te.Add(fmt.Errorf(\"config field '%s' is not validated by constraint '%s'\", er.Namespace(), er.ActualTag()))\n\t\t}\n\t}\n\n\tif !e.HasParent() {\n\t\te = nil\n\t}\n\n\treturn e\n}", "title": "" }, { "docid": "ad6c2aaee3ff52c5e72a9e4bf7a04f69", "score": "0.53713715", "text": "func validateConfig(args ArgCollection) error {\n\texpectedKeys := []string{}\n\tconfigFileRequired := false\n\tif args.ProviderFlag == \"custom\" {\n\t\tconfigFileRequired = true\n\t\texpectedKeys = append(expectedKeys, []string{\"providers.custom.insecure\", \"providers.custom.endpoint_format\", \"providers.custom.regions\", \"providers.custom.address_style\"}...)\n\t}\n\tif args.WriteToDB {\n\t\tconfigFileRequired = true\n\t\texpectedKeys = append(expectedKeys, []string{\"db.uri\"}...)\n\t}\n\tif args.UseMq {\n\t\tconfigFileRequired = true\n\t\texpectedKeys = append(expectedKeys, []string{\"mq.queue_name\", \"mq.uri\"}...)\n\t}\n\t// User didn't give any arguments that require the config file\n\tif !configFileRequired {\n\t\treturn nil\n\t}\n\n\t// Try to find and read config file\n\tif err := viper.ReadInConfig(); err != nil {\n\t\tif _, ok := err.(viper.ConfigFileNotFoundError); ok {\n\t\t\treturn errors.New(\"config file not found\")\n\t\t} else {\n\t\t\treturn err\n\t\t}\n\t}\n\n\t// Verify all expected keys are in the config file\n\tfor _, k := range expectedKeys {\n\t\tif !viper.IsSet(k) {\n\t\t\treturn fmt.Errorf(\"config file missing key: %s\", k)\n\t\t}\n\t}\n\treturn nil\n}", "title": "" }, { "docid": "64142917636fd283729e4999cde6173d", "score": "0.5365799", "text": "func (c *Container) validate() error {\n\timageIDSet := c.config.RootfsImageID != \"\"\n\timageNameSet := c.config.RootfsImageName != \"\"\n\trootfsSet := c.config.Rootfs != \"\"\n\n\t// If one of RootfsImageIDor RootfsImageName are set, both must be set.\n\tif (imageIDSet || imageNameSet) && !(imageIDSet && imageNameSet) {\n\t\treturn fmt.Errorf(\"both RootfsImageName and RootfsImageID must be set if either is set: %w\", define.ErrInvalidArg)\n\t}\n\n\t// Cannot set RootfsImageID and Rootfs at the same time\n\tif imageIDSet && rootfsSet {\n\t\treturn fmt.Errorf(\"cannot set both an image ID and rootfs for a container: %w\", define.ErrInvalidArg)\n\t}\n\n\t// Must set at least one of RootfsImageID or Rootfs\n\tif !(imageIDSet || rootfsSet) {\n\t\treturn fmt.Errorf(\"must set root filesystem source to either image or rootfs: %w\", define.ErrInvalidArg)\n\t}\n\n\t// A container cannot be marked as an infra and service container at\n\t// the same time.\n\tif c.IsInfra() && c.IsService() {\n\t\treturn fmt.Errorf(\"cannot be infra and service container at the same time: %w\", define.ErrInvalidArg)\n\t}\n\n\t// Cannot make a network namespace if we are joining another container's\n\t// network namespace\n\tif c.config.CreateNetNS && c.config.NetNsCtr != \"\" {\n\t\treturn fmt.Errorf(\"cannot both create a network namespace and join another container's network namespace: %w\", define.ErrInvalidArg)\n\t}\n\n\tif c.config.CgroupsMode == cgroupSplit && c.config.CgroupParent != \"\" {\n\t\treturn fmt.Errorf(\"cannot specify --cgroup-mode=split with a cgroup-parent: %w\", define.ErrInvalidArg)\n\t}\n\n\t// Not creating cgroups has a number of requirements, mostly related to\n\t// the PID namespace.\n\tif c.config.NoCgroups || c.config.CgroupsMode == \"disabled\" {\n\t\tif c.config.PIDNsCtr != \"\" {\n\t\t\treturn fmt.Errorf(\"cannot join another container's PID namespace if not creating cgroups: %w\", define.ErrInvalidArg)\n\t\t}\n\n\t\tif c.config.CgroupParent != \"\" {\n\t\t\treturn fmt.Errorf(\"cannot set cgroup parent if not creating cgroups: %w\", define.ErrInvalidArg)\n\t\t}\n\n\t\t// Ensure we have a PID namespace\n\t\tif c.config.Spec.Linux == nil {\n\t\t\treturn fmt.Errorf(\"must provide Linux namespace configuration in OCI spec when using NoCgroups: %w\", define.ErrInvalidArg)\n\t\t}\n\t\tfoundPid := false\n\t\tfor _, ns := range c.config.Spec.Linux.Namespaces {\n\t\t\tif ns.Type == spec.PIDNamespace {\n\t\t\t\tfoundPid = true\n\t\t\t\tif ns.Path != \"\" {\n\t\t\t\t\treturn fmt.Errorf(\"containers not creating Cgroups must create a private PID namespace - cannot use another: %w\", define.ErrInvalidArg)\n\t\t\t\t}\n\t\t\t\tbreak\n\t\t\t}\n\t\t}\n\t\tif !foundPid {\n\t\t\treturn fmt.Errorf(\"containers not creating Cgroups must create a private PID namespace: %w\", define.ErrInvalidArg)\n\t\t}\n\t}\n\n\t// Can only set static IP or MAC is creating a network namespace.\n\tif !c.config.CreateNetNS && (c.config.StaticIP != nil || c.config.StaticMAC != nil) {\n\t\treturn fmt.Errorf(\"cannot set static IP or MAC address if not creating a network namespace: %w\", define.ErrInvalidArg)\n\t}\n\n\t// Cannot set static IP or MAC if joining >1 network.\n\tif len(c.config.Networks) > 1 && (c.config.StaticIP != nil || c.config.StaticMAC != nil) {\n\t\treturn fmt.Errorf(\"cannot set static IP or MAC address if joining more than one network: %w\", define.ErrInvalidArg)\n\t}\n\n\t// Using image resolv.conf conflicts with various DNS settings.\n\tif c.config.UseImageResolvConf &&\n\t\t(len(c.config.DNSSearch) > 0 || len(c.config.DNSServer) > 0 ||\n\t\t\tlen(c.config.DNSOption) > 0) {\n\t\treturn fmt.Errorf(\"cannot configure DNS options if using image's resolv.conf: %w\", define.ErrInvalidArg)\n\t}\n\n\tif c.config.UseImageHosts && len(c.config.HostAdd) > 0 {\n\t\treturn fmt.Errorf(\"cannot add to /etc/hosts if using image's /etc/hosts: %w\", define.ErrInvalidArg)\n\t}\n\n\t// Check named volume, overlay volume and image volume destination conflist\n\tdestinations := make(map[string]bool)\n\tfor _, vol := range c.config.NamedVolumes {\n\t\t// Don't check if they already exist.\n\t\t// If they don't we will automatically create them.\n\t\tif _, ok := destinations[vol.Dest]; ok {\n\t\t\treturn fmt.Errorf(\"two volumes found with destination %s: %w\", vol.Dest, define.ErrInvalidArg)\n\t\t}\n\t\tdestinations[vol.Dest] = true\n\t}\n\tfor _, vol := range c.config.OverlayVolumes {\n\t\t// Don't check if they already exist.\n\t\t// If they don't we will automatically create them.\n\t\tif _, ok := destinations[vol.Dest]; ok {\n\t\t\treturn fmt.Errorf(\"two volumes found with destination %s: %w\", vol.Dest, define.ErrInvalidArg)\n\t\t}\n\t\tdestinations[vol.Dest] = true\n\t}\n\tfor _, vol := range c.config.ImageVolumes {\n\t\t// Don't check if they already exist.\n\t\t// If they don't we will automatically create them.\n\t\tif _, ok := destinations[vol.Dest]; ok {\n\t\t\treturn fmt.Errorf(\"two volumes found with destination %s: %w\", vol.Dest, define.ErrInvalidArg)\n\t\t}\n\t\tdestinations[vol.Dest] = true\n\t}\n\n\t// If User in the OCI spec is set, require that c.config.User is set for\n\t// security reasons (a lot of our code relies on c.config.User).\n\tif c.config.User == \"\" && (c.config.Spec.Process.User.UID != 0 || c.config.Spec.Process.User.GID != 0) {\n\t\treturn fmt.Errorf(\"please set User explicitly via WithUser() instead of in OCI spec directly: %w\", define.ErrInvalidArg)\n\t}\n\n\t// Init-ctrs must be used inside a Pod. Check if an init container type is\n\t// passed and if no pod is passed\n\tif len(c.config.InitContainerType) > 0 && len(c.config.Pod) < 1 {\n\t\treturn fmt.Errorf(\"init containers must be created in a pod: %w\", define.ErrInvalidArg)\n\t}\n\n\tif c.config.SdNotifyMode == define.SdNotifyModeIgnore && len(c.config.SdNotifySocket) > 0 {\n\t\treturn fmt.Errorf(\"cannot set sd-notify socket %q with sd-notify mode %q\", c.config.SdNotifySocket, c.config.SdNotifyMode)\n\t}\n\n\tif c.config.HealthCheckOnFailureAction != define.HealthCheckOnFailureActionNone && c.config.HealthCheckConfig == nil {\n\t\treturn fmt.Errorf(\"cannot set on-failure action to %s without a health check\", c.config.HealthCheckOnFailureAction.String())\n\t}\n\n\tif value, exists := c.config.Labels[define.AutoUpdateLabel]; exists {\n\t\t// TODO: we cannot reference pkg/autoupdate here due to\n\t\t// circular dependencies. It's worth considering moving the\n\t\t// auto-update logic into the libpod package.\n\t\tif value == \"registry\" || value == \"image\" {\n\t\t\tif err := validateAutoUpdateImageReference(c.config.RawImageName); err != nil {\n\t\t\t\treturn err\n\t\t\t}\n\t\t}\n\t}\n\n\t// Cannot set startup HC without a healthcheck\n\tif c.config.HealthCheckConfig == nil && c.config.StartupHealthCheckConfig != nil {\n\t\treturn fmt.Errorf(\"cannot set a startup healthcheck when there is no regular healthcheck: %w\", define.ErrInvalidArg)\n\t}\n\n\treturn nil\n}", "title": "" }, { "docid": "df57bc9e317081e39d1d62b82b91714e", "score": "0.53652215", "text": "func (vt VolumeType) Validate() error {\n\tswitch string(vt) {\n\tcase \"local\", \"instance\", \"\":\n\t\treturn nil\n\tdefault:\n\t\treturn maskAny(errgo.WithCausef(nil, ValidationError, \"invalid volume type '%s'\", string(vt)))\n\t}\n}", "title": "" }, { "docid": "07adbcd4cb63d5ca6c4299d329d3a937", "score": "0.53644806", "text": "func Validate(ic *types.InstallConfig) error {\n\tif ic.Platform.VSphere == nil {\n\t\treturn errors.New(field.Required(field.NewPath(\"platform\", \"vsphere\"), \"vSphere validation requires a vSphere platform configuration\").Error())\n\t}\n\treturn validation.ValidatePlatform(ic.Platform.VSphere, field.NewPath(\"platform\").Child(\"vsphere\")).ToAggregate()\n}", "title": "" }, { "docid": "5a34b47da2a0df446d6ef8142c66578e", "score": "0.53625095", "text": "func (c *operatorConfig) validate() (err error) {\n\tswitch config := c; {\n\tcase config.serverVersion == nil:\n\t\terr = newInvalidOperatorConfigError(\"discovery client nil\")\n\tcase config.numWorkers < 1:\n\t\terr = newInvalidOperatorConfigError(\"must specify at least one worker per queue\")\n\t}\n\n\treturn\n}", "title": "" }, { "docid": "a0fcfaa284fa942a5a7a976323853f2c", "score": "0.53605163", "text": "func (o *StorageDeleteOptions) Validate() (err error) {\n\tif o.isDevfile {\n\t\treturn\n\t}\n\n\texists := o.LocalConfigInfo.StorageExists(o.storageName)\n\tif !exists {\n\t\treturn fmt.Errorf(\"the storage %v does not exists in the application %v, cause %v\", o.storageName, o.Application, err)\n\t}\n\n\treturn\n}", "title": "" }, { "docid": "df16bd3f5d5787ce67c8c9864e2ed978", "score": "0.53588414", "text": "func (j *JobConfig) validate() error {\n\tif j.Name == \"\" {\n\t\treturn errors.New(\"job must have a name\")\n\t}\n\n\tif j.Spec == \"\" {\n\t\treturn errors.New(\"spec is required\")\n\t}\n\n\tif j.Command == \"\" {\n\t\treturn errors.New(\"command is required\")\n\t}\n\n\t// Configure shell when multi-line scripts\n\tif j.Shell == \"\" && len(strings.Split(j.Command, \"\\n\")) > 1 {\n\t\tj.Shell = defaultShell\n\t}\n\n\tif _, err := cron.Parse(j.Spec); err != nil {\n\t\treturn fmt.Errorf(\"invalid cron spec: %v\", err)\n\t}\n\n\tif val := j.TimeoutString; val != \"\" {\n\t\tdur, err := time.ParseDuration(val)\n\t\tif err != nil {\n\t\t\treturn fmt.Errorf(\"invalid timeout: %v\", err)\n\t\t}\n\t\tj.Timeout = dur\n\t}\n\n\tif j.Docker != nil {\n\t\tj.RunMode = dockerMode\n\t} else {\n\t\tj.RunMode = nativeMode\n\t}\n\n\t// Notify on errors only by default\n\tif j.Notify != nil && j.Notify.Mode == \"\" {\n\t\tj.Notify.Mode = notifyError\n\t}\n\n\treturn nil\n}", "title": "" }, { "docid": "dd5e98fbcef1330ab1127e7f3b20f140", "score": "0.535806", "text": "func (d *ceph) Validate(config map[string]string) error {\n\trules := map[string]func(value string) error{\n\t\t\"ceph.cluster_name\": validate.IsAny,\n\t\t\"ceph.osd.force_reuse\": validate.Optional(validate.IsBool), // Deprecated, should not be used.\n\t\t\"ceph.osd.pg_num\": validate.IsAny,\n\t\t\"ceph.osd.pool_name\": validate.IsAny,\n\t\t\"ceph.osd.data_pool_name\": validate.IsAny,\n\t\t\"ceph.rbd.clone_copy\": validate.Optional(validate.IsBool),\n\t\t\"ceph.rbd.du\": validate.Optional(validate.IsBool),\n\t\t\"ceph.rbd.features\": validate.IsAny,\n\t\t\"ceph.user.name\": validate.IsAny,\n\t\t\"volatile.pool.pristine\": validate.IsAny,\n\t}\n\n\treturn d.validatePool(config, rules, d.commonVolumeRules())\n}", "title": "" }, { "docid": "0e2f14c284ae2a9534f860ca4d49935e", "score": "0.5342603", "text": "func (t *OpenconfigPlatform_Components_Component_Fabric_Config) Validate(opts ...ygot.ValidationOption) error {\n\tif err := ytypes.Validate(SchemaTree[\"OpenconfigPlatform_Components_Component_Fabric_Config\"], t, opts...); err != nil {\n\t\treturn err\n\t}\n\treturn nil\n}", "title": "" }, { "docid": "a5e93848a853e96646f8a409ec262c7d", "score": "0.5341688", "text": "func (n RequestDrivenWebServiceNetworkConfig) validate() error {\n\tif n.IsEmpty() {\n\t\treturn nil\n\t}\n\tif err := n.VPC.validate(); err != nil {\n\t\treturn fmt.Errorf(`validate \"vpc\": %w`, err)\n\t}\n\treturn nil\n}", "title": "" }, { "docid": "11ab4c14df3b21f7c7c33013df372670", "score": "0.5340825", "text": "func (m *MountNewCreateDisksParamsVMVolume) ContextValidate(ctx context.Context, formats strfmt.Registry) error {\n\tvar res []error\n\n\tif err := m.contextValidateElfStoragePolicy(ctx, formats); err != nil {\n\t\tres = append(res, err)\n\t}\n\n\tif err := m.contextValidateSizeUnit(ctx, formats); err != nil {\n\t\tres = append(res, err)\n\t}\n\n\tif len(res) > 0 {\n\t\treturn errors.CompositeValidationError(res...)\n\t}\n\treturn nil\n}", "title": "" } ]
774c0f264bee7a44be8f5095ef9fb28e
return error for player should be kick, not enough money
[ { "docid": "56063b5c669002f7e910a02faba6209d", "score": "0.48476988", "text": "func (gameInstance *PhomGame) IsPlayerMoneyValidToStayInRoom(playerMoney int64, roomRequirement int64) (err error) {\n\treturn game.IsPlayerMoneyValidToStayInRoom(gameInstance, playerMoney, roomRequirement)\n}", "title": "" } ]
[ { "docid": "2ea75f7a1762efc45335e6ca553debde", "score": "0.58163506", "text": "func (p Player) canWinNull(afterSkat bool) int {\n\tsafe := 0\n\trisky := 0\n\tquiterisky := 0\n\tunplayable := 0\n\n\t// foreHand := ( &p == players[0] )\n\tdebugTacticsLog(\"Evaluating safe suits\\n\")\n\tremoved := 0\n\tfor _, s := range suits {\n\t\trisk := nullSafeSuit(s, p.hand)\n\t\tswitch risk {\n\t\tcase 0:\n\t\t\tsafe++\n\t\tcase 1:\n\t\t\trisky++\n\t\tcase 2:\n\t\t\tquiterisky++\n\t\tdefault:\n\t\t\treturn -1 // one unplayable is enough to reject\n\t\t}\n\t\tif risk > 2 && !afterSkat {\n\t\t\t//check if they can be discard it\n\t\t\tcs := filter(p.hand, func(c Card) bool {\n\t\t\t\treturn c.Suit == s\n\t\t\t})\n\t\t\tcs = sortRankSpecial(cs, nullRanksRev)\n\t\t\tmaxToRemove := 1\n\t\t\tfor nullSafeSuit(s, cs) > 2 && removed < maxToRemove {\n\t\t\t\tlast := cs[len(cs)-1]\n\t\t\t\tcs = remove(cs, last)\n\t\t\t\tremoved++\n\t\t\t\tdebugTacticsLog(\".. If I discard %v (%d removed)\", last, removed)\n\t\t\t}\n\t\t\tif nullSafeSuit(s, cs) < 3 {\n\t\t\t\tdebugTacticsLog(\".. the suit is OK\")\n\t\t\t\tunplayable--\n\t\t\t\tquiterisky++\n\t\t\t}\n\t\t}\n\t}\n\tif unplayable > 0 {\n\t\treturn -1\n\t}\n\tif risky+quiterisky > 2 {\n\t\treturn -1\n\t}\n\tif safe == 4 {\n\t\treturn 1\n\t}\n\treturn 0\n}", "title": "" }, { "docid": "4d02f31a85c7c29138efd6f071a2409e", "score": "0.561931", "text": "func IsUserKicked(err error) bool {\n\treturn errors.Is(err, typedErrChecker{t: ErrUserKicked})\n}", "title": "" }, { "docid": "6140706f79a2068bc9ff7a2601409d2e", "score": "0.5557081", "text": "func (r *Room) KickPlayer(pl *Player) {\n\twasRoomOwner := pl.RoomOwner\n\tfor index := range r.players {\n\t\tif r.players[index] == pl {\n\t\t\tr.players[index].Dead = true\n\t\t\tif wasRoomOwner {\n\t\t\t\tr.players = append(r.players[:index], r.players[(index+1):]...)\n\t\t\t\tif len(r.players) != 0 {\n\t\t\t\t\tr.players[index+1].RoomOwner = true\n\t\t\t\t\treturn\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\tr.players = append(r.players[:index], r.players[(index+1):]...)\n\t\t\t\treturn\n\t\t\t}\n\t\t}\n\t}\n}", "title": "" }, { "docid": "952e7e0540746768fff7eb2f13759104", "score": "0.55140436", "text": "func (cr *ChatRoom) Kick(name string) string {\n\tdefer cr.clientsMtx.Unlock()\n\tcr.clientsMtx.Lock() //preventing simultaneous access to the `clients` map\n\n\tclient, suid, err := cr.getClient(name)\n\tif err != nil {\n\t\treturn \"Unable to get client for name \" + name\n\t}\n\n\tif client.IsMod {\n\t\treturn \"You cannot kick another mod.\"\n\t}\n\n\tif client.IsAdmin {\n\t\treturn \"Jebaited No.\"\n\t}\n\n\tcolor := client.color\n\thost := client.Host()\n\tclient.conn.Close()\n\tcr.delClient(suid)\n\n\tcr.AddEventMsg(common.EvKick, name, color)\n\tfmt.Printf(\"[kick] %s %s has been kicked\\n\", host, name)\n\treturn \"\"\n}", "title": "" }, { "docid": "9b58b10af6bdbd9c52ac85a8ef810a6f", "score": "0.54377943", "text": "func (s *State) attackPlayer(mon *monster.Monster) {\n\t// TODO check for negatespirit or spirit pro against poltergeis and naga\n\t// TODO cubeundead or undeadpro against vampire, wraith, zombie\n\n\tmName := s.monsterName(mon)\n\n\t// If character is invisble chance to miss\n\tif s.C.Cond.EffectActive(conditions.Invisiblity) {\n\t\tif rand.Intn(33) < 20 {\n\t\t\ts.Log(fmt.Sprintf(\"The %s misses wildly\", mName))\n\t\t\treturn\n\t\t}\n\t}\n\n\tif s.C.Cond.EffectActive(conditions.CharmMonsters) {\n\t\tif rand.Intn(30)+5*mon.Info.Lvl-int(s.C.Stats.Cha) < 30 {\n\t\t\ts.Log(fmt.Sprintf(\"The %s is awestruct at your magnificence!\", mName))\n\t\t\treturn\n\t\t}\n\t}\n\n\ts.hitPlayer(mon)\n}", "title": "" }, { "docid": "b368f8fbcf00af4454ad7879775e216b", "score": "0.5418241", "text": "func (w *Wallet) TakeMoney(money int64) error {\n\tif money = w.Money - money; money < 0 { // How is this readable code?\n\t\treturn errors.New(\"You are broke\")\n\t}\n\n\tw.Money = money\n\n\treturn nil\n}", "title": "" }, { "docid": "e78b4c8f6c6f6a7ab9b7dc78249c2c92", "score": "0.541151", "text": "func (p *Player) AllowEndTurn() bool {\n\treturn p.IsTurn && p.ThrownDice\n}", "title": "" }, { "docid": "e617d4f27bfa25c1bd81614e27e294f8", "score": "0.53444195", "text": "func (s *State) hitPlayer(mon *monster.Monster) {\n\tdmg := mon.BaseDamage()\n\n\tif mon.Info.Attack > 0 {\n\t\tif dmg+s.difficulty+8 > s.C.Stats.Ac || s.C.Stats.Ac <= 0 || rand.Intn(s.C.Stats.Ac) == 0 { // Check for special attack success\n\t\t\t// TODO check for special attack\n\t\t\t/*\n\t\t\t\tif special() {\n\t\t\t\t\treturn\n\t\t\t\t}\n\t\t\t*/\n\n\t\t\ts.difficulty -= 2\n\t\t}\n\t}\n\n\t// No special attack, deal normal damage\n\tif (dmg+s.difficulty) > s.C.Stats.Ac || s.C.Stats.Ac <= 0 || rand.Intn(s.C.Stats.Ac) == 0 {\n\t\ts.Log(fmt.Sprintf(\"The %v hit you\", s.monsterName(mon)))\n\t\tif s.C.Stats.Ac < dmg {\n\t\t\ts.C.Damage(dmg - s.C.Stats.Ac)\n\t\t}\n\t}\n\n\ts.Log(fmt.Sprintf(\"The %s missed\", s.monsterName(mon)))\n}", "title": "" }, { "docid": "0fb5aeca433689a7e3c057e176d70262", "score": "0.52511096", "text": "func (_Mcdflap *McdflapTransactor) Kick(opts *bind.TransactOpts, lot *big.Int, bid *big.Int) (*types.Transaction, error) {\n\treturn _Mcdflap.contract.Transact(opts, \"kick\", lot, bid)\n}", "title": "" }, { "docid": "6394b443e0379314e9163afb3acb2724", "score": "0.52335817", "text": "func (c *Client) CheckPlayer(username string, platform string) bool {\n\n\tif !(platform == \"pc\" || platform == \"ps4\" || platform == \"xb1\") {\n\t\tfmt.Println(\"Bad platform provided;\", platform)\n\t\treturn false\n\t}\n\n\taccount := c.Lookup(username)\n\n\tif account.ID == \"\" {\n\t\treturn false\n\t}\n\n\tvar response RawBRStatsResponse\n\n\tc.Mutex.Lock()\n\tc.Request.Get(statsBattleRoyaleEndpoint(account.ID)).\n\t\tSet(\"Authorization\", fmt.Sprintf(\"bearer %v\", c.AccessToken)).\n\t\tEndStruct(&response)\n\tc.Mutex.Unlock()\n\n\tfor _, stat := range response {\n\t\tif strings.Contains(stat.Name, fmt.Sprintf(\"_%v_\", platform)) {\n\t\t\treturn true\n\t\t}\n\t}\n\n\treturn false\n}", "title": "" }, { "docid": "51d8d3139e52a77d712fa525c6b2553e", "score": "0.5205439", "text": "func (g *Game) validateStockBuy(player *Player, buyInfo *MarketAction, saleCash int) error {\n\tcompany, err := g.validateMarketAction(buyInfo)\n\tif err != nil {\n\t\treturn err\n\t}\n\n\t// If the company hasn't been started yet we need to make sure the company is allowed to be\n\t// started, and that the price the player wants to start it at is valid for this tech level.\n\tif company.StockPrice == 0 {\n\t\tif company.Restricted {\n\t\t\treturn fmt.Errorf(\"%s locked until tech level 3\", company.Name)\n\t\t}\n\n\t\tvalidPrice := false\n\t\tfor _, option := range boardInfo.StartingStockPrices(g.TechLevel) {\n\t\t\tvalidPrice = validPrice || buyInfo.Price == option\n\t\t}\n\t\tif !validPrice {\n\t\t\treturn fmt.Errorf(\"$%d not one of the valid starting prices for tech level %d\",\n\t\t\t\tbuyInfo.Price, g.TechLevel)\n\t\t}\n\t}\n\n\t// Next check to make sure the player can afford the stock they want, and that there is enough\n\t// non-player held stock available for them to purchase.\n\tif buyInfo.Count*buyInfo.Price > player.Cash+saleCash {\n\t\treturn fmt.Errorf(\"%s has insufficient cash for %d shares of %s at $%d\",\n\t\t\tplayer.Name, buyInfo.Count, company.Name, buyInfo.Price)\n\t} else if left := company.HeldStock + g.OrphanStocks[company.Name]; buyInfo.Count > left {\n\t\treturn fmt.Errorf(\"%s only has %d shares remaining\", company.Name, left)\n\t}\n\treturn nil\n}", "title": "" }, { "docid": "afa267b7c76a03eb2d1f7a97ee2992c7", "score": "0.51942647", "text": "func TestMarketPlayerValidation(t *testing.T) {\n\tplayerNames := []string{\"1st\", \"2nd\", \"3rd\", \"4th\", \"5th\", \"6th\"}\n\tgame := NewGame(playerNames)\n\tturn := MarketTurn{\n\t\tPurchase: &MarketAction{\n\t\t\tCompany: randomCompany(false),\n\t\t\tCount: 1,\n\t\t\tPrice: startingPrices[0][0],\n\t\t},\n\t}\n\n\t// This part of the test must come first, otherwise we will no longer be in the market phase\n\t// and this would no longer check player name existence.\n\tif errs := game.PerformMarketTurn(\"bad name\", MarketTurn{}); len(errs) == 0 {\n\t\tt.Error(\"bad player name did not error performing market action\")\n\t}\n\n\tfor turnNum, actual := range game.TurnManager.Order {\n\t\tif turnNum != game.TurnManager.Number {\n\t\t\tt.Fatalf(\"internal game turn %d != expected turn %d\", game.TurnManager.Number, turn)\n\t\t}\n\t\tfor index := range rand.Perm(len(playerNames)) {\n\t\t\tif other := playerNames[index]; other != actual {\n\t\t\t\tif errs := game.PerformMarketTurn(other, MarketTurn{}); len(errs) == 0 {\n\t\t\t\t\tt.Errorf(\"%s's market action succeeded on %s's turn\", other, actual)\n\t\t\t\t}\n\t\t\t\tif turnNum != game.TurnManager.Number {\n\t\t\t\t\tt.Errorf(\"turn advanced from %s's action on %s's turn\", other, actual)\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\tif errs := game.PerformMarketTurn(actual, turn); len(errs) > 0 {\n\t\t\tt.Errorf(\"%s failed to perform their market action: %v\", actual, errs)\n\t\t}\n\t}\n}", "title": "" }, { "docid": "60e3ed2285a8e0aa4f4e5045306e54b9", "score": "0.519341", "text": "func ChoosePlayers() (bool, Player) {\n\tvar players Player\n\tvar sign string\n\tinput := bufio.NewScanner(os.Stdin)\n\n\tfor counter := 0; counter < 5; counter++ {\n\t\tfmt.Print(\"Chose sign for player 1: X or O: \")\n\t\tinput.Scan()\n\t\tsign = input.Text()\n\t\tif validatePlayer(sign) {\n\t\t\tplayers = assignPlayers(sign)\n\t\t\treturn true, players\n\t\t}\n\t}\n\tfmt.Println(\"Max number of attemps reached!\")\n\treturn false, Player{}\n}", "title": "" }, { "docid": "d6307cc67639971fd8433b6f21add90e", "score": "0.5188896", "text": "func KickUser(bot *BotAPI, chat *Chat, user *User, ban bool) {\n\tkickConfig := KickChatMemberConfig{}\n\tkickConfig.ChatID = chat.ID\n\tkickConfig.UserID = user.ID\n\t_, err := bot.KickChatMember(kickConfig)\n\tif err != nil {\n\t\tlog.Printf(\"Error kicking user %s: %s\", user.UserName, err)\n\t} else {\n\t\tlog.Printf(\"[KICK] Kicked user %s: Name length = %d > %d\", user.UserName, len(user.FirstName), configuration.Cfg.FirstNameMaxLength)\n\t}\n\n\t// User is banned by default when kicked\n\tif ban == true {\n\t\treturn\n\t}\n\n\tunBanConfig := ChatMemberConfig{}\n\tunBanConfig.ChatID = chat.ID\n\tunBanConfig.UserID = user.ID\n\tbot.UnbanChatMember(unBanConfig)\n}", "title": "" }, { "docid": "eacf880a37d1f5b99c0a8dfcc2e06e70", "score": "0.5142137", "text": "func (t *Telegram) Kick(ctx context.Context, chatID, userID string) error {\n\ts := fmt.Sprintf(\"kickChatMember?chat_id=%s&user_id=%s\", url.QueryEscape(chatID), url.QueryEscape(userID))\n\t_, err := t.do(ctx, s)\n\treturn err\n}", "title": "" }, { "docid": "2c238eb795236c9b5d602672aa9f5652", "score": "0.5128415", "text": "func checkVictory() {\n\tfor {\n\t\ttime.Sleep(1000 * time.Millisecond)\n\t\tif countSpawnedPlayers() > 1 {\n\t\t\twinner := getWinner()\n\t\t\tif winner != -1 {\n\t\t\t\ttime.Sleep(1000 * time.Millisecond)\n\t\t\t\tgameState.Winner = winner\n\t\t\t\ttime.Sleep(5000 * time.Millisecond)\n\t\t\t\tresetGame()\n\t\t\t}\n\t\t}\n\t}\n}", "title": "" }, { "docid": "5c10cd1a38c251590978f489762e27e8", "score": "0.5126935", "text": "func (r *Roster) PlayerKills(puuid uuid.UUID) int32 {\n\tvar kills int32\n\tr.lock.RLock()\n\tif k, ok := r.kills[puuid]; ok {\n\t\tkills = k\n\t}\n\tr.lock.RUnlock()\n\treturn kills\n}", "title": "" }, { "docid": "85cf00b78ea69d210146262cbfca55ce", "score": "0.5119388", "text": "func PlayerWins(playerHand string, dealerHand string) bool {\n\tpanic(\"Please implement the PlayerWins function\")\n}", "title": "" }, { "docid": "3d38f9a1de7390e88b8dfa5cdaffd176", "score": "0.51087546", "text": "func (c DiscordService) KickUser(user, message string) error {\n\t_, err := c.session.ChannelMessageSend(user, message)\n\treturn err\n}", "title": "" }, { "docid": "c5cc70c17e407298e9027901bdb5c011", "score": "0.5077436", "text": "func KickUser(userName string) error {\n\tif len(userName) == 0 {\n\t\treturn errors.New(\"users.KickUser() requires a user name\")\n\t}\n\t//\n\tuser, err := Get(userName)\n\tif err != nil {\n\t\treturn err\n\t}\n\t//\n\tuser.Logout()\n\t//\n\treturn nil\n}", "title": "" }, { "docid": "56a9e08c2613de2855026e5a4a0998c1", "score": "0.5063116", "text": "func (a *Remote) Kick(ctx context.Context) error {\n\tif a.Session.UID() == \"\" {\n\t\treturn constants.ErrNoUIDBind\n\t}\n\trsp := &proto_mcbeam.KickAnswer{}\n\terr := a.SendRequest(ctx, constants.KickRoute,\n\t\t&proto_mcbeam.KickMsg{UserId: a.Session.UID()},\n\t\trsp)\n\treturn err\n}", "title": "" }, { "docid": "d88e53010283f35681535c61e523a4a1", "score": "0.5059962", "text": "func (g *Game) validateSubaction(p int, c client.Client, d simple.Subaction) bool {\n if g.status != Running {\n g.subactionError(c, \"Subaction Error\", \"Can only move pieces when game is 'Running'\")\n return false\n }\n if g.turnState.Type == simple.Bumping && p != g.turnState.BumpingPlayer {\n g.subactionError(c, \"Subaction Error\", \"It's %s's turn to replace after the bump\",\n g.players[g.turnState.BumpingPlayer].Client.Identity().Name,\n )\n return false\n }\n if g.turnState.Type != simple.Bumping && p != g.turnState.Player {\n g.subactionError(c, \"Subaction Error\", \"It's not your turn\")\n return false\n }\n\n err := g.table.ValidateLocationAndPiece(d.Source, d.Piece, d.Token)\n if err != \"\" {\n g.subactionError(c, \"Source Error\", err)\n return false\n }\n err = g.table.ValidateLocation(d.Dest)\n if err != \"\" {\n g.subactionError(c, \"Dest Error\", err)\n return false\n }\n\n return true\n}", "title": "" }, { "docid": "c21ae8eb885cc809ef83fecbb49589b4", "score": "0.50549227", "text": "func (_Mcdflap *McdflapSession) Kick(lot *big.Int, bid *big.Int) (*types.Transaction, error) {\n\treturn _Mcdflap.Contract.Kick(&_Mcdflap.TransactOpts, lot, bid)\n}", "title": "" }, { "docid": "ef9e5814d808a7abdfa4b1d7f34c098c", "score": "0.5054343", "text": "func (_Mcdflap *McdflapTransactorSession) Kick(lot *big.Int, bid *big.Int) (*types.Transaction, error) {\n\treturn _Mcdflap.Contract.Kick(&_Mcdflap.TransactOpts, lot, bid)\n}", "title": "" }, { "docid": "51481ab9dbdf19a423fc9b13aa475dbd", "score": "0.5050236", "text": "func (target *Client) ErrChanOPrivIsNeeded(channel *Channel) {\n\ttarget.NumericReply(ERR_CHANOPRIVSNEEDED,\n\t\t\"%s :You're not channel operator\", channel)\n}", "title": "" }, { "docid": "212d03772dca691e0b3ace60438963a2", "score": "0.5048628", "text": "func (m *MysqlDriver) CheckPlayer(username, password string) (*model.User, error) {\n\tuser := new(model.User)\n\tok, err := m.conn.Alias(\"u\").Where(\"u.account = ? and u.password = ?\", username, password).Get(user)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\tif !ok {\n\t\treturn nil, ErrNoRowsFound\n\t}\n\treturn user, nil\n}", "title": "" }, { "docid": "aea1a669615ca9de8d9e84ee8830ffb9", "score": "0.5044676", "text": "func (boid Boid) avoidPlayer(p *phys.Body, i BoidInfo, w *world.World) {\n\tdd := i.PlayerDist * i.PlayerDist\n\tpt := p.Box.Center()\n\tif p.Vel == geom.Pt(0, 0) || w.Pixels.SqDist(boid.Box.Center(), pt) > dd {\n\t\treturn\n\t}\n\tbias := geom.Pt(i.PlayerBias, i.PlayerBias)\n\td := avoidVec(boid.Box.Center(), pt, i.PlayerDist, w).Mul(bias)\n\tboid.Vel = boid.Vel.Add(d)\n}", "title": "" }, { "docid": "65b5827ff914142d1db6886eafc2c798", "score": "0.50309926", "text": "func attack(damage int, enemyArmor int, criticalChance int, enemyLife int, enemyShieldArmor int, enemyShieldHP int) (int, int, int, bool) {\n critic := criticalCalculator(criticalChance)\n if critic {\n damage *= 2\n }\n damage, enemyShieldHP = shieldCalculation(damage, enemyShieldHP, enemyShieldArmor)\n damage = damageCalculator(damage, enemyArmor, enemyLife)\n enemyLife -= damage\n return enemyLife, enemyShieldHP, damage, critic\n}", "title": "" }, { "docid": "6d591cc1c85e38e179c18f12edc931f8", "score": "0.50165695", "text": "func (p ProxyPlayer) TryGiveUp(buf []byte) (iplayer.Turn, error) {\n\tturn := iplayer.Turn{-1, board.Pos{-1, -1}, board.Pos{-1, -1}}\n\n\tvar str string\n\terr := json.Unmarshal(buf, &str)\n\tif err != nil {\n\t\treturn turn, err\n\t}\n\treturn turn, nil\n}", "title": "" }, { "docid": "3257eab1b9a27526dab96580406b40f6", "score": "0.5009333", "text": "func Playerattack(gameboard [10][10]string, hidden [10][10]string) [10][10]string {\n\ta := gameboard\n\tvar spot [2]int\n\t//Drawboard(hidden)\n\tfmt.Println(\"Enter a space to attack. Range A1 - E5\")\n\t//Checks if valid spot on board\n\t//If valid continues, Else prompts for new attack\n\tfor {\n\t\tspot = EnterSpace(a)\n\t\t//Drawboard(a)\n\t\tif CheckIfMatch(spot, a) == 1 || CheckIfMatch(spot, a) == -1 {\n\t\t\tfmt.Println(\"You have already played there. Try again.\")\n\t\t\tcontinue\n\t\t}\n\t\tbreak\n\t}\n\n\trow := spot[0]\n\tcolum := spot[1]\n\t// X if hit, * if miss\n\tswitch CheckIfMatch(spot, hidden) {\n\tcase 1:\n\t\ta[row][colum] = \"X\"\n\tcase 0:\n\t\ta[row][colum] = \"*\"\n\t}\n\n\treturn a\n}", "title": "" }, { "docid": "5b0f4b941cb6736618588f28423fdbfa", "score": "0.50011873", "text": "func (a *Account) canWithdraw(amount decimal.Decimal) (bool) {\n\treturn a.balance.Cmp(amount) >= 0\n}", "title": "" }, { "docid": "32b2c29e39c91014adf9c1c51f106136", "score": "0.4998879", "text": "func checkDamage() {\n\tfor {\n\t\ttime.Sleep(16 * time.Millisecond)\n\t\tfor id, player := range gameState.Players {\n\t\t\tfor _, exp := range gameState.Explosions {\n\t\t\t\tif distance(player.XPos, player.YPos, exp.XPos, exp.YPos) <= 150 && !player.DamageTaken && exp.Spawned {\n\t\t\t\t\tgameState.Players[id].DamageTaken = true\n\t\t\t\t\tgo playerDamaged(id)\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n}", "title": "" }, { "docid": "f68582edcf2f7effb49e3a4f9264b556", "score": "0.49978083", "text": "func (s *sigAttack) attempt(v bool) []byte {\n\t// f = (x-s1+s2)^e - c1\n\tctx := modctx(s.n)\n\tf := modpoly(ctx).SetCoeffUI(1, 1)\n\tf.Sub(f, modpoly(ctx).SetCoeff(0, s.ss[1])).Add(f, modpoly(ctx).SetCoeff(0, s.ss[0])).Pow(f, s.e)\n\tf.Sub(f, modpoly(ctx).SetCoeff(0, s.cs[0]))\n\n\t// g = x^e-c2\n\tg := modpoly(ctx).SetCoeffUI(1, 1)\n\tg.Pow(g, s.e).Sub(g, modpoly(ctx).SetCoeff(0, s.cs[1]))\n\n\ta := modpoly(modctx(f.GetMod())).Set(f)\n\tb := modpoly(modctx(g.GetMod())).Set(g)\n\n\tzero := modpoly(ctx).Zero()\n\trp := modpoly(ctx)\n\n\tif v {\n\t\tlog.Printf(\"%s beginning, this can sometimes crash, try it again if it does.\", name)\n\t}\n\n\tvar r *fmp.FmpzModPoly\n\tfor {\n\t\t_, r = a.DivRem(b)\n\n\t\tif r.Equal(zero) {\n\t\t\tco0 := rp.GetCoeff(0)\n\t\t\tco1 := rp.GetCoeff(1)\n\n\t\t\tq, _ := modpoly(ctx).SetCoeff(0, ln.BigOne).DivRem(modpoly(ctx).SetCoeff(0, co1))\n\t\t\tq.MulScalar(q, ln.BigNOne).MulScalar(q, co0)\n\t\t\treturn ln.NumberToBytes(q.GetCoeff(0))\n\t\t}\n\n\t\trp.Set(r)\n\t\ta.Set(b)\n\t\tb.Set(r)\n\t}\n}", "title": "" }, { "docid": "6dfc4ceb53ec0674977ba72bce303217", "score": "0.4965444", "text": "func (g *Game) isLegal(i int, j int) (bool, int) {\n\t// it's illegal to play on a non-empty point\n\tif g.curr[i][j] != board.EMPTY {\n\t\treturn false, 1\n\t}\n\n\t// preview state of board after playing this move\n\ttmp := board.CloneBoard(g.curr)\n\tif g.blackTurn {\n\t\ttmp[i][j] = board.BLACK\n\t} else {\n\t\ttmp[i][j] = board.WHITE\n\t}\n\t//board.PrintStdBoard(tmp)\n\trules.ProcessBoard(&tmp, g.blackTurn)\n\t//board.PrintStdBoard(tmp)\n\n\t// it's illegal to commit suicide\n\tif tmp[i][j] == board.EMPTY {\n\t\treturn false, 2\n\t}\n\n\t// it's illegal to repeat state, check if ko\n\tif board.EqualBoard(tmp, g.prev2) {\n\t\treturn false, 3\n\t}\n\n\t// if we don't violate previous rules, it's legal\n\treturn true, 0\n}", "title": "" }, { "docid": "f3abc9041e9e5b77cebed4a5249c11f0", "score": "0.49641493", "text": "func (g guildMemberQueryBuilder) Kick(reason string) error {\n\tr := g.client.newRESTRequest(&httd.Request{\n\t\tMethod: http.MethodDelete,\n\t\tEndpoint: endpoint.GuildMember(g.gid, g.uid),\n\t\tReason: reason,\n\t\tCtx: g.ctx,\n\t}, g.flags)\n\n\t_, err := r.Execute()\n\treturn err\n}", "title": "" }, { "docid": "50ad9e48f3baf0f1b541a25ebd3a9a2e", "score": "0.49569565", "text": "func (p *Player) checkJokerExtra() (int, bool) {\n\tswitch {\n\tcase p.hasJokerR && p.hasJokerB && p.hasWildCard:\n\t\treturn 47, true // it's like having two red Joker and one black Joker i.e. treating the wild card as red Joker (from rank 2 to rank 19).\n\tcase p.hasJokerR && p.hasJokerB:\n\t\treturn 30, false\n\tcase p.hasJokerR && p.hasWildCard:\n\t\treturn 45, true\n\tcase p.hasJokerB && p.hasWildCard:\n\t\treturn 47, true\n\tdefault:\n\t\treturn 0, false\n\t}\n}", "title": "" }, { "docid": "2f65f1de332f448bc70e32e7df01bd7b", "score": "0.4951658", "text": "func PanicIfCallerNotPlaying() {\n\tcallerAddress := address.GetCallerAddress()\n\n\t//if there are 256 bits(a hashedBoard) than the player is playing\n\tif len(state.ReadBytesByAddress(callerAddress)) == 32 {\n\t\tpanic(\"player is in pool\")\n\t}\n\n\t//if the index isn't 0, the player is playing\n\tindex := state.ReadUint64ByAddress(callerAddress)\n\tif index == 0 {\n\t\tpanic(\"player is not playing a game\")\n\t}\n}", "title": "" }, { "docid": "afd3f2e9a9c1d4333afe160cda6d93af", "score": "0.49449554", "text": "func (kc *KickCmd) RequiresRoom() {}", "title": "" }, { "docid": "3e3bc0da78785de91b8bbe3155b32dc0", "score": "0.4921614", "text": "func (gs *GameState) checkPrize(ip string) {\n\tif gs.NextPrize > 1 {\n\t\tgs.NextPrize--\n\t\treturn\n\t}\n\tgs.Players[ip].Points += gs.getPrize()\n\tgs.NextPrize = PrizeSmallClicks\n}", "title": "" }, { "docid": "3f21f78b42f61d32089301e470060338", "score": "0.49214506", "text": "func (b *Bot) trySend() bool {\n if len(b.chips) == 2 {\n if b.high != nil && b.low != nil {\n for !b.low.ready || !b.high.ready { }\n b.low.getChip <- Min(b.chips[0], b.chips[1])\n b.high.getChip <- Max(b.chips[0], b.chips[1])\n b.done <- fmt.Sprintln(\"Bot\",b.id,\"sent chips:\",b.chips[0],\"and\",b.chips[1])\n return true\n }\n }\n return false\n}", "title": "" }, { "docid": "a3ecde328e1478bc6910c65bdf2fd4d1", "score": "0.49084944", "text": "func (gp *GenericPlayer) raise(raiseAmount int) {\n\tif gp.stack < raiseAmount {\n\t\tfmt.Println(gp.getName(),\"tried to raise more than its stack. This is a fatal error.\")\n\t\tfmt.Printf(\"Stack: $%d, Raise: $%d\\n\", gp.stack, raiseAmount)\n\t\t//fmt.Println(gp)\n\t\tos.Exit(9)\n\t}\n\n\t// The below block may be redundant if this method was called from\n\t// allIn() but it's best to have it in case raise() is called from\n\t// a method that doesn't check if the player is all-in or not.\n\tif raiseAmount == gp.stack {\n\t\tgp.isAllIn = true\n\t}\n\n\tgp.bet += raiseAmount\n\tgp.stack -= raiseAmount\n}", "title": "" }, { "docid": "e9ca806062fbaa903d00db09dbb5fca9", "score": "0.49080795", "text": "func (conn *Conn) Kick(ctx context.Context, tube string, bound int) (int64, error) {\n\tconn.mu.Lock()\n\tdefer conn.mu.Unlock()\n\n\t// If the tube is different than the last time, switch tubes.\n\tif tube != conn.lastTube {\n\t\tif _, _, err := conn.command(ctx, \"use %s\", tube); err != nil {\n\t\t\treturn 0, err\n\t\t}\n\n\t\tconn.lastTube = tube\n\t}\n\n\tcount, _, err := conn.command(ctx, \"kick %d\", bound)\n\tif err != nil {\n\t\treturn 0, err\n\t}\n\n\treturn int64(count), nil\n}", "title": "" }, { "docid": "dcefb74688711f768e17de59f62e3596", "score": "0.489799", "text": "func passFail() {\n\tfmt.Println(\"passFail\")\n\tfmt.Print(\"Enter a grade: \")\n\tgrade, err := keyboard.GetFloat()\n\tif err != nil {\n\t\tlog.Fatal(err)\n\t}\n\n\tvar status string\n\tif grade >= 60 {\n\t\tstatus = \"passing\"\n\t} else {\n\t\tstatus = \"failing\"\n\t}\n\tfmt.Println(\"A grade of\", grade, \"is\", status)\n}", "title": "" }, { "docid": "936c864f5b1463e45312e2f1609cf59c", "score": "0.48950452", "text": "func (kc *KickCmd) Validate(args []string) error {\n\tif len(args) != 1 {\n\t\treturn fmt.Errorf(\"requires a single arg\")\n\t}\n\n\tkc.player = args[0]\n\treturn nil\n}", "title": "" }, { "docid": "f5659cd4b5e1650c66883f830227c56e", "score": "0.48838493", "text": "func (ps *raftPeerStats) Fail() {\n\tps.FailCnt++\n}", "title": "" }, { "docid": "dca65da55fe220444fee9457bcc95f8a", "score": "0.4870991", "text": "func (g *Game) validateStockSale(player *Player, saleInfo *MarketAction) error {\n\tif company, err := g.validateMarketAction(saleInfo); err != nil {\n\t\treturn err\n\t} else if held := player.Stocks[company.Name]; held == 0 {\n\t\treturn fmt.Errorf(\"%s has no stock in %s\", player.Name, company.Name)\n\t} else if saleInfo.Count > held {\n\t\treturn fmt.Errorf(\"%s only has %d shares in %s\", player.Name, held, company.Name)\n\t} else if saleInfo.Count == held {\n\t\t// If the sum of this player's shares, the company's shares, and the orphaned shares\n\t\t// equal the total number of shares then no other player has any stock in this company\n\t\tif company.HeldStock+g.OrphanStocks[company.Name]+saleInfo.Count == 10 {\n\t\t\treturn fmt.Errorf(\"Cannot sell the last player held stock in %s\", company.Name)\n\t\t}\n\t}\n\n\treturn nil\n}", "title": "" }, { "docid": "9cbbd43c84023320bacd71379b74c594", "score": "0.48631302", "text": "func playerDecisions(scan *bufio.Reader, p player, d []card, i int, dc []card) (player, int) {\n\tfor {\n\t\to, err := handOptions(scan, p, dc)\n\t\tif err != nil {\n\t\t\tlog.Fatal(err)\n\t\t}\n\t\tif o == \"stand\" {\n\t\t\tbreak\n\t\t}\n\t\tif o == \"hit\" {\n\t\t\tp, i = hit(p, d, i)\n\t\t}\n\t\tcv := sumHand(p.cards)\n\t\tsort.Ints(cv[:])\n\t\tvar bust bool\n\t\tif cv[0] != 0 {\n\t\t\tif cv[0] > 21 && cv[1] > 21 {\n\t\t\t\tbust = true\n\t\t\t}\n\t\t}\n\t\tif cv[0] == 0 {\n\t\t\tif cv[1] > 21 {\n\t\t\t\tbust = true\n\t\t\t}\n\t\t}\n\t\tif bust {\n\t\t\tfmt.Printf(\"Bust %v \", sumHand(p.cards))\n\t\t\tbreak\n\t\t}\n\t}\n\tfmt.Println(p.name, \"has\", p.cards, \"for total value of\", sumHand(p.cards))\n\treturn p, i\n}", "title": "" }, { "docid": "b5b862cd49dd51e0c02426a1bcff68ed", "score": "0.4857646", "text": "func ErrBalanceNotEnough(proposer string, initialDeposit string) sdk.EnvelopedErr {\n\treturn sdk.EnvelopedErr{Err: sdkerrors.New(DefaultCodespace, codeBalanceNotEnough, fmt.Sprintf(\"failed to submit proposal because proposer %s didn't have enough coins to pay for the initial deposit %s\", proposer, initialDeposit))}\n}", "title": "" }, { "docid": "864e66ac7b0666488aed98403f6b8a61", "score": "0.4857027", "text": "func (g *MNK) Passes() int { return -1 }", "title": "" }, { "docid": "f70ed8afe2cc0534deb1617e899c0fb7", "score": "0.48520282", "text": "func (s *Social) KickChatMember(room steamid.SteamID, user steamid.SteamID) {\n\tchatID := room.ClanToChat()\n\ts.client.Write(protocol.NewClientStructMessage(&steamlang.MsgClientChatAction{\n\t\tSteamIdChat: chatID.Uint64(),\n\t\tSteamIdUserToActOn: user.Uint64(),\n\t\tChatAction: steamlang.EChatAction_Kick,\n\t}, make([]byte, 0)))\n}", "title": "" }, { "docid": "0233f961978994bd3263b7d3b5b18549", "score": "0.48479742", "text": "func playerDamaged(id int) {\n\tgameState.Players[id].Lives--\n\tif gameState.Players[id].Lives == 0 {\n\t\tgameState.Players[id].Dead = true\n\t}\n\ttime.Sleep(1500 * time.Millisecond)\n\tgameState.Players[id].DamageTaken = false\n}", "title": "" }, { "docid": "3bbf326f5dfbc91d17555e6e9996569c", "score": "0.48217973", "text": "func panicIfCallerPlaying() {\n\tcallerAddress := address.GetCallerAddress()\n\n\t//if there are 256 bits(a hashedBoard) than the player is playing\n\tif len(state.ReadBytesByAddress(callerAddress)) == 32 {\n\t\tpanic(\"player is already in pool\")\n\t}\n\n\t//if the index isn't 0, the player is playing\n\tindex := state.ReadUint64ByAddress(callerAddress)\n\tif index != 0 {\n\t\tpanic(\"player is already playing\")\n\t}\n\n}", "title": "" }, { "docid": "a670f7efef9437e94b2c4c96bd8c362e", "score": "0.48188594", "text": "func PanicIfOneOfPlayersApprovedBoard() {\n\t//get the games from the state\n\tgames := make(games)\n\tgames.getGamesFromState()\n\t//get the relevant game to the caller\n\trelevantGame := games[state.ReadUint64ByAddress(address.GetCallerAddress())]\n\t//check if one of the players approved their board\n\tif relevantGame.board1Approved != 3 || relevantGame.board2Approved != 3 {\n\t\tpanic(\"both players need to approve their board\")\n\t}\n}", "title": "" }, { "docid": "622ba6499a15f29de08433930aeaaef1", "score": "0.48097196", "text": "func (r *Rock) Attack(damage float64) {\n\tr.hardness -= damage\n\tif r.hardness <= 0 {\n\t\tr.broken = true\n\t\tr.sound.Play()\n\t}\n}", "title": "" }, { "docid": "60d951ed55bd1a1641a2e1afc68f5934", "score": "0.47989514", "text": "func (p *Player) EndTurn() {\n\tp.ThrownDice = false\n}", "title": "" }, { "docid": "ed39cc63691bdb97df924ed56255e15b", "score": "0.4793299", "text": "func (k kind) OtherValid(equip loadout) loadout {\n\tswitch k {\n\tcase rocky:\n\t\tif equip == torch {\n\t\t\treturn climbing\n\t\t}\n\t\treturn torch\n\tcase wet:\n\t\tif equip == climbing {\n\t\t\treturn neither\n\t\t}\n\t\treturn climbing\n\tcase narrow:\n\t\tif equip == neither {\n\t\t\treturn torch\n\t\t}\n\t\treturn neither\n\t}\n\tpanic(\"bums\")\n}", "title": "" }, { "docid": "cd9aae5c0478efdf3d081dbc9d6feb74", "score": "0.47820634", "text": "func (g *CricketGame) RequestThrow(number, modifier int, h *ws.Hub) error {\n\tsequence := g.Base.UndoLog.CreateSequence()\n\tpreviousMessage := g.Base.Message\n\tpreviousState := g.Base.GameState\n\n\tactivePlayer := &g.Base.Player[g.Base.ActivePlayer]\n\tallPlayer := g.Base.Player\n\n\t// Check game state\n\tif g.Base.GameState == \"THROW\" {\n\t\t// check if ongoing round else create\n\t\tcheckOngoingElseCreate(activePlayer, &g.Base, sequence)\n\n\t\t// Add Throw to last round\n\t\tthrowRound := addThrowToCurrentRound(activePlayer, &g.Base, sequence, number, modifier)\n\n\t\t// Filter if throw is relevant at all\n\t\t// and assign index if applicable\n\t\tvar relevant = false\n\t\tvar index = -1\n\t\tfor i, n := range g.Base.CricketController.Numbers {\n\t\t\tif number == n {\n\t\t\t\trelevant = true\n\t\t\t\tindex = i\n\t\t\t}\n\t\t}\n\n\t\tif relevant {\n\t\t\t// Throw is relevant, continue\n\t\t\t// In Ghost reveal if not revealed yet\n\t\t\tif g.Base.CricketController.Ghost {\n\t\t\t\tif !g.Base.CricketController.NumberRevealed[index] {\n\t\t\t\t\tg.Base.CricketController.NumberRevealed[index] = true\n\t\t\t\t\tsequence.AddActionToSequence(undo.Action{\n\t\t\t\t\t\tAction: \"REVEALNUMBER\",\n\t\t\t\t\t\tNumberIndex: index,\n\t\t\t\t\t\tGameID: g.Base.UID,\n\t\t\t\t\t})\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t// Open Close handling\n\t\t\t// Check if already closed\n\t\t\tif !g.Base.CricketController.NumberClosed[index] {\n\t\t\t\t// Continue with scoring and such\n\t\t\t\trelevantMod := increaseHitCount(activePlayer.Score, index, modifier)\n\t\t\t\t// calculate relevant mod\n\n\t\t\t\tpoints := number * relevantMod\n\t\t\t\tsequence.AddActionToSequence(undo.Action{\n\t\t\t\t\tAction: \"INCREASEHITCOUNT\",\n\t\t\t\t\tNumberIndex: index,\n\t\t\t\t\tModifier: modifier,\n\t\t\t\t\tPlayer: activePlayer,\n\t\t\t\t})\n\n\t\t\t\t// Check if number has to be closed for player\n\t\t\t\tif !checkClosed(activePlayer.Score, index) && checkToClose(activePlayer.Score, index) {\n\t\t\t\t\tactivePlayer.Score.Closed[index] = true\n\t\t\t\t\tsequence.AddActionToSequence(undo.Action{\n\t\t\t\t\t\tAction: \"CLOSEPLAYERNUMBER\",\n\t\t\t\t\t\tNumberIndex: index,\n\t\t\t\t\t\tPlayer: activePlayer,\n\t\t\t\t\t})\n\t\t\t\t}\n\n\t\t\t\t// Dispatch to different scoring modes\n\t\t\t\tswitch g.Base.Variant {\n\t\t\t\tcase \"cut\":\n\t\t\t\t\tif checkClosed(activePlayer.Score, index) {\n\t\t\t\t\t\tscoreCut(g, points, index, activePlayer.UID, allPlayer, sequence)\n\t\t\t\t\t}\n\t\t\t\tcase \"normal\":\n\t\t\t\t\tscoreNormal(g, points, index, *activePlayer, sequence)\n\t\t\t\tcase \"no\":\n\t\t\t\t}\n\n\t\t\t\t// Now check again if the number has to be closed\n\t\t\t\tvar done = true\n\t\t\t\tfor _, p := range allPlayer {\n\t\t\t\t\tif !checkClosed(p.Score, index) {\n\t\t\t\t\t\tdone = false\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tif done {\n\t\t\t\t\tg.Base.CricketController.NumberClosed[index] = true\n\t\t\t\t\tsequence.AddActionToSequence(undo.Action{\n\t\t\t\t\t\tAction: \"CLOSECONTROLLERNUMBER\",\n\t\t\t\t\t\tNumberIndex: index,\n\t\t\t\t\t\tGameID: g.Base.UID,\n\t\t\t\t\t})\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\t// Check if 3 throws in round and close round\n\t\t// Also set gameState and perhaps increase g.Base.ThrowRound\n\t\t// if everyone has already thrown to this round\n\t\tif len(throwRound.Throws) == 3 {\n\t\t\tclosePlayerRound(&g.Base, activePlayer, throwRound, sequence, []undo.Action{}, previousState, previousMessage)\n\t\t}\n\n\t\t// Check if game shot and handle win\n\t\tif checkWin(g) {\n\t\t\tcricketWin(g, activePlayer, sequence, throwRound)\n\t\t}\n\n\t\t// Set assets for Frontend\n\t\tsetFrontendAssets(&g.Base.Player[g.Base.ActivePlayer], &g.Base)\n\n\t\t// Update scoreboard\n\t\tutils.WSSendUpdate(g.Base.UID, h)\n\t\treturn nil\n\t}\n\n\treturn fmt.Errorf(\"game state is '%+v', so no throw accepted\", g.Base.GameState)\n}", "title": "" }, { "docid": "7f7d6b2087c808721f15898d9ef0ebe0", "score": "0.47786295", "text": "func (conn *Conn) Kick(channel, nick string, message ...string) {\n\tmsg := strings.Join(message, \" \")\n\tif msg != \"\" {\n\t\tmsg = \" :\" + msg\n\t}\n\tconn.out <- \"KICK \" + channel + \" \" + nick + msg\n}", "title": "" }, { "docid": "b1dfb18b7e6e26022acaad9c2307f18f", "score": "0.47781527", "text": "func (g *Game) updateProgress() error {\n\tg.player[0].mu.RLock()\n\tg.player[1].mu.RLock()\n\t// clock = min{player clocks}\n\tclock := g.player[0].clock\n\tif t := g.player[1].clock; t < clock {\n\t\tclock = t\n\t}\n\twin0 := g.player[0].score > g.player[1].score\n\twin1 := g.player[1].score > g.player[0].score\n\tprog0 := Progress{\n\t\tYourScore: g.player[0].score,\n\t\tOpponentScore: g.player[1].score,\n\t}\n\tprog1 := Progress{\n\t\tYourScore: g.player[1].score,\n\t\tOpponentScore: g.player[0].score,\n\t}\n\tg.player[0].mu.RUnlock()\n\tg.player[1].mu.RUnlock()\n\n\tif err := writeMessage(g.player[0].client.conn, &Message{\n\t\tType: \"Progress\",\n\t\tData: prog0,\n\t}); err != nil {\n\t\treturn err\n\t}\n\tif err := writeMessage(g.player[1].client.conn, &Message{\n\t\tType: \"Progress\",\n\t\tData: prog1,\n\t}); err != nil {\n\t\treturn err\n\t}\n\n\tif clock == NumQuestions {\n\t\t// Game over\n\t\tpfs := []int{\n\t\t\tg.player[0].picks.PortfolioPick,\n\t\t\tg.player[1].picks.PortfolioPick,\n\t\t}\n\t\tif err := writeMessage(g.player[0].client.conn, &Message{\n\t\t\tType: \"GameOver\",\n\t\t\tData: GameOver{\n\t\t\t\tYouWon: win0,\n\t\t\t\tPortfolios: pfs,\n\t\t\t},\n\t\t}); err != nil {\n\t\t\treturn err\n\t\t}\n\t\tif err := writeMessage(g.player[1].client.conn, &Message{\n\t\t\tType: \"GameOver\",\n\t\t\tData: GameOver{\n\t\t\t\tYouWon: win1,\n\t\t\t\tPortfolios: pfs,\n\t\t\t},\n\t\t}); err != nil {\n\t\t\treturn err\n\t\t}\n\t}\n\treturn nil\n}", "title": "" }, { "docid": "c874dcb92b761f5159710d13e56e8eea", "score": "0.47672597", "text": "func TestGetOutputRun3(t *testing.T){\n userguess:=\"SAND\"\n cows,bulls := CowsandBulls.GetOutput(userguess,systemguess)\n if cows<0 && bulls<0{\n t.Fail()\n t.Log(\"Invalid output in third run\")\n }\n fmt.Println(\"user third guess\" ,userguess)\n fmt.Println(\"cows and bulls are\" ,cows,bulls)\n}", "title": "" }, { "docid": "13360e0f6628044a109cd45fc31c541a", "score": "0.4765151", "text": "func (p *Player) doTurn() {\n\n\tr := rand.New(rand.NewSource(time.Now().Unix()))\n\n\t// randomly choose an opponent to ask\n\tvar randIdx = p.ID\n\tif len(p.Opponents) > 1 {\n\t\tfmt.Printf(\"Player %d my hand: %v\\n\", p.ID, p.Hand)\n\t\tfmt.Printf(\"Player %d my pairs: %v\\n\\n\", p.ID, p.Pairs)\n\n\t\tfor randIdx == p.ID {\n\t\t\trandIdx = r.Intn(len(p.Opponents))\n\t\t}\n\n\t\targs := CardRequest{Target: p.Opponents[randIdx].ID}\n\n\t\t// randomly choose a card value from your hand to ask for\n\t\tif len(p.Hand) > 0 {\n\t\t\trandIdx = r.Intn(len(p.Hand))\n\t\t\targs.Value = p.Hand[randIdx].Value\n\t\t} else {\n\t\t\targs.Value = \"-1\"\n\t\t}\n\n\t\tp.callAskForCard(args)\n\n\t} else {\n\t\ttime.Sleep(300 * time.Millisecond)\n\t}\n}", "title": "" }, { "docid": "5640b8b8ec79bb1e0a328dc39eded0f3", "score": "0.4764593", "text": "func cmdDrawnBalot(fromID, letter, number string, respmsg tgbotapi.MessageConfig) (tgbotapi.MessageConfig, bool) {\n\tvar ()\n\trespmsg.Text = errorOccurred + randomGif(\"fail\")\n\n\tgame, _, err := getGameNOrganizer(fromID, \"\")\n\tif err != nil {\n\t\tstrerr := fmt.Sprintf(\"failed loading game (%s) and organizer from (TG %s) for details\", game.BingoID, fromID)\n\t\tlogError(strerr, err)\n\t\treturn respmsg, false\n\t}\n\n\tif !game.Playing {\n\t\tstrerr := fmt.Sprintf(\"drawn balot but game is not playing (%s)\", game.BingoID)\n\t\trespmsg.Text = \"No se esta jugando una partida! Inicia una nueva partida para jugar\"\n\t\tlogError(strerr, err)\n\t\treturn respmsg, false\n\t}\n\n\twinners, err := game.drawBalot(letter, number)\n\tif err != nil {\n\t\tstrerr := fmt.Sprintf(\"failed game.drawBalot %s\", game.BingoID)\n\t\tlogError(strerr, err)\n\t\treturn respmsg, true\n\t}\n\n\trespmsg.Text = fmt.Sprintf(\"Registrado (%s-%s)\", letter, number)\n\tif number == \"42\" {\n\t\trespmsg.Text += \"(😛 woooo 42nd!!)\"\n\t}\n\tif winners > 0 {\n\t\trespmsg.Text += fmt.Sprintf(\"\\n\\nHabemus ganadores: %d\", winners)\n\t}\n\n\treturn respmsg, true\n}", "title": "" }, { "docid": "5b33ff8048e9678cfae54b4983ba0c47", "score": "0.47642094", "text": "func (s *SelectorTournament) validOrPanic() {\n\tif s.KeepCount < 1 {\n\t\tlog.Panicf(\"KeepCount must be one or more: %d\", s.KeepCount)\n\t}\n\tif s.Contenders < 2 {\n\t\tlog.Panicf(\"Contenders must be two or more: %d\", s.Contenders)\n\t}\n}", "title": "" }, { "docid": "8338dacb1706e76285a3f8bdba73ceec", "score": "0.4746635", "text": "func TestSystemguess(t *testing.T){\n systemguess= CowsandBulls.Systemguess()\n \n if len(systemguess)!=4 {\n t.Fail()\n t.Log(\"Invalid system guess\")\n }\n fmt.Println(\"system guess\",systemguess)\n}", "title": "" }, { "docid": "e4fc425fcecc355f609ff208fc598536", "score": "0.4738653", "text": "func (s SendError) CanRetry() bool { return true }", "title": "" }, { "docid": "736cb33f3d89fcc38950ef23ce1a5abc", "score": "0.47332716", "text": "func TestGetOutputRun4(t *testing.T){\n userguess:=\"NAMS\"\n cows,bulls := CowsandBulls.GetOutput(userguess,systemguess)\n if cows<0 && bulls<0{\n t.Fail()\n t.Log(\"Invalid output in fourth run\")\n }\n fmt.Println(\"user fourth guess\" ,userguess)\n fmt.Println(\"cows and bulls are\" ,cows,bulls)\n}", "title": "" }, { "docid": "bc4950b56cf888533572a3074db55d2d", "score": "0.47308823", "text": "func PassFail() {\n\ttitle := \"Ferris: Conditionals and Loops in Go.\"\n\tfmt.Println(strings.Title(title))\n\n\t// fmt.Print doesnt skip to a new line, we can grab input\n\tfmt.Print(\"Enter a grade: \")\n\n\tgrade, err := keyboard.GetFloat()\n\tif err != nil {\n\t\tlog.Fatal(err)\n\t}\n\n\tvar status string\n\tif grade >= 60 {\n\t\tstatus = \"Passing\"\n\t} else {\n\t\tstatus = \"Failing\"\n\t}\n\tfmt.Println(status)\n}", "title": "" }, { "docid": "a67f2a388f18cf1b81969148643645c4", "score": "0.4730417", "text": "func (o *Account) GetUserLimitOk() (int32, bool) {\n\tif o == nil || o.UserLimit == nil {\n\t\tvar ret int32\n\t\treturn ret, false\n\t}\n\treturn *o.UserLimit, true\n}", "title": "" }, { "docid": "47961cbb7271c988c86fbe723a6afa96", "score": "0.4720682", "text": "func (server *SBServer) KickHandler(w http.ResponseWriter, r *http.Request) {\n\turlSuffix := strings.TrimPrefix(r.URL.Path, \"/admin/kick/\")\n\turlSuffixSplit := strings.Split(urlSuffix, \"/\")\n\n\tif len(urlSuffixSplit) == 1 || len(urlSuffixSplit) > 3 || (len(urlSuffixSplit) == 3 && urlSuffixSplit[2] != \"\") {\n\t\tw.WriteHeader(400)\n\t\tw.Write([]byte(\"Request URL is illegal.\"))\n\t\treturn\n\t}\n\troomName := urlSuffixSplit[0]\n\tplayerToKick := urlSuffixSplit[1]\n\n\tswitch r.Method {\n\tcase http.MethodDelete:\n\t\troom, err := server.GetRoom(roomName)\n\t\tif err != nil {\n\t\t\tw.WriteHeader(404)\n\t\t\tw.Write([]byte(\"Room \\\"\" + roomName + \"\\\" doesn't exist.\"))\n\t\t\treturn\n\t\t}\n\n\t\tgame, err := server.GetGame(roomName)\n\t\tif err != nil || game.Finished {\n\t\t\tw.WriteHeader(404)\n\t\t\tw.Write([]byte(\"There is no running game in room \\\"\" + roomName + \"\\\".\"))\n\t\t\treturn\n\t\t}\n\n\t\tissuer, err := util.ExtractUsernameFromAuthorizationHeader(r.Header.Get(\"Authorization\"))\n\t\tif err != nil {\n\t\t\tw.WriteHeader(500)\n\t\t\tw.Write([]byte(\"Error during decoding of authorization header.\"))\n\t\t\treturn\n\t\t}\n\n\t\tinGame := false\n\t\tfor _, player := range game.Players {\n\t\t\tif player == playerToKick {\n\t\t\t\tinGame = true\n\t\t\t\tbreak\n\t\t\t}\n\t\t}\n\t\tif !inGame {\n\t\t\tw.WriteHeader(404)\n\t\t\tw.Write([]byte(\"The user to kick is not in the game.\"))\n\t\t\treturn\n\t\t}\n\n\t\tisAdmin := false\n\t\tfor _, admin := range room.Admins {\n\t\t\tif admin == issuer {\n\t\t\t\tisAdmin = true\n\t\t\t\tbreak\n\t\t\t}\n\t\t}\n\t\tif !isAdmin {\n\t\t\tw.WriteHeader(403)\n\t\t\tw.Write([]byte(\"You don't have admin access for room \\\"\" + roomName + \"\\\".\"))\n\t\t\treturn\n\t\t}\n\n\t\tgame.Kick(playerToKick)\n\t\tw.Write([]byte(\"Player \\\"\" + playerToKick + \"\\\" has been kicked from the game in room \\\"\" + roomName + \"\\\".\"))\n\t\treturn\n\tdefault:\n\t\tw.WriteHeader(405)\n\t\treturn\n\t}\n}", "title": "" }, { "docid": "89ec1a39d5fba6bfc8dbadd9687acb13", "score": "0.47196373", "text": "func (b *Board) moveLegal(piece *Piece, p1, p2 Pos) error {\n\tif b.positionOffBoard(p2) {\n\t\treturn fmt.Errorf(\"position p2 is off the board\")\n\t}\n\n\t// Check if there's a piece at position p2.\n\tpiece2, found := b.posToPiece[p2]\n\n\t// If there was a piece found at position p2.\n\tif found {\n\t\t// If piece2 is the color as piece, the position\n\t\t// is occupied.\n\t\tif piece.Color == piece2.Color {\n\t\t\treturn ErrOccupiedPosition\n\t\t}\n\t\t// If the piece is a pawn, it can't take a piece in\n\t\t// front of it.\n\t\tif piece.Name == Pawn && p1.X == p2.X {\n\t\t\treturn ErrOccupiedPosition\n\t\t}\n\t}\n\n\t// If there was no piece at position p2 and the piece is a\n\t// pawn trying to move diagonally, if there's no setup for\n\t// an en passant, the move is illegal.\n\tif !found && piece.Name == Pawn && p1.X != p2.X &&\n\t\t!b.canEnPassant(piece, p1, p2) {\n\t\treturn ErrInvalidPieceMove\n\t}\n\n\t// Check if the move from p1 to p2 is blocked by any other pieces.\n\tif b.moveBlocked(piece, p1, p2) {\n\t\treturn ErrMoveBlocked\n\t}\n\n\t// If color is in check, make sure that the piece can't\n\t// be moved, unless it evades the current check.\n\t//\n\t// If not in check, then make sure move doesn't put own king in check.\n\tif err := b.moveIntoOrWhileCheck(piece, p1, p2); err != nil {\n\t\treturn err\n\t}\n\n\t// If the piece is a King, see if it can move to p2 without\n\t// being put into check and also make sure that the opponent's\n\t// king is not within 1 X or Y position of position p2.\n\tif piece.Name == King {\n\t\t// Get the king's possible move positions from position p2.\n\t\tkingPositions := getMovePositions(piece, p2)\n\t\t// Iterate over all the possible positions from p2 and see if\n\t\t// the opponent's king is in any of those positions.\n\t\tfor pos := range kingPositions {\n\t\t\tif pc, found := b.posToPiece[pos]; found {\n\t\t\t\t// The king will be too close to the other king if it\n\t\t\t\t// moves to position p2.\n\t\t\t\tif pc.Name == King && pc.Color != piece.Color {\n\t\t\t\t\treturn ErrKingTooCloseToKing\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\t// Remove the king from it's current position on the board\n\t\t// so that it doesn't block any pieces in position attacked.\n\t\tdelete(b.posToPiece, p1)\n\n\t\t// Check if the position is being attacked by the opponent's color.\n\t\tattacked := b.positionAttacked(p2, piece.Color^1)\n\n\t\t// Put the king back at position p1.\n\t\tb.posToPiece[p1] = piece\n\n\t\t// If the position is being attacked, the move is illegal\n\t\t// as the king would be moving into a check.\n\t\tif attacked {\n\t\t\treturn ErrMovingIntoCheck\n\t\t}\n\t}\n\n\treturn nil\n}", "title": "" }, { "docid": "911ee20f52c0cb580f59f49a7adb8367", "score": "0.47193357", "text": "func TestGetOutputRun1(t *testing.T){\n userguess:=\"TEST\"\n cows,bulls := CowsandBulls.GetOutput(userguess,systemguess)\n if cows<0 && bulls<0{\n t.Fail()\n t.Log(\"Invalid output in first run\")\n }\n fmt.Println(\"user first guess\" ,userguess)\n fmt.Println(\"cows and bulls are\" ,cows,bulls)\n}", "title": "" }, { "docid": "67ccf2bdf146421f0f6625a6e77f3327", "score": "0.47155666", "text": "func (kc *KickCmd) Run() error {\n\taction := fmt.Sprintf(\"kick player \\\"%s\\\" from the game\", kc.player)\n\tif !util.ConfirmationPrompt(action) {\n\t\tfmt.Println(\"Operation cancelled. No action taken.\")\n\t\treturn nil\n\t}\n\tif err := kc.Client.KickPlayer(kc.player); err != nil {\n\t\treturn err\n\t}\n\n\tfmt.Printf(\"You've kicked \\\"%s\\\" from the game.\\n\", kc.player)\n\treturn nil\n}", "title": "" }, { "docid": "c68aca1690747f89e85e66728bea11c1", "score": "0.47134334", "text": "func (p *player) addTry(knockedDownPins int) bool {\n\tif len(p.frames) == 0 {\n\t\tp.createFrame(1, knockedDownPins)\n\t\treturn true\n\t} else {\n\t\tlastFrame := p.frames[len(p.frames)-1]\n\t\treturn lastFrame.addTry(knockedDownPins, p)\n\t}\n}", "title": "" }, { "docid": "d5e7e25d994ac9fa04454b92bce96018", "score": "0.469391", "text": "func isUnspendable(o *wire.TxOut) bool {\n\tswitch {\n\tcase len(o.PkScript) > 10000: //len 0 is OK, spendable\n\t\treturn true\n\tcase len(o.PkScript) > 0 && o.PkScript[0] == 0x6a: //OP_RETURN is 0x6a\n\t\treturn true\n\tdefault:\n\t\treturn false\n\t}\n}", "title": "" }, { "docid": "e3b9d1ef25ae51ddc42e955bd908032d", "score": "0.4691078", "text": "func TryActivateSuperManaPotion(sim *Simulation) {\n\tif !sim.Options.Consumes.SuperManaPotion || sim.isOnCD(MagicIDPotion) {\n\t\treturn\n\t}\n\n\t// Only pop if we have less than the max mana provided by the potion minus 1mp5 tick.\n\ttotalRegen := sim.manaRegenPerSecond() * 5\n\tif sim.Stats[StatMana]-(sim.CurrentMana+totalRegen) < 3000 {\n\t\treturn\n\t}\n\n\t// Restores 1800 to 3000 mana. (2 Min Cooldown)\n\tmanaGain := 1800 + (sim.rando.Float64() * 1200)\n\n\tif sim.hasAura(MagicIDAlchStone) {\n\t\tmanaGain *= 1.4\n\t}\n\n\tsim.CurrentMana += manaGain\n\tsim.setCD(MagicIDPotion, time.Second*120)\n\tif sim.Debug != nil {\n\t\tsim.Debug(\"Used Mana Potion\\n\")\n\t}\n\treturn\n}", "title": "" }, { "docid": "b5b4afa73307a105b99882a2fe36e011", "score": "0.46908602", "text": "func (b Board) endgameValue() int {\n //Another possibilty for the function below\n /*\n x := 0\n t := 0\n for (x < len(b.Pieces)) {\n if (strings.Compare(b.Pieces[x].Name, \"queen\") == 0) {\n t = t + 2\n }\n if (strings.Compare(b.Pieces[x].Name, \"rook\") == 0) {\n t = t + 1\n }\n x = x + 1\n }\n if (t < 3) {\n return 1\n }\n return 0\n */\n\n if (len(b) < 12) {\n return 1\n }\n return 0\n}", "title": "" }, { "docid": "0bed8e78b081880a0682982e0d881ce8", "score": "0.46827006", "text": "func (t *Team) TestHintAllowed(cipher *CipherConfig, status CipherStatus) (bool, string, time.Time) {\n\td := t.Now().Sub(status.Arrival)\n\tstats, _ := t.GetStats()\n\ttitle := \"\"\n\n\tswitch t.gameConfig.HintMode {\n\tcase HintsFree:\n\t\tif d < t.gameConfig.HintLimit {\n\t\t\treturn false, fmt.Sprintf(\"Zatím uběhlo jen %v od příchodu na šifru, nápověda je dostupná až po %v od příchodu\", d.Round(time.Second), t.gameConfig.HintLimit), status.Arrival.Add(t.gameConfig.HintLimit)\n\t\t}\n\tcase HintsMiniCiphers:\n\t\tif stats.HintScore <= 0 && !t.gameConfig.HintMCAllowNegative {\n\t\t\treturn false, fmt.Sprintf(\"Nemáte žádné nepoužité šifřičky pro zisk nápovědy, nejdříve nějakou vyluštěte\"), time.Time{}\n\t\t}\n\t\tif d < t.gameConfig.HintLimit {\n\t\t\treturn false, fmt.Sprintf(\"Zatím uběhlo jen %v od příchodu na šifru, nápověda je dostupná až po %v od příchodu\", d.Round(time.Second), t.gameConfig.HintLimit), status.Arrival.Add(t.gameConfig.HintLimit)\n\t\t}\n\n\t\tif stats.HintScore <= 0 {\n\t\t\ttitle = \"Nemáte žádné nepoužité šifřičky, ale můžete si vzít nápovědu na dluh\"\n\t\t}\n\t}\n\treturn true, title, time.Time{}\n}", "title": "" }, { "docid": "4a12acf50c8e9dacbd6176bba2d126e8", "score": "0.46734607", "text": "func TransServerError(err error) {\n\tvar player1FirstHand bool\n\tif conf.PLAYER1_FIRST_HAND == \"true\" {\n\t\tplayer1FirstHand = true\n\t} else {\n\t\tplayer1FirstHand = false\n\t}\n\n\tmatchErrData := &model.MatchDataModel{\n\t\tGameID: conf.GAME_ID,\n\t\tBoardLength: conf.BOARD_LENGTH,\n\t\tBoardHeight: conf.BOARD_HEIGHT,\n\t\tPlayer1ID: conf.PLAYER1_ID,\n\t\tPlayer2ID: conf.PLAYER2_ID,\n\t\tPlayer1FirstHand: player1FirstHand,\n\t\tMaxThingTime: conf.MAX_THINKING_TIME,\n\t\tWinner: -1,\n\t\tStartTime: time.Now().Unix(),\n\t\tEndTime: time.Now().Unix(),\n\t\tOperations: []*model.Operation{},\n\t\tFoulPlayer: 0,\n\t\tServerError: true,\n\t}\n\n\tbinaryData, err1 := json.Marshal(matchErrData)\n\tif err1 != nil {\n\t\tselect {}\n\t}\n\n\tproducer, err1 := client.NewNsqClient()\n\tif err1 != nil {\n\t\tselect {}\n\t}\n\n\ti := 0\n\tfor ;producer.Publish(conf.NSQ_TOPIC_GAME_RESULT, binaryData) != nil && i < 10; i++ {}\n\n\tselect {}\n}", "title": "" }, { "docid": "ed81176f71696c17c81353b4f4124bf7", "score": "0.4672101", "text": "func (c *Contractor) badContractCheck(u modules.ContractUtility) (modules.ContractUtility, bool) {\n\tif u.BadContract {\n\t\tu.GoodForUpload = false\n\t\tu.GoodForRenew = false\n\t\treturn u, true\n\t}\n\treturn u, false\n}", "title": "" }, { "docid": "db709847646cf9386074b837886279ce", "score": "0.46654347", "text": "func Monstercheck(cp models.Player) models.Player {\n\tcm := models.Spawnmonsterget()\n\tif cp.Position == cm.Position {\n\t\tbcheck := 1 //1 means fight, 0 means stop\n\t\tif cm.Met == true {\n\t\t\tfmt.Println(cm.Found)\n\t\t}\n\t\tif cm.Met == false {\n\t\t\tfmt.Println(\"You see a\", cm.Name)\n\t\t\tfmt.Println(cm.Intro)\n\t\t\tcm.Met = true\n\t\t\tmodels.Monsterupdate(cm, cm.Name)\n\t\t}\n\t\tfor bcheck == 1 { //need to check if player is alive, monster is alive, and they are in the same room\n\t\t\tcp, cm = battle(cp, cm)\n\t\t\tif cm.Position == cp.Position {\n\t\t\t\tif cm.Health > 0 {\n\t\t\t\t\tmodels.Monsterhealth(cm)\n\t\t\t\t}\n\t\t\t}\n\t\t\tbcheck = 0\n\t\t\tif cm.Health > 0 && cp.Health > 0 {\n\t\t\t\tif cp.Position == cm.Position {\n\t\t\t\t\tbcheck = 1\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\tif cm.Health <= 0 {\n\t\t\tcp.Continue = false\n\t\t\tfmt.Println(cm.Outrom)\n\t\t}\n\t\tif cp.Health <= 0 && cm.Health > 0 { //player wins ties\n\t\t\tcp.Continue = false\n\t\t\t//fmt.Println(cm.Outrop) moved to ending.go\n\t\t}\n\t\tmodels.Monsterupdate(cm, cm.Name)\n\t\treturn cp\n\t}\n\treturn cp\n}", "title": "" }, { "docid": "d2f44a98f1a3dec12abec2d124215c68", "score": "0.4660476", "text": "func TestBroke(t *testing.T) {\n\tgame := NewGame(5, 0)\n\t_, _, err := game.Deal()\n\tif err == nil {\n\t\tt.Log(\"Game dealt hand to player with 0 balance\")\n\t\tt.Fail()\n\t}\n}", "title": "" }, { "docid": "9cdb93a40eab6ac088e823b475d3b2fa", "score": "0.46597221", "text": "func (r *Roster) PlayerKilled(vUUID, aUUID uuid.UUID) {\n\tr.lock.Lock()\n\tif _, ok := r.kills[aUUID]; ok {\n\t\tr.kills[aUUID]++\n\t} else {\n\t\tr.kills[aUUID] = 1\n\t}\n\tr.deaths[vUUID]++\n\tr.lock.Unlock()\n}", "title": "" }, { "docid": "59b0b6e17291aa8cfd7a556230f3aee6", "score": "0.46537548", "text": "func attempts(name string) int {\n\tif strings.Contains(name, \"Android_Framework\") || strings.Contains(name, \"G3_Framework\") {\n\t\t// Both bots can be long running. No need to retry them.\n\t\treturn 1\n\t}\n\tif !(strings.HasPrefix(name, \"Build-\") || strings.HasPrefix(name, \"Upload-\")) {\n\t\tfor _, extraConfig := range []string{\"ASAN\", \"MSAN\", \"TSAN\", \"UBSAN\", \"Valgrind\"} {\n\t\t\tif strings.Contains(name, extraConfig) {\n\t\t\t\t// Sanitizers often find non-deterministic issues that retries would hide.\n\t\t\t\treturn 1\n\t\t\t}\n\t\t}\n\t}\n\t// Retry by default to hide random bot/hardware failures.\n\treturn 2\n}", "title": "" }, { "docid": "e0bf7b8a07ace34affa18d4e77d74106", "score": "0.46531406", "text": "func findPlayer(a *App,tag string)(structures.PlayerStats,error) {\n\n\t//Search for the player in local database\n\tplayer, err := queries.GetFromTag(a.DB, tag)\n\n\tif err != nil {\n\n\t\t//In case it doesn't exists in the database\n\t\tif err == sql.ErrNoRows {\n\n\t\t\t//Search for the player through the clash royale api\n\t\t\tplayer, err := a.Client.GetRequestForPlayer(tag)\n\n\t\t\t//Returns error if there was an error with the request to the api\n\t\t\tif err != nil {\n\t\t\t\treturn player, err\n\t\t\t}\n\n\t\t\t//Updates the player in the local database\n\t\t\terr = queries.UpdatePlayer(a.DB, player, nil)\n\n\t\t\t//Error during the updating of the player in the local database\n\t\t\tif err != nil {\n\t\t\t\treturn player, errors.NewResponseError(err.Error(), \"Failed to insert/update the player into database, please try again later\", 500)\n\t\t\t}\n\n\t\t\t//Reads the newly inserted player from the local database\n\t\t\tplayer, err = queries.GetFromTag(a.DB, tag)\n\n\t\t\t//Error during reading the newly inserted player from the database\n\t\t\tif err != nil {\n\t\t\t\tif err == sql.ErrNoRows {\n\t\t\t\t\t//Tries to read the same player without a clan\n\t\t\t\t\tplayer, err := queries.ClanNotFoundByTag(a.DB, tag)\n\n\t\t\t\t\t//In case the backup read without clan fails, player doesn't exists or isn't reachable at the moment\n\t\t\t\t\tif err != nil {\n\t\t\t\t\t\treturn player, errors.NewResponseError(err.Error(), \"Can't find the player\", 404)\n\t\t\t\t\t}\n\t\t\t\t\t//Returns the structure of the player and a nil error\n\t\t\t\t\treturn player, nil\n\t\t\t\t} else {\n\t\t\t\t\t//In case the database error isn't ErrNoRows, returns unexpected error\n\t\t\t\t\treturn player, errors.NewResponseError(err.Error(), \"Unexpected error with the database\", 500)\n\t\t\t\t}\n\t\t\t}\n\n\t\t\treturn player, nil\n\n\t\t} else {\n\t\t\t//In case the database error isn't ErrNoRows, returns unexpected error\n\t\t\treturn player, errors.NewResponseError(err.Error(), \"Unexpected error with the database\", 500)\n\t\t}\n\t}\n\n\t//Returns the player struct and nil error if the player is present in our local database\n\treturn player, nil\n\n}", "title": "" }, { "docid": "8e681a23321f692d55686a4521b3bec3", "score": "0.46461356", "text": "func (st *serverTester) mineMoney() {\n\t// Get old balance.\n\tvar info modules.WalletInfo\n\tst.getAPI(\"/wallet/status\", &info)\n\n\t// Mine enough blocks to overcome the maturity delay and receive coins.\n\tfor i := 0; i < 1+consensus.MaturityDelay; i++ {\n\t\tst.mineBlock()\n\t\tst.updateWait()\n\t}\n\n\t// Compare new balance to old balance.\n\tvar info2 modules.WalletInfo\n\tst.getAPI(\"/wallet/status\", &info2)\n\tif info2.Balance.Cmp(info.Balance) <= 0 {\n\t\tst.Fatal(\"Mining did not increase balance\")\n\t}\n}", "title": "" }, { "docid": "9708579f5c0cbdb011b817b03944a715", "score": "0.46454093", "text": "func test_kill_player() {\n\tbg := initBackground()\n\tbg = insertEnemy(bg)\n\tbg = insertEnemy(bg)\n\tbg = insertEnemy(bg)\n\tplay := initPlayer()\n\t\t\n\tTEST_STEPS := 125\n\tfor i := 0; i < TEST_STEPS; i++ {\n\t\tbg = moveBackground(bg)\n\t\tif checkDead(bg, play) {\n\t\t\tfmt.Println(\"Successfully died!\")\n\t\t\treturn\n\t\t}\n\t\tbg = drawPlayer(bg, play)\n\t\trender(bg)\n\t}\n}", "title": "" }, { "docid": "f191a37431d2a44f6d79a68cdb58dca1", "score": "0.46419543", "text": "func TestGetOutputRun2(t *testing.T){\n userguess:=\"VALS\"\n cows,bulls := CowsandBulls.GetOutput(userguess,systemguess)\n if cows<0 && bulls<0{\n t.Fail()\n t.Log(\"Invalid output in second run\")\n }\n fmt.Println(\"user second guess\" ,userguess)\n fmt.Println(\"cows and bulls are\" ,cows,bulls)\n}", "title": "" }, { "docid": "c175fac550306bb857a999c9a34716ff", "score": "0.4640254", "text": "func rpsGame(playerName string) {\n\t// game variable controls if rps is running or not. Needs to be rewritten for\n\t// better effeciency ***\n\tgame := 0\n\tfor game < 1 {\n\t\tcomputerPlay := rand.Intn(3) + 1\n\n\t\t//humanPlay variable containing output of users options\n\t\tvar humanPlay int\n\t\tfmt.Printf(\"\\n ~~~~~~~~~~~~~~~~~~~~~~~~~~~~ \\n\")\n\t\tfmt.Printf(\"| |\\n\")\n\t\tfmt.Printf(\"| (1) - Rock |\\n\")\n\t\tfmt.Printf(\"| (2) - Scissors |\\n\")\n\t\tfmt.Printf(\"| (3) - Paper |\\n\")\n\t\tfmt.Printf(\"| |\\n\")\n\t\tfmt.Printf(\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~ \\n\")\n\t\tfmt.Printf(\"\\nRock, Scissors, or Paper: \")\n\t\tfmt.Scanln(&humanPlay)\n\n\t\t// condition for if the player chooses a non valid choice\n\t\tif humanPlay < 1 || humanPlay > 3 {\n\t\t\tguesses := 0\n\t\t\twrong := 0\n\t\t\tfor wrong < 1 {\n\t\t\t\tfmt.Printf(\"That is not a valid choice. Choose again.\")\n\t\t\t\tguesses = guesses + 1\n\t\t\t\tfmt.Printf(\"\\nRock, Scissors, or Paper: \")\n\t\t\t\tfmt.Scanln(&humanPlay)\n\t\t\t\tif humanPlay == 1 || humanPlay == 2 || humanPlay == 3 {\n\t\t\t\t\twrong = 1\n\t\t\t\t}\n\t\t\t\tfor guesses >= 3 {\n\t\t\t\t\tfmt.Printf(\"Are you an idiot??? Type 1 for Rock, 2 for Scissors or 3 for paper... Sheesh.\")\n\t\t\t\t\tguesses = guesses + 1\n\t\t\t\t\tfmt.Printf(\"\\nRock, Scissors, or Paper: \")\n\t\t\t\t\tfmt.Scanln(&humanPlay)\n\t\t\t\t\tif humanPlay == 1 || humanPlay == 2 || humanPlay == 3 {\n\t\t\t\t\t\twrong = 1\n\t\t\t\t\t\tguesses = 0\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\t// conditions of if and switches for players choice and computers choice\n\t\tif humanPlay == 1 {\n\t\t\tfmt.Printf(\"%s plays Rock.\\n\", playerName)\n\t\t}\n\t\tif humanPlay == 2 {\n\t\t\tfmt.Printf(\"%s plays Scissors.\\n\", playerName)\n\t\t}\n\t\tif humanPlay == 3 {\n\t\t\tfmt.Printf(\"%s plays Paper.\\n\", playerName)\n\t\t}\n\t\tif computerPlay == 1 {\n\t\t\tfmt.Printf(\"Computer plays Rock.\\n\")\n\t\t}\n\t\tif computerPlay == 2 {\n\t\t\tfmt.Printf(\"Computer plays Scissors.\\n\")\n\t\t}\n\t\tif computerPlay == 3 {\n\t\t\tfmt.Printf(\"Computer plays Paper.\\n\")\n\t\t}\n\n\t\tif humanPlay == computerPlay {\n\t\t\tif humanPlay == 1 {\n\t\t\t\tfmt.Printf(\"It's a draw! Try again!\\n\")\n\t\t\t}\n\t\t\tif humanPlay == 2 {\n\t\t\t\tfmt.Printf(\"It's a draw! Try again!\\n\")\n\t\t\t}\n\t\t\tif humanPlay == 3 {\n\t\t\t\tfmt.Printf(\"It's a draw! Try again!\\n\")\n\t\t\t}\n\t\t} else if humanPlay == 1 {\n\t\t\tswitch computerPlay {\n\t\t\tcase 2:\n\t\t\t\tfmt.Printf(\"Rock smashes Scissors! %s wins!\\n\", playerName)\n\t\t\tcase 3:\n\t\t\t\tfmt.Printf(\"Paper covers Rock! Computer wins!\\n\")\n\t\t\t}\n\t\t} else if humanPlay == 2 {\n\t\t\tswitch computerPlay {\n\t\t\tcase 3:\n\t\t\t\tfmt.Printf(\"Scissors cuts Paper! %s wins!\\n\", playerName)\n\t\t\tcase 1:\n\t\t\t\tfmt.Printf(\"Rock smashes Scissors! Computer wins!\\n\")\n\n\t\t\t}\n\t\t} else if humanPlay == 3 {\n\t\t\tswitch computerPlay {\n\t\t\tcase 1:\n\t\t\t\tfmt.Printf(\"Paper covers Rock! %s wins!\\n\", playerName)\n\t\t\tcase 2:\n\t\t\t\tfmt.Printf(\"Scissors cuts Paper! Computer wins!\\n\")\n\t\t\t}\n\t\t}\n\t\t// game var breaks the loop after one run through. for loop not necessarily needed\n\t\t// since there is only one round. only used for future round implementation\n\t\tgame = game + 1\n\n\t\t// var again2 to play again or go back to main menu\n\t\tvar again2 int\n\t\tfmt.Printf(\"\\nPress 1 to play again or 2 to go back to the main menu: \")\n\t\tfmt.Scanln(&again2)\n\n\t\tif again2 == 1 {\n\t\t\trpsGame(playerName)\n\t\t} else if again2 == 2 {\n\t\t\tgameDriver(playerName)\n\t\t} else {\n\t\t\tfor {\n\t\t\t\tfmt.Printf(\"That is a not a valid selection. Choose again: \")\n\t\t\t\tfmt.Scanln(&again2)\n\t\t\t\tif again2 == 1 || again2 == 2 {\n\t\t\t\t\tbreak\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n}", "title": "" }, { "docid": "786db09be196544403483ad304534661", "score": "0.46389568", "text": "func (ps *PokerSet) JudgeBankerAndPlayerWin(pr *PokerSet) (result bool) {\n\n\tpr.CalcPokerTypeAndSum()\n\t//先比较类型\n\tif ps.TypeSan>pr.TypeSan{\n\t\tpr.IsWin=false\n\t\treturn\n\t}\n\tif ps.TypeSan<pr.TypeSan{\n\t\tpr.IsWin=true\n\t\treturn\n\t}\n\t//类型相同\n\tif ps.TypeSan==pr.TypeSan{\n\t\tif ps.ThreeSum>pr.ThreeSum{\n\t\t\tpr.IsWin=false\n\t\t\treturn\n\t\t}\n\n\t\tif ps.ThreeSum<pr.ThreeSum{\n\t\t\tpr.IsWin=true\n\t\t\treturn\n\t\t}\n\n\t\tif ps.ThreeSum==pr.ThreeSum{\n\t\t\t//比较公牌数量\n\t\t\tif ps.CountPaiSum()>pr.CountPaiSum(){\n\t\t\t\tpr.IsWin=false\n\t\t\t\treturn\n\t\t\t}\n\t\t\tif ps.CountPaiSum()<pr.CountPaiSum(){\n\t\t\t\tpr.IsWin=true\n\t\t\t\treturn\n\t\t\t}\n\t\t\tif ps.CountPaiSum()==pr.CountPaiSum(){//公牌数相等\n\t\t\t\t//比较最大那张牌\n\t\t\t\tif ps.Pokers[0].Flag>ps.Pokers[0].Flag{\n\t\t\t\t\tpr.IsWin=false\n\t\t\t\t\treturn\n\t\t\t\t}\n\t\t\t\tif ps.Pokers[0].Flag<ps.Pokers[0].Flag{\n\t\t\t\t\tpr.IsWin=true\n\t\t\t\t\treturn\n\t\t\t\t}\n\t\t\t\tif ps.Pokers[0].Flag==ps.Pokers[0].Flag{\n\t\t\t\t\t//比较花色\n\t\t\t\t\tif ps.Pokers[0].Type>pr.Pokers[0].Type{\n\t\t\t\t\t\tpr.IsWin=false\n\n\t\t\t\t\t}else{\n\t\t\t\t\t\tpr.IsWin=true\n\t\t\t\t\t}\n\t\t\t\t\treturn\n\t\t\t\t}\n\n\n\t\t\t}\n\t\t\t//比较花色\n\t\t\tif ps.Pokers[0].Type>pr.Pokers[0].Type{\n\t\t\t\tpr.IsWin=false\n\t\t\t\treturn\n\t\t\t}else {\n\t\t\t\tpr.IsWin=true\n\t\t\t\treturn\n\t\t\t}\n\t\t}\n\n\t}\n\n\n\n\n\treturn\n\n}", "title": "" }, { "docid": "9b3734bcd4eabb53199a189732c24d6f", "score": "0.4638269", "text": "func (mg *Movegen) HasLegalMove(position *position.Position) bool {\n\n\tus := position.NextPlayer()\n\tusBb := position.OccupiedBb(us)\n\n\t// KING\n\t// We do not need to check castling as possible castling implies King or Rook moves\n\tkingSquare := position.KingSquare(us)\n\ttmpMoves := GetAttacksBb(King, kingSquare, BbZero) &^ usBb\n\tfor tmpMoves != 0 {\n\t\ttoSquare := tmpMoves.PopLsb()\n\t\tif position.IsLegalMove(CreateMove(kingSquare, toSquare, Normal, PtNone)) {\n\t\t\treturn true\n\t\t}\n\t}\n\n\tmyPawns := position.PiecesBb(us, Pawn)\n\toccupiedBb := position.OccupiedAll()\n\topponentBb := position.OccupiedBb(us.Flip())\n\n\t// PAWN\n\t// pawns - check step one to unoccupied squares\n\ttmpMoves = ShiftBitboard(myPawns, us.MoveDirection()) & ^position.OccupiedAll()\n\t// pawns double - check step two to unoccupied squares\n\ttmpMovesDouble := ShiftBitboard(tmpMoves&us.PawnDoubleRank(), us.MoveDirection()) & ^position.OccupiedAll()\n\t// double pawn steps\n\tfor tmpMovesDouble != 0 {\n\t\ttoSquare := tmpMovesDouble.PopLsb()\n\t\tfromSquare := toSquare.To(us.Flip().MoveDirection()).To(us.Flip().MoveDirection())\n\t\tif position.IsLegalMove(CreateMove(fromSquare, toSquare, Normal, PtNone)) {\n\t\t\treturn true\n\t\t}\n\t}\n\t// normal single pawn steps\n\ttmpMoves &= ^us.PromotionRankBb()\n\tfor tmpMoves != 0 {\n\t\ttoSquare := tmpMoves.PopLsb()\n\t\tfromSquare := toSquare.To(us.Flip().MoveDirection())\n\t\tif position.IsLegalMove(CreateMove(fromSquare, toSquare, Normal, PtNone)) {\n\t\t\treturn true\n\t\t}\n\t}\n\n\t// normal pawn captures to the west (includes promotions)\n\ttmpMoves = ShiftBitboard(myPawns, us.MoveDirection()+West) & opponentBb\n\tfor tmpMoves != 0 {\n\t\ttoSquare := tmpMoves.PopLsb()\n\t\tfromSquare := toSquare.To(us.Flip().MoveDirection() + East)\n\t\tif position.IsLegalMove(CreateMove(fromSquare, toSquare, Normal, PtNone)) {\n\t\t\treturn true\n\t\t}\n\t}\n\n\t// normal pawn captures to the east - promotions first\n\ttmpMoves = ShiftBitboard(myPawns, us.MoveDirection()+East) & opponentBb\n\tfor tmpMoves != 0 {\n\t\ttoSquare := tmpMoves.PopLsb()\n\t\tfromSquare := toSquare.To(us.Flip().MoveDirection() + West)\n\t\tif position.IsLegalMove(CreateMove(fromSquare, toSquare, Normal, PtNone)) {\n\t\t\treturn true\n\t\t}\n\t}\n\n\t// OFFICERS\n\tfor pt := Knight; pt <= Queen; pt++ {\n\t\tpieces := position.PiecesBb(us, pt)\n\t\tfor pieces != 0 {\n\t\t\tfromSquare := pieces.PopLsb()\n\t\t\tmoves := GetAttacksBb(pt, fromSquare, occupiedBb)\n\t\t\tfor moves != 0 {\n\t\t\t\ttoSquare := moves.PopLsb()\n\t\t\t\tif position.IsLegalMove(CreateMove(fromSquare, toSquare, Normal, PtNone)) {\n\t\t\t\t\treturn true\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\n\t// en passant captures\n\tenPassantSquare := position.GetEnPassantSquare()\n\tif enPassantSquare != SqNone {\n\t\t// left\n\t\ttmpMoves = ShiftBitboard(enPassantSquare.Bb(), us.Flip().MoveDirection()+West) & myPawns\n\t\tif tmpMoves != 0 {\n\t\t\tfromSquare := tmpMoves.PopLsb()\n\t\t\tif position.IsLegalMove(CreateMove(fromSquare, fromSquare.To(us.MoveDirection()+East), EnPassant, PtNone)) {\n\t\t\t\treturn true\n\t\t\t}\n\t\t}\n\t\t// right\n\t\ttmpMoves = ShiftBitboard(enPassantSquare.Bb(), us.Flip().MoveDirection()+East) & myPawns\n\t\tif tmpMoves != 0 {\n\t\t\tfromSquare := tmpMoves.PopLsb()\n\t\t\tif position.IsLegalMove(CreateMove(fromSquare, fromSquare.To(us.MoveDirection()+West), EnPassant, PtNone)) {\n\t\t\t\treturn true\n\t\t\t}\n\t\t}\n\t}\n\n\t// no move found\n\treturn false\n}", "title": "" }, { "docid": "77b044df801d7630f442f57446df0dfd", "score": "0.4628659", "text": "func sendMoney(client *Client, from *util.KeyPair, to *util.KeyPair, amount uint64) {\n\taccount := client.GetAccount(from.PublicKey().String())\n\tif account == nil || account.Balance < amount {\n\t\tlog.Fatalf(\"%s did not have enough money\", from.PublicKey().String())\n\t}\n\tseq := account.Sequence + 1\n\ttransaction := &currency.Transaction{\n\t\tFrom: from.PublicKey().String(),\n\t\tSequence: account.Sequence + 1,\n\t\tTo: to.PublicKey().String(),\n\t\tAmount: amount,\n\t\tFee: 0,\n\t}\n\tst := transaction.SignWith(from)\n\ttm := currency.NewTransactionMessage(st)\n\tsm := util.NewSignedMessage(from, tm)\n\tclient.SendMessage(sm)\n\tclient.WaitToClear(from.PublicKey().String(), seq)\n}", "title": "" }, { "docid": "5735dc83c4cced5484d0826eff3f483c", "score": "0.46239147", "text": "func (c *ChessGame) PlayerAccepts(player *User) (GameStarts bool) {\n\tGameStarts = false\n\tif player == c.WhitePlayer {\n\t\tc.WhiteAccept = true\n\t} else if player == c.BlackPlayer {\n\t\tc.BlackAccept = true\n\t}\n\tif c.WhiteAccept && c.BlackAccept {\n\t\tGameStarts = true\n\t\tc.BeginGame()\n\t}\n\treturn\n}", "title": "" }, { "docid": "54cdf487bb0a52c824aa5aafb00278e5", "score": "0.46198574", "text": "func (e Player) LeaderAlgo(alfa int, beta int, resultStr *r.ResultStrings) int {\n\tvar Leader = DefaultLeader\n\t//Limit the algorithm run time\n\tfor i := 0; i < NumberOfRounds; i++ {\n\t\ttime.Sleep(1 * time.Second)\n\t\t//Check if receive a message from another player\n\t\tfor _, element := range e.otherPlayersChannels {\n\t\t\tstarts := e.ch.GetStartMsg()\n\t\t\talives := e.ch.GetAliveMsg()\n\t\t\tif ((starts[element.GetID()]) > 0) || ((alives[element.GetID()]) > 0) {\n\t\t\t\te.ch.InitialMessages(element.GetID())\n\t\t\t\t//Get the round of the sender\n\t\t\t\totherRound := element.GetRound()\n\t\t\t\tcurrentRound := e.ch.GetRound()\n\t\t\t\t//Check which round is bigger\n\t\t\t\tif currentRound > otherRound {\n\t\t\t\t\t//Send \"START\" message if my round is bigger than sender round\n\t\t\t\t\te.sendMessage(element, StartMsg)\n\t\t\t\t\t// Add message to the result object\n\t\t\t\t\tresultStr.AddMessage(fmt.Sprintf(\"%s,%s,%s\", strconv.Itoa(e.GetNumber()), strconv.Itoa(element.GetID()), StartMsg))\n\t\t\t\t} else {\n\t\t\t\t\tif currentRound < otherRound {\n\t\t\t\t\t\t//Start the bigger round in case the sender round is bigger than mine\n\t\t\t\t\t\te.startRound(otherRound, e.GetNumberOfNodes(), resultStr)\n\t\t\t\t\t\t//Update the round variables\n\t\t\t\t\t\te.ch.SetRound(otherRound)\n\t\t\t\t\t\tcurrentRound = e.ch.GetRound()\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\t//Case of crash\n\t\tif alfa < i && beta > 0 {\n\t\t\t//decrease the number of players-nodes\n\t\t\te.SetNumberOfNodes(e.GetNumberOfNodes() - 1)\n\t\t\t//Check the leader before the crashing\n\t\t\tif e.GetNumber() != (e.ch.GetRound() % (e.GetNumberOfNodes() + 1)) {\n\t\t\t\t//Start the next round after leader fail\n\t\t\t\te.startRound(e.ch.GetRound()+1, e.GetNumberOfNodes(), resultStr)\n\t\t\t\t//Update the round variable\n\t\t\t\te.ch.SetRound(e.ch.GetRound() + 1)\n\t\t\t} else {\n\t\t\t\t//Case I'am the leader that crashed\n\t\t\t\treturn DefaultLeader\n\t\t\t}\n\t\t}\n\t\t//Case I'am the leader- send \"ALIVE\" message to all the players\n\t\tif e.GetNumber() == (e.ch.GetRound() % e.GetNumberOfNodes()) {\n\t\t\te.SendMessagesToAllPlayers(AliveMsg, resultStr)\n\t\t}\n\t\t//Update the current leader\n\t\tLeader = (e.ch.GetRound() % e.GetNumberOfNodes())\n\t}\n\treturn Leader\n}", "title": "" }, { "docid": "5f5dc984be4c2b5866efc5fc35348779", "score": "0.4609887", "text": "func PRNGEntropyKick() {\n\tfor _, prng := range prngPool {\n\t\tprng.QuickReseedKick()\n\t}\n}", "title": "" }, { "docid": "bc74b93b55d22e4881419a778718f099", "score": "0.4608082", "text": "func IsParticipantsTooFew(err error) bool {\n\treturn errors.Is(err, typedErrChecker{t: ErrParticipantsTooFew})\n}", "title": "" }, { "docid": "a7eb1ce266cac3df8e0850904697ed75", "score": "0.46076462", "text": "func howManyGames(p int32, d int32, m int32, s int32) int32 {\n // Return the number of games you can buy\n var buy int32 = 0\n if s < p {\n return 0\n }\n var remain int32 = s\n var price int32 = p\n for ; remain >= price; {\n if remain >= price {\n buy++\n remain -= price\n }\n if price > m {\n price -= d\n }\n if price < m {\n price = m\n }\n }\n return buy\n}", "title": "" }, { "docid": "b0d5fef7e1c3e2d2112cafc6209032c0", "score": "0.46068996", "text": "func (t *Team) TestSkipAllowed(cipher *CipherConfig, status CipherStatus) (bool, string, time.Time) {\n\td := t.Now().Sub(status.Arrival)\n\tif d < t.gameConfig.SkipLimit {\n\t\treturn false, fmt.Sprintf(\"Zatím uběhlo jen %v od příchodu na šifru, přeskočení je dostupné až po %v od příchodu\", d.Round(time.Second), t.gameConfig.SkipLimit), status.Arrival.Add(t.gameConfig.SkipLimit)\n\t}\n\treturn true, \"\", time.Time{}\n}", "title": "" }, { "docid": "5bb80f0b280db17b21c4026cb3c65520", "score": "0.46036056", "text": "func (w *Watcher) failUpdate(usernameOrID string) {\n\ttimeout := time.After(10 * time.Minute)\n\t<-timeout\n\tw.UpdateUser(usernameOrID)\n}", "title": "" }, { "docid": "8ba22f666d4d6b394ee73542b9dc3f41", "score": "0.4603281", "text": "func (self SendStats) RateError() float64 {\n return self.CalcRate() / float64(self.Config.Rate)\n}", "title": "" }, { "docid": "6ce9e8336969246eb1de7cc071759051", "score": "0.45975047", "text": "func getWinner() int {\n\taliveCount := 0\n\tpotentialWinner := 0\n\tfor i, p := range gameState.Players {\n\t\tif !p.Dead && p.Spawned {\n\t\t\taliveCount++\n\t\t\tpotentialWinner = i\n\t\t}\n\t}\n\tif aliveCount == 1 {\n\t\treturn potentialWinner\n\t}\n\treturn -1\n}", "title": "" } ]
aee1501254228d18113aa57e3cbbbfb6
UpByOne migrates up by a single version.
[ { "docid": "ea9a6fc7fde47d2c97a463dc42fe14b7", "score": "0.7799894", "text": "func UpByOne(db *sql.DB, dir string, opts ...OptionsFunc) error {\n\tctx := context.Background()\n\treturn UpByOneContext(ctx, db, dir, opts...)\n}", "title": "" } ]
[ { "docid": "d4116192a4d5e8d3a49e7c2f1af08ab4", "score": "0.8605583", "text": "func (ms Migrations) UpByOne(db *sql.DB) error {\n\tcurrentVersion, err := GetDBVersion(db)\n\tif err != nil {\n\t\treturn err\n\t}\n\n\tnext, err := ms.Next(currentVersion)\n\tif err != nil {\n\t\tif err == ErrNoNextVersion {\n\t\t\tlog.Printf(\"goose: no migrations to run. current version: %d\\n\", currentVersion)\n\t\t}\n\n\t\treturn err\n\t}\n\n\treturn next.Up(db)\n}", "title": "" }, { "docid": "690f882f7b24d577f48d4d59f36f4a8f", "score": "0.8554379", "text": "func UpByOne(db *sql.DB, dir string) error {\n\tmigrations, err := CollectMigrations(dir, minVersion, maxVersion)\n\tif err != nil {\n\t\treturn err\n\t}\n\n\treturn migrations.UpByOne(db)\n}", "title": "" }, { "docid": "354656f1c4f43b84a9dd267a4d299314", "score": "0.85383534", "text": "func UpByOne(ctx context.Context, db *sql.DB, dir string) error {\n\tmigrations, err := CollectMigrations(dir, minVersion, maxVersion)\n\tif err != nil {\n\t\treturn err\n\t}\n\n\tcurrentVersion, err := GetDBVersion(db)\n\tif err != nil {\n\t\treturn err\n\t}\n\n\tnext, err := migrations.Next(currentVersion)\n\tif err != nil {\n\t\tif err == ErrNoNextVersion {\n\t\t\tlog.Printf(\"goose: no migrations to run. current version: %d\\n\", currentVersion)\n\t\t\treturn nil\n\t\t}\n\t\treturn err\n\t}\n\n\tif err = next.Up(ctx, db); err != nil {\n\t\treturn err\n\t}\n\n\treturn nil\n}", "title": "" }, { "docid": "8fdec13d530686c3d2768d52cea1e59e", "score": "0.73768663", "text": "func (ms Migrations) Up(db *sql.DB) error {\n\tfor {\n\t\terr := ms.UpByOne(db)\n\n\t\tswitch {\n\t\tcase err == nil:\n\t\tcase err == ErrNoNextVersion:\n\t\t\treturn nil\n\t\tdefault:\n\t\t\treturn err\n\t\t}\n\t}\n}", "title": "" }, { "docid": "9101945b57ec6d4097b3e7dc2076ad35", "score": "0.6954473", "text": "func UpByOneContext(ctx context.Context, db *sql.DB, dir string, opts ...OptionsFunc) error {\n\topts = append(opts, withApplyUpByOne())\n\treturn UpToContext(ctx, db, dir, maxVersion, opts...)\n}", "title": "" }, { "docid": "5ef709688cd56ab94e79ea2bb5abd56f", "score": "0.6785975", "text": "func UpTo(ctx context.Context, db *sql.DB, dir string, version int64) error {\n\tmigrations, err := CollectMigrations(dir, minVersion, version)\n\tif err != nil {\n\t\treturn err\n\t}\n\n\tfor {\n\t\tcurrent, err := GetDBVersion(db)\n\t\tif err != nil {\n\t\t\treturn err\n\t\t}\n\n\t\tnext, err := migrations.Next(current)\n\t\tif err != nil {\n\t\t\tif err == ErrNoNextVersion {\n\t\t\t\tlog.Printf(\"goose: no migrations to run. current version: %d\\n\", current)\n\t\t\t\treturn nil\n\t\t\t}\n\t\t\treturn err\n\t\t}\n\n\t\tif err = next.Up(ctx, db); err != nil {\n\t\t\treturn err\n\t\t}\n\t}\n}", "title": "" }, { "docid": "a008cda7c48563c3ffba855eb3e8b116", "score": "0.655751", "text": "func MigrateUp(logger *zap.SugaredLogger, db *sqlx.DB, path string) error {\n\tdriver, err := postgres.WithInstance(db.DB, &postgres.Config{})\n\tm, err := migrate.NewWithDatabaseInstance(path, \"postgres\", driver)\n\tif err != nil {\n\t\treturn fmt.Errorf(\"migrate NewWithDatabaseInstance: %w\", err)\n\t}\n\n\terr = m.Up()\n\tif err != nil && err != migrate.ErrNoChange {\n\t\treturn fmt.Errorf(\"migrate Up: %w\", err)\n\t}\n\n\tversion, dirty, err := m.Version()\n\tif err != nil && err != migrate.ErrNoChange {\n\t\treturn fmt.Errorf(\"migrate version: %w\", err)\n\t}\n\tlogger.With(\"version\", version, \"dirty\", dirty).Info(\"Migrations applied\")\n\n\treturn nil\n}", "title": "" }, { "docid": "eb427318c3b6220efde2bdd0bf75a431", "score": "0.654006", "text": "func UpTo(db *sql.DB, dir string, version int64) error {\n\tmigrations, err := CollectMigrations(dir, minVersion, version)\n\tif err != nil {\n\t\treturn err\n\t}\n\n\treturn migrations.Up(db)\n}", "title": "" }, { "docid": "f090eb3a05b8a806ab2003261e75ac2d", "score": "0.64856005", "text": "func (m MigrationStore) MigrationUp() error {\n\terr := goose.Up(m.db, m.dirMigration)\n\tif err != nil {\n\t\treturn err\n\t}\n\treturn goose.Status(m.db, m.dirMigration)\n}", "title": "" }, { "docid": "0352378794b7c7483e7558af403dfbe1", "score": "0.6477061", "text": "func (link *Link) MigrateUp(exec sqlx.Execer) (errExec error) {\n\t_, errExec = exec.Exec(\n\t\t`\n CREATE TABLE IF NOT EXISTS entityone (\n entityone_id BIGSERIAL NOT NULL,\n time_created DATE NOT NULL DEFAULT CURRENT_DATE,\n PRIMARY KEY (entityone_id)\n )\n `)\n\tif errExec != nil {\n\t\treturn errExec\n\t}\n\n\t_, errExec = exec.Exec(\n\t\t`\n CREATE TABLE IF NOT EXISTS entityone_status (\n entityone_id BIGSERIAL NOT NULL,\n action_id BIGINT NOT NULL DEFAULT 1,\n status_id INT NOT NULL DEFAULT 1,\n time_created DATE NOT NULL DEFAULT CURRENT_DATE,\n is_latest INT NULL DEFAULT 1,\n UNIQUE (is_latest, entityone_id),\n INDEX (status_id, is_latest),\n CONSTRAINT es_fk_e\n FOREIGN KEY (entityone_id)\n REFERENCES entityone (entityone_id),\n INDEX (entityone_id)\n )\n `)\n\treturn errExec\n}", "title": "" }, { "docid": "c0a9d257e45bf2f4476413c798752578", "score": "0.647521", "text": "func Up(ctx context.Context, db *sql.DB, dir string) error {\n\treturn UpTo(ctx, db, dir, maxVersion)\n}", "title": "" }, { "docid": "996c6fc99b39a193c93942f389148848", "score": "0.6445165", "text": "func Up(ctx context.Context, logger *zap.Logger, store kv.SchemaStore) error {\n\tmigrator, err := migration.NewMigrator(logger, store, Migrations[:]...)\n\tif err != nil {\n\t\treturn err\n\t}\n\n\treturn migrator.Up(ctx)\n}", "title": "" }, { "docid": "51b9d50051f029590bcd132e6e3abc8d", "score": "0.6372567", "text": "func upToNoVersioning(ctx context.Context, db *sql.DB, migrations Migrations, version int64) error {\n\tvar finalVersion int64\n\tfor _, current := range migrations {\n\t\tif current.Version > version {\n\t\t\tbreak\n\t\t}\n\t\tcurrent.noVersioning = true\n\t\tif err := current.UpContext(ctx, db); err != nil {\n\t\t\treturn err\n\t\t}\n\t\tfinalVersion = current.Version\n\t}\n\tlog.Printf(\"goose: up to current file version: %d\\n\", finalVersion)\n\treturn nil\n}", "title": "" }, { "docid": "34583e15f20071c88e228be5211b7d45", "score": "0.63606626", "text": "func (m *Migration) Up(ctx context.Context, store kv.SchemaStore) error {\n\treturn m.up(ctx, store)\n}", "title": "" }, { "docid": "968bc74b255f3f7fa8bef99ef5d15041", "score": "0.627116", "text": "func Up(db *sql.DB, dir string) error {\n\treturn UpTo(db, dir, maxVersion)\n}", "title": "" }, { "docid": "a3830c88eccb6dee780b0ac4937dc0e4", "score": "0.6267091", "text": "func (m *DescriptorMigration) Up(tx *sql.Tx) error {\n\treturn m.up(tx)\n}", "title": "" }, { "docid": "0169c2e7f63d17d3d8e39fb04d11758b", "score": "0.6252136", "text": "func UpTo(db *sql.DB, dir string, version int64, opts ...OptionsFunc) error {\n\tctx := context.Background()\n\treturn UpToContext(ctx, db, dir, version, opts...)\n}", "title": "" }, { "docid": "f1e4dd0ae55896f14031852541398b1a", "score": "0.61267066", "text": "func UpOnlyMigration(name string, up MigrationFunc) *Migration {\n\treturn &Migration{name, up, noopMigration}\n}", "title": "" }, { "docid": "aa77413d059dcffc2796615d3539808e", "score": "0.61206836", "text": "func Up() (id string, err error) {\n\tif len(sourceMigrations) == len(existMigrations) {\n\t\treturn \"\", nil\n\t}\n\n\tm := sourceMigrations[len(existMigrations)]\n\n\tcontent, err := src.Read(m.ID, m.Type)\n\tif err != nil {\n\t\treturn\n\t}\n\n\tswitch m.Type {\n\tcase constants.RecordSQL:\n\t\terr = mysqlSrv.Up(content)\n\t\tif err != nil {\n\t\t\treturn\n\t\t}\n\tcase constants.RecordRedis:\n\t\terr = redisSrv.Up(content)\n\t\tif err != nil {\n\t\t\treturn\n\t\t}\n\tdefault:\n\t\treturn \"\", constants.ErrMigrationNotSupported\n\t}\n\n\terr = rec.Write(m.ID, m.Type)\n\tif err != nil {\n\t\treturn\n\t}\n\n\tid = m.ID\n\treturn\n}", "title": "" }, { "docid": "eaf164ccabfa25e52202229b522b85a8", "score": "0.6079505", "text": "func (m *migrate) MigrateUp() error {\n\tm.printf(\"Migrating UP...\\n\")\n\treturn m.migrate(UP)\n}", "title": "" }, { "docid": "db66623ad9348aaa91c00a7139d32cd4", "score": "0.6050984", "text": "func (m *Migration) Up() {\n\tswitch m.ModifyType {\n\tcase \"reverse\":\n\t\tm.ModifyType = \"alter\"\n\tcase \"delete\":\n\t\tm.ModifyType = \"create\"\n\t}\n\tm.sqls = append(m.sqls, m.GetSQL())\n}", "title": "" }, { "docid": "7160a0dc9d726b23c9e92feaca9fec31", "score": "0.60361326", "text": "func UpMigration(m *migrate.Migrate, limit int) error {\n\tif limit > 0 {\n\t\treturn m.Steps(limit)\n\t}\n\n\treturn m.Up()\n}", "title": "" }, { "docid": "0f88b70977d1fd5b06e3261a4978764a", "score": "0.596397", "text": "func (m Migrator) Up(pipe chan interface{}) {\n\td, files, version, err := m.initDriverAndReadMigrationFilesAndGetVersion()\n\tif err != nil {\n\t\tgo pipep.Close(pipe, err)\n\t\treturn\n\t}\n\n\tapplyMigrationFiles, err := files.ToLastFrom(version)\n\tif err != nil {\n\t\tif err2 := d.Close(); err2 != nil {\n\t\t\tpipe <- err2\n\t\t}\n\t\tgo pipep.Close(pipe, err)\n\t\treturn\n\t}\n\n\tif len(applyMigrationFiles) > 0 {\n\t\tfor _, f := range applyMigrationFiles {\n\t\t\tpipe1 := pipep.New()\n\t\t\tgo d.Migrate(m.Id, f, pipe1)\n\t\t\tif ok := pipep.WaitAndRedirect(pipe1, pipe, handleInterrupts()); !ok {\n\t\t\t\tbreak\n\t\t\t}\n\t\t}\n\t\tif err := d.Close(); err != nil {\n\t\t\tpipe <- err\n\t\t}\n\t\tgo pipep.Close(pipe, nil)\n\t\treturn\n\t} else {\n\t\tif err := d.Close(); err != nil {\n\t\t\tpipe <- err\n\t\t}\n\t\tgo pipep.Close(pipe, nil)\n\t\treturn\n\t}\n}", "title": "" }, { "docid": "735ded4049c2eb73ef097ef9c014617e", "score": "0.58658355", "text": "func Up(c *core.Config) error {\n\n\t// driver\n\tdriver := core.GetDriver(c.Driver())\n\tif err := driver.Open(c.Dsn()); err != nil {\n\t\treturn err\n\t}\n\n\t// current version\n\tcurrent, err := driver.Version().Current()\n\tif err != nil {\n\t\treturn err\n\t}\n\n\t// create a service\n\tsvc := core.NewService(c).\n\t\tWithVersion(current).\n\t\tWithDriver(driver)\n\n\treturn driver.Transaction(func(tx *sql.Tx) error {\n\t\t// Up migrations\n\t\treturn svc.Up()\n\t})\n}", "title": "" }, { "docid": "07f79ea58f1066f6b4caa1b2b707b96a", "score": "0.58366156", "text": "func UpsertOne(query, update interface{}) (*adb.ChangeInfo, error) {\n\treturn db.Upsert(Collection, query, update)\n}", "title": "" }, { "docid": "fa567b97c88f56557afd56d6f547517d", "score": "0.5823394", "text": "func (c *Connection) MigrateUp() {\n\tmigrations := &migrate.PackrMigrationSource{\n\t\tBox: packr.New(\"migrations\", \"./migrations\"),\n\t\tDir: \".\",\n\t}\n\tn, err := migrate.Exec(c.DB.DB, c.dialect, migrations, migrate.Up)\n\tif err != nil {\n\t\tc.logger.Log().Panicf(\"failed to migrate the database up: %v\", err)\n\t}\n\tc.logger.WithFields(logrus.Fields{\"migrations_number\": n}).Info(\"migrated the database up\")\n}", "title": "" }, { "docid": "58449f43ff1b5f54a3cbc30620c9c233", "score": "0.58228403", "text": "func (m *Migrator) Up(ctx context.Context, pipe chan interface{}, conn driver.Conn) {\n\tprevFiles, files, err := m.init(ctx, conn, true)\n\tif err != nil {\n\t\tgo pipep.Close(pipe, err)\n\t\treturn\n\t}\n\tm.up(ctx, pipe, conn, prevFiles, files, prevFiles.LastVersion())\n}", "title": "" }, { "docid": "ab0a977a888ae856049f44b9f15005b4", "score": "0.5678335", "text": "func ExampleUp() {\n\tadapter := migrate.NewPostgreSQLAdapter(log.Printf)\n\tdb, err := sql.Open(\"migrate_test\", \"\")\n\tif err != nil {\n\t\tlog.Panic(err)\n\t}\n\n\tmigrations := []migrate.Migration{\n\t\t{\n\t\t\tComment: \"Add user and app tables\",\n\t\t\tUp: migrate.ExecQueries([]string{\n\t\t\t\t`CREATE TABLE users (\n\t\t\t\t\tid SERIAL PRIMARY KEY,\n\t\t\t\t\tusername VARCHAR(50) NOT NULL)`,\n\t\t\t\t`CREATE TABLE apps (\n\t\t\t\t\tid SERIAL PRIMARY KEY,\n\t\t\t\t\ttitle VARCHAR(100) NOT NULL)`,\n\t\t\t}),\n\t\t\tDown: migrate.ExecQueries([]string{\n\t\t\t\t`DROP TABLE apps`,\n\t\t\t\t`DROP TABLE users`,\n\t\t\t}),\n\t\t},\n\t\t{\n\t\t\tComment: \"Add user app join table\",\n\t\t\tUp: migrate.ExecQueries([]string{\n\t\t\t\t`CREATE TABLE user_apps (\n\t\t\t\t\tuser_id INT NOT NULL REFERENCES users(id),\n\t\t\t\t\tapp_id INT NOT NULL REFERENCES apps(id),\n\t\t\t\t\tUNIQUE (user_id, app_id))`,\n\t\t\t}),\n\t\t\tDown: migrate.ExecQueries([]string{\n\t\t\t\t`DROP TABLE user_apps`,\n\t\t\t}),\n\t\t},\n\t}\n\n\terr = migrate.Up(context.Background(), db, adapter, migrations)\n\tif err != nil {\n\t\tlog.Panicf(\"error running migrations: %s\", err)\n\t}\n}", "title": "" }, { "docid": "6ba04989fa7984bb8211222b8075818b", "score": "0.5674175", "text": "func (m *committedAtMigrator) Up(ctx context.Context) (err error) {\n\ttx, err := m.store.Transact(ctx)\n\tdefer func() {\n\t\terr = tx.Done(err)\n\t}()\n\n\tbatch, err := dbstore.ScanSourcedCommits(tx.Query(ctx, sqlf.Sprintf(committedAtSelectUpQuery, m.batchSize)))\n\tif err != nil {\n\t\treturn err\n\t}\n\n\tfor _, sourcedCommits := range batch {\n\t\tif err := m.handleSourcedCommits(ctx, tx, sourcedCommits); err != nil {\n\t\t\treturn err\n\t\t}\n\t}\n\n\treturn nil\n}", "title": "" }, { "docid": "b7d6f89ac1ce87fdb9a60d53cd1f7550", "score": "0.5670987", "text": "func (dbMigrate *DBMigrate) ApplyOne() error {\n\treturn dbMigrate.apply(false)\n}", "title": "" }, { "docid": "e5631d72c0141e66686eea89ccf8215a", "score": "0.56579554", "text": "func (c *Connection) MigrateUp() error {\n\tm, err := c.migrationSource()\n\tif err != nil {\n\t\treturn err\n\t}\n\t_, err = migrate.Exec(c.DB, \"mysql\", m, migrate.Up)\n\treturn err\n}", "title": "" }, { "docid": "74eaab1723c8f12685637e900bd895d1", "score": "0.56401795", "text": "func (dm *DjangoMigration) Upsert(db XODB) error {\n\tvar err error\n\n\t// if already exist, bail\n\tif dm._exists {\n\t\treturn errors.New(\"insert failed: already exists\")\n\t}\n\n\t// sql query\n\tconst sqlstr = `INSERT INTO public.django_migrations (` +\n\t\t`id, app, name, applied` +\n\t\t`) VALUES (` +\n\t\t`$1, $2, $3, $4` +\n\t\t`) ON CONFLICT (id) DO UPDATE SET (` +\n\t\t`id, app, name, applied` +\n\t\t`) = (` +\n\t\t`EXCLUDED.id, EXCLUDED.app, EXCLUDED.name, EXCLUDED.applied` +\n\t\t`)`\n\n\t// run query\n\tXOLog(sqlstr, dm.ID, dm.App, dm.Name, dm.Applied)\n\t_, err = db.Exec(sqlstr, dm.ID, dm.App, dm.Name, dm.Applied)\n\tif err != nil {\n\t\treturn err\n\t}\n\n\t// set existence\n\tdm._exists = true\n\n\treturn nil\n}", "title": "" }, { "docid": "a26f38835d9486300dbe246a144b43e9", "score": "0.56359875", "text": "func (m *Migrate) UpToLatest() error {\n\terr := m.loadMigrations()\n\tif err != nil {\n\t\treturn errors.New(\"can't load migrations \" + err.Error())\n\t}\n\n\tverStrs, err := m.c.LoadVersions()\n\tif err != nil {\n\t\treturn err\n\t}\n\n\tappliedVers, err := StringsToVersions(verStrs)\n\tif err != nil {\n\t\treturn err\n\t}\n\n\tlastVer := GreatestVersion(appliedVers)\n\n\tm.ensureThatMigrationsNotLost(lastVer, appliedVers)\n\n\tmigrationsToApply := m.migrationsAfter(lastVer)\n\tfmt.Printf(\"Going to apply %d migration(s)...\\n\", len(migrationsToApply))\n\n\tfor _, migration := range migrationsToApply {\n\t\tfmt.Printf(\"Applying '%s' migration... \\n\", migration.Version())\n\t\tstart := time.Now()\n\n\t\tmigration.SetConnection(m.c)\n\t\terr := migration.Up()\n\t\tif err != nil {\n\t\t\treturn err\n\t\t}\n\n\t\terr = m.c.SetVersion(migration.Version().String())\n\t\tif err != nil {\n\t\t\treturn err\n\t\t}\n\n\t\tfmt.Printf(\"Applied '%s'! Duration: %v.\\n\\n\", migration.Version(), time.Since(start))\n\t}\n\n\tfmt.Println(\"Database up to date!\")\n\n\tm.migrations = []Migration{}\n\n\treturn nil\n}", "title": "" }, { "docid": "5db501f9dc275a40e2652459dab73d7c", "score": "0.5598762", "text": "func (p Posit16) Up() Posit32 {\n\treturn Posit32{impl: p.impl.Up()}\n}", "title": "" }, { "docid": "2b30fbe4a6bb34037ab83fd09c076d7b", "score": "0.5595294", "text": "func (apt *AptPackageManager) UpgradeOne(packageName string) (err error) {\n\tif err = command.ExecuteCommand(execCommand(apt.Path, \"upgrade\", packageName)); err != nil {\n\t\treturn fmt.Errorf(\"Cannot %s upgrade: %s\", apt.Name, err)\n\t}\n\treturn err\n}", "title": "" }, { "docid": "7d2bfc22dfc8bdad20d2bf36bec46f80", "score": "0.5576346", "text": "func (c *Connection) MigrateUp(path string) error {\n\twarningMsg := \"Connection#MigrateUp is deprecated, and will be removed in a future version. Use FileMigrator#Up instead.\"\n\t_, file, no, ok := runtime.Caller(1)\n\tif ok {\n\t\twarningMsg = fmt.Sprintf(\"%s Called from %s:%d\", warningMsg, file, no)\n\t}\n\tlog.Println(warningMsg)\n\n\tmig, err := NewFileMigrator(path, c)\n\tif err != nil {\n\t\treturn errors.WithStack(err)\n\t}\n\treturn mig.Up()\n}", "title": "" }, { "docid": "9a08a7fecf331b1a65c79b3520005556", "score": "0.5508921", "text": "func Upversion(step, current string) (string, error) {\n\tif err := validateStep(step); err != nil {\n\t\treturn \"\", err\n\t}\n\tprefix := \"\"\n\tif len(current) > 0 && current[0] == 'v' {\n\t\tprefix = \"v\"\n\t\tcurrent = current[1:]\n\t}\n\tmajor, minor, patch, err := validateAndParseSemver(current)\n\tif err != nil {\n\t\treturn \"\", err\n\t}\n\n\tif step == semverMajor {\n\t\tmajor++\n\t\tminor = 0\n\t\tpatch = 0\n\t}\n\tif step == semverMinor {\n\t\tminor++\n\t\tpatch = 0\n\t}\n\tif step == semverPatch {\n\t\tpatch++\n\t}\n\treturn fmt.Sprintf(\"%s%d.%d.%d\", prefix, major, minor, patch), nil\n}", "title": "" }, { "docid": "b13f08fb6ff76bc845ab85119da49968", "score": "0.5503708", "text": "func (p *SQLProvider) SchemaMigrationsUp(ctx context.Context, version int) (migrations []model.SchemaMigration, err error) {\n\tcurrent, err := p.SchemaVersion(ctx)\n\tif err != nil {\n\t\treturn migrations, err\n\t}\n\n\tif version == 0 {\n\t\tversion = SchemaLatest\n\t}\n\n\tif current >= version {\n\t\treturn migrations, ErrNoAvailableMigrations\n\t}\n\n\treturn loadMigrations(p.name, current, version)\n}", "title": "" }, { "docid": "51cbf1630ed471e2b0f1a48a800f7ef7", "score": "0.5500761", "text": "func (s *Service) UpSwitch(c context.Context, arg *model.ArgUpSwitch) (res *model.PBUpSwitch, err error) {\n\terr = s.client.Call(c, _UpSwitch, arg, &res)\n\treturn\n}", "title": "" }, { "docid": "d97aae0d8cae595aa092b174cd020b3b", "score": "0.54969513", "text": "func Up_20131010234732(txn *sql.Tx) {\n\t_, err := txn.Exec(sqlUp)\n\tif err != nil {\n\t\tfmt.Printf(\"error commiting txn: %s\\n\", err.Error())\n\t}\n}", "title": "" }, { "docid": "20137214270dcfba8d763644f9e838b5", "score": "0.5480377", "text": "func (m *DescriptorMigration) UpNoTx(db *sql.DB) error {\n\treturn m.up(db)\n}", "title": "" }, { "docid": "52a151c63520d9152efc3ece53905761", "score": "0.54619104", "text": "func (m *diagnosticsCountMigrator) MigrateRowUp(scanner scanner) (updateSpec, error) {\n\tvar dumpID int\n\tvar path string\n\tvar rawData []byte\n\n\tif err := scanner.Scan(&dumpID, &path, &rawData); err != nil {\n\t\treturn updateSpec{}, err\n\t}\n\n\tdata, err := m.serializer.UnmarshalDocumentData(rawData)\n\tif err != nil {\n\t\treturn updateSpec{}, err\n\t}\n\n\treturn updateSpec{\n\t\tDumpID: dumpID,\n\t\tConditions: map[string]interface{}{\"path\": path},\n\t\tAssignments: map[string]interface{}{\"num_diagnostics\": len(data.Diagnostics)},\n\t}, nil\n}", "title": "" }, { "docid": "76805400f2565e24c04b23f573abcd29", "score": "0.54572046", "text": "func (mock Mock) MigrateUp() error {\n\treturn mock.OnMigrateUp()\n}", "title": "" }, { "docid": "6d3625aad0d40cf80a7f249b7a616d6f", "score": "0.5438765", "text": "func (m *menuMigration) Up(db *gorm.DB) error {\n\tmenu := models.Menu{\n\t\tName: \"Default\",\n\t}\n\n\tif err := db.Create(&menu).Error; err != nil {\n\t\treturn err\n\t}\n\n\treturn nil\n}", "title": "" }, { "docid": "220fdb6e7d04a27f38906d2f4fbd80c6", "score": "0.5422625", "text": "func OptionSetMigrateUp() MongodbOption {\n\treturn func(options *driverOptions) {\n\t\toptions.migrateUp = true\n\t}\n}", "title": "" }, { "docid": "60c96ecf3f0306025d04ef33cee7af93", "score": "0.5388437", "text": "func (p Posit32) Up() Posit64 {\n\treturn Posit64{impl: p.impl.Up()}\n}", "title": "" }, { "docid": "fa4828147ae5193732646fa8d6fe6c14", "score": "0.5374686", "text": "func Up_20130624131437(txn *sql.Tx) {\n\ttxn.Exec(alterTo)\n}", "title": "" }, { "docid": "f605d8996fd58f5a67b43029febd4d1f", "score": "0.5374165", "text": "func Up(db *sql.DB, dir string, opts ...OptionsFunc) error {\n\tctx := context.Background()\n\treturn UpContext(ctx, db, dir, opts...)\n}", "title": "" }, { "docid": "d906b2a1838ec3a7195503e38ff851aa", "score": "0.53666955", "text": "func Up_20130624145943(txn *sql.Tx) {\n\ttxn.Exec(alterTo)\n}", "title": "" }, { "docid": "2e04e7db2cf157ef1f8d57d1007a1d2f", "score": "0.52653295", "text": "func (p Posit8) Up() Posit16 {\n\treturn Posit16{impl: p.impl.Up()}\n}", "title": "" }, { "docid": "b0f308ecff7cc203835c61f258771ab4", "score": "0.5256222", "text": "func (m *DescriptorMigration) up(db dbConn) error {\n\t// Count how many entries we have in jobs table that we need to migrate. Split them into\n\t// shards of size shardSize for migration. Can't be done online within a single transaction,\n\t// as there cannot be two active queries on the same connection at the same time\n\t// (see https://github.com/lib/pq/issues/81)\n\n\tcount := uint64(0)\n\tm.log.Debugf(\"counting the number of jobs to migrate\")\n\tstart := time.Now()\n\trows, err := db.Query(\"select count(*) from jobs\")\n\tif err != nil {\n\t\treturn fmt.Errorf(\"could not fetch number of records to migrate: %w\", err)\n\t}\n\tif !rows.Next() {\n\t\terr := \"could not fetch number of records to migrate, at least one result from count(*) expected\"\n\t\tif rows.Err() == nil {\n\t\t\treturn fmt.Errorf(err)\n\t\t}\n\t\treturn fmt.Errorf(\"%s (err: %w)\", err, rows.Err())\n\t}\n\tif err := rows.Scan(&count); err != nil {\n\t\treturn fmt.Errorf(\"could not fetch number of records to migrate: %w\", err)\n\t}\n\tif err := rows.Close(); err != nil {\n\t\tm.log.Warningf(\"could not close rows after count(*) query\")\n\t}\n\n\t// Create a new plugin registry. This is necessary because some information that need to be\n\t// associated with the extended_descriptor is not available in the db and can only be looked\n\t// up via the TestFetcher.\n\tregistry := pluginregistry.NewPluginRegistry()\n\tplugins.Init(registry, m.log)\n\n\telapsed := time.Since(start)\n\tm.log.Debugf(\"total number of jobs to migrate: %d, fetched in %.3f ms\", count, ms(elapsed))\n\tfor offset := uint64(0); offset < count; offset += shardSize {\n\t\tjobs, err := m.fetchJobs(db, shardSize, offset, m.log)\n\t\tif err != nil {\n\t\t\treturn fmt.Errorf(\"could not fetch events in range offset %d limit %d: %w\", offset, shardSize, err)\n\t\t}\n\t\terr = m.migrateJobs(db, jobs, registry, m.log)\n\t\tif err != nil {\n\t\t\treturn fmt.Errorf(\"could not migrate events in range offset %d limit %d: %w\", offset, shardSize, err)\n\t\t}\n\t\tm.log.Infof(\"migrated %d/%d\", offset, count)\n\t}\n\treturn nil\n}", "title": "" }, { "docid": "235a4f69d083f885b10e2450ff32d07b", "score": "0.5220894", "text": "func (c *K8sDeploymentClient) UpdateOne(kd *K8sDeployment) *K8sDeploymentUpdateOne {\n\tmutation := newK8sDeploymentMutation(c.config, OpUpdateOne, withK8sDeployment(kd))\n\treturn &K8sDeploymentUpdateOne{config: c.config, hooks: c.Hooks(), mutation: mutation}\n}", "title": "" }, { "docid": "29db2c99734f2752e3410b675dd3b337", "score": "0.52019644", "text": "func (cask *CaskPackageManager) UpgradeOne(packageName string) (err error) {\n\tif err = command.ExecuteCommand(execCommand(cask.Path, \"cask\", \"upgrade\")); err != nil {\n\t\treturn fmt.Errorf(\"Cannot %s upgrade %s: %s\", cask.Name, packageName, err)\n\t}\n\treturn err\n}", "title": "" }, { "docid": "3f609798dd8fe4bc5988bff18dab03b4", "score": "0.51969564", "text": "func Up_20131006194217(txn *sql.Tx) {\n\t_, err := txn.Exec(sqlUp)\n\tif err != nil {\n\t\tfmt.Printf(\"error commiting txn: %s\\n\", err.Error())\n\t}\n}", "title": "" }, { "docid": "2cc309e899a80093fd534d50c0b913b5", "score": "0.51926255", "text": "func (s *ServiceDelegator) Up(ctx context.Context, project *types.Project, options UpOptions) error {\n\treturn s.Delegate.Up(ctx, project, options)\n}", "title": "" }, { "docid": "ebaa74037b9e5d1caecf8ede080d76fd", "score": "0.5186944", "text": "func (v *Vote) Up() { v.Mode = 1 }", "title": "" }, { "docid": "e85999dc8e1b7518b3b7c4ef4d4403bb", "score": "0.517695", "text": "func (c *Collection) UpsertOne(ctx context.Context, selector interface{}, update interface{}) (*CollectionUpdateResult, error) {\n\treturn c.updateRecord(ctx, selector, update, true)\n}", "title": "" }, { "docid": "3c4c7e374de2f11fc7255598e3c79159", "score": "0.5170989", "text": "func (t *Interface) Up() error {\n\tpanic(\"tuntap: Not implemented on this platform\")\n}", "title": "" }, { "docid": "3af81226c95b226887e10870833bae82", "score": "0.5152612", "text": "func (s nish) UpUp() string {\n\treturn strings.ToUpper(string(s)) //convert user defined type to string\n}", "title": "" }, { "docid": "fe2deb50ba9bd2d6d4dbddfb9a82732e", "score": "0.51374847", "text": "func Up(po *Options) error {\n\tif po.Provisioner == \"vagrant\" {\n\t\treturn VagrantUp(po)\n\t}\n\treturn fmt.Errorf(\"%s is not a valid provisioner choice\", po.Provisioner)\n}", "title": "" }, { "docid": "353ae6a8431b1f3b55a90af6e8ce723f", "score": "0.51352185", "text": "func UpT20200413233928(db *sql.DB) error {\n\tvar createStmt = fmt.Sprintf(`create table %s (\n\t\tid integer primary key autoincrement,\n\t\tkey text not null,\n\t\tvalue text not null,\n\t\ttype_hint integer not null -- 1 -> int, 2 -> plain str, 3 -> bool, 14 -> csv(int), 24 -> csv(str)\n\t)`, configTableName)\n\t// Add Up Logic Here!\n\tif _, err := db.Exec(createStmt); err != nil {\n\t\treturn err\n\t}\n\n\tvar createIndexStmt = fmt.Sprintf(\"create unique index %s on %s (key)\", keyIndexName, configTableName)\n\tif _, err := db.Exec(createIndexStmt); err != nil {\n\t\treturn err\n\t}\n\treturn nil\n}", "title": "" }, { "docid": "7f7048b4159d54dde8f805491c3aca93", "score": "0.51152074", "text": "func Upvote(ctx context.Context, voter user.User, storyID uuid.UUID) ([]Vote, error) {\n\treturn voteUpdate(ctx, voter, storyID, +1)\n}", "title": "" }, { "docid": "d7e6f8b137ddae64e71c41e2b60f13cb", "score": "0.51084715", "text": "func UpContext(ctx context.Context, db *sql.DB, dir string, opts ...OptionsFunc) error {\n\treturn UpToContext(ctx, db, dir, maxVersion, opts...)\n}", "title": "" }, { "docid": "1d9647c80f88648312e733cfe965ce2e", "score": "0.51011217", "text": "func (c *ImplementClient) UpdateOne(i *Implement) *ImplementUpdateOne {\n\tmutation := newImplementMutation(c.config, OpUpdateOne, withImplement(i))\n\treturn &ImplementUpdateOne{config: c.config, hooks: c.Hooks(), mutation: mutation}\n}", "title": "" }, { "docid": "420814eb2eb8bb4925fdabfe9b611173", "score": "0.51006", "text": "func Upgrade(tx *sql.Tx, directory string) error {\n\tif MissingSchemaMigrations(tx) {\n\t\treturn nil\n\t}\n\n\t// Migrate from schema_migrations to the migrations.applied table\n\tif err := CopyMigrations(tx); err != nil {\n\t\t_ = tx.Rollback()\n\t\treturn err\n\t}\n\n\t// Add the rollbacks migrations.rollbacks table\n\tif err := UpdateRollbacks(tx, directory); err != nil {\n\t\treturn err\n\t}\n\n\t// Remove the remainder of migrations/v1\n\tif err := dropSchemaMigrations(tx); err != nil {\n\t\treturn err\n\t}\n\n\treturn nil\n}", "title": "" }, { "docid": "7d7a1190b3f88ac2359398ca31129468", "score": "0.50974977", "text": "func TestDDL_MigrateUp(t *testing.T) {\n\n\ttests := []struct {\n\t\tname string\n\t\twithEmptySchema bool\n\t\twantErr bool\n\t}{\n\t\t{\n\t\t\tname: \"Default\",\n\t\t\twithEmptySchema: true,\n\t\t\twantErr: false,\n\t\t},\n\t\t{\n\t\t\tname: \"Default\",\n\t\t\twithEmptySchema: false,\n\t\t\twantErr: false,\n\t\t},\n\t}\n\tfor _, tt := range tests {\n\t\tddl := &DDL{}\n\t\tt.Run(tt.name, func(t *testing.T) {\n\t\t\tif tt.withEmptySchema {\n\t\t\t\terrE := ddl.MigrateDown(context.Background(), pool)\n\t\t\t\tif errE != nil {\n\t\t\t\t\tt.Errorf(\"DDL.MigrateDown() error = %v when emptying the schema\", errE)\n\t\t\t\t}\n\t\t\t}\n\t\t\tif err := ddl.MigrateUp(context.Background(), pool); (err != nil) != tt.wantErr {\n\t\t\t\tt.Errorf(\"DDL.MigrateUp() error = %v, wantErr %v\", err, tt.wantErr)\n\t\t\t}\n\t\t})\n\t}\n}", "title": "" }, { "docid": "520337ac9221d391036f7ea7bbbd0c21", "score": "0.5092193", "text": "func (c *AdminrepairClient) UpdateOne(a *Adminrepair) *AdminrepairUpdateOne {\n\tmutation := newAdminrepairMutation(c.config, OpUpdateOne, withAdminrepair(a))\n\treturn &AdminrepairUpdateOne{config: c.config, hooks: c.Hooks(), mutation: mutation}\n}", "title": "" }, { "docid": "9cac72a44dcb5b46aa85da72a04ab4ab", "score": "0.5047639", "text": "func migrateUtxoSetVersion1To2(ctx context.Context, db database.DB) error {\n\t// Hardcoded bucket and key names so updates do not affect old upgrades.\n\tv1BucketName := []byte(\"utxoset\")\n\tv2BucketName := []byte(\"utxosetv2\")\n\n\tlog.Info(\"Migrating database utxo set. This may take a while...\")\n\tstart := time.Now()\n\n\t// Create the new utxoset bucket as needed.\n\terr := db.Update(func(dbTx database.Tx) error {\n\t\t_, err := dbTx.Metadata().CreateBucketIfNotExists(v2BucketName)\n\t\treturn err\n\t})\n\tif err != nil {\n\t\treturn err\n\t}\n\n\t// doBatch contains the primary logic for upgrading the utxoset from version\n\t// 1 to 2 in batches. This is done because attempting to migrate in a\n\t// single database transaction could result in massive memory usage and\n\t// could potentially crash on many systems due to ulimits.\n\t//\n\t// It returns whether or not all entries have been updated.\n\tconst maxEntries = 20000\n\tvar resumeOffset uint32\n\tvar totalMigrated uint64\n\tdoBatch := func(dbTx database.Tx) (bool, error) {\n\t\tmeta := dbTx.Metadata()\n\t\tv1Bucket := meta.Bucket(v1BucketName)\n\t\tif v1Bucket == nil {\n\t\t\treturn false, fmt.Errorf(\"bucket %s does not exist\", v1BucketName)\n\t\t}\n\n\t\tv2Bucket := meta.Bucket(v2BucketName)\n\t\tif v2Bucket == nil {\n\t\t\treturn false, fmt.Errorf(\"bucket %s does not exist\", v2BucketName)\n\t\t}\n\n\t\t// Migrate utxoset entries so long as the max number of entries for this\n\t\t// batch has not been exceeded.\n\t\tvar logProgress bool\n\t\tvar numMigrated, numIterated uint32\n\t\terr := v1Bucket.ForEach(func(key, oldSerialized []byte) error {\n\t\t\tif interruptRequested(ctx) {\n\t\t\t\tlogProgress = true\n\t\t\t\treturn errInterruptRequested\n\t\t\t}\n\n\t\t\tif numMigrated >= maxEntries {\n\t\t\t\tlogProgress = true\n\t\t\t\treturn errBatchFinished\n\t\t\t}\n\n\t\t\t// Skip entries that have already been migrated in previous batches.\n\t\t\tnumIterated++\n\t\t\tif numIterated-1 < resumeOffset {\n\t\t\t\treturn nil\n\t\t\t}\n\t\t\tresumeOffset++\n\n\t\t\t// Skip entries that have already been migrated in previous\n\t\t\t// interrupted upgrades.\n\t\t\tif v2Bucket.Get(key) != nil {\n\t\t\t\treturn nil\n\t\t\t}\n\n\t\t\t// Copy the existing serialized bytes so they can be mutated and\n\t\t\t// rewritten to the new bucket as needed.\n\t\t\tserialized := make([]byte, len(oldSerialized))\n\t\t\tcopy(serialized, oldSerialized)\n\n\t\t\t// The legacy version 1 unspent transaction output (utxo) set\n\t\t\t// consists of an entry for each transaction which contains a utxo\n\t\t\t// serialized using a format that is highly optimized to reduce\n\t\t\t// space using domain specific compression algorithms.\n\t\t\t//\n\t\t\t// The legacy format for this entry is roughly:\n\t\t\t//\n\t\t\t// <version><height><index><flags><rest of data>\n\t\t\t//\n\t\t\t// Field Type Size\n\t\t\t// transaction version VLQ variable\n\t\t\t// block height VLQ variable\n\t\t\t// block index VLQ variable\n\t\t\t// flags VLQ variable (only ever 1 byte)\n\t\t\t// rest of data...\n\t\t\t//\n\t\t\t// The legacy serialized flags code format is:\n\t\t\t// bit 0 - containing transaction is a coinbase\n\t\t\t// bit 1 - containing transaction has an expiry\n\t\t\t// bits 2-3 - transaction type\n\t\t\t// bit 4 - is fully spent\n\t\t\t// bits 5-7 - unused\n\t\t\t//\n\t\t\t// Given the migration only needs to move the fully spent bit from\n\t\t\t// bit 4 to bit 6, the following specifically finds and modifies the\n\t\t\t// relevant byte while leaving everything else untouched.\n\n\t\t\t// Deserialize the tx version, block height, and block index to\n\t\t\t// locate the offset of the flags byte that needs to be modified.\n\t\t\t_, bytesRead := deserializeVLQ(serialized)\n\t\t\toffset := bytesRead\n\t\t\tif offset >= len(serialized) {\n\t\t\t\treturn errDeserialize(\"unexpected end of data after version\")\n\t\t\t}\n\t\t\t_, bytesRead = deserializeVLQ(serialized[offset:])\n\t\t\toffset += bytesRead\n\t\t\tif offset >= len(serialized) {\n\t\t\t\treturn errDeserialize(\"unexpected end of data after height\")\n\t\t\t}\n\t\t\t_, bytesRead = deserializeVLQ(serialized[offset:])\n\t\t\toffset += bytesRead\n\t\t\tif offset >= len(serialized) {\n\t\t\t\treturn errDeserialize(\"unexpected end of data after index\")\n\t\t\t}\n\n\t\t\t// Migrate flags to the new format.\n\t\t\tconst v1FullySpentFlag = 1 << 4\n\t\t\tconst v2FullySpentFlag = 1 << 6\n\t\t\tflags64, bytesRead := deserializeVLQ(serialized[offset:])\n\t\t\tif bytesRead != 1 {\n\t\t\t\tstr := fmt.Sprintf(\"unexpected flags size -- got %d, want 1\",\n\t\t\t\t\tbytesRead)\n\t\t\t\treturn errDeserialize(str)\n\t\t\t}\n\t\t\tflags := byte(flags64)\n\t\t\tfullySpent := flags&v1FullySpentFlag != 0\n\t\t\tflags &^= v1FullySpentFlag\n\t\t\tif fullySpent {\n\t\t\t\tflags |= v2FullySpentFlag\n\t\t\t}\n\t\t\tserialized[offset] = flags\n\n\t\t\t// Write the entry serialized with the new format to the new bucket.\n\t\t\terr = v2Bucket.Put(key, serialized)\n\t\t\tif err != nil {\n\t\t\t\treturn err\n\t\t\t}\n\n\t\t\tnumMigrated++\n\t\t\treturn nil\n\t\t})\n\t\tisFullyDone := err == nil\n\t\tif (isFullyDone || logProgress) && numMigrated > 0 {\n\t\t\ttotalMigrated += uint64(numMigrated)\n\t\t\tlog.Infof(\"Migrated %d entries (%d total)\", numMigrated,\n\t\t\t\ttotalMigrated)\n\t\t}\n\t\treturn isFullyDone, err\n\t}\n\n\t// Migrate all entries in batches for the reasons mentioned above.\n\tif err := batchedUpdate(ctx, db, doBatch); err != nil {\n\t\treturn err\n\t}\n\n\telapsed := time.Since(start).Round(time.Millisecond)\n\tlog.Infof(\"Done migrating utxoset. Total entries: %d in %v\", totalMigrated,\n\t\telapsed)\n\n\tif interruptRequested(ctx) {\n\t\treturn errInterruptRequested\n\t}\n\n\t// Drop version 1 utxoset.\n\tlog.Info(\"Removing old utxoset entries...\")\n\tstart = time.Now()\n\terr = incrementalFlatDrop(ctx, db, v1BucketName, \"old utxoset\")\n\tif err != nil {\n\t\treturn err\n\t}\n\telapsed = time.Since(start).Round(time.Millisecond)\n\tlog.Infof(\"Done removing old utxoset entries in %v\", elapsed)\n\treturn nil\n}", "title": "" }, { "docid": "a245ea534c1846643a099c0050df6e30", "score": "0.50383025", "text": "func Up() *cobra.Command {\n\tupOptions := &UpOptions{}\n\tcmd := &cobra.Command{\n\t\tUse: \"up\",\n\t\tShort: \"Activate your development container\",\n\t\tArgs: utils.NoArgsAccepted(\"https://okteto.com/docs/reference/cli/#up\"),\n\t\tRunE: func(cmd *cobra.Command, args []string) error {\n\t\t\tif okteto.InDevContainer() {\n\t\t\t\treturn oktetoErrors.ErrNotInDevContainer\n\t\t\t}\n\n\t\t\tu := utils.UpgradeAvailable()\n\t\t\tif len(u) > 0 {\n\t\t\t\twarningFolder := filepath.Join(config.GetOktetoHome(), \".warnings\")\n\t\t\t\tif utils.GetWarningState(warningFolder, \"version\") != u {\n\t\t\t\t\toktetoLog.Yellow(\"Okteto %s is available. To upgrade:\", u)\n\t\t\t\t\toktetoLog.Yellow(\" %s\", utils.GetUpgradeCommand())\n\t\t\t\t\tif err := utils.SetWarningState(warningFolder, \"version\", u); err != nil {\n\t\t\t\t\t\toktetoLog.Infof(\"failed to set warning version state: %s\", err.Error())\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tcheckLocalWatchesConfiguration()\n\n\t\t\tif upOptions.AutoDeploy {\n\t\t\t\toktetoLog.Warning(`The 'deploy' flag is deprecated and will be removed in a future release.\n Set the 'autocreate' field in your okteto manifest to get the same behavior.\n More information is available here: https://okteto.com/docs/reference/cli/#up`)\n\t\t\t}\n\n\t\t\tctx := context.Background()\n\n\t\t\tmanifestOpts := contextCMD.ManifestOptions{Filename: upOptions.DevPath, Namespace: upOptions.Namespace, K8sContext: upOptions.K8sContext}\n\t\t\tmanifest, err := contextCMD.LoadManifestWithContext(ctx, manifestOpts)\n\t\t\tif err != nil {\n\t\t\t\tif !strings.Contains(err.Error(), \"okteto init\") {\n\t\t\t\t\treturn err\n\t\t\t\t}\n\t\t\t\tif !utils.AskIfOktetoInit(upOptions.DevPath) {\n\t\t\t\t\treturn err\n\t\t\t\t}\n\n\t\t\t\tmanifest, err = LoadManifestWithInit(ctx, upOptions.K8sContext, upOptions.Namespace, upOptions.DevPath)\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\tdev, err := utils.GetDevFromManifest(manifest)\n\t\t\tif err != nil {\n\t\t\t\treturn err\n\t\t\t}\n\n\t\t\tif err := loadManifestOverrides(dev, upOptions); err != nil {\n\t\t\t\treturn err\n\t\t\t}\n\n\t\t\tif syncthing.ShouldUpgrade() {\n\t\t\t\toktetoLog.Println(\"Installing dependencies...\")\n\t\t\t\tif err := downloadSyncthing(); err != nil {\n\t\t\t\t\toktetoLog.Infof(\"failed to upgrade syncthing: %s\", err)\n\n\t\t\t\t\tif !syncthing.IsInstalled() {\n\t\t\t\t\t\treturn fmt.Errorf(\"couldn't download syncthing, please try again\")\n\t\t\t\t\t}\n\n\t\t\t\t\toktetoLog.Yellow(\"couldn't upgrade syncthing, will try again later\")\n\t\t\t\t\toktetoLog.Println()\n\t\t\t\t} else {\n\t\t\t\t\toktetoLog.Success(\"Dependencies successfully installed\")\n\t\t\t\t}\n\t\t\t}\n\n\t\t\toktetoLog.ConfigureFileLogger(config.GetAppHome(dev.Namespace, dev.Name), config.VersionString)\n\n\t\t\tif err := checkStignoreConfiguration(dev); err != nil {\n\t\t\t\toktetoLog.Infof(\"failed to check '.stignore' configuration: %s\", err.Error())\n\t\t\t}\n\n\t\t\tif err := addStignoreSecrets(dev); err != nil {\n\t\t\t\treturn err\n\t\t\t}\n\n\t\t\tif err := addSyncFieldHash(dev); err != nil {\n\t\t\t\treturn err\n\t\t\t}\n\n\t\t\tif _, ok := os.LookupEnv(model.OktetoAutoDeployEnvVar); ok {\n\t\t\t\tupOptions.AutoDeploy = true\n\t\t\t}\n\n\t\t\tup := &upContext{\n\t\t\t\tDev: dev,\n\t\t\t\tExit: make(chan error, 1),\n\t\t\t\tresetSyncthing: upOptions.Reset,\n\t\t\t\tStartTime: time.Now(),\n\t\t\t\tOptions: upOptions,\n\t\t\t}\n\t\t\tup.inFd, up.isTerm = term.GetFdInfo(os.Stdin)\n\t\t\tif up.isTerm {\n\t\t\t\tvar err error\n\t\t\t\tup.stateTerm, err = term.SaveState(up.inFd)\n\t\t\t\tif err != nil {\n\t\t\t\t\toktetoLog.Infof(\"failed to save the state of the terminal: %s\", err.Error())\n\t\t\t\t\treturn fmt.Errorf(\"failed to save the state of the terminal\")\n\t\t\t\t}\n\t\t\t\toktetoLog.Infof(\"Terminal: %v\", up.stateTerm)\n\t\t\t}\n\n\t\t\terr = up.start()\n\n\t\t\tif err := up.Client.CoreV1().PersistentVolumeClaims(dev.Namespace).Delete(ctx, fmt.Sprintf(model.DeprecatedOktetoVolumeNameTemplate, dev.Name), metav1.DeleteOptions{}); err != nil {\n\t\t\t\toktetoLog.Infof(\"error deleting deprecated volume: %v\", err)\n\t\t\t}\n\n\t\t\tif err != nil {\n\t\t\t\tswitch err.(type) {\n\t\t\t\tdefault:\n\t\t\t\t\terr = fmt.Errorf(\"%w\\n Find additional logs at: %s/okteto.log\", err, config.GetAppHome(dev.Namespace, dev.Name))\n\t\t\t\tcase oktetoErrors.CommandError:\n\t\t\t\t\toktetoLog.Infof(\"CommandError: %v\", err)\n\t\t\t\t}\n\n\t\t\t}\n\n\t\t\treturn err\n\t\t},\n\t}\n\n\tcmd.Flags().StringVarP(&upOptions.DevPath, \"file\", \"f\", utils.DefaultManifest, \"path to the manifest file\")\n\tcmd.Flags().StringVarP(&upOptions.Namespace, \"namespace\", \"n\", \"\", \"namespace where the up command is executed\")\n\tcmd.Flags().StringVarP(&upOptions.K8sContext, \"context\", \"c\", \"\", \"context where the up command is executed\")\n\tcmd.Flags().IntVarP(&upOptions.Remote, \"remote\", \"r\", 0, \"configures remote execution on the specified port\")\n\tcmd.Flags().BoolVarP(&upOptions.AutoDeploy, \"deploy\", \"d\", false, \"create deployment when it doesn't exist in a namespace\")\n\tcmd.Flags().MarkHidden(\"deploy\")\n\tcmd.Flags().BoolVarP(&upOptions.Build, \"build\", \"\", false, \"build on-the-fly the dev image using the info provided by the 'build' okteto manifest field\")\n\tcmd.Flags().BoolVarP(&upOptions.ForcePull, \"pull\", \"\", false, \"force dev image pull\")\n\tcmd.Flags().BoolVarP(&upOptions.Reset, \"reset\", \"\", false, \"reset the file synchronization database\")\n\treturn cmd\n}", "title": "" }, { "docid": "e76851a38070f8bf7e73117604119b61", "score": "0.50373226", "text": "func (c *DiseaseClient) UpdateOne(d *Disease) *DiseaseUpdateOne {\n\tmutation := newDiseaseMutation(c.config, OpUpdateOne, withDisease(d))\n\treturn &DiseaseUpdateOne{config: c.config, hooks: c.Hooks(), mutation: mutation}\n}", "title": "" }, { "docid": "9748facfd6b32d758cd987363f195c12", "score": "0.50073695", "text": "func (apt *AptPackageManager) UpdateOne(packageName string) (err error) {\n\treturn ErrAptMissingFeature\n}", "title": "" }, { "docid": "c207791236b6f4390abea4d28fee4c65", "score": "0.5004424", "text": "func (c *ProvinceClient) UpdateOne(pr *Province) *ProvinceUpdateOne {\n\tmutation := newProvinceMutation(c.config, OpUpdateOne, withProvince(pr))\n\treturn &ProvinceUpdateOne{config: c.config, hooks: c.Hooks(), mutation: mutation}\n}", "title": "" }, { "docid": "e326af0e9622984dd75897908123a1d4", "score": "0.5002972", "text": "func Up_20210530144301(txn *sql.Tx) {\n\torm := db.GetDB()\n\t// Create table for `User`\n\torm.CreateTable(&User{})\n}", "title": "" }, { "docid": "83bb4fe961463a786ab03c044df17d44", "score": "0.49863994", "text": "func (t *BT) Up() {\n\trunnable := exec.Command(\"hciconfig\", \"hci0\", \"up\")\n\trunnable.Output()\n}", "title": "" }, { "docid": "fcbd5fba1b5d860c4d2affdc7e90a711", "score": "0.49845856", "text": "func Up20151009170110(txn *sql.Tx) {\n\t_, err := txn.Query(\"ALTER TABLE users ADD tutorial_state VARCHAR(1024) NULL\")\n\tif err != nil {\n\t\tlog.Println(err)\n\t\ttxn.Rollback()\n\t}\n}", "title": "" }, { "docid": "b06731f1204272e646a555e1ab34d13f", "score": "0.4954775", "text": "func upgradeToVer1(cli *clientv3.Client, uctx Context) error {\n\treturn nil\n}", "title": "" }, { "docid": "026b3d82018d665ab11096a64a6e3594", "score": "0.49443", "text": "func (u *simpleUpgrader) updatePlusOne(ctx context.Context, cs *api.OpenShiftManagedCluster, role api.AgentPoolProfileRole, ssHashes map[scalesetName]hash) *api.PluginError {\n\tcount := getCount(cs, role)\n\n\t// store a list of all the VM instances now, so that if we end up creating\n\t// new ones (in the crash recovery case, we might not), we can detect which\n\t// they are\n\toldVMs, err := u.listVMs(ctx, cs, role)\n\tif err != nil {\n\t\treturn &api.PluginError{Err: err, Step: api.PluginStepUpdatePlusOneListVMs}\n\t}\n\n\tblob, err := u.readUpdateBlob()\n\tif err != nil {\n\t\treturn &api.PluginError{Err: err, Step: api.PluginStepUpdatePlusOneReadBlob}\n\t}\n\n\t// Filter out VMs that do not need to get upgraded. Should speed\n\t// up retrying failed upgrades.\n\toldVMs = u.filterOldVMs(oldVMs, blob, ssHashes)\n\tvmsBefore := map[string]struct{}{}\n\tfor _, vm := range oldVMs {\n\t\tvmsBefore[*vm.InstanceID] = struct{}{}\n\t}\n\n\tfor _, vm := range oldVMs {\n\t\tu.log.Infof(\"setting ss-%s capacity to %d\", role, count+1)\n\t\tfuture, err := u.ssc.Update(ctx, cs.Properties.AzProfile.ResourceGroup, \"ss-\"+string(role), compute.VirtualMachineScaleSetUpdate{\n\t\t\tSku: &compute.Sku{\n\t\t\t\tCapacity: to.Int64Ptr(int64(count) + 1),\n\t\t\t},\n\t\t})\n\t\tif err != nil {\n\t\t\treturn &api.PluginError{Err: err, Step: api.PluginStepUpdatePlusOneWaitForReady}\n\t\t}\n\n\t\tif err := future.WaitForCompletionRef(ctx, u.ssc.Client()); err != nil {\n\t\t\treturn &api.PluginError{Err: err, Step: api.PluginStepUpdatePlusOneWaitForReady}\n\t\t}\n\n\t\tupdatedList, err := u.listVMs(ctx, cs, role)\n\t\tif err != nil {\n\t\t\treturn &api.PluginError{Err: err, Step: api.PluginStepUpdatePlusOneListVMs}\n\t\t}\n\n\t\t// wait for newly created VMs to reach readiness (n.b. one alternative to\n\t\t// this approach would be for the CSE to not return until the node is\n\t\t// ready, but that is also problematic)\n\t\tfor _, updated := range updatedList {\n\t\t\tif _, found := vmsBefore[*updated.InstanceID]; !found {\n\t\t\t\tcomputerName := kubeclient.ComputerName(*updated.VirtualMachineScaleSetVMProperties.OsProfile.ComputerName)\n\t\t\t\tu.log.Infof(\"waiting for %s to be ready\", computerName)\n\t\t\t\terr = u.kubeclient.WaitForReady(ctx, role, computerName)\n\t\t\t\tif err != nil {\n\t\t\t\t\treturn &api.PluginError{Err: err, Step: api.PluginStepUpdatePlusOneWaitForReady}\n\t\t\t\t}\n\t\t\t\tvmsBefore[*updated.InstanceID] = struct{}{}\n\t\t\t\tblob[instanceName(*updated.Name)] = ssHashes[ssNameForVM(&updated)]\n\t\t\t\tif err := u.writeUpdateBlob(blob); err != nil {\n\t\t\t\t\treturn &api.PluginError{Err: err, Step: api.PluginStepUpdatePlusOneUpdateBlob}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\tif err := u.delete(ctx, cs, role, *vm.InstanceID, kubeclient.ComputerName(*vm.VirtualMachineScaleSetVMProperties.OsProfile.ComputerName)); err != nil {\n\t\t\treturn &api.PluginError{Err: err, Step: api.PluginStepUpdatePlusOneDeleteVMs}\n\t\t}\n\t\tdelete(blob, instanceName(*vm.Name))\n\t\tif err := u.writeUpdateBlob(blob); err != nil {\n\t\t\treturn &api.PluginError{Err: err, Step: api.PluginStepUpdatePlusOneUpdateBlob}\n\t\t}\n\t}\n\n\treturn nil\n}", "title": "" }, { "docid": "be8183a2921588ee9f10f29c0d9044d6", "score": "0.49437103", "text": "func (c *UserClient) UpdateOne(u *User) *UserUpdateOne {\n\tmutation := newUserMutation(c.config, OpUpdateOne, withUser(u))\n\treturn &UserUpdateOne{config: c.config, hooks: c.Hooks(), mutation: mutation}\n}", "title": "" }, { "docid": "be8183a2921588ee9f10f29c0d9044d6", "score": "0.49437103", "text": "func (c *UserClient) UpdateOne(u *User) *UserUpdateOne {\n\tmutation := newUserMutation(c.config, OpUpdateOne, withUser(u))\n\treturn &UserUpdateOne{config: c.config, hooks: c.Hooks(), mutation: mutation}\n}", "title": "" }, { "docid": "be8183a2921588ee9f10f29c0d9044d6", "score": "0.49437103", "text": "func (c *UserClient) UpdateOne(u *User) *UserUpdateOne {\n\tmutation := newUserMutation(c.config, OpUpdateOne, withUser(u))\n\treturn &UserUpdateOne{config: c.config, hooks: c.Hooks(), mutation: mutation}\n}", "title": "" }, { "docid": "be8183a2921588ee9f10f29c0d9044d6", "score": "0.49437103", "text": "func (c *UserClient) UpdateOne(u *User) *UserUpdateOne {\n\tmutation := newUserMutation(c.config, OpUpdateOne, withUser(u))\n\treturn &UserUpdateOne{config: c.config, hooks: c.Hooks(), mutation: mutation}\n}", "title": "" }, { "docid": "be8183a2921588ee9f10f29c0d9044d6", "score": "0.49437103", "text": "func (c *UserClient) UpdateOne(u *User) *UserUpdateOne {\n\tmutation := newUserMutation(c.config, OpUpdateOne, withUser(u))\n\treturn &UserUpdateOne{config: c.config, hooks: c.Hooks(), mutation: mutation}\n}", "title": "" }, { "docid": "be8183a2921588ee9f10f29c0d9044d6", "score": "0.49437103", "text": "func (c *UserClient) UpdateOne(u *User) *UserUpdateOne {\n\tmutation := newUserMutation(c.config, OpUpdateOne, withUser(u))\n\treturn &UserUpdateOne{config: c.config, hooks: c.Hooks(), mutation: mutation}\n}", "title": "" }, { "docid": "be8183a2921588ee9f10f29c0d9044d6", "score": "0.49437103", "text": "func (c *UserClient) UpdateOne(u *User) *UserUpdateOne {\n\tmutation := newUserMutation(c.config, OpUpdateOne, withUser(u))\n\treturn &UserUpdateOne{config: c.config, hooks: c.Hooks(), mutation: mutation}\n}", "title": "" }, { "docid": "be8183a2921588ee9f10f29c0d9044d6", "score": "0.49437103", "text": "func (c *UserClient) UpdateOne(u *User) *UserUpdateOne {\n\tmutation := newUserMutation(c.config, OpUpdateOne, withUser(u))\n\treturn &UserUpdateOne{config: c.config, hooks: c.Hooks(), mutation: mutation}\n}", "title": "" }, { "docid": "a8dd06c575bfef3954f9576833579230", "score": "0.49258962", "text": "func Upgrade(lasttime int64) error {\n\tsm := sortMap(migrationMap)\n\ti := 0\n\tmigs, _ := getAllMigrations()\n\tfor _, v := range sm {\n\t\tif _, ok := migs[v.name]; !ok {\n\t\t\tlogs.Info(\"start upgrade\", v.name)\n\t\t\tv.m.Reset()\n\t\t\tv.m.Up()\n\t\t\terr := v.m.Exec(v.name, \"up\")\n\t\t\tif err != nil {\n\t\t\t\tlogs.Error(\"execute error:\", err)\n\t\t\t\ttime.Sleep(2 * time.Second)\n\t\t\t\treturn err\n\t\t\t}\n\t\t\tlogs.Info(\"end upgrade:\", v.name)\n\t\t\ti++\n\t\t}\n\t}\n\tlogs.Info(\"total success upgrade:\", i, \" migration\")\n\ttime.Sleep(2 * time.Second)\n\treturn nil\n}", "title": "" }, { "docid": "e5e83b09163a5b9825c54ced4145748f", "score": "0.49236387", "text": "func UpadateAnimalByModel(animal Animal) int64 {\n\tdb := Connect()\n\tdefer db.Close()\n\trs := db.Model(&animal).Update(\"Name\", \"Super Dog\")\n\treturn rs.RowsAffected\n}", "title": "" }, { "docid": "938b06124c07dcd62b1f2e4b1f3f4d13", "score": "0.49121803", "text": "func (d *DB) Rollup() *DB {\r\n\td.rollup = true\r\n\treturn d\r\n}", "title": "" }, { "docid": "ca821a3b202afb792cd5d78f9787f3be", "score": "0.48925883", "text": "func (c *UserStatusClient) UpdateOne(us *UserStatus) *UserStatusUpdateOne {\n\tmutation := newUserStatusMutation(c.config, OpUpdateOne, withUserStatus(us))\n\treturn &UserStatusUpdateOne{config: c.config, hooks: c.Hooks(), mutation: mutation}\n}", "title": "" }, { "docid": "d45fb90e4167581e7311b5b46406e120", "score": "0.4892186", "text": "func UpdateOne(db Rootx, sqlKey string, args ...interface{}) error {\n\treturn updateOne(db, sqlKey, \"UpdateOne\", args...)\n}", "title": "" }, { "docid": "aca0c3bb5a31474125e2e4863fd3a520", "score": "0.4886596", "text": "func (c *PaymentTypeClient) UpdateOne(pt *PaymentType) *PaymentTypeUpdateOne {\n\tmutation := newPaymentTypeMutation(c.config, OpUpdateOne, withPaymentType(pt))\n\treturn &PaymentTypeUpdateOne{config: c.config, hooks: c.Hooks(), mutation: mutation}\n}", "title": "" }, { "docid": "43c794a9ae10adcb3d826808b7131161", "score": "0.4886437", "text": "func Up() bool {\n\treturn fwdUp\n}", "title": "" }, { "docid": "9c0a2cca0159d438d78055fadadb16ee", "score": "0.48807368", "text": "func (c *EquipmentPortClient) UpdateOne(ep *EquipmentPort) *EquipmentPortUpdateOne {\n\treturn c.UpdateOneID(ep.ID)\n}", "title": "" }, { "docid": "1f6ba0e8ea6d7ce4525b51845ae21a87", "score": "0.48659068", "text": "func (m *sshMigrator) Up(ctx context.Context) error {\n\ttx, err := m.store.Transact(ctx)\n\tif err != nil {\n\t\treturn err\n\t}\n\tdefer func() { err = tx.Done(err) }()\n\n\tf := false\n\tcredentials, _, err := tx.UserCredentials().List(ctx, database.UserCredentialsListOpts{\n\t\tScope: database.UserCredentialScope{\n\t\t\tDomain: database.UserCredentialDomainBatches,\n\t\t},\n\t\tLimitOffset: &database.LimitOffset{\n\t\t\tLimit: sshMigrationCountPerRun,\n\t\t},\n\t\tForUpdate: true,\n\t\tSSHMigrationApplied: &f,\n\t})\n\tif err != nil {\n\t\treturn err\n\t}\n\tfor _, cred := range credentials {\n\t\ta, err := cred.Authenticator(ctx)\n\t\tif err != nil {\n\t\t\treturn err\n\t\t}\n\n\t\tswitch a := a.(type) {\n\t\tcase *auth.OAuthBearerToken:\n\t\t\tnewCred := &auth.OAuthBearerTokenWithSSH{OAuthBearerToken: *a}\n\t\t\tkeypair, err := encryption.GenerateRSAKey()\n\t\t\tif err != nil {\n\t\t\t\treturn err\n\t\t\t}\n\t\t\tnewCred.PrivateKey = keypair.PrivateKey\n\t\t\tnewCred.PublicKey = keypair.PublicKey\n\t\t\tnewCred.Passphrase = keypair.Passphrase\n\t\t\tif err := cred.SetAuthenticator(ctx, newCred); err != nil {\n\t\t\t\treturn err\n\t\t\t}\n\t\tcase *auth.BasicAuth:\n\t\t\tnewCred := &auth.BasicAuthWithSSH{BasicAuth: *a}\n\t\t\tkeypair, err := encryption.GenerateRSAKey()\n\t\t\tif err != nil {\n\t\t\t\treturn err\n\t\t\t}\n\t\t\tnewCred.PrivateKey = keypair.PrivateKey\n\t\t\tnewCred.PublicKey = keypair.PublicKey\n\t\t\tnewCred.Passphrase = keypair.Passphrase\n\t\t\tif err := cred.SetAuthenticator(ctx, newCred); err != nil {\n\t\t\t\treturn err\n\t\t\t}\n\t\t}\n\n\t\tcred.SSHMigrationApplied = true\n\t\tif err := tx.UserCredentials().Update(ctx, cred); err != nil {\n\t\t\treturn err\n\t\t}\n\t}\n\n\treturn nil\n}", "title": "" }, { "docid": "97019a10e1b4aff44088d487ff910cbc", "score": "0.48637807", "text": "func UpToCheckpointV2(v1 apitype.CheckpointV1) apitype.CheckpointV2 {\n\tvar v2 apitype.CheckpointV2\n\tv2.Stack = v1.Stack\n\tv2.Config = make(config.Map)\n\tfor key, value := range v1.Config {\n\t\tv2.Config[key] = value\n\t}\n\n\tvar v2deploy *apitype.DeploymentV2\n\tif v1.Latest != nil {\n\t\tdeploy := UpToDeploymentV2(*v1.Latest)\n\t\tv2deploy = &deploy\n\t}\n\tv2.Latest = v2deploy\n\treturn v2\n}", "title": "" }, { "docid": "5a023dc34e75d5e94ef076ae547191ca", "score": "0.48623645", "text": "func (c *EquipmentPortDefinitionClient) UpdateOne(epd *EquipmentPortDefinition) *EquipmentPortDefinitionUpdateOne {\n\treturn c.UpdateOneID(epd.ID)\n}", "title": "" }, { "docid": "191a737a16bf0fee5e940d0d90295819", "score": "0.48530677", "text": "func Up(tag string, mode string) (string, error) {\n \treturn\tchange(tag,mode,true)\n}", "title": "" }, { "docid": "9fe57f4f2ee0ddc20b0ecf3b6d915c40", "score": "0.48437804", "text": "func (c *GoodsClient) UpdateOne(_go *Goods) *GoodsUpdateOne {\n\tmutation := newGoodsMutation(c.config, OpUpdateOne, withGoods(_go))\n\treturn &GoodsUpdateOne{config: c.config, hooks: c.Hooks(), mutation: mutation}\n}", "title": "" }, { "docid": "a7e55a553e37e5ce38cc66e3d8b761d3", "score": "0.48430377", "text": "func (c *DrugClient) UpdateOne(d *Drug) *DrugUpdateOne {\n\tmutation := newDrugMutation(c.config, OpUpdateOne, withDrug(d))\n\treturn &DrugUpdateOne{config: c.config, hooks: c.Hooks(), mutation: mutation}\n}", "title": "" }, { "docid": "e1480e9824894bc78886c6dd9f461229", "score": "0.48401314", "text": "func (s *Server) upgradeDBSchemaV1Import(tctx *tcontext.Context, cfgs map[string]map[string]config.SubTaskConfig) error {\n\tfor _, taskCfgs := range cfgs {\n\t\t// all subtasks in one task must have the same downstream, so we only create one BaseDB instance.\n\t\t// but different tasks may have different downstream.\n\t\tvar targetDB *conn.BaseDB\n\t\tfor _, cfg := range taskCfgs {\n\t\t\tcfg2, err := cfg.DecryptPassword() // `cfg` should already be `Adjust`.\n\t\t\tif err != nil {\n\t\t\t\treturn err\n\t\t\t}\n\t\t\tif targetDB == nil {\n\t\t\t\ttargetDB, err = conn.DefaultDBProvider.Apply(cfg2.To)\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\terr = v1dbschema.UpdateSchema(tctx, targetDB, cfg2)\n\t\t\tif err != nil {\n\t\t\t\ttargetDB.Close()\n\t\t\t\treturn err\n\t\t\t}\n\t\t}\n\t\ttargetDB.Close() // close BaseDB for this task.\n\t}\n\treturn nil\n}", "title": "" } ]
e827361b516b53daf0858ba35964bce5
Generate a new file backend
[ { "docid": "6a36b66cb0866d9ccbfd75d88ed6da3a", "score": "0.5877001", "text": "func NewFileBackend(ctx context.Context, ec *ExportConfig) (Backend, error) {\n\tperms := os.O_RDWR\n\tif ec.ReadOnly {\n\t\tperms = os.O_RDONLY\n\t}\n\tif s, err := isTrue(ec.DriverParameters[\"sync\"]); err != nil {\n\t\treturn nil, err\n\t} else if s {\n\t\tperms |= os.O_SYNC\n\t}\n\tfile, err := os.OpenFile(ec.DriverParameters[\"path\"], perms, 0666)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\tstat, err := file.Stat()\n\tif err != nil {\n\t\tfile.Close()\n\t\treturn nil, err\n\t}\n\treturn &FileBackend{\n\t\tfile: file,\n\t\tsize: uint64(stat.Size()),\n\t}, nil\n}", "title": "" } ]
[ { "docid": "6170d4905154fdeb92393f70e0005ac7", "score": "0.6304034", "text": "func (g *generator) generateFile() error {\n\tdata := g.generateTmplData(g.p.ParsedFields())\n\n\tdir, file := path.Split(g.p.Filename())\n\tout := file[:strings.LastIndex(file, \".\")] + \"gen.go\"\n\n\tf, err := os.Create(path.Join(dir, out))\n\tif err != nil {\n\t\treturn err\n\t}\n\n\tdefer func() { _ = f.Close() }()\n\n\tmustWrite(fmt.Fprintf(f, \"// Code generated by kenv for %s target. DO NOT EDIT.\\n\", g.p.Target()))\n\tmustWrite(fmt.Fprintf(f, \"package %s\\n\\n\", g.p.Package()))\n\n\tif g.needImport {\n\t\timports := strings.Join(conv.GetPredefinedImport(), \"\\n\\t\")\n\t\tmustWrite(fmt.Fprintf(f, \"import (\\n\\t%s\\n)\\n\", imports))\n\t}\n\n\ttemplates := map[string]*template.Template{\n\t\t// for predefined convert functions\n\t\tpredefined: template.Must(template.New(predefined).Parse(Get)),\n\t\t// for New method\n\t\tconstruct: template.Must(template.New(construct).Parse(New)),\n\t\t// for other\n\t\ttypes.Want: template.Must(template.New(types.Want).Parse(Want)),\n\t\ttypes.Must: template.Must(template.New(types.Must).Parse(Must)),\n\t\ttypes.Secret: template.Must(template.New(types.Secret).Parse(Secret)),\n\t}\n\n\tfor key, d := range data {\n\t\tmust(templates[d.Name].Execute(f, d))\n\n\t\tif d.Name == predefined {\n\t\t\tdelete(data, key)\n\t\t}\n\t}\n\n\tmust(templates[construct].Execute(f, struct {\n\t\tRecv *Recv\n\t\tData map[string]*TmplData\n\t}{g.makeRecv(), data}))\n\n\treturn nil\n}", "title": "" }, { "docid": "2b37bf36c4efbe093177161d37656cf3", "score": "0.612975", "text": "func ToFileWithTemplate() {\n\n}", "title": "" }, { "docid": "a602efe40f38fae7a5f43596976d0ba4", "score": "0.5878688", "text": "func generateOneFile(fileNamePrefix string, types []TypeContext) (err error) {\n\terr = generateDotGo(fileNamePrefix+\".go\", types)\n\tif err != nil {\n\t\treturn\n\t}\n\terr = generateTestDotGo(fileNamePrefix+\"_test.go\", types)\n\treturn\n}", "title": "" }, { "docid": "0e36a21b8e464466368b3a7b5babef6a", "score": "0.5837174", "text": "func Generate(args []string) error {\n return gobelt.Generate(args, func(build *gogen.Build, filePath, dir string) error {\n // retrieve the file from the build\n file := build.File(filepath.Base(filePath))\n\n data := TemplateData{\n Package: file.Package(),\n }\n\n\t\tpwd, err := os.Getwd()\n\t\tif err != nil {\n\t\t\treturn err\n\t\t}\n\n // open template file\n template := filecache.Cache.LoadFile(gobelt.GetTemplatePath(\"observablegen\") + \"/template.go\")\n\n for stName := range file.Structs().Filter(\"@observable\") {\n data.ModelName = stName\n\n // create out file\n out, err := os.Create(filepath.Join(pwd, stName + \".observable.gen.go\"))\n if err != nil {\n return err\n }\n\n err = gobelt.ExecuteTemplate(template, out, &data)\n if err != nil {\n return err\n }\n\n out.Close()\n }\n\n return nil\n })\n}", "title": "" }, { "docid": "33cbe9c696e95b898dda75550c7aa434", "score": "0.5820617", "text": "func Generate(outfile, buildTag, codecPkgPath string, uid int64, goRunTag string,\n\tst string, regexName *regexp.Regexp, notRegexName *regexp.Regexp, deleteTempFile bool, infiles ...string) (err error) {\n\t// For each file, grab AST, find each type, and write a call to it.\n\tif len(infiles) == 0 {\n\t\treturn\n\t}\n\tif outfile == \"\" || codecPkgPath == \"\" {\n\t\terr = errors.New(\"outfile and codec package path cannot be blank\")\n\t\treturn\n\t}\n\tif uid < 0 {\n\t\tuid = -uid\n\t}\n\tif uid == 0 {\n\t\trr := rand.New(rand.NewSource(time.Now().UnixNano()))\n\t\tuid = 101 + rr.Int63n(9777)\n\t}\n\t// We have to parse dir for package, before opening the temp file for writing (else ImportDir fails).\n\t// Also, ImportDir(...) must take an absolute path.\n\tlastdir := filepath.Dir(outfile)\n\tabsdir, err := filepath.Abs(lastdir)\n\tif err != nil {\n\t\treturn\n\t}\n\tpkg, err := build.Default.ImportDir(absdir, build.AllowBinary)\n\tif err != nil {\n\t\treturn\n\t}\n\ttype tmplT struct {\n\t\tCodecPkgName string\n\t\tCodecImportPath string\n\t\tImportPath string\n\t\tOutFile string\n\t\tPackageName string\n\t\tRandString string\n\t\tBuildTag string\n\t\tStructTags string\n\t\tTypes []string\n\t\tCodecPkgFiles bool\n\t}\n\ttv := tmplT{\n\t\tCodecPkgName: genCodecPkg,\n\t\tOutFile: outfile,\n\t\tCodecImportPath: codecPkgPath,\n\t\tBuildTag: buildTag,\n\t\tRandString: strconv.FormatInt(uid, 10),\n\t\tStructTags: st,\n\t}\n\ttv.ImportPath = pkg.ImportPath\n\tif tv.ImportPath == tv.CodecImportPath {\n\t\ttv.CodecPkgFiles = true\n\t\ttv.CodecPkgName = \"codec\"\n\t} else {\n\t\t// HACK: always handle vendoring. It should be typically on in go 1.6, 1.7\n\t\ttv.ImportPath = stripVendor(tv.ImportPath)\n\t}\n\tastfiles := make([]*ast.File, len(infiles))\n\tfor i, infile := range infiles {\n\t\tif filepath.Dir(infile) != lastdir {\n\t\t\terr = errors.New(\"in files must all be in same directory as outfile\")\n\t\t\treturn\n\t\t}\n\t\tfset := token.NewFileSet()\n\t\tastfiles[i], err = parser.ParseFile(fset, infile, nil, 0)\n\t\tif err != nil {\n\t\t\treturn\n\t\t}\n\t\tif i == 0 {\n\t\t\ttv.PackageName = astfiles[i].Name.Name\n\t\t\tif tv.PackageName == \"main\" {\n\t\t\t\t// codecgen cannot be run on types in the 'main' package.\n\t\t\t\t// A temporary 'main' package must be created, and should reference the fully built\n\t\t\t\t// package containing the types.\n\t\t\t\t// Also, the temporary main package will conflict with the main package which already has a main method.\n\t\t\t\terr = errors.New(\"codecgen cannot be run on types in the 'main' package\")\n\t\t\t\treturn\n\t\t\t}\n\t\t}\n\t}\n\n\t// keep track of types with selfer methods\n\t// selferMethods := []string{\"CodecEncodeSelf\", \"CodecDecodeSelf\"}\n\tselferEncTyps := make(map[string]bool)\n\tselferDecTyps := make(map[string]bool)\n\tfor _, f := range astfiles {\n\t\tfor _, d := range f.Decls {\n\t\t\t// if fd, ok := d.(*ast.FuncDecl); ok && fd.Recv != nil && fd.Recv.NumFields() == 1 {\n\t\t\tif fd, ok := d.(*ast.FuncDecl); ok && fd.Recv != nil && len(fd.Recv.List) == 1 {\n\t\t\t\trecvType := fd.Recv.List[0].Type\n\t\t\t\tif ptr, ok := recvType.(*ast.StarExpr); ok {\n\t\t\t\t\trecvType = ptr.X\n\t\t\t\t}\n\t\t\t\tif id, ok := recvType.(*ast.Ident); ok {\n\t\t\t\t\tswitch fd.Name.Name {\n\t\t\t\t\tcase \"CodecEncodeSelf\":\n\t\t\t\t\t\tselferEncTyps[id.Name] = true\n\t\t\t\t\tcase \"CodecDecodeSelf\":\n\t\t\t\t\t\tselferDecTyps[id.Name] = true\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\n\t// now find types\n\tfor _, f := range astfiles {\n\t\tfor _, d := range f.Decls {\n\t\t\tif gd, ok := d.(*ast.GenDecl); ok {\n\t\t\t\tfor _, dd := range gd.Specs {\n\t\t\t\t\tif td, ok := dd.(*ast.TypeSpec); ok {\n\t\t\t\t\t\t// if len(td.Name.Name) == 0 || td.Name.Name[0] > 'Z' || td.Name.Name[0] < 'A' {\n\t\t\t\t\t\tif len(td.Name.Name) == 0 {\n\t\t\t\t\t\t\tcontinue\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\t// only generate for:\n\t\t\t\t\t\t// struct: StructType\n\t\t\t\t\t\t// primitives (numbers, bool, string): Ident\n\t\t\t\t\t\t// map: MapType\n\t\t\t\t\t\t// slice, array: ArrayType\n\t\t\t\t\t\t// chan: ChanType\n\t\t\t\t\t\t// do not generate:\n\t\t\t\t\t\t// FuncType, InterfaceType, StarExpr (ptr), etc\n\t\t\t\t\t\tswitch td.Type.(type) {\n\t\t\t\t\t\tcase *ast.StructType, *ast.Ident, *ast.MapType, *ast.ArrayType, *ast.ChanType:\n\t\t\t\t\t\t\t// only add to tv.Types iff\n\t\t\t\t\t\t\t// - it matches per the -r parameter\n\t\t\t\t\t\t\t// - it doesn't match per the -nr parameter\n\t\t\t\t\t\t\t// - it doesn't have any of the Selfer methods in the file\n\t\t\t\t\t\t\tif regexName.FindStringIndex(td.Name.Name) != nil &&\n\t\t\t\t\t\t\t\tnotRegexName.FindStringIndex(td.Name.Name) == nil &&\n\t\t\t\t\t\t\t\t!selferEncTyps[td.Name.Name] &&\n\t\t\t\t\t\t\t\t!selferDecTyps[td.Name.Name] {\n\t\t\t\t\t\t\t\ttv.Types = append(tv.Types, td.Name.Name)\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\tif len(tv.Types) == 0 {\n\t\treturn\n\t}\n\n\t// we cannot use ioutil.TempFile, because we cannot guarantee the file suffix (.go).\n\t// Also, we cannot create file in temp directory,\n\t// because go run will not work (as it needs to see the types here).\n\t// Consequently, create the temp file in the current directory, and remove when done.\n\n\t// frun, err = ioutil.TempFile(\"\", \"codecgen-\")\n\t// frunName := filepath.Join(os.TempDir(), \"codecgen-\"+strconv.FormatInt(time.Now().UnixNano(), 10)+\".go\")\n\n\tfrunMainName := \"codecgen-main-\" + tv.RandString + \".generated.go\"\n\tfrunPkgName := \"codecgen-pkg-\" + tv.RandString + \".generated.go\"\n\tif deleteTempFile {\n\t\tdefer os.Remove(frunMainName)\n\t\tdefer os.Remove(frunPkgName)\n\t}\n\t// var frunMain, frunPkg *os.File\n\tif _, err = gen1(frunMainName, genFrunMainTmpl, &tv); err != nil {\n\t\treturn\n\t}\n\tif _, err = gen1(frunPkgName, genFrunPkgTmpl, &tv); err != nil {\n\t\treturn\n\t}\n\n\t// remove outfile, so \"go run ...\" will not think that types in outfile already exist.\n\tos.Remove(outfile)\n\n\t// execute go run frun\n\tcmd := exec.Command(\"go\", \"run\", \"-tags\", \"codecgen.exec safe \"+goRunTag, frunMainName) //, frunPkg.Name())\n\tvar buf bytes.Buffer\n\tcmd.Stdout = &buf\n\tcmd.Stderr = &buf\n\tif err = cmd.Run(); err != nil {\n\t\terr = fmt.Errorf(\"error running 'go run %s': %v, console: %s\",\n\t\t\tfrunMainName, err, buf.Bytes())\n\t\treturn\n\t}\n\tos.Stdout.Write(buf.Bytes())\n\treturn\n}", "title": "" }, { "docid": "7ce8978607c7256b993411aa6f8bd85a", "score": "0.57924926", "text": "func generate(singleFile bool, accessToken string, outPath string) {\n\t// Make output colorful for visibility.\n\tstdColor := color.New(color.FgWhite).Add(color.Bold)\n\tsuccessColor := color.New(color.FgGreen).Add(color.Bold)\n\n\t// Fetch the necessary data via the Rollbar API.\n\tprojects := fetcher.FetchProjects(accessToken)\n\tteams := fetcher.FetchTeams(accessToken)\n\tusers := fetcher.FetchUsers(accessToken)\n\n\tif singleFile {\n\t\t/*\n\t\t * If the user pases the single file flag, just append constantly to the same file.\n\t\t *\n\t\t * FIXME: This is clunky.\n\t\t */\n\t\twriter.WriteProviderBlocks(outPath + \"/rollbar_account.tf\")\n\t\twriter.WriteTeams(teams, outPath+\"/rollbar_account.tf\")\n\t\twriter.WriteProjects(projects, teams, outPath+\"/rollbar_account.tf\")\n\t\twriter.WriteProjectAccessTokens(projects, outPath+\"/rollbar_account.tf\")\n\t\twriter.WriteUsers(users, outPath+\"/rollbar_account.tf\")\n\t\tsuccessColor.Fprintln(os.Stdout, \"Rendered All Account Resources to rollbar_account.tf.\")\n\n\t\twriter.WriteProjectAccessTokenImportCommands(projects, outPath+\"/import\")\n\t\twriter.WriteProjectImportCommands(projects, outPath+\"/import\")\n\t\twriter.WriteTeamImportCommands(teams, outPath+\"/import\")\n\t\twriter.WriteUserImportCommands(users, outPath+\"/import\")\n\t\tstdColor.Fprintln(os.Stdout, \"Rendered Terraform Import Commands to import\")\n\t} else {\n\t\twriter.WriteProviderBlocks(outPath + \"/main.tf\")\n\n\t\twriter.WriteTeams(teams, outPath+\"/teams.tf\")\n\t\tsuccessColor.Fprintln(os.Stdout, \"Rendered Team Resources to teams.tf.\")\n\n\t\twriter.WriteProjects(projects, teams, outPath+\"/projects.tf\")\n\t\tsuccessColor.Fprintln(os.Stdout, \"Rendered Project Resources to projects.tf.\")\n\n\t\twriter.WriteProjectAccessTokens(projects, outPath+\"/access_tokens.tf\")\n\t\tsuccessColor.Fprintln(os.Stdout, \"Rendered Access Token Resources to access_tokens.tf.\")\n\n\t\twriter.WriteUsers(users, outPath+\"/users.tf\")\n\t\tsuccessColor.Fprintln(os.Stdout, \"Rendered User Resources to users.tf.\")\n\n\t\twriter.WriteProjectAccessTokenImportCommands(projects, outPath+\"/import\")\n\t\twriter.WriteProjectImportCommands(projects, outPath+\"/import\")\n\t\twriter.WriteTeamImportCommands(teams, outPath+\"/import\")\n\t\twriter.WriteUserImportCommands(users, outPath+\"/import\")\n\t\tstdColor.Fprintln(os.Stdout, \"Rendered Terraform Import Commands to import\")\n\t}\n}", "title": "" }, { "docid": "4bcc764e883a8a500380841e0da8f1b2", "score": "0.57759196", "text": "func main() {\n\tf, err := os.Create(generatedPath)\n\tif err != nil {\n\t\tlog.Fatal(err)\n\t}\n\n\tmeta := parseMeta()\n\n\t// Generate header\n\terr = headerT.Execute(f, meta)\n\tif err != nil {\n\t\tlog.Fatal(err)\n\t}\n\n\t// Generate meta\n\terr = metaT.Execute(f, meta)\n\tif err != nil {\n\t\tlog.Fatal(err)\n\t}\n\n\t// Generate pairs\n\terr = pairsT.Execute(f, meta)\n\tif err != nil {\n\t\tlog.Fatal(err)\n\t}\n\n\t// Generate context\n\terr = contextT.Execute(f, meta)\n\tif err != nil {\n\t\tlog.Fatal(err)\n\t}\n}", "title": "" }, { "docid": "935294220541be930e0f456137bac5a7", "score": "0.57405937", "text": "func Generate() {\n\tsetDataType()\n\tdb := getDatabase()\n\tcolumns := getTableModels(db)\n\tfor _, el := range columns {\n\t\tcreateFile(el)\n\t}\n}", "title": "" }, { "docid": "471d1ac5cdb86794479ff90bb85a16c3", "score": "0.57333106", "text": "func (renderer *ServiceRenderer) Generate(response *plugins.Response, files []string) (err error) {\n\tfor _, filename := range files {\n\t\tfile := &plugins.File{}\n\t\tfile.Name = filename\n\t\tf := new(bytes.Buffer)\n\t\tt := renderer.Templates[filename]\n\t\tlog.Printf(\"Generating %s\", filename)\n\t\terr = t.Execute(f, struct {\n\t\t\tRenderer *ServiceRenderer\n\t\t}{\n\t\t\trenderer,\n\t\t})\n\t\tif err != nil {\n\t\t\tresponse.Errors = append(response.Errors, fmt.Sprintf(\"ERROR %v\", err))\n\t\t}\n\t\tinputBytes := f.Bytes()\n\t\t// run generated Go files through gofmt\n\t\tif filepath.Ext(file.Name) == \".go\" {\n\t\t\tstrippedBytes := stripMarkers(inputBytes)\n\t\t\tfile.Data, err = gofmt(file.Name, strippedBytes)\n\t\t} else {\n\t\t\tfile.Data = inputBytes\n\t\t}\n\t\tresponse.Files = append(response.Files, file)\n\t}\n\treturn\n}", "title": "" }, { "docid": "089a210d6ad389cdd63a43ba3adb0149", "score": "0.57316613", "text": "func (s *SmartContract) createFile(APIstub shim.ChaincodeStubInterface, args []string) sc.Response {\n\n uname, err := s.testCertificate(APIstub, nil)\n if err != nil {\n return shim.Error(err.Error())\n }\n\n //check if exist a file with same name\n //haven't tested\n resultsIterator, err := APIstub.GetStateByPartialCompositeKey(\"File\",[]string{args[0]})\n if err != nil {\n return shim.Error(err.Error())\n }\n defer resultsIterator.Close()\n\n if resultsIterator.HasNext(){\n return shim.Error(\"already exist a file having the same name\")\n }\n\n // create an object\n //var file = File{Name: args[0], Hash: args[1], Keyword: args[2], Summary: args[3], Owner: uname, Locktime: 0,Magnet:args[4]}\n var file = File{Name: args[0], Hash: args[1], Keyword: args[2], Summary: args[3], Owner: uname, Locktime: 0,Magnet:args[4],AESKey:args[5]}\n fileAsBytes, _ := json.Marshal(file)\n\n // we need a relational database as an addition to leveldb\n // edit here when custom interface is ready\n // we currently use composite key with keyword name and owner.\n\n //args[2]: keyword\n //args[0]: Name\n //uname:\n keys := []string{args[2], args[0], uname}\n ckey, err := APIstub.CreateCompositeKey(\"File\", keys)\n if err != nil {\n return shim.Error(err.Error())\n }\n APIstub.PutState(ckey, fileAsBytes)\n\n APIstub.SetEvent(\"createFile\", fileAsBytes);\n return shim.Success([]byte(uname))\n}", "title": "" }, { "docid": "e299d3761c1f9c49da2455fd55eabf1e", "score": "0.5671429", "text": "func (gr *goResource) generateAPIFile(dir string) error {\n\tfilename := filepath.Join(dir, strings.ToLower(gr.Name)+\"_api.go\")\n\treturn commons.GenerateFile(gr, resourceAPITemplate, \"resource_api_template\", filename, false)\n}", "title": "" }, { "docid": "a8faf4333cd02b4c088c557145441bf5", "score": "0.56650203", "text": "func generateFile(gen *protogen.Plugin, file *protogen.File) *protogen.GeneratedFile {\n\tfilename := file.GeneratedFilenamePrefix + \".md\"\n\tg := gen.NewGeneratedFile(filename, file.GoImportPath)\n\n\tgenFileComment(gen, file, g)\n\n\tfor _, service := range file.Services {\n\t\tif service.Desc.Options().(*descriptorpb.ServiceOptions).GetDeprecated() {\n\t\t\tcontinue\n\t\t}\n\t\tgenService(file, service, g)\n\t}\n\treturn g\n}", "title": "" }, { "docid": "0d14cdd1bd27f1328e78ed1ff1cdf392", "score": "0.5587755", "text": "func generate(filename string) (err error) {\n\tvar cfg config\n\tif err := yaml.Unmarshal(configData, &cfg); err != nil {\n\t\treturn fmt.Errorf(\"decode config: %w\", err)\n\t}\n\n\ttmpl := template.New(\"base\").Funcs(template.FuncMap{\n\t\t\"ucfirst\": ucfirst,\n\t\t\"dict\": dict,\n\t\t\"contains\": strings.Contains,\n\t})\n\n\ttmpl, err = tmpl.ParseFS(templates, \"templates/*.tmpl\")\n\tif err != nil {\n\t\treturn fmt.Errorf(\"parse templates: %w\", err)\n\t}\n\n\toutput, err := os.Create(filename) //nolint: gosec\n\tif err != nil {\n\t\treturn fmt.Errorf(\"open output: %w\", err)\n\t}\n\n\tdefer func() {\n\t\tif errc := output.Close(); err == nil && errc != nil {\n\t\t\terr = errc\n\t\t}\n\t}()\n\n\tif err := tmpl.ExecuteTemplate(output, \"root.tmpl\", cfg); err != nil {\n\t\treturn fmt.Errorf(\"execute template: %w\", err)\n\t}\n\n\tcmd := exec.Command(\"gofmt\", \"-w\", filename)\n\tbuf, err := cmd.CombinedOutput()\n\tif err != nil {\n\t\treturn fmt.Errorf(\"format output %q: %w\", string(buf), err)\n\t}\n\n\treturn nil\n}", "title": "" }, { "docid": "89c4c651fadf032a302e287697184064", "score": "0.5570257", "text": "func Generate(path string, info Info) error {\n\n\thandleError := func(err error) error {\n\t\tos.RemoveAll(path)\n\t\treturn err\n\t}\n\tif err := os.MkdirAll(filepath.Join(path, \"internal\"), 0755); err != nil {\n\t\treturn err\n\t}\n\n\tfor _, t := range info.IntegrationTypes {\n\t\tswitch IntegrationType(t) {\n\t\tcase IntegrationTypeSourcecode:\n\t\t\tinfo.Capabilities = append(info.Capabilities,\n\t\t\t\tsourcecode.PullRequestCommitModelName,\n\t\t\t\tsourcecode.PullRequestCommentModelName,\n\t\t\t)\n\t\tcase IntegrationTypeIssueTracking:\n\t\t\tinfo.Capabilities = append(info.Capabilities,\n\t\t\t\twork.UserModelName,\n\t\t\t\twork.ProjectModelName,\n\t\t\t\twork.IssueModelName,\n\t\t\t\twork.IssueCommentModelName,\n\t\t\t\twork.SprintModelName,\n\t\t\t)\n\t\tcase IntegrationTypeCalendar:\n\t\t\tinfo.Capabilities = append(info.Capabilities,\n\t\t\t\tcalendar.UserModelName,\n\t\t\t\tcalendar.CalendarModelName,\n\t\t\t\tcalendar.EventModelName,\n\t\t\t)\n\t\tcase IntegrationTypeCodeQuality:\n\t\t\tinfo.Capabilities = append(info.Capabilities,\n\t\t\t\tcodequality.MetricModelName,\n\t\t\t\tcodequality.ProjectModelName,\n\t\t\t)\n\t\tcase IntegrationTypeCICD:\n\t\tcase IntegrationTypeSecurity:\n\t\t}\n\t}\n\n\tinfo.TitleCaseName = strings.Title(info.Name)\n\tinfo.LowerCaseName = strings.ToLower(info.Name)\n\tinfo.Date = time.Now().String()\n\tinfo.GitTag = gitTag\n\tfor _, name := range AssetNames() {\n\t\t// trim off template/\n\t\tthename := strings.Replace(name[9:], \".tmpl\", \"\", -1)\n\t\tif err := generate(path, thename, info); err != nil {\n\t\t\treturn handleError(err)\n\t\t}\n\t}\n\n\treturn nil\n}", "title": "" }, { "docid": "0c39e9a82f0b681cb5f94d5aa126d6d4", "score": "0.55653405", "text": "func getFile(args *internal.ArgType, t *internal.TBuf) (*os.File, error) {\n\tvar f *os.File\n\tvar err error\n\n\t// determine filename\n\tfilename := strings.ToLower(t.Name)\n\tif t.TemplateType == internal.ExtensionTemplate {\n\t\tfilename += \".\" + internal.ExtensionTemplate.String()\n\t}\n\tif t.NeedSuffix {\n\t\tif t.Driver == \"godror\" {\n\t\t\tfilename += \".oracle\"\n\t\t} else {\n\t\t\tfilename += \".\" + t.Driver\n\t\t}\n\t}\n\tfilename += args.Suffix\n\n\tif args.SingleFile {\n\t\tfilename = args.Filename\n\t}\n\tfilename = path.Join(args.Path, filename)\n\n\t// lookup file\n\tf, ok := files[filename]\n\tif ok {\n\t\treturn f, nil\n\t}\n\n\t// default open mode\n\tmode := os.O_RDWR | os.O_CREATE | os.O_TRUNC\n\n\t// stat file to determine if file already exists\n\tfi, err := os.Stat(filename)\n\tif err == nil && fi.IsDir() {\n\t\treturn nil, errors.New(\"filename cannot be directory\")\n\t} else if _, ok = err.(*os.PathError); !ok && args.Append && t.TemplateType != internal.XOTemplate {\n\t\t// file exists so append if append is set and not XO type\n\t\tmode = os.O_APPEND | os.O_WRONLY\n\t}\n\n\t// skip\n\t//if t.TemplateType == internal.XOTemplate && fi != nil {\n\t//\treturn nil, nil\n\t//}\n\n\t// open file\n\tf, err = os.OpenFile(filename, mode, 0666)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\t// file didn't originally exist, so add package header\n\tif fi == nil || !args.Append {\n\t\t// add build tags\n\t\tif args.Tags != \"\" {\n\t\t\tf.WriteString(`// +build ` + args.Tags + \"\\n\\n\")\n\t\t}\n\n\t\t// execute\n\t\terr = args.TemplateSet().Execute(f, \"xo_package.go.tpl\", args)\n\t\tif err != nil {\n\t\t\treturn nil, err\n\t\t}\n\t}\n\n\t// store file\n\tfiles[filename] = f\n\n\treturn f, nil\n}", "title": "" }, { "docid": "4da7ab0a6fda16f1321d84817753e4ae", "score": "0.55365425", "text": "func Generate(generate GenerateFunc, config Config) {\n\tvar (\n\t\terr error\n\t\tfile string\n\t\tok bool\n\t)\n\tctx := GenerateContext{Logger: config.logger}\n\n\tctx.ApplicationPath, err = os.Getwd()\n\tif err != nil {\n\t\tconfig.exitHandler.Error(fmt.Errorf(\"unable to get working directory\\n%w\", err))\n\t\treturn\n\t}\n\n\tif config.logger.IsDebugEnabled() {\n\t\tif err := config.contentWriter.Write(\"Application contents\", ctx.ApplicationPath); err != nil {\n\t\t\tconfig.logger.Debugf(\"unable to write application contents\\n%w\", err)\n\t\t}\n\t}\n\n\tif s, ok := os.LookupEnv(EnvExtensionDirectory); ok {\n\t\tctx.Extension.Path = filepath.Clean(s)\n\t} else {\n\t\tconfig.exitHandler.Error(fmt.Errorf(\"unable to get CNB_EXTENSION_DIR, not found\"))\n\t\treturn\n\t}\n\n\tif config.logger.IsDebugEnabled() {\n\t\tif err := config.contentWriter.Write(\"Extension contents\", ctx.Extension.Path); err != nil {\n\t\t\tconfig.logger.Debugf(\"unable to write extension contents\\n%w\", err)\n\t\t}\n\t}\n\n\tfile = filepath.Join(ctx.Extension.Path, \"extension.toml\")\n\tif _, err = toml.DecodeFile(file, &ctx.Extension); err != nil && !os.IsNotExist(err) {\n\t\tconfig.exitHandler.Error(fmt.Errorf(\"unable to decode extension %s\\n%w\", file, err))\n\t\treturn\n\t}\n\tconfig.logger.Debugf(\"Extension: %+v\", ctx.Extension)\n\n\tAPI, err := semver.NewVersion(ctx.Extension.API)\n\tif err != nil {\n\t\tconfig.exitHandler.Error(errors.New(\"version cannot be parsed\"))\n\t\treturn\n\t}\n\n\tcompatVersionCheck, _ := semver.NewConstraint(fmt.Sprintf(\">= %s, <= %s\", MinSupportedBPVersion, MaxSupportedBPVersion))\n\tif !compatVersionCheck.Check(API) {\n\t\tif MinSupportedBPVersion == MaxSupportedBPVersion {\n\t\t\tconfig.exitHandler.Error(fmt.Errorf(\"this version of libcnb is only compatible with buildpack API == %s\", MinSupportedBPVersion))\n\t\t\treturn\n\t\t}\n\n\t\tconfig.exitHandler.Error(fmt.Errorf(\"this version of libcnb is only compatible with buildpack APIs >= %s, <= %s\", MinSupportedBPVersion, MaxSupportedBPVersion))\n\t\treturn\n\t}\n\n\toutputDir, ok := os.LookupEnv(EnvOutputDirectory)\n\tif !ok {\n\t\tconfig.exitHandler.Error(fmt.Errorf(\"expected CNB_OUTPUT_DIR to be set\"))\n\t\treturn\n\t}\n\tctx.OutputDirectory = outputDir\n\n\tctx.Platform.Path, ok = os.LookupEnv(EnvPlatformDirectory)\n\tif !ok {\n\t\tconfig.exitHandler.Error(fmt.Errorf(\"expected CNB_PLATFORM_DIR to be set\"))\n\t\treturn\n\t}\n\n\tbuildpackPlanPath, ok := os.LookupEnv(EnvBuildPlanPath)\n\tif !ok {\n\t\tconfig.exitHandler.Error(fmt.Errorf(\"expected CNB_BP_PLAN_PATH to be set\"))\n\t\treturn\n\t}\n\n\tif config.logger.IsDebugEnabled() {\n\t\tif err := config.contentWriter.Write(\"Platform contents\", ctx.Platform.Path); err != nil {\n\t\t\tconfig.logger.Debugf(\"unable to write platform contents\\n%w\", err)\n\t\t}\n\t}\n\n\tif ctx.Platform.Bindings, err = NewBindings(ctx.Platform.Path); err != nil {\n\t\tconfig.exitHandler.Error(fmt.Errorf(\"unable to read platform bindings %s\\n%w\", ctx.Platform.Path, err))\n\t\treturn\n\t}\n\tconfig.logger.Debugf(\"Platform Bindings: %+v\", ctx.Platform.Bindings)\n\n\tfile = filepath.Join(ctx.Platform.Path, \"env\")\n\tif ctx.Platform.Environment, err = internal.NewConfigMapFromPath(file); err != nil {\n\t\tconfig.exitHandler.Error(fmt.Errorf(\"unable to read platform environment %s\\n%w\", file, err))\n\t\treturn\n\t}\n\tconfig.logger.Debugf(\"Platform Environment: %s\", ctx.Platform.Environment)\n\n\tif _, err = toml.DecodeFile(buildpackPlanPath, &ctx.Plan); err != nil && !os.IsNotExist(err) {\n\t\tconfig.exitHandler.Error(fmt.Errorf(\"unable to decode buildpack plan %s\\n%w\", buildpackPlanPath, err))\n\t\treturn\n\t}\n\tconfig.logger.Debugf(\"Buildpack Plan: %+v\", ctx.Plan)\n\n\tif ctx.StackID, ok = os.LookupEnv(EnvStackID); !ok {\n\t\tconfig.exitHandler.Error(fmt.Errorf(\"CNB_STACK_ID not set\"))\n\t\treturn\n\t}\n\tconfig.logger.Debugf(\"Stack: %s\", ctx.StackID)\n\n\tresult, err := generate(ctx)\n\tif err != nil {\n\t\tconfig.exitHandler.Error(err)\n\t\treturn\n\t}\n\tconfig.logger.Debugf(\"Result: %+v\", result)\n}", "title": "" }, { "docid": "987aa8bfd5295906e331265de3306f7b", "score": "0.5516745", "text": "func serverFile(genpkg string, svc *expr.HTTPServiceExpr) *codegen.File {\n\tdata := HTTPServices.Get(svc.Name())\n\tsvcName := data.Service.PathName\n\tpath := filepath.Join(codegen.Gendir, \"http\", svcName, \"server\", \"server.go\")\n\ttitle := fmt.Sprintf(\"%s HTTP server\", svc.Name())\n\tfuncs := map[string]any{\n\t\t\"join\": strings.Join,\n\t\t\"hasWebSocket\": hasWebSocket,\n\t\t\"isWebSocketEndpoint\": isWebSocketEndpoint,\n\t\t\"viewedServerBody\": viewedServerBody,\n\t\t\"mustDecodeRequest\": mustDecodeRequest,\n\t\t\"addLeadingSlash\": addLeadingSlash,\n\t\t\"removeTrailingIndexHTML\": removeTrailingIndexHTML,\n\t}\n\tsections := []*codegen.SectionTemplate{\n\t\tcodegen.Header(title, \"server\", []*codegen.ImportSpec{\n\t\t\t{Path: \"bufio\"},\n\t\t\t{Path: \"context\"},\n\t\t\t{Path: \"fmt\"},\n\t\t\t{Path: \"io\"},\n\t\t\t{Path: \"mime/multipart\"},\n\t\t\t{Path: \"net/http\"},\n\t\t\t{Path: \"path\"},\n\t\t\t{Path: \"strings\"},\n\t\t\t{Path: \"github.com/gorilla/websocket\"},\n\t\t\tcodegen.GoaImport(\"\"),\n\t\t\tcodegen.GoaNamedImport(\"http\", \"goahttp\"),\n\t\t\t{Path: genpkg + \"/\" + svcName, Name: data.Service.PkgName},\n\t\t\t{Path: genpkg + \"/\" + svcName + \"/\" + \"views\", Name: data.Service.ViewsPkg},\n\t\t}),\n\t}\n\n\tsections = append(sections, &codegen.SectionTemplate{Name: \"server-struct\", Source: serverStructT, Data: data})\n\tsections = append(sections, &codegen.SectionTemplate{Name: \"server-mountpoint\", Source: mountPointStructT, Data: data})\n\n\tfor _, e := range data.Endpoints {\n\t\tif e.MultipartRequestDecoder != nil {\n\t\t\tsections = append(sections, &codegen.SectionTemplate{\n\t\t\t\tName: \"multipart-request-decoder-type\",\n\t\t\t\tSource: multipartRequestDecoderTypeT,\n\t\t\t\tData: e.MultipartRequestDecoder,\n\t\t\t})\n\t\t}\n\t}\n\n\tsections = append(sections, &codegen.SectionTemplate{Name: \"server-init\", Source: serverInitT, Data: data, FuncMap: funcs})\n\tsections = append(sections, &codegen.SectionTemplate{Name: \"server-service\", Source: serverServiceT, Data: data})\n\tsections = append(sections, &codegen.SectionTemplate{Name: \"server-use\", Source: serverUseT, Data: data})\n\tsections = append(sections, &codegen.SectionTemplate{Name: \"server-method-names\", Source: serverMethodNamesT, Data: data})\n\tsections = append(sections, &codegen.SectionTemplate{Name: \"server-mount\", Source: serverMountT, Data: data, FuncMap: funcs})\n\n\tfor _, e := range data.Endpoints {\n\t\tsections = append(sections, &codegen.SectionTemplate{Name: \"server-handler\", Source: serverHandlerT, Data: e})\n\t\tsections = append(sections, &codegen.SectionTemplate{Name: \"server-handler-init\", Source: serverHandlerInitT, FuncMap: funcs, Data: e})\n\t}\n\tfor _, s := range data.FileServers {\n\t\tsections = append(sections, &codegen.SectionTemplate{Name: \"server-files\", Source: fileServerT, FuncMap: funcs, Data: s})\n\t}\n\n\treturn &codegen.File{Path: path, SectionTemplates: sections}\n}", "title": "" }, { "docid": "b797991b260c54115cca3387c187a46a", "score": "0.55167305", "text": "func clientFile(genpkg string, svc *expr.HTTPServiceExpr) *codegen.File {\n\tdata := HTTPServices.Get(svc.Name())\n\tsvcName := data.Service.PathName\n\tpath := filepath.Join(codegen.Gendir, \"http\", svcName, \"client\", \"client.go\")\n\ttitle := fmt.Sprintf(\"%s client HTTP transport\", svc.Name())\n\tsections := []*codegen.SectionTemplate{\n\t\tcodegen.Header(title, \"client\", []*codegen.ImportSpec{\n\t\t\t{Path: \"context\"},\n\t\t\t{Path: \"fmt\"},\n\t\t\t{Path: \"io\"},\n\t\t\t{Path: \"mime/multipart\"},\n\t\t\t{Path: \"net/http\"},\n\t\t\t{Path: \"strconv\"},\n\t\t\t{Path: \"strings\"},\n\t\t\t{Path: \"time\"},\n\t\t\t{Path: \"github.com/gorilla/websocket\"},\n\t\t\tcodegen.GoaImport(\"\"),\n\t\t\tcodegen.GoaNamedImport(\"http\", \"goahttp\"),\n\t\t\t{Path: genpkg + \"/\" + svcName, Name: data.Service.PkgName},\n\t\t\t{Path: genpkg + \"/\" + svcName + \"/\" + \"views\", Name: data.Service.ViewsPkg},\n\t\t}),\n\t}\n\tsections = append(sections, &codegen.SectionTemplate{\n\t\tName: \"client-struct\",\n\t\tSource: clientStructT,\n\t\tData: data,\n\t\tFuncMap: map[string]any{\"hasWebSocket\": hasWebSocket},\n\t})\n\n\tfor _, e := range data.Endpoints {\n\t\tif e.MultipartRequestEncoder != nil {\n\t\t\tsections = append(sections, &codegen.SectionTemplate{\n\t\t\t\tName: \"multipart-request-encoder-type\",\n\t\t\t\tSource: multipartRequestEncoderTypeT,\n\t\t\t\tData: e.MultipartRequestEncoder,\n\t\t\t})\n\t\t}\n\t}\n\n\tsections = append(sections, &codegen.SectionTemplate{\n\t\tName: \"client-init\",\n\t\tSource: clientInitT,\n\t\tData: data,\n\t\tFuncMap: map[string]any{\"hasWebSocket\": hasWebSocket},\n\t})\n\n\tfor _, e := range data.Endpoints {\n\t\tsections = append(sections, &codegen.SectionTemplate{\n\t\t\tName: \"client-endpoint-init\",\n\t\t\tSource: endpointInitT,\n\t\t\tData: e,\n\t\t\tFuncMap: map[string]any{\n\t\t\t\t\"isWebSocketEndpoint\": isWebSocketEndpoint,\n\t\t\t\t\"responseStructPkg\": responseStructPkg,\n\t\t\t},\n\t\t})\n\t}\n\n\treturn &codegen.File{Path: path, SectionTemplates: sections}\n}", "title": "" }, { "docid": "341bd4388b444712412978554e5bf94d", "score": "0.55036145", "text": "func genFile(file string) {\n\tf, err := os.Create(file)\n\tdefer f.Close()\n\tif err != nil {\n\t\tlog.Fatal(err)\n\t}\n\n\tif err := f.Truncate(bytes); err != nil {\n\t\tlog.Fatal(err)\n\t}\n}", "title": "" }, { "docid": "df662a6f408835aeec821714367d972d", "score": "0.550119", "text": "func GenFile(input string, output string) error {\n\t//fmt.Printf(\"input=%s output=%s\\n\", input, output)\n\toutdir := filepath.Dir(output)\n\tif !exists(outdir) {\n\t\tos.MkdirAll(outdir, 0775)\n\t}\n\treturn generate(input, output)\n}", "title": "" }, { "docid": "44c23985e66afd371b78855cd93d9204", "score": "0.54711396", "text": "func Generate(args []string) error {\n\treturn gobelt.Generate(args, func(build *gogen.Build, filePath, dir string) error {\n\t\t// retrieve the file from the build\n\t\treturn FromFile(build.File(filePath), dir)\n\t})\n}", "title": "" }, { "docid": "1f45d9025dc9fd72ac4f8640fcab0e5c", "score": "0.54687625", "text": "func NewBackend(path string) *Backend {\n\tname := filepath.Ext(path)\n\tif name != \"\" {\n\t\tname = name[1:]\n\t}\n\n\treturn &Backend{\n\t\tpath: path,\n\t\tname: name,\n\t}\n}", "title": "" }, { "docid": "9d08e244a6e5ff7388440e7067d8f5bf", "score": "0.54666877", "text": "func (g *GoBackend) Generate(req *plugin.Request, log backend.LogFunc) *plugin.Response {\n\tg.req = req\n\tg.res = plugin.NewResponse()\n\tg.log = log\n\tg.prepareUtilities()\n\tg.prepareTemplates()\n\tg.fillRequisitions()\n\tg.executeTemplates()\n\treturn g.buildResponse()\n}", "title": "" }, { "docid": "1f4f255ea3fcceb2f2e57883c46f817b", "score": "0.54614735", "text": "func genInternalGoFile(r io.Reader, w io.Writer) (err error) {\n\tgenInternalOnce.Do(genInternalInit)\n\n\tgt := genInternalV\n\n\tt := template.New(\"\").Funcs(genInternalTmplFuncs)\n\n\ttmplstr, err := ioutil.ReadAll(r)\n\tif err != nil {\n\t\treturn\n\t}\n\n\tif t, err = t.Parse(string(tmplstr)); err != nil {\n\t\treturn\n\t}\n\n\tvar out bytes.Buffer\n\terr = t.Execute(&out, gt)\n\tif err != nil {\n\t\treturn\n\t}\n\n\tbout, err := format.Source(out.Bytes())\n\tif err != nil {\n\t\tw.Write(out.Bytes()) // write out if error, so we can still see.\n\t\t// w.Write(bout) // write out if error, as much as possible, so we can still see.\n\t\treturn\n\t}\n\tw.Write(bout)\n\treturn\n}", "title": "" }, { "docid": "bf299e4e8937d2694a908456bc563266", "score": "0.5452627", "text": "func (ps *pythonSecurity) generate(dir string) error {\n\tfilename := filepath.Join(dir, ps.FileName)\n\treturn commons.GenerateFile(ps, ps.template, ps.templateName, filename, true)\n}", "title": "" }, { "docid": "7f0107af8e37903826a22dd282a6180f", "score": "0.5439573", "text": "func (ilu TriceIDLookUp) toFile(fSys afero.Fs, fn string) (err error) {\n\tvar fJSON, fC, fH, fCS afero.File\n\tfJSON, err = fSys.Create(fn)\n\tmsg.FatalOnErr(err)\n\tdefer func() {\n\t\terr = fJSON.Close()\n\t\tmsg.FatalOnErr(err)\n\t}()\n\tvar b []byte\n\tb, err = ilu.toJSON()\n\tmsg.FatalOnErr(err)\n\t_, err = fJSON.Write(b)\n\tmsg.FatalOnErr(err)\n\n\tif Verbose { // generate helpers for third party\n\t\tfnC := fn + \".c\"\n\t\tfC, err = fSys.Create(fnC)\n\t\tmsg.FatalOnErr(err)\n\t\tfnH := fn + \".h\"\n\t\tfH, err = fSys.Create(fnH)\n\t\tmsg.FatalOnErr(err)\n\t\tfnCS := fn + \".cs\"\n\t\tfCS, err = fSys.Create(fnCS)\n\t\tmsg.FatalOnErr(err)\n\t\tdefer func() {\n\t\t\terr = fC.Close()\n\t\t\tmsg.FatalOnErr(err)\n\t\t\terr = fH.Close()\n\t\t\tmsg.FatalOnErr(err)\n\t\t\terr = fCS.Close()\n\t\t\tmsg.FatalOnErr(err)\n\t\t}()\n\n\t\tcs, e := ilu.toCSFmtList(fnC)\n\t\t_, err = fCS.Write(cs)\n\t\tmsg.FatalOnErr(e)\n\n\t\tc, e := ilu.toCFmtList(fnC)\n\t\t_, err = fC.Write(c)\n\t\tmsg.FatalOnErr(e)\n\n\t\th := []byte(`//! \\file ` + fnH + `\n//! ///////////////////////////////////////////////////////////////////////////\n\n//! generated code - do not edit!\n\n#include <stdint.h>\n\ntypedef struct{\n\tchar* formatString;\n\tuint16_t id;\n\tint16_t dataLength;\n\tuint8_t bitWidth;\n} triceFormatStringList_t;\n\nextern const triceFormatStringList_t triceFormatStringList[];\nextern const unsigned triceFormatStringListElements;\n\n`)\n\t\t_, e = fH.Write(h)\n\t\tmsg.FatalOnErr(e)\n\t}\n\treturn\n}", "title": "" }, { "docid": "e6e2cf9afae95ac547ad1c3c25e58245", "score": "0.5435012", "text": "func Generate(gfilepath, associated string) (err error) {\n\tvar gfile genesisfile.GFile\n\tvar ma Associated\n\tgfile, ma, err = GenerateData()\n\tif err != nil {\n\t\treturn\n\t}\n\n\terr = ma.Dump(associated)\n\tif err != nil {\n\t\terr = errors.Wrap(err, \"writing associated file\")\n\t\treturn\n\t}\n\n\terr = gfile.Dump(gfilepath)\n\tif err != nil {\n\t\terr = errors.Wrap(err, \"writing genesis file\")\n\t\treturn\n\t}\n\n\treturn\n}", "title": "" }, { "docid": "a12c32c316bc723f891678d8787131f2", "score": "0.542305", "text": "func (g *openapiGenerator) generateFile(name string,\n\tpkg *protomodel.FileDescriptor,\n\tmessages map[string]*protomodel.MessageDescriptor,\n\tenums map[string]*protomodel.EnumDescriptor,\n\t_ map[string]*protomodel.ServiceDescriptor) plugin.CodeGeneratorResponse_File {\n\n\tg.messages = messages\n\n\tallSchemas := make(map[string]*openapi3.SchemaRef)\n\n\tfor _, message := range messages {\n\t\t// we generate the top-level messages here and the nested messages are generated\n\t\t// inside each top-level message.\n\t\tif message.Parent == nil {\n\t\t\tg.generateMessage(message, allSchemas)\n\t\t}\n\t}\n\n\tfor _, enum := range enums {\n\t\t// when there is no parent to the enum.\n\t\tif len(enum.QualifiedName()) == 1 {\n\t\t\tg.generateEnum(enum, allSchemas)\n\t\t}\n\t}\n\n\tvar version string\n\tvar description string\n\t// only get the API version when generate per package or per file,\n\t// as we cannot guarantee all protos in the input are the same version.\n\tif !g.singleFile {\n\t\tif g.currentFrontMatterProvider != nil && g.currentFrontMatterProvider.Matter.Description != \"\" {\n\t\t\tdescription = g.currentFrontMatterProvider.Matter.Description\n\t\t} else if pd := g.generateDescription(g.currentPackage); pd != \"\" {\n\t\t\tdescription = pd\n\t\t} else {\n\t\t\tdescription = \"OpenAPI Spec for Istio APIs.\"\n\t\t}\n\t\t// derive the API version from the package name\n\t\t// which is a convention for Istio APIs.\n\t\tvar p string\n\t\tif pkg != nil {\n\t\t\tp = pkg.GetPackage()\n\t\t} else {\n\t\t\tp = name\n\t\t}\n\t\ts := strings.Split(p, \".\")\n\t\tversion = s[len(s)-1]\n\t} else {\n\t\tdescription = \"OpenAPI Spec for Istio APIs.\"\n\t}\n\n\tc := openapi3.NewComponents()\n\tc.Schemas = allSchemas\n\t// add the openapi object required by the spec.\n\to := openapi3.Swagger{\n\t\tOpenAPI: \"3.0.1\",\n\t\tInfo: openapi3.Info{\n\t\t\tTitle: description,\n\t\t\tVersion: version,\n\t\t},\n\t\tComponents: c,\n\t}\n\n\tg.buffer.Reset()\n\tvar filename *string\n\tif g.yaml {\n\t\tb, err := yaml.Marshal(o)\n\t\tif err != nil {\n\t\t\tfmt.Fprintf(os.Stderr, \"unable to marshall the output of %v to yaml\", name)\n\t\t}\n\t\tfilename = proto.String(name + \".yaml\")\n\t\tg.buffer.Write(b)\n\t} else {\n\t\tb, err := json.MarshalIndent(o, \"\", \" \")\n\t\tif err != nil {\n\t\t\tfmt.Fprintf(os.Stderr, \"unable to marshall the output of %v to json\", name)\n\t\t}\n\t\tfilename = proto.String(name + \".json\")\n\t\tg.buffer.Write(b)\n\t}\n\n\treturn plugin.CodeGeneratorResponse_File{\n\t\tName: filename,\n\t\tContent: proto.String(g.buffer.String()),\n\t}\n}", "title": "" }, { "docid": "09890de344594a00335f7c71e748a885", "score": "0.5402948", "text": "func GenerateWithMem(ctx context.Context, src, dest string, useASCII bool, opts ...storage.Option) (err error) {\n\tfs := afs.New()\n\tvar uploads = make([]string, 0)\n\terr = fs.Walk(ctx, src, func(ctx context.Context, baseURL string, parent string, info os.FileInfo, reader io.Reader) (toContinue bool, err error) {\n\t\tif info.IsDir() {\n\t\t\treturn true, nil\n\t\t}\n\t\tvar data Data\n\t\tdata, err = ioutil.ReadAll(reader)\n\t\tdestURL := url.Join(dest, path.Join(parent, info.Name()))\n\t\tuploads = append(uploads,\n\t\t\tfmt.Sprintf(`\n\terr = fs.Upload(ctx, \"%v\", file.DefaultFileOsMode, bytes.NewReader(%v))\n\tif err != nil {\n\t\tlog.Printf(\"failed to upload: %v %v\", err)\n\t}\n`, destURL, data.AsBytesLiteral(useASCII), destURL, `%v`))\n\t\treturn true, nil\n\t}, opts...)\n\n\tif err != nil {\n\t\treturn err\n\t}\n\tif len(uploads) == 0 {\n\t\treturn nil\n\t}\n\tpayload := fmt.Sprintf(`package %v\nimport (\n\t\"bytes\"\n\t\"log\"\n\t\"github.com/viant/afs\"\n\t\"github.com/viant/afs/file\"\n\t\"context\"\n)\n\nfunc init() {\n\tfs := afs.New()\n\tctx := context.Background()\n\tvar err error\n\t%v\n}\n\n`, Pkg(dest), strings.Join(uploads, \"\\n\"))\n\treturn fs.Upload(ctx, dest, file.DefaultFileOsMode, strings.NewReader(payload))\n}", "title": "" }, { "docid": "14c29aa9c37dc400a044d32192932cb0", "score": "0.537826", "text": "func createGoGetFile(ri repoInfo) error {\n\tfilename := fmt.Sprintf(\"static/golang/%s.html\", ri.Repo)\n\tfile, err := os.Create(filename)\n\tif err != nil {\n\t\treturn err\n\t}\n\tdefer file.Close()\n\treturn fileTemplate.Execute(file, ri)\n}", "title": "" }, { "docid": "9f54ea06c512ef88c1d2bb1e0988c261", "score": "0.53715104", "text": "func newGenerator(pkg, version string, language language, info tfbridge.ProviderInfo,\n\toverlaysDir, outDir string) (*generator, error) {\n\t// If outDir or overlaysDir are empty, default to pack/<language>/ and overlays/<language>/ in the pwd.\n\tif outDir == \"\" || overlaysDir == \"\" {\n\t\tp, err := os.Getwd()\n\t\tif err != nil {\n\t\t\treturn nil, err\n\t\t}\n\t\tif outDir == \"\" {\n\t\t\toutDir = filepath.Join(p, defaultOutDir, string(language))\n\t\t}\n\t\tif overlaysDir == \"\" {\n\t\t\toverlaysDir = filepath.Join(p, defaultOverlaysDir, string(language))\n\t\t}\n\t}\n\n\t// Ensure the language is valid and, if so, create a new language-specific code generator.\n\tvar lg langGenerator\n\tswitch language {\n\tcase golang:\n\t\tlg = newGoGenerator(pkg, version, info, overlaysDir, outDir)\n\tcase nodeJS:\n\t\tlg = newNodeJSGenerator(pkg, version, info, overlaysDir, outDir)\n\tcase python:\n\t\tlg = newPythonGenerator(pkg, version, info, overlaysDir, outDir)\n\tcase csharp:\n\t\tlg = newCSharpGenerator(pkg, version, info, overlaysDir, outDir)\n\tcase pulumiSchema:\n\t\tlg = newSchemaGenerator(pkg, version, info, outDir)\n\tdefault:\n\t\treturn nil, errors.Errorf(\"unrecognized language runtime: %s\", language)\n\t}\n\n\treturn &generator{\n\t\tpkg: pkg,\n\t\tversion: version,\n\t\tlanguage: language,\n\t\tinfo: info,\n\t\tlg: lg,\n\t\toverlaysDir: overlaysDir,\n\t\toutDir: outDir,\n\t}, nil\n}", "title": "" }, { "docid": "65ed3858c8550df1b9544b33d10ca309", "score": "0.5368505", "text": "func BackendUIRendered() *bytes.Buffer {\n\n\tvar b1 = new(bytes.Buffer)\n\n\thtmlfrag.Wb(b1, \"filesystem interface\", \"\")\n\n\thtmlfrag.Wb(b1, \"set type\", UriSetFSType)\n\thtmlfrag.Wb(b1, \"create\", \"/fsi/create-objects\")\n\n\thtmlfrag.Wb(b1, \"query\", \"/fsi/retrieve-by-query\")\n\thtmlfrag.Wb(b1, \"readdir\", \"/fsi/retrieve-by-read-dir\")\n\thtmlfrag.Wb(b1, \"walk\", \"/fsi/walk\")\n\thtmlfrag.Wb(b1, \"remove subset\", \"/fsi/remove\")\n\n\t// htmlfrag.Wb(b1, \"delete all\", \"/fsi/delete-all\", \"all fs types\")\n\thtmlfrag.Wb(b1, \"delete tree\", UriDeleteSubtree, \"of selected fs\")\n\n\t// htmlfrag.Wb(b1, , \"\")\n\thtmlfrag.Wb(b1, \"dsfs mount\", \"nobr\")\n\thtmlfrag.Wb(b1, \"last\", \"/fsi/cntr/last\")\n\thtmlfrag.Wb(b1, \"decr\", \"/fsi/cntr/decr\")\n\thtmlfrag.Wb(b1, \"incr\", \"/fsi/cntr/incr\")\n\thtmlfrag.Wb(b1, \"reset\", \"/fsi/cntr/reset\")\n\n\treturn b1\n\n}", "title": "" }, { "docid": "51521b01e06f0b3e6035ac0a0c944f6e", "score": "0.53657484", "text": "func GenerateFile() {\n\tcomicMetaSlice := []ComicMeta{}\n\tcmch := make(chan ComicMeta)\n\tguard := make(chan struct{}, maxGoroutines)\n\tstartTime := time.Now()\n\tgo makeRequest(guard, cmch)\n\tfor i := 1; i < comicCounts; i++ {\n\t\tcomicMetaSlice = append(comicMetaSlice, <-cmch)\n\t}\n\tcostTime := time.Since(startTime).Seconds()\n\tfmt.Printf(\"cost %.2f s\\n\", costTime)\n\ttext, err := json.Marshal(comicMetaSlice)\n\tcheck(err)\n\tworkDir, wdErr := os.Getwd()\n\tcheck(wdErr)\n\toutputFilePath := workDir + \"/src/chapter4/work4_12/xkcd.json\"\n\tfmt.Println(\"outputFilePath:\", outputFilePath)\n\twriteErr := ioutil.WriteFile(outputFilePath, text, 0644)\n\tcheck(writeErr)\n}", "title": "" }, { "docid": "252380e711ab4a57da55e330c8529472", "score": "0.53587663", "text": "func newSpecialFilePath(path string) filePath {\n\t// Identify the parts we need from the full path.\n\t//\n\t// Ideally we wouldn't need to do this - each module would return\n\t// filePaths.\n\t//\n\t// The special path should look like\n\t// ${BuildDir}/filename.ext\n\t// $(TARGET_OUT_GEN)/STATIC_LIBRARIES/directory/filename.ext\n\t//\n\t// Local path should just be the basename.\n\t// Module dir should be the directory.\n\treturn generatedFilePath{path, filepath.Base(path), filepath.Dir(path)}\n}", "title": "" }, { "docid": "7920cf196b2b33caca0ae24e2f352a02", "score": "0.53582406", "text": "func generate(appDir string) {\n\tfSys := filesys.MakeFsOnDisk()\n\topts := &krusty.Options{}\n\tk := krusty.MakeKustomizer(fSys, opts)\n\tm, err := k.Run(appDir)\n\tcheck(err)\n\n\terr = emitResources(fSys, m)\n\tcheck(err)\n}", "title": "" }, { "docid": "e65cb584f3c90c94472b1e4f75d984d8", "score": "0.5351353", "text": "func GeneratorFilesGen(payload []interface{}, f func([][]string) [][]string, nomeArq string) error {\n\tstructToCsv := make([][]string, 0)\n\tif len(payload) < 1 {\n\t\treturn errors.New(\"Arquivo vazio !!! ---->\" + nomeArq)\n\t}\n\n\tfor _, a := range payload {\n\t\tb := make([]string, 0)\n\n\t\tfor _, v := range structs.Values(a) {\n\t\t\tif _, ok := v.(string); ok {\n\t\t\t\tb = append(b, fmt.Sprintf(\"%v\", v))\n\t\t\t}\n\t\t}\n\t\tstructToCsv = append(structToCsv, b)\n\t}\n\tif f != nil {\n\t\tstructToCsv = f(structToCsv)\n\t}\n\n\terr := CSVGZExport(structToCsv, nomeArq)\n\treturn err\n}", "title": "" }, { "docid": "d6cf3d568fb41d0e75d1dd0e6cd46f9b", "score": "0.53492475", "text": "func generateFile(scripts []script, tmplFile string, dest string) error {\n\tdestFile, err := os.Create(dest)\n\tif err != nil {\n\t\treturn err\n\t}\n\ttmpl, err := template.ParseFiles(tmplFile)\n\tif err != nil {\n\t\treturn err\n\t}\n\treturn tmpl.Execute(destFile, scripts)\n}", "title": "" }, { "docid": "f82128de439ca60686b77984e15d3ad4", "score": "0.53354037", "text": "func GenerateFile(data interface{}, tmplFile, tmplName, filename string, override bool) error {\n\tif !override && isFileExist(filename) {\n\t\tlog.Infof(\"file %v already exist and override=false, no need to regenerate\", filename)\n\t\treturn nil\n\t}\n\n\tif err := checkCreateDir(filepath.Dir(filename)); err != nil {\n\t}\n\n\t// pass Go function to template\n\tfuncMap := template.FuncMap{\n\t\t\"ToLower\": strings.ToLower,\n\t}\n\n\t// all template files path is relative to current directory (./)\n\t// while go-bindata files exist in templates directory\n\ttmplFile = strings.Replace(tmplFile, \"./\", \"\", -1)\n\n\tbyteData, err := templates.Asset(tmplFile)\n\tif err != nil {\n\t\treturn err\n\t}\n\n\tt, err := template.New(tmplName).Funcs(funcMap).Parse(string(byteData))\n\tif err != nil {\n\t\treturn err\n\t}\n\n\tf, err := os.Create(filename)\n\tif err != nil {\n\t\treturn err\n\t}\n\tdefer f.Close()\n\n\tlog.Infof(\"generating file %v\", filename)\n\tif err := t.ExecuteTemplate(f, tmplName, data); err != nil {\n\t\treturn err\n\t}\n\n\tswitch {\n\tcase strings.HasSuffix(filename, \".go\"):\n\t\treturn runGoFmt(filename)\n\tcase strings.HasSuffix(filename, \".py\"):\n\t\treturn runAutoPep8(filename)\n\t}\n\treturn nil\n}", "title": "" }, { "docid": "17307b03fdb78f6cf85d468e33941656", "score": "0.5327956", "text": "func GenerateFile(templateFile string, outputPath string, data interface{}) {\n\tpath := filepath.Join(\"templates\", templateFile)\n\tbody, _ := ioutil.ReadFile(path)\n\ttmpl := template.Must(template.New(\"model\").Option(\"missingkey=error\").Funcs(FuncMap).Parse(string(body)))\n\n\tvar buf bytes.Buffer\n\terr := tmpl.Execute(&buf, data)\n\tCheckErr(err)\n\n\tsrc, _ := format.Source(buf.Bytes())\n\tdstPath := filepath.Join(outputPath)\n\n\tif !util.FileExists(filepath.Dir(dstPath)) {\n\t\tif err := os.Mkdir(filepath.Dir(dstPath), 0644); err != nil {\n\t\t\tfmt.Println(err)\n\t\t}\n\t}\n\tif err := ioutil.WriteFile(dstPath, src, 0644); err != nil {\n\t\tfmt.Println(err)\n\t}\n}", "title": "" }, { "docid": "6c8190cb8632d0f1f88b53a8493b6bde", "score": "0.5315898", "text": "func filename(base string, t backend.Type, name string) string {\n\tif t == backend.Config {\n\t\treturn filepath.Join(base, \"config\")\n\t}\n\n\treturn filepath.Join(dirname(base, t, name), name)\n}", "title": "" }, { "docid": "0006c3541cb8a6b412cb2f12712a8a88", "score": "0.5309735", "text": "func Generate(ctx context.Context, outPath, specPath, moduleNameIndex string) error {\n\tcommand, cleanup, err := nodetime.Command(nodetime.CommandSTA)\n\tif err != nil {\n\t\treturn err\n\t}\n\tdefer cleanup()\n\n\tdir := filepath.Dir(outPath)\n\tfile := filepath.Base(outPath)\n\n\t// command constructs the sta command.\n\tcommand = append(command, []string{\n\t\t\"--module-name-index\",\n\t\tmoduleNameIndex,\n\t\t\"-p\",\n\t\tspecPath,\n\t\t\"-o\",\n\t\tdir,\n\t\t\"-n\",\n\t\tfile,\n\t}...)\n\n\t// execute the command.\n\treturn exec.Exec(ctx, command, exec.IncludeStdLogsToError())\n}", "title": "" }, { "docid": "f5bba9d5c129700a68ce6f67d09836d7", "score": "0.5300318", "text": "func createResource(path string, data Generator) (err error) {\n\n\tbuf, err := data.Generate()\n\tif err != nil {\n\t\treturn\n\t}\n\treturn ioutil.WriteFile(path, buf, 0644)\n\n}", "title": "" }, { "docid": "1b28e02f7b948977873a9552ab9c6be0", "score": "0.52965516", "text": "func (job *Job) createFile(dir string, format string, isLocalStorage bool) (string, string) {\n\tswitch strings.ToLower(format) {\n\tcase dataset.TXTFormat:\n\t\tif isLocalStorage {\n\t\t\treturn path.Join(dir, \"data.txt\"), \"\"\n\t\t}\n\t\treturn strings.Join([]string{dir, \"data.txt\"}, \"/\"), strings.Join([]string{dir, \"dataIndex.txt\"}, \"/\")\n\tcase dataset.CSVFormat:\n\t\treturn strings.Join([]string{dir, \"data.csv\"}, \"/\"), \"\"\n\t}\n\n\treturn \"\", \"\"\n}", "title": "" }, { "docid": "95cc1dfa017ecd3aa6cf0af85a4b05ea", "score": "0.52948153", "text": "func (gr *goResource) generate(r *raml.Resource, URI, dir string,\n\tapiFilePerMethod bool, libRootURLs []string) error {\n\tgr.GenerateMethods(r, \"go\", newServerMethod, newGoClientMethod)\n\tif err := gr.generateInterfaceFile(dir); err != nil {\n\t\treturn err\n\t}\n\tif !apiFilePerMethod {\n\t\treturn gr.generateAPIFile(dir)\n\t} else {\n\t\treturn gr.generateAPIImplementations(dir)\n\t}\n}", "title": "" }, { "docid": "574d4954741704f70036eff8fa25e8b8", "score": "0.52926433", "text": "func (gr *goResource) generate(r *raml.Resource, URI, dir string, libRootURLs []string) error {\n\tif err := gr.generateInterfaceFile(dir); err != nil {\n\t\treturn err\n\t}\n\n\tapiDir := filepath.Join(dir, serverAPIDir, gr.PackageName)\n\treturn gr.generateAPIImplementations(apiDir)\n}", "title": "" }, { "docid": "b04a7b31ad8eb7e2b6d200c374c2d53a", "score": "0.52814704", "text": "func CreateTG(tgt string) (*os.File) {\n // path, _ := filepath.Abs(\"./data\")\n tg, err := os.Create(tgt) // hardcoded for now\n if err != nil {\n log.Errorf(\"unable to create %s: %s\", tgt, err)\n os.Exit(1)\n }\n return tg\n}", "title": "" }, { "docid": "82a61a9823dff14b02da9bdb8aa843d0", "score": "0.526701", "text": "func Generate(opts *Opts) error {\n\tb, err := ioutil.ReadFile(opts.Filename)\n\tif err != nil {\n\t\treturn err\n\t}\n\t// var workingDir = filepath.Dir(opts.Filename)\n\tabsPath, err := filepath.Abs(opts.Filename)\n\tif err != nil {\n\t\treturn err\n\t}\n\n\tfset := token.NewFileSet()\n\tfile, err := parser.ParseFile(fset, opts.Filename, b, parser.ParseComments)\n\tif err != nil {\n\t\treturn err\n\t}\n\t// ast.Print(fset, file)\n\tstructs := collectStructs(file)\n\tfor _, val := range structs {\n\t\tvar buf bytes.Buffer\n\t\tgenerateCRUD(val, &buf)\n\t\tformatedContent, err := format.Source(buf.Bytes())\n\t\tif err != nil {\n\t\t\treturn err\n\t\t}\n\t\tf, err := os.OpenFile(absPath, os.O_WRONLY|os.O_APPEND, 0666)\n\t\tif err != nil {\n\t\t\treturn err\n\t\t}\n\n\t\t_, err = f.Write(formatedContent)\n\t\tif err != nil {\n\t\t\treturn err\n\t\t}\n\n\t\t// err = ioutil.WriteFile(filepath.Join(workingDir, val.Name+\"CRUD.go\"), formatedContent, 0666)\n\t\t// if err != nil {\n\t\t// \tlog.Println(err)\n\t\t// \treturn err\n\t\t// }\n\t}\n\n\treturn nil\n}", "title": "" }, { "docid": "53e3666a91d5b28c8b7b176fd53dc2fc", "score": "0.5260632", "text": "func Generate() ([]string, error) {\n\tvar (\n\t\tver string\n\t\toutDir string\n\t\tfiles []string\n\t)\n\t//these are flags passed in via the goagen tool -d -o\n\tset := flag.NewFlagSet(\"app\", flag.PanicOnError)\n\tset.String(\"design\", \"\", \"\") // Consume design argument so Parse doesn't complain\n\tset.StringVar(&ver, \"version\", \"\", \"\")\n\tset.StringVar(&outDir, \"out\", \"\", \"\")\n\tset.Parse(os.Args[2:])\n\n\t// First check compatibility\n\tif err := codegen.CheckVersion(ver); err != nil {\n\t\treturn nil, err\n\t}\n\t//generate swagger doc\n\tsFiles, err := genswagger.Generate()\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\tfiles = append(files, sFiles...)\n\n\t//generate cli client\n\tsFiles, err = genclient.Generate()\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\tfiles = append(files, sFiles...)\n\t// generate package.json\n\tsFiles, err = generators.PackageJsonGenerate()\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\tfiles = append(files, sFiles...)\n\t//generate handlers\n\tsFiles, err = generators.HandlerGenerate()\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\tfiles = append(files, sFiles...)\n\t//generate router\n\tsFiles, err = generators.RouterGenerate()\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\tfiles = append(files, sFiles...)\n\t//generate models\n\tsFiles, err = generators.ModelGenerate()\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\tfiles = append(files, sFiles...)\n\t//generate main.js\n\tsFiles, err = generators.ServerGenerate()\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\tfiles = append(files, sFiles...)\n\t//generate config\n\tsFiles, err = generators.ConfigGenerate()\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\tfiles = append(files, sFiles...)\n\n\treturn files, nil\n}", "title": "" }, { "docid": "461f5f004912a64c9cad8d61fd526bb8", "score": "0.52500105", "text": "func NewBackend(w io.Writer, opts ...BackendOption) *Backend {\n\tb := &Backend{w: w, flag: defaultFlags}\n\tfor _, o := range opts {\n\t\to(b)\n\t}\n\treturn b\n}", "title": "" }, { "docid": "eb2d0f014061b5266d2196126d382dc1", "score": "0.52491474", "text": "func Generate(arguments Arguments) error {\n\tvar err error\n\n\t// get defaults\n\targs := NewDefaultInternalArgs(arguments)\n\tinternal.Args = args\n\n\t// process args\n\terr = processArgs(args)\n\tif err != nil {\n\t\treturn err\n\t}\n\n\t// open database\n\terr = openDB(args)\n\tif err != nil {\n\t\treturn err\n\t}\n\tdefer func() {\n\t\tfor _, db := range args.DBS {\n\t\t\tdb.Close()\n\t\t}\n\t}()\n\n\tfor _, driver := range args.LoaderTypes {\n\t\tloader, ok := args.Loaders[driver]\n\t\tif !ok {\n\t\t\treturn errors.New(\"not support \" + driver)\n\t\t}\n\t\t// set current driver\n\t\targs.LoaderType = driver\n\t\targs.Loader = loader\n\n\t\tif db, ok := args.DBS[driver]; ok {\n\t\t\targs.DB = db\n\t\t} else {\n\t\t\treturn errors.New(\"not support \" + driver)\n\t\t}\n\n\t\t// load schema name\n\t\targs.Schema, err = loader.SchemaName(args)\n\t\tif err != nil {\n\t\t\treturn err\n\t\t}\n\n\t\t// load defs into type map\n\t\tif args.QueryMode {\n\t\t\terr = loader.ParseQuery(args)\n\t\t} else {\n\t\t\terr = loader.LoadSchema(args)\n\t\t}\n\t\tif err != nil {\n\t\t\treturn err\n\t\t}\n\t}\n\n\t// add schema definitions\n\terr = loadSchemaDefinition(args)\n\tif err != nil {\n\t\treturn err\n\t}\n\n\t// add extension\n\terr = loadExtension(args)\n\tif err != nil {\n\t\treturn err\n\t}\n\n\t// add xo\n\terr = args.ExecuteTemplate(internal.XOTemplate, \"xo_db\", \"\", args)\n\tif err != nil {\n\t\treturn err\n\t}\n\n\t// output\n\terr = writeTypes(args)\n\tif err != nil {\n\t\treturn err\n\t}\n\n\treturn nil\n}", "title": "" }, { "docid": "743bc946b2d76310a3dba3588b132fab", "score": "0.5246477", "text": "func (gr *goResource) generateInterfaceFile(directory string) error {\n\tfilename := directory + \"/\" + strings.ToLower(gr.Name) + \"_if.go\"\n\treturn commons.GenerateFile(gr, resourceIfTemplate, \"resource_if_template\", filename, true)\n}", "title": "" }, { "docid": "c01cbf70b918244ecca7b05d30c4df61", "score": "0.5244072", "text": "func Generate(bluezApi gen.BluezAPI, outDir string, debug bool, forceOverwrite bool) error {\n\n\tapiGroups := bluezApi.Api\n\n\terr := util.Mkdir(outDir)\n\tif err != nil {\n\t\tlog.Errorf(\"Failed to mkdir %s: %s\", outDir, err)\n\t\treturn err\n\t}\n\n\toutDir += \"/profile\"\n\terr = util.Mkdir(outDir)\n\tif err != nil {\n\t\tlog.Errorf(\"Failed to mkdir %s: %s\", outDir, err)\n\t\treturn err\n\t}\n\n\terrorsFile := path.Join(outDir, \"gen_errors.go\")\n\tif forceOverwrite || !util.Exists(errorsFile) {\n\t\terr = ErrorsTemplate(errorsFile, apiGroups)\n\t\tif err != nil {\n\t\t\treturn err\n\t\t}\n\t}\n\n\tversionFile := path.Join(outDir, \"gen_version.go\")\n\tif forceOverwrite || !util.Exists(versionFile) {\n\t\terr = VersionTemplate(versionFile, bluezApi.Version)\n\t\tif err != nil {\n\t\t\treturn err\n\t\t}\n\t}\n\n\t// filename = filepath.Join(outDir, \"interfaces.go\")\n\t// err = InterfacesTemplate(filename, apiGroups)\n\t// if err != nil {\n\t// \treturn err\n\t// }\n\n\tfor _, apiGroup := range apiGroups {\n\n\t\tif apiGroup == nil {\n\t\t\tcontinue\n\t\t}\n\n\t\tapiName := getApiPackage(apiGroup)\n\t\tdirpath := path.Join(outDir, apiName)\n\t\terr := util.Mkdir(dirpath)\n\t\tif err != nil {\n\t\t\tlog.Errorf(\"Failed to mkdir %s: %s\", dirpath, err)\n\t\t\tcontinue\n\t\t}\n\n\t\trootFile := path.Join(dirpath, fmt.Sprintf(\"gen_%s.go\", apiName))\n\n\t\tif forceOverwrite || !util.Exists(rootFile) {\n\t\t\terr = RootTemplate(rootFile, apiGroup)\n\t\t\tif err != nil {\n\t\t\t\tlog.Errorf(\"Failed to create %s: %s\", rootFile, err)\n\t\t\t\tcontinue\n\t\t\t}\n\t\t\tif debug {\n\t\t\t\tlog.Tracef(\"Wrote %s\", rootFile)\n\t\t\t}\n\t\t}\n\n\t\tfor _, api := range apiGroup.Api {\n\n\t\t\tif api == nil {\n\t\t\t\tcontinue\n\t\t\t}\n\n\t\t\tpts := strings.Split(api.Interface, \".\")\n\t\t\tapiBaseName := pts[len(pts)-1]\n\t\t\tapiBaseName = strings.Replace(apiBaseName, \" [experimental]\", \"\", -1)\n\n\t\t\tapiFilename := path.Join(dirpath, fmt.Sprintf(\"%s.go\", apiBaseName))\n\t\t\tapiGenFilename := path.Join(dirpath, fmt.Sprintf(\"gen_%s.go\", apiBaseName))\n\n\t\t\tif util.Exists(apiFilename) {\n\t\t\t\t// log.Debugf(\"Skipped generation, API file exists: %s\", apiFilename)\n\t\t\t\tcontinue\n\t\t\t}\n\n\t\t\tif !forceOverwrite && util.Exists(apiGenFilename) {\n\t\t\t\t// log.Debugf(\"Skipped, file exists: %s\", apiGenFilename)\n\t\t\t\tcontinue\n\t\t\t}\n\n\t\t\terr1 := ApiTemplate(apiGenFilename, api, apiGroup)\n\t\t\tif err1 != nil {\n\t\t\t\tlog.Errorf(\"Api generation failed %s: %s\", api.Title, err1)\n\t\t\t\treturn err1\n\t\t\t}\n\t\t\tif debug {\n\t\t\t\tlog.Tracef(\"Wrote %s\", apiGenFilename)\n\t\t\t}\n\n\t\t\tcode, err := imports.Process(apiGenFilename, nil, nil)\n\t\t\tif err != nil {\n\t\t\t\tlog.Tracef(\"format code: %s: %v\", apiGenFilename, err)\n\t\t\t}\n\n\t\t\tif err := ioutil.WriteFile(apiGenFilename, code, 0644); err != nil {\n\t\t\t\tlog.Tracef(\"rewrite with formatted code: %s\", apiGenFilename)\n\t\t\t\treturn err\n\t\t\t}\n\t\t}\n\t}\n\treturn nil\n}", "title": "" }, { "docid": "17ec64d5b82ece71100f67d64e914c53", "score": "0.52283686", "text": "func createBackend(progress text.Progress, client api.Interface, serviceID string, version int, backend Backend, undoStack undo.Stacker) error {\n\t// We don't display the fact we're creating a backend when it's for an\n\t// originless purpose as the user shouldn't have to know about this detail.\n\toriginless := backend.Name == \"originless\" && backend.Address == \"127.0.0.1\"\n\tif !originless {\n\t\tprogress.Step(fmt.Sprintf(\"Creating backend '%s' (host: %s, port: %d)...\", backend.Name, backend.Address, backend.Port))\n\t}\n\n\tundoStack.Push(func() error {\n\t\treturn client.DeleteBackend(&fastly.DeleteBackendInput{\n\t\t\tServiceID: serviceID,\n\t\t\tServiceVersion: version,\n\t\t\tName: backend.Address,\n\t\t})\n\t})\n\n\t_, err := client.CreateBackend(&fastly.CreateBackendInput{\n\t\tServiceID: serviceID,\n\t\tServiceVersion: version,\n\t\tName: backend.Name,\n\t\tAddress: backend.Address,\n\t\tPort: backend.Port,\n\t\tOverrideHost: backend.OverrideHost,\n\t\tSSLSNIHostname: backend.SSLSNIHostname,\n\t})\n\tif err != nil {\n\t\tif originless {\n\t\t\treturn fmt.Errorf(\"error configuring the service: %w\", err)\n\t\t}\n\t\treturn fmt.Errorf(\"error creating backend: %w\", err)\n\t}\n\n\treturn nil\n}", "title": "" }, { "docid": "1d665f11cf47c68d97a1b59be546b3dd", "score": "0.5219308", "text": "func (g *Generator) generate(typeName string) {\n\tf := g.getFileByTypeName(typeName)\n\tif f != nil {\n\t\trepoName := g.lcFirst(typeName) + \"BaseRepo\"\n\t\trepoNameRecv := \"*\" + repoName\n\t\ttypeNameWithPointer := \"*\" + typeName\n\n\t\t// Print the header and package clause.\n\t\tg.Printf(\"// Code generated by \\\"gormrepogen %s\\\"; DO NOT EDIT\\n\", strings.Join(os.Args[1:], \" \"))\n\t\tg.Printf(\"\\n\")\n\t\tg.Printf(\"package %s\", f.file.Name.Name)\n\t\tg.Printf(\"\\n\")\n\t\tg.Printf(\"import (\\n\")\n\t\tg.Printf(\" \\\"github.com/l-vitaly/gormrepo\\\"\\n\")\n g.Printf(\" \\\"github.com/jinzhu/gorm\\\"\\n\")\n\t\tg.Printf(\")\\n\")\n\n\t\tg.Printf(baseRepo, repoName)\n\t\tg.Printf(repoApplyCriteria, repoNameRecv)\n g.Printf(repoRelated, repoNameRecv, typeNameWithPointer)\n\t\tg.Printf(repoGet, repoNameRecv, typeNameWithPointer, typeName)\n\t\tg.Printf(repoGetAll, repoNameRecv, typeNameWithPointer)\n\t\tg.Printf(repoGetBy, repoNameRecv, typeNameWithPointer)\n\t\tg.Printf(repoGetByFirst, repoNameRecv, typeNameWithPointer, typeName)\n\t\tg.Printf(repoGetByLast, repoNameRecv, typeNameWithPointer, typeName)\n\t\tg.Printf(repoCreate, repoNameRecv, typeName, typeNameWithPointer)\n\t\tg.Printf(repoUpdate, repoNameRecv, typeNameWithPointer)\n g.Printf(repoDelete, repoNameRecv, typeNameWithPointer)\n\t\tg.Printf(repoAutomigrate, repoNameRecv, typeName)\n g.Printf(repoAddUniqueIndex, repoNameRecv, typeName)\n g.Printf(repoAddForeignKey, repoNameRecv, typeName)\n g.Printf(repoAddIndex, repoNameRecv, typeName)\n\n\t\t//Format the output.\n\t\tsrc := g.format()\n\n\t\tabsPath, _ := filepath.Abs(f.name)\n\t\tdir := filepath.Dir(absPath)\n\n\t\tbaseName := fmt.Sprintf(\"%s_base_repo.go\", typeName)\n\t\toutputName := filepath.Join(dir, strings.ToLower(baseName))\n\n\t\terr := ioutil.WriteFile(outputName, src, 0644)\n\t\tif err != nil {\n\t\t\tlog.Fatalf(\"writing output: %s\", err)\n\t\t}\n\n\t\tfmt.Printf(\"Type %s repository is generated: %s\\n\", typeName, outputName)\n\n\t\tg.buf.Reset()\n\t} else {\n\t\tfmt.Printf(\"Type %s is not found\\n\", typeName)\n\t}\n}", "title": "" }, { "docid": "05a2dba3740a28625c10aeaf481cd050", "score": "0.5210051", "text": "func (d *Descriptor) GenerateDescriptorFileForGQLGen(pl *protogen.Plugin) error {\n\tindent, err := json.MarshalIndent(d, \"\", \" \")\n\tif err != nil {\n\t\treturn errors.Wrap(err, \"unable to marshal into json descriptor\")\n\t}\n\n\tg := pl.NewGeneratedFile(\"graphql/descriptor.json\", \"\")\n\t_, err = g.Write(indent)\n\tif err != nil {\n\t\treturn errors.Wrap(err, \"unable to write into generated file\")\n\t}\n\n\treturn nil\n}", "title": "" }, { "docid": "ccf4bc5fe4d7dddfd2672d20ab7fa6a6", "score": "0.52090734", "text": "func createModuleTF(modName string, content string) error {\n\n\tfmt.Sprintf(\"Creating zone name %s module configuration file...\", modName)\n\tnamedmodulePath := createNamedModulePath(modName)\n\tif !createDirectory(namedmodulePath) {\n\t\treturn fmt.Errorf(\"Failed to create name module folder: %s\", namedmodulePath)\n\t}\n\tmoduleFilename := filepath.Join(namedmodulePath, normalizeResourceName(modName)+\".tf\")\n\tif _, err := os.Stat(moduleFilename); err == nil {\n\t\t// File exists.\n\t\treturn fmt.Errorf(\"Zone record name config already exists: %s\", moduleFilename)\n\t}\n\tf, err := os.Create(moduleFilename)\n\tif err != nil {\n\t\treturn fmt.Errorf(\"Failed to create name module configuration file: %s\", namedmodulePath)\n\t}\n\tdefer f.Close()\n\t_, err = f.WriteString(content)\n\tif err != nil {\n\t\treturn fmt.Errorf(\"Failed to write name module configuration: %s\", namedmodulePath)\n\t}\n\tf.Sync()\n\n\treturn nil\n}", "title": "" }, { "docid": "6074df82cef01d0eee6a675da6bf13b1", "score": "0.5202311", "text": "func GenControlersAPI(db *gorm.DB) string {\n\n\tcontrollersCodeReg := \"\"\n\n\t// create the list of structs\n\tvar structs []models.Struct\n\tdb.Find(&structs)\n\n\tfor _, _struct := range structs {\n\t\tfilename := filepath.Join(ApiPkgGenPath, fmt.Sprintf(\"%s.go\", _struct.Name))\n\n\t\t// we should use go generate\n\t\tlog.Println(\"generating controller file : \" + filename)\n\n\t\tf, err := os.Create(filename)\n\t\tif err != nil {\n\t\t\tlog.Panic(err)\n\t\t}\n\n\t\tlowerCaseStructName := strings.ToLower(_struct.Name)\n\n\t\tres := controlerTemplateAPI\n\t\tres = strings.ReplaceAll(res, \"{{Structname}}\", _struct.Name)\n\t\tres = strings.ReplaceAll(res, \"{{structname}}\", lowerCaseStructName)\n\n\t\tres = strings.ReplaceAll(res, \"{{PkgPathRoot}}\", strings.ReplaceAll(PkgGoPath, \"/models\", \"\"))\n\n\t\tfmt.Fprintf(f, \"%s\", res)\n\n\t\tdefer f.Close()\n\n\t}\n\treturn controllersCodeReg\n}", "title": "" }, { "docid": "028a4980f563b218988040d4907a1faa", "score": "0.5200986", "text": "func (ps Server) Generate(dir string) error {\n\n\tglobAPIDef = ps.APIDef\n\t// generate input validators helper\n\tif err := commons.GenerateFile(struct{}{}, \"./templates/input_validators_python.tmpl\", \"input_validators_python\",\n\t\tfilepath.Join(dir, \"input_validators.py\"), false); err != nil {\n\t\treturn err\n\t}\n\n\t// generate request body\n\tif err := generateClassesFromBodies(getAllResources(ps.APIDef, true), dir); err != nil {\n\t\treturn err\n\t}\n\n\t// python classes\n\tif err := generateClasses(ps.APIDef.Types, dir); err != nil {\n\t\tlog.Errorf(\"failed to generate python clased:%v\", err)\n\t\treturn err\n\t}\n\n\t// security scheme\n\tif err := generateSecurity(ps.APIDef.SecuritySchemes, dir); err != nil {\n\t\tlog.Errorf(\"failed to generate security scheme:%v\", err)\n\t\treturn err\n\t}\n\n\t// genereate resources\n\trds, err := generateServerResources(ps.APIDef, dir)\n\tif err != nil {\n\t\treturn err\n\t}\n\tps.ResourcesDef = rds\n\n\t// libraries\n\tif err := generateLibraries(ps.APIDef.Libraries, dir); err != nil {\n\t\treturn err\n\t}\n\n\t// requirements.txt file\n\tif err := commons.GenerateFile(nil, \"./templates/requirements_python.tmpl\", \"requirements_python\", filepath.Join(dir, \"requirements.txt\"), false); err != nil {\n\t\treturn err\n\t}\n\n\t// generate main\n\tif ps.WithMain {\n\t\t// generate HTML front page\n\t\tif err := commons.GenerateFile(ps, \"./templates/index.html.tmpl\", \"index.html\", filepath.Join(dir, \"index.html\"), false); err != nil {\n\t\t\treturn err\n\t\t}\n\t\t// main file\n\t\treturn commons.GenerateFile(ps, \"./templates/server_main_python.tmpl\", \"server_main_python\", filepath.Join(dir, \"app.py\"), true)\n\t}\n\treturn nil\n\n}", "title": "" }, { "docid": "97d5c72d2246f6f45fbf62d254f7873b", "score": "0.5196667", "text": "func newFile(dataSources []dataSource, opts LoadOptions) *File {\n\treturn &File{\n\t\tBlockMode: true,\n\t\tdataSources: dataSources,\n\t\tsections: make(map[string]*Section),\n\t\tsectionList: make([]string, 0, 10),\n\t\toptions: opts,\n\t}\n}", "title": "" }, { "docid": "064c52af3018bbf00eca5bc0d935f112", "score": "0.51939726", "text": "func Generate(w io.Writer, s *schema.Schema) error {\n\tfmt.Fprintf(w, module)\n\tgenerateTypes(w, s)\n\tgenerateMethodTypes(w, s)\n\tgenerateMethodFuncs(w, s)\n\tgenerateDecoderFuncs(w, s)\n\treturn nil\n}", "title": "" }, { "docid": "9f271a23b71fd45975963939cd60e47e", "score": "0.51922065", "text": "func createSingleFileOneLevelsAboveNgTargetPath(filename string) (file *os.File) {\n\tvar err error\n\n\tpathToLibDir := filepath.Join(MatTargetPath, \"..\")\n\n\tpath := filepath.Join(pathToLibDir, filename)\n\n\tlog.Println(\"generating : \" + path)\n\n\tfile, err = os.Create(path)\n\tif err != nil {\n\t\tlog.Panic(err)\n\t}\n\n\treturn file\n}", "title": "" }, { "docid": "aa85af7fcdb1fb3487c4ce78e055205a", "score": "0.5191548", "text": "func NewBackend(options Options) (backend *Backend) {\n\treturn &Backend{\n\t\tpath: options.Path,\n\t}\n}", "title": "" }, { "docid": "fda53c81f8bb6b54be9f62b2e918cb7e", "score": "0.5185656", "text": "func (gr *goResource) generateInterfaceFile(directory string) error {\n\tgr.SortMethods()\n\tfilename := directory + \"/\" + strings.ToLower(gr.Name) + \"_if.go\"\n\treturn commons.GenerateFile(gr, resourceIfTemplate, \"resource_if_template\", filename, true)\n}", "title": "" }, { "docid": "71abc4c043d0dc5c2f2c186b6614977a", "score": "0.5180221", "text": "func newFile(name string, content []byte, perm os.FileMode) file {\n\treturn file{\n\t\tName: name,\n\t\tDir: false,\n\t\tMode: perm,\n\t\tModTime: time.Now(),\n\t\tBuffer: bytes.NewBuffer(content),\n\t}\n}", "title": "" }, { "docid": "172b8ad7e10f4ae342ea986b0a24b565", "score": "0.51778865", "text": "func generatePolicyFile(tempDir string) string {\n\tkeyPath := filepath.Join(tempDir, \"key.gpg\")\n\tpolicyPath := filepath.Join(tempDir, \"policy.json\")\n\tconf := fmt.Sprintf(`\n{\n \"default\": [\n {\n \"type\": \"insecureAcceptAnything\"\n }\n ],\n \"transports\": {\n \"docker\": {\n \"localhost:5000\": [\n {\n \"type\": \"signedBy\",\n \"keyType\": \"GPGKeys\",\n \"keyPath\": \"%s\"\n }\n ],\n \"localhost:5000/sigstore-signed\": [\n {\n \"type\": \"sigstoreSigned\",\n \"keyPath\": \"testdata/sigstore-key.pub\"\n }\n ],\n \"localhost:5000/sigstore-signed-params\": [\n {\n \"type\": \"sigstoreSigned\",\n \"keyPath\": \"testdata/sigstore-key.pub\"\n }\n ]\n }\n }\n}\n`, keyPath)\n\twriteConf([]byte(conf), policyPath)\n\treturn policyPath\n}", "title": "" }, { "docid": "641ebd0660ba7e639ec4ecc1b8fc32dd", "score": "0.5176745", "text": "func GenCfgFile(args domain.GenCfgFileArgs) error {\n\tif err := ValidateGenCfgFileArgs(args); err != nil {\n\t\treturn errors.Wrap(err, \"failed to validate arguments\")\n\t}\n\treader := args.Reader\n\tcfgUC := args.CfgUC\n\tgenerater := args.Generator\n\texecuter := args.Executer\n\tdest := args.Dest\n\ttmplPath := args.TmplPath\n\n\t// read and parse the config from file\n\tconfig, err := args.CfgReader.Read(args.Src)\n\tif err != nil {\n\t\treturn errors.Wrap(err, \"failed to read configuration file\")\n\t}\n\tcfgUC.Update(&config)\n\ttd := domain.TemplateData{\n\t\tCfg: config,\n\t\tCfgUC: cfgUC,\n\t\tEnvUC: args.EnvUC,\n\t\tFlagUC: args.FlagUC,\n\t\tParamUC: args.ParamUC}\n\n\t// set config.Dest\n\tif dest == \"\" {\n\t\tif config.Dest != \"\" {\n\t\t\tdest = config.Dest\n\t\t} else {\n\t\t\tdest = \"cfg/cfg.go\"\n\t\t}\n\t}\n\n\tif err := validateDest(dest); err != nil {\n\t\treturn errors.Wrap(err, fmt.Sprintf(\"failed to validate dest: %s\", dest))\n\t}\n\n\t// set code template\n\tcfgTmpl := DefaultCfgTmpl\n\tif tmplPath != \"\" {\n\t\tcfgTmpl, err = reader.Read(tmplPath)\n\t\tif err != nil {\n\t\t\treturn errors.Wrap(\n\t\t\t\terr, fmt.Sprintf(\"failed to read the template file: %s\", tmplPath))\n\t\t}\n\t} else {\n\t\tif config.TemplatePath != \"\" {\n\t\t\tcfgTmpl, err = reader.Read(config.TemplatePath)\n\t\t\tif err != nil {\n\t\t\t\treturn errors.Wrap(\n\t\t\t\t\terr, fmt.Sprintf(\n\t\t\t\t\t\t\"failed to read the template file: %s\", config.TemplatePath))\n\t\t\t}\n\t\t}\n\t}\n\n\t// generate code file\n\tif err := generater.Exec(dest, strings.Trim(cfgTmpl, \"\\n\"), td); err != nil {\n\t\treturn errors.Wrap(err, fmt.Sprintf(\"failed to generate code: %s\", dest))\n\t}\n\n\t// format code file by formatters\n\tif len(config.Formatters) != 0 {\n\t\tfor _, formatter := range config.Formatters {\n\t\t\tif err := executer.Exec(formatter, dest); err != nil {\n\t\t\t\treturn errors.Wrap(\n\t\t\t\t\terr, fmt.Sprintf(\n\t\t\t\t\t\t\"failed to format code by command: %s %s\", formatter, dest))\n\t\t\t}\n\t\t}\n\t}\n\n\treturn nil\n}", "title": "" }, { "docid": "cba1a0c853cb4a5be5e7376457b38d64", "score": "0.51634383", "text": "func NewBackend(id int, info PathInfo) Backend {\n\tlog := logrus.New().WithFields(logrus.Fields{\n\t\t\"type\": \"backend\",\n\t\t\"backend_id\": id,\n\t\t\"host\": info.Host,\n\t\t\"path\": info.Prefix,\n\t})\n\tlog.Logger = logrus.StandardLogger()\n\n\tself := backendStruct{\n\t\tid,\n\t\tinfo,\n\t\tlog,\n\t\tmake(chan chan progressCmd),\n\t\tmake(chan chan net.Conn, 1000),\n\t\tmake(chan progressCmd),\n\t\tmake(chan bool),\n\t\tfalse,\n\t\tnil,\n\t}\n\tgo progressBroker(self.progress, self.subscribeProgress)\n\tgo self.monitor()\n\n\treturn &self\n}", "title": "" }, { "docid": "2e4c93a618cd5955ccdc51b7a679b22b", "score": "0.51506495", "text": "func MakeFilesCreateEndpoint(svc FilesCreatorService) endpoint.Endpoint {\n\treturn func(ctx context.Context, request interface{}) (interface{}, error) {\n\t\treq := request.(FilesCreateRequest)\n\t\tmsg, err := svc.Create(req.FileDescriptor)\n\t\treturn FilesCreateResponse{Message:msg, Err:err}, nil\n\t\t//var (\n\t\t//\ttxt string\n\t\t//\tparam string\n\t\t//)\n\t\t//\n\t\t//param = req.Param\n\t\t//\n\t\t//if strings.EqualFold(req.RequestType, \"Word\") {\n\t\t//\t//Word referring to Word method of our interface FilesCreatorService\n\t\t//\ttxt = svc.Word(param)\n\t\t//} else {\n\t\t//\treturn nil, ErrRequestTypeNotFound\n\t\t//}\n\t\t//return FilesCreateResponse{Message: txt}, nil\n\n\t}\n}", "title": "" }, { "docid": "b9f9c6420def22ad2b7dbb0e752fd0d7", "score": "0.51491266", "text": "func generateWithHeaderFile(f func(string) error) (err error) {\n\ti, err := (&scaffold.Boilerplate{}).GetInput()\n\tif err != nil {\n\t\treturn err\n\t}\n\thf := i.Path\n\tif _, err := os.Stat(hf); os.IsNotExist(err) {\n\t\tif hf, err = createEmptyTmpFile(); err != nil {\n\t\t\treturn err\n\t\t}\n\t\tdefer func() {\n\t\t\tif err = os.RemoveAll(hf); err != nil {\n\t\t\t\tlog.Error(err)\n\t\t\t}\n\t\t}()\n\t}\n\treturn f(hf)\n}", "title": "" }, { "docid": "4153a42dc1654897799ae969ea5ee6bd", "score": "0.51425594", "text": "func Generate(path string, codec IndexCodec) error {\n\tstore, err := mmap.Open(path)\n\tif err != nil {\n\t\treturn err\n\t}\n\tidx, err := GenerateIndex(store, 0, codec, false)\n\tif err != nil {\n\t\treturn err\n\t}\n\n\treturn Save(idx, path)\n}", "title": "" }, { "docid": "66fb4c61014664b6470f801ba0e36091", "score": "0.51374775", "text": "func generatedFileName() string {\n\treturn fmt.Sprintf(\"%v.go\", uuid.New())\n}", "title": "" }, { "docid": "91bf213852621be2211e8e568a7155c9", "score": "0.5136484", "text": "func Generate() error {\n\tcfg := config.GetGlobalConfig()\n\tdb := sqlx.MustConnect(cfg.DriverName, cfg.DSN)\n\tdefer func(db *sqlx.DB) {\n\t\terr := db.Close()\n\t\tif err != nil {\n\t\t\tfmt.Println(\"Warning: DB connection close failed.\", err)\n\t\t}\n\t}(db)\n\terr := db.Ping()\n\tif err != nil {\n\t\treturn err\n\t}\n\tvar code string\n\tswitch cfg.DriverName {\n\tcase \"mysql\":\n\t\tcode, err = mysql.GenerateCode(db)\n\tcase \"postgres\":\n\t\terr = errors.New(\"TODO: postgresql driver\")\n\tcase \"sqlite3\":\n\t\terr = errors.New(\"TODO: sqlite3 driver\")\n\tcase \"mssql\":\n\t\terr = errors.New(\"TODO: mssql driver\")\n\tdefault:\n\t\terr = errors.New(\"unknown driver type\")\n\t}\n\tif err == nil {\n\t\terr = WriteCodeToFile(cfg, code)\n\t}\n\tif err == nil {\n\t\tcmd := exec.Command(\"gofmt\", \"-w\", cfg.FilePath)\n\t\terr = cmd.Run()\n\t}\n\treturn err\n}", "title": "" }, { "docid": "83e87e855919151dd6e12dbfca08a22d", "score": "0.51338", "text": "func (r *Renter) makeNewFile(up *fileUpload) (*core.File, error) {\n\tfileId, err := util.GenerateID()\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\taesKeyEncrypted, err := rsa.EncryptOAEP(sha256.New(), rand.Reader, &r.privKey.PublicKey, up.aesKey, nil)\n\tif err != nil {\n\t\treturn nil, fmt.Errorf(\"Unable to encrypt aes key. Error: %s\", err)\n\t}\n\taesIVEncrypted, err := rsa.EncryptOAEP(sha256.New(), rand.Reader, &r.privKey.PublicKey, up.aesIV, nil)\n\tif err != nil {\n\t\treturn nil, fmt.Errorf(\"Unable to encrypt aes IV. Error: %s\", err)\n\t}\n\tversions := []core.Version{\n\t\t*up.version,\n\t}\n\tfile := &core.File{\n\t\tID: fileId,\n\t\tOwnerID: r.Config.RenterId,\n\t\tOwnerAlias: r.Config.Alias,\n\t\tName: up.destPath,\n\t\tIsDir: false,\n\t\tAccessList: []core.Permission{},\n\t\tAesKey: base64.URLEncoding.EncodeToString(aesKeyEncrypted),\n\t\tAesIV: base64.URLEncoding.EncodeToString(aesIVEncrypted),\n\t\tVersions: versions,\n\t}\n\treturn file, nil\n}", "title": "" }, { "docid": "8a876122fab291c2e28c0e3211a634b7", "score": "0.5131077", "text": "func (g *Generator) Generate(req *common.Req, res *common.Res) error {\n\to := &common.Op{\n\t\tName: \"dockerfiles\",\n\t\tTemplate: DockerfileTemplate,\n\t\tPathFunc: pathfunc,\n\t\tDoNotFormat: true,\n\t}\n\n\treturn common.Proces(o, req, res)\n}", "title": "" }, { "docid": "69701ba070282c2237446c2e40552460", "score": "0.5126602", "text": "func Create(file string, config *Config, providerModels *ProviderModels, prefix, indent string, marshalFunc MarshalIndentFunc) error {\n\tif config == nil {\n\t\tconfig = &Config{\n\t\t\tLogging: &Logging{\n\t\t\t\tLevel: 4,\n\t\t\t},\n\t\t\tWebServer: &webserver.Config{\n\t\t\t\tAddr: \":443\",\n\t\t\t\tSessions: &webserver.ConfigSessions{\n\t\t\t\t\tDefaultMaxAge: 3600,\n\t\t\t\t\tRememberMaxAge: 3600 * 24 * 30,\n\t\t\t\t},\n\t\t\t\tTLS: new(webserver.ConfigTLS),\n\t\t\t},\n\t\t\tProviders: providerModels,\n\t\t}\n\t}\n\n\tfHandle, err := os.Create(file)\n\tif err != nil {\n\t\treturn err\n\t}\n\tdefer fHandle.Close()\n\n\tbData, err := marshalFunc(config, prefix, indent)\n\tif err != nil {\n\t\treturn err\n\t}\n\n\t_, err = fHandle.Write(bData)\n\treturn err\n}", "title": "" }, { "docid": "771fef060a4f542c7ea94f03656c51d2", "score": "0.5112964", "text": "func TechnicianAddFile(w http.ResponseWriter, r *http.Request) {}", "title": "" }, { "docid": "c77d75ac922c9f971b5227e778e6d973", "score": "0.5109742", "text": "func (o *ObjectStoragePath) Generate(mode imageentity.Mode, filePath string) (*FilePath, error) {\n\tvar file FilePath\n\tif err := mode.Validate(); err != nil {\n\t\treturn nil, err\n\t}\n\n\tswitch mode {\n\tcase imageentity.ModePublic:\n\t\tu, err := url.Parse(o.config.Public.DownloadProto + o.config.Public.DownloadHost + o.config.Public.DownloadPort)\n\t\tif err != nil {\n\t\t\treturn nil, err\n\t\t}\n\t\tu.Path = path.Join(u.Path, o.config.Public.DownloadPath, filePath)\n\n\t\tfile = FilePath{\n\t\t\tProto: o.config.Public.DownloadProto,\n\t\t\tHost: o.config.Public.DownloadHost,\n\t\t\tFilePath: filePath,\n\t\t\tDownloadPath: path.Join(o.config.Public.DownloadPath, filePath),\n\t\t\tDownloadLink: u.String(),\n\t\t}\n\n\tcase imageentity.ModePrivate:\n\t\tu, err := url.Parse(o.config.Private.DownloadProto + o.config.Private.DownloadHost + o.config.Private.DownloadPort)\n\t\tif err != nil {\n\t\t\treturn nil, err\n\t\t}\n\t\tu.Path = path.Join(u.Path, o.config.Private.DownloadPath)\n\n\t\tv := u.Query()\n\t\tv.Add(\"image_path\", filePath)\n\t\tu.RawQuery = v.Encode()\n\n\t\tfile = FilePath{\n\t\t\tProto: o.config.Private.DownloadProto,\n\t\t\tHost: o.config.Private.DownloadHost,\n\t\t\tFilePath: filePath,\n\t\t\tDownloadPath: path.Join(o.config.Private.DownloadPath, filePath),\n\t\t\tDownloadLink: u.String(),\n\t\t}\n\n\tcase imageentity.ModeSigned:\n\t\tfile = FilePath{\n\t\t\tProto: \"\",\n\t\t\tHost: \"\",\n\t\t\tFilePath: \"\",\n\t\t\tDownloadPath: \"\",\n\t\t\tDownloadLink: filePath,\n\t\t\tSigned: true,\n\t\t}\n\t}\n\treturn &file, nil\n}", "title": "" }, { "docid": "87870d4b6cb76e6935e1ef5c936b8b19", "score": "0.510569", "text": "func Generate() {\n\tctx, cancel := context.WithCancel(context.Background())\n\tdefer cancel()\n\n\tshouldWork(ctx, nil, wd, \"statik\", \"-src\", \"./facts\", \"-f\")\n\tshouldWork(ctx, nil, filepath.Join(wd, \"rpc\", \"printerfacts\"), \"sh\", \"./regen.sh\")\n\tfmt.Println(\"reran code generation\")\n\n\tfin, err := os.Open(\"./rpc/printerfacts/printerfacts_twirp.js\")\n\tif err != nil {\n\t\tlog.Fatal(err)\n\t}\n\tdefer fin.Close()\n\n\tfout, err := os.Create(\"./facts/printerfacts_twirp.js\")\n\tif err != nil {\n\t\tlog.Fatal(err)\n\t}\n\tdefer fout.Close()\n\n\tio.Copy(fout, fin)\n}", "title": "" }, { "docid": "1a651ba0c0964784481169f79ee19f16", "score": "0.5104394", "text": "func Generate(out io.Writer, tmplPath string, config *File) error {\n\tvar err error\n\tvar t *template.Template\n\n\tif tmplPath != \"\" {\n\t\tt, err = template.ParseFiles(tmplPath)\n\t\tif err != nil {\n\t\t\treturn fmt.Errorf(\"unable to parse template %s: %s\", tmplPath, err)\n\t\t}\n\t} else {\n\t\tt, err = template.New(\"singularity.conf\").Parse(TemplateAsset)\n\t\tif err != nil {\n\t\t\treturn fmt.Errorf(\"unable to create template: %s\", err)\n\t\t}\n\t}\n\n\tif err := t.Execute(out, config); err != nil {\n\t\treturn fmt.Errorf(\"unable to execute template text for %s on %v: %v\", t.Name(), config, err)\n\t}\n\n\treturn nil\n}", "title": "" }, { "docid": "08cd8faf15031f092a8598bdae6b9645", "score": "0.51043826", "text": "func Generate() error {\n\tflag.Parse()\n\n\tdefs, err := readDefinitions(*inputSpec)\n\tif err != nil {\n\t\treturn err\n\t}\n\n\t// Write out the concatenated spec.\n\tvar spec bytes.Buffer\n\tfor _, def := range defs {\n\t\tspec.WriteString(def.Docstring)\n\t\tspec.WriteByte('\\n')\n\t\tjson.Indent(&spec, def.JSON, \"\", \" \")\n\t\tspec.WriteString(\"\\n\\n\")\n\t}\n\tif err = ioutil.WriteFile(*outputSpec, spec.Bytes(), 0640); err != nil {\n\t\treturn err\n\t}\n\t// Generate and write out the code.\n\tsymbols, err := parse(defs)\n\tif err != nil {\n\t\treturn err\n\t}\n\tneed := neededTypes(symbols)\n\tbs, err := renderAPI(*templates, symbols, need)\n\tif err != nil {\n\t\treturn err\n\t}\n\tformatted, err := format.Source(bs)\n\tif err != nil {\n\t\t// Ignore the error, we're just trying to write out the\n\t\t// unformatted code to help debugging.\n\t\tioutil.WriteFile(*outputGo, bs, 0640)\n\t\treturn err\n\t}\n\tif err = ioutil.WriteFile(*outputGo, formatted, 0640); err != nil {\n\t\treturn err\n\t}\n\n\treturn nil\n}", "title": "" }, { "docid": "f38f628b2f172b0a98793333e0ac2eb9", "score": "0.5104207", "text": "func (s UnisonSvc) CreateSyncFile() {\n}", "title": "" }, { "docid": "4ab10ebb39646e8913186bdd6d943e08", "score": "0.5100912", "text": "func GenerateNew(s CreateSettings) {\n\ttemplates.CreateMain(s.ProjectName, s.GoPath)\n\ttemplates.CreateSettings(s.ProjectName, s.DbName)\n\n\tcreateServerFolder(s.ProjectName, s.FullPath)\n\ttemplates.CreateServer(s.ProjectName, s.FullPath, s.GoPath)\n\n\tcreateParamsFolder(s.ProjectName, s.FullPath)\n\ttemplates.CreateParams(s.ProjectName, s.FullPath)\n\n\tcreateDbFolder(s.ProjectName, s.FullPath)\n\tcreateMigrationsFolder(s.ProjectName, s.FullPath)\n\ttemplates.CreateDbConf(s.ProjectName, s.FullPath, s.DbName, s.DbUser, s.DbPassword)\n\n\tcreateApiFolder(s.ProjectName, s.FullPath)\n\ttemplates.CreateAPI(s.ProjectName, s.FullPath)\n\ttemplates.CreateEndpoint(s.ProjectName, s.FullPath)\n\ttemplates.CreateErrors(s.ProjectName, s.FullPath)\n\ttemplates.CreateInit(s.ProjectName, s.FullPath)\n\ttemplates.CreateInterface(s.ProjectName, s.FullPath)\n\ttemplates.CreateOption(s.ProjectName, s.FullPath)\n\ttemplates.CreateOptionMethod(s.ProjectName, s.FullPath)\n\ttemplates.CreateRequest(s.ProjectName, s.FullPath, s.GoPath)\n\ttemplates.CreateResponse(s.ProjectName, s.FullPath)\n\ttemplates.CreateTree(s.ProjectName, s.FullPath, s.GoPath)\n\ttemplates.CreateWrite(s.ProjectName, s.FullPath)\n\n\tcreateV1Folder(s.ProjectName, s.FullPath)\n\ttemplates.CreateV1(s.ProjectName, s.FullPath)\n}", "title": "" }, { "docid": "01c95caab33c7214880a66cfc80e14df", "score": "0.5098815", "text": "func (d *demo) createFile(fileName string) {\n\t//Prints to the webpage that the file is being created in a bucket with a filename.\n\tfmt.Fprintf(d.w, \"Creating file /%v/%v\\n\", bucket, fileName)\n\t//Appears to be a writer for google cloud.\n\twc := d.bucket.Object(fileName).NewWriter(d.ctx)\n\t//Data\n\twc.ContentType = \"text/plain\"\n\t//More Data\n\twc.Metadata = map[string]string{\n\t\t\"x-goog-meta-foo\": \"foo\",\n\t\t\"x-goog-meta-bar\": \"bar\",\n\t}\n\t//Need to look up what this does.\n\td.cleanUp = append(d.cleanUp, fileName)\n\t//Writing to the writer abcde\\n\n\tif _, err := wc.Write([]byte(\"abcde\\n\")); err != nil {\n\t\tlog.Errorf(d.ctx, \"createFile: unable to write data to bucket %q, file %q: %v\", bucket, fileName, err)\n\t\treturn\n\t}\n\t//Writing to the writer a lot of f and then a new one.\n\tif _, err := wc.Write([]byte(strings.Repeat(\"f\", 1024*4) + \"\\n\")); err != nil {\n\t\tlog.Errorf(d.ctx, \"createFile: unable to write data to bucket %q, file %q: %v\", bucket, fileName, err)\n\t\treturn\n\t}\n\t//Closes the writer.\n\tif err := wc.Close(); err != nil {\n\t\tlog.Errorf(d.ctx, \"createFile: unable to close bucket %q, file %q: %v\", bucket, fileName, err)\n\t\treturn\n\t}\n}", "title": "" }, { "docid": "867ea29ee34104d5a36affc1b0765ffd", "score": "0.50961345", "text": "func main() {\n\tif len(os.Args) > 1 {\n\t\tfmt.Fprintf(os.Stderr, \"coremodel code generator does not currently accept any arguments\\n, got %q\", os.Args)\n\t\tos.Exit(1)\n\t}\n\twd := gcgen.NewWriteDiffer()\n\n\t// TODO generating these is here temporarily until we make a more permanent home\n\twdsh, err := genSharedSchemas(groot)\n\tif err != nil {\n\t\tfmt.Fprintf(os.Stderr, \"TS gen error for shared schemas in %s: %w\", filepath.Join(groot, \"packages\", \"grafana-schema\", \"src\", \"schema\"), err)\n\t\tos.Exit(1)\n\t}\n\twd.Merge(wdsh)\n\n\tif _, set := os.LookupEnv(\"CODEGEN_VERIFY\"); set {\n\t\terr = wd.Verify()\n\t\tif err != nil {\n\t\t\tfmt.Fprintf(os.Stderr, \"generated code is not up to date:\\n%s\\nrun `make gen-cue` to regenerate\\n\\n\", err)\n\t\t\tos.Exit(1)\n\t\t}\n\t} else {\n\t\terr = wd.Write()\n\t\tif err != nil {\n\t\t\tfmt.Fprintf(os.Stderr, \"error while writing generated code to disk:\\n%s\\n\", err)\n\t\t\tos.Exit(1)\n\t\t}\n\t}\n}", "title": "" }, { "docid": "810ba8f9c74ff9a394453e459c4ac549", "score": "0.50939685", "text": "func createFile(bytes []byte, filepath string) error {\n\terr := ioutil.WriteFile(filepath, bytes, 0644)\n\tif err != nil {\n\t\treturn err\n\t}\n\treturn nil\n}", "title": "" }, { "docid": "75024d8ecbb4a7ac5abcf10c1f12ee18", "score": "0.50931835", "text": "func createFile(finalConfig string) error {\n\toutputFile, err := os.Create(\"challenge.out\")\n\tif err != nil {\n\t\treturn err\n\t}\n\n\t// Write the information in the file\n\toutputFile.WriteString(finalConfig)\n\tdefer outputFile.Close()\n\n\treturn nil\n}", "title": "" }, { "docid": "715c52c54c76ec25957ef717ed3ca453", "score": "0.508989", "text": "func make_file() {\n\tf,_,_ := pdf.OpenFile(OutputDirectory + \"/test-file.pdf\", os.O_RDWR|os.O_CREATE)\n\to1 := pdf.NewIndirect()\n\tindirect1 := f.WriteObject(o1)\n\to1.Write(pdf.NewNumeric(3.14))\n\n\tindirect2 := f.WriteObject(pdf.NewNumeric(2.718))\n\n\tf.WriteObject(pdf.NewName(\"foo\"))\n\n\t// Delete the *indirect reference* to the 3.14 numeric\n\tf.DeleteObject(indirect1)\n\tf.WriteObject(pdf.NewNumeric(3))\n\n\t// Delete the 2.718 numeric object itself\n\tf.DeleteObject(indirect2)\n\n\tp := pdf.NewPageFactory().New(f)\n\tp.SetParent(indirect1)\n\tp.SetMediaBox(0, 0, 612, 792)\n\tp.Finish()\n\n\tcatalog := pdf.NewDictionary()\n\tcatalog.Add(\"Type\", pdf.NewName(\"Catalog\"))\n\tf.SetCatalog(catalog)\n\n\tf.Close()\n}", "title": "" }, { "docid": "177924108ec5f15d3ef6f9e2d52eb370", "score": "0.5087026", "text": "func Backend(c *logical.BackendConfig) *backend {\n\tvar b backend\n\n\tb.logger = c.Logger\n\n\tb.Backend = &framework.Backend{\n\t\tBackendType: logical.TypeLogical,\n\t\tHelp: backendHelp,\n\t\tPaths: []*framework.Path{\n\t\t\t// gen/info\n\t\t\t&framework.Path{\n\t\t\t\tPattern: \"info\",\n\t\t\t\tHelpSynopsis: \"Display information about this plugin\",\n\t\t\t\tHelpDescription: `\n\nDisplays information about the plugin, such as the plugin version and where to\nget help.\n\n`,\n\t\t\t\tCallbacks: map[logical.Operation]framework.OperationFunc{\n\t\t\t\t\tlogical.ReadOperation: b.pathInfo,\n\t\t\t\t},\n\t\t\t},\n\n\t\t\t// oauth2/powerbi/config/<name>\n\t\t\t&framework.Path{\n\t\t\t\tPattern: \"powerbi/config/\" + framework.GenericNameRegex(\"name\"),\n\t\t\t\tHelpSynopsis: \"Configure credentials to get access token\",\n\t\t\t\tHelpDescription: `\n\nConfigure Power BI credentials to retrieve access token\n\n`,\n\t\t\t\tFields: map[string]*framework.FieldSchema{\n\t\t\t\t\t\"name\": &framework.FieldSchema{\n\t\t\t\t\t\tType: framework.TypeString,\n\t\t\t\t\t\tDescription: \"Credentials' name. i.e: staging/production.\",\n\t\t\t\t\t\tDefault: \"-\",\n\t\t\t\t\t},\n\t\t\t\t\t\"username\": &framework.FieldSchema{\n\t\t\t\t\t\tType: framework.TypeString,\n\t\t\t\t\t\tDescription: \"Username\",\n\t\t\t\t\t\tDefault: \"-\",\n\t\t\t\t\t},\n\t\t\t\t\t\"password\": &framework.FieldSchema{\n\t\t\t\t\t\tType: framework.TypeString,\n\t\t\t\t\t\tDescription: \"Pasword\",\n\t\t\t\t\t\tDefault: \"-\",\n\t\t\t\t\t},\n\t\t\t\t\t\"client_id\": &framework.FieldSchema{\n\t\t\t\t\t\tType: framework.TypeString,\n\t\t\t\t\t\tDescription: \"Client Id\",\n\t\t\t\t\t\tDefault: \"-\",\n\t\t\t\t\t},\n\t\t\t\t\t\"client_secret\": &framework.FieldSchema{\n\t\t\t\t\t\tType: framework.TypeString,\n\t\t\t\t\t\tDescription: \"Client secret\",\n\t\t\t\t\t\tDefault: \"-\",\n\t\t\t\t\t},\n\t\t\t\t},\n\t\t\t\tCallbacks: map[logical.Operation]framework.OperationFunc{\n\t\t\t\t\tlogical.UpdateOperation: b.pathConfigWrite,\n\t\t\t\t\tlogical.ReadOperation: b.pathConfigRead,\n\t\t\t\t},\n\t\t\t},\n\n\t\t\t// oauth2/powerbi/token/<name>\n\t\t\t&framework.Path{\n\t\t\t\tPattern: \"powerbi/token/\" + framework.GenericNameRegex(\"name\"),\n\t\t\t\tHelpSynopsis: \"Generate and return an OAuth access token for Power BI Service\",\n\t\t\t\tHelpDescription: `\n\nInvoke API to generate an access token with the existing credentials\n\n`,\n\t\t\t\tFields: map[string]*framework.FieldSchema{\n\t\t\t\t\t\"name\": &framework.FieldSchema{\n\t\t\t\t\t\tType: framework.TypeString,\n\t\t\t\t\t\tDescription: \"Credentials' name. i.e: staging/production.\",\n\t\t\t\t\t\tDefault: \"-\",\n\t\t\t\t\t},\n\t\t\t\t\t\"refresh\": &framework.FieldSchema{\n\t\t\t\t\t\tType: framework.TypeBool,\n\t\t\t\t\t\tDescription: \"We are caching access token for 30 mins to reduce API call to MS OAuth Server. Set refresh=true if you want to get a new access token.\",\n\t\t\t\t\t\tDefault: false,\n\t\t\t\t\t},\n\t\t\t\t},\n\t\t\t\tCallbacks: map[logical.Operation]framework.OperationFunc{\n\t\t\t\t\tlogical.ReadOperation: b.pathToken,\n\t\t\t\t},\n\t\t\t},\n\t\t},\n\t}\n\n\treturn &b\n}", "title": "" }, { "docid": "89d5b384f67188a9effe9db0f168b837", "score": "0.5083952", "text": "func GenerateFile(gen *protogen.Plugin, file *protogen.File) *protogen.GeneratedFile {\n\tif len(file.Services) == 0 {\n\t\treturn nil\n\t}\n\tfilename := file.GeneratedFilenamePrefix + \"_grpc.pb.go\"\n\tg := gen.NewGeneratedFile(filename, file.GoImportPath)\n\tg.P(\"// Code generated by protoc-gen-go-grpc. DO NOT EDIT.\")\n\tg.P()\n\tg.P(\"package \", file.GoPackageName)\n\tg.P()\n\tGenerateFileContent(gen, file, g)\n\treturn g\n}", "title": "" }, { "docid": "38be5af8f32539efcbdacddaa01b52e1", "score": "0.5081339", "text": "func (app *App) MakeFile() error {\n\t//create ordered list of keys\n\tvar keys []string\n\tfor k := range app.Names {\n\t\tkeys = append(keys, k)\n\t}\n\tsort.Strings(keys)\n\t//create list of files\n\tvar buffer bytes.Buffer\n\tfor i, k := range keys {\n\t\tbuffer.WriteString(\n\t\t\tfmt.Sprintf(\"%d. %s - %s\\n\", i+1, k, app.Names[k].Path))\n\t}\n\n\theader := fmt.Sprintf(HEAD_MSG, app.Package, buffer.String())\n\n\tfile, err := os.Create(app.TemplateName)\n\tdefer file.Close()\n\tif err != nil {\n\t\treturn err\n\t}\n\t//write header\n\tif _, err := file.WriteString(header); err != nil {\n\t\treturn err\n\t}\n\n\t//write body\n\tfor _, k := range keys {\n\t\tif _, err := file.WriteString(k + \" = `\\n\"); err != nil {\n\t\t\treturn err\n\t\t}\n\t\tif _, err := file.WriteString(app.Names[k].Content + \"`\\n\\n\"); err != nil {\n\t\t\treturn err\n\t\t}\n\t}\n\tend := \")\"\n\tif _, err := file.WriteString(end); err != nil {\n\t\treturn err\n\t}\n\treturn nil\n}", "title": "" }, { "docid": "0bded1af7597411bfe1ec72d54ddecbd", "score": "0.5078504", "text": "func Generate(ramlBytes []byte, dir string) error {\n\t// extract zipped files\n\tif err := extract(dir); err != nil {\n\t\treturn err\n\t}\n\tramlBytes = append([]byte(\"#%RAML 1.0\\n\"), ramlBytes...)\n\t// write the .raml file\n\treturn ioutil.WriteFile(filepath.Join(dir, \"api.raml\"), ramlBytes, 0777)\n}", "title": "" }, { "docid": "0daa5ba47fa82f34ba49c8c1c096ed4e", "score": "0.50759804", "text": "func GenerateFile(filename string, fileContent []byte) {\n\t// Variables for function use\n\tvar err error\n\n\t// Write the file with rw-rw-rw- premissions\n\terr = ioutil.WriteFile(filename, fileContent, 0666)\n\tif err != nil {\n\t\tlog.Fatal(err)\n\t}\n}", "title": "" }, { "docid": "91da9b87204ce2f09f1572692cc1e18f", "score": "0.504579", "text": "func initFiles(cmd *cobra.Command, args []string) error {\n\tvar cryptoService usecase.CryptoUseCase\n\tswitch strings.ToLower(encryptionType) {\n\tcase \"ed25519\":\n\t\tcryptoService=new(usecase.Ed25519)\n\t\tbreak\n\tcase \"rsa\":\n\t\tcryptoService=new(usecase.Rsa)\n\t\tbreak\n\tdefault:\n\t\treturn errors.New(\"Invalid encryption type\")\n\t}\n\tkey,err:=cryptoService.GenerateKey()\n\tif err!=nil{\n\t\treturn err\n\t}\n\tkey.Save(HomeDir)\n\trepository.GenerateFileRepository(HomeDir)\n\treturn nil\n}", "title": "" }, { "docid": "f815d885b7b01293c9e1a50c14f280be", "score": "0.5038249", "text": "func CreateBackend(project structs.Project, environment string) structs.Infrastructure {\n\tworkspaceRoot := \"/tmp\"\n\n\tbackendTerraformOutput := backendTerraformOutput{}\n\n\tlogger.LogInfo(\"Gathering Info\")\n\n\tworkspaceDir := filepath.Join(workspaceRoot, project.Name, environment, project.Type)\n\n\tlogger.LogInfo(\"Generating Template\")\n\ttemplate.GenerateBackendTemplate(project, workspaceDir, environment)\n\n\tcontainerTemplateFile := workspaceDir + \"/sample.json.tpl\"\n\ttemplate.GenerateContainerTemplate(containerTemplateFile)\n\n\tlogger.LogInfo(\"Running Infrastructure Changes\")\n\n\tworkspaceName := project.Name + \"-\" + project.Type + \"-\" + environment\n\tterraformOutput, err := terraform.RunInfrastructureChanges(workspaceDir, workspaceName)\n\n\tlogger.FailOnError(err, \"Cannot run changes\")\n\n\t_ = json.Unmarshal([]byte(terraformOutput), &backendTerraformOutput)\n\n\tbackend := structs.Infrastructure{\n\t\tCluster: backendTerraformOutput.BackendClusterName.Value,\n\t\tContainerDefinition: backendTerraformOutput.BackendContainerDefinition.Value,\n\t\tService: backendTerraformOutput.Service.Value,\n\t\tTaskDefinition: backendTerraformOutput.BackendTaskDefinitionID.Value,\n\t\tBackendURL: backendTerraformOutput.BackendURL.Value,\n\t\tRepoURL: backendTerraformOutput.RepoURL.Value,\n\t}\n\n\treturn backend\n}", "title": "" }, { "docid": "65b289aefec55900471a01c68bbd44de", "score": "0.5036946", "text": "func MakeFileEndpoint(s service.ControlService) endpoint.Endpoint {\n\treturn func(ctx context.Context, request interface{}) (interface{}, error) {\n\t\treq := request.(FileRequest)\n\t\tres, err := s.File(ctx, req.Req)\n\t\treturn FileResponse{\n\t\t\tErr: err,\n\t\t\tRes: res,\n\t\t}, nil\n\t}\n}", "title": "" }, { "docid": "270770f2434bed77139fb7540649f8c1", "score": "0.5036177", "text": "func (g *Generator) Generate(dst io.Writer, realhost, realpath string) error {\n\tpath := strings.Trim(realpath, \"/\")\n\n\tdata := make(map[string]interface{})\n\tvar pkg, sub string\n\tvar err error\n\n\tif path != \"\" {\n\t\tpkg, sub, err = g.deducePackage(path)\n\t\tif err != nil {\n\t\t\treturn fmt.Errorf(\"make package data: %v\", err)\n\t\t}\n\n\t\thost := g.config.PackageHost\n\t\tif host == \"\" {\n\t\t\thost = realhost\n\t\t}\n\n\t\tdata[\"ImportPrefix\"] = filepath.Join(host, path)\n\t\tg.makeGit(data, pkg)\n\t\tg.makeHTTP(data, pkg)\n\t}\n\n\tredirect, err := g.makeRedirectURL(g.config.Redirect, pkg, sub)\n\tif err != nil {\n\t\treturn fmt.Errorf(\"make redirect: %v\", err)\n\t}\n\tdata[\"RedirectURI\"] = redirect\n\n\tif err = g.template.Execute(dst, data); err != nil {\n\t\treturn fmt.Errorf(\"execute template: %v\", err)\n\t}\n\n\treturn nil\n}", "title": "" }, { "docid": "ea32d2e304789634672992b6e2616e1c", "score": "0.5035507", "text": "func GenMappingFile() error {\n\tDownloadDevicesRepository()\n\treturn nil\n}", "title": "" }, { "docid": "024843ffae09b3f8267480fdd61383e1", "score": "0.50302064", "text": "func GenerateFile(path string, w Writer, compat bool) error {\n\tcontent, err := ioutil.ReadFile(path)\n\tif err != nil {\n\t\treturn err\n\t}\n\n\ttree, err := ast.Parse(path, string(content), tm.StopOnFirstError)\n\tif err != nil {\n\t\treturn err\n\t}\n\n\tg, err := grammar.Compile(ast.File{Node: tree.Root()}, compat)\n\tif err != nil {\n\t\treturn err\n\t}\n\n\tif g.TargetLang == \"\" {\n\t\t// A source-only grammar.\n\t\treturn fmt.Errorf(\"no target language\")\n\t}\n\n\treturn Generate(g, w)\n}", "title": "" }, { "docid": "eaef718347ecdfb058bb4be572db1868", "score": "0.50246954", "text": "func Generate(wr io.Writer, gidl gidlir.All, fidl fidlir.Root) error {\n\tencodeSuccessCases, err := encodeSuccessCases(gidl.EncodeSuccess, fidl)\n\tif err != nil {\n\t\treturn err\n\t}\n\tdecodeSuccessCases, err := decodeSuccessCases(gidl.DecodeSuccess, fidl)\n\tif err != nil {\n\t\treturn err\n\t}\n\tencodeFailureCases, err := encodeFailureCases(gidl.EncodeFailure, fidl)\n\tif err != nil {\n\t\treturn err\n\t}\n\tdecodeFailureCases, err := decodeFailureCases(gidl.DecodeFailure)\n\tif err != nil {\n\t\treturn err\n\t}\n\treturn tmpl.Execute(wr, tmplInput{\n\t\tEncodeSuccessCases: encodeSuccessCases,\n\t\tDecodeSuccessCases: decodeSuccessCases,\n\t\tEncodeFailureCases: encodeFailureCases,\n\t\tDecodeFailureCases: decodeFailureCases,\n\t})\n}", "title": "" }, { "docid": "fcf3ff828836f097471847070fdbe043", "score": "0.5010421", "text": "func (s fileSaver) Save(fname string, f *jen.File) error {\n\tbuf := &bytes.Buffer{}\n\tif err := f.Render(buf); err != nil {\n\t\treturn err\n\t}\n\toutpath := makeOutputPath(s.sourceDir, fname, GeneratedFileExt)\n\treturn ioutil.WriteFile(outpath, buf.Bytes(), 0644)\n}", "title": "" } ]
899813135fb7782bb24501a3b2d576d5
use ihash(key) % NReduce to choose the reduce task number for each KeyValue emitted by Map.
[ { "docid": "d5de62fabceed8f9487a50b8aee1091c", "score": "0.46970728", "text": "func ihash(key string) int {\n\th := fnv.New32a()\n\th.Write([]byte(key))\n\treturn int(h.Sum32() & 0x7fffffff)\n}", "title": "" } ]
[ { "docid": "d2547a4d0cf9f7691caf9cf09ad0f798", "score": "0.6549827", "text": "func doReduce(\n\tjobName string, // the name of the whole MapReduce job\n\treduceTaskNumber int, // which reduce task this is\n\tnMap int, // the number of map tasks that were run (\"M\" in the paper)\n\treduceF func(key string, values []string) string,\n) {\n\tdebug(\"DEBUG[doReduce]: jobName:%s, reduceTaskNumber:%d, mapTask:%d\\n\", jobName, reduceTaskNumber, nMap);\n\tkeyValues := make(map[string][]string)\n\tfor i := 0; i < nMap; i++ {\n\t\tfileName := reduceName(jobName, i, reduceTaskNumber)\n\t\tdebug(\"DEBUG[doReduce]: Reduce File %s\\n\", fileName)\n\t\tfile, err := os.Open(fileName)\n\t\tif err != nil {\n\t\t\tlog.Fatal(\"Open error: \", err)\n\t\t}\n\t\tdec := json.NewDecoder(file)\n\t\t//iterate each pairs in the file\n\t\t//append the pair's Value for which has the same Key\n\t\t//e.g. before reduce: [\"a\", \"1\"] [\"b\", \"2\"] [\"a\", \"3\"] [\"b\", \"5\"] [\"c\", \"6\"]\n\t\t// after reduce: [\"a\", [\"1\", \"3\"] [\"b\", [\"2\", \"5\"]] [\"c\", [\"6\"]]\n\t\t//send this result to reduceF(user-defined)\n\t\tfor {\n\t\t\tvar kv KeyValue\n\t\t\terr := dec.Decode(&kv)\n\t\t\tif err != nil {\n\t\t\t\tbreak\n\t\t\t}\n\t\t\t_, ok := keyValues[kv.Key]\n\t\t\tif !ok {\n\t\t\t\tkeyValues[kv.Key] = make([]string, 0)\n\t\t\t}\n\t\t\tkeyValues[kv.Key] = append(keyValues[kv.Key], kv.Value)\n\t\t}\n\t\tfile.Close()\n\t}\n\n\tvar keys []string\n\tfor k, _:= range keyValues {\n\t\tkeys = append(keys, k)\n\t}\n\n\tsort.Strings(keys)\n\tmergeFileName := mergeName(jobName, reduceTaskNumber)\n\tdebug(\"DEBUG[doReduce]: mergeFileName: %v\\n\", mergeFileName)\n\tmerge_file, err := os.Create(mergeFileName)\n\tif err != nil {\n\t\tlog.Fatal(\"ERROR[doReduce]: Create file error: \", err)\n\t}\n\tenc := json.NewEncoder(merge_file)\n\tfor _, k := range keys {\n\t\tres := reduceF(k, keyValues[k])\n\t\tenc.Encode(&KeyValue{k, res})\n\t}\n\tmerge_file.Close()\n}", "title": "" }, { "docid": "52cdea14d24114e39ea7fda8f2452cbb", "score": "0.64693534", "text": "func doMap(index int, reduceN int, sourceFile string, mapf func(string, string) []KeyValue) []int {\n\tfile, _ := read(sourceFile)\n\n\t// apply given map function in the worker definition\n\tkvps := mapf(sourceFile, file)\n\n\t// map of filename to json encoders for each of the intermediate file\n\tencoders := make(map[string]*json.Encoder)\n\n\ttmpSuffix := \"-map-tmp\"\n\n\tindexes := []int{}\n\n\t// go through each of the map result key-value pair\n\tfor _, kv := range kvps {\n\t\tx := index\n\t\ty := ihash(kv.Key) % reduceN\n\n\t\tif !containsInt(y, indexes) {\n\t\t\tindexes = append(indexes, y)\n\t\t}\n\n\t\t// create intermediate file with following convention: mr-{mapTaskNumber}-{reduceTaskNumber}\n\t\tfilename := fmt.Sprintf(\"mr-%d-%d%v\", x, y, tmpSuffix)\n\n\t\tvar encoder *json.Encoder\n\t\tencoder, ok := encoders[filename]\n\t\tif !ok {\n\t\t\tfd, err := os.OpenFile(filename, os.O_CREATE|os.O_APPEND|os.O_WRONLY, 0777)\n\t\t\tif err != nil {\n\t\t\t\tlog.Fatalln(\"Error opening file when writing map output\", filename, err)\n\t\t\t}\n\t\t\tdefer fd.Close()\n\n\t\t\tencoders[filename] = json.NewEncoder(fd)\n\t\t\tencoder = encoders[filename]\n\t\t}\n\n\t\tencoder.Encode(&kv)\n\t}\n\n\t// rename tmp files to actual reduce files\n\tfiles, _ := os.ReadDir(\".\")\n\tfor _, file := range files {\n\t\tif strings.HasSuffix(file.Name(), tmpSuffix) {\n\t\t\treduceFileName := strings.Replace(file.Name(), tmpSuffix, \"\", 1)\n\t\t\tos.Rename(file.Name(), reduceFileName)\n\t\t}\n\t}\n\n\treturn indexes\n}", "title": "" }, { "docid": "9a5117a1da06f3aef48db556c88f56e2", "score": "0.6379036", "text": "func doReduce(\n\tjobName string, // the name of the whole MapReduce job\n\treduceTaskNumber int, // which reduce task this is\n\toutFile string, // write the output here\n\tnMap int, // the number of map tasks that were run (\"M\" in the paper)\n\treduceF func(key string, values []string) string,\n) {\n\tkvs := make(map[string][]string)\n\tfor i := 0; i < nMap; i++ {\n\t\tfileName := reduceName(jobName, i, reduceTaskNumber)\n\t\tfile, err := os.Open(fileName)\n\t\tif err != nil {\n\t\t\tlog.Panic(err)\n\t\t}\n\t\tdefer file.Close()\n\t\tvar kv KeyValue\n\t\tdecoder := json.NewDecoder(file)\n\t\tfor {\n\t\t\tif err := decoder.Decode(&kv); err != nil {\n\t\t\t\tbreak\n\t\t\t}\n\t\t\tkvs[kv.Key] = append(kvs[kv.Key], kv.Value)\n\t\t}\n\t}\n\n\t// reduceF(k2, list(v2)) -> list(v2)\n\tkeys := []string{}\n\tfor key := range kvs {\n\t\tkeys = append(keys, key)\n\t}\n\n\tsort.Strings(keys)\n\toutF, err := os.Create(outFile)\n\tif err != nil {\n\t\tlog.Panic(err)\n\t}\n\tdefer outF.Close()\n\tencoder := json.NewEncoder(outF)\n\n\tfor _, key := range keys {\n\t\terr := encoder.Encode(&KeyValue{key, reduceF(key, kvs[key])})\n\t\tif err != nil {\n\t\t\tlog.Panic(err)\n\t\t}\n\t}\n}", "title": "" }, { "docid": "29688be1f552589c18689b808094369f", "score": "0.63096493", "text": "func doMap(\n\tjobName string, // the name of the MapReduce job\n\tmapTaskNumber int, // which map task this is\n\tinFile string,\n\tnReduce int, // the number of reduce task that will be run (\"R\" in the paper)\n\tmapF func(file string, contents string) []KeyValue,\n) {\n\t// Open the input file and check for errors.\n\tfile, err := ioutil.ReadFile(inFile)\n\tcheckError(err)\n\t// Map key-values of the input file\n\tkeyValues := mapF(inFile, string(file))\n\t\n\t// Slice to map the MapReduce job in JSON format.\n\tencoderSlice := make(map[string]*json.Encoder)\n\t\n\t// Execute the reduce task.\n\tfor i := 0; i < nReduce; i++ {\n\t\tfileName := reduceName(jobName, mapTaskNumber, i)\n\t\t// Create each intermediate file and check for errors.\n\t\tintermediateFile, err := os.Create(fileName)\n\t\tcheckError(err)\n\t\t// Close the file when returning from this function, by using keyword defer.\n\t\tdefer intermediateFile.Close()\n\t\t// Encoded to JSON format in each of the nReduce intermediate files.\n\t\tmiddleEncoder := json.NewEncoder(intermediateFile)\n\t\tencoderSlice[fileName] = middleEncoder\n\t}\n\t\n\t// Call ihash function to decide which file a given key belongs into each of the keyValues mapped that will be reduced.\n\tfor _, kV := range keyValues {\n\t\tfileID := int(ihash(kV.Key)) % nReduce\n\t\tfileName := reduceName(jobName, mapTaskNumber, fileID)\n\t\terr := encoderSlice[fileName].Encode(&kV)\n\t\tcheckError(err)\n\t}\n}", "title": "" }, { "docid": "22addca16ca9b0da95f7008536a089ae", "score": "0.62465644", "text": "func doReduce(\n\tjobName string, // the name of the whole MapReduce job\n\treduceTaskNumber int, // which reduce task this is\n\toutFile string, // write the output here\n\tnMap int, // the number of map tasks that were run (\"M\" in the paper)\n\treduceF func(key string, values []string) string,\n) {\n\t//\n\t// You will need to write this function.\n\t//\n\t// You'll need to read one intermediate file from each map task;\n\t// reduceName(jobName, m, reduceTaskNumber) yields the file\n\t// name from map task m.\n\t//\n\t// Your doMap() encoded the key/value pairs in the intermediate\n\t// files, so you will need to decode them. If you used JSON, you can\n\t// read and decode by creating a decoder and repeatedly calling\n\t// .Decode(&kv) on it until it returns an error.\n\t//\n\t// You may find the first example in the golang sort package\n\t// documentation useful.\n\t//\n\t// reduceF() is the application's reduce function. You should\n\t// call it once per distinct key, with a slice of all the values\n\t// for that key. reduceF() returns the reduced value for that key.\n\t//\n\t// You should write the reduce output as JSON encoded KeyValue\n\t// objects to the file named outFile. We require you to use JSON\n\t// because that is what the merger than combines the output\n\t// from all the reduce tasks expects. There is nothing special about\n\t// JSON -- it is just the marshalling format we chose to use. Your\n\t// output code will look something like this:\n\t//\n\t// enc := json.NewEncoder(file)\n\t// for key := ... {\n\t// \tenc.Encode(KeyValue{key, reduceF(...)})\n\t// }\n\t// file.Close()\n\t//\n\toutFileHandler, err := os.Create(outFile)\n\tif err != nil {\n\t\tlog.Fatal(\"os.Create: can not create \", err)\n\t}\n\tenc := json.NewEncoder(outFileHandler)\n\tdefer outFileHandler.Close()\n\tvar kvPairs []KeyValue\n\tfor i := 0; i < nMap; i++ {\n\t\tinFileName := reduceName(jobName, i, reduceTaskNumber)\n\t\tinFileHandler, err := os.OpenFile(inFileName, os.O_RDONLY, 0400)\n\t\tif err != nil {\n\t\t\tlog.Fatal(\"os.OpenFile: \", err)\n\t\t}\n\t\tdec := json.NewDecoder(inFileHandler)\n\t\tkv := KeyValue{}\n\t\tfor {\n\t\t\terr := dec.Decode(&kv)\n\t\t\tif err != nil {\n\t\t\t\tbreak\n\t\t\t} else {\n\t\t\t\tkvPairs = append(kvPairs, kv)\n\t\t\t}\n\t\t}\n\t\tinFileHandler.Close()\n\t}\n\tsort.Sort(ByKey(kvPairs))\n\tstop := 0\n\tfor stop != len(kvPairs) {\n\t\tstart := stop\n\t\tstop = start + 1\n\t\tvar values []string\n\t\tfor ; stop != len(kvPairs) && kvPairs[stop].Key == kvPairs[stop - 1].Key; stop++ {\n\t\t\tvalues = append(values, kvPairs[stop - 1].Value)\n\t\t}\n\t\tvalues = append(values, kvPairs[stop - 1].Value)\n\t\tres := reduceF(kvPairs[start].Key, values)\n\t\tenc.Encode(KeyValue{kvPairs[start].Key, res})\n\t}\n}", "title": "" }, { "docid": "d4e01a1f8c483079bc4c3daf830baf7a", "score": "0.6196289", "text": "func doReduce(\n\tjobName string, // the name of the whole MapReduce job\n\treduceTaskNumber int, // which reduce task this is\n\toutFile string, // write the output here\n\tnMap int, // the number of map tasks that were run (\"M\" in the paper)\n\treduceF func(key string, values []string) string,\n) {\n\tkey2values := make(map[string][]string)\n\tvar kv KeyValue\n\tfor m := 0; m < nMap; m++ {\n\t\tfileIn, e := os.Open(reduceName(jobName, m, reduceTaskNumber))\n\t\tif e != nil {\n\t\t\tlog.Println(\"os.Open:\", reduceName(jobName, m, reduceTaskNumber), e)\n\t\t\treturn\n\t\t}\n\t\tdec := json.NewDecoder(fileIn)\n\t\tfor {\n\t\t\tif e := dec.Decode(&kv); e != nil {\n\t\t\t\tbreak\n\t\t\t}\n\t\t\tkey2values[kv.Key] = append(key2values[kv.Key], kv.Value)\n\t\t}\n\t\tfileIn.Close()\n\t}\n\tvar keys []string\n\tfor k := range key2values {\n\t\tkeys = append(keys, k)\n\t}\n\tsort.Strings(keys)\n\tvar key2reduced []KeyValue\n\tfor _, k := range keys {\n\t\tkey2reduced = append(key2reduced, KeyValue{k, reduceF(k, key2values[k])})\n\t}\n\n\tfileOut, e := os.OpenFile(mergeName(jobName, reduceTaskNumber),\n\t\tos.O_WRONLY|os.O_CREATE|os.O_TRUNC, 0666)\n\tif e != nil {\n\t\tlog.Println(\"os.OpenFile:\", mergeName(jobName, reduceTaskNumber), e)\n\t\treturn\n\t}\n\tenc := json.NewEncoder(fileOut)\n\tfor i := 0; i < len(key2reduced); i++ {\n\t\te := enc.Encode(key2reduced[i])\n\t\tif e != nil {\n\t\t\tlog.Println(\"enc.Encode:\", key2reduced[i], e)\n\t\t\treturn\n\t\t}\n\t}\n\n\tfileOut.Close()\n}", "title": "" }, { "docid": "b2a27860a6aa2479374b6684f0ddde3e", "score": "0.6160398", "text": "func doReduce(\n\tjobName string, // the name of the whole MapReduce job\n\treduceTaskNumber int, // which reduce task this is\n\toutFile string, // write the output here\n\tnMap int, // the number of map tasks that were run (\"M\" in the paper)\n\treduceF func(key string, values []string) string,\n) {\n\t// Opening all temp files\n\tlogInfo(jobName, reducePhase, reduceTaskNumber, fmt.Sprintf(\"Starting to process %d files\", nMap))\n\tvar decoders = make([]*json.Decoder, nMap)\n\tfor i := 0; i < nMap; i++ {\n\t\tfileName := reduceName(jobName, i, reduceTaskNumber)\n\t\tfd, err := os.OpenFile(fileName, os.O_RDONLY, 0600)\n\t\tif err != nil {\n\t\t\tlogFatal(jobName, reducePhase, reduceTaskNumber, fmt.Sprintf(\"Failed to open: %s\", fileName))\n\t\t\treturn\n\t\t}\n\t\tdecoders[i] = json.NewDecoder(fd)\n\t\tdefer fd.Close()\n\t}\n\n\tkvs := make(map[string][]string)\n\n\t// Unmarshal all temp files and collate key-values\n\tfor i := 0; i < nMap; i++ {\n\t\tvar kv *KeyValue\n\t\tfor {\n\t\t\terr := decoders[i].Decode(&kv)\n\t\t\tif err != nil {\n\t\t\t\tbreak\n\t\t\t}\n\t\t\tkvs[kv.Key] = append(kvs[kv.Key], kv.Value)\n\t\t}\n\t}\n\tlogInfo(jobName, reducePhase, reduceTaskNumber, fmt.Sprintf(\"Read %d keys from %d files\", len(kvs), nMap))\n\n\t// Sort by key\n\tlogInfo(jobName, reducePhase, reduceTaskNumber, fmt.Sprintf(\"Sorting data by keys\"))\n\tvar keys []string\n\tfor k := range kvs {\n\t\tkeys = append(keys, k)\n\t}\n\tsort.Strings(keys)\n\n\t// Create output file\n\tfd, err := os.OpenFile(outFile, os.O_CREATE|os.O_APPEND|os.O_WRONLY, 0600)\n\tif err != nil {\n\t\tlogFatal(jobName, reducePhase, reduceTaskNumber, fmt.Sprintf(\"Failed to open: %s\", outFile))\n\t\treturn\n\t}\n\tdefer fd.Close()\n\n\t// Apply reduce f() and write results\n\tlogInfo(jobName, reducePhase, reduceTaskNumber, fmt.Sprintf(\"Applying reduce f() and writing to output file: %s\", outFile))\n\tencoder := json.NewEncoder(fd)\n\tfor _, key := range keys {\n\t\tencoder.Encode(KeyValue{key, reduceF(key, kvs[key])})\n\t}\n}", "title": "" }, { "docid": "02d163937d181623b4edd47d90d57375", "score": "0.61111975", "text": "func doReduce(\n\tjobName string, // the name of the whole MapReduce job\n\treduceTaskNumber int, // which reduce task this is\n\toutFile string, // write the output here\n\tnMap int, // the number of map tasks that were run (\"M\" in the paper)\n\treduceF func(key string, values []string) string,\n) {\n\n\tw, err := os.OpenFile(outFile, os.O_APPEND|os.O_WRONLY, 0600)\n\n\tif err != io.EOF && err!= nil {\n\t\tw, _ = os.Create(outFile)\n\t}\n\n\tfor mapNum := 0; mapNum < nMap; mapNum++ {\n\t\treduceFileName := reduceName(jobName, mapNum, reduceTaskNumber)\n\t\tf, err := ioutil.ReadFile(reduceFileName)\n\t\terrCheck(err)\n\n\t\tread := bytes.NewBuffer(f)\n\t\twrite := new(bytes.Buffer)\n\t\tdec := json.NewDecoder(read)\n\t\tenc := json.NewEncoder(write)\n\n\t\tvar keyValuePairs []KeyValue\n\t\tfor {\n\t\t\tvar kv KeyValue\n\t\t\tif err := dec.Decode(&kv); err == io.EOF {\n\t\t\t\tbreak\n\t\t\t} else if err != nil {\n\t\t\t\tlog.Fatal(err)\n\t\t\t}\n\t\t\tkeyValuePairs = append(keyValuePairs, kv)\n\t\t}\n\t\tkeys := make(map[string]bool)\n\t\tfor _, key := range keyValuePairs {\n\t\t\tkeys[key.Key] = true\n\t\t}\n\n\t\tfor key := range keys {\n\t\t\tvar values []string\n\t\t\tfor _, keyValue := range keyValuePairs {\n\t\t\t\tif keyValue.Key == key {\n\t\t\t\t\tvalues = append(values, keyValue.Value)\n\t\t\t\t}\n\t\t\t}\n\t\t\tenc.Encode(KeyValue{key, reduceF(key, values)})\n\t\t\tw.WriteString(write.String())\n\t\t}\n\t}\n\tw.Close()\n\n\n\t//\n\t// You will need to write this function.\n\t//\n\t// You'll need to read one intermediate file from each map task;\n\t// reduceName(jobName, m, reduceTaskNumber) yields the file\n\t// name from map task m.\n\t//\n\t// Your doMap() encoded the key/value pairs in the intermediate\n\t// files, so you will need to decode them. If you used JSON, you can\n\t// read and decode by creating a decoder and repeatedly calling\n\t// .Decode(&kv) on it until it returns an error.\n\t//\n\t// You may find the first example in the golang sort package\n\t// documentation useful.\n\t//\n\t// reduceF() is the application's reduce function. You should\n\t// call it once per distinct key, with a slice of all the values\n\t// for that key. reduceF() returns the reduced value for that key.\n\t//\n\t// You should write the reduce output as JSON encoded KeyValue\n\t// objects to the file named outFile. We require you to use JSON\n\t// because that is what the merger than combines the output\n\t// from all the reduce tasks expects. There is nothing special about\n\t// JSON -- it is just the marshalling format we chose to use. Your\n\t// output code will look something like this:\n\t//\n\t// enc := json.NewEncoder(file)\n\t// for key := ... {\n\t// \tenc.Encode(KeyValue{key, reduceF(...)})\n\t// }\n\t// file.Close()\n\t//\n}", "title": "" }, { "docid": "15548172dbe8e5de4fcf752fcd0242ec", "score": "0.61110157", "text": "func doReduce(\n\tjobName string, // the name of the whole MapReduce job\n\treduceTaskNumber int, // which reduce task this is\n\toutFile string, // write the output here\n\tnMap int, // the number of map tasks that were run (\"M\" in the paper)\n\treduceF func(key string, values []string) string,\n) {\n\t//\n\t// You will need to write this function.\n\t//\n\t// You'll need to read one intermediate file from each map task;\n\t// reduceName(jobName, m, reduceTaskNumber) yields the file\n\t// name from map task m.\n\t//\n\t// Your doMap() encoded the key/value pairs in the intermediate\n\t// files, so you will need to decode them. If you used JSON, you can\n\t// read and decode by creating a decoder and repeatedly calling\n\t// .Decode(&kv) on it until it returns an error.\n\t//\n\t// You may find the first example in the golang sort package\n\t// documentation useful.\n\t//\n\t// reduceF() is the application's reduce function. You should\n\t// call it once per distinct key, with a slice of all the values\n\t// for that key. reduceF() returns the reduced value for that key.\n\t//\n\t// You should write the reduce output as JSON encoded KeyValue\n\t// objects to the file named outFile. We require you to use JSON\n\t// because that is what the merger than combines the output\n\t// from all the reduce tasks expects. There is nothing special about\n\t// JSON -- it is just the marshalling format we chose to use. Your\n\t// output code will look something like this:\n\t//\n\t// enc := json.NewEncoder(file)\n\t// for key := ... {\n\t// \tenc.Encode(KeyValue{key, reduceF(...)})\n\t// }\n\t// file.Close()\n\t//\n\n\tvar err error\n\tinData := make(map[string][]string)\n\t// Read input files\n\tinputs := make([]*os.File, nMap)\n\tfor i := range inputs {\n\t\tvar kvs []KeyValue\n\n\t\tinputPath, err := filepath.Abs(reduceName(jobName, i, reduceTaskNumber))\n\t\tif err != nil {\n\t\t\tpanic(err)\n\t\t}\n\t\tinputs[i], err = os.Open(inputPath)\n\t\tif err != nil {\n\t\t\tpanic(err)\n\t\t}\n\t\tdefer inputs[i].Close()\n\n\t\t// Read json files\n\t\tdec := json.NewDecoder(inputs[i])\n\t\terr = dec.Decode(&kvs)\n\t\tif err != nil {\n\t\t\tpanic(err)\n\t\t}\n\n\t\t// collect data of this file\n\t\tfor _, kv := range kvs {\n\t\t\tinData[kv.Key] = append(inData[kv.Key], kv.Value)\n\t\t}\n\t}\n\n\t// Open output file\n\toutput, err := os.OpenFile(outFile, os.O_CREATE | os.O_RDWR | os.O_TRUNC, 0755)\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\tdefer output.Close()\n\n\t// Write output file(JSON)\n\tenc := json.NewEncoder(output)\n\tfor key, value := range inData {\n\t\tenc.Encode(KeyValue{key, reduceF(key, value)})\n\t}\n\n}", "title": "" }, { "docid": "c788918b25e96b13bce3bf866edc048a", "score": "0.60924405", "text": "func doReduce(\n jobName string, // the name of the whole MapReduce job\n reduceTaskNumber int, // which reduce task this is\n nMap int, // the number of map tasks that were run (\"M\" in the paper)\n reduceF func(key string, values []string) string,\n) {\n // TODO:\n // You will need to write this function.\n // You can find the intermediate file for this reduce task from map task number\n // m using reduceName(jobName, m, reduceTaskNumber).\n // Remember that you've encoded the values in the intermediate files, so you\n // will need to decode them. If you chose to use JSON, you can read out\n // multiple decoded values by creating a decoder, and then repeatedly calling\n // .Decode() on it until Decode() returns an error.\n //\n // You should write the reduced output in as JSON encoded KeyValue\n // objects to a file named mergeName(jobName, reduceTaskNumber). We require\n // you to use JSON here because that is what the merger than combines the\n // output from all the reduce tasks expects. There is nothing \"special\" about\n // JSON -- it is just the marshalling format we chose to use. It will look\n // something like this:\n //\n // enc := json.NewEncoder(mergeFile)\n // for key in ... {\n // enc.Encode(KeyValue{key, reduceF(...)})\n // }\n // file.Close()\n //\n // Use checkError to handle errors.\n\n debug(\"Entering doReduce function\\n\")\n \n var keyValuePair []KeyValue\n var kvArr_tmp []KeyValue\n\n for m := 0; m < nMap; m++ {\n kvArr_tmp = nil\n\n // Get marshalled json object produced by map function\n content, err := ioutil.ReadFile(reduceName(jobName, m, reduceTaskNumber))\n checkError(err)\n\n\n // Unmarshall json object and check for errors\n err = json.Unmarshal(content, &kvArr_tmp)\n checkError(err)\n\n // Merge all contents from all intermediate files \n keyValuePair = append(keyValuePair, kvArr_tmp...)\n }\n \n // Then we need to sort the intermediate key/value pairs by key \n sortKeyValues(keyValuePair)\n debug(\"doReduce - sorted keys\\n %v\\n\", keyValuePair)\n\n // Setting up a map to easily keep track of unique keys and values\n keyValueMap := make(map[string][]string)\n\n /* Iterate through key/value pairs and using the map\n * merge all values for one same key together\n */\n for k := 0; k < len(keyValuePair); k++ {\n key := keyValuePair[k].Key\n keyValueMap[key] = append(keyValueMap[key], keyValuePair[k].Value)\n }\n \n debug(\"doReduce - key/value pairs sorted and merged together\\n %v \\n\", keyValueMap)\n\n // Setup output file w/encoder\n output_file, err := os.OpenFile(mergeName(jobName, reduceTaskNumber), os.O_RDWR|os.O_CREATE, 0755)\n checkError(err)\n\n enc := json.NewEncoder(output_file)\n\n debug(\"doReduce - Output file\\n\")\n\n /* Iterate through key/value pairs, apply reduce funtion\n * and directly encode it to output file\n */\n for key, value := range keyValueMap{\n enc.Encode(KeyValue{key, reduceF(key, value)})\n }\n\n output_file.Close()\n}", "title": "" }, { "docid": "41db5418982d5226f63c427bde928e05", "score": "0.6085916", "text": "func ReduceTask(reduceFileNo int,listOfMapWorkerFiles []int, reducef func(string, []string)string ) bool {\n\n // get all the files to read from NXM buckets\n // load to memory(in a slice)\n intermediate := GetKvForReduce(listOfMapWorkerFiles, reduceFileNo)\n //fmt.Println(\"intermediate values are \",intermediate)\n // sort the slice, Map-Reduce paper states if the intermediate data is too large for memory\n // we send it for external sort\n sort.Sort(ByKey(intermediate))\n\n // create file to write to \n reduceFile := fmt.Sprint(\"mr-out-\", reduceFileNo)\n rFile, err := os.Create(reduceFile)\n if err != nil {\n return false\n }\n // reducef\n\t//\n\t// call Reduce on each distinct key in intermediate[],\n\t// and print the result to mr-out-*.\n\t//\n i := 0\n\tfor i < len(intermediate) {\n\t\tj := i + 1\n // Find the first index which is different from intermediate[i].key\n\t\tfor j < len(intermediate) && intermediate[j].Key == intermediate[i].Key {\n\t\t\tj++\n\t\t}\n\t\tvalues := []string{}\n\t\tfor k := i; k < j; k++ {\n\t\t\tvalues = append(values, intermediate[k].Value)\n\t\t}\n\t\toutput := reducef(intermediate[i].Key, values)\n //fmt.Println(\"intermediate key for reduce is : \",intermediate[i].Key)\n // write to file\n\t\tfmt.Fprintf(rFile, \"%v %v\\n\", intermediate[i].Key, output)\n\n\t\ti = j\n\t}\n // close file\n rFile.Close()\n return true\n}", "title": "" }, { "docid": "02bb2accd3b7278b1bb2b1a41bf1437f", "score": "0.60419023", "text": "func ihash(key string) int {\n\th := fnv.New32a()\n\th.Write([]byte(key))\n\treturn int(h.Sum32() & 0x7fffffff) % nreduce_\n}", "title": "" }, { "docid": "596e26d79cce27d066e39a3e8a3233b1", "score": "0.60156333", "text": "func reduceFunc(input []mapreduce.KeyValue) (result []mapreduce.KeyValue) {\n\t// \tMaybe it's easier if we have an auxiliary structure? Which one?\n\t//\n\t// \tYou can check if a map have a key as following:\n\t// \t\tif _, ok := myMap[myKey]; !ok {\n\t//\t\t\t// Don't have the key\n\t//\t\t}\n\t//\n\t// \tReduce will receive KeyValue pairs that have string values, you may need\n\t// \tconvert those values to int before being able to use it in operations.\n\t// \tstrconv.Atoi(string_number)\n\n\t/////////////////////////\n\t// YOUR CODE GOES HERE //\n\t/////////////////////////\n\tvar mapAux map[string]int = make(map[string]int)\n\t\n\tfor _,item := range input { \n\t\t_, ok := mapAux[item.Key]\n\t\tv,err := strconv.Atoi(item.Value)\t//v is the generated number, err indicate error in the conversion\t\n\t\tif !ok { //If the key (word) is not in the map, create it\n\t\t\tif err == nil { \n\t\t\t\tmapAux[item.Key]=v //when the Value string represents a number\n\t\t\t} else {\n\t\t\t\tmapAux[item.Key]=1 //when the Value string is any symbol (so we cannot convert to number)\n\t\t\t}\n\t\t} else{ //Increment the quantity of the word\n\t\t\tif err == nil { \n\t\t\t\tmapAux[item.Key]=mapAux[item.Key] + v //increment by the other value\n\t\t\t} else {\n\t\t\t\tmapAux[item.Key]=mapAux[item.Key] + 1 //only increment by 1\n\t\t\t}\t\t\t\n\t\t}\n\t}\n\tfor k, v := range mapAux {\n\t\tresult = append(result, mapreduce.KeyValue{k,strconv.Itoa(v)})\n\t}\n\tfmt.Printf(\"%v\", mapAux)\n\t\n\treturn result\n\t//return make([]mapreduce.KeyValue, 0)\n}", "title": "" }, { "docid": "347a3647e1eda94de29c731ef4ad874c", "score": "0.5989523", "text": "func doMap(\n\tjobName string, // the name of the MapReduce job\n\tmapTaskNumber int, // which map task this is\n\tinFile string,\n\tnReduce int, // the number of reduce task that will be run (\"R\" in the paper)\n\tmapF func(file string, contents string) []KeyValue,\n) {\n\tfileIn, e := os.Open(inFile)\n\tif e != nil {\n\t\tlog.Println(\"os.Open:\", inFile, e)\n\t\treturn\n\t}\n\tcontents, e := ioutil.ReadAll(fileIn)\n\tfileIn.Close()\n\tif e != nil {\n\t\tlog.Println(\"ioutil.ReadAll:\", fileIn, e)\n\t\treturn\n\t}\n\tkeyValues := mapF(inFile, string(contents))\n\n\tfilesOut := make([]*os.File, nReduce)\n\tencoders := make([]*json.Encoder, nReduce)\n\tfor r := 0; r < nReduce; r++ {\n\t\tfileOut, e := os.OpenFile(reduceName(jobName, mapTaskNumber, r),\n\t\t\tos.O_WRONLY|os.O_CREATE|os.O_TRUNC, 0666)\n\t\tif e != nil {\n\t\t\tlog.Println(\"os.Open:\", reduceName(jobName, mapTaskNumber, r), e)\n\t\t\treturn\n\t\t}\n\t\tfilesOut[r] = fileOut\n\t\tencoders[r] = json.NewEncoder(fileOut)\n\t}\n\tfor i := 0; i < len(keyValues); i++ {\n\t\tr := ihash(keyValues[i].Key) % nReduce\n\t\te := encoders[r].Encode(keyValues[i])\n\t\tif e != nil {\n\t\t\tlog.Println(\"enc.Encode:\", keyValues[i], e)\n\t\t\treturn\n\t\t}\n\t}\n\n\tfor r := 0; r < nReduce; r++ {\n\t\tfilesOut[r].Close()\n\t}\n}", "title": "" }, { "docid": "b01da4c511c55fac0163fd7d42571a6b", "score": "0.59883106", "text": "func Reduce(key string, values *list.List) string {\n\tsum := 0;\n\tfor e := values.Front(); e != nil; e = e.Next(){\n\t\tnum, _ := strconv.Atoi(e.Value.(string))\n\t\tsum += num\n//\t\tfmt.Println(\"Running, %s\", key, e.Value.(string))\n\t}\n\tfmt.Println(\"The sum of key %s is %d\", key, sum)\n\treturn strconv.Itoa(sum)\n}", "title": "" }, { "docid": "4e48bde1005d52832961d5d7aa180ee1", "score": "0.5948145", "text": "func doReduce(\n\tjobName string,\n\treduceTaskNum int,\n\tnMap int,\n) {\n\t// TODO:\n\t// You will need to write this function.\n\t// You can find the intermediate file for this reduce task from\n\t// map task number m using serverless.ReduceName(jobName,\n\t// mapTask, reduceTask). Remember that you've encoded the values\n\t// in the intermediate files, so you will need to decode them. If\n\t// you chose to use JSON, you can read out multiple decoded\n\t// values by creating a decoder, and then repeatedly calling\n\t// .Decode() on it until Decode() returns an error.\n\t//\n\t// You should write the reduced output in as JSON encoded\n\t// KeyValue objects to a file named mergeName(jobName,\n\t// reduceTaskNumber). We require you to use JSON here because\n\t// that is what the merger (the function driver.merge()) than\n\t// combines the output from all the reduce tasks expects. There\n\t// is nothing \"special\" about JSON -- it is just the marshalling\n\t// format we chose to use. It will look something like this:\n\t//\n\t// enc := json.NewEncoder(mergeFile)\n\t// for key in ... {\n\t// \tenc.Encode(KeyValue{key, reduceF(...)})\n\t// }\n\t// file.Close()\n\t//\n\t// Use checkError to handle errors.\n}", "title": "" }, { "docid": "c1505ea31246918d83cb9d94745dc970", "score": "0.59383476", "text": "func reduceFunc(input []mapreduce.KeyValue) (result []mapreduce.KeyValue) {\n\t// \tMaybe it's easier if we have an auxiliary structure? Which one?\n\t//\n\t// \tYou can check if a map have a key as following:\n\t// \t\tif _, ok := myMap[myKey]; !ok {\n\t//\t\t\t// Don't have the key\n\t//\t\t}\n\t//\n\t// \tReduce will receive KeyValue pairs that have string values, you may need\n\t// \tconvert those values to int before being able to use it in operations.\n\t// \tstrconv.Atoi(string_number)\n\n\t/////////////////////////\n\t// YOUR CODE GOES HERE //\n\t/////////////////////////\n\t// Codigo Pedro Nunes Baptista aluno Especial CE-288\n\tvar (\n\t\tja_tem bool\n\t\tvalue, key string\n\t\tqty1, qty2 int\n\t\terr error\n\t\t)\n mapa_resultado := make(map[string]string)\n\n\tif len(input) != 0 { //entrada valida\n\t\tfor _, chave := range(input) { //percorre toda a entrada\n\n\t\t\t\tvalue, ja_tem = mapa_resultado[chave.Key] //testa a existencia da chave\n\n\t\t\t\tif ja_tem { //chave repetida, soma o valor da chave com o do mapa\n\n qty1, err = strconv.Atoi(chave.Value)\n\t\t\t\t\tif err != nil { //caso nao seja um numero considera 1\n\t\t\t\t\t\tqty1 = 1\n\t\t\t\t\t}\n qty2, err = strconv.Atoi(value)\n\t\t\t\t\tif err != nil { //caso nao seja um numero considera 1\n\t\t\t\t\t\tqty2 = 1\n\t\t\t\t\t}\n\n mapa_resultado[chave.Key] = strconv.Itoa(qty1+qty2)\n\n } else { //nova chave\n\n \tmapa_resultado[chave.Key] = chave.Value\n\n }\n }\n\n\t\t// converte o mapa para o slice de saida\n\t\tresult = make([]mapreduce.KeyValue, len(mapa_resultado))\n\t\ti := 0\n\t\tfor key, value = range(mapa_resultado)\t{\n\t\t\tresult[i].Key = key\n\t\t\tresult[i].Value = value\n\t\t\ti++\n\t\t}\n\n } else { //entrada vazia retornara uma saida vazia\n \tresult = make([]mapreduce.KeyValue, 0)\n }\n\n\treturn result\n}", "title": "" }, { "docid": "bd8930729be5ef1f848d3907dd58acb8", "score": "0.5917559", "text": "func keyToID(key string, n uint) uint64 {\n\t//SomeHash\n\treturn murmur3.Sum64([]byte(key)) >> (uint(64 - n))\n}", "title": "" }, { "docid": "6731950e750ab712df0528a048764582", "score": "0.5884425", "text": "func reduceFunc(input []mapreduce.KeyValue) (result []mapreduce.KeyValue) {\n\t// \tMaybe it's easier if we have an auxiliary structure? Which one?\n\t//\n\t// \tYou can check if a map have a key as following:\n\t// \t\tif _, ok := myMap[myKey]; !ok {\n\t//\t\t\t// Don't have the key\n\t//\t\t}\n\t//\n\t// \tReduce will receive KeyValue pairs that have string values, you may need\n\t// \tconvert those values to int before being able to use it in operations.\n\t// \tpackage strconv: func Atoi(s string) (int, error)\n\t//\n\t// \tIt's also possible to receive a non-numeric value (i.e. \"+\"). You can check the\n\t// \terror returned by Atoi and if it's not 'nil', use 1 as the value.\n\n\twordMap := make(map[string]int)\n\twordKeyVal := make([]mapreduce.KeyValue, 0)\n\t\n\tfor _, keyVal := range input {\n\t\tvalue, exists := wordMap[keyVal.Key]\n\t\tif !exists {\n\t\t\tvalue = 0\n\t\t}\n\t\tcurrrentValue, err := strconv.Atoi(keyVal.Value)\n\t\tif err != nil {\n\t\t\tcurrrentValue = 1\n\t\t}\n\t\twordMap[keyVal.Key] = value + currrentValue\n\t\t\n\t}\n\t\n\tfor key, value := range wordMap {\n\t\twordKeyVal = append(wordKeyVal, mapreduce.KeyValue{Key: key, Value: strconv.Itoa(value)})\n\t}\n\t\n\treturn wordKeyVal\n}", "title": "" }, { "docid": "159e16b2b7a1126ff97ae1b660c631da", "score": "0.58646744", "text": "func doMap(\n\tjobName string, // the name of the MapReduce job\n\tmapTaskNumber int, // which map task this is\n\tinFile string,\n\tnReduce int, // the number of reduce task that will be run (\"R\" in the paper)\n\tmapF func(file string, contents string) []KeyValue,\n) {\n\tfiledata, err := ioutil.ReadFile(inFile)\n\tcheckErr(err)\n\tcontent := string(filedata)\n\n\t// Call user-defined map function for the file's content.\n\tkvpairs := mapF(inFile, content)\n\n\t// Stores json encoders for each intermediate file\n\tfileEncoders := make(map[string]*json.Encoder)\n\n\t// Create nReduce number of intermediate files\n\tfor i:= 0; i < nReduce; i++ {\n\t\toutputFileName := reduceName(jobName, mapTaskNumber, i)\n\t\toutputFile, err := os.Create(outputFileName)\n\t\tdefer outputFile.Close()\n\n\t\tcheckErr(err)\n\n\t\tencoder := json.NewEncoder(outputFile)\n\t\tfileEncoders[outputFileName] = encoder\n\t}\n\n\t// Assign kv pairs to corresponding intermediate files for reducer to read.\n\tfor _, kv := range kvpairs {\n\t\tkey := kv.Key\n\t\treduceTaskNumber := (int(ihash(key)) % nReduce)\n\t\treduceFileName := reduceName(jobName, mapTaskNumber, reduceTaskNumber)\n\n\t\terr := fileEncoders[reduceFileName].Encode(kv)\n\t\tcheckErr(err)\n\t}\n}", "title": "" }, { "docid": "325fa28c06efc164dcd5d3f509e7f0a3", "score": "0.58451426", "text": "func doReduce(\njobName string, // the name of the whole MapReduce job\nreduceTaskNumber int, // which reduce task this is\nnMap int, // the number of map tasks that were run (\"M\" in the paper)\nreduceF func(key string, values []string) string,\n) {\n\t// TODO:\n\t// You will need to write this function.\n\t// You can find the intermediate file for this reduce task from map task number\n\t// m using reduceName(jobName, m, reduceTaskNumber).\n\t// Remember that you've encoded the values in the intermediate files, so you\n\t// will need to decode them. If you chose to use JSON, you can read out\n\t// multiple decoded values by creating a decoder, and then repeatedly calling\n\t// .Decode() on it until Decode() returns an error.\n\t//\n\t// You should write the reduced output in as JSON encoded KeyValue\n\t// objects to a file named mergeName(jobName, reduceTaskNumber). We require\n\t// you to use JSON here because that is what the merger than combines the\n\t// output from all the reduce tasks expects. There is nothing \"special\" about\n\t// JSON -- it is just the marshalling format we chose to use. It will look\n\t// something like this:\n\t//\n\t// enc := json.NewEncoder(mergeFile)\n\t// for key in ... {\n\t// \tenc.Encode(KeyValue{key, reduceF(...)})\n\t// }\n\t// file.Close()\n\n\n\t/**\n\t1.读intermediate files\n\t2.排序\n\t 为什么要排序? 为了方便有些任务需要排序后的数据,因此提供了排序功能。\n\t3.调用reduceF\n\t4.writes the output to disk.\n\t */\n\n\tfmt.Println(\"doReduce\")\n\tkeys := []string{}\n\tvar line KeyValue\n\treduceMap := map[string][]string{}\n\tfor i := 0; i < nMap; i++ {\n\t\treduceName := reduceName(jobName, i, reduceTaskNumber);\n\t\tf, err := os.Open(reduceName);\n\t\tif err != nil {\n\t\t\tlog.Fatal(\"open file error\")\n\t\t}\n\t\tdec := json.NewDecoder(f)\n\t\tfor {\n\t\t\tif err := dec.Decode(&line); err == nil {\n\t\t\t\treduceMap[line.Key] = append(reduceMap[line.Key], line.Value)\n\t\t\t\tcontinue\n\t\t\t}\n\t\t\tbreak\n\t\t}\n\t\tf.Close()\n\t}\n\n\t// fmt.Println(\"reduceMap=\", reduceMap)\n\tfor key := range reduceMap {\n\t\tkeys = append(keys, key)\n\t}\n\n\t//sort\n\tsort.Strings(keys)\n\n\tmergeFile := mergeName(jobName, reduceTaskNumber)\n\tf := openFile(mergeFile)\n\tenc := json.NewEncoder(f)\n\n\tfor _, key := range keys {\n\t\tenc.Encode(KeyValue{Key:key, Value:reduceF(key, reduceMap[key])})\n\t}\n\n\tf.Close()\n\n}", "title": "" }, { "docid": "91a6c11079178a93f25c81ec9d4a4ff6", "score": "0.582277", "text": "func reduceFunc(input []mapreduce.KeyValue) (result []mapreduce.KeyValue) {\n\t// \tMaybe it's easier if we have an auxiliary structure? Which one?\n\t//\n\t// \tYou can check if a map have a key as following:\n\t// \t\tif _, ok := myMap[myKey]; !ok {\n\t//\t\t\t// Don't have the key\n\t//\t\t}\n\t//\n\t// \tReduce will receive KeyValue pairs that have string values, you may need\n\t// \tconvert those values to int before being able to use it in operations.\n\t// \tpackage strconv: func Atoi(s string) (int, error)\n\t//\n\t// \tIt's also possible to receive a non-numeric value (i.e. \"+\"). You can check the\n\t// \terror returned by Atoi and if it's not 'nil', use 1 as the value.\n\n\t/////////////////////////\n\t// YOUR CODE GOES HERE //\n\t/////////////////////////\n\n\n\tresult = make([]mapreduce.KeyValue, 0)\n\tm := make(map[string]string)\n\t\n\tfor _ , element := range input {\n\t\tif _, ok := m[element.Key]; !ok {\n\t\t\t// Don't have the key\n\t\t\t//m[element.Key] = strconv.Atoi(element.Value)\n\t\t\tm[element.Key] = element.Value \n\t\t} else {\n\t\t\t val1 , err1 := strconv.Atoi(m[element.Key])\n\t\t\t if err1 != nil {\n\t\t\t \tval1 = 1\n\t\t\t }\n\t\t\t val2 , err2 := strconv.Atoi(element.Value)\n\t\t\t if err2 != nil {\n\t\t\t \tval2 = 1\n\t\t\t }\n\t\t\tm[element.Key] = strconv.Itoa(val1 + val2)\n\t\t}\n\t}\n\n\tfor key, value := range m {\n\t\t//aux := mapreduce.KeyValue{Key:k , Value: strconv.Itoa(m[k])}\n\t\taux := mapreduce.KeyValue{Key:key , Value: value}\n\t\tresult = append ( result , aux )\n\t}\n\treturn result\n\t\n}", "title": "" }, { "docid": "5b684ea72e3fdfb118e6fce4d389bc82", "score": "0.5741326", "text": "func reduceFunc(input []mapreduce.KeyValue) (result []mapreduce.KeyValue) {\n\t// \tMaybe it's easier if we have an auxiliary structure? Which one?\n\t//\n\t// \tYou can check if a map have a key as following:\n\t// \t\tif _, ok := myMap[myKey]; !ok {\n\t//\t\t\t// Don't have the key\n\t//\t\t}\n\t//\n\t// \tReduce will receive KeyValue pairs that have string values, you may need\n\t// \tconvert those values to int before being able to use it in operations.\n\t// \tstrconv.Atoi(string_number)\n\n\t/////////////////////////\n\t// YOUR CODE GOES HERE //\n\t/////////////////////////\n\treturn make([]mapreduce.KeyValue, 0)\n}", "title": "" }, { "docid": "a68e310d7ee2bdb05ea5f6622bb993e3", "score": "0.570592", "text": "func mapF(filename string, contents string) []mapreduce.KeyValue {\n // Your code here (Part II).\n count_dict := make(map[string]int)\n\n var str_buf bytes.Buffer\n for _, ch := range contents {\n if unicode.IsLetter(ch) {\n str_buf.WriteString(string(ch))\n } else {\n if str_buf.Len() > 0 {\n word := str_buf.String()\n bucket, key_exist := count_dict[word]\n if key_exist == false {\n count_dict[word] = 1;\n } else {\n count_dict[word] = bucket + 1;\n }\n }\n str_buf.Reset()\n }\n }\n\n if str_buf.Len() > 0 {\n word := str_buf.String()\n bucket, key_exist := count_dict[word]\n if key_exist == false {\n count_dict[word] = 1;\n } else {\n count_dict[word] = bucket + 1;\n }\n }\n\n map_kv := make([]mapreduce.KeyValue, 0)\n for word, cnt := range count_dict {\n map_kv = append(map_kv, mapreduce.KeyValue{word, strconv.Itoa(cnt)})\n }\n\n return map_kv\n}", "title": "" }, { "docid": "3a05e93011742f06fa03afab042c0bb0", "score": "0.5690696", "text": "func DoMap(m,taskId, nReduce int, filename string, mapf func(string, string) []KeyValue) error {\n\n\t// Step 1: Read from Input file\n\tfile, err := os.Open(filename)\n\n\tif err != nil {\n\t\tlog.Fatalf(\" DoMap cannot open %v\", filename)\n\t\treturn err\n\t}\n\tcontent, err := ioutil.ReadAll(file)\n\tif err != nil {\n\t\tlog.Fatalf(\"DoMap cannot read %v\", filename)\n\t\treturn err\n\t}\n\n\tfile.Close()\n\n\t// Step 2: Run Map function\n\tkva := mapf(filename, string(content))\n\n\t// Step 3: Partition the result of this Map process to intermediate k/v\n\tvar intermediate []ByKey\n\tfor i := 0; i < nReduce; i++ {\n\t\tintermediate = append(intermediate, ByKey{})\n\t}\n\n\tfor _, kv := range kva {\n\t\tr := ihash(kv.Key) % nReduce\n\t\tintermediate[r] = append(intermediate[r], kv)\n\t}\n\n\t// Step 4: Intermediate to disk\n\tvar intermediates []string\n\n\tfor i := 0; i < nReduce; i++ {\n\n\t\treduceName := fmt.Sprintf(\"mr-%v-%v.txt\", m, i)\n\t\tintermediates = append(intermediates, reduceName)\n\t\tofile, _ := os.Create(reduceName)\n\t\tenc := json.NewEncoder(ofile)\n\t\tfor _, kv := range intermediate[i] {\n\t\t\terr := enc.Encode(&kv)\n\t\t\tif err != nil {\n\t\t\t\tlog.Fatalf(\"DoMap Step 4: Intermediate to disk error %v\", filename)\n\t\t\t\treturn err\n\t\t\t}\n\t\t}\n\t\tofile.Close()\n\t}\n\n\t// Notify the master\n\tCallNotify(m, taskId, intermediates, false)\n\n\t// Return the related intermediate files\n\treturn nil\n}", "title": "" }, { "docid": "60a4b9397f84e3bbf338e52920be442c", "score": "0.5673821", "text": "func splitNBuckets(m *Master) {\n\t// fmt.Printf(\"All map tasks hava done, it's time to split into %v buckets\\n\", reduceTasksTodo)\n\t// fmt.Println(intermediateFiles)\n\tkva := []KeyValue{}\n\tfor _, filename := range intermediateFiles {\n\t\tfile, err := os.Open(filename)\n\t\tif err != nil {\n\t\t\tlog.Fatal(err)\n\t\t}\n\n\t\tdec := json.NewDecoder(file)\n\t\tfor {\n\t\t\tvar kv KeyValue\n\t\t\tif err := dec.Decode(&kv); err != nil {\n\t\t\t\tbreak\n\t\t\t}\n\t\t\tkva = append(kva, kv)\n\t\t}\n\n\t\t// fmt.Println(filename, \"has read\")\n\t\t// fmt.Println(len(kva))\n\t\t// fmt.Println(kva[100], kva[1234])\n\t}\n\n\tsort.Sort(ByKey(kva))\n\n\tlength := len(kva)\n\tbucketSize := length / reduceTasksTodo\n\tif bucketSize < 1 {\n\t\tbucketSize = 1\n\t}\n\t// fmt.Println(\"Bucket Size: \", bucketSize)\n\n\tstart := 0\n\tendPos := 0\n\tindex := 0\n\n\tfor {\n\t\tif start+bucketSize <= length-1 {\n\t\t\tendPos = start + bucketSize\n\n\t\t\t// same key should assign into the same reduce task\n\t\t\tfor endPos < length-1 && kva[endPos].Key == kva[endPos+1].Key {\n\t\t\t\tendPos++\n\t\t\t}\n\t\t} else {\n\t\t\tendPos = length - 1\n\t\t}\n\t\tendPos++\n\n\t\t// fmt.Println(\"start: \", start, \", end:\", endPos)\n\t\ttempFileName := \"mr-tmp-\" + strconv.Itoa(index)\n\n\t\tfile, err := os.Create(tempFileName)\n\t\tif err != nil {\n\t\t\tlog.Fatal(err)\n\t\t}\n\n\t\tenc := json.NewEncoder(file)\n\t\t// fmt.Println(\"bucket \", index, \" : \", kva[start:endPos])\n\t\tfor _, kv := range kva[start:endPos] {\n\t\t\terr := enc.Encode(&kv)\n\t\t\tif err != nil {\n\t\t\t\tlog.Fatal(err)\n\t\t\t}\n\t\t}\n\n\t\tfile.Close()\n\n\t\tm.reduceTasks[index].filename = tempFileName\n\t\tm.reduceTasks[index].state = IDLE\n\n\t\tstart = endPos\n\t\tindex++\n\t\tif index == reduceTasksTodo {\n\t\t\tbreak\n\t\t}\n\t}\n\t// fmt.Println(m.reduceTasks)\n}", "title": "" }, { "docid": "78c65753a6419f76f38876ad075a5a70", "score": "0.5633266", "text": "func hash(key string) int {\n\tindex := 0\n\tfor _, val := range key {\n\t\tindex += int(val)\n\t}\n\treturn index % tableLen\n}", "title": "" }, { "docid": "fb0a37ff624c2af50eef5fb41e7ed3e1", "score": "0.560579", "text": "func hash(key string, arrSize int) int {\n\tsum := 0\n\tfor _, v := range key {\n\t\tsum += int(v)\n\t}\n\n\treturn sum % arrSize\n}", "title": "" }, { "docid": "9ac41f00d714a9a2edcccbac7f9a18c0", "score": "0.55685294", "text": "func hash_intermediate(intermediate []KeyValue, nReduce int64, task_id int64) bool {\n\tintermediate_files := make(map[int64][]KeyValue)\n\n\tfor _, v := range intermediate {\n\t\ttmp_slice := intermediate_files[int64(ihash(v.Key))%nReduce]\n\t\tintermediate_files[int64(ihash(v.Key))%nReduce] = append(tmp_slice, v)\n\t}\n\n\tfor i, slice := range intermediate_files {\n\t\toname := fmt.Sprintf(\"mr-%d-%d\", task_id, i)\n\t\tofile, _ := os.Create(oname)\n\t\tenc := json.NewEncoder(ofile)\n\t\tfor _, kv := range slice {\n\t\t\tif err := enc.Encode(&kv); err != nil {\n\t\t\t\tlog.Fatalf(\"Error occurs when encode: %v\", err)\n\t\t\t}\n\t\t}\n\t\tofile.Close()\n\t}\n\n\treturn true\n}", "title": "" }, { "docid": "09b05cbb8f1aac6390e38e1435f37f26", "score": "0.5546753", "text": "func reduceF(key string, values []string) string {\n\t// Your code here (Part II).\n\tvar dict = make(map[string]int)\n\tvar res string\n\tfor _, word := range values {\n\t\tv, ok := dict[word]\n\t\tif ok == false {\n\t\t\tdict[word] = 1\n\t\t} else {\n\t\t\tdict[word] = v + 1\n\t\t}\n\t}\n\tfor _, v := range dict {\n\t\tres += strconv.Itoa(v)\n\t\tres += \"\\n\"\n\t}\n\tres = strings.TrimRight(res, \"\\n\")\n\treturn res\n}", "title": "" }, { "docid": "5d51e05b63dcb2ab509415a0086a1e9d", "score": "0.55301625", "text": "func reduceF(key string, values []string) string {\n\t// Your code here (Part V).\n\thashMap := make(map[string]int)\n\tfor _, value := range values {\n\t\thashMap[value]++\n\t}\n\tres := strconv.Itoa(len(hashMap)) + \" \"\n\tkeys := make([]string, len(hashMap))\n\ti := 0\n\tfor k := range hashMap {\n\t\tkeys[i] = k\n\t\ti++\n\t}\n\tsort.Slice(keys, func(i, j int) bool {\n\t\treturn strings.Compare(keys[i], keys[j]) < 0\n\t})\n\tfor _, k := range keys {\n\t\tres += k + \",\"\n\t}\n\t// remove last comma\n\tres = res[:len(res)-1]\n\treturn res\n}", "title": "" }, { "docid": "811853bfa332ca7eb340f19328d36dae", "score": "0.55230963", "text": "func Worker(mapf func(string, string) []KeyValue, reducef func(string, []string) string) {\n\n\t// Your worker implementation here.\n\ttask := call_get_task()\n\n\t// while task type is map, reduce or wait (DONE==task_type exits)\n\tfor task.TaskType == \"m\" || task.TaskType == \"r\" || task.TaskType == \"w\" {\n\t\tfmt.Println(task)\n\n\t\tif task.TaskType == \"m\" {\n\t\t\t// Get file content, compute map\n\t\t\tifile := task.TaskNumber\n\t\t\tcontent := get_content(ifile)\n\t\t\tkva := mapf(ifile, string(content))\n\n\t\t\t// Output result, nReduce buckets, \"map-out-X-Y\"\n\t\t\tnReduce := task.NReduce\n\t\t\tintermediate_files := []*os.File{}\n\t\t\tfor i := 0; i < nReduce; i++ {\n\n\t\t\t\t// trim path to just input file name\n\t\t\t\tt := filepath.Base(ifile)\n\t\t\t\tt = strings.Split(t, \".txt\")[0]\n\n\t\t\t\ttemp_name := fmt.Sprintf(\"map-out-%s-%d.temp*\", t, i)\n\t\t\t\ttemp_file, err := ioutil.TempFile(\"\", temp_name)\n\t\t\t\tdefer temp_file.Close()\n\t\t\t\tif err != nil {\n\t\t\t\t\tlog.Fatalf(\"error creating temp file %s\", temp_name)\n\t\t\t\t}\n\t\t\t\tintermediate_files = append(intermediate_files, temp_file)\n\t\t\t}\n\t\t\t// For each KV, compute hash and append to respective file\n\t\t\tfor _, kv := range kva {\n\t\t\t\tY := ihash(kv.Key) % nReduce\n\t\t\t\tfmt.Fprintf(intermediate_files[Y], \"%v %v\\n\", kv.Key, kv.Value)\n\t\t\t}\n\t\t\t// Atomic Rename\n\t\t\tfor _, file := range intermediate_files {\n\t\t\t\ttemp_name := file.Name()\n\t\t\t\tfile_name := filepath.Base(temp_name)\n\t\t\t\tfile_name = strings.Split(file_name, \".temp\")[0]\n\t\t\t\tos.Rename(temp_name, file_name)\n\t\t\t}\n\n\t\t\t// Complete Task\n\t\t\tcall_complete_task(task)\n\n\t\t} else if task.TaskType == \"r\" {\n\n\t\t\t// Get all input files for this reduce task, bring KV into memory\n\t\t\tglob_pattern := fmt.Sprintf(\"map-out-*-%s\", task.TaskNumber)\n\t\t\tintermediate_files, err := filepath.Glob(glob_pattern)\n\t\t\tif err != nil {\n\t\t\t\tlog.Fatalf(\"cannot glob %s\", glob_pattern)\n\t\t\t}\n\t\t\tintermediate := []KeyValue{}\n\t\t\t// Add all files for these keys into array\n\t\t\tfor _, filename := range intermediate_files {\n\t\t\t\tcontent := get_content(filename)\n\t\t\t\tlines := strings.Split(content, \"\\n\")\n\t\t\t\tfor _, line := range lines {\n\t\t\t\t\t// Last line can be empty..\n\t\t\t\t\tif line != \"\" {\n\t\t\t\t\t\ts := strings.Split(line, \" \")\n\t\t\t\t\t\tk := s[0]\n\t\t\t\t\t\tv := s[1]\n\t\t\t\t\t\tkv := KeyValue{k, v}\n\t\t\t\t\t\tintermediate = append(intermediate, kv)\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t// We group all keys together, then call reduce on k, [v], where v all share same key\n\t\t\tsort.Sort(ByKey(intermediate))\n\n\t\t\t// Output reduce to temp file, then atomic rename\n\t\t\ttemp_name := fmt.Sprintf(\"mr-out-%s.temp*\", task.TaskNumber)\n\t\t\ttemp_file, err := ioutil.TempFile(\"\", temp_name)\n\t\t\tdefer temp_file.Close()\n\t\t\tif err != nil {\n\t\t\t\tlog.Fatalf(\"error creating temp file %s\", temp_name)\n\t\t\t}\n\n\t\t\t// Compute reduce\n\t\t\ti := 0\n\t\t\tfor i < len(intermediate) {\n\t\t\t\tj := i + 1\n\t\t\t\tfor j < len(intermediate) && intermediate[j].Key == intermediate[i].Key {\n\t\t\t\t\tj++\n\t\t\t\t}\n\t\t\t\tvalues := []string{}\n\t\t\t\tfor k := i; k < j; k++ {\n\t\t\t\t\tvalues = append(values, intermediate[k].Value)\n\t\t\t\t}\n\t\t\t\toutput := reducef(intermediate[i].Key, values)\n\n\t\t\t\t// this is the correct format for each line of Reduce output.\n\t\t\t\tfmt.Fprintf(temp_file, \"%v %v\\n\", intermediate[i].Key, output)\n\t\t\t\ti = j\n\t\t\t}\n\n\t\t\t// Output result, \"mr-out-X\"\n\t\t\t// Atomic Rename\n\t\t\ttemp_name = temp_file.Name()\n\t\t\tfile_name := filepath.Base(temp_name)\n\t\t\tfile_name = strings.Split(file_name, \".temp\")[0]\n\t\t\tos.Rename(temp_name, file_name)\n\n\t\t\t// Complete Task\n\t\t\tcall_complete_task(task)\n\n\t\t} else {\n\t\t\t// We recieved a \"w\" task, or wait. This happens when other works are doing map or reduce tasks and we need to wait for further instruction.\n\t\t\t// Wait 5 secs\n\t\t\ttime.Sleep(5 * time.Second)\n\t\t}\n\n\t\t// Get next task\n\t\ttask = call_get_task()\n\t}\n\n\t// Done all\n}", "title": "" }, { "docid": "77842a0241ef535f87bc1499219e6c88", "score": "0.5513046", "text": "func shuffleFunc(task *mapreduce.Task, key string) (reduceJob int) {\n\th := fnv.New32a()\n\th.Write([]byte(key))\n\treturn int(h.Sum32() % uint32(task.NumReduceJobs))\n}", "title": "" }, { "docid": "77842a0241ef535f87bc1499219e6c88", "score": "0.5513046", "text": "func shuffleFunc(task *mapreduce.Task, key string) (reduceJob int) {\n\th := fnv.New32a()\n\th.Write([]byte(key))\n\treturn int(h.Sum32() % uint32(task.NumReduceJobs))\n}", "title": "" }, { "docid": "77842a0241ef535f87bc1499219e6c88", "score": "0.5513046", "text": "func shuffleFunc(task *mapreduce.Task, key string) (reduceJob int) {\n\th := fnv.New32a()\n\th.Write([]byte(key))\n\treturn int(h.Sum32() % uint32(task.NumReduceJobs))\n}", "title": "" }, { "docid": "77842a0241ef535f87bc1499219e6c88", "score": "0.5513046", "text": "func shuffleFunc(task *mapreduce.Task, key string) (reduceJob int) {\n\th := fnv.New32a()\n\th.Write([]byte(key))\n\treturn int(h.Sum32() % uint32(task.NumReduceJobs))\n}", "title": "" }, { "docid": "77842a0241ef535f87bc1499219e6c88", "score": "0.5513046", "text": "func shuffleFunc(task *mapreduce.Task, key string) (reduceJob int) {\n\th := fnv.New32a()\n\th.Write([]byte(key))\n\treturn int(h.Sum32() % uint32(task.NumReduceJobs))\n}", "title": "" }, { "docid": "7bacbacedaf23467b7b258bd54193924", "score": "0.54683644", "text": "func Worker(mapf func(string, string) []KeyValue, reducef func(string, []string) string) {\n\tlog.SetFlags(log.Ldate | log.Ltime | log.Lmicroseconds | log.Lshortfile)\n\tlog.SetOutput(ioutil.Discard)\n\n\tworkerId, nMap, nReduce := RegisterWorker()\n\t//f, err := os.OpenFile(\"log_worker_\"+strconv.Itoa(workerId), os.O_RDWR|os.O_CREATE, 0666)\n\t//if err != nil {\n\t//\tlog.Fatal(err)\n\t//}\n\t//log.SetOutput(io.MultiWriter(os.Stdout, f))\n\tlog.Printf(\"Worker %d started, NMap:%d, NReduce:%d.\\n\", workerId, nMap, nReduce)\n\n\tfor {\n\t\tif CheckCoordinatorDone() {\n\t\t\tlog.Printf(\"MapReduce Done. Close Worker %d.\\n\", workerId)\n\t\t\treturn\n\t\t}\n\t\thasTask, taskType, taskId, filename, finished := FetchTask(workerId)\n\t\t//log.Printf(\"HasTask:%t, taskType:%s, taskId:%s, filename:%s\", hasTask, taskType, taskId, filename)\n\t\tif finished {\n\t\t\tlog.Printf(\"MapReduce task finished. Worker:%d exit!\\n\", workerId)\n\t\t\tbreak\n\t\t}\n\t\tif !hasTask {\n\t\t\tlog.Printf(\"Worker %d receive no task from Coordinator!\", workerId)\n\t\t\ttime.Sleep(time.Second * 5)\n\t\t\tcontinue\n\t\t}\n\n\t\tswitch taskType {\n\t\tcase MapTaskPrefix:\n\t\t\tlog.Printf(\"Worker %d starts task %s-%s\", workerId, taskType, taskId)\n\t\t\tfile, err := os.Open(filename)\n\t\t\tif err != nil {\n\t\t\t\tlog.Fatalf(\"cannot open %v\\n\", filename)\n\t\t\t}\n\t\t\tcontent, err := ioutil.ReadAll(file)\n\t\t\tif err != nil {\n\t\t\t\tlog.Fatalf(\"cannot read %v\\n\", filename)\n\t\t\t}\n\t\t\tfile.Close()\n\t\t\tintermediateKV := mapf(filename, string(content))\n\t\t\tmapId, err := strconv.Atoi(taskId)\n\t\t\tif err != nil {\n\t\t\t\treturn\n\t\t\t}\n\t\t\tintermediateFiles, encoders := CreateIntermediateFiles(mapId, nReduce)\n\t\t\tdefer CloseFiles(intermediateFiles)\n\n\t\t\tfor _, keyValuePair := range intermediateKV {\n\t\t\t\tR := ihash(keyValuePair.Key) % nReduce\n\t\t\t\terr = encoders[R].Encode(&keyValuePair)\n\t\t\t\tif err != nil {\n\t\t\t\t\tlog.Printf(\"encoding %#v failed, err:%v\\n\", keyValuePair, err)\n\t\t\t\t}\n\t\t\t}\n\n\t\t\terr = Rename(intermediateFiles)\n\t\t\tif err != nil {\n\t\t\t\tlog.Printf(\"Rename map files err:%v\", err)\n\t\t\t}\n\t\t\tlog.Printf(\"Worker %d finishes task %s-%s\", workerId, taskType, taskId)\n\n\t\tcase ReduceTaskPrefix:\n\t\t\tlog.Printf(\"Worker %d starts task %s-%s\", workerId, taskType, taskId)\n\n\t\t\tvar intermediateKV []KeyValue\n\t\t\tfor i := 0; i < nMap; i++ {\n\t\t\t\tfilename := fmt.Sprintf(\"mr-%d-%s\", i, taskId)\n\t\t\t\tfile, err := os.Open(filename)\n\t\t\t\tif err != nil {\n\t\t\t\t\tlog.Fatalf(\"cannot open %v\\n, err:%v\", filename, err)\n\t\t\t\t}\n\t\t\t\tdefer file.Close()\n\n\t\t\t\tdecoder := json.NewDecoder(file)\n\t\t\t\tfor {\n\t\t\t\t\tvar kv KeyValue\n\t\t\t\t\tif err := decoder.Decode(&kv); err != nil {\n\t\t\t\t\t\tbreak\n\t\t\t\t\t}\n\t\t\t\t\tintermediateKV = append(intermediateKV, kv)\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tsort.Sort(ByKey(intermediateKV))\n\n\t\t\toname := fmt.Sprintf(\"mr-out-%s\", taskId)\n\t\t\tofile, err := ioutil.TempFile(TmpDirPath, fmt.Sprintf(\"%s.tmp*\", filename))\n\t\t\tdefer ofile.Close()\n\n\t\t\tif err != nil {\n\t\t\t\tlog.Fatal(err)\n\t\t\t}\n\t\t\ti := 0\n\t\t\tfor i < len(intermediateKV) {\n\t\t\t\tj := i + 1\n\t\t\t\tfor j < len(intermediateKV) && intermediateKV[j].Key == intermediateKV[i].Key {\n\t\t\t\t\tj++\n\t\t\t\t}\n\t\t\t\tvalues := []string{}\n\t\t\t\tfor k := i; k < j; k++ {\n\t\t\t\t\tvalues = append(values, intermediateKV[k].Value)\n\t\t\t\t}\n\t\t\t\toutput := reducef(intermediateKV[i].Key, values)\n\n\t\t\t\t// this is the correct format for each line of Reduce output.\n\t\t\t\tfmt.Fprintf(ofile, \"%v %v\\n\", intermediateKV[i].Key, output)\n\n\t\t\t\ti = j\n\t\t\t}\n\n\t\t\terr = os.Rename(ofile.Name(), oname)\n\t\t\tif err != nil {\n\t\t\t\tlog.Fatal(err)\n\t\t\t}\n\n\t\t\tlog.Printf(\"Worker %d finishes task %s-%s\\n\", workerId, taskType, taskId)\n\n\t\tdefault:\n\t\t\tlog.Fatalf(\"Unexpected taskType:%s\\n\", taskType)\n\t\t}\n\t}\n\n}", "title": "" }, { "docid": "b057d49bdfcc545fca51bc466c3aec69", "score": "0.54560995", "text": "func Worker(mapf func(string, string) []KeyValue,\n\treducef func(string, []string) string) {\n\n\t// Your worker implementation here.\n\n\t// uncomment to send the Example RPC to the master.\n\t// CallExample()\n\tpid := os.Getpid()\n\n\tfor {\n\t\targs := GetTaskArgs{fmt.Sprintf(\"%d\", pid)}\n\t\treply := GetTaskReply{}\n\t\t// log.Println(\"Request a task\")\n\t\tfor !call(\"Master.GetTask\", &args, &reply) {\n\t\t}\n\n\t\t// log.Println(args, reply)\n\t\ttaskType := reply.TaskType\n\t\tnReduce := reply.NReduce\n\t\tfileNames := reply.FileNames\n\t\ttaskId := reply.TaskId\n\t\tswitch taskType {\n\t\tcase MAP_TASK:\n\t\t\t{\n\t\t\t\tvar intermediates [][]KeyValue\n\t\t\t\tfor i := 0; i < nReduce; i++ {\n\t\t\t\t\tintermediates = append(intermediates, []KeyValue{})\n\t\t\t\t}\n\n\t\t\t\tif len(fileNames) != 1 {\n\t\t\t\t\tlog.Fatalf(\"No file for map\")\n\t\t\t\t\tlog.Fatalln(fileNames)\n\t\t\t\t\tcontinue\n\t\t\t\t}\n\n\t\t\t\tfilename := fileNames[0]\n\t\t\t\tfile, err := os.Open(filename)\n\n\t\t\t\tif err != nil {\n\t\t\t\t\tlog.Fatalf(\"cannot open %v\", filename)\n\t\t\t\t}\n\n\t\t\t\tcontent, err := ioutil.ReadAll(file)\n\t\t\t\tif err != nil {\n\t\t\t\t\tlog.Fatalf(\"cannot read %v\", filename)\n\t\t\t\t}\n\n\t\t\t\tfile.Close()\n\t\t\t\tkva := mapf(filename, string(content))\n\t\t\t\t// log.Printf(\"after map %v\", kva[0])\n\t\t\t\tfor _, v := range kva {\n\t\t\t\t\ti := ihash(v.Key) % nReduce\n\t\t\t\t\tintermediates[i] = append(intermediates[i], v)\n\t\t\t\t}\n\n\t\t\t\tfor i := 0; i < nReduce; i++ {\n\t\t\t\t\tsort.Sort(ByKey(intermediates[i]))\n\t\t\t\t\ttmpFile, err := ioutil.TempFile(\"\", fmt.Sprintf(\"mr-%d-%d\", taskId, i))\n\n\t\t\t\t\tif err != nil {\n\t\t\t\t\t\tlog.Fatal(err)\n\t\t\t\t\t}\n\t\t\t\t\t// defer os.Remove(tmpFile.Name()) // clean up\n\t\t\t\t\tfor _, v := range intermediates[i] {\n\t\t\t\t\t\tif _, err := fmt.Fprintf(tmpFile, \"%s %s\\n\", v.Key, v.Value); err != nil {\n\t\t\t\t\t\t\tlog.Fatal(err)\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\n\t\t\t\t\ttmpFile.Close()\n\t\t\t\t\terr = os.Rename(tmpFile.Name(), fmt.Sprintf(\"mr-%d-%d\", taskId, i))\n\n\t\t\t\t\tif err != nil {\n\t\t\t\t\t\tlog.Fatal(err)\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\t//notify finish\n\t\t\t\tNotifyFinish(taskId, MAP_TASK)\n\t\t\t}\n\t\tcase REDUCE_TASK:\n\t\t\t{\n\n\t\t\t\ttaskId := reply.TaskId\n\t\t\t\t// log.Printf(\"before start get reduce task\")\n\t\t\t\tintermediateFiles := reply.FileNames\n\t\t\t\tkVal := make(map[string][]string)\n\t\t\t\tfor _, fileName := range intermediateFiles {\n\t\t\t\t\t// log.Printf(\"proccess %v\", fileName)\n\t\t\t\t\tfile, err := os.Open(fileName)\n\t\t\t\t\tif err != nil {\n\t\t\t\t\t\tlog.Fatal(fmt.Sprintf(\"open %s faild\", fileName))\n\t\t\t\t\t\tcontinue\n\t\t\t\t\t}\n\n\t\t\t\t\treader := bufio.NewReader(file)\n\n\t\t\t\t\tfor {\n\t\t\t\t\t\tline, err := reader.ReadString('\\n')\n\t\t\t\t\t\tif err != nil {\n\t\t\t\t\t\t\t_ = file.Close()\n\t\t\t\t\t\t\tbreak\n\t\t\t\t\t\t}\n\t\t\t\t\t\tline = strings.Trim(line, \"\\n\")\n\t\t\t\t\t\tpair := strings.Split(line, \" \")\n\t\t\t\t\t\tkVal[pair[0]] = append(kVal[pair[0]], pair[1])\n\t\t\t\t\t}\n\t\t\t\t\t_ = file.Close()\n\t\t\t\t}\n\t\t\t\ttmpfile, err := ioutil.TempFile(\"\", fmt.Sprintf(\"mr-out-%d\", taskId))\n\t\t\t\tif err != nil {\n\t\t\t\t\tlog.Fatal(err)\n\t\t\t\t}\n\t\t\t\t//do reduce task\n\t\t\t\tfor key, values := range kVal {\n\t\t\t\t\toutput := reducef(key, values)\n\t\t\t\t\t_, _ = fmt.Fprintf(tmpfile, \"%v %v\\n\", key, output)\n\t\t\t\t}\n\t\t\t\terr = tmpfile.Close()\n\t\t\t\tif err != nil {\n\t\t\t\t\tlog.Fatal(err)\n\t\t\t\t}\n\t\t\t\terr = os.Rename(tmpfile.Name(), fmt.Sprintf(\"mr-out-%d\", taskId))\n\t\t\t\tif err != nil {\n\t\t\t\t\tlog.Fatal(err)\n\t\t\t\t}\n\t\t\t\t// log.Printf(fmt.Sprintf(\"mr-out-%d\", taskId))\n\t\t\t\t//notify finish\n\t\t\t\tNotifyFinish(taskId, REDUCE_TASK)\n\t\t\t}\n\t\tdefault:\n\t\t\t{\n\t\t\t\tlog.Panicln(\"not task to do\")\n\t\t\t\ttime.Sleep(100)\n\t\t\t}\n\n\t\t}\n\t}\n\n}", "title": "" }, { "docid": "15f3bb787551b24ad50bfedf327bf1ac", "score": "0.5416984", "text": "func (f *Feed) mapKey() uint64 {\n\tserializedData := make([]byte, feedLength)\n\tf.binaryPut(serializedData)\n\thasher := hashPool.Get().(hash.Hash)\n\tdefer hashPool.Put(hasher)\n\thasher.Reset()\n\thasher.Write(serializedData)\n\thash := hasher.Sum(nil)\n\treturn *(*uint64)(unsafe.Pointer(&hash[0]))\n}", "title": "" }, { "docid": "ea0417bc8e5792c5175837ea8a6fba28", "score": "0.54104674", "text": "func doMap(\n\tjobName string, // the name of the MapReduce job\n\tmapTaskNumber int, // which map task this is\n\tinFile string,\n\tnReduce int, // the number of reduce tasks that will run (\"R\" in the paper)\n\tmapF func(file string, contents string) []KeyValue,\n) {\n\t// \n\t// fmt.Println(\"11111111111111111111111\")\n\t// 这里的infile就是对应的mapfunc中创建的1-10w的文件\n\t// 824-mrinput-0.txt\n\tdata, e := ioutil.ReadFile(inFile)\n\tif e != nil {\n\t panic(\"ReadFile\")\n\t}\n\t// data是文件读取的中的数据,是数组格式,数字是1到10w\n\t// pairs是一个数组,里面对应的格式是一个对象,key是数字,后面是一个空字符\n\tpairs := mapF(inFile, string(data))\n\tencoders := make([]*json.Encoder, nReduce)\n\t// fmt.Println(encoders)\n\tfor i, _ := range encoders {\n\t\t// 这里reduceName(jobName, mapTaskNumber, i)产生map的结果名字文件\n\t\t// mrtmp.test-0-0\n\t\t// fmt.Printf(reduceName(jobName, mapTaskNumber, i))\n\t\t// 不存在就创建他\n\t\tf, e := os.OpenFile(reduceName(jobName, mapTaskNumber, i), os.O_WRONLY | os.O_CREATE, 0666)\n\t\tif e != nil {\n\t\t \tpanic(\"OpenFile\")\n\t\t}\n\t\t// 对于json.NewEncoder函数\n\t\t// 这里的json.NewEncoder函数是产生的一个可写入的json的pipline,将这个pipline存入encoders数组里面\n\n\t\tencoders[i] = json.NewEncoder(f)\n\t\t// fmt.Println(encoders)\n\t\tdefer f.Close()\n\t}\n\t// 上一布针对每一个file产生里一个独特的pipline,存储在encoders中,供调用者写入使用\n\t// 将很长的pairs按照reduce的数目,分到几个reduce文件中\n\tfor _, pair := range pairs {\n\t\ti := ihash(pair.Key) % nReduce\n\t\t// 在这里是一次一次输入,所以造成了value都为空的原因\n\t\te := encoders[i].Encode(&pair)\n\t\tif e != nil {\n\t\t\tpanic(\"Encode\")\n\t\t}\n\t}\n}", "title": "" }, { "docid": "31d4b2c1216d6ccf11d22ede1e86487d", "score": "0.5330717", "text": "func doReduce(index int, files []string, reducef func(string, []string) string) error {\n\t// process thru all the files under the tmp directory\n\tkva := []KeyValue{}\n\n\tfor _, file := range files {\n\t\t// open file to reduce to decode key-value from disk for processing\n\n\t\tifile, err := os.Open(file)\n\t\tif err != nil {\n\t\t\tlog.Fatalf(\"Error opening up intermediate file for reduce %v\", file)\n\t\t\tpanic(err)\n\t\t}\n\t\tdefer ifile.Close()\n\n\t\tdecoder := json.NewDecoder(ifile)\n\n\t\t// aggregate all key-value pairs and sort them out before writing to output file\n\t\tfor {\n\t\t\tvar kv KeyValue\n\t\t\tif err := decoder.Decode(&kv); err != nil {\n\t\t\t\tbreak\n\t\t\t}\n\n\t\t\tkva = append(kva, kv)\n\t\t}\n\t}\n\n\t// Call reduce on each distinct key in intermediate[]\n\tofilename := fmt.Sprintf(\"mr-out-%v\", index)\n\tofile, err := os.OpenFile(ofilename, os.O_CREATE|os.O_WRONLY, 0777)\n\tif err != nil {\n\t\tlog.Fatalf(\"Error opening file for writing out reduce output %v\", ofilename)\n\t\tpanic(err)\n\t}\n\tdefer ofile.Close()\n\n\tsort.Sort(ByKey(kva))\n\n\t// read each key and associated values to build a reduce output of key value per line\n\ti := 0\n\tfor i < len(kva) {\n\t\tj := i + 1\n\t\tfor j < len(kva) && kva[j].Key == kva[i].Key {\n\t\t\tj++\n\t\t}\n\n\t\tkey := kva[i].Key\n\t\tvalues := []string{}\n\t\tfor k := i; k < j; k++ {\n\t\t\tvalues = append(values, kva[k].Value)\n\t\t}\n\n\t\tvalue := reducef(kva[i].Key, values)\n\n\t\tfmt.Fprintf(ofile, \"%v %v\\n\", key, value)\n\n\t\ti = j\n\t}\n\n\t// notify co-ordinator of the task done\n\targs := ResponseTaskArgs{Index: index}\n\treply := ResponseTaskReply{}\n\tif ok := call(\"Coordinator.SetTaskCompleted\", &args, &reply); !ok {\n\t\tlog.Fatalf(\"Failed reporting reduce task completion to coordinator\")\n\t}\n\n\treturn nil\n}", "title": "" }, { "docid": "0fe96745498094fe5ccfc497079603e3", "score": "0.5294652", "text": "func reduceF(key string, values []string) string {\n\t// TODO: you also have to write this function\n\tres := 0\n\tfor _, v := range values {\n\t\tn, err := strconv.Atoi(v)\n\t\tif err != nil {\n\t\t\tn = 0\n\t\t}\n\t\tres += n\n\t}\n\treturn strconv.Itoa(res)\n}", "title": "" }, { "docid": "2f9778c7962e79c9fce85b862b0ff300", "score": "0.52831674", "text": "func reduceF(key string, values []string) string {\n\treturn strconv.Itoa(len(values))\n}", "title": "" }, { "docid": "dbed8ebb202886b52825b04d9f588c1b", "score": "0.52652836", "text": "func MapTask(filename string, mapf func(string,string)[]KeyValue) bool {\n create := CreateInterFiles()\n if !create {\n return false\n }\n\t\tfile, err := os.Open(filename)\n\t\tif err != nil {\n\t\t\tlog.Fatalf(\"cannot open %v\", filename)\n return false\n\t\t}\n\t\tcontent, err := ioutil.ReadAll(file)\n\t\tif err != nil {\n\t\t\tlog.Fatalf(\"cannot read %v\", filename)\n return false\n\t\t}\n //fmt.Println(content)\n\t\tfile.Close()\n //fmt.Println(string(content))\n\t\tkva := mapf(filename, string(content))\n for _,kv := range kva {\n reduceFileNo := (ihash(kv.Key) % CurrentWorker.R)\n WriteMapTo(reduceFileNo,kv)\n }\n return true\n}", "title": "" }, { "docid": "b23a98eaed34bc8e80cb66dcf9f9e84b", "score": "0.5245433", "text": "func BenchmarkKeyHashUint64Key(b *testing.B) {\n\tb.StopTimer()\n\tm := make(map[uint64]int)\n\tfor i := ADD_PATH_COUNT; i > 0; i-- {\n\t\tx := uint64(i)\n\t\tm[x] = i\n\t}\n\tb.StartTimer()\n\tfor i := ADD_PATH_COUNT; i > 0; i-- {\n\t\tm[2] = m[1]\n\t\tm[1000] = m[1001]\n\t\tm[5000] = m[5001]\n\t\tm[9999] = m[9991]\n\t\tm[100000] = m[100001]\n\t\tm[200000] = m[200001]\n\n\t}\n}", "title": "" }, { "docid": "96f13190b7be873711fc747ae4bbcb57", "score": "0.52429014", "text": "func Reduce(key string, values *list.List) string {\n\t// Note:\n\t// The key argument holds the key common to all values in the values argument\n\t// The values argument is a list of value strings with the given key.\n\t// You need to:\n\t// (1) Reduce the all of the values in the values list\n\t// (2) Return the reduced/summed up values as a string\n sum := 0\n for count_str_it := values.Front(); count_str_it != nil; count_str_it = count_str_it.Next() {\n count_str := count_str_it.Value.(string)\n count, _ := strconv.Atoi(count_str)\n sum += count\n }\n return strconv.Itoa(sum)\n}", "title": "" }, { "docid": "257fa2fd943c16c6b6b5b0f27f837337", "score": "0.520149", "text": "func Hash(val, key int) int {\n\treturn val % key\n}", "title": "" }, { "docid": "abb772930e68732a9f9e6a55a1a4afc8", "score": "0.519663", "text": "func benchmarkLotsReadsSequential(m IMap, b *testing.B, numKeys, numReads int) {\n\tcurrentKey := 0\n\t/* Initialize the map */\n\tInitializeMap(numKeys, m)\n\tb.ResetTimer()\n\truntime.GOMAXPROCS(runtime.NumCPU())\n\tb.RunParallel(func(pb *testing.PB) {\n\t\tfor pb.Next() {\n\t\t\trand.Seed(time.Now().UTC().UnixNano())\n\t\t\tfor i := 0; i < numReads; i++ {\n\t\t\t\tk := currentKey\n\t\t\t\tcurrentKey = (currentKey + 1) % numKeys\n\t\t\t\tv, ok := m.Get(k)\n\t\t\t\tif ok {\n\t\t\t\t\texpectedV := fmt.Sprintf(\"%12d\", k)\n\t\t\t\t\tif v != expectedV {\n\t\t\t\t\t\tb.Error(\"Wrong value for key\", k, \". Expect \", expectedV, \". Got \", v)\n\t\t\t\t\t}\n\t\t\t\t} else {\n\t\t\t\t\tb.Error(\"Failed to get key \", k)\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t})\n}", "title": "" }, { "docid": "a5f95b40902304c632eb462c7a42f70e", "score": "0.51901233", "text": "func reduceF(key string, values []string) string {\n // Your code here (Part II).\n cnt := 0\n for _, str := range values {\n local_cnt, atoi_err := strconv.Atoi(str)\n if atoi_err != nil {\n fmt.Printf(\"Error in %s\\n\", atoi_err)\n continue\n }\n cnt += local_cnt\n }\n\n reduce_out := fmt.Sprintf(\"%d\", cnt)\n return reduce_out\n}", "title": "" }, { "docid": "5b2c41fc7cc5d622d30a12702dbff9d4", "score": "0.518963", "text": "func (m Map) Reduce(initial interface{}, reduceFn ReduceFunc) interface{} {\n\tif reduceFn == nil {\n\t\treturn initial\n\t}\n\n\tmemo := initial\n\tfor k, v := range m {\n\t\tmemo = reduceFn(memo, k, v)\n\t}\n\treturn memo\n}", "title": "" }, { "docid": "53795a726e11bb9bf0a810d35ad96124", "score": "0.51838374", "text": "func Worker(mapf func(string, string) []KeyValue,\n\treducef func(string, []string) string) {\n\n\tpid := os.Getpid()\n\tCallRegisterWorker(pid)\n\trun := true\n\tx := 1\n\tfor run {\n\t\treply := callTask(x)\n\t\tx += 1\n\t\trun = reply.MasterState != Completed\n\t\tif run && reply.T != nil && len(reply.T.Files) > 0{\n\t\t\tswitch reply.T.Type {\n\t\t\tcase Map:\n\t\t\t\tDoMap(reply.T.Y, reply.T.Id, reply.T.NReduce, reply.T.Files[0], mapf)\n\t\t\tdefault:\n\t\t\t\tDoReduce(reply.T.Y, reply.T.Id, reply.T.Files, reducef)\n\t\t\t}\n\t\t}\n\t}\n\n\tCallDeleteWorker(pid)\n\t//fmt.Printf(\"pid: %v Reduce Process has finished !\\n\",pid)\n}", "title": "" }, { "docid": "fbc5d049acc07e99155dce98ab77d97a", "score": "0.51674193", "text": "func (bm *UsageManager) ReduceKeyCount(username string, count int64) error {\n\tb, err := bm.FindByUserName(username)\n\tif err != nil {\n\t\treturn err\n\t}\n\tif b.KeysCreated < count {\n\t\tb.KeysCreated = 0\n\t} else {\n\t\tb.KeysCreated = b.KeysCreated - count\n\t}\n\treturn bm.DB.Model(b).Update(\"keys_created\", b.KeysCreated).Error\n}", "title": "" }, { "docid": "3060a8a4e59b3f6fa8b1f46650405988", "score": "0.5167301", "text": "func Worker(mapf func(string, string) []KeyValue,\n\treducef func(string, []string) string) {\n\n\t// Your worker implementation here.\n\n\t// uncomment to send the Example RPC to the master.\n\t// CallExample()\n\tvar intermediateEncoderMap map[int]*json.Encoder = nil\n\tvar intermediateFileNameMap map[int]string = nil\n\tfor {\n\t\taskForReply := AskForTask()\n\t\tif askForReply.JobDone {\n\t\t\tbreak\n\t\t}\n\t\tswitch askForReply.CurPhase {\n\t\tcase MapPhase:\n\t\t\tif intermediateEncoderMap == nil {\n\t\t\t\tuuidInstance := uuid.New()\n\t\t\t\tintermediateEncoderMap = make(map[int]*json.Encoder)\n\t\t\t\tintermediateFileNameMap = make(map[int]string)\n\t\t\t\tfor j := 0; j < askForReply.ReduceNum; j++ {\n\t\t\t\t\tfileName := fmt.Sprintf(\"mr-tmp-%+v-%+v-%+v\", uuidInstance.String(), askForReply.MapTaskIdx, j)\n\t\t\t\t\tfile, err := os.OpenFile(fileName, os.O_APPEND|os.O_CREATE|os.O_WRONLY, 0644)\n\t\t\t\t\tif err != nil {\n\t\t\t\t\t\tlog.Fatalf(\"cannot open intermediateEncoderFile:%v mapIdx:%+v reduceIdx:%+v\", fileName, askForReply.MapTaskIdx, j)\n\t\t\t\t\t}\n\t\t\t\t\tintermediateEncoderMap[j] = json.NewEncoder(file)\n\t\t\t\t\tintermediateFileNameMap[j] = fileName\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tfileName := askForReply.MapFile\n\t\t\tfile, err := os.Open(fileName)\n\t\t\tif err != nil {\n\t\t\t\t//log.Fatalf(\"cannot open mapFile:%v\", fileName)\n\t\t\t\tos.Exit(1)\n\t\t\t\tbreak\n\t\t\t}\n\t\t\tcontent, err := ioutil.ReadAll(file)\n\t\t\tif err != nil {\n\t\t\t\tlog.Fatalf(\"cannot read %v\", fileName)\n\t\t\t\tbreak\n\t\t\t}\n\t\t\tfile.Close()\n\t\t\tkva := mapf(fileName, string(content))\n\t\t\tmapPhaseSucc := true\n\t\t\tfor i := 0; i < len(kva); i++ {\n\t\t\t\treduceTaskIdx := ihash(kva[i].Key) % askForReply.ReduceNum\n\t\t\t\tintermediateEncoder := intermediateEncoderMap[reduceTaskIdx]\n\t\t\t\tif err := intermediateEncoder.Encode(kva[i]); err != nil {\n\t\t\t\t\tlog.Fatalf(\"encode kv:%v failed\", kva[i])\n\t\t\t\t\tmapPhaseSucc = false\n\t\t\t\t\tNotifyWorkerTaskStatus(MapPhase, askForReply.MapTaskIdx, Fail)\n\t\t\t\t\tintermediateEncoderMap = nil\n\t\t\t\t\tintermediateFileNameMap = nil\n\t\t\t\t\tbreak\n\t\t\t\t}\n\t\t\t}\n\t\t\tif mapPhaseSucc {\n\t\t\t\tfor reduceIdx, fileName := range intermediateFileNameMap {\n\t\t\t\t\tos.Rename(fileName, fmt.Sprintf(\"mr-%+v-%+v\", askForReply.MapTaskIdx, reduceIdx))\n\t\t\t\t}\n\t\t\t\tintermediateEncoderMap = nil\n\t\t\t\tintermediateFileNameMap = nil\n\t\t\t\tNotifyWorkerTaskStatus(MapPhase, askForReply.MapTaskIdx, Success)\n\t\t\t}\n\t\tcase ReducePhase:\n\t\t\tintermediate := []KeyValue{}\n\t\t\tfor i := 0; i < askForReply.MapNum; i++ {\n\t\t\t\tfileName := fmt.Sprintf(\"mr-%+v-%+v\", i, askForReply.ReduceTaskIdx)\n\t\t\t\tfile, err := os.Open(fileName)\n\t\t\t\tif err != nil {\n\t\t\t\t\tlog.Fatalf(\"cannot open intermediateDecoderFile:%v mapIdx:%+v reduceIdx:%+v\", fileName, i, askForReply.ReduceTaskIdx)\n\t\t\t\t}\n\t\t\t\tdec := json.NewDecoder(file)\n\t\t\t\tfor {\n\t\t\t\t\tvar kv KeyValue\n\t\t\t\t\tif err := dec.Decode(&kv); err != nil {\n\t\t\t\t\t\tbreak\n\t\t\t\t\t}\n\t\t\t\t\tintermediate = append(intermediate, kv)\n\t\t\t\t}\n\t\t\t}\n\t\t\tsort.Sort(ByKey(intermediate))\n\n\t\t\toname := fmt.Sprintf(\"mr-out-%+v\", askForReply.ReduceTaskIdx)\n\t\t\tuuidInstance := uuid.New()\n\t\t\tuuidFileName := fmt.Sprintf(\"mr-tmp-reduce-%v\", uuidInstance.String())\n\t\t\tofile, err := os.OpenFile(uuidFileName, os.O_APPEND|os.O_CREATE|os.O_WRONLY, 0644)\n\t\t\tif err != nil {\n\t\t\t\tlog.Fatalf(\"cannot open uuidFileName:%v\", uuidFileName)\n\t\t\t\tbreak\n\t\t\t}\n\n\t\t\ti := 0\n\t\t\tfor i < len(intermediate) {\n\t\t\t\tj := i + 1\n\t\t\t\tfor j < len(intermediate) && intermediate[j].Key == intermediate[i].Key {\n\t\t\t\t\tj++\n\t\t\t\t}\n\t\t\t\tvalues := []string{}\n\t\t\t\tfor k := i; k < j; k++ {\n\t\t\t\t\tvalues = append(values, intermediate[k].Value)\n\t\t\t\t}\n\t\t\t\toutput := reducef(intermediate[i].Key, values)\n\n\t\t\t\t// this is the correct format for each line of Reduce output.\n\t\t\t\tfmt.Fprintf(ofile, \"%v %v\\n\", intermediate[i].Key, output)\n\n\t\t\t\ti = j\n\t\t\t}\n\t\t\tos.Rename(uuidFileName, oname)\n\t\t\tNotifyWorkerTaskStatus(ReducePhase, askForReply.ReduceTaskIdx, Success)\n\t\t\tfor i := 0; i < askForReply.MapNum; i++ {\n\t\t\t\tfileName := fmt.Sprintf(\"mr-%+v-%+v\", i, askForReply.ReduceTaskIdx)\n\t\t\t\terr := os.Remove(fileName)\n\t\t\t\tif err != nil {\n\t\t\t\t\tlog.Fatalf(\"cannot remove tmp file:%v\", fileName)\n\t\t\t\t}\n\t\t\t}\n\t\t\tofile.Close()\n\t\t}\n\n\t\ttime.Sleep(time.Second)\n\t}\n}", "title": "" }, { "docid": "0a3448cddef4100c61a8d4c2700c7130", "score": "0.5166422", "text": "func reduceF(key string, values []string) string {\n\t// TODO: you also have to write this function\n\tsum := 0\n\t//fmt.Println(values)\n\tfor _, v := range values {\n\t\tvCount, err := strconv.Atoi(v)\n\t\tif err != nil {\n\t\t\tlog.Fatal(err)\n\t\t}\n\n\t\tsum = sum + vCount\n\t}\n\t//fmt.Println(sum)\n\treturn strconv.Itoa(sum)\n}", "title": "" }, { "docid": "40b380b208f5647ade83d75f009e5025", "score": "0.510588", "text": "func (DependencyMap) NKeys() int { return 0 }", "title": "" }, { "docid": "4ed3b23a21569008742ef24c4a8fc2cb", "score": "0.50892", "text": "func RunMapTask(taskID int, filePath string, R int, mapf func(string, string) []KeyValue) {\n\tcontent, err := ioutil.ReadFile(filePath)\n\tif err != nil {\n\t\tlog.Fatal(\"Cannot read the file: \", filePath)\n\t}\n\tres := mapf(filePath, string(content[:]))\n\ttempEncoderMap := make(map[string]*json.Encoder)\n\tfor i:=0;i<len(res);i++ {\n\t\tpartitionID := ihash(res[i].Key) % R\n\t\tpartitionFileName := \"mr-\"+strconv.Itoa(taskID)+\"-\"+strconv.Itoa(partitionID)\n\t\ttempEncoder, exists := tempEncoderMap[partitionFileName]\n\t\tif exists == false {\n\t\t\tnewTempFile, err := ioutil.TempFile(os.TempDir(), \"mr-\")\n\t\t\tif err != nil {\n\t\t\t\tlog.Fatal(\"Cannot create new temporary file: \", err)\n\t\t\t}\n\t\t\tdefer func(){\n\t\t\t\t//close the file and atomically rename it\n\t\t\t\tnewTempFile.Close()\n\t\t\t\tos.Rename(newTempFile.Name(), partitionFileName)\n\t\t\t\t//fmt.Println(\"file written and renamed\")\n\t\t\t}()\n\t\t\ttempEncoderMap[partitionFileName] = json.NewEncoder(newTempFile)\n\t\t\ttempEncoder = tempEncoderMap[partitionFileName]\n\t\t}\n\t\t//fmt.Println(res[i])\n\t\terr := tempEncoder.Encode(&res[i])\n\t\tif err != nil {\n\t\t\tlog.Fatal(\"Cannot write this key value pair: \", err)\n\t\t}\n\t}\n\treturn\n}", "title": "" }, { "docid": "4f47157ca8628d3a5cf39e0ade5c5aa7", "score": "0.5073776", "text": "func Worker(mapf func(string, string) []KeyValue,\n\treducef func(string, []string) string) {\n\n\t// Your worker implementation here.\n\n\t// uncomment to send the Example RPC to the master.\n\n\t//step: MAP\n\tfor {\n\t\tmapTask, ok := CallGetMapTask()\n\t\tif !ok {\n\t\t\tlog.Fatalf(\"rpc failed\")\n\t\t}\n\t\tif mapTask.MapStatus == Finish {\n\t\t\t// map阶段已完成,跳出\n\t\t\tbreak\n\t\t} else if mapTask.MapStatus == Waiting {\n\t\t\t// 等待别的worker完成map,继续监听,防止worker宕机\n\t\t\ttime.Sleep(2 * time.Second)\n\t\t\tcontinue\n\t\t} else if mapTask.MapStatus != Normal {\n\t\t\t// 非正常状态,跳出吧,不太可能有这个返回\n\t\t\tbreak\n\t\t}\n\t\t// 处理master返回的Input 文件\n\t\tmapFile, err := os.Open(mapTask.FileName)\n\t\tif err != nil {\n\t\t\tlog.Fatalf(\"cannot open %v\", mapTask.FileName)\n\t\t}\n\t\tcontent, err := ioutil.ReadAll(mapFile)\n\t\tif err != nil {\n\t\t\tlog.Fatalf(\"cannot read %v\", mapTask.FileName)\n\t\t}\n\t\tmapFile.Close()\n\t\tkva := mapf(mapTask.FileName, string(content))\n\n\t\tfileListMap := make(map[int][]string) //key: reduceID value:该reduceID的文件列表\n\t\tfileNameMap := make(map[string][]KeyValue) // key: 文件名 value: kv键值对\n\t\tr := rand.New(rand.NewSource(time.Now().UnixNano()))\n\t\trandNo := r.Intn(1000) // 每个worker在生成map阶段临时文件的时候,文件名带有一个随机数,防止不同worker在针对同一map任务进行写冲突\n\t\tfor _, kv := range kva {\n\t\t\tidx := ihash(kv.Key)%mapTask.ReduceSum //为该key找到对应的reduceID\n\t\t\treduceFilename := buildReduceFilename(randNo, mapTask.MapID, idx) //生成临时文件名\n\t\t\tif _, ok := fileNameMap[reduceFilename]; !ok {\n\t\t\t\t//该文件第一次出现,初始化\n\t\t\t\tif _, ok := fileListMap[idx]; !ok {\n\t\t\t\t\tfileListMap[idx] = []string{reduceFilename}\n\t\t\t\t} else {\n\t\t\t\t\tfileListMap[idx] = append(fileListMap[idx], reduceFilename)\n\t\t\t\t}\n\t\t\t\tfileNameMap[reduceFilename] = []KeyValue{kv}\n\t\t\t\tcontinue\n\t\t\t}\n\t\t\t//该文件名已生成,进行内容追加\n\t\t\tfileNameMap[reduceFilename] = append(fileNameMap[reduceFilename], kv)\n\t\t}\n\t\t// 将文件内容统一落盘\n\t\tfor filename,kvs := range fileNameMap {\n\t\t\tfile, err := os.OpenFile(filename, os.O_RDWR|os.O_CREATE|os.O_APPEND,0644)\n\t\t\tif err != nil {\n\t\t\t\tlog.Fatalf(\"openfile failed, err:%+v\", err)\n\t\t\t}\n\t\t\tenc := json.NewEncoder(file)\n\t\t\tfor _, kv := range kvs {\n\t\t\t\terr = enc.Encode(&kv)\n\t\t\t\tif err != nil {\n\t\t\t\t\tlog.Fatalf(\"write reduce file failed, err %v\", err)\n\t\t\t\t}\n\t\t\t}\n\t\t\tfile.Close()\n\t\t}\n\n\n\t\t// shuffle 通知master 该map操作已完成以及告知生成的临时文件\n\t\tok = CallShuffle(mapTask.MapID, fileListMap)\n\t\tif !ok {\n\t\t\tlog.Fatalf(\"Shuffle failed\")\n\t\t}\n\t}\n\n\t//step: REDUCE\n\tfor {\n\t\treduceTask, ok := CallGetReduceTask()\n\t\tif !ok {\n\t\t\t// RPC操作失败,默认master崩了,结束\n\t\t\tbreak\n\t\t}\n\t\tif reduceTask.Status == Finish {\n\t\t\t// 该任务Reduce操作已完成,结束\n\t\t\tbreak\n\t\t} else if reduceTask.Status == Waiting || reduceTask.Status == UnInit {\n\t\t\t// 等待别的worker进行Reduce操作进行监听; Reduce操作未开始,继续监听\n\t\t\ttime.Sleep(2 * time.Second)\n\t\t\tcontinue\n\t\t}\n\t\t// 读取临时文件,进行Reduce操作\n\t\tres := []KeyValue{}\n\t\tfor _, filename := range reduceTask.FileList {\n\t\t\tfile, err := os.Open(filename)\n\t\t\tif err != nil {\n\t\t\t\tlog.Fatalf(\"open file failed, err:%+v\", err)\n\t\t\t}\n\t\t\tdec := json.NewDecoder(file)\n\t\t\tfor {\n\t\t\t\tvar kv KeyValue\n\t\t\t\tif err := dec.Decode(&kv); err != nil {\n\t\t\t\t\tbreak\n\t\t\t\t}\n\t\t\t\tres = append(res, kv)\n\t\t\t}\n\t\t\tfile.Close()\n\t\t}\n\t\tsort.Sort(ByKey(res))\n\t\toFileName := \"mr-out-\" + strconv.Itoa(reduceTask.ReduceID)\n\t\tofile, _ := os.Create(oFileName)\n\t\ti := 0\n\t\tfor i < len(res) {\n\t\t\tj := i + 1\n\t\t\tfor j < len(res) && res[j].Key == res[i].Key {\n\t\t\t\tj++\n\t\t\t}\n\t\t\tvalues := []string{}\n\t\t\tfor k := i; k < j; k++ {\n\t\t\t\tvalues = append(values, res[k].Value)\n\t\t\t}\n\t\t\toutput := reducef(res[i].Key, values)\n\n\t\t\t// this is the correct format for each line of Reduce output.\n\t\t\tfmt.Fprintf(ofile, \"%v %v\\n\", res[i].Key, output)\n\t\t\ti = j\n\t\t}\n\t\tofile.Close()\n\t\tok = CallSubmitReduce(reduceTask.ReduceID)\n\t\tif !ok {\n\t\t\tlog.Fatalf(\"submit reduce failed\")\n\t\t}\n\t}\n}", "title": "" }, { "docid": "f82da8d12544e0afbb43f7b74af659d8", "score": "0.5043378", "text": "func BenchmarkNativeMapLotsReadsFreqKeys(b *testing.B) {\n\tbenchmarkLotsReadsNormalDist(nativemap.NewNativeMap(), b, NumKeysInBigMap, NumReadsInReadOnlyTestSmall)\n}", "title": "" }, { "docid": "00bd734503914d00902b8335fba8b002", "score": "0.50118023", "text": "func keyToPartition(tkey dax.TableKey, partitionN int, key string) dax.PartitionNum {\n\t// Hash the bytes and mod by partition count.\n\th := fnv.New64a()\n\t_, _ = h.Write([]byte(tkey))\n\t_, _ = h.Write([]byte(key))\n\treturn dax.PartitionNum(h.Sum64() % uint64(partitionN))\n}", "title": "" }, { "docid": "e643b2394443f776b51bb12bb1e4401b", "score": "0.50013876", "text": "func Worker(mapf func(string, string) []KeyValue,\n\treducef func(string, []string) string) {\n\ttempDir := \"temp-mr\"\n\t// Your worker implementation here.\n\n\t// uncomment to send the Example RPC to the master.\n\t// CallExample()\n\tfor true {\n\t\ttime.Sleep(1 * time.Second)\n\t\treply := CallRequestTask()\n\t\tif len(reply.Key) > 0 {\n\t\t\tif reply.IsMap {\n\t\t\t\tkeys := make(map[int]bool)\n\t\t\t\tfile, err := os.Open(reply.Key)\n\t\t\t\tif err != nil {\n\t\t\t\t\tlog.Fatalf(\"cannot open %v\", reply.Key)\n\t\t\t\t}\n\t\t\t\tcontent, err := ioutil.ReadAll(file)\n\t\t\t\tif err != nil {\n\t\t\t\t\tlog.Fatalf(\"cannot read %v\", reply.Key)\n\t\t\t\t}\n\t\t\t\tfile.Close()\n\t\t\t\tkva := mapf(reply.Key, string(content))\n\n\t\t\t\t_ = os.Mkdir(tempDir, 0777)\n\n\t\t\t\tfileGlob := fmt.Sprintf(\"mr-%d-*\", reply.Id)\n\t\t\t\tfiles, err := filepath.Glob(filepath.Join(tempDir, fileGlob))\n\t\t\t\tif err != nil {\n\t\t\t\t\tlog.Fatalf(\"cannot glob files\")\n\t\t\t\t}\n\t\t\t\tfor _, f := range files {\n\t\t\t\t\tif err := os.Remove(f); err != nil {\n\t\t\t\t\t\tlog.Fatalf(\"cannot remove file %s\", f)\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tfor _, kv := range kva {\n\t\t\t\t\tnumkey := ihash(kv.Key) % reply.Nreduce\n\t\t\t\t\tintermediateFilename := fmt.Sprintf(\"mr-%d-%d\", reply.Id, numkey)\n\t\t\t\t\t//fmt.Printf(\"%s : %s : %s\\n\", kv.Key, kv.Value, intermediateFilename)\n\t\t\t\t\tpath := filepath.Join(tempDir, intermediateFilename)\n\t\t\t\t\tintermediateFile, err := os.OpenFile(path, os.O_CREATE|os.O_RDWR|os.O_APPEND, 0755)\n\t\t\t\t\tif err != nil {\n\t\t\t\t\t\tlog.Fatalf(\"cannot open %v\", path)\n\t\t\t\t\t}\n\t\t\t\t\tenc := json.NewEncoder(intermediateFile)\n\t\t\t\t\terr = enc.Encode(&kv)\n\t\t\t\t\tif err != nil {\n\t\t\t\t\t\tlog.Fatalf(\"cannot encode %v\", reply.Key)\n\t\t\t\t\t}\n\t\t\t\t\tintermediateFile.Close()\n\t\t\t\t\tkeys[numkey] = true\n\t\t\t\t}\n\t\t\t\tkeysList := make([]int, 0, len(keys))\n\t\t\t\tfor k := range keys {\n\t\t\t\t\tkeysList = append(keysList, k)\n\t\t\t\t}\n\t\t\t\t_ = CallTaskFinished(reply.Id, keysList, true)\n\t\t\t} else {\n\t\t\t\t//fmt.Printf(\"Reduce task : %d \\n\", reply.Id)\n\t\t\t\tvar intermediateReduce []KeyValue\n\t\t\t\tfileGlob := fmt.Sprintf(\"mr-*-%d\", reply.Id)\n\t\t\t\tfiles, err := filepath.Glob(filepath.Join(tempDir, fileGlob))\n\t\t\t\tif err != nil {\n\t\t\t\t\tlog.Fatalf(\"cannot glob files\")\n\t\t\t\t}\n\t\t\t\tfor _, f := range files {\n\t\t\t\t\tintermediateFile, err := os.Open(f)\n\t\t\t\t\tif err != nil {\n\t\t\t\t\t\tlog.Fatalf(\"cannot open %v\", f)\n\t\t\t\t\t}\n\t\t\t\t\tdec := json.NewDecoder(intermediateFile)\n\t\t\t\t\tfor {\n\t\t\t\t\t\tvar kv KeyValue\n\t\t\t\t\t\tif err := dec.Decode(&kv); err != nil {\n\t\t\t\t\t\t\tbreak\n\t\t\t\t\t\t}\n\t\t\t\t\t\tintermediateReduce = append(intermediateReduce, kv)\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tsort.Sort(ByKey(intermediateReduce))\n\n\t\t\t\toname := fmt.Sprintf(\"temp-r-%d\", reply.Id)\n\t\t\t\tofile, _ := ioutil.TempFile(tempDir, oname)\n\t\t\t\ttempName := ofile.Name()\n\t\t\t\tdefer os.Remove(tempName)\n\t\t\t\ti := 0\n\t\t\t\tfor i < len(intermediateReduce) {\n\t\t\t\t\tj := i + 1\n\t\t\t\t\tfor j < len(intermediateReduce) && intermediateReduce[j].Key == intermediateReduce[i].Key {\n\t\t\t\t\t\tj++\n\t\t\t\t\t}\n\t\t\t\t\tvalues := []string{}\n\t\t\t\t\tfor k := i; k < j; k++ {\n\t\t\t\t\t\tvalues = append(values, intermediateReduce[k].Value)\n\t\t\t\t\t}\n\t\t\t\t\toutput := reducef(intermediateReduce[i].Key, values)\n\n\t\t\t\t\t// this is the correct format for each line of Reduce output.\n\t\t\t\t\tfmt.Fprintf(ofile, \"%v %v\\n\", intermediateReduce[i].Key, output)\n\n\t\t\t\t\ti = j\n\t\t\t\t}\n\n\t\t\t\tofile.Close()\n\t\t\t\tos.Rename(tempName, oname)\n\t\t\t\tvar keysList []int\n\t\t\t\t_ = CallTaskFinished(reply.Id, keysList, false)\n\t\t\t}\n\t\t}\n\t}\n}", "title": "" }, { "docid": "0eb9cceff050aec372ce87c62b2a50f3", "score": "0.49739042", "text": "func benchmarkLotsWritesFewReadsSequential(m IMap, b *testing.B, numWrites int) {\n\tcurrentWriteKey := 0\n\tcurrentReadKey := 0\n\truntime.GOMAXPROCS(runtime.NumCPU())\n\tb.RunParallel(func(pb *testing.PB) {\n\t\tfor pb.Next() {\n\t\t\trand.Seed(time.Now().UTC().UnixNano())\n\t\t\tfor i := 0; i < numWrites; i++ {\n\t\t\t\t/* Do a read */\n\t\t\t\tif i > 0 && i%WriteRatioHigh == 0 {\n\t\t\t\t\tk := currentReadKey\n\t\t\t\t\tcurrentReadKey = (currentReadKey + 1) % numWrites\n\t\t\t\t\tv, ok := m.Get(k)\n\t\t\t\t\tif ok {\n\t\t\t\t\t\texpectedV := fmt.Sprintf(\"%12d\", k)\n\t\t\t\t\t\tif v != expectedV {\n\t\t\t\t\t\t\tb.Error(\"Wrong value for key\", k, \". Expect \", expectedV, \". Got \", v)\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t} else {\n\t\t\t\t\t/* Do write */\n\t\t\t\t\tk := currentWriteKey\n\t\t\t\t\tcurrentWriteKey = (currentWriteKey + 1) % numWrites\n\t\t\t\t\tv := fmt.Sprintf(\"%12d\", k)\n\t\t\t\t\tm.Put(k, v)\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t})\n}", "title": "" }, { "docid": "8e9308da0a1efd6f7e47e8eb3fad293f", "score": "0.49505368", "text": "func BenchmarkLockMapLotsWritesFewReadsFreqKeys(b *testing.B) {\n\tbenchmarkLotsWritesFewReadsNormalDist(lockmap.NewLockMap(), b, NumWritesInRWTestSmall)\n}", "title": "" }, { "docid": "199cb3535975a29018f4555093273b2e", "score": "0.49157715", "text": "func handleMapTask(mapf func(string, string) []KeyValue, reply AskForTaskReply) []string {\n\tintermediate := []KeyValue{}\n\tfor _, filename := range reply.TaskResponse.FileNames {\n\t\tfile, err := os.Open(filename)\n\t\tif err != nil {\n\t\t\tlog.Fatalf(\"cannot open %v\", filename)\n\t\t}\n\t\tcontent, err := ioutil.ReadAll(file)\n\t\tif err != nil {\n\t\t\tlog.Fatalf(\"cannot read %v\", filename)\n\t\t}\n\t\tfile.Close()\n\t\tkva := mapf(filename, string(content))\n\t\tintermediate = append(intermediate, kva...)\n\t}\n\n\tvar filenames []string\n\tencs := make([]*json.Encoder, reply.TaskResponse.NReduce)\n\tfor rNumber := 0; rNumber < reply.TaskResponse.NReduce; rNumber++ {\n\t\tfilename := fmt.Sprintf(\"mr-%v-%v\", reply.TaskResponse.Number, rNumber)\n\t\tfilenames = append(filenames, filename)\n\t\tfile, err := os.Create(filename)\n\t\tif err != nil {\n\t\t\tlog.Fatalf(\"cannot create %v\", filename)\n\t\t}\n\t\tencs[rNumber] = json.NewEncoder(file)\n\t}\n\n\tfor _, kv := range intermediate {\n\t\terr := encs[ihash(kv.Key)%reply.TaskResponse.NReduce].Encode(&kv)\n\t\tif err != nil {\n\t\t\tlog.Fatalf(\"cannot write to %v\", encs[ihash(kv.Key)%reply.TaskResponse.NReduce])\n\t\t}\n\t}\n\n\treturn filenames\n}", "title": "" }, { "docid": "72c901e7b728d683730d2d7c3d51af92", "score": "0.4905959", "text": "func Worker(mapf func(string, string) []KeyValue,\n\treducef func(string, []string) string) {\n\n\t// Your worker implementation here.\n\n\t// uncomment to send the Example RPC to the master.\n\t// CallExample()\n\tvar mapping bool = true\n\tvar finished bool = false\n\t//fmt.Println(\"worker start\", os.Getpid())\n\n\tfor {\n\t\theartBeatReply := HeartBeat()\n\t\tmapping = !heartBeatReply.MapFinished\n\t\tfinished = heartBeatReply.ReduceFinished\n\n\t\t//fmt.Println(\"got beat\", os.Getpid(), mapping, finished)\n\t\tif mapping == true {\n\t\t\t//do map\n\t\t\t//fmt.Println(\"ready get map\", os.Getpid())\n\t\t\tfileReply, err := GetWork()\n\n\t\t\tif err != nil {\n\t\t\t\ttime.Sleep(2 * time.Second)\n\t\t\t\tcontinue\n\t\t\t}\n\t\t\t//fmt.Println(\"doing map\", fileReply.FileName, os.Getpid())\n\t\t\treduceNum := fileReply.ReduceNum\n\n\n\t\t\tfile, err := os.Open(fileReply.FileName)\n\t\t\tdefer file.Close()\n\t\t\tif err != nil {\n\t\t\t\tlog.Fatalf(\"cannot open %v\", fileReply.FileName)\n\t\t\t}\n\n\t\t\tcontent, err := ioutil.ReadAll(file)\n\t\t\tif err!= nil {\n\t\t\t\tlog.Fatalf(\"cannot read %v\", fileReply.FileName)\n\t\t\t}\n\n\t\t\tkva := mapf(fileReply.FileName, string(content))\n\n\t\t\tid := fileReply.MapID\n\n\t\t\ttmpName := make([]string, reduceNum + 1)\n\t\t\ttmpFile := make([]*os.File, reduceNum + 1)\n\t\t\tfor i := 1; i <= reduceNum; i++ {\n\t\t\t\ttmpfile, err := ioutil.TempFile(\"\", \"mr-\" + strconv.Itoa(id) + \"-\" + strconv.Itoa(i))\n\n\t\t\t\tif err != nil {\n\t\t\t\t\tlog.Fatal(err)\n\t\t\t\t}\n\n\t\t\t\ttmpName[i] = tmpfile.Name()\n\t\t\t\ttmpFile[i] = tmpfile\n\t\t\t}\n\n\t\t\t//map out to reduce bucket according to key\n\t\t\tfor _, kv := range kva {\n\t\t\t\treduceIndex := ihash(kv.Key) % reduceNum\n\n\t\t\t\tif reduceIndex == 0 {\n\t\t\t\t\treduceIndex = reduceNum\n\t\t\t\t}\n\n\t\t\t\toFile := tmpFile[reduceIndex]\n\n\t\t\t\tenc := json.NewEncoder(oFile)\n\t\t\t\tenc.Encode(&kv)\n\n\t\t\t}\n\n\t\t\t//rename tmp file\n\t\t\tfor i := 1; i <= reduceNum; i++{\n\t\t\t\tos.Rename(tmpName[i], \"mr-\" + strconv.Itoa(id) + \"-\" + strconv.Itoa(i))\n\t\t\ttmpName[i] = \"mr-\" + strconv.Itoa(id) + \"-\" + strconv.Itoa(i)\n\t\t\t}\n\t\t\t//communicate with master\n\t\t\t//about finishment and file location\n\t\t\tMapDone(fileReply.FileName)\n\n\t\t\tfor i := 1; i <= reduceNum; i++ {\n\t\t\t\tMapOut(tmpName[i], i)\n\t\t\t}\n\t\t\t//fmt.Println(\"map finished\", fileReply.FileName, os.Getpid())\n\t\t} else if finished == false{\n\t\t\t//do reduce\n\t\t\tfilesReply := GetReduceWork()\n\t\t\treduceNumber := filesReply.ReduceNumber\n\t\t\tfiles := filesReply.Files\n\n\t\t\toname := \"mr-out-\" + strconv.Itoa(reduceNumber)\n\t\t\tofile, _ := os.Create(oname)\n\n\t\t\tkva := make([]KeyValue, 0)\n\n\t\t\tfor _, fileName := range files {\n\t\t\t\tfile, _ := os.Open(fileName)\n\t\t\t\tdec := json.NewDecoder(file)\n\t\t\t\tfor {\n\t\t\t\t\tvar kv KeyValue\n\n\t\t\t\t\tif err := dec.Decode(&kv); err != nil {\n\t\t\t\t\t\tbreak\n\t\t\t\t\t}\n\n\t\t\t\t\tkva = append(kva, kv)\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tsort.Sort(ByKey(kva))\n\n\t\t\ti := 0\n\t\t\tfor i < len(kva) {\n\t\t\t\tj := i + 1\n\t\t\t\tfor j < len(kva) && kva[j].Key == kva[i].Key {\n\t\t\t\t\tj++\n\t\t\t\t}\n\n\t\t\t\tvalues := make([]string, 0)\n\n\t\t\t\tfor k := i; k < j; k++ {\n\t\t\t\t\tvalues = append(values, kva[k].Value)\n\t\t\t\t}\n\n\t\t\t\toutput := reducef(kva[i].Key, values)\n\n\t\t\t\tfmt.Fprintf(ofile, \"%v %v\\n\", kva[i].Key, output)\n\t\t\t\ti = j\n\n\t\t\t\tvalues = make([]string, 0)\n\t\t\t}\n\t\t\t//fmt.Println(\"reduce done\", reduceNumber)\n\t\t\tReduceDone(reduceNumber)\n\t\t} else if finished == true {\n\t\t\t//fmt.Println(\" woker exit \", os.Getpid())\n\t\t\tbreak\n\t\t}\n\t}\n}", "title": "" }, { "docid": "92a6d299388ddbb6ee604bd1af383991", "score": "0.4898464", "text": "func ScReduce(out *[32]byte, s *[64]byte) {\n\ts0 := 2097151 & load3(s[:])\n\ts1 := 2097151 & (load4(s[2:]) >> 5)\n\ts2 := 2097151 & (load3(s[5:]) >> 2)\n\ts3 := 2097151 & (load4(s[7:]) >> 7)\n\ts4 := 2097151 & (load4(s[10:]) >> 4)\n\ts5 := 2097151 & (load3(s[13:]) >> 1)\n\ts6 := 2097151 & (load4(s[15:]) >> 6)\n\ts7 := 2097151 & (load3(s[18:]) >> 3)\n\ts8 := 2097151 & load3(s[21:])\n\ts9 := 2097151 & (load4(s[23:]) >> 5)\n\ts10 := 2097151 & (load3(s[26:]) >> 2)\n\ts11 := 2097151 & (load4(s[28:]) >> 7)\n\ts12 := 2097151 & (load4(s[31:]) >> 4)\n\ts13 := 2097151 & (load3(s[34:]) >> 1)\n\ts14 := 2097151 & (load4(s[36:]) >> 6)\n\ts15 := 2097151 & (load3(s[39:]) >> 3)\n\ts16 := 2097151 & load3(s[42:])\n\ts17 := 2097151 & (load4(s[44:]) >> 5)\n\ts18 := 2097151 & (load3(s[47:]) >> 2)\n\ts19 := 2097151 & (load4(s[49:]) >> 7)\n\ts20 := 2097151 & (load4(s[52:]) >> 4)\n\ts21 := 2097151 & (load3(s[55:]) >> 1)\n\ts22 := 2097151 & (load4(s[57:]) >> 6)\n\ts23 := (load4(s[60:]) >> 3)\n\n\ts11 += s23 * 666643\n\ts12 += s23 * 470296\n\ts13 += s23 * 654183\n\ts14 -= s23 * 997805\n\ts15 += s23 * 136657\n\ts16 -= s23 * 683901\n\ts23 = 0\n\n\ts10 += s22 * 666643\n\ts11 += s22 * 470296\n\ts12 += s22 * 654183\n\ts13 -= s22 * 997805\n\ts14 += s22 * 136657\n\ts15 -= s22 * 683901\n\ts22 = 0\n\n\ts9 += s21 * 666643\n\ts10 += s21 * 470296\n\ts11 += s21 * 654183\n\ts12 -= s21 * 997805\n\ts13 += s21 * 136657\n\ts14 -= s21 * 683901\n\ts21 = 0\n\n\ts8 += s20 * 666643\n\ts9 += s20 * 470296\n\ts10 += s20 * 654183\n\ts11 -= s20 * 997805\n\ts12 += s20 * 136657\n\ts13 -= s20 * 683901\n\ts20 = 0\n\n\ts7 += s19 * 666643\n\ts8 += s19 * 470296\n\ts9 += s19 * 654183\n\ts10 -= s19 * 997805\n\ts11 += s19 * 136657\n\ts12 -= s19 * 683901\n\ts19 = 0\n\n\ts6 += s18 * 666643\n\ts7 += s18 * 470296\n\ts8 += s18 * 654183\n\ts9 -= s18 * 997805\n\ts10 += s18 * 136657\n\ts11 -= s18 * 683901\n\ts18 = 0\n\n\tvar carry [17]int64\n\n\tcarry[6] = (s6 + (1 << 20)) >> 21\n\ts7 += carry[6]\n\ts6 -= carry[6] << 21\n\tcarry[8] = (s8 + (1 << 20)) >> 21\n\ts9 += carry[8]\n\ts8 -= carry[8] << 21\n\tcarry[10] = (s10 + (1 << 20)) >> 21\n\ts11 += carry[10]\n\ts10 -= carry[10] << 21\n\tcarry[12] = (s12 + (1 << 20)) >> 21\n\ts13 += carry[12]\n\ts12 -= carry[12] << 21\n\tcarry[14] = (s14 + (1 << 20)) >> 21\n\ts15 += carry[14]\n\ts14 -= carry[14] << 21\n\tcarry[16] = (s16 + (1 << 20)) >> 21\n\ts17 += carry[16]\n\ts16 -= carry[16] << 21\n\n\tcarry[7] = (s7 + (1 << 20)) >> 21\n\ts8 += carry[7]\n\ts7 -= carry[7] << 21\n\tcarry[9] = (s9 + (1 << 20)) >> 21\n\ts10 += carry[9]\n\ts9 -= carry[9] << 21\n\tcarry[11] = (s11 + (1 << 20)) >> 21\n\ts12 += carry[11]\n\ts11 -= carry[11] << 21\n\tcarry[13] = (s13 + (1 << 20)) >> 21\n\ts14 += carry[13]\n\ts13 -= carry[13] << 21\n\tcarry[15] = (s15 + (1 << 20)) >> 21\n\ts16 += carry[15]\n\ts15 -= carry[15] << 21\n\n\ts5 += s17 * 666643\n\ts6 += s17 * 470296\n\ts7 += s17 * 654183\n\ts8 -= s17 * 997805\n\ts9 += s17 * 136657\n\ts10 -= s17 * 683901\n\ts17 = 0\n\n\ts4 += s16 * 666643\n\ts5 += s16 * 470296\n\ts6 += s16 * 654183\n\ts7 -= s16 * 997805\n\ts8 += s16 * 136657\n\ts9 -= s16 * 683901\n\ts16 = 0\n\n\ts3 += s15 * 666643\n\ts4 += s15 * 470296\n\ts5 += s15 * 654183\n\ts6 -= s15 * 997805\n\ts7 += s15 * 136657\n\ts8 -= s15 * 683901\n\ts15 = 0\n\n\ts2 += s14 * 666643\n\ts3 += s14 * 470296\n\ts4 += s14 * 654183\n\ts5 -= s14 * 997805\n\ts6 += s14 * 136657\n\ts7 -= s14 * 683901\n\ts14 = 0\n\n\ts1 += s13 * 666643\n\ts2 += s13 * 470296\n\ts3 += s13 * 654183\n\ts4 -= s13 * 997805\n\ts5 += s13 * 136657\n\ts6 -= s13 * 683901\n\ts13 = 0\n\n\ts0 += s12 * 666643\n\ts1 += s12 * 470296\n\ts2 += s12 * 654183\n\ts3 -= s12 * 997805\n\ts4 += s12 * 136657\n\ts5 -= s12 * 683901\n\ts12 = 0\n\n\tcarry[0] = (s0 + (1 << 20)) >> 21\n\ts1 += carry[0]\n\ts0 -= carry[0] << 21\n\tcarry[2] = (s2 + (1 << 20)) >> 21\n\ts3 += carry[2]\n\ts2 -= carry[2] << 21\n\tcarry[4] = (s4 + (1 << 20)) >> 21\n\ts5 += carry[4]\n\ts4 -= carry[4] << 21\n\tcarry[6] = (s6 + (1 << 20)) >> 21\n\ts7 += carry[6]\n\ts6 -= carry[6] << 21\n\tcarry[8] = (s8 + (1 << 20)) >> 21\n\ts9 += carry[8]\n\ts8 -= carry[8] << 21\n\tcarry[10] = (s10 + (1 << 20)) >> 21\n\ts11 += carry[10]\n\ts10 -= carry[10] << 21\n\n\tcarry[1] = (s1 + (1 << 20)) >> 21\n\ts2 += carry[1]\n\ts1 -= carry[1] << 21\n\tcarry[3] = (s3 + (1 << 20)) >> 21\n\ts4 += carry[3]\n\ts3 -= carry[3] << 21\n\tcarry[5] = (s5 + (1 << 20)) >> 21\n\ts6 += carry[5]\n\ts5 -= carry[5] << 21\n\tcarry[7] = (s7 + (1 << 20)) >> 21\n\ts8 += carry[7]\n\ts7 -= carry[7] << 21\n\tcarry[9] = (s9 + (1 << 20)) >> 21\n\ts10 += carry[9]\n\ts9 -= carry[9] << 21\n\tcarry[11] = (s11 + (1 << 20)) >> 21\n\ts12 += carry[11]\n\ts11 -= carry[11] << 21\n\n\ts0 += s12 * 666643\n\ts1 += s12 * 470296\n\ts2 += s12 * 654183\n\ts3 -= s12 * 997805\n\ts4 += s12 * 136657\n\ts5 -= s12 * 683901\n\ts12 = 0\n\n\tcarry[0] = s0 >> 21\n\ts1 += carry[0]\n\ts0 -= carry[0] << 21\n\tcarry[1] = s1 >> 21\n\ts2 += carry[1]\n\ts1 -= carry[1] << 21\n\tcarry[2] = s2 >> 21\n\ts3 += carry[2]\n\ts2 -= carry[2] << 21\n\tcarry[3] = s3 >> 21\n\ts4 += carry[3]\n\ts3 -= carry[3] << 21\n\tcarry[4] = s4 >> 21\n\ts5 += carry[4]\n\ts4 -= carry[4] << 21\n\tcarry[5] = s5 >> 21\n\ts6 += carry[5]\n\ts5 -= carry[5] << 21\n\tcarry[6] = s6 >> 21\n\ts7 += carry[6]\n\ts6 -= carry[6] << 21\n\tcarry[7] = s7 >> 21\n\ts8 += carry[7]\n\ts7 -= carry[7] << 21\n\tcarry[8] = s8 >> 21\n\ts9 += carry[8]\n\ts8 -= carry[8] << 21\n\tcarry[9] = s9 >> 21\n\ts10 += carry[9]\n\ts9 -= carry[9] << 21\n\tcarry[10] = s10 >> 21\n\ts11 += carry[10]\n\ts10 -= carry[10] << 21\n\tcarry[11] = s11 >> 21\n\ts12 += carry[11]\n\ts11 -= carry[11] << 21\n\n\ts0 += s12 * 666643\n\ts1 += s12 * 470296\n\ts2 += s12 * 654183\n\ts3 -= s12 * 997805\n\ts4 += s12 * 136657\n\ts5 -= s12 * 683901\n\ts12 = 0\n\n\tcarry[0] = s0 >> 21\n\ts1 += carry[0]\n\ts0 -= carry[0] << 21\n\tcarry[1] = s1 >> 21\n\ts2 += carry[1]\n\ts1 -= carry[1] << 21\n\tcarry[2] = s2 >> 21\n\ts3 += carry[2]\n\ts2 -= carry[2] << 21\n\tcarry[3] = s3 >> 21\n\ts4 += carry[3]\n\ts3 -= carry[3] << 21\n\tcarry[4] = s4 >> 21\n\ts5 += carry[4]\n\ts4 -= carry[4] << 21\n\tcarry[5] = s5 >> 21\n\ts6 += carry[5]\n\ts5 -= carry[5] << 21\n\tcarry[6] = s6 >> 21\n\ts7 += carry[6]\n\ts6 -= carry[6] << 21\n\tcarry[7] = s7 >> 21\n\ts8 += carry[7]\n\ts7 -= carry[7] << 21\n\tcarry[8] = s8 >> 21\n\ts9 += carry[8]\n\ts8 -= carry[8] << 21\n\tcarry[9] = s9 >> 21\n\ts10 += carry[9]\n\ts9 -= carry[9] << 21\n\tcarry[10] = s10 >> 21\n\ts11 += carry[10]\n\ts10 -= carry[10] << 21\n\n\tout[0] = byte(s0 >> 0)\n\tout[1] = byte(s0 >> 8)\n\tout[2] = byte((s0 >> 16) | (s1 << 5))\n\tout[3] = byte(s1 >> 3)\n\tout[4] = byte(s1 >> 11)\n\tout[5] = byte((s1 >> 19) | (s2 << 2))\n\tout[6] = byte(s2 >> 6)\n\tout[7] = byte((s2 >> 14) | (s3 << 7))\n\tout[8] = byte(s3 >> 1)\n\tout[9] = byte(s3 >> 9)\n\tout[10] = byte((s3 >> 17) | (s4 << 4))\n\tout[11] = byte(s4 >> 4)\n\tout[12] = byte(s4 >> 12)\n\tout[13] = byte((s4 >> 20) | (s5 << 1))\n\tout[14] = byte(s5 >> 7)\n\tout[15] = byte((s5 >> 15) | (s6 << 6))\n\tout[16] = byte(s6 >> 2)\n\tout[17] = byte(s6 >> 10)\n\tout[18] = byte((s6 >> 18) | (s7 << 3))\n\tout[19] = byte(s7 >> 5)\n\tout[20] = byte(s7 >> 13)\n\tout[21] = byte(s8 >> 0)\n\tout[22] = byte(s8 >> 8)\n\tout[23] = byte((s8 >> 16) | (s9 << 5))\n\tout[24] = byte(s9 >> 3)\n\tout[25] = byte(s9 >> 11)\n\tout[26] = byte((s9 >> 19) | (s10 << 2))\n\tout[27] = byte(s10 >> 6)\n\tout[28] = byte((s10 >> 14) | (s11 << 7))\n\tout[29] = byte(s11 >> 1)\n\tout[30] = byte(s11 >> 9)\n\tout[31] = byte(s11 >> 17)\n}", "title": "" }, { "docid": "bc1fe9e64f00c8b7844709ac121834fd", "score": "0.48970598", "text": "func Hash(key uint64, numBuckets int32) int32 {\n\n\tif numBuckets <= 0 {\n\t\treturn 0\n\t}\n\n\tvar b, j int64 = -1, 0\n\n\tfor j < int64(numBuckets) {\n\t\tb = j\n\t\tkey = key*2862933555777941757 + 1\n\t\tj = int64(float64(b+1) * (float64(int64(1)<<31) / float64((key>>33)+1)))\n\t}\n\treturn int32(b)\n}", "title": "" }, { "docid": "bbb58c81e12b6abab4c5bc215e1bc8df", "score": "0.48962286", "text": "func DealMap(mapf func(string, string) []KeyValue,\n\tmapstruct MapReply) map[int][]string {\n\tfile, err := os.Open(mapstruct.Filename)\n\tif err != nil {\n\t\tlog.Fatalf(\"cannot open:%v\", file)\n\t}\n\tcontent, err := ioutil.ReadAll(file)\n\tif err != nil {\n\t\tlog.Fatalf(\"cannot read:%v\", mapstruct.Filename)\n\t}\n\tfile.Close()\n\n\t//intermediate k-v pairs\n\tkva := mapf(mapstruct.Filename, string(content))\n\n\t//make same hash code to one map array\n\thashmaps := make(map[int][]KeyValue)\n\tfor _, kv := range kva {\n\n\t\tr := ihash(kv.Key) % mapstruct.NReduce\n\t\thashmaps[r] = append(hashmaps[r], kv)\n\t}\n\n\t//hashcode -> filenames (there have R hashcodes)\n\tinterfiles := make(map[int][]string)\n\tfor k, v := range hashmaps {\n\t\tfilename := (\"mr-\" + strconv.Itoa(mapstruct.Tasknumber) + \"-\" + strconv.Itoa(k+1))\n\t\tos.Remove(filename)\n\t\tfile, er := os.Create(filename)\n\t\tif er != nil {\n\t\t\tlog.Fatalf(\"cannot create:%v\", filename)\n\t\t}\n\t\t//write to intermediate file\n\t\tenc := json.NewEncoder(file)\n\t\tfor _, kv := range v {\n\t\t\ter = enc.Encode(&kv)\n\t\t\tif er != nil {\n\t\t\t\tlog.Fatalf(\"cannot encode:%v\", filename)\n\t\t\t}\n\t\t}\n\t\tinterfiles[k] = append(interfiles[k], filename)\n\t\tfile.Close()\n\t}\n\n\treturn interfiles\n}", "title": "" }, { "docid": "9eac43538b132c7cba522e3766c5cf32", "score": "0.48815548", "text": "func Worker(mapf func(string, string) []KeyValue,\n\treducef func(string, []string) string) {\n\treducersCount := getReducersCount()\n\n\tfor {\n\t\ttask := tryGetTaskFromMaster()\n\t\t\n\t\tswitch task.Kind {\n\t\tcase MAP:\n\t\t\toutputFilenames, err := execMap(mapf, task, reducersCount)\n\n\t\t\tif (err != nil) {\n\t\t\t\t// log.Printf(\"Task fail: %v\\n\", err)\n\t\t\t\treportAboutTaskFail(task.Id)\n\t\t\t\tcontinue\n\t\t\t}\n\n\t\t\treportAboutMapTaskComplete(task.Id, outputFilenames)\n\t\tcase REDUCE:\n\t\t\terr := execReduce(reducef, task)\n\n\t\t\tif (err != nil) {\n\t\t\t\t// log.Printf(\"Task fail: %v\\n\", err)\n\t\t\t\treportAboutTaskFail(task.Id)\n\t\t\t\tcontinue\n\t\t\t}\n\n\t\t\treportAboutReduceTaskComplete(task.Id)\n\t\t}\n\t}\t\n}", "title": "" }, { "docid": "0811915295373b86681f602750c0b902", "score": "0.48752737", "text": "func TestReduce(t *testing.T) {\n\tin := []Proto{0, 1, 2, 3, 4, 5, 6}\n\teighteen :=\n\t\tGather(\n\t\t\tReduce(add_reduce,\n\t\t\t\tMap(double_map,\n\t\t\t\t\tFilter(filt_odd,\n\t\t\t\t\t\tSend(in)))))[0].(int)\n\n\tif eighteen != 18 {\n\t\tt.Errorf(\"Expected 18, got %v\", eighteen)\n\t}\n}", "title": "" }, { "docid": "cb9bc69bfbb5a3cc226e14169c5f4203", "score": "0.48381114", "text": "func Worker(mapf func(string, string) []KeyValue,\n\treducef func(string, []string) string) {\n\tgob.Register(&MapTask{})\n\tgob.Register(&ReduceTask{})\n\tworker := &Work{\n\t\tMapf: mapf,\n\t\tReducef: reducef,\n\t}\n\tworker.Run()\n}", "title": "" }, { "docid": "e64041f0a5ecafe5b2f1ce9cc86a5fca", "score": "0.48377532", "text": "func MapReduce(file io.Reader, parser StringParser, reducer Reducer) chan *Entry {\n\t// Input file lines. This channel is unbuffered to publish\n\t// next line to handle only when previous is taken by mapper.\n\tvar lines = make(chan string)\n\n\t// Host thread to spawn new mappers\n\tvar entries = make(chan *Entry, 10)\n\tgo func(topLoad int) {\n\t\t// Create semafore channel with capacity equal to the output channel\n\t\t// capacity. Use it to control mapper goroutines spawn.\n\t\tvar sem = make(chan bool, topLoad)\n\t\tfor i := 0; i < topLoad; i++ {\n\t\t\t// Ready to go!\n\t\t\tsem <- true\n\t\t}\n\n\t\tvar wg sync.WaitGroup\n\t\tfor {\n\t\t\t// Wait until semaphore becomes available and run a mapper\n\t\t\tif !<-sem {\n\t\t\t\t// Stop the host loop if false received from semaphore\n\t\t\t\tbreak\n\t\t\t}\n\t\t\twg.Add(1)\n\t\t\tgo func() {\n\t\t\t\tdefer wg.Done()\n\t\t\t\t// Take next file line to map. Check is channel closed.\n\t\t\t\tline, ok := <-lines\n\t\t\t\t// Return immediately if lines channel is closed\n\t\t\t\tif !ok {\n\t\t\t\t\t// Send false to semaphore channel to indicate that job's done\n\t\t\t\t\tsem <- false\n\t\t\t\t\treturn\n\t\t\t\t}\n\t\t\t\tentry, err := parser.ParseString(line)\n\t\t\t\tif err == nil {\n\t\t\t\t\t// Write result Entry to the output channel. This will\n\t\t\t\t\t// block goroutine runtime until channel is free to\n\t\t\t\t\t// accept new item.\n\t\t\t\t\tentries <- entry\n\t\t\t\t} else {\n\t\t\t\t\thandleError(err)\n\t\t\t\t}\n\t\t\t\t// Increment semaphore to allow new mapper workers to spawn\n\t\t\t\tsem <- true\n\t\t\t}()\n\t\t}\n\t\t// Wait for all mappers to complete, then send a quit signal\n\t\twg.Wait()\n\t\tclose(entries)\n\t}(cap(entries))\n\n\t// Run reducer routine.\n\tvar output = make(chan *Entry)\n\tgo reducer.Reduce(entries, output)\n\n\tgo func() {\n\t\treader := bufio.NewReader(file)\n\t\tline, err := readLine(reader)\n\t\tfor err == nil {\n\t\t\t// Read next line from the file and feed mapper routines.\n\t\t\tlines <- line\n\t\t\tline, err = readLine(reader)\n\t\t}\n\t\tclose(lines)\n\n\t\tif err != nil && err != io.EOF {\n\t\t\thandleError(err)\n\t\t}\n\t}()\n\n\treturn output\n}", "title": "" }, { "docid": "0b08a6ac2190eaee1b6db4db6fb7d1f6", "score": "0.48265895", "text": "func StaticSizeOfMap(\n\tzeroValueKey, zeroValueValue interface{}, count int) (bytes int) {\n\treturn StaticSizeOfMapWithSize(int(reflect.TypeOf(zeroValueKey).Size()),\n\t\tint(reflect.TypeOf(zeroValueValue).Size()), count)\n}", "title": "" }, { "docid": "dee0acd1460438b18ac95dbc6e24e4e5", "score": "0.4814441", "text": "func (h *MapUint32ToInt64) Inc(k uint32) {\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": "d3ee48ada201092cd4fc9713f31ff519", "score": "0.48138118", "text": "func (NameMap) NKeys() int { return 0 }", "title": "" }, { "docid": "f3f5103fe41b413f4022a81c4106bcb0", "score": "0.4808086", "text": "func checkKeyHash(key string) int {\n\thasher := md5.New()\n\n\thasher.Write([]byte(key + newline))\n\tringIndex := -1 //where the hash of the key would go in the hash ring\n\t\n\tfor ind, hash := range hashRing {\n\t\tif key > hash {\n\t\t\tcontinue\n\t\t}\n\t\tringIndex = ind\n\t}\n\tif ringIndex < 0 {\n\t\tringIndex = 0\n\t}\n\tringHash := hashRing[ringIndex] //get corresponding hash\n\treturn hashClusterMap[ringHash] //return clusterID corresponsing to hash\n}", "title": "" }, { "docid": "22da3799567b9b705328332ba56138c1", "score": "0.48022884", "text": "func iHash(key string) int {\n\th := fnv.New32a()\n\th.Write([]byte(key))\n\treturn int(h.Sum32() & 0x7fffffff)\n}", "title": "" }, { "docid": "14381b0da7f88cf589137caf96dac3aa", "score": "0.47942773", "text": "func fastReduce(x, N uint64) uint64 {\n\t// This uses math/bits to perform the 128-bit multiplication as the compiler\n\t// will replace it with the relevant intrinsic on most architectures.\n\t//\n\t// The high 64 bits in a 128-bit product is the same as shifting the entire\n\t// product right by 64 bits.\n\thi, _ := bits.Mul64(x, N)\n\treturn hi\n}", "title": "" }, { "docid": "10acad43371af2aebd5ee8f86cc266eb", "score": "0.47929794", "text": "func newHashMap(size int) *hashMap {\n\treturn &hashMap{\n\t\tlookup: make(map[uint64][]Task, size),\n\t}\n}", "title": "" }, { "docid": "8e0a26a15ee810ace22882410eb944a6", "score": "0.47912315", "text": "func benchmarkLotsReads(m IMap, b *testing.B, numKeys, numReads int) {\n\t/* Initialize the map */\n\tInitializeMap(numKeys, m)\n\tb.ResetTimer()\n\truntime.GOMAXPROCS(runtime.NumCPU())\n\tb.RunParallel(func(pb *testing.PB) {\n\t\tfor pb.Next() {\n\t\t\trand.Seed(time.Now().UTC().UnixNano())\n\t\t\tfor i := 0; i < numReads; i++ {\n\t\t\t\tk := rand.Intn(numKeys)\n\t\t\t\tv, ok := m.Get(k)\n\t\t\t\tif ok {\n\t\t\t\t\texpectedV := fmt.Sprintf(\"%12d\", k)\n\t\t\t\t\tif v != expectedV {\n\t\t\t\t\t\tb.Error(\"Wrong value for key\", k, \". Expect \", expectedV, \". Got \", v)\n\t\t\t\t\t}\n\t\t\t\t} else {\n\t\t\t\t\tb.Error(\"Failed to get key \", k)\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t})\n}", "title": "" }, { "docid": "10779648e2c2383dd48404524e158bf8", "score": "0.47808313", "text": "func (s *Shards) Index(key string) int {\n\th := fnv.New64()\n\th.Write([]byte(key))\n\treturn int(h.Sum64() % uint64(s.Count))\n}", "title": "" }, { "docid": "bb4d423824b5e9a0743890608d37175a", "score": "0.4772523", "text": "func doMapTask(mapf func(string, string) []KeyValue,\n\tfilePath string,\n\toutputfile string) []string {\n\n\tdata, _ := ioutil.ReadFile(filePath)\n\tkva := mapf(filePath, string(data))\n\n\t// Assume R is 2\n\tpars := DoPartition(kva, 2)\n\n\treturn PartitionStore(pars, outputfile)\n}", "title": "" }, { "docid": "73c1d1ee49b38db1858aac5d89539eb6", "score": "0.47703055", "text": "func BenchmarkKeyHashMax(b *testing.B) {\n\tkh := New()\n\tfor i := ADD_PATH_COUNT; i > 0; i-- {\n\t\tkh.Max(\"a\" + strconv.Itoa(i))\n\t}\n}", "title": "" }, { "docid": "cdb476628ae18c879495e5ab8a29213a", "score": "0.476658", "text": "func Worker(mapf func(string, string) []KeyValue, reducef func(string, []string) string) {\n\n\tfmt.Println(\"Worker starting.\\n\")\n\ttime.Sleep(time.Second)\n\n\tfor {\n\t\ttask := GetTask()\n\n\t\tif task.TaskType == WaitTaskType {\n\t\t\tfmt.Printf(\"Master asked us to wait.\\n\")\n\t\t} else if task.TaskType == DieTaskType {\n\t\t\tfmt.Printf(\"Master asked us to die.\\n\")\n\t\t\tos.Exit(0)\n\t\t} else if task.TaskType == MapTaskType {\n\t\t\tfmt.Printf(\"Master asked us to run a MapTask.\\n\")\n\t\t\tfmt.Printf(\"Running mapf for task %d (%v)\\n\", task.TaskNum, task.Filename)\n\t\t\tresult := mapf(task.Filename, readFile(task.Filename))\n\t\t\tfmt.Printf(\"Writing results for task %d (%v)\\n\", task.TaskNum, task.Filename)\n\t\t\twriteIntermediateFiles(result, task.TaskNum, task.NumReduceTasks)\n\t\t\tReportTask(task.TaskType, task.TaskNum, Done)\n\t\t} else if task.TaskType == ReduceTaskType {\n\t\t\tfmt.Printf(\"Master asked us to run a ReduceTask.\\n\")\n\n\t\t\t// Open files and read into KVA struct\n\n\t\t\tfmt.Printf(\"Opening and reading intermediate KVA files.\\n\")\n\t\t\tkva := make([]KeyValue, 0)\n\t\t\tt := 0\n\t\t\tfor t < task.NumMapTasks {\n\t\t\t\tfilename := getFilenameForTask(t, task.TaskNum)\n\t\t\t\tfile, err := os.Open(filename)\n\t\t\t\tif err != nil {\n\t\t\t\t\tlog.Fatalf(\"cannot open %v\", filename)\n\t\t\t\t}\n\t\t\t\tdec := json.NewDecoder(file)\n\t\t\t\tfor {\n\t\t\t\t\tvar kv KeyValue\n\t\t\t\t\tif err := dec.Decode(&kv); err != nil {\n\t\t\t\t\t\tbreak\n\t\t\t\t\t}\n\t\t\t\t\tkva = append(kva, kv)\n\t\t\t\t}\n\t\t\t\tfile.Close()\n\t\t\t\tt += 1\n\t\t\t}\n\n\t\t\tfmt.Printf(\"Sorting KVA by the Key.\\n\")\n\t\t\t// Sort KVA by Key\n\t\t\tsort.Sort(ByKey(kva))\n\n\t\t\tofilename := getFilenameForReduceTask(task.TaskNum)\n\t\t\tofile, err := os.Create(ofilename)\n\t\t\tif err != nil {\n\t\t\t\tlog.Fatalf(\"cannot create %v\", ofilename)\n\t\t\t}\n\n\t\t\t// call reducef on each distinct key in intermediate[],\n\t\t\t// and print the result to ofile\n\t\t\ti := 0\n\t\t\tfor i < len(kva) {\n\t\t\t\tj := i + 1\n\t\t\t\tfor j < len(kva) && kva[j].Key == kva[i].Key {\n\t\t\t\t\tj++\n\t\t\t\t}\n\t\t\t\tvalues := []string{}\n\t\t\t\tfor k := i; k < j; k++ {\n\t\t\t\t\tvalues = append(values, kva[k].Value)\n\t\t\t\t}\n\t\t\t\toutput := reducef(kva[i].Key, values)\n\t\t\t\tfmt.Fprintf(ofile, \"%v %v\\n\", kva[i].Key, output)\n\t\t\t\ti = j\n\t\t\t}\n\n\t\t\tReportTask(task.TaskType, task.TaskNum, Done)\n\t\t}\n\n\t\ttime.Sleep(100 * time.Millisecond)\n\t}\n}", "title": "" }, { "docid": "1f9ceef0eca96d05c3ce72ecf073605f", "score": "0.47568005", "text": "func reduceF(key string, values []string) string {\n\t// TODO: implement me\n\t// you have to write this function\n\t// TODO TODO TODO\n}", "title": "" }, { "docid": "6813205f4b868cf0945101b0c399bf24", "score": "0.4754587", "text": "func BenchmarkLockMapLotsWriteFreqKeys(b *testing.B) {\n\tbenchmarkConcurrentWritesNormalDist(lockmap.NewLockMap(), b, NumWritesInWriteOnlyTestSmall)\n}", "title": "" }, { "docid": "7317fb9d8853e17aa0fdce18e8bf4e74", "score": "0.47407353", "text": "func (r keylessRow) ReduceToIndexKeys(idx schema.Index, tf *types.TupleFactory) (types.Tuple, types.Tuple, types.Tuple, error) {\n\tvals := make([]types.Value, 0, len(idx.AllTags())*2)\n\tfor _, tag := range idx.AllTags() {\n\t\tval, ok := r.GetColVal(tag)\n\t\tif !ok {\n\t\t\tval = types.NullValue\n\t\t}\n\t\tvals = append(vals, types.Uint(tag), val)\n\t}\n\thashTag, err := r.key.Get(0)\n\tif err != nil {\n\t\treturn types.Tuple{}, types.Tuple{}, types.Tuple{}, err\n\t}\n\thashVal, err := r.key.Get(1)\n\tif err != nil {\n\t\treturn types.Tuple{}, types.Tuple{}, types.Tuple{}, err\n\t}\n\n\tcardTag, err := r.val.Get(0)\n\tif err != nil {\n\t\treturn types.Tuple{}, types.Tuple{}, types.Tuple{}, err\n\t}\n\tcardVal, err := r.val.Get(1)\n\tif err != nil {\n\t\treturn types.Tuple{}, types.Tuple{}, types.Tuple{}, err\n\t}\n\n\tvar fullKey types.Tuple\n\tvar partialKey types.Tuple\n\tvar keyValue types.Tuple\n\n\tif tf == nil {\n\t\tkeyValue, err = types.NewTuple(r.Format(), cardTag, cardVal)\n\t\tif err != nil {\n\t\t\treturn types.Tuple{}, types.Tuple{}, types.Tuple{}, err\n\t\t}\n\n\t\tvals = append(vals, hashTag, hashVal)\n\t\tfullKey, err = types.NewTuple(r.Format(), vals...)\n\t\tif err != nil {\n\t\t\treturn types.Tuple{}, types.Tuple{}, types.Tuple{}, err\n\t\t}\n\n\t\tpartialKey, err = types.NewTuple(r.Format(), vals[:idx.Count()*2]...)\n\t\tif err != nil {\n\t\t\treturn types.Tuple{}, types.Tuple{}, types.Tuple{}, err\n\t\t}\n\t} else {\n\t\tkeyValue, err = tf.Create(cardTag, cardVal)\n\t\tif err != nil {\n\t\t\treturn types.Tuple{}, types.Tuple{}, types.Tuple{}, err\n\t\t}\n\n\t\tvals = append(vals, hashTag, hashVal)\n\t\tfullKey, err = tf.Create(vals...)\n\t\tif err != nil {\n\t\t\treturn types.Tuple{}, types.Tuple{}, types.Tuple{}, err\n\t\t}\n\n\t\tpartialKey, err = tf.Create(vals[:idx.Count()*2]...)\n\t\tif err != nil {\n\t\t\treturn types.Tuple{}, types.Tuple{}, types.Tuple{}, err\n\t\t}\n\t}\n\n\treturn fullKey, partialKey, keyValue, nil\n}", "title": "" }, { "docid": "48f82642cfb660269f75543a0148c3f2", "score": "0.4738854", "text": "func reduceName(jobName string, mapTask int, reduceTask int) string {\n\treturn \"mrtmp.\" + jobName + \"-\" + strconv.Itoa(mapTask) + \"-\" + strconv.Itoa(reduceTask)\n}", "title": "" }, { "docid": "6e2299d62382d27165d13845e0cf787e", "score": "0.47284716", "text": "func countFunc(args ...interface{}) (interface{}, error) {\n\tuniqueGroup := args[0].(string)\n\tdigest := digestArgs(args[1:])\n\tif uniqueMap[uniqueGroup] == nil {\n\t\tuniqueMap[uniqueGroup] = make(map[string]int)\n\t}\n\tif _, ok := uniqueMap[uniqueGroup][digest]; ok == false {\n\t\t// The value has not been seen\n\t\tuniqueMap[uniqueGroup][digest] = 0\n\t}\n\tuniqueMap[uniqueGroup][digest]++\n\treturn (float64)(uniqueMap[uniqueGroup][digest]), nil\n}", "title": "" }, { "docid": "20453463f1a955e17b20ae950910ab9c", "score": "0.47207847", "text": "func IDMapPut(m IDMap, val interface{}) string {\n\tmeta := IDMapMetadata[m]\n\n\tmeta.Lock.Lock()\n\tdefer meta.Lock.Unlock()\n\n\tmapValue := reflect.ValueOf(m).Elem()\n\tfor mapValue.MapIndex(reflect.ValueOf(strconv.Itoa(meta.Counter))).IsValid() {\n\t\tmeta.Counter++\n\t\tif meta.Counter == MaxID {\n\t\t\tmeta.Counter = 0\n\t\t}\n\t}\n\tID := strconv.Itoa(meta.Counter)\n\tmapValue.SetMapIndex(reflect.ValueOf(ID), reflect.ValueOf(val))\n\n\tmeta.Counter++\n\tif meta.Counter == MaxID {\n\t\tmeta.Counter = 0\n\t}\n\n\treturn ID\n}", "title": "" }, { "docid": "31f0fd39bf9209e43158e2cfeaa5d241", "score": "0.4719676", "text": "func (this *MyHashMap) Get(key int) int {\n\thKey := key % 100000\n\treturn this.Store[hKey]\n}", "title": "" }, { "docid": "7eb09c5b15bfc9b1f2295129378b50d1", "score": "0.471637", "text": "func BenchmarkKeyHashShortStringKey(b *testing.B) {\n\tb.StopTimer()\n\tm := make(map[string]int)\n\tfor i := ADD_PATH_COUNT; i > 0; i-- {\n\t\tx := strconv.Itoa(i)\n\t\tm[x] = i\n\t}\n\tb.StartTimer()\n\tfor i := ADD_PATH_COUNT; i > 0; i-- {\n\t\tm[\"2\"] = m[\"1\"]\n\t\tm[\"1000\"] = m[\"1001\"]\n\t\tm[\"5000\"] = m[\"5001\"]\n\t\tm[\"9999\"] = m[\"9991\"]\n\t\tm[\"100000\"] = m[\"100001\"]\n\t\tm[\"200000\"] = m[\"200001\"]\n\n\t}\n}", "title": "" }, { "docid": "35a8ec89e17c742a37ddfe0ac57b1ef3", "score": "0.471627", "text": "func (h *MapUint32ToInt) Inc(k uint32) {\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": "5239b88a99c38fc2737d6cd988c5ff56", "score": "0.4714168", "text": "func (m *Master) getNextReduceTaskID() int {\n\tnextReduceTaskID := m.nextReduceTaskID\n\tm.nextReduceTaskID++\n\treturn nextReduceTaskID\n}", "title": "" }, { "docid": "a50e8f04a102467609e5308f09f1a1c0", "score": "0.470856", "text": "func expandJobHadoopJobMap(c *Client, f map[string]JobHadoopJob) (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 := expandJobHadoopJob(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": "" } ]
4aaf93afbf30824f7ba649b60bcbe763
StartLeader runs the given test as the leader.
[ { "docid": "8666baedcefd078fcafaf9ce1efa891a", "score": "0.8279193", "text": "func (hv *Hyperviser) StartLeader(testType TestType, leaderLog, testLog string) error {\n\thv.mu.Lock()\n\tif !hv.isRunning {\n\t\thv.mu.Unlock()\n\t\treturn fmt.Errorf(\"Not running\")\n\t}\n\tif hv.ti.isTesting {\n\t\thv.mu.Unlock()\n\t\treturn fmt.Errorf(\"Already testing\")\n\t}\n\tif _, ok := tests[testType]; !ok {\n\t\thv.mu.Unlock()\n\t\treturn fmt.Errorf(\"Invalid test type: %s\", testType)\n\t}\n\n\t// Initialize leader state\n\thv.ti.isTesting = true\n\thv.ti.isLeader = true\n\thv.ti.killChan = make(chan bool)\n\thv.ti.readyChan = make(chan bool)\n\thv.ti.testType = testType\n\n\t// It is safe to unlock here because RPC calls use isLeader and isReady to\n\t// determine whether to run.\n\thv.mu.Unlock()\n\tdefer func() {\n\t\t// DPrintf(\"hv (%s): StartLeader: calling stopTest on exit\", hv.ap.String())\n\t\thv.stopTest(true)\n\t}()\n\n\thv.ls = &leaderState{}\n\tdefer func() {\n\t\t// DPrintf(\"hv (%s): StartLeader: calling cleanLeader on exit\", hv.ap.String())\n\t\thv.cleanLeader(true)\n\t}()\n\n\t// Set up log files.\n\tf, err := os.Create(hv.logDir + leaderLog)\n\tif err != nil {\n\t\treturn fmt.Errorf(\"Creating leader log failed: %s\", err)\n\t}\n\thv.ls.lgBuf = f\n\thv.ls.lg = log.New(f, hv.ap.String()+\" \", log.LstdFlags|log.LUTC)\n\n\t// Run the test\n\t// TODO: should rewrite to reuse existing chord instances rather than\n\t// tearing down every time.\n\tfor batchNum, batchSize := range tests[testType].phases {\n\t\thv.mu.Lock()\n\t\tlogName := fmt.Sprintf(\"%s%d\", testLog, batchSize)\n\t\tf, err = os.Create(hv.logDir + logName)\n\t\tif err != nil {\n\t\t\thv.mu.Unlock()\n\t\t\treturn fmt.Errorf(\"Creating test log failed: %s\", err)\n\t\t}\n\t\thv.ti.lgBuf = f\n\t\thv.ti.lg = log.New(f, hv.ap.String()+\" \", log.LstdFlags|log.LUTC)\n\n\t\thv.ls.lg.Printf(\"Starting %s round %d\", testType, batchNum)\n\t\tCPrintf(White, \"hv (%s): Starting %s round %d\", hv.ap.String(), testType, batchNum)\n\t\thv.ls.servers = hv.initServers(batchSize)\n\n\t\t// Initialize leader's chords\n\t\tif err := hv.addChord(nil, false); err != nil {\n\t\t\thv.mu.Unlock()\n\t\t\treturn fmt.Errorf(\"First chord initialization failed: %s\", err)\n\t\t}\n\n\t\tn := (*hv.chkvs)[0].Ch.GetNode()\n\t\thv.ti.baseCh = &n\n\t\tCPrintf(White, \"hv (%s): baseChord: %s\", hv.ap.String(), hv.ti.baseCh.String())\n\n\t\tinfo := (*hv.ls.servers)[hv.ap]\n\t\tinfo.numChs = 1\n\n\t\t// Prepare test on followers and leader\n\t\thv.ls.lg.Println(\"Preparing for test\")\n\t\tDPrintf(\"hv (%s): Preparing for test\", hv.ap.String())\n\t\thv.ls.readyWg = &sync.WaitGroup{}\n\n\t\thv.ti.isReady = true\n\t\thv.mu.Unlock()\n\t\tfor ap, info := range *hv.ls.servers {\n\t\t\thv.ls.readyWg.Add(1)\n\t\t\tif ap == hv.ap {\n\t\t\t\tcontinue\n\t\t\t}\n\t\t\tgo hv.sendPrepare(ap, info, logName)\n\t\t}\n\t\tgo hv.prepareLeader()\n\n\t\t// Gather responses\n\t\thv.ls.lg.Println(\"Waiting for ready\")\n\t\tDPrintf(\"hv (%s): Waiting for ready\", hv.ap.String())\n\n\t\twaitChan := make(chan bool)\n\t\tgo func() {\n\t\t\thv.ls.readyWg.Wait()\n\t\t\twaitChan <- true\n\t\t}()\n\t\ttimeout := 20 * time.Second * time.Duration(info.targetNumChs)\n\t\tDPrintf(\"timeout: %ds\", timeout/time.Second)\n\t\tselect {\n\t\tcase <-time.After(timeout):\n\t\t\tmsg := \"Timeout before servers ready\"\n\t\t\thv.ls.lg.Println(msg)\n\t\t\treturn fmt.Errorf(msg)\n\t\tcase <-waitChan:\n\t\t\t// Nothing to do but move on.\n\t\t}\n\n\t\t// Run test\n\t\thv.mu.Lock()\n\t\thv.ti.isRunning = true\n\t\thv.ls.doneWg = &sync.WaitGroup{}\n\t\thv.mu.Unlock()\n\t\thv.ls.lg.Println(\"Executing test\")\n\t\tDPrintf(\"hv (%s): Executing test\", hv.ap.String())\n\t\tfor ap, info := range *hv.ls.servers {\n\t\t\tDPrintf(\"in servers loop: ap=%s info=%+v\", ap.String(), *info)\n\t\t\thv.ls.doneWg.Add(1)\n\t\t\tif ap == hv.ap {\n\t\t\t\tDPrintf(\"skipping loop iteration\")\n\t\t\t\tcontinue\n\t\t\t}\n\t\t\tgo hv.sendStart(ap, info, logName)\n\t\t}\n\t\tgo hv.startLeaderTest()\n\n\t\thv.ls.lg.Println(\"Waiting for test to finish\")\n\t\tDPrintf(\"hv (%s): Waiting for test to finish\", hv.ap.String())\n\t\twaitChan = make(chan bool)\n\t\tgo func() {\n\t\t\thv.ls.doneWg.Wait()\n\t\t\twaitChan <- true\n\t\t}()\n\t\tselect {\n\t\tcase <-time.After(tests[testType].timeout):\n\t\t\tmsg := \"Timeout before getting test results\"\n\t\t\thv.ls.lg.Println(msg)\n\t\t\treturn fmt.Errorf(msg)\n\t\tcase <-waitChan:\n\t\t\t// Nothing to do but move on\n\t\t}\n\n\t\thv.ls.lg.Printf(\"Test %d Succeeded\", batchNum)\n\t\tDPrintf(\"hv (%s): Test %d Succeeded\", hv.ap.String(), batchNum)\n\n\t\t// Clean up leader\n\t\thv.mu.Lock()\n\t\tDPrintf(\"hv (%s): StartLeader: calling choseChords after successful test\",\n\t\t\thv.ap.String())\n\t\thv.closeChords()\n\t\thv.mu.Unlock()\n\t}\n\n\treturn nil\n}", "title": "" } ]
[ { "docid": "9c08d9059ade2afb6ec10984a0789e8e", "score": "0.80005497", "text": "func (hv *Hyperviser) startLeaderTest() {\n\tDPrintf(\"hv (%s): startLeaderTest\", hv.ap.String())\n\terr := tests[hv.ti.testType].f(hv)\n\n\thv.ls.mu.Lock()\n\tinfo := (*hv.ls.servers)[hv.ap]\n\tif err != nil {\n\t\thv.ls.lg.Printf(\"Node %s test failed: %s\", hv.ap.String(), err)\n\t\tinfo.status = failedSt\n\t} else {\n\t\tinfo.status = doneSt\n\t}\n\n\tDPrintf(\"hv (%s): startLeaderTest: calling doneWg.Done()\", hv.ap.String())\n\thv.ls.doneWg.Done()\n\thv.ls.mu.Unlock()\n\tDPrintf(\"hv (%s): startLeaderTest: exiting\", hv.ap.String())\n}", "title": "" }, { "docid": "9ee4c7dc4f9b5de9cde7aa33f37f7b35", "score": "0.72926474", "text": "func (_m *LeaderMonitor) StartLeader(view uint64, leaderID uint64) {\n\t_m.Called(view, leaderID)\n}", "title": "" }, { "docid": "7b69037a4f67883de3135e5cf6d44a1e", "score": "0.67604554", "text": "func (hv *Hyperviser) StartTest(args *TestArgs, reply *struct{}) error {\n\thv.mu.Lock()\n\tdefer hv.mu.Unlock()\n\tDPrintf(\"hv (%s): StartTest from %s\", hv.ap.String(), args.AA.AP.String())\n\terr := hv.validate(args.AA)\n\tswitch {\n\tcase err != nil:\n\t\treturn err\n\tcase !hv.ti.isTesting:\n\t\treturn fmt.Errorf(\"No test running\")\n\tcase args.TType != hv.ti.testType:\n\t\treturn fmt.Errorf(\"Invalid test type (%v)\", args.TType)\n\tcase hv.ti.isLeader:\n\t\treturn fmt.Errorf(\"Cannot call StartTest on leader\")\n\tcase !hv.ti.isReady:\n\t\treturn fmt.Errorf(\"Not ready to start test\")\n\tcase hv.ti.isRunning:\n\t\treturn fmt.Errorf(\"Test already running\")\n\t}\n\n\thv.ti.readyChan <- true\n\thv.ti.isRunning = true\n\n\tgo hv.executeTest(hv.ti.testType, hv.ti.tNum)\n\treturn nil\n}", "title": "" }, { "docid": "d0827105b8399137930a76985d96dca7", "score": "0.6381886", "text": "func TestModLeaderSet(t *testing.T) {\n\ttests.RunServer(func(s *server.Server) {\n\t\t// Set leader.\n\t\tbody, status, err := testSetLeader(s, \"foo\", \"xxx\", 10)\n\t\tassert.NoError(t, err)\n\t\tassert.Equal(t, status, 200)\n\t\tassert.Equal(t, body, \"2\")\n\n\t\t// Check that the leader is set.\n\t\tbody, status, err = testGetLeader(s, \"foo\")\n\t\tassert.NoError(t, err)\n\t\tassert.Equal(t, status, 200)\n\t\tassert.Equal(t, body, \"xxx\")\n\n\t\t// Delete leader.\n\t\tbody, status, err = testDeleteLeader(s, \"foo\", \"xxx\")\n\t\tassert.NoError(t, err)\n\t\tassert.Equal(t, status, 200)\n\t\tassert.Equal(t, body, \"\")\n\n\t\t// Check that the leader is removed.\n\t\tbody, status, err = testGetLeader(s, \"foo\")\n\t\tassert.NoError(t, err)\n\t\tassert.Equal(t, status, 200)\n\t\tassert.Equal(t, body, \"\")\n\t})\n}", "title": "" }, { "docid": "64f29d4e25c0704c7a66298c0dda3187", "score": "0.6183083", "text": "func TestHA_CreateLeader(t *testing.T) {\n\tha := NewHA(new(mockStorage.MockStorage), new(mockLogger.MockLogger), &scheduler.LeaderConfiguration{\n\t\tIP: \"1\", // Make sure we break out of our HA loop by matching on what mock storage gives us.\n\t})\n\tif err := ha.CreateLeader(); err != nil {\n\t\tt.Logf(\"Failed to create a leader %v\", err.Error())\n\t\tt.Fail()\n\t}\n}", "title": "" }, { "docid": "0485c9a9a2240c7ecb37b009eb07a40d", "score": "0.6040063", "text": "func TestClientInteraction_Leader(t *testing.T) {\n\t// Out.Println(\"TestClientInteraction_Leader start\")\n\tsuppressLoggers()\n\tconfig := DefaultConfig()\n\tcluster, _ := CreateLocalCluster(config)\n\tdefer cleanupCluster(cluster)\n\n\ttime.Sleep(2 * time.Second)\n\n\tleader, err := findLeader(cluster)\n\tif err != nil {\n\t\tt.Fatal(err)\n\t}\n\tfmt.Printf(\"~~~~~~~~~~~~~~LEADER: %v\\n\", leader)\n\t// First make sure we can register a client correctly\n\treply, _ := leader.RegisterClientCaller(context.Background(), &RegisterClientRequest{})\n\tif reply.Status != ClientStatus_OK {\n\t\tt.Fatal(\"Counld not register client\")\n\t}\n\n\tclientid := reply.ClientId\n\n\t// Hash initialization request\n\tinitReq := ClientRequest{\n\t\tClientId: clientid,\n\t\tSequenceNum: 1,\n\t\tStateMachineCmd: hashmachine.HASH_CHAIN_INIT,\n\t\tData: []byte(\"hello\"),\n\t}\n\tclientResult, _ := leader.ClientRequestCaller(context.Background(), &initReq)\n\tif clientResult.Status != ClientStatus_OK {\n\t\tt.Fatal(\"Leader failed to commit a client request\")\n\t}\n\n\t// Make sure further request is correct processed\n\tClientReq := ClientRequest{\n\t\tClientId: clientid,\n\t\tSequenceNum: 2,\n\t\tStateMachineCmd: hashmachine.HASH_CHAIN_ADD,\n\t\tData: []byte{},\n\t}\n\tclientResult, _ = leader.ClientRequestCaller(context.Background(), &ClientReq)\n\tif clientResult.Status != ClientStatus_OK {\n\t\tt.Fatal(\"Leader failed to commit a client request\")\n\t}\n\n\tleader.GetRemoteSelf().RemoveClientConn()\n\tcloseAllConnections()\n\t// Out.Println(\"TestClientInteraction_Leader done\")\n\t// time.Sleep(time.Second * WAIT_PERIOD)\n}", "title": "" }, { "docid": "0dba68f9c4c89f097704a8699b12e0a9", "score": "0.59416366", "text": "func (_m *LeaderMonitor) StartFollower(view uint64, leaderID uint64) {\n\t_m.Called(view, leaderID)\n}", "title": "" }, { "docid": "779dfda67db95967415dbbcc43a5e3e4", "score": "0.59318453", "text": "func (n *Node) Leader() {\n\tfmt.Printf(\"Node %d # Leader start.\\n\", n.Id)\n\tn.LogEvent(\"Leader start\")\n\tfor n.Active && n.State == Leader {\n\t\tgo n.PerformHeartBeat()\n\t\ttime.Sleep(200 * time.Millisecond)\n\t}\n}", "title": "" }, { "docid": "7ee000b30a9b13cf6843176ebcb455a2", "score": "0.5832509", "text": "func (p *partition) SetLeader(leader string, epoch uint64) error {\n\tp.mu.Lock()\n\tdefer p.mu.Unlock()\n\n\tif epoch < p.LeaderEpoch {\n\t\treturn fmt.Errorf(\"proposed leader epoch %d is less than current epoch %d\",\n\t\t\tepoch, p.LeaderEpoch)\n\t}\n\tp.Leader = leader\n\tp.LeaderEpoch = epoch\n\n\tif p.recovered || p.paused {\n\t\t// If this partition is being recovered, we will start the\n\t\t// leader/follower loop later. If it's paused, we won't start it til\n\t\t// it's resumed.\n\t\treturn nil\n\t}\n\n\treturn p.startLeadingOrFollowing()\n}", "title": "" }, { "docid": "a25ba734fef3c558e12b54aef2681547", "score": "0.58027107", "text": "func TestHA_GetLeader(t *testing.T) {\n\tha := NewHA(new(mockStorage.MockStorage), new(mockLogger.MockLogger), &scheduler.LeaderConfiguration{\n\t\tIP: \"1\", // Make sure we break out of our HA loop by matching on what mock storage gives us.\n\t})\n\tif err := ha.CreateLeader(); err != nil {\n\t\tt.Logf(\"Failed to create a leader %v\\n\", err.Error())\n\t\tt.Fail()\n\t}\n\t// Leader string is simply an empty string during testing...\n\t_, err := ha.GetLeader()\n\tif err != nil {\n\t\tt.Logf(\"Failed to grab the leader %v\\n\", err.Error())\n\t\tt.Fail()\n\t}\n}", "title": "" }, { "docid": "bdfe1240cff146c8325015276aafb0e1", "score": "0.5795971", "text": "func NewLeader(id string) {\n\tfmt.Printf(\"%s: new leader: %s\\n\", hostname(), id)\n}", "title": "" }, { "docid": "9bf324671facd70e72378ed401885e4c", "score": "0.5734147", "text": "func (_TokenMigratorTest *TokenMigratorTestTransactor) TestStart(opts *bind.TransactOpts) (*types.Transaction, error) {\n\treturn _TokenMigratorTest.contract.Transact(opts, \"testStart\")\n}", "title": "" }, { "docid": "5a3d380661dc4348a7b22d70512d101a", "score": "0.5712918", "text": "func TestClientInteraction_oldleader(t *testing.T) {\n\t// Out.Println(\"TestClientInteraction_oldleader start\")\n\tsuppressLoggers()\n\tconfig := DefaultConfig()\n\tconfig.ClusterSize = 5\n\n\tcluster, err := CreateLocalCluster(config)\n\tdefer cleanupCluster(cluster)\n\tif err != nil {\n\t\tt.Fatal(err)\n\t}\n\n\t// wait for a leader to be elected\n\ttime.Sleep(time.Second * WAIT_PERIOD)\n\toldLeader, err := findLeader(cluster)\n\tif err != nil {\n\t\tt.Fatal(err)\n\t}\n\tfmt.Printf(\"~~~~~~~~~~~~OLD LEADER: %v\\n\", oldLeader.GetRemoteSelf().GetId())\n\t// partition leader, triggering election\n\toldTerm := oldLeader.GetCurrentTerm()\n\toldLeader.NetworkPolicy.PauseWorld(true)\n\n\t// wait for new leader to be elected\n\ttime.Sleep(time.Second * WAIT_PERIOD)\n\n\t// unpause old leader and wait for it to become a follower\n\toldLeader.NetworkPolicy.PauseWorld(false)\n\ttime.Sleep(time.Second * WAIT_PERIOD)\n\t//Out.Printf(\"OLD LEADER is: %v\\n\", oldLeader.State.String())\n\tnewLeader, err := findLeader(cluster)\n\tif err != nil {\n\t\tt.Fatal(err)\n\t}\n\tfmt.Printf(\"~~~~~~~~~~~~NEW LEADER: %v\\n\", newLeader.GetRemoteSelf().GetId())\n\n\tif oldLeader.Id == newLeader.Id {\n\t\tt.Errorf(\"leader did not change\")\n\t}\n\n\tif newLeader.GetCurrentTerm() == oldTerm {\n\t\tt.Errorf(\"term did not change\")\n\t}\n\n\t//register the client to the old leader\n\treply, _ := oldLeader.GetRemoteSelf().RegisterClientRPC()\n\tfmt.Printf(\"reply request: %v\\n\", reply.Status)\n\tif reply.Status != ClientStatus_NOT_LEADER && reply.Status != ClientStatus_ELECTION_IN_PROGRESS {\n\t\tt.Error(reply.Status)\n\t\tt.Fatal(\"Wrong response when registering a client to an old leader\")\n\t}\n\n\treq := ClientRequest{\n\t\tClientId: 1,\n\t\tSequenceNum: 1,\n\t\tStateMachineCmd: hashmachine.HASH_CHAIN_INIT,\n\t\tData: []byte(\"hello\"),\n\t}\n\tclientResult, _ := oldLeader.GetRemoteSelf().ClientRequestRPC(&req)\n\tfmt.Printf(\"client request1: %v\\n\", clientResult.Status)\n\tif clientResult.Status != ClientStatus_NOT_LEADER && clientResult.Status != ClientStatus_ELECTION_IN_PROGRESS {\n\t\tt.Fatal(\"Wrong response when sending a client request to an old leader\")\n\t}\n\t// Out.Println(\"TestClientInteraction_oldleader done\")\n\t// time.Sleep(time.Second * WAIT_PERIOD)\n}", "title": "" }, { "docid": "b9f5438f15482a0c27ede9b6f939e063", "score": "0.5697888", "text": "func (m *Participant) EnableLeader() {\n\tm.setLeader(m.member)\n}", "title": "" }, { "docid": "9e7c6b6ff52d65588ad770d4869d281b", "score": "0.5636815", "text": "func (svc *mgmtSvc) startLeaderLoops(ctx context.Context) {\n\tgo svc.leaderTaskLoop(ctx)\n}", "title": "" }, { "docid": "2382c32a4319bcd6cee73dc76a8d70d0", "score": "0.5633048", "text": "func NewLeader(app common.Application, privKey sign.PrivateKey, rs common.RBCSetting, g *errgroup.Group) (\n\tmao *leader.Leader, stopper func(), err error) {\n\tl := leader.NewLeader(\"mao\", app, rs.ByzantineLimit, rs.AllPeers, privKey)\n\tlis, err := net.Listen(\"tcp\", fmt.Sprintf(\"%s:%d\", address, leaderPort))\n\tif err != nil {\n\t\treturn nil, func() {}, err\n\t}\n\ts := grpc.NewServer()\n\n\tpb.RegisterEchoServer(s, l)\n\tpb.RegisterReadyServer(s, l)\n\tpb.RegisterPrepareServer(s, l)\n\tpb.RegisterSyncServer(s, l)\n\tl.Debugf(\"RBC Leader starts to listen on %s:%d\", address, leaderPort)\n\tif g == nil {\n\t\terr = s.Serve(lis)\n\t\treturn l, func() {}, nil\n\t}\n\tg.Go(func() error {\n\t\treturn s.Serve(lis)\n\t})\n\treturn l, s.GracefulStop, nil\n\n}", "title": "" }, { "docid": "c33643ac4d077cfd94df580c54b66cec", "score": "0.562713", "text": "func StartTest() {\n\tlogin()\n}", "title": "" }, { "docid": "ea39f37c257b2cb73293ecbda5ff37e8", "score": "0.5522973", "text": "func (m *Participant) PreCheckLeader() error {\n\t// No specific thing to check. Returns no error.\n\treturn nil\n}", "title": "" }, { "docid": "7861c9028283c69b4feb124a46f1e07e", "score": "0.5518154", "text": "func TestModLeaderRenew(t *testing.T) {\n\ttests.RunServer(func(s *server.Server) {\n\t\t// Set leader.\n\t\tbody, status, err := testSetLeader(s, \"foo\", \"xxx\", 2)\n\t\tassert.NoError(t, err)\n\t\tassert.Equal(t, status, 200)\n\t\tassert.Equal(t, body, \"2\")\n\n\t\ttime.Sleep(1 * time.Second)\n\n\t\t// Renew leader.\n\t\tbody, status, err = testSetLeader(s, \"foo\", \"xxx\", 3)\n\t\tassert.NoError(t, err)\n\t\tassert.Equal(t, status, 200)\n\t\tassert.Equal(t, body, \"2\")\n\n\t\ttime.Sleep(2 * time.Second)\n\n\t\t// Check that the leader is set.\n\t\tbody, status, err = testGetLeader(s, \"foo\")\n\t\tassert.NoError(t, err)\n\t\tassert.Equal(t, status, 200)\n\t\tassert.Equal(t, body, \"xxx\")\n\t})\n}", "title": "" }, { "docid": "d21315ffbd76909c26203ba5ef138957", "score": "0.550323", "text": "func (m *Master) onLeader() {\n\tlog.Infof(\"@@@ became leader\")\n\n\tgo m.checksumLoop()\n\n\t// Notify that the master is elected as the Raft leader.\n\t// Used for testing only.\n\tselect {\n\tcase m.leaderCh <- struct{}{}:\n\tdefault:\n\t}\n}", "title": "" }, { "docid": "37d862f22e94db75e708a57999688a21", "score": "0.5487232", "text": "func TestMasterServiceGiveupLeadership(t *testing.T) {\n\tt.Parallel()\n\tl, s, _, m := setupMaster(t)\n\ts.Start()\n\tl.Start()\n\tm.Start()\n\n\tcheckAllMasterServiceStarted(t, s)\n\n\tl.GiveupLeadership()\n\tcheckAllServiceStopped(t, s)\n\n\tl.ChangeLeadership()\n\tcheckAllServiceStopped(t, s)\n}", "title": "" }, { "docid": "643b79500fe4a27e4316ce677b2409af", "score": "0.54857016", "text": "func TestElection_2(t *testing.T) {\n\tfmt.Println(\"test 2\")\n\n\twg = new(sync.WaitGroup)\n\n\t_, killed_Leader, err := rpc_call()\n\tif err != nil {\n\t\tkill_all_server(cmd)\n\t\tpanic(\"test failed\")\n\t}\n\n\t//fmt.Println(\"Kill Leader\", killed_Leader)\n\n\twg.Add(1)\n\tgo KillServer(wg, cmd, int(killed_Leader-1), false)\n\twg.Wait()\n\tvar new_Leader uint64\n\tnew_Leader = unknown\n\t_, new_Leader = GetLeader()\n\tif new_Leader == killed_Leader {\n\t\tfmt.Println(new_Leader, \" \", killed_Leader)\n\t\tkill_all_server(cmd)\n\t\tpanic(\"no leader not elected\")\n\n\t}\n\n\tpath := GetPath() + \"/bin/main\"\n\tcmd[int(killed_Leader)-1] = exec.Command(path, \"-id\", strconv.Itoa(int(killed_Leader)))\n\tcmd[int(killed_Leader)-1].Start()\n\tselect {\n\tcase <-time.After(2 * time.Second):\n\n\t}\n\n\treturn\n\n}", "title": "" }, { "docid": "7c15867df1722f498981095e4e24d978", "score": "0.54769856", "text": "func StartTest(desc string) {\n\tif Debug != None {\n\t\tdesc = desc + \"\\n\"\n\t}\n\tColorPrintf(Underline, desc)\n}", "title": "" }, { "docid": "bb7774a5989aeb3d251083d7b73ff184", "score": "0.5466274", "text": "func (r *Raft) becomeLeader() {\n\t// Your Code Here (2A).\n\t// NOTE: Leader should propose a noop entry on its term\n\tr.State = StateLeader\n\tr.Lead = r.id\n\tr.cleanState()\n\tr.cleanProgress()\n\t_ = r.Step(pb.Message{\n\t\tMsgType: pb.MessageType_MsgPropose,\n\t\tTo: r.id,\n\t\tFrom: r.id,\n\t\tTerm: r.Term,\n\t\tEntries: []*pb.Entry{{}},\n\t})\n}", "title": "" }, { "docid": "8c7c7dd59fb37b51142a9c5ea4fceade", "score": "0.54534173", "text": "func (db *boltStore) StartTest(id string, testName string, startTime time.Time) (*TestInstance, error) {\n\ttest := &TestInstance{\n\t\tTestID: id,\n\t\tTestName: testName,\n\t\tStartAt: startTime.UTC(),\n\t}\n\n\t// keep in memory until its finished\n\tdb.ongoingMu.Lock()\n\tdb.ongoing[id] = *test\n\tdb.ongoingMu.Unlock()\n\n\t// TODO: Couldn't we store an in-progress version of said test in the\n\t// database? Hm.\n\treturn test, nil\n}", "title": "" }, { "docid": "6bd68bc2ac2bf695d9016b40d32085fb", "score": "0.5416854", "text": "func (c *cluster) EnsureLeader(t *testing.T, expect string) {\n\t// We assume c.Leader() has been called already; now check all the rafts\n\t// think the leader is correct\n\tfail := false\n\tfor _, r := range c.rafts {\n\t\tleader := r.Leader()\n\t\tif leader != expect {\n\t\t\tif leader == \"\" {\n\t\t\t\tleader = \"[none]\"\n\t\t\t}\n\t\t\tif expect == \"\" {\n\t\t\t\tc.logger.Printf(\"[ERR] Peer %s sees leader %v expected [none]\", r, leader)\n\t\t\t} else {\n\t\t\t\tc.logger.Printf(\"[ERR] Peer %s sees leader %v expected %v\", r, leader, expect)\n\t\t\t}\n\t\t\tfail = true\n\t\t}\n\t}\n\tif fail {\n\t\tc.FailNowf(\"[ERR] At least one peer has the wrong notion of leader\")\n\t}\n}", "title": "" }, { "docid": "5ac804f8be0ddf74c8213058642a0e67", "score": "0.54139906", "text": "func (c *Client) StartBgpFailoverTest(ctx context.Context, params *StartBgpFailoverTestInput, optFns ...func(*Options)) (*StartBgpFailoverTestOutput, error) {\n\tif params == nil {\n\t\tparams = &StartBgpFailoverTestInput{}\n\t}\n\n\tresult, metadata, err := c.invokeOperation(ctx, \"StartBgpFailoverTest\", params, optFns, addOperationStartBgpFailoverTestMiddlewares)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\tout := result.(*StartBgpFailoverTestOutput)\n\tout.ResultMetadata = metadata\n\treturn out, nil\n}", "title": "" }, { "docid": "0f09e2c643be3ba03fa2cbc8e90c218e", "score": "0.541293", "text": "func (_TokenMigratorTest *TokenMigratorTestTransactorSession) TestStart() (*types.Transaction, error) {\n\treturn _TokenMigratorTest.Contract.TestStart(&_TokenMigratorTest.TransactOpts)\n}", "title": "" }, { "docid": "3707e1416e20925996246f4693836cc1", "score": "0.53955835", "text": "func (rf *Raft) Start(command interface{}) (int, int, bool) {\n\n\t// Your code here (2B).\n\trf.mu.Lock()\n\tdefer rf.mu.Unlock()\n\tif rf.status != Leader {\n\t\treturn -1, -1, false\n\t}\n\tindex := rf.logs[len(rf.logs)-1].Index + 1\n\tterm := rf.currentTerm\n\tisLeader := true\n\t//parsed := rf.parseCommand(command)\n\t\n\tnewLogEntry := Entry{Index: rf.logs[len(rf.logs)-1].Index + 1, Op: command, Term: rf.currentTerm}\n\trf.logs = append(rf.logs, newLogEntry)\n\trf.persist()\n\trf.matchIndex[rf.me] = index\n\trf.nextIndex[rf.me] = index + 1\n\t\n\t\n\tDPrintf(\"%d as leader at term %d start agreement on index %d, command %v\", rf.me, term, index, command)\n\tgo rf.startAgreement(command)\n\n\n\treturn index, term, isLeader\n}", "title": "" }, { "docid": "4dd3b18d43923f95c3c2f56be16701a2", "score": "0.5389559", "text": "func (_TokenMigratorTest *TokenMigratorTestSession) TestStart() (*types.Transaction, error) {\n\treturn _TokenMigratorTest.Contract.TestStart(&_TokenMigratorTest.TransactOpts)\n}", "title": "" }, { "docid": "858c98f15880a0742bae3bb20370ceca", "score": "0.53808725", "text": "func LaunchStreamDeriveLeader(experimentsDetails *experimentTypes.ExperimentDetails, clients clients.ClientSets) error {\n\tvar err error\n\tLivenessTopicLeader, err := LivenessStream(experimentsDetails, clients)\n\tif err != nil {\n\t\treturn errors.Errorf(\"liveness stream failed, err: %v\", err)\n\t}\n\texperimentsDetails.TargetPod, err = SelectBroker(experimentsDetails, LivenessTopicLeader, clients)\n\tDisplayKafkaBroker(experimentsDetails)\n\n\treturn nil\n}", "title": "" }, { "docid": "f96652fc91894141b9018772aca71476", "score": "0.53219545", "text": "func (r *raftNode) setLeader(leader bool) {\n\tvar flag int64\n\tif leader {\n\t\tflag = 1\n\t}\n\tatomic.StoreInt64(&(r.leader), flag)\n}", "title": "" }, { "docid": "fc70b7cff6858981f898e6c86b9e669a", "score": "0.5253044", "text": "func (c *TestPeer) Start(local *data.Local) error {\n\tautoAction := actions.Config{\n\t\tLocal: local,\n\t}\n\n\tlocal.AutoAction[\"MSG_CHAT_MSG\"] = autoAction.ChatMsg\n\n\tlocal.User = strings.Replace(uuid.NewV4().String(), \"-\", \"\", -1)\n\tlocal.Pass = strings.Replace(uuid.NewV4().String(), \"-\", \"\", -1)\n\tlocal.Name = strings.Replace(uuid.NewV4().String(), \"-\", \"\", -1)\n\tlocal.Peers[local.WorkerID].User = local.User\n\n\tlocal.AuthBase = c.config.TargetAuth\n\tlocal.WSconf = c.WSconfig\n\tlocal.Log = c.Log\n\tlocal.Prometheus = c.Prometheus\n\n\treturn nil\n}", "title": "" }, { "docid": "70ad9c6bc8a91b4393d6d878164b005b", "score": "0.5243538", "text": "func (cl *Cluster) switchLeader(num int) {\n\tlogger.Debugf(\"switch.leader[from %v to %v]\",\n\t\tcl.Leader, cl.Machines[num])\n\n\tcl.Leader = cl.Machines[num]\n}", "title": "" }, { "docid": "e75d423a0b86379664794a4ae7c2695e", "score": "0.5243363", "text": "func TestStart(t *testing.T) {\n\tTestingT(t)\n}", "title": "" }, { "docid": "15a93a6b708dadb76baa1cc24107c80f", "score": "0.5238642", "text": "func (rf *Raft) becomeLeader() {\n\tRPrintf(rf, \"elected as a leader\")\n\trf.State = Leader\n\trf.VoteCount = 0\n\n\trf.NextIndex = make([]int, len(rf.peers))\n\trf.MatchIndex = make([]int, len(rf.peers))\n\n\tfor peerIndex := range rf.peers {\n\t\trf.NextIndex[peerIndex] = len(rf.Log) + 1\n\t\trf.MatchIndex[peerIndex] = 0\n\t}\n}", "title": "" }, { "docid": "417f37f11899915e77a41c44e90171af", "score": "0.5175936", "text": "func (s *Status) Leader(args struct{}, reply *string) error {\n\tleader := s.server.raft.Leader()\n\tif leader != \"\" {\n\t\t*reply = leader\n\t} else {\n\t\t*reply = \"\"\n\t}\n\treturn nil\n}", "title": "" }, { "docid": "79d8c186d720c401ba1ffafe062dd29c", "score": "0.5162303", "text": "func (rf *Raft) Start(command interface{}) (int, int, bool) {\n\tDPrintf(\"Start:: command comming in: %s.\\n\", command)\n\tindex := -1\n\tterm := -1\n\tisLeader := true\n\n\t// Your code here (3B).\n\t// if this server isn't the leader, return false\n\trf.mu.Lock()\n\tif rf.Status == Leader {\n\t\tindex = rf.promiseIndex\n\t\trf.promiseIndex++\n\t\tterm = rf.currentTerm\n\n\t\tlength := len(rf.logs)\n\t\t// leader appends the command to its log as a new entry\n\t\tentry := &Entry{}\n\t\tentry.Term = rf.currentTerm\n\t\tentry.Index = length + 1\n\t\tentry.Command = command\n\t\trf.logs = append(rf.logs, entry)\n\n\t\tDPrintf(\"Start:: command %s, index %d, term %d.\\n\", command, index, term)\n\t\tNPrintf(\"Start:: command: %s, index: %d, term: %d.\\n\", command, index, term)\n\t\trf.mu.Unlock()\n\t\tgo rf.makeConsensus()\n\t} else {\n\t\tisLeader = false\n\t\trf.mu.Unlock()\n\t}\n\n\treturn index, term, isLeader\n}", "title": "" }, { "docid": "040faabc00d3df747fa85b3339c1b898", "score": "0.51597416", "text": "func (rf *Raft) Start(command int) (int, int, bool) {\n\n if rf.nodeType == \"Leader\" {\n entry := rf.AppendCommand(command)\n rf.Schedule(3)\n return entry.Index, rf.currentTerm, true\n } else {\n return -1, rf.currentTerm, false\n }\n}", "title": "" }, { "docid": "84fb64a1cf53b485b63eb9f8c658d551", "score": "0.5151338", "text": "func startRaft(tlsConfig TLSConfig) {\n\tvar err error\n\n\traftName := info.Name\n\n\t// Create transporter for raft\n\traftTransporter = newTransporter(tlsConfig.Scheme, tlsConfig.Client)\n\n\t// Create raft server\n\traftServer, err = raft.NewServer(raftName, dirPath, raftTransporter, etcdStore, nil)\n\n\tif err != nil {\n\t\tfatal(err)\n\t}\n\n\t// LoadSnapshot\n\tif snapshot {\n\t\terr = raftServer.LoadSnapshot()\n\n\t\tif err == nil {\n\t\t\tdebugf(\"%s finished load snapshot\", raftServer.Name())\n\t\t} else {\n\t\t\tdebug(err)\n\t\t}\n\t}\n\n\traftServer.SetElectionTimeout(ElectionTimeout)\n\traftServer.SetHeartbeatTimeout(HeartbeatTimeout)\n\n\traftServer.Start()\n\n\tif raftServer.IsLogEmpty() {\n\n\t\t// start as a leader in a new cluster\n\t\tif len(cluster) == 0 {\n\n\t\t\ttime.Sleep(time.Millisecond * 20)\n\n\t\t\t// leader need to join self as a peer\n\t\t\tfor {\n\t\t\t\tcommand := &JoinCommand{\n\t\t\t\t\tName: raftServer.Name(),\n\t\t\t\t\tRaftURL: argInfo.RaftURL,\n\t\t\t\t\tEtcdURL: argInfo.EtcdURL,\n\t\t\t\t}\n\t\t\t\t_, err := raftServer.Do(command)\n\t\t\t\tif err == nil {\n\t\t\t\t\tbreak\n\t\t\t\t}\n\t\t\t}\n\t\t\tdebugf(\"%s start as a leader\", raftServer.Name())\n\n\t\t\t// start as a follower in a existing cluster\n\t\t} else {\n\n\t\t\ttime.Sleep(time.Millisecond * 20)\n\n\t\t\tfor i := 0; i < retryTimes; i++ {\n\n\t\t\t\tsuccess := false\n\t\t\t\tfor _, machine := range cluster {\n\t\t\t\t\tif len(machine) == 0 {\n\t\t\t\t\t\tcontinue\n\t\t\t\t\t}\n\t\t\t\t\terr = joinCluster(raftServer, machine, tlsConfig.Scheme)\n\t\t\t\t\tif err != nil {\n\t\t\t\t\t\tif err.Error() == errors[103] {\n\t\t\t\t\t\t\tfmt.Println(err)\n\t\t\t\t\t\t\tos.Exit(1)\n\t\t\t\t\t\t}\n\t\t\t\t\t\tdebugf(\"cannot join to cluster via machine %s %s\", machine, err)\n\t\t\t\t\t} else {\n\t\t\t\t\t\tsuccess = true\n\t\t\t\t\t\tbreak\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\tif success {\n\t\t\t\t\tbreak\n\t\t\t\t}\n\n\t\t\t\twarnf(\"cannot join to cluster via given machines, retry in %d seconds\", RetryInterval)\n\t\t\t\ttime.Sleep(time.Second * RetryInterval)\n\t\t\t}\n\t\t\tif err != nil {\n\t\t\t\tfatalf(\"Cannot join the cluster via given machines after %x retries\", retryTimes)\n\t\t\t}\n\t\t\tdebugf(\"%s success join to the cluster\", raftServer.Name())\n\t\t}\n\n\t} else {\n\t\t// rejoin the previous cluster\n\t\tdebugf(\"%s restart as a follower\", raftServer.Name())\n\t}\n\n\t// open the snapshot\n\tif snapshot {\n\t\tgo monitorSnapshot()\n\t}\n\n\t// start to response to raft requests\n\tgo startRaftTransport(*info, tlsConfig.Scheme, tlsConfig.Server)\n\n}", "title": "" }, { "docid": "b95c06ace496523345ca92ed087a97a1", "score": "0.51344967", "text": "func startCluster(c *cluster) {\n\t// Create member key\n\treliably(c.ctx, c.logger, \"member key\", func() error {\n\t\treturn createMemberKey(c)\n\t})\n\n\telec := concurrency.NewElection(c.sess, path.Join(c.clusterPrefix, \"election\"))\n\n\tcampaignCh := make(chan struct{}, 1)\n\tgo leadForever(c, elec, campaignCh)\n\tgo observeForever(c, elec, campaignCh)\n}", "title": "" }, { "docid": "c40f34c8ea3fe0bb7e480771b23a1610", "score": "0.51291347", "text": "func Leader(ctx *macaron.Context) {\n\tvar (\n\t\tres, _ = ctx.Data[middleware.ResKey].(map[string]interface{})\n\t\tleader string\n\t\terr error\n\t)\n\tif leader, err = clientrpc.Leader(); err != nil {\n\t\tlog.Error(\"err\", err)\n\t\tres[\"ret\"] = errcode.ErrCodeInternal\n\t\treturn\n\t}\n\n\tres[\"data\"] = leader\n}", "title": "" }, { "docid": "f77ab5c1233699b646ed79588490e6af", "score": "0.5111398", "text": "func WatchLeaderElection(cc *api.Client, serviceKey string, chStop chan struct{}, leaderServiceStart func(), leaderServiceStop func()) {\n\tlog.Debugf(\"WatchLeaderElection for service:%q\", serviceKey)\n\tvar (\n\t\twaitIndex uint64\n\t\tlastIndex uint64\n\t\tisAny bool\n\t\tleader string\n\t)\n\tagentName, err := GetAgentName(cc)\n\tif err != nil {\n\t\thandleError(err, serviceKey)\n\t\treturn\n\t}\n\n\tfor {\n\t\tselect {\n\t\tcase <-chStop:\n\t\t\tlog.Printf(\"Stop watching leader election for service:%q\", serviceKey)\n\t\t\treturn\n\t\tdefault:\n\t\t}\n\n\t\tisAny, leader, lastIndex, err = IsAnyLeader(cc, serviceKey, waitIndex)\n\t\tlog.Debugf(\"Wait Index is %d for watching leader election for service:%q\", lastIndex, serviceKey)\n\t\tif err != nil {\n\t\t\thandleError(err, serviceKey)\n\t\t\tcontinue\n\t\t}\n\t\tif waitIndex == lastIndex {\n\t\t\tcontinue\n\t\t}\n\t\twaitIndex = lastIndex\n\t\tif !isAny {\n\t\t\t// No leader has been elected : try to acquire leadership on service\n\t\t\tsession, err := GetSession(cc, serviceKey, agentName)\n\t\t\tif err != nil {\n\t\t\t\thandleError(err, serviceKey)\n\t\t\t\tcontinue\n\t\t\t}\n\t\t\tkvPair := &api.KVPair{\n\t\t\t\tKey: serviceKey,\n\t\t\t\tValue: []byte(agentName),\n\t\t\t\tSession: session,\n\t\t\t}\n\n\t\t\t// Try to acquire the service leadership\n\t\t\tacquired, _, err := cc.KV().Acquire(kvPair, nil)\n\t\t\tif err != nil {\n\t\t\t\thandleError(err, serviceKey)\n\t\t\t\tcontinue\n\t\t\t}\n\t\t\tif acquired {\n\t\t\t\tlog.Printf(\"I am now leader for service:%q as %q\", serviceKey, agentName)\n\t\t\t\t// Proceed to leader concern execution if needed\n\t\t\t\tif leaderServiceStart != nil {\n\t\t\t\t\tleaderServiceStart()\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\tlog.Printf(\"Failed to acquire service leadership. Another node did it for service:%q\", serviceKey)\n\t\t\t}\n\t\t} else {\n\t\t\tif leader == agentName {\n\t\t\t\tlog.Printf(\"I am still the leader for service:%q as %q\", serviceKey, agentName)\n\t\t\t\t// Proceed to leader concern execution if needed\n\t\t\t\tif leaderServiceStart != nil {\n\t\t\t\t\tleaderServiceStart()\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\tlog.Debugf(\"leader is %q\", leader)\n\t\t\t\tif leaderServiceStop != nil {\n\t\t\t\t\tleaderServiceStop()\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n}", "title": "" }, { "docid": "c9131eeaddcd08e880bb6093ce439e6b", "score": "0.50875115", "text": "func (hv *Hyperviser) PrepareTest(args *TestArgs, reply *struct{}) error {\n\tDPrintf(\"hv (%s): PrepareTest %s called from %s\", hv.ap.String(),\n\t\targs.TType, args.AA.AP.String())\n\thv.mu.Lock()\n\tdefer hv.mu.Unlock()\n\tif err := hv.validate(args.AA); err != nil {\n\t\treturn err\n\t}\n\tif hv.ti.isTesting {\n\t\treturn fmt.Errorf(\"Already running test %v\", hv.ti.testType)\n\t}\n\tif args.NumChords <= 0 {\n\t\treturn fmt.Errorf(\"Invalid number of Chords (%d)\", args.NumChords)\n\t}\n\tif _, ok := tests[args.TType]; !ok {\n\t\treturn fmt.Errorf(\"Invalid test type: %s\", args.TType)\n\t}\n\n\thv.ti.isTesting = true\n\thv.ti.isLeader = false\n\thv.ti.tSize = args.NumChords\n\thv.ti.leader = args.AA.AP\n\thv.ti.testType = args.TType\n\thv.ti.baseCh = args.BaseChordNode\n\thv.ti.killChan = make(chan bool)\n\n\t// TODO: file name validation\n\tf, err := os.Create(hv.logDir + args.LogName)\n\tif err != nil {\n\t\thv.ti.clear()\n\t\treturn fmt.Errorf(\"Open log failed: %s\", err)\n\t}\n\thv.ti.lgBuf = f\n\thv.ti.lg = log.New(f, hv.ap.String()+\" \", log.LstdFlags|log.LUTC)\n\thv.ti.tNum++\n\n\t// Add random delay before start to avoid overloading leader\n\tr := rand.Intn(1500)\n\ttime.Sleep(time.Millisecond * time.Duration(r))\n\n\t// Prepare the test.\n\tgo hv.initTest(args.NumChords)\n\n\treturn nil\n}", "title": "" }, { "docid": "07ef529d5ffc223c2a98a2e7c98229f4", "score": "0.508618", "text": "func (oc *Controller) Start(nodeName string, wg *sync.WaitGroup, ctx context.Context) error {\n\t// Set up leader election process first\n\trl, err := resourcelock.New(\n\t\tresourcelock.ConfigMapsResourceLock,\n\t\tconfig.Kubernetes.OVNConfigNamespace,\n\t\t\"ovn-kubernetes-master\",\n\t\toc.client.CoreV1(),\n\t\tnil,\n\t\tresourcelock.ResourceLockConfig{\n\t\t\tIdentity: nodeName,\n\t\t\tEventRecorder: oc.recorder,\n\t\t},\n\t)\n\tif err != nil {\n\t\treturn err\n\t}\n\n\tlec := leaderelection.LeaderElectionConfig{\n\t\tLock: rl,\n\t\tLeaseDuration: time.Duration(config.MasterHA.ElectionLeaseDuration) * time.Second,\n\t\tRenewDeadline: time.Duration(config.MasterHA.ElectionRenewDeadline) * time.Second,\n\t\tRetryPeriod: time.Duration(config.MasterHA.ElectionRetryPeriod) * time.Second,\n\t\tReleaseOnCancel: true,\n\t\tCallbacks: leaderelection.LeaderCallbacks{\n\t\t\tOnStartedLeading: func(ctx context.Context) {\n\t\t\t\tklog.Infof(\"Won leader election; in active mode\")\n\t\t\t\t// run the cluster controller to init the master\n\t\t\t\tstart := time.Now()\n\t\t\t\tdefer func() {\n\t\t\t\t\tend := time.Since(start)\n\t\t\t\t\tmetrics.MetricMasterReadyDuration.Set(end.Seconds())\n\t\t\t\t}()\n\t\t\t\t// run only on the active master node.\n\t\t\t\tmetrics.StartMasterMetricUpdater(oc.stopChan, oc.nbClient)\n\t\t\t\tif err := oc.StartClusterMaster(nodeName); err != nil {\n\t\t\t\t\tpanic(err.Error())\n\t\t\t\t}\n\t\t\t\tif err := oc.Run(wg, nodeName); err != nil {\n\t\t\t\t\tpanic(err.Error())\n\t\t\t\t}\n\t\t\t},\n\t\t\tOnStoppedLeading: func() {\n\t\t\t\t//This node was leader and it lost the election.\n\t\t\t\t// Whenever the node transitions from leader to follower,\n\t\t\t\t// we need to handle the transition properly like clearing\n\t\t\t\t// the cache. It is better to exit for now.\n\t\t\t\t// kube will restart and this will become a follower.\n\t\t\t\tklog.Infof(\"No longer leader; exiting\")\n\t\t\t\tos.Exit(1)\n\t\t\t},\n\t\t\tOnNewLeader: func(newLeaderName string) {\n\t\t\t\tif newLeaderName != nodeName {\n\t\t\t\t\tklog.Infof(\"Lost the election to %s; in standby mode\", newLeaderName)\n\t\t\t\t}\n\t\t\t},\n\t\t},\n\t}\n\n\tleaderelection.SetProvider(ovnkubeMasterLeaderMetricsProvider{})\n\tleaderElector, err := leaderelection.NewLeaderElector(lec)\n\tif err != nil {\n\t\treturn err\n\t}\n\n\twg.Add(1)\n\tgo func() {\n\t\tleaderElector.Run(ctx)\n\t\tklog.Infof(\"Stopped leader election\")\n\t\twg.Done()\n\t}()\n\n\treturn nil\n}", "title": "" }, { "docid": "2e20b9cba6a25b53560677ff605bc49a", "score": "0.5068677", "text": "func (p *partition) becomeLeader(epoch uint64) error {\n\tif err := p.stopLeadingOrFollowing(); err != nil {\n\t\treturn err\n\t}\n\n\tif !p.recovered {\n\t\t// Update leader epoch on log if this isn't a recovered partition. A\n\t\t// recovered partition indicates we were the previous leader and are\n\t\t// continuing a leader epoch.\n\t\tif err := p.log.NewLeaderEpoch(epoch); err != nil {\n\t\t\treturn errors.Wrap(err, \"failed to update leader epoch on log\")\n\t\t}\n\t}\n\n\t// Update this replica's latest offset to ensure it's up to date.\n\trep := p.isr[p.srv.config.Clustering.ServerID]\n\trep.updateLatestOffset(p.log.NewestOffset())\n\n\t// Start message processing loop.\n\trecvChan := make(chan *nats.Msg, recvChannelSize)\n\tp.stopLeader = make(chan struct{})\n\tp.srv.startGoroutineWithArgsWG(func(args ...interface{}) {\n\t\tstop := args[0].(chan struct{})\n\t\tp.messageProcessingLoop(recvChan, stop, epoch)\n\t}, p.shutdown, p.stopLeader)\n\n\t// Start replicating to followers.\n\tp.startReplicating(epoch, p.stopLeader)\n\n\t// Subscribe to the NATS subject and begin sequencing messages.\n\t// TODO: This should be drained on shutdown.\n\tsub, err := p.srv.nc.QueueSubscribe(p.getSubject(), p.Group, func(m *nats.Msg) {\n\t\trecvChan <- m\n\t})\n\tif err != nil {\n\t\treturn errors.Wrap(err, \"failed to subscribe to NATS\")\n\t}\n\tsub.SetPendingLimits(-1, -1)\n\tp.sub = sub\n\tp.srv.nc.Flush()\n\n\t// Subscribe to the partition replication subject.\n\tsub, err = p.srv.ncRepl.Subscribe(p.getReplicationRequestInbox(), p.handleReplicationRequest)\n\tif err != nil {\n\t\treturn errors.Wrap(err, \"failed to subscribe to replication inbox\")\n\t}\n\tsub.SetPendingLimits(-1, -1)\n\tp.leaderReplSub = sub\n\n\t// Also subscribe to leader epoch offset requests subject.\n\tsub, err = p.srv.ncRepl.Subscribe(p.getLeaderOffsetRequestInbox(), p.handleLeaderOffsetRequest)\n\tif err != nil {\n\t\treturn errors.Wrap(err, \"failed to subscribe to replication inbox\")\n\t}\n\tsub.SetPendingLimits(-1, -1)\n\tp.leaderOffsetSub = sub\n\tp.srv.ncRepl.Flush()\n\n\t// Start auto-pause timer if enabled.\n\tif p.autoPauseTime > 0 {\n\t\tp.srv.startGoroutine(func() {\n\t\t\tp.autoPauseLoop(p.stopLeader)\n\t\t})\n\t}\n\n\tp.isLeading = true\n\tp.isFollowing = false\n\n\t// Notify the cursor manager if we've become leader for a cursor partition.\n\tif p.Stream == cursorsStream {\n\t\tp.srv.cursors.BecomePartitionLeader()\n\t}\n\n\treturn nil\n}", "title": "" }, { "docid": "5349d1d22a18ab9090ad149a116b1d32", "score": "0.50657296", "text": "func (c *Client) Start() error {\n\tif c.DataDir == \"\" {\n\t\treturn errors.New(\"no data dir specified\")\n\t}\n\n\tc._isLeader = false\n\tc._isLeaderSync = new(sync.RWMutex)\n\tc.quitElection = make(chan bool)\n\tc.quitKeepAlive = make(chan bool)\n\tc.Logger.Info(\"starting gosensus...\")\n\n\t// check if a node key exists and generate one if not\n\tkeyExists, err := nodeKeyExists(c.DataDir)\n\tif err != nil {\n\t\treturn err\n\t}\n\n\tif !keyExists {\n\t\tc.Logger.Info(\"no node key found. Generating a new one...\")\n\t\tif err := generateNodeKey(c.DataDir); err != nil {\n\t\t\treturn err\n\t\t}\n\t\tc.Logger.Info(\"successfully generated a new node key\")\n\t}\n\n\tif err := registerNode(c); err != nil {\n\t\treturn err\n\t}\n\tgo c.leaderElectionLoop()\n\treturn nil\n}", "title": "" }, { "docid": "98c9fcd89089668089e4e947927d896f", "score": "0.5055094", "text": "func Test_Parition_1(t *testing.T) {\n\tclear()\n\ttime.Sleep(500 * time.Millisecond)\n\tconfig := util.CreateConfig()\n\tserverlist := config.ServerList\n\tIdList := generateRandomList(serverlist.ServerNum)\n\t// majority partition\n\tparams := generatePartitionParams(serverlist.ServerNum, IdList, serverlist.ServerNum / 2 + 1)\n\tfor _, server := range config.ServerList.Servers {\n\t\tvar address string = server.Addr\n\t\t// connect to the server\n\t\tconn, err := grpc.Dial(address, grpc.WithInsecure())\n\t\tif err != nil {\n\t\t\tlog.Fatalf(\"did not connect: %v\", err)\n\t\t}\n\t\tdefer conn.Close()\n\t\tclient := pb_monkey.NewChaosMonkeyClient(conn)\n\t\t// Contact the server and print out its response.\n\t\tctx, cancel := context.WithTimeout(context.Background(), time.Minute)\n\t\tdefer cancel()\n\t\t// generating random params for\n\t\tclient.Partition(ctx, &pb_monkey.PartitionInfo{Server: params.servers})\n\t}\n\n\ttime.Sleep(500 * time.Millisecond)\n\n\n\tleaderCount := checkLeader(params)\n\n\tif leaderCount == 1 {\n\t\tt.Log(\"Passed the majority test.\")\n\t} else {\n\t\tt.Error(\"Failed the majority test.\")\n\t}\n\t//clear()\n}", "title": "" }, { "docid": "5de2d1dc951296e2811461f72ff2dca9", "score": "0.50539327", "text": "func (s *svcAcmeClient) IsLeader() bool { return true }", "title": "" }, { "docid": "9d7c715ceb08382fe064e27164d42caa", "score": "0.5052219", "text": "func (m *Participant) setLeader(member *tsopb.Participant) {\n\tm.leader.Store(member)\n\tm.lastLeaderUpdatedTime.Store(time.Now())\n}", "title": "" }, { "docid": "ae7d9595f124a456798341553fa28f93", "score": "0.50459987", "text": "func (s *FourNodeTestSuite) SetUpTest(c *C) {\n\ts.isBlameTest = false\n\tcommon.InitLog(\"info\", true, \"four_nodes_test\")\n\tconversion.SetupBech32Prefix()\n\ts.ports = []int{\n\t\t16666, 16667, 16668, 16669,\n\t}\n\ts.bootstrapPeer = \"/ip4/127.0.0.1/tcp/16666/p2p/16Uiu2HAmACG5DtqmQsHtXg4G2sLS65ttv84e7MrL4kapkjfmhxAp\"\n\ts.preParams = getPreparams(c)\n\ts.servers = make([]*TssServer, partyNum)\n\tconf := common.TssConfig{\n\t\tKeyGenTimeout: 60 * time.Second,\n\t\tKeySignTimeout: 60 * time.Second,\n\t\tPreParamTimeout: 5 * time.Second,\n\t}\n\n\tvar wg sync.WaitGroup\n\tfor i := 0; i < partyNum; i++ {\n\t\twg.Add(1)\n\t\tgo func(idx int) {\n\t\t\tdefer wg.Done()\n\t\t\tif idx == 0 {\n\t\t\t\ts.servers[idx] = s.getTssServer(c, idx, conf, \"\")\n\t\t\t} else {\n\t\t\t\ts.servers[idx] = s.getTssServer(c, idx, conf, s.bootstrapPeer)\n\t\t\t}\n\t\t}(i)\n\n\t\ttime.Sleep(time.Second)\n\t}\n\twg.Wait()\n\tfor i := 0; i < partyNum; i++ {\n\t\tc.Assert(s.servers[i].Start(), IsNil)\n\t}\n}", "title": "" }, { "docid": "8151f97bf641e5f4d199c119e42100ae", "score": "0.5029316", "text": "func startTestManager(t *testing.T, mgr manager.Manager) func() {\n\tstop := make(chan struct{})\n\twg := &sync.WaitGroup{}\n\twg.Add(1)\n\n\tgo func() {\n\t\tdefer wg.Done()\n\t\tassert.NoError(t, mgr.Start(stop))\n\t}()\n\n\t// Return stop func intended to be deferred.\n\treturn func() {\n\t\tclose(stop)\n\t\twg.Wait()\n\t}\n}", "title": "" }, { "docid": "7a14bc7f0f79ffbf32414ffca0236fbc", "score": "0.50175166", "text": "func (e Player) startRound(s int, len int, resultStr *r.ResultStrings) {\n\t//check if i'am the leader of the new round\n\tif e.GetNumber() != (s % len) {\n\t\ti := (s % len)\n\t\t//get the id of the new leader\n\t\telement := e.allChan[i]\n\t\t//send \"START\" message to the new leader\n\t\te.sendMessage(element, \"START\")\n\t\t// Add message to the result object\n\t\tresultStr.AddMessage(fmt.Sprintf(\"%s,%s,%s\", strconv.Itoa(e.GetNumber()), strconv.Itoa(element.GetID()), StartMsg))\n\t}\n\n}", "title": "" }, { "docid": "4176515fc16bf6b7ec2413a487ff473e", "score": "0.50173825", "text": "func (a *activityManager) BecomeLeader() error {\n\tif !a.config.ActivityStream.Enabled {\n\t\treturn nil\n\t}\n\tif err := a.createActivityStream(); err != nil {\n\t\treturn err\n\t}\n\ta.leadershipLostCh = make(chan struct{})\n\ta.startGoroutine(a.dispatch)\n\treturn nil\n}", "title": "" }, { "docid": "4176515fc16bf6b7ec2413a487ff473e", "score": "0.50160617", "text": "func (a *activityManager) BecomeLeader() error {\n\tif !a.config.ActivityStream.Enabled {\n\t\treturn nil\n\t}\n\tif err := a.createActivityStream(); err != nil {\n\t\treturn err\n\t}\n\ta.leadershipLostCh = make(chan struct{})\n\ta.startGoroutine(a.dispatch)\n\treturn nil\n}", "title": "" }, { "docid": "9ad4c58bff8e9e313039587529f88c25", "score": "0.5013858", "text": "func (r *Runner) Start() {\n\n\t// Setup our LeaderCandidate object for leader elections and session renewal.\n\tleaderKey := r.config.ConsulKeyRoot + \"/\" + \"leader\"\n\tr.candidate = newLeaderCandidate(r.config.ConsulClient, leaderKey,\n\t\tleaderLockTimeout)\n\tgo r.leaderTicker()\n\n\tjobScalingPolicy := newJobScalingPolicy()\n\n\tif !r.config.ClusterScalingDisable || !r.config.JobScalingDisable {\n\t\t// Setup our JobScalingPolicy Watcher and start running this.\n\t\tgo r.config.NomadClient.JobWatcher(jobScalingPolicy)\n\t}\n\n\tif !r.config.ClusterScalingDisable {\n\t\t// Setup the node registry and initiate worker pool and node discovery.\n\t\tnodeRegistry := structs.NewNodeRegistry()\n\t\tgo r.config.NomadClient.NodeWatcher(nodeRegistry)\n\n\t\t// Launch our cluster scaling main ticker function\n\t\tgo r.clusterScalingTicker(nodeRegistry, jobScalingPolicy)\n\t}\n\n\t// Launch our job scaling main ticker function\n\tif !r.config.JobScalingDisable {\n\t\tgo r.jobScalingTicker(jobScalingPolicy)\n\t}\n}", "title": "" }, { "docid": "c5b167928782ad40da4a71f60fb02f1c", "score": "0.50068796", "text": "func (n *Node) IsLeader() bool {\n\tif n.Node.Status().Lead == n.ID {\n\t\treturn true\n\t}\n\treturn false\n}", "title": "" }, { "docid": "03ab014767773c1f60bd2faab2c24efd", "score": "0.5004388", "text": "func (rf *Raft) Start(command interface{}) (int, int, bool) {\n\n\tindex := -1\n\tterm := -1\n\tisLeader := true\n\n\t// Your code here (2B).\n\trf.mu.Lock()\n\tterm = rf.currentTerm\n\tstate := rf.state\n\trf.mu.Unlock()\n\tif state != Leader {\n\t\treturn -1, term, !isLeader\n\t}\n\n\trf.mu.Lock()\n\tif len(rf.log) > 0 {\n\t\tindex = len(rf.log)\n\t} else {\n\t\tindex = 0\n\t}\n\n\tentry := LogEntry{Term:rf.currentTerm, Index:index, Command:command}\n\tLogger.Printf(\"leader %d in term %d start append log entry %s\", rf.me, rf.currentTerm, entry)\n\trf.log = append(rf.log, entry)\n\trf.mu.Unlock()\n\n\treturn index+1, term, isLeader //index start from 1\n}", "title": "" }, { "docid": "e542a47637800461aebc1fdeaf21f032", "score": "0.50024873", "text": "func (rf *Raft) Start(command interface{}) (int, int, bool, int) {\n\tindex := -1\n\tterm := -1\n\tisLeader := true\n\tlastLeader := -1\n\n\t// Your code here (2B).\n\n\trf.mu.Lock()\n\tisLeader = rf.state == leader\n\tlastLeader = rf.leaderId\n\n\tif isLeader {\n\t\tif len(rf.log) > 0 {\n\t\t\tindex = rf.log[len(rf.log)-1].Index + 1\n\t\t} else {\n\t\t\tindex, _ = readSnapshot(rf.persister.ReadSnapshot())\n\t\t\tindex++\n\t\t}\n\t\tterm = rf.currentTerm\n\t\trf.log = append(rf.log, LogEntry{index, term, command})\n\t\trf.matchIndex[rf.me] = rf.log[len(rf.log)-1].Index\n\t\trf.persist()\n\t\tDPrintf(-1, \"Leader %v Start a command %v, term is %v, index is %v\\n\", rf.me, command, term, index)\n\t}\n\n\trf.mu.Unlock()\n\n\treturn index, term, isLeader, lastLeader\n}", "title": "" }, { "docid": "cfe1f6b3f3bf314d29590b55536b28ea", "score": "0.49979514", "text": "func StartNewTestProvider(t *testing.T, provider stream_provider.StreamProvider, streamName string) {\n\tlabels := map[string]string{\n\t\torc8r.StreamProviderLabel: \"true\",\n\t}\n\tannotations := map[string]string{\n\t\torc8r.StreamProviderStreamsAnnotation: streamName,\n\t}\n\tsrv, lis, plis := test_utils.NewTestOrchestratorService(t, orc8r.ModuleName, streamName, labels, annotations)\n\tservicer := &providerServicer{provider: provider}\n\tstreamer_protos.RegisterStreamProviderServer(srv.ProtectedGrpcServer, servicer)\n\tgo srv.RunTest(lis, plis)\n}", "title": "" }, { "docid": "6148e3100454bae4aa8b6730ae954176", "score": "0.49872985", "text": "func (rf *Raft) Start(command interface{}) (int, int, bool) {\n\tindex := -1\n\tterm := -1\n\tisLeader := true\n\n\t// Your code here (2B).\n\n\trf.mu.Lock()\n\tdefer rf.mu.Unlock()\n\n\tisLeader = rf.role == Leader\n\tterm = rf.currentTerm\n\n\tif isLeader {\n\n\t\tindex = len(rf.log)\n\t\trf.log = append(rf.log, Entries{rf.currentTerm, command})\n\t\trf.persist()\n\t}\n\n\treturn index, term, isLeader\n}", "title": "" }, { "docid": "640c7997ff340f5112485ec6ab0fd41a", "score": "0.49861303", "text": "func RunTest(name string, clusterCfg cluster.Config, testCfg TestConfig) error {\n\t// 1 - Create the resource.\n\n\ttc := &TestCase{\n\t\tname: name,\n\t\tcapture: &captureLogger{listeners: make(map[chan logLine]bool)},\n\t\tclusterCfg: clusterCfg,\n\t\ttestCfg: testCfg,\n\t}\n\n\t// The controller runs each test process with its working directory set to\n\t// the directory it should use for RootDir.\n\twd, err := os.Getwd()\n\tif err != nil {\n\t\tlog.Fatalf(\"Failed to get current directory: %v\", err)\n\t}\n\ttc.clusterCfg.RootDir = wd\n\n\ttlog := cluster.NewTerminalLogger(tc.clusterCfg.LogConfig)\n\ttc.bc = cluster.NewCluster(\n\t\t&tc.clusterCfg,\n\t\t[]cluster.Logger{tlog, tc.capture},\n\t)\n\n\t// Direct our log output to the demuxer too.\n\tredirectStderr(tlog)\n\n\tlog.Infof(\"setting up the cluster...\")\n\ttc.bc.Setup()\n\tlog.Infof(\"starting the cluster...\")\n\tcapture := tc.captureLogs()\n\ttc.bc.Start()\n\tcluster := strings.Join(tc.bc.MasterAddrs(), \",\")\n\ttc.c = client.NewClient(client.Options{Cluster: cluster, DisableCache: testCfg.DisableCache})\n\ttc.noRetryC = client.NewClient(client.Options{Cluster: cluster, DisableCache: true, DisableRetry: true})\n\n\t// 2 - Wait the cluster is fully setup and functional.\n\n\t// Wait for the cluster to settle down.\n\tlog.Infof(\"waiting for the cluster to initialize...\")\n\t// Wait for some master to become leader,\n\twaitFor := []string{\"m.:@@@ became leader\"}\n\tvar i uint\n\tfor i = 0; i < tc.clusterCfg.CuratorGroups; i++ {\n\t\t// each curator group to get a partition,\n\t\twaitFor = append(waitFor, fmt.Sprintf(\"c%d:@@@ curator group .* initialized\", i))\n\t\t// each curator group to get a successful heartbeat from all tractservers,\n\t\twaitFor = append(waitFor, fmt.Sprintf(\"c%d:@@@ tsmon: %d hosts, %d healthy\",\n\t\t\ti, tc.clusterCfg.Tractservers, tc.clusterCfg.Tractservers))\n\t}\n\tfor i = 0; i < tc.clusterCfg.Tractservers; i++ {\n\t\t// and each tractserver to register with the master.\n\t\twaitFor = append(waitFor, \"m.:@@@ received registration request from tractserver\")\n\t}\n\tif capture.WaitFor(waitFor...) != nil {\n\t\tlog.Fatalf(\"cluster did not initialize\")\n\t}\n\n\t// 3 - Run the test.\n\n\ttt := reflect.TypeOf(tc)\n\tmethod, ok := tt.MethodByName(name)\n\tif !ok {\n\t\treturn fmt.Errorf(\"Failed to find test %q method\", name)\n\t}\n\n\t// We have to stop the blb cluster when test is done because the cluster has\n\t// spawned child processes to run masters, curators and tract servers and if\n\t// the process terminates normally without calling \"Stop\" these child processes\n\t// will not be terminated.\n\t//\n\t// If the process terminates by receiving some signals we don't have to call\n\t// \"Stop\" because the process and all these child processes belong to the\n\t// same process group thus they will receive the same signal and exit at\n\t// that time.\n\tdefer tc.bc.Stop()\n\tdefer tc.capture.Close()\n\n\tlog.Infof(\"[%s] started\", method.Name)\n\tvar v reflect.Value\n\tif v = method.Func.Call([]reflect.Value{reflect.ValueOf(tc)})[0]; v.IsNil() {\n\t\tlog.Infof(\"[%s] passed\", method.Name)\n\t\treturn nil\n\t}\n\terr = v.Interface().(error)\n\tlog.Errorf(\"[%s] failed: %s\", method.Name, err)\n\treturn err\n}", "title": "" }, { "docid": "62fa1a22465c87466dcd2766616b1173", "score": "0.49730703", "text": "func StartCluster(ctx context.Context, t *testing.T, cfg cluster.TestConfig) (c cluster.Cluster) {\n\tvar completed bool\n\tdefer func() {\n\t\tif !completed && c != nil {\n\t\t\tc.AssertAndStop(ctx, t)\n\t\t}\n\t}()\n\n\tparts := strings.Split(t.Name(), \"/\")\n\tif len(parts) < 2 {\n\t\tt.Fatal(\"must invoke RunDocker\")\n\t}\n\n\tvar runMode string\n\tfor _, part := range parts[1:] {\n\t\tpart = reStripTestEnumeration.ReplaceAllLiteralString(part, \"\")\n\t\tswitch part {\n\t\tcase dockerTest:\n\t\t\tif runMode != \"\" {\n\t\t\t\tt.Fatalf(\"test has more than one run mode: %s and %s\", runMode, part)\n\t\t\t}\n\t\t\trunMode = part\n\t\t}\n\t}\n\n\tswitch runMode {\n\tcase dockerTest:\n\t\tlogDir := *flagLogDir\n\t\tif logDir != \"\" {\n\t\t\tlogDir = filepath.Join(logDir, filepath.Clean(t.Name()))\n\t\t}\n\t\tl := cluster.CreateDocker(ctx, cfg, logDir, stopper)\n\t\tl.Start(ctx)\n\t\tc = l\n\n\tdefault:\n\t\tt.Fatalf(\"unable to run in mode %q, use RunDocker\", runMode)\n\t}\n\n\t// Don't wait for replication unless requested (usually it is).\n\tif !cfg.NoWait && cfg.InitMode != cluster.INIT_NONE {\n\t\twantedReplicas := 3\n\t\tif numNodes := c.NumNodes(); numNodes < wantedReplicas {\n\t\t\twantedReplicas = numNodes\n\t\t}\n\n\t\t// Looks silly, but we actually start zero-node clusters in the\n\t\t// reference tests.\n\t\tif wantedReplicas > 0 {\n\t\t\tlog.Infof(ctx, \"waiting for first range to have %d replicas\", wantedReplicas)\n\n\t\t\ttestutils.SucceedsSoon(t, func() error {\n\t\t\t\tselect {\n\t\t\t\tcase <-stopper.ShouldQuiesce():\n\t\t\t\t\tt.Fatal(\"interrupted\")\n\t\t\t\tcase <-time.After(time.Second):\n\t\t\t\t}\n\n\t\t\t\t// Always talk to node 0 because it's guaranteed to exist.\n\t\t\t\tdb, err := c.NewDB(ctx, 0)\n\t\t\t\tif err != nil {\n\t\t\t\t\tt.Fatal(err)\n\t\t\t\t}\n\t\t\t\trows, err := db.Query(`SELECT array_length(replicas, 1) FROM crdb_internal.ranges LIMIT 1`)\n\t\t\t\tif err != nil {\n\t\t\t\t\t// Versions <= 1.1 do not contain the crdb_internal table, which is what's used\n\t\t\t\t\t// to determine whether a cluster has up-replicated. This is relevant for the\n\t\t\t\t\t// version upgrade acceptance test. Just skip the replication check for this case.\n\t\t\t\t\tif testutils.IsError(err, \"(table|relation) \\\"crdb_internal.ranges\\\" does not exist\") {\n\t\t\t\t\t\treturn nil\n\t\t\t\t\t}\n\t\t\t\t\tt.Fatal(err)\n\t\t\t\t}\n\t\t\t\tdefer rows.Close()\n\t\t\t\tvar foundReplicas int\n\t\t\t\tif rows.Next() {\n\t\t\t\t\tif err = rows.Scan(&foundReplicas); err != nil {\n\t\t\t\t\t\tt.Fatalf(\"unable to scan for length of replicas array: %s\", err)\n\t\t\t\t\t}\n\t\t\t\t\tif log.V(1) {\n\t\t\t\t\t\tlog.Infof(ctx, \"found %d replicas\", foundReplicas)\n\t\t\t\t\t}\n\t\t\t\t} else {\n\t\t\t\t\treturn errors.Errorf(\"no ranges listed\")\n\t\t\t\t}\n\n\t\t\t\tif foundReplicas < wantedReplicas {\n\t\t\t\t\treturn errors.Errorf(\"expected %d replicas, only found %d\", wantedReplicas, foundReplicas)\n\t\t\t\t}\n\t\t\t\treturn nil\n\t\t\t})\n\t\t}\n\n\t\t// Ensure that all nodes are serving SQL by making sure a simple\n\t\t// read-only query succeeds.\n\t\tfor i := 0; i < c.NumNodes(); i++ {\n\t\t\ttestutils.SucceedsSoon(t, func() error {\n\t\t\t\tdb, err := c.NewDB(ctx, i)\n\t\t\t\tif err != nil {\n\t\t\t\t\treturn err\n\t\t\t\t}\n\t\t\t\tif _, err := db.Exec(\"SHOW DATABASES\"); err != nil {\n\t\t\t\t\treturn err\n\t\t\t\t}\n\t\t\t\treturn nil\n\t\t\t})\n\t\t}\n\t}\n\n\tcompleted = true\n\treturn c\n}", "title": "" }, { "docid": "d66cdaa0cb7dda3fd5d5ebfbfa9e6d0e", "score": "0.49710968", "text": "func (m *Participant) CheckLeader() (ElectionLeader, bool) {\n\tif err := m.PreCheckLeader(); err != nil {\n\t\tlog.Error(\"failed to pass pre-check, check the leader later\", errs.ZapError(errs.ErrEtcdLeaderNotFound))\n\t\ttime.Sleep(200 * time.Millisecond)\n\t\treturn nil, true\n\t}\n\n\tleader, revision, err := m.getPersistentLeader()\n\tif err != nil {\n\t\tlog.Error(\"getting the leader meets error\", errs.ZapError(err))\n\t\ttime.Sleep(200 * time.Millisecond)\n\t\treturn nil, true\n\t}\n\tif leader == nil {\n\t\t// no leader yet\n\t\treturn nil, false\n\t}\n\n\tif m.IsSameLeader(leader) {\n\t\t// oh, we are already the leader, which indicates we may meet something wrong\n\t\t// in previous CampaignLeader. We should delete the leadership and campaign again.\n\t\tlog.Warn(\"the leader has not changed, delete and campaign again\", zap.Stringer(\"old-leader\", leader))\n\t\t// Delete the leader itself and let others start a new election again.\n\t\tif err = m.leadership.DeleteLeaderKey(); err != nil {\n\t\t\tlog.Error(\"deleting the leader key meets error\", errs.ZapError(err))\n\t\t\ttime.Sleep(200 * time.Millisecond)\n\t\t\treturn nil, true\n\t\t}\n\t\t// Return nil and false to make sure the campaign will start immediately.\n\t\treturn nil, false\n\t}\n\n\treturn &EtcdLeader{\n\t\twrapper: m,\n\t\tpariticipant: leader,\n\t\trevision: revision,\n\t}, false\n}", "title": "" }, { "docid": "354c8c80be9a773edec0469dbb790feb", "score": "0.496399", "text": "func (hv *Hyperviser) prepareLeader() {\n\tDPrintf(\"hv (%s): prepareLeader\", hv.ap.String())\n\n\thv.ls.mu.Lock()\n\tinfo := (*hv.ls.servers)[hv.ap]\n\tfor i := 1; i < info.targetNumChs; i++ {\n\t\tif err := hv.addChord(hv.ti.baseCh, true); err != nil {\n\t\t\thv.ls.lg.Printf(\"prepareLeader: initChord failed: %s\", err)\n\t\t\treturn\n\t\t}\n\t}\n\n\thv.ti.tNum = info.targetNumChs\n\tinfo.numChs = info.targetNumChs\n\tinfo.status = readySt\n\thv.ls.mu.Unlock()\n\tCPrintf(Red, \"hv (%s): prepareLeader Done\", hv.ap.String())\n\thv.ls.readyWg.Done()\n}", "title": "" }, { "docid": "7677f0a100f67b40b414ee86b5307773", "score": "0.49553692", "text": "func (httpAPI *API) LeaderCheck(params martini.Params, r render.Render, req *http.Request) {\n\trespondStatus, err := strconv.Atoi(params[\"errorStatusCode\"])\n\tif err != nil || respondStatus < 0 {\n\t\trespondStatus = http.StatusNotFound\n\t}\n\n\tif logic.IsLeader() {\n\t\tr.JSON(http.StatusOK, \"OK\")\n\t} else {\n\t\tr.JSON(respondStatus, \"Not leader\")\n\t}\n}", "title": "" }, { "docid": "367fe2528d8d0af1d33b81dc01ce66e1", "score": "0.4952275", "text": "func (tn *TestNode) StartNode() error {\n\t// Create server\n\ts, err := server.New(\":0\", tn.UserAgent, tn.Password, tn.params)\n\tif err != nil {\n\t\treturn err\n\t}\n\ttn.Server = s\n\ttn.Client.Address = s.APIAddress()\n\treturn tn.WalletUnlockPost(tn.primarySeed)\n}", "title": "" }, { "docid": "e3cc21cffc1cfb3fcd714f58dd82823a", "score": "0.4943512", "text": "func (c Cluster) Leader() (*Node, error) {\n\tl, err := c[0].WaitForLeader()\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\treturn c.FindNodeByRaftAddr(l)\n}", "title": "" }, { "docid": "a9fc013f23abce33f05ad6437810a7c9", "score": "0.49386302", "text": "func (client *ZooKeeperClient) IsLeader(nodeGUID string) (bool, error) {\n\tparticipants, err := client.Children(client.config[ZooKeeperElectionRoot])\n\tif err != nil {\n\t\treturn false, err\n\t}\n\n\tseqNum, err := strconv.ParseInt(nodeGUID[len(nodeGUID)-10:], 10, 32)\n\tif err != nil {\n\t\tglog.Errorf(\"Failed to parse %s to int\", nodeGUID[len(nodeGUID)-10:])\n\t\treturn false, err\n\t}\n\n\tvar otherParticipants []int32\n\tfor _, participant := range participants {\n\t\tnum, err := strconv.ParseInt(participant[len(participant)-10:], 10, 32)\n\t\tif err != nil {\n\t\t\tglog.Errorf(\"Failed to parse %s to int\", participant[len(participant)-10:])\n\t\t\treturn false, err\n\t\t}\n\t\totherParticipants = append(otherParticipants, int32(num))\n\t}\n\n\t// FIXME overfollow and rejoin\n\tfor _, num := range otherParticipants {\n\t\tif num < int32(seqNum) {\n\t\t\treturn false, nil\n\t\t}\n\t}\n\treturn true, nil\n}", "title": "" }, { "docid": "b61ab955058c1c9b095a5de711519e27", "score": "0.49355623", "text": "func (n *neli) IsLeader() bool {\n\treturn n.isLeader.GetInt() == 1\n}", "title": "" }, { "docid": "ff64cbdb0843f6ef926c63570e6b90cc", "score": "0.49299383", "text": "func TestPresenceStart(t *testing.T) {\n\tPrintTestMessage(\"==========Presence tests start==========\")\n}", "title": "" }, { "docid": "d7b3d6dc9a14c7a8a208860afa32e5ec", "score": "0.49193197", "text": "func Start(ip string, join ...string) {\n\th, p := gonet.GetAddress(ip)\n\tlog.Printf(\"[CLUSTER] Starting on %v:%v\", h, p)\n\tif p == 0 {\n\t\tp = gonet.FindFreePort()\n\t}\n\tname := fmt.Sprintf(\"%v:%v\", h, p+1)\n\tc := getMemberlistConfig(h, p, name)\n\tl, err := memberlist.Create(c)\n\n\tif err != nil {\n\t\tpanic(\"[CLUSTER] Failed to create memberlist: \" + err.Error())\n\t}\n\tspawnPartitionActor()\n\tlist = l\n\tremoting.Start(name)\n\n\tif len(join) > 0 {\n\t\t// Join an existing cluster by specifying at least one known member.\n\t\t_, err = list.Join(join)\n\t\tif err != nil {\n\t\t\tpanic(\"[CLUSTER] Failed to join cluster: \" + err.Error())\n\t\t}\n\t\ttime.Sleep(500 * time.Millisecond)\n\t}\n}", "title": "" }, { "docid": "cbf0f8341dac255b6145c00d36952b1e", "score": "0.49141195", "text": "func (rf *Raft) Start(command interface{}) (int, int, bool) {\n\tindex := -1\n\tterm := -1\n\tisLeader := false\n\n\t// Your code here (2B).\n\t//2A\n\trf.mu.Lock()\n\tdefer rf.mu.Unlock()\n\n\trf.debug(\"Start command %v\", command)\n\n\tif rf.role == Leader {\n\t\trf.log = append(rf.log, Entry{Command: command, Term: rf.currentTerm, Index: rf.lastLogIndex() + 1})\n\t\tindex = rf.lastLogIndex()\n\t\tterm = rf.currentTerm\n\t\tisLeader = true\n\t\t//2C\n\t\trf.persist()\n\n\t\tfor server := range rf.peers {\n\t\t\tif server == rf.me {\n\t\t\t\tcontinue\n\t\t\t}\n\t\t\trf.sendAppendEntriesTo(server)\n\t\t}\n\t}\n\n\treturn index, term, isLeader\n}", "title": "" }, { "docid": "2fa3937ddb16c0d1e63f2ec5a77b0960", "score": "0.49138397", "text": "func (rf *Raft) Start(command interface{}) (int, int, bool) {\n\tindex := -1\n\tterm := -1\n\tisLeader := true\n\n\t// Your code here (2B).\n\trf.mu.Lock()\n\tdefer rf.mu.Unlock()\n\tisLeader = rf.status == Leader\n\tif !isLeader {\n\t\treturn 0, 0, false\n\t}\n\n\tterm = rf.currentTerm\n\trf.log = append(rf.log, CommandTerm{\n\t\tCommand: command,\n\t\tTerm: term,\n\t})\n\trf.lastLogIndex = len(rf.log) - 1\n\tindex = rf.lastLogIndex\n\trf.persist()\n\treturn index, term, isLeader\n}", "title": "" }, { "docid": "ef5444b76cf10d48f242d727c5573195", "score": "0.4908046", "text": "func (m *Manager) OnLeader(f func(ctx context.Context) error) {\n\tgo func() {\n\t\t<-m.leaderChan\n\t\tfor {\n\t\t\tif err := f(m.leaderCTX); err != nil {\n\t\t\t\tlogrus.Errorf(\"failed to call leader func: %v\", err)\n\t\t\t\ttime.Sleep(5 * time.Second)\n\t\t\t\tcontinue\n\t\t\t}\n\t\t\tbreak\n\t\t}\n\t}()\n}", "title": "" }, { "docid": "499450eec2f1b158884affe0b52d53dc", "score": "0.49071768", "text": "func NewLeaderShuffler(pdAddr string, regionKey string) *LeaderShuffler {\n\tl := new(LeaderShuffler)\n\tl.Client = pdutil.NewPDClient(http.DefaultClient, pdAddr)\n\tl.regionKey = regionKey\n\tl.shuffleFuncs = []func() error{l.transferLeader, l.transferRegion, l.transferOtherRegionToLeader, l.mergeRegion, l.splitRegion}\n\treturn l\n}", "title": "" }, { "docid": "5f489bf44786605488fde2baa1d8d99d", "score": "0.48978052", "text": "func TestClientInteraction_Candidate(t *testing.T) {\n\t// Out.Println(\"TestClientInteraction_Candidate start\")\n\tsuppressLoggers()\n\tconfig := DefaultConfig()\n\tconfig.ClusterSize = 7\n\tcluster, _ := CreateLocalCluster(config)\n\tdefer cleanupCluster(cluster)\n\n\ttime.Sleep(3 * time.Second)\n\n\tleader, err := findLeader(cluster)\n\tif err != nil {\n\t\tt.Fatal(err)\n\t}\n\tfmt.Printf(\"~~~~~~~~~~~~~~LEADER: %v\\n\", leader)\n\n\tfor _, node := range cluster {\n\t\tif node.State == CANDIDATE_STATE {\n\t\t\tfmt.Println(\"find the candidate!\")\n\t\t\treply, _ := node.GetRemoteSelf().RegisterClientRPC()\n\t\t\tfmt.Printf(\"reply request: %v\\n\", reply.Status)\n\t\t\tif reply.Status != ClientStatus_NOT_LEADER && reply.Status != ClientStatus_ELECTION_IN_PROGRESS {\n\t\t\t\tt.Error(reply.Status)\n\t\t\t\tt.Fatal(\"Wrong response when registering a client to a candidate\")\n\t\t\t}\n\n\t\t\treq := ClientRequest{\n\t\t\t\tClientId: 1,\n\t\t\t\tSequenceNum: 1,\n\t\t\t\tStateMachineCmd: hashmachine.HASH_CHAIN_INIT,\n\t\t\t\tData: []byte(\"hello\"),\n\t\t\t}\n\t\t\tclientResult, _ := node.GetRemoteSelf().ClientRequestRPC(&req)\n\t\t\tfmt.Printf(\"client request1: %v\\n\", clientResult.Status)\n\t\t\tif clientResult.Status != ClientStatus_NOT_LEADER && clientResult.Status != ClientStatus_ELECTION_IN_PROGRESS {\n\t\t\t\tt.Fatal(\"Wrong response when sending a client request to a candidate\")\n\t\t\t}\n\t\t\tbreak\n\t\t}\n\t}\n\t// Out.Println(\"TestClientInteraction_Candidate done\")\n\t// time.Sleep(time.Second * WAIT_PERIOD)\n}", "title": "" }, { "docid": "7121e80c96a88923148a274e7878f6bb", "score": "0.48723686", "text": "func TestStart(t *testing.T) {\n\t// ****************************** NOTICE TO TESTERS / DEVELOPERS *************************************************\n\t// Please remember to always checkin logrus.FatalLevel\n\t// otherwise there is noise in the CI logs.\n\t//\n\t// To change LogLevel:\n\t// Info -> logrus.SetLevel(logrus.InfoLevel)\n\t// Fatal -> logrus.SetLevel(logrus.FatalLevel)\n\tlogrus.SetLevel(logrus.FatalLevel)\n\tremoveTestFiles(t)\n\tseqUnitTests(t)\n}", "title": "" }, { "docid": "5358708cf294a28f0802c90a45602968", "score": "0.48662317", "text": "func StartNewTestIndexer(t *testing.T, idx indexer.Indexer) {\n\tlabels := map[string]string{\n\t\torc8r.StateIndexerLabel: \"true\",\n\t}\n\tannotations := map[string]string{\n\t\torc8r.StateIndexerVersionAnnotation: strconv.Itoa(int(idx.GetVersion())),\n\t\torc8r.StateIndexerTypesAnnotation: strings.Join(idx.GetTypes(), orc8r.AnnotationFieldSeparator),\n\t}\n\tsrv, lis, plis := test_utils.NewTestOrchestratorService(t, orc8r.ModuleName, idx.GetID(), labels, annotations)\n\tservicer := &indexerServicer{idx: idx}\n\tprotos.RegisterIndexerServer(srv.ProtectedGrpcServer, servicer)\n\tgo srv.RunTest(lis, plis)\n}", "title": "" }, { "docid": "c113006e3604252de74fd994aeec6a30", "score": "0.48634613", "text": "func (r *Raft) becomeLeader() {\n\tr.State = StateLeader\n\tr.Lead = r.id\n\tr.RaftLog.entries = append(r.RaftLog.entries, pb.Entry{\n\t\tEntryType: pb.EntryType_EntryNormal,\n\t\tTerm: r.Term,\n\t\tIndex: r.RaftLog.LastIndex() + 1,\n\t})\n\tlastIndex := r.RaftLog.LastIndex()\n\tfor peer, _ := range r.Prs {\n\t\tif peer != r.id {\n\t\t\tr.Prs[peer].Next = lastIndex\n\t\t} else {\n\t\t\tr.Prs[peer].Next = lastIndex + 1\n\t\t\tr.Prs[peer].Match = lastIndex\n\t\t}\n\t}\n\tr.bcastAppend()\n\tif len(r.Prs) == 1 {\n\t\tr.RaftLog.committed = r.RaftLog.LastIndex()\n\t}\n}", "title": "" }, { "docid": "63bf8402c019f2ec7079f6cb8f2d3ad8", "score": "0.48631284", "text": "func (c *Client) Start(round int) error {\n\tsm := c.GetLastStateMachine()\n\tif sm.Round != round {\n\t\treturn errors.New(\"can only start the current round\")\n\t}\n\tme := false\n\tfor _, p := range sm.CurrentRoundInfo().Participants {\n\t\tif p == c.Id {\n\t\t\tme = true\n\t\t}\n\t}\n\tif !me {\n\t\treturn errors.New(\"can only start a round after submitting the public key. please wait\")\n\t}\n\top := StartOp{\n\t\tId: c.Id,\n\t\tR: round,\n\t\tCrypto: newMasseyOmuraCrypto(c.Config.MessageSize + c.messageHeaderLength()),\n\t}\n\tgo c.pending.add(op)\n\treturn nil\n}", "title": "" }, { "docid": "87fc846a0659b7b9b96e0f7253a4f164", "score": "0.48527318", "text": "func (cm *ClusterManager) Start(ctx context.Context, cancel context.CancelFunc) error {\n\tmetrics.RegisterClusterManagerBase()\n\n\t// Set up leader election process first.\n\t// User lease resource lock as configmap and endpoint lock support is removed from leader election library.\n\t// TODO: Remove the leader election from cluster-manager and have one single election\n\t// when both cluster manager and network controller manager are running.\n\t// See https://issues.redhat.com/browse/OCPBUGS-8080 for details\n\trl, err := resourcelock.New(\n\t\tresourcelock.LeasesResourceLock,\n\t\tconfig.Kubernetes.OVNConfigNamespace,\n\t\t\"ovn-kubernetes-cluster-manager\",\n\t\tcm.client.CoreV1(),\n\t\tcm.client.CoordinationV1(),\n\t\tresourcelock.ResourceLockConfig{\n\t\t\tIdentity: cm.identity,\n\t\t\tEventRecorder: cm.recorder,\n\t\t},\n\t)\n\tif err != nil {\n\t\treturn err\n\t}\n\n\tlec := leaderelection.LeaderElectionConfig{\n\t\tLock: rl,\n\t\tLeaseDuration: time.Duration(config.ClusterMgrHA.ElectionLeaseDuration) * time.Second,\n\t\tRenewDeadline: time.Duration(config.ClusterMgrHA.ElectionRenewDeadline) * time.Second,\n\t\tRetryPeriod: time.Duration(config.ClusterMgrHA.ElectionRetryPeriod) * time.Second,\n\t\tReleaseOnCancel: true,\n\t\tCallbacks: leaderelection.LeaderCallbacks{\n\t\t\tOnStartedLeading: func(ctx context.Context) {\n\t\t\t\tklog.Infof(\"Won leader election; in active mode\")\n\t\t\t\t// run only on the active master node\n\t\t\t\tif err := cm.run(ctx, cancel); err != nil {\n\t\t\t\t\tklog.Error(err)\n\t\t\t\t\tcancel()\n\t\t\t\t}\n\t\t\t},\n\t\t\tOnStoppedLeading: func() {\n\t\t\t\tklog.Infof(\"No longer leader; transitioning to standby mode\")\n\t\t\t\t// This node was leader and it lost the election.\n\t\t\t\t// Call halt() to stop all the cluster manager responsibilities\n\t\t\t\t// and become a standby. This doesn't exit the process because\n\t\t\t\t// - network cluster manager may also be running in an another\n\t\t\t\t// leader election session and we don't want to disrupt it.\n\t\t\t\t// - ClusterManager run() can be called again if it starts\n\t\t\t\t// leading again.\n\t\t\t\tif err := cm.halt(); err != nil {\n\t\t\t\t\tklog.Error(err)\n\t\t\t\t\tcancel()\n\t\t\t\t}\n\t\t\t},\n\t\t\tOnNewLeader: func(newLeaderName string) {\n\t\t\t\tif newLeaderName != cm.identity {\n\t\t\t\t\tklog.Infof(\"Lost the election to %s; in standby mode\", newLeaderName)\n\t\t\t\t}\n\t\t\t},\n\t\t},\n\t}\n\n\tleaderElector, err := leaderelection.NewLeaderElector(lec)\n\tif err != nil {\n\t\treturn err\n\t}\n\n\tcm.wg.Add(1)\n\tgo func() {\n\t\tleaderElector.Run(ctx)\n\t\tcm.wg.Done()\n\t}()\n\n\treturn nil\n}", "title": "" }, { "docid": "2be3bc2b45f28d92c4e2c07e59c50edb", "score": "0.4852349", "text": "func (kv *ShardKV) debugLeader(format string, a ...interface{}) {\n\tif Debug > 0 && !kv.killed {\n\t\tif _, isLeader := kv.rf.GetState(); isLeader {\n\t\t\tkv.debug(format, a...)\n\t\t}\n\t}\n}", "title": "" }, { "docid": "7ebc6812f1dca62b5b0e67d3b05f2259", "score": "0.48333612", "text": "func (m *Mockcoin) StartEpoch(arg0 context.Context, arg1 types.EpochID, arg2 weakcoin.UnitAllowances) {\n\tm.ctrl.T.Helper()\n\tm.ctrl.Call(m, \"StartEpoch\", arg0, arg1, arg2)\n}", "title": "" }, { "docid": "d5a46e018875867fd3393bd9a8c0390c", "score": "0.48328754", "text": "func (rf *Raft) Start(command interface{}) (int, int, bool) {\n\tindex := -1\n\tterm := -1\n\tisLeader := true\n\n\t// Your code here (2B).\n\tif rf.killed() {\n\t\treturn index, term, false\n\t}\n\n\tterm, isLeader = rf.GetState()\n\tif !isLeader {\n\t\treturn index, term, isLeader\n\t}\n\n\trf.mu.Lock()\n\tdefer rf.mu.Unlock()\n\tif len(rf.logs) > 0 {\n\t\tlastLogEntry := rf.logs[len(rf.logs)-1]\n\n\t\t// index = rf.matchIndex[rf.me]\n\t\tindex = lastLogEntry.Index + 1\n\t\trf.matchIndex[rf.me] = index\n\t\trf.nextIndex[rf.me] = index + 1\n\t} else {\n\t\tindex = 0\n\t}\n\trf.logs = append(rf.logs[:len(rf.logs)], LogEntry{\n\t\tTerm: rf.currentTerm,\n\t\tIndex: index,\n\t\tCommand: command,\n\t})\n\trf.persist()\n\tlog.Printf(\"leader %v logs %v\\n\", rf.me, rf.logs)\n\n\treturn index + 1, term, isLeader\n}", "title": "" }, { "docid": "4c0305b4af3ea426437360ea7e127951", "score": "0.48311812", "text": "func Test_Parition_2(t *testing.T) {\n\tclear()\n\tconfig := util.CreateConfig()\n\tserverlist := config.ServerList\n\tIdList := generateRandomList(serverlist.ServerNum)\n\t// majority partition\n\tparams := generatePartitionParams(serverlist.ServerNum, IdList, serverlist.ServerNum / 2)\n\tfor _, server := range config.ServerList.Servers {\n\t\tvar address string = server.Addr\n\t\t// connect to the server\n\t\tconn, err := grpc.Dial(address, grpc.WithInsecure())\n\t\tif err != nil {\n\t\t\tlog.Fatalf(\"did not connect: %v\", err)\n\t\t}\n\t\tdefer conn.Close()\n\t\tclient := pb_monkey.NewChaosMonkeyClient(conn)\n\t\t// Contact the server and print out its response.\n\t\tctx, cancel := context.WithTimeout(context.Background(), time.Minute)\n\t\tdefer cancel()\n\t\t// generating random params for\n\t\tclient.Partition(ctx, &pb_monkey.PartitionInfo{Server: params.servers})\n\t}\n\n\ttime.Sleep(750)\n\n\n\tleaderCount := checkLeader(params)\n\n\tif leaderCount <= 1 {\n\t\tt.Log(\"Passed the minority test.\")\n\t} else {\n\t\tt.Error(\"Failed the minority test.\")\n\t}\n\tclear()\n}", "title": "" }, { "docid": "f4d91b36cb960ae9a1a085dc98341c70", "score": "0.4827721", "text": "func StartTestCluster(t func() *testing.T, settings *installer.TestCephSettings) (*installer.CephInstaller, *utils.K8sHelper) {\n\tk8shelper, err := utils.CreateK8sHelper(t)\n\trequire.NoError(t(), err)\n\tsettings.KubernetesVersion = k8shelper.GetK8sServerVersion()\n\n\t// Turn on DEBUG logging\n\tcapnslog.SetGlobalLogLevel(capnslog.DEBUG)\n\n\tinstaller := installer.NewCephInstaller(t, k8shelper.Clientset, settings)\n\tisRookInstalled, err := installer.InstallRook()\n\n\tif !isRookInstalled || err != nil {\n\t\tlogger.Errorf(\"Rook was not installed successfully: %v\", err)\n\t\tif !installer.T().Failed() {\n\t\t\tinstaller.GatherAllRookLogs(t().Name(), settings.Namespace, settings.OperatorNamespace)\n\t\t}\n\t\tt().Fail()\n\t\tinstaller.UninstallRook()\n\t\tt().FailNow()\n\t}\n\n\treturn installer, k8shelper\n}", "title": "" }, { "docid": "ea1dea62fc13eed06c873dd481be875c", "score": "0.48249453", "text": "func (rf *Raft) Start(command interface{}) (int, int, bool) {\n\tindex := -1\n\tterm := -1\n\tisLeader := true\n\n\t// Your code here (2B).\n\trf.mu.Lock()\n\tif rf.role == LEADER {\n\t\tisLeader = true\n\t\tentry := LogEntry{}\n\t\tentry.Term = rf.CurrentTerm\n\t\tentry.Index = rf.GetLastLogEntryWithLock().Index + 1\n\t\tentry.Command = command\n\t\tindex = entry.Index\n\t\tterm = entry.Term\n\t\trf.Logs = append(rf.Logs, entry)\n\t\trf.persist()\n\t\tfor i := 0; i < len(rf.peers); i++ {\n\t\t\tif i == rf.me {\n\t\t\t\tcontinue\n\t\t\t}\n\t\t\tgo rf.RequestAppendNewEntries(i,false)\n\t\t}\n\t} else {\n\t\tisLeader = false\n\t}\n\trf.mu.Unlock()\n\treturn index, term, isLeader\n}", "title": "" }, { "docid": "aa82087c20e505ab0c5eebc17d9224d0", "score": "0.4814508", "text": "func attestModuleStart(ctx *zedagentContext) error {\n\tlog.Info(\"[ATTEST] Starting attestation task\")\n\tif ctx.attestCtx == nil {\n\t\treturn fmt.Errorf(\"No attest module context\")\n\t}\n\tif ctx.attestCtx.attestModCtx == nil {\n\t\treturn fmt.Errorf(\"No state machine context found\")\n\t}\n\tgo ctx.attestCtx.attestModCtx.EnterEventLoop()\n\treturn nil\n}", "title": "" }, { "docid": "1f5064424d438043eea5b6a2cb85dc4b", "score": "0.4808638", "text": "func TestClientStartRace(t *testing.T) {\n\tNewClient(\"127.0.0.1:2181\", nil).Start()\n}", "title": "" }, { "docid": "08e739ee47f7d290896b5b93a3bd0453", "score": "0.48075664", "text": "func (n *Node) isLeader() bool {\n\tif !n.IsMember() {\n\t\treturn false\n\t}\n\n\tif n.Status().Lead == n.Config.ID {\n\t\treturn true\n\t}\n\treturn false\n}", "title": "" }, { "docid": "111c2453c2d1eea0fddd488b710011bd", "score": "0.4805274", "text": "func TestShiftToRegLeader(t *testing.T) {\n\tp := newPaxos(&Config{ID: 1, NodeCount: 3})\n\tp.shiftToRegLeader()\n\n\tassertState(t, p, StateRegLeader)\n\n\t// TODO set messages before and set ARU.\n}", "title": "" }, { "docid": "904372dad20585145b621d2776b7a92a", "score": "0.48006335", "text": "func (rf *Raft) Start(command interface{}) (int, int, bool) {\n\tindex := -1\n\tterm := -1\n\n\trf.mu.Lock()\n\tdefer rf.mu.Unlock()\n\tisLeader := rf.state == leaderState\n\t// Your code here (2B).\n\tif !isLeader {\n\t\treturn index, term, isLeader\n\t}\n\trf.log = append(rf.log, Log{Term: int(rf.currentTerm), Command: command})\n\tindex = len(rf.log)\n\tterm = int(rf.currentTerm)\n\n\treturn index, term, isLeader\n}", "title": "" }, { "docid": "b952247eb9d757e1506e912daadc3ee8", "score": "0.4800364", "text": "func TestStartOk(t *testing.T) {\n\tconfig := &PooledConfig{NumWorkers: 3, WorkQueueSize: 3}\n\trunner := NewPooled(config)\n\tassert.NotNil(t, runner)\n\terr := runner.Start()\n\tassert.Nil(t, err)\n\t// It should have a worker queue of the size expected\n\tassert.Equal(t, 3, cap(runner.workerQueue))\n\t// It should have a workers of the expected size\n\tassert.Equal(t, 3, len(runner.workers))\n\t// Runner should be active\n\tassert.True(t, runner.active)\n}", "title": "" }, { "docid": "3aa7f2f5adada25fb2df6839a334ce5d", "score": "0.47957668", "text": "func (n *Node) WaitForLeader() (string, error) {\n\treturn n.Store.WaitForLeader(10 * time.Second)\n}", "title": "" }, { "docid": "2c259c1689e21f0b35f4a783f4f6a460", "score": "0.47913277", "text": "func WaitForLeader(t *testing.T, rpc rpcFn, dc string) {\n\tvar out structs.IndexedNodes\n\tretry.Run(t, func(r *retry.R) {\n\t\targs := &structs.DCSpecificRequest{Datacenter: dc}\n\t\tif err := rpc(\"Catalog.ListNodes\", args, &out); err != nil {\n\t\t\tr.Fatalf(\"Catalog.ListNodes failed: %v\", err)\n\t\t}\n\t\tif !out.QueryMeta.KnownLeader {\n\t\t\tr.Fatalf(\"No leader\")\n\t\t}\n\t\tif out.Index < 2 {\n\t\t\tr.Fatalf(\"Consul index should be at least 2\")\n\t\t}\n\t})\n}", "title": "" }, { "docid": "ce0310b7408750d52a800758ece02996", "score": "0.4778007", "text": "func (m *FactoidTransaction) Leader(state interfaces.IState) bool {\n\treturn state.LeaderFor(constants.FACTOID_CHAINID)\n}", "title": "" }, { "docid": "e1c79d9ee9ac9380f195f090986df2b1", "score": "0.4774125", "text": "func (rt *RaftType) Leader(id *int) {\n\t//fmt.Println(\"In Leader function:-\",rt,*id)\n\tif rt.serv.ServState.my_state == FOLLOWER {\n\t\t//return rt.serv.ServState.vote_for\n\t\t*id = 0\n\t} else if rt.serv.ServState.my_state == LEADER {\n\t\t*id = rt.serv.ServState.vote_for\n\t} else {\n\t\t*id = -1\n\t}\n\t//fmt.Println(\"In Leader function:-\",rt,*id)\n}", "title": "" }, { "docid": "f79b4d6b7c6c5dfe0888e02a7089f39d", "score": "0.47716454", "text": "func (m *Participant) ResetLeader() {\n\tm.leadership.Reset()\n\tm.unsetLeader()\n}", "title": "" }, { "docid": "d44524d204c9a0ef5cd57f80fcfe4ef5", "score": "0.47712263", "text": "func TestStart(t *testing.T) {\n\trunTest(t, func(s *Session) {\n\t\ts.Handle(\"model\", res.GetResource(func(r res.GetRequest) { r.NotFound() }))\n\t}, nil)\n}", "title": "" } ]
106df504c97ad9a642356f30deab0054
============================================================================= Function ============================================================================= Minus makes polynomial to polynomial
[ { "docid": "7787bad179645e90f269dfd5ca7e85b5", "score": "0.81258404", "text": "func Minus(P Polynomial) Polynomial {\n\tL := len(P.Coeff)\n\tvar Q Polynomial\n\tQ.Coeff = make([]float64, L, L)\n\tfor i := range Q.Coeff {\n\t\tQ.Coeff[i] = -P.Coeff[i]\n\t}\n\treturn Q\n}", "title": "" } ]
[ { "docid": "d3d0cfbef28a09d0fb45f1bcf97a32cf", "score": "0.65309256", "text": "func Poly(x float64, coeffs ...float64) float64 {\n\ty := coeffs[0]\n\tv := 1.0\n\tfor _, c := range coeffs[1:] {\n\t\tv *= x\n\t\ty += c * v\n\t}\n\treturn y\n}", "title": "" }, { "docid": "f77ed00e60411dc07274d6d7b11319c0", "score": "0.6063945", "text": "func (z *Int64) Minus(y *Int64, a int64) *Int64 {\n\tz.l = y.l - a\n\tz.r = y.r\n\treturn z\n}", "title": "" }, { "docid": "0358098c18967817074ae40f50341b80", "score": "0.59595233", "text": "func (curve *CurveParams) polynomial(x *big.Int) *big.Int {\n\tx3 := new(big.Int).Mul(x, x)\n\tx3.Mul(x3, x)\n\n\taX := new(big.Int).Mul(curve.A, x)\n\n\tx3.Add(x3, aX)\n\tx3.Add(x3, curve.B)\n\tx3.Mod(x3, curve.P)\n\n\treturn x3\n}", "title": "" }, { "docid": "1d87768c06e9106a3ba8d64f128a335b", "score": "0.59292513", "text": "func (z *Float) Minus(y *Float, a *big.Float) *Float {\n\tz.l.Sub(&y.l, a)\n\tz.r.Set(&y.r)\n\treturn z\n}", "title": "" }, { "docid": "7baeaca94b937384088f70e60222065d", "score": "0.585543", "text": "func (coins DecCoins) Minus(coinsB DecCoins) DecCoins {\n\treturn coins.Plus(coinsB.Negative())\n}", "title": "" }, { "docid": "908d7dde85dfb776e604327e6fb7188c", "score": "0.5803578", "text": "func NewPoly(coeffs ...complex128) poly {\n\treturn poly(coeffs).Normalise()\n}", "title": "" }, { "docid": "29c4edb12c4acb02bc0d0ea295ef4027", "score": "0.57434076", "text": "func (v Vec3) Minus(v1 Vec3) Vec3 {\n\treturn NewVec(v.El[0]-v1.El[0], v.El[1]-v1.El[1], v.El[2]-v1.El[2])\n}", "title": "" }, { "docid": "6980330447dceaf62b30460ea0b613b5", "score": "0.57404673", "text": "func (a Vec) Minus(b Vec) Vec {\n\treturn Vec{a.X - b.X, a.Y - b.Y, a.Z - b.Z}\n}", "title": "" }, { "docid": "250f6fc399a89fb0672964e5cf9f192b", "score": "0.5728639", "text": "func (v Vec) Minus(v2 Vec) Vec {\n\treturn NewVec(v.E[0]-v2.E[0], v.E[1]-v2.E[1], v.E[2]-v2.E[2])\n}", "title": "" }, { "docid": "cb494c0f8da74490c1dad1026a0c8084", "score": "0.57175916", "text": "func xMinusConst(a *big.Int) Poly {\n\tb := new(big.Int)\n\tb.Neg(a)\n\treturn Poly{b, big.NewInt(1)}\n}", "title": "" }, { "docid": "4fd428241a06dbeb268523c81e7acbb1", "score": "0.5580796", "text": "func (coin DecCoin) Minus(coinB DecCoin) DecCoin {\n\tif coin.Denom != coinB.Denom {\n\t\tpanic(fmt.Sprintf(\"coin denom different: %v %v\\n\", coin.Denom, coinB.Denom))\n\t}\n\treturn DecCoin{coin.Denom, coin.Amount.Sub(coinB.Amount)}\n}", "title": "" }, { "docid": "a22680582c5086d71b72bb8a6c1e11d5", "score": "0.55023", "text": "func (v Vec) Minus(v2 Vec) Vec {\n\treturn Vec{v[0] - v2[0], v[1] - v2[1], v[2] - v2[2]}\n}", "title": "" }, { "docid": "a870e3c350592a82f1c07e7c517593cc", "score": "0.5456414", "text": "func (z *poly) Mul(a, b *poly) *poly {\n\tda := a.Divide()\n\tdb := b.Divide()\n\tvar dz [8]*poly\n\tfor i := 0; i < 8; i++ {\n\t\tdz[i] = NewPoly().MulKaratsuba(da[i], db[i])\n\t}\n\tvar res, res1, res2 [3]*poly\n\n\t// compute z111,z112\n\tfor i := 0; i < 32; i++ {\n\t\tdz[0].coeffs[i] -= reduce(BigNumberMultiplication(dz[0].coeffs[i+32], R7))\n\t\tdz[0].coeffs[i] = reduce(dz[0].coeffs[i])\n\t\tdz[1].coeffs[i] -= reduce(BigNumberMultiplication(dz[1].coeffs[i+32], R7))\n\t\tdz[1].coeffs[i] = reduce(dz[1].coeffs[i])\n\t\tdz[2].coeffs[i] -= reduce(BigNumberMultiplication(dz[2].coeffs[i+32], R3))\n\t\tdz[2].coeffs[i] = reduce(dz[2].coeffs[i])\n\t\tdz[3].coeffs[i] -= reduce(BigNumberMultiplication(dz[3].coeffs[i+32], R3))\n\t\tdz[3].coeffs[i] = reduce(dz[3].coeffs[i])\n\t\tdz[4].coeffs[i] -= reduce(BigNumberMultiplication(dz[4].coeffs[i+32], R5))\n\t\tdz[4].coeffs[i] = reduce(dz[4].coeffs[i])\n\t\tdz[5].coeffs[i] -= reduce(BigNumberMultiplication(dz[5].coeffs[i+32], R5))\n\t\tdz[5].coeffs[i] = reduce(dz[5].coeffs[i])\n\t\tdz[6].coeffs[i] -= reduce(BigNumberMultiplication(dz[6].coeffs[i+32], R1))\n\t\tdz[6].coeffs[i] = reduce(dz[6].coeffs[i])\n\t\tdz[7].coeffs[i] -= reduce(BigNumberMultiplication(dz[7].coeffs[i+32], R1))\n\t\tdz[7].coeffs[i] = reduce(dz[7].coeffs[i])\n\t}\n\tfor i := 0; i < 32; i++ {\n\t\t//c111\n\t\tdz[0].coeffs[i+32] = dz[0].coeffs[i]\n\t\tdz[0].coeffs[i] = reduce(reduce(BigNumberMultiplication(dz[0].coeffs[i], -R7)))\n\t\t//c112\n\t\tdz[1].coeffs[i+32] = reduce(-dz[1].coeffs[i])\n\t\tdz[1].coeffs[i] = reduce(-BigNumberMultiplication(dz[1].coeffs[i], R7))\n\t\t//c121\n\t\tdz[2].coeffs[i+32] = dz[2].coeffs[i]\n\t\tdz[2].coeffs[i] = reduce(BigNumberMultiplication(dz[2].coeffs[i], -R3))\n\t\t//c122\n\t\tdz[3].coeffs[i+32] = reduce(-dz[3].coeffs[i])\n\t\tdz[3].coeffs[i] = reduce(BigNumberMultiplication(dz[3].coeffs[i], R3))\n\t\t//c211\n\t\tdz[4].coeffs[i] = dz[4].coeffs[i]\n\t\tdz[4].coeffs[i+32] = reduce(BigNumberMultiplication(dz[4].coeffs[i], -R5))\n\t\t//c212\n\t\tdz[5].coeffs[i+32] = reduce(-dz[5].coeffs[i])\n\t\tdz[5].coeffs[i] = reduce(BigNumberMultiplication(dz[5].coeffs[i], R5))\n\t\t//c221\n\t\tdz[6].coeffs[i] = dz[6].coeffs[i]\n\t\tdz[6].coeffs[i+32] = reduce(BigNumberMultiplication(dz[6].coeffs[i], -R1))\n\t\t//c222\n\t\tdz[7].coeffs[i+32] = reduce(-dz[7].coeffs[i])\n\t\tdz[7].coeffs[i] = reduce(-BigNumberMultiplication(dz[7].coeffs[i], R1))\n\t}\n\n\t// compute z11,z12,z21,z22\n\tres1[1] = NewPoly().Add(dz[0], dz[1])\n\tres1[2] = NewPoly().Add(dz[2], dz[3])\n\tres2[1] = NewPoly().Add(dz[4], dz[5])\n\tres2[2] = NewPoly().Add(dz[6], dz[7])\n\tfor i := 0; i < 64; i++ {\n\t\tres1[1].coeffs[i] = reduce(BigNumberMultiplication(res1[1].coeffs[i], reduce(BigNumberMultiplication((Q+1)/2, R1))))\n\t\tres1[2].coeffs[i] = reduce(BigNumberMultiplication(res1[2].coeffs[i], reduce(BigNumberMultiplication((Q+1)/2, R5))))\n\t\tres2[1].coeffs[i] = reduce(BigNumberMultiplication(res2[1].coeffs[i], reduce(BigNumberMultiplication((Q+1)/2, R3))))\n\t\tres2[2].coeffs[i] = reduce(BigNumberMultiplication(res2[2].coeffs[i], reduce(BigNumberMultiplication((Q+1)/2, R7))))\n\t}\n\tfor i := 0; i < 64; i++ {\n\t\tres1[1].coeffs[i+64] = res1[1].coeffs[i]\n\t\tres1[1].coeffs[i] = reduce(BigNumberMultiplication(res1[1].coeffs[i], -R6))\n\n\t\tres1[2].coeffs[i+64] = reduce(-res1[2].coeffs[i])\n\t\tres1[2].coeffs[i] = reduce(-BigNumberMultiplication(res1[2].coeffs[i], R6))\n\n\t\tres2[1].coeffs[i+64] = res2[1].coeffs[i]\n\t\tres2[1].coeffs[i] = reduce(BigNumberMultiplication(res2[1].coeffs[i], -R2))\n\n\t\tres2[2].coeffs[i+64] = reduce(-res2[2].coeffs[i])\n\t\tres2[2].coeffs[i] = reduce(-BigNumberMultiplication(res2[2].coeffs[i], R6))\n\t}\n\n\t//compute z1,z2\n\tres[1] = NewPoly().Add(res1[1], res1[2])\n\tres[2] = NewPoly().Add(res2[1], res2[2])\n\tfor i := 0; i < 128; i++ {\n\t\tres[1].coeffs[i] = reduce(BigNumberMultiplication(res[1].coeffs[i], reduce(BigNumberMultiplication((Q+1)/2, R2))))\n\t\tres[2].coeffs[i] = reduce(BigNumberMultiplication(res[2].coeffs[i], reduce(BigNumberMultiplication((Q+1)/2, R6))))\n\t}\n\tfor i := 0; i < 128; i++ {\n\t\tres[1].coeffs[i+128] = res[1].coeffs[i]\n\t\tres[1].coeffs[i+128] = reduce(BigNumberMultiplication(res[1].coeffs[i], -R4))\n\t\tres[2].coeffs[i+128] = reduce(-res[2].coeffs[i])\n\t\tres[2].coeffs[i+128] = reduce(-BigNumberMultiplication(res[2].coeffs[i], R4))\n\t}\n\tz=NewPoly().Add(res[1],res[2])\n\tfor i := 0; i < 128; i++ {\n\t\tz.coeffs[i]=reduce(BigNumberMultiplication(z.coeffs[i],BigNumberMultiplication((Q+1)/2,R4)))\n\t}\n\treturn z\n}", "title": "" }, { "docid": "1e89b8cebe17c7b5992f9514595a9d7f", "score": "0.542375", "text": "func makePoly(field *Field, coefficients []byte) *poly {\n\tif len(coefficients) == 0 {\n\t\treturn nil\n\t}\n\tobj := &poly{field: field}\n\tif len(coefficients) > 1 && coefficients[0] == 0 {\n\t\t// Leading term must be non-zero for anything except the constant polynomial \"0\".\n\t\tfirstNonZero := 1\n\t\tfor coefficients[firstNonZero] == 0 && firstNonZero < len(coefficients) {\n\t\t\tfirstNonZero++\n\t\t}\n\t\tif firstNonZero == len(coefficients) {\n\t\t\tobj.coefficients = zero\n\t\t} else {\n\t\t\t// Slice it.\n\t\t\tobj.coefficients = coefficients[firstNonZero:]\n\t\t}\n\t} else {\n\t\tobj.coefficients = coefficients\n\t}\n\treturn obj\n}", "title": "" }, { "docid": "a6a3f46183f7068983c8e365a6c4d4c7", "score": "0.5403551", "text": "func (v Vec) Minus(v2 Vec) Vec {\n\tx := v.X - v2.X\n\ty := v.Y - v2.Y\n\tz := v.Z - v2.Z\n\treturn Vec{x, y, z}\n}", "title": "" }, { "docid": "715f443f560d9ebf1c63d9dba6abc494", "score": "0.5305862", "text": "func (z *poly) Sub(a, b *poly) *poly {\n\tfor i := 0; i < N; i++ {\n\t\tz.coeffs[i] = a.coeffs[i] - b.coeffs[i]\n\t\tz.coeffs[i] = reduce(z.coeffs[i])\n\t}\n\treturn z\n}", "title": "" }, { "docid": "f9872c3c1adf3e01f5c550ea91819e19", "score": "0.5262321", "text": "func evaluatePolynomialNaive(xArray []float64, yArray []float64) {\n\tfor index := range xArray {\n\t\tx := xArray[index]\n\t\ty := c100\n\t\ty = c99 + x * y\n\t\ty = c98 + x * y\n\t\ty = c97 + x * y\n\t\ty = c96 + x * y\n\t\ty = c95 + x * y\n\t\ty = c94 + x * y\n\t\ty = c93 + x * y\n\t\ty = c92 + x * y\n\t\ty = c91 + x * y\n\t\ty = c90 + x * y\n\t\ty = c89 + x * y\n\t\ty = c88 + x * y\n\t\ty = c87 + x * y\n\t\ty = c86 + x * y\n\t\ty = c85 + x * y\n\t\ty = c84 + x * y\n\t\ty = c83 + x * y\n\t\ty = c82 + x * y\n\t\ty = c81 + x * y\n\t\ty = c80 + x * y\n\t\ty = c79 + x * y\n\t\ty = c78 + x * y\n\t\ty = c77 + x * y\n\t\ty = c76 + x * y\n\t\ty = c75 + x * y\n\t\ty = c74 + x * y\n\t\ty = c73 + x * y\n\t\ty = c72 + x * y\n\t\ty = c71 + x * y\n\t\ty = c70 + x * y\n\t\ty = c69 + x * y\n\t\ty = c68 + x * y\n\t\ty = c67 + x * y\n\t\ty = c66 + x * y\n\t\ty = c65 + x * y\n\t\ty = c64 + x * y\n\t\ty = c63 + x * y\n\t\ty = c62 + x * y\n\t\ty = c61 + x * y\n\t\ty = c60 + x * y\n\t\ty = c59 + x * y\n\t\ty = c58 + x * y\n\t\ty = c57 + x * y\n\t\ty = c56 + x * y\n\t\ty = c55 + x * y\n\t\ty = c54 + x * y\n\t\ty = c53 + x * y\n\t\ty = c52 + x * y\n\t\ty = c51 + x * y\n\t\ty = c50 + x * y\n\t\ty = c49 + x * y\n\t\ty = c48 + x * y\n\t\ty = c47 + x * y\n\t\ty = c46 + x * y\n\t\ty = c45 + x * y\n\t\ty = c44 + x * y\n\t\ty = c43 + x * y\n\t\ty = c42 + x * y\n\t\ty = c41 + x * y\n\t\ty = c40 + x * y\n\t\ty = c39 + x * y\n\t\ty = c38 + x * y\n\t\ty = c37 + x * y\n\t\ty = c36 + x * y\n\t\ty = c35 + x * y\n\t\ty = c34 + x * y\n\t\ty = c33 + x * y\n\t\ty = c32 + x * y\n\t\ty = c31 + x * y\n\t\ty = c30 + x * y\n\t\ty = c29 + x * y\n\t\ty = c28 + x * y\n\t\ty = c27 + x * y\n\t\ty = c26 + x * y\n\t\ty = c25 + x * y\n\t\ty = c24 + x * y\n\t\ty = c23 + x * y\n\t\ty = c22 + x * y\n\t\ty = c21 + x * y\n\t\ty = c20 + x * y\n\t\ty = c19 + x * y\n\t\ty = c18 + x * y\n\t\ty = c17 + x * y\n\t\ty = c16 + x * y\n\t\ty = c15 + x * y\n\t\ty = c14 + x * y\n\t\ty = c13 + x * y\n\t\ty = c12 + x * y\n\t\ty = c11 + x * y\n\t\ty = c10 + x * y\n\t\ty = c9 + x * y\n\t\ty = c8 + x * y\n\t\ty = c7 + x * y\n\t\ty = c6 + x * y\n\t\ty = c5 + x * y\n\t\ty = c4 + x * y\n\t\ty = c3 + x * y\n\t\ty = c2 + x * y\n\t\ty = c1 + x * y\n\t\ty = c0 + x * y\n\t\tyArray[index] = y\n\t}\n}", "title": "" }, { "docid": "71675ae8573cefbe21d31adfc1966ca6", "score": "0.52155983", "text": "func superPow(a int, b []int) int {\n\tn := len(b)\n\tif n == 0 {\n\t\treturn 1\n\t}\n\n\tp := 0\n\tfor _, value := range b {\n\t\tp = (p*10 + value) % 1140\n\t}\n\n\tif p == 0 {\n\t\tp += 1440\n\t}\n\n\treturn power(a, p, 1337)\n}", "title": "" }, { "docid": "7fa16ae5480f41bde51e48bb51906edc", "score": "0.519871", "text": "func superPow(a int, b []int) int {\n\tif len(b) == 0 {\n\t\treturn 1\n\t}\n\tlast := b[len(b)-1]\n\tb = b[:len(b)-1]\n\tpart1 := myPow(a, last)\n\tpart2 := myPow(superPow(a, b), 10)\n\treturn (part1 * part2) % base\n}", "title": "" }, { "docid": "3576e289c464e74cbafc173ee2472014", "score": "0.5132943", "text": "func MinusCaculator(num1, num2 int) {\n\tresult = num1 / num2\n}", "title": "" }, { "docid": "0454026160b2b73fb867e74b09767ef6", "score": "0.5121977", "text": "func (o *Powell) Min(x0 la.Vector, reuseNmat bool) (fmin float64) {\n\n\t// set Nmat with unit vectors\n\tif !reuseNmat {\n\t\to.Nmat.SetDiag(1) // set diagonal\n\t}\n\n\t// initializations\n\to.x.Apply(1, x0) // x := x0\n\tfmin = o.ffcn(o.x) // fmin := f({x0})\n\n\t// history\n\tvar λhist float64\n\tvar nhist la.Vector\n\tif o.History {\n\t\to.Hist = NewHistory(o.MaxIt, fmin, o.x, o.ffcn)\n\t\tnhist = la.NewVector(o.size)\n\t}\n\n\t// iterations\n\tfor o.It = 0; o.It < o.MaxIt; o.It++ {\n\n\t\t// set iteration values\n\t\tfx := fmin // iteration f({x})\n\t\tjDel := 0 // index of largest decrease\n\t\tdelF := 0.0 // largest function decrease\n\n\t\t// loop over all directions in the set\n\t\tfor jDir := 0; jDir < o.size; jDir++ {\n\n\t\t\t// minimize along direction jDir\n\t\t\tn := o.Nmat.GetCol(jDir) // direction\n\t\t\tfold := fmin // save fmin\n\t\t\tλhist, fmin = o.LS.MinUpdateX(o.x, n) // x := x @ min\n\n\t\t\t// record direction if it corresponds to the largest decrease so far\n\t\t\tif fold-fmin > delF {\n\t\t\t\tdelF = fold - fmin\n\t\t\t\tjDel = jDir + 1\n\t\t\t}\n\n\t\t\t// history\n\t\t\tif o.History {\n\t\t\t\tnhist.Apply(λhist, n)\n\t\t\t\to.Hist.Append(fmin, o.x, nhist)\n\t\t\t}\n\t\t}\n\n\t\t// exit point\n\t\tif 2.0*(fx-fmin) <= o.Ftol*(math.Abs(fx)+math.Abs(fmin))+o.tiny {\n\t\t\treturn\n\t\t}\n\n\t\t// update\n\t\tfor i := 0; i < o.size; i++ {\n\t\t\to.xe[i] = 2.0*o.x[i] - x0[i] // xe := 2⋅x - x0 extrapolated point\n\t\t\to.nAve[i] = o.x[i] - x0[i] // nAve := x - x0 average direction moved\n\t\t\tx0[i] = o.x[i] // save the old starting point\n\t\t}\n\n\t\t// function value at extrapolated point\n\t\tfe := o.ffcn(o.xe)\n\n\t\t// move to the minimum of the new direction, and save the new direction\n\t\tif fe < fx {\n\t\t\tt := 2.0*(fx-2.0*fmin+fe)*math.Pow(fx-fmin-delF, 2) - delF*math.Pow(fx-fe, 2)\n\t\t\tif t < 0.0 {\n\t\t\t\tfmin = o.LS.Min(o.x, o.nAve)\n\t\t\t\tfor i := 0; i < o.size; i++ {\n\t\t\t\t\to.Nmat.Set(i, jDel-1, o.Nmat.Get(i, o.size-1))\n\t\t\t\t\to.Nmat.Set(i, o.size-1, o.nAve[i])\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\n\t// did not converge\n\tchk.Panic(\"fail to converge after %d iterations\", o.It)\n\treturn\n}", "title": "" }, { "docid": "976fb62f616bc221592a835b95f26649", "score": "0.5112003", "text": "func multiply_polynomials(a, b []byte) []byte {\n\n\t// I'll compute each term separately and add them together\n\tresultterms := []byte{}\n\n\t// this grows to account for the fact the terms increase as it goes\n\t// for example, multiplying by x, shifts all 1 right\n\ttermpadding := []byte{}\n\tfor _, bterm := range b {\n\t\tthisvalue := termpadding[:]\n\t\t// multiply each a by the b term.\n\t\tfor _, aterm := range a {\n\t\t\tthisvalue = append(thisvalue, gf256_mul(aterm, bterm))\n\t\t}\n\n\t\tresultterms = add_polynomials(resultterms, thisvalue)\n\t\t// moved another x value over...\n\t\ttermpadding = append(termpadding,0)\n\t}\n\n\treturn resultterms\n}", "title": "" }, { "docid": "ae8b37025cf699cee141a465e6042806", "score": "0.50843453", "text": "func (A AdjVertexSet) Minus(B AdjVertexSet) (AmB AdjVertexSet) {\r\n\tAmB.Init(A.Parent)\r\n\tfor k := range A.Repr {\r\n\t\tif B.Repr[k] == false {\r\n\t\t\tAmB.Repr[k] = true\r\n\t\t}\r\n\t}\r\n\treturn\r\n}", "title": "" }, { "docid": "2cd9e2bf611fea0fc553f7b60c9f9259", "score": "0.5079278", "text": "func linearPolyForVar(qap QAP, i int, x, alpha, beta Element) Element {\n\t// u_i(x)\n\tui := qap.left[i].Eval(x)\n\t// beta * u_i(x)\n\tbui := NewElement().Mul(ui, beta)\n\t// v_i(x)\n\tvi := qap.right[i].Eval(x)\n\t// alpha * v_i(x)\n\tavi := NewElement().Mul(vi, alpha)\n\twi := qap.out[i].Eval(x)\n\treturn wi.Add(wi, NewElement().Add(bui, avi))\n}", "title": "" }, { "docid": "67e57c374d8b6181998232205b52ca45", "score": "0.50770116", "text": "func (z *poly) Scale(a *poly, b int64) *poly {\n\tfor i := 0; i < N; i++ {\n\t\tz.coeffs[i] = BigNumberMultiplication(a.coeffs[i], b)\n\t\tz.coeffs[i] = reduce(z.coeffs[i])\n\t}\n\treturn z\n}", "title": "" }, { "docid": "010e177be200126b2da5b029f6ddc8ec", "score": "0.5017314", "text": "func (f *FloatU)Pow(p int) {\n temp := new(FloatU)\n *temp = *f\n\n if p == 0 {\n f.value = 1.0\n return\n }\n\n for i:=1; i< p; i++ {\n f.Mul(temp)\n }\n}", "title": "" }, { "docid": "455db96105e8379468c1bc43cc03a155", "score": "0.4978355", "text": "func (pk *PublicKey) NegPoly(ct *PolyCiphertext) *PolyCiphertext {\n\n\tdegree := ct.Degree\n\tresult := make([]*Ciphertext, degree)\n\n\tfor i := degree - 1; i >= 0; i-- {\n\t\tresult[i] = pk.Sub(pk.encryptZero(), ct.Coefficients[i])\n\t}\n\n\treturn &PolyCiphertext{result, ct.Degree, ct.ScaleFactor, ct.L2}\n}", "title": "" }, { "docid": "2035dbc504047af7922f5004ae827d06", "score": "0.49630216", "text": "func (z *Perplex) Sub(x, y *Perplex) *Perplex {\n\tz.Real().Sub(x.Real(), y.Real())\n\tz.Dual().Sub(x.Dual(), y.Dual())\n\treturn z\n}", "title": "" }, { "docid": "70629c290b38c63e84bb0ed5806360ee", "score": "0.49338877", "text": "func gfPolyMultiplication(p, q []int) (result []int) {\n\tresult = make([]int, len(p)+len(q)-1)\n\t// compute the polynomial multiplication like product of two vectors\n\tfor j := 0; j < len(q); j++ {\n\t\tfor i := 0; i < len(p); i++ {\n\t\t\tresult[i+j] ^= gfMultiplication(p[i], q[j])\n\t\t}\n\t}\n\treturn\n}", "title": "" }, { "docid": "d2905b8ba46a61862ee54a7e6680b153", "score": "0.4927376", "text": "func (p Polynomial) Subtract(other Polynomial) Polynomial {\n\tm := make(map[uint]float64)\n\n\tgrade := max(p.grade, other.grade)\n\n\tfor i := uint(0); i <= grade; i++ {\n\t\tsub := p.coefficients[i] - other.coefficients[i]\n\n\t\tif checkNotZero(sub) {\n\t\t\tm[i] = sub\n\t\t}\n\t}\n\n\treturn Polynomial{m, getGradeFromMap(m)}\n}", "title": "" }, { "docid": "1342a95440283043f5455c4f82e8bc42", "score": "0.49213332", "text": "func (context *Context) NewUniformPoly() (Pol *Poly) {\n\n\tvar randomBytes []byte\n\tvar randomUint, mask uint64\n\n\tPol = context.NewPoly()\n\n\tn := context.N\n\tif n < 8 {\n\t\tn = 8\n\t}\n\n\trandomBytes = make([]byte, n)\n\tif _, err := rand.Read(randomBytes); err != nil {\n\t\tpanic(\"crypto rand error\")\n\t}\n\n\tfor j, qi := range context.Modulus {\n\n\t\t// Starts by computing the mask\n\t\tmask = (1 << uint64(bits.Len64(qi))) - 1\n\n\t\t// Iterates for each modulus over each coefficient\n\t\tfor i := uint64(0); i < context.N; i++ {\n\n\t\t\t// Samples an integer between [0, qi-1]\n\t\t\tfor {\n\n\t\t\t\t// Replenishes the pool if it runs empty\n\t\t\t\tif len(randomBytes) < 8 {\n\t\t\t\t\trandomBytes = make([]byte, n)\n\t\t\t\t\tif _, err := rand.Read(randomBytes); err != nil {\n\t\t\t\t\t\tpanic(\"crypto rand error\")\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\t// Reads bytes from the pool\n\t\t\t\trandomUint = binary.BigEndian.Uint64(randomBytes[:8]) & mask\n\t\t\t\trandomBytes = randomBytes[8:] // Discard the used bytes\n\n\t\t\t\t// If the integer is between [0, qi-1], breaks the loop\n\t\t\t\tif randomUint < qi {\n\t\t\t\t\tbreak\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tPol.Coeffs[j][i] = randomUint\n\t\t}\n\t}\n\n\treturn\n}", "title": "" }, { "docid": "a44491a5ea717422737350f14679d52b", "score": "0.49057037", "text": "func (z *poly) Divide() (res [8]*poly) {\n\tfor i := 0; i < 8; i++ {\n\t\tres[i] = NewPoly()\n\t}\n\tvar a [3]*poly //a1=a[1],a2=a[2]\n\tvar a1 [3]*poly //a11=a1[1],a12=a1[2]\n\tvar a2 [3]*poly //a21=a2[1],a22=a2[2]\n\tfor i := 1; i < 3; i++ {\n\t\ta[i] = NewPoly()\n\t\ta1[i] = NewPoly()\n\t\ta2[i] = NewPoly()\n\t}\n\n\tvar tmp [8]int64\n\t// compute a1,a2\n\tfor i := 0; i < N/2; i++ {\n\t\ttmp[4] = BigNumberMultiplication(z.coeffs[i+N/2], -R4)\n\t\ta[1].coeffs[i] = reduce(z.coeffs[i] + tmp[4])\n\t\ta[2].coeffs[i] = reduce(z.coeffs[i] + tmp[4])\n\t}\n\t// compute a11,a12,a21,a22\n\tfor i := 0; i < N/4; i++ {\n\t\ttmp[2] = BigNumberMultiplication(z.coeffs[i+N/4], -R2)\n\t\ttmp[6] = BigNumberMultiplication(z.coeffs[i+N/4], -R6)\n\t\ta1[1].coeffs[i] = reduce(a[1].coeffs[i] + tmp[6])\n\t\ta1[2].coeffs[i] = reduce(a[1].coeffs[i] - tmp[6])\n\t\ta2[1].coeffs[i] = reduce(a[2].coeffs[i] - tmp[2])\n\t\ta2[2].coeffs[i] = reduce(a[2].coeffs[i] - tmp[2])\n\t}\n\t// compute a111~a222\n\tfor i := 0; i < N/8; i++ {\n\t\ttmp[1] = BigNumberMultiplication(a1[0].coeffs[i+N/8], -R1)\n\t\ttmp[3] = BigNumberMultiplication(a1[0].coeffs[i+N/8], -R3)\n\t\ttmp[5] = BigNumberMultiplication(a1[0].coeffs[i+N/8], -R5)\n\t\ttmp[7] = BigNumberMultiplication(a1[0].coeffs[i+N/8], -R7)\n\t\tres[0].coeffs[i] = reduce(a1[1].coeffs[i] + tmp[7]) //a111\n\t\tres[1].coeffs[i] = reduce(a1[1].coeffs[i] + tmp[7]) //a112\n\t\tres[2].coeffs[i] = reduce(a1[2].coeffs[i] + tmp[3]) //a121\n\t\tres[3].coeffs[i] = reduce(a1[2].coeffs[i] + tmp[3]) //a122\n\t\tres[4].coeffs[i] = reduce(a2[1].coeffs[i] + tmp[5]) //a211\n\t\tres[5].coeffs[i] = reduce(a2[1].coeffs[i] + tmp[5]) //a212\n\t\tres[6].coeffs[i] = reduce(a2[2].coeffs[i] + tmp[1]) //a221\n\t\tres[7].coeffs[i] = reduce(a2[2].coeffs[i] + tmp[1]) //a222\n\t}\n\treturn res\n}", "title": "" }, { "docid": "3636c974ea2c06a815f38dd7aca1ec40", "score": "0.48951375", "text": "func min(point, carry, min uint) uint {\n\tif carry < point {\n\t\treturn point - carry\n\t}\n\treturn min\n}", "title": "" }, { "docid": "0c46a2d02ca8889a2770ce046aa7be23", "score": "0.48828125", "text": "func NewPolynomial(c []float64) (p Polynomial) {\n\tp.c = c\n\treturn\n}", "title": "" }, { "docid": "c3f8d1e5973532508690f09c61e3e2d7", "score": "0.4867715", "text": "func (resources Resources) Minus(that ...Resource) Resources {\n\tx := resources.Clone()\n\treturn x.Subtract(that...)\n}", "title": "" }, { "docid": "53dee6feaef51a552138ea08b7a9904d", "score": "0.48597145", "text": "func (t Tri) Poly() Poly {\n\tcopy := t // Ensure that poly updates can't affect our tri\n\treturn Poly(copy[:])\n}", "title": "" }, { "docid": "ac17337f82f41980fe65a55e91427a9f", "score": "0.48444366", "text": "func (z *E2) MulByNonResidue1Power1(x *E2) *E2 {\n\t// (8376118865763821496583973867626364092589906065868298776909617916018768340080,16469823323077808223889137241176536799009286646108169935659301613961712198316)\n\tz.Mul(x, &nonRes1Pow1to5[0])\n\treturn z\n}", "title": "" }, { "docid": "e42da00743bf8e7d46c73901092efe8c", "score": "0.483731", "text": "func gfPolyScale(p []int, x int) []int {\n\tresult := make([]int, len(p))\n\tfor i := 0; i < len(p); i++ {\n\t\tresult[i] = gfMultiplication(p[i], x)\n\t}\n\treturn result\n}", "title": "" }, { "docid": "6f188566167a87b997a73bac0bf7ac13", "score": "0.4827687", "text": "func (pk *PublicKey) MultConstPoly(ct *PolyCiphertext, constant *big.Float) *PolyCiphertext {\n\n\tisNegative := constant.Cmp(big.NewFloat(0.0)) < 0\n\tif isNegative {\n\t\tconstant.Mul(constant, big.NewFloat(-1.0))\n\t}\n\n\tpk.mu.Lock()\n\tpoly := pk.NewUnbalancedPlaintext(constant)\n\tpk.mu.Unlock()\n\n\tdegree := ct.Degree + poly.Degree\n\tresult := make([]*Ciphertext, degree)\n\n\tzero := pk.encryptZero()\n\tif ct.L2 {\n\t\tzero = pk.makeL2(zero)\n\t}\n\n\t// set all coefficients to zero\n\tfor i := 0; i < degree; i++ {\n\t\tresult[i] = zero\n\t}\n\n\tvar mu sync.Mutex // mutex for addition\n\tvar wg sync.WaitGroup\n\tfor i := ct.Degree - 1; i >= 0; i-- {\n\t\tfor k := poly.Degree - 1; k >= 0; k-- {\n\t\t\twg.Add(1)\n\t\t\tindex := i + k\n\t\t\tgo func(index int, c1 *Ciphertext, c *big.Int) {\n\t\t\t\tdefer wg.Done()\n\t\t\t\tmu.Lock()\n\t\t\t\tcoeff := pk.MultConst(c1, c)\n\t\t\t\tresult[index] = pk.Add(result[index], coeff)\n\t\t\t\tmu.Unlock()\n\t\t\t}(index, ct.Coefficients[i], poly.Coefficients[k])\n\t\t}\n\t}\n\n\twg.Wait()\n\n\tproduct := &PolyCiphertext{result, degree, ct.ScaleFactor + poly.ScaleFactor, ct.L2}\n\n\tif isNegative {\n\t\treturn pk.NegPoly(product)\n\t}\n\n\treturn product\n}", "title": "" }, { "docid": "2aab29b782d475ed2119362d83df2b06", "score": "0.48203635", "text": "func (z *poly) Add(a, b *poly) *poly {\n\tfor i := 0; i < N; i++ {\n\t\tz.coeffs[i] = a.coeffs[i] + b.coeffs[i]\n\t\tz.coeffs[i] = reduce(z.coeffs[i])\n\t}\n\treturn z\n}", "title": "" }, { "docid": "aeb2424aa16e3d196a3c3fa848d3ac54", "score": "0.48201314", "text": "func (pk *PublicKey) EvalPoly(ct *PolyCiphertext) *Ciphertext {\n\tacc := pk.EncryptDeterministic(big.NewInt(0))\n\tx := big.NewInt(int64(pk.PolyEncodingParams.PolyBase))\n\n\tfor i := ct.Degree - 1; i >= 0; i-- {\n\t\tacc = pk.MultConst(acc, x)\n\t\tacc = pk.Add(acc, ct.Coefficients[i])\n\t}\n\n\treturn acc\n}", "title": "" }, { "docid": "9ba58ffe5ffd3a434eaaf4861e8e87de", "score": "0.48166174", "text": "func polyMod(v []byte) uint64 {\r\n\t/**\r\n\t * The input is interpreted as a list of coefficients of a polynomial over F\r\n\t * = GF(32), with an implicit 1 in front. If the input is [v0,v1,v2,v3,v4],\r\n\t * that polynomial is v(x) = 1*x^5 + v0*x^4 + v1*x^3 + v2*x^2 + v3*x + v4.\r\n\t * The implicit 1 guarantees that [v0,v1,v2,...] has a distinct checksum\r\n\t * from [0,v0,v1,v2,...].\r\n\t *\r\n\t * The output is a 40-bit integer whose 5-bit groups are the coefficients of\r\n\t * the remainder of v(x) mod g(x), where g(x) is the cashaddr generator, x^8\r\n\t * + {19}*x^7 + {3}*x^6 + {25}*x^5 + {11}*x^4 + {25}*x^3 + {3}*x^2 + {19}*x\r\n\t * + {1}. g(x) is chosen in such a way that the resulting code is a BSV\r\n\t * code, guaranteeing detection of up to 4 errors within a window of 1025\r\n\t * characters. Among the various possible BSV codes, one was selected to in\r\n\t * fact guarantee detection of up to 5 errors within a window of 160\r\n\t * characters and 6 erros within a window of 126 characters. In addition,\r\n\t * the code guarantee the detection of a burst of up to 8 errors.\r\n\t *\r\n\t * Note that the coefficients are elements of GF(32), here represented as\r\n\t * decimal numbers between {}. In this finite field, addition is just XOR of\r\n\t * the corresponding numbers. For example, {27} + {13} = {27 ^ 13} = {22}.\r\n\t * Multiplication is more complicated, and requires treating the bits of\r\n\t * values themselves as coefficients of a polynomial over a smaller field,\r\n\t * GF(2), and multiplying those polynomials mod a^5 + a^3 + 1. For example,\r\n\t * {5} * {26} = (a^2 + 1) * (a^4 + a^3 + a) = (a^4 + a^3 + a) * a^2 + (a^4 +\r\n\t * a^3 + a) = a^6 + a^5 + a^4 + a = a^3 + 1 (mod a^5 + a^3 + 1) = {9}.\r\n\t *\r\n\t * During the course of the loop below, `c` contains the bitpacked\r\n\t * coefficients of the polynomial constructed from just the values of v that\r\n\t * were processed so far, mod g(x). In the above example, `c` initially\r\n\t * corresponds to 1 mod (x), and after processing 2 inputs of v, it\r\n\t * corresponds to x^2 + v0*x + v1 mod g(x). As 1 mod g(x) = 1, that is the\r\n\t * starting value for `c`.\r\n\t */\r\n\tc := uint64(1)\r\n\tfor _, d := range v {\r\n\t\t/**\r\n\t\t * We want to update `c` to correspond to a polynomial with one extra\r\n\t\t * term. If the initial value of `c` consists of the coefficients of\r\n\t\t * c(x) = f(x) mod g(x), we modify it to correspond to\r\n\t\t * c'(x) = (f(x) * x + d) mod g(x), where d is the next input to\r\n\t\t * process.\r\n\t\t *\r\n\t\t * Simplifying:\r\n\t\t * c'(x) = (f(x) * x + d) mod g(x)\r\n\t\t * ((f(x) mod g(x)) * x + d) mod g(x)\r\n\t\t * (c(x) * x + d) mod g(x)\r\n\t\t * If c(x) = c0*x^5 + c1*x^4 + c2*x^3 + c3*x^2 + c4*x + c5, we want to\r\n\t\t * compute\r\n\t\t * c'(x) = (c0*x^5 + c1*x^4 + c2*x^3 + c3*x^2 + c4*x + c5) * x + d\r\n\t\t * mod g(x)\r\n\t\t * = c0*x^6 + c1*x^5 + c2*x^4 + c3*x^3 + c4*x^2 + c5*x + d\r\n\t\t * mod g(x)\r\n\t\t * = c0*(x^6 mod g(x)) + c1*x^5 + c2*x^4 + c3*x^3 + c4*x^2 +\r\n\t\t * c5*x + d\r\n\t\t * If we call (x^6 mod g(x)) = k(x), this can be written as\r\n\t\t * c'(x) = (c1*x^5 + c2*x^4 + c3*x^3 + c4*x^2 + c5*x + d) + c0*k(x)\r\n\t\t */\r\n\r\n\t\t// First, determine the value of c0:\r\n\t\tc0 := byte(c >> 35)\r\n\r\n\t\t// Then compute c1*x^5 + c2*x^4 + c3*x^3 + c4*x^2 + c5*x + d:\r\n\t\tc = ((c & 0x07ffffffff) << 5) ^ uint64(d)\r\n\r\n\t\t// Finally, for each set bit n in c0, conditionally add {2^n}k(x):\r\n\t\tif c0&0x01 > 0 {\r\n\t\t\t// k(x) = {19}*x^7 + {3}*x^6 + {25}*x^5 + {11}*x^4 + {25}*x^3 +\r\n\t\t\t// {3}*x^2 + {19}*x + {1}\r\n\t\t\tc ^= 0x98f2bc8e61\r\n\t\t}\r\n\r\n\t\tif c0&0x02 > 0 {\r\n\t\t\t// {2}k(x) = {15}*x^7 + {6}*x^6 + {27}*x^5 + {22}*x^4 + {27}*x^3 +\r\n\t\t\t// {6}*x^2 + {15}*x + {2}\r\n\t\t\tc ^= 0x79b76d99e2\r\n\t\t}\r\n\r\n\t\tif c0&0x04 > 0 {\r\n\t\t\t// {4}k(x) = {30}*x^7 + {12}*x^6 + {31}*x^5 + {5}*x^4 + {31}*x^3 +\r\n\t\t\t// {12}*x^2 + {30}*x + {4}\r\n\t\t\tc ^= 0xf33e5fb3c4\r\n\t\t}\r\n\r\n\t\tif c0&0x08 > 0 {\r\n\t\t\t// {8}k(x) = {21}*x^7 + {24}*x^6 + {23}*x^5 + {10}*x^4 + {23}*x^3 +\r\n\t\t\t// {24}*x^2 + {21}*x + {8}\r\n\t\t\tc ^= 0xae2eabe2a8\r\n\t\t}\r\n\r\n\t\tif c0&0x10 > 0 {\r\n\t\t\t// {16}k(x) = {3}*x^7 + {25}*x^6 + {7}*x^5 + {20}*x^4 + {7}*x^3 +\r\n\t\t\t// {25}*x^2 + {3}*x + {16}\r\n\t\t\tc ^= 0x1e4f43e470\r\n\t\t}\r\n\t}\r\n\r\n\t/**\r\n\t * PolyMod computes what value to xor into the final values to make the\r\n\t * checksum 0. However, if we required that the checksum was 0, it would be\r\n\t * the case that appending a 0 to a valid list of values would result in a\r\n\t * new valid list. For that reason, cashaddr requires the resulting checksum\r\n\t * to be 1 instead.\r\n\t */\r\n\treturn c ^ 1\r\n}", "title": "" }, { "docid": "af801bf31adc1053fbef586271ef8fb5", "score": "0.48157504", "text": "func (z *E2) MulByNonResidue2Power1(x *E2) *E2 {\n\t// 21888242871839275220042445260109153167277707414472061641714758635765020556617\n\tb := fp.Element{\n\t\t14595462726357228530,\n\t\t17349508522658994025,\n\t\t1017833795229664280,\n\t\t299787779797702374,\n\t}\n\tz.A0.Mul(&x.A0, &b)\n\tz.A1.Mul(&x.A1, &b)\n\treturn z\n}", "title": "" }, { "docid": "dcff3fdd3783ce786f04e95813fbcb63", "score": "0.47996122", "text": "func Uton(u float32) float32 { return 2*u - 1 }", "title": "" }, { "docid": "333e80fab25a3742c96a0c48474a03b8", "score": "0.47788095", "text": "func (C *Matrix) Minus(A, B *Matrix) *Matrix {\n\n\t// Normal matrices.\n\tif A.stride == A.width && B.stride == B.width && C.stride == C.width {\n\t\tfor i, bi := range B.data {\n\t\t\tC.data[i] = A.data[i] - bi\n\t\t}\n\t\treturn C\n\t}\n\n\t// SubMatrices.\n\tfor i := 0; i < A.height; i++ {\n\t\tAi := A.Row(i)\n\t\tCi := C.Row(i)\n\t\tfor j, bij := range B.Row(i) {\n\t\t\tCi[j] = Ai[j] - bij\n\t\t}\n\t}\n\treturn C\n}", "title": "" }, { "docid": "df80c24692a5b0564cf42dd65e53cb13", "score": "0.4776728", "text": "func pow(z complex128, i int) complex128 {\n\tif i < 0 {\n\t\tpanic(\"negative power\")\n\t}\n\n\tvar res complex128 = 1\n\n\tfor i > 0 {\n\t\tres *= z\n\t\ti--\n\t}\n\n\treturn res\n}", "title": "" }, { "docid": "799b36c85ed2d09acca9086a02ae2f0a", "score": "0.47556224", "text": "func ConsensusMinerMinPower(p stabi.RegisteredPoStProof) (stabi.StoragePower, error) {\n\tinfo, ok := PoStProofPolicies[p]\n\tif !ok {\n\t\treturn stabi.NewStoragePower(0), xerrors.Errorf(\"unsupported proof type: %v\", p)\n\t}\n\treturn info.ConsensusMinerMinPower, nil\n}", "title": "" }, { "docid": "88dbee6c1d5eab4329a0007d9a757896", "score": "0.4753739", "text": "func superPow1(a int, b []int) int {\n\tn := len(b)\n\tif n == 0 {\n\t\treturn 1\n\t}\n\n\tlastDigit := b[n-1]\n\n\treturn powMod(superPow(a, b[:n-1]), 10) * powMod(a, lastDigit) % base\n}", "title": "" }, { "docid": "49d1afe2febe755504f153eaca9c9fcb", "score": "0.4750334", "text": "func (point1 *testpoint) Mul(coefficient string) (*testpoint, error) {\n\tcoeff := utils.ToBigInt(coefficient)\n\tcurrent := point1\n\tresult := &testpoint{\n\t\tnil,\n\t\tnil,\n\t\tpoint1.A,\n\t\tpoint1.B,\n\t}\n\tfor coeff.Int64() > 0 {\n\t\t// keep adding to ther result if the rightmost bit is 1\n\t\tif (coeff.Int64() & 1) == 1 {\n\t\t\tresult, _ = result.Add(current)\n\t\t}\n\t\tcurrent, _ = current.Add(current)\n\t\tcoeff.Rsh(coeff, 1)\n\t}\n\treturn result, nil\n\n}", "title": "" }, { "docid": "7a2e664fc6c08cfc0d6ad07de9f416f3", "score": "0.47455457", "text": "func (n *Component_Transceiver_Channel_InputPowerPath) Min() *Component_Transceiver_Channel_InputPower_MinPath {\n\treturn &Component_Transceiver_Channel_InputPower_MinPath{\n\t\tNodePath: ygot.NewNodePath(\n\t\t\t[]string{\"min\"},\n\t\t\tmap[string]interface{}{},\n\t\t\tn,\n\t\t),\n\t}\n}", "title": "" }, { "docid": "6eac01f545cf70bee6b0e15b6083a3b7", "score": "0.47389483", "text": "func Minus(A, B *Matrix) *Matrix {\n\t C := Zeros(A.height, A.width)\n\t C.Minus(A, B)\n\treturn C\n}", "title": "" }, { "docid": "451e77492f670d85032755e02703cf9d", "score": "0.47360235", "text": "func buildMonomial(field *Field, degree int, coefficient byte) *poly {\n\tif degree < 0 {\n\t\treturn nil\n\t}\n\tif coefficient == 0 {\n\t\treturn getZero(field)\n\t}\n\tcoefficients := make([]byte, degree+1)\n\tcoefficients[0] = coefficient\n\treturn &poly{field, coefficients}\n}", "title": "" }, { "docid": "cb09df1b925662ac3c570e3d82cfe6dd", "score": "0.47278646", "text": "func (n *Component_Transceiver_Channel_OutputPowerPath) Min() *Component_Transceiver_Channel_OutputPower_MinPath {\n\treturn &Component_Transceiver_Channel_OutputPower_MinPath{\n\t\tNodePath: ygot.NewNodePath(\n\t\t\t[]string{\"min\"},\n\t\t\tmap[string]interface{}{},\n\t\t\tn,\n\t\t),\n\t}\n}", "title": "" }, { "docid": "0c56aea04b32b2c56decb91f2ad443bc", "score": "0.47259903", "text": "func main() {\n\n // a string of a polynomial expression we want to compute the implicit derivative of.\n // expression: 2*x*y^2\n\n // interface to handle variant types.\n a := []interface{}{2, \"*\", \"x\", \"*\", \"y\", \"^\", 2}\n // 0 -> constant: define its properties and it should be / have an operator like property or simply use an operator on each coefficient.\n // 1 -> product operator\n // 2 -> x term: variable not being y, define it's properties.\n // 3 -> product operator\n // 4 -> exponent operator: let j be an idx who's element is a variable, if j+1 is ^ -\n // - j+2 is the exponent on the j term. handle this..\n // - j+2 becomes the coefficient on the j term, j-1 - and j+1 is decremented n-1. handle powers of 1.\n b := []interface{}{}\n // define each operators properties.\n ...\n\n // define the chain rule for a given term.\n // let j be an idx who's element is y which has a composite function at j+n.\n // based on prefined rules of the composite function, compute its derivative.\n // the expression becomes j*j+n assuming we've placed its derivative in j+n.\n}", "title": "" }, { "docid": "59895d54dbc60466a33ce6959c53c4b9", "score": "0.4725614", "text": "func (p Polynomial) Derive() Polynomial {\n\tm := make(map[uint]float64)\n\n\tfor i := uint(0); i <= p.grade; i++ {\n\t\tif checkNotZero(p.coefficients[i+1]) {\n\t\t\tm[i] = p.coefficients[i+1] * (float64(i + 1))\n\t\t}\n\t}\n\n\treturn Polynomial{m, p.grade - 1}\n}", "title": "" }, { "docid": "d1fd703990c2508ee11ec94acd6f8485", "score": "0.47236934", "text": "func (pk *PublicKey) SubPoly(ct1 *PolyCiphertext, ct2 *PolyCiphertext) *PolyCiphertext {\n\treturn pk.AddPoly(ct1, pk.NegPoly(ct2))\n}", "title": "" }, { "docid": "0e1f44a22147ae5a609310b9dd0c2c8e", "score": "0.47220105", "text": "func (n *OpticalAmplifier_Amplifier_OutputPowerTotalPath) Min() *OpticalAmplifier_Amplifier_OutputPowerTotal_MinPath {\n\treturn &OpticalAmplifier_Amplifier_OutputPowerTotal_MinPath{\n\t\tNodePath: ygot.NewNodePath(\n\t\t\t[]string{\"min\"},\n\t\t\tmap[string]interface{}{},\n\t\t\tn,\n\t\t),\n\t}\n}", "title": "" }, { "docid": "647a3408dc4ce08ce7f369d7d6123c7b", "score": "0.47193012", "text": "func (n *Component_Transceiver_InputPowerPath) Min() *Component_Transceiver_InputPower_MinPath {\n\treturn &Component_Transceiver_InputPower_MinPath{\n\t\tNodePath: ygot.NewNodePath(\n\t\t\t[]string{\"min\"},\n\t\t\tmap[string]interface{}{},\n\t\t\tn,\n\t\t),\n\t}\n}", "title": "" }, { "docid": "ead47a4f33e6e820e1dd0f61c75e287a", "score": "0.4717013", "text": "func (xp Natural) Pow(n uint) Natural {\n\tz := Nat(1);\n\tx := xp;\n\tfor n > 0 {\n\t\t// z * x^n == x^n0\n\t\tif n&1 == 1 {\n\t\t\tz = z.Mul(x)\n\t\t}\n\t\tx, n = x.Mul(x), n/2;\n\t}\n\treturn z;\n}", "title": "" }, { "docid": "c4fb669548a99f8b7c0d5922010437c1", "score": "0.4716916", "text": "func (pk *PublicKey) EncryptPoly(pt *PolyPlaintext) *PolyCiphertext {\n\n\tencryptedCoefficients := make([]*Ciphertext, pt.Degree)\n\n\tfor i := 0; i < pt.Degree; i++ {\n\n\t\tnegative := (pt.Coefficients[i].Cmp(big.NewInt(0)) < 0)\n\t\tif negative {\n\t\t\tpositive := new(big.Int).Mul(big.NewInt(-1), pt.Coefficients[i])\n\t\t\tcoeff := positive\n\t\t\tencryptedCoefficients[i] = pk.Sub(pk.encryptZero(), pk.Encrypt(coeff))\n\t\t} else {\n\t\t\tcoeff := pt.Coefficients[i]\n\t\t\tencryptedCoefficients[i] = pk.Encrypt(coeff)\n\t\t}\n\t}\n\n\treturn &PolyCiphertext{encryptedCoefficients, pt.Degree, pt.ScaleFactor, false}\n}", "title": "" }, { "docid": "91d283c90f9e88859166675e960f5e19", "score": "0.4708898", "text": "func (n *OpticalAmplifier_Amplifier_InputPowerTotalPath) Min() *OpticalAmplifier_Amplifier_InputPowerTotal_MinPath {\n\treturn &OpticalAmplifier_Amplifier_InputPowerTotal_MinPath{\n\t\tNodePath: ygot.NewNodePath(\n\t\t\t[]string{\"min\"},\n\t\t\tmap[string]interface{}{},\n\t\t\tn,\n\t\t),\n\t}\n}", "title": "" }, { "docid": "50fed310258bdf444ac8d4b948229af1", "score": "0.47004676", "text": "func (n *Component_Transceiver_OutputPowerPath) Min() *Component_Transceiver_OutputPower_MinPath {\n\treturn &Component_Transceiver_OutputPower_MinPath{\n\t\tNodePath: ygot.NewNodePath(\n\t\t\t[]string{\"min\"},\n\t\t\tmap[string]interface{}{},\n\t\t\tn,\n\t\t),\n\t}\n}", "title": "" }, { "docid": "7407443a32993fbeae52e9d4a2a4cd52", "score": "0.46974173", "text": "func (f Polynomial) Mul(g Polynomial) (h Polynomial) {\n\thDeg := f.Deg() + g.Deg()\n\th = NewPoly(hDeg)\n\tfor k := 0; k <= f.Deg(); k++ {\n\t\tfor l := 0; l <= g.Deg(); l++ {\n\t\t\tm := k + l\n\t\t\th[m] += f.At(k) * g.At(l)\n\t\t}\n\t}\n\treturn h\n}", "title": "" }, { "docid": "ca1b6904dad00c9c5140b0796adca80b", "score": "0.46933913", "text": "func add_polynomials(a, b []byte) []byte {\n\n\t// make them the same length...\n\tif len(a) < len(b) {\n\t\ta = append(a, make([]byte, len(b)-len(a))...)\n\t}\n\tif len(a) > len(b) {\n\t\tb = append(b, make([]byte, len(a)-len(b))...)\n\t}\n\n\tif len(a) != len(b) {\n\t\tpanic(\"a and be are not the same length\")\n\t}\n\n\tresult := []byte{}\n\tfor pos := range a {\n\t\tresult = append(result, gf256_add(a[pos], b[pos]))\n\t}\n\n\treturn result\n}", "title": "" }, { "docid": "97772d87c0ed5f38517ba773991bb19e", "score": "0.4690594", "text": "func pow(x, y int) int {\n\tpow := 1\n\tfor i := 0; i < y; i++ {\n\t\tpow *= x\n\t}\n\treturn pow\n}", "title": "" }, { "docid": "314fd57fe766bdc4cf1cfa85bd92357b", "score": "0.46837613", "text": "func (o *OpTensorOp) Min() OpTensorOp { *o = OpTensorOp(C.miopenTensorOpMin); return *o }", "title": "" }, { "docid": "eea7e9c0092ac26dbf8b791d43fe667d", "score": "0.4675601", "text": "func (n *OpticalAmplifier_Amplifier_OutputPowerCBandPath) Min() *OpticalAmplifier_Amplifier_OutputPowerCBand_MinPath {\n\treturn &OpticalAmplifier_Amplifier_OutputPowerCBand_MinPath{\n\t\tNodePath: ygot.NewNodePath(\n\t\t\t[]string{\"min\"},\n\t\t\tmap[string]interface{}{},\n\t\t\tn,\n\t\t),\n\t}\n}", "title": "" }, { "docid": "ff68d523cee2240a3fa08126b0a1f7a0", "score": "0.46708998", "text": "func NewPoly(deg int) (f Polynomial) {\n\tf = make(Polynomial, deg+1)\n\treturn f\n}", "title": "" }, { "docid": "0eb05f46aca8dc78cd95c25d73a42237", "score": "0.46696612", "text": "func (n *Component_Transceiver_InputPowerPathAny) Min() *Component_Transceiver_InputPower_MinPathAny {\n\treturn &Component_Transceiver_InputPower_MinPathAny{\n\t\tNodePath: ygot.NewNodePath(\n\t\t\t[]string{\"min\"},\n\t\t\tmap[string]interface{}{},\n\t\t\tn,\n\t\t),\n\t}\n}", "title": "" }, { "docid": "8b7ace7ac1c2a521f2892d33b6301254", "score": "0.46653745", "text": "func (n *Component_Transceiver_Channel_InputPowerPathAny) Min() *Component_Transceiver_Channel_InputPower_MinPathAny {\n\treturn &Component_Transceiver_Channel_InputPower_MinPathAny{\n\t\tNodePath: ygot.NewNodePath(\n\t\t\t[]string{\"min\"},\n\t\t\tmap[string]interface{}{},\n\t\t\tn,\n\t\t),\n\t}\n}", "title": "" }, { "docid": "22855f6af0800e671dfac30020eb6d78", "score": "0.46632323", "text": "func (n *Component_Transceiver_Channel_OutputPowerPathAny) Min() *Component_Transceiver_Channel_OutputPower_MinPathAny {\n\treturn &Component_Transceiver_Channel_OutputPower_MinPathAny{\n\t\tNodePath: ygot.NewNodePath(\n\t\t\t[]string{\"min\"},\n\t\t\tmap[string]interface{}{},\n\t\t\tn,\n\t\t),\n\t}\n}", "title": "" }, { "docid": "8643849c810d6c3c8dc28d5a0c7c0e63", "score": "0.4659467", "text": "func (n *OpticalAmplifier_Amplifier_InputPowerCBandPath) Min() *OpticalAmplifier_Amplifier_InputPowerCBand_MinPath {\n\treturn &OpticalAmplifier_Amplifier_InputPowerCBand_MinPath{\n\t\tNodePath: ygot.NewNodePath(\n\t\t\t[]string{\"min\"},\n\t\t\tmap[string]interface{}{},\n\t\t\tn,\n\t\t),\n\t}\n}", "title": "" }, { "docid": "f76228023e8eb18ea90027a227fb36ee", "score": "0.46589872", "text": "func (n *Component_Transceiver_OutputPowerPathAny) Min() *Component_Transceiver_OutputPower_MinPathAny {\n\treturn &Component_Transceiver_OutputPower_MinPathAny{\n\t\tNodePath: ygot.NewNodePath(\n\t\t\t[]string{\"min\"},\n\t\t\tmap[string]interface{}{},\n\t\t\tn,\n\t\t),\n\t}\n}", "title": "" }, { "docid": "5dddd169b4aea7293fd99af95040e57a", "score": "0.4646577", "text": "func (w *gethWhisperWrapper) MinPow() float64 {\n\treturn w.whisper.MinPow()\n}", "title": "" }, { "docid": "00171a2b5a753e0466b7fbb180b38d85", "score": "0.4643762", "text": "func (f Polynomial) Sub(g Polynomial) (h Polynomial) {\n\tdeg := max(f.Deg(), g.Deg())\n\tfor k := deg; k >= 0; k-- {\n\t\ta := f.At(k) - g.At(k)\n\t\tif a == 0 {\n\t\t\tcontinue\n\t\t}\n\t\tif h == nil {\n\t\t\th = NewPoly(k)\n\t\t}\n\t\th[k] = a\n\t}\n\treturn h\n}", "title": "" }, { "docid": "ace76a4566c1ca179387857a880c22e2", "score": "0.4639335", "text": "func (z *E2) MulByNonResidue3Power1(x *E2) *E2 {\n\t// (11697423496358154304825782922584725312912383441159505038794027105778954184319,303847389135065887422783454877609941456349188919719272345083954437860409601)\n\tz.Mul(x, &nonRes3Pow1To5[0])\n\treturn z\n}", "title": "" }, { "docid": "82d0b61670ec953cb0f3c5f516d2b9ad", "score": "0.463491", "text": "func power(x, n int) int {\r\n\tif n == 0 {\r\n\t\treturn 1\r\n\t}\r\n\r\n\tif n < 0 {\r\n\t\treturn 0\r\n\t}\r\n\r\n\tresult := x\r\n\tfor i := 1; i < n; i++ {\r\n\t\tresult *= x\r\n\t}\r\n\treturn result\r\n}", "title": "" }, { "docid": "82d0b61670ec953cb0f3c5f516d2b9ad", "score": "0.463491", "text": "func power(x, n int) int {\r\n\tif n == 0 {\r\n\t\treturn 1\r\n\t}\r\n\r\n\tif n < 0 {\r\n\t\treturn 0\r\n\t}\r\n\r\n\tresult := x\r\n\tfor i := 1; i < n; i++ {\r\n\t\tresult *= x\r\n\t}\r\n\treturn result\r\n}", "title": "" }, { "docid": "af2ff4d8fce750da37b41e5ee6fa3632", "score": "0.46288434", "text": "func (z *poly) MulLow16(a, b *poly) *poly {\n\tfor i := 0; i < N; i++ {\n\t\tz.coeffs[i] = 0\n\t}\n\tfor i := 0; i < 16; i++ {\n\t\tfor j := 0; j < 16; j++ {\n\t\t\tm := i + j\n\t\t\tz.coeffs[m] += BigNumberMultiplication(a.coeffs[i], b.coeffs[j])\n\t\t\tz.coeffs[m] = reduce(z.coeffs[m])\n\t\t}\n\t}\n\treturn z\n}", "title": "" }, { "docid": "e1be76d567b0c8e6549f66a1fd12b20f", "score": "0.46267545", "text": "func (n *Component_Port_OpticalPort_InputPowerPath) Min() *Component_Port_OpticalPort_InputPower_MinPath {\n\treturn &Component_Port_OpticalPort_InputPower_MinPath{\n\t\tNodePath: ygot.NewNodePath(\n\t\t\t[]string{\"min\"},\n\t\t\tmap[string]interface{}{},\n\t\t\tn,\n\t\t),\n\t}\n}", "title": "" }, { "docid": "7c2ffa4bced520dab199fb9cbafa47f2", "score": "0.46252745", "text": "func (p *poly) getCoefficient(degree int) byte {\n\treturn p.coefficients[len(p.coefficients)-1-degree]\n}", "title": "" }, { "docid": "f951e5c1fdbdd2c80bd0e440a95523dd", "score": "0.46094325", "text": "func minOperations(n int) int {\n\tans := 0\n\tfor i := 1; i < n; i += 2 {\n\t\tans += n - i\n\t}\n\treturn ans\n}", "title": "" }, { "docid": "6390f364e5ffd1fd7bad6a7768eb826d", "score": "0.460153", "text": "func (p Polynomial) Sum(other Polynomial) Polynomial {\n\tm := make(map[uint]float64)\n\n\tgrade := max(p.grade, other.grade)\n\n\tfor i := uint(0); i <= grade; i++ {\n\t\tsum := p.coefficients[i] + other.coefficients[i]\n\n\t\tif checkNotZero(p.coefficients[i]) {\n\t\t\tm[i] = sum\n\t\t}\n\t}\n\n\treturn Polynomial{m, getGradeFromMap(m)}\n}", "title": "" }, { "docid": "1f3b41c55375c9a8bc3c4f487b7ba84e", "score": "0.45985624", "text": "func (z *DualPerplex) Sub(x, y *DualPerplex) *DualPerplex {\n\tz.l.Sub(&x.l, &y.l)\n\tz.r.Sub(&x.r, &y.r)\n\treturn z\n}", "title": "" }, { "docid": "b851ebd279180760820d86b661f0cd10", "score": "0.45973614", "text": "func (n *Component_Port_OpticalPort_OutputPowerPath) Min() *Component_Port_OpticalPort_OutputPower_MinPath {\n\treturn &Component_Port_OpticalPort_OutputPower_MinPath{\n\t\tNodePath: ygot.NewNodePath(\n\t\t\t[]string{\"min\"},\n\t\t\tmap[string]interface{}{},\n\t\t\tn,\n\t\t),\n\t}\n}", "title": "" }, { "docid": "e5cfce67046c3fe1807eb836c2d914b3", "score": "0.4594229", "text": "func polygamman(n int, lnfac, x float64) float64 {\n\t// Coefficients for asymptotic expansion:\n\t// b_{2k} = BernoulliB_{2k}/(2k)!\n\tconst (\n\t\tb2 = 1. / 12\n\t\tb4 = -1. / 720\n\t\tb6 = 1. / 30240\n\t\tb8 = -1. / 1209600\n\t\tb10 = 1. / 47900160\n\t\tb12 = -691. / 1307674368000\n\t\tb14 = 1. / 74724249600\n\t\tb16 = -3617. / 10670622842880000\n\t\tb18 = 43867. / 5109094217170944000\n\t\tb20 = -174611. / 802857662698291200000\n\t\tb22 = 77683. / 14101100039391805440000\n\t\tb24 = -236364091. / 1693824136731743669452800000\n\t\tb26 = 657931. / 186134520519971831808000000\n\t\tb28 = -3392780147. / 37893265687455865519472640000000\n\t\t/*\n\t\t\tb30 = 1723168255201. / 759790291646040068357842010112000000\n\t\t\tb32 = -7709321041217. / 134196726836183700385281186201600000000\n\t\t\tb34 = 151628697551. / 104199811425742637946218332815360000000\n\t\t\tb36 = -26315271553053477373. / 713925872841910517552409860896601407488000000000\n\t\t\tb38 = 154210205991661. / 165165037094716140555791754978970828800000000\n\t\t\tb40 = -261082718496449122051. / 11039333782344056345696120477635448049500160000000000\n\t\t*/\n\t)\n\n\t// s = (-1)**(n+1)\n\ts := -1 + 2*(n&1)\n\n\ty := 1 / (x * x)\n\tlx := math.Log(x)\n\n\treturn float64(s) * math.Exp(lnfac-float64(n)*lx) * (1/float64(n) + 1/x*(0.5+\n\t\tfloat64(n+1)/x*(b2+\n\t\t\tfloat64((n+2)*(n+3))*y*(b4+\n\t\t\t\tfloat64((n+4)*(n+5))*y*(b6+\n\t\t\t\t\tfloat64((n+6)*(n+7))*y*(b8+\n\t\t\t\t\t\tfloat64((n+8)*(n+9))*y*(b10+\n\t\t\t\t\t\t\tfloat64((n+10)*(n+11))*y*(b12+\n\t\t\t\t\t\t\t\tfloat64((n+12)*(n+13))*y*(b14+\n\t\t\t\t\t\t\t\t\tfloat64((n+14)*(n+15))*y*(b16+\n\t\t\t\t\t\t\t\t\t\tfloat64((n+16)*(n+17))*y*(b18+\n\t\t\t\t\t\t\t\t\t\t\tfloat64((n+18)*(n+19))*y*(b20+\n\t\t\t\t\t\t\t\t\t\t\t\tfloat64((n+20)*(n+21))*y*(b22+\n\t\t\t\t\t\t\t\t\t\t\t\t\tfloat64((n+22)*(n+23))*y*(b24+\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tfloat64((n+24)*(n+25))*y*(b26+\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tfloat64((n+26)*(n+27))*y*b28)))))))))))))))\n}", "title": "" }, { "docid": "24afc38c724cebbf56d5a940f1925cfc", "score": "0.45850375", "text": "func pow(x float64, n float64)(result float64){\n\n\tif n == 0{\n\t\treturn 1\n\t}\n\tif n == 1{\n\t\treturn x\n\t}\n\tif n == -1{\n\t\treturn 1/x\n\t}\n\n\tif n < 0{\n\t\tresult = 1/x * pow(x, n + 1)\n\t\treturn result\n\t}\n\tresult = x * pow(x, n - 1)\n\n\treturn result\n}", "title": "" }, { "docid": "f8428cf44a78d95a95ceb65db48c5ac8", "score": "0.4584867", "text": "func (z *E2) MulByNonResidue1Power2(x *E2) *E2 {\n\t// (21575463638280843010398324269430826099269044274347216827212613867836435027261,10307601595873709700152284273816112264069230130616436755625194854815875713954)\n\tz.Mul(x, &nonRes1Pow1to5[1])\n\treturn z\n}", "title": "" }, { "docid": "36a55ee022a6a33560f96133ef46a2a0", "score": "0.45827416", "text": "func Pow(z, x, y *inf.Dec, s inf.Scale) *inf.Dec {\n\ts = s + 2\n\tif z == nil {\n\t\tz = new(inf.Dec)\n\t\tz.SetUnscaled(1).SetScale(0)\n\t}\n\n\t// Check if y is of type int.\n\ttmp := new(inf.Dec).Abs(y)\n\tisInt := tmp.Cmp(new(inf.Dec).Round(tmp, 0, inf.RoundDown)) == 0\n\n\tneg := x.Sign() < 0\n\n\tif !isInt && neg {\n\t\treturn nil\n\t}\n\n\t// Exponent Precision Explanation (RaduBerinde):\n\t// Say we compute the Log with a scale of k. That means that the result we get is:\n\t// ln x +/- 10^-k.\n\t// This leads to an error of y * 10^-k in the exponent, which leads to a\n\t// multiplicative error of e^(y*10^-k) in the result.\n\t// For small values of u, e^u can be approximated by 1 + u, so for large k\n\t// that error is around 1 + y*10^-k. So the additive error will be x^y * y * 10^-k,\n\t// and we want this to be less than 10^-s. This approximately means that k has to be\n\t// s + the number of digits before the decimal point in x^y. Which roughly is\n\t//\n\t// s + <the number of digits before decimal point in x> * y.\n\t//\n\t// exponent precision = s + <the number of digits before decimal point in x> * y.\n\tnumDigits := float64(x.UnscaledBig().BitLen()) / digitsToBitsRatio\n\tnumDigits -= float64(x.Scale())\n\n\t// Round up y which should provide us with a threshold in calculating the new scale.\n\tyu := float64(new(inf.Dec).Round(y, 0, inf.RoundUp).UnscaledBig().Int64())\n\n\t// exponent precision = s + <the number of digits before decimal point in x> * y\n\tes := s + inf.Scale(int32(numDigits*yu))\n\n\ttmp = new(inf.Dec).Abs(x)\n\tLog(tmp, tmp, es)\n\ttmp.Mul(tmp, y)\n\tExp(tmp, tmp, es)\n\n\tif neg && y.Round(y, 0, inf.RoundDown).UnscaledBig().Bit(0) == 1 {\n\t\ttmp.Neg(tmp)\n\t}\n\n\t// Round to the desired scale.\n\treturn z.Round(tmp, s-2, inf.RoundHalfUp)\n}", "title": "" }, { "docid": "6eea26548a8e8e1983e8de055e42e441", "score": "0.4582222", "text": "func (n *OpticalAmplifier_Amplifier_OutputPowerCBandPathAny) Min() *OpticalAmplifier_Amplifier_OutputPowerCBand_MinPathAny {\n\treturn &OpticalAmplifier_Amplifier_OutputPowerCBand_MinPathAny{\n\t\tNodePath: ygot.NewNodePath(\n\t\t\t[]string{\"min\"},\n\t\t\tmap[string]interface{}{},\n\t\t\tn,\n\t\t),\n\t}\n}", "title": "" }, { "docid": "11e17724c1256211a6b7793bab2f1a06", "score": "0.45804945", "text": "func (n *Component_Transceiver_PreFecBerPath) Min() *Component_Transceiver_PreFecBer_MinPath {\n\treturn &Component_Transceiver_PreFecBer_MinPath{\n\t\tNodePath: ygot.NewNodePath(\n\t\t\t[]string{\"min\"},\n\t\t\tmap[string]interface{}{},\n\t\t\tn,\n\t\t),\n\t}\n}", "title": "" }, { "docid": "6b209df4daef97df128c0707bcd4df56", "score": "0.45785692", "text": "func (n *OpticalAmplifier_Amplifier_OutputPowerTotalPathAny) Min() *OpticalAmplifier_Amplifier_OutputPowerTotal_MinPathAny {\n\treturn &OpticalAmplifier_Amplifier_OutputPowerTotal_MinPathAny{\n\t\tNodePath: ygot.NewNodePath(\n\t\t\t[]string{\"min\"},\n\t\t\tmap[string]interface{}{},\n\t\t\tn,\n\t\t),\n\t}\n}", "title": "" }, { "docid": "35d9c4ac53d9e1849d781ed7febbb436", "score": "0.45768663", "text": "func coeffs(constants []complex128) []complex128 {\n\tres := make([]complex128, len(constants)+1)\n\tfor num := 0; num <= len(constants); num++ {\n\t\tsum := complex128(0)\n\t\tif num == 0 {\n\t\t\tsum = 1\n\t\t}\n\t\tcombos := takeNumOfLength(len(constants), num)\n\t\tfor _, parts := range combos {\n\t\t\tprod := complex128(1)\n\t\t\tfor _, part := range parts {\n\t\t\t\tprod *= -constants[part]\n\t\t\t}\n\t\t\tsum += prod\n\t\t}\n\t\tres[num] = sum\n\t}\n\treturn res\n}", "title": "" }, { "docid": "ef76d9c18c8c57d53ab12c7db41bb2fe", "score": "0.4574611", "text": "func (z *E2) MulByNonResidue1Power3(x *E2) *E2 {\n\t// (2821565182194536844548159561693502659359617185244120367078079554186484126554,3505843767911556378687030309984248845540243509899259641013678093033130930403)\n\tz.Mul(x, &nonRes1Pow1to5[2])\n\treturn z\n}", "title": "" }, { "docid": "00427f68eb9a31ecf9cb1af9e0be5d7c", "score": "0.45722517", "text": "func pow(x, n int) int {\n\tr := 1\n\tfor {\n\t\tif n&0x00000001 == 1 {\n\t\t\tr *= x\n\t\t}\n\t\tn /= 2\n\t\tif n == 0 {\n\t\t\tbreak\n\t\t}\n\t\tx *= x\n\t}\n\treturn r\n}", "title": "" }, { "docid": "cb8a58ac9fb342e4bb10a9b0a445e53a", "score": "0.457204", "text": "func (vs Versions) Minus(m Versions) Versions {\n\tns := map[string]Version{}\n\tfor _, p := range vs {\n\t\tns[p[\"name\"]] = p\n\t}\n\tfor _, p := range m {\n\t\tdelete(ns, p[\"name\"])\n\t}\n\tvar nvs Versions\n\tfor _, v := range ns {\n\t\tnvs = append(nvs, v)\n\t}\n\treturn nvs\n}", "title": "" }, { "docid": "b95db4ff2dc5e73ea6b6d661b33699ef", "score": "0.45677963", "text": "func (f FQ2) MultiplyByNonresidue() *FQ2 {\n\treturn &FQ2{\n\t\tc0: f.c0.Sub(f.c1),\n\t\tc1: f.c1.Add(f.c0),\n\t}\n}", "title": "" }, { "docid": "97adc2abd3c445301c0ac8555acb6168", "score": "0.45666468", "text": "func (p Polynomial) Multiply(other Polynomial) Polynomial {\n\tm := make(map[uint]float64)\n\n\tgrade := p.grade + other.grade\n\n\tfor i := uint(0); i <= p.grade; i++ {\n\t\tfor j := uint(0); j <= other.grade; j++ {\n\t\t\ta := p.coefficients[i]\n\t\t\tb := other.coefficients[j]\n\n\t\t\tif checkNotZero(a * b) {\n\t\t\t\tm[i+j] += a * b\n\t\t\t}\n\t\t}\n\t}\n\n\treturn Polynomial{m, grade}\n}", "title": "" }, { "docid": "59ee2c0d801e2a2733e0f00261869f20", "score": "0.45666245", "text": "func (z *poly) Mod(a *poly, n int64, r int64) *poly {\n\tif n == 32 {\n\t\tfor i := 0; i < 32; i++ {\n\t\t\tz.coeffs[i] += BigNumberMultiplication(a.coeffs[i+32], r)\n\t\t\tz.coeffs[i] = reduce(z.coeffs[i])\n\t\t}\n\t}\n\treturn z\n}", "title": "" }, { "docid": "a006b3efffe52f2e75f49b7b2b4a2639", "score": "0.45599145", "text": "func (n *System_Cpu_SoftwareInterruptPath) Min() *System_Cpu_SoftwareInterrupt_MinPath {\n\treturn &System_Cpu_SoftwareInterrupt_MinPath{\n\t\tNodePath: ygot.NewNodePath(\n\t\t\t[]string{\"min\"},\n\t\t\tmap[string]interface{}{},\n\t\t\tn,\n\t\t),\n\t}\n}", "title": "" } ]
aa7dfb3d5365591013b0f42b9f065703
setupSlice initialises a slice of numbers up to and including limit starting from 0
[ { "docid": "f05c6d7103031cdb4ce2d8c2363629a9", "score": "0.7675083", "text": "func setupSlice(limit int) []int {\n\tintegers := make([]int, limit)\n\n\t// Keeping first two values as 0 as they aren't taken into account\n\tfor i := 2; i < limit; i++ {\n\t\tintegers[i] = i\n\t}\n\n\treturn integers\n}", "title": "" } ]
[ { "docid": "b5a01cead5b64273a3251d58f2637277", "score": "0.6114934", "text": "func page31_MakingSlices() {\n\tprintSlice := func(s string, x []int) {\n\t\tfmt.Printf(\"%s len=%d cap=%d %v\\n\", s, len(x), cap(x), x)\n\t}\n\n\ta := make([]int, 5)\n\tprintSlice(\"a\", a)\n\n\tb := make([]int, 0, 5)\n\tprintSlice(\"b\", b)\n\n\tc := b[0:2]\n\tprintSlice(\"c\", c)\n\n\td := c[2:5]\n\tprintSlice(\"d\", d)\n}", "title": "" }, { "docid": "06d8630b86d522bac78f64114089cd8f", "score": "0.59954214", "text": "func MakeRange(start, count int) []int {\n a := make([]int, count)\n for i := range a {\n a[i] = start + i\n }\n return a\n}", "title": "" }, { "docid": "2429df7bf3fad8fc12413c87998eb305", "score": "0.5963116", "text": "func FromLimitOffset(limit, offset, count int64) Paginate {\n\tif count < 0 {\n\t\tcount = 0\n\t}\n\tif limit <= 0 {\n\t\tlimit = 1\n\t}\n\tif offset < 0 {\n\t\toffset = 0\n\t} else if offset > count {\n\t\toffset = count\n\t}\n\treturn Paginate{\n\t\tpage: offset/limit + 1,\n\t\tperPage: limit,\n\t\titems: count,\n\t}\n}", "title": "" }, { "docid": "157b508fbb3c3f04c66c47083a604f9d", "score": "0.5941635", "text": "func SetSliceInitialCap(initialCap int) {\n\tif initialCap > 0 {\n\t\tsliceInitialCap = initialCap\n\t}\n}", "title": "" }, { "docid": "a4c7a9beafd6be56e91d6a12c9eab681", "score": "0.5806129", "text": "func printSliceMake(s string, x []int) {\n\tfmt.Printf(\"%s len=%d cap=%d %v\\n\",\n\t\ts, len(x), cap(x), x)\n}", "title": "" }, { "docid": "f6e291f5faae016984b2738b046d037e", "score": "0.57004255", "text": "func CreateSlice(elemNum int) []int {\n\tintSlice := make([]int, 0, 10)\n\tfor i := 0; i < elemNum; i++ {\n\t\tintSlice = append(intSlice, i)\n\t}\n\treturn intSlice\n}", "title": "" }, { "docid": "7ffe0afbe0a65725e5d78e924a36966e", "score": "0.5656907", "text": "func makeSlice1(elmSize int, slen int, scap int) []uint8", "title": "" }, { "docid": "39518da57c82b57d3a69d2ccf1027583", "score": "0.56190294", "text": "func generateSlice(size int) []int {\n\n\tslice := make([]int, size, size)\n\trand.Seed(time.Now().UnixNano())\n\tfor i := 0; i < size; i++ {\n\t\tslice[i] = rand.Intn(999) - rand.Intn(999)\n\t}\n\treturn slice\n}", "title": "" }, { "docid": "39518da57c82b57d3a69d2ccf1027583", "score": "0.56190294", "text": "func generateSlice(size int) []int {\n\n\tslice := make([]int, size, size)\n\trand.Seed(time.Now().UnixNano())\n\tfor i := 0; i < size; i++ {\n\t\tslice[i] = rand.Intn(999) - rand.Intn(999)\n\t}\n\treturn slice\n}", "title": "" }, { "docid": "39518da57c82b57d3a69d2ccf1027583", "score": "0.56190294", "text": "func generateSlice(size int) []int {\n\n\tslice := make([]int, size, size)\n\trand.Seed(time.Now().UnixNano())\n\tfor i := 0; i < size; i++ {\n\t\tslice[i] = rand.Intn(999) - rand.Intn(999)\n\t}\n\treturn slice\n}", "title": "" }, { "docid": "d76150e2cdca6dd97332a4cab24c0e9d", "score": "0.5599078", "text": "func CreateRandomSlice (size int, lower int, upper int) []int {\n\t_slice := make([]int, size)\n\tvar \t_index int;\n\n\tfor _index < size {\n\t\t_slice [_index] = generateRandomInt (lower, upper);\n\t\t_index++;\n\t}\n\treturn _slice;\n}", "title": "" }, { "docid": "f72b15b56595c1b0f325b3b8a7cda24f", "score": "0.55871826", "text": "func SliceBegin(s interface{}) RandomReadWriter {\n\treturn sliceIter{\n\t\ts: reflect.ValueOf(s),\n\t}\n}", "title": "" }, { "docid": "f72923a8c257b79fed2d63db9624fd1a", "score": "0.55431896", "text": "func generateSlice(size int) []int {\r\n\r\n\tslice := make([]int, size, size)\r\n\trand.Seed(time.Now().UnixNano())\r\n\tfor i := 0; i < size; i++ {\r\n\t\tslice[i] = rand.Intn(99999) - rand.Intn(99999)\r\n\t}\r\n\treturn slice\r\n}", "title": "" }, { "docid": "fef5e6e9ea31415dfab7e219893171c1", "score": "0.55179983", "text": "func generateSlice(size int) []int {\n\n\tslice := make([]int, size, size)\n\trand.Seed(time.Now().UnixNano())\n\tfor i := 0; i < size; i++ {\n\t\tslice[i] = rand.Intn(99999) - rand.Intn(99999)\n\t}\n\treturn slice\n}", "title": "" }, { "docid": "99681819d9d4706dededa267c2c9ea7b", "score": "0.5504543", "text": "func GenerateSlice(size int) []int {\n\tslice := make([]int, size, size)\n\trand.Seed(time.Now().UnixNano())\n\tfor i := 0; i < size; i++ {\n\t\tslice[i] = rand.Intn(999) - rand.Intn(999)\n\t}\n\treturn slice\n}", "title": "" }, { "docid": "78aa2df6576721bd4ff0808b83a1eda9", "score": "0.5488635", "text": "func Slices5() {\n\trolls := []int{19: 200}\n\tfmt.Println(\"Capacity:\", cap(rolls)) // 20\n\tfmt.Println(\"Length:\", len(rolls)) // 20\n}", "title": "" }, { "docid": "77b3eec9f814a415b1b4e74430953d2f", "score": "0.54836434", "text": "func makeSlice(n int) []byte {\n\t// If the make fails, give a known error.\n\tdefer func() {\n\t\tif recover() != nil {\n\t\t\tpanic(ErrTooLarge)\n\t\t}\n\t}()\n\treturn make([]byte, n)\n}", "title": "" }, { "docid": "39ed0deef68c8c0f9cb11a9177ec8ab9", "score": "0.5476416", "text": "func Slice(full []models.Dimension, offset, limit int) (sliced []models.Dimension) {\n\tend := offset + limit\n\tif end > len(full) {\n\t\tend = len(full)\n\t}\n\n\tif offset > len(full) {\n\t\treturn []models.Dimension{}\n\t}\n\treturn full[offset:end]\n}", "title": "" }, { "docid": "7c595abc55fe35efadc418af6d439253", "score": "0.5444518", "text": "func (s SliceT) Take(n int) SliceT", "title": "" }, { "docid": "f09261e316878a6f40baeda04dd85086", "score": "0.5439078", "text": "func Slices9() {\n\tslice := []int{10, 20, 30, 40, 50}\n\tfmt.Printf(\"%v\\n\", slice)\n\tsliceOne := slice[1:3]\n\tfmt.Printf(\"sliceOne: %v, slice: %v\\n\", sliceOne, slice)\n\t// sliceOne: [20, 30], slice: [10, 20, 30, 40, 50]\n\tfmt.Printf(\"len: %d, cap: %d\\n\", len(sliceOne), cap(sliceOne)) // len: 2, cap: 4\n\n\tsliceOne[1] = 70\n\tfmt.Printf(\"sliceOne: %v, slice: %v\\n\", sliceOne, slice)\n\t// sliceOne: [20, 70], slice: [10, 20, 70, 40, 50]\n\t// The above output shows that the slice in a slice is just a window in original slice\n\n\t// If original slice has len: 5 (olen) and cap: 5 (ocap), then formula for len and cap\n\t// of slice out of it:\n\t// nslice = oslice[i:j] => len(nslice) == (j-i), cap(nslice) == (ocap - i)\n\n\t// sliceOne[3] = 100\n\t// The above gives: panic: runtime error: index out of range [3] with length 2\n\t// Reason: len(sliceOne) is 2 (0, 1 indexes), so we can't access beyond the length\n\t// even though the capacity is higher (4)\n}", "title": "" }, { "docid": "a237d50cc6086df05438f4a0aa7c6cd4", "score": "0.5412771", "text": "func subSliceLeft (initialPosition int, list []int) (int, []int){\n sliceHalf := len(list)/2\n roundSliceHalf := int(math.Round(float64(len(list))/2))\n result := make([]int, roundSliceHalf)\n\n copy(result, list[0 : sliceHalf])\n //fmt.Println(fmt.Sprint(list) + \" -> \" + fmt.Sprint(result))\n //fmt.Println(\"returns \" + strconv.Itoa(initialPosition))\n\n return initialPosition, result\n}", "title": "" }, { "docid": "b8a00113f4c9e7c1c26a4c4708ad7531", "score": "0.53884214", "text": "func (seq Seq) Slice(from, to Int) Seq {\n\treturn Seq{seq.contents[from.Int():to.Int()], seq.isString}\n}", "title": "" }, { "docid": "e346c5b332b597ae91c889604322e831", "score": "0.53716743", "text": "func WierdSlice(src []int, slicelen int) ([]int, error) {\n\tif slicelen > len(src) {\n\t\treturn nil, errors.New(\"invalid slice len\")\n\t}\n\tsl := src[0:slicelen] // HL\n\tfmt.Println(\"new\")\n\tinspect(sl)\n\n\tsl = append(sl, 500)\n\tfmt.Println(\"original\")\n\tinspect(src)\n\n\tfmt.Println(\"new after append\")\n\tinspect(sl)\n\n\treturn sl, nil\n}", "title": "" }, { "docid": "fb1785af8b570fb5d1e3b62df8e631cb", "score": "0.53535813", "text": "func generateIntSlice(n int) []int {\n\tx := make([]int, 0, n)\n\tfor i := 0; i < n; i++ {\n\t\tx = append(x, n)\n\t}\n\treturn x\n}", "title": "" }, { "docid": "f11d6eb60b8ff55f3ffad7517672fc84", "score": "0.5347592", "text": "func makeSlice(n int) []byte {\n\t// If the make fails, give a known error.\n\tdefer func() {\n\t\tif recover() != nil {\n\t\t\tpanic(bytes.ErrTooLarge)\n\t\t}\n\t}()\n\treturn make([]byte, n)\n}", "title": "" }, { "docid": "3b1fd460cdc494bc4b318cd1cf257de1", "score": "0.5343437", "text": "func initialisePocketDim(startingSlice [][]int, sizeOverride int) [][][]int {\n\tconst DEFAULT_POCKET_SIZE = 24\n\tsize := DEFAULT_POCKET_SIZE\n\n\tif sizeOverride > 0 {\n\t\tsize = sizeOverride\n\t}\n\n\tif len(startingSlice) >= size {\n\t\tlog.Fatalf(\"Dimension not big enough (%v) for starting slice (%v)\\n\", size, len(startingSlice))\n\t}\n\n\tpocketDimension := makeEmptyDimension(size)\n\n\t// copy in slice\n\t// assumes slice is square, but does not have to be odd/even in length\n\n\thalfDim := size / 2\n\thalfSlice := len(startingSlice) / 2\n\tstartPos := halfDim - halfSlice\n\n\t// (z,) y, x refer to dim; i, j to the slice\n\tfor y, i := startPos, 0; i < len(startingSlice); i++ {\n\n\t\tfor x, j := startPos, 0; j < len(startingSlice); j++ {\n\t\t\tpocketDimension[halfDim][y][x] = startingSlice[i][j]\n\t\t\tx++\n\t\t}\n\n\t\ty++\n\t}\n\n\treturn pocketDimension\n}", "title": "" }, { "docid": "c6030ab6bc0dd74389e1d84b0548c923", "score": "0.53047436", "text": "func (fb *FB) Slice(m, n int) Slice {\n\tif fb.buf0 == nil {\n\t\tpanicSingleBuffer()\n\t}\n\treturn Slice{fb: fb, m: byte(m), n: byte(n), p: byte(m)}\n}", "title": "" }, { "docid": "1dd2f3078a2e87481b1a62266914f6a3", "score": "0.53030044", "text": "func main() {\n\ts := []int{2, 3, 5, 7, 11, 13}\n\ts = s[:0]\n\tP(s, \"s[:0]\")\n\n\ts = s[:4]\n\tP(s, \"s[:4]\")\n\n\ts = s[2:]\n\tP(s, \"s[2:]\")\n}", "title": "" }, { "docid": "38926925655f9ee85969a54fcc3af9d0", "score": "0.5286786", "text": "func page30_SlicingSlices() {\n\tp := []int{2, 3, 5, 7, 11, 13}\n\tfmt.Println(\"p ==\", p)\n\n\toneToFour := p[1:4]\n\tfmt.Println(\"\\noneToFour := p[1:4]\")\n\tfmt.Println(\"oneToFour ==\", oneToFour) // [3, 5, 7]\n\tfmt.Println(\"p ==\", p) // [2, 3, 5, 7, 11, 13]\n\n\tp[3] = -1\n\t/*\n\t * In fact, oneToFour and p points to the same array. So any changes made\n\t * to either slice is visible for other slices.\n\t */\n\tfmt.Println(\"\\np[3] = -1\")\n\tfmt.Println(\"p ==\", p) // [2, 3, 5, -1, 11, 13]\n\tfmt.Println(\"oneToFour == \", oneToFour) // [3, 5, -1]\n\n\tfmt.Println(\"\\np[:3] ==\", p[:3])\n\tfmt.Println(\"p[4:] ==\", p[4:])\n}", "title": "" }, { "docid": "c9b5e78bdf2c92687eebeffbdae55bd6", "score": "0.52203333", "text": "func IntSlice() {\r\n\t/* NOTE: \"pretty print\" as much as possible\r\n\t 1. Use the make function to create a slice of 0 integers named \"numbers\"\r\n\t 2. Use %v to print the slice in its default format\r\n\t 3. Print the length of the slice\r\n\t 4a. Use a \"counting\" loop to prompt for and read in 5 values for \"numbers\"\r\n\t 4b. Use the append function to add the input values into \"numbers\"\r\n\t 5. Use %v to print the slice in its default format\r\n\t 6. Print the length of the slice*/\r\n\tnumbers := make([]int, 0)\r\n\tfmt.Printf(\"Slice in default: %v\\n\", numbers)\r\n\tfmt.Printf(\"Length of slice: %v\\n\", len(numbers))\r\n\tfor i := 0; i < 5; i++ {\r\n\t\tpInput := 0\r\n\t\tfmt.Printf(\"Please enter an integer value.\\n\")\r\n\t\tfmt.Scanln(&pInput)\r\n\t\tnumbers = append(numbers, pInput)\r\n\t}\r\n\tfmt.Printf(\"slice default: %v\\n\", numbers)\r\n\tfmt.Printf(\"the length: %v\\n\", len(numbers))\r\n\tfmt.Scanln()\r\n}", "title": "" }, { "docid": "58463ed2f6a551bfd543608c684ea027", "score": "0.521469", "text": "func makePagerSlice(totalRows, crtPageNum int) []map[string]interface{} {\n\tpageCount := getPageCount(totalRows)\n\tresult := make([]map[string]interface{}, pageCount)\n\tfor i := 0; i < pageCount; i++ {\n\t\tfirst := 1 + i*ROWS_PER_PAGE\n\t\tlast := first + ROWS_PER_PAGE - 1\n\t\tif last > totalRows {\n\t\t\tlast = totalRows\n\t\t}\n\t\tresult[i] = map[string]interface{}{\n\t\t\t\"first\": first,\n\t\t\t\"last\": last,\n\t\t\t\"optionVal\": i + 1,\n\t\t\t\"selected\": i+1 == crtPageNum,\n\t\t}\n\t}\n\treturn result\n}", "title": "" }, { "docid": "0f882083bb5a0ffbd98844085a0d996f", "score": "0.52069175", "text": "func Slice(start, end int, itr i.RandomAccess) i.RandomAccess {\n\ts := slice{start: start, cur: start, end: end}\n\ts.WRandomAccess = *(itk.WrapRandomAccess(itr))\n\ts.Goto(0)\n\treturn &s\n}", "title": "" }, { "docid": "2e2cc57a16e66cb675b3c67ab6a26492", "score": "0.52061456", "text": "func TestSliceExpand(t *testing.T) {\n\tslices := make([]int, 5)\n\t//len:0 cap:5\n\tfmt.Printf(\"origin len:%d,cap:%d \\n\", len(slices), cap(slices))\n\n\t//len:5 cap:5 * 2 = 10\n\tslices = append(slices, 2)\n\tfmt.Printf(\"origin len:%d,cap:%d \\n\", len(slices), cap(slices))\n}", "title": "" }, { "docid": "fe83f83cf97097df9a35f1381ab9ea90", "score": "0.52017957", "text": "func main() {\n\n\t// Since in the previous exercise, we used different values, we will create a new slice in this exercise\n\t// that contains all the relevant values above.\n\n\ts := []int{42, 43, 44, 45, 46, 47, 48, 49, 50, 51}\n\n\t// slicing means that with our variable, we will choose a range from the index to work with\n\t// We do this with the notation <variable>[x:y]\n\n\t// For the first slice, we are capturing the first 5 values\n\t// Note: when slicing, the first value is included in the range, but the second value is not\n\t// That means we will need our slice to read [0:5], or just [:5]\n\tx := s[:5]\n\tfmt.Println(x)\n\n\t// The second slice looks like it ranges the last 5 values, so our slice will read [5:]\n\ty := s[5:]\n\tfmt.Println(y)\n\n\t// The third slice is from the 3rd to 7th value so our slice is [3:8]\n\tz := s[3:8]\n\tfmt.Println(z)\n\n\t// The last slice is from the 2nd to 6th value so our slice is [2:7]\n\tw := s[2:7]\n\tfmt.Println(w)\n}", "title": "" }, { "docid": "39768d4b86c62a08874dda958dacb615", "score": "0.5182822", "text": "func (slice *plasmaSlice) startWriters(numWriters int) {\n\n\t// If slice already have more writers that the desired number, return.\n\tif slice.numWriters >= numWriters {\n\t\treturn\n\t}\n\n\t// If desired number is more than length of the slice, then need to resize.\n\tif numWriters > len(slice.cmdCh) {\n\t\tslice.stopWriters(0)\n\t\tslice.initWriters(numWriters)\n\t}\n\n\t// update the number of slice writers\n\tslice.numWriters = numWriters\n}", "title": "" }, { "docid": "75c3ce0119fa3ca3d89986e37a87bf97", "score": "0.5179411", "text": "func Slice(r Rope, start, end int64) Rope {\n\t_, r = split(r, start)\n\tr, _ = split(r, end-start)\n\treturn r\n}", "title": "" }, { "docid": "9be74f951a701d8afa601111d8ca7451", "score": "0.51777273", "text": "func (s *f32) Slice(start, end int) Floating {\n\tstart = s.BufferIndex(0, start)\n\tend = s.BufferIndex(0, end)\n\treturn &f32{\n\t\tchannels: s.channels,\n\t\tbuffer: s.buffer[start:end],\n\t}\n}", "title": "" }, { "docid": "6db7ca9f7ed8e0ba7b83572f49b3d906", "score": "0.5175834", "text": "func (q *Query) Slice(offset, limit int) *Query {\n\tq.Offset = offset\n\tq.Limit = limit\n\treturn q\n}", "title": "" }, { "docid": "01f0c8fecb3087db81c4eab9c3f82a47", "score": "0.5161045", "text": "func TestSLices() {\n\tprint(\"======\\nTest slices\\n\")\n\tvar arr1, arr3 []int\n\tarr1 = make([]int, 2)\n\tarr1[0] = 10\n\tarr1[1] = 20\n\n\tarr2 := []int{3, 6, 7}\n\t// Append examples\n\tarr3 = append(arr3, 1, 4, 5)\n\tarr3 = append(arr3, arr1...)\n\tarr3 = append(arr3, []int{7}...)\n\tfmt.Printf(\"Slices: \\n\\t %#v \\n\\t %#v \\n\\t %#v \\n\", arr1, arr2, arr3)\n\n\tfmt.Printf(\"Slice: \\n\\t length:\\t %d \\n\\t capacity:\\t %d \\n \",\n\t\tlen(arr3), cap(arr3))\n\n\t// From index (including)\n\tstartIndex := 4\n\t// get items count, including start index\n\tsliceLength := 2\n\tfmt.Printf(\"Slice [%d:%d]: \\n\\t %#v \\n\",\n\t\tstartIndex, sliceLength,\n\t\tarr3[startIndex:startIndex+sliceLength])\n\n\t// From index (including)\n\tstartIndex = 4\n\t// get items count, including start index\n\t// Slice lenth get via capacity of array\n\tsliceLength = cap(arr3) - startIndex\n\tfmt.Printf(\"Slice [%d:%d]: \\n\\t %#v \\n\",\n\t\tstartIndex, sliceLength,\n\t\tarr3[startIndex:startIndex+sliceLength])\n\ttestSliceReturn(arr3, arr2)\n\tfmt.Printf(\"Changed slice: \\n\\t %v \\n\\t %v \\n\", arr3, arr2)\n}", "title": "" }, { "docid": "0d406e992fb58786ac5929ed8accc001", "score": "0.5152714", "text": "func NewFromSlice(a []int) (r Bitset) {\n\tfor i, v := range a {\n\t\tif v < 0 {\n\t\t\tlog.Fatalf(\"All values in the slice must be positive. Saw %d at index %d\", v, i)\n\t\t}\n\t\tr = r + Bitset(pow(2, v))\n\t}\n\treturn\n}", "title": "" }, { "docid": "a9257d7e7247f9f54bde0d832e091a34", "score": "0.5149782", "text": "func (s *Slice) Slice(start, end int) *Slice {\n\tnewEnd := s.start + start + (end - start)\n\tif start < 0 || newEnd > s.end {\n\t\tpanic(errOutOfBounds)\n\t}\n\treturn &Slice{\n\t\tvector: s.vector,\n\t\tstart: s.start + start,\n\t\tend: newEnd,\n\t}\n}", "title": "" }, { "docid": "582c769bc31315d2570b2eb1d3118503", "score": "0.5141817", "text": "func (hmm *HMM) Slice(start, end int) *HMM {\n\tnodes := make([]HMMNode, end-start)\n\tcopy(nodes, hmm.Nodes[start:end])\n\tlast := len(nodes) - 1\n\tnodes[last].Transitions.MM = 0\n\tnodes[last].Transitions.MI = MinProb\n\tnodes[last].Transitions.MD = MinProb\n\tnodes[last].Transitions.IM = 0\n\tnodes[last].Transitions.II = MinProb\n\tnodes[last].Transitions.DM = 0\n\tnodes[last].Transitions.DD = MinProb\n\n\treturn &HMM{\n\t\tNodes: nodes,\n\t\tAlphabet: hmm.Alphabet,\n\t\tNull: hmm.Null,\n\t}\n}", "title": "" }, { "docid": "410888979a3e0d4a2d28dc8487c9c0a2", "score": "0.5137992", "text": "func (l Layout) Slice(start, end int) Layout {\n\tif start == end || end == 0 || start == len(l.Clusters) {\n\t\treturn Layout{}\n\t}\n\tnewRuneStart := l.Clusters[start].Runes.Offset\n\trunesBefore := newRuneStart - l.Runes.Offset\n\tendCluster := l.Clusters[end-1]\n\tstartCluster := l.Clusters[start]\n\trunesAfter := l.Runes.Offset + l.Runes.Count - (endCluster.Runes.Offset + endCluster.Runes.Count)\n\n\tif l.Direction.Progression() == system.TowardOrigin {\n\t\tstartCluster, endCluster = endCluster, startCluster\n\t}\n\tglyphStart := startCluster.Glyphs.Offset\n\tglyphEnd := endCluster.Glyphs.Offset + endCluster.Glyphs.Count\n\n\tout := l\n\tout.Clusters = nil\n\tout.Glyphs = out.Glyphs[glyphStart:glyphEnd]\n\tout.Runes.Offset = newRuneStart\n\tout.Runes.Count -= runesBefore + runesAfter\n\n\treturn out\n}", "title": "" }, { "docid": "345132d02279e194fa8d9746bd623165", "score": "0.5123152", "text": "func makeRange(first, last uint) []uint {\n\tif first > last {\n\t\tpanic(fmt.Errorf(\"invalid range (%d..%d)\", first, last))\n\t}\n\ts := make([]uint, 0, last-first+1)\n\tfor ; first <= last; first++ {\n\t\ts = append(s, first)\n\t}\n\treturn s\n}", "title": "" }, { "docid": "ab2d8eb29bba9a93fa83d539b9fdb9a1", "score": "0.5117007", "text": "func printSlice(s string, x []int) {\n\tfmt.Printf(\"%s\\t len=%d cap=%d\\t %v\\n\",\n\t\ts, len(x), cap(x), x)\n}", "title": "" }, { "docid": "00ee37d01b48b30a333db1a508261f0e", "score": "0.5115461", "text": "func (vp *cVectorParty) Slice(startRow int, numRows int) (vector common.SlicedVector) {\n\tbeginIndex := startRow\n\t// size is the number of entries in the vector,\n\t// size != numRows when compressed,\n\t// although here size is initialized as if vector is uncompressed.\n\tsize := vp.length - beginIndex\n\tif size < 0 {\n\t\tsize = 0\n\t}\n\tif size > numRows {\n\t\tsize = numRows\n\t}\n\n\tmode := vp.GetMode()\n\tif mode == common.AllValuesDefault && size > 0 {\n\t\tsize = 1\n\t} else if mode == common.HasCountVector {\n\t\t// find the indexes [beginIndex, endIndex) based on [startRow, startRow + numRows)\n\t\tlowerCount := uint32(startRow)\n\t\tupperCount := uint32(startRow + numRows)\n\t\tbeginIndex = vp.counts.UpperBound(0, vp.counts.Size, unsafe.Pointer(&lowerCount)) - 1\n\t\tendIndex := vp.counts.LowerBound(beginIndex, vp.counts.Size, unsafe.Pointer(&upperCount))\n\t\t// subtract endIndex by 1 when endIndex points to vp.length+1\n\t\tif endIndex == vp.counts.Size {\n\t\t\tendIndex -= 1\n\t\t}\n\t\tsize = endIndex - beginIndex\n\t}\n\n\tvector = common.SlicedVector{\n\t\tValues: make([]interface{}, size),\n\t\tCounts: make([]int, size),\n\t}\n\n\tfor i := 0; i < size; i++ {\n\t\tif mode == common.AllValuesDefault {\n\t\t\tvector.Values[i] = vp.defaultValue.ConvertToHumanReadable(vp.dataType)\n\t\t\tvector.Counts[i] = numRows\n\t\t\tif vector.Counts[i] > vp.length {\n\t\t\t\tvector.Counts[i] = vp.length\n\t\t\t}\n\t\t} else if mode == common.HasCountVector {\n\t\t\t// compressed\n\t\t\tvector.Values[i] = vp.GetDataValue(beginIndex + i).ConvertToHumanReadable(vp.dataType)\n\t\t\tcount := int(*(*uint32)(vp.counts.GetValue(beginIndex + i + 1))) - startRow\n\t\t\tif count > numRows {\n\t\t\t\tcount = numRows\n\t\t\t}\n\t\t\tvector.Counts[i] = count\n\t\t} else {\n\t\t\t// uncompressed\n\t\t\tvector.Values[i] = vp.GetDataValue(beginIndex + i).ConvertToHumanReadable(vp.dataType)\n\t\t\tvector.Counts[i] = i + 1\n\t\t}\n\t}\n\n\treturn vector\n}", "title": "" }, { "docid": "9061a1e208ef44d8258763d35edf992e", "score": "0.510849", "text": "func NewSlice(capacity int, debug bool) *Slice {\n\treturn &Slice{values: make([]int, capacity), debug: debug}\n}", "title": "" }, { "docid": "fc369df65674ff317ac4888c123844d9", "score": "0.51020086", "text": "func extendSlice(ba []byte, n int) []byte {\n\tfor k := 0; k < n; k++ {\n\t\tba = append(ba, 0x0)\n\t}\n\treturn ba\n}", "title": "" }, { "docid": "c79c467202d15946600ddbc9cd511462", "score": "0.50991416", "text": "func divSlice(buf []byte, n int) [][]byte {\n\treturn [][]byte{buf[:n], buf[n:]}\n}", "title": "" }, { "docid": "c129410614ad02fdd67678dcebeed425", "score": "0.509515", "text": "func batchIntSlice(s []int, batchSize int) [][]int {\n\tbatches := [][]int{}\n\tfor len(s) > batchSize {\n\t\tbatches = append(batches, s[:batchSize])\n\t\ts = s[batchSize:]\n\t}\n\n\tif len(s) > 0 {\n\t\tbatches = append(batches, s)\n\t}\n\n\treturn batches\n}", "title": "" }, { "docid": "c853f0ba9819da75c74518cdc72574da", "score": "0.5078517", "text": "func make_chain_from_slice(from_slice []Block) []Block{\n\tvar new_chain []Block\n\tfor i := range from_slice {\n\t\tnew_chain = append(new_chain, from_slice[i])\n\t}\n\treturn new_chain\n}", "title": "" }, { "docid": "92af7909a7c08ad67514c1b1b97d62bd", "score": "0.5077329", "text": "func Slice(str string, limit int) string {\n\tif len(str) > limit {\n\t\treturn str[0:limit]\n\t}\n\treturn str\n}", "title": "" }, { "docid": "28c30c699686950e8e8b565c39665636", "score": "0.507555", "text": "func Slice(v interface{}) { sliceFunc(globalFaker.Rand, v) }", "title": "" }, { "docid": "e9d016929934f91d3360852ea6e5ab6c", "score": "0.5071253", "text": "func printSlice(s string, x []int) {\n\tfmt.Printf(\"%s len=%d cap=%d %v\\n\",\n\t\ts, len(x), cap(x), x)\n}", "title": "" }, { "docid": "24725b5bf8cd4abb25b22558f8ddd5d9", "score": "0.5067665", "text": "func main() {\n\tarreglo := [3]int{1,2,3}\n\tslice := arreglo[0:]\n\tfmt.Println(slice)\n\n\t//aqui un ejemplo de como utilizar un make\n\tslice1 := make([]int, 3, 5) //como tercer parametro el capasity .\n\tfmt.Println(cap(slice1))\n\n\tslice1 = append(slice1,2)\n\tfmt.Println(slice1)\n\n}", "title": "" }, { "docid": "d61a7ffac7c86b45167d06d0e01b8258", "score": "0.50565594", "text": "func createPageNumberRange(index, total, numbers int) []int {\n\tvar pageNumbers []int\n\tswitch {\n\tcase index > total-numbers && total > numbers:\n\t\tstart := total - numbers + 1\n\t\tpageNumbers = make([]int, numbers)\n\t\tfor i := range pageNumbers {\n\t\t\tpageNumbers[i] = start + i\n\t\t}\n\tcase index >= numbers && total > numbers:\n\t\tstart := index - numbers + 1\n\t\tpageNumbers = make([]int, int(math.Min(float64(numbers), float64(index+1))))\n\t\tfor i := range pageNumbers {\n\t\t\tpageNumbers[i] = start + i\n\t\t}\n\tdefault:\n\t\tpageNumbers = make([]int, int(math.Min(float64(numbers), float64(total))))\n\t\tfor i := range pageNumbers {\n\t\t\tpageNumbers[i] = i + 1\n\t\t}\n\t}\n\treturn pageNumbers\n}", "title": "" }, { "docid": "6f821e48ec291e435998567fc5157de0", "score": "0.5051711", "text": "func PrefilledSlice(value, length int) []int {\n if length < 0 {\n return make([]int, 0)\n }\n\tnewSlice := make([]int, length)\n for k := range newSlice {\n newSlice[k] = value\n }\n\treturn newSlice\n}", "title": "" }, { "docid": "d0f77813d0173755d2dc0195a4655e6d", "score": "0.5038976", "text": "func (f *Faker) Slice(v interface{}) { sliceFunc(f.Rand, v) }", "title": "" }, { "docid": "e4b12a837467b07f8cd45d52bedc1d7c", "score": "0.50314033", "text": "func makeRange(min, max int) []int {\n\ta := make([]int, max-min+1)\n\tfor i := range a {\n\t\ta[i] = min + i\n\t}\n\treturn a\n}", "title": "" }, { "docid": "e4b12a837467b07f8cd45d52bedc1d7c", "score": "0.50314033", "text": "func makeRange(min, max int) []int {\n\ta := make([]int, max-min+1)\n\tfor i := range a {\n\t\ta[i] = min + i\n\t}\n\treturn a\n}", "title": "" }, { "docid": "e4b12a837467b07f8cd45d52bedc1d7c", "score": "0.50314033", "text": "func makeRange(min, max int) []int {\n\ta := make([]int, max-min+1)\n\tfor i := range a {\n\t\ta[i] = min + i\n\t}\n\treturn a\n}", "title": "" }, { "docid": "660910b7d8e420f7c33fc5ceb6d80569", "score": "0.50201863", "text": "func (b Buffer) Slice(start int64, len int) Buffer {\n\tif b == nil || BufferSize(start) >= b.Size() || start < 0 {\n\t\treturn nil\n\t}\n\tend := BufferSize(start + int64(len))\n\tresult := Buffer(make([][]float64, b.NumChannels()))\n\tfor i := range b {\n\t\tif end > b.Size() {\n\t\t\tend = b.Size()\n\t\t}\n\t\tresult[i] = append(result[i], b[i][start:end]...)\n\t}\n\treturn result\n}", "title": "" }, { "docid": "549ca2b3c94e9b23926fe3c04627064a", "score": "0.50196534", "text": "func S(start int, opt ...int) tensor.Slice {\n\tvar end, step int\n\tif len(opt) > 0 {\n\t\tend = opt[0]\n\t} else {\n\t\tend = start + 1\n\t}\n\n\tstep = 1\n\tif len(opt) > 1 {\n\t\tstep = opt[1]\n\t} else if end == start+1 {\n\t\tstep = 0\n\t}\n\n\treturn &sli{\n\t\tstart: start,\n\t\tend: end,\n\t\tstep: step,\n\t}\n}", "title": "" }, { "docid": "89f6b22ea4f44d0faf0659f5038de3ab", "score": "0.50113666", "text": "func printSlice(s []int) {\n\tfmt.Printf(\"len=%d cap=%d %v\\n\", len(s), cap(s), s)\n}", "title": "" }, { "docid": "89f6b22ea4f44d0faf0659f5038de3ab", "score": "0.50113666", "text": "func printSlice(s []int) {\n\tfmt.Printf(\"len=%d cap=%d %v\\n\", len(s), cap(s), s)\n}", "title": "" }, { "docid": "cb22d9976e8d548a2f57b74b698216ea", "score": "0.5004814", "text": "func main() {\n\tvar s []int\n\tprintSlice(s) // len=0 cap=0 []\n\n\ts = append(s, 0)\n\tprintSlice(s) // len=1 cap=1 [0]\n\n\ts = append(s, 2, 3, 4)\n\tprintSlice(s) // len=4 cap=4 [0 2 3 4]\n}", "title": "" }, { "docid": "b23ecc48f2bdc901a84ba5248337d2f7", "score": "0.5003138", "text": "func makeRange(min, max int) []int {\n\ta := make([]int, max-min)\n\tfor i := range a {\n\t\ta[i] = min + i\n\t}\n\treturn a\n}", "title": "" }, { "docid": "9d6b8d0d42a17bd6b189334159bd873b", "score": "0.49914584", "text": "func (s *GrowableByteSlice) slice(start, end int64) []byte {\n\tif start > end {\n\t\tpanic(fmt.Sprintf(\"start(%d) > end(%d)\", start, end))\n\t}\n\n\tif end > int64(len(s.data)) {\n\t\ts.Resize(int64(end))\n\t}\n\n\treturn s.data[start:end]\n}", "title": "" }, { "docid": "fb9201f868379ea1cb7b151e428d54fc", "score": "0.49906898", "text": "func TestGenerateSlice(t *testing.T) {\n\tvar lengths = []int{1, 2, 5, 10}\n\tfor _, length := range lengths {\n\t\tresult, err := GenerateSlice(length)\n\t\tassert.Lenf(t, result, length, \"Slice length is invalid\")\n\t\tassert.Nilf(t, err, \"Error should be nil: expected length %d\", length)\n\t}\n}", "title": "" }, { "docid": "679efbb74550997792fa54e391a2836a", "score": "0.49862286", "text": "func (fb *FB) NewSlice(m, n int) *Slice {\n\ts := new(Slice)\n\t*s = fb.Slice(m, n)\n\treturn s\n}", "title": "" }, { "docid": "c1c545a44c68d01d4336d019ee5983e0", "score": "0.4977788", "text": "func printSlice(s string, x []int) /* type is missing*/ {\n\n\t// cap is capacity\n\tfmt.Printf(\"%s len=%d cap=%d %v \\n\", s, len(x), cap(x), x) \n\t// %s is some sort of Interfacing but we'll leave it for now\n}", "title": "" }, { "docid": "25206be72da82cd4848c679938961df6", "score": "0.49774152", "text": "func Slice[T any](collection []T, start int, end int) []T {\n\tsize := len(collection)\n\n\tif start >= end {\n\t\treturn []T{}\n\t}\n\n\tif start > size {\n\t\tstart = size\n\t}\n\n\tif end > size {\n\t\tend = size\n\t}\n\n\treturn collection[start:end]\n}", "title": "" }, { "docid": "8314636c5d613b92b3d8dc8e69d12d58", "score": "0.4976967", "text": "func SliceDetails(s Slice, size int) (start, end, step int, err error) {\n\tif s == nil {\n\t\tstart = 0\n\t\tend = size\n\t\tstep = 1\n\t} else {\n\t\tif err = CheckSlice(s, size); err != nil {\n\t\t\treturn\n\t\t}\n\n\t\tstart = s.Start()\n\t\tend = s.End()\n\t\tstep = s.Step()\n\n\t\tif end > size {\n\t\t\tend = size\n\t\t}\n\t}\n\treturn\n}", "title": "" }, { "docid": "0dfd3bdf3666c5a0642880b551b608a1", "score": "0.4972162", "text": "func NewSlice(l int) []byte {\n\tremainder := l % 8\n\tif remainder != 0 {\n\t\tremainder = 1\n\t}\n\treturn make([]byte, l/8+remainder)\n}", "title": "" }, { "docid": "da07545012c17fb5e82f7a8e6b3575c4", "score": "0.4969296", "text": "func (seq Seq) SliceFrom(ix Int) Seq {\n\treturn Seq{seq.contents[ix.Int():], seq.isString}\n}", "title": "" }, { "docid": "c3c131d70120377864e5f3ba764baed4", "score": "0.4954688", "text": "func init() {\n\tlog.Println(\"Running slices\")\n\tslices_101_ints()\n\tslices_102_strings()\n\tslices_103_vs_arrays()\n\tslices_104_nil()\n\tslices_105_manipulate()\n\tlog.Println(\"Running slices: done\")\n}", "title": "" }, { "docid": "3e20da9181ac82dbf7318e74cbab7b51", "score": "0.49472117", "text": "func OffsetLimit(users []UserDbRecord, offset, limit int) []UserDbRecord {\n\tmin := func (a, b int) int {\n\t\tif a < b {\n\t\t\treturn a\n\t\t}\n\t\treturn b\n\t}\n\n\toffset = min(offset, len(users))\n\tlimit = min(offset+limit, len(users))\n\treturn users[offset:limit]\n}", "title": "" }, { "docid": "da2abbbbc935b3b1d728c3f528c9d67b", "score": "0.49291024", "text": "func split_input(input_slice []int) ([]int, []int, []int, []int){\n\n length := len(input_slice)\n array_size := length / 4\n remainder := length % 4\n\n var inc1, rem1 = check_remainder(remainder)\n array1 := input_slice[:array_size+inc1]\n\n var inc2, rem2 = check_remainder(rem1)\n array2 := input_slice[array_size+inc1:array_size*2+inc1+inc2]\n \n var inc3, _ = check_remainder(rem2)\n array3 := input_slice[array_size*2+inc1+inc2:array_size*3+inc1+inc2+inc3]\n \n array4 := input_slice[array_size*3+inc1+inc2+inc3:array_size*4+inc1+inc2+inc3]\n\n return array1, array2, array3, array4\n}", "title": "" }, { "docid": "dbcbe1d792a6fc67d4a1a8cd3aacdac5", "score": "0.4928186", "text": "func IntegerSlice(start, stop, step int) []Value {\n\tresult := make([]Value, 0)\n\tfor i := start; i != stop + step; i += step {\n\t\tresult = append(result, IntVal(i))\n\t}\n\treturn result\n}", "title": "" }, { "docid": "35cc66077db742dd48d72061b08dfa72", "score": "0.49260718", "text": "func MakeRange(min, max int) []int {\n\tvar nb []int\n\tif min >= max {\n\t\treturn nil\n\t}\n\tnb = make([]int, max-min)\n\tfor i := range nb {\n\t\tnb[i] = i + min\n\t}\n\treturn nb\n\n}", "title": "" }, { "docid": "c1fb0a19a4efb46916de258ab67680b1", "score": "0.49255055", "text": "func (sc *scope) evalBuiltinMakeSlice3(call *ast.CallExpr) reflect.Value {\n\ttyp := sc.typeOf(call.Args[0])\n\tsize := sc.evalExpr(call.Args[1], nil)[0].Int()\n\tcapacity := sc.evalExpr(call.Args[2], nil)[0].Int()\n\treturn reflect.MakeSlice(typ, int(size), int(capacity))\n}", "title": "" }, { "docid": "912cadb31f60b6301a87a39873d827ad", "score": "0.4924259", "text": "func (p Int16) Slice(low, high int) Slice {\n\treturn p[low:high]\n}", "title": "" }, { "docid": "1269ff7d7b76b61bc19ed536104e2234", "score": "0.49202093", "text": "func playWithSlices() {\n\ts1 := []int{1, 2, 3, 4, 5}\n\ts2 := s1[:2]\n\ts3 := s1[2:]\n\tfmt.Println(len(s1), cap(s1))\n\tfmt.Println(len(s2), cap(s2))\n\tfmt.Println(len(s3), cap(s3))\n}", "title": "" }, { "docid": "c332449e99a2bb8cd3ce00da0a046e34", "score": "0.4909498", "text": "func (c *PagedControl) SliceOffsets() (start, end int) {\n\tstart = (c.PageNum() - 1) * c.PageSize()\n\t_, end = math.MinInt(start+c.PageSize(), c.TotalItems())\n\treturn\n}", "title": "" }, { "docid": "3df01dda3f300f1cab2f141faac11338", "score": "0.49073973", "text": "func (l *List) SetSlice(f *Frame, s *Slice, value *Object) *BaseException {\n\tl.mutex.Lock()\n\tnumListElems := len(l.elems)\n\tstart, stop, step, numSliceElems, raised := s.calcSlice(f, numListElems)\n\tif raised == nil {\n\t\traised = seqApply(f, value, func(elems []*Object, _ bool) *BaseException {\n\t\t\tnumElems := len(elems)\n\t\t\tif step == 1 {\n\t\t\t\ttailElems := l.elems[stop:numListElems]\n\t\t\t\tl.resize(numListElems - numSliceElems + numElems)\n\t\t\t\tcopy(l.elems[start+numElems:], tailElems)\n\t\t\t\tcopy(l.elems[start:start+numElems], elems)\n\t\t\t} else if numSliceElems == numElems {\n\t\t\t\ti := 0\n\t\t\t\tfor j := start; j != stop; j += step {\n\t\t\t\t\tl.elems[j] = elems[i]\n\t\t\t\t\ti++\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\tformat := \"attempt to assign sequence of size %d to extended slice of size %d\"\n\t\t\t\treturn f.RaiseType(ValueErrorType, fmt.Sprintf(format, numElems, numSliceElems))\n\t\t\t}\n\t\t\treturn nil\n\t\t})\n\t}\n\tl.mutex.Unlock()\n\treturn raised\n}", "title": "" }, { "docid": "3a9a27485e42ad931cc3b6fd6752b79b", "score": "0.49048463", "text": "func subSliceRight (initialPosition int, list []int) (int, []int) {\n sliceHalf := len(list)/2\n roundSliceHalf := int(math.Round(float64(len(list))/2))\n result := make([]int, roundSliceHalf)\n\n copy(result, list[sliceHalf : len(list)])\n //fmt.Println(fmt.Sprint(list) + \" -> \" + fmt.Sprint(result))\n\n //fmt.Println(\"returns \" + strconv.Itoa(initialPosition + (len(list) - len(result))))\n return (initialPosition + (len(list) - len(result))), result\n}", "title": "" }, { "docid": "14bef04f0a21edd8d3f6c2f331ccba06", "score": "0.48960528", "text": "func SliceRBegin(s interface{}) RandomReadWriter {\n\tv := reflect.ValueOf(s)\n\treturn sliceIter{\n\t\ts: v,\n\t\ti: v.Len() - 1,\n\t\tbackward: true,\n\t}\n}", "title": "" }, { "docid": "6c89547446a9bff32253d6592a8ad9fc", "score": "0.48958638", "text": "func (array *Array) SliceFrom(ix Int) *Array {\n\treturn array.Slice(ix, array.Len(0))\n}", "title": "" }, { "docid": "afd6317aabf7fc43c2e028a2a544a7cd", "score": "0.48914647", "text": "func TestSliceSubList(t *testing.T) {\n\tslices := make([]int, 5)\n\t//0 0 0 0 0\n\tfmt.Printf(\"origin %+v \\n\", slices)\n\n\t//0\n\tsub := slices[2:3]\n\tfmt.Printf(\"sub %+v \\n\", sub)\n\t//memory address are the same,which mean when you change sub[0]'s value,slices will change too\n\tfmt.Printf(\"slices[2] addr:%v sub[0] addr:%v \\n\", &slices[2], &sub[0])\n\n\tsub[0] = -1\n\tfmt.Printf(\"origin %+v , sub %+v \\n\", slices, sub)\n}", "title": "" }, { "docid": "a383c4e8b3291f68fc679e7625007c25", "score": "0.4887835", "text": "func (p *MediaPlaylist) SetRange(limit, offset int) error {\n\tif p.count == 0 {\n\t\treturn errors.New(\"playlist is empty\")\n\t}\n\tcheckVersion(&p.ver, 4) // due section 3.4.1\n\tp.Segments[p.last()].Limit = limit\n\tp.Segments[p.last()].Offset = offset\n\treturn nil\n}", "title": "" }, { "docid": "6beab584f2ea2d11d7ede64bb3f61a10", "score": "0.48834413", "text": "func numDesiredSlices(numEndpoints, maxPerSlice int) int {\n\treturn int(math.Ceil(float64(numEndpoints) / float64(maxPerSlice)))\n}", "title": "" }, { "docid": "371d3a9b4e7277a944ec1569236d8eb9", "score": "0.48811537", "text": "func (l *List) Slice(from, to int) *List {\n\treturn &List{\n\t\telements: l.elements[from:to],\n\t}\n}", "title": "" }, { "docid": "2b174eec1ff1591fefed343e8541a456", "score": "0.48757267", "text": "func Reslice(slc []byte, lidx int, uidx int) []byte {\r\n\tvar newSlice []byte = AllocateMake(uidx)\r\n\tvar slice_copy []byte = CopySlice(slc)\r\n\tcopy (slice_copy[lidx:uidx], newSlice)\r\n\t\r\n\r\n\treturn newSlice; \r\n}", "title": "" }, { "docid": "5c23a19fb6eb48193d626d82a5562fbc", "score": "0.4872506", "text": "func (b *Builder) InitSlicedScroller(id, max, size int, scroll string) *Builder {\n\tquery := b.query()\n\tsliceQuery := elastic.NewSliceQuery().Id(id).Max(max)\n\n\tb.scroller = b.client.Scroll(b.index).\n\t\tSlice(sliceQuery).\n\t\tQuery(query).\n\t\tSize(size).\n\t\tScroll(scroll)\n\n\treturn b\n}", "title": "" }, { "docid": "b0e3f219b82becadd96ee12832fc0569", "score": "0.48642555", "text": "func generateRange(from, to int) []int {\n\tlength := to - from + 1\n\n\tif length < 0 {\n\t\tpanic(\"Invalid from, to.\")\n\t}\n\n\tret := make([]int, length)\n\n\tfor i := 0; i < length; i++ {\n\t\tret[i] = from + i\n\t}\n\n\treturn ret\n}", "title": "" }, { "docid": "042bb585eb61a05cef1cb40ef435c00b", "score": "0.48606905", "text": "func (b *pageBits) setRange(i, n uint) {\n\t_ = b[i/64]\n\tif n == 1 {\n\t\t// Fast path for the n == 1 case.\n\t\tb.set(i)\n\t\treturn\n\t}\n\t// Set bits [i, j].\n\tj := i + n - 1\n\tif i/64 == j/64 {\n\t\tb[i/64] |= ((uint64(1) << n) - 1) << (i % 64)\n\t\treturn\n\t}\n\t_ = b[j/64]\n\t// Set leading bits.\n\tb[i/64] |= ^uint64(0) << (i % 64)\n\tfor k := i/64 + 1; k < j/64; k++ {\n\t\tb[k] = ^uint64(0)\n\t}\n\t// Set trailing bits.\n\tb[j/64] |= (uint64(1) << (j%64 + 1)) - 1\n}", "title": "" }, { "docid": "6fa2ef3613f0a8c68075502a76683011", "score": "0.4857088", "text": "func (d *SliceDataStore) Init(parameters ...interface{}) error {\n\td.slice = make([]Record, parameters[0].(int))\n\treturn nil\n}", "title": "" }, { "docid": "c0e57602359832d20f2fb65ea03be13a", "score": "0.48538166", "text": "func split(slice []int) {\n fmt.Printf(\"address in split: %v\\n\", &slice[0])\n fmt.Printf(\"address in split: %v\\n\", &slice[1])\n\n slice = slice[1:5]\n fmt.Printf(\"%v : \\n\", slice)\n\n for i, elem := range slice {\n slice[i] = elem * 2\n }\n}", "title": "" }, { "docid": "96234280487c62a77863bffc86d43c33", "score": "0.48519084", "text": "func NewSlice(c *Config) *Slice {\n\t// check Config\n\tif c == nil || c.Active < c.Idle {\n\t\tpanic(\"config nil or Idle Must <= Active\")\n\t}\n\tctx, cancel := context.WithCancel(context.Background())\n\t// new pool\n\tp := &Slice{\n\t\tconf: c,\n\t\tstop: cancel,\n\t\titemRequests: make(map[uint64]chan item),\n\t\topenerCh: make(chan struct{}, 1000000),\n\t}\n\tp.startCleanerLocked(time.Duration(c.IdleTimeout))\n\n\tgo p.itemOpener(ctx)\n\treturn p\n}", "title": "" }, { "docid": "43434f0b934a09529fbf6dfa357ca5b9", "score": "0.4837971", "text": "func makeRange(min, max int64) []int64 {\n\ta := make([]int64, max-min+1)\n\tfor i := range a {\n\t\ta[i] = min + int64(i)\n\t}\n\treturn a\n}", "title": "" } ]
03d0de62a7e41b6012ad25aaeb90674f
updateUser changes the user row in the database according to the new given User model
[ { "docid": "ac34ed4209f5b865af8cd21ad39120c0", "score": "0.7089822", "text": "func updateUser(user *User) error {\n\tdb, err := database.Connect()\n\tif err != nil {\n\t\treturn err\n\t}\n\n\tdefer db.Close()\n\n\tsqlStatement := `UPDATE users SET username=$2, email=$3, password=$4 WHERE user_id=$1`\n\n\tres, err := db.Exec(sqlStatement, user.ID, user.Username, user.Email, user.Password)\n\tif err != nil {\n\t\treturn fmt.Errorf(\n\t\t\t\"unable to execute `%s` with user_id `%v`: %v\",\n\t\t\tsqlStatement, user.ID, err,\n\t\t)\n\t}\n\n\trowsAffected, err := res.RowsAffected()\n\tif err != nil {\n\t\treturn fmt.Errorf(\"failed checking the affected rows: %v\", err)\n\t}\n\n\tlog.L.Info(\"user rows updated\", zap.Int64(\"total\", rowsAffected))\n\n\treturn nil\n}", "title": "" } ]
[ { "docid": "ec266a1fae7e8bf59c4dda593ba5afcc", "score": "0.7811905", "text": "func UpdateUser(c *gin.Context) {\n\n\t// Validate input\n\tvar input UpdateUserInput\n\tif err := c.ShouldBindJSON(&input); err != nil {\n\t\tc.JSON(http.StatusBadRequest, gin.H{\"error\": err.Error()})\n\t\treturn\n\t}\n\n\t// Get model if exist\n\t//var user models.User\n\tuser := models.User{\n\t\tEmail: input.Email,\n\t\tRut: input.Rut,\n\t\tFirst_name: input.First_name,\n\t\tLast_name: input.Last_name,\n\t\tPassword: input.Password,\n\t\tPhone: input.Phone,\n\t\tBirthdate: input.Birthdate,\n\t\tGender: input.Gender,\n\t\tNationality: input.Nationality,\n\t\tGraduate: input.Graduate,\n\t\tTypeuser: input.Type,\n\t\tCreated_on: time.Now(),\n\t\tLast_login: time.Now()}\n\n\tif err := models.DB.Where(\"ID = ?\", c.Param(\"id\")).Save(&user).Error; err != nil {\n\t\tc.JSON(http.StatusBadRequest, gin.H{\"error\": \"Record not found!\"})\n\t\treturn\n\t} else {\n\t\tc.JSON(http.StatusOK, gin.H{\"data\": user})\n\t}\n}", "title": "" }, { "docid": "8592eae5039500cca1584f5628bd9020", "score": "0.7691598", "text": "func Update(c *gin.Context) {\n\tmyUserModel := c.MustGet(\"my_user_model\").(UserModel)\n\tuserModelValidator := NewUserModelValidatorFillWith(myUserModel)\n\tif err := userModelValidator.Bind(c); err != nil {\n\t\tc.JSON(http.StatusUnprocessableEntity, common.NewValidatorError(err))\n\t\treturn\n\t}\n\n\tuserModelValidator.userModel.ID = myUserModel.ID\n\tif err := myUserModel.Update(userModelValidator.userModel); err != nil {\n\t\tc.JSON(http.StatusUnprocessableEntity, common.NewError(\"database\", err))\n\t\treturn\n\t}\n\tUpdateContextUserModel(c, myUserModel.ID)\n\tserializer := UserSerializer{c}\n\tc.JSON(http.StatusOK, gin.H{\"user\": serializer.Response()})\n}", "title": "" }, { "docid": "e7017dda363200f74cb51f254afe944a", "score": "0.7691493", "text": "func UpdateUser(c *gin.Context) {\n\tdb := c.MustGet(\"db\").(*gorm.DB)\n\n\t// Get model if exist\n\tvar user models.User\n\tif err := db.Where(\"id = ?\", c.Param(\"id\")).First(&user).Error; err != nil {\n\t\tc.JSON(http.StatusBadRequest, gin.H{\"error\": \"Record not found!\"})\n\t\treturn\n\t}\n\n\t// Validate input\n\tvar input models.User\n\tif err := c.ShouldBindJSON(&input); err != nil {\n\t\tc.JSON(http.StatusBadRequest, gin.H{\"error\": err.Error()})\n\t\treturn\n\t}\n\n\tresult := db.Model(&user).Updates(input)\n\n\tc.JSON(http.StatusOK, result)\n}", "title": "" }, { "docid": "4a69bd99fcdd9eda58d2068d76cfa8d4", "score": "0.7610879", "text": "func UpdateUser(c *gin.Context) {\n\tvar user models.User\n\terr := models.DB.Where(\"id = ?\", c.Param(\"id\")).First(&user).Error\n\tif err != nil {\n\t\tc.JSON(http.StatusBadRequest, gin.H{\"error\": \"Record not found!\"})\n\t\treturn\n\t}\n\n\tvar input UpdateUserInput\n\terr = c.ShouldBindJSON(&input)\n\tif err != nil {\n\t\tc.JSON(http.StatusBadRequest, gin.H{\"error\": err.Error()})\n\t\treturn\n\t}\n\n\tmodels.DB.Model(&user).Updates(input)\n\n\tc.JSON(http.StatusOK, gin.H{\"data\": user})\n}", "title": "" }, { "docid": "177034a431f895fdfcc9f1a3f6b024d8", "score": "0.75909126", "text": "func UserUpdate(ctx context.Context, res http.ResponseWriter, req *http.Request) {\n\tappContext := ctx.Value(\"appContext\").(*AppContext)\n\tuserID := pat.Param(ctx, \"userID\")\n\n\t// non-admins can only edit their own details\n\tif !appContext.AuthUser.IsAdmin && appContext.AuthUser.ID != userID {\n\t\tappContext.Response = MessageResponse{\n\t\t\tMessage: \"This resource is only available to users with administrator rights.\",\n\t\t}\n\t\tres.WriteHeader(http.StatusForbidden)\n\t\treturn\n\t}\n\n\tvar updateUser models.User\n\n\terr := json.NewDecoder(io.LimitReader(req.Body, maxRequestLength)).Decode(&updateUser)\n\tif err != nil {\n\t\tres.WriteHeader(http.StatusBadRequest)\n\t\tappContext.Response = MessageResponse{\n\t\t\tMessage: \"JSON request body was not in a valid format\",\n\t\t}\n\t\treturn\n\t}\n\treq.Body.Close()\n\n\tuser, err := db.UserFromID(userID)\n\tif err != nil && err != db.ErrEntityNotFound {\n\t\tpanic(err)\n\t}\n\n\tif err == db.ErrEntityNotFound {\n\t\tres.WriteHeader(http.StatusNotFound)\n\t\tappContext.Response = MessageResponse{\n\t\t\tMessage: fmt.Sprintf(\"User not found on ID: %s\", userID),\n\t\t}\n\t\treturn\n\t}\n\n\tupdateUser.Sanitise()\n\tvalidationErrors, err := updateUser.ValidateUpdate(userID)\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\n\tif len(validationErrors) > 0 {\n\t\tres.WriteHeader(http.StatusBadRequest)\n\t\tappContext.Response = updateResponse{\n\t\t\tMessage: \"User model is invalid.\",\n\t\t\tErrors: validationErrors,\n\t\t}\n\t\treturn\n\t}\n\n\tuser.Name = updateUser.Name\n\tuser.Email = updateUser.Email\n\n\tif appContext.AuthUser.IsAdmin {\n\t\tuser.IsAdmin = updateUser.IsAdmin\n\t}\n\n\tif updateUser.Password != \"\" {\n\t\tbcryptWorkFactor := appContext.Settings.AppSettings.BCryptWorkFactor\n\t\thashedPassword, bcryptErr := bcrypt.GenerateFromPassword([]byte(updateUser.Password), bcryptWorkFactor)\n\t\tif bcryptErr != nil {\n\t\t\tpanic(bcryptErr)\n\t\t}\n\n\t\tuser.HashedPassword = string(hashedPassword)\n\t}\n\n\terr = user.Save()\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\n\tappContext.Response = MessageResponse{\n\t\tMessage: ok,\n\t}\n}", "title": "" }, { "docid": "35a2e06b038a3131b847a8f48d4cd59c", "score": "0.74710494", "text": "func updateUser(w http.ResponseWriter, r *http.Request) {\n\tuserId := getUserId(r)\n\tbody := readBody(r)\n\tvar newValues UpdateUserReqBody\n\terr := json.Unmarshal(body, &newValues)\n\thelpers.HandleError(err)\n\n\t// Call the user profile update func\n\tdb.UpdateUserProfile(userId, newValues.Name, newValues.Email)\n\n\tresp := map[string]interface{}{\n\t\t\"success\": true,\n\t}\n\tapiResponse(resp, w)\n}", "title": "" }, { "docid": "249dd22b13185a73b826f13951068444", "score": "0.7470988", "text": "func (uc UserController) UpdateUser(c *gin.Context) {\n\tctx := store.AuthContext(c)\n\n\ttype UserInput struct {\n\t\tID string `form:\"id\" json:\"id\"`\n\t\tKey string `form:\"key\" json:\"key\"`\n\t\tPassword string `form:\"password\" json:\"password\"`\n\t\tFirstname string `form:\"firstname\" json:\"firstname\"`\n\t\tLastname string `form:\"lastname\" json:\"lastname\"`\n\t}\n\tvar userInput UserInput\n\tif err := c.ShouldBind(&userInput); err != nil {\n\t\tuc.AbortWithError(c, helpers.ErrorInvalidInput(err))\n\t\treturn\n\t}\n\n\tdbUser, err := models.GetUser(ctx, bson.M{\"_id\": userInput.ID})\n\tif err != nil {\n\t\tuc.AbortWithError(c, helpers.ErrorResourceNotFound(err))\n\t\treturn\n\t}\n\n\tif userInput.Key != dbUser.Key {\n\t\tuc.AbortWithError(c, helpers.ErrorUserUnauthorized)\n\t\treturn\n\t}\n\n\tdbUser.Key = helpers.RandomString(40)\n\n\tif dbUser.Status == \"created\" {\n\t\tdbUser.Status = \"activated\"\n\t} else if dbUser.Status == \"activated\" {\n\t\tdbUser.Status = \"modified\"\n\t}\n\n\thashedPassword, err := bcrypt.GenerateFromPassword([]byte(userInput.Password), bcrypt.DefaultCost)\n\tif err != nil {\n\t\tuc.AbortWithError(c, helpers.ErrorInternal(err))\n\t\treturn\n\t}\n\tdbUser.Password = string(hashedPassword)\n\n\tif userInput.Firstname != \"\" {\n\t\tdbUser.FirstName = userInput.Firstname\n\t}\n\tif userInput.Lastname != \"\" {\n\t\tdbUser.LastName = userInput.Lastname\n\t}\n\n\tdbUser.LastModification = time.Now().Unix()\n\terr = models.UpdateUser(ctx, dbUser.ID, dbUser)\n\tutils.CheckErr(err)\n\n\tc.JSON(http.StatusOK, \"User well modified\")\n}", "title": "" }, { "docid": "39293a1060b8569041f7ccbfddce4552", "score": "0.7463793", "text": "func UpdateUser(w http.ResponseWriter, r *http.Request) {\n\n\t//connect\n\tdb, err = gorm.Open(\"sqlite3\", \"test.db\")\n\tif err != nil {\n\t\tpanic(\"Could not connect to database\")\n\t}\n\tdefer db.Close()\n\n\t//get vars\n\tvars := mux.Vars(r)\n\tname := vars[\"name\"]\n\temail := vars[\"email\"]\n\n\tvar user User\n\n\t//find the user and update email form post\n\tdb.Where(\"name = ?\", name).Find(&user)\n\tuser.Email = email\n\n\t//update the user in DB\n\tdb.Save(&user)\n\n\tfmt.Fprintf(w, \"Successfully updated the user\")\n\n}", "title": "" }, { "docid": "568a26ea9c9518061bf7e6a9db027471", "score": "0.7411883", "text": "func (h *handler) updateUser(c echo.Context) error {\n\t//Obtain email paramater from request\n\temail := c.Param(\"email\")\n\tfmt.Println(\"Updating User: \", email)\n\t//Find user by email\n\tuser := h.db[email]\n\t\n\t//user not found, throws error\n\tif user == nil {\n\t\treturn echo.NewHTTPError(http.StatusNotFound, \"user not found\")\n\t}\n\n\t//Define a new User that contains PUT information\n\tuUser := new(User)\n\t\n\t//User attributes bind with the request\n\tif err := c.Bind(uUser); err != nil {\n\t\treturn err\n\t}\n\n\t//Validate attributes is not empty\n\tif uUser.Email != \"\" {\n\t\tuser.Email = uUser.Email\t\n\t}\n\t\n\tif uUser.Password != \"\" {\n\t\tuser.Password = uUser.Password\t\n\t}\n\t\n\t//Update database info\n\th.db[email] = user\n\n\treturn c.JSON(http.StatusOK, user)\n\n}", "title": "" }, { "docid": "e62fd283eacbc31bb5d87c84219d5abb", "score": "0.7403357", "text": "func UpdateUser(w http.ResponseWriter, r *http.Request) {\n\tw.Header().Set(\"content-type\", \"application/json\")\n\tparams := mux.Vars(r)\n\tvar user models.User\n\tdb.First(&user, params[\"id\"])\n\tjson.NewDecoder(r.Body).Decode(&user)\n\tdb.Save(&user)\n\tjson.NewEncoder(w).Encode(user)\n}", "title": "" }, { "docid": "bb80a75dae9a57474526b42d7b301528", "score": "0.73534596", "text": "func (api *Api) updateUser(w http.ResponseWriter, r *http.Request) {\n\tvars := mux.Vars(r)\n\t// Convert id string variable to int.\n\tid, err := uuid.Parse(vars[\"id\"])\n\tif err != nil {\n\t\tutils.RespondWithError(w, http.StatusInternalServerError, err.Error())\n\t}\n\n\t// Gets JSON object from request body.\n\tvar u model.User\n\tdecoder := json.NewDecoder(r.Body)\n\tif err := decoder.Decode(&u); err != nil {\n\t\tutils.RespondWithError(w, http.StatusBadRequest, \"Invalid resquest payload\")\n\t\treturn\n\t}\n\tu.UserID = id\n\n\tdefer r.Body.Close()\n\t// Hash password.\n\tu.Password = auth.HashAndSalt([]byte(u.Password))\n\n\tif err := u.UpdateUser(d.Database); err != nil {\n\t\tutils.DBNoRowsError(w, err, u)\n\t\treturn\n\t}\n\t// Respond with updated user.\n\tutils.RespondWithJSON(w, http.StatusOK, u)\n}", "title": "" }, { "docid": "0c2e3061078e71563f4f8558529d63aa", "score": "0.73431545", "text": "func UpdateUser(user User) (int64, error) {\n\tdb := Connect()\n\tdefer db.Close()\n\trs := db.Model(&user).Where(\"id = ?\", user.ID).UpdateColumns(\n\t\tmap[string]interface{}{\n\t\t\t\"name\": user.Name,\n\t\t\t\"email\": user.Email,\n\t\t},\n\t)\n\treturn rs.RowsAffected, rs.Error\n}", "title": "" }, { "docid": "609f5214b67646fb02c20a4a1ab7c58a", "score": "0.73191035", "text": "func (c *AuthController) UpdateUser(w http.ResponseWriter, r *http.Request) {\n\t_, claims, _ := helper.DecodeJwt(r)\n\n\tpayload := models.UserModel{}\n\n\tif err := render.Bind(r, &payload); err != nil {\n\t\trender.Render(w, r, helper.ResponseError(422, err))\n\t\treturn\n\t}\n\n\theader := req.Header{\n\t\t\"Accept\": \"application/json\",\n\t\t\"Claims\": c.BuildClaims(claims),\n\t}\n\n\tbody := req.BodyJSON(&payload)\n\n\treq := req.New()\n\n\tid := chi.URLParam(r, \"id\")\n\n\tres, err := req.Put(authUrl+\"/user/\"+id, header, body)\n\n\tif err != nil {\n\t\trender.Render(w, r, helper.ResponseError(res.Response().StatusCode, errors.New(res.Response().Status)))\n\t\treturn\n\t}\n\n\tnewRes := helper.ResponseModel{}\n\n\tres.ToJSON(&newRes)\n\n\tif !newRes.Success {\n\t\trender.Render(w, r, helper.ResponseError(newRes.HTTPStatusCode, errors.New(newRes.Message)))\n\t\treturn\n\t}\n\n\trender.Render(w, r, helper.Response(&newRes))\n}", "title": "" }, { "docid": "af3b01cfe6647f5ce9f0ea43284bd286", "score": "0.72816265", "text": "func UpdateUser(user *User, id string) (err error) {\n\tfmt.Println(user)\n\tconfig.DB.Save(user)\n\treturn nil\n}", "title": "" }, { "docid": "4f45a95f4868fab5386bdcacd2c7359d", "score": "0.72737694", "text": "func (repo *UserRepositoryImpl) UpdateUser(ctx context.Context, user User) error {\r\n\ttmp, err := repo.SearchUser(ctx, user.UserID)\r\n\ttmp.UserType = user.UserType\r\n\ttmp.UserName = user.UserName\r\n\ttmp.Password = user.Password\r\n\ttmp.School = user.School\r\n\ttmp.ID = user.ID\r\n\ttmp.Phone = user.Phone\r\n\ttmp.Email = user.Email\r\n\ttmp.Name = user.Name\r\n\t// if err = repo.DB.Save(tmp).Error; nil != err {\r\n\t// \treturn err\r\n\t// }\r\n\tif err = repo.DB.Model(&tmp).Updates(tmp).Error; nil != err {\r\n\t\treturn err\r\n\t}\r\n\treturn nil\r\n}", "title": "" }, { "docid": "e89dfa2af2481ec1366d3cdc715533eb", "score": "0.7245381", "text": "func UpdateUser(w http.ResponseWriter, req *http.Request, params httprouter.Params) {\n\tID := params.ByName(\"id\")\n\tif ID == \"\" {\n\t\thttp.Error(w, \"ID can not be empty\", http.StatusBadRequest)\n\t\treturn\n\t}\n\tvar u User\n\terr := json.NewDecoder(req.Body).Decode(&u)\n\tdefer req.Body.Close()\n\tif err != nil {\n\t\thttp.Error(w, err.Error(), http.StatusInternalServerError)\n\t\treturn\n\t}\n\tif u.ID == 0 {\n\t\thttp.Error(w, \"Please set ID in User information\", http.StatusBadRequest)\n\t\treturn\n\t}\n\t_, err = NewUser().FindByID(ID)\n\tif err != nil {\n\t\thttp.Error(w, err.Error(), http.StatusBadRequest)\n\t\treturn\n\t}\n\terr = NewUser().Update(u)\n\tif err != nil {\n\t\thttp.Error(w, err.Error(), http.StatusInternalServerError)\n\t\treturn\n\t}\n\tw.WriteHeader(http.StatusOK)\n}", "title": "" }, { "docid": "d1ae5232af1268c9d5e9d1f24ce65b0b", "score": "0.7245154", "text": "func UpdateUser(c *gin.Context) {\n\tvar user models.User\n\n\terr := models.GetUser(&user, c.Param(\"id\"))\n\n\tif err != nil {\n\t\tc.AbortWithStatus(http.StatusNotFound)\n\t\treturn\n\t}\n\n\tc.BindJSON(&user)\n\n\terr = models.UpdateUser(&user)\n\n\tif err != nil {\n\t\tc.AbortWithStatus(http.StatusBadRequest)\n\t} else {\n\t\tc.JSON(http.StatusOK, user)\n\t}\n}", "title": "" }, { "docid": "164de74ee6b03129aff67a30c60ae8b0", "score": "0.7223407", "text": "func (s *userRepo) Update(user entity.User) (*entity.User, *resterrors.RestErr) {\n\n\tquery := `\n\t\tUPDATE tab_user\n\t\t\tSET\tname \t\t\t\t\t= ?,\n\t\t\t\t\temail\t\t\t\t\t= ?,\n\t\t\t\t\tcountry_code\t= ?,\n\t\t\t\t\tarea_code\t\t\t= ?,\n\t\t\t\t\tphone_number\t= ?\n\t\t\t\n\t\tWHERE id\t= ?;\n\t`\n\n\tstmt, err := s.db.Prepare(query)\n\tif err != nil {\n\t\terrorCode := \"Error 0009: \"\n\t\tlog.Println(fmt.Sprintf(\"%sError when trying to prepare the query statement in the Update user\", errorCode), err)\n\t\treturn nil, resterrors.NewInternalServerError(fmt.Sprintf(\"%sDatabase error\", errorCode))\n\t}\n\tdefer stmt.Close()\n\n\t_, err = stmt.Exec(\n\t\tuser.Name,\n\t\tuser.Email,\n\t\tuser.CountryCode,\n\t\tuser.AreaCode,\n\t\tuser.PhoneNumber,\n\t\tuser.ID)\n\tif err != nil {\n\t\terrorCode := \"Error 00010: \"\n\t\tlog.Println(fmt.Sprintf(\"%sError when trying to execute Query in the Update user\", errorCode), err)\n\t\treturn nil, mysqlutils.HandleMySQLError(errorCode, err)\n\t}\n\n\treturn &user, nil\n}", "title": "" }, { "docid": "3c2ff8e573518cc11c43b936668363e5", "score": "0.7214019", "text": "func (da *InMemoryDataAccess) UserUpdate(ctx context.Context, user rest.User) error {\n\tif user.Username == \"\" {\n\t\treturn errs.ErrEmptyUserName\n\t}\n\n\texists, err := da.UserExists(ctx, user.Username)\n\tif err != nil {\n\t\treturn err\n\t}\n\tif !exists {\n\t\treturn errs.ErrNoSuchUser\n\t}\n\n\tif user.Mappings == nil {\n\t\tuser.Mappings = map[string]string{}\n\t}\n\n\tda.users[user.Username] = &user\n\n\treturn nil\n}", "title": "" }, { "docid": "abaf0f8f3fde80d12f337a7ff22e5927", "score": "0.71994406", "text": "func UpdateUser(w http.ResponseWriter, r *http.Request) {\n\tparams := mux.Vars(r)\n\n\tID, err := strconv.ParseUint(params[\"id\"], 10, 32)\n\tif err != nil {\n\t\tw.Write([]byte(\"Error while converting param to int\"))\n\t\treturn\n\t}\n\n\treqBody, err := ioutil.ReadAll(r.Body)\n\tif err != nil {\n\t\tw.Write([]byte(\"Error while reading request body\"))\n\t\treturn\n\t}\n\n\tvar user user\n\tif err = json.Unmarshal(reqBody, &user); err != nil {\n\t\tw.Write([]byte(\"Error while converting user to struct\"))\n\t\treturn\n\t}\n\n\tdatabase, err := database.Connect()\n\tif err != nil {\n\t\tw.Write([]byte(\"Error while connecting to database\"))\n\t\treturn\n\t}\n\tdefer database.Close()\n\n\tstatement, err := database.Prepare(\"update users set name = ?, email = ? where id = ?\")\n\tif err != nil {\n\t\tw.Write([]byte(\"Error while creating statement\"))\n\t\treturn\n\t}\n\tdefer statement.Close()\n\n\tif _, err := statement.Exec(user.Name, user.Email, ID); err != nil {\n\t\tw.Write([]byte(\"Error while updateing user\"))\n\t\treturn\n\t}\n\n\tw.WriteHeader(http.StatusNoContent)\n}", "title": "" }, { "docid": "dc419ef737b0d96b4e7916d0111d0189", "score": "0.71811914", "text": "func (h *Handler) UpdateUser(c echo.Context) error {\n\n\tloginUID := c.Get(\"uid\").(string)\n\tif loginUID != c.Param(\"uid\") {\n\t\treturn c.JSON(http.StatusUnauthorized, map[string]interface{}{\n\t\t\t\"error\": \"Unauthorized user\",\n\t\t})\n\t}\n\n\tuid, err := strconv.Atoi(c.Param(\"uid\"))\n\tif err != nil {\n\t\treturn c.JSON(http.StatusBadRequest, map[string]interface{}{\n\t\t\t\"error\": err.Error(),\n\t\t})\n\t}\n\n\tuser := User{}\n\n\tresult := h.DB.Find(&user, uid)\n\tif result.Error != nil {\n\t\treturn c.JSON(http.StatusInternalServerError, map[string]interface{}{\n\t\t\t\"error\": result.Error.Error(),\n\t\t})\n\t} else if result.RowsAffected == 0 {\n\t\treturn c.JSON(http.StatusNotFound, map[string]interface{}{\n\t\t\t\"error\": \"record not found\",\n\t\t})\n\t}\n\n\tupdateUser := User{}\n\n\terr = c.Bind(&updateUser)\n\tif err != nil {\n\t\treturn c.JSON(http.StatusBadRequest, map[string]interface{}{\n\t\t\t\"error\": err.Error(),\n\t\t})\n\t}\n\n\tif updateUser.Name != \"\" {\n\t\tuser.Name = updateUser.Name\n\t}\n\n\tif updateUser.Password != \"\" {\n\t\tuser.Password = updateUser.Password\n\t}\n\n\tif updateUser.Email != \"\" {\n\t\tuser.Email = updateUser.Email\n\t}\n\n\tresult = h.DB.Save(&user)\n\tif result.Error != nil {\n\t\treturn c.JSON(http.StatusInternalServerError, map[string]interface{}{\n\t\t\t\"error\": result.Error.Error(),\n\t\t})\n\t}\n\n\treturn c.JSON(http.StatusOK, user)\n\n}", "title": "" }, { "docid": "a04db6476ca36e86141bbdc431620ab8", "score": "0.71711254", "text": "func (userRepositoryImpl *UserRepositoryImpl) UpdateUser(ctx context.Context, user models.User) (*models.User, error) {\n\treturn nil, nil\n}", "title": "" }, { "docid": "199f45a01ccd29840388b97bde771583", "score": "0.7170179", "text": "func (u *UserModel) Update(data interface{}) error {\n\tdb := common.GetDB()\n\terr := db.Model(u).Update(data).Error\n\treturn err\n}", "title": "" }, { "docid": "5c1067c2af3d27a639ff93effe25356f", "score": "0.71608734", "text": "func UserUpdate(c *gin.Context) {\n\trecord := session.User(c)\n\n\tif err := c.BindJSON(&record); err != nil {\n\t\tlogrus.Warnf(\"Failed to bind user data. %s\", err)\n\n\t\tc.JSON(\n\t\t\thttp.StatusPreconditionFailed,\n\t\t\tgin.H{\n\t\t\t\t\"status\": http.StatusPreconditionFailed,\n\t\t\t\t\"message\": \"Failed to bind user data\",\n\t\t\t},\n\t\t)\n\n\t\tc.Abort()\n\t\treturn\n\t}\n\n\terr := store.UpdateUser(\n\t\tc,\n\t\trecord,\n\t)\n\n\tif err != nil {\n\t\tlogrus.Warnf(\"Failed to update user. %s\", err)\n\n\t\tc.JSON(\n\t\t\thttp.StatusBadRequest,\n\t\t\tgin.H{\n\t\t\t\t\"status\": http.StatusBadRequest,\n\t\t\t\t\"message\": err.Error(),\n\t\t\t},\n\t\t)\n\n\t\tc.Abort()\n\t\treturn\n\t}\n\n\tc.JSON(\n\t\thttp.StatusOK,\n\t\trecord,\n\t)\n}", "title": "" }, { "docid": "62e2359045194e246e1e231d29eeb200", "score": "0.7155328", "text": "func UpdateUser(w http.ResponseWriter, r *http.Request) {\n\n\t//call function for verify and validation of request\n\tuserUpdate, err := verifyUserUpdate(w,r)\n\tif err != nil{\n\t\treturn\n\t}\n\n\t//take 'id' into queryString\n\tquery := r.URL.Query().Get(\"id\")\n\n\t//create ObjectID\n\tid,err := primitive.ObjectIDFromHex(query)\n\tif err != nil {\n\t\tconfigs.ErrorCreateId(w)\n\t\treturn\n\t}\n\n\t//call function for insert user in database\n\tresUser, err := database.UpdateUser(id,userUpdate)\n\tif err != nil{\n\t\tconfigs.ErrorNotFound(w,\"user\")\n\t\treturn\n\t}\n\n\t//message confirmation in log\n\tlog.Printf(\"[SUCESS] User Updated -> %v\",resUser)\n\t//show message sucess\n\t_, _ = w.Write([]byte(`{\"message\":\" update success\"}`))\n}", "title": "" }, { "docid": "4882b3ebb2ef040d944fa716495897f0", "score": "0.71361786", "text": "func UpdateUser(w http.ResponseWriter, r *http.Request) {\n\tvars := mux.Vars(r)\n\tuserID, err := strconv.ParseUint(vars[\"id\"], 10, 64)\n\tif err != nil {\n\t\tresponses.ERROR(w, http.StatusBadRequest, err)\n\t\treturn\n\t}\n\n\tuser := models.User{}\n\terr = json.NewDecoder(r.Body).Decode(&user)\n\tif err != nil {\n\t\tresponses.ERROR(w, http.StatusUnprocessableEntity, err)\n\t\treturn\n\t}\n\n\terr = user.Validate(\"update\")\n\tif err != nil {\n\t\tresponses.ERROR(w, http.StatusUnprocessableEntity, err)\n\t\treturn\n\t}\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\trepo := crud.NewRepositoryUsersCRUD(db)\n\tfunc(userRepos crud.UserRepository) {\n\t\trowsAffected, err := userRepos.Update(userID, user)\n\t\tif err != nil {\n\t\t\tresponses.ERROR(w, http.StatusBadRequest, err)\n\t\t\treturn\n\t\t}\n\t\tresponses.JSON(w, http.StatusOK, rowsAffected)\n\t}(repo)\n}", "title": "" }, { "docid": "49582b340c04aee2cd67bb08ab241780", "score": "0.7130896", "text": "func UpdateUser(w http.ResponseWriter, r *http.Request) {\n\tparams := mux.Vars(r)\n\n\tID, err := strconv.ParseUint(params[\"id\"], 10, 32)\n\tif err != nil {\n\t\tw.Write([]byte(\"Failed converting the query param from the request to integer\"))\n\t\treturn\n\t}\n\n\trequestBody, err := ioutil.ReadAll(r.Body)\n\tif err != nil {\n\t\tw.Write([]byte(\"Failed to get information from the request body\"))\n\t\treturn\n\t}\n\n\tvar u user\n\tif err := json.Unmarshal(requestBody, &u); err != nil {\n\t\tw.Write([]byte(\"Failed converting the user information from JSON\"))\n\t\treturn\n\t}\n\n\tdb, err := db.Connect()\n\tif err != nil {\n\t\tw.Write([]byte(\"Failed to open a database connection\"))\n\t\treturn\n\t}\n\tdefer db.Close()\n\n\tstatement, err := db.Prepare(\"update users set name = ?, email = ? where id = ?\")\n\tif err != nil {\n\t\tw.Write([]byte(\"Failed to create SQL statement\"))\n\t}\n\tdefer statement.Close()\n\n\tif _, err := statement.Exec(u.Name, u.Email, ID); err != nil {\n\t\tw.Write([]byte(\"Failed to execute the SQL statement\"))\n\t\treturn\n\t}\n\n\tw.WriteHeader(http.StatusNoContent)\n\n}", "title": "" }, { "docid": "2d91c85b37f5e1c54cd4c8574bdf6e1c", "score": "0.7129009", "text": "func (ug *userGorm) Update(user *User) error {\n\treturn ug.db.Model(user).Updates(user).Error\n}", "title": "" }, { "docid": "a203af358d97ea66625b4385fa8523f4", "score": "0.712814", "text": "func UpdateUser(w http.ResponseWriter, r *http.Request) {\n\tif err != nil {\n\t\tpanic(\"Could not connect to the database\")\n\t}\n\tw.Header().Set(\"Content-Type\", \"application/json\")\n\n\tvar userUpdates User\n\tvar user User\n\t//decodes the user from the body and turns it into data\n\t_ = json.NewDecoder(r.Body).Decode(&userUpdates)\n\n\tdb.Where(\"name = ?\", userUpdates.Name).Find(&user)\n\n\tuser.Email = userUpdates.Email\n\tuser.Name = userUpdates.Name\n\n\tdb.Save(&user)\n\n\tjson.NewEncoder(w).Encode(user)\n\tfmt.Fprintf(w, \"Update User Endpoint Hit\")\n}", "title": "" }, { "docid": "8a8f7ba8648e433f5e4bff7a9b20989e", "score": "0.7125794", "text": "func UpdateUser(user models.User, r *http.Request) (models.User, error) {\n\tc := Controller{}\n\n\tdata, err := c.Load(r)\n\n\tif err != nil {\n\t\treturn user, err\n\t}\n\n\tvar updated []models.User\n\tfound := false\n\tfor _, u := range data.Users {\n\t\tif u.ID == user.ID {\n\t\t\tupdated = append(updated, models.User{\n\t\t\t\tID: user.ID,\n\t\t\t\tName: user.Name,\n\t\t\t\tPassword: u.Password,\n\t\t\t\tEmail: user.Email,\n\t\t\t\tLastLoginDate: user.LastLoginDate,\n\t\t\t\tUserLevel: user.UserLevel,\n\t\t\t})\n\t\t\tfound = true\n\t\t} else {\n\t\t\tupdated = append(updated, u)\n\t\t}\n\t}\n\n\tif !found {\n\t\treturn user, errUserNotFound\n\t}\n\n\terr = c.StoreUsers(updated, r)\n\n\tif err != nil {\n\t\treturn user, err\n\t}\n\n\treturn user, nil\n}", "title": "" }, { "docid": "d979c20f25dc3b533a03ef3a6f1c3172", "score": "0.7125787", "text": "func UpdateUserById(m *User) (err error) {\n\to := orm.NewOrm()\n\tv := User{Id: m.Id}\n\t// ascertain id exists in the database\n\tif err = o.Read(&v); err == nil {\n\t\tvar num int64\n\t\tfmt.Println(\"==================upadteUser===========\")\n\t\tfmt.Println(m)\n\t\tif num, err = o.Update(m); err == nil {\n\t\t\tfmt.Println(\"Number of records updated in database:\", num)\n\t\t} else {\n\t\t\tfmt.Println(\"user update failed :\", err)\n\t\t}\n\t}\n\n\treturn\n}", "title": "" }, { "docid": "30b0161c673fdd8f2e2c921b01065ff2", "score": "0.7125127", "text": "func UpdateUser(server *app.App) func(w http.ResponseWriter, req *http.Request) {\n\treturn func(w http.ResponseWriter, req *http.Request) {\n\t\tvars := mux.Vars(req)\n\t\tid := vars[\"id\"]\n\t\tuser := &models.User{ID: id}\n\t\tif ok, err := server.DB.Exists(user); err != nil || !ok {\n\t\t\tserver.Render.JSON(w, http.StatusNotFound, nil)\n\t\t\treturn\n\t\t}\n\t\tupdateReq := &models.UserUpdateRequest{}\n\t\tif err := binding.Bind(req, updateReq); err.Handle(w) {\n\t\t\treturn\n\t\t}\n\t\thash, err := bcrypt.GenerateFromPassword([]byte(updateReq.Password), 12)\n\t\tif err != nil {\n\t\t\tserver.Render.JSON(w, http.StatusInternalServerError, map[string]string{\"error\": \"there was an error updating the user\"})\n\t\t\tlog.Println(err)\n\t\t\treturn\n\t\t}\n\t\tif err := server.DB.Update(user, map[string]interface{}{\"Hash\": string(hash)}); err != nil {\n\t\t\tserver.Render.JSON(w, http.StatusInternalServerError, map[string]string{\"error\": \"there was an error updating the user\"})\n\t\t\tlog.Println(err)\n\t\t\treturn\n\t\t}\n\t\tuser.Hash = \"\"\n\t\tserver.Render.JSON(w, http.StatusOK, user)\n\t}\n}", "title": "" }, { "docid": "0b826237776bc2877980e5319a551411", "score": "0.7123412", "text": "func UpdateUser(db *sqlx.DB, u *User) error {\n\t// TODO: TEST CASE\n\t// TODO: maybe go to trigger for updated_at like https://stackoverflow.com/a/26284695\n\tvar updatedAt time.Time\n\tquery := db.Rebind(`UPDATE users SET email = ?, full_name = ?, username = ?, password = ?, updated_at = NOW()\n\t\tWHERE id = ?) RETURNING updated_at`)\n\terr := db.QueryRow(\n\t\tquery, u.Email, u.FullName, u.Username, u.Password, u.Id).Scan(&updatedAt)\n\tif err != nil {\n\t\treturn err\n\t}\n\tu.UpdatedAt = updatedAt\n\treturn nil\n}", "title": "" }, { "docid": "204bec21bfa82ef3beba5258c7fa1e05", "score": "0.71093804", "text": "func UpdateUser(ctx iris.Context) {\n\tuserID, err := ctx.Params().GetInt(\"userID\")\n\tif err != nil {\n\t\tctx.StatusCode(http.StatusBadRequest)\n\t\tctx.JSON(jsonError{\"Modification d'utilisateur, paramètre : \" + err.Error()})\n\t\treturn\n\t}\n\tdb, user := ctx.Values().Get(\"db\").(*sql.DB), models.User{ID: userID}\n\tif err = user.GetByID(db); err != nil {\n\t\tctx.StatusCode(http.StatusInternalServerError)\n\t\tctx.JSON(jsonError{\"Modification d'utilisateur, requête get : \" + err.Error()})\n\t\treturn\n\t}\n\tvar req sentUser\n\tif err = ctx.ReadJSON(&req); err != nil {\n\t\tctx.StatusCode(http.StatusInternalServerError)\n\t\tctx.JSON(jsonError{\"Modification d'utilisateur, décodage : \" + err.Error()})\n\t\treturn\n\t}\n\tif req.Email != \"\" {\n\t\tuser.Email = req.Email\n\t}\n\tif req.Name != \"\" {\n\t\tuser.Name = req.Name\n\t}\n\tuser.Active = req.Active\n\tif req.Role != \"\" {\n\t\tif req.Role != models.AdminRole && req.Role != models.UserRole && req.Role != models.ObserverRole {\n\t\t\tctx.StatusCode(http.StatusBadRequest)\n\t\t\tctx.JSON(jsonError{\"Modification d'utilisateur, rôle incorrect\"})\n\t\t\treturn\n\t\t}\n\t\tuser.Role = req.Role\n\t}\n\tif req.Password != \"\" {\n\t\tuser.Password = req.Password\n\t\tif err = user.CryptPwd(); err != nil {\n\t\t\tctx.StatusCode(http.StatusInternalServerError)\n\t\t\tctx.JSON(jsonError{\"Modification d'utilisateur, mot de passe : \" + err.Error()})\n\t\t\treturn\n\t\t}\n\t}\n\tif err = user.Update(db); err != nil {\n\t\tctx.StatusCode(http.StatusInternalServerError)\n\t\tctx.JSON(jsonError{\"Modification d'utilisateur, requête : \" + err.Error()})\n\t\treturn\n\t}\n\tctx.StatusCode(http.StatusOK)\n\tctx.JSON(userResp{user})\n}", "title": "" }, { "docid": "c633c963dc5a4fb9aad00db94ff090a5", "score": "0.7093725", "text": "func (h *UserHandler) updateUser(c *fiber.Ctx) error {\n\t// Initialize variables.\n\tuser := &User{}\n\ttargetedUserID := c.Locals(\"userID\").(int)\n\n\t// Create cancellable context.\n\tcustomContext, cancel := context.WithCancel(context.Background())\n\tdefer cancel()\n\n\t// Parse request body.\n\tif err := c.BodyParser(user); err != nil {\n\t\treturn c.Status(fiber.StatusBadRequest).JSON(&fiber.Map{\n\t\t\t\"status\": \"fail\",\n\t\t\t\"message\": err.Error(),\n\t\t})\n\t}\n\n\t// Update one user.\n\terr := h.userService.UpdateUser(customContext, targetedUserID, user)\n\tif err != nil {\n\t\treturn c.Status(fiber.StatusInternalServerError).JSON(&fiber.Map{\n\t\t\t\"status\": \"fail\",\n\t\t\t\"message\": err.Error(),\n\t\t})\n\t}\n\n\t// Return result.\n\treturn c.Status(fiber.StatusOK).JSON(&fiber.Map{\n\t\t\"status\": \"success\",\n\t\t\"message\": \"User has been updated successfully!\",\n\t})\n}", "title": "" }, { "docid": "35b543012bcdac0cfbef650d15da079e", "score": "0.7093217", "text": "func UserUpdate(c *gin.Context) {\n\tuser := &models.User{}\n\tif err := c.Bind(user); err == nil {\n\t\tif err := user.HashPassword(); err != nil {\n\t\t\tc.HTML(http.StatusInternalServerError, \"errors/500\", nil)\n\t\t\treturn\n\t\t}\n\t\tif err := user.Update(); err != nil {\n\t\t\tc.HTML(http.StatusInternalServerError, \"errors/500\", nil)\n\t\t\treturn\n\t\t}\n\t\tc.Redirect(http.StatusFound, \"/admin/users\")\n\t} else {\n\t\tsession := sessions.Default(c)\n\t\tsession.AddFlash(err.Error())\n\t\tsession.Save()\n\t\tc.Redirect(http.StatusSeeOther, \"/admin/users\")\n\t}\n}", "title": "" }, { "docid": "1ae409951c6573b781eb1e727798852f", "score": "0.70914257", "text": "func (u *User) Update(db *gorm.DB, user *gorsk.User) error {\n\treturn db.Save(&user).Error\n}", "title": "" }, { "docid": "b60696bee089a82fc77e4cef38565cc0", "score": "0.70747507", "text": "func (a Authenticator) UpdateUser(user, pass string) (err error) {\n\terr = a.db.Put(user, pass)\n\treturn\n}", "title": "" }, { "docid": "17218ccf68e42a64ef759d1a42b8a528", "score": "0.7070763", "text": "func (s *User) Update(cl orm.DB, user *twisk.User) (*twisk.User, error) {\n\t_, err := cl.Model(user).WherePK().Update()\n\treturn user, err\n}", "title": "" }, { "docid": "f3c52c8c03ee40c253498e179a147819", "score": "0.7059337", "text": "func (m *postgresDBRepo) UpdateUser(user modals.User) error {\n\t//if this transaction is taking longer then give time then time out\n\tctx, cancel := context.WithTimeout(context.Background(), 3*time.Second)\n\tdefer cancel()\n\n\tquery := \"update users set first_name = $1, last_name = $2, email = $3, access_level = $4, updated_at = $5\"\n\n\t_, err := m.DB.ExecContext(ctx, query, user.FirstName, user.LastName, user.Email, user.AccessLevel, time.Now())\n\n\tif err != nil {\n\t\treturn err\n\t}\n\treturn nil\n}", "title": "" }, { "docid": "34c918640cfb7ddca40800703b583186", "score": "0.70492166", "text": "func UpdateUser(w http.ResponseWriter, r *http.Request) {\n\tvars := mux.Vars(r)\n\tbody, err := ioutil.ReadAll(r.Body) //se encarga de obtener todo el contenido del body\n\tif err != nil {\n\t\tresponses.ERROR(w, http.StatusUnprocessableEntity, err)\n\t\treturn\n\t}\n\tNewuser := models.User{}\n\terr = json.Unmarshal(body, &Newuser) //verifica si puede ser convertido a un <<User>> y si es asi, lo convierte\n\tif err != nil {\n\t\tresponses.ERROR(w, http.StatusUnprocessableEntity, err) //manejador de errores\n\t\treturn\n\t}\n\t_ID, err := primitive.ObjectIDFromHex(vars[\"id\"]) //obtiene el id para realizar una actualizacion de un registro x\n\tif err != nil {\n\t\tresponses.ERROR(w, http.StatusInternalServerError, err)\n\t\treturn\n\t}\n\trepo, err := repository.GetRepositoryCrud(w, r) //obtiene la estructura *RepositoryUsersCRUD\n\tif err != nil {\n\t\tresponses.ERROR(w, http.StatusUnprocessableEntity, err)\n\t\treturn\n\t}\n\t//funcion anonima que se encarga de tomar como parametro a cualquier estructura que implemente la interfaz UserRepository\n\tfunc(userRepository repository.UserRepository) {\n\t\tuserID, err := userRepository.Update(_ID, Newuser)\n\t\tif err != nil {\n\t\t\tresponses.ERROR(w, http.StatusInternalServerError, err)\n\t\t\treturn\n\t\t}\n\t\tresponses.JSON(w, http.StatusOK, fmt.Sprintf(\"Updated document ID: [ %s ] at %s \", userID.String(), time.Now()))\n\t}(repo) //--> se callea la funcion anonima mediante ()\n}", "title": "" }, { "docid": "24408d9774ee6e62e7d6fc47b04041e9", "score": "0.70338684", "text": "func UpdateUser(user models.User, id string) (bool, error) {\n\n\tctx, cancel := context.WithTimeout(context.Background(), time.Second*15)\n\tdefer cancel()\n\tdb := Mongodb.Database(\"gotwitter\")\n\tcol := db.Collection(\"users\")\n\t//Pasar el id del usuario de string a ObjectID(asi esta guardado en db)\n\tobjID, _ := primitive.ObjectIDFromHex(id)\n\t//Como es un update se tiene que armar el where\n\twhere := bson.M{\"_id\": bson.M{\"$eq\": objID}} //$eq = equals\n\t//Para mandar a actualizar los datos del usuario se comprueba que campos viene con datos ya que desde el Front solo se envia los campos que han sufrido modificaciones\n\tmodel := make(map[string]interface{}) //Creamos un slice clave valor de tipo Interface que contendra los campos a modificar\n\tif len(user.Nombre) > 0 {\n\t\tmodel[\"nombre\"] = user.Nombre\n\t}\n\tif len(user.Apellido) > 0 {\n\t\tmodel[\"apellido\"] = user.Apellido\n\t}\n\tmodel[\"fechanac\"] = user.FechaNac\n\tif len(user.Avatar) > 0 {\n\t\tmodel[\"avatar\"] = user.Avatar\n\t}\n\tif len(user.Banner) > 0 {\n\t\tmodel[\"banner\"] = user.Banner\n\t}\n\tif len(user.Biografia) > 0 {\n\t\tmodel[\"biografia\"] = user.Biografia\n\t}\n\tif len(user.Ubicacion) > 0 {\n\t\tmodel[\"ubicacion\"] = user.Ubicacion\n\t}\n\tif len(user.Sitioweb) > 0 {\n\t\tmodel[\"sitioweb\"] = user.Sitioweb\n\t}\n\t//Para enviar el modelo a actualizar en Mongo se envia con la siguiente sintaxis\n\tmodelMongo := bson.M{\n\t\t\"$set\": model,\n\t}\n\t_, err := col.UpdateOne(ctx, where, modelMongo)\n\tif err != nil {\n\t\treturn false, err\n\t}\n\treturn true, nil\n}", "title": "" }, { "docid": "938d57f1f50acdaa5d256cad6dd3482c", "score": "0.7029589", "text": "func (c *Client) UpdateUser(user *models.UserModel) error {\n\tbody, err := json.Marshal(&user)\n\tif err != nil {\n\t\treturn err\n\t}\n\n\t// Send data to Moesif async\n\tgo c.SendDataToMoesif(body, \"/v1/users\")\n\n\treturn err\n}", "title": "" }, { "docid": "50ce71da0656cb53aea89c0cfa2d386a", "score": "0.701863", "text": "func Updateuser(c *gin.Context) {\n\tvar us model.user\n\tid := c.Params.ByName(\"id\")\n\terr := service.Getuser(&us, id)\n\tif err != nil {\n\t\tc.JSON(http.StatusNotFound, us)\n\t}\n\tc.BindJSON(&us)\n\terr = service.Updateuser(&us, id)\n\tif err != nil {\n\t\tc.AbortWithStatus(http.StatusNotFound)\n\t} else {\n\t\tc.JSON(http.StatusOK, us)\n\t}\n}", "title": "" }, { "docid": "1fe56965b88b4be3215338ee155f26c7", "score": "0.7012274", "text": "func (a *API) updateUser(rc *wrapper.RequestContext, w http.ResponseWriter, r *http.Request) {\n\tuser := model.UserFromJson(r.Body)\n\tif user == nil {\n\t\trc.SetError(\"Body received for user creation is invalid.\", http.StatusBadRequest)\n\t\treturn\n\t}\n\tif user.UserID == 0 {\n\t\trc.SetError(\"UserId received to update userID is 0.\", http.StatusBadRequest)\n\t\treturn\n\t}\n\tvar err *model.AppError\n\tif user, err = rc.App.UpdateUser(user); err != nil {\n\t\trc.SetError(\"User object update failed.\", http.StatusInternalServerError)\n\t\treturn\n\t}\n\trc.SetAppResponse(user.ToJson(), http.StatusOK)\n}", "title": "" }, { "docid": "05d7cf73201da9639fc22d4c2ded26ba", "score": "0.70116925", "text": "func (u *User) Update(ctx context.Context, user entity.User) error {\n\t_, err := u.ExecContext(ctx, updateUserQuery, user.FirstName, user.LastName, user.NickName, user.Email, user.CountryID)\n\tif err != nil {\n\t\treturn fmt.Errorf(\"query failed, %w\", err)\n\t}\n\n\treturn nil\n}", "title": "" }, { "docid": "bf72c7d783b5868059c1d29aaf20b2a7", "score": "0.6989456", "text": "func UpdateUser(context *gin.Context) {\n\tuser := entity.User{}\n\terr := context.BindJSON(&user)\n\tif err != nil {\n\t\tcontext.String(http.StatusBadRequest, err.Error())\n\t\treturn\n\t}\n\terr = validator.UserValidation(user.ConvertUserToUserBody())\n\tif err != nil {\n\t\tcontext.String(http.StatusBadRequest, err.Error())\n\t\treturn\n\t}\n\terr = service.UpdateUser(user)\n\tif err != nil {\n\t\tcontext.String(http.StatusInternalServerError, err.Error())\n\t\treturn\n\t}\n}", "title": "" }, { "docid": "84804e8058f90b75e401a24ac3a64ee3", "score": "0.6989321", "text": "func (c *IAM) UpdateUser(req *UpdateUserRequest) (err error) {\n\t// NRE\n\terr = c.client.Do(\"UpdateUser\", \"POST\", \"/\", req, nil)\n\treturn\n}", "title": "" }, { "docid": "0a6d8c762d4d77ab1931f20d66b1024b", "score": "0.6987504", "text": "func updateUser(id int64, user models.User, db *sql.DB) int64 {\n\tPingOrPanic(db) // check the connection\n\tsqlStatement := `UPDATE users SET name=$2, email=$3, password=$4 WHERE userId=$1` // create the update sql query\n\trowsAffected := ExecStatementAndGetRowsAffected(db, sqlStatement, id, user.Name, user.Email, user.Password) // check how many rows affected\n\treturn rowsAffected\n}", "title": "" }, { "docid": "d470f383fed8a1d5685b178050b35717", "score": "0.69848096", "text": "func (r *repository) Update(user *repo.UserModel) error {\n\tctx, cancel := context.WithTimeout(context.Background(), 5*time.Second)\n\tdefer cancel()\n\n\tquery := \"UPDATE person SET first_name = ?, last_name = ?,age = ?, date_joined = ?, date_updated = ? WHERE id = ?\"\n\tstmt, err := r.db.PrepareContext(ctx, query)\n\tif err != nil {\n\t\treturn err\n\t}\n\tdefer stmt.Close()\n\n\t_, err = stmt.ExecContext(ctx, user.IDdb,\n\t\tuser.FirstNamedb,\n\t\tuser.LastNamedb,\n\t\tuser.Agedb,\n\t\tuser.DateJoineddb,\n\t\tuser.DateUpdateddb)\n\treturn err\n}", "title": "" }, { "docid": "c9185243fa76993c1cbaa6491f22c2ac", "score": "0.6977303", "text": "func UpdateUserHandler(w http.ResponseWriter, r *http.Request) {\n\tuid := GetUIDOrRedirect(w, r)\n\tif uid == 0 {\n\t\treturn\n\t}\n\n\tdb := GetDBOrPrintError(w)\n\tif db == nil {\n\t\treturn\n\t}\n\tvar user PtUser\n\tdb.First(&user, uid)\n\tdecoder := json.NewDecoder(r.Body)\n\terr := decoder.Decode(&user)\n\tif err != nil {\n\t\tJsonDecodeError(w, err)\n\t}\n\n\tdefer db.Close()\n\tdb.Model(PtUser{Id: uid}).Update(user)\n\n\tj, _ := json.Marshal(user)\n\tfmt.Fprintln(w, string(j))\n}", "title": "" }, { "docid": "e6c21e809cfd9fc9c655262e6a17e70e", "score": "0.6976822", "text": "func UpdateUser(db *sql.DB, u sdk.User) error {\n\tquery := `UPDATE \"user\" SET username=$1, admin=$2, data=$3 WHERE id=$4`\n\tu.Groups = nil\n\t_, err := db.Exec(query, u.Username, u.Admin, u.JSON(), u.ID)\n\treturn err\n}", "title": "" }, { "docid": "ea6ed342665b1b4ddd53b31025e373ca", "score": "0.6971311", "text": "func (m *UserManager) updateUser(userID string, updateReq *User) error {\n\tuInfo := &User{}\n\terr := m.db.Get(usersCollection, userID, uInfo)\n\tif err != nil {\n\t\treturn cmn.NewErrNotFound(\"user-manager: %s user %q\", svcName, userID)\n\t}\n\tif userID == adminID && len(updateReq.Roles) != 0 {\n\t\treturn errors.New(\"cannot change administrator's role\")\n\t}\n\n\tif updateReq.Password != \"\" {\n\t\tuInfo.Password = encryptPassword(updateReq.Password)\n\t}\n\tif len(updateReq.Roles) != 0 {\n\t\tuInfo.Roles = updateReq.Roles\n\t}\n\tuInfo.Clusters = MergeClusterACLs(uInfo.Clusters, updateReq.Clusters)\n\tuInfo.Buckets = MergeBckACLs(uInfo.Buckets, updateReq.Buckets)\n\n\treturn m.db.Set(usersCollection, userID, uInfo)\n}", "title": "" }, { "docid": "443b76681aec6b7697b076947c029d99", "score": "0.69705397", "text": "func (u UserResource) UpdateUser(request *restful.Request, response *restful.Response) {\n\tuser := new(model.User)\n\terr := request.ReadEntity(&user)\n\tif err != nil {\n\t\tresponse.WriteError(http.StatusBadRequest, err)\n\t} else {\n\t\tif err := userService.Update(user); err != nil {\n\t\t\tresponse.WriteError(http.StatusInternalServerError, err)\n\t\t} else {\n\t\t\tresponse.WriteHeader(http.StatusNoContent)\n\t\t}\n\t}\n}", "title": "" }, { "docid": "d8a157bb38a08b7de9d078ad8dbe7f5c", "score": "0.6967509", "text": "func UpdateUser(user User) *User {\n\to := orm.NewOrm()\n\tu := User{Id: user.Id}\n\tvar updatedUser User\n\n\t// get existing user\n\tif o.Read(&u) == nil {\n\n\t\t// updated user\n\t\t// hash new password\n\t\t//user.Password, _ = hashPassword(user.Password)\n\n\t\t// Keep the old registration date in case user tries to update it\n\t\t//user.RegDate = u.RegDate\n\t\tu = user\n\t\t_, err := o.Update(&u)\n\n\t\t// read updated user\n\t\tif err == nil {\n\t\t\t// update successful\n\t\t\tupdatedUser = User{Id: user.Id}\n\t\t\to.Read(&updatedUser)\n\t\t}\n\t}\n\n\treturn &updatedUser\n}", "title": "" }, { "docid": "3c98c4aae347399a5319ee5e48d828d3", "score": "0.69648683", "text": "func (ug *userGorm) Update(user *User) error {\n\treturn ug.db.Save(user).Error\n}", "title": "" }, { "docid": "3c98c4aae347399a5319ee5e48d828d3", "score": "0.69648683", "text": "func (ug *userGorm) Update(user *User) error {\n\treturn ug.db.Save(user).Error\n}", "title": "" }, { "docid": "3c98c4aae347399a5319ee5e48d828d3", "score": "0.69648683", "text": "func (ug *userGorm) Update(user *User) error {\n\treturn ug.db.Save(user).Error\n}", "title": "" }, { "docid": "a3748d9c4ec68be8e61c4aaa4696452d", "score": "0.69468784", "text": "func (u *users) UpdateUser() gin.HandlerFunc {\n\t// TODO: implement\n\treturn func(ctx *gin.Context) {}\n}", "title": "" }, { "docid": "1e25e45ac1d87d57ee2c21d8f0e4a03e", "score": "0.69464135", "text": "func UserUpdate(m *mongo.Database, u *UserUpdateData) error {\n\t// Create a DB connection\n\tdb := m.Collection(usersCollectionName)\n\n\t// Set the new values for active and role\n\tr, err := db.UpdateOne(context.TODO(), bson.M{\"_id\": u.ID}, bson.M{\n\t\t\"$set\": bson.M{\"active\": u.Active, \"role\": u.Role},\n\t})\n\tif err != nil {\n\t\treturn internal.NewError(internal.ErrDBUpdate, err, 1)\n\t}\n\n\t// If no data was updated, return an error\n\tif r.ModifiedCount == 0 {\n\t\treturn internal.NewError(internal.ErrDBNoUpdate, err, 1)\n\t}\n\n\treturn nil\n}", "title": "" }, { "docid": "0bc108e1b3589030c2d9aa8f9ea870a9", "score": "0.69459707", "text": "func (psql *Repository) UpdateUser(user *entity.User) error {\n\tstmt, _ := psql.connection.Prepare(`UPDATE Users SET first_name = ?, last_name = ?, phonenumber = ?, email = ?, job_title = ?,\n\t\tcountry = ?, city = ?, gender = ?, cv = ?, profile_pic = ?, bio = ?, prefe = ? WHERE uid = ?`)\n\t_, err := stmt.Exec(\n\t\tuser.Firstname,\n\t\tuser.Lastname,\n\t\tuser.Phonenumber,\n\t\tuser.Email,\n\t\tuser.JobTitle,\n\t\tuser.Country,\n\t\tuser.City,\n\t\tuser.Gender,\n\t\tuser.CV,\n\t\tuser.ProfilePic,\n\t\tuser.Bio,\n\t\tuser.Prefe,\n\t\tuser.UID)\n\n\tif err != nil {\n\t\treturn err\n\t}\n\treturn nil\n\n}", "title": "" }, { "docid": "03f87f26ef56fd95b42d397785dbc5b0", "score": "0.69395363", "text": "func UserUpdate(ctx context.Context, user *model.User, id *string, userRepo model.UserRepository) error {\n\treqID := utils.GetReqIDFromContext(ctx)\n\tlogger := log.WithFields(log.Fields{\n\t\tconstant.ReqID: reqID,\n\t})\n\tlogger.Debug(\"Enter in UserUpdate service\")\n\n\treturn userRepo.Update(ctx, id, user)\n}", "title": "" }, { "docid": "f7a728b2cb6e37aa5ffdb9e97c4ed46a", "score": "0.6937284", "text": "func (s *UserService) UpdateUser(user *allowance.User) error {\n\tuser.UpdatedAt = time.Now()\n\terr := s.db.Update(user)\n\treturn err\n}", "title": "" }, { "docid": "c5da82afb947b94fd455de03263e2232", "score": "0.6935622", "text": "func (m User) UpdateUser() error{\n\tc := newUserCollection()\n\tdefer c.Close()\n\t\n\terr := c.Session.Update(bson.M{\n\t\t\"_id\": m.ID,\n\t}, bson.M{\n\t\t\"$set\": bson.M{\n\"firstName\": m.FirstName,\"lastName\": m.LastName,\"birthDay\": m.BirthDay,\"position\": m.Position,},\n\n\t})\n\treturn err\n}", "title": "" }, { "docid": "29d0e941172d4a6724e19568e2fc98ee", "score": "0.6930451", "text": "func UpdateUser(user models.User) (int64, error) {\n\tnum, err := o.Update(&user)\n\tif err != nil {\n\t\treturn num, err\n\t}\n\treturn num, nil\n}", "title": "" }, { "docid": "cbb0248cd226a295d6c437a5cc5d8919", "score": "0.69301355", "text": "func (user *User) Update() *errors.RestError {\n\tstmt, err := users_db.Client.Prepare(queryUpdateUser)\n\tif err != nil {\n\t\tlogger.Error(\"error when trying to prepare save user statement\", err)\n\t\treturn errors.NewInternalServerError(\"Database Error\")\n\t}\n\tdefer stmt.Close()\n\n\t_, err = stmt.Exec(user.Firstname, user.Lastname, user.Email, user.Status, user.Password, user.ID)\n\tif err != nil {\n\t\tlogger.Error(\"error when trying to execute user statement\", err)\n\t\treturn errors.NewInternalServerError(\"Database Error\")\n\t}\n\treturn nil\n}", "title": "" }, { "docid": "162832d11e8f3ffe31fa1f447d017012", "score": "0.6929218", "text": "func (resolver *UserResolver) UpdateUser(params graphql.ResolveParams) (interface{}, error) {\n\tuser, err := resolver.DB.UpdateUser(params.Args)\n\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\treturn user, nil\n}", "title": "" }, { "docid": "bf06d773475ce981ec3e261d7ec163ff", "score": "0.6921102", "text": "func (api API) UpdateUser() (User, error) {\n\t// api.makeRequest(\"PATCH\", \"/user\", user)\n\treturn User{}, nil\n}", "title": "" }, { "docid": "7105bd50cc409ff28ea8f6d2c58f5be6", "score": "0.69145733", "text": "func (svc *UserService) UpdateUser(id string, obj *nimbleos.User) (*nimbleos.User, error) {\n\tif obj == nil {\n\t\treturn nil, fmt.Errorf(\"UpdateUser: invalid parameter specified, %v\", obj)\n\t}\n\n\tuserResp, err := svc.objectSet.UpdateObject(id, obj)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\treturn userResp, nil\n}", "title": "" }, { "docid": "9da86ff8f58d6081f932341213ef6735", "score": "0.6908667", "text": "func UpdateUser(c *gin.Context) {\n\tvar student Models.Student\n\tid := c.Params.ByName(\"id\")\n\terr := Models.GetUserByID(&student, id)\n\tif err != nil {\n\t\tc.JSON(http.StatusNotFound, student)\n\t}\n\terror_ := c.BindJSON(&student)\n\tif error_ != nil {\n\t\tfmt.Println(error_.Error())\n\t}\n\terr = Models.UpdateUser(&student, id)\n\tif err != nil {\n\t\tc.AbortWithStatus(http.StatusNotFound)\n\t} else {\n\t\tc.JSON(http.StatusOK, student)\n\t}\n}", "title": "" }, { "docid": "e1e6a3ee1ffbd925842c9965e6986ef4", "score": "0.69057167", "text": "func (c *Client) UpdateUser(userid string, obj User) (*User, error) {\n\turl := userPath(userid)\n\tret := &User{}\n\terr := c.Put(url, obj, ret, http.StatusAccepted)\n\treturn ret, err\n}", "title": "" }, { "docid": "35a832442cc9be30c34b4cab36d9882a", "score": "0.69020575", "text": "func UpdateUser(user models.AdminUser, updatedBy string) error {\n\tdbUser, err := models.FindAdminUserG(user.ID)\n\n\tif err != nil {\n\t\treturn err\n\t}\n\n\tif dbUser == nil {\n\t\treturn errors.New(\"User not found\")\n\t}\n\n\twhitelist := make([]string, 0)\n\twhitelist = append(whitelist, models.AdminUserColumns.Forename,\n\t\tmodels.AdminUserColumns.Lastname,\n\t\tmodels.AdminUserColumns.Phone,\n\t\tmodels.AdminUserColumns.Active,\n\t\tmodels.AdminUserColumns.UpdatedBy,\n\t\tmodels.AdminUserColumns.UpdatedAt)\n\n\tif user.Password != \"\" {\n\t\tdbUser.Password = user.Password\n\t\twhitelist = append(whitelist, models.AdminUserColumns.Password)\n\t}\n\tdbUser.Forename = user.Forename\n\tdbUser.Lastname = user.Lastname\n\tdbUser.Phone = user.Phone\n\tdbUser.Active = user.Active\n\tdbUser.UpdatedBy = updatedBy\n\tdbUser.UpdatedAt = time.Now()\n\n\t_, err = dbUser.UpdateG(boil.Whitelist(whitelist...))\n\tif err != nil {\n\t\treturn err\n\t}\n\n\treturn nil\n}", "title": "" }, { "docid": "5b82e009ddac55d5ce1948e2dcd401af", "score": "0.68872327", "text": "func (a *API) UserUpdate(w http.ResponseWriter, r *http.Request) error {\n\tctx := r.Context()\n\tconfig := a.getConfig(ctx)\n\tinstanceID := getInstanceID(ctx)\n\n\tparams := &UserUpdateParams{}\n\tjsonDecoder := json.NewDecoder(r.Body)\n\terr := jsonDecoder.Decode(params)\n\tif err != nil {\n\t\treturn badRequestError(\"Could not read User Update params: %v\", err)\n\t}\n\n\tclaims := getClaims(ctx)\n\tuserID, err := uuid.FromString(claims.Subject)\n\tif err != nil {\n\t\treturn badRequestError(\"Could not read User ID claim\")\n\t}\n\n\tuser, err := models.FindUserByID(a.db, userID)\n\tif err != nil {\n\t\tif models.IsNotFoundError(err) {\n\t\t\treturn notFoundError(err.Error())\n\t\t}\n\t\treturn internalServerError(\"Database error finding user\").WithInternalError(err)\n\t}\n\n\tlog := getLogEntry(r)\n\tlog.Debugf(\"Checking params for token %v\", params)\n\n\terr = a.db.Transaction(func(tx *storage.Connection) error {\n\t\tvar terr error\n\t\tif params.Password != \"\" {\n\t\t\tif terr = user.UpdatePassword(tx, params.Password); terr != nil {\n\t\t\t\treturn internalServerError(\"Error during password storage\").WithInternalError(terr)\n\t\t\t}\n\t\t}\n\n\t\tif params.Data != nil {\n\t\t\tif terr = user.UpdateUserMetaData(tx, params.Data); terr != nil {\n\t\t\t\treturn internalServerError(\"Error updating user\").WithInternalError(terr)\n\t\t\t}\n\t\t}\n\n\t\tif params.AppData != nil {\n\t\t\tif !a.isAdmin(ctx, user, config.JWT.Aud) {\n\t\t\t\treturn unauthorizedError(\"Updating app_metadata requires admin privileges\")\n\t\t\t}\n\n\t\t\tif terr = user.UpdateAppMetaData(tx, params.AppData); terr != nil {\n\t\t\t\treturn internalServerError(\"Error updating user\").WithInternalError(terr)\n\t\t\t}\n\t\t}\n\n\t\tif params.EmailChangeToken != \"\" {\n\t\t\tlog.Debugf(\"Got change token %v\", params.EmailChangeToken)\n\n\t\t\tif params.EmailChangeToken != user.EmailChangeToken {\n\t\t\t\treturn unauthorizedError(\"Email Change Token didn't match token on file\")\n\t\t\t}\n\n\t\t\tif terr = user.ConfirmEmailChange(tx); terr != nil {\n\t\t\t\treturn internalServerError(\"Error updating user\").WithInternalError(terr)\n\t\t\t}\n\t\t} else if params.Email != \"\" && params.Email != user.Email {\n\t\t\tif terr = a.validateEmail(ctx, params.Email); terr != nil {\n\t\t\t\treturn terr\n\t\t\t}\n\n\t\t\tvar exists bool\n\t\t\tif exists, terr = models.IsDuplicatedEmail(tx, instanceID, params.Email, user.Aud); terr != nil {\n\t\t\t\treturn internalServerError(\"Database error checking email\").WithInternalError(terr)\n\t\t\t} else if exists {\n\t\t\t\treturn unprocessableEntityError(\"Email address already registered by another user\")\n\t\t\t}\n\n\t\t\tmailer := a.Mailer(ctx)\n\t\t\treferrer := a.getReferrer(r)\n\t\t\tif terr = a.sendEmailChange(tx, user, mailer, params.Email, referrer); terr != nil {\n\t\t\t\treturn internalServerError(\"Error sending change email\").WithInternalError(terr)\n\t\t\t}\n\t\t}\n\n\t\tif terr = models.NewAuditLogEntry(tx, instanceID, user, models.UserModifiedAction, nil); terr != nil {\n\t\t\treturn internalServerError(\"Error recording audit log entry\").WithInternalError(terr)\n\t\t}\n\n\t\treturn nil\n\t})\n\tif err != nil {\n\t\treturn err\n\t}\n\n\treturn sendJSON(w, http.StatusOK, user)\n}", "title": "" }, { "docid": "5464446df2c5d116d37cdf3c49c88113", "score": "0.6886501", "text": "func UpdateUser(p User) error {\n\ti := findIndexByUserID(p.ID)\n\tif i == -1 {\n\t\treturn ErrUserNotFound\n\t}\n\n\t// update the user in the DB\n\tuserList[i] = &p\n\n\treturn nil\n}", "title": "" }, { "docid": "3a42659a543086107b38db2e8ed3cad9", "score": "0.68808436", "text": "func UpdateUserHandler(w http.ResponseWriter, r *http.Request) {\n\tlog.Debug(\"UpdateUserHandler\")\n\n\t// Verify Request\n\tmethod := r.Method\n\tif method != `PUT` {\n\t\thttpError(w, http.StatusMethodNotAllowed, `method PUT is expected`, nil)\n\t\treturn\n\t}\n\tctype := r.Header[\"Content-Type\"][0]\n\tif ctype != `application/json` {\n\t\thttpError(w, http.StatusBadRequest, `Content-Type: application/json is expected`, nil)\n\t\treturn\n\t}\n\n\tvar updateUserRequest model.UpdateUserRequest\n\tif err := json.NewDecoder(r.Body).Decode(&updateUserRequest); err != nil {\n\t\thttpError(w, http.StatusBadRequest, `invalid json request`, err)\n\t\treturn\n\t}\n\tupdater := db.User{\n\t\tID: updateUserRequest.ID,\n\t\tName: updateUserRequest.Username,\n\t\tPassword: updateUserRequest.NewPassword,\n\t}\n\n\t// main logic\n\ttx, err := db.BeginTx()\n\tif err != nil {\n\t\thttpError(w, http.StatusInternalServerError, `internal server error`, err)\n\t\treturn\n\t}\n\tusrSvc := service.UserService{}\n\tu, err := usrSvc.Lookup(tx, updateUserRequest.ID)\n\tif err != nil {\n\t\tif errors.Cause(err) == sql.ErrNoRows {\n\t\t\thttpError(w, http.StatusUnauthorized, `authorization failed`, nil)\n\t\t\treturn\n\t\t}\n\t\thttpError(w, http.StatusInternalServerError, `internal server error`, err)\n\t\treturn\n\t}\n\tif u.Password != utils.HashPassword(updateUserRequest.OldPassword, u.ID+u.Name) {\n\t\thttpError(w, http.StatusUnauthorized, `authorization failed`, nil)\n\t\treturn\n\t}\n\tif err := usrSvc.Update(tx, &updater); err != nil {\n\t\thttpError(w, http.StatusInternalServerError, `internal server error`, err)\n\t\treturn\n\t}\n\tif err := tx.Commit(); err != nil {\n\t\thttpError(w, http.StatusInternalServerError, `internal server error`, err)\n\t\treturn\n\t}\n\thttpJSON(w, map[string]string{\"message\": \"success\"})\n}", "title": "" }, { "docid": "69637ce52d80c9f99849439ddcaf9890", "score": "0.687671", "text": "func (repository Users) UpdateUser(ID uint64, user models.User) error {\n\tstatement, err := repository.db.Prepare(\n\t\t\"update users set name = ?, nick = ?, email = ? where id = ?\",\n\t)\n\tif err != nil {\n\t\treturn err\n\t}\n\tdefer statement.Close()\n\n\tif _, err = statement.Exec(user.Name, user.Nick, user.Email, ID); err != nil {\n\t\treturn err\n\t}\n\n\treturn nil\n}", "title": "" }, { "docid": "431d9299ce13210c004a36052f3f0d6a", "score": "0.68702286", "text": "func (u *UserUpdateSerializer) UpdateUser(cfg Config, user *User) {\n\tuser.Username = u.Username\n\tuser.FirstName = u.FirstName\n\tuser.LastName = u.LastName\n\tuser.Email = u.Email\n\n\tif u.passwordChange {\n\t\tcfg.Manager().User().SetPassword(user, u.Password)\n\t}\n\tuser.IsActive = u.IsActive\n\tuser.IsAdmin = u.IsAdmin\n\tuser.CanList = u.CanList\n\tuser.CanDownload = u.CanDownload\n\tuser.CanCreate = u.CanCreate\n\tuser.CanUpdate = u.CanUpdate\n}", "title": "" }, { "docid": "18abc24c8021385bd5986116e9670a5e", "score": "0.6861096", "text": "func (c *Core) Update(ctx context.Context, usr User, uu UpdateUser) (User, error) {\n\tif uu.Name != nil {\n\t\tusr.Name = *uu.Name\n\t}\n\tif uu.Email != nil {\n\t\tusr.Email = *uu.Email\n\t}\n\tif uu.Roles != nil {\n\t\tusr.Roles = uu.Roles\n\t}\n\tif uu.Password != nil {\n\t\tpw, err := bcrypt.GenerateFromPassword([]byte(*uu.Password), bcrypt.DefaultCost)\n\t\tif err != nil {\n\t\t\treturn User{}, fmt.Errorf(\"generatefrompassword: %w\", err)\n\t\t}\n\t\tusr.PasswordHash = pw\n\t}\n\tif uu.Department != nil {\n\t\tusr.Department = *uu.Department\n\t}\n\tif uu.Enabled != nil {\n\t\tusr.Enabled = *uu.Enabled\n\t}\n\tusr.DateUpdated = time.Now()\n\n\tif err := c.storer.Update(ctx, usr); err != nil {\n\t\treturn User{}, fmt.Errorf(\"update: %w\", err)\n\t}\n\n\tif err := c.evnCore.SendEvent(ctx, uu.UpdatedEvent(usr.ID)); err != nil {\n\t\treturn User{}, fmt.Errorf(\"failed to send a `%s` event: %w\", EventUpdated, err)\n\t}\n\n\treturn usr, nil\n}", "title": "" }, { "docid": "c8bdcd82e3d92bb6ea2259c419b6cee3", "score": "0.68598056", "text": "func (c *UserController) Update(args *msg.UpdateUserArgs,\n\tresponse *msg.UpdateUserResponse) error {\n\tuser := models.User(*(*args))\n\terr := c.UserRepo.Update(&user)\n\n\tresult := err == nil\n\t*response = msg.UpdateUserResponse(result)\n\n\treturn err\n}", "title": "" }, { "docid": "f57051c30419a9871c4f83f92d43942a", "score": "0.6857511", "text": "func (app *Lipisha) UpdateUser(fullName, role, mobileNumber, email, userName, password string) (string, error) {\n\n\tdata := url.Values{}\n\tdata.Set(\"full_name\", fullName)\n\tdata.Set(\"role\", role)\n\tdata.Set(\"mobile_number\", mobileNumber)\n\tdata.Set(\"email\", email)\n\tdata.Set(\"user_name\", userName)\n\tdata.Set(\"password\", password)\n\n\treturn app.getURLResponse(updateUser, data)\n}", "title": "" }, { "docid": "c732427ca2c965ed0b9c0f697414d3c5", "score": "0.6856205", "text": "func (d DefaultSec) UpdateUser(dbConn *sql.DB, user User) error {\n\tlogit.Info.Println(\"DefaultSec.UpdateUser\")\n\terr := DBUpdateUser(dbConn, user)\n\tif err != nil {\n\t\tlogit.Error.Println(err.Error())\n\t\treturn err\n\t}\n\n\treturn nil\n}", "title": "" }, { "docid": "eaf0638467867525ace4db911d9760cb", "score": "0.68526125", "text": "func (u *UserModel) Update() error {\n\treturn DB.Save(u).Error\n}", "title": "" }, { "docid": "4dd56770b45eaffb44d70531be7b7dd3", "score": "0.6851608", "text": "func EditUser(c *gin.Context) {\n\tvar users Users\n\tuserId := c.Param(\"id\")\n\tdb := Database()\n\tdb.First(&users, userId)\n\n\tif users.ID == 0 {\n\t\tc.JSON(http.StatusNotFound, gin.H{\"status\": http.StatusNotFound, \"message\": \"No User Found!\"})\n\t\treturn\n\t}\n\n\tdb.Model(&users).Where(\"id = ?\", userId).Updates(Users{\n\t\tIsValidated: users.IsValidated,\n\t\tVersion: users.Version,\n\t\tEmail: users.Email,\n\t\tUsername: users.Username,\n\t})\n\n\tc.JSON(http.StatusOK, gin.H{\"status\": http.StatusOK, \"message\": \"User updated successfully!\"})\n}", "title": "" }, { "docid": "9b0bed8d2f218d62dbd4d6ed57c13a66", "score": "0.6841356", "text": "func (c *Client) UserUpdate(params *UserUpdateParams) (*User, error) {\n\twrapper := &userUpdateParamsWrapper{Params: params.Params, User: params}\n\tobj := &User{}\n\terr := c.request(\"PUT\", \"/v2/user\", params, wrapper, obj)\n\treturn obj, err\n}", "title": "" }, { "docid": "3c1e68c68dfd689fa239adac994e336b", "score": "0.68406916", "text": "func (s UserService) UpdateUser(u domain.User) (*domain.User, error) {\n\treturn nil, nil\n}", "title": "" }, { "docid": "241a23cb7f178f1ac89491a202d0d090", "score": "0.6836866", "text": "func UpdateUser(user map[string]interface{}) (id int, err error) {\r\n\tif result, err := MaptoUpdate(user, \"users\", \"id\"); err == nil {\r\n\t\tif err = Modify(result); err != nil {\r\n\t\t\tCheckError(\"Error updating the user.\", err, false)\r\n\t\t}\r\n\t}\r\n\r\n\treturn\r\n}", "title": "" }, { "docid": "13c785e9747ae4d27f757ec637af2a93", "score": "0.6835811", "text": "func (u *User) UpdateUser(db *sql.DB) error {\n\t_, err := db.Exec(\"UPDATE users SET emailaddress=$1, password=$2 WHERE id=$3\", u.Emailaddress, u.Password, u.ID)\n\treturn err\n}", "title": "" }, { "docid": "65edd8281ba966f2a790266e793e950f", "score": "0.68323565", "text": "func UserUpdate(w http.ResponseWriter, r *http.Request, ps httprouter.Params) {\n\tresponse := CreateResponse{}\n\tid := ps.ByName(\"id\")\n\temail := r.FormValue(\"email\")\n\n\tvar userCount int\n\n\terr := database.QueryRow(\"SELECT COUNT(user_id) FROM users WHERE user_id=?\", id).Scan(&userCount)\n\n\tif userCount == 0 {\n\t\terrMsg := ErrorMessages(404)\n\t\tlog.Println(errMsg.ErrCode)\n\t\tlog.Println(w, errMsg.Msg, errMsg.StatusCode)\n\t\tfmt.Fprintln(w, errMsg.Msg, \" : \", errMsg.StatusCode)\n\t\treturn\n\t} else if err != nil {\n\t\tlog.Println(err)\n\t\treturn\n\t} else {\n\t\t_, err = database.Exec(\"UPDATE users SET user_email=? WHERE user_id=?\", email, id)\n\n\t\tif err != nil {\n\t\t\t_, errorCode := dbErrorParse(err.Error())\n\t\t\terrMsg := ErrorMessages(errorCode)\n\n\t\t\thttp.Error(w, errMsg.Msg, errMsg.StatusCode)\n\t\t} else {\n\t\t\tresponse.Error = \"success\"\n\t\t\tresponse.ErrorCode = \"0\"\n\t\t\toutput, _ := json.Marshal(response)\n\t\t\tfmt.Fprintln(w, string(output))\n\t\t}\n\t}\n}", "title": "" }, { "docid": "2b5c5c4f05696a10dcb76d23ac3a1797", "score": "0.68290716", "text": "func (m *postgresDBRepo) UpdateUser(user models.User) error {\n\tctx, cancel := context.WithTimeout(context.Background(), 3*time.Second) // cancel transaction if it takes longer than 3 seconds to complete\n\tdefer cancel()\n\n\tquery := `\n\t\tUPDATE users \n\t\tSET username = $1, first_name = $2, last_name = $3, email = $4\n\t`\n\t_, err := m.DB.ExecContext(ctx, query, \n\t\t&user.Username,\n\t\t&user.FirstName,\n\t\t&user.LastName,\n\t\t&user.Email,\n\t)\n\tif err != nil {\n\t\treturn err\n\t}\n\n\treturn nil\n}", "title": "" }, { "docid": "021cc97f5669e5dcc9c976fe09b8dfa3", "score": "0.682533", "text": "func UpdateUser(ctx context.Context, user *User) error {\n\tkey := datastore.NewKey(ctx, \"User\", user.Email, 0, nil)\n\t_, err := datastore.Put(ctx, key, user)\n\treturn err\n}", "title": "" }, { "docid": "e01d96583a768c709f48221143c4dd32", "score": "0.6824628", "text": "func (db *GormDB) UpdateUser(user *pb.User) error {\n\tif err := db.conn.First(&pb.User{ID: user.GetID()}).Error; err != nil {\n\t\treturn err\n\t}\n\treturn db.conn.Save(&user).Error\n}", "title": "" }, { "docid": "5047390e2219babfa2be142749744d3a", "score": "0.6823608", "text": "func (api *RbacApi) UpdateUser(c iris.Context) {\n\tvar p struct {\n\t\tSystem string `json:\"system\" validate:\"required\"`\n\t\tUID string `json:\"uid\" validate:\"required\"`\n\t\tNewRoles []string `json:\"new_roles\" validate:\"required\"`\n\t}\n\tif validateParams(c, &p) != nil {\n\t\treturn\n\t}\n\n\terr := api.rbac.UpdateUser(p.System, p.UID, p.NewRoles...)\n\tapi.responseByError(c, err)\n}", "title": "" }, { "docid": "97ca8596b463e079e79444d2d3472291", "score": "0.6817323", "text": "func (repo *Repository) Update(user *userPB.User) (*userPB.User, error) {\n\tquery := fmt.Sprintf(\"UPDATE users SET first_name = '%s', last_name = '%s', username = '%s', password = '%s',\"+\n\t\t\" email_address = '%s', phone_number = '%s', date_of_birth = '%s', address = '%s', role = '%s',\"+\n\t\t\" credit_card_number = '%s', credit_card_type = '%s', credit_card_expired_month = '%s', credit_card_expired_year = '%s',\"+\n\t\t\" credit_card_cvv = '%s', status = 'active', n = '%s', g = '%s' WHERE id = %d\", user.FirstName, user.LastName, user.Username,\n\t\tuser.Password, user.EmailAddress, user.PhoneNumber, user.DateOfBirth, user.Address, user.Role,\n\t\tuser.CreditCardNumber, user.CreditCardType, user.CreditCardExpiredMonth, user.CreditCardExpiredYear,\n\t\tuser.CreditCardCvv, user.N, user.G, user.Id)\n\t_, err := repo.DB.Exec(query)\n\n\treturn user, err\n}", "title": "" }, { "docid": "457d260395f92ba9d6cb5197068e7a19", "score": "0.68142", "text": "func (m *mgr) updateUser(userID string, updateReq *authn.User) error {\n\tuInfo := &authn.User{}\n\terr := m.db.Get(usersCollection, userID, uInfo)\n\tif err != nil {\n\t\treturn cos.NewErrNotFound(\"%s: user %q\", svcName, userID)\n\t}\n\tif userID == adminUserID && len(updateReq.Roles) != 0 {\n\t\treturn errors.New(\"cannot change administrator's role\")\n\t}\n\n\tif updateReq.Password != \"\" {\n\t\tuInfo.Password = encryptPassword(updateReq.Password)\n\t}\n\tif len(updateReq.Roles) != 0 {\n\t\tuInfo.Roles = updateReq.Roles\n\t}\n\tuInfo.ClusterACLs = mergeClusterACLs(uInfo.ClusterACLs, updateReq.ClusterACLs, \"\")\n\tuInfo.BucketACLs = mergeBckACLs(uInfo.BucketACLs, updateReq.BucketACLs, \"\")\n\n\treturn m.db.Set(usersCollection, userID, uInfo)\n}", "title": "" }, { "docid": "e86a03c42083b1240337032e21122efc", "score": "0.6813645", "text": "func UpdateUserById(m *User) (err error) {\n\to := orm.NewOrm()\n\tv := User{Id: m.Id}\n\t// ascertain id exists in the database\n\tif err = o.Read(&v); err == nil {\n\t\tvar num int64\n\t\tif num, err = o.Update(m); err == nil {\n\t\t\tfmt.Println(\"Number of records updated in database:\", num)\n\t\t}\n\t}\n\treturn\n}", "title": "" }, { "docid": "e86a03c42083b1240337032e21122efc", "score": "0.6813645", "text": "func UpdateUserById(m *User) (err error) {\n\to := orm.NewOrm()\n\tv := User{Id: m.Id}\n\t// ascertain id exists in the database\n\tif err = o.Read(&v); err == nil {\n\t\tvar num int64\n\t\tif num, err = o.Update(m); err == nil {\n\t\t\tfmt.Println(\"Number of records updated in database:\", num)\n\t\t}\n\t}\n\treturn\n}", "title": "" }, { "docid": "1d6c8bd47890bdc47f29cecc47684133", "score": "0.6808042", "text": "func (dao UserImplMysql) Update(u *models.User) error {\n\tquery := \"UPDATE allusers SET name = ?, gender = ?, age = ? WHERE id=?\"\n\tdb := get()\n\tdefer db.Close()\n\tstmt, err := db.Prepare(query)\n\n\tif err != nil {\n\t\treturn err\n\t}\n\tdefer stmt.Close()\n\t_, err = stmt.Query(NewNullString(u.Name), NewNullString(u.Gender), u.Age, u.Id)\n\tif err != nil {\n\t\treturn err\n\t}\n\treturn nil\n}", "title": "" }, { "docid": "ae2ce11c9043bedac842ae1272725a25", "score": "0.680628", "text": "func UserUpdate(user interface{}, username Key) error {\n\treturn tryUpdateVersion(tblUser.Get(username), user)\n}", "title": "" }, { "docid": "21e5bb8a5956f2416bf8642af69af1d8", "score": "0.68007827", "text": "func (h *UserHandler) UpdateUser(w http.ResponseWriter, r *http.Request) {\n\tvars := mux.Vars(r)\n\trid := vars[\"id\"]\n\n\tclaims, err := auth.ExtractClaims(r)\n\tif err != nil {\n\t\tw.WriteHeader(http.StatusUnauthorized)\n\t\treturn\n\t}\n\n\trole, ok := claims[\"role\"].(string)\n\tif !ok {\n\t\tw.WriteHeader(http.StatusUnauthorized)\n\t\treturn\n\t}\n\n\tswitch role {\n\tcase \"admin\":\n\n\tcase \"visitor\":\n\t\tw.WriteHeader(http.StatusForbidden)\n\t\treturn\n\n\tdefault:\n\t\tcid, ok := claims[\"user_id\"].(string)\n\t\tif !ok {\n\t\t\tw.WriteHeader(http.StatusUnauthorized)\n\t\t\treturn\n\t\t}\n\t\tif cid != rid {\n\t\t\tw.WriteHeader(http.StatusForbidden)\n\t\t\treturn\n\t\t}\n\t}\n\n\tw.Write([]byte(\"updateUser\"))\n}", "title": "" }, { "docid": "dedd8254f41f399507ac9c2ced0be198", "score": "0.6797791", "text": "func UpdateUserByUser(newUser User) error {\n\tvar user User\n\n\t// Update NewUser Data (If the new data has an empty field, it will be completed with the old stored data)\n\tif err := DB.C(\"users\").Find(bson.M{\"_id\": newUser.ID}).One(&user); err != nil {\n\t\treturn err\n\t}\n\tif newUser.FirstName != \"\" {\n\t\tuser.FirstName = newUser.FirstName\n\t}\n\tif newUser.LastName != \"\" {\n\t\tuser.LastName = newUser.LastName\n\t}\n\tuser.FullName = user.FirstName + \" \" + user.LastName\n\tif newUser.Phone != \"\" {\n\t\tuser.Phone = newUser.Phone\n\t}\n\tif newUser.Email != \"\" {\n\t\tuser.Email = newUser.Email\n\t}\n\tif newUser.Password != \"\" {\n\t\tnewPassword, _ := GenerateStringHashedPassword(newUser.Password)\n\t\tuser.Password = newPassword\n\t}\n\tif newUser.CooperativeID != nil {\n\t\tuser.CooperativeID = newUser.CooperativeID\n\t}\n\tuser.Role = newUser.Role\n\tuser.UpdatedAt = time.Now().UTC()\n\n\tif err := DB.C(\"users\").UpdateId(user.ID, user); err != nil {\n\t\tif err.Error() != \"not found\" {\n\t\t\tlog.Errorf(\"Error in domain.UpdateUserByID -> error: %v\", err.Error())\n\t\t}\n\t\treturn err\n\t}\n\n\treturn nil\n}", "title": "" } ]
cd4e6b07732a277e49eaf05a66d24c17
ErrFailedToUnmarshalPostParam error when unmarshal post param failed.
[ { "docid": "c0d09e2a949e7c4d99c4fead5f7196d1", "score": "0.8758983", "text": "func ErrFailedToUnmarshalPostParam(err error) sdk.Error {\n\treturn types.NewError(types.CodeFailedToUnmarshalPostParam, fmt.Sprintf(\"failed to unmarshal post param: %s\", err.Error()))\n}", "title": "" } ]
[ { "docid": "d233ada19bfacfa7cbf7d295477a907d", "score": "0.74661195", "text": "func ErrFailedToMarshalPostParam(err error) sdk.Error {\n\treturn types.NewError(types.CodeFailedToMarshalPostParam, fmt.Sprintf(\"failed to marshal post param: %s\", err.Error()))\n}", "title": "" }, { "docid": "74cf3e5f87edddeb16afd6d92deb0bec", "score": "0.68759733", "text": "func ErrFailedToUnmarshalVoteParam(err error) sdk.Error {\n\treturn types.NewError(types.CodeFailedToUnmarshalVoteParam, fmt.Sprintf(\"failed to unmarshal vote param: %s\", err.Error()))\n}", "title": "" }, { "docid": "44bf10d1a3c0f2cc0708b353316bd541", "score": "0.6780502", "text": "func ErrFailedToUnmarshalReputationParam(err error) sdk.Error {\n\treturn types.NewError(types.CodeFailedToUnmarshalReputationParam, fmt.Sprintf(\"failed to unmarshal account param: %s\", err.Error()))\n}", "title": "" }, { "docid": "01c31c8f9246aebefa0fd13189a7cddb", "score": "0.6628729", "text": "func ErrFailedToUnmarshalProposalParam(err error) sdk.Error {\n\treturn types.NewError(types.CodeFailedToUnmarshalProposalParam, fmt.Sprintf(\"failed to unmarshal proposal param: %s\", err.Error()))\n}", "title": "" }, { "docid": "2b438bf791382f8d19d96cd960b443e3", "score": "0.6522216", "text": "func ErrFailedToUnmarshalValidatorParam(err error) sdk.Error {\n\treturn types.NewError(types.CodeFailedToUnmarshalValidatorParam, fmt.Sprintf(\"failed to unmarshal validator param: %s\", err.Error()))\n}", "title": "" }, { "docid": "a42b6f1727d3906df05cbe7ef00557f0", "score": "0.65063447", "text": "func ErrFailedToUnmarshalAccountParam(err error) sdk.Error {\n\treturn types.NewError(types.CodeFailedToUnmarshalAccountParam, fmt.Sprintf(\"failed to unmarshal account param: %s\", err.Error()))\n}", "title": "" }, { "docid": "6c96b236868a7acc01e11796c1dd7dfc", "score": "0.650209", "text": "func ErrFailedToUnmarshalBandwidthParam(err error) sdk.Error {\n\treturn types.NewError(types.CodeFailedToUnmarshalBandwidthParam, fmt.Sprintf(\"failed to unmarshal bandwidth param: %s\", err.Error()))\n}", "title": "" }, { "docid": "9c6e9285791cf8a18d9f84f13af28b6a", "score": "0.6210752", "text": "func ErrFailedToUnmarshalDeveloperParam(err error) sdk.Error {\n\treturn types.NewError(types.CodeFailedToUnmarshalDeveloperParam, fmt.Sprintf(\"failed to unmarshal developer param: %s\", err.Error()))\n}", "title": "" }, { "docid": "d55148db864129eabd14cb770325180f", "score": "0.6106795", "text": "func ErrFailedToUnmarshalGlobalAllocationParam(err error) sdk.Error {\n\treturn types.NewError(types.CodeFailedToUnmarshalGlobalAllocationParam, fmt.Sprintf(\"failed to unmarshal global allocation param: %s\", err.Error()))\n}", "title": "" }, { "docid": "88fdc3d6402da6ac5eb40c5e5e19602a", "score": "0.5923642", "text": "func ErrFailedToMarshalReputationParam(err error) sdk.Error {\n\treturn types.NewError(types.CodeFailedToMarshalReputationParam, fmt.Sprintf(\"failed to marshal reputation param: %s\", err.Error()))\n}", "title": "" }, { "docid": "967e839d84be175a6f2b9de77afa5af8", "score": "0.5910746", "text": "func ErrFailedToUnmarshalCoinDayParam(err error) sdk.Error {\n\treturn types.NewError(types.CodeFailedToUnmarshalCoinDayParam, fmt.Sprintf(\"failed to unmarshal coin day param: %s\", err.Error()))\n}", "title": "" }, { "docid": "2c9a9e990ecf2045a5f9e8b38ff22a0e", "score": "0.5891743", "text": "func ErrPostParamNotFound() sdk.Error {\n\treturn types.NewError(types.CodePostParamNotFound, fmt.Sprintf(\"post param not found\"))\n}", "title": "" }, { "docid": "b7824e864c5ed19d5b8848fb317dc3be", "score": "0.58075964", "text": "func ErrFailedToMarshalVoteParam(err error) sdk.Error {\n\treturn types.NewError(types.CodeFailedToMarshalVoteParam, fmt.Sprintf(\"failed to marshal vote param: %s\", err.Error()))\n}", "title": "" }, { "docid": "bd831a26d1eaee0ff33b7f51820eedb7", "score": "0.5702577", "text": "func ErrFailedToUnmarshalEvaluateOfContentValueParam(err error) sdk.Error {\n\treturn types.NewError(types.CodeFailedToUnmarshalEvaluateOfContentValueParam, fmt.Sprintf(\"failed to unmarshal evaluate of content value param: %s\", err.Error()))\n}", "title": "" }, { "docid": "a5ad9a96e9bc024f0ccc2d7ae88d32d5", "score": "0.55934525", "text": "func (s *StructArgsBinder) PostReadPullBody(ctx tp.ReadCtx) *tp.Rerror {\n\tparams, ok := s.binders[ctx.Path()]\n\tif !ok {\n\t\treturn nil\n\t}\n\tbodyValue := reflect.ValueOf(ctx.Input().Body())\n\terr := params.bindAndValidate(bodyValue, ctx.Query())\n\tif err != nil {\n\t\treturn tp.NewRerror(s.bindErrCode, s.bindErrMessage, err.Error())\n\t}\n\treturn nil\n}", "title": "" }, { "docid": "ab7f850d9c515897f0db705c052ebb30", "score": "0.55334604", "text": "func ErrFailedToMarshalValidatorParam(err error) sdk.Error {\n\treturn types.NewError(types.CodeFailedToMarshalValidatorParam, fmt.Sprintf(\"failed to marshal validator param: %s\", err.Error()))\n}", "title": "" }, { "docid": "b95c8a0e30db38e1da7c39d32bfcc426", "score": "0.5462492", "text": "func ErrFailedToMarshalProposalParam(err error) sdk.Error {\n\treturn types.NewError(types.CodeFailedToMarshalProposalParam, fmt.Sprintf(\"failed to marshal proposal param: %s\", err.Error()))\n}", "title": "" }, { "docid": "d7ba1ba8555f975d1e0b04f653ce5acb", "score": "0.54136413", "text": "func (d *DefaultEventHandler) OnParseMessageBodyFailed(_ error, _ *ali_mns.MessageReceiveResponse) {\n}", "title": "" }, { "docid": "260d7d92a157671be05ebc9a7f71cdbb", "score": "0.5367847", "text": "func ErrFailedToMarshalBandwidthParam(err error) sdk.Error {\n\treturn types.NewError(types.CodeFailedToMarshalBandwidthParam, fmt.Sprintf(\"failed to marshal bandwidth param: %s\", err.Error()))\n}", "title": "" }, { "docid": "b06a815d9059d131202ec01d449acdf2", "score": "0.5358214", "text": "func (ph ParamHolder) GetPostParam(ctx sdk.Context) (*PostParam, sdk.Error) {\n\tstore := ctx.KVStore(ph.key)\n\tparamBytes := store.Get(GetPostParamKey())\n\tif paramBytes == nil {\n\t\treturn nil, ErrPostParamNotFound()\n\t}\n\tparam := new(PostParam)\n\tif err := ph.cdc.UnmarshalBinaryLengthPrefixed(paramBytes, param); err != nil {\n\t\treturn nil, ErrFailedToUnmarshalPostParam(err)\n\t}\n\treturn param, nil\n}", "title": "" }, { "docid": "ff97bdbc0929c68bc615a488904b7e61", "score": "0.5243576", "text": "func ErrFailedToMarshalAccountParam(err error) sdk.Error {\n\treturn types.NewError(types.CodeFailedToMarshalAccountParam, fmt.Sprintf(\"failed to marshal account param: %s\", err.Error()))\n}", "title": "" }, { "docid": "9fab7b5ce22d5e6b9a2c8d7864ae170a", "score": "0.52339023", "text": "func PostProcessJsonError(data []byte, err error) error {\n\tswitch v := err.(type) {\n\tcase *json.SyntaxError:\n\t\tsnip := snippet(data, int(v.Offset), v.Error())\n\t\treturn fmt.Errorf(\"Could not parse JSON. %s\", snip)\n\tcase *json.UnmarshalTypeError:\n\t\tsnip := snippet(data, int(v.Offset), fmt.Sprintf(\"%s is not parseable as an %s\", v.Value, v.Type))\n\t\treturn fmt.Errorf(\"Could not parse JSON. %s\", snip)\n\t}\n\treturn err\n}", "title": "" }, { "docid": "c1612110f33d4d95d22d35d77006ff68", "score": "0.51326233", "text": "func ErrFailedToMarshalGlobalAllocationParam(err error) sdk.Error {\n\treturn types.NewError(types.CodeFailedToMarshalGlobalAllocationParam, fmt.Sprintf(\"failed to marshal global allocation param: %s\", err.Error()))\n}", "title": "" }, { "docid": "81470f956aea1170cdac05a99ba76d44", "score": "0.5106154", "text": "func (s *StructArgsBinder) PostReg(h *tp.Handler) *tp.Rerror {\n\tif h.ArgElemType().Kind() != reflect.Struct {\n\t\treturn nil\n\t}\n\tparams := newParams(h.Name())\n\terr := params.addFields([]int{}, h.ArgElemType(), h.NewArgValue())\n\tif err != nil {\n\t\ttp.Fatalf(\"%v\", err)\n\t}\n\ts.binders[h.Name()] = params\n\treturn nil\n}", "title": "" }, { "docid": "edc94bc8533cbf3a52698e8feb7fbd65", "score": "0.50344276", "text": "func ErrFailedToMarshalDeveloperParam(err error) sdk.Error {\n\treturn types.NewError(types.CodeFailedToMarshalDeveloperParam, fmt.Sprintf(\"failed to marshal developer param: %s\", err.Error()))\n}", "title": "" }, { "docid": "082147df8232fd570462db336f23808e", "score": "0.5012764", "text": "func (c *CustomConfig) PostUnmarshal() error {\n\tfor i, g := range c.Fields {\n\t\tif g.MinStepDuration != \"\" {\n\t\t\tdur, err := time.ParseDuration(g.MinStepDuration)\n\t\t\tif err != nil {\n\t\t\t\treturn errors.Wrap(err, \"parsing step_duration_min\")\n\t\t\t}\n\t\t\tc.Fields[i].minStepDuration = dur\n\t\t}\n\t\tif g.MaxStepDuration != \"\" {\n\t\t\tdur, err := time.ParseDuration(g.MaxStepDuration)\n\t\t\tif err != nil {\n\t\t\t\treturn errors.Wrap(err, \"parsing step_duration_max\")\n\t\t\t}\n\t\t\tc.Fields[i].maxStepDuration = dur\n\t\t}\n\t}\n\treturn nil\n}", "title": "" }, { "docid": "6555d1d8aeaa9b4f7765077d9da92faf", "score": "0.4982355", "text": "func parseErr(resp *http.Response) error {\n\terrBody := new(DoError)\n\n\terr := decodeBody(resp, &errBody)\n\n\t// if there was an error decoding the body, just return that\n\tif err != nil {\n\t\treturn fmt.Errorf(\"Error parsing error body for non-200 request: %s\", err)\n\t}\n\n\treturn fmt.Errorf(\"API Error: %s: %s\", errBody.Id, errBody.Message)\n}", "title": "" }, { "docid": "9b158088f1fdd88dbd5c9198673c328d", "score": "0.49772888", "text": "func ErrFailedToMarshalCoinDayParam(err error) sdk.Error {\n\treturn types.NewError(types.CodeFailedToMarshalCoinDayParam, fmt.Sprintf(\"failed to marshal coin day param: %s\", err.Error()))\n}", "title": "" }, { "docid": "d310b1ecff51eaa9b53d093abe9fe9a6", "score": "0.49594295", "text": "func NewFailureDetectorPhiPostParams() *FailureDetectorPhiPostParams {\n\tvar ()\n\treturn &FailureDetectorPhiPostParams{\n\n\t\ttimeout: cr.DefaultTimeout,\n\t}\n}", "title": "" }, { "docid": "df87e4496146d211a42167804e71c838", "score": "0.4913906", "text": "func (this *Request) ParamPost() (data map[string]interface{}) { /*{{{*/\n\terr := this.ParseMultiForm()\n\tif err != nil {\n\t\treturn nil\n\t}\n\tif this.request.PostForm == nil {\n\t\treturn nil\n\t}\n\tdata = make(map[string]interface{})\n\tfor k, v := range this.request.PostForm {\n\t\tif len(v) > 1 {\n\t\t\tdata[k] = v\n\t\t} else {\n\t\t\tdata[k] = v[0]\n\t\t}\n\t}\n\treturn data\n}", "title": "" }, { "docid": "00a08ea572bf96a2713df8dbb6427100", "score": "0.4905186", "text": "func (o *PostV1ProxyUpdateParams) bindRemotePort(rawData []string, hasKey bool, formats strfmt.Registry) error {\n\tvar raw string\n\tif len(rawData) > 0 {\n\t\traw = rawData[len(rawData)-1]\n\t}\n\n\t// Required: false\n\n\tif raw == \"\" { // empty values pass all other validations\n\t\treturn nil\n\t}\n\n\tvalue, err := swag.ConvertInt64(raw)\n\tif err != nil {\n\t\treturn errors.InvalidType(\"remote_port\", \"formData\", \"int64\", raw)\n\t}\n\to.RemotePort = &value\n\n\treturn nil\n}", "title": "" }, { "docid": "f40b58c19a8c1d4f6ee2e3516404b404", "score": "0.48803014", "text": "func (w *Weibull) UnmarshalParameters(p []Parameter) {\n\tif len(p) != w.NumParameters() {\n\t\tpanic(\"weibull: incorrect number of parameters to set\")\n\t}\n\tif p[0].Name != \"K\" {\n\t\tpanic(\"weibull: \" + panicNameMismatch)\n\t}\n\tif p[1].Name != \"λ\" {\n\t\tpanic(\"weibull: \" + panicNameMismatch)\n\t}\n\tw.K = p[0].Value\n\tw.Lambda = p[1].Value\n}", "title": "" }, { "docid": "87801b47b85f19020ad462015847a373", "score": "0.48682812", "text": "func decodeGetPostResponse(_ context.Context, r *http1.Response) (interface{}, error) {\n\tif r.StatusCode != http1.StatusOK {\n\t\treturn nil, http2.ErrorDecoder(r)\n\t}\n\tvar resp endpoint1.GetPostResponse\n\terr := json.NewDecoder(r.Body).Decode(&resp)\n\treturn resp, err\n}", "title": "" }, { "docid": "e31fc38c4033c9d3c9f41cf59493d5d9", "score": "0.48646837", "text": "func (s *BaseRippletParserListener) ExitRestParamArg(ctx *RestParamArgContext) {}", "title": "" }, { "docid": "082ff9e9d01d6f8222de29671f9dd9ab", "score": "0.48532185", "text": "func (v *Post) UnmarshalJSON(data []byte) error {\n\tr := jlexer.Lexer{Data: data}\n\teasyjsonD2b7633eDecodeTechParkDbHwInternalPkgModels8(&r, v)\n\treturn r.Error()\n}", "title": "" }, { "docid": "3fcb7a81bdd4fde6bcd04f62af2406dc", "score": "0.48414275", "text": "func (query *Query) GetPostParam(ctx context.Context) (*model.PostParam, error) {\n\tresp, err := query.transport.Query(ctx, getPostParamKey(), ParamKVStoreKey)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\tparam := new(model.PostParam)\n\tif err := query.transport.Cdc.UnmarshalJSON(resp, param); err != nil {\n\t\treturn nil, err\n\t}\n\treturn param, nil\n}", "title": "" }, { "docid": "c00cc97beb0782cc8427aca39240fe60", "score": "0.4840498", "text": "func ErrFailedToMarshalEvaluateOfContentValueParam(err error) sdk.Error {\n\treturn types.NewError(types.CodeFailedToMarshalEvaluateOfContentValueParam, fmt.Sprintf(\"failed to marshal evaluate of content value param: %s\", err.Error()))\n}", "title": "" }, { "docid": "a29611f971a133a3883a422e7e689fbc", "score": "0.4806706", "text": "func NewPostDatasetUploadPreconditionFailed() *PostDatasetUploadPreconditionFailed {\n\treturn &PostDatasetUploadPreconditionFailed{}\n}", "title": "" }, { "docid": "90fe96a4e3ff88056e712875065d2b54", "score": "0.47765303", "text": "func (c *APIController) decodePost() (*models.Post, error) {\n\tpost := &models.Post{}\n\tif err := json.NewDecoder(c.Ctx.Request.Body).Decode(post); err != nil {\n\t\treturn nil, err\n\t}\n\tif post.ID != \"\" {\n\t\tpost.OID, _ = primitive.ObjectIDFromHex(post.ID)\n\t}\n\treturn post, nil\n}", "title": "" }, { "docid": "8d460db33f3184e85a63a6b23f9f9900", "score": "0.47598872", "text": "func decodeUpdatePostResponse(_ context.Context, r *http1.Response) (interface{}, error) {\n\tif r.StatusCode != http1.StatusOK {\n\t\treturn nil, http2.ErrorDecoder(r)\n\t}\n\tvar resp endpoint1.UpdatePostResponse\n\terr := json.NewDecoder(r.Body).Decode(&resp)\n\treturn resp, err\n}", "title": "" }, { "docid": "83710de60a2edd42bf17e97858184fc6", "score": "0.47439852", "text": "func (p ActionParams) Unmarshal(dest interface{}) error {\n\tif err := mapstructure.Decode(p, dest); err != nil {\n\t\treturn fmt.Errorf(\"failed to unmarshal action params, %s\", err)\n\t}\n\n\treturn nil\n}", "title": "" }, { "docid": "8004c1e868424390d0a0f25302013d89", "score": "0.4743969", "text": "func UnmarshalPostPostcard(reader io.Reader, consumer runtime.Consumer) (PostPostcard, error) {\n\t// we need to read this twice, so first into a buffer\n\tdata, err := ioutil.ReadAll(reader)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\treturn unmarshalPostPostcard(data, consumer)\n}", "title": "" }, { "docid": "219bbf35d61f1e7806dd4713aae67b7c", "score": "0.47293225", "text": "func NewPostLoadBadRequest() *PostLoadBadRequest {\n\n\treturn &PostLoadBadRequest{}\n}", "title": "" }, { "docid": "dfc44907345fb66e7f4f1c471bd321ba", "score": "0.47271997", "text": "func NewPostLdapPingBadRequest() *PostLdapPingBadRequest {\n\treturn &PostLdapPingBadRequest{}\n}", "title": "" }, { "docid": "1ddcfbf0190cd04b4a023c80107798fe", "score": "0.47124913", "text": "func (l *Laplace) UnmarshalParameters(p []Parameter) {\n\tif len(p) != l.NumParameters() {\n\t\tpanic(\"dist: slice length mismatch\")\n\t}\n\tif p[0].Name != \"Mu\" {\n\t\tpanic(\"laplace: \" + panicNameMismatch)\n\t}\n\tif p[1].Name != \"Scale\" {\n\t\tpanic(\"laplace: \" + panicNameMismatch)\n\t}\n\tl.Mu = p[0].Value\n\tl.Scale = p[1].Value\n}", "title": "" }, { "docid": "6e94d7287f0e06df3aa377c73a5d9642", "score": "0.47114274", "text": "func TestParseBodyToAttendeeDtoParseError(t *testing.T) {\n\tdocs.Description(\"a parse failure of the json body should lead to the correct 'bad request' error response\")\n\tw := httptest.NewRecorder()\n\tr := tstMockPostRequest(\"{[[garbage}\")\n\n\t_, err := parseBodyToAttendeeDto(context.TODO(), w, r)\n\trequire.NotNil(t, err, \"expected an error return code so controller will bail out\")\n\ttstRequireErrorResponse(t, w, http.StatusBadRequest, \"attendee.parse.error\")\n}", "title": "" }, { "docid": "f5681e7a17558a87b8da84f37df3acfc", "score": "0.47045594", "text": "func ValidatePostResponse() error {\n\tif postResponse.StatusCode != 201 {\n\t\tlog.Panicln(\"POST - Error code tidak sesuai\")\n\t}\n\n\treturn nil\n}", "title": "" }, { "docid": "852fadb1ceee4d34c90331e44ba084c3", "score": "0.46811637", "text": "func (r *Request) DecodeFail(v interface{}, tag string) error {\n\tif err := r.Decode(v, tag); err != nil {\n\t\tif errSend := r.SendErrorEnvelope(fasthttp.StatusBadRequest,\n\t\t\t\"Error unmarshalling request: `\"+err.Error()+\"`\", nil, excepBadRequest); errSend != nil {\n\t\t\treturn errSend\n\t\t}\n\n\t\treturn err\n\t}\n\n\treturn nil\n}", "title": "" }, { "docid": "adb59eff3d74fd9efc4ff6bad47a3d22", "score": "0.46801338", "text": "func PostBind(c *gin.Context, ret interface{}) bool {\n\tc.ShouldBindWith(ret, binding.Form)\n\tif _, err := govalidator.ValidateStruct(ret); err != nil {\n\t\ters := []string{}\n\t\tfor k, v := range govalidator.ErrorsByField(err) {\n\t\t\ters = append(ers, k+\": \"+v)\n\t\t}\n\t\tc.String(400, strings.Join(ers, \"\\n\"))\n\t\treturn false\n\t}\n\treturn true\n}", "title": "" }, { "docid": "4d8214208a7bcf823bf493c297833e79", "score": "0.46718433", "text": "func (hse HTTPErr) ErrParam() string {\n\treturn string(hse.Param)\n}", "title": "" }, { "docid": "758467f92b6ae35cc88314d919f85085", "score": "0.4630439", "text": "func decodeCreatePostResponse(_ context.Context, r *http1.Response) (interface{}, error) {\n\tif r.StatusCode != http1.StatusOK {\n\t\treturn nil, http2.ErrorDecoder(r)\n\t}\n\tvar resp endpoint1.CreatePostResponse\n\terr := json.NewDecoder(r.Body).Decode(&resp)\n\treturn resp, err\n}", "title": "" }, { "docid": "a4e59ecb7450c22c1bbbaf129687985c", "score": "0.4590043", "text": "func ErrDecodeYaml(err error) error {\n\treturn errors.New(ErrDecodeYamlCode, errors.Alert, []string{\"Error occured while decoding YAML\"}, []string{err.Error()}, []string{}, []string{})\n}", "title": "" }, { "docid": "b40f5b603cc4c6d0bcffef46ca0fec6d", "score": "0.45758268", "text": "func (o *PostUserBadRequestBody) UnmarshalJSON(raw []byte) error {\n\t// PostUserBadRequestBodyAO0\n\tvar postUserBadRequestBodyAO0 models.Error400Data\n\tif err := swag.ReadJSON(raw, &postUserBadRequestBodyAO0); err != nil {\n\t\treturn err\n\t}\n\to.Error400Data = postUserBadRequestBodyAO0\n\n\t// PostUserBadRequestBodyAO1\n\tvar dataPostUserBadRequestBodyAO1 struct {\n\t\tErrors *PostUserBadRequestBodyAO1Errors `json:\"errors\"`\n\n\t\tMessage *string `json:\"message\"`\n\t}\n\tif err := swag.ReadJSON(raw, &dataPostUserBadRequestBodyAO1); err != nil {\n\t\treturn err\n\t}\n\n\to.Errors = dataPostUserBadRequestBodyAO1.Errors\n\n\to.Message = dataPostUserBadRequestBodyAO1.Message\n\n\treturn nil\n}", "title": "" }, { "docid": "5bd002ffbc72d9427c9283b691fe3aba", "score": "0.45756125", "text": "func (c *MainController) decodePost() (*models.Post, error) {\n\tpost := &models.Post{}\n\tif err := json.NewDecoder(c.Ctx.Request.Body).Decode(post); err != nil {\n\t\treturn nil, err\n\t}\n\treturn post, nil\n}", "title": "" }, { "docid": "5c8244ff92b6b1020d1faffb75914451", "score": "0.4569678", "text": "func marshalledPOST(server, uri string, creds *Credentials, body interface{}, ret interface{}) HttpError {\n\tb := new(bytes.Buffer)\n\terr := json.NewEncoder(b).Encode(body)\n\tif err != nil {\n\t\treturn makeError(\"JSON marshalling failed\", HTTP_ERROR_JSON, err)\n\t}\n\n\treturn invokeHTTP(\"POST\", server, uri, creds, b, ret)\n}", "title": "" }, { "docid": "3f184bd56fa9a0d97caf4d7f658bb01d", "score": "0.4557108", "text": "func unmarshalPostTransactionsTransactionsPayload(ctx context.Context, service *goa.Service, req *http.Request) error {\n\tpayload := &postTransactionsTransactionsPayload{}\n\tif err := service.DecodeRequest(req, payload); err != nil {\n\t\treturn err\n\t}\n\tif err := payload.Validate(); err != nil {\n\t\t// Initialize payload with private data structure so it can be logged\n\t\tgoa.ContextRequest(ctx).Payload = payload\n\t\treturn err\n\t}\n\tgoa.ContextRequest(ctx).Payload = payload.Publicize()\n\treturn nil\n}", "title": "" }, { "docid": "db55ac1e718b533086186fe80f9f672d", "score": "0.45509836", "text": "func (r *AWSNeptuneDBParameterGroup) UnmarshalJSON(b []byte) error {\n\ttype Properties AWSNeptuneDBParameterGroup\n\tres := &struct {\n\t\tType string\n\t\tProperties *Properties\n\t\tDependsOn []string\n\t\tMetadata map[string]interface{}\n\t}{}\n\tif err := json.Unmarshal(b, &res); err != nil {\n\t\tfmt.Printf(\"ERROR: %s\\n\", err)\n\t\treturn err\n\t}\n\n\t// If the resource has no Properties set, it could be nil\n\tif res.Properties != nil {\n\t\t*r = AWSNeptuneDBParameterGroup(*res.Properties)\n\t}\n\tif res.DependsOn != nil {\n\t\tr._dependsOn = res.DependsOn\n\t}\n\tif res.Metadata != nil {\n\t\tr._metadata = res.Metadata\n\t}\n\n\treturn nil\n}", "title": "" }, { "docid": "aee7e7be2f6cb4a9dbb46499124d9559", "score": "0.45494857", "text": "func (p *Params) Unmarshal(marshalled []byte, compressed bool, checked bool) bool {\n\tif len(marshalled) == 0 {\n\t\treturn false\n\t}\n\tif C.embedded_pairing_lqibe_params_get_marshalled_length(C._Bool(compressed)) != C.size_t(len(marshalled)) {\n\t\treturn false\n\t}\n\treturn bool(C.embedded_pairing_lqibe_params_unmarshal(&p.Data, unsafe.Pointer(&marshalled[0]), C._Bool(compressed), C._Bool(checked)))\n}", "title": "" }, { "docid": "e64bec8dad8f146647e50ad4364d0c07", "score": "0.45406625", "text": "func (r *CommonRequest) RspInvalidParam(c Context, err error) APIResponse {\n\treturn RspInvalidParam.WithError(err)\n}", "title": "" }, { "docid": "bbba286f7c921f82682c7604293656f4", "score": "0.45201927", "text": "func (v *PNLArg) UnmarshalJSON(data []byte) error {\n\tr := jlexer.Lexer{Data: data}\n\teasyjsonE92dfa68DecodeGithubComKamaiuIbCpGoClientV1WsModel(&r, v)\n\treturn r.Error()\n}", "title": "" }, { "docid": "d723079899210598d47cf389b7b5266a", "score": "0.45016184", "text": "func TestParserNegative(t *testing.T) {\n\t// Check type validation.\n\tjsonBadCmd := []byte(`{\n \"command_name\": \"start\",\n \"params\": {\n \"name\": true,\n \"env\": [\n \"TRYAM=true\"\n ]\n }\n}\n`)\n\tassertParseFails(t, jsonBadCmd)\n\n\t// Check params validation (required parameter(\"name\") is missing).\n\tjsonBadCmd = []byte(`{\n \"command_name\": \"start\",\n \"params\": {\n \"env\": [\n \"TRYAM=true\"\n ]\n }\n}\n`)\n\tassertParseFails(t, jsonBadCmd)\n\n\t// Check params validation (unknown parameter is present).\n\tjsonBadCmd = []byte(`{\n \"command_name\": \"start\",\n \"params\": {\n \"name\": \"test_inst\",\n \"unknown_param\": 5,\n \"env\": [\n \"TRYAM=true\"\n ]\n }\n}\n`)\n\tassertParseFails(t, jsonBadCmd)\n}", "title": "" }, { "docid": "0df0afd7d26bbfae0f51c587c97bfe76", "score": "0.44923294", "text": "func Decode(b []byte) (*Param, error) {\n\tlog.Println(\"DEPRECATED: use Parse instead\")\n\treturn Parse(b)\n}", "title": "" }, { "docid": "bec44289942ccd167d5eaa921046cf7c", "score": "0.4490385", "text": "func ValidateRegisterKeyIPMismatchResponseBody(body *RegisterKeyIPMismatchResponseBody) (err error) {\n\tif body.Name == nil {\n\t\terr = goa.MergeErrors(err, goa.MissingFieldError(\"name\", \"body\"))\n\t}\n\tif body.ID == nil {\n\t\terr = goa.MergeErrors(err, goa.MissingFieldError(\"id\", \"body\"))\n\t}\n\tif body.Message == nil {\n\t\terr = goa.MergeErrors(err, goa.MissingFieldError(\"message\", \"body\"))\n\t}\n\tif body.Temporary == nil {\n\t\terr = goa.MergeErrors(err, goa.MissingFieldError(\"temporary\", \"body\"))\n\t}\n\tif body.Timeout == nil {\n\t\terr = goa.MergeErrors(err, goa.MissingFieldError(\"timeout\", \"body\"))\n\t}\n\tif body.Fault == nil {\n\t\terr = goa.MergeErrors(err, goa.MissingFieldError(\"fault\", \"body\"))\n\t}\n\treturn\n}", "title": "" }, { "docid": "2d5d7c17da65d721e057ed14926b4f5e", "score": "0.44827414", "text": "func DecoderErr(err error) error {\n\tswitch {\n\t// If the request body is empty (io.EOF)\n\t// return an error\n\tcase err == io.EOF:\n\t\treturn errs.E(errs.InvalidRequest, errors.New(\"Request Body cannot be empty\"))\n\t// If the request body has malformed JSON (io.ErrUnexpectedEOF)\n\t// return an error\n\tcase err == io.ErrUnexpectedEOF:\n\t\treturn errs.E(errs.InvalidRequest, errors.New(\"Malformed JSON\"))\n\t// return all other errors\n\tcase err != nil:\n\t\treturn errs.E(err)\n\t}\n\treturn nil\n}", "title": "" }, { "docid": "92950d93c2b246d1dac6c177956da32c", "score": "0.44696856", "text": "func (o *MicrosoftGraphItemPreviewInfo) GetPostParametersOk() (string, bool) {\n\tif o == nil || o.PostParameters == nil {\n\t\tvar ret string\n\t\treturn ret, false\n\t}\n\treturn *o.PostParameters, true\n}", "title": "" }, { "docid": "36bda09af971a94dfb8ca27141e9ddb9", "score": "0.44668874", "text": "func TestHandler_URLMappingDirectPlacementCreateFailItemVarUndecrypt(t *testing.T) {\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\"note\": \"note\",\n\t\t\"direct_placement_items\": []tester.D{\n\t\t\t{\n\t\t\t\t\"item_variant_id\": \"aaa\",\n\t\t\t\t\"quantity\": float32(10),\n\t\t\t\t\"unit_price\": float64(2000),\n\t\t\t\t\"total_price\": float64(20000),\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/direct-placement\").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}", "title": "" }, { "docid": "870ee3597e8205e9c4751bf5b44a0400", "score": "0.44635016", "text": "func (v *PostUpdate) UnmarshalJSON(data []byte) error {\n\tr := jlexer.Lexer{Data: data}\n\teasyjsonD2b7633eDecodeTechParkDbHwInternalPkgModels6(&r, v)\n\treturn r.Error()\n}", "title": "" }, { "docid": "f47fa61dac549e2dd8dce0d38f096685", "score": "0.4463298", "text": "func (d *DataPager) UnmarshalState(m page.SavedState) {\n\tif v, ok := m.Load(\"pageNum\"); ok {\n\t\tif i, ok2 := v.(int); ok2 {\n\t\t\td.PagedControl().SetPageNum(i) // admittedly, multiple pagers will repeat the same call, but not likely to effect performance\n\t\t}\n\t}\n}", "title": "" }, { "docid": "75fab4fc3cb4d8376f6c5ce34f9b6a5f", "score": "0.44599968", "text": "func parseFailedReason(message string) (string, error) {\n\tswitch {\n\t// Invalid image name\n\tcase strings.Contains(message, \"InvalidImageName\"):\n\t\treturn errInvalidImageName, nil\n\t// Invalid image\n\tcase strings.Contains(message, \"ImagePullBackOff\"):\n\t\treturn errPullImage, nil\n\t// oomkilled\n\tcase strings.Contains(message, \"OOMKilled\"):\n\t\treturn errOomKilled, nil\n\tdefault:\n\t\t// TODO: Analyze the reason for the failure\n\t\treturn \"\", errors.New(\"unexpected\")\n\t}\n}", "title": "" }, { "docid": "a50c13d73050b2c804201dcca8343434", "score": "0.4449605", "text": "func (p *Param) UnmarshalBinary(b []byte) error {\n\tl := len(b)\n\tif l < 4 {\n\t\treturn ErrTooShortToParse\n\t}\n\n\tp.Tag = binary.BigEndian.Uint16(b[0:2])\n\tp.Length = binary.BigEndian.Uint16(b[2:4])\n\tif int(p.Length) > l || p.Length < 4 {\n\t\treturn ErrInvalidLength\n\t}\n\n\tp.Data = b[4:p.Length]\n\treturn nil\n}", "title": "" }, { "docid": "c0382160b550312b057a267477a7c9f5", "score": "0.44401824", "text": "func (v *GetRequestPostDataParams) UnmarshalJSON(data []byte) error {\n\tr := jlexer.Lexer{Data: data}\n\teasyjsonC5a4559bDecodeGithubComChromedpCdprotoNetwork43(&r, v)\n\treturn r.Error()\n}", "title": "" }, { "docid": "2bab41ac185912a7e7626e04ffc7b4b5", "score": "0.44289276", "text": "func (amlwsfrddp *AzureMachineLearningWebServiceFunctionRetrieveDefaultDefinitionParameters) UnmarshalJSON(body []byte) error {\n\tvar m map[string]*json.RawMessage\n\terr := json.Unmarshal(body, &m)\n\tif err != nil {\n\t\treturn err\n\t}\n\tfor k, v := range m {\n\t\tswitch k {\n\t\tcase \"bindingRetrievalProperties\":\n\t\t\tif v != nil {\n\t\t\t\tvar azureMachineLearningWebServiceFunctionBindingRetrievalProperties AzureMachineLearningWebServiceFunctionBindingRetrievalProperties\n\t\t\t\terr = json.Unmarshal(*v, &azureMachineLearningWebServiceFunctionBindingRetrievalProperties)\n\t\t\t\tif err != nil {\n\t\t\t\t\treturn err\n\t\t\t\t}\n\t\t\t\tamlwsfrddp.AzureMachineLearningWebServiceFunctionBindingRetrievalProperties = &azureMachineLearningWebServiceFunctionBindingRetrievalProperties\n\t\t\t}\n\t\tcase \"bindingType\":\n\t\t\tif v != nil {\n\t\t\t\tvar bindingType BindingType\n\t\t\t\terr = json.Unmarshal(*v, &bindingType)\n\t\t\t\tif err != nil {\n\t\t\t\t\treturn err\n\t\t\t\t}\n\t\t\t\tamlwsfrddp.BindingType = bindingType\n\t\t\t}\n\t\t}\n\t}\n\n\treturn nil\n}", "title": "" }, { "docid": "db9174073b3e3df5438dd580a2a38125", "score": "0.44225284", "text": "func (v *Post) UnmarshalJSON(data []byte) error {\n\tr := jlexer.Lexer{Data: data}\n\teasyjsonD2b7633eDecodeGithubComLisaBella97TechDbForumAppModels11(&r, v)\n\treturn r.Error()\n}", "title": "" }, { "docid": "abe8f3b96cfca0a9b3f785d365e64752", "score": "0.44141564", "text": "func UnmarshalPrin(bytes []byte) (p Prin, err error) {\n\tt, err := UnmarshalTerm(bytes)\n\tif err != nil {\n\t\treturn\n\t}\n\tp, ok := t.(Prin) // will always be value type here\n\tif !ok {\n\t\terr = fmt.Errorf(\"expected Prin, found %T\", t)\n\t}\n\treturn\n}", "title": "" }, { "docid": "46f296946ea41ac23af9005fd23782d8", "score": "0.44119683", "text": "func (v *ViperEnv) Unmarshal(value interface{}) error {\n\tparameters := buildParameters(value)\n\tfor _, parameter := range parameters {\n\t\t// These bindings are required in case the value for a particular configuration property that is a field of the specified value struct\n\t\t// is only set via env variables (if we do not explicitly do a binding, viper.AllKeys() will not return a key for this configuration\n\t\t// property and unmarshal will not even try to find a value for this property key when filling up the config struct)\n\t\tif err := v.Viper.BindEnv(parameter.Name); err != nil {\n\t\t\treturn err\n\t\t}\n\t}\n\treturn v.Viper.Unmarshal(value)\n\n}", "title": "" }, { "docid": "167a89c8f06a504bbd976e36d475f548", "score": "0.43950793", "text": "func (o *PostUserBody) UnmarshalJSON(raw []byte) error {\n\t// PostUserParamsBodyAO0\n\tvar postUserParamsBodyAO0 models.AuthUserParams\n\tif err := swag.ReadJSON(raw, &postUserParamsBodyAO0); err != nil {\n\t\treturn err\n\t}\n\to.AuthUserParams = postUserParamsBodyAO0\n\n\treturn nil\n}", "title": "" }, { "docid": "28bc0a9976382d68bca125b63bf696cb", "score": "0.4385698", "text": "func NewPostVerifyBadRequest() *PostVerifyBadRequest {\n\treturn &PostVerifyBadRequest{}\n}", "title": "" }, { "docid": "7b188fc0567f58adb702a4eb81fec908", "score": "0.4379863", "text": "func (w *ServerInterfaceWrapper) Post(ctx echo.Context) error {\n\tvar err error\n\n\t// Invoke the callback with all the unmarshalled arguments\n\terr = w.Handler.Post(ctx)\n\treturn err\n}", "title": "" }, { "docid": "040ccc75972f84545e3376a6ed9dbe98", "score": "0.43674448", "text": "func DecodeFailMsg(msg wire.Message) (string, error) {\n\tif msg.Kind == uint16(messages.MessageType_MessageType_Failure) {\n\t\tfailure := &messages.Failure{}\n\t\terr := proto.Unmarshal(msg.Data, failure)\n\t\tif err != nil {\n\t\t\treturn \"\", err\n\t\t}\n\t\treturn failure.GetMessage(), nil\n\t}\n\treturn \"\", fmt.Errorf(\"calling DecodeFailMsg with wrong message type: %s\", messages.MessageType(msg.Kind))\n}", "title": "" }, { "docid": "8390c89c662a517515f7524022af3bd9", "score": "0.43616256", "text": "func ValidateRetrieveKeyIPMismatchResponseBody(body *RetrieveKeyIPMismatchResponseBody) (err error) {\n\tif body.Name == nil {\n\t\terr = goa.MergeErrors(err, goa.MissingFieldError(\"name\", \"body\"))\n\t}\n\tif body.ID == nil {\n\t\terr = goa.MergeErrors(err, goa.MissingFieldError(\"id\", \"body\"))\n\t}\n\tif body.Message == nil {\n\t\terr = goa.MergeErrors(err, goa.MissingFieldError(\"message\", \"body\"))\n\t}\n\tif body.Temporary == nil {\n\t\terr = goa.MergeErrors(err, goa.MissingFieldError(\"temporary\", \"body\"))\n\t}\n\tif body.Timeout == nil {\n\t\terr = goa.MergeErrors(err, goa.MissingFieldError(\"timeout\", \"body\"))\n\t}\n\tif body.Fault == nil {\n\t\terr = goa.MergeErrors(err, goa.MissingFieldError(\"fault\", \"body\"))\n\t}\n\treturn\n}", "title": "" }, { "docid": "6df532a898ee84ae12c6933c8ad92471", "score": "0.43542948", "text": "func (p *cryptoParameter) UnmarshalJSON(b []byte) error {\n var aux auxCryptoParameter\n if err := json.Unmarshal(b, &aux); err != nil {\n return err\n }\n p.Int = new(big.Int)\n p.SetBytes(aux.Raw)\n return nil\n}", "title": "" }, { "docid": "a37fd96dc00fe227040068c67613112c", "score": "0.43526313", "text": "func NewPostSepaddBadRequest() *PostSepaddBadRequest {\n\treturn &PostSepaddBadRequest{}\n}", "title": "" }, { "docid": "708e5764b9a01c0da9bddddb7b6e1377", "score": "0.4342367", "text": "func (p *StatPacket) UnmarshalPacketBody(buf *Buffer) (err error) {\n\t*p = StatPacket{\n\t\tPath: buf.ConsumeString(),\n\t}\n\n\treturn buf.Err\n}", "title": "" }, { "docid": "861e7c0ac760a774f338ef3a03be160c", "score": "0.43355313", "text": "func ParsePostFraudPaymentRegistrationRzp(rsp *http.Response) (*PostFraudPaymentRegistrationRzp, error) {\n\tbodyBytes, err := ioutil.ReadAll(rsp.Body)\n\tdefer rsp.Body.Close()\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\tresponse := &PostFraudPaymentRegistrationRzp{\n\t\tBody: bodyBytes,\n\t\tHTTPResponse: rsp,\n\t}\n\n\tswitch {\n\tcase strings.Contains(rsp.Header.Get(\"Content-Type\"), \"json\") && rsp.StatusCode == 200:\n\t\tvar dest FraudRegistrationResponse\n\t\tif err := json.Unmarshal(bodyBytes, &dest); err != nil {\n\t\t\treturn nil, err\n\t\t}\n\t\tresponse.JSON200 = &dest\n\n\tcase strings.Contains(rsp.Header.Get(\"Content-Type\"), \"json\") && rsp.StatusCode == 201:\n\t\tvar dest ScoreOnlyResponse\n\t\tif err := json.Unmarshal(bodyBytes, &dest); err != nil {\n\t\t\treturn nil, err\n\t\t}\n\t\tresponse.JSON201 = &dest\n\n\tcase strings.Contains(rsp.Header.Get(\"Content-Type\"), \"json\") && rsp.StatusCode == 400:\n\t\tvar dest FraudRegistrationResponse\n\t\tif err := json.Unmarshal(bodyBytes, &dest); err != nil {\n\t\t\treturn nil, err\n\t\t}\n\t\tresponse.JSON400 = &dest\n\n\t}\n\n\treturn response, nil\n}", "title": "" }, { "docid": "cdad45e6dca3db8464a3272bb0cb4da7", "score": "0.43315732", "text": "func parseField(v reflect.Value, pd *perBitData, params fieldParameters) (err error) {}", "title": "" }, { "docid": "180f6af9b0c7cab39b3c13cc7f0b4ef5", "score": "0.43300688", "text": "func (pt *InParamPort) Fail(msg interface{}) {\n\tFailf(\"[In-Param-Port:%s] %s\", pt.Name(), msg)\n}", "title": "" }, { "docid": "fee3d5b288b8c2105a527b34ec5649c1", "score": "0.43280593", "text": "func mockUserReceiveAddressBadJSON(statusCode int) {\r\n\thttpmock.RegisterResponder(http.MethodPost, fmt.Sprintf(\"%s%s\", testHost, getUserReceiveAddress),\r\n\t\thttpmock.NewStringResponder(\r\n\t\t\tstatusCode, `{\"code\": 74012,\"msg\",}`,\r\n\t\t),\r\n\t)\r\n}", "title": "" }, { "docid": "bd1eb6536f2fb16da2be770ae7dd9436", "score": "0.43275297", "text": "func (d *DeploymentScriptUpdateParameter) UnmarshalJSON(data []byte) error {\n\tvar rawMsg map[string]json.RawMessage\n\tif err := json.Unmarshal(data, &rawMsg); err != nil {\n\t\treturn fmt.Errorf(\"unmarshalling type %T: %v\", d, err)\n\t}\n\tfor key, val := range rawMsg {\n\t\tvar err error\n\t\tswitch key {\n\t\tcase \"id\":\n\t\t\terr = unpopulate(val, \"ID\", &d.ID)\n\t\t\tdelete(rawMsg, key)\n\t\tcase \"name\":\n\t\t\terr = unpopulate(val, \"Name\", &d.Name)\n\t\t\tdelete(rawMsg, key)\n\t\tcase \"tags\":\n\t\t\terr = unpopulate(val, \"Tags\", &d.Tags)\n\t\t\tdelete(rawMsg, key)\n\t\tcase \"type\":\n\t\t\terr = unpopulate(val, \"Type\", &d.Type)\n\t\t\tdelete(rawMsg, key)\n\t\t}\n\t\tif err != nil {\n\t\t\treturn fmt.Errorf(\"unmarshalling type %T: %v\", d, err)\n\t\t}\n\t}\n\treturn nil\n}", "title": "" }, { "docid": "336b36946ce743b7bdf6107d7dafbdcc", "score": "0.43261397", "text": "func ParsePostRoutesResponse(rsp *http.Response) (*PostRoutesResponse, error) {\n\tbodyBytes, err := ioutil.ReadAll(rsp.Body)\n\tdefer rsp.Body.Close()\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\tresponse := &PostRoutesResponse{\n\t\tBody: bodyBytes,\n\t\tHTTPResponse: rsp,\n\t}\n\n\tswitch {\n\tcase strings.Contains(rsp.Header.Get(\"Content-Type\"), \"json\") && rsp.StatusCode == 201:\n\t\tvar dest RouteInfoResponse\n\t\tif err := json.Unmarshal(bodyBytes, &dest); err != nil {\n\t\t\treturn nil, err\n\t\t}\n\t\tresponse.JSON201 = &dest\n\n\tcase strings.Contains(rsp.Header.Get(\"Content-Type\"), \"json\") && rsp.StatusCode == 422:\n\t\tvar dest struct {\n\n\t\t\t// 错误码\n\t\t\t//\n\t\t\t// |Code|Description|\n\t\t\t// |----|----|\n\t\t\t// |422.000|数据不存在|\n\t\t\t// |422.111|数据已存在|\n\t\t\t// |422.999|参数有误|\n\t\t\tCode *ErrCode `json:\"code,omitempty\"`\n\n\t\t\t// 错误字段\n\t\t\tField *string `json:\"field,omitempty\"`\n\n\t\t\t// 错误描述\n\t\t\tMsg *string `json:\"msg,omitempty\"`\n\t\t}\n\t\tif err := json.Unmarshal(bodyBytes, &dest); err != nil {\n\t\t\treturn nil, err\n\t\t}\n\t\tresponse.JSON422 = &dest\n\n\t}\n\n\treturn response, nil\n}", "title": "" }, { "docid": "9986c919af373558a12df4065c78afc1", "score": "0.43253654", "text": "func UnmarshalPrinTail(bytes []byte) (p PrinTail, err error) {\n\tt, err := UnmarshalTerm(bytes)\n\tif err != nil {\n\t\treturn\n\t}\n\tp, ok := t.(PrinTail) // will always be value type here\n\tif !ok {\n\t\terr = fmt.Errorf(\"expected PrinTail, found %T\", t)\n\t}\n\treturn\n}", "title": "" }, { "docid": "8a8fd90905d7b562a98fbe8404a4a2d2", "score": "0.4324413", "text": "func (m *BookingBusinessesItemPublishRequestBuilder) Post(ctx context.Context, requestConfiguration *BookingBusinessesItemPublishRequestBuilderPostRequestConfiguration)(error) {\n requestInfo, err := m.ToPostRequestInformation(ctx, requestConfiguration);\n if err != nil {\n return err\n }\n errorMapping := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ErrorMappings {\n \"4XX\": ia572726a95efa92ddd544552cd950653dc691023836923576b2f4bf716cf204a.CreateODataErrorFromDiscriminatorValue,\n \"5XX\": ia572726a95efa92ddd544552cd950653dc691023836923576b2f4bf716cf204a.CreateODataErrorFromDiscriminatorValue,\n }\n err = m.BaseRequestBuilder.RequestAdapter.SendNoContent(ctx, requestInfo, errorMapping)\n if err != nil {\n return err\n }\n return nil\n}", "title": "" }, { "docid": "b6487a2fc344d2ec81650bbc2977d06b", "score": "0.43241245", "text": "func (s *BaseDZListener) ExitProcParam(ctx *ProcParamContext) {}", "title": "" }, { "docid": "7329cfaebee21f1ee29286671e6ed2cb", "score": "0.43219548", "text": "func DecodeMultiParams(b []byte) ([]*Param, error) {\n\tlog.Println(\"DEPRECATED: use ParseMultiParams instead\")\n\treturn ParseMultiParams(b)\n}", "title": "" }, { "docid": "41771e7eb64374cf092992391c40ed4a", "score": "0.43196177", "text": "func (pt *OutParamPort) Fail(msg interface{}) {\n\tFailf(\"[Out-Param-Port:%s] %s\", pt.Name(), msg)\n}", "title": "" }, { "docid": "b6c412ba560b934567580f6df69ed4e7", "score": "0.4316965", "text": "func NewFailureDetectorPhiPostParamsWithTimeout(timeout time.Duration) *FailureDetectorPhiPostParams {\n\tvar ()\n\treturn &FailureDetectorPhiPostParams{\n\n\t\ttimeout: timeout,\n\t}\n}", "title": "" }, { "docid": "bcd01ac08c6963f66fc4deeb6d5d1b1f", "score": "0.43089652", "text": "func (b *Binder) Unmarshal(iface interface{}, r *http.Request) (err error) {\n\t// Check for errors.\n\tv := reflect.ValueOf(iface)\n\tif v.Kind() != reflect.Ptr {\n\t\treturn errors.New(\"must pass a pointer, not a value\")\n\t}\n\n\t// Load the map.\n\tm := make(map[string]interface{})\n\n\t// Try to auto detect data type based on on the header.\n\t// Header can having multiple values separated by a semicolon.\n\tct := r.Header.Get(\"Content-Type\")\n\tswitch true {\n\tcase ct == \"\", strings.Contains(ct, \"application/x-www-form-urlencoded\"):\n\t\t// Parse the form.\n\t\terr = r.ParseForm()\n\t\tif err != nil {\n\t\t\treturn err\n\t\t}\n\n\t\tfor k, vv := range r.Form {\n\t\t\tm[k] = vv[0]\n\t\t}\n\tcase strings.Contains(ct, \"application/json\"):\n\t\t// Decode to the interface.\n\t\terr = json.NewDecoder(r.Body).Decode(&m)\n\t\tr.Body.Close()\n\t\tif err != nil {\n\t\t\t// No longer fail on an unmarshal error. This is so users can submit\n\t\t\t// empty data for GET requests, yet we can still map the URL\n\t\t\t// parameter by using the same logic.\n\t\t}\n\n\t\t// Copy the map items to a new map.\n\t\tmt := make(map[string]interface{})\n\t\tfor key, value := range m {\n\t\t\tmt[key] = value\n\t\t}\n\n\t\t// Save the map to the body to handle cases where there is a body\n\t\t// defined.\n\t\tm[\"body\"] = mt\n\t}\n\n\t// Loop through each field to extract the URL parameter.\n\telem := reflect.Indirect(v.Elem())\n\tkeys := elem.Type()\n\tfor j := 0; j < elem.NumField(); j++ {\n\t\ttag := keys.Field(j).Tag\n\t\ttagvalue := tag.Get(\"json\")\n\t\tpathParam := b.router.Param(r, tagvalue)\n\t\tif len(pathParam) > 0 {\n\t\t\tm[tagvalue] = pathParam\n\t\t}\n\t}\n\n\t// Convert to JSON.\n\tvar data []byte\n\tdata, err = json.Marshal(m)\n\tif err != nil {\n\t\treturn\n\t}\n\n\t// Unmarshal to the interface from JSON.\n\treturn json.Unmarshal(data, &iface)\n}", "title": "" }, { "docid": "9c6d14beb3f3438dbd2c06e0d9b92ade", "score": "0.43026587", "text": "func (s *PipelineBind) Unmarshal(val []byte) (err error) {\n\terr = json.Unmarshal(val, s)\n\treturn\n}", "title": "" }, { "docid": "f94f68dc3ef3cdb91c00b505df18b47b", "score": "0.43023688", "text": "func mockUserReceiveAddressFailed(statusCode int) {\r\n\thttpmock.Reset()\r\n\thttpmock.RegisterResponder(http.MethodPost, fmt.Sprintf(\"%s%s\", testHost, getUserReceiveAddress),\r\n\t\thttpmock.NewStringResponder(\r\n\t\t\tstatusCode, `{\r\n\"code\": 74012,\"msg\": \"User receive address failed\",\r\n\"data\": null,\"req_id\": \"77dbf77797fc727a3e7afe39209e7238\"}`,\r\n\t\t),\r\n\t)\r\n}", "title": "" }, { "docid": "3e3ae07e894ea021e79d976f1e104921", "score": "0.4301182", "text": "func (p *RenamePacket) UnmarshalPacketBody(buf *Buffer) (err error) {\n\t*p = RenamePacket{\n\t\tOldPath: buf.ConsumeString(),\n\t\tNewPath: buf.ConsumeString(),\n\t}\n\n\treturn buf.Err\n}", "title": "" }, { "docid": "f8172f3fc99611440db50213837fe1c1", "score": "0.42927837", "text": "func (p *Params) unmarshalConfig(cfgFile string) error {\n\tif cfgFile != \"\" {\n\t\t// Use config file from the user-provided flag.\n\t\tviper.SetConfigFile(cfgFile)\n\t} else {\n\t\tviper.SetConfigName(\"bmcbutler\")\n\t\tviper.AddConfigPath(\"/etc/bmcbutler\")\n\t}\n\n\terr := viper.ReadInConfig()\n\tif err != nil {\n\t\treturn err\n\t}\n\n\terr = viper.Unmarshal(&p)\n\tif err != nil {\n\t\treturn err\n\t}\n\n\treturn nil\n}", "title": "" } ]
f6a4c086a37f93670b875c9ee1028609
SetStoreOffline sets store state to be offline.
[ { "docid": "3a580756e992512a39011fc35c953dd3", "score": "0.8708256", "text": "func (mc *MockCluster) SetStoreOffline(storeID uint64) {\n\tstore := mc.GetStore(storeID)\n\tstore.State = metapb.StoreState_Offline\n\tmc.PutStore(store)\n}", "title": "" } ]
[ { "docid": "50c48f54bf51f8eccb183c980793f839", "score": "0.6964516", "text": "func (s *DescribeFeatureGroupOutput) SetOfflineStoreStatus(v *OfflineStoreStatus) *DescribeFeatureGroupOutput {\n\ts.OfflineStoreStatus = v\n\treturn s\n}", "title": "" }, { "docid": "c8491bc25e1a58d361e81d3c07c04900", "score": "0.6803188", "text": "func (s *FeatureGroupSummary) SetOfflineStoreStatus(v *OfflineStoreStatus) *FeatureGroupSummary {\n\ts.OfflineStoreStatus = v\n\treturn s\n}", "title": "" }, { "docid": "bb8970de48a7d938ad90fc5bdb8d0b00", "score": "0.6763601", "text": "func (s *FeatureGroup) SetOfflineStoreStatus(v *OfflineStoreStatus) *FeatureGroup {\n\ts.OfflineStoreStatus = v\n\treturn s\n}", "title": "" }, { "docid": "b2a12017c23c3a0ca47c7bb607253358", "score": "0.6735714", "text": "func (s *CreateFeatureGroupInput) SetOfflineStoreConfig(v *OfflineStoreConfig) *CreateFeatureGroupInput {\n\ts.OfflineStoreConfig = v\n\treturn s\n}", "title": "" }, { "docid": "35f2949de2f2c17412ba2a16f0713e71", "score": "0.6578148", "text": "func (s *DescribeFeatureGroupOutput) SetOfflineStoreConfig(v *OfflineStoreConfig) *DescribeFeatureGroupOutput {\n\ts.OfflineStoreConfig = v\n\treturn s\n}", "title": "" }, { "docid": "2cf2db6c828d2e63c350222b297c236a", "score": "0.6499643", "text": "func (mc *MockCluster) SetStoreDown(storeID uint64) {\n\tstore := mc.GetStore(storeID)\n\tstore.State = metapb.StoreState_Up\n\tstore.LastHeartbeatTS = time.Time{}\n\tmc.PutStore(store)\n}", "title": "" }, { "docid": "1c1cc5c72de10287f33e8de724650a69", "score": "0.6468916", "text": "func (mc *MockCluster) SetStoreDisconnect(storeID uint64) {\n\tstore := mc.GetStore(storeID)\n\tstore.State = metapb.StoreState_Up\n\tstore.LastHeartbeatTS = time.Now().Add(-time.Second * 30)\n\tmc.PutStore(store)\n}", "title": "" }, { "docid": "3098944c71ee02cd4309ffbe03801c24", "score": "0.6374722", "text": "func (s *FeatureGroup) SetOfflineStoreConfig(v *OfflineStoreConfig) *FeatureGroup {\n\ts.OfflineStoreConfig = v\n\treturn s\n}", "title": "" }, { "docid": "70b5f8bae0daf49442e03a8be7daf6d9", "score": "0.6349295", "text": "func (v Account) SetOffline() (bool, error) {\n\tr, err := v.API.Request(\"account.setOffline\", nil)\n\tif err != nil {\n\t\treturn false, err\n\t}\n\n\treturn decodeBoolIntResponse(r)\n}", "title": "" }, { "docid": "ee3fd2d71d1c70898482504e36e4ad59", "score": "0.6163456", "text": "func (a *Account) SetOffline() (bool, error) {\n\tresp, err := a.vk.Request(\"account.setOffline\", nil)\n\tif err != nil {\n\t\treturn false, err\n\t}\n\tok, err := strconv.ParseUint(string(resp), 10, 8)\n\tif err != nil {\n\t\treturn false, err\n\t}\n\treturn ok == 1, nil\n}", "title": "" }, { "docid": "076af7f86cb1cc6e44846e3821e41938", "score": "0.58590823", "text": "func (c *Cluster) StopStore(storeID uint64) {\n\tc.Lock()\n\tdefer c.Unlock()\n\n\tif store := c.stores[storeID]; store != nil {\n\t\tstore.meta.State = metapb.StoreState_Offline\n\t}\n}", "title": "" }, { "docid": "583ee49c9b766b782f9729bd0ba8b871", "score": "0.54668784", "text": "func (mc *MockCluster) SetStoreBusy(storeID uint64, busy bool) {\n\tstore := mc.GetStore(storeID)\n\tstore.Stats.IsBusy = busy\n\tstore.LastHeartbeatTS = time.Now()\n\tmc.PutStore(store)\n}", "title": "" }, { "docid": "b6861375821ba374ec7e06d0050d0449", "score": "0.5246686", "text": "func (s *ListFeatureGroupsInput) SetOfflineStoreStatusEquals(v string) *ListFeatureGroupsInput {\n\ts.OfflineStoreStatusEquals = &v\n\treturn s\n}", "title": "" }, { "docid": "433601d50fc5a5089e179e4771aa9b57", "score": "0.5222556", "text": "func TestMarkOffline(t *testing.T) {\n\tsuicide := int64(0)\n\tgo func() {\n\t\ts.Join()\n\t\tatomic.StoreInt64(&suicide, 1)\n\t}()\n\n\terr := models.SetProxyStatus(conn, conf.productName, conf.proxyId, models.PROXY_STATE_MARK_OFFLINE)\n\tassert.MustNoError(err)\n\n\ttime.Sleep(3 * time.Second)\n\n\tif atomic.LoadInt64(&suicide) == 0 {\n\t\tt.Error(\"shoud be suicided\")\n\t}\n}", "title": "" }, { "docid": "34a544ffc53b0338a8957b5b36e227b0", "score": "0.5219094", "text": "func (s *EdgeModelStat) SetOfflineDeviceCount(v int64) *EdgeModelStat {\n\ts.OfflineDeviceCount = &v\n\treturn s\n}", "title": "" }, { "docid": "412ee84e842664e8910f2f2187c8243c", "score": "0.5167236", "text": "func SetStore(s *Store) {\n\tstore = s\n}", "title": "" }, { "docid": "5440724a83c8d0ec0256bc4e53e8ce5d", "score": "0.51567525", "text": "func (z *zpoolctl) Offline(ctx context.Context, name string, force, t bool, devs ...string) *execute {\n\targs := []string{\"offline\"}\n\targs = append(args, name)\n\tif force {\n\t\targs = append(args, \"-f\")\n\t}\n\tif t {\n\t\targs = append(args, \"-t\")\n\t}\n\tfor _, dev := range devs {\n\t\targs = append(args, dev)\n\t}\n\treturn &execute{ctx: ctx, name: z.cmd, args: args}\n}", "title": "" }, { "docid": "401ca42be4a65515696c04e1ed17df52", "score": "0.51141727", "text": "func (m *MainWindow) hideOfflineAllServers() {\n\tfmt.Println(\"(Un)Hiding offline servers in 'Servers' tab...\")\n\tif m.all_servers_hide_offline.GetActive() {\n\t\tctx.Cfg.Cfg[\"/serverslist/all_servers/hide_offline\"] = \"1\"\n\t} else {\n\t\tctx.Cfg.Cfg[\"/serverslist/all_servers/hide_offline\"] = \"0\"\n\t}\n\tctx.Eventer.LaunchEvent(\"loadAllServers\", map[string]string{})\n}", "title": "" }, { "docid": "8e84743400861ab12b42655825881700", "score": "0.502987", "text": "func (d *Dao) DeviceOffline(mid int64) error {\n\tvar (\n\t\tupdate = bson.M{\"$set\": bson.M{\"online\": false}}\n\t)\n\tsession := d.MongoSession.Copy()\n\tdefer session.Close()\n\treturn d.GetCollection(session, deviceCollection).Update(bson.M{\"_id\": mid}, update)\n}", "title": "" }, { "docid": "39f0ee980c7a8d1059dd7114da5df209", "score": "0.49000996", "text": "func (mc *MockCluster) SetStoreUp(storeID uint64) {\n\tstore := mc.GetStore(storeID)\n\tstore.State = metapb.StoreState_Up\n\tstore.LastHeartbeatTS = time.Now()\n\tmc.PutStore(store)\n}", "title": "" }, { "docid": "353c02811269796aeeccbb162e4bca82", "score": "0.4799603", "text": "func (o *RequestSepaMoneyTransferParams) SetStoreSecrets(v bool) {\n\to.StoreSecrets = &v\n}", "title": "" }, { "docid": "5a4fb65551174b400e39768e45e8869e", "score": "0.47764346", "text": "func (writer *DefaultPacketWriter) WriteOffline(packet RakNetPacket) error {\n\toutput := make([]byte, 0, 1492)\n\tbuffer := bytes.NewBuffer(output)\n\tstream := &extendedWriter{buffer}\n\n\terr := stream.WriteByte(packet.Type())\n\tif err != nil {\n\t\treturn err\n\t}\n\terr = stream.allBytes(OfflineMessageID)\n\tif err != nil {\n\t\treturn err\n\t}\n\n\terr = packet.Serialize(writer, stream)\n\tif err != nil {\n\t\treturn err\n\t}\n\tlayers := &PacketLayers{\n\t\tPacketType: packet.Type(),\n\t\tMain: packet,\n\t\tOfflinePayload: buffer.Bytes(),\n\t\tUniqueID: writer.context.uniqueID,\n\t}\n\twriter.context.uniqueID++\n\n\twriter.output(layers.OfflinePayload)\n\t<-writer.LayerEmitter.Emit(\"offline\", layers)\n\treturn nil\n}", "title": "" }, { "docid": "a3bf547b70eaee918bdb8e88b9d27b0c", "score": "0.47478884", "text": "func (client *LDClient) IsOffline() bool {\n\treturn client.offline\n}", "title": "" }, { "docid": "d7342d9f9c8661afc5ab799d052abcb9", "score": "0.46964848", "text": "func (m *MainWindow) hideOfflineFavoriteServers() {\n\tfmt.Println(\"(Un)Hiding offline servers in 'Favorite' tab...\")\n\tif m.fav_servers_hide_offline.GetActive() {\n\t\tctx.Cfg.Cfg[\"/serverslist/favorite/hide_offline\"] = \"1\"\n\t} else {\n\t\tctx.Cfg.Cfg[\"/serverslist/favorite/hide_offline\"] = \"0\"\n\t}\n\tctx.Eventer.LaunchEvent(\"loadFavoriteServers\", map[string]string{})\n}", "title": "" }, { "docid": "d5d610c7e7104d31cafd27703e161f45", "score": "0.46964324", "text": "func (o *PaymentMethodCash) SetStore(v string) {\n\to.Store.Set(&v)\n}", "title": "" }, { "docid": "99171a75d36a2b8858bd57d11741af3c", "score": "0.46901658", "text": "func (ctx Context) WithOffline(offline bool) Context {\n\tctx.Offline = offline\n\treturn ctx\n}", "title": "" }, { "docid": "58289542b9ed9de4eabf892f08829333", "score": "0.46832383", "text": "func (u *UserProfile) SetStore(store *Store) error {\n\tif store == nil {\n\t\treturn errors.New(\"cannot set UserProfile store to a nil value\")\n\t}\n\tif store.ID == \"\" {\n\t\treturn errors.New(\"UserProfile.SetStore: store is uninitialized\")\n\t}\n\tu.store = store\n\treturn nil\n}", "title": "" }, { "docid": "ead8aa7cac189ebf3a53f077d8b0bc69", "score": "0.46816924", "text": "func (r *Syncer) downloadStore(path string, description string) error {\n\treturn r.downloadStoreApply(path, \"\", description, 0, util.Nop)\n}", "title": "" }, { "docid": "a6e154de52f858f865264ede14ddb70b", "score": "0.4678012", "text": "func (m *ConditionalAccessDeviceStates) SetExcludeStates(value []string)() {\n err := m.GetBackingStore().Set(\"excludeStates\", value)\n if err != nil {\n panic(err)\n }\n}", "title": "" }, { "docid": "7908c42501571423e115f06d6f9ad47a", "score": "0.46590316", "text": "func (h *BotSnack) SetStore(_ PluginStore) {}", "title": "" }, { "docid": "05c1705387cc8c0c811dd79dc6ed0ac9", "score": "0.46339464", "text": "func OfflineMode(offlineMode bool) BuilderOpt {\n\treturn func(c *Builder) error {\n\t\tc.OfflineMode = offlineMode\n\t\treturn nil\n\t}\n}", "title": "" }, { "docid": "165e94a8caf4b96bd9b4f9ce01ce4bd5", "score": "0.46079054", "text": "func (m *OnlineMeetingInfo) SetBackingStore(value ie8677ce2c7e1b4c22e9c3827ecd078d41185424dd9eeb92b7d971ed2d49a392e.BackingStore)() {\n m.backingStore = value\n}", "title": "" }, { "docid": "30ccf263d696042c992a0630b34eedc6", "score": "0.45918992", "text": "func (m *PortalNotification) SetBackingStore(value ie8677ce2c7e1b4c22e9c3827ecd078d41185424dd9eeb92b7d971ed2d49a392e.BackingStore)() {\n m.backingStore = value\n}", "title": "" }, { "docid": "4bedff9f9edacef51a24f0bc41e40509", "score": "0.4526627", "text": "func (o *PaymentMethodCash) UnsetStore() {\n\to.Store.Unset()\n}", "title": "" }, { "docid": "bde15883e80a83d61a85f48603b8182e", "score": "0.44974008", "text": "func (dm *DMMasterClient) OfflineWorker(name string, retryOpt *utils.RetryOption) error {\n\tquery := \"/worker/\" + name\n\treturn dm.OfflineMember(query, retryOpt)\n}", "title": "" }, { "docid": "eea31a215da7fd086d0d710c492c76f5", "score": "0.44889894", "text": "func (m *PresenceStatusMessage) SetBackingStore(value ie8677ce2c7e1b4c22e9c3827ecd078d41185424dd9eeb92b7d971ed2d49a392e.BackingStore)() {\n m.backingStore = value\n}", "title": "" }, { "docid": "c3c9a512ffed12a3cd61683dfa4ad2f0", "score": "0.44857082", "text": "func (s *RecordsIngested) SetMemoryStore(v int64) *RecordsIngested {\n\ts.MemoryStore = &v\n\treturn s\n}", "title": "" }, { "docid": "342fcfb0674ffc537ca3448e7ca4b1a8", "score": "0.44838184", "text": "func (m *ConditionalAccessDeviceStates) SetBackingStore(value ie8677ce2c7e1b4c22e9c3827ecd078d41185424dd9eeb92b7d971ed2d49a392e.BackingStore)() {\n m.backingStore = value\n}", "title": "" }, { "docid": "26467573dacb99a6ef4e42a5dd1daf7a", "score": "0.44820374", "text": "func (sc *SessionContext) SetStore(store sessions.Store) {\n\tif store == nil {\n\t\tsc.store = dbStore.NewDatabaseStore([]byte(\"3d1fd34f389d799a2539ff554d922683\"))\n\t} else {\n\t\tsc.store = store\n\t}\n}", "title": "" }, { "docid": "9c82daeaf08fdb716676c2bad8be4533", "score": "0.44447553", "text": "func (n ServiceNodeInfo) IsOffline(clock clock.Clock, threshold time.Duration) bool {\n\treturn nodeIsOffline(clock, threshold, n.Heartbeat)\n}", "title": "" }, { "docid": "aa522c3c95ee6d5fdc087944959a178e", "score": "0.44213244", "text": "func (m *DeviceHealthAttestationState) SetBackingStore(value ie8677ce2c7e1b4c22e9c3827ecd078d41185424dd9eeb92b7d971ed2d49a392e.BackingStore)() {\n m.backingStore = value\n}", "title": "" }, { "docid": "1c35c6e988b03a777768664295f240fe", "score": "0.44197667", "text": "func (m *GovernancePolicy) SetBackingStore(value ie8677ce2c7e1b4c22e9c3827ecd078d41185424dd9eeb92b7d971ed2d49a392e.BackingStore)() {\n m.backingStore = value\n}", "title": "" }, { "docid": "6e489d58472e1b77ce7b04297afedd94", "score": "0.44030887", "text": "func (m *DeviceManagementSettings) SetBackingStore(value ie8677ce2c7e1b4c22e9c3827ecd078d41185424dd9eeb92b7d971ed2d49a392e.BackingStore)() {\n m.backingStore = value\n}", "title": "" }, { "docid": "bae6fb45659518420c2b8b2a76024239", "score": "0.44012454", "text": "func (_ *offlineExchange) Close() error {\n\t// NB: exchange doesn't own the blockstore's underlying datastore, so it is\n\t// not responsible for closing it.\n\treturn nil\n}", "title": "" }, { "docid": "fd181ebccb6f3abe078e79695746427d", "score": "0.4396381", "text": "func (m *MailboxSettings) SetBackingStore(value ie8677ce2c7e1b4c22e9c3827ecd078d41185424dd9eeb92b7d971ed2d49a392e.BackingStore)() {\n m.backingStore = value\n}", "title": "" }, { "docid": "a7e1e2905c1da645e1fb601dcf4a9b2a", "score": "0.4391414", "text": "func (m *DeviceManagementApplicabilityRuleOsEdition) SetBackingStore(value ie8677ce2c7e1b4c22e9c3827ecd078d41185424dd9eeb92b7d971ed2d49a392e.BackingStore)() {\n m.backingStore = value\n}", "title": "" }, { "docid": "96ff79f55ad00bb414c262417d6bef9d", "score": "0.43879175", "text": "func (s *TestSuite) TestOfflineTarget(t *testing.T) {\n\t// create a target entity in topo\n\tcreateOfflineTarget(t, offlineTargetName, \"devicesim\", \"1.0.0\", offlineTargetName+\":11161\")\n\n\t// Make a GNMI client to use for requests\n\tgnmiClient := gnmiutils.GetGNMIClientOrFail(t)\n\n\t// Sends a set request using onos-config NB\n\ttargetPath := gnmiutils.GetTargetPathWithValue(offlineTargetName, modPath, modValue, proto.StringVal)\n\tgnmiutils.SetGNMIValueOrFail(t, gnmiClient, targetPath, gnmiutils.NoPaths, gnmiutils.NoExtensions)\n\n\t// Install and start target simulator\n\tsimulator := gnmiutils.CreateSimulatorWithName(t, offlineTargetName, false)\n\tdefer gnmiutils.DeleteSimulator(t, simulator)\n\n\t// Wait for config to connect to the target\n\tgnmiutils.WaitForTargetAvailable(t, topoapi.ID(simulator.Name()), time.Minute)\n\terr := gnmiutils.WaitForConfigurationCompleteOrFail(t, configapi.ConfigurationID(simulator.Name()), time.Minute)\n\tassert.NoError(t, err)\n\n\tgnmiutils.CheckGNMIValue(t, gnmiClient, targetPath, modValue, 0, \"Query after set returned the wrong value\")\n\n\t// Check that the value was set properly on the target, wait for configuration gets completed\n\ttargetGnmiClient := gnmiutils.GetTargetGNMIClientOrFail(t, simulator)\n\tgnmiutils.CheckTargetValue(t, targetGnmiClient, targetPath, modValue)\n}", "title": "" }, { "docid": "70bc7800f48ec6379062d447f8af899e", "score": "0.43764785", "text": "func (m *RetentionEventStatus) SetBackingStore(value ie8677ce2c7e1b4c22e9c3827ecd078d41185424dd9eeb92b7d971ed2d49a392e.BackingStore)() {\n m.backingStore = value\n}", "title": "" }, { "docid": "7e879f26d28d40920a295d4ac6bf0d71", "score": "0.43650776", "text": "func (h *Salute) SetStore(_ PluginStore) {}", "title": "" }, { "docid": "f581257da8b9efdbca04494fc2959749", "score": "0.4347454", "text": "func (m *RetentionLabelSettings) SetBackingStore(value ie8677ce2c7e1b4c22e9c3827ecd078d41185424dd9eeb92b7d971ed2d49a392e.BackingStore)() {\n m.backingStore = value\n}", "title": "" }, { "docid": "05d0c7459a180b27b5307dafbcad49f4", "score": "0.43275574", "text": "func StopOfflineCleanupTimer() {\n\tif _offlineCleanupTimer != nil {\n\t\t_offlineCleanupTimer.Stop()\n\t}\n}", "title": "" }, { "docid": "39ba6112b052ef8de20b811fa3e63bd8", "score": "0.4323412", "text": "func (h *Beer) SetStore(_ PluginStore) {}", "title": "" }, { "docid": "29028ab454aa8637b79f766ba8979f0d", "score": "0.43132898", "text": "func (c *pdClient) SetStoreState(storeID uint64, state string) error {\n\tapiURL := fmt.Sprintf(\"%s/%s/%d/state?state=%s\", c.url, storePrefix, storeID, state)\n\treq, err := http.NewRequest(\"POST\", apiURL, nil)\n\tif err != nil {\n\t\treturn err\n\t}\n\tres, err := c.httpClient.Do(req)\n\tif err != nil {\n\t\treturn err\n\t}\n\tdefer httputil.DeferClose(res.Body)\n\n\tif res.StatusCode == http.StatusOK || res.StatusCode == http.StatusNotFound {\n\t\treturn nil\n\t}\n\tbody, err := io.ReadAll(res.Body)\n\tif err != nil {\n\t\treturn err\n\t}\n\n\treturn fmt.Errorf(\"failed to delete store %d: %v\", storeID, string(body))\n}", "title": "" }, { "docid": "f417dfefab7cc52e8355de9e806faf27", "score": "0.4307667", "text": "func (m *SharepointIds) SetBackingStore(value ie8677ce2c7e1b4c22e9c3827ecd078d41185424dd9eeb92b7d971ed2d49a392e.BackingStore)() {\n m.backingStore = value\n}", "title": "" }, { "docid": "3b2423ceb4f6847d4e98ddb376b5665a", "score": "0.43046552", "text": "func (m *DeviceManagementSettingDependency) SetBackingStore(value ie8677ce2c7e1b4c22e9c3827ecd078d41185424dd9eeb92b7d971ed2d49a392e.BackingStore)() {\n m.backingStore = value\n}", "title": "" }, { "docid": "c36e29c03fcf31835199f106d5c348f5", "score": "0.42812854", "text": "func (m *WindowsKioskProfile) SetBackingStore(value ie8677ce2c7e1b4c22e9c3827ecd078d41185424dd9eeb92b7d971ed2d49a392e.BackingStore)() {\n m.backingStore = value\n}", "title": "" }, { "docid": "080fcbfd35fdb9a43641fe63fa3c6ab4", "score": "0.42743292", "text": "func (ws *WalletStore) Reset(nodeID string) error {\n\tfile := ws.Config.GetWalletStoreFile(nodeID)\n\tif !FileExists(file) {\n\t\tws.Save()\n\t} else {\n\t\tws.ClearAll()\n\t}\n\treturn nil\n}", "title": "" }, { "docid": "1edb8a2916563d3ad15f72da16f76e04", "score": "0.42648998", "text": "func (m *TeamworkSoftwareUpdateHealth) SetBackingStore(value ie8677ce2c7e1b4c22e9c3827ecd078d41185424dd9eeb92b7d971ed2d49a392e.BackingStore)() {\n m.backingStore = value\n}", "title": "" }, { "docid": "3a2276be897d82c26cdf85841215b46a", "score": "0.4264164", "text": "func (m *ImportedWindowsAutopilotDeviceIdentityState) SetBackingStore(value ie8677ce2c7e1b4c22e9c3827ecd078d41185424dd9eeb92b7d971ed2d49a392e.BackingStore)() {\n m.backingStore = value\n}", "title": "" }, { "docid": "18b2a8e2984e41bc5517cf9b7f6361e4", "score": "0.42574975", "text": "func (p *atomicMSpanPointer) StoreNoWB(s *mspan) {\n\tp.p.StoreNoWB(unsafe.Pointer(s))\n}", "title": "" }, { "docid": "fd0b0b430964bf96e3424132d3c5f308", "score": "0.425153", "text": "func (dm *DMMasterClient) OfflineMaster(name string, retryOpt *utils.RetryOption) error {\n\tquery := \"/master/\" + name\n\treturn dm.OfflineMember(query, retryOpt)\n}", "title": "" }, { "docid": "116eb390c33f1a9ea409ecc7551610f9", "score": "0.4245618", "text": "func (m *MicrosoftManagedDesktop) SetBackingStore(value ie8677ce2c7e1b4c22e9c3827ecd078d41185424dd9eeb92b7d971ed2d49a392e.BackingStore)() {\n m.backingStore = value\n}", "title": "" }, { "docid": "2d281cefdacb4c12c44bb8e8620ce01e", "score": "0.4238177", "text": "func (m *Setting) SetBackingStore(value ie8677ce2c7e1b4c22e9c3827ecd078d41185424dd9eeb92b7d971ed2d49a392e.BackingStore)() {\n m.backingStore = value\n}", "title": "" }, { "docid": "b273aa49e2c23f45f8543c9b3427b91b", "score": "0.4231338", "text": "func (in *Store) DeepCopy() *Store {\n\tif in == nil {\n\t\treturn nil\n\t}\n\tout := new(Store)\n\tin.DeepCopyInto(out)\n\treturn out\n}", "title": "" }, { "docid": "3cee1133ca815867333e32091061b6c4", "score": "0.42086998", "text": "func (r *Registry) Disable(names ...string) {\n\tr.Lock()\n\tdefer r.Unlock()\n\n\tfor _, name := range names {\n\t\tif obj, ok := r.dataStores[name]; ok {\n\t\t\tobj.Enabled = false\n\t\t}\n\t}\n}", "title": "" }, { "docid": "749750f24bf8fdc44f9be80a357dcf05", "score": "0.42010298", "text": "func NewOfflineProcessor(context context.T) (*Processor, error) {\n\tmessageContext := context.With(\"[\" + offlineName + \"]\")\n\tlog := messageContext.Log()\n\n\tlog.Debug(\"Creating offline command document service\")\n\tofflineService, err := newOfflineService(log)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\treturn NewProcessor(messageContext, offlineName, offlineService, 1, 1, false, []model.DocumentType{model.SendCommandOffline, model.CancelCommandOffline}), nil\n}", "title": "" }, { "docid": "a2ff9a999c850f33f097c61048ff0197", "score": "0.41856587", "text": "func UseFallbackToOffline(useOfflineFallback bool) Option {\n\treturn offlineFallback(useOfflineFallback)\n}", "title": "" }, { "docid": "cc2cf6c26a587b1ed127939d4d1a83c2", "score": "0.41711992", "text": "func (m *WindowsMalwareCategoryCount) SetBackingStore(value ie8677ce2c7e1b4c22e9c3827ecd078d41185424dd9eeb92b7d971ed2d49a392e.BackingStore)() {\n m.backingStore = value\n}", "title": "" }, { "docid": "cb2240b43b6db6780ce74be253bad5c0", "score": "0.4159943", "text": "func Storestates(mods ...qm.QueryMod) storestateQuery {\n\tmods = append(mods, qm.From(\"\\\"storestate\\\"\"))\n\treturn storestateQuery{NewQuery(mods...)}\n}", "title": "" }, { "docid": "8af9ec55415e991db33de5c3c21589d5", "score": "0.41597563", "text": "func MicrosoftStoreForBusinessLicenseTypePOffline() *MicrosoftStoreForBusinessLicenseType {\n\tv := MicrosoftStoreForBusinessLicenseTypeVOffline\n\treturn &v\n}", "title": "" }, { "docid": "2650086275139549fa1990b8f085a47c", "score": "0.41576946", "text": "func SetSecureStore(opts buffalo.Options) buffalo.Options {\n\tstore := sessions.NewCookieStore([]byte(getSecret(opts.Env)))\n\tif opts.Env != \"development\" && opts.Env != \"test\" {\n\t\tstore.Options.Secure = true\n\t\tstore.Options.HttpOnly = true\n\t}\n\topts.SessionStore = store\n\treturn opts\n}", "title": "" }, { "docid": "1c2fc251106bab8c64283ceb69d5d796", "score": "0.41574153", "text": "func NewStore() *Store {\n\ts := new(Store)\n\ts.data = make(map[string]interface{})\n\ts.dataChangeNotifiers = make([]chan bool, 0)\n\ts.dataWatchers = make(map[chan string]bool)\n\treturn s\n}", "title": "" }, { "docid": "648b31528618f7efadb822a04dd5d395", "score": "0.4150171", "text": "func (m *DeviceOperatingSystemSummary) SetBackingStore(value ie8677ce2c7e1b4c22e9c3827ecd078d41185424dd9eeb92b7d971ed2d49a392e.BackingStore)() {\n m.backingStore = value\n}", "title": "" }, { "docid": "4125e2d9b95ecab72b718653757846c8", "score": "0.41477722", "text": "func (m *InformationalUrl) SetBackingStore(value ie8677ce2c7e1b4c22e9c3827ecd078d41185424dd9eeb92b7d971ed2d49a392e.BackingStore)() {\n m.backingStore = value\n}", "title": "" }, { "docid": "401387c494031b5c63b815486fcefef4", "score": "0.41414404", "text": "func (m *EmailSettings) SetBackingStore(value ie8677ce2c7e1b4c22e9c3827ecd078d41185424dd9eeb92b7d971ed2d49a392e.BackingStore)() {\n m.backingStore = value\n}", "title": "" }, { "docid": "68421b74472ec016d007e0602ad74741", "score": "0.413644", "text": "func GetOffline() []Nas {\n\n\tvar off []Nas\n\tnases.mut.RLock()\n\tvar keys []int\n\tfor k := range nases.data {\n\t\tkeys = append(keys, k)\n\t}\n\tnases.mut.RUnlock()\n\tsort.Ints(keys)\n\tnases.mut.RLock()\n\tfor _, k := range keys {\n\t\tv := nases.data[k]\n\t\tif v.LossPerc == 100 {\n\t\t\toff = append(off, v)\n\t\t}\n\t}\n\tnases.mut.RUnlock()\n\treturn off\n}", "title": "" }, { "docid": "09582dc046e9fdf40074d03b92fd45b1", "score": "0.4134466", "text": "func (m *DiscoveredSensitiveType) SetBackingStore(value ie8677ce2c7e1b4c22e9c3827ecd078d41185424dd9eeb92b7d971ed2d49a392e.BackingStore)() {\n m.backingStore = value\n}", "title": "" }, { "docid": "41048c1763f75a0f5bb68f4e4204b18f", "score": "0.4132964", "text": "func (m *PrinterLocation) SetBackingStore(value ie8677ce2c7e1b4c22e9c3827ecd078d41185424dd9eeb92b7d971ed2d49a392e.BackingStore)() {\n m.backingStore = value\n}", "title": "" }, { "docid": "3c10669d3829ae434237530db09ae30a", "score": "0.41277966", "text": "func (m *ConnectorStatusDetails) SetBackingStore(value ie8677ce2c7e1b4c22e9c3827ecd078d41185424dd9eeb92b7d971ed2d49a392e.BackingStore)() {\n m.backingStore = value\n}", "title": "" }, { "docid": "23cd509026c84ad6f644f1ca84ea844b", "score": "0.41251472", "text": "func SetOfflineActivationRequestMeterAttributeUses(name string, uses uint) int {\n\tcName := goToCString(name)\n\tcUses := (C.uint)(uses)\n\tstatus := C.SetOfflineActivationRequestMeterAttributeUses(cName, cUses)\n\tfreeCString(cName)\n\treturn int(status)\n}", "title": "" }, { "docid": "53c3bf81cd0a2cb90253d7a52fa8bd7b", "score": "0.4124228", "text": "func (m *CloudPcRestorePointSetting) SetBackingStore(value ie8677ce2c7e1b4c22e9c3827ecd078d41185424dd9eeb92b7d971ed2d49a392e.BackingStore)() {\n m.backingStore = value\n}", "title": "" }, { "docid": "d2d250565ea72bec7952ad7582c3255b", "score": "0.4123684", "text": "func (s OfflineStoreStatus) String() string {\n\treturn awsutil.Prettify(s)\n}", "title": "" }, { "docid": "a97289c45b1c6ec07ec5c67e53c87299", "score": "0.41072324", "text": "func (s *atomicSpanSetSpinePointer) StoreNoWB(p spanSetSpinePointer) {\n\ts.a.StoreNoWB(p.p)\n}", "title": "" }, { "docid": "28d78d5fcc3eff4ae5421ef4f307aa4c", "score": "0.41016218", "text": "func (o ServerEndpointSyncStatusResponseOutput) OfflineDataTransferStatus() pulumi.StringOutput {\n\treturn o.ApplyT(func(v ServerEndpointSyncStatusResponse) string { return v.OfflineDataTransferStatus }).(pulumi.StringOutput)\n}", "title": "" }, { "docid": "53475e3cd1ac84803516741c29cb300c", "score": "0.409777", "text": "func ResetStoreInstance() {\n\tif storeInstance == nil {\n\t\treturn\n\t}\n\tstoreInstance.Stop()\n\tstoreInstance = nil\n}", "title": "" }, { "docid": "8fb77a31a9a7e744d70e0c9b21202062", "score": "0.40946364", "text": "func TestIsOffline(t *testing.T) {\n\tfor _, ac := range appClassCases {\n\t\tt.Logf(\"start case: %s\", ac.describe)\n\t\tresult := IsOffline(ac.pod)\n\t\tif result != ac.isOffline {\n\t\t\tt.Fatalf(\"offline check err, expect %v, but get %v\", ac.isOffline, result)\n\t\t}\n\t}\n}", "title": "" }, { "docid": "029772ee87931fd7fb8ec81be9e2c1b6", "score": "0.40941244", "text": "func (a *SSERelayDataStoreAdapter) GetStore() interfaces.DataStore {\n\ta.mu.RLock()\n\tstore := a.store\n\ta.mu.RUnlock()\n\treturn store\n}", "title": "" }, { "docid": "655d3dae476e780f980683945c59f86f", "score": "0.40925926", "text": "func (p *AccumuloProxyClient) OfflineTable(login []byte, tableName string, wait bool) (err error) {\n\tif err = p.sendOfflineTable(login, tableName, wait); err != nil {\n\t\treturn\n\t}\n\treturn p.recvOfflineTable()\n}", "title": "" }, { "docid": "485107daf856fc55abf45ddc5995aa07", "score": "0.4092026", "text": "func (d *domainClient) SetCacheDisabled(ctx context.Context, args *SetCacheDisabledArgs) (err error) {\n\tif args != nil {\n\t\terr = rpcc.Invoke(ctx, \"Network.setCacheDisabled\", args, nil, d.conn)\n\t} else {\n\t\terr = rpcc.Invoke(ctx, \"Network.setCacheDisabled\", nil, nil, d.conn)\n\t}\n\tif err != nil {\n\t\terr = &internal.OpError{Domain: \"Network\", Op: \"SetCacheDisabled\", Err: err}\n\t}\n\treturn\n}", "title": "" }, { "docid": "a5bf8c182071f7b1be36453658d9add1", "score": "0.4091553", "text": "func (m *DeliveryOptimizationBandwidthBusinessHoursLimit) SetBackingStore(value ie8677ce2c7e1b4c22e9c3827ecd078d41185424dd9eeb92b7d971ed2d49a392e.BackingStore)() {\n m.backingStore = value\n}", "title": "" }, { "docid": "d8c8dcd3646c09d18e03638dbea0055e", "score": "0.40858725", "text": "func (s *StatsPeriodStore) SetGenericStore(store *kallax.Store) {\n\ts.Store = store\n}", "title": "" }, { "docid": "7e25dd47e2d999eaee760070b9240fdf", "score": "0.4085255", "text": "func (m *DeviceEnrollmentWindowsHelloForBusinessConfiguration) SetState(value *Enablement)() {\n err := m.GetBackingStore().Set(\"state\", value)\n if err != nil {\n panic(err)\n }\n}", "title": "" }, { "docid": "c3fa73e8c40a075a6748f45d55db2e3f", "score": "0.4085198", "text": "func (s *PollStore) SetGenericStore(store *kallax.Store) {\n\ts.Store = store\n}", "title": "" }, { "docid": "c35da9453120d1c654fa3690a3eebb0b", "score": "0.40705013", "text": "func (o ServerEndpointHealthResponseOutput) OfflineDataTransferStatus() pulumi.StringPtrOutput {\n\treturn o.ApplyT(func(v ServerEndpointHealthResponse) *string { return v.OfflineDataTransferStatus }).(pulumi.StringPtrOutput)\n}", "title": "" }, { "docid": "8b4dc1212b479845d58b227dd69676e1", "score": "0.40668517", "text": "func (m *DeviceHealth) SetBackingStore(value ie8677ce2c7e1b4c22e9c3827ecd078d41185424dd9eeb92b7d971ed2d49a392e.BackingStore)() {\n m.backingStore = value\n}", "title": "" }, { "docid": "b01db400c9a4963390b97b49cc39f3ee", "score": "0.40623435", "text": "func WritableStore(location string, cmdOpt cmdStoreOptions) (desync.WriteStore, error) {\n\ts, err := storeFromLocation(location, cmdOpt)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\tstore, ok := s.(desync.WriteStore)\n\tif !ok {\n\t\treturn nil, fmt.Errorf(\"store '%s' does not support writing\", location)\n\t}\n\treturn store, nil\n}", "title": "" }, { "docid": "f0cdd8bf526c4b58ee8b3fb4f19ccb8f", "score": "0.40590277", "text": "func (m *SecurityActionState) SetBackingStore(value ie8677ce2c7e1b4c22e9c3827ecd078d41185424dd9eeb92b7d971ed2d49a392e.BackingStore)() {\n m.backingStore = value\n}", "title": "" }, { "docid": "ca480cb0cac074b14fba68f0f4653c3b", "score": "0.40577406", "text": "func (s *PollOptionStore) SetGenericStore(store *kallax.Store) {\n\ts.Store = store\n}", "title": "" }, { "docid": "e5c6fca1fbdf66b7e48de3f3ab5be8bd", "score": "0.4048624", "text": "func IsNoStoreAPIWarning(warning string) bool {\n\treturn strings.EqualFold(warning, NoStoreAPIWarning)\n}", "title": "" }, { "docid": "2e7b4991eb6fa7de849d90520c872b51", "score": "0.40475023", "text": "func NewStore(store storage.Interface) *Store {\n\treturn &Store{store: store}\n}", "title": "" } ]