text stringlengths 11 6.3k | embedding listlengths 768 768 |
|---|---|
func PossibleSignedResourceTypesValues() []SignedResourceTypes {
return []SignedResourceTypes{SignedResourceTypesC, SignedResourceTypesO, SignedResourceTypesS}
} | [
0.09822303056716919,
-1.0816468000411987,
-0.02898753434419632,
0.6669516563415527,
-0.02709001488983631,
0.5200883746147156,
-0.40942618250846863,
-0.7227302193641663,
0.8121199011802673,
-0.5810743570327759,
-0.8486667275428772,
-1.124821424484253,
-0.14844389259815216,
1.092093944549560... |
func PossibleSkuNameValues() []SkuName {
return []SkuName{PremiumLRS, PremiumZRS, StandardGRS, StandardGZRS, StandardLRS, StandardRAGRS, StandardRAGZRS, StandardZRS}
} | [
-0.9751894474029541,
-0.4875432252883911,
0.30184128880500793,
1.040761113166809,
-1.4622787237167358,
0.20893819630146027,
-0.812092661857605,
0.7500492334365845,
0.6126302480697632,
-0.3053938150405884,
-0.6287345886230469,
0.9063941836357117,
0.29850906133651733,
0.4329622983932495,
0... |
func PossibleSkuTierValues() []SkuTier {
return []SkuTier{Premium, Standard}
} | [
-0.994697093963623,
-0.0000960486286203377,
0.1599016636610031,
1.7670389413833618,
-1.6917147636413574,
0.7991697192192078,
-1.0492645502090454,
0.5468692779541016,
-0.47531023621559143,
-0.42605629563331604,
-0.7934302091598511,
0.1484089344739914,
0.23319187760353088,
0.7530142068862915... |
func PossibleStateValues() []State {
return []State{StateDeprovisioning, StateFailed, StateNetworkSourceDeleted, StateProvisioning, StateSucceeded}
} | [
-0.8679504990577698,
0.23365414142608643,
0.11767161637544632,
0.5350236892700195,
-0.8618715405464172,
0.5383919477462769,
-0.807181179523468,
0.6770866513252258,
0.4886089861392975,
-0.6421242356300354,
-0.7628062963485718,
-0.21695682406425476,
0.3020015060901642,
0.7518474459648132,
... |
func PossibleUsageUnitValues() []UsageUnit {
return []UsageUnit{Bytes, BytesPerSecond, Count, CountsPerSecond, Percent, Seconds}
} | [
-0.6317456364631653,
-0.406631737947464,
0.28664305806159973,
0.28161486983299255,
0.16158084571361542,
0.2095886915922165,
0.09500949084758759,
0.10383574664592743,
-0.07574708014726639,
-0.7606809735298157,
-0.42407962679862976,
0.505170464515686,
-0.22444911301136017,
0.679225742816925,... |
func getRepoPath() (string, error) {
// Set default base path and directory name
directoryName := ".saturn"
// Join the path and directory name, then expand the home path
fullPath, err := homedir.Expand(filepath.Join("~", directoryName))
if err != nil {
return "", err
}
// Return the shortest lexical represe... | [
0.4832116961479187,
0.08873698115348816,
0.6264891028404236,
0.40103161334991455,
-0.0661836713552475,
-0.5520758628845215,
0.23993252217769623,
0.6841335296630859,
0.561311662197113,
0.41244879364967346,
0.7709937691688538,
-0.39048564434051514,
-0.16138029098510742,
-0.7104653716087341,
... |
func (o *GenerateLockerReferenceForEnvironmentUsingPOSTReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) {
switch response.Code() {
case 200:
result := NewGenerateLockerReferenceForEnvironmentUsingPOSTOK()
if err := result.readResponse(response, consumer, o.form... | [
-0.05017123371362686,
-0.7663072943687439,
0.8036285638809204,
0.13947631418704987,
-0.009260071441531181,
-0.21100392937660217,
0.23106691241264343,
-0.5016608834266663,
0.22814233601093292,
0.5465497970581055,
0.4993799328804016,
-0.4497598111629486,
-1.2711691856384277,
0.16703990101814... |
func NewGenerateLockerReferenceForEnvironmentUsingPOSTOK() *GenerateLockerReferenceForEnvironmentUsingPOSTOK {
return &GenerateLockerReferenceForEnvironmentUsingPOSTOK{}
} | [
-0.16049735248088837,
-0.21309466660022736,
0.3305656909942627,
-0.19694437086582184,
-0.28853344917297363,
0.6542508006095886,
0.06495732069015503,
-0.5424864888191223,
-1.1623097658157349,
0.43082812428474426,
-0.17372384667396545,
-1.0976585149765015,
-0.19874614477157593,
1.15857768058... |
func NewGenerateLockerReferenceForEnvironmentUsingPOSTCreated() *GenerateLockerReferenceForEnvironmentUsingPOSTCreated {
return &GenerateLockerReferenceForEnvironmentUsingPOSTCreated{}
} | [
0.7086583375930786,
-0.23981346189975739,
0.323690265417099,
-0.0523696132004261,
0.528777003288269,
0.8083534836769104,
-0.24851946532726288,
-0.46454519033432007,
-0.9234504103660583,
-0.7128505706787109,
0.08717403560876846,
-0.8032411932945251,
0.36368709802627563,
1.1894901990890503,
... |
func NewGenerateLockerReferenceForEnvironmentUsingPOSTUnauthorized() *GenerateLockerReferenceForEnvironmentUsingPOSTUnauthorized {
return &GenerateLockerReferenceForEnvironmentUsingPOSTUnauthorized{}
} | [
-0.674487829208374,
0.11020269244909286,
0.5659867525100708,
0.33952465653419495,
-0.251217782497406,
0.6675623655319214,
-0.3597576916217804,
0.4032128155231476,
-0.6180781722068787,
-0.5895513296127319,
0.11608952283859253,
0.581915557384491,
-0.045936379581689835,
0.4298040568828583,
... |
func NewGenerateLockerReferenceForEnvironmentUsingPOSTForbidden() *GenerateLockerReferenceForEnvironmentUsingPOSTForbidden {
return &GenerateLockerReferenceForEnvironmentUsingPOSTForbidden{}
} | [
0.2206968367099762,
0.39623764157295227,
0.5073343515396118,
0.30262085795402527,
-0.26534396409988403,
0.8868807554244995,
0.18040180206298828,
-0.7856159806251526,
-0.6271378993988037,
-0.36250919103622437,
0.193643257021904,
-0.037301648408174515,
-0.103408083319664,
0.41647475957870483... |
func NewGenerateLockerReferenceForEnvironmentUsingPOSTNotFound() *GenerateLockerReferenceForEnvironmentUsingPOSTNotFound {
return &GenerateLockerReferenceForEnvironmentUsingPOSTNotFound{}
} | [
-0.1327158808708191,
-0.5461586117744446,
0.15802867710590363,
-0.3421204090118408,
0.8096479773521423,
1.0930858850479126,
-0.23969599604606628,
-0.26168179512023926,
-0.7394422292709351,
0.004370104521512985,
-0.10197296738624573,
0.042963653802871704,
0.19096222519874573,
0.769215881824... |
func (o *UpdateStoreReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) {
switch response.Code() {
case 200:
result := NewUpdateStoreOK()
if err := result.readResponse(response, consumer, o.formats); err != nil {
return nil, err
}
return result, nil
case 4... | [
-0.3052460551261902,
-0.669230043888092,
0.5545796751976013,
0.1012183278799057,
-0.7493226528167725,
-0.860940158367157,
-0.13458649814128876,
-0.586864709854126,
1.1152178049087524,
0.5409870743751526,
0.31231188774108887,
-0.2953571081161499,
-1.1532100439071655,
-0.05209164693951607,
... |
func NewUpdateStoreOK() *UpdateStoreOK {
return &UpdateStoreOK{}
} | [
-0.707597553730011,
-0.9469268321990967,
-0.07870656996965408,
0.7014955878257751,
-1.7221324443817139,
-0.3563995063304901,
0.02936544269323349,
0.2962944507598877,
-0.027606163173913956,
0.1182994693517685,
-0.4067639112472534,
-0.5618618130683899,
0.6378485560417175,
0.09012643992900848... |
func NewUpdateStoreNotFound() *UpdateStoreNotFound {
return &UpdateStoreNotFound{}
} | [
-0.5712966918945312,
-1.8828575611114502,
-0.33915767073631287,
-0.22544269263744354,
-1.2621625661849976,
0.3780849575996399,
-0.41310086846351624,
-0.19052907824516296,
0.20218390226364136,
-0.46770501136779785,
-0.39269891381263733,
-0.18803933262825012,
-0.03246401995420456,
0.05564706... |
func NewUpdateStoreConflict() *UpdateStoreConflict {
return &UpdateStoreConflict{}
} | [
-0.6434950232505798,
-1.1412566900253296,
-0.06063109263777733,
0.35252493619918823,
-1.3124988079071045,
-0.5279696583747864,
-0.221602201461792,
-0.39083725214004517,
0.347614586353302,
-0.7766081094741821,
0.40924400091171265,
-0.7900605797767639,
-0.5779931545257568,
-0.642878711223602... |
func NewUpdateStoreUnprocessableEntity() *UpdateStoreUnprocessableEntity {
return &UpdateStoreUnprocessableEntity{}
} | [
-0.4906351864337921,
-0.49762123823165894,
0.038611769676208496,
-0.3296312391757965,
-1.4692260026931763,
-0.3665632903575897,
-0.07811374217271805,
1.0966706275939941,
-0.23242349922657013,
-0.23561246693134308,
-0.22067832946777344,
-0.06039552763104439,
-0.240668386220932,
-0.861225426... |
func RegisterGin(r *gin.Engine) {
once.Do(func() { sdkClient(r) })
} | [
-0.9136564135551453,
1.2085120677947998,
0.5466827154159546,
0.41186147928237915,
0.8110412955284119,
-0.3493991792201996,
-0.22170494496822357,
-0.14003188908100128,
-0.8398025631904602,
-0.3745463788509369,
-0.2963505983352661,
0.3022424578666687,
-0.42957502603530884,
0.8181330561637878... |
func New() *Lark {
mutex.Lock()
defer mutex.Unlock()
if singleton != nil {
return singleton
}
singleton = &Lark{
config: larkConfig,
}
return singleton
} | [
0.6491937637329102,
-0.17729918658733368,
0.23248031735420227,
-1.2377887964248657,
-0.6573593616485596,
0.14584851264953613,
-0.2622053027153015,
1.0133421421051025,
0.20350560545921326,
-0.5242981314659119,
0.48791342973709106,
1.104549765586853,
-0.28695082664489746,
0.255592942237854,
... |
func (l *Lark) Logger(logOpt map[string]interface{}) *LarkLogger {
return &LarkLogger{l: l, opt: logOpt}
} | [
0.13843490183353424,
-0.25343748927116394,
0.3576318621635437,
-1.539676547050476,
-0.6931076049804688,
0.3802914023399353,
-1.4179306030273438,
0.29426655173301697,
1.1127216815948486,
-0.3593626022338867,
0.5360400080680847,
0.2551742494106293,
-0.2928619086742401,
0.3149614930152893,
... |
func NewCustomMockMessageSvc(typeVal, name string) *MockMessageSvc {
return &MockMessageSvc{
HandleFunc: func(*service.DIDCommMsg) (string, error) {
return "", nil
},
AcceptFunc: func(msgType string, purpose []string) bool {
return typeVal == msgType
},
NameVal: name,
}
} | [
-0.7446677684783936,
-0.4092978239059448,
0.39632031321525574,
-0.2420269399881363,
-0.5864034295082092,
-0.9144194722175598,
0.44463440775871277,
-1.0699520111083984,
0.4634360074996948,
0.11498737335205078,
0.10109082609415054,
0.6039300560951233,
-0.5718161463737488,
1.3147118091583252,... |
func (m *MockMessageSvc) Accept(msgType string, purpose []string) bool {
if m.AcceptFunc != nil {
return m.AcceptFunc(msgType, purpose)
}
return true
} | [
-0.7520545721054077,
0.6509826183319092,
0.3520863950252533,
0.11734239012002945,
-0.0877273678779602,
-0.058937110006809235,
0.4198243319988251,
-0.11786393821239471,
-0.48678427934646606,
0.5384355783462524,
0.5278175473213196,
0.21581026911735535,
-0.9143922924995422,
1.4653947353363037... |
func (m *MockMessageSvc) Name() string {
return m.NameVal
} | [
-0.4547548294067383,
-0.4299050271511078,
0.2999018728733063,
-0.009668003767728806,
-0.21543559432029724,
0.34678468108177185,
0.3922324776649475,
-1.1759458780288696,
-0.013912759721279144,
0.39204710721969604,
-0.37474679946899414,
-0.26827937364578247,
-0.9020970463752747,
1.3539263010... |
func (m *UdpListenerConfig) GetHiddenEnvoyDeprecatedConfig() *_struct.Struct {
if x, ok := m.GetConfigType().(*UdpListenerConfig_HiddenEnvoyDeprecatedConfig); ok {
return x.HiddenEnvoyDeprecatedConfig
}
return nil
} | [
0.15892401337623596,
0.5789892673492432,
0.6047680377960205,
-0.23314782977104187,
-0.11393463611602783,
0.4896228015422821,
-0.4680361747741699,
0.07797787338495255,
-0.2983130216598511,
-0.5484816431999207,
-1.087854027748108,
0.44951319694519043,
-0.3706325888633728,
-0.1129277497529983... |
func (*UdpListenerConfig) XXX_OneofWrappers() []interface{} {
return []interface{}{
(*UdpListenerConfig_TypedConfig)(nil),
(*UdpListenerConfig_HiddenEnvoyDeprecatedConfig)(nil),
}
} | [
-1.061109185218811,
0.21791397035121918,
0.5166577696800232,
-0.34774085879325867,
0.48270130157470703,
0.14788134396076202,
-0.07501120120286942,
0.122139111161232,
1.171377420425415,
-0.01758747175335884,
-1.1283713579177856,
0.03499119356274605,
0.04334159567952156,
0.6003474593162537,
... |
func HandleAdd(w http.ResponseWriter, r *http.Request) {
defer r.Body.Close()
fmt.Println("In handleAdd")
var ab AddressBook
if r.Method != http.MethodPost {
err := fmt.Sprintf("Method %s not supported on this action %s\n", r.Method, r.URL.Path)
fmt.Printf("%s", err)
http.Error(w, err, http.StatusMetho... | [
-0.5980497002601624,
-0.9386505484580994,
1.174540638923645,
0.29321053624153137,
-0.296414852142334,
0.6619608998298645,
0.13093611598014832,
-0.27447590231895447,
0.6089117527008057,
0.2797310948371887,
1.1640409231185913,
-0.041595879942178726,
-0.6003915071487427,
1.0490574836730957,
... |
func HandleModify(w http.ResponseWriter, r *http.Request) {
defer r.Body.Close()
fmt.Println("In handleModify")
var ab AddressBook
if r.Method != http.MethodPost {
err := fmt.Sprintf("Method %s not supported on this action %s\n", r.Method, r.URL.Path)
fmt.Printf("%s", err)
http.Error(w, err, http.Statu... | [
-1.2815009355545044,
-0.8452693223953247,
1.1456072330474854,
0.34717708826065063,
0.02660219743847847,
0.21407166123390198,
0.13341949880123138,
-0.19673964381217957,
0.34350278973579407,
0.4522370398044586,
0.7641324400901794,
-0.29051461815834045,
-1.0956103801727295,
0.8418134450912476... |
func HandleDelete(w http.ResponseWriter, r *http.Request) {
defer r.Body.Close()
fmt.Println("In handleDelete")
if r.Method != http.MethodGet {
msg := fmt.Sprintf("Method %s not supported on this action %s\n", r.Method, r.URL.Path)
fmt.Printf("%s", msg)
http.Error(w, msg, http.StatusMethodNotAllowed)
... | [
0.010661021806299686,
-0.5104272961616516,
0.9447475075721741,
0.6660952568054199,
0.11500392854213715,
0.2742701768875122,
0.5789788961410522,
0.19081582129001617,
0.4942913055419922,
0.14583279192447662,
1.1383391618728638,
-0.7199010252952576,
-0.9326361417770386,
0.9985728859901428,
... |
func HandleShow(w http.ResponseWriter, r *http.Request) {
defer r.Body.Close()
fmt.Println("In handleShow")
if r.Method != http.MethodGet {
msg := fmt.Sprintf("Method %s not supported on this action %s\n", r.Method, r.URL.Path)
fmt.Printf("%s", msg)
http.Error(w, msg, http.StatusMethodNotAllowed)
retu... | [
-0.5211206674575806,
-0.5678094625473022,
1.104698896408081,
0.0814262256026268,
-0.764857292175293,
0.04124285653233528,
0.4045034945011139,
-0.09460506588220596,
0.21215102076530457,
0.5983548760414124,
0.678916871547699,
0.046779707074165344,
-0.3652561604976654,
1.0456303358078003,
0... |
func HandleList(w http.ResponseWriter, r *http.Request) {
defer r.Body.Close()
fmt.Println("In handleList")
Mutex.RLock()
defer Mutex.RUnlock()
if len(AddrBook) == 0 {
msg := fmt.Sprintf("Address book is empty\n")
fmt.Printf("%s\n", msg)
http.Error(w, msg, http.StatusNotFound)
return
}
w.Heade... | [
-1.169934868812561,
-0.7790173888206482,
0.9462581276893616,
0.3186156153678894,
0.054986171424388885,
0.017430951818823814,
0.27530011534690857,
0.12706990540027618,
-0.1406753808259964,
0.8643052577972412,
0.06352320313453674,
-0.6315169334411621,
-0.3738444447517395,
1.1933465003967285,... |
func HandleSave(w http.ResponseWriter, r *http.Request) {
defer r.Body.Close()
Mutex.Lock()
defer Mutex.Unlock()
fmt.Println("In handleSave")
if len(AddrBook) == 0 {
msg := fmt.Sprintf("Saving empty address book\n")
fmt.Printf("%s\n", msg)
}
if err := WriteToCSV(CSVFile, AddrBook); err != nil {
... | [
-1.014862060546875,
-0.09638835489749908,
0.7480570673942566,
0.5923508405685425,
1.021568775177002,
0.3836241364479065,
0.4488609731197357,
0.09332779049873352,
-0.40433192253112793,
-0.1760777086019516,
0.45822206139564514,
-0.697143018245697,
-0.7680803537368774,
0.4096848666667938,
0... |
func HandleLoad(w http.ResponseWriter, r *http.Request) {
defer r.Body.Close()
fmt.Println("In handleLoad")
Mutex.RLock()
defer Mutex.RUnlock()
abMap, err := ReadFromCSV(CSVFile)
if err != nil {
msg := fmt.Sprintf("%s after ReadFromCSV\n", err.Error())
fmt.Printf("%s", msg)
http.Error(w, msg, http.... | [
-0.5797106027603149,
-0.642445981502533,
0.8598539233207703,
0.06356436759233475,
-0.3944827616214752,
1.1862415075302124,
0.02916721999645233,
-0.20010608434677124,
-0.526522159576416,
0.08017479628324509,
1.3591907024383545,
-1.0166049003601074,
-0.07557357847690582,
-0.22630715370178223... |
func normalizeContent(content string) string {
normalizedContent, _ := url.QueryUnescape(content)
normalizedContent = strings.Replace(normalizedContent, "\\t", "", -1)
normalizedContent = strings.Replace(normalizedContent, "\\n", "", -1)
return normalizedContent
} | [
0.04316658899188042,
-0.7115136384963989,
0.5936559438705444,
-0.9055878520011902,
-0.26790881156921387,
-0.11783287674188614,
-0.3863757252693176,
0.2056385576725006,
-0.4949515461921692,
0.6237111687660217,
0.4820941090583801,
-0.49921756982803345,
-0.5874508023262024,
-0.521780133247375... |
func unique(arr []string) []string {
occured := map[string]bool{}
result := []string{}
for e := range arr {
if occured[arr[e]] != true {
occured[arr[e]] = true
result = append(result, arr[e])
}
}
return result
} | [
-0.1855810582637787,
-0.8013762831687927,
0.7129656672477722,
-0.2827390730381012,
-0.16874286532402039,
0.4278516173362732,
0.34912562370300293,
0.7378029227256775,
0.45187485218048096,
1.0626976490020752,
-0.15637077391147614,
0.5307883620262146,
0.17724189162254333,
0.6766356825828552,
... |
func matches(regexp *regexp.Regexp, content string) []string {
var matches []string
match := regexp.FindAllString(content, -1)
if len(match) > 0 {
matches = unique(match)
}
return matches
} | [
0.19675391912460327,
-1.1021320819854736,
0.4428481161594391,
-0.015554686076939106,
1.0469999313354492,
-0.3246760368347168,
-0.5948041677474976,
0.35945233702659607,
0.08797527104616165,
0.7514455914497375,
-0.08735466748476028,
-0.08843478560447693,
-1.3336812257766724,
-0.7760304808616... |
func rawUrl(htmlUrl string) string {
domain := strings.Replace(htmlUrl, "https://github.com/", "https://raw.githubusercontent.com/", -1)
return strings.Replace(domain, "/blob/", "/", -1)
} | [
0.1976754367351532,
0.4920872151851654,
0.40263333916664124,
0.4357644319534302,
-0.12482577562332153,
0.7443733215332031,
-0.027192572131752968,
0.14524847269058228,
0.15533460676670074,
0.2003593146800995,
-0.01661381870508194,
0.01742178574204445,
0.4239494204521179,
-0.5258298516273499... |
func (s *Source) DomainRegexp(domain string) *regexp.Regexp {
rdomain := strings.Replace(domain, ".", "\\.", -1)
return regexp.MustCompile("(\\w+[.])*" + rdomain)
} | [
0.09228111803531647,
0.26402753591537476,
0.41305315494537354,
-0.010236643254756927,
-0.42585304379463196,
0.17134229838848114,
0.1006951704621315,
0.9530519247055054,
0.6459531784057617,
0.10156557708978653,
-0.21751832962036133,
1.0289347171783447,
-0.3355047106742859,
-0.20715005695819... |
func (s *Source) Name() string {
return "github"
} | [
-0.17155276238918304,
0.09771957993507385,
0.3060159683227539,
0.07508739829063416,
-0.7573908567428589,
0.10323672741651535,
-0.2799204885959625,
0.6700893640518188,
0.3944377601146698,
0.6820560097694397,
-1.6550753116607666,
-0.49005618691444397,
0.5408022999763489,
0.7762989401817322,
... |
func (product Products) ToJSON(w io.Writer) error {
return json.NewEncoder(w).Encode(product)
} | [
-0.8968555927276611,
-0.8182269334793091,
0.46204429864883423,
0.542763888835907,
0.2807568609714508,
0.6403233408927917,
1.1692559719085693,
-0.5658152103424072,
0.48218873143196106,
0.7445958256721497,
-1.1596910953521729,
0.36802786588668823,
0.05501192435622215,
-0.5988398194313049,
... |
func (product *Product) FromJSON(r io.Reader) error {
return json.NewDecoder(r).Decode(product)
} | [
-0.5143377780914307,
-1.0896352529525757,
0.1600559949874878,
-0.07183559238910675,
-1.1575524806976318,
0.5916236042976379,
-0.19600261747837067,
-0.8196127414703369,
0.8033503293991089,
0.5790835618972778,
-0.9928836822509766,
0.7275522947311401,
0.12301821261644363,
-0.39236775040626526... |
func (pm *ProductModel) Insert(product Product) error {
if _, err := pm.DB.Exec(INSERT_PRODUCT_STMT, product.ProductName, product.Price, product.ShortDescription); err != nil {
log.Printf("error occured on inserting product : %s", err)
return err
}
return nil
} | [
-0.48910149931907654,
0.6302111148834229,
0.3884560465812683,
0.6886282563209534,
0.571405291557312,
1.253872275352478,
0.18179848790168762,
-0.17496387660503387,
-0.41726037859916687,
0.2801375091075897,
-1.0019077062606812,
-0.6194128394126892,
-1.37039053440094,
0.13804446160793304,
-... |
func (pm *ProductModel) GetAll() (*Products, error) {
res, err := pm.DB.Query(GET_ALL_PRODUCT_STMT)
if err != nil {
log.Printf("error occured on getting all the products : %s", err)
}
defer res.Close()
var products Products
for res.Next() {
product := &Product{}
res.Scan(&product.ID, &product.ProductName, ... | [
0.10874270647764206,
-0.25683072209358215,
0.4569578766822815,
1.484610915184021,
0.8569818139076233,
0.6678885221481323,
-0.8954234719276428,
-0.5418961644172668,
-0.04458284750580788,
0.01677466556429863,
0.09018732607364655,
0.5188434720039368,
-0.6250461339950562,
0.7754200100898743,
... |
func (pm *ProductModel) GetSpec(p Product) (*Products, error) {
res, err := pm.DB.Query(GET_SPECIFIC_PRODUCT_STMT, p.ProductName)
if err != nil {
log.Printf("error occurred on getting specific product : %s", err)
return nil, err
}
defer res.Close()
var singleProduct Products
for res.Next() {
product := &P... | [
-0.22134417295455933,
0.42260870337486267,
0.42015260457992554,
1.3248451948165894,
1.0767953395843506,
0.0439397394657135,
-0.11356507986783981,
-0.2730812728404999,
0.24456290900707245,
0.2965063452720642,
0.12762509286403656,
0.49063366651535034,
0.11164409667253494,
0.02676419541239738... |
func (pm *ProductModel) Delete(product Product) error {
if _, err := pm.DB.Query(DELETE_PRODUCT_STMT, product.ProductName); err != nil {
log.Printf("error occurred on deleting a specific product : %s", err)
return err
}
return nil
} | [
0.0980978012084961,
0.31245020031929016,
0.2640726566314697,
1.1546874046325684,
0.9789242148399353,
0.9255934357643127,
0.11741358786821365,
0.016969071701169014,
0.44304358959198,
0.4633844196796417,
0.031098628416657448,
-0.24329058825969696,
-0.7434889674186707,
0.011774422600865364,
... |
func (pm *ProductModel) Update(product Product) error {
if _, err := pm.DB.Query(UPDATE_PRODUCT_STMT, product.ProductName, product.Price, product.ShortDescription, product.ID); err != nil {
log.Printf("error occurred on updating a specific product : %s", err)
return err
}
return nil
} | [
-0.6241773962974548,
-0.3343977630138397,
0.21622952818870544,
0.8222701549530029,
0.23507316410541534,
1.024696946144104,
-0.5298585891723633,
-0.14951123297214508,
0.09580682963132858,
0.458685964345932,
-0.18049578368663788,
-0.1090555340051651,
-0.6928920149803162,
0.08576306700706482,... |
func GetPokemans(w http.ResponseWriter, r *http.Request) {
//TODO implement fetch from database
json.NewEncoder(w).Encode("Testing")
} | [
-1.2786166667938232,
0.3701370656490326,
0.34096190333366394,
-0.22921569645404816,
-0.46339738368988037,
-0.5404247641563416,
-0.8568695187568665,
-0.6026555299758911,
-0.3090672194957733,
0.7701541781425476,
-0.09737587720155716,
0.23093384504318237,
-0.485330730676651,
0.908031344413757... |
func (_m *CacheControllerI) DeleteCacheByPath(paths []core.CachePath) error {
ret := _m.Called(paths)
var r0 error
if rf, ok := ret.Get(0).(func([]core.CachePath) error); ok {
r0 = rf(paths)
} else {
r0 = ret.Error(0)
}
return r0
} | [
-0.004427678883075714,
0.1405341923236847,
0.5911003351211548,
0.9819057583808899,
-0.6640545129776001,
0.08584807813167572,
1.388933777809143,
-0.25114428997039795,
0.06188041344285011,
-0.22593426704406738,
0.12051756680011749,
-1.3437472581863403,
-0.43598344922065735,
0.323865473270416... |
func (_m *CacheControllerI) DeleteCacheByTags(tags []string) error {
ret := _m.Called(tags)
var r0 error
if rf, ok := ret.Get(0).(func([]string) error); ok {
r0 = rf(tags)
} else {
r0 = ret.Error(0)
}
return r0
} | [
0.10943278670310974,
0.018799683079123497,
0.45209094882011414,
0.32149234414100647,
-0.4341488480567932,
-0.4446786344051361,
0.5623968839645386,
-0.06644928455352783,
-0.19124212861061096,
-0.16980065405368805,
-0.22933654487133026,
-0.6595962643623352,
-0.30594679713249207,
0.8109418153... |
func (_m *CacheControllerI) GetCache(r *http.Request, pathPrefix string, serviceKey string) (core.Cache, error) {
ret := _m.Called(r, pathPrefix, serviceKey)
var r0 core.Cache
if rf, ok := ret.Get(0).(func(*http.Request, string, string) core.Cache); ok {
r0 = rf(r, pathPrefix, serviceKey)
} else {
r0 = ret.Get... | [
-0.7433852553367615,
0.4989970028400421,
0.5456860065460205,
0.894659161567688,
0.005256382282823324,
-0.5101478695869446,
0.7546241879463196,
-0.37902262806892395,
0.23974376916885376,
0.018129369243979454,
0.5995404124259949,
-0.09021858125925064,
-0.4010067880153656,
0.3966667354106903,... |
func (_m *CacheControllerI) GetCacheDetail(r *http.Request, pathPrefix string, serviceKey string) (core.CacheDetail, error) {
ret := _m.Called(r, pathPrefix, serviceKey)
var r0 core.CacheDetail
if rf, ok := ret.Get(0).(func(*http.Request, string, string) core.CacheDetail); ok {
r0 = rf(r, pathPrefix, serviceKey)
... | [
-0.04329688102006912,
0.1547849029302597,
0.5170465707778931,
0.4248655140399933,
-0.4347306787967682,
0.021953755989670753,
0.23958644270896912,
-0.4453977048397064,
0.0706474557518959,
-0.12807399034500122,
-0.2980455160140991,
0.983307957649231,
-0.11767453700304031,
0.695570707321167,
... |
func (_m *CacheControllerI) HandleResponse(serviceKey string, r *http.Response) error {
ret := _m.Called(serviceKey, r)
var r0 error
if rf, ok := ret.Get(0).(func(string, *http.Response) error); ok {
r0 = rf(serviceKey, r)
} else {
r0 = ret.Error(0)
}
return r0
} | [
-0.25030717253685,
-0.2128693014383316,
0.06344519555568695,
0.5654993057250977,
0.033343952149152756,
-0.3366695046424866,
0.729410707950592,
-0.016912134364247322,
0.023437898606061935,
0.24554379284381866,
-0.29892146587371826,
-1.1894809007644653,
-0.4706464409828186,
0.280530780553817... |
func (_m *CacheControllerI) IsCacheableRequest(r *http.Request) bool {
ret := _m.Called(r)
var r0 bool
if rf, ok := ret.Get(0).(func(*http.Request) bool); ok {
r0 = rf(r)
} else {
r0 = ret.Get(0).(bool)
}
return r0
} | [
-0.9553200602531433,
-0.21349327266216278,
0.6118720173835754,
0.6727443337440491,
-0.8046079277992249,
0.04257950186729431,
0.5043283104896545,
0.11882133036851883,
0.33616334199905396,
0.25234049558639526,
-0.3380442261695862,
-0.3679410219192505,
-0.23575985431671143,
0.3384579420089721... |
func (_m *CacheControllerI) ListenResponses() {
_m.Called()
} | [
0.8110271692276001,
-0.3660253584384918,
0.2882564067840576,
-0.22604091465473175,
0.4915979206562042,
-0.1623205989599228,
1.7069300413131714,
-0.4785661995410919,
1.214359998703003,
-0.8786984086036682,
-0.4146419167518616,
-0.4217618703842163,
0.08810330927371979,
-0.48007526993751526,
... |
func (s *Suite) InstallUmbrella() *helm.InstallCmd {
return s.Helm().
Install("onos", "onos-umbrella").
RepoURL(onostest.OnosChartRepo).
Set("onos-topo.image.tag", "latest").
Set("onos-config.image.tag", "latest").
Set("onos-config-model.image.tag", "latest")
} | [
-0.4706636071205139,
-0.3211572468280792,
0.6613897085189819,
-0.007088066544383764,
1.1253520250320435,
0.2282709777355194,
0.6538010835647583,
0.3949541449546814,
0.29979443550109863,
-0.12896470725536346,
-0.7469469904899597,
-0.4462600350379944,
0.5356494188308716,
0.6783125400543213,
... |
func List(d Recorder, limit, offset uint64) ([]Recorder, error) {
fn := func(desc Describer, query squirrel.SelectBuilder) (squirrel.SelectBuilder, error) {
return query.Limit(limit).Offset(offset), nil
}
return ListWhere(d, fn)
} | [
-0.1460149735212326,
0.052914030849933624,
0.5346282124519348,
-0.18107518553733826,
-0.032686199992895126,
-0.5272529721260071,
-0.8793214559555054,
1.0484402179718018,
0.5221946835517883,
-0.03381822258234024,
-0.34712445735931396,
0.993630588054657,
0.4800178110599518,
0.346499741077423... |
func ListWhere(d Recorder, fn WhereFunc) ([]Recorder, error) {
var tn string = d.TableName()
var cols []string = d.Columns(true)
buf := []Recorder{}
// Base query
q := d.Builder().Select(cols...).From(tn)
// Allow the fn to modify our query
var err error
q, err = fn(d, q)
if err != nil {
return buf, err
}... | [
-0.36349862813949585,
-0.02026810683310032,
0.8150649666786194,
0.3639080226421356,
-0.2560417354106903,
-0.9597159028053284,
-0.20836545526981354,
0.014850517734885216,
-0.05942889302968979,
0.11554491519927979,
-0.834459125995636,
0.2192433774471283,
0.8368377089500427,
0.699407577514648... |
func New(db squirrel.DBProxyBeginner, flavor string) *DbRecorder {
d := new(DbRecorder)
d.Init(db, flavor)
return d
} | [
0.23763495683670044,
0.8913325071334839,
0.30987775325775146,
-0.8417317271232605,
0.07306715101003647,
-0.7352822422981262,
-1.0869512557983398,
0.5381299257278442,
-0.5712749361991882,
-0.6967942714691162,
0.2823348343372345,
1.0865132808685303,
-1.048663854598999,
1.5531426668167114,
... |
func (d *DbRecorder) Init(db squirrel.DBProxyBeginner, flavor string) {
b := squirrel.StatementBuilder.RunWith(db)
if flavor == "postgres" {
b = b.PlaceholderFormat(squirrel.Dollar)
}
d.builder = &b
d.db = db
d.flavor = flavor
} | [
0.03227062150835991,
0.9311949610710144,
0.4527909457683563,
-0.8114364743232727,
-0.2771337926387787,
0.12489426136016846,
-0.8615835309028625,
1.2404855489730835,
-0.26283299922943115,
-0.3224654495716095,
0.6694448590278625,
1.443399429321289,
-0.9973195791244507,
1.3875808715820312,
... |
func (s *DbRecorder) TableName() string {
return s.table
} | [
0.4300073981285095,
0.1392267346382141,
0.1883859485387802,
0.41186150908470154,
-0.06526146829128265,
-0.2481212168931961,
0.5797316431999207,
0.7882575988769531,
-0.4291433095932007,
-0.15454721450805664,
0.3714127540588379,
0.6198711395263672,
-0.2283637970685959,
0.4585961103439331,
... |
func (s *DbRecorder) DB() squirrel.DBProxyBeginner {
return s.db
} | [
0.6491487622261047,
0.7796845436096191,
0.5107327103614807,
0.1952647864818573,
0.03793894872069359,
0.2225993126630783,
0.8359289765357971,
0.43489766120910645,
1.1758718490600586,
-1.0440016984939575,
0.8637299537658691,
0.9773411750793457,
-0.954326331615448,
0.8842586874961853,
0.309... |
func (s *DbRecorder) Builder() *squirrel.StatementBuilderType {
return s.builder
} | [
-0.06975299119949341,
0.5290436148643494,
0.15123748779296875,
0.13302281498908997,
-0.2129974216222763,
0.015533787198364735,
0.6447486877441406,
0.6310389041900635,
0.9883185625076294,
-0.8532117009162903,
-0.404464453458786,
0.41718849539756775,
-0.7354739308357239,
0.882951557636261,
... |
func (s *DbRecorder) Driver() string {
return s.flavor
} | [
-0.48014745116233826,
-0.033227503299713135,
0.24204659461975098,
0.3010145425796509,
0.15791642665863037,
-0.19297678768634796,
-0.03181179240345955,
0.00693208584561944,
0.21549807488918304,
-0.1971658319234848,
0.4981750547885895,
0.3440873324871063,
-1.1532368659973145,
0.6156053543090... |
func (s *DbRecorder) Bind(tableName string, ar Record) Recorder {
// "To be is to be the value of a bound variable." - W. O. Quine
// Get the table name
s.table = tableName
// Get the fields
s.scanFields(ar)
s.record = ar
return Recorder(s)
} | [
0.09287459403276443,
-0.3935798406600952,
0.4414045810699463,
0.8366968035697937,
-0.8739050626754761,
-0.5168542861938477,
-0.5775499939918518,
-0.08372154831886292,
-0.3120342195034027,
-0.606788694858551,
0.19351144134998322,
1.1472707986831665,
0.07390308380126953,
0.3553760349750519,
... |
func (s *DbRecorder) Key() []string {
key := make([]string, len(s.key))
for i, f := range s.key {
key[i] = f.column
}
return key
} | [
-0.572157621383667,
0.2141871154308319,
0.5855876803398132,
0.2807448208332062,
0.6996952295303345,
0.21984998881816864,
-0.6073300242424011,
0.3804112374782562,
-0.44070103764533997,
1.1879322528839111,
-0.43283185362815857,
0.4053414463996887,
-0.9769932627677917,
0.11092370748519897,
... |
func (s *DbRecorder) Load() error {
whereParts := s.WhereIds()
dest := s.FieldReferences(false)
q := s.builder.Select(s.colList(false, false)...).From(s.table).Where(whereParts)
err := q.QueryRow().Scan(dest...)
return err
} | [
-0.6707241535186768,
0.6525897979736328,
0.38797831535339355,
-0.48775944113731384,
-0.30168190598487854,
-0.32981279492378235,
-0.25059399008750916,
0.0274340957403183,
-0.7320258021354675,
0.0562262237071991,
-0.17371582984924316,
-0.04273897409439087,
-0.7567188143730164,
-0.10328231751... |
func (s *DbRecorder) Exists() (bool, error) {
has := false
whereParts := s.WhereIds()
q := s.builder.Select("COUNT(*) > 0").From(s.table).Where(whereParts)
err := q.QueryRow().Scan(&has)
return has, err
} | [
-0.8542585372924805,
0.31088870763778687,
0.6648305654525757,
-0.3658789396286011,
0.39043882489204407,
-0.3839605450630188,
-0.792477548122406,
0.3178584575653076,
-0.6118956804275513,
-0.4154776334762573,
-0.07873997092247009,
-0.44224420189857483,
-0.485696941614151,
0.6824825406074524,... |
func (s *DbRecorder) ExistsWhere(pred interface{}, args ...interface{}) (bool, error) {
has := false
q := s.builder.Select("COUNT(*) > 0").From(s.table).Where(pred, args...)
err := q.QueryRow().Scan(&has)
return has, err
} | [
-0.11154370754957199,
0.5022364854812622,
0.7407761812210083,
0.3678906261920929,
0.02697093039751053,
0.1725674420595169,
-0.08902063220739365,
0.8765414953231812,
-1.4971359968185425,
0.08179562538862228,
-0.08088909834623337,
-0.4800708591938019,
0.03522304818034172,
1.0863103866577148,... |
func (s *DbRecorder) Delete() error {
wheres := s.WhereIds()
q := s.builder.Delete(s.table).Where(wheres)
_, err := q.Exec()
return err
} | [
0.3322860598564148,
1.3134886026382446,
0.3802248239517212,
0.840403139591217,
0.9076619148254395,
-0.40948939323425293,
0.20797519385814667,
0.6112147569656372,
-0.253662645816803,
0.13075606524944305,
0.19944101572036743,
0.3574495017528534,
-1.0631550550460815,
0.27406740188598633,
-0... |
func (s *DbRecorder) Insert() error {
switch s.flavor {
case "postgres":
return s.insertPg()
default:
return s.insertStd()
}
} | [
-0.32173681259155273,
1.58031165599823,
0.5145858526229858,
0.2445783019065857,
0.6406444907188416,
-0.09213820844888687,
-0.2808854877948761,
0.09471138566732407,
-0.8947464823722839,
0.12162549048662186,
0.19060206413269043,
0.896626353263855,
-1.311378836631775,
1.0782119035720825,
0.... |
func (s *DbRecorder) insertStd() error {
cols, vals := s.colValLists(true, false)
q := s.builder.Insert(s.table).Columns(cols...).Values(vals...)
ret, err := q.Exec()
if err != nil {
return err
}
for _, f := range s.fields {
if f.isAuto {
ar := reflect.Indirect(reflect.ValueOf(s.record))
field := ar... | [
-0.07418826222419739,
0.8515974283218384,
0.8202963471412659,
-0.17676176130771637,
0.010456466116011143,
-0.30429771542549133,
0.723677933216095,
0.23613208532333374,
-1.155754804611206,
-0.15887415409088135,
-0.11372074484825134,
-0.39761286973953247,
-1.3333430290222168,
0.6748812794685... |
func (s *DbRecorder) insertPg() error {
cols, vals := s.colValLists(true, false)
dest := s.FieldReferences(true)
q := s.builder.Insert(s.table).Columns(cols...).Values(vals...).
Suffix("RETURNING " + strings.Join(s.colList(true, false), ","))
sql, vals, err := q.ToSql()
if err != nil {
return err
}
return ... | [
-0.9980548024177551,
2.004594564437866,
0.7319874167442322,
-0.12451052665710449,
0.029825525358319283,
0.21707600355148315,
-0.2041417360305786,
0.05336267128586769,
-1.2018176317214966,
0.5878623723983765,
0.39115428924560547,
-0.5622684359550476,
-1.6501038074493408,
0.1845710426568985,... |
func (s *DbRecorder) Update() error {
whereParts := s.WhereIds()
updates := s.updateFields()
q := s.builder.Update(s.table).SetMap(updates).Where(whereParts)
_, err := q.Exec()
return err
} | [
-0.5025467276573181,
-0.0826803669333458,
0.27506059408187866,
0.2407553791999817,
-0.1351831555366516,
0.044891539961099625,
-0.18845103681087494,
0.6946631073951721,
-0.6393859386444092,
0.16596545279026031,
-0.0634395107626915,
-0.08788508921861649,
-1.1097161769866943,
0.02427306212484... |
func (s *DbRecorder) Columns(includeKeys bool) []string {
return s.colList(includeKeys, false)
} | [
-0.31480762362480164,
0.2277751863002777,
0.38016650080680847,
-0.04470467194914818,
-0.6035924553871155,
0.11076699942350388,
-0.09057532995939255,
0.858828604221344,
0.3485856056213379,
0.5189272165298462,
-0.40723636746406555,
0.36210036277770996,
-1.0740578174591064,
0.1352580189704895... |
func (s *DbRecorder) colList(withKeys bool, omitNil bool) []string {
names := make([]string, 0, len(s.fields))
var ar reflect.Value
if omitNil {
ar = reflect.Indirect(reflect.ValueOf(s.record))
}
for _, field := range s.fields {
if !withKeys && field.isKey {
continue
}
if omitNil {
f := ar.FieldByN... | [
-0.2091483324766159,
-0.8589020371437073,
0.6733317375183105,
-0.35194462537765503,
-0.5912280678749084,
-0.6258886456489563,
-0.14604638516902924,
0.2918681502342224,
-0.11140488088130951,
1.3962231874465942,
-1.0429319143295288,
0.21034997701644897,
0.3038581311702728,
0.5738341808319092... |
func (s *DbRecorder) FieldReferences(withKeys bool) []interface{} {
refs := make([]interface{}, 0, len(s.fields))
ar := reflect.Indirect(reflect.ValueOf(s.record))
for _, field := range s.fields {
if !withKeys && field.isKey {
continue
}
fv := ar.FieldByName(field.name)
var ref reflect.Value
if fv.Kin... | [
-0.9413740038871765,
0.15512068569660187,
0.6341807246208191,
-0.4453212320804596,
0.051059283316135406,
-0.6658232808113098,
-0.15147098898887634,
-0.18900378048419952,
-0.185377299785614,
0.3758639991283417,
-0.3487085700035095,
0.4221283197402954,
-0.9319362640380859,
0.3712987899780273... |
func (s *DbRecorder) colValLists(withKeys, withAutos bool) (columns []string, values []interface{}) {
ar := reflect.Indirect(reflect.ValueOf(s.record))
for _, field := range s.fields {
switch {
case !withKeys && field.isKey:
continue
case !withAutos && field.isAuto:
continue
}
// Get the value of t... | [
-0.004965311847627163,
-0.1864452064037323,
0.3741864860057831,
-0.15091140568256378,
-0.6328679919242859,
-0.1229860857129097,
-0.20803827047348022,
-0.2931738495826721,
-0.8270012140274048,
0.3646671772003174,
-0.7386201620101929,
0.11819904297590256,
0.3150331676006317,
0.91063171625137... |
func (s *DbRecorder) updateFields() map[string]interface{} {
update := map[string]interface{}{}
cols, vals := s.colValLists(false, true)
for i, col := range cols {
update[col] = vals[i]
}
return update
} | [
-1.09129798412323,
0.05475246533751488,
0.44608205556869507,
-0.5555594563484192,
-0.7148124575614929,
-0.07124143093824387,
-0.3097050189971924,
-0.06084134429693222,
-0.34710693359375,
0.702914834022522,
-0.837554931640625,
-0.5177596807479858,
-0.5716545581817627,
0.18197248876094818,
... |
func (s *DbRecorder) WhereIds() map[string]interface{} {
clause := make(map[string]interface{}, len(s.key))
ar := reflect.Indirect(reflect.ValueOf(s.record))
for _, f := range s.key {
clause[f.column] = ar.FieldByName(f.name).Interface()
}
return clause
} | [
-0.35552752017974854,
-0.29714837670326233,
0.327938050031662,
-1.3851865530014038,
-1.2252079248428345,
-0.4240955710411072,
0.24556989967823029,
0.23218713700771332,
-1.179569125175476,
1.0545790195465088,
-0.12216034531593323,
0.198359414935112,
-0.308493047952652,
-0.6593528389930725,
... |
func (s *DbRecorder) scanFields(ar Record) {
v := reflect.Indirect(reflect.ValueOf(ar))
t := v.Type()
count := t.NumField()
keys := make([]*field, 0, 2)
for i := 0; i < count; i++ {
f := t.Field(i)
// Skip fields with no tag.
if len(f.Tag) == 0 {
continue
}
sqtag := f.Tag.Get("stbl")
if len(sqtag) ... | [
-0.5482335090637207,
0.9178633689880371,
0.4594990611076355,
-0.18943332135677338,
-0.8789127469062805,
-0.7247669100761414,
0.2970862090587616,
-0.4121151864528656,
-0.16358080506324768,
0.1295379102230072,
-1.2230422496795654,
-0.38828304409980774,
0.052293505519628525,
-0.41236042976379... |
func (s *DbRecorder) parseTag(fieldName, tag string) []string {
parts := strings.Split(tag, ",")
if len(parts) == 0 {
return []string{fieldName}
}
return parts
} | [
-0.0947282463312149,
0.004248277749866247,
0.3201431930065155,
-0.18212854862213135,
0.8750247955322266,
-0.29452574253082275,
-1.042384147644043,
0.22234304249286652,
-0.6017471551895142,
0.8012707233428955,
-0.44885846972465515,
0.1189655289053917,
-0.6949065327644348,
0.5460962057113647... |
func RegisterMarshalerFunc(i interface{}, f MarshalerFunc) {
marshalerFuncs.Store(reflect.TypeOf(i), f)
} | [
-0.0381905697286129,
0.22598424553871155,
0.32708239555358887,
0.10214819014072418,
-0.37912750244140625,
-0.23117554187774658,
0.5013319253921509,
0.8879157304763794,
-0.23285169899463654,
-0.6405443549156189,
-0.7286432385444641,
0.28706252574920654,
0.7847698926925659,
-0.02183940820395... |
func defaultMarshalerFunc(i interface{}, _ *MarshalOpt) (string, error) {
if i == nil {
i = "-"
}
switch v := i.(type) {
case string:
if v == "" {
i = "-"
}
}
return fmt.Sprint(i), nil
} | [
0.3047727644443512,
0.4926290214061737,
0.44706863164901733,
0.24451754987239838,
0.18965278565883636,
0.09541711956262589,
-0.3078237771987915,
0.5465174317359924,
0.1408551186323166,
-0.24647460877895355,
0.7573410272598267,
-0.03783297911286354,
0.06890405714511871,
0.3656140863895416,
... |
func isMarshalable(t reflect.Type) bool {
_, hasMarshalerFunc := getMarshalerFunc(t)
return (t.Kind() != reflect.Struct && t.Kind() != reflect.Map && t.Kind() != reflect.Ptr) ||
hasMarshalerFunc ||
t.Implements(reflect.TypeOf((*Marshaler)(nil)).Elem()) ||
t.Implements(reflect.TypeOf((*error)(nil)).Elem()) ||
... | [
-0.19562356173992157,
0.16381514072418213,
0.9360923767089844,
-0.24230584502220154,
-0.5326342582702637,
-0.3195681571960449,
0.38367682695388794,
-0.4337392747402191,
0.693309485912323,
-0.010907663963735104,
-0.1556527018547058,
0.2565884292125702,
-0.6860995292663574,
1.411705493927002... |
func EnumMarshalFunc(specs EnumMarshalSpecs) MarshalerFunc {
return func(i interface{}, opt *MarshalOpt) (s string, e error) {
value, _ := defaultMarshalerFunc(i, opt)
spec, exist := specs[i]
if exist {
if spec.Value != "" {
value = spec.Value
}
value = terminal.Style(value, spec.Attribute)
}
re... | [
0.36488956212997437,
-0.24179311096668243,
0.5234151482582092,
-0.5265777111053467,
-0.5604190826416016,
-0.14570674300193787,
0.32780900597572327,
0.1862749308347702,
0.4427035450935364,
0.5817521810531616,
1.2241939306259155,
0.20441772043704987,
0.900923490524292,
0.45570138096809387,
... |
func messageCreate(s *discordgo.Session, m *discordgo.MessageCreate) {
// Ignore all messages created by the bot itself
// This isn't required in this specific example but it's a good practice.
if m.Author.ID == s.State.User.ID {
return
}
// TODO: Maybe use regex?
if len(m.Content) > 2 && m.Content[:2] == ">c"... | [
0.3630077838897705,
-0.13441722095012665,
0.596297025680542,
0.18553586304187775,
0.6659960746765137,
-0.39901891350746155,
-0.7223960161209106,
-0.19104288518428802,
-0.30846157670021057,
-0.36027687788009644,
0.2400430589914322,
-0.2463533729314804,
-0.19545425474643707,
0.71542835235595... |
func MyIP() (net.IP, error) {
resp, err := http.Get(queryURL)
if err != nil {
return nil, nil
}
data, err := ioutil.ReadAll(resp.Body)
if err != nil {
return nil, nil
}
ip := net.ParseIP(string(data))
return ip, nil
} | [
-1.0263370275497437,
-0.34846895933151245,
0.7023065090179443,
-0.008926085196435452,
-0.7503566145896912,
-0.401106595993042,
-0.9337050914764404,
0.150286003947258,
0.008404204621911049,
-0.35964468121528625,
-0.007368294056504965,
-0.10941371321678162,
-0.6117874979972839,
-0.8489109277... |
func DiskUsage(path string) (disk DiskStatus, err error) {
fs := syscall.Statfs_t{}
err = syscall.Statfs(path, &fs)
if err != nil {
return
}
disk.All = fs.Blocks * uint64(fs.Bsize)
disk.Free = fs.Bfree * uint64(fs.Bsize)
disk.Used = disk.All - disk.Free
return
} | [
-0.6475226283073425,
0.2921837866306305,
0.686090350151062,
-0.4265349507331848,
-0.1459372639656067,
-1.031697154045105,
1.0039801597595215,
-0.3299659788608551,
0.2102818787097931,
0.24214428663253784,
-0.18522533774375916,
-0.23523755371570587,
-0.13670295476913452,
0.7993873953819275,
... |
func SetCookie(w http.ResponseWriter, req *http.Request, name, value string) {
SetCookieAge(w, req, name, value, 0)
} | [
-0.2831536829471588,
-0.3978152275085449,
0.5009042024612427,
0.8495548963546753,
-0.222152978181839,
0.06924725323915482,
0.11184027045965195,
-0.23186127841472626,
-0.7457121014595032,
0.589353084564209,
0.6272815465927124,
-0.37918031215667725,
-0.19460420310497284,
0.7511621117591858,
... |
func SetCookieAge(w http.ResponseWriter, req *http.Request, name, value string, age time.Duration) {
cfg := config.FromContext(req.Context())
u, err := url.Parse(cfg.PublicURL())
if err != nil {
panic(err)
}
cookiePath := "/"
secure := req.URL.Scheme == "https"
if cfg.ShouldUsePublicURL() {
cookiePath = str... | [
-0.7857708930969238,
-0.31419065594673157,
0.6934898495674133,
0.6385191082954407,
-0.31166866421699524,
0.3813484013080597,
-0.1366134136915207,
0.1604900360107422,
-0.8499841094017029,
0.8465473055839539,
0.10417807847261429,
0.4378056526184082,
-0.1622360199689865,
1.0923023223876953,
... |
func ClearCookie(w http.ResponseWriter, req *http.Request, name string) {
SetCookieAge(w, req, name, "", -time.Second)
} | [
0.09015879780054092,
-0.23624126613140106,
0.6277391910552979,
0.47974586486816406,
-0.5827147960662842,
0.1164441928267479,
-0.9890176057815552,
-0.6847611665725708,
-0.9766172766685486,
1.6059812307357788,
0.754766047000885,
0.4932720363140106,
-0.04278057813644409,
0.46783173084259033,
... |
func MockEdge(log *zerolog.Logger, addrs []*allregions.EdgeAddr) *Edge {
regions := allregions.NewNoResolve(addrs)
return &Edge{
log: log,
regions: regions,
}
} | [
-0.6160619854927063,
-0.027555115520954132,
0.3347664773464203,
-0.4994226098060608,
0.32139331102371216,
-0.3668254017829895,
-0.5113434791564941,
0.43259119987487793,
0.24460504949092865,
-0.5799464583396912,
0.15629231929779053,
-0.7022004127502441,
-1.001796841621399,
0.381314367055892... |
func (s *DataNode) Shutdown() {
s.control.Shutdown(s, doShutdown)
} | [
-0.014057477936148643,
0.5170300602912903,
0.07070939987897873,
-0.34167158603668213,
1.1521490812301636,
0.3948710858821869,
-0.08819011598825455,
0.16658183932304382,
0.5647134184837341,
-0.3684798777103424,
-0.5298303365707397,
1.0339609384536743,
0.4373975396156311,
-0.0626761615276336... |
func (s *DataNode) Sync() {
s.control.Sync()
} | [
0.3184033930301666,
0.44433435797691345,
-0.05055901035666466,
-0.3702711760997772,
-0.0050238086842000484,
-0.2684415578842163,
-0.2784516215324402,
-0.871224582195282,
-0.25170832872390747,
-0.03121735155582428,
-0.7193688750267029,
1.6674696207046509,
0.8695353865623474,
0.3298359513282... |
func doStart(server common.Server, cfg *config.Config) (err error) {
debug.SetMaxThreads(20000)
s, ok := server.(*DataNode)
if !ok {
return errors.New("Invalid Node Type!")
}
s.stopC = make(chan bool, 0)
// parse the config file
if err = s.parseConfig(cfg); err != nil {
return
}
exporter.Init(ModuleNam... | [
0.07404123991727829,
0.5712010264396667,
1.0540317296981812,
0.18789055943489075,
0.3840820789337158,
0.42145684361457825,
0.6678904891014099,
0.221397265791893,
0.14973998069763184,
0.06737080216407776,
-0.12300443649291992,
0.8197668194770813,
-0.06191347911953926,
0.9313830137252808,
... |
func (s *DataNode) register(cfg *config.Config) {
var (
err error
)
timer := time.NewTimer(0)
// get the IsIPV4 address, cluster ID and node ID from the master
for {
select {
case <-timer.C:
var ci *proto.ClusterInfo
if ci, err = MasterClient.AdminAPI().GetClusterInfo(); err != nil {
log.LogError... | [
-0.42131227254867554,
0.49847155809402466,
0.6659039258956909,
-0.37168943881988525,
0.30693304538726807,
-0.602044403553009,
-0.20976854860782623,
0.900034487247467,
-0.3514922857284546,
0.5003498196601868,
-0.577150821685791,
1.3175345659255981,
-0.2428615689277649,
0.3648262917995453,
... |
func (s *DataNode) incDiskErrCnt(partitionID uint64, err error, flag uint8) {
if err == nil {
return
}
dp := s.space.Partition(partitionID)
if dp == nil {
return
}
d := dp.Disk()
if d == nil {
return
}
if !IsDiskErr(err.Error()) {
return
}
if flag == WriteFlag {
d.incWriteErrCnt()
} else if flag =... | [
-0.0462816096842289,
-0.09194739907979965,
0.7207118272781372,
-0.23948310315608978,
0.154685840010643,
-0.718923807144165,
0.7507935762405396,
0.6798092722892761,
-0.1851905882358551,
-0.4053511917591095,
0.9858418703079224,
0.3181295394897461,
-0.008629053831100464,
0.609897255897522,
... |
func FileSystemFromFlags(flags *pflag.FlagSet) (FileSystem, error) {
path, err := flags.GetString("output")
if err != nil {
return nil, err
}
u, err := url.Parse(path)
if err != nil {
return nil, fmt.Errorf("could not parse output location: %v", err)
}
switch u.Scheme {
case "http", "https":
return urlF... | [
0.5946127772331238,
-0.5854544043540955,
0.3629474639892578,
-0.27180397510528564,
-0.06269852072000504,
-0.48135167360305786,
0.17264658212661743,
-0.9970529675483704,
0.24730242788791656,
-1.3640741109848022,
0.8244507908821106,
-0.17019608616828918,
-0.367982417345047,
0.397917419672012... |
func MustRegisterSqlite3WithPcre() {
if libSqlite3Pcre == "" {
env.PrintHelp()
log.Fatal("can't find the libsqlite3-pcre library because LIBSQLITE3_PCRE was not set")
}
sql.Register("sqlite3_with_pcre", &sqlite3.SQLiteDriver{Extensions: []string{libSqlite3Pcre}})
} | [
0.9034160375595093,
0.8779518604278564,
0.4741092920303345,
-0.6444932818412781,
0.6181358695030212,
0.4671138525009155,
-1.488876461982727,
-0.23233705759048462,
0.7066778540611267,
0.3456411361694336,
0.1983758509159088,
-0.338811993598938,
-0.9710952043533325,
0.1242109090089798,
-0.5... |
func SetLocalLibpath() {
if libSqlite3Pcre != "" {
return
}
repositoryRoot, err := exec.Command("git", "rev-parse", "--show-toplevel").Output()
if err != nil {
panic("can't find the libsqlite3-pcre library because LIBSQLITE3_PCRE was not set and you're not in the git repository, which is where the library is e... | [
0.7831944227218628,
0.17620857059955597,
0.5170645117759705,
-0.7461156845092773,
0.26437899470329285,
0.6151009798049927,
-0.5717565417289734,
-0.15763145685195923,
0.18181119859218597,
0.048599082976579666,
0.34455767273902893,
0.2984304428100586,
-0.6435292363166809,
0.06612204760313034... |
func (s *S3Agent) CreateBucketNoInfoLogging(name string) error {
return s.createBucket(name, false)
} | [
-0.2696320414543152,
0.5809301137924194,
0.3321959376335144,
-0.3293549120426178,
-0.22005286812782288,
0.7652840614318848,
-0.23199935257434845,
-0.1929498016834259,
-0.5677828192710876,
-0.8390762805938721,
-0.357477605342865,
-0.639955997467041,
-0.023169325664639473,
0.6274294257164001... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.