text stringlengths 11 6.3k | embedding listlengths 768 768 |
|---|---|
func (c *Canvas) Text(x, y float64, size float64, s string, color color.RGBA) {
x, y = dimen(x, y, c.Width, c.Height)
size = pct(size, c.Width)
AbsText(c.Container, int(x), int(y), s, int(size), color)
} | [
0.7718332409858704,
-0.3942928910255432,
0.6643014550209045,
-0.9166836738586426,
-0.5180789232254028,
-0.06868082284927368,
0.14211629331111908,
-0.9187091588973999,
0.6228766441345215,
0.6309676766395569,
0.06681325286626816,
0.16932635009288788,
0.718492865562439,
-0.3852483332157135,
... |
func (c *Canvas) CText(x, y float64, size float64, s string, color color.RGBA) {
x, y = dimen(x, y, c.Width, c.Height)
size = pct(size, c.Width)
AbsTextMid(c.Container, int(x), int(y), s, int(size), color)
} | [
1.4455150365829468,
-0.7577528357505798,
0.6262550950050354,
-1.1661063432693481,
-0.6748875379562378,
0.24459457397460938,
0.3318454921245575,
-0.7462971806526184,
0.5689627528190613,
0.6662908792495728,
0.232347771525383,
0.1717434674501419,
0.36921030282974243,
-0.34479382634162903,
-... |
func (c *Canvas) EText(x, y float64, size float64, s string, color color.RGBA) {
x, y = dimen(x, y, c.Width, c.Height)
size = pct(size, c.Width)
AbsTextEnd(c.Container, int(x), int(y), s, int(size), color)
} | [
1.111467957496643,
-0.0892513319849968,
0.766892671585083,
-1.5251350402832031,
-0.6241761445999146,
0.21919505298137665,
-0.12172326445579529,
-0.8107525706291199,
0.6986419558525085,
0.8150885105133057,
-0.04597851634025574,
-0.032095327973365784,
0.7101628184318542,
-0.1575290858745575,... |
func (c *Canvas) Circle(x, y, r float64, color color.RGBA) {
x, y = dimen(x, y, c.Width, c.Height)
r = pct(r, c.Width)
AbsCircle(c.Container, int(x), int(y), int(r/2), color)
} | [
0.12176872044801712,
-0.16006413102149963,
0.40478020906448364,
-0.5859271883964539,
-0.5116062164306641,
0.5099838972091675,
0.46840253472328186,
-1.3867723941802979,
0.1162150576710701,
0.8885873556137085,
1.0100716352462769,
0.3986245095729828,
0.9182879328727722,
0.7994295358657837,
... |
func (c *Canvas) Line(x1, y1, x2, y2, size float64, color color.RGBA) {
x1, y1 = dimen(x1, y1, c.Width, c.Height)
x2, y2 = dimen(x2, y2, c.Width, c.Height)
lsize := pct(size, c.Width)
AbsLine(c.Container, int(x1), int(y1), int(x2), int(y2), float32(lsize), color)
} | [
-0.017232388257980347,
0.11862272769212723,
0.6682855486869812,
-0.1728527843952179,
0.06272565573453903,
0.587755024433136,
-0.6391397714614868,
-0.8425368070602417,
-0.4853692352771759,
-0.6305537223815918,
-0.030778735876083374,
-0.26703372597694397,
0.7328332662582397,
0.25587582588195... |
func (c *Canvas) Rect(x, y, w, h float64, color color.RGBA) {
x, y = dimen(x, y, c.Width, c.Height)
w = pct(w, float64(c.Width))
h = pct(h, float64(c.Height))
AbsCornerRect(c.Container, int(x-(w/2)), int(y-(h/2)), int(w), int(h), color)
} | [
0.8224669694900513,
-0.10437621176242828,
0.5945776104927063,
-1.068187952041626,
-0.09189896285533905,
0.5831363797187805,
0.19681982696056366,
-0.7205725908279419,
0.03403230011463165,
-0.06656653434038162,
0.629257321357727,
0.3423340618610382,
1.2598252296447754,
-0.13583847880363464,
... |
func (c *Canvas) CornerRect(x, y, w, h float64, color color.RGBA) {
x, y = dimen(x, y, c.Width, c.Height)
w = pct(w, float64(c.Width))
h = pct(h, float64(c.Height))
AbsCornerRect(c.Container, int(x), int(y), int(w), int(h), color)
} | [
0.7354775071144104,
-0.5354791283607483,
0.857158362865448,
-1.072939395904541,
-0.4155288636684418,
0.3959982991218567,
0.03596070781350136,
-0.09031528234481812,
0.13368575274944305,
-0.2632005512714386,
1.204635739326477,
0.2788991928100586,
0.40819424390792847,
0.5375039577484131,
-0... |
func (c *Canvas) Image(x, y float64, w, h int, name string) {
x, y = dimen(x, y, c.Width, c.Height)
AbsImage(c.Container, int(x), int(y), w, h, name)
} | [
-0.18881386518478394,
-0.2116997092962265,
0.49238038063049316,
-0.3301018476486206,
-0.5869374871253967,
0.7123690247535706,
-0.6683400273323059,
-0.6412285566329956,
-0.49219635128974915,
0.7287076115608215,
0.025508681312203407,
-0.11976213753223419,
1.213410496711731,
0.297699540853500... |
func (c *Canvas) ArcLine(x, y, r, a1, a2, size float64, color color.RGBA) {
step := (a2 - a1) / 100
x1, y1 := Polar(x, y, r, a1)
for t := a1 + step; t <= a2; t += step {
x2, y2 := PolarRadians(x, y, r, t)
c.Line(x1, y1, x2, y2, size, color)
x1 = x2
y1 = y2
}
} | [
-0.6332882642745972,
-0.6959341764450073,
0.40695297718048096,
-0.9625687003135681,
0.25288137793540955,
0.3229482173919678,
-0.15964928269386292,
-0.7408250570297241,
-0.3004249334335327,
0.011383840814232826,
-0.025178439915180206,
0.24436146020889282,
0.7478253841400146,
-0.441490113735... |
func succeedsSoon(t *testing.T, f func() error) {
max := 15 * time.Second
end := time.NewTimer(max).C
done := make(chan struct{})
defer func() {
done <- struct{}{}
}()
go func() {
select {
case <-end:
t.Fatal("succeedsSoon timed out")
case <-done:
}
}()
b := &backoff.Backoff{
Min: 1 * time.M... | [
0.6352497339248657,
0.46140986680984497,
0.5006601214408875,
0.1860344111919403,
-0.005525736603885889,
0.37100130319595337,
-0.038987595587968826,
-0.05612543970346451,
-0.25397858023643494,
0.15225271880626678,
-0.7683215141296387,
0.6122833490371704,
0.5132670998573303,
-0.1766553372144... |
func TestMain(m *testing.M) {
code := setupForTesting()
if code != 0 {
os.Exit(code)
}
code = m.Run()
if !TestDisableDatabase {
err := TestDB.Close()
if err != nil {
fmt.Println("close error:", err)
os.Exit(2)
}
}
os.Exit(code)
} | [
-0.010941588319838047,
0.6776553392410278,
0.7434967756271362,
0.931454062461853,
-0.3101010024547577,
0.8529050946235657,
1.358311414718628,
1.1437617540359497,
-0.21370157599449158,
0.3716101348400116,
0.6708983182907104,
-0.20846374332904816,
-1.90848970413208,
0.4692930281162262,
0.7... |
func setupForTesting() int {
flag.BoolVar(&TestDisableDatabase, "disableDatabase", true, "set to true to disable the Oracle tests")
flag.StringVar(&TestHostValid, "hostValid", "127.0.0.1", "a host where a Oracle database is running")
flag.StringVar(&TestHostInvalid, "hostInvalid", "169.254.200.200", "a host where a ... | [
0.20514176785945892,
0.8050803542137146,
0.8964065313339233,
-0.3046533763408661,
0.46443507075309753,
0.033208344131708145,
0.7717577219009399,
0.5014309287071228,
-0.24640819430351257,
1.0197288990020752,
-0.34677854180336,
0.024084705859422684,
-0.7813470959663391,
0.6124082803726196,
... |
func TestParseDSN(t *testing.T) {
var (
pacific *time.Location
err error
)
if pacific, err = time.LoadLocation("America/Los_Angeles"); err != nil {
panic(err)
}
var dsnTests = []struct {
dsnString string
expectedDSN *DSN
}{
{"oracle://xxmc:xxmc@107.20.30.169:1521/ORCL?loc=America%2FLos_Angeles"... | [
0.19987039268016815,
0.137102410197258,
0.9143872261047363,
-0.1873694211244583,
0.5876805186271667,
-0.5358719229698181,
0.5945923924446106,
0.11202619224786758,
0.7282525300979614,
-0.9528220295906067,
-0.7588506937026978,
-0.006386354099959135,
0.4477819800376892,
-0.347557008266449,
... |
func TestIsBadConn(t *testing.T) {
var errorCode = "ORA-03114"
if !isBadConnection(errorCode) {
t.Errorf("TestIsBadConn: expected %+v, actual %+v", true, isBadConnection(errorCode))
}
} | [
0.30442994832992554,
-0.9871233105659485,
0.23315267264842987,
0.6513361930847168,
0.9856197834014893,
-0.6283711194992065,
-0.3895317316055298,
0.6284295320510864,
0.9009367227554321,
-0.6845053434371948,
-0.010425888933241367,
0.999306321144104,
-0.222151979804039,
0.019778480753302574,
... |
func testGetDB() *sql.DB {
os.Setenv("NLS_LANG", "American_America.AL32UTF8")
var openString string
// [username/[password]@]host[:port][/instance_name][?param1=value1&...¶mN=valueN]
if len(TestUsername) > 0 {
if len(TestPassword) > 0 {
openString = TestUsername + "/" + TestPassword + "@"
} else {
op... | [
0.29996606707572937,
0.35474029183387756,
0.9869087934494019,
0.7715578079223633,
0.4132946729660034,
0.510422945022583,
0.7945359945297241,
-0.20157164335250854,
0.33307144045829773,
0.2690500319004059,
0.7545419335365295,
0.938565731048584,
-0.8722527027130127,
0.11852503567934036,
0.6... |
func testExec(t *testing.T, query string, args []interface{}) error {
ctx, cancel := context.WithTimeout(context.Background(), TestContextTimeout)
stmt, err := TestDB.PrepareContext(ctx, query)
cancel()
if err != nil {
return fmt.Errorf("prepare error: %v", err)
}
ctx, cancel = context.WithTimeout(context.Back... | [
0.23647671937942505,
0.5270071625709534,
0.7736724615097046,
0.2982763350009918,
-0.11531190574169159,
0.31758928298950195,
-0.1525481939315796,
-0.40020230412483215,
-0.013141265138983727,
0.4916865825653076,
0.42099529504776,
-0.3363141417503357,
-0.6201627850532532,
0.024463022127747536... |
func testExecRows(t *testing.T, query string, args [][]interface{}) error {
ctx, cancel := context.WithTimeout(context.Background(), TestContextTimeout)
stmt, err := TestDB.PrepareContext(ctx, query)
cancel()
if err != nil {
return fmt.Errorf("prepare error: %v", err)
}
for i := 0; i < len(args); i++ {
ctx, ... | [
-0.2572430372238159,
1.0318748950958252,
0.7795012593269348,
-0.039865750819444656,
0.38332241773605347,
0.03150761500000954,
0.14754511415958405,
-0.4630964994430542,
0.12971404194831848,
0.2066681683063507,
0.5450637340545654,
-0.57558274269104,
-0.5289002060890198,
0.6997519731521606,
... |
func testRunQueryResults(t *testing.T, queryResults []testQueryResults) {
for _, queryResult := range queryResults {
if len(queryResult.args) != len(queryResult.results) {
t.Errorf("args len %v and results len %v do not match - query: %v",
len(queryResult.args), len(queryResult.results), queryResult.query)
... | [
-0.3700295686721802,
0.1357664167881012,
0.688438355922699,
-0.1850574016571045,
0.18707969784736633,
0.270200252532959,
0.3818491995334625,
-0.3838631808757782,
0.49619507789611816,
-0.5874553322792053,
-0.12584561109542847,
-0.8934136629104614,
-1.0511212348937988,
0.17237575352191925,
... |
func testRunQueryResult(t *testing.T, queryResult testQueryResults, stmt *sql.Stmt) {
for i := 0; i < len(queryResult.args); i++ {
result, err := testGetRows(t, stmt, queryResult.args[i])
if err != nil {
t.Errorf("get rows error: %v - query: %v", err, queryResult.query)
continue
}
if result == nil && que... | [
-0.20459669828414917,
-0.052981115877628326,
0.9265754222869873,
0.07482317835092545,
0.41713252663612366,
-0.43037155270576477,
0.4905276596546173,
-0.8642680644989014,
-0.014252612367272377,
0.10674794018268585,
-0.41378697752952576,
-0.14265072345733643,
-0.7098156809806824,
0.393010646... |
func NewSalesInvoiceCommentRepositoryV1SavePostParams() *SalesInvoiceCommentRepositoryV1SavePostParams {
var ()
return &SalesInvoiceCommentRepositoryV1SavePostParams{
timeout: cr.DefaultTimeout,
}
} | [
0.1829044371843338,
-0.44550442695617676,
0.39308369159698486,
-0.32616546750068665,
0.2547858655452728,
-0.5279401540756226,
-0.46791961789131165,
0.5889908075332642,
-0.33541086316108704,
-0.07821899652481079,
-0.46827054023742676,
-1.4152547121047974,
-0.3255155384540558,
0.358419299125... |
func NewSalesInvoiceCommentRepositoryV1SavePostParamsWithTimeout(timeout time.Duration) *SalesInvoiceCommentRepositoryV1SavePostParams {
var ()
return &SalesInvoiceCommentRepositoryV1SavePostParams{
timeout: timeout,
}
} | [
0.46873942017555237,
-0.5758129954338074,
0.3950662314891815,
-0.18825116753578186,
0.12157698720693588,
0.01208340935409069,
-0.946691632270813,
0.48770496249198914,
-0.4021408259868622,
0.7985045313835144,
-0.5218157768249512,
-0.8838985562324524,
-0.583709716796875,
0.7252551913261414,
... |
func NewSalesInvoiceCommentRepositoryV1SavePostParamsWithContext(ctx context.Context) *SalesInvoiceCommentRepositoryV1SavePostParams {
var ()
return &SalesInvoiceCommentRepositoryV1SavePostParams{
Context: ctx,
}
} | [
0.032187409698963165,
-0.602916419506073,
0.5589271187782288,
-0.5386805534362793,
0.3546871840953827,
0.014957534149289131,
-0.862442135810852,
0.09649714827537537,
0.1354593187570572,
0.3253343999385834,
-0.5035531520843506,
-1.2213094234466553,
-0.5584917664527893,
0.13717462122440338,
... |
func NewSalesInvoiceCommentRepositoryV1SavePostParamsWithHTTPClient(client *http.Client) *SalesInvoiceCommentRepositoryV1SavePostParams {
var ()
return &SalesInvoiceCommentRepositoryV1SavePostParams{
HTTPClient: client,
}
} | [
-0.16061359643936157,
-0.5417513847351074,
0.3383636474609375,
-0.2603154182434082,
0.6851373910903931,
0.00532901706174016,
-0.2512737810611725,
0.6634091138839722,
-0.8933082818984985,
0.05088145285844803,
-0.7697336673736572,
-1.1407039165496826,
-0.6219947934150696,
0.23869089782238007... |
func (o *SalesInvoiceCommentRepositoryV1SavePostParams) WithTimeout(timeout time.Duration) *SalesInvoiceCommentRepositoryV1SavePostParams {
o.SetTimeout(timeout)
return o
} | [
0.5371714234352112,
-0.5737866163253784,
0.37559401988983154,
-0.30316346883773804,
-0.017500359565019608,
-0.5657587647438049,
-0.29962557554244995,
0.21353167295455933,
0.25856733322143555,
0.936697244644165,
-0.3202991187572479,
-1.2504322528839111,
-0.09952300041913986,
-0.190862983465... |
func (o *SalesInvoiceCommentRepositoryV1SavePostParams) SetTimeout(timeout time.Duration) {
o.timeout = timeout
} | [
0.32047364115715027,
-0.2950746417045593,
0.1963396519422531,
-0.027560217306017876,
0.5486128926277161,
-0.13566641509532928,
-0.30781927704811096,
0.7008218765258789,
-0.012677804566919804,
1.0029796361923218,
-0.2840668261051178,
-1.047945261001587,
-0.5485919713973999,
-0.2097604721784... |
func (o *SalesInvoiceCommentRepositoryV1SavePostParams) WithContext(ctx context.Context) *SalesInvoiceCommentRepositoryV1SavePostParams {
o.SetContext(ctx)
return o
} | [
0.033124055713415146,
-0.6673305034637451,
0.564023494720459,
-0.45842796564102173,
0.05803399533033371,
-0.3609378933906555,
-0.5194580554962158,
-0.3656042516231537,
0.7061747908592224,
0.30777281522750854,
-0.3851296305656433,
-1.3648782968521118,
-0.656012773513794,
-0.9709760546684265... |
func (o *SalesInvoiceCommentRepositoryV1SavePostParams) SetContext(ctx context.Context) {
o.Context = ctx
} | [
-0.08058253675699234,
-0.2746400833129883,
0.33176353573799133,
0.17149855196475983,
0.6567599177360535,
-0.03666619211435318,
-0.41383564472198486,
-0.06764303892850876,
0.7732297778129578,
0.5048006176948547,
-0.40142950415611267,
-1.1371442079544067,
-0.7960611581802368,
-0.883068263530... |
func (o *SalesInvoiceCommentRepositoryV1SavePostParams) WithHTTPClient(client *http.Client) *SalesInvoiceCommentRepositoryV1SavePostParams {
o.SetHTTPClient(client)
return o
} | [
0.07448407262563705,
-1.3271243572235107,
0.3951914608478546,
-0.500991940498352,
0.40270572900772095,
-0.2905408442020416,
0.03164483234286308,
0.043582793325185776,
-0.4146183729171753,
0.16214899718761444,
-0.2949126362800598,
-1.2897868156433105,
-0.17846882343292236,
-0.97962790727615... |
func (o *SalesInvoiceCommentRepositoryV1SavePostParams) SetHTTPClient(client *http.Client) {
o.HTTPClient = client
} | [
0.5396254658699036,
-0.8628567457199097,
0.172941192984581,
-0.7154440879821777,
0.3923150897026062,
-0.5629602074623108,
0.21915197372436523,
0.041964370757341385,
-0.7255464792251587,
0.15928830206394196,
-0.584442138671875,
-0.924875795841217,
-0.4006457030773163,
-1.0673301219940186,
... |
func (o *SalesInvoiceCommentRepositoryV1SavePostParams) WithSalesInvoiceCommentRepositoryV1SavePostBody(salesInvoiceCommentRepositoryV1SavePostBody SalesInvoiceCommentRepositoryV1SavePostBody) *SalesInvoiceCommentRepositoryV1SavePostParams {
o.SetSalesInvoiceCommentRepositoryV1SavePostBody(salesInvoiceCommentRepositor... | [
0.279692143201828,
-0.9032615423202515,
0.7684961557388306,
-0.7225458025932312,
0.039804186671972275,
-0.582184910774231,
0.38531559705734253,
0.11844375729560852,
0.9712268114089966,
-0.008291180245578289,
-0.12205450981855392,
-2.0120584964752197,
-0.19024032354354858,
-0.17428515851497... |
func (o *SalesInvoiceCommentRepositoryV1SavePostParams) SetSalesInvoiceCommentRepositoryV1SavePostBody(salesInvoiceCommentRepositoryV1SavePostBody SalesInvoiceCommentRepositoryV1SavePostBody) {
o.SalesInvoiceCommentRepositoryV1SavePostBody = salesInvoiceCommentRepositoryV1SavePostBody
} | [
0.5575630068778992,
-1.0596699714660645,
0.8044014573097229,
-0.4807487726211548,
0.19028016924858093,
-0.44974470138549805,
0.006816275417804718,
0.03972626104950905,
0.6073827147483826,
0.01765422709286213,
-0.6197721362113953,
-1.8074249029159546,
-0.326351523399353,
-0.2774970233440399... |
func (o *SalesInvoiceCommentRepositoryV1SavePostParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error {
if err := r.SetTimeout(o.timeout); err != nil {
return err
}
var res []error
if err := r.SetBodyParam(o.SalesInvoiceCommentRepositoryV1SavePostBody); err != nil {
return err
}
if len... | [
-0.9360938668251038,
-0.42377418279647827,
0.5966732501983643,
-0.560512363910675,
1.2365368604660034,
-0.6563512682914734,
0.8023694157600403,
0.06935174018144608,
-0.27246513962745667,
0.3598882853984833,
0.059161677956581116,
-0.6087901592254639,
-0.8842530250549316,
-0.4693861007690429... |
func Validate(iface interface{}) error {
err := validate.Struct(iface)
var errs ValidationErrorsResponse
if err != nil {
if fieldError, ok := err.(validator.ValidationErrors); ok {
for _, v := range fieldError {
actualValue := ""
if vStr, ok := v.Value().(string); ok {
actualValue = vStr
}
... | [
-0.7454311847686768,
0.30255642533302307,
0.5742102265357971,
-0.12868887186050415,
-0.273046612739563,
-0.3364296555519104,
-0.06546466052532196,
-1.170677900314331,
0.13787449896335602,
0.09264662861824036,
-0.1268531084060669,
-1.091774821281433,
-0.41084393858909607,
0.8295427560806274... |
func shouldBeFuture(fl validator.FieldLevel) bool {
field := fl.Field()
if field.Kind() == reflect.Struct {
if v, ok := field.Interface().(time.Time); ok {
now := time.Now()
if now.Before(v) {
return true
}
}
}
return false
} | [
-0.1995343714952469,
0.8490298986434937,
0.7634500861167908,
0.29094192385673523,
0.1288967877626419,
-0.02334647625684738,
-0.04413780942559242,
-0.08455856889486313,
-0.5731540322303772,
0.021939704194664955,
-1.1824191808700562,
-0.13241565227508545,
0.009003146551549435,
0.890299141407... |
func MysqlToMMDDHHMMNoError(text string) (date string) {
date, err := MysqlToMMDDHHMM(text)
if err != nil {
fmt.Errorf("%v", err)
}
return
} | [
-0.08016805350780487,
-0.10051783919334412,
0.5553203821182251,
-0.043071866035461426,
-0.7919344305992126,
0.14336128532886505,
-0.6698506474494934,
-0.22960203886032104,
0.21882089972496033,
-0.014766799286007881,
-0.5053316354751587,
-0.4125303030014038,
-0.3433142304420471,
-0.19223162... |
func MysqlToYYYYMMDDHHMMNoError(text string) (date string) {
date, err := MysqlToYYYYMMDDHHMM(text)
if err != nil {
fmt.Errorf("%v", err)
}
return
} | [
0.2578485310077667,
-0.43897390365600586,
0.6004922986030579,
-0.11387613415718079,
-0.3853539824485779,
0.8374238610267639,
-0.38896265625953674,
-0.25163471698760986,
-0.09878890216350555,
-0.23011139035224915,
-0.8651941418647766,
-0.35565006732940674,
-0.4130389392375946,
-0.0626578181... |
func MysqlToYYYYMMDDNoError(text string) (date string) {
date, err := MysqlToYYYYMMDD(text)
if err != nil {
fmt.Errorf("%v", err)
}
return
} | [
0.5987734198570251,
-0.6720786690711975,
0.7387927770614624,
-0.4104827344417572,
-1.0074636936187744,
0.6143746376037598,
-0.25021570920944214,
-0.2510722577571869,
-0.18571044504642487,
-0.36394789814949036,
-0.36202678084373474,
0.04747448116540909,
-0.03608188405632973,
0.1355344355106... |
func MysqlToMMDDNoError(text string) (date string) {
date, err := MysqlToMMDD(text)
if err != nil {
fmt.Errorf("%v", err)
}
return
} | [
0.15564699470996857,
-0.8115296959877014,
0.4681796729564667,
-0.25484615564346313,
-1.6586917638778687,
0.7560471892356873,
-0.6449994444847107,
0.07175690680742264,
0.3282051384449005,
-0.24844370782375336,
0.41026219725608826,
-0.20352278649806976,
-0.479403018951416,
0.3691824972629547... |
func GetAlias() string {
return "db"
} | [
0.856734573841095,
-0.07712015509605408,
0.6374537944793701,
0.7553234696388245,
0.30773067474365234,
1.4050334692001343,
-0.34436216950416565,
0.8360844254493713,
0.023018604144454002,
0.4026162326335907,
-0.5522750616073608,
1.0059549808502197,
-0.2432704120874405,
1.0842018127441406,
... |
func GetDatabase(image liferay.Image, datastore string) DatabaseImage {
if datastore == "mysql" {
return MySQL{LpnType: image.GetType()}
} else if datastore == "postgresql" {
return PostgreSQL{LpnType: image.GetType()}
}
return nil
} | [
-0.3432481586933136,
0.24857096374034882,
0.24489618837833405,
-0.1066010370850563,
0.34798845648765564,
-0.16269716620445251,
-1.0215078592300415,
-0.37504440546035767,
0.8441178798675537,
0.059332672506570816,
0.25301191210746765,
0.7978111505508423,
-0.26775598526000977,
1.3151792287826... |
func SendMessage(botToken string, chatId string, text string) (*Message, error) {
body := &SendMessageRequestBody{
ChatID: chatId,
Text: text,
}
b, err := json.Marshal(&body)
if err != nil {
return nil, err
}
response, err := http.Post("https://api.telegram.org/"+botToken+"/sendMessage", "application/json... | [
-1.2232873439788818,
0.1075473353266716,
0.5092142820358276,
0.06980393826961517,
0.02857060916721821,
-0.2338973730802536,
-1.2084567546844482,
-0.3895973861217499,
-0.6531755328178406,
0.571678638458252,
-0.31391993165016174,
0.4426051676273346,
-1.1525890827178955,
0.6405775547027588,
... |
func LogWith(ctx context.Context, log log.Interface) log.Interface {
userID, err := ExtractUserID(ctx)
if err == nil {
log = log.WithField("userID", userID)
}
orgID, err := ExtractOrgID(ctx)
if err == nil {
log = log.WithField("orgID", orgID)
}
return log
} | [
0.7717597484588623,
-0.5096059441566467,
0.5739946365356445,
0.23025764524936676,
-0.7811247110366821,
0.28463977575302124,
-1.123117208480835,
-0.48713555932044983,
0.4148175120353699,
-0.09603752940893173,
-0.384799599647522,
0.14729513227939606,
0.371150940656662,
-0.13862888514995575,
... |
func DeleteFrom(table string) *DeleteBuilder {
return NewDeleteBuilder(table)
} | [
1.1386233568191528,
0.3490869104862213,
0.04791652038693428,
1.4108368158340454,
-0.6351197361946106,
0.103205107152462,
-0.1260301172733307,
0.7657222151756287,
1.1928194761276245,
-1.3949111700057983,
0.023870987817645073,
0.2319401055574417,
0.06275185197591782,
-0.3712867796421051,
-... |
func InsertInto(table string) *InsertBuilder {
return NewInsertBuilder(table)
} | [
0.6196233034133911,
0.7481547594070435,
0.21852651238441467,
0.2526269853115082,
-1.066976547241211,
-0.20340199768543243,
0.03255649283528328,
1.1297868490219116,
-0.7405635118484497,
-1.0350453853607178,
-0.9957393407821655,
0.191841721534729,
-1.1948753595352173,
-0.3931647837162018,
... |
func Select(columns ...string) *SelectBuilder {
return NewSelectBuilder(columns...)
} | [
0.30977508425712585,
0.5211200714111328,
0.12128704786300659,
1.1401516199111938,
-0.2522262930870056,
0.05168957635760307,
-0.7732027173042297,
-0.24561035633087158,
0.029448967427015305,
-1.3798950910568237,
-0.5791717767715454,
0.3175083100795746,
-0.13483476638793945,
-0.80372929573059... |
func SQL(sql string, args ...interface{}) *RawBuilder {
return NewRawBuilder(sql, args...)
} | [
0.7585234045982361,
0.293642520904541,
0.4521222710609436,
1.1424912214279175,
-1.8509521484375,
-0.01971949078142643,
-1.4394594430923462,
0.48803436756134033,
0.9568919539451599,
-2.1373915672302246,
-0.041989151388406754,
0.7808319330215454,
0.691065788269043,
-0.008479411713778973,
-... |
func Update(table string) *UpdateBuilder {
return NewUpdateBuilder(table)
} | [
0.2070300579071045,
0.1531568169593811,
0.13427527248859406,
1.5744719505310059,
-1.313737154006958,
0.5385427474975586,
-0.3385501503944397,
0.8682016134262085,
0.7814372777938843,
-0.8975870013237,
-0.3149292469024658,
-0.2113317847251892,
-0.9218155741691589,
-0.37394949793815613,
-0.... |
func ProbeVolumePlugins() []volume.VolumePlugin {
return []volume.VolumePlugin{&flockerPlugin{nil}}
} | [
-0.6087684035301208,
-0.6626231074333191,
0.5233553051948547,
1.0483430624008179,
0.574248194694519,
-0.5886128544807434,
-0.542958676815033,
-0.7790560722351074,
1.6374481916427612,
0.6024505496025085,
-0.5598294138908386,
0.6058127284049988,
-0.9664841294288635,
0.30208227038383484,
0.... |
func (b *flockerVolumeMounter) CanMount() error {
return nil
} | [
1.2553575038909912,
-0.8931244015693665,
0.4746660590171814,
0.9770475625991821,
-0.40870124101638794,
-0.07534033060073853,
0.3133227825164795,
-0.4488389790058136,
0.21219630539417267,
0.05055753141641617,
-0.04911408945918083,
0.7311331629753113,
-0.48106443881988525,
1.3770161867141724... |
func (b *flockerVolumeMounter) SetUp(fsGroup *int64) error {
return b.SetUpAt(b.GetPath(), fsGroup)
} | [
-0.2123940885066986,
-0.23558220267295837,
0.2577413022518158,
-0.2218799591064453,
-0.08703707903623581,
-0.7389025092124939,
0.9579675197601318,
-0.8394577503204346,
-0.6916658282279968,
-0.07906311005353928,
0.013401082716882229,
0.06894703954458237,
-0.2756841480731964,
1.0100624561309... |
func (p *flockerPlugin) newFlockerClient(hostIP string) (*flockerapi.Client, error) {
host := env.GetEnvAsStringOrFallback("FLOCKER_CONTROL_SERVICE_HOST", defaultHost)
port, err := env.GetEnvAsIntOrFallback("FLOCKER_CONTROL_SERVICE_PORT", defaultPort)
if err != nil {
return nil, err
}
caCertPath := env.GetEnvAs... | [
-0.030568409711122513,
-0.7173872590065002,
0.49140506982803345,
0.6608625054359436,
-0.3344142436981201,
-0.3942180871963501,
1.152825951576233,
-0.6984187364578247,
-0.944239616394043,
-0.027533475309610367,
-0.8586370944976807,
0.4904794991016388,
-1.0008888244628906,
0.7819527983665466... |
func (b *flockerVolumeMounter) SetUpAt(dir string, fsGroup *int64) error {
var err error
if b.flockerClient == nil {
b.flockerClient, err = b.newFlockerClient()
if err != nil {
return err
}
}
datasetUUID, err := b.GetDatasetUUID()
if err != nil {
return fmt.Errorf("The datasetUUID for volume with datas... | [
-0.5267083048820496,
-0.4136207401752472,
0.9375426769256592,
-0.843865692615509,
-0.14548823237419128,
-0.6788942217826843,
-0.04966706037521362,
-1.0481624603271484,
-0.40189340710639954,
0.17311522364616394,
0.8774989247322083,
0.5818892121315002,
0.5441986918449402,
0.9301360845565796,... |
func (b *flockerVolumeMounter) updateDatasetPrimary(datasetUUID string, primaryUUID string) error {
// We need to update the primary and wait for it to be ready
_, err := b.flockerClient.UpdatePrimaryForDataset(primaryUUID, datasetUUID)
if err != nil {
return err
}
timeoutChan := time.NewTimer(timeoutWaitingFor... | [
-0.28657057881355286,
-0.4214487075805664,
0.5189684629440308,
-0.8186684846878052,
-0.6287039518356323,
-0.8275265097618103,
-1.1593176126480103,
-0.43987444043159485,
-0.1953788697719574,
-0.08125841617584229,
0.3789246082305908,
1.1201547384262085,
-0.14822572469711304,
-0.1314312964677... |
func (c *flockerVolumeUnmounter) TearDown() error {
return c.TearDownAt(c.GetPath())
} | [
0.6915981769561768,
-0.4002681076526642,
0.46965137124061584,
-0.021796047687530518,
0.6914930939674377,
-0.26338374614715576,
0.9394500851631165,
-0.787895143032074,
-0.01238713227212429,
-0.7237879633903503,
0.2363140732049942,
0.6126317381858826,
-0.2797151207923889,
0.5633880496025085,... |
func (c *flockerVolumeUnmounter) TearDownAt(dir string) error {
return util.UnmountPath(dir, c.mounter)
} | [
-0.05656105652451515,
-0.706215500831604,
0.5362879633903503,
-1.1825001239776611,
0.0882149338722229,
-0.7699435949325562,
0.5890359282493591,
-1.0982980728149414,
0.4069288671016693,
-1.0184307098388672,
0.7239729166030884,
-0.06650037318468094,
-0.1498871147632599,
0.7131074666976929,
... |
func (d *Database) Set(key string, value string) error {
d.dbMutex.Lock()
defer d.dbMutex.Unlock()
data := []byte(value)
d.Dlog.Append(key, data)
d.Data[key] = data
return nil
} | [
-0.7471263408660889,
1.1991788148880005,
0.31491488218307495,
-0.769014298915863,
-0.5223417282104492,
0.14193496108055115,
-1.2236183881759644,
-0.01426667533814907,
-0.4019758105278015,
0.5917962193489075,
-1.0280251502990723,
0.5280535221099854,
-0.41969332098960876,
0.43065181374549866... |
func New(dl logbook.Logbook, databaseName string) (*Database, error) {
db := &Database{
Dlog: dl,
}
// Check if data folder exists
_, err := os.Stat(config.DBFolder)
if err != nil {
if os.IsNotExist(err) {
// If folder does not exist, create it
err := os.Mkdir(config.DBFolder, 0777)
if err != nil {
... | [
-0.1630052924156189,
-0.3345055878162384,
0.6476669907569885,
-0.41760575771331787,
-0.18699932098388672,
0.8558880090713501,
-0.013812725432217121,
0.07871752232313156,
-0.6898161768913269,
0.18586061894893646,
-0.43149831891059875,
0.14856790006160736,
-0.05995027720928192,
0.65798878669... |
func (d *Database) RebuildMap() error {
d.dbMutex.Lock()
defer d.dbMutex.Unlock()
data := make(map[string][]byte)
logChan, err := d.Dlog.GetAll()
if err != nil {
log.Fatal("Could not get log.")
return err
}
for line := range logChan {
var key, value, action string
var ind int
_, err := fmt.Sscanf(li... | [
-0.9229730367660522,
0.007219954393804073,
0.44701409339904785,
-0.4423457086086273,
-0.15364374220371246,
-0.24755337834358215,
-0.03710801526904106,
0.443576455116272,
-0.24257057905197144,
-0.08719479292631149,
-0.5707483291625977,
0.8902157545089722,
0.25972801446914673,
-0.08437501639... |
func (d *Database) SaveToFile() error {
//TODO Use absolute path
err := os.Chdir("../" + config.DBFolder)
if err != nil {
fmt.Println(err)
return err
}
f, err := os.Create(fmt.Sprintf("%s%d", d.DatabaseName, d.Dlog.GetIndex()))
if err != nil {
fmt.Println(err)
return errors.New("error")
}
fmt.Printf("... | [
-0.20874610543251038,
1.0899940729141235,
0.5917347073554993,
-0.5186020731925964,
0.710219144821167,
0.8769477605819702,
0.28886908292770386,
0.434070348739624,
-1.0611082315444946,
0.6365705728530884,
-0.9482084512710571,
-0.16309718787670135,
-0.9726552367210388,
0.22780974209308624,
... |
func Open(opts *Opts) (*WAL, error) {
wal := &WAL{
filebased: filebased{
dir: opts.Dir,
fileFlags: os.O_CREATE | os.O_APPEND | os.O_WRONLY,
h: newHash(),
log: golog.LoggerFor("wal"),
},
closed: make(chan interface{}),
}
// Append a sentinel to the most recent file (just in case... | [
0.19137591123580933,
0.34318864345550537,
0.9524242281913757,
-0.16633658111095428,
-0.00007744185131741688,
0.03170768544077873,
0.5079544186592102,
-0.1513270139694214,
-0.3593895435333252,
-0.14675675332546234,
0.7978391647338867,
0.37077638506889343,
-0.27614161372184753,
-0.1539892107... |
func (wal *WAL) Latest() ([]byte, Offset, error) {
var data []byte
var offset Offset
lastSeq := int64(0)
err := wal.forEachSegmentInReverse(func(file os.FileInfo, first bool, last bool) (bool, error) {
position := int64(0)
filename := file.Name()
fileSequence := filenameToSequence(filename)
if fileSequence... | [
-0.10606079548597336,
-0.6773967146873474,
1.0705028772354126,
-0.7989175915718079,
0.613350510597229,
0.09815892577171326,
0.28237608075141907,
-0.13820886611938477,
-0.8540928959846497,
0.5270274877548218,
-0.43323755264282227,
-0.5267550945281982,
0.27476564049720764,
0.0126711456105113... |
func (wal *WAL) Write(bufs ...[]byte) error {
if wal.backlog != nil {
wal.backlog <- bufs
return nil
} else {
return wal.doWrite(bufs...)
}
} | [
0.07007895410060883,
0.25206315517425537,
0.5664772987365723,
0.7541429400444031,
1.436021327972412,
0.5190904140472412,
0.42080560326576233,
-0.5890040397644043,
-0.11532977223396301,
-0.04493233188986778,
-0.4248996376991272,
-0.23214372992515564,
-1.159013271331787,
0.3557897210121155,
... |
func (wal *WAL) TruncateBefore(o Offset) error {
cutoff := sequenceToFilename(o.FileSequence())
_, latestOffset, err := wal.Latest()
if err != nil {
return fmt.Errorf("Unable to determine latest offset: %v", err)
}
latestSequence := latestOffset.FileSequence()
return wal.forEachSegment(func(file os.FileInfo, fi... | [
0.40237903594970703,
-0.020334014669060707,
0.8301810622215271,
-0.687417209148407,
0.06452147662639618,
-0.2587781846523285,
0.6258647441864014,
-0.523167073726654,
-0.03536083921790123,
0.7498365640640259,
-0.07901857793331146,
-1.0004568099975586,
-0.31546005606651306,
0.223542273044586... |
func (wal *WAL) TruncateBeforeTime(ts time.Time) error {
return wal.TruncateBefore(NewOffset(tsToFileSequence(ts), 0))
} | [
0.3127923607826233,
-0.1443895399570465,
0.47013288736343384,
-0.5442623496055603,
0.2581530213356018,
0.21619506180286407,
-0.3987106382846832,
-0.48142775893211365,
-0.004489562474191189,
1.229423999786377,
-0.2279154360294342,
-0.36025360226631165,
-0.10464350134134293,
0.42204153537750... |
func (wal *WAL) TruncateToSize(limit int64) error {
seen := int64(0)
return wal.forEachSegmentInReverse(func(file os.FileInfo, first bool, last bool) (bool, error) {
next := file.Size()
seen += next
if seen > limit {
fullname := filepath.Join(wal.dir, file.Name())
rmErr := os.Remove(fullname)
if rmErr ... | [
0.026281151920557022,
0.8317739367485046,
0.9710016846656799,
-0.9637511968612671,
0.436564177274704,
-0.5080654621124268,
0.8318655490875244,
-0.44787320494651794,
0.28614386916160583,
0.3770897388458252,
-0.1621808111667633,
-0.4404749870300293,
-0.7142724394798279,
0.010731495916843414,... |
func (wal *WAL) CompressBefore(o Offset) error {
cutoff := sequenceToFilename(o.FileSequence())
return wal.forEachSegment(func(file os.FileInfo, first bool, last bool) (bool, error) {
if last || file.Name() >= cutoff {
// Files are sorted by name, if we've gotten past the cutoff or
// encountered the last (ac... | [
0.20032361149787903,
-0.06820601969957352,
0.722859799861908,
-0.5312368869781494,
-0.5147733092308044,
-0.48229116201400757,
0.4096205532550812,
-0.7255005836486816,
-0.6425352692604065,
0.5482358336448669,
-0.21934126317501068,
-0.8951355218887329,
-0.1188727393746376,
0.7638904452323914... |
func (wal *WAL) CompressBeforeTime(ts time.Time) error {
return wal.CompressBefore(NewOffset(tsToFileSequence(ts), 0))
} | [
-0.540552020072937,
-0.3313400447368622,
0.4490582346916199,
-0.19273899495601654,
-0.26521584391593933,
-0.026339691132307053,
-0.5954229235649109,
-0.15802662074565887,
-0.5432878732681274,
0.944405734539032,
-0.38463982939720154,
-0.5768510103225708,
0.12260167300701141,
1.0567975044250... |
func (wal *WAL) CompressBeforeSize(limit int64) error {
seen := int64(0)
return wal.forEachSegmentInReverse(func(file os.FileInfo, first bool, last bool) (bool, error) {
if last {
// Don't compress the last (active) file
return true, nil
}
next := file.Size()
seen += next
if seen > limit {
return w... | [
-0.2152876853942871,
0.5733330845832825,
0.7672842144966125,
-0.33324095606803894,
0.03491958975791931,
-0.8076658248901367,
0.636804461479187,
-0.1896921694278717,
0.11131598800420761,
0.13227099180221558,
-0.09164860099554062,
-0.42625051736831665,
-0.6319172978401184,
0.7309662103652954... |
func (wal *WAL) Close() (err error) {
wal.closeOnce.Do(func() {
select {
case <-wal.closed:
// already closed
return
default:
// continue
}
wal.log.Debug("Closing")
defer wal.log.Debug("Closed")
close(wal.closed)
if wal.backlog != nil {
close(wal.backlog)
<-wal.backlogFinished
}
... | [
0.008903518319129944,
0.0189153291285038,
0.730111837387085,
0.26204606890678406,
0.1045890524983406,
0.08347398787736893,
0.5933827757835388,
-0.9838149547576904,
-0.6444453597068787,
-0.6036202311515808,
0.9732748866081238,
0.028775649145245552,
-0.5722892880439758,
0.9529129266738892,
... |
func (wal *WAL) NewReader(name string, offset Offset, bufferSource func() []byte) (*Reader, error) {
r := &Reader{
filebased: filebased{
dir: wal.dir,
fileFlags: os.O_RDONLY,
h: newHash(),
log: golog.LoggerFor("wal." + name),
},
wal: wal,
bufferSource: bufferSource,
}
... | [
-0.7659288048744202,
-0.984659731388092,
0.8923355937004089,
-1.1286770105361938,
-0.5434696078300476,
0.03707026690244675,
0.21928435564041138,
0.04778841510415077,
-0.2634204030036926,
0.21444346010684967,
0.6687583923339844,
-0.2148464322090149,
0.27927663922309875,
0.29440250992774963,... |
func (r *Reader) Read() ([]byte, error) {
for {
length, err := r.readHeader()
if err != nil {
return nil, err
}
checksum, err := r.readHeader()
if err != nil {
return nil, err
}
if length > maxEntrySize {
fmt.Printf("Discarding wal entry of size %v exceeding %v, probably corrupted\n", humanize.B... | [
0.9541988968849182,
-0.2805975079536438,
0.7109597325325012,
-0.26779425144195557,
-0.0013727543409913778,
0.25800466537475586,
-0.42974016070365906,
-0.700929582118988,
0.29217007756233215,
0.17617125809192657,
0.6568925380706787,
0.10437607765197754,
-0.5146462321281433,
0.37996411323547... |
func (r *Reader) Offset() Offset {
return NewOffset(r.fileSequence, r.position)
} | [
-0.0001756959973135963,
-1.7747591733932495,
0.21665632724761963,
-0.8116587400436401,
-0.6197304129600525,
0.5876546502113342,
0.6424251198768616,
0.8837089538574219,
0.24491871893405914,
-0.34273698925971985,
0.2581031620502472,
-0.060474034398794174,
-0.09325964748859406,
-0.16785410046... |
func (r *Reader) Stop() {
atomic.StoreInt32(&r.stopped, 1)
} | [
-1.1661067008972168,
-0.053221479058265686,
0.09075891226530075,
-1.0793836116790771,
0.015879953280091286,
0.3679470717906952,
0.4928685128688812,
0.3505994975566864,
-1.532684087753296,
0.003328345948830247,
-0.5613986253738403,
0.33057016134262085,
-1.2980992794036865,
-0.29020756483078... |
func (r *Reader) Close() error {
atomic.StoreInt32(&r.closed, 1)
return r.file.Close()
} | [
-0.4130743443965912,
-0.17426128685474396,
0.47464460134506226,
-0.8845080733299255,
-0.4089564085006714,
0.08219963312149048,
0.4495394229888916,
-0.22210390865802765,
-1.5393003225326538,
-0.9026424884796143,
0.7319992184638977,
-0.4357324540615082,
-1.6299465894699097,
0.820416986942291... |
func (d RuntimeVersion) GetDockerInstallCandidate(kubernetesVersion string) (string, string, error) {
crVersion, err := generic.GetDockerVersion(kubernetesVersion, dockerInstallCandidates)
if err != nil {
return "", "", fmt.Errorf("failed to get docker install candidate for %s: %v", kubernetesVersion, err)
}
for... | [
-0.5042378306388855,
-1.553267240524292,
0.8592823147773743,
0.3176039755344391,
-0.919270396232605,
-0.058853358030319214,
0.5539904236793518,
0.8485002517700195,
0.0124825993552804,
0.7661905884742737,
0.23274341225624084,
0.44313591718673706,
-0.34575024247169495,
1.0714225769042969,
... |
func (s replicatedSession) replicate(params replicatedParams) error {
for _, asyncSession := range s.asyncSessions {
asyncSession := asyncSession // capture var
var (
clonedID = s.identifierPool.Clone(params.id)
clonedNS = s.identifierPool.Clone(params.namespace)
clonedTags ident.TagIterator
)
if... | [
-1.0813047885894775,
-0.4169144034385681,
0.6635167598724365,
-0.16931329667568207,
0.22491709887981415,
-0.27755454182624817,
0.31131476163864136,
-0.2164975255727768,
0.3320329487323761,
0.8507317304611206,
-0.3419787287712097,
0.05686638131737709,
-0.12066728621721268,
-0.20547598600387... |
func (s replicatedSession) Write(
namespace, id ident.ID, t xtime.UnixNano, value float64,
unit xtime.Unit, annotation []byte,
) error {
return s.replicate(replicatedParams{
namespace: namespace,
id: id,
t: t.Add(-s.writeTimestampOffset),
value: value,
unit: unit,
annotation:... | [
-0.6508066654205322,
0.1481429785490036,
0.30803823471069336,
-0.20566920936107635,
0.4958072602748871,
0.5046573281288147,
-0.23954962193965912,
0.3970124423503876,
0.6497980356216431,
0.7353489995002747,
-0.9352536201477051,
0.6991776823997498,
0.1601918339729309,
-0.3902817666530609,
... |
func (s replicatedSession) WriteTagged(
namespace, id ident.ID, tags ident.TagIterator, t xtime.UnixNano,
value float64, unit xtime.Unit, annotation []byte,
) error {
return s.replicate(replicatedParams{
namespace: namespace,
id: id,
t: t.Add(-s.writeTimestampOffset),
value: value,
u... | [
-0.351442813873291,
0.11001452803611755,
0.5438201427459717,
-0.6593436598777771,
0.629126250743866,
0.11528508365154266,
-0.12221371382474899,
-0.11904651671648026,
0.14731286466121674,
0.5372574329376221,
-1.4498275518417358,
0.5369341373443604,
-0.08420342206954956,
0.2861529290676117,
... |
func (s replicatedSession) Fetch(
namespace, id ident.ID, startInclusive, endExclusive xtime.UnixNano,
) (encoding.SeriesIterator, error) {
return s.session.Fetch(namespace, id, startInclusive, endExclusive)
} | [
0.11939124017953873,
-0.423837274312973,
0.1509418487548828,
-0.44135966897010803,
-1.3346004486083984,
-0.04047836735844612,
-1.3199824094772339,
-1.2270848751068115,
0.5637943744659424,
-0.02611672878265381,
-0.5945402383804321,
2.1625542640686035,
0.8079249262809753,
-0.3835611641407013... |
func (s replicatedSession) FetchIDs(
namespace ident.ID, ids ident.Iterator, startInclusive, endExclusive xtime.UnixNano,
) (encoding.SeriesIterators, error) {
return s.session.FetchIDs(namespace, ids, startInclusive, endExclusive)
} | [
-0.5328193306922913,
-0.11096484214067459,
0.06462078541517258,
-0.2624400854110718,
-1.1775121688842773,
-0.03626220300793648,
-0.8247029781341553,
-0.8476629853248596,
0.6371312141418457,
0.4825398325920105,
-0.4747377336025238,
1.6947007179260254,
0.4176466763019562,
-0.4371581375598907... |
func (s replicatedSession) Aggregate(
ctx context.Context,
ns ident.ID,
q index.Query,
opts index.AggregationOptions,
) (AggregatedTagsIterator, FetchResponseMetadata, error) {
return s.session.Aggregate(ctx, ns, q, opts)
} | [
-0.7781856656074524,
0.9173019528388977,
0.3504738509654999,
-0.802950382232666,
0.24267280101776123,
-0.5164861679077148,
-0.6393963694572449,
-1.9279593229293823,
0.927914559841156,
-0.19689945876598358,
-0.2260473072528839,
0.6228653192520142,
0.34831637144088745,
-0.18591263890266418,
... |
func (s replicatedSession) FetchTagged(
ctx context.Context,
namespace ident.ID,
q index.Query,
opts index.QueryOptions,
) (encoding.SeriesIterators, FetchResponseMetadata, error) {
return s.session.FetchTagged(ctx, namespace, q, opts)
} | [
0.3331698775291443,
-0.003813052549958229,
0.33088624477386475,
-0.5191121101379395,
-0.3318845331668854,
0.057245418429374695,
-0.633698046207428,
-2.0268709659576416,
1.524672508239746,
0.39045995473861694,
-0.7956156134605408,
1.360191822052002,
0.8653544187545776,
0.293599396944046,
... |
func (s replicatedSession) FetchTaggedIDs(
ctx context.Context,
namespace ident.ID,
q index.Query,
opts index.QueryOptions,
) (TaggedIDsIterator, FetchResponseMetadata, error) {
return s.session.FetchTaggedIDs(ctx, namespace, q, opts)
} | [
0.11489561945199966,
-0.02778146229684353,
0.15409879386425018,
-0.8748957514762878,
-0.38993605971336365,
0.2971486747264862,
-1.1138397455215454,
-1.553599238395691,
1.3627513647079468,
0.308879554271698,
-0.4964626431465149,
1.1705660820007324,
-0.02608856000006199,
0.33538660407066345,... |
func (s replicatedSession) ShardID(id ident.ID) (uint32, error) {
return s.session.ShardID(id)
} | [
0.492127925157547,
-0.26055386662483215,
0.5623498558998108,
-0.9868292212486267,
-0.3845064640045166,
0.34803980588912964,
0.15297086536884308,
-0.039731014519929886,
1.3577982187271118,
0.23413951694965363,
-0.2019692212343216,
1.4832663536071777,
-0.29041871428489685,
0.0633273050189018... |
func (s replicatedSession) IteratorPools() (encoding.IteratorPools, error) {
return s.session.IteratorPools()
} | [
-0.9816175103187561,
-0.6136938333511353,
0.22582225501537323,
-0.15457305312156677,
-1.1331392526626587,
0.5189912915229797,
1.4336646795272827,
-0.4710381031036377,
0.9332664012908936,
0.5579255223274231,
-0.5927544236183167,
0.8374082446098328,
-0.38619422912597656,
-0.8986112475395203,... |
func (s replicatedSession) Origin() topology.Host {
return s.session.Origin()
} | [
-0.23671799898147583,
-0.8529818058013916,
0.3452954888343811,
0.18259678781032562,
-0.4674047827720642,
0.8772986531257629,
1.000640630722046,
1.0038999319076538,
0.8866603374481201,
-0.22074447572231293,
-0.0967981144785881,
1.6150479316711426,
0.8514132499694824,
-1.073710322380066,
-... |
func (s replicatedSession) Replicas() int {
return s.session.Replicas()
} | [
-0.7714985013008118,
0.46932780742645264,
0.16699275374412537,
-0.5226791501045227,
-1.2038700580596924,
-0.332191526889801,
-0.025342175737023354,
0.5487273931503296,
1.0926496982574463,
0.10077153891324997,
-0.8236392140388489,
0.6717532277107239,
0.3701130449771881,
-0.46760058403015137... |
func (s replicatedSession) TopologyMap() (topology.Map, error) {
return s.session.TopologyMap()
} | [
-0.7815132737159729,
-0.16418905556201935,
0.2912865877151489,
-0.11034130305051804,
-0.6089008450508118,
0.49100959300994873,
0.9739792943000793,
0.14688706398010254,
1.7736716270446777,
-0.10416150838136673,
-0.22456704080104828,
-0.31499388813972473,
0.9385175108909607,
-1.5372476577758... |
func (s replicatedSession) Truncate(namespace ident.ID) (int64, error) {
return s.session.Truncate(namespace)
} | [
-0.3022828996181488,
0.839775025844574,
0.220143124461174,
-0.41177526116371155,
-0.49793338775634766,
-0.6423848867416382,
-0.11914630234241486,
-0.9671867489814758,
1.55117928981781,
0.49749794602394104,
-0.6659349799156189,
1.0985851287841797,
-0.5170788764953613,
-0.2582206428050995,
... |
func (s replicatedSession) FetchBootstrapBlocksFromPeers(
namespace namespace.Metadata,
shard uint32,
start, end xtime.UnixNano,
opts result.Options,
) (result.ShardResult, error) {
return s.session.FetchBootstrapBlocksFromPeers(namespace, shard, start, end, opts)
} | [
-0.19032999873161316,
-0.4857751727104187,
0.4126182198524475,
0.3927595913410187,
-0.7331053614616394,
-0.17423148453235626,
-1.4087613821029663,
-1.1394399404525757,
0.23053400218486786,
0.22107207775115967,
-0.01767398789525032,
0.7408837676048279,
-0.3990199565887451,
0.064272850751876... |
func (s replicatedSession) FetchBootstrapBlocksMetadataFromPeers(
namespace ident.ID,
shard uint32,
start, end xtime.UnixNano,
result result.Options,
) (PeerBlockMetadataIter, error) {
return s.session.FetchBootstrapBlocksMetadataFromPeers(namespace, shard, start, end, result)
} | [
-0.20641177892684937,
-0.20133395493030548,
0.4472203552722931,
0.1406109482049942,
-0.4044751524925232,
-0.28276583552360535,
-0.9092281460762024,
-1.5917435884475708,
-0.15327316522598267,
0.22315730154514313,
-0.20298582315444946,
0.9001274704933167,
-0.42789673805236816,
0.515425801277... |
func (s replicatedSession) FetchBlocksMetadataFromPeers(
namespace ident.ID,
shard uint32,
start, end xtime.UnixNano,
consistencyLevel topology.ReadConsistencyLevel,
result result.Options,
) (PeerBlockMetadataIter, error) {
return s.session.FetchBlocksMetadataFromPeers(namespace, shard, start, end, consistencyLev... | [
-0.25812357664108276,
-0.046300649642944336,
0.4445795714855194,
0.00692724296823144,
-0.43682312965393066,
0.174605593085289,
-0.7930867671966553,
-1.3490140438079834,
-0.006739061791449785,
0.46177345514297485,
0.2150023728609085,
0.6951321959495544,
-0.4462891221046448,
0.01810633018612... |
func (s replicatedSession) FetchBlocksFromPeers(
namespace namespace.Metadata,
shard uint32,
consistencyLevel topology.ReadConsistencyLevel,
metadatas []block.ReplicaMetadata,
opts result.Options,
) (PeerBlocksIter, error) {
return s.session.FetchBlocksFromPeers(namespace, shard, consistencyLevel, metadatas, opts... | [
-0.37131887674331665,
-0.12310874462127686,
0.3893767297267914,
-0.13412588834762573,
-0.6809481382369995,
0.26961836218833923,
-0.774225652217865,
-0.8431500792503357,
0.544221818447113,
0.530183732509613,
0.3302609920501709,
0.3317945897579193,
-0.38454803824424744,
-0.06175213307142258,... |
func (s replicatedSession) Open() error {
if err := s.session.Open(); err != nil {
return err
}
for _, asyncSession := range s.asyncSessions {
if err := asyncSession.Open(); err != nil {
s.log.Error("could not open session to async cluster: %v", zap.Error(err))
}
}
return nil
} | [
-0.7868373394012451,
0.34741631150245667,
0.256493479013443,
-0.14761477708816528,
0.17216859757900238,
-0.055823102593421936,
1.0687443017959595,
0.7703028917312622,
0.4174879491329193,
0.8835337162017822,
-0.055305808782577515,
0.6525728702545166,
0.1917036771774292,
-0.5915483236312866,... |
func TestConnectionGroup(t *testing.T) {
t.Run("test adding connection to group", func(t *testing.T) {
group, _ := createGroupWithConnection()
if group.Count() != 1 {
t.Errorf("Group should have 1 connection, it has %d", group.Count())
}
})
t.Run("test closing down group", func(t *testing.T) {
group, co... | [
-0.381767600774765,
0.6880759596824646,
0.4478170871734619,
-0.014926903881132603,
0.3390243351459503,
-0.09199443459510803,
0.7403943538665771,
-0.746065080165863,
-0.6054308414459229,
-0.28279146552085876,
0.5389612913131714,
-0.20767326653003693,
-0.7640045881271362,
0.8068312406539917,... |
func CreateUserPath() string {
return fmt.Sprintf("/users")
} | [
0.07634734362363815,
-0.2897339463233948,
0.17127501964569092,
0.4032442569732666,
-0.1254308670759201,
1.0398948192596436,
0.5350456833839417,
-0.11029569804668427,
-0.35449641942977905,
-0.0073103150352835655,
0.21351611614227295,
-0.1914757937192917,
-0.7201895713806152,
0.5936607718467... |
func (c *Client) NewCreateUserRequest(ctx context.Context, path string, payload *CreateUserPayload, contentType string) (*http.Request, error) {
var body bytes.Buffer
if contentType == "" {
contentType = "*/*" // Use default encoder
}
err := c.Encoder.Encode(payload, &body, contentType)
if err != nil {
return ... | [
-0.47515642642974854,
-0.5256346464157104,
0.7366443276405334,
0.22992047667503357,
-1.099661111831665,
-0.38868382573127747,
-0.055612962692976,
-0.7700983881950378,
-0.35369306802749634,
0.29918399453163147,
-0.1588858664035797,
0.6696569323539734,
-0.47547978162765503,
0.856128990650177... |
func DeleteUserPath(id interface{}) string {
param0 := fmt.Sprintf("%v", id)
return fmt.Sprintf("/users/%s", param0)
} | [
-0.38027507066726685,
-0.41955867409706116,
0.16548989713191986,
0.8390987515449524,
-0.6922147274017334,
0.5808642506599426,
1.1360677480697632,
-0.11269690841436386,
0.6077063679695129,
-0.09805101156234741,
-0.11868506669998169,
0.0053032878786325455,
-0.5456915497779846,
0.761227726936... |
func (c *Client) NewDeleteUserRequest(ctx context.Context, path string) (*http.Request, error) {
scheme := c.Scheme
if scheme == "" {
scheme = "http"
}
u := url.URL{Host: c.Host, Scheme: scheme, Path: path}
req, err := http.NewRequest("DELETE", u.String(), nil)
if err != nil {
return nil, err
}
return req, ... | [
-0.6387211084365845,
-0.30491191148757935,
0.5301722288131714,
0.572313129901886,
-1.2016726732254028,
-0.49250635504722595,
0.13673338294029236,
0.1294286847114563,
-0.015449829399585724,
-0.295522004365921,
-0.12755036354064941,
0.9844680428504944,
-0.3705209791660309,
0.4298641383647918... |
func ListUserPath() string {
return fmt.Sprintf("/users")
} | [
0.024217532947659492,
-0.5796498656272888,
0.37852782011032104,
0.36018693447113037,
-0.6597306728363037,
0.4389210343360901,
0.5010998249053955,
-0.1228329986333847,
0.6256788372993469,
0.01489066332578659,
0.10971464216709137,
0.4305630624294281,
-0.45615848898887634,
0.640476405620575,
... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.