text
stringlengths
11
6.3k
embedding
listlengths
768
768
func (in *ActionLocationNetworkCreateInput) UnselectParameters(params ...string) *ActionLocationNetworkCreateInput { if in._selectedParameters == nil { return in } for _, param := range params { delete(in._selectedParameters, param) } return in }
[ -0.6119487881660461, -0.41457393765449524, -0.03395261615514755, -0.17757999897003174, 0.6580706834793091, -0.2492743879556656, 0.4153323173522949, -0.59117591381073, 0.07349936664104462, 0.15052743256092072, -0.10571104288101196, 0.4247199594974518, -0.8050950765609741, -0.084765426814556...
func (action *ActionLocationNetworkCreate) Prepare() *ActionLocationNetworkCreateInvocation { return &ActionLocationNetworkCreateInvocation{ Action: action, Path: "/v6.0/location_networks", } }
[ 0.43278607726097107, -0.41868168115615845, 0.43148043751716614, 0.06385994702577591, 0.3533181846141815, -0.26388221979141235, 0.1358809620141983, -0.5748160481452942, 0.8252440094947815, -0.2657482624053955, 0.21408912539482117, -0.18006153404712677, 0.8040976524353027, -0.077689751982688...
func (inv *ActionLocationNetworkCreateInvocation) NewInput() *ActionLocationNetworkCreateInput { inv.Input = &ActionLocationNetworkCreateInput{} return inv.Input }
[ 0.5049756765365601, -0.7148942351341248, 0.22000199556350708, 0.3883627951145172, 0.4917888939380646, 0.7616127729415894, 0.7947723865509033, -0.19175997376441956, 0.6204742193222046, -1.0743035078048706, 0.27597731351852417, 0.16310973465442657, -0.1292577087879181, -0.4889853596687317, ...
func (inv *ActionLocationNetworkCreateInvocation) SetInput(input *ActionLocationNetworkCreateInput) *ActionLocationNetworkCreateInvocation { inv.Input = input return inv }
[ -0.26556721329689026, 0.10615165531635284, 0.12016277015209198, 0.5819780826568604, 0.7374112010002136, 1.333311676979065, 0.8210893869400024, 0.2893209457397461, 0.5872514843940735, -1.3706421852111816, -0.42216557264328003, 0.14826719462871552, -0.13899998366832733, 0.3139171302318573, ...
func (inv *ActionLocationNetworkCreateInvocation) IsParameterSelected(param string) bool { if inv.Input._selectedParameters == nil { return true } _, exists := inv.Input._selectedParameters[param] return exists }
[ -0.8978556394577026, -0.5226529240608215, 0.23119622468948364, -0.02200992777943611, 0.8465113043785095, -0.3499954640865326, 0.7751368284225464, -0.6734394431114197, 0.6660376191139221, 0.2245778888463974, -0.3633090555667877, 1.1589993238449097, -0.8176693320274353, 0.0989094078540802, ...
func (inv *ActionLocationNetworkCreateInvocation) IsParameterNil(param string) bool { if inv.Input._nilParameters == nil { return false } _, exists := inv.Input._nilParameters[param] return exists }
[ -0.6112149953842163, -0.6600642800331116, 0.46509498357772827, 0.38201889395713806, -0.04410127177834511, -0.42628127336502075, -0.026751410216093063, -0.0657031312584877, 0.9847642183303833, 1.0007013082504272, -0.3101940453052521, 0.5495753288269043, -0.5370791554450989, 0.36909195780754...
func (inv *ActionLocationNetworkCreateInvocation) NewMetaInput() *ActionLocationNetworkCreateMetaGlobalInput { inv.MetaInput = &ActionLocationNetworkCreateMetaGlobalInput{} return inv.MetaInput }
[ 0.4310201108455658, -0.7548805475234985, 0.33119118213653564, 0.06393969804048538, -0.028294725343585014, 0.6512686610221863, 0.4082701504230499, 0.20748652517795563, 0.15999530255794525, -0.9008697867393494, -0.12963014841079712, 0.3587559461593628, 0.33338794112205505, -0.266229063272476...
func (inv *ActionLocationNetworkCreateInvocation) SetMetaInput(input *ActionLocationNetworkCreateMetaGlobalInput) *ActionLocationNetworkCreateInvocation { inv.MetaInput = input return inv }
[ -0.18025636672973633, -0.6363345980644226, 0.2542569935321808, 0.12538069486618042, 0.6401572227478027, 1.0216737985610962, 0.7386050224304199, 0.1416146457195282, 0.2984958291053772, -1.005833387374878, -0.5034458041191101, 0.5230665802955627, 0.2600710093975067, 0.4072783887386322, 0.4...
func (inv *ActionLocationNetworkCreateInvocation) IsMetaParameterSelected(param string) bool { if inv.MetaInput._selectedParameters == nil { return true } _, exists := inv.MetaInput._selectedParameters[param] return exists }
[ -1.0256394147872925, -0.5887433290481567, 0.4339308738708496, -0.32076212763786316, 0.46762797236442566, 0.12761016190052032, 0.4325411021709442, -0.9623149633407593, 0.4592898488044739, 0.7812105417251587, -0.10721711069345474, 0.8200036287307739, -0.35075899958610535, 0.18479304015636444...
func (inv *ActionLocationNetworkCreateInvocation) IsMetaParameterNil(param string) bool { if inv.MetaInput._nilParameters == nil { return false } _, exists := inv.MetaInput._nilParameters[param] return exists }
[ -0.6263028383255005, -0.7362127304077148, 0.6155168414115906, -0.1372184455394745, -0.17943793535232544, 0.07284625619649887, -0.25194230675697327, -0.5220769047737122, 0.7269240021705627, 1.0333350896835327, -0.10853151232004166, 0.00738063408061862, -0.23247577250003815, 0.54526197910308...
func (inv *ActionLocationNetworkCreateInvocation) Call() (*ActionLocationNetworkCreateResponse, error) { return inv.callAsBody() }
[ -0.6045792102813721, -0.36639639735221863, 0.24846304953098297, 0.10636938363313675, 0.5095060467720032, 0.8560037016868591, -0.5811837911605835, -0.9552329182624817, 0.3843543529510498, 0.11292743682861328, 0.10672389715909958, 0.3169272840023041, 0.29201462864875793, 0.09087406098842621,...
func NewSyncGroupsClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) *SyncGroupsClient { cp := arm.ClientOptions{} if options != nil { cp = *options } if len(cp.Endpoint) == 0 { cp.Endpoint = arm.AzurePublicCloud } client := &SyncGroupsClient{ subscriptionID: subscr...
[ 0.581594705581665, -0.053534891456365585, 0.0755695030093193, -0.008519753813743591, -0.1641361117362976, -0.4409460127353668, -0.115632064640522, -0.6892748475074768, -1.2338852882385254, 0.2891924977302551, -0.4824747145175934, 1.2922520637512207, -0.5025455355644226, -0.3460292816162109...
func (client *SyncGroupsClient) cancelSyncCreateRequest(ctx context.Context, resourceGroupName string, serverName string, databaseName string, syncGroupName string, options *SyncGroupsClientCancelSyncOptions) (*policy.Request, error) { urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/prov...
[ 0.015354320406913757, 0.010449538938701153, 0.568448543548584, -0.14732298254966736, -0.6340796947479248, -0.10553102940320969, 0.5195872783660889, 0.14607393741607666, -0.7998749017715454, -0.15639415383338928, 0.10128835588693619, 0.8422250151634216, -0.6194502711296082, 0.67972034215927...
func (client *SyncGroupsClient) createOrUpdateCreateRequest(ctx context.Context, resourceGroupName string, serverName string, databaseName string, syncGroupName string, parameters SyncGroup, options *SyncGroupsClientBeginCreateOrUpdateOptions) (*policy.Request, error) { urlPath := "/subscriptions/{subscriptionId}/reso...
[ -0.31443527340888977, -0.0747850313782692, 0.6481134295463562, -0.5477229356765747, -0.16682106256484985, 0.11594446003437042, 0.357832670211792, -0.008798953145742416, -0.5749061703681946, 0.4780791997909546, 0.3805086016654968, 0.5326569080352783, -0.6320470571517944, 0.8820564150810242,...
func (client *SyncGroupsClient) deleteCreateRequest(ctx context.Context, resourceGroupName string, serverName string, databaseName string, syncGroupName string, options *SyncGroupsClientBeginDeleteOptions) (*policy.Request, error) { urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/provide...
[ 0.14439742267131805, -0.11005347222089767, 0.8811239004135132, -0.10095559805631638, -0.18756119906902313, -0.24272167682647705, 0.5300338864326477, 0.07707324624061584, -0.5384536385536194, -0.07038130611181259, 0.4119877219200134, 1.1327204704284668, -0.6839131116867065, 0.63691973686218...
func (client *SyncGroupsClient) getCreateRequest(ctx context.Context, resourceGroupName string, serverName string, databaseName string, syncGroupName string, options *SyncGroupsClientGetOptions) (*policy.Request, error) { urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsof...
[ 0.02747918851673603, 0.45786771178245544, 1.028967022895813, -0.24191074073314667, -0.43873074650764465, -0.2807912230491638, 0.022651664912700653, -0.08052678406238556, -0.702601432800293, 0.2961461842060089, 0.6409525871276855, 1.6347723007202148, -0.5629373788833618, 0.593064546585083, ...
func (client *SyncGroupsClient) getHandleResponse(resp *http.Response) (SyncGroupsClientGetResponse, error) { result := SyncGroupsClientGetResponse{RawResponse: resp} if err := runtime.UnmarshalAsJSON(resp, &result.SyncGroup); err != nil { return SyncGroupsClientGetResponse{}, err } return result, nil }
[ 0.03487638756632805, 0.04310186207294464, 0.5683026313781738, -0.07523328065872192, -0.26330751180648804, -0.6455485224723816, 0.7467551231384277, -0.39189115166664124, 0.0461067333817482, -0.4868607819080353, -0.20611031353473663, -0.5518513321876526, -0.951286256313324, -0.67782622575759...
func (client *SyncGroupsClient) listByDatabaseCreateRequest(ctx context.Context, resourceGroupName string, serverName string, databaseName string, options *SyncGroupsClientListByDatabaseOptions) (*policy.Request, error) { urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsof...
[ -0.002007973613217473, 0.6411533355712891, 0.676906943321228, -0.5742824077606201, -0.3313498795032501, -0.7230308055877686, 0.29917624592781067, -0.1171296015381813, -0.4131695032119751, 0.5447704792022705, -0.37383562326431274, 0.8707955479621887, -0.5594191551208496, 0.6132992506027222,...
func (client *SyncGroupsClient) listByDatabaseHandleResponse(resp *http.Response) (SyncGroupsClientListByDatabaseResponse, error) { result := SyncGroupsClientListByDatabaseResponse{RawResponse: resp} if err := runtime.UnmarshalAsJSON(resp, &result.SyncGroupListResult); err != nil { return SyncGroupsClientListByData...
[ 0.2268238663673401, 0.1763235181570053, 0.2830341160297394, -0.7732906937599182, -0.037977900356054306, -0.51840740442276, 1.1745326519012451, -0.27210643887519836, -0.17501041293144226, 0.7337357997894287, -1.0883293151855469, -0.8561230301856995, -0.8295912146568298, 0.014712986536324024...
func (client *SyncGroupsClient) listHubSchemasCreateRequest(ctx context.Context, resourceGroupName string, serverName string, databaseName string, syncGroupName string, options *SyncGroupsClientListHubSchemasOptions) (*policy.Request, error) { urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupNa...
[ -0.2086276262998581, -0.10069544613361359, 0.5329811573028564, -0.37325215339660645, 0.10717567801475525, -0.07703674584627151, 0.10100162774324417, 0.3054870367050171, -0.3584584891796112, -0.13426467776298523, -0.07014049589633942, 0.7804031372070312, -0.5412939190864563, 0.4127067923545...
func (client *SyncGroupsClient) listHubSchemasHandleResponse(resp *http.Response) (SyncGroupsClientListHubSchemasResponse, error) { result := SyncGroupsClientListHubSchemasResponse{RawResponse: resp} if err := runtime.UnmarshalAsJSON(resp, &result.SyncFullSchemaPropertiesListResult); err != nil { return SyncGroupsC...
[ 0.1372530609369278, -0.33760061860084534, 0.2682977020740509, -0.5546359419822693, -0.5528462529182434, -0.04026889428496361, 0.7941626310348511, 0.06988769769668579, 0.3416413962841034, -0.05714065954089165, -0.8482898473739624, -0.9514291882514954, -0.45075803995132446, -0.06240655481815...
func (client *SyncGroupsClient) listLogsCreateRequest(ctx context.Context, resourceGroupName string, serverName string, databaseName string, syncGroupName string, startTime string, endTime string, typeParam SyncGroupsType, options *SyncGroupsClientListLogsOptions) (*policy.Request, error) { urlPath := "/subscriptions/...
[ -0.051202692091464996, 0.3642936050891876, 0.8789977431297302, -0.6462323069572449, -0.08844408392906189, -0.5788022875785828, -0.48996415734291077, -0.2965153753757477, -0.6932316422462463, 0.07815929502248764, 0.2939664423465729, 1.3327662944793701, -0.4189472496509552, 0.564150631427764...
func (client *SyncGroupsClient) listLogsHandleResponse(resp *http.Response) (SyncGroupsClientListLogsResponse, error) { result := SyncGroupsClientListLogsResponse{RawResponse: resp} if err := runtime.UnmarshalAsJSON(resp, &result.SyncGroupLogListResult); err != nil { return SyncGroupsClientListLogsResponse{}, err ...
[ 0.25366517901420593, -0.2687006890773773, 0.34963539242744446, -0.527270495891571, -1.5207655429840088, -0.29470929503440857, 0.1540328711271286, -0.7493589520454407, 0.5124242305755615, 0.4542671740055084, -0.7918275594711304, -0.2239055037498474, -0.4423242211341858, 0.268026202917099, ...
func (client *SyncGroupsClient) listSyncDatabaseIDsCreateRequest(ctx context.Context, locationName string, options *SyncGroupsClientListSyncDatabaseIDsOptions) (*policy.Request, error) { urlPath := "/subscriptions/{subscriptionId}/providers/Microsoft.Sql/locations/{locationName}/syncDatabaseIds" if locationName == ""...
[ -0.06855777651071548, 0.403748482465744, 0.6166386008262634, -0.6490732431411743, -0.007441748399287462, -0.3205275535583496, 0.246810644865036, 0.15108031034469604, -0.15226921439170837, 0.44331124424934387, -0.6806089878082275, 1.5107966661453247, -0.4723595082759857, 0.584617018699646, ...
func (client *SyncGroupsClient) listSyncDatabaseIDsHandleResponse(resp *http.Response) (SyncGroupsClientListSyncDatabaseIDsResponse, error) { result := SyncGroupsClientListSyncDatabaseIDsResponse{RawResponse: resp} if err := runtime.UnmarshalAsJSON(resp, &result.SyncDatabaseIDListResult); err != nil { return SyncGr...
[ 0.10364799201488495, 0.20172429084777832, 0.4282141625881195, -0.5168609619140625, -0.23714713752269745, 0.17648062109947205, 1.262045979499817, -0.041449785232543945, -0.09784487634897232, 0.8180577754974365, -1.3435487747192383, 0.21854867041110992, -0.9391593933105469, -0.03403914719820...
func (client *SyncGroupsClient) refreshHubSchemaCreateRequest(ctx context.Context, resourceGroupName string, serverName string, databaseName string, syncGroupName string, options *SyncGroupsClientBeginRefreshHubSchemaOptions) (*policy.Request, error) { urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resour...
[ -0.1401376873254776, 0.4255090355873108, 0.7281795740127563, 0.22698213160037994, -0.17906229197978973, -0.20371732115745544, -0.3431718051433563, 0.08056417852640152, -0.6216809153556824, 0.13468961417675018, 0.24746374785900116, 0.8148716688156128, -0.7153840065002441, 0.580653727054596,...
func (client *SyncGroupsClient) triggerSyncCreateRequest(ctx context.Context, resourceGroupName string, serverName string, databaseName string, syncGroupName string, options *SyncGroupsClientTriggerSyncOptions) (*policy.Request, error) { urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/pr...
[ -0.12637242674827576, 0.23243406414985657, 0.5134128332138062, -0.2160957008600235, -0.06595596671104431, -0.6579849123954773, 0.22830849885940552, -0.028512608259916306, -0.7436268925666809, 0.16186176240444183, -0.28308361768722534, 0.9121407866477966, -0.5500098466873169, 0.499846786260...
func (client *SyncGroupsClient) updateCreateRequest(ctx context.Context, resourceGroupName string, serverName string, databaseName string, syncGroupName string, parameters SyncGroup, options *SyncGroupsClientBeginUpdateOptions) (*policy.Request, error) { urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{reso...
[ -0.4073961675167084, -0.5063093900680542, 0.8227849006652832, -0.305110901594162, -0.5456741452217102, 0.14725202322006226, 0.34460970759391785, 0.28438395261764526, -0.6989573836326599, 0.6740128397941589, 0.3384609520435333, 1.003488302230835, -0.9580803513526917, 0.5008866786956787, 0...
func NewRefVarTransformer( varMap map[string]string, fs []config.FieldSpec) *RefVarTransformer { return &RefVarTransformer{ varMap: varMap, fieldSpecs: fs, } }
[ -0.32460394501686096, -0.29864728450775146, 0.18223035335540771, 0.024726536124944687, -0.3306335210800171, -0.7887672781944275, -0.3442223370075226, -0.017843622714281082, 0.04229776933789253, -0.47830888628959656, -0.8267306089401245, -0.3536750078201294, -0.41508397459983826, 1.44309949...
func (rv *RefVarTransformer) replaceVars(in interface{}) (interface{}, error) { switch vt := in.(type) { case []interface{}: var xs []string for _, a := range in.([]interface{}) { xs = append(xs, expansion.Expand(a.(string), rv.mappingFunc)) } return xs, nil case map[string]interface{}: inMap := in.(map...
[ -0.7121585607528687, 0.13109993934631348, 0.5630376935005188, -0.7224516272544861, -1.1065928936004639, -0.6288901567459106, 0.2120201140642166, 0.2168075144290924, 0.7025313973426819, 0.37601763010025024, 0.6587390899658203, 0.4936220943927765, -0.3850760757923126, 0.7512958645820618, 0...
func (rv *RefVarTransformer) UnusedVars() []string { var unused []string for k := range rv.varMap { _, ok := rv.replacementCounts[k] if !ok { unused = append(unused, k) } } return unused }
[ -0.6235068440437317, -0.37861740589141846, 0.22546470165252686, -1.1395779848098755, -0.2669229805469513, 0.0902629941701889, 0.18492218852043152, -0.4646802246570587, 0.1893976777791977, -0.31228625774383545, 0.09645452350378036, 0.31504103541374207, -1.009896993637085, 1.3803850412368774...
func (rv *RefVarTransformer) Transform(m resmap.ResMap) error { rv.replacementCounts = make(map[string]int) rv.mappingFunc = expansion.MappingFuncFor( rv.replacementCounts, rv.varMap) for id, res := range m { for _, fieldSpec := range rv.fieldSpecs { if id.Gvk().IsSelected(&fieldSpec.Gvk) { if err := muta...
[ -0.7574862241744995, -0.12026184052228928, 0.33660560846328735, -0.22715404629707336, 0.48843345046043396, -0.8637201189994812, 0.8472837805747986, 0.01710231602191925, 0.1287551075220108, 0.23371340334415436, -0.5520845651626587, -0.6341537833213806, -0.3910936713218689, 0.509335398674011...
func (c *UsageController) Load(r *http.Request) error { var changelog []models.Usage data, err := storage.GetFile("usage", r) if err != nil { return err } err = json.Unmarshal(data, &changelog) if err != nil { return err } c.setList(changelog) return nil }
[ -0.4218343198299408, -0.08833654969930649, 0.7050853967666626, -0.6974542737007141, 0.21819180250167847, -0.10475526005029678, -0.2375537008047104, -0.08384404331445694, -0.706636369228363, 1.428902268409729, -0.6842401623725891, -0.6278433203697205, -0.1521841436624527, 0.0844686999917030...
func (c *UsageController) setList(list []models.Usage) { c.Usage = list c.parseNewID() }
[ -0.6310455203056335, -0.29318737983703613, 0.05952157825231552, 0.8083412051200867, 1.187433123588562, -0.3285910487174988, -0.6155967712402344, 1.0143706798553467, 0.5507320761680603, 0.6914215683937073, -1.0062931776046753, -0.9847362041473389, 0.41433170437812805, 1.6484416723251343, ...
func (c *UsageController) getNewID() int64 { c.NewID = c.NewID + 1 return c.NewID }
[ 0.22291405498981476, 0.0019767070189118385, 0.4965605139732361, 0.1444253921508789, 0.33639389276504517, 0.34241122007369995, 0.7717283368110657, -0.0006368201575241983, 0.19999448955059052, -0.8940932154655457, 0.15981633961200714, 0.5499709248542786, -0.055174291133880615, 0.984283030033...
func (c *UsageController) parseNewID() { var newID int64 = 0 for _, r := range c.Usage { if r.ID > newID { newID = r.ID } } c.NewID = newID }
[ -0.160935178399086, -0.614061176776886, 0.36765256524086, -0.09379945695400238, 0.5060955286026001, -0.733223021030426, 0.014340532012283802, -0.41649019718170166, -0.09224289655685425, 0.1254178285598755, 0.3542926609516144, 0.3179539740085602, 0.21931613981723785, 1.300533413887024, 0....
func (c *UsageController) Add(recipeID int64, userID int64) error { c.Usage = append(c.Usage, models.Usage{ ID: c.getNewID(), RecipeID: recipeID, Date: time.Now(), UserID: userID, }) return nil }
[ -0.5625061988830566, -0.025070760399103165, 0.4026534855365753, 0.25802674889564514, 0.5212525129318237, 0.25852319598197937, -0.28025883436203003, 0.784866452217102, 0.16461728513240814, -0.23456257581710815, 0.5788531303405762, -0.1658555567264557, -0.1212761178612709, 0.9856899976730347...
func (c *UsageController) Store(r *http.Request) error { if len(c.Usage) == 0 { return errNoChangesToSave } data, err := json.MarshalIndent(c.Usage, "", " ") if err != nil { return err } err = storage.PutFile("usage", data, r) if err != nil { return err } return nil }
[ -0.4332457184791565, 0.18093279004096985, 0.7063618302345276, -0.25036945939064026, 0.39146608114242554, 0.14841783046722412, 0.8069323897361755, -0.23778098821640015, 0.20768408477306366, 0.21411900222301483, -0.17202433943748474, 0.13495731353759766, -0.40372979640960693, 0.5124163627624...
func NoCache(c *gin.Context) { c.Header("Cacha-Control", "no-cache,no-store,max-age=0,must-revalidate,value") c.Header("Expires", "Thu, 01 Jan 1970 00:00:00 GMT") c.Header("Last-Modified", time.Now().UTC().Format(http.TimeFormat)) c.Next() }
[ -0.29384341835975647, 0.3518226444721222, 0.46850302815437317, -0.0397690087556839, -0.05969854071736336, 0.20333456993103027, 0.1334739625453949, -0.2208678126335144, -0.10356918722391129, -0.15395589172840118, 0.09984467178583145, 0.12223488092422485, 0.2380790114402771, 0.39794269204139...
func Option(c *gin.Context) { if c.Request.Method != "OPTIONS" { c.Next() } else { c.Header("Access-Control-Allow-Origin", "*") c.Header("Access-Control-Allow-Methods", "GET,POST,PUT,OPTIONS,PATCH,DELETE") c.Header("Access-Control-Allow-Headers", "authorization,origin,content-type,accept") c.Header("Allow",...
[ 0.33683907985687256, 0.22401121258735657, 0.9442086219787598, 0.39822670817375183, 0.16530275344848633, 0.2747451364994049, 0.7772414684295654, -0.6366746425628662, 0.30689626932144165, 0.750931978225708, 0.9665376543998718, -0.005601563956588507, 0.7094746828079224, -0.08191314339637756, ...
func Secure(c *gin.Context) { c.Header("Access-Control-Allow-Origin", "*") c.Header("X-Frame-Options", "DENY") c.Header("X-Content-Type-Options", "nosniff") c.Header("X-XSS-Protection", "1;mode=block") if c.Request.TLS != nil { c.Header("Strict-Transport-Security", "max-age=31536000") } }
[ -0.09013309329748154, 0.5341423749923706, 0.7160817980766296, 0.6636945009231567, 0.6108357310295105, -0.13055887818336487, -0.4288483262062073, -0.9714416861534119, -0.36212360858917236, -0.27395549416542053, -0.43727052211761475, 0.13008040189743042, 0.46951594948768616, 0.08118752390146...
func HealthCheck(w http.ResponseWriter, r *http.Request) {}
[ -0.24167023599147797, -0.8816354870796204, 0.5497971177101135, 1.19357430934906, 0.30831727385520935, 0.9064407348632812, 1.2271844148635864, 0.011335344985127449, 0.05512131378054619, -0.47841864824295044, 0.79221111536026, 0.10067258030176163, 0.09788282215595245, -0.25176292657852173, ...
func (c *Client) GetMyDashboard() (interface{}, error) { query := request{ Client: c, Method: "getMyDashboard", ID: 1, } response, err := query.decodeInterface() return response, err }
[ -0.8605543375015259, 1.597313404083252, 0.6652199625968933, 0.48133349418640137, -0.5271076560020447, -0.8956199288368225, 0.49200084805488586, -0.19498372077941895, -0.47733280062675476, -1.6609910726547241, -0.7093493342399597, 0.537177324295044, -1.387338638305664, 0.10255829244852066, ...
func (d DynamoDBSchema) CreateTableCommand(opt ...SchemaOption) []string { var o SchemaOption if len(opt) > 0 { o = opt[0] } if o.ReadCapacityUnits == 0 { o.ReadCapacityUnits = 5 } if o.WriteCapacityUnits == 0 { o.WriteCapacityUnits = 5 } result := []string{ "aws", "dynamodb", "create-table", "--t...
[ -0.07988213747739792, -0.37685030698776245, 0.9640408754348755, -0.40727487206459045, 1.023239254951477, 0.7494344115257263, 0.42563727498054504, -0.23082676529884338, -0.4666358530521393, 0.21278445422649384, 0.010901181027293205, 0.008853238075971603, -0.2182593047618866, 0.3022352159023...
func NewDynamoDBSchema(collectionEntity interface{}, urlString string) (*DynamoDBSchema, error) { sv := reflect.ValueOf(collectionEntity).Elem() if sv.Type().Kind() != reflect.Struct { typeStr := reflect.ValueOf(collectionEntity).Type().String() return nil, fmt.Errorf("collectionEntity should be struct interface ...
[ -0.7443358302116394, 0.08756595104932785, 0.6677100658416748, 0.6411356329917908, -0.04503079876303673, -0.29708847403526306, 0.027759602293372154, 0.1948959231376648, -0.13111914694309235, 0.2550044059753418, -0.2705751955509186, -0.16595137119293213, -0.042175572365522385, 0.404882848262...
func getLogger() Logger { if logger == nil { getConfig().GetString(ConfigLogLevel) level, err := logrus.ParseLevel(getConfig().GetString(ConfigLogLevel)) if err != nil { level = logrus.InfoLevel } logger = &logrus.Logger{ Out: os.Stderr, Formatter: new(logrus.TextFormatter), Hooks: make...
[ -0.20389504730701447, -0.41075482964515686, 0.5432001948356628, -0.18864469230175018, -0.26325568556785583, -0.19721980392932892, -0.45813173055648804, 0.2526475489139557, -0.14507998526096344, -0.41384896636009216, 0.7513705492019653, 0.39583349227905273, -0.630020260810852, 1.21211659908...
func IntersectPlane( plane_p, plane_n Vec3D, lineStart , lineEnd Vec3D ) Vec3D { plane_n = plane_n.Normalize() plane_d := -plane_n.Dot( plane_p) ad := lineStart.Dot(plane_n) bd := lineEnd.Dot(plane_n) t := (-plane_d - ad) / (bd - ad) lineStartToEnd := lineEnd.Sub(lineStart) lineToIntersect ...
[ 1.1344736814498901, -0.5597960948944092, 0.7731975317001343, -0.3625459372997284, 0.2421475499868393, 1.3511648178100586, -0.11730031669139862, 0.7172842621803284, -1.3604105710983276, 0.20519472658634186, 0.4211370348930359, -0.2264297604560852, -0.632789134979248, 0.3133212924003601, 0...
func (d *Database) MutateItem( id int64, fn func(*structs.Item) structs.EntityUpdate) (*structs.Item, error) { d.lock.Lock() defer d.lock.Unlock() if err := d.checkClosed(); err != nil { log.Error(err) return nil, err } tx, err := d.db.Begin() if err != nil { log.Error(err) return nil, err } defer t...
[ -0.8260807991027832, -0.3178125023841858, 0.8002808690071106, 0.6703358292579651, 0.29790863394737244, -0.05401535704731941, -0.2252969890832901, -0.090228371322155, 0.3306429982185364, 0.3141556978225708, 0.16676165163516998, 0.09292395412921906, -0.21884934604167938, -0.05420499294996261...
func (d *Database) InsertItems(items []*structs.Item) error { if len(items) == 0 { log.Trace("InsertItems() called with empty list") return nil } d.lock.Lock() defer d.lock.Unlock() if err := d.checkClosed(); err != nil { log.Error(err) return err } insertColumns := structs.ItemInsertColumns insertPl...
[ -1.3330012559890747, 0.7118791341781616, 0.553276777267456, -0.28562313318252563, 1.1030328273773193, -0.48626744747161865, 0.1553947776556015, -0.05647541955113411, 0.024847915396094322, -0.02691156417131424, -0.21315939724445343, -0.5795544981956482, -0.664715588092804, 0.527038216590881...
func (d *Database) GetItems( req GetItemsRequest) (*GetItemsResponse, error) { var err error resp := GetItemsResponse{ Items: []*structs.Item{}} if !req.Unread && req.ReadAfter == nil && req.ReadBefore == nil { log.Info("GetItems() called with empty request") return &resp, nil } if len(req.FeedIDs) != 0 &...
[ -0.5729071497917175, 0.43782177567481995, 0.9062021970748901, 0.16121414303779602, 0.2567140460014343, -0.5086491703987122, 0.013504033908247948, -0.28405553102493286, 0.18988530337810516, -0.27538231015205383, 0.9813138842582703, 0.08076854795217514, -0.7127479910850525, 0.282415330410003...
func (d *Database) MarkItemsReadByFeed(feedID int64, maxID int64) ( []*structs.Item, error) { d.lock.Lock() defer d.lock.Unlock() if err := d.checkClosed(); err != nil { log.Error(err) return nil, err } tx, err := d.db.Begin() if err != nil { log.Error(err) return nil, err } defer tx.Rollback() // ...
[ -0.938782274723053, -0.7158873677253723, 0.7898337841033936, -0.17675893008708954, 0.17671093344688416, -0.8706110715866089, -0.183712899684906, -0.3735710084438324, -0.1761976033449173, 0.44862523674964905, 0.04290664941072464, -0.08913683891296387, -0.2990511655807495, 0.2428901940584182...
func NewMeta(status int, ctype string) *Meta { m := base.NewMeta(status, ctype) return &Meta{Meta: *m} }
[ 0.4238642752170563, -0.6626152396202087, 0.36591410636901855, 1.5211095809936523, -0.9386617541313171, -0.013795721344649792, -0.9397456049919128, 0.3607267141342163, -0.3891119062900543, -0.1883346289396286, 0.40694543719291687, 0.16204321384429932, 0.056704796850681305, 0.011397432535886...
func (p *Meta) Raise(status int, abort bool, message string) (string, error) { p.SetStatus(status) p.errorMessage = message // TODO: pass it via error only if abort { return "", errors.New(message) } return "", nil }
[ -0.26454368233680725, 0.2735503017902374, 0.6940925717353821, 0.16837432980537415, -0.315084308385849, -0.1909497082233429, -1.2502317428588867, -0.1887098252773285, -0.4132501482963562, 1.069818377494812, 1.2343298196792603, 0.6981974840164185, -0.25386711955070496, 0.24266083538532257, ...
func (p *Meta) RedirectFound(uri string) (string, error) { p.SetStatus(http.StatusFound) p.location = uri return "", ErrRedirect // TODO: Is there a way to pass status & title via error? }
[ -0.5626771450042725, -0.6216065287590027, 0.4181235730648041, -0.03371068835258484, 0.29031622409820557, 0.9562281966209412, 0.7162133455276489, -0.5424485802650452, 0.43316611647605896, -0.19214928150177002, 0.2908766567707062, 0.2728443443775177, 0.8507647514343262, 0.15903116762638092, ...
func (p Meta) Location() string { return p.location }
[ -0.5757671594619751, -1.0539071559906006, 0.27350151538848877, 0.12639470398426056, 0.16146624088287354, 1.1076877117156982, 0.8671115636825562, 0.2820113003253937, 0.20529592037200928, 0.3987776041030884, 0.6619076728820801, 0.1437610685825348, 0.36696484684944153, -0.8300438523292542, ...
func (p *Meta) AddJS(file string) (string, error) { p.JS = append(p.JS, file) return "", nil }
[ -0.26217320561408997, 0.3674969971179962, 0.42831772565841675, -0.148617222905159, -0.8054768443107605, 0.39682525396347046, -0.3683028519153595, -0.08539329469203949, 0.18515504896640778, -0.002934106858447194, 0.8553280234336853, 0.22174057364463806, -0.06621072441339493, 1.0541411638259...
func (p *Meta) AddCSS(file string) (string, error) { p.JS = append(p.CSS, file) return "", nil }
[ 0.3097037971019745, -0.21912625432014465, 0.5257912874221802, 0.1015656590461731, -0.6137288808822632, 0.7303237318992615, -0.8451478481292725, -0.6514853835105896, -0.08332522213459015, 0.15683040022850037, 0.7365652918815613, -0.1494855135679245, 0.10630524903535843, 0.5465812087059021, ...
func SetProtoFuncs(funcs template.FuncMap) { funcs["request"] = func() interface{} { return nil } funcs["param"] = func(key string) string { return "" } }
[ -1.2838281393051147, -0.15106400847434998, 0.45985957980155945, 0.31930461525917053, 0.41120797395706177, -1.050728440284729, 0.3113628625869751, 0.021240567788481712, 0.17853674292564392, -0.908146858215332, -1.0824636220932007, -0.09473734349012375, -0.2628036439418793, 0.055498301982879...
func TestSeekPathrunDialogCase6(t *testing.T) { cfg := &config.Config{ ProjectFile: confgFile, } cfg.Init() expectedName := "added project name" expectedPath := "/added/path/to/project" expectedContainer := "" var name, path, container string tfs := &testFileSystem{ getUserDirectory: func() (string, err...
[ 0.1057516559958458, 0.16025133430957794, 0.7242524027824402, 0.4335598051548004, 0.4008372128009796, 0.5661875605583191, 1.3822827339172363, -0.8628804087638855, -0.0680418461561203, -0.23035532236099243, 0.012145383283495903, -0.021633444353938103, -0.08148440718650818, 0.4707458615303039...
func CurrentStatus() Status { return runnerStatus.snapshot() }
[ -0.394765168428421, -0.6570349335670471, 0.09705322235822678, -0.15748709440231323, -1.3699618577957153, 0.29539942741394043, -0.18797419965267181, 0.7316486239433289, 0.09659356623888016, -0.47166770696640015, -0.1931634545326233, 0.552031397819519, 0.6311049461364746, 0.570766031742096, ...
func (p *Post) Body() (buf []byte, err error) { if buf, err = ioutil.ReadFile(p.Path); err != nil { return } buf = buf[p.BodyIdx:] return }
[ 0.023975146934390068, -0.3753351867198944, 0.4357299208641052, 0.49512979388237, 0.5532966256141663, 0.7465381026268005, -0.6350631713867188, -1.099242925643921, 0.048429980874061584, 0.09612090140581131, -0.6554989814758301, 0.09619254618883133, -0.5686239004135132, -0.19137011468410492, ...
func (p *Post) RenderBody() (buf []byte, err error) { if buf, err = p.Body(); err != nil { return } buf = blackfriday.MarkdownCommon(buf) return }
[ -0.013923865742981434, 0.5009430050849915, 0.3932586908340454, 0.5514341592788696, 0.3018733561038971, 0.12403086572885513, -1.2673178911209106, -0.437050461769104, 0.42648208141326904, -0.0838981345295906, -0.1375136822462082, -0.6687431335449219, -1.3592034578323364, 1.0257307291030884, ...
func (p *Post) Slug() string { return Slugified(p.Title) }
[ 0.317922443151474, -0.5591113567352295, 0.16219766438007355, -0.18870900571346283, -0.19391092658042908, 0.9338183999061584, -1.2596004009246826, 0.8743429780006409, -0.044650882482528687, -1.1776670217514038, -0.018006665632128716, 0.07630206644535065, -0.3449585437774658, -0.630698859691...
func NewPost(path string) *Post { var err error var finfo os.FileInfo var file *os.File if finfo, err = os.Stat(path); err != nil { return nil } p := &Post{ Path: path, Headers: make(map[string]string), Cdt: finfo.ModTime(), } if file, err = os.Open(pat...
[ 0.44740206003189087, -1.1000841856002808, 0.5843856930732727, 0.48207277059555054, -0.9172954559326172, 0.07304594665765762, -0.4571433961391449, -0.34876009821891785, -0.45158758759498596, -0.5915507078170776, 0.5291955471038818, -0.5690115094184875, 0.05267946422100067, -0.21498440206050...
func Solution(A []int) int { // write your code in Go 1.4 result := 0 sort.Ints(A) for i := range A { if i == 0 { result++ } else { if A[i] != A[i-1] { result++ } } } return result }
[ -0.047343987971544266, 0.19557613134384155, 0.6404712796211243, 0.4469953179359436, -0.5405949950218201, -0.4513571560382843, 1.587812066078186, 0.248395174741745, 0.3869423568248749, 0.07643524557352066, -0.6307258009910583, 0.6098867654800415, -0.6820665597915649, 0.758156955242157, -0...
func (server *Server) ClientHandler(store Store, tokens TokenGenerator) http.Handler { return http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) { ctx := r.Context() server.logger.Printf("Got SQRL request: %v\n", r) response := genNextResponse(server, r) defer writeResponse(w, response) if r.Hea...
[ 0.23493492603302002, -0.39747676253318787, 0.5572934746742249, -0.4211956262588501, -0.1207645833492279, -0.4906025826931, 0.4375348389148712, -0.42772695422172546, 0.33654674887657166, -0.018123973160982132, -1.0276274681091309, -0.7238835692405701, -0.36460891366004944, -0.19700503349304...
func DispatcherStatusString(s string) (DispatcherStatus, error) { if val, ok := _DispatcherStatusNameToValueMap[s]; ok { return val, nil } return 0, fmt.Errorf("%s does not belong to DispatcherStatus values", s) }
[ -0.9241840839385986, -0.18890532851219177, 0.03955473378300667, 0.1466463804244995, -1.3842555284500122, -0.10577661544084549, -0.42365577816963196, -0.186024010181427, 0.010582318529486656, -0.02318839356303215, 0.02698029950261116, -0.8322737812995911, 0.5301558375358582, 0.2673246860504...
func DispatcherStatusValues() []DispatcherStatus { return _DispatcherStatusValues }
[ -0.7568793892860413, 0.04807621240615845, -0.010176603682339191, 0.41729724407196045, -1.005737066268921, 0.7268142104148865, -0.7975021004676819, 0.6032723784446716, -0.49877750873565674, -0.8295571804046631, -1.53425931930542, -0.5092833638191223, 1.360453486442566, 1.4453392028808594, ...
func (i DispatcherStatus) IsADispatcherStatus() bool { for _, v := range _DispatcherStatusValues { if i == v { return true } } return false }
[ -0.8025098443031311, -0.3921438753604889, 0.12057140469551086, 0.3017922043800354, -0.4528946578502655, -0.10751627385616302, -0.25783029198646545, 0.5970817804336548, 0.4100896120071411, -0.09571295231580734, -0.5921645760536194, -0.3612357974052429, 0.5784506797790527, 0.9639841914176941...
func (p *parser) parsePackage(fileNames []string) error { if len(fileNames) == 0 { return fmt.Errorf("fileNames is empty") } for i, name := range fileNames { if i > 0 && filepath.Dir(name) != filepath.Dir(fileNames[0]) { return fmt.Errorf("Go files belong to different directories") } if !strings.HasSuffix...
[ -0.36006489396095276, 0.3959962725639343, 0.8009504675865173, 0.5661206245422363, 1.1763311624526978, 0.38539639115333557, 0.3827700912952423, 0.17863474786281586, -0.6638979315757751, 0.3360525667667389, 0.41561320424079895, -0.4875194728374481, -0.698320746421814, 0.8373947739601135, -...
func (p *parser) recordImport(f *ast.File, typ ast.Expr) error { if star, ok := typ.(*ast.StarExpr); ok { typ = star.X } sel, ok := typ.(*ast.SelectorExpr) if !ok { return nil } pkgID, ok := sel.X.(*ast.Ident) if !ok { return nil } if _, ok := p.extraImports[pkgID.Name]; ok { return nil } path := ...
[ -0.2542877197265625, 0.2440423220396042, 0.6568180322647095, -0.3977060616016388, -0.23331142961978912, -0.13775059580802917, -0.3451237380504608, 0.36657318472862244, -0.3622397780418396, 0.03781265392899513, -0.8856241703033447, 0.49837663769721985, -0.3448312282562256, 0.591343820095062...
func (p *parser) exprString(expr ast.Expr) (string, error) { p.exprStrBuf.Reset() err := printer.Fprint(&p.exprStrBuf, p.fileSet, expr) return p.exprStrBuf.String(), err }
[ -0.2835633456707001, -0.6718842387199402, 0.24801814556121826, -0.9208370447158813, -0.9028394818305969, -0.16698378324508667, -0.025282520800828934, -0.716275155544281, -0.20592336356639862, 0.4524467885494232, 0.974085807800293, 0.3660886585712433, -0.1385595053434372, 0.4462016522884369...
func RestoreSources(dst string) error { // Look into the executable's folder. if execFolderPath, err := osext.ExecutableFolder(); err == nil { if src, _ := findSources(execFolderPath); src != "" { return copySources(src, dst) } } // Look into cwd. if workingDirectory, err := os.Getwd(); err == nil { if s...
[ 0.02384130284190178, 0.3197597861289978, 0.4545796811580658, -0.8494973182678223, 0.38648274540901184, -0.48366954922676086, 0.6255244016647339, -0.03847076743841171, -0.05772318318486214, -0.11036521196365356, 0.27823618054389954, -0.6276671886444092, -0.7806482911109924, 0.57677787542343...
func findSources(root string) (string, error) { // Check if all the sources are here. Return that root if it's the case. found := true for _, src := range sources { fi, err := os.Stat(filepath.Join(root, src)) if err != nil || (os.IsPathSeparator(src[len(src)-1]) && !fi.IsDir()) { // The source does not exist...
[ 0.49530598521232605, 0.20728014409542084, 0.8469077348709106, 0.03450006991624832, 0.18456606566905975, -0.7592592239379883, 0.5826123356819153, -0.944199800491333, 0.3875543177127838, -0.28457748889923096, 0.40669870376586914, -0.617759108543396, -0.8873127102851868, 1.6023246049880981, ...
func copySources(root, dst string) error { for _, src := range sources { // We copy the source directory itself to the destination, rather than its // content. src = strings.TrimSuffix(src, string(filepath.Separator)) if err := copyDir(filepath.Join(root, src), dst); err != nil { return err } } return ...
[ -0.03480762615799904, 0.3275184631347656, 0.3164287805557251, -0.258454829454422, 0.043261535465717316, -0.4045950174331665, -0.2509908080101013, -0.30297693610191345, -0.018403859809041023, 0.0018380690598860383, -0.19542858004570007, -0.17635975778102875, -0.12267056852579117, 0.37907117...
func copyDir(src, dst string) error { if fi, err := os.Stat(src); err == nil && fi.Mode().IsRegular() { // src is actually a file, not a directory, copy it and return. return copyFile(src, fi.Mode(), dst) } if fi, err := os.Stat(dst); err == nil { if fi.Mode().IsDir() && !os.IsPathSeparator(src[len(src)-1]) {...
[ -0.23133650422096252, 0.22760942578315735, 0.6977728605270386, 0.6641651391983032, -0.7873139977455139, 0.34283971786499023, 1.3315883874893188, -0.35947614908218384, -0.2818598747253418, -0.19561932981014252, 0.4897419214248657, -0.09647901356220245, 0.7291884422302246, 0.3847628235816955...
func copyFile(src string, srcMode os.FileMode, dst string) error { if fi, err := os.Stat(dst); err == nil && fi.IsDir() { // The destination is an existing folder, write the file into it. _, srcFileName := filepath.Split(src) dst = filepath.Join(dst, srcFileName) } // Open the source file. srcFile, err := os...
[ -0.4140319228172302, 0.44410884380340576, 0.5537153482437134, -0.37162235379219055, 0.1278272271156311, 0.23588383197784424, 0.9155729413032532, 0.3279072046279907, -1.2058707475662231, 0.6087016463279724, -0.24146407842636108, -0.3361060321331024, 0.6627469062805176, -0.2674020230770111, ...
func (as *Authors) Add(a *Author) { as.data = append(as.data, a) }
[ -1.0405991077423096, -0.41142410039901733, 0.13864648342132568, -0.7185906767845154, 0.17194662988185883, 0.5518465042114258, -0.9553872346878052, 1.079429030418396, 0.9008269309997559, -0.5787857174873352, 0.5622755289077759, 1.8212648630142212, 0.3104778826236725, 0.8576020002365112, 0...
func (as *Authors) AddFrom(r io.Reader) error { parsed, err := as.parse(r) if err != nil { return err } for _, a := range parsed { as.data = append(as.data, a) } return nil }
[ -0.06432938575744629, -0.5984210968017578, 0.3505886495113373, -0.44026491045951843, -0.08879265934228897, 0.4179683029651642, -0.949438750743866, 0.6526793837547302, -0.08488360792398453, -0.2701922059059143, 1.1089682579040527, 0.493082195520401, 0.1584111452102661, 0.6326071619987488, ...
func (as Authors) parse(r io.Reader) ([]*Author, error) { var parsed []*Author lineScanner := bufio.NewScanner(r) for lineScanner.Scan() { line := strings.TrimSpace(lineScanner.Text()) if line == "" { continue } if strings.HasPrefix(line, "#") { continue } inlineComment := strings.Index(line, "#...
[ -0.4054337739944458, -0.9696037769317627, 0.5149322152137756, -0.2358022779226303, -0.8049265146255493, -0.3327579200267792, 0.3279370963573456, 0.2815597951412201, -0.2631940245628357, 0.4592702388763428, 0.48954230546951294, 0.5959797501564026, -0.6458157896995544, -0.07632910460233688, ...
func (self *HostImportLibvirtServersTask) CreateImportedLibvirtGuestOnHost( ctx context.Context, host *models.SHost, guest *models.SGuest, guestDesc *compute.SImportGuestDesc, ) error { task, err := taskman.TaskManager.NewTask( ctx, "CreateImportedLibvirtGuestTask", guest, self.UserCred, nil, "", "", nil) if err !...
[ 0.4050377309322357, 0.13217580318450928, 0.9437033534049988, 0.5634322762489319, -0.09205016493797302, 0.6523314118385315, 0.08868323266506195, 0.14714111387729645, -0.3571012616157532, 0.6169823408126831, -0.7720397710800171, 0.290058434009552, 0.14461813867092133, -0.3482091426849365, ...
func DefaultMW(next http.Handler) http.Handler { return http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) { ctx := DefaultContext(r.Context()) next.ServeHTTP(w, r.WithContext(ctx)) }) }
[ -0.006143935490399599, 0.03856808692216873, 0.7974671721458435, 0.33228227496147156, -0.4854556620121002, -0.11982031911611557, -0.4851965010166168, -0.12291828542947769, 0.36391860246658325, -0.5876441597938538, -0.03640294075012207, -0.7402241230010986, -0.025160515680909157, 1.366160273...
func DefaultContext(ctx context.Context) context.Context { ctx = context.WithValue(ctx, vars.SharedData, store.NewDataStore()) ctx = validate.SetContext(ctx) return ctx }
[ 0.8829948306083679, 0.3570334315299988, 0.42839571833610535, 0.5065823197364807, -0.014770753681659698, 1.280469298362732, -0.023975783959031105, 0.17091529071331024, 1.511842966079712, -0.910785973072052, 0.2104135900735855, -0.2875555753707886, -0.08737858384847641, -0.09090927243232727,...
func BodyLimitMW(size int64) func(http.Handler) http.Handler { bodyLimit := size return func(next http.Handler) http.Handler { return http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) { r.Body = http.MaxBytesReader(w, r.Body, bodyLimit) next.ServeHTTP(w, r) }) } }
[ 0.0521349273622036, -0.09079274535179138, 0.8858023285865784, -0.3433416187763214, -1.9214670658111572, 0.4743330478668213, -0.7206252813339233, 0.07214207202196121, 0.9127800464630127, -0.3608030080795288, -0.6251932382583618, -0.14899207651615143, 0.10830706357955933, 0.44028931856155396...
func DeliverFile( ctx context.Context, file static.File, w http.ResponseWriter, r *http.Request, ) error { span, ctx := opentracing.StartSpanFromContext(ctx, "deliverFile") defer span.Finish() etag, err := file.ETag() if err != nil { w.WriteHeader(http.StatusBadRequest) return err } if r.Header.Get("If-...
[ -0.27260828018188477, -0.10392829775810242, 0.7954224944114685, -0.22268757224082947, 0.08241885155439377, 0.6446760892868042, 0.6167013645172119, 0.16082757711410522, -0.6281824111938477, 0.4637727737426758, 0.7064056396484375, -0.9266960620880127, 0.3462129533290863, 0.4516863226890564, ...
func Reverse(s string) string { r := []rune(s) for i, j := 0, len(r)-1; i < len(r)/2; i, j = i+1, j-1 { r[i], r[j] = r[j], r[i] } return string(r) }
[ -0.5891856551170349, 0.18905360996723175, 0.5280811190605164, -0.7652336955070496, -0.5301413536071777, -0.5031483769416809, 0.1287447065114975, 0.3161930739879608, -0.8481500744819641, 0.1945982277393341, -0.38717472553253174, 0.8124303221702576, -0.7813066840171814, -1.6775474548339844, ...
func NewDriver(options *DriverOptions) *Driver { d := Driver{ volLockMap: util.NewLockMap(), subnetLockMap: util.NewLockMap(), volumeLocks: newVolumeLocks(), cloudConfigSecretName: options.CloudConfigSecretName, cloudConfigSecretNamespace: options.CloudConfigS...
[ 0.13003559410572052, -0.3411865234375, 0.6121259331703186, 0.8693372011184692, 0.3799908459186554, -0.3707593083381653, 0.2840224802494049, -0.15891705453395844, 0.622451901435852, 0.03684132918715477, 0.792109489440918, 0.027069319039583206, -0.9134460687637329, 0.31567472219467163, 1.7...
func GetContainerInfo(id string) (string, string, string, error) { segments := strings.Split(id, separator) if len(segments) < 3 { return "", "", "", fmt.Errorf("error parsing volume id: %q, should at least contain two #", id) } return segments[0], segments[1], segments[2], nil }
[ -0.45489975810050964, -1.0333853960037231, 0.8595802187919617, -0.42192262411117554, 0.49068984389305115, -0.4461052417755127, -0.057310860604047775, -0.7659735083580017, -0.8630285263061523, 0.03893089294433594, -0.7010571360588074, -0.6797270178794861, -0.03723004460334778, 0.00750896986...
func getValidContainerName(volumeName, protocol string) string { containerName := strings.ToLower(volumeName) if len(containerName) > containerNameMaxLength { containerName = containerName[0:containerNameMaxLength] } if !checkContainerNameBeginAndEnd(containerName) || len(containerName) < containerNameMinLength {...
[ -0.49407315254211426, -0.45062875747680664, 0.9384684562683105, 0.16898998618125916, -0.10500199347734451, -0.02125331200659275, -0.64560866355896, -0.10538783669471741, 0.3331330120563507, 0.056275445967912674, 0.8753662109375, 0.3460158705711365, -0.5634927749633789, -0.09709715098142624...
func isSASToken(key string) bool { return strings.Contains(key, "?sv=") }
[ -0.5960313081741333, 0.16773566603660583, 0.31038928031921387, 0.8198903203010559, -0.9629291892051697, -0.6185975074768066, -1.347415804862976, 0.1663980782032013, 1.1993317604064941, 0.6543922424316406, -0.6889384388923645, 0.16363251209259033, 0.08329600095748901, 0.6698399782180786, ...
func (d *Driver) GetStorageAccountAndContainer(ctx context.Context, volumeID string, attrib, secrets map[string]string) (string, string, string, string, error) { var ( accountName string accountKey string accountSasToken string containerName string keyVaultURL str...
[ -0.12547816336154938, -1.1657172441482544, 0.8055063486099243, 0.7348678708076477, 0.36678260564804077, -0.33313366770744324, 0.43567955493927, -0.728604793548584, -0.43488436937332153, -0.3194495439529419, 0.7871617078781128, 0.21826179325580597, 0.808069109916687, 0.7121011018753052, 1...
func getStorageAccount(secrets map[string]string) (string, string, error) { if secrets == nil { return "", "", fmt.Errorf("unexpected: getStorageAccount secrets is nil") } var accountName, accountKey string for k, v := range secrets { switch strings.ToLower(k) { case accountNameField: accountName = v ca...
[ 0.05307121202349663, -1.0346187353134155, 0.7407050728797913, 0.7174984812736511, 0.1303660273551941, -0.5744214057922363, 1.2943843603134155, -0.1577448695898056, -0.4848151206970215, 0.21491290628910065, -0.09894649684429169, 0.4117877185344696, 0.20180661976337433, 0.5063217282295227, ...
func (d *Driver) GetStorageAccesskey(ctx context.Context, accountOptions *azure.AccountOptions, secrets map[string]string, secretName, secretNamespace string) (string, string, error) { if len(secrets) > 0 { return getStorageAccount(secrets) } // read from k8s secret first if secretName == "" { secretName = fmt...
[ -0.3456292450428009, -0.7725130915641785, 0.7875872254371643, 0.8342841267585754, 0.46606573462486267, -0.7624171376228333, 1.0490033626556396, -0.6161066889762878, -0.07314639538526535, 0.26886504888534546, 0.7420588135719299, 0.8352035880088806, 0.5635327100753784, 0.5487390160560608, ...
func (d *Driver) GetStorageAccountFromSecret(secretName, secretNamespace string) (string, string, error) { if d.cloud.KubeClient == nil { return "", "", fmt.Errorf("could not get account key from secret(%s): KubeClient is nil", secretName) } secret, err := d.cloud.KubeClient.CoreV1().Secrets(secretNamespace).Get(...
[ -0.08523061126470566, -1.1429977416992188, 0.6256217956542969, 0.5800318717956543, 0.3838098347187042, -0.33220186829566956, -0.07250010222196579, -0.8604219555854797, 0.05285247787833214, 0.16862007975578308, -0.3062340319156647, 0.651729166507721, -0.11998749524354935, 0.475943386554718,...
func (d *Driver) getSubnetResourceID() string { subsID := d.cloud.SubscriptionID if len(d.cloud.NetworkResourceSubscriptionID) > 0 { subsID = d.cloud.NetworkResourceSubscriptionID } rg := d.cloud.ResourceGroup if len(d.cloud.VnetResourceGroup) > 0 { rg = d.cloud.VnetResourceGroup } return fmt.Sprintf(subne...
[ 1.291871428489685, -0.22444993257522583, 0.40752577781677246, -0.12996023893356323, -0.3445456624031067, -0.5118442177772522, -0.841363251209259, -0.30478355288505554, 0.8896112442016602, -0.0952552929520607, -0.20050092041492462, -0.11691737920045853, -0.12201891839504242, 0.2628643810749...
func appendDefaultMountOptions(mountOptions []string, tmpPath, containerName string) []string { var defaultMountOptions = map[string]string{ "--pre-mount-validate": "true", "--use-https": "true", "--tmp-path": tmpPath, "--container-name": containerName, // prevent billing charges on mo...
[ 0.5023362636566162, 0.0032529018353670835, 0.7846384644508362, 0.49938279390335083, 0.4836316704750061, -0.2625444829463959, -1.0924205780029297, -0.6797153949737549, 0.8179339170455933, 0.2251283973455429, -0.05192495509982109, -0.12963643670082092, -0.10807392746210098, 1.642230749130249...
func fixDescription(s string) string { // feishu fix: clean non printable char s = stringsx.Clean(s) // feishu fix: unescape a string s = fmt.Sprintf("%#v", s) // remove prefix and suffix double quote, means we just unescape inner text s = strings.TrimPrefix(s, "\"") s = strings.TrimSuffix(s, "\"") return s }
[ 1.094433069229126, -0.922129213809967, 0.4309599697589874, -0.6421688795089722, -0.6597357392311096, -0.5467745065689087, 0.166440948843956, 0.8576091527938843, 0.10968126356601715, 0.2964361310005188, 0.1371592879295349, 1.6054309606552124, 0.3302551507949829, 0.6476298570632935, 0.0655...
func Newhandler(service *comment.Service) *Handler { return &Handler{ Service: service, } }
[ 1.017327904701233, -0.6316735744476318, -0.13888630270957947, -0.14934219419956207, -0.6789211630821228, 0.3564890921115875, -0.7215383052825928, -0.1785736083984375, 0.2623201012611389, -0.9041466116905212, 0.9280425906181335, 0.8252439498901367, -0.374017596244812, -0.3715592622756958, ...
func (h *Handler) SetupRoutes() { fmt.Println("Setting Up Routes") h.Router = mux.NewRouter() h.Router.HandleFunc("/api/comment", h.GetAllComments).Methods("GET") h.Router.HandleFunc("/api/comment", h.PostComment).Methods("POST") h.Router.HandleFunc("/api/comment/{id}", h.GetComment).Methods("GET") h.Router.Hand...
[ -0.2848636507987976, -0.292845219373703, 0.7156171798706055, -0.141201451420784, 1.164337158203125, 0.10646523535251617, 0.5127543807029724, -0.10476887971162796, -0.4855211675167084, -0.2650286555290222, 0.14628225564956665, -0.5443457365036011, -0.1478426158428192, 0.8111446499824524, ...
func (h Handler) GetComment(w http.ResponseWriter, r *http.Request) { w.Header().Set("Content-Type", "application/json; charset=UTF-8") w.WriteHeader(http.StatusOK) vars := mux.Vars(r) id := vars["id"] i, err := strconv.ParseUint(id, 10, 64) if err != nil { sendErrorResponse(w, "Unable to parse UINT from ID"...
[ -0.813866376876831, -0.6778134107589722, 0.8237252235412598, 0.00827739480882883, 0.7055690884590149, -0.6691900491714478, 0.4594118893146515, -0.5613394975662231, 0.03009502775967121, 0.44193488359451294, -0.38605135679244995, 0.4061524569988251, -0.3816048800945282, 0.5525665879249573, ...