query
stringlengths
7
3.85k
document
stringlengths
11
430k
metadata
dict
negatives
listlengths
0
101
negative_scores
listlengths
0
101
document_score
stringlengths
3
10
document_rank
stringclasses
102 values
WithPrevious adds the previous to the artifact lister o k response
func (o *ArtifactListerOK) WithPrevious(previous string) *ArtifactListerOK { o.Previous = previous return o }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "func (o *ArtifactListerOK) SetPrevious(previous string) {\n\to.Previous = previous\n}", "func (o *ArtifactListerPartialContent) WithPrevious(previous string) *ArtifactListerPartialContent {\n\to.Previous = previous\n\treturn o\n}", "func (o *ArtifactListerPartialContent) SetPrevious(previous string) {\n\to.Pre...
[ "0.76308", "0.6955441", "0.68752134", "0.6169351", "0.6020429", "0.5993091", "0.59885836", "0.5842263", "0.58317107", "0.5777413", "0.5720675", "0.5687227", "0.5680128", "0.5671869", "0.5661059", "0.56137663", "0.5610555", "0.55352676", "0.55333525", "0.55176044", "0.5497521"...
0.7789683
0
SetPrevious sets the previous to the artifact lister o k response
func (o *ArtifactListerOK) SetPrevious(previous string) { o.Previous = previous }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "func (o *ArtifactListerPartialContent) SetPrevious(previous string) {\n\to.Previous = previous\n}", "func (o *ArtifactListerOK) WithPrevious(previous string) *ArtifactListerOK {\n\to.Previous = previous\n\treturn o\n}", "func (h *History) Previous() {\n\tload := h.Load()\n\n\tif len(load) <= 1 {\n\t\tfmt.Print...
[ "0.77181244", "0.71131843", "0.65698516", "0.6438215", "0.64082676", "0.628293", "0.62722445", "0.6237737", "0.6235969", "0.62080115", "0.6201952", "0.6166058", "0.6163214", "0.61596376", "0.6144202", "0.61367834", "0.60615146", "0.6043462", "0.60110754", "0.5901605", "0.5887...
0.84276
0
WithTotalRecords adds the totalRecords to the artifact lister o k response
func (o *ArtifactListerOK) WithTotalRecords(totalRecords uint64) *ArtifactListerOK { o.TotalRecords = totalRecords return o }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "func (o *ArtifactListerOK) SetTotalRecords(totalRecords uint64) {\n\to.TotalRecords = totalRecords\n}", "func (o *ArtifactListerPartialContent) WithTotalRecords(totalRecords uint64) *ArtifactListerPartialContent {\n\to.TotalRecords = totalRecords\n\treturn o\n}", "func (o *ArtifactListerPartialContent) SetTota...
[ "0.7082838", "0.6644841", "0.65511394", "0.59687066", "0.5265039", "0.52637076", "0.51604646", "0.5144401", "0.49985495", "0.49891698", "0.49746624", "0.49441192", "0.4920693", "0.4915378", "0.4912611", "0.49113533", "0.48780045", "0.4875096", "0.48719037", "0.48052523", "0.4...
0.7237572
0
SetTotalRecords sets the totalRecords to the artifact lister o k response
func (o *ArtifactListerOK) SetTotalRecords(totalRecords uint64) { o.TotalRecords = totalRecords }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "func (o *ArtifactListerPartialContent) SetTotalRecords(totalRecords uint64) {\n\to.TotalRecords = totalRecords\n}", "func (o *ArtifactListerOK) WithTotalRecords(totalRecords uint64) *ArtifactListerOK {\n\to.TotalRecords = totalRecords\n\treturn o\n}", "func (o *ArtifactListerPartialContent) WithTotalRecords(to...
[ "0.7411211", "0.68853676", "0.6527963", "0.55671", "0.54397994", "0.5403986", "0.53291595", "0.5215049", "0.5191748", "0.50850916", "0.5069385", "0.5031457", "0.50241286", "0.5012421", "0.49860403", "0.4947973", "0.49434286", "0.48956817", "0.48902997", "0.48888567", "0.48390...
0.7904642
0
WithPayload adds the payload to the artifact lister o k response
func (o *ArtifactListerOK) WithPayload(payload []*weles.ArtifactInfo) *ArtifactListerOK { o.Payload = payload return o }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "func (o *ArtifactListerOK) SetPayload(payload []*weles.ArtifactInfo) {\n\to.Payload = payload\n}", "func (o *ArtifactListerNotFound) SetPayload(payload *weles.ErrResponse) {\n\to.Payload = payload\n}", "func (o *ArtifactListerInternalServerError) WithPayload(payload *weles.ErrResponse) *ArtifactListerInternalS...
[ "0.6866891", "0.66566706", "0.6601299", "0.6497717", "0.64683825", "0.62051743", "0.6182859", "0.61026436", "0.6092998", "0.6023159", "0.59868246", "0.5975534", "0.59724355", "0.5956259", "0.5928238", "0.5864594", "0.5844204", "0.58379173", "0.5822459", "0.5804906", "0.578109...
0.7198307
0
SetPayload sets the payload to the artifact lister o k response
func (o *ArtifactListerOK) SetPayload(payload []*weles.ArtifactInfo) { o.Payload = payload }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "func (o *ArtifactListerInternalServerError) SetPayload(payload *weles.ErrResponse) {\n\to.Payload = payload\n}", "func (o *ArtifactListerNotFound) SetPayload(payload *weles.ErrResponse) {\n\to.Payload = payload\n}", "func (o *ArtifactListerPartialContent) SetPayload(payload []*weles.ArtifactInfo) {\n\to.Payloa...
[ "0.80036867", "0.78599703", "0.7637977", "0.7551845", "0.751056", "0.73339987", "0.73249924", "0.7306623", "0.7282951", "0.7273448", "0.7267256", "0.72652704", "0.72629154", "0.7250694", "0.7237921", "0.72156614", "0.72121644", "0.7205217", "0.72041637", "0.719303", "0.718320...
0.8145345
0
WriteResponse to the client
func (o *ArtifactListerOK) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { // response header Next next := o.Next if next != "" { rw.Header().Set("Next", next) } // response header Previous previous := o.Previous if previous != "" { rw.Header().Set("Previous", previous) } // response header TotalRecords totalRecords := swag.FormatUint64(o.TotalRecords) if totalRecords != "" { rw.Header().Set("TotalRecords", totalRecords) } rw.WriteHeader(200) payload := o.Payload if payload == nil { payload = make([]*weles.ArtifactInfo, 0, 50) } if err := producer.Produce(rw, payload); err != nil { panic(err) // let the recovery middleware deal with this } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "func (r *Response) Write(w io.Writer) error", "func (c *Operation) writeResponse(rw http.ResponseWriter, status int, data []byte) { // nolint: unparam\n\trw.WriteHeader(status)\n\n\tif _, err := rw.Write(data); err != nil {\n\t\tlogger.Errorf(\"Unable to send error message, %s\", err)\n\t}\n}", "func WriteResp...
[ "0.81303823", "0.7882039", "0.77722245", "0.7771901", "0.7753117", "0.7740585", "0.76670325", "0.7638451", "0.76095873", "0.75798", "0.7579178", "0.7567389", "0.7560546", "0.75579476", "0.75447774", "0.7542929", "0.75416607", "0.753386", "0.7531158", "0.75192654", "0.75191355...
0.0
-1
NewArtifactListerPartialContent creates ArtifactListerPartialContent with default headers values
func NewArtifactListerPartialContent() *ArtifactListerPartialContent { return &ArtifactListerPartialContent{} }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "func responderArtifact206(listInfo weles.ListInfo, paginator weles.ArtifactPagination,\n\tartifactInfoReturned []*weles.ArtifactInfo, defaultPageLimit int32,\n) (responder *artifacts.ArtifactListerPartialContent) {\n\tvar artifactListerURL artifacts.ArtifactListerURL\n\n\tresponder = artifacts.NewArtifactListerPar...
[ "0.51237345", "0.5079677", "0.48940608", "0.4778246", "0.47617704", "0.46847615", "0.45793572", "0.45420745", "0.45120734", "0.445179", "0.4426803", "0.4417869", "0.42650312", "0.4262712", "0.42211097", "0.4195483", "0.41943496", "0.4141338", "0.41383514", "0.41365728", "0.41...
0.6221102
0
WithNext adds the next to the artifact lister partial content response
func (o *ArtifactListerPartialContent) WithNext(next string) *ArtifactListerPartialContent { o.Next = next return o }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "func (o *ArtifactListerOK) WithNext(next string) *ArtifactListerOK {\n\to.Next = next\n\treturn o\n}", "func (rl *ResourceList) next() error {\n\tif rl.Page == rl.NumPages-1 {\n\t\treturn errors.New(\"no more new pages\")\n\t}\n\treturn common.SendGetRequest(rl.NextPageURI, *rl.act, rl)\n}", "func (o *Artifact...
[ "0.72289026", "0.645706", "0.64555925", "0.63839513", "0.60253656", "0.5970255", "0.59100014", "0.586041", "0.5832225", "0.58279544", "0.58180356", "0.58152777", "0.5741045", "0.57042944", "0.5696428", "0.5690498", "0.56730956", "0.5670502", "0.56292367", "0.5609952", "0.5609...
0.7497578
0
SetNext sets the next to the artifact lister partial content response
func (o *ArtifactListerPartialContent) SetNext(next string) { o.Next = next }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "func (o *ArtifactListerOK) SetNext(next string) {\n\to.Next = next\n}", "func (o *ArtifactListerPartialContent) WithNext(next string) *ArtifactListerPartialContent {\n\to.Next = next\n\treturn o\n}", "func (o *ArtifactListerOK) WithNext(next string) *ArtifactListerOK {\n\to.Next = next\n\treturn o\n}", "func...
[ "0.7756037", "0.72146124", "0.6890151", "0.66719323", "0.6429602", "0.6257318", "0.6213263", "0.61644214", "0.61464286", "0.61457473", "0.6136115", "0.6107888", "0.6003156", "0.5911297", "0.5861905", "0.58498603", "0.5823983", "0.5804221", "0.57927185", "0.5776159", "0.577228...
0.7778235
0
WithPrevious adds the previous to the artifact lister partial content response
func (o *ArtifactListerPartialContent) WithPrevious(previous string) *ArtifactListerPartialContent { o.Previous = previous return o }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "func (o *ArtifactListerOK) WithPrevious(previous string) *ArtifactListerOK {\n\to.Previous = previous\n\treturn o\n}", "func (o *ArtifactListerPartialContent) SetPrevious(previous string) {\n\to.Previous = previous\n}", "func (o *ArtifactListerOK) SetPrevious(previous string) {\n\to.Previous = previous\n}", ...
[ "0.7339573", "0.7055601", "0.7044713", "0.5785379", "0.5747456", "0.56446016", "0.55336547", "0.55245286", "0.5484428", "0.54556274", "0.543618", "0.5434471", "0.53161204", "0.52835345", "0.5261165", "0.52551", "0.524028", "0.5193619", "0.51731586", "0.5107878", "0.50953263",...
0.76621854
0
SetPrevious sets the previous to the artifact lister partial content response
func (o *ArtifactListerPartialContent) SetPrevious(previous string) { o.Previous = previous }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "func (o *ArtifactListerOK) SetPrevious(previous string) {\n\to.Previous = previous\n}", "func (o *ArtifactListerPartialContent) WithPrevious(previous string) *ArtifactListerPartialContent {\n\to.Previous = previous\n\treturn o\n}", "func (o *ArtifactListerOK) WithPrevious(previous string) *ArtifactListerOK {\n...
[ "0.7994916", "0.7187832", "0.68588996", "0.6172114", "0.61423135", "0.61087483", "0.60712993", "0.5970792", "0.5911965", "0.59103006", "0.58738756", "0.5862722", "0.58572626", "0.57138544", "0.57009304", "0.56922466", "0.5663544", "0.5663291", "0.5650287", "0.5636499", "0.563...
0.79678786
1
WithRemainingRecords adds the remainingRecords to the artifact lister partial content response
func (o *ArtifactListerPartialContent) WithRemainingRecords(remainingRecords uint64) *ArtifactListerPartialContent { o.RemainingRecords = remainingRecords return o }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "func (o *ArtifactListerPartialContent) SetRemainingRecords(remainingRecords uint64) {\n\to.RemainingRecords = remainingRecords\n}", "func (o *ArtifactListerPartialContent) WithTotalRecords(totalRecords uint64) *ArtifactListerPartialContent {\n\to.TotalRecords = totalRecords\n\treturn o\n}", "func (o *ArtifactL...
[ "0.7257407", "0.565533", "0.5209284", "0.5129928", "0.49627718", "0.4876884", "0.4797178", "0.46875754", "0.4657041", "0.46173438", "0.44904017", "0.44647884", "0.44330287", "0.44215667", "0.44097626", "0.43981874", "0.43955588", "0.4385607", "0.43707445", "0.43707445", "0.43...
0.7293859
0
SetRemainingRecords sets the remainingRecords to the artifact lister partial content response
func (o *ArtifactListerPartialContent) SetRemainingRecords(remainingRecords uint64) { o.RemainingRecords = remainingRecords }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "func (o *ArtifactListerPartialContent) WithRemainingRecords(remainingRecords uint64) *ArtifactListerPartialContent {\n\to.RemainingRecords = remainingRecords\n\treturn o\n}", "func (o *ArtifactListerPartialContent) SetTotalRecords(totalRecords uint64) {\n\to.TotalRecords = totalRecords\n}", "func (o *ArtifactL...
[ "0.69616556", "0.5386693", "0.5374586", "0.52538633", "0.49944463", "0.4884808", "0.4698167", "0.46968845", "0.46378824", "0.45794222", "0.45628688", "0.4557788", "0.45545992", "0.44833428", "0.44659272", "0.44270992", "0.4404188", "0.43419722", "0.43134865", "0.43134865", "0...
0.7889897
0
WithTotalRecords adds the totalRecords to the artifact lister partial content response
func (o *ArtifactListerPartialContent) WithTotalRecords(totalRecords uint64) *ArtifactListerPartialContent { o.TotalRecords = totalRecords return o }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "func (o *ArtifactListerOK) WithTotalRecords(totalRecords uint64) *ArtifactListerOK {\n\to.TotalRecords = totalRecords\n\treturn o\n}", "func (o *ArtifactListerOK) SetTotalRecords(totalRecords uint64) {\n\to.TotalRecords = totalRecords\n}", "func (o *ArtifactListerPartialContent) SetTotalRecords(totalRecords ui...
[ "0.68602043", "0.68162364", "0.68050385", "0.576847", "0.5462304", "0.52687824", "0.5133332", "0.50719863", "0.5024894", "0.49290606", "0.49057037", "0.48331985", "0.48321137", "0.4808243", "0.47965768", "0.47944167", "0.4767452", "0.47474995", "0.47454843", "0.47244698", "0....
0.71389055
0
SetTotalRecords sets the totalRecords to the artifact lister partial content response
func (o *ArtifactListerPartialContent) SetTotalRecords(totalRecords uint64) { o.TotalRecords = totalRecords }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "func (o *ArtifactListerOK) SetTotalRecords(totalRecords uint64) {\n\to.TotalRecords = totalRecords\n}", "func (o *ArtifactListerPartialContent) WithTotalRecords(totalRecords uint64) *ArtifactListerPartialContent {\n\to.TotalRecords = totalRecords\n\treturn o\n}", "func (o *ArtifactListerOK) WithTotalRecords(to...
[ "0.7586981", "0.68356216", "0.65602857", "0.5993812", "0.53407735", "0.5330599", "0.5120447", "0.5045564", "0.5006892", "0.4913021", "0.49010208", "0.48902938", "0.48774007", "0.4825394", "0.48173904", "0.4800855", "0.4796975", "0.47928557", "0.47822073", "0.47713763", "0.475...
0.74971026
1
WithPayload adds the payload to the artifact lister partial content response
func (o *ArtifactListerPartialContent) WithPayload(payload []*weles.ArtifactInfo) *ArtifactListerPartialContent { o.Payload = payload return o }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "func (o *ArtifactListerPartialContent) SetPayload(payload []*weles.ArtifactInfo) {\n\to.Payload = payload\n}", "func (o *ArtifactListerOK) SetPayload(payload []*weles.ArtifactInfo) {\n\to.Payload = payload\n}", "func (o *ArtifactListerNotFound) SetPayload(payload *weles.ErrResponse) {\n\to.Payload = payload\n}...
[ "0.67320496", "0.6584429", "0.6506249", "0.64527833", "0.6376058", "0.6320063", "0.61683536", "0.6130742", "0.60633284", "0.59844196", "0.59294057", "0.5903623", "0.5874044", "0.57567525", "0.5752173", "0.57191354", "0.57170546", "0.571159", "0.57087535", "0.5708628", "0.5700...
0.71963346
0
SetPayload sets the payload to the artifact lister partial content response
func (o *ArtifactListerPartialContent) SetPayload(payload []*weles.ArtifactInfo) { o.Payload = payload }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "func (o *ArtifactListerOK) SetPayload(payload []*weles.ArtifactInfo) {\n\to.Payload = payload\n}", "func (o *ArtifactListerInternalServerError) SetPayload(payload *weles.ErrResponse) {\n\to.Payload = payload\n}", "func (o *ArtifactListerNotFound) SetPayload(payload *weles.ErrResponse) {\n\to.Payload = payload\...
[ "0.7755639", "0.77370477", "0.7547121", "0.74540854", "0.7391761", "0.71630627", "0.71489614", "0.7132938", "0.71324253", "0.7063658", "0.7039256", "0.70076543", "0.69959146", "0.6990534", "0.69864225", "0.69838345", "0.6963603", "0.6956441", "0.6955837", "0.6955526", "0.6930...
0.7865953
0
WriteResponse to the client
func (o *ArtifactListerPartialContent) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { // response header Next next := o.Next if next != "" { rw.Header().Set("Next", next) } // response header Previous previous := o.Previous if previous != "" { rw.Header().Set("Previous", previous) } // response header RemainingRecords remainingRecords := swag.FormatUint64(o.RemainingRecords) if remainingRecords != "" { rw.Header().Set("RemainingRecords", remainingRecords) } // response header TotalRecords totalRecords := swag.FormatUint64(o.TotalRecords) if totalRecords != "" { rw.Header().Set("TotalRecords", totalRecords) } rw.WriteHeader(206) payload := o.Payload if payload == nil { payload = make([]*weles.ArtifactInfo, 0, 50) } if err := producer.Produce(rw, payload); err != nil { panic(err) // let the recovery middleware deal with this } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "func (r *Response) Write(w io.Writer) error", "func (c *Operation) writeResponse(rw http.ResponseWriter, status int, data []byte) { // nolint: unparam\n\trw.WriteHeader(status)\n\n\tif _, err := rw.Write(data); err != nil {\n\t\tlogger.Errorf(\"Unable to send error message, %s\", err)\n\t}\n}", "func WriteResp...
[ "0.81303823", "0.7882039", "0.77722245", "0.7771901", "0.7753117", "0.7740585", "0.76670325", "0.7638451", "0.76095873", "0.75798", "0.7579178", "0.7567389", "0.7560546", "0.75579476", "0.75447774", "0.7542929", "0.75416607", "0.753386", "0.7531158", "0.75192654", "0.75191355...
0.0
-1
NewArtifactListerBadRequest creates ArtifactListerBadRequest with default headers values
func NewArtifactListerBadRequest() *ArtifactListerBadRequest { return &ArtifactListerBadRequest{} }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "func (o *ArtifactListerBadRequest) WithPayload(payload *weles.ErrResponse) *ArtifactListerBadRequest {\n\to.Payload = payload\n\treturn o\n}", "func NewListBadRequest(body *ListBadRequestResponseBody) *goa.ServiceError {\n\tv := &goa.ServiceError{\n\t\tName: *body.Name,\n\t\tID: *body.ID,\n\t\tMessag...
[ "0.6623783", "0.59504145", "0.5825326", "0.5791996", "0.57016426", "0.56496376", "0.5584372", "0.5577911", "0.55503136", "0.553018", "0.5512467", "0.54805005", "0.54748464", "0.54560053", "0.54332155", "0.54139864", "0.5413202", "0.5401377", "0.5400714", "0.5381099", "0.53698...
0.77091694
0
WithPayload adds the payload to the artifact lister bad request response
func (o *ArtifactListerBadRequest) WithPayload(payload *weles.ErrResponse) *ArtifactListerBadRequest { o.Payload = payload return o }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "func (o *ArtifactListerBadRequest) SetPayload(payload *weles.ErrResponse) {\n\to.Payload = payload\n}", "func (o *ArtifactListerNotFound) SetPayload(payload *weles.ErrResponse) {\n\to.Payload = payload\n}", "func (o *ArtifactListerInternalServerError) SetPayload(payload *weles.ErrResponse) {\n\to.Payload = pay...
[ "0.70712554", "0.66748416", "0.66125786", "0.6426536", "0.6421959", "0.62453586", "0.62187576", "0.6214958", "0.62071145", "0.61881536", "0.61808497", "0.6167171", "0.61444926", "0.61349064", "0.6130238", "0.6124997", "0.6106821", "0.6104793", "0.60994357", "0.60610396", "0.6...
0.7316845
0
SetPayload sets the payload to the artifact lister bad request response
func (o *ArtifactListerBadRequest) SetPayload(payload *weles.ErrResponse) { o.Payload = payload }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "func (o *ArtifactListerInternalServerError) SetPayload(payload *weles.ErrResponse) {\n\to.Payload = payload\n}", "func (o *ArtifactListerNotFound) SetPayload(payload *weles.ErrResponse) {\n\to.Payload = payload\n}", "func (o *ArtifactListerOK) SetPayload(payload []*weles.ArtifactInfo) {\n\to.Payload = payload\...
[ "0.8006691", "0.779523", "0.76306844", "0.7535646", "0.7526764", "0.74793965", "0.74657947", "0.74545217", "0.74450266", "0.7421751", "0.73978674", "0.73853314", "0.7370035", "0.73608977", "0.73517865", "0.7346822", "0.7346421", "0.7337875", "0.7331927", "0.7323504", "0.73230...
0.8232403
0
WriteResponse to the client
func (o *ArtifactListerBadRequest) 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 } } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "func (r *Response) Write(w io.Writer) error", "func (c *Operation) writeResponse(rw http.ResponseWriter, status int, data []byte) { // nolint: unparam\n\trw.WriteHeader(status)\n\n\tif _, err := rw.Write(data); err != nil {\n\t\tlogger.Errorf(\"Unable to send error message, %s\", err)\n\t}\n}", "func WriteResp...
[ "0.81303823", "0.7882039", "0.77722245", "0.7771901", "0.7753117", "0.7740585", "0.76670325", "0.7638451", "0.76095873", "0.75798", "0.7579178", "0.7567389", "0.7560546", "0.75579476", "0.75447774", "0.7542929", "0.75416607", "0.753386", "0.7531158", "0.75192654", "0.75191355...
0.0
-1
NewArtifactListerNotFound creates ArtifactListerNotFound with default headers values
func NewArtifactListerNotFound() *ArtifactListerNotFound { return &ArtifactListerNotFound{} }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "func (o *ArtifactListerNotFound) WithPayload(payload *weles.ErrResponse) *ArtifactListerNotFound {\n\to.Payload = payload\n\treturn o\n}", "func NewNotFound(err error, msg ...string) *Errs {\n\tif err == nil {\n\t\terr = ErrNotFound\n\t}\n\treturn &Errs{\n\t\tcodeHTTP: http.StatusNotFound,\n\t\terr: err,\n\...
[ "0.59044456", "0.57735026", "0.5671174", "0.5652109", "0.551046", "0.5478157", "0.54348093", "0.5429371", "0.54193217", "0.5406982", "0.5349323", "0.5341761", "0.5314563", "0.53118944", "0.5307573", "0.5300036", "0.5300036", "0.5294548", "0.52603376", "0.5257353", "0.52521986...
0.6899325
0
WithPayload adds the payload to the artifact lister not found response
func (o *ArtifactListerNotFound) WithPayload(payload *weles.ErrResponse) *ArtifactListerNotFound { o.Payload = payload return o }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "func (o *ArtifactListerNotFound) SetPayload(payload *weles.ErrResponse) {\n\to.Payload = payload\n}", "func (o *ArtifactListerInternalServerError) WithPayload(payload *weles.ErrResponse) *ArtifactListerInternalServerError {\n\to.Payload = payload\n\treturn o\n}", "func (o *ArtifactListerBadRequest) WithPayload...
[ "0.71166545", "0.6728402", "0.66189927", "0.64214116", "0.6334641", "0.62707865", "0.61188954", "0.6086991", "0.6048841", "0.60328", "0.6022252", "0.59993637", "0.59868425", "0.59859324", "0.59848446", "0.5979178", "0.59789467", "0.597695", "0.5948902", "0.5940029", "0.590009...
0.7106535
1
SetPayload sets the payload to the artifact lister not found response
func (o *ArtifactListerNotFound) SetPayload(payload *weles.ErrResponse) { o.Payload = payload }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "func (o *ArtifactListerInternalServerError) SetPayload(payload *weles.ErrResponse) {\n\to.Payload = payload\n}", "func (o *ArtifactListerBadRequest) SetPayload(payload *weles.ErrResponse) {\n\to.Payload = payload\n}", "func (o *GetRepositoryInfoNotFound) SetPayload(payload *models.Error) {\n\to.Payload = paylo...
[ "0.7733741", "0.74927545", "0.73879963", "0.73810774", "0.729546", "0.72907823", "0.72536606", "0.7219174", "0.71641356", "0.7158319", "0.71465546", "0.7140486", "0.71336025", "0.7127423", "0.7115021", "0.70977026", "0.7092067", "0.7070966", "0.706679", "0.7057871", "0.703365...
0.8157627
0
WriteResponse to the client
func (o *ArtifactListerNotFound) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { rw.WriteHeader(404) if o.Payload != nil { payload := o.Payload if err := producer.Produce(rw, payload); err != nil { panic(err) // let the recovery middleware deal with this } } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "func (r *Response) Write(w io.Writer) error", "func (c *Operation) writeResponse(rw http.ResponseWriter, status int, data []byte) { // nolint: unparam\n\trw.WriteHeader(status)\n\n\tif _, err := rw.Write(data); err != nil {\n\t\tlogger.Errorf(\"Unable to send error message, %s\", err)\n\t}\n}", "func WriteResp...
[ "0.81303823", "0.7882039", "0.77722245", "0.7771901", "0.7753117", "0.7740585", "0.76670325", "0.7638451", "0.76095873", "0.75798", "0.7579178", "0.7567389", "0.7560546", "0.75579476", "0.75447774", "0.7542929", "0.75416607", "0.753386", "0.7531158", "0.75192654", "0.75191355...
0.0
-1
WithPayload adds the payload to the artifact lister internal server error response
func (o *ArtifactListerInternalServerError) WithPayload(payload *weles.ErrResponse) *ArtifactListerInternalServerError { o.Payload = payload return o }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "func (o *ArtifactListerInternalServerError) SetPayload(payload *weles.ErrResponse) {\n\to.Payload = payload\n}", "func (o *ArtifactListerBadRequest) SetPayload(payload *weles.ErrResponse) {\n\to.Payload = payload\n}", "func (o *ArtifactListerBadRequest) WithPayload(payload *weles.ErrResponse) *ArtifactListerBa...
[ "0.7157846", "0.6921978", "0.6862238", "0.6658315", "0.62427086", "0.61828434", "0.61777896", "0.6167557", "0.61196446", "0.609198", "0.60899943", "0.60818005", "0.6081588", "0.6076011", "0.60722697", "0.6067129", "0.60604006", "0.6055573", "0.60487366", "0.60356337", "0.6033...
0.72021204
0
SetPayload sets the payload to the artifact lister internal server error response
func (o *ArtifactListerInternalServerError) SetPayload(payload *weles.ErrResponse) { o.Payload = payload }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "func (o *ArtifactListerBadRequest) SetPayload(payload *weles.ErrResponse) {\n\to.Payload = payload\n}", "func (o *ArtifactListerNotFound) SetPayload(payload *weles.ErrResponse) {\n\to.Payload = payload\n}", "func (o *GetVSphereDatastoresInternalServerError) SetPayload(payload *models.Error) {\n\to.Payload = pa...
[ "0.7831036", "0.75439966", "0.736797", "0.730542", "0.7304041", "0.72276163", "0.7226452", "0.722291", "0.72117543", "0.72073513", "0.7200168", "0.7198472", "0.7189686", "0.7186961", "0.7180009", "0.71769434", "0.7167124", "0.71656305", "0.71651083", "0.7156538", "0.7151973",...
0.81285137
0
WriteResponse to the client
func (o *ArtifactListerInternalServerError) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { rw.WriteHeader(500) if o.Payload != nil { payload := o.Payload if err := producer.Produce(rw, payload); err != nil { panic(err) // let the recovery middleware deal with this } } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "func (r *Response) Write(w io.Writer) error", "func (c *Operation) writeResponse(rw http.ResponseWriter, status int, data []byte) { // nolint: unparam\n\trw.WriteHeader(status)\n\n\tif _, err := rw.Write(data); err != nil {\n\t\tlogger.Errorf(\"Unable to send error message, %s\", err)\n\t}\n}", "func WriteResp...
[ "0.81303823", "0.7882039", "0.77722245", "0.7771901", "0.7753117", "0.7740585", "0.76670325", "0.7638451", "0.76095873", "0.75798", "0.7579178", "0.7567389", "0.7560546", "0.75579476", "0.75447774", "0.7542929", "0.75416607", "0.753386", "0.7531158", "0.75192654", "0.75191355...
0.0
-1
Main is the main.
func Main(use string, options ...RootCommandOption) { appcmd.Main(context.Background(), newRootCommand(use, options...), version) }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "func Main(args ...interface{}) {\n\n\t// ...\n}", "func main() {\n\tapplication.Application()\n}", "func main() {\n\tgimain.Main(func() {\n\t\tmainrun()\n\t})\n}", "func main() {\n\tgimain.Main(func() {\n\t\tmainrun()\n\t})\n}", "func main() {\n\tgimain.Main(func() {\n\t\tmainrun()\n\t})\n}", "func main(...
[ "0.76547235", "0.76154083", "0.756919", "0.756919", "0.756919", "0.756919", "0.756919", "0.7539344", "0.7493354", "0.7487511", "0.7462853", "0.74361163", "0.74144876", "0.74144876", "0.74144876", "0.73895395", "0.731854", "0.73091245", "0.73091245", "0.72880375", "0.7265347",...
0.0
-1
NewExecutableSchema creates an ExecutableSchema from the ResolverRoot interface.
func NewExecutableSchema(cfg Config) graphql.ExecutableSchema { return &executableSchema{ resolvers: cfg.Resolvers, directives: cfg.Directives, complexity: cfg.Complexity, } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "func NewExecutableSchema(resolvers ResolverRoot) graphql.ExecutableSchema {\n\treturn MakeExecutableSchema(shortMapper{r: resolvers})\n}", "func NewExecutableSchema(cfg Config) graphql.ExecutableSchema {\n\treturn &executableSchema{\n\t\tresolvers: cfg.Resolvers,\n\t\tdirectives: cfg.Directives,\n\t}\n}", "fu...
[ "0.7599504", "0.71238595", "0.7099825", "0.6739987", "0.5023748", "0.4870003", "0.47683108", "0.4757958", "0.470629", "0.465203", "0.4584383", "0.45783812", "0.45181683", "0.44727597", "0.44668096", "0.44606218", "0.44596046", "0.44547275", "0.4448324", "0.444426", "0.4361986...
0.71002424
33
nolint: gocyclo, errcheck, gas, goconst
func (ec *executionContext) _Application(ctx context.Context, sel ast.SelectionSet, obj *model.Application) graphql.Marshaler { fields := graphql.CollectFields(ctx, sel, applicationImplementors) out := graphql.NewOrderedMap(len(fields)) invalid := false for i, field := range fields { out.Keys[i] = field.Alias switch field.Name { case "__typename": out.Values[i] = graphql.MarshalString("Application") case "id": out.Values[i] = ec._Application_id(ctx, field, obj) if out.Values[i] == graphql.Null { invalid = true } case "description": out.Values[i] = ec._Application_description(ctx, field, obj) if out.Values[i] == graphql.Null { invalid = true } case "appliedBy": out.Values[i] = ec._Application_appliedBy(ctx, field, obj) if out.Values[i] == graphql.Null { invalid = true } case "appliedAt": out.Values[i] = ec._Application_appliedAt(ctx, field, obj) if out.Values[i] == graphql.Null { invalid = true } case "verifiedBy": out.Values[i] = ec._Application_verifiedBy(ctx, field, obj) if out.Values[i] == graphql.Null { invalid = true } case "verifiedAt": out.Values[i] = ec._Application_verifiedAt(ctx, field, obj) if out.Values[i] == graphql.Null { invalid = true } default: panic("unknown field " + strconv.Quote(field.Name)) } } if invalid { return graphql.Null } return out }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "func TestForbidConstAssignWhenLoweringUsing(t *testing.T) {\n\tdefault_suite.expectBundled(t, bundled{\n\t\tfiles: map[string]string{\n\t\t\t\"/entry.js\": `\n\t\t\t\tconst x = 1\n\t\t\t\tusing x2 = 2\n\t\t\t\tx = 3\n\t\t\t\tfunction foo() {\n\t\t\t\t\tconst y = 1\n\t\t\t\t\tusing y2 = 2\n\t\t\t\t\ty = 3\n\t\t\t\t...
[ "0.58961266", "0.5789828", "0.5636053", "0.5535501", "0.55172944", "0.5413666", "0.5380411", "0.53663796", "0.5304195", "0.52977353", "0.5256102", "0.5206977", "0.51570046", "0.5108867", "0.5090636", "0.50079507", "0.5005115", "0.49890158", "0.49617404", "0.4953384", "0.49496...
0.0
-1
nolint: gocyclo, errcheck, gas, goconst
func (ec *executionContext) _Mutation(ctx context.Context, sel ast.SelectionSet) graphql.Marshaler { fields := graphql.CollectFields(ctx, sel, mutationImplementors) ctx = graphql.WithResolverContext(ctx, &graphql.ResolverContext{ Object: "Mutation", }) out := graphql.NewOrderedMap(len(fields)) invalid := false for i, field := range fields { out.Keys[i] = field.Alias switch field.Name { case "__typename": out.Values[i] = graphql.MarshalString("Mutation") case "newUser": out.Values[i] = ec._Mutation_newUser(ctx, field) if out.Values[i] == graphql.Null { invalid = true } case "newAppliation": out.Values[i] = ec._Mutation_newAppliation(ctx, field) if out.Values[i] == graphql.Null { invalid = true } default: panic("unknown field " + strconv.Quote(field.Name)) } } if invalid { return graphql.Null } return out }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "func TestForbidConstAssignWhenLoweringUsing(t *testing.T) {\n\tdefault_suite.expectBundled(t, bundled{\n\t\tfiles: map[string]string{\n\t\t\t\"/entry.js\": `\n\t\t\t\tconst x = 1\n\t\t\t\tusing x2 = 2\n\t\t\t\tx = 3\n\t\t\t\tfunction foo() {\n\t\t\t\t\tconst y = 1\n\t\t\t\t\tusing y2 = 2\n\t\t\t\t\ty = 3\n\t\t\t\t...
[ "0.58951914", "0.5789157", "0.56343776", "0.55349874", "0.5516496", "0.54126674", "0.5380506", "0.53651625", "0.5303207", "0.5297547", "0.52558833", "0.52072686", "0.51567554", "0.51085794", "0.508947", "0.5007158", "0.50040805", "0.49892417", "0.4960484", "0.49534518", "0.49...
0.0
-1
nolint: gocyclo, errcheck, gas, goconst
func (ec *executionContext) _Query(ctx context.Context, sel ast.SelectionSet) graphql.Marshaler { fields := graphql.CollectFields(ctx, sel, queryImplementors) ctx = graphql.WithResolverContext(ctx, &graphql.ResolverContext{ Object: "Query", }) var wg sync.WaitGroup out := graphql.NewOrderedMap(len(fields)) invalid := false for i, field := range fields { out.Keys[i] = field.Alias switch field.Name { case "__typename": out.Values[i] = graphql.MarshalString("Query") case "users": wg.Add(1) go func(i int, field graphql.CollectedField) { out.Values[i] = ec._Query_users(ctx, field) if out.Values[i] == graphql.Null { invalid = true } wg.Done() }(i, field) case "userById": wg.Add(1) go func(i int, field graphql.CollectedField) { out.Values[i] = ec._Query_userById(ctx, field) if out.Values[i] == graphql.Null { invalid = true } wg.Done() }(i, field) case "userByIds": wg.Add(1) go func(i int, field graphql.CollectedField) { out.Values[i] = ec._Query_userByIds(ctx, field) if out.Values[i] == graphql.Null { invalid = true } wg.Done() }(i, field) case "applications": wg.Add(1) go func(i int, field graphql.CollectedField) { out.Values[i] = ec._Query_applications(ctx, field) if out.Values[i] == graphql.Null { invalid = true } wg.Done() }(i, field) case "applicationByUserId": wg.Add(1) go func(i int, field graphql.CollectedField) { out.Values[i] = ec._Query_applicationByUserId(ctx, field) if out.Values[i] == graphql.Null { invalid = true } wg.Done() }(i, field) case "applicationByUserIds": wg.Add(1) go func(i int, field graphql.CollectedField) { out.Values[i] = ec._Query_applicationByUserIds(ctx, field) if out.Values[i] == graphql.Null { invalid = true } wg.Done() }(i, field) case "__type": out.Values[i] = ec._Query___type(ctx, field) case "__schema": out.Values[i] = ec._Query___schema(ctx, field) default: panic("unknown field " + strconv.Quote(field.Name)) } } wg.Wait() if invalid { return graphql.Null } return out }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "func TestForbidConstAssignWhenLoweringUsing(t *testing.T) {\n\tdefault_suite.expectBundled(t, bundled{\n\t\tfiles: map[string]string{\n\t\t\t\"/entry.js\": `\n\t\t\t\tconst x = 1\n\t\t\t\tusing x2 = 2\n\t\t\t\tx = 3\n\t\t\t\tfunction foo() {\n\t\t\t\t\tconst y = 1\n\t\t\t\t\tusing y2 = 2\n\t\t\t\t\ty = 3\n\t\t\t\t...
[ "0.58957493", "0.57890224", "0.5634927", "0.55365646", "0.5517367", "0.5414204", "0.5380421", "0.5367313", "0.530519", "0.5298157", "0.5256187", "0.520729", "0.5157703", "0.5108482", "0.5088959", "0.5006738", "0.50056857", "0.49891955", "0.49601772", "0.49536383", "0.49474543...
0.0
-1
nolint: gocyclo, errcheck, gas, goconst
func (ec *executionContext) _User(ctx context.Context, sel ast.SelectionSet, obj *model.User) graphql.Marshaler { fields := graphql.CollectFields(ctx, sel, userImplementors) out := graphql.NewOrderedMap(len(fields)) invalid := false for i, field := range fields { out.Keys[i] = field.Alias switch field.Name { case "__typename": out.Values[i] = graphql.MarshalString("User") case "id": out.Values[i] = ec._User_id(ctx, field, obj) if out.Values[i] == graphql.Null { invalid = true } case "name": out.Values[i] = ec._User_name(ctx, field, obj) if out.Values[i] == graphql.Null { invalid = true } case "email": out.Values[i] = ec._User_email(ctx, field, obj) if out.Values[i] == graphql.Null { invalid = true } case "contact": out.Values[i] = ec._User_contact(ctx, field, obj) if out.Values[i] == graphql.Null { invalid = true } case "createAt": out.Values[i] = ec._User_createAt(ctx, field, obj) if out.Values[i] == graphql.Null { invalid = true } default: panic("unknown field " + strconv.Quote(field.Name)) } } if invalid { return graphql.Null } return out }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "func TestForbidConstAssignWhenLoweringUsing(t *testing.T) {\n\tdefault_suite.expectBundled(t, bundled{\n\t\tfiles: map[string]string{\n\t\t\t\"/entry.js\": `\n\t\t\t\tconst x = 1\n\t\t\t\tusing x2 = 2\n\t\t\t\tx = 3\n\t\t\t\tfunction foo() {\n\t\t\t\t\tconst y = 1\n\t\t\t\t\tusing y2 = 2\n\t\t\t\t\ty = 3\n\t\t\t\t...
[ "0.58957493", "0.57890224", "0.5634927", "0.55365646", "0.5517367", "0.5414204", "0.5380421", "0.5367313", "0.530519", "0.5298157", "0.5256187", "0.520729", "0.5157703", "0.5108482", "0.5088959", "0.5006738", "0.50056857", "0.49891955", "0.49601772", "0.49536383", "0.49474543...
0.0
-1
nolint: gocyclo, errcheck, gas, goconst
func (ec *executionContext) ___Directive(ctx context.Context, sel ast.SelectionSet, obj *introspection.Directive) graphql.Marshaler { fields := graphql.CollectFields(ctx, sel, __DirectiveImplementors) out := graphql.NewOrderedMap(len(fields)) invalid := false for i, field := range fields { out.Keys[i] = field.Alias switch field.Name { case "__typename": out.Values[i] = graphql.MarshalString("__Directive") case "name": out.Values[i] = ec.___Directive_name(ctx, field, obj) if out.Values[i] == graphql.Null { invalid = true } case "description": out.Values[i] = ec.___Directive_description(ctx, field, obj) case "locations": out.Values[i] = ec.___Directive_locations(ctx, field, obj) if out.Values[i] == graphql.Null { invalid = true } case "args": out.Values[i] = ec.___Directive_args(ctx, field, obj) if out.Values[i] == graphql.Null { invalid = true } default: panic("unknown field " + strconv.Quote(field.Name)) } } if invalid { return graphql.Null } return out }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "func TestForbidConstAssignWhenLoweringUsing(t *testing.T) {\n\tdefault_suite.expectBundled(t, bundled{\n\t\tfiles: map[string]string{\n\t\t\t\"/entry.js\": `\n\t\t\t\tconst x = 1\n\t\t\t\tusing x2 = 2\n\t\t\t\tx = 3\n\t\t\t\tfunction foo() {\n\t\t\t\t\tconst y = 1\n\t\t\t\t\tusing y2 = 2\n\t\t\t\t\ty = 3\n\t\t\t\t...
[ "0.58961266", "0.5789828", "0.5636053", "0.5535501", "0.55172944", "0.5413666", "0.5380411", "0.53663796", "0.5304195", "0.52977353", "0.5256102", "0.5206977", "0.51570046", "0.5108867", "0.5090636", "0.50079507", "0.5005115", "0.49890158", "0.49617404", "0.4953384", "0.49496...
0.0
-1
nolint: gocyclo, errcheck, gas, goconst
func (ec *executionContext) ___EnumValue(ctx context.Context, sel ast.SelectionSet, obj *introspection.EnumValue) graphql.Marshaler { fields := graphql.CollectFields(ctx, sel, __EnumValueImplementors) out := graphql.NewOrderedMap(len(fields)) invalid := false for i, field := range fields { out.Keys[i] = field.Alias switch field.Name { case "__typename": out.Values[i] = graphql.MarshalString("__EnumValue") case "name": out.Values[i] = ec.___EnumValue_name(ctx, field, obj) if out.Values[i] == graphql.Null { invalid = true } case "description": out.Values[i] = ec.___EnumValue_description(ctx, field, obj) case "isDeprecated": out.Values[i] = ec.___EnumValue_isDeprecated(ctx, field, obj) if out.Values[i] == graphql.Null { invalid = true } case "deprecationReason": out.Values[i] = ec.___EnumValue_deprecationReason(ctx, field, obj) default: panic("unknown field " + strconv.Quote(field.Name)) } } if invalid { return graphql.Null } return out }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "func TestForbidConstAssignWhenLoweringUsing(t *testing.T) {\n\tdefault_suite.expectBundled(t, bundled{\n\t\tfiles: map[string]string{\n\t\t\t\"/entry.js\": `\n\t\t\t\tconst x = 1\n\t\t\t\tusing x2 = 2\n\t\t\t\tx = 3\n\t\t\t\tfunction foo() {\n\t\t\t\t\tconst y = 1\n\t\t\t\t\tusing y2 = 2\n\t\t\t\t\ty = 3\n\t\t\t\t...
[ "0.58951914", "0.5789157", "0.56343776", "0.55349874", "0.5516496", "0.54126674", "0.5380506", "0.53651625", "0.5303207", "0.5297547", "0.52558833", "0.52072686", "0.51567554", "0.51085794", "0.508947", "0.5007158", "0.50040805", "0.49892417", "0.4960484", "0.49534518", "0.49...
0.0
-1
nolint: gocyclo, errcheck, gas, goconst
func (ec *executionContext) ___Field(ctx context.Context, sel ast.SelectionSet, obj *introspection.Field) graphql.Marshaler { fields := graphql.CollectFields(ctx, sel, __FieldImplementors) out := graphql.NewOrderedMap(len(fields)) invalid := false for i, field := range fields { out.Keys[i] = field.Alias switch field.Name { case "__typename": out.Values[i] = graphql.MarshalString("__Field") case "name": out.Values[i] = ec.___Field_name(ctx, field, obj) if out.Values[i] == graphql.Null { invalid = true } case "description": out.Values[i] = ec.___Field_description(ctx, field, obj) case "args": out.Values[i] = ec.___Field_args(ctx, field, obj) if out.Values[i] == graphql.Null { invalid = true } case "type": out.Values[i] = ec.___Field_type(ctx, field, obj) if out.Values[i] == graphql.Null { invalid = true } case "isDeprecated": out.Values[i] = ec.___Field_isDeprecated(ctx, field, obj) if out.Values[i] == graphql.Null { invalid = true } case "deprecationReason": out.Values[i] = ec.___Field_deprecationReason(ctx, field, obj) default: panic("unknown field " + strconv.Quote(field.Name)) } } if invalid { return graphql.Null } return out }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "func TestForbidConstAssignWhenLoweringUsing(t *testing.T) {\n\tdefault_suite.expectBundled(t, bundled{\n\t\tfiles: map[string]string{\n\t\t\t\"/entry.js\": `\n\t\t\t\tconst x = 1\n\t\t\t\tusing x2 = 2\n\t\t\t\tx = 3\n\t\t\t\tfunction foo() {\n\t\t\t\t\tconst y = 1\n\t\t\t\t\tusing y2 = 2\n\t\t\t\t\ty = 3\n\t\t\t\t...
[ "0.58957493", "0.57890224", "0.5634927", "0.55365646", "0.5517367", "0.5414204", "0.5380421", "0.5367313", "0.530519", "0.5298157", "0.5256187", "0.520729", "0.5157703", "0.5108482", "0.5088959", "0.5006738", "0.50056857", "0.49891955", "0.49601772", "0.49536383", "0.49474543...
0.0
-1
nolint: gocyclo, errcheck, gas, goconst
func (ec *executionContext) ___InputValue(ctx context.Context, sel ast.SelectionSet, obj *introspection.InputValue) graphql.Marshaler { fields := graphql.CollectFields(ctx, sel, __InputValueImplementors) out := graphql.NewOrderedMap(len(fields)) invalid := false for i, field := range fields { out.Keys[i] = field.Alias switch field.Name { case "__typename": out.Values[i] = graphql.MarshalString("__InputValue") case "name": out.Values[i] = ec.___InputValue_name(ctx, field, obj) if out.Values[i] == graphql.Null { invalid = true } case "description": out.Values[i] = ec.___InputValue_description(ctx, field, obj) case "type": out.Values[i] = ec.___InputValue_type(ctx, field, obj) if out.Values[i] == graphql.Null { invalid = true } case "defaultValue": out.Values[i] = ec.___InputValue_defaultValue(ctx, field, obj) default: panic("unknown field " + strconv.Quote(field.Name)) } } if invalid { return graphql.Null } return out }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "func TestForbidConstAssignWhenLoweringUsing(t *testing.T) {\n\tdefault_suite.expectBundled(t, bundled{\n\t\tfiles: map[string]string{\n\t\t\t\"/entry.js\": `\n\t\t\t\tconst x = 1\n\t\t\t\tusing x2 = 2\n\t\t\t\tx = 3\n\t\t\t\tfunction foo() {\n\t\t\t\t\tconst y = 1\n\t\t\t\t\tusing y2 = 2\n\t\t\t\t\ty = 3\n\t\t\t\t...
[ "0.58957493", "0.57890224", "0.5634927", "0.55365646", "0.5517367", "0.5414204", "0.5380421", "0.5367313", "0.530519", "0.5298157", "0.5256187", "0.520729", "0.5157703", "0.5108482", "0.5088959", "0.5006738", "0.50056857", "0.49891955", "0.49601772", "0.49536383", "0.49474543...
0.0
-1
nolint: gocyclo, errcheck, gas, goconst
func (ec *executionContext) ___Schema(ctx context.Context, sel ast.SelectionSet, obj *introspection.Schema) graphql.Marshaler { fields := graphql.CollectFields(ctx, sel, __SchemaImplementors) out := graphql.NewOrderedMap(len(fields)) invalid := false for i, field := range fields { out.Keys[i] = field.Alias switch field.Name { case "__typename": out.Values[i] = graphql.MarshalString("__Schema") case "types": out.Values[i] = ec.___Schema_types(ctx, field, obj) if out.Values[i] == graphql.Null { invalid = true } case "queryType": out.Values[i] = ec.___Schema_queryType(ctx, field, obj) if out.Values[i] == graphql.Null { invalid = true } case "mutationType": out.Values[i] = ec.___Schema_mutationType(ctx, field, obj) case "subscriptionType": out.Values[i] = ec.___Schema_subscriptionType(ctx, field, obj) case "directives": out.Values[i] = ec.___Schema_directives(ctx, field, obj) if out.Values[i] == graphql.Null { invalid = true } default: panic("unknown field " + strconv.Quote(field.Name)) } } if invalid { return graphql.Null } return out }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "func TestForbidConstAssignWhenLoweringUsing(t *testing.T) {\n\tdefault_suite.expectBundled(t, bundled{\n\t\tfiles: map[string]string{\n\t\t\t\"/entry.js\": `\n\t\t\t\tconst x = 1\n\t\t\t\tusing x2 = 2\n\t\t\t\tx = 3\n\t\t\t\tfunction foo() {\n\t\t\t\t\tconst y = 1\n\t\t\t\t\tusing y2 = 2\n\t\t\t\t\ty = 3\n\t\t\t\t...
[ "0.58961266", "0.5789828", "0.5636053", "0.5535501", "0.55172944", "0.5413666", "0.5380411", "0.53663796", "0.5304195", "0.52977353", "0.5256102", "0.5206977", "0.51570046", "0.5108867", "0.5090636", "0.50079507", "0.5005115", "0.49890158", "0.49617404", "0.4953384", "0.49496...
0.0
-1
nolint: gocyclo, errcheck, gas, goconst
func (ec *executionContext) ___Type(ctx context.Context, sel ast.SelectionSet, obj *introspection.Type) graphql.Marshaler { fields := graphql.CollectFields(ctx, sel, __TypeImplementors) out := graphql.NewOrderedMap(len(fields)) invalid := false for i, field := range fields { out.Keys[i] = field.Alias switch field.Name { case "__typename": out.Values[i] = graphql.MarshalString("__Type") case "kind": out.Values[i] = ec.___Type_kind(ctx, field, obj) if out.Values[i] == graphql.Null { invalid = true } case "name": out.Values[i] = ec.___Type_name(ctx, field, obj) case "description": out.Values[i] = ec.___Type_description(ctx, field, obj) case "fields": out.Values[i] = ec.___Type_fields(ctx, field, obj) case "interfaces": out.Values[i] = ec.___Type_interfaces(ctx, field, obj) case "possibleTypes": out.Values[i] = ec.___Type_possibleTypes(ctx, field, obj) case "enumValues": out.Values[i] = ec.___Type_enumValues(ctx, field, obj) case "inputFields": out.Values[i] = ec.___Type_inputFields(ctx, field, obj) case "ofType": out.Values[i] = ec.___Type_ofType(ctx, field, obj) default: panic("unknown field " + strconv.Quote(field.Name)) } } if invalid { return graphql.Null } return out }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "func TestForbidConstAssignWhenLoweringUsing(t *testing.T) {\n\tdefault_suite.expectBundled(t, bundled{\n\t\tfiles: map[string]string{\n\t\t\t\"/entry.js\": `\n\t\t\t\tconst x = 1\n\t\t\t\tusing x2 = 2\n\t\t\t\tx = 3\n\t\t\t\tfunction foo() {\n\t\t\t\t\tconst y = 1\n\t\t\t\t\tusing y2 = 2\n\t\t\t\t\ty = 3\n\t\t\t\t...
[ "0.58951914", "0.5789157", "0.56343776", "0.55349874", "0.5516496", "0.54126674", "0.5380506", "0.53651625", "0.5303207", "0.5297547", "0.52558833", "0.52072686", "0.51567554", "0.51085794", "0.508947", "0.5007158", "0.50040805", "0.49892417", "0.4960484", "0.49534518", "0.49...
0.0
-1
return store instance to interact with db
func NewCatStore(db *gorm.DB) *CatStore { return &CatStore{ db: db, } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "func Store() *bolt.DB {\n\treturn store\n}", "func Store() store.Store {\n\treturn pg.New(config.GetDbURL())\n}", "func GetStore() KVStore {\n\treturn dbConn\n}", "func Instance() *gorm.DB {\n return database\n}", "func (s *Store) Store() backend.Store {\n\treturn s.store\n}", "func NewStore()(*Store)...
[ "0.7613458", "0.67639315", "0.6701285", "0.65773106", "0.6572337", "0.65669346", "0.6475751", "0.64663815", "0.641933", "0.641262", "0.6412358", "0.64015996", "0.6391207", "0.6363214", "0.6360533", "0.63537705", "0.63418376", "0.6340086", "0.6324563", "0.6293636", "0.6260166"...
0.0
-1
Get retrieves a byte buffer from the pool and resets it so that it is ready to use.
func (p *bufferPool) Get() *bytes.Buffer { buf := p.underlying.Get().(*bytes.Buffer) buf.Reset() return buf }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "func (bp *BufferPool) Get() *bytes.Buffer {\n\tvar buff *bytes.Buffer\n\tselect {\n\tcase buff = <-bp.pool:\n\tdefault:\n\t\tbuff = &bytes.Buffer{}\n\t}\n\treturn buff\n}", "func Get() *bytes.Buffer {\n\treturn gPool.Get().(*bytes.Buffer)\n}", "func (bp *BufferPool) Get() *bytes.Buffer {\n\tbuffer := bp.pool.G...
[ "0.80125904", "0.7854275", "0.785205", "0.77734995", "0.7718327", "0.76411927", "0.7631384", "0.7628094", "0.76028615", "0.7544255", "0.7519572", "0.7511184", "0.74695724", "0.72912955", "0.72753537", "0.7266877", "0.7258527", "0.72441524", "0.72260463", "0.7162879", "0.71382...
0.81058604
0
ApplyOptions implementation of the Actionable interface
func (ci *createIndex) ApplyOptions() Actionable { ci.options = ci.context.Options().(*options.CreateIndexOptions) ci.indexer.SetOptions(&golastic.IndexOptions{Timeout: ci.options.TimeoutInSeconds()}) return ci }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "func (s *snapshot) ApplyOptions() Actionable {\n\ts.options = s.context.Options().(*options.SnapshotOptions)\n\n\tif len(s.options.Name) == 0 {\n\t\ts.options.Name = \"github.com/alejandro-carstens/scrubber-\" + time.Now().Format(\"1992-06-02\")\n\t}\n\n\tif !s.options.Exists(\"wait_for_completion\") {\n\t\ts.opti...
[ "0.7005766", "0.6385246", "0.62773436", "0.6115748", "0.58998954", "0.5832392", "0.5778075", "0.56691056", "0.5668067", "0.5614631", "0.56125396", "0.55785906", "0.55463755", "0.55210423", "0.5516695", "0.5509331", "0.5503785", "0.5501453", "0.5478226", "0.54261357", "0.54245...
0.6105199
4
Perform implementation of the actionable interface
func (ci *createIndex) Perform() Actionable { exists, err := ci.indexer.Exists(ci.options.Name) if err != nil { ci.errorContainer.push(ci.options.Name, ci.name, err) return ci } if exists { ci.errorContainer.push(ci.options.Name, ci.name, errors.New("Index already exists")) return ci } schema, err := mapToString(ci.options.ExtraSettings) if err != nil { ci.errorContainer.push(ci.options.Name, ci.name, err) return ci } if err := ci.indexer.CreateIndex(ci.options.Name, schema); err != nil { ci.errorContainer.push(ci.options.Name, ci.name, err) } if len(ci.errorContainer.list()) > 0 && ci.retryCount < ci.context.GetRetryCount() { ci.retryCount = ci.retryCount + 1 ci.Perform() } ci.notifiableList = append(ci.notifiableList, ci.options.Name) return ci }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "func (c *Card) Action(_ context.Context, _ *int, _ time.Time, _ interface{}) (done bool, err error) {\n\treturn true, nil\n}", "func (m *Bigo) Action(handler Handler) {\n\tvalidateHandler(handler)\n\tm.action = handler\n}", "func (e *evictAction) DoAction(conflicting bool, data interface{}) (*ActionResult, err...
[ "0.6321835", "0.628808", "0.6212448", "0.6210594", "0.6196974", "0.61947316", "0.6190128", "0.6157147", "0.60914505", "0.6066623", "0.60116875", "0.59964776", "0.5961889", "0.5958526", "0.59500957", "0.59466", "0.5925344", "0.5824236", "0.57868105", "0.5785024", "0.57547855",...
0.0
-1
ApplyFilters implementation of the actionable interface
func (ci *createIndex) ApplyFilters() error { return nil }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "func Apply(m []AuthenticatedResource) {\n\tfor _, a := range m {\n\t\tvar fc revel.FilterConfigurator\n\t\tif reflect.TypeOf(a.Resource).Kind() == reflect.Func {\n\t\t\tfc = revel.FilterAction(a.Resource)\n\t\t} else {\n\t\t\tfc = revel.FilterController(a.Resource)\n\t\t}\n\t\tfc.Add(SessionAuthenticationFilter)\n...
[ "0.6541863", "0.6425357", "0.6058154", "0.5973066", "0.59585464", "0.5934287", "0.5757698", "0.5753853", "0.573798", "0.5654189", "0.56025416", "0.56002575", "0.55881435", "0.5585381", "0.5567364", "0.5439903", "0.5408636", "0.53953284", "0.53719705", "0.5364307", "0.5357391"...
0.58346456
6
NewDefaultApiController creates a default api controller
func NewDefaultApiController(s DefaultApiServicer) Router { return &DefaultApiController{ service: s } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "func NewDefaultApiController(s DefaultApiServicer) Router {\n\treturn &DefaultApiController{service: s}\n}", "func NewDefaultApiController(s DefaultApiServicer, m func(http.Handler) http.Handler) Router {\n\treturn &DefaultApiController{service: s, middleware: m}\n}", "func NewAPIController(c *container.Contai...
[ "0.8075666", "0.8023453", "0.67176133", "0.64246213", "0.6235566", "0.62157035", "0.6152561", "0.6152561", "0.6152561", "0.6112844", "0.6106132", "0.6084419", "0.6062073", "0.60533047", "0.60165876", "0.60151273", "0.59801435", "0.5952995", "0.59251064", "0.58884543", "0.5872...
0.8062977
2
Routes returns all of the api route for the DefaultApiController
func (c *DefaultApiController) Routes() Routes { return Routes{ { "GetJobOffer", strings.ToUpper("Get"), "/job_offer", c.GetJobOffer, }, { "GetOccupation", strings.ToUpper("Get"), "/occupation", c.GetOccupation, }, { "GetTotalPopulation", strings.ToUpper("Get"), "/total_population", c.GetTotalPopulation, }, } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "func (c *DefaultApiController) Routes() Routes {\n\treturn Routes{ \n\t\t{\n\t\t\t\"AccountGet\",\n\t\t\tstrings.ToUpper(\"Get\"),\n\t\t\t\"/api/v1/account\",\n\t\t\tc.AccountGet,\n\t\t},\n\t\t{\n\t\t\t\"EchoGet\",\n\t\t\tstrings.ToUpper(\"Get\"),\n\t\t\t\"/api/v1/echo\",\n\t\t\tc.EchoGet,\n\t\t},\n\t}\n}", "fun...
[ "0.7880956", "0.7545313", "0.7503585", "0.749873", "0.74294", "0.7349533", "0.73050517", "0.7297267", "0.7239463", "0.7185087", "0.7149267", "0.70478773", "0.70125264", "0.6981117", "0.697953", "0.69765663", "0.6949959", "0.6927297", "0.68335825", "0.6802384", "0.68009883", ...
0.7773238
1
NewCmdSnapshot adds command for operating on snapshot
func NewCmdSnapshot() *cobra.Command { cmd := &cobra.Command{ Use: "snapshot", Short: "Provides operations related to a Volume snapshot", Long: snapshotCommandHelpText, } cmd.AddCommand( NewCmdSnapshotCreate(), NewCmdSnapshotList(), NewCmdSnapshotRevert(), ) cmd.PersistentFlags().StringVarP(&options.namespace, "namespace", "n", options.namespace, "namespace name, required if volume is not in the default namespace") return cmd }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "func Snapshot() *Command {\n\tcmd := &Command{\n\t\tCommand: &cobra.Command{\n\t\t\tUse: \"snapshot\",\n\t\t\tAliases: []string{\"s\"},\n\t\t\tShort: \"Access and manage snapshots\",\n\t\t\tLong: \"The subcommands of `doctl compute snapshot` allow you to manage and retrieve information about Droplet and b...
[ "0.7127528", "0.6976639", "0.6315205", "0.6281483", "0.6244356", "0.6174659", "0.59622616", "0.57991153", "0.5735832", "0.5718462", "0.56993085", "0.5630121", "0.5628828", "0.561144", "0.5593766", "0.5501497", "0.549639", "0.5496263", "0.54405695", "0.54318595", "0.5427724", ...
0.7492406
0
IsDNS1123Label tests for a string that conforms to the definition of a label in DNS (RFC 1123).
func IsDNS1123Label(value string) bool { if len(value) > dns1123LabelMaxLength { return false } if !dns1123LabelRegexp.MatchString(value) { return false } return true }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "func NameIsDNSLabel(name string, prefix bool) []string {\n\tif prefix {\n\t\tname = maskTrailingDash(name)\n\t}\n\treturn validation.IsDNS1123Label(name)\n}", "func validDNSLabel(s string) bool {\n\tif len(s) > 63 {\n\t\treturn false\n\t}\n\n\tfor i, r := range s {\n\t\tif i == 0 || i == len(s)-1 {\n\t\t\tif (r ...
[ "0.7073981", "0.6784894", "0.6662813", "0.6645072", "0.6610259", "0.65547305", "0.6539056", "0.61992234", "0.590272", "0.5892211", "0.57716644", "0.568415", "0.56640834", "0.56540054", "0.5626012", "0.55819505", "0.55145305", "0.5475766", "0.5388402", "0.5378654", "0.53565663...
0.8913801
0
SetJSON store json data
func (h *API) SetJSON(key string, value interface{}, expiration time.Duration) (*redis.StatusCmd, error) { value, err := json.Marshal(value) if err != nil { return nil, err } ret := h.Client.Set(key, value, expiration) return ret, nil }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "func SetJSON(s KVStore, key string, v interface{}) (returnErr error) {\n\tdata, err := json.Marshal(v)\n\tif err != nil {\n\t\treturn errors.Wrap(err, \"Error while storing json\")\n\t}\n\treturn s.Store(key, data)\n}", "func (s *DiffStore) SetJSON(key []byte, value interface{}) {\n\tvalueBytes, err := json.Mars...
[ "0.7538773", "0.7155119", "0.70645815", "0.6895792", "0.6857484", "0.6847259", "0.67868143", "0.6607495", "0.6364926", "0.62667775", "0.6214888", "0.6126578", "0.60069203", "0.59185195", "0.5913743", "0.59000033", "0.5890777", "0.58237827", "0.57883984", "0.56852114", "0.5677...
0.6524781
8
GetJSON get json data
func (h *API) GetJSON(key string) (map[string]interface{}, error) { var imapGet map[string]interface{} value, err := h.Client.Get(key).Result() if err != nil { return nil, err } json.Unmarshal([]byte(value), &imapGet) return imapGet, nil }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "func getJson(url string, target interface{}) error {\n\tr, err := sendClient.Get(url)\n\tif err != nil {\n\t\treturn err\n\t}\n\tdefer r.Body.Close()\n\treturn json.NewDecoder(r.Body).Decode(target)\n}", "func getJson(url string, target interface{}) error {\n\tr, err := http.Get(url)\n\tif err != nil {\n\t\tretu...
[ "0.70674294", "0.70100605", "0.6993362", "0.6975635", "0.695702", "0.69370836", "0.6917192", "0.69113797", "0.6858359", "0.6826451", "0.68240994", "0.6764532", "0.67441463", "0.6697951", "0.6689485", "0.6645399", "0.6592032", "0.65773845", "0.65652645", "0.6562084", "0.651350...
0.6406143
29
getTemplatingSource fetches template source files and adds them to a data set to be used when running the template function
func getTemplatingSource(spec *opsv1alpha1.GitOps) (map[string]interface{}, error) { if spec.Spec.Templating != nil { sourceDir := spec.Status.RootFolder + "/" + spec.Spec.RootFolder + "/" + spec.Spec.Templating.SourceFolder if spec.Spec.Templating.SourceFolder != "" { sourceDir += "/" } t := spec.Spec.Templating if t.Enabled { if t.Source != nil { data := make(map[string]interface{}) for _, f := range t.Source.TemplateDataFile { temp := make(map[string]interface{}) fData, err := ioutil.ReadFile(sourceDir + f) if err != nil { log.Error(err, "Failed to read file") return nil, err } yaml.Unmarshal(fData, temp) for k, v := range temp { data[k] = v } } return data, nil } } return nil, nil } return nil, nil }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "func getTemplateSource() templateSource {\n\t// do lazy init to avoid zip decompression unless absolutely necessary\n\ttemplatesOnce.Do(func() {\n\t\ttemplates = &fsTemplateSource{\n\t\t\tfs: http.FS(templatesFs),\n\t\t\tnamingScheme: func(language extension.Language, category extension.Category, template string) ...
[ "0.7741914", "0.6508751", "0.6408694", "0.62078", "0.6203542", "0.61677474", "0.6116086", "0.61155236", "0.60829556", "0.60757655", "0.60627323", "0.6052237", "0.6047212", "0.59024334", "0.58020484", "0.5796863", "0.57956225", "0.5792862", "0.57480186", "0.5741771", "0.573856...
0.76934034
1
templateFile takes one yaml file as input and runs Go template engine on the file. Output is written to output directory
func (t *templater) templateFile(workDir string, outDir string, file os.FileInfo, d map[string]interface{}) { if strings.Contains(file.Name(), "yaml") { filePath := workDir + "/" + file.Name() tEx := templ.New(file.Name()) tEx.Funcs(templateFuncs(workDir)) tEx.ParseFiles(filePath) b := bytes.NewBuffer([]byte{}) err := tEx.Execute(b, d) if err != nil { log.Error(err, "Failed to execute template") } newF, err := os.Create(outDir + "/" + file.Name()) if err != nil { log.Error(err, "Failed to create file", "file", file.Name()) return } newF.Write(b.Bytes()) newF.Close() } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "func TemplateFile(src string, outBuf *bytes.Buffer, vars map[string]interface{}) error {\n\n\t// verify that the input template exists\n\tif _, err := os.Stat(src); err != nil {\n\t\treturn errors.Wrapf(err, \"Source template '%s' doesn't exist\", src)\n\t}\n\n\tsrcTemplate, err := ioutil.ReadFile(src)\n\tif err !...
[ "0.7149074", "0.67122024", "0.6695799", "0.6583514", "0.64977914", "0.6476879", "0.63664204", "0.63381994", "0.62933046", "0.62473583", "0.6188287", "0.6182314", "0.6150731", "0.6140894", "0.6135779", "0.6125098", "0.6113959", "0.608692", "0.60588443", "0.60361314", "0.598491...
0.8018812
0
templateDir runs through a directory recursively templating every file on the way down in the tree
func (t *templater) templateDir(workDir string, outDir string, d map[string]interface{}) { log.Info("templating", "dir", workDir) err := os.Mkdir(outDir, 0755) if err != nil && !os.IsExist(err) { log.Error(err, "Failed to create output dir") return } files, err := ioutil.ReadDir(workDir) if err != nil { log.Error(err, "Failed to read dir") } for _, file := range files { if file.IsDir() { t.templateDir(workDir+"/"+file.Name(), outDir+"/"+file.Name(), d) } else { t.templateFile(workDir, outDir, file, d) } } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "func setupTemplates(folder string) error {\n\n\tcontents, err := ioutil.ReadDir(folder)\n\n\tif err != nil {\n\t\treturn err\n\t}\n\n\tvar files []string\n\n\tfor _, file := range contents {\n\t\tfull_name := file.Name()\n\t\tfiles = append(files, filepath.Join(folder, full_name))\n\t}\n\n\tvar temperr error\n\n\t...
[ "0.71167123", "0.6988426", "0.6940073", "0.68628114", "0.67087746", "0.66926205", "0.66885155", "0.667753", "0.66757613", "0.66010064", "0.6564374", "0.6556842", "0.6528031", "0.6474018", "0.6458112", "0.6447552", "0.6434968", "0.64225084", "0.62655014", "0.62508416", "0.6185...
0.7967958
0
RunPreExecutor runs an arbitary preexecutor to template the yaml files
func RunPreExecutor(spec *opsv1alpha1.GitOps, dir string) error { if spec.Spec.Templating != nil { t := spec.Spec.Templating if t.Executor != nil { // Create a new context and add a timeout to it ctx, cancel := context.WithTimeout(context.Background(), 2*time.Second) defer cancel() // The cancel should be deferred so resources are cleaned up cmd := exec.CommandContext(ctx, t.Executor.Exec) cmd.Dir = GetGitRootDir(spec) if spec.Spec.Templating.SourceFolder != "" { cmd.Dir += "/" + spec.Spec.Templating.SourceFolder } if len(t.Executor.Args) >= 1 { a := []string{t.Executor.Exec} for _, add := range t.Executor.Args { a = append(a, add) } cmd.Args = a } out, err := cmd.CombinedOutput() if ctx.Err() == context.DeadlineExceeded { log.Error(err, "Command timed out") return err } if err != nil { log.Error(err, "Command failed", "output", string(out)) } return err } } return nil }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "func (k *PluginRunner) preRun(cmd *cobra.Command, args []string) error {\n\tlr := fLdr.RestrictionRootOnly\n\tfSys := filesys.MakeFsOnDisk()\n\tldr, err := fLdr.NewLoader(lr, filepath.Clean(k.root), fSys)\n\tif err != nil {\n\t\treturn err\n\t}\n\n\tv := validator.NewKustValidator()\n\n\tuf := kunstruct.NewKunstru...
[ "0.62390107", "0.6202845", "0.6157384", "0.6145199", "0.61007977", "0.58247554", "0.57876694", "0.5771327", "0.5714059", "0.5706957", "0.5641635", "0.5640143", "0.5631724", "0.56255126", "0.5613145", "0.556822", "0.5548587", "0.5501238", "0.5452613", "0.5401187", "0.53920096"...
0.6956221
0
NewConverter creates and returns a new Converter for the given Lua state.
func NewConverter(L *lua.LState) *Converter { c := &Converter{ lstate: L, } c.metatable = c.ctyMetatable() return c }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "func NewConverter(config *Config) (*Converter, error) {\n if config == nil {\n\t\treturn nil, errors.New(\"config cannot be nil\")\n\t}\n\treturn &Converter{\n\t\tconfig: config,\n\t}, nil\n}", "func NewConverter() *converter {\n\treturn &converter{}\n}", "func NewConverter(config *ConverterConfig) *Convert...
[ "0.70830095", "0.7060295", "0.678922", "0.6786389", "0.66167057", "0.65999913", "0.6595154", "0.65438426", "0.6493315", "0.6200213", "0.6107004", "0.59985536", "0.595151", "0.58438957", "0.5787515", "0.57420427", "0.55313313", "0.5462134", "0.5317193", "0.52470976", "0.517908...
0.83710945
0
phi6primeSq evaluates the 6th cyclotomic polynomial, \phi_6(x) = x^2x+1, at p^2.
func phi6primeSq() []byte { one := big.NewInt(1) p := new(big.Int).SetBytes(fpOrder[:]) // p p2 := new(big.Int).Mul(p, p) // p^2 p4 := new(big.Int).Sub(p2, one) // p^2 - 1 p4.Mul(p4, p2) // p^4 - p^2 p4.Add(p4, one) // p^4 - p^2 + 1 return p4.Bytes() }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "func hash6(u uint64, h uint8) uint32 {\n\treturn uint32(((u << (64 - 48)) * prime6bytes) >> ((64 - h) & 63))\n}", "func Pow6(in *big.Float) *big.Float {\n\treturn Pow(in, 6)\n}", "func (r thinPoly) Toom6(f, g *[768]int32) thinPoly {\n\tvar e = [][]int32 {\n\t\tmake(thinPoly, 256).Karatsuba1(f[0:128], g[0:128])...
[ "0.6544208", "0.6188257", "0.56555146", "0.51578116", "0.5128709", "0.50900054", "0.5025849", "0.5000295", "0.49927026", "0.4945414", "0.490238", "0.4882119", "0.48817033", "0.48737305", "0.48098227", "0.47991794", "0.47904107", "0.47711647", "0.47703955", "0.47602263", "0.47...
0.8614351
0
New instanciate the newapis
func New(key string) *Api { return &Api{&http.Client{}, key, "https://newsapi.org/v2/"} }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "func New() *Client {\n return &Client{&API{}}\n}", "func newAPI(cfg *ClientConfig, options ...ClientOption) *Client {\n\tclient := &Client{\n\t\tConfig: cfg,\n\t\thttpClient: &http.Client{},\n\t}\n\n\tfor _, option := range options {\n\t\toption(client)\n\t}\n\n\treturn client\n}", "func getNewAPI(anonymo...
[ "0.66781676", "0.64137304", "0.6388719", "0.6369072", "0.63019925", "0.63019925", "0.6297614", "0.6277084", "0.6175942", "0.6163042", "0.6157485", "0.610001", "0.60947263", "0.6075261", "0.6031725", "0.60286605", "0.6021817", "0.60109615", "0.60100245", "0.6003949", "0.598773...
0.64275396
1
SerializeUrl implements the required interface
func (r ReqArticles) SerializeUrl() string { return r.baseUrl + "everything?q=" + r.q }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "func (m *InformationalUrl) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) {\n {\n err := writer.WriteStringValue(\"logoUrl\", m.GetLogoUrl())\n if err != nil {\n return err\n }\n }\n {\n err := writer.Wr...
[ "0.6716807", "0.63441896", "0.62649", "0.6165139", "0.6015502", "0.5903639", "0.58992463", "0.58314365", "0.5798447", "0.57529104", "0.57151", "0.57116693", "0.56682795", "0.5641105", "0.56274664", "0.5583831", "0.55663586", "0.55209136", "0.550381", "0.55001384", "0.54861057...
0.7404325
0
SerializeUrl implements the required interface
func (r ReqHeadlines) SerializeUrl() string { return r.baseUrl + "top-headlines?category=" + r.category + "&pageSize=" + strconv.Itoa(r.pageSize) + "&country=" + r.country }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "func (r ReqArticles) SerializeUrl() string {\n\treturn r.baseUrl + \"everything?q=\" + r.q\n}", "func (m *InformationalUrl) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) {\n {\n err := writer.WriteStringValue(\"logoUrl\", m.GetLogoUrl())\...
[ "0.7404191", "0.6716941", "0.63445586", "0.6165448", "0.60160846", "0.5903363", "0.589787", "0.5830765", "0.5797892", "0.57532245", "0.571518", "0.5711831", "0.5668135", "0.56397814", "0.5626903", "0.5581893", "0.5565815", "0.55203366", "0.5503169", "0.54993176", "0.54848033"...
0.6264516
3
GetArticles returns all the articles in given a request, a keyword can be anything
func (a *Api) GetArticles(keyword string) (*Response, error) { req := ReqArticles{baseUrl: a.baseUrl, q: keyword} return a.do(req) }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "func GetArticles(w http.ResponseWriter, r *http.Request) {\n\tarticles, err := dao.findAll()\n\tif err != nil {\n\t\trespondWithError(w, http.StatusInternalServerError, err.Error())\n\t\treturn\n\t}\n\trespondWithJSON(w, http.StatusOK, articles)\n}", "func (c *Client) GetArticles(since int) (*RetrieveResult, err...
[ "0.6451116", "0.63958263", "0.6380423", "0.6260228", "0.61972106", "0.6151694", "0.6122455", "0.60833824", "0.5931939", "0.59121436", "0.5874952", "0.5871982", "0.58573645", "0.5850068", "0.5837676", "0.5773559", "0.5768707", "0.571975", "0.57004565", "0.56893593", "0.5687668...
0.7885638
0
GetHeadlines returns all the articles in given a request, a category can be one of the following: entertainement, general, health, science, sports, technology, business
func (a *Api) GetHeadlines(category string) (*Response, error) { req := ReqHeadlines{baseUrl: a.baseUrl, category: category} return a.do(req) }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "func (t *NewsService) Headlines(request *HeadlinesRequest) (*HeadlinesResponse, error) {\n\n\trsp := &HeadlinesResponse{}\n\treturn rsp, t.client.Call(\"news\", \"Headlines\", request, rsp)\n\n}", "func TopHeadlines(ctx context.Context, _ store.Store, r *http.Request) (*SuccessResponse, error) {\n\tr.ParseForm()...
[ "0.68849087", "0.6120435", "0.58814883", "0.57775015", "0.5727307", "0.5402256", "0.51543653", "0.5129571", "0.49519652", "0.48825216", "0.48794803", "0.47898486", "0.4730368", "0.46671894", "0.46384147", "0.45988035", "0.4587881", "0.45309943", "0.44835395", "0.4472544", "0....
0.7598716
0
CronIntervalValidator return a nil value when a valid cron string is passed used in gopkg.in/validator.v2
func CronIntervalValidator(val interface{}, param string) error { value, ok := val.(string) if !ok { return fmt.Errorf("invalid crontab entry, not a valid string") } if _, err := cron.ParseStandard(value); err != nil { return errors.Wrap(err, "invalid crontab entry") } return nil }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "func ValidateCronInterval(val interface{}) error {\n\treturn CronIntervalValidator(val, \"\")\n}", "func (c *CronSchedule) Validate() error {\n\tif c.entry == \"\" {\n\t\treturn ErrMissingCronEntry\n\t}\n\t_, err := cron.Parse(c.entry)\n\tif err != nil {\n\t\treturn err\n\t}\n\treturn nil\n}", "func (c Cron) V...
[ "0.80303437", "0.72242135", "0.6995862", "0.6559356", "0.57354695", "0.5719239", "0.5704898", "0.5627016", "0.56057084", "0.5604991", "0.5554886", "0.5496737", "0.54547256", "0.5443391", "0.5397671", "0.5357907", "0.53289336", "0.5317187", "0.5303617", "0.524098", "0.5240222"...
0.81514907
0
ValidateCronInterval return a nil value when a valid cron string is passed
func ValidateCronInterval(val interface{}) error { return CronIntervalValidator(val, "") }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "func CronIntervalValidator(val interface{}, param string) error {\n\tvalue, ok := val.(string)\n\tif !ok {\n\t\treturn fmt.Errorf(\"invalid crontab entry, not a valid string\")\n\t}\n\tif _, err := cron.ParseStandard(value); err != nil {\n\t\treturn errors.Wrap(err, \"invalid crontab entry\")\n\t}\n\treturn nil\n}...
[ "0.79615176", "0.74458677", "0.68224376", "0.6681811", "0.5889432", "0.58734566", "0.5814548", "0.57939744", "0.5617034", "0.55219054", "0.55017984", "0.5481706", "0.53538656", "0.5240428", "0.5230663", "0.5189", "0.5160228", "0.51555777", "0.51552075", "0.513699", "0.511997"...
0.8333683
0
Handle executing the request and returning a response
func (fn PostSilencesHandlerFunc) Handle(params PostSilencesParams) middleware.Responder { return fn(params) }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "func (h *Handler) Handle(payload *router.Payload, response *router.Response) {\n\tbody, err := ioutil.ReadAll(payload.Req.Body)\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\twholeRequest := &pluginRequestPayload{\n\t\tMethod: payload.Req.Method,\n\t\tPath: payload.Req.URL.Path,\n\t\tQueryString: payload.R...
[ "0.65477353", "0.64089614", "0.63521093", "0.6293218", "0.6220044", "0.618034", "0.611625", "0.6113114", "0.6109798", "0.6105902", "0.60919166", "0.6048176", "0.60456955", "0.60319835", "0.60087895", "0.60002613", "0.599812", "0.59511447", "0.59339225", "0.591396", "0.5902561...
0.0
-1
NewPostSilences creates a new http.Handler for the post silences operation
func NewPostSilences(ctx *middleware.Context, handler PostSilencesHandler) *PostSilences { return &PostSilences{Context: ctx, Handler: handler} }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "func (fn PostSilencesHandlerFunc) Handle(params PostSilencesParams) middleware.Responder {\n\treturn fn(params)\n}", "func (s *Service) AddPostHandler(w http.ResponseWriter, r *http.Request) {\n\n\tform := PForm{}\n\n\tdefer r.Body.Close()\n\tif err := json.NewDecoder(r.Body).Decode(&form); err != nil {\n\t\tmes...
[ "0.5782889", "0.5709932", "0.55733293", "0.5463332", "0.5406926", "0.5386403", "0.5368965", "0.53227884", "0.5293708", "0.52551687", "0.5246721", "0.52441657", "0.52388203", "0.5234427", "0.5228126", "0.52029496", "0.51942873", "0.51863825", "0.51829284", "0.5158858", "0.5144...
0.7520936
0
Validate validates this post silences o k body
func (o *PostSilencesOKBody) Validate(formats strfmt.Registry) error { return nil }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "func (mt *Post) Validate() (err error) {\n\n\tif mt.URLName == \"\" {\n\t\terr = goa.MergeErrors(err, goa.MissingAttributeError(`response`, \"url_name\"))\n\t}\n\tif mt.Title == \"\" {\n\t\terr = goa.MergeErrors(err, goa.MissingAttributeError(`response`, \"title\"))\n\t}\n\tif mt.Contents == \"\" {\n\t\terr = goa....
[ "0.6828625", "0.6763795", "0.66514206", "0.66498876", "0.6551311", "0.6549796", "0.6481227", "0.64445597", "0.64433396", "0.6426678", "0.6376102", "0.62443596", "0.6219988", "0.60760933", "0.6075056", "0.6064885", "0.6051017", "0.6040373", "0.6032003", "0.6032003", "0.6004105...
0.6716438
2
ContextValidate validates this post silences o k body based on context it is used
func (o *PostSilencesOKBody) ContextValidate(ctx context.Context, formats strfmt.Registry) error { return nil }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "func (o *GetAPIV1PostsPostIDOKBody) ContextValidate(ctx context.Context, formats strfmt.Registry) error {\n\tvar res []error\n\n\tif err := o.contextValidateVotedAge(ctx, formats); err != nil {\n\t\tres = append(res, err)\n\t}\n\n\tif err := o.contextValidateVotedBloodType(ctx, formats); err != nil {\n\t\tres = ap...
[ "0.6598052", "0.65758985", "0.65550315", "0.65479106", "0.653154", "0.6530507", "0.64153093", "0.6161927", "0.60246253", "0.5965307", "0.59410894", "0.5938023", "0.5882044", "0.5875261", "0.58471507", "0.58214104", "0.5811343", "0.5792734", "0.5791356", "0.5773505", "0.576035...
0.73734653
0
NewDesktopApp is a esktopApp constructor
func NewDesktopApp(c *restapi.RestClient) *DesktopApp { s := DesktopApp{} s.client = c s.apiRead = "/SaasManage/GetApplication" s.apiCreate = "/SaasManage/ImportAppFromTemplate" s.apiDelete = "/SaasManage/DeleteApplication" s.apiUpdate = "/SaasManage/UpdateApplicationDE" s.apiPermissions = "/SaasManage/SetApplicationPermissions" return &s }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "func NewMicrosoftManagedDesktop()(*MicrosoftManagedDesktop) {\n m := &MicrosoftManagedDesktop{\n }\n m.backingStore = ie8677ce2c7e1b4c22e9c3827ecd078d41185424dd9eeb92b7d971ed2d49a392e.BackingStoreFactoryInstance();\n m.SetAdditionalData(make(map[string]any))\n return m\n}", "func newApp(name strin...
[ "0.67276466", "0.6412036", "0.6337244", "0.6161679", "0.6158922", "0.6152389", "0.6087091", "0.6004905", "0.5998879", "0.5976587", "0.5976587", "0.59525", "0.5938636", "0.59010977", "0.58993447", "0.58642554", "0.58642554", "0.5835353", "0.58348334", "0.5830582", "0.57973415"...
0.66225857
1
Read function fetches a DesktopApp from source, including attribute values. Returns error if any
func (o *DesktopApp) Read() error { if o.ID == "" { return errors.New("error: ID is empty") } var queryArg = make(map[string]interface{}) queryArg["_RowKey"] = o.ID // Attempt to read from an upstream API resp, err := o.client.CallGenericMapAPI(o.apiRead, queryArg) if err != nil { return err } if !resp.Success { return errors.New(resp.Message) } fillWithMap(o, resp.Result) LogD.Printf("Filled object: %+v", o) return nil }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "func (c Client) Application(name string) (types.Application, error) {\n var app types.ApplicationResponse\n\n resp, err := c.get(\"/applications/\" + name, nil)\n defer ensureReaderClosed(resp)\n if err != nil {\n return app.Attributes, err\n }\n\n err = json.NewDecoder(resp.body).Decode(&app)\n\n if err...
[ "0.5668806", "0.5593288", "0.5444834", "0.53778654", "0.5353353", "0.5259754", "0.5245159", "0.51499933", "0.5140241", "0.5134525", "0.51081663", "0.50886697", "0.5061541", "0.5054451", "0.50369155", "0.5032618", "0.50098276", "0.49908748", "0.49253199", "0.49178293", "0.4913...
0.69884974
0
Create function creates a new DesktopApp and returns a map that contains creation result
func (o *DesktopApp) Create() (*restapi.SliceResponse, error) { var queryArg = make(map[string]interface{}) queryArg["ID"] = []string{o.TemplateName} LogD.Printf("Generated Map for Create(): %+v", queryArg) resp, err := o.client.CallSliceAPI(o.apiCreate, queryArg) if err != nil { return nil, err } if !resp.Success { return nil, errors.New(resp.Message) } return resp, nil }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "func CreateApp(appoptions *options.App) (*App, error) {\n\tvar err error\n\n\tctx := context.Background()\n\n\t// Merge default options\n\toptions.MergeDefaults(appoptions)\n\n\tdebug := IsDebug()\n\tdevtools := IsDevtoolsEnabled()\n\tctx = context.WithValue(ctx, \"debug\", debug)\n\tctx = context.WithValue(ctx, \...
[ "0.66225415", "0.654446", "0.6375472", "0.6223953", "0.61807823", "0.6058937", "0.60041124", "0.599074", "0.59359264", "0.58941877", "0.5833043", "0.5830877", "0.58298594", "0.58298594", "0.58147323", "0.5808668", "0.5769868", "0.5695114", "0.5672025", "0.5667319", "0.5640489...
0.7543266
0
Update function updates an existing DesktopApp and returns a map that contains update result
func (o *DesktopApp) Update() (*restapi.GenericMapResponse, error) { if o.ID == "" { return nil, errors.New("error: ID is empty") } var queryArg = make(map[string]interface{}) queryArg, err := generateRequestMap(o) if err != nil { return nil, err } queryArg["_RowKey"] = o.ID LogD.Printf("Generated Map for Update(): %+v", queryArg) resp, err := o.client.CallGenericMapAPI(o.apiUpdate, queryArg) if err != nil { return nil, err } if !resp.Success { return nil, errors.New(resp.Message) } return resp, nil }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "func (a *DesktopAppState) Update(mctx MetaContext, event string, provider rpc.Transporter) {\n\tmctx.Debug(\"DesktopAppState.Update(%v)\", event)\n\ta.Lock()\n\tdefer a.Unlock()\n\ta.provider = provider\n\tswitch event {\n\tcase \"suspend\":\n\t\ta.suspended = true\n\tcase \"resume\":\n\t\ta.suspended = false\n\tc...
[ "0.6385493", "0.6043658", "0.5864704", "0.5800069", "0.5693987", "0.56730175", "0.56563413", "0.5626671", "0.56140643", "0.5547077", "0.55217266", "0.55096394", "0.54742914", "0.5469813", "0.54679286", "0.5461321", "0.54513216", "0.5429835", "0.54193294", "0.53887457", "0.538...
0.75419784
0
Delete function deletes a DesktopApp and returns a map that contains deletion result
func (o *DesktopApp) Delete() (*restapi.SliceResponse, error) { if o.ID == "" { return nil, errors.New("error: ID is empty") } var queryArg = make(map[string]interface{}) queryArg["_RowKey"] = []string{o.ID} resp, err := o.client.CallSliceAPI(o.apiDelete, queryArg) if err != nil { return nil, err } if !resp.Success { return nil, errors.New(resp.Message) } return resp, nil }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "func (am *ArtifactMap) DeleteApp(AppGUID string) {\n\tvar desiredApp *ArtifactEntry\n\tindex := 0\n\tfor i, app := range am.AppList {\n\t\tif app.GUID == AppGUID {\n\t\t\tdesiredApp = app\n\t\t\tindex = i\n\t\t\tbreak\n\t\t}\n\t}\n\tif desiredApp != nil {\n\t\tam.AppList = append(am.AppList[:index], am.AppList[ind...
[ "0.6278572", "0.6178651", "0.5830268", "0.5773523", "0.56855094", "0.5678537", "0.56749743", "0.56497693", "0.5643732", "0.5613216", "0.55936193", "0.54953444", "0.5468976", "0.5435457", "0.54103154", "0.5401574", "0.53760886", "0.5356636", "0.53545827", "0.53500414", "0.5340...
0.6713155
0
Query function returns a single DesktopApp object in map format
func (o *DesktopApp) Query() (map[string]interface{}, error) { query := "SELECT * FROM Application WHERE 1=1 AND AppType='Desktop'" if o.Name != "" { query += " AND Name='" + o.Name + "'" } return queryVaultObject(o.client, query) }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "func QueryAppComputer(appID interface{}, page, limit int, appName string) (result []services.ComputerData) {\n\tif limit == 0 {\n\t\tlimit = 50\n\t}\n\n\tvar oneAppID = 0\n\tvar appIDS []int\n\n\toneAppID, ok := appID.(int)\n\tif !ok {\n\t\tappIDS, ok = appID.([]int)\n\t}\n\n\t// select app.id as app_id, app.name,...
[ "0.6097737", "0.60779285", "0.58480924", "0.57571447", "0.57378846", "0.5686214", "0.5626677", "0.55896246", "0.5573494", "0.5558356", "0.55174613", "0.5502187", "0.54962736", "0.54962695", "0.5467324", "0.54668546", "0.5459671", "0.5443265", "0.54386073", "0.5380653", "0.537...
0.81131613
0
Inject add db and repository in mediator container
func Inject(container mediator.Container, db *gorm.DB) { container.Inject("db", db) container.Inject("repository", repository.NewRepository(db)) }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "func Inject(builder ConfigBuilder) {\n\n\t//load the env into the object\n\tbuilder.SetEnvConfigs()\n\n\t//setup dynamo library\n\tdynamoClient := builder.SetDynamoDBConfigsAndBuild()\n\t//connect to the instance\n\tlog.Println(\"Connecting to dynamo client\")\n\tdynamoClient.DefaultConnect()\n\n\t//dependency inj...
[ "0.62128794", "0.6069224", "0.60179096", "0.56158364", "0.5569465", "0.5566464", "0.5466895", "0.5295448", "0.5250882", "0.5194616", "0.518952", "0.5185271", "0.51505613", "0.5144981", "0.5142828", "0.510748", "0.5075509", "0.506949", "0.5014673", "0.49763554", "0.49588317", ...
0.7495779
0
loadOrSelfSignCertificate loads TLS certificate from secret or creates a new one
func loadOrSelfSignCertificate(cli typedCore.CoreV1Interface, cfg ServerConfig) (string, string, error) { if cfg.TLSSecretName != "" { // Load TLS certificate from secret s, err := cli.Secrets(cfg.Namespace).Get(context.Background(), cfg.TLSSecretName, meta.GetOptions{}) if err != nil { return "", "", err } certBytes, found := s.Data[core.TLSCertKey] if !found { return "", "", errors.Newf("No %s found in secret %s", core.TLSCertKey, cfg.TLSSecretName) } keyBytes, found := s.Data[core.TLSPrivateKeyKey] if !found { return "", "", errors.Newf("No %s found in secret %s", core.TLSPrivateKeyKey, cfg.TLSSecretName) } return string(certBytes), string(keyBytes), nil } // Secret not specified, create our own TLS certificate options := certificates.CreateCertificateOptions{ CommonName: cfg.ServerName, Hosts: append([]string{cfg.ServerName}, cfg.ServerAltNames...), ValidFrom: time.Now(), ValidFor: time.Hour * 24 * 365 * 10, IsCA: false, ECDSACurve: "P256", } return certificates.CreateCertificate(options, nil) }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "func (am *admissionManager) loadCertsFromSecret() {\n\tnamespace := utils.GetCurrentNamespace()\n\tcreate := false\n\tsecret, err := am.kubeClient.CoreV1().Secrets(namespace).Get(context.Background(),\n\t\tcertsSecretName, metav1.GetOptions{})\n\tif err != nil {\n\t\tif !errors.IsNotFound(err) {\n\t\t\tklog.Fatalf...
[ "0.67040336", "0.6692501", "0.64090234", "0.619866", "0.61599535", "0.614306", "0.60478413", "0.60309976", "0.6009421", "0.5974995", "0.5934542", "0.5929582", "0.58173513", "0.5784342", "0.5741942", "0.56803405", "0.56732273", "0.56301534", "0.5622985", "0.56219256", "0.55680...
0.805537
0
createTLSConfig creates a TLS config based on given config
func createTLSConfig(cert, key string) (*tls.Config, error) { var result *tls.Config c, err := tls.X509KeyPair([]byte(cert), []byte(key)) if err != nil { return nil, errors.WithStack(err) } result = &tls.Config{ Certificates: []tls.Certificate{c}, } return result, nil }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "func createTLSConfig(certFile, keyFile string) (*tls.Config, error) {\n\tvar err error\n\tconfig := &tls.Config{}\n\tconfig.Certificates = make([]tls.Certificate, 1)\n\tconfig.Certificates[0], err = tls.LoadX509KeyPair(certFile, keyFile)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\treturn config, nil\n}", "fu...
[ "0.79326254", "0.73788613", "0.7294283", "0.72898865", "0.71747434", "0.71747434", "0.71747434", "0.71747434", "0.7162306", "0.71118134", "0.6947135", "0.6874644", "0.6862285", "0.6862285", "0.673357", "0.67174786", "0.67114896", "0.6697693", "0.66969925", "0.66713005", "0.66...
0.7967637
0
Constructor will Initialize your data structure here.
func Constructor() RandomizedSet { return RandomizedSet{ Value: map[int]bool{}, Keys: []int{}, } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "func NewData() *Data {\n d := &Data{}\n d.hashMap = make(map[int]string)\n return d\n}", "func Constructor() MyHashMap {\n\treturn MyHashMap{[10005][]Node{}}\n}", "func Constructor() WordDictionary {\n\treturn WordDictionary{root:newNode2(),size:0}\n}", "func initialize() {\n\n\thead.data = \"San Francisc...
[ "0.60873514", "0.60087246", "0.5856668", "0.5840631", "0.5805296", "0.58047825", "0.5797549", "0.5733434", "0.57284784", "0.5727212", "0.57259125", "0.5710063", "0.570584", "0.5699865", "0.56768256", "0.56670105", "0.5664013", "0.56486166", "0.5637623", "0.5632756", "0.562991...
0.0
-1
Insert will Inserts a value to the set. Returns true if the set did not already contain the specified element.
func (set *RandomizedSet) Insert(val int) bool { if v, ok := set.Value[val]; ok { if v { return false } } else { set.Keys = append(set.Keys, val) } set.Value[val] = true set.Count++ return true }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "func (this *RandomizedSet) Insert(val int) bool {\n\tif _, ok := this.m[val]; ok{\n\t\treturn false\n\t}\n\tthis.m[val] = struct{}{}\n\treturn true\n}", "func (this *RandomizedSet) Insert(val int) bool {\n\t_, ok := this.m[val]\n\tif !ok {\n\t\tthis.m[val] = len(this.data)\n\t\tthis.data = append(this.data, val)...
[ "0.78956634", "0.7808493", "0.7805946", "0.7777138", "0.7772888", "0.777273", "0.7771234", "0.77451116", "0.7713906", "0.76536494", "0.7653306", "0.7574232", "0.75585407", "0.7501971", "0.7489873", "0.747495", "0.74315095", "0.727646", "0.7046946", "0.6831391", "0.681875", ...
0.7923681
0
Remove will Removes a value from the set. Returns true if the set contained the specified element.
func (set *RandomizedSet) Remove(val int) bool { if !set.Value[val] { return false } set.Value[val] = false set.Count-- if len(set.Keys) > 5*set.Count { keys := []int{} for key := range set.Value { keys = append(keys, key) } set.Keys = keys } return true }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "func (s *Set) Remove(element interface{}) bool {\n\tif _, exists := (*s)[element]; exists {\n\t\tdelete(*s, element)\n\t\treturn true\n\t}\n\treturn false\n}", "func (s *Set) Remove(elem A) bool {\n\t_, found := s.m[elem]\n\tif found {\n\t\tdelete(s.m, elem)\n\t}\n\treturn found\n}", "func (s *Set) Remove(val ...
[ "0.8324413", "0.801336", "0.78466815", "0.7746541", "0.7681242", "0.7564174", "0.7546115", "0.7481034", "0.7443292", "0.73528993", "0.7302366", "0.73018223", "0.7271032", "0.72703797", "0.72621644", "0.72470576", "0.7179773", "0.71460664", "0.71451026", "0.7127476", "0.707083...
0.7388723
9
GetRandom will Get a random element from the set.
func (set *RandomizedSet) GetRandom() int { if set.Count == 0 { return 0 } idx := rand.Int() % len(set.Keys) for !set.Value[set.Keys[idx]] { idx = rand.Int() % len(set.Keys) } return set.Keys[idx] }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "func (this *RandomizedSet) GetRandom() int {\n\tindex := rand.Intn(len(this.a))\n\treturn this.a[index]\n}", "func (this *RandomizedSet) GetRandom() int {\n\treturn this.list[rand.Intn(len(this.list))]\n}", "func (this *RandomizedSet) GetRandom() int {\n\treturn this.a[rand.Intn(len(this.a))]\n}", "func (thi...
[ "0.8133475", "0.80877596", "0.8075978", "0.805595", "0.7991664", "0.79250515", "0.791871", "0.7899077", "0.7874426", "0.7870769", "0.78109825", "0.77761334", "0.77267087", "0.76966566", "0.7687145", "0.7679171", "0.76757604", "0.7478473", "0.7123785", "0.71016484", "0.7044928...
0.7441737
18
TODO move this to sizing.go TODO when doing so, account for margins
func (w *widgetbase) allocate(x int, y int, width int, height int, d *sizing) []*allocation { return []*allocation{&allocation{ x: x, y: y, width: width, height: height, this: w, }} }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "func (s *Screen) Size() Point { return Point{X: s.width, Y: len(s.current) / s.width} }", "func (b *Element) Resize(sz fyne.Size) {\n\tif b.size == sz {\n\t\treturn\n\t}\n\n\tb.parseDims(sz)\n\n\tif b.Name == \"inputElement\" || b.Name == \"inputView\" {\n\t\tfmt.Println(\"--Resize:\", b.Name, sz, b.parsedDims.m...
[ "0.61356664", "0.5796528", "0.57349265", "0.56754404", "0.56606096", "0.5638224", "0.5629771", "0.56017876", "0.55882335", "0.557032", "0.556939", "0.55675405", "0.55657023", "0.5536792", "0.55328375", "0.5525519", "0.5525519", "0.55015546", "0.54620117", "0.54553914", "0.544...
0.0
-1
Parse parses the result.
func (r *QueryResult) Parse(targets interface{}) error { byts, _ := json.Marshal(r.Records) return json.Unmarshal(byts, &targets) }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "func (h *HTTPerf) Parse() {\n h.Results = RawParser(h.Raw)\n}", "func (r Results) Parse() telebot.Results {\n\tparsedResults := make(telebot.Results, len(r))\n\n\tfor i, result := range r {\n\t\tparsedResults[i] = &telebot.ArticleResult{\n\t\t\tURL: result.SiteUrl,\n\t\t\tThumbURL: result.CoverImag...
[ "0.7564657", "0.72145206", "0.6883133", "0.67062014", "0.65949386", "0.6539672", "0.6453612", "0.64350474", "0.6362603", "0.62645894", "0.6230624", "0.62238795", "0.6221113", "0.61815053", "0.61756355", "0.61674684", "0.6121528", "0.6115988", "0.61028284", "0.6046812", "0.602...
0.60989374
19
IsValid returns true if whereClause's condition is valid. In SOQL, condition in where clause can only be number, boolean or string.
func (c *whereClause) IsValid() bool { switch c.condition.(type) { case int, int8, int16, int32, int64, uint, uint8, uint16, uint32, uint64, float32, float64: return true case bool: return true case string: return true default: return false } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "func (c Condition) Valid() bool {\n\t// TODO: pass in a ColumnSchema and do validation based on it\n\tswitch c.Function {\n\tcase FuncLt, FuncLe, FuncEq, FuncNe, FuncGt, FuncGe, FuncInc, FuncExc:\n\t\treturn true\n\t}\n\treturn false\n}", "func (c *compiledStatement) validateCondition(expr influxql.Expr) error {...
[ "0.64737576", "0.6043885", "0.57372516", "0.5440292", "0.54174995", "0.5357616", "0.5356479", "0.52202374", "0.5218492", "0.51943374", "0.5133273", "0.51300323", "0.5097209", "0.5082896", "0.5081986", "0.5069481", "0.5067441", "0.5057074", "0.5036478", "0.5009793", "0.4987895...
0.82517755
0
Make request by given request context.
func (op *OpQuery) Make(ctx *RequestCtx) (*Request, error) { switch { case op.sobjectName == "": return nil, errors.New("missing Sobject name") case len(op.selectFileds) <= 0: return nil, errors.New("missing select fields") default: return NewRequest(http.MethodGet, ctx.QueryURL(op.makeQueryStatment()), nil), nil } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "func (r *Request) WithContext(ctx context.Context) *Request", "func (req *GetRequest) Context(ctx context.Context) *GetRequest {\n\treq.impl = req.impl.Context(ctx)\n\n\treturn req\n}", "func (r *Request) Context() context.Context", "func DoCtx(ctx context.Context, req *http.Request, resp interface{}) (*http...
[ "0.66820943", "0.64559156", "0.6442738", "0.64160204", "0.6373162", "0.6330858", "0.63197917", "0.63101447", "0.62860614", "0.626401", "0.62520146", "0.62121326", "0.61617136", "0.6160791", "0.61565435", "0.6135405", "0.60810935", "0.6061468", "0.60367745", "0.6032127", "0.60...
0.0
-1
Handle success response from salesforce.
func (op *OpQuery) Handle(resp *http.Response) error { if resp.StatusCode != http.StatusOK { return fmt.Errorf("get operator can't handle response with code %d, expect %d", resp.StatusCode, http.StatusOK) } return json.NewDecoder(resp.Body).Decode(&op.result) }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "func (s *STS) sendSuccessfulResponse(w http.ResponseWriter, tokenData []byte) {\n\tw.Header().Add(\"Content-Type\", \"application/json\")\n\tw.WriteHeader(http.StatusOK)\n\tif _, err := w.Write(tokenData); err != nil {\n\t\tlog.Printf(\"failure in sending STS success response: %v\", err)\n\t\treturn\n\t}\n}", "f...
[ "0.6574858", "0.63047427", "0.62137634", "0.6155782", "0.6146457", "0.6141689", "0.60377365", "0.59824455", "0.5981291", "0.59637105", "0.5942656", "0.5931414", "0.5924862", "0.5917695", "0.5870379", "0.5833002", "0.5802651", "0.5802538", "0.5785916", "0.5780289", "0.5776209"...
0.0
-1
Select defines which columns of SObject will be return in result.
func (op *OpQuery) Select(fields ...string) *OpQuery { if op.selectFileds == nil { op.selectFileds = make([]string, 0) } op.selectFileds = append(op.selectFileds, fields...) return op }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "func (q *PersonQuery) Select(columns ...kallax.SchemaField) *PersonQuery {\n\tif len(columns) == 0 {\n\t\treturn q\n\t}\n\tq.BaseQuery.Select(columns...)\n\treturn q\n}", "func (s *TableQuery) Select(args ...interface{}) drivers.ITableQuery {\n\ts.SelectSQL = NewColumn().GetSelectColumns(args...)\n\treturn s\n}"...
[ "0.72090787", "0.7190675", "0.71419865", "0.7098499", "0.70653456", "0.7048921", "0.70345056", "0.7005074", "0.69855535", "0.690301", "0.6891688", "0.6752438", "0.67426044", "0.6661285", "0.66525835", "0.6647796", "0.6607657", "0.65955967", "0.65814257", "0.6540316", "0.65068...
0.6302345
36
From defines which SObject will be query.
func (op *OpQuery) From(sobjectName string) *OpQuery { op.sobjectName = sobjectName return op }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "func (r *Search) From(from int) *Search {\n\tr.req.From = &from\n\n\treturn r\n}", "func From(from string) QueryMod {\n\treturn func(q *queries.Query) {\n\t\tqueries.AppendFrom(q, from)\n\t}\n}", "func (q *Query) From(from time.Time) *Query {\n\tq.from, q.to = from, time.Time{}\n\treturn q\n}", "func (sp *Se...
[ "0.67133564", "0.66742694", "0.6646103", "0.64490926", "0.6409074", "0.6370014", "0.63413197", "0.62121135", "0.61973435", "0.6066253", "0.60305166", "0.5998385", "0.59610677", "0.5934918", "0.58969045", "0.5894441", "0.58907807", "0.58899057", "0.5863759", "0.584637", "0.583...
0.7508155
0
Where defines what condition will be appended to the query.
func (op *OpQuery) Where(field string, condition interface{}) *OpQuery { where := whereClause{ field: field, condition: condition, } if where.IsValid() { op.whereClauses = append(op.whereClauses, where) } return op }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "func (q *Query) Where(cond string, args ...interface{}) *Query {\n\tq.whereParts = append(q.whereParts, newWherePart(cond, args...))\n\treturn q\n}", "func Where(clause string, args ...interface{}) QueryMod {\n\treturn func(q *queries.Query) {\n\t\tqueries.AppendWhere(q, clause, args...)\n\t}\n}", "func (stmt ...
[ "0.8228763", "0.81684643", "0.81154907", "0.80740434", "0.7836893", "0.7744843", "0.7743522", "0.773382", "0.77259666", "0.7711289", "0.767306", "0.76619434", "0.7660566", "0.76269233", "0.7623534", "0.7593027", "0.75879514", "0.75751895", "0.7567398", "0.75500625", "0.754909...
0.7458407
32
OrderDesc defines the order column to sort results descendant.
func (op *OpQuery) OrderDesc(field string) *OpQuery { op.order = fmt.Sprintf("%s DESC", field) return op }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "func (builder QueryBuilder) OrderDesc(predicate interface{}) QueryBuilder {\n\tbuilder.rootEdge.Order = append(builder.rootEdge.Order, orderBy{\n\t\tDirection: OrderDirectionDesc,\n\t\tPredicate: predicate,\n\t})\n\treturn builder\n}", "func OrderDesc(cols ...string) Option {\n\treturn func(q Query) Query {\n\t\...
[ "0.74827576", "0.72914994", "0.6598838", "0.6589177", "0.63501024", "0.63361025", "0.6326321", "0.6254213", "0.6189498", "0.6155316", "0.6123717", "0.6116668", "0.6116172", "0.60371745", "0.60003346", "0.5966971", "0.5953216", "0.5950294", "0.5940716", "0.5934457", "0.5901084...
0.7447665
1
OrderAsc defines the order column to sort results ascendant.
func (op *OpQuery) OrderAsc(field string) *OpQuery { op.order = fmt.Sprintf("%s ASC", field) return op }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "func OrderAsc(cols ...string) Option {\n\treturn func(q Query) Query {\n\t\tq.clauses = append(q.clauses, orderClause{\n\t\t\tcols: cols,\n\t\t\tdir: \"ASC\",\n\t\t})\n\t\treturn q\n\t}\n}", "func (c *column) Asc() orderByExpression {\n\treturn orderByExpression(c.asSql() + \" ASC\")\n}", "func (builder Query...
[ "0.78143317", "0.7525152", "0.7338644", "0.6839009", "0.67874277", "0.6700575", "0.65920097", "0.65069413", "0.6502752", "0.64526", "0.63834435", "0.6323034", "0.6193146", "0.61448115", "0.6070924", "0.6051124", "0.59214026", "0.58528703", "0.58476794", "0.58287406", "0.58260...
0.77456623
1
OrderReset resets the order statment=="".
func (op *OpQuery) OrderReset() *OpQuery { op.order = "" return op }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "func (m *ReviewMutation) ResetOrder() {\n\tm._order = nil\n\tm.cleared_order = false\n}", "func (m *TodoItemMutation) ResetOrder() {\n\tm._order = nil\n\tm.add_order = nil\n}", "func (t *txLookUp) ResetOrder() {\n\tt.mu.RLock()\n\tdefer t.mu.RUnlock()\n\tt.resetOrder()\n}", "func (m *RestaurantMutation) Rese...
[ "0.7494716", "0.732402", "0.71533674", "0.702815", "0.6776591", "0.6715659", "0.6569579", "0.65285724", "0.6491999", "0.60279214", "0.5953112", "0.59416157", "0.5916235", "0.58786863", "0.58506453", "0.5834124", "0.57945484", "0.5742576", "0.5716395", "0.56950414", "0.5656402...
0.7746023
0
OrderNullFirst make null null column value first in query results when given order column.
func (op *OpQuery) OrderNullFirst() *OpQuery { op.nullPriority = "NULL FIRST" return op }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "func (op *OpQuery) OrderNullLast() *OpQuery {\n\top.nullPriority = \"NULL LAST\"\n\treturn op\n}", "func OrderAsc(cols ...string) Option {\n\treturn func(q Query) Query {\n\t\tq.clauses = append(q.clauses, orderClause{\n\t\t\tcols: cols,\n\t\t\tdir: \"ASC\",\n\t\t})\n\t\treturn q\n\t}\n}", "func (q *Query) Or...
[ "0.6892724", "0.5792839", "0.56489444", "0.559137", "0.5567387", "0.54570764", "0.541041", "0.54067844", "0.53797185", "0.5370025", "0.53610027", "0.532752", "0.5286768", "0.5284509", "0.52831644", "0.527476", "0.52649486", "0.5257366", "0.52451324", "0.52153933", "0.521498",...
0.8278714
0
OrderNullLast make null column value last in query results when given order column.
func (op *OpQuery) OrderNullLast() *OpQuery { op.nullPriority = "NULL LAST" return op }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "func (op *OpQuery) OrderNullFirst() *OpQuery {\n\top.nullPriority = \"NULL FIRST\"\n\treturn op\n}", "func (op *OpQuery) makeOrderStatment() string {\n\tif op.order == \"\" {\n\t\treturn \"\"\n\t}\n\n\tvar nullPriority = op.nullPriority\n\tif op.nullPriority == \"\" {\n\t\tnullPriority = \"NULL FIRST\"\n\t}\n\tr...
[ "0.63343173", "0.5581829", "0.55036545", "0.5465771", "0.5410145", "0.52359337", "0.52086264", "0.51696247", "0.51222646", "0.50885546", "0.5049316", "0.50372714", "0.50086486", "0.50060993", "0.4990505", "0.49754462", "0.49704665", "0.49319875", "0.48896864", "0.48730737", "...
0.83508426
0
Limit defines the max records will be return. if n==0, will treat it as a signal to reset limitation to unlimited.
func (op *OpQuery) Limit(n int) *OpQuery { op.limit = n return op }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "func (s *ScanOp) Limit(n int) *ScanOp {\n\ts.limit = n\n\treturn s\n}", "func (q *Query) Limit(n int) *Query {\n\tq.limit = n\n\treturn q\n}", "func (s Stream) Limit(n int) Stream {\n\treturn s.Pipe(func() func(r Record) (Record, error) {\n\t\tvar count int\n\n\t\treturn func(r Record) (Record, error) {\n\t\t\...
[ "0.77530706", "0.7497172", "0.7461868", "0.7406514", "0.73182726", "0.7308236", "0.7283943", "0.7179369", "0.7084239", "0.70444053", "0.6980641", "0.69723237", "0.69614846", "0.69016427", "0.68793577", "0.68770933", "0.68446934", "0.67989546", "0.67393696", "0.6734933", "0.67...
0.7169924
8
makeSelectStatment renders statment as below if r.selectFileds has elements: SELECT [,]...
func (op *OpQuery) makeSelectStatment() string { if len(op.selectFileds) == 0 { defaultLogger.Print("[QuerySObjectRequest] Missing Select fields") } return strings.Join(op.selectFileds, ",") }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "func (op *OpQuery) Select(fields ...string) *OpQuery {\n\tif op.selectFileds == nil {\n\t\top.selectFileds = make([]string, 0)\n\t}\n\top.selectFileds = append(op.selectFileds, fields...)\n\treturn op\n}", "func renderSelect() error {\n\tview, err := g.View(ViewSelect)\n\tif err != nil {\n\t\treturn err\n\t}\n\n...
[ "0.6158283", "0.60410637", "0.5865177", "0.5729214", "0.56631666", "0.56621164", "0.56160337", "0.55718744", "0.55577374", "0.5554273", "0.5550564", "0.54608256", "0.53678966", "0.53404766", "0.5337978", "0.53222317", "0.53139794", "0.52990556", "0.52875936", "0.5280315", "0....
0.7165648
0
makeWhereCluasesStatment renders statment as below if r.whereClauses has elements: WHERE = [,=]...
func (op *OpQuery) makeWhereCluasesStatment() string { var data = make(map[string]interface{}) for _, clause := range op.whereClauses { if !clause.IsValid() { defaultLogger.Printf( "[QuerySObjectRequest] Found invalid where-clause which should be type of number, boolean or string. QuerySObject=%s, Field=%s, ConditionType=%T", op.sobjectName, clause.field, clause.condition, ) continue } data[clause.field] = clause.condition } if len(data) == 0 { return "" } var filters = make([]string, 0) for field, cond := range data { if str, ok := cond.(string); ok { filters = append(filters, fmt.Sprintf("%s='%s'", field, str)) } else { filters = append(filters, fmt.Sprintf("%s=%v", field, cond)) } } return fmt.Sprintf("WHERE %s", strings.Join(filters, ",")) }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "func whereClause(o bool, w ...where) string {\n\tvar buffer bytes.Buffer\n\tbuffer.WriteString(fmt.Sprintf(\" where \"))\n\tfor c, wc := range w {\n\t\tif c == 0 {\n\t\t\tbuffer.WriteString(fmt.Sprintf(\"%s='%v' \", wc.field, wc.value))\n\t\t} else {\n\t\t\tif o {\n\t\t\t\tbuffer.WriteString(fmt.Sprintf(\"OR %s='%...
[ "0.6814265", "0.6226242", "0.60207593", "0.5893642", "0.5787044", "0.56551355", "0.5622741", "0.5619232", "0.5502907", "0.54659235", "0.54589283", "0.54537964", "0.5450217", "0.5446686", "0.54258674", "0.5418166", "0.5396725", "0.53889036", "0.53759825", "0.535872", "0.534792...
0.76522404
0
makeOrderStatment renders statment as below if r.order!="": ORDER BY NULL
func (op *OpQuery) makeOrderStatment() string { if op.order == "" { return "" } var nullPriority = op.nullPriority if op.nullPriority == "" { nullPriority = "NULL FIRST" } return fmt.Sprintf("ORDER BY %s %s", op.order, nullPriority) }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "func (q *Query) Order(stmt string) *Query {\n\tif q.RawSQL.Fragment != \"\" {\n\t\tfmt.Println(\"Warning: Query is setup to use raw SQL\")\n\t\treturn q\n\t}\n\tq.orderClauses = append(q.orderClauses, clause{stmt, []interface{}{}})\n\treturn q\n}", "func buildOrder(conditions map[string][]string) string {\n\tvar...
[ "0.6601301", "0.64912677", "0.64893216", "0.64278907", "0.6417455", "0.6298002", "0.62018764", "0.6187332", "0.6150831", "0.6121438", "0.6041865", "0.6032457", "0.6028543", "0.59962493", "0.59961367", "0.5992576", "0.5948517", "0.59442306", "0.59339327", "0.5930972", "0.59036...
0.7929656
0