Skip to content

Commit

Permalink
Add more typed functions (ridge#6)
Browse files Browse the repository at this point in the history
crypto/ecdsa.*PrivateKey
crypto/ecdsa.*PublicKey
crypto/ed25519.*PrivateKey
crypto/ed25519.*PublicKey
crypto/rsa.*PrivateKey
crypto/rsa.*PublicKey
crypto/x509.*Certificate
hash.Hash
html/template.*Template
math/big.*Int
net/http.*Response
net/http.*Transport
text/template.*Template
  • Loading branch information
misha-ridge authored Jun 11, 2021
1 parent 659f5a4 commit f3aa966
Show file tree
Hide file tree
Showing 2 changed files with 109 additions and 0 deletions.
22 changes: 22 additions & 0 deletions generator/generator.go
Original file line number Diff line number Diff line change
Expand Up @@ -45,11 +45,20 @@ func main() {
package must
import (
"crypto/ecdsa"
"crypto/ed25519"
"crypto/rsa"
"crypto/x509"
"hash"
htmltemplate "html/template"
"io"
"math/big"
"net"
"net/http"
"net/url"
"os"
texttemplate "text/template"
"time"
)
`)

Expand All @@ -72,6 +81,19 @@ import (
genFunc(fh, "NetListener", "net.Listener")
genFunc(fh, "NetURL", "*url.URL")
genFunc(fh, "HTTPRequest", "*http.Request")
genFunc(fh, "HTTPResponse", "*http.Response")
genFunc(fh, "HTTPHandler", "http.Handler")
genFunc(fh, "HTTPTransport", "*http.Transport")
genFunc(fh, "Time", "time.Time")
genFunc(fh, "HTMLTemplate", "*htmltemplate.Template")
genFunc(fh, "TextTemplate", "*texttemplate.Template")
genFunc(fh, "Hash", "hash.Hash")
genFunc(fh, "BigInt", "*big.Int")
genFunc(fh, "X509Certificate", "*x509.Certificate")
genFunc(fh, "RSAPublicKey", "*rsa.PublicKey")
genFunc(fh, "RSAPrivateKey", "*rsa.PrivateKey")
genFunc(fh, "ECDSAPublicKey", "*ecdsa.PublicKey")
genFunc(fh, "ECDSAPrivateKey", "*ecdsa.PrivateKey")
genFunc(fh, "ED25519PublicKey", "*ed25519.PublicKey")
genFunc(fh, "ED25519PrivateKey", "*ed25519.PrivateKey")
}
87 changes: 87 additions & 0 deletions types_gen.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit f3aa966

Please sign in to comment.