// SetupRequest passes the cached ETag and Last Modified date to the request.
973304
func (r *CachedResponseDecoder) SetupRequest(req *http.Request) {
	if etag := r.Header.Get(etagHeader); len(etag) > 0 {
		req.Header.Set(ifNoneMatchHeader, etag)
	}

	if lastmod := r.Header.Get(lastModHeader); len(lastmod) > 0 {
		req.Header.Set(ifModSinceHeader, lastmod)
	}
}
37524
func (s *Operation) SetUpdateDate(v time.Time) *Operation {
	s.UpdateDate = &v
	return s
}
279403
func (s *PlacementDescription) SetUpdatedDate(v time.Time) *PlacementDescription {
	s.UpdatedDate = &v
	return s
}
476412
func setup(c *caddy.Controller) error {
	rules, err := headersParse(c)
	if err != nil {
		return err
	}

	httpserver.GetConfig(c).AddMiddleware(func(next httpserver.Handler) httpserver.Handler {
		return Headers{Next: next, Rules: rules}
	})

	return nil
}
1230761
func (a *auditLogFile) AddRequest(m Request) error {
	return errors.Trace(a.addRecord(Record{Request: &m}))

}
501951
func (a *accessKey) DecorateRequest(req *http.Request) {
	req.Header.Set("Authorization", fmt.Sprintf("key %s", a.accessKey))
}
1198940
func (s *GetQueryResultsOutput) SetUpdateCount(v int64) *GetQueryResultsOutput {
	s.UpdateCount = &v
	return s
}
1249683
func (q *Queue) AddRequest(r *colly.Request) error {
	d, err := r.Marshal()
	if err != nil {
		return err
	}
	if err := q.storage.AddRequest(d); err != nil {
		return err
	}
	q.lock.Lock()
	for _, c := range q.threadChans {
		c <- !stop
	}
	q.threadChans = make([]chan bool, 0, q.Threads)
	q.lock.Unlock()
	return nil
}
1104126
func (s *ProjectSummary) SetUpdatedDate(v time.Time) *ProjectSummary {
	s.UpdatedDate = &v
	return s
}
495839
func (r *amqpRequester) Setup() error {
	conn, err := amqp.Dial(r.url)
	if err != nil {
		return err
	}
	c, err := conn.Channel()
	if err != nil {
		return err
	}
	queue, err := c.QueueDeclare(
		r.queueName, // name
		false,       // not durable
		false,       // delete when unused
		true,        // exclusive
		false,       // no wait
		nil,         // arguments
	)
	if err != nil {
		return err
	}
	err = c.ExchangeDeclare(
		r.exchangeName, // name
		"fanout",       // type
		false,          // not durable
		false,          // auto-deleted
		false,          // internal
		false,          // no wait
		nil,            // arguments
	)
	if err != nil {
		return err
	}
	err = c.QueueBind(
		r.queueName,
		r.queueName,
		r.exchangeName,
		false,
		nil,
	)
	if err != nil {
		return err
	}

	inbound, err := c.Consume(
		r.queueName, // queue
		"",          // consumer
		true,        // auto ack
		false,       // exclusive
		true,        // no local
		false,       // no wait
		nil,         // args
	)
	if err != nil {
		return err
	}
	r.conn = conn
	r.queue = queue
	r.channel = c
	r.inbound = inbound
	r.msg = amqp.Publishing{
		DeliveryMode: amqp.Transient,
		Timestamp:    time.Now(),
		ContentType:  "text/plain",
		Body:         make([]byte, r.payloadSize),
	}
	return nil
}
871689
func (m *MultipartStreamer) SetupRequest(req *http.Request) {
	req.Body = m.GetReader()
	req.Header.Add("Content-Type", m.ContentType)
	req.ContentLength = m.Len()
}
626110
func (client *Client) setupHttpRequest(req *request) (*http.Request, error) {
	// Copy so that signing the http request will not mutate it

	u, err := req.url()
	if err != nil {
		return nil, err
	}
	u.Opaque = fmt.Sprintf("//%s%s", u.Host, partiallyEscapedPath(u.Path))

	hreq := http.Request{
		URL:        u,
		Method:     req.method,
		ProtoMajor: 1,
		ProtoMinor: 1,
		Close:      true,
		Header:     req.headers,
		Form:       req.params,
	}

	hreq.Header.Set("X-SDK-Client", `AliyunGO/`+common.Version)

	contentLength := req.headers.Get("Content-Length")

	if contentLength != "" {
		hreq.ContentLength, _ = strconv.ParseInt(contentLength, 10, 64)
		req.headers.Del("Content-Length")
	}

	if req.payload != nil {
		hreq.Body = ioutil.NopCloser(req.payload)
	}

	return &hreq, nil
}
303940
func (s *ServerCertificateMetadata) SetUploadDate(v time.Time) *ServerCertificateMetadata {
	s.UploadDate = &v
	return s
}
1013897
func (s *SSHPublicKeyMetadata) SetUploadDate(v time.Time) *SSHPublicKeyMetadata {
	s.UploadDate = &v
	return s
}
153884
func (s *TransactWriteItem) SetUpdate(v *Update) *TransactWriteItem {
	s.Update = v
	return s
}
1104925
func (s *TaskSet) SetUpdatedAt(v time.Time) *TaskSet {
	s.UpdatedAt = &v
	return s
}
1195874
func (s *ServiceSoftwareOptions) SetUpdateAvailable(v bool) *ServiceSoftwareOptions {
	s.UpdateAvailable = &v
	return s
}