text
stringlengths
11
6.3k
embedding
listlengths
768
768
func NewCreateLocationUnprocessableEntity() *CreateLocationUnprocessableEntity { return &CreateLocationUnprocessableEntity{} }
[ -0.22420351207256317, -0.3400082290172577, 0.35764452815055847, -0.5188269019126892, 0.011007964611053467, -0.14059269428253174, 0.8704180717468262, 1.0866217613220215, -0.5975799560546875, 0.699677586555481, -0.34967827796936035, -0.7272441983222961, -0.29730224609375, -0.0686903595924377...
func NewCreateLocationTooManyRequests() *CreateLocationTooManyRequests { return &CreateLocationTooManyRequests{} }
[ -1.2700073719024658, -0.1303967982530594, -0.0036556448321789503, -0.02493942901492119, 0.3624831736087799, -0.41026991605758667, -0.2002781629562378, -0.192740336060524, 0.18786782026290894, 0.6057194471359253, -0.46769261360168457, -1.2912172079086304, -0.10398014634847641, 0.24989321827...
func NewCreateLocationDefault(code int) *CreateLocationDefault { return &CreateLocationDefault{ _statusCode: code, } }
[ -0.3244350850582123, 0.22651736438274384, -0.07449677586555481, 0.21188189089298248, 1.0782634019851685, 0.29292619228363037, 0.5906763672828674, 0.27147170901298523, 0.12438544631004333, 0.12850365042686462, -1.1303097009658813, -0.8961982727050781, -0.7504879832267761, 0.3350597321987152...
func (o *CreateLocationDefault) Code() int { return o._statusCode }
[ -0.6888918876647949, 0.0992136001586914, 0.1803249567747116, 0.5895925760269165, 0.893966555595398, 0.5715095400810242, 0.7376787066459656, 0.7952813506126404, 0.10605156421661377, -0.33372172713279724, -0.3913083076477051, -0.7041527628898621, -0.31498751044273376, 0.476784348487854, -0...
func (s *KeyAgentTestSuite) TestAddKey(c *check.C) { // make a new local agent lka, err := NewLocalAgent(s.keyDir, s.hostname, s.username) c.Assert(err, check.IsNil) // add the key to the local agent, this should write the key // to disk as well as load it in the agent _, err = lka.AddKey(s.key) c.Assert(err, c...
[ 0.17936071753501892, -0.37143269181251526, 0.5915642380714417, -0.01082063838839531, 0.5091580748558044, 0.1170497015118599, -0.060651492327451706, 0.3638385236263275, 0.26692983508110046, -0.38127467036247253, -0.04112580046057701, 0.0018891749205067754, -0.042840395122766495, 0.544222235...
func (s *KeyAgentTestSuite) TestLoadKey(c *check.C) { userdata := []byte("hello, world") // make a new local agent lka, err := NewLocalAgent(s.keyDir, s.hostname, s.username) c.Assert(err, check.IsNil) // unload any keys that might be in the agent for this user err = lka.UnloadKey() c.Assert(err, check.IsNil) ...
[ -0.09544166922569275, -0.20369644463062286, 0.6527462601661682, -0.09389303624629974, 0.10011257231235504, 0.01828884333372116, -0.05452620983123779, 0.4239839017391205, 0.21640633046627045, -0.5353432297706604, -0.33519336581230164, -0.0637514591217041, -0.4731273055076599, 0.733717322349...
func (c *Config) Bind(f *pflag.FlagSet) { c.BaseConfig.Bind(f) // We set the targetDB based on the value in the incoming HTTP // request. if err := f.MarkHidden("targetDB"); err != nil { panic(err) } f.IntVar(&c.IdealFlushBatchSize, "idealFlushBatchSize", defaultFlushBatchSize, "try to apply at least this m...
[ -0.7955563068389893, 0.030191220343112946, 0.4606756269931793, -0.3755020201206207, 0.6901446580886841, 0.023032598197460175, 0.20337696373462677, -0.41250526905059814, -1.020887851715088, -0.41259926557540894, -0.26732373237609863, 0.29901817440986633, 0.4850046932697296, 1.01044213771820...
func NewAddresser() Addresser { return &addresser{execute: rtnlExecute} }
[ -0.597072958946228, -0.9141989946365356, 0.06280643492937088, 0.3070744574069977, -0.4005446434020996, -0.31853315234184265, -0.9919964671134949, 0.15501049160957336, 0.3544437289237976, -0.9588674902915955, 0.2509201467037201, 0.4924641251564026, -0.7206977605819702, 1.5170097351074219, ...
func rtnlExecute(m rtnetlink.Message, family uint16, flags netlink.HeaderFlags) ([]rtnetlink.Message, error) { c, err := rtnetlink.Dial(nil) if err != nil { return nil, err } defer c.Close() // Socket options are applied on a best-effort basis because they may not be // supported on older Linux kernel versions...
[ 0.23023124039173126, 0.17704370617866516, 0.5873863697052002, 0.2699456810951233, 0.43844839930534363, -0.7152629494667053, -0.984507143497467, -0.40564799308776855, -0.1738390475511551, 0.48407018184661865, 0.21083547174930573, -0.5192014575004578, -0.7014923095703125, 0.7433456778526306,...
func RunGhost() { if !isRunning { isRunning = true main() } }
[ 0.1263326108455658, 0.4054133892059326, 0.4754827618598938, 1.1812124252319336, 1.3142449855804443, 1.1272106170654297, -0.11680580675601959, 0.27841606736183167, -0.918014407157898, 0.2609873414039612, -0.43274468183517456, 0.9790765643119812, -1.441208839416504, 0.5597789883613586, 0.3...
func VoidFunc() { main() }
[ 0.9541653394699097, -0.12703607976436615, 0.17466634511947632, 0.6074368953704834, 0.5934815406799316, 0.23643937706947327, 1.5482594966888428, 0.7009257078170776, 0.02899656444787979, 0.236448734998703, 0.25174787640571594, 1.4412124156951904, 0.9009809494018555, -0.14104418456554413, -...
func DllInstall() { main() }
[ 1.1454095840454102, -0.6492019295692444, 0.4311385750770569, 0.38505131006240845, -0.060746029019355774, 0.2657791078090668, 0.27093738317489624, 0.49565714597702026, 0.9951921105384827, 0.8254027366638184, -0.02440924383699894, 0.574315071105957, 0.44386395812034607, 0.15488335490226746, ...
func DllRegisterServer() { main() }
[ -0.337805837392807, -0.423541784286499, 0.31044474244117737, -0.23424360156059265, 1.1556779146194458, -0.2751171588897705, 0.4052679240703583, 0.6904520392417908, 0.189509779214859, 0.1435142457485199, -0.5518448948860168, 0.9391117095947266, -0.8650906682014465, 0.46819841861724854, 0....
func DllUnregisterServer() { main() }
[ -0.573311984539032, -0.0542282909154892, 0.21786656975746155, -0.17503559589385986, 0.5652603507041931, -0.14098453521728516, 0.7704199552536011, 1.0268731117248535, 0.5820655822753906, 0.043121371418237686, -0.636342465877533, 1.389317274093628, -0.5704967975616455, 0.8333464860916138, ...
func (s *Socket) Read() (p *Packet, err error) { s.RLock() conn := s.Conn s.RUnlock() if err = conn.SetReadDeadline(time.Now().Add(s.readTimeout)); err != nil { return } p, err = conn.ReadPacket() return }
[ -0.2979116439819336, 0.194582000374794, 0.4652251899242401, -0.006595775485038757, -0.9536433219909668, 0.05596644803881645, -0.9654344320297241, -0.057193823158741, -0.12716133892536163, -0.23643144965171814, 0.46345704793930054, 1.1397802829742432, -0.5708122849464417, -0.250811547040939...
func (s *Socket) Close() (err error) { s.once.Do(func() { s.hasBeenClosed = true s.emitter.close() err = s.Conn.Close() }) return }
[ -0.5538774728775024, 0.46458449959754944, 0.565506100654602, -0.7542120814323425, 0.17379705607891083, -0.3643566966056824, 0.24002720415592194, 0.234629824757576, -0.3489550054073334, -1.1936753988265991, 0.057531461119651794, 0.87947678565979, -0.8085175156593323, 1.4649803638458252, 0...
func (s *Socket) Emit(event event, msgType MessageType, args interface{}) (err error) { var pktType PacketType switch event { case EventOpen: pktType = PacketTypeOpen case EventMessage: pktType = PacketTypeMessage case EventClose: pktType = PacketTypeClose // case EventError: // case EventUpgrade: case Ev...
[ -1.169983983039856, 0.35849857330322266, 0.9616236090660095, -0.47571873664855957, -0.3792918622493744, -0.02621288411319256, -0.8061287999153137, -0.5062751770019531, 0.3945160508155823, -0.10426881909370422, -0.4770570695400238, 1.1019890308380127, -0.6300360560417175, 0.6430748701095581...
func (s *Socket) Send(args interface{}) (err error) { return s.Emit(EventMessage, MessageTypeString, args) }
[ -0.7721025347709656, 0.5881568789482117, 0.35250240564346313, 0.2163964807987213, 0.37037667632102966, -0.14809978008270264, -0.22727780044078827, -0.5362027287483215, -0.21266229450702667, 0.22124415636062622, -0.1797928810119629, 1.12553071975708, -0.9232942461967468, 1.129186987876892, ...
func (s *Socket) Sid() string { return s.id }
[ 0.6828533411026001, -0.23594404757022858, 0.4584493041038513, -0.4710449278354645, -0.7902197241783142, 0.4351944625377655, -0.16771931946277618, -0.42544806003570557, 1.4660913944244385, -0.5669897198677063, -0.5307320952415466, 1.7168662548065186, -0.2981589436531067, -0.6822686791419983...
func (s *Socket) HasBeenClosed() bool { return s.hasBeenClosed }
[ 0.7704092264175415, 0.20028188824653625, 0.6852428913116455, -0.5545688271522522, 0.08829452842473984, 0.0021944986656308174, 0.6212752461433411, 0.38177722692489624, -0.39660850167274475, -0.5867565870285034, -0.09018867462873459, 0.5403597354888916, -0.12733082473278046, 1.09416711330413...
func (s *Socket) SetHasBeenClosed(state bool) { s.hasBeenClosed = state }
[ 1.1620814800262451, 0.09621287882328033, 0.47612202167510986, -0.3860100507736206, 0.22901558876037598, 0.8634335994720459, 0.5320863127708435, 0.27131837606430054, -0.5501533150672913, -0.24348749220371246, -0.26278820633888245, 0.479163259267807, 0.5798918604850769, 1.2719039916992188, ...
func (s *Socket) GetHeader(key string) (val string) { s.RLock() val = s.Conn.httpHeader().Get(key) s.RUnlock() return }
[ -0.8046608567237854, 0.2441895306110382, 0.48564305901527405, 0.8069022297859192, -1.0176342725753784, -0.3239774703979492, -0.5442723631858826, -1.633089542388916, -0.573951005935669, 0.47437646985054016, 0.2219000607728958, 0.3966955542564392, -1.7303736209869385, 0.25104159116744995, ...
func (s *Socket) SetHeader(key, value string) { s.Lock() s.Conn.httpHeader().Set(key, value) s.Unlock() }
[ -0.7219859957695007, 0.042631641030311584, 0.482829213142395, -0.0009483019821345806, -0.9571809768676758, 0.3789110779762268, -1.1511945724487305, -0.6191194653511047, -0.5553700923919678, 0.2955518662929535, -0.19589824974536896, 0.8681585788726807, -0.8744925260543823, -0.04321716725826...
func (*mockConnection) WriteWireMessage(ctx context.Context, wm wiremessage.WireMessage) error { select { case <-ctx.Done(): return errors.New("intentional mock error") default: return nil } }
[ -1.733514428138733, 0.038574326783418655, 0.3726087808609009, -0.011100498028099537, 1.4594966173171997, -0.05283462628722191, 0.13901551067829132, -0.5308597683906555, -0.26278382539749146, 0.3241730034351349, -0.6085097193717957, -0.15091754496097565, -1.7982393503189087, 1.1748626232147...
func (m *mockConnection) ReadWireMessage(ctx context.Context) (wiremessage.WireMessage, error) { if m.writes < 4 { // write empty batch d := createOKBatchReplyDoc(2, bsonx.Arr{}) return internal.MakeReply(m.t, d), nil } else if m.willErr { // write error return nil, errors.New("intentional mock error") } ...
[ -0.6713095307350159, 0.21069848537445068, 0.5166546702384949, -0.4749612510204315, 0.7028586268424988, -0.3270123302936554, 0.012121249921619892, -0.9007393717765808, -0.2505260407924652, 0.1278906613588333, 0.6114963293075562, 0.1358468234539032, -1.432443618774414, 0.3214804232120514, ...
func assignRequestID(r *http.Request) *http.Request { ctx := c.AddRequestIDToCTX(r.Context(), uuid.New().String()) return r.WithContext(ctx) }
[ -0.826682448387146, -0.9364271759986877, 0.39848634600639343, 0.5046027302742004, -0.18161170184612274, 0.8808766007423401, -0.634567141532898, 0.5607780814170837, 0.7174070477485657, 0.5174006819725037, 0.969758927822113, 0.5430733561515808, -0.04350956529378891, 0.16051656007766724, -1...
func AssignRequestIDHandler(next http.Handler) http.Handler { return http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) { r = assignRequestID(r) id, _ := c.GetRequestID(r) w.Header().Set(HTTPHeaderNameRequestID, id) next.ServeHTTP(w, r) }) }
[ -0.8666026592254639, -1.8567478656768799, 0.49925217032432556, 0.37406542897224426, -0.8171237111091614, 0.7758311033248901, 0.14729386568069458, -0.5587257742881775, 0.030713800340890884, 0.6260384917259216, 0.04422030225396156, -0.010006553493440151, -0.42264121770858765, 0.4949136972427...
func GetRandomNameWithHyphen(retry int) string { name := strings.Replace(namesgenerator.GetRandomName(retry), "_", "-", 1) return name }
[ -0.2568295896053314, -0.22020643949508667, 0.8439968824386597, -0.2164340615272522, -0.5386004447937012, 0.29544559121131897, -1.060564398765564, 0.4271145462989807, 0.012060604058206081, -0.1759553700685501, -1.0927391052246094, 0.13528110086917877, 0.2391093522310257, -0.288958340883255,...
func Create(name, dir, ext string, t time.Time) error { if name == "" { fmt.Println("name is required") return errors.New("name is required") } if dir == "" { fmt.Println("dir is required") return errors.New("dir is required") } if ext == "" { fmt.Println("ext is required") return errors.New("ext is ...
[ 0.15938198566436768, -0.12441391497850418, 0.8947984576225281, 0.48680850863456726, -0.12588287889957428, 0.8058626651763916, -0.08546151965856552, 0.20683720707893372, -1.0417145490646362, 0.3720264136791229, -0.02619381807744503, -0.10163816064596176, 0.33890408277511597, 0.5934926867485...
func ParseAST(stream *lexer.LexemeReader) (*AST, error) { ast, lexeme, err := parseAST(stream) if err != nil { return nil, err } if lexeme != nil { return nil, ErrorUnexpectedStartLexeme(*lexeme) } return ast, nil }
[ 0.11944286525249481, -0.8328589797019958, 0.47099167108535767, -0.21798847615718842, -1.505096435546875, -0.3277446925640106, -0.3275551199913025, -0.2131490856409073, 0.5024636387825012, 0.11722539365291595, 0.2957572340965271, 0.3456283211708069, 0.022836342453956604, 0.19927817583084106...
func (a *AST) Merge(overwrite AST) { blocks := map[string][]*Block{} for i, block := range a.Blocks { list, ok := blocks[block.Name] if !ok { list = []*Block{} } list = append(list, &a.Blocks[i]) blocks[block.Name] = list } blockIndices := map[string]int{} for _, block := range overwrite.Bl...
[ -1.1203851699829102, -0.23661023378372192, 1.0357110500335693, -0.4725508391857147, -0.41272857785224915, -1.043095588684082, -0.05945540592074394, 0.1851387768983841, -0.4292571246623993, 0.6044484972953796, -0.35809704661369324, -0.06623712927103043, -0.5019965171813965, 1.31931126117706...
func (c cell) IsValid() bool { return c.contentHandler != nil }
[ 0.663539707660675, -0.3068239092826843, 0.3051392436027527, 0.5696204900741577, 0.028747571632266045, 1.0056475400924683, 0.06923185288906097, 0.12181352078914642, 0.09406791627407074, -1.0780038833618164, -0.18763665854930878, -0.30885419249534607, -0.5812672972679138, 0.11998506635427475...
func (c cell) IsHyperLink() bool { _, ok := c.contentHandler.(*HyperLink) return ok }
[ 0.016736134886741638, 0.17716769874095917, 0.3527013659477234, 1.1055688858032227, 0.17791607975959778, -0.14070698618888855, 0.5077469348907471, 0.6104470491409302, 0.011051272973418236, -1.0996415615081787, -1.0402060747146606, 0.1138027012348175, -0.5314769744873047, 0.35992056131362915...
func (c cell) MustHpyerLink() *HyperLink { return c.contentHandler.(*HyperLink) }
[ 0.04308391362428665, 0.418657511472702, 0.2601184844970703, 0.678839921951294, 0.29900965094566345, 0.4925471246242523, -0.6366235017776489, 0.30015498399734497, -0.31661278009414673, -0.6094480156898499, -0.3477884531021118, -0.5367109179496765, -0.4757518172264099, 1.3834903240203857, ...
func (c cell) IsNumber() bool { _, ok := c.contentHandler.(*NumberCol) return ok }
[ -0.43366700410842896, 0.3951117992401123, 0.25959956645965576, 1.6515533924102783, 0.38286131620407104, 0.044384848326444626, 0.7034769058227539, -0.5014742612838745, -0.4718164801597595, -0.48503226041793823, -0.9163390398025513, -0.5934380292892456, -0.5631375908851624, 0.373173117637634...
func (c cell) MustNumber() *NumberCol { return c.contentHandler.(*NumberCol) }
[ 0.24318471550941467, 0.26644057035446167, 0.24407505989074707, 1.2538652420043945, 0.2048313170671463, 0.6316908597946167, 0.27584683895111084, -0.46656107902526855, 0.03099689446389675, -0.9345470070838928, -0.234914630651474, -0.9968805909156799, 0.014698531478643417, 0.00033266204991377...
func (c cell) IsFormula() bool { _, ok := c.contentHandler.(*FormulaCol) return ok }
[ -0.47938573360443115, 0.030785560607910156, 0.3479829430580139, 1.320412039756775, -0.06734775751829147, -0.41026273369789124, 0.13186371326446533, -0.2732258141040802, -0.13813866674900055, -0.7237446904182434, 0.028558433055877686, 0.016577092930674553, -0.09965216368436813, 0.8385126590...
func (c cell) MustFormula() *FormulaCol { return c.contentHandler.(*FormulaCol) }
[ 0.029568899422883987, -0.3234332203865051, 0.3785770833492279, 0.7237264513969421, -0.35280317068099976, 0.3707505166530609, -0.2232937514781952, -0.6872722506523132, -0.5377976298332214, -0.9154270887374878, 0.40794891119003296, -0.6664411425590515, 0.4344777464866638, 0.9825313687324524,...
func (c cell) IsBlank() bool { _, ok := c.contentHandler.(*BlankCol) return ok }
[ -0.6345193386077881, 0.4495690166950226, 0.36425378918647766, 1.0412434339523315, 1.1163076162338257, -0.21376748383045197, 0.3662392795085907, -1.0571259260177612, -0.1126023679971695, 0.5572722554206848, -0.6525035500526428, 0.39310580492019653, -0.03880169987678528, -0.2252957969903946,...
func (c cell) MustBlank() *BlankCol { return c.contentHandler.(*BlankCol) }
[ 0.21557554602622986, 0.7406083941459656, 0.34161242842674255, 0.8651909828186035, 0.5383912324905396, 0.8154891133308411, 0.2645500898361206, -1.0801162719726562, -0.08052822947502136, 0.3585340082645416, -0.4917471408843994, -0.08353284001350403, 0.7304936051368713, -0.5691714882850647, ...
func (c cell) IsRk() bool { _, ok := c.contentHandler.(*RkCol) return ok }
[ -0.47129425406455994, 0.4080178439617157, 0.3455909788608551, 1.1747162342071533, 0.44459646940231323, -0.214514821767807, 0.5389507412910461, -0.6082947850227356, -0.4307115972042084, 0.20902885496616364, -0.30465519428253174, -0.08328985422849655, -0.8644406795501709, 0.4763144552707672,...
func (c cell) MustRk() *RkCol { return c.contentHandler.(*RkCol) }
[ 0.07417836785316467, 0.6840317249298096, 0.33649149537086487, 1.1322102546691895, 0.1481335461139679, 0.11793526262044907, 0.3366205394268036, -0.9523112177848816, -0.21232552826404572, 0.020309731364250183, -0.12908263504505157, -0.4671507179737091, 0.27705076336860657, 0.5177050828933716...
func (s *CreateCmdSuite) TestCreateCmd() { ts := time.Date(2000, 12, 25, 00, 01, 02, 3456789, time.UTC) tsUnixStr := strconv.FormatInt(ts.Unix(), 10) tsUnixNanoStr := strconv.FormatInt(ts.UnixNano(), 10) testCwd := s.mustGetwd() cases := []struct { tid string existingDirs []string // directory path...
[ 0.009998859837651253, -0.7066824436187744, 0.8619399666786194, -0.077214814722538, 0.1096014529466629, 0.13776610791683197, 1.4879847764968872, -0.5384670495986938, 0.13154728710651398, -0.22169843316078186, -0.2945530414581299, -0.32036182284355164, 0.31517958641052246, 0.8090611100196838...
func ReadUAsFromCSV(f string) UAs { r, err := os.Open(f) if err != nil { panic(err) } defer r.Close() data, err := csv.NewReader(r).ReadAll() if err != nil { panic(err) } uas := make(UAs, len(data)) for i, line := range data { uas[i] = NewUAFromLine(line) } return uas }
[ -0.221333310008049, -0.0328676700592041, 0.3956301510334015, -0.009239469654858112, -0.845102846622467, 0.5640400052070618, -0.19710394740104675, 0.34650859236717224, 0.5203966498374939, -0.11124264448881149, 0.6483469009399414, 0.3019355535507202, 0.9931381940841675, -0.6619237661361694, ...
func (uas UAs) Matches(s string) UAs { if matches, ok := MatchesCache.Get(s); ok { return matches.(UAs) } matchedUAs := make(UAs, 0) for _, ua := range uas { if ua != nil { if ua.Pattern.Match(s) { matchedUAs = append(matchedUAs, ua) } } } MatchesCache.Add(s, matchedUAs) return matchedUAs }
[ -0.9622039198875427, 0.014620485715568066, 0.4146856367588043, 0.26957979798316956, -0.14384351670742035, -0.6169633865356445, 0.13705141842365265, 0.5365289449691772, 1.7651969194412231, -0.5541637539863586, -0.041278306394815445, -0.15389883518218994, 0.2719314992427826, -0.6279853582382...
func (uas UAs) TopMatch(s string) *UA { if match, ok := TopMatchesCache.Get(s); ok { return match.(*UA) } m := uas.Matches(s) if len(m) < 1 { return nil } q := &matchQuery{ua: s, uas: m} sort.Sort(q) TopMatchesCache.Add(s, q.uas[0]) return q.uas[0] }
[ 0.00507219647988677, 0.019863415509462357, 0.7111635208129883, 0.43254923820495605, -1.116685152053833, 0.002079467521980405, 0.5102009177207947, -0.04934817925095558, 1.8813871145248413, -0.7481164932250977, 0.576203465461731, 0.1515231430530548, 0.024046553298830986, -0.8767505288124084,...
func New() *Rest { return &Rest{ client: http.Client{ Timeout: httpTimeout, }, } }
[ 0.6543789505958557, -1.0004332065582275, 0.1087876558303833, -0.06161554530262947, -0.696401059627533, 0.16501417756080627, -0.9859906435012817, -0.22064071893692017, -0.2724728286266327, -0.009240446612238884, -0.1244182288646698, 0.5436590909957886, -0.024611691012978554, -0.502347350120...
func (r *Rest) PostEvent(url *types.URI, e event.Event) error { b, err := json.Marshal(e) if err != nil { log.Errorf("error marshalling event %v", e) return err } if status := r.Post(url, b); status == http.StatusBadRequest { return fmt.Errorf("post returned status %d", status) } return nil }
[ -0.24974879622459412, 0.13840928673744202, 0.8169013857841492, 0.05307963490486145, 0.12374458461999893, 0.47125864028930664, -0.8476598858833313, 0.610778272151947, 0.0981152132153511, -0.31444674730300903, -0.4626551866531372, 0.07458803057670593, -0.4102431535720825, 0.0668400228023529,...
func (r *Rest) PostHwEvent(url *types.URI, e hwevent.Event) error { b, err := json.Marshal(e) if err != nil { log.Errorf("error marshalling event %v", e) return err } if status := r.Post(url, b); status == http.StatusBadRequest { return fmt.Errorf("post returned status %d", status) } return nil }
[ -0.1998564749956131, 0.2699267268180847, 0.8938597440719604, 0.5527684688568115, 0.5175984501838684, 0.5190423727035522, -0.29618099331855774, 0.2292236089706421, 0.022143980488181114, -0.31083858013153076, -1.1821974515914917, -0.36229783296585083, -0.5776041746139526, 0.5471267104148865,...
func (r *Rest) Post(url *types.URI, data []byte) int { ctx := context.Background() ctx, cancel := context.WithCancel(ctx) defer cancel() request, err := http.NewRequestWithContext(ctx, "POST", url.String(), bytes.NewBuffer(data)) if err != nil { log.Errorf("error creating post request %v", err) return http.Sta...
[ 0.05228717252612114, -0.15321499109268188, 1.150217890739441, 0.5665217041969299, -0.49461284279823303, -0.04975012317299843, -0.5299824476242065, -0.29101991653442383, -0.20560775697231293, -0.9902645945549011, -0.08095671236515045, 0.29028427600860596, -1.413763403892517, -0.062404748052...
func (r *Rest) PostWithReturn(url *types.URI, data []byte) (int, []byte) { ctx := context.Background() ctx, cancel := context.WithCancel(ctx) defer cancel() request, err := http.NewRequestWithContext(ctx, "POST", url.String(), bytes.NewBuffer(data)) if err != nil { log.Errorf("error creating post request %v", er...
[ -0.25942641496658325, -0.8220948576927185, 1.2008963823318481, 0.23462766408920288, -0.16607573628425598, -0.5120977759361267, -0.34333598613739014, -0.36590805649757385, 0.24003784358501434, -0.20796199142932892, -1.0665727853775024, 0.07970841974020004, -1.2628960609436035, -0.1108766943...
func NewOMXPlayer(filename string, testing bool, debug bool, cmd spyCmd) (*OMXPlayer, error) { if testing && cmd == nil { return nil, fmt.Errorf("cmd cannot be nil if testing") } omx := OMXPlayer{ testing: testing, cmd: cmd, } // OMXPlayer command flags. args := []string{ "--blank", // Set th...
[ -0.5527232885360718, -0.8329673409461975, 0.580932080745697, 0.3752366602420807, -0.991653561592102, -0.4316118359565735, 0.16339634358882904, -0.2121497392654419, 1.0317308902740479, -0.10716284066438675, 0.26882925629615784, -0.001446331269107759, -1.2618855237960815, 0.34816253185272217...
func (o *OMXPlayer) Open(waiting chan string) error { o.status = statusStarting // Close OMXPlayer if it's already running if err := o.Close(); err != nil { // TODO wrap error here with the new errors thing return err } if err := o.cmd.Start(); err != nil { o.status = statusError return err } o.status...
[ -0.7726562023162842, -0.5960118770599365, 0.7389030456542969, 0.25065019726753235, -0.6850512027740479, 0.43250465393066406, 0.4298464357852936, 0.6853081583976746, 0.47591882944107056, -0.3475129306316376, 0.029454801231622696, -0.05077853798866272, -0.6054782867431641, 0.0598767884075641...
func (o *OMXPlayer) Close() error { if o.status != statusPlaying { return nil } o.status = statusClosing o.closing = make(chan error) defer close(o.closing) o.status = statusStopped return nil }
[ -0.3481099009513855, -0.45032382011413574, 0.49869096279144287, 0.3693419098854065, -1.0245800018310547, 0.7034908533096313, 0.132796972990036, -0.44356751441955566, 0.3701280355453491, -0.5356815457344055, 0.26616954803466797, 0.05337362736463547, -0.7277408838272095, 0.30035004019737244,...
func (o *OMXPlayer) dbusSend(method string, args ...interface{}) (string, error) { // Skip this if testing. I'll have to mock the dbus package to test this properly. // TODO: mock dbus package to test this properly. if o.testing { return "", nil } obj := o.dbConn.Object(dbDestination, dbPath) call := obj.Call(...
[ -1.0114915370941162, 0.9631227850914001, 0.6573612689971924, -0.03520571440458298, -0.048489153385162354, -0.4814516603946686, -0.7332276701927185, -0.790527880191803, 0.4833807945251465, 0.20954938232898712, -0.2665236294269562, 0.585416316986084, -0.7608620524406433, 0.3404524028301239, ...
func (o *OMXPlayer) Play() error { if o.status == statusPlaying { return nil } // TODO: test this properly by mocking dbus package. if o.testing { o.status = statusPlaying return nil } _, err := o.dbusSend("Play", dbus.FlagNoAutoStart) if err != nil { return err } o.status = statusPlaying return nil...
[ -0.16386964917182922, 0.571408212184906, 0.4676263928413391, 0.8197197914123535, 0.4204322099685669, -0.14952290058135986, 0.19262006878852844, -0.36365920305252075, 0.6640777587890625, -0.7815443277359009, 0.09515072405338287, -0.03953375294804573, -0.7548739910125732, -0.2318169623613357...
func (o *OMXPlayer) Pause() error { if o.status == statusPaused { return nil } // TODO: test this properly by mocking dbus package. if o.testing { o.status = statusPaused return nil } _, err := o.dbusSend("Pause", dbus.FlagNoAutoStart) if err != nil { return err } o.status = statusPaused return nil ...
[ -0.517673909664154, 0.40893661975860596, 0.4866825342178345, 0.7225161194801331, 1.024045467376709, -0.7299644351005554, 0.20238055288791656, -0.4004388153553009, 1.1660094261169434, -0.7023086547851562, -0.34505048394203186, -0.15691854059696198, -1.0456384420394897, -0.15148817002773285,...
func (o *OMXPlayer) Stop() { }
[ -1.3151628971099854, -0.8398802876472473, 0.26839521527290344, 0.5210685729980469, -0.46690037846565247, 0.5012967586517334, 0.453233927488327, 0.05905007943511009, 0.3120027780532837, -0.029696160927414894, -0.7837436199188232, 0.3783562481403351, -1.3482277393341064, -0.18246039748191833...
func (o *OMXPlayer) Chapter(chapter int) int { return -1 }
[ -1.145324945449829, -0.8202505707740784, 0.5416722893714905, 1.1378687620162964, -0.46224895119667053, -0.062486905604600906, 1.0075690746307373, 0.2720019519329071, -0.11144769936800003, -0.25618305802345276, 0.4055275619029999, -0.47672736644744873, -0.4504552185535431, 0.757708132266998...
func (o *OMXPlayer) Seek(microseconds int64, whence int) (int64, error) { return -1, nil }
[ -0.6841951608657837, 0.7185790538787842, 0.3626765012741089, 0.368972510099411, -0.7848566770553589, -0.06345134228467941, 0.8906229734420776, -0.6259177327156067, 0.3779977560043335, -0.7387158274650574, -0.24718855321407318, 0.06525859981775284, -1.267867088317871, -0.2710030674934387, ...
func (o *OMXPlayer) Position(microseconds int64) int64 { return -1 }
[ -0.9005404710769653, -0.1371861696243286, 0.43996360898017883, 0.9230118989944458, -0.675159752368927, -0.14057974517345428, 0.7734168171882629, 0.16036871075630188, 0.21230678260326385, -0.2223827987909317, -0.25901466608047485, -1.0508205890655518, -1.2154957056045532, 0.0098843714222311...
func (o *OMXPlayer) PlaybackRate(rate float64) float64 { return 0 }
[ 0.27222904562950134, 0.07945441454648972, 0.4068874716758728, 0.6884517669677734, -0.8991578221321106, -0.5278397798538208, -0.30383267998695374, -0.24381200969219208, 0.373515248298645, -0.12410043179988861, 1.4305261373519897, -0.9537032842636108, -1.1588735580444336, 0.6346285343170166,...
func (o *OMXPlayer) AudioStream(index int) int { return -1 }
[ -1.058906078338623, -0.6914987564086914, 0.5242058038711548, 0.308993935585022, -0.2326737344264984, -0.366589218378067, 0.8099570274353027, -0.8026813268661499, 0.5750115513801575, -0.6044905781745911, 0.2950645387172699, -0.12067138403654099, -0.7628428339958191, 0.1976945698261261, -0...
func (o *OMXPlayer) VideoStream(index int) int { return -1 }
[ -0.8756582140922546, -0.3563614785671234, 0.5237975120544434, 1.007441759109497, -0.1723359376192093, -0.9367482662200928, 0.3761651813983917, -0.29789939522743225, 1.1401716470718384, -0.5627396702766418, -0.6426509022712708, 0.46493324637413025, -0.8050133585929871, 0.4648708999156952, ...
func (o *OMXPlayer) SubtitleStream(index int) int { return -1 }
[ -0.4611290693283081, -0.1834907978773117, 0.7234522700309753, 0.6565613150596619, -0.8979370594024658, -0.08358605951070786, 0.32498395442962646, 0.07405470311641693, 0.01636449433863163, -0.3337733745574951, -0.38303905725479126, 0.1549891233444214, -0.8561807870864868, 0.1516480743885040...
func (o *OMXPlayer) Volume(volume float64) float64 { return -1 }
[ -0.8729787468910217, 0.09294050931930542, 0.452966570854187, 0.8605833053588867, 0.3236750662326813, -0.3958103060722351, 0.9196653366088867, -0.3404145836830139, -0.5042517185211182, -0.5562626719474792, 0.5179665088653564, -0.4678694009780884, -1.458802342414856, 0.19906768202781677, 0...
func assembleK8sManifest(m model.Manifest, k model.K8sTarget, iTargets ...model.ImageTarget) model.Manifest { ids := make([]model.TargetID, 0, len(iTargets)) for _, iTarget := range iTargets { ids = append(ids, iTarget.ID()) } k = k.WithDependencyIDs(ids) return m. WithImageTargets(iTargets). WithDeployTarge...
[ -0.7836822271347046, -1.2084593772888184, 0.422412246465683, -0.3354908525943756, -0.12304016947746277, -0.3284528851509094, -1.8269660472869873, 0.32757139205932617, 0.1655912548303604, 0.8096348643302917, 0.20619022846221924, 0.16223585605621338, 0.4917643368244171, -0.10420161485671997,...
func assembleDCManifest(m model.Manifest, iTargets ...model.ImageTarget) model.Manifest { ids := make([]model.TargetID, 0, len(iTargets)) for _, iTarget := range iTargets { ids = append(ids, iTarget.ID()) } dc := dcTarg.WithDependencyIDs(ids) return m. WithImageTargets(iTargets). WithDeployTarget(dc) }
[ -0.3359253704547882, -1.3743458986282349, 0.19946140050888062, -0.673140287399292, -0.3612114489078522, -0.05373723432421684, -0.29748085141181946, 0.8724275231361389, -0.24133522808551788, 0.05472426861524582, -0.5985969305038452, -0.11231935769319534, 0.3981769382953644, 0.14445790648460...
func ParseBind(message []byte, length int) (string,string,[]BindValue) { var fmts []int16 var types []int32 var values []BindValue msg := NewMessageBuffer(message) msg.Seek(5) portal, _ := msg.ReadString() stmt, _ := msg.ReadString() fmtCnt, _ := msg.ReadInt16() for i := int16(0); i < fmtCnt; i++ { fmt, ...
[ 0.4134007394313812, -1.0277799367904663, 0.7827215194702148, -0.4340003430843353, -0.8866114616394043, 0.41904449462890625, 0.10815741121768951, -1.0220153331756592, -0.25108230113983154, -0.1957090198993683, 0.21099567413330078, 0.7766858339309692, -1.1033408641815186, 0.8715091347694397,...
func GetRowDescriptionFromPG(cols []Description) (bool,[]byte,int32) { ok := true msg := NewMessageBuffer([]byte{}) msg.WriteByte(RowDescriptionMessageType) msg.WriteInt32(0) msg.WriteInt16(int16(len(cols))) msg.WriteInt32(0) for _, column := range cols { msg.WriteBytes([]byte(column.Title[:len(column.Title...
[ -0.22678600251674652, 0.23890268802642822, 1.0326977968215942, -0.39486196637153625, 0.10757717490196228, -0.25926700234413147, -0.029705530032515526, -1.1281704902648926, -0.3485603630542755, 0.5360051989555359, -0.3925577402114868, 0.7623505592346191, -0.8757511377334595, 0.5707633495330...
func (c Child) asKey() string { // Want to ignore values that are being aggregated over. c.Val = nil c.Children = nil b, err := json.Marshal(c) if err != nil { log.Fatalf("Got %v encoding child %v", err, c) } return string(b) }
[ 0.4060007631778717, -0.4526903033256531, 0.6307804584503174, -0.34239938855171204, 0.1798395812511444, -0.3011443614959717, -0.542210578918457, -0.6947021484375, -1.0163694620132446, 0.7198006510734558, -0.5420472025871277, 0.5152559280395508, 0.524206280708313, 0.5161340236663818, -0.18...
func mergeChildren(dest, src []Child) []Child { if dest == nil || src == nil { if dest == nil { return src } return dest } // Store pointers to children accesible by key. destMap := make(map[string]*Child) for i, child := range dest { destMap[child.asKey()] = &dest[i] } // For each child in src, mer...
[ -0.6012510061264038, -0.09432467818260193, 0.7516825795173645, 0.13880813121795654, -0.4154619872570038, -0.6524628400802612, -0.9298485517501831, 0.0462552048265934, -0.485622376203537, 0.15358412265777588, -0.9103265404701233, -0.3150748312473297, 0.3421907424926758, 0.32168400287628174,...
func mergeNanocubeResponse(dest, src *NanocubeResponse) { if dest.Layers == nil { dest.Layers = []string{} } if dest.Root.Val != nil { if src.Root.Val != nil { *(dest.Root.Val) += *(src.Root.Val) } return } else if src.Root.Val != nil { dest.Root.Val = src.Root.Val } dest.Root.Children = mergeChild...
[ -0.25565028190612793, 0.06536797434091568, 0.49189141392707825, -0.03594669699668884, -0.0682033821940422, -0.3220982253551483, 0.1346433460712433, -0.4642280340194702, 0.7125139236450195, -0.2949928641319275, -0.4921872913837433, -0.34650152921676636, -0.2108224779367447, 0.58894747495651...
func CreateProductImage(c buffalo.Context) error { images := &models.Images{} tx, ok := c.Value("tx").(*pop.Connection) if !ok { return errors.New("Transaction not found") } if err := c.Bind(images); err != nil { return errors.WithStack(err) } if err := tx.Create(images); err != nil { return errors.WithS...
[ -1.0664838552474976, 0.49580293893814087, 0.5466052889823914, 0.3666480481624603, 0.22840113937854767, -0.20671577751636505, -0.019793830811977386, -0.7193945646286011, -0.27586907148361206, 1.4619202613830566, -0.046782493591308594, -0.45512402057647705, -0.17139233648777008, 0.5368195772...
func GetProductImage(c buffalo.Context) error { images := &models.Images{} tx, ok := c.Value("tx").(*pop.Connection) if !ok { return errors.New("Transaction not found") } if err := tx.All(images); err != nil { return errors.WithStack(err) } return c.Render(http.StatusOK, r.JSON(images)) }
[ -0.8224874138832092, 0.7675560712814331, 0.6320075988769531, 0.26571226119995117, 0.159665048122406, -0.7799944281578064, -0.06390317529439926, -0.3614269495010376, -0.6624205708503723, 1.205786943435669, 0.43913641571998596, 0.34514492750167847, -0.05050846189260483, 0.26163044571876526, ...
func (impl *Server) ResourceName() string { return "server" }
[ -0.6629998087882996, -0.3881952464580536, 0.5225720405578613, -0.27838334441185, -0.486300528049469, 0.23455961048603058, 0.7153134942054749, 0.734637439250946, 0.6841819882392883, 0.4876028299331665, 0.08621565252542496, 0.22275806963443756, -0.11424310505390167, 0.3942658007144928, -0....
func (impl *Server) NewEntity() base.EntityInterface { return new(entity.Server) }
[ -0.15677689015865326, -1.1126928329467773, 0.19795697927474976, 0.40415623784065247, 0.2478419840335846, 0.8356292247772217, 1.0444992780685425, -0.6636043787002563, 0.7099525332450867, -0.48677659034729004, -0.1074071153998375, 0.28883805871009827, -0.48727908730506897, 1.2725844383239746...
func (impl *Server) NewEntityCollection() interface{} { return new([]entity.Server) }
[ -1.3744308948516846, -0.8945639729499817, 0.3049927055835724, -0.43772995471954346, -0.4853667616844177, -0.05355585739016533, 0.8918324112892151, -0.6559919118881226, -0.019742373377084732, -0.5630914568901062, -1.041329264640808, 0.5535793900489807, -0.4782979190349579, 1.887387752532959...
func (impl *Server) GetConnection() *gorm.DB { return base.GetConnection() }
[ -0.07819008082151413, 0.2724529504776001, 0.44501954317092896, 0.6619015336036682, 0.6106879115104675, -0.2641701400279999, 0.6597207188606262, 0.17283669114112854, -0.6271222829818726, -0.0042612128891050816, -0.15847653150558472, -0.5158972144126892, -1.1006300449371338, 0.95358961820602...
func (impl *Server) NeedCheckDuplication() bool { return true }
[ -1.5348707437515259, -0.26447516679763794, 0.7186791896820068, 0.7665250301361084, -0.1933474987745285, 1.4027003049850464, 0.8434411883354187, 0.17730027437210083, -0.0517251156270504, 0.2137465924024582, -0.8592590093612671, 0.6051316857337952, -0.9111407995223999, 1.5921387672424316, ...
func (impl *Server) ConvertFindResultToCollection(start int64, total int64, result interface{}) (*base.CollectionModel, *base.ErrorResponse) { collection, ok := result.(*[]entity.Server) if !ok { log.Error("Server.ConvertFindResult() failed, convert data failed.") return nil, base.NewErrorResponseInternalError() ...
[ -1.4379780292510986, -0.6300593018531799, 0.6596611142158508, -0.40160250663757324, 0.16963224112987518, -0.298699289560318, 0.9797706604003906, -1.2178126573562622, -0.13345107436180115, 0.19042110443115234, -0.7423911690711975, -0.5014553070068359, -0.3125300109386444, -0.195251092314720...
func (impl *Server) ConvertFindResultToModel(result interface{}) ([]base.ModelInterface, *base.ErrorResponse) { collection, ok := result.(*[]entity.Server) if !ok { log.Error("Server.ConvertFindResult() failed, convert data failed.") return nil, base.NewErrorResponseInternalError() } ret := make([]base.ModelInt...
[ -1.8042716979980469, -0.4311745762825012, 0.6848939061164856, -0.022945262491703033, 0.8389859795570374, 0.13584333658218384, 0.7941886186599731, -1.0010547637939453, 0.2181103527545929, 0.37832900881767273, -0.9330902099609375, -0.6930512189865112, -0.43252208828926086, 0.5588597655296326...
func (impl *Server) FindServerStateAdded() string { var ( c = impl.TemplateImpl.GetConnection() server = new(entity.Server) ) if notFound := c.Where("\"State\" = ?", constvalue.ServerStateAdded).Order("\"Name\" asc").First(server).RecordNotFound(); notFound { return "" } return server.ID }
[ 0.15399251878261566, -0.4140413999557495, 0.5239951610565186, -0.6836234331130981, 0.12705551087856293, 0.18052352964878082, -0.017935533076524734, -0.7958126664161682, 0.2276105135679245, 0.43962427973747253, -0.3493516743183136, 0.25716081261634827, -1.0088962316513062, 1.491806268692016...
func (impl *Server) Exist(s *model.Server) (bool, base.ModelInterface) { var ( c = impl.TemplateImpl.GetConnection() server = new(entity.Server) ) if s == nil { return false, nil } c.Where("\"PhysicalUUID\" = ?", s.PhysicalUUID).First(server) if s.PhysicalUUID == server.PhysicalUUID { return true, ...
[ -1.3761781454086304, -0.489944189786911, 0.5718644261360168, -0.2214440405368805, 0.8469547033309937, 0.5956005454063416, 0.30737829208374023, 0.08446096628904343, -0.4338313639163971, 0.7272737622261047, -0.2070024460554123, -0.6714744567871094, -0.5046419501304626, 0.6680463552474976, ...
func (impl *Server) CreateServer(s *model.Server) (base.ModelInterface, base.ModelInterface, error) { var ( c = impl.TemplateImpl.GetConnection() server = new(entity.Server) ) if exist, _ := impl.Exist(s); exist { // TODO get the server to return. log.WithFields(log.Fields{"hostname": s.Hostname}).Info(...
[ -1.142348289489746, 0.5813809633255005, 0.9289063215255737, 0.05345987528562546, 0.7518371343612671, -0.267330527305603, 1.0181550979614258, 0.3084758222103119, -0.3665635287761688, 0.7532932162284851, -0.8563212752342224, -0.7319239377975464, -0.7563066482543945, 0.8331122398376465, 0.4...
func (impl *Server) GetAndLock(ID string) (bool, base.ModelInterface) { var ( c = impl.TemplateImpl.GetConnection() server = new(entity.Server) ) // Transaction start. tx := c.Begin() if err := tx.Error; err != nil { log.WithFields(log.Fields{ "id": ID, "error": err}). Warn("DB get and lock ...
[ -1.0551947355270386, 0.3029692769050598, 1.141126275062561, -0.28945180773735046, 0.07092388719320297, -0.09486740827560425, 0.23949772119522095, -0.0009080176241695881, -0.05137530341744423, 0.886038064956665, -0.47267043590545654, 0.024673525243997574, -0.3588320314884186, -0.12258429825...
func (impl *Server) SetState(ID string, state string) (base.ModelInterface, error) { var ( c = impl.TemplateImpl.GetConnection() server = new(entity.Server) ) tx := c.Begin() if err := tx.Error; err != nil { log.WithFields(log.Fields{ "id": ID, "op": "SetState", "error": err, }).Warn("DB...
[ -1.226060390472412, 0.0037771882489323616, 1.0792236328125, -0.19262710213661194, -0.1262495368719101, -0.20619910955429077, 0.32435253262519836, 0.05249595269560814, -0.03883371129631996, 1.1227219104766846, -0.4800626039505005, 0.22304990887641907, -0.7641858458518982, -0.013781552202999...
func (impl *Server) SetServerHealth(ID string, health string) (base.ModelInterface, error) { var ( c = impl.TemplateImpl.GetConnection() server = new(entity.Server) ) tx := c.Begin() if err := tx.Error; err != nil { log.WithFields(log.Fields{ "id": ID, "op": "SetServerHealth", "error": err...
[ -0.6045199632644653, -0.7335735559463501, 0.8632212281227112, -0.14385785162448883, -0.34521132707595825, 0.3906846344470978, 0.4412273168563843, 0.00445067323744297, -0.17874650657176971, 1.0080795288085938, -0.35855555534362793, 0.3022083044052124, -1.0502128601074219, 0.4452912509441376...
func (impl *Server) UpdateProcessors(ID string, processors []model.Processor) (base.ModelInterface, error) { var ( c = impl.TemplateImpl.GetConnection() server = new(entity.Server) ) tx := c.Begin() if err := tx.Error; err != nil { log.WithFields(log.Fields{ "id": ID, "op": "UpdateProcessors"...
[ -1.5835405588150024, -0.6342453956604004, 0.84978848695755, -0.644079864025116, -0.08450282365083694, -0.528679609298706, 0.18071918189525604, -0.18597231805324554, 0.16583748161792755, 1.4845337867736816, -0.263660192489624, 0.36491283774375916, -0.9632007479667664, 0.5529435873031616, ...
func (impl *Server) UpdateMemory(ID string, memory []model.Memory) (base.ModelInterface, error) { var ( c = impl.TemplateImpl.GetConnection() server = new(entity.Server) ) tx := c.Begin() if err := tx.Error; err != nil { log.WithFields(log.Fields{ "id": ID, "op": "UpdateMemory", "error": e...
[ -0.9668845534324646, -0.4182450473308563, 1.005631923675537, -0.4272010922431946, 0.10417000949382782, -0.31546005606651306, 0.31487008929252625, -0.39313098788261414, 0.19030338525772095, 1.6748230457305908, -0.19490133225917816, 0.3799835741519928, -0.8072119951248169, 0.6028971672058105...
func (impl *Server) UpdateEthernetInterfaces(ID string, ethernet []model.EthernetInterface) (base.ModelInterface, error) { var ( c = impl.TemplateImpl.GetConnection() server = new(entity.Server) ) tx := c.Begin() if err := tx.Error; err != nil { log.WithFields(log.Fields{ "id": ID, "op": "Upd...
[ -1.9345611333847046, -0.5855634212493896, 0.9599232077598572, -0.5617825984954834, 0.39856356382369995, 0.18633206188678741, 0.7007654309272766, -0.18773958086967468, 0.19619052112102509, 1.3201853036880493, -0.8197788000106812, -0.8833983540534973, -0.7333131432533264, 1.0814422369003296,...
func (impl *Server) UpdateNetworkInterfaces(ID string, networkInterface []model.NetworkInterface) (base.ModelInterface, error) { var ( c = impl.TemplateImpl.GetConnection() server = new(entity.Server) ) tx := c.Begin() if err := tx.Error; err != nil { log.WithFields(log.Fields{ "id": ID, "op": ...
[ -1.6474709510803223, -0.4577789604663849, 0.8371098637580872, -0.2224913239479065, 0.15414181351661682, 0.20338690280914307, 0.9466066360473633, -0.44276538491249084, 0.036807358264923096, 1.0295542478561401, -1.0038496255874634, -1.2260314226150513, -1.2908108234405518, 0.8190141320228577...
func (impl *Server) UpdateBoards(ID string, boards []model.Board) (base.ModelInterface, error) { var ( c = impl.TemplateImpl.GetConnection() server = new(entity.Server) ) tx := c.Begin() if err := tx.Error; err != nil { log.WithFields(log.Fields{ "id": ID, "op": "UpdateBoards", "error": er...
[ -0.7580040097236633, 0.36068201065063477, 1.1391736268997192, 0.031122645363211632, -0.2575540244579315, -0.16372257471084595, 0.8276686072349548, -0.16143998503684998, 0.103159099817276, 1.3568779230117798, -0.5018118023872375, -0.331722229719162, -0.7644144892692566, 0.8442716002464294, ...
func (impl *Server) UpdateNetworkAdapters(ID string, networkAdapters []model.NetworkAdapter) (base.ModelInterface, error) { var ( c = impl.TemplateImpl.GetConnection() server = new(entity.Server) ) tx := c.Begin() if err := tx.Error; err != nil { log.WithFields(log.Fields{ "id": ID, "op": "Up...
[ -1.9060885906219482, -0.7660428285598755, 0.6849620342254639, 0.023522578179836273, 0.18169879913330078, -0.4191107749938965, 0.5038827061653137, -0.2968214154243469, 0.20086398720741272, 1.4995396137237549, -0.680700421333313, -0.6923643946647644, -0.9016934633255005, 0.6233432292938232, ...
func (impl *Server) UpdatePCIeDevices(ID string, pcieDevices []model.PCIeDevice) (base.ModelInterface, error) { var ( c = impl.TemplateImpl.GetConnection() server = new(entity.Server) ) tx := c.Begin() if err := tx.Error; err != nil { log.WithFields(log.Fields{ "id": ID, "op": "UpdatePCIeDevi...
[ -1.657379388809204, -0.460276335477829, 0.8437129259109497, -0.16978299617767334, 0.12137977033853531, 0.12552912533283234, 0.9458450078964233, 0.30148905515670776, 0.08073659241199493, 1.5167773962020874, -0.3424750566482544, -0.7810435891151428, -1.5295048952102661, 0.45258045196533203, ...
func (impl *Server) DeleteServer(id string) (base.ModelInterface, []base.ModelInterface, *base.ErrorResponse) { var ( name = impl.ResourceName() record = new(entity.Server) previous = new(entity.Server) deletedSSG = make([]base.ModelInterface, 0) deletedSSGEntity = make([]...
[ -0.8242279291152954, -0.3376573324203491, 1.037296175956726, -0.356586754322052, 0.40461990237236023, -0.32000890374183655, 1.336326241493225, -0.06591695547103882, -0.08376411348581314, 0.9299585223197937, -0.3947162330150604, -0.4653171896934509, -0.20480719208717346, 1.051255464553833, ...
func (impl *Server) DeleteServerCollection() ([]base.ModelInterface, []base.ModelInterface, *base.ErrorResponse) { var ( name = impl.TemplateImpl.ResourceName() recordCollection = impl.TemplateImpl.NewEntityCollection() c = impl.TemplateImpl.GetConnection() tables = impl.Te...
[ -0.6429747939109802, 0.2332998663187027, 0.7766594290733337, -0.020495761185884476, 0.43178725242614746, -0.15235716104507446, 1.184842824935913, -0.49228981137275696, -0.46150144934654236, 0.6266812086105347, -0.07543222606182098, 0.10000217705965042, -0.39947593212127686, 1.6821019649505...
func DecodeResponse(res *http.Response, obj interface{}) error { ctype := res.Header.Get("Content-Type") if !(lfsMediaTypeRE.MatchString(ctype) || jsonMediaTypeRE.MatchString(ctype)) { return nil } err := json.NewDecoder(res.Body).Decode(obj) io.Copy(ioutil.Discard, res.Body) res.Body.Close() if err != nil {...
[ -0.10309068858623505, -0.7876642346382141, 0.5928260087966919, 0.041625749319791794, -0.4168100953102112, -0.42845892906188965, -0.36765527725219727, -0.7690586447715759, 0.6982012987136841, 0.011325511150062084, -0.37308749556541443, -0.1647110879421234, -0.5892302393913269, -0.5292594432...
func handleResponse(cfg *config.Configuration, res *http.Response, creds auth.Creds) error { auth.SaveCredentials(cfg, creds, res) if res.StatusCode < 400 { return nil } defer func() { io.Copy(ioutil.Discard, res.Body) res.Body.Close() }() cliErr := &ClientError{} err := DecodeResponse(res, cliErr) if ...
[ -0.022276271134614944, -0.2555291950702667, 0.602759838104248, -0.0851876512169838, 0.10508027672767639, -0.4363049864768982, -0.2745228409767151, 0.3152146339416504, 0.10273764282464981, 0.28197920322418213, -0.3723676800727844, -0.6719112396240234, -0.5556566119194031, -0.457199364900589...
func FormatTmsp(num int) string { return "date_format(?,'%Y-%m-%d %H:%i:%s.%f')" }
[ 0.45540013909339905, -0.8097524046897888, 0.8097943663597107, -0.8074475526809692, -0.5809192657470703, -0.30741992592811584, -0.539387047290802, -0.6699404716491699, 0.6256295442581177, 1.1978347301483154, 0.6473909020423889, -0.8345618844032288, 0.48822829127311707, 0.10153862088918686, ...