text stringlengths 11 6.3k | embedding listlengths 768 768 |
|---|---|
func (d *Domain) CreateSWANURL(
r *http.Request,
returnURL string,
action string,
addParams func(url.Values)) (string, *SWANError) {
b, err := d.CallSWANStorageURL(r, action, func(q url.Values) error {
// Set the return URL after the operation completes.
q.Set("returnUrl", returnURL)
// Add user interface ... | [
-0.6230360865592957,
0.5924316048622131,
0.5190637707710266,
0.2272094339132309,
-0.41485604643821716,
-0.219115749001503,
0.40259167551994324,
-0.809363842010498,
-0.033193305134773254,
0.26927661895751953,
0.3127598166465759,
0.6208509206771851,
-0.10091593116521835,
0.5666043162345886,
... |
func (d *Domain) GetOWIDCreator() (*owid.Creator, error) {
var err error
if d.owid == nil {
d.owid, err = d.owidStore.GetCreator(d.Host)
if err != nil {
return nil, err
}
if d.owid == nil {
return nil, fmt.Errorf(
"Domain '%s' is not a registered OWID creator. Register the "+
"domain for the SW... | [
0.004932489711791277,
1.3966251611709595,
0.27082720398902893,
-0.08172029256820679,
-0.1034608855843544,
0.2022571712732315,
0.40738630294799805,
-0.6634863018989563,
0.7437061071395874,
-0.7538289427757263,
0.41109541058540344,
1.133302092552185,
-0.44394010305404663,
0.7637131214141846,... |
func (authCredentials *AuthCredentials) Authenticate(database *sql.DB) {
hasUsername := len(authCredentials.Username) > 0
hasEmail := len(authCredentials.Email) > 0
hasPassword := len(authCredentials.Password) > 0
if (!hasUsername && !hasEmail) || !hasPassword {
panic(&ModelError{
Code: AuthErrorMissingPara... | [
-0.4229052662849426,
0.397630512714386,
0.48070576786994934,
0.5477288365364075,
0.7534564733505249,
0.4279148280620575,
-0.21332310140132904,
0.23216798901557922,
-0.47501686215400696,
0.6496042013168335,
-0.12392798811197281,
-0.1545034646987915,
-0.3505290150642395,
0.7684535980224609,
... |
func (q *Query) WhereRaw(raw string, vals ...interface{}) *Query {
q.conditions = append(q.conditions, &condition{raw: raw, rawVals: vals})
return q
} | [
0.1724177896976471,
0.441232293844223,
0.2694963812828064,
-0.24368798732757568,
-1.667383074760437,
0.6791123747825623,
-0.426552414894104,
0.09244422614574432,
-0.28007590770721436,
-1.1371972560882568,
0.49967673420906067,
0.13818153738975525,
1.0268248319625854,
-0.07133486866950989,
... |
func (q *Query) And(and *Query) *Query {
q.ands = append(q.ands, and)
return q
} | [
0.005509299226105213,
-1.5425375699996948,
0.5670561194419861,
-0.6154579520225525,
-1.0078859329223633,
0.6265984773635864,
-1.0071765184402466,
0.8820302486419678,
1.2865179777145386,
-1.2719448804855347,
0.3678824305534363,
0.8926432132720947,
0.3534477949142456,
0.888852059841156,
-0... |
func (q *Query) OrderBy(bys ...string) *Query {
q.orderBys = append(q.orderBys, bys...)
return q
} | [
-0.35775279998779297,
0.15619929134845734,
0.3776913583278656,
0.8364602327346802,
-0.16697566211223602,
0.20149557292461395,
-0.5782209038734436,
-0.083060123026371,
-0.1397491842508316,
-0.5825937390327454,
-0.004451307468116283,
-0.016315748915076256,
-0.24761414527893066,
-0.3859889507... |
func (q *Query) Limit(i int) *Query {
q.limit = i
return q
} | [
-0.5714830160140991,
0.29335498809814453,
0.25989824533462524,
-0.2551380693912506,
-0.2100342959165573,
1.0133121013641357,
0.6268581748008728,
0.07487309724092484,
0.6790018081665039,
-0.7391299605369568,
-0.21748128533363342,
-0.4624944031238556,
-0.6971085071563721,
-0.6870258450508118... |
func (q *Query) Exec(ctx context.Context) (*QueryResult, error) {
var r QueryResult
if q.client == nil || !q.client.Started() {
return &r, fmt.Errorf("client or db is nil")
}
switch q.action {
case "select":
rows, err := q.execSelect(ctx)
r.Rows = rows
return &r, err
case "insert":
rows, err := q.exec... | [
0.24117986857891083,
0.6886656284332275,
0.5473303198814392,
0.15497058629989624,
-0.4903810918331146,
0.05396581441164017,
-0.3943885266780853,
-0.5391037464141846,
0.41019001603126526,
-0.04341920092701912,
0.4654848277568817,
-0.22188179194927216,
-0.1454058587551117,
0.1414091289043426... |
func (q *Query) whereClause(i int) (string, []interface{}) {
if i < 1 {
// the numbering starts at $1 not $0
i = 1
}
vals := make([]interface{}, 0, len(q.conditions))
b := strings.Builder{}
// get length of values since the numbering of the where clause starts after values
startPos := len(q.values) + i
c... | [
-0.013555481098592281,
-0.4796851873397827,
0.8534283638000488,
-0.3634967505931854,
-0.6279411911964417,
-0.5239530205726624,
0.5045245885848999,
0.5826338529586792,
-0.1795736402273178,
0.26607343554496765,
-0.10406502336263657,
-0.4020770192146301,
-0.29284924268722534,
0.38696345686912... |
func (c *condition) Clause(i int) (string, int) {
var condClause string
if nullable, ok := c.val.(Nullable); c.val == nil || (ok && nullable.IsNull()) {
condClause = condClauseNull(c.negative)
} else if _, ok := c.val.(Range); ok {
condClause, i = condClauseRange(i, c.negative)
} else if err := verifyArray(refl... | [
-0.5282356142997742,
-0.5692343711853027,
0.6491217613220215,
-0.5163828134536743,
-0.46640250086784363,
-0.14401517808437347,
-0.24024268984794617,
0.11503294110298157,
-0.1322099268436432,
0.44512471556663513,
0.6509069800376892,
-0.10564980655908585,
-0.7316817045211792,
0.4104824364185... |
func (r *QueryResult) Slice(ctx context.Context, slicePtr interface{}) error {
if r.Rows == nil {
return errors.New("result rows is nil")
}
defer r.Close()
slicePtrType := reflect.TypeOf(slicePtr)
// make sure this is a pointer
if err := verifyPtr(slicePtrType); err != nil {
return err
}
sliceType := sl... | [
-0.9017568826675415,
-0.061515022069215775,
0.31120577454566956,
0.8934503793716431,
-0.9533737301826477,
-0.5728836059570312,
-0.024477185681462288,
-0.7555781006813049,
1.0006619691848755,
0.16165578365325928,
0.6691333055496216,
0.06980712711811066,
-0.36699455976486206,
0.4298758506774... |
func (r *QueryResult) Scan(ctx context.Context, ptr interface{}) error {
if r.Rows == nil {
return errors.New("result rows is nil")
}
defer r.Close()
if !r.Rows.Next() {
if r.Rows.Err() != nil {
return r.Rows.Err()
}
return ErrNoRows
}
ptrType := reflect.TypeOf(ptr)
// make sure this is a pointer
... | [
-0.7982666492462158,
0.5173153877258301,
0.6170493960380554,
0.46283820271492004,
-1.3139688968658447,
-0.40075692534446716,
0.45171722769737244,
-1.28659188747406,
0.509183943271637,
-0.8026306629180908,
0.17225246131420135,
-0.05150751769542694,
-0.11833859980106354,
0.8415823578834534,
... |
func AttributeEndorsementFromBase64(payload64 string) (*AttributeEndorsement, error) {
// decode the base64 string
if bytes, err := base64.StdEncoding.DecodeString(payload64); err != nil {
logger.Debug("Failed to decode base64 payload: %s", err)
return nil, fmt.Errorf("attribute endorsement base64 encoding incorr... | [
0.04938431456685066,
-0.04347589984536171,
0.5753871202468872,
-0.49832502007484436,
-1.4246784448623657,
-0.2071819007396698,
-0.5028952360153198,
0.6769688725471497,
0.012948720715939999,
0.4833192229270935,
0.784337043762207,
0.4803050756454468,
-0.4540393352508545,
-0.01993768848478794... |
func (a *AttributeEndorsement) ToBytes() []byte {
if bytes, err := json.Marshal(a); err != nil {
logger.Debug("Failed to json serialize: %s", err)
return nil
} else {
return bytes
}
} | [
0.09983275830745697,
1.0011225938796997,
0.6848150491714478,
-1.621044635772705,
0.0891624465584755,
-1.0861355066299438,
-0.22947785258293152,
0.24739333987236023,
0.714148223400116,
0.8512433171272278,
0.21196770668029785,
0.8939003348350525,
-0.10507022589445114,
0.3525823950767517,
0... |
func (a *AttributeEndorsement) ToBase64() string {
return base64.StdEncoding.EncodeToString(a.ToBytes())
} | [
0.08793480694293976,
-0.0534009113907814,
0.6208006739616394,
-0.1976691484451294,
0.30565911531448364,
0.07061084359884262,
0.07554987818002701,
0.9757011532783508,
0.35063686966896057,
1.2286170721054077,
0.5877267122268677,
0.31836777925491333,
-0.2581927478313446,
-0.000055965781939448... |
func createAccessToken(user model.User) (string, error) {
var newUser = model.User{}
newUser.ID = user.ID
expiresAt := time.Now().Add(time.Duration(config.Conf.JwtTokenExpiration) * time.Millisecond)
claims := UserClaim{
newUser,
jwt.StandardClaims{
ExpiresAt: expiresAt.Unix(),
},
}
// Generates access ... | [
0.37098345160484314,
-0.537414014339447,
0.6927311420440674,
-0.49959585070610046,
-1.8134288787841797,
0.7868834137916565,
0.09048444032669067,
-0.4508618414402008,
0.18788181245326996,
0.28116968274116516,
-0.17887862026691437,
0.5597859621047974,
0.6303932070732117,
0.30729639530181885,... |
func (a *AuthController) SignUp(c *gin.Context) {
// Retrieve the body
signUpUserForm := validator2.SignUpUserForm{}
if err := c.ShouldBindJSON(&signUpUserForm); err != nil {
c.JSON(http.StatusBadRequest, gin.H{"error": err.Error()})
return
}
// Validate the form
validate := validator.New()
err := validate.... | [
-0.12204347550868988,
0.715638279914856,
1.0358712673187256,
0.055621303617954254,
0.5293105244636536,
0.1348828822374344,
0.196098193526268,
0.047247715294361115,
-0.0035991647746413946,
0.18990805745124817,
0.11173296719789505,
0.36716338992118835,
0.03803505375981331,
0.1216337606310844... |
func (a *AuthController) Login(c *gin.Context) {
// Retrieve the body
loginUserForm := validator2.LoginUserForm{}
if err := c.ShouldBindJSON(&loginUserForm); err != nil {
c.JSON(http.StatusBadRequest, gin.H{"error": err.Error()})
return
}
// Validate the form
validate := validator.New()
err := validate.Stru... | [
0.2596011757850647,
-0.02528790570795536,
0.8541727066040039,
0.637458860874176,
-0.1348423808813095,
-0.3033618927001953,
-0.3210095763206482,
-0.4578224718570709,
-0.08789992332458496,
-0.34265759587287903,
-0.30223366618156433,
0.8083679676055908,
0.11032558232545853,
0.0659497603774070... |
func (a *AuthController) RefreshAccessToken(c *gin.Context) {
// Retrieve the body
refreshingTokenForm := validator2.RefreshingTokenForm{}
if err := c.ShouldBindJSON(&refreshingTokenForm); err != nil {
c.JSON(http.StatusBadRequest, gin.H{"error": err.Error()})
return
}
// Validate the form
validate := valida... | [
0.3535166382789612,
0.4012983441352844,
0.8285900354385376,
-0.06258574873209,
-0.49205610156059265,
-0.02960662543773651,
-0.12867887318134308,
-0.5942357778549194,
-0.12164699286222458,
0.1625632345676422,
0.2343256026506424,
1.4014322757720947,
0.485844224691391,
0.7471861839294434,
0... |
func GetColumnNames(table string) []string {
var columns []string
if configs.DbConfig.DbDriver == "mysql" {
columns = getColumnsMySQL(table)
} else if configs.DbConfig.DbDriver == "postgresql" {
columns = getColumnsPG(table)
}
return columns
} | [
-0.654295802116394,
0.05369298905134201,
0.6250466704368591,
1.1833175420761108,
0.42205172777175903,
-0.21018388867378235,
-0.43165895342826843,
-0.2605254054069519,
-0.10544987767934799,
0.9285953044891357,
-0.728180468082428,
0.11166113615036011,
-0.09921088814735413,
0.7787076830863953... |
func getColumnsPG(table string) []string {
columns := []map[string]interface{}{}
columnNames := []string{}
sqlCommand := fmt.Sprintf("SELECT column_name FROM information_schema.columns WHERE table_name='%s'", table)
initdb.DB.Raw(sqlCommand).Scan(&columns)
for _, v := range columns {
columnNames = append(col... | [
-0.4551188051700592,
0.5068708658218384,
0.9485286474227905,
0.6687408089637756,
0.23790960013866425,
-0.3480181396007538,
-0.9449989795684814,
-0.13917098939418793,
-1.3988054990768433,
1.0970308780670166,
-0.1363368183374405,
-0.07785747945308685,
-0.25407329201698303,
0.3738574087619781... |
func NewTime(t time.Time, valid bool) Time {
return Time{
Time: t,
Valid: valid,
}
} | [
0.29170477390289307,
0.24951130151748657,
0.4525734484195709,
0.6928240656852722,
-0.7701428532600403,
0.8245358467102051,
-1.9335246086120605,
-0.06801331788301468,
-0.05647885799407959,
0.99253910779953,
-0.05958060175180435,
-0.7155668139457703,
-0.3442535996437073,
-0.7229077816009521,... |
func TimeFrom(t time.Time) Time {
return NewTime(t, true)
} | [
0.3984239101409912,
0.1973123550415039,
0.3434092700481415,
0.06613587588071823,
-0.7278424501419067,
0.6655254364013672,
-0.6885183453559875,
-0.5702171325683594,
0.45998314023017883,
0.6544957756996155,
-0.9176537394523621,
-0.9377027153968811,
0.7830907702445984,
0.08871317654848099,
... |
func TimeFromPtr(t *time.Time) Time {
if t == nil {
return NewTime(time.Time{}, false)
}
return NewTime(*t, true)
} | [
0.1598409116268158,
-0.3841923177242279,
0.42131951451301575,
0.009710978716611862,
-0.3545261323451996,
0.3805174231529236,
-0.32278740406036377,
-0.4159089922904968,
-0.14381183683872223,
1.0893396139144897,
-0.23822230100631714,
-1.570456624031067,
-0.11788232624530792,
-0.0362697094678... |
func (t *Time) Scan(value interface{}) error {
var err error
switch x := value.(type) {
case time.Time:
t.Time = x
case nil:
t.Valid = false
return nil
default:
err = fmt.Errorf("null: cannot scan type %T into null.Time: %v", value, value)
}
t.Valid = err == nil
return err
} | [
-0.5230497717857361,
0.6207773089408875,
0.6906054615974426,
0.7191211581230164,
-0.6942533254623413,
0.09195327758789062,
0.021744750440120697,
-0.5416083931922913,
0.46420302987098694,
0.20152008533477783,
-0.36404889822006226,
0.14514167606830597,
0.09108520299196243,
1.15309476852417,
... |
func (t Time) Value() (driver.Value, error) {
if !t.Valid {
return nil, nil
}
return t.Time, nil
} | [
-0.5489850044250488,
0.19652307033538818,
0.4886370301246643,
0.8044896125793457,
0.5828615427017212,
0.31116506457328796,
0.02203993685543537,
-0.5954316854476929,
0.5654929280281067,
1.2445508241653442,
0.28079840540885925,
-0.29804736375808716,
-0.26949837803840637,
0.7369189858436584,
... |
func (t Time) MarshalJSON() ([]byte, error) {
return t.MarshalText()
} | [
-0.03623799979686737,
-0.3249973654747009,
0.20857323706150055,
-0.14925843477249146,
-1.1139973402023315,
0.044506411999464035,
-0.5936160087585449,
0.029658356681466103,
0.22996489703655243,
1.0911539793014526,
-1.6077241897583008,
-0.08128605782985687,
-0.4445030689239502,
1.41720783710... |
func (t *Time) UnmarshalJSON(data []byte) error {
return t.UnmarshalText(data)
} | [
-0.14794057607650757,
0.31679385900497437,
0.45243969559669495,
-1.260399341583252,
-1.1055127382278442,
0.14556807279586792,
-0.5591718554496765,
-0.10464552044868469,
-0.09906074404716492,
1.3710110187530518,
-1.0648289918899536,
-0.8492458462715149,
-0.6040355563163757,
1.09325778484344... |
func (t Time) MarshalText() ([]byte, error) {
if !t.Valid {
return []byte("null"), nil
}
return []byte(strconv.FormatInt(t.toEpochMsec(), 10)), nil
} | [
0.5566955804824829,
0.45006054639816284,
0.4640880823135376,
0.04883256554603577,
-0.2942653298377991,
-0.182763934135437,
-1.759860873222351,
-0.33428600430488586,
1.1357192993164062,
1.1302521228790283,
-0.7324919104576111,
-0.3698408603668213,
-0.4849497079849243,
0.8186944127082825,
... |
func (t *Time) UnmarshalText(data []byte) error {
str := string(data)
if str == "" || str == "null" {
t.Valid = false
return nil
}
var epochMsec int64
if err := json.Unmarshal(data, &epochMsec); err != nil {
t.Valid = false
return nil
}
t.Time = t.timeFromEpochMsec(epochMsec)
return nil
} | [
0.6531519293785095,
0.29828572273254395,
0.7985727787017822,
-0.9202216267585754,
-1.0240308046340942,
-0.5182207226753235,
-0.8196054697036743,
0.3524966835975647,
0.1793145388364792,
1.3927888870239258,
-0.549610435962677,
-0.7769016027450562,
-0.3986644446849823,
0.2700819969177246,
-... |
func (t *Time) SetValid(v time.Time) {
t.Time = v
t.Valid = true
} | [
0.4711928963661194,
-0.25042566657066345,
0.336664617061615,
0.34288540482521057,
-0.45424309372901917,
1.247758150100708,
-0.7987905740737915,
0.02224516123533249,
-0.07380183041095734,
0.6449261903762817,
-0.796444833278656,
0.47706884145736694,
0.1532740443944931,
0.5700547695159912,
... |
func (t Time) Ptr() *time.Time {
if !t.Valid {
return nil
}
return &t.Time
} | [
0.35712191462516785,
0.24841254949569702,
0.4213257431983948,
0.5351723432540894,
-0.9507025480270386,
0.5497335195541382,
-0.8771122097969055,
-1.089163064956665,
0.7816370129585266,
0.7073184251785278,
0.927905797958374,
-0.08286844193935394,
-0.9740694761276245,
0.7009758949279785,
0.... |
func (o AgentOptions) Validate() error {
if o.Mbus == "" {
return bosherr.Error("Must provide a non-empty Mbus")
}
return nil
} | [
0.4901140034198761,
0.630475640296936,
0.39967238903045654,
-0.02254556305706501,
0.8646501898765564,
-0.08051156997680664,
0.025354813784360886,
-0.4083585739135742,
0.061308037489652634,
0.33936765789985657,
0.4419625997543335,
-0.43242862820625305,
-0.9388682842254639,
0.303006440401077... |
func Geostd8_bin_RuneWeight(r rune) int32 {
weight, ok := geostd8_bin_Weights[r]
if ok {
return weight
} else if r >= 0 && r <= 127 {
return r + 0
} else {
return 2147483647
}
} | [
-0.4046168923377991,
-0.2045125663280487,
0.6281127333641052,
-0.3003014326095581,
-0.8593077063560486,
0.5184865593910217,
0.5400684475898743,
-0.8447414636611938,
-0.2809121012687683,
0.44703564047813416,
0.5725572109222412,
0.3913610577583313,
-0.7855522036552429,
0.41602808237075806,
... |
func minDistance(word1 string, word2 string) int {
dp := make([][]int, len(word2)+1)
for i := range dp {
dp[i] = make([]int, len(word1)+1)
dp[i][0] = i
}
for i := 0; i < len(word1)+1; i++ {
dp[0][i] = i
}
for i := 1; i < len(word2)+1; i++ {
for j := 1; j < len(word1)+1; j++ {
if word2[i-1] == word1[j-1... | [
0.31820374727249146,
-0.26642507314682007,
1.1322379112243652,
-0.8159810304641724,
-1.4543395042419434,
-0.30502694845199585,
0.03154434263706207,
-0.3305181860923767,
0.2483493685722351,
1.3689385652542114,
0.006035950034856796,
1.266664981842041,
-1.647454023361206,
-0.2639073133468628,... |
func RunTestSuite(t *testing.T, s storage.Storage) {
t.Run("UpdateAuthRequest", func(t *testing.T) { testUpdateAuthRequest(t, s) })
t.Run("CreateRefresh", func(t *testing.T) { testCreateRefresh(t, s) })
} | [
-0.9783503413200378,
-0.08136032521724701,
0.4074631631374359,
0.36993905901908875,
0.6027077436447144,
0.6122241616249084,
0.5769621729850769,
-0.4608552157878876,
0.21019938588142395,
-0.44926634430885315,
-0.2603054940700531,
0.25747495889663696,
0.0545191764831543,
0.028170760720968246... |
func AddToManager(m manager.Manager, cfg *rest.Config) error {
for _, f := range AddToManagerFuncs {
if err := f(m); err != nil {
return err
}
}
for _, f := range AddToManagerFuncsWithCfg {
if err := f(m, cfg); err != nil {
return err
}
}
return nil
} | [
-0.8086945414543152,
0.2757681906223297,
0.2695881128311157,
0.24893921613693237,
0.041423436254262924,
-0.58840012550354,
-0.18954114615917206,
-0.2604161500930786,
0.16988058388233185,
-0.5442017912864685,
-0.43209508061408997,
-0.37935230135917664,
-0.5984818339347839,
1.907190322875976... |
func (c *Client) UpdateHealthCheck(ctx context.Context, params *UpdateHealthCheckInput, optFns ...func(*Options)) (*UpdateHealthCheckOutput, error) {
if params == nil {
params = &UpdateHealthCheckInput{}
}
result, metadata, err := c.invokeOperation(ctx, "UpdateHealthCheck", params, optFns, c.addOperationUpdateHea... | [
-0.9296002984046936,
0.015137098729610443,
0.7715557217597961,
0.8386642932891846,
-0.1540444791316986,
-0.279331237077713,
0.571907103061676,
-0.9304964542388916,
0.4929010570049286,
-0.13230574131011963,
0.39954376220703125,
1.3036819696426392,
-0.640820324420929,
-0.5532197952270508,
... |
func sendRequest(ctx context.Context, method, addr string, reqBody string) ([]byte, error) {
client := http.Client{}
//nolint:staticcheck
req := &http.Request{}
var err error
if method == "POST" {
form := url.Values{}
form.Set("message", reqBody)
form.Set("parse_mode", "HTML")
reqReader := strings.NewRead... | [
-0.2298807054758072,
0.19892790913581848,
1.085819125175476,
0.42016375064849854,
-0.08562809228897095,
-0.2746405601501465,
-0.7242121696472168,
-0.3685877025127411,
0.39393648505210876,
0.1517922431230545,
0.5529437065124512,
0.807394802570343,
-0.3310890793800354,
0.5283979177474976,
... |
func (m *Metric) getMetricValues(wg *sync.WaitGroup, ctx context.Context) error {
defer wg.Done()
var parser fastjson.Parser
respBytes, err := sendRequest(ctx, "GET", p8sAddr+"/api/v1/query?query="+m.query, "")
if err != nil {
return err
}
data, err := parser.ParseBytes(respBytes)
if err != nil {
return err... | [
-0.5969099402427673,
0.850855827331543,
0.5283014178276062,
-0.024766553193330765,
0.015701333060860634,
-0.3627317249774933,
-0.06730302423238754,
-0.32981762290000916,
-1.035949945449829,
-0.20060884952545166,
0.21150562167167664,
0.2004726380109787,
-0.4550112783908844,
1.26840603351593... |
func notify(ctx context.Context, report string) error {
_, err := sendRequest(ctx, "POST", notifyAddr, report)
if err != nil {
return err
}
return nil
} | [
0.6171969175338745,
1.2502659559249878,
0.2571212351322174,
0.4960220456123352,
0.8746959567070007,
-0.404900461435318,
-0.3715343773365021,
0.1187681332230568,
0.21884842216968536,
-0.036550506949424744,
-0.6473120450973511,
1.06455659866333,
-0.897627055644989,
0.14265213906764984,
0.2... |
func CatchSigterm(StopProcess func()) {
// Catch a SIGTERM and stop
sigs := make(chan os.Signal, 1)
signal.Notify(sigs, os.Interrupt, syscall.SIGTERM)
go func() {
for sig := range sigs {
log.Info("Shutting down from Signal", "signal", sig)
StopProcess()
/*
if service != nil {
service.Stop()
... | [
0.7261603474617004,
-0.9135531187057495,
0.5677513480186462,
0.08282508701086044,
0.0668395459651947,
0.26885664463043213,
0.14354579150676727,
0.08392723649740219,
-0.507132351398468,
0.2797553241252899,
-0.804534912109375,
-0.371773362159729,
-0.17822089791297913,
0.3843406140804291,
0... |
func (e Exemplar) Equals(e2 Exemplar) bool {
if !labels.Equal(e.Labels, e2.Labels) {
return false
}
if (e.HasTs || e2.HasTs) && e.Ts != e2.Ts {
return false
}
return e.Value == e2.Value
} | [
-1.2126096487045288,
-0.5774335265159607,
0.5210467576980591,
-0.3998984098434448,
-0.5011075139045715,
0.4733586311340332,
-0.5914235711097717,
0.3035283088684082,
-0.45528993010520935,
0.2067401260137558,
-0.725590169429779,
0.6716212630271912,
0.9499088525772095,
1.0672672986984253,
0... |
func Cmd(rootArgs *shared.RootArgs, printf shared.FormatFn) *cobra.Command {
t := &token{RootArgs: rootArgs}
c := &cobra.Command{
Use: "token",
Short: "JWT Token Utilities",
Long: "JWT Token Utilities",
PersistentPreRunE: func(cmd *cobra.Command, args []string) error {
return rootArgs.Resolve(true, tru... | [
0.6592791080474854,
-0.38663825392723083,
0.7573161125183105,
-0.07709083706140518,
0.2264670431613922,
0.03482995182275772,
0.0674574077129364,
0.06442893296480179,
0.03578424081206322,
-1.4362430572509766,
0.5586168766021729,
0.9129111766815186,
0.5125793814659119,
0.6289296746253967,
... |
func (t *token) rotateCert(printf shared.FormatFn) error {
var verbosef = shared.NoPrintf
if t.Verbose {
verbosef = printf
}
verbosef("generating a new key and cert...")
cert, privateKey, err := provision.GenKeyCert(t.certKeyStrength, t.certExpirationInYears)
if err != nil {
return errors.Wrap(err, "generati... | [
-0.3269253671169281,
-0.30450862646102905,
0.857161283493042,
-0.4631509482860565,
-0.07206938415765762,
0.22585034370422363,
-0.4903355836868286,
-0.5383774638175964,
-0.6690385937690735,
0.41125673055648804,
-0.8763415217399597,
1.2229098081588745,
-0.7247500419616699,
-0.332415491342544... |
func (t *token) createSecret(printf shared.FormatFn) error {
var verbosef = shared.NoPrintf
if t.Verbose {
verbosef = printf
}
jwkSet := &jwk.Set{}
verbosef("retrieving existing certificates...")
var err error
if t.truncate > 1 { // if 1, just skip old stuff
// old jwks
jwksURL := fmt.Sprintf(certsURLFor... | [
-0.10373741388320923,
0.045143548399209976,
0.8454752564430237,
-0.6456155776977539,
-0.21723395586013794,
-0.758358895778656,
-0.2277398258447647,
-1.525963306427002,
-0.016075044870376587,
0.22969874739646912,
-0.6695590615272522,
0.4498169422149658,
0.06326179951429367,
0.84716171026229... |
func Console(consoleFlags *flags.ConsoleFlags) error {
account, err := buildIdpAccount(consoleFlags.LoginExecFlags)
if err != nil {
return errors.Wrap(err, "error building login details")
}
sharedCreds := awsconfig.NewSharedCredentials(account.Profile, account.CredentialsFile)
// this checks if the credential... | [
0.2688319981098175,
0.03489777445793152,
0.7762212753295898,
-0.4049285650253296,
0.5697847604751587,
0.09948848187923431,
0.07494864612817764,
-0.3543471395969391,
0.12024859338998795,
-0.7576400637626648,
0.3784049153327942,
0.60956209897995,
0.03796065226197243,
0.19811797142028809,
0... |
func NewLove(cfg config.KeyValueStore) (r *love, err error) {
var db driver.DB
if cfg.LevelDB != nil {
db, err = driver.NewLevelDB(*cfg.LevelDB)
}
if err != nil || db == nil {
return
}
return &love{
db: db,
}, nil
} | [
-0.19561322033405304,
0.3838748335838318,
0.49833691120147705,
0.989775538444519,
-0.5551137924194336,
0.2708226144313812,
-1.4069597721099854,
0.21929410099983215,
-0.5515857934951782,
0.21973393857479095,
-0.45908626914024353,
-0.42748379707336426,
-1.3778901100158691,
0.8330220580101013... |
func (r *love) Insert(boardID uint16, timecode, userID uint32, t time.Time) (err error) {
idBytes := make([]byte, 10)
binary.BigEndian.PutUint16(idBytes[0:2], boardID)
binary.BigEndian.PutUint32(idBytes[2:6], userID)
binary.BigEndian.PutUint32(idBytes[6:10], timecode)
val := make([]byte, 4)
binary.BigEndian.PutUi... | [
-0.18441064655780792,
1.623986005783081,
0.8506929874420166,
-0.5634070634841919,
-0.033426433801651,
0.2866115868091583,
-0.39613720774650574,
-0.24524205923080444,
-0.5836485624313354,
0.7174025177955627,
-1.5235564708709717,
-0.19534040987491608,
-1.8874341249465942,
0.20762713253498077... |
func (r *love) All() (loves []*entity.Love, err error) {
keys, vals, err := r.db.GetRanged(nil, 0, false)
if err != nil {
return
}
for i, val := range vals {
if len(keys[i]) != 10 {
continue
}
loves = append(loves, &entity.Love{
BoardID: binary.BigEndian.Uint16(keys[i][0:2]),
Timecode: binary.BigE... | [
0.08706305921077728,
0.24811503291130066,
0.7447789907455444,
0.402725487947464,
0.5582202672958374,
0.8818541169166565,
-1.3285129070281982,
-0.07058524340391159,
-0.7269507050514221,
0.6486432552337646,
-0.4122554659843445,
0.7664484977722168,
-0.3677878677845001,
1.2396925687789917,
0... |
func (r *love) Sweep(t time.Time) (s int, n int, err error) {
keys, vals, err := r.db.GetRanged([]byte(nil), 0, false)
if err != nil {
return
}
for i, val := range vals {
if len(keys[i]) != 10 {
continue
}
if time.Unix(int64(binary.BigEndian.Uint32(val[0:4])), 0).Before(t) {
if err = r.db.Delete(keys[... | [
-0.800476610660553,
1.2753440141677856,
0.7928937673568726,
-0.6213902235031128,
-0.5429134368896484,
-0.25870874524116516,
0.17398932576179504,
0.35695889592170715,
-0.30736222863197327,
1.031117558479309,
-0.8701987862586975,
0.07861015200614929,
0.516495943069458,
0.597412645816803,
0... |
func (r *love) Close() {
r.db.Close()
} | [
-0.4458102285861969,
0.5814028978347778,
0.37906765937805176,
-0.36647841334342957,
-0.4026196300983429,
1.611622929573059,
-0.8630714416503906,
-0.8226836323738098,
-0.9264727234840393,
-0.4326845407485962,
-0.25368741154670715,
-0.29129981994628906,
-1.2960456609725952,
1.527946829795837... |
func New(publishers []Publisher) *Canary {
return &Canary{
Publishers: publishers,
OutputChan: make(chan sensor.Measurement),
}
} | [
0.7007580399513245,
-1.2152231931686401,
-0.02731151133775711,
1.05094575881958,
-0.7311519384384155,
-0.1637292206287384,
-0.21194294095039368,
-0.5320538282394409,
-1.1287416219711304,
-0.044882532209157944,
0.7497713565826416,
0.6131470799446106,
-0.38711702823638916,
1.2886922359466553... |
func Load(ctx context.Context, rec data.Record) (dist.Dist, error) {
params, err := registry.NewDistribution(ctx, rec.Kind, nil)
if err != nil {
return nil, err
}
return params.Unmarshal(rec.Distribution)
} | [
0.17072001099586487,
-0.2803487479686737,
0.18576490879058838,
-1.0398849248886108,
-0.26157763600349426,
-0.17969422042369843,
0.14896263182163239,
0.17893755435943604,
0.1532876193523407,
0.3329939842224121,
-0.07207616418600082,
0.2953314483165741,
-0.868509829044342,
-0.413612961769104... |
func Get() Cfg {
return conf
} | [
0.14636355638504028,
0.03006903827190399,
-0.05011885613203049,
-0.49634215235710144,
-0.01681273803114891,
-0.5260247588157654,
-0.3424539566040039,
0.9470152258872986,
-0.9510822296142578,
-0.4410022497177124,
-0.6443433165550232,
0.6773446798324585,
0.06906771659851074,
0.26054772734642... |
func (conf blah) SetDef(key string, def string) {
viper.SetDefault(key, def)
} | [
-0.3383863568305969,
0.15556493401527405,
0.3462926745414734,
1.2110577821731567,
1.2920078039169312,
-0.2405119091272354,
-0.7441301345825195,
0.7990162372589111,
-0.5462453961372375,
0.38628822565078735,
-1.1710121631622314,
0.7290911078453064,
-0.31431981921195984,
1.1707183122634888,
... |
func (conf blah) SetOverride(key string, def string) {
viper.Set(key, def)
} | [
-0.673769474029541,
0.7970232367515564,
0.4304690361022949,
1.3385426998138428,
0.8545963168144226,
-0.5729532837867737,
-1.2566629648208618,
0.2820458710193634,
-0.5329371094703674,
-0.2223508059978485,
-0.9744086861610413,
0.37611380219459534,
-0.915813148021698,
-0.0781063437461853,
-... |
func (conf blah) Val(key string) string {
return viper.GetString(key)
} | [
-0.8959234952926636,
0.21758517622947693,
0.19775067269802094,
0.15120910108089447,
-0.13675862550735474,
-0.07983605563640594,
-0.9731916189193726,
-0.15615522861480713,
-0.38788551092147827,
0.5382078886032104,
-0.22918829321861267,
0.4179786443710327,
0.054129548370838165,
-0.1632296293... |
func (conf blah) Intval(key string) int {
return viper.GetInt(key)
} | [
-0.6244004964828491,
0.07538681477308273,
0.4168444275856018,
-0.056179191917181015,
-0.4524913728237152,
-0.3226242661476135,
-0.46071815490722656,
0.27606523036956787,
-0.8450090885162354,
0.6305315494537354,
-0.18688225746154785,
-0.017688756808638573,
-0.6565314531326294,
0.41532129049... |
func (conf blah) Exists(key string) bool {
return viper.IsSet(key)
} | [
-1.7579740285873413,
-0.2707395851612091,
0.45790895819664,
0.06700310111045837,
1.0975583791732788,
0.30444440245628357,
-1.3658632040023804,
0.04437040537595749,
-0.4615814685821533,
0.39774999022483826,
-0.7012194395065308,
-0.44587117433547974,
-0.3209342956542969,
0.40045708417892456,... |
func (conf blah) Path() string {
return configPath
} | [
-0.24803471565246582,
-1.1034938097000122,
0.18172629177570343,
0.5200499296188354,
-0.15232467651367188,
1.260871410369873,
0.6886559128761292,
-0.21146808564662933,
-0.46456044912338257,
0.04315574839711189,
-0.7144956588745117,
-0.5546537041664124,
-0.715184211730957,
0.6688581109046936... |
func (conf blah) Cache() string {
return conf.Val(CACHEPATH)
} | [
-0.6082223057746887,
-0.27348053455352783,
0.2697369158267975,
0.718829870223999,
-0.1101420596241951,
0.8564656376838684,
0.2612822651863098,
0.04687153175473213,
-0.30479493737220764,
0.3891938030719757,
0.3502444326877594,
-0.1110149547457695,
-0.03213068097829819,
0.2795323133468628,
... |
func (conf blah) Home() string {
return homeDir
} | [
-0.15920613706111908,
-0.7381280660629272,
0.312645822763443,
1.5806612968444824,
0.15152394771575928,
0.699508547782898,
0.8187273144721985,
0.2157668024301529,
0.3597138822078705,
-0.5352060198783875,
-0.4621376693248749,
0.2523517608642578,
-0.4422157108783722,
0.46902164816856384,
-0... |
func (conf blah) File() string {
return filepath.Join(configPath, defConfigFile)
} | [
-0.45351842045783997,
0.0382414236664772,
0.18978644907474518,
1.0038349628448486,
0.6412369608879089,
1.272892713546753,
0.6108193397521973,
0.40384721755981445,
-1.233138918876648,
0.15092284977436066,
-0.4746723473072052,
-0.4944821000099182,
0.09701269865036011,
1.0660449266433716,
0... |
func (conf blah) User() string {
return usr.Username
} | [
-0.958577036857605,
-0.6034112572669983,
0.2975108027458191,
1.0749905109405518,
-0.24075639247894287,
0.4173033833503723,
1.027381420135498,
0.05643786862492561,
0.040036603808403015,
-1.3209078311920166,
-0.9377444386482239,
-0.31012997031211853,
0.3506103754043579,
0.15181314945220947,
... |
func (conf blah) AppPath() string {
return appPath
} | [
0.13159088790416718,
-1.1460319757461548,
0.10239240527153015,
0.428937703371048,
-0.19465316832065582,
1.1040098667144775,
0.30648499727249146,
-0.2898344099521637,
0.009507053531706333,
0.08359683305025101,
0.04357459768652916,
-0.19261938333511353,
-0.2746458351612091,
1.173557043075561... |
func (conf blah) AppName() string {
return appName
} | [
-0.17813754081726074,
-0.9909427762031555,
0.30121180415153503,
0.7907577157020569,
-0.6517547369003296,
0.5486243367195129,
-0.10901600122451782,
0.5687334537506104,
-0.5725266933441162,
0.011016512289643288,
0.02787979505956173,
-0.30952396988868713,
0.10470476001501083,
0.70629769563674... |
func setFlags(*os.File) error {
return nil
} | [
0.43502122163772583,
0.5068607926368713,
0.2538517713546753,
0.21948416531085968,
0.6527836918830872,
0.7097154855728149,
0.8714292049407959,
0.32823893427848816,
-0.7970138788223267,
-1.014093279838562,
-0.9175740480422974,
0.32361727952957153,
-0.740773618221283,
1.6458638906478882,
-0... |
func (m *MongoProxyHandler) dispatch(db string, cmd string, query bson.D, fields []byte) (doc p.SimpleBSON, err error) {
queryCmd := strings.ToLower(cmd)
log.Info("dispatch cmd : ", queryCmd, " cmd:", cmd, " query : ", query.Map())
switch queryCmd {
// part 1 : 伪handler mongo server ,响应客户端连接请求
case "getnonce":
d... | [
0.4616248309612274,
0.05014491826295853,
0.9484544396400452,
0.5957954525947571,
0.14484903216362,
1.0527366399765015,
0.7352892160415649,
-0.06212456151843071,
0.13795940577983856,
-0.14878499507904053,
-0.8876609802246094,
0.2795196771621704,
-0.6920522451400757,
0.7661271095275879,
-0... |
func NewRepoCache(drive *google.Drive, cas cache.ObjectCache, privateConfigFile string, publicConfigFile string) *RepoCache {
//Create a new config
privateConfig, _ := configuration.NewConfiguration(privateConfigFile)
publicConfig, _ := configuration.NewConfiguration(publicConfigFile)
//Define a new repo
newRepo... | [
-0.5351683497428894,
-0.35451775789260864,
0.5651736259460449,
-0.0338166281580925,
-1.0771493911743164,
-0.20836696028709412,
-0.48293325304985046,
0.9727721810340881,
-0.6275637745857239,
0.6135499477386475,
-0.5387516617774963,
-0.34975388646125793,
-0.17962440848350525,
-0.341908216476... |
func (repo *RepoCache) GetStaticPublicDocument(path string) (string, error) {
//Look up the document id from the config
documentId, err := repo.publicConfig.GetStringError(path)
if err != nil {
return "", err
}
//see if there is a cache, if there is no cache just return it
if repo.cas == nil {
return repo.... | [
-0.4062771797180176,
0.3388218283653259,
0.6203116774559021,
-0.01932389661669731,
-1.523478627204895,
0.2112419754266739,
0.11431102454662323,
-0.3035293519496918,
-0.0898737758398056,
0.8235801458358765,
0.03813086822628975,
0.13876959681510925,
-0.5590031743049622,
0.29381099343299866,
... |
func (repo *RepoCache) GetStaticPrivateDocument(path string) (string, error) {
//Look up the document id from the config
documentId, err := repo.privateConfig.GetStringError(path)
if err != nil {
return "", err
}
//see if there is a cache, if there is no cache just return it
if repo.cas == nil {
return rep... | [
-0.6364670991897583,
0.28848522901535034,
0.7019985914230347,
0.042010411620140076,
-1.2113488912582397,
-0.03310739994049072,
-0.08520516753196716,
-0.5176289081573486,
0.5164186358451843,
0.5078005194664001,
0.30704736709594727,
0.2314625382423401,
-0.6741675734519958,
0.0912735760211944... |
func (repo *RepoCache) CleanUp() {
} | [
-0.133651003241539,
-0.496454656124115,
0.22216758131980896,
0.01153488177806139,
-0.39622119069099426,
-0.009441169910132885,
0.810306966304779,
0.6743875741958618,
1.214360237121582,
-0.43245694041252136,
-0.623380184173584,
-0.22980637848377228,
0.4443760812282562,
0.6272789239883423,
... |
func createClusterServer(opts *NodeOptions) *clusterServer {
return &clusterServer{workers: sync.Map{}, opts: opts}
} | [
-0.9047722816467285,
-0.05095813423395157,
0.21526993811130524,
-0.4303598999977112,
0.5832360982894897,
0.24650053679943085,
-0.4792320132255554,
-0.34641140699386597,
0.2723783850669861,
0.5162129998207092,
-0.34403008222579956,
0.7416920065879822,
-1.1254812479019165,
0.0765649378299713... |
func (s *clusterServer) RegisterWorker(ctx context.Context, req *pb.MRegisterRequest) (*pb.MRegisterResponse, error) {
s.numWorkersLock.Lock()
defer s.numWorkersLock.Unlock()
if _, exists := s.workers.Load(req.Id); exists {
return nil, fmt.Errorf("worker %s is already registered", req.Id)
}
if s.numWorkers == s.... | [
-1.2225935459136963,
0.17885245382785797,
0.7450109720230103,
-0.31986203789711,
0.8314270377159119,
-0.09771071374416351,
-0.020967770367860794,
-0.4064781665802002,
0.26602891087532043,
-0.2722513973712921,
-0.49587616324424744,
-0.13064487278461456,
-0.951072096824646,
0.834822595119476... |
func (s *clusterServer) NumberOfWorkers() int {
s.numWorkersLock.Lock()
defer s.numWorkersLock.Unlock()
return s.numWorkers
} | [
-0.9887130856513977,
0.7612460851669312,
0.18867750465869904,
-0.10293509811162949,
0.5023574829101562,
-0.7964104413986206,
0.6618973016738892,
-0.3307894468307495,
-0.4182330369949341,
-0.5400677919387817,
-0.8330745697021484,
0.16271232068538666,
-1.4938746690750122,
0.46789315342903137... |
func (s *clusterServer) Workers() []*pb.MWorkerDescriptor {
result := make([]*pb.MWorkerDescriptor, 0)
s.workers.Range(func(_, v interface{}) bool {
w := v.(*pb.MWorkerDescriptor)
result = append(result, w)
return true
})
return result
} | [
-1.6261919736862183,
0.400879830121994,
0.3663451075553894,
0.028744878247380257,
0.6688793301582336,
0.4358566701412201,
-0.09500391036272049,
0.1545826941728592,
-0.3899126946926117,
0.1907472461462021,
-0.47685739398002625,
0.7959517240524292,
-0.9835290312767029,
1.0746679306030273,
... |
func NewConnectionHandler(username string, password string, host string, port string, database string) (ConnectionHandler, error) {
db, err := gorm.Open(sqlite.Open(database), &gorm.Config{})
if err != nil {
return &connectionHandler{}, err
}
return &connectionHandler{db: db}, nil
} | [
-0.02134835720062256,
-0.10867856442928314,
0.13115598261356354,
0.6445258259773254,
-0.6227635145187378,
0.21624961495399475,
-0.2312084287405014,
0.2320270985364914,
-0.7751244902610779,
0.47081753611564636,
0.1255630999803543,
-1.0888850688934326,
-1.051348090171814,
0.10880637168884277... |
func New(client *client.Client, properties ClientProperties) *Client {
return &Client{
client: client,
assetSid: properties.AssetSid,
serviceSid: properties.ServiceSid,
}
} | [
0.9511488676071167,
-1.2998255491256714,
0.10086088627576828,
-0.9568699598312378,
-0.6732964515686035,
0.43476206064224243,
-0.05818620324134827,
-0.6477807760238647,
-1.2919247150421143,
-0.7601840496063232,
0.7790109515190125,
0.5997324585914612,
0.7405878305435181,
-0.9009554982185364,... |
func Login(userID, password string) (*Account, error) {
log.Info("user:", userID, " start login")
// save cookie
jar, _ := cookiejar.New(nil)
req.Client().Jar = jar
// do login
r, err := req.Post(loginURL, req.Param{
"eid": userID,
"pw": password,
"submit": "%E7%99%BB%E5%BD%95",
}, req.Header{
"Co... | [
-0.17064985632896423,
-0.826151967048645,
1.084733247756958,
0.575438380241394,
-0.9048259258270264,
0.510494589805603,
0.8929399251937866,
-0.6517407298088074,
0.8798819780349731,
0.6038973331451416,
-0.09448999166488647,
0.7046157717704773,
-0.024774443358182907,
0.12827569246292114,
-... |
func makeCookie(session string) *http.Cookie {
cookie := new(http.Cookie)
cookie.Name = "JSESSIONID"
cookie.Value = session
return cookie
} | [
0.306962788105011,
-0.7757646441459656,
0.25298649072647095,
-0.16176587343215942,
-1.046761155128479,
0.1326659470796585,
0.08977430313825607,
-1.0157192945480347,
0.6456428170204163,
0.39612987637519836,
-0.6665205359458923,
0.16740594804286957,
0.7853721380233765,
-0.554505467414856,
... |
func parseTime(rawtime string) time.Time {
rawtime = strings.Replace(rawtime, "下午", "PM ", -1)
rawtime = strings.Replace(rawtime, "上午", "AM ", -1)
tm, err := time.Parse("2006-1-2 PM 3:04", rawtime)
if err != nil {
log.Error(err)
return time.Now().AddDate(-10, 0, 0)
}
return tm
} | [
-0.018771322444081306,
-0.09295541048049927,
0.7374937534332275,
-0.2244156002998352,
-0.2877258062362671,
0.27792787551879883,
-0.9558960199356079,
0.4866667687892914,
0.40605366230010986,
0.8548584580421448,
0.022003186866641045,
-0.2702428996562958,
-0.2519080638885498,
0.43771979212760... |
func TagLoggerWithArchiveHistoryRequestAndURI(logger log.Logger, request *ArchiveHistoryRequest, URI string) log.Logger {
return log.With(
logger,
tag.ShardID(request.ShardID),
tag.ArchivalRequestNamespaceID(request.NamespaceID),
tag.ArchivalRequestNamespace(request.Namespace),
tag.ArchivalRequestWorkflowID(... | [
0.18561041355133057,
-0.9119237661361694,
0.6981138586997986,
-0.26593348383903503,
0.5573996305465698,
-0.2987971603870392,
-1.6109498739242554,
0.4382864236831665,
-0.24415960907936096,
-0.374563068151474,
0.5149641633033752,
0.5284412503242493,
0.837552547454834,
0.46755895018577576,
... |
func TagLoggerWithArchiveVisibilityRequestAndURI(logger log.Logger, request *archiverspb.VisibilityRecord, URI string) log.Logger {
return log.With(
logger,
tag.ArchivalRequestNamespaceID(request.GetNamespaceId()),
tag.ArchivalRequestNamespace(request.GetNamespace()),
tag.ArchivalRequestWorkflowID(request.GetW... | [
0.25280851125717163,
-1.0016781091690063,
0.8553465008735657,
-0.37539029121398926,
-0.00499110110104084,
-0.13022653758525848,
-1.553932547569275,
0.5474389791488647,
0.2659424841403961,
0.22004790604114532,
0.39835935831069946,
0.8089575171470642,
0.997127890586853,
0.679303765296936,
... |
func ValidateHistoryArchiveRequest(request *ArchiveHistoryRequest) error {
if request.NamespaceID == "" {
return errEmptyNamespaceID
}
if request.WorkflowID == "" {
return errEmptyWorkflowID
}
if request.RunID == "" {
return errEmptyRunID
}
if request.Namespace == "" {
return errEmptyNamespace
}
return... | [
-0.12945058941841125,
-0.17284423112869263,
0.5456808805465698,
0.195658877491951,
0.9790422916412354,
0.5103418231010437,
-0.1596773862838745,
-0.3679896891117096,
0.34013575315475464,
-0.2753210663795471,
0.5423457622528076,
1.2338448762893677,
-0.159733384847641,
1.8048791885375977,
0... |
func ValidateGetRequest(request *GetHistoryRequest) error {
if request.NamespaceID == "" {
return errEmptyNamespaceID
}
if request.WorkflowID == "" {
return errEmptyWorkflowID
}
if request.RunID == "" {
return errEmptyRunID
}
if request.PageSize == 0 {
return errInvalidPageSize
}
return nil
} | [
-0.14925286173820496,
-0.18730342388153076,
0.6506197452545166,
-0.13446025550365448,
0.8902823328971863,
0.41181761026382446,
-0.21304719150066376,
-0.6298415660858154,
0.6558229923248291,
-0.21354874968528748,
0.9895994067192078,
0.9611374139785767,
-0.3508566617965698,
1.372743487358093... |
func ValidateVisibilityArchivalRequest(request *archiverspb.VisibilityRecord) error {
if request.GetNamespaceId() == "" {
return errEmptyNamespaceID
}
if request.GetNamespace() == "" {
return errEmptyNamespace
}
if request.GetWorkflowId() == "" {
return errEmptyWorkflowID
}
if request.GetRunId() == "" {
... | [
-0.29755470156669617,
-0.5712066888809204,
0.8929253220558167,
0.14775317907333374,
-0.04479457065463066,
0.7459985613822937,
0.09037291258573532,
-0.3423606753349304,
0.4747030735015869,
0.35556188225746155,
0.49888068437576294,
0.9554561376571655,
0.01266704685986042,
1.3303513526916504,... |
func ValidateQueryRequest(request *QueryVisibilityRequest) error {
if request.NamespaceID == "" {
return errEmptyNamespaceID
}
if request.PageSize == 0 {
return errInvalidPageSize
}
return nil
} | [
-0.1877632886171341,
-0.043895360082387924,
0.43742936849594116,
-0.2849481701850891,
-0.349751353263855,
0.6808775067329407,
-0.17595893144607544,
-0.6230885982513428,
1.2604657411575317,
-0.03464110940694809,
0.6298364996910095,
0.4215133786201477,
-0.0403088703751564,
1.8685442209243774... |
func (k Keeper) ChanCloseInit(ctx sdk.Context, portID, channelID string) error {
capName := host.ChannelCapabilityPath(portID, channelID)
chanCap, ok := k.scopedKeeper.GetCapability(ctx, capName)
if !ok {
return sdkerrors.Wrapf(channeltypes.ErrChannelCapabilityNotFound, "could not retrieve channel capability at: %... | [
0.008039480075240135,
-1.4406832456588745,
0.746982991695404,
-0.9934459328651428,
0.30227988958358765,
0.48590630292892456,
-0.4550117552280426,
-0.4729616343975067,
-0.2675817310810089,
0.20834149420261383,
0.044311609119176865,
0.8231210112571716,
-0.41173145174980164,
0.325916320085525... |
func (k Keeper) IsBound(ctx sdk.Context, portID string) bool {
_, ok := k.scopedKeeper.GetCapability(ctx, host.PortPath(portID))
return ok
} | [
-0.23564058542251587,
-1.172644853591919,
0.6578922271728516,
0.20180679857730865,
0.8762656450271606,
0.4125923216342926,
-0.6132310032844543,
-0.09101694822311401,
0.7935648560523987,
0.28774115443229675,
-0.3900129199028015,
1.1437454223632812,
-0.36668673157691956,
0.7584260106086731,
... |
func (k Keeper) BindPort(ctx sdk.Context, portID string) error {
cap := k.portKeeper.BindPort(ctx, portID)
return k.ClaimCapability(ctx, cap, host.PortPath(portID))
} | [
0.19678744673728943,
-0.5733737945556641,
0.43709930777549744,
1.099839687347412,
0.43331822752952576,
0.3738114833831787,
-0.37875014543533325,
0.5493183732032776,
0.9442878365516663,
-0.8922373056411743,
0.2438448667526245,
0.39841464161872864,
-0.3588577210903168,
0.39464476704597473,
... |
func (k Keeper) GetPort(ctx sdk.Context) string {
store := ctx.KVStore(k.storeKey)
return string(store.Get(types.PortKey))
} | [
-0.003826714353635907,
0.20279474556446075,
0.3176436424255371,
0.4974372088909149,
0.5322107076644897,
0.34472841024398804,
0.05631629750132561,
-0.5825846791267395,
0.7215189337730408,
0.6256040930747986,
0.508959949016571,
0.12116739898920059,
-0.2337280958890915,
0.14655883610248566,
... |
func (k Keeper) SetPort(ctx sdk.Context, portID string) {
store := ctx.KVStore(k.storeKey)
store.Set(types.PortKey, []byte(portID))
} | [
-0.10773816704750061,
0.19286775588989258,
0.06800566613674164,
0.3924620747566223,
0.33929845690727234,
0.7949329614639282,
-0.4150876998901367,
-0.0736098662018776,
0.9373125433921814,
0.4072938561439514,
-0.914297878742218,
0.3605407178401947,
-0.5594826936721802,
0.1761627197265625,
... |
func (k Keeper) AuthenticateCapability(ctx sdk.Context, cap *capabilitytypes.Capability, name string) bool {
return k.scopedKeeper.AuthenticateCapability(ctx, cap, name)
} | [
-1.6059993505477905,
-0.4377378523349762,
0.5350490212440491,
1.4012717008590698,
-0.39703428745269775,
-0.36731433868408203,
0.31305447220802307,
-0.564906120300293,
0.9755790829658508,
1.047603964805603,
-1.0159623622894287,
-0.20097053050994873,
-0.2682493329048157,
-0.12144725769758224... |
func (k Keeper) ClaimCapability(ctx sdk.Context, cap *capabilitytypes.Capability, name string) error {
return k.scopedKeeper.ClaimCapability(ctx, cap, name)
} | [
-0.6079869270324707,
-0.642741858959198,
0.4422290623188019,
1.2877544164657593,
0.2147725373506546,
-0.2804461717605591,
0.45884278416633606,
0.18291939795017242,
1.0937856435775757,
0.7531015872955322,
-0.6554875373840332,
0.6127521991729736,
-0.13599424064159393,
0.5159947872161865,
-... |
func New(transport runtime.ClientTransport, formats strfmt.Registry) *Client {
return &Client{transport: transport, formats: formats}
} | [
-0.053929269313812256,
-1.4649492502212524,
-0.09012952446937561,
-0.8262796401977539,
-0.550800621509552,
0.6438911557197571,
0.3526709973812103,
-0.1351967602968216,
-0.9943568110466003,
-0.7430494427680969,
-0.3152836263179779,
0.610390305519104,
0.2375689148902893,
0.0706297904253006,
... |
func (a *Client) CreateAccount(params *CreateAccountParams) (*CreateAccountCreated, error) {
// TODO: Validate the params before sending
if params == nil {
params = NewCreateAccountParams()
}
result, err := a.transport.Submit(&runtime.ClientOperation{
ID: "createAccount",
Method: ... | [
-0.9077529907226562,
-0.21394194662570953,
0.772095263004303,
0.44821062684059143,
0.6361432075500488,
0.27617451548576355,
1.1256812810897827,
-0.46626946330070496,
0.3577400743961334,
-0.10235083103179932,
0.004195090848952532,
0.9208762049674988,
-0.8566948175430298,
0.4503876864910126,... |
func (a *Client) CreateSubscription(params *CreateSubscriptionParams) (*CreateSubscriptionOK, error) {
// TODO: Validate the params before sending
if params == nil {
params = NewCreateSubscriptionParams()
}
result, err := a.transport.Submit(&runtime.ClientOperation{
ID: "createSubscription",
... | [
-0.48914456367492676,
-0.1202533021569252,
0.8014950156211853,
0.5476918816566467,
-0.05126400664448738,
0.19039419293403625,
0.7494339346885681,
-0.32611536979675293,
-0.013508741743862629,
0.5246635675430298,
-0.5037980675697327,
0.39351633191108704,
-0.8768297433853149,
0.51172947883605... |
func (a *Client) DeleteEvent(params *DeleteEventParams) (*DeleteEventNoContent, error) {
// TODO: Validate the params before sending
if params == nil {
params = NewDeleteEventParams()
}
result, err := a.transport.Submit(&runtime.ClientOperation{
ID: "deleteEvent",
Method: "DELETE"... | [
0.27011173963546753,
0.38106539845466614,
0.7894590497016907,
0.2648885250091553,
0.23826542496681213,
-0.2961801290512085,
0.16281558573246002,
-0.9294387102127075,
0.4025408625602722,
-0.8913599252700806,
0.3446410000324249,
1.2180945873260498,
-0.7321567535400391,
-0.20051828026771545,
... |
func (a *Client) DoBootImage(params *DoBootImageParams) (*DoBootImageAccepted, error) {
// TODO: Validate the params before sending
if params == nil {
params = NewDoBootImageParams()
}
result, err := a.transport.Submit(&runtime.ClientOperation{
ID: "doBootImage",
Method: "POST",
... | [
-1.3561547994613647,
-0.03604291379451752,
0.7135088443756104,
0.6394706964492798,
-0.26817741990089417,
-0.48790156841278076,
0.4952770173549652,
-0.17013363540172577,
-0.4871726632118225,
0.5531061291694641,
-0.27825337648391724,
1.310145378112793,
-1.0652302503585815,
0.9088687300682068... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.