gcp

package
v0.1.5 Latest Latest
Warning

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

Go to latest
Published: Feb 22, 2026 License: MIT Imports: 14 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type GCPConfig

type GCPConfig struct {
	ProjectID       string `json:"project_id" yaml:"project_id"`
	CredentialsJSON string `json:"credentials_json" yaml:"credentials_json"`
	Region          string `json:"region" yaml:"region"`
}

GCPConfig holds configuration for the GCP cloud provider.

type GCPProvider

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

GCPProvider implements CloudProvider for Google Cloud Platform.

func NewGCPProvider

func NewGCPProvider(config GCPConfig) *GCPProvider

NewGCPProvider creates a new GCPProvider with the given configuration.

func NewGCPProviderWithClient added in v0.1.5

func NewGCPProviderWithClient(config GCPConfig, client HTTPDoer, tokenFn func(ctx context.Context) (string, error)) *GCPProvider

NewGCPProviderWithClient creates a GCPProvider with an injectable HTTP client and token function. Nil arguments are replaced with safe defaults: a 30-second http.Client and the provider's Application Default Credentials token function.

func (*GCPProvider) Dependencies

func (p *GCPProvider) Dependencies() []plugin.PluginDependency

func (*GCPProvider) Deploy

func (*GCPProvider) Description

func (p *GCPProvider) Description() string

func (*GCPProvider) GetDeploymentStatus

func (p *GCPProvider) GetDeploymentStatus(ctx context.Context, deployID string) (*provider.DeployStatus, error)

GetDeploymentStatus queries the Cloud Run v2 API for the status of a service. deployID must be the full Cloud Run service resource name: "projects/{project}/locations/{region}/services/{service}".

func (*GCPProvider) GetMetrics

func (p *GCPProvider) GetMetrics(ctx context.Context, deployID string, window time.Duration) (*provider.Metrics, error)

GetMetrics fetches Cloud Monitoring metrics (request count and latency) for a Cloud Run service. deployID may be the full resource name ("projects/.../services/{service}") or just the service name.

func (*GCPProvider) ListImages

func (p *GCPProvider) ListImages(ctx context.Context, repo string) ([]provider.ImageTag, error)

ListImages lists container images in a Google Artifact Registry repository. The repo parameter is the repository name within the configured project and region.

func (*GCPProvider) Name

func (p *GCPProvider) Name() string

func (*GCPProvider) OnDisable

func (p *GCPProvider) OnDisable(_ plugin.PluginContext) error

func (*GCPProvider) OnEnable

func (p *GCPProvider) OnEnable(_ plugin.PluginContext) error

func (*GCPProvider) PullImage

func (p *GCPProvider) PullImage(ctx context.Context, image string, auth provider.RegistryAuth) error

PullImage validates that a container image is accessible in Google Artifact Registry. It verifies the image is reachable via the Docker Registry v2 manifest API.

func (*GCPProvider) PushImage

func (p *GCPProvider) PushImage(ctx context.Context, image string, auth provider.RegistryAuth) error

PushImage validates that a container image is present in Google Artifact Registry after pushing. The actual image data must be pushed using `docker push` or a compatible tool before calling this method. PushImage verifies the image is accessible via the Docker Registry v2 manifest API.

func (*GCPProvider) RegisterRoutes

func (p *GCPProvider) RegisterRoutes(mux *http.ServeMux)

func (*GCPProvider) Rollback

func (p *GCPProvider) Rollback(ctx context.Context, deployID string) error

Rollback directs 100% of traffic to the latest ready revision of the Cloud Run service. deployID must be the full Cloud Run service resource name.

func (*GCPProvider) TestConnection

func (p *GCPProvider) TestConnection(ctx context.Context, _ map[string]any) (*provider.ConnectionResult, error)

TestConnection verifies that the configured GCP project is accessible via the Cloud Resource Manager API.

func (*GCPProvider) UIPages

func (p *GCPProvider) UIPages() []plugin.UIPageDef

func (*GCPProvider) Version

func (p *GCPProvider) Version() string

type HTTPDoer added in v0.1.5

type HTTPDoer interface {
	Do(req *http.Request) (*http.Response, error)
}

HTTPDoer is an interface for making HTTP requests (allows testing).

Jump to

Keyboard shortcuts

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