bigquery

package
v0.0.9 Latest Latest
Warning

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

Go to latest
Published: Feb 25, 2023 License: Apache-2.0 Imports: 25 Imported by: 0

Documentation

Index

Constants

View Source
const (
	GcpSAFileLocation        = "gcp-serviceaccount-json-location"
	GcpProjectId             = "gcp-project-id"
	GsuiteIdentityStoreSync  = "gsuite-identity-store-sync"
	GsuiteImpersonateSubject = "gsuite-impersonate-subject"
	GsuiteCustomerId         = "gsuite-customer-id"
	BqExcludedDatasets       = "bq-excluded-datasets"
	BqIncludeHiddenDatasets  = "bq-include-hidden-datasets"
)
View Source
const CONTEXT_TIMEOUT = 10 * time.Second
View Source
const MAX_PAGE_ITEMS = 100

Variables

This section is empty.

Functions

func ConnectToBigQuery

func ConnectToBigQuery(configMap *config.ConfigMap, ctx context.Context) (*bigquery.Client, error)

Types

type AccessSyncer

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

func NewDataAccessSyncer

func NewDataAccessSyncer() *AccessSyncer

func (*AccessSyncer) SyncAccessAsCodeToTarget

func (a *AccessSyncer) SyncAccessAsCodeToTarget(ctx context.Context, accessProviders *importer.AccessProviderImport, prefix string, configMap *config.ConfigMap) error

func (*AccessSyncer) SyncAccessProviderToTarget

func (a *AccessSyncer) SyncAccessProviderToTarget(ctx context.Context, accessProviders *importer.AccessProviderImport, accessProviderFeedbackHandler wrappers.AccessProviderFeedbackHandler, configMap *config.ConfigMap) error

func (*AccessSyncer) SyncAccessProvidersFromTarget

func (a *AccessSyncer) SyncAccessProvidersFromTarget(ctx context.Context, accessProviderHandler wrappers.AccessProviderHandler, configMap *config.ConfigMap) error

type BQEntity

type BQEntity struct {
	ID       string
	Type     string
	Name     string
	FullName string
	ParentId string
}

type BQInformationSchemaEntity

type BQInformationSchemaEntity struct {
	CachedQuery bool                `bigquery:"cache_hit"`
	User        string              `bigquery:"user_email"`
	Query       string              `bigquery:"query"`
	Tables      []BQReferencedTable `bigquery:"referenced_tables"`
	StartTime   int64               `bigquery:"start_time"`
	EndTime     int64               `bigquery:"end_time"`
}

type BQReferencedTable added in v0.0.2

type BQReferencedTable struct {
	Project string `bigquery:"project_id"`
	Dataset string `bigquery:"dataset_id"`
	Table   string `bigquery:"table_id"`
}

type BigQueryRepository

type BigQueryRepository struct {
}

func (*BigQueryRepository) GetDataSetDataAccess

func (r *BigQueryRepository) GetDataSetDataAccess(ctx context.Context, configMap *config.ConfigMap, ignoreBindings []IamBinding) ([]*sync_from_target.AccessProvider, error)

func (*BigQueryRepository) GetDataSets

func (r *BigQueryRepository) GetDataSets(ctx context.Context, configMap *config.ConfigMap) ([]BQEntity, error)

func (*BigQueryRepository) GetDataUsage

func (r *BigQueryRepository) GetDataUsage(ctx context.Context, configMap *config.ConfigMap) ([]BQInformationSchemaEntity, error)

func (*BigQueryRepository) GetProjectDataAccess

func (r *BigQueryRepository) GetProjectDataAccess(ctx context.Context, configMap *config.ConfigMap, ignoreBindings []IamBinding) ([]*sync_from_target.AccessProvider, error)

func (*BigQueryRepository) GetTables

func (r *BigQueryRepository) GetTables(ctx context.Context, configMap *config.ConfigMap, parent BQEntity) ([]BQEntity, error)

func (*BigQueryRepository) Grant

func (r *BigQueryRepository) Grant(ctx context.Context, configMap *config.ConfigMap, member, role, resource string) error

func (*BigQueryRepository) Revoke

func (r *BigQueryRepository) Revoke(ctx context.Context, configMap *config.ConfigMap, member, role, resource string) error

type DataSourceSyncer

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

func NewDataSourceSyncer

func NewDataSourceSyncer() *DataSourceSyncer

func (*DataSourceSyncer) GetDataSourceMetaData

func (s *DataSourceSyncer) GetDataSourceMetaData(_ context.Context) (*ds.MetaData, error)

func (*DataSourceSyncer) SyncDataSource

func (s *DataSourceSyncer) SyncDataSource(ctx context.Context, dataSourceHandler wrappers.DataSourceObjectHandler, configMap *config.ConfigMap) error

type DataUsageSyncer

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

func NewDataUsageSyncer

func NewDataUsageSyncer() *DataUsageSyncer

func (*DataUsageSyncer) SyncDataUsage

func (s *DataUsageSyncer) SyncDataUsage(ctx context.Context, fileCreator wrappers.DataUsageStatementHandler, configParams *config.ConfigMap) error

type GCPIamRepository

type GCPIamRepository struct {
}

func NewGCPIamRepository

func NewGCPIamRepository() *GCPIamRepository

func (*GCPIamRepository) GetIamPolicy

func (r *GCPIamRepository) GetIamPolicy(ctx context.Context, configMap *config.ConfigMap) (*cloudresourcemanager.Policy, error)

func (*GCPIamRepository) Grant

func (r *GCPIamRepository) Grant(ctx context.Context, configMap *config.ConfigMap, member, role string) error

func (*GCPIamRepository) Revoke

func (r *GCPIamRepository) Revoke(ctx context.Context, configMap *config.ConfigMap, member, role string) error

type GSuiteIdentityStoreRepository

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

func (*GSuiteIdentityStoreRepository) GetGroups

func (r *GSuiteIdentityStoreRepository) GetGroups(ctx context.Context, configMap *config.ConfigMap) ([]GroupEntity, error)

func (*GSuiteIdentityStoreRepository) GetServiceAccounts

func (r *GSuiteIdentityStoreRepository) GetServiceAccounts(ctx context.Context, configMap *config.ConfigMap) ([]UserEntity, error)

func (*GSuiteIdentityStoreRepository) GetUsers

func (r *GSuiteIdentityStoreRepository) GetUsers(ctx context.Context, configMap *config.ConfigMap) ([]UserEntity, error)

type GroupEntity

type GroupEntity struct {
	ExternalId string
	Email      string
	Members    []string
}

type IamBinding

type IamBinding struct {
	Member       string
	Role         string
	Resource     string
	ResourceType string
}

type IdentityStoreSyncer

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

func NewIdentityStoreSyncer

func NewIdentityStoreSyncer() *IdentityStoreSyncer

func (*IdentityStoreSyncer) GetIdentityStoreMetaData

func (s *IdentityStoreSyncer) GetIdentityStoreMetaData(_ context.Context) (*is.MetaData, error)

func (*IdentityStoreSyncer) SyncIdentityStore

func (s *IdentityStoreSyncer) SyncIdentityStore(ctx context.Context, identityHandler wrappers.IdentityStoreIdentityHandler, configMap *config.ConfigMap) error

type ProjectIdentityStoreRepository

type ProjectIdentityStoreRepository struct {
}

func (*ProjectIdentityStoreRepository) GetGroups

func (r *ProjectIdentityStoreRepository) GetGroups(ctx context.Context, configMap *config.ConfigMap) ([]GroupEntity, error)

func (*ProjectIdentityStoreRepository) GetServiceAccounts

func (r *ProjectIdentityStoreRepository) GetServiceAccounts(ctx context.Context, configMap *config.ConfigMap) ([]UserEntity, error)

func (*ProjectIdentityStoreRepository) GetUsers

type UserEntity

type UserEntity struct {
	ExternalId string
	Name       string
	Email      string
}

Jump to

Keyboard shortcuts

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