query
stringlengths
10
3.85k
ru_query
stringlengths
9
3.76k
document
stringlengths
17
430k
metadata
dict
negatives
listlengths
97
100
negative_scores
listlengths
97
100
document_score
stringlengths
5
10
document_rank
stringclasses
2 values
ReadTrustAnchor reads a root trust anchor from: and returns the data or an error.
ReadTrustAnchor считывает корневой доверенный сертификат из: и возвращает данные или ошибку.
func ReadTrustAnchor(q io.Reader) ([]*TrustAnchor, error) { d := xml.NewDecoder(q) t := new(XMLTrustAnchor) if e := d.Decode(t); e != nil { return nil, e } ta := make([]*TrustAnchor, 0) var err error for _, digest := range t.KeyDigest { t1 := new(TrustAnchor) t1.Id = t.Id t1.Source = t.Source t1.Anchor...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "func getTrustAnchor() (*trustAnchor, error) {\n\tresp, err := http.Get(trustAnchorURL)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\tif resp.StatusCode != http.StatusOK {\n\t\treturn nil, fmt.Errorf(\"bad http response: %d\", resp.StatusCode)\n\t}\n\tbyteValue, err := ioutil.ReadAll(resp.Body)\n\tif err != nil {...
[ "0.70352846", "0.54166305", "0.5376895", "0.5034828", "0.50329363", "0.5005947", "0.4975937", "0.49141535", "0.49141535", "0.47976542", "0.4571982", "0.45457885", "0.44578916", "0.44233346", "0.44013694", "0.43893903", "0.4377805", "0.4350652", "0.4340766", "0.42625472", "0.4...
0.75947404
0
Name returns the name of the StreamToSubStream process
Name возвращает имя процесса StreamToSubStream
func (p *StreamToSubStream) Name() string { return p.name }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "func (o *Echo) GetStreamName() string {\n\treturn \"\"\n}", "func (s *Stream) Name() string { return s.file.Name() }", "func (o *ExportData) GetStreamName() string {\n\treturn \"\"\n}", "func (o *Kanban) GetStreamName() string {\n\treturn \"\"\n}", "func (o *ProjectWebhook) GetStreamName() string {\n\tretu...
[ "0.6440815", "0.62418556", "0.61738175", "0.61010945", "0.6079546", "0.60654175", "0.6047112", "0.58845854", "0.58486265", "0.5778065", "0.56679744", "0.56591153", "0.5604969", "0.5579104", "0.5553676", "0.5548935", "0.55190974", "0.5492352", "0.54096514", "0.5362376", "0.534...
0.75903994
0
Run runs the StreamToSubStream
Run запускает StreamToSubStream
func (p *StreamToSubStream) Run() { defer p.OutSubStream.Close() scipipe.Debug.Println("Creating new information packet for the substream...") subStreamIP := scipipe.NewIP("") scipipe.Debug.Printf("Setting in-port of process %s to IP substream field\n", p.Name()) subStreamIP.SubStream = p.In scipipe.Debug.Print...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "func (transmuxer *Transmuxer) Run() {\n\tif transmuxer.closed {\n\t\treturn\n\t}\n\n\tif transmuxer.running {\n\t\treturn\n\t}\n\n\ttransmuxer.running = true\n\n\tfor {\n\t\tvar sample float64\n\n\t\tfor _, streamer := range transmuxer.Streamers {\n\t\t\tnewSample, err := streamer.ReadSample()\n\t\t\tif err != nil...
[ "0.68090886", "0.6607723", "0.62104803", "0.6052246", "0.60397995", "0.6036606", "0.6014039", "0.5855327", "0.584613", "0.5787809", "0.5786557", "0.57808554", "0.57723176", "0.5762391", "0.5720863", "0.5698172", "0.56778085", "0.56413287", "0.56297857", "0.5620973", "0.559650...
0.79116404
0
reconcileStorage will ensure that the storage options for the ArgoCDExport are present.
reconcileStorage обеспечит, что опции хранения для ArgoCDExport будут присутствовать.
func (r *ReconcileArgoCDExport) reconcileStorage(cr *argoprojv1a1.ArgoCDExport) error { if cr.Spec.Storage == nil { cr.Spec.Storage = &argoprojv1a1.ArgoCDExportStorageSpec{ Backend: common.ArgoCDExportStorageBackendLocal, } return r.Client.Update(context.TODO(), cr) } // Local storage if err := r.reconcil...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "func (p *PBM) ResyncStorage(l *log.Event) error {\n\tstg, err := p.GetStorage(l)\n\tif err != nil {\n\t\treturn errors.Wrap(err, \"unable to get backup store\")\n\t}\n\n\t_, err = stg.FileStat(StorInitFile)\n\tif errors.Is(err, storage.ErrNotExist) {\n\t\terr = stg.Save(StorInitFile, bytes.NewBufferString(version....
[ "0.59389216", "0.5565799", "0.5399797", "0.52743936", "0.5260172", "0.5217568", "0.519692", "0.5181096", "0.517504", "0.51422614", "0.5113219", "0.50962377", "0.5088531", "0.5082477", "0.50752294", "0.5073554", "0.5038864", "0.5020849", "0.5003397", "0.49999294", "0.49972135"...
0.8529653
0
HasOwned returns true if the tags contains a tag that marks the resource as owned by the cluster from the perspective of this management tooling.
HasOwned возвращает true, если в тегах есть тег, который помечает ресурс как принадлежащий кластеру с точки зрения этой инфраструктуры управления.
func (in Labels) HasOwned(cluster string) bool { value, ok := in[ClusterTagKey(cluster)] return ok && ResourceLifecycle(value) == ResourceLifecycleOwned }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "func IsOwned(object metav1.Object) (owned bool, err error) {\n\trefs, err := getRefs(object)\n\tif err != nil {\n\t\treturn false, err\n\t}\n\treturn len(refs) > 0, nil\n}", "func (k keeper) HasOwner(ctx sdk.Context, name string) bool {\n\treturn !k.GetWhois(ctx, name).Owner.Empty()\n}", "func (o *DeployKey) H...
[ "0.65666986", "0.61177206", "0.59844804", "0.59676355", "0.596722", "0.5791662", "0.57812816", "0.577984", "0.56838113", "0.5683395", "0.56106216", "0.55367696", "0.5497445", "0.5447929", "0.53616506", "0.52428067", "0.5231064", "0.52302146", "0.5227012", "0.5203173", "0.5201...
0.7708871
0
ToComputeFilter returns the string representation of the labels as a filter to be used in google compute sdk calls.
ToComputeFilter возвращает строковое представление меток в качестве фильтра, который используется в вызовах google compute sdk.
func (in Labels) ToComputeFilter() string { var builder strings.Builder for k, v := range in { builder.WriteString(fmt.Sprintf("(labels.%s = %q) ", k, v)) } return builder.String() }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "func (q *Query) ToFilter() string {\n\treturn fmt.Sprintf(`\nresource.type=k8s_container\nAND (\n\tlogName=projects/%s/logs/stderr\n\tOR logName=projects/%s/logs/stdout\n)\nAND resource.labels.cluster_name=%q\nAND resource.labels.namespace_name=%q\nAND labels.%q=%q\n`,\n\t\tq.Project,\n\t\tq.Project,\n\t\tq.Cluste...
[ "0.63834465", "0.574212", "0.55767214", "0.55669326", "0.55330604", "0.55210286", "0.54926217", "0.53527564", "0.52048385", "0.51603985", "0.5131564", "0.5130316", "0.51199216", "0.50214374", "0.4973829", "0.4970531", "0.49135852", "0.4864435", "0.48620355", "0.48164833", "0....
0.8348716
0
ClusterTagKey generates the key for resources associated with a cluster.
ClusterTagKey генерирует ключ для ресурсов, связанных с кластером.
func ClusterTagKey(name string) string { return fmt.Sprintf("%s%s", NameGCPProviderOwned, name) }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "func GetClusterKey(clusterId string) string {\n\treturn ClusterKeyPrefix + clusterId\n}", "func ToClusterKey(vc *v1alpha1.Virtualcluster) string {\n\tif len(vc.GetNamespace()) > 0 {\n\t\treturn vc.GetNamespace() + \"-\" + vc.GetName()\n\t}\n\treturn vc.GetName()\n}", "func ResourceKey(group, version, kind stri...
[ "0.6541917", "0.6501025", "0.61764675", "0.5924296", "0.5737486", "0.5630355", "0.55596966", "0.5547573", "0.54778725", "0.54484475", "0.53929687", "0.5359112", "0.53568804", "0.5336668", "0.5244287", "0.52346826", "0.5230897", "0.5210514", "0.52006227", "0.51887405", "0.5183...
0.7726849
0
GinLogrus is a logger middleware, which use the logrus replace gin default logger
GinLogrus — это middleware-логгер, который использует logrus вместо дефолтного логгера Gin
func GinLogrus() gin.HandlerFunc { return func(c *gin.Context) { start := time.Now() // some evil middlewares modify this values path := c.Request.URL.Path c.Next() end := time.Since(start) status := c.Writer.Status() entry := logrus.WithFields(logrus.Fields{ "path": path, "method": c.Req...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "func Logrus() echo.MiddlewareFunc {\n\treturn LogrusDefaultConfig(DefaultLoggerConfig)\n}", "func GinLogger(log *logrus.Logger) gin.HandlerFunc {\n\treturn func(c *gin.Context) {\n\n\t\t// other handler can change c.Path so:\n\t\tpath := c.Request.URL.Path\n\t\tmethod := c.Request.Method\n\t\tstart := time.Now()...
[ "0.7025706", "0.6979332", "0.6601648", "0.6236444", "0.61680114", "0.6146722", "0.602604", "0.5978633", "0.59643364", "0.5946916", "0.59344643", "0.5901862", "0.5896292", "0.5896292", "0.57851714", "0.5780678", "0.5773026", "0.57373214", "0.57046056", "0.5691755", "0.5688423"...
0.75822556
0
save saving current page to filesystem
сохранение текущей страницы в файловую систему
func (p *Page) save(d *Dir) error { p.Sidebar = d.sidebar p.Items = d.pages file, err := os.Create(p.Path) if (err != nil) { return err } fmt.Printf("Create new page: %s\n \tby link:%s\n", p.Title, p.Path) return p.render(file) }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "func (p *Page) save() error {\n\tbody := fmt.Sprintf(\"<!-- Ingredients -->\\n%s\\n<!-- Instructions -->\\n%s\", p.Ingredients, p.Instructions)\n\treturn ioutil.WriteFile(filepath.Join(pagesDir, p.Filename+\".txt\"), []byte(body), 0600)\n}", "func (p *Page) save() error {\n\tfilename := \"./pages/\" + p.Title + ...
[ "0.75267327", "0.7403389", "0.7397416", "0.7375422", "0.7351893", "0.73325723", "0.7299355", "0.72905964", "0.7201987", "0.7189554", "0.7094197", "0.7000149", "0.69070685", "0.67373985", "0.6554937", "0.647469", "0.64519274", "0.6404184", "0.63746774", "0.6366096", "0.6352044...
0.76523435
0
public static native int floatToRawIntBits(float value);
public static native int floatToRawIntBits(float value);
func floatToRawIntBits(frame *rtda.Frame) { floatVal := frame.LocalVars().GetFloat(0) frame.OperandStack().PushInt(int32(math.Float32bits(floatVal))) }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "func JDK_java_lang_Float_floatToRawIntBits(value Float) Int {\n\tbits := math.Float32bits(float32(value))\n\treturn Int(int32(bits))\n}", "func float32bits(f float32) uint32 { return *(*uint32)(unsafe.Pointer(&f)) }", "func floatBits(f float64) uint64 {\n\t// Take f parameter and determine bit pattern.\n\t// T...
[ "0.8932094", "0.73746973", "0.7082981", "0.6395846", "0.6257228", "0.6139659", "0.60942435", "0.6084789", "0.60047704", "0.5823916", "0.5806024", "0.57731223", "0.57533044", "0.5684423", "0.5669247", "0.5609524", "0.5561731", "0.55265313", "0.5512581", "0.54936963", "0.546031...
0.82935
1
Send marshals and sends the DescribeUserHierarchyStructure API request.
Отправляет маршалов и отправляет запрос API DescribeUserHierarchyStructure.
func (r DescribeUserHierarchyStructureRequest) Send(ctx context.Context) (*DescribeUserHierarchyStructureResponse, error) { r.Request.SetContext(ctx) err := r.Request.Send() if err != nil { return nil, err } resp := &DescribeUserHierarchyStructureResponse{ DescribeUserHierarchyStructureOutput: r.Request.Data....
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "func (s *DescribeUserHierarchyStructureOutput) SetHierarchyStructure(v *HierarchyStructure) *DescribeUserHierarchyStructureOutput {\n\ts.HierarchyStructure = v\n\treturn s\n}", "func (s *UpdateUserHierarchyStructureInput) SetHierarchyStructure(v *HierarchyStructureUpdate) *UpdateUserHierarchyStructureInput {\n\t...
[ "0.57184553", "0.5469647", "0.5156814", "0.49289703", "0.48873046", "0.48873046", "0.4772959", "0.4772959", "0.44967076", "0.4447158", "0.4413114", "0.44060668", "0.44043696", "0.44002792", "0.43401435", "0.4336481", "0.42501748", "0.42497203", "0.42474967", "0.42249528", "0....
0.7537883
0
SDKResponseMetdata returns the response metadata for the DescribeUserHierarchyStructure request.
SDKResponseMetdata возвращает метаданные ответа для запроса DescribeUserHierarchyStructure.
func (r *DescribeUserHierarchyStructureResponse) SDKResponseMetdata() *aws.Response { return r.response }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "func (r *DescribeUserResponse) SDKResponseMetdata() *aws.Response {\n\treturn r.response\n}", "func (r *DescribeOrganizationConfigurationResponse) SDKResponseMetdata() *aws.Response {\n\treturn r.response\n}", "func (r *DescribeAccountAuditConfigurationResponse) SDKResponseMetdata() *aws.Response {\n\treturn r...
[ "0.62536407", "0.5904975", "0.5872406", "0.5871081", "0.5858043", "0.5845549", "0.5798019", "0.57850534", "0.574214", "0.57293725", "0.5725915", "0.57254905", "0.57240504", "0.5721584", "0.5710341", "0.570328", "0.5691056", "0.5691056", "0.5689465", "0.5678145", "0.56704104",...
0.7379813
0
NewWorkload constructs and returns a workload representation from an application reference.
NewWorkload создает и возвращает представление нагрузки на основе ссылки на приложение.
func NewWorkload(cluster *kubernetes.Cluster, app models.AppRef) *Workload { return &Workload{cluster: cluster, app: app} }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "func NewWorkloadDefinition(ctx *pulumi.Context,\n\tname string, args *WorkloadDefinitionArgs, opts ...pulumi.ResourceOption) (*WorkloadDefinition, error) {\n\tif args == nil {\n\t\targs = &WorkloadDefinitionArgs{}\n\t}\n\targs.ApiVersion = pulumi.StringPtr(\"core.oam.dev/v1alpha2\")\n\targs.Kind = pulumi.StringPtr...
[ "0.6290281", "0.6186775", "0.59179425", "0.57543576", "0.5292014", "0.52139693", "0.52035826", "0.5164044", "0.51574534", "0.5087843", "0.5084347", "0.50763017", "0.49866802", "0.498484", "0.49624205", "0.4953039", "0.49443993", "0.49021307", "0.48930544", "0.47866622", "0.47...
0.78468955
0
BoundServicesChange imports the currently bound services into the deployment. It takes a ServiceList, not just names, as it has to create/retrieve the associated service binding secrets. It further takes a set of the old services. This enables incremental modification of the deployment (add, remove affected, instead of...
BoundServicesChange импортирует текущие привязанные службы в развертывание. Он принимает ServiceList, а не просто имена, поскольку необходимо создать/получить соответствующие секреты привязки служб. Кроме того, он принимает набор старых служб. Это позволяет инкрементно модифицировать развертывание (добавить, удалить за...
func (a *Workload) BoundServicesChange(ctx context.Context, userName string, oldServices NameSet, newServices interfaces.ServiceList) error { app, err := Get(ctx, a.cluster, a.app) if err != nil { // Should not happen. Application was validated to exist // already somewhere by callers. return err } owner := ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "func (service *Service) HandelBoundServices(d9SecurityGroupID, policyType string, boundService BoundServicesRequest) (*CloudSecurityGroupResponse, *http.Response, error) {\n\tv := new(CloudSecurityGroupResponse)\n\trelativeURL := fmt.Sprintf(\"%s/%s/%s/%s\", awsSgResourcePath, d9SecurityGroupID, awsSgResourceServi...
[ "0.56772745", "0.54476625", "0.5211605", "0.51789063", "0.51135707", "0.50000817", "0.4976379", "0.49644193", "0.49369168", "0.48852873", "0.48671865", "0.4861238", "0.48560068", "0.48487443", "0.482289", "0.48134246", "0.48115814", "0.47962728", "0.47867313", "0.47812405", "...
0.7591342
0
EnvironmentChange imports the current environment into the deployment. This requires only the names of the currently existing environment variables, not the values, as the import is internally done as pod env specifications using secret key references.
EnvironmentChange импортирует текущую среду в развертывание. Для этого требуется только названия существующих переменных окружения, а не их значения, так как импорт выполняется внутренне в виде спецификаций окружения подконтейнеров с использованием ссылок на секретные ключи.
func (a *Workload) EnvironmentChange(ctx context.Context, varNames []string) error { return retry.RetryOnConflict(retry.DefaultRetry, func() error { // Retrieve the latest version of Deployment before attempting update // RetryOnConflict uses exponential backoff to avoid exhausting the apiserver deployment, err ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "func env() error {\n\t// regexp for TF_VAR_ terraform vars\n\ttfVar := regexp.MustCompile(`^TF_VAR_.*$`)\n\n\t// match terraform vars in environment\n\tfor _, e := range os.Environ() {\n\t\t// split on value\n\t\tpair := strings.SplitN(e, \"=\", 2)\n\n\t\t// match on TF_VAR_*\n\t\tif tfVar.MatchString(pair[0]) {\n...
[ "0.5812909", "0.5790658", "0.576041", "0.5611268", "0.5522273", "0.5518604", "0.549987", "0.5493906", "0.54892653", "0.54662716", "0.54650384", "0.54612553", "0.5447039", "0.54098463", "0.5391029", "0.5381192", "0.53804636", "0.537156", "0.53701836", "0.5362287", "0.5356194",...
0.76379824
0
Scale changes the number of instances (replicas) for the application's Deployment.
Scale изменяет количество экземпляров (реплика) для Deployment приложения.
func (a *Workload) Scale(ctx context.Context, instances int32) error { return retry.RetryOnConflict(retry.DefaultRetry, func() error { // Retrieve the latest version of Deployment before attempting update // RetryOnConflict uses exponential backoff to avoid exhausting the apiserver deployment, err := a.Deploymen...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "func Scale(namespace string, app string, n *int32) error {\n\tc, err := k8s.NewInClusterClient()\n\tif err != nil {\n\t\treturn nil, errors.Wrap(err, \"failed to get k8s client\")\n\t}\n\n\td, err := c.ExtensionsV1Beta1().GetDeployment(ctx, app, namespace)\n\tif err != nil {\n\t\treturn errors.Wrap(err, \"failed t...
[ "0.82982755", "0.73352265", "0.7108116", "0.70009696", "0.6907844", "0.6820197", "0.6735582", "0.67346925", "0.66280305", "0.64414525", "0.6375801", "0.6365863", "0.6314644", "0.62918156", "0.62655246", "0.6144791", "0.61160296", "0.60683995", "0.60674256", "0.5875461", "0.58...
0.8210777
1
deployment is a helper, it returns the kube deployment resource of the workload.
deployment — это вспомогательный инструмент, он возвращает ресурс kube deployment работы.
func (a *Workload) Deployment(ctx context.Context) (*appsv1.Deployment, error) { return a.cluster.Kubectl.AppsV1().Deployments(a.app.Org).Get( ctx, a.app.Name, metav1.GetOptions{}, ) }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "func kubeconDeployment(image, tag string) (*apiv1b2.Deployment, error) {\n\tom := webappMeta(helloKubeconDeploymentName, \"api\")\n\tif tag == \"\" || image == \"\" {\n\t\treturn nil, fmt.Errorf(\"error: image and tag must be defined\")\n\t}\n\tpts := &v1.PodTemplateSpec{\n\t\tObjectMeta: om,\n\t\tSpec: v1.PodSpec...
[ "0.69726676", "0.6918134", "0.6861107", "0.6786004", "0.6662607", "0.6639795", "0.6584675", "0.6517535", "0.65127385", "0.64983946", "0.6455542", "0.64240986", "0.6340011", "0.6307846", "0.63056487", "0.6301531", "0.62912184", "0.6233751", "0.6231887", "0.62260896", "0.622602...
0.7065447
0
Get returns the state of the app deployment encoded in the workload.
Get возвращает состояние развертывания приложения, закодированное в работе.
func (a *Workload) Get(ctx context.Context, deployment *appsv1.Deployment) *models.AppDeployment { active := false route := "" stageID := "" status := "" username := "" // Query application deployment for stageID and status (ready vs desired replicas) deploymentSelector := fmt.Sprintf("app.kubernetes.io/part-o...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "func (d *Deployment) Get(namespace, name string) (*appsv1.Deployment, error) {\n\tdeploy, err := d.cs.AppsV1().Deployments(namespace).Get(context.Background(), name, metav1.GetOptions{})\n\tif err != nil {\n\t\tif k8serrors.IsNotFound(err) {\n\t\t\treturn nil, k8serror.ErrNotFound\n\t\t}\n\t\treturn nil, err\n\t}\...
[ "0.60578436", "0.5990617", "0.5870273", "0.5749326", "0.5747082", "0.5648761", "0.5562212", "0.5540046", "0.54830396", "0.5407057", "0.5313466", "0.5292182", "0.5255391", "0.52393395", "0.52236474", "0.5207524", "0.51852775", "0.5173332", "0.5171748", "0.51617277", "0.5147494...
0.7768766
0
NewRepository returns Repository with given middleware.Pool
NewRepository возвращает Repository с заданным middleware.Pool
func NewRepository(db middleware.Pool) *Repository { return &Repository{Database: db} }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "func NewRepository(pool *pgxpool.Pool) *Repository {\n\treturn &Repository{pool: pool}\n}", "func New(pool *pgxpool.Pool) (repository.Repository, error) {\n\tif pool == nil {\n\t\treturn nil, ErrMissingPool\n\t}\n\n\treturn postgresRepository{\n\t\tpool: pool,\n\t}, nil\n}", "func NewRepository(pool *pgxpool.P...
[ "0.7033007", "0.70324636", "0.68525314", "0.67147243", "0.65552145", "0.65296394", "0.6516489", "0.64633226", "0.6458645", "0.6428717", "0.6424986", "0.64021033", "0.6314789", "0.62775224", "0.6276378", "0.62416613", "0.6236914", "0.621444", "0.61860937", "0.6185766", "0.6185...
0.76721686
0
Transaction returns a middleware.Transaction that could execute multiple commands as a transaction
Транзакция возвращает middleware.Transaction, который может выполнять несколько команд как транзакцию
func (r *Repository) Transaction() (middleware.Transaction, error) { return r.Database.Transaction() }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "func Transaction(next http.Handler) http.Handler {\n\tfn := func(w http.ResponseWriter, r *http.Request) {\n\t\tt, ctx := orm.NewTransaction(r.Context())\n\t\tdefer func() {\n\t\t\tif rec := recover(); rec != nil {\n\t\t\t\tt.Rollback()\n\t\t\t\t// Panic to let recoverer handle 500\n\t\t\t\tpanic(rec)\n\t\t\t} els...
[ "0.6934194", "0.68263537", "0.66666955", "0.65281916", "0.65220726", "0.6500732", "0.64666903", "0.6418999", "0.6384218", "0.63415635", "0.6333283", "0.63124186", "0.630846", "0.6259748", "0.62529105", "0.6215971", "0.62130564", "0.6209439", "0.6205622", "0.6169113", "0.61445...
0.7005496
0
NewClient Creates a new client to communicate with the Sentry API.
NewClient создаёт новый клиент для взаимодействия с API Sentry.
func NewClient(api string, baseURI string, org string) *Client { if !strings.HasSuffix(baseURI, "/") { baseURI += "/" } return &Client{ client: &http.Client{}, sentryAPIKey: api, sentryURI: baseURI, sentryOrg: org, } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "func NewClient(clientID string) *Client {\n\treturn &Client{\n\t\tApi: &soundcloud.Api{\n\t\t\tClientId: clientID,\n\t\t},\n\t\tclientID: clientID,\n\t\thc: &http.Client{\n\t\t\tTimeout: 5 * time.Second,\n\t\t},\n\t}\n}", "func New(client *sajari.Client) *Client {\n\treturn &Client{\n\t\tc: client,\n\t}\n}", "...
[ "0.69753504", "0.6909176", "0.68756545", "0.6828231", "0.6781878", "0.6778484", "0.67573667", "0.6750796", "0.6738676", "0.67295736", "0.67211974", "0.6719252", "0.67097473", "0.67009145", "0.66968787", "0.6682295", "0.66727865", "0.6664944", "0.66583467", "0.6650193", "0.664...
0.72267675
0
Simulate an empty response. (This is not a compliant server behavior.)
Симулировать пустой ответ. (Это не соответствует стандартному поведению сервера.)
func TestEmptyResponse(t *testing.T) { doh, _ := NewTransport(testURL, ips, nil, nil, nil) transport := doh.(*transport) rt := makeTestRoundTripper() transport.client.Transport = rt // Fake server. go func() { <-rt.req // Make an empty body. r, w := io.Pipe() w.Close() rt.resp <- &http.Response{ Sta...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "func CreateEmptyResponse(w http.ResponseWriter) {\n\tw.WriteHeader(http.StatusNoContent)\n}", "func (r *Responder) NoContent() { r.write(http.StatusNoContent) }", "func RespondEmpty(w http.ResponseWriter, code int) {\n\tw.Header().Set(\"X-XSS-Protection\", \"1; mode=block\")\n\tw.Header().Set(\"X-Content-Type-...
[ "0.75151366", "0.7469854", "0.7159161", "0.7026811", "0.7014444", "0.69953966", "0.69483393", "0.6848218", "0.6798946", "0.6741318", "0.67343277", "0.67306024", "0.6727121", "0.6715123", "0.66678727", "0.6632295", "0.6557014", "0.6511988", "0.64460313", "0.6439891", "0.643529...
0.7485086
1
Test if DoH resolver IPs are confirmed and disconfirmed when queries suceeded and fail, respectively.
Проверьте, подтверждается ли IP-адрес DoH-резолвера и отменяется ли он при успешных и неуспешных запросах соответственно.
func TestDohIPConfirmDisconfirm(t *testing.T) { u, _ := url.Parse(testURL) doh, _ := NewTransport(testURL, ips, nil, nil, nil) transport := doh.(*transport) hostname := u.Hostname() ipmap := transport.ips.Get(hostname) // send a valid request to first have confirmed-ip set res, _ := doh.Query(simpleQueryBytes) ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "func TestFlaggingDecommissionedHosts(t *testing.T) {\n\tConvey(\"When flagging decommissioned hosts\", t, func() {\n\n\t\tConvey(\"only hosts in the database who are marked decommissioned\"+\n\t\t\t\" should be returned\", func() {\n\n\t\t\t// reset the db\n\t\t\trequire.NoError(t, db.ClearCollections(host.Collect...
[ "0.56950366", "0.5444178", "0.52720666", "0.52533114", "0.52149844", "0.520094", "0.51740646", "0.51245964", "0.5120735", "0.5113124", "0.5092491", "0.50820696", "0.50752467", "0.50582534", "0.5049603", "0.5046325", "0.50083274", "0.49557894", "0.49459672", "0.49330953", "0.4...
0.71566
0
Check that packing |compressedQueryBytes| constructs the same query byteforbyte.
Проверьте, что упаковка |compressedQueryBytes| строит тот же запрос байт в байт.
func TestDnsMessageCompressedQueryConfidenceCheck(t *testing.T) { m := mustUnpack(compressedQueryBytes) packedBytes := mustPack(m) if len(packedBytes) != len(compressedQueryBytes) { t.Errorf("Packed query has different size than original:\n %v\n %v", packedBytes, compressedQueryBytes) } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "func TestDnsMessageUncompressedQueryConfidenceCheck(t *testing.T) {\n\tm := mustUnpack(uncompressedQueryBytes)\n\tpackedBytes := mustPack(m)\n\tif len(packedBytes) >= len(uncompressedQueryBytes) {\n\t\tt.Errorf(\"Compressed query is not smaller than uncompressed query\")\n\t}\n}", "func (q *CompoundQuery) GetCom...
[ "0.68890274", "0.57353276", "0.5696035", "0.5437959", "0.54121333", "0.537639", "0.5337406", "0.5200456", "0.51706797", "0.5057195", "0.5042812", "0.49630687", "0.4941367", "0.49219006", "0.4919686", "0.49029464", "0.48985067", "0.4887714", "0.48703045", "0.4842406", "0.48307...
0.71391696
0
Check that packing |uncompressedQueryBytes| constructs a smaller query byteforbyte, since label compression is enabled by default.
Проверьте, что упаковка |uncompressedQueryBytes| создает более короткий запрос по байту за байтом, поскольку сжатие меток включено по умолчанию.
func TestDnsMessageUncompressedQueryConfidenceCheck(t *testing.T) { m := mustUnpack(uncompressedQueryBytes) packedBytes := mustPack(m) if len(packedBytes) >= len(uncompressedQueryBytes) { t.Errorf("Compressed query is not smaller than uncompressed query") } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "func TestDnsMessageCompressedQueryConfidenceCheck(t *testing.T) {\n\tm := mustUnpack(compressedQueryBytes)\n\tpackedBytes := mustPack(m)\n\tif len(packedBytes) != len(compressedQueryBytes) {\n\t\tt.Errorf(\"Packed query has different size than original:\\n %v\\n %v\", packedBytes, compressedQueryBytes)\n\t}\n}",...
[ "0.6823946", "0.53564346", "0.51485986", "0.5139452", "0.50640583", "0.5022969", "0.49374676", "0.4916851", "0.48699605", "0.4850243", "0.48246896", "0.48079136", "0.4799034", "0.4767999", "0.47604385", "0.47575718", "0.4742403", "0.47369084", "0.47271678", "0.47015467", "0.4...
0.721547
0
NewProtectedGetPlaytimeGameTelemetryV1ProtectedSteamIdsSteamIDPlaytimeGetOK creates a ProtectedGetPlaytimeGameTelemetryV1ProtectedSteamIdsSteamIDPlaytimeGetOK with default headers values
NewProtectedGetPlaytimeGameTelemetryV1ProtectedSteamIdsSteamIDPlaytimeGetOK создает ProtectedGetPlaytimeGameTelemetryV1ProtectedSteamIdsSteamIDPlaytimeGetOK с значениями заголовков по умолчанию
func NewProtectedGetPlaytimeGameTelemetryV1ProtectedSteamIdsSteamIDPlaytimeGetOK() *ProtectedGetPlaytimeGameTelemetryV1ProtectedSteamIdsSteamIDPlaytimeGetOK { return &ProtectedGetPlaytimeGameTelemetryV1ProtectedSteamIdsSteamIDPlaytimeGetOK{} }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "func NewProtectedGetPlaytimeGameTelemetryV1ProtectedSteamIdsSteamIDPlaytimeGetUnprocessableEntity() *ProtectedGetPlaytimeGameTelemetryV1ProtectedSteamIdsSteamIDPlaytimeGetUnprocessableEntity {\n\treturn &ProtectedGetPlaytimeGameTelemetryV1ProtectedSteamIdsSteamIDPlaytimeGetUnprocessableEntity{}\n}", "func (o *Pr...
[ "0.52899104", "0.447495", "0.4440635", "0.44148892", "0.4270405", "0.42306632", "0.42255187", "0.42208046", "0.41822582", "0.41728333", "0.41548944", "0.4154055", "0.4148511", "0.41375974", "0.41100857", "0.41024846", "0.40931123", "0.4068021", "0.40467957", "0.4037121", "0.4...
0.7406249
0
NewProtectedGetPlaytimeGameTelemetryV1ProtectedSteamIdsSteamIDPlaytimeGetUnprocessableEntity creates a ProtectedGetPlaytimeGameTelemetryV1ProtectedSteamIdsSteamIDPlaytimeGetUnprocessableEntity with default headers values
NewProtectedGetPlaytimeGameTelemetryV1ProtectedSteamIdsSteamIDPlaytimeGetUnprocessableEntity создает ProtectedGetPlaytimeGameTelemetryV1ProtectedSteamIdsSteamIDPlaytimeGetUnprocessableEntity с значениями заголовков по умолчанию
func NewProtectedGetPlaytimeGameTelemetryV1ProtectedSteamIdsSteamIDPlaytimeGetUnprocessableEntity() *ProtectedGetPlaytimeGameTelemetryV1ProtectedSteamIdsSteamIDPlaytimeGetUnprocessableEntity { return &ProtectedGetPlaytimeGameTelemetryV1ProtectedSteamIdsSteamIDPlaytimeGetUnprocessableEntity{} }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "func NewGetTaskDetailsUnprocessableEntity() *GetTaskDetailsUnprocessableEntity {\n\n\treturn &GetTaskDetailsUnprocessableEntity{}\n}", "func NewGetAPIPublicV1TeamUnprocessableEntity() *GetAPIPublicV1TeamUnprocessableEntity {\n\treturn &GetAPIPublicV1TeamUnprocessableEntity{}\n}", "func NewWeaviateKeyCreateUnpr...
[ "0.5650617", "0.5636281", "0.54643387", "0.5256545", "0.5237649", "0.5215986", "0.5137212", "0.5104093", "0.5101223", "0.4990614", "0.49280345", "0.48145685", "0.48031926", "0.47842333", "0.47759265", "0.4742333", "0.4735349", "0.46556872", "0.46432883", "0.46251956", "0.4601...
0.7384049
0
NewPaddingTLV creates a new padding TLV
NewPaddingTLV создает новый тег заполнения TLV
func NewPaddingTLV(length uint8) *PaddingTLV { return &PaddingTLV{ TLVType: PaddingType, TLVLength: length, PaddingData: make([]byte, length), } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "func (p *PaddingTLV) Length() uint8 {\n\treturn p.TLVLength\n}", "func pad(unpadded []byte, desiredLength int) []byte {\n\tif len(unpadded) == desiredLength {\n\t\treturn unpadded\n\t}\n\ttoAppend := desiredLength - len(unpadded)\n\treturn append(unpadded, bytes.Repeat([]byte{byte(0x00)}, toAppend)...)\n}", "f...
[ "0.5740221", "0.56109005", "0.5459555", "0.5429105", "0.5415254", "0.526596", "0.52202696", "0.5168666", "0.50730824", "0.49269283", "0.49154794", "0.49023673", "0.48499796", "0.48332152", "0.48277208", "0.48276848", "0.47980988", "0.47889626", "0.4785528", "0.47746792", "0.4...
0.7591314
0
Length gets the length of the TLV
Длина получает длину TLV
func (p *PaddingTLV) Length() uint8 { return p.TLVLength }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "func (a *AdditionalGUTI) GetLen() (len uint16) {}", "func (h *ExtendedHeader) GetLength(_ protocol.VersionNumber) protocol.ByteCount {\n\tlength := 1 /* type byte */ + 4 /* version */ + 1 /* dest conn ID len */ + protocol.ByteCount(h.DestConnectionID.Len()) + 1 /* src conn ID len */ + protocol.ByteCount(h.SrcCon...
[ "0.7318795", "0.7001363", "0.6942401", "0.6891273", "0.6878425", "0.68543977", "0.6744803", "0.6739835", "0.6715174", "0.67149013", "0.6713755", "0.66523576", "0.66506857", "0.66475517", "0.6636951", "0.6624504", "0.65799433", "0.6557597", "0.65531355", "0.65423506", "0.65261...
0.7524238
0
Serialize serializes a padding TLV
Serialize сериализует padding TLV
func (p *PaddingTLV) Serialize(buf *bytes.Buffer) { buf.WriteByte(p.TLVType) buf.WriteByte(p.TLVLength) buf.Write(p.PaddingData) }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "func (p *PaddingTLV) Length() uint8 {\n\treturn p.TLVLength\n}", "func NewPaddingTLV(length uint8) *PaddingTLV {\n\treturn &PaddingTLV{\n\t\tTLVType: PaddingType,\n\t\tTLVLength: length,\n\t\tPaddingData: make([]byte, length),\n\t}\n}", "func (g *GroupedAVP) Padding() int {\n\treturn 0\n}", "func getPa...
[ "0.5785339", "0.5553274", "0.5451155", "0.5364017", "0.5321094", "0.52745724", "0.5261391", "0.52536887", "0.5251995", "0.52181494", "0.5216098", "0.5210108", "0.520552", "0.5186594", "0.5163753", "0.50572926", "0.50076044", "0.49867326", "0.4979345", "0.49656087", "0.4959786...
0.76584166
0
AFunc1In calls the stored function 'a_bit_of_everything.a_func_1_in(number) number' on db.
AFunc1In вызывает хранимую функцию 'a_bit_of_everything.a_func_1_in(number) number' на db.
func AFunc1In(ctx context.Context, db DB, aParam int64) (int64, error) { // call a_bit_of_everything.a_func_1_in const sqlstr = `SELECT a_bit_of_everything.a_func_1_in(:1) FROM dual` // run var r0 int64 logf(sqlstr, aParam) if err := db.QueryRowContext(ctx, sqlstr, aParam).Scan(&r0); err != nil { return 0, loge...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "func A1In1Out(ctx context.Context, db DB, aParam int) (int, error) {\n\t// At the moment, the Go MySQL driver does not support stored procedures\n\t// with out parameters\n\treturn 0, fmt.Errorf(\"unsupported\")\n}", "func FuncIn() {\n\tsimlog.FuncIn()\n}", "func (l *logger) FuncIn() {\n\tif !l.isDebug {\n\t\t...
[ "0.59811527", "0.5737294", "0.5608908", "0.542825", "0.52071387", "0.50139046", "0.5005405", "0.49846172", "0.49317142", "0.49308378", "0.48855373", "0.48657376", "0.4847981", "0.48454347", "0.48078746", "0.48072076", "0.47299212", "0.47262934", "0.47253907", "0.47093183", "0...
0.86705595
0
XXH64 returns new hash.Hash64
XXH64 возвращает новый hash.Hash64
func XXH64(seed uint64) hash.Hash64 { d := &digest64{seed: seed, buf: new(bytes.Buffer)} d.Reset() return d }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "func (this *XXHash64) Hash(data []byte) uint64 {\n\tend := len(data)\n\tvar h64 uint64\n\tn := 0\n\n\tif end >= 32 {\n\t\tend32 := end - 32\n\t\tv1 := this.seed + _XXHASH_PRIME64_1 + _XXHASH_PRIME64_2\n\t\tv2 := this.seed + _XXHASH_PRIME64_2\n\t\tv3 := this.seed\n\t\tv4 := this.seed - _XXHASH_PRIME64_1\n\n\t\tfor ...
[ "0.708379", "0.6949178", "0.6914841", "0.6849021", "0.6677332", "0.66591746", "0.664148", "0.65541524", "0.6538839", "0.64558864", "0.64174473", "0.6362205", "0.6334637", "0.6288086", "0.6278777", "0.62381715", "0.6187761", "0.6118733", "0.6098435", "0.6039612", "0.603536", ...
0.7710503
0
NewConfig returns an empty ServerConfigBuilder.
NewConfig возвращает пустой ServerConfigBuilder.
func NewConfig() ServerConfigBuilder { return &serverConfig{} }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "func newConfigServer() *ConfigServer {\n\treturn &ConfigServer{}\n}", "func newConfig() *Config {\n\treturn &Config{\n\t\tgeneral{\n\t\t\tVerbose: false,\n\t\t},\n\t\tserver{\n\t\t\tType: \"http\",\n\t\t\tHost: \"0.0.0.0\",\n\t\t},\n\t\tmongo{\n\t\t\tHost: \"0.0.0.0:27017\",\n\t\t\tDatabase: \"etlog\",\n...
[ "0.714636", "0.6788078", "0.672954", "0.671221", "0.64953154", "0.6477215", "0.63846946", "0.6384149", "0.6354265", "0.6305003", "0.6282221", "0.6247137", "0.6234308", "0.622695", "0.61695105", "0.61501217", "0.61187845", "0.6103186", "0.60942477", "0.60919195", "0.60896236",...
0.7364699
0
SetRetryWaitTime accepts an int and sets retry wait time in seconds.
SetRetryWaitTime принимает целое число и устанавливает время ожидания повторной попытки в секундах.
func (co *serverConfig) SetRetryWaitTime(t int) ServerConfigBuilder { co.RetryWaitTime = time.Duration(t) * time.Second return co }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "func (c *Client) SetMaxRetryWait(retryWait time.Duration) {\n\tc.modifyLock.RLock()\n\tdefer c.modifyLock.RUnlock()\n\tc.config.modifyLock.Lock()\n\tdefer c.config.modifyLock.Unlock()\n\n\tc.config.MaxRetryWait = retryWait\n}", "func SetRetrySeconds(retrySeconds int8) Option {\n\treturn func(s *Scraper) Option {...
[ "0.6929946", "0.67542446", "0.6693405", "0.6526574", "0.6397074", "0.63898647", "0.6365026", "0.6311", "0.6271505", "0.6238838", "0.6207614", "0.61254764", "0.60295117", "0.6028012", "0.6021742", "0.5974879", "0.5930354", "0.59214675", "0.5837585", "0.5833836", "0.57983696", ...
0.83682585
0
Build method returns a serverConfig struct.
Метод Build возвращает структуру serverConfig.
func (co *serverConfig) Build() serverConfig { return serverConfig{ URL: co.URL, Retry: co.Retry, RetryWaitTime: co.RetryWaitTime, } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "func (c *TLSConfig) BuildServerConfig(host string) *tls.Config {\n\tif c == nil {\n\t\t// use default TLS settings, if config is empty.\n\t\treturn &tls.Config{\n\t\t\tServerName: host,\n\t\t\tInsecureSkipVerify: true,\n\t\t\tVerifyConnection: makeVerifyServerConnection(&TLSConfig{\n\t\t\t\tVerification: V...
[ "0.66880894", "0.6239105", "0.61657727", "0.6142114", "0.60939157", "0.6093432", "0.5998546", "0.59107727", "0.5907868", "0.5894315", "0.5862838", "0.5836971", "0.582672", "0.57969505", "0.57863814", "0.5756004", "0.5753981", "0.5732995", "0.57201874", "0.56668013", "0.565264...
0.7297781
0
RunTests executes the scorecard tests as configured
RunTests выполняет тесты scorecard в соответствии с настройками
func (o Scorecard) RunTests(ctx context.Context) (testOutput v1alpha3.Test, err error) { err = o.TestRunner.Initialize(ctx) if err != nil { return testOutput, err } tests := o.selectTests() if len(tests) == 0 { return testOutput, nil } for _, test := range tests { result, err := o.TestRunner.RunTest(ctx...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "func (o Scorecard) RunTests() (testOutput v1alpha2.ScorecardOutput, err error) {\n\ttests := selectTests(o.Selector, o.Config.Tests)\n\tif len(tests) == 0 {\n\t\tfmt.Println(\"no tests selected\")\n\t\treturn testOutput, err\n\t}\n\n\tbundleData, err := getBundleData(o.BundlePath)\n\tif err != nil {\n\t\treturn te...
[ "0.7847949", "0.7178379", "0.66959757", "0.6382603", "0.63654983", "0.63125676", "0.62624186", "0.6155679", "0.6062077", "0.6012515", "0.59727854", "0.59608316", "0.59560037", "0.594106", "0.59397423", "0.5924008", "0.59166163", "0.5908898", "0.5906732", "0.5884082", "0.58350...
0.79646385
0
selectTests applies an optionally passed selector expression against the configured set of tests, returning the selected tests
selectTests применяет необязательно переданное выражение селектора к настроенному набору тестов, возвращая выбранные тесты
func (o Scorecard) selectTests() []Test { selected := make([]Test, 0) for _, test := range o.Config.Tests { if o.Selector.String() == "" || o.Selector.Matches(labels.Set(test.Labels)) { // TODO olm manifests check selected = append(selected, test) } } return selected }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "func selectTests(selector labels.Selector, tests []Test) []Test {\n\n\tselected := make([]Test, 0)\n\n\tfor _, test := range tests {\n\t\tif selector.String() == \"\" || selector.Matches(labels.Set(test.Labels)) {\n\t\t\t// TODO olm manifests check\n\t\t\tselected = append(selected, test)\n\t\t}\n\t}\n\treturn sel...
[ "0.74813306", "0.7090248", "0.5607932", "0.5303558", "0.5094614", "0.5069643", "0.5042959", "0.50331104", "0.49627775", "0.49533433", "0.49461237", "0.48975343", "0.47849888", "0.4777621", "0.47751915", "0.47463155", "0.47339553", "0.46907428", "0.46764013", "0.46577954", "0....
0.7408755
1
Initialize sets up the bundle configmap for tests
Инициализация настраивает конфигурационный файл ConfigMap для тестов
func (r *PodTestRunner) Initialize(ctx context.Context) error { bundleData, err := r.getBundleData() if err != nil { return fmt.Errorf("error getting bundle data %w", err) } r.configMapName, err = r.CreateConfigMap(ctx, bundleData) if err != nil { return fmt.Errorf("error creating ConfigMap %w", err) } retu...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "func (r *PodTestRunner) Initialize(ctx context.Context) error {\n\tbundleData, err := r.getBundleData()\n\tif err != nil {\n\t\treturn fmt.Errorf(\"error getting bundle data %w\", err)\n\t}\n\n\tr.configMapName, err = r.CreateConfigMap(ctx, bundleData)\n\tif err != nil {\n\t\treturn fmt.Errorf(\"error creating Con...
[ "0.7311859", "0.6341264", "0.63236684", "0.6308758", "0.6293854", "0.6219397", "0.61819357", "0.6114997", "0.6113638", "0.61045194", "0.610196", "0.6097097", "0.60905164", "0.6058089", "0.6026225", "0.60097724", "0.60009825", "0.5987813", "0.59876114", "0.5987233", "0.5917201...
0.7322952
0
Cleanup deletes pods and configmap resources from this test run
Cleanup удаляет pods и configmap ресурсы из этого тестового запуска
func (r PodTestRunner) Cleanup(ctx context.Context) (err error) { err = r.deletePods(ctx, r.configMapName) if err != nil { return err } err = r.deleteConfigMap(ctx, r.configMapName) if err != nil { return err } return nil }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "func (r PodTestRunner) Cleanup(ctx context.Context) (err error) {\n\n\terr = r.deletePods(ctx, r.configMapName)\n\tif err != nil {\n\t\treturn err\n\t}\n\terr = r.deleteConfigMap(ctx, r.configMapName)\n\tif err != nil {\n\t\treturn err\n\t}\n\n\treturn nil\n}", "func (p *PodmanTestIntegration) Cleanup() {\n\tp.S...
[ "0.82490194", "0.7183337", "0.6963463", "0.6941537", "0.6897071", "0.6610021", "0.6599832", "0.6594847", "0.6564672", "0.6459518", "0.64580095", "0.6447388", "0.6432132", "0.6390202", "0.6367826", "0.636664", "0.63490593", "0.6323104", "0.62937874", "0.6286403", "0.62849927",...
0.8216792
1
waitForTestToComplete waits for a fixed amount of time while checking for a test pod to complete
waitForTestToComplete ожидает определенное количество времени, проверяя завершение тестовой папки
func (r PodTestRunner) waitForTestToComplete(ctx context.Context, p *v1.Pod) (err error) { podCheck := wait.ConditionFunc(func() (done bool, err error) { var tmp *v1.Pod tmp, err = r.Client.CoreV1().Pods(p.Namespace).Get(ctx, p.Name, metav1.GetOptions{}) if err != nil { return true, fmt.Errorf("error getting...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "func (r PodTestRunner) waitForTestToComplete(ctx context.Context, p *v1.Pod) (err error) {\n\n\tpodCheck := wait.ConditionFunc(func() (done bool, err error) {\n\t\tvar tmp *v1.Pod\n\t\ttmp, err = r.Client.CoreV1().Pods(p.Namespace).Get(ctx, p.Name, metav1.GetOptions{})\n\t\tif err != nil {\n\t\t\treturn true, fmt....
[ "0.7927179", "0.72653604", "0.6584559", "0.60880834", "0.6087988", "0.6062425", "0.5917469", "0.59123796", "0.59050435", "0.59032446", "0.58534753", "0.5846773", "0.5770013", "0.57408786", "0.57073563", "0.56853384", "0.56759846", "0.5669011", "0.56403846", "0.56218016", "0.5...
0.76772004
1
DelayDuration returns delay duration in a form of time.Duration.
DelayDuration возвращает длительность задержки в виде time.Duration.
func (o *Options) DelayDuration() time.Duration { return time.Second * time.Duration(o.Delay) }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "func (v RxDelay) Duration() time.Duration {\n\tswitch v {\n\tcase RX_DELAY_0, RX_DELAY_1:\n\t\treturn time.Second\n\tdefault:\n\t\treturn time.Duration(v) * time.Second\n\t}\n}", "func (d *Delay) TimeDuration() time.Duration {\n\treturn time.Duration(d.Duration*1000) * time.Millisecond\n}", "func (b *Backoff) ...
[ "0.79466355", "0.7600061", "0.6968741", "0.68646014", "0.68198526", "0.6818932", "0.6725045", "0.66359437", "0.66057986", "0.6569005", "0.6561068", "0.6546487", "0.6497679", "0.64850616", "0.6454614", "0.64448506", "0.64159924", "0.6401013", "0.6279634", "0.6225847", "0.61952...
0.78912795
1
check the first parameter, true if it wants only a Context check if the handler needs a Context , has the first parameter as type of Context it's usefuly in NewRoute inside route.go
проверьте первый параметр, true, если он хочет только проверку Context проверьте, нужно ли обработчику Context, имеет ли первый параметр тип Context, это полезно в NewRoute внутри route.go
func hasContextParam(handlerType reflect.Type) bool { //if the handler doesn't take arguments, false if handlerType.NumIn() == 0 { return false } //if the first argument is not a pointer, false p1 := handlerType.In(0) if p1.Kind() != reflect.Ptr { return false } //but if the first argument is a context, tr...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "func hasContextAndRenderer(handlerType reflect.Type) bool {\n\n\t//first check if we have pass 2 arguments\n\tif handlerType.NumIn() < 2 {\n\t\treturn false\n\t}\n\n\tfirstParamIsContext := hasContextParam(handlerType)\n\n\t//the first argument/parameter is always context if exists otherwise it's only Renderer or ...
[ "0.7213183", "0.5509956", "0.5483808", "0.5468682", "0.5381114", "0.53599775", "0.53556824", "0.5326522", "0.5323669", "0.53084695", "0.5305011", "0.5259829", "0.52473307", "0.52404714", "0.52363706", "0.52258265", "0.5179706", "0.51651525", "0.5151531", "0.5140357", "0.50984...
0.76307327
0
check the first parameter, true if it wants only a Renderer
проверьте первый параметр, true, если хочет только Renderer
func hasRendererParam(handlerType reflect.Type) bool { //if the handler doesn't take arguments, false if handlerType.NumIn() == 0 { return false } //if the first argument is not a pointer, false p1 := handlerType.In(0) if p1.Kind() != reflect.Ptr { return false } //but if the first argument is a renderer, ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "func hasContextAndRenderer(handlerType reflect.Type) bool {\n\n\t//first check if we have pass 2 arguments\n\tif handlerType.NumIn() < 2 {\n\t\treturn false\n\t}\n\n\tfirstParamIsContext := hasContextParam(handlerType)\n\n\t//the first argument/parameter is always context if exists otherwise it's only Renderer or ...
[ "0.64195585", "0.6211272", "0.5952793", "0.5785611", "0.57511944", "0.5662539", "0.56310743", "0.56270677", "0.5563061", "0.5553207", "0.55048263", "0.55048263", "0.55043006", "0.5455274", "0.5440663", "0.54219353", "0.5395095", "0.5364567", "0.5228344", "0.52223676", "0.5192...
0.72854406
0
check if two parameters, true if it wants Context following by a Renderer
проверить, хочет ли он контекст, следующий за отрисовщиком
func hasContextAndRenderer(handlerType reflect.Type) bool { //first check if we have pass 2 arguments if handlerType.NumIn() < 2 { return false } firstParamIsContext := hasContextParam(handlerType) //the first argument/parameter is always context if exists otherwise it's only Renderer or ResponseWriter,Reques...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "func hasRendererParam(handlerType reflect.Type) bool {\n\t//if the handler doesn't take arguments, false\n\tif handlerType.NumIn() == 0 {\n\t\treturn false\n\t}\n\n\t//if the first argument is not a pointer, false\n\tp1 := handlerType.In(0)\n\tif p1.Kind() != reflect.Ptr {\n\t\treturn false\n\t}\n\t//but if the fi...
[ "0.5999429", "0.5965332", "0.57624316", "0.54819465", "0.53604686", "0.5321732", "0.52336234", "0.51454157", "0.50726795", "0.5054565", "0.50247794", "0.4973077", "0.49111223", "0.4891894", "0.48881614", "0.4885618", "0.48833802", "0.48631704", "0.48545897", "0.48403186", "0....
0.7145373
0
GetNerCustomizedSeaEcom invokes the alinlp.GetNerCustomizedSeaEcom API synchronously
GetNerCustomizedSeaEcom вызывает асинхронно API alinlp.GetNerCustomizedSeaEcom
func (client *Client) GetNerCustomizedSeaEcom(request *GetNerCustomizedSeaEcomRequest) (response *GetNerCustomizedSeaEcomResponse, err error) { response = CreateGetNerCustomizedSeaEcomResponse() err = client.DoAction(request, response) return }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "func (client *Client) GetNerCustomizedSeaEcomWithCallback(request *GetNerCustomizedSeaEcomRequest, callback func(response *GetNerCustomizedSeaEcomResponse, err error)) <-chan int {\n\tresult := make(chan int, 1)\n\terr := client.AddAsyncTask(func() {\n\t\tvar response *GetNerCustomizedSeaEcomResponse\n\t\tvar err ...
[ "0.7576879", "0.69949114", "0.6187827", "0.6112665", "0.50135446", "0.4806385", "0.46168134", "0.45960653", "0.45363542", "0.45080954", "0.44634172", "0.43717235", "0.43654612", "0.43571216", "0.43244952", "0.42791805", "0.42694405", "0.42490053", "0.42486668", "0.42294818", ...
0.7616816
0
GetNerCustomizedSeaEcomWithChan invokes the alinlp.GetNerCustomizedSeaEcom API asynchronously
GetNerCustomizedSeaEcomWithChan асинхронно вызывает API alinlp.GetNerCustomizedSeaEcom
func (client *Client) GetNerCustomizedSeaEcomWithChan(request *GetNerCustomizedSeaEcomRequest) (<-chan *GetNerCustomizedSeaEcomResponse, <-chan error) { responseChan := make(chan *GetNerCustomizedSeaEcomResponse, 1) errChan := make(chan error, 1) err := client.AddAsyncTask(func() { defer close(responseChan) defe...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "func (client *Client) GetNerCustomizedSeaEcomWithCallback(request *GetNerCustomizedSeaEcomRequest, callback func(response *GetNerCustomizedSeaEcomResponse, err error)) <-chan int {\n\tresult := make(chan int, 1)\n\terr := client.AddAsyncTask(func() {\n\t\tvar response *GetNerCustomizedSeaEcomResponse\n\t\tvar err ...
[ "0.7701703", "0.64137083", "0.58868027", "0.55262583", "0.5286783", "0.52103513", "0.5023557", "0.501735", "0.4995522", "0.4890827", "0.48545292", "0.4846518", "0.48191816", "0.4794705", "0.47043338", "0.4639148", "0.46159783", "0.46019688", "0.45946375", "0.45439455", "0.451...
0.8141107
0
GetNerCustomizedSeaEcomWithCallback invokes the alinlp.GetNerCustomizedSeaEcom API asynchronously
GetNerCustomizedSeaEcomWithCallback вызывает асинхронно API alinlp.GetNerCustomizedSeaEcom
func (client *Client) GetNerCustomizedSeaEcomWithCallback(request *GetNerCustomizedSeaEcomRequest, callback func(response *GetNerCustomizedSeaEcomResponse, err error)) <-chan int { result := make(chan int, 1) err := client.AddAsyncTask(func() { var response *GetNerCustomizedSeaEcomResponse var err error defer c...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "func (client *Client) GetNerCustomizedSeaEcomWithChan(request *GetNerCustomizedSeaEcomRequest) (<-chan *GetNerCustomizedSeaEcomResponse, <-chan error) {\n\tresponseChan := make(chan *GetNerCustomizedSeaEcomResponse, 1)\n\terrChan := make(chan error, 1)\n\terr := client.AddAsyncTask(func() {\n\t\tdefer close(respon...
[ "0.66507435", "0.6284932", "0.5937611", "0.547515", "0.5420296", "0.52048594", "0.51196504", "0.49444628", "0.49300382", "0.4908999", "0.48851317", "0.48516223", "0.4745386", "0.47324798", "0.4731915", "0.4646688", "0.46445283", "0.46423602", "0.45770156", "0.45028207", "0.45...
0.8188641
0
CreateGetNerCustomizedSeaEcomRequest creates a request to invoke GetNerCustomizedSeaEcom API
CreateGetNerCustomizedSeaEcomRequest создает запрос для вызова GetNerCustomizedSeaEcom API
func CreateGetNerCustomizedSeaEcomRequest() (request *GetNerCustomizedSeaEcomRequest) { request = &GetNerCustomizedSeaEcomRequest{ RpcRequest: &requests.RpcRequest{}, } request.InitWithApiInfo("alinlp", "2020-06-29", "GetNerCustomizedSeaEcom", "alinlp", "openAPI") request.Method = requests.POST return }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "func (client *Client) GetNerCustomizedSeaEcom(request *GetNerCustomizedSeaEcomRequest) (response *GetNerCustomizedSeaEcomResponse, err error) {\n\tresponse = CreateGetNerCustomizedSeaEcomResponse()\n\terr = client.DoAction(request, response)\n\treturn\n}", "func CreateGetNerCustomizedSeaEcomResponse() (response ...
[ "0.7064167", "0.68019885", "0.67888623", "0.6246826", "0.619077", "0.6190453", "0.5972899", "0.58737063", "0.5718027", "0.5634352", "0.5581408", "0.55074394", "0.54870504", "0.54577786", "0.5399441", "0.5375696", "0.53739506", "0.533545", "0.5314561", "0.5306372", "0.5286929"...
0.89601254
0
CreateGetNerCustomizedSeaEcomResponse creates a response to parse from GetNerCustomizedSeaEcom response
CreateGetNerCustomizedSeaEcomResponse создает ответ для парсинга из GetNerCustomizedSeaEcom ответа
func CreateGetNerCustomizedSeaEcomResponse() (response *GetNerCustomizedSeaEcomResponse) { response = &GetNerCustomizedSeaEcomResponse{ BaseResponse: &responses.BaseResponse{}, } return }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "func CreateGetNerCustomizedSeaEcomRequest() (request *GetNerCustomizedSeaEcomRequest) {\n\trequest = &GetNerCustomizedSeaEcomRequest{\n\t\tRpcRequest: &requests.RpcRequest{},\n\t}\n\trequest.InitWithApiInfo(\"alinlp\", \"2020-06-29\", \"GetNerCustomizedSeaEcom\", \"alinlp\", \"openAPI\")\n\trequest.Method = reques...
[ "0.75959283", "0.70300895", "0.661331", "0.6274801", "0.61348885", "0.6081415", "0.60363543", "0.5802763", "0.57948554", "0.56905454", "0.5679204", "0.5625127", "0.5603903", "0.5568985", "0.55646026", "0.5562964", "0.55232185", "0.5499022", "0.54989606", "0.5492508", "0.54896...
0.896394
0
WithHeimdallClient sets the client
WithHeimdallClient устанавливает клиент
func WithHeimdallClient(client heimdall.Client) Option { return func(s *Storage) { s.client = client } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "func (cl *Client) setClient() {\n\tcl.client = &http.Client{\n\t\tTransport: &ochttp.Transport{\n\t\t\tBase: &http.Transport{\n\t\t\t\tProxy: http.ProxyFromEnvironment,\n\t\t\t\tDial: (&net.Dialer{\n\t\t\t\t\tKeepAlive: cl.keepAlive,\n\t\t\t\t}).Dial,\n\t\t\t\tTLSHandshakeTimeout: cl.handshakeTimeout,\n\t\t\t\tMax...
[ "0.66653216", "0.656386", "0.6513115", "0.63362336", "0.6135869", "0.6078363", "0.6058374", "0.6022997", "0.58994734", "0.5800192", "0.57922196", "0.5785561", "0.5777135", "0.57480276", "0.5738935", "0.5699551", "0.5697977", "0.56765866", "0.56661636", "0.5657892", "0.5656079...
0.71384174
0
CreateAuthMiddleware creates the middleware for authtication
CreateAuthMiddleware создает middleware для аутентификации
func CreateAuthMiddleware() (*jwt.Middleware, error) { err := variables.LoadTokenKeys() if err != nil { return nil, err } authMiddleware := &jwt.Middleware{ Realm: "numapp", SigningAlgorithm: variables.SigningAlgorithm, Key: variables.TokenSignKey, VerifyKey: &variables.Tok...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "func NewAuthMiddleware(svc interfaces.Service, r interfaces.Repository) interfaces.Service {\n\treturn &authMiddleware{\n\t\tnext: svc,\n\t\trepository: r,\n\t}\n}", "func NewAuthMiddleware(l lib.LogI, ctx *lib.Context) *AuthMiddleware {\n\treturn &AuthMiddleware{\n\t\tLog: l,\n\t\tContext: ctx,\n\t}\n...
[ "0.749641", "0.71149826", "0.7067203", "0.6840958", "0.684059", "0.6691852", "0.66247874", "0.6615308", "0.6607044", "0.6568086", "0.65581614", "0.65564984", "0.65474516", "0.65150654", "0.65064883", "0.6489449", "0.6460329", "0.6460041", "0.6445028", "0.64227384", "0.6399165...
0.76894057
0
MakeHandler creates the api request handler
MakeHandler создает обработчик API-запроса
func MakeHandler() *http.Handler { api := rest.NewApi() authMiddleware, err := CreateAuthMiddleware() if err != nil { panic(err) } api.Use(&rest.IfMiddleware{ // Only authenticate non login or register requests Condition: func(request *rest.Request) bool { return (request.URL.Path != variables.APIPathLo...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "func MakeHandler(svc manager.Service) http.Handler {\n\topts := []kithttp.ServerOption{\n\t\tkithttp.ServerErrorEncoder(encodeError),\n\t}\n\n\tregistration := kithttp.NewServer(\n\t\tregistrationEndpoint(svc),\n\t\tdecodeCredentials,\n\t\tencodeResponse,\n\t\topts...,\n\t)\n\n\tlogin := kithttp.NewServer(\n\t\tlo...
[ "0.7168402", "0.710997", "0.7024364", "0.6932593", "0.69240314", "0.68977165", "0.6896971", "0.6886619", "0.6849388", "0.6845259", "0.68446195", "0.68355274", "0.68299645", "0.68141025", "0.67243904", "0.66944796", "0.6646774", "0.66209537", "0.6620859", "0.65832055", "0.6569...
0.7418875
0
Creates a case in the AWS Support Center. This operation is similar to how you create a case in the AWS Support Center Create Case ( page. The AWS Support API doesn't support requesting service limit increases. You can submit a service limit increase in the following ways: Submit a request from the AWS Support Center C...
Создает обращение в центр поддержки AWS. Эта операция похожа на создание обращения в центре поддержки AWS Create Case (страница). AWS Support API не поддерживает запросы на увеличение лимитов служб. Вы можете подать запрос на увеличение лимита службы следующими способами: отправить запрос с помощью страницы AWS Support...
func (c *Client) CreateCase(ctx context.Context, params *CreateCaseInput, optFns ...func(*Options)) (*CreateCaseOutput, error) { if params == nil { params = &CreateCaseInput{} } result, metadata, err := c.invokeOperation(ctx, "CreateCase", params, optFns, addOperationCreateCaseMiddlewares) if err != nil { retu...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "func (c *Client) AddCommunicationToCase(ctx context.Context, params *AddCommunicationToCaseInput, optFns ...func(*Options)) (*AddCommunicationToCaseOutput, error) {\n\tif params == nil {\n\t\tparams = &AddCommunicationToCaseInput{}\n\t}\n\n\tresult, metadata, err := c.invokeOperation(ctx, \"AddCommunicationToCase\...
[ "0.6415229", "0.5866429", "0.5843353", "0.57201755", "0.57147646", "0.5541539", "0.52763075", "0.52597666", "0.5138041", "0.5122116", "0.50251997", "0.49641767", "0.48984498", "0.48797622", "0.48758298", "0.4828721", "0.48263887", "0.48155132", "0.4813809", "0.4793567", "0.47...
0.78295654
0
GetAwsSession Returns an AWS session for the specified server cfguration
GetAwsSession Возвращает сеанс AWS для указанной серверной конфигурации
func GetAwsSession(cfg config.ServerConfig) (*session.Session, error) { var providers []credentials.Provider customResolver := func(service, region string, optFns ...func(*endpoints.Options)) (endpoints.ResolvedEndpoint, error) { if service == endpoints.RdsServiceID && cfg.AwsEndpointRdsURL != "" { return endpo...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "func GetAwsSession(region string, awsAccessKeyID string, awsSecretAccessKey string) (*session.Session, error) {\n\tif awsAccessKeyID == \"\" || awsSecretAccessKey == \"\" {\n\t\tconfig := aws.Config{\n\t\t\tRegion: aws.String(region),\n\t\t\tMaxRetries: aws.Int(awsSdkMaxRetries),\n\t\t}\n\n\t\tsess, err := ses...
[ "0.7475091", "0.7309152", "0.7308612", "0.7059727", "0.6873469", "0.6860654", "0.676002", "0.671794", "0.6665601", "0.66074514", "0.6492171", "0.6449359", "0.64330184", "0.64273876", "0.62588125", "0.6234018", "0.61775804", "0.61309797", "0.61003613", "0.6086228", "0.6027008"...
0.7961176
0
GetAuthorizer gets an existing Authorizer resource's state with the given name, ID, and optional state properties that are used to uniquely qualify the lookup (nil if not required).
GetAuthorizer получает состояние существующего ресурса Authorizer с заданным именем, идентификатором и необязательными свойствами состояния, используемыми для однозначного определения поиска (nil, если это не требуется).
func GetAuthorizer(ctx *pulumi.Context, name string, id pulumi.ID, state *AuthorizerState, opts ...pulumi.ResourceOpt) (*Authorizer, error) { inputs := make(map[string]interface{}) if state != nil { inputs["authorizerCredentials"] = state.AuthorizerCredentials inputs["authorizerResultTtlInSeconds"] = state.Autho...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "func (c *APIGateway) GetAuthorizer(input *GetAuthorizerInput) (*Authorizer, error) {\n\treq, out := c.GetAuthorizerRequest(input)\n\terr := req.Send()\n\treturn out, err\n}", "func GetAuthorizer(sp *ServicePrincipal, env *azure.Environment) (autorest.Authorizer, error) {\n\toauthConfig, err := adal.NewOAuthConfi...
[ "0.6288236", "0.61128867", "0.600631", "0.5912986", "0.56904894", "0.55917406", "0.55573034", "0.54324085", "0.5352838", "0.52806234", "0.51653206", "0.51357406", "0.5128047", "0.50898623", "0.5068182", "0.5052384", "0.50460017", "0.4977039", "0.4974712", "0.49660113", "0.495...
0.8224552
0
Search performs a symbol search on the symbols service.
Поиск выполняет поиск по символам в службе символов.
func (c *Client) Search(ctx context.Context, args search.SymbolsParameters) (symbols result.Symbols, err error) { span, ctx := ot.StartSpanFromContext(ctx, "symbols.Client.Search") defer func() { if err != nil { ext.Error.Set(span, true) span.LogFields(otlog.Error(err)) } span.Finish() }() span.SetTag("...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "func (s *svc) Search(ctx context.Context, req *api.SearchRequest) (*api.SearchResponse, error) {\n\tvar resp api.SearchResponse\n\tresp.Results = &api.Series{\n\t\tKey: req.Key,\n\t}\n\n\telts, err := s.searcher.Search(req.Key, req.Oldest, req.Newest)\n\tswitch err.(type) {\n\tcase storage.KeyNotFound:\n\t\tresp.S...
[ "0.6486218", "0.6482556", "0.6436115", "0.63494456", "0.63310945", "0.6226671", "0.62113196", "0.62071586", "0.6191202", "0.6155028", "0.61464447", "0.6116039", "0.60901916", "0.60784996", "0.6064667", "0.6061123", "0.6048405", "0.60473895", "0.60432905", "0.6012252", "0.6011...
0.75943005
0
ValidateNetwork validates a Network object.
ValidateNetwork проверяет объект Network.
func ValidateNetwork(network *extensionsv1alpha1.Network) field.ErrorList { allErrs := field.ErrorList{} allErrs = append(allErrs, apivalidation.ValidateObjectMeta(&network.ObjectMeta, true, apivalidation.NameIsDNSSubdomain, field.NewPath("metadata"))...) allErrs = append(allErrs, ValidateNetworkSpec(&network.Spec, ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "func (m *Network) Validate(formats strfmt.Registry) error {\n\tvar res []error\n\n\tif err := m.validateID(formats); err != nil {\n\t\tres = append(res, err)\n\t}\n\n\tif err := m.validateMasterInterface(formats); err != nil {\n\t\tres = append(res, err)\n\t}\n\n\tif err := m.validateType(formats); err != nil {\n\...
[ "0.73155195", "0.7186104", "0.6923285", "0.6841164", "0.6532549", "0.6366392", "0.6291432", "0.6251806", "0.6238205", "0.62232083", "0.6216633", "0.6098777", "0.60969937", "0.6080908", "0.60757625", "0.60336506", "0.59988767", "0.59749514", "0.5909168", "0.59000635", "0.58446...
0.722179
1
ValidateNetworkUpdate validates a Network object before an update.
ValidateNetworkUpdate проверяет объект Network перед обновлением.
func ValidateNetworkUpdate(new, old *extensionsv1alpha1.Network) field.ErrorList { allErrs := field.ErrorList{} allErrs = append(allErrs, apivalidation.ValidateObjectMetaUpdate(&new.ObjectMeta, &old.ObjectMeta, field.NewPath("metadata"))...) allErrs = append(allErrs, ValidateNetworkSpecUpdate(&new.Spec, &old.Spec, ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "func (n *Network) ValidateUpdate(old runtime.Object) error {\n\tvar allErrors field.ErrorList\n\toldNetwork := old.(*Network)\n\n\tnetworklog.Info(\"validate update\", \"name\", n.Name)\n\n\t// shared validation rules with create\n\tallErrors = append(allErrors, n.Validate()...)\n\n\t// shared validation rules wit...
[ "0.75814086", "0.7003011", "0.69270676", "0.66921806", "0.65416247", "0.6206754", "0.61542016", "0.6152612", "0.6117212", "0.6075632", "0.6073497", "0.6065042", "0.6044899", "0.60341346", "0.5975376", "0.59118503", "0.5901321", "0.58906287", "0.5874365", "0.5820233", "0.58181...
0.81501204
0
ValidateNetworkSpec validates the specification of a Network object.
ValidateNetworkSpec проверяет спецификацию объекта Network.
func ValidateNetworkSpec(spec *extensionsv1alpha1.NetworkSpec, fldPath *field.Path) field.ErrorList { allErrs := field.ErrorList{} if len(spec.Type) == 0 { allErrs = append(allErrs, field.Required(fldPath.Child("type"), "field is required")) } var cidrs []cidrvalidation.CIDR if len(spec.PodCIDR) == 0 { allE...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "func (m *Network) Validate(formats strfmt.Registry) error {\n\tvar res []error\n\n\tif err := m.validateID(formats); err != nil {\n\t\tres = append(res, err)\n\t}\n\n\tif err := m.validateMasterInterface(formats); err != nil {\n\t\tres = append(res, err)\n\t}\n\n\tif err := m.validateType(formats); err != nil {\n\...
[ "0.67122936", "0.6589741", "0.65722126", "0.6494365", "0.6392701", "0.6391177", "0.6070578", "0.5993474", "0.59743595", "0.5910308", "0.5891103", "0.58672804", "0.5779491", "0.57532775", "0.574947", "0.5687439", "0.56747395", "0.5661901", "0.5616588", "0.5615219", "0.5526241"...
0.7853857
0
ValidateNetworkSpecUpdate validates the spec of a Network object before an update.
ValidateNetworkSpecUpdate проверяет спецификацию объекта Network перед обновлением.
func ValidateNetworkSpecUpdate(new, old *extensionsv1alpha1.NetworkSpec, deletionTimestampSet bool, fldPath *field.Path) field.ErrorList { allErrs := field.ErrorList{} if deletionTimestampSet && !apiequality.Semantic.DeepEqual(new, old) { allErrs = append(allErrs, apivalidation.ValidateImmutableField(new, old, fld...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "func ValidateNetworkUpdate(new, old *extensionsv1alpha1.Network) field.ErrorList {\n\tallErrs := field.ErrorList{}\n\n\tallErrs = append(allErrs, apivalidation.ValidateObjectMetaUpdate(&new.ObjectMeta, &old.ObjectMeta, field.NewPath(\"metadata\"))...)\n\tallErrs = append(allErrs, ValidateNetworkSpecUpdate(&new.Spe...
[ "0.7803706", "0.7432386", "0.6940642", "0.6773171", "0.65616477", "0.62644356", "0.6179208", "0.61404437", "0.60304904", "0.5948759", "0.5853366", "0.5791877", "0.5764017", "0.5707987", "0.5648009", "0.561715", "0.56039965", "0.560212", "0.55983096", "0.55652076", "0.5551288"...
0.84096605
0
ValidateNetworkStatus validates the status of a Network object.
ValidateNetworkStatus проверяет состояние объекта Network.
func ValidateNetworkStatus(spec *extensionsv1alpha1.NetworkStatus, fldPath *field.Path) field.ErrorList { allErrs := field.ErrorList{} return allErrs }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "func ValidateNetworkStatusUpdate(newStatus, oldStatus extensionsv1alpha1.NetworkStatus) field.ErrorList {\n\tallErrs := field.ErrorList{}\n\n\treturn allErrs\n}", "func (m *PVMInstanceNetwork) Validate(formats strfmt.Registry) error {\n\treturn nil\n}", "func (m *Network) Validate(formats strfmt.Registry) erro...
[ "0.66972476", "0.6420284", "0.6402876", "0.623381", "0.6194095", "0.6179858", "0.59234226", "0.59146374", "0.5855416", "0.5853569", "0.5832253", "0.5828169", "0.5795385", "0.5792761", "0.5747493", "0.5727989", "0.56904906", "0.5665054", "0.55920434", "0.55584145", "0.5537664"...
0.78875095
0
ValidateNetworkStatusUpdate validates the status field of a Network object.
ValidateNetworkStatusUpdate проверяет поле status объекта Network.
func ValidateNetworkStatusUpdate(newStatus, oldStatus extensionsv1alpha1.NetworkStatus) field.ErrorList { allErrs := field.ErrorList{} return allErrs }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "func ValidateNetworkUpdate(new, old *extensionsv1alpha1.Network) field.ErrorList {\n\tallErrs := field.ErrorList{}\n\n\tallErrs = append(allErrs, apivalidation.ValidateObjectMetaUpdate(&new.ObjectMeta, &old.ObjectMeta, field.NewPath(\"metadata\"))...)\n\tallErrs = append(allErrs, ValidateNetworkSpecUpdate(&new.Spe...
[ "0.7406666", "0.68307406", "0.64648366", "0.64205205", "0.63305455", "0.615615", "0.57889855", "0.5749044", "0.56802106", "0.56731206", "0.56397283", "0.5616703", "0.5597998", "0.552378", "0.55079824", "0.550207", "0.55003566", "0.5485629", "0.54382426", "0.54291725", "0.5423...
0.8169572
0
TestRejectStaleTermMessage tests that if a server receives a request with a stale term number, it rejects the request. Our implementation ignores the request instead. Reference: section 5.1
Тест TestRejectStaleTermMessage проверяет, отклоняет ли сервер запрос с устаревшим номером терма. Наша реализация игнорирует такой запрос вместо этого. Ссылка: раздел 5.1
func TestRejectStaleTermMessage(t *testing.T) { called := false fakeStep := func(r *raft, m pb.Message) bool { called = true return false } r := newTestRaft(1, []uint64{1, 2, 3}, 10, 1, NewMemoryStorage()) defer closeAndFreeRaft(r) r.step = fakeStep r.loadState(pb.HardState{Term: 2}) r.Step(pb.Message{Type...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "func (r *Raft) handleStaleTerm(replication *followerReplication) {\n\tklog.Errorf(fmt.Sprintf(\"peer:%s/%s has newer term, stopping replication\", replication.peer.ID, replication.peer.Address))\n\treplication.notifyAll(false) // No longer leader\n\tselect {\n\tcase replication.stepDown <- struct{}{}:\n\tdefault:\...
[ "0.56858855", "0.53210557", "0.52441114", "0.5125209", "0.5098463", "0.50712526", "0.5064494", "0.5052523", "0.5047018", "0.5040143", "0.50186044", "0.49960944", "0.49875304", "0.49849272", "0.48978335", "0.48863882", "0.4785406", "0.4753413", "0.47414866", "0.47414866", "0.4...
0.78242046
0
TestStartAsFollower tests that when servers start up, they begin as followers. Reference: section 5.2
TestStartAsFollower проверяет, что при запуске серверов они начинают работу в качестве последователей. Ссылка: раздел 5.2
func TestStartAsFollower(t *testing.T) { r := newTestRaft(1, []uint64{1, 2, 3}, 10, 1, NewMemoryStorage()) defer closeAndFreeRaft(r) if r.state != StateFollower { t.Errorf("state = %s, want %s", r.state, StateFollower) } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "func TestSubscribeStreamNotLeader(t *testing.T) {\n\tdefer cleanupStorage(t)\n\n\t// Use a central NATS server.\n\tns := natsdTest.RunDefaultServer()\n\tdefer ns.Shutdown()\n\n\t// Configure first server.\n\ts1Config := getTestConfig(\"a\", true, 5050)\n\ts1 := runServerWithConfig(t, s1Config)\n\tdefer s1.Stop()\n...
[ "0.595199", "0.58877313", "0.58543223", "0.5852667", "0.58501625", "0.57495034", "0.5743804", "0.57330644", "0.57233655", "0.5692679", "0.5688954", "0.56840384", "0.5670661", "0.5664961", "0.5647548", "0.5643796", "0.5638572", "0.55047965", "0.5490936", "0.5486376", "0.548137...
0.81484336
0
TestLeaderBcastBeat tests that if the leader receives a heartbeat tick, it will send a msgApp with m.Index = 0, m.LogTerm=0 and empty entries as heartbeat to all followers. Reference: section 5.2
TestLeaderBcastBeat проверяет, что если лидер получает тик сердечной волны, он отправит сообщение msgApp со значениями m.Index = 0, m.LogTerm=0 и пустыми записями в качестве сердечной волны всем последователям. Ссылка: раздел 5.2
func TestLeaderBcastBeat(t *testing.T) { // heartbeat interval hi := 1 r := newTestRaft(1, []uint64{1, 2, 3}, 10, hi, NewMemoryStorage()) defer closeAndFreeRaft(r) r.becomeCandidate() r.becomeLeader() for i := 0; i < 10; i++ { r.appendEntry(pb.Entry{Index: uint64(i) + 1}) } for i := 0; i < hi; i++ { r.tic...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "func TestBcastBeat(t *testing.T) {\n\toffset := uint64(1000)\n\t// make a state machine with log.offset = 1000\n\tpeerGrps := make([]*pb.Group, 0)\n\tfor _, pid := range []uint64{1, 2, 3} {\n\t\tgrp := pb.Group{\n\t\t\tNodeId: pid,\n\t\t\tRaftReplicaId: pid,\n\t\t\tGroupId: 1,\n\t\t}\n\t\tpeerGrps = a...
[ "0.71547526", "0.70240164", "0.63609374", "0.62657857", "0.62503654", "0.62429494", "0.61554277", "0.60415953", "0.6011709", "0.59536695", "0.58787113", "0.5639564", "0.56021845", "0.55552447", "0.54215586", "0.5409809", "0.5384751", "0.5377757", "0.53510165", "0.532129", "0....
0.8377475
0
testNonleaderStartElection tests that if a follower receives no communication over election timeout, it begins an election to choose a new leader. It increments its current term and transitions to candidate state. It then votes for itself and issues RequestVote RPCs in parallel to each of the other servers in the clust...
testNonleaderStartElection проверяет, что если последователь не получает никакой информации в течение таймаута выборов, он начинает выборы для выбора нового лидера. Он увеличивает текущий срок и переходит в состояние кандидата. Затем он голосует за себя и одновременно отправляет RPC-запросы RequestVote каждому из други...
func testNonleaderStartElection(t *testing.T, state StateType) { // election timeout et := 10 r := newTestRaft(1, []uint64{1, 2, 3}, et, 1, NewMemoryStorage()) defer closeAndFreeRaft(r) switch state { case StateFollower: r.becomeFollower(1, 2) case StateCandidate: r.becomeCandidate() } for i := 1; i < 2*e...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "func TestLeaderElectionInOneRoundRPC(t *testing.T) {\n\ttests := []struct {\n\t\tsize int\n\t\tvotes map[uint64]bool\n\t\tstate StateType\n\t}{\n\t\t// win the election when receiving votes from a majority of the servers\n\t\t{1, map[uint64]bool{}, StateLeader},\n\t\t{3, map[uint64]bool{2: true, 3: true}, StateLe...
[ "0.69972724", "0.6816061", "0.6698817", "0.6691727", "0.6545872", "0.6444551", "0.6347674", "0.6304992", "0.6195448", "0.61766136", "0.6131735", "0.6121858", "0.6079972", "0.60769695", "0.6027061", "0.6016548", "0.6013733", "0.60108995", "0.59614134", "0.5916561", "0.59080714...
0.8241493
0
TestLeaderElectionInOneRoundRPC tests all cases that may happen in leader election during one round of RequestVote RPC: a) it wins the election b) it loses the election c) it is unclear about the result Reference: section 5.2
Тест TestLeaderElectionInOneRoundRPC проверяет все случаи, которые могут произойти в ходе выбора лидера во время одного раунда RPC RequestVote: а) он выигрывает выборы, б) он проигрывает выборы, в) он неясно, какой результат. Ссылка: раздел 5.2
func TestLeaderElectionInOneRoundRPC(t *testing.T) { tests := []struct { size int votes map[uint64]bool state StateType }{ // win the election when receiving votes from a majority of the servers {1, map[uint64]bool{}, StateLeader}, {3, map[uint64]bool{2: true, 3: true}, StateLeader}, {3, map[uint64]boo...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "func testNonleaderStartElection(t *testing.T, state StateType) {\n\t// election timeout\n\tet := 10\n\tr := newTestRaft(1, []uint64{1, 2, 3}, et, 1, NewMemoryStorage())\n\tdefer closeAndFreeRaft(r)\n\tswitch state {\n\tcase StateFollower:\n\t\tr.becomeFollower(1, 2)\n\tcase StateCandidate:\n\t\tr.becomeCandidate()...
[ "0.712777", "0.6818168", "0.65368366", "0.64485717", "0.6448258", "0.64238167", "0.6404896", "0.63321364", "0.6317073", "0.6308467", "0.62964714", "0.62061626", "0.61874914", "0.61642045", "0.6135719", "0.61182326", "0.6116993", "0.61055106", "0.6050055", "0.6028388", "0.6019...
0.83975685
0
TestFollowerVote tests that each follower will vote for at most one candidate in a given term, on a firstcomefirstserved basis. Reference: section 5.2
TestFollowerVote проверяет, что каждый фоллер проголосует за не более одного кандидата в данном терме, исходя из принципа «первый пришёл — первый проголосовал». Ссылка: раздел 5.2
func TestFollowerVote(t *testing.T) { tests := []struct { vote uint64 nvote uint64 wreject bool }{ {None, 1, false}, {None, 2, false}, {1, 1, false}, {2, 2, false}, {1, 2, true}, {2, 1, true}, } for i, tt := range tests { r := newTestRaft(1, []uint64{1, 2, 3}, 10, 1, NewMemoryStorage()) d...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "func TestPreVoteWithSplitVote(t *testing.T) {\n\tn1 := newTestRaft(1, []uint64{1, 2, 3}, 10, 1, NewMemoryStorage())\n\tn2 := newTestRaft(2, []uint64{1, 2, 3}, 10, 1, NewMemoryStorage())\n\tn3 := newTestRaft(3, []uint64{1, 2, 3}, 10, 1, NewMemoryStorage())\n\tdefer closeAndFreeRaft(n1)\n\tdefer closeAndFreeRaft(n2)...
[ "0.65611714", "0.60730743", "0.59893113", "0.5856957", "0.5796058", "0.578427", "0.57096905", "0.5693165", "0.5662607", "0.5610894", "0.5576574", "0.5562577", "0.5519122", "0.54921544", "0.54869354", "0.54458255", "0.54402566", "0.5409583", "0.53818727", "0.5380176", "0.53773...
0.7265358
0
TestCandidateFallback tests that while waiting for votes, if a candidate receives an AppendEntries RPC from another server claiming to be leader whose term is at least as large as the candidate's current term, it recognizes the leader as legitimate and returns to follower state. Reference: section 5.2
TestCandidateFallback проверяет, что во время ожидания голосов, если кандидат получает RPC AppendEntries от другого сервера, утверждающего, что является лидером, и его срок (term) не меньше, чем текущий срок кандидата, кандидат признает лидера легитимным и возвращается в состояние последователя. Ссылка: раздел 5.2
func TestCandidateFallback(t *testing.T) { tests := []pb.Message{ {From: 2, To: 1, Term: 1, Type: pb.MsgApp}, {From: 2, To: 1, Term: 2, Type: pb.MsgApp}, } for i, tt := range tests { r := newTestRaft(1, []uint64{1, 2, 3}, 10, 1, NewMemoryStorage()) defer closeAndFreeRaft(r) r.Step(pb.Message{From: 1, To: 1...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "func testNonleaderStartElection(t *testing.T, state StateType) {\n\t// election timeout\n\tet := 10\n\tr := newTestRaft(1, []uint64{1, 2, 3}, et, 1, NewMemoryStorage())\n\tdefer closeAndFreeRaft(r)\n\tswitch state {\n\tcase StateFollower:\n\t\tr.becomeFollower(1, 2)\n\tcase StateCandidate:\n\t\tr.becomeCandidate()...
[ "0.6167525", "0.6163571", "0.58222115", "0.57729566", "0.5765619", "0.57036155", "0.5693399", "0.5582176", "0.55365545", "0.54777724", "0.5464581", "0.539433", "0.5368451", "0.53509605", "0.5331513", "0.53258264", "0.5297152", "0.5295841", "0.5238286", "0.52340853", "0.523113...
0.77985966
0
testNonleaderElectionTimeoutRandomized tests that election timeout for follower or candidate is randomized. Reference: section 5.2
testNonleaderElectionTimeoutRandomized проверяет, что таймаут выбора лидера для последователя или кандидата является случайным. Ссылка: раздел 5.2
func testNonleaderElectionTimeoutRandomized(t *testing.T, state StateType) { et := 10 r := newTestRaft(1, []uint64{1, 2, 3}, et, 1, NewMemoryStorage()) defer closeAndFreeRaft(r) timeouts := make(map[int]bool) for round := 0; round < 50*et; round++ { switch state { case StateFollower: r.becomeFollower(r.Term...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "func (node *Node) randElectionTimeout() time.Duration {\n\treturn time.Duration(150+rand.Intn(150)) * time.Millisecond\n}", "func TestLearnerElectionTimeout(t *testing.T) {\n\tn1 := newTestLearnerRaft(1, []uint64{1}, []uint64{2}, 10, 1, NewMemoryStorage())\n\tn2 := newTestLearnerRaft(2, []uint64{1}, []uint64{2},...
[ "0.7392285", "0.7258269", "0.7240653", "0.71084785", "0.70563203", "0.6986426", "0.6932368", "0.6688159", "0.6592933", "0.6393019", "0.5969358", "0.5868286", "0.5805566", "0.5655917", "0.562618", "0.5552523", "0.54569644", "0.5443769", "0.54374623", "0.54012024", "0.53832304"...
0.84037805
0
testNonleadersElectionTimeoutNonconflict tests that in most cases only a single server(follower or candidate) will time out, which reduces the likelihood of split vote in the new election. Reference: section 5.2
testNonleadersElectionTimeoutNonconflict проверяет, что в большинстве случаев вовремя истекает таймер только одного сервера (фоллбека или кандидата), что снижает вероятность разногласий при голосовании на новых выборах. Ссылка: раздел 5.2
func testNonleadersElectionTimeoutNonconflict(t *testing.T, state StateType) { et := 10 size := 5 rs := make([]*raft, size) ids := idsBySize(size) for k := range rs { rs[k] = newTestRaft(ids[k], ids, et, 1, NewMemoryStorage()) } defer func() { for k := range rs { closeAndFreeRaft(rs[k]) } }() conflict...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "func TestLearnerElectionTimeout(t *testing.T) {\n\tn1 := newTestLearnerRaft(1, []uint64{1}, []uint64{2}, 10, 1, NewMemoryStorage())\n\tn2 := newTestLearnerRaft(2, []uint64{1}, []uint64{2}, 10, 1, NewMemoryStorage())\n\tdefer closeAndFreeRaft(n1)\n\tdefer closeAndFreeRaft(n2)\n\n\tn1.becomeFollower(1, None)\n\tn2.b...
[ "0.75048506", "0.74821985", "0.67603856", "0.6744892", "0.64194924", "0.6378772", "0.62738466", "0.6143999", "0.61402524", "0.61349475", "0.6042316", "0.59706557", "0.5956589", "0.5952429", "0.59391177", "0.59348154", "0.5842057", "0.58403885", "0.58317566", "0.5827153", "0.5...
0.81604284
0
TestLeaderStartReplication tests that when receiving client proposals, the leader appends the proposal to its log as a new entry, then issues AppendEntries RPCs in parallel to each of the other servers to replicate the entry. Also, when sending an AppendEntries RPC, the leader includes the index and term of the entry i...
Тест TestLeaderStartReplication проверяет, что при получении клиентских предложений лидер добавляет предложение в свой журнал как новую запись, а затем одновременно отправляет RPC AppendEntries каждому из других серверов для репликации записи. Также при отправке RPC AppendEntries лидер включает в него индекс и номер те...
func TestLeaderStartReplication(t *testing.T) { s := NewMemoryStorage() r := newTestRaft(1, []uint64{1, 2, 3}, 10, 1, s) defer closeAndFreeRaft(r) r.becomeCandidate() r.becomeLeader() commitNoopEntry(r, s) li := r.raftLog.lastIndex() ents := []pb.Entry{{Data: []byte("some data")}} r.Step(pb.Message{From: 1, T...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "func TestLogReplication1(t *testing.T) {\n\n\tack := make(chan bool)\n\n\t//Get leader\n\tleaderId := raft.GetLeaderId()\n\n\t//Append a log entry to leader as client\n\traft.InsertFakeLogEntry(leaderId)\n\n\tleaderLog := raft.GetLogAsString(leaderId)\n\t// log.Println(leaderLog)\n\n\ttime.AfterFunc(1*time.Second,...
[ "0.6864116", "0.640381", "0.6347351", "0.62488306", "0.6234333", "0.6037683", "0.60331476", "0.5993272", "0.58315694", "0.57851213", "0.578263", "0.57710594", "0.57250357", "0.5723692", "0.56953937", "0.56943995", "0.562664", "0.55386865", "0.5529624", "0.5525888", "0.5491838...
0.7907163
0
TestLeaderCommitEntry tests that when the entry has been safely replicated, the leader gives out the applied entries, which can be applied to its state machine. Also, the leader keeps track of the highest index it knows to be committed, and it includes that index in future AppendEntries RPCs so that the other servers e...
Тест TestLeaderCommitEntry проверяет, что когда запись была безопасно скопирована, лидер предоставляет примененные записи, которые могут быть применены к его машине состояния. Также лидер отслеживает наибольший индекс, который он знает, что он подтвержден, и включает этот индекс в будущие RPC AppendEntries, чтобы други...
func TestLeaderCommitEntry(t *testing.T) { s := NewMemoryStorage() r := newTestRaft(1, []uint64{1, 2, 3}, 10, 1, s) defer closeAndFreeRaft(r) r.becomeCandidate() r.becomeLeader() commitNoopEntry(r, s) li := r.raftLog.lastIndex() r.Step(pb.Message{From: 1, To: 1, Type: pb.MsgProp, Entries: []pb.Entry{{Data: []by...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "func TestFollowerCommitEntry(t *testing.T) {\n\ttests := []struct {\n\t\tents []pb.Entry\n\t\tcommit uint64\n\t}{\n\t\t{\n\t\t\t[]pb.Entry{\n\t\t\t\t{Term: 1, Index: 1, Data: []byte(\"some data\")},\n\t\t\t},\n\t\t\t1,\n\t\t},\n\t\t{\n\t\t\t[]pb.Entry{\n\t\t\t\t{Term: 1, Index: 1, Data: []byte(\"some data\")},\n...
[ "0.6883694", "0.67447805", "0.66522014", "0.652149", "0.61476606", "0.6147621", "0.5985899", "0.59405583", "0.58946085", "0.5710116", "0.56795913", "0.56135434", "0.5583243", "0.5540832", "0.552765", "0.5499955", "0.54635894", "0.54535663", "0.5443962", "0.5425161", "0.540683...
0.8186935
0
TestLeaderAcknowledgeCommit tests that a log entry is committed once the leader that created the entry has replicated it on a majority of the servers. Reference: section 5.3
Тест TestLeaderAcknowledgeCommit проверяет, что запись журна фиксируется, когда лидер, создавший эту запись, успешно реплицировал её на большинстве серверов. Ссылка: раздел 5.3
func TestLeaderAcknowledgeCommit(t *testing.T) { tests := []struct { size int acceptors map[uint64]bool wack bool }{ {1, nil, true}, {3, nil, false}, {3, map[uint64]bool{2: true}, true}, {3, map[uint64]bool{2: true, 3: true}, true}, {5, nil, false}, {5, map[uint64]bool{2: true}, false}, ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "func TestLeaderCommitEntry(t *testing.T) {\n\ts := NewMemoryStorage()\n\tr := newTestRaft(1, []uint64{1, 2, 3}, 10, 1, s)\n\tdefer closeAndFreeRaft(r)\n\tr.becomeCandidate()\n\tr.becomeLeader()\n\tcommitNoopEntry(r, s)\n\tli := r.raftLog.lastIndex()\n\tr.Step(pb.Message{From: 1, To: 1, Type: pb.MsgProp, Entries: [...
[ "0.6636693", "0.6383855", "0.6223964", "0.61065626", "0.6075896", "0.60401034", "0.60329896", "0.6028253", "0.59614366", "0.59245425", "0.58974385", "0.5846647", "0.5833662", "0.58287334", "0.57737565", "0.57682055", "0.57222724", "0.57091546", "0.570812", "0.5635217", "0.562...
0.8480067
0
TestFollowerCommitEntry tests that once a follower learns that a log entry is committed, it applies the entry to its local state machine (in log order). Reference: section 5.3
TestFollowerCommitEntry проверяет, что как только последователь learns, что запись журнала была зафиксирована, он применяет запись к своему локальному состоянию (в порядке журнала). Ссылка: раздел 5.3
func TestFollowerCommitEntry(t *testing.T) { tests := []struct { ents []pb.Entry commit uint64 }{ { []pb.Entry{ {Term: 1, Index: 1, Data: []byte("some data")}, }, 1, }, { []pb.Entry{ {Term: 1, Index: 1, Data: []byte("some data")}, {Term: 1, Index: 2, Data: []byte("some data2")}, ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "func TestLeaderCommitEntry(t *testing.T) {\n\ts := NewMemoryStorage()\n\tr := newTestRaft(1, []uint64{1, 2, 3}, 10, 1, s)\n\tdefer closeAndFreeRaft(r)\n\tr.becomeCandidate()\n\tr.becomeLeader()\n\tcommitNoopEntry(r, s)\n\tli := r.raftLog.lastIndex()\n\tr.Step(pb.Message{From: 1, To: 1, Type: pb.MsgProp, Entries: [...
[ "0.7963243", "0.7106544", "0.64706445", "0.637154", "0.62599796", "0.6237348", "0.6076704", "0.60045826", "0.58949214", "0.58655334", "0.5726599", "0.56900215", "0.5676556", "0.5592769", "0.5567174", "0.5552651", "0.5539082", "0.5505763", "0.5505618", "0.54969454", "0.5466882...
0.85471386
0
TestFollowerCheckMsgApp tests that if the follower does not find an entry in its log with the same index and term as the one in AppendEntries RPC, then it refuses the new entries. Otherwise it replies that it accepts the append entries. Reference: section 5.3
TestFollowerCheckMsgApp проверяет, что если последователь не находит запись в своем журнале с таким же индексом и термом, как и в RPC AppendEntries, то он отвергает новые записи. В противном случае он отвечает, что принимает эти записи. Ссылка: раздел 5.3
func TestFollowerCheckMsgApp(t *testing.T) { ents := []pb.Entry{{Term: 1, Index: 1}, {Term: 2, Index: 2}} tests := []struct { term uint64 index uint64 windex uint64 wreject bool wrejectHint uint64 }{ // match with committed entries {0, 0, 1, false, 0}, {ents[0].Term, ents[0].Ind...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "func TestFollowerAppendEntries(t *testing.T) {\n\ttests := []struct {\n\t\tindex, term uint64\n\t\tents []pb.Entry\n\t\twents []pb.Entry\n\t\twunstable []pb.Entry\n\t}{\n\t\t{\n\t\t\t2, 2,\n\t\t\t[]pb.Entry{{Term: 3, Index: 3}},\n\t\t\t[]pb.Entry{{Term: 1, Index: 1}, {Term: 2, Index: 2}, {Term: 3, I...
[ "0.68868625", "0.67104995", "0.60897493", "0.607411", "0.59460866", "0.5896438", "0.5842949", "0.58197165", "0.57796806", "0.57522064", "0.5702428", "0.56857294", "0.56728303", "0.56607705", "0.5658912", "0.5633639", "0.56321836", "0.5629746", "0.56050974", "0.5597355", "0.55...
0.8075628
0
TestFollowerAppendEntries tests that when AppendEntries RPC is valid, the follower will delete the existing conflict entry and all that follow it, and append any new entries not already in the log. Also, it writes the new entry into stable storage. Reference: section 5.3
TestFollowerAppendEntries проверяет, что при корректном AppendEntries RPC фолловер удаляет существующую конфликтующую запись и все последующие за ней, а также добавляет любые новые записи, которые еще не находятся в журнале. Также он записывает новую запись в стабильное хранилище. Ссылка: раздел 5.3
func TestFollowerAppendEntries(t *testing.T) { tests := []struct { index, term uint64 ents []pb.Entry wents []pb.Entry wunstable []pb.Entry }{ { 2, 2, []pb.Entry{{Term: 3, Index: 3}}, []pb.Entry{{Term: 1, Index: 1}, {Term: 2, Index: 2}, {Term: 3, Index: 3}}, []pb.Entry{{Term: 3, I...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "func (rf *Raft) AppendEntries(args AppendEntriesArgs, reply *AppendEntriesReply) error {\n\trf.mu.Lock()\n\tdefer rf.mu.Unlock()\n\tif rf.state == Down {\n\t\treturn nil\n\t}\n\n\tlog.Printf(\"[%v] received AppendEntries RPC call: Args%+v\", rf.me, args)\n\tif args.Term > rf.currentTerm {\n\t\tlog.Printf(\"[%v] cu...
[ "0.7225577", "0.7173168", "0.7102185", "0.7074297", "0.6984191", "0.69528997", "0.6949836", "0.69274294", "0.6906517", "0.69037604", "0.687655", "0.6865381", "0.6854907", "0.6832888", "0.6794146", "0.67904896", "0.6753549", "0.67144686", "0.6712799", "0.6691537", "0.6635659",...
0.82861537
0
TestLeaderSyncFollowerLog tests that the leader could bring a follower's log into consistency with its own. Reference: section 5.3, figure 7
Тест TestLeaderSyncFollowerLog проверяет, может ли лидер привести лог последователя к согласованности с собственным. Ссылка: раздел 5.3, рисунок 7
func TestLeaderSyncFollowerLog(t *testing.T) { ents := []pb.Entry{ {}, {Term: 1, Index: 1}, {Term: 1, Index: 2}, {Term: 1, Index: 3}, {Term: 4, Index: 4}, {Term: 4, Index: 5}, {Term: 5, Index: 6}, {Term: 5, Index: 7}, {Term: 6, Index: 8}, {Term: 6, Index: 9}, {Term: 6, Index: 10}, } term := uint64(8) test...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "func TestFollowerCommitEntry(t *testing.T) {\n\ttests := []struct {\n\t\tents []pb.Entry\n\t\tcommit uint64\n\t}{\n\t\t{\n\t\t\t[]pb.Entry{\n\t\t\t\t{Term: 1, Index: 1, Data: []byte(\"some data\")},\n\t\t\t},\n\t\t\t1,\n\t\t},\n\t\t{\n\t\t\t[]pb.Entry{\n\t\t\t\t{Term: 1, Index: 1, Data: []byte(\"some data\")},\n...
[ "0.66216356", "0.642609", "0.642562", "0.6424496", "0.63664854", "0.62123907", "0.614392", "0.6084621", "0.59841955", "0.58548945", "0.581514", "0.573651", "0.57138723", "0.57014894", "0.5697903", "0.56343067", "0.55782557", "0.55703485", "0.55664957", "0.55110955", "0.544706...
0.7571284
0
TestVoter tests the voter denies its vote if its own log is more uptodate than that of the candidate. Reference: section 5.4.1
TestVoter проверяет, отвергает ли избиратель голос, если его собственный журнал более актуален, чем журнал кандидата. Ссылка: раздел 5.4.1
func TestVoter(t *testing.T) { tests := []struct { ents []pb.Entry logterm uint64 index uint64 wreject bool }{ // same logterm {[]pb.Entry{{Term: 1, Index: 1}}, 1, 1, false}, {[]pb.Entry{{Term: 1, Index: 1}}, 1, 2, false}, {[]pb.Entry{{Term: 1, Index: 1}, {Term: 1, Index: 2}}, 1, 1, true}, // ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "func TestVoter_Vote(t *testing.T) {\n\tallia := sdk.NewOntologySdk()\n\tallia.NewRpcClient().SetAddress(RpcAddr)\n\tvoting := make(chan *btc.BtcProof, 10)\n\n\tacct, err := GetAccountByPassword(allia, \"../cmd/lightcli/wallet.dat\", \"passwordtest\")\n\tif err != nil {\n\t\tt.Fatalf(\"Failed to get acct: %v\", err...
[ "0.64001024", "0.6056834", "0.6027904", "0.5626672", "0.56244373", "0.5542475", "0.5518413", "0.5512789", "0.54705715", "0.54133296", "0.5404219", "0.5358423", "0.5338186", "0.53258735", "0.531703", "0.5274945", "0.5258293", "0.5252841", "0.5242921", "0.5231294", "0.52267873"...
0.7073056
0
Free decrements the reference count on a message, and releases its resources if no further references remain. While this is not strictly necessary thanks to GC, doing so allows for the resources to be recycled without engaging GC. This can have rather substantial benefits for performance.
Free уменьшает счётчик ссылок на сообщение и освобождает его ресурсы, если не остаётся дальнейших ссылок. Хотя это не строго необходимо благодаря сборке мусора, выполнение этого позволяет переработать ресурсы без вовлечения сборщика мусора. Это может иметь довольно существенные преимущества для производительности.
func (m *Message) Free() { var ch chan *Message if v := atomic.AddInt32(&m.refcnt, -1); v > 0 { return } for i := range messageCache { if m.bsize == messageCache[i].maxbody { ch = messageCache[i].cache break } } m.Port = nil select { case ch <- m: default: } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "func (m *Message) Free() {\n\tC.nlmsg_free(m.nlm)\n\tm.nlm = nil\n}", "func (m *Message) Release() {\n\tif m != nil {\n\t\tm.Text = nil\n\t\tfor i := len(m.List) - 1; i >= 0; i-- {\n\t\t\tm.List[i] = nil\n\t\t}\n\t\tm.List = m.List[:0]\n\t\tif m.used > 0 {\n\t\t\tcopy(m.buf[:m.used], blankBuf[:m.used])\n\t\t\tm....
[ "0.7511681", "0.7141758", "0.64743555", "0.6416629", "0.61727434", "0.6037461", "0.59808373", "0.5910276", "0.5909302", "0.5899108", "0.5874916", "0.5853634", "0.5834384", "0.583358", "0.58314615", "0.580654", "0.5789198", "0.57745117", "0.5758875", "0.5738124", "0.5727779", ...
0.785433
0
Dup creates a "duplicate" message. What it really does is simply increment the reference count on the message. Note that since the underlying message is actually shared, consumers must take care not to modify the message. (We might revise this API in the future to add a copyonwrite facility, but for now modification is...
Dup создает сообщение "дубликат". На самом деле он просто увеличивает счетчик ссылок на сообщение. Обратите внимание, что поскольку базовое сообщение на самом деле является общим, потребители должны быть осторожны и не модифицировать сообщение. (Мы можем в будущем пересмотреть этот API и добавить функциональность copy-...
func (m *Message) Dup() *Message { atomic.AddInt32(&m.refcnt, 1) return m }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "func (pkt *Packet) Dup() {\n\tpkt.mtx.Lock()\n\tif *pkt.refCount <= 0 {\n\t\tpanic(\"cannot reference freed packet\")\n\t}\n\t*pkt.refCount++\n\tpkt.mtx.Unlock()\n}", "func (c *Clac) DupN() error {\n\tnum, err := c.popCount()\n\tif err != nil {\n\t\treturn err\n\t}\n\treturn c.dup(0, num)\n}", "func Duplicate(...
[ "0.6534085", "0.54666907", "0.5392197", "0.5277368", "0.5169085", "0.5128281", "0.50643915", "0.5006668", "0.50032216", "0.49683774", "0.49560294", "0.48899946", "0.4889048", "0.48835996", "0.48802045", "0.4869459", "0.4795192", "0.47699422", "0.47657543", "0.47597653", "0.47...
0.72607046
0
Expired returns true if the message has "expired". This is used by transport implementations to discard messages that have been stuck in the write queue for too long, and should be discarded rather than delivered across the transport. This is only used on the TX path, there is no sense of "expiration" on the RX path.
Expired возвращает true, если сообщение имеет "истекший срок". Это используется транспортными реализациями для отбрасывания сообщений, которые долгое время находились в очереди на запись и должны быть отброшены вместо передачи через транспорт. Это используется только на пути отправки, на пути приема понятие "истечения ...
func (m *Message) Expired() bool { if m.expire.IsZero() { return false } if m.expire.After(time.Now()) { return false } return true }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "func (m *Attachment) HasExpired() bool {\n\tvar validTime = m.SigningTime.Add(time.Duration(m.SigningMinutes) * time.Minute)\n\treturn validTime.Unix() < time.Now().Unix()\n}", "func (q *queueData) expired() bool {\n\treturn q.ExpireAt < time.Now().Unix()\n}", "func (r *Record) IsExpired() bool {\n\treturn IsE...
[ "0.7090891", "0.70129126", "0.696582", "0.69188714", "0.6754564", "0.66905755", "0.6583698", "0.6581767", "0.65576303", "0.6547072", "0.6530696", "0.65154415", "0.65109485", "0.6510724", "0.6507026", "0.65001976", "0.64995795", "0.64461267", "0.64384156", "0.6424752", "0.6424...
0.7297898
0
NewMessage is the supported way to obtain a new Message. This makes use of a "cache" which greatly reduces the load on the garbage collector.
NewMessage — это рекомендуемый способ получения нового сообщения. Это использует «кэш», который значительно сокращает нагрузку на сборщик мусора.
func NewMessage(sz int) *Message { var m *Message var ch chan *Message for i := range messageCache { if sz < messageCache[i].maxbody { ch = messageCache[i].cache sz = messageCache[i].maxbody break } } select { case m = <-ch: default: m = &Message{} m.bbuf = make([]byte, 0, sz) m.hbuf = make([]...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "func (s *Store) NewMessage(_ context.Context, req *meta.StoreNewMessageRequest) (*meta.StoreNewMessageResponse, error) {\n\tlog.Debugf(\"Store NewMessage, msg:%v\", req.Msg)\n\t// add消息到db\n\tif err := s.message.add(*req.Msg); err != nil {\n\t\treturn &meta.StoreNewMessageResponse{Header: &meta.ResponseHeader{Code...
[ "0.76747173", "0.75967216", "0.7573609", "0.7450602", "0.7434523", "0.7382211", "0.7325671", "0.7325356", "0.7283416", "0.727642", "0.7223555", "0.7203074", "0.7185232", "0.7172994", "0.71674216", "0.71535164", "0.71507347", "0.7118813", "0.7068694", "0.70560145", "0.7037355"...
0.7645472
1
GetResourceRecordSets will return all resource record sets for a managed zone
GetResourceRecordSets вернёт все записи ресурсов для управляемой зоны
func (d *DNS) GetResourceRecordSets(projectID string, managedZone string) ([]*v1.ResourceRecordSet, error) { ctx := context.Background() rrsService := v1.NewResourceRecordSetsService(d.V1) rrsListCall := rrsService.List(projectID, managedZone).Context(ctx) rrsList, err := d.Calls.ResourceRecordSetsList.Do(rrsListCa...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "func (s *cloudDNSService) getResourceRecordSets(dnsZone string) ([]*dns.ResourceRecordSet, error) {\n\ttimer := pkg.NewTimer(prometheus.ObserverFunc(func(v float64) {\n\t\trequestRecordsTimeSummary.WithLabelValues(dnsZone).Observe(v)\n\t}))\n\tdefer timer.ObserveDuration()\n\n\tpageToken := \"\"\n\n\tresourceRecor...
[ "0.7884958", "0.71977293", "0.690012", "0.667474", "0.6506424", "0.65049356", "0.6426561", "0.62984467", "0.6185397", "0.61584216", "0.6146449", "0.60125625", "0.6006893", "0.5978852", "0.596062", "0.5958101", "0.59567195", "0.59504706", "0.59106505", "0.5834692", "0.58345544...
0.749032
1
GetResourceRecordSet will search for an existing record set by the resourcer record set name
GetResourceRecordSet будет искать существующий набор записей по имени набора записей ресурса
func (d *DNS) GetResourceRecordSet(projectID string, managedZone string, name string) (*v1.ResourceRecordSet, error) { ctx := context.Background() rrsService := v1.NewResourceRecordSetsService(d.V1) rrsListCall := rrsService.List(projectID, managedZone).Context(ctx).Name(name) rrsList, err := d.Calls.ResourceRecord...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "func GetResourceRecordSet(ctx *pulumi.Context,\n\tname string, id pulumi.IDInput, state *ResourceRecordSetState, opts ...pulumi.ResourceOption) (*ResourceRecordSet, error) {\n\tvar resource ResourceRecordSet\n\terr := ctx.ReadResource(\"google-native:dns/v1beta2:ResourceRecordSet\", name, id, state, &resource, opt...
[ "0.6996784", "0.69788545", "0.69788545", "0.6760038", "0.6608798", "0.6574195", "0.62507427", "0.6177412", "0.61474234", "0.6131648", "0.5973977", "0.5969924", "0.5915531", "0.58928186", "0.5730913", "0.569206", "0.56689787", "0.55815643", "0.553899", "0.55002767", "0.5467366...
0.70044184
0
SetResourceRecordSets will create or update a DNS zone with one or more record sets
SetResourceRecordSets будет создавать или обновлять DNS-зону с одним или несколькими наборами записей
func (d *DNS) SetResourceRecordSets(projectID string, managedZone string, records []*v1.ResourceRecordSet) error { var deletions []*v1.ResourceRecordSet var additions []*v1.ResourceRecordSet var change *v1.Change logItems := []string{} for _, record := range records { existing, err := d.GetResourceRecordSet(proj...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "func (p *Provider) SetRecords(ctx context.Context, zone string, records []libdns.Record) ([]libdns.Record, error) {\n\tp.mutex.Lock()\n\tdefer p.mutex.Unlock()\n\n\tclient := &http.Client{}\n\n\tvar updatedRecords []libdns.Record\n\n\tvar resourceRecordSets []LeasewebRecordSet\n\n\tfor _, record := range records {...
[ "0.7518115", "0.6707654", "0.6628259", "0.6497489", "0.61840737", "0.61539745", "0.6116657", "0.6111992", "0.6105293", "0.6021211", "0.5987698", "0.5978222", "0.58855504", "0.58805597", "0.58334905", "0.5816443", "0.5797787", "0.5787811", "0.5784792", "0.5780214", "0.5722433"...
0.81879765
0
DeleteResourceRecordSets will remove all resource record sets from a managed zone
DeleteResourceRecordSets удалит все ресурсные записи из управляемой зоны
func (d *DNS) DeleteResourceRecordSets(projectID string, managedZone string) error { var deletions []*v1.ResourceRecordSet resourceRecordSets, err := d.GetResourceRecordSets(projectID, managedZone) if err != nil { return err } d.log.Info("Deleting all records from DNS zone %s:", managedZone) for _, resourceReco...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "func (s *Synk) deleteResourceSets(ctx context.Context, name string, version int32) error {\n\tc := s.client.Resource(resourceSetGVR)\n\n\tlist, err := c.List(ctx, metav1.ListOptions{})\n\tif err != nil {\n\t\treturn errors.Wrap(err, \"list existing resources\")\n\t}\n\tfor _, r := range list.Items {\n\t\tn, v, ok ...
[ "0.7039469", "0.6500067", "0.6473653", "0.6403441", "0.63773626", "0.60974884", "0.60132223", "0.5994559", "0.5870117", "0.58634305", "0.5807364", "0.5782578", "0.5775964", "0.57438874", "0.57385606", "0.56440526", "0.56085396", "0.5581031", "0.5575552", "0.5569227", "0.55610...
0.81050515
0
Meta sets the meta data to be included in the aggregation response.
Meta устанавливает метаданные, которые должны быть включены в ответ агрегации.
func (a *ChildrenAggregation) Meta(metaData map[string]interface{}) *ChildrenAggregation { a.meta = metaData return a }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "func (a *FilterAggregation) Meta(metaData map[string]interface{}) *FilterAggregation {\n\ta.meta = metaData\n\treturn a\n}", "func (a *AdjacencyMatrixAggregation) Meta(metaData map[string]interface{}) *AdjacencyMatrixAggregation {\n\ta.meta = metaData\n\treturn a\n}", "func (o *GetRecipeInformation200ResponseE...
[ "0.7573695", "0.7172021", "0.63159454", "0.6203084", "0.60634434", "0.6045212", "0.6020982", "0.6007781", "0.5971997", "0.59656334", "0.5953286", "0.5938713", "0.5897168", "0.5880866", "0.58364844", "0.58214897", "0.5801138", "0.57809526", "0.57665086", "0.57444215", "0.57327...
0.7300219
1
WithPayload adds the payload to the create sub category created response
WithPayload добавляет полезную нагрузку в ответ на создание подкатегории
func (o *CreateSubCategoryCreated) WithPayload(payload *models.SubCategory) *CreateSubCategoryCreated { o.Payload = payload return o }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "func (o *CreateSubCategoryCreated) SetPayload(payload *models.SubCategory) {\n\to.Payload = payload\n}", "func CreateCategory (w http.ResponseWriter, r *http.Request) {\n\tvar newCategory Category\n\n\t//get the information containing in request's body\n\t//or report an error\n\treqBody, err := ioutil.ReadAll(r....
[ "0.65292084", "0.5659147", "0.5402749", "0.5291293", "0.5193651", "0.51259524", "0.5121756", "0.5048872", "0.4986674", "0.49802187", "0.49666917", "0.49362504", "0.49362025", "0.49071783", "0.48970366", "0.48712412", "0.48694733", "0.48630476", "0.48542443", "0.4837587", "0.4...
0.730311
0
SetPayload sets the payload to the create sub category created response
SetPayload устанавливает полезную нагрузку для ответа на создание подкатегории
func (o *CreateSubCategoryCreated) SetPayload(payload *models.SubCategory) { o.Payload = payload }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "func (o *PutSlideSuperlikeCreated) SetPayload(payload models.Success) {\n\to.Payload = payload\n}", "func (o *CreateSubCategoryCreated) WithPayload(payload *models.SubCategory) *CreateSubCategoryCreated {\n\to.Payload = payload\n\treturn o\n}", "func (o *ClientPermissionCreateInternalServerError) SetPayload(pa...
[ "0.6328343", "0.6283681", "0.62103945", "0.6195887", "0.61484605", "0.6141625", "0.60756665", "0.607248", "0.60694844", "0.6023221", "0.6005432", "0.597998", "0.59690493", "0.5965882", "0.5945944", "0.5940896", "0.5934345", "0.59289837", "0.5923078", "0.59091187", "0.5885831"...
0.73931634
0
New creates processor for k8s Secret resource.
New creates processor for k8s Secret resource.
func New() helmify.Processor { return &secret{} }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "func Create(c *client.Client, i *Instance) error {\n\tsecretType, err := detectSecretType(i.Type)\n\tif err != nil {\n\t\treturn err\n\t}\n\n\tsecret := v1.Secret{\n\t\tObjectMeta: metav1.ObjectMeta{\n\t\t\tName: i.Name,\n\t\t\tNamespace: i.Namespace,\n\t\t},\n\t\tData: map[string][]byte{\n\t\t\ti.Key: []byte...
[ "0.66797674", "0.6378324", "0.63245016", "0.631639", "0.6316075", "0.6300446", "0.62829036", "0.611341", "0.6105122", "0.60965884", "0.60490847", "0.6026435", "0.60210687", "0.60203475", "0.59663445", "0.5898095", "0.5892259", "0.5868871", "0.5848825", "0.58468777", "0.584556...
0.73855734
0
Process k8s Secret object into template. Returns false if not capable of processing given resource type.
Обрабатывает объект k8s Secret в шаблон. Возвращает false, если невозможно обработать данный тип ресурса.
func (d secret) Process(appMeta helmify.AppMetadata, obj *unstructured.Unstructured) (bool, helmify.Template, error) { if obj.GroupVersionKind() != configMapGVC { return false, nil, nil } sec := corev1.Secret{} err := runtime.DefaultUnstructuredConverter.FromUnstructured(obj.Object, &sec) if err != nil { retur...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "func isSecret(resource v1alpha1.BackingServiceResource) bool {\n\treturn strings.ToLower(resource.Group+\".\"+resource.Version+\".\"+resource.Kind) == \".v1.secret\"\n}", "func (regionEnv *RegionEnv) createSecret(deploymentName string) bool {\n\tgvk := schema.GroupVersionKind{Version: \"v1\", Kind: \"Secret\"}\n...
[ "0.6179236", "0.5799094", "0.52540725", "0.515004", "0.51190156", "0.5062301", "0.50266254", "0.49973863", "0.49073693", "0.489995", "0.48877433", "0.48646992", "0.48484105", "0.4844005", "0.4831506", "0.4827381", "0.48271757", "0.48162967", "0.4793151", "0.47895056", "0.4777...
0.7421397
0
NewConstraintReferenceService creates a new instance of ConstraintReferenceService. It also registers a testing interface on the mock and a cleanup function to assert the mocks expectations.
NewConstraintReferenceService создает новый экземпляр ConstraintReferenceService. Он также регистрирует тестовый интерфейс на моке и функцию очистки для проверки ожиданий моков.
func NewConstraintReferenceService(t mockConstructorTestingTNewConstraintReferenceService) *ConstraintReferenceService { mock := &ConstraintReferenceService{} mock.Mock.Test(t) t.Cleanup(func() { mock.AssertExpectations(t) }) return mock }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "func NewFormationConstraintSvc(t mockConstructorTestingTNewFormationConstraintSvc) *FormationConstraintSvc {\n\tmock := &FormationConstraintSvc{}\n\tmock.Mock.Test(t)\n\n\tt.Cleanup(func() { mock.AssertExpectations(t) })\n\n\treturn mock\n}", "func NewService(repo formationTemplateConstraintReferenceRepository, ...
[ "0.61277133", "0.5656435", "0.5619453", "0.54407775", "0.5274641", "0.5209439", "0.5191312", "0.5136981", "0.49495593", "0.4917797", "0.48863798", "0.48752347", "0.48572385", "0.47870165", "0.47863263", "0.47311988", "0.47112477", "0.46971738", "0.46850052", "0.46345636", "0....
0.84137696
0
idDistance calculates the distance of a and b accounting for wraparound using max. Wraparound means that a may be closer to b if they traveled through max. The lowest value of the following is returned: |a b| max a + b + 1 max b + a + 1 Expressions that evaluate to be larger than max are ignored to prevent overflowing.
idDistance рассчитывает расстояние между a и b с учетом обертывания с использованием max. Обертывание означает, что a может быть ближе к b, если они проходят через max. Возвращается наименьшее из следующих значений: |a - b|, max - a + b + 1, max - b + a + 1. Выражения, которые оцениваются больше, чем max, игнорируются,...
func idDistance(a, b id.ID, max id.ID) id.ID { // Wrap distance will always be smaller when a > b so // swap the two if that doesn't hold. if id.Compare(a, b) < 0 { return idDistance(b, a, max) } var ( one = id.ID{Low: 1} directDist = absSub(b, a) maxDist = idSub(max, a) ) // Don't wrap around if b...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "func (id ID) Distance(other ID) (result ID) {\n\tdistance := new(big.Int)\n\tdistance = distance.Xor(id.Int(), other.Int())\n\tresult, _ = NewID(distance.Bytes())\n\treturn\n}", "func (kademliaID KademliaID) CalcDistance(target *KademliaID) *KademliaID {\n\tresult := KademliaID{}\n\tfor i := 0; i < ID_LEN; i++ {...
[ "0.59706086", "0.5848006", "0.5799961", "0.5799961", "0.57304907", "0.5343803", "0.51886135", "0.5186379", "0.5079502", "0.50471145", "0.49845216", "0.4917509", "0.49031368", "0.490295", "0.487796", "0.4873442", "0.4847311", "0.4836192", "0.48251015", "0.48215413", "0.4791891...
0.8380889
0
absSub :: | a b |
absSub :: | a b |
func absSub(a, b id.ID) id.ID { cmp := id.Compare(a, b) switch { case cmp < 0: // a < b return idSub(b, a) case cmp == 0: // a == b return id.Zero case cmp > 0: // a > b return idSub(a, b) default: panic("impossible case") } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "func (v Vec) AbsSub(other Vec) Vec {\n\treturn v.Copy().AbsSubBy(other)\n}", "func (a Vec2) Sub(b Vec2) Vec2 {\n\treturn Vec2{a.X - b.X, a.Y - b.Y}\n}", "func (t Torus) Sub(a, b Point) Point {\n\ta, b = t.normPair(a, b)\n\treturn a.Sub(b)\n}", "func (a ImpactAmount) sub(b ImpactAmount) ImpactAmount {\n\tif b...
[ "0.7009983", "0.6930586", "0.6803725", "0.66169053", "0.65832865", "0.65832865", "0.65832865", "0.6508825", "0.6508825", "0.6508825", "0.6458546", "0.6458546", "0.6458546", "0.6440195", "0.64367706", "0.6427443", "0.6413858", "0.64080596", "0.6405884", "0.637051", "0.634558",...
0.7613036
0
Returns true when v + o would overflow max.
Возвращает истину, когда v + o превышало бы max.
func addOverflows(v, o, max id.ID) bool { // o overflows when (max - v) < o maxDist := idSub(max, v) return id.Compare(maxDist, o) < 0 }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "func bounded(n ir.Node, max int64) bool {\n\tif n.Type() == nil || !n.Type().IsInteger() {\n\t\treturn false\n\t}\n\n\tsign := n.Type().IsSigned()\n\tbits := int32(8 * n.Type().Size())\n\n\tif ir.IsSmallIntConst(n) {\n\t\tv := ir.Int64Val(n)\n\t\treturn 0 <= v && v < max\n\t}\n\n\tswitch n.Op() {\n\tcase ir.OAND, ...
[ "0.59384793", "0.58904886", "0.58642787", "0.584234", "0.5744652", "0.56927615", "0.5617862", "0.5560207", "0.550647", "0.5500962", "0.54567045", "0.5416046", "0.5390327", "0.53597915", "0.5351312", "0.5327792", "0.5325286", "0.5323421", "0.5316553", "0.5291704", "0.5264823",...
0.7086862
0
idAdd :: v + o
idAdd :: v + o
func idAdd(v, o id.ID) id.ID { low, borrow := bits.Add64(v.Low, o.Low, 0) high, _ := bits.Add64(v.High, o.High, borrow) return id.ID{High: high, Low: low} }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "func add(this js.Value, i []js.Value) interface{} {\n\tin1, in2 := getInputValues(i)\n\tsetValueById(i[2].String(), in1+in2)\n\treturn nil\n}", "func _cgoexp_e93fccc2f088_add(a *struct {\n\t\tp0 _Ctype_int\n\t\tp1 _Ctype_int\n\t\tr0 _Ctype_int\n\t}) {\n\ta.r0 = add(a.p0, a.p1)\n}", "func add(x, y int) int", ...
[ "0.67529297", "0.6540365", "0.64769065", "0.64463145", "0.64110214", "0.63479173", "0.63165194", "0.6288132", "0.6288132", "0.6288132", "0.6288132", "0.6288132", "0.6288132", "0.6288132", "0.6278636", "0.6243417", "0.6243417", "0.6243417", "0.6243417", "0.62226516", "0.621912...
0.774656
0
control the terminal mode Set a tty terminal to raw mode.
управление режимом терминала Установите tty-терминал в режим raw.
func setRawMode(fd int) (*raw.Termios, error) { // make sure this is a tty if !isatty.IsTerminal(uintptr(fd)) { return nil, fmt.Errorf("fd %d is not a tty", fd) } // get the terminal IO mode originalMode, err := raw.TcGetAttr(uintptr(fd)) if err != nil { return nil, err } // modify the original mode newMod...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "func (i *In) SetRawTerminal() (err error) {\n\tif !i.isTerminal || os.Getenv(\"NORAW\") != \"\" {\n\t\treturn nil\n\t}\n\ti.state, err = term.SetRawTerminal(i.fd)\n\treturn err\n}", "func SetRawTerminal(fd FileDescriptor) (state *TerminalState, err error) {\n\tvar s *mobyterm.State\n\ts, err = mobyterm.SetRawTer...
[ "0.75425404", "0.7029126", "0.66933656", "0.61317337", "0.5962113", "0.58300453", "0.57845724", "0.5764185", "0.5763176", "0.5722855", "0.5571576", "0.5564034", "0.553365", "0.5418981", "0.5362698", "0.53572845", "0.5330058", "0.5295675", "0.5278407", "0.52701086", "0.526473"...
0.7128382
1
Add a byte to a utf8 decode. Return the rune and it's size in bytes.
Добавить байт к декодированию utf8. Вернуть руну и её размер в байтах.
func (u *utf8) add(c byte) (r rune, size int) { switch u.state { case getByte0: if c&0x80 == 0 { // 1 byte return rune(c), 1 } else if c&0xe0 == 0xc0 { // 2 byte u.val = int32(c&0x1f) << 6 u.count = 2 u.state = get1More return KeycodeNull, 0 } else if c&0xf0 == 0xe0 { // 3 bytes u.val...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "func (UTF8Decoder) DecodeRune(p []byte) (rune, int) { return utf8.DecodeRune(p) }", "func (s *scratch) addRune(r rune) int {\n\tif s.fill+utf8.UTFMax >= cap(s.data) {\n\t\ts.grow()\n\t}\n\n\tn := utf8.EncodeRune(s.data[s.fill:], r)\n\ts.fill += n\n\treturn n\n}", "func (t *TelWindow) AddByte(b byte) {\n \n}...
[ "0.62522995", "0.6023888", "0.575294", "0.5561606", "0.55129707", "0.5300394", "0.52845013", "0.52588093", "0.5219854", "0.5210699", "0.5197407", "0.5191365", "0.5188205", "0.5158537", "0.5146117", "0.50871277", "0.5043505", "0.5022171", "0.49819675", "0.49794295", "0.4960473...
0.7119522
0
Return true if we know we don't support this terminal.
Возвращать true, если мы знаем, что не поддерживаем этот терминал.
func unsupportedTerm() bool { _, ok := unsupported[os.Getenv("TERM")] return ok }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "func IsTerminal(fd uintptr) bool {\r\n\treturn false\r\n}", "func isTerminal(f *os.File) bool {\n\tlog.Fatalf(\"hyperkit: Function not supported on your OS\")\n\treturn false\n}", "func terminalIsDumb() bool {\n var term = os.Getenv(\"TERM\")\n\n if term == \"\" || term == \"dumb\" {\n return true...
[ "0.6745055", "0.66499245", "0.6545055", "0.6524213", "0.64737916", "0.6460544", "0.64597934", "0.62575334", "0.6241871", "0.62060475", "0.6071826", "0.6039111", "0.60130143", "0.6007517", "0.59933984", "0.5969025", "0.59652334", "0.59541774", "0.59541774", "0.5943652", "0.584...
0.7082624
0