fetching

package
v0.0.0-...-5200ab0 Latest Latest
Warning

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

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

Documentation

Index

Constants

View Source
const (
	FileSystemType = "file-system"
	KubeAPIType    = "kube-api"
	ProcessType    = "process"

	// AWS subtypes
	AccessAnalyzers              = "aws-access-analyzers"
	AwsMonitoringType            = "aws-monitoring"
	ConfigServiceResourceType    = "aws-config"
	EBSSnapshotType              = "aws-ebs-snapshot"
	EBSType                      = "aws-ebs"
	EC2NetworkingType            = "aws-ec2-network"
	EC2Type                      = "aws-ec2"
	EcrType                      = "aws-ecr"
	ElbType                      = "aws-elb"
	IAMServerCertificateType     = "aws-iam-server-certificate"
	IAMType                      = "aws-iam"
	IAMUserType                  = "aws-iam-user"
	InternetGateway              = "aws-internet-gateway"
	KmsType                      = "aws-kms"
	LambdaAliasType              = "aws-lambda-function-alias"
	LambdaEventSourceMappingType = "aws-lambda-event-source-mapping"
	LambdaFunctionType           = "aws-lambda-function"
	LambdaLayerType              = "aws-lambda-layer"
	MultiTrailsType              = "aws-multi-trails"
	NatGateway                   = "aws-nat-gateway"
	NetworkInterface             = "aws-network-interface"
	NetworkNACLType              = "aws-nacl"
	PolicyType                   = "aws-policy"
	PwdPolicyType                = "aws-password-policy"
	RdsType                      = "aws-rds"
	S3Type                       = "aws-s3"
	SNSTopicType                 = "aws-sns"
	SecurityGroupType            = "aws-security-group"
	SecurityHubType              = "aws-securityhub"
	Subnet                       = "aws-subnet"
	TrailType                    = "aws-trail"
	TransitGateway               = "aws-transit-gateway"
	TransitGatewayAttachment     = "aws-transit-gateway-attachment"
	VpcPeeringConnectionType     = "aws-vpc-peering-connection"
	VpcType                      = "aws-vpc"

	// GCP subtypes
	GcpLoggingType    = "gcp-logging"
	GcpMonitoringType = "gcp-monitoring"
	GcpPolicies       = "gcp-policies"
	GcpServiceUsage   = "gcp-service-usage"

	// Azure resources group subtypes
	AzureActivityLogAlertType          = "azure-activity-log-alert"
	AzureBastionType                   = "azure-bastion"
	AzureClassicStorageAccountType     = "azure-classic-storage-account"
	AzureDiagnosticSettingsType        = "azure-diagnostic-settings"
	AzureDiskType                      = "azure-disk"
	AzureDocumentDBDatabaseAccountType = "azure-document-db-database-account"
	AzureInsightsComponentType         = "azure-insights-component"
	AzureMySQLDBType                   = "azure-mysql-server-db"
	AzureFlexibleMySQLDBType           = "azure-flexible-mysql-server-db"
	AzureNetworkWatchersFlowLogType    = "azure-network-watchers-flow-log"
	AzureNetworkWatchersType           = "azure-network-watcher"
	AzureNetworkSecurityGroupType      = "azure-network-group"
	AzurePostgreSQLDBType              = "azure-postgresql-server-db"
	AzureFlexiblePostgreSQLDBType      = "azure-flexible-postgresql-server-db"
	AzureSecurityContactsType          = "azure-security-contacts"
	AzureAutoProvisioningSettingsType  = "azure-security-auto-provisioning-settings"
	AzureSQLServerType                 = "azure-sql-server"
	AzureStorageAccountType            = "azure-storage-account"
	AzureVMType                        = "azure-vm"
	AzureVaultType                     = "azure-vault"
	AzureWebSiteType                   = "azure-web-site"

	// Azure authorizationresources group subtypes
	AzureRoleDefinitionType = "azure-role-definition"

	// Types
	CloudAudit             = "cloud-audit"
	CloudCompute           = "cloud-compute"
	CloudConfig            = "cloud-config"
	CloudContainerMgmt     = "caas" // containers as a service
	CloudContainerRegistry = "container-registry"
	CloudDatabase          = "cloud-database"
	CloudDns               = "cloud-dns"
	CloudIdentity          = "identity-management"
	CloudLoadBalancer      = "load-balancer"
	CloudStorage           = "cloud-storage"
	DataProcessing         = "data-processing"
	KeyManagement          = "key-management"
	LoggingIdentity        = "logging"
	MonitoringIdentity     = "monitoring"
	ProjectManagement      = "project-management"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type AwsBaseFetcherConfig

type AwsBaseFetcherConfig struct {
	BaseFetcherConfig `config:",inline"`
	AwsConfig         awssdk.ConfigAWS `config:",inline"`
}

type BaseFetcherConfig

type BaseFetcherConfig struct {
	Name string `config:"name"`
}

type CloudAccountMetadata

type CloudAccountMetadata struct {
	AccountId        string `json:"account_id,omitempty"`
	AccountName      string `json:"account_name,omitempty"`
	OrganisationId   string `json:"organization_id,omitempty"`
	OrganizationName string `json:"organization_name,omitempty"`
}

type Condition

type Condition interface {
	Condition() bool
	Name() string
}

type Fetcher

type Fetcher interface {
	Fetch(context.Context, cycle.Metadata) error
	Stop()
}

Fetcher represents a data fetcher.

type MockCondition

type MockCondition struct {
	mock.Mock
}

MockCondition is an autogenerated mock type for the Condition type

func NewMockCondition

func NewMockCondition(t interface {
	mock.TestingT
	Cleanup(func())
}) *MockCondition

NewMockCondition creates a new instance of MockCondition. 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 (*MockCondition) Condition

func (_m *MockCondition) Condition() bool

Condition provides a mock function with given fields:

func (*MockCondition) EXPECT

func (_m *MockCondition) EXPECT() *MockCondition_Expecter

func (*MockCondition) Name

func (_m *MockCondition) Name() string

Name provides a mock function with given fields:

type MockCondition_Condition_Call

type MockCondition_Condition_Call struct {
	*mock.Call
}

MockCondition_Condition_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Condition'

func (*MockCondition_Condition_Call) Return

func (*MockCondition_Condition_Call) Run

func (*MockCondition_Condition_Call) RunAndReturn

func (_c *MockCondition_Condition_Call) RunAndReturn(run func() bool) *MockCondition_Condition_Call

type MockCondition_Expecter

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

func (*MockCondition_Expecter) Condition

Condition is a helper method to define mock.On call

func (*MockCondition_Expecter) Name

Name is a helper method to define mock.On call

type MockCondition_Name_Call

type MockCondition_Name_Call struct {
	*mock.Call
}

MockCondition_Name_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Name'

func (*MockCondition_Name_Call) Return

func (*MockCondition_Name_Call) Run

func (_c *MockCondition_Name_Call) Run(run func()) *MockCondition_Name_Call

func (*MockCondition_Name_Call) RunAndReturn

func (_c *MockCondition_Name_Call) RunAndReturn(run func() string) *MockCondition_Name_Call

type MockFetcher

type MockFetcher struct {
	mock.Mock
}

MockFetcher is an autogenerated mock type for the Fetcher type

func NewMockFetcher

func NewMockFetcher(t interface {
	mock.TestingT
	Cleanup(func())
}) *MockFetcher

NewMockFetcher creates a new instance of MockFetcher. 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 (*MockFetcher) EXPECT

func (_m *MockFetcher) EXPECT() *MockFetcher_Expecter

func (*MockFetcher) Fetch

func (_m *MockFetcher) Fetch(_a0 context.Context, _a1 cycle.Metadata) error

Fetch provides a mock function with given fields: _a0, _a1

func (*MockFetcher) Stop

func (_m *MockFetcher) Stop()

Stop provides a mock function with given fields:

type MockFetcher_Expecter

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

func (*MockFetcher_Expecter) Fetch

func (_e *MockFetcher_Expecter) Fetch(_a0 interface{}, _a1 interface{}) *MockFetcher_Fetch_Call

Fetch is a helper method to define mock.On call

  • _a0 context.Context
  • _a1 cycle.Metadata

func (*MockFetcher_Expecter) Stop

Stop is a helper method to define mock.On call

type MockFetcher_Fetch_Call

type MockFetcher_Fetch_Call struct {
	*mock.Call
}

MockFetcher_Fetch_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Fetch'

func (*MockFetcher_Fetch_Call) Return

func (*MockFetcher_Fetch_Call) Run

func (*MockFetcher_Fetch_Call) RunAndReturn

type MockFetcher_Stop_Call

type MockFetcher_Stop_Call struct {
	*mock.Call
}

MockFetcher_Stop_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Stop'

func (*MockFetcher_Stop_Call) Return

func (*MockFetcher_Stop_Call) Run

func (_c *MockFetcher_Stop_Call) Run(run func()) *MockFetcher_Stop_Call

func (*MockFetcher_Stop_Call) RunAndReturn

func (_c *MockFetcher_Stop_Call) RunAndReturn(run func()) *MockFetcher_Stop_Call

type MockResource

type MockResource struct {
	mock.Mock
}

MockResource is an autogenerated mock type for the Resource type

func NewMockResource

func NewMockResource(t interface {
	mock.TestingT
	Cleanup(func())
}) *MockResource

NewMockResource creates a new instance of MockResource. 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 (*MockResource) EXPECT

func (_m *MockResource) EXPECT() *MockResource_Expecter

func (*MockResource) GetData

func (_m *MockResource) GetData() interface{}

GetData provides a mock function with given fields:

func (*MockResource) GetElasticCommonData

func (_m *MockResource) GetElasticCommonData() (map[string]interface{}, error)

GetElasticCommonData provides a mock function with given fields:

func (*MockResource) GetIds

func (_m *MockResource) GetIds() []string

GetIds provides a mock function with given fields:

func (*MockResource) GetMetadata

func (_m *MockResource) GetMetadata() (ResourceMetadata, error)

GetMetadata provides a mock function with given fields:

type MockResource_Expecter

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

func (*MockResource_Expecter) GetData

GetData is a helper method to define mock.On call

func (*MockResource_Expecter) GetElasticCommonData

GetElasticCommonData is a helper method to define mock.On call

func (*MockResource_Expecter) GetIds

GetIds is a helper method to define mock.On call

func (*MockResource_Expecter) GetMetadata

GetMetadata is a helper method to define mock.On call

type MockResource_GetData_Call

type MockResource_GetData_Call struct {
	*mock.Call
}

MockResource_GetData_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'GetData'

func (*MockResource_GetData_Call) Return

func (_c *MockResource_GetData_Call) Return(_a0 interface{}) *MockResource_GetData_Call

func (*MockResource_GetData_Call) Run

func (*MockResource_GetData_Call) RunAndReturn

func (_c *MockResource_GetData_Call) RunAndReturn(run func() interface{}) *MockResource_GetData_Call

type MockResource_GetElasticCommonData_Call

type MockResource_GetElasticCommonData_Call struct {
	*mock.Call
}

MockResource_GetElasticCommonData_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'GetElasticCommonData'

func (*MockResource_GetElasticCommonData_Call) Return

func (*MockResource_GetElasticCommonData_Call) Run

func (*MockResource_GetElasticCommonData_Call) RunAndReturn

func (_c *MockResource_GetElasticCommonData_Call) RunAndReturn(run func() (map[string]interface{}, error)) *MockResource_GetElasticCommonData_Call

type MockResource_GetIds_Call

type MockResource_GetIds_Call struct {
	*mock.Call
}

MockResource_GetIds_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'GetIds'

func (*MockResource_GetIds_Call) Return

func (*MockResource_GetIds_Call) Run

func (*MockResource_GetIds_Call) RunAndReturn

func (_c *MockResource_GetIds_Call) RunAndReturn(run func() []string) *MockResource_GetIds_Call

type MockResource_GetMetadata_Call

type MockResource_GetMetadata_Call struct {
	*mock.Call
}

MockResource_GetMetadata_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'GetMetadata'

func (*MockResource_GetMetadata_Call) Return

func (*MockResource_GetMetadata_Call) Run

func (*MockResource_GetMetadata_Call) RunAndReturn

type Resource

type Resource interface {
	GetMetadata() (ResourceMetadata, error)
	GetData() any
	GetElasticCommonData() (map[string]any, error)
	GetIds() []string
}

type ResourceFields

type ResourceFields struct {
	ResourceMetadata
	Raw any `json:"raw"`
}

type ResourceInfo

type ResourceInfo struct {
	Resource
	CycleMetadata cycle.Metadata
}

type ResourceMap

type ResourceMap map[string][]Resource

type ResourceMetadata

type ResourceMetadata struct {
	ID      string `json:"id"`
	Type    string `json:"type"`
	SubType string `json:"sub_type,omitempty"`
	Name    string `json:"name,omitempty"`
	Region  string `json:"region,omitempty"`

	CloudAccountMetadata
}

type Result

type Result struct {
	Type     string `json:"type"`
	SubType  string `json:"subType"`
	Resource any    `json:"resource"`
}

Directories

Path Synopsis
fetchers
aws
gcp
k8s

Jump to

Keyboard shortcuts

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