client: define default version as a constant

This commit is contained in:
Michael Marineau 2017-06-02 17:10:27 -07:00
parent d40844181a
commit c9e5a6a602
2 changed files with 6 additions and 2 deletions

View file

@ -25,6 +25,10 @@ import (
"github.com/coreos/go-omaha/omaha" "github.com/coreos/go-omaha/omaha"
) )
const (
defaultClientVersion = "go-omaha"
)
// Client supports managing multiple apps using a single server. // Client supports managing multiple apps using a single server.
type Client struct { type Client struct {
apiClient *httpClient apiClient *httpClient
@ -53,7 +57,7 @@ func New(serverURL, userID string) (*Client, error) {
c := &Client{ c := &Client{
apiClient: newHTTPClient(), apiClient: newHTTPClient(),
clientVersion: "go-omaha", clientVersion: defaultClientVersion,
userID: userID, userID: userID,
sessionID: uuid.NewV4().String(), sessionID: uuid.NewV4().String(),
apps: make(map[string]*AppClient), apps: make(map[string]*AppClient),

View file

@ -60,7 +60,7 @@ func NewMachineClient(serverURL string) (*Client, error) {
c := &Client{ c := &Client{
apiClient: newHTTPClient(), apiClient: newHTTPClient(),
clientVersion: "go-omaha", clientVersion: defaultClientVersion,
userID: string(machineID), userID: string(machineID),
sessionID: string(bootID), sessionID: string(bootID),
isMachine: true, isMachine: true,