text
stringlengths
11
6.3k
embedding
listlengths
768
768
func (i *ImageBuf) ZEnd() int { ret := int(C.ImageBuf_zend(i.ptr)) runtime.KeepAlive(i) return ret }
[ -0.1563788205385208, -1.061824917793274, 0.4642031192779541, 0.16915790736675262, -0.6440035700798035, 0.16416016221046448, 1.8642661571502686, -0.972324013710022, -0.1374255120754242, -0.8900601863861084, -0.03635969012975693, -0.11248436570167542, -1.62237548828125, 0.4850258231163025, ...
func (i *ImageBuf) XMin() int { ret := int(C.ImageBuf_xmin(i.ptr)) runtime.KeepAlive(i) return ret }
[ -0.2704200744628906, -0.4820635914802551, 0.1841411590576172, -0.004353267606347799, -1.1007660627365112, -0.16247914731502533, 0.4241592288017273, -1.630204200744629, 0.1745908409357071, -0.746163010597229, -0.7410434484481812, -0.27640825510025024, -1.8483998775482178, 0.1305036097764969...
func (i *ImageBuf) XMax() int { ret := int(C.ImageBuf_xmax(i.ptr)) runtime.KeepAlive(i) return ret }
[ -0.5357956886291504, 0.3085477948188782, 0.4295804500579834, 0.2957111895084381, -0.5622873902320862, -0.509258508682251, 0.1775132715702057, -0.5915883183479309, 0.1281583160161972, -0.12483426928520203, -0.7534777522087097, 0.22956018149852753, -1.3475316762924194, 0.14572902023792267, ...
func (i *ImageBuf) YMin() int { ret := int(C.ImageBuf_ymin(i.ptr)) runtime.KeepAlive(i) return ret }
[ -0.6034578084945679, -1.1066749095916748, 0.41253936290740967, 0.06295192241668701, -0.7747411727905273, -0.31011366844177246, 0.9103259444236755, -1.4128447771072388, 0.04479586333036423, -1.490220069885254, -0.9264661073684692, 0.02324885129928589, -1.3736979961395264, 0.3844566941261291...
func (i *ImageBuf) YMax() int { ret := int(C.ImageBuf_ymax(i.ptr)) runtime.KeepAlive(i) return ret }
[ -0.5478968620300293, -0.36431261897087097, 0.6411404013633728, 0.5355468392372131, -0.27094414830207825, -0.6612235903739929, 0.7289558053016663, -0.37944918870925903, 0.014481490477919579, -0.9296181201934814, -1.1243022680282593, 0.6873245239257812, -0.8431994318962097, 0.546925961971283...
func (i *ImageBuf) ZMin() int { ret := int(C.ImageBuf_zmin(i.ptr)) runtime.KeepAlive(i) return ret }
[ -0.684026300907135, -0.9617454409599304, 0.10652851313352585, -0.008163966238498688, -0.98349928855896, -0.24097414314746857, 1.117493748664856, -1.820055603981018, 0.15147842466831207, -1.2068569660186768, -0.449319064617157, -0.19619302451610565, -2.101907253265381, 0.1729832887649536, ...
func (i *ImageBuf) ZMax() int { ret := int(C.ImageBuf_zmax(i.ptr)) runtime.KeepAlive(i) return ret }
[ -0.6844451427459717, -0.07473470270633698, 0.3922416865825653, 0.4546235501766205, -0.6259493827819824, -0.6611238718032837, 0.9398723244667053, -0.7755860090255737, 0.3101309835910797, -0.4857504367828369, -0.6466840505599976, 0.40446069836616516, -1.4239203929901123, 0.00247753388248384,...
func (i *ImageBuf) SetFull(xbegin, xend, ybegin, yend, zbegin, zend int) { C.ImageBuf_set_full( i.ptr, C.int(xbegin), C.int(xend), C.int(ybegin), C.int(yend), C.int(zbegin), C.int(zend)) runtime.KeepAlive(i) }
[ 0.19044406712055206, -0.3000028133392334, 0.3730124235153198, -0.03990199416875839, -0.08119501173496246, 0.2716314196586609, 1.1831861734390259, -0.6597508788108826, -0.40671080350875854, 0.1096569150686264, -1.1982896327972412, 0.31329238414764404, -0.9084473252296448, -0.124739885330200...
func (i *ImageBuf) ROI() *ROI { ret := newROI(C.ImageBuf_roi(i.ptr)) runtime.KeepAlive(i) return ret }
[ 0.13649579882621765, -0.867929995059967, 0.254060298204422, 0.3819388449192047, -0.0879470631480217, -0.5287638902664185, 0.6840391159057617, -0.9671791195869446, -0.3744649291038513, -0.7264900803565979, -0.5599134564399719, 0.012174133211374283, -1.909253716468811, -1.2989732027053833, ...
func (i *ImageBuf) ROIFull() *ROI { ret := newROI(C.ImageBuf_roi_full(i.ptr)) runtime.KeepAlive(i) return ret }
[ 0.9170169830322266, -0.4984378218650818, 0.5154678225517273, 0.38747885823249817, -0.24813717603683472, -0.14771988987922668, 0.2878727614879608, -0.5148552656173706, 0.1474127471446991, 0.4778667688369751, -1.3024715185165405, 0.20981504023075104, -1.202165961265564, -0.7887200713157654, ...
func (i *ImageBuf) SetROIFull(roi *ROI) error { C.ImageBuf_set_roi_full(i.ptr, roi.ptr) runtime.KeepAlive(i) runtime.KeepAlive(roi) return i.LastError() }
[ -0.18292316794395447, -0.7156267762184143, 0.5183237195014954, 0.19907286763191223, -0.20083996653556824, 0.06315509229898453, 0.7089490294456482, -0.68141770362854, -0.1766776442527771, 0.5573223829269409, -1.4028371572494507, 0.178463876247406, -1.5787076950073242, -0.08066339045763016, ...
func (i *ImageBuf) ImageCache() *ImageCache { ret := &ImageCache{C.ImageBuf_imagecache(i.ptr)} runtime.KeepAlive(i) return ret }
[ -0.2903222441673279, -1.2715169191360474, 0.23656296730041504, 0.1450471431016922, -0.6525264382362366, -0.501681387424469, 0.1915888488292694, -0.6424775719642639, 0.07542631030082703, -0.0663859024643898, 0.12050343304872513, -0.4218948781490326, -1.2875385284423828, -0.1467830091714859,...
func (i *ImageBuf) Deep() bool { ret := bool(C.ImageBuf_deep(i.ptr)) runtime.KeepAlive(i) return ret }
[ -0.8360153436660767, 0.4715084731578827, 0.6869921088218689, -0.1566186249256134, -0.38770970702171326, 1.355129599571228, 0.7740562558174133, -0.7105705738067627, -0.4293961822986603, -1.0361902713775635, -1.1369898319244385, 0.18359063565731049, -1.4696056842803955, 0.10969115048646927, ...
func registerModelModel31Flags(depth int, cmdPrefix string, cmd *cobra.Command) error { if err := registerModel31Addresses(depth, cmdPrefix, cmd); err != nil { return err } if err := registerModel31Device(depth, cmdPrefix, cmd); err != nil { return err } if err := registerModel31Hostname(depth, cmdPrefix, c...
[ -0.45936501026153564, 0.9092706441879272, 1.012818694114685, 0.4718776047229767, 0.9182865619659424, 1.686414361000061, -0.19301819801330566, -0.5309624075889587, 0.07376393675804138, -0.2887342870235443, -0.19492138922214508, 0.5636991262435913, -0.4538050591945648, 1.4260894060134888, ...
func retrieveModelModel31Flags(depth int, m *models.Model31, cmdPrefix string, cmd *cobra.Command) (error, bool) { retAdded := false err, addressesAdded := retrieveModel31AddressesFlags(depth, m, cmdPrefix, cmd) if err != nil { return err, false } retAdded = retAdded || addressesAdded err, deviceAdded := retr...
[ -0.1025773137807846, 0.36791926622390747, 0.9721631407737732, 0.18149061501026154, 0.5228502154350281, 1.3566852807998657, 0.14317747950553894, -0.8527393937110901, 0.32676053047180176, -0.6637510061264038, 0.2710643708705902, 0.5685803294181824, -0.7620319724082947, 1.5495929718017578, ...
func cutOff(array []string, first, last bool) []string { if len(array) > 0 && first { array = array[1:] } if len(array) > 0 && last { array = array[:len(array)-1] } return array }
[ 0.0033886071760207415, -0.4697147607803345, 0.6998848915100098, 0.13498564064502716, -0.30424508452415466, 0.6963644623756409, -0.6456102132797241, 0.7045966386795044, 0.06133709102869034, 1.5556845664978027, 0.7856863141059875, 0.9627608060836792, -0.13184446096420288, -0.1433111429214477...
func NewRule(ruleType RuleType, value string) *Rule { rule := &Rule{ Type: ruleType, Length: len(value), } parts, hasPrefix, hasSuffix := splitPathValue(value) if hasPrefix { rule.Prefix = parts[0] } if hasSuffix { rule.Suffix = parts[len(parts)-1] } // If this is the case, the rule was something like...
[ 0.6922887563705444, -0.18044647574424744, 0.28907057642936707, -0.2688295245170593, -0.20615118741989136, -0.16441869735717773, 0.21106396615505219, 0.25429779291152954, 0.2433546930551529, 0.09716804325580597, 0.769345223903656, 0.9269244074821472, -0.26372405886650085, 0.0737696737051010...
func (r *Rule) Match(path string) bool { if r.Equals != "" { return r.Equals == path } if r.Prefix != "" && !strings.HasPrefix(path, r.Prefix) { return false } if r.Suffix != "" && !strings.HasSuffix(path, r.Suffix) { return false } if len(r.Needles) > 0 { // Remove prefix and suffix, otherwise the needl...
[ 0.11945857107639313, 0.20594607293605804, 0.5173835754394531, -0.8587440848350525, -0.34231480956077576, 0.36057162284851074, 0.6661611795425415, 0.1325213760137558, -0.1815282553434372, 0.6259053945541382, 0.1349121481180191, 0.09464205801486969, -0.5708182454109192, -0.003006692975759506...
func (g *Group) HasMembers() bool { return len(g.Allow) != 0 || len(g.Disallow) != 0 || g.CrawlDelay != "" }
[ -0.21970562636852264, 0.7023050785064697, 0.3339318037033081, -0.4931209087371826, 0.4022294580936432, 0.27578046917915344, -0.08234088122844696, 0.7463720440864563, -1.074567437171936, -0.6096788644790649, 0.5101290345191956, -0.026723099872469902, -1.3356397151947021, 1.1394089460372925,...
func (g *Group) HasUserAgents() bool { return len(g.UserAgents) != 0 }
[ -0.24871021509170532, -0.30259984731674194, 0.3321991562843323, 0.04999420419335365, 0.09418687969446182, -0.26131370663642883, 0.23473604023456573, 0.30696284770965576, 0.6541674137115479, -0.10400780290365219, -0.7238921523094177, -0.7615596652030945, -0.7153431177139282, -0.011269174516...
func (g *Group) Matches(name string) (bool, int) { match, length := false, 0 for _, agent := range g.UserAgents { // A wildcard matches all agents, but it's also the weakest match // according to Google, so keep the length set to zero. if agent == "*" { match = true } if strings.HasPrefix(name, agent) { ...
[ -0.8409018516540527, -0.3916909992694855, 0.6124362945556641, -0.7580999135971069, -0.9511538147926331, -0.2981742024421692, -0.48392733931541443, 0.7910803556442261, 0.35066816210746765, 0.11510498076677322, -0.5913940668106079, -0.18110403418540955, -0.7019546627998352, 0.126706063747406...
func NewGroups(r io.Reader) (groups Groups) { active := &Group{} // Ignore possible UTF-8 byte order mark at the beginning of the // robots.txt file, just like Google does. buffer := bufio.NewReader(r) if data, err := buffer.Peek(3); err == nil && string(data) == "\xef\xbb\xbf" { buffer.Read(data) } scanner :=...
[ -0.2518012225627899, -0.7727286219596863, 0.29854997992515564, -0.2752257287502289, -0.7685494422912598, -0.3978748023509979, 0.1800081431865692, -0.11876856535673141, -0.3811754286289215, -0.12116023153066635, 0.38252416253089905, 0.15045015513896942, -0.6083613038063049, 0.02185025997459...
func (g Groups) Find(name string) (result *Group) { // User-agent names are case-insensitive. name = strings.ToLower(name) // Google says: // The crawler must determine the correct group of records by finding the // group with the most specific user-agent that still matches. longest := -1 for _, group := range...
[ -0.21735301613807678, 0.6047443151473999, 0.37421393394470215, -0.7758368849754333, -0.4340195655822754, -0.6642581820487976, 0.26067206263542175, -1.12624192237854, -0.6110900044441223, 0.12883983552455902, 0.08155915886163712, -0.4464612901210785, -0.585511326789856, 0.8886989951133728, ...
func (r *Robots) add(rule *Rule) { if rule.Length > 0 { r.Rules = append(r.Rules, rule) } }
[ -0.03502868860960007, 0.5312901735305786, 0.15090912580490112, -0.5464411973953247, 1.6808539628982544, 1.0687735080718994, -1.1433669328689575, 0.3415304124355316, 0.5991263389587402, -0.3777625262737274, 0.4621214270591736, 0.6199238896369934, -0.8698672652244568, 1.609427571296692, 0....
func New(r io.Reader, useragent string) *Robots { group := NewGroups(r).Find(useragent) if group == nil { return &Robots{} } result := &Robots{} for _, value := range group.Allow { result.add(NewRule(TypeAllow, value)) } for _, value := range group.Disallow { result.add(NewRule(TypeDisallow, value)) } if...
[ -0.3043668270111084, -0.34457316994667053, 0.2950158417224884, -0.301971971988678, -0.979669451713562, -0.3536544144153595, 0.4619941711425781, 0.027766486629843712, -1.0167402029037476, 0.13160036504268646, 0.6007517576217651, -0.08023838698863983, -0.2867960035800934, 0.23211371898651123...
func (r *Robots) Allow(path string) bool { var match *Rule for _, rule := range r.Rules { if rule.Match(path) { if match == nil || rule.Length > match.Length { match = rule } } } return match == nil || match.Type == TypeAllow }
[ -0.19329653680324554, 0.12340046465396881, 0.7546995878219604, 0.061567023396492004, -0.3933488428592682, 0.36687642335891724, 0.17324481904506683, 0.05039645731449127, -0.7258620858192444, 0.7559174299240112, 1.2832038402557373, 0.09892894327640533, -1.1356257200241089, 0.642662525177002,...
func (d *Cookie) Get(w http.ResponseWriter, r *http.Request, v any) (bool, error) { s, err := webmiddleware.GetSecureCookie(r.Context()) if err != nil { return false, err } cookie, err := r.Cookie(d.Name) if err != nil || cookie.Value == tombstone { return false, nil } err = s.Decode(d.Name, cookie.Value, ...
[ -0.3914690613746643, 0.1992160826921463, 0.9834022521972656, 0.08814167231321335, -0.4987330138683319, -0.7988021969795227, -0.5213646292686462, -0.4249725341796875, 0.2557797431945801, 0.7735906839370728, -0.06298388540744781, 0.5887485146522522, -0.620861828327179, -0.12527135014533997, ...
func (d *Cookie) Set(w http.ResponseWriter, r *http.Request, v any) error { s, err := webmiddleware.GetSecureCookie(r.Context()) if err != nil { return err } str, err := s.Encode(d.Name, v) if err != nil { return err } c := d.new(r) c.Value = str http.SetCookie(w, &c) return nil }
[ -0.4934776723384857, -0.3757580816745758, 0.3505804240703583, -0.4809349775314331, -0.4013669490814209, -0.2824857532978058, -0.33971330523490906, -0.4339601993560791, -0.014724676497280598, 0.49278193712234497, -0.3092823922634125, 1.2738534212112427, 0.04189230874180794, 0.26860085129737...
func (d *Cookie) Exists(r *http.Request) bool { cookie, err := r.Cookie(d.Name) return err == nil && cookie.Value != tombstone }
[ -1.4997799396514893, 0.04590051993727684, 0.43604373931884766, 0.0243852436542511, 0.1665148288011551, -0.3280676007270813, -0.6865031123161316, -0.8203041553497314, -0.0302767064422369, 0.5623538494110107, 0.5341708660125732, 0.1869117021560669, 0.781894862651825, 0.5575200319290161, -0...
func (d *Cookie) Remove(w http.ResponseWriter, r *http.Request) { if !d.Exists(r) { return } c := d.new(r) c.Expires = time.Unix(1, 0) c.MaxAge = 0 c.Value = tombstone http.SetCookie(w, &c) }
[ -0.799688458442688, 0.18727684020996094, 0.41262170672416687, 0.0341525636613369, -0.5802313089370728, -0.5609951019287109, 0.006552267353981733, 0.2937232553958893, 0.15301910042762756, 0.3628264367580414, 0.18442295491695404, -0.2393808811903, -0.2505529224872589, 0.42777204513549805, ...
func Destroy(ctx context.Context) *cobra.Command { options := &Options{ Variables: []string{}, } cmd := &cobra.Command{ Use: "destroy", Short: `Destroy everything created by the 'okteto deploy' command`, Long: `Destroy everything created by the 'okteto deploy' command. You can also include a 'destroy' se...
[ 0.4762769341468811, -0.6005789637565613, 0.8291085958480835, 0.3121485114097595, 0.5972170233726501, -0.06442841142416, -0.037666235119104385, -0.31536734104156494, 0.39379459619522095, 0.10385402292013168, 0.9855527877807617, 0.5670844316482544, -0.6276021599769592, 0.8316981792449951, ...
func (fn GetReposOwnerRepoIssuesEventsHandlerFunc) Handle(params GetReposOwnerRepoIssuesEventsParams) middleware.Responder { return fn(params) }
[ 0.6282464861869812, 0.22680863738059998, 0.5165944695472717, 0.3812616169452667, 0.2666555941104889, -0.6478209495544434, 0.5076356530189514, 0.07896900922060013, 0.5210481286048889, -0.5788071751594543, 0.27233579754829407, -0.30999958515167236, -0.4304242432117462, -0.6212237477302551, ...
func NewGetReposOwnerRepoIssuesEvents(ctx *middleware.Context, handler GetReposOwnerRepoIssuesEventsHandler) *GetReposOwnerRepoIssuesEvents { return &GetReposOwnerRepoIssuesEvents{Context: ctx, Handler: handler} }
[ 0.7939400672912598, -0.00003509839370963164, 0.48272496461868286, 0.4006445109844208, 0.4367058277130127, -0.8067478537559509, 0.2897675931453705, 0.1861521601676941, 0.3910873830318451, -0.6144633293151855, -0.48882991075515747, -0.1420234888792038, -0.15366162359714508, -0.34555616974830...
func ParseWithoutCheck(token []byte) (*Claims, error) { var c Claims firstDot, lastDot, sig, _, err := c.scan(token) if err != nil { return nil, err } return &c, c.applyPayload(token[firstDot+1:lastDot], sig) }
[ 0.7290893793106079, 0.016095304861664772, 0.4810362160205841, -0.1433604657649994, -0.21851637959480286, -0.17429593205451965, -0.3650740385055542, -0.5525065064430237, 0.4191751480102539, -1.1999847888946533, -0.1873091161251068, -0.054274678230285645, -0.5900346636772156, 0.2988206744194...
func EdDSACheck(token []byte, key ed25519.PublicKey) (*Claims, error) { var c Claims firstDot, lastDot, sig, alg, err := c.scan(token) if err != nil { return nil, err } if alg != EdDSA { return nil, AlgError(alg) } if !ed25519.Verify(key, token[:lastDot], sig) { return nil, ErrSigMiss } return &c, c.a...
[ -0.20065705478191376, 0.7371945977210999, 0.507244348526001, -0.4604443907737732, -0.27292996644973755, -0.01540408656001091, -0.3830483555793762, -0.28053000569343567, 0.13531625270843506, 0.5991058349609375, 0.66093510389328, 0.9587060213088989, 0.3650422990322113, 0.6437286138534546, ...
func (c *Claims) applyPayload(encoded, buf []byte) error { buf = buf[:cap(buf)] n, err := encoding.Decode(buf, encoded) if err != nil { return fmt.Errorf("jwt: malformed payload: %w", err) } buf = buf[:n] c.Raw = json.RawMessage(buf) if err = json.Unmarshal(buf, &c.Set); err != nil { return fmt.Errorf("jwt: ...
[ 0.06933348625898361, -0.23743735253810883, 0.5873456597328186, -0.9847758412361145, -0.830707311630249, -0.4048425853252411, -0.06037679687142372, -0.23743917047977448, 0.5671132802963257, -0.12987761199474335, 0.4529506266117096, 0.7810645699501038, 0.2889229655265808, 0.2226942926645279,...
func (c *Client) TipLog(names []string, lineCount int) error { sgs, err := c.getServiceList(names, false) if err != nil { return errors.WithStack(err) } c.tipLogServicesOrGroups(sgs, lineCount) return nil }
[ -1.233513355255127, 0.4957101345062256, 0.44362154603004456, 0.023498309776186943, -0.13917088508605957, -0.0808119997382164, 0.014561088755726814, -0.3325110375881195, -0.5514797568321228, 0.28436365723609924, 0.0919414609670639, -0.17730511724948883, 0.1406836211681366, 0.548974156379699...
func (c *Context) Child(t *testing.T) *Context { return &Context{ RW: c.RW, Admin: c.Admin, NoAuth: c.NoAuth, Config: c.Config, T: t, } }
[ 1.1728732585906982, -0.7498884201049805, 0.31112098693847656, -0.3262856900691986, -0.7498034834861755, 1.143132209777832, 0.6431084871292114, -0.9363062381744385, 0.34331128001213074, -0.5883159637451172, -0.876056969165802, 0.0038494691252708435, 0.5062896013259888, -0.7144056558609009, ...
func (c *Context) Skip() { if c.Config.Bool(c.T, "skip") { c.T.Skip("Test skipped by suite configuration") } }
[ 0.1462641805410385, 0.7480676174163818, 0.37333929538726807, 0.7641414403915405, 0.5610453486442566, 0.6360036134719849, 1.5593655109405518, -0.5626105070114136, 0.2981147766113281, 0.7709227800369263, -0.12109700590372086, -0.218994140625, 0.13932962715625763, -0.08250010013580322, -0.1...
func (c *Context) Skipf(format string, args ...interface{}) { c.T.Skipf(format, args...) }
[ -0.2499106228351593, -0.43157851696014404, 0.3858817517757416, 0.30874618887901306, 1.070174217224121, 0.5312293767929077, 1.053065538406372, 0.04937057942152023, -0.998831033706665, -0.4884233772754669, 0.2731933891773224, -0.5938515067100525, 0.6936631202697754, -0.28848108649253845, -...
func (c *Context) Logf(format string, args ...interface{}) { c.T.Logf(format, args...) }
[ 0.29059547185897827, -0.4443586766719818, 0.3186860680580139, -0.2313455194234848, 1.3141582012176514, -0.10986589640378952, 0.2308073341846466, 0.3700072467327118, -0.7096315026283264, -0.5704585313796997, -0.574090838432312, 0.04423636943101883, 0.6039828062057495, 0.13776163756847382, ...
func (c *Context) Fatalf(format string, args ...interface{}) { c.T.Fatalf(format, args...) }
[ 1.034727931022644, -0.6505268812179565, 0.2566782832145691, 0.19277457892894745, 1.079790711402893, 0.42599034309387207, 0.08600189536809921, 0.3490852415561676, 0.05117412656545639, -0.17778389155864716, 0.40164634585380554, -0.20768320560455322, 0.9247416853904724, -0.02897595800459385, ...
func (c *Context) MustBeSet(key string) { if !c.IsSet(key) { c.T.Fatalf("'%s' not set. Please configure this test.", key) } }
[ 0.1356622278690338, 0.5417723059654236, 0.3621509373188019, 0.14188875257968903, 1.0446068048477173, 0.7868437767028809, -0.6473032236099243, -1.0849343538284302, 0.4594323933124542, 1.0305956602096558, 0.20145165920257568, 0.46542888879776, 0.0485958531498909, 1.0401772260665894, -0.845...
func (c *Context) MustStringSlice(key string) []string { c.MustBeSet(key) return c.StringSlice(key) }
[ -1.1544065475463867, -0.45558950304985046, 0.09621031582355499, 0.20991653203964233, 0.4298974275588989, 0.06936764717102051, -1.2981377840042114, -0.8862069845199585, 0.28578677773475647, 0.9686415791511536, 0.4621731638908386, 0.07806636393070221, -0.13138659298419952, 0.8478794097900391...
func (c *Context) MustBool(key string) bool { c.MustBeSet(key) return c.Bool(key) }
[ -0.5346103310585022, 0.5948466062545776, 0.4441468417644501, 0.6558844447135925, -0.13156618177890778, 1.1913647651672363, -0.5122480392456055, -0.23379625380039215, 0.281913161277771, 1.7814286947250366, -0.04998236522078514, -0.06263028085231781, 0.13335342705249786, -0.3240569531917572,...
func (c *Context) IntSlice(key string) []int { v, _ := c.Config.Interface(c.T, key).([]int) return v }
[ -1.0614659786224365, 0.4356112778186798, 0.2607950270175934, 0.011857517994940281, 0.20702603459358215, -0.7635005712509155, -0.7695876359939575, -0.3418373465538025, -0.09310323745012283, 1.3913146257400513, -0.36797967553138733, 0.014086993411183357, -0.4977663457393646, 0.44881281256675...
func (c *Context) MustIntSlice(key string) []int { c.MustBeSet(key) return c.IntSlice(key) }
[ -1.9800798892974854, -0.06124222278594971, 0.1378735452890396, 0.3118722438812256, -0.000618915306404233, -0.06357226520776749, -1.1952816247940063, -0.5408813953399658, 0.22323773801326752, 0.8134040236473083, -0.14519114792346954, 0.12999245524406433, -0.6254678964614868, 1.1635581254959...
func (c *Context) StringSlice(key string) []string { return c.Config.StringSlice(c.T, key) }
[ -0.962761402130127, -0.48624446988105774, 0.2673385739326477, -0.28214025497436523, 0.2136901170015335, -0.3673703670501709, -1.1092169284820557, -0.6018624305725098, -0.40545856952667236, 1.4389857053756714, -0.49900245666503906, 0.1377781182527542, -0.6315390467643738, 0.1475566774606704...
func (c *Context) String(key string) string { return c.Config.String(c.T, key) }
[ -0.11047925055027008, -0.7095297574996948, -0.1401890367269516, -0.7553180456161499, -0.45450612902641296, 0.7162759304046631, 0.3157883286476135, -1.0499995946884155, -0.3234095275402069, 1.4568525552749634, -0.3103448152542114, -0.2953973114490509, -0.12149090319871902, -0.11492137610912...
func (c *Context) MustString(key string) string { c.MustBeSet(key) return c.String(key) }
[ -0.6895366907119751, -0.0909557193517685, 0.13891439139842987, 0.10272465646266937, -0.39973586797714233, 1.0605945587158203, -0.548552393913269, -1.5129741430282593, 0.5891491174697876, 1.033803105354309, 0.595225989818573, -0.34591054916381836, -0.46046510338783264, 0.17090792953968048, ...
func (c *Context) Int(key string) int { return c.Config.Int(c.T, key) }
[ -0.22310572862625122, 0.03656287491321564, 0.19952327013015747, -1.2695578336715698, -0.0810471773147583, 0.07387597858905792, 0.32031911611557007, -0.49490606784820557, -1.0930687189102173, 1.3657946586608887, -0.49271684885025024, -0.5956358909606934, 0.12174581736326218, 0.1561333388090...
func (c *Context) MustInt(key string) int { c.MustBeSet(key) return c.Int(key) }
[ -0.23992037773132324, 0.5721872448921204, 0.28917619585990906, -0.11462084203958511, -0.28529971837997437, 0.2979992926120758, -0.3975200355052948, -0.917428731918335, -0.3557417392730713, 1.2399282455444336, -0.0759534165263176, -0.7570827603340149, -0.37337663769721985, 0.063423484563827...
func (c *Context) Bool(key string) bool { return c.Config.Bool(c.T, key) }
[ -0.16108931601047516, 0.10107601433992386, 0.1023208424448967, -0.24476560950279236, 0.14654330909252167, 0.9315510392189026, 0.29119873046875, 0.7588689923286438, -0.32876113057136536, 1.5104906558990479, -0.4789940416812897, -0.36813464760780334, 0.3522413969039917, -0.6471810936927795, ...
func (c *Context) Options(key string) map[string]interface{} { i := c.Config.get(name(c.T), key) o, _ := i.(map[string]interface{}) return o }
[ -1.2604140043258667, -0.11034838110208511, 0.3714143931865692, -0.6984496712684631, 0.34328481554985046, -0.5714935064315796, -0.42440634965896606, -0.807901918888092, 0.30780819058418274, 1.4318197965621948, -0.3897439241409302, -0.5080408453941345, 0.2254704236984253, -0.0847062095999717...
func (c *Context) IsSet(key string) bool { return c.Interface(key) != nil }
[ -0.6600568294525146, 0.30244195461273193, 0.271724671125412, 0.08873780071735382, 0.38558152318000793, -0.19087673723697662, 0.11256477981805801, -0.5388669967651367, 0.025513531640172005, 1.072892665863037, -0.294613242149353, -0.2818306088447571, -0.5173773765563965, 0.13879159092903137,...
func Register(name string, fn testFunc) { tests[name] = fn }
[ -0.09963413327932358, 0.20313608646392822, 0.22980400919914246, -0.42742642760276794, 0.1878548115491867, -0.8719879984855652, -0.23359355330467224, 0.410543292760849, -0.45657095313072205, -0.64033442735672, -1.3420915603637695, 0.4874997138977051, -0.009979568421840668, -0.58028084039688...
func RunSubtests(ctx *Context) { for name, fn := range tests { ctx.Run(name, fn) } }
[ -0.34614309668540955, 0.09576306492090225, 0.44030845165252686, 0.2662868797779083, -0.09958808124065399, 0.9152368903160095, 0.25778356194496155, -0.21034668385982513, 0.2609998285770416, -1.223595142364502, -0.608350932598114, 0.5883811116218567, -0.5965312719345093, 0.05756780877709389,...
func (c *Context) TestDB() string { dbname := c.TestDBName() err := Retry(func() error { return c.Admin.CreateDB(context.Background(), dbname, c.Options("db")) }) if err != nil { c.Fatalf("Failed to create database: %s", err) } return dbname }
[ 0.3457646071910858, 0.9394220113754272, 0.46534067392349243, 0.6513838768005371, 0.6449846029281616, 0.7011516690254211, 0.6174634695053101, -1.2337498664855957, 0.8030608296394348, -0.09220696985721588, 0.9119244813919067, -0.1483955979347229, -1.1948144435882568, 0.17207036912441254, 0...
func (c *Context) TestDBName() string { return TestDBName(c.T) }
[ 0.2238157093524933, -0.09534125030040741, 0.28154122829437256, 0.13973543047904968, -0.3297848105430603, 0.4253186583518982, 0.7278083562850952, -0.5115298628807068, 0.6313194036483765, -0.11704109609127045, -0.05956876277923584, -0.6688904762268066, -0.9729129672050476, 0.0662819892168045...
func TestDBName(t *testing.T) string { id := strings.ToLower(t.Name()) id = invalidDBCharsRE.ReplaceAllString(id, "_") id = id[strings.Index(id, "/")+1:] id = strings.Replace(id, "/", "_", -1) + "$" rndMU.Lock() defer rndMU.Unlock() dbname := fmt.Sprintf("%s%s%016x", TestDBPrefix, id, rnd.Int63()) return dbname...
[ -0.45931363105773926, -0.036261435598134995, 0.49767670035362244, -0.7349044680595398, -0.6589460968971252, 0.13490889966487885, -0.04294139891862869, -0.4503282308578491, 0.6632525324821472, -0.0034393062815070152, -0.5668843984603882, -0.46333104372024536, -0.8916441202163696, 0.54287260...
func (c *Context) RunAdmin(fn testFunc) { if c.Admin != nil { c.Run("Admin", fn) } }
[ 0.2713257670402527, 0.4210206866264343, 0.2238011658191681, 0.6064125299453735, 0.5182194709777832, -0.2634281516075134, 0.08045918494462967, -0.6112865209579468, 0.3165423274040222, -0.6740904450416565, 0.14534738659858704, 0.8365649580955505, -0.07333982735872269, 0.46951454877853394, ...
func (c *Context) RunNoAuth(fn testFunc) { if c.NoAuth != nil { c.Run("NoAuth", fn) } }
[ -0.1849731206893921, 0.14354172348976135, 0.001993774436414242, -0.046407103538513184, 0.027955912053585052, -0.5430245995521545, 1.4584782123565674, 0.031385838985443115, 0.12804293632507324, -0.3945257365703583, -0.4694474935531616, 0.5762515068054199, -0.10343094170093536, 0.09551546722...
func (c *Context) RunRW(fn testFunc) { if c.RW { c.Run("RW", fn) } }
[ 0.21350057423114777, 0.3839532434940338, 0.4564211964607239, 0.23205243051052094, 0.5111526846885681, -0.27744975686073303, 0.8781483173370361, -0.42142611742019653, -0.2608744502067566, -0.9025017619132996, 0.28965672850608826, -0.13391079008579254, -0.024106578901410103, 0.84133255481719...
func (c *Context) RunRO(fn testFunc) { if !c.RW { fn(c) } }
[ 0.46607306599617004, 0.4864843785762787, 0.45460304617881775, 0.2192622423171997, 0.36703890562057495, -0.4654914438724518, 1.166401982307434, -0.22309154272079468, -0.4577706456184387, -1.1492867469787598, 0.03628372400999069, -0.23361562192440033, -0.3498068153858185, 0.6346642374992371,...
func (c *Context) Parallel() { c.T.Parallel() }
[ 1.182350516319275, 0.38112762570381165, 0.10841049998998642, 0.3502809405326843, 0.5249526500701904, 0.7128294706344604, 0.808878481388092, 0.4343593120574951, 0.13668988645076752, -0.24500876665115356, 0.06114102154970169, 0.5250936150550842, 0.1781669408082962, -0.0890408456325531, -0....
func Retry(fn func() error) error { bo := backoff.WithMaxRetries(backoff.NewExponentialBackOff(), maxRetries) var i int return backoff.Retry(func() error { err := fn() if err != nil { if shouldRetry(err) { fmt.Printf("Retrying after error: %s\n", err) time.Sleep(500 * time.Millisecond) i++ ret...
[ 0.40564870834350586, 0.4847930669784546, 0.43913379311561584, 0.19103994965553284, -0.476277619600296, -0.23939813673496246, -0.42867133021354675, -0.14907513558864594, -0.17939139902591705, -0.1069144606590271, 0.13840563595294952, 0.4474712014198303, 0.09924840182065964, -0.6969045996665...
func Body(str string, args ...interface{}) io.ReadCloser { return io.NopCloser(strings.NewReader(fmt.Sprintf(str, args...))) }
[ -0.3261820375919342, -0.6580880284309387, 0.4094787836074829, -0.45736783742904663, -0.5279138684272766, 0.5369198322296143, -0.6978784799575806, -1.035704255104065, -0.8172777891159058, -0.34573468565940857, 0.7374164462089539, -0.14279873669147491, -0.37395790219306946, 0.030643224716186...
func (w WorkerPool) ParallelDo(tasks ...func() (interface{}, error)) ([]interface{}, error) { jobs := make(chan func() (interface{}, error)) results := make(chan interface{}, len(tasks)) errs := make(chan error, len(tasks)) done := make(chan bool) for i := 0; i < w.WorkerCount; i++ { w.spawnWorker(jobs, results...
[ 0.6360997557640076, 0.5021976232528687, 1.1819885969161987, 0.39326825737953186, 0.2485942840576172, 0.43755775690078735, 0.2175034135580063, -0.5750412940979004, -0.3667621314525604, -0.13495805859565735, -0.04037296026945114, 0.054718781262636185, -0.31024518609046936, 0.5155928134918213...
func NewFullyQualifiedCSID(nodeID string, csIDs ...uint16) *IE { v := NewFullyQualifiedCSIDFields(nodeID, csIDs...) b, err := v.Marshal() if err != nil { return nil } return New(FullyQualifiedCSID, 0x00, b) }
[ 0.5806950330734253, -0.27478545904159546, 0.11541702598333359, 0.23671050369739532, -0.18626700341701508, -0.19089394807815552, -0.8866628408432007, -0.3876434564590454, -0.6264119744300842, -0.3685838580131531, -0.1145951896905899, -0.1260482668876648, -0.2916824221611023, 0.5008431673049...
func (i *IE) FullyQualifiedCSID() (*FullyQualifiedCSIDFields, error) { switch i.Type { case FullyQualifiedCSID: return ParseFullyQualifiedCSIDFields(i.Payload) default: return nil, &InvalidTypeError{Type: i.Type} } }
[ 0.2872234880924225, -0.5476831197738647, 0.2738669514656067, 0.3594836890697479, 0.2323225885629654, -0.1091446802020073, -0.6239314675331116, -0.6752563714981079, 0.39074862003326416, -0.2701004147529602, -0.35112059116363525, -0.712088942527771, -0.2379426211118698, 0.09900622814893723, ...
func NewFullyQualifiedCSIDFields(nodeID string, csIDs ...uint16) *FullyQualifiedCSIDFields { f := &FullyQualifiedCSIDFields{ NumberOfCSIDs: uint8(len(csIDs)), CSIDs: csIDs, } ip := net.ParseIP(nodeID) if ip == nil { var err error f.NodeID, err = hex.DecodeString(nodeID) if err != nil { return ...
[ 0.06743569672107697, -0.12174145132303238, 0.21795055270195007, -0.33811065554618835, 0.09535902738571167, -0.6042687296867371, -0.8864945769309998, -0.49644553661346436, 0.153799906373024, -0.2436792254447937, -0.7675423622131348, -0.2120029777288437, -0.49039599299430847, -0.051455698907...
func (f *FullyQualifiedCSIDFields) UnmarshalBinary(b []byte) error { l := len(b) if l < 1 { return io.ErrUnexpectedEOF } f.NodeIDType = (b[0] >> 4) & 0x0f f.NumberOfCSIDs = b[0] & 0x0f offset := 1 switch f.NodeIDType { case nodeIDIPv4, nodeIDOther: if l < offset+4 { return io.ErrUnexpectedEOF } f.N...
[ 0.027082223445177078, -0.07861504703760147, 0.7683036923408508, -1.1434370279312134, 0.6388401389122009, -0.9588965773582458, -0.04319106787443161, -0.48258599638938904, -0.4832821786403656, 0.005590086802840233, -0.10074839740991592, 0.2364390790462494, -0.3572748601436615, -0.33162829279...
func (f *FullyQualifiedCSIDFields) MarshalLen() int { l := 1 switch f.NodeIDType { case nodeIDIPv4, nodeIDOther: l += 4 case nodeIDIPv6: l += 16 default: } l += len(f.CSIDs) * 2 return l }
[ -0.10294801741838455, 0.5333083271980286, 0.19318512082099915, -0.3583189845085144, 0.7223830223083496, -0.20455576479434967, -0.039156895130872726, 0.8293450474739075, 0.11977462470531464, -0.6110844016075134, -0.40763869881629944, 0.469860702753067, -0.010022588074207306, 0.2386132776737...
func (i *IE) NodeIDType() (uint8, error) { if len(i.Payload) < 1 { return 0, io.ErrUnexpectedEOF } switch i.Type { case FullyQualifiedCSID: return (i.Payload[0] >> 4) & 0x0f, nil default: return 0, &InvalidTypeError{Type: i.Type} } }
[ -0.6442532539367676, 0.33595937490463257, 0.3854128122329712, -0.7925119400024414, 0.8145639896392822, -0.3033853769302368, -0.3650193512439728, -1.1005498170852661, 0.3106636106967926, 0.26527494192123413, 0.31121113896369934, 0.08739374577999115, -1.1463009119033813, 0.5120857357978821, ...
func (i *IE) MustNodeIDType() uint8 { v, _ := i.NodeIDType() return v }
[ -1.0247950553894043, 0.06884356588125229, 0.27590838074684143, -0.28023937344551086, 0.6548003554344177, 0.17924150824546814, -0.24751609563827515, -1.1092312335968018, 0.5247117280960083, 0.7444201111793518, -0.14048069715499878, 0.1826014667749405, -1.151068925857544, 1.4148941040039062,...
func (i *IE) NodeID() ([]byte, error) { if len(i.Payload) < 1 { return nil, io.ErrUnexpectedEOF } switch i.Type { case FullyQualifiedCSID: switch (i.Payload[0] >> 4) & 0x0f { case nodeIDIPv4, nodeIDOther: if len(i.Payload) < 6 { return nil, io.ErrUnexpectedEOF } return i.Payload[1:5], nil case...
[ -0.4879938066005707, -0.4820265769958496, 0.5455700159072876, -0.692002534866333, 0.47695058584213257, 0.2154751569032669, -0.13411757349967957, -0.8549211025238037, 0.47044822573661804, 0.7676749229431152, 0.4725506603717804, 0.31972891092300415, -0.6688036322593689, 0.31528958678245544, ...
func (i *IE) MustNodeID() []byte { v, _ := i.NodeID() return v }
[ -0.46631675958633423, -0.04469197988510132, 0.38395604491233826, -0.09089596569538116, 0.2728344798088074, 0.9971569180488586, -0.3356209695339203, -0.45552948117256165, 0.8167736530303955, 1.4631788730621338, 0.019187545403838158, 0.6658050417900085, -0.6924443244934082, 1.485442042350769...
func (i *IE) CSIDs() ([]uint16, error) { if len(i.Payload) < 1 { return nil, io.ErrUnexpectedEOF } switch i.Type { case FullyQualifiedCSID: offset := 0 switch (i.Payload[0] >> 4) & 0x0f { case nodeIDIPv4, nodeIDOther: offset += 5 case nodeIDIPv6: offset += 17 default: return nil, ErrMalformed ...
[ -0.2106601446866989, -0.1706651896238327, 0.3940523564815521, -0.8285874128341675, 0.642723798751831, 0.13330017030239105, -0.5897601246833801, -0.7166014909744263, 0.8138931393623352, 0.07683779299259186, 0.7626996040344238, 0.5209181904792786, -0.7330615520477295, 0.14201495051383972, ...
func (i *IE) MustCSIDs() []uint16 { v, _ := i.CSIDs() return v }
[ -0.8861483335494995, -0.3191080093383789, 0.2723885774612427, -0.5682803988456726, 0.6901301145553589, 0.4935120642185211, -1.0247995853424072, -0.8075696229934692, 0.3825831413269043, 0.5895052552223206, -0.23476099967956543, 0.4706762433052063, -1.0288218259811401, 1.1747570037841797, ...
func (p *PersistableEvent) ToStringKeys() []string { return []string{"type", "nodeID", "fullNodeID", "amount", "time", "manaType", "transactionID", "inputID"} }
[ -0.6584676504135132, -0.24890252947807312, 0.5241177082061768, -0.4770326018333435, 0.10831615328788757, -0.3605453670024872, -0.33290910720825195, -0.3664635419845581, -0.3271368741989136, 1.5528401136398315, -0.9848556518554688, 0.661668598651886, -1.142912745475769, 0.10929352790117264,...
func (p *PersistableEvent) ToStringValues() []string { _type := strconv.Itoa(int(p.Type)) _nodeID := p.NodeID.String() _fullNodeID := base58.Encode(p.NodeID[:]) _amount := strconv.FormatFloat(p.Amount, 'g', -1, 64) _time := strconv.FormatInt(p.Time.Unix(), 10) _manaType := p.ManaType.String() _txID := p.Transact...
[ 0.05168990045785904, -0.2055387794971466, 0.6448307633399963, -0.42832741141319275, 0.48067325353622437, -0.361104816198349, -0.3699759542942047, 0.11567853391170502, -0.2663698196411133, 0.9486602544784546, -0.5725553631782532, 0.20326192677021027, -0.3952449858188629, 0.5751345157623291,...
func (p *PersistableEvent) Bytes() []byte { if bytes := p.bytes; bytes != nil { return bytes } // create marshal helper marshalUtil := marshalutil.New() marshalUtil.WriteByte(p.Type) marshalUtil.WriteByte(byte(p.ManaType)) marshalUtil.WriteBytes(p.NodeID.Bytes()) marshalUtil.WriteTime(p.Time) marshalUtil.Wri...
[ 0.6861160397529602, 0.2748093903064728, 0.4871591031551361, -0.6265663504600525, 0.21478046476840973, 0.229592964053154, -0.8897961974143982, -0.21920090913772583, 0.7479676008224487, -0.295041024684906, -0.2735288441181183, 0.2219294309616089, -0.5183010697364807, -0.005565168801695108, ...
func (p *PersistableEvent) Update(objectstorage.StorableObject) { panic("should not be updated") }
[ 0.704653799533844, -0.5008912086486816, 0.3659275770187378, 1.1466819047927856, -0.49921703338623047, 1.3236231803894043, -0.21751919388771057, -0.07678219676017761, 0.7333474159240723, 0.7409696578979492, -0.49776482582092285, -0.07036162912845612, -0.5161533951759338, -1.2282477617263794...
func (p *PersistableEvent) ObjectStorageKey() []byte { return p.Bytes() }
[ -0.3431238830089569, -0.09803169965744019, 0.7291920185089111, 0.454091876745224, 0.5723851323127747, 0.6150757670402527, -0.145482137799263, -0.8658534288406372, -0.11991079896688461, 1.222104549407959, -1.1650139093399048, -0.2970024049282074, 0.37381425499916077, 0.44742634892463684, ...
func (p *PersistableEvent) ObjectStorageValue() []byte { return p.Bytes() }
[ 0.009219412691891193, 0.008591577410697937, 0.716671884059906, 0.4144429862499237, 0.07138370722532272, 0.7268083095550537, -0.28080621361732483, -0.9426957964897156, -0.19056449830532074, 0.5352745056152344, -1.172424077987671, -0.19629685580730438, 0.6703945994377136, 0.14320074021816254...
func parseEvent(marshalUtil *marshalutil.MarshalUtil) (result *PersistableEvent, err error) { eventType, err := marshalUtil.ReadByte() if err != nil { return } manaType, err := marshalUtil.ReadByte() if err != nil { return } nodeIDBytes, err := marshalUtil.ReadBytes(sha256.Size) if err != nil { return } ...
[ 1.192267656326294, 0.4150063097476959, 0.6759330630302429, -0.4669414460659027, -0.5872217416763306, -0.30712828040122986, -0.050737954676151276, -0.4753599762916565, 0.037345338612794876, 0.04930683970451355, -0.2732115089893341, 0.06361261755228043, -0.28434401750564575, -0.1022213846445...
func FromEventObjectStorage(_ []byte, data []byte) (result objectstorage.StorableObject, err error) { return parseEvent(marshalutil.New(data)) }
[ 0.8461304306983948, -0.15465688705444336, 0.5461426973342896, 0.2792140245437622, -0.904783308506012, 0.0733727216720581, -0.4574472904205322, -0.5452750325202942, 0.34599170088768005, 0.38415998220443726, -0.8642942309379578, -0.3955846428871155, 0.5783523917198181, -1.1455110311508179, ...
func (c *CachedPersistableEvent) Retain() *CachedPersistableEvent { return &CachedPersistableEvent{c.CachedObject.Retain()} }
[ 1.0213489532470703, -0.010218883864581585, 0.6361446380615234, 0.9735977053642273, -0.3538532555103302, 0.5228383541107178, 0.36806097626686096, -0.22757560014724731, 0.4937289357185364, -0.9886924028396606, -0.4543159008026123, 0.15626941621303558, -0.5487924218177795, -0.3605388104915619...
func (c *CachedPersistableEvent) Consume(consumer func(pbm *PersistableEvent)) bool { return c.CachedObject.Consume(func(object objectstorage.StorableObject) { consumer(object.(*PersistableEvent)) }) }
[ 0.29929375648498535, 0.06830024719238281, 0.6927098035812378, 1.484964370727539, -0.5367964506149292, 0.5378283262252808, 0.34614160656929016, -0.2919897735118866, -0.024332862347364426, 0.8125048279762268, -0.40147432684898376, -0.4409814476966858, -0.2730479836463928, 0.098323754966259, ...
func (c *CachedPersistableEvent) Unwrap() *PersistableEvent { untypedPbm := c.Get() if untypedPbm == nil { return nil } typeCastedPbm := untypedPbm.(*PersistableEvent) if typeCastedPbm == nil || typeCastedPbm.IsDeleted() { return nil } return typeCastedPbm }
[ -0.3089922368526459, 0.24812112748622894, 0.8200609683990479, 0.800190269947052, -0.14207057654857635, 0.015261182561516762, 0.11250347644090652, 0.16076704859733582, 0.8085019588470459, -0.0845777615904808, 0.34318220615386963, 1.113916039466858, -0.7226719856262207, -0.18343913555145264,...
func (*Config) Descriptor() ([]byte, []int) { return file_transport_internet_request_assembly_config_proto_rawDescGZIP(), []int{0} }
[ -0.5075860619544983, 0.3982607424259186, 0.4575745165348053, 0.44671139121055603, 0.06805833429098129, 0.17605964839458466, 0.5885779857635498, 1.175201654434204, -0.40727484226226807, -0.4399518370628357, -0.3308757543563843, -0.35456937551498413, 0.3400016725063324, 1.0817588567733765, ...
func (s *TokenService) Decode(token string) (*CustomClaims, error) { // status text fmt.Println("Decoding token") // parse the token // ParseWithClaims takes the token, custom claims struct referfence, // and a function that returns the secret key as []byte tokenType, err := jwt.ParseWithClaims(token, &CustomCl...
[ 0.8079888820648193, -0.33825069665908813, 0.5837246775627136, 0.06381672620773315, -0.41170060634613037, -0.9279131293296814, -1.5724087953567505, 0.12845200300216675, 0.7569379806518555, -0.5530548095703125, -0.3002468943595886, 1.1365950107574463, -0.335801362991333, 0.07518749684095383,...
func (s *TokenService) Encode(user *pb.User) (string, error) { // get expire time expires := time.Now().Add(time.Hour * 72).Unix() // Create claims claims := CustomClaims{ user, jwt.StandardClaims{ ExpiresAt: expires, Issuer: "go.micro.srv.user", }, } // create token token := jwt.NewWithClaims(...
[ -0.14497680962085724, 0.045712389051914215, 0.6229107975959778, 0.3367387354373932, -1.376485824584961, 0.1811370551586151, -0.4194948077201843, -0.1885838508605957, 0.4322131276130676, 0.1551082879304886, -0.3352935016155243, 0.6268861889839172, -0.2726386487483978, -0.34218278527259827, ...
func (p *proxy) LastValidatorId() (uint64, error) { return p.rpc.LastValidatorId() }
[ -0.9666998386383057, -0.40701359510421753, 0.3444395065307617, -0.5836971402168274, -0.33974510431289673, 0.14699983596801758, -0.3709791600704193, 0.1709829866886139, 0.2877265214920044, -0.3396317958831787, 0.018690699711441994, 0.4740065932273865, -1.32668936252594, 0.9741848707199097, ...
func (p *proxy) ValidatorsCount() (uint64, error) { return p.rpc.ValidatorsCount() }
[ -0.6263549327850342, -0.036324210464954376, 0.33099430799484253, -0.2022680789232254, 0.3219994306564331, -0.507879376411438, 0.10880737751722336, 0.38232922554016113, -0.20968449115753174, -0.3913135528564453, -0.7982745170593262, 0.20094989240169525, -1.648620843887329, 0.191939055919647...
func (p *proxy) IsValidator(addr *common.Address) (bool, error) { return p.rpc.IsValidator(addr) }
[ -1.1233750581741333, 0.6406846046447754, 0.49037986993789673, -0.18283070623874664, -1.115922212600708, 0.2386500984430313, -0.37427106499671936, 0.08081994950771332, 1.0319372415542603, -0.047819070518016815, 0.12493357807397842, 0.3668355941772461, -0.9691649079322815, 0.9488623738288879...
func (p *proxy) ValidatorAddress(id *hexutil.Big) (*common.Address, error) { // try to use cache adr := p.cache.PullValidatorAddress(id) if nil != adr { return adr, nil } // pull from SFC adr, err := p.rpc.ValidatorAddress((*big.Int)(id)) if err != nil { return nil, err } // store to cache for future use...
[ -1.035448431968689, 0.15635181963443756, 0.3347650170326233, -0.0435531809926033, -0.6213944554328918, -0.7460922002792358, 0.1635408103466034, 0.2580249607563019, 1.3465267419815063, -0.6307944655418396, 0.07275359332561493, 0.7471973299980164, -0.6085895895957947, 0.5711793303489685, 0...
func (p *proxy) Validator(id *hexutil.Big) (*types.Validator, error) { return p.rpc.Validator((*big.Int)(id)) }
[ -0.7304234504699707, 0.6165359616279602, 0.1252390742301941, -1.0285816192626953, -0.20459143817424774, 0.1125943586230278, -0.02327364683151245, -0.07165990769863129, 0.7844622731208801, -1.002451777458191, -0.4466331899166107, 0.0822288990020752, -0.5522373914718628, 0.5364662408828735, ...
func (p *proxy) ValidatorByAddress(addr *common.Address) (*types.Validator, error) { return p.rpc.ValidatorByAddress(addr) }
[ -0.27582740783691406, 0.18147322535514832, 0.19763636589050293, -0.3900887668132782, -1.0562944412231445, -0.15482601523399353, 0.3637862205505371, 0.0737021192908287, 1.2273937463760376, -0.1359453797340393, -0.1933140754699707, 0.41596025228500366, -0.5240262746810913, 0.6879507303237915...
func (p *proxy) SfcMaxDelegatedRatio() (*big.Int, error) { // try cache first val := p.cache.PullSfcMaxDelegatedRatio() if val != nil { return val, nil } // pull from the SFC contract val, err := p.rpc.SfcMaxDelegatedRatio() if err != nil { return nil, err } // store for future use p.cache.PushSfcMaxDel...
[ 0.2631063461303711, 1.4285584688186646, 0.6604013442993164, -0.6616511940956116, 0.3680543601512909, -0.6472534537315369, -0.24647915363311768, 0.04184959456324577, 0.21060039103031158, -0.665989339351654, 0.3653522729873657, 0.017336951568722725, 0.018100008368492126, 1.1468957662582397, ...