anchor
dict
positive
dict
negative
dict
{ "audio": "", "image": "", "text": "func (ndb *nodeDB) cacheNode(node *Node) {\n\telem := ndb.nodeCacheQueue.PushBack(node)\n\tndb.nodeCache[string(node.hash)] = elem\n\n\tif ndb.nodeCacheQueue.Len() > ndb.nodeCacheSize {\n\t", "video": "" }
{ "audio": "", "image": "", "text": "\toldest := ndb.nodeCacheQueue.Front()\n\t\thash := ndb.nodeCacheQueue.Remove(oldest).(*Node).hash\n\t\tdelete(ndb.nodeCache, string(hash))\n\t}\n}", "video": "" }
{ "audio": "", "image": "", "text": "\tndb.batch.Close()\n\tndb.batch = ndb.db.NewBatch()\n}", "video": "" }
{ "audio": "", "image": "", "text": "func (ndb *nodeDB) Commit() {\n\tndb.mtx.Lock()\n\tdefer ndb.mtx.Unlock()\n\n\tndb.batch.Write()\n", "video": "" }
{ "audio": "", "image": "", "text": "\tndb.batch.Close()\n\tndb.batch = ndb.db.NewBatch()\n}", "video": "" }
{ "audio": "", "image": "", "text": "\tbA.mtx.Lock()\n\tdefer bA.mtx.Unlock()\n\treturn bA.setIndex(i, v)\n}", "video": "" }
{ "audio": "", "image": "", "text": "func (ndb *nodeDB) SaveRoot(root *Node, version int64) error {\n\tif len(root.hash) == 0 {\n\t\tpanic(\"Hash should not be", "video": "" }
{ "audio": "", "image": "", "text": " empty\")\n\t}\n\treturn ndb.saveRoot(root.hash, version)\n}", "video": "" }
{ "audio": "", "image": "", "text": "\n\tif t.root == nil {\n\t\treturn 0\n\t}\n\treturn t.root.size\n}", "video": "" }
{ "audio": "", "image": "", "text": "func (ndb *nodeDB) SaveEmptyRoot(version int64) error {\n", "video": "" }
{ "audio": "", "image": "", "text": "\treturn ndb.saveRoot([]byte{}, version)\n}", "video": "" }
{ "audio": "", "image": "", "text": "\tndb.batch.Close()\n\tndb.batch = ndb.db.NewBatch()\n}", "video": "" }
{ "audio": "", "image": "", "text": "func Find(top *html.Node, expr string) []*html.Node {\n\texp, err := xpath.Compile(expr)\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\tvar elems []*html.Node\n\tt := exp.Select(CreateXPathNavigator(top))\n\tfor t.MoveNext() {\n\t\tnav := t.Current().(*NodeNavigator)\n\t\tn := get...
{ "audio": "", "image": "", "text": " > 0 && (elems[0] == n || (nav.NodeType() == xpath.AttributeNode &&\n\t\t\tnav.LocalName() == elems[0].Data && nav.Value() == InnerText(elems[0]))) {\n\t\t\tcontinue\n\t\t}\n\t\telems = append(elems, n)\n\t}\n\treturn elems\n}", "video": "" }
{ "audio": "", "image": "", "text": "\t// lines per node.\n\tcase false:\n\t\tt := asciitable.MakeTable([]string{\"Node Name\", \"Address\", \"Labels\"})\n\t\tfor _, n := range nodes {\n\t\t\tlabelChunks := chunkLabels(n.GetAllLabels(), 2)\n\t\t\tfor i, v := range labelChunks {\n\t\t\t\tvar hostname string\n\t\t\...
{ "audio": "", "image": "", "text": "func LoadURL(url string) (*html.Node, error) {\n\tresp, err := http.Get(url)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\tdefer resp.Body.Close()\n\n\tr, err", "video": "" }
{ "audio": "", "image": "", "text": " := charset.NewReader(resp.Body, resp.Header.Get(\"Content-Type\"))\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\treturn html.Parse(r)\n}", "video": "" }
{ "audio": "", "image": "", "text": "\tif t == nil {\n\t\tt = http.DefaultTransport\n\t}\n\tresp, err := t.RoundTrip(req)\n\tif err != nil {\n\t\treturn nil, &RemoteError{req.URL.Host, err}\n\t}\n\treturn resp, err\n}", "video": "" }
{ "audio": "", "image": "", "text": "func Parse(r io.Reader) (*html.Node,", "video": "" }
{ "audio": "", "image": "", "text": " error) {\n\treturn html.Parse(r)\n}", "video": "" }
{ "audio": "", "image": "", "text": " r.Reader.(io.Closer); ok {\n\t\treturn c.Close()\n\t}\n\treturn nil\n}", "video": "" }
{ "audio": "", "image": "", "text": "func InnerText(n *html.Node) string {\n\tvar output func(*bytes.Buffer, *html.Node)\n\toutput = func(buf *bytes.Buffer, n *html.Node) {\n\t\tswitch n.Type {\n\t\tcase html.TextNode:\n\t\t\tbuf.WriteString(n.Data)\n\t\t\treturn\n\t\tcase html.CommentNode:\n\t\t\treturn\n\t", ...
{ "audio": "", "image": "", "text": "\t}\n\t\tfor child := n.FirstChild; child != nil; child = child.NextSibling {\n\t\t\toutput(buf, child)\n\t\t}\n\t}\n\n\tvar buf bytes.Buffer\n\toutput(&buf, n)\n\treturn buf.String()\n}", "video": "" }
{ "audio": "", "image": "", "text": " -1 {\n\t\treturn formulaTable[fmtForms(FormsTable[idx].Value)]\n\t}\n\treturn func(n int) int {\n\t\treturn n\n\t}\n}", "video": "" }
{ "audio": "", "image": "", "text": "func OutputHTML(n *html.Node, self bool) string {\n\tvar buf bytes.Buffer\n\tif self {\n\t\thtml.Render(&buf, n)", "video": "" }
{ "audio": "", "image": "", "text": "\n\t} else {\n\t\tfor n := n.FirstChild; n != nil; n = n.NextSibling {\n\t\t\thtml.Render(&buf, n)\n\t\t}\n\t}\n\treturn buf.String()\n}", "video": "" }
{ "audio": "", "image": "", "text": "\t}()\n\tvar buf bytes.Buffer\n\tif _, err := io.CopyN(&buf, rs, 1e6); err != nil {\n\t\tif err != io.EOF {\n\t\t\treturn false, err\n\t\t}\n\t}\n\treturn utf8.Valid(buf.Bytes()), nil\n}", "video": "" }
{ "audio": "", "image": "", "text": "func (c *Client) GetOrganization(orgID string, args Arguments) (organization *Organization, err error) {\n\tpath := fmt.Sprintf(\"organizations/%s\", orgID)\n\terr =", "video": "" }
{ "audio": "", "image": "", "text": " c.Get(path, args, &organization)\n\tif organization != nil {\n\t\torganization.client = c\n\t}\n\treturn\n}", "video": "" }
{ "audio": "", "image": "", "text": "\t\tfilepath.Walk(rootPath, func(path string, info os.FileInfo, err error) error {\n\t\t\t\tmatched, err := filepath.Match(\"*.json\", info.Name())\n\t\t\t\tif err != nil {\n\t\t\t\t\twarn(err)\n\t\t\t\t\treturn nil\n\t\t\t\t}\n\t\t\t\tif matched {\n\t\t\t\t\tc <- path\n\t\t\t...
{ "audio": "", "image": "", "text": "func (c *Client) GetToken(tokenID string, args Arguments) (token *Token, err error) {\n\tpath := fmt.Sprintf(\"tokens/%s\", tokenID)\n\terr = c.Get(path,", "video": "" }
{ "audio": "", "image": "", "text": " args, &token)\n\tif token != nil {\n\t\ttoken.client = c\n\t}\n\treturn\n}", "video": "" }
{ "audio": "", "image": "", "text": "\t\tfilepath.Walk(rootPath, func(path string, info os.FileInfo, err error) error {\n\t\t\t\tmatched, err := filepath.Match(\"*.json\", info.Name())\n\t\t\t\tif err != nil {\n\t\t\t\t\twarn(err)\n\t\t\t\t\treturn nil\n\t\t\t\t}\n\t\t\t\tif matched {\n\t\t\t\t\tc <- path\n\t\t\t...
{ "audio": "", "image": "", "text": "func (c ActionCollection) FirstCardCreateAction() *Action {\n\tsort.Sort(c)\n\tfor _, action := range c {\n", "video": "" }
{ "audio": "", "image": "", "text": "\t\tif action.DidCreateCard() {\n\t\t\treturn action\n\t\t}\n\t}\n\treturn nil\n}", "video": "" }
{ "audio": "", "image": "", "text": "\tdefer c.Unlock()\n\n\tfor id := range c.cache {\n\t\tif _, ok := liveContainers[id]; !ok {\n\t\t\tdelete(c.cache, id)\n\t\t}\n\t}\n}", "video": "" }
{ "audio": "", "image": "", "text": "func (c ActionCollection) FilterToCardCreationActions() ActionCollection {\n\tnewSlice := make(ActionCollection, 0, len(c))\n\tfor _, action := range c", "video": "" }
{ "audio": "", "image": "", "text": " {\n\t\tif action.DidCreateCard() {\n\t\t\tnewSlice = append(newSlice, action)\n\t\t}\n\t}\n\treturn newSlice\n}", "video": "" }
{ "audio": "", "image": "", "text": " len(a.clients))\n\tfor _, c := range a.clients {\n\t\tclients = append(clients, c)\n\t}\n\tawcsti := map[string]struct{}{a.Name: struct{}{}}\n\ta.mu.Unlock()\n\tfor _, c := range clients {\n\t\tc.processSubsOnConfigReload(awcsti)\n\t}\n}", "video": "" }
{ "audio": "", "image": "", "text": "func (c ActionCollection) FilterToListChangeActions() ActionCollection {\n\tnewSlice := make(ActionCollection, 0, len(c))\n\tfor _, action := range c", "video": "" }
{ "audio": "", "image": "", "text": " {\n\t\tif action.DidChangeListForCard() {\n\t\t\tnewSlice = append(newSlice, action)\n\t\t}\n\t}\n\treturn newSlice\n}", "video": "" }
{ "audio": "", "image": "", "text": " len(a.clients))\n\tfor _, c := range a.clients {\n\t\tclients = append(clients, c)\n\t}\n\tawcsti := map[string]struct{}{a.Name: struct{}{}}\n\ta.mu.Unlock()\n\tfor _, c := range clients {\n\t\tc.processSubsOnConfigReload(awcsti)\n\t}\n}", "video": "" }
{ "audio": "", "image": "", "text": "func (c ActionCollection) FilterToCardMembershipChangeActions() ActionCollection {\n\tnewSlice := make(ActionCollection, 0, len(c))\n\tfor _, action := range c {\n", "video": "" }
{ "audio": "", "image": "", "text": "\t\tif action.DidChangeCardMembership() || action.DidArchiveCard() || action.DidUnarchiveCard() {\n\t\t\tnewSlice = append(newSlice, action)\n\t\t}\n\t}\n\treturn newSlice\n}", "video": "" }
{ "audio": "", "image": "", "text": " len(a.clients))\n\tfor _, c := range a.clients {\n\t\tclients = append(clients, c)\n\t}\n\tawcsti := map[string]struct{}{a.Name: struct{}{}}\n\ta.mu.Unlock()\n\tfor _, c := range clients {\n\t\tc.processSubsOnConfigReload(awcsti)\n\t}\n}", "video": "" }
{ "audio": "", "image": "", "text": "func (c *Client) GetMember(memberID string, args Arguments) (member *Member, err error) {\n\tpath := fmt.Sprintf(\"members/%s\", memberID)\n\terr =", "video": "" }
{ "audio": "", "image": "", "text": " c.Get(path, args, &member)\n\tif err == nil {\n\t\tmember.client = c\n\t}\n\treturn\n}", "video": "" }
{ "audio": "", "image": "", "text": " \t\tC0 [T0/P0, T1/P1]\n\t// \t\tC1 [T0/P1, T1/P0]\n\t//\n\t// Even though the later is still round robin, the partitions are crossed\n\t//\n\tfor _, members := range membersByTopic {\n\t\tsort.Slice(members, func(i, j int) bool {\n\t\t\treturn members[i].MemberID < members[j]...
{ "audio": "", "image": "", "text": "func (o *Organization) GetMembers(args Arguments) (members []*Member, err error) {\n\tpath := fmt.Sprintf(\"organizations/%s/members\", o.ID)\n\terr =", "video": "" }
{ "audio": "", "image": "", "text": " o.client.Get(path, args, &members)\n\tfor i := range members {\n\t\tmembers[i].client = o.client\n\t}\n\treturn\n}", "video": "" }
{ "audio": "", "image": "", "text": "\treturn func(o *Options) error {\n\t\to.ClosedCB = cb\n\t\treturn nil\n\t}\n}", "video": "" }
{ "audio": "", "image": "", "text": "func (b *Board) GetMembers(args Arguments) (members []*Member, err error) {\n\tpath := fmt.Sprintf(\"boards/%s/members\", b.ID)\n\terr =", "video": "" }
{ "audio": "", "image": "", "text": " b.client.Get(path, args, &members)\n\tfor i := range members {\n\t\tmembers[i].client = b.client\n\t}\n\treturn\n}", "video": "" }
{ "audio": "", "image": "", "text": " := fmt.Sprintf(\"boards/%s/actions\", b.ID)\n\terr = b.client.Get(path, args, &actions)\n\treturn\n}", "video": "" }
{ "audio": "", "image": "", "text": "func (c *Card) GetMembers(args Arguments) (members []*Member, err error) {\n\tpath := fmt.Sprintf(\"cards/%s/members\",", "video": "" }
{ "audio": "", "image": "", "text": " c.ID)\n\terr = c.client.Get(path, args, &members)\n\tfor i := range members {\n\t\tmembers[i].client = c.client\n\t}\n\treturn\n}", "video": "" }
{ "audio": "", "image": "", "text": " := range c.Args {\n\t\toutput += fmt.Sprintf(\"%v\", arg)\n\t}\n\treturn cmdHash(output)\n}", "video": "" }
{ "audio": "", "image": "", "text": "func (c *Client) GetCustomField(fieldID string, args Arguments) (customField *CustomField, err error) {\n", "video": "" }
{ "audio": "", "image": "", "text": "\tpath := fmt.Sprintf(\"customFields/%s\", fieldID)\n\terr = c.Get(path, args, &customField)\n\treturn\n}", "video": "" }
{ "audio": "", "image": "", "text": " *Client {\n\tc.Username = u\n\treturn c\n}", "video": "" }
{ "audio": "", "image": "", "text": "func (b *Board) GetCustomFields(args Arguments) (customFields []*CustomField, err error) {\n\tpath", "video": "" }
{ "audio": "", "image": "", "text": " := fmt.Sprintf(\"boards/%s/customFields\", b.ID)\n\terr = b.client.Get(path, args, &customFields)\n\treturn\n}", "video": "" }
{ "audio": "", "image": "", "text": "\n\terr = b.Do(k, func(mc *memcached.Client, vb uint16) error {\n\t\tresult, err = mc.Observe(vb, k)\n\t\treturn err\n\t})\n\treturn\n}", "video": "" }
{ "audio": "", "image": "", "text": "func (durs ByFirstEntered) Less(i, j int) bool", "video": "" }
{ "audio": "", "image": "", "text": " {\n\treturn durs[i].FirstEntered.Before(durs[j].FirstEntered)\n}", "video": "" }
{ "audio": "", "image": "", "text": " func(i int) bool {\n\t\treturn !results.vertices[i].less(results.config, result)\n\t})\n}", "video": "" }
{ "audio": "", "image": "", "text": "func (c *Card) GetMemberDurations() (durations []*MemberDuration, err error) {\n\tvar actions ActionCollection\n\tif len(c.Actions) == 0 {\n\t\tc.client.log(\"[trello] GetMemberDurations() called on card '%s' without any Card.Actions. Fetching fresh.\", c.ID)\n\t\tactions, err...
{ "audio": "", "image": "", "text": "\n\t\t\terr = errors.Wrap(err, \"GetMembershipChangeActions() call failed.\")\n\t\t\treturn\n\t\t}\n\t} else {\n\t\tactions = c.Actions.FilterToCardMembershipChangeActions()\n\t}\n\n\treturn actions.GetMemberDurations()\n}", "video": "" }
{ "audio": "", "image": "", "text": " attachment.URL,\n\t\t\"name\": attachment.Name,\n\t}\n\terr := c.client.Post(path, args, &attachment)\n\tif err != nil {\n\t\terr = errors.Wrapf(err, \"Error adding attachment to card %s\", c.ID)\n\t}\n\treturn err\n\n}", "video": "" }
{ "audio": "", "image": "", "text": "func NewBoard(name string) Board {\n\tb := Board{Name: name}\n\n\t// default", "video": "" }
{ "audio": "", "image": "", "text": " values in line with API POST\n\tb.Prefs.SelfJoin = true\n\tb.Prefs.CardCovers = true\n\n\treturn b\n}", "video": "" }
{ "audio": "", "image": "", "text": " {\n\t\tif provider.Name() == name {\n\t\t\treturn provider, nil\n\t\t}\n\t}\n\n\treturn nil, &common.MissingProviderError{ProviderName: name}\n}", "video": "" }
{ "audio": "", "image": "", "text": "func (b *Board) CreatedAt() time.Time {\n\tt, _", "video": "" }
{ "audio": "", "image": "", "text": " := IDToTime(b.ID)\n\treturn t\n}", "video": "" }
{ "audio": "", "image": "", "text": "\tnowFunc: func() time.Time { return time.Now().In(time.UTC) },\n\t}\n}", "video": "" }
{ "audio": "", "image": "", "text": "func (b *Board) Delete(extraArgs Arguments) error {\n\tpath := fmt.Sprintf(\"boards/%s\", b.ID)\n", "video": "" }
{ "audio": "", "image": "", "text": "\treturn b.client.Delete(path, Arguments{}, b)\n}", "video": "" }
{ "audio": "", "image": "", "text": " *SampleFJSONBuilder {\n\tdelete(b._properties, info.fieldName)\n\treturn b\n}", "video": "" }
{ "audio": "", "image": "", "text": "func (c *Client) GetBoard(boardID string, args Arguments) (board *Board, err error) {\n\tpath := fmt.Sprintf(\"boards/%s\", boardID)\n\terr = c.Get(path,", "video": "" }
{ "audio": "", "image": "", "text": " args, &board)\n\tif board != nil {\n\t\tboard.client = c\n\t}\n\treturn\n}", "video": "" }
{ "audio": "", "image": "", "text": " = c.Get(\"search\", args, &res)\n\tboards = res.Boards\n\tfor _, board := range boards {\n\t\tboard.client = c\n\t}\n\treturn\n}", "video": "" }
{ "audio": "", "image": "", "text": "func (c *Client) GetMyBoards(args Arguments) (boards []*Board, err error) {\n\tpath := \"members/me/boards\"\n\terr = c.Get(path, args, &boards)\n", "video": "" }
{ "audio": "", "image": "", "text": "\tfor i := range boards {\n\t\tboards[i].client = c\n\t}\n\treturn\n}", "video": "" }
{ "audio": "", "image": "", "text": " = c.Get(\"search\", args, &res)\n\tboards = res.Boards\n\tfor _, board := range boards {\n\t\tboard.client = c\n\t}\n\treturn\n}", "video": "" }
{ "audio": "", "image": "", "text": "func (m *Member) GetBoards(args Arguments) (boards []*Board, err error) {\n\tpath := fmt.Sprintf(\"members/%s/boards\", m.ID)\n\terr =", "video": "" }
{ "audio": "", "image": "", "text": " m.client.Get(path, args, &boards)\n\tfor i := range boards {\n\t\tboards[i].client = m.client\n\t}\n\treturn\n}", "video": "" }
{ "audio": "", "image": "", "text": " URLs {\n\tm.Error = err\n\treturn m\n}", "video": "" }
{ "audio": "", "image": "", "text": "func NewClient(key, token string) *Client {\n\treturn &Client{\n\t\tClient: http.DefaultClient,\n\t\tBaseURL: DefaultBaseURL,\n\t\tKey: key,\n\t\tToken: token,\n\t", "video": "" }
{ "audio": "", "image": "", "text": "\tthrottle: time.Tick(time.Second / 8), // Actually 10/second, but we're extra cautious\n\t\ttestMode: false,\n\t\tctx: context.Background(),\n\t}\n}", "video": "" }
{ "audio": "", "image": "", "text": " *Client {\n\treturn &Client{\n\t\tclient: graphql.NewClient(url, httpClient),\n\t}\n}", "video": "" }
{ "audio": "", "image": "", "text": "func (c *Client) WithContext(ctx context.Context)", "video": "" }
{ "audio": "", "image": "", "text": " *Client {\n\tnewC := *c\n\tnewC.ctx = ctx\n\treturn &newC\n}", "video": "" }
{ "audio": "", "image": "", "text": " *r.WithContext(context.WithValue(r.Context(), StatusCtxKey, status))\n}", "video": "" }
{ "audio": "", "image": "", "text": "func (c *Client) GetMyNotifications(args Arguments) (notifications []*Notification, err error) {\n\tpath", "video": "" }
{ "audio": "", "image": "", "text": " := \"members/me/notifications\"\n\terr = c.Get(path, args, &notifications)\n\tfor i := range notifications {\n\t\tnotifications[i].client = c\n\t}\n\treturn\n}", "video": "" }
{ "audio": "", "image": "", "text": " *Client {\n\tc.Username = u\n\treturn c\n}", "video": "" }
{ "audio": "", "image": "", "text": "func (c *Client) CreateWebhook(webhook *Webhook) error {\n\tpath := \"webhooks\"\n\targs := Arguments{\"idModel\": webhook.IDModel, \"description\": webhook.Description, \"callbackURL\": webhook.CallbackURL}", "video": "" }
{ "audio": "", "image": "", "text": "\n\terr := c.Post(path, args, webhook)\n\tif err == nil {\n\t\twebhook.client = c\n\t}\n\treturn err\n}", "video": "" }
{ "audio": "", "image": "", "text": " *Client {\n\tc.Username = u\n\treturn c\n}", "video": "" }
{ "audio": "", "image": "", "text": "func (c *Client) GetWebhook(webhookID string, args Arguments) (webhook *Webhook, err error) {\n\tpath := fmt.Sprintf(\"webhooks/%s\", webhookID)\n\terr = c.Get(path,", "video": "" }
{ "audio": "", "image": "", "text": " args, &webhook)\n\tif webhook != nil {\n\t\twebhook.client = c\n\t}\n\treturn\n}", "video": "" }
{ "audio": "", "image": "", "text": "\t\tfilepath.Walk(rootPath, func(path string, info os.FileInfo, err error) error {\n\t\t\t\tmatched, err := filepath.Match(\"*.json\", info.Name())\n\t\t\t\tif err != nil {\n\t\t\t\t\twarn(err)\n\t\t\t\t\treturn nil\n\t\t\t\t}\n\t\t\t\tif matched {\n\t\t\t\t\tc <- path\n\t\t\t...
{ "audio": "", "image": "", "text": "func (t *Token) GetWebhooks(args Arguments) (webhooks []*Webhook, err error) {\n\tpath :=", "video": "" }
{ "audio": "", "image": "", "text": " fmt.Sprintf(\"tokens/%s/webhooks\", t.ID)\n\terr = t.client.Get(path, args, &webhooks)\n\treturn\n}", "video": "" }
{ "audio": "", "image": "", "text": " *ListWebhooksOutput {\n\ts.Webhooks = v\n\treturn s\n}", "video": "" }
{ "audio": "", "image": "", "text": "func GetBoardWebhookRequest(r *http.Request) (whr *BoardWebhookRequest, err error) {\n\tif r.Method == \"HEAD\" {\n\t\treturn &BoardWebhookRequest{}, nil", "video": "" }
{ "audio": "", "image": "", "text": "\n\t}\n\tdecoder := json.NewDecoder(r.Body)\n\terr = decoder.Decode(&whr)\n\tif err != nil {\n\t\terr = errors.Wrapf(err, \"GetBoardWebhookRequest() failed to decode '%s'.\", r.URL)\n\t}\n\treturn\n}", "video": "" }
{ "audio": "", "image": "", "text": "\treturn\n\t}\n\tdefer rdr.Close()\n\n\tdebugf(\"piping request upstream\")\n\tgo func() {\n\t\th.upstream.ServeHTTP(rw, r.Request)\n\t\trw.Stream.Close()\n\t}()\n\trw.WaitHeaders()\n\n\tif r.Method != \"HEAD\" && !r.isStateChanging() {\n\t\treturn\n\t}\n\n\tres := rw.Resource...
{ "audio": "", "image": "", "text": "func (c *Card) CreatedAt() time.Time {\n\tt, _", "video": "" }
{ "audio": "", "image": "", "text": " := IDToTime(c.ID)\n\treturn t\n}", "video": "" }
{ "audio": "", "image": "", "text": "\tnowFunc: func() time.Time { return time.Now().In(time.UTC) },\n\t}\n}", "video": "" }
{ "audio": "", "image": "", "text": "func (c *Card) CustomFields(boardCustomFields []*CustomField) map[string]interface{} {\n\n\tcfm := c.customFieldMap\n\n\tif cfm == nil {\n\t\tcfm = &(map[string]interface{}{})\n\n\t\t// bcfOptionNames[CustomField ID] = Custom Field Name\n\t\tbcfOptionNames := map[string]string...
{ "audio": "", "image": "", "text": "\t\t\t}\n\t\t}\n\n\t\tfor _, cf := range c.CustomFieldItems {\n\t\t\tname := bcfOptionNames[cf.IDCustomField]\n\n\t\t\t// create 2nd level map when not available yet\n\t\t\tmap2, ok := bcfOptionsMap[cf.IDCustomField]\n\t\t\tif !ok {\n\t\t\t\tcontinue\n\t\t\t}\n\t\t\tvalue, ok ...
{ "audio": "", "image": "", "text": " with the same id, take\n\t\t\t\t// the annotation with the latest modification time\n\t\t\t\t// This is to prevent issues when an update or delete fails.\n\t\t\t\t// Updates and deletes are multiple step queries.\n\t\t\t\tprev, ok := annos[anno.ID]\n\t\t\t\tif !ok || anno.mod...
{ "audio": "", "image": "", "text": "func (c *Card) MoveToList(listID string, args Arguments) error {\n\tpath := fmt.Sprintf(\"cards/%s\", c.ID)\n", "video": "" }
{ "audio": "", "image": "", "text": "\targs[\"idList\"] = listID\n\treturn c.client.Put(path, args, &c)\n}", "video": "" }
{ "audio": "", "image": "", "text": "\t\tfilepath.Walk(rootPath, func(path string, info os.FileInfo, err error) error {\n\t\t\t\tmatched, err := filepath.Match(\"*.json\", info.Name())\n\t\t\t\tif err != nil {\n\t\t\t\t\twarn(err)\n\t\t\t\t\treturn nil\n\t\t\t\t}\n\t\t\t\tif matched {\n\t\t\t\t\tc <- path\n\t\t\t...
{ "audio": "", "image": "", "text": "func (c *Card) SetPos(newPos float64) error {\n\tpath := fmt.Sprintf(\"cards/%s\", c.ID)\n\treturn c.client.Put(path,", "video": "" }
{ "audio": "", "image": "", "text": " Arguments{\"pos\": fmt.Sprintf(\"%f\", newPos)}, c)\n}", "video": "" }
{ "audio": "", "image": "", "text": " func(c *Client) {\n\t\tc.client = client\n\t}\n}", "video": "" }
{ "audio": "", "image": "", "text": "func (c *Card) RemoveMember(memberID string) error {\n\tpath := fmt.Sprintf(\"cards/%s/idMembers/%s\", c.ID, memberID)", "video": "" }
{ "audio": "", "image": "", "text": "\n\treturn c.client.Delete(path, Defaults(), nil)\n}", "video": "" }
{ "audio": "", "image": "", "text": " \t\tC0 [T0/P0, T1/P1]\n\t// \t\tC1 [T0/P1, T1/P0]\n\t//\n\t// Even though the later is still round robin, the partitions are crossed\n\t//\n\tfor _, members := range membersByTopic {\n\t\tsort.Slice(members, func(i, j int) bool {\n\t\t\treturn members[i].MemberID < members[j]...
{ "audio": "", "image": "", "text": "func (c *Card) AddMemberID(memberID string) (member []*Member, err error) {\n\tpath := fmt.Sprintf(\"cards/%s/idMembers\", c.ID)\n\terr", "video": "" }
{ "audio": "", "image": "", "text": " = c.client.Post(path, Arguments{\"value\": memberID}, &member)\n\treturn member, err\n}", "video": "" }
{ "audio": "", "image": "", "text": "\t\t\tC.GoString(C.ERR_reason_error_string(err))))\n\t}\n\treturn errors.New(fmt.Sprintf(\"SSL errors: %s\", strings.Join(errs, \"\\n\")))\n}", "video": "" }
{ "audio": "", "image": "", "text": "func (c *Card) RemoveIDLabel(labelID string, label *Label) error {\n\tpath", "video": "" }
{ "audio": "", "image": "", "text": " := fmt.Sprintf(\"cards/%s/idLabels/%s\", c.ID, labelID)\n\treturn c.client.Delete(path, Defaults(), label)\n\n}", "video": "" }
{ "audio": "", "image": "", "text": "\t\tfilepath.Walk(rootPath, func(path string, info os.FileInfo, err error) error {\n\t\t\t\tmatched, err := filepath.Match(\"*.json\", info.Name())\n\t\t\t\tif err != nil {\n\t\t\t\t\twarn(err)\n\t\t\t\t\treturn nil\n\t\t\t\t}\n\t\t\t\tif matched {\n\t\t\t\t\tc <- path\n\t\t\t...
{ "audio": "", "image": "", "text": "func (c *Card) AddIDLabel(labelID string) error {\n\tpath := fmt.Sprintf(\"cards/%s/idLabels\", c.ID)\n\terr :=", "video": "" }
{ "audio": "", "image": "", "text": " c.client.Post(path, Arguments{\"value\": labelID}, &c.IDLabels)\n\treturn err\n}", "video": "" }
{ "audio": "", "image": "", "text": "\t\t\tC.GoString(C.ERR_reason_error_string(err))))\n\t}\n\treturn errors.New(fmt.Sprintf(\"SSL errors: %s\", strings.Join(errs, \"\\n\")))\n}", "video": "" }
{ "audio": "", "image": "", "text": "func (c *Card) MoveToTopOfList() error {\n\tpath := fmt.Sprintf(\"cards/%s\",", "video": "" }
{ "audio": "", "image": "", "text": " c.ID)\n\treturn c.client.Put(path, Arguments{\"pos\": \"top\"}, c)\n}", "video": "" }
{ "audio": "", "image": "", "text": " == consts.PluginTypeUnknown {\n\t\tpath = fmt.Sprintf(\"/v1/sys/plugins/catalog/%s\", name)\n\t}\n\n\treturn path\n}", "video": "" }
{ "audio": "", "image": "", "text": "func (c *Card) Update(args Arguments) error {\n\tpath := fmt.Sprintf(\"cards/%s\", c.ID)\n", "video": "" }
{ "audio": "", "image": "", "text": "\treturn c.client.Put(path, args, c)\n}", "video": "" }
{ "audio": "", "image": "", "text": " := range c.Args {\n\t\toutput += fmt.Sprintf(\"%v\", arg)\n\t}\n\treturn cmdHash(output)\n}", "video": "" }
{ "audio": "", "image": "", "text": "func (c *Client) CreateCard(card *Card, extraArgs Arguments) error {\n\tpath := \"cards\"\n\targs := Arguments{\n\t\t\"name\": card.Name,\n\t\t\"desc\": card.Desc,\n\t\t\"pos\": strconv.FormatFloat(card.Pos, 'g', -1, 64),\n\t\t\"idList\": card.IDList,\n\t\t\...
{ "audio": "", "image": "", "text": "\targs[\"due\"] = card.Due.Format(time.RFC3339)\n\t}\n\t// Allow overriding the creation position with 'top' or 'botttom'\n\tif pos, ok := extraArgs[\"pos\"]; ok {\n\t\targs[\"pos\"] = pos\n\t}\n\terr := c.Post(path, args, &card)\n\tif err == nil {\n\t\tcard.client = c\n\t}\n\...
{ "audio": "", "image": "", "text": " attachment.URL,\n\t\t\"name\": attachment.Name,\n\t}\n\terr := c.client.Post(path, args, &attachment)\n\tif err != nil {\n\t\terr = errors.Wrapf(err, \"Error adding attachment to card %s\", c.ID)\n\t}\n\treturn err\n\n}", "video": "" }
{ "audio": "", "image": "", "text": "func (l *List) AddCard(card *Card, extraArgs Arguments) error {\n\tpath := fmt.Sprintf(\"lists/%s/cards\", l.ID)\n\targs := Arguments{\n\t\t\"name\": card.Name,\n\t\t\"desc\": card.Desc,\n\t\t\"idMembers\": strings.Join(card.IDMembers, \",\"),\n\t\t\"idLabels\": str...
{ "audio": "", "image": "", "text": "\t}\n\tif card.Due != nil {\n\t\targs[\"due\"] = card.Due.Format(time.RFC3339)\n\t}\n\t// Allow overwriting the creation position with 'top' or 'bottom'\n\tif pos, ok := extraArgs[\"pos\"]; ok {\n\t\targs[\"pos\"] = pos\n\t}\n\terr := l.client.Post(path, args, &card)\n\tif err...
{ "audio": "", "image": "", "text": " attachment.URL,\n\t\t\"name\": attachment.Name,\n\t}\n\terr := c.client.Post(path, args, &attachment)\n\tif err != nil {\n\t\terr = errors.Wrapf(err, \"Error adding attachment to card %s\", c.ID)\n\t}\n\treturn err\n\n}", "video": "" }
{ "audio": "", "image": "", "text": "func (c *Card) AddComment(comment string, args Arguments) (*Action, error) {\n\tpath := fmt.Sprintf(\"cards/%s/actions/comments\", c.ID)\n", "video": "" }
{ "audio": "", "image": "", "text": "\targs[\"text\"] = comment\n\taction := Action{}\n\terr := c.client.Post(path, args, &action)\n\tif err != nil {\n\t\terr = errors.Wrapf(err, \"Error commenting on card %s\", c.ID)\n\t}\n\treturn &action, err\n}", "video": "" }
{ "audio": "", "image": "", "text": "\t\tfilepath.Walk(rootPath, func(path string, info os.FileInfo, err error) error {\n\t\t\t\tmatched, err := filepath.Match(\"*.json\", info.Name())\n\t\t\t\tif err != nil {\n\t\t\t\t\twarn(err)\n\t\t\t\t\treturn nil\n\t\t\t\t}\n\t\t\t\tif matched {\n\t\t\t\t\tc <- path\n\t\t\t...
{ "audio": "", "image": "", "text": "func (c *Card) AddURLAttachment(attachment *Attachment) error {\n\tpath := fmt.Sprintf(\"cards/%s/attachments\", c.ID)\n\targs := Arguments{\n\t\t\"url\":", "video": "" }
{ "audio": "", "image": "", "text": " attachment.URL,\n\t\t\"name\": attachment.Name,\n\t}\n\terr := c.client.Post(path, args, &attachment)\n\tif err != nil {\n\t\terr = errors.Wrapf(err, \"Error adding attachment to card %s\", c.ID)\n\t}\n\treturn err\n\n}", "video": "" }
{ "audio": "", "image": "", "text": " := range c.Args {\n\t\toutput += fmt.Sprintf(\"%v\", arg)\n\t}\n\treturn cmdHash(output)\n}", "video": "" }
{ "audio": "", "image": "", "text": "func (c *Card) GetParentCard(args Arguments) (*Card, error) {\n\n\t// Hopefully the card came pre-loaded with Actions including the card creation\n\taction := c.Actions.FirstCardCreateAction()\n\n\tif action == nil {\n\t\t// No luck. Go get copyCard actions for this card.\n\t\...
{ "audio": "", "image": "", "text": "\t\treturn nil, err\n\t\t}\n\t\taction = actions.FirstCardCreateAction()\n\t}\n\n\tif action != nil && action.Data != nil && action.Data.CardSource != nil {\n\t\tcard, err := c.client.GetCard(action.Data.CardSource.ID, args)\n\t\treturn card, err\n\t}\n\n\treturn nil, nil\n}",...
{ "audio": "", "image": "", "text": "\n\t\t\terr = errors.Wrap(err, \"GetMembershipChangeActions() call failed.\")\n\t\t\treturn\n\t\t}\n\t} else {\n\t\tactions = c.Actions.FilterToCardMembershipChangeActions()\n\t}\n\n\treturn actions.GetMemberDurations()\n}", "video": "" }
{ "audio": "", "image": "", "text": "func (c *Card) GetAncestorCards(args Arguments) (ancestors []*Card, err error) {\n\n\t// Get the first parent\n\tparent, err := c.GetParentCard(args)\n\tif IsNotFound(err) || IsPermissionDenied(err) {\n\t\tc.client.log(\"[trello] Can't get details about the parent of card '%s'...
{ "audio": "", "image": "", "text": " {\n\t\t\tc.client.log(\"[trello] Can't get details about the parent of card '%s' due to lack of permissions or card deleted.\", c.ID)\n\t\t\treturn ancestors, nil\n\t\t} else if err != nil {\n\t\t\treturn ancestors, err\n\t\t}\n\t}\n\n\treturn ancestors, err\n}", "video": "...
{ "audio": "", "image": "", "text": " = parent.Parent {\n\t\tancestors = append(ancestors, parent)\n\t}\n\treturn ancestors\n}", "video": "" }
{ "audio": "", "image": "", "text": "func (c *Card) GetOriginatingCard(args Arguments) (*Card, error) {\n\tancestors, err := c.GetAncestorCards(args)\n", "video": "" }
{ "audio": "", "image": "", "text": "\tif err != nil {\n\t\treturn c, err\n\t}\n\tif len(ancestors) > 0 {\n\t\treturn ancestors[len(ancestors)-1], nil\n\t}\n\n\treturn c, nil\n}", "video": "" }
{ "audio": "", "image": "", "text": " schedulerCache,\n\t\tStopEverything: stopEverything,\n\t\tschedulerName: args.SchedulerName,\n\t\thardPodAffinitySymmetricWeight: args.HardPodAffinitySymmetricWeight,\n\t\tdisablePreemption: args.DisablePreemption,\n\...
{ "audio": "", "image": "", "text": "func (c *Card) CreatorMember() (*Member, error) {\n\tvar actions ActionCollection\n\tvar err error\n\n\tif len(c.Actions) == 0 {\n\t\tc.Actions, err = c.GetActions(Arguments{\"filter\": \"all\", \"limit\": \"1000\", \"memberCreator_fields\": \"all\"})\n", "video": "" }
{ "audio": "", "image": "", "text": "\t\tif err != nil {\n\t\t\terr = errors.Wrapf(err, \"GetActions() call failed.\")\n\t\t\treturn nil, err\n\t\t}\n\t}\n\tactions = c.Actions.FilterToCardCreationActions()\n\n\tif len(actions) > 0 {\n\t\treturn actions[0].MemberCreator, nil\n\t}\n\treturn nil, errors.Errorf(\"No...
{ "audio": "", "image": "", "text": "\n\t\t\terr = errors.Wrap(err, \"GetMembershipChangeActions() call failed.\")\n\t\t\treturn\n\t\t}\n\t} else {\n\t\tactions = c.Actions.FilterToCardMembershipChangeActions()\n\t}\n\n\treturn actions.GetMemberDurations()\n}", "video": "" }
{ "audio": "", "image": "", "text": "func (c *Card) CreatorMemberID() (string, error) {\n\n\tvar actions ActionCollection\n\tvar err error\n\n\tif len(c.Actions) == 0 {\n\t\tc.client.log(\"[trello] CreatorMemberID() called on card '%s' without any Card.Actions. Fetching fresh.\", c.ID)\n\t\tc.Actions, err = c.Get...
{ "audio": "", "image": "", "text": "\tif actions[0].IDMemberCreator != \"\" {\n\t\t\treturn actions[0].IDMemberCreator, err\n\t\t}\n\t}\n\n\treturn \"\", errors.Wrapf(err, \"No Actions on card '%s' could be used to find its creator.\", c.ID)\n}", "video": "" }
{ "audio": "", "image": "", "text": "\n\t\t\terr = errors.Wrap(err, \"GetMembershipChangeActions() call failed.\")\n\t\t\treturn\n\t\t}\n\t} else {\n\t\tactions = c.Actions.FilterToCardMembershipChangeActions()\n\t}\n\n\treturn actions.GetMemberDurations()\n}", "video": "" }
{ "audio": "", "image": "", "text": "func (b *Board) ContainsCopyOfCard(cardID string, args Arguments) (bool, error) {\n\targs[\"filter\"] = \"copyCard\"\n\tactions, err := b.GetActions(args)\n\tif err != nil {\n\t\terr := errors.Wrapf(err, \"GetCards() failed inside ContainsCopyOf() for board '%s' and card '%s'....
{ "audio": "", "image": "", "text": "\n\tfor _, action := range actions {\n\t\tif action.Data != nil && action.Data.CardSource != nil && action.Data.CardSource.ID == cardID {\n\t\t\treturn true, nil\n\t\t}\n\t}\n\treturn false, nil\n}", "video": "" }
{ "audio": "", "image": "", "text": " // queue declare args\n\t\t\tqueueBindingArgs, // queue binding args\n\t\t)\n\t\tif err != nil {\n\t\t\treturn nil, err\n\t\t}\n\n\t\t// Reconnect to the channel if it disconnects/errors out\n\t\tgo func() {\n\t\t\tselect {\n\t\t\tcase err = <-co...
{ "audio": "", "image": "", "text": "func (c *Client) GetCard(cardID string, args Arguments) (card *Card, err error) {\n\tpath", "video": "" }
{ "audio": "", "image": "", "text": " := fmt.Sprintf(\"cards/%s\", cardID)\n\terr = c.Get(path, args, &card)\n\tif card != nil {\n\t\tcard.client = c\n\t}\n\treturn card, err\n}", "video": "" }
{ "audio": "", "image": "", "text": "\t\tfilepath.Walk(rootPath, func(path string, info os.FileInfo, err error) error {\n\t\t\t\tmatched, err := filepath.Match(\"*.json\", info.Name())\n\t\t\t\tif err != nil {\n\t\t\t\t\twarn(err)\n\t\t\t\t\treturn nil\n\t\t\t\t}\n\t\t\t\tif matched {\n\t\t\t\t\tc <- path\n\t\t\t...
{ "audio": "", "image": "", "text": "func (b *Board) GetCards(args Arguments) (cards []*Card, err error) {\n\tpath := fmt.Sprintf(\"boards/%s/cards\", b.ID)\n\n\terr = b.client.Get(path, args, &cards)\n\n\t// Naive implementation would return here. To make sure we get all\n\t// cards, we begin\n\tif len(cards) > ...
{ "audio": "", "image": "", "text": "\n\t\t\tif len(nextCardBatch) > 0 {\n\t\t\t\tcards = append(cards, nextCardBatch...)\n\t\t\t} else {\n\t\t\t\tmoreCards = false\n\t\t\t}\n\t\t}\n\t}\n\n\tfor i := range cards {\n\t\tcards[i].client = b.client\n\t}\n\n\treturn\n}", "video": "" }
{ "audio": "", "image": "", "text": " := fmt.Sprintf(\"boards/%s/actions\", b.ID)\n\terr = b.client.Get(path, args, &actions)\n\treturn\n}", "video": "" }
{ "audio": "", "image": "", "text": "func (l *List) GetCards(args Arguments) (cards []*Card, err error) {\n\tpath := fmt.Sprintf(\"lists/%s/cards\",", "video": "" }
{ "audio": "", "image": "", "text": " l.ID)\n\terr = l.client.Get(path, args, &cards)\n\tfor i := range cards {\n\t\tcards[i].client = l.client\n\t}\n\treturn\n}", "video": "" }
{ "audio": "", "image": "", "text": " space between string arguments\n\tlogStatement := strings.TrimSpace(fmt.Sprintln(v...))\n\tl.print(logStatement)\n}", "video": "" }
{ "audio": "", "image": "", "text": "func (b *Board) GetLabels(args Arguments) (labels []*Label, err error) {\n\tpath :=", "video": "" }
{ "audio": "", "image": "", "text": " fmt.Sprintf(\"boards/%s/labels\", b.ID)\n\terr = b.client.Get(path, args, &labels)\n\treturn\n}", "video": "" }
{ "audio": "", "image": "", "text": "\n\terr = b.Do(k, func(mc *memcached.Client, vb uint16) error {\n\t\tresult, err = mc.Observe(vb, k)\n\t\treturn err\n\t})\n\treturn\n}", "video": "" }
{ "audio": "", "image": "", "text": "func (args Arguments) ToURLValues() url.Values {\n\tv :=", "video": "" }
{ "audio": "", "image": "", "text": " url.Values{}\n\tfor key, value := range args {\n\t\tv.Set(key, value)\n\t}\n\treturn v\n}", "video": "" }
{ "audio": "", "image": "", "text": "\n\t// http POST style params\n\tif r.HTTPFormEncodedValues {\n\t\treq, err := http.NewRequest(method, url.String(), bytes.NewBufferString(values.Encode()))\n\t\treq.Header.Set(\"Content-Type\", \"application/x-www-form-urlencoded\")\n\t\treturn req, err\n\t}\n\turl.RawQuery =...
{ "audio": "", "image": "", "text": "func (b *Board) GetActions(args Arguments) (actions ActionCollection, err error) {\n\tpath", "video": "" }
{ "audio": "", "image": "", "text": " := fmt.Sprintf(\"boards/%s/actions\", b.ID)\n\terr = b.client.Get(path, args, &actions)\n\treturn\n}", "video": "" }
{ "audio": "", "image": "", "text": "\n\t\t\terr = errors.Wrap(err, \"GetMembershipChangeActions() call failed.\")\n\t\t\treturn\n\t\t}\n\t} else {\n\t\tactions = c.Actions.FilterToCardMembershipChangeActions()\n\t}\n\n\treturn actions.GetMemberDurations()\n}", "video": "" }
{ "audio": "", "image": "", "text": "func (l *List) GetActions(args Arguments) (actions ActionCollection, err error) {\n\tpath", "video": "" }
{ "audio": "", "image": "", "text": " := fmt.Sprintf(\"lists/%s/actions\", l.ID)\n\terr = l.client.Get(path, args, &actions)\n\treturn\n}", "video": "" }
{ "audio": "", "image": "", "text": "\treturn l.runLimitFunc(a, l.actions.MutateLimit)\n}", "video": "" }
{ "audio": "", "image": "", "text": "func (c *Card) GetActions(args Arguments) (actions ActionCollection, err error) {\n\tpath", "video": "" }
{ "audio": "", "image": "", "text": " := fmt.Sprintf(\"cards/%s/actions\", c.ID)\n\terr = c.client.Get(path, args, &actions)\n\treturn\n}", "video": "" }
{ "audio": "", "image": "", "text": "\n\t\t\terr = errors.Wrap(err, \"GetMembershipChangeActions() call failed.\")\n\t\t\treturn\n\t\t}\n\t} else {\n\t\tactions = c.Actions.FilterToCardMembershipChangeActions()\n\t}\n\n\treturn actions.GetMemberDurations()\n}", "video": "" }
{ "audio": "", "image": "", "text": "func (c *Card) GetMembershipChangeActions() (actions ActionCollection, err error) {\n\t// We include updateCard:closed as if the member is implicitly removed", "video": "" }
{ "audio": "", "image": "", "text": " from the card when it's closed.\n\t// This allows us to \"close out\" the duration length.\n\treturn c.GetActions(Arguments{\"filter\": \"addMemberToCard,removeMemberFromCard,updateCard:closed\"})\n}", "video": "" }
{ "audio": "", "image": "", "text": "\t\t).Error(\"Tried to remove exchange multiple times\")\n\t\treturn\n\t}\n\n\t// If the message exchange was found, then we perform clean up actions.\n\t// These clean up actions can only be run once per exchange.\n\tmexset.onRemoved()\n}", "video": "" }
{ "audio": "", "image": "", "text": "func (a *Action) DidArchiveCard() bool {\n\treturn (a.Type", "video": "" }
{ "audio": "", "image": "", "text": " == \"updateCard\") && a.Data != nil && a.Data.Card != nil && a.Data.Card.Closed\n}", "video": "" }
{ "audio": "", "image": "", "text": " func(a ma.Multiaddr) bool {\n\t\treturn !f(a)\n\t}\n}", "video": "" }
{ "audio": "", "image": "", "text": "func (a *Action) DidUnarchiveCard() bool {\n\treturn (a.Type", "video": "" }
{ "audio": "", "image": "", "text": " == \"updateCard\") && a.Data != nil && a.Data.Old != nil && a.Data.Old.Closed\n}", "video": "" }
{ "audio": "", "image": "", "text": " func(a ma.Multiaddr) bool {\n\t\treturn !f(a)\n\t}\n}", "video": "" }
{ "audio": "", "image": "", "text": "func (c *Client) SearchCards(query string, args Arguments) (cards []*Card, err error) {\n\targs[\"query\"] = query\n\targs[\"modelTypes\"] = \"cards\"\n\tres :=", "video": "" }
{ "audio": "", "image": "", "text": " SearchResult{}\n\terr = c.Get(\"search\", args, &res)\n\tcards = res.Cards\n\treturn\n}", "video": "" }
{ "audio": "", "image": "", "text": " from \"latest\"\n\t\t\tquery = query.Where(\"id < ?\", id)\n\t\t}\n\t\tquery = query.Order(\"id desc\")\n\t} else {\n\t\tquery = query.Where(\"id > ?\", id).Order(\"id asc\")\n\t}\n\n\tres := query.Limit(records).Find(&changes)\n\tif res.Error != nil {\n\t\treturn nil, res.Er...
{ "audio": "", "image": "", "text": "func (c *Client) SearchBoards(query string, args Arguments) (boards []*Board, err error) {\n\targs[\"query\"] = query\n\targs[\"modelTypes\"] = \"boards\"\n\tres := SearchResult{}\n\terr", "video": "" }
{ "audio": "", "image": "", "text": " = c.Get(\"search\", args, &res)\n\tboards = res.Boards\n\tfor _, board := range boards {\n\t\tboard.client = c\n\t}\n\treturn\n}", "video": "" }
{ "audio": "", "image": "", "text": " from \"latest\"\n\t\t\tquery = query.Where(\"id < ?\", id)\n\t\t}\n\t\tquery = query.Order(\"id desc\")\n\t} else {\n\t\tquery = query.Where(\"id > ?\", id).Order(\"id asc\")\n\t}\n\n\tres := query.Limit(records).Find(&changes)\n\tif res.Error != nil {\n\t\treturn nil, res.Er...
{ "audio": "", "image": "", "text": "func (c *Client) SearchMembers(query string, args Arguments) (members []*Member, err error) {\n\targs[\"query\"] = query\n", "video": "" }
{ "audio": "", "image": "", "text": "\terr = c.Get(\"search/members\", args, &members)\n\treturn\n}", "video": "" }
{ "audio": "", "image": "", "text": " Query {\n\tquery.GroupFields = fields\n\treturn query\n}", "video": "" }
{ "audio": "", "image": "", "text": "func IsRateLimit(err error) bool {\n\tre, ok := err.(rateLimitError)\n", "video": "" }
{ "audio": "", "image": "", "text": "\treturn ok && re.IsRateLimit()\n}", "video": "" }
{ "audio": "", "image": "", "text": " bool {\n\treturn func(err error) bool {\n\t\treturn Cause(err) == cause\n\t}\n}", "video": "" }
{ "audio": "", "image": "", "text": "func IsNotFound(err error) bool {\n\tnf, ok := err.(notFoundError)\n", "video": "" }
{ "audio": "", "image": "", "text": "\treturn ok && nf.IsNotFound()\n}", "video": "" }
{ "audio": "", "image": "", "text": " ok {\n\t\treturn apiErr.Type == NotFoundError\n\t}\n\n\treturn false\n}", "video": "" }
{ "audio": "", "image": "", "text": "func IsPermissionDenied(err error) bool {\n\tpd, ok", "video": "" }
{ "audio": "", "image": "", "text": " := err.(permissionDeniedError)\n\treturn ok && pd.IsPermissionDenied()\n}", "video": "" }
{ "audio": "", "image": "", "text": " bool {\n\treturn func(err error) bool {\n\t\treturn Cause(err) == cause\n\t}\n}", "video": "" }
{ "audio": "", "image": "", "text": "func (l *List) CreatedAt() time.Time {\n\tt, _", "video": "" }
{ "audio": "", "image": "", "text": " := IDToTime(l.ID)\n\treturn t\n}", "video": "" }
{ "audio": "", "image": "", "text": "\tnowFunc: func() time.Time { return time.Now().In(time.UTC) },\n\t}\n}", "video": "" }
{ "audio": "", "image": "", "text": "func (c *Client) GetList(listID string, args Arguments) (list *List, err error) {\n\tpath := fmt.Sprintf(\"lists/%s\", listID)", "video": "" }
{ "audio": "", "image": "", "text": "\n\terr = c.Get(path, args, &list)\n\tif list != nil {\n\t\tlist.client = c\n\t\tfor i := range list.Cards {\n\t\t\tlist.Cards[i].client = c\n\t\t}\n\t}\n\treturn\n}", "video": "" }
{ "audio": "", "image": "", "text": "\t\tfilepath.Walk(rootPath, func(path string, info os.FileInfo, err error) error {\n\t\t\t\tmatched, err := filepath.Match(\"*.json\", info.Name())\n\t\t\t\tif err != nil {\n\t\t\t\t\twarn(err)\n\t\t\t\t\treturn nil\n\t\t\t\t}\n\t\t\t\tif matched {\n\t\t\t\t\tc <- path\n\t\t\t...
{ "audio": "", "image": "", "text": "func (b *Board) GetLists(args Arguments) (lists []*List, err error) {\n\tpath := fmt.Sprintf(\"boards/%s/lists\", b.ID)\n\terr =", "video": "" }
{ "audio": "", "image": "", "text": " b.client.Get(path, args, &lists)\n\tfor i := range lists {\n\t\tlists[i].client = b.client\n\t\tfor j := range lists[i].Cards {\n\t\t\tlists[i].Cards[j].client = b.client\n\t\t}\n\t}\n\treturn\n}", "video": "" }
{ "audio": "", "image": "", "text": " := fmt.Sprintf(\"boards/%s/actions\", b.ID)\n\terr = b.client.Get(path, args, &actions)\n\treturn\n}", "video": "" }
{ "audio": "", "image": "", "text": "func IDToTime(id string) (t time.Time, err error) {\n\tif id == \"\" {\n\t\treturn time.Time{}, nil\n\t}\n\t// The first 8 characters in the object ID are a Unix timestamp\n\tts, err := strconv.ParseUint(id[:8], 16, 64)\n\tif err != nil {\n", "video": "" }
{ "audio": "", "image": "", "text": "\t\terr = errors.Wrapf(err, \"ID '%s' failed to convert to timestamp.\", id)\n\t} else {\n\t\tt = time.Unix(int64(ts), 0)\n\t}\n\treturn\n}", "video": "" }
{ "audio": "", "image": "", "text": " res)\n\tif err != nil {\n\t\treturn \"\", time.Time{}, err\n\t}\n\treturn res.GetAccessToken(), time.Unix(res.GetExpirationTime(), 0), nil\n}", "video": "" }
{ "audio": "", "image": "", "text": "func (l *ListDuration) AddDuration(d time.Duration) {\n\tl.Duration =", "video": "" }
{ "audio": "", "image": "", "text": " l.Duration + d\n\tl.TimesInList++\n}", "video": "" }
{ "audio": "", "image": "", "text": "\n\t\treturn err\n\t}\n\n\tif raw.Duration > 0 {\n\t\tnsec := int64(raw.Duration * float64(time.Second))\n\t\traw.EmbeddedJSONAttachment.Duration = time.Duration(nsec)\n\t}\n\n\treturn nil\n}", "video": "" }
{ "audio": "", "image": "", "text": "func (c *Card) GetListDurations() (durations []*ListDuration, err error) {\n\n\tvar actions ActionCollection\n\tif len(c.Actions) == 0 {\n\t\t// Get all actions which affected the Card's List\n\t\tc.client.log(\"[trello] GetListDurations() called on card '%s' without any Card....
{ "audio": "", "image": "", "text": "\tif err != nil {\n\t\t\terr = errors.Wrap(err, \"GetListChangeActions() call failed.\")\n\t\t\treturn\n\t\t}\n\t} else {\n\t\tactions = c.Actions.FilterToListChangeActions()\n\t}\n\n\treturn actions.GetListDurations()\n}", "video": "" }
{ "audio": "", "image": "", "text": "\n\t\t\terr = errors.Wrap(err, \"GetMembershipChangeActions() call failed.\")\n\t\t\treturn\n\t\t}\n\t} else {\n\t\tactions = c.Actions.FilterToCardMembershipChangeActions()\n\t}\n\n\treturn actions.GetMemberDurations()\n}", "video": "" }
{ "audio": "", "image": "", "text": "func (actions ActionCollection) GetListDurations() (durations []*ListDuration, err error) {\n\tsort.Sort(actions)\n\n\tvar prevTime time.Time\n\tvar prevList *List\n\n\tdurs := make(map[string]*ListDuration)\n\tfor _, action := range actions {\n\t\tif action.DidChangeListForCa...
{ "audio": "", "image": "", "text": " &ListDuration{ListID: prevList.ID, ListName: prevList.Name, Duration: duration, TimesInList: 1, FirstEntered: prevTime}\n\t\t} else {\n\t\t\tdurs[prevList.ID].AddDuration(duration)\n\t\t}\n\t}\n\n\tdurations = make([]*ListDuration, 0, len(durs))\n\tfor _, ld := range durs {\n...
{ "audio": "", "image": "", "text": " errors.Errorf(\"invalid action parameters\")\n\t}\n\n\tswitch name {\n\tcase actions.JujuRunActionName:\n\t\treturn handleJujuRunAction(params)\n\tdefault:\n\t\treturn nil, errors.Errorf(\"unexpected action %s\", name)\n\t}\n}", "video": "" }
{ "audio": "", "image": "", "text": "func DefaultAlertConfig() *ConsulAlertConfig {\n\n\tchecks := &ChecksConfig{\n\t\tEnabled: true,\n\t\tChangeThreshold: 60,\n\t}\n\n\tevents := &EventsConfig{\n\t\tEnabled: true,\n\t\tHandlers: []string{},\n\t}\n\n\temail := &notifier.EmailNotifier{\n\t\tClusterName: \...
{ "audio": "", "image": "", "text": " false,\n\t\tClusterName: \"Consul-Alerts\",\n\t}\n\n\tvictorOps := &notifier.VictorOpsNotifier{\n\t\tEnabled: false,\n\t}\n\n\tilert := &notifier.ILertNotifier{\n\t\tEnabled: false,\n\t\tIncidentKeyTemplate: \"{{.Node}}:{{.Service}}:{{.Check}}\",\n\t}\n\n\tnotif...
{ "audio": "", "image": "", "text": " !mergeDeletionList {\n\t\t\toriginal[key] = patchVal\n\t\t\treturn true, false, \"\", nil\n\t\t}\n\t\toriginalKey, err := extractKey(key, deleteFromPrimitiveListDirectivePrefix)\n\t\treturn false, true, originalKey, err\n\t}\n\treturn false, false, \"\", nil\n}", "video": "...
{ "audio": "", "image": "", "text": "func (il *ILertNotifier) sendEvent(event iLertEvent) error {\n\tbody, err := json.Marshal(event)\n\tif err != nil {\n\t\treturn err\n\t}\n\n\tres, err := http.Post(apiEndpoint, \"application/json\", bytes.NewBuffer(body))\n\tif err != nil {\n\t\treturn err\n\t}\n\n\tdefer res....
{ "audio": "", "image": "", "text": "\n\tif res.StatusCode != 200 {\n\t\tbody, _ := ioutil.ReadAll(res.Body)\n\t\treturn errors.New(fmt.Sprintf(\"Unexpected HTTP status code: %d (%s)\", res.StatusCode, string(body)))\n\t}\n\n\treturn nil\n}", "video": "" }
{ "audio": "", "image": "", "text": "\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\tctx.req.Body.Close()\n\tctx.req.Body = ioutil.NopCloser(bytes.NewBuffer(body))\n\n\treturn body, nil\n}", "video": "" }
{ "audio": "", "image": "", "text": "func (c *ConsulAlertClient) GetReminders() []notifier.Message {\n\tremindersList, _, _ := c.api.KV().List(\"consul-alerts/reminders\", nil)\n\tvar messages []notifier.Message\n", "video": "" }
{ "audio": "", "image": "", "text": "\tfor _, kvpair := range remindersList {\n\t\tvar message notifier.Message\n\t\tjson.Unmarshal(kvpair.Value, &message)\n\t\tmessages = append(messages, message)\n\t}\n\tlog.Println(\"Getting reminders\")\n\treturn messages\n}", "video": "" }
{ "audio": "", "image": "", "text": " message.id\n\tc.send <- message\n}", "video": "" }
{ "audio": "", "image": "", "text": "func (c *ConsulAlertClient) SetReminder(m notifier.Message) {\n\tdata, _ := json.Marshal(m)\n\tkey := fmt.Sprintf(\"consul-alerts/reminders/%s/%s\",", "video": "" }
{ "audio": "", "image": "", "text": " m.Node, m.CheckId)\n\tc.api.KV().Put(&consulapi.KVPair{Key: key, Value: data}, nil)\n\tlog.Println(\"Setting reminder for node: \", m.Node)\n}", "video": "" }
{ "audio": "", "image": "", "text": "\t\t\"nobody\",\n\t\tfalse,\n\t\tfunc(e Export) UserMapping { return e.MapRoot },\n\t\tfunc(e Export, m UserMapping) { e.MapRoot = m })\n\n\treturn api.ExportUpdate(ctx, c.API, nex)\n}", "video": "" }
{ "audio": "", "image": "", "text": "func (c *ConsulAlertClient) DeleteReminder(node string, checkid string) {\n\tkey := fmt.Sprintf(\"consul-alerts/reminders/%s/%s\",", "video": "" }
{ "audio": "", "image": "", "text": " node, checkid)\n\tc.api.KV().Delete(key, nil)\n\tlog.Println(\"Deleting reminder for node: \", node)\n}", "video": "" }
{ "audio": "", "image": "", "text": " err)\n\t}\n\n\tpatchBytes := []byte(fmt.Sprintf(`{\"spec\":{\"podCIDR\":%s}}`, raw))\n\n\tif _, err := c.CoreV1().Nodes().Patch(string(node), types.StrategicMergePatchType, patchBytes); err != nil {\n\t\treturn fmt.Errorf(\"failed to patch node CIDR: %v\", err)\n\t}\n\treturn...
{ "audio": "", "image": "", "text": "func (c *ConsulAlertClient) NewAlerts() []Check {\n\tallChecks, _, _ := c.api.KV().List(\"consul-alerts/checks\", nil)\n\tvar alerts []Check\n\tfor _, kvpair := range allChecks {\n\t\tkey := kvpair.Key\n\t\tif strings.HasSuffix(key, \"/\") {\n\t\t\tcontinue\n\t\t}\n\t\tvar sta...
{ "audio": "", "image": "", "text": "\t\t\tdata, _ := json.Marshal(status)\n\t\t\tc.api.KV().Put(&consulapi.KVPair{Key: key, Value: data}, nil)\n\t\t\t// check if blacklisted\n\n\t\t\tif !c.IsBlacklisted(status.HealthCheck) {\n\t\t\t\talerts = append(alerts, *status.HealthCheck)\n\t\t\t}\n\t\t}\n\t}\n\treturn ale...
{ "audio": "", "image": "", "text": "\n\n\tvar cfg opts.GetConfig\n\tfor _, o := range getOpts {\n\t\to(&cfg)\n\t}\n\n\tif cfg.ResolveStatus {\n\t\tvol.Status = v.Status()\n\t}\n\treturn &vol, nil\n}", "video": "" }
{ "audio": "", "image": "", "text": "func (c *ConsulAlertClient) CustomNotifiers() (customNotifs map[string]string) {\n\tif kvPairs, _, err := c.api.KV().List(\"consul-alerts/config/notifiers/custom\", nil); err == nil {\n\t\tcustomNotifs = make(map[string]string)\n\t\tfor _, kvPair := range kvPairs {\n\t\t\trp :...
{ "audio": "", "image": "", "text": "\tmatch := rp.FindStringSubmatch(kvPair.Key)\n\t\t\tcustNotifName := match[1]\n\t\t\tif custNotifName == \"\" {\n\t\t\t\tcontinue\n\t\t\t}\n\t\t\tcustomNotifs[custNotifName] = string(kvPair.Value)\n\t\t}\n\t}\n\treturn customNotifs\n}", "video": "" }
{ "audio": "", "image": "", "text": " http.NewRequest(method, u.String(), buf)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\tvar h map[string]string = c.Headers\n\tif headers != nil {\n\t\tfor k, v := range headers {\n\t\t\th[k] = v\n\t\t}\n\t}\n\n\tfor k, v := range h {\n\t\treq.Header.Set(k, v)\n\t}\n\n\tre...
{ "audio": "", "image": "", "text": "func (c *ConsulAlertClient) getProfileForEntity(entity string, id string) string {\n\tkvPair, _, _ := c.api.KV().Get(\n\t\tfmt.Sprintf(\"consul-alerts/config/notif-selection/%ss/%s\",\n\t\t\tentity, id), nil)\n\tif kvPair != nil {\n\t\tlog.Printf(\"%s selection key found.\\n\"...
{ "audio": "", "image": "", "text": "\t\tif err != nil {\n\t\t\t\tlog.Printf(\"unable to match %s %s against pattern %s. Error: %s\\n\",\n\t\t\t\t\tentity, id, pattern, err.Error())\n\t\t\t} else if matched {\n\t\t\t\tlog.Printf(\"Regexp matching %s found (%s).\\n\", entity, pattern)\n\t\t\t\treturn profile\n\t\t...
{ "audio": "", "image": "", "text": " = append(p.entity.Tombstones, struct {\n\t\t\tID string\n\t\t\tTombstoned time.Time\n\t\t}{id, ts})\n\t}\n\treturn p.entity\n}", "video": "" }
{ "audio": "", "image": "", "text": "func (c *ConsulAlertClient) GetProfileInfo(node, serviceID, checkID, status string) ProfileInfo {\n\tlog.Println(\"Getting profile for node: \", node, \" service: \", serviceID, \" check: \", checkID)\n\n\tvar profile string\n\n\tprofile = c.getProfileForService(serviceID)\n\t...
{ "audio": "", "image": "", "text": "\tkvPair, _, _ := c.api.KV().Get(key, nil)\n\tif kvPair == nil {\n\t\tlog.Println(\"profile key not found.\")\n\t\treturn checkProfile\n\t}\n\n\tif err := json.Unmarshal(kvPair.Value, &checkProfile); err != nil {\n\t\tlog.Error(\"Profile unmarshalling error: \", err.Error())\n...
{ "audio": "", "image": "", "text": " _, profile := range policy.Profiles {\n\t\tif haveAuth {\n\t\t\tbreak\n\t\t}\n\t\thaveAuth = (profile.Provider != nil)\n\t}\n\n\tif !haveAuth {\n\t\treturn nil, errors.New(errors.PolicyError, errors.InvalidPolicy)\n\t}\n\n\treturn &api.HTTPHandler{\n\t\tHandler: &AuthHandler{...
{ "audio": "", "image": "", "text": "func (c *ConsulAlertClient) IsBlacklisted(check *Check) bool {\n\tblacklistExist := func() bool {\n\t\tkvPairs, _, err := c.api.KV().List(\"consul-alerts/config/checks/blacklist/\", nil)\n\t\treturn len(kvPairs) != 0 && err == nil\n\t}\n\n\tnode := check.Node\n\tnodeCheckKey :...
{ "audio": "", "image": "", "text": " c.CheckKeyExists(serviceCheckKey) || c.CheckKeyMatchesRegexp(\"consul-alerts/config/checks/blacklist/services\", service)\n\t\t}\n\t}\n\n\tcheckID := check.CheckID\n\tcheckCheckKey := fmt.Sprintf(\"consul-alerts/config/checks/blacklist/checks/%s\", checkID)\n\n\tcheckBlacklis...
{ "audio": "", "image": "", "text": " bool {\n\treturn func(err error) bool {\n\t\treturn Cause(err) == cause\n\t}\n}", "video": "" }
{ "audio": "", "image": "", "text": "func New(possible []string, subsetSize []int) *ClosestMatch {\n\tcm := new(ClosestMatch)\n\tcm.SubstringSizes = subsetSize\n\tcm.SubstringToID = make(map[string]map[uint32]struct{})\n\tcm.ID = make(map[uint32]IDInfo)\n\tfor i, s := range possible {\n\t\tsubstrings := cm.splitW...
{ "audio": "", "image": "", "text": " := range substrings {\n\t\t\tif _, ok := cm.SubstringToID[substring]; !ok {\n\t\t\t\tcm.SubstringToID[substring] = make(map[uint32]struct{})\n\t\t\t}\n\t\t\tcm.SubstringToID[substring][uint32(i)] = struct{}{}\n\t\t}\n\t}\n\n\treturn cm\n}", "video": "" }
{ "audio": "", "image": "", "text": "\tdefer cm.mtx.RUnlock()\n\n\treturn cm.pending[inKey]\n}", "video": "" }
{ "audio": "", "image": "", "text": "func Load(filename string) (*ClosestMatch, error) {\n\tcm := new(ClosestMatch)\n\n\tf, err := os.Open(filename)\n\tdefer f.Close()\n\tif err != nil {\n\t\treturn cm, err\n\t}\n\n\tw, err", "video": "" }
{ "audio": "", "image": "", "text": " := gzip.NewReader(f)\n\tif err != nil {\n\t\treturn cm, err\n\t}\n\n\terr = json.NewDecoder(w).Decode(&cm)\n\treturn cm, err\n}", "video": "" }
{ "audio": "", "image": "", "text": " EXT descriptor\".\n\t\tzipFI.Method = zip.Deflate\n\n\t\tw, err := w.CreateHeader(zipFI)\n\t\tif err != nil {\n\t\t\treturn err\n\t\t}\n\n\t\tf, err := os.Open(filePath)\n\t\tif err != nil {\n\t\t\treturn err\n\t\t}\n\t\tdefer f.Close()\n\n\t\t_, err = io.Copy(w, bufio.NewRea...
{ "audio": "", "image": "", "text": "func (cm *ClosestMatch) Add(possible []string) {\n\tcm.mux.Lock()\n\tfor i, s := range possible {\n\t\tsubstrings := cm.splitWord(strings.ToLower(s))\n\t\tcm.ID[uint32(i)] = IDInfo{Key: s, NumSubstrings: len(substrings)}\n\t\tfor substring := range substrings {\n\t\t\tif _, ok...
{ "audio": "", "image": "", "text": " !ok {\n\t\t\t\tcm.SubstringToID[substring] = make(map[uint32]struct{})\n\t\t\t}\n\t\t\tcm.SubstringToID[substring][uint32(i)] = struct{}{}\n\t\t}\n\t}\n\tcm.mux.Unlock()\n}", "video": "" }
{ "audio": "", "image": "", "text": "\tdefer cm.lock.Unlock()\n\n\trefs := cm.refmap()\n\trefs[name] = c\n}", "video": "" }
{ "audio": "", "image": "", "text": "func (cm *ClosestMatch) Save(filename string) error {\n\tf, err := os.Create(filename)\n\tif err != nil {\n", "video": "" }
{ "audio": "", "image": "", "text": "\t\treturn err\n\t}\n\tdefer f.Close()\n\tw := gzip.NewWriter(f)\n\tdefer w.Close()\n\tenc := json.NewEncoder(w)\n\t// enc.SetIndent(\"\", \" \")\n\treturn enc.Encode(cm)\n}", "video": "" }
{ "audio": "", "image": "", "text": "\t}\n\tfilename := \"\"\n\tif hasDestinationFilename {\n\t\tfilename = dest\n\t} else {\n\t\t// try to assert\n\t\tre := regexp.MustCompile(\"[^/]+$\") //everything after last slash\n\n\t\tif results := re.FindAllString(path, -1); len(results) > 0 {\n\t\t\tfilename = results[l...
{ "audio": "", "image": "", "text": "func (cm *ClosestMatch) Closest(searchWord string) string {\n\tfor _, pair := range", "video": "" }
{ "audio": "", "image": "", "text": " rankByWordCount(cm.match(searchWord)) {\n\t\treturn pair.Key\n\t}\n\treturn \"\"\n}", "video": "" }
{ "audio": "", "image": "", "text": " string {\n\tfor _, fn := range funcs {\n\t\ts = fn(s)\n\t}\n\treturn s\n}", "video": "" }
{ "audio": "", "image": "", "text": "func (cm *ClosestMatch) ClosestN(searchWord string, max int) []string {\n\tmatches := make([]string, 0, max)\n\tfor i, pair := range rankByWordCount(cm.match(searchWord)) {\n", "video": "" }
{ "audio": "", "image": "", "text": "\t\tif i >= max {\n\t\t\tbreak\n\t\t}\n\t\tmatches = append(matches, pair.Key)\n\t}\n\treturn matches\n}", "video": "" }
{ "audio": "", "image": "", "text": "\tdefer cm.mtx.RUnlock()\n\n\treturn cm.pending[inKey]\n}", "video": "" }
{ "audio": "", "image": "", "text": "func Open(address string) (*Connection, error) {\r\n\tc := new(Connection)\r\n\tc.Address = address\r\n\tresp, err := http.Get(c.Address + \"/uptime\")\r\n\tif", "video": "" }
{ "audio": "", "image": "", "text": " err != nil {\r\n\t\treturn c, err\r\n\t}\r\n\tdefer resp.Body.Close()\r\n\treturn c, nil\r\n}", "video": "" }
{ "audio": "", "image": "", "text": " {\n\taddr := address.EncodeAddress()\n\tcmd := btcjson.NewSetAccountCmd(addr, account)\n\treturn c.sendCmd(cmd)\n}", "video": "" }
{ "audio": "", "image": "", "text": "func (u *URL) UnmarshalYAML(unmarshal func(interface{}) error) error {\n\tvar s string\n\tif err :=", "video": "" }
{ "audio": "", "image": "", "text": " unmarshal(&s); err != nil {\n\t\treturn err\n\t}\n\n\turlp, err := url.Parse(s)\n\tif err != nil {\n\t\treturn err\n\t}\n\tu.URL = urlp\n\treturn nil\n}", "video": "" }
{ "audio": "", "image": "", "text": "\n\tvar w wrap\n\tvar err error\n\tif err = json.Unmarshal(body, &w); err != nil {\n\t\treturn err\n\t}\n\tu.Tag = w.Tag\n\tswitch u.Tag {\n\tcase \"metadata\":\n\t\tu.Metadata, err = IsMediaMetadataFromJSON(body)\n\n\t\tif err != nil {\n\t\t\treturn err\n\t\t}\n\t}\n\treturn ...
{ "audio": "", "image": "", "text": "func (u URL) MarshalYAML() (interface{}, error) {\n\tif u.URL != nil {\n\t", "video": "" }
{ "audio": "", "image": "", "text": "\treturn u.String(), nil\n\t}\n\treturn nil, nil\n}", "video": "" }
{ "audio": "", "image": "", "text": " {\n\t\treturn string(r)\n\t}\n\tif u.User != nil {\n\t\tu.User = url.User(u.User.Username())\n\t}\n\treturn u.String()\n}", "video": "" }
{ "audio": "", "image": "", "text": "func (c *HTTPClientConfig) Validate() error {\n\tif len(c.BearerToken) > 0 && len(c.BearerTokenFile) > 0 {\n\t\treturn fmt.Errorf(\"at most one of bearer_token & bearer_token_file must be configured\")\n\t}\n\tif c.BasicAuth != nil && (len(c.BearerToken) > 0 || len(c.BearerTok...
{ "audio": "", "image": "", "text": " must be configured\")\n\t}\n\tif c.BasicAuth != nil && (string(c.BasicAuth.Password) != \"\" && c.BasicAuth.PasswordFile != \"\") {\n\t\treturn fmt.Errorf(\"at most one of basic_auth password & password_file must be configured\")\n\t}\n\treturn nil\n}", "video": "" }
{ "audio": "", "image": "", "text": " {\n\t\tv.Set(\"channels\", c.channels)\n\t}\n\n\tif len(c.description) > 0 {\n\t\tv.Set(\"description\", c.description)\n\t}\n\n\tif len(c.handle) > 0 {\n\t\tv.Set(\"handle\", c.handle)\n\t}\n\n\tif c.includeCount {\n\t\tv.Set(\"include_count\", \"true\")\n\t}\n\n\tif len(c.n...