text
stringlengths
11
6.3k
embedding
listlengths
768
768
func (store KeyValue) list() (keys []DatabaseKey) { switch store.Type { case PERSISTENT: //store.tree. size := store.tree.Size() results := make([]DatabaseKey, size, size) for i := 0; i < store.tree.Size(); i++ { key, _ := store.tree.GetByIndex(i) results[i] = DatabaseKey(key) } return results de...
[ -0.37849316000938416, 0.30263617634773254, 0.30948254466056824, 0.4129943251609802, 0.009806009940803051, -0.8634161353111267, 0.020200790837407112, 0.4663904011249542, -0.0358121432363987, 1.0173805952072144, -0.49683690071105957, 0.39487993717193604, -0.4668707847595215, 0.65247493982315...
func (store KeyValue) empty() { switch store.Type { case MEMORY: case PERSISTENT: default: panic("Unknown Type") } }
[ -0.46976450085639954, 0.15144070982933044, 0.15525102615356445, 0.48697027564048767, -0.12666593492031097, 1.3218144178390503, -0.19871972501277924, -0.3910762071609497, -0.617031991481781, 0.8676813840866089, -0.1576467603445053, 1.3678278923034668, 0.000011626411833276507, 0.239321321249...
func (i *Instance) CopyTarball(path string) (string, *tar.Reader, error) { // Set up filepaths path = filepath.Clean(path) file := filepath.Base(path) parentDir := filepath.Dir(path) dir := filepath.Join(os.TempDir(), i.Name) // Make temp directory Mkdirp(dir) archivePrefix := filepath.Base(parentDir) if ar...
[ 0.13289348781108856, -0.9987516403198242, 0.8836761116981506, -0.499159038066864, -0.8814838528633118, 0.8427727818489075, 0.48144030570983887, -0.015380360186100006, -0.4053623080253601, 0.30251026153564453, 0.6208462119102478, -0.22988584637641907, -0.17753061652183533, 0.182150244712829...
func (printer *PrettyPrinter) init() *PrettyPrinter { printer.frameworkSummary = ControlSummary{} printer.summary = Summary{} printer.sortedControlNames = []string{} return printer }
[ -0.2718721628189087, -0.942345142364502, 0.5874618887901306, -0.7011892199516296, -0.35835784673690796, 0.5162002444267273, -0.17344683408737183, -0.26389241218566895, 0.030965136364102364, -0.8134673237800598, -0.007051389664411545, 0.3978251814842224, -0.48711836338043213, 0.909137606620...
func DbConn() (db *sql.DB) { //var host = "tcp(192.168.0.14)" var host = "tcp(192.168.0.12)" // var host = "tcp(127.0.0.1)" dbname := "dbaexperience" db, err := sql.Open(config.DbDriver, fmt.Sprintf("%s:%s@%s/%s", config.DbUser, config.DbPass, host, dbname)) if err != nil { panic(err.Error()) } return db }
[ -0.12692631781101227, -0.010711085051298141, 0.7694583535194397, 0.555701494216919, 0.004817981738597155, 0.41052353382110596, -0.2887236177921295, 0.7885531187057495, 0.02616018056869507, -0.2828563153743744, 0.3858696520328522, 0.1530361920595169, -0.34663814306259155, 0.1902042329311370...
func (s *State) Total() int { return len(s.groups) }
[ -0.9290632605552673, 0.14227478206157684, 0.38610926270484924, -1.0173612833023071, 0.33638906478881836, -0.6799018979072571, 0.708991289138794, -0.02704889141023159, 0.3435337245464325, 0.15534256398677826, -0.948945939540863, -0.0168000441044569, -0.023989195004105568, -0.783423840999603...
func (s *State) Pop() *mesosfile.Group { // If running task groups synchronously each subsequent group (and task) must reach // TASK_FINISHED before the next task is available for scheduling. if s.sync && s.last != mesos.TASK_FINISHED { return nil } select { case group := <-s.pending: if s.sync { // Reset ...
[ 0.07388774305582047, 0.8993291854858398, 0.5074822902679443, -0.3099713921546936, -0.5949850082397461, -0.3027184009552002, 0.6435622572898865, -0.12325724214315414, -0.9266921877861023, 0.4419185221195221, 0.5697454810142517, -0.2265242636203766, 0.1388055831193924, -0.0838157907128334, ...
func (s *State) Append(group *mesosfile.Group) { s.pending <- group }
[ -0.4274769127368927, 0.2521035373210907, 0.26582056283950806, -0.63973069190979, -0.5047053098678589, -0.07236584275960922, -0.35091450810432434, 0.10133285820484161, -0.8045323491096497, -0.7173666954040527, -0.06948357820510864, 0.14501714706420898, -0.18911616504192352, 1.79029357433319...
func (s *State) Update(status mesos.TaskStatus) { s.updates <- status }
[ -0.30943936109542847, -0.3451879024505615, 0.14769625663757324, -0.2090509980916977, -0.6980145573616028, 0.6726108193397522, -0.17874060571193695, 0.5147706270217896, 0.031847208738327026, 0.1814451515674591, -1.3008636236190796, -0.04692985489964485, 0.15943045914173126, 0.53226584196090...
func (s *State) finished() bool { for _, state := range s.states { if state != mesos.TASK_FINISHED { return false } } return true }
[ -0.12784506380558014, 0.3520067036151886, 0.38285064697265625, 0.08577053993940353, -0.19272035360336304, -0.2310800552368164, -0.22413989901542664, -0.2428976446390152, -0.4926988482475281, 0.09893779456615448, -1.1956654787063599, -0.5623656511306763, 0.33059775829315186, 1.0361261367797...
func (mb *serialPort) connect() error { if mb.port == nil { port, err := serial.OpenPort(&mb.Config) if err != nil { return err } mb.port = port } return nil }
[ 0.6228800415992737, -0.4064379036426544, 0.5198758840560913, 0.3350924253463745, -0.22582951188087463, 0.22996599972248077, 0.42435190081596375, 0.09455669671297073, -0.1103442832827568, -0.17952898144721985, -0.1321060210466385, 0.4518919289112091, -0.44879910349845886, 0.0980067849159240...
func (mb *serialPort) close() (err error) { if mb.port != nil { err = mb.port.Close() mb.port = nil } return }
[ 1.1366370916366577, -0.3515335023403168, 0.4470589756965637, 0.1024630069732666, 0.20572324097156525, 0.23807379603385925, 0.7245105504989624, -0.019289808347821236, 0.4340458810329437, -0.9801102876663208, 0.12947824597358704, 0.6059821248054504, -1.5409669876098633, 0.511761486530304, ...
func (mb *serialPort) closeIdle() { mb.mu.Lock() defer mb.mu.Unlock() if mb.IdleTimeout <= 0 { return } idle := time.Now().Sub(mb.lastActivity) if idle >= mb.IdleTimeout { mb.logf("modbus: closing connection due to idle timeout: %v", idle) mb.close() } }
[ 0.05924265831708908, -0.397429496049881, 0.7381434440612793, -0.4103713631629944, 0.31149032711982727, 0.44308510422706604, 0.003415030660107732, -0.5514429211616516, 0.7027643322944641, -0.8202203512191772, 0.8908544778823853, 0.2820509374141693, -1.915627360343933, 0.21891160309314728, ...
func str2bytes(s string) (int, error) { for r, f := range byteMap { match := r.FindStringSubmatch(s) if len(match) == 0 { continue } val, err := strconv.ParseFloat(match[1], 10) if err != nil { return 0, err } return int(math.Round(val * f)), nil } return 0, errors.New("cannot parse string") }
[ 0.6427544355392456, -0.5484227538108826, 0.6504523158073425, -0.24123787879943848, -0.20345443487167358, -0.7698284983634949, 0.479394793510437, -0.1840212047100067, -0.9947061538696289, -0.1397610455751419, -0.21591821312904358, -0.3576053977012634, -0.7958287000656128, 0.9464238882064819...
func (w *wikiClient) RandomSummary(ctx context.Context) ([]byte, error) { req, err := http.NewRequestWithContext(ctx, http.MethodGet, w.url, nil) if err != nil { return nil, err } req.Header.Add("Accept", "application/problem+json") req.Header.Add("User-Agent", w.userAgent) resp, err := w.client.Do(req) if e...
[ -0.47190776467323303, -0.37412476539611816, 1.1856495141983032, -0.3579259216785431, -0.40778791904449463, -0.6520216464996338, -0.9092437624931335, -0.1761150360107422, 0.8047676682472229, 0.599742591381073, 0.2112485021352768, 0.40585625171661377, -0.5116296410560608, 0.25366735458374023...
func NewDeck(cards ...spanish.Card) *Deck { return &Deck{ cards: cards, } }
[ 0.22836509346961975, 0.6115444898605347, 0.1828719526529312, 1.356243371963501, -0.5244019627571106, -0.24940691888332367, -1.5298503637313843, 0.009273371659219265, 0.13142025470733643, -1.1757936477661133, 0.4960778057575226, 0.44909948110580444, 0.8287234306335449, 0.4301227927207947, ...
func (deck *Deck) Len() int { return len(deck.cards) }
[ 0.41329964995384216, 0.30145442485809326, 0.037354499101638794, -0.6125985383987427, 0.34191980957984924, -1.2133015394210815, -0.049228157848119736, 1.4267336130142212, 0.03299788385629654, -1.135384440422058, -1.035808801651001, 0.26841139793395996, 0.9847521185874939, 0.4254657328128814...
func (deck *Deck) Copy() cards.Deck { currentCards := make([]spanish.Card, len(deck.cards)) copy(currentCards, deck.cards) return &Deck{cards: currentCards} }
[ -0.1765003204345703, -0.6537942290306091, 0.2742300033569336, 0.2524404525756836, -0.9676517248153687, 0.5680152177810669, -0.37079140543937683, 0.34939128160476685, 0.8987454771995544, -0.17423692345619202, 0.3459935784339905, 0.4993763566017151, 0.2816060483455658, 0.5274977684020996, ...
func (deck *Deck) Swap(i, j int) { deck.cards[i], deck.cards[j] = deck.cards[j], deck.cards[i] }
[ -1.485658884048462, -0.15564168989658356, 0.2160710245370865, -0.7866983413696289, 0.43641698360443115, 0.02700197324156761, -0.5534549951553345, 0.5678770542144775, -0.8052916526794434, -0.3352159559726715, -0.44583457708358765, 0.7184193730354309, 0.3752003014087677, -0.45862215757369995...
func (deck *Deck) Deal(n int) []cards.Card { peeked := deck.Peek(n) deck.cards = deck.cards[0 : len(deck.cards)-len(peeked)] return peeked }
[ -1.3093518018722534, 0.7636346220970154, 0.6902474761009216, -0.33952832221984863, 0.14311456680297852, -0.08540970087051392, -0.6235193610191345, -0.32754766941070557, 0.4426167607307434, -0.17698878049850464, -1.2856640815734863, 0.5831409692764282, -0.13264203071594238, 0.79888260364532...
func (deck *Deck) Peek(n int) []cards.Card { baseLength := len(deck.cards) if n < 1 { panic(cards.ErrDealBadCount) } else if n > baseLength { panic(cards.ErrDealNotEnough) } else { newLength := baseLength - n source := deck.cards[newLength:baseLength] result := make([]cards.Card, len(source)) for index...
[ -0.8063501715660095, 0.4578116834163666, 0.716385543346405, -0.49055981636047363, -0.2969247102737427, -0.8180679678916931, -0.4593418836593628, -0.6537876129150391, 0.3341307044029236, 0.37271609902381897, -0.8552669882774353, 0.6229252219200134, 0.6437181234359741, 0.16098521649837494, ...
func (deck *Deck) Stack(cards []cards.Card) { newLength := len(cards) baseLength := len(deck.cards) if newLength == 0 { return } newCards := make([]spanish.Card, newLength+baseLength) copy(newCards, deck.cards) for index := 0; index < newLength; index++ { newCards[baseLength+index] = cards[index].(spanish....
[ -0.3318105936050415, 0.58425372838974, 0.5284722447395325, -0.2254343032836914, 0.5004138350486755, -0.3949904143810272, -0.18686407804489136, -0.00514222914353013, 0.22651635110378265, 0.9686157703399658, -0.6442893147468567, 0.7193601131439209, 0.25098010897636414, 0.054589685052633286, ...
func (deck *Deck) Queue(cards []cards.Card) { newLength := len(cards) baseLength := len(deck.cards) if newLength == 0 { return } newCards := make([]spanish.Card, newLength+baseLength) for index := 0; index < newLength; index++ { newCards[newLength-1-index] = cards[index].(spanish.Card) } copy(newCards[new...
[ -0.30660659074783325, 0.44336798787117004, 0.6773375272750854, -0.2096732258796692, 0.7849470973014832, -0.4707659184932709, -0.6248379945755005, -0.04740499332547188, 0.567364513874054, 0.25799596309661865, -0.4203411638736725, 0.8651009202003479, 0.3295572102069855, 0.6259774565696716, ...
func (app *Application) DeliverTx(req types.RequestDeliverTx) types.ResponseDeliverTx { var method, key, value []byte parts := bytes.Split(req.Tx, []byte("=")) if len(parts) == 3 { method, key, value = parts[0], parts[1], parts[2] } else { method, key, value = req.Tx, req.Tx, req.Tx } lib.Log.Notice(strin...
[ -0.39474403858184814, -0.26522424817085266, 1.2713303565979004, -0.09659601002931595, -0.3970171809196472, 0.24178670346736908, 0.15032345056533813, 0.24685819447040558, 0.5959656238555908, 0.6351180672645569, -0.7322014570236206, -0.7738127112388611, 0.10551787167787552, 0.133763462305068...
func (app *Application) Query(reqQuery types.RequestQuery) (resQuery types.ResponseQuery) { lib.Log.Notice(reqQuery) // if reqQuery.Prove { // lib.Log.Notice(string(reqQuery.Data)) // 此处修改 value, err := app.state.db.Get(prefixKey(reqQuery.Data)) // value, err := app.state.db.Get(reqQuery.Data) // // ...
[ -0.5402610898017883, -0.3920913338661194, 0.985821008682251, 0.819422721862793, -0.41142839193344116, 0.07213503122329712, -0.3944534659385681, 0.4130857586860657, 0.17051182687282562, 0.10985089838504791, 0.5561665892601013, -0.5379377007484436, -0.15774384140968323, 0.551787257194519, ...
func (template *Template) Init() error { template.Directory = git.Repository(filepath.Join(TemplatesDirectory, template.Name)) if template.Directory.ToString() == "" { return fmt.Errorf("can not init a new template without a directory") } template.Files = filepath.Join(template.Directory.ToString(), "template") ...
[ -0.25418412685394287, -0.5174799561500549, 0.492154985666275, -0.20854537189006805, 0.05140393227338791, 0.08430135250091553, 0.10922747850418091, 0.9766384363174438, -1.1435532569885254, 0.30298346281051636, -0.7517910003662109, -0.007539393380284309, 0.13816145062446594, 1.24087989330291...
func (template *Template) FileIsTemplate(filePath string) (bool, error) { if filepath.Ext(filePath) == ".tmpl" { return true, nil } relPath, err := filepath.Rel(template.Files, filePath) if err != nil { return false, err } for _, match := range template.TemplateFiles { if match == relPath { return true...
[ 0.384278804063797, -0.5196050405502319, 0.7595219612121582, 0.11589369922876358, 0.013020085170865059, -0.001199717284180224, -0.020188769325613976, 0.1490805596113205, -0.03027421422302723, 0.7103931903839111, -0.35542967915534973, -0.7711120843887329, -0.8384075164794922, 0.2491004914045...
func (e *Example) PostLogin(ctx context.Context, req *example.Request, rsp *example.Response) error { log.Log("登陆 api/v1.0/sessions") //返回给前端的map结构体 rsp.Errno = utils.RECODE_OK rsp.Errmsg = utils.RecodeText(rsp.Errno) //查询数据库 var user models.User o:=orm.NewOrm() //创建查询句柄 qs:=o.QueryTable("user") //查询符合的数据 ...
[ -0.7143439054489136, -0.6288011074066162, 1.152978539466858, 0.3529553711414337, -0.7515954375267029, 0.5772797465324402, 0.4429105818271637, -0.3589397668838501, 0.6991046071052551, 0.487270325422287, -0.9728540182113647, -0.11846498399972916, -0.6197808384895325, -0.20215028524398804, ...
func SplitListOfIntsInURL(request *http.Request, key string, delimiter string) []int { sourceValue := request.URL.Query().Get(key) splitValues := strings.Split(sourceValue, delimiter) result := make([]int, 0, len(splitValues)) var err error var convertedValue int for _, value := range splitValues { if convert...
[ -2.2888896465301514, 0.11436738073825836, 0.49473264813423157, -0.3200867176055908, -0.2230907827615738, -0.7196159958839417, -0.43806126713752747, 1.2068127393722534, -0.19154903292655945, 0.6285474896430969, -1.0020350217819214, -0.3881378173828125, -0.6155679225921631, 0.708269357681274...
func (svc *SSHService) GetConfig(hostParam interface{}) (*system.SSHConfig, error) { var host *model.Host switch hostParam.(type) { case string: mh, err := metadata.LoadHost(svc.provider, hostParam.(string)) if err != nil { err = infraErr(err) return nil, err } host = mh.Get() case *model.Host: hos...
[ 0.06511987000703812, 0.4056273400783539, 0.7796640992164612, 0.8608347773551941, -0.02945058047771454, 0.24364596605300903, 0.0007447247044183314, 0.44968539476394653, -0.686125636100769, 0.48547208309173584, -0.4040640890598297, 0.6336334943771362, -0.22574223577976227, 1.0111374855041504...
func (svc *SSHService) WaitServerReady(hostParam interface{}, timeout time.Duration) error { var err error sshSvc := NewSSHService(svc.provider) ssh, err := sshSvc.GetConfig(hostParam) if err != nil { return logicErrf(err, "Failed to read SSH config") } waitErr := ssh.WaitServerReady(timeout) return infraErr(w...
[ -0.7627808451652527, 0.4489331543445587, 0.6287564039230347, 0.3304441571235657, 0.015537265688180923, 0.5631495118141174, -0.6730962991714478, 0.4351891577243805, -0.14697343111038208, 0.5995407700538635, -0.8159830570220947, 0.798344075679779, 0.06636054813861847, 0.9759659767150879, 0...
func (svc *SSHService) Run(hostName, cmd string) (int, string, string, error) { var stdOut, stdErr string var retCode int var err error hostSvc := NewHostService(svc.provider) host, err := hostSvc.Get(hostName) if err != nil { return 0, "", "", logicErrf(err, "no host found with name or id '%s'", hostName) } ...
[ -0.7046656608581543, -0.404992014169693, 0.9717500805854797, -0.08148347586393356, -0.30783262848854065, 0.1966204047203064, -0.013568933121860027, 0.2701556980609894, -1.211359977722168, -0.02304515801370144, -0.7368485331535339, 0.5539711713790894, -0.26166796684265137, 0.674714386463165...
func (svc *SSHService) run(ssh *system.SSHConfig, cmd string) (int, string, string, error) { // Create the command sshCmd, err := ssh.Command(cmd) if err != nil { return 0, "", "", err } return sshCmd.Run() }
[ -0.5575065612792969, -0.19063889980316162, 0.6132184863090515, -0.1212376281619072, -0.28263580799102783, 0.4899950325489044, -0.5012611746788025, 0.36630675196647644, -0.8351807594299316, -0.2515067160129547, -1.0435068607330322, 0.3395783305168152, -0.5052216053009033, 0.755163848400116,...
func Reverse(s string) (result string) { for _,v := range s { result = string(v) + result } return }
[ -1.1121304035186768, 0.4862545132637024, 0.30830302834510803, -0.6431722044944763, 0.043770067393779755, -0.764729380607605, -0.5376884341239929, 0.08650338649749756, -0.7486245632171631, -0.6068639755249023, -0.8436328172683716, 0.06734199821949005, -0.6335093975067139, -1.066784858703613...
func (l *List) PanicIfUnsafeNotAllowed() { if !l.allowUnsafe { panic(ErrUnsafe) } }
[ -0.20767517387866974, 1.5784317255020142, 0.2102733999490738, 0.9705240726470947, -0.0709780603647232, 0.23359748721122742, -0.300393283367157, 0.3719036877155304, -0.10821641981601715, 0.7038013935089111, -0.9324302673339844, 0.0749564915895462, -0.334665447473526, 1.2216938734054565, 0...
func (l *List) PanicIfEmpty() { //Check this List has some Items if l.length == 0 || l.start == nil || l.end == nil { panic(ErrNoItems) } }
[ 0.19659186899662018, 0.09644228219985962, 0.2745994031429291, 0.5149437189102173, 1.5840996503829956, -0.1366012990474701, -0.9369215369224548, -0.10999009013175964, 0.26558592915534973, 0.7239945530891418, -1.5123978853225708, -0.41240769624710083, -0.01542725320905447, 1.0696643590927124...
func (l *List) PanicIfNotInList(i *Item) { if (i.before == nil && i.after == nil && l.length != 1) || l.length == 0 { panic(ErrNotInList) } }
[ 0.2374463826417923, 0.7117711305618286, 0.008159874007105827, 0.9484368562698364, -0.19626794755458832, 0.5107020139694214, -0.6740639805793762, 0.3621329367160797, 0.23818530142307281, 0.5182279944419861, -1.7174761295318604, -0.48425209522247314, -1.1331197023391724, 1.3354833126068115, ...
func (l *List) PanicIfNotInListCheck(i *Item) { inList, _ := l.ItemPosition(i, 0, false, false) if !inList { panic(ErrNotInList) } }
[ 0.32068556547164917, 0.4749068319797516, 0.03918197378516197, 0.6904444694519043, 0.14240866899490356, 1.0799283981323242, -0.21998532116413116, -0.14887037873268127, 0.10717232525348663, -0.05505908280611038, -1.0943466424942017, -0.6826395392417908, -0.9441017508506775, 0.779804944992065...
func (i *Item) PanicIfInList() { if i.before != nil || i.after != nil { panic(ErrInList) } }
[ 0.3621077239513397, 0.0199058186262846, 0.17448210716247559, 0.7360001802444458, 0.3372514843940735, 0.13447332382202148, -0.4859894812107086, 0.18874649703502655, 0.34616565704345703, 0.6095004081726074, -1.498155951499939, -0.20553545653820038, -0.669420599937439, 1.03292715549469, -0....
func createFilesToMount(tempDir string, step batcheslib.Step, stepContext *template.StepContext) (map[string]*os.File, func(), error) { // Parse and render the step.Files. files, err := template.RenderStepMap(step.Files, stepContext) if err != nil { return nil, nil, errors.Wrap(err, "parsing step files") } var ...
[ 0.37724554538726807, -0.5538938045501709, 0.6451377272605896, -0.6047536134719849, 0.10014817118644714, -1.028082251548767, 0.27516183257102966, -0.055165309458971024, -0.8107126951217651, 0.49918457865715027, -0.8269602060317993, -1.0515661239624023, 0.7136073708534241, 0.8967181444168091...
func createRunScriptFile(ctx context.Context, tempDir string, stepRun string, stepCtx *template.StepContext) (string, string, func(), error) { // Set up a temporary file on the host filesystem to contain the // script. runScriptFile, err := os.CreateTemp(tempDir, "") if err != nil { return "", "", nil, errors.Wra...
[ 0.1799362450838089, -0.8282955884933472, 0.6847274303436279, -0.2582937777042389, -0.4298475682735443, -0.6184356808662415, 0.4369592070579529, -0.2259313017129898, -0.963762104511261, 0.04870767146348953, -0.41320502758026123, 0.12298934906721115, 0.3221588432788849, 0.38976454734802246, ...
func createCidFile(ctx context.Context, tempDir string, repoSlug string) (string, func(), error) { // Find a location that we can use for a cidfile, which will contain the // container ID that is used below. We can then use this to remove the // container on a successful run, rather than leaving it dangling. cidFil...
[ 0.9996095299720764, -0.8524537086486816, 0.6835192441940308, -0.5033278465270996, 0.0908840075135231, -0.47900789976119995, 0.5421918034553528, -0.09260392934083939, -0.286708265542984, 0.21561741828918457, -0.018976040184497833, -0.6961004734039307, -0.04970788583159447, 0.220788210630416...
func (e *Error) Load() error { v := e.v.Load() if v == nil { return nil } eh := v.(errorHolder) return eh.err }
[ -0.322388231754303, -0.10104171931743622, 0.25527822971343994, 0.10730451345443726, -0.36057746410369873, 0.13096372783184052, -0.18768680095672607, -0.26634877920150757, 0.7356869578361511, -0.21566514670848846, 0.2034561038017273, 0.22568440437316895, -0.5681154727935791, -0.078974500298...
func (e *Error) Store(err error) { e.v.Store(errorHolder{err: err}) }
[ -0.2575218379497528, 0.25155261158943176, -0.1211983785033226, 0.5488221049308777, -0.4239020049571991, 0.920661211013794, 0.2300257831811905, 0.041263531893491745, 1.539542317390442, -1.1714719533920288, -0.5992500185966492, 0.3754402697086334, 0.03779503330588341, 0.8324307799339294, 0...
func NewMockProviderClient(ctrl *gomock.Controller) *MockProviderClient { mock := &MockProviderClient{ctrl: ctrl} mock.recorder = &MockProviderClientMockRecorder{mock} return mock }
[ -0.08969629555940628, -0.2304796576499939, 0.08451968431472778, 0.8586040735244751, -0.7468900084495544, 0.023460853844881058, 1.2548930644989014, -0.45559316873550415, 0.7243381142616272, 0.8595141172409058, -0.2901844382286072, 0.08925621211528778, -0.9177212715148926, 0.4811616539955139...
func (m *MockProviderClient) EXPECT() *MockProviderClientMockRecorder { return m.recorder }
[ 0.10680558532476425, 0.06702833622694016, 0.11163514852523804, 0.07822305709123611, 0.07125216722488403, 0.23996715247631073, 0.3130592703819275, 0.13544264435768127, 0.6402205228805542, 0.18432900309562683, 0.4321354031562805, 1.1877778768539429, -1.1449085474014282, 0.2376430481672287, ...
func (m *MockProviderClient) BootstrapCreds(arg0 context.Context, arg1 map[string]string) (string, error) { m.ctrl.T.Helper() ret := m.ctrl.Call(m, "BootstrapCreds", arg0, arg1) ret0, _ := ret[0].(string) ret1, _ := ret[1].(error) return ret0, ret1 }
[ -0.1171976625919342, 0.13644413650035858, 0.6473445892333984, -0.25177329778671265, -0.06964035332202911, 0.3110174834728241, 0.22057461738586426, -0.4203007221221924, -0.7891604900360107, 0.055897511541843414, -0.7763673067092896, 0.39513495564460754, -0.9115728735923767, 0.85954910516738...
func (mr *MockProviderClientMockRecorder) BootstrapCreds(arg0, arg1 interface{}) *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "BootstrapCreds", reflect.TypeOf((*MockProviderClient)(nil).BootstrapCreds), arg0, arg1) }
[ 0.1820473074913025, 0.6986399292945862, 0.39896291494369507, -0.22872377932071686, -0.6708967685699463, -0.02990657277405262, -0.7164292335510254, -0.9006466865539551, 0.282817006111145, 0.8474808931350708, 0.08268845826387405, 1.2461185455322266, -0.9407035708427429, 1.0405821800231934, ...
func (m *MockProviderClient) BootstrapIam(arg0 context.Context, arg1 map[string]string, arg2 string) error { m.ctrl.T.Helper() ret := m.ctrl.Call(m, "BootstrapIam", arg0, arg1, arg2) ret0, _ := ret[0].(error) return ret0 }
[ -0.22188597917556763, -0.3339393436908722, 0.3720543384552002, 0.870733380317688, 0.9223314523696899, 0.12969769537448883, 0.9686395525932312, -0.10830157995223999, -1.2897635698318481, 0.0052358671091496944, -1.2356853485107422, -0.11273560672998428, -0.6767974495887756, 0.045279141515493...
func (mr *MockProviderClientMockRecorder) BootstrapIam(arg0, arg1, arg2 interface{}) *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "BootstrapIam", reflect.TypeOf((*MockProviderClient)(nil).BootstrapIam), arg0, arg1, arg2) }
[ 0.2060774713754654, 0.21998171508312225, 0.29305270314216614, 0.6483307480812073, 0.06935281306505203, -0.15238803625106812, 0.053527746349573135, -0.42456209659576416, -0.1308394968509674, 0.8371704816818237, -0.16359251737594604, 0.8069702982902527, -0.888135552406311, 0.2962230145931244...
func (m *MockProviderClient) DeleteCloudformationStack(arg0 context.Context, arg1 map[string]string, arg2 string) error { m.ctrl.T.Helper() ret := m.ctrl.Call(m, "DeleteCloudformationStack", arg0, arg1, arg2) ret0, _ := ret[0].(error) return ret0 }
[ -0.6630510687828064, 0.4394608736038208, 0.26215308904647827, 0.470451682806015, 0.627669632434845, 0.053666163235902786, 1.1337774991989136, -0.5653459429740906, -1.2797685861587524, -1.2633432149887085, -0.34460416436195374, -1.0723729133605957, -0.4195108115673065, 1.3497759103775024, ...
func (mr *MockProviderClientMockRecorder) DeleteCloudformationStack(arg0, arg1, arg2 interface{}) *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "DeleteCloudformationStack", reflect.TypeOf((*MockProviderClient)(nil).DeleteCloudformationStack), arg0, arg1, arg2) }
[ -0.34995633363723755, 0.6788845658302307, 0.3248332738876343, 0.21136100590229034, -0.018735887482762337, 0.11998461931943893, 0.0216404739767313, -0.8381628394126892, -0.36015087366104126, -0.6719861030578613, 0.4536706209182739, -0.16578339040279388, -0.17669081687927246, 1.2881013154983...
func NewMockProviderKubectlClient(ctrl *gomock.Controller) *MockProviderKubectlClient { mock := &MockProviderKubectlClient{ctrl: ctrl} mock.recorder = &MockProviderKubectlClientMockRecorder{mock} return mock }
[ 0.23157523572444916, -0.10396444797515869, 0.0460369810461998, 0.30967384576797485, -0.2276122272014618, 0.24406597018241882, 0.5912638306617737, -0.5812430381774902, -0.05203995853662491, 0.7117329239845276, 0.6009475588798523, 0.12297758460044861, -0.8764470815658569, -0.246958389878273,...
func (m *MockProviderKubectlClient) EXPECT() *MockProviderKubectlClientMockRecorder { return m.recorder }
[ 0.561186671257019, -0.07196947932243347, 0.15149737894535065, 0.1368686705827713, -0.000789543439168483, 0.41236862540245056, -0.25802773237228394, -0.016710510477423668, 0.13920213282108307, -0.060339897871017456, 1.0232621431350708, 1.0416240692138672, -1.1518274545669556, -0.11352130770...
func (m *MockProviderKubectlClient) GetEksaAWSDatacenterConfig(arg0 context.Context, arg1, arg2, arg3 string) (*v1alpha1.AWSDatacenterConfig, error) { m.ctrl.T.Helper() ret := m.ctrl.Call(m, "GetEksaAWSDatacenterConfig", arg0, arg1, arg2, arg3) ret0, _ := ret[0].(*v1alpha1.AWSDatacenterConfig) ret1, _ := ret[1].(er...
[ 0.13329355418682098, 0.003353628097102046, 0.14742881059646606, -0.6624601483345032, 0.33123013377189636, 0.03514717146754265, 0.5035213232040405, -0.273613303899765, -0.05992570519447327, -0.04558205604553223, -0.41606295108795166, -0.023038778454065323, 0.556878924369812, 1.2859151363372...
func (mr *MockProviderKubectlClientMockRecorder) GetEksaAWSDatacenterConfig(arg0, arg1, arg2, arg3 interface{}) *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GetEksaAWSDatacenterConfig", reflect.TypeOf((*MockProviderKubectlClient)(nil).GetEksaAWSDatacenterConfig), arg0,...
[ 0.9635782241821289, 0.5654265284538269, 0.2465403527021408, -0.8747612237930298, -0.16628305613994598, 0.08700840920209885, -0.46187758445739746, -0.18417857587337494, 0.5309300422668457, 0.6154131293296814, 0.22119437158107758, 0.6596936583518982, 0.4650535583496094, 1.4625777006149292, ...
func (m *MockProviderKubectlClient) GetEksaCluster(arg0 context.Context, arg1 *types.Cluster) (*v1alpha1.Cluster, error) { m.ctrl.T.Helper() ret := m.ctrl.Call(m, "GetEksaCluster", arg0, arg1) ret0, _ := ret[0].(*v1alpha1.Cluster) ret1, _ := ret[1].(error) return ret0, ret1 }
[ -0.6324063539505005, 0.12868469953536987, 0.18239261209964752, 0.35363224148750305, 1.1760749816894531, -0.4949477016925812, 1.135556936264038, -0.7495255470275879, -0.43298104405403137, -0.5699844360351562, -0.0829421654343605, 0.06057288497686386, -0.5218437910079956, 0.8437749743461609,...
func (mr *MockProviderKubectlClientMockRecorder) GetEksaCluster(arg0, arg1 interface{}) *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GetEksaCluster", reflect.TypeOf((*MockProviderKubectlClient)(nil).GetEksaCluster), arg0, arg1) }
[ 0.16816763579845428, 0.880156397819519, 0.13276700675487518, 0.09940721094608307, 0.5032994747161865, -0.14427338540554047, -0.07782528549432755, -0.6722573041915894, 0.4499792456626892, 0.4318232834339142, 0.7438528537750244, 1.0052562952041626, -0.6977341771125793, 1.0883630514144897, ...
func (m *MockProviderKubectlClient) GetKubeadmControlPlane(arg0 context.Context, arg1 *types.Cluster, arg2 ...executables.KubectlOpt) (*v1alpha30.KubeadmControlPlane, error) { m.ctrl.T.Helper() varargs := []interface{}{arg0, arg1} for _, a := range arg2 { varargs = append(varargs, a) } ret := m.ctrl.Call(m, "Get...
[ 0.24443413317203522, -0.11630817502737045, 0.5975796580314636, 0.24278156459331512, 0.5346099138259888, 0.5946043133735657, 0.49473240971565247, -1.3057729005813599, -0.7929297685623169, -0.609928548336029, 0.3631039261817932, -0.16242888569831848, -1.6998331546783447, 0.41864144802093506,...
func (mr *MockProviderKubectlClientMockRecorder) GetKubeadmControlPlane(arg0, arg1 interface{}, arg2 ...interface{}) *gomock.Call { mr.mock.ctrl.T.Helper() varargs := append([]interface{}{arg0, arg1}, arg2...) return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GetKubeadmControlPlane", reflect.TypeOf((*MockProvid...
[ 0.6605667471885681, 0.39591825008392334, 0.6076952219009399, 0.1615189164876938, -0.18028050661087036, 0.7432384490966797, -0.6853885054588318, -1.4251129627227783, -0.35813483595848083, 0.09288260340690613, 0.9614897966384888, 0.763581395149231, -1.7566595077514648, 1.2062575817108154, ...
func (m *MockProviderKubectlClient) GetMachineDeployment(arg0 context.Context, arg1 *types.Cluster, arg2 ...executables.KubectlOpt) (*v1alpha3.MachineDeployment, error) { m.ctrl.T.Helper() varargs := []interface{}{arg0, arg1} for _, a := range arg2 { varargs = append(varargs, a) } ret := m.ctrl.Call(m, "GetMachi...
[ -0.40539464354515076, 0.13901692628860474, 0.22515153884887695, 0.6085847020149231, 0.6010715961456299, 0.1098032295703888, 0.6510708928108215, -0.29823604226112366, -1.1575711965560913, -0.27396857738494873, 0.025844918563961983, -0.5857353806495667, -1.0084995031356812, 1.139475226402282...
func (mr *MockProviderKubectlClientMockRecorder) GetMachineDeployment(arg0, arg1 interface{}, arg2 ...interface{}) *gomock.Call { mr.mock.ctrl.T.Helper() varargs := append([]interface{}{arg0, arg1}, arg2...) return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GetMachineDeployment", reflect.TypeOf((*MockProviderKu...
[ -0.1214950755238533, 0.8613530397415161, 0.4630950689315796, 0.4609307646751404, 0.15779392421245575, 0.035142265260219574, -0.39389270544052124, -0.341509610414505, -0.3024643063545227, 0.5504298806190491, 0.8145343065261841, 0.3892977237701416, -1.0447560548782349, 1.3967236280441284, ...
func createBodies() { space = chipmunk.NewSpace() space.Gravity = vect.Vect{0, -900} staticBody := chipmunk.NewBodyStatic() staticLines = []*chipmunk.Shape{ chipmunk.NewSegment(vect.Vect{111.0, 280.0}, vect.Vect{407.0, 246.0}, 0), chipmunk.NewSegment(vect.Vect{407.0, 246.0}, vect.Vect{407.0, 343.0}, 0), } fo...
[ 0.19282416999340057, 0.26533928513526917, 0.6433350443840027, -1.1127992868423462, 1.1747076511383057, 0.960277259349823, 0.05605163425207138, -0.7792764902114868, 0.3324943780899048, -0.12267684191465378, -0.6265730261802673, -0.055469874292612076, 0.2378719300031662, 0.9675517678260803, ...
func step(dt float32) []*message.State { space.Step(vect.Float(dt)) states := make([]*message.State, len(balls)) for i := 0; i < len(balls); i++ { ball := balls[i] rot := ball.Body.Angle() * chipmunk.DegreeConst p := ball.Body.Position() vec := &message.Vec{X: float32(p.X), Y: float32(p.Y)} s := &message...
[ -0.7929650545120239, 0.710576057434082, 0.5753723382949829, -1.1791797876358032, -0.26976367831230164, 0.2321595847606659, 0.9805334806442261, -1.0547688007354736, 0.6047729253768921, 0.18652306497097015, -1.555751085281372, -0.1453525274991989, 0.2745683491230011, -0.14075879752635956, ...
func Register(user models.User) (string, bool, error){ ctx, cancel := context.WithTimeout(context.Background(), 15*time.Second) defer cancel() db := MongoClient.Database("test-api-go") col := db.Collection("users") user.Password, _ = PasswordEncrypt(user.Password) result, err := col.InsertOne(ctx, user) if...
[ -0.5765491724014282, 1.1344965696334839, 0.8210312128067017, -0.04417264461517334, 0.2591794431209564, 0.6077593564987183, 0.5218362808227539, -0.055773500353097916, -0.8943898677825928, 0.9715039730072021, -1.1968492269515991, -0.4808116555213928, -1.1872613430023193, 0.01923878863453865,...
func NewService(config Config) (*common.HTTPHandler, error) { newServer := rpc.NewServer() codec := json.NewCodec() newServer.RegisterCodec(codec, "application/json") newServer.RegisterCodec(codec, "application/json;charset=UTF-8") if err := newServer.RegisterService(&Admin{ Config: config, profiler: profile...
[ 0.0029757884331047535, 0.13002783060073853, 0.5562110543251038, -0.07702920585870743, -0.20993046462535858, 0.4041925072669983, -0.3135426640510559, -1.0650508403778076, -0.3698858916759491, 0.23170049488544464, -0.534462571144104, 1.028877854347229, -1.1354156732559204, 1.7088391780853271...
func (a *Admin) StartCPUProfiler(_ *http.Request, _ *struct{}, _ *api.EmptyReply) error { a.Log.Debug("API called", zap.String("service", "admin"), zap.String("method", "startCPUProfiler"), ) return a.profiler.StartCPUProfiler() }
[ -0.140656977891922, 0.9793667793273926, 0.5218666195869446, 0.6710616946220398, -0.5039159059524536, -0.3463496267795563, 0.3678768575191498, -0.6095036268234253, -0.35117676854133606, 0.48387011885643005, -0.8038138747215271, 0.6467066407203674, -0.8664654493331909, 1.1900570392608643, ...
func (a *Admin) StopCPUProfiler(_ *http.Request, _ *struct{}, _ *api.EmptyReply) error { a.Log.Debug("API called", zap.String("service", "admin"), zap.String("method", "stopCPUProfiler"), ) return a.profiler.StopCPUProfiler() }
[ -0.9219869375228882, 0.6272987127304077, 0.37727829813957214, 0.31960731744766235, -0.531353235244751, 0.09107759594917297, 0.594458818435669, -0.6747896075248718, -1.0674185752868652, 0.806666374206543, -0.905173659324646, 0.12948568165302277, -1.5532313585281372, 0.887674868106842, 0.8...
func (a *Admin) MemoryProfile(_ *http.Request, _ *struct{}, _ *api.EmptyReply) error { a.Log.Debug("API called", zap.String("service", "admin"), zap.String("method", "memoryProfile"), ) return a.profiler.MemoryProfile() }
[ 0.7283096313476562, 1.203366756439209, 0.46729573607444763, -0.20405015349388123, 0.18480917811393738, -0.5336902737617493, -0.3361930847167969, -1.7265985012054443, 0.050699662417173386, 0.7925232648849487, -0.13031630218029022, 1.152893304824829, -1.8103303909301758, 0.8337453603744507, ...
func (a *Admin) LockProfile(_ *http.Request, _ *struct{}, _ *api.EmptyReply) error { a.Log.Debug("API called", zap.String("service", "admin"), zap.String("method", "lockProfile"), ) return a.profiler.LockProfile() }
[ -0.013748507015407085, 0.7487987279891968, 0.47905072569847107, 0.5512112379074097, 0.39334186911582947, 0.09341537952423096, -0.08551442623138428, -1.81919264793396, -0.0014031653990969062, 0.38154396414756775, -0.0750768706202507, 0.49154847860336304, -1.4539976119995117, 0.2425929158926...
func (a *Admin) Alias(_ *http.Request, args *AliasArgs, _ *api.EmptyReply) error { a.Log.Debug("API called", zap.String("service", "admin"), zap.String("method", "alias"), logging.UserString("endpoint", args.Endpoint), logging.UserString("alias", args.Alias), ) if len(args.Alias) > maxAliasLength { return...
[ -1.0716828107833862, 0.18388505280017853, 0.6608206629753113, -0.3573245704174042, 0.588482141494751, 0.4867088496685028, -0.6584177017211914, -0.33668461441993713, -0.14213167130947113, 0.8353967666625977, 0.7297553420066833, 1.1523607969284058, -0.27395153045654297, 0.4841826856136322, ...
func (a *Admin) AliasChain(_ *http.Request, args *AliasChainArgs, _ *api.EmptyReply) error { a.Log.Debug("API called", zap.String("service", "admin"), zap.String("method", "aliasChain"), logging.UserString("chain", args.Chain), logging.UserString("alias", args.Alias), ) if len(args.Alias) > maxAliasLength {...
[ -0.9276947379112244, -0.22477173805236816, 0.584113359451294, -0.37785863876342773, 0.6673914194107056, 0.6716850996017456, -0.5306805372238159, -0.2118319422006607, -0.19662417471408844, 0.49071812629699707, -0.08233405649662018, 1.4941514730453491, -0.30222010612487793, 0.653501152992248...
func (a *Admin) GetChainAliases(_ *http.Request, args *GetChainAliasesArgs, reply *GetChainAliasesReply) error { a.Log.Debug("API called", zap.String("service", "admin"), zap.String("method", "getChainAliases"), logging.UserString("chain", args.Chain), ) id, err := ids.FromString(args.Chain) if err != nil { ...
[ -1.0647982358932495, 0.042966097593307495, 0.39056751132011414, -0.3107928931713104, 0.455782413482666, -0.2632687985897064, -0.8193696737289429, -0.8163945078849792, -0.41777679324150085, 0.7288997769355774, -0.4799598157405853, 1.8612831830978394, -0.6340492367744446, 0.6960702538490295,...
func (a *Admin) Stacktrace(_ *http.Request, _ *struct{}, _ *api.EmptyReply) error { a.Log.Debug("API called", zap.String("service", "admin"), zap.String("method", "stacktrace"), ) stacktrace := []byte(utils.GetStacktrace(true)) return perms.WriteFile(stacktraceFile, stacktrace, perms.ReadWrite) }
[ 0.4344717264175415, 0.7115522027015686, 0.770933985710144, -0.15028762817382812, 1.172256588935852, -0.21839399635791779, 0.16156481206417084, -0.7554996013641357, 0.02986719086766243, 0.7572730183601379, 0.15027259290218353, 0.8455458283424377, -1.130448579788208, 0.4623563587665558, 0....
func (a *Admin) SetLoggerLevel(_ *http.Request, args *SetLoggerLevelArgs, _ *api.EmptyReply) error { a.Log.Debug("API called", zap.String("service", "admin"), zap.String("method", "setLoggerLevel"), logging.UserString("loggerName", args.LoggerName), zap.Stringer("logLevel", args.LogLevel), zap.Stringer("disp...
[ -1.5378462076187134, -0.13270889222621918, 0.561134934425354, -0.5041674971580505, -0.2212645560503006, -0.2504417300224304, -0.25989851355552673, -0.5285087823867798, -0.27922526001930237, 0.4524633586406708, -0.7316329479217529, 1.17820405960083, -0.7288625240325928, 1.5849360227584839, ...
func (a *Admin) GetLoggerLevel(_ *http.Request, args *GetLoggerLevelArgs, reply *GetLoggerLevelReply) error { a.Log.Debug("API called", zap.String("service", "admin"), zap.String("method", "getLoggerLevels"), logging.UserString("loggerName", args.LoggerName), ) reply.LoggerLevels = make(map[string]LogAndDispla...
[ -1.0639867782592773, 0.19169974327087402, 0.682100772857666, -0.31729722023010254, 0.0007894115406088531, -0.3518750071525574, -0.40338191390037537, -1.0257766246795654, -0.06975185126066208, 0.33988142013549805, -0.8324205279350281, 1.195794701576233, -0.8884137868881226, 1.69851315021514...
func (a *Admin) GetConfig(_ *http.Request, _ *struct{}, reply *interface{}) error { a.Log.Debug("API called", zap.String("service", "admin"), zap.String("method", "getConfig"), ) *reply = a.NodeConfig return nil }
[ -0.5368123650550842, 1.6375073194503784, 0.6666495203971863, -0.3098539710044861, 0.777583658695221, -0.45232316851615906, -0.13956278562545776, -0.7465835213661194, -0.09606168419122696, 0.47646623849868774, 0.332846075296402, 1.7341947555541992, -0.577470600605011, 0.7609934210777283, ...
func (a *Admin) LoadVMs(r *http.Request, _ *struct{}, reply *LoadVMsReply) error { a.Log.Debug("API called", zap.String("service", "admin"), zap.String("method", "loadVMs"), ) ctx := r.Context() loadedVMs, failedVMs, err := a.VMRegistry.ReloadWithReadLock(ctx) if err != nil { return err } // extract the ...
[ -0.8707337379455566, 0.21983495354652405, 0.23495543003082275, -0.5953905582427979, 0.8025433421134949, -0.5103890895843506, -1.0151283740997314, -0.5923956036567688, 0.3433644473552704, 1.0623255968093872, -0.17456316947937012, 1.2188843488693237, -0.762299656867981, 0.507919430732727, ...
func Test_combinationSum(t *testing.T) { type args struct { candidates []int target int } tests := []struct { name string args args want [][]int }{ {name: "test", args: struct { candidates []int target int }{candidates: []int{2, 3, 6, 7}, target: 7}, want: [][]int{ {7}, {2, 2, 3}, ...
[ -0.3868740200996399, -0.686004638671875, 1.084885597229004, -0.1492960900068283, 0.767105758190155, -0.503320574760437, 1.0323917865753174, -0.41608428955078125, 0.27893587946891785, -0.45935213565826416, -0.4413544535636902, -0.12370068579912186, -0.08901242166757584, -0.3021370768547058,...
func checkLocal(dpath string) error { if info, err := os.Stat(dpath); err != nil { return err } else if !info.IsDir() { return fmt.Errorf("%v exists, but is not a directory") } if err := metastore.CheckMetaDB(dpath); err != nil { return err } return nil }
[ -0.44270578026771545, 0.2330704927444458, 0.742720365524292, 0.41463005542755127, -0.1678098440170288, 0.4737216532230377, 0.3460504114627838, 0.7278673052787781, 0.6334513425827026, 0.6531247496604919, 0.7245967388153076, 0.9014724493026733, 0.04379807785153389, 0.7146819829940796, -0.1...
func (client *CraneDockerClient) DeployStack(bundle *model.Bundle) error { if bundle.Namespace == "" || !isValidName.MatchString(bundle.Namespace) { return cranerror.NewError(CodeInvalidStackName, "invalid name, only [a-zA-Z0-9][a-zA-Z0-9-]*[a-zA-Z0-9]") } newNetworkMap, err := client.PretreatmentStack(*bundle) ...
[ -0.7322469353675842, 0.8612973690032959, 0.5273469686508179, 0.16396935284137726, 0.026479898020625114, -0.08979427069425583, 1.2673492431640625, -0.37935638427734375, -0.057253818958997726, 0.21328771114349365, -0.27560073137283325, -0.36730825901031494, -0.6237388253211975, 0.56999504566...
func (client *CraneDockerClient) PretreatmentStack(bundle model.Bundle) (map[string]bool, error) { // create network map and convert to slice for distinct network networkMap := make(map[string]bool) // all the publish port in the stack publishedPortMap := make(map[string]bool) for _, serviceSpec := range bundle....
[ -0.4787355661392212, 0.32641974091529846, 0.8739515542984009, -0.4021837115287781, 0.6775669455528259, -0.5400282144546509, 1.234420657157898, -0.6814698576927185, -0.17634059488773346, 0.45419052243232727, -0.041168857365846634, -0.5467286705970764, -0.48627716302871704, 0.662148058414459...
func (client *CraneDockerClient) ListStackService(namespace string, opts types.ServiceListOptions) ([]ServiceStatus, error) { services, err := client.FilterServiceByStack(namespace, opts) if err != nil { return nil, err } return client.GetServicesStatus(services) }
[ -0.5349339246749878, 0.6567755341529846, 0.4765913784503937, 0.712508499622345, 0.5756508708000183, -1.290259599685669, -0.6078857779502869, -1.6004958152770996, 0.12946121394634247, 0.31958311796188354, -0.6385897994041443, 0.6710414886474609, -0.37772032618522644, 1.4918863773345947, -...
func (client *CraneDockerClient) InspectStack(namespace string) (*model.Bundle, error) { services, err := client.FilterServiceByStack(namespace, types.ServiceListOptions{}) if err != nil { return nil, err } stackServices := make(map[string]model.CraneServiceSpec) for _, swarmService := range services { stackS...
[ -0.22599108517169952, 0.5911756157875061, 0.6840842366218567, -0.39236980676651, -0.014602165669202805, -0.8220812082290649, 0.7891114354133606, -1.2792774438858032, 0.046263668686151505, 0.10238709300756454, -0.1364912986755371, 0.23469866812229156, -0.11422017961740494, 1.106987833976745...
func (client *CraneDockerClient) RemoveStack(namespace string) error { services, err := client.FilterServiceByStack(namespace, types.ServiceListOptions{}) if err != nil { return err } for _, service := range services { log.Info("begin to remove service ", service.Spec.Name) if err := client.RemoveService(ser...
[ -0.5260211825370789, 1.3650952577590942, 0.6525037288665771, 0.21974527835845947, 0.6201000213623047, -0.7351462244987488, 0.9122195243835449, -0.38702884316444397, 0.043902330100536346, 0.06547924131155014, -0.14715451002120972, -0.33496490120887756, -0.26111510396003723, 1.31898534297943...
func (client *CraneDockerClient) FilterServiceByStack(namespace string, opts types.ServiceListOptions) ([]swarm.Service, error) { if opts.Filter.Len() == 0 { opts.Filter = filters.NewArgs() } opts.Filter.Add("label", LabelNamespace) services, err := client.ListServiceSpec(opts) if err != nil { return nil, err ...
[ -0.531369149684906, 0.3518880009651184, 0.8152732849121094, 0.21980929374694824, 0.22360891103744507, -0.8074880838394165, -0.20751319825649261, -1.5814968347549438, 0.6007001399993896, 0.5899792313575745, 0.5708599090576172, 0.6825791001319885, -0.6667910218238831, 0.8547007441520691, -...
func (client *CraneDockerClient) getStackFilter(namespace string) filters.Args { filter := filters.NewArgs() filter.Add("label", LabelNamespace+"="+namespace) return filter }
[ 0.13447843492031097, 0.7907404899597168, 0.33698663115501404, 0.2438923865556717, 0.7057301998138428, -0.42040881514549255, -0.2884427309036255, -1.4913170337677002, -0.558422863483429, -0.004468260332942009, -0.8611058592796326, 1.5013985633850098, -0.32195937633514404, 0.9757208824157715...
func (client *CraneDockerClient) filterStackServices(namespace string) ([]swarm.Service, error) { return client.ListServiceSpec(types.ServiceListOptions{Filter: client.getStackFilter(namespace)}) }
[ -0.13142454624176025, 0.914872407913208, 0.37371110916137695, 0.665303647518158, -0.22780553996562958, -1.085815191268921, 0.19777554273605347, -1.7339396476745605, 0.35171186923980713, -0.03139807656407356, -0.0306069515645504, 0.789856493473053, -0.4913212060928345, 1.2070261240005493, ...
func (client *CraneDockerClient) filterStackNetwork(namespace string) ([]docker.Network, error) { filter := docker.NetworkFilterOpts{"label": map[string]bool{LabelNamespace: true}} networks, err := client.ListNetworks(filter) if err != nil { return nil, err } var stackNetwork []docker.Network for _, network :=...
[ -0.26052579283714294, 0.007735195104032755, 0.6578928232192993, 0.4938630163669586, -0.21433080732822418, -0.15935355424880981, -0.4000098705291748, -1.6850121021270752, 0.1933511644601822, 0.6829347014427185, -0.744171142578125, 0.22771181166172028, -0.4208889305591583, 0.8345000743865967...
func (pi *PeerInfo) RequestChat(ctx context.Context, cid ChannelID) (ChatWithPeer, error) { chat := newTalker(pi, cid) // Prioritize the request over a context timeout. // https://groups.google.com/d/msg/golang-nuts/M2xjN_yWBiQ/QzsWuoV4-IIJ select { case pi.requestedSessions <- chat: return chat, nil default: ...
[ -0.4579973518848419, -0.389303594827652, 0.6050523519515991, 0.430283784866333, 0.26149657368659973, -0.13359415531158447, -0.6401607990264893, -1.1488882303237915, 0.7119473218917847, -1.0659847259521484, 0.9812518358230591, 0.14660996198654175, -0.9134063720703125, 0.08952231705188751, ...
func Diff(want, got interface{}) (string, bool, error) { fname1, err := writeToTemp(want) if err != nil { return "", false, err } defer os.Remove(fname1) fname2, err := writeToTemp(got) if err != nil { return "", false, err } defer os.Remove(fname2) cmd := exec.Command("diff", "-u", "--label=want", "--la...
[ -1.365180253982544, -0.16451749205589294, 1.1771174669265747, -0.3043624460697174, -0.37670475244522095, 0.8733268976211548, 0.08020133525133133, -0.31897449493408203, -0.6227946877479553, 0.275647908449173, 0.15567409992218018, 0.03129860758781433, -0.2274000495672226, 0.9003211259841919,...
func convertToBoolean(obj object.Object) (bool, bool) { isValid := object.ObjectIs( obj, object.BooleanObj, object.IntergerObj, object.FloatObj, object.StringObj, object.NullObj, ) return isTruthy(obj), isValid }
[ -0.693071186542511, -1.0481714010238647, 0.7711523175239563, -0.2128068506717682, 0.25548630952835083, 0.04869065061211586, 0.3930432200431824, -0.16803862154483795, 0.3936708867549896, 0.6167464852333069, -1.5154277086257935, 0.09691975265741348, -0.0068460204638540745, 0.2500631809234619...
func getli(size int) []int { a := make([]int, size) list := strings.Split(read(), " ") for i, s := range list { n, _ := strconv.Atoi(s) a[i] = n } return a }
[ 0.3453564941883087, -0.4612515866756439, 0.8557284474372864, -0.9090873599052429, -0.24340027570724487, -0.622456431388855, -0.16305647790431976, 0.2848309278488159, -0.07593711465597153, -0.03654880449175835, -1.3796234130859375, -0.17377543449401855, -0.34879782795906067, -0.460161119699...
func (Server) TableName() string { return "Server" }
[ 0.05490603297948837, -0.2783929109573364, 0.45050156116485596, 1.1716970205307007, -0.7411499619483948, 0.3569395840167999, 0.3098849952220917, 0.7128380537033081, -0.5322469472885132, 0.009257696568965912, -0.70091313123703, 1.4007503986358643, 0.014569848775863647, 0.8593974113464355, ...
func (e Server) String() string { return e.Name }
[ -0.7054117321968079, -1.0602315664291382, 0.23985686898231506, -0.44573917984962463, -0.6016010046005249, 1.0360435247421265, 0.6781148314476013, -0.9642869234085083, 0.014566745609045029, 0.35635536909103394, -0.5512130260467529, 1.071775197982788, -0.3604545295238495, 0.5814325213432312,...
func (e *Server) PropertyNameForDuplicationCheck() string { return "PhysicalUUID" }
[ -0.5265718698501587, -0.42738446593284607, 0.44264304637908936, 0.953991711139679, 0.11358974874019623, 0.6887596249580383, 0.14217208325862885, 0.4643752872943878, -0.06553615629673004, -0.1669943779706955, 0.7975518703460693, -0.15113799273967743, 0.4284857511520386, -0.37803760170936584...
func (e *Server) Preload() []string { return []string{ "Processors", "Memory", "EthernetInterfaces", "EthernetInterfaces.IPv4Addresses", "EthernetInterfaces.IPv6Addresses", "EthernetInterfaces.VLANs", "NetworkInterfaces", "Storages", "Storages.StorageControllers", "Power", "Power.PowerControl", ...
[ -0.6400858759880066, -0.3449263274669647, 0.9044220447540283, -0.9705876708030701, 0.2590341866016388, 0.5773522853851318, -0.2922959625720978, -0.3656756579875946, 0.6896645426750183, 0.4264061152935028, -0.7657572031021118, -0.5466257929801941, -0.6139616370201111, 0.17266929149627686, ...
func (e *Server) Association() []interface{} { ret := []interface{}{} for _, x := range e.Processors { ret = append(ret, &x) } for _, x := range e.Memory { ret = append(ret, &x) } for _, x := range e.EthernetInterfaces { for _, y := range x.IPv4Addresses { ret = append(ret, &y) } for _, y := range x....
[ -1.3203157186508179, -0.5213043093681335, 0.7577112913131714, -0.4062546491622925, 0.18158447742462158, -0.12577132880687714, 0.42028844356536865, -0.3092045187950134, -0.0011516683734953403, 0.7142501473426819, -0.22977466881275177, 0.028485694900155067, 0.5214548110961914, 0.910081326961...
func (e *Server) Tables() []interface{} { return []interface{}{ new(Location), new(PostalAddress), new(Placement), new(Server), new(Processor), new(Memory), new(EthernetInterface), new(IPv4Address), new(IPv6Address), new(VLanNetworkInterface), new(NetworkInterface), new(Storage), new(StorageC...
[ -0.98648601770401, 0.41571497917175293, 0.6143115162849426, -0.1385965347290039, 0.15988856554031372, 0.333362877368927, 0.06833896785974503, -0.3673335909843445, 0.2112807184457779, -0.3430812358856201, -1.1638296842575073, -0.02257486619055271, -0.2915913760662079, 0.7412334084510803, ...
func (e *Server) FilterNameList() []string { return []string{ "State", "Name", "Health", "Description", "PhysicalUUID", "Hostname", "Vender", "PowerState", "IndicatorLED", "Model", "Manufacturer", "SerialNumber", "PartNumber", "SparePartNumber", "AssetTag", } }
[ -0.38150283694267273, -0.38613635301589966, 0.5412659049034119, -0.4830559492111206, -0.6110506653785706, 0.5616500973701477, -1.054333209991455, -0.4504825472831726, 0.5252881646156311, 0.46490657329559326, -1.3416697978973389, 0.4931986927986145, -0.528522789478302, 0.7021573185920715, ...