gcp

package
v0.15.0 Latest Latest
Warning

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

Go to latest
Published: May 7, 2025 License: MIT Imports: 13 Imported by: ? modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	// Supported AssetTypes: https://cloud.google.com/asset-inventory/docs/supported-asset-types#searchable_asset_types
	SupportedAssetTypes = []string{
		"compute.googleapis.com/Instance",
	}
)

Functions

This section is empty.

Types

type Compute

type Compute struct {
	Instance  *compute.Instance   `json:"instance"`
	Firewalls []*compute.Firewall `json:"firewalls"`
	IsPublic  bool                `json:"is_public"`
}

type GcpClient

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

func (*GcpClient) DescribeInstance

func (g *GcpClient) DescribeInstance(ctx context.Context, projectID, zone, instanceName string) (*Compute, error)

func (*GcpClient) GetAsset

func (g *GcpClient) GetAsset(ctx context.Context, gcpProjectID, resourceName string) (*assetpb.ResourceSearchResult, error)

func (*GcpClient) VerifyCode

func (g *GcpClient) VerifyCode(ctx context.Context, gcpProjectID, verificationCode string) (bool, error)

type GcpServiceClient

type GcpServiceClient interface {
	VerifyCode(ctx context.Context, gcpProjectID, verificationCode string) (bool, error)
	GetAsset(ctx context.Context, gcpProjectID, resourceName string) (*assetpb.ResourceSearchResult, error)
	DescribeInstance(ctx context.Context, projectID, zone, instanceName string) (*Compute, error)
}

func NewGcpClient

func NewGcpClient(ctx context.Context, credentialPath string, l logging.Logger) (GcpServiceClient, error)

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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