//Use if you already have an Authentication header you want to pass through to couchdb
8143
func (pta *PassThroughAuth) AddAuthHeaders(req *http.Request) {
	req.Header.Set("Authorization", pta.AuthHeader)
}
477021
func (c *Client) Use(id int) error {
	_, err := c.ExecCmd(NewCmd("use").WithArgs(NewArg("sid", id)))
	return err
}
770093
func (r *Router) Use(handlers ...Handler) {
	r.RouteGroup.Use(handlers...)
	r.notFoundHandlers = combineHandlers(r.handlers, r.notFound)
}
388515
func (m *Mux) Use(p plugin.Plugin) *Mux {
	m.Middleware.Use(p)
	return m
}
1040302
func (rg *RouteGroup) Use(handlers ...Handler) {
	rg.handlers = append(rg.handlers, handlers...)
}
1023556
func (c *Client) Use(p plugin.Plugin) *Client {
	c.Middleware.Use(p)
	return c
}
573941
func (app *App) UseHandler(h Handler) *App {
	app.mds = append(app.mds, h.Serve)
	return app
}
767607
func (r *router) Use(f func(next http.Handler) http.Handler) {
	r.group.Use(f)
}
743346
func Use(c context.Context, out io.Writer) context.Context {
	return logging.SetFactory(c, GetFactory(out))
}
535838
func (a *managedAddress) Used(ns walletdb.ReadBucket) bool {
	return a.manager.fetchUsed(ns, a.AddrHash())
}
1154472
func UseAuthenticator(a BasicHTTPAuthenticator) Option {
	return func(p *Plugin) {
		p.Deps.Authenticator = a
	}
}
1044603
func (db *Database) Save(doc interface{}, id string, rev string) (string, error) {
	url, err := buildUrl(db.dbName, id)
	if err != nil {
		return "", err
	}
	var headers = make(map[string]string)
	headers["Content-Type"] = "application/json"
	headers["Accept"] = "application/json"
	if id == "" {
		return "", fmt.Errorf("No ID specified")
	}
	if rev != "" {
		headers["If-Match"] = rev
	}
	data, numBytes, err := encodeData(doc)
	if err != nil {
		return "", err
	}
	headers["Content-Length"] = strconv.Itoa(numBytes)
	//Yes, this needs to be here.
	//Yes, I know the Golang http.Client doesn't support expect/continue
	//This is here to work around a bug in CouchDB.  It shouldn't work, and yet it does.
	//See: http://stackoverflow.com/questions/30541591/large-put-requests-from-go-to-couchdb
	//Also, I filed a bug report: https://issues.apache.org/jira/browse/COUCHDB-2704
	//Go net/http needs to support the HTTP/1.1 spec, or CouchDB needs to get fixed.
	//If either of those happens in the future, I can revisit this.
	//Unless I forget, which I'm sure I will.
	if numBytes > 4000 {
		headers["Expect"] = "100-continue"
	}
	resp, err := db.connection.request("PUT", url, data, headers, db.auth)
	if err != nil {
		return "", err
	}
	defer resp.Body.Close()
	return getRevInfo(resp)
}
1364566
func (c *Ctx) UseCertificate(cert *Certificate) error {
	runtime.LockOSThread()
	defer runtime.UnlockOSThread()
	c.cert = cert
	if int(C.SSL_CTX_use_certificate(c.ctx, cert.x)) != 1 {
		return errorFromErrorQueue()
	}
	return nil
}
761593
func (w *Ware) Use(handler Handler) {
	validateHandler(handler)

	w.handlers = append(w.handlers, handler)
}
1290999
func (auth *v2Auth) Request(c *Connection) (*http.Request, error) {
	auth.Region = c.Region
	// Toggle useApiKey if not first run and not OK yet
	if auth.notFirst && !auth.useApiKeyOk {
		auth.useApiKey = !auth.useApiKey
	}
	auth.notFirst = true
	// Create a V2 auth request for the body of the connection
	var v2i interface{}
	if !auth.useApiKey {
		// Normal swift authentication
		v2 := v2AuthRequest{}
		v2.Auth.PasswordCredentials.UserName = c.UserName
		v2.Auth.PasswordCredentials.Password = c.ApiKey
		v2.Auth.Tenant = c.Tenant
		v2.Auth.TenantId = c.TenantId
		v2i = v2
	} else {
		// Rackspace special with API Key
		v2 := v2AuthRequestRackspace{}
		v2.Auth.ApiKeyCredentials.UserName = c.UserName
		v2.Auth.ApiKeyCredentials.ApiKey = c.ApiKey
		v2.Auth.Tenant = c.Tenant
		v2.Auth.TenantId = c.TenantId
		v2i = v2
	}
	body, err := json.Marshal(v2i)
	if err != nil {
		return nil, err
	}
	url := c.AuthUrl
	if !strings.HasSuffix(url, "/") {
		url += "/"
	}
	url += "tokens"
	req, err := http.NewRequest("POST", url, bytes.NewBuffer(body))
	if err != nil {
		return nil, err
	}
	req.Header.Set("Content-Type", "application/json")
	req.Header.Set("User-Agent", c.UserAgent)
	return req, nil
}
749832
func Use(c context.Context, s Client) context.Context {
	return context.WithValue(c, &contextKey, s)
}
1024021
func (m *Martini) Use(handler Handler) {
	validateHandler(handler)

	m.handlers = append(m.handlers, handler)
}