Skip to content

Commit

Permalink
Default API version to 3.17 and allow users to override it.
Browse files Browse the repository at this point in the history
  • Loading branch information
ggreer committed Mar 11, 2024
1 parent cae00d1 commit f6ca213
Show file tree
Hide file tree
Showing 1,197 changed files with 78,346 additions and 45,585 deletions.
2 changes: 2 additions & 0 deletions cmd/baton-tableau/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ type config struct {
AccessTokenSecret string `mapstructure:"access-token-secret"`
ServerPath string `mapstructure:"server-path"`
SiteID string `mapstructure:"site-id"`
APIVersion string `mapstructure:"api-version"`
}

// validateConfig is run after the configuration is loaded, and should return an error if it isn't valid.
Expand All @@ -40,4 +41,5 @@ func cmdFlags(cmd *cobra.Command) {
cmd.PersistentFlags().String("access-token-secret", "", "Secret of the personal access token used to connect to the Tableau API. ($BATON_ACCESS_TOKEN_SECRET)")
cmd.PersistentFlags().String("server-path", "", "Base url of your server or Tableau Cloud. ($BATON_SERVER_PATH)")
cmd.PersistentFlags().String("site-id", "", "On server it's referred as Site ID, on cloud it appears after /site/ in the Browser address bar. ($BATON_SITE_ID)")
cmd.PersistentFlags().String("api-version", "3.17", "API version of your server or Tableau Cloud. ($BATON_API_VERSION)")
}
7 changes: 6 additions & 1 deletion cmd/baton-tableau/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,12 @@ func main() {

func getConnector(ctx context.Context, cfg *config) (types.ConnectorServer, error) {
l := ctxzap.Extract(ctx)
baseUrl, err := url.JoinPath("https://", cfg.ServerPath, "/api/3.19")

apiVersion := "3.17"
if cfg.APIVersion != "" {
apiVersion = cfg.APIVersion
}
baseUrl, err := url.JoinPath("https://", cfg.ServerPath, "api", apiVersion)
if err != nil {
l.Error("error creating base url", zap.Error(err))
}
Expand Down
2 changes: 2 additions & 0 deletions vendor/filippo.io/age/.gitattributes

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 6 additions & 0 deletions vendor/filippo.io/age/AUTHORS

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

27 changes: 27 additions & 0 deletions vendor/filippo.io/age/LICENSE

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

251 changes: 251 additions & 0 deletions vendor/filippo.io/age/README.md

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading

0 comments on commit f6ca213

Please sign in to comment.