connector

package
v0.0.8 Latest Latest
Warning

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

Go to latest
Published: Dec 20, 2024 License: Apache-2.0 Imports: 18 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// Roles relevant to Account API (Grantable to User or ServicePrincipal).
	AccountAdminRole     = "account_admin"
	MarketplaceAdminRole = "marketplace.admin"

	// Roles (or Entitlements) relevant to Workspace API (Grantable to User, Group or ServicePrincipal).
	WorkspaceAccessRole    = "workspace-access"
	SQLAccessRole          = "databricks-sql-access"
	ClusterCreateRole      = "allow-cluster-create"
	InstancePoolCreateRole = "allow-instance-pool-create"

	UsersType             = "users"
	GroupsType            = "groups"
	ServicePrincipalsType = "servicePrincipals"
)
View Source
const (
	RoleMemberEntitlement = "member"
	RoleType              = "role"
	EntitlementType       = "entitlement"
)
View Source
const ResourcesPageSize uint = 50

Variables

This section is empty.

Functions

This section is empty.

Types

type Databricks

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

func New

func New(
	ctx context.Context,
	hostname,
	accountHostname,
	accountID string,
	auth databricks.Auth,
	workspaces []string,
) (*Databricks, error)

New returns a new instance of the connector.

func (*Databricks) Asset

func (d *Databricks) Asset(ctx context.Context, asset *v2.AssetRef) (string, io.ReadCloser, error)

Asset takes an input AssetRef and attempts to fetch it using the connector's authenticated http client It streams a response, always starting with a metadata object, following by chunked payloads for the asset.

func (*Databricks) Metadata

func (d *Databricks) Metadata(ctx context.Context) (*v2.ConnectorMetadata, error)

Metadata returns metadata about the connector.

func (*Databricks) ResourceSyncers

func (d *Databricks) ResourceSyncers(ctx context.Context) []connectorbuilder.ResourceSyncer

ResourceSyncers returns a ResourceSyncer for each resource type that should be synced from the upstream service.

func (*Databricks) Validate

func (d *Databricks) Validate(ctx context.Context) (annotations.Annotations, error)

Validate is called to ensure that the connector is properly configured. It should exercise any API credentials to be sure that they are valid. Since this connector works with two APIs and can have different types of credentials it is important to validate that the connector is properly configured before attempting to sync.

type ResourceCache

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

func NewResourceCache

func NewResourceCache() *ResourceCache

func (*ResourceCache) Get

func (c *ResourceCache) Get(resourceId string) *v2.Resource

func (*ResourceCache) Set

func (c *ResourceCache) Set(resourceId string, resource *v2.Resource)

Jump to

Keyboard shortcuts

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