clients

package
v0.0.0-...-60cae77 Latest Latest
Warning

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

Go to latest
Published: Aug 4, 2020 License: Apache-2.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Client

type Client interface {
	Auth(ctx context.Context, opts ...option.ClientOption) error
	GetResources(projectID string, config *reaperconfig.ResourceConfig) ([]*resources.Resource, error)
	DeleteResource(projectID string, resource *resources.Resource) error
}

A Client represents the interface between the Reaper and GCP. Each resource supported by the reaper will have its own client that implements the following interface:

  • Auth authenticates the client. Passing options changes how authentication occurs. See https://pkg.go.dev/google.golang.org/api/option?tab=doc for more details.
  • GetResources returns a list of Resources that are match the ResourceConfig.
  • DeleteResource deletes the specified resource.

func NewClient

func NewClient(resourceType reaperconfig.ResourceType) (Client, error)

NewClient is the factory method that returns the correct implementation of the GCP client based on the resource type.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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