1//
2// Copyright (c) 2018, Joyent, Inc. All rights reserved.
3//
4// This Source Code Form is subject to the terms of the Mozilla Public
5// License, v. 2.0. If a copy of the MPL was not distributed with this
6// file, You can obtain one at http://mozilla.org/MPL/2.0/.
7//
8
9package triton
10
11import (
12	"fmt"
13	"runtime"
14)
15
16// Version represents main version number of the current release
17// of the Triton-go SDK.
18const Version = "1.4.0"
19
20// Prerelease adds a pre-release marker to the version.
21//
22// If this is "" (empty string) then it means that it is a final release.
23// Otherwise, this is a pre-release such as "dev" (in development), "beta",
24// "rc1", etc.
25var Prerelease = "dev"
26
27// UserAgent returns a Triton-go characteristic string that allows the
28// network protocol peers to identify the version, release and runtime
29// of the Triton-go client from which the requests originate.
30func UserAgent() string {
31	if Prerelease != "" {
32		return fmt.Sprintf("triton-go/%s-%s (%s-%s; %s)", Version, Prerelease,
33			runtime.GOARCH, runtime.GOOS, runtime.Version())
34	}
35
36	return fmt.Sprintf("triton-go/%s (%s-%s; %s)", Version, runtime.GOARCH,
37		runtime.GOOS, runtime.Version())
38}
39
40// CloudAPIMajorVersion specifies the CloudAPI version compatibility
41// for current release of the Triton-go SDK.
42const CloudAPIMajorVersion = "8"
43