aboutsummaryrefslogtreecommitdiffhomepage
path: root/vendor/golang.org/x/crypto/acme/autocert/example_test.go
diff options
context:
space:
mode:
Diffstat (limited to 'vendor/golang.org/x/crypto/acme/autocert/example_test.go')
-rw-r--r--vendor/golang.org/x/crypto/acme/autocert/example_test.go36
1 files changed, 0 insertions, 36 deletions
diff --git a/vendor/golang.org/x/crypto/acme/autocert/example_test.go b/vendor/golang.org/x/crypto/acme/autocert/example_test.go
deleted file mode 100644
index 552a625..0000000
--- a/vendor/golang.org/x/crypto/acme/autocert/example_test.go
+++ /dev/null
@@ -1,36 +0,0 @@
-// Copyright 2017 The Go Authors. All rights reserved.
-// Use of this source code is governed by a BSD-style
-// license that can be found in the LICENSE file.
-
-package autocert_test
-
-import (
- "crypto/tls"
- "fmt"
- "log"
- "net/http"
-
- "golang.org/x/crypto/acme/autocert"
-)
-
-func ExampleNewListener() {
- mux := http.NewServeMux()
- mux.HandleFunc("/", func(w http.ResponseWriter, r *http.Request) {
- fmt.Fprintf(w, "Hello, TLS user! Your config: %+v", r.TLS)
- })
- log.Fatal(http.Serve(autocert.NewListener("example.com"), mux))
-}
-
-func ExampleManager() {
- m := &autocert.Manager{
- Cache: autocert.DirCache("secret-dir"),
- Prompt: autocert.AcceptTOS,
- HostPolicy: autocert.HostWhitelist("example.org"),
- }
- go http.ListenAndServe(":http", m.HTTPHandler(nil))
- s := &http.Server{
- Addr: ":https",
- TLSConfig: &tls.Config{GetCertificate: m.GetCertificate},
- }
- s.ListenAndServeTLS("", "")
-}