client

package
v0.8.0 Latest Latest
Warning

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

Go to latest
Published: May 24, 2022 License: MPL-2.0 Imports: 41 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AddGcpMetadata

func AddGcpMetadata(ctx context.Context, c schema.ClientMeta, r *schema.Resource) error

func Configure

func Configure(logger hclog.Logger, config interface{}) (schema.ClientMeta, diag.Diagnostics)

func DeleteProjectFilter

func DeleteProjectFilter(meta schema.ClientMeta, _ *schema.Resource) []interface{}

func ErrorClassifier added in v0.5.0

func ErrorClassifier(meta schema.ClientMeta, resourceName string, err error) diag.Diagnostics

func GcpMockTestHelper added in v0.5.1

func GcpMockTestHelper(t *testing.T, table *schema.Table, createService func() (*Services, error), options TestOptions)

func IgnoreErrorHandler

func IgnoreErrorHandler(err error) bool

func ProjectMultiplex

func ProjectMultiplex(meta schema.ClientMeta) []schema.ClientMeta

func RedactError added in v0.6.1

func RedactError(projects []string, e diag.Diagnostic) diag.Diagnostic

RedactError redacts a given diagnostic and returns a RedactedDiagnostic containing both original and redacted versions

func ResolveProject

func ResolveProject(_ context.Context, meta schema.ClientMeta, r *schema.Resource, _ schema.Column) error

Types

type BackoffSettings added in v0.6.5

type BackoffSettings struct {
	Gax        gax.Backoff
	Backoff    backoff.Config
	MaxRetries int
}

type Client

type Client struct {

	// All gcp services initialized by client
	Services *Services
	// this is set by table client multiplexer
	ProjectId string
	// contains filtered or unexported fields
}

func NewGcpClient

func NewGcpClient(log hclog.Logger, bo BackoffSettings, projects []string, services *Services) *Client

func (Client) Logger

func (c Client) Logger() hclog.Logger

func (*Client) RetryingDo added in v0.6.5

func (c *Client) RetryingDo(ctx context.Context, doerIface interface{}, opts ...googleapi.CallOption) (interface{}, error)

RetryingDo runs the given doerIface with retry doerIface needs to have two methods: `Call(...googleapi.CallOption) (T, error)` and `Context(ctx.Context) T`

type Config

type Config struct {
	ProjectFilter         string   `hcl:"project_filter,optional"` // Deprecated
	ProjectIDs            []string `hcl:"project_ids,optional"`
	FolderIDs             []string `hcl:"folder_ids,optional"`
	FolderMaxDepth        uint     `hcl:"folders_max_depth,optional"`
	ServiceAccountKeyJSON string   `hcl:"service_account_key_json,optional"`

	BaseDelay         int     `hcl:"backoff_base_delay,optional" default:"-1"`
	Multiplier        float64 `hcl:"backoff_multiplier,optional"`
	MaxDelay          int     `hcl:"backoff_max_delay,optional"`
	Jitter            float64 `hcl:"backoff_jitter,optional"`
	MinConnectTimeout int     `hcl:"backoff_min_connect_timeout,optional"`
	MaxRetries        int     `hcl:"max_retries,optional" default:"3"`
}

Config defines Provider Configuration

func (Config) Backoff added in v0.6.5

func (c Config) Backoff() BackoffSettings

func (Config) ClientOptions added in v0.6.5

func (c Config) ClientOptions() []option.ClientOption

func (Config) Example added in v0.3.0

func (c Config) Example() string

type Services

type Services struct {
	Kms             *kms.Service
	Storage         *storage.Service
	Sql             *sql.Service
	Iam             *iam.Service
	CloudBilling    *cloudbilling.APIService
	CloudFunctions  *cloudfunctions.Service
	Domain          *domains.Service
	Compute         *compute.Service
	BigQuery        *bigquery.Service
	Dns             *dns.Service
	Logging         *logging.Service
	Monitoring      *monitoring.Service
	ResourceManager *cloudresourcemanager.Service
	ServiceUsage    *serviceusage.Service
}

type TestOptions added in v0.5.1

type TestOptions struct {
	SkipEmptyJsonB bool
}

Jump to

Keyboard shortcuts

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