Skip to content
This repository has been archived by the owner on Mar 12, 2021. It is now read-only.

Commit

Permalink
Default Version is set when version is not provided (#12)
Browse files Browse the repository at this point in the history
  • Loading branch information
bgokden authored Apr 9, 2019
1 parent 0048470 commit 383aa12
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 1 deletion.
7 changes: 7 additions & 0 deletions client/client.go
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ import (
"time"

"github.com/ghodss/yaml"
"github.com/magneticio/vampkubistcli/logging"
"github.com/magneticio/vampkubistcli/models"
"gopkg.in/resty.v1"
)
Expand Down Expand Up @@ -95,8 +96,14 @@ type authSuccess struct {
RefreshToken string `json:"refresh_token"`
}

const defaultVersion = "v1"

func NewRestClient(url string, token string, version string, isVerbose bool, cert string) *restClient {
resty.SetDebug(isVerbose)
if version == "" {
logging.Info("Using Default Version for client: %s\n", defaultVersion)
version = defaultVersion
}
if cert != "" {
// Create our Temp File: This will create a filename like /tmp/prefix-123456
// We can use a pattern of "pre-*.txt" to get an extension like: /tmp/pre-123456.txt
Expand Down
2 changes: 1 addition & 1 deletion cmd/root.go
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ var OutputType string
var Hosts []string

// version should be in format d.d.d where d is a decimal number
const Version string = "0.0.20"
const Version string = "0.0.21"
const AppName string = "vamp"

// Backend version is the version this client is tested with
Expand Down

0 comments on commit 383aa12

Please sign in to comment.