text
stringlengths
11
6.3k
embedding
listlengths
768
768
func GetNylasJobPostings(ctx context.Context) (<-chan *JobPosting, error) { return getLeverJobsFor(ctx, "nylas") }
[ 0.6355535387992859, 0.3913748562335968, 0.3703998625278473, 0.5562956929206848, -0.15895648300647736, -0.17749829590320587, -0.4366557002067566, -0.6015265583992004, 0.4461195170879364, -0.6121761202812195, -0.7123746275901794, 0.3845611810684204, -0.49448078870773315, 1.5062707662582397, ...
func TestCreateDeleteUserAccount(t *testing.T) { var account UserAccount if err := Create("TestyTesterson1134", "t@t.com", "pass", &account); err != nil { t.Error(err) } if err := Delete(account.Key); err != nil { t.Error(err) } }
[ 0.7126203179359436, 0.09337159991264343, 0.25976186990737915, 1.1673507690429688, 0.6155858635902405, 0.6020438075065613, 1.9366371631622314, 0.3262712061405182, 0.8563681840896606, -0.566628634929657, -0.2660064995288849, 0.09439319372177124, 0.18872623145580292, -0.08437418937683105, 0...
func TestRejectShortName(t *testing.T) { if err := Create("short", "", "", nil); err == nil { t.Error("Short handle worked") } }
[ 1.1966174840927124, 1.0056146383285522, 0.5899561643600464, 0.1673409342765808, 0.1378694623708725, 1.4479962587356567, -0.2625982463359833, -0.20071710646152496, -0.023930512368679047, -1.141688346862793, -0.5178437232971191, 0.48793795704841614, -0.38596686720848083, -0.07693564891815186...
func TestRejectLongName(t *testing.T) { longHandle := "1234567890123456789012345678901234567890" if err := Create(longHandle, "", "", nil); err == nil { t.Error("Long handle worked") } }
[ 0.6448988914489746, 1.0738046169281006, 0.7140346765518188, -0.9196470975875854, 0.49787506461143494, 1.4316636323928833, -0.22430384159088135, -0.025457439944148064, 0.13738617300987244, -0.8881843090057373, -0.8109474778175354, -0.43677645921707153, -0.8589986562728882, -0.12700714170932...
func TestEncryption(t *testing.T) { password := "timisadork" bPass := []byte(password) hash := Encrypt(password) if err := bcrypt.CompareHashAndPassword(hash, bPass); err != nil { t.Error(err) } }
[ 0.8739721775054932, 0.9274201393127441, 0.4180390536785126, 0.8329014778137207, 1.0265840291976929, -0.32916176319122314, 0.9450711011886597, 0.3094289004802704, 0.5292948484420776, 0.09320835769176483, -1.0165609121322632, -0.4569941461086273, -0.8996425867080688, 0.12749658524990082, -...
func TestHandleExists(t *testing.T) { handle := "test_handleexists" email := "test_handleexists@test.com" var account UserAccount if err := Create(handle, email, "timisadork", &account); err != nil { t.Error(err) } if err := HandleExists(handle); err == nil { t.Error("Handle exists failed") } ...
[ 0.576679527759552, 0.054612092673778534, 0.6148045063018799, 0.06186812371015549, 1.7305872440338135, 0.8360623121261597, 1.046949028968811, 0.138920858502388, 0.20903602242469788, -0.4338700771331787, -0.4161970913410187, -0.3007340133190155, -0.16360856592655182, -0.4047580659389496, 0...
func TestEmailExists(t *testing.T) { handle := "test_handleexists" email := "test_handleexists@test.com" var account UserAccount if err := Create(handle, email, "timisadork", &account); err != nil { t.Error(err) } if err := EmailExists(email); err == nil { t.Error("Handle exists failed") } i...
[ 0.4280979335308075, 0.2526753544807434, 0.6973756551742554, -0.017244601622223854, 1.5183478593826294, 0.5947131514549255, 1.0046730041503906, 0.621823787689209, 0.15117323398590088, -0.134351447224617, -0.37143731117248535, -0.09878621995449066, -0.2442040592432022, -0.47754552960395813, ...
func TestHandleAlreadyInUse(t *testing.T) { handle := "test_handleinuse" email1 := "test_handleinuse1@test.com" email2 := "test_handleinuse2@test.com" var account UserAccount if err := Create(handle, email1, "timisadork", &account); err != nil { t.Error(err) } if err := Create(handle, email2, "tim...
[ 0.39521121978759766, 0.4863014817237854, 0.8515753746032715, 0.20934689044952393, 0.8774239420890808, 0.1508147269487381, 1.284334659576416, -0.21909959614276886, 0.3152490556240082, -0.44607701897621155, -0.09161684662103653, 0.18670523166656494, -0.6334364414215088, -0.12849245965480804,...
func TestEmailAlreadyInUse(t *testing.T) { handle1 := "test_handleinuse1" handle2 := "test_handleinuse2" email := "test_handleinuse@test.com" var account UserAccount if err := Create(handle1, email, "timisadork", &account); err != nil { t.Error(err) } if err := Create(handle2, email, "timisadork", ...
[ 0.18410523235797882, 0.6796404123306274, 0.8401205539703369, 0.2837581932544708, 0.6867074370384216, -0.20061179995536804, 1.2225137948989868, 0.008974217809736729, 0.22737683355808258, -0.007065479177981615, -0.06788294017314911, 0.5103792548179626, -0.41194790601730347, -0.08104009181261...
func NewToken(usr *users.User) ([]byte, error) { token := jwt.NewWithClaims(jwt.SigningMethodHS256, &tokenClaims{ StandardClaims: jwt.StandardClaims{ ExpiresAt: time.Now().Add(time.Hour).Unix(), IssuedAt: time.Now().Unix(), }, UserID: usr.ID(), Admin: usr.Admin(), }) key, _ := jwtKey(nil) tokenStr,...
[ 0.005659887101501226, -0.6635178923606873, 0.5596862435340881, 0.4025932848453522, -1.2997753620147705, 0.2578197419643402, -0.410308837890625, -0.3372684717178345, 0.17334789037704468, -0.14118948578834534, -1.0948739051818848, 1.1727392673492432, 0.5374575853347778, 0.5698975920677185, ...
func VerifyToken(tokenStr string) (*tokenClaims, error) { token, err := jwt.ParseWithClaims(tokenStr, &tokenClaims{}, jwtKey) if err != nil { return nil, err } if !token.Valid { return nil, errors.New("token is not valid") } claims, ok := token.Claims.(*tokenClaims) if !ok { return nil, errors.New("wrong...
[ 0.5537026524543762, -0.9591013789176941, 0.3796927332878113, 0.5080466866493225, -0.34858012199401855, -0.17515245079994202, -0.8200615048408508, -0.06450984627008438, 0.9189125299453735, -0.5981953144073486, -0.8936141729354858, 0.9336403012275696, 0.11723095178604126, 0.8511771559715271,...
func (p Pretty) Padding(strs ...string) []string { var ret []string var right int left := p.OutputPadding.Width // Loop through each string induvidually for _, str := range strs { var newStr string // Split by newline for i, s := range strings.Split(str, p.Newline) { newStr += p.addPaddingToLine(s, left...
[ -0.8748886585235596, -0.16209015250205994, 0.7506098747253418, 0.15723860263824463, -0.3614303171634674, 0.4999677538871765, -0.4365801215171814, -0.5186972618103027, -0.13650928437709808, 0.29233017563819885, 0.9332675933837891, -0.038501668721437454, -0.39279916882514954, 0.7346158623695...
func (p Pretty) Center(strs ...string) []string { var ret []string for _, str := range strs { var newStr string var left int var right int width := getLongestStringLength(strings.Split(str, p.Newline)) for i, s := range strings.Split(str, p.Newline) { if utf8.RuneCountInString(s) < width { diff := ...
[ -0.32242920994758606, -0.632541835308075, 0.9301885962486267, -0.13459955155849457, -0.33551549911499023, 0.2685804069042206, -0.4821931719779968, -0.27806493639945984, 0.551540732383728, 0.6488428711891174, 0.9861754179000854, 0.39079809188842773, -0.3013644218444824, 0.6594660878181458, ...
func (e *oidcExtension) authenticate(ctx context.Context, headers map[string][]string) (context.Context, error) { metadata := client.NewMetadata(headers) authHeaders := metadata.Get(e.cfg.Attribute) if len(authHeaders) == 0 { return ctx, errNotAuthenticated } // we only use the first header, if multiple values ...
[ 0.3297310173511505, -0.15203918516635895, 0.8503826856613159, 0.05171413719654083, 0.28968772292137146, -0.6390827894210815, -1.2553960084915161, -0.8917416334152222, 0.5107640027999878, -0.23224635422229767, 0.3203275799751282, 0.6181640028953552, 0.0005800677463412285, -0.813053190708160...
func NewHandler(manager Manager) *Handler { return &Handler{manager} }
[ 0.30125102400779724, -0.5673152804374695, -0.2724318206310272, 0.6072103381156921, -1.4910829067230225, 0.723023533821106, -0.2455269694328308, 0.49544084072113037, -0.014320135116577148, -0.9422448873519897, 0.33174553513526917, 0.5985339283943176, -0.22782842814922333, 0.2545988857746124...
func (h *Handler) GetClusterSummary(ctx context.Context, request *grpc_monitoring_go.ClusterSummaryRequest) (*grpc_monitoring_go.ClusterSummary, error) { log.Debug().Interface("request", request).Msg("GetClusterSummary") return h.Manager.GetClusterSummary(request) }
[ -1.2608253955841064, 0.9725513458251953, 0.45161256194114685, 0.1556251049041748, 0.26232296228408813, -0.03373546525835991, 0.5335256457328796, -0.5795570611953735, -0.04598810151219368, 0.3007553815841675, -0.1204492598772049, 1.3318325281143188, -0.3741587996482849, -0.13231202960014343...
func (h *Handler) GetClusterStats(ctx context.Context, request *grpc_monitoring_go.ClusterStatsRequest) (*grpc_monitoring_go.ClusterStats, error) { log.Debug().Interface("request", request).Msg("GetClusterStats") return h.Manager.GetClusterStats(request) }
[ -0.41609787940979004, 1.1920995712280273, 0.3549636900424957, 0.23594927787780762, 0.24031132459640503, -0.05287064239382744, 0.4212934970855713, -1.0656296014785767, -0.3210040330886841, -0.42368173599243164, -0.15256622433662415, 1.4302940368652344, -1.1608779430389404, 0.315728038549423...
func (h *Handler) Query(ctx context.Context, request *grpc_monitoring_go.QueryRequest) (*grpc_monitoring_go.QueryResponse, error) { log.Debug().Interface("request", request).Msg("Query") return h.Manager.Query(request) }
[ -0.47132834792137146, -0.22334130108356476, 0.49031880497932434, -0.1420152485370636, 0.3859943747520447, 0.2541445791721344, -0.2655048966407776, -0.49149081110954285, 0.050943851470947266, -0.15576308965682983, 0.5747563242912292, 0.24613253772258759, -0.8522058129310608, 0.6630405783653...
func (o *ListPolicyV1beta1NamespacedPodDisruptionBudgetReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { switch response.Code() { case 200: result := NewListPolicyV1beta1NamespacedPodDisruptionBudgetOK() if err := result.readResponse(response, consumer, o.form...
[ -0.48890143632888794, -0.6313384771347046, 0.45908984541893005, 0.31548163294792175, 0.19090747833251953, 0.18039356172084808, -0.2881348133087158, -0.14940322935581207, 0.9200881719589233, 0.10335104167461395, -0.09771162271499634, -0.5078979134559631, -1.2682769298553467, -0.061296004801...
func NewListPolicyV1beta1NamespacedPodDisruptionBudgetOK() *ListPolicyV1beta1NamespacedPodDisruptionBudgetOK { return &ListPolicyV1beta1NamespacedPodDisruptionBudgetOK{} }
[ -0.3738683760166168, 0.09773634374141693, 0.6531552672386169, 0.6744126081466675, 0.2624151110649109, 1.694553256034851, -0.08542943745851517, 0.30581197142601013, 0.2740950286388397, -0.27396562695503235, -1.7175294160842896, -0.5083856582641602, -0.19388410449028015, 0.46548768877983093,...
func NewListPolicyV1beta1NamespacedPodDisruptionBudgetUnauthorized() *ListPolicyV1beta1NamespacedPodDisruptionBudgetUnauthorized { return &ListPolicyV1beta1NamespacedPodDisruptionBudgetUnauthorized{} }
[ -0.8328644633293152, -0.5108970999717712, 0.7204914689064026, 0.14255306124687195, -0.4824996590614319, 1.2285418510437012, -0.6628924608230591, 0.6276479363441467, 0.6384632587432861, -1.0517836809158325, -1.2101101875305176, 0.32791242003440857, -0.6085783839225769, 0.14038078486919403, ...
func loggingHandler(next http.Handler) http.Handler { fn := func(w http.ResponseWriter, r *http.Request) { t1 := time.Now() next.ServeHTTP(w, r) t2 := time.Now() log.Printf("[%s] %q %v\n", r.Method, r.URL.String(), t2.Sub(t1)) } return http.HandlerFunc(fn) }
[ -0.6395145058631897, -0.30489763617515564, 0.5553504824638367, -0.010420160368084908, -0.7925547361373901, 0.06733327358961105, -0.3271790146827698, -0.004736245144158602, -0.540479838848114, -0.08494510501623154, -0.20930492877960205, -0.32793310284614563, -0.21724003553390503, 0.52919274...
func recoverHandler(next http.Handler) http.Handler { fn := func(w http.ResponseWriter, r *http.Request) { defer func() { if err := recover(); err != nil { log.Printf("error: %+v", err) http.Error(w, http.StatusText(500), 500) } }() next.ServeHTTP(w, r) } return http.HandlerFunc(fn) }
[ -0.0754767432808876, -0.2018742710351944, 0.4591490924358368, 0.2800242602825165, -0.9152337312698364, 0.06001150235533714, 0.02376072108745575, -0.22061745822429657, 0.42488235235214233, -0.37344101071357727, 0.2306455671787262, -0.23653839528560638, -0.8656233549118042, -0.31744825839996...
func (m *minerMigrator) correctExpirationQueue(exq miner.ExpirationQueue, sectors miner.Sectors, allTerminated bitfield.BitField, allFaults bitfield.BitField, sectorSize abi.SectorSize, ) (cid.Cid, expirationQueueStats, error) { // processed expired sectors includes all terminated and all sectors seen in earlier expi...
[ 0.04755736142396927, -1.160478949546814, 0.7861676812171936, -0.4403511583805084, -0.011810247786343098, -0.14125366508960724, 0.05105021223425865, -0.17200186848640442, 0.434691458940506, 0.12357255816459656, 0.4793640971183777, 0.13920465111732483, 0.39542505145072937, 1.0546607971191406...
func correctExpirationSetPowerAndPledge(exs *miner.ExpirationSet, sectors miner.Sectors, allFaults bitfield.BitField, sectorSize abi.SectorSize, ) (bool, miner.PowerPair, miner.PowerPair, error) { modified := false allSectors, err := bitfield.MergeBitFields(exs.OnTimeSectors, exs.EarlySectors) if err != nil { r...
[ -0.38996753096580505, -0.9601556658744812, 0.8627353310585022, -0.8997275233268738, -0.22056391835212708, 0.3350886404514313, -0.05798147991299629, 0.5298452377319336, 0.24125660955905914, 0.08304984122514725, 0.7463256120681763, -0.30943700671195984, -0.5876415371894836, 1.053602337837219...
func HasMetaInfo(ctx context.Context) bool { return getKV(ctx) != nil }
[ 0.7995743751525879, -0.24483881890773773, 0.35262879729270935, -0.3689631223678589, 0.18150794506072998, 0.6315088868141174, -0.8532844185829163, 0.34877851605415344, -0.02915218099951744, -0.3904242217540741, -0.7435408234596252, 0.15781015157699585, 0.2458326369524002, 0.4992658793926239...
func SetMetaInfoFromMap(ctx context.Context, m map[string]string) context.Context { if ctx == nil { return nil } for k, v := range m { if t, nk := determineKeyType(k, v); t != invalidType { ctx = addKV(ctx, t, nk, v) } } return ctx }
[ -0.0649736225605011, -0.33780455589294434, 0.5175631046295166, 0.4802190065383911, -0.26706770062446594, 0.8329908847808838, -0.9032697677612305, -0.8595976829528809, 0.0004063482047058642, 0.32358020544052124, 0.11695360392332077, 0.45657283067703247, -0.4081405699253082, 0.29871261119842...
func SaveMetaInfoToMap(ctx context.Context, m map[string]string) { if ctx == nil || m == nil { return } ctx = TransferForward(ctx) for k, v := range GetAllValues(ctx) { m[PrefixTransient+k] = v } for k, v := range GetAllPersistentValues(ctx) { m[PrefixPersistent+k] = v } }
[ -0.6297017931938171, -0.7512288689613342, 0.6056478023529053, -0.2597746253013611, -0.17729942500591278, 0.6562046408653259, -0.19911111891269684, -0.24923071265220642, 0.19064413011074066, 0.1930849850177765, -0.8009772896766663, 0.2735022008419037, -0.323577880859375, 0.39260485768318176...
func determineKeyType(k, v string) (infoType infoType, newKey string) { if len(k) == 0 || len(v) == 0 { return invalidType, k } switch { case strings.HasPrefix(k, PrefixTransientUpstream): if len(k) > lenPTU { return transientUpstreamType, k[lenPTU:] } case strings.HasPrefix(k, PrefixTransient): if len...
[ 0.14106719195842743, -0.7142656445503235, 0.565940797328949, -0.5372074246406555, 0.25459790229797363, -0.6555016040802002, -0.8481714725494385, 0.1099274680018425, -0.07152662426233292, 0.4887124300003052, 0.1195189505815506, 0.5666027665138245, -0.8340109586715698, 0.8339136242866516, ...
func Cmd(rootArgs *shared.RootArgs, printf shared.FormatFn) *cobra.Command { p := &provision{RootArgs: rootArgs} c := &cobra.Command{ Use: "provision", Short: "Provision your Apigee environment for remote services", Long: `The provision command will set up your Apigee environment for remote services. This in...
[ 0.15651552379131317, -0.9796973466873169, 0.9731302261352539, -0.26643192768096924, 0.46725204586982727, 0.5158973932266235, -0.023013710975646973, 0.14658083021640778, -0.0607469268143177, -0.010238123126327991, 1.0030665397644043, 0.3541010916233063, -0.1274833232164383, 0.63306492567062...
func (p *provision) retrieveRuntimeType() error { req, err := p.ApigeeClient.NewRequestNoEnv(http.MethodGet, "", nil) if err != nil { return err } org := &apigee.Organization{} if _, err := p.ApigeeClient.Do(req, org); err != nil { return err } p.runtimeType = org.RuntimeType return nil }
[ 0.14060772955417633, 0.3384942412376404, 0.419258713722229, -0.2884519696235657, 1.2802904844284058, -0.32282522320747375, -0.3959392011165619, 0.10821840912103653, 0.5038852691650391, 0.13036450743675232, -0.6640117764472961, 0.6822270154953003, -1.893622875213623, 0.9032989740371704, 1...
func (p *provision) isCloud() bool { return p.IsGCPManaged && p.runtimeType == "CLOUD" }
[ -0.22384288907051086, 0.6769546866416931, 0.44059649109840393, 1.3229026794433594, 0.1883060485124588, 0.735699474811554, -0.3233885169029236, -0.2097984403371811, 0.5689194798469543, 0.02321372926235199, 0.24320949614048004, 1.122832179069519, -0.7382620573043823, 1.0252794027328491, 0....
func (p *provision) policySecretsFromPropertyset() (keyID string, privateKey *rsa.PrivateKey, jwks jwk.Set, err error) { req, err := p.ApigeeClient.NewRequest(http.MethodGet, fmt.Sprintf(propertysetGETOrPUTURL, "remote-service"), nil) if err != nil { return } buf := new(bytes.Buffer) _, err = p.ApigeeClient.Do(...
[ -0.24938997626304626, -0.5698547959327698, 0.601007342338562, -0.7938145399093628, -0.32507482171058655, 0.05128730088472366, -1.3595695495605469, -0.987643837928772, -0.07764077931642532, 0.4972893297672272, -0.47127872705459595, 0.6391759514808655, -0.45896416902542114, 0.663355886936187...
func (p *provision) verifyRemoteServiceProxy(client *http.Client, printf shared.FormatFn) error { verifyGET := func(targetURL string) error { req, err := http.NewRequest(http.MethodGet, targetURL, nil) if err != nil { return errors.Wrapf(err, "creating request") } res, err := client.Do(req) if res != nil...
[ -0.8496240973472595, -0.05307170748710632, 0.8920274376869202, 0.07470239698886871, -0.11337236315011978, -0.3630160093307495, -0.5608811974525452, -0.0880068689584732, 0.26452139019966125, 0.12198416888713837, -0.7563765645027161, 0.9345524311065674, -0.33981606364250183, 0.51275420188903...
func ReadClassFile(raw []byte) (classFile *ClassFile, err error) { defer func() { if e := recover(); e != nil { classFile = nil err = e.(error) } }() classFile = new(ClassFile) err = nil reader := bytes.NewReader(raw) safeReadBinary(reader, binary.BigEndian, &classFile.Magic) if classFile.Magic != Cl...
[ 0.1638760268688202, -0.1006237044930458, 0.8417797684669495, -0.09596023708581924, -0.44260331988334656, 0.8025673627853394, 0.9125878214836121, 0.3605031967163086, -0.22571226954460144, 0.03926697373390198, -0.09089994430541992, -0.10577862709760666, -0.55340975522995, -0.0140723893418908...
func readCpEntry(reader *bytes.Reader) CpEntry { var tag ConstantTag safeReadBinary(reader, binary.BigEndian, &tag) //fmt.Printf("tag %v\n", tag) switch tag { case CONSTANT_Class: var info CONSTANT_Class_info info.Tag = tag safeReadBinary(reader, binary.BigEndian, &info.NameIndex) return &info case CONSTA...
[ 1.1339823007583618, -0.7669386267662048, 0.9401233792304993, -0.8267745971679688, -0.7388318181037903, 0.16643407940864563, -0.23799395561218262, -0.7589743733406067, -0.2616252303123474, 0.5034487247467041, -0.17667768895626068, 0.46592167019844055, -0.033300306648015976, 0.63634169101715...
func readField(reader *bytes.Reader) FieldInfo { var fieldInfo FieldInfo safeReadBinary(reader, binary.BigEndian, &fieldInfo.AccessFlags) safeReadBinary(reader, binary.BigEndian, &fieldInfo.NameIndex) safeReadBinary(reader, binary.BigEndian, &fieldInfo.DescriptorIndex) safeReadBinary(reader, binary.BigEndian, &fie...
[ -0.24988152086734772, -0.04614304006099701, 0.38882651925086975, -1.8109618425369263, -0.5562959909439087, 0.26932305097579956, -0.4360324442386627, -0.6950945258140564, -0.700371503829956, -0.6459121108055115, -0.43659907579421997, -0.22009874880313873, -0.009786837734282017, 0.0115053681...
func readAttr(reader *bytes.Reader) AttrInfo { var attrInfo AttrInfo safeReadBinary(reader, binary.BigEndian, &attrInfo.NameIndex) safeReadBinary(reader, binary.BigEndian, &attrInfo.AttrLength) attrInfo.AttrData = make([]byte, attrInfo.AttrLength) io.ReadFull(reader, attrInfo.AttrData) return attrInfo }
[ 0.1208348423242569, -1.1113578081130981, 0.3955778479576111, -1.627572774887085, -1.2566907405853271, 0.14586976170539856, -0.37021419405937195, -0.34419485926628113, -0.10977224260568619, -0.3591311573982239, 0.12719301879405975, 0.5870751142501831, 0.6662538647651672, 0.39734676480293274...
func readMethod(reader *bytes.Reader) MethodInfo { var methodInfo MethodInfo safeReadBinary(reader, binary.BigEndian, &methodInfo.AccessFlags) safeReadBinary(reader, binary.BigEndian, &methodInfo.NameIndex) safeReadBinary(reader, binary.BigEndian, &methodInfo.DescriptorIndex) safeReadBinary(reader, binary.BigEndia...
[ -0.007121240254491568, -0.4570843279361725, 0.5220819711685181, -1.201402187347412, -0.7953820824623108, -0.4276468753814697, -0.2032708376646042, -0.6756851673126221, -0.6779761910438538, -0.37375608086586, 0.3792819678783417, -0.015172623097896576, 0.3149585425853729, 0.5189009308815002,...
func NewRedisRateLimiter(windowSize int, limitMap map[string]uint64, redisClient *redis.Client) *RedisRateLimiter { if windowSize == 0 { windowSize = 60 // seconds } return &RedisRateLimiter{ windowSize: windowSize, limitMap: limitMap, redisClient: redisClient, } }
[ -0.0073063732124865055, 0.5946314334869385, 0.44920656085014343, -0.29092493653297424, -1.4592349529266357, -0.38916492462158203, -1.4671556949615479, -0.1150943860411644, 0.7909427285194397, 0.34191203117370605, -0.3733580708503723, 1.1875683069229126, -1.4381874799728394, 0.0384081825613...
func (r *RedisRateLimiter) IsLimitBreached(key string) (bool, error) { limit := r.limitMap[key] windowSize := r.windowSize // seconds filename := getFilePath() content, err := ioutil.ReadFile(filename) if err != nil { _ = fmt.Errorf("could not read file %s: %+v", filename, err) return false, errors.New("error ...
[ -0.22334927320480347, 0.11934112757444382, 1.1852059364318848, -0.34393826127052307, -0.23861779272556305, 0.4510645568370819, -0.33744215965270996, 0.2513798475265503, 0.28836590051651, 0.16508108377456665, -0.030292995274066925, 0.5442423820495605, -1.7118390798568726, 0.563636839389801,...
func getFilePath() string { _, filename, _, _ := runtime.Caller(1) return path.Join(path.Dir(filename), "/ratelimiter.lua") }
[ 1.2654365301132202, 0.3279043138027191, 0.7497966289520264, -0.14832380414009094, 0.7450093626976013, 0.6671046614646912, 0.9246649742126465, 0.3481842279434204, -0.9197756052017212, 0.27082544565200806, 0.6876921653747559, 0.5341464281082153, -0.9466850757598877, 0.5524467825889587, 0.4...
func (s TokenStrategy) String() string { return strategyToString[s] }
[ 0.36559757590293884, -0.966938853263855, -0.01266357209533453, -0.8237465620040894, -0.2198854386806488, -0.12645329535007477, -0.11421211808919907, -1.465211272239685, 0.6677829027175903, 0.3689015805721283, 0.3639014661312103, 1.194166898727417, 0.8742552995681763, -0.4686141014099121, ...
func (s *TokenStrategy) UnmarshalYAML(unmarshal func(interface{}) error) error { var t string err := unmarshal(&t) if err != nil { return err } if val, ok := toStrategy[strings.ToLower(t)]; ok { *s = val return nil } return fmt.Errorf("'%s' is not a valid token strategy", t) }
[ 0.4512741267681122, 0.36637094616889954, 0.564310610294342, -0.5525139570236206, -0.678309977054596, -1.2024463415145874, 0.12039893120527267, 0.3499060571193695, 0.4842500388622284, 0.746620237827301, 0.5452843904495239, 0.9354684948921204, 0.9481521248817444, -0.47551777958869934, -0.1...
func (p *Product) VerifyToken(token string) bool { switch p.TokenSettings.Strategy { case StaticToken: return *p.TokenSettings.Value == token } panic(fmt.Sprintf("Token strategy %v is not implemented", p.TokenSettings.Strategy)) }
[ -0.06659102439880371, 0.2706014811992645, 0.3853234648704529, 0.5741091966629028, 0.5915747284889221, 0.78706294298172, 0.04482102021574974, -0.5808891654014587, 0.8810761570930481, 0.15554383397102356, -0.9631962180137634, 0.8076956868171692, 0.3874965310096741, 0.4045545160770416, 0.26...
func (r *AnalyticsResult) Next(valuePtr interface{}) bool { if r.err != nil { return false } row := r.NextBytes() if row == nil { return false } r.err = r.serializer.Deserialize(row, valuePtr) if r.err != nil { return false } return true }
[ 0.06486468762159348, 0.853836178779602, 0.3594632148742676, 0.11959681659936905, -1.102666974067688, -0.0762268528342247, -0.33127057552337646, -0.9857848882675171, 0.536348283290863, 0.0920822024345398, 0.25600123405456543, 0.08480177074670792, -0.6263473033905029, -0.2783600687980652, ...
func (r *AnalyticsResult) NextBytes() []byte { if r.streamResult.Closed() { return nil } raw, err := r.streamResult.NextBytes() if err != nil { r.err = err return nil } return raw }
[ 0.38077300786972046, 0.9509403705596924, 0.340939462184906, 0.00662649841979146, -0.7892390489578247, -0.4158708453178406, 0.011077291332185268, -1.6338735818862915, 0.38225057721138, -0.6457169055938721, 0.6233400702476501, 0.6302923560142517, -1.055846095085144, 0.4548433721065521, -0....
func (r *AnalyticsResult) Close() error { if r.streamResult.Closed() { return r.err } err := r.streamResult.Close() ctxErr := r.ctx.Err() if r.cancel != nil { r.cancel() } if ctxErr == context.DeadlineExceeded { return timeoutError{} } if r.err != nil { return r.err } return err }
[ 0.8995108604431152, 0.24854734539985657, 0.5502078533172607, 0.10234034806489944, -0.7870954275131226, -0.06603311747312546, 0.44743043184280396, -0.9613795876502991, -0.5540401935577393, 0.20086435973644257, 0.8761764168739319, -0.056987371295690536, -0.46028241515159607, 0.04323867335915...
func (r *AnalyticsResult) One(valuePtr interface{}) error { if !r.Next(valuePtr) { err := r.Close() if err != nil { return err } return noResultsError{} } // We have to purge the remaining rows in order to get to the remaining // response attributes for r.NextBytes() != nil { } err := r.Close() if ...
[ -0.5561631917953491, 0.42933160066604614, 0.6843791007995605, 0.05906466022133827, 0.31362852454185486, 0.0507836639881134, 0.9215072989463806, -0.9077988862991333, -0.10646375268697739, 0.2051224559545517, 0.532690167427063, -0.2003578543663025, -0.6333028078079224, -0.048155348747968674,...
func (r *AnalyticsResult) Metadata() (*AnalyticsMetadata, error) { if !r.streamResult.Closed() { return nil, clientError{message: "result must be closed before accessing meta-data"} } return &r.metadata, nil }
[ 0.13364194333553314, 0.1791517287492752, 0.4824160635471344, 0.08740610629320145, 0.18051788210868835, -0.29657095670700073, 0.5726076364517212, -1.8468600511550903, -0.20592068135738373, 0.12271381169557571, 0.44713911414146423, 0.7192767858505249, -0.6927897930145264, -0.2926807105541229...
func (r *AnalyticsMetadata) Warnings() []AnalyticsWarning { return r.warnings }
[ 0.07802309095859528, -0.15120714902877808, 0.15807032585144043, 0.33513951301574707, 0.8583846092224121, 0.633480429649353, -0.5126240253448486, -1.4922125339508057, 0.13465818762779236, 0.6980079412460327, 0.20887744426727295, 1.4011406898498535, 0.9144526720046997, -0.4006524682044983, ...
func (r *AnalyticsMetadata) Status() string { return r.status }
[ 0.6356625556945801, -0.9657511711120605, -0.1334737092256546, -0.3946406841278076, 0.23675437271595, 1.349014163017273, -0.14263121783733368, 0.047261565923690796, 0.047738444060087204, 0.7215046882629395, 0.12341337651014328, 1.179848551750183, 0.7088388800621033, -0.2552928924560547, 0...
func (r *AnalyticsMetadata) Metrics() AnalyticsMetrics { return r.metrics }
[ 0.313884973526001, -0.049228690564632416, 0.03788508102297783, -0.3591925799846649, -0.1224098801612854, 0.789844274520874, 0.5547341704368591, -0.6766531467437744, 0.282212495803833, -0.14945892989635468, 0.9180253744125366, 0.7122324705123901, 0.7121289968490601, -0.7052530646324158, -...
func (r *AnalyticsMetadata) RequestID() string { return r.requestID }
[ 0.24773471057415009, -0.5162032246589661, 0.10854567587375641, 0.5009423494338989, -0.1718609780073166, 1.5522180795669556, 0.17504437267780304, -0.36736124753952026, 0.7595086693763733, 0.3259294927120209, 0.9817559123039246, 1.1851332187652588, 0.494384765625, 0.16353482007980347, -0.6...
func (r *AnalyticsMetadata) ClientContextID() string { return r.clientContextID }
[ 1.9347468614578247, -1.1160069704055786, 0.05904531106352806, -0.6654694080352783, -0.2790833115577698, 0.6323766708374023, 0.7886194586753845, -0.8996301889419556, 0.5571958422660828, 1.021349310874939, 0.17719878256320953, 1.0456092357635498, 0.6928759813308716, -0.12863358855247498, -...
func (c *Cluster) AnalyticsQuery(statement string, opts *AnalyticsOptions) (*AnalyticsResult, error) { if opts == nil { opts = &AnalyticsOptions{} } ctx := opts.Context if ctx == nil { ctx = context.Background() } provider, err := c.getHTTPProvider() if err != nil { return nil, err } return c.analytics...
[ 0.32708242535591125, 0.3750033676624298, 0.5423906445503235, 0.6677284836769104, 0.26033976674079895, -0.837235689163208, 0.1353786289691925, -0.7080105543136597, 0.5719364881515503, 0.26355209946632385, 1.1413825750350952, 1.4817944765090942, 0.26231491565704346, -0.6414614319801331, -0...
func (ra RegistrationAssignment) MarshalJSON() ([]byte, error) { objectMap := make(map[string]interface{}) if ra.Properties != nil { objectMap["properties"] = ra.Properties } return json.Marshal(objectMap) }
[ -1.0376620292663574, -0.6313523054122925, 0.17825627326965332, -0.36592286825180054, -0.46954545378685, -0.1805594563484192, 0.2731390595436096, 0.6794825196266174, 0.25673359632492065, 0.9258253574371338, -0.4876856207847595, 0.40203940868377686, -0.1545661985874176, 1.1227741241455078, ...
func (iter *RegistrationAssignmentListIterator) NextWithContext(ctx context.Context) (err error) { if tracing.IsEnabled() { ctx = tracing.StartSpan(ctx, fqdn+"/RegistrationAssignmentListIterator.NextWithContext") defer func() { sc := -1 if iter.Response().Response.Response != nil { sc = iter.Response().R...
[ -0.722154974937439, 0.05707257613539696, 0.6499778032302856, 0.25841280817985535, -1.1345877647399902, 0.04974288120865822, 0.05137048661708832, -0.6304405331611633, 0.8050481081008911, 0.8833356499671936, 0.030119426548480988, -0.22538764774799347, -0.5454495549201965, 0.754207193851471, ...
func (iter *RegistrationAssignmentListIterator) Next() error { return iter.NextWithContext(context.Background()) }
[ -0.8020406365394592, 0.5498044490814209, 0.16015936434268951, 0.9861888885498047, -0.8661366701126099, 0.2522498369216919, 0.35444989800453186, 0.06847817450761795, 0.45787274837493896, 0.9731528162956238, 0.8191246390342712, 0.564639151096344, -0.1715482622385025, 1.217401385307312, 0.0...
func (iter RegistrationAssignmentListIterator) NotDone() bool { return iter.page.NotDone() && iter.i < len(iter.page.Values()) }
[ -1.2339799404144287, 0.26748180389404297, 0.21601781249046326, 0.07678884267807007, -0.013599821366369724, 0.3100823163986206, 0.30726203322410583, -0.07446793466806412, -0.6421523690223694, 0.8780367970466614, 0.1417827159166336, -1.0994722843170166, -0.9267188906669617, 1.337522745132446...
func (iter RegistrationAssignmentListIterator) Response() RegistrationAssignmentList { return iter.page.Response() }
[ -1.1110161542892456, -0.8513597249984741, 0.12775109708309174, 0.5043265223503113, -0.5924884080886841, 0.03561670333147049, 0.9769702553749084, 0.27249741554260254, 1.1633329391479492, 1.09469473361969, -0.3896137475967407, -0.7902998328208923, 0.3806542158126831, 0.7746414542198181, -0...
func (iter RegistrationAssignmentListIterator) Value() RegistrationAssignment { if !iter.page.NotDone() { return RegistrationAssignment{} } return iter.page.Values()[iter.i] }
[ -1.9079899787902832, -0.242460697889328, 0.43438106775283813, 0.26757529377937317, -0.011619883589446545, -0.08583876490592957, 0.8873754739761353, -0.5344985723495483, 0.3998616933822632, 1.1290037631988525, 0.6870343089103699, 0.16516435146331787, -0.2443499118089676, 0.841522753238678, ...
func NewRegistrationAssignmentListIterator(page RegistrationAssignmentListPage) RegistrationAssignmentListIterator { return RegistrationAssignmentListIterator{page: page} }
[ -2.080230951309204, -0.5501651167869568, -0.05686074122786522, 0.09793657809495926, -1.3650219440460205, -0.20570439100265503, -0.023288482800126076, 0.4062578082084656, 0.13817737996578217, 1.4209026098251343, -0.36917567253112793, -0.40912970900535583, 0.5486060976982117, 1.2771433591842...
func (ral RegistrationAssignmentList) IsEmpty() bool { return ral.Value == nil || len(*ral.Value) == 0 }
[ -1.8247419595718384, 0.019457751885056496, 0.37628641724586487, 0.5481003522872925, 0.8064021468162537, 0.10815650969743729, -0.2468012422323227, 1.0196657180786133, 0.3320164978504181, 0.7707424163818359, -0.49603018164634705, 0.12023274600505829, 0.005473920609802008, 1.4924107789993286,...
func (ral RegistrationAssignmentList) hasNextLink() bool { return ral.NextLink != nil && len(*ral.NextLink) != 0 }
[ -0.38973796367645264, 0.23729459941387177, 0.17522940039634705, 0.28757500648498535, -0.14280489087104797, -0.2643282413482666, -0.2897341251373291, 1.5013411045074463, -0.006615739315748215, -0.44450536370277405, -0.5043697357177734, -0.10593143850564957, 0.25549551844596863, 1.6895666122...
func (ral RegistrationAssignmentList) registrationAssignmentListPreparer(ctx context.Context) (*http.Request, error) { if !ral.hasNextLink() { return nil, nil } return autorest.Prepare((&http.Request{}).WithContext(ctx), autorest.AsJSON(), autorest.AsGet(), autorest.WithBaseURL(to.String(ral.NextLink))) }
[ -1.8281066417694092, 0.10319401323795319, 0.46681326627731323, 0.2096620351076126, -0.6485503911972046, -0.14309833943843842, -0.23999543488025665, 0.09454924613237381, 0.7791688442230225, 0.7838464379310608, -0.49422237277030945, -0.7311104536056519, 0.3398965895175934, 1.4293895959854126...
func (page *RegistrationAssignmentListPage) NextWithContext(ctx context.Context) (err error) { if tracing.IsEnabled() { ctx = tracing.StartSpan(ctx, fqdn+"/RegistrationAssignmentListPage.NextWithContext") defer func() { sc := -1 if page.Response().Response.Response != nil { sc = page.Response().Response....
[ -0.3349304795265198, 0.03211416304111481, 0.694219172000885, 0.2520171105861664, -0.44756433367729187, 0.18511854112148285, 0.11078020185232162, -0.23802070319652557, 1.0169183015823364, 0.9204330444335938, 0.023177549242973328, -0.07908839732408524, -0.3250473439693451, 0.8811939358711243...
func (page *RegistrationAssignmentListPage) Next() error { return page.NextWithContext(context.Background()) }
[ -0.744426965713501, 0.8684765696525574, 0.16875319182872772, 1.2586859464645386, -0.2673948407173157, 0.6190211176872253, 0.2986707389354706, 0.24320855736732483, 0.7333767414093018, 0.7833608388900757, 0.6736708283424377, 0.56982421875, -0.2820337414741516, 1.269723653793335, 0.28513374...
func (page RegistrationAssignmentListPage) NotDone() bool { return !page.ral.IsEmpty() }
[ -0.636093258857727, 0.39509087800979614, 0.36160188913345337, 0.5483173131942749, 0.9209443926811218, 0.4852878451347351, 0.06146145612001419, 0.4333816170692444, -0.0992821678519249, 0.8051010370254517, -0.17312109470367432, -1.1310052871704102, -0.7560668587684631, 1.6191041469573975, ...
func (page RegistrationAssignmentListPage) Response() RegistrationAssignmentList { return page.ral }
[ -0.9285397529602051, -1.0991864204406738, 0.1419638991355896, 0.6391960382461548, -0.27633917331695557, 0.39374053478240967, 0.818595290184021, 0.823441207408905, 1.6476266384124756, 1.1261624097824097, -0.47225603461265564, -0.804818332195282, 0.5510406494140625, 0.6547409296035767, 0.5...
func (page RegistrationAssignmentListPage) Values() []RegistrationAssignment { if page.ral.IsEmpty() { return nil } return *page.ral.Value }
[ -1.1375246047973633, 0.009387779049575329, 0.4084125757217407, 0.3892289102077484, 0.9934711456298828, -0.03265370428562164, -0.3346712291240692, 0.22789601981639862, 0.517204761505127, 0.502221941947937, -0.3017895221710205, -0.37615594267845154, -0.10131854563951492, 1.4071629047393799, ...
func NewRegistrationAssignmentListPage(cur RegistrationAssignmentList, getNextPage func(context.Context, RegistrationAssignmentList) (RegistrationAssignmentList, error)) RegistrationAssignmentListPage { return RegistrationAssignmentListPage{ fn: getNextPage, ral: cur, } }
[ -1.4462966918945312, 0.36543622612953186, 0.04893741384148598, 0.06576582044363022, -0.5024359226226807, 0.018567396327853203, 0.19396419823169708, 0.6534692049026489, -0.008642365224659443, 1.204206109046936, -0.21775837242603302, -0.7174105644226074, 0.08989041298627853, 1.14384710788726...
func (rap RegistrationAssignmentProperties) MarshalJSON() ([]byte, error) { objectMap := make(map[string]interface{}) if rap.RegistrationDefinitionID != nil { objectMap["registrationDefinitionId"] = rap.RegistrationDefinitionID } return json.Marshal(objectMap) }
[ -0.7022719979286194, -0.45994967222213745, -0.020289655774831772, -0.22247232496738434, -0.6980665922164917, 0.17685416340827942, 0.5399918556213379, 0.5902961492538452, -0.1839408278465271, 1.2131377458572388, -0.3320719301700592, 0.5703310370445251, 0.4400258958339691, 0.8491359949111938...
func (rapD RegistrationAssignmentPropertiesRegistrationDefinition) MarshalJSON() ([]byte, error) { objectMap := make(map[string]interface{}) if rapD.Properties != nil { objectMap["properties"] = rapD.Properties } if rapD.Plan != nil { objectMap["plan"] = rapD.Plan } return json.Marshal(objectMap) }
[ -0.0812363401055336, -0.4532514810562134, 0.07944485545158386, -0.8189640641212463, -0.1339324712753296, -0.007533928845077753, 0.08498595654964447, 0.740606427192688, -0.08551103621721268, 0.768717885017395, -0.3533276319503784, 0.406074583530426, 0.8225046396255493, 1.0327179431915283, ...
func (rd RegistrationDefinition) MarshalJSON() ([]byte, error) { objectMap := make(map[string]interface{}) if rd.Properties != nil { objectMap["properties"] = rd.Properties } if rd.Plan != nil { objectMap["plan"] = rd.Plan } return json.Marshal(objectMap) }
[ -0.5344220399856567, 0.4291693866252899, 0.313271164894104, -0.2843320965766907, -0.3389692008495331, -0.29617318511009216, 0.08036696910858154, 0.716975212097168, 0.6688060760498047, 0.5637463927268982, -1.0578418970108032, 0.8085674047470093, -0.07794462889432907, 0.7672167420387268, 0...
func (iter *RegistrationDefinitionListIterator) NextWithContext(ctx context.Context) (err error) { if tracing.IsEnabled() { ctx = tracing.StartSpan(ctx, fqdn+"/RegistrationDefinitionListIterator.NextWithContext") defer func() { sc := -1 if iter.Response().Response.Response != nil { sc = iter.Response().R...
[ -0.35181909799575806, 0.33359038829803467, 0.5408768653869629, 0.3253190815448761, -0.7405813932418823, -0.2746478319168091, -0.15337041020393372, -0.7192781567573547, 0.9285582304000854, 0.732729434967041, -0.4946024417877197, -0.08323947340250015, -0.47482046484947205, 0.9127000570297241...
func (iter *RegistrationDefinitionListIterator) Next() error { return iter.NextWithContext(context.Background()) }
[ -0.21887312829494476, 1.0921809673309326, 0.08728024363517761, 1.2312169075012207, -0.3166922926902771, -0.05647476762533188, 0.014238199219107628, 0.028963737189769745, 0.6107441782951355, 0.9056627750396729, 0.10848840326070786, 0.8852931261062622, -0.23023779690265656, 1.388037562370300...
func (iter RegistrationDefinitionListIterator) NotDone() bool { return iter.page.NotDone() && iter.i < len(iter.page.Values()) }
[ -0.7236470580101013, 0.644595205783844, 0.14387620985507965, 0.17801935970783234, 0.4647383689880371, 0.173005610704422, 0.13707858324050903, -0.09636703878641129, -0.4340015649795532, 0.7954691052436829, -0.4145442545413971, -0.8944090008735657, -0.9143238663673401, 1.4325523376464844, ...
func (iter RegistrationDefinitionListIterator) Response() RegistrationDefinitionList { return iter.page.Response() }
[ -0.3395470380783081, -0.14394883811473846, 0.147727370262146, 0.9097619652748108, -0.0951082706451416, -0.23223048448562622, 0.5120464563369751, 0.154743492603302, 1.312391757965088, 0.8146492838859558, -1.108769178390503, -0.3967496156692505, 0.09770824015140533, 0.9066183567047119, -0....
func (iter RegistrationDefinitionListIterator) Value() RegistrationDefinition { if !iter.page.NotDone() { return RegistrationDefinition{} } return iter.page.Values()[iter.i] }
[ -0.6372794508934021, 0.3543211817741394, 0.2728469967842102, 0.2569187581539154, 0.2907181978225708, -0.004154887516051531, 0.2945258915424347, -0.16832801699638367, 0.44428595900535583, 1.003691554069519, -0.22288036346435547, 0.36635568737983704, -0.3312031328678131, 0.9349057674407959, ...
func NewRegistrationDefinitionListIterator(page RegistrationDefinitionListPage) RegistrationDefinitionListIterator { return RegistrationDefinitionListIterator{page: page} }
[ -1.0890575647354126, -0.04105669632554054, 0.06946216523647308, 0.45169422030448914, -0.9615524411201477, -0.48229551315307617, -0.3711717426776886, 0.622751772403717, 0.6626509428024292, 1.1374677419662476, -0.8809090256690979, 0.1910865306854248, 0.2924363315105438, 1.1905165910720825, ...
func (rdl RegistrationDefinitionList) IsEmpty() bool { return rdl.Value == nil || len(*rdl.Value) == 0 }
[ -1.3861167430877686, 1.0579473972320557, 0.28194791078567505, 0.4502409100532532, 1.151355504989624, -0.0681360587477684, -0.33790314197540283, 0.5876749753952026, 0.4521372616291046, 0.7979620695114136, -1.1105046272277832, 0.32652151584625244, -0.04932990297675133, 1.3357905149459839, ...
func (rdl RegistrationDefinitionList) hasNextLink() bool { return rdl.NextLink != nil && len(*rdl.NextLink) != 0 }
[ 0.2508683204650879, 0.9670885801315308, 0.22182703018188477, 0.2870539724826813, 0.0350753590464592, -0.6842324733734131, -0.19552595913410187, 1.318038821220398, 0.005028094165027142, -0.5904096961021423, -0.7507104277610779, 0.11494946479797363, 0.3487592041492462, 1.6175998449325562, ...
func (rdl RegistrationDefinitionList) registrationDefinitionListPreparer(ctx context.Context) (*http.Request, error) { if !rdl.hasNextLink() { return nil, nil } return autorest.Prepare((&http.Request{}).WithContext(ctx), autorest.AsJSON(), autorest.AsGet(), autorest.WithBaseURL(to.String(rdl.NextLink))) }
[ -1.0407801866531372, 0.7983707189559937, 0.4629514515399933, 0.1906224638223648, -0.023260202258825302, -0.3133962154388428, -0.48209285736083984, 0.2340715378522873, 1.3463494777679443, 0.6352682113647461, -1.0577752590179443, -0.4466521441936493, 0.2432362139225006, 1.510697841644287, ...
func (page *RegistrationDefinitionListPage) NextWithContext(ctx context.Context) (err error) { if tracing.IsEnabled() { ctx = tracing.StartSpan(ctx, fqdn+"/RegistrationDefinitionListPage.NextWithContext") defer func() { sc := -1 if page.Response().Response.Response != nil { sc = page.Response().Response....
[ -0.05239900201559067, 0.5201610922813416, 0.5948874950408936, 0.14235112071037292, -0.23803484439849854, -0.17854131758213043, -0.19581463932991028, -0.5232927203178406, 1.2410989999771118, 0.6977195739746094, -0.5017892122268677, 0.0894099697470665, -0.4551551938056946, 0.981215238571167,...
func (page *RegistrationDefinitionListPage) Next() error { return page.NextWithContext(context.Background()) }
[ -0.2100757658481598, 1.2414804697036743, 0.12499920278787613, 1.4490077495574951, 0.09351607412099838, 0.2833141088485718, -0.031219638884067535, 0.2053835391998291, 0.9612270593643188, 0.6337920427322388, -0.016652487218379974, 0.8613720536231995, -0.44054657220840454, 1.4184997081756592,...
func (page RegistrationDefinitionListPage) NotDone() bool { return !page.rdl.IsEmpty() }
[ -0.21980352699756622, 0.9794601798057556, 0.39884671568870544, 0.416373074054718, 1.1839089393615723, 0.21949297189712524, -0.2673652172088623, 0.13355334103107452, 0.0293398629873991, 0.6893055438995361, -0.6602509617805481, -0.9091646075248718, -0.9502114653587341, 1.4032371044158936, ...
func (page RegistrationDefinitionListPage) Response() RegistrationDefinitionList { return page.rdl }
[ -0.05655813589692116, -0.018029827624559402, 0.20058485865592957, 0.6642089486122131, -0.23948568105697632, 0.09904858469963074, 0.10079704225063324, 0.40572264790534973, 1.9993900060653687, 0.7179263234138489, -1.0931110382080078, -0.3110140860080719, 0.1206774190068245, 0.524077117443084...
func (page RegistrationDefinitionListPage) Values() []RegistrationDefinition { if page.rdl.IsEmpty() { return nil } return *page.rdl.Value }
[ -0.38159316778182983, 0.9555079340934753, 0.2867763936519623, 0.1792299896478653, 1.1259299516677856, -0.20050381124019623, -0.8574416637420654, 0.27249056100845337, 0.6200310587882996, 0.34936246275901794, -0.9827336668968201, -0.031302161514759064, -0.341188907623291, 1.3565726280212402,...
func NewRegistrationDefinitionListPage(cur RegistrationDefinitionList, getNextPage func(context.Context, RegistrationDefinitionList) (RegistrationDefinitionList, error)) RegistrationDefinitionListPage { return RegistrationDefinitionListPage{ fn: getNextPage, rdl: cur, } }
[ -0.6185718178749084, 0.7802614569664001, 0.2077207863330841, 0.4071803390979767, -0.08917015790939331, -0.2994530498981476, -0.16258299350738525, 0.7137357592582703, 0.5603364109992981, 0.6198679208755493, -0.990598738193512, -0.03018776886165142, -0.087196946144104, 1.2422527074813843, ...
func (rdp RegistrationDefinitionProperties) MarshalJSON() ([]byte, error) { objectMap := make(map[string]interface{}) if rdp.Description != nil { objectMap["description"] = rdp.Description } if rdp.Authorizations != nil { objectMap["authorizations"] = rdp.Authorizations } if rdp.RegistrationDefinitionName != ...
[ -0.21744123101234436, 0.48362693190574646, 0.22163128852844238, 0.06781526654958725, -0.32194164395332336, 0.15860696136951447, 0.1844283789396286, 0.4804614782333374, -0.02173452451825142, 0.6631936430931091, -1.1071853637695312, 0.7390928268432617, -0.5779320597648621, 0.558083713054657,...
func LinkTag(e *Context) error { preconnectAdded := false for n := e.DOM.RootNode; n != nil; n = htmlnode.Next(n) { if !preconnectAdded && isLinkAnyGoogleFont(n) { addLinkGoogleFontPreconnect(n) preconnectAdded = true } if isLinkGoogleFont(n) { addDisplayOptional(n) } } addLinkPublisherOriginPrec...
[ 0.31101053953170776, -0.182711660861969, 0.38867682218551636, 0.26232418417930603, 0.9113049507141113, -0.312521368265152, 0.4628424644470215, 0.11392352730035782, 0.7676991820335388, 0.2408359944820404, -0.16400820016860962, 0.319356769323349, -0.3151308298110962, 1.794019341468811, -0....
func isLinkAnyGoogleFont(n *html.Node) bool { if n.DataAtom != atom.Link { return false } v, ok := htmlnode.GetAttributeVal(n, "", "href") return ok && strings.HasPrefix(v, "https://fonts.googleapis.com/") }
[ -0.6288585066795349, -0.6041169166564941, 0.3602374196052551, -0.2468528151512146, 0.5878563523292542, -0.8424080610275269, -0.4831368625164032, -0.4745960235595703, 0.5328810811042786, -0.976851761341095, -0.33877626061439514, 0.9877380132675171, -0.21596896648406982, 1.0866097211837769, ...
func isLinkGoogleFont(n *html.Node) bool { if n.DataAtom != atom.Link { return false } v, ok := htmlnode.GetAttributeVal(n, "", "href") return ok && (strings.HasPrefix(v, "https://fonts.googleapis.com/css?") || strings.HasPrefix(v, "https://fonts.googleapis.com/css2?")) }
[ -0.45834413170814514, -0.3489108681678772, 0.3346872925758362, -0.3122527301311493, 0.5212763547897339, -0.22658120095729828, -0.2026022970676422, -0.6090937256813049, 0.791013240814209, -0.551139771938324, -0.0456957183778286, 1.3518726825714111, -0.10324639081954956, 0.6394405364990234, ...
func addDisplayOptional(n *html.Node) { // Confirm this is a Google Font if !isLinkGoogleFont(n) { return } if hrefVal, hrefOk := htmlnode.GetAttributeVal(n, "", "href"); hrefOk { if u, _ := url.Parse(strings.ToLower(hrefVal)); u != nil { v := u.Query() if g := v.Get("display"); g == "" { htmlnode.App...
[ 0.39052391052246094, 0.08903344720602036, 0.6715674996376038, -0.19087164103984833, 0.061743322759866714, 0.10339571535587311, 0.050798553973436356, -0.23848479986190796, 1.2889608144760132, 0.11891122907400131, 0.7719597220420837, 0.26603513956069946, 0.023669879883527756, 1.1715015172958...
func addLinkGoogleFontPreconnect(n *html.Node) { if n.DataAtom != atom.Link { return } preconnect := htmlnode.Element("link", html.Attribute{Key: "crossorigin"}, html.Attribute{Key: "href", Val: "https://fonts.gstatic.com/"}, html.Attribute{Key: "rel", Val: "dns-prefetch preconnect"}) n.Parent.InsertBe...
[ -0.1882953941822052, 0.5390682816505432, 0.6451348662376404, -0.8770323395729065, 0.46580472588539124, 0.15252210199832916, -0.28973135352134705, -0.2088920772075653, 0.06808685511350632, -0.48255833983421326, -0.5130318403244019, 0.21129362285137177, 0.037479646503925323, 0.15397000312805...
func addLinkPublisherOriginPreconnect(n *html.Node, u *url.URL) { if n.DataAtom != atom.Head { return } // Generates a preconnect value, which does not need anything // other than the origin to connect to, so to shave some bytes, strip // everything else. urlCopy := *u urlCopy.User = nil urlCopy.Path = "" ur...
[ 0.20668059587478638, -0.12133850157260895, 0.539405882358551, -0.26241928339004517, -0.3541244864463806, 0.12317036092281342, -0.24551425874233246, 0.5223438143730164, 0.5915368795394897, -1.130443811416626, 0.11203674226999283, 0.037972353398799896, -0.019742872565984726, 0.21880684792995...
func Exclusive(path string) (fd int, err error) { fd, err = unix.Open(path, os.O_RDONLY, 0) if err != nil { return fd, err } err = unix.Flock(fd, unix.LOCK_EX) if err != nil { unix.Close(fd) return fd, err } return fd, nil }
[ 0.3931930363178253, 0.1721436083316803, 0.9474055171012878, 0.00837569311261177, -1.2098816633224487, -0.3817986249923706, -0.10378336906433105, 0.2321663349866867, 0.6551744937896729, -1.1711663007736206, 0.4425713121891022, 0.9433149099349976, -0.5454661846160889, -0.32297030091285706, ...
func Release(fd int) error { defer unix.Close(fd) if err := unix.Flock(fd, unix.LOCK_UN); err != nil { return err } return nil }
[ -0.30714261531829834, 0.7669359445571899, 0.4929603040218353, -0.19912613928318024, -0.5559734106063843, -0.007123380433768034, -0.07578281313180923, -0.4788264334201813, -0.2308296412229538, -0.36501726508140564, 0.04944567382335663, 0.39326873421669006, -0.3934132754802704, 0.19315370917...
func NewByteRange(fd int, start, len int64) *ByteRange { return &ByteRange{fd, start, len} }
[ 0.4790874123573303, -0.6438887715339661, 0.06362897902727127, -0.32600075006484985, -0.8123252987861633, -0.9767356514930725, -0.6949824690818787, 0.015584138222038746, -1.0281120538711548, -0.44726112484931946, -0.894903302192688, 0.8467524647712708, -0.12054780125617981, -0.0315345302224...