mirror of
https://github.com/go-acme/lego.git
synced 2025-01-03 15:23:32 +02:00
37 lines
906 B
Go
37 lines
906 B
Go
package main
|
|
|
|
const dnsBaseUserAgent = "goacme-lego/"
|
|
|
|
const dnsSourceFile = "./providers/dns/internal/useragent/useragent.go"
|
|
|
|
const dnsTemplate = `// Code generated by 'internal/useragent'; DO NOT EDIT.
|
|
|
|
package useragent
|
|
|
|
import (
|
|
"fmt"
|
|
"net/http"
|
|
"runtime"
|
|
)
|
|
|
|
const (
|
|
// ourUserAgent is the User-Agent of this underlying library package.
|
|
ourUserAgent = "goacme-lego/{{ .version }}"
|
|
|
|
// ourUserAgentComment is part of the UA comment linked to the version status of this underlying library package.
|
|
// values: detach|release
|
|
// NOTE: Update this with each tagged release.
|
|
ourUserAgentComment = "{{ .comment }}"
|
|
)
|
|
|
|
// Get builds and returns the User-Agent string.
|
|
func Get() string {
|
|
return fmt.Sprintf("%s (%s; %s; %s)", ourUserAgent, ourUserAgentComment, runtime.GOOS, runtime.GOARCH)
|
|
}
|
|
|
|
// SetHeader sets the User-Agent header.
|
|
func SetHeader(h http.Header) {
|
|
h.Set("User-Agent", Get())
|
|
}
|
|
`
|