Documentation
¶
Index ¶
- type APIClient
- func (c *APIClient) AddCardToDashboard(dashboardId int, cardId int) (OrderedCard, error)
- func (c *APIClient) CreateCard(name string, description *string, collectionId *CollectionId, ...) (*Card, error)
- func (c *APIClient) CreateCollection(name string, description *string, color *string, parent_id *CollectionId, ...) (*Collection, error)
- func (c *APIClient) CreateDashboard(name string, description *string, collectionId *CollectionId, ...) (*Dashboard, error)
- func (c *APIClient) CreateSnippet(snippet *Snippet) (*Snippet, error)
- func (c *APIClient) EnableEmbedding(enable bool) error
- func (c *APIClient) GetAllCards(filter *string) ([]Card, error)
- func (c *APIClient) GetAllCollections(isArchived *bool, namespace *string) ([]Collection, error)
- func (c *APIClient) GetAllDashboards(filter *string) ([]Dashboard, error)
- func (c *APIClient) GetAllDatabases(includeTables bool, includeSavedQuestions bool) ([]Database, error)
- func (c *APIClient) GetCollectionItems(id int, model *string, isArchived *bool) ([]CollectionItem, error)
- func (c *APIClient) GetDatabase(id int, includeTables bool, includeTableFields bool) (*Database, error)
- func (c *APIClient) GetSessionProperties() (*SessionProperties, error)
- func (c *APIClient) GetTableMetadata(tableId int, includeHiddenFields bool, includeSensitiveFields bool) (TableWithMetadata, error)
- func (c *APIClient) HealthCheck() error
- func (c *APIClient) Login(username string, password string, saveToken bool) (string, error)
- func (c *APIClient) RandomToken() (string, error)
- func (c *APIClient) SetEmbeddingToken(token string) error
- func (c *APIClient) SetupInstance(body *InstanceSetup, saveToken bool) (string, error)
- func (c *APIClient) SyncSchema(databaseId int) error
- func (c *APIClient) UpdateCollection(collectionID CollectionId, description *string, color *string, ...) (*Collection, error)
- func (c *APIClient) UpdateDashboard(dashboardId int, dashboardOptions ...DashboardOption) (*Dashboard, error)
- func (c *APIClient) UpdateDashboardCards(dashboardId int, orderedCards ...OrderedCard) error
- func (c *APIClient) UpdateSetting(key string, value interface{}) error
- func (c *APIClient) WithDefaultHeader(key string, val string) *APIClient
- func (c *APIClient) WithSessionToken(token string) *APIClient
- type APIError
- type Card
- type CardOption
- func AllowCardEmbedding() CardOption
- func NativeQuery(databaseId int, query string, templateTags map[string]interface{}) CardOption
- func SetDisplay(display string, settings map[string]interface{}) CardOption
- func SetDisplayAsLine(settings *LineVisualizationSetting) CardOption
- func SetDisplayAsScalar() CardOption
- func SetVisualizationSettings(settings map[string]interface{}) CardOption
- type Collection
- type CollectionId
- type CollectionItem
- type CommonFields
- type Dashboard
- type DashboardOption
- type Database
- type DbEngineSetup
- type ErrorCode
- type FilterParams
- type InstanceSetup
- type LineVisualizationSetting
- type OrderedCard
- type ParamMapping
- type PrefSetup
- type SessionProperties
- type Snippet
- type Table
- type TableField
- type TableWithMetadata
- type UserSetup
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type APIClient ¶
type APIClient struct { BasePath string `json:"basePath,omitempty"` // contains filtered or unexported fields }
func NewAPIClient ¶
func (*APIClient) AddCardToDashboard ¶
func (c *APIClient) AddCardToDashboard( dashboardId int, cardId int, ) (OrderedCard, error)
func (*APIClient) CreateCard ¶
func (c *APIClient) CreateCard( name string, description *string, collectionId *CollectionId, cardOptions ...CardOption) (*Card, error)
func (*APIClient) CreateCollection ¶
func (c *APIClient) CreateCollection( name string, description *string, color *string, parent_id *CollectionId, namespace *string, ) (*Collection, error)
func (*APIClient) CreateDashboard ¶
func (c *APIClient) CreateDashboard( name string, description *string, collectionId *CollectionId, collectionPosition *int, parameters []FilterParams, ) (*Dashboard, error)
func (*APIClient) CreateSnippet ¶
func (*APIClient) EnableEmbedding ¶
func (*APIClient) GetAllCollections ¶
func (c *APIClient) GetAllCollections(isArchived *bool, namespace *string) ([]Collection, error)
func (*APIClient) GetAllDashboards ¶
func (*APIClient) GetAllDatabases ¶
func (*APIClient) GetCollectionItems ¶
func (*APIClient) GetDatabase ¶
func (*APIClient) GetSessionProperties ¶
func (c *APIClient) GetSessionProperties() (*SessionProperties, error)
func (*APIClient) GetTableMetadata ¶
func (*APIClient) HealthCheck ¶
func (*APIClient) RandomToken ¶
func (*APIClient) SetEmbeddingToken ¶
func (*APIClient) SetupInstance ¶
func (c *APIClient) SetupInstance(body *InstanceSetup, saveToken bool) (string, error)
func (*APIClient) SyncSchema ¶
func (*APIClient) UpdateCollection ¶
func (c *APIClient) UpdateCollection( collectionID CollectionId, description *string, color *string, parentId *CollectionId, namespace *string, archived *bool, ) (*Collection, error)
func (*APIClient) UpdateDashboard ¶
func (c *APIClient) UpdateDashboard( dashboardId int, dashboardOptions ...DashboardOption, ) (*Dashboard, error)
func (*APIClient) UpdateDashboardCards ¶
func (c *APIClient) UpdateDashboardCards( dashboardId int, orderedCards ...OrderedCard, ) error
func (*APIClient) UpdateSetting ¶
func (*APIClient) WithDefaultHeader ¶
func (*APIClient) WithSessionToken ¶
type Card ¶
type Card struct { CommonFields Display string `json:"display"` CollectionId *CollectionId `json:"collection_id"` VisualizationSetting visualizationSettings `json:"visualization_settings"` DatabaseQuery datasetQuery `json:"dataset_query"` Archived *bool `json:"archived,omitempty"` EnableEmbedding *bool `json:"enable_embedding,omitempty"` }
type CardOption ¶
func AllowCardEmbedding ¶
func AllowCardEmbedding() CardOption
func NativeQuery ¶
func NativeQuery(databaseId int, query string, templateTags map[string]interface{}) CardOption
func SetDisplay ¶
func SetDisplay(display string, settings map[string]interface{}) CardOption
func SetDisplayAsLine ¶
func SetDisplayAsLine(settings *LineVisualizationSetting) CardOption
func SetDisplayAsScalar ¶
func SetDisplayAsScalar() CardOption
func SetVisualizationSettings ¶
func SetVisualizationSettings(settings map[string]interface{}) CardOption
type Collection ¶
type Collection struct { Id CollectionId `json:"id,omitempty"` Name string `json:"name,omitempty"` Color *string `json:"color,omitempty"` Description *string `json:"description,omitempty"` Namespace *string `json:"namespace,omitempty"` Archived *bool `json:"archived,omitempty"` ParentId *CollectionId `json:"parent_id,omitempty"` }
func (*Collection) GetUrl ¶
func (c *Collection) GetUrl() string
type CollectionId ¶
type CollectionId struct {
// contains filtered or unexported fields
}
func (*CollectionId) Int ¶
func (c *CollectionId) Int() int
func (CollectionId) MarshalJSON ¶
func (c CollectionId) MarshalJSON() ([]byte, error)
func (*CollectionId) UnmarshalJSON ¶
func (c *CollectionId) UnmarshalJSON(b []byte) error
type CollectionItem ¶
type CommonFields ¶
type Dashboard ¶
type Dashboard struct { CommonFields CollectionId *CollectionId `json:"collection_id,omitempty"` CollectionPoisition *int `json:"collection_position,omitempty"` OrderedCards []OrderedCard `json:"ordered_cards"` Archived *bool `json:"archived,omitempty"` CanWrite *bool `json:"can_write,omitempty"` EnableEmbedding *bool `json:"enable_embedding,omitempty"` EmbeddingParams map[string]interface{} `json:"embedding_params,omitempty"` CreatorID *int `json:"creator_id,omitempty"` ParamFields map[string]interface{} `json:"param_fields,omitempty"` ParamValues interface{} `json:"param_values,omitempty"` Parameters []FilterParams `json:"parameters,omitempty"` }
type DashboardOption ¶
func ToggleDashboardEmbedding ¶
func ToggleDashboardEmbedding(enable bool, params map[string]interface{}) DashboardOption
func WithParameter ¶
func WithParameter( param FilterParams, ) DashboardOption
type Database ¶
type Database struct { CommonFields Timezone string `json:"timezone"` AutoRunQueries *bool `json:"auto_run_queries"` IsFullSync *bool `json:"is_full_sync"` Details map[string]interface{} `json:"details"` Engine string `json:"engine"` Tables []Table `json:"tables"` Features []string `json:"features"` }
type DbEngineSetup ¶
type FilterParams ¶
type FilterParams struct { Id string `json:"id"` Name string `json:"name"` Slug string `json:"slug"` Type string `json:"type"` Default *string `json:"default,omitempty"` }
func MakeFilterParam ¶
func MakeFilterParam(name string, type_ string, default_ *string) FilterParams
type InstanceSetup ¶
type InstanceSetup struct { User UserSetup `json:"user"` Token string `json:"token"` Database DbEngineSetup `json:"database"` Pref PrefSetup `json:"prefs"` }
type LineVisualizationSetting ¶
type LineVisualizationSetting struct { Dimension []string `mapstructure:"graph.dimensions,omitempty"` Metrics []string `mapstructure:"graph.metrics,omitempty"` XAxis string `mapstructure:"graph.x_axis.title_text,omitempty"` YAxis string `mapstructure:"graph.y_axis.title_text,omitempty"` PivotColumn string `mapstructure:"table.pivot_column,omitempty"` CellColumn string `mapstructure:"table.cell_column,omitempty"` SeriesSetting seriesSettings `mapstructure:"series_settings,omitempty"` }
type OrderedCard ¶
type OrderedCard struct { CommonFields CardId int `json:"card_id"` DashboardId int `json:"dashboard_id"` SizeX int `json:"sizeX"` SizeY int `json:"sizeY"` Row int `json:"row"` Column int `json:"col"` Series []interface{} `json:"series"` ParameterMappings []ParamMapping `json:"parameter_mappings"` VisualizationSettings map[string]interface{} `json:"visualization_settings"` }
type ParamMapping ¶
type SessionProperties ¶
type SessionProperties struct { GACode string `json:"ga-code"` SiteLocale string `json:"en"` ApplicationName string `json:"application-name"` SiteUrl string `json:"site-url"` EnablePasswordLogin bool `json:"enable-password-login"` SetupToken string `json:"setup-token"` EmbeddingSecretKey string `json:"embedding-secret-key"` EnableEmbedding bool `json:"enable-embedding"` ShowHomePageXRays bool `json:"show-homepage-xrays"` }
type TableField ¶
type TableField struct { CommonFields DatabaseType string `json:"database_type"` TableID int `json:"table_id"` SpecialType *string `json:"special_type"` FingerprintVersion int `json:"fingerprint_version"` HasFieldValues string `json:"has_field_values"` FkTargetFieldID *int `json:"fk_target_field_id"` Dimensions []string `json:"dimensions"` DimensionOptions []string `json:"dimension_options"` CustomPosition *int `json:"custom_position"` Active bool `json:"active"` ParentID *int `json:"parent_id"` LastAnalyzed *string `json:"last_analyzed"` Position *int `json:"position"` VisibilityType *string `json:"visibility_type"` DefaultDimensionOption *string `json:"default_dimension_option"` PreviewDisplay bool `json:"preview_display"` DisplayName string `json:"display_name"` DatabasePosition int `json:"database_position"` Fingerprint map[string]interface{} `json:"fingerprint"` BaseType *string `json:"base_type"` }
type TableWithMetadata ¶
type TableWithMetadata struct { Table Fields []TableField `json:"fields"` }
Click to show internal directories.
Click to hide internal directories.