Versions in this module Expand all Collapse all v0 v0.0.7 Sep 11, 2023 v0.0.6 Jul 8, 2023 Changes in this version + func GenCertificate(dir string) (tls.Certificate, string, error) + func GetCertFingerprint(cert []byte) string + func NewServer(addr string, cert tls.Certificate, handler http.Handler) *http.Server + func UrlPrefix(host string) string + func WithAuth(auth Authorizer, next httprouter.Handle) httprouter.Handle + func WithLogging(next http.Handler) http.Handler + type Authorizer interface + TrustsCert func(fingerprint string) bool + func TrustOneCert(finger string) Authorizer + type AuthorizerFunc func(fingerprint string) bool + func (a AuthorizerFunc) TrustsCert(fingerprint string) bool + type Client struct + func NewClient(cert tls.Certificate, timeout time.Duration, auth Authorizer) *Client + func (c *Client) GET(ctx context.Context, url string) (*http.Response, error) + func (c *Client) POST(ctx context.Context, url string, body io.Reader) (*http.Response, error) + type ErrUntrustedClient struct + Fingerprint string + func (e *ErrUntrustedClient) Error() string + type ErrUntrustedServer struct + Fingerprint string + func (e *ErrUntrustedServer) Error() string