Documentation
¶
Index ¶
- Constants
- Variables
- type AssetsInventoryRateLimiter
- type AssetsInventoryWrapper
- type ExtendedGcpAsset
- type Iterator
- type LoggingAsset
- type MapCache
- type MockIterator
- type MockIterator_Expecter
- type MockIterator_Next_Call
- type MockProviderInitializerAPI
- type MockProviderInitializerAPI_Expecter
- type MockProviderInitializerAPI_Init_Call
- func (_c *MockProviderInitializerAPI_Init_Call) Return(_a0 ServiceAPI, _a1 error) *MockProviderInitializerAPI_Init_Call
- func (_c *MockProviderInitializerAPI_Init_Call) Run(...) *MockProviderInitializerAPI_Init_Call
- func (_c *MockProviderInitializerAPI_Init_Call) RunAndReturn(...) *MockProviderInitializerAPI_Init_Call
- type MockServiceAPI
- func (_m *MockServiceAPI) Close() error
- func (_m *MockServiceAPI) EXPECT() *MockServiceAPI_Expecter
- func (_m *MockServiceAPI) ListAllAssetTypesByName(ctx context.Context, assets []string) ([]*ExtendedGcpAsset, error)
- func (_m *MockServiceAPI) ListLoggingAssets(ctx context.Context) ([]*LoggingAsset, error)
- func (_m *MockServiceAPI) ListMonitoringAssets(ctx context.Context, monitoringAssetTypes map[string][]string) ([]*MonitoringAsset, error)
- func (_m *MockServiceAPI) ListProjectsAncestorsPolicies(ctx context.Context) ([]*ProjectPoliciesAsset, error)
- func (_m *MockServiceAPI) ListServiceUsageAssets(ctx context.Context) ([]*ServiceUsageAsset, error)
- type MockServiceAPI_Close_Call
- type MockServiceAPI_Expecter
- func (_e *MockServiceAPI_Expecter) Close() *MockServiceAPI_Close_Call
- func (_e *MockServiceAPI_Expecter) ListAllAssetTypesByName(ctx interface{}, assets interface{}) *MockServiceAPI_ListAllAssetTypesByName_Call
- func (_e *MockServiceAPI_Expecter) ListLoggingAssets(ctx interface{}) *MockServiceAPI_ListLoggingAssets_Call
- func (_e *MockServiceAPI_Expecter) ListMonitoringAssets(ctx interface{}, monitoringAssetTypes interface{}) *MockServiceAPI_ListMonitoringAssets_Call
- func (_e *MockServiceAPI_Expecter) ListProjectsAncestorsPolicies(ctx interface{}) *MockServiceAPI_ListProjectsAncestorsPolicies_Call
- func (_e *MockServiceAPI_Expecter) ListServiceUsageAssets(ctx interface{}) *MockServiceAPI_ListServiceUsageAssets_Call
- type MockServiceAPI_ListAllAssetTypesByName_Call
- func (_c *MockServiceAPI_ListAllAssetTypesByName_Call) Return(_a0 []*ExtendedGcpAsset, _a1 error) *MockServiceAPI_ListAllAssetTypesByName_Call
- func (_c *MockServiceAPI_ListAllAssetTypesByName_Call) Run(run func(ctx context.Context, assets []string)) *MockServiceAPI_ListAllAssetTypesByName_Call
- func (_c *MockServiceAPI_ListAllAssetTypesByName_Call) RunAndReturn(run func(context.Context, []string) ([]*ExtendedGcpAsset, error)) *MockServiceAPI_ListAllAssetTypesByName_Call
- type MockServiceAPI_ListLoggingAssets_Call
- func (_c *MockServiceAPI_ListLoggingAssets_Call) Return(_a0 []*LoggingAsset, _a1 error) *MockServiceAPI_ListLoggingAssets_Call
- func (_c *MockServiceAPI_ListLoggingAssets_Call) Run(run func(ctx context.Context)) *MockServiceAPI_ListLoggingAssets_Call
- func (_c *MockServiceAPI_ListLoggingAssets_Call) RunAndReturn(run func(context.Context) ([]*LoggingAsset, error)) *MockServiceAPI_ListLoggingAssets_Call
- type MockServiceAPI_ListMonitoringAssets_Call
- func (_c *MockServiceAPI_ListMonitoringAssets_Call) Return(_a0 []*MonitoringAsset, _a1 error) *MockServiceAPI_ListMonitoringAssets_Call
- func (_c *MockServiceAPI_ListMonitoringAssets_Call) Run(run func(ctx context.Context, monitoringAssetTypes map[string][]string)) *MockServiceAPI_ListMonitoringAssets_Call
- func (_c *MockServiceAPI_ListMonitoringAssets_Call) RunAndReturn(run func(context.Context, map[string][]string) ([]*MonitoringAsset, error)) *MockServiceAPI_ListMonitoringAssets_Call
- type MockServiceAPI_ListProjectsAncestorsPolicies_Call
- func (_c *MockServiceAPI_ListProjectsAncestorsPolicies_Call) Return(_a0 []*ProjectPoliciesAsset, _a1 error) *MockServiceAPI_ListProjectsAncestorsPolicies_Call
- func (_c *MockServiceAPI_ListProjectsAncestorsPolicies_Call) Run(run func(ctx context.Context)) *MockServiceAPI_ListProjectsAncestorsPolicies_Call
- func (_c *MockServiceAPI_ListProjectsAncestorsPolicies_Call) RunAndReturn(run func(context.Context) ([]*ProjectPoliciesAsset, error)) *MockServiceAPI_ListProjectsAncestorsPolicies_Call
- type MockServiceAPI_ListServiceUsageAssets_Call
- func (_c *MockServiceAPI_ListServiceUsageAssets_Call) Return(_a0 []*ServiceUsageAsset, _a1 error) *MockServiceAPI_ListServiceUsageAssets_Call
- func (_c *MockServiceAPI_ListServiceUsageAssets_Call) Run(run func(ctx context.Context)) *MockServiceAPI_ListServiceUsageAssets_Call
- func (_c *MockServiceAPI_ListServiceUsageAssets_Call) RunAndReturn(run func(context.Context) ([]*ServiceUsageAsset, error)) *MockServiceAPI_ListServiceUsageAssets_Call
- type MockTypeGenerator
- type MockTypeGenerator_Execute_Call
- func (_c *MockTypeGenerator_Execute_Call[T]) Return(_a0 *T) *MockTypeGenerator_Execute_Call[T]
- func (_c *MockTypeGenerator_Execute_Call[T]) Run(...) *MockTypeGenerator_Execute_Call[T]
- func (_c *MockTypeGenerator_Execute_Call[T]) RunAndReturn(run func([]*ExtendedGcpAsset, string, string, string, string) *T) *MockTypeGenerator_Execute_Call[T]
- type MockTypeGenerator_Expecter
- type MonitoringAsset
- type ProjectPoliciesAsset
- type Provider
- func (p *Provider) Close() error
- func (p *Provider) ListAllAssetTypesByName(ctx context.Context, assetTypes []string) ([]*ExtendedGcpAsset, error)
- func (p *Provider) ListLoggingAssets(ctx context.Context) ([]*LoggingAsset, error)
- func (p *Provider) ListMonitoringAssets(ctx context.Context, monitoringAssetTypes map[string][]string) ([]*MonitoringAsset, error)
- func (p *Provider) ListProjectsAncestorsPolicies(ctx context.Context) ([]*ProjectPoliciesAsset, error)
- func (p *Provider) ListServiceUsageAssets(ctx context.Context) ([]*ServiceUsageAsset, error)
- type ProviderInitializer
- type ProviderInitializerAPI
- type ResourceManagerWrapper
- type ServiceAPI
- type ServiceUsageAsset
- type TypeGenerator
Constants ¶
const ( StorageBucketAssetType = "storage.googleapis.com/Bucket" ComputeFirewallAssetType = "compute.googleapis.com/Firewall" ComputeInstanceAssetType = "compute.googleapis.com/Instance" ComputeNetworkAssetType = "compute.googleapis.com/Network" ComputeBackendServiceAssetType = "compute.googleapis.com/RegionBackendService" ComputeSubnetworkAssetType = "compute.googleapis.com/Subnetwork" ComputeDiskAssetType = "compute.googleapis.com/Disk" DnsManagedZoneAssetType = "dns.googleapis.com/ManagedZone" BigqueryDatasetAssetType = "bigquery.googleapis.com/Dataset" BigqueryTableAssetType = "bigquery.googleapis.com/Table" CrmProjectAssetType = "cloudresourcemanager.googleapis.com/Project" CrmOrgAssetType = "cloudresourcemanager.googleapis.com/Organization" CrmFolderAssetType = "cloudresourcemanager.googleapis.com/Folder" ApiKeysKeyAssetType = "apikeys.googleapis.com/Key" CloudKmsCryptoKeyAssetType = "cloudkms.googleapis.com/CryptoKey" IamServiceAccountAssetType = "iam.googleapis.com/ServiceAccount" IamServiceAccountKeyAssetType = "iam.googleapis.com/ServiceAccountKey" SqlDatabaseInstanceAssetType = "sqladmin.googleapis.com/Instance" LogBucketAssetType = "logging.googleapis.com/LogBucket" LogSinkAssetType = "logging.googleapis.com/LogSink" DataprocClusterAssetType = "dataproc.googleapis.com/Cluster" MonitoringLogMetricAssetType = "logging.googleapis.com/LogMetric" MonitoringAlertPolicyAssetType = "monitoring.googleapis.com/AlertPolicy" DnsPolicyAssetType = "dns.googleapis.com/Policy" ServiceUsageAssetType = "serviceusage.googleapis.com/Service" GkeClusterAssetType = "container.googleapis.com/Cluster" ComputeForwardingRuleAssetType = "compute.googleapis.com/ForwardingRule" IamRoleAssetType = "iam.googleapis.com/Role" CloudFunctionAssetType = "cloudfunctions.googleapis.com/CloudFunction" CloudRunService = "run.googleapis.com/Service" )
Variables ¶
var RetryOnResourceExhausted = gax.WithRetry(func() gax.Retryer { return gax.OnCodes([]codes.Code{codes.ResourceExhausted}, gax.Backoff{ Initial: 1 * time.Second, Max: 1 * time.Minute, Multiplier: 1.2, }) })
a gax.CallOption that defines a retry strategy which retries the request on ResourceExhausted error.
Functions ¶
This section is empty.
Types ¶
type AssetsInventoryRateLimiter ¶
type AssetsInventoryRateLimiter struct {
// contains filtered or unexported fields
}
func NewAssetsInventoryRateLimiter ¶
func NewAssetsInventoryRateLimiter(log *clog.Logger) *AssetsInventoryRateLimiter
func (*AssetsInventoryRateLimiter) GetInterceptorDialOption ¶
func (rl *AssetsInventoryRateLimiter) GetInterceptorDialOption() grpc.DialOption
Returns a grpc.DialOption that intercepts the unary RPCs and limits the rate of the method calls.
type AssetsInventoryWrapper ¶
type ExtendedGcpAsset ¶
type ExtendedGcpAsset struct { *assetpb.Asset CloudAccount *fetching.CloudAccountMetadata }
type LoggingAsset ¶
type LoggingAsset struct { CloudAccount *fetching.CloudAccountMetadata LogSinks []*ExtendedGcpAsset `json:"log_sinks,omitempty"` }
type MapCache ¶
type MapCache[T any] struct { // contains filtered or unexported fields }
func NewMapCache ¶
type MockIterator ¶
MockIterator is an autogenerated mock type for the Iterator type
func NewMockIterator ¶
func NewMockIterator(t interface { mock.TestingT Cleanup(func()) }) *MockIterator
NewMockIterator creates a new instance of MockIterator. It also registers a testing interface on the mock and a cleanup function to assert the mocks expectations. The first argument is typically a *testing.T value.
func (*MockIterator) EXPECT ¶
func (_m *MockIterator) EXPECT() *MockIterator_Expecter
type MockIterator_Expecter ¶
type MockIterator_Expecter struct {
// contains filtered or unexported fields
}
func (*MockIterator_Expecter) Next ¶
func (_e *MockIterator_Expecter) Next() *MockIterator_Next_Call
Next is a helper method to define mock.On call
type MockIterator_Next_Call ¶
MockIterator_Next_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Next'
func (*MockIterator_Next_Call) Return ¶
func (_c *MockIterator_Next_Call) Return(_a0 *assetpb.Asset, _a1 error) *MockIterator_Next_Call
func (*MockIterator_Next_Call) Run ¶
func (_c *MockIterator_Next_Call) Run(run func()) *MockIterator_Next_Call
func (*MockIterator_Next_Call) RunAndReturn ¶
func (_c *MockIterator_Next_Call) RunAndReturn(run func() (*assetpb.Asset, error)) *MockIterator_Next_Call
type MockProviderInitializerAPI ¶
MockProviderInitializerAPI is an autogenerated mock type for the ProviderInitializerAPI type
func NewMockProviderInitializerAPI ¶
func NewMockProviderInitializerAPI(t interface { mock.TestingT Cleanup(func()) }) *MockProviderInitializerAPI
NewMockProviderInitializerAPI creates a new instance of MockProviderInitializerAPI. It also registers a testing interface on the mock and a cleanup function to assert the mocks expectations. The first argument is typically a *testing.T value.
func (*MockProviderInitializerAPI) EXPECT ¶
func (_m *MockProviderInitializerAPI) EXPECT() *MockProviderInitializerAPI_Expecter
func (*MockProviderInitializerAPI) Init ¶
func (_m *MockProviderInitializerAPI) Init(ctx context.Context, log *clog.Logger, gcpConfig auth.GcpFactoryConfig) (ServiceAPI, error)
Init provides a mock function with given fields: ctx, log, gcpConfig
type MockProviderInitializerAPI_Expecter ¶
type MockProviderInitializerAPI_Expecter struct {
// contains filtered or unexported fields
}
func (*MockProviderInitializerAPI_Expecter) Init ¶
func (_e *MockProviderInitializerAPI_Expecter) Init(ctx interface{}, log interface{}, gcpConfig interface{}) *MockProviderInitializerAPI_Init_Call
Init is a helper method to define mock.On call
- ctx context.Context
- log *clog.Logger
- gcpConfig auth.GcpFactoryConfig
type MockProviderInitializerAPI_Init_Call ¶
MockProviderInitializerAPI_Init_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Init'
func (*MockProviderInitializerAPI_Init_Call) Return ¶
func (_c *MockProviderInitializerAPI_Init_Call) Return(_a0 ServiceAPI, _a1 error) *MockProviderInitializerAPI_Init_Call
func (*MockProviderInitializerAPI_Init_Call) Run ¶
func (_c *MockProviderInitializerAPI_Init_Call) Run(run func(ctx context.Context, log *clog.Logger, gcpConfig auth.GcpFactoryConfig)) *MockProviderInitializerAPI_Init_Call
func (*MockProviderInitializerAPI_Init_Call) RunAndReturn ¶
func (_c *MockProviderInitializerAPI_Init_Call) RunAndReturn(run func(context.Context, *clog.Logger, auth.GcpFactoryConfig) (ServiceAPI, error)) *MockProviderInitializerAPI_Init_Call
type MockServiceAPI ¶
MockServiceAPI is an autogenerated mock type for the ServiceAPI type
func NewMockServiceAPI ¶
func NewMockServiceAPI(t interface { mock.TestingT Cleanup(func()) }) *MockServiceAPI
NewMockServiceAPI creates a new instance of MockServiceAPI. It also registers a testing interface on the mock and a cleanup function to assert the mocks expectations. The first argument is typically a *testing.T value.
func (*MockServiceAPI) Close ¶
func (_m *MockServiceAPI) Close() error
Close provides a mock function with given fields:
func (*MockServiceAPI) EXPECT ¶
func (_m *MockServiceAPI) EXPECT() *MockServiceAPI_Expecter
func (*MockServiceAPI) ListAllAssetTypesByName ¶
func (_m *MockServiceAPI) ListAllAssetTypesByName(ctx context.Context, assets []string) ([]*ExtendedGcpAsset, error)
ListAllAssetTypesByName provides a mock function with given fields: ctx, assets
func (*MockServiceAPI) ListLoggingAssets ¶
func (_m *MockServiceAPI) ListLoggingAssets(ctx context.Context) ([]*LoggingAsset, error)
ListLoggingAssets provides a mock function with given fields: ctx
func (*MockServiceAPI) ListMonitoringAssets ¶
func (_m *MockServiceAPI) ListMonitoringAssets(ctx context.Context, monitoringAssetTypes map[string][]string) ([]*MonitoringAsset, error)
ListMonitoringAssets provides a mock function with given fields: ctx, monitoringAssetTypes
func (*MockServiceAPI) ListProjectsAncestorsPolicies ¶
func (_m *MockServiceAPI) ListProjectsAncestorsPolicies(ctx context.Context) ([]*ProjectPoliciesAsset, error)
ListProjectsAncestorsPolicies provides a mock function with given fields: ctx
func (*MockServiceAPI) ListServiceUsageAssets ¶
func (_m *MockServiceAPI) ListServiceUsageAssets(ctx context.Context) ([]*ServiceUsageAsset, error)
ListServiceUsageAssets provides a mock function with given fields: ctx
type MockServiceAPI_Close_Call ¶
MockServiceAPI_Close_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Close'
func (*MockServiceAPI_Close_Call) Return ¶
func (_c *MockServiceAPI_Close_Call) Return(_a0 error) *MockServiceAPI_Close_Call
func (*MockServiceAPI_Close_Call) Run ¶
func (_c *MockServiceAPI_Close_Call) Run(run func()) *MockServiceAPI_Close_Call
func (*MockServiceAPI_Close_Call) RunAndReturn ¶
func (_c *MockServiceAPI_Close_Call) RunAndReturn(run func() error) *MockServiceAPI_Close_Call
type MockServiceAPI_Expecter ¶
type MockServiceAPI_Expecter struct {
// contains filtered or unexported fields
}
func (*MockServiceAPI_Expecter) Close ¶
func (_e *MockServiceAPI_Expecter) Close() *MockServiceAPI_Close_Call
Close is a helper method to define mock.On call
func (*MockServiceAPI_Expecter) ListAllAssetTypesByName ¶
func (_e *MockServiceAPI_Expecter) ListAllAssetTypesByName(ctx interface{}, assets interface{}) *MockServiceAPI_ListAllAssetTypesByName_Call
ListAllAssetTypesByName is a helper method to define mock.On call
- ctx context.Context
- assets []string
func (*MockServiceAPI_Expecter) ListLoggingAssets ¶
func (_e *MockServiceAPI_Expecter) ListLoggingAssets(ctx interface{}) *MockServiceAPI_ListLoggingAssets_Call
ListLoggingAssets is a helper method to define mock.On call
- ctx context.Context
func (*MockServiceAPI_Expecter) ListMonitoringAssets ¶
func (_e *MockServiceAPI_Expecter) ListMonitoringAssets(ctx interface{}, monitoringAssetTypes interface{}) *MockServiceAPI_ListMonitoringAssets_Call
ListMonitoringAssets is a helper method to define mock.On call
- ctx context.Context
- monitoringAssetTypes map[string][]string
func (*MockServiceAPI_Expecter) ListProjectsAncestorsPolicies ¶
func (_e *MockServiceAPI_Expecter) ListProjectsAncestorsPolicies(ctx interface{}) *MockServiceAPI_ListProjectsAncestorsPolicies_Call
ListProjectsAncestorsPolicies is a helper method to define mock.On call
- ctx context.Context
func (*MockServiceAPI_Expecter) ListServiceUsageAssets ¶
func (_e *MockServiceAPI_Expecter) ListServiceUsageAssets(ctx interface{}) *MockServiceAPI_ListServiceUsageAssets_Call
ListServiceUsageAssets is a helper method to define mock.On call
- ctx context.Context
type MockServiceAPI_ListAllAssetTypesByName_Call ¶
MockServiceAPI_ListAllAssetTypesByName_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'ListAllAssetTypesByName'
func (*MockServiceAPI_ListAllAssetTypesByName_Call) Return ¶
func (_c *MockServiceAPI_ListAllAssetTypesByName_Call) Return(_a0 []*ExtendedGcpAsset, _a1 error) *MockServiceAPI_ListAllAssetTypesByName_Call
func (*MockServiceAPI_ListAllAssetTypesByName_Call) Run ¶
func (_c *MockServiceAPI_ListAllAssetTypesByName_Call) Run(run func(ctx context.Context, assets []string)) *MockServiceAPI_ListAllAssetTypesByName_Call
func (*MockServiceAPI_ListAllAssetTypesByName_Call) RunAndReturn ¶
func (_c *MockServiceAPI_ListAllAssetTypesByName_Call) RunAndReturn(run func(context.Context, []string) ([]*ExtendedGcpAsset, error)) *MockServiceAPI_ListAllAssetTypesByName_Call
type MockServiceAPI_ListLoggingAssets_Call ¶
MockServiceAPI_ListLoggingAssets_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'ListLoggingAssets'
func (*MockServiceAPI_ListLoggingAssets_Call) Return ¶
func (_c *MockServiceAPI_ListLoggingAssets_Call) Return(_a0 []*LoggingAsset, _a1 error) *MockServiceAPI_ListLoggingAssets_Call
func (*MockServiceAPI_ListLoggingAssets_Call) Run ¶
func (_c *MockServiceAPI_ListLoggingAssets_Call) Run(run func(ctx context.Context)) *MockServiceAPI_ListLoggingAssets_Call
func (*MockServiceAPI_ListLoggingAssets_Call) RunAndReturn ¶
func (_c *MockServiceAPI_ListLoggingAssets_Call) RunAndReturn(run func(context.Context) ([]*LoggingAsset, error)) *MockServiceAPI_ListLoggingAssets_Call
type MockServiceAPI_ListMonitoringAssets_Call ¶
MockServiceAPI_ListMonitoringAssets_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'ListMonitoringAssets'
func (*MockServiceAPI_ListMonitoringAssets_Call) Return ¶
func (_c *MockServiceAPI_ListMonitoringAssets_Call) Return(_a0 []*MonitoringAsset, _a1 error) *MockServiceAPI_ListMonitoringAssets_Call
func (*MockServiceAPI_ListMonitoringAssets_Call) Run ¶
func (_c *MockServiceAPI_ListMonitoringAssets_Call) Run(run func(ctx context.Context, monitoringAssetTypes map[string][]string)) *MockServiceAPI_ListMonitoringAssets_Call
func (*MockServiceAPI_ListMonitoringAssets_Call) RunAndReturn ¶
func (_c *MockServiceAPI_ListMonitoringAssets_Call) RunAndReturn(run func(context.Context, map[string][]string) ([]*MonitoringAsset, error)) *MockServiceAPI_ListMonitoringAssets_Call
type MockServiceAPI_ListProjectsAncestorsPolicies_Call ¶
MockServiceAPI_ListProjectsAncestorsPolicies_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'ListProjectsAncestorsPolicies'
func (*MockServiceAPI_ListProjectsAncestorsPolicies_Call) Return ¶
func (_c *MockServiceAPI_ListProjectsAncestorsPolicies_Call) Return(_a0 []*ProjectPoliciesAsset, _a1 error) *MockServiceAPI_ListProjectsAncestorsPolicies_Call
func (*MockServiceAPI_ListProjectsAncestorsPolicies_Call) Run ¶
func (_c *MockServiceAPI_ListProjectsAncestorsPolicies_Call) Run(run func(ctx context.Context)) *MockServiceAPI_ListProjectsAncestorsPolicies_Call
func (*MockServiceAPI_ListProjectsAncestorsPolicies_Call) RunAndReturn ¶
func (_c *MockServiceAPI_ListProjectsAncestorsPolicies_Call) RunAndReturn(run func(context.Context) ([]*ProjectPoliciesAsset, error)) *MockServiceAPI_ListProjectsAncestorsPolicies_Call
type MockServiceAPI_ListServiceUsageAssets_Call ¶
MockServiceAPI_ListServiceUsageAssets_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'ListServiceUsageAssets'
func (*MockServiceAPI_ListServiceUsageAssets_Call) Return ¶
func (_c *MockServiceAPI_ListServiceUsageAssets_Call) Return(_a0 []*ServiceUsageAsset, _a1 error) *MockServiceAPI_ListServiceUsageAssets_Call
func (*MockServiceAPI_ListServiceUsageAssets_Call) Run ¶
func (_c *MockServiceAPI_ListServiceUsageAssets_Call) Run(run func(ctx context.Context)) *MockServiceAPI_ListServiceUsageAssets_Call
func (*MockServiceAPI_ListServiceUsageAssets_Call) RunAndReturn ¶
func (_c *MockServiceAPI_ListServiceUsageAssets_Call) RunAndReturn(run func(context.Context) ([]*ServiceUsageAsset, error)) *MockServiceAPI_ListServiceUsageAssets_Call
type MockTypeGenerator ¶
MockTypeGenerator is an autogenerated mock type for the TypeGenerator type
func NewMockTypeGenerator ¶
func NewMockTypeGenerator[T interface{}](t interface { mock.TestingT Cleanup(func()) }) *MockTypeGenerator[T]
NewMockTypeGenerator creates a new instance of MockTypeGenerator. It also registers a testing interface on the mock and a cleanup function to assert the mocks expectations. The first argument is typically a *testing.T value.
func (*MockTypeGenerator[T]) EXPECT ¶
func (_m *MockTypeGenerator[T]) EXPECT() *MockTypeGenerator_Expecter[T]
func (*MockTypeGenerator[T]) Execute ¶
func (_m *MockTypeGenerator[T]) Execute(assets []*ExtendedGcpAsset, projectId string, projectName string, orgId string, orgName string) *T
Execute provides a mock function with given fields: assets, projectId, projectName, orgId, orgName
type MockTypeGenerator_Execute_Call ¶
MockTypeGenerator_Execute_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Execute'
func (*MockTypeGenerator_Execute_Call[T]) Return ¶
func (_c *MockTypeGenerator_Execute_Call[T]) Return(_a0 *T) *MockTypeGenerator_Execute_Call[T]
func (*MockTypeGenerator_Execute_Call[T]) Run ¶
func (_c *MockTypeGenerator_Execute_Call[T]) Run(run func(assets []*ExtendedGcpAsset, projectId string, projectName string, orgId string, orgName string)) *MockTypeGenerator_Execute_Call[T]
func (*MockTypeGenerator_Execute_Call[T]) RunAndReturn ¶
func (_c *MockTypeGenerator_Execute_Call[T]) RunAndReturn(run func([]*ExtendedGcpAsset, string, string, string, string) *T) *MockTypeGenerator_Execute_Call[T]
type MockTypeGenerator_Expecter ¶
type MockTypeGenerator_Expecter[T interface{}] struct {
// contains filtered or unexported fields
}
func (*MockTypeGenerator_Expecter[T]) Execute ¶
func (_e *MockTypeGenerator_Expecter[T]) Execute(assets interface{}, projectId interface{}, projectName interface{}, orgId interface{}, orgName interface{}) *MockTypeGenerator_Execute_Call[T]
Execute is a helper method to define mock.On call
- assets []*ExtendedGcpAsset
- projectId string
- projectName string
- orgId string
- orgName string
type MonitoringAsset ¶
type MonitoringAsset struct { CloudAccount *fetching.CloudAccountMetadata LogMetrics []*ExtendedGcpAsset `json:"log_metrics,omitempty"` Alerts []*ExtendedGcpAsset `json:"alerts,omitempty"` }
type ProjectPoliciesAsset ¶
type ProjectPoliciesAsset struct { CloudAccount *fetching.CloudAccountMetadata Policies []*ExtendedGcpAsset `json:"policies,omitempty"` }
type Provider ¶
type Provider struct {
// contains filtered or unexported fields
}
func (*Provider) ListAllAssetTypesByName ¶
func (*Provider) ListLoggingAssets ¶
func (p *Provider) ListLoggingAssets(ctx context.Context) ([]*LoggingAsset, error)
ListLoggingAssets returns a list of logging assets grouped by project id, extended with folder and org level log sinks
func (*Provider) ListMonitoringAssets ¶
func (p *Provider) ListMonitoringAssets(ctx context.Context, monitoringAssetTypes map[string][]string) ([]*MonitoringAsset, error)
ListMonitoringAssets returns a list of monitoring assets grouped by project id
func (*Provider) ListProjectsAncestorsPolicies ¶
func (p *Provider) ListProjectsAncestorsPolicies(ctx context.Context) ([]*ProjectPoliciesAsset, error)
func (*Provider) ListServiceUsageAssets ¶
func (p *Provider) ListServiceUsageAssets(ctx context.Context) ([]*ServiceUsageAsset, error)
ListServiceUsageAssets returns a list of service usage assets grouped by project id
type ProviderInitializer ¶
type ProviderInitializer struct{}
func (*ProviderInitializer) Init ¶
func (p *ProviderInitializer) Init(ctx context.Context, log *clog.Logger, gcpConfig auth.GcpFactoryConfig) (ServiceAPI, error)
type ProviderInitializerAPI ¶
type ProviderInitializerAPI interface { // Init initializes the GCP asset client Init(ctx context.Context, log *clog.Logger, gcpConfig auth.GcpFactoryConfig) (ServiceAPI, error) }
type ResourceManagerWrapper ¶
type ResourceManagerWrapper struct {
// contains filtered or unexported fields
}
type ServiceAPI ¶
type ServiceAPI interface { // ListAllAssetTypesByName List all content types of the given assets types ListAllAssetTypesByName(ctx context.Context, assets []string) ([]*ExtendedGcpAsset, error) // ListMonitoringAssets List all monitoring assets by project id ListMonitoringAssets(ctx context.Context, monitoringAssetTypes map[string][]string) ([]*MonitoringAsset, error) // ListLoggingAssets returns a list of logging assets grouped by project id, extended with folder and org level log sinks ListLoggingAssets(ctx context.Context) ([]*LoggingAsset, error) // ListServiceUsageAssets returns a list of service usage assets grouped by project id ListServiceUsageAssets(ctx context.Context) ([]*ServiceUsageAsset, error) // returns a project policies for all its ancestors ListProjectsAncestorsPolicies(ctx context.Context) ([]*ProjectPoliciesAsset, error) // Close the GCP asset client Close() error }
type ServiceUsageAsset ¶
type ServiceUsageAsset struct { CloudAccount *fetching.CloudAccountMetadata Services []*ExtendedGcpAsset `json:"services,omitempty"` }
type TypeGenerator ¶
type TypeGenerator[T any] func(assets []*ExtendedGcpAsset, projectId, projectName, orgId, orgName string) *T