Documentation
¶
Overview ¶
Package ua builds the fleet User-Agent header value.
Every fleet service should brand its outbound HTTP calls:
client := safehttp.NewClient(safehttp.WithUserAgent(ua.Build(ServiceID, Version)))
This produces "go_myservice/v1.2.3 (+https://github.com/baditaflorin/go_myservice)".
Index ¶
Examples ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Build ¶
Build returns the standard 0crawl branded User-Agent string. Format: "<serviceID>/<version> (+https://github.com/baditaflorin/<serviceID>)"
Example ¶
package main
import (
"fmt"
"github.com/baditaflorin/go-common/ua"
)
func main() {
fmt.Println(ua.Build("go_example", "v1.2.3"))
}
Output: go_example/v1.2.3 (+https://github.com/baditaflorin/go_example)
Types ¶
This section is empty.