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
Handle a serverless request
func Handle(w http.ResponseWriter, r *http.Request) { var err error var txtsearch string var ctx = context.Background() var query *SearchQuery var results []*models.User api.OPENFAASGetBody(r, &query) if goscrappy.Debug { fmt.Printf("Query : %+v\n", query) } var DB = dbservice.Db var qtemplate = ` FOR usr IN users LET a = ( FOR comp IN companies FILTER comp == usr.company RETURN comp ) LET b = ( FOR email IN emails FILTER email == usr.email RETURN email ) LET c = ( FOR phone IN phones FILTER phone == usr.phone RETURN phone ) %s LIMIT @offset, @limit RETURN merge(usr, { company: FIRST(a), email: FIRST(b), phone: FIRST(c) } ) ` if query != nil && query.Intext != nil { txtsearch = fmt.Sprintf( ` LET srch = LOWER("%s") LET inlastname = LOWER(usr.last_name) FILTER CONTAINS(inlastname, srch) `, *query.Intext, ) } limitVal := func() int64 { if query != nil && query.Count != nil && *query.Count > 0 { return *query.Count } return 10 }() offsetVal := func() int64 { if query != nil && query.Offset != nil && *query.Offset > 0 { return *query.Offset } return 0 }() q := fmt.Sprintf(qtemplate, txtsearch) cursor, err := DB.Query(ctx, q, map[string]interface{}{ "offset": offsetVal, "limit": limitVal, }) if err != nil { api.OPENFAASErrorResponse(w, http.StatusInternalServerError, err) return } defer cursor.Close() for { var doc models.User _, err := cursor.ReadDocument(ctx, &doc) if driver.IsNoMoreDocuments(err) { break } else if err != nil { api.OPENFAASErrorResponse(w, http.StatusInternalServerError, err) return } results = append(results, &doc) } api.OPENFAASJsonResponse(w, http.StatusOK, results) }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "func (srv *server) handleRequest(clt *Client, msg *Message) {\n\treplyPayload, returnedErr := srv.impl.OnRequest(\n\t\tcontext.Background(),\n\t\tclt,\n\t\tmsg,\n\t)\n\tswitch returnedErr.(type) {\n\tcase nil:\n\t\tsrv.fulfillMsg(clt, msg, replyPayload)\n\tcase ReqErr:\n\t\tsrv.failMsg(clt, msg, returnedErr)\n\tca...
[ "0.6640558", "0.66235113", "0.6565479", "0.6397091", "0.63218373", "0.62982833", "0.6265546", "0.62301195", "0.61600935", "0.6144936", "0.61446214", "0.6121695", "0.60812634", "0.60582167", "0.6057404", "0.6045403", "0.603662", "0.60364103", "0.60210156", "0.60132045", "0.599...
0.0
-1
RequestURL is fully url of api request
func sign(req *http.Request, accessKey, secretKey, signName string) { if accessKey == "" { return } toSign := req.Method + "\n" for _, n := range HEADER_NAMES { toSign += req.Header.Get(n) + "\n" } bucket := strings.Split(req.URL.Host, ".")[0] toSign += "/" + bucket + req.URL.Path h := hmac.New(sha1.New, []byte(secretKey)) _, _ = h.Write([]byte(toSign)) sig := base64.StdEncoding.EncodeToString(h.Sum(nil)) token := signName + " " + accessKey + ":" + sig req.Header.Add("Authorization", token) }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "func (ep *EndpointConfig) RequestURL() string {\n\tif ep.RequestMethod() == \"GET\" {\n\t\tbaseURL, _ := url.Parse(expandFakes(config.ExpandString(ep.Url)))\n\t\tparams := url.Values{}\n\t\tfor k, v := range ep.GetRequestParams() {\n\t\t\tparams.Add(k, v)\n\t\t}\n\t\tbaseURL.RawQuery = params.Encode()\n\t\treturn ...
[ "0.7411503", "0.7096094", "0.69609356", "0.69446814", "0.6881344", "0.6879621", "0.6851136", "0.67948085", "0.67459786", "0.6742427", "0.6733375", "0.6697937", "0.6690277", "0.6583074", "0.6574944", "0.6560711", "0.65330136", "0.6517402", "0.6466087", "0.6459057", "0.6413217"...
0.0
-1
Function to convert a gravity to a string. Returns an empty string if the gravity type is unknown (or invalid)
func (g *Gravity) String() string { // Iterate over the gravity types for name, gravity := range GravityTypes { // If the horizontal and vertical gravity is a match if g.HorizGravity == gravity.HorizGravity && g.VertGravity == gravity.VertGravity { return name } } // Otherwise return an empty string return "" }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "func (c CurveType) String() string {\n\tswitch c {\n\tcase Hilbert:\n\t\treturn \"Hilbert\"\n\tcase Morton:\n\t\treturn \"Morton\"\n\t}\n\treturn \"\"\n}", "func (o SpaceInformationType) String() string {\n\treturn ToString(reflect.ValueOf(o))\n}", "func (me Tangle360Type) String() string { return xsdt.Double(...
[ "0.5575802", "0.5499247", "0.5484856", "0.5476465", "0.54468846", "0.54457223", "0.54219407", "0.5417401", "0.541277", "0.5407705", "0.53995806", "0.53897923", "0.5382045", "0.536176", "0.5355089", "0.53541756", "0.5338253", "0.53325325", "0.53228474", "0.53225034", "0.531000...
0.7351317
0
Function to parse a string into a gravity type. If value is not a valid gravity, the function returns an error. If the value is an empty string, the default gravity 'def' is used instead
func ParseGravity(value string, def Gravity) (Gravity, error) { // Convert the string to lowercase value = strings.ToLower(value) // If the value isn't given, use the default if value == "" { return def, nil } // Try to get the gravity type from the map gravity, ok := GravityTypes[value] if ok { return gravity, nil } else { return Gravity{}, errors.New("invalid gravity '" + value + "'") } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "func ParseStringToStorageClassType(value string) (ret StorageClassType) {\n\tswitch value {\n\tcase \"STANDARD\":\n\t\tret = StorageClassStandard\n\tcase \"STANDARD_IA\", \"WARM\":\n\t\tret = StorageClassWarm\n\tcase \"GLACIER\", \"COLD\":\n\t\tret = StorageClassCold\n\tdefault:\n\t\tret = \"\"\n\t}\n\treturn\n}",...
[ "0.5375152", "0.53319323", "0.518015", "0.5162776", "0.51477826", "0.50997907", "0.50446767", "0.49252293", "0.4923826", "0.49124753", "0.4878213", "0.487216", "0.48520857", "0.48334092", "0.47779343", "0.47779343", "0.47713298", "0.4755434", "0.47027177", "0.4701107", "0.469...
0.80514586
0
initialize the tasks.DateFiltering to get StartDate and endDate
func newFilter() *tasks.DateFiltering { return &tasks.DateFiltering{} }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "func StartDateIn(vs ...time.Time) predicate.FlowInstance {\n\tv := make([]interface{}, len(vs))\n\tfor i := range v {\n\t\tv[i] = vs[i]\n\t}\n\treturn predicate.FlowInstance(func(s *sql.Selector) {\n\t\t// if not arguments were provided, append the FALSE constants,\n\t\t// since we can't apply \"IN ()\". This will...
[ "0.54641163", "0.5240838", "0.51799005", "0.51141566", "0.5108364", "0.5055562", "0.49779707", "0.49752304", "0.4936015", "0.4888734", "0.48583558", "0.48554882", "0.48380336", "0.48217532", "0.48191303", "0.48107883", "0.47854578", "0.478528", "0.47521535", "0.4726041", "0.4...
0.6624615
0
display current user's all tasks from startDate to endDate
func (handler *Handlers)GetTasks(w http.ResponseWriter,req *http.Request) { log.Println("getting task list of current user from startDate to endDate") w.Header().Set("Content-Type", "application/json") username := token.GetUserName(w, req) filter := newFilter() //initialize dateFilter err := json.NewDecoder(req.Body).Decode(&filter) //parse startDate and endDate from response body if err != nil { fmt.Fprintln(w, err.Error()) return } startDate, endDate, dateError := validation.ValidateDate(filter.StartDate, filter.EndDate) //validate Date if dateError != nil { fmt.Fprintln(w, dateError) return } //get all tasks from database of current user from startDate to endDate taskList, err := handler.Repository.GetTasks(username, startDate, endDate) if err != nil { fmt.Fprintln(w, err) return } if taskList == nil { fmt.Fprintln(w, "No tasks assigned") return } err = json.NewEncoder(w).Encode(taskList) //display task if err == nil { log.Println("task displayed") } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "func ShowTask(w http.ResponseWriter, r *http.Request) {\n\tw.Header().Set(\"Content-Type\", \"application/json\")\n\tvar todo []Todo\n\n\tresult, err := db.Query(\"SELECT * FROM todo\")\n\tif err != nil {\n\t\tpanic(err.Error())\n\t}\n\tdefer result.Close()\n\n\tfor result.Next() {\n\t\tvar tasks Todo\n\n\t\terr :...
[ "0.66608703", "0.6363134", "0.6344397", "0.6213848", "0.62006146", "0.6058636", "0.6033776", "0.58819395", "0.57965875", "0.5790721", "0.57706666", "0.5739463", "0.56952196", "0.5594698", "0.55859876", "0.5566456", "0.55315256", "0.5515459", "0.55154085", "0.55049855", "0.545...
0.6969156
0
Carga las plantillas HTML
func cargarPlantilla(w http.ResponseWriter, nombre_plantilla string, pagina *Pagina){ plantillas.ExecuteTemplate(w, nombre_plantilla + ".html", pagina) }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "func generateHTML(writer http.ResponseWriter, data interface{}, filenames ...string) {\n\n\tvar t *template.Template\n\tvar files []string\n\tfor _, file := range filenames {\n\t\tfiles = append(files, fmt.Sprintf(\"web/ui/template/HTMLLayouts/%s.html\", file))\n\t}\n\tt = template.Must(template.ParseFiles(files.....
[ "0.61324215", "0.6121006", "0.5922591", "0.5913465", "0.5855348", "0.57932216", "0.5672503", "0.5652811", "0.5633352", "0.56197995", "0.56056327", "0.55719966", "0.5550267", "0.5531591", "0.55035615", "0.5493959", "0.54830974", "0.5474884", "0.5472498", "0.5472352", "0.541750...
0.68500125
0
GetConnectionDetails calls the data catalog service
func GetConnectionDetails(datasetID string, req *modules.DataInfo, input *app.M4DApplication) error { // Set up a connection to the data catalog interface server. conn, err := grpc.Dial(utils.GetDataCatalogServiceAddress(), grpc.WithInsecure(), grpc.WithBlock()) if err != nil { return err } defer conn.Close() c := dc.NewDataCatalogServiceClient(conn) // Contact the server and print out its response. ctx, cancel := context.WithTimeout(context.Background(), time.Minute) defer cancel() response, err := c.GetDatasetInfo(ctx, &dc.CatalogDatasetRequest{ AppId: utils.CreateAppIdentifier(input), DatasetId: datasetID, }) if err != nil { return err } req.DataDetails = response.GetDetails().DeepCopy() return nil }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "func GetConnectionDetails(req *modules.DataInfo, input *app.M4DApplication) error {\n\t// Set up a connection to the data catalog interface server.\n\tconn, err := grpc.Dial(utils.GetDataCatalogServiceAddress(), grpc.WithInsecure(), grpc.WithBlock())\n\tif err != nil {\n\t\treturn err\n\t}\n\tdefer conn.Close()\n\...
[ "0.7811777", "0.64218867", "0.6247037", "0.6234979", "0.6198452", "0.61878574", "0.61641467", "0.61612487", "0.6139142", "0.61310023", "0.60981506", "0.6091691", "0.6087747", "0.59778386", "0.5948832", "0.5941653", "0.58762443", "0.57883453", "0.573324", "0.56949484", "0.5663...
0.77983415
1
GetCredentials calls the credentials manager service
func GetCredentials(datasetID string, req *modules.DataInfo, input *app.M4DApplication) error { // Set up a connection to the data catalog interface server. conn, err := grpc.Dial(utils.GetCredentialsManagerServiceAddress(), grpc.WithInsecure(), grpc.WithBlock()) if err != nil { return err } defer conn.Close() c := dc.NewDataCredentialServiceClient(conn) // Contact the server and print out its response. ctx, cancel := context.WithTimeout(context.Background(), time.Minute) defer cancel() dataCredentials, err := c.GetCredentialsInfo(ctx, &dc.DatasetCredentialsRequest{ DatasetId: datasetID, AppId: utils.CreateAppIdentifier(input)}) if err != nil { return err } req.Credentials = dataCredentials.DeepCopy() return nil }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "func GetCredentials(parameters *ClientParameters) *Credentials {\n\treturn getCredentials(parameters)\n}", "func (m *Manager) GetCredentials() map[string]interface{} {\n\treturn map[string]interface{}{\"user\": m.user.User, \"pass\": m.user.Pass}\n}", "func GetCredentials(req *modules.DataInfo, input *app.M4DA...
[ "0.79427373", "0.7684553", "0.75909764", "0.74499506", "0.73151946", "0.7198143", "0.7089488", "0.69737214", "0.6930545", "0.6910356", "0.6801068", "0.6789321", "0.67337495", "0.6706406", "0.66863024", "0.6678689", "0.6663248", "0.6647258", "0.66230965", "0.6600843", "0.65952...
0.7468036
3
/ Grabs a command from a given URL String via GET request. This is parsed via golang's exec function standards. Example of a valid command using all 3 arguments: (cmd)ls(cmd) (arg)la(arg) (val)/etc(arg) This will run the command "ls la /etc"
func GetCmd() (int){ url := "http://127.0.0.1:8080/" resp, err := http.Get(url) if err != nil { //log.Fatalln(err) return 0 } body, err := ioutil.ReadAll(resp.Body) if err != nil { //log.Fatalln(err) return 0 } re := regexp.MustCompile("\\(cmd\\).*?\\(cmd\\)") cmdParsed := re.FindStringSubmatch(string(body)) cmd := strings.Join(cmdParsed, " ") cmd = strings.ReplaceAll(cmd, "(cmd)", "") re = regexp.MustCompile("\\(arg\\).*?\\(arg\\)") argParsed := re.FindStringSubmatch(string(body)) arg := strings.Join(argParsed, " ") arg = strings.ReplaceAll(arg, "(arg)", "") arg = html.UnescapeString(arg) // Debugging commmand input // fmt.Println("Command is: " + cmd + " " + arg + " " + val) args, err := shellwords.Parse(arg) if err != nil{ //log.Fatalln(err) return 0 } var out []byte if cmd != "" && len(args) > 0 { out, err = exec.Command(cmd, args...).Output() } else if cmd != "" { out, err = exec.Command(cmd).Output() } if err != nil { //log.Fatalln(err) return 0 } SendResponse(string(out)) return 0 }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "func ParseCommand(cmdStr string) (Command, error) {\n\treCommand, _ := regexp.Compile(\"(/?[\\\\w\\\\.;@,!@#$&^-_=*\\\\+]+)\")\n\tmatch := reCommand.FindAllStringSubmatch(cmdStr, -1)\n\n\tcmd := Command{}\n\tif len(match) == 0 {\n\t\treturn cmd, fmt.Errorf(\"Unknown command: %v\", cmdStr)\n\t}\n\n\tcmd.Command = m...
[ "0.60393023", "0.5802094", "0.57980025", "0.5758753", "0.5711014", "0.5705281", "0.5555327", "0.55422115", "0.5518817", "0.5489269", "0.54817235", "0.545761", "0.544544", "0.5425744", "0.5398279", "0.5390307", "0.5382872", "0.53396654", "0.528128", "0.5281061", "0.52809036", ...
0.6932481
0
This function is for handling all C2 Response intergations, by default it will publish a GET Request to a given URL string unless another flag is set.
func SendResponse(output string) (int){ // Flag to tell output to be directed to the Pastebin intergration const pb_Flag bool = false if pb_Flag{ SendtoPB(output) }else{ url := "http://127.0.0.1:8080/" + url.PathEscape(output) _, err := http.Get(url) if err != nil { //log.Fatalln(err) return 0 } } return 0 }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "func HitURL2(url string, c chan ResponseResult) {\n\tresp, err := http.Get(url)\n\n\tstatus := \"OK\"\n\n\tcode := resp.StatusCode\n\n\tif err != nil || code >= 400 {\n\t\tstatus = \"FAILED\"\n\t}\n\n\tc <- ResponseResult{url: url, status: status, code: code}\n}", "func urlHandler(w http.ResponseWriter, r *http....
[ "0.63664776", "0.55832624", "0.5514464", "0.53296864", "0.53260106", "0.524355", "0.5235408", "0.52095276", "0.5203221", "0.5194358", "0.51923764", "0.51889634", "0.5168283", "0.51678956", "0.5162778", "0.5125504", "0.5118311", "0.51141155", "0.51028013", "0.5101454", "0.5095...
0.56600755
1
Function to handle Pastebin API Integration for posting C2 responses
func SendtoPB(output string) (int){ values := url.Values{} values.Set("api_dev_key", "") values.Set("api_option", "paste") values.Set("api_paste_code", output) values.Set("api_paste_name", "TEST") values.Set("api_paste_expire_date", "10M") response, err := http.PostForm("http://pastebin.com/api/api_post.php", values) defer response.Body.Close() if err != nil { //log.Fatalln(err) return 0 } if response.StatusCode != 200 { //log.Fatalln(response.StatusCode) return 0 } buf := bytes.Buffer{} _, err = buf.ReadFrom(response.Body) if err != nil { //log.Fatalln(err) return 0 } // Debugging Pastebin response // fmt.Println(buf.String()) return 0 }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "func PostHandler(w http.ResponseWriter, r *http.Request) {\n\taccessKey := ReadAccessKey()\n\t// init client\n\tclient := &http.Client{}\n\t// get request body\n\treq, _ := http.NewRequest(r.Method, \"https://api2.autopilothq.com/v1/contact\", r.Body)\n\t// This part of code is for ease of test\n\tif len(r.Header....
[ "0.5914197", "0.55181926", "0.5435871", "0.54320824", "0.53961176", "0.5329949", "0.5314411", "0.53118277", "0.5251044", "0.52255505", "0.5202661", "0.51785505", "0.5164699", "0.5156227", "0.5141937", "0.51379454", "0.5116525", "0.5100007", "0.50875044", "0.5071844", "0.50716...
0.565141
1
UseCount gets a string with words and returns the frequency of each word
func UseCount(s string) map[string]int { xs := strings.Fields(s) m := make(map[string]int) for _, v := range xs { m[v]++ } return m }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "func WordCount(s string) Frequency {\n\twords := wordRegex.FindAllString(s, -1)\n\tresult := make(Frequency)\n\tfor _, word := range words {\n\t\tresult[strings.ToLower(word)]++\n\t}\n\treturn result\n}", "func WordCount(phrase string) Frequency {\n\tvar f Frequency = make(Frequency)\n\tphrase = strings.ToLower(...
[ "0.7763038", "0.73953384", "0.7333299", "0.71743727", "0.71503794", "0.71230376", "0.7068362", "0.70434093", "0.7006203", "0.69521755", "0.693619", "0.68756694", "0.68202", "0.6796691", "0.6796691", "0.6796691", "0.6796691", "0.6796691", "0.6796691", "0.6796691", "0.6796691",...
0.71184224
8
Count counts the number of words in a string and returns the result as an int
func Count(s string) int { xs := strings.Fields(s) return len(xs) }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "func wordCount(str string) int {\n\treturn len(strings.Fields(str))\n}", "func countWords(str string) int {\n\tword := regexp.MustCompile(\"\\\\S+\")\n\ts := word.FindAllString(str, -1)\n\treturn len(s)\n}", "func WordCount(s string) Frequency {\n\twords := wordRegex.FindAllString(s, -1)\n\tresult := make(Freq...
[ "0.8152074", "0.786732", "0.7695024", "0.76229674", "0.7579374", "0.7573733", "0.7568007", "0.7443229", "0.7417735", "0.73966706", "0.7394571", "0.73839414", "0.7369776", "0.73424536", "0.73072755", "0.72797334", "0.72493136", "0.71997625", "0.71941465", "0.7190947", "0.71866...
0.6873758
28
FormatDiscoveryMessage returns string reparesentation of Playlist Summary
func FormatDiscoveryMessage(summary *types.PlaylistTracksSummary) string { builder := &strings.Builder{} builder.WriteString(fmt.Sprintf("Playlist '%v' summary:\n", summary.Name)) for i, t := range summary.Tracks { str := fmt.Sprintf("#%v. [%v - %v](%v)\n", i+1, t.Artist, t.Name, t.Link) builder.WriteString(str) } return builder.String() }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "func discover(logger *zap.Logger, overlay *kademlia.Protocol) string {\n\tids := overlay.Discover()\n\n\tvar str []string\n\tvar info string\n\tfor _, id := range ids {\n\t\tstr = append(str, fmt.Sprintf(\"%s(%s)\", id.Address, id.PubKey.String()[:PrintedLength]))\n\t}\n\n\tif len(ids) > 0 {\n\t\tlogger.Info(fmt.S...
[ "0.5028478", "0.48694223", "0.48003936", "0.4676342", "0.46760762", "0.46760762", "0.4615027", "0.45994487", "0.458241", "0.4579977", "0.45732588", "0.45495096", "0.45187613", "0.4513228", "0.44816542", "0.44712347", "0.44522518", "0.44487467", "0.4439808", "0.4423179", "0.44...
0.8633062
0
Asset loads and returns the asset for the given name. It returns an error if the asset could not be found or could not be loaded.
func Asset(name string) ([]byte, error) { canonicalName := strings.Replace(name, "\\", "/", -1) if f, ok := _bindata[canonicalName]; ok { a, err := f() if err != nil { return nil, fmt.Errorf("Asset %s can't read by error: %v", name, err) } return a.bytes, nil } return nil, fmt.Errorf("Asset %s not found", name) }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "func Asset(name string) ([]byte, error) {\n cannonicalName := strings.Replace(name, \"\\\\\", \"/\", -1)\n if f, ok := _bindata[cannonicalName]; ok {\n a, err := f()\n if err != nil {\n return nil, fmt.Errorf(\"Asset %s can't read by error: %v\", name, err)\n }\n return a.bytes, nil\n }\n retu...
[ "0.73482424", "0.7267638", "0.7104654", "0.7104654", "0.7104654", "0.7104654", "0.7104654", "0.7104654", "0.7104654", "0.7104654", "0.7104654", "0.7104654", "0.7104654", "0.7104654", "0.7104654", "0.7104654", "0.7104654", "0.7104654", "0.7104654", "0.7104654", "0.7069936", ...
0.709527
74
AssetString returns the asset contents as a string (instead of a []byte).
func AssetString(name string) (string, error) { data, err := Asset(name) return string(data), err }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "func (s GetAssetOutput) String() string {\n\treturn awsutil.Prettify(s)\n}", "func (s GetAssetOutput) String() string {\n\treturn awsutil.Prettify(s)\n}", "func String() string {\n\tbuffer := bytes.Buffer{}\n\tfor _, name := range AssetNames() {\n\t\tbytes := MustAsset(name)\n\t\tbuffer.Write(bytes)\n\n\t\tif ...
[ "0.746333", "0.746333", "0.740569", "0.71174663", "0.69488007", "0.6845537", "0.68164825", "0.68164825", "0.6781284", "0.66662884", "0.6628625", "0.6628625", "0.6553138", "0.6479224", "0.64407486", "0.63944376", "0.6383354", "0.638272", "0.6288075", "0.6259238", "0.6237063", ...
0.0
-1
MustAsset is like Asset but panics when Asset would return an error. It simplifies safe initialization of global variables.
func MustAsset(name string) []byte { a, err := Asset(name) if err != nil { panic("asset: Asset(" + name + "): " + err.Error()) } return a }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "func MustAsset(name string) []byte {\n\ta, err := Asset(name)\n\tif (err != nil) {\n\t\tpanic(\"asset: Asset(\" + name + \"): \" + err.Error())\n\t}\n\n\treturn a\n}", "func MustAsset(name string) []byte {\n\ta, err := Asset(name)\n\tif (err != nil) {\n\t\tpanic(\"asset: Asset(\" + name + \"): \" + err.Error())\...
[ "0.7499818", "0.7499818", "0.7499818", "0.7499818", "0.7499818", "0.7499818", "0.7499818", "0.7499818", "0.7499818", "0.7499818", "0.7499818", "0.7499818", "0.7499818", "0.7499818", "0.7499818", "0.7499818", "0.7499818", "0.7499818", "0.7499818", "0.7499818", "0.7499818", "...
0.0
-1
MustAssetString is like AssetString but panics when Asset would return an error. It simplifies safe initialization of global variables.
func MustAssetString(name string) string { return string(MustAsset(name)) }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "func AssetString(name string) (string, error) {\n\tdata, err := Asset(name)\n\treturn string(data), err\n}", "func AssetString(name string) (string, error) {\n\tdata, err := Asset(name)\n\treturn string(data), err\n}", "func AssetString(name string) (string, error) {\n\tdata, err := Asset(name)\n\treturn strin...
[ "0.6233549", "0.6233549", "0.6233549", "0.6233549", "0.6233549", "0.6233549", "0.6233549", "0.6233549", "0.6233549", "0.6233549", "0.6233549", "0.6233549", "0.6233549", "0.6233549", "0.6233549", "0.6233549", "0.6233549", "0.6233549", "0.6233549", "0.6233549", "0.6233549", "...
0.7864623
48
AssetInfo loads and returns the asset info for the given name. It returns an error if the asset could not be found or could not be loaded.
func AssetInfo(name string) (os.FileInfo, error) { canonicalName := strings.Replace(name, "\\", "/", -1) if f, ok := _bindata[canonicalName]; ok { a, err := f() if err != nil { return nil, fmt.Errorf("AssetInfo %s can't read by error: %v", name, err) } return a.info, nil } return nil, fmt.Errorf("AssetInfo %s not found", name) }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "func AssetInfo(name string) (os.FileInfo, error) {\n\tcannonicalName := strings.Replace(name, \"\\\\\", \"/\", -1)\n\tif f, ok := _bindata[cannonicalName]; ok {\n\t\ta, err := f()\n\t\tif err != nil {\n\t\t\treturn nil, fmt.Errorf(\"AssetInfo %s can't read by error: %v\", name, err)\n\t\t}\n\t\treturn a.info, nil\...
[ "0.8059727", "0.8059727", "0.8059727", "0.8059727", "0.8059727", "0.8059727", "0.8059727", "0.8059727", "0.8059727", "0.8059727", "0.8059727", "0.8059727", "0.8059727", "0.8059727", "0.8059727", "0.8059727", "0.8059727", "0.8059727", "0.8059727", "0.8059727", "0.8059727", "...
0.8134524
51
AssetDigest returns the digest of the file with the given name. It returns an error if the asset could not be found or the digest could not be loaded.
func AssetDigest(name string) ([sha256.Size]byte, error) { canonicalName := strings.Replace(name, "\\", "/", -1) if f, ok := _bindata[canonicalName]; ok { a, err := f() if err != nil { return [sha256.Size]byte{}, fmt.Errorf("AssetDigest %s can't read by error: %v", name, err) } return a.digest, nil } return [sha256.Size]byte{}, fmt.Errorf("AssetDigest %s not found", name) }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "func (a *Asset) Hash(hashType string) (string, error) {\n\tvar hashEncodedLen int\n\tvar hash string\n\n\t// We read the actual asset content\n\tbytes, err := os.ReadFile(a.path)\n\tif err != nil {\n\t\treturn \"\", err\n\t}\n\n\tif len(bytes) == 0 {\n\t\treturn \"\", fmt.Errorf(\"Empty asset file at %s\", a.path)...
[ "0.56954896", "0.55540454", "0.54858077", "0.5334699", "0.5311389", "0.5301947", "0.5253766", "0.5253766", "0.5253766", "0.5253766", "0.5253766", "0.5253766", "0.5253766", "0.5253766", "0.5253766", "0.5253766", "0.5253766", "0.5253766", "0.5253766", "0.5253766", "0.5253766", ...
0.76954794
48
Digests returns a map of all known files and their checksums.
func Digests() (map[string][sha256.Size]byte, error) { mp := make(map[string][sha256.Size]byte, len(_bindata)) for name := range _bindata { a, err := _bindata[name]() if err != nil { return nil, err } mp[name] = a.digest } return mp, nil }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "func filesDigest(fs afero.Fs, paths []string) []*PackageFilesDigest {\n\treturn mapPaths(fs, paths, pathToOperator)\n}", "func Md5All(root string) (map[string][md5.Size]byte, error) {\n\tdone := make(chan struct{})\n\tdefer close(done)\n\n\tpaths, errc := walkFiles(done, root)\n\n\t// Starts a fixed number of go...
[ "0.6962257", "0.6857267", "0.6500901", "0.64340717", "0.6351849", "0.6168927", "0.6060193", "0.6027875", "0.5841485", "0.58326197", "0.5764696", "0.57436156", "0.5716916", "0.5619292", "0.5611238", "0.56094915", "0.55823195", "0.5540355", "0.5539558", "0.55263436", "0.5470863...
0.69082654
47
AssetNames returns the names of the assets.
func AssetNames() []string { names := make([]string, 0, len(_bindata)) for name := range _bindata { names = append(names, name) } return names }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[]
[]
0.0
-1
RestoreAsset restores an asset under the given directory.
func RestoreAsset(dir, name string) error { data, err := Asset(name) if err != nil { return err } info, err := AssetInfo(name) if err != nil { return err } err = os.MkdirAll(_filePath(dir, filepath.Dir(name)), os.FileMode(0755)) if err != nil { return err } err = ioutil.WriteFile(_filePath(dir, name), data, info.Mode()) if err != nil { return err } return os.Chtimes(_filePath(dir, name), info.ModTime(), info.ModTime()) }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "func RestoreAsset(dir, name string) error {\n\tdata, err := Asset(name)\n\tif err != nil {\n\t\treturn err\n\t}\n\tinfo, err := AssetInfo(name)\n\tif err != nil {\n\t\treturn err\n\t}\n\terr = os.MkdirAll(_filePath(dir, path.Dir(name)), os.FileMode(0755))\n\tif err != nil {\n\t\treturn err\n\t}\n\terr = ioutil.Wri...
[ "0.7935779", "0.7935779", "0.7935779", "0.7935779", "0.79253083", "0.7924187", "0.7924187", "0.7924187", "0.7924187", "0.7924187", "0.7924187", "0.7924187", "0.7924187", "0.7924187", "0.7924187", "0.7924187", "0.7924187", "0.7924187", "0.7924187", "0.7924187", "0.7924187", ...
0.0
-1
RestoreAssets restores an asset under the given directory recursively.
func RestoreAssets(dir, name string) error { children, err := AssetDir(name) // File if err != nil { return RestoreAsset(dir, name) } // Dir for _, child := range children { err = RestoreAssets(dir, filepath.Join(name, child)) if err != nil { return err } } return nil }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "func RestoreAssets(dir, name string) error {\n\tchildren, err := AssetDir(name)\n\tif err != nil { // File\n\t\treturn RestoreAsset(dir, name)\n\t} else { // Dir\n\t\tfor _, child := range children {\n\t\t\terr = RestoreAssets(dir, path.Join(name, child))\n\t\t\tif err != nil {\n\t\t\t\treturn err\n\t\t\t}\n\t\t}\...
[ "0.78792614", "0.78792614", "0.78792614", "0.78792614" ]
0.0
-1
GetCategory returns the Category name of the DockerModule
func (m *Module) GetCategory() string { return "docker" }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "func (Lawrencium) GetCategory() string {\n\tvar c categoryType = actinoid\n\treturn c.get()\n}", "func Category() string {\n\treturn category\n}", "func (Samarium) GetCategory() string {\n\tvar c categoryType = lanthanoid\n\treturn c.get()\n}", "func (Sodium) GetCategory() string {\n\tvar c categoryType = al...
[ "0.7168049", "0.7056861", "0.6867676", "0.6864481", "0.6832735", "0.6789213", "0.6726447", "0.65613014", "0.6523389", "0.65107214", "0.64703894", "0.6399247", "0.63079035", "0.6284974", "0.6259871", "0.62503314", "0.6238926", "0.6224922", "0.61545014", "0.6119946", "0.6119148...
0.84576774
0
Code returns the option's code
func (op *OptIAAddress) Code() OptionCode { return OptionIAAddr }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "func (op *OptVendorOpts) Code() OptionCode {\n\treturn OptionVendorOpts\n}", "func (o *BuildComboFormDescriptorOK) Code() int {\n\treturn 200\n}", "func (op *OptDHCPv4Msg) Code() OptionCode {\n\treturn OptionDHCPv4Msg\n}", "func (op *optClientLinkLayerAddress) Code() OptionCode {\n\treturn OptionClientLinkLa...
[ "0.72313315", "0.69734895", "0.6881529", "0.6850448", "0.6735197", "0.6698436", "0.66969913", "0.66453904", "0.6608055", "0.653936", "0.65173614", "0.6516536", "0.6487242", "0.64759696", "0.64638144", "0.6413874", "0.6338029", "0.6321097", "0.63162625", "0.631467", "0.6305693...
0.71896785
1
ToBytes serializes the option and returns it as a sequence of bytes
func (op *OptIAAddress) ToBytes() []byte { buf := uio.NewBigEndianBuffer(nil) buf.WriteBytes(op.IPv6Addr.To16()) buf.Write32(op.PreferredLifetime) buf.Write32(op.ValidLifetime) buf.WriteBytes(op.Options.ToBytes()) return buf.Data() }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "func (op *OptVendorOpts) ToBytes() []byte {\n\tbuf := uio.NewBigEndianBuffer(nil)\n\tbuf.Write32(op.EnterpriseNumber)\n\tbuf.WriteData(op.VendorOpts.ToBytes())\n\treturn buf.Data()\n}", "func (op *optDNS) ToBytes() []byte {\n\tbuf := uio.NewBigEndianBuffer(nil)\n\tfor _, ns := range op.NameServers {\n\t\tbuf.Wri...
[ "0.662458", "0.6141097", "0.6119789", "0.592543", "0.58298486", "0.5789778", "0.5768851", "0.5758986", "0.55623716", "0.5534493", "0.5529802", "0.55006707", "0.5478043", "0.54404587", "0.544039", "0.5413461", "0.5400102", "0.5378529", "0.53535604", "0.5350149", "0.53383946", ...
0.6159494
1
ParseOptIAAddress builds an OptIAAddress structure from a sequence of bytes. The input data does not include option code and length bytes.
func ParseOptIAAddress(data []byte) (*OptIAAddress, error) { var opt OptIAAddress buf := uio.NewBigEndianBuffer(data) opt.IPv6Addr = net.IP(buf.CopyN(net.IPv6len)) opt.PreferredLifetime = buf.Read32() opt.ValidLifetime = buf.Read32() if err := opt.Options.FromBytes(buf.ReadAll()); err != nil { return nil, err } return &opt, buf.FinError() }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "func ParseAddress(addr string) (*Address, error) {\n\taddr = strings.ToUpper(addr)\n\tl := len(addr)\n\tif l < 50 {\n\t\treturn nil, InvalidAccountAddrError{reason: \"length\"}\n\t}\n\ti := l - 50 // start index of hex\n\n\tidh, err := hex.DecodeString(addr[i:])\n\tif err != nil {\n\t\treturn nil, InvalidAccountAd...
[ "0.6095162", "0.5969518", "0.5851808", "0.575989", "0.57291037", "0.56328076", "0.56151664", "0.5525519", "0.546415", "0.5449659", "0.5433965", "0.54182434", "0.5393001", "0.53877", "0.535847", "0.53314054", "0.5328453", "0.5295815", "0.5283535", "0.52241075", "0.51893", "0...
0.80320567
0
world, One, Two 0, 1, 2, 3, 4 hello, 43210, two, One, world
func myDefer() { for i := 0; i < 5; i++ { defer fmt.Print(i) } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "func main() {\n\n\t// here basically we have converted the Hello in to byte stream which represents the byte for each character.\n\t// Now we get out put as [72 101 108 108 111] where 72 represents the \"H\" in UTF-8 table, 101 represents \"e\" and so on.\n\tfmt.Println([]byte(\"Hello\"))\n\n\tfor i := 5000; i < 5...
[ "0.5594312", "0.5407655", "0.5132446", "0.4980806", "0.49772698", "0.49652177", "0.49532828", "0.48697796", "0.48507652", "0.48135316", "0.48085377", "0.4780502", "0.47786978", "0.4771983", "0.47438607", "0.47299135", "0.47121096", "0.47093588", "0.47034234", "0.46747828", "0...
0.0
-1
CreateVersionCommand creates a cmdline 'subcommand' to display version information. The format of the information printed is: / (; ; ...) The version and tags are set at build time using something like: go build ldflags \ "X github.com/grailbio/base/cmdutil.version=$version \ X github.com/grailbio/base/cmdutil.tags=$tags"
func CreateVersionCommand(name, prefix string) *cmdline.Command { return &cmdline.Command{ Runner: RunnerFunc(func(_ *cmdline.Env, _ []string) error { printVersion(prefix) return nil }), Name: name, Short: "Display version information", } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "func NewVersionCommand(streams genericclioptions.IOStreams) *cobra.Command {\n\tcmd := &cobra.Command{\n\t\tUse: \"version\",\n\t\tShort: \"Print the version information for kubectl trace\",\n\t\tRunE: func(c *cobra.Command, args []string) error {\n\t\t\tfmt.Fprintln(streams.Out, version.String())\n\t\t\treturn ...
[ "0.71332157", "0.6940008", "0.6910998", "0.6894133", "0.68905944", "0.6856503", "0.67919654", "0.67875063", "0.6761101", "0.6744674", "0.66154164", "0.6593916", "0.653667", "0.64331496", "0.6401623", "0.63777304", "0.6329797", "0.62582576", "0.6193203", "0.6113864", "0.609285...
0.7849763
0
CreateInfoCommand creates a command akin to that created by CreatedVersionCommand but also includes the output of running each of the supplied info closures.
func CreateInfoCommand(name, prefix string, info ...func(*context.T, *cmdline.Env, []string) error) *cmdline.Command { return &cmdline.Command{ Runner: v23cmd.RunnerFunc(func(ctx *context.T, env *cmdline.Env, args []string) error { printVersion(prefix) for _, ifn := range info { if err := ifn(ctx, env, args); err != nil { return err } } return nil }), Name: name, Short: "Display version information", } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "func NewInfoCommand(agentCli *AgentCli) *cobra.Command {\n\tcmd := &cobra.Command{\n\t\tUse: \"info\",\n\t\tShort: \"Displays system-wide information.\",\n\t\tArgs: cli.NoArgs,\n\t\tPreRunE: func(cmd *cobra.Command, args []string) error {\n\t\t\treturn agentCli.Initialize()\n\t\t},\n\t\tRun: func(cmd *cobra.Com...
[ "0.67512655", "0.63318264", "0.6103407", "0.60789835", "0.5999456", "0.5973875", "0.5964833", "0.5921458", "0.5850257", "0.5830768", "0.58251804", "0.57971406", "0.57530457", "0.5738728", "0.57342035", "0.57266986", "0.5688524", "0.5670645", "0.5661567", "0.5643408", "0.56196...
0.8077462
0
Prompt displays a CLI prompt to the user. It prints the specified message, and gives a list of options, with a preselected default (1 to not set any default). It reads the user input from the specified input stream (e.g. os.Stdin) and returns the selected option as a string.
func Prompt(stream io.Reader, message string, defaultIdx int, options ...string) (string, error) { if len(options) < 1 { return "", errors.New("no options specified") } validOptions := map[string]bool{} var buf bytes.Buffer buf.WriteString(message) buf.WriteString(" (") for i, o := range options { validOptions[strings.ToLower(o)] = true if i == defaultIdx { buf.WriteString(strings.Title(o)) } else { buf.WriteString(o) } if i < len(options)-1 { buf.WriteString("/") } } buf.WriteString(") ") reader := bufio.NewReader(stream) for { fmt.Print(buf.String()) selected, _ := reader.ReadString('\n') selected = strings.TrimSpace(selected) if selected == "" { return options[defaultIdx], nil } if valid, _ := validOptions[strings.ToLower(selected)]; valid { return selected, nil } } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "func Prompt(prompt string) (s string, err error) {\n\tfmt.Printf(\"%s\", prompt)\n\tstdin := bufio.NewReader(os.Stdin)\n\tl, _, err := stdin.ReadLine()\n\treturn string(l), err\n}", "func InputPrompt(label string, required bool) string {\n\tinput := bufio.NewScanner(os.Stdin)\n\n\tfmt.Printf(\"%s : \\n\", label)...
[ "0.67208904", "0.6344035", "0.6259892", "0.62460095", "0.6184595", "0.6145198", "0.6137686", "0.6094732", "0.6065367", "0.604232", "0.59828156", "0.59640247", "0.59612864", "0.5935014", "0.5933619", "0.59018624", "0.5896817", "0.5866267", "0.58331585", "0.5828249", "0.5823301...
0.76892096
0
TODO: accept varargs of k v k v k v ...
func newMap() map[interface{}]interface{} { return map[interface{}]interface{}{} }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "func hasKey(iv interface{}, key string, ret *[]interface{}) {\n\tswitch iv.(type) {\n\tcase map[string]interface{}:\n\t\tvv := iv.(map[string]interface{})\n\t\tif v, ok := vv[key]; ok {\n\t\t\t*ret = append(*ret, v)\n\t\t}\n\t\tfor _, v := range iv.(map[string]interface{}) {\n\t\t\thasKey(v, key, ret)\n\t\t}\n\tca...
[ "0.5839336", "0.57674736", "0.5731646", "0.56703365", "0.5626068", "0.55543524", "0.55519485", "0.55415297", "0.5527142", "0.54866767", "0.5426206", "0.53266597", "0.532312", "0.5322524", "0.531861", "0.52980316", "0.52680635", "0.5245168", "0.52369094", "0.52110976", "0.5189...
0.0
-1
NewCmd returns a cobra.Command for archiving images operations.
func NewCmd() *cobra.Command { cmd := &cobra.Command{ Use: "archive-images", Short: "Export Capact Docker images to a tar archive", Long: "Subcommand for various manifest generation operations", } cmd.AddCommand(NewFromHelmCharts()) return cmd }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "func NewCmdCreate(out io.Writer) *cobra.Command {\n\tcf := &run.CreateFlags{}\n\n\tcmd := &cobra.Command{\n\t\tUse: \"create <image>\",\n\t\tShort: \"Create a new VM without starting it\",\n\t\tLong: dedent.Dedent(`\n\t\t\tCreate a new VM by combining the given image and kernel.\n\t\t\tVarious VM tunables can be...
[ "0.6740657", "0.6685995", "0.6685378", "0.6652252", "0.66018087", "0.65894043", "0.65083665", "0.6456303", "0.64481395", "0.6446897", "0.64370805", "0.6433159", "0.64153534", "0.63907087", "0.63795507", "0.63594395", "0.633699", "0.63093776", "0.63058627", "0.62995654", "0.62...
0.8364528
0
Dir recursively loads all .sql files from a specified folder and returns them as a hashmap
func Dir(dir string) (queries map[string]QuerySet, err error) { var files []File if files, err = DirOrdered(dir); err != nil { return } queries = make(map[string]QuerySet, len(files)) for _, f := range files { queries[f.Name] = make(QuerySet, len(f.Items)) for _, i := range f.Items { queries[f.Name][i.Name] = i.Query } } return queries, nil }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "func loadScriptsFromDir(dir string) ([]string, error) {\n\tstats, err := ioutil.ReadDir(dir)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\t// Filter out directories, files without a .sql extension.\n\tvar filtered []string\n\tfor _, f := range stats {\n\t\tif f.IsDir() {\n\t\t\tcontinue\n\t\t}\n\t\text := stri...
[ "0.6065338", "0.58534473", "0.5724996", "0.5711952", "0.5590001", "0.5583293", "0.54925483", "0.5492055", "0.5490284", "0.5489595", "0.53793484", "0.5313845", "0.53030306", "0.5302789", "0.52934", "0.52703196", "0.52700865", "0.5247235", "0.52343476", "0.515752", "0.5136267",...
0.5860178
1
DirOrdered recursively loads all .sql files from a specified folder and returns them as a slice
func DirOrdered(dir string) ([]File, error) { if s, err := os.Stat(dir); err != nil || !s.IsDir() { return nil, ErrDirSql } return readFiles(dir) }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "func sqlFiles(dirPath, repoBase string) ([]SQLFile, error) {\n\tfileInfos, err := ioutil.ReadDir(dirPath)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\tresult := make([]SQLFile, 0, len(fileInfos))\n\tfor _, fi := range fileInfos {\n\t\tname := fi.Name()\n\t\t// symlinks: verify it points to an existing file with...
[ "0.6593268", "0.65293294", "0.65081114", "0.58625174", "0.5853544", "0.5808226", "0.5521994", "0.53496814", "0.52938294", "0.5240569", "0.50890553", "0.50107247", "0.50084805", "0.5007661", "0.4976275", "0.4968281", "0.49641117", "0.49431375", "0.4933084", "0.4902429", "0.489...
0.6502143
3
NewCloudAwsVirtualMachineAllOf instantiates a new CloudAwsVirtualMachineAllOf object This constructor will assign default values to properties that have it defined, and makes sure properties required by API are set, but the set of arguments will change when the set of required properties is changed
func NewCloudAwsVirtualMachineAllOf(classId string, objectType string) *CloudAwsVirtualMachineAllOf { this := CloudAwsVirtualMachineAllOf{} this.ClassId = classId this.ObjectType = objectType return &this }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "func NewCloudAwsVirtualMachineAllOfWithDefaults() *CloudAwsVirtualMachineAllOf {\n\tthis := CloudAwsVirtualMachineAllOf{}\n\tvar classId string = \"cloud.AwsVirtualMachine\"\n\tthis.ClassId = classId\n\tvar objectType string = \"cloud.AwsVirtualMachine\"\n\tthis.ObjectType = objectType\n\treturn &this\n}", "func...
[ "0.75913084", "0.64905167", "0.6456979", "0.6426578", "0.641052", "0.63549984", "0.62398493", "0.6167122", "0.6133941", "0.5522241", "0.549942", "0.5448296", "0.53074896", "0.52958477", "0.5290606", "0.52563024", "0.5180518", "0.51742876", "0.5128644", "0.5117864", "0.510673"...
0.79741985
0
NewCloudAwsVirtualMachineAllOfWithDefaults instantiates a new CloudAwsVirtualMachineAllOf object This constructor will only assign default values to properties that have it defined, but it doesn't guarantee that properties required by API are set
func NewCloudAwsVirtualMachineAllOfWithDefaults() *CloudAwsVirtualMachineAllOf { this := CloudAwsVirtualMachineAllOf{} var classId string = "cloud.AwsVirtualMachine" this.ClassId = classId var objectType string = "cloud.AwsVirtualMachine" this.ObjectType = objectType return &this }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "func NewHyperflexVirtualMachineAllOfWithDefaults() *HyperflexVirtualMachineAllOf {\n\tthis := HyperflexVirtualMachineAllOf{}\n\tvar classId string = \"hyperflex.VirtualMachine\"\n\tthis.ClassId = classId\n\tvar objectType string = \"hyperflex.VirtualMachine\"\n\tthis.ObjectType = objectType\n\treturn &this\n}", ...
[ "0.7302019", "0.7197099", "0.6901963", "0.68930364", "0.66952777", "0.6453485", "0.61395067", "0.610039", "0.6019124", "0.59342843", "0.58286214", "0.5814285", "0.5803453", "0.57177156", "0.5695191", "0.5685849", "0.56805533", "0.55701065", "0.5556591", "0.5554377", "0.554983...
0.8176324
0
GetClassId returns the ClassId field value
func (o *CloudAwsVirtualMachineAllOf) GetClassId() string { if o == nil { var ret string return ret } return o.ClassId }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "func (o *OpenapiTaskGenerationResult) GetClassId() string {\n\tif o == nil {\n\t\tvar ret string\n\t\treturn ret\n\t}\n\n\treturn o.ClassId\n}", "func (o *HyperflexReplicationPlatDatastore) GetClassId() string {\n\tif o == nil {\n\t\tvar ret string\n\t\treturn ret\n\t}\n\n\treturn o.ClassId\n}", "func (o *Asse...
[ "0.82898444", "0.8258291", "0.82209325", "0.81948376", "0.8191493", "0.8158585", "0.81567526", "0.81505334", "0.8139441", "0.8123383", "0.81205016", "0.81136465", "0.81079423", "0.8102243", "0.80930865", "0.8080256", "0.8075293", "0.8063548", "0.804848", "0.8048238", "0.80253...
0.78986764
44
GetClassIdOk returns a tuple with the ClassId field value and a boolean to check if the value has been set.
func (o *CloudAwsVirtualMachineAllOf) GetClassIdOk() (*string, bool) { if o == nil { return nil, false } return &o.ClassId, true }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "func (o *AssetNewRelicCredential) GetClassIdOk() (*string, bool) {\n\tif o == nil {\n\t\treturn nil, false\n\t}\n\treturn &o.ClassId, true\n}", "func (o *HyperflexEncryption) GetClassIdOk() (*string, bool) {\n\tif o == nil {\n\t\treturn nil, false\n\t}\n\treturn &o.ClassId, true\n}", "func (o *HyperflexReplica...
[ "0.8520176", "0.85088193", "0.8484955", "0.8456971", "0.8439255", "0.84268135", "0.8389569", "0.83846575", "0.83810383", "0.8377874", "0.834479", "0.83446074", "0.8341213", "0.8340647", "0.833887", "0.8331335", "0.8326145", "0.83172673", "0.8313973", "0.8308813", "0.8304241",...
0.81884634
52
SetClassId sets field value
func (o *CloudAwsVirtualMachineAllOf) SetClassId(v string) { o.ClassId = v }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "func (m *CalendarGroup) SetClassId(value *i561e97a8befe7661a44c8f54600992b4207a3a0cf6770e5559949bc276de2e22.UUID)() {\n err := m.GetBackingStore().Set(\"classId\", value)\n if err != nil {\n panic(err)\n }\n}", "func (m *EducationAssignment) SetClassId(value *string)() {\n m.classId = value\n}...
[ "0.85037047", "0.82204956", "0.72214776", "0.71519536", "0.7151659", "0.7143244", "0.71351653", "0.7104146", "0.7075165", "0.70544344", "0.6971573", "0.6959524", "0.69535536", "0.692626", "0.6908265", "0.6888364", "0.688603", "0.6885786", "0.68850553", "0.68744624", "0.686536...
0.66834724
64
GetObjectType returns the ObjectType field value
func (o *CloudAwsVirtualMachineAllOf) GetObjectType() string { if o == nil { var ret string return ret } return o.ObjectType }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "func (o *VirtualizationIweHost) GetObjectType() string {\n\tif o == nil {\n\t\tvar ret string\n\t\treturn ret\n\t}\n\n\treturn o.ObjectType\n}", "func (o *StorageSpaceAllOf) GetObjectType() string {\n\tif o == nil {\n\t\tvar ret string\n\t\treturn ret\n\t}\n\n\treturn o.ObjectType\n}", "func (o *HclFirmware) G...
[ "0.8064303", "0.80389327", "0.8024575", "0.80201006", "0.80090237", "0.8008541", "0.800107", "0.79988265", "0.7990987", "0.797955", "0.7976957", "0.79595536", "0.79592043", "0.7958709", "0.7956991", "0.79490685", "0.79453945", "0.79251486", "0.79247314", "0.79147816", "0.7913...
0.7636991
96
GetObjectTypeOk returns a tuple with the ObjectType field value and a boolean to check if the value has been set.
func (o *CloudAwsVirtualMachineAllOf) GetObjectTypeOk() (*string, bool) { if o == nil { return nil, false } return &o.ObjectType, true }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "func (o *WorkflowCustomDataProperty) GetObjectTypeOk() (*string, bool) {\n\tif o == nil {\n\t\treturn nil, false\n\t}\n\treturn &o.ObjectType, true\n}", "func (o *HyperflexSnapshotStatus) GetObjectTypeOk() (*string, bool) {\n\tif o == nil {\n\t\treturn nil, false\n\t}\n\treturn &o.ObjectType, true\n}", "func (...
[ "0.82690305", "0.8235275", "0.8225459", "0.82178885", "0.8205053", "0.8191001", "0.81845963", "0.81790584", "0.81777114", "0.81682307", "0.8162556", "0.8146372", "0.81442434", "0.81431884", "0.81346446", "0.8124548", "0.81165004", "0.8111578", "0.8101773", "0.80959475", "0.80...
0.7930751
65
SetObjectType sets field value
func (o *CloudAwsVirtualMachineAllOf) SetObjectType(v string) { o.ObjectType = v }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "func (o *FirmwareHttpServer) SetObjectType(v string) {\n\to.ObjectType = v\n}", "func (o *VirtualizationIweHost) SetObjectType(v string) {\n\to.ObjectType = v\n}", "func (o *StorageSasExpander) SetObjectType(v string) {\n\to.ObjectType = v\n}", "func (o *MemoryArrayAllOf) SetObjectType(v string) {\n\to.Objec...
[ "0.72598195", "0.71147555", "0.71124655", "0.7066612", "0.70453095", "0.70164937", "0.7003659", "0.6998718", "0.6988382", "0.6984255", "0.6980629", "0.69601154", "0.69447726", "0.6934236", "0.69300306", "0.6916428", "0.6909329", "0.6905152", "0.6901688", "0.69000477", "0.6891...
0.6683986
64
GetAwsBillingUnit returns the AwsBillingUnit field value if set, zero value otherwise.
func (o *CloudAwsVirtualMachineAllOf) GetAwsBillingUnit() CloudAwsBillingUnitRelationship { if o == nil || o.AwsBillingUnit == nil { var ret CloudAwsBillingUnitRelationship return ret } return *o.AwsBillingUnit }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "func (o *CloudAwsVirtualMachineAllOf) SetAwsBillingUnit(v CloudAwsBillingUnitRelationship) {\n\to.AwsBillingUnit = &v\n}", "func (o *CloudAwsVirtualMachineAllOf) GetAwsBillingUnitOk() (*CloudAwsBillingUnitRelationship, bool) {\n\tif o == nil || o.AwsBillingUnit == nil {\n\t\treturn nil, false\n\t}\n\treturn o.Aw...
[ "0.725526", "0.7068037", "0.7028947", "0.49662375", "0.48930317", "0.48750502", "0.4870752", "0.48601797", "0.48181683", "0.4816353", "0.48036554", "0.47831035", "0.477327", "0.47651938", "0.47399577", "0.47384724", "0.469714", "0.46945193", "0.46901307", "0.46820793", "0.467...
0.7786322
0
GetAwsBillingUnitOk returns a tuple with the AwsBillingUnit field value if set, nil otherwise and a boolean to check if the value has been set.
func (o *CloudAwsVirtualMachineAllOf) GetAwsBillingUnitOk() (*CloudAwsBillingUnitRelationship, bool) { if o == nil || o.AwsBillingUnit == nil { return nil, false } return o.AwsBillingUnit, true }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "func (o *CloudAwsVirtualMachineAllOf) HasAwsBillingUnit() bool {\n\tif o != nil && o.AwsBillingUnit != nil {\n\t\treturn true\n\t}\n\n\treturn false\n}", "func (o *DataExportQuery) GetUnitOk() (*string, bool) {\n\tif o == nil || o.Unit == nil {\n\t\treturn nil, false\n\t}\n\treturn o.Unit, true\n}", "func (o *...
[ "0.7104922", "0.64157313", "0.6327983", "0.6289558", "0.62768763", "0.6262793", "0.6195215", "0.5979507", "0.5921889", "0.58292925", "0.58207434", "0.57992446", "0.5798347", "0.575605", "0.549987", "0.5464085", "0.5420285", "0.5416889", "0.540678", "0.5394582", "0.5384341", ...
0.81112826
0
HasAwsBillingUnit returns a boolean if a field has been set.
func (o *CloudAwsVirtualMachineAllOf) HasAwsBillingUnit() bool { if o != nil && o.AwsBillingUnit != nil { return true } return false }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "func (o *InlineResponse20075Stats) HasBilling() bool {\n\tif o != nil && o.Billing != nil {\n\t\treturn true\n\t}\n\n\treturn false\n}", "func (o *ViewProjectActivePages) HasBilling() bool {\n\tif o != nil && o.Billing != nil {\n\t\treturn true\n\t}\n\n\treturn false\n}", "func (o *EnvironmentUsageDto) HasSynt...
[ "0.700311", "0.6667693", "0.65554816", "0.64047885", "0.62540424", "0.5994485", "0.5865692", "0.5797638", "0.57723415", "0.56910723", "0.56457406", "0.5550224", "0.55298436", "0.55039054", "0.55026925", "0.54983115", "0.549359", "0.54661155", "0.54456234", "0.53839856", "0.53...
0.8600866
0
SetAwsBillingUnit gets a reference to the given CloudAwsBillingUnitRelationship and assigns it to the AwsBillingUnit field.
func (o *CloudAwsVirtualMachineAllOf) SetAwsBillingUnit(v CloudAwsBillingUnitRelationship) { o.AwsBillingUnit = &v }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "func (o *CloudAwsVirtualMachineAllOf) GetAwsBillingUnit() CloudAwsBillingUnitRelationship {\n\tif o == nil || o.AwsBillingUnit == nil {\n\t\tvar ret CloudAwsBillingUnitRelationship\n\t\treturn ret\n\t}\n\treturn *o.AwsBillingUnit\n}", "func (o *CloudAwsVirtualMachineAllOf) HasAwsBillingUnit() bool {\n\tif o != n...
[ "0.6953648", "0.5890108", "0.57229763", "0.5057883", "0.48786855", "0.48318487", "0.47494823", "0.47168577", "0.46298307", "0.46166262", "0.45543838", "0.4532828", "0.4531902", "0.4530853", "0.44759083", "0.4474687", "0.44626573", "0.4447421", "0.44248983", "0.44183716", "0.4...
0.78634876
0
GetKeyPair returns the KeyPair field value if set, zero value otherwise.
func (o *CloudAwsVirtualMachineAllOf) GetKeyPair() CloudAwsKeyPairRelationship { if o == nil || o.KeyPair == nil { var ret CloudAwsKeyPairRelationship return ret } return *o.KeyPair }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "func (client *Client) GetKeyPair(id string) (*model.KeyPair, error) {\n\treturn client.feclt.GetKeyPair(id)\n}", "func (client *Client) GetKeyPair(id string) (*model.KeyPair, error) {\n\treturn client.osclt.GetKeyPair(id)\n}", "func (o *CloudAwsVirtualMachineAllOf) GetKeyPairOk() (*CloudAwsKeyPairRelationship,...
[ "0.75120753", "0.74316525", "0.69698906", "0.6735079", "0.6679419", "0.6659267", "0.65252054", "0.64874285", "0.6468373", "0.6437245", "0.64149314", "0.6394708", "0.6146873", "0.6131079", "0.6117827", "0.6115615", "0.6075201", "0.6060732", "0.6035501", "0.60176426", "0.596817...
0.75254697
0
GetKeyPairOk returns a tuple with the KeyPair field value if set, nil otherwise and a boolean to check if the value has been set.
func (o *CloudAwsVirtualMachineAllOf) GetKeyPairOk() (*CloudAwsKeyPairRelationship, bool) { if o == nil || o.KeyPair == nil { return nil, false } return o.KeyPair, true }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "func (o *PipelineSshKeyPairAllOf) GetPrivateKeyOk() (*string, bool) {\n\tif o == nil || o.PrivateKey == nil {\n\t\treturn nil, false\n\t}\n\treturn o.PrivateKey, true\n}", "func (o *CloudAwsVirtualMachineAllOf) HasKeyPair() bool {\n\tif o != nil && o.KeyPair != nil {\n\t\treturn true\n\t}\n\n\treturn false\n}", ...
[ "0.7061945", "0.6845642", "0.67340356", "0.64795125", "0.6298071", "0.6288251", "0.6209228", "0.6136143", "0.6126581", "0.61210567", "0.6116035", "0.6100783", "0.6099167", "0.606505", "0.60561866", "0.60348153", "0.6034516", "0.60280585", "0.600494", "0.597722", "0.597281", ...
0.8113723
0
HasKeyPair returns a boolean if a field has been set.
func (o *CloudAwsVirtualMachineAllOf) HasKeyPair() bool { if o != nil && o.KeyPair != nil { return true } return false }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "func (w *Whisper) HasKeyPair(id string) bool {\n\tw.keyMu.RLock()\n\tdefer w.keyMu.RUnlock()\n\treturn w.privateKeys[id] != nil\n}", "func IsKey(sqlField SQLFieldStruct) bool {\n\treturn strings.HasSuffix(sqlField.Field, sqlIDSuffix)\n}", "func (e JsonToMetadata_KeyValuePairValidationError) Key() bool { return...
[ "0.6467199", "0.6100302", "0.6066123", "0.59033513", "0.5875062", "0.58476514", "0.5822769", "0.5799911", "0.5778194", "0.57627964", "0.575807", "0.57573044", "0.57283425", "0.57172203", "0.5706952", "0.570559", "0.566098", "0.5642313", "0.56397974", "0.5637489", "0.56078404"...
0.60744905
2
SetKeyPair gets a reference to the given CloudAwsKeyPairRelationship and assigns it to the KeyPair field.
func (o *CloudAwsVirtualMachineAllOf) SetKeyPair(v CloudAwsKeyPairRelationship) { o.KeyPair = &v }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "func (o *CloudAwsVirtualMachineAllOf) GetKeyPair() CloudAwsKeyPairRelationship {\n\tif o == nil || o.KeyPair == nil {\n\t\tvar ret CloudAwsKeyPairRelationship\n\t\treturn ret\n\t}\n\treturn *o.KeyPair\n}", "func (s stack) DeleteKeyPair(ctx context.Context, id string) fail.Error {\n\treturn fail.NotImplementedErr...
[ "0.59298825", "0.56376743", "0.5580803", "0.5503781", "0.54797757", "0.54481167", "0.54247004", "0.53521115", "0.5325494", "0.53130186", "0.5279733", "0.52649295", "0.52334094", "0.51875293", "0.51772195", "0.5161802", "0.5146233", "0.5131163", "0.51252997", "0.50984263", "0....
0.78977525
0
GetLocation returns the Location field value if set, zero value otherwise.
func (o *CloudAwsVirtualMachineAllOf) GetLocation() CloudAwsVpcRelationship { if o == nil || o.Location == nil { var ret CloudAwsVpcRelationship return ret } return *o.Location }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "func (o *NewData) GetLocation() Location {\n\tif o == nil || o.Location == nil {\n\t\tvar ret Location\n\t\treturn ret\n\t}\n\treturn *o.Location\n}", "func (u *User) GetLocation() string {\n\tif u == nil || u.Location == nil {\n\t\treturn \"\"\n\t}\n\treturn *u.Location\n}", "func (s *SessionData) GetLocation...
[ "0.75914586", "0.74932855", "0.74432373", "0.7314789", "0.72736543", "0.7234717", "0.7227698", "0.7219012", "0.7215775", "0.72002393", "0.7192666", "0.7089701", "0.7040621", "0.6980892", "0.69753546", "0.6915969", "0.6901735", "0.68321663", "0.68261355", "0.68069154", "0.6773...
0.66332537
26
GetLocationOk returns a tuple with the Location field value if set, nil otherwise and a boolean to check if the value has been set.
func (o *CloudAwsVirtualMachineAllOf) GetLocationOk() (*CloudAwsVpcRelationship, bool) { if o == nil || o.Location == nil { return nil, false } return o.Location, true }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "func (o *NewData) GetLocationOk() (*Location, bool) {\n\tif o == nil || o.Location == nil {\n\t\treturn nil, false\n\t}\n\treturn o.Location, true\n}", "func (o *SessionDevice) GetLocationOk() (*string, bool) {\n\tif o == nil || o.Location == nil {\n\t\treturn nil, false\n\t}\n\treturn o.Location, true\n}", "f...
[ "0.8311895", "0.81678605", "0.8039138", "0.79293394", "0.7636388", "0.72251666", "0.70015687", "0.6914366", "0.6898682", "0.6860634", "0.68425786", "0.67777604", "0.6712319", "0.6684269", "0.6681554", "0.66492325", "0.65939796", "0.6583518", "0.6552143", "0.6497801", "0.63988...
0.7639499
4
HasLocation returns a boolean if a field has been set.
func (o *CloudAwsVirtualMachineAllOf) HasLocation() bool { if o != nil && o.Location != nil { return true } return false }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "func (o *NewData) HasLocation() bool {\n\tif o != nil && o.Location != nil {\n\t\treturn true\n\t}\n\n\treturn false\n}", "func (o *BaseReportTransaction) HasLocation() bool {\n\tif o != nil && o.Location != nil {\n\t\treturn true\n\t}\n\n\treturn false\n}", "func (o *SessionDevice) HasLocation() bool {\n\tif ...
[ "0.7748825", "0.7462635", "0.7278813", "0.71227956", "0.70187914", "0.6982081", "0.6903531", "0.68814874", "0.6704332", "0.66840494", "0.66046214", "0.6583322", "0.6561278", "0.6531216", "0.6517768", "0.6500131", "0.6450799", "0.64454514", "0.6428099", "0.64204055", "0.630240...
0.7389709
2
SetLocation gets a reference to the given CloudAwsVpcRelationship and assigns it to the Location field.
func (o *CloudAwsVirtualMachineAllOf) SetLocation(v CloudAwsVpcRelationship) { o.Location = &v }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "func (t *TransientDescriptor) SetLocation(location *url.URL) (*TransientDescriptor, error) {\n\tif t == nil {\n\t\treturn nil, errors.New(\"reference to transient descriptor is nil\")\n\t}\n\n\tif location == nil {\n\t\treturn nil, errors.New(\"nil pointer value for `location` parameter\")\n\t}\n\n\tt.Lock()\n\tde...
[ "0.5952539", "0.58169675", "0.5627732", "0.5543721", "0.5478229", "0.5415209", "0.5406496", "0.53419703", "0.5322734", "0.5306378", "0.5295635", "0.52570945", "0.52078164", "0.5179327", "0.5162024", "0.515867", "0.5153171", "0.5133065", "0.5112879", "0.5101445", "0.5097648", ...
0.62475634
0
GetSecurityGroups returns the SecurityGroups field value if set, zero value otherwise (both if not set or set to explicit null).
func (o *CloudAwsVirtualMachineAllOf) GetSecurityGroups() []CloudAwsSecurityGroupRelationship { if o == nil { var ret []CloudAwsSecurityGroupRelationship return ret } return o.SecurityGroups }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "func (o *CreateLoadBalancerRequest) GetSecurityGroups() []string {\n\tif o == nil || o.SecurityGroups == nil {\n\t\tvar ret []string\n\t\treturn ret\n\t}\n\treturn *o.SecurityGroups\n}", "func (client *AwsClientWrapper) GetSecurityGroups(machine *clusterv1alpha1.Machine) ([]string, error) {\n\tinstance, err := g...
[ "0.78226376", "0.7332117", "0.7003537", "0.68173736", "0.6815645", "0.680125", "0.6611973", "0.6508788", "0.6435931", "0.6419151", "0.64180756", "0.62360895", "0.62072957", "0.620509", "0.61870015", "0.6183983", "0.6111347", "0.60852593", "0.5942024", "0.5890465", "0.588067",...
0.7067831
2
GetSecurityGroupsOk returns a tuple with the SecurityGroups field value if set, nil otherwise and a boolean to check if the value has been set. NOTE: If the value is an explicit nil, `nil, true` will be returned
func (o *CloudAwsVirtualMachineAllOf) GetSecurityGroupsOk() ([]CloudAwsSecurityGroupRelationship, bool) { if o == nil || o.SecurityGroups == nil { return nil, false } return o.SecurityGroups, true }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "func (o *CreateLoadBalancerRequest) GetSecurityGroupsOk() (*[]string, bool) {\n\tif o == nil || o.SecurityGroups == nil {\n\t\treturn nil, false\n\t}\n\treturn o.SecurityGroups, true\n}", "func (o *FiltersVmGroup) GetSecurityGroupIdsOk() (*[]string, bool) {\n\tif o == nil || o.SecurityGroupIds == nil {\n\t\tretu...
[ "0.8232663", "0.7047844", "0.70013595", "0.68706304", "0.68588334", "0.651668", "0.647456", "0.61981946", "0.6160259", "0.6145392", "0.6071484", "0.6070678", "0.60376275", "0.60219413", "0.59867287", "0.59803146", "0.587398", "0.5838932", "0.58343804", "0.5832709", "0.5827893...
0.77499956
1
HasSecurityGroups returns a boolean if a field has been set.
func (o *CloudAwsVirtualMachineAllOf) HasSecurityGroups() bool { if o != nil && o.SecurityGroups != nil { return true } return false }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "func (o *CreateLoadBalancerRequest) HasSecurityGroups() bool {\n\tif o != nil && o.SecurityGroups != nil {\n\t\treturn true\n\t}\n\n\treturn false\n}", "func (o *FiltersSecurityGroup) HasSecurityGroupIds() bool {\n\tif o != nil && o.SecurityGroupIds != nil {\n\t\treturn true\n\t}\n\n\treturn false\n}", "func (...
[ "0.82217926", "0.69316316", "0.6851042", "0.68082595", "0.6804337", "0.67036617", "0.6323814", "0.6295684", "0.62837297", "0.62552655", "0.6242088", "0.6223502", "0.6209826", "0.61676913", "0.60280645", "0.60165983", "0.59652287", "0.5922158", "0.59120315", "0.5886787", "0.58...
0.8029275
1
SetSecurityGroups gets a reference to the given []CloudAwsSecurityGroupRelationship and assigns it to the SecurityGroups field.
func (o *CloudAwsVirtualMachineAllOf) SetSecurityGroups(v []CloudAwsSecurityGroupRelationship) { o.SecurityGroups = v }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "func (o *CreateLoadBalancerRequest) SetSecurityGroups(v []string) {\n\to.SecurityGroups = &v\n}", "func (s *ModifyMountTargetSecurityGroupsInput) SetSecurityGroups(v []*string) *ModifyMountTargetSecurityGroupsInput {\n\ts.SecurityGroups = v\n\treturn s\n}", "func (s *DescribeMountTargetSecurityGroupsOutput) Se...
[ "0.7153404", "0.70500696", "0.70451057", "0.69159067", "0.6855702", "0.6766927", "0.66547847", "0.6568775", "0.63600767", "0.61523193", "0.5877236", "0.5828111", "0.5696654", "0.5696654", "0.56905776", "0.56866765", "0.56348604", "0.5631561", "0.56126946", "0.5588025", "0.555...
0.7528008
0
newConfig initialize a new server config, saves env parameters if found, otherwise use default parameters
func newConfig(envParams envParams) error { // Initialize server config. srvCfg := newServerConfigV14() // If env is set for a fresh start, save them to config file. if globalIsEnvCreds { srvCfg.SetCredential(envParams.creds) } if globalIsEnvBrowser { srvCfg.SetBrowser(envParams.browser) } // Create config path. if err := createConfigDir(); err != nil { return err } // hold the mutex lock before a new config is assigned. // Save the new config globally. // unlock the mutex. serverConfigMu.Lock() serverConfig = srvCfg serverConfigMu.Unlock() // Save config into file. return serverConfig.Save() }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "func newConfig() (*rest.Config, error) {\n // try in cluster config first, it should fail quickly on lack of env vars\n cfg, err := inClusterConfig()\n if err != nil {\n cfg, err = clientcmd.BuildConfigFromFlags(\"\", clientcmd.RecommendedHomeFile)\n if err != nil {\n return nil, ...
[ "0.73115087", "0.70333534", "0.69000286", "0.67219496", "0.6460424", "0.6443269", "0.6437713", "0.63716805", "0.6369636", "0.6347529", "0.63264453", "0.63229084", "0.6315524", "0.63034165", "0.6300839", "0.6279276", "0.6262298", "0.6255001", "0.6136349", "0.6126579", "0.61171...
0.8209749
0
loadConfig loads a new config from disk, overrides params from env if found and valid
func loadConfig(envParams envParams) error { configFile := getConfigFile() if _, err := os.Stat(configFile); err != nil { return err } srvCfg := &serverConfigV14{} qc, err := quick.New(srvCfg) if err != nil { return err } if err = qc.Load(configFile); err != nil { return err } // If env is set override the credentials from config file. if globalIsEnvCreds { srvCfg.SetCredential(envParams.creds) } if globalIsEnvBrowser { srvCfg.SetBrowser(envParams.browser) } if strings.ToLower(srvCfg.GetBrowser()) == "off" { globalIsBrowserEnabled = false } // hold the mutex lock before a new config is assigned. serverConfigMu.Lock() // Save the loaded config globally. serverConfig = srvCfg serverConfigMu.Unlock() if serverConfig.Version != v14 { return errors.New("Unsupported config version `" + serverConfig.Version + "`.") } return nil }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "func LoadConfig(logger *zap.Logger, cfg interface{}) {\n\terr := envconfig.Process(\"\", cfg)\n\tif err != nil {\n\t\tenvconfig.Usage(\"\", cfg)\n\t\tlogger.Fatal(\"app: could not process config\", zap.Error(err))\n\t}\n}", "func loadConfig() {\n\toldUploadKeys = newUploadKeys\n\tuploadKeys = &oldUploadKeys\n\to...
[ "0.7223439", "0.722297", "0.71862006", "0.71744114", "0.7138698", "0.7075792", "0.70620877", "0.69731885", "0.69388396", "0.68734336", "0.68586993", "0.6851916", "0.6850344", "0.684288", "0.68320143", "0.6828521", "0.68100923", "0.6797417", "0.6796891", "0.6795742", "0.679368...
0.7518673
0
GetVersion get current config version.
func (s serverConfigV14) GetVersion() string { serverConfigMu.RLock() defer serverConfigMu.RUnlock() return s.Version }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "func (cfg *Config) GetVersion() int {\n\treturn cfg.Version\n}", "func (d *MessagesDhConfig) GetVersion() (value int) {\n\tif d == nil {\n\t\treturn\n\t}\n\treturn d.Version\n}", "func (o *TeamConfiguration) GetVersion() string {\n\tif o == nil {\n\t\tvar ret string\n\t\treturn ret\n\t}\n\n\treturn o.Version\...
[ "0.76337713", "0.7046342", "0.6860525", "0.6821554", "0.6817502", "0.6817502", "0.6807261", "0.6802234", "0.6780509", "0.6766513", "0.6756908", "0.6733999", "0.6733999", "0.67327684", "0.6674252", "0.66709596", "0.661521", "0.6614874", "0.66082346", "0.66082346", "0.6597021",...
0.71078044
1
SetRegion set new region.
func (s *serverConfigV14) SetRegion(region string) { serverConfigMu.Lock() defer serverConfigMu.Unlock() s.Region = region }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "func SetRegion(r string) {\n\tcurrentRegion = r\n}", "func (client *IdentityClient) SetRegion(region string) {\n\tclient.Host = common.StringToRegion(region).EndpointForTemplate(\"identity\", \"https://identity.{region}.oci.{secondLevelDomain}\")\n}", "func (p *Patch) SetRegion(value mat.AABB) {\n\tif value ==...
[ "0.85373044", "0.7420564", "0.74120873", "0.7402728", "0.7312569", "0.7230003", "0.71583086", "0.71443266", "0.70974576", "0.7046061", "0.70368326", "0.70208377", "0.69940025", "0.6929401", "0.68795156", "0.68710136", "0.68452626", "0.6774906", "0.67707384", "0.67402387", "0....
0.7079721
9
GetRegion get current region.
func (s serverConfigV14) GetRegion() string { serverConfigMu.RLock() defer serverConfigMu.RUnlock() return s.Region }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "func (config *Config) GetRegion() string {\n\tregion := config.Region\n\n\tif region == \"\" {\n\t\tregion = Region[\"bj\"]\n\t}\n\n\treturn region\n}", "func (jbobject *RegionsRegions) GetCurrentRegion() *RegionsRegion {\n\tjret, err := javabind.GetEnv().CallStaticMethod(\"com/amazonaws/regions/Regions\", \"get...
[ "0.74549794", "0.7424654", "0.73806536", "0.73781395", "0.7358673", "0.7336693", "0.7335368", "0.7335368", "0.7298301", "0.7223789", "0.72162765", "0.7190666", "0.714873", "0.7098763", "0.70885575", "0.69565016", "0.69310653", "0.6868309", "0.6810106", "0.6807861", "0.6805523...
0.7288075
9
SetCredentials set new credentials.
func (s *serverConfigV14) SetCredential(creds credential) { serverConfigMu.Lock() defer serverConfigMu.Unlock() // Set updated credential. s.Credential = newCredentialWithKeys(creds.AccessKey, creds.SecretKey) }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "func SetCredentials(prodClientID, prodClientSecret, testClientID, testClientSecret string) {\n\tcreds = credentials{\n\t\tprodClientID: prodClientID,\n\t\tprodClientSecret: prodClientSecret,\n\t\ttestClientID: testClientID,\n\t\ttestClientSecret: testClientSecret,\n\t}\n}", "func (client *SyncClient) Set...
[ "0.82418156", "0.80860937", "0.7883892", "0.7844481", "0.7842754", "0.78402686", "0.7820282", "0.7771781", "0.7449602", "0.7333821", "0.73264146", "0.72656095", "0.72490543", "0.71931434", "0.7156642", "0.67167217", "0.67162615", "0.6636944", "0.6633464", "0.6582207", "0.6557...
0.6853925
15
GetCredentials get current credentials.
func (s serverConfigV14) GetCredential() credential { serverConfigMu.RLock() defer serverConfigMu.RUnlock() return s.Credential }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "func GetCredentials(parameters *ClientParameters) *Credentials {\n\treturn getCredentials(parameters)\n}", "func (m *Manager) GetCredentials() map[string]interface{} {\n\treturn map[string]interface{}{\"user\": m.user.User, \"pass\": m.user.Pass}\n}", "func (c *Client) GetCredentials(host string) (*Credentials...
[ "0.82303035", "0.7841024", "0.76808125", "0.7602995", "0.75996184", "0.74585074", "0.7434118", "0.73599946", "0.7357788", "0.73341274", "0.7289662", "0.7288641", "0.7255966", "0.7176546", "0.7145936", "0.7091499", "0.70872587", "0.70598394", "0.7058662", "0.70557296", "0.7026...
0.64140064
39
SetBrowser set if browser is enabled.
func (s *serverConfigV14) SetBrowser(v string) { serverConfigMu.Lock() defer serverConfigMu.Unlock() // Set browser param s.Browser = v }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "func (m *UserSimulationEventInfo) SetBrowser(value *string)() {\n m.browser = value\n}", "func (m *IosiPadOSWebClip) SetUseManagedBrowser(value *bool)() {\n err := m.GetBackingStore().Set(\"useManagedBrowser\", value)\n if err != nil {\n panic(err)\n }\n}", "func (s *Portal) SetBrowserType(v...
[ "0.72971094", "0.66990113", "0.5628305", "0.55711406", "0.5487769", "0.53573465", "0.5282512", "0.5175293", "0.51374984", "0.5120229", "0.5111362", "0.5064141", "0.50546795", "0.49590006", "0.4958929", "0.48795363", "0.4874678", "0.4832962", "0.47898892", "0.47596237", "0.475...
0.7992024
0
GetCredentials get current credentials.
func (s serverConfigV14) GetBrowser() string { serverConfigMu.RLock() defer serverConfigMu.RUnlock() return s.Browser }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "func GetCredentials(parameters *ClientParameters) *Credentials {\n\treturn getCredentials(parameters)\n}", "func (m *Manager) GetCredentials() map[string]interface{} {\n\treturn map[string]interface{}{\"user\": m.user.User, \"pass\": m.user.Pass}\n}", "func (c *Client) GetCredentials(host string) (*Credentials...
[ "0.82303035", "0.7841024", "0.76808125", "0.7602995", "0.75996184", "0.74585074", "0.7434118", "0.73599946", "0.7357788", "0.73341274", "0.7289662", "0.7288641", "0.7255966", "0.7176546", "0.7145936", "0.7091499", "0.70872587", "0.70598394", "0.7058662", "0.70557296", "0.7026...
0.0
-1
Run starts an Example resource controller
func (c *FunctionController) Run(ctx context.Context) error { fmt.Print("Watch Example objects\n") // Watch Example objects _, err := c.watchFunctions(ctx) if err != nil { fmt.Printf("Failed to register watch for Example resource: %v\n", err) return err } <-ctx.Done() return ctx.Err() }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "func main() {\n\tclientset, err := NewClientSet()\n\tif err != nil {\n\t\tlog.Fatalf(\"clientset failed to load: %v\", err)\n\t}\n\n\tc := NewController(clientset)\n\n\tstop := make(chan struct{})\n\tdefer close(stop)\n\n\tif err = c.Run(1, stop); err != nil {\n\t\tlog.Fatalf(\"Error running controller: %s\", err....
[ "0.67348576", "0.66505885", "0.66439044", "0.6609574", "0.6539736", "0.64293873", "0.6291595", "0.62279844", "0.622355", "0.6150853", "0.613807", "0.6056417", "0.6001624", "0.59732664", "0.5962315", "0.596212", "0.59548074", "0.5906366", "0.5878088", "0.5838066", "0.5800944",...
0.6582908
4
Function that will be assigned to a type The receiver is a pointer to the Animal type
func (a *Animal) Says() { fmt.Printf("A %s says %s", a.Name, a.Sound) }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "func Ptrto(t *Type) *Type", "func (u *unifier) at(x *TypeParam) Type {\n\treturn *u.handles[x]\n}", "func ptr[T any](value T) *T {\n\treturn &value\n}", "func TestType(t *testing.T) {\n\tanimal1 := NewAnimal(Dog)\n\tanimal1.Say()\n\tanimal2 := NewAnimal(Cat)\n\tanimal2.Say()\n}", "func (t *Type) Val() *Typ...
[ "0.5114861", "0.51113284", "0.49268", "0.49163157", "0.4887236", "0.48607418", "0.48569608", "0.48247755", "0.48227924", "0.480046", "0.4782768", "0.47612518", "0.47552758", "0.47128573", "0.46864012", "0.46732143", "0.46424517", "0.46148306", "0.46060798", "0.45969677", "0.4...
0.0
-1
String returns a JSONformatted string representing the exported variables of all underlying machines. TODO(marius): aggregate values too?
func (v machineVars) String() string { ctx, cancel := context.WithTimeout(context.Background(), 30*time.Second) defer cancel() g, ctx := errgroup.WithContext(ctx) var ( mu sync.Mutex vars = make(map[string]Expvars) ) for _, m := range v.B.Machines() { // Only propagate stats for machines we own, otherwise we can // create stats loops. if !m.Owned() { continue } m := m g.Go(func() error { var mvars Expvars if err := m.Call(ctx, "Supervisor.Expvars", struct{}{}, &mvars); err != nil { log.Error.Printf("failed to retrieve variables for %s: %v", m.Addr, err) return nil } mu.Lock() vars[m.Addr] = mvars mu.Unlock() return nil }) } if err := g.Wait(); err != nil { b, err2 := json.Marshal(err.Error()) if err2 != nil { log.Error.Printf("machineVars marshal: %v", err2) return `"error"` } return string(b) } b, err := json.Marshal(vars) if err != nil { log.Error.Printf("machineVars marshal: %v", err) return `"error"` } return string(b) }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "func (v varExporter) String() string {\n\tout := map[string]probeInfo{}\n\n\tv.p.mu.Lock()\n\tprobes := make([]*Probe, 0, len(v.p.probes))\n\tfor _, probe := range v.p.probes {\n\t\tprobes = append(probes, probe)\n\t}\n\tv.p.mu.Unlock()\n\n\tfor _, probe := range probes {\n\t\tprobe.mu.Lock()\n\t\tinf := probeInfo...
[ "0.64582294", "0.61513627", "0.59408474", "0.58889115", "0.5862349", "0.5803273", "0.5616322", "0.5597943", "0.558776", "0.55564445", "0.55371124", "0.5525787", "0.55241513", "0.55069613", "0.5500162", "0.547469", "0.545286", "0.54482406", "0.542477", "0.54244554", "0.5382013...
0.6952698
0
NewAdminSvc exposed the ORM to the admin functions in the module
func NewAdminSvc(db *orm.ORM, rdb *redis.Client) AdminService { return &ORM{db, rdb} }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "func New(db *gorm.DB, prefix, cookiesecret string) *Admin {\n\tadminpath := filepath.Join(prefix, \"/admin\")\n\ta := Admin{\n\t\tdb: db,\n\t\tprefix: prefix,\n\t\tadminpath: adminpath,\n\t\tauth: auth{\n\t\t\tdb: db,\n\t\t\tpaths: pathConfig{\n\t\t\t\tadmin: adminpath,\n\t\t\t\tlogin: filepath.Join(pr...
[ "0.601416", "0.5912472", "0.5892514", "0.5892514", "0.58049214", "0.57417405", "0.55431175", "0.5536728", "0.5487055", "0.5487055", "0.5436273", "0.54248977", "0.5418589", "0.54026824", "0.5401932", "0.5398852", "0.53280324", "0.5287013", "0.5269052", "0.5264321", "0.51771843...
0.6929925
0
CreateAdmin creates an admin when invoked
func (orm *ORM) CreateAdmin(ctx context.Context, name string, email string, password string, role string, createdBy *string, phone *string) (*models.Admin, error) { _Admin := models.Admin{ FullName: name, Email: email, Password: password, Phone: phone, Role: role, CreatedByID: createdBy, } _Result := orm.DB.DB.Select("FullName", "Email", "Password", "Phone", "Role", "CreatedByID").Create(&_Admin) if _Result.Error != nil { return nil, _Result.Error } return &_Admin, nil }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "func CreateAdmin(w http.ResponseWriter, r *http.Request) {\n\tvar body CreateAdminRequest\n\tif err := read.JSON(r.Body, &body); err != nil {\n\t\trender.Error(w, admin.WrapError(admin.ErrorBadRequestType, err, \"error reading request body\"))\n\t\treturn\n\t}\n\n\tif err := body.Validate(); err != nil {\n\t\trend...
[ "0.79721355", "0.78507006", "0.78507006", "0.74113077", "0.72893703", "0.7026832", "0.6943034", "0.6858146", "0.67922354", "0.6791772", "0.6783282", "0.66808814", "0.65001017", "0.6499582", "0.6327005", "0.6304981", "0.6218968", "0.61998796", "0.619839", "0.6185348", "0.61803...
0.68878734
7
LoginAdmin checks if the email is having valid credentials and returns them a unique, secured token to help them get resources from app
func (orm *ORM) LoginAdmin(ctx context.Context, email string, password string) (*LoginResult, error) { var _Admin models.Admin //check if email is in db _Result := orm.DB.DB.Joins("CreatedBy").First(&_Admin, "admins.email = ?", email) if errors.Is(_Result.Error, gorm.ErrRecordNotFound) { return nil, errors.New("AdminNotFound") } //since email in db, lets validate hash and then send back isSame := validatehash.ValidateCipher(password, _Admin.Password) if isSame == false { return nil, errors.New("PasswordIncorrect") } //sign token token, signTokenErrr := signjwt.SignJWT(jwt.MapClaims{ "id": _Admin.ID, "role": _Admin.Role, }, utils.MustGet("SECRET")) if signTokenErrr != nil { return nil, signTokenErrr } return &LoginResult{ Token: token, Admin: _Admin, }, nil }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "func AdminLogin(w http.ResponseWriter, r *http.Request) {\n\n\tbody, err := ioutil.ReadAll(r.Body) // it reads the data for the api asign to the body\n\tif err != nil {\n\t\tresponses.ERROR(w, http.StatusUnprocessableEntity, err)\n\t\treturn\n\t}\n\tuser := models.User{}\n\terr = json.Unmarshal(body, &user) // her...
[ "0.7065629", "0.6748006", "0.67117566", "0.64069337", "0.6336156", "0.6307874", "0.62228215", "0.6125018", "0.6107571", "0.6039019", "0.60134894", "0.598423", "0.5961705", "0.5946701", "0.5932845", "0.5899275", "0.5894682", "0.58542633", "0.5816433", "0.5813608", "0.5801796",...
0.6823067
1
UpdateAdminRole updates role of an admin
func (orm *ORM) UpdateAdminRole(ctx context.Context, adminID string, role string) (bool, error) { var _Admin models.Admin err := orm.DB.DB.First(&_Admin, "id = ?", adminID).Error if errors.Is(err, gorm.ErrRecordNotFound) { return false, errors.New("AdminNotFound") } _Admin.Role = role orm.DB.DB.Save(&_Admin) return true, nil }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "func (bs *DefaultSecurity) UpdateAdminRoles(login string, delete bool) error {\n\tfor i, name := range bs.Admins.Roles {\n\t\tif name == login {\n\t\t\tif delete {\n\t\t\t\tbs.Admins.Roles = append(bs.Admins.Roles[:i], bs.Admins.Roles[i+1:]...)\n\t\t\t\treturn nil\n\t\t\t}\n\t\t\treturn errors.New(\"Role already e...
[ "0.75154316", "0.719224", "0.7145205", "0.7117579", "0.69392425", "0.6890341", "0.6837208", "0.6815211", "0.67718214", "0.6735075", "0.6655265", "0.66327924", "0.6616167", "0.66020566", "0.6572484", "0.6556261", "0.6539695", "0.649078", "0.6460554", "0.64441735", "0.6400338",...
0.75749993
0
UpdateAdmin updates data of an admin
func (orm *ORM) UpdateAdmin(ctx context.Context, adminID string, fullname *string, email *string, phone *string) (bool, error) { var _Admin models.Admin err := orm.DB.DB.First(&_Admin, "id = ?", adminID).Error if errors.Is(err, gorm.ErrRecordNotFound) { return false, errors.New("AdminNotFound") } if fullname != nil { _Admin.FullName = *fullname } if email != nil { _Admin.Email = *email } if phone != nil { _Admin.Phone = phone } orm.DB.DB.Save(&_Admin) return true, nil }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "func UpdateAdmin(w http.ResponseWriter, r *http.Request) {\n\tvar body UpdateAdminRequest\n\tif err := read.JSON(r.Body, &body); err != nil {\n\t\trender.Error(w, admin.WrapError(admin.ErrorBadRequestType, err, \"error reading request body\"))\n\t\treturn\n\t}\n\n\tif err := body.Validate(); err != nil {\n\t\trend...
[ "0.75725096", "0.7215969", "0.6647906", "0.6647906", "0.64647335", "0.6423737", "0.62350154", "0.61032325", "0.61016893", "0.6100485", "0.60433316", "0.60104555", "0.60084134", "0.59471935", "0.5941222", "0.59372747", "0.5907692", "0.5901883", "0.58410764", "0.5800188", "0.57...
0.6539474
4
UpdateAdminPassword updates password of an admin
func (orm *ORM) UpdateAdminPassword(ctx context.Context, adminID string, oldPassword string, newPassword string) (bool, error) { var _Admin models.Admin err := orm.DB.DB.First(&_Admin, "id = ?", adminID).Error if errors.Is(err, gorm.ErrRecordNotFound) { return false, errors.New("AdminNotFound") } isSame := validatehash.ValidateCipher(oldPassword, _Admin.Password) if isSame == false { return false, errors.New("OldPasswordIncorrect") } _Admin.Password = newPassword orm.DB.DB.Save(&_Admin) return true, nil }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "func ChangeAdminPassword(client *gophercloud.ServiceClient, id, newPassword string) (r ActionResult) {\n\tb := map[string]interface{}{\n\t\t\"changePassword\": map[string]string{\n\t\t\t\"adminPass\": newPassword,\n\t\t},\n\t}\n\tresp, err := client.Post(actionURL(client, id), b, nil, nil)\n\t_, r.Header, r.Err = ...
[ "0.7758886", "0.7567674", "0.69972223", "0.69869626", "0.69246644", "0.69102764", "0.6888545", "0.68878937", "0.6886632", "0.68864185", "0.68759125", "0.6830527", "0.68250537", "0.68117106", "0.6811218", "0.678045", "0.6760435", "0.67210925", "0.67163247", "0.6713579", "0.670...
0.68512404
11
DeleteAdmin deletes an admin
func (orm *ORM) DeleteAdmin(ctx context.Context, adminID string) (bool, error) { var _Admin models.Admin err := orm.DB.DB.Delete(&_Admin, "id = ?", adminID).Error if errors.Is(err, gorm.ErrRecordNotFound) { return false, errors.New("AdminNotFound") } return true, nil }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "func (sec *DatabaseSecurity) DeleteAdmin(login string) error {\n\tif err := sec.db.GetSecurity(sec); err != nil {\n\t\treturn err\n\t}\n\tsec.UpdateAdmins(login, true)\n\tif err := sec.db.SetSecurity(sec); err != nil {\n\t\treturn err\n\t}\n\treturn nil\n}", "func (s *rpcServer) DeleteAdmin(ctx context.Context, ...
[ "0.76786566", "0.7470642", "0.7054028", "0.69997346", "0.69702077", "0.67570275", "0.67210203", "0.6699456", "0.66597235", "0.655705", "0.6519527", "0.64041364", "0.6399189", "0.6351331", "0.6346993", "0.6275566", "0.6214313", "0.6211368", "0.6193503", "0.6181546", "0.6179268...
0.6911579
5
Forgot Password Fucntionality 1. Request with Email 2. Send Code And save code in redis 3. Compare code And send response 4. Enter new password and remove from redis ForgotPasswordRequest is to start the process
func (orm *ORM) ForgotPasswordRequest(ctx context.Context, email string) (*models.Admin, error) { var _Admin models.Admin // check if admin exists err := orm.DB.DB.First(&_Admin, "email = ?", email).Error if errors.Is(err, gorm.ErrRecordNotFound) { return nil, errors.New("AdminNotFound") } //generate code code := generatecode.GenerateCode(6) //save in redis and expire in an hours time redisErr := orm.rdb.Set(ctx, fmt.Sprintf("%s", _Admin.ID), code, 1*time.Hour).Err() if redisErr != nil { return nil, redisErr } // send code to email mailErr := mail.SendMail(_Admin.Email, fmt.Sprintf("Your code is %s", code)) if mailErr != nil { return nil, mailErr } return &_Admin, nil }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "func resetPasswordRequest(w http.ResponseWriter, r *http.Request) {\n\tw.Header().Set(\"Content-Type\", \"application/json\")\n\tvar body otpRequest\n\n\terr := json.NewDecoder(r.Body).Decode(&body)\n\tlog.ErrorHandler(err)\n\n\t// Verify email\n\temailStatus := emailValidator(body.Email)\n\tif !emailStatus {\n\t\...
[ "0.7171423", "0.71607596", "0.7140673", "0.68705434", "0.6823032", "0.654389", "0.65227264", "0.65004206", "0.6471425", "0.6269772", "0.6252708", "0.62453693", "0.6240722", "0.6219106", "0.6211322", "0.6209083", "0.6203456", "0.6166167", "0.6163382", "0.6157834", "0.6134311",...
0.69016
3
ResendCode helps to resend a new code
func (orm *ORM) ResendCode(ctx context.Context, adminID string) (*models.Admin, error) { var _Admin models.Admin // check if admin exists err := orm.DB.DB.First(&_Admin, "id = ?", adminID).Error if errors.Is(err, gorm.ErrRecordNotFound) { return nil, errors.New("AdminNotFound") } //generate code code := generatecode.GenerateCode(6) //save in redis and expire in an hours time redisErr := orm.rdb.Set(ctx, fmt.Sprintf("%s", _Admin.ID), code, 1*time.Hour).Err() if redisErr != nil { return nil, redisErr } // send code to email mailErr := mail.SendMail(_Admin.Email, fmt.Sprintf("Your code is %s", code)) if mailErr != nil { return nil, mailErr } return &_Admin, nil }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "func (dc *DexClient) ResendActivationCode(email string) error {\n\treturn dc.ResendActivationCodeContext(context.Background(), email)\n}", "func (dc *DexClient) ResendActivationCodeContext(ctx context.Context, email string) error {\n\t// Create request body\n\treq := map[string]string{\n\t\t\"email\": email,\n\t...
[ "0.6858339", "0.59381795", "0.58342206", "0.55491394", "0.5370716", "0.53603715", "0.53393215", "0.53146356", "0.53073716", "0.53061116", "0.5272337", "0.52508247", "0.5212652", "0.5147963", "0.5101353", "0.5094711", "0.509436", "0.509355", "0.5080473", "0.5077903", "0.507390...
0.7235184
0
CompareAdminCodes compares the admin code sent by user
func (orm *ORM) CompareAdminCodes(ctx context.Context, adminID string, code string) (bool, error) { //check in redis to see if its the same and not expired value, err := orm.rdb.Get(ctx, fmt.Sprintf("%s", adminID)).Result() if err == redis.Nil { return false, errors.New("CodeHasExpired") } else if err != nil { return false, err } if value != code { return false, errors.New("CodeIncorrect") } return true, nil }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "func checkAdmin(value int64) bool {\n\tfor _, i := range Config.Admins {\n\t\tif i == value {\n\t\t\treturn true\n\t\t}\n\t}\n\treturn false\n}", "func (o *CTROracle) CheckAdmin(ciphertext []byte) bool {\n\tctr := stream.NewCTR(o.Key, o.Nonce)\n\tdecrypted := string(ctr.Decrypt(ciphertext))\n\n\treturn strings.I...
[ "0.5926233", "0.5840442", "0.5440513", "0.5376668", "0.53707075", "0.5186763", "0.51571697", "0.51361406", "0.50601006", "0.5047268", "0.50200075", "0.5019204", "0.5016419", "0.50071216", "0.49842063", "0.49710804", "0.49564472", "0.494138", "0.49289712", "0.490529", "0.49040...
0.80040187
0
ResetPassword updates the admins new password
func (orm *ORM) ResetPassword(ctx context.Context, adminID string, password string) (bool, error) { var _Admin models.Admin err := orm.DB.DB.First(&_Admin, "id = ?", adminID).Error if errors.Is(err, gorm.ErrRecordNotFound) { return false, errors.New("AdminNotFound") } //update password _Admin.Password = password orm.DB.DB.Save(&_Admin) //invalidate the redis data pertaining to this admin redisErr := orm.rdb.Set(ctx, fmt.Sprintf("%s", adminID), nil, 1*time.Second).Err() if redisErr != nil { return false, redisErr } return true, nil }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "func (as *AdminServer) ResetPassword(w http.ResponseWriter, r *http.Request) {\n\tu := ctx.Get(r, \"user\").(models.User)\n\tsession := ctx.Get(r, \"session\").(*sessions.Session)\n\tif !u.PasswordChangeRequired {\n\t\tFlash(w, r, \"info\", \"Please reset your password through the settings page\")\n\t\tsession.Sav...
[ "0.74520636", "0.72761947", "0.7267525", "0.71116567", "0.7103729", "0.70087475", "0.69554776", "0.69512504", "0.68913746", "0.68597054", "0.6825464", "0.68242425", "0.6756234", "0.6742758", "0.6735563", "0.6732325", "0.6695984", "0.66888964", "0.6677383", "0.6662779", "0.665...
0.6968013
6
Value returns a value constructed from the type of the event and filled via the bound contract's UnpackLog function. The optional typ parameter allows to disambiguate the type to select. This is useful in cases where the ID of an EventInfo refers to multiples EventType where each of the bound contract would be able to unpack the log with no error.
func (ev *EventInfo) Value(log types.Log, typ ...reflect.Type) (res reflect.Value, err error) { var ty reflect.Type if len(typ) > 0 { ty = typ[0] } for _, u := range ev.Types { if ty != nil && ty != u.Type { continue } event := reflect.New(u.Type.Elem()) err = u.BoundContract.UnpackLog(event.Interface(), ev.Name, log) if err != nil { continue } f := event.Elem().FieldByName("Raw") if f.IsValid() && f.CanSet() { f.Set(reflect.ValueOf(log)) } return event, nil } return }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "func (e _event) Type() string { return e.Type_ }", "func (ev binlogEvent) Type() byte {\n\treturn ev.Bytes()[BinlogEventTypeOffset]\n}", "func (e *basicEvent) Type() Type {\n\treturn e.dtype\n}", "func EventType(val string) zap.Field {\n\treturn zap.String(FieldEventType, val)\n}", "func (bse *BaseEvent) T...
[ "0.5817425", "0.5224016", "0.5199794", "0.5174661", "0.50340146", "0.49963158", "0.4947979", "0.48776007", "0.4869081", "0.48292866", "0.47609672", "0.47547865", "0.4714412", "0.46656308", "0.46602678", "0.4621549", "0.45972863", "0.45967934", "0.4589144", "0.4566101", "0.455...
0.7790924
0
ReadResponse reads a server response into the received o.
func (o *ListGroupsReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { switch response.Code() { case 200: result := NewListGroupsOK() if err := result.readResponse(response, consumer, o.formats); err != nil { return nil, err } return result, nil case 400: result := NewListGroupsBadRequest() if err := result.readResponse(response, consumer, o.formats); err != nil { return nil, err } return nil, result case 403: result := NewListGroupsForbidden() if err := result.readResponse(response, consumer, o.formats); err != nil { return nil, err } return nil, result case 404: result := NewListGroupsNotFound() if err := result.readResponse(response, consumer, o.formats); err != nil { return nil, err } return nil, result case 500: result := NewListGroupsInternalServerError() if err := result.readResponse(response, consumer, o.formats); err != nil { return nil, err } return nil, result default: result := NewListGroupsDefault(response.Code()) if err := result.readResponse(response, consumer, o.formats); err != nil { return nil, err } if response.Code()/100 == 2 { return result, nil } return nil, result } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "func (d *ResourceHandler) ReadResponse(dataOut unsafe.Pointer, bytesToRead int32, bytesRead *int32, callback *Callback) int32 {\n\treturn lookupResourceHandlerProxy(d.Base()).ReadResponse(d, dataOut, bytesToRead, bytesRead, callback)\n}", "func (o *GetServerReader) ReadResponse(response runtime.ClientResponse, c...
[ "0.76401496", "0.7606844", "0.75207657", "0.7508911", "0.74786514", "0.74720436", "0.743376", "0.74238384", "0.7374945", "0.73664176", "0.7357928", "0.7354524", "0.734958", "0.73463714", "0.7345592", "0.73392683", "0.733557", "0.7321857", "0.7315043", "0.7313861", "0.7309584"...
0.0
-1
NewListGroupsOK creates a ListGroupsOK with default headers values
func NewListGroupsOK() *ListGroupsOK { return &ListGroupsOK{} }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "func NewListGroupsDefault(code int) *ListGroupsDefault {\n\treturn &ListGroupsDefault{\n\t\t_statusCode: code,\n\t}\n}", "func (c *DefaultIdentityProvider) ListGroups(ctx context.Context, options *metainternal.ListOptions) (*auth.GroupList, error) {\n\tkeyword := \"\"\n\tlimit := 50\n\tif options.FieldSelector !...
[ "0.6938777", "0.61539084", "0.61058784", "0.60837674", "0.6075854", "0.60570604", "0.60215706", "0.6012626", "0.60092974", "0.6003559", "0.599757", "0.59502655", "0.5944972", "0.5928773", "0.59200424", "0.5902793", "0.5882899", "0.5873967", "0.58671695", "0.5861143", "0.58153...
0.7069612
0
NewListGroupsBadRequest creates a ListGroupsBadRequest with default headers values
func NewListGroupsBadRequest() *ListGroupsBadRequest { return &ListGroupsBadRequest{} }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "func NewListServerGroupBadRequest() *ListServerGroupBadRequest {\n\treturn &ListServerGroupBadRequest{}\n}", "func NewGetConsistencyGroupsBadRequest() *GetConsistencyGroupsBadRequest {\n\treturn &GetConsistencyGroupsBadRequest{}\n}", "func NewGetHostGroupsBadRequest() *GetHostGroupsBadRequest {\n\treturn &GetH...
[ "0.7203379", "0.6827672", "0.6800662", "0.6767549", "0.65069234", "0.6362982", "0.6343974", "0.6341393", "0.6338169", "0.61313295", "0.6129404", "0.6056113", "0.60408044", "0.6037293", "0.60331726", "0.6015777", "0.5988406", "0.591956", "0.5843401", "0.5837527", "0.58244187",...
0.8323626
0
NewListGroupsForbidden creates a ListGroupsForbidden with default headers values
func NewListGroupsForbidden() *ListGroupsForbidden { return &ListGroupsForbidden{} }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "func NewListGroupsBadRequest() *ListGroupsBadRequest {\n\treturn &ListGroupsBadRequest{}\n}", "func NewGetHostGroupsForbidden() *GetHostGroupsForbidden {\n\treturn &GetHostGroupsForbidden{}\n}", "func getGroups(w http.ResponseWriter, r *http.Request) {\n InitResponse(&w)\n if r.Method == \"OPTIONS\" {return}...
[ "0.6481354", "0.63941246", "0.6109768", "0.5942938", "0.5937463", "0.5933636", "0.5757323", "0.5738157", "0.5690592", "0.5634998", "0.5624124", "0.55764693", "0.5573737", "0.5562796", "0.5555221", "0.552152", "0.55055183", "0.5485115", "0.5476348", "0.54459757", "0.54165435",...
0.7673657
0
NewListGroupsNotFound creates a ListGroupsNotFound with default headers values
func NewListGroupsNotFound() *ListGroupsNotFound { return &ListGroupsNotFound{} }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "func NewListGroupsDefault(code int) *ListGroupsDefault {\n\treturn &ListGroupsDefault{\n\t\t_statusCode: code,\n\t}\n}", "func NewListGroupsBadRequest() *ListGroupsBadRequest {\n\treturn &ListGroupsBadRequest{}\n}", "func NewGetHostGroupsNotFound() *GetHostGroupsNotFound {\n\treturn &GetHostGroupsNotFound{}\n}...
[ "0.63562137", "0.6228668", "0.6198471", "0.6065619", "0.58854806", "0.58265823", "0.5792491", "0.57695234", "0.57186234", "0.56959563", "0.5435722", "0.54346776", "0.5393077", "0.53348124", "0.5326011", "0.53110677", "0.5290318", "0.528526", "0.5273268", "0.52673376", "0.5266...
0.7558979
0
NewListGroupsDefault creates a ListGroupsDefault with default headers values
func NewListGroupsDefault(code int) *ListGroupsDefault { return &ListGroupsDefault{ _statusCode: code, } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "func NewDefaultGroups(ctx *pulumi.Context,\n\tname string, args *DefaultGroupsArgs, opts ...pulumi.ResourceOption) (*DefaultGroups, error) {\n\tif args == nil || args.GroupIds == nil {\n\t\treturn nil, errors.New(\"missing required argument 'GroupIds'\")\n\t}\n\tif args == nil || args.RealmId == nil {\n\t\treturn ...
[ "0.6909627", "0.6855606", "0.6750744", "0.67320436", "0.6511958", "0.6096127", "0.6058161", "0.6057901", "0.6002544", "0.5979988", "0.5939993", "0.5933852", "0.58916205", "0.5888019", "0.58734596", "0.5857483", "0.5743509", "0.5674591", "0.5649271", "0.562719", "0.56152534", ...
0.77026397
0
Code gets the status code for the list groups default response
func (o *ListGroupsDefault) Code() int { return o._statusCode }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "func (o *PostVolumeGroupsListDefault) Code() int {\n\treturn o._statusCode\n}", "func (o *GetHostGroupsDefault) Code() int {\n\treturn o._statusCode\n}", "func (o *QueryCIDGroupsDefault) Code() int {\n\treturn o._statusCode\n}", "func (o *ListServerGroupOK) Code() int {\n\treturn 200\n}", "func (o *QueryUs...
[ "0.8499957", "0.84434056", "0.8435817", "0.8416033", "0.8345299", "0.8230771", "0.8145179", "0.80832684", "0.79981744", "0.79788136", "0.7896459", "0.7836262", "0.7748716", "0.7699286", "0.7659471", "0.7655369", "0.76534915", "0.7602137", "0.7558863", "0.75421864", "0.7498871...
0.8957152
0
Describes the ID format settings for resources for the specified IAM user, IAM role, or root user. For example, you can view the resource types that are enabled for longer IDs. This request only returns information about resource types whose ID formats can be modified; it does not return information about other resource types. For more information, see Resource IDs ( in the Amazon Elastic Compute Cloud User Guide. The following resource types support longer IDs: bundle | conversiontask | customergateway | dhcpoptions | elasticipallocation | elasticipassociation | exporttask | flowlog | image | importtask | instance | internetgateway | networkacl | networkaclassociation | networkinterface | networkinterfaceattachment | prefixlist | reservation | routetable | routetableassociation | securitygroup | snapshot | subnet | subnetcidrblockassociation | volume | vpc | vpccidrblockassociation | vpcendpoint | vpcpeeringconnection | vpnconnection | vpngateway . These settings apply to the principal specified in the request. They do not apply to the principal that makes the request.
func (c *Client) DescribeIdentityIdFormat(ctx context.Context, params *DescribeIdentityIdFormatInput, optFns ...func(*Options)) (*DescribeIdentityIdFormatOutput, error) { if params == nil { params = &DescribeIdentityIdFormatInput{} } result, metadata, err := c.invokeOperation(ctx, "DescribeIdentityIdFormat", params, optFns, c.addOperationDescribeIdentityIdFormatMiddlewares) if err != nil { return nil, err } out := result.(*DescribeIdentityIdFormatOutput) out.ResultMetadata = metadata return out, nil }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "func permissionsResourceIDFields() []permissionsIDFieldMapping {\n\tSIMPLE := func(client *service.DBApiClient, id string) (string, error) {\n\t\treturn id, nil\n\t}\n\tPATH := func(client *service.DBApiClient, path string) (string, error) {\n\t\tinfo, err := client.Notebooks().Read(path)\n\t\tif err != nil {\n\t\...
[ "0.48658967", "0.4843349", "0.47780105", "0.4751632", "0.4737584", "0.4706194", "0.46835887", "0.46823364", "0.46605846", "0.46132356", "0.46063283", "0.4602935", "0.45769018", "0.45747116", "0.45594412", "0.4555575", "0.45465", "0.45461395", "0.45461395", "0.4528009", "0.447...
0.46983594
6
initialize a scanner.Store given libscan.Opts
func initStore(ctx context.Context, opts *Opts) (*sqlx.DB, scanner.Store, error) { var store scanner.Store switch opts.DataStore { case Postgres: // we are going to use pgx for more control over connection pool and // and a cleaner api around bulk inserts cfg, err := pgxpool.ParseConfig(opts.ConnString) if err != nil { return nil, nil, fmt.Errorf("failed to parse ConnString: %v", err) } cfg.MaxConns = 30 pool, err := pgxpool.ConnectConfig(ctx, cfg) if err != nil { return nil, nil, fmt.Errorf("failed to create ConnPool: %v", err) } // setup sqlx db, err := sqlx.Open("pgx", opts.ConnString) if err != nil { return nil, nil, fmt.Errorf("failed to open db: %v", err) } store = postgres.NewStore(db, pool) return db, store, nil default: return nil, nil, fmt.Errorf("provided unknown DataStore") } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "func InitStore(s Store) {\n\tstore = s\n}", "func InitStore(s Store) {\n\tstore = s\n}", "func InitStore(s Store) {\n\tstore = s\n}", "func New(opts ...Option) (*Store, error) {\n\tvar s Store\n\n\tfor _, opt := range opts {\n\t\tif err := opt.Apply(&s); err != nil {\n\t\t\treturn nil, err\n\t\t}\n\t}\n\n\tr...
[ "0.6040634", "0.6040634", "0.6040634", "0.5996873", "0.58918715", "0.5885029", "0.5856279", "0.5775144", "0.5730361", "0.56557924", "0.5648506", "0.5630458", "0.5617305", "0.5564756", "0.55376226", "0.5534137", "0.5514809", "0.5432588", "0.54181623", "0.53568417", "0.5354101"...
0.6672689
0
GetConfig returns configuration data from .env file or env variables.
func GetConfig() (*Config, error) { var err error if _, err = os.Stat(".env"); !os.IsNotExist(err) { err = godotenv.Load() if err != nil { return nil, err } } var conf Config err = envconfig.Process("", &conf) if err != nil { return nil, err } if utf8.RuneCountInString(conf.Delimiter) != 1 { return nil, ErrIncorrectDelimiter } conf.FieldDelimiter, _ = utf8.DecodeRuneInString(conf.Delimiter) return &conf, nil }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "func Get() (*Config, error) {\n\tconf := Config{}\n\tif err := env.Parse(&conf); err != nil {\n\t\treturn nil, err\n\t}\n\treturn &conf, nil\n}", "func getConfig() Conf {\n\tfile, _ := os.Open(\"config/config.json\")\n\tdefer file.Close()\n\tdecoder := json.NewDecoder(file)\n\tConfig := defaultConfig()\n\terr :=...
[ "0.7490927", "0.746446", "0.736129", "0.73386055", "0.729168", "0.7282887", "0.7251122", "0.7225108", "0.718537", "0.71753985", "0.71724844", "0.71357465", "0.7128604", "0.71018463", "0.7094278", "0.7091888", "0.7080909", "0.7067862", "0.7066559", "0.7064386", "0.7062411", ...
0.69321257
26
Asset loads and returns the asset for the given name. It returns an error if the asset could not be found or could not be loaded.
func Asset(name string) ([]byte, error) { if f, ok := _bindata[name]; ok { return f() } return nil, fmt.Errorf("Asset %s not found", name) }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "func Asset(name string) ([]byte, error) {\n cannonicalName := strings.Replace(name, \"\\\\\", \"/\", -1)\n if f, ok := _bindata[cannonicalName]; ok {\n a, err := f()\n if err != nil {\n return nil, fmt.Errorf(\"Asset %s can't read by error: %v\", name, err)\n }\n return a.bytes, nil\n }\n retu...
[ "0.73482424", "0.7267638", "0.7104654", "0.7104654", "0.7104654", "0.7104654", "0.7104654", "0.7104654", "0.7104654", "0.7104654", "0.7104654", "0.7104654", "0.7104654", "0.7104654", "0.7104654", "0.7104654", "0.7104654", "0.7104654", "0.7104654", "0.7104654", "0.709527", "...
0.0
-1
ReactionDelete Handle when a reaction is deleted from a message
func (b *Bot) ReactionDelete(s *discordgo.Session, event *discordgo.MessageReactionRemove) { if f, ok := b.Commands.ReactionRemoveCommands[event.Emoji.Name]; ok { f(b, s, event) } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "func HandleDeleteRemindCommand(ctx context.Context, s *discordgo.Session, m *discordgo.MessageCreate, content []string) {\n\tuserID := fmt.Sprintf(\"%s-%s\", m.Author.Username, m.Author.ID)\n\n\terr := models.DeleteRemind(ctx, content[1], userID)\n\n\tif err != nil {\n\t\ts.ChannelMessageSend(m.ChannelID, fmt.Spri...
[ "0.7750925", "0.6899156", "0.68633205", "0.6679848", "0.6557125", "0.65511835", "0.6498537", "0.63918865", "0.6388954", "0.6379347", "0.63770807", "0.6354654", "0.6294034", "0.62326926", "0.6200813", "0.6182433", "0.60744053", "0.60292774", "0.5997569", "0.5922095", "0.587101...
0.7663503
1
Initialize will create database connection and wire up routes
func (app *App) Initialize(user, password, dbname string) { connectionString := fmt.Sprintf("user=%s password=%s dbname=%s", user, password, dbname) var err error app.DB, err = sql.Open("postgres", connectionString) if err != nil { log.Fatal(err) } app.Router = mux.NewRouter() }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "func (a *App) Initialize() {\n\tpsqlInfo := fmt.Sprintf(\"host=%s port=%d user=%s \"+\"password=%s dbname=%s sslmode=disable\",\n\thost, port, user, password, dbname)\n\tvar err error\n\ta.DB, err = sql.Open(\"postgres\", psqlInfo)\n\n\tif err != nil {\n\t\tlog.Fatal(err)\n\t}\n\n\ta.Router = mux.NewRouter()\n\ta....
[ "0.7584453", "0.75465846", "0.7507653", "0.74276567", "0.7385693", "0.7308852", "0.7270049", "0.7269961", "0.7269961", "0.71667546", "0.71504784", "0.71273017", "0.70464236", "0.7006716", "0.6994363", "0.6990787", "0.6919952", "0.68893766", "0.6831192", "0.6829179", "0.676510...
0.767754
0
Run will start the application
func (app *App) Run(addr string) {}
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "func (app *App) Run() error {\n\treturn nil\n}", "func (app *Application) Run() error {\n\n\terr := app.expose()\n\tif err != nil {\n\t\treturn err\n\t}\n\n\treturn nil\n}", "func (a *Application) Run() error {\n\t<-a.quit\n\treturn nil\n}", "func Run(version string, args []string) {\n\terr := NewApp(version...
[ "0.785601", "0.7610544", "0.7582014", "0.75548065", "0.7538604", "0.7497038", "0.7462086", "0.7445589", "0.74442726", "0.74031967", "0.7324322", "0.7255823", "0.7255806", "0.7229509", "0.7229075", "0.72209775", "0.72208834", "0.71981674", "0.71670043", "0.7135768", "0.7131172...
0.69530505
32
HookClientConfigForWebhook construct a webhook.ClientConfig using a v1beta1.Webhook API object. webhook.ClientConfig is used to create a HookClient and the purpose of the config struct is to share that with other packages that need to create a HookClient.
func HookClientConfigForWebhook(w *v1beta1.Webhook) webhook.ClientConfig { ret := webhook.ClientConfig{Name: w.Name, CABundle: w.ClientConfig.CABundle} if w.ClientConfig.URL != nil { ret.URL = *w.ClientConfig.URL } if w.ClientConfig.Service != nil { ret.Service = &webhook.ClientConfigService{ Name: w.ClientConfig.Service.Name, Namespace: w.ClientConfig.Service.Namespace, } if w.ClientConfig.Service.Path != nil { ret.Service.Path = *w.ClientConfig.Service.Path } } return ret }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "func BuildClientConfigFor(webhookPath string, namespace, componentName string, servicePort int, mode, url string, caBundle []byte) admissionregistrationv1.WebhookClientConfig {\n\tvar (\n\t\tpath = webhookPath\n\t\tclientConfig = admissionregistrationv1.WebhookClientConfig{\n\t\t\t// can be empty if inject...
[ "0.6975738", "0.58652604", "0.5590961", "0.5589027", "0.5560638", "0.54133326", "0.5370507", "0.5327911", "0.53260064", "0.531939", "0.5312625", "0.5310126", "0.53042454", "0.5289221", "0.5241468", "0.52322096", "0.52140266", "0.52014375", "0.5191292", "0.5150803", "0.5130526...
0.85725427
0