text stringlengths 11 6.3k | embedding listlengths 768 768 |
|---|---|
func (cmd *DeleteBookCommand) RegisterFlags(cc *cobra.Command, c *client.Client) {
var name string
cc.Flags().StringVar(&cmd.Name, "name", name, ``)
} | [
0.03411441668868065,
0.6689055562019348,
0.22846625745296478,
-0.17549607157707214,
1.1278620958328247,
0.40265411138534546,
-0.719531774520874,
0.5696311593055725,
-1.170275330543518,
-0.7593356370925903,
-0.8012902736663818,
0.5253333449363708,
-1.2720037698745728,
1.5457663536071777,
... |
func (cmd *ListBookCommand) Run(c *client.Client, args []string) error {
var path string
if len(args) > 0 {
path = args[0]
} else {
path = "/books"
}
logger := goa.NewLogger(log.New(os.Stderr, "", log.LstdFlags))
ctx := goa.WithLogger(context.Background(), logger)
resp, err := c.ListBook(ctx, path)
if err !... | [
-1.38671875,
-0.8368127346038818,
0.6867917776107788,
0.5032055974006653,
0.3484152555465698,
0.7374093532562256,
0.6384860277175903,
0.05654824525117874,
-0.8655840158462524,
-0.15484076738357544,
-0.04452171176671982,
0.6232101321220398,
-1.147328495979309,
0.7092092633247375,
-0.16433... |
func (cmd *ListBookCommand) RegisterFlags(cc *cobra.Command, c *client.Client) {
} | [
-0.6285461783409119,
0.3072560727596283,
0.3200130760669708,
0.5315917134284973,
1.4587459564208984,
0.7625209093093872,
-0.24206656217575073,
0.6614530086517334,
-0.901129424571991,
-1.1584268808364868,
-0.6581777930259705,
0.49022093415260315,
-1.457484483718872,
1.5062273740768433,
-0... |
func (cmd *ShowBookCommand) Run(c *client.Client, args []string) error {
var path string
if len(args) > 0 {
path = args[0]
} else {
path = fmt.Sprintf("/books/%v", url.QueryEscape(cmd.Name))
}
logger := goa.NewLogger(log.New(os.Stderr, "", log.LstdFlags))
ctx := goa.WithLogger(context.Background(), logger)
r... | [
-1.062082052230835,
-0.3514019846916199,
0.6454498767852783,
0.3589485287666321,
-0.32104161381721497,
0.7283521294593811,
1.02692711353302,
0.4274943470954895,
-0.9167664051055908,
-0.07816298305988312,
0.12727414071559906,
0.9939520359039307,
-0.8107886910438538,
0.5812481641769409,
0.... |
func (cmd *ShowBookCommand) RegisterFlags(cc *cobra.Command, c *client.Client) {
var name string
cc.Flags().StringVar(&cmd.Name, "name", name, ``)
} | [
0.15245337784290314,
0.7812083959579468,
0.22795841097831726,
-0.2008984088897705,
0.9553555846214294,
0.4144529402256012,
-0.4398147761821747,
0.4149659276008606,
-1.180888295173645,
-0.6873565316200256,
-1.008110761642456,
0.7821157574653625,
-1.020482063293457,
1.5002224445343018,
0.3... |
func (cmd *UpdateBookCommand) Run(c *client.Client, args []string) error {
var path string
if len(args) > 0 {
path = args[0]
} else {
path = fmt.Sprintf("/books/%v", url.QueryEscape(cmd.Name))
}
var payload client.BookPayload
if cmd.Payload != "" {
err := json.Unmarshal([]byte(cmd.Payload), &payload)
if e... | [
-1.575947880744934,
-0.8858768343925476,
0.8736953139305115,
0.22436590492725372,
-0.23681916296482086,
0.5871572494506836,
0.7017946243286133,
0.19247712194919586,
-1.0585014820098877,
0.4533707797527313,
-0.22719143331050873,
0.4270711839199066,
-1.2328530550003052,
0.38937854766845703,
... |
func (cmd *UpdateBookCommand) RegisterFlags(cc *cobra.Command, c *client.Client) {
cc.Flags().StringVar(&cmd.Payload, "payload", "", "Request body encoded in JSON")
cc.Flags().StringVar(&cmd.ContentType, "content", "", "Request content type override, e.g. 'application/x-www-form-urlencoded'")
var name string
cc.Fla... | [
-0.3987506926059723,
0.07161799818277359,
0.5312984585762024,
-0.03980029746890068,
0.866082489490509,
0.4129796624183655,
-0.7027423977851868,
-0.09786317497491837,
-1.478116750717163,
-0.494862824678421,
-0.8316165208816528,
0.33101996779441833,
-1.380249261856079,
1.3025577068328857,
... |
func (cmd *CreateUserCommand) Run(c *client.Client, args []string) error {
var path string
if len(args) > 0 {
path = args[0]
} else {
path = "/users"
}
var payload client.UserPayload
if cmd.Payload != "" {
err := json.Unmarshal([]byte(cmd.Payload), &payload)
if err != nil {
return fmt.Errorf("failed to... | [
-0.8564420342445374,
-0.2872829735279083,
0.6651614904403687,
-0.2437349110841751,
0.22276067733764648,
0.759737491607666,
1.236706018447876,
-0.4257031977176666,
-0.6671793460845947,
-0.08735030889511108,
-0.2502540647983551,
0.2385309785604477,
-1.1594434976577759,
0.5635313391685486,
... |
func (cmd *CreateUserCommand) RegisterFlags(cc *cobra.Command, c *client.Client) {
cc.Flags().StringVar(&cmd.Payload, "payload", "", "Request body encoded in JSON")
cc.Flags().StringVar(&cmd.ContentType, "content", "", "Request content type override, e.g. 'application/x-www-form-urlencoded'")
} | [
0.15227732062339783,
0.6899839639663696,
0.31141477823257446,
-0.2608160376548767,
1.193825364112854,
0.47712647914886475,
-0.39453360438346863,
-0.7134590744972229,
-1.0285499095916748,
-1.2317159175872803,
-0.8162014484405518,
0.742258608341217,
-0.9320979118347168,
1.3656504154205322,
... |
func (cmd *DeleteUserCommand) Run(c *client.Client, args []string) error {
var path string
if len(args) > 0 {
path = args[0]
} else {
path = fmt.Sprintf("/users/%v", url.QueryEscape(cmd.UserID))
}
logger := goa.NewLogger(log.New(os.Stderr, "", log.LstdFlags))
ctx := goa.WithLogger(context.Background(), logger... | [
-0.9640932083129883,
-0.5125267505645752,
0.5240955948829651,
0.4392620027065277,
0.11020388454198837,
0.5319846868515015,
1.355080485343933,
-0.09802201390266418,
-0.34936919808387756,
-0.41256970167160034,
0.22067347168922424,
0.8717232942581177,
-1.010608196258545,
0.49305132031440735,
... |
func (cmd *DeleteUserCommand) RegisterFlags(cc *cobra.Command, c *client.Client) {
var userID string
cc.Flags().StringVar(&cmd.UserID, "user_id", userID, ``)
} | [
0.8216579556465149,
0.989984393119812,
0.07871831208467484,
0.24598950147628784,
1.1686900854110718,
0.519578754901886,
-0.17235945165157318,
0.5459113121032715,
-0.34719592332839966,
-1.2143292427062988,
-0.6273339986801147,
1.4224251508712769,
-0.7398882508277893,
1.6412591934204102,
-... |
func (cmd *ListUserCommand) Run(c *client.Client, args []string) error {
var path string
if len(args) > 0 {
path = args[0]
} else {
path = "/users"
}
logger := goa.NewLogger(log.New(os.Stderr, "", log.LstdFlags))
ctx := goa.WithLogger(context.Background(), logger)
resp, err := c.ListUser(ctx, path)
if err !... | [
-1.1696537733078003,
-0.6393247842788696,
0.7069869637489319,
0.16450175642967224,
0.223487988114357,
0.5083719491958618,
1.0696203708648682,
0.09320443868637085,
-0.37668144702911377,
-0.3112856447696686,
-0.06118404492735863,
0.9597763419151306,
-1.1537859439849854,
0.5928100347518921,
... |
func (cmd *ListUserCommand) RegisterFlags(cc *cobra.Command, c *client.Client) {
} | [
-0.2092147171497345,
0.6951333284378052,
0.2956918179988861,
0.46251314878463745,
1.1952879428863525,
0.4697570502758026,
-0.02619725652039051,
0.5750601887702942,
-0.43945154547691345,
-1.3745394945144653,
-0.8396143913269043,
0.9323838949203491,
-1.1675585508346558,
1.171053409576416,
... |
func (cmd *ShowUserCommand) Run(c *client.Client, args []string) error {
var path string
if len(args) > 0 {
path = args[0]
} else {
path = fmt.Sprintf("/users/%v", url.QueryEscape(cmd.UserID))
}
logger := goa.NewLogger(log.New(os.Stderr, "", log.LstdFlags))
ctx := goa.WithLogger(context.Background(), logger)
... | [
-0.7496879696846008,
-0.08820740133523941,
0.6341500282287598,
0.16591814160346985,
-0.5431963801383972,
0.44411733746528625,
1.408341407775879,
0.20897267758846283,
-0.3196973502635956,
-0.3748894929885864,
0.055709294974803925,
1.265838861465454,
-0.5824108123779297,
0.49569007754325867,... |
func (cmd *ShowUserCommand) RegisterFlags(cc *cobra.Command, c *client.Client) {
var userID string
cc.Flags().StringVar(&cmd.UserID, "user_id", userID, ``)
} | [
0.8202638626098633,
1.1752678155899048,
0.12650109827518463,
0.17255468666553497,
0.8892872333526611,
0.5317559838294983,
0.024961039423942566,
0.498883992433548,
-0.45032474398612976,
-1.088739037513733,
-0.8134037852287292,
1.617943525314331,
-0.46444863080978394,
1.6330243349075317,
-... |
func (cmd *UpdateUserCommand) Run(c *client.Client, args []string) error {
var path string
if len(args) > 0 {
path = args[0]
} else {
path = fmt.Sprintf("/users/%v", url.QueryEscape(cmd.UserID))
}
var payload client.UserPayload
if cmd.Payload != "" {
err := json.Unmarshal([]byte(cmd.Payload), &payload)
if... | [
-1.1167967319488525,
-0.7010136842727661,
0.8774491548538208,
-0.03180893138051033,
-0.4635048508644104,
0.34892213344573975,
1.1798131465911865,
-0.05893756449222565,
-0.4204868674278259,
0.18100126087665558,
-0.294182687997818,
0.6376497149467468,
-1.055683970451355,
0.25424113869667053,... |
func (cmd *UpdateUserCommand) RegisterFlags(cc *cobra.Command, c *client.Client) {
cc.Flags().StringVar(&cmd.Payload, "payload", "", "Request body encoded in JSON")
cc.Flags().StringVar(&cmd.ContentType, "content", "", "Request content type override, e.g. 'application/x-www-form-urlencoded'")
var userID string
cc.F... | [
0.04653820022940636,
0.38579627871513367,
0.4737508296966553,
-0.03816063702106476,
0.6794725656509399,
0.37765106558799744,
-0.3594624996185303,
-0.2625080645084381,
-0.8491713404655457,
-0.7825028300285339,
-0.7469450235366821,
0.9186452627182007,
-1.0276508331298828,
1.3424699306488037,... |
func GenerateGetApiInput(cr *svcapitypes.API) *svcsdk.GetApiInput {
res := &svcsdk.GetApiInput{}
if cr.Status.AtProvider.APIID != nil {
res.SetApiId(*cr.Status.AtProvider.APIID)
}
return res
} | [
-0.8039417862892151,
0.010241910815238953,
0.3361106812953949,
0.04330020397901535,
-0.3169529139995575,
0.5352944731712341,
0.4829501211643219,
0.059902943670749664,
1.0690768957138062,
0.08214091509580612,
-0.5248392820358276,
-0.1643373817205429,
-0.75836580991745,
0.32005682587623596,
... |
func GenerateAPI(resp *svcsdk.GetApiOutput) *svcapitypes.API {
cr := &svcapitypes.API{}
if resp.ApiEndpoint != nil {
cr.Status.AtProvider.APIEndpoint = resp.ApiEndpoint
} else {
cr.Status.AtProvider.APIEndpoint = nil
}
if resp.ApiGatewayManaged != nil {
cr.Status.AtProvider.APIGatewayManaged = resp.ApiGatew... | [
-0.2052365094423294,
-0.5663989782333374,
0.5880790948867798,
0.110298752784729,
-0.3680754601955414,
-0.40756678581237793,
0.4173416197299957,
0.2052825391292572,
0.5201374292373657,
0.3806796371936798,
-0.48262012004852295,
-0.5855135917663574,
-0.18078741431236267,
-0.22145432233810425,... |
func GenerateCreateApiInput(cr *svcapitypes.API) *svcsdk.CreateApiInput {
res := &svcsdk.CreateApiInput{}
if cr.Spec.ForProvider.APIKeySelectionExpression != nil {
res.SetApiKeySelectionExpression(*cr.Spec.ForProvider.APIKeySelectionExpression)
}
if cr.Spec.ForProvider.CORSConfiguration != nil {
f1 := &svcsdk.... | [
-0.8172173500061035,
-0.3024698495864868,
0.7532312273979187,
-0.28596413135528564,
-0.5845524072647095,
0.4233818054199219,
0.9758020043373108,
0.10013416409492493,
0.07941526919603348,
0.45790666341781616,
-0.17190563678741455,
-0.01356087252497673,
-0.6205037236213684,
0.037953283637762... |
func GenerateUpdateApiInput(cr *svcapitypes.API) *svcsdk.UpdateApiInput {
res := &svcsdk.UpdateApiInput{}
if cr.Status.AtProvider.APIID != nil {
res.SetApiId(*cr.Status.AtProvider.APIID)
}
if cr.Spec.ForProvider.APIKeySelectionExpression != nil {
res.SetApiKeySelectionExpression(*cr.Spec.ForProvider.APIKeySele... | [
-1.025466799736023,
-0.6147938966751099,
0.7949236631393433,
-0.10683968663215637,
-0.9180579781532288,
0.1902526468038559,
0.7700700163841248,
0.18308556079864502,
0.12039422988891602,
0.4304042160511017,
-0.27054455876350403,
0.10097451508045197,
-0.49255284667015076,
-0.0439963340759277... |
func GenerateDeleteApiInput(cr *svcapitypes.API) *svcsdk.DeleteApiInput {
res := &svcsdk.DeleteApiInput{}
if cr.Status.AtProvider.APIID != nil {
res.SetApiId(*cr.Status.AtProvider.APIID)
}
return res
} | [
-1.2348140478134155,
-0.4027193486690521,
0.4615197777748108,
-0.3112008571624756,
-0.4390624165534973,
0.7234028577804565,
0.5883601307868958,
0.535041332244873,
1.4571036100387573,
0.10129239410161972,
-0.5404245853424072,
-0.5631852149963379,
-0.07587137818336487,
0.48939549922943115,
... |
func IsNotFound(err error) bool {
awsErr, ok := err.(awserr.Error)
return ok && awsErr.Code() == "NotFoundException"
} | [
-0.36415544152259827,
-0.6395846605300903,
0.11574195325374603,
0.21605829894542694,
-0.42423921823501587,
0.10390236228704453,
-0.22412806749343872,
-0.4897645115852356,
1.7800538539886475,
0.20054279267787933,
0.17733252048492432,
0.7516899108886719,
0.017091628164052963,
0.6816132068634... |
func (w work) SavingDB(ctx context.Context) {
log.Printf("save %s", w.sth)
stmt := "select name from db.table"
db := sql.DB{}
conn, _ := db.Conn(ctx)
rows, err := conn.QueryContext(ctx, stmt)
if err != nil {
if err == context.DeadlineExceeded {
// context canceled
}
return
}
var name string
for rows... | [
-0.676563024520874,
0.795359194278717,
0.9774518013000488,
1.1623667478561401,
-0.6476266384124756,
0.8474304676055908,
-0.08246085047721863,
-0.5853785276412964,
0.18347524106502533,
0.4831241965293884,
-0.10366453975439072,
-0.9313932061195374,
-0.9078469276428223,
0.9356059432029724,
... |
func (a *BenchmarkApiService) CreateBenchmarkUsingPost(ctx context.Context, benchmark Benchmark) (Benchmark, *http.Response, error) {
var (
localVarHttpMethod = strings.ToUpper("Post")
localVarPostBody interface{}
localVarFileName string
localVarFileBytes []byte
localVarReturnValue Benchmark
)
//... | [
0.14464519917964935,
0.04567301273345947,
0.9574276208877563,
-0.16407650709152222,
-0.00793902575969696,
-0.2649550139904022,
0.0917104110121727,
-0.515840470790863,
-0.8905676007270813,
-0.03220953047275543,
-0.19072194397449493,
0.18629571795463562,
-0.9853620529174805,
0.94978499412536... |
func (a *BenchmarkApiService) DeleteBenchmarkUsingDelete(ctx context.Context, benchmarkId string) (*http.Response, error) {
var (
localVarHttpMethod = strings.ToUpper("Delete")
localVarPostBody interface{}
localVarFileName string
localVarFileBytes []byte
)
// create path and map variables
a.client = N... | [
-0.2047693133354187,
-0.24547186493873596,
0.9040529131889343,
-0.04643416404724121,
0.19551002979278564,
-0.3929835557937622,
0.4077856242656708,
-0.46278566122055054,
-0.38186532258987427,
0.2606964707374573,
-0.12185953557491302,
0.7572773098945618,
-1.1741671562194824,
0.78820842504501... |
func (a *BenchmarkApiService) GetBenchmarkUsingGet(ctx context.Context, benchmarkId string) (Benchmark, *http.Response, error) {
var (
localVarHttpMethod = strings.ToUpper("Get")
localVarPostBody interface{}
localVarFileName string
localVarFileBytes []byte
localVarReturnValue Benchmark
)
// creat... | [
-0.44002416729927063,
-0.07638435065746307,
0.997591495513916,
-0.3676650822162628,
0.41489726305007935,
-0.6614680886268616,
-0.11286570876836777,
-0.4575664699077606,
-0.7603740096092224,
-0.2218959927558899,
0.13408169150352478,
1.0727856159210205,
-1.0220308303833008,
0.625838875770568... |
func (a *BenchmarkApiService) UpdateBenchmarkUsingPut(ctx context.Context, benchmark interface{}, benchmarkId string) (Benchmark, *http.Response, error) {
var (
localVarHttpMethod = strings.ToUpper("Put")
localVarPostBody interface{}
localVarFileName string
localVarFileBytes []byte
localVarReturnVal... | [
-0.3907098174095154,
-0.04030346870422363,
0.8569347262382507,
-0.544960081577301,
-0.10280700027942657,
-0.25592362880706787,
0.6170874834060669,
-0.34749558568000793,
-0.8573798537254333,
0.5138644576072693,
-0.526647686958313,
0.518562912940979,
-1.2266489267349243,
0.48966872692108154,... |
func SetSGR(Colors ...SGR) {
for _, Color := range Colors {
fmt.Fprintf(Output, "\033[1;%dm", Color)
}
} | [
-0.36840274930000305,
0.7684482336044312,
0.5329104065895081,
-0.1899339258670807,
0.3751986622810364,
0.2818068861961365,
-0.5871635675430298,
-0.2102651745080948,
-1.0982455015182495,
-0.5533691644668579,
-0.4282359182834625,
0.8308985829353333,
0.11214622855186462,
1.1446070671081543,
... |
func (*GaugeResponse) XXX_OneofFuncs() (func(msg proto.Message, b *proto.Buffer) error, func(msg proto.Message, tag, wire int, b *proto.Buffer) (bool, error), func(msg proto.Message) (n int), []interface{}) {
return _GaugeResponse_OneofMarshaler, _GaugeResponse_OneofUnmarshaler, _GaugeResponse_OneofSizer, []interface{... | [
-0.6620486378669739,
0.2388984113931656,
0.48807409405708313,
-0.9278271198272705,
0.43951258063316345,
-0.967992901802063,
0.9068207144737244,
-1.2306199073791504,
0.22445259988307953,
-0.277896523475647,
-0.4214664101600647,
-0.47058770060539246,
-0.6844278573989868,
0.7785804867744446,
... |
func NewOpcuaExport() (opcuaExport *OpcuaExport, err error) {
var opcuaContext map[string]string
opcuaExport = &OpcuaExport{}
opcuaExport.configMgr, err = eiicfgmgr.ConfigManager()
if err != nil {
glog.Fatal("Config Manager initialization failed...")
}
opcuaExport.devMode, err = opcuaExport.configMgr.IsDevMode... | [
-0.4831177890300751,
-0.8088580369949341,
0.6664127707481384,
0.4603925049304962,
-0.18317854404449463,
0.2813384532928467,
0.7014787197113037,
0.032988470047712326,
-0.10991080105304718,
0.5823395252227783,
-0.09285545349121094,
0.20917567610740662,
-0.7199423313140869,
0.9573284387588501... |
func (opcuaExport *OpcuaExport) Subscribe() {
glog.Infof("-- Initializing message bus context")
defer opcuaExport.configMgr.Destroy()
numOfSubscriber, _ := opcuaExport.configMgr.GetNumSubscribers()
for i := 0; i < numOfSubscriber; i++ {
subctx, err := opcuaExport.configMgr.GetSubscriberByIndex(i)
if err != nil... | [
0.21805205941200256,
0.12083769589662552,
0.7070085406303406,
0.4922557473182678,
0.6597366333007812,
-0.04157104343175888,
0.13987326622009277,
-0.27447542548179626,
-0.6362952589988708,
-0.06673846393823624,
-0.07778190076351166,
0.8099974393844604,
-1.1608184576034546,
0.429819226264953... |
func (opcuaExport *OpcuaExport) Publish(data interface{}) {
pubTopics := opcuaExport.opcuaBus.pubTopics
topicConfigs := make([]map[string]string, len(pubTopics))
for i, pubTopic := range pubTopics {
topicConfigs[i] = map[string]string{"ns": "StreamManager", "name": pubTopic, "dType": "string"}
}
for _, topicConf... | [
0.06034262105822563,
-0.17762413620948792,
0.37734323740005493,
-0.05695332959294319,
-0.2205686718225479,
0.7369760274887085,
-0.08732697367668152,
-0.31202611327171326,
-0.22093135118484497,
-0.01972929574549198,
0.14432664215564728,
0.597724437713623,
-0.9232704043388367,
1.261780858039... |
func ConnectWithPassword(host, username, pass string) (*Client, error) {
return ConnectWithPasswordTimeout(host, username, pass, DefaultTimeout)
} | [
0.3582298457622528,
-0.1486959308385849,
0.3110443353652954,
1.5347259044647217,
-0.8549833297729492,
0.02258087322115898,
-0.29807212948799133,
-0.38366299867630005,
-0.5793284773826599,
0.5463302135467529,
-0.35566022992134094,
-0.07506014406681061,
-0.7693668603897095,
-0.16325677931308... |
func ConnectWithPasswordTimeout(host, username, pass string, timeout time.Duration) (*Client, error) {
authMethod := ssh.Password(pass)
return connect(username, host, authMethod, timeout)
} | [
0.48288092017173767,
-0.6688395738601685,
0.3428976535797119,
0.43252089619636536,
-1.095262050628662,
0.24010492861270905,
-1.027527093887329,
-0.19055292010307312,
-0.7150039672851562,
1.0449979305267334,
0.02152538299560547,
0.3752394914627075,
-0.35604721307754517,
0.6190276145935059,
... |
func ConnectWithKeyFileTimeout(host, username, privKeyPath string, timeout time.Duration) (*Client, error) {
if privKeyPath == "" {
currentUser, err := user.Current()
if err == nil {
privKeyPath = filepath.Join(currentUser.HomeDir, ".ssh", "id_rsa")
}
}
privKey, err := ioutil.ReadFile(privKeyPath)
if err ... | [
0.38920992612838745,
-0.8126782178878784,
0.6831496357917786,
0.3704855144023895,
-0.5938429236412048,
0.3827987611293793,
-0.4909359812736511,
0.30184173583984375,
-1.0138319730758667,
1.0701179504394531,
-0.24797584116458893,
0.02444627322256565,
-0.8806961178779602,
-0.241911381483078,
... |
func ConnectWithKeyFilePassphraseTimeout(host, username, privKeyPath string, passPhrase string, timeout time.Duration) (*Client, error) {
if privKeyPath == "" {
currentUser, err := user.Current()
if err == nil {
privKeyPath = filepath.Join(currentUser.HomeDir, ".ssh", "id_rsa")
}
}
pemKey, err := ioutil.Rea... | [
0.12929032742977142,
-0.4879341721534729,
0.647186279296875,
0.11508749425411224,
-0.72869873046875,
0.5694937705993652,
-0.4851219654083252,
0.7552537322044373,
-0.8107762932777405,
1.4952634572982788,
-0.11911991238594055,
-0.9290016293525696,
-1.3058695793151855,
-0.29152560234069824,
... |
func ConnectWithKeyFile(host, username, privKeyPath string) (*Client, error) {
return ConnectWithKeyFileTimeout(host, username, privKeyPath, DefaultTimeout)
} | [
0.20552581548690796,
-0.34493082761764526,
0.4807673394680023,
0.9863740801811218,
-0.916334867477417,
0.8260879516601562,
-0.0687853991985321,
-0.5300095081329346,
-1.650506854057312,
0.7763835787773132,
-0.9850709438323975,
-0.2218378782272339,
-1.0121726989746094,
-0.5296081304550171,
... |
func ConnectWithKeyFilePassphrase(host, username, privKeyPath string, passPhrase string) (*Client, error) {
return ConnectWithKeyFilePassphraseTimeout(host, username, privKeyPath, passPhrase, DefaultTimeout)
} | [
-0.07592745870351791,
-0.23920445144176483,
0.49943625926971436,
0.32772067189216614,
-0.7561216950416565,
0.5465400218963623,
-0.7523267269134521,
0.2278204709291458,
-1.4168802499771118,
0.9790626764297485,
-0.3944183886051178,
-1.2371412515640259,
-1.1369374990463257,
-0.573647618293762... |
func ConnectWithKeyTimeout(host, username, privKey string, timeout time.Duration) (*Client, error) {
signer, err := ssh.ParsePrivateKey([]byte(privKey))
if err != nil {
return nil, err
}
authMethod := ssh.PublicKeys(signer)
return connect(username, host, authMethod, timeout)
} | [
0.15057553350925446,
-0.6393976807594299,
0.5060353875160217,
0.5895906090736389,
-1.5672597885131836,
-0.12495452165603638,
-1.6324290037155151,
-0.11357501149177551,
-0.5950402617454529,
1.047218918800354,
-0.6868597865104675,
0.3484486937522888,
-0.6262991428375244,
0.3057273030281067,
... |
func ConnectWithKeyPassphraseTimeout(host, username string, signer ssh.Signer, timeout time.Duration) (*Client, error) {
authMethod := ssh.PublicKeys(signer)
return connect(username, host, authMethod, timeout)
} | [
0.03336717560887337,
-0.6187364459037781,
0.32053205370903015,
0.3946384787559509,
-1.7403048276901245,
0.6099147200584412,
-1.559389591217041,
0.4436832666397095,
-0.46906906366348267,
1.2016199827194214,
-0.31245172023773193,
-0.8572211265563965,
-0.5241319537162781,
0.48858287930488586,... |
func ConnectWithKey(host, username, privKey string) (*Client, error) {
return ConnectWithKeyTimeout(host, username, privKey, DefaultTimeout)
} | [
-0.3932245075702667,
0.19055938720703125,
0.42670297622680664,
1.7271074056625366,
-0.9103919267654419,
-0.4605482518672943,
-0.7111671566963196,
-0.6269640922546387,
-0.9639279246330261,
1.230049729347229,
-0.39451196789741516,
0.2322278469800949,
-0.8354820013046265,
-0.10418855398893356... |
func ConnectWithAgentTimeout(host, username string, timeout time.Duration) (*Client, error) {
return connectWithAgentTimeout(host, username, timeout)
} | [
0.4363429844379425,
-1.036808967590332,
0.14720575511455536,
0.9350816607475281,
-1.1091270446777344,
0.15242771804332733,
-0.7696422338485718,
-0.41681045293807983,
-0.05881679430603981,
1.0387864112854004,
-0.1569959819316864,
-0.11915595829486847,
0.08992922306060791,
0.1780870258808136... |
func ConnectWithAgent(host, username string) (*Client, error) {
return ConnectWithAgentTimeout(host, username, DefaultTimeout)
} | [
0.1362522542476654,
-0.2851707935333252,
0.23856228590011597,
1.2218760251998901,
-0.7805914878845215,
-0.3478151559829712,
-0.27645713090896606,
-0.7405979633331299,
-0.0706418827176094,
0.3151947855949402,
-0.5229823589324951,
-0.06021039932966232,
-0.4326155483722687,
-0.099209599196910... |
func (c *Client) Exec(cmd string) ([]byte, error) {
session, err := c.SSHClient.NewSession()
if err != nil {
return nil, err
}
defer session.Close()
return session.CombinedOutput(cmd)
} | [
0.24274340271949768,
-0.24090377986431122,
0.45498138666152954,
0.42781004309654236,
-0.894253134727478,
0.17535264790058136,
-0.6177810430526733,
-0.9326756000518799,
-0.12483149766921997,
-0.19617889821529388,
-0.3598780035972595,
0.2359941601753235,
-0.47973930835723877,
-0.429780930280... |
func (c *Client) ExecSudo(cmd, passwd string) ([]byte, error) {
session, err := c.SSHClient.NewSession()
if err != nil {
return nil, err
}
defer session.Close()
// -n run non interactively
// -p specify the prompt. We do this to know that sudo is asking for a passwd
// -S Writes the prompt to StdErr and reads... | [
0.233515664935112,
-0.29844245314598083,
0.8092761635780334,
0.34665629267692566,
-0.5372877717018127,
-0.07502110302448273,
-0.3284302353858948,
-0.1794942319393158,
0.07530763000249863,
-0.6186797022819519,
-0.11161097884178162,
0.6664577722549438,
0.1252681314945221,
0.26209911704063416... |
func (c *Client) Download(remote, local string) error {
client, err := sftp.NewClient(c.SSHClient)
if err != nil {
return err
}
defer client.Close()
remoteFile, err := client.Open(remote)
if err != nil {
return err
}
defer remoteFile.Close()
localFile, err := os.Create(local)
if err != nil {
return er... | [
1.2099485397338867,
-0.4982781708240509,
0.9881410002708435,
-0.7131514549255371,
-0.40613609552383423,
0.978888750076294,
-0.3408299684524536,
0.7664633989334106,
-1.1155617237091064,
0.06988351047039032,
-0.26909497380256653,
0.1377466768026352,
-0.7130616307258606,
-0.565341591835022,
... |
func (c *Client) Upload(local, remote string) error {
client, err := sftp.NewClient(c.SSHClient)
if err != nil {
return err
}
defer client.Close()
localFile, err := os.Open(local)
if err != nil {
return err
}
defer localFile.Close()
remoteFile, err := client.Create(remote)
if err != nil {
return err
... | [
0.5155942440032959,
0.2012312412261963,
1.0680781602859497,
-1.2587631940841675,
-0.12736859917640686,
1.0775128602981567,
-0.5459659099578857,
0.4071177542209625,
-1.6548093557357788,
0.43976306915283203,
-0.15803779661655426,
0.4317891001701355,
-0.9580358862876892,
-0.7956481575965881,
... |
func (c *Client) Remove(path string) error {
client, err := sftp.NewClient(c.SSHClient)
if err != nil {
return err
}
defer client.Close()
return client.Remove(path)
} | [
0.13868597149848938,
-0.09390804171562195,
0.5123326182365417,
-0.4635303318500519,
-1.4407997131347656,
0.33389395475387573,
-0.17949053645133972,
0.507444441318512,
-0.29277554154396057,
0.4069633185863495,
-0.8086912035942078,
0.1641145497560501,
-1.5840505361557007,
-0.0259856991469860... |
func (c *Client) RemoveDirectory(path string) error {
client, err := sftp.NewClient(c.SSHClient)
if err != nil {
return err
}
defer client.Close()
return client.RemoveDirectory(path)
} | [
-0.8540812134742737,
0.30398860573768616,
0.5581114888191223,
-0.16023752093315125,
-0.7522523403167725,
-0.2728670537471771,
-0.13213291764259338,
0.22325560450553894,
-0.10595420747995377,
-0.35203397274017334,
-0.8977451324462891,
0.49406102299690247,
-0.7865301966667175,
0.312717378139... |
func (c *Client) ReadAll(filepath string) ([]byte, error) {
sftp, err := c.SFTPClient()
if err != nil {
panic(err)
}
defer sftp.Close()
file, err := sftp.Open(filepath)
if err != nil {
return nil, err
}
defer file.Close()
return ioutil.ReadAll(file)
} | [
0.6774514317512512,
-0.22627019882202148,
0.9552611112594604,
0.31081366539001465,
-0.24375639855861664,
1.0195327997207642,
-0.8875110149383545,
0.13187235593795776,
-0.8972761631011963,
0.35439538955688477,
0.05858568847179413,
0.7406521439552307,
-0.5691207647323608,
0.7182855606079102,... |
func (c *Client) Close() error {
return c.SSHClient.Close()
} | [
0.7880152463912964,
-0.32629308104515076,
0.44197553396224976,
-0.30992358922958374,
-0.6426278352737427,
0.9796634912490845,
-0.31608885526657104,
-0.3010680079460144,
-1.3218438625335693,
-0.7539583444595337,
-0.15483041107654572,
0.6854133605957031,
-0.8496893644332886,
0.42035949230194... |
func (c *Client) SFTPClient() (*sftp.Client, error) {
return sftp.NewClient(c.SSHClient)
} | [
1.232977032661438,
-0.024532416835427284,
0.21138250827789307,
-0.15826302766799927,
-0.9068593978881836,
0.2603227496147156,
-0.05451212078332901,
0.26989510655403137,
-0.19455520808696747,
-0.5126240849494934,
-0.8677356243133545,
1.1487812995910645,
-0.3254636526107788,
-0.1997535526752... |
func New(ioReader io.Reader) (r KafkalogReader, err error) {
r = &reader{
ioReader: ioReader,
}
return
} | [
0.12944673001766205,
-0.7665742039680481,
0.1813058704137802,
-0.1346404105424881,
-1.2527351379394531,
-0.31025347113609314,
-0.7722575664520264,
0.1733061969280243,
-0.9118627905845642,
0.3560493588447571,
0.5488003492355347,
-0.3884730637073517,
-0.1322217732667923,
0.1190502792596817,
... |
func (this *reader) Seek(offset int64, whence int) (n int64, err error) {
if ioSeeker, ok := this.ioReader.(io.Seeker); ok {
return ioSeeker.Seek(offset, whence)
}
return
} | [
-0.8455075621604919,
0.32399386167526245,
0.386035680770874,
-0.06252122670412064,
-0.5575464963912964,
-0.4044398069381714,
0.2962251305580139,
-0.65964275598526,
-0.23481053113937378,
-1.08148193359375,
0.18908166885375977,
0.3580053150653839,
-0.10519757121801376,
-0.417369544506073,
... |
func (this *reader) Close() (err error) {
if ioCloser, ok := this.ioReader.(io.Closer); ok {
err = ioCloser.Close()
}
return
} | [
-0.30201002955436707,
-0.7825949192047119,
0.5622630715370178,
-0.06602102518081665,
-0.5896921157836914,
0.4853021800518036,
0.33373716473579407,
-0.777003824710846,
-1.0017706155776978,
-0.8708670139312744,
1.3247284889221191,
-0.41584333777427673,
-1.645853877067566,
0.17118965089321136... |
func (this *reader) rollback(n int, err error) ([]byte, []byte, int64, error) {
_, e := this.Seek(int64(-n), 1)
if e != nil {
err = fmt.Errorf("Reading error(%q); Rollback error(%q)", err, e)
}
return nil, nil, 0, err
} | [
-0.7500507235527039,
0.3689688742160797,
0.9062820076942444,
-0.14335383474826813,
0.3668505847454071,
-0.27264976501464844,
0.28001099824905396,
-0.3177472949028015,
-0.17953090369701385,
0.48801189661026,
-0.07057840377092361,
0.09175277501344681,
-0.3848384618759155,
-0.0282763019204139... |
func (this *reader) ioRead(buffer []byte) (n int, err error) {
n, err = this.ioReader.Read(buffer)
if err != nil {
return
}
if n != len(buffer) {
err = fmt.Errorf("Reading failed. Expected %v bytes but %v was read",
len(buffer), n)
}
return
} | [
-0.4820300340652466,
-0.1225527673959732,
0.8798583745956421,
-0.3659466505050659,
-0.025959255173802376,
0.5198387503623962,
0.38970187306404114,
-0.29354217648506165,
0.08517169952392578,
-0.3097173273563385,
0.2662295997142792,
-0.14854682981967926,
-0.853895366191864,
-0.39214175939559... |
func (this *reader) Read() (value, key []byte, offset int64, err error) {
// read header
buffer := make([]byte, common.MSGSET_HEADER_SIZE)
n, err := this.ioRead(buffer)
if err != nil {
return this.rollback(n, err)
}
// parse header
_, msglen, err := common.ParseMessageSetHeader(buffer)
if err != nil {
retur... | [
-0.2123180776834488,
-0.1291874200105667,
0.8743692636489868,
-1.0016220808029175,
-0.5144997239112854,
-0.031503040343523026,
0.07276052981615067,
-0.34656038880348206,
-0.9479678273200989,
0.2593565285205841,
0.35606756806373596,
0.36642324924468994,
-0.6090436577796936,
0.11222789436578... |
func NewFile(path string) (_ KafkalogReader, err error) {
r, err := ioreader.NewFile(path)
if err != nil {
return
}
return New(r)
} | [
0.8129399418830872,
-0.15033183991909027,
0.5054486989974976,
0.2538454532623291,
-1.0891380310058594,
-0.5099565982818604,
-0.2562289535999298,
-0.28018927574157715,
-1.323102593421936,
-0.20363320410251617,
0.9295492172241211,
-0.601362407207489,
-0.3010605573654175,
-0.38960427045822144... |
func FixParams(req *model.ScriptGetReq, conf *config.Config) {
if req.LevelLower < 1 || req.LevelLower > 10 {
req.LevelLower = 1
}
if req.LevelUpper < 1 || req.LevelUpper > 10 {
req.LevelUpper = 10
}
if req.LevelLower > req.LevelUpper {
req.LevelLower = 1
req.LevelUpper = 10
}
if req.NumLower < 1 || req.... | [
-1.011823058128357,
-0.3172082304954529,
0.9391611814498901,
0.07360847294330597,
0.7912675738334656,
-0.1466885805130005,
0.0189004335552454,
0.7755321860313416,
-1.0857728719711304,
0.18846412003040314,
0.03439551219344139,
0.7950319051742554,
-0.6414424180984497,
1.6672405004501343,
1... |
func (s *ServerExpr) EvalName() string { return "Server " + s.Name } | [
-0.46698901057243347,
-0.6193520426750183,
0.4592953324317932,
-0.749926745891571,
-1.7407275438308716,
1.0901151895523071,
-0.7956767082214355,
1.077107548713684,
0.5591694712638855,
0.507395327091217,
-0.9204925298690796,
0.8655706644058228,
0.10540931671857834,
0.3805968463420868,
-0.... |
func (s *ServerExpr) Validate() error {
verr := new(eval.ValidationErrors)
for _, h := range s.Hosts {
verr.Merge(h.Validate().(*eval.ValidationErrors))
}
for _, svc := range s.Services {
if Root.Service(svc) == nil {
verr.Add(s, "service %q undefined", svc)
}
}
return verr
} | [
-0.3078153133392334,
0.09786342829465866,
0.42471644282341003,
0.21533600986003876,
0.22036579251289368,
0.4093696177005768,
0.049190454185009,
0.10136301070451736,
-0.6011565923690796,
-0.4494851231575012,
0.5529078841209412,
0.5792620182037354,
-0.4579556882381439,
1.5570805072784424,
... |
func (s *ServerExpr) Finalize() {
if len(s.Services) == 0 {
s.Services = make([]string, len(Root.Services))
for i, svc := range Root.Services {
s.Services[i] = svc.Name
}
}
if len(s.Hosts) == 0 {
s.Hosts = []*HostExpr{{
Name: "svc",
Description: "Service host",
URIs: []URIExpr{"http... | [
-0.7385505437850952,
0.7090666890144348,
0.6775862574577332,
0.022735757753252983,
0.4381738305091858,
-0.14884744584560394,
0.2577889859676361,
0.10824693739414215,
-0.6134229302406311,
-0.11526132375001907,
0.28250834345817566,
0.7208487391471863,
-0.4903486967086792,
1.2067134380340576,... |
func (s *ServerExpr) Schemes() []string {
schemes := make(map[string]struct{})
for _, h := range s.Hosts {
for _, sch := range h.Schemes() {
schemes[sch] = struct{}{}
}
}
ss := make([]string, len(schemes))
i := 0
for s := range schemes {
ss[i] = s
i++
}
sort.Strings(ss)
return ss
} | [
-0.27699223160743713,
0.3029519319534302,
0.4971233308315277,
-0.4538675546646118,
-0.4825124740600586,
0.7373743653297424,
0.1735546886920929,
-0.20058968663215637,
0.1574006974697113,
0.4474939703941345,
-0.0903003066778183,
0.4946105182170868,
-0.021573476493358612,
0.5676788091659546,
... |
func (h *HostExpr) Validate() error {
verr := new(eval.ValidationErrors)
if len(h.URIs) == 0 {
verr.Add(h, "host must define at least one URI")
}
for _, u := range h.URIs {
vu := uriVariableRegex.ReplaceAllString(string(u), "/w")
pu, err := url.Parse(vu)
if err != nil {
verr.Add(h, "malformed URI %q", u)... | [
-0.8469956517219543,
0.042210958898067474,
0.5646193623542786,
-0.0018219294724985957,
-0.31428325176239014,
0.23636281490325928,
0.05409371852874756,
0.35223594307899475,
-0.9630678296089172,
0.3173181712627411,
0.3449845016002655,
-0.03439682722091675,
-0.827744722366333,
0.7025168538093... |
func (h *HostExpr) Finalize() {
if h.Variables == nil {
h.Variables = &AttributeExpr{Type: &Object{}}
}
} | [
-0.2988183796405792,
0.5359473824501038,
0.474448025226593,
-0.5651761293411255,
0.14329032599925995,
0.14623074233531952,
0.2196754813194275,
0.7423754930496216,
-0.550527036190033,
0.019715769216418266,
0.1474088728427887,
0.9396875500679016,
-0.8983349204063416,
0.9242665767669678,
0.... |
func (h *HostExpr) EvalName() string {
return fmt.Sprintf("host %q of server %q", h.Name, h.ServerName)
} | [
-0.5279902815818787,
-0.6977495551109314,
0.5329063534736633,
-0.7801343202590942,
-1.5255627632141113,
0.8716524839401245,
-0.9299440383911133,
0.8910999894142151,
-0.7050014138221741,
0.43243733048439026,
-0.32726988196372986,
0.8075699210166931,
-0.220648393034935,
0.07460130751132965,
... |
func (h *HostExpr) Attribute() *AttributeExpr {
if h.Variables == nil {
h.Variables = &AttributeExpr{Type: &Object{}}
}
return h.Variables
} | [
0.19631534814834595,
-0.39713478088378906,
0.17490875720977783,
0.04009973257780075,
-0.0988416075706482,
0.23815903067588806,
0.7541119456291199,
0.6441625356674194,
0.40473318099975586,
-0.08877304196357727,
0.06320139020681381,
1.1803135871887207,
-0.34093034267425537,
0.344283580780029... |
func (h *HostExpr) Schemes() []string {
schemes := make(map[string]struct{})
for _, uri := range h.URIs {
schemes[uri.Scheme()] = struct{}{}
}
ss := make([]string, len(schemes))
i := 0
for s := range schemes {
ss[i] = s
i++
}
sort.Strings(ss)
return ss
} | [
-0.41351404786109924,
0.5821237564086914,
0.49595168232917786,
-0.2854456901550293,
-0.2704175114631653,
0.4019845128059387,
0.06926155090332031,
0.028396684676408768,
0.33698680996894836,
0.360697478055954,
0.22789664566516876,
-0.1282747983932495,
0.007725825998932123,
0.1513177752494812... |
func (h *HostExpr) HasHTTPScheme() bool {
for _, s := range []string{"http", "https"} {
for _, sch := range h.Schemes() {
if s == sch {
return true
}
}
}
return false
} | [
0.2652161419391632,
0.5429912209510803,
0.5210247039794922,
0.12766321003437042,
-0.16620926558971405,
0.0032741848845034838,
-0.5049301981925964,
0.5086449980735779,
-0.7712359428405762,
0.33370402455329895,
0.07612369954586029,
-0.5438847541809082,
0.4881416857242584,
1.1692639589309692,... |
func (h *HostExpr) HasGRPCScheme() bool {
for _, s := range []string{"grpc", "grpcs"} {
for _, sch := range h.Schemes() {
if s == sch {
return true
}
}
}
return false
} | [
0.4295487105846405,
0.6517695188522339,
0.6537464261054993,
-0.21657238900661469,
0.46444401144981384,
-0.0011993712978437543,
-0.009725227952003479,
0.45852160453796387,
-0.9813432097434998,
0.4023588299751282,
-0.12416895478963852,
0.05924893543124199,
-0.30207911133766174,
0.99736785888... |
func (h *HostExpr) URIString(u URIExpr) (string, error) {
found := false
for _, ue := range h.URIs {
if ue == u {
found = true
break
}
}
if !found {
return "", fmt.Errorf("uri %s not found in host", string(u))
}
uri := string(u)
// Substitute URI parameters with the corresponding variables defined in... | [
-0.7683063745498657,
0.07063150405883789,
0.5653453469276428,
0.17014874517917633,
-0.3623044788837433,
0.15222503244876862,
0.2569655776023865,
1.0579028129577637,
-0.735773503780365,
0.540365993976593,
0.10868530720472336,
-0.21444708108901978,
-0.4225081503391266,
-0.09955080598592758,
... |
func (u URIExpr) Params() []string {
r := regexp.MustCompile(`\{([^\{\}]+)\}`)
matches := r.FindAllStringSubmatch(string(u), -1)
if len(matches) == 0 {
return nil
}
wcs := make([]string, len(matches))
for i, m := range matches {
wcs[i] = m[1]
}
return wcs
} | [
-0.6107032895088196,
-0.2593599557876587,
0.496820867061615,
-0.17863430082798004,
-0.1812247484922409,
-0.37489691376686096,
0.10510320216417313,
0.34064844250679016,
0.15270866453647614,
0.5444270372390747,
0.6746599674224854,
0.7922664284706116,
-1.059548258781433,
0.10935269296169281,
... |
func (u URIExpr) Scheme() string {
ustr := string(u)
// Did not use url package to find scheme because the url may
// contain params (i.e. http://{version}.example.com) which needs
// substition for url.Parse to succeed. Also URIs in host must have
// a scheme otherwise validations would have failed.
switch {
ca... | [
-0.6237586736679077,
0.6128778457641602,
0.5360994338989258,
0.6163327097892761,
-0.03741631656885147,
-0.238254114985466,
0.00746353343129158,
0.3449765145778656,
-0.1596187800168991,
0.03153247386217117,
0.756393551826477,
0.011895972304046154,
-0.04502103850245476,
0.1831047534942627,
... |
func NewSchema(path string, content []byte) (schema *Schema, readErr error) {
if content == nil || (len(content) == 0) { // content not specified or has no content
readErr = ErrNoContentProvided
return
}
schema = &Schema{
Map: make(map[string]*SchemaKV),
Order: []string{},
Path: path,
}
cs := string... | [
-0.24036522209644318,
-1.5185316801071167,
0.9513369798660278,
0.6200031638145447,
-0.44170013070106506,
-1.1789554357528687,
-0.4388393461704254,
0.6476194262504578,
0.17711131274700165,
-0.10746237635612488,
0.6509014964103699,
-0.3426477611064911,
0.01670118421316147,
0.3818316757678985... |
func ParseSchemaLine(line string) (key string, t *SchemaType) {
keyValArr := strings.SplitN(line, "=", 2) // Split between key and value
if len(keyValArr) != 2 { // Not a key=val
return
}
key = keyValArr[0] // Set key to first position in array
rawVal := keyValArr[1] // Set our raw value
parsedSt, parseE... | [
-1.0589760541915894,
-0.48149821162223816,
0.6078948378562927,
-0.38794147968292236,
-0.17531435191631317,
-1.12519371509552,
-0.9663407206535339,
0.4562970995903015,
-0.11181210726499557,
0.2626561224460602,
-0.8543491959571838,
0.013528444804251194,
-0.02608596533536911,
0.25278845429420... |
func (schema *Schema) AddSection(section string, sT *SchemaKV) (addErr error) {
if schema.HasSection(section) { // Section already exists
addErr = ErrSectionExists
return
}
schema.Map[section] = sT
schema.Order = append(schema.Order, section) // Append to the existing order
return
} | [
-0.3874269127845764,
-0.801034152507782,
0.6645870208740234,
1.0187944173812866,
0.07565456628799438,
-0.23798426985740662,
-0.554029107093811,
0.21956150233745575,
0.5696647763252258,
0.20831944048404694,
0.47474661469459534,
-0.3071078658103943,
0.8039122223854065,
0.8570988774299622,
... |
func (schema *Schema) DeleteSections(sections ...string) {
for _, section := range sections { // For each section
section = TrimSectionSlashes(section)
delete(schema.Map, section) // Delete the section
schema.Order = RemoveFromStringArr(schema.Order, section) // Remove the section f... | [
0.0891585648059845,
-0.7263639569282532,
0.5115801095962524,
0.43359896540641785,
-0.027038946747779846,
0.10905458778142929,
-0.27480122447013855,
0.04343023523688316,
-0.033504776656627655,
-0.13375915586948395,
0.4255309998989105,
-0.7238226532936096,
-0.15128719806671143,
0.76172649860... |
func (schema *Schema) DeleteSectionsWithPrefix(sections ...string) {
for sectionInMap := range schema.Map { // For each section in the map
for _, section := range sections { // For each of the sections
section = TrimSectionSlashes(section)
if strings.HasPrefix(sectionInMap, section) { // If this section in th... | [
0.08431897312402725,
-1.1878643035888672,
0.896422803401947,
0.22374357283115387,
-0.7791289687156677,
-0.3801461458206177,
0.09852303564548492,
-0.060017023235559464,
0.4363396167755127,
-0.11221826821565628,
0.9177647829055786,
-0.7698407173156738,
-0.06925390660762787,
1.048898458480835... |
func (schema *Schema) GetSection(section string) (kv *SchemaKV, getErr error) {
var exists bool
if kv, exists = schema.Map[section]; !exists { // If the section does not exist
kv = nil
getErr = ErrSectionDoesNotExist
}
return
} | [
-0.18419143557548523,
-0.47246992588043213,
0.6351701617240906,
0.7602763772010803,
0.16066168248653412,
-0.8257091641426086,
-0.3854232132434845,
-0.009293397888541222,
0.2719111144542694,
0.5748453736305237,
0.6439528465270996,
0.25143536925315857,
0.30815908312797546,
0.578667163848877,... |
func (schema *Schema) HasSection(section string) (exists bool) {
_, exists = schema.Map[section]
return
} | [
-0.7333235144615173,
-0.25665032863616943,
0.5783519744873047,
-0.27962690591812134,
0.18526194989681244,
-0.22272537648677826,
-0.2635205090045929,
0.6232798099517822,
-0.5027551651000977,
-0.046872083097696304,
-0.10274015367031097,
-0.811142086982727,
1.0132335424423218,
1.0045539140701... |
func (schema *Schema) ImportIntoDconf() (importErr error) {
schemaContent := []byte(schema.String())
if len(schemaContent) == 0 { // No content
importErr = ErrNoContentProvided
return
}
bytesReader := bytes.NewReader(schemaContent) // Create a bytes reader for the file contents
var dconfPath string
dconfPa... | [
-0.022659173235297203,
0.3895294666290283,
0.715894877910614,
-0.5376132726669312,
-0.0599077008664608,
-0.597395122051239,
0.8269065618515015,
-0.03585804998874664,
-0.611239492893219,
0.3654426634311676,
-0.8161798715591431,
0.16971765458583832,
-0.8533490896224976,
-0.34161481261253357,... |
func (schema *Schema) MigrateSectionsWithName(source string, dest string, exact bool) {
source = TrimSectionSlashes(source)
dest = TrimSectionSlashes(dest)
for sectionKey, sectionKV := range schema.Map { // For each section in the map
if !strings.HasPrefix(sectionKey, source) || // Doesn't have source in the name... | [
-0.43604224920272827,
-0.06335718929767609,
0.9998190999031067,
-0.20791229605674744,
-0.9372593760490417,
-0.10441748052835464,
-0.4385557770729065,
-0.19696317613124847,
0.47175124287605286,
1.4307737350463867,
-0.7526861429214478,
-0.8371900320053101,
0.8968451619148254,
0.5051358342170... |
func (schema *Schema) String() (schemaString string) {
lines := []string{} // Set our lines that we'll use to ensure newlines and the like
sort.Strings(schema.Order) // Sort our order
for _, section := range schema.Order { // Use order so our sections are organized alphabetically
kv := schema.Map[section] ... | [
0.06600115448236465,
-1.1874228715896606,
0.620390772819519,
-0.32107114791870117,
-0.8544909358024597,
-0.3538573682308197,
-0.5210347771644592,
-0.1315702646970749,
-0.34093889594078064,
-0.08157847821712494,
0.2719988524913788,
0.5124719142913818,
0.4446113407611847,
0.32310688495635986... |
func ExtensionPOSIXRename() *sshfx.ExtensionPair {
return &sshfx.ExtensionPair{
Name: extensionPOSIXRename,
Data: "1",
}
} | [
0.1318044513463974,
0.0900283083319664,
0.464918851852417,
0.7784096002578735,
-2.108720541000366,
-0.5205075740814209,
-1.9182761907577515,
0.8200947046279907,
0.7388188242912292,
0.3392446041107178,
-1.2624588012695312,
-0.816182017326355,
0.5018116235733032,
-0.30560609698295593,
0.50... |
func (ep *POSIXRenameExtendedPacket) Type() sshfx.PacketType {
return sshfx.PacketTypeExtended
} | [
0.4626024663448334,
0.9988665580749512,
0.4736262559890747,
-0.25976860523223877,
-0.962041437625885,
0.2504163980484009,
-1.7528393268585205,
-0.20290279388427734,
0.9794997572898865,
-0.6608834862709045,
-1.1133798360824585,
1.1758710145950317,
-0.3207918703556061,
0.58076411485672,
0.... |
func (ep *POSIXRenameExtendedPacket) MarshalPacket(reqid uint32, b []byte) (header, payload []byte, err error) {
p := &sshfx.ExtendedPacket{
ExtendedRequest: extensionPOSIXRename,
Data: ep,
}
return p.MarshalPacket(reqid, b)
} | [
0.32140621542930603,
0.5561847686767578,
0.4809481203556061,
-0.01161676924675703,
-1.4427556991577148,
-0.37783995270729065,
-1.7836456298828125,
1.0185530185699463,
0.6960161328315735,
-0.6233728528022766,
-0.264058381319046,
1.0189449787139893,
0.02328798733651638,
0.4581931531429291,
... |
func NewAbsenceRepository() *AbsenceRepository {
return &AbsenceRepository{}
} | [
-0.28297680616378784,
-0.7185775637626648,
0.2116127759218216,
-0.8264811635017395,
-1.8881877660751343,
-0.04134533926844597,
0.010912436060607433,
0.20139619708061218,
0.47498393058776855,
-0.26760348677635193,
-0.2105015218257904,
-0.37606996297836304,
-0.5118913650512695,
0.20328573882... |
func WithTimeout(timeout time.Duration) configF {
return func(c *config) *config {
c.defaultTimeout = timeout
return c
}
} | [
0.671914279460907,
0.4297044575214386,
0.24470634758472443,
0.4368019104003906,
-0.10965025424957275,
-0.4078417122364044,
-0.14095406234264374,
0.9101104736328125,
-0.16597871482372284,
0.42874690890312195,
-0.7082116603851318,
-0.5979557633399963,
0.9608750343322754,
0.5928390622138977,
... |
func WithSync() configF {
var mu sync.Mutex
return func(c *config) *config {
c.beforeCall = mu.Lock
c.afterCall = mu.Unlock
return c
}
} | [
0.148849755525589,
0.5529810190200806,
0.6125885248184204,
0.29933205246925354,
-0.7751948833465576,
-1.4845914840698242,
0.2863062918186188,
0.10308341681957245,
-0.3107544183731079,
-0.11727731674909592,
-0.33212924003601074,
-0.35094189643859863,
1.052154302597046,
0.4139384627342224,
... |
func NewSPI(spiPort spi.Port, resetPin gpio.PinOut, irqPin gpio.PinIn, configs ...configF) (*Dev, error) {
cfg := &config{
defaultTimeout: 30 * time.Second,
beforeCall: noop,
afterCall: noop,
}
for _, cf := range configs {
cfg = cf(cfg)
}
raw, err := commands.NewLowLevelSPI(spiPort, resetPin, irqP... | [
0.40460970997810364,
0.14804542064666748,
0.4361143708229065,
0.7101000547409058,
-0.3680405914783478,
-0.03267275169491768,
0.45248597860336304,
-0.5074188709259033,
0.07565315067768097,
0.006051267962902784,
-0.2730157971382141,
-0.23470179736614227,
-0.5677893161773682,
0.08655333518981... |
func (r *Dev) Halt() error {
r.beforeCall()
defer r.afterCall()
return r.LowLevel.Halt()
} | [
0.5391939878463745,
0.5993655920028687,
0.27672070264816284,
0.01841721124947071,
0.41141921281814575,
1.2271748781204224,
0.11299747228622437,
-1.4044111967086792,
0.6418582201004028,
-0.9364350438117981,
-0.31462669372558594,
0.915882408618927,
-0.6154500842094421,
0.7877350449562073,
... |
func (r *Dev) SetAntennaGain(gain int) error {
r.beforeCall()
defer r.afterCall()
if gain < 0 || gain > 7 {
return wrapf("gain must be in [0..7] interval")
}
r.LowLevel.SetAntennaGain(gain)
return nil
} | [
-0.045747533440589905,
-0.5626855492591858,
0.49712705612182617,
-0.23544006049633026,
-0.7293064594268799,
0.3775775730609894,
-0.013591834343969822,
-0.8856695890426636,
0.7758274674415588,
-0.533559262752533,
-0.8125832676887512,
0.6756525635719299,
-0.04313154146075249,
1.1524031162261... |
func (r *Dev) ReadCard(timeout time.Duration, auth byte, sector int, block int, key Key) (data []byte, err error) {
r.beforeCall()
defer func() {
r.afterCall()
if err == nil {
err = r.LowLevel.StopCrypto()
}
}()
uuid, err := r.selectCard(timeout)
if err != nil {
return
}
state, err := r.LowLevel.Auth(... | [
-1.0330805778503418,
-0.032976873219013214,
0.807458758354187,
0.17710040509700775,
-0.5944167971611023,
-0.09929770976305008,
-0.983890950679779,
-0.42322829365730286,
0.35140857100486755,
0.7470949292182922,
0.40097877383232117,
1.0036290884017944,
-0.5074217319488525,
-0.475613087415695... |
func (r *Dev) ReadAuth(timeout time.Duration, auth byte, sector int, key Key) (data []byte, err error) {
r.beforeCall()
defer func() {
r.afterCall()
if err == nil {
err = r.LowLevel.StopCrypto()
}
}()
uuid, err := r.selectCard(timeout)
if err != nil {
return
}
state, err := r.LowLevel.Auth(auth, calc... | [
-0.486889123916626,
-0.3617716133594513,
0.7292699813842773,
0.703177273273468,
-0.6066742539405823,
0.059009015560150146,
-0.4631745517253876,
-0.4971846342086792,
0.49507439136505127,
0.3375059962272644,
0.37228792905807495,
0.6436099410057068,
-0.7319101095199585,
-0.6083551645278931,
... |
func (r *Dev) WriteCard(timeout time.Duration, auth byte, sector int, block int, data [16]byte, key Key) (err error) {
r.beforeCall()
defer func() {
r.afterCall()
if err == nil {
err = r.LowLevel.StopCrypto()
}
}()
uuid, err := r.selectCard(timeout)
if err != nil {
return
}
state, err := r.LowLevel.Au... | [
-1.2665328979492188,
-0.05618716776371002,
0.7362496852874756,
-0.32381585240364075,
0.19148176908493042,
-0.12845396995544434,
-0.4517003893852234,
-0.010019500739872456,
0.3973195254802704,
0.767022430896759,
-0.12088879942893982,
0.4858185052871704,
-0.7889525294303894,
-0.2214507609605... |
func (r *Dev) WriteSectorTrail(timeout time.Duration, auth byte, sector int, keyA Key, keyB Key, access *BlocksAccess, key Key) (err error) {
r.beforeCall()
defer func() {
r.afterCall()
if err == nil {
err = r.LowLevel.StopCrypto()
}
}()
uuid, err := r.selectCard(timeout)
if err != nil {
return
}
stat... | [
-0.5382935404777527,
-0.3033330738544464,
0.8813906311988831,
-0.37473905086517334,
0.22567598521709442,
-0.16621865332126617,
-0.023820411413908005,
-0.6242058873176575,
-0.5717583894729614,
0.6011870503425598,
-0.4122059941291809,
-0.02368032932281494,
-0.2747196555137634,
-0.18715322017... |
func (r *Dev) request() (int, error) {
backBits := -1
if err := r.LowLevel.DevWrite(commands.BitFramingReg, 0x07); err != nil {
return backBits, err
}
_, backBits, err := r.LowLevel.CardWrite(commands.PCD_TRANSCEIVE, []byte{0x26})
if err != nil {
return -1, err
}
if backBits != 0x10 {
return -1, wrapf("wro... | [
-1.3809601068496704,
1.1253539323806763,
0.9120455384254456,
-0.053565237671136856,
0.7977381944656372,
-0.7694075107574463,
0.831150233745575,
-0.5964511036872864,
-0.017397716641426086,
-0.7453999519348145,
0.5143160223960876,
0.6224548816680908,
-1.2667698860168457,
0.5428616404533386,
... |
func (r *Dev) antiColl() ([]byte, error) {
if err := r.LowLevel.DevWrite(commands.BitFramingReg, 0x00); err != nil {
return nil, err
}
backData, _, err := r.LowLevel.CardWrite(commands.PCD_TRANSCEIVE, []byte{commands.PICC_ANTICOLL, 0x20}[:])
if err != nil {
return nil, err
}
if len(backData) != 5 {
retur... | [
0.3351362943649292,
-0.622842013835907,
0.9726754426956177,
-0.5562793612480164,
0.04387500137090683,
0.04004152864217758,
0.2694896459579468,
-1.0536309480667114,
-0.28667840361595154,
-0.036905016750097275,
-0.141805961728096,
0.11228413134813309,
-1.1096612215042114,
0.09356667101383209... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.