2018-02-12 23:22:41 +00:00
|
|
|
//
|
|
|
|
// Copyright (c) 2018, Joyent, Inc. All rights reserved.
|
|
|
|
//
|
|
|
|
// This Source Code Form is subject to the terms of the Mozilla Public
|
|
|
|
// License, v. 2.0. If a copy of the MPL was not distributed with this
|
|
|
|
// file, You can obtain one at http://mozilla.org/MPL/2.0/.
|
|
|
|
//
|
|
|
|
|
|
|
|
package triton
|
|
|
|
|
|
|
|
import (
|
|
|
|
"fmt"
|
|
|
|
"runtime"
|
|
|
|
)
|
|
|
|
|
2018-02-12 23:27:18 +00:00
|
|
|
// Version represents main version number of the current release
|
|
|
|
// of the Triton-go SDK.
|
2018-07-06 16:09:34 +00:00
|
|
|
const Version = "1.4.0"
|
2018-02-12 23:22:41 +00:00
|
|
|
|
2018-02-12 23:27:18 +00:00
|
|
|
// Prerelease adds a pre-release marker to the version.
|
|
|
|
//
|
|
|
|
// If this is "" (empty string) then it means that it is a final release.
|
|
|
|
// Otherwise, this is a pre-release such as "dev" (in development), "beta",
|
|
|
|
// "rc1", etc.
|
|
|
|
var Prerelease = "dev"
|
2018-02-12 23:22:41 +00:00
|
|
|
|
2018-02-12 23:27:18 +00:00
|
|
|
// UserAgent returns a Triton-go characteristic string that allows the
|
|
|
|
// network protocol peers to identify the version, release and runtime
|
|
|
|
// of the Triton-go client from which the requests originate.
|
2018-02-12 23:22:41 +00:00
|
|
|
func UserAgent() string {
|
|
|
|
if Prerelease != "" {
|
2018-02-12 23:27:18 +00:00
|
|
|
return fmt.Sprintf("triton-go/%s-%s (%s-%s; %s)", Version, Prerelease,
|
|
|
|
runtime.GOARCH, runtime.GOOS, runtime.Version())
|
2018-02-12 23:22:41 +00:00
|
|
|
}
|
2018-02-12 23:27:18 +00:00
|
|
|
|
|
|
|
return fmt.Sprintf("triton-go/%s (%s-%s; %s)", Version, runtime.GOARCH,
|
|
|
|
runtime.GOOS, runtime.Version())
|
2018-02-12 23:22:41 +00:00
|
|
|
}
|
|
|
|
|
2018-02-12 23:27:18 +00:00
|
|
|
// CloudAPIMajorVersion specifies the CloudAPI version compatibility
|
|
|
|
// for current release of the Triton-go SDK.
|
2018-02-12 23:22:41 +00:00
|
|
|
const CloudAPIMajorVersion = "8"
|