From 4b643523fb11ca87aa22968f94017e184a25a6fa Mon Sep 17 00:00:00 2001 From: Adnan Maolood Date: Thu, 14 Jan 2021 21:23:13 -0500 Subject: [PATCH] Update examples --- examples/auth.go | 3 ++- examples/cert.go | 8 ++++---- examples/server.go | 3 ++- examples/stream.go | 3 ++- 4 files changed, 10 insertions(+), 7 deletions(-) diff --git a/examples/auth.go b/examples/auth.go index 1df0c79..228f975 100644 --- a/examples/auth.go +++ b/examples/auth.go @@ -12,6 +12,7 @@ import ( "time" "git.sr.ht/~adnano/go-gemini" + "git.sr.ht/~adnano/go-gemini/certificate" ) type User struct { @@ -33,7 +34,7 @@ func main() { log.Fatal(err) } server.CreateCertificate = func(hostname string) (tls.Certificate, error) { - return gemini.CreateCertificate(gemini.CertificateOptions{ + return certificate.Create(certificate.CreateOptions{ Subject: pkix.Name{ CommonName: hostname, }, diff --git a/examples/cert.go b/examples/cert.go index 8f2c31b..91a4be0 100644 --- a/examples/cert.go +++ b/examples/cert.go @@ -11,7 +11,7 @@ import ( "os" "time" - "git.sr.ht/~adnano/go-gemini" + "git.sr.ht/~adnano/go-gemini/certificate" ) func main() { @@ -24,20 +24,20 @@ func main() { if err != nil { log.Fatal(err) } - options := gemini.CertificateOptions{ + options := certificate.CreateOptions{ Subject: pkix.Name{ CommonName: host, }, DNSNames: []string{host}, Duration: duration, } - cert, err := gemini.CreateCertificate(options) + cert, err := certificate.Create(options) if err != nil { log.Fatal(err) } certPath := host + ".crt" keyPath := host + ".key" - if err := gemini.WriteCertificate(cert, certPath, keyPath); err != nil { + if err := certificate.Write(cert, certPath, keyPath); err != nil { log.Fatal(err) } } diff --git a/examples/server.go b/examples/server.go index 795495a..21b6da4 100644 --- a/examples/server.go +++ b/examples/server.go @@ -11,6 +11,7 @@ import ( "time" "git.sr.ht/~adnano/go-gemini" + "git.sr.ht/~adnano/go-gemini/certificate" ) func main() { @@ -21,7 +22,7 @@ func main() { log.Fatal(err) } server.CreateCertificate = func(hostname string) (tls.Certificate, error) { - return gemini.CreateCertificate(gemini.CertificateOptions{ + return certificate.Create(certificate.CreateOptions{ Subject: pkix.Name{ CommonName: hostname, }, diff --git a/examples/stream.go b/examples/stream.go index 56651c9..522205c 100644 --- a/examples/stream.go +++ b/examples/stream.go @@ -13,6 +13,7 @@ import ( "time" "git.sr.ht/~adnano/go-gemini" + "git.sr.ht/~adnano/go-gemini/certificate" ) func main() { @@ -21,7 +22,7 @@ func main() { log.Fatal(err) } server.CreateCertificate = func(hostname string) (tls.Certificate, error) { - return gemini.CreateCertificate(gemini.CertificateOptions{ + return certificate.Create(certificate.CreateOptions{ Subject: pkix.Name{ CommonName: hostname, },