Documentation ¶
Index ¶
- Constants
- Variables
- func NewDefaultBigQueryClient(projectID string) (*bigQueryClient, error)
- func NewDefaultCloudResourceManagerClient() (*iamClient, error)
- type Config
- type Credentials
- type Dataset
- type PermissionConfig
- type Provider
- func (p *Provider) CreateConfig(pc *domain.ProviderConfig) error
- func (p *Provider) GetResources(pc *domain.ProviderConfig) ([]*domain.Resource, error)
- func (p *Provider) GetType() string
- func (p *Provider) GrantAccess(pc *domain.ProviderConfig, a *domain.Appeal) error
- func (p *Provider) RevokeAccess(pc *domain.ProviderConfig, a *domain.Appeal) error
- type Table
Constants ¶
View Source
const ( DatasetRoleReader = "READER" DatasetRoleWriter = "WRITER" DatasetRoleOwner = "OWNER" )
View Source
const ( // ResourceTypeDataset is the resource type name for BigQuery dataset ResourceTypeDataset = "dataset" // ResourceTypeTable is the resource type name for BigQuery table ResourceTypeTable = "table" )
Variables ¶
View Source
var ( // ErrInvalidCredentials is the error value for invalid credentials ErrInvalidCredentials = errors.New("invalid credentials type") // ErrInvalidPermissionConfig is the error value for invalid permission config ErrInvalidPermissionConfig = errors.New("invalid permission config type") // ErrUnableToEncryptNilCredentials is the error value if the to be encrypted credentials is nil ErrUnableToEncryptNilCredentials = errors.New("unable to encrypt nil credentials") // ErrUnableToDecryptNilCredentials is the error value if the to be decrypted credentials is nil ErrUnableToDecryptNilCredentials = errors.New("unable to decrypt nil credentials") // ErrInvalidCredentialsType is the error value if the credentials value can't be casted into the bigquery.Credentials type ErrInvalidCredentialsType = errors.New("invalid credentials type") ErrInvalidRole = errors.New("invalid role") ErrInvalidResourceType = errors.New("invalid resource type") ErrInvalidTableURN = errors.New("table URN is invalid") ErrPermissionAlreadyExists = errors.New("permission already exists") ErrPermissionNotFound = errors.New("permission not found") ErrNilProviderConfig = errors.New("provider config can't be nil") ErrNilAppeal = errors.New("appeal can't be nil") ErrNilResource = errors.New("designated resource can't be nil") ErrProviderTypeMismatch = errors.New("provider type in the config and in the appeal don't match") ErrProviderURNMismatch = errors.New("provider urn in the config and in the appeal don't match") )
Functions ¶
func NewDefaultBigQueryClient ¶ added in v0.1.1
func NewDefaultCloudResourceManagerClient ¶ added in v0.2.0
func NewDefaultCloudResourceManagerClient() (*iamClient, error)
Types ¶
type Config ¶
type Config struct { ProviderConfig *domain.ProviderConfig // contains filtered or unexported fields }
Config for bigquery provider
func NewConfig ¶
func NewConfig(pc *domain.ProviderConfig, crypto domain.Crypto) *Config
NewConfig returns bigquery config struct
func (*Config) EncryptCredentials ¶
EncryptCredentials encrypts the bigquery credentials config
func (*Config) ParseAndValidate ¶
ParseAndValidate validates bigquery config within provider config and make the interface{} config value castable into the expected bigquery config value
type Credentials ¶
type Credentials string
Credentials is the authentication configuration used by the bigquery client
type PermissionConfig ¶
type PermissionConfig struct { Name string `json:"name" mapstructure:"name" validate:"required"` Target string `json:"target,omitempty" mapstructure:"target"` }
PermissionConfig is for mapping role into bigquery permissions
type Provider ¶
type Provider struct {
// contains filtered or unexported fields
}
Provider for bigquery
func NewProvider ¶
NewProvider returns bigquery provider
func (*Provider) CreateConfig ¶
func (p *Provider) CreateConfig(pc *domain.ProviderConfig) error
CreateConfig validates provider config
func (*Provider) GetResources ¶
GetResources returns BigQuery dataset and table resources
func (*Provider) GrantAccess ¶
func (*Provider) RevokeAccess ¶
Click to show internal directories.
Click to hide internal directories.