github.com/searKing/golang/go@v1.2.117/net/http/clone.go (about)

     1  // Copyright 2021 The searKing Author. All rights reserved.
     2  // Use of this source code is governed by a BSD-style
     3  // license that can be found in the LICENSE file.
     4  
     5  package http
     6  
     7  import (
     8  	"crypto/tls"
     9  	"mime/multipart"
    10  	"net/http"
    11  	"net/url"
    12  	_ "unsafe" // for go:linkname
    13  )
    14  
    15  //go:linkname CloneURLValues net/http.cloneURLValues
    16  func CloneURLValues(v url.Values) url.Values
    17  
    18  //go:linkname CloneURL net/http.cloneURL
    19  func CloneURL(u *url.URL) *url.URL
    20  
    21  //go:linkname CloneMultipartForm net/http.cloneMultipartForm
    22  func CloneMultipartForm(f *multipart.Form) *multipart.Form
    23  
    24  //go:linkname CloneMultipartFileHeader net/http.cloneMultipartFileHeader
    25  func CloneMultipartFileHeader(fh *multipart.FileHeader) *multipart.FileHeader
    26  
    27  // CloneOrMakeHeader invokes Header.Clone but if the
    28  // result is nil, it'll instead make and return a non-nil Header.
    29  //
    30  //go:linkname CloneOrMakeHeader net/http.cloneOrMakeHeader
    31  func CloneOrMakeHeader(hdr http.Header) http.Header
    32  
    33  // CloneTLSConfig returns a shallow clone of cfg, or a new zero tls.Config if
    34  // cfg is nil. This is safe to call even if cfg is in active use by a TLS
    35  // client or server.
    36  //
    37  //go:linkname CloneTLSConfig net/http.cloneTLSConfig
    38  func CloneTLSConfig(cfg *tls.Config) *tls.Config