text stringlengths 11 6.3k | embedding listlengths 768 768 |
|---|---|
func (w *WebPA) Run(waitGroup *sync.WaitGroup, shutdown <-chan struct{}) error {
w.once.Do(func() {
go func() {
var err error
w.logger.Info("Starting [%s]", w)
if w.Secure() {
err = w.serverExecutor.ListenAndServeTLS(w.certificateFile, w.keyFile)
} else {
err = w.serverExecutor.ListenAndServe()
... | [
-0.8194376826286316,
-0.23483650386333466,
0.6921245455741882,
0.16258589923381805,
-0.0044980295933783054,
0.7259140014648438,
0.6910767555236816,
0.26470839977264404,
0.29928529262542725,
0.40177831053733826,
-0.0796961635351181,
-0.0015529760858044028,
-0.944887638092041,
0.780934512615... |
func (wu *WechatUpdate) Where(ps ...predicate.Wechat) *WechatUpdate {
wu.mutation.predicates = append(wu.mutation.predicates, ps...)
return wu
} | [
-0.1879422962665558,
-1.0063706636428833,
0.3153650462627411,
-0.28297159075737,
-0.4749021828174591,
0.6442916393280029,
-0.13747239112854004,
-0.2062666118144989,
-0.42862042784690857,
-0.4642922580242157,
0.4062606394290924,
0.9200751781463623,
-0.09794045984745026,
-0.148433655500412,
... |
func (wu *WechatUpdate) SetOpenid(s string) *WechatUpdate {
wu.mutation.SetOpenid(s)
return wu
} | [
-0.7613399028778076,
-0.5728928446769714,
-0.019640129059553146,
0.7920565605163574,
-1.1766104698181152,
1.1914265155792236,
0.3102112114429474,
0.42187029123306274,
0.5826451778411865,
-0.19084133207798004,
-0.3801872730255127,
0.29191917181015015,
-0.2565717101097107,
0.3317757546901703... |
func (wu *WechatUpdate) SetUnionId(s string) *WechatUpdate {
wu.mutation.SetUnionId(s)
return wu
} | [
-0.5482919812202454,
-0.48773765563964844,
-0.10781905800104141,
0.9363433718681335,
-0.19394007325172424,
0.46535253524780273,
0.31163057684898376,
0.9180416464805603,
0.8371147513389587,
-0.3687261641025543,
-0.5847632884979248,
0.8803911209106445,
-0.10930192470550537,
0.315191805362701... |
func (wu *WechatUpdate) SetAppType(wt wechat.AppType) *WechatUpdate {
wu.mutation.SetAppType(wt)
return wu
} | [
-0.4228476583957672,
0.09447932988405228,
0.18919101357460022,
0.8970579504966736,
-0.11307533085346222,
0.550350546836853,
-0.10348720848560333,
-0.0033235286828130484,
0.5081400275230408,
0.13056102395057678,
-0.14880964159965515,
-0.5988696813583374,
0.255948007106781,
1.497153401374817... |
func (wu *WechatUpdate) SetMetaData(b []byte) *WechatUpdate {
wu.mutation.SetMetaData(b)
return wu
} | [
-0.7953987121582031,
0.4586717486381531,
0.2856077551841736,
1.139719843864441,
0.7629779577255249,
0.8493528366088867,
0.5158084034919739,
0.6319312453269958,
0.40447989106178284,
0.09976380318403244,
-0.722784698009491,
0.20959681272506714,
-0.37983664870262146,
0.4757746458053589,
-0.... |
func (wu *WechatUpdate) ClearMetaData() *WechatUpdate {
wu.mutation.ClearMetaData()
return wu
} | [
-0.40262049436569214,
0.041260283440351486,
0.24073296785354614,
0.7955653667449951,
-0.34023934602737427,
0.8717779517173767,
-0.24627667665481567,
-0.3834044337272644,
0.1445564329624176,
0.825477123260498,
0.16283056139945984,
1.0082021951675415,
-0.210862934589386,
-0.3701058030128479,... |
func (wu *WechatUpdate) SetCustomersID(id int64) *WechatUpdate {
wu.mutation.SetCustomersID(id)
return wu
} | [
-0.8344818949699402,
-1.1108548641204834,
-0.44345420598983765,
0.10483380407094955,
-0.18567819893360138,
-0.1103229746222496,
-0.08642934262752533,
0.008753779344260693,
0.24157516658306122,
-0.052711308002471924,
-0.6105173826217651,
0.15002001821994781,
-0.4450826346874237,
0.777850329... |
func (wu *WechatUpdate) SetNillableCustomersID(id *int64) *WechatUpdate {
if id != nil {
wu = wu.SetCustomersID(*id)
}
return wu
} | [
-0.1119082123041153,
-1.0323699712753296,
0.007832063362002373,
-0.5071063041687012,
-0.710746705532074,
-0.6731076836585999,
-0.5291112065315247,
-0.11749794334173203,
0.14802943170070648,
0.24647094309329987,
0.17920318245887756,
0.5819761157035828,
-1.1867128610610962,
0.790949225425720... |
func (wu *WechatUpdate) SetCustomers(c *Customer) *WechatUpdate {
return wu.SetCustomersID(c.ID)
} | [
-0.23142725229263306,
-0.45480018854141235,
0.09787357598543167,
-0.13370291888713837,
-0.0077683208510279655,
0.013050933368504047,
0.021848296746611595,
0.26554936170578003,
-0.1624865084886551,
-0.5193297863006592,
-0.2677724361419678,
0.407026469707489,
-0.9981705546379089,
0.895509362... |
func (wu *WechatUpdate) Mutation() *WechatMutation {
return wu.mutation
} | [
-0.7975324988365173,
-1.1985926628112793,
0.2851073145866394,
0.2052198052406311,
-0.019048910588026047,
0.5265493392944336,
0.48731178045272827,
-0.30299022793769836,
0.9846816658973694,
-0.3837879002094269,
0.10061988234519958,
0.02334817871451378,
-0.25874170660972595,
0.024422740563750... |
func (wu *WechatUpdate) ClearCustomers() *WechatUpdate {
wu.mutation.ClearCustomers()
return wu
} | [
-0.6693777441978455,
0.013080614618957043,
-0.09308721125125885,
0.4669763743877411,
-0.8165544271469116,
-0.23064841330051422,
-0.5527665019035339,
-0.15520702302455902,
0.3220707178115845,
0.15298894047737122,
0.6848939657211304,
0.9935747385025024,
-0.8020368814468384,
0.076501272618770... |
func (wu *WechatUpdate) Save(ctx context.Context) (int, error) {
var (
err error
affected int
)
wu.defaults()
if len(wu.hooks) == 0 {
if err = wu.check(); err != nil {
return 0, err
}
affected, err = wu.sqlSave(ctx)
} else {
var mut Mutator = MutateFunc(func(ctx context.Context, m Mutation) (Va... | [
-1.2201495170593262,
0.0940760001540184,
0.7602503299713135,
-0.20020122826099396,
0.21190166473388672,
-0.8883316516876221,
0.9323170781135559,
-0.502712607383728,
-0.7927284240722656,
0.3825567960739136,
-0.29140129685401917,
-0.024570822715759277,
-0.8329324722290039,
0.3269891142845154... |
func (wu *WechatUpdate) SaveX(ctx context.Context) int {
affected, err := wu.Save(ctx)
if err != nil {
panic(err)
}
return affected
} | [
-1.0104238986968994,
0.612275242805481,
0.6225948333740234,
0.3623233437538147,
-0.627568781375885,
0.7438486814498901,
-0.254199355840683,
0.5224254727363586,
0.9354816675186157,
0.09817562252283096,
-1.150925636291504,
-0.030572859570384026,
-0.7995216846466064,
0.05465520918369293,
0.... |
func (wu *WechatUpdate) Exec(ctx context.Context) error {
_, err := wu.Save(ctx)
return err
} | [
-0.32381439208984375,
-0.24102406203746796,
0.587984561920166,
0.31580230593681335,
0.20372027158737183,
1.2242233753204346,
-0.19560179114341736,
-0.011104130186140537,
0.09724905341863632,
0.45379355549812317,
-0.06559394299983978,
0.049958616495132446,
-0.3318769931793213,
-0.3877044320... |
func (wu *WechatUpdate) ExecX(ctx context.Context) {
if err := wu.Exec(ctx); err != nil {
panic(err)
}
} | [
0.11656764894723892,
0.24986495077610016,
0.6200709939002991,
0.507900595664978,
-0.17145869135856628,
1.3440234661102295,
-0.6190880537033081,
0.168241947889328,
0.6658554077148438,
-0.05180323123931885,
0.08212460577487946,
0.8492410778999329,
0.1937166154384613,
0.031158627942204475,
... |
func (wu *WechatUpdate) defaults() {
if _, ok := wu.mutation.UpdateTime(); !ok {
v := wechat.UpdateDefaultUpdateTime()
wu.mutation.SetUpdateTime(v)
}
} | [
-0.9628156423568726,
0.35403066873550415,
0.3027317225933075,
0.27173906564712524,
0.5304790139198303,
-0.3605774939060211,
-0.7336251735687256,
-0.23312723636627197,
0.14619600772857666,
0.09059032797813416,
-0.5194366574287415,
-0.1749763786792755,
-0.4436785578727722,
0.5511202216148376... |
func (wu *WechatUpdate) check() error {
if v, ok := wu.mutation.Openid(); ok {
if err := wechat.OpenidValidator(v); err != nil {
return &ValidationError{Name: "openid", err: fmt.Errorf("ent: validator failed for field \"openid\": %w", err)}
}
}
if v, ok := wu.mutation.UnionId(); ok {
if err := wechat.UnionI... | [
-0.5357735753059387,
-0.13442841172218323,
0.5167340636253357,
0.20102640986442566,
0.2855629324913025,
0.6023255586624146,
0.2022654265165329,
-0.42120495438575745,
-0.5125682353973389,
-0.32077810168266296,
0.3958672881126404,
0.06876777857542038,
-0.3305949866771698,
1.173478126525879,
... |
func (wuo *WechatUpdateOne) SetOpenid(s string) *WechatUpdateOne {
wuo.mutation.SetOpenid(s)
return wuo
} | [
-0.7618200778961182,
-0.5712787508964539,
-0.058291636407375336,
0.8629711270332336,
-1.000264048576355,
1.1749842166900635,
0.31754204630851746,
0.5699242949485779,
0.6227065920829773,
-0.2316543608903885,
-0.40855735540390015,
0.4263473451137543,
-0.2721930146217346,
0.34073156118392944,... |
func (wuo *WechatUpdateOne) SetUnionId(s string) *WechatUpdateOne {
wuo.mutation.SetUnionId(s)
return wuo
} | [
-0.49480515718460083,
-0.4395151138305664,
-0.06801273673772812,
1.1833480596542358,
0.019056785851716995,
0.45882511138916016,
0.29307907819747925,
0.9711582064628601,
0.9463750720024109,
-0.46167272329330444,
-0.6626777052879333,
0.927352249622345,
-0.14651308953762054,
0.189331859350204... |
func (wuo *WechatUpdateOne) SetAppType(wt wechat.AppType) *WechatUpdateOne {
wuo.mutation.SetAppType(wt)
return wuo
} | [
-0.5038663744926453,
0.0819653794169426,
0.17122302949428558,
0.8808901906013489,
0.0942036435008049,
0.5873329639434814,
-0.01789623312652111,
0.06251278519630432,
0.5665872097015381,
0.1291997730731964,
-0.2771972417831421,
-0.647233784198761,
0.26566967368125916,
1.5643306970596313,
-... |
func (wuo *WechatUpdateOne) SetMetaData(b []byte) *WechatUpdateOne {
wuo.mutation.SetMetaData(b)
return wuo
} | [
-0.7984722852706909,
0.5084742307662964,
0.2515704035758972,
1.367125153541565,
0.9859107732772827,
0.9021666049957275,
0.5535711646080017,
0.6844965219497681,
0.44024381041526794,
0.07878143340349197,
-0.8109935522079468,
0.20415328443050385,
-0.4262286424636841,
0.5345010161399841,
-0.... |
func (wuo *WechatUpdateOne) ClearMetaData() *WechatUpdateOne {
wuo.mutation.ClearMetaData()
return wuo
} | [
-0.3465975224971771,
0.21493689715862274,
0.1251065880060196,
0.9484758377075195,
0.004172844812273979,
0.8568549752235413,
-0.10944271087646484,
-0.29948827624320984,
0.12230634689331055,
0.9554730653762817,
0.025882165879011154,
0.9478074312210083,
-0.26461079716682434,
-0.09890062361955... |
func (wuo *WechatUpdateOne) SetCustomersID(id int64) *WechatUpdateOne {
wuo.mutation.SetCustomersID(id)
return wuo
} | [
-0.8547205328941345,
-1.1562821865081787,
-0.5138404369354248,
0.2808125913143158,
0.01553863100707531,
-0.11755641549825668,
-0.0822494775056839,
0.05628586560487747,
0.24737267196178436,
-0.08357842266559601,
-0.7336263656616211,
0.16476590931415558,
-0.509979248046875,
0.836252212524414... |
func (wuo *WechatUpdateOne) SetNillableCustomersID(id *int64) *WechatUpdateOne {
if id != nil {
wuo = wuo.SetCustomersID(*id)
}
return wuo
} | [
-0.01890237256884575,
-0.9447624087333679,
-0.08375547081232071,
-0.32562190294265747,
-0.4403187334537506,
-0.6313424110412598,
-0.36513277888298035,
-0.15822729468345642,
0.17106488347053528,
0.32417020201683044,
-0.05497131124138832,
0.49450424313545227,
-1.1497480869293213,
0.839189589... |
func (wuo *WechatUpdateOne) SetCustomers(c *Customer) *WechatUpdateOne {
return wuo.SetCustomersID(c.ID)
} | [
-0.25046828389167786,
-0.27651315927505493,
0.07121351361274719,
0.2851939797401428,
0.33234331011772156,
-0.07173324376344681,
0.1657859981060028,
0.3482665717601776,
-0.14691968262195587,
-0.629662275314331,
-0.5448448061943054,
0.3733963072299957,
-1.0444587469100952,
1.0373462438583374... |
func (wuo *WechatUpdateOne) Mutation() *WechatMutation {
return wuo.mutation
} | [
-0.9035944938659668,
-0.9231857061386108,
0.2302273064851761,
0.3380783498287201,
0.4411974251270294,
0.47221359610557556,
0.7209877371788025,
-0.1315523087978363,
1.0898163318634033,
-0.23349112272262573,
-0.17446845769882202,
-0.17281118035316467,
-0.3849255442619324,
0.18413405120372772... |
func (wuo *WechatUpdateOne) ClearCustomers() *WechatUpdateOne {
wuo.mutation.ClearCustomers()
return wuo
} | [
-0.7525455355644226,
0.1656195968389511,
-0.3041197657585144,
0.578223705291748,
-0.6167798042297363,
-0.30808597803115845,
-0.4412558376789093,
-0.06960858404636383,
0.3197060525417328,
0.25552719831466675,
0.5504149794578552,
0.8733240962028503,
-0.8687230348587036,
0.3134739100933075,
... |
func (wuo *WechatUpdateOne) Save(ctx context.Context) (*Wechat, error) {
var (
err error
node *Wechat
)
wuo.defaults()
if len(wuo.hooks) == 0 {
if err = wuo.check(); err != nil {
return nil, err
}
node, err = wuo.sqlSave(ctx)
} else {
var mut Mutator = MutateFunc(func(ctx context.Context, m Mutatio... | [
-0.6997114419937134,
-0.002140738070011139,
0.645060122013092,
-0.30000433325767517,
0.39641106128692627,
-0.38712847232818604,
0.6867489218711853,
-0.7462434768676758,
-0.44900810718536377,
0.47108766436576843,
0.11692017316818237,
0.22609646618366241,
-0.6436588168144226,
0.2173932343721... |
func (wuo *WechatUpdateOne) SaveX(ctx context.Context) *Wechat {
node, err := wuo.Save(ctx)
if err != nil {
panic(err)
}
return node
} | [
-0.8126149773597717,
0.5910906195640564,
0.49176687002182007,
0.290465772151947,
-0.4980272352695465,
1.0080195665359497,
-0.6024100184440613,
-0.049568455666303635,
1.068149447441101,
0.2540050148963928,
-0.7916865944862366,
0.4634009897708893,
-0.6362206935882568,
-0.17537260055541992,
... |
func (wuo *WechatUpdateOne) Exec(ctx context.Context) error {
_, err := wuo.Save(ctx)
return err
} | [
-0.3943777084350586,
-0.06633386760950089,
0.6033651232719421,
0.5101338624954224,
0.5460320711135864,
1.072259783744812,
-0.03577663376927376,
-0.11836731433868408,
0.09836099296808243,
0.481766939163208,
-0.34767383337020874,
-0.09519443660974503,
-0.5063908100128174,
-0.1104951947927475... |
func (wuo *WechatUpdateOne) ExecX(ctx context.Context) {
if err := wuo.Exec(ctx); err != nil {
panic(err)
}
} | [
0.08903706818819046,
0.38786187767982483,
0.6431566476821899,
0.7208430767059326,
0.025722818449139595,
1.3005388975143433,
-0.5556660294532776,
0.07171390950679779,
0.5629404187202454,
0.10504111647605896,
-0.10808064043521881,
0.7748929262161255,
0.10447515547275543,
0.15208324790000916,... |
func (wuo *WechatUpdateOne) defaults() {
if _, ok := wuo.mutation.UpdateTime(); !ok {
v := wechat.UpdateDefaultUpdateTime()
wuo.mutation.SetUpdateTime(v)
}
} | [
-1.045352578163147,
0.5016834139823914,
0.31684064865112305,
0.4084884524345398,
0.6878490447998047,
-0.2929651439189911,
-0.6497483253479004,
-0.21760204434394836,
0.21487054228782654,
0.20577064156532288,
-0.684410810470581,
-0.23511278629302979,
-0.5140990018844604,
0.7074196934700012,
... |
func (wuo *WechatUpdateOne) check() error {
if v, ok := wuo.mutation.Openid(); ok {
if err := wechat.OpenidValidator(v); err != nil {
return &ValidationError{Name: "openid", err: fmt.Errorf("ent: validator failed for field \"openid\": %w", err)}
}
}
if v, ok := wuo.mutation.UnionId(); ok {
if err := wechat.... | [
-0.6178065538406372,
-0.004466130398213863,
0.5582419633865356,
0.3445674479007721,
0.49552541971206665,
0.5727437138557434,
0.26249366998672485,
-0.38609349727630615,
-0.45583808422088623,
-0.14167365431785583,
0.2398938238620758,
-0.005799266044050455,
-0.3127267360687256,
1.346084475517... |
func GenerateContainer(name, image string, isPrivileged bool, command, args []string, envVars []corev1.EnvVar, resourceReqs corev1.ResourceRequirements, ports []corev1.ContainerPort) *corev1.Container {
container := &corev1.Container{
Name: name,
Image: image,
ImagePullPolicy: corev1.PullAlw... | [
-0.6811812520027161,
0.15983255207538605,
0.7349053621292114,
0.17389015853405,
0.08856499195098877,
0.20093682408332825,
-0.36402615904808044,
0.476900577545166,
0.2729337811470032,
-0.18942739069461823,
0.22803303599357605,
0.38884788751602173,
-0.11088844388723373,
1.1693248748779297,
... |
func GeneratePodTemplateSpec(objectMeta metav1.ObjectMeta, containers []corev1.Container) *corev1.PodTemplateSpec {
podTemplateSpec := &corev1.PodTemplateSpec{
ObjectMeta: objectMeta,
Spec: corev1.PodSpec{
Containers: containers,
Volumes: []corev1.Volume{
{
Name: OdoSourceVolume,
},
{
/... | [
0.08451879024505615,
-0.5179191827774048,
0.7288148403167725,
-0.49864187836647034,
-0.04404537007212639,
0.44489675760269165,
-0.44520965218544006,
-0.3204725980758667,
0.1437680721282959,
0.3575529158115387,
-0.5319232940673828,
0.4233536124229431,
-0.07787717133760452,
-0.17516997456550... |
func GenerateDeploymentSpec(podTemplateSpec corev1.PodTemplateSpec, podSelectorLabels map[string]string) *appsv1.DeploymentSpec {
deploymentSpec := &appsv1.DeploymentSpec{
Strategy: appsv1.DeploymentStrategy{
Type: appsv1.RecreateDeploymentStrategyType,
},
Selector: &metav1.LabelSelector{
MatchLabels: podS... | [
-0.5530863404273987,
-0.5345199108123779,
0.33974549174308777,
-0.9585650563240051,
0.06685493886470795,
0.6245483756065369,
-0.715434730052948,
0.4485950171947479,
0.012756205163896084,
0.7575694918632507,
-0.20431026816368103,
0.5372125506401062,
0.6924480199813843,
-0.3464217185974121,
... |
func GeneratePVCSpec(quantity resource.Quantity) *corev1.PersistentVolumeClaimSpec {
pvcSpec := &corev1.PersistentVolumeClaimSpec{
Resources: corev1.ResourceRequirements{
Requests: corev1.ResourceList{
corev1.ResourceStorage: quantity,
},
},
AccessModes: []corev1.PersistentVolumeAccessMode{
corev1.... | [
0.12161459028720856,
-0.5726737380027771,
0.5242106914520264,
-1.089859962463379,
-0.39219212532043457,
0.44179683923721313,
-1.0010218620300293,
0.13456587493419647,
0.3560178875923157,
-0.1843777745962143,
-0.02764672413468361,
0.1327580213546753,
0.21503888070583344,
-0.1978830397129058... |
func GenerateServiceSpec(componentName string, containerPorts []corev1.ContainerPort) *corev1.ServiceSpec {
// generate Service Spec
var svcPorts []corev1.ServicePort
for _, containerPort := range containerPorts {
svcPort := corev1.ServicePort{
Name: containerPort.Name,
Port: containerPort.Conta... | [
-0.05407126247882843,
-0.1412547379732132,
0.5498445630073547,
-0.6755689978599548,
0.01356520876288414,
0.5703504085540771,
0.2981433570384979,
0.019910532981157303,
0.08069439977407455,
0.3328043222427368,
-0.258850634098053,
0.10777182132005692,
-0.037391360849142075,
-0.557973206043243... |
func GenerateIngressSpec(ingressParam IngressParameter) *extensionsv1.IngressSpec {
ingressSpec := &extensionsv1.IngressSpec{
Rules: []extensionsv1.IngressRule{
{
Host: ingressParam.IngressDomain,
IngressRuleValue: extensionsv1.IngressRuleValue{
HTTP: &extensionsv1.HTTPIngressRuleValue{
Paths: ... | [
-0.1285015493631363,
0.09846436232328415,
0.5678279995918274,
-0.3870261609554291,
-0.27518215775489807,
0.5368741750717163,
-0.6790380477905273,
0.49334201216697693,
-0.023346705362200737,
0.9498558640480042,
-0.617422342300415,
0.9016672968864441,
-0.4397469162940979,
-0.0463994853198528... |
func GenerateSelfSignedCertificate(host string) (SelfSignedCertificate, error) {
privateKey, err := rsa.GenerateKey(rand.Reader, 2048)
if err != nil {
return SelfSignedCertificate{}, errors.Wrap(err, "unable to generate rsa key")
}
template := x509.Certificate{
SerialNumber: big.NewInt(time.Now().Unix()),
Su... | [
-0.2134937196969986,
0.03909391909837723,
0.817033052444458,
0.2763536274433136,
-0.8061631917953491,
-0.6972857713699341,
-0.03450767323374748,
-0.289427250623703,
-0.06361504644155502,
-0.18500925600528717,
-0.8070828914642334,
0.09330084174871445,
-0.708934485912323,
0.8112413287162781,... |
func GenerateOwnerReference(deployment *appsv1.Deployment) metav1.OwnerReference {
ownerReference := metav1.OwnerReference{
APIVersion: DeploymentAPIVersion,
Kind: DeploymentKind,
Name: deployment.Name,
UID: deployment.UID,
}
return ownerReference
} | [
-1.0858222246170044,
-0.6474655866622925,
0.4839918315410614,
-0.25151869654655457,
-0.2603759765625,
0.42140674591064453,
-0.3706396818161011,
0.17144951224327087,
0.8582730889320374,
0.523549497127533,
0.27255815267562866,
0.40851858258247375,
0.24114581942558289,
-0.4658746123313904,
... |
func (c *Client) GeneratePortForwardReq(podName string) *rest.Request {
return c.KubeClient.CoreV1().RESTClient().
Post().
Resource("pods").
Namespace(c.Namespace).
Name(podName).
SubResource("portforward")
} | [
-1.219675898551941,
0.17706868052482605,
0.6887300610542297,
-0.5382771492004395,
-0.8756686449050903,
0.6619026064872742,
-0.28848883509635925,
-0.10288851708173752,
-0.5012948513031006,
-0.3856925070285797,
-0.13057520985603333,
0.2614322602748871,
-0.6302587389945984,
0.0073214340955019... |
func (p *socketAppProxyClient) commitBlock(block ledger.Block) ([]byte, error) {
var stateHash ledger.StateHash
conn, err := net.DialTimeout("tcp", p.clientAddr, p.timeout)
if err != nil {
return nil, err
}
rpcConn := jsonrpc.NewClient(conn)
err = rpcConn.Call("State.CommitBlock", block, &stateHash)
p.logge... | [
-0.9197641611099243,
0.4136410057544708,
0.9001335501670837,
-0.43586626648902893,
-0.10390769690275192,
0.1252063810825348,
-0.12652428448200226,
-0.5427002906799316,
-0.2229551076889038,
0.8389686346054077,
-0.27337849140167236,
0.14573684334754944,
-1.1911126375198364,
0.810640990734100... |
func DecodeRFC2047(s string) string {
return coding.RFC2047Decode(s)
} | [
-0.40220263600349426,
-0.06700944900512695,
0.21215683221817017,
-0.92459636926651,
-0.5587548613548279,
-1.0534387826919556,
-0.694076657295227,
0.9752750396728516,
-0.35615408420562744,
-1.0208159685134888,
-0.5329208374023438,
-0.4560350775718689,
-0.14929717779159546,
0.432924628257751... |
func DecodeHeaders(b []byte, addtlHeaders ...string) (textproto.MIMEHeader, error) {
b = ensureHeaderBoundary(b)
tr := textproto.NewReader(bufio.NewReader(bytes.NewReader(b)))
headers, err := tr.ReadMIMEHeader()
switch errors.Cause(err) {
case nil, io.EOF:
// carry on, io.EOF is expected
default:
return nil, e... | [
-0.17426519095897675,
-0.1709681749343872,
0.7791224122047424,
-0.2687101364135742,
-0.45045721530914307,
-0.3443404734134674,
-0.5132170915603638,
0.4789511263370514,
-0.597906768321991,
0.5549644827842712,
-0.7781537771224976,
-0.8708460330963135,
-1.3502010107040405,
-0.0849094539880752... |
func ensureHeaderBoundary(b []byte) []byte {
slice := bytes.SplitAfter(b, []byte{'\r', '\n'})
dest := make([]byte, 0, len(b)+2)
headers := true
for _, v := range slice {
if headers && (bytes.Contains(v, []byte{':'}) || bytes.HasPrefix(v, []byte{' '}) || bytes.HasPrefix(v, []byte{'\t'})) {
dest = append(dest, v... | [
0.23765987157821655,
-0.7928091883659363,
1.0142983198165894,
0.22339405119419098,
-0.3917035758495331,
-0.47780105471611023,
-1.0456589460372925,
-0.7701647281646729,
-0.1648404598236084,
0.6607549786567688,
-0.7261268496513367,
-0.4530409276485443,
-0.552438497543335,
0.3953779637813568,... |
func (circle Circle) Perimeter() float64 {
return 2 * math.Pi * circle.radius
} | [
-0.5907397270202637,
-0.5429188013076782,
0.08048181980848312,
-0.27449366450309753,
0.045404255390167236,
-0.4789946377277374,
0.12328483909368515,
-0.32971179485321045,
0.13345131278038025,
0.12974247336387634,
-0.4216122627258301,
-0.4877740144729614,
-0.4742003381252289,
-0.06259635090... |
func MakeCircle(radius float64) Circle {
return Circle{radius}
} | [
0.3461224138736725,
0.3394363820552826,
0.09523056447505951,
-0.5506619811058044,
-1.4466593265533447,
0.7533659338951111,
0.7907493114471436,
-0.4743697941303253,
0.11738400906324387,
0.384329229593277,
-0.02177530527114868,
-0.06496500968933105,
0.26122501492500305,
-0.47263315320014954,... |
func (l TLSCertificateLoader) GetCertificate(
hello *tls.ClientHelloInfo,
) (*tls.Certificate, error) {
return l.Get(hello.Context())
} | [
0.738701581954956,
-0.4251975119113922,
0.3728363513946533,
0.663872241973877,
0.4823422133922577,
-0.5097092390060425,
-0.5354654788970947,
-0.49697786569595337,
-0.7223201394081116,
-0.486320436000824,
-0.9270796179771423,
0.21047170460224152,
-0.5311558842658997,
0.7116339802742004,
0... |
func (l TLSCertificateLoader) GetClientCertificate(
reqInfo *tls.CertificateRequestInfo,
) (*tls.Certificate, error) {
return l.Get(reqInfo.Context())
} | [
0.6453397870063782,
-0.5920182466506958,
0.309662789106369,
0.089787058532238,
-0.7489070892333984,
-0.1323980838060379,
-0.11858036369085312,
-1.0551352500915527,
-0.5001254677772522,
-0.8970790505409241,
-0.003555875038728118,
0.2969961166381836,
-0.4243352711200714,
0.7197731733322144,
... |
func (l TLSCertificateLoader) Get(ctx context.Context) (*tls.Certificate, error) {
signer, err := l.SignerGen.Generate(ctx)
if err != nil {
return nil, err
}
return toTLSCertificate(signer), nil
} | [
0.2558228671550751,
-0.052794259041547775,
0.2935944199562073,
-0.474417120218277,
-0.17292554676532745,
-0.10605021566152573,
-1.0954777002334595,
-0.1094743087887764,
-0.665852963924408,
-0.5790186524391174,
-0.2456519454717636,
-0.2900705635547638,
-0.20010286569595337,
0.32016766071319... |
func (s NiftyCreatePrivateLanInput) String() string {
return nifcloudutil.Prettify(s)
} | [
0.07622204720973969,
-0.003228293964639306,
-0.07080244272947311,
-0.21938130259513855,
0.07304041087627411,
0.4781559705734253,
0.2133753001689911,
-1.7358275651931763,
0.013061588630080223,
-0.5047954320907593,
-0.28340497612953186,
0.3977467715740204,
0.07175863534212112,
0.078599251806... |
func (s NiftyCreatePrivateLanOutput) String() string {
return nifcloudutil.Prettify(s)
} | [
0.8685402870178223,
0.017519259825348854,
-0.12412959337234497,
-0.11770560592412949,
-0.4171704053878784,
-0.39560815691947937,
0.4978227913379669,
-1.6167622804641724,
-0.3717600107192993,
-0.44176745414733887,
0.020313546061515808,
0.20079870522022247,
0.26139140129089355,
0.18879529833... |
func (r NiftyCreatePrivateLanRequest) Send(ctx context.Context) (*NiftyCreatePrivateLanResponse, error) {
r.Request.SetContext(ctx)
err := r.Request.Send()
if err != nil {
return nil, err
}
resp := &NiftyCreatePrivateLanResponse{
NiftyCreatePrivateLanOutput: r.Request.Data.(*NiftyCreatePrivateLanOutput),
re... | [
-0.8325506448745728,
0.1320105344057083,
-0.060679662972688675,
-0.08047186583280563,
0.2631743848323822,
-0.1920575350522995,
-0.26041287183761597,
-2.1276118755340576,
0.3670920133590698,
-0.05938207358121872,
-0.39774760603904724,
0.26622432470321655,
-0.2345818281173706,
0.901366412639... |
func (r *NiftyCreatePrivateLanResponse) SDKResponseMetdata() *aws.Response {
return r.response
} | [
-0.0665767714381218,
0.07312825322151184,
-0.019304916262626648,
-0.3455907106399536,
-0.0331476628780365,
-0.15566125512123108,
-0.8358643054962158,
-1.3777352571487427,
0.9180576801300049,
-0.5279802083969116,
-0.6371980309486389,
-0.4301842153072357,
0.25072821974754333,
-0.064445883035... |
func publish_expvars(r metrics.Registry) {
du := float64(time.Nanosecond)
percentiles := []float64{0.50, 0.75, 0.95, 0.99, 0.999}
r.Each(func(name string, i interface{}) {
switch m := i.(type) {
case metrics.Counter:
expvar.Publish(fmt.Sprintf("%s.Count", name), expvar.Func(func() interface{} {
return m.C... | [
0.39154425263404846,
0.39903387427330017,
0.681046724319458,
-0.4132593274116516,
-0.41352859139442444,
0.3526309132575989,
0.44965457916259766,
-0.39801865816116333,
-0.7374332547187805,
0.46633222699165344,
0.48289012908935547,
0.32199743390083313,
0.20686689019203186,
0.9596570730209351... |
func (l Line) FileName() string {
return l.fileName
} | [
0.910038411617279,
-1.4328967332839966,
0.16034847497940063,
0.06492776423692703,
0.4955493211746216,
0.23046083748340607,
-0.1119169145822525,
1.0970841646194458,
-0.5387707352638245,
-0.7685359120368958,
0.1058730036020279,
0.4058324992656708,
0.4368915259838104,
0.35542502999305725,
-... |
func (l Line) String() string {
return *(*string)(unsafe.Pointer(&l.line))
} | [
0.8923797607421875,
-0.88176029920578,
-0.22335004806518555,
-0.022982366383075714,
0.425827294588089,
0.43458253145217896,
-0.21660207211971283,
-1.3704304695129395,
-0.06461480259895325,
-0.7720226645469666,
-0.24423062801361084,
0.40732795000076294,
-0.33761346340179443,
-0.264660149812... |
func (l Line) StringTrimmed() string {
trimmedString := l.BytesTrimmed()
return *(*string)(unsafe.Pointer(&trimmedString))
} | [
1.2230632305145264,
-1.3209034204483032,
0.16789864003658295,
-0.738143265247345,
0.19496142864227295,
0.9306208491325378,
-1.104468822479248,
-0.3300897181034088,
0.7667856812477112,
-0.4137417674064636,
-1.0501121282577515,
0.6012012362480164,
-0.5937848687171936,
-0.7482016682624817,
... |
func (l Line) Bytes() []byte {
return l.line
} | [
0.35603588819503784,
-0.2571299374103546,
0.13420182466506958,
-0.20216026902198792,
0.9492014646530151,
0.69694983959198,
-1.713083267211914,
-0.41823506355285645,
0.2963641583919525,
-1.4507087469100952,
-0.7193601131439209,
0.7190182209014893,
-0.18250522017478943,
0.2526804506778717,
... |
func (l Line) BytesTrimmed() []byte {
// inline optimization with goto instead of for
Loop:
if len(l.line) == 0 {
return l.line
}
last := l.line[len(l.line)-1]
if last == '\n' || last == '\r' || last == ' ' {
l.line = l.line[:len(l.line)-1]
} else {
return l.line
}
goto Loop
} | [
0.8029810190200806,
-0.23604854941368103,
0.7148051261901855,
-0.4809294044971466,
1.0701441764831543,
-0.045483995229005814,
-0.9407002925872803,
-0.022059207782149315,
0.6332612037658691,
-0.3499753773212433,
-0.8657466173171997,
0.9848173260688782,
-0.7306855320930481,
0.233329579234123... |
func (gs *GateService) SignIn(ctx context.Context, login string, password string) (*SingInResponse, error) {
us, _, err := cocain.UserGRPCService(cocain.UserPort, gs.logger)
if err != nil {
return nil, err
}
user, err := us.Authenticate(ctx, login, password)
if err != nil {
return nil, err
}
as, _, err := co... | [
-0.15680894255638123,
-0.4306912124156952,
0.721217691898346,
-0.45033371448516846,
-0.5898355841636658,
0.5247218012809753,
0.18883877992630005,
-0.08875356614589691,
0.04338419437408447,
0.6546626687049866,
-1.0452566146850586,
0.8914284110069275,
-0.24997921288013458,
-0.096915215253829... |
func (gs *GateService) Logout(ctx context.Context, opaque string) error {
return gs.repo.RemoveToken(ctx, opaque)
} | [
0.3211854100227356,
0.31577780842781067,
0.1001974493265152,
-1.0483150482177734,
-0.3135190010070801,
0.9496008157730103,
-0.44190308451652527,
-0.7939392328262329,
0.02611885964870453,
0.7320543527603149,
-0.11564115434885025,
1.082719326019287,
-0.7596888542175293,
-0.12085944414138794,... |
func NewViewQuery(dbcon DBConn, tablename string, model interface{}) ViewQuery {
return ViewQuery{
NewQuery(dbcon, tablename, model),
}
} | [
0.4263942539691925,
0.0006754657370038331,
0.25208696722984314,
0.8685701489448547,
-1.6843844652175903,
-0.48583927750587463,
-0.841452419757843,
0.37693265080451965,
-0.7036958336830139,
-0.6717230081558228,
-0.3062668740749359,
0.6665321588516235,
0.07175808399915695,
0.7452473044395447... |
func NewViewQueryCustom(dbcon DBConn) ViewQuery {
return ViewQuery{
NewQueryCustom(dbcon),
}
} | [
0.6705560684204102,
-0.16638043522834778,
0.020605091005563736,
0.06669680029153824,
-1.5477415323257446,
-0.6921741962432861,
-0.7156527042388916,
0.538206160068512,
0.4476068913936615,
-0.5935450792312622,
0.07705521583557129,
0.7190777659416199,
0.7738704085350037,
0.5131828188896179,
... |
func (f *FactorMapper) BaseRateToRangeConfig(baseRates []models.BaseRate) (rangeRates []models.RangeConfig) {
sort.Slice(baseRates, func(i, j int) bool {
return baseRates[i].Time < baseRates[j].Time
})
prev := 0
result := []models.RangeConfig{}
for i:= 0; i < len(baseRates); i++ {
curr := baseRates[i]... | [
-0.6029916405677795,
-0.8591271042823792,
0.4617871046066284,
-0.23469609022140503,
0.37703195214271545,
0.29261475801467896,
-0.9170358180999756,
-0.2196188122034073,
-0.6455467939376831,
1.4469774961471558,
-0.038772858679294586,
0.3427431285381317,
-1.0260071754455566,
0.140596404671669... |
func (f *FactorMapper) DriverAgeFactorToRangeConfig(ageFactors []models.DriverAgeFactor) (rangeRates []models.RangeConfig) {
sort.Slice(ageFactors, func(i, j int) bool {
return ageFactors[i].Age < ageFactors[j].Age
})
prev := 0
result := []models.RangeConfig{}
for i:= 0; i < len(ageFactors); i++ {
cur... | [
-1.6739392280578613,
-1.2542526721954346,
0.768582820892334,
-0.20028871297836304,
0.3927997350692749,
0.003371891798451543,
-0.17713876068592072,
0.34499818086624146,
-0.3939441740512848,
0.6972272396087646,
-0.36973997950553894,
-0.479714572429657,
-0.581137478351593,
0.3642001450061798,... |
func (f *FactorMapper) InsuranceGroupFactorToRangeConfig(insuranceGroups []models.InsuranceGroupFactor) (rangeRates []models.RangeConfig) {
result := []models.RangeConfig{}
for i:= 0; i < len(insuranceGroups); i++ {
curr := insuranceGroups[i]
s := strings.Split(curr.Group, "-")
var start, end int
st... | [
-1.5843682289123535,
-1.2105571031570435,
0.4309362471103668,
-0.017644623294472694,
0.4430692493915558,
-0.12225007265806198,
-0.17349636554718018,
0.10242076218128204,
-0.609199583530426,
0.38743171095848083,
0.08710437268018723,
0.2201433926820755,
-0.5237910747528076,
0.017045555636286... |
func (f *FactorMapper) LicenceValidityFactorToRangeConfig(licenceValidities []models.LicenceValidityFactor) (rangeRates []models.RangeConfig) {
result := []models.RangeConfig{}
for i:= 0; i < len(licenceValidities); i++ {
curr := licenceValidities[i]
s := strings.Split(curr.Length, "-")
var start, end i... | [
-0.7681816816329956,
-1.2190462350845337,
0.5137280821800232,
-0.2583959996700287,
0.08907809853553772,
0.09755223244428635,
-0.6205187439918518,
1.1323866844177246,
-0.031992122530937195,
0.29517024755477905,
-0.2877427339553833,
-0.12619814276695251,
-0.6829051971435547,
0.54624164104461... |
func TestHello(t *testing.T) {
// refactor tests into an assertion to remove duplication
assertCorrectMessage := func(t *testing.T, got, want string) {
// helper func displays line func is called:
t.Helper()
if got != want {
t.Errorf("got %q want %q", got, want)
}
}
// test case where there is an arg t... | [
0.2416628748178482,
-0.14989779889583588,
0.6940693259239197,
-0.09541082382202148,
0.8129442930221558,
0.7386007308959961,
0.27325984835624695,
-0.014072437770664692,
-0.2582228481769562,
-0.8386005163192749,
-0.23351439833641052,
0.7438433766365051,
0.21544918417930603,
0.737680315971374... |
func New(params *stripe.TestHelpersTreasuryReceivedDebitParams) (*stripe.TreasuryReceivedDebit, error) {
return getC().New(params)
} | [
0.8557790517807007,
-0.15137510001659393,
0.16444498300552368,
-1.3627612590789795,
0.8019207715988159,
0.23063179850578308,
0.6924389600753784,
0.07497707009315491,
-0.729921281337738,
-0.27924126386642456,
0.1642179787158966,
0.27818846702575684,
0.05266387015581131,
0.12848658859729767,... |
func (c Client) New(params *stripe.TestHelpersTreasuryReceivedDebitParams) (*stripe.TreasuryReceivedDebit, error) {
receiveddebit := &stripe.TreasuryReceivedDebit{}
err := c.B.Call(
http.MethodPost,
"/v1/test_helpers/treasury/received_debits",
c.Key,
params,
receiveddebit,
)
return receiveddebit, err
} | [
0.2131509780883789,
0.12763792276382446,
0.4573443830013275,
-1.2669793367385864,
0.2285192310810089,
0.3979668915271759,
0.4039885997772217,
-0.6189505457878113,
-0.7597308158874512,
-0.1917964518070221,
-0.15988554060459137,
0.49452295899391174,
-0.24124805629253387,
0.41058188676834106,... |
func StartManager(ctx context.Context, t *testing.T, mgr manager.Manager) {
ctx, cancel := context.WithCancel(ctx)
mgrStopped := &sync.WaitGroup{}
mgrStopped.Add(1)
var err error
go func() {
defer mgrStopped.Done()
err = mgr.Start(ctx)
}()
t.Cleanup(func() {
cancel()
mgrStopped.Wait()
if err != nil... | [
-0.20932023227214813,
0.002757919719442725,
0.597594141960144,
0.2547153830528259,
-0.090718574821949,
0.02171344682574272,
0.004431887064129114,
0.5221469402313232,
0.36979296803474426,
0.009665226563811302,
0.20226076245307922,
0.4654356837272644,
0.0370793342590332,
1.5159674882888794,
... |
func NewNodePoolService(clusters Store, nodePools NodePoolStore, manager NodePoolManager) NodePoolService {
return nodePoolService{
clusters: clusters,
nodePools: nodePools,
manager: manager,
}
} | [
-0.8688210844993591,
-0.3826015293598175,
-0.0690457746386528,
-0.1074715405702591,
-1.0049363374710083,
0.05297476798295975,
-0.1935088336467743,
-1.2521382570266724,
0.4939979016780853,
0.27083659172058105,
-0.3457892835140228,
1.093493103981018,
-0.40967580676078796,
0.6098706722259521,... |
func (c *APIClient) addResponseCode(code int) {
c.respCodes = append(c.respCodes, code)
} | [
-0.17556041479110718,
-0.5253311395645142,
0.5134042501449585,
-0.38602057099342346,
0.40892499685287476,
-0.2021033614873886,
-0.14583508670330048,
-0.2188447266817093,
1.2641510963439941,
-0.6103068590164185,
-0.4649121165275574,
-0.7047895789146423,
-0.8292497992515564,
0.22586122155189... |
func (c *APIClient) GetLastResponseCode() int {
if len(c.respCodes) == 0 {
return 0
}
return c.respCodes[len(c.respCodes)-1]
} | [
-0.044427014887332916,
-0.6928985714912415,
0.8280987739562988,
-0.7508707642555237,
0.9706779718399048,
-0.793073296546936,
0.4199954569339752,
0.0567803755402565,
0.6331736445426941,
-0.2573212683200836,
0.40813446044921875,
-0.1023293137550354,
-1.4757953882217407,
-0.44314709305763245,... |
func (c *APIClient) GetResponseCodes() []int {
return c.respCodes
} | [
-0.06342325359582901,
-0.34772059321403503,
0.6791467070579529,
0.5255452394485474,
0.5025908946990967,
-0.859028160572052,
0.545015811920166,
-0.00884300284087658,
0.8556311130523682,
-0.6411311030387878,
-0.9587297439575195,
0.15253667533397675,
-1.4111846685409546,
0.12189622968435287,
... |
func (c *APIClient) StatusCheck() (bool, error) {
url, err := c.compileStatusCheckURL()
if err != nil {
return false, err
}
req, err := http.NewRequest(http.MethodGet, url, nil)
if err != nil {
return false, err
}
// Use CallRaw since no authentication is needed for status check.
r, err := c.Client.Call... | [
-1.1538652181625366,
0.20156192779541016,
0.7897506356239319,
0.716346800327301,
0.5152837038040161,
0.7418409585952759,
-0.05465243011713028,
0.5007364153862,
-0.1731487214565277,
-0.48908036947250366,
0.04415208473801613,
0.1556645631790161,
-0.1500590294599533,
0.08524112403392792,
0.... |
func (c *APIClient) compileStatusCheckURL() (string, error) {
if c.BaseURL == "" {
return "", errors.New("Could not compile status check URL. Missing APIClient.BaseURL")
}
return fmt.Sprintf("%s/%s/%s", c.BaseURL, API_VERSION, RESOURCE_STATUSCHECK), nil
} | [
-0.9170815348625183,
-1.275311827659607,
0.1372767835855484,
0.7108430862426758,
0.10602957010269165,
0.7124506235122681,
0.13939321041107178,
0.7550247311592102,
-0.7653430700302124,
-0.24659141898155212,
0.2795484662055969,
0.23368005454540253,
-0.2809640169143677,
0.7092955708503723,
... |
func (c *APIClient) SetNewAPIToken() error {
url, err := c.compileTokenURL()
if err != nil {
return err
}
req, err := http.NewRequest(http.MethodPost, url, nil)
if err != nil {
return err
}
return c.Client.SetNewAPIToken(req)
} | [
-2.1557204723358154,
-0.4280673861503601,
0.4663361608982086,
-0.12215635925531387,
-0.31199777126312256,
0.4448053538799286,
-0.4219270348548889,
0.4501434862613678,
-0.7891890406608582,
-0.5583968758583069,
-1.7756356000900269,
0.8192024230957031,
-0.5228002667427063,
0.5257502794265747,... |
func (c *APIClient) Get(endpoint Endpointer, model interface{}, queryParams ...func(q url.Values)) error {
resp, err := c.GetWithRawResponse(endpoint, queryParams...)
if err != nil {
return err
}
defer resp.Body.Close()
c.addResponseCode(resp.StatusCode)
if err != nil {
return err
}
if resp.StatusCode != ... | [
-1.1932628154754639,
-0.2924676835536957,
0.7347767353057861,
-0.44668957591056824,
0.2088310420513153,
-0.37577712535858154,
-1.0315802097320557,
-0.4223574101924896,
-0.8092918992042542,
0.13505616784095764,
-0.5725498199462891,
0.4785991311073303,
-0.03104816935956478,
-0.60765379667282... |
func (c *APIClient) GetWithRawResponse(endpoint Endpointer, queryParams ...func(q url.Values)) (resp *http.Response, err error) {
epoint, err := endpoint.GetEndpoint()
if err != nil {
return
}
endUrl := c.CompileEndpointURL(epoint)
req, _ := http.NewRequest(http.MethodGet, endUrl, nil)
q := req.URL.Query()
f... | [
-0.8041132688522339,
-0.41154491901397705,
1.0143961906433105,
-0.3127218186855316,
0.0713450089097023,
-0.5068585276603699,
-1.0668562650680542,
-0.7665773630142212,
0.34946101903915405,
-0.4158172011375427,
-0.5782469511032104,
-0.46039673686027527,
0.12483920902013779,
-0.47319531440734... |
func (c *APIClient) Post(endpoint Endpointer, payload interface{}, result interface{}, headers ...func(h *http.Header)) error {
return c.postPut(http.MethodPost, endpoint, payload, result, headers...)
} | [
-0.5811287760734558,
0.18288061022758484,
0.3997274339199066,
0.4889090359210968,
-0.3794602155685425,
-0.4913104474544525,
-0.6517005562782288,
-0.9383742809295654,
-1.062988519668579,
-0.7328591346740723,
-0.3729555010795593,
-1.2084647417068481,
-0.7896535992622375,
-0.31278008222579956... |
func (c *APIClient) Put(endpoint Endpointer, payload interface{}, result interface{}, headers ...func(h *http.Header)) error {
return c.postPut(http.MethodPut, endpoint, payload, result, headers...)
} | [
-0.7301039695739746,
0.015157531015574932,
0.46006157994270325,
-0.3640676438808441,
-0.23626211285591125,
-0.31977301836013794,
-0.378355473279953,
-0.6271992921829224,
-1.14264976978302,
0.02648897096514702,
-0.6584390997886658,
-0.3376842439174652,
-0.9962403774261475,
-0.56639933586120... |
func (c *APIClient) postPut(method string, endpoint Endpointer, payload interface{}, result interface{}, headers ...func(h *http.Header)) error {
epoint, err := endpoint.GetEndpoint()
if err != nil {
return err
}
endUrl := c.CompileEndpointURL(epoint)
body, err := json.Marshal(payload)
if err != nil {
retur... | [
-1.0323255062103271,
0.3977545201778412,
0.9573666453361511,
-0.741723358631134,
-0.6034700870513916,
-0.4838900864124298,
-0.6826175451278687,
-0.48017576336860657,
-0.9587774872779846,
0.24422068893909454,
-0.34080973267555237,
-0.5822192430496216,
-0.7404864430427551,
-0.523429811000824... |
func (c *APIClient) Delete(endpoint Endpointer, result interface{}, headers ...func(h *http.Header)) error {
epoint, err := endpoint.GetEndpoint()
if err != nil {
return err
}
endUrl := c.CompileEndpointURL(epoint)
req, _ := http.NewRequest(http.MethodDelete, endUrl, nil)
h := &req.Header
for _, v := range he... | [
-0.6739653944969177,
-0.08473709970712662,
1.00716233253479,
0.3459666073322296,
0.010914879851043224,
-0.6218008399009705,
-0.7560874223709106,
-0.4629443287849426,
-0.27736085653305054,
0.5205779075622559,
-0.14412230253219604,
-0.2943107485771179,
-1.1635463237762451,
-0.593226790428161... |
func (c APIClient) CompileEndpointURL(endpoint string) string {
return fmt.Sprintf("%v/%v/%v/%v", c.BaseURL, c.API, API_VERSION, endpoint)
} | [
-1.0117427110671997,
-1.7769595384597778,
0.32523393630981445,
0.4560801088809967,
0.3205060064792633,
0.41953185200691223,
-0.708813488483429,
0.40499603748321533,
-0.7258705496788025,
0.3006308376789093,
0.10944735258817673,
-0.26865899562835693,
-0.6527794003486633,
-0.02123804204165935... |
func (c *APIClient) UnsetAuthToken() {
c.Client.UnsetAuthToken()
} | [
-0.3290167450904846,
-0.1066344752907753,
0.0731835663318634,
-0.9413130879402161,
0.3957388401031494,
-0.27828794717788696,
1.5722997188568115,
0.342543363571167,
-0.6641702651977539,
-0.5685786604881287,
-0.7102993130683899,
1.4944995641708374,
-0.03961730748414993,
-0.06032995879650116,... |
func NewFixture(config FixtureConfig) (*Fixture, error) {
f := &Fixture{
BaseFixture: &BaseFixture{},
}
var setters = []func(FixtureConfig){
f.setTearDown,
f.setAPIDiscovery,
f.setCRDClient,
f.setCRDClientV1,
f.setDynamicClientset,
f.setKubeClientset,
}
for _, setFn := range setters {
setFn(config)... | [
-0.5732484459877014,
-0.3705020844936371,
0.1205650269985199,
0.1438761204481125,
-0.10412301868200302,
-1.1427003145217896,
0.04747503995895386,
-0.33781668543815613,
0.15546245872974396,
0.1799428015947342,
-0.8736317157745361,
0.3429560959339142,
-0.44702965021133423,
0.7353489995002747... |
func (f *Fixture) TearDown() {
if !f.tearDown {
return
}
// cleanup in descending order
for i := len(f.teardownFuncs) - 1; i >= 0; i-- {
teardown := f.teardownFuncs[i]
err := teardown()
if err != nil {
if apierrors.IsNotFound(err) {
klog.V(2).Infof(
"Teardown ignored: Resource not found: %+v",
... | [
0.1414111703634262,
-0.1376829892396927,
0.6180773973464966,
-0.09671755880117416,
0.9109164476394653,
0.0200485922396183,
1.0846995115280151,
-0.20399604737758636,
0.06325454264879227,
-0.5659680962562561,
0.17425410449504852,
-0.4132435917854309,
0.055439338088035583,
0.3712177872657776,... |
func (f *Fixture) AddToTeardown(teardown func() error) {
if !f.tearDown {
return
}
f.teardownFuncs = append(f.teardownFuncs, teardown)
} | [
-0.2257412225008011,
-0.16173790395259857,
0.5721465349197388,
-0.4200296103954315,
0.26774680614471436,
0.4281448721885681,
0.9569293260574341,
0.6142300367355347,
0.40705597400665283,
-0.8383577466011047,
-0.4351120591163635,
-0.2818535566329956,
0.08686035871505737,
0.000255392660619691... |
func (f *Fixture) GetClientForAPIVersionAndKind(
apiversion string,
kind string,
) (*clientset.ResourceClient, error) {
if f.getClientForAPIVersionAndKindFn != nil {
return f.getClientForAPIVersionAndKindFn(apiversion, kind)
}
return f.dynamicClientset.GetClientForAPIVersionAndKind(
apiversion,
kind,
)
} | [
-0.6394975185394287,
-1.1794497966766357,
0.23700644075870514,
-0.20938850939273834,
-0.09161873906850815,
-1.0931841135025024,
0.4014553129673004,
-0.8370325565338135,
-0.5250614285469055,
-0.24881118535995483,
1.0711085796356201,
1.491701364517212,
-0.42191556096076965,
-0.30861723423004... |
func (f *Fixture) GetClientForAPIVersionAndResource(
apiversion string,
resource string,
) (*clientset.ResourceClient, error) {
if f.getClientForAPIVersionAndResourceFn != nil {
return f.getClientForAPIVersionAndResourceFn(apiversion, resource)
}
return f.dynamicClientset.GetClientForAPIVersionAndResource(
api... | [
-0.27988433837890625,
-1.5153236389160156,
0.2656915485858917,
-0.0440802201628685,
-0.47973573207855225,
-0.6360601186752319,
0.8202782273292542,
-0.4841160476207733,
-0.2974046766757965,
-0.576145589351654,
0.6968219876289368,
0.7482730746269226,
0.301617294549942,
-0.6177008748054504,
... |
func (f *Fixture) GetAPIForAPIVersionAndResource(
apiversion string,
resource string,
) *dynamicdiscovery.APIResource {
if f.getAPIForAPIVersionAndResourceFn != nil {
return f.getAPIForAPIVersionAndResourceFn(apiversion, resource)
}
return f.apiDiscovery.
GetAPIForAPIVersionAndResource(
apiversion,
resou... | [
-0.01562164444476366,
-1.2427915334701538,
0.2880772054195404,
0.5709620714187622,
-0.5785182118415833,
-0.8954805135726929,
-0.041129808872938156,
0.29840072989463806,
0.5764015316963196,
-0.5633106231689453,
-0.20135298371315002,
-0.3164554536342621,
0.2552186846733093,
0.024238528683781... |
func (f *Fixture) GetDiscoveryAPIForAPIVersionAndResource(
apiversion string,
resource string,
) *dynamicdiscovery.APIResource {
return f.apiDiscovery.
GetAPIForAPIVersionAndResource(
apiversion,
resource,
)
} | [
-0.119538813829422,
-1.243933916091919,
0.22163012623786926,
0.5637092590332031,
-0.7634888887405396,
-0.40932267904281616,
-0.1773974448442459,
0.4832337498664856,
0.32130980491638184,
-0.26947370171546936,
-0.3704715967178345,
-0.5140209794044495,
0.2603633403778076,
-0.11104905605316162... |
func (f *Fixture) GetDiscoveryAPIForAPIVersionAndKind(
apiversion string,
kind string,
) *dynamicdiscovery.APIResource {
return f.apiDiscovery.
GetAPIForAPIVersionAndKind(
apiversion,
kind,
)
} | [
-0.48390743136405945,
-1.101012945175171,
0.22599954903125763,
0.34239301085472107,
-0.3791649341583252,
-0.9296760559082031,
-0.30818861722946167,
0.15015213191509247,
0.08903665840625763,
0.0456404983997345,
-0.04200754687190056,
0.29847538471221924,
-0.17553481459617615,
0.0486080683767... |
func (f *Fixture) GetAPIResourcesForKind(kind string) []*metav1.APIResource {
return f.apiDiscovery.GetAPIResourcesForKind(kind)
} | [
-0.8701003193855286,
-0.4549656808376312,
0.2553427517414093,
-0.39193350076675415,
0.14026451110839844,
-1.322021484375,
-0.1403762698173523,
-0.08441564440727234,
0.24147115647792816,
-0.2860282063484192,
-0.5710195302963257,
-0.31098130345344543,
-0.31960350275039673,
0.592437207698822,... |
func NewWorker(inputFile, outputFile, parseScript string, workerCount int) *Worker {
return &Worker{
InPage: make(chan *Page, 0),
OutText: make(chan []byte, 0),
OutputFile: outputFile,
InputFile: inputFile,
ParseScript: parseScript,
workerCount: workerCount,
wg: &sync.WaitGroup{},
}... | [
0.1453210413455963,
-0.7551186084747314,
0.4298032522201538,
0.21617768704891205,
-0.9773547053337097,
0.2055191546678543,
0.1736394613981247,
0.010858545079827309,
-0.9358261227607727,
-0.04962582141160965,
-0.1326342672109604,
0.15941499173641205,
-0.8037639260292053,
0.1153937578201294,... |
func (w *Worker) Start() {
for i := 1; i <= w.workerCount; i++ {
log.Println("starting worker:", i)
go w.startWorker()
}
go w.startWriter()
w.startReader()
// Let the workers finish, then exit
w.wg.Wait()
close(w.OutText)
} | [
-0.47770896553993225,
-0.5505779385566711,
0.2765115797519684,
0.3054206967353821,
0.04245278984308243,
0.2756756842136383,
1.03653085231781,
0.34453684091567993,
-1.202565312385559,
-0.07114747911691666,
-0.2297981232404709,
0.4045559763908386,
-0.9058990478515625,
0.608161211013794,
-1... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.