cloudarmor

package
v0.2.0 Latest Latest
Warning

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

Go to latest
Published: Dec 28, 2020 License: MIT Imports: 9 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 struct {
	// contains filtered or unexported fields
}

func NewClient

func NewClient(config *models.CloudArmorConfig) (*Client, error)

NewClient creates a new GCP client

func (*Client) CreateRule

func (c *Client) CreateRule(rule *models.FirewallRule) error

func (*Client) DeleteRule

func (c *Client) DeleteRule(rule *models.FirewallRule) error

func (*Client) GetProviderName

func (c *Client) GetProviderName() string

func (*Client) GetRules

func (c *Client) GetRules(ruleNamePrefix string) ([]*models.FirewallRule, error)

func (*Client) MaxRules

func (c *Client) MaxRules() int

func (*Client) MaxSourcesPerRule

func (c *Client) MaxSourcesPerRule() int

func (*Client) PatchRule

func (c *Client) PatchRule(rule *models.FirewallRule) error

func (*Client) Priority

func (c *Client) Priority() int64

type GoogleComputeService

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

func NewGoogleComputeService

func NewGoogleComputeService(endpoint string) *GoogleComputeService

NewGoogleComputeService creates the compute service. The default endpoint can be overriden for testing purpose (to make calls to a mock server instead of the real Google servers).

func (*GoogleComputeService) AddRule

func (s *GoogleComputeService) AddRule(project string, policyName string, rule *compute.SecurityPolicyRule) (*compute.Operation, error)

func (*GoogleComputeService) GetFirewallPolicy

func (s *GoogleComputeService) GetFirewallPolicy(project string, policyName string) (*compute.SecurityPolicy, error)

func (*GoogleComputeService) PatchRule

func (s *GoogleComputeService) PatchRule(project string, policyName string, rule *compute.SecurityPolicyRule, rulePriority int64) (*compute.Operation, error)

func (*GoogleComputeService) RemoveRule

func (s *GoogleComputeService) RemoveRule(project string, policyName string, rulePriority int64) (*compute.Operation, error)

func (*GoogleComputeService) WaitOperation

func (s *GoogleComputeService) WaitOperation(project string, operation string) error

type GoogleComputeServiceIface

type GoogleComputeServiceIface interface {
	GetFirewallPolicy(project string, policyName string) (*compute.SecurityPolicy, error)
	AddRule(project string, policyName string, rule *compute.SecurityPolicyRule) (*compute.Operation, error)
	RemoveRule(project string, policyName string, rulePriority int64) (*compute.Operation, error)
	PatchRule(project string, policyName string, rule *compute.SecurityPolicyRule, rulePriority int64) (*compute.Operation, error)
	WaitOperation(project string, operation string) error
}

Jump to

Keyboard shortcuts

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