text
stringlengths
11
6.3k
embedding
listlengths
768
768
func (dsm DSM) GetTrustedUpdateMode(hostID int) (TrustedUpdateModeResponse, bool) { var describeTUResponse JsonDescribeTrustedUpdateModeResponse url := fmt.Sprintf("%shosts/%d/trusted-update-mode", dsm.RestURL, hostID) cookies := []*http.Cookie{{Name: "sID", Value: dsm.SessionID}} resp, err := grequests.Get(url, &g...
[ -1.175240159034729, 0.09704276919364929, 1.1154779195785522, -0.5573219656944275, -0.25891128182411194, 0.05192757397890091, -0.3961595296859741, -0.5069871544837952, -0.0657825767993927, 0.6322294473648071, -1.1985952854156494, 0.732571005821228, -0.25964054465293884, 0.4307614266872406, ...
func (dsm DSM) EndSession() { url := fmt.Sprintf("%sauthentication/logout", dsm.RestURL) _, err := grequests.Delete(url, &grequests.RequestOptions{HTTPClient: &dsm.RestClient, Params: map[string]string{"sID": dsm.SessionID}}) if err != nil { log.Println("Unable to make request", err) } }
[ -0.8603299260139465, 0.13854457437992096, 0.5050111413002014, -0.9634659886360168, 0.2920098304748535, -0.4607432186603546, 0.08391216397285461, 0.428273469209671, 0.7127158045768738, -0.14882561564445496, 0.33014699816703796, 1.3707327842712402, -0.4725310504436493, 0.01136194821447134, ...
func (dsm DSM) HostRecommendationRuleIDsRetrieve(hostID int, ruleType int, onlyUnassigned string) ([]int32, error) { hrrir := gowsdlservice.HostRecommendationRuleIDsRetrieve{HostID: int32(hostID), Type_: int32(ruleType), Onlyunassigned: onlyUnassigned, SID: dsm.SessionID} resp, err := dsm.SoapClient.HostRecommendati...
[ -0.5161656141281128, 0.27252623438835144, 0.40388408303260803, -0.305203378200531, 0.19318819046020508, 0.4687020182609558, -0.5478492975234985, 0.9353452920913696, -0.8498071432113647, 1.050898551940918, 0.27522242069244385, 1.5212072134017944, -1.231073021888733, 0.4995935559272766, 1....
func (dsm DSM) HostGroupCreate(name string, external bool, externalID string, parentGroupId int32) (*gowsdlservice.HostGroupTransport, error) { hgt := gowsdlservice.HostGroupTransport{Name: name, External: external} if parentGroupId != -1 { hgt.ParentGroupID = parentGroupId } if external { hgt.ExternalID = ext...
[ -0.172357439994812, 1.1037126779556274, 0.5734609365463257, -0.31298160552978516, -0.8123528361320496, 0.062430817633867264, -0.2969149649143219, 0.4236757159233093, -1.4154678583145142, -0.21717801690101624, -0.17448246479034424, -0.235281303524971, -0.9119518399238586, 0.3892211019992828...
func (dsm DSM) HostRetrieveAll() ([]*gowsdlservice.HostTransport, error) { hra := gowsdlservice.HostRetrieveAll{SID: dsm.SessionID} resp, err := dsm.SoapClient.HostRetrieveAll(&hra) if err != nil { return make([]*gowsdlservice.HostTransport, 0), errors.New("Unable to retrieve all hosts.") } else { return resp.H...
[ 0.16457530856132507, 0.5614017248153687, 0.47588586807250977, 0.4939230978488922, -0.04436352103948593, -0.2889077067375183, -0.6297606825828552, 0.3175506293773651, 0.027969956398010254, -1.1204131841659546, -0.2772296369075775, 0.411317378282547, -0.3627103269100189, 0.39420491456985474,...
func (dsm DSM) HostRetrieveByHostGroup(hostGroupId int) ([]*gowsdlservice.HostTransport, error) { hrgh := gowsdlservice.HostRetrieveByHostGroup{HostGroupID: int32(hostGroupId), SID: dsm.SessionID} resp, err := dsm.SoapClient.HostRetrieveByHostGroup(&hrgh) if err != nil { return make([]*gowsdlservice.HostTransport,...
[ -0.3577578365802765, 0.4302334487438202, 0.33755892515182495, 0.2632471024990082, -0.6211584210395813, -0.918228030204773, 0.3386244773864746, -0.46641287207603455, -0.464843213558197, 0.010681597515940666, -0.2621236741542816, -0.5723841190338135, -1.0260372161865234, 0.5884076356887817, ...
func (dsm DSM) HostGroupRetrieveAll() ([]*gowsdlservice.HostGroupRetrieveAllReturnTransport, error) { hgra := gowsdlservice.HostGroupRetrieveAll{SID: dsm.SessionID} resp, err := dsm.SoapClient.HostGroupRetrieveAll(&hgra) if err != nil { return make([]*gowsdlservice.HostGroupRetrieveAllReturnTransport, 0), errors.N...
[ -0.3041888475418091, 0.8874281644821167, 0.43953368067741394, 0.2869085669517517, -0.6181759238243103, -0.3964199423789978, -0.1102418601512909, 0.18653498589992523, -0.6829479932785034, -1.0759892463684082, -0.06831765174865723, 0.4635452926158905, -0.5732293725013733, 0.6287912130355835,...
func (dsm DSM) HostGetStatus(host int32) (*gowsdlservice.HostStatusTransport, error) { hgs := gowsdlservice.HostGetStatus{Id: host, SID: dsm.SessionID} response, err := dsm.SoapClient.HostGetStatus(&hgs) if err != nil { return nil, errors.New(fmt.Sprintf("Unable to get host status for host: %d", host)) } else { ...
[ -0.1116676777601242, 0.15988518297672272, 0.5260622501373291, -0.4240819811820984, -0.5739315152168274, -0.36864498257637024, -0.4957452118396759, 0.13097357749938965, -0.1337045133113861, -0.3173542618751526, -1.2259379625320435, 0.24614165723323822, -0.20308876037597656, -0.0303799565881...
func (dsm DSM) HostRecommendationScan(hosts []int32) error { hrs := gowsdlservice.HostRecommendationScan{HostIDs: hosts, SID: dsm.SessionID} _, err := dsm.SoapClient.HostRecommendationScan(&hrs) if err != nil { return errors.New(fmt.Sprintf("Error intiating host reccomentdation scan on hosts %d", hosts)) } else {...
[ -1.1236367225646973, 0.6664003133773804, 0.429583877325058, -0.08562381565570831, -0.6034296751022339, 0.3924194872379303, 0.6053261160850525, 0.22964632511138916, -0.8606935143470764, 0.0008759161573834717, 0.07610020786523819, 1.134703278541565, -0.3062000274658203, 0.49222704768180847, ...
func (dsm DSM) HostRetrieveByName(hostName string) (*gowsdlservice.HostTransport, error) { hrbn := gowsdlservice.HostRetrieveByName{Hostname: hostName, SID: dsm.SessionID} resp, err := dsm.SoapClient.HostRetrieveByName(&hrbn) if err != nil || resp.HostRetrieveByNameReturn.Platform == "" { return nil, errors.New(fm...
[ 0.2443293184041977, 0.3621332347393036, 0.35646605491638184, 0.06383374333381653, -0.9100176095962524, -0.5948119759559631, -0.01189697626978159, -0.5403430461883545, -0.34871554374694824, -0.1599915772676468, -0.36291658878326416, -0.4576365053653717, -1.1199257373809814, -0.1498771905899...
func (dsm DSM) HostMoveToHostGroup(hostIDs []int32, hostGroupID int32) (*gowsdlservice.HostMoveToHostGroupResponse, error) { hmtg := gowsdlservice.HostMoveToHostGroup{HostIDs: hostIDs, HostGroupID: hostGroupID, SID: dsm.SessionID} resp, err := dsm.SoapClient.HostMoveToHostGroup(&hmtg) if err != nil { return nil, ...
[ -1.294535517692566, 0.6058838963508606, 0.27134808897972107, -0.3417242765426636, -0.7956345677375793, -0.3224999010562897, 0.44923800230026245, -0.25152236223220825, -1.439078450202942, 0.8949154615402222, -0.11074226349592209, 0.2294340282678604, -0.4762679636478424, 0.39527520537376404,...
func (dsm DSM) AntiMalwareEventRetrieve(rangeFrom time.Time, rangeTo time.Time, specificTime time.Time, timeType string, hostID int, hostGroupID int, securityProfileID int, hostType string, eventID int, eventOperator string) ([]*gowsdlservice.AntiMalwareEventTransport, error) { tft := buildTimeFilterTransport(range...
[ -0.3341157138347626, 0.057160619646310806, 0.6350531578063965, 0.25649455189704895, -0.7889199256896973, -0.17450754344463348, -0.3667719066143036, -0.09103091061115265, 0.203805074095726, 0.32621288299560547, 0.07188494503498077, 0.492788165807724, -0.9132601022720337, 0.4188631474971771,...
func (dsm DSM) SystemEventRetrieve(rangeFrom time.Time, rangeTo time.Time, specificTime time.Time, timeType string, hostID int, hostGroupID int, securityProfileID int, hostType string, eventID int, eventOperator string, includeNonHostEvents bool) ([]*gowsdlservice.SystemEventTransport, error) { tft := buildTimeFilt...
[ -0.3204161822795868, -0.043570391833782196, 0.7189419865608215, 0.6894564032554626, -0.23782745003700256, -0.5458395481109619, -0.007323405239731073, 0.09987529367208481, -0.024538345634937286, 0.08725844323635101, -0.48194509744644165, 0.34211230278015137, -1.188470482826233, 0.4474075138...
func GetAccount(r *http.Request, c appengine.Context, u *user.User) (acc *ds.Account, err error) { // First check in memcache: mk := prefixAccForUID + u.ID var item *memcache.Item if item, err = memcache.Get(c, mk); err == nil { // Found in memcache if len(item.Value) == 0 { // This means that the user has ...
[ -0.4229288399219513, 0.40986067056655884, 0.7815234065055847, 0.3942365050315857, -0.3924097716808319, -0.661204993724823, 0.4781295955181122, 0.2788836658000946, 0.865690290927887, 0.3344431221485138, 0.17739324271678925, 0.30152660608291626, 0.39922094345092773, 0.7076892852783203, 0.4...
func CacheAccount(c appengine.Context, acc *ds.Account) { mk := prefixAccForUID + acc.UserID if err := memcache.Set(c, &memcache.Item{Key: mk, Value: acc.Encode(), Expiration: cachedAccExpiration}); err != nil { c.Warningf("Failed to set %s in memcache: %v", mk, err) } }
[ 0.544397234916687, 0.05432143062353134, 0.2652907371520996, -0.18222196400165558, -0.30620473623275757, -0.016569742932915688, 0.4495915174484253, 0.7743334174156189, 0.811570942401886, 0.4012705087661743, -0.10171320289373398, 1.2051522731781006, 1.059738278388977, 0.11013448983430862, ...
func blockOneCoinbasePaysTokens(tx *dcrutil.Tx, params *chaincfg.Params) error { // Nothing to do when there is no ledger specified. if len(params.BlockOneLedger) == 0 { return nil } if tx.MsgTx().LockTime != 0 { str := "block 1 coinbase has invalid locktime" return ruleError(ErrBlockOneTx, str) } if tx.M...
[ -0.2538699507713318, 0.23235872387886047, 0.822345495223999, -0.24751552939414978, -0.2693464756011963, -0.19260071218013763, 0.325508177280426, -0.8944860696792603, -1.0050073862075806, 0.8302271962165833, 0.17428062856197357, -0.18226224184036255, -0.5135878920555115, 1.0283969640731812,...
func coinbasePaysTreasury(subsidyCache *standalone.SubsidyCache, tx *dcrutil.Tx, height int64, voters uint16, params *chaincfg.Params) error { // Treasury subsidy only applies from block 2 onwards. if height <= 1 { return nil } // Treasury subsidy is disabled. if params.BlockTaxProportion == 0 { return nil }...
[ -0.035468704998493195, 0.0050390190444886684, 0.6338843703269958, -0.5503913760185242, -0.5635883808135986, -0.35087668895721436, 0.25040021538734436, -0.37749162316322327, -0.030576437711715698, 1.0149606466293335, 0.29665547609329224, 0.1435779631137848, -0.5735676884651184, -0.140979245...
func calculateAddedSubsidy(block, parent *dcrutil.Block) int64 { var subsidy int64 if headerApprovesParent(&block.MsgBlock().Header) { subsidy += parent.MsgBlock().Transactions[0].TxIn[0].ValueIn } for _, stx := range block.MsgBlock().STransactions { if stake.IsSSGen(stx) { subsidy += stx.TxIn[0].ValueIn ...
[ 0.6670116782188416, 0.4823436439037323, 0.702737033367157, 0.25165560841560364, -0.9762060642242432, -0.5677292346954346, -0.14291012287139893, -0.7185249328613281, -0.7199445962905884, -0.029975881800055504, -0.5700502991676331, 0.29088762402534485, -1.0268722772598267, 1.207352876663208,...
func (u *ArticlesModel) Create() error { return DB.Self.Create(&u).Error }
[ -0.23836153745651245, 0.6567148566246033, -0.07694882899522781, 0.24973423779010773, 0.3061342239379883, 0.257980614900589, 0.20103026926517487, 0.07952489703893661, -1.5071555376052856, 0.5333700180053711, -0.2843013107776642, -1.1945608854293823, -0.4872419536113739, 0.369819700717926, ...
func DeleteArticles(id uint64) error { Articles := ArticlesModel{} Articles.BaseModel.Id = id return DB.Self.Delete(&Articles).Error }
[ -0.40870460867881775, -0.1971474587917328, -0.04441659152507782, -0.13220922648906708, 0.3818718194961548, -0.03228427842259407, 0.09590200334787369, 0.36188003420829773, 0.13201408088207245, 0.4086553752422333, -0.6695652604103088, -0.8473647236824036, -0.3518141210079193, 0.5363584160804...
func (u *ArticlesModel) Update() error { return DB.Self.Save(u).Error }
[ -1.0866591930389404, -0.43316927552223206, -0.10560114681720734, -0.49176958203315735, -0.19278258085250854, 0.254831999540329, -0.000046175260649761185, 0.49672654271125793, -0.5532424449920654, 0.7776780128479004, -0.556271493434906, -0.5668327808380127, -0.6136614680290222, -0.439526677...
func GetArticleById(id int) (*ArticlesModel, error) { u := &ArticlesModel{} d := DB.Self.Where("id = ?", id).First(&u) return u, d.Error }
[ 0.46743980050086975, -0.21081051230430603, 0.09942521899938583, 0.31204748153686523, 0.2984633147716522, -0.30265647172927856, 0.1587173044681549, -0.5129738450050354, -0.4053410589694977, 0.6433555483818054, -0.4772356450557709, -0.4162701666355133, -0.23360666632652283, 0.088117159903049...
func (diff Diff) MarshalJSON() ([]byte, error) { var o map[string] interface{} = make(map[string] interface{}) o["op"] = diff.Operation o["id"] = diff.Id o["type"] = diff.Type o["data"] = string(diff.Data) if diff.Attr.Key != "" { var a map[string] interface{} = make(map[string] interface{}) a["key"...
[ -1.0187033414840698, -0.343489408493042, 0.7473810315132141, -0.2903449535369873, -0.593579888343811, -0.20687437057495117, 0.9277213215827942, 0.14875514805316925, 0.304137259721756, -0.07891137152910233, -0.8948612809181213, 0.954838216304779, 0.46253934502601624, 1.3196731805801392, 0...
func (diff *Diff) UnmarshalJSON(b []byte) error { //var temp *Diff var temp map[string] interface{} = make(map[string] interface{}) if err := json.Unmarshal(b, &temp); err != nil { return err } diff.Operation = int(temp["op"].(float64)) diff.Id = temp["id"].(string) diff.Type = html.NodeType(temp["ty...
[ -1.2004687786102295, 0.20454005897045135, 0.9343463778495789, -1.1749924421310425, -0.8045406937599182, 0.24432086944580078, 0.9312868714332581, 0.037494245916604996, -0.03098798729479313, -0.07690958678722382, -0.8380082249641418, 0.1446240246295929, 0.3511095941066742, 1.1990686655044556...
func (p *Patch) Add(diff *Diff) int { p.Diffs = append(p.Diffs, *diff) return len(p.Diffs) }
[ -1.3991326093673706, 0.11688952893018723, 0.6988874673843384, -1.5732566118240356, -0.2996237576007843, 0.7782002091407776, -0.18578128516674042, 0.24140454828739166, 0.7218097448348999, -1.074836254119873, -0.8250235319137573, -0.17620517313480377, -0.4559594988822937, 0.18910476565361023...
func (c *Client) ListV3RolesByQuery(query url.Values) ([]V3Role, error) { var roles []V3Role requestURL, err := url.Parse("/v3/roles") if err != nil { return nil, err } requestURL.RawQuery = query.Encode() for { r := c.NewRequest("GET", fmt.Sprintf("%s?%s", requestURL.Path, requestURL.RawQuery)) resp, err ...
[ 0.18036872148513794, -0.03827829658985138, 0.2972995340824127, -0.8023490905761719, 0.2174384444952011, -0.287106454372406, -1.5219757556915283, -0.7722362875938416, 1.2273253202438354, 0.7574240565299988, 0.6766257882118225, 0.7763859033584595, -0.48148074746131897, 0.3034782111644745, ...
func (b *BaseEvent) GetSource() interface{} { return b.Source }
[ 0.6020861864089966, 0.41349610686302185, 0.5553224086761475, 1.813029170036316, 0.2550031244754791, -0.24746151268482208, 0.7659353613853455, 0.0856211930513382, 0.8453936576843262, -0.212301567196846, -0.99132239818573, -0.06262265145778656, -1.1095736026763916, 0.5630576014518738, 0.42...
func (b *BaseEvent) GetTimestamp() time.Time { return b.Timestamp }
[ 0.7555375099182129, 0.4139351546764374, 0.6359979510307312, 0.8964381217956543, 1.3411086797714233, 0.16796889901161194, 0.28214579820632935, 0.17918367683887482, 0.6049909591674805, -0.6518321633338928, -0.4965507984161377, -0.08176213502883911, -0.625754177570343, 0.216278538107872, 0....
func (b *BaseEvent) String() string { return fmt.Sprintf("BaseEvent[source = %#v]", b.Source) }
[ 0.41697967052459717, -0.9310308694839478, 0.15568846464157104, -0.2701016366481781, -0.17287124693393707, 0.5670653581619263, 0.23973609507083893, -0.18999499082565308, -0.03637893870472908, 0.16818088293075562, -0.4655876159667969, 0.6390769481658936, -0.40444403886795044, -0.281079649925...
func NewBaseEvent(source interface{}) *BaseEvent { return &BaseEvent{ Source: source, Timestamp: time.Now(), } }
[ 0.16963140666484833, -0.7308576703071594, 0.1979541927576065, 0.6544801592826843, -0.9957318305969238, 0.09781988710165024, -0.1919570118188858, 0.2423323690891266, 0.4760124981403351, 0.01086160447448492, -1.0691602230072021, 0.9458639621734619, -0.09226181358098984, 0.27775269746780396, ...
func (suite *HandlerTestSuite) SetupTest() { suite.coordinator = ibctesting.NewCoordinator(suite.T(), 2) suite.chainA = suite.coordinator.GetChain(ibctesting.GetChainID(0)) suite.chainB = suite.coordinator.GetChain(ibctesting.GetChainID(1)) }
[ -0.16738450527191162, 0.030576815828680992, 0.38189697265625, -0.11225654184818268, 1.5317476987838745, 0.13746985793113708, 0.7474972605705261, -0.2095206379890442, -0.6802334189414978, -0.5810707807540894, 0.15726862847805023, 0.12666381895542145, -0.6906613707542419, -0.5111786723136902...
func (suite *HandlerTestSuite) TestHandleRecvPacket() { var ( packet channeltypes.Packet ) testCases := []struct { name string malleate func() expPass bool }{ {"success: ORDERED", func() { _, clientB, connA, connB := suite.coordinator.SetupClientConnections(suite.chainA, suite.chainB, clientexpor...
[ 0.08240696787834167, 0.5870121121406555, 1.0281093120574951, -0.9693395495414734, 0.7490842938423157, -0.3774993419647217, 0.12065201252698898, -0.5518640279769897, -0.11637111753225327, -0.7477748394012451, -0.36569342017173767, 0.4917818307876587, -0.12148457765579224, 0.0415399447083473...
func (suite *HandlerTestSuite) TestHandleAcknowledgePacket() { var ( packet channeltypes.Packet ) testCases := []struct { name string malleate func() expPass bool }{ {"success: ORDERED", func() { clientA, clientB, connA, connB := suite.coordinator.SetupClientConnections(suite.chainA, suite.chainB...
[ 0.5655392408370972, 0.08915049582719803, 0.9571276307106018, -1.2204387187957764, 0.9210538268089294, -0.11859458684921265, 0.15001891553401947, -0.5286357402801514, 0.13429850339889526, -0.6988445520401001, -0.1465158313512802, 0.6281556487083435, -0.05472917482256889, 0.46624886989593506...
func (suite *HandlerTestSuite) TestHandleTimeoutPacket() { var ( packet channeltypes.Packet packetKey []byte ) testCases := []struct { name string malleate func() expPass bool }{ {"success: ORDERED", func() { clientA, clientB, connA, connB := suite.coordinator.SetupClientConnections(suite.ch...
[ 0.4361821413040161, 0.10834456235170364, 0.9298204183578491, -0.7099352478981018, 0.23400329053401947, -0.027940504252910614, 0.20338240265846252, -0.7717739939689636, -0.17865698039531708, -0.55319744348526, -0.22598052024841309, 0.6885178685188293, -0.0721186026930809, 0.0190561227500438...
func OSSFuzzGenerateCerts(w http.ResponseWriter, r *http.Request) { var project types.OssFuzzProject query := datastore.NewQuery("OssFuzzProject") it := db.RunQuery(r.Context(), query) for it.Next(&project) { var tls types.WorkerTlsCert entityKey := datastore.Key{ Kind: "WorkerTlsCert", Name: project.Nam...
[ -0.8730405569076538, 0.6505773067474365, 0.4195740520954132, -0.09220725297927856, 0.5173047184944153, 0.2527008056640625, 0.8155347108840942, 0.047090306878089905, -0.9966191649436951, 0.4338528513908386, -0.6537240147590637, -1.1059539318084717, 0.1685010939836502, 0.7648768424987793, ...
func getDashboardsToDelete(allDashboards *v1beta1.GrafanaDashboardList, grafanas []v1beta1.Grafana) map[*v1beta1.Grafana][]v1beta1.NamespacedResource { dashboardsToDelete := map[*v1beta1.Grafana][]v1beta1.NamespacedResource{} for _, grafana := range grafanas { grafana := grafana for _, dashboard := range grafana....
[ -0.02697119489312172, 0.4887482821941376, 0.7397593855857849, 0.5659819841384888, 0.45866063237190247, -0.19072017073631287, 0.6096239686012268, 0.5559038519859314, 0.4136030673980713, -0.24262499809265137, 0.015079561620950699, 0.20929491519927979, 0.2304123044013977, 0.8455383777618408, ...
func (r *GrafanaDashboardReconciler) resolveDatasources(dashboard *v1beta1.GrafanaDashboard, dashboardJson []byte) ([]byte, error) { if len(dashboard.Spec.Datasources) == 0 { return dashboardJson, nil } for _, input := range dashboard.Spec.Datasources { if input.DatasourceName == "" || input.InputName == "" { ...
[ -0.451972097158432, 0.5078014135360718, 0.62980055809021, -0.9654971361160278, 0.4321887195110321, -1.0676947832107544, 0.4410371482372284, 0.584955096244812, -0.13434560596942902, -0.4507603049278259, -0.8993515372276306, -0.701599657535553, -0.37850308418273926, 0.5274717807769775, 0.5...
func (r *GrafanaDashboardReconciler) fetchDashboardJson(dashboard *v1beta1.GrafanaDashboard) ([]byte, error) { sourceTypes := dashboard.GetSourceTypes() if len(sourceTypes) == 0 { return nil, fmt.Errorf("no source type provided for dashboard %v", dashboard.Name) } if len(sourceTypes) > 1 { return nil, fmt.Err...
[ -0.25850582122802734, 0.2813016474246979, 0.5574862957000732, 0.02931455336511135, -0.44465598464012146, -0.5410584807395935, 0.6968811750411987, -0.4108542799949646, 0.22703078389167786, 0.23855160176753998, -0.790717601776123, 0.3574178218841553, -0.002997245639562607, 0.8649434447288513...
func (r *GrafanaDashboardReconciler) SetupWithManager(mgr ctrl.Manager, ctx context.Context) error { err := ctrl.NewControllerManagedBy(mgr). For(&v1beta1.GrafanaDashboard{}). Complete(r) if err == nil { d, err := time.ParseDuration(initialSyncDelay) if err != nil { return err } go func() { for { ...
[ 0.3090590536594391, 1.0245915651321411, 1.0115326642990112, 0.15171922743320465, 0.1080041453242302, -1.0414435863494873, 0.7233000993728638, -0.4940202236175537, -0.3983893394470215, -0.40215709805488586, 0.31641721725463867, -0.6532427072525024, 0.35714131593704224, 0.8808196187019348, ...
func IsUUID(str string) bool { return rxUUID.MatchString(str) }
[ -0.13808155059814453, -0.903473973274231, 0.5118971467018127, 0.20898893475532532, -0.5728426575660706, 0.24308593571186066, -0.5727127194404602, 0.6411518454551697, 1.1334341764450073, -0.17928636074066162, -0.1537379026412964, 0.3824140429496765, -1.3757256269454956, -0.84767746925354, ...
func GetClusterId() string { return axClusterId }
[ 1.0598820447921753, -0.4318758547306061, 0.2698211073875427, 0.06329669803380966, 0.23219034075737, 0.725562334060669, 0.6982932686805725, 0.03928952291607857, 0.4200425148010254, -0.07080362737178802, 0.5768706798553467, 1.7416338920593262, -0.8969881534576416, -0.15060748159885406, 1.1...
func Command(cli *cli.SensuCli) *cobra.Command { cmd := &cobra.Command{ Use: "describe-type [RESOURCE TYPE],[RESOURCE TYPE]...", Short: "Print details about the supported API resources types", Long: description, RunE: execute(cli), } format := cli.Config.Format() _ = cmd.Flags().StringP("format", "", f...
[ 0.3765415549278259, -0.1035698875784874, 0.5950478911399841, -0.9744805693626404, 0.7338062524795532, 0.759423017501831, -0.26155000925064087, 0.05831315740942955, 0.16218432784080505, -0.7316010594367981, 0.6318446397781372, 0.8899739980697632, -0.09621530771255493, 0.5106492638587952, ...
func isNamespaced(r corev3.Resource) bool { gr, ok := r.(corev3.GlobalResource) if !ok { return true } return !gr.IsGlobalResource() }
[ 0.20643022656440735, -0.12708158791065216, 0.4043031334877014, -0.2264840453863144, -0.45137056708335876, 1.0379416942596436, 0.3332505524158478, -0.21589690446853638, 0.9646482467651367, 0.9431303143501282, -0.5796521902084351, 0.6330562829971313, -1.1463679075241089, 1.523292064666748, ...
func SelfPath() string { path, _ := filepath.Abs(os.Args[0]) return path }
[ -0.1876710057258606, -1.061011552810669, 0.7692117094993591, 0.33046987652778625, -0.12833911180496216, 0.6077437400817871, 1.5336198806762695, -0.503677487373352, -0.9487285017967224, -0.049558162689208984, 0.2710466682910919, 0.05346835404634476, -0.13912248611450195, 0.8411403894424438,...
func SelfDir() string { return filepath.Dir(SelfPath()) }
[ 0.12858791649341583, -1.2475700378417969, 0.49757590889930725, 0.4980961084365845, -1.374186396598816, 0.40364575386047363, 1.3291369676589966, -0.123544842004776, 0.010663940571248531, -1.5825278759002686, 0.4406619369983673, 0.46775493025779724, 0.19207820296287537, 0.729202389717102, ...
func NewMockTime(ctrl *gomock.Controller) *MockTime { mock := &MockTime{ctrl: ctrl} mock.recorder = &MockTimeMockRecorder{mock} return mock }
[ -0.40979281067848206, 0.2146528959274292, 0.510612964630127, 0.5303835868835449, 0.697041392326355, -0.29241305589675903, -0.2340104728937149, -0.4392552971839905, 0.2926255464553833, 0.6855190992355347, -0.9628814458847046, -0.9663764238357544, -0.6004425883293152, 1.58488929271698, 0.3...
func (m *MockTime) EXPECT() *MockTimeMockRecorder { return m.recorder }
[ -0.40833529829978943, 0.2098163217306137, 0.3932405710220337, 0.4341704547405243, 0.08504974842071533, 0.33336010575294495, -0.21887534856796265, -0.15358765423297882, 0.16228151321411133, 0.16759811341762543, 0.32082775235176086, 0.09306321293115616, -0.952157199382782, 1.30455482006073, ...
func (m *MockTime) Now() time.Time { m.ctrl.T.Helper() ret := m.ctrl.Call(m, "Now") ret0, _ := ret[0].(time.Time) return ret0 }
[ -0.9052889347076416, -0.42399320006370544, 0.4427902400493622, 0.8285911679267883, 1.2048869132995605, 0.589165449142456, 0.4968736469745636, 0.10649608075618744, -1.2816461324691772, 0.014599286019802094, -1.098902702331543, -0.5867891311645508, -0.43103137612342834, 1.4892889261245728, ...
func (mr *MockTimeMockRecorder) Now() *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Now", reflect.TypeOf((*MockTime)(nil).Now)) }
[ -0.5412008166313171, 0.024017205461859703, 0.2731188237667084, 0.5212969183921814, 0.17991018295288086, 0.25231775641441345, -0.4175453186035156, -0.7840527892112732, -0.1277625858783722, 0.41751304268836975, -0.0833284854888916, 0.38078972697257996, -0.4666481018066406, 1.7363433837890625...
func RolesGetAll() []models.Role { var r []models.Role bootstrap.Db().Find(&r) return r }
[ 0.8826198577880859, -0.08447660505771637, 0.39686504006385803, 0.18250949680805206, 1.023209571838379, 0.05821862444281578, -1.03276526927948, -0.05043024942278862, 0.026389576494693756, 0.10838677734136581, 0.4663969576358795, 0.38059201836586, -0.438529908657074, 0.9309084415435791, -0...
func RoleCreate(r *models.Role) error { if r == nil { log.Error(r) } if r.Name != "" { // Check if role already exists var count uint bootstrap.Db().Where("name = ?", r.Name).Find(&models.Role{}).Count(&count) if count == 0 { err := bootstrap.Db().Create(&r).Error if err != nil { return errors....
[ 0.022617457434535027, 0.5332951545715332, 0.8017406463623047, 0.5540575981140137, 0.7368365526199341, 0.2845456898212433, -0.3204009234905243, -0.33356156945228577, -0.08274706453084946, 0.681288480758667, 0.19176718592643738, -1.3519388437271118, -0.5763819217681885, 0.6019902229309082, ...
func RoleGetByID(id int) *models.Role { var role models.Role bootstrap.Db().First(&role, id) return &role }
[ 0.8061972260475159, -0.10383987426757812, 0.054636504501104355, -0.45290452241897583, 0.5022337436676025, -0.6995567083358765, -0.42578643560409546, -0.5086396336555481, -0.06951599568128586, 0.060428619384765625, 0.23462489247322083, -0.20290158689022064, -0.63583904504776, 0.310197681188...
func RoleUpdate(r *models.Role) error { if r.Name != "" { // Check if name already exists var count uint bootstrap.Db().Where("name = ? AND id <> ?", r.Name, r.ID).Find(&models.Role{}).Count(&count) if count == 0 { err := bootstrap.Db().Save(r).Error if err != nil { return errors.New(err.Error()) ...
[ -0.44925594329833984, -0.491833359003067, 0.9813339710235596, -0.23076091706752777, 0.10849650204181671, 0.16591034829616547, -0.5631430745124817, 0.08397475630044937, 0.15025301277637482, 1.3596621751785278, -0.1719001680612564, -1.0061055421829224, -1.0203651189804077, 0.1787387728691101...
func RoleDelete(r *models.Role) error { err := bootstrap.Db().Delete(&r).Error if err != nil { return errors.New(err.Error()) } return nil }
[ 0.49291595816612244, 0.1343197375535965, 0.42457839846611023, 0.7842738032341003, 1.314026951789856, -0.16245074570178986, -0.24725885689258575, 0.06541624665260315, -0.015302661806344986, 1.0216020345687866, 0.28105711936950684, -0.7950699925422668, -0.7226554155349731, 0.6300572156906128...
func (l *Librus) GetSchoolInfo() (*School, error) { res, err := l.GetData("Schools") if err != nil { return nil, err } defer res.Body.Close() // get school response schoolResponse := new(SchoolResponse) if err := json.NewDecoder(res.Body).Decode(schoolResponse); err != nil { return nil, err } return scho...
[ -0.4042704105377197, -0.3164246380329132, 0.34015893936157227, 0.019838031381368637, 0.34588947892189026, -0.46851950883865356, 0.1372680366039276, -0.8898859024047852, 0.055526405572891235, -0.19315236806869507, -0.7444877624511719, 0.9845638871192932, -0.7075247168540955, -0.270397067070...
func (h *PivnetRCReadWriter) ReadFromFile() ([]byte, error) { _, err := os.Stat(h.configFilepath) if err != nil { if os.IsNotExist(err) { return nil, nil } return nil, err } pivnetRCBytes, err := ioutil.ReadFile(h.configFilepath) if err != nil { return nil, err } return pivnetRCBytes, nil }
[ -0.6083669066429138, -0.13240541517734528, 0.2207646518945694, -0.8174633383750916, 0.3548823297023773, -0.13322153687477112, -0.45869940519332886, 0.028394898399710655, -1.2705203294754028, 0.7938089370727539, -0.013355088420212269, -0.8321141600608826, -1.2097861766815186, 0.234085381031...
func NewService() (service.Service, error) { return &Service{}, nil }
[ 0.33247092366218567, -0.8243609666824341, -0.10513072460889816, 0.7952714562416077, -0.5058991312980652, -0.46866676211357117, -0.3617970943450928, -1.256469488143921, 0.07972624152898788, -0.8523585796356201, -0.25274500250816345, 1.041121244430542, -0.569432258605957, 0.5471765995025635,...
func (s Service) Register(r *grpc.Server) { server := &Server{} nb.RegisterC1InterfaceServiceServer(r, server) }
[ -0.9564366936683655, 0.6930729746818542, 0.35111895203590393, 0.2758151590824127, 1.0809143781661987, 0.8527270555496216, 0.8471583724021912, -0.47987446188926697, -0.5873138308525085, -0.24553640186786652, -0.8525093197822571, 0.6054099798202515, -1.8307026624679565, 1.1989283561706543, ...
func (s Server) ListStations(req *nb.StationListRequest, stream nb.C1InterfaceService_ListStationsServer) error { if req.Subscribe { return fmt.Errorf("subscribe not yet implemented") } if req.Ecgi == nil { ch := make(chan sb.ControlUpdate) if req.Subscribe { if err := manager.GetManager().SubscribeControl...
[ -0.9349760413169861, -0.12649506330490112, 0.7842481136322021, -0.028494806960225105, 0.18784773349761963, -0.1032664030790329, 0.24101918935775757, -0.5523806810379028, -0.06585324555635452, 0.2633814513683319, -0.2998659908771515, -0.023176034912467003, -0.6402671337127686, 1.10921025276...
func (s Server) ListStationLinks(req *nb.StationLinkListRequest, stream nb.C1InterfaceService_ListStationLinksServer) error { if req.Ecgi == nil { ch := make(chan sb.ControlUpdate) if req.Subscribe { if err := manager.GetManager().SubscribeControlUpdates(ch); err != nil { return err } } else { if er...
[ -0.7830111384391785, -0.3330722749233246, 0.6248851418495178, 0.3118373155593872, -0.12706127762794495, 0.2992825508117676, 0.3888092637062073, 0.07921577244997025, -0.6961983442306519, 0.023153366521000862, -0.23776191473007202, 0.7387162446975708, -0.8899419903755188, 1.2058173418045044,...
func (s Server) ListUELinks(req *nb.UELinkListRequest, stream nb.C1InterfaceService_ListUELinksServer) error { if req.Ecgi == nil { ch := make(chan sb.TelemetryMessage) if req.Subscribe { if err := manager.GetManager().SubscribeTelemetry(ch); err != nil { return err } } else { if err := manager.GetM...
[ -0.04325549677014351, 0.10959108173847198, 0.6287832856178284, -1.022310495376587, 0.4570023715496063, -0.15912140905857086, -0.1648394912481308, 0.288313090801239, 0.05016877502202988, -0.17686595022678375, 0.5029218196868896, 0.4333634078502655, -0.21936820447444916, 1.6932939291000366, ...
func (s Server) TriggerHandOver(ctx context.Context, req *nb.HandOverRequest) (*nb.HandOverResponse, error) { if req != nil { src := req.GetSrcStation() dst := req.GetDstStation() crnti := req.GetCrnti() srcEcgi := sb.ECGI{ Ecid: src.GetEcid(), PlmnId: src.GetPlmnid(), } dstEcgi := sb.ECGI{ Ec...
[ -0.28248685598373413, 0.13591189682483673, 0.9178861975669861, 0.15446123480796814, 0.26386329531669617, 0.3645480275154114, 0.6454751491546631, 0.2753223478794098, 0.33572015166282654, -0.32785114645957947, -0.33623868227005005, -0.3897689878940582, -0.4607960283756256, 0.2610961198806762...
func (s Server) SetRadioPower(ctx context.Context, req *nb.RadioPowerRequest) (*nb.RadioPowerResponse, error) { if req != nil { offset := req.GetOffset() var pa []sb.XICICPA switch offset { case nb.StationPowerOffset_PA_DB_0: pa = append(pa, sb.XICICPA_XICIC_PA_DB_0) case nb.StationPowerOffset_PA_DB_1: ...
[ -0.5714168548583984, -0.22082579135894775, 0.7756116986274719, -0.37540242075920105, 0.14358608424663544, 0.2233576774597168, 0.22958000004291534, -0.5360530018806458, 0.0712452307343483, -0.14016710221767426, -0.37958046793937683, -0.1632348597049713, -1.1904600858688354, -0.0404607914388...
func HandleStatusCode(res *http.Response, err error) (*http.Response, error) { if err != nil || (res.StatusCode >= 200 && res.StatusCode < 300) { return res, err } var sb strings.Builder fmt.Fprintln(&sb, "http error with status code:", res.StatusCode) if err = printPayload(res, &sb); err != nil { return res, ...
[ 0.46792709827423096, -0.6510403752326965, 0.4428352117538452, 0.13193312287330627, -0.2440142035484314, -0.4864843785762787, -0.2936803698539734, -0.323469340801239, 0.9430527687072754, -0.1716139316558838, 0.19552432000637054, -0.3357202112674713, 0.3397267460823059, -0.3047889471054077, ...
func (p *Pvr) GetDockerImageRepoDigest(image registry.Image, auth types.AuthConfig) (string, error) { r, err := p.GetDockerRegistry(image, auth) if err != nil { return "", err } repoDigest, err := r.Digest(context.Background(), image) if err != nil { return "", err } return string(repoDigest), nil }
[ -1.2754943370819092, 0.4148460030555725, 0.6869732141494751, -0.8322558999061584, -0.2027568221092224, -0.4493497312068939, -0.37089306116104126, -0.10191568732261658, 0.17544586956501007, 0.22823692858219147, -0.07926618307828903, 0.05812141299247742, -0.745451033115387, 0.140103787183761...
func DownloadLayersFromLocalDocker(digest string) (io.ReadCloser, error) { ctx := context.Background() cli, err := client.NewClientWithOpts(client.FromEnv) if err != nil { return nil, err } cli.NegotiateAPIVersion(ctx) httpClient := cli.HTTPClient() url := "http://v" + cli.ClientVersion() + "/images/" + diges...
[ -0.1772821545600891, -0.41092661023139954, 0.8122920989990234, -0.8120337128639221, -0.5420408844947815, -0.3455105423927307, -0.5106908082962036, -0.8887243270874023, 0.04585062339901924, 0.1904575228691101, 0.06529855728149414, 0.5442128777503967, -0.5717008709907532, 1.5269955396652222,...
func (p *Pvr) FindDockerImage(app *AppData) (err error) { app.LocalImage.Exists = false app.RemoteImage.Exists = false sourceOrder := strings.Split(app.Source, ",") for _, source := range sourceOrder { switch source { case "local": err = LoadLocalImage(app) if app.LocalImage.Exists { return nil } ...
[ -0.5279105305671692, -0.39574959874153137, 0.6391773819923401, -0.23452000319957733, -0.1513907015323639, -0.10896444320678711, -0.0750533789396286, -0.16277842223644257, -0.5570904016494751, 0.7852995991706848, 0.5873852968215942, -0.3333437740802765, -0.10384722799062729, 1.7723306417465...
func (p *Pvr) LoadRemoteImage(app *AppData) error { var dockerManifest *schema2.Manifest app.RemoteImage = DockerImage{ Exists: false, } image, err := registry.ParseImage(app.From) if err != nil { return err } auth, err := p.AuthConfig(app.Username, app.Password, image.Domain) if err != nil { return err...
[ -0.2661456763744354, -0.0905575081706047, 0.9190163016319275, 0.4578969478607178, -0.5183533430099487, 0.4668791890144348, -0.3264665901660919, 0.69302898645401, 0.32652026414871216, 0.8668317794799805, 0.17540423572063446, 0.6806818246841431, -0.24762655794620514, 0.9069810509681702, 0....
func LoadLocalImage(app *AppData) error { app.LocalImage = DockerImage{ Exists: false, } ctx := context.Background() cli, err := client.NewClientWithOpts(client.FromEnv) cli.NegotiateAPIVersion(ctx) defer cli.Close() if err != nil { return err } inspect, _, err := cli.ImageInspectWithRaw(ctx, app.From) if...
[ 0.3273526132106781, -0.31538495421409607, 0.8240180015563965, -0.6085416078567505, 0.03494623675942421, 0.4511526823043823, -0.5810171365737915, 0.896853506565094, -0.3767601251602173, 1.022737741470337, 0.11973956972360611, 0.5154381394386292, 0.24666379392147064, 0.833869218826294, 0.7...
func ProcessWhiteouts(extractPath string, layerPath string, layerNumber int) error { whiteouts, err := FindWhiteoutsFromLayer(layerPath) if err != nil { return err } if len(whiteouts) == 0 { return nil } PrintDebugf("Processing Whiteouts from layer %d:%s\n", layerNumber, layerPath) for _, whiteoutFile := ran...
[ 0.1966506540775299, -0.505777895450592, 0.9247300028800964, -0.6813622117042542, 0.2123277336359024, -0.15485061705112457, 1.0707753896713257, -0.15510249137878418, 0.3459777235984802, 0.759465754032135, 0.9922550320625305, 0.10640285909175873, -0.5173982977867126, 1.121092677116394, 0.5...
func FindWhiteoutsFromLayer(layerPath string) ([]string, error) { whiteoutPaths := []string{} tarFile, err := os.Open(layerPath) if err != nil { return whiteoutPaths, err } contentType, err := GetFileContentType(layerPath) if err != nil { return whiteoutPaths, err } tr := tar.NewReader(tarFile) if conten...
[ 0.5752500891685486, -0.6212008595466614, 0.7944482564926147, -0.521190345287323, -0.11419815570116043, 0.1743442267179489, 0.6859261989593506, -0.6571752429008484, 0.000020103219867451116, 0.9776398539543152, 0.009137149900197983, 0.01797664351761341, -0.5246254801750183, 1.722314357757568...
func IsFileExists(filePath string) (bool, error) { //Check if file exists in cache _, err := os.Stat(filePath) if os.IsNotExist(err) { return false, nil } else if err != nil { return false, err } return true, nil }
[ -0.5930882096290588, -0.1377534121274948, 0.529401421546936, -0.38852113485336304, 1.3464431762695312, 1.0168721675872803, -0.5287391543388367, 0.24339179694652557, 0.29476186633110046, 0.5845277309417725, -0.4195205271244049, -0.38170894980430603, -0.01953917369246483, 0.39069613814353943...
func ParseRate(rateStr string) (Rate, error) { var n int n, err := strconv.Atoi(rateStr) if err == nil && n >= 0 { return Rate(n), nil } if n < 0 { return 0, fmt.Errorf("not a valid rate string: %d, only non-negative values are supported", n) } matches := rateRE.FindStringSubmatch(rateStr) if len(matches)...
[ -0.018552958965301514, -0.650571882724762, 0.7407847046852112, 0.505240261554718, -0.8842102885246277, -0.027703149244189262, -0.31072157621383667, 0.04419388622045517, -0.39677414298057556, -0.5516780018806458, 0.7568593621253967, -0.16973154246807098, -1.4450664520263672, -0.239322111010...
func (d Rate) String() string { var ( n = int64(d) symbol = "B" unit = B ) if n == 0 { return "0B" } switch int64(0) { case n % int64(GB): symbol = "GB" unit = GB case n % int64(MB): symbol = "MB" unit = MB case n % int64(KB): symbol = "KB" unit = KB } return fmt.Sprintf("%v%v", n/...
[ -0.5044524669647217, 0.500878632068634, 0.4212798774242401, -0.7848097085952759, -0.11468978226184845, 0.35888880491256714, -0.0425695963203907, -1.0996599197387695, -0.4228554964065552, 0.28916656970977783, 0.8815231323242188, 0.06161198765039444, -0.7394528985023499, -0.44915980100631714...
func (d Rate) MarshalYAML() (interface{}, error) { return d.String(), nil }
[ 1.1807124614715576, 0.5122065544128418, 0.14692561328411102, -0.46770158410072327, -0.46211978793144226, 0.30881932377815247, -0.3070177435874939, 0.053081706166267395, 0.8000383973121643, 0.14105573296546936, 0.3065432906150818, 0.6254668831825256, 0.2475830316543579, -0.4775373637676239,...
func (d *Rate) UnmarshalYAML(unmarshal func(interface{}) error) error { var s string if err := unmarshal(&s); err != nil { return err } rate, err := ParseRate(s) if err != nil { return err } *d = rate return nil }
[ 0.6145991086959839, 1.1833006143569946, 0.574325442314148, -0.9398788213729858, -0.2908215820789337, -1.1550111770629883, -0.15981338918209076, 0.23324941098690033, 0.4052960276603699, 0.559438169002533, 0.4760209321975708, 0.2304585576057434, -0.1403772383928299, -0.11229456961154938, -...
func (d Rate) MarshalJSON() ([]byte, error) { return json.Marshal(d.String()) }
[ 0.23582607507705688, 0.6623170375823975, 0.1473589539527893, -1.0276179313659668, -0.565234899520874, -0.31558412313461304, -1.0573534965515137, -0.19465626776218414, 0.5282396674156189, 0.23442915081977844, -0.22282636165618896, 0.9740238189697266, -0.5287341475486755, 0.07427775859832764...
func (d *Rate) UnmarshalJSON(b []byte) error { str, _ := strconv.Unquote(string(b)) rate, err := ParseRate(str) if err != nil { return err } *d = rate return nil }
[ -0.004054150078445673, 0.6995677351951599, 0.36714038252830505, -1.7291202545166016, -0.4562748074531555, -0.6326385736465454, -0.6084429025650024, -0.21312399208545685, 0.04169249162077904, 0.6731981635093689, -0.019605565816164017, 0.07314766943454742, -1.158627986907959, -0.049864050000...
func NewAccessList(ethAccessList *ethtypes.AccessList) AccessList { if ethAccessList == nil { return nil } al := AccessList{} for _, tuple := range *ethAccessList { storageKeys := make([]string, len(tuple.StorageKeys)) for i := range tuple.StorageKeys { storageKeys[i] = tuple.StorageKeys[i].String() } ...
[ -0.9366611838340759, -0.4124588966369629, 0.5069288611412048, 0.07555260509252548, -0.758787214756012, -0.43088340759277344, -0.17226828634738922, 0.007957867346704006, 0.4984187185764313, 1.1192567348480225, -0.07632992416620255, -0.8083637952804565, 0.5740113258361816, 0.3655565679073334...
func (al AccessList) ToEthAccessList() *ethtypes.AccessList { var ethAccessList ethtypes.AccessList for _, tuple := range al { storageKeys := make([]common.Hash, len(tuple.StorageKeys)) for i := range tuple.StorageKeys { storageKeys[i] = common.HexToHash(tuple.StorageKeys[i]) } ethAccessList = append(et...
[ -0.6443109512329102, 0.13761822879314423, 0.6859721541404724, -0.17570903897285461, 0.19658711552619934, 0.06485024839639664, 0.0502333901822567, 0.11670222878456116, 0.47208818793296814, 1.4329750537872314, -0.040459685027599335, -0.36631229519844055, 1.3221781253814697, 0.274520903825759...
func GetAllProducts(w http.ResponseWriter, r *http.Request) { p, err := dynamodbservice.Items.GetAll() w.Header().Add("Content-Type", "application/json") if err != nil { http.Error(w, err.Error(), http.StatusInternalServerError) return } w.WriteHeader(http.StatusOK) json.NewEncod...
[ -1.027342677116394, -0.39402762055397034, 1.0662858486175537, 0.766524076461792, -0.10487231612205505, 0.4812793731689453, -0.2303134649991989, -0.14810492098331451, 0.08751610666513443, 0.1246391087770462, -0.4284886121749878, 0.5434250831604004, 0.12983809411525726, 0.22379785776138306, ...
func CreateProduct(w http.ResponseWriter, r *http.Request) { var p dynamodbservice.Product w.Header().Add("Content-Type", "application/json") if err := json.NewDecoder(r.Body).Decode(&p); err != nil { http.Error(w, err.Error(), http.StatusBadRequest) return } defer r.Body.Close() ...
[ -1.0970064401626587, -0.09731747210025787, 0.6062728762626648, 0.3276197910308838, 0.6803282499313354, 0.9286995530128479, -0.2671624422073364, -0.5765042304992676, 0.27638375759124756, 0.2518686354160309, -0.11179333925247192, -0.3941720724105835, -0.33868610858917236, -0.3237285912036896...
func NewDBus() (*DBus, error) { bus, err := dbus.SystemBus() if err != nil { log.Printf("Failed to access system dbus: %v", err) return nil, err } return &DBus{bus}, nil }
[ -0.5549980401992798, -0.32576367259025574, 0.18545375764369965, -0.013248712755739689, -0.609203040599823, -0.38195255398750305, -0.3347310721874237, -0.33677446842193604, 0.6668893098831177, -1.101745367050171, -0.08945529907941818, 0.9961106777191162, -1.0131471157073975, 0.3197815716266...
func CreateTopics(ctx context.Context, admin *kafka.AdminClient, details KafkaBroker) { // create topic configs topicConfigs := buildTopicConfig(details) results, _ := admin.CreateTopics(ctx, topicConfigs) fmt.Println("result topic creation", results) failedTopics := make(map[string]bool) for _, res := range r...
[ 0.36072084307670593, 0.3298848867416382, 0.5096285939216614, 0.345549613237381, 0.6490297913551331, 0.3896981477737427, 0.2901431620121002, -0.2604086101055145, -0.25485438108444214, 0.38180190324783325, 0.31532275676727295, -0.6687549352645874, -0.29753613471984863, 0.8627994656562805, ...
func (r *Resolver) Channel(args struct{ ID string }) (*channels.ChannelResolver, error) { return channels.GetChannel(args) }
[ -0.9695420265197754, -0.09820881485939026, -0.07747475802898407, -0.2940044403076172, 0.9679034352302551, 0.04298949986696243, -0.014921057969331741, -0.1059209406375885, -0.05604198947548866, -1.08246910572052, 0.2522999942302704, 1.1941556930541992, -0.19110415875911713, -0.1116229966282...
func GetCache(cacheFile string) MemCache { var ( mem memCacheDisk err error ) b, err := ioutil.ReadFile(cacheFile) if err == nil { err = json.Unmarshal(b, &mem) if err == nil && mem.ShardNo == shardNo { return mem.Cache } } m := make(MemCache, shardNo) for i := 0; i < shardNo; i++ { m[i] = &Temp...
[ 0.31442227959632874, 0.19488230347633362, 0.8420777320861816, 0.4039059579372406, -0.3896912634372711, -0.30791616439819336, 0.3419145345687866, 0.01692291349172592, -0.1486593782901764, -0.20284005999565125, 0.051787592470645905, 0.018638817593455315, -0.5884852409362793, 0.00119883741717...
func (m MemCache) allSetIds() []int { num := 0 for _, shard := range m { num += len(shard.Templates) } result := make([]int, 0, num) for _, shard := range m { shard.RLock() for _, set := range shard.Templates { result = append(result, int(set.Template.TemplateID)) } shard.RUnlock() } sort.Ints(resul...
[ 0.035610560327768326, -0.3863505423069, 0.9095519185066223, 0.17834681272506714, -0.942028284072876, -0.3836880028247833, 0.049489229917526245, -0.1297890692949295, 0.8614684343338013, 0.10579455643892288, -0.31868642568588257, 0.5346859097480774, -0.6503655314445496, 1.0953320264816284, ...
func (m MemCache) Dump(cacheFile string) error { b, err := json.Marshal( memCacheDisk{ m, shardNo, }, ) if err != nil { return err } err = ioutil.WriteFile(cacheFile, b, 0644) if err != nil { return err } return nil }
[ -0.3403695523738861, 0.5528092384338379, 0.5420743823051453, -0.6115612387657166, 0.02591477520763874, 0.7132060527801514, 0.3913435935974121, 0.19112539291381836, -0.5244128704071045, -0.3546587824821472, -0.466084748506546, -0.14531280100345612, -0.47538304328918457, 0.9151408076286316, ...
func NewMockAccount(ctrl *gomock.Controller) *MockAccount { mock := &MockAccount{ctrl: ctrl} mock.recorder = &MockAccountMockRecorder{mock} return mock }
[ 0.38559624552726746, -0.20310285687446594, 0.13463595509529114, 0.8780260682106018, 0.5910757184028625, -0.20800641179084778, 1.5857903957366943, -0.09660083800554276, 1.0891224145889282, 0.1638651043176651, -0.6666529774665833, 0.6441824436187744, -0.16341768205165863, 0.6534082889556885,...
func (m *MockAccount) EXPECT() *MockAccountMockRecorder { return m.recorder }
[ 0.5890375375747681, -0.013258814811706543, 0.1721348762512207, 0.25159719586372375, 0.018741047009825706, -0.08787724375724792, 0.7712141275405884, 0.3960227966308594, 0.9844403862953186, -0.4407563805580139, 0.8221352696418762, 1.0106364488601685, -0.5443161129951477, -0.00413975818082690...
func (m *MockAccount) Authorize(arg0, arg1 string) (*models.User, error) { m.ctrl.T.Helper() ret := m.ctrl.Call(m, "Authorize", arg0, arg1) ret0, _ := ret[0].(*models.User) ret1, _ := ret[1].(error) return ret0, ret1 }
[ -0.9649558663368225, 0.25035005807876587, 0.2720023989677429, 0.9010310173034668, 0.9922649264335632, -0.20477630198001862, 1.0518381595611572, -0.1091010645031929, -1.0729572772979736, 0.5512208342552185, -0.05456779897212982, -0.2157726287841797, -0.724621057510376, 1.1059139966964722, ...
func (mr *MockAccountMockRecorder) Authorize(arg0, arg1 interface{}) *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Authorize", reflect.TypeOf((*MockAccount)(nil).Authorize), arg0, arg1) }
[ -0.30240359902381897, 0.9740945100784302, 0.36646950244903564, 0.5721772313117981, 0.3458065390586853, -0.18759213387966156, 0.08247534930706024, -0.7651986479759216, 0.4102926552295685, 1.1466784477233887, 0.9786015748977661, 0.8932632207870483, -1.1747374534606934, 1.507480263710022, 0...
func (m *MockAccount) CreateMessage(arg0 models.User, arg1, arg2 string) (*models.ChatMessage, error) { m.ctrl.T.Helper() ret := m.ctrl.Call(m, "CreateMessage", arg0, arg1, arg2) ret0, _ := ret[0].(*models.ChatMessage) ret1, _ := ret[1].(error) return ret0, ret1 }
[ -0.7929308414459229, -0.25613799691200256, 0.18010878562927246, 0.15249791741371155, 1.3543801307678223, 0.12310437113046646, 0.42632055282592773, -0.565333902835846, -0.888253927230835, 0.3081355094909668, -0.42186829447746277, -1.1468021869659424, -1.0215201377868652, 1.9754340648651123,...
func (mr *MockAccountMockRecorder) CreateMessage(arg0, arg1, arg2 interface{}) *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "CreateMessage", reflect.TypeOf((*MockAccount)(nil).CreateMessage), arg0, arg1, arg2) }
[ -0.30188894271850586, 0.4934045970439911, 0.20537526905536652, -0.06192159652709961, 0.7048095464706421, 0.32067105174064636, -0.6790518164634705, -1.324221134185791, 0.21938654780387878, 0.5874274969100952, 0.7164275050163269, 0.06882316619157791, -1.145618200302124, 1.7983620166778564, ...
func (m *MockAccount) GetChatHistory(arg0 models.User) ([]models.ChatMessage, error) { m.ctrl.T.Helper() ret := m.ctrl.Call(m, "GetChatHistory", arg0) ret0, _ := ret[0].([]models.ChatMessage) ret1, _ := ret[1].(error) return ret0, ret1 }
[ -0.03595560044050217, -0.6177685856819153, 0.22075387835502625, 0.8862406611442566, 1.2566529512405396, -0.2044464498758316, 0.8682934641838074, -0.8328271508216858, -1.4406449794769287, -0.5212826728820801, -1.4119532108306885, -0.16140934824943542, -0.5054244995117188, 1.136599063873291,...
func (mr *MockAccountMockRecorder) GetChatHistory(arg0 interface{}) *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GetChatHistory", reflect.TypeOf((*MockAccount)(nil).GetChatHistory), arg0) }
[ 0.518612802028656, 0.08351420611143112, 0.18882714211940765, 0.43350130319595337, 0.4812116026878357, -0.11146806180477142, -0.22067342698574066, -1.1876380443572998, 0.05605591833591461, 0.3940852880477905, -0.33829203248023987, 0.944739043712616, -0.3702189028263092, 1.07860267162323, ...
func (m *MockAccount) Register(arg0, arg1 string) (*models.User, error) { m.ctrl.T.Helper() ret := m.ctrl.Call(m, "Register", arg0, arg1) ret0, _ := ret[0].(*models.User) ret1, _ := ret[1].(error) return ret0, ret1 }
[ -1.1636277437210083, 0.6563284993171692, 0.1894986927509308, 0.759278416633606, 1.0003304481506348, -0.12389291822910309, 0.8597522974014282, 0.027149390429258347, -1.4577168226242065, -0.34790846705436707, -0.6910239458084106, -0.2384561449289322, -0.43036219477653503, 0.9219726324081421,...
func (mr *MockAccountMockRecorder) Register(arg0, arg1 interface{}) *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Register", reflect.TypeOf((*MockAccount)(nil).Register), arg0, arg1) }
[ -0.7426220774650574, 1.1691222190856934, 0.24809733033180237, 0.5193142294883728, 0.35464316606521606, -0.2742611765861511, -0.24074091017246246, -0.5989488363265991, -0.04352392256259918, 0.12131399661302567, 0.3753642737865448, 1.023267388343811, -0.7377822399139404, 1.7005406618118286, ...
func (m *MockAccount) ValidateToken(arg0 string) (*models.User, error) { m.ctrl.T.Helper() ret := m.ctrl.Call(m, "ValidateToken", arg0) ret0, _ := ret[0].(*models.User) ret1, _ := ret[1].(error) return ret0, ret1 }
[ -0.8773213028907776, -0.4506731331348419, 0.08917605131864548, 0.24689403176307678, 0.9411357641220093, 0.31367167830467224, 1.275068759918213, -0.3528238832950592, -0.5754204988479614, -1.2653698921203613, -1.289398193359375, 0.1388491541147232, -0.1941591203212738, 1.2102901935577393, ...
func (mr *MockAccountMockRecorder) ValidateToken(arg0 interface{}) *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "ValidateToken", reflect.TypeOf((*MockAccount)(nil).ValidateToken), arg0) }
[ -0.13994278013706207, 0.4283175766468048, 0.16135762631893158, -0.07714220136404037, 0.3284375071525574, 0.1863643079996109, 0.0629199892282486, -0.40708741545677185, 0.7413115501403809, -0.5571182370185852, -0.18340055644512177, 1.0185308456420898, -0.4116513133049011, 1.3703666925430298,...