tableau4go

package module
v0.0.0-...-76c2244 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Aug 10, 2022 License: Apache-2.0 Imports: 16 Imported by: 0

Documentation

Index

Constants

View Source
const ApiVersion = "2.0"
View Source
const BoundaryString = "813e3160-3c95-11e5-a151-feff819cdc9f"
View Source
const DELETE = "DELETE"
View Source
const GET = "GET"
View Source
const PAGESIZE = 100
View Source
const POST = "POST"

Variables

This section is empty.

Functions

func ConvertSiteNameToContentUrl

func ConvertSiteNameToContentUrl(siteName string) string

helper method to convert to contentUrl as most api methods use this

func DefaultTimeoutClient

func DefaultTimeoutClient() *http.Client

func NewTimeoutClient

func NewTimeoutClient(cTimeout time.Duration, rwTimeout time.Duration, useClientCerts bool) *http.Client

apps will set two OS variables: atscale_http_sslcert - location of the http ssl cert atscale_http_sslkey - location of the http ssl key

Types

type API

type API struct {
	Server              string
	Version             string
	Boundary            string
	AuthToken           string
	OmitDefaultSiteName bool
	DefaultSiteName     string
	ConnectTimeout      time.Duration
	ReadTimeout         time.Duration
	Debug               bool
}

func NewAPI

func NewAPI(server string, version string, boundary string, defaultSiteName string, omitDefaultSiteName bool, cTimeout, rTimeout time.Duration) API

func (*API) GetDatasourceContentXML

func (api *API) GetDatasourceContentXML(siteId, tableauProjectId, datasourceName string) (string, error)

assumption is that the intersection of site, project, and datasource name is unique

func (*API) GetProjectByID

func (api *API) GetProjectByID(siteId, id string) (Project, error)

func (*API) GetProjectByName

func (api *API) GetProjectByName(siteId, name string) (Project, error)

func (*API) GetSite

func (api *API) GetSite(siteName string) (Site, error)

use this method to easily get the site by name

func (*API) GetSiteID

func (api *API) GetSiteID(siteName string) (string, error)

func (*API) QueryProjects

func (api *API) QueryProjects(siteId string) ([]Project, error)

type AuthResponse

type AuthResponse struct {
	Credentials *Credentials `json:"credentials,omitempty" xml:"credentials,omitempty"`
}

type ConnectionCredentials

type ConnectionCredentials struct {
	Name     string `json:"name,omitempty" xml:"name,attr,omitempty"`
	Password string `json:"password,omitempty" xml:"password,attr,omitempty"`
	Embed    bool   `json:"embed" xml:"embed,attr"`
}

func NewConnectionCredentials

func NewConnectionCredentials(name, password string, embed bool) ConnectionCredentials

type CreateProjectRequest

type CreateProjectRequest struct {
	Request Project `json:"project,omitempty" xml:"project,omitempty"`
}

func (CreateProjectRequest) XML

func (req CreateProjectRequest) XML() ([]byte, error)

type CreateProjectResponse

type CreateProjectResponse struct {
	Project Project `json:"project,omitempty" xml:"project,omitempty"`
}

type Credentials

type Credentials struct {
	Name        string `json:"name,omitempty" xml:"name,attr,omitempty"`
	Password    string `json:"password,omitempty" xml:"password,attr,omitempty"`
	Token       string `json:"token,omitempty" xml:"token,attr,omitempty"`
	Site        *Site  `json:"site,omitempty" xml:"site,omitempty"`
	Impersonate *User  `json:"user,omitempty" xml:"user,omitempty"`
}

type Datasource

type Datasource struct {
	ID                    string                 `json:"id,omitempty" xml:"id,attr,omitempty"`
	Name                  string                 `json:"name,omitempty" xml:"name,attr,omitempty"`
	Type                  string                 `json:"type,omitempty" xml:"type,attr,omitempty"`
	ConnectionCredentials *ConnectionCredentials `json:"connectionCredentials,omitempty" xml:"connectionCredentials,omitempty"`
	Project               *Project               `json:"project,omitempty" xml:"project,omitempty"`
	Owner                 *User                  `json:"owner,omitempty" xml:"owner,omitempty"`
}

func (*Datasource) XML

func (ds *Datasource) XML() ([]byte, error)

type DatasourceCreateRequest

type DatasourceCreateRequest struct {
	Request Datasource `json:"datasource,omitempty" xml:"datasource,omitempty"`
}

func (DatasourceCreateRequest) XML

func (req DatasourceCreateRequest) XML() ([]byte, error)

type Datasources

type Datasources struct {
	Datasources []Datasource `json:"datasource,omitempty" xml:"datasource,omitempty"`
}

type ErrorResponse

type ErrorResponse struct {
	Error TError `json:"error,omitempty" xml:"error,omitempty"`
}

type Pagination

type Pagination struct {
	PageNumber     int `json:"pageNumber,omitempty" xml:"pageNumber,attr,omitempty"`
	PageSize       int `json:"pageSize,omitempty" xml:"pageSize,attr,omitempty"`
	TotalAvailable int `json:"totalAvailable,omitempty" xml:"totalAvailable,attr,omitempty"`
}

type Project

type Project struct {
	ID          string `json:"id,omitempty" xml:"id,attr,omitempty"`
	Name        string `json:"name,omitempty" xml:"name,attr,omitempty"`
	Description string `json:"description,omitempty" xml:"description,attr,omitempty"`
}

func NewProject

func NewProject(id string, name string, description string) Project

func (Project) XML

func (p Project) XML() ([]byte, error)

type ProjectByName

type ProjectByName []Project

for sorting by tableau project name

func (ProjectByName) Len

func (a ProjectByName) Len() int

func (ProjectByName) Less

func (a ProjectByName) Less(i, j int) bool

func (ProjectByName) Swap

func (a ProjectByName) Swap(i, j int)

type Projects

type Projects struct {
	Projects []Project `json:"project,omitempty" xml:"project,omitempty"`
}

type QueryDatasourceResponseRawXML

type QueryDatasourceResponseRawXML struct {
	Datasource string `xml:",innerxml"`
}

type QueryDatasourcesResponse

type QueryDatasourcesResponse struct {
	Datasources Datasources `json:"datasources,omitempty" xml:"datasources,omitempty"`
}

type QueryProjectsResponse

type QueryProjectsResponse struct {
	Pagination Pagination `json:"pagination,omitempty" xml:"pagination,omitempty"`
	Projects   Projects   `json:"projects,omitempty" xml:"projects,omitempty"`
}

type QuerySiteResponse

type QuerySiteResponse struct {
	Site Site `json:"site,omitempty" xml:"site,omitempty"`
}

func (QuerySiteResponse) XML

func (req QuerySiteResponse) XML() ([]byte, error)

type QuerySitesResponse

type QuerySitesResponse struct {
	Sites Sites `json:"sites,omitempty" xml:"sites,omitempty"`
}

func (QuerySitesResponse) XML

func (req QuerySitesResponse) XML() ([]byte, error)

type QueryUserOnSiteResponse

type QueryUserOnSiteResponse struct {
	User User `json:"user,omitempty" xml:"user,omitempty"`
}

func (QueryUserOnSiteResponse) XML

func (req QueryUserOnSiteResponse) XML() ([]byte, error)

type ServerInfo

type ServerInfo struct {
	ProductVersion string `json:"productVersion,omitempty" xml:"productVersion,omitempty"`
	RestApiVersion string `json:"restApiVersion,omitempty" xml:"restApiVersion,omitempty"`
}

type ServerInfoResponse

type ServerInfoResponse struct {
	ServerInfo ServerInfo `json:"serverInfo,omitempty" xml:"serverInfo,omitempty"`
}

type SigninRequest

type SigninRequest struct {
	Request Credentials `json:"credentials,omitempty" xml:"credentials,omitempty"`
}

func (SigninRequest) XML

func (req SigninRequest) XML() ([]byte, error)

type Site

type Site struct {
	ID           string     `json:"id,omitempty" xml:"id,attr,omitempty"`
	Name         string     `json:"name,omitempty" xml:"name,attr,omitempty"`
	ContentUrl   string     `json:"contentUrl,omitempty" xml:"contentUrl,attr,omitempty"`
	AdminMode    string     `json:"adminMode,omitempty" xml:"adminMode,attr,omitempty"`
	UserQuota    string     `json:"userQuota,omitempty" xml:"userQuota,attr,omitempty"`
	StorageQuota int        `json:"storageQuota,omitempty" xml:"storageQuota,attr,omitempty"`
	State        string     `json:"state,omitempty" xml:"state,attr,omitempty"`
	StatusReason string     `json:"statusReason,omitempty" xml:"statusReason,attr,omitempty"`
	Usage        *SiteUsage `json:"usage,omitempty" xml:"usage,omitempty"`
}

type SiteUsage

type SiteUsage struct {
	//nolint:tagliatelle // can't change old json fields that are not camel-cased
	NumberOfUsers int `json:"number-of-users" xml:"number-of-users,attr"`
	Storage       int `json:"storage" xml:"storage,attr"`
}

type Sites

type Sites struct {
	Sites []Site `json:"sites" xml:"sites,attr"`
}

type StatusError

type StatusError struct {
	Code int
	Msg  string
	URL  string
}

func (*StatusError) Error

func (e *StatusError) Error() string

type TError

type TError struct {
	Code    string `json:"code,omitempty" xml:"code,attr,omitempty"`
	Summary string `json:"summary,omitempty" xml:"summary,omitempty"`
	Detail  string `json:"detail,omitempty" xml:"detail,omitempty"`
}

func (TError) Error

func (t TError) Error() string

type User

type User struct {
	ID       string `json:"id,omitempty" xml:"id,attr,omitempty"`
	Name     string `json:"name,omitempty" xml:"name,attr,omitempty"`
	SiteRole string `json:"siteRole,omitempty" xml:"siteRole,attr,omitempty"`
	FullName string `json:"fullName,omitempty" xml:"fullName,attr,omitempty"`
}

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL