firewallcleaner

package
v0.0.0-...-a4b4531 Latest Latest
Warning

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

Go to latest
Published: May 18, 2021 License: Apache-2.0 Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Cleaner

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

Cleaner Element holding the firewall cleaning logic

func NewCleaner

func NewCleaner(computeAPI ComputeAPI) *Cleaner

NewCleaner Returns a new cleaner object

func (*Cleaner) Run

func (c *Cleaner) Run(dryRun bool, project string) error

Run the main find&destroy function

type ComputeAPI

type ComputeAPI interface {
	LookupFirewallRule(project string) ([]*compute.Firewall, error)
	LookupInstances(project string) ([]*compute.Instance, error)
	LookupNodePools(clusters []*container.Cluster) ([]*container.NodePool, error)
	LookupClusters(project string) ([]*container.Cluster, error)
	DeleteFirewallRule(project, firewall string)
}

ComputeAPI interface logic for Google cloud API

type ComputeServiceWrapper

type ComputeServiceWrapper struct {
	Context   context.Context
	Compute   *compute.Service
	Container *container.Service
}

ComputeServiceWrapper A wrapper for compute API service connections.

func (*ComputeServiceWrapper) DeleteFirewallRule

func (csw *ComputeServiceWrapper) DeleteFirewallRule(project, firewall string)

DeleteFirewallRule Delete firewall rule base on name in specifiec project

func (*ComputeServiceWrapper) LookupClusters

func (csw *ComputeServiceWrapper) LookupClusters(project string) ([]*container.Cluster, error)

LookupClusters ???

func (*ComputeServiceWrapper) LookupFirewallRule

func (csw *ComputeServiceWrapper) LookupFirewallRule(project string) ([]*compute.Firewall, error)

LookupFirewallRule List of all available firewall rules for a project

func (*ComputeServiceWrapper) LookupInstances

func (csw *ComputeServiceWrapper) LookupInstances(project string) ([]*compute.Instance, error)

LookupInstances ???

func (*ComputeServiceWrapper) LookupNodePools

func (csw *ComputeServiceWrapper) LookupNodePools(clusters []*container.Cluster) ([]*container.NodePool, error)

LookupNodePools ???

type Options

type Options struct {
	Version string
	Body    string
}

Options represents the query options to delete firewall rules

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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