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
Read reads up to len(b) bytes from memory. It returns the number of bytes read. EOF is signaled by a zero count with err set to io.EOF.
func (m *Memory) Read(b []byte) (n int, err error) { var dbg = false if m == nil { return 0, os.ErrInvalid } //fmt.Printf("Memory.Read: len(b)=%d, len(m.buf)=%d, cap(m.buf)=%d\n", len(b), len(m.buf), cap(m.buf)) if len(m.buf) == 0 { //fmt.Printf("Memory.Read: EOF\n") return 0, io.EOF } if len(b) > len(m.buf) { n = len(m.buf) } else { n = len(b) } // fmt.Printf("Memory.Read: B len(m.buf)=%d, cap(m.buf)=%d\n", len(m.buf), cap(m.buf)) if (dbg) { fmt.Printf("|") } for i := 0; i < n; i++ { b[i] = m.buf[i] if (dbg) { fmt.Printf("%d, ", b[i]) } } if (dbg) { fmt.Printf("|") } // b = m.buf[0:n] m.buf = m.buf[n:] //fmt.Printf("Memory.Read: A len(m.buf)=%d, cap(m.buf)=%d\n", len(m.buf), cap(m.buf)) return n, nil }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "func (tr *Reader) Read(b []byte) (n int, err error) {\n\tif tr.nb == 0 {\n\t\t// file consumed\n\t\treturn 0, io.EOF\n\t}\n\n\tif int64(len(b)) > tr.nb {\n\t\tb = b[0:tr.nb]\n\t}\n\tn, err = tr.r.Read(b)\n\ttr.nb -= int64(n)\n\n\tif err == io.EOF && tr.nb > 0 {\n\t\terr = io.ErrUnexpectedEOF\n\t}\n\ttr.err = err\n...
[ "0.72346056", "0.72149915", "0.7092386", "0.6838555", "0.68181294", "0.6725703", "0.67138755", "0.66786355", "0.6652705", "0.66448426", "0.6643276", "0.6602761", "0.6566816", "0.64891243", "0.64816517", "0.64796203", "0.6452111", "0.6405469", "0.63854784", "0.6384274", "0.635...
0.70700204
3
Write writes len(b) bytes to memory. It returns the number of bytes written and an error, if any. Write returns a nonnil error when n != len(b).
func (m *Memory) Write(b []byte) (n int, err error) { if m == nil { return 0, os.ErrInvalid } if len(b) > len(m.buf) { n = len(m.buf) } else { n = len(b) } for i := 0; i < n; i++ { m.buf[i] = b[i] } m.buf = m.buf[n:] return n, nil }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "func (w *Writer) Write(b []byte) (n int, err error) {\n\tw.Lock()\n\tdefer w.Unlock()\n\tn = len(b)\n\twrite(w, b)\n\treturn n, err\n}", "func (w *Writer) Write(b []byte) int {\n\tif w.err != nil {\n\t\treturn 0\n\t}\n\tn, err := w.W.Write(b)\n\tw.check(n, err)\n\treturn n\n}", "func (w *ReadWriter) Write(b []...
[ "0.7429347", "0.7159322", "0.7155304", "0.7095502", "0.7083462", "0.69782776", "0.69447505", "0.6820908", "0.68133396", "0.6781417", "0.66773105", "0.6669058", "0.66512936", "0.66504216", "0.65993243", "0.6598238", "0.65876794", "0.65593493", "0.6512497", "0.6491802", "0.6484...
0.75367165
0
same as above but just peek, don't update any counters
func (bs *Bitstream) peekbits2(bits uint) (uint32, error) { var rbits = bits var ret uint32 = 0 //fmt.Printf("bitstream.peekbits2: rbits=%d/tbits=%d, bits=%d, nbits=%d, eof=%v, rbits=%d\n", bs.rbits, bs.tbits, bs.bits, bs.nbits, bs.eof, bits); //fmt.Printf("bitstream.peekbits2: bs.bufc=0x%x, bs.bits=%d, bs.bufn=0x%x bs.nbits=%d\n", bs.bufc, bs.bits, bs.bufn, bs.nbits) //fmt.Printf("bitstream.peekbits2: bits=%d, nbits=%d, eof=%v, rbits=%d\n", bs.bits, bs.nbits, bs.eof, bits); if bs.eof == true && bs.bits == 0 && bs.nbits == 0 { return 0, io.EOF } if bits <= bs.bits { ret = (bs.bufc>>(bs.bits - bits))&((1<<bits)-1) } else { if bs.bits > 0 { rbits = bits - bs.bits ret = (bs.bufc&((1<<bs.bits)-1)) << rbits } ret |= ((bs.bufn>>(bs.nbits - rbits))&((1<<rbits)-1)) } //fmt.Printf("bitstream.peekbits2: bits=%d, nbits=%d, eof=%v, rbits=%d, ret=0x%x\n", bs.bits, bs.nbits, bs.eof, bits, ret); //fmt.Printf("bitstream.peekbits2: rbits=%d/tbits=%d, bits=%d, nbits=%d, eof=%v, rbits=%d, ret=0x%x\n", bs.rbits, bs.tbits, bs.bits, bs.nbits, bs.eof, bits, ret); return ret, nil }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "func (m *minifier) peek() int {\n\tm.theLookahead = m.get()\n\treturn m.theLookahead\n}", "func (this *MyQueue) Peek() int {\n\tif len(this.b) == 0 {\n\t\tfor len(this.a) > 0 {\n\t\t\tthis.b = append(this.b, this.a[len(this.a)-1])\n\t\t\tthis.a = this.a[:len(this.a)-1]\n\t\t}\n\t}\n\treturn this.b[len(this.b)-1]...
[ "0.69087", "0.662804", "0.6528335", "0.6451527", "0.6432186", "0.6432042", "0.6290286", "0.62846935", "0.6258624", "0.62279546", "0.61727685", "0.6163973", "0.6154929", "0.6147931", "0.61459637", "0.6137356", "0.6123638", "0.61093056", "0.6107459", "0.61026", "0.60964817", ...
0.0
-1
/ sp>strm_buf =((tmp>>24)&0xFF) | (((tmp>>16)&0xFF)>8)&0xFF)strm_buf =(((tmp>>16)&0xFF)>8)&0xFF)strm_buf = (((tmp>>8)&0xFF)strm_buf = ((tmp&0xFF)<<24);
func (bs *Bitstream) Skipbits(bits uint) error { for bits > 32 { bs.Rul() bits -= 32 } for bits > 0 { bs.Rub() bits -= 1 } return nil }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "func (bs *Bitstream) peekbits2(bits uint) (uint32, error) {\nvar rbits = bits\nvar ret uint32 = 0\n\n\t//fmt.Printf(\"bitstream.peekbits2: rbits=%d/tbits=%d, bits=%d, nbits=%d, eof=%v, rbits=%d\\n\", bs.rbits, bs.tbits, bs.bits, bs.nbits, bs.eof, bits);\n\t//fmt.Printf(\"bitstream.peekbits2: bs.bufc=0x%x, bs.bits=...
[ "0.53808624", "0.5074039", "0.503196", "0.49986258", "0.49602598", "0.49345705", "0.49281877", "0.49244517", "0.4919213", "0.4918674", "0.4850113", "0.48456", "0.48240948", "0.48209944", "0.48121387", "0.48047864", "0.48029023", "0.47852796", "0.4782287", "0.4769038", "0.4764...
0.0
-1
read bit or bool
func (bs *Bitstream) Rub() bool { ret, _ := bs.getbits2(1) ret = ret&0x1 if ret == 1 { return true } else { return false } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "func ReadBool(r io.Reader) (bool, error) {\n\td := make([]byte, 1, 1)\n\t_, err := io.ReadFull(r, d)\n\tif err != nil {\n\t\treturn false, err\n\t}\n\tswitch uint8(d[0]) {\n\tcase 1:\n\t\treturn true, nil\n\tcase 0:\n\t\treturn false, nil\n\tdefault:\n\t\treturn false, ErrorInvalidValue\n\t}\n}", "func ReadBool(...
[ "0.709957", "0.70159477", "0.67494464", "0.66404885", "0.64952254", "0.64942056", "0.6452578", "0.6372139", "0.62465316", "0.6194528", "0.6179957", "0.6169726", "0.61510795", "0.60633117", "0.6006086", "0.5983767", "0.59565043", "0.59435403", "0.5938545", "0.5937716", "0.5930...
0.0
-1
peek bit or bool
func (bs *Bitstream) Pub() bool { ret, _ := bs.peekbits2(1) ret = ret&0x1 if ret == 1 { return true } else { return false } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "func (s *Stack) Peek() (interface{}, bool) {\n\tif s.IsEmpty() {\n\t\treturn \"\", false\n\t}\n\treturn s.data[len(s.data) - 1], true\t\n}", "func (s *Stack) Peek() (e interface{}, ok bool) {\n\tif len(*s) > 0 {\n\t\treturn (*s)[len(*s)-1], true\n\t}\n\treturn nil, false\n}", "func (s *Stack) Peek() (value int...
[ "0.6764622", "0.66685134", "0.661828", "0.6604809", "0.65647995", "0.65120655", "0.6410959", "0.63133526", "0.6193097", "0.61892813", "0.6185485", "0.6178123", "0.60667247", "0.6031022", "0.60185325", "0.5989441", "0.5975517", "0.5958108", "0.59509766", "0.59199476", "0.59163...
0.0
-1
read unsigned long sub
func (bs *Bitstream) Ruls(bits uint) uint32 { ret, _ := bs.getbits2(bits) return ret }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "func (d *decoder) readUint(size int) uint64 {\n\td.head = align(d.head, size)\n\tvar val uint64\n\tfor i := d.head + size - 1; i >= d.head; i-- {\n\t\tval <<= 8\n\t\tval |= uint64(d.buffer[i])\n\t}\n\td.head += size\n\treturn val\n}", "func (s *Stream) readUint(size byte) (uint64, error) {\n\tswitch size {\n\tca...
[ "0.63755673", "0.628545", "0.6082956", "0.6069935", "0.6061391", "0.6050009", "0.5986054", "0.5967398", "0.58884037", "0.5881102", "0.58554363", "0.58501756", "0.5838365", "0.5802667", "0.5786433", "0.5785723", "0.57831055", "0.57824427", "0.5777832", "0.576317", "0.5685453",...
0.0
-1
read unsigned short sub
func (bs *Bitstream) Russ(bits uint) uint16 { /* if (bits > 16) iexit("russ"); */ // printf("russ: 0x%lx\n", ul&0xFFFF); ret, _ := bs.getbits2(bits) return uint16(ret) }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "func (p *Packet) ReadShort() int {\n\treturn int(p.readVarLengthInt(2))\n}", "func (m *MMU) ReadShort(addr uint16) uint16 {\n\treturn Endian.Uint16([]uint8{m.Read(addr), m.Read(addr + 1)})\n}", "func readVarUInt16(r io.Reader) (uint16, error) {\n\t// Since we are being given seven bits per byte, we can fit 2 1...
[ "0.6613946", "0.6598805", "0.6213823", "0.6115921", "0.6039999", "0.6038293", "0.5982321", "0.5916595", "0.58945924", "0.58620244", "0.58599365", "0.58300376", "0.58266693", "0.57954603", "0.56963944", "0.5624942", "0.555724", "0.55507994", "0.5545249", "0.55341876", "0.55265...
0.0
-1
read signed short sub
func (bs *Bitstream) Rss(bits uint) int16 { /* if (bits > 16) iexit("russ"); */ ret, _ := bs.getbits2(bits) //fmt.Printf("Rss: ret=0x%x\n", ret&0xFFFF) return int16(ret) }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "func (p *Packet) ReadShort() int {\n\treturn int(p.readVarLengthInt(2))\n}", "func (m *MMU) ReadShort(addr uint16) uint16 {\n\treturn Endian.Uint16([]uint8{m.Read(addr), m.Read(addr + 1)})\n}", "func (nc NopCloser) ReadShorts(p []int16) (int, error) {\n\treturn ReadShorts(nc, p)\n}", "func readShortUtf8(rd *...
[ "0.6621528", "0.6384858", "0.6312423", "0.6097438", "0.6081304", "0.5990647", "0.59612584", "0.5919964", "0.5882283", "0.5663859", "0.56592983", "0.5584501", "0.5525515", "0.546759", "0.54635507", "0.5435661", "0.5403426", "0.53957343", "0.5393919", "0.53646505", "0.5363067",...
0.0
-1
read unsigned char sub
func (bs *Bitstream) Rucs(bits uint) byte { ret, _ := bs.getbits2(bits) return byte(ret&0xFF) }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "func ReadUInt8(buffer []byte, offset int) uint8 {\n return uint8(buffer[offset])\n}", "func readByte(r io.Reader) (uint8, error) {\n\ttmp := []uint8{0}\n\t_, e := r.Read(tmp)\n\treturn tmp[0], e\n}", "func ReadChar(buffer []byte, offset int) rune {\n return rune(ReadUInt8(buffer, offset))\n}", "func (p...
[ "0.64694846", "0.6252479", "0.6117221", "0.6050169", "0.6000922", "0.5901212", "0.5860441", "0.5860441", "0.5833265", "0.5808791", "0.57862896", "0.5668919", "0.56551856", "0.56547564", "0.5631442", "0.5602297", "0.5542729", "0.55101675", "0.55060464", "0.5486135", "0.5485503...
0.0
-1
read signed char sub
func (bs *Bitstream) Rcs(bits uint) int8 { ret, _ := bs.getbits2(bits) return int8(ret) }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "func (p *atomReader) ReadSignedByte() int8 {\n\tc, _ := p.r.ReadByte()\n\treturn int8(c)\n}", "func (s Stream) ReadSignedByte() (int8, error) {\n\tb, err := s.ReadByte()\n\tif err != nil {\n\t\treturn 0, err\n\t}\n\n\treturn int8(b), nil\n}", "func ReadChar(buffer []byte, offset int) rune {\n return rune(Re...
[ "0.6380608", "0.62133133", "0.6146235", "0.574458", "0.5633963", "0.55531675", "0.5509154", "0.5509154", "0.5468431", "0.5455597", "0.53939104", "0.53855103", "0.53823346", "0.53739035", "0.5358301", "0.5339786", "0.5326236", "0.5318796", "0.53119934", "0.53057224", "0.530496...
0.0
-1
ProvidersAWS : Define the aws provider function
func ProvidersAWS(w http.ResponseWriter, r *http.Request) { w.Header().Set("Content-Type", "application/json; charset=UTF-8") w.WriteHeader(http.StatusOK) if err := json.NewEncoder(w).Encode(awsResources); err != nil { panic(err) } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "func NewAWSProvider(dryRun bool) (Provider, error) {\n\tconfig := aws.NewConfig()\n\n\tsession, err := session.NewSessionWithOptions(session.Options{\n\t\tConfig: *config,\n\t\tSharedConfigState: session.SharedConfigEnable,\n\t})\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\tprovider := &AWSProvider...
[ "0.6819622", "0.62086576", "0.62025106", "0.61090666", "0.60824037", "0.60271865", "0.5967627", "0.59602726", "0.5927459", "0.5871286", "0.58574826", "0.5853901", "0.5825679", "0.58055574", "0.5767389", "0.5753407", "0.5695943", "0.5585618", "0.5578424", "0.5531067", "0.55276...
0.70843154
0
ResourceAWS : Define the aws resource function
func ResourceAWS(w http.ResponseWriter, r *http.Request) { vars := mux.Vars(r) ResourceName := vars["ResourceName"] w.Header().Set("Content-Type", "application/json; charset=UTF-8") w.WriteHeader(http.StatusOK) if err := json.NewEncoder(w).Encode(awsResources[ResourceName]); err != nil { panic(err) } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "func resourceAwsLambdaFunctionCreate(d *schema.ResourceData, meta interface{}) error {\n\tconn := meta.(*AWSClient).lambdaconn\n\n\tfunctionName := d.Get(\"function_name\").(string)\n\treservedConcurrentExecutions := d.Get(\"reserved_concurrent_executions\").(int)\n\tiamRole := d.Get(\"role\").(string)\n\n\tlog.Pr...
[ "0.6991364", "0.6930179", "0.63717675", "0.58506465", "0.5662601", "0.5583528", "0.5579139", "0.5561207", "0.5452959", "0.54288423", "0.54267603", "0.53498", "0.53387374", "0.53074354", "0.53047895", "0.5234232", "0.5231297", "0.5206632", "0.52057105", "0.5187965", "0.5177647...
0.7337061
0
MysqlConnect return sql.DB connection
func MysqlConnect() *sql.DB { db, err := sql.Open("mysql", "root:mysql@/go-cms") err = db.Ping() if err != nil { fmt.Println(err.Error()) panic(err.Error()) // proper error handling instead of panic in your app } return db }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "func Connect(ctx context.Context, dbName string) (*sql.DB, error) {\n\tdbusername := os.Getenv(\"MARIA_USERNAME\")\n\tdbpassword := os.Getenv(\"MARIA_PASSWORD\")\n\n\tdb, err := sql.Open(\"mysql\", dbusername+\":\"+dbpassword+\"@tcp(127.0.0.1:3306)/\"+dbName)\n\tif err != nil {\n\t\tlogger.Error.Println(logger.Get...
[ "0.7435016", "0.7401686", "0.72967714", "0.72485375", "0.72361165", "0.7153986", "0.71051663", "0.70108306", "0.6982586", "0.69476956", "0.6929489", "0.6918455", "0.69164646", "0.6911132", "0.6901979", "0.689255", "0.6888109", "0.68737906", "0.6856792", "0.6850909", "0.684650...
0.78162384
0
SelectAllFromPost return slice Post
func SelectAllFromPost() []Post { db := MysqlConnect() defer db.Close() results, err := db.Query("SELECT * FROM post") if err != nil { panic(err.Error()) } var result []Post for results.Next() { var post Post err = results.Scan(&post.ID, &post.Title, &post.Description, &post.Post, &post.Date, &post.Author, &post.Thumbnail, &post.Categories) if err != nil { panic(err.Error()) } result = append(result, post) } return result }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "func (q postQuery) All(ctx context.Context, exec boil.ContextExecutor) (PostSlice, error) {\n\tvar o []*Post\n\n\terr := q.Bind(ctx, exec, &o)\n\tif err != nil {\n\t\treturn nil, errors.Wrap(err, \"orm: failed to assign all query results to Post slice\")\n\t}\n\n\tif len(postAfterSelectHooks) != 0 {\n\t\tfor _, ob...
[ "0.708097", "0.6149454", "0.59697145", "0.5919534", "0.5841082", "0.58057535", "0.56839687", "0.56670296", "0.5506022", "0.5505743", "0.54964495", "0.5495293", "0.5465193", "0.54260176", "0.5310454", "0.52867424", "0.5270984", "0.5218484", "0.52107173", "0.5208747", "0.518458...
0.673066
1
SelectFromPostByID return one row by Id
func SelectFromPostByID(id int) *Post { db := MysqlConnect() defer db.Close() var post Post err := db.QueryRow("SELECT * FROM post where id = ?", id).Scan(&post.ID, &post.Title, &post.Description, &post.Post, &post.Date, &post.Author, &post.Thumbnail, &post.Categories) if err != nil { panic(err.Error()) } return &post }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "func (store MySQL) GetPostByID(id int) (Post, error) {\n\tlog.Debug().Int(\"post_id\", id).Msg(\"GetPostByID\")\n\n\tconn := db.Connx(mysqlDbID)\n\n\trows, err := conn.Queryx(`\n SELECT\n `+postSelectSQL+`\n FROM\n `+postsTableName+`\n WHERE\n id = ?\n LIMIT 1`,\n\t\tid)\n\n\tif err != n...
[ "0.7332524", "0.70177686", "0.6865962", "0.6823647", "0.6802304", "0.67554516", "0.67408395", "0.6667746", "0.65764743", "0.6552099", "0.6530873", "0.6515364", "0.6512163", "0.644861", "0.6407746", "0.6329042", "0.63176656", "0.6305343", "0.6304021", "0.6272049", "0.624037", ...
0.74236697
0
mustParseInt parses the given expression as an int or returns an error.
func mustParseInt(expr string) (uint, error) { num, err := strconv.Atoi(expr) if err != nil { return 0, fmt.Errorf("Failed to parse int from %s: %s", expr, err) } if num < 0 { return 0, fmt.Errorf("Negative number (%d) not allowed: %s", num, expr) } return uint(num), nil }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "func MustParseInteger(s string) Number {\n\tif res, err := ParseInteger(s); err != nil {\n\t\tpanic(err)\n\t} else {\n\t\treturn res\n\t}\n}", "func ParseInt(operand string) (value int, err error) {\n\ti64, err := strconv.ParseInt(operand, 0, 32)\n\treturn int(i64), err\n}", "func ParseCompileEvaluateInt(exp s...
[ "0.69212425", "0.6258728", "0.622956", "0.6207462", "0.6207462", "0.6166046", "0.614657", "0.6103113", "0.60874563", "0.60366434", "0.6028786", "0.60140276", "0.6012161", "0.5967202", "0.5948929", "0.59394974", "0.59371984", "0.59245354", "0.5917032", "0.58945227", "0.5839608...
0.7912464
0
getBits sets all bits in the range [min, max], modulo the given step size.
func getBits(min, max, step uint) uint64 { var bits uint64 // If step is 1, use shifts. if step == 1 { return ^(math.MaxUint64 << (max + 1)) & (math.MaxUint64 << min) } // Else, use a simple loop. for i := min; i <= max; i += step { bits |= 1 << i } return bits }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "func Range(low, high, step int) Bits {\n\tvar b Bits\n\tif low < 0 {\n\t\tlow = 0\n\t}\n\tif high > 63 {\n\t\thigh = 63\n\t}\n\tfor n := low; n <= high; n += step {\n\t\tb = b.Set(n)\n\t}\n\treturn b\n}", "func SetBits(z *big.Int, abs []big.Word) *big.Int {\n\treturn z.SetBits(abs)\n}", "func newBitset(bits ui...
[ "0.6353587", "0.54566395", "0.53469795", "0.53462315", "0.5337429", "0.5304013", "0.5241235", "0.52031434", "0.5197273", "0.5193695", "0.51649874", "0.51403403", "0.5129424", "0.5081992", "0.50790936", "0.5070936", "0.5058837", "0.5049866", "0.5022632", "0.50153077", "0.49825...
0.7482306
0
NewKafkaProducer returns a new writer for writing messages to a given topic.
func NewKafkaProducer(kafkaAddress, topic string) (*kafka.Writer, error) { conn, err := kafka.Dial("tcp", kafkaAddress) if err != nil { return nil, err } err = conn.CreateTopics(kafka.TopicConfig{ Topic: topic, NumPartitions: 6, ReplicationFactor: 1, }) if err != nil { return nil, err } return kafka.NewWriter(kafka.WriterConfig{ Brokers: []string{kafkaAddress}, Topic: topic, Balancer: &kafka.LeastBytes{}, RequiredAcks: 1, CompressionCodec: &compress.SnappyCodec, }), nil }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "func NewProducer(brokers string) *kafkago.Writer {\n\treturn kafkago.NewWriter(kafkago.WriterConfig{\n\t\tBrokers: []string{brokers},\n\t\tTopic: viper.GetString(\"kafka.topic\"),\n\t\tBalancer: &kafkago.Hash{},\n\t\tBatchTimeout: time.Duration(100) * time.Millisecond,\n\t\tQueueCapacity: 10000...
[ "0.7589761", "0.7055011", "0.68371147", "0.67392504", "0.6711313", "0.6677843", "0.66746676", "0.6628656", "0.64824504", "0.63408065", "0.62722284", "0.62657493", "0.62012464", "0.61716956", "0.6127535", "0.6051101", "0.604499", "0.60395133", "0.6035999", "0.6013231", "0.5914...
0.74114734
1
Value implementation of driver.Valuer
func (country Country) Value() (value driver.Value, err error) { if country == "" { return "", nil } if err = country.Validate(); err != nil { return nil, err } return country.String(), nil }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "func Value(g orb.Geometry, srid int) driver.Valuer {\n\treturn value{srid: srid, v: g}\n}", "func Value(ctx context.Context, v interface{}) interface{} {\n\tif v, ok := v.(Valuer); ok {\n\t\treturn v(ctx)\n\t}\n\treturn v\n}", "func (t *Type) Val() *Type", "func (ns Int64) Value() (driver.Value, error) {\n\t...
[ "0.7086163", "0.6718577", "0.6710976", "0.6582082", "0.6565556", "0.65151715", "0.65132105", "0.64788556", "0.64730585", "0.64386106", "0.6437514", "0.643475", "0.6406415", "0.6396057", "0.63824785", "0.6378028", "0.6377376", "0.63772804", "0.6358859", "0.6349328", "0.6340555...
0.0
-1
UnmarshalJSON unmarshall implementation for Country
func (country *Country) UnmarshalJSON(data []byte) error { var str string if err := json.Unmarshal(data, &str); err != nil { return err } _, err := ByCountryStrErr(str) if err != nil { return err } *country = Country(str) return nil }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "func (s *ServiceCountry) UnmarshalJSON(data []byte) error {\n\tvar rawMsg map[string]json.RawMessage\n\tif err := json.Unmarshal(data, &rawMsg); err != nil {\n\t\treturn fmt.Errorf(\"unmarshalling type %T: %v\", s, err)\n\t}\n\tfor key, val := range rawMsg {\n\t\tvar err error\n\t\tswitch key {\n\t\tcase \"id\":\n...
[ "0.7520358", "0.7236365", "0.6672791", "0.66148806", "0.6038574", "0.5802558", "0.56341153", "0.5518476", "0.544189", "0.54402363", "0.54201967", "0.54020405", "0.5388485", "0.53526396", "0.534792", "0.5329885", "0.532914", "0.5324301", "0.5320204", "0.5309219", "0.5292587", ...
0.74020594
1
Validate implementation of ozzovalidation Validate interface
func (country Country) Validate() error { if _, ok := ByCountryStr(string(country)); !ok { return fmt.Errorf("'%s' is not valid ISO-4217 country", country) } return nil }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "func (cv *CustomValidator) Validate(i interface{}) error {\n\treturn cv.ValidatorX.Struct(i)\n}", "func (cv *CustomValidator) Validate(i interface{}) error {\n\treturn cv.Validator.Struct(i)\n}", "func (cv *CustomValidator) Validate(i interface{}) error {\n\treturn cv.Validator.Struct(i)\n}", "func (m *Eutra...
[ "0.6895335", "0.67800546", "0.67800546", "0.67138636", "0.6671434", "0.6671434", "0.6650311", "0.6557091", "0.6524675", "0.6488952", "0.6443869", "0.6443503", "0.6439199", "0.6436848", "0.64361644", "0.6426901", "0.642463", "0.64170504", "0.6393724", "0.63847923", "0.6361069"...
0.0
-1
IsSet indicates if Country is set
func (country Country) IsSet() bool { return len(string(country)) > 0 }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "func (m *User) SetCountry(value *string)() {\n m.country = value\n}", "func (me *TSupplierCountry) Set(s string) { (*xsdt.String)(me).Set(s) }", "func (a *Meta_Country) Set(fieldName string, value interface{}) {\n\tif a.AdditionalProperties == nil {\n\t\ta.AdditionalProperties = make(map[string]interface{})...
[ "0.65503603", "0.65052235", "0.6231138", "0.6095958", "0.6047148", "0.5990728", "0.58719623", "0.5839228", "0.581528", "0.5749963", "0.5691082", "0.5689148", "0.5682564", "0.5672455", "0.56587803", "0.56568104", "0.5652519", "0.5650086", "0.5649846", "0.5614951", "0.5588311",...
0.7769249
0
String implementation of Stringer interface
func (country Country) String() string { return string(country) }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "func (self StringEqualer) String() string {\n\treturn fmt.Sprintf(\"%s\", self.S)\n}", "func (sk StringKey) String() string {\n\treturn fmt.Sprintf(\"StringKey{%s, str:%q}\", sk.Base.String(), sk.str)\n}", "func (e Str) String() string {\n\treturn fmt.Sprintf(\"%v\", e)\n}", "func (ms MyString) String() stri...
[ "0.75323826", "0.7176641", "0.71551687", "0.71428615", "0.7133808", "0.69970995", "0.69302416", "0.6890453", "0.6862748", "0.685702", "0.67200184", "0.6655948", "0.66553897", "0.66175354", "0.66154265", "0.6591957", "0.65869206", "0.6483278", "0.6481807", "0.6472345", "0.6472...
0.0
-1
IsCountryIn Checks there is a country in Countries
func (countries Countries) IsCountryIn(country string) bool { for _, c := range countries { if string(c) == country { return true } } return false }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "func isCountry(str string) bool {\n\tfor _, entry := range govalidator.ISO3166List {\n\t\tif str == entry.EnglishShortName {\n\t\t\treturn true\n\t\t}\n\t}\n\n\treturn false\n}", "func CountryIn(vs ...string) predicate.Location {\n\tv := make([]interface{}, len(vs))\n\tfor i := range v {\n\t\tv[i] = vs[i]\n\t}\n...
[ "0.7393233", "0.72111654", "0.64721316", "0.6398905", "0.63727", "0.63351285", "0.62785286", "0.62423366", "0.61999017", "0.6182004", "0.61802745", "0.6177708", "0.615309", "0.6137258", "0.6083767", "0.6018212", "0.59891874", "0.5952523", "0.5952199", "0.5889898", "0.5869588"...
0.8314264
0
Value implementation of driver.Valuer
func (currency Currency) Value() (value driver.Value, err error) { if currency == "" { return "", nil } if err = currency.Validate(); err != nil { return nil, err } return currency.String(), nil }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "func Value(g orb.Geometry, srid int) driver.Valuer {\n\treturn value{srid: srid, v: g}\n}", "func Value(ctx context.Context, v interface{}) interface{} {\n\tif v, ok := v.(Valuer); ok {\n\t\treturn v(ctx)\n\t}\n\treturn v\n}", "func (t *Type) Val() *Type", "func (ns Int64) Value() (driver.Value, error) {\n\t...
[ "0.70849544", "0.6717832", "0.6711541", "0.6580412", "0.6563838", "0.6514199", "0.6512207", "0.64785296", "0.64731455", "0.6437411", "0.64355654", "0.6433111", "0.6405991", "0.6395225", "0.63810277", "0.6377446", "0.6376847", "0.63760144", "0.63593113", "0.6347213", "0.633903...
0.0
-1
UnmarshalJSON unmarshall implementation for Currency
func (currency *Currency) UnmarshalJSON(data []byte) error { var str string if err := json.Unmarshal(data, &str); err != nil { return err } currencyValue, err := ByCurrencyStrErr(str) if err != nil { return err } *currency = currencyValue.Currency() return nil }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "func (c *Currency) UnmarshalJSON(b []byte) error {\n\t// UnmarshalJSON does not expect quotes\n\tb = bytes.Trim(b, `\"`)\n\terr := c.i.UnmarshalJSON(b)\n\tif err != nil {\n\t\treturn err\n\t}\n\tif c.i.Sign() < 0 {\n\t\tc.i = *big.NewInt(0)\n\t\treturn ErrNegativeCurrency\n\t}\n\treturn nil\n}", "func (v *Curren...
[ "0.742587", "0.71653044", "0.6980743", "0.68119055", "0.64238787", "0.63120264", "0.6245073", "0.6195886", "0.6194892", "0.6182612", "0.6112677", "0.6090041", "0.60086787", "0.59561217", "0.59060544", "0.5903369", "0.5868142", "0.58613175", "0.5851409", "0.58497226", "0.58438...
0.7172785
1
Validate implementation of ozzovalidation Validate interface
func (currency Currency) Validate() error { if _, ok := ByCurrencyStr(string(currency)); !ok { return fmt.Errorf("'%s' is not valid ISO-4217 currency", currency) } return nil }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "func (cv *CustomValidator) Validate(i interface{}) error {\n\treturn cv.ValidatorX.Struct(i)\n}", "func (cv *CustomValidator) Validate(i interface{}) error {\n\treturn cv.Validator.Struct(i)\n}", "func (cv *CustomValidator) Validate(i interface{}) error {\n\treturn cv.Validator.Struct(i)\n}", "func (m *Eutra...
[ "0.6894558", "0.6779242", "0.6779242", "0.67130953", "0.6670755", "0.6670755", "0.66498876", "0.65566313", "0.65237385", "0.6487206", "0.6443447", "0.6443155", "0.6438971", "0.64359945", "0.6435547", "0.64249223", "0.64240056", "0.64179343", "0.63942605", "0.63836837", "0.635...
0.0
-1
IsSet indicates if Currency is set
func (currency Currency) IsSet() bool { return len(string(currency)) > 0 }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "func (m NoSides) HasSettlCurrency() bool {\n\treturn m.Has(tag.SettlCurrency)\n}", "func (t *VSIntDbl) IsSet() bool {\n\treturn true\n}", "func (country Country) IsSet() bool {\n\treturn len(string(country)) > 0\n}", "func (t *VSDbl) IsSet() bool {\n\treturn true\n}", "func (t *VSStrDbl) IsSet() bool {\n\t...
[ "0.63235146", "0.62823975", "0.61658186", "0.6161759", "0.6142526", "0.61146784", "0.6071438", "0.6032922", "0.60309446", "0.6022377", "0.5981361", "0.59167683", "0.58959395", "0.5871354", "0.5824443", "0.5822197", "0.5774597", "0.5711065", "0.5703303", "0.56996065", "0.56971...
0.7954899
0
String implementation of Stringer interface
func (currency Currency) String() string { return string(currency) }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "func (self StringEqualer) String() string {\n\treturn fmt.Sprintf(\"%s\", self.S)\n}", "func (sk StringKey) String() string {\n\treturn fmt.Sprintf(\"StringKey{%s, str:%q}\", sk.Base.String(), sk.str)\n}", "func (e Str) String() string {\n\treturn fmt.Sprintf(\"%v\", e)\n}", "func (ms MyString) String() stri...
[ "0.75322604", "0.7176142", "0.71555346", "0.7143784", "0.7133403", "0.69966245", "0.69308", "0.68905234", "0.6862448", "0.6856965", "0.6719543", "0.6656341", "0.66548955", "0.66163653", "0.66132116", "0.6590965", "0.65861064", "0.64824784", "0.64815915", "0.6472712", "0.64726...
0.0
-1
Value implementation of driver.Valuer
func (code Code) Value() (value driver.Value, err error) { if code == "" { return "", nil } if err = code.Validate(); err != nil { return nil, err } return code.String(), nil }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "func Value(g orb.Geometry, srid int) driver.Valuer {\n\treturn value{srid: srid, v: g}\n}", "func Value(ctx context.Context, v interface{}) interface{} {\n\tif v, ok := v.(Valuer); ok {\n\t\treturn v(ctx)\n\t}\n\treturn v\n}", "func (t *Type) Val() *Type", "func (ns Int64) Value() (driver.Value, error) {\n\t...
[ "0.7086163", "0.6718577", "0.6710976", "0.6582082", "0.6565556", "0.65151715", "0.65132105", "0.64788556", "0.64730585", "0.64386106", "0.6437514", "0.643475", "0.6406415", "0.6396057", "0.63824785", "0.6378028", "0.6377376", "0.63772804", "0.6358859", "0.6349328", "0.6340555...
0.0
-1
UnmarshalJSON unmarshall implementation for Code
func (code *Code) UnmarshalJSON(data []byte) error { var str string if err := json.Unmarshal(data, &str); err != nil { return err } currency, err := ByCodeStrErr(str) if err != nil { return err } *code = currency.Code() return nil }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "func (x *TabletServerErrorPB_Code) UnmarshalJSON(b []byte) error {\n\tnum, err := protoimpl.X.UnmarshalJSONEnum(x.Descriptor(), b)\n\tif err != nil {\n\t\treturn err\n\t}\n\t*x = TabletServerErrorPB_Code(num)\n\treturn nil\n}", "func (v *CodeMessage) UnmarshalJSON(data []byte) error {\n\tr := jlexer.Lexer{Data: ...
[ "0.6012877", "0.5994266", "0.5987265", "0.5810601", "0.57076085", "0.564477", "0.5636483", "0.56181854", "0.55915743", "0.5584634", "0.5581789", "0.5581036", "0.5563045", "0.5510256", "0.5510151", "0.5494825", "0.54602593", "0.544941", "0.5436807", "0.54237014", "0.5421895", ...
0.65324324
0
Validate implementation of ozzovalidation Validate interface
func (code Code) Validate() error { if _, ok := ByCodeStr(string(code)); !ok { return fmt.Errorf("'%s' is not valid ISO-4217 code", code) } return nil }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "func (cv *CustomValidator) Validate(i interface{}) error {\n\treturn cv.ValidatorX.Struct(i)\n}", "func (cv *CustomValidator) Validate(i interface{}) error {\n\treturn cv.Validator.Struct(i)\n}", "func (cv *CustomValidator) Validate(i interface{}) error {\n\treturn cv.Validator.Struct(i)\n}", "func (m *Eutra...
[ "0.6894354", "0.67791325", "0.67791325", "0.67129165", "0.6670609", "0.6670609", "0.66495097", "0.655622", "0.6522608", "0.6486731", "0.64421475", "0.64419454", "0.6438619", "0.6435914", "0.6435649", "0.6424192", "0.6423689", "0.6417392", "0.639448", "0.63837177", "0.6359225"...
0.0
-1
IsSet indicates if Code is set
func (code Code) IsSet() bool { return len(string(code)) > 0 }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "func (t *VSIntStr) IsSet() bool {\n\treturn true\n}", "func (o *BuildComboFormDescriptorOK) IsCode(code int) bool {\n\treturn code == 200\n}", "func (o *SetAllocatorMetadataItemOK) IsCode(code int) bool {\n\treturn code == 200\n}", "func (o *CreateOrUpdateAWSSettingsCreated) IsCode(code int) bool {\n\treturn...
[ "0.600504", "0.5894775", "0.5868944", "0.5815714", "0.5802817", "0.580272", "0.5783933", "0.5768184", "0.5755762", "0.5716777", "0.5711601", "0.56909645", "0.56888294", "0.56586444", "0.5655527", "0.5650609", "0.5644416", "0.56438637", "0.56348795", "0.56344795", "0.5632594",...
0.739425
0
String implementation of Stringer interface
func (code Code) String() string { return string(code) }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "func (self StringEqualer) String() string {\n\treturn fmt.Sprintf(\"%s\", self.S)\n}", "func (sk StringKey) String() string {\n\treturn fmt.Sprintf(\"StringKey{%s, str:%q}\", sk.Base.String(), sk.str)\n}", "func (e Str) String() string {\n\treturn fmt.Sprintf(\"%v\", e)\n}", "func (ms MyString) String() stri...
[ "0.75323826", "0.7176641", "0.71551687", "0.71428615", "0.7133808", "0.69970995", "0.69302416", "0.6890453", "0.6862748", "0.685702", "0.67200184", "0.6655948", "0.66553897", "0.66175354", "0.66154265", "0.6591957", "0.65869206", "0.6483278", "0.6481807", "0.6472345", "0.6472...
0.0
-1
Places returns number of digits after the dot. E.g. 2 for USD, 0 for for currencies which do not support fractions
func (code Code) Places() int { return currenciesByCode[string(code)].decimalPlaces }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "func decimalPlaces(v string) int {\n\ts := strings.Split(v, \".\")\n\tif len(s) < 2 {\n\t\treturn 0\n\t}\n\treturn len(s[1])\n}", "func FindNumberOfDecimals(locale, entry string) int {\n\tdecimalsRegex := regexp.MustCompile(\n\t\tMathDecimals[locale],\n\t)\n\tnumberRegex := regexp.MustCompile(`\\d+`)\n\n\tdecima...
[ "0.762821", "0.57097113", "0.56845206", "0.56845206", "0.5483798", "0.54278415", "0.5372884", "0.5366294", "0.53467494", "0.53311324", "0.53203964", "0.52873135", "0.5246231", "0.52243394", "0.5194961", "0.51790583", "0.5178787", "0.5102693", "0.5083274", "0.506445", "0.50559...
0.6213454
1
Value implementation of driver.Valuer
func (number Number) Value() (value driver.Value, err error) { if number == "" { return "", nil } if err = number.Validate(); err != nil { return nil, err } return number.String(), nil }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "func Value(g orb.Geometry, srid int) driver.Valuer {\n\treturn value{srid: srid, v: g}\n}", "func Value(ctx context.Context, v interface{}) interface{} {\n\tif v, ok := v.(Valuer); ok {\n\t\treturn v(ctx)\n\t}\n\treturn v\n}", "func (t *Type) Val() *Type", "func (ns Int64) Value() (driver.Value, error) {\n\t...
[ "0.7084119", "0.6716029", "0.67103857", "0.65789413", "0.6563129", "0.65131533", "0.651072", "0.64768064", "0.64721", "0.64368767", "0.64348894", "0.6432346", "0.64039445", "0.6393851", "0.63800097", "0.6376664", "0.6375274", "0.63744503", "0.6358531", "0.63464695", "0.633779...
0.0
-1
UnmarshalJSON unmarshall implementation for Number
func (number *Number) UnmarshalJSON(data []byte) error { var str string if err := json.Unmarshal(data, &str); err != nil { return err } currency, err := ByNumberStrErr(str) if err != nil { return err } *number = currency.Number() return nil }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "func JSONnumberUnmarshal(r io.Reader, i interface{}) error {\n\tdec := json.NewDecoder(r)\n\tdec.UseNumber()\n\treturn dec.Decode(i)\n}", "func (n *Number) UnmarshalJSON(p []byte) error {\n\t*n = Number(\"\")\n\tif len(p) == 0 {\n\t\treturn nil\n\t}\n\tif len(p) > 2 && p[0] == '\"' && p[len(p)-1] == '\"' {\n\t\t...
[ "0.75686663", "0.74890137", "0.73420054", "0.6944769", "0.6942246", "0.69255257", "0.6832556", "0.67320865", "0.65925765", "0.65513116", "0.65375686", "0.65208596", "0.65087634", "0.64488107", "0.6404552", "0.63052386", "0.6258588", "0.62261724", "0.62259305", "0.6179629", "0...
0.7262707
3
Validate implementation of ozzovalidation Validate interface
func (number Number) Validate() error { if _, ok := ByNumberStr(string(number)); !ok { return fmt.Errorf("'%s' is not valid ISO-4217 number", number) } return nil }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "func (cv *CustomValidator) Validate(i interface{}) error {\n\treturn cv.ValidatorX.Struct(i)\n}", "func (cv *CustomValidator) Validate(i interface{}) error {\n\treturn cv.Validator.Struct(i)\n}", "func (cv *CustomValidator) Validate(i interface{}) error {\n\treturn cv.Validator.Struct(i)\n}", "func (m *Eutra...
[ "0.689448", "0.6779133", "0.6779133", "0.67129886", "0.66706574", "0.66706574", "0.66495615", "0.6556484", "0.65232617", "0.6487176", "0.64431983", "0.64428335", "0.6438711", "0.6435842", "0.6435237", "0.64247423", "0.6423761", "0.6417637", "0.63939375", "0.6383445", "0.63597...
0.0
-1
IsSet indicates if Number is set
func (number Number) IsSet() bool { return len(string(number)) > 0 }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "func (t *VSIntDbl) IsSet() bool {\n\treturn true\n}", "func (t *VSStrInt) IsSet() bool {\n\treturn true\n}", "func (t *VSStrDbl) IsSet() bool {\n\treturn true\n}", "func (t *VSInt) IsSet() bool {\n\treturn true\n}", "func (t *VSIntInt) IsSet() bool {\n\treturn true\n}", "func (t *VSDblInt) IsSet() bool {...
[ "0.69339883", "0.6756747", "0.6663215", "0.66329336", "0.6566586", "0.6484455", "0.634472", "0.6265728", "0.6180234", "0.61563396", "0.61460376", "0.60782546", "0.605109", "0.5982352", "0.5968536", "0.59613574", "0.5849868", "0.5842947", "0.5774191", "0.5755659", "0.5718024",...
0.77407116
0
String implementation of Stringer interface
func (number Number) String() string { return string(number) }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "func (self StringEqualer) String() string {\n\treturn fmt.Sprintf(\"%s\", self.S)\n}", "func (sk StringKey) String() string {\n\treturn fmt.Sprintf(\"StringKey{%s, str:%q}\", sk.Base.String(), sk.str)\n}", "func (e Str) String() string {\n\treturn fmt.Sprintf(\"%v\", e)\n}", "func (ms MyString) String() stri...
[ "0.7532271", "0.717642", "0.7156089", "0.7144944", "0.7134255", "0.6998332", "0.6931195", "0.68912286", "0.68617904", "0.6857166", "0.6720681", "0.6656916", "0.6654753", "0.6615872", "0.66134626", "0.65902686", "0.6586722", "0.64839727", "0.6481609", "0.64732903", "0.6472588"...
0.0
-1
CurrencyByCurrency get currency by currency
func (currencies currencies) CurrencyByCurrency(curr string) (currency, bool) { for _, c := range currencies { if string(c.currency) == curr { return c, true } } return currency{}, false }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "func ByCurrency(currency Currency) (c currency, ok bool) {\n\tc, ok = currenciesByCurrency[currency.String()]\n\treturn\n}", "func GetCurrency(code Code) (c Currency, ok bool) {\n\tok = false\n\tif !code.IsValid() {\n\t\treturn\n\t}\n\n\tc, ok = currenciesByCode[code]\n\treturn\n}", "func (h *HitBTC) GetCurren...
[ "0.712126", "0.6747095", "0.67326546", "0.66519374", "0.64402825", "0.6391166", "0.6330754", "0.6322158", "0.6318228", "0.63087094", "0.62615204", "0.6257262", "0.6242342", "0.6214747", "0.614413", "0.61223215", "0.6066883", "0.6050893", "0.604564", "0.60454744", "0.6022849",...
0.72543776
0
CurrencyByCode gets currency by code
func (currencies currencies) CurrencyByCode(code string) (currency, bool) { for _, c := range currencies { if string(c.code) == code { return c, true } } return currency{}, false }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "func ByCode(code Code) (c currency, ok bool) {\n\tc, ok = currenciesByCode[code.String()]\n\treturn\n}", "func (s *Currencies) FindByCode(code string) (*models.Currency, error) {\n\tvar currency models.Currency\n\n\terr := s.db.Where(\"code = ?\", code).FirstOrInit(&currency).Error\n\n\treturn &currency, err\n}"...
[ "0.77351403", "0.74289626", "0.7260116", "0.7163229", "0.69392973", "0.6830337", "0.67866826", "0.67462707", "0.6739368", "0.669114", "0.6622207", "0.65072155", "0.6408006", "0.6378446", "0.6357323", "0.63329697", "0.6305248", "0.6265441", "0.62562954", "0.61683005", "0.61658...
0.7806417
0
CurrencyByNumber gets currency by number
func (currencies currencies) CurrencyByNumber(number string) (currency, bool) { for _, c := range currencies { if string(c.number) == number { return c, true } } return currency{}, false }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "func ByNumber(number Number) (c currency, ok bool) {\n\tc, ok = currenciesByNumber[number.String()]\n\treturn\n}", "func ByNumberStr(number string) (c currency, ok bool) {\n\tc, ok = currenciesByNumber[number]\n\treturn\n}", "func Currency() *CurrencyInfo {\n\tindex := rand.Intn(len(data.Data()[\"currency\"][\...
[ "0.74653196", "0.68633723", "0.6495746", "0.6428904", "0.63087445", "0.6232836", "0.6177459", "0.6165097", "0.5944682", "0.59029067", "0.588898", "0.5877524", "0.5839041", "0.583721", "0.58142686", "0.58103347", "0.57569075", "0.5723884", "0.57216394", "0.56859946", "0.562979...
0.7446671
1
ByCodeStr lookup for currency type by code
func ByCodeStr(code string) (c currency, ok bool) { c, ok = currenciesByCode[code] return }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "func ByCode(code Code) (c currency, ok bool) {\n\tc, ok = currenciesByCode[code.String()]\n\treturn\n}", "func ByCodeStrErr(code string) (c currency, err error) {\n\tvar ok bool\n\tc, ok = currenciesByCode[code]\n\n\tif !ok {\n\t\treturn currency{}, fmt.Errorf(\"'%s' is not valid ISO-4217 code\", code)\n\t}\n\n\...
[ "0.73103803", "0.6828898", "0.6659425", "0.64761", "0.6436941", "0.6435694", "0.64262456", "0.6325654", "0.624168", "0.62250626", "0.60374033", "0.59841007", "0.56001306", "0.55955267", "0.5517457", "0.5515457", "0.5472482", "0.54600394", "0.5382138", "0.5378068", "0.5372913"...
0.7808488
0
ByCurrencyStr lookup for currency type by currency
func ByCurrencyStr(currency string) (c currency, ok bool) { c, ok = currenciesByCurrency[currency] return }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "func ByCountryStr(country string) (c currencies, ok bool) {\n\tc, ok = currenciesByCountry[country]\n\treturn\n}", "func ByCodeStr(code string) (c currency, ok bool) {\n\tc, ok = currenciesByCode[code]\n\treturn\n}", "func ByNumberStr(number string) (c currency, ok bool) {\n\tc, ok = currenciesByNumber[number]...
[ "0.68975925", "0.6786371", "0.67324406", "0.6673408", "0.6592272", "0.6533355", "0.6397389", "0.6046408", "0.59839725", "0.5982539", "0.59611624", "0.5863553", "0.5841928", "0.5815756", "0.5796604", "0.5770695", "0.5715139", "0.56904584", "0.5637685", "0.548118", "0.5476843",...
0.78283846
0
ByNumberStr lookup for currency type by number
func ByNumberStr(number string) (c currency, ok bool) { c, ok = currenciesByNumber[number] return }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "func ByNumber(number Number) (c currency, ok bool) {\n\tc, ok = currenciesByNumber[number.String()]\n\treturn\n}", "func ByNumberStrErr(number string) (c currency, err error) {\n\tvar ok bool\n\tc, ok = currenciesByNumber[number]\n\n\tif !ok {\n\t\treturn currency{}, fmt.Errorf(\"'%s' is not valid ISO-4217 numbe...
[ "0.6817933", "0.65723807", "0.6502705", "0.6447706", "0.6443985", "0.5979146", "0.5968836", "0.57494783", "0.574361", "0.56470025", "0.5584685", "0.5536671", "0.55269", "0.54442865", "0.54131377", "0.5378354", "0.53639525", "0.530616", "0.5285936", "0.52613264", "0.52027345",...
0.7869854
0
ByCountryStr lookup for currencies type by country
func ByCountryStr(country string) (c currencies, ok bool) { c, ok = currenciesByCountry[country] return }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "func ByCountry(country Country) (c currencies, ok bool) {\n\tc, ok = currenciesByCountry[country.String()]\n\treturn\n}", "func ByCountryStrErr(country string) (c currencies, err error) {\n\tvar ok bool\n\tc, ok = currenciesByCountry[country]\n\n\tif !ok {\n\t\treturn nil, fmt.Errorf(\"'%s' is not valid ISO-4217...
[ "0.7116249", "0.6771441", "0.6448623", "0.61640435", "0.60912514", "0.56510687", "0.562963", "0.56018627", "0.55800307", "0.54929966", "0.54818165", "0.5421905", "0.53713953", "0.53572464", "0.5337062", "0.53153455", "0.5249796", "0.52379555", "0.5210464", "0.51556665", "0.51...
0.8230134
0
ByCodeStrErr lookup for currency type by code
func ByCodeStrErr(code string) (c currency, err error) { var ok bool c, ok = currenciesByCode[code] if !ok { return currency{}, fmt.Errorf("'%s' is not valid ISO-4217 code", code) } return }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "func ByCodeErr(code Code) (c currency, err error) {\n\tvar ok bool\n\tc, ok = currenciesByCode[code.String()]\n\n\tif !ok {\n\t\treturn currency{}, fmt.Errorf(\"'%s' is not valid ISO-4217 code\", code)\n\t}\n\n\treturn\n}", "func ByCodeStr(code string) (c currency, ok bool) {\n\tc, ok = currenciesByCode[code]\n\...
[ "0.7749114", "0.6958004", "0.662515", "0.65252256", "0.6470898", "0.64441013", "0.6224553", "0.6029232", "0.59684896", "0.5962775", "0.58444315", "0.5785742", "0.57549185", "0.5750396", "0.57261664", "0.56605464", "0.56460124", "0.56161344", "0.56147873", "0.5612118", "0.5604...
0.7907018
0
ByCurrencyStrErr lookup for currency type by currency
func ByCurrencyStrErr(currencyStr string) (c currency, err error) { var ok bool c, ok = currenciesByCurrency[currencyStr] if !ok { return currency{}, fmt.Errorf("'%s' is not valid ISO-4217 currency", currencyStr) } return }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "func ByCurrencyErr(currencyStr Currency) (c currency, err error) {\n\tvar ok bool\n\tc, ok = currenciesByCurrency[currencyStr.String()]\n\n\tif !ok {\n\t\treturn currency{}, fmt.Errorf(\"'%s' is not valid ISO-4217 currency\", currencyStr)\n\t}\n\n\treturn\n}", "func ByCountryStrErr(country string) (c currencies,...
[ "0.791155", "0.7033588", "0.6906172", "0.68585384", "0.67705154", "0.6440552", "0.63040984", "0.6203238", "0.6036318", "0.5979185", "0.58646864", "0.5829881", "0.58076686", "0.5793948", "0.5785826", "0.5701816", "0.56405437", "0.5605415", "0.5544147", "0.55334294", "0.5348575...
0.78136224
1
ByNumberStrErr lookup for currency type by number
func ByNumberStrErr(number string) (c currency, err error) { var ok bool c, ok = currenciesByNumber[number] if !ok { return currency{}, fmt.Errorf("'%s' is not valid ISO-4217 number", number) } return }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "func ByNumberErr(number Number) (c currency, err error) {\n\tvar ok bool\n\tc, ok = currenciesByNumber[number.String()]\n\n\tif !ok {\n\t\treturn currency{}, fmt.Errorf(\"'%s' is not valid ISO-4217 number\", number)\n\t}\n\n\treturn\n}", "func ByNumberStr(number string) (c currency, ok bool) {\n\tc, ok = currenc...
[ "0.7464267", "0.701826", "0.66607094", "0.66269207", "0.6476945", "0.6183518", "0.6154435", "0.59164727", "0.5779423", "0.57048374", "0.55546963", "0.5391889", "0.53823334", "0.5304725", "0.5281949", "0.5280108", "0.52798015", "0.5269731", "0.5257536", "0.51309687", "0.510625...
0.7802311
0
ByCountryStrErr lookup for currencies type by country
func ByCountryStrErr(country string) (c currencies, err error) { var ok bool c, ok = currenciesByCountry[country] if !ok { return nil, fmt.Errorf("'%s' is not valid ISO-4217 country", country) } return }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "func ByCountryErr(country Country) (c currencies, err error) {\n\tvar ok bool\n\tc, ok = currenciesByCountry[country.String()]\n\n\tif !ok {\n\t\treturn nil, fmt.Errorf(\"'%s' is not valid ISO-4217 country\", country)\n\t}\n\n\treturn\n}", "func ByCountryStr(country string) (c currencies, ok bool) {\n\tc, ok = c...
[ "0.7716239", "0.746525", "0.6514391", "0.6457357", "0.64152604", "0.6158099", "0.5888997", "0.5701336", "0.56703097", "0.5649593", "0.56475663", "0.56095713", "0.551954", "0.5500617", "0.54689586", "0.5342147", "0.53403157", "0.53308916", "0.53119993", "0.5272928", "0.5260263...
0.8191458
0
ByCode lookup for currency type by code
func ByCode(code Code) (c currency, ok bool) { c, ok = currenciesByCode[code.String()] return }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "func (currencies currencies) CurrencyByCode(code string) (currency, bool) {\n\tfor _, c := range currencies {\n\t\tif string(c.code) == code {\n\t\t\treturn c, true\n\t\t}\n\t}\n\n\treturn currency{}, false\n}", "func ByCodeStr(code string) (c currency, ok bool) {\n\tc, ok = currenciesByCode[code]\n\treturn\n}",...
[ "0.711305", "0.70005816", "0.68633837", "0.64822996", "0.6429585", "0.63299453", "0.62102735", "0.61856073", "0.58091164", "0.58040273", "0.57661283", "0.57386893", "0.5727519", "0.56891936", "0.5676841", "0.56753325", "0.56372035", "0.56358904", "0.5599372", "0.55699724", "0...
0.77860105
0
ByCurrency lookup for currency type by currency
func ByCurrency(currency Currency) (c currency, ok bool) { c, ok = currenciesByCurrency[currency.String()] return }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "func (currencies currencies) CurrencyByCurrency(curr string) (currency, bool) {\n\tfor _, c := range currencies {\n\t\tif string(c.currency) == curr {\n\t\t\treturn c, true\n\t\t}\n\t}\n\n\treturn currency{}, false\n}", "func ByCurrencyStr(currency string) (c currency, ok bool) {\n\tc, ok = currenciesByCurrency[...
[ "0.6820611", "0.65810734", "0.61428577", "0.6023269", "0.60230213", "0.5916888", "0.58960956", "0.58749396", "0.5846241", "0.578117", "0.57568413", "0.5741295", "0.5740566", "0.57186496", "0.567756", "0.55976605", "0.55669355", "0.5535557", "0.55213594", "0.5449528", "0.54434...
0.7225508
0
ByNumber lookup for currency type by number
func ByNumber(number Number) (c currency, ok bool) { c, ok = currenciesByNumber[number.String()] return }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "func ByNumberStr(number string) (c currency, ok bool) {\n\tc, ok = currenciesByNumber[number]\n\treturn\n}", "func (currencies currencies) CurrencyByNumber(number string) (currency, bool) {\n\tfor _, c := range currencies {\n\t\tif string(c.number) == number {\n\t\t\treturn c, true\n\t\t}\n\t}\n\n\treturn curren...
[ "0.6928493", "0.68912613", "0.6297232", "0.617345", "0.58834743", "0.5832352", "0.58096915", "0.5701448", "0.5588778", "0.5461972", "0.53230804", "0.53069794", "0.5248212", "0.51886237", "0.51393116", "0.50860757", "0.50569624", "0.5041218", "0.5023148", "0.50179917", "0.4962...
0.7456256
0
ByCountry lookup for currency type by country
func ByCountry(country Country) (c currencies, ok bool) { c, ok = currenciesByCountry[country.String()] return }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "func ByCountryStr(country string) (c currencies, ok bool) {\n\tc, ok = currenciesByCountry[country]\n\treturn\n}", "func ByCountryErr(country Country) (c currencies, err error) {\n\tvar ok bool\n\tc, ok = currenciesByCountry[country.String()]\n\n\tif !ok {\n\t\treturn nil, fmt.Errorf(\"'%s' is not valid ISO-4217...
[ "0.7243346", "0.6430731", "0.5919585", "0.5860527", "0.58262354", "0.5715987", "0.56672966", "0.56334823", "0.5629747", "0.5584398", "0.553167", "0.54191345", "0.5390111", "0.535436", "0.5313098", "0.5309947", "0.53078055", "0.5307197", "0.52507395", "0.52407664", "0.5229729"...
0.76937616
0
ByCodeErr lookup for currency type by code
func ByCodeErr(code Code) (c currency, err error) { var ok bool c, ok = currenciesByCode[code.String()] if !ok { return currency{}, fmt.Errorf("'%s' is not valid ISO-4217 code", code) } return }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "func ByCodeStrErr(code string) (c currency, err error) {\n\tvar ok bool\n\tc, ok = currenciesByCode[code]\n\n\tif !ok {\n\t\treturn currency{}, fmt.Errorf(\"'%s' is not valid ISO-4217 code\", code)\n\t}\n\n\treturn\n}", "func ByCode(code Code) (c currency, ok bool) {\n\tc, ok = currenciesByCode[code.String()]\n\...
[ "0.72557294", "0.69156337", "0.6348125", "0.6243849", "0.62317413", "0.6062725", "0.6021445", "0.6007123", "0.59874946", "0.59745944", "0.5952912", "0.5939566", "0.59384495", "0.5903402", "0.58690673", "0.58429134", "0.58231896", "0.5818882", "0.5784363", "0.5783797", "0.5762...
0.8068545
0
ByCurrencyErr lookup for currencies type by code
func ByCurrencyErr(currencyStr Currency) (c currency, err error) { var ok bool c, ok = currenciesByCurrency[currencyStr.String()] if !ok { return currency{}, fmt.Errorf("'%s' is not valid ISO-4217 currency", currencyStr) } return }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "func ByCodeErr(code Code) (c currency, err error) {\n\tvar ok bool\n\tc, ok = currenciesByCode[code.String()]\n\n\tif !ok {\n\t\treturn currency{}, fmt.Errorf(\"'%s' is not valid ISO-4217 code\", code)\n\t}\n\n\treturn\n}", "func ByCodeStrErr(code string) (c currency, err error) {\n\tvar ok bool\n\tc, ok = curre...
[ "0.73201984", "0.6735376", "0.6608469", "0.65929776", "0.6350844", "0.6255838", "0.6243447", "0.6242924", "0.622392", "0.61914283", "0.5953313", "0.59486204", "0.5942135", "0.59157544", "0.5864772", "0.5721525", "0.57012635", "0.5698221", "0.5652568", "0.5614737", "0.5614035"...
0.7103866
1
ByNumberErr lookup for currencies type by number
func ByNumberErr(number Number) (c currency, err error) { var ok bool c, ok = currenciesByNumber[number.String()] if !ok { return currency{}, fmt.Errorf("'%s' is not valid ISO-4217 number", number) } return }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "func ByNumberStrErr(number string) (c currency, err error) {\n\tvar ok bool\n\tc, ok = currenciesByNumber[number]\n\n\tif !ok {\n\t\treturn currency{}, fmt.Errorf(\"'%s' is not valid ISO-4217 number\", number)\n\t}\n\n\treturn\n}", "func ByNumber(number Number) (c currency, ok bool) {\n\tc, ok = currenciesByNumb...
[ "0.68148583", "0.6639139", "0.6220518", "0.6076349", "0.5943517", "0.5899749", "0.5606017", "0.5513069", "0.5377606", "0.5259354", "0.5212386", "0.51051205", "0.50797594", "0.5073507", "0.5073319", "0.5038484", "0.49862245", "0.49223855", "0.48956224", "0.48798838", "0.486761...
0.7502478
0
ByCountryErr lookup for currencies type by country
func ByCountryErr(country Country) (c currencies, err error) { var ok bool c, ok = currenciesByCountry[country.String()] if !ok { return nil, fmt.Errorf("'%s' is not valid ISO-4217 country", country) } return }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "func ByCountryStrErr(country string) (c currencies, err error) {\n\tvar ok bool\n\tc, ok = currenciesByCountry[country]\n\n\tif !ok {\n\t\treturn nil, fmt.Errorf(\"'%s' is not valid ISO-4217 country\", country)\n\t}\n\n\treturn\n}", "func ByCountry(country Country) (c currencies, ok bool) {\n\tc, ok = currencies...
[ "0.7554859", "0.6782914", "0.66101635", "0.6152723", "0.59113085", "0.584685", "0.5671783", "0.5669322", "0.55411214", "0.5414264", "0.5399832", "0.5392362", "0.53908765", "0.5350927", "0.53391033", "0.532064", "0.53134775", "0.5284964", "0.5261415", "0.5257611", "0.5256462",...
0.81207436
0
Schema returns a schema name in SQL database ("").
func (v *actorInfoViewType) Schema() string { return v.s.SQLSchema }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "func (stmt *Statement) Schema() string {\n\tif stmt.ObjectQualifier != \"\" {\n\t\treturn stmt.ObjectQualifier\n\t}\n\treturn stmt.DefaultDatabase\n}", "func (p Postgres) Schema() string {\n\tif p.schema != \"\" {\n\t\treturn p.schema\n\t}\n\treturn getDefaultValue(p, \"schema\")\n}", "func (*ShowDatabases) Sc...
[ "0.7783269", "0.7636865", "0.74002093", "0.7219923", "0.72162557", "0.71864945", "0.7090756", "0.7027028", "0.6954281", "0.69507444", "0.6936371", "0.69134814", "0.68763167", "0.6818516", "0.6762529", "0.6755347", "0.6718388", "0.66764885", "0.66666335", "0.65712553", "0.6550...
0.66925526
17
Name returns a view or table name in SQL database ("actor_info").
func (v *actorInfoViewType) Name() string { return v.s.SQLName }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "func (v *pgStatDatabaseViewType) Name() string {\n\treturn v.s.SQLName\n}", "func (*View) Name() string { return \"view\" }", "func (v *pgUserViewType) Name() string {\n\treturn v.s.SQLName\n}", "func (v *View) ViewName() string { return v.viewName }", "func (v *nicerButSlowerFilmListViewType) Name() strin...
[ "0.70319706", "0.7025239", "0.6951003", "0.67236215", "0.6599698", "0.6525693", "0.64955735", "0.64427733", "0.64427733", "0.63724196", "0.61963934", "0.60590583", "0.6024301", "0.6006662", "0.5940104", "0.58838356", "0.58816934", "0.5837826", "0.58248645", "0.57685894", "0.5...
0.78057486
0
Columns returns a new slice of column names for that view or table in SQL database.
func (v *actorInfoViewType) Columns() []string { return []string{ "actor_id", "first_name", "last_name", "film_info", } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "func (view *CrosstabView) Columns() ([]string, error) {\n\tif view.err != nil {\n\t\treturn nil, view.err\n\t}\n\tcols := make([]string, len(view.hkeys)+1)\n\tcols[0] = view.v\n\tfor i := 0; i < len(view.hkeys); i++ {\n\t\tcols[i+1] = view.hkeys[i].v\n\t}\n\treturn cols, nil\n}", "func (d *dnfEventPrizeDao) GetC...
[ "0.7085163", "0.69049156", "0.68666506", "0.6773775", "0.67729735", "0.67571825", "0.669912", "0.669912", "0.6635047", "0.6635047", "0.66023743", "0.66006917", "0.6587278", "0.6578381", "0.6572403", "0.6563301", "0.65214026", "0.65059286", "0.6492208", "0.6483741", "0.6475978...
0.6419828
25
NewStruct makes a new struct for that view or table.
func (v *actorInfoViewType) NewStruct() reform.Struct { return new(ActorInfo) }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "func (v *libraryTableType) NewStruct() reform.Struct {\n\treturn new(Library)\n}", "func (v *pgStatDatabaseViewType) NewStruct() reform.Struct {\n\treturn new(pgStatDatabase)\n}", "func NewStruct(ty *StructType) *Struct {\n\ts := &Struct{\n\t\tty: ty,\n\t\tvalue: make(map[string]Item),\n\t}\n\n\tfor k, t :=...
[ "0.7208628", "0.7197622", "0.68504274", "0.67651767", "0.6762078", "0.67612964", "0.6731444", "0.6698641", "0.669247", "0.6645788", "0.6599662", "0.6598579", "0.654523", "0.6533609", "0.65133476", "0.6508883", "0.6505324", "0.6458471", "0.64527214", "0.6429975", "0.64195675",...
0.6958512
2
String returns a string representation of this struct or record.
func (s ActorInfo) String() string { res := make([]string, 4) res[0] = "ActorID: " + reform.Inspect(s.ActorID, true) res[1] = "FirstName: " + reform.Inspect(s.FirstName, true) res[2] = "LastName: " + reform.Inspect(s.LastName, true) res[3] = "FilmInfo: " + reform.Inspect(s.FilmInfo, true) return strings.Join(res, ", ") }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "func (s Record) String() string {\n\treturn awsutil.Prettify(s)\n}", "func (r *Record) String() string {\n\tend := r.End()\n\treturn fmt.Sprintf(\"%s %v %v %d %s:%d..%d (%d) %d %s:%d %d %s %v %v\",\n\t\tr.Name,\n\t\tr.Flags,\n\t\tr.Cigar,\n\t\tr.MapQ,\n\t\tr.Ref.Name(),\n\t\tr.Pos,\n\t\tend,\n\t\tr.Bin(),\n\t\te...
[ "0.77077574", "0.76104605", "0.75756145", "0.74553204", "0.7451299", "0.7217998", "0.7195485", "0.71748054", "0.711455", "0.710375", "0.7094485", "0.7086003", "0.7044672", "0.7040539", "0.6959524", "0.6956746", "0.69413435", "0.69298464", "0.6917857", "0.69000095", "0.6887534...
0.0
-1
View returns View object for that struct.
func (s *ActorInfo) View() reform.View { return ActorInfoView }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "func (db *DB) View(ddoc, view string, result interface{}, opts Options) error {\n\tddoc = strings.Replace(ddoc, \"_design/\", \"\", 1)\n\tpath, err := optpath(opts, viewJsonKeys, db.name, \"_design\", ddoc, \"_view\", view)\n\tif err != nil {\n\t\treturn err\n\t}\n\tresp, err := db.request(db.ctx, \"GET\", path, n...
[ "0.68859226", "0.6793776", "0.67661506", "0.67110616", "0.65003264", "0.64739406", "0.6467204", "0.64412266", "0.64138675", "0.6390512", "0.63750994", "0.6260405", "0.62450373", "0.6238107", "0.6209322", "0.6173822", "0.61601686", "0.6104211", "0.6025274", "0.6023296", "0.600...
0.6901212
0
GetMarginRates gets margin rates
func (h *HUOBI) GetMarginRates(ctx context.Context, symbol currency.Pair) (MarginRatesData, error) { var resp MarginRatesData vals := url.Values{} if !symbol.IsEmpty() { symbolValue, err := h.FormatSymbol(symbol, asset.Spot) if err != nil { return resp, err } vals.Set("symbol", symbolValue) } return resp, h.SendAuthenticatedHTTPRequest(ctx, exchange.RestSpot, http.MethodGet, huobiMarginRates, vals, nil, &resp, false) }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "func (ci converterInfo) Rates() *map[string]map[string]float64 {\n\treturn ci.rates\n}", "func (p Provider) getRatesFromResponse(body []byte) (map[string]float64, map[string]float64, time.Time, error) {\n\tvar (\n\t\terr error\n\t\tapiJson model.SuccessApiResponse\n\t\tdirectRat...
[ "0.54712915", "0.52787596", "0.5275388", "0.52186406", "0.51040155", "0.5097", "0.5015672", "0.49543777", "0.4946414", "0.49171793", "0.49167514", "0.48848617", "0.48729435", "0.4844471", "0.48423526", "0.4831846", "0.48296964", "0.48107427", "0.47966403", "0.47797173", "0.47...
0.7426654
0
GetSpotKline returns kline data KlinesRequestParams contains symbol currency.Pair, period and size
func (h *HUOBI) GetSpotKline(ctx context.Context, arg KlinesRequestParams) ([]KlineItem, error) { vals := url.Values{} symbolValue, err := h.FormatSymbol(arg.Symbol, asset.Spot) if err != nil { return nil, err } vals.Set("symbol", symbolValue) vals.Set("period", arg.Period) if arg.Size != 0 { vals.Set("size", strconv.Itoa(arg.Size)) } type response struct { Response Data []KlineItem `json:"data"` } var result response err = h.SendHTTPRequest(ctx, exchange.RestSpot, common.EncodeURLValues(huobiMarketHistoryKline, vals), &result) if result.ErrorMessage != "" { return nil, errors.New(result.ErrorMessage) } return result.Data, err }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "func (h *HUOBIHADAX) GetSpotKline(arg KlinesRequestParams) ([]KlineItem, error) {\n\tvals := url.Values{}\n\tvals.Set(\"symbol\", arg.Symbol)\n\tvals.Set(\"period\", string(arg.Period))\n\n\tif arg.Size != 0 {\n\t\tvals.Set(\"size\", strconv.Itoa(arg.Size))\n\t}\n\n\ttype response struct {\n\t\tResponse\n\t\tData ...
[ "0.67138237", "0.66007125", "0.64088297", "0.6191798", "0.56293464", "0.56253314", "0.55883294", "0.553392", "0.55242205", "0.53931427", "0.5123226", "0.5024441", "0.4991342", "0.49328083", "0.4908834", "0.48196834", "0.48113474", "0.47260907", "0.47260556", "0.4642228", "0.4...
0.67117244
1
Get24HrMarketSummary returns 24hr market summary for a given market symbol
func (h *HUOBI) Get24HrMarketSummary(ctx context.Context, symbol currency.Pair) (MarketSummary24Hr, error) { var result MarketSummary24Hr params := url.Values{} symbolValue, err := h.FormatSymbol(symbol, asset.Spot) if err != nil { return result, err } params.Set("symbol", symbolValue) return result, h.SendHTTPRequest(ctx, exchange.RestSpot, huobi24HrMarketSummary+params.Encode(), &result) }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "func (h *HUOBI) GetMarketDetail(ctx context.Context, symbol currency.Pair) (Detail, error) {\n\tvals := url.Values{}\n\tsymbolValue, err := h.FormatSymbol(symbol, asset.Spot)\n\tif err != nil {\n\t\treturn Detail{}, err\n\t}\n\tvals.Set(\"symbol\", symbolValue)\n\n\ttype response struct {\n\t\tResponse\n\t\tTick D...
[ "0.55780244", "0.5537733", "0.5334831", "0.51851654", "0.51605296", "0.4856593", "0.4765028", "0.46983725", "0.46772322", "0.46315122", "0.45058358", "0.4498733", "0.4488088", "0.44808736", "0.4415156", "0.43936917", "0.4388997", "0.436385", "0.43553677", "0.43303472", "0.432...
0.8163198
0
GetTickers returns the ticker for the specified symbol
func (h *HUOBI) GetTickers(ctx context.Context) (Tickers, error) { var result Tickers return result, h.SendHTTPRequest(ctx, exchange.RestSpot, huobiMarketTickers, &result) }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "func (e *Bitfinex) GetTickers() (*Tickers, error) {\n\tclient := rest.NewClient()\n\tbookTickers, err := client.Tickers.All()\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\ttickers := NewTickers(len(*bookTickers))\n\tfor _, ticker := range *bookTickers {\n\t\tsymbol := ticker.Symbol\n\t\tif len(symbol) == 0 || ...
[ "0.7233842", "0.69541305", "0.67868614", "0.6781976", "0.6696683", "0.6648738", "0.6512607", "0.64099586", "0.6363949", "0.63361305", "0.6307165", "0.6276918", "0.626765", "0.6240822", "0.6217349", "0.6207242", "0.62066466", "0.61970997", "0.6148071", "0.6105411", "0.5991007"...
0.65373147
6
GetMarketDetailMerged returns the ticker for the specified symbol
func (h *HUOBI) GetMarketDetailMerged(ctx context.Context, symbol currency.Pair) (DetailMerged, error) { vals := url.Values{} symbolValue, err := h.FormatSymbol(symbol, asset.Spot) if err != nil { return DetailMerged{}, err } vals.Set("symbol", symbolValue) type response struct { Response Tick DetailMerged `json:"tick"` } var result response err = h.SendHTTPRequest(ctx, exchange.RestSpot, common.EncodeURLValues(huobiMarketDetailMerged, vals), &result) if result.ErrorMessage != "" { return result.Tick, errors.New(result.ErrorMessage) } return result.Tick, err }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "func (h *HUOBIHADAX) GetMarketDetailMerged(symbol string) (DetailMerged, error) {\n\tvals := url.Values{}\n\tvals.Set(\"symbol\", symbol)\n\n\ttype response struct {\n\t\tResponse\n\t\tTick DetailMerged `json:\"tick\"`\n\t}\n\n\tvar result response\n\turlPath := fmt.Sprintf(\"%s/%s\", h.APIUrl, huobihadaxMarketDet...
[ "0.8255225", "0.65050185", "0.6322203", "0.56942534", "0.5553249", "0.5543869", "0.5449716", "0.54233116", "0.5400529", "0.5382314", "0.5321258", "0.5321083", "0.5201834", "0.51908404", "0.51829964", "0.51211035", "0.5110207", "0.50944126", "0.5091702", "0.5042947", "0.503989...
0.79985017
1
GetDepth returns the depth for the specified symbol
func (h *HUOBI) GetDepth(ctx context.Context, obd *OrderBookDataRequestParams) (*Orderbook, error) { symbolValue, err := h.FormatSymbol(obd.Symbol, asset.Spot) if err != nil { return nil, err } vals := url.Values{} vals.Set("symbol", symbolValue) if obd.Type != OrderBookDataRequestParamsTypeNone { vals.Set("type", string(obd.Type)) } type response struct { Response Depth Orderbook `json:"tick"` } var result response err = h.SendHTTPRequest(ctx, exchange.RestSpot, common.EncodeURLValues(huobiMarketDepth, vals), &result) if result.ErrorMessage != "" { return nil, errors.New(result.ErrorMessage) } return &result.Depth, err }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "func (o *Dig) GetDepth() int32 {\n\tif o == nil {\n\t\tvar ret int32\n\t\treturn ret\n\t}\n\n\treturn o.Depth\n}", "func Depth(e expr.Expr) uint {\n\t//fmt.Printf(\"%f\\n\",e)\n\t// TODO: implement this function\n\tswitch i:= e.(type){\n\tcase expr.Var:\n\n\tcase expr.Literal:\n\n\tcase expr.Unary:\n\t\treturn D...
[ "0.7089582", "0.6523248", "0.649192", "0.64471996", "0.6439405", "0.6403592", "0.63978463", "0.63439864", "0.62823826", "0.6259164", "0.6158828", "0.6070787", "0.60601467", "0.6042089", "0.60263443", "0.58882874", "0.58837485", "0.5771903", "0.57704747", "0.5755861", "0.57555...
0.63631207
7
GetTrades returns the trades for the specified symbol
func (h *HUOBI) GetTrades(ctx context.Context, symbol currency.Pair) ([]Trade, error) { vals := url.Values{} symbolValue, err := h.FormatSymbol(symbol, asset.Spot) if err != nil { return nil, err } vals.Set("symbol", symbolValue) type response struct { Response Tick struct { Data []Trade `json:"data"` } `json:"tick"` } var result response err = h.SendHTTPRequest(ctx, exchange.RestSpot, common.EncodeURLValues(huobiMarketTrade, vals), &result) if result.ErrorMessage != "" { return nil, errors.New(result.ErrorMessage) } return result.Tick.Data, err }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "func (h *HUOBIHADAX) GetTrades(symbol string) ([]Trade, error) {\n\tvals := url.Values{}\n\tvals.Set(\"symbol\", symbol)\n\n\ttype response struct {\n\t\tResponse\n\t\tTick struct {\n\t\t\tData []Trade `json:\"data\"`\n\t\t} `json:\"tick\"`\n\t}\n\n\tvar result response\n\turlPath := fmt.Sprintf(\"%s/%s\", h.APIUr...
[ "0.77358645", "0.74462044", "0.72698647", "0.7161789", "0.7063039", "0.6877662", "0.68180925", "0.6814122", "0.66341156", "0.641439", "0.63792527", "0.631567", "0.62600946", "0.62124175", "0.6184803", "0.5992327", "0.59001803", "0.5839547", "0.5820225", "0.57762575", "0.57157...
0.7542442
1
GetLatestSpotPrice returns latest spot price of symbol symbol: string of currency pair
func (h *HUOBI) GetLatestSpotPrice(ctx context.Context, symbol currency.Pair) (float64, error) { list, err := h.GetTradeHistory(ctx, symbol, 1) if err != nil { return 0, err } if len(list) == 0 { return 0, errors.New("the length of the list is 0") } return list[0].Trades[0].Price, nil }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "func (h *HUOBIHADAX) GetLatestSpotPrice(symbol string) (float64, error) {\n\tlist, err := h.GetTradeHistory(symbol, \"1\")\n\n\tif err != nil {\n\t\treturn 0, err\n\t}\n\tif len(list) == 0 {\n\t\treturn 0, errors.New(\"the length of the list is 0\")\n\t}\n\n\treturn list[0].Trades[0].Price, nil\n}", "func getLat...
[ "0.77745754", "0.7193159", "0.666575", "0.6478049", "0.64037836", "0.63810873", "0.6332459", "0.61890215", "0.61658907", "0.615555", "0.6145192", "0.61415225", "0.6090254", "0.60899234", "0.6089614", "0.6075997", "0.6038538", "0.59489167", "0.5942223", "0.58824354", "0.587439...
0.770424
1
GetTradeHistory returns the trades for the specified symbol
func (h *HUOBI) GetTradeHistory(ctx context.Context, symbol currency.Pair, size int64) ([]TradeHistory, error) { vals := url.Values{} symbolValue, err := h.FormatSymbol(symbol, asset.Spot) if err != nil { return nil, err } vals.Set("symbol", symbolValue) if size > 0 { vals.Set("size", strconv.FormatInt(size, 10)) } type response struct { Response TradeHistory []TradeHistory `json:"data"` } var result response err = h.SendHTTPRequest(ctx, exchange.RestSpot, common.EncodeURLValues(huobiMarketTradeHistory, vals), &result) if result.ErrorMessage != "" { return nil, errors.New(result.ErrorMessage) } return result.TradeHistory, err }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "func (h *HUOBIHADAX) GetTradeHistory(symbol, size string) ([]TradeHistory, error) {\n\tvals := url.Values{}\n\tvals.Set(\"symbol\", symbol)\n\n\tif size != \"\" {\n\t\tvals.Set(\"size\", size)\n\t}\n\n\ttype response struct {\n\t\tResponse\n\t\tTradeHistory []TradeHistory `json:\"data\"`\n\t}\n\n\tvar result respo...
[ "0.774049", "0.7495697", "0.73949796", "0.72742754", "0.71751446", "0.70379996", "0.7008821", "0.69034564", "0.6860174", "0.6848418", "0.6804651", "0.6595937", "0.6560636", "0.64742374", "0.6428474", "0.63386184", "0.6329062", "0.6323354", "0.62972164", "0.6276863", "0.625543...
0.7448461
2
GetMarketDetail returns the ticker for the specified symbol
func (h *HUOBI) GetMarketDetail(ctx context.Context, symbol currency.Pair) (Detail, error) { vals := url.Values{} symbolValue, err := h.FormatSymbol(symbol, asset.Spot) if err != nil { return Detail{}, err } vals.Set("symbol", symbolValue) type response struct { Response Tick Detail `json:"tick"` } var result response err = h.SendHTTPRequest(ctx, exchange.RestSpot, common.EncodeURLValues(huobiMarketDetail, vals), &result) if result.ErrorMessage != "" { return result.Tick, errors.New(result.ErrorMessage) } return result.Tick, err }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "func (h *HUOBIHADAX) GetMarketDetail(symbol string) (Detail, error) {\n\tvals := url.Values{}\n\tvals.Set(\"symbol\", symbol)\n\n\ttype response struct {\n\t\tResponse\n\t\tTick Detail `json:\"tick\"`\n\t}\n\n\tvar result response\n\turlPath := fmt.Sprintf(\"%s/%s\", h.APIUrl, huobihadaxMarketDetail)\n\n\terr := h...
[ "0.8112884", "0.70698243", "0.66401184", "0.6608597", "0.65049994", "0.63923836", "0.63712066", "0.63195145", "0.6317771", "0.6250894", "0.6222333", "0.6180861", "0.61649966", "0.6137566", "0.61068106", "0.6099787", "0.60953355", "0.60864127", "0.5972353", "0.5950708", "0.590...
0.7900944
1
GetSymbols returns an array of symbols supported by Huobi
func (h *HUOBI) GetSymbols(ctx context.Context) ([]Symbol, error) { type response struct { Response Symbols []Symbol `json:"data"` } var result response err := h.SendHTTPRequest(ctx, exchange.RestSpot, huobiSymbols, &result) if result.ErrorMessage != "" { return nil, errors.New(result.ErrorMessage) } return result.Symbols, err }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "func (h *HUOBIHADAX) GetSymbols() ([]Symbol, error) {\n\ttype response struct {\n\t\tResponse\n\t\tSymbols []Symbol `json:\"data\"`\n\t}\n\n\tvar result response\n\turlPath := fmt.Sprintf(\"%s/v%s/%s/%s\", h.APIUrl, huobihadaxAPIVersion, huobihadaxAPIName, huobihadaxSymbols)\n\n\terr := h.SendHTTPRequest(urlPath, ...
[ "0.75294846", "0.7160797", "0.6886707", "0.68014264", "0.67673326", "0.673544", "0.6693559", "0.64586174", "0.63749856", "0.6354442", "0.6348164", "0.6332441", "0.62591314", "0.6209346", "0.60926986", "0.6064489", "0.60520715", "0.6035134", "0.59386194", "0.5895679", "0.58121...
0.74265635
1
GetCurrencies returns a list of currencies supported by Huobi
func (h *HUOBI) GetCurrencies(ctx context.Context) ([]string, error) { type response struct { Response Currencies []string `json:"data"` } var result response err := h.SendHTTPRequest(ctx, exchange.RestSpot, huobiCurrencies, &result) if result.ErrorMessage != "" { return nil, errors.New(result.ErrorMessage) } return result.Currencies, err }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "func (h *HUOBIHADAX) GetCurrencies() ([]string, error) {\n\ttype response struct {\n\t\tResponse\n\t\tCurrencies []string `json:\"data\"`\n\t}\n\n\tvar result response\n\turlPath := fmt.Sprintf(\"%s/v%s/%s/%s\", h.APIUrl, huobihadaxAPIVersion, huobihadaxAPIName, huobihadaxCurrencies)\n\n\terr := h.SendHTTPRequest(...
[ "0.7940655", "0.7914041", "0.7359975", "0.7289902", "0.72533494", "0.72454774", "0.709783", "0.6853516", "0.680497", "0.6703024", "0.66982454", "0.66967124", "0.66059655", "0.64261043", "0.6403865", "0.6106475", "0.6078244", "0.60724616", "0.59978205", "0.59853965", "0.597373...
0.8249069
0
GetCurrenciesIncludingChains returns currency and chain data
func (h *HUOBI) GetCurrenciesIncludingChains(ctx context.Context, curr currency.Code) ([]CurrenciesChainData, error) { resp := struct { Data []CurrenciesChainData `json:"data"` }{} vals := url.Values{} if !curr.IsEmpty() { vals.Set("currency", curr.Lower().String()) } path := common.EncodeURLValues(huobiCurrenciesReference, vals) err := h.SendHTTPRequest(ctx, exchange.RestSpot, path, &resp) if err != nil { return nil, err } return resp.Data, nil }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "func (p *Poloniex) GetCurrencies(ctx context.Context) (map[string]*Currencies, error) {\n\ttype Response struct {\n\t\tData map[string]*Currencies\n\t}\n\tresp := Response{}\n\treturn resp.Data, p.SendHTTPRequest(ctx,\n\t\texchange.RestSpot,\n\t\t\"/public?command=returnCurrencies&includeMultiChainCurrencies=true\...
[ "0.6466333", "0.6206367", "0.60474086", "0.60303265", "0.60085416", "0.58764243", "0.58675426", "0.57580274", "0.5713741", "0.5682365", "0.5654221", "0.564269", "0.5568197", "0.5563465", "0.5478817", "0.54718465", "0.5429817", "0.53818154", "0.53504306", "0.53450036", "0.5321...
0.79641265
0
GetCurrentServerTime returns the Huobi server time
func (h *HUOBI) GetCurrentServerTime(ctx context.Context) (time.Time, error) { var result struct { Response Timestamp int64 `json:"data"` } err := h.SendHTTPRequest(ctx, exchange.RestSpot, "/v"+huobiAPIVersion+"/"+huobiTimestamp, &result) if result.ErrorMessage != "" { return time.Time{}, errors.New(result.ErrorMessage) } return time.UnixMilli(result.Timestamp), err }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "func (b *ByBit) GetServerTime() (timeNow int64, err error) {\n\tparams := map[string]interface{}{}\n\tvar ret BaseResult\n\t_, err = b.PublicRequest(http.MethodGet, \"v2/public/time\", params, &ret)\n\tif err != nil {\n\t\treturn\n\t}\n\tvar t float64\n\tt, err = strconv.ParseFloat(ret.TimeNow, 64)\n\tif err != ni...
[ "0.74922496", "0.7441755", "0.73424494", "0.7115304", "0.70538753", "0.6963024", "0.6384371", "0.6375798", "0.628768", "0.626892", "0.6084976", "0.6065404", "0.59435916", "0.5934524", "0.5934524", "0.59177524", "0.5914358", "0.5840831", "0.5821712", "0.5816911", "0.5772398", ...
0.82223976
0
GetAccounts returns the Huobi user accounts
func (h *HUOBI) GetAccounts(ctx context.Context) ([]Account, error) { result := struct { Accounts []Account `json:"data"` }{} err := h.SendAuthenticatedHTTPRequest(ctx, exchange.RestSpot, http.MethodGet, huobiAccounts, url.Values{}, nil, &result, false) return result.Accounts, err }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "func (h *HUOBIHADAX) GetAccounts() ([]Account, error) {\n\ttype response struct {\n\t\tResponse\n\t\tAccountData []Account `json:\"data\"`\n\t}\n\n\tvar result response\n\terr := h.SendAuthenticatedHTTPRequest(http.MethodGet, huobihadaxAccounts, url.Values{}, &result)\n\n\tif result.ErrorMessage != \"\" {\n\t\tret...
[ "0.74113905", "0.7391975", "0.7164754", "0.7095255", "0.70190525", "0.6981187", "0.6962625", "0.6887199", "0.67971075", "0.67842317", "0.67434764", "0.66493773", "0.6630689", "0.6626408", "0.6601694", "0.6565802", "0.65299225", "0.6493446", "0.6492428", "0.6472309", "0.644711...
0.7695345
0
GetAccountBalance returns the users Huobi account balance
func (h *HUOBI) GetAccountBalance(ctx context.Context, accountID string) ([]AccountBalanceDetail, error) { result := struct { AccountBalanceData AccountBalance `json:"data"` }{} endpoint := fmt.Sprintf(huobiAccountBalance, accountID) v := url.Values{} v.Set("account-id", accountID) err := h.SendAuthenticatedHTTPRequest(ctx, exchange.RestSpot, http.MethodGet, endpoint, v, nil, &result, false) return result.AccountBalanceData.AccountBalanceDetails, err }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "func getAccountBal(num hedera.AccountID) float64{\n\taccountID := num\n\tclient, err := hedera.Dial(server)\n\tif err != nil{\n\t\tpanic(err)\n\t}\n\n\toperatorAccountID := hedera.AccountID{Account: 1001}\n\n\toperatorSecret,err := hedera.SecretKeyFromString(secret)\n\tif err != nil{\n\t\tpanic(err)\n\t}\n\tclient...
[ "0.7452465", "0.74295706", "0.7419697", "0.74162275", "0.74064755", "0.735374", "0.73480195", "0.7244893", "0.7216182", "0.7149386", "0.7141794", "0.71160525", "0.70873076", "0.70523936", "0.70475477", "0.7044288", "0.70184004", "0.7001416", "0.6995776", "0.6987101", "0.69842...
0.7313167
7
GetAggregatedBalance returns the balances of all the subaccount aggregated.
func (h *HUOBI) GetAggregatedBalance(ctx context.Context) ([]AggregatedBalance, error) { result := struct { AggregatedBalances []AggregatedBalance `json:"data"` }{} err := h.SendAuthenticatedHTTPRequest(ctx, exchange.RestSpot, http.MethodGet, huobiAggregatedBalance, nil, nil, &result, false, ) return result.AggregatedBalances, err }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "func (h *HUOBIHADAX) GetAggregatedBalance() ([]AggregatedBalance, error) {\n\ttype response struct {\n\t\tResponse\n\t\tAggregatedBalances []AggregatedBalance `json:\"data\"`\n\t}\n\n\tvar result response\n\n\terr := h.SendAuthenticatedHTTPRequest(\n\t\thttp.MethodGet,\n\t\thuobihadaxAggregatedBalance,\n\t\turl.Va...
[ "0.7904757", "0.6482815", "0.5996011", "0.59091663", "0.590624", "0.5835807", "0.58216393", "0.58101076", "0.5806454", "0.5773293", "0.5766585", "0.5745049", "0.5733462", "0.5720619", "0.5719984", "0.5704534", "0.56838685", "0.5669005", "0.5656682", "0.5616598", "0.5590198", ...
0.78960353
1
SpotNewOrder submits an order to Huobi
func (h *HUOBI) SpotNewOrder(ctx context.Context, arg *SpotNewOrderRequestParams) (int64, error) { symbolValue, err := h.FormatSymbol(arg.Symbol, asset.Spot) if err != nil { return 0, err } data := struct { AccountID int `json:"account-id,string"` Amount string `json:"amount"` Price string `json:"price"` Source string `json:"source"` Symbol string `json:"symbol"` Type string `json:"type"` }{ AccountID: arg.AccountID, Amount: strconv.FormatFloat(arg.Amount, 'f', -1, 64), Symbol: symbolValue, Type: string(arg.Type), } // Only set price if order type is not equal to buy-market or sell-market if arg.Type != SpotNewOrderRequestTypeBuyMarket && arg.Type != SpotNewOrderRequestTypeSellMarket { data.Price = strconv.FormatFloat(arg.Price, 'f', -1, 64) } if arg.Source != "" { data.Source = arg.Source } result := struct { OrderID int64 `json:"data,string"` }{} err = h.SendAuthenticatedHTTPRequest(ctx, exchange.RestSpot, http.MethodPost, huobiOrderPlace, nil, data, &result, false, ) return result.OrderID, err }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "func (h *HUOBIHADAX) SpotNewOrder(arg SpotNewOrderRequestParams) (int64, error) {\n\tvals := make(map[string]string)\n\tvals[\"account-id\"] = fmt.Sprintf(\"%d\", arg.AccountID)\n\tvals[\"amount\"] = strconv.FormatFloat(arg.Amount, 'f', -1, 64)\n\n\t// Only set price if order type is not equal to buy-market or sel...
[ "0.7041048", "0.67198926", "0.660019", "0.6581826", "0.6535157", "0.6426308", "0.6313448", "0.63072133", "0.6250626", "0.62356013", "0.6212552", "0.62063384", "0.61981225", "0.61631507", "0.61499107", "0.6122116", "0.612134", "0.60900116", "0.6079018", "0.60722727", "0.607117...
0.68176264
1
CancelExistingOrder cancels an order on Huobi
func (h *HUOBI) CancelExistingOrder(ctx context.Context, orderID int64) (int64, error) { resp := struct { OrderID int64 `json:"data,string"` }{} endpoint := fmt.Sprintf(huobiOrderCancel, strconv.FormatInt(orderID, 10)) err := h.SendAuthenticatedHTTPRequest(ctx, exchange.RestSpot, http.MethodPost, endpoint, url.Values{}, nil, &resp, false) return resp.OrderID, err }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "func (h *HUOBIHADAX) CancelExistingOrder(orderID int64) (int64, error) {\n\ttype response struct {\n\t\tResponse\n\t\tOrderID int64 `json:\"data,string\"`\n\t}\n\n\tvar result response\n\tendpoint := fmt.Sprintf(huobihadaxOrderCancel, strconv.FormatInt(orderID, 10))\n\terr := h.SendAuthenticatedHTTPRequest(http.Me...
[ "0.7982873", "0.7509303", "0.7477572", "0.74205244", "0.7381548", "0.7376845", "0.73706186", "0.7329423", "0.73204273", "0.7311485", "0.7295048", "0.7218077", "0.72067356", "0.7199981", "0.7152807", "0.712268", "0.7113329", "0.71112394", "0.7083864", "0.7072437", "0.7053852",...
0.80147773
0
CancelOrderBatch cancels a batch of orders
func (h *HUOBI) CancelOrderBatch(ctx context.Context, orderIDs, clientOrderIDs []string) (*CancelOrderBatch, error) { resp := struct { Response Data *CancelOrderBatch `json:"data"` }{} data := struct { ClientOrderIDs []string `json:"client-order-ids"` OrderIDs []string `json:"order-ids"` }{ ClientOrderIDs: clientOrderIDs, OrderIDs: orderIDs, } return resp.Data, h.SendAuthenticatedHTTPRequest(ctx, exchange.RestSpot, http.MethodPost, huobiOrderCancelBatch, nil, data, &resp, false) }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "func (h *HUOBIHADAX) CancelOrderBatch(orderIDs []int64) (CancelOrderBatch, error) {\n\ttype response struct {\n\t\tStatus string `json:\"status\"`\n\t\tData CancelOrderBatch `json:\"data\"`\n\t}\n\n\t// Used to send param formatting\n\ttype postBody struct {\n\t\tList []int64 `json:\"order-ids\"`\n\t}\...
[ "0.822437", "0.8103009", "0.79727215", "0.795652", "0.7638825", "0.7576727", "0.69496006", "0.68547153", "0.6806051", "0.67155564", "0.66445506", "0.65916646", "0.64911425", "0.64472646", "0.6443092", "0.6423299", "0.64134276", "0.6400897", "0.63996583", "0.6347828", "0.63314...
0.83265907
0
CancelOpenOrdersBatch cancels a batch of orders todo
func (h *HUOBI) CancelOpenOrdersBatch(ctx context.Context, accountID string, symbol currency.Pair) (CancelOpenOrdersBatch, error) { params := url.Values{} symbolValue, err := h.FormatSymbol(symbol, asset.Spot) if err != nil { return CancelOpenOrdersBatch{}, err } params.Set("account-id", accountID) var result CancelOpenOrdersBatch data := struct { AccountID string `json:"account-id"` Symbol string `json:"symbol"` }{ AccountID: accountID, Symbol: symbolValue, } err = h.SendAuthenticatedHTTPRequest(ctx, exchange.RestSpot, http.MethodPost, huobiBatchCancelOpenOrders, url.Values{}, data, &result, false) if result.Data.FailedCount > 0 { return result, fmt.Errorf("there were %v failed order cancellations", result.Data.FailedCount) } return result, err }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "func (h *HUOBIHADAX) CancelOpenOrdersBatch(accountID, symbol string) (CancelOpenOrdersBatch, error) {\n\tparams := url.Values{}\n\n\tparams.Set(\"account-id\", accountID)\n\tvar result CancelOpenOrdersBatch\n\n\tdata := struct {\n\t\tAccountID string `json:\"account-id\"`\n\t\tSymbol string `json:\"symbol\"`\n\...
[ "0.7923264", "0.77472794", "0.76979214", "0.75543076", "0.75353384", "0.75210243", "0.6732386", "0.65819687", "0.6324351", "0.614448", "0.6141224", "0.6105609", "0.61001647", "0.60601443", "0.6042365", "0.6029124", "0.6017087", "0.60033786", "0.59321886", "0.5918302", "0.5905...
0.8021356
0
GetOrder returns order information for the specified order
func (h *HUOBI) GetOrder(ctx context.Context, orderID int64) (OrderInfo, error) { resp := struct { Order OrderInfo `json:"data"` }{} urlVal := url.Values{} urlVal.Set("clientOrderId", strconv.FormatInt(orderID, 10)) err := h.SendAuthenticatedHTTPRequest(ctx, exchange.RestSpot, http.MethodGet, huobiGetOrder, urlVal, nil, &resp, false) return resp.Order, err }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "func (s *Service) GetOrder(w http.ResponseWriter, r *http.Request) {\n\t// Get the order ID\n\tvars := mux.Vars(r)\n\tid := vars[\"id\"]\n\n\t// Get the order\n\tentry, err := usecases.GetOrderByID(s.storage, id)\n\tif err != nil {\n\t\tlog.Errorf(\"GetOrder: %v\", err)\n\t\tutils.ResponseWithError(w, http.StatusB...
[ "0.8084447", "0.7766128", "0.7737722", "0.75724894", "0.7569734", "0.7559587", "0.7513443", "0.7497927", "0.7443749", "0.7427781", "0.7366409", "0.7257124", "0.72497797", "0.72425586", "0.72413254", "0.72258645", "0.71987915", "0.71626014", "0.7110712", "0.7057454", "0.705598...
0.763984
3
GetOrderMatchResults returns matched order info for the specified order
func (h *HUOBI) GetOrderMatchResults(ctx context.Context, orderID int64) ([]OrderMatchInfo, error) { resp := struct { Orders []OrderMatchInfo `json:"data"` }{} endpoint := fmt.Sprintf(huobiGetOrderMatch, strconv.FormatInt(orderID, 10)) err := h.SendAuthenticatedHTTPRequest(ctx, exchange.RestSpot, http.MethodGet, endpoint, url.Values{}, nil, &resp, false) return resp.Orders, err }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "func (h *HUOBIHADAX) GetOrderMatchResults(orderID int64) ([]OrderMatchInfo, error) {\n\ttype response struct {\n\t\tResponse\n\t\tOrders []OrderMatchInfo `json:\"data\"`\n\t}\n\n\tvar result response\n\tendpoint := fmt.Sprintf(huobihadaxGetOrderMatch, strconv.FormatInt(orderID, 10))\n\terr := h.SendAuthenticatedHT...
[ "0.7709318", "0.7545658", "0.7274498", "0.58032656", "0.5693317", "0.5657902", "0.5292344", "0.52673906", "0.5212277", "0.5204469", "0.5193957", "0.5185805", "0.5178536", "0.51722807", "0.5125284", "0.51143175", "0.5058944", "0.5037071", "0.50324965", "0.50301117", "0.499497"...
0.8005124
0
GetOrders returns a list of orders
func (h *HUOBI) GetOrders(ctx context.Context, symbol currency.Pair, types, start, end, states, from, direct, size string) ([]OrderInfo, error) { resp := struct { Orders []OrderInfo `json:"data"` }{} vals := url.Values{} symbolValue, err := h.FormatSymbol(symbol, asset.Spot) if err != nil { return nil, err } vals.Set("symbol", symbolValue) vals.Set("states", states) if types != "" { vals.Set("types", types) } if start != "" { vals.Set("start-date", start) } if end != "" { vals.Set("end-date", end) } if from != "" { vals.Set("from", from) } if direct != "" { vals.Set("direct", direct) } if size != "" { vals.Set("size", size) } err = h.SendAuthenticatedHTTPRequest(ctx, exchange.RestSpot, http.MethodGet, huobiGetOrders, vals, nil, &resp, false) return resp.Orders, err }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "func GetOrders() (orders []Orders, err error) {\r\n\tvar rows *sql.Rows\r\n\tif rows, err = Get(`select * from orders where deleted_at is null order by created_at desc;`); err != nil {\r\n\t\tCheckError(\"Error getting Orders.\", err, false)\r\n\t\treturn nil, err\r\n\t}\r\n\r\n\tdefer rows.Close()\r\n\tfor rows.N...
[ "0.8021092", "0.7939502", "0.7898351", "0.7851084", "0.7817973", "0.7680215", "0.7620534", "0.7618465", "0.7594423", "0.747957", "0.74689823", "0.74555665", "0.733778", "0.72915035", "0.7288201", "0.7277796", "0.72330827", "0.7228539", "0.72184867", "0.7187312", "0.71313196",...
0.78322846
4
GetOpenOrders returns a list of orders
func (h *HUOBI) GetOpenOrders(ctx context.Context, symbol currency.Pair, accountID, side string, size int64) ([]OrderInfo, error) { resp := struct { Orders []OrderInfo `json:"data"` }{} vals := url.Values{} symbolValue, err := h.FormatSymbol(symbol, asset.Spot) if err != nil { return nil, err } vals.Set("symbol", symbolValue) vals.Set("accountID", accountID) if len(side) > 0 { vals.Set("side", side) } vals.Set("size", strconv.FormatInt(size, 10)) err = h.SendAuthenticatedHTTPRequest(ctx, exchange.RestSpot, http.MethodGet, huobiGetOpenOrders, vals, nil, &resp, false) return resp.Orders, err }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "func GetOpenOrders() (orders []Order, error error) {\n\tjsonData, err := doTauRequest(1, \"GET\", \"trading/myopenorders/\", nil)\n\tif err != nil {\n\t\treturn nil, fmt.Errorf(\"GetOpenOrders->%v\", err)\n\t}\n\tlog.Tracef(\"jsonData=%s\", string(jsonData))\n\tif err := json.Unmarshal(jsonData, &orders); err != n...
[ "0.83499825", "0.820294", "0.8136588", "0.80742687", "0.8059319", "0.7973168", "0.7902803", "0.78767157", "0.7716815", "0.73401946", "0.719397", "0.7185342", "0.7156556", "0.6838385", "0.6812726", "0.6769861", "0.6764177", "0.66310555", "0.658563", "0.6577945", "0.6551665", ...
0.7996609
5
GetOrdersMatch returns a list of matched orders
func (h *HUOBI) GetOrdersMatch(ctx context.Context, symbol currency.Pair, types, start, end, from, direct, size string) ([]OrderMatchInfo, error) { resp := struct { Orders []OrderMatchInfo `json:"data"` }{} vals := url.Values{} symbolValue, err := h.FormatSymbol(symbol, asset.Spot) if err != nil { return nil, err } vals.Set("symbol", symbolValue) if types != "" { vals.Set("types", types) } if start != "" { vals.Set("start-date", start) } if end != "" { vals.Set("end-date", end) } if from != "" { vals.Set("from", from) } if direct != "" { vals.Set("direct", direct) } if size != "" { vals.Set("size", size) } err = h.SendAuthenticatedHTTPRequest(ctx, exchange.RestSpot, http.MethodGet, huobiGetOrdersMatch, vals, nil, &resp, false) return resp.Orders, err }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "func (h *HUOBIHADAX) GetOrdersMatch(symbol, types, start, end, from, direct, size string) ([]OrderMatchInfo, error) {\n\ttype response struct {\n\t\tResponse\n\t\tOrders []OrderMatchInfo `json:\"data\"`\n\t}\n\n\tvals := url.Values{}\n\tvals.Set(\"symbol\", symbol)\n\n\tif types != \"\" {\n\t\tvals.Set(\"types\", ...
[ "0.7789129", "0.75529885", "0.7296313", "0.63969296", "0.5923573", "0.5799041", "0.5767649", "0.5706189", "0.56900114", "0.5662897", "0.56520593", "0.56440866", "0.56375915", "0.5621133", "0.5600105", "0.55478734", "0.54957914", "0.54358935", "0.54228586", "0.5418654", "0.537...
0.8078988
0
MarginTransfer transfers assets into or out of the margin account
func (h *HUOBI) MarginTransfer(ctx context.Context, symbol currency.Pair, currency string, amount float64, in bool) (int64, error) { symbolValue, err := h.FormatSymbol(symbol, asset.Spot) if err != nil { return 0, err } data := struct { Symbol string `json:"symbol"` Currency string `json:"currency"` Amount string `json:"amount"` }{ Symbol: symbolValue, Currency: currency, Amount: strconv.FormatFloat(amount, 'f', -1, 64), } path := huobiMarginTransferIn if !in { path = huobiMarginTransferOut } resp := struct { TransferID int64 `json:"data"` }{} err = h.SendAuthenticatedHTTPRequest(ctx, exchange.RestSpot, http.MethodPost, path, nil, data, &resp, false) return resp.TransferID, err }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "func (h *HUOBIHADAX) MarginTransfer(symbol, currency string, amount float64, in bool) (int64, error) {\n\tvals := url.Values{}\n\tvals.Set(\"symbol\", symbol)\n\tvals.Set(\"currency\", currency)\n\tvals.Set(\"amount\", strconv.FormatFloat(amount, 'f', -1, 64))\n\n\tpath := huobihadaxMarginTransferIn\n\tif !in {\n\...
[ "0.6801492", "0.54919773", "0.5167506", "0.5142463", "0.5141134", "0.51354355", "0.51304615", "0.50694734", "0.50644636", "0.50561655", "0.5050912", "0.50429857", "0.5037492", "0.5036882", "0.5034344", "0.50095516", "0.49908176", "0.49833798", "0.49598277", "0.49555779", "0.4...
0.7141913
0
MarginOrder submits a margin order application
func (h *HUOBI) MarginOrder(ctx context.Context, symbol currency.Pair, currency string, amount float64) (int64, error) { symbolValue, err := h.FormatSymbol(symbol, asset.Spot) if err != nil { return 0, err } data := struct { Symbol string `json:"symbol"` Currency string `json:"currency"` Amount string `json:"amount"` }{ Symbol: symbolValue, Currency: currency, Amount: strconv.FormatFloat(amount, 'f', -1, 64), } resp := struct { MarginOrderID int64 `json:"data"` }{} err = h.SendAuthenticatedHTTPRequest(ctx, exchange.RestSpot, http.MethodPost, huobiMarginOrders, nil, data, &resp, false) return resp.MarginOrderID, err }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "func (h *HUOBIHADAX) MarginOrder(symbol, currency string, amount float64) (int64, error) {\n\tvals := url.Values{}\n\tvals.Set(\"symbol\", symbol)\n\tvals.Set(\"currency\", currency)\n\tvals.Set(\"amount\", strconv.FormatFloat(amount, 'f', -1, 64))\n\n\ttype response struct {\n\t\tResponse\n\t\tMarginOrderID int64...
[ "0.6173851", "0.6042736", "0.580337", "0.4914481", "0.48733956", "0.48561537", "0.47935137", "0.47831476", "0.47708306", "0.47530133", "0.47241613", "0.4717534", "0.46670195", "0.4662393", "0.46536615", "0.46479648", "0.45968997", "0.45933428", "0.45734856", "0.45468733", "0....
0.61538357
1
MarginRepayment repays a margin amount for a margin ID
func (h *HUOBI) MarginRepayment(ctx context.Context, orderID int64, amount float64) (int64, error) { data := struct { Amount string `json:"amount"` }{ Amount: strconv.FormatFloat(amount, 'f', -1, 64), } resp := struct { MarginOrderID int64 `json:"data"` }{} endpoint := fmt.Sprintf(huobiMarginRepay, strconv.FormatInt(orderID, 10)) err := h.SendAuthenticatedHTTPRequest(ctx, exchange.RestSpot, http.MethodPost, endpoint, nil, data, &resp, false) return resp.MarginOrderID, err }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "func (h *HUOBIHADAX) MarginRepayment(orderID int64, amount float64) (int64, error) {\n\tvals := url.Values{}\n\tvals.Set(\"order-id\", strconv.FormatInt(orderID, 10))\n\tvals.Set(\"amount\", strconv.FormatFloat(amount, 'f', -1, 64))\n\n\ttype response struct {\n\t\tResponse\n\t\tMarginOrderID int64 `json:\"data\"`...
[ "0.7938476", "0.5493116", "0.5417867", "0.5322645", "0.5245273", "0.5238542", "0.5231548", "0.52093804", "0.5093545", "0.49932605", "0.4940364", "0.49142474", "0.48920882", "0.478867", "0.47885302", "0.47826168", "0.47281605", "0.46928594", "0.46615312", "0.46386105", "0.4626...
0.7981299
0
GetMarginLoanOrders returns the margin loan orders
func (h *HUOBI) GetMarginLoanOrders(ctx context.Context, symbol currency.Pair, currency, start, end, states, from, direct, size string) ([]MarginOrder, error) { vals := url.Values{} symbolValue, err := h.FormatSymbol(symbol, asset.Spot) if err != nil { return nil, err } vals.Set("symbol", symbolValue) vals.Set("currency", currency) if start != "" { vals.Set("start-date", start) } if end != "" { vals.Set("end-date", end) } if states != "" { vals.Set("states", states) } if from != "" { vals.Set("from", from) } if direct != "" { vals.Set("direct", direct) } if size != "" { vals.Set("size", size) } resp := struct { MarginLoanOrders []MarginOrder `json:"data"` }{} err = h.SendAuthenticatedHTTPRequest(ctx, exchange.RestSpot, http.MethodGet, huobiMarginLoanOrders, vals, nil, &resp, false) return resp.MarginLoanOrders, err }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "func (h *HUOBIHADAX) GetMarginLoanOrders(symbol, currency, start, end, states, from, direct, size string) ([]MarginOrder, error) {\n\tvals := url.Values{}\n\tvals.Set(\"symbol\", symbol)\n\tvals.Set(\"currency\", currency)\n\n\tif start != \"\" {\n\t\tvals.Set(\"start-date\", start)\n\t}\n\n\tif end != \"\" {\n\t\...
[ "0.8213857", "0.66564023", "0.504801", "0.49783853", "0.49183816", "0.48903054", "0.48602033", "0.47295225", "0.46930307", "0.46446615", "0.46144164", "0.46108356", "0.45685264", "0.45621142", "0.4506872", "0.44697723", "0.4463625", "0.4440926", "0.438206", "0.43632683", "0.4...
0.8328072
0
GetMarginAccountBalance returns the margin account balances
func (h *HUOBI) GetMarginAccountBalance(ctx context.Context, symbol currency.Pair) ([]MarginAccountBalance, error) { resp := struct { Balances []MarginAccountBalance `json:"data"` }{} vals := url.Values{} if !symbol.IsEmpty() { symbolValue, err := h.FormatSymbol(symbol, asset.Spot) if err != nil { return resp.Balances, err } vals.Set("symbol", symbolValue) } err := h.SendAuthenticatedHTTPRequest(ctx, exchange.RestSpot, http.MethodGet, huobiMarginAccountBalance, vals, nil, &resp, false) return resp.Balances, err }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "func (h *HUOBIHADAX) GetMarginAccountBalance(symbol string) ([]MarginAccountBalance, error) {\n\ttype response struct {\n\t\tResponse\n\t\tBalances []MarginAccountBalance `json:\"data\"`\n\t}\n\n\tvals := url.Values{}\n\tif symbol != \"\" {\n\t\tvals.Set(\"symbol\", symbol)\n\t}\n\n\tvar result response\n\terr := ...
[ "0.80503064", "0.6669102", "0.65312743", "0.6513888", "0.63166493", "0.6298557", "0.6274418", "0.6232896", "0.6197671", "0.615502", "0.6134208", "0.60987025", "0.6091355", "0.607732", "0.6075519", "0.60680085", "0.60352254", "0.6031761", "0.60201985", "0.60090667", "0.6003995...
0.7991697
1
Withdraw withdraws the desired amount and currency
func (h *HUOBI) Withdraw(ctx context.Context, c currency.Code, address, addrTag, chain string, amount, fee float64) (int64, error) { if c.IsEmpty() || address == "" || amount <= 0 { return 0, errors.New("currency, address and amount must be set") } resp := struct { WithdrawID int64 `json:"data"` }{} data := struct { Address string `json:"address"` Amount string `json:"amount"` Currency string `json:"currency"` Fee string `json:"fee,omitempty"` Chain string `json:"chain,omitempty"` AddrTag string `json:"addr-tag,omitempty"` }{ Address: address, Currency: c.Lower().String(), Amount: strconv.FormatFloat(amount, 'f', -1, 64), } if fee > 0 { data.Fee = strconv.FormatFloat(fee, 'f', -1, 64) } if addrTag != "" { data.AddrTag = addrTag } if chain != "" { data.Chain = strings.ToLower(chain) } err := h.SendAuthenticatedHTTPRequest(ctx, exchange.RestSpot, http.MethodPost, huobiWithdrawCreate, nil, data, &resp, false) return resp.WithdrawID, err }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "func (_IWETH *IWETHSession) Withdraw(arg0 *big.Int) (*types.Transaction, error) {\r\n\treturn _IWETH.Contract.Withdraw(&_IWETH.TransactOpts, arg0)\r\n}", "func (_Contract *ContractTransactor) Withdraw(opts *bind.TransactOpts, value *big.Int) (*types.Transaction, error) {\n\treturn _Contract.contract.Transact(opt...
[ "0.77723145", "0.7767799", "0.7744333", "0.7738606", "0.76728463", "0.76718146", "0.7658312", "0.7617599", "0.7595128", "0.7575202", "0.75635475", "0.7563229", "0.7558074", "0.75207466", "0.7508427", "0.7485259", "0.74540657", "0.7446718", "0.7441854", "0.7433156", "0.7431218...
0.7156289
44
CancelWithdraw cancels a withdraw request
func (h *HUOBI) CancelWithdraw(ctx context.Context, withdrawID int64) (int64, error) { resp := struct { WithdrawID int64 `json:"data"` }{} vals := url.Values{} vals.Set("withdraw-id", strconv.FormatInt(withdrawID, 10)) endpoint := fmt.Sprintf(huobiWithdrawCancel, strconv.FormatInt(withdrawID, 10)) err := h.SendAuthenticatedHTTPRequest(ctx, exchange.RestSpot, http.MethodPost, endpoint, vals, nil, &resp, false) return resp.WithdrawID, err }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "func (h *HUOBIHADAX) CancelWithdraw(withdrawID int64) (int64, error) {\n\ttype response struct {\n\t\tResponse\n\t\tWithdrawID int64 `json:\"data\"`\n\t}\n\n\tvals := url.Values{}\n\tvals.Set(\"withdraw-id\", strconv.FormatInt(withdrawID, 10))\n\n\tvar result response\n\tendpoint := fmt.Sprintf(huobihadaxWithdrawC...
[ "0.8209363", "0.69613934", "0.6717407", "0.6661929", "0.66083544", "0.64474326", "0.64346635", "0.6207621", "0.62070704", "0.6199843", "0.6197736", "0.6195833", "0.6160289", "0.6144072", "0.61151004", "0.6094923", "0.6090664", "0.607637", "0.6073357", "0.60618705", "0.6055893...
0.8331418
0
QueryDepositAddress returns the deposit address for a specified currency
func (h *HUOBI) QueryDepositAddress(ctx context.Context, cryptocurrency currency.Code) ([]DepositAddress, error) { resp := struct { DepositAddress []DepositAddress `json:"data"` }{} vals := url.Values{} vals.Set("currency", cryptocurrency.Lower().String()) err := h.SendAuthenticatedHTTPRequest(ctx, exchange.RestSpot, http.MethodGet, huobiAccountDepositAddress, vals, nil, &resp, true) if err != nil { return nil, err } if len(resp.DepositAddress) == 0 { return nil, errors.New("deposit address data isn't populated") } return resp.DepositAddress, nil }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "func (e Exchange) DepositAddress(exch string, currencyCode currency.Code) (out string, err error) {\n\tif currencyCode.IsEmpty() {\n\t\terr = errors.New(\"currency code is empty\")\n\t\treturn\n\t}\n\treturn engine.Bot.DepositAddressManager.GetDepositAddressByExchange(exch, currencyCode)\n}", "func (k *Kraken) G...
[ "0.7201584", "0.7159637", "0.7113259", "0.70785964", "0.6856927", "0.6840263", "0.67491704", "0.65610737", "0.655659", "0.64991057", "0.6119848", "0.6076726", "0.60266584", "0.6012706", "0.59784126", "0.5939621", "0.58625615", "0.5805118", "0.5754761", "0.5750813", "0.5715253...
0.8221875
0