text stringlengths 11 6.3k | embedding listlengths 768 768 |
|---|---|
func (o *RegisterRecipientToProgramOK) SetPayload(payload interface{}) {
o.Payload = payload
} | [
-0.19027358293533325,
1.1224582195281982,
0.10178171843290329,
-0.46083033084869385,
-0.22124846279621124,
0.02509000152349472,
0.5862496495246887,
0.12964653968811035,
0.4072527289390564,
0.8183814287185669,
-0.3549109399318695,
-0.08906319737434387,
-0.72637540102005,
-0.1779240816831588... |
func (o *RegisterRecipientToProgramOK) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) {
rw.WriteHeader(200)
payload := o.Payload
if err := producer.Produce(rw, payload); err != nil {
panic(err) // let the recovery middleware deal with this
}
} | [
-0.5870802998542786,
0.41642042994499207,
0.14160430431365967,
-0.24597395956516266,
0.828065037727356,
-0.6345670819282532,
0.8735266923904419,
0.06446046382188797,
0.4511875510215759,
1.0576063394546509,
-0.029783140867948532,
-0.036187976598739624,
-0.7911399006843567,
-0.50692820549011... |
func NewRegisterRecipientToProgramBadRequest() *RegisterRecipientToProgramBadRequest {
return &RegisterRecipientToProgramBadRequest{}
} | [
-0.5829620361328125,
0.5228275656700134,
0.09778944402933121,
-0.05830628424882889,
0.16711309552192688,
-0.15684571862220764,
-0.22399753332138062,
0.5610426068305969,
-0.1855817288160324,
-0.08126895874738693,
-0.43101128935813904,
0.7285279035568237,
-0.3488077223300934,
-0.196759223937... |
func (o *RegisterRecipientToProgramBadRequest) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) {
rw.Header().Del(runtime.HeaderContentType) //Remove Content-Type on empty responses
rw.WriteHeader(400)
} | [
-0.7620591521263123,
0.1056591346859932,
0.3000478446483612,
0.13155798614025116,
1.3317610025405884,
-0.41712576150894165,
0.16544587910175323,
-0.22943878173828125,
0.05042069032788277,
0.4117428660392761,
-0.036124613136053085,
0.3261066973209381,
-1.242060899734497,
0.01002081762999296... |
func NewRegisterRecipientToProgramUnauthorized() *RegisterRecipientToProgramUnauthorized {
return &RegisterRecipientToProgramUnauthorized{}
} | [
-0.48204147815704346,
0.6630982160568237,
0.10487908869981766,
-0.3000970482826233,
-0.5418111085891724,
0.14354753494262695,
0.5211628675460815,
0.9828423857688904,
0.14700236916542053,
-0.16467849910259247,
-0.5865753293037415,
1.4923911094665527,
-0.5273265242576599,
-1.3656784296035767... |
func (o *RegisterRecipientToProgramUnauthorized) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) {
rw.Header().Del(runtime.HeaderContentType) //Remove Content-Type on empty responses
rw.WriteHeader(401)
} | [
-0.8119129538536072,
0.2694008946418762,
0.21003806591033936,
-0.10483916848897934,
0.7206165194511414,
-0.2212790697813034,
0.8396919965744019,
0.3147364854812622,
0.21673767268657684,
0.5069000124931335,
-0.22684304416179657,
0.6565834879875183,
-1.19015634059906,
-0.6991589665412903,
... |
func (o *RegisterRecipientToProgramInternalServerError) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) {
rw.Header().Del(runtime.HeaderContentType) //Remove Content-Type on empty responses
rw.WriteHeader(500)
} | [
-0.9138393402099609,
0.11852004379034042,
0.22333717346191406,
-0.2954193353652954,
0.9651960134506226,
-0.5617523193359375,
1.1848517656326294,
0.1333988606929779,
0.20091775059700012,
0.6694765686988831,
-0.003087384393438697,
0.4672265350818634,
-1.5406233072280884,
0.10627339035272598,... |
func (app ApplicationArguments) Switch(name, description string, shorts ...rune) *kingpin.FlagClause {
return app.add(name, description, true, shorts...)
} | [
0.6701950430870056,
-0.2931308150291443,
0.44772958755493164,
0.7013949155807495,
-0.3010994791984558,
1.3267796039581299,
-1.3756492137908936,
0.4152030348777771,
-0.45601218938827515,
0.0931757390499115,
0.019202571362257004,
0.89032381772995,
-0.48130202293395996,
-0.08122628927230835,
... |
func (app ApplicationArguments) Argument(name, description string, shorts ...rune) *kingpin.FlagClause {
return app.add(name, description, false, shorts...)
} | [
0.4644423723220825,
-0.5316222906112671,
0.28412413597106934,
0.290300190448761,
-0.0808604508638382,
1.2704987525939941,
-0.4000001847743988,
0.21353188157081604,
-0.09996189177036285,
0.19786161184310913,
0.565240204334259,
1.5265296697616577,
-0.33727461099624634,
1.047331690788269,
-... |
func (app ApplicationArguments) SplitManaged(args []string) (managed []string, unmanaged []string) {
Arg:
for i := 1; i < len(args); i++ {
arg := args[i]
if arg == "--" {
unmanaged = append(unmanaged, args[i+1:]...)
break
}
if strings.HasPrefix(arg, "--") {
argSplit := strings.Split(args[i][2:], "=")
... | [
-0.21378128230571747,
-0.026783177629113197,
0.7445955872535706,
-0.008968144655227661,
0.17069192230701447,
-0.16562201082706451,
-0.5378292798995972,
0.019332846626639366,
0.09496068209409714,
0.5563995838165283,
0.43217989802360535,
1.4902290105819702,
-0.636584997177124,
1.447314262390... |
func NewApplication(app *kingpin.Application) ApplicationArguments {
return ApplicationArguments{
Application: app,
longs: map[string]bool{
"help-man": true,
"help-long": true,
"completion-bash": true,
"completion-script-bash": true,
"completion-script-zsh": true,
... | [
0.3954455554485321,
-0.5148718357086182,
0.3413000702857971,
0.5193668603897095,
-0.48133012652397156,
0.22010594606399536,
-0.05985879898071289,
-0.3471013903617859,
-0.16730596125125885,
0.7833648920059204,
0.3903808295726776,
0.28948259353637695,
0.04733983427286148,
1.0154592990875244,... |
func (s *State) ApplyAnswer(clue string, answer string, onlyCorrect bool) error {
num, direction, err := ParseClue(clue)
if err != nil {
return err
}
cells, err := ParseAnswer(answer)
if err != nil {
return err
}
minX, minY, maxX, maxY, err := s.Puzzle.GetAnswerCoordinates(num, direction)
if err != nil {
... | [
-0.29794982075691223,
0.11522035300731659,
0.8812705278396606,
0.006212913431227207,
-0.5627750754356384,
-0.4004283547401428,
0.5212227702140808,
0.3671082854270935,
0.41703104972839355,
0.22652196884155273,
0.7024011015892029,
0.6296485066413879,
-0.18551713228225708,
0.6021024584770203,... |
func (s *State) ClearIncorrectCells() error {
for y := 0; y < s.Puzzle.Rows; y++ {
for x := 0; x < s.Puzzle.Cols; x++ {
if s.Cells[y][x] != "" && s.Cells[y][x] != s.Puzzle.Cells[y][x] {
s.Cells[y][x] = ""
}
}
}
// Now that we may have modified one or more cells we need to determine which
// clues are... | [
0.12270907312631607,
-0.129331573843956,
0.4636530578136444,
-0.0012202328070998192,
-0.25195929408073425,
0.02338470332324505,
0.4003104865550995,
-0.36129385232925415,
-0.13336090743541718,
0.7261447310447693,
0.5019851922988892,
0.789606511592865,
-0.23953871428966522,
0.846892595291137... |
func (s *State) UpdateFilledClues() error {
for num := range s.Puzzle.CluesAcross {
minX, y, maxX, _, err := s.Puzzle.GetAnswerCoordinates(num, "a")
if err != nil {
return fmt.Errorf("somehow got invalid clue id %d from CluesAcross", num)
}
complete := true
for x := minX; x <= maxX; x++ {
if s.Cells[y... | [
0.273885577917099,
-0.4249390661716461,
0.7002478837966919,
-0.8014792799949646,
-0.3407368063926697,
0.2180604785680771,
0.554583728313446,
-0.3486933708190918,
-0.22780558466911316,
0.44751623272895813,
-0.22358539700508118,
0.03460681438446045,
-1.146619200706482,
0.9926146268844604,
... |
func ParseClue(clue string) (int, string, error) {
clue = strings.ToLower(strings.TrimSpace(clue))
if len(clue) <= 1 {
return 0, "", fmt.Errorf("unable to parse clue: %s", clue)
}
dir := clue[len(clue)-1:]
if dir != "a" && dir != "d" {
return 0, "", fmt.Errorf("unable to parse clue: %s", clue)
}
num, err :... | [
-0.5561057925224304,
-0.430205374956131,
0.9493304491043091,
-0.4630228579044342,
-0.04578062891960144,
-1.0508430004119873,
1.0843902826309204,
0.6794926524162292,
0.581169068813324,
0.46318456530570984,
-0.19406522810459137,
0.327894002199173,
-0.535096287727356,
0.7864232063293457,
1.... |
func ParseAnswer(answer string) ([]string, error) {
var cells []string
var inside bool
for _, c := range strings.ToUpper(answer) {
switch {
case c == ' ':
continue
case c == '(':
if inside {
return nil, fmt.Errorf("unable to parse answer, nested groups: %s", answer)
}
inside = true
cells =... | [
-0.36638015508651733,
-0.1761159747838974,
1.0575071573257446,
0.6619874835014343,
-1.0346664190292358,
-0.662263810634613,
0.09526686370372772,
-0.9652793407440186,
0.6204802989959717,
0.6211972236633301,
0.08179979771375656,
0.2568722069263458,
-0.47711777687072754,
0.10355032980442047,
... |
func StateKey(name string) string {
return fmt.Sprintf("%s:crossword:state", name)
} | [
-0.3766266703605652,
0.027254249900579453,
0.48782244324684143,
-0.6570709347724915,
-0.3080351650714874,
0.07851079851388931,
-0.1787852644920349,
-0.049319054931402206,
0.3645060360431671,
2.6469082832336426,
0.11629993468523026,
0.11439067125320435,
-0.358378142118454,
0.424648165702819... |
func GetState(conn db.Connection, channel string) (State, error) {
var state State
if testStateLoadError != nil {
return state, testStateLoadError
}
err := db.Get(conn, StateKey(channel), &state)
return state, err
} | [
0.04210551083087921,
0.3210229277610779,
0.45089617371559143,
-0.15011990070343018,
0.7732731699943542,
-0.765674889087677,
-0.2430136352777481,
-0.6422600746154785,
0.2044280618429184,
0.3489677906036377,
-0.013734525069594383,
0.5419985055923462,
-1.6156516075134277,
0.5076817870140076,
... |
func SetState(conn db.Connection, channel string, state State) error {
if testStateSaveError != nil {
return testStateSaveError
}
return db.SetWithTTL(conn, StateKey(channel), state, StateTTL)
} | [
-0.28082573413848877,
0.5471633672714233,
0.34239229559898376,
-0.5143157839775085,
0.6108585000038147,
-0.3483806550502777,
-0.44546598196029663,
0.10494726896286011,
-0.12701013684272766,
0.8520810008049011,
-0.7804211974143982,
-0.19258910417556763,
-1.0922825336456299,
0.52501708269119... |
func GetAllChannels(conn db.Connection) ([]model.Channel, error) {
keys, err := db.ScanKeys(conn, StateKey("*"))
if err != nil {
return nil, err
}
values, err := db.GetAll(conn, keys, State{})
if err != nil {
return nil, err
}
channels := make([]model.Channel, 0)
for key, value := range values {
name :=... | [
-0.13492807745933533,
-0.06691720336675644,
0.4731888473033905,
0.2819119393825531,
-0.13786320388317108,
-0.13373689353466034,
-0.9484428763389587,
-0.4977129399776459,
-0.14427223801612854,
-0.12247681617736816,
0.11172497272491455,
0.2688673436641693,
-0.2592902183532715,
0.876388251781... |
func NewTrail(ctx *pulumi.Context,
name string, args *TrailArgs, opts ...pulumi.ResourceOption) (*Trail, error) {
if args == nil {
return nil, errors.New("missing one or more required arguments")
}
if args.IsLogging == nil {
return nil, errors.New("invalid value for required argument 'IsLogging'")
}
if args.... | [
0.2034974992275238,
0.9608344435691833,
0.591074526309967,
0.024725554510951042,
0.33089616894721985,
0.7736217379570007,
-0.7515241503715515,
-0.06740594655275345,
-0.2297559529542923,
0.16780728101730347,
-0.9572950601577759,
0.07636978477239609,
-0.3347049355506897,
0.10150134563446045,... |
func GetTrail(ctx *pulumi.Context,
name string, id pulumi.IDInput, state *TrailState, opts ...pulumi.ResourceOption) (*Trail, error) {
var resource Trail
err := ctx.ReadResource("aws-native:cloudtrail:Trail", name, id, state, &resource, opts...)
if err != nil {
return nil, err
}
return &resource, nil
} | [
0.7707058191299438,
0.5653212666511536,
0.32030215859413147,
0.11810525506734848,
0.5010595917701721,
0.44560378789901733,
-0.5436389446258545,
-0.3910161852836609,
0.4362671673297882,
-0.3584209382534027,
-0.57152259349823,
1.3645734786987305,
0.3160676956176758,
-1.115149736404419,
-0.... |
func (o TrailOutput) AdvancedEventSelectors() TrailAdvancedEventSelectorArrayOutput {
return o.ApplyT(func(v *Trail) TrailAdvancedEventSelectorArrayOutput { return v.AdvancedEventSelectors }).(TrailAdvancedEventSelectorArrayOutput)
} | [
-0.632623016834259,
-1.089290976524353,
1.1038168668746948,
-0.13395079970359802,
0.4508208632469177,
-0.0673479214310646,
0.35521167516708374,
-0.9528135061264038,
0.4678691029548645,
-0.29636579751968384,
-0.5486971139907837,
0.056907132267951965,
1.1458914279937744,
0.04611702263355255,... |
func (o TrailOutput) CloudWatchLogsLogGroupArn() pulumi.StringPtrOutput {
return o.ApplyT(func(v *Trail) pulumi.StringPtrOutput { return v.CloudWatchLogsLogGroupArn }).(pulumi.StringPtrOutput)
} | [
0.751918613910675,
0.06883813440799713,
0.35181546211242676,
-0.45412009954452515,
0.01963653787970543,
0.6462521553039551,
0.26485899090766907,
0.5094813704490662,
-0.12855860590934753,
-0.36194249987602234,
-0.14882083237171173,
2.0644991397857666,
0.5830370187759399,
-0.6779806017875671... |
func (o TrailOutput) CloudWatchLogsRoleArn() pulumi.StringPtrOutput {
return o.ApplyT(func(v *Trail) pulumi.StringPtrOutput { return v.CloudWatchLogsRoleArn }).(pulumi.StringPtrOutput)
} | [
1.4237923622131348,
-0.28446024656295776,
0.4675503075122833,
-0.6354512572288513,
0.6147962212562561,
0.7595641613006592,
-0.028994649648666382,
0.18447744846343994,
0.40771088004112244,
-0.16153307259082794,
-0.7760412693023682,
1.4489825963974,
0.5011831521987915,
-1.0914040803909302,
... |
func (o TrailOutput) EnableLogFileValidation() pulumi.BoolPtrOutput {
return o.ApplyT(func(v *Trail) pulumi.BoolPtrOutput { return v.EnableLogFileValidation }).(pulumi.BoolPtrOutput)
} | [
1.5621311664581299,
-0.12687470018863678,
0.6282269954681396,
0.4253009259700775,
0.2372763603925705,
1.307839274406433,
0.1748153269290924,
1.089859962463379,
-0.7493541836738586,
-0.5235386490821838,
-0.5170125961303711,
0.5046463012695312,
-0.45010992884635925,
-0.6404410600662231,
-1... |
func (o TrailOutput) EventSelectors() TrailEventSelectorArrayOutput {
return o.ApplyT(func(v *Trail) TrailEventSelectorArrayOutput { return v.EventSelectors }).(TrailEventSelectorArrayOutput)
} | [
-0.5079725980758667,
-0.8889921307563782,
0.7550261616706848,
0.18377113342285156,
1.047887921333313,
-0.46726617217063904,
0.5339869856834412,
-0.8268436789512634,
0.7386903762817383,
-0.5493153929710388,
-0.3849215507507324,
0.38911378383636475,
0.7657292485237122,
-0.5647252798080444,
... |
func (o TrailOutput) IncludeGlobalServiceEvents() pulumi.BoolPtrOutput {
return o.ApplyT(func(v *Trail) pulumi.BoolPtrOutput { return v.IncludeGlobalServiceEvents }).(pulumi.BoolPtrOutput)
} | [
0.7898749113082886,
0.9149022102355957,
0.9586506485939026,
0.8986412882804871,
-0.3081875741481781,
1.7992914915084839,
0.7215979099273682,
0.5092758536338806,
0.1797313690185547,
0.47235769033432007,
-0.3014608919620514,
0.7265737056732178,
-0.8872711658477783,
-0.003990619909018278,
-... |
func (o TrailOutput) InsightSelectors() TrailInsightSelectorArrayOutput {
return o.ApplyT(func(v *Trail) TrailInsightSelectorArrayOutput { return v.InsightSelectors }).(TrailInsightSelectorArrayOutput)
} | [
-0.6945956945419312,
-0.3881802260875702,
0.47920891642570496,
-0.14919263124465942,
1.2872358560562134,
0.39395764470100403,
0.6492568850517273,
-0.7991406321525574,
1.1127606630325317,
-0.7050564289093018,
-0.30611512064933777,
0.6819944381713867,
0.6019951701164246,
-0.5094383358955383,... |
func (o TrailOutput) IsLogging() pulumi.BoolOutput {
return o.ApplyT(func(v *Trail) pulumi.BoolOutput { return v.IsLogging }).(pulumi.BoolOutput)
} | [
0.1469552218914032,
0.7595202922821045,
0.6696193218231201,
1.2651666402816772,
0.5088823437690735,
0.7834039330482483,
-0.11904370039701462,
0.42618072032928467,
0.27323925495147705,
0.1469903290271759,
-0.24490255117416382,
0.7645491361618042,
-0.029367240145802498,
-0.42892563343048096,... |
func (o TrailOutput) IsMultiRegionTrail() pulumi.BoolPtrOutput {
return o.ApplyT(func(v *Trail) pulumi.BoolPtrOutput { return v.IsMultiRegionTrail }).(pulumi.BoolPtrOutput)
} | [
0.06155579909682274,
0.6338410377502441,
0.6050181984901428,
0.7708032131195068,
0.2793216407299042,
1.0285370349884033,
0.19081193208694458,
-0.04720260575413704,
-0.3160400092601776,
0.4715340733528137,
-0.4451129734516144,
-0.04486314207315445,
-0.001784949330613017,
0.27143594622612,
... |
func (o TrailOutput) IsOrganizationTrail() pulumi.BoolPtrOutput {
return o.ApplyT(func(v *Trail) pulumi.BoolPtrOutput { return v.IsOrganizationTrail }).(pulumi.BoolPtrOutput)
} | [
0.5719124674797058,
0.38734230399131775,
0.39066609740257263,
0.9699891805648804,
0.6083375215530396,
1.0584423542022705,
0.5958191752433777,
-0.2539689540863037,
-0.007876063697040081,
0.48406487703323364,
-0.018643876537680626,
0.47424590587615967,
0.11552143096923828,
-0.399389564990997... |
func (o TrailOutput) KmsKeyId() pulumi.StringPtrOutput {
return o.ApplyT(func(v *Trail) pulumi.StringPtrOutput { return v.KmsKeyId }).(pulumi.StringPtrOutput)
} | [
1.1616986989974976,
-0.18258561193943024,
0.31805092096328735,
0.024078650400042534,
0.08571281284093857,
0.942055344581604,
-0.16924794018268585,
0.31934258341789246,
-0.015765022486448288,
0.03627529367804527,
-0.02838939242064953,
0.7149375081062317,
0.20228354632854462,
-0.408714175224... |
func (o TrailOutput) S3BucketName() pulumi.StringOutput {
return o.ApplyT(func(v *Trail) pulumi.StringOutput { return v.S3BucketName }).(pulumi.StringOutput)
} | [
0.9576034545898438,
0.13152076303958893,
0.6514334082603455,
0.13568945229053497,
-0.26382893323898315,
1.5514204502105713,
-0.06544753164052963,
-0.050159573554992676,
-0.3304034471511841,
0.27364808320999146,
0.10263510793447495,
0.4517485499382019,
1.2377820014953613,
-1.451526761054992... |
func (o TrailOutput) S3KeyPrefix() pulumi.StringPtrOutput {
return o.ApplyT(func(v *Trail) pulumi.StringPtrOutput { return v.S3KeyPrefix }).(pulumi.StringPtrOutput)
} | [
0.5649076104164124,
-0.22719991207122803,
0.5059496760368347,
-0.03761006146669388,
0.09429999440908432,
1.2427847385406494,
-0.28627946972846985,
0.34548020362854004,
1.0361093282699585,
0.7122460603713989,
-0.5113171935081482,
1.1105375289916992,
0.2603805661201477,
-1.7851121425628662,
... |
func (o TrailOutput) SnsTopicName() pulumi.StringPtrOutput {
return o.ApplyT(func(v *Trail) pulumi.StringPtrOutput { return v.SnsTopicName }).(pulumi.StringPtrOutput)
} | [
0.9408320784568787,
0.0596979558467865,
0.48285073041915894,
-0.045180853456258774,
-0.15220780670642853,
1.1636439561843872,
-0.5382700562477112,
-0.3007611930370331,
0.11346402764320374,
0.3197571039199829,
-0.17888708412647247,
-0.10131017863750458,
0.6583459377288818,
-1.09104955196380... |
func (c *cluster) Peer(nodeId uint64) (uint64, bool) {
for idx := range c.node.peersAddr {
if uint64(idx+1) != nodeId {
return uint64(idx + 1), true
}
}
return 0, false
} | [
-1.3596645593643188,
0.28571200370788574,
0.6626856327056885,
-0.31534332036972046,
-0.4358404278755188,
-0.47443273663520813,
0.2990664839744568,
0.07519381493330002,
0.08511967211961746,
0.8580339550971985,
0.09185934066772461,
0.4660494029521942,
-1.0148745775222778,
0.767719566822052,
... |
func StartRaftNodes(eng engine.Engine, grpcSrv *grpc.Server, peers []string, myAddr string) {
clus = new(cluster)
clus.eng = eng
clus.ctx, clus.cancel = context.WithCancel(context.Background())
clus.wal = raftwal.Init(eng, config.RaftId)
clus.mapLock = &sync.Mutex{}
var wg sync.WaitGroup
clus.myAddr = myAddr
... | [
-0.5169318318367004,
0.2188546508550644,
0.6870213747024536,
-0.4639098346233368,
0.33234918117523193,
-0.13642826676368713,
0.7861596941947937,
0.5133733153343201,
-0.4808179438114166,
0.4515727460384369,
0.010526152327656746,
1.6311633586883545,
-0.2541942298412323,
0.2577740252017975,
... |
func BlockingStop() {
clus.Node().Stop() // blocking stop all nodes
transport.StopServer()
// blocking sync all marks
_, cancel := context.WithTimeout(context.Background(), 5*time.Minute)
defer cancel()
} | [
0.12440553307533264,
0.5760427117347717,
0.6140231490135193,
0.8330509662628174,
0.17038187384605408,
0.8209032416343689,
0.49676063656806946,
-0.3656063377857208,
-1.3165868520736694,
1.2690222263336182,
-0.20330938696861267,
-0.4822966456413269,
-0.13526107370853424,
-0.7460637092590332,... |
func NewBinaryEncoding(c Constructor) *BinaryEncoding {
return &BinaryEncoding{Constructor: c}
} | [
0.21157360076904297,
-0.05325214937329292,
0.060580648481845856,
1.1008083820343018,
-0.8409164547920227,
-1.3076627254486084,
0.01710517704486847,
-0.17467857897281647,
-0.0909246876835823,
-0.5961780548095703,
-1.7345889806747437,
-0.5315243005752563,
-0.22186580300331116,
0.467327743768... |
func (e BinaryEncoding) Read(r io.Reader, objs ...interface{}) error {
de := decoder{e.Constructor, r}
for i := 0; i < len(objs); i++ {
// XXX check that it's a by-reference type
// (pointer, slice, etc.) and complain if not,
// to head of accidental misuse?
if err := de.value(reflect.ValueOf(objs[i]), 0); er... | [
-1.06387460231781,
-0.4189182221889496,
0.7104763984680176,
0.7443726658821106,
0.292766809463501,
-0.35202541947364807,
0.6808964014053345,
-0.3812921643257141,
-0.7275417447090149,
0.21993261575698853,
-0.06524869799613953,
-0.027414465323090553,
-0.34817925095558167,
1.026939868927002,
... |
func (e BinaryEncoding) Write(w io.Writer, objs ...interface{}) error {
en := encoder{w}
for i := 0; i < len(objs); i++ {
if err := en.value(objs[i], 0); err != nil {
return err
}
}
return nil
} | [
-1.589654564857483,
-0.14635968208312988,
0.4578586220741272,
1.200648307800293,
0.9677320122718811,
0.40679073333740234,
0.2658615708351135,
0.1033560186624527,
-0.7032800912857056,
0.5156828761100769,
-0.6495447754859924,
-0.577340304851532,
-0.22728231549263,
1.1869934797286987,
-0.93... |
func Read(r io.Reader, c Constructor, objs ...interface{}) error {
return NewBinaryEncoding(c).Read(r, objs)
} | [
-0.38039079308509827,
-0.6896510124206543,
0.3488859534263611,
0.5746998190879822,
-0.3301416337490082,
0.38671547174453735,
0.07705894112586975,
-0.3649400472640991,
-0.719691276550293,
-0.398891806602478,
-0.7457588315010071,
-0.4001207649707794,
-0.06307780742645264,
0.26193058490753174... |
func Write(w io.Writer, objs ...interface{}) error {
return NewBinaryEncoding(nil).Write(w, objs)
} | [
-1.002889633178711,
-0.1287839263677597,
0.353324294090271,
1.6620063781738281,
0.5487985014915466,
-0.0010523498058319092,
0.2053592950105667,
-0.4001910388469696,
-0.2891896367073059,
-0.1795007288455963,
-0.9608879089355469,
-0.8670009970664978,
-0.24840512871742249,
1.007165551185608,
... |
func (tx *EvmTransaction) WithSignature(sig []byte) (*EvmTransaction, error) {
r, s, v, err := SignatureValues(tx, sig)
if err != nil {
return nil, err
}
cpy := &EvmTransaction{data: tx.data}
cpy.data.R, cpy.data.S, cpy.data.V = r, s, v
return cpy, nil
} | [
0.21479755640029907,
-0.32915186882019043,
0.34369590878486633,
-0.4002140164375305,
-0.8382567763328552,
-1.2814711332321167,
-0.2950264811515808,
-0.06799466162919998,
0.3125370144844055,
0.5270741581916809,
-1.4172312021255493,
-1.060556411743164,
0.09613770246505737,
-0.149768084287643... |
func SignTx(tx *EvmTransaction, prv *ecdsa.PrivateKey) (*EvmTransaction, error) {
h := tx.getUnsignedHash()
sig, err := crypto.Sign(h[:], prv)
if err != nil {
return nil, err
}
return tx.WithSignature(sig)
} | [
-0.40485987067222595,
-0.06611239165067673,
0.5202395915985107,
-0.48455482721328735,
0.012249085120856762,
0.2089451104402542,
-0.9625268578529358,
0.33604440093040466,
0.36470040678977966,
0.313085675239563,
-1.0226994752883911,
-0.5266615748405457,
-0.01284184679389,
-0.505433976650238,... |
func SignatureValues(tx *EvmTransaction, sig []byte) (R, S, V *big.Int, err error) {
if len(sig) != 65 {
panic(fmt.Sprintf("wrong size for signature: got %d, want 65", len(sig)))
}
R = new(big.Int).SetBytes(sig[:32])
S = new(big.Int).SetBytes(sig[32:64])
V = new(big.Int).SetBytes([]byte{sig[64] + 27})
return R... | [
0.1129692941904068,
0.7711833715438843,
0.5336083173751831,
-0.40964218974113464,
-0.577538013458252,
-1.0002894401550293,
-0.28385642170906067,
0.4087238311767578,
-0.25741493701934814,
0.123869888484478,
-1.0646636486053467,
-0.6336157917976379,
-0.0011600516736507416,
0.4435006380081177... |
func SendDiscordLogEntry(message string) {
// Create WebhookInfo
info := WebhookInfo{}
// Sets the content
info.Content = message + "\n"
// Encode JSON
raw, _ := json.Marshal(info)
// Post the JSON to URL
response, err := http.Post(DiscordWebhookUrl, "application/json", bytes.NewBuffer(raw))
// Check if an e... | [
0.2698160707950592,
0.6682080030441284,
0.8931496739387512,
-0.5398195385932922,
0.4219266176223755,
-0.026452194899320602,
-0.01454350259155035,
0.15088260173797607,
-0.9259175062179565,
0.6346877813339233,
-0.7026187777519226,
1.4627277851104736,
-0.5617786645889282,
1.2614717483520508,
... |
func Configure(p *config.Provider) {
p.AddResourceConfigurator("azurerm_redis_cache", func(r *config.Resource) {
r.Version = common.VersionV1Alpha2
r.References = config.References{
"resource_group_name": config.Reference{
Type: rconfig.ResourceGroupReferencePath,
},
"subnet_id": config.Reference{
... | [
-0.1678832769393921,
0.696273922920227,
0.8896005153656006,
0.4491008520126343,
0.276620090007782,
-0.41529548168182373,
-0.13429796695709229,
0.22864945232868195,
0.16322603821754456,
0.7516090869903564,
-0.35445255041122437,
-0.19116945564746857,
0.04688021168112755,
1.2020257711410522,
... |
func (a *auth) GetTokenSource(ctx context.Context, ref reference.Named) (oauth2.TokenSource, error) {
source, err := google.DefaultTokenSource(ctx, gcrScope)
if nil != err {
err = fmt.Errorf("failed to get Google Auth token source: %s", err)
}
return source, err
} | [
-0.5901492834091187,
0.6505454778671265,
0.003022729652002454,
-0.3596329689025879,
-0.45828238129615784,
-1.0238970518112183,
-0.38786980509757996,
-0.37072059512138367,
0.6125808358192444,
0.6442718505859375,
-0.5911991000175476,
1.662413477897644,
-0.5666919946670532,
0.2881190180778503... |
func NewAuth() voucher.Auth {
return new(auth)
} | [
0.22189617156982422,
-0.42346784472465515,
-0.00959639623761177,
1.7850948572158813,
-1.1373867988586426,
-0.26042017340660095,
0.43503305315971375,
0.4010063707828522,
0.508836567401886,
-0.48898744583129883,
0.5646535158157349,
0.5076337456703186,
0.31477558612823486,
0.8425502181053162,... |
func (m *ServerMap) Add(server string, client Extension) error {
extensionMap := *m
if _, ok := extensionMap[server]; ok {
return fmt.Errorf("duplicate extension server found: %s", server)
}
extensionMap[server] = client
return nil
} | [
-0.35069799423217773,
-0.6130160093307495,
0.44900208711624146,
-0.18739305436611176,
0.03337324410676956,
0.6056991815567017,
-0.2362206131219864,
-0.12847480177879333,
0.7904008626937866,
0.002462648320943117,
-0.04736415296792984,
1.0968894958496094,
-0.9201127886772156,
0.4226349592208... |
func RequireAuthentication() gin.HandlerFunc {
return func(ctx *gin.Context) {
cookie, err := ctx.Request.Cookie("token")
if err != nil {
if err == http.ErrNoCookie {
ctx.AbortWithStatusJSON(http.StatusUnauthorized, gin.H{
"message": "Unauthorized",
})
return
}
ctx.AbortWithStatusJSON(htt... | [
-1.0994449853897095,
-0.20507963001728058,
0.5201664566993713,
0.5749877691268921,
-0.47221824526786804,
0.18199904263019562,
0.3776710331439972,
0.0296117402613163,
0.01678122766315937,
0.7858780026435852,
0.29729384183883667,
0.22504597902297974,
0.2740614712238312,
-0.36709514260292053,... |
func Authenticate(ctx *gin.Context) (*auth.Subject, error) {
var creds auth.Credentials
err := json.NewDecoder(ctx.Request.Body).Decode(&creds)
if err != nil {
ctx.AbortWithStatusJSON(http.StatusBadRequest, gin.H{
"message": "Bad Request",
})
return &auth.Subject{}, err
}
subject, token, err := auth.Auth... | [
-0.25439023971557617,
-0.17467845976352692,
0.6926838159561157,
0.34342220425605774,
-0.4703051745891571,
-0.302243173122406,
-0.7425180673599243,
-0.8342744708061218,
-0.4032471776008606,
0.4034256637096405,
0.8957538604736328,
1.0099685192108154,
0.08933697640895844,
-0.24750664830207825... |
func (s *Scan) ExecuteUAScan(config *ScanOptions, utils Utils) error {
// Download the unified agent jar file if one does not exist
if err := downloadAgent(config, utils); err != nil {
return err
}
// Auto generate a config file based on the working directory's contents.
// TODO/NOTE: Currently this scans the U... | [
-1.1332446336746216,
-0.35796016454696655,
0.9337414503097534,
0.44746583700180054,
0.1874709129333496,
0.12637218832969666,
0.9409953951835632,
0.09506392478942871,
0.4114733338356018,
0.2594446837902069,
0.7823318839073181,
-0.4352704584598541,
0.23081672191619873,
-0.28962090611457825,
... |
func downloadAgent(config *ScanOptions, utils Utils) error {
agentFile := config.AgentFileName
exists, err := utils.FileExists(agentFile)
if err != nil {
return fmt.Errorf("could not check whether the file '%s' exists: %w", agentFile, err)
}
if !exists {
err := utils.DownloadFile(config.AgentDownloadURL, agent... | [
0.2506243586540222,
-0.720045268535614,
0.5679685473442078,
-0.13325433433055878,
0.5538330674171448,
0.05730077996850014,
0.4997015595436096,
0.5707496404647827,
0.6771107316017151,
-0.11266032606363297,
0.3602970838546753,
-0.11798082292079926,
-0.019729571416974068,
0.28579941391944885,... |
func autoGenerateWhitesourceConfig(config *ScanOptions, utils Utils) error {
// TODO: Should we rely on -detect, or set the parameters manually?
if err := utils.RunExecutable("java", "-jar", config.AgentFileName, "-d", ".", "-detect"); err != nil {
return err
}
// Rename generated config file to config.ConfigFil... | [
-0.40367740392684937,
0.13900361955165863,
0.8727999329566956,
-0.29545921087265015,
0.12497465312480927,
0.13697132468223572,
1.1641970872879028,
0.27823612093925476,
-0.011792944744229317,
0.2836611568927765,
-0.006649140268564224,
0.023893708363175392,
0.3358742594718933,
1.329018592834... |
func (ctx *PQContext) Call(cmd string, params []string) apis.IResponse {
if ctx.finishFlag {
return mpqerr.ERR_CONN_CLOSING
}
ctx.callsCount += 1
switch cmd {
case PQ_CMD_POPLOCK:
return ctx.PopLock(params)
case PQ_CMD_POP:
return ctx.Pop(params)
case PQ_CMD_MSG_INFO:
return ctx.GetMessageInfo(params)
c... | [
-0.7611658573150635,
-0.6771706342697144,
1.0435806512832642,
0.24639806151390076,
-0.3695138096809387,
0.36681243777275085,
-0.49950703978538513,
-1.0308634042739868,
0.5045607686042786,
0.05199570953845978,
0.8401009440422058,
-0.09868161380290985,
-0.7851184606552124,
0.3445979952812195... |
func parseMessageIdOnly(params []string) (string, *mpqerr.ErrorResponse) {
if len(params) == 1 {
if mpqproto.ValidateItemId(params[0]) {
return params[0], nil
} else {
return "", mpqerr.ERR_ID_IS_WRONG
}
} else if len(params) == 0 {
return "", mpqerr.ERR_MSG_ID_NOT_DEFINED
}
return "", mpqerr.ERR_ONE_... | [
-0.04213888570666313,
-0.8961247801780701,
0.7224497199058533,
0.2141161561012268,
0.41612696647644043,
-0.32861006259918213,
-0.09475695341825485,
0.29920002818107605,
0.6790186762809753,
0.38276052474975586,
0.5059810876846313,
0.18197336792945862,
-1.224716305732727,
1.5326013565063477,... |
func parseReceiptOnly(params []string) (string, *mpqerr.ErrorResponse) {
if len(params) == 1 {
return params[0], nil
} else if len(params) > 1 {
return "", mpqerr.ERR_ONE_RECEIPT_ONLY
}
return "", mpqerr.ERR_NO_RECEIPT
} | [
-0.43633586168289185,
-0.10128958523273468,
0.6688191890716553,
-0.30290350317955017,
-0.44685685634613037,
-1.062750220298767,
-0.03109842538833618,
0.7994856834411621,
0.8617047071456909,
0.8159373998641968,
0.2199939340353012,
-0.4584484398365021,
0.17675231397151947,
1.0818918943405151... |
func (ctx *PQContext) PopLock(params []string) apis.IResponse {
var err *mpqerr.ErrorResponse
var limit int64 = 1
var asyncId string
popWaitTimeout := ctx.pq.config.PopWaitTimeout
lockTimeout := ctx.pq.config.PopLockTimeout
for len(params) > 0 {
switch params[0] {
case PRM_LOCK_TIMEOUT:
params, lockTimeo... | [
-0.7698436379432678,
0.12277457118034363,
0.9715403318405151,
0.35699498653411865,
0.14457665383815765,
0.2209867537021637,
-0.2851372957229614,
0.03265348821878433,
0.07133866846561432,
1.0635093450546265,
0.6179491877555847,
-0.10778357088565826,
-0.7560348510742188,
-0.05439130589365959... |
func (ctx *PQContext) Pop(params []string) apis.IResponse {
var err *mpqerr.ErrorResponse
var limit int64 = 1
var asyncId string
popWaitTimeout := ctx.pq.config.PopWaitTimeout
for len(params) > 0 {
switch params[0] {
case PRM_LIMIT:
params, limit, err = mpqproto.ParseInt64Param(params, 1, conf.CFG_PQ.MaxP... | [
-1.078012228012085,
0.06443185359239578,
0.8302960991859436,
0.2076333910226822,
0.16818033158779144,
0.2631329596042633,
0.00897189974784851,
0.05645138397812843,
-0.0851389616727829,
1.5240263938903809,
0.3968885540962219,
-0.5416572690010071,
-0.5120219588279724,
0.04355432465672493,
... |
func (ctx *PQContext) DeleteByReceipt(params []string) apis.IResponse {
rcpt, err := parseReceiptOnly(params)
if err != nil {
return err
}
return ctx.pq.DeleteByReceipt(rcpt)
} | [
0.08320444822311401,
0.014578747563064098,
0.7250797152519226,
0.484201043844223,
0.04430529847741127,
-0.6139094233512878,
0.5422536730766296,
-0.6192776560783386,
1.1215908527374268,
0.6713916063308716,
0.19810843467712402,
-0.993194580078125,
-0.35347744822502136,
-0.04815559834241867,
... |
func (ctx *PQContext) UnlockByReceipt(params []string) apis.IResponse {
rcpt, err := parseReceiptOnly(params)
if err != nil {
return err
}
return ctx.pq.UnlockByReceipt(rcpt)
} | [
-0.6940204501152039,
0.22022899985313416,
0.44939297437667847,
0.5146977305412292,
-0.2262638956308365,
-1.1211328506469727,
0.6408510804176331,
-0.7432403564453125,
1.0253008604049683,
0.6155431270599365,
0.08003015071153641,
-1.1386727094650269,
-1.0137748718261719,
-0.5923113822937012,
... |
func (ctx *PQContext) Push(params []string) apis.IResponse {
var err *mpqerr.ErrorResponse
var msgId string
var priority int64 = 0
var syncWait bool
var asyncId string
var payload string
cfg := ctx.pq.config
delay := cfg.DeliveryDelay
msgTtl := cfg.MsgTtl
for len(params) > 0 {
switch params[0] {
case PR... | [
-0.6377744674682617,
0.35011669993400574,
0.861803412437439,
0.1975235939025879,
-0.037794336676597595,
0.26890984177589417,
0.1262402981519699,
-0.28123414516448975,
-0.25430160760879517,
0.7028273940086365,
0.563886821269989,
0.15519662201404572,
-0.8450104594230652,
0.8962384462356567,
... |
func (ctx *PQContext) UpdateLockByRcpt(params []string) apis.IResponse {
var err *mpqerr.ErrorResponse
var rcpt string
var lockTimeout int64 = -1
for len(params) > 0 {
switch params[0] {
case PRM_RECEIPT:
params, rcpt, err = mpqproto.ParseReceiptParam(params)
case PRM_LOCK_TIMEOUT:
params, lockTimeout,... | [
-0.27676650881767273,
-0.43132227659225464,
0.6879364252090454,
-0.004295561462640762,
-0.030222449451684952,
0.17452186346054077,
0.01725194975733757,
-0.18099433183670044,
0.4308125078678131,
0.9775203466415405,
0.458307683467865,
-0.021527687087655067,
-1.1106719970703125,
0.24326285719... |
func (ctx *PQContext) UpdateLockById(params []string) apis.IResponse {
var err *mpqerr.ErrorResponse
var msgId string
var lockTimeout int64 = -1
for len(params) > 0 {
switch params[0] {
case PRM_ID:
params, msgId, err = mpqproto.ParseItemId(params)
case PRM_LOCK_TIMEOUT:
params, lockTimeout, err = mpqp... | [
-0.5149157047271729,
-0.8482288122177124,
0.7091463804244995,
0.38990819454193115,
-0.2585142254829407,
0.08373548090457916,
-0.3080935776233673,
-0.4436874985694885,
-0.04661548510193825,
1.011740803718567,
-0.012490716762840748,
0.6046395897865295,
-1.3566075563430786,
0.7241925001144409... |
func defineClientServerTest(desc string, f *framework.Framework, configures *generalTestConfigures) {
It(desc, func() {
runClientServerTest(f, configures)
})
} | [
-0.05930539220571518,
0.6991641521453857,
0.3399519622325897,
-0.012606998905539513,
0.27678391337394714,
0.39110857248306274,
1.1403992176055908,
-0.12782423198223114,
-0.01680193468928337,
-0.5469170212745667,
-0.39658698439598083,
-0.173988938331604,
-0.27621564269065857,
0.782003760337... |
func GetUsers(c *gin.Context) {
var users []models.User
log.Println("GetUsers from db")
db := db.GetDB()
db.Find(&users)
c.JSON(http.StatusOK, users)
} | [
-0.8202540278434753,
-0.008020886220037937,
0.4284582734107971,
0.74372798204422,
0.8407074213027954,
0.4212808310985565,
-0.0016952945152297616,
-0.1617477983236313,
-0.432617723941803,
0.3715819716453552,
0.03459843248128891,
0.6123098134994507,
-0.06936754286289215,
0.8977954983711243,
... |
func GetUser(c *gin.Context) {
log.Println("GetUser from db")
var user models.User
id := c.Param("id")
db := db.GetDB()
if err := db.Where("id = ?", id).First(&user).Error; err != nil {
c.AbortWithStatus(http.StatusNotFound)
log.Println("Failed to GetUser in db")
return
}
c.JSON(http.StatusOK, user)
} | [
-0.6487751007080078,
0.014076408930122852,
0.6759396195411682,
1.150983452796936,
0.3881811201572418,
0.27135971188545227,
0.2879880666732788,
-0.2615213394165039,
-0.26936256885528564,
0.059544045478105545,
-0.05158811807632446,
0.41784778237342834,
0.34747129678726196,
0.7336691617965698... |
func CreateUser(c *gin.Context) {
log.Println("CreateUser in db")
var user models.User
var db = db.GetDB()
if err := c.BindJSON(&user); err != nil {
c.AbortWithStatusJSON(http.StatusBadRequest, gin.H{
"error": err.Error(),
})
log.Println("Failed to create user in db")
return
}
// hash the password
use... | [
-0.5616999864578247,
-0.29297107458114624,
0.708437442779541,
0.8449300527572632,
0.7350248694419861,
0.38801121711730957,
-0.24546843767166138,
-0.1688118427991867,
-0.1918656975030899,
0.4337317645549774,
-0.6015461087226868,
-0.7375038862228394,
0.07486863434314728,
0.7016192078590393,
... |
func UpdateUser(c *gin.Context) {
id := c.Param("id")
log.Printf("UpdateUser in db %v", id)
var user models.User
db := db.GetDB()
if err := db.Where("id = ?", id).First(&user).Error; err != nil {
c.AbortWithStatus(http.StatusNotFound)
log.Println("Failed to UpdateUser in db")
return
}
c.BindJSON(&user)
d... | [
-1.4723834991455078,
-0.9327735304832458,
0.7446060180664062,
0.6012971997261047,
0.005909900646656752,
0.0038923840038478374,
0.8112595081329346,
0.008679406717419624,
-0.3144151270389557,
0.1372649222612381,
-0.8730828762054443,
0.08463515341281891,
0.18065574765205383,
0.868174493312835... |
func DeleteUser(c *gin.Context) {
id := c.Param("id")
log.Printf("DeleteUser in db %v", id)
var user models.User
db := db.GetDB()
if err := db.Where("id = ?", id).First(&user).Error; err != nil {
c.AbortWithStatus(http.StatusNotFound)
log.Println("Failed to DeleteUser in db")
return
}
db.Delete(&user)
} | [
-0.20735500752925873,
-0.059763144701719284,
0.630591869354248,
0.6486925482749939,
0.6670519113540649,
0.46063289046287537,
0.8378498554229736,
-0.0766529068350792,
-0.26756584644317627,
-0.5529413223266602,
0.3162497878074646,
0.10511545091867447,
-0.06920591741800308,
1.266768217086792,... |
func NewGetTeamsOK() *GetTeamsOK {
return &GetTeamsOK{}
} | [
0.5686711072921753,
0.1700713336467743,
0.02977423369884491,
0.8569556474685669,
-0.8892292976379395,
-0.28675514459609985,
0.5766353607177734,
-0.07971040904521942,
-0.6928007006645203,
-0.3278743326663971,
-1.1344521045684814,
-0.2828228175640106,
0.020614609122276306,
-0.376384198665618... |
func (o *GetTeamsOK) WithPayload(payload []*models.Team) *GetTeamsOK {
o.Payload = payload
return o
} | [
0.875382661819458,
0.541218638420105,
-0.20120593905448914,
0.38945895433425903,
-0.3929969072341919,
-0.3431122601032257,
0.23598821461200714,
-0.8240957856178284,
-0.3242940902709961,
-0.2658185064792633,
-0.2575531005859375,
-0.7235217690467834,
0.7375974655151367,
-0.4627719223499298,
... |
func (o *GetTeamsOK) SetPayload(payload []*models.Team) {
o.Payload = payload
} | [
0.3959413766860962,
0.6203505396842957,
-0.022958904504776,
0.4216519594192505,
-0.21028628945350647,
0.18674932420253754,
0.1265115737915039,
-0.9341604709625244,
-0.5950108170509338,
0.27286872267723083,
-0.47345688939094543,
-0.5088559985160828,
0.1672544777393341,
-0.024790743365883827... |
func (o *GetTeamsOK) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) {
rw.WriteHeader(200)
payload := o.Payload
if payload == nil {
// return empty array
payload = make([]*models.Team, 0, 50)
}
if err := producer.Produce(rw, payload); err != nil {
panic(err) // let the recovery middleware ... | [
-0.3248506486415863,
-0.13072094321250916,
0.2696726322174072,
0.6114056706428528,
0.607683539390564,
-0.483484148979187,
0.2382526993751526,
-0.541688084602356,
0.007476123981177807,
0.6556850075721741,
-0.2018641233444214,
-0.5342307686805725,
-0.29369327425956726,
-0.38825684785842896,
... |
func NewGetTeamsBadRequest() *GetTeamsBadRequest {
return &GetTeamsBadRequest{}
} | [
-0.1912505030632019,
0.29178643226623535,
0.2720411717891693,
0.44561347365379333,
-0.43037575483322144,
-0.41008710861206055,
-0.7590259909629822,
-0.19626130163669586,
-0.6164077520370483,
-1.2632187604904175,
-0.2186693251132965,
0.8310871720314026,
-0.266699880361557,
0.096486583352088... |
func (o *GetTeamsBadRequest) WithPayload(payload *models.Error) *GetTeamsBadRequest {
o.Payload = payload
return o
} | [
0.009994435124099255,
0.6037184596061707,
0.07496470957994461,
-0.025019025430083275,
-0.06783280521631241,
-0.4111832082271576,
-1.1057590246200562,
-1.040361762046814,
-0.06075261905789375,
-1.2121585607528687,
0.7871208190917969,
0.6846380829811096,
0.18863454461097717,
-0.0641781315207... |
func (o *GetTeamsBadRequest) SetPayload(payload *models.Error) {
o.Payload = payload
} | [
-0.5127680897712708,
0.6847823262214661,
0.0312967486679554,
-0.021554235368967056,
0.39814984798431396,
-0.11642122268676758,
-1.1775307655334473,
-1.0269752740859985,
-0.5693596601486206,
-0.5363027453422546,
0.3425860106945038,
1.2062809467315674,
-0.3470321595668793,
-0.049705587327480... |
func (o *GetTeamsBadRequest) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) {
rw.WriteHeader(400)
if o.Payload != nil {
payload := o.Payload
if err := producer.Produce(rw, payload); err != nil {
panic(err) // let the recovery middleware deal with this
}
}
} | [
-0.4321916103363037,
-0.1413203477859497,
0.4168955981731415,
0.5188769698143005,
1.0356979370117188,
-0.3088805079460144,
-0.5315591096878052,
-0.9670535922050476,
-0.002403941936790943,
-0.21024781465530396,
0.4393884539604187,
0.30458858609199524,
-0.3230937421321869,
-0.560983955860137... |
func NewGetTeamsForbidden() *GetTeamsForbidden {
return &GetTeamsForbidden{}
} | [
1.1540871858596802,
0.5275687575340271,
0.24845309555530548,
0.718816876411438,
-0.4551217257976532,
0.36271873116493225,
0.6072751879692078,
-0.9492638111114502,
-0.6166118383407593,
-1.3535996675491333,
-0.5268977284431458,
1.075195074081421,
-0.33718252182006836,
-0.9958397150039673,
... |
func (o *GetTeamsForbidden) WithPayload(payload *models.Error) *GetTeamsForbidden {
o.Payload = payload
return o
} | [
1.0790412425994873,
0.9734911322593689,
-0.1514732986688614,
0.22555649280548096,
-0.4059062898159027,
0.28454849123954773,
-0.030007118359208107,
-1.33306884765625,
-0.05810372903943062,
-1.0570238828659058,
0.4778895378112793,
0.497041791677475,
0.23821282386779785,
-0.7133618593215942,
... |
func (o *GetTeamsForbidden) SetPayload(payload *models.Error) {
o.Payload = payload
} | [
0.6102532148361206,
1.2439788579940796,
0.039957690984010696,
0.10686810314655304,
-0.20164701342582703,
0.5480917096138,
0.05431712791323662,
-1.1618996858596802,
-0.33463698625564575,
-0.46370941400527954,
-0.16639675199985504,
0.9939547777175903,
-0.18166384100914001,
-0.711783945560455... |
func (o *GetTeamsForbidden) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) {
rw.WriteHeader(403)
if o.Payload != nil {
payload := o.Payload
if err := producer.Produce(rw, payload); err != nil {
panic(err) // let the recovery middleware deal with this
}
}
} | [
0.16957582533359528,
0.39398330450057983,
0.27287372946739197,
0.40634533762931824,
0.6471362113952637,
0.09358618408441544,
0.3661574721336365,
-1.1736692190170288,
-0.055398453027009964,
0.07296495139598846,
0.48860836029052734,
0.13945122063159943,
-0.27702072262763977,
-1.0573173761367... |
func (o *GetTeamsInternalServerError) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) {
rw.Header().Del(runtime.HeaderContentType) //Remove Content-Type on empty responses
rw.WriteHeader(500)
} | [
-0.608654797077179,
-0.5616335272789001,
0.23053012788295746,
-0.06441113352775574,
0.6377606987953186,
-0.3505840301513672,
0.7833536267280579,
-0.6709746718406677,
-0.1686474233865738,
0.13144779205322266,
0.6353751420974731,
0.51881343126297,
-1.0196999311447144,
-0.18403847515583038,
... |
func (module *KafkaZkClient) Configure(name, configRoot string) {
module.Log.Info("configuring")
module.name = name
module.running = &sync.WaitGroup{}
module.groupLock = &sync.RWMutex{}
module.groupList = make(map[string]*topicList)
module.connectFunc = helpers.ZookeeperConnect
module.servers = viper.GetString... | [
0.043971627950668335,
-0.25020867586135864,
0.7074349522590637,
0.9615076780319214,
-0.10210497677326202,
-0.418453574180603,
0.5087622404098511,
0.2134903371334076,
-0.8237441182136536,
1.173572063446045,
0.3083712160587311,
0.3229149281978607,
-0.6169811487197876,
0.8819670081138611,
1... |
func (module *KafkaZkClient) Start() error {
module.Log.Info("starting")
zkconn, connEventChan, err := module.connectFunc(module.servers, time.Duration(module.zookeeperTimeout)*time.Second, module.Log)
if err != nil {
return err
}
module.zk = zkconn
// Set up all groups initially (we can't count on catching t... | [
0.03785761445760727,
-0.4698140621185303,
0.34612974524497986,
0.577177882194519,
0.4149964451789856,
-0.337354838848114,
1.2024266719818115,
0.37672680616378784,
-0.9992032051086426,
0.5917593240737915,
-0.27599936723709106,
1.0369960069656372,
-0.6301681995391846,
0.7099536061286926,
0... |
func (module *KafkaZkClient) Stop() error {
module.Log.Info("stopping")
// Closing the ZK client will invalidate all the watches, which will close all the running goroutines
module.zk.Close()
module.running.Wait()
return nil
} | [
-0.1484886109828949,
-0.3214019536972046,
0.0797634869813919,
0.1578618437051773,
0.3548634350299835,
0.4365624189376831,
1.0660239458084106,
0.3481161296367645,
-1.1687853336334229,
0.3930276036262512,
0.0914267972111702,
0.6576182842254639,
-1.7296123504638672,
0.34631597995758057,
0.4... |
func drainEventChannel(eventChan <-chan zk.Event) {
<-eventChan
} | [
-0.1612488478422165,
-0.43144333362579346,
0.4819105565547943,
-0.9464585185050964,
1.062303900718689,
0.5827819108963013,
0.5841570496559143,
-0.569492518901825,
0.8621242642402649,
-0.6642905473709106,
-0.055085018277168274,
0.09767348319292068,
-0.5785592794418335,
0.34345993399620056,
... |
func (as *AuthService) SignOut(id int) error {
details := &MethodInfo{
Name: "SignOut",
Description: "SignOut is the DB method used to SignOut",
}
tx, err := as.db.Begin()
_, err = tx.Exec("UPDATE users SET session_token='' WHERE id=$1", id)
if err != nil {
return errors.Wrap(err, details.Name)
}
re... | [
-0.7738332748413086,
0.06630086153745651,
0.4367217719554901,
-0.5373700261116028,
-0.40978145599365234,
0.10448654741048813,
0.03912555053830147,
-0.07529175281524658,
0.5583546161651611,
1.1643531322479248,
-0.4894992411136627,
0.593850314617157,
-0.29990407824516296,
0.07992389798164368... |
func (as *AuthService) UserSetToken(id int, sessionToken string) (*railway.User, error) {
details := &MethodInfo{
Name: "UserSetToken",
Description: "UserSetToken is the DB method used to UserSetToken",
}
updatedUser := &railway.User{}
query := `
UPDATE users SET session_token=$1 WHERE id=$2
RETURNING... | [
-1.4425854682922363,
-0.9035031199455261,
0.3293822109699249,
0.04757920652627945,
-0.4437248408794403,
-0.801210880279541,
0.016583234071731567,
-1.299359917640686,
0.2580021619796753,
0.5526320934295654,
-1.7327970266342163,
0.7069408297538757,
0.24458909034729004,
-0.3336859345436096,
... |
func StatusHealthy(message string) Status {
s := Status{
Healthy: true,
}
if len(message) > 0 {
s.Properties = map[string]interface{}{"message": message}
}
return s
} | [
0.34994229674339294,
-1.0071150064468384,
0.4519694447517395,
-0.02342393808066845,
-0.6622766852378845,
0.13807213306427002,
-0.6564686894416809,
0.00866651814430952,
-0.01792323589324951,
-0.5551933646202087,
-0.011533861048519611,
0.6348535418510437,
0.005560911726206541,
-0.42955502867... |
func StatusHealthyWithProperties(properties map[string]interface{}) Status {
return Status{
Healthy: true,
Properties: properties,
}
} | [
0.28482890129089355,
-1.9579273462295532,
0.22651061415672302,
0.23818160593509674,
-0.8012653589248657,
0.1939530372619629,
-1.4567545652389526,
-0.2020617425441742,
-0.008965383283793926,
-0.8473854660987854,
-0.2027404010295868,
-0.3039896786212921,
0.6309410333633423,
-0.18733394145965... |
func StatusUnhealthy(message string, cause error) Status {
s := Status{
Healthy: false,
}
if len(message) > 0 {
s.Properties = map[string]interface{}{"message": message}
}
if cause != nil && len(cause.Error()) > 0 {
if s.Properties == nil {
s.Properties = make(map[string]interface{})
}
s.Properties["c... | [
-0.3352460265159607,
-0.6546974778175354,
0.4840010404586792,
-0.7851681709289551,
-0.52830570936203,
-0.33061954379081726,
-0.4525105059146881,
0.4789445698261261,
-0.27430060505867004,
-0.7296683192253113,
0.11028426885604858,
0.5578987002372742,
0.08029422163963318,
-0.3043936789035797,... |
func StatusUnhealthyWithProperties(properties map[string]interface{}) Status {
return Status{
Healthy: false,
Properties: properties,
}
} | [
-0.5160902738571167,
-1.5338010787963867,
0.11837531626224518,
-0.6624800562858582,
-0.4635521471500397,
-0.000896751880645752,
-1.2922563552856445,
-0.035954978317022324,
-0.42061665654182434,
-1.0296083688735962,
-0.1543525904417038,
-0.5607067942619324,
0.3166879415512085,
-0.2188074737... |
func NewGetV1IntegrationsAwsCloudtrailBatchesParams() *GetV1IntegrationsAwsCloudtrailBatchesParams {
return &GetV1IntegrationsAwsCloudtrailBatchesParams{
timeout: cr.DefaultTimeout,
}
} | [
1.2124210596084595,
0.8612069487571716,
0.2650080621242523,
0.505416750907898,
0.0458194725215435,
0.35114380717277527,
0.11225500702857971,
-0.25204238295555115,
-1.178368091583252,
-0.3660843074321747,
-0.08113131672143936,
0.05130423977971077,
0.25203293561935425,
0.4725629389286041,
... |
func NewGetV1IntegrationsAwsCloudtrailBatchesParamsWithTimeout(timeout time.Duration) *GetV1IntegrationsAwsCloudtrailBatchesParams {
return &GetV1IntegrationsAwsCloudtrailBatchesParams{
timeout: timeout,
}
} | [
1.4183037281036377,
0.7383303642272949,
0.3645380437374115,
0.5756524205207825,
-0.13393959403038025,
0.8881300687789917,
-0.4466957151889801,
-0.006571464240550995,
-0.973107099533081,
0.49252721667289734,
-0.062282636761665344,
0.15668976306915283,
0.09427954256534576,
0.499814510345459,... |
func NewGetV1IntegrationsAwsCloudtrailBatchesParamsWithContext(ctx context.Context) *GetV1IntegrationsAwsCloudtrailBatchesParams {
return &GetV1IntegrationsAwsCloudtrailBatchesParams{
Context: ctx,
}
} | [
1.1568390130996704,
0.9501456022262573,
0.5808750987052917,
0.4277864992618561,
0.08768467605113983,
0.8788042664527893,
-0.1420932561159134,
-0.7442799806594849,
-1.0381208658218384,
0.026149075478315353,
-0.03271479159593582,
0.022223813459277153,
-0.07361207902431488,
-0.059054687619209... |
func NewGetV1IntegrationsAwsCloudtrailBatchesParamsWithHTTPClient(client *http.Client) *GetV1IntegrationsAwsCloudtrailBatchesParams {
return &GetV1IntegrationsAwsCloudtrailBatchesParams{
HTTPClient: client,
}
} | [
1.0707414150238037,
0.8096473217010498,
0.45524460077285767,
0.41780397295951843,
0.6342450380325317,
0.8334145545959473,
0.43507373332977295,
-0.17772488296031952,
-1.5658544301986694,
-0.39425989985466003,
-0.40794044733047485,
0.02724255993962288,
0.4107756018638611,
-0.0733356103301048... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.