metabase

package
v0.0.0-...-b508d79 Latest Latest
Warning

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

Go to latest
Published: Apr 29, 2024 License: MIT Imports: 26 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func MarshalUUID

func MarshalUUID(id uuid.UUID) string

Types

type Client

type Client struct {
	// contains filtered or unexported fields
}

func NewClient

func NewClient(url, username, password, oauth2ClientID, oauth2ClientSecret, oauth2TenantID string) *Client

func (*Client) AddPermissionGroupMember

func (c *Client) AddPermissionGroupMember(ctx context.Context, groupID int, email string) error

func (*Client) ArchiveCollection

func (c *Client) ArchiveCollection(ctx context.Context, colID int) error

func (*Client) AutoMapSemanticTypes

func (c *Client) AutoMapSemanticTypes(ctx context.Context, dbID int) error

func (*Client) CreateCollection

func (c *Client) CreateCollection(ctx context.Context, name string) (int, error)

func (*Client) CreateCollectionWithAccess

func (c *Client) CreateCollectionWithAccess(ctx context.Context, groupIDs []int, name string) (int, error)

func (*Client) CreateDatabase

func (c *Client) CreateDatabase(ctx context.Context, team, name, saJSON, saEmail string, ds *models.BigQuery) (int, error)

func (*Client) CreatePermissionGroup

func (c *Client) CreatePermissionGroup(ctx context.Context, name string) (int, error)

func (*Client) Databases

func (c *Client) Databases(ctx context.Context) ([]Database, error)

func (*Client) DeletePermissionGroup

func (c *Client) DeletePermissionGroup(ctx context.Context, groupID int) error

func (*Client) GetAzureGroupID

func (c *Client) GetAzureGroupID(ctx context.Context, email string) (string, error)

func (*Client) GetPermissionGroup

func (c *Client) GetPermissionGroup(ctx context.Context, groupID int) ([]PermissionGroupMember, error)

func (*Client) HideTables

func (c *Client) HideTables(ctx context.Context, ids []int) error

func (*Client) MapSemanticType

func (c *Client) MapSemanticType(ctx context.Context, fieldID int, semanticType string) error

func (*Client) OpenAccessToDatabase

func (c *Client) OpenAccessToDatabase(ctx context.Context, databaseID int) error

func (*Client) RemovePermissionGroupMember

func (c *Client) RemovePermissionGroupMember(ctx context.Context, memberID int) error

func (*Client) RestrictAccessToDatabase

func (c *Client) RestrictAccessToDatabase(ctx context.Context, groupIDs []int, databaseID int) error

func (*Client) SetCollectionAccess

func (c *Client) SetCollectionAccess(ctx context.Context, groupIDs []int, collectionID int) error

func (*Client) Tables

func (c *Client) Tables(ctx context.Context, dbID int) ([]Table, error)

type Database

type Database struct {
	ID        int
	Name      string
	DatasetID string
	ProjectID string
	NadaID    string
	SAEmail   string
}

type Details

type Details struct {
	DatasetID          string `json:"dataset-id"`
	ProjectID          string `json:"project-id"`
	ServiceAccountJSON string `json:"service-account-json"`
	NadaID             string `json:"nada-id"`
	SAEmail            string `json:"sa-email"`
}

type Field

type Field struct{}

type Metabase

type Metabase struct {
	// contains filtered or unexported fields
}

func New

func New(repo *database.Repo, client *Client, accessMgr graph.AccessManager, eventMgr *event.Manager, serviceAccount, serviceAccountEmail string, errs *prometheus.CounterVec, iamService *iam.Service, crmService *cloudresourcemanager.Service, log *logrus.Entry) *Metabase

func (*Metabase) HideOtherTables

func (m *Metabase) HideOtherTables(ctx context.Context, dbID int, table string) error

type MetabaseUser

type MetabaseUser struct {
	Email string `json:"email"`
	ID    int    `json:"id"`
}

type NewDatabase

type NewDatabase struct {
	AutoRunQueries bool    `json:"auto_run_queries"`
	Details        Details `json:"details"`
	Engine         string  `json:"engine"`
	IsFullSync     bool    `json:"is_full_sync"`
	Name           string  `json:"name"`
}

type PermissionGroup

type PermissionGroup struct {
	ID      int                     `json:"id"`
	Name    string                  `json:"name"`
	Members []PermissionGroupMember `json:"members"`
}

type PermissionGroupMember

type PermissionGroupMember struct {
	ID    int    `json:"membership_id"`
	Email string `json:"email"`
}

type Table

type Table struct {
	Name   string `json:"name"`
	ID     int    `json:"id"`
	Fields []struct {
		DatabaseType string `json:"database_type"`
		ID           int    `json:"id"`
		SemanticType string `json:"semantic_type"`
	} `json:"fields"`
}

Jump to

Keyboard shortcuts

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