Documentation ¶
Index ¶
- type Client
- func (c *Client) CreateRule(rule *models.FirewallRule) error
- func (c *Client) DeleteRule(rule *models.FirewallRule) error
- func (c *Client) GetProviderName() string
- func (c *Client) GetRules(ruleNamePrefix string) ([]*models.FirewallRule, error)
- func (c *Client) MaxRules() int
- func (c *Client) MaxSourcesPerRule() int
- func (c *Client) PatchRule(rule *models.FirewallRule) error
- func (c *Client) Priority() int64
- type GoogleComputeService
- func (s *GoogleComputeService) AddRule(project string, policyName string, rule *compute.SecurityPolicyRule) (*compute.Operation, error)
- func (s *GoogleComputeService) GetFirewallPolicy(project string, policyName string) (*compute.SecurityPolicy, error)
- func (s *GoogleComputeService) PatchRule(project string, policyName string, rule *compute.SecurityPolicyRule, ...) (*compute.Operation, error)
- func (s *GoogleComputeService) RemoveRule(project string, policyName string, rulePriority int64) (*compute.Operation, error)
- func (s *GoogleComputeService) WaitOperation(project string, operation string) error
- type GoogleComputeServiceIface
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 (*Client) GetRules ¶
func (c *Client) GetRules(ruleNamePrefix string) ([]*models.FirewallRule, error)
func (*Client) MaxSourcesPerRule ¶
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 }
Click to show internal directories.
Click to hide internal directories.