gcp

package
v0.12.0 Latest Latest
Warning

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

Go to latest
Published: Sep 25, 2024 License: MIT Imports: 13 Imported by: 0

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