text
stringlengths
11
6.3k
embedding
listlengths
768
768
func (mx *Mux) MethodNotAllowedHandler() http.HandlerFunc { if mx.methodNotAllowedHandler != nil { return mx.methodNotAllowedHandler } return methodNotAllowedHandler }
[ 0.6752864718437195, -0.09265913814306259, 0.36669468879699707, 0.4222296178340912, -1.8977463245391846, 0.10632488876581192, 0.300193727016449, -0.7750328183174133, 0.6265215873718262, -0.2811519205570221, 1.117067813873291, 0.1900157630443573, -0.5557807087898254, -0.15733574330806732, ...
func methodNotAllowedHandler(w http.ResponseWriter, r *http.Request) { w.WriteHeader(405) if _, err := w.Write(nil); err != nil { panic(err) } }
[ 0.41151246428489685, 0.036532193422317505, 0.4445330500602722, 0.05652935057878494, -0.9748374819755554, 0.3736479878425598, 0.6581022143363953, -0.7888527512550354, -0.13632425665855408, 0.5243832468986511, 1.025407314300537, -0.014338190667331219, -0.10378202050924301, 0.1463310569524765...
func (fn RegisterActivateHandlerFunc) Handle(params RegisterActivateParams) middleware.Responder { return fn(params) }
[ -0.12419559061527252, -0.36529555916786194, 0.16189420223236084, 0.6269214749336243, 0.4061160385608673, 0.05163087695837021, 0.7987425923347473, 0.2372218519449234, 0.1283450722694397, -0.07362841814756393, -0.3679911196231842, 0.2194506675004959, -0.5709342360496521, -0.3331962823867798,...
func NewRegisterActivate(ctx *middleware.Context, handler RegisterActivateHandler) *RegisterActivate { return &RegisterActivate{Context: ctx, Handler: handler} }
[ -0.5606738924980164, -0.435621052980423, 0.22479934990406036, 0.4848117232322693, -0.9708757400512695, -0.1755475550889969, -0.5883070230484009, -0.024404166266322136, 0.03172258287668228, 0.31966152787208557, -1.0520151853561401, 0.561913251876831, -1.0201491117477417, 0.17322660982608795...
func NewNodeUpdaterClient() NodeUpdaterClient { return &RpmOstreeClient{} }
[ -0.4508742094039917, -0.5286797285079956, 0.09655598551034927, -0.7898824214935303, -1.477126955986023, -1.1054776906967163, -0.4437949061393738, -0.007548005320131779, -1.0712436437606812, -0.09873746335506439, 0.13293525576591492, 0.07616084814071655, -0.7603039145469666, -0.005683097522...
func (r *RpmOstreeClient) getBootedDeployment(rootMount string) (*RpmOstreeDeployment, error) { var rosState RpmOstreeState output, err := RunGetOut("chroot", rootMount, "rpm-ostree", "status", "--json") if err != nil { return nil, err } if err := json.Unmarshal(output, &rosState); err != nil { return nil, fm...
[ -0.20872211456298828, -0.7866172790527344, 0.6445978283882141, 0.5722992420196533, -0.15367360413074493, -0.7026466727256775, -0.14052946865558624, -0.3729674816131592, -0.1829000562429428, -0.26290345191955566, 0.5485057830810547, 0.8256481885910034, -1.1355586051940918, 1.29328191280365,...
func (r *RpmOstreeClient) GetStatus() (string, error) { output, err := RunGetOut("rpm-ostree", "status") if err != nil { return "", err } return string(output), nil }
[ -0.014499610289931297, 0.2080727368593216, 0.474454790353775, 0.34684839844703674, -0.3229750394821167, -0.17258980870246887, -0.6893549561500549, -0.13947850465774536, -0.28179317712783813, 0.23904907703399658, -0.3650030493736267, 0.6072080731391907, -1.1536853313446045, 0.86453509330749...
func (r *RpmOstreeClient) GetBootedOSImageURL(rootMount string) (string, string, error) { bootedDeployment, err := r.getBootedDeployment(rootMount) if err != nil { return "", "", err } // the canonical image URL is stored in the custom origin field by the pivot tool osImageURL := "<not pivoted>" if len(bootedD...
[ -0.600671112537384, -0.6672569513320923, 0.48388582468032837, 0.39472031593322754, -0.24195939302444458, -0.38352784514427185, -0.20975075662136078, 0.22333188354969025, -0.7456942796707153, 0.8183224201202393, 0.38919615745544434, 0.6477782130241394, 0.085551917552948, 1.2371822595596313,...
func (r *RpmOstreeClient) RunPivot(osImageURL string) error { if err := os.MkdirAll(filepath.Dir(constants.EtcPivotFile), os.FileMode(0755)); err != nil { return fmt.Errorf("error creating leading dirs for %s: %v", constants.EtcPivotFile, err) } if err := ioutil.WriteFile(constants.EtcPivotFile, []byte(osImageURL...
[ -0.6189861297607422, -0.13786283135414124, 0.8879168629646301, -0.3393029272556305, -0.35796332359313965, 0.16734719276428223, 0.13782250881195068, -0.2427252233028412, -0.954775333404541, -0.03732539340853691, -0.05044616758823395, -0.43500804901123047, -0.9116742610931396, 0.359150499105...
func followPivotJournalLogs(stopCh <-chan time.Time) { reader, err := sdjournal.NewJournalReader( sdjournal.JournalReaderConfig{ Since: time.Duration(1) * time.Second, Matches: []sdjournal.Match{ { Field: sdjournal.SD_JOURNAL_FIELD_SYSTEMD_UNIT, Value: pivotUnit, }, { Field: sdjourna...
[ -0.052242834120988846, -0.34966662526130676, 0.7334519624710083, -0.737905740737915, -0.2800745666027069, -0.3161223232746124, -0.6455734372138977, -0.572252094745636, -0.04949857294559479, 0.18670274317264557, 0.2836712598800659, 0.037814196199178696, -0.11556734144687653, 1.1564816236495...
func ColorText(colorCode, text string) string { return colourText(colorCode, text) }
[ 0.34081774950027466, -0.6543033719062805, 0.22393517196178436, -0.1932683289051056, -0.49754899740219116, -0.3540913164615631, -1.5400971174240112, 0.1567666232585907, 1.0173364877700806, 0.9582276940345764, -0.09836980700492859, 0.6820304989814758, -0.8044138550758362, 0.28003057837486267...
func colourText(colorCode, text string) string { var coloredText string if len(colorCode) < 1 { return text // nothing to do } text = strings.Replace(text, "%", "%%", -1) switch colorCode[0] { // foreground case 'r': coloredText = Red(text).String() case 'g': coloredText = Green(text).String() case 'y...
[ 0.45159655809402466, -0.7307485938072205, 0.9131228923797607, -0.5638614892959595, -0.3033078908920288, -0.35084179043769836, -0.48938342928886414, -0.24470074474811554, 0.5585389137268066, 0.7126597166061401, -0.23945441842079163, 0.29128554463386536, -0.547828197479248, 0.321569979190826...
func readVInt(dis *bytes.Buffer, tagByte byte) (int, error) { b, err := dis.ReadByte() if err != nil { return 0, err } //fmt.Printf("Read VINT %x\n", b) var i uint i = uint(b) & 0x7F var shift uint for shift = 7; (b & 0x80) != 0; shift += 7 { b, err = dis.ReadByte() if err != nil { return 0, err } ...
[ -0.3560388386249542, -1.0711052417755127, 0.7985164523124695, -0.6449443101882935, -0.5165186524391174, 0.06389737129211426, 0.008115530014038086, -0.5840581655502319, -0.2541986107826233, 0.1073710098862648, -0.06814916431903839, 0.15859487652778625, -0.724189043045044, -0.237135201692581...
func readUtf8(dis *bytes.Buffer) error { return nil }
[ -0.32745274901390076, 0.13570670783519745, 0.07828400284051895, 0.1512160301208496, -0.1805681437253952, 0.4748188555240631, 0.7114095091819763, 0.4195074141025543, 0.06584066152572632, -0.21255426108837128, 0.36449548602104187, -0.29778578877449036, -0.03423259034752846, -0.67393344640731...
func NewSQLBuilder() *SQLBuilder { return &SQLBuilder{} }
[ 0.425152063369751, 0.17551372945308685, 0.2879036068916321, 0.9934622645378113, -1.5859348773956299, -0.23368148505687714, -1.401937484741211, -0.2792735993862152, 1.101409912109375, -1.317722201347351, -0.5136032104492188, -0.2687319219112396, -0.5375853180885315, 1.0683344602584839, 0....
func (sb *SQLBuilder) Select(cols ...string) *SQLBuilder { var buf strings.Builder for k, col := range cols { buf.WriteString(col) if k != len(cols)-1 { buf.WriteString(",") } } sb._select = buf.String() return sb }
[ 0.08352981507778168, 0.26356643438339233, 0.303600013256073, 0.06967238336801529, 0.09446290880441666, -0.4771443009376526, -0.5465795397758484, -0.7329727411270142, -0.023474296554923058, -0.796251118183136, -0.5412684679031372, 0.04373396560549736, 0.17851684987545013, -0.340424269437789...
func (sb *SQLBuilder) WhereRaw(s string, values ...interface{}) *SQLBuilder { return sb.whereRaw("AND", s, values) }
[ 0.4357800781726837, 0.4263640344142914, 0.40292397141456604, 0.4359135627746582, -2.0268208980560303, 0.3138604760169983, -0.1451648324728012, 0.33574867248535156, -0.04086725413799286, -1.4922059774398804, -0.1331261545419693, 0.5054963827133179, 1.0312069654464722, 0.015567135065793991, ...
func (sb *SQLBuilder) OrWhereRaw(s string, values ...interface{}) *SQLBuilder { return sb.whereRaw("OR", s, values) }
[ -0.050481103360652924, -0.08496628701686859, 0.4629574120044708, -0.107084259390831, -1.0839015245437622, -0.08770199120044708, -0.24458681046962738, 0.1506279855966568, 0.6170304417610168, -0.9335476160049438, 0.14125241339206696, -0.33535486459732056, 1.2981021404266357, -0.3651592433452...
func (sb *SQLBuilder) Where(field string, condition string, value interface{}) *SQLBuilder { return sb.where("AND", condition, field, value) }
[ 1.1086505651474, -0.21549031138420105, 0.23903176188468933, 0.32448187470436096, -1.6551090478897095, 0.45742636919021606, 0.48031625151634216, 0.5296050906181335, -0.5269051194190979, -0.8214210867881775, 0.1079544723033905, 0.6034213900566101, 0.3027738332748413, 0.2528649568557739, -0...
func (sb *SQLBuilder) OrWhere(field string, condition string, value interface{}) *SQLBuilder { return sb.where("OR", condition, field, value) }
[ 1.2603487968444824, -0.05287817865610123, 0.3198699951171875, 0.0925339087843895, -0.9404139518737793, 0.5289347171783447, 0.2829095125198364, 0.2849411368370056, -0.7353204488754272, -0.21689221262931824, 0.4049604833126068, -0.3415168225765228, 0.34543663263320923, -0.2058088481426239, ...
func (sb *SQLBuilder) WhereIn(field string, values ...interface{}) *SQLBuilder { return sb.whereIn("AND", "IN", field, values) }
[ 0.37208092212677, 0.26049333810806274, 0.44992339611053467, 0.055504605174064636, -1.1987955570220947, 0.8396079540252686, -0.15488633513450623, 0.6718704104423523, -0.7473134398460388, -1.1345853805541992, -0.3776548504829407, 0.7717058658599854, -0.2881195843219757, 0.536952555179596, ...
func (sb *SQLBuilder) OrWhereIn(field string, values ...interface{}) *SQLBuilder { return sb.whereIn("OR", "IN", field, values) }
[ 0.22043879330158234, -0.1149587631225586, 0.3792221248149872, -0.12857739627361298, -0.8831757307052612, 0.6697788238525391, 0.033298294991254807, 0.4580012261867523, -0.5544151067733765, -0.7823330760002136, 0.11863331496715546, 0.12325513362884521, -0.20752589404582977, -0.31719928979873...
func (sb *SQLBuilder) WhereNotIn(field string, values ...interface{}) *SQLBuilder { return sb.whereIn("AND", "NOT IN", field, values) }
[ 0.2875678837299347, -0.2123941332101822, 0.4572923481464386, 0.522742509841919, -0.8273866772651672, 1.1348137855529785, 0.178660586476326, 0.1496489942073822, -0.8545053005218506, -0.6689794659614563, 0.1055358275771141, 0.26301640272140503, -0.9450863599777222, -0.0037935220170766115, ...
func (sb *SQLBuilder) OrWhereNotIn(field string, values ...interface{}) *SQLBuilder { return sb.whereIn("OR", "NOT IN", field, values) }
[ -0.49394771456718445, -0.2924521565437317, 0.4058072566986084, -0.6866976022720337, -0.6011802554130554, 0.6700708270072937, -0.06669655442237854, 0.07762397825717926, -0.6398909687995911, -0.3675401508808136, 0.2883704900741577, -0.599358320236206, -0.5814685225486755, -0.3983992338180542...
func (sb *SQLBuilder) GroupBy(fields ...string) *SQLBuilder { var buf strings.Builder buf.WriteString("GROUP BY ") for k, field := range fields { buf.WriteString(field) if k != len(fields)-1 { buf.WriteString(",") } } sb._groupBy = buf.String() return sb }
[ 0.2520468533039093, 0.6829226613044739, 0.6509084701538086, 0.023457221686840057, 0.14872755110263824, 0.053901176899671555, 0.545050859451294, -0.0625591054558754, -1.0102049112319946, -0.5476204752922058, -0.012539593502879143, 0.16982769966125488, -0.7319958209991455, -0.135374039411544...
func (sb *SQLBuilder) HavingRaw(s string, values ...interface{}) *SQLBuilder { return sb.havingRaw("AND", s, values) }
[ 0.3497820794582367, 0.8641722202301025, 0.5121795535087585, 0.4828280806541443, -1.4292376041412354, 0.46262285113334656, -0.9240878224372864, 0.3814232349395752, 0.1508638709783554, -1.849856972694397, -0.15566928684711456, -0.20710238814353943, 1.1187849044799805, 0.698818564414978, -0...
func (sb *SQLBuilder) OrHavingRaw(s string, values ...interface{}) *SQLBuilder { return sb.havingRaw("OR", s, values) }
[ -0.10616863518953323, 0.5202799439430237, 0.4956519603729248, -0.05965259671211243, -0.9380728006362915, 0.47455960512161255, -1.0372580289840698, 0.19673359394073486, 0.1425289362668991, -1.501216173171997, 0.10903695225715637, -0.5624615550041199, 1.19940984249115, 0.30574458837509155, ...
func (sb *SQLBuilder) Having(field string, condition string, value interface{}) *SQLBuilder { return sb.having("AND", condition, field, value) }
[ 0.611926794052124, 0.016183700412511826, 0.24016067385673523, 0.5230464935302734, -1.0781322717666626, 0.7636674046516418, -0.4407369792461395, 0.4648273289203644, -0.3539265990257263, -0.5381013751029968, -0.06669458001852036, -0.01987987384200096, -0.08512238413095474, 0.608806312084198,...
func (sb *SQLBuilder) OrHaving(field string, condition string, value interface{}) *SQLBuilder { return sb.having("OR", condition, field, value) }
[ 0.06013121455907822, -0.16035136580467224, 0.3788720667362213, -0.004615859594196081, -0.9577797055244446, 0.8148328065872192, -0.5640484690666199, -0.07232244312763214, -0.19648900628089905, 0.016821300610899925, 0.22917571663856506, -0.3681860566139221, 0.06029055640101433, 0.15543620288...
func (sb *SQLBuilder) OrderBy(operator string, fields ...string) *SQLBuilder { var buf strings.Builder buf.WriteString("ORDER BY ") for k, field := range fields { buf.WriteString(field) if k != len(fields)-1 { buf.WriteString(",") } } buf.WriteString(" ") buf.WriteString(operator) sb._orderBy = bu...
[ 0.023580199107527733, 0.672764003276825, 0.7499779462814331, -0.06483274698257446, -0.4858218729496002, -0.23317201435565948, 0.2763025760650635, 0.11917627602815628, -1.0736017227172852, -0.6250016093254089, -0.1885806918144226, -0.547559380531311, -0.35123270750045776, -0.677444517612457...
func (sb *SQLBuilder) JoinRaw(join string, values ...interface{}) *SQLBuilder { var buf strings.Builder buf.WriteString(sb._join) if buf.Len() != 0 { buf.WriteString(" ") } buf.WriteString(join) sb._join = buf.String() for _, value := range values { sb._joinParams = append(sb._joinParams, value) } retu...
[ -0.08817345649003983, 0.6092288494110107, 0.8957529067993164, 0.4325072467327118, -0.9778058528900146, 0.8443067669868469, -0.8122875690460205, 0.08363503217697144, -0.3279404640197754, -1.347069263458252, 0.23631322383880615, 0.11535360664129257, -0.11554722487926483, 0.6736298203468323, ...
func Forbidden(messages ...string) Error { return createMessageError(http.StatusText(http.StatusForbidden), messages) }
[ 0.38007599115371704, 0.5355557203292847, 0.3990562856197357, 0.7539288401603699, 0.1413605809211731, 0.39535072445869446, -0.36769580841064453, -0.7482510805130005, -0.87485271692276, -0.43318063020706177, -0.07263216376304626, 0.47652971744537354, -0.35180675983428955, 0.4257385730743408,...
func (capi *CapiNozzle) Receive(data interface{}) error { // the attempt to write to dataChan may panic if dataChan has been closed defer func() { if r := recover(); r != nil { capi.Logger().Errorf("%v recovered from %v", capi.Id(), r) if capi.validateRunningState() == nil { // report error only when capi...
[ -0.8387107849121094, -0.47293853759765625, 0.8010271191596985, -0.17079953849315643, 0.48489367961883545, -0.5632811784744263, 0.4147639274597168, 0.08001544326543808, 0.18382830917835236, -0.09985039383172989, -0.4635927677154541, 0.6343284249305725, -0.3683887720108032, 0.288744062185287...
func (capi *CapiNozzle) batchGetMeta(vbno uint16, bigDoc_map base.McRequestMap) (map[string]bool, error) { if capi.Logger().GetLogLevel() >= log.LogLevelDebug { capi.Logger().Debugf("%v batchGetMeta called for vb %v and bigDoc_map with len %v, map=%v%v%v\n", capi.Id(), vbno, len(bigDoc_map), base.UdTagBegin, bigDoc_...
[ -0.5556765198707581, -0.7783534526824951, 1.098386287689209, 0.7938644886016846, 0.40166136622428894, -0.43789738416671753, 0.16735413670539856, 0.1488547921180725, -0.428570032119751, 0.6670230031013489, -0.2742552161216736, 1.166885256767273, -0.20368878543376923, 0.47665461897850037, ...
func (capi *CapiNozzle) batchUpdateDocsWithRetry(vbno uint16, req_list *[]*base.WrappedMCRequest) error { if len(*req_list) == 0 { return nil } num_of_retry := 0 backoffTime := capi.config.retryInterval for { err := capi.validateRunningState() if err != nil { return err } err = capi.batchUpdateDocs(...
[ -0.2594301402568817, -0.461615651845932, 0.587890625, 1.0990402698516846, 0.2695964574813843, -0.46189093589782715, -0.6464396119117737, -0.02350320667028427, 0.011496996507048607, 0.7074905633926392, -0.31422048807144165, 0.22945883870124817, -1.0059738159179688, -0.20364367961883545, -...
func (capi *CapiNozzle) writeToPartCh(part_ch chan []byte, fin_ch chan bool, data []byte) bool { for { select { case <-fin_ch: capi.Logger().Infof("%v received finish signal. Aborting writing to part ch", capi.Id()) return false case part_ch <- data: return true } } }
[ -0.5468177199363708, -0.5448763370513916, 0.5290993452072144, -0.05070396140217781, 0.5357057452201843, 0.8088000416755676, -0.03974803909659386, -0.4876621663570404, -0.7766024470329285, 0.1693374514579773, -0.5793973207473755, -0.2633446753025055, -1.1530311107635498, -0.4060845077037811...
func trimErrorMessage(err error) string { errMsg := err.Error() if len(errMsg) > MaxErrorMessageLength { errMsg = errMsg[:MaxErrorMessageLength] } return errMsg }
[ -0.8174896240234375, 0.8587813973426819, 0.5112422704696655, -0.4928363263607025, -0.18034270405769348, 0.2720245122909546, -0.6012017726898193, -0.5962383151054382, 0.6846861243247986, 0.7523748874664307, -0.24445568025112152, -0.6806029677391052, -0.47952213883399963, 0.1706424057483673,...
func getDocMap(req *mc.MCRequest, doc_map map[string]interface{}) { doc_map[BodyKey] = req.Body meta_map := doc_map[MetaKey].(map[string]interface{}) //TODO need to handle Key being non-UTF8? meta_map[IdKey] = string(req.Key) meta_map[RevKey] = getSerializedRevision(req) meta_map[ExpirationKey] = binary.BigEndia...
[ -1.0209581851959229, -0.42248132824897766, 0.9099401235580444, 0.17959147691726685, -0.25804126262664795, -0.33130794763565063, -0.473087340593338, 0.3664064109325409, 0.7188138365745544, 0.20580127835273743, 0.6524332165718079, 0.6948402523994446, -0.06942528486251831, 0.36059609055519104...
func getSerializedRevision(req *mc.MCRequest) string { var revId [16]byte // CAS copy(revId[0:8], req.Extras[16:24]) // expiration copy(revId[8:12], req.Extras[4:8]) // flags copy(revId[12:16], req.Extras[0:4]) revSeq := binary.BigEndian.Uint64(req.Extras[8:16]) revSeqStr := strconv.FormatUint(revSeq, 10) re...
[ -0.3434668779373169, -0.5376065373420715, 0.7138385772705078, -0.9718706011772156, -0.30627360939979553, -0.21176932752132416, -0.6567016839981079, 0.6031708121299744, 0.7270475625991821, -0.1599801927804947, -0.1289944350719452, 1.0504816770553589, 0.016996268182992935, -0.700337886810302...
func (capi *CapiNozzle) resetConn() error { capi.Logger().Infof("%v resetting capi connection. \n", capi.Id()) if capi.validateRunningState() != nil { capi.Logger().Infof("%v is not running, no need to resetConn", capi.Id()) return nil } // the sole purpose of getClientOpFunc is to match the func signature re...
[ -0.41984012722969055, -0.664326548576355, 0.6000288128852844, 0.7884769439697266, -0.02062249556183815, -0.7958201169967651, 0.5711109638214111, 0.397868812084198, -0.5017872452735901, 0.21379730105400085, -0.2219858467578888, 0.9020389914512634, -0.4226056933403015, -0.2982091009616852, ...
func NewLegacyFeatureParams() *LegacyFeatureParams { var () return &LegacyFeatureParams{ timeout: cr.DefaultTimeout, } }
[ 0.581278383731842, -0.41352808475494385, 0.2734646797180176, 1.024844765663147, -0.5104116797447205, -0.3387600779533386, -0.5097714066505432, 1.319811463356018, -0.5947052836418152, -0.16024093329906464, -0.9994029402732849, -0.01910284161567688, -0.6812240481376648, 0.9669082760810852, ...
func NewLegacyFeatureParamsWithTimeout(timeout time.Duration) *LegacyFeatureParams { var () return &LegacyFeatureParams{ timeout: timeout, } }
[ 0.813508152961731, -0.6748292446136475, 0.34738272428512573, 0.7369558215141296, -0.586976945400238, 0.35751819610595703, -1.357858419418335, 0.8711973428726196, -0.6672396659851074, 0.8376597166061401, -0.30972909927368164, 0.173586905002594, -0.27566927671432495, 1.0700712203979492, -1...
func (o *LegacyFeatureParams) WithLegacyFeatureID(LegacyFeatureID int64) *LegacyFeatureParams { o.LegacyFeatureID = LegacyFeatureID return o }
[ 0.8458194136619568, -1.2059109210968018, 0.4934905767440796, 0.4474673867225647, -0.3681042790412903, -0.14783599972724915, -0.48909232020378113, 0.7543241381645203, 0.8995577096939087, 0.3021049201488495, -0.4718190133571625, -0.17618337273597717, -0.19799356162548065, 1.0437536239624023,...
func (o *LegacyFeatureParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { r.SetTimeout(o.timeout) var res []error // path param legacy_feature_id if err := r.SetPathParam("legacy_feature_id", swag.FormatInt64(o.LegacyFeatureID)); err != nil { return err } if len(res) > 0 { return e...
[ -1.124775767326355, -0.26403626799583435, 0.6799179315567017, -0.16967307031154633, 1.0753027200698853, -0.09441646188497543, 0.9511598944664001, 0.6118447780609131, -0.3291958272457123, 0.1821044236421585, 0.22995585203170776, 0.02066650614142418, -0.384112149477005, 0.40767085552215576, ...
func Handler() func(ctx *routing.Context) error { return func(ctx *routing.Context) error { // r.URL.Query().Get("query") print(ctx.Request.URI().QueryString()) result := executeQuery(string(ctx.Request.URI().QueryString()), schema) json.NewEncoder(ctx.Response.BodyWriter()).Encode(result) return nil } }
[ -0.5076969265937805, -0.3731624186038971, 0.5011494755744934, 0.17532196640968323, 0.2804730236530304, 0.7992003560066223, 0.22702348232269287, 0.4059630036354065, 0.07523550093173981, -0.49039795994758606, 0.05444148927927017, 0.1496087610721588, 0.5733456611633301, -0.34204864501953125, ...
func (m *Manager) Create(ctx context.Context, tx *sql.Tx, user v0.User) error { _, err := tx.ExecContext(ctx, ` INSERT INTO users ( name, email, primary_public_key, recovery_public_key, super_user, auth_level, weight, user_set ) VALUES (?, ?, ?, ?, ?, ?, ?, ?)`, ...
[ 0.21633535623550415, 1.0553034543991089, 0.36260029673576355, 0.5748197436332703, -0.016246331855654716, 0.6156208515167236, -0.45780009031295776, -0.2835458517074585, -1.0244929790496826, -0.3310844600200653, -1.0905479192733765, -0.33991166949272156, -0.5453154444694519, 0.21593938767910...
func (m *Manager) Alter(ctx context.Context, tx *sql.Tx, user v0.User) error { // This is quite a hacky delete, but NULL fields are not evaluated in indexes; thus there can be only one field // with deleted=FALSE, and many fields with deleted=NULL (thus true). err := m.Delete(ctx, tx, user) if err != nil { return...
[ -0.28793808817863464, 0.1415284126996994, 0.4470309913158417, 0.2277049571275711, -0.25444528460502625, 0.15117037296295166, 0.02902187965810299, 0.6942456960678101, -0.21570947766304016, -0.5969824194908142, -0.22207596898078918, 0.4550098180770874, 0.19937118887901306, 0.5434085726737976...
func (m *Manager) Get(ctx context.Context, tx *sql.Tx, publicKey []byte) (*v0.User, error) { row := tx.QueryRowContext(ctx, ` SELECT name, email, primary_public_key, recovery_public_key, super_user, auth_level, weight, user_set FROM users WHERE primary_publ...
[ -0.22222091257572174, 0.32500389218330383, 0.7299129366874695, -0.17476487159729004, -0.2065124660730362, -0.41085144877433777, -0.918698787689209, -0.21250058710575104, -0.3394894599914551, -0.2252235859632492, -0.22992141544818878, 0.5182822942733765, -0.5202072858810425, -0.220374524593...
func (m *Manager) Delete(ctx context.Context, tx *sql.Tx, user v0.User) error { result, err := tx.ExecContext(ctx, ` UPDATE users SET deleted_at = ?, deleted = TRUE WHERE primary_public_key = ?;`, time.Now(), user.PrimaryPublicKey, ) if err != nil { return err } affected, err := result.Row...
[ 0.16666732728481293, 0.5588662028312683, 0.6954168081283569, 0.5561962127685547, 0.09522110223770142, 0.5054786205291748, -0.08098400384187698, 0.1282593160867691, -0.6591553092002869, 0.5325672030448914, -0.3493487536907196, 0.22780993580818176, -0.8921866416931152, 0.29009267687797546, ...
func NewNotificationsUpdateHandler(notificationService notification.Service) *NotificationsUpdateHandler { return &NotificationsUpdateHandler{notificationService} }
[ 0.14709705114364624, -0.06210504472255707, -0.046803221106529236, 0.19086451828479767, -1.1482245922088623, 0.6105524897575378, -0.20113004744052887, -0.013601473532617092, 0.11393683403730392, 0.5752702355384827, -0.2704765200614929, 0.1481766700744629, -0.3825608193874359, -0.11749535799...
func (n *NotificationsUpdateHandler) ServeHTTP(w http.ResponseWriter, req *http.Request) { var notificationSettings api.NotificationSettingsRequest err := json.NewDecoder(req.Body).Decode(&notificationSettings) if err != nil { http.Error(w, "Unable to parse json", http.StatusBadRequest) return } n.notificatio...
[ -0.022220509126782417, 0.22497378289699554, 0.4467777609825134, 0.6420010328292847, -0.3377379775047302, 0.7154080867767334, -0.3670331537723541, -0.18287324905395508, -0.6735134124755859, 1.5830203294754028, 0.13895227015018463, 0.10795500129461288, -0.6903570890426636, -0.121551439166069...
func mutate(m message) message { if len(m) == 0 { return m } n := make(message, len(m)) copy(n, m) for tries := 0; tries < 3; tries++ { i := rand.Intn(len(m)) word := m[i] if len(word.original) >= minWordLength { n[i] = dictionary.randomSubstituteFor(word) return n } } return n }
[ -0.10827232152223587, 1.0308678150177002, 0.6357424855232239, -0.8380511403083801, -0.6140207052230835, 0.15306530892848969, -0.14241038262844086, -0.35948413610458374, 0.4747982919216156, 0.4848092794418335, 0.14439062774181366, 0.8263452649116516, -1.5193537473678589, -0.1691954582929611...
func telephone(from, to chan message) { for m := <-from; m != nil; m = <-from { if *printIntermediateStates { fmt.Printf("Heard: %s\n", m) } to <- mutate(m) } to <- nil }
[ 0.3525889217853546, -0.3670468330383301, 0.5755122900009155, -0.9506816864013672, 0.7023721933364868, 0.5388875007629395, -0.7034597396850586, -0.7019394040107727, 0.2193230390548706, -0.02389063499867916, 0.11274298280477524, 1.1194134950637817, -0.8603270649909973, -0.15543422102928162, ...
func main() { flag.Parse() if file, err := os.Open(*wordList, os.O_RDONLY, 0); err == nil { fmt.Fprintf(os.Stderr, "Reading words from \"%s\"...\n", *wordList) dictionary = readWords(file) file.Close() } else { fmt.Fprintf(os.Stderr, "%s: %s\n", *wordList, err) } if dictionary.Len() < 1 { fmt.Fprintf(os...
[ 0.39737021923065186, 0.6021369099617004, 1.2736705541610718, -0.30851852893829346, -0.0343518890440464, 0.5714678168296814, 0.30084189772605896, -0.5224165320396423, -1.0731412172317505, 0.954709529876709, 0.25687578320503235, 0.31382349133491516, -0.22563843429088593, 0.4979209005832672, ...
func (d metaphoneDict) phoneticLocation(metaphone string) (i int) { left, right := 0, len(d) for left < right { i = left + ((right - left) / 2) if d[i].metaphone < metaphone { left = i + 1 } else { right = i } } return }
[ -1.3552467823028564, 0.03067515417933464, 0.522631049156189, -0.7665543556213379, -1.1354947090148926, -0.35060298442840576, 1.167283296585083, -0.357923299074173, 0.1485939919948578, 0.20795688033103943, 0.43891003727912903, -0.5444844365119934, -0.6127711534500122, -0.17677201330661774, ...
func (d metaphoneDict) matches(metaphone string) metaphoneDict { var l, r int i := d.phoneticLocation(metaphone) for r = i; r < len(d) && d[r].metaphone == metaphone; r++ { } for l = i; l >= 0 && d[l].metaphone == metaphone; l-- { } l++ if r-l < fudgeDistance*2 { l -= fudgeDistance r += fudgeDistance } if...
[ -0.34432774782180786, -0.007860002107918262, 0.3088456690311432, -0.4905947148799896, -1.0488665103912354, -0.2579056918621063, -0.3199356496334076, 0.3070656955242157, 0.2853504717350006, 0.3021467626094818, -0.08905206620693207, -0.34383782744407654, -0.5869051218032837, -0.1518383771181...
func (d metaphoneDict) randomNonEqual(w string) *metaphoneWord { if len(d) == 0 { return nil } i := rand.Intn(len(d)) switch { case d[i].literal != w: case i > 0 && d[i-1].literal != w: i-- case i < len(d)-1 && d[i+1].literal != w: i++ case i == 0 && len(d) > 2 && d[i+2].literal != w: i += 2 case i == ...
[ -0.5080989003181458, -0.11655881255865097, 0.6778793334960938, -0.9477315545082092, -0.7279436588287354, 0.06214940547943115, 0.16978327929973602, -0.3773971199989319, 0.43985745310783386, 0.24325206875801086, -0.6957583427429199, 0.034089986234903336, -0.9786362648010254, 0.58014416694641...
func (d metaphoneDict) randomSubstituteFor(w *metaphoneWord) *metaphoneWord { mp := w.metaphone if rand.Intn(2) == 0 { mp = w.secondary } match := d.matches(mp).randomNonEqual(w.literal) if match != nil { return match } return w }
[ 0.3741529583930969, -0.058023851364851, 0.3829863667488098, -1.1279488801956177, -1.0487604141235352, -0.019170789048075676, -0.5920473337173462, -0.17086760699748993, 0.5482684969902039, -0.8113774657249451, 0.15199097990989685, 0.2114650011062622, -0.8263559341430664, 0.4422239661216736,...
func (d *metaphoneDict) Push(mp metaphoneWord) { dict := *d if len(dict) < cap(dict) { dict = dict[0 : len(dict)+1] } else { dict = make(metaphoneDict, len(dict)+1, cap(dict)+dictCapacity) copy(dict, *d) } dict[len(dict)-1] = mp *d = dict }
[ -0.7961305975914001, 1.3790820837020874, 0.3415229618549347, -1.0094674825668335, -0.9987123012542725, 0.36833062767982483, -0.4220341742038727, 0.016462013125419617, 0.532749354839325, 0.873249888420105, -0.10704181343317032, 0.4332696795463562, -0.32261428236961365, 0.6423821449279785, ...
func readWords(input io.Reader) metaphoneDict { dict := newMetaphoneDict() rd := bufio.NewReader(input) for { if word, err := rd.ReadString('\n'); err == nil { word = strings.TrimSpace(word) if !*allowNamesInWordList { rune, _ := utf8.DecodeRuneInString(word) if unicode.IsUpper(rune) { continue ...
[ 0.0787598267197609, 0.215926855802536, 0.5839071273803711, -1.0369991064071655, -1.6194212436676025, 0.4349370002746582, 0.01360719557851553, -0.7145868539810181, -0.5170164108276367, 0.6338899731636047, -0.13084743916988373, 0.3544982373714447, -0.5182831287384033, 1.0095995664596558, -...
func doubleMetaphone(word string) (result *metaphoneWord) { if doubleMetaphoneMaxLen > 0 { return doubleMetaphoneLimited(word, doubleMetaphoneMaxLen) } return doubleMetaphoneLimited(word, len(word)*2) }
[ -0.2466570883989334, 0.4071590006351471, 0.5628838539123535, 0.6612018346786499, -1.108327865600586, 0.5203337669372559, -0.513495922088623, -0.895492434501648, 0.3078831434249878, 0.6902297735214233, -0.7478073835372925, 0.3820456266403198, -0.15351241827011108, 0.13710680603981018, 0.7...
func doubleMetaphoneLimited(word string, maxLen int) (result *metaphoneWord) { result = new(metaphoneWord) result.original = word word = strings.ToUpper(word) // TODO: Strip punctuation result.literal = word prev, skip, last, slavoGermanic := 0, 0, len(word)-1, false testSlavoGermanic: for pos, c := range word {...
[ -0.016677655279636383, -0.07346651703119278, 0.8603363633155823, 0.20179180800914764, -1.0446313619613647, 0.10795504599809647, 0.19871242344379425, -0.2635655105113983, 0.6779274344444275, 0.609127402305603, -0.5204707384109497, 0.3337264657020569, -0.3671381175518036, -0.1195297166705131...
func (q *Query) NotIn(field_name string, val []interface{}) *Query { return q.addCondition(field_name, query.OpNotIn, val) }
[ -0.4191876947879791, -0.043490227311849594, 0.19906730949878693, 0.4841204583644867, -1.2657757997512817, 1.2896889448165894, -0.17893283069133759, 0.210699662566185, -0.8231234550476074, 0.11920937895774841, 0.42239800095558167, -0.009183965623378754, -0.7123929262161255, 0.31095182895660...
func (q *Query) In(field_name string, val []interface{}) *Query { return q.addCondition(field_name, query.OpIn, val) }
[ 0.01261181477457285, -0.09332020580768585, 0.2706236243247986, 0.13828431069850922, -1.1098664999008179, 0.909792423248291, -0.3808988034725189, 0.38284626603126526, -1.023283839225769, -0.0005486052832566202, 0.4691728949546814, 0.6564005613327026, -0.04949844628572464, 0.4121972024440765...
func (q *Query) Greater(field_name string, val interface{}) *Query { return q.addCondition(field_name, query.OpGreater, val) }
[ -0.1479795128107071, 0.7245278358459473, 0.36360862851142883, 0.19362513720989227, -0.6361331343650818, 0.6529206037521362, -0.9654584527015686, -0.6967140436172485, -0.9977200031280518, -0.46255794167518616, 0.3756052851676941, 0.08939842134714127, 0.8487489223480225, 0.38886651396751404,...
func (q *Query) GreaterOrEqual(field_name string, val interface{}) *Query { return q.addCondition(field_name, query.OpGreaterOrEqual, val) }
[ -0.27827370166778564, -0.2196943461894989, 0.27961358428001404, -0.1681719273328781, -0.4981423020362854, 0.44772833585739136, -0.6230822205543518, -0.7221561074256897, -0.7885769009590149, 0.4856936037540436, -0.0641515702009201, -0.3540570139884949, -0.12392142415046692, 0.06379107385873...
func (q *Query) Less(field_name string, val interface{}) *Query { return q.addCondition(field_name, query.OpLess, val) }
[ 0.9146510362625122, 0.08731554448604584, 0.11235284060239792, -0.5599654316902161, -1.236280083656311, 0.7109637260437012, -0.11860594898462296, -1.326364278793335, -0.1769324690103531, -0.9690585136413574, 0.4224683940410614, -0.04782761633396149, -0.5229682922363281, 0.7225484251976013, ...
func (q *Query) LessOrEqual(field_name string, val interface{}) *Query { return q.addCondition(field_name, query.OpLessOrEqual, val) }
[ 0.5068822503089905, -0.7123404741287231, 0.3720318377017975, -0.6362919807434082, -0.6367706656455994, 0.08164548128843307, -0.5559320449829102, -0.602938711643219, 0.09645570069551468, -0.025217147544026375, 0.02680571936070919, -0.3206029236316681, -0.5682684183120728, 0.2498092502355575...
func (q *Query) Equal(field_name string, val interface{}) *Query { return q.addCondition(field_name, query.OpEqual, val) }
[ -0.09750773757696152, 0.26668980717658997, 0.2220892757177353, 0.3938532769680023, -0.4387066662311554, 0.6264072060585022, -0.0974377691745758, -0.4889396131038666, -0.6882093548774719, 0.7890447378158569, 0.01358029991388321, -0.03336998075246811, -0.3869408667087555, 0.518998384475708, ...
func (q *Query) NotEqual(field_name string, val interface{}) *Query { return q.addCondition(field_name, query.OpNotEqual, val) }
[ -0.07573413103818893, -0.04821179434657097, 0.4583253562450409, 0.8034618496894836, -0.8556765913963318, 0.4744437336921692, -0.35689446330070496, -0.6201399564743042, -0.7692215442657471, 0.8603556156158447, -0.09496468305587769, -0.5871139764785767, -0.6457703113555908, 0.385974258184433...
func (q *Query) Nil(field_name string) *Query { return q.addCondition(field_name, query.OpNil, nil) }
[ 0.8809133768081665, 0.14299769699573517, 0.3412522077560425, 0.18397502601146698, -0.7608359456062317, 0.31532472372055054, 0.2490791231393814, 0.867315948009491, -0.025744108483195305, -0.19881486892700195, 0.3825085163116455, -0.4155246615409851, -0.1586521416902542, -0.13382084667682648...
func (q *Query) NotNil(field_name string) *Query { return q.addCondition(field_name, query.OpNotNil, nil) }
[ 1.2256170511245728, -0.22072170674800873, 0.3556733727455139, 0.48933175206184387, -1.3606164455413818, 0.1185140535235405, 0.10008247196674347, 0.9747554063796997, 0.033316489309072495, 0.8034605979919434, -0.17485357820987701, -0.7101343274116516, -0.2423582673072815, 0.09042710810899734...
func (q *Query) Like(field_name string, val interface{}) *Query { return q.addCondition(field_name, query.OpLike, val) }
[ -0.007501386571675539, 0.38254639506340027, 0.34384217858314514, 0.10477863252162933, -1.7954692840576172, 1.0447341203689575, -0.9299429655075073, -0.6031956076622009, -0.7178679704666138, 0.3874785602092743, 0.1948404759168625, -0.14821724593639374, -0.6206516623497009, 0.314982444047927...
func (q *Query) StartsWith(field_name string, val interface{}) *Query { return q.addCondition(field_name, query.OpStartsWith, val) }
[ 0.9907904863357544, -0.5100499987602234, 0.31002211570739746, 0.9578536152839661, -1.348290205001831, -0.01587166264653206, -0.36675968766212463, -0.7599454522132874, -0.14065031707286835, 0.13891851902008057, 0.10748819261789322, 0.1536165028810501, 0.0915483832359314, 0.591931939125061, ...
func (q *Query) EndsWith(field_name string, val interface{}) *Query { return q.addCondition(field_name, query.OpEndsWith, val) }
[ -0.1406194567680359, 0.08932475000619888, 0.28616446256637573, 0.04569653421640396, -1.6071397066116333, 0.13752536475658417, -1.3362475633621216, -0.32261595129966736, -0.20856967568397522, -0.07939561456441879, 0.2735901474952698, -0.12444797903299332, -0.2793053090572357, 0.632154345512...
func (q *Query) Expr(field_name, expr string, args ...interface{}) *Query { return q.addCondition(field_name, query.OpExpr, expr, args...) }
[ 0.4245680868625641, 0.21343201398849487, 0.3066317141056061, 0.16724202036857605, -0.7978575825691223, 0.057668592780828476, -0.7483720183372498, 0.5486747622489929, -0.5351600646972656, -0.06291534006595612, 0.5848256945610046, 0.12888745963573456, -0.09630286693572998, 0.8387688398361206...
func (q *Query) NoLimit() *Query { q.offset = 0 q.limit = 0 return q }
[ 0.2700113356113434, -0.2816579341888428, 0.2858315110206604, -1.3082959651947021, -0.6447609663009644, 0.7758462429046631, 0.30071893334388733, 0.31613099575042725, -0.19972427189350128, -0.6021568179130554, 0.4475882351398468, -0.1798757165670395, -0.3051879107952118, -0.2729140818119049,...
func (q *Query) And() *Query { q.logicalOr = false return q }
[ 0.38848456740379333, -1.668998122215271, 0.2986414432525635, -0.4185202419757843, -0.9189021587371826, 1.2021732330322266, -0.08984871953725815, 1.15276300907135, 0.5260453820228577, -1.3562979698181152, 0.5401284098625183, 0.16244925558567047, 0.17978207767009735, 0.8335515856742859, -0...
func (q *Query) Or() *Query { q.logicalOr = true return q }
[ -0.19812655448913574, -0.29599201679229736, 0.060528550297021866, -0.5413277745246887, -0.7722506523132324, 1.4137407541275024, -0.7895013093948364, 0.603245735168457, 0.5124022364616394, -1.1842844486236572, 0.7756351232528687, -0.3853224217891693, 0.41378068923950195, 0.15104877948760986...
func (q *Query) Wrap(sub_query *Query) *Query { q.sub_queries = append(q.sub_queries, sub_query) return q }
[ -0.06204379349946976, 0.22447142004966736, 0.40715309977531433, 0.40463367104530334, -0.429456889629364, 1.358738660812378, -1.6146697998046875, -0.4386655390262604, 0.49057233333587646, -0.2653816342353821, 0.5608500838279724, 1.3579109907150269, 0.713645339012146, 0.16921161115169525, ...
func (q *Query) WrappedTo(parent_query *Query) *Query { parent_query.sub_queries = append(parent_query.sub_queries, q) return q }
[ 0.15263104438781738, 0.491784930229187, 0.5313818454742432, -1.153874397277832, 0.02474256232380867, 0.7425057291984558, -0.7339079976081848, -0.5315290093421936, -0.1657436043024063, -0.8641862273216248, -0.1421165019273758, 1.3621782064437866, 0.7544530630111694, 0.2825191915035248, -1...
func (q *Query) OrderBy(field_name string, desc bool) *Query { q.order_by = append(q.order_by, query.Order{ Field: field_name, Desc: desc, }) return q }
[ 0.27779829502105713, 0.5554155111312866, 0.4109210669994354, 0.6167595386505127, -0.02572479657828808, 0.2711850702762604, -0.9697156548500061, 0.4740760326385498, -0.800032913684845, -0.47292017936706543, -0.1066560298204422, -0.4643593430519104, 0.25711631774902344, -0.26738888025283813,...
func (q *Query) Page(page, page_size int) *Query { if page < 1 || page_size < 1 { logrus.Warn("illegal page or page_size: ", page, ", ", page_size) return q } q.offset = (page - 1) * page_size q.limit = page_size return q }
[ 0.3210548758506775, -0.021173549816012383, 0.528411865234375, -0.13668601214885712, -0.45862218737602234, 0.6149359941482544, -0.21368302404880524, 0.5283505320549011, 0.6687188148498535, 0.017062993720173836, 1.40013587474823, 0.04908290505409241, -0.6857019662857056, 0.38278475403785706,...
func (q *Query) Limit(limit int) *Query { if limit < 1 { logrus.Warn("illegal limit: ", limit) return q } q.limit = limit return q }
[ -0.20464704930782318, 0.416864275932312, 0.4494704604148865, 0.5419340133666992, -0.5733886957168579, 0.7384612560272217, -0.08599507808685303, -0.2350367307662964, 0.8706769943237305, -0.4505501687526703, 0.6207541227340698, 0.41173866391181946, -0.7543647885322571, -0.29576531052589417, ...
func (q *Query) Offset(offset, limit int) *Query { if limit < 1 || offset < 0 { logrus.Warn("illegal offset or limit: ", offset, ", ", limit) return q } q.offset = offset q.limit = limit return q }
[ -0.07091833651065826, -0.5049875974655151, 0.47031646966934204, -0.22188153862953186, -1.23462975025177, 1.5471744537353516, -0.4516001343727112, 0.8275660276412964, 0.4835854172706604, 0.04304474592208862, 0.8931303024291992, 0.9805249571800232, 0.11375125497579575, -0.1868668496608734, ...
func (q *Query) Data() query.Data { data := query.Data{} // conditions data.Conditions = q.conditions // logical data.Or = q.logicalOr // order data.Order = q.order_by // offset, limit data.Offset = q.offset data.Limit = q.limit // sub queries data.Children = []query.Data{} for _, query := range q.sub...
[ -0.31935182213783264, -0.44599226117134094, 0.3010840117931366, -0.5424227118492126, -0.7791311144828796, 1.2176042795181274, -0.2620505392551422, -0.1486368626356125, -0.04028720408678055, -1.1249051094055176, 0.11317351460456848, 0.6230352520942688, 0.4843209385871887, 0.4490447640419006...
func InterDiff(oldDiff, newDiff io.Reader) (string, error) { oldFileDiffs, errOldFiles := diff.NewMultiFileDiffReader(oldDiff).ReadAllFiles() newFileDiffs, errNewFiles := diff.NewMultiFileDiffReader(newDiff).ReadAllFiles() if errOldFiles != nil { fmt.Errorf("error parsing old diffs") return "", errOldFiles } ...
[ 0.07420097291469574, -1.5537309646606445, 1.0459684133529663, -0.5145902037620544, -0.44770216941833496, 0.1460714489221573, 0.5002719163894653, 0.0717569962143898, -0.2339290976524353, 0.17822468280792236, 0.7623544335365295, 0.3679036796092987, -0.07216906547546387, 1.291970133781433, ...
func Build() flaw.Flaw { // make http-specs directory curDir, httpDir, err := getDirectories() if err != nil { return flaw.From(err) } // assemble the specs err = assembleSpecs(curDir, httpDir) if err != nil { return flaw.From(err) } // image/build-with-tls images-to-deploy/http-specs err = image.BuildG...
[ -0.2340092658996582, -0.5456717014312744, 0.37110164761543274, -0.10448355972766876, 0.28075459599494934, 0.027682984247803688, 0.27190297842025757, 0.017108557745814323, 0.12924164533615112, -0.09078989923000336, -0.08527615666389465, 0.5013994574546814, 0.054501697421073914, 0.9330838322...
func RetryWithCounter(err error, n int) (Retry, int) { retry, retryIncr, _ := RetryWithIncrementAndFlag(err) ctr := n if bool(retryIncr) { ctr++ } return retry, ctr }
[ 0.21369734406471252, -0.18948523700237274, 0.3652518093585968, 0.5804041624069214, -0.9296742081642151, -0.36640405654907227, 0.3707096576690674, -0.2701129913330078, 0.3444277048110962, -0.7971264719963074, -0.6855832934379578, -0.09700798243284225, 0.3571917712688446, 0.7897382378578186,...
func RetryWithIncrement(err error) (Retry, RetryIncrement) { retry, retryIncr, _ := RetryWithIncrementAndFlag(err) return retry, retryIncr }
[ 0.10625991225242615, -0.671196699142456, 0.49249202013015747, 0.5728652477264404, -1.1481508016586304, -0.23126015067100525, 0.5333824753761292, -0.9440592527389526, 0.4305049180984497, -0.9240620136260986, -0.57647705078125, 0.15619532763957977, -0.14493902027606964, 0.19348208606243134, ...
func RetryWithIncrementAndFlag(err error) (Retry, RetryIncrement, RetryFlag) { if err == nil { return false, false, false } cast, ok := err.(*PropagatedError) if !ok { return false, false, false } return cast.RetryWithIncrementAndFlag() }
[ -0.12439052015542984, -0.3760623335838318, 0.7075328826904297, 1.170923113822937, -0.862821638584137, 0.5026785135269165, 0.8609387874603271, -0.36314359307289124, 0.15654589235782623, -0.6511415839195251, -0.7432421445846558, -0.04240576922893524, -0.1866556853055954, 0.6757596731185913, ...
func NewOpsSightCtl() *Ctl { return &Ctl{ Spec: &opssightv1.OpsSightSpec{}, PerceptorName: "", PerceptorImage: "", PerceptorPort: 0, PerceptorCheckForStalledScan...
[ 0.37180861830711365, -0.6753775477409363, 0.9928880929946899, -0.9927099347114563, -0.5241418480873108, -0.08412779867649078, 0.30397555232048035, -0.7600411772727966, 1.1017823219299316, -0.48068100214004517, 0.41635164618492126, 0.10402733832597733, 0.08042661845684052, 0.247830986976623...
func (ctl *Ctl) GetSpec() interface{} { return *ctl.Spec }
[ 0.916468620300293, 0.09394720941781998, 0.41851362586021423, 1.134412169456482, 0.2399865686893463, 0.050453584641218185, 1.0318074226379395, -0.549435555934906, 0.8989816308021545, -0.6987724304199219, -0.05914254114031792, 0.034050241112709045, 0.24193339049816132, -0.3029932379722595, ...
func (ctl *Ctl) SetSpec(spec interface{}) error { convertedSpec, ok := spec.(opssightv1.OpsSightSpec) if !ok { return fmt.Errorf("Error setting OpsSight Spec") } ctl.Spec = &convertedSpec return nil }
[ 0.12063781172037125, 0.2807300388813019, 0.5452236533164978, 0.7359536290168762, 0.059578269720077515, 0.31862524151802063, 0.6723419427871704, -0.35890331864356995, 0.7763755321502686, 0.0587976798415184, -0.09412738680839539, 0.5354179739952087, 1.1805309057235718, 0.3652617931365967, ...
func (ctl *Ctl) CheckSpecFlags() error { for _, registryJSON := range ctl.ScannerPodImageFacadeInternalRegistriesJSONSlice { registry := &opssightv1.RegistryAuth{} err := json.Unmarshal([]byte(registryJSON), registry) if err != nil { return fmt.Errorf("Invalid Registry Format") } } return nil }
[ -0.7255516648292542, 0.288910835981369, 0.43012160062789917, 0.1438950002193451, 0.5614823698997498, -0.29532143473625183, 0.23562219738960266, 0.03812882676720619, -0.09624841064214706, 0.3481946587562561, -0.4646463692188263, 0.3895620107650757, -0.9755843877792358, 1.1807551383972168, ...
func (ctl *Ctl) SwitchSpec(createOpsSightSpecType string) error { switch createOpsSightSpecType { case "empty": ctl.Spec = &opssightv1.OpsSightSpec{} case "disabledBlackduck": ctl.Spec = crddefaults.GetOpsSightDefaultValueWithDisabledHub() case "default": ctl.Spec = crddefaults.GetOpsSightDefaultValue() defa...
[ -0.1913442760705948, 0.10872170329093933, 0.3185868561267853, -0.13877247273921967, 0.8997451066970825, 0.3991031348705292, 0.09473492205142975, -0.11959058791399002, 0.28098100423812866, 0.23190109431743622, 0.4064803421497345, 0.4958987832069397, 0.21327832341194153, 0.04594205692410469,...
func (ctl *Ctl) AddSpecFlags(cmd *cobra.Command, master bool) { if master { cmd.Flags().StringVar(&ctl.PerceptorName, "perceptor-name", ctl.PerceptorName, "Name of the Perceptor") cmd.Flags().StringVar(&ctl.ScannerPodName, "scannerpod-name", ctl.ScannerPodName, "Name of the ScannerPod") cmd.Flags().StringVar(&ct...
[ 0.7329537868499756, 0.06999727338552475, 0.885882556438446, -0.30069056153297424, 0.5857188701629639, 0.3466961085796356, -0.05988788604736328, 0.05809953808784485, -0.07720447331666946, -0.47783198952674866, -0.1814458966255188, 0.5314436554908752, -0.7943432927131653, 1.3381963968276978,...
func (ctl *Ctl) SetChangedFlags(flagset *pflag.FlagSet) { flagset.VisitAll(ctl.SetFlag) }
[ -0.23069246113300323, 0.046260591596364975, 0.1808944195508957, 0.23411177098751068, 0.11130575090646744, 0.2095179408788681, 0.11963740736246109, -0.36636993288993835, -0.048356231302022934, -0.5472773909568787, -0.8791970610618591, 0.9022140502929688, -0.5077721476554871, 2.0478770732879...
func (ctl *Ctl) SetFlag(f *pflag.Flag) { if f.Changed { log.Debugf("Flag %s: CHANGED\n", f.Name) switch f.Name { case "perceptor-name": if ctl.Spec.Perceptor == nil { ctl.Spec.Perceptor = &opssightv1.Perceptor{} } ctl.Spec.Perceptor.Name = ctl.PerceptorName case "perceptor-image": if ctl.Spec.P...
[ 0.4088539481163025, -0.24514120817184448, 0.6274207830429077, -0.48423466086387634, 0.0925542563199997, 0.4549381136894226, 0.4685559570789337, 0.31781837344169617, 0.3148243725299835, -0.2853073477745056, -0.15452809631824493, 0.14149032533168793, 0.3140197992324829, 1.013650894165039, ...
func (ctl *Ctl) SpecIsValid() (bool, error) { return true, nil }
[ 0.008836637251079082, -0.9344931840896606, 0.4763038158416748, 0.4149251878261566, 0.043064940720796585, 0.7570532560348511, 0.5724901556968689, 0.05565135180950165, 1.1500495672225952, -0.07168933004140854, -0.2616264820098877, 0.20673269033432007, -0.15665479004383087, -0.112690269947052...