Documentation ¶
Index ¶
- Constants
- Variables
- func NewClient(config *ClientConfig) (*client, error)
- func NewProvider(typeName string, crypto domain.Crypto) *provider
- type ClientConfig
- type Config
- type Credentials
- type DataSource
- type Flow
- type HTTPClient
- type Metric
- type Permission
- type SessionResponse
- type TableauClient
- type UnderlyingView
- type View
- type Workbook
Constants ¶
View Source
const ( ResourceTypeWorkbook = "workbook" ResourceTypeFlow = "flow" ResourceTypeDataSource = "datasource" ResourceTypeView = "view" ResourceTypeMetric = "metric" )
View Source
const (
AccountTypeUser = "user"
)
Variables ¶
View Source
var ( ErrInvalidRole = errors.New("invalid role") ErrInvalidResourceType = errors.New("invalid resource type") ErrUserNotFound = errors.New("cannot find user with the given email") ErrInvalidCredentials = errors.New("invalid credentials type") ErrInvalidPermissionConfig = errors.New("invalid permission config type") ErrUnableToEncryptNilCredentials = errors.New("unable to encrypt nil credentials") ErrUnableToDecryptNilCredentials = errors.New("unable to decrypt nil credentials") )
View Source
var PermissionModes = []string{"Allow", "Deny"}
View Source
var PermissionNames = map[string][]string{
ResourceTypeWorkbook: {"AddComment", "ChangeHierarchy", "ChangePermissions", "Delete", "ExportData", "ExportImage", "ExportXml", "Filter", "Read", "ShareView", "ViewComments", "ViewUnderlyingData", "WebAuthoring", "Write"},
ResourceTypeFlow: {"ChangeHierarchy", "ChangePermissions", "Delete", "Execute", "ExportXml", "Read", "Write"},
ResourceTypeDataSource: {"ChangePermissions", "Connect", "Delete", "ExportXml", "Read", "Write"},
ResourceTypeView: {"AddComment", "ChangePermissions", "Delete", "ExportData", "ExportImage", "ExportXml", "Filter", "Read", "ShareView", "ViewComments", "ViewUnderlyingData", "WebAuthoring", "Write"},
ResourceTypeMetric: {"Delete", "Read", "Write"},
}
View Source
var SiteRolePermissions = []string{
"Creator", "Explorer", "ExplorerCanPublish", "SiteAdministratorExplorer", "SiteAdministratorCreator", "Unlicensed", "Viewer",
}
Functions ¶
func NewClient ¶
func NewClient(config *ClientConfig) (*client, error)
func NewProvider ¶
Types ¶
type ClientConfig ¶
type ClientConfig struct { Host string `validate:"required,url" mapstructure:"host"` Username string `validate:"required" mapstructure:"username"` Password string `validate:"required" mapstructure:"password"` ContentURL string `validate:"required" mapstructure:"content_url"` APIVersion string `mapstructure:"apiVersion" default:"3.12"` HTTPClient HTTPClient }
type Config ¶
type Config struct { ProviderConfig *domain.ProviderConfig // contains filtered or unexported fields }
func (*Config) EncryptCredentials ¶
func (*Config) ParseAndValidate ¶
type Credentials ¶
type Credentials struct { Host string `json:"host" mapstructure:"host" validate:"required,url"` Username string `json:"username" mapstructure:"username" validate:"required"` Password string `json:"password" mapstructure:"password" validate:"required"` ContentURL string `json:"content_url" mapstructure:"content_url" validate:"required"` }
type DataSource ¶
type DataSource struct { Project project `json:"project"` Owner owner `json:"owner"` Tags interface{} `json:"tags"` ID string `json:"id"` Name string `json:"name"` EncryptExtracts string `json:"encryptExtracts"` ContentURL string `json:"contentUrl"` HasExtracts bool `json:"hasExtracts"` IsCertified bool `json:"isCertified"` Type string `json:"type"` UseRemoteQueryAgent bool `json:"useRemoteQueryAgent"` WebpageURL string `json:"webpageUrl"` }
func (*DataSource) FromDomain ¶
func (d *DataSource) FromDomain(r *domain.Resource) error
func (*DataSource) ToDomain ¶
func (d *DataSource) ToDomain() *domain.Resource
type Flow ¶
type Metric ¶
type Metric struct { Project project `json:"project"` Owner owner `json:"owner"` Tags interface{} `json:"tags"` UnderlyingView UnderlyingView `json:"underlyingView"` ID string `json:"id"` Name string `json:"name"` Description string `json:"description"` WebpageURL string `json:"webpageUrl"` Suspended bool `json:"suspended"` }
type Permission ¶
type Permission struct { Name string `json:"name" mapstructure:"name" validate:"required"` Type string `json:"type,omitempty" mapstructure:"type"` }
func (Permission) String ¶
func (p Permission) String() string
type SessionResponse ¶
type SessionResponse struct {
Credentials responseCredentials `json:"credentials"`
}
type TableauClient ¶
type TableauClient interface { GetWorkbooks() ([]*Workbook, error) GetFlows() ([]*Flow, error) GetDataSources() ([]*DataSource, error) GetViews() ([]*View, error) GetMetrics() ([]*Metric, error) UpdateSiteRole(user, role string) error GrantWorkbookAccess(resource *Workbook, user, role string) error RevokeWorkbookAccess(resource *Workbook, user, role string) error GrantFlowAccess(resource *Flow, user, role string) error RevokeFlowAccess(resource *Flow, user, role string) error GrantDataSourceAccess(resource *DataSource, user, role string) error RevokeDataSourceAccess(resource *DataSource, user, role string) error GrantViewAccess(resource *View, user, role string) error RevokeViewAccess(resource *View, user, role string) error GrantMetricAccess(resource *Metric, user, role string) error RevokeMetricAccess(resource *Metric, user, role string) error }
type UnderlyingView ¶
type UnderlyingView struct {
ID string `json:"id"`
}
type View ¶
type Workbook ¶
type Workbook struct { Project project `json:"project"` Owner owner `json:"owner"` Tags interface{} `json:"tags"` DataAccelerationConfig dataAccelerationConfig `json:"dataAccelerationConfig"` ID string `json:"id"` Name string `json:"name"` ContentURL string `json:"contentUrl"` WebpageURL string `json:"webpageUrl"` ShowTabs string `json:"showTabs"` Size string `json:"size"` CreatedAt time.Time `json:"createdAt"` UpdatedAt time.Time `json:"updatedAt"` EncryptExtracts string `json:"encryptExtracts"` DefaultViewID string `json:"defaultViewId"` }
Click to show internal directories.
Click to hide internal directories.