text stringlengths 11 6.3k | embedding listlengths 768 768 |
|---|---|
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(... | [
-0.1380489617586136,
-0.6179684400558472,
1.1178044080734253,
-0.2132265716791153,
-0.71913743019104,
0.04927573725581169,
0.940850555896759,
0.00936092622578144,
-0.08654648065567017,
-0.19154851138591766,
0.2728978097438812,
0.34920090436935425,
-0.46558719873428345,
1.2446777820587158,
... |
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
} | [
-0.7573415040969849,
0.27847665548324585,
0.6206672787666321,
0.38267505168914795,
0.48194870352745056,
-0.22032801806926727,
0.7626417279243469,
0.31116288900375366,
0.26712626218795776,
-0.07070478796958923,
-0.7810315489768982,
0.40270766615867615,
-0.9442473649978638,
1.061785936355590... |
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... | [
-0.4172843396663666,
0.048139989376068115,
0.8949628472328186,
-0.18220099806785583,
-1.322054386138916,
-0.39680883288383484,
0.5113382339477539,
-1.5714155435562134,
-0.519177258014679,
-0.3233986496925354,
-0.40257489681243896,
0.9894072413444519,
-0.18318036198616028,
1.378656983375549... |
func (bs *Bitstream) Skipbits(bits uint) error {
for bits > 32 {
bs.Rul()
bits -= 32
}
for bits > 0 {
bs.Rub()
bits -= 1
}
return nil
} | [
-0.886967658996582,
1.367872714996338,
0.3685981035232544,
-0.15543954074382782,
-0.46549615263938904,
1.3058582544326782,
0.7351683378219604,
-1.3910493850708008,
-0.06645305454730988,
-0.7768074870109558,
-0.20273524522781372,
0.4699535071849823,
-0.8137301206588745,
0.6961477994918823,
... |
func (bs *Bitstream) Rub() bool {
ret, _ := bs.getbits2(1)
ret = ret&0x1
if ret == 1 {
return true
} else {
return false
}
} | [
-0.7046470642089844,
0.827922523021698,
0.63127601146698,
0.559345543384552,
-0.4948890805244446,
0.1441936492919922,
0.09052257239818573,
-0.2744508683681488,
0.4555774927139282,
-0.9444301724433899,
0.02503483183681965,
1.1972969770431519,
-1.9098047018051147,
0.4128730893135071,
-0.48... |
func (bs *Bitstream) Pub() bool {
ret, _ := bs.peekbits2(1)
ret = ret&0x1
if ret == 1 {
return true
} else {
return false
}
} | [
-0.2971412241458893,
0.45223021507263184,
0.48786360025405884,
0.890393078327179,
-0.5767523050308228,
0.45307374000549316,
0.01894955150783062,
-0.09348200261592865,
-0.2754536271095276,
-0.8757033348083496,
-0.35673990845680237,
0.5755993127822876,
-1.3373886346817017,
0.4031308591365814... |
func (bs *Bitstream) Ruls(bits uint) uint32 {
ret, _ := bs.getbits2(bits)
return ret
} | [
-0.5192065834999084,
1.3536916971206665,
0.45855262875556946,
-0.6054844856262207,
-0.28512629866600037,
-0.016767853870987892,
-0.009603472426533699,
-2.1110434532165527,
0.20681586861610413,
-0.135075643658638,
-0.0646771639585495,
1.278334617614746,
-0.6037724018096924,
0.10989204049110... |
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)
} | [
-0.37553733587265015,
0.30956050753593445,
0.16867128014564514,
-0.6094649434089661,
-0.4791705012321472,
-0.26066136360168457,
-0.0018235306488350034,
-0.7516568303108215,
0.5499992966651917,
-1.00505793094635,
-0.2834269106388092,
1.6993681192398071,
-0.3256034851074219,
0.17942674458026... |
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)
} | [
-0.0032693042885512114,
0.29812029004096985,
0.4897631108760834,
-0.6483539342880249,
-0.4080671966075897,
-0.564217209815979,
0.2916494905948639,
-1.2124756574630737,
0.14335571229457855,
-0.6447864174842834,
-0.09239178150892258,
1.0845712423324585,
-1.0328444242477417,
0.154489561915397... |
func (bs *Bitstream) Rucs(bits uint) byte {
ret, _ := bs.getbits2(bits)
return byte(ret&0xFF)
} | [
-0.5303585529327393,
0.7230716347694397,
0.30013155937194824,
-0.6614381670951843,
-0.1878441870212555,
-0.15582580864429474,
0.00686914287507534,
-2.25893235206604,
0.4297947585582733,
-0.6119956970214844,
0.24169819056987762,
1.4551842212677002,
-0.3623678982257843,
-0.16698622703552246,... |
func (bs *Bitstream) Rcs(bits uint) int8 {
ret, _ := bs.getbits2(bits)
return int8(ret)
} | [
-0.2739831805229187,
-0.04857764020562172,
0.2876185476779938,
-0.24900567531585693,
-0.46906816959381104,
-0.443833589553833,
0.2692411243915558,
-1.8641806840896606,
0.2742041349411011,
0.5854248404502869,
-0.2279902547597885,
1.1782116889953613,
-1.2286806106567383,
-0.06875097006559372... |
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)
}
} | [
-1.1429449319839478,
-0.09396595507860184,
0.37483495473861694,
-1.0748792886734009,
-1.0069679021835327,
0.16442695260047913,
-0.33748748898506165,
-0.35832643508911133,
1.0620747804641724,
1.2431925535202026,
0.059387169778347015,
0.5860198140144348,
0.5934091210365295,
-0.14858667552471... |
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)
}
} | [
-0.7329503893852234,
-0.8461074233055115,
0.4165288805961609,
-1.514208436012268,
-1.4358267784118652,
0.2916510999202728,
-0.27326899766921997,
-0.8216171860694885,
0.6195249557495117,
0.923025369644165,
0.1578947901725769,
0.6300126910209656,
0.9901019334793091,
-0.01625191792845726,
0... |
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
} | [
0.7637398838996887,
-0.4445283114910126,
0.46959608793258667,
-0.23378127813339233,
-0.3662278652191162,
0.32143568992614746,
-0.7006562352180481,
-0.5442736744880676,
-0.03955193608999252,
0.4365929067134857,
0.16029807925224304,
0.12399721145629883,
-0.5530179738998413,
-0.16521257162094... |
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... | [
0.3551900386810303,
-0.655568540096283,
0.2686503827571869,
1.326411485671997,
0.04097019508481026,
-0.17218664288520813,
-1.5329296588897705,
-1.0352931022644043,
0.11623235791921616,
-0.5877647995948792,
-0.37104687094688416,
-0.19376909732818604,
-0.2385793924331665,
0.2956124246120453,... |
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())
... | [
0.4770832359790802,
-0.2870052456855774,
0.1870916336774826,
0.4766750633716583,
-0.5907905101776123,
-0.12309514731168747,
-1.0674275159835815,
-1.6282209157943726,
0.5964552760124207,
-0.41661325097084045,
-0.23270340263843536,
-0.4577620327472687,
-0.25000661611557007,
-0.42228314280509... |
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
} | [
-0.4408111572265625,
-0.909012496471405,
0.7271687984466553,
-0.5243096351623535,
-0.9810863733291626,
0.8797516226768494,
-0.541850745677948,
0.38831713795661926,
-0.44157400727272034,
-0.047246310859918594,
0.12429382652044296,
0.5632103085517883,
-0.5850657224655151,
0.03139137104153633... |
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
} | [
-1.0089010000228882,
0.8924396634101868,
0.36526384949684143,
1.184273600578308,
-0.2654065489768982,
-0.17266899347305298,
-0.20149211585521698,
-0.8950656056404114,
-0.7303368449211121,
-1.1034259796142578,
-0.26705649495124817,
0.8129797577857971,
-0.2925611436367035,
0.1467034667730331... |
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
... | [
0.5476891398429871,
-0.05805239453911781,
0.414041668176651,
0.35206952691078186,
-1.0866273641586304,
-0.9950587153434753,
-0.4751826524734497,
0.2960885465145111,
0.22339928150177002,
0.8325906991958618,
0.415537565946579,
-0.6196563839912415,
-0.692825198173523,
-0.12589851021766663,
... |
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
} | [
-0.15935204923152924,
0.313705712556839,
0.3052379786968231,
0.5591156482696533,
0.41782844066619873,
0.8684957027435303,
0.05717882141470909,
-0.5965341925621033,
0.8976194262504578,
0.4113956689834595,
1.0935089588165283,
0.35616013407707214,
-0.5236592888832092,
0.2285282015800476,
1.... |
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
} | [
0.031950581818819046,
0.014750881120562553,
0.30893364548683167,
-1.1232287883758545,
-0.6354908347129822,
0.4039071202278137,
0.5075080990791321,
0.27313777804374695,
0.2387511134147644,
-0.04010603576898575,
-0.09173595160245895,
0.3223588466644287,
-0.8920029401779175,
0.088314294815063... |
func (country Country) Validate() error {
if _, ok := ByCountryStr(string(country)); !ok {
return fmt.Errorf("'%s' is not valid ISO-4217 country", country)
}
return nil
} | [
0.5381459593772888,
0.34012266993522644,
0.3959214389324188,
0.5309839248657227,
0.08745577186346054,
0.6807302832603455,
0.1081152856349945,
-0.14160104095935822,
-0.19505371153354645,
0.08198466897010803,
0.7664651274681091,
-0.2877342402935028,
-0.871345579624176,
0.13845686614513397,
... |
func (country Country) IsSet() bool {
return len(string(country)) > 0
} | [
-0.38660115003585815,
0.10413835942745209,
0.20674103498458862,
-0.1540004014968872,
0.7268171310424805,
0.8104114532470703,
-0.4209671914577484,
-0.06428784132003784,
-0.6070267558097839,
0.5093240737915039,
-0.1575040966272354,
0.2367284595966339,
-0.6192984580993652,
0.2119683027267456,... |
func (country Country) String() string {
return string(country)
} | [
0.009254153817892075,
-1.149363398551941,
-0.31386610865592957,
-0.3470725417137146,
-0.6660857796669006,
1.797736644744873,
0.5018228888511658,
-1.1325374841690063,
-0.3024701178073883,
-0.1829729676246643,
0.1930094063282013,
0.5024533867835999,
-0.6237398982048035,
-0.2057865560054779,
... |
func (countries Countries) IsCountryIn(country string) bool {
for _, c := range countries {
if string(c) == country {
return true
}
}
return false
} | [
0.009441438131034374,
-0.644557774066925,
0.16342659294605255,
0.08643434941768646,
-0.8045514225959778,
0.598177433013916,
-0.014874101616442204,
0.7538748383522034,
-0.6090410947799683,
-0.12489237636327744,
-0.4120963215827942,
0.15567615628242493,
-1.193447232246399,
0.6046199798583984... |
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
} | [
-0.10180804878473282,
0.5748878121376038,
0.2644726037979126,
0.4474368691444397,
0.18310055136680603,
0.2487257570028305,
0.14619654417037964,
-0.5677546262741089,
1.1612625122070312,
0.6683399081230164,
1.045319676399231,
-0.19605125486850739,
-0.8234159350395203,
0.1463652104139328,
0... |
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
} | [
-0.42828071117401123,
0.1409505158662796,
0.3254203498363495,
-1.3355923891067505,
-0.8051905632019043,
-0.28443604707717896,
0.5404197573661804,
0.07912208884954453,
0.2339961677789688,
0.5158121585845947,
-0.11683093756437302,
-0.20624570548534393,
-1.0106093883514404,
0.1900543272495269... |
func (currency Currency) Validate() error {
if _, ok := ByCurrencyStr(string(currency)); !ok {
return fmt.Errorf("'%s' is not valid ISO-4217 currency", currency)
}
return nil
} | [
0.38944748044013977,
0.3883470296859741,
0.4342429041862488,
0.5542089343070984,
-0.11108403652906418,
0.3158513605594635,
0.061515454202890396,
-0.21239566802978516,
0.257599413394928,
0.017709430307149887,
0.6696881055831909,
-0.528437077999115,
-1.190226435661316,
0.07064688205718994,
... |
func (currency Currency) IsSet() bool {
return len(string(currency)) > 0
} | [
-0.44921350479125977,
0.3707805573940277,
0.25448447465896606,
-0.37675046920776367,
0.38181591033935547,
-0.17833273112773895,
-0.31105837225914,
-0.06836884468793869,
-0.37153100967407227,
0.6294158101081848,
-0.2510043680667877,
-0.3031756281852722,
-0.9293398857116699,
-0.0393840894103... |
func (currency Currency) String() string {
return string(currency)
} | [
-0.18575984239578247,
-0.6575141549110413,
-0.33485883474349976,
-0.3451884686946869,
-0.8480851650238037,
1.0532790422439575,
0.6430888772010803,
-1.1648198366165161,
0.07948119193315506,
0.19997036457061768,
0.07885066419839859,
-0.1187741607427597,
-0.7259476184844971,
-0.29088437557220... |
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
} | [
-0.06830469518899918,
0.6349942684173584,
0.3363940119743347,
0.48081278800964355,
0.5240773558616638,
0.026551710441708565,
-0.057566720992326736,
-0.4079393744468689,
0.915627658367157,
0.4050915539264679,
1.202784538269043,
0.2612583041191101,
-0.36648640036582947,
0.38427209854125977,
... |
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
} | [
-0.27098336815834045,
0.7157729864120483,
0.45166996121406555,
-1.4289268255233765,
-0.46509793400764465,
-0.9004573225975037,
0.06999333947896957,
0.35940659046173096,
0.3610210418701172,
0.6165214776992798,
-0.4225485324859619,
0.1363404393196106,
-0.898370087146759,
0.48721304535865784,... |
func (code Code) Validate() error {
if _, ok := ByCodeStr(string(code)); !ok {
return fmt.Errorf("'%s' is not valid ISO-4217 code", code)
}
return nil
} | [
0.2285761535167694,
0.9119428396224976,
0.5357305407524109,
0.2184293121099472,
0.3742385506629944,
-0.11750233918428421,
-0.1549483686685562,
0.15762318670749664,
0.16724148392677307,
-0.06863921135663986,
0.5683003664016724,
-0.15008233487606049,
-0.35254207253456116,
0.24822503328323364... |
func (code Code) IsSet() bool {
return len(string(code)) > 0
} | [
-0.5986366271972656,
0.5366068482398987,
0.3409641683101654,
-0.5438177585601807,
0.8394594192504883,
-0.5608422160148621,
-0.7652189135551453,
0.21637646853923798,
-0.20584642887115479,
0.3801794946193695,
-0.07850988209247589,
0.39621981978416443,
-0.19343522191047668,
0.3365205526351928... |
func (code Code) String() string {
return string(code)
} | [
-0.11227615177631378,
-0.18586498498916626,
-0.22417595982551575,
-0.5994547605514526,
-0.1695731282234192,
0.7659662961959839,
0.4387024939060211,
-0.7987155914306641,
0.08522910624742508,
0.12552501261234283,
-0.07884132117033005,
0.4134415090084076,
0.23545055091381073,
-0.0207330472767... |
func (code Code) Places() int {
return currenciesByCode[string(code)].decimalPlaces
} | [
-0.06565144658088684,
0.8935166597366333,
0.5120257139205933,
-1.3997740745544434,
0.4948643445968628,
-0.48211029171943665,
0.5664737224578857,
0.19002115726470947,
0.8950871825218201,
-0.23456346988677979,
-0.28233060240745544,
-0.5840275287628174,
-0.6531504392623901,
0.0824619084596633... |
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
} | [
-0.29530996084213257,
0.5417030453681946,
0.4640647768974304,
0.5460332632064819,
0.3180074989795685,
0.4728648066520691,
-0.030053667724132538,
-0.44505468010902405,
1.1899757385253906,
-0.13934972882270813,
1.0854450464248657,
0.10291047394275665,
-0.016753248870372772,
0.264615952968597... |
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
} | [
-0.5419389009475708,
0.19166694581508636,
0.44493722915649414,
-0.9582679867744446,
-0.43889689445495605,
-0.5152581930160522,
0.28580909967422485,
0.15481749176979065,
0.4935927093029022,
0.11527933180332184,
-0.769392192363739,
-0.007001847494393587,
-0.47170451283454895,
0.0960894376039... |
func (number Number) Validate() error {
if _, ok := ByNumberStr(string(number)); !ok {
return fmt.Errorf("'%s' is not valid ISO-4217 number", number)
}
return nil
} | [
0.2891550660133362,
0.7391611933708191,
0.5559767484664917,
0.6092117428779602,
0.0646500214934349,
0.2554282546043396,
-0.4339856803417206,
0.1909378618001938,
0.19768284261226654,
-0.5937895774841309,
0.23265524208545685,
-0.11552145332098007,
0.030822401866316795,
-0.03560119494795799,
... |
func (number Number) IsSet() bool {
return len(string(number)) > 0
} | [
-0.683719277381897,
0.24573731422424316,
0.32047250866889954,
-0.2153501957654953,
0.42414745688438416,
0.3014107942581177,
-0.6912298202514648,
0.3722239136695862,
0.05959785729646683,
-0.12981554865837097,
-0.3478425443172455,
0.11992642283439636,
0.13330863416194916,
-0.0908070802688598... |
func (number Number) String() string {
return string(number)
} | [
-0.5558104515075684,
-0.6533730030059814,
-0.1965702772140503,
0.019528396427631378,
-0.536045491695404,
0.7659805417060852,
0.5666356682777405,
-1.0080223083496094,
0.535336971282959,
-0.8426842093467712,
-0.39325904846191406,
0.45330220460891724,
0.44520530104637146,
-0.2027263045310974,... |
func (currencies currencies) CurrencyByCurrency(curr string) (currency, bool) {
for _, c := range currencies {
if string(c.currency) == curr {
return c, true
}
}
return currency{}, false
} | [
-0.5408324003219604,
-0.5889587998390198,
0.21955101191997528,
-0.21689215302467346,
-0.9702507853507996,
-0.3905945420265198,
0.4428539276123047,
-0.1462392657995224,
-0.04197128489613533,
1.622455358505249,
-0.45949938893318176,
-1.2609578371047974,
-1.2860757112503052,
0.139811158180236... |
func (currencies currencies) CurrencyByCode(code string) (currency, bool) {
for _, c := range currencies {
if string(c.code) == code {
return c, true
}
}
return currency{}, false
} | [
-0.838287889957428,
0.04701792448759079,
0.3220299780368805,
-1.0955921411514282,
-0.24534010887145996,
-0.23413442075252533,
0.22622744739055634,
-0.26638802886009216,
0.11030108481645584,
1.6280548572540283,
-0.5083147883415222,
-1.2333179712295532,
-0.7938688397407532,
0.202871128916740... |
func (currencies currencies) CurrencyByNumber(number string) (currency, bool) {
for _, c := range currencies {
if string(c.number) == number {
return c, true
}
}
return currency{}, false
} | [
-0.9463205933570862,
-0.07212547212839127,
0.2887050211429596,
-0.4081527888774872,
-0.9255310297012329,
-0.46071431040763855,
0.44566866755485535,
-0.38045769929885864,
0.29664549231529236,
1.15885329246521,
-0.4680292308330536,
-1.022357702255249,
-0.7725298404693604,
-0.1486379355192184... |
func ByCodeStr(code string) (c currency, ok bool) {
c, ok = currenciesByCode[code]
return
} | [
-0.4978542625904083,
-0.05974242091178894,
0.3796732723712921,
-0.6084446907043457,
-0.8117423057556152,
-0.09371846914291382,
0.08410537242889404,
-0.4280707836151123,
-0.3182552754878998,
1.0310077667236328,
-0.7133044004440308,
-0.7162114381790161,
0.040674492716789246,
-0.2526251375675... |
func ByCurrencyStr(currency string) (c currency, ok bool) {
c, ok = currenciesByCurrency[currency]
return
} | [
-0.17697246372699738,
-0.7003628015518188,
0.09600213170051575,
0.09993081539869308,
-1.4125339984893799,
0.08907027542591095,
0.7380292415618896,
-0.4269232451915741,
-0.14408008754253387,
1.3475295305252075,
-0.46365052461624146,
-1.5313948392868042,
-1.359418511390686,
-0.13122364878654... |
func ByNumberStr(number string) (c currency, ok bool) {
c, ok = currenciesByNumber[number]
return
} | [
-0.43425387144088745,
-0.2930128872394562,
0.17334489524364471,
0.1412791609764099,
-1.2471145391464233,
-0.16598056256771088,
0.4177272915840149,
-0.9240461587905884,
0.02076529711484909,
0.8253498673439026,
-0.44308874011039734,
-0.8707184791564941,
-0.3495572507381439,
-0.48965162038803... |
func ByCountryStr(country string) (c currencies, ok bool) {
c, ok = currenciesByCountry[country]
return
} | [
-0.09086483716964722,
-0.29480937123298645,
0.3320651352405548,
0.17233137786388397,
-0.9305303692817688,
-0.26950326561927795,
0.7751670479774475,
-0.6807928681373596,
-0.5187605619430542,
1.3636540174484253,
-0.8519170880317688,
-1.1011979579925537,
-0.6904052495956421,
-0.31949910521507... |
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
} | [
-0.47691047191619873,
0.2318817675113678,
0.3379993736743927,
-1.0156946182250977,
-0.5409151911735535,
-0.4475032687187195,
-0.6042842268943787,
-0.6892808079719543,
0.17798732221126556,
0.37087109684944153,
0.704709529876709,
0.15806132555007935,
-0.9399270415306091,
-0.1777917593717575,... |
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
} | [
-0.08989144116640091,
-0.5707881450653076,
0.15832461416721344,
0.11944060772657394,
-1.2921558618545532,
-0.032555364072322845,
0.21834121644496918,
-0.4712446331977844,
0.19987620413303375,
0.5039921402931213,
0.1898798942565918,
-1.2917912006378174,
-1.3834346532821655,
-0.0729352831840... |
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
} | [
-0.33920586109161377,
-0.290770947933197,
0.19798965752124786,
-0.046039171516895294,
-0.910950779914856,
-0.13007064163684845,
-0.08899878710508347,
-0.9255995154380798,
0.5578736662864685,
0.36622053384780884,
0.9052204489707947,
-0.1168288141489029,
-1.0653294324874878,
-0.4738811850547... |
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
} | [
-0.4163214862346649,
-0.29068517684936523,
0.24192114174365997,
-0.08596738427877426,
-0.3204885423183441,
-0.1273861974477768,
0.14841793477535248,
-0.7711483240127563,
0.23364613950252533,
1.0487034320831299,
0.522692084312439,
-0.6539693474769592,
-1.4626567363739014,
-0.067100360989570... |
func ByCode(code Code) (c currency, ok bool) {
c, ok = currenciesByCode[code.String()]
return
} | [
-0.03901422768831253,
0.6493464112281799,
0.37866494059562683,
-1.245550274848938,
-0.3411110043525696,
-0.474212646484375,
0.34269455075263977,
-0.11620961874723434,
-0.1703222095966339,
1.470139503479004,
-0.7885860204696655,
-0.4614156484603882,
-0.35640114545822144,
-0.4170055389404297... |
func ByCurrency(currency Currency) (c currency, ok bool) {
c, ok = currenciesByCurrency[currency.String()]
return
} | [
-0.13714399933815002,
0.0336763821542263,
0.23424950242042542,
-0.25673410296440125,
-0.6952263116836548,
-0.30150502920150757,
0.8208054900169373,
-0.19537721574306488,
-0.20481781661510468,
1.1003931760787964,
-0.7201241850852966,
-0.8493902087211609,
-1.144469976425171,
-0.4921278357505... |
func ByNumber(number Number) (c currency, ok bool) {
c, ok = currenciesByNumber[number.String()]
return
} | [
-0.4666282534599304,
0.6330767869949341,
0.32471147179603577,
-0.5817855000495911,
-0.961897075176239,
-0.5983243584632874,
0.6455046534538269,
-0.5385333299636841,
0.12592099606990814,
0.8621188998222351,
-0.6327557563781738,
-0.5024814605712891,
-0.4246326982975006,
-0.5677704215049744,
... |
func ByCountry(country Country) (c currencies, ok bool) {
c, ok = currenciesByCountry[country.String()]
return
} | [
-0.33049455285072327,
0.45096921920776367,
0.45995813608169556,
-0.5014753341674805,
-0.5786292552947998,
-0.30406272411346436,
0.9094777703285217,
-0.6141006946563721,
-0.208094984292984,
1.5579460859298706,
-0.9327003955841064,
-0.6003142595291138,
-1.2565287351608276,
-0.428716123104095... |
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
} | [
-0.021863045170903206,
0.14604757726192474,
0.3479011654853821,
-0.25450974702835083,
-0.7358607053756714,
-0.2642093896865845,
0.1753840297460556,
-0.09213260561227798,
0.3913179934024811,
0.5397582054138184,
0.19506646692752838,
-0.5050303339958191,
-0.4952407777309418,
0.446127712726593... |
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
} | [
-0.02974359318614006,
-0.43666958808898926,
0.04340356960892677,
0.35410940647125244,
-1.029090404510498,
0.09487570077180862,
0.2734393775463104,
-0.18196655809879303,
0.34406399726867676,
0.7416802644729614,
0.491080105304718,
-0.7985338568687439,
-1.3840320110321045,
-0.1142945289611816... |
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
} | [
-0.17404687404632568,
-0.07103496789932251,
0.2796609699726105,
0.28020328283309937,
-1.0888845920562744,
-0.11677628010511398,
0.29146715998649597,
-0.21927577257156372,
0.582447350025177,
0.4587760865688324,
0.47856593132019043,
-0.5136734843254089,
-0.554227352142334,
-0.229729309678077... |
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
} | [
0.10596857219934464,
0.03974173218011856,
0.3182338774204254,
0.21219520270824432,
-0.4108867049217224,
-0.1388135850429535,
0.3702130615711212,
-0.02525215409696102,
0.1783624291419983,
1.1670503616333008,
0.21719273924827576,
-0.8278036117553711,
-1.0279066562652588,
0.015845606103539467... |
func (v *actorInfoViewType) Schema() string {
return v.s.SQLSchema
} | [
-0.17243719100952148,
-0.4033346474170685,
0.33697929978370667,
0.5205528736114502,
-0.022330330684781075,
0.17714916169643402,
-0.021482834592461586,
0.6278347373008728,
0.9820093512535095,
-0.2621535658836365,
0.5568435788154602,
0.44532737135887146,
-0.2185927778482437,
0.03191269189119... |
func (v *actorInfoViewType) Name() string {
return v.s.SQLName
} | [
-0.39073634147644043,
-0.7214018702507019,
0.48301634192466736,
0.24125789105892181,
-1.2810297012329102,
-0.04427444189786911,
0.42705410718917847,
-0.27887511253356934,
0.0012405216693878174,
0.6250000596046448,
-0.2557179927825928,
0.2291264533996582,
0.10161587595939636,
0.627547800540... |
func (v *actorInfoViewType) Columns() []string {
return []string{
"actor_id",
"first_name",
"last_name",
"film_info",
}
} | [
-0.49278539419174194,
-0.5345922708511353,
0.14533881843090057,
-0.3397129476070404,
0.4819127917289734,
0.43247389793395996,
-0.3632270097732544,
-0.2586769461631775,
0.4649375379085541,
-0.614176332950592,
-0.506496250629425,
0.5775909423828125,
-0.1028042584657669,
0.6143903136253357,
... |
func (v *actorInfoViewType) NewStruct() reform.Struct {
return new(ActorInfo)
} | [
-0.31076082587242126,
-0.8899425864219666,
0.16738361120224,
-0.5399104356765747,
-1.6549581289291382,
0.37401995062828064,
0.1245531290769577,
-0.47787776589393616,
0.5029507279396057,
-1.1887999773025513,
0.29513075947761536,
0.52675861120224,
-0.06949523091316223,
0.44479402899742126,
... |
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,... | [
-0.2938510477542877,
-2.0134646892547607,
0.11739806085824966,
-0.8145344257354736,
-0.5445153713226318,
0.12071049958467484,
0.12418034672737122,
-0.11674383282661438,
0.05698595568537712,
0.14715486764907837,
-0.466709166765213,
1.1277716159820557,
0.13771948218345642,
0.2507274150848388... |
func (s *ActorInfo) View() reform.View {
return ActorInfoView
} | [
-0.05788518860936165,
-1.1646181344985962,
0.11801008880138397,
-1.265599250793457,
-0.8600497245788574,
0.29620683193206787,
0.5992689728736877,
0.5991953611373901,
0.09797768294811249,
-1.6374664306640625,
0.34416183829307556,
1.1444498300552368,
-0.10535994917154312,
-0.2396988570690155... |
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 res... | [
-0.46947118639945984,
0.6152141094207764,
0.4792501628398895,
0.053236719220876694,
0.374314546585083,
-0.5408754348754883,
-0.7444126009941101,
-0.5849576592445374,
0.3281095623970032,
0.4709938168525696,
0.8264667391777039,
0.552823007106781,
-1.6261240243911743,
0.3317010700702667,
0.... |
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... | [
-0.9787799119949341,
-0.13924048840999603,
0.5911213755607605,
0.979659914970398,
0.4195871949195862,
-0.29639381170272827,
-0.40560221672058105,
-0.5396549105644226,
-0.3998415470123291,
0.5362579822540283,
-0.15514247119426727,
0.36013638973236084,
-0.337389200925827,
0.31057241559028625... |
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.SendHTT... | [
-1.2978501319885254,
0.9345049858093262,
0.35728639364242554,
-0.7135868072509766,
-0.5405803918838501,
-0.003827325301244855,
-0.476624071598053,
-0.8587605357170105,
-0.09197330474853516,
0.012765621766448021,
0.18580621480941772,
0.41564303636550903,
-0.47515174746513367,
-0.62993746995... |
func (h *HUOBI) GetTickers(ctx context.Context) (Tickers, error) {
var result Tickers
return result, h.SendHTTPRequest(ctx, exchange.RestSpot, huobiMarketTickers, &result)
} | [
-0.6720927357673645,
0.8432953357696533,
0.22683346271514893,
1.2281217575073242,
1.1961939334869385,
-0.5589988231658936,
-0.060565683990716934,
-1.2078264951705933,
-0.33742082118988037,
-0.1890377551317215,
-0.27071821689605713,
0.04029439389705658,
-2.0135786533355713,
0.04453486949205... |
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... | [
-0.8084823489189148,
0.9477617144584656,
0.5817999839782715,
-0.0741548091173172,
0.6865038275718689,
0.3509240448474884,
0.21288913488388062,
-0.6391796469688416,
0.2598142921924591,
-0.4297352433204651,
-0.36244887113571167,
0.5907266736030579,
-0.7710413336753845,
0.6853502988815308,
... |
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("... | [
-1.2343323230743408,
0.3245801031589508,
0.7920036315917969,
0.9811371564865112,
0.3973039388656616,
0.6717647314071655,
1.007432222366333,
-0.861955463886261,
-0.581563413143158,
-0.26448607444763184,
0.23882822692394257,
1.0798784494400024,
-0.5056471824645996,
0.18024960160255432,
0.4... |
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"`
... | [
-0.8197627067565918,
1.0629217624664307,
0.466312050819397,
-0.062386803328990936,
1.2597956657409668,
-0.16990645229816437,
-0.0702221617102623,
-1.4063483476638794,
0.08729226142168045,
0.03733598813414574,
-0.1034163385629654,
0.3754916787147522,
-1.0777015686035156,
-0.0364499650895595... |
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
} | [
-0.7654235363006592,
0.16137397289276123,
0.5930241942405701,
0.4594234824180603,
0.027756020426750183,
-0.4298730492591858,
-0.1280108541250229,
-0.5706190466880798,
-0.029872290790081024,
1.0402576923370361,
0.29710322618484497,
-0.5587918162345886,
-0.6458613276481628,
-0.07403051853179... |
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,... | [
-0.6957324743270874,
1.259434700012207,
0.5339297652244568,
-0.2501696050167084,
0.4590933322906494,
-0.5399693250656128,
0.1277589052915573,
-1.1410202980041504,
-0.0418020561337471,
0.5181732773780823,
-0.7629504799842834,
0.8225809335708618,
-0.5354542136192322,
-0.2920646667480469,
-... |
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 ... | [
-0.4421733021736145,
0.7718380689620972,
0.5564858317375183,
-0.24408750236034393,
0.4932316839694977,
0.20347009599208832,
0.10129760950803757,
-0.9932625889778137,
0.5594473481178284,
0.36684519052505493,
0.0021263379603624344,
0.642491340637207,
-0.4850132465362549,
0.03686640039086342,... |
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)
}
ret... | [
-1.0784447193145752,
0.8407056927680969,
0.2639819085597992,
0.402275949716568,
0.9414472579956055,
-0.23031264543533325,
-0.5269567966461182,
-1.3685499429702759,
0.11410828679800034,
-0.141374409198761,
-0.5363227128982544,
0.5474397540092468,
-0.8568784594535828,
-0.612755298614502,
0... |
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... | [
-1.070175290107727,
0.5811554193496704,
0.4158545136451721,
0.6176177859306335,
0.8317322731018066,
-0.5302410125732422,
-0.5117847919464111,
-1.0831305980682373,
0.27450859546661377,
0.7100270390510559,
-0.3020593822002411,
-0.32003897428512573,
-1.4358538389205933,
-0.08369927853345871,
... |
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(huobiCurr... | [
-0.45693498849868774,
0.991618275642395,
0.300152450799942,
-0.13888393342494965,
0.0735611766576767,
-0.1889069676399231,
-0.16141165792942047,
-0.9246490597724915,
0.7147132754325867,
0.5027463436126709,
-0.417062908411026,
0.4971913695335388,
-1.1537591218948364,
0.5408275127410889,
0... |
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.Er... | [
-1.1248024702072144,
-0.17775847017765045,
0.747851550579071,
0.4852122962474823,
-0.0753319039940834,
-0.2807353436946869,
-0.24117402732372284,
-0.5108161568641663,
-0.35721275210380554,
1.2546007633209229,
-0.32830119132995605,
-0.4521738886833191,
-1.539167046546936,
0.2879699468612671... |
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
} | [
-0.691821277141571,
0.19698844850063324,
0.4562808871269226,
1.29914128780365,
1.1229370832443237,
-0.21391937136650085,
-0.15517528355121613,
-0.878750741481781,
0.45961833000183105,
-0.2581012547016144,
0.3186125159263611,
0.03296789899468422,
-1.1202521324157715,
-0.5946383476257324,
... |
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.SendAuthenticatedHTT... | [
-1.0147857666015625,
0.2743663489818573,
0.45894357562065125,
0.5446262955665588,
0.9528147578239441,
-0.40707284212112427,
-0.23890633881092072,
-0.8098735213279724,
0.7822173237800598,
0.27352258563041687,
0.10839183628559113,
0.20316670835018158,
-0.3064768314361572,
0.5533584952354431,... |
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... | [
-0.537185549736023,
0.8724645972251892,
0.5196323394775391,
1.029510736465454,
0.5404155254364014,
0.05105828866362572,
-0.392418771982193,
-0.7168617248535156,
0.49991798400878906,
0.11266247928142548,
-0.00004338045255281031,
-0.03961911052465439,
-1.07841157913208,
0.3456403911113739,
... |
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:... | [
-1.5331839323043823,
-0.6527387499809265,
0.9391392469406128,
0.06606311351060867,
-0.41638538241386414,
-0.1183909997344017,
0.133524551987648,
-0.24364428222179413,
-0.2260431945323944,
0.3565438985824585,
-0.24114421010017395,
-0.2557656168937683,
-0.5977990627288818,
0.8837813138961792... |
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.Va... | [
-0.27461642026901245,
-0.22632330656051636,
0.5817555785179138,
0.6228886246681213,
0.0810888484120369,
0.06255599856376648,
-0.4567124843597412,
0.21561004221439362,
-0.11039668321609497,
1.1611660718917847,
-0.511860191822052,
-0.3912390172481537,
-0.3446022868156433,
0.5244753956794739,... |
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"`
}{
ClientOr... | [
-0.09103641659021378,
-0.4583626687526703,
0.32883453369140625,
0.44561904668807983,
-0.06162920221686363,
-0.009451719932258129,
-0.13729585707187653,
-0.28136685490608215,
-0.4075576961040497,
0.35846179723739624,
-0.20483995974063873,
0.3323588967323303,
-0.5045578479766846,
0.505957961... |
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 C... | [
-0.4698077440261841,
-0.3766416311264038,
0.3036487400531769,
0.3366987109184265,
-0.9183467626571655,
0.0033756319899111986,
0.5394223928451538,
-0.42310959100723267,
-0.2676084339618683,
-0.02922780066728592,
0.16819480061531067,
0.2842080295085907,
-0.10708516091108322,
0.09967301040887... |
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,
... | [
-0.47556936740875244,
0.13781370222568512,
0.4822376072406769,
0.6979876756668091,
0.15523283183574677,
-0.1585371345281601,
-0.7679003477096558,
-0.9209810495376587,
0.07511021196842194,
-0.08674699813127518,
-0.551666259765625,
0.2245943546295166,
-0.6440818309783936,
0.1420140117406845,... |
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, ... | [
-1.0002995729446411,
0.4363320469856262,
0.6716772317886353,
0.2074662148952484,
0.49770045280456543,
-0.41032373905181885,
-0.09091922640800476,
-0.7804521918296814,
0.20457065105438232,
-0.07983748614788055,
-0.3626149892807007,
-0.5384197235107422,
-0.7186989784240723,
0.302693486213684... |
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
}... | [
-1.2103238105773926,
0.5049273371696472,
0.41542282700538635,
0.019393540918827057,
0.6124629974365234,
-0.21882247924804688,
-0.49715298414230347,
-0.8175545334815979,
-0.34943047165870667,
-0.08084676414728165,
-0.10344777256250381,
0.3227536678314209,
-0.6607654094696045,
-0.51134258508... |
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("sy... | [
-1.258493185043335,
0.7473564743995667,
0.5913040041923523,
-0.3774411380290985,
-0.25234541296958923,
-0.4570158123970032,
-0.2672673165798187,
-0.48324888944625854,
-0.3043791651725769,
-0.007841442711651325,
-0.600293755531311,
0.20774702727794647,
-0.9980460405349731,
-0.46705928444862... |
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,... | [
-1.0276269912719727,
0.44502678513526917,
0.6032928228378296,
0.29567256569862366,
0.4756534993648529,
-0.21356236934661865,
-0.1299886256456375,
-0.8086957931518555,
-0.7309342622756958,
0.22973142564296722,
-0.24267752468585968,
0.006995499134063721,
-0.962072491645813,
-0.37055769562721... |
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"`
Amoun... | [
-0.7235661745071411,
0.13906286656856537,
0.676583468914032,
-0.38832056522369385,
-0.21098606288433075,
0.1937328577041626,
0.22137556970119476,
-0.22306182980537415,
0.38463398814201355,
0.497986763715744,
0.7851162552833557,
-0.05015579238533974,
-1.21274733543396,
0.006996764801442623,... |
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 `... | [
-0.7963217496871948,
0.09817015379667282,
0.6454549431800842,
0.167999729514122,
-0.019197849556803703,
-0.10593771189451218,
0.033404842019081116,
-0.7056397199630737,
0.16593660414218903,
0.032833538949489594,
0.27157720923423767,
-0.15640337765216827,
-1.244141697883606,
0.5724521279335... |
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, strcon... | [
-0.9715102314949036,
0.07443435490131378,
0.6620281338691711,
-0.5171785354614258,
-0.2104155272245407,
-0.6956191062927246,
-0.2883944809436798,
0.31163156032562256,
0.7926300168037415,
0.528559148311615,
1.0184451341629028,
0.29363423585891724,
-0.7284107804298401,
-0.16221582889556885,
... |
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(... | [
-0.9972493052482605,
-0.19803078472614288,
0.6039924621582031,
-0.2318025380373001,
-0.4336813688278198,
0.13040228188037872,
-0.8087132573127747,
-0.29323381185531616,
0.2088908851146698,
0.23752185702323914,
0.4187100827693939,
0.6741508841514587,
-1.1183743476867676,
0.35686755180358887... |
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 r... | [
-1.039372205734253,
-0.1438170224428177,
0.5961073040962219,
0.5652913451194763,
0.15659400820732117,
-0.26393046975135803,
0.17683525383472443,
-0.15988054871559143,
0.6559866070747375,
0.14608675241470337,
0.8665403723716736,
0.41166871786117554,
-0.4580695331096649,
0.08157175034284592,... |
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 := ... | [
-0.6996405124664307,
0.46606186032295227,
0.7150118350982666,
-0.09385514259338379,
0.15734659135341644,
-0.3748040199279785,
-0.3016303479671478,
-0.44613105058670044,
-0.17818017303943634,
-0.23964761197566986,
-0.3060339093208313,
0.25719863176345825,
-1.1833529472351074,
-0.18942981958... |
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.Sen... | [
0.04987221956253052,
-0.38020047545433044,
0.7283732295036316,
-0.20691266655921936,
-1.0427230596542358,
-0.01473908219486475,
-0.5748481750488281,
-0.5428245663642883,
0.7189607620239258,
-0.1447555422782898,
-0.5133318901062012,
-0.1999128758907318,
-0.48025640845298767,
-0.282812178134... |
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.Re... | [
-0.9180511832237244,
0.1456657350063324,
0.6275243163108826,
0.13629432022571564,
0.764305830001831,
-0.052844543009996414,
-0.09310825914144516,
-0.6716712713241577,
0.590798020362854,
0.02477255091071129,
-0.01700400747358799,
0.03915059193968773,
-1.0404304265975952,
-0.1503383070230484... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.