Esempio n. 1
0
 public persistConn(RoundTripper alt = default, ref ptr <Transport> t = default, connectMethodKey cacheKey = default, net.Conn conn = default, ref ptr <tls.ConnectionState> tlsState = default, ref ptr <bufio.Reader> br = default, ref ptr <bufio.Writer> bw = default, long nwrite = default, channel <requestAndChan> reqch = default, channel <writeRequest> writech = default, channel <object> closech = default, bool isProxy = default, bool sawEOF = default, long readLimit = default, channel <error> writeErrCh = default, channel <object> writeLoopDone = default, time.Time idleAt = default, ref ptr <time.Timer> idleTimer = default, sync.Mutex mu = default, long numExpectedResponses = default, error closed = default, error canceledErr = default, bool broken = default, bool reused = default, Action <Header> mutateHeaderFunc = default)
 {
     this.alt                  = alt;
     this.t                    = t;
     this.cacheKey             = cacheKey;
     this.conn                 = conn;
     this.tlsState             = tlsState;
     this.br                   = br;
     this.bw                   = bw;
     this.nwrite               = nwrite;
     this.reqch                = reqch;
     this.writech              = writech;
     this.closech              = closech;
     this.isProxy              = isProxy;
     this.sawEOF               = sawEOF;
     this.readLimit            = readLimit;
     this.writeErrCh           = writeErrCh;
     this.writeLoopDone        = writeLoopDone;
     this.idleAt               = idleAt;
     this.idleTimer            = idleTimer;
     this.mu                   = mu;
     this.numExpectedResponses = numExpectedResponses;
     this.closed               = closed;
     this.canceledErr          = canceledErr;
     this.broken               = broken;
     this.reused               = reused;
     this.mutateHeaderFunc     = mutateHeaderFunc;
 }
Esempio n. 2
0
 public Client(RoundTripper Transport = default, Func <ptr <Request>, slice <ptr <Request> >, error> CheckRedirect = default, CookieJar Jar = default, time.Duration Timeout = default)
 {
     this.Transport     = Transport;
     this.CheckRedirect = CheckRedirect;
     this.Jar           = Jar;
     this.Timeout       = Timeout;
 }
Esempio n. 3
0
        public void ChangingBuiltInAnalyzer()
        {
            // hide
            var client = TestClient.GetInMemoryClient(c => c.DisableDirectStreaming().PrettyJson());

            var createIndexResponse = client.CreateIndex("my-index", c => c
                                                         .Settings(s => s
                                                                   .Analysis(a => a
                                                                             .Analyzers(aa => aa
                                                                                        .Standard("standard_english", sa => sa
                                                                                                  .StopWords("_english_") // <1> Pre-defined list of English stopwords within Elasticsearch
                                                                                                  )
                                                                                        )
                                                                             )
                                                                   )
                                                         .Mappings(m => m
                                                                   .Map <Project>(mm => mm
                                                                                  .Properties(p => p
                                                                                              .Text(t => t
                                                                                                    .Name(n => n.Name)
                                                                                                    .Analyzer("standard_english") // <2> Use the `standard_english` analyzer configured
                                                                                                    )
                                                                                              )
                                                                                  )
                                                                   )
                                                         );

            /**
             */
            //json
            var expected = new
            {
                settings = new
                {
                    analysis = new
                    {
                        analyzer = new
                        {
                            standard_english = new
                            {
                                type      = "standard",
                                stopwords = new [] { "_english_" }
                            }
                        }
                    }
                },
                mappings = new
                {
                    doc = new // <3> our connection settings map `Project` to `doc`
                    {
                        properties = new
                        {
                            name = new
                            {
                                type     = "text",
                                analyzer = "standard_english"
                            }
                        }
                    }
                }
            };

            // hide
            RoundTripper.Expect(expected).NoRoundTrip().WhenSerializing(Encoding.UTF8.GetString(createIndexResponse.ApiCall.RequestBodyInBytes));
        }