text stringlengths 11 6.3k | embedding listlengths 768 768 |
|---|---|
func (o *EquipmentIoCardBase) GetModuleId() int64 {
if o == nil || o.ModuleId == nil {
var ret int64
return ret
}
return *o.ModuleId
} | [
0.8887282013893127,
-0.3404094874858856,
0.28210437297821045,
0.8050824403762817,
0.5064030289649963,
0.8671827912330627,
0.19575658440589905,
-0.20542822778224945,
1.4748765230178833,
-0.12036014348268509,
0.6574501991271973,
-0.34219929575920105,
-0.6029250025749207,
1.4614337682724,
0... |
func (o *EquipmentIoCardBase) GetModuleIdOk() (*int64, bool) {
if o == nil || o.ModuleId == nil {
return nil, false
}
return o.ModuleId, true
} | [
0.16713570058345795,
-0.033663034439086914,
0.42675644159317017,
0.1885850578546524,
0.7427265644073486,
1.0414998531341553,
0.48987045884132385,
0.6790288686752319,
0.8700578808784485,
-0.1756969690322876,
-0.4652307629585266,
-0.2826549708843231,
-0.044001299887895584,
0.791387140750885,... |
func (o *EquipmentIoCardBase) HasModuleId() bool {
if o != nil && o.ModuleId != nil {
return true
}
return false
} | [
1.077919363975525,
-0.2995221018791199,
0.3105889558792114,
-0.42111852765083313,
0.48921340703964233,
0.7374723553657532,
-0.6612924337387085,
0.6472448110580444,
1.0094470977783203,
0.29847267270088196,
0.1355784386396408,
0.3428332805633545,
-0.20612235367298126,
1.2163708209991455,
-... |
func (o *EquipmentIoCardBase) SetModuleId(v int64) {
o.ModuleId = &v
} | [
0.5830453038215637,
-0.13251784443855286,
-0.11869680136442184,
0.1449260413646698,
-0.19081534445285797,
1.1577285528182983,
-0.6090081334114075,
-0.9381778240203857,
0.6379142999649048,
0.9025188088417053,
0.8623466491699219,
1.019519567489624,
0.15325112640857697,
0.6015175580978394,
... |
func (o *EquipmentIoCardBase) GetOperReason() []string {
if o == nil {
var ret []string
return ret
}
return o.OperReason
} | [
0.23484498262405396,
-0.3195491135120392,
0.6079353094100952,
0.03370622172951698,
0.3442135751247406,
0.5584065914154053,
0.10022282600402832,
0.09028848260641098,
0.968621015548706,
-0.10278332978487015,
-0.4618847370147705,
0.09583934396505356,
-0.9978669881820679,
-0.1955929696559906,
... |
func (o *EquipmentIoCardBase) GetOperReasonOk() ([]string, bool) {
if o == nil || o.OperReason == nil {
return nil, false
}
return o.OperReason, true
} | [
0.09973178058862686,
-0.36114323139190674,
0.8113216757774353,
-0.10425162315368652,
0.03693077713251114,
0.27450621128082275,
0.7864063382148743,
0.5467681288719177,
0.7381487488746643,
0.6269949674606323,
-0.1503823846578598,
-0.36586248874664307,
-0.06276564300060272,
-0.028500551357865... |
func (o *EquipmentIoCardBase) HasOperReason() bool {
if o != nil && o.OperReason != nil {
return true
}
return false
} | [
0.7263256907463074,
-0.17150677740573883,
0.3963139057159424,
-0.7700052261352539,
0.4101048409938812,
-0.2798740863800049,
-0.12477818876504898,
0.7680855989456177,
0.7302244305610657,
-0.5373492240905762,
-0.5430286526679993,
-0.7267919182777405,
-0.5237298607826233,
0.20473584532737732,... |
func (o *EquipmentIoCardBase) SetOperReason(v []string) {
o.OperReason = v
} | [
-0.4843500256538391,
-0.5825986266136169,
0.19202248752117157,
-0.7756916284561157,
-0.03193635493516922,
0.3957231044769287,
0.020094092935323715,
-0.11748269200325012,
0.8142533898353577,
0.5175987482070923,
-0.5484824776649475,
0.11940594017505646,
-0.5081167221069336,
-0.08794789761304... |
func (o *EquipmentIoCardBase) GetOperState() string {
if o == nil || o.OperState == nil {
var ret string
return ret
}
return *o.OperState
} | [
0.04209745675325394,
0.2829371392726898,
0.2592355012893677,
0.35302719473838806,
-1.0313215255737305,
-0.1333307921886444,
0.19727139174938202,
-0.6479546427726746,
0.4813314974308014,
-0.26554325222969055,
0.44648459553718567,
-1.9478565454483032,
-0.957306444644928,
-0.38545987010002136... |
func (o *EquipmentIoCardBase) GetOperStateOk() (*string, bool) {
if o == nil || o.OperState == nil {
return nil, false
}
return o.OperState, true
} | [
-0.3479432463645935,
0.0654761791229248,
0.6306615471839905,
0.01181681826710701,
-0.8282893300056458,
0.4702560603618622,
0.7271631360054016,
0.12709380686283112,
0.27858766913414,
0.48563364148139954,
-0.2891688048839569,
-1.5047637224197388,
-0.48494601249694824,
-0.17483001947402954,
... |
func (o *EquipmentIoCardBase) HasOperState() bool {
if o != nil && o.OperState != nil {
return true
}
return false
} | [
0.35643041133880615,
0.3233044445514679,
0.4226672947406769,
-0.24992907047271729,
-0.2071039080619812,
-0.4496949017047882,
-0.13072392344474792,
0.5510716438293457,
0.4768112897872925,
-0.4717561602592468,
-0.46993589401245117,
-2.040041208267212,
-0.2807592749595642,
-0.3089696168899536... |
func (o *EquipmentIoCardBase) SetOperState(v string) {
o.OperState = &v
} | [
0.10099581629037857,
0.08400441706180573,
0.19964733719825745,
-0.6092007160186768,
-1.398429036140442,
-0.06475567072629929,
-0.5097146034240723,
-0.8555701971054077,
0.07568608224391937,
0.23525908589363098,
0.21457578241825104,
-0.6448692083358765,
-0.7495408058166504,
-1.35171711444854... |
func (o *EquipmentIoCardBase) GetPartNumber() string {
if o == nil || o.PartNumber == nil {
var ret string
return ret
}
return *o.PartNumber
} | [
0.41039592027664185,
-0.18665023148059845,
0.3518335521221161,
0.2366240918636322,
-0.14799124002456665,
-0.11402450501918793,
1.1150742769241333,
0.09806165099143982,
0.6556326150894165,
-0.7432213425636292,
-0.20466163754463196,
-1.2328137159347534,
-0.759853184223175,
0.5217067003250122... |
func (o *EquipmentIoCardBase) GetPartNumberOk() (*string, bool) {
if o == nil || o.PartNumber == nil {
return nil, false
}
return o.PartNumber, true
} | [
0.5323139429092407,
-0.2919711172580719,
0.37877964973449707,
0.2646515667438507,
-0.4322569966316223,
0.2956850230693817,
0.8830652832984924,
1.1590379476547241,
-0.0008598060812801123,
0.302688330411911,
-0.6932986378669739,
-0.689849317073822,
-0.09550411254167557,
0.26860886812210083,
... |
func (o *EquipmentIoCardBase) HasPartNumber() bool {
if o != nil && o.PartNumber != nil {
return true
}
return false
} | [
0.5771029591560364,
-0.45873650908470154,
0.5011711120605469,
-0.49082496762275696,
0.09882187843322754,
-0.327463299036026,
0.6591405868530273,
1.1002763509750366,
-0.03871597349643707,
-0.8156064748764038,
-0.9171096682548523,
-0.839449405670166,
-0.19903625547885895,
0.5452926754951477,... |
func (o *EquipmentIoCardBase) SetPartNumber(v string) {
o.PartNumber = &v
} | [
0.5579221248626709,
-0.6260490417480469,
-0.08843665570020676,
-1.0537723302841187,
-0.8011909127235413,
-0.41530346870422363,
0.23803174495697021,
-0.23096118867397308,
0.11811622977256775,
-0.08900496363639832,
-0.41883158683776855,
0.671547532081604,
-0.28438472747802734,
-0.38516896963... |
func (o *EquipmentIoCardBase) GetPid() string {
if o == nil || o.Pid == nil {
var ret string
return ret
}
return *o.Pid
} | [
1.1915830373764038,
-0.17227821052074432,
0.2654413878917694,
1.1149519681930542,
0.24161522090435028,
0.26826557517051697,
0.4531618058681488,
-0.5153460502624512,
1.1590166091918945,
-0.45163410902023315,
0.5069930553436279,
-1.8489526510238647,
-0.7826675176620483,
-0.05070251226425171,... |
func (o *EquipmentIoCardBase) GetPidOk() (*string, bool) {
if o == nil || o.Pid == nil {
return nil, false
}
return o.Pid, true
} | [
0.20359201729297638,
-0.20111672580242157,
0.44473859667778015,
0.6988903880119324,
0.22084157168865204,
0.5509591102600098,
0.21247458457946777,
0.9628229141235352,
0.3036966621875763,
0.8037996888160706,
-0.4988689720630646,
-1.2022981643676758,
-0.45768243074417114,
-0.25372177362442017... |
func (o *EquipmentIoCardBase) HasPid() bool {
if o != nil && o.Pid != nil {
return true
}
return false
} | [
1.320759654045105,
-0.1632574051618576,
0.40105581283569336,
0.8152238726615906,
0.80116206407547,
0.2973024547100067,
-0.4875544011592865,
0.614363968372345,
0.6059237122535706,
-0.4775875508785248,
0.09324046224355698,
-1.7992252111434937,
-0.5654391050338745,
-0.8776952624320984,
0.57... |
func (o *EquipmentIoCardBase) SetPid(v string) {
o.Pid = &v
} | [
1.213484764099121,
-0.3657688796520233,
-0.10632680356502533,
0.3758445680141449,
-0.5129322409629822,
0.6201973557472229,
-0.8360891342163086,
-0.5959838628768921,
0.26680609583854675,
0.2390134185552597,
0.3794013261795044,
-0.3464932143688202,
-0.47934049367904663,
-1.5109847784042358,
... |
func (o *EquipmentIoCardBase) GetProductName() string {
if o == nil || o.ProductName == nil {
var ret string
return ret
}
return *o.ProductName
} | [
0.12329040467739105,
0.1975352019071579,
0.20924916863441467,
0.7770763039588928,
-0.11805529147386551,
-0.37087827920913696,
1.0695576667785645,
-0.40560677647590637,
0.4833667278289795,
-0.25864744186401367,
0.4300970733165741,
-1.7267699241638184,
-0.48492494225502014,
0.546048998832702... |
func (o *EquipmentIoCardBase) GetProductNameOk() (*string, bool) {
if o == nil || o.ProductName == nil {
return nil, false
}
return o.ProductName, true
} | [
0.011975117959082127,
-0.2215709686279297,
0.5348532199859619,
-0.0797012597322464,
-0.24612043797969818,
0.013537375256419182,
0.8865561485290527,
-0.1562524139881134,
0.1365680694580078,
1.2237881422042847,
-0.6363435983657837,
-0.5684396624565125,
0.5908393263816833,
0.02425763569772243... |
func (o *EquipmentIoCardBase) HasProductName() bool {
if o != nil && o.ProductName != nil {
return true
}
return false
} | [
0.2897402346134186,
0.2616373896598816,
0.42244791984558105,
0.05042346566915512,
0.3309919238090515,
-0.7873842120170593,
0.6548041105270386,
0.31579533219337463,
0.5719377398490906,
-0.31877392530441284,
-0.2864476442337036,
-1.161484718322754,
0.11223459988832474,
0.23164166510105133,
... |
func (o *EquipmentIoCardBase) SetProductName(v string) {
o.ProductName = &v
} | [
0.21498627960681915,
-0.06281061470508575,
0.08021733909845352,
0.5752708911895752,
-0.6186482310295105,
-0.5444151163101196,
0.5946540832519531,
-1.0180799961090088,
0.01061942707747221,
0.19788934290409088,
0.2062506377696991,
0.22252339124679565,
0.050012990832328796,
-0.707251965999603... |
func (o *EquipmentIoCardBase) GetSku() string {
if o == nil || o.Sku == nil {
var ret string
return ret
}
return *o.Sku
} | [
-0.0100511834025383,
0.39277002215385437,
0.15222600102424622,
1.6893142461776733,
-0.7283183336257935,
-1.0476500988006592,
0.8333260416984558,
-0.22110699117183685,
0.792817234992981,
-0.9299697875976562,
0.4696425795555115,
-0.6468068361282349,
0.046143367886543274,
0.707939863204956,
... |
func (o *EquipmentIoCardBase) GetSkuOk() (*string, bool) {
if o == nil || o.Sku == nil {
return nil, false
}
return o.Sku, true
} | [
-0.08578520268201828,
0.41534820199012756,
0.4169011414051056,
1.570734977722168,
-0.3020645081996918,
-0.13375940918922424,
0.3936006724834442,
0.6587415933609009,
0.5657092928886414,
0.620642364025116,
-0.4553071856498718,
-0.5940336585044861,
0.6384587287902832,
-0.12635070085525513,
... |
func (o *EquipmentIoCardBase) HasSku() bool {
if o != nil && o.Sku != nil {
return true
}
return false
} | [
0.37849828600883484,
0.512076199054718,
0.33404773473739624,
0.8542100787162781,
0.44175979495048523,
-0.9777672290802002,
-0.03685598820447922,
1.0180652141571045,
0.38552239537239075,
-0.7425587177276611,
-0.32390961050987244,
-0.6469345092773438,
0.07783237844705582,
0.2765015661716461,... |
func (o *EquipmentIoCardBase) SetSku(v string) {
o.Sku = &v
} | [
0.15181609988212585,
0.16817530989646912,
-0.31668245792388916,
0.8255406618118286,
-0.9796342253684998,
-1.093988060951233,
-0.24284812808036804,
-0.5900400280952454,
-0.18348129093647003,
-0.3252907991409302,
-0.04410022497177124,
1.261683464050293,
0.458645224571228,
-0.5395739078521729... |
func (o *EquipmentIoCardBase) GetVersion() string {
if o == nil || o.Version == nil {
var ret string
return ret
}
return *o.Version
} | [
0.6682978868484497,
-0.03256579488515854,
0.08765847235918045,
1.2932324409484863,
0.4463413953781128,
-0.11991177499294281,
1.2949174642562866,
-0.4084174335002899,
0.7423039674758911,
-0.10348266363143921,
-0.3588580787181854,
-1.844332218170166,
-0.5271076560020447,
0.30154716968536377,... |
func (o *EquipmentIoCardBase) GetVersionOk() (*string, bool) {
if o == nil || o.Version == nil {
return nil, false
}
return o.Version, true
} | [
0.19988766312599182,
-0.4230442941188812,
0.23832091689109802,
1.3022247552871704,
0.07275761663913727,
0.32437071204185486,
0.8514106273651123,
0.3900723159313202,
-0.10086984187364578,
1.4407331943511963,
-1.2672791481018066,
-1.3141816854476929,
0.2755453884601593,
0.295875608921051,
... |
func (o *EquipmentIoCardBase) HasVersion() bool {
if o != nil && o.Version != nil {
return true
}
return false
} | [
0.5202745199203491,
-0.21402442455291748,
0.14543545246124268,
1.1513034105300903,
0.8656101822853088,
-0.03891516476869583,
0.5062755942344666,
0.8561956286430359,
0.12391393631696701,
-0.096363864839077,
-0.9306616187095642,
-1.7329931259155273,
-0.3307713270187378,
-0.07577932626008987,... |
func (o *EquipmentIoCardBase) SetVersion(v string) {
o.Version = &v
} | [
0.32601305842399597,
-0.39384278655052185,
-0.22041814029216766,
0.5891991853713989,
-0.23674540221691132,
-0.23259517550468445,
-0.2070370614528656,
-0.6644122004508972,
-0.3814300298690796,
0.3662264049053192,
-0.6487410068511963,
0.009194642305374146,
-0.30566155910491943,
-0.6977463960... |
func (o *EquipmentIoCardBase) GetVid() string {
if o == nil || o.Vid == nil {
var ret string
return ret
}
return *o.Vid
} | [
0.6085221767425537,
-0.3495941162109375,
0.1267714947462082,
1.3094911575317383,
-0.04012303426861763,
-0.28799372911453247,
1.2014188766479492,
-0.5945947170257568,
1.1301134824752808,
-0.9102053642272949,
-0.00868622213602066,
-0.6184954643249512,
-0.5160754919052124,
-0.0239282157272100... |
func (o *EquipmentIoCardBase) GetVidOk() (*string, bool) {
if o == nil || o.Vid == nil {
return nil, false
}
return o.Vid, true
} | [
0.657244086265564,
-0.6845173239707947,
0.31672897934913635,
1.2916593551635742,
-0.08234816044569016,
-0.3165488541126251,
0.8051658868789673,
0.3089616000652313,
0.8431553244590759,
0.517701268196106,
-0.8045555353164673,
0.08765731751918793,
0.0775352492928505,
-0.08703792840242386,
-... |
func (o *EquipmentIoCardBase) HasVid() bool {
if o != nil && o.Vid != nil {
return true
}
return false
} | [
0.7258899807929993,
-0.31784969568252563,
0.16972582042217255,
1.1024296283721924,
0.524707555770874,
-0.3754884898662567,
0.1937503069639206,
0.32111796736717224,
0.591687798500061,
-1.0503032207489014,
-0.5072926878929138,
-0.37072762846946716,
-0.2201002687215805,
0.014044529758393764,
... |
func (o *EquipmentIoCardBase) SetVid(v string) {
o.Vid = &v
} | [
0.671588122844696,
-0.7306273579597473,
-0.328277051448822,
0.3593941032886505,
-0.6646450757980347,
-0.14334829151630402,
-0.5494531393051147,
-0.8884714841842651,
0.13085302710533142,
-0.21101824939250946,
-0.09938420355319977,
0.8300337195396423,
-0.037333693355321884,
-1.27747178077697... |
func (o *EquipmentIoCardBase) GetHostPorts() []EtherHostPortRelationship {
if o == nil {
var ret []EtherHostPortRelationship
return ret
}
return o.HostPorts
} | [
0.7027603387832642,
0.2504569888114929,
0.3438510596752167,
1.3651138544082642,
0.8480039834976196,
0.568523108959198,
0.7474383115768433,
-0.21311785280704498,
0.5997975468635559,
-0.4955577850341797,
-0.6281625628471375,
-0.8499367237091064,
-1.3336844444274902,
-0.0017704559722915292,
... |
func (o *EquipmentIoCardBase) GetHostPortsOk() ([]EtherHostPortRelationship, bool) {
if o == nil || o.HostPorts == nil {
return nil, false
}
return o.HostPorts, true
} | [
0.5745701789855957,
0.6807941794395447,
0.45812880992889404,
1.2429988384246826,
0.3050403594970703,
0.24297113716602325,
0.8017688989639282,
0.4502068758010864,
0.05923254415392876,
0.2854764461517334,
-1.3942415714263916,
-1.337247371673584,
0.1730443686246872,
0.005648396909236908,
-0... |
func (o *EquipmentIoCardBase) HasHostPorts() bool {
if o != nil && o.HostPorts != nil {
return true
}
return false
} | [
1.4466302394866943,
0.45020878314971924,
0.6262186765670776,
0.3332110047340393,
0.544291079044342,
0.14089447259902954,
0.35316339135169983,
0.29989051818847656,
-0.058020636439323425,
-0.54703289270401,
-1.3106437921524048,
-1.8920146226882935,
-0.588977575302124,
0.2596088647842407,
-... |
func (o *EquipmentIoCardBase) SetHostPorts(v []EtherHostPortRelationship) {
o.HostPorts = v
} | [
0.7363017797470093,
-0.024982376024127007,
0.20609809458255768,
0.2647813856601715,
0.5714063048362732,
0.41319313645362854,
0.8373714089393616,
-0.5121697783470154,
-0.04141862317919731,
0.1391061693429947,
-1.0199280977249146,
-0.6543853282928467,
0.03093956597149372,
0.04650507494807243... |
func (o *EquipmentIoCardBase) GetMgmtController() ManagementControllerRelationship {
if o == nil || o.MgmtController == nil {
var ret ManagementControllerRelationship
return ret
}
return *o.MgmtController
} | [
0.7178471684455872,
0.48223474621772766,
0.10727700591087341,
0.42850103974342346,
0.28515753149986267,
-0.09244634956121445,
-0.13167203962802887,
-1.3216369152069092,
1.1339001655578613,
-0.6538258790969849,
0.3056756854057312,
-0.7041975855827332,
-0.8838042616844177,
1.0954513549804688... |
func (o *EquipmentIoCardBase) GetMgmtControllerOk() (*ManagementControllerRelationship, bool) {
if o == nil || o.MgmtController == nil {
return nil, false
}
return o.MgmtController, true
} | [
0.6459492444992065,
0.22487547993659973,
0.19053682684898376,
-0.10356496274471283,
0.22569814324378967,
0.5879152417182922,
0.5142632126808167,
0.034753575921058655,
0.018890030682086945,
0.48417556285858154,
-0.39178144931793213,
-0.13405971229076385,
-0.05628719553351402,
0.991969048976... |
func (o *EquipmentIoCardBase) HasMgmtController() bool {
if o != nil && o.MgmtController != nil {
return true
}
return false
} | [
0.9276190400123596,
0.47524893283843994,
0.4437873661518097,
-0.7380953431129456,
0.7917320728302002,
-0.21091961860656738,
-0.23420506715774536,
-0.30719783902168274,
0.2073327749967575,
-0.6675220131874084,
-0.05287656560540199,
-0.6610379815101624,
-0.10604570060968399,
1.92255985736846... |
func (o *EquipmentIoCardBase) SetMgmtController(v ManagementControllerRelationship) {
o.MgmtController = &v
} | [
0.9205299615859985,
0.10354623198509216,
0.09865310788154602,
-0.5751422047615051,
0.31233030557632446,
0.31743788719177246,
-0.542813777923584,
-1.6279932260513306,
0.33272743225097656,
-0.3370954096317291,
0.6820647120475769,
0.3077532649040222,
-0.0004111174202989787,
0.4978610873222351... |
func (o *EquipmentIoCardBase) GetNetworkPorts() []EtherNetworkPortRelationship {
if o == nil {
var ret []EtherNetworkPortRelationship
return ret
}
return o.NetworkPorts
} | [
0.0027326031122356653,
0.33262455463409424,
0.25454819202423096,
0.6783037185668945,
0.5364543795585632,
0.22305689752101898,
0.7626092433929443,
-1.3160651922225952,
1.3631339073181152,
-0.5862518548965454,
-1.4046299457550049,
-1.4564179182052612,
-1.3057000637054443,
0.3909982740879059,... |
func (o *EquipmentIoCardBase) GetNetworkPortsOk() ([]EtherNetworkPortRelationship, bool) {
if o == nil || o.NetworkPorts == nil {
return nil, false
}
return o.NetworkPorts, true
} | [
0.5451251268386841,
0.15238063037395477,
0.4614674746990204,
0.17494910955429077,
-0.2873188555240631,
0.03677547723054886,
1.1103554964065552,
-1.0850002765655518,
0.5912915468215942,
1.0331103801727295,
-1.9703724384307861,
-1.7902653217315674,
-0.36570000648498535,
0.6159998774528503,
... |
func (o *EquipmentIoCardBase) HasNetworkPorts() bool {
if o != nil && o.NetworkPorts != nil {
return true
}
return false
} | [
0.769775927066803,
0.652191698551178,
0.24976417422294617,
-0.3370722532272339,
0.7938879132270813,
-0.584480881690979,
0.29649817943573,
-0.9946885108947754,
0.17974476516246796,
-0.1821502149105072,
-1.5292681455612183,
-2.556694507598877,
-0.9092110395431519,
0.7621986269950867,
-0.23... |
func (o *EquipmentIoCardBase) SetNetworkPorts(v []EtherNetworkPortRelationship) {
o.NetworkPorts = v
} | [
-0.06301926076412201,
0.034976858645677567,
0.14776749908924103,
-0.006035245023667812,
0.42452743649482727,
0.3489782512187958,
0.5888261795043945,
-1.6875077486038208,
0.9302434325218201,
0.3322499096393585,
-1.285319209098816,
-1.4875965118408203,
-0.8676018118858337,
0.3284678757190704... |
func NewPolledList(ctx context.Context, client pb.JournalClient, dur time.Duration, req pb.ListRequest) (*PolledList, error) {
var resp, err = ListAllJournals(ctx, client, req)
if err != nil {
return nil, err
}
var pl = &PolledList{
ctx: ctx,
client: client,
req: req,
updateCh: make(chan struc... | [
-0.3426022231578827,
-0.7531073689460754,
0.19284850358963013,
0.10596303641796112,
-0.5030728578567505,
0.07810115069150925,
-1.2072227001190186,
0.16706041991710663,
0.4963163733482361,
0.07785354554653168,
-0.4864664077758789,
-0.01695939339697361,
-0.7607871890068054,
0.829750478267669... |
func (pl *PolledList) List() *pb.ListResponse { return pl.resp.Load().(*pb.ListResponse) } | [
-0.12221325188875198,
-1.2832633256912231,
0.2621021270751953,
-0.2368040233850479,
0.3452813923358917,
-0.1373661309480667,
-0.8775429725646973,
0.6220517754554749,
1.441308617591858,
0.2657461166381836,
-1.0915052890777588,
-1.4036331176757812,
-1.1894543170928955,
0.47840917110443115,
... |
func (pl *PolledList) UpdateCh() <-chan struct{} { return pl.updateCh } | [
-0.552099883556366,
-0.6951389908790588,
0.5086559057235718,
0.48841893672943115,
-0.6572691202163696,
1.40086030960083,
0.042262766510248184,
-0.141665518283844,
-0.01826900988817215,
0.3100748360157013,
-0.418795108795166,
0.39706140756607056,
-0.7969072461128235,
0.12939059734344482,
... |
func ListAllJournals(ctx context.Context, client pb.JournalClient, req pb.ListRequest) (*pb.ListResponse, error) {
var resp *pb.ListResponse
for {
// List RPCs may be dispatched to any broker.
if r, err := client.List(pb.WithDispatchDefault(ctx), &req, grpc.FailFast(false)); err != nil {
return resp, mapGRPCC... | [
-0.4506811499595642,
-0.8234395384788513,
0.6785410046577454,
-0.44076910614967346,
0.22315150499343872,
-0.6478601098060608,
-0.632889449596405,
-0.1267271488904953,
0.8210755586624146,
0.498715877532959,
0.25198599696159363,
0.19525641202926636,
-1.1699104309082031,
0.9091498255729675,
... |
func ApplyJournals(ctx context.Context, jc pb.JournalClient, req *pb.ApplyRequest) (*pb.ApplyResponse, error) {
return ApplyJournalsInBatches(ctx, jc, req, 0)
} | [
-0.5861634016036987,
0.19329231977462769,
0.25332382321357727,
0.14571356773376465,
-0.4665781855583191,
-0.1971205174922943,
-0.20526285469532013,
0.17298640310764313,
0.9354743361473083,
-0.6809807419776917,
0.2586762607097626,
0.09556552022695541,
-1.2744776010513306,
1.0579607486724854... |
func ApplyJournalsInBatches(ctx context.Context, jc pb.JournalClient, req *pb.ApplyRequest, size int) (*pb.ApplyResponse, error) {
if len(req.Changes) == 0 {
return &pb.ApplyResponse{}, nil
}
if size == 0 {
size = len(req.Changes)
}
var curReq = &pb.ApplyRequest{}
var offset = 0
for {
if len(req.Changes[o... | [
0.02442547306418419,
-0.3057529330253601,
0.7529754638671875,
-0.557002067565918,
-0.984166145324707,
0.027694031596183777,
-0.278381884098053,
-0.3208540678024292,
0.5228850245475769,
-0.3644348978996277,
-0.05946468189358711,
0.11093427985906601,
-1.2055621147155762,
0.5957787036895752,
... |
func ListAllFragments(ctx context.Context, client pb.RoutedJournalClient, req pb.FragmentsRequest) (*pb.FragmentsResponse, error) {
var resp *pb.FragmentsResponse
var routedCtx = pb.WithDispatchItemRoute(ctx, client, req.Journal.String(), false)
for {
if r, err := client.ListFragments(routedCtx, &req); err != nil... | [
-0.7291958928108215,
-0.4221591055393219,
0.7348147630691528,
-0.048377130180597305,
-0.1710655242204666,
-0.8354564309120178,
-0.0821828693151474,
-0.3434789478778839,
1.0544958114624023,
-0.3761345446109772,
0.2781536877155304,
-0.11755410581827164,
-1.4364681243896484,
0.589660942554473... |
func Go(f func() error) chan error {
ch := make(chan error)
go func() {
ch <- f()
}()
return ch
} | [
0.2986203730106354,
1.018358588218689,
0.5182191729545593,
-0.34504434466362,
0.32742953300476074,
0.03543876111507416,
-0.010783202014863491,
-0.212568998336792,
-0.9838661551475525,
0.09068376570940018,
0.03509240597486496,
1.4202332496643066,
1.1194298267364502,
-0.2463352531194687,
-... |
func IsExist(path string) bool {
_, err := os.Stat(path)
return err == nil || os.IsExist(err)
} | [
0.015614759176969528,
-0.22865813970565796,
0.768765926361084,
0.6715002655982971,
0.6908060312271118,
0.2622131109237671,
-0.210099458694458,
0.29177168011665344,
0.49290192127227783,
0.496816486120224,
0.2025848627090454,
-0.4091784358024597,
-0.2923057973384857,
0.7507951259613037,
-0... |
func GetGOPATHs() []string {
gopath := os.Getenv("GOPATH")
if gopath == "" && strings.Compare(runtime.Version(), "go1.8") >= 0 {
gopath = defaultGOPATH()
}
return filepath.SplitList(gopath)
} | [
-0.9575048685073853,
0.996770441532135,
0.647387683391571,
1.555008888244629,
0.763554036617279,
0.6096892356872559,
-0.06050462648272514,
0.19066189229488373,
-0.6718948483467102,
1.3848062753677368,
-0.37195640802383423,
-0.001856015296652913,
-1.4306612014770508,
0.4221990704536438,
0... |
func IsInGOPATH(thePath string) bool {
for _, gopath := range GetGOPATHs() {
if strings.Contains(thePath, filepath.Join(gopath, "src")) {
return true
}
}
return false
} | [
-0.4979715049266815,
0.4125056564807892,
0.5093955397605896,
0.4987800121307373,
0.4351370930671692,
0.3935871720314026,
-0.11463968455791473,
0.21201521158218384,
-0.04195196181535721,
0.8701109290122986,
-0.36081185936927795,
-0.3602873682975769,
-1.2394652366638184,
0.06015041097998619,... |
func IsBeegoProject(thePath string) bool {
mainFiles := []string{}
hasBeegoRegex := regexp.MustCompile(`(?s)package main.*?import.*?\(.*?github.com/beego/beego/v2".*?\).*func main()`)
c := make(chan error)
// Walk the application path tree to look for main files.
// Main files must satisfy the 'hasBeegoRegex' regu... | [
0.04561556503176689,
0.496026873588562,
1.0304204225540161,
-0.11989952623844147,
0.3233564496040344,
0.3327474594116211,
0.6246906518936157,
0.4132404625415802,
-0.577060878276825,
0.3483000695705414,
-0.10318783670663834,
-0.2479087859392166,
-0.6220675110816956,
0.4875873029232025,
-1... |
func SearchGOPATHs(app string) (bool, string, string) {
gps := GetGOPATHs()
if len(gps) == 0 {
beeLogger.Log.Fatal("GOPATH environment variable is not set or empty")
}
// Lookup the application inside the user workspace(s)
for _, gopath := range gps {
var currentPath string
if !strings.Contains(app, "src")... | [
-0.846356987953186,
0.3435867130756378,
0.7702383399009705,
-0.07601332664489746,
0.364705890417099,
1.1596354246139526,
0.013310063630342484,
-0.44234639406204224,
-0.4007704555988312,
1.2628000974655151,
-0.14891661703586578,
-0.7797204852104187,
-0.9702815413475037,
0.5749682188034058,
... |
func AskForConfirmation() bool {
var response string
_, err := fmt.Scanln(&response)
if err != nil {
beeLogger.Log.Fatalf("%s", err)
}
okayResponses := []string{"y", "Y", "yes", "Yes", "YES"}
nokayResponses := []string{"n", "N", "no", "No", "NO"}
if containsString(okayResponses, response) {
return true
} el... | [
-0.49625033140182495,
-0.43550941348075867,
0.5439730882644653,
0.21533921360969543,
-0.33222708106040955,
-0.23156599700450897,
0.4758245646953583,
-0.6264892220497131,
-0.16972918808460236,
-0.8287433385848999,
-0.20040686428546906,
-0.8425057530403137,
-0.0465753898024559,
1.32754087448... |
func SnakeString(s string) string {
data := make([]byte, 0, len(s)*2)
j := false
num := len(s)
for i := 0; i < num; i++ {
d := s[i]
if i > 0 && d >= 'A' && d <= 'Z' && j {
data = append(data, '_')
}
if d != '_' {
j = true
}
data = append(data, d)
}
return strings.ToLower(string(data[:]))
} | [
-0.3342684209346771,
-0.2869032323360443,
0.6551723480224609,
-1.4282788038253784,
-0.7015343904495239,
-0.21559062600135803,
-0.07995866984128952,
-0.7657376527786255,
0.1692541390657425,
0.8298916220664978,
-0.6477441787719727,
0.7307559847831726,
-0.13861966133117676,
-0.406827896833419... |
func CamelCase(in string) string {
tokens := strings.Split(in, "_")
for i := range tokens {
tokens[i] = strings.Title(strings.Trim(tokens[i], " "))
}
return strings.Join(tokens, "")
} | [
-0.4343840777873993,
-0.5790048837661743,
0.5986887812614441,
-0.9397454857826233,
-0.6469281911849976,
0.14245642721652985,
-1.0250520706176758,
0.3279602527618408,
0.1260051131248474,
1.1393483877182007,
-0.3444812595844269,
-0.35256490111351013,
0.14723505079746246,
-1.0529963970184326,... |
func FormatSourceCode(filename string) {
cmd := exec.Command("gofmt", "-w", filename)
if err := cmd.Run(); err != nil {
beeLogger.Log.Warnf("Error while running gofmt: %s", err)
}
} | [
-0.18196649849414825,
-0.49765998125076294,
0.5512468814849854,
-0.6970030069351196,
0.8829023241996765,
-0.3304212987422943,
0.6571756601333618,
0.5624844431877136,
-0.2158270925283432,
0.7361524701118469,
0.7884025573730469,
0.6495142579078674,
0.05058027431368828,
1.7239999771118164,
... |
func CloseFile(f *os.File) {
err := f.Close()
MustCheck(err)
} | [
0.4468652307987213,
0.8450467586517334,
0.41539424657821655,
0.8254285454750061,
0.47217580676078796,
1.7223796844482422,
0.7294921278953552,
-0.240942120552063,
-0.8300708532333374,
-0.7325223684310913,
1.2319055795669556,
-0.8522416949272156,
0.24621257185935974,
1.11125648021698,
-0.0... |
func MustCheck(err error) {
if err != nil {
panic(err)
}
} | [
0.3589686155319214,
0.534687876701355,
0.07360781729221344,
1.6259183883666992,
0.018898144364356995,
1.1463470458984375,
-0.6501814126968384,
0.20581117272377014,
0.9314199090003967,
0.39429718255996704,
0.26759687066078186,
0.5905013680458069,
0.5928346514701843,
1.1054109334945679,
0.... |
func WriteToFile(filename, content string) {
f, err := os.Create(filename)
MustCheck(err)
defer CloseFile(f)
_, err = f.WriteString(content)
MustCheck(err)
} | [
0.5647425651550293,
-0.2592431604862213,
0.07243592292070389,
-0.009774371050298214,
1.291584849357605,
0.6418926119804382,
0.14723911881446838,
0.021490225568413734,
-1.557795524597168,
0.3921806812286377,
0.09789865463972092,
-0.4046861231327057,
-0.4177769124507904,
-0.8544797897338867,... |
func FILE() string {
_, file, _, _ := runtime.Caller(1)
return file
} | [
-0.2995052635669708,
-0.3873095214366913,
0.6760554313659668,
0.8101451992988586,
-0.21528717875480652,
0.5351874232292175,
0.7898169755935669,
-0.666373074054718,
-1.0865161418914795,
-0.8073692917823792,
0.13269387185573578,
-0.03725101053714752,
0.08297605812549591,
1.1945841312408447,
... |
func LINE() int {
_, _, line, _ := runtime.Caller(1)
return line
} | [
-0.5166541337966919,
0.4644801914691925,
0.4377709925174713,
1.003557562828064,
0.4521665871143341,
-0.061296865344047546,
0.6350297927856445,
-0.42053788900375366,
-0.7864840626716614,
-1.4204177856445312,
-0.6480086445808411,
0.04250430315732956,
-1.1566603183746338,
1.1452367305755615,
... |
func BeeFuncMap() template.FuncMap {
return template.FuncMap{
"trim": strings.TrimSpace,
"bold": colors.Bold,
"headline": colors.MagentaBold,
"foldername": colors.RedBold,
"endline": EndLine,
"tmpltostr": TmplToString,
}
} | [
-0.66521817445755,
-1.034325361251831,
0.425987184047699,
-0.715270459651947,
-0.0037691446486860514,
-1.217578411102295,
0.22221694886684418,
0.08254697173833847,
-0.09498325735330582,
-1.0766186714172363,
-0.9045861959457397,
0.8507384657859802,
0.26719802618026733,
0.651125967502594,
... |
func TmplToString(tmpl string, data interface{}) string {
t := template.New("tmpl").Funcs(BeeFuncMap())
template.Must(t.Parse(tmpl))
var doc bytes.Buffer
err := t.Execute(&doc, data)
MustCheck(err)
return doc.String()
} | [
-0.3963896930217743,
-0.30408844351768494,
0.16383560001850128,
-1.1880854368209839,
-0.7589345574378967,
-0.33719804883003235,
-0.6613948345184326,
-0.555025041103363,
-0.5169926881790161,
0.05479329079389572,
-0.9118316173553467,
-0.45691725611686707,
-0.17612934112548828,
-0.33044135570... |
func EndLine() string {
return "\n"
} | [
0.41969579458236694,
-0.5903709530830383,
0.2549819350242615,
-0.004329626448452473,
0.26493367552757263,
0.8079807162284851,
-1.3235310316085815,
0.15369828045368195,
-0.20457802712917328,
-0.9617249965667725,
-0.4191647469997406,
-0.21428456902503967,
-0.9179611802101135,
0.3882761299610... |
func GoCommand(command string, args ...string) error {
allargs := []string{command}
allargs = append(allargs, args...)
goBuild := exec.Command("go", allargs...)
goBuild.Stderr = os.Stderr
return goBuild.Run()
} | [
-0.07924866676330566,
-0.05648559704422951,
0.564881443977356,
0.02502070739865303,
1.4112539291381836,
1.074537754058838,
-0.5268115997314453,
0.49171021580696106,
-0.190977543592453,
-0.09533047676086426,
-0.19502617418766022,
1.4029518365859985,
-0.38087111711502075,
0.7518367767333984,... |
func SplitQuotedFields(in string) []string {
type stateEnum int
const (
inSpace stateEnum = iota
inField
inQuote
inQuoteEscaped
)
state := inSpace
r := []string{}
var buf bytes.Buffer
for _, ch := range in {
switch state {
case inSpace:
if ch == '\'' {
state = inQuote
} else if !unicode.Is... | [
-0.730991542339325,
-0.5004982948303223,
0.40209999680519104,
-0.6714573502540588,
0.38363659381866455,
-0.14687956869602203,
-0.15938866138458252,
-0.06363428384065628,
0.12810593843460083,
0.5207951664924622,
-0.8777534365653992,
0.9037445187568665,
-1.5127030611038208,
-0.35820218920707... |
func GetFileModTime(path string) int64 {
path = strings.Replace(path, "\\", "/", -1)
f, err := os.Open(path)
if err != nil {
beeLogger.Log.Errorf("Failed to open file on '%s': %s", path, err)
return time.Now().Unix()
}
defer f.Close()
fi, err := f.Stat()
if err != nil {
beeLogger.Log.Errorf("Failed to get... | [
-0.6856049299240112,
-0.5480650663375854,
0.8078715801239014,
-0.8043691515922546,
-0.2158678025007248,
-0.42631855607032776,
0.013882291503250599,
0.48340854048728943,
-0.2929893136024475,
0.16493777930736542,
0.13573898375034332,
-0.12993918359279633,
-0.1420913189649582,
1.2227129936218... |
func BeeReposInfo() (repos Repos) {
var url = "https://api.github.com/repos/beego/bee"
resp, err := http.Get(url)
if err != nil {
beeLogger.Log.Warnf("Get bee repos from github error: %s", err)
return
}
defer resp.Body.Close()
bodyContent, _ := ioutil.ReadAll(resp.Body)
if err = json.Unmarshal(bodyContent, &... | [
-0.8087212443351746,
-0.3434101939201355,
0.5250089168548584,
-0.9216635823249817,
0.11943025141954422,
-0.41110751032829285,
-0.747390866279602,
0.28533491492271423,
-0.25941893458366394,
0.623325765132904,
-0.7987314462661743,
0.011099066585302353,
-0.03612320497632027,
-0.24514749646186... |
func BeeReleasesInfo() (repos []Releases) {
var url = "https://api.github.com/repos/beego/bee/releases"
resp, err := http.Get(url)
if err != nil {
beeLogger.Log.Warnf("Get bee releases from github error: %s", err)
return
}
defer resp.Body.Close()
bodyContent, _ := ioutil.ReadAll(resp.Body)
if err = json.Unma... | [
-0.4927709400653839,
-0.39396408200263977,
0.32328328490257263,
-0.9351575374603271,
0.16930432617664337,
-0.448243111371994,
-0.950237512588501,
-0.043351199477910995,
-0.5376984477043152,
0.8517422676086426,
-0.5702283382415771,
0.2360248565673828,
-0.293689489364624,
0.3709345757961273,... |
func UpdateLastPublishedTime() {
info := BeeReleasesInfo()
if len(info) == 0 {
beeLogger.Log.Warn("Has no releases")
return
}
createdAt := info[0].PublishedAt.Format("2006-01-02")
beeHome := system.BeegoHome
if !IsExist(beeHome) {
if err := os.MkdirAll(beeHome, 0755); err != nil {
beeLogger.Log.Fatalf("C... | [
-0.030404092743992805,
-1.2515124082565308,
0.6967644095420837,
-0.8126476407051086,
0.41705527901649475,
0.32610392570495605,
0.18396827578544617,
0.6973936557769775,
-0.27731794118881226,
0.3179877996444702,
-0.16934801638126373,
-0.41531622409820557,
-0.2410457283258438,
0.7849380373954... |
func (u *PageType) Scan(value interface{}) error { *u = PageType(value.(int64)); return nil } | [
-0.9441542625427246,
0.8293558359146118,
0.25253885984420776,
0.729320764541626,
-0.5811254382133484,
0.21098312735557556,
0.004483263939619064,
-0.8565205931663513,
0.5357682108879089,
-0.7116570472717285,
-0.3636663854122162,
0.18337996304035187,
-0.19095906615257263,
1.060891032218933,
... |
func (u PageType) Value() (driver.Value, error) { return int64(u), nil } | [
-0.7534422278404236,
0.40060076117515564,
0.5040483474731445,
0.8621237277984619,
0.9480141401290894,
0.0950108990073204,
0.3187980353832245,
-0.47256946563720703,
0.8121636509895325,
0.6183850765228271,
0.20094650983810425,
0.1835334748029709,
-0.7487679123878479,
1.0457707643508911,
0.... |
func (m *Model) FindPage(id uint, ptype PageType) *Page {
var page Page
res := m.Db.First(&page, " id = ? and type = ? ", id, ptype)
if res.Error != nil {
return nil
}
return &page
} | [
0.14157070219516754,
0.16841067373752594,
0.44468504190444946,
0.2320699840784073,
0.8106095790863037,
0.33593833446502686,
-0.7325551509857178,
-1.3474416732788086,
-0.3704691529273987,
1.1990525722503662,
1.13531494140625,
-0.5254829525947571,
-1.9559003114700317,
1.1470129489898682,
0... |
func InitializeReplicaCreation(restclient *rest.RESTClient, clusterName,
namespace string) error {
pgreplicaList := &crv1.PgreplicaList{}
selector := config.LABEL_PG_CLUSTER + "=" + clusterName
err := kubeapi.GetpgreplicasBySelector(restclient, pgreplicaList, selector, namespace)
if err != nil {
log.Error(err)
... | [
-0.6357378959655762,
0.4787753224372864,
0.7627214193344116,
-0.029452694579958916,
0.04785953834652901,
-0.024295078590512276,
-0.38945677876472473,
0.57832270860672,
-0.6402448415756226,
1.0142933130264282,
-0.6151188015937805,
0.9322226047515869,
-0.7584431171417236,
0.6000333428382874,... |
func SetClusterInitializedStatus(restclient *rest.RESTClient, clusterName,
namespace string) error {
cluster := crv1.Pgcluster{}
if _, err := kubeapi.Getpgcluster(restclient, &cluster, clusterName,
namespace); err != nil {
log.Error(err)
return err
}
message := "Cluster has been initialized"
if err := kube... | [
-0.33849042654037476,
-0.6115550994873047,
0.5096925497055054,
-0.5257415175437927,
0.5074594020843506,
0.4164072573184967,
-0.2540062367916107,
0.5267968773841858,
0.04262203723192215,
-0.11264197528362274,
-1.0394843816757202,
1.1367583274841309,
-0.8407241702079773,
0.18631714582443237,... |
func Run(isNonInitCmd bool) error {
// check if policy paths exist
if path, err := os.Stat(config.GetPolicyRepoPath()); err == nil && path.IsDir() {
if isNonInitCmd {
return nil
}
}
zap.S().Debug("initializing terrascan")
if !connected(terrascanReadmeURL) {
return errNoConnection
}
// download polici... | [
0.3228961229324341,
-0.6260336637496948,
0.6918008327484131,
-0.0017579005798324943,
0.7115488052368164,
0.8187205791473389,
0.5148581266403198,
0.04307212680578232,
0.3409334421157837,
0.20987072587013245,
0.19480696320533752,
-0.5438622236251831,
-0.1557849496603012,
0.703927755355835,
... |
func DownloadPolicies() error {
policyBasePath := config.GetPolicyBasePath()
repoURL := config.GetPolicyRepoURL()
branch := config.GetPolicyBranch()
zap.S().Debug("downloading policies")
zap.S().Debugf("base directory path : %s", policyBasePath)
zap.S().Debugf("policy directory path : %s", config.GetPolicyRepo... | [
0.9672877788543701,
-0.03648499399423599,
0.548734724521637,
-0.6220963001251221,
0.533595085144043,
0.955704391002655,
0.11135992407798767,
-0.47085559368133545,
0.49974051117897034,
0.9208033680915833,
0.48421406745910645,
0.24613149464130402,
-0.3684347867965698,
0.4758630096912384,
0... |
func (c *Client) AuthenticateURL(state string, scopes ...string) string {
u := url.Values{
"response_type": {"code"},
"redirect_uri": {c.callbackURL},
"client_id": {c.clientID},
"scope": {strings.Join(scopes, " ")},
"state": {state},
}
return fmt.Sprintf("%s?%s", c.discovery.Authoriza... | [
-0.14106722176074982,
0.04905767738819122,
0.46287816762924194,
0.43567559123039246,
0.13121099770069122,
-0.18187688291072845,
-0.14134547114372253,
0.07436787337064743,
1.1805628538131714,
0.483739972114563,
0.3210802376270294,
0.35496199131011963,
0.3171866536140442,
-0.2960624694824219... |
func (c *Client) ExchangeCode(ctx context.Context, code string) (result ExchangeCodeResponse, err error) {
v := url.Values{
"grant_type": {"authorization_code"},
"code": {code},
}
req, err := http.NewRequestWithContext(ctx, "POST", c.discovery.TokenEndpoint, strings.NewReader(v.Encode()))
if err != nil {... | [
-0.478935182094574,
0.39817488193511963,
0.6999552845954895,
-0.5598486065864563,
-0.0058413478545844555,
-0.8767451047897339,
-0.5958941578865051,
-0.09920428693294525,
0.8581504821777344,
0.48857977986335754,
-0.005738494452089071,
1.055514931678772,
-0.5636544823646545,
0.13474623858928... |
func (c *Client) RevokeToken(ctx context.Context, refreshToken string) error {
v := url.Values{
"token_type_hint": {"refresh_token"},
"token": {refreshToken},
}
req, err := http.NewRequestWithContext(ctx, "POST", c.discovery.RevocationEndpoint, strings.NewReader(v.Encode()))
if err != nil {
return ... | [
0.6243683099746704,
-0.06070731207728386,
0.5551668405532837,
0.1680520921945572,
0.1723531186580658,
0.07547096163034439,
-0.5882807374000549,
-0.4280814826488495,
0.5928786396980286,
-0.8840609192848206,
-0.42283886671066284,
1.1641123294830322,
0.11332979053258896,
-0.11017854511737823,... |
func (c *Client) GetCharacterDetails(t *jwt.Token) (characterID int, characterName string, err error) {
claims, ok := t.Claims.(jwt.MapClaims)
if !ok {
return 0, "", errors.New("provided token claims could not be mapped")
}
sub, ok := claims["sub"].(string)
if !ok {
return 0, "", errors.New("sub claim of JWT ... | [
-0.23391097784042358,
-1.344539999961853,
0.6780310273170471,
-0.9371393322944641,
-0.6726443767547607,
0.3433022201061249,
-0.8599749207496643,
-0.43741413950920105,
0.07029447704553604,
0.13940609991550446,
-1.1069653034210205,
1.3129667043685913,
0.08753525465726852,
0.5268520712852478,... |
func (c *Client) ParseToken(ctx context.Context, token string) (*jwt.Token, error) {
parsedToken, err := jwt.Parse(token, func(t *jwt.Token) (interface{}, error) {
var err error
if c.keySet == nil {
c.keySet, err = jwk.Fetch(ctx, c.discovery.JwksURI, jwk.WithHTTPClient(c.httpClient))
if err != nil {
ret... | [
0.45124173164367676,
-0.638801634311676,
0.7518110275268555,
-0.6918694376945496,
-0.8762871026992798,
-0.20697760581970215,
-0.2924154996871948,
-0.4964463710784912,
0.3008778393268585,
-0.33553820848464966,
0.170810729265213,
0.8906505107879639,
0.19687063992023468,
0.21431046724319458,
... |
func (c *Client) getAuthHeaderValue() string {
var buf bytes.Buffer
fmt.Fprintf(&buf, "%s:%s", c.clientID, c.clientSecret)
return base64.StdEncoding.EncodeToString(buf.Bytes())
} | [
-0.04806103557348251,
-0.8541418313980103,
0.5587878823280334,
-0.6770576238632202,
-0.5620442032814026,
0.4459307789802551,
-0.35089874267578125,
-0.5663444995880127,
-0.544503927230835,
0.1778429001569748,
0.033701397478580475,
1.446932315826416,
-0.049163661897182465,
-0.179844573140144... |
func isValidSecret(secret *v1.Secret) (bool, error) {
switch secret.Type {
// We will accept TLS secrets that also have the 'ca.crt' payload.
case v1.SecretTypeTLS:
data, ok := secret.Data[v1.TLSCertKey]
if !ok {
return false, errors.New("missing TLS certificate")
}
if err := validateCertificate(data); e... | [
-0.4888182580471039,
0.09421255439519882,
0.7638076543807983,
0.2784341275691986,
-1.0431993007659912,
0.10578544437885284,
-0.37704116106033325,
-0.6133049726486206,
-0.2966187000274658,
0.398148775100708,
-0.49538788199424744,
0.02248399890959263,
-0.18473559617996216,
0.977154016494751,... |
func containsPEMHeader(data []byte) bool {
// A PEM header starts with the begin token.
start := bytes.Index(data, []byte("-----BEGIN"))
if start == -1 {
return false
}
// And ends with the end token.
end := bytes.Index(data[start+10:], []byte("-----"))
if end == -1 {
return false
}
// And must be on a s... | [
0.11928986012935638,
-0.6729080677032471,
0.6759480834007263,
-0.3950625956058502,
-0.6957027912139893,
-0.12437617033720016,
-0.6911233067512512,
0.060945864766836166,
0.20913773775100708,
-0.0024934422690421343,
-0.570514440536499,
0.16886180639266968,
-1.2898402214050293,
0.446306169033... |
func NewLocationHandlers() *LocationHandler {
return &LocationHandler{locRepo: NewLocationRepo()}
} | [
0.2740687131881714,
-0.885982871055603,
0.05674199014902115,
0.49384886026382446,
-0.46220457553863525,
0.11324326694011688,
-0.0367053784430027,
0.1342075616121292,
0.3182125687599182,
-0.10928678512573242,
-0.721315324306488,
-0.8976725339889526,
-0.6174271702766418,
-0.6450478434562683,... |
func (h *LocationHandler) show(w http.ResponseWriter, r *http.Request) {
vars := mux.Vars(r)
id, err := strconv.Atoi(vars["locationId"])
if err != nil {
RespondWithError(w, http.StatusBadRequest, "Invalid ID")
return
}
location, err := h.locRepo.getLocation(id)
if err != nil {
RespondWithError(w, http.Statu... | [
-0.4218810796737671,
-0.5595459342002869,
0.40001580119132996,
-0.6074301600456238,
-0.6844789981842041,
0.0664263367652893,
0.37654075026512146,
0.6719321608543396,
0.1323891133069992,
0.5357869863510132,
0.48546528816223145,
0.1170666515827179,
0.060131680220365524,
0.2173561155796051,
... |
func (h *LocationHandler) update(w http.ResponseWriter, r *http.Request) {
var location Location
decoder := json.NewDecoder(r.Body)
if err := decoder.Decode(&location); err != nil {
RespondWithError(w, http.StatusBadRequest, "Invalid Location Data")
return
}
if err := h.locRepo.updateLocation(&location); err ... | [
-0.8726375102996826,
-1.302721381187439,
0.6597599387168884,
-0.41684359312057495,
-0.4844357967376709,
0.7032551765441895,
-0.4310702383518219,
0.51856929063797,
0.05670373886823654,
0.20649532973766327,
0.2548392713069916,
-0.7798829674720764,
-0.37070658802986145,
-0.3324529230594635,
... |
func NewCluster(name string, newGroup NewGroup, raftBind, raftDir string) *Cluster {
slots := make(map[int]*Slot, SlotNum)
for i := 0; i < SlotNum; i++ {
slots[i] = NewSlot(i, SlotStateOffline, nil, nil)
}
return &Cluster{
name: name,
slots: slots,
newGroup: newGroup,
groups: make(map[int]Group),... | [
0.09080635011196136,
-0.12874168157577515,
0.14109288156032562,
0.0776757150888443,
-1.4983547925949097,
0.4830484986305237,
0.8792188763618469,
0.3226231038570404,
0.12097771465778351,
-0.34831464290618896,
0.454414039850235,
0.8605626821517944,
-0.3473549783229828,
0.25359517335891724,
... |
func (c *Cluster) Open(enableSingle bool, localID string) error {
// Setup Raft configuration.
config := raft.DefaultConfig()
config.LocalID = raft.ServerID(localID)
// Setup Raft communication.
addr, err := net.ResolveTCPAddr("tcp", c.raftBind)
if err != nil {
return err
}
transport, err := raft.NewTCPTrans... | [
0.03417449817061424,
0.8613158464431763,
0.6838425993919373,
-0.186516672372818,
0.22497424483299255,
0.1996907740831375,
1.1158183813095093,
1.0303524732589722,
0.009924969635903835,
-0.10460101813077927,
-0.22966957092285156,
0.9147701263427734,
-0.6375238299369812,
0.23010988533496857,
... |
func (c *Cluster) Close(wait bool) error {
f := c.raft.Shutdown()
if wait {
if err := f.Error(); err != nil {
return err
}
}
return nil
} | [
0.0751265287399292,
0.9277251958847046,
0.7074944376945496,
0.6809910535812378,
0.13157397508621216,
0.38318511843681335,
0.692526638507843,
-0.22285373508930206,
-1.0623602867126465,
0.23995961248874664,
0.6539595723152161,
-0.00837938766926527,
-1.0445573329925537,
0.3848021626472473,
... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.