text
stringlengths
11
6.3k
embedding
listlengths
768
768
func NewBRContextManager(client *Client) ContextManager { return &brContextManager{ client: client, hasTable: make(map[int64]CreatedTable), } }
[ 0.10865946859121323, -0.17470934987068176, 0.23841328918933868, 0.8778756856918335, -0.5704559683799744, -0.09193971753120422, 0.1374121904373169, -0.3841129541397095, -0.48469579219818115, -1.0923088788986206, -0.7701798677444458, 0.482439786195755, -1.0539203882217407, 0.7660907506942749...
func Exhaust(ec <-chan error) []error { out := make([]error, 0, len(ec)) for { select { case err := <-ec: out = append(out, err) default: // errCh will NEVER be closed(ya see, it has multi sender-part), // so we just consume the current backlog of this channel, then return. return out } } }
[ -0.17735496163368225, -0.012642777524888515, 0.68394935131073, 0.07732667773962021, 0.2366994321346283, 0.07841139286756516, -0.7528048157691956, -1.0443035364151, 0.3350311517715454, 0.9271758794784546, -0.0601348951458931, 0.8278295993804932, -0.38820889592170715, 0.5891541242599487, 0...
func NewTiKVSender( ctx context.Context, cli *Client, updateCh glue.Progress, ) (BatchSender, error) { inCh := make(chan DrainResult, defaultChannelSize) midCh := make(chan DrainResult, defaultChannelSize) sender := &tikvSender{ client: cli, updateCh: updateCh, inCh: inCh, wg: new(sync.WaitGr...
[ 0.044697608798742294, -0.27012962102890015, 0.522967517375946, 0.1685173064470291, -0.6426268815994263, -0.5233652591705322, -0.6997988820075989, -0.8955224752426147, -0.5249564051628113, 0.7289885878562927, -0.786884069442749, -0.025241026654839516, -0.7977210879325867, 0.9311932325363159...
func NewConnection(listener *Listener, logger log.Logger, conn net.Conn) (*Connection, error) { if logger == nil { return nil, errors.New("NewConnection requires a non-nil logger") } params := &ConnectionParameters{ ConnectionTimeout: time.Second * 60, } c := &Connection{ plainConn: conn, listener: liste...
[ 0.3096681833267212, -0.33763399720191956, 0.5264546871185303, 0.12024251371622086, -0.7207767367362976, -0.49057042598724365, -0.39024636149406433, 0.15926256775856018, 0.11618570983409882, -0.057502131909132004, -0.25029346346855164, -0.23856127262115479, -0.14444467425346375, 0.367918014...
func isClosedErr(err error) bool { return strings.HasSuffix(err.Error(), "use of closed network connection") // YUCK! }
[ -0.5086291432380676, -0.45012587308883667, 0.3440364599227905, 0.6438773274421692, -0.7431052923202515, 0.43265435099601746, -0.823635458946228, 0.038273751735687256, 0.7867640852928162, 0.1600332260131836, 0.25235897302627563, -0.38095414638519287, -0.7456977367401123, 1.62190842628479, ...
func (c *Connection) nbdReplyToBytes(rep *nbdReply) (payload []byte, err error) { var buffer bytes.Buffer err = binary.Write(&buffer, binary.BigEndian, rep) if err == nil { payload = buffer.Bytes() } return }
[ -0.4641108214855194, 0.9373887777328491, 0.6480311751365662, -1.493172287940979, -0.1391839236021042, -0.10266086459159851, -0.6537042856216431, -1.5699299573898315, 0.8262885808944702, 0.4425184428691864, -1.172074794769287, -0.14985333383083344, -1.626994252204895, 0.17116613686084747, ...
func (c *Connection) sendHeader(ctx context.Context, rep *nbdReply) bool { payload, err := c.nbdReplyToBytes(rep) if err != nil { c.logger.Infof("Client %s couldn't send reply", c.name) return false } return c.sendPayload(ctx, payload) }
[ -0.5499932169914246, 0.5733728408813477, 0.7049054503440857, -0.5937642455101013, -0.5792463421821594, 0.5931186676025391, -0.49498480558395386, -1.2913450002670288, 0.67960524559021, 0.48056575655937195, -0.03747827932238579, -0.02741156704723835, -1.3775392770767212, -0.5181877017021179,...
func (c *Connection) sendPayload(ctx context.Context, payload []byte) bool { atomic.AddInt64(&c.numInflight, 1) // one more in flight select { case c.repCh <- payload: case <-ctx.Done(): return false } return true }
[ -0.7348923087120056, 1.4214091300964355, 0.5651670694351196, 0.12885026633739471, -0.37688058614730835, 0.28847259283065796, -0.4184495210647583, -0.8786930441856384, 0.16570471227169037, -0.21192725002765656, -0.3295271396636963, -0.987964928150177, -1.5482308864593506, -0.315994143486022...
func (c *Connection) reply(ctx context.Context) { defer func() { c.logger.Infof("Replyer exiting for %s", c.name) c.kill(ctx) c.wg.Done() }() for { select { case <-ctx.Done(): return case payload, ok := <-c.repCh: if !ok { return } n, err := c.conn.Write(payload) if err != nil { ...
[ -0.357301265001297, 0.20071187615394592, 0.796876847743988, -0.342287540435791, 0.35297784209251404, -0.0011048461310565472, -0.38477644324302673, -0.6513252258300781, -0.3605162799358368, 0.023863067850470543, 0.03356236591935158, 0.007937191985547543, -1.0220259428024292, 0.5006324648857...
func (c *Connection) receive(ctx context.Context) { defer func() { c.logger.Infof("Receiver exiting for %s", c.name) c.kill(ctx) c.wg.Done() }() for { // get request var req nbdRequest if err := binary.Read(c.conn, binary.BigEndian, &req); err != nil { if nerr, ok := err.(net.Error); ok { if nerr...
[ -0.41797634959220886, -0.7623316645622253, 0.9069751501083374, -0.19282324612140656, 0.35815078020095825, -0.6583892703056335, -0.22787918150424957, -0.6354576945304871, 0.07634005695581436, -0.05262555554509163, 0.592734158039093, -0.46171706914901733, -0.32356125116348267, 0.652655541896...
func (c *Connection) kill(ctx context.Context) { c.killMutex.Lock() defer c.killMutex.Unlock() if !c.killed { close(c.killCh) c.killed = true } }
[ 0.11411907523870468, -0.7063066363334656, 0.3008812665939331, 0.9449355006217957, 0.1769387125968933, 0.9028424024581909, -0.6118800044059753, -0.2333948314189911, 0.08575256168842316, 0.010200545191764832, -0.22015123069286346, -0.04194340482354164, -0.5851308703422546, -0.314626514911651...
func (c *Connection) Serve(parentCtx context.Context) { ctx, cancelFunc := context.WithCancel(parentCtx) c.repCh = make(chan []byte, 1024) c.killCh = make(chan struct{}) c.conn = c.plainConn c.name = c.plainConn.RemoteAddr().String() if c.name == "" { c.name = "[unknown]" } defer func() { if c.backend !=...
[ 0.6002618670463562, -0.3132544755935669, 1.067154049873352, 0.0033326749689877033, 0.4534962475299835, -0.621337354183197, -0.48187750577926636, 0.25610730051994324, -0.5386225581169128, 0.6942445635795593, -0.26526394486427307, 0.4070744216442108, -0.5684532523155212, -0.3066956400871277,...
func roundUpToNextPowerOfTwo(x uint64) uint64 { var r uint64 = 1 for i := 0; i < 64; i++ { if x <= r { return r } r = r << 1 } return 0 // won't fit in uint64 :-( }
[ -0.6620205640792847, -0.15538591146469116, 0.5099575519561768, 0.07930687814950943, -0.8825969099998474, -0.30227982997894287, -0.7772305011749268, -0.8200613856315613, -0.4608970284461975, -0.16779756546020508, 0.3071657419204712, 0.3717609941959381, -0.378573477268219, 0.4393052160739898...
func (c *Connection) connectExport(ctx context.Context, ec *ExportConfig) (*Export, error) { // defaults to false in case of error, // this is good enough for our purposes forceFlush, _ := strconv.ParseBool(ec.DriverParameters["flush"]) forceFua, _ := strconv.ParseBool(ec.DriverParameters["fua"]) driver := string...
[ 0.10543294250965118, 0.037107329815626144, 0.8922484517097473, 0.5484806895256042, -0.23631621897220612, -0.6724311113357544, 0.29326900839805603, -0.2174493670463562, -0.3060269355773926, 0.2816520035266876, -0.2138679325580597, -0.004307758528739214, -0.5722376704216003, 0.12768830358982...
func RegisterBackend(name string, generator BackendGenerator) { backendMap[name] = generator }
[ -0.6999421119689941, -0.371866375207901, 0.33615031838417053, -0.07236579060554504, 0.4608439803123474, -0.43748342990875244, -0.6764232516288757, 0.8785742521286011, -0.7656445503234863, 0.0792156532406807, -1.0857317447662354, 0.19498157501220703, -0.43812915682792664, 0.1685523837804794...
func ContainsBackend(name string) bool { for k := range backendMap { if k == name { return true } } return false }
[ 0.48807504773139954, -0.5077372789382935, 0.6269911527633667, 0.1826125830411911, -0.28412890434265137, 0.3536624014377594, -0.8950715065002441, -0.6968820691108704, -0.27931445837020874, 0.33855754137039185, -0.720676600933075, -0.034628015011548996, -1.3335440158843994, 0.264524966478347...
func GetBackendNames() []string { b := make([]string, len(backendMap)) i := 0 for k := range backendMap { b[i] = k i++ } sort.Strings(b) return b }
[ -0.060337409377098083, 0.17219574749469757, 0.7483982443809509, 0.6175737380981445, 0.29793670773506165, 0.24455635249614716, -0.52470862865448, -0.5097633004188538, -0.13737760484218597, 0.9139784574508667, -0.05772650986909866, 0.6131909489631653, -0.7151774168014526, 0.0882670059800148,...
func NewMoney(i interface{}) (Money, error) { var err error var d decimal.Decimal switch v := i.(type) { case string: d, err = decimal.NewFromString(v) case float64: d = decimal.NewFromFloat(v) case int64: d = decimal.New(v, 0) case int: d = decimal.New(int64(v), 0) case decimal.Decimal: d = v case ...
[ -0.3290199041366577, -0.49972227215766907, 0.7248430848121643, 0.42999717593193054, -0.6594928503036499, 0.30003902316093445, -0.15857934951782227, -1.0976018905639648, 0.4429079294204712, 0.04888220503926277, 0.0653521791100502, 0.016858475282788277, -0.23957999050617218, 0.42919871211051...
func NewMoneyFromDecimal(d decimal.Decimal) Money { return Money{d} }
[ -0.17022106051445007, -0.3746032118797302, 0.28718024492263794, 0.38360530138015747, -1.18886137008667, 0.17511731386184692, -1.232336401939392, -1.1187137365341187, 0.0261146929115057, -0.8465878367424011, -0.3623591363430023, -0.30538588762283325, 0.003255113959312439, 0.3137065470218658...
func NewMoneyFromString(s string) (Money, error) { // TODO: this is pretty much basic implementation - should be rewritten when currency is added decValue, err := decimal.NewFromString(s) return Money{decValue}, err }
[ 0.09881917387247086, -1.4470429420471191, 0.15389715135097504, 0.07364973425865173, -1.3597183227539062, -0.5539894104003906, -0.49437040090560913, -0.7016997337341309, 0.4521758258342743, -0.7899850010871887, -0.36524561047554016, -0.3142922520637512, -0.22227314114570618, -0.109741181135...
func NewMoneyFromFloat(i float64) Money { return Money{decimal.NewFromFloat(i)} }
[ 0.005809510592371225, 0.2570738196372986, 0.3387145400047302, 0.6092709898948669, -0.5651530623435974, 0.2946123778820038, -0.5386962890625, -0.864337682723999, -0.530994713306427, -0.6625744700431824, -0.7591591477394104, -1.3707616329193115, -0.24235223233699799, 0.266993910074234, -0....
func NewMoneyFromFloatWithExponent(i float64, exp int32) Money { return Money{decimal.NewFromFloatWithExponent(i, exp)} }
[ -0.2923993468284607, 0.09650826454162598, 0.5647965669631958, 0.6072545051574707, -0.8813021779060364, 0.16478964686393738, -0.7488363981246948, 0.23674121499061584, -0.11816583573818207, -0.18233588337898254, -0.3851452171802521, -1.0824836492538452, -0.241061270236969, -0.155192866921424...
func (m Money) MarshalJSON() ([]byte, error) { return []byte(m.StringFixed(2)), nil }
[ -0.1848440021276474, -0.22224850952625275, 0.2629591226577759, 0.262376993894577, -0.5959473848342896, -0.014014665968716145, -0.47179391980171204, -0.3570384681224823, 0.3005441129207611, 0.3571929633617401, -1.0020294189453125, 0.8460168838500977, -0.46843189001083374, 0.9351018071174622...
func (m *Money) UnmarshalJSON(decimalBytes []byte) error { d := &decimal.Decimal{} if err := d.UnmarshalJSON(decimalBytes); err != nil { return err } *m = Money{*d} return m.Validate() }
[ -0.42518705129623413, 0.14782221615314484, 0.7289555668830872, -0.5860059261322021, -0.523154616355896, 0.07460357248783112, 0.09335450828075409, 0.0016711247153580189, 0.5323613286018372, -0.542039155960083, -0.2636620104312897, -0.07104077190160751, -0.910515308380127, 0.4195472002029419...
func (m *Money) Scan(value interface{}) error { str, err := Unquote(value) if err != nil { return err } *m, err = NewMoneyFromString(str) return err }
[ -0.4503328800201416, 0.18596486747264862, 0.6536926031112671, -0.052411310374736786, -1.5158900022506714, -0.34407854080200195, -0.22672298550605774, -0.691149890422821, 0.36455264687538147, -0.5056946873664856, -0.1479443609714508, 0.26772019267082214, -0.19675537943840027, 0.489237189292...
func (m Money) Value() (driver.Value, error) { return m.String(), nil }
[ -0.49978744983673096, -0.3678264319896698, 0.1976751983165741, 0.08445347845554352, 0.27172762155532837, 0.11408083885908127, 0.057933259755373, -1.117565393447876, 0.8334839940071106, 0.513685941696167, 0.9742628335952759, 0.2586268484592438, -0.3318888247013092, 0.3875328302383423, 0.2...
func New(port serial.Port, delayBefore, delayAfter time.Duration, sig Control) (*Port, error) { if port == nil || sig == nil { return nil, serial.ErrPortNotInitialized } p := &Port{ port: port, delayBefore: delayBefore, delayAfter: delayAfter, sig: sig, } // Initially Lower the signal er...
[ 0.6608906388282776, -0.3578866720199585, 0.15753568708896637, -0.10796406865119934, -0.20674769580364227, -0.2619231939315796, 0.3976749777793884, 0.3179731070995331, -0.13526521623134613, -0.9037904143333435, -0.18382930755615234, -0.2798681855201721, 0.0331401564180851, 0.304242789745330...
func (p *Port) Write(b []byte) (n int, err error) { if p == nil || len(b) == 0 { return 0, fmt.Errorf("failed to write empty / un-initialized port") } // Startup err = p.sig(true) // Activate the Signal if err != nil { return 0, fmt.Errorf("failed to raise the signal for RS485 Write - %w", err) } if p.delay...
[ -0.470426470041275, 0.30971571803092957, 0.6007866263389587, 0.39505380392074585, 0.4606429636478424, -0.4811095893383026, 1.2778956890106201, 0.7748345136642456, 0.09937311708927155, 0.01971828192472458, -1.2839958667755127, 0.007458138279616833, -1.4869978427886963, 0.35212454199790955, ...
func (p *Port) Close() error { if p == nil { return serial.ErrNotOpen } return p.port.Close() }
[ 0.4090350568294525, 0.15834684669971466, 0.49152714014053345, 0.2826472520828247, 0.07396060973405838, 0.4472848176956177, 0.12224549800157547, -0.5096768140792847, 0.07695344090461731, -1.133109450340271, 0.21967577934265137, -0.12561343610286713, -0.993865430355072, 0.14042240381240845, ...
func (p *Port) Read(b []byte) (n int, err error) { if p == nil || len(b) == 0 { return 0, fmt.Errorf("failed to read empty / un-initialized port") } // Startup err = p.sig(false) // Activate the Signal if err != nil { return 0, fmt.Errorf("failed to lower the signal for RS485 Read - %w", err) } n, err = p....
[ -0.1805611252784729, -0.29635030031204224, 0.5330310463905334, 0.402702659368515, 0.26672062277793884, -0.20802201330661774, 1.0109012126922607, 0.44547146558761597, 0.17300449311733246, -0.2858259081840515, -0.636690080165863, 0.6241708397865295, -1.5777294635772705, 0.31087175011634827, ...
func (m *Message) MarshalJSONPB(opts *jsonpb.Marshaler) ([]byte, error) { var b indentBuffer b.indent = opts.Indent if len(opts.Indent) == 0 { b.indentCount = -1 } b.comma = true if err := m.marshalJSON(&b, opts); err != nil { return nil, err } return b.Bytes(), nil }
[ -0.016210878267884254, 0.23698359727859497, 0.7912188768386841, 0.7507668137550354, -0.24787795543670654, 0.45180055499076843, -0.6818844079971313, -0.5455574989318848, 0.5112050771713257, -0.062139034271240234, 0.5303367972373962, 0.1782853901386261, -1.669710636138916, 0.6635435819625854...
func (m *Message) UnmarshalMergeJSON(js []byte) error { return m.UnmarshalMergeJSONPB(&jsonpb.Unmarshaler{}, js) }
[ -0.3685135841369629, 0.13514670729637146, 0.5866311192512512, -0.6788409352302551, -0.27594900131225586, -0.3661944568157196, 0.25038212537765503, -0.07911664992570877, 0.2651118338108063, 0.1662960797548294, -0.5440316200256348, -0.10548309236764908, -1.8153325319290161, 1.334526658058166...
func (m *Message) UnmarshalJSONPB(opts *jsonpb.Unmarshaler, js []byte) error { m.Reset() if err := m.UnmarshalMergeJSONPB(opts, js); err != nil { return err } return m.Validate() }
[ -0.052577272057533264, 0.5476477146148682, 0.6006979942321777, 0.2065432220697403, -0.2875595986843109, 0.1610715091228485, 0.3310626745223999, -0.6342377066612244, 0.51793372631073, -0.2849718928337097, 0.5724264979362488, -0.3086687922477722, -1.6545155048370361, 0.7014252543449402, -0...
func (m *Message) UnmarshalMergeJSONPB(opts *jsonpb.Unmarshaler, js []byte) error { r := newJsReader(js) err := m.unmarshalJson(r, opts) if err != nil { return err } if t, err := r.poll(); err != io.EOF { b, _ := ioutil.ReadAll(r.unread()) s := fmt.Sprintf("%v%s", t, string(b)) return fmt.Errorf("superfluo...
[ 0.18784549832344055, 0.260978639125824, 0.9232705235481262, -0.8839554190635681, -0.4350782632827759, 0.18164025247097015, -0.17639267444610596, -0.49509963393211365, -0.1776561439037323, -0.1890246570110321, 0.15320676565170288, -0.4318722188472748, -1.3028843402862549, 0.5172907114028931...
func AnyResolver(mf *MessageFactory, files ...*desc.FileDescriptor) jsonpb.AnyResolver { return &anyResolver{mf: mf, files: files} }
[ -0.07595141232013702, -0.6609528660774231, 0.29261431097984314, 0.13827455043792725, -0.4247344732284546, -0.41526105999946594, -0.530236542224884, 0.4015388786792755, -0.9458030462265015, -1.8658698797225952, 0.10456297546625137, -0.41249915957450867, -0.8148986101150513, 1.02365589141845...
func CORSVC(ac *atmi.ATMICtx, svc *atmi.TPSVCINFO) { ret := SUCCEED //Return to the caller defer func() { ac.TpLogCloseReqFile() if SUCCEED == ret { ac.TpReturn(atmi.TPSUCCESS, 0, &svc.Data, 0) } else { ac.TpReturn(atmi.TPFAIL, 0, &svc.Data, 0) } }() //Get UBF Handler ub, _ := ac.CastToUBF(&svc.D...
[ -0.049409545958042145, 0.060902465134859085, 0.8743702173233032, -0.8689854145050049, -0.4222285747528076, 0.2764383554458618, 0.492519736289978, -0.30985936522483826, 0.10233034938573837, -0.5072364807128906, 0.6222739815711975, 0.0976414829492569, -0.8521694540977478, 0.5922839641571045,...
func Init(ac *atmi.ATMICtx) int { ac.TpLogWarn("Doing server init...") if err := ac.TpInit(); err != nil { return FAIL } //Get the configuration //Allocate configuration buffer buf, err := ac.NewUBF(16 * 1024) if nil != err { ac.TpLogError("Failed to allocate buffer: [%s]", err.Error()) return FAIL } ...
[ -0.4602752923965454, 0.2792764902114868, 0.8161596655845642, -0.7616551518440247, -0.7964063882827759, 0.2200109362602234, 0.056345950812101364, -0.11203059554100037, -1.1664395332336426, 0.5312747955322266, -0.4004504978656769, 0.34210196137428284, -0.31176745891571045, 0.7247836589813232...
func main() { //Have some context ac, err := atmi.NewATMICtx() if nil != err { fmt.Fprintf(os.Stderr, "Failed to allocate new context: %s", err) os.Exit(atmi.FAIL) } else { //Run as server ac.TpRun(Init, Uninit) } }
[ 0.6183149814605713, -0.19938382506370544, 0.8305737972259521, 0.5530796647071838, -0.2446359395980835, 0.6367788314819336, 0.056949011981487274, -0.13547758758068085, -0.2178613245487213, -0.0768599808216095, 0.7562066316604614, 0.13045768439769745, 0.37289661169052124, -0.0869660377502441...
func NewAuthor() *Author { this := Author{} return &this }
[ 0.1453361064195633, -1.3758060932159424, 0.186592698097229, 1.5939605236053467, -0.8175696730613708, -0.638717532157898, 0.863193929195404, 0.05243254825472832, 0.17288847267627716, -0.8947620391845703, -0.2233041524887085, 0.47406330704689026, -0.5113173723220825, -0.12833838164806366, ...
func NewAuthorWithDefaults() *Author { this := Author{} return &this }
[ 0.15561404824256897, -0.764420747756958, -0.06609880924224854, 1.4715746641159058, 0.14077560603618622, -0.7313736081123352, -0.2022632509469986, -0.4334922730922699, 0.10159756243228912, -0.6250737309455872, -0.7959693670272827, -1.340253233909607, -0.5926194787025452, 0.8128724694252014,...
func (o *Author) GetRaw() string { if o == nil || o.Raw == nil { var ret string return ret } return *o.Raw }
[ 0.017965931445360184, 1.241407036781311, 0.7016766667366028, 0.927017867565155, -0.8758832812309265, 0.16666968166828156, 0.3705020546913147, -0.19849847257137299, 0.44760623574256897, -1.370497703552246, 0.13826753199100494, -0.2891807556152344, 0.5626686215400696, -0.011165591888129711, ...
func (o *Author) GetRawOk() (*string, bool) { if o == nil || o.Raw == nil { return nil, false } return o.Raw, true }
[ -0.8200085759162903, 0.9623314738273621, 0.7642921209335327, 0.28187859058380127, -0.0016495370073243976, -0.3970453441143036, 0.39626821875572205, 0.5421913862228394, -0.3080662488937378, -1.1512033939361572, -1.241621494293213, -0.057130005210638046, 0.9714910387992859, -0.08144916594028...
func (o *Author) HasRaw() bool { if o != nil && o.Raw != nil { return true } return false }
[ 0.2270323783159256, 1.2562788724899292, 0.6139006614685059, 0.3579575717449188, -0.21171312034130096, 0.28282591700553894, -0.2373562455177307, 0.6071316003799438, -0.4071522653102875, -1.482447862625122, -0.47992706298828125, -0.9236578345298767, 1.001270055770874, 0.08796557784080505, ...
func (o *Author) SetRaw(v string) { o.Raw = &v }
[ 0.0946030244231224, 0.7654727697372437, 0.07259545475244522, -0.027106622233986855, -1.8375489711761475, 0.0022282872814685106, -0.7972640991210938, -0.9124307632446289, -0.007879008539021015, -0.7674615979194641, 0.34835323691368103, 1.1097979545593262, 0.6470206379890442, -0.892224848270...
func (o *Author) GetUser() Account { if o == nil || o.User == nil { var ret Account return ret } return *o.User }
[ 0.4366236925125122, 0.3031254708766937, 0.24954001605510712, 1.6957252025604248, -0.3643842339515686, -0.35971611738204956, 1.7529609203338623, -0.6011888384819031, 1.3497728109359741, -1.0268261432647705, -0.2112850844860077, -1.0832101106643677, -0.23355235159397125, 0.7854089140892029, ...
func (o *Author) GetUserOk() (*Account, bool) { if o == nil || o.User == nil { return nil, false } return o.User, true }
[ 0.4173790514469147, 0.02227240800857544, 0.4266597032546997, 1.446114182472229, -0.8096987009048462, 0.291757732629776, 1.3768556118011475, 0.2318098396062851, 0.4738534986972809, 0.4859459698200226, -1.0189611911773682, -0.7316963076591492, 0.41523227095603943, 0.47492653131484985, -0.1...
func (o *Author) HasUser() bool { if o != nil && o.User != nil { return true } return false }
[ 0.31102481484413147, 0.44284486770629883, 0.10933593660593033, 1.00797700881958, 0.2254011332988739, -0.06572733074426651, 0.768278956413269, 0.8652433753013611, 0.014655590057373047, -1.4816161394119263, -0.41621991991996765, -0.9698728919029236, 0.08262041956186295, 0.14135019481182098, ...
func (o *Author) SetUser(v Account) { o.User = &v }
[ 0.36266109347343445, 0.291960746049881, -0.26893651485443115, 0.9176023006439209, -0.6373540163040161, -0.2664969563484192, 0.6851575970649719, -0.7237538695335388, 0.674953043460846, -0.8063096404075623, 0.1085055023431778, 0.7070369124412537, 0.19137828052043915, -0.0891861841082573, 0...
func mockConfigDir() (string, error) { return "/tmp/CONFIG/datamaps/", nil }
[ -1.1555070877075195, -0.062481123954057693, 0.45408228039741516, -0.2775907814502716, -0.4774675667285919, 0.39388781785964966, 0.9159173369407654, 1.0060535669326782, -0.024252155795693398, -0.44702452421188354, -0.4537246525287628, -0.6805863380432129, -0.36229652166366577, 0.75897479057...
func (v value) Is(t Type) bool { return v.typ.Name() == t.Name() }
[ -1.317219614982605, -0.7122824192047119, 0.09817672520875931, 0.28875911235809326, 0.039021383970975876, 0.0710417777299881, -1.0181876420974731, -1.5384732484817505, 0.8550733327865601, 1.3445658683776855, -0.6532732844352722, 1.1066453456878662, 0.5606297850608826, 0.22668923437595367, ...
func LineSeparator() { fmt.Println("#####################################") }
[ 0.9082111120223999, -0.9851281642913818, 1.1714972257614136, -0.6973604559898376, 0.3594121038913727, 0.1822344958782196, -0.40609854459762573, -0.19082704186439514, -0.18913818895816803, -0.6772834062576294, -0.6358629465103149, 0.01581045612692833, -0.2977747917175293, 0.4831891357898712...
func readTomlFile(tomlfile string) (*Tomlconfig, error) { var config *Tomlconfig if _, err := toml.DecodeFile(tomlfile, &config); err != nil { return nil, err } return config, nil }
[ 0.20437589287757874, -0.07204453647136688, 0.37151002883911133, -0.512208878993988, -1.6129711866378784, 0.19097276031970978, -0.7081975936889648, 0.2723062038421631, -0.4276246130466461, 0.9138890504837036, -0.6497414708137512, 0.1738034337759018, -0.8465558886528015, -0.46059995889663696...
func checkExist(fs afero.Fs, directory string) error { LineSeparator() _, err := fs.Stat(directory) if err != nil { return err } return nil }
[ 0.016277430579066277, -0.3707369863986969, 0.7891843914985657, 0.4725317060947418, 1.0327733755111694, -0.06524968892335892, -0.27984946966171265, 0.460685670375824, -0.03489981219172478, 1.078425407409668, 0.8120058178901672, 0.2234208583831787, 0.47915297746658325, 1.1199699640274048, ...
func runCheck(fs afero.Fs, config Tomlconfig) { LineSeparator() fmt.Printf("Config Title:\n%s\n", config.Title) LineSeparator() for directoryName, directory := range config.Directories { fmt.Printf("Backup: %s\nOrigin: %s | Destiny: %s | Retention: %d\n", directoryName, directory.ORIGIN, directory.DESTINY, direct...
[ -0.20736174285411835, -0.1713770031929016, 0.9526199102401733, 0.33824002742767334, 0.8246051073074341, 0.7213451266288757, 1.0227479934692383, 0.7870622277259827, -0.34037601947784424, -0.18331265449523926, 0.3801031708717346, -0.24498659372329712, 0.5411555171012878, 0.9378427267074585, ...
func checkFiles(fs afero.Fs, dirorigin string, dirdestiny string, retention int) *Filestobackup { retentionhours := (retention * 24) backup := &Filestobackup{} backup.ORIGIN = dirorigin backup.DESTINY = dirdestiny files, err := afero.ReadDir(fs, dirorigin) if err != nil { fmt.Printf("%s", err.Error()) } for _...
[ -0.40707844495773315, -0.07504606992006302, 0.6571174263954163, 0.016881423071026802, 0.00031858449801802635, -0.1144343912601471, -0.6148090958595276, 0.750798225402832, -0.3777513802051544, 0.5784063935279846, 0.5768914222717285, -0.6086366772651672, 0.08610843122005463, -0.2275555729866...
func (c *MetricsConfig) GetConf(filePath string) error { yamlFile, err := ioutil.ReadFile(filePath) if err != nil { return err } err = yaml.Unmarshal(yamlFile, c) return err }
[ 1.4649462699890137, -0.07561508566141129, 0.6339349746704102, -0.28210923075675964, 0.41391271352767944, 0.0502653606235981, 1.335402488708496, 0.835975170135498, -1.2088247537612915, 0.24184586107730865, -0.19460360705852509, 0.42097729444503784, 0.411576509475708, 0.28301239013671875, ...
func (list DependencyManagerList) Main() DependencyManager { if len(list) > 0 { return list[0] } return nil }
[ -0.546233594417572, -0.02463190071284771, 0.5047273635864258, 0.8063677549362183, -0.018888942897319794, 0.11545513570308685, -0.20659679174423218, 0.8081129789352417, 0.844509482383728, -0.48556116223335266, -0.22866205871105194, -0.5555099844932556, -0.6124533414840698, 1.487460613250732...
func RunServer() { serverMutex.Lock() defer serverMutex.Unlock() if serverStarted { return } err := initialiseServer() if err != nil { log.Panicln("server:", err) } log.Println("server: Server starting at", config.Address) serverStarted = true go func() { err = server.ListenAndServe() if err != http....
[ -1.06381356716156, -1.1884709596633911, 0.5707016587257385, 0.2649093270301819, 0.8040214776992798, 0.412019282579422, -0.06846261769533157, 1.1714602708816528, -0.015944087877869606, -1.0008186101913452, -0.6082479357719421, 0.8303962349891663, -1.2893905639648438, 0.670358419418335, 1....
func StopServer() { serverMutex.Lock() defer serverMutex.Unlock() if !serverStarted { return } err := server.Shutdown(context.Background()) if err == nil { log.Println("server: stopped") } else { log.Println("server:", err) } }
[ -1.4761277437210083, -1.137736439704895, 0.38946643471717834, 0.2999780774116516, 0.930267870426178, 0.4231583774089813, -0.011533534154295921, 0.6937121748924255, 0.15906710922718048, 0.08562866598367691, -0.23761014640331268, 0.7469038963317871, -1.655739188194275, 0.4668675363063812, ...
func Shape(sf shape.Shape) func(Generator) { return func(g Generator) { g.(Shapeable).SetShape(sf) } }
[ -0.3011912405490875, 0.242584228515625, 0.1402604579925537, 0.4135640859603882, -0.44420507550239563, 0.0928603857755661, 0.9678670167922974, 0.2154502421617508, -0.3853040635585785, -0.6992418169975281, -0.1815129816532135, 0.14965938031673431, 1.7336302995681763, 0.6060121655464172, 0....
func (m *Migrator) MigrateIfNeeded(target *EtcdVersionPair) error { klog.Infof("Starting migration to %s", target) err := m.dataDirectory.Initialize(target) if err != nil { return fmt.Errorf("failed to initialize data directory %s: %v", m.dataDirectory.path, err) } var current *EtcdVersionPair vfExists, err :=...
[ -1.057371735572815, -0.1869947612285614, 0.9192230105400085, -0.10455640405416489, -0.1324184387922287, 0.15620510280132294, -0.14430250227451324, -0.7158330678939819, -0.3864899277687073, 0.7305159568786621, 0.04606614634394646, 0.08296606689691544, 0.36470821499824524, 0.1509611308574676...
func BitFieldContainsAny(a, b BitField) (bool, error) { aruns, err := a.RunIterator() if err != nil { return false, err } bruns, err := b.RunIterator() if err != nil { return false, err } // Take the intersection of the two bitfields. combined, err := rlepluslazy.And(aruns, bruns) if err != nil { retur...
[ -0.1338878720998764, -0.06183769181370735, 0.891926109790802, 0.13717001676559448, 0.47655782103538513, 0.10738567262887955, 0.20900209248065948, -0.5578593015670776, -0.7447468042373657, 0.4624939560890198, 0.049989208579063416, 0.23829385638237, -0.4983316659927368, 0.74892258644104, -...
func BitFieldContainsAll(a, b BitField) (bool, error) { aruns, err := a.RunIterator() if err != nil { return false, err } bruns, err := b.RunIterator() if err != nil { return false, err } // Remove any elements in a from b. If b contains bits not in a, some // bits will remain. combined, err := rleplusla...
[ 0.31664448976516724, -0.27646246552467346, 0.9906780123710632, 0.05941891670227051, -0.3877164423465729, 0.6355937719345093, 0.23411200940608978, 0.14407110214233398, -0.5001394748687744, 0.9653126001358032, -0.27016690373420715, 0.3378318250179291, -0.7623749375343323, 0.08932323008775711...
func Connect() (*mongo.Collection, error) { goENV, ok := os.LookupEnv("GO_ENV") if !ok { goENV = "LOCAL" } var dbURL, dbName string var URLOk, nameOk bool if goENV == "TEST" { dbURL, URLOk = os.LookupEnv("DB_URL_TEST") dbName, nameOk = os.LookupEnv("DB_NAME_TEST") } else { dbURL, URLOk = os.LookupEnv("DB...
[ -0.46519935131073, -0.4289999306201935, 0.8828906416893005, 0.3391951620578766, 0.6959181427955627, 0.32486140727996826, -0.4980473518371582, -0.37131252884864807, -0.6823893785476685, 0.7082551121711731, 0.3068656027317047, 0.46464186906814575, -1.0400257110595703, 0.700082004070282, -0...
func (d *DiscordAPI) slashCommandHandlers(s *discordgo.Session, i *discordgo.InteractionCreate) { Logger.With(zap.Any("interaction", i.Interaction)).Debug("slash command interaction") switch i.Type { case discordgo.InteractionApplicationCommand: d.slashApplicationCommanInteractionHandler(s, i) case discordgo.In...
[ 0.004945254418998957, -0.9798659682273865, 0.3987211585044861, -0.2808207869529724, 0.9619483947753906, 0.5709543228149414, 0.6946360468864441, 0.22252564132213593, -0.20605120062828064, -0.4551765024662018, 0.09584049135446548, 0.04197736456990242, -0.6466553807258606, -0.1712223589420318...
func (d *DiscordAPI) slashMessageComponentHandler(s *discordgo.Session, i *discordgo.InteractionCreate) { customID := i.Interaction.MessageComponentData().CustomID switch customID[:strings.Index(customID, ":")] { case "stream": d.slashStreamComponentHandler(s, i) } }
[ 1.2006902694702148, -1.1492375135421753, 0.231050044298172, -0.9820693731307983, 0.30130791664123535, 0.18001966178417206, 1.0076682567596436, 0.13944832980632782, 0.11920091509819031, -0.20218148827552795, 0.20387405157089233, 0.44837677478790283, -0.7923617362976074, 0.20396821200847626,...
func (d *DiscordAPI) slashApplicationCommanInteractionHandler(s *discordgo.Session, i *discordgo.InteractionCreate) { switch i.Interaction.ApplicationCommandData().Name { case "stream": d.slashStreamHandler(s, i) } }
[ 0.9525335431098938, -0.41438794136047363, 0.38823577761650085, -0.1624237447977066, 0.7316845655441284, 0.9888430833816528, 0.8304661512374878, 0.41168123483657837, -0.3028741776943207, -0.023084379732608795, 0.5676082968711853, -0.40984535217285156, -1.0672019720077515, 0.2166121155023574...
func NewTokenizer(path string, addEOF bool) *Tokenizer { return &Tokenizer{filePath: path, addEOF: addEOF} }
[ -0.385135293006897, -0.754426896572113, 0.09070255607366562, -0.30586278438568115, -1.4013632535934448, -0.30991095304489136, -0.40396979451179504, 0.44817832112312317, -0.13853420317173004, -0.37960168719291687, -0.769494354724884, 0.0025043992791324854, -0.320771723985672, 0.755676150321...
func (t *Tokenizer) Tokenize() []Token { input, err := ioutil.ReadFile(t.filePath) if err != nil { log.Fatal(err) } t.input = string(input) var toks []Token for { // new line will be omitted in preprocessor, but still needed to parse #include ... and #define ... if tok := t.readNewLine(); tok != nil { to...
[ -0.2632358968257904, -0.3906034529209137, 0.987455427646637, -0.7302973866462708, -0.5853121280670166, -0.3473774790763855, -0.27679169178009033, 0.24350324273109436, -0.3366767168045044, 0.16821730136871338, -0.4971877634525299, -0.07259579747915268, -0.1031971201300621, 0.391874462366104...
func (s DescribeOrganizationConfigurationInput) String() string { return awsutil.Prettify(s) }
[ 0.4045622944831848, 0.5886206030845642, 0.11315521597862244, -0.18597984313964844, -0.31660863757133484, 0.8503899574279785, 1.0303130149841309, -0.8980684280395508, -0.15693128108978271, 0.22727857530117035, 0.18050459027290344, 0.5779421329498291, 0.2707931697368622, -0.01951660774648189...
func (s *DescribeOrganizationConfigurationInput) Validate() error { invalidParams := aws.ErrInvalidParams{Context: "DescribeOrganizationConfigurationInput"} if s.DetectorId == nil { invalidParams.Add(aws.NewErrParamRequired("DetectorId")) } if s.DetectorId != nil && len(*s.DetectorId) < 1 { invalidParams.Add(a...
[ -0.06808886677026749, 0.7160198092460632, 0.42832133173942566, 0.42916810512542725, -0.05097753927111626, 0.08518422394990921, 0.32913872599601746, -0.16849492490291595, -0.21961507201194763, 0.18464647233486176, 0.6746669411659241, 0.10557150095701218, -0.13739065825939178, 1.521150231361...
func (s DescribeOrganizationConfigurationInput) MarshalFields(e protocol.FieldEncoder) error { e.SetValue(protocol.HeaderTarget, "Content-Type", protocol.StringValue("application/json"), protocol.Metadata{}) if s.DetectorId != nil { v := *s.DetectorId metadata := protocol.Metadata{} e.SetValue(protocol.PathTa...
[ 0.22242067754268646, 0.6497891545295715, 0.22238343954086304, -0.5290778875350952, 0.37983614206314087, 0.5836696028709412, 0.18147049844264984, -0.0689585730433464, -0.12788502871990204, 0.20446617901325226, -0.06610873341560364, 0.16149522364139557, -0.449678897857666, 0.4116072356700897...
func (s DescribeOrganizationConfigurationOutput) String() string { return awsutil.Prettify(s) }
[ 0.9202505350112915, 0.11556736379861832, 0.20314548909664154, -0.14591708779335022, -0.5748069882392883, 0.020301297307014465, 1.0086617469787598, -0.7852558493614197, -0.625526487827301, 0.14437535405158997, 0.2963259220123291, 0.3477378189563751, 0.6026597619056702, -0.08836473524570465,...
func (s DescribeOrganizationConfigurationOutput) MarshalFields(e protocol.FieldEncoder) error { if s.AutoEnable != nil { v := *s.AutoEnable metadata := protocol.Metadata{} e.SetValue(protocol.BodyTarget, "autoEnable", protocol.BoolValue(v), metadata) } if s.MemberAccountLimitReached != nil { v := *s.MemberA...
[ 0.2480783611536026, 0.6914722919464111, 0.25577011704444885, -0.24261437356472015, 0.2840012013912201, 0.4301859438419342, 0.3406078517436981, 0.32159772515296936, -0.4507892429828644, 0.47275057435035706, -0.1863950937986374, 0.2525389492511749, -0.7281100153923035, 0.11814279109239578, ...
func (r DescribeOrganizationConfigurationRequest) Send(ctx context.Context) (*DescribeOrganizationConfigurationResponse, error) { r.Request.SetContext(ctx) err := r.Request.Send() if err != nil { return nil, err } resp := &DescribeOrganizationConfigurationResponse{ DescribeOrganizationConfigurationOutput: r.R...
[ -0.856040358543396, 0.7293292880058289, 0.3555600643157959, 0.09245794266462326, -0.04738966375589371, -0.23295429348945618, 0.2433120459318161, -0.9922458529472351, -0.03423044830560684, 0.38387805223464966, -0.45065751671791077, 0.8063914775848389, 0.15107019245624542, 0.6179255247116089...
func (r *DescribeOrganizationConfigurationResponse) SDKResponseMetdata() *aws.Response { return r.response }
[ -0.05687383562326431, 0.34509122371673584, 0.29381611943244934, -0.3209537863731384, -0.14852271974086761, -0.02331499755382538, -0.22654488682746887, -0.2850380837917328, 0.5668692588806152, 0.4246980845928192, -0.3605290353298187, -0.12210153043270111, 0.3634769916534424, -0.390592485666...
func TestStore(t *testing.T, supplier streams.StoreSupplier, pc streams.ProcessorContext) { var err error var store streams.Store key := randStringBytes(8) value := randStringBytes(32) t.Run("initialize", func(t *testing.T) { store = supplier() if initializer, ok := store.(streams.Initializer); ok { err =...
[ -0.058936990797519684, 0.15465332567691803, 0.7954092025756836, -0.5684950947761536, -0.20889092981815338, -0.0602678619325161, 0.66642826795578, -0.9882400035858154, 0.9578114748001099, -0.38940584659576416, -0.11982410401105881, 0.4068708121776581, -0.5008472204208374, -0.031482577323913...
func (s *WebMethodStep) PrepareMarshal() { s.BaseStep.PrepareMarshal() s.Type = TypeWebMethod }
[ 0.010118902660906315, 0.1495499610900879, 0.26197585463523865, 0.9443907737731934, -0.1622769832611084, -0.13161416351795197, 0.9525144100189209, 0.15205399692058563, 0.8009916543960571, -0.6862211227416992, 0.2974144220352173, 0.36647942662239075, 0.22323505580425262, 2.246612548828125, ...
func (s *WebMethodStep) Validate() []error { errs := []error{} if _, ok := validMethods[s.Method]; !ok { errs = append(errs, fmt.Errorf("%s is not a valid method", s.Method)) } if u, err := url.Parse(s.URL); err != nil { errs = append(errs, fmt.Errorf("%s is not a valid URL: %s", s.URL, err.Error())) } else i...
[ -0.6645119190216064, 0.004645810928195715, 0.5524587035179138, 0.9070158004760742, 0.011221639811992645, -0.017637962475419044, -0.35511884093284607, -0.13339734077453613, -0.2999001145362854, -0.3841821253299713, 0.5061652064323425, -0.2047782838344574, 0.2146412432193756, 1.6801168918609...
func (s *WebMethodStep) Do(ctx context.Context, exec Executor, flow *Flow) error { client := exec.GetHTTPClientFactory().GetHTTPClient(ctx, false) var body io.Reader // if PUT or POST, figure content type and body if s.Method == http.MethodPut || s.Method == http.MethodPost { switch data := flow.Data.(type) { ...
[ -0.045270733535289764, -0.1177590861916542, 0.9758443236351013, 0.24491021037101746, -0.2654373049736023, 0.2769806385040283, -0.12019412964582443, -0.8366648554801941, -0.2970863878726959, 0.1164739653468132, -0.08798343688249588, 1.1830605268478394, 0.06180617958307266, 1.213542699813842...
func GetYamlFileChanges(oldSpec, newSpec string) (ChangeLogEntries, error) { spec1, err := ReadYAMLFile(oldSpec) if err != nil { return nil, err } spec2, err := ReadYAMLFile(newSpec) if err != nil { return nil, err } changes, err := GetYamlNodeChanges(spec1, spec2) if err != nil { return nil, e...
[ 0.9660254120826721, -0.5438738465309143, 0.7598402500152588, -0.5434603691101074, -0.00441197631880641, -0.4945383369922638, -0.009259047918021679, 0.5508794188499451, -0.7536958456039429, 0.8730015754699707, -0.149473637342453, 1.4914093017578125, 0.5624117851257324, 1.0770140886306763, ...
func GetYamlNodeChanges(doc1, doc2 *yaml.Node) (ChangeLogEntries, error) { changes := ChangeLogEntries{} hashed1 := HashNode(doc1) hashed2 := HashNode(doc2) changes = diffNode(hashed1, hashed2) return changes, nil }
[ 0.3356431722640991, -0.38688772916793823, 0.7363934516906738, 0.23774823546409607, -0.6002857685089111, -0.18652626872062683, -0.3086075782775879, -0.16811592876911163, -0.3147154152393341, 0.5230266451835632, -0.9566969871520996, 1.6740161180496216, 0.5267311930656433, 1.0792416334152222,...
func ReadYAMLFile(filename string) (*yaml.Node, error) { f, err := os.Open(filename) if err != nil { return nil, err } decoder := yaml.NewDecoder(f) var cf yaml.Node err = decoder.Decode(&cf) if err != nil { return nil, err } return &cf, nil }
[ 0.6809704899787903, -0.22934319078922272, 0.6270424723625183, -1.0389389991760254, -0.6509544849395752, -0.18402531743049622, 0.1325562447309494, 1.10602605342865, -0.41654449701309204, 0.3466768264770508, -0.6311432719230652, 0.3526993691921234, 0.5753686428070068, -0.38454341888427734, ...
func NewSync(c *cli.Context) Sync { return Sync{ src: c.Args().Get(0), dst: c.Args().Get(1), op: c.Command.Name, fullCommand: commandFromContext(c), // flags delete: c.Bool("delete"), sizeOnly: c.Bool("size-only"), exitOnError: c.Bool("exit-on-error"), // flags fo...
[ 0.32281360030174255, -0.10925714671611786, 0.6531567573547363, 0.5742425918579102, -0.9106738567352295, -0.7229725122451782, 0.26566749811172485, -0.9214595556259155, -0.07431100308895111, 0.10751113295555115, 0.12476647645235062, 0.21862967312335968, 1.0348284244537354, -0.192782148718833...
func (s Sync) Run(c *cli.Context) error { srcurl, err := url.New(s.src, url.WithRaw(s.raw)) if err != nil { return err } dsturl, err := url.New(s.dst, url.WithRaw(s.raw)) if err != nil { return err } ctx, cancel := context.WithCancel(c.Context) sourceObjects, destObjects, err := s.getSourceAndDestination...
[ -0.5648913979530334, 0.14652004837989807, 1.0915837287902832, 0.3356875777244568, -0.057040199637413025, 0.06124868243932724, 1.3262946605682373, 0.3329378068447113, -0.10781720280647278, -0.31676167249679565, -0.6413351893424988, -0.22507353127002716, 0.3542160987854004, 0.379338562488555...
func compareObjects(sourceObjects, destObjects chan *storage.Object) (chan *url.URL, chan *url.URL, chan *ObjectPair) { var ( srcOnly = make(chan *url.URL, extsortChannelBufferSize) dstOnly = make(chan *url.URL, extsortChannelBufferSize) commonObj = make(chan *ObjectPair, extsortChannelBufferSize) srcName ...
[ -0.8666554093360901, -0.31976890563964844, 0.8519099950790405, -0.8874828815460205, -0.5018271803855896, -0.06823313981294632, 0.1965443640947342, -0.538984477519989, -0.4410717785358429, 0.06580452620983124, -0.32613202929496765, -0.18994024395942688, 0.6520965099334717, 0.109437555074691...
func (s Sync) getSourceAndDestinationObjects(ctx context.Context, cancel context.CancelFunc, srcurl, dsturl *url.URL) (chan *storage.Object, chan *storage.Object, error) { sourceClient, err := storage.NewClient(ctx, srcurl, s.storageOpts) if err != nil { return nil, nil, err } destClient, err := storage.NewClien...
[ -0.6872197389602661, 0.1581074297428131, 0.7127278447151184, -0.19526290893554688, -0.41572773456573486, -0.1605360209941864, 0.6372883319854736, -0.35071635246276855, -0.08284220844507217, 0.0984150692820549, -0.5518563389778137, 0.8486348986625671, 0.6724435687065125, 0.14619703590869904...
func (s Sync) planRun( c *cli.Context, onlySource, onlyDest chan *url.URL, common chan *ObjectPair, dsturl *url.URL, strategy SyncStrategy, w io.WriteCloser, isBatch bool, ) { defer w.Close() // Always use raw mode since sync command generates commands // from raw S3 objects. Otherwise, generated copy comman...
[ -0.5452366471290588, 0.021686622872948647, 0.9837526679039001, 0.010304071009159088, -0.04127500578761101, 0.4929365813732147, 1.1342639923095703, 0.39673858880996704, 0.409926176071167, 0.12056542187929153, -0.12348020821809769, 0.26136261224746704, 0.8181164860725403, 0.0872841402888298,...
func generateDestinationURL(srcurl, dsturl *url.URL, isBatch bool) *url.URL { objname := srcurl.Base() if isBatch { objname = srcurl.Relative() } if dsturl.IsRemote() { if dsturl.IsPrefix() || dsturl.IsBucket() { return dsturl.Join(objname) } return dsturl.Clone() } return dsturl.Join(objname) }
[ -1.1398077011108398, 0.4451957941055298, 0.8486911654472351, 0.27709832787513733, -0.6314892768859863, 1.0067578554153442, -0.21739672124385834, 0.41464343667030334, -0.1212160661816597, 0.3429749608039856, -0.8311727046966553, -0.2289007008075714, 1.2762117385864258, -0.09609028697013855,...
func (s Sync) shouldSkipObject(object *storage.Object, verbose bool) bool { if object.Type.IsDir() || errorpkg.IsCancelation(object.Err) { return true } if err := object.Err; err != nil { if verbose { printError(s.fullCommand, s.op, err) } return true } if object.StorageClass.IsGlacier() { if verbos...
[ -0.6387620568275452, -0.05584857240319252, 0.911247193813324, 1.0011669397354126, -0.26340219378471375, 0.9637889266014099, 0.6114906668663025, -0.4560212194919586, 0.30971747636795044, 0.47649094462394714, -0.08703508973121643, 0.016503864899277687, 0.40293967723846436, -0.208918988704681...
func (s Sync) shouldStopSync(err error) bool { if err == storage.ErrNoObjectFound { return false } if awsErr, ok := err.(awserr.Error); ok { switch awsErr.Code() { case "AccessDenied", "NoSuchBucket": return true } } return s.exitOnError }
[ -0.657593846321106, 0.19304631650447845, 0.6754512786865234, -0.2904662787914276, 0.003243842162191868, 0.11901694536209106, -0.06890860199928284, -0.29586470127105713, -0.15047483146190643, -0.673231303691864, -0.5282708406448364, 0.17753611505031586, 0.586857795715332, 0.0872157737612724...
func SendDockerData(dCon docker.DockerContainer) (int, error) { jsonStr, err := json.Marshal(dCon) if err != nil { return 0, fmt.Errorf("Error marshalling docker json to send to pod-logger: %v\n", err) } resp, err := sendLog(jsonStr, config.DockerURL) if err != nil { return 0, fmt.Errorf("Error sending log: %v...
[ -1.388667345046997, 0.3851126730442047, 0.7369264364242554, -0.39295947551727295, -0.5199770927429199, -0.11736229807138443, 0.0377982035279274, -0.04244829714298248, -0.5583886504173279, 0.3103441894054413, -0.4743594229221344, 0.4805276393890381, -0.13056664168834686, 0.8646661639213562,...
func SendCrioData(mStat models.Status) (int, error) { jsonStr, err := json.Marshal(mStat) if err != nil { return 0, fmt.Errorf("Error marshalling crio json to send to pod-logger: %v\n", err) } resp, err := sendLog(jsonStr, config.CrioURL) if err != nil { return 0, fmt.Errorf("Error sending log: %v\n", err) } ...
[ -0.6092193722724915, -0.05147620290517807, 0.6009854674339294, 0.021238898858428, -0.35538625717163086, 0.5112919807434082, -0.35550132393836975, -0.2726115584373474, -0.9745331406593323, 0.7224714159965515, -1.252699375152588, 0.3467276990413666, -0.1417449712753296, 0.27413269877433777, ...
func SendClamData(sRes api.ScanResult) (int, error) { jsonStr, err := json.Marshal(sRes) if err != nil { return 0, fmt.Errorf("Error marshalling clam json to send to pod-logger: %v\n", err) } resp, err := sendLog(jsonStr, config.ClamURL) if err != nil { return 0, fmt.Errorf("Error sending log: %v\n", err) } ...
[ -1.0994268655776978, 0.554125189781189, 0.5912390351295471, 0.07681488990783691, -0.507378339767456, 0.20916299521923065, -0.1886293888092041, -0.8160462975502014, -0.3491942882537842, 0.6369795799255371, -0.7260741591453552, 0.4663885533809662, -0.609515368938446, 0.3419736325740814, 0....
func New(restConfig *rest.Config) (AutoDetect, error) { dcl, err := discovery.NewDiscoveryClientForConfig(restConfig) if err != nil { // it's pretty much impossible to get into this problem, as most of the // code branches from the previous call just won't fail at all, // but let's handle this error anyway... ...
[ 0.6105754971504211, -1.0597962141036987, 0.3218758702278137, 0.5721226930618286, -0.026877760887145996, -0.7182970643043518, 0.07929660379886627, -0.0824923887848854, -0.5275060534477234, -1.1319587230682373, -0.49359455704689026, 0.15287594497203827, 0.4291730225086212, 0.7436352968215942...
func (a *autoDetect) IsOpenshift() (bool, error) { apiList, err := a.dcl.ServerGroups() if err != nil { return false, err } apiGroups := apiList.Groups for i := 0; i < len(apiGroups); i++ { if apiGroups[i].Name == "route.openshift.io" { return true, nil } } return false, nil }
[ -1.040117859840393, -0.37876537442207336, 0.8009702563285828, 0.40861958265304565, -0.39043447375297546, -0.21457137167453766, 0.3542591631412506, -0.5831376314163208, 0.5697852969169617, -0.18622362613677979, -0.30563926696777344, -0.013875424861907959, -0.8193956017494202, 1.427673101425...
func OnGoingGame(game *api.Game) { reader := bufio.NewReader(os.Stdin) for { fmt.Print("Enter a letter: ") letter, _ := reader.ReadString('\n') letter = strings.TrimSpace(letter) if isLetter(letter) { output, err := GuessALetter(hangmanClient, game, letter) if err != nil { // should move them away ...
[ 0.03867720812559128, -0.9584939479827881, 0.683933436870575, -0.03307642787694931, -0.23521055281162262, 0.6840515732765198, 0.08763617277145386, 0.4803813695907593, -0.47084909677505493, 0.8304693102836609, 0.28049612045288086, 0.4625284671783447, -1.3716074228286743, 0.3903040885925293, ...
func GuessALetter(client api.HangmanClient, game *api.Game, letter string) (string, error) { var reply string ctx, cancel := AppContext() defer cancel() if game.Id > 0 { nGame, err := client.GuessLetter(ctx, &api.GuessRequest{GameID: game.Id, Letter: letter}) if err != nil { return "", err } //refact...
[ -0.6055131554603577, -0.9228823184967041, 0.7060599327087402, -0.398188978433609, -0.5597285032272339, 0.052439041435718536, -0.7078506350517273, -0.8474124073982239, 0.036825209856033325, 0.7373474836349487, 0.2504514455795288, 0.5785310864448547, -0.9697675108909607, 0.69343101978302, ...
func checkIfYouLost(err error) { if strings.Contains(fmt.Sprintf("%s", err), "you lost") { fmt.Println("▓██ ██▓ ▒█████ █ ██ ▓█████▄ ██▓▓█████ ▓█████▄ ") fmt.Println(" ▒██ ██▒▒██▒ ██▒ ██ ▓██▒ ▒██▀ ██▌▓██▒▓█ ▀ ▒██▀ ██▌") fmt.Println(" ▒██ ██░▒██░ ██▒▓██ ▒██░ ░██ █▌▒██▒▒███ ░██ █▌") f...
[ 0.19880345463752747, -0.13869120180606842, 0.7612210512161255, -0.25341954827308655, -0.052709177136421204, -0.027765976265072823, 0.16616211831569672, -0.21710115671157837, 0.5680946707725525, 0.762199878692627, -0.21352489292621613, 0.7471123933792114, -0.326438307762146, 0.6115995049476...
func checkIfYouWin(err error) { if strings.Contains(fmt.Sprintf("%s", err), "you won") { fmt.Println("██╗ ██╗ ██████╗ ██╗ ██╗ ██╗ ██╗ ██████╗ ███╗ ██╗") fmt.Println("╚██╗ ██╔╝██╔═══██╗██║ ██║ ██║ ██║██╔═══██╗████╗ ██║") fmt.Println(" ╚████╔╝ ██║ ██║██║ ██║ ██║ █╗ ██║██║ ██║██╔██╗ ██...
[ 0.1890861839056015, 0.16551785171031952, 0.9613475799560547, 0.4434354305267334, -0.45902854204177856, 0.48173239827156067, 0.37233468890190125, 0.44668805599212646, 0.4333626329898834, 0.5058103799819946, 0.0016252236673608422, 1.4296985864639282, -0.23921066522598267, 1.1776424646377563,...