diff options
author | Dimitri Sokolyuk <demon@dim13.org> | 2016-01-18 18:14:04 +0100 |
---|---|---|
committer | Dimitri Sokolyuk <demon@dim13.org> | 2016-01-18 18:14:04 +0100 |
commit | 152cb4632441a2a6971922e508943708a2f4cca8 (patch) | |
tree | c0397bc3c164fd07d4e0dff39cb8d282aade7655 /provider.go | |
parent | 580f70ebc87cb66007f6ebede4ebdb720b198e30 (diff) |
Rename NewProvider into DialProvider
Diffstat (limited to 'provider.go')
-rw-r--r-- | provider.go | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/provider.go b/provider.go index cf54aa4..d160c94 100644 --- a/provider.go +++ b/provider.go @@ -42,8 +42,8 @@ func (p Provider) nonce(resp *http.Response) { } } -// NewProvider fetches directory and initializes nonce -func NewProvider(directory string) (*Provider, error) { +// DialProvider fetches directory and initializes nonce +func DialProvider(directory string) (*Provider, error) { p := &Provider{ nonces: make(chan string, 10), Client: http.Client{ @@ -110,7 +110,7 @@ type nextStep struct { var linksRe = regexp.MustCompile(`^<(.*)>;rel="(.*)"`) -func (p *Provider) parseHeader(resp *http.Response) nextStep { +func parseHeader(resp *http.Response) nextStep { var ns nextStep if lo, _ := resp.Location(); lo != nil { ns.Location = lo.String() @@ -126,7 +126,7 @@ func (p *Provider) parseHeader(resp *http.Response) nextStep { } func (p *Provider) parseJson(resp *http.Response, v interface{}) (nextStep, error) { - ns := p.parseHeader(resp) + ns := parseHeader(resp) defer resp.Body.Close() switch resp.Header.Get("Content-Type") { case "application/problem+json": @@ -139,7 +139,7 @@ func (p *Provider) parseJson(resp *http.Response, v interface{}) (nextStep, erro } func (p *Provider) parseCert(resp *http.Response) (*x509.Certificate, nextStep, error) { - ns := p.parseHeader(resp) + ns := parseHeader(resp) defer resp.Body.Close() switch resp.Header.Get("Content-Type") { case "application/problem+json": |