Documentation
¶
Index ¶
- Variables
- func BackendServiceFQN(project, region, name string) string
- func FirewallNeedsUpdate(fw *computepb.Firewall, expectedPorts map[int32]struct{}) bool
- func ForwardingRuleFQN(project, region, name string) string
- func NEGFQN(project, region, name string) string
- func NetworkFQN(project, name string) string
- func ServiceAttachmentFQN(project, region, name string) string
- func SubnetFQN(project, region, name string) string
- type Client
- type ClientConfig
- type ClientError
- type GCPClient
- func (c *GCPClient) AttachEndpoints(ctx context.Context, neg string, mappings []*PortMapping) error
- func (c *GCPClient) CreateBackendService(ctx context.Context, name string, neg string) error
- func (c *GCPClient) CreateFirewall(ctx context.Context, name string, ports map[int32]struct{}) error
- func (c *GCPClient) CreateForwardingRule(ctx context.Context, name, backendSvc string, ip *string, globalAccess *bool) error
- func (c *GCPClient) CreatePortmapNEG(ctx context.Context, name string) error
- func (c *GCPClient) CreateServiceAttachment(ctx context.Context, name, fwdRuleFQN string, ...) error
- func (c *GCPClient) DeleteBackendService(ctx context.Context, name string) error
- func (c *GCPClient) DeleteFirewall(ctx context.Context, name string) error
- func (c *GCPClient) DeleteForwardingRule(ctx context.Context, name string) error
- func (c *GCPClient) DeletePortmapNEG(ctx context.Context, name string) error
- func (c *GCPClient) DeleteServiceAttachment(ctx context.Context, name string) error
- func (c *GCPClient) DetachEndpoints(ctx context.Context, neg string, mappings []*PortMapping) error
- func (c *GCPClient) GetBackendService(ctx context.Context, name string) (*computepb.BackendService, error)
- func (c *GCPClient) GetFirewall(ctx context.Context, name string) (*computepb.Firewall, error)
- func (c *GCPClient) GetForwardingRule(ctx context.Context, name string) (*computepb.ForwardingRule, error)
- func (c *GCPClient) GetNEG(ctx context.Context, name string) (*computepb.NetworkEndpointGroup, error)
- func (c *GCPClient) GetServiceAttachment(ctx context.Context, name string) (*computepb.ServiceAttachment, error)
- func (c *GCPClient) ListEndpoints(ctx context.Context, neg string) ([]*PortMapping, error)
- func (c *GCPClient) Project() string
- func (c *GCPClient) Region() string
- func (c *GCPClient) UpdateFirewall(ctx context.Context, name string, ports map[int32]struct{}) error
- type PortMapping
Constants ¶
This section is empty.
Variables ¶
View Source
var ErrNotFound = &ClientError{msg: "not found", status: http.StatusNotFound}
Functions ¶
func BackendServiceFQN ¶
func FirewallNeedsUpdate ¶
func ForwardingRuleFQN ¶
func NetworkFQN ¶
func ServiceAttachmentFQN ¶
Types ¶
type Client ¶
type Client interface {
// Accessors
Project() string
Region() string
// NEGs API
GetNEG(ctx context.Context, name string) (*computepb.NetworkEndpointGroup, error)
CreatePortmapNEG(ctx context.Context, name string) error
DeletePortmapNEG(ctx context.Context, name string) error
ListEndpoints(ctx context.Context, neg string) ([]*PortMapping, error)
AttachEndpoints(ctx context.Context, neg string, mappings []*PortMapping) error
DetachEndpoints(ctx context.Context, neg string, mappings []*PortMapping) error
// Firewalls API
GetFirewall(ctx context.Context, name string) (*computepb.Firewall, error)
CreateFirewall(ctx context.Context, name string, ports map[int32]struct{}) error
UpdateFirewall(ctx context.Context, name string, ports map[int32]struct{}) error
DeleteFirewall(ctx context.Context, name string) error
// Backend Services API
GetBackendService(ctx context.Context, name string) (*computepb.BackendService, error)
CreateBackendService(ctx context.Context, name string, neg string) error
DeleteBackendService(ctx context.Context, name string) error
// Forwarding Rules API
GetForwardingRule(ctx context.Context, name string) (*computepb.ForwardingRule, error)
CreateForwardingRule(ctx context.Context, name, backendSvc string, ip *string, globalAccess *bool) error
DeleteForwardingRule(ctx context.Context, name string) error
// Service Attachments API
GetServiceAttachment(ctx context.Context, name string) (*computepb.ServiceAttachment, error)
CreateServiceAttachment(ctx context.Context, name, fwdRuleFQN string, consumers []*computepb.ServiceAttachmentConsumerProjectLimit, natSubnetFQNs []string) error
DeleteServiceAttachment(ctx context.Context, name string) error
}
type ClientConfig ¶
type ClientError ¶
type ClientError struct {
// contains filtered or unexported fields
}
func (*ClientError) Error ¶
func (e *ClientError) Error() string
type GCPClient ¶
type GCPClient struct {
// contains filtered or unexported fields
}
func NewClient ¶
func NewClient(ctx context.Context, cfg ClientConfig, opts ...option.ClientOption) (*GCPClient, error)
func (*GCPClient) AttachEndpoints ¶
func (*GCPClient) CreateBackendService ¶
func (*GCPClient) CreateFirewall ¶
func (*GCPClient) CreateForwardingRule ¶
func (*GCPClient) CreatePortmapNEG ¶
func (*GCPClient) CreateServiceAttachment ¶
func (*GCPClient) DeleteBackendService ¶
func (*GCPClient) DeleteFirewall ¶
func (*GCPClient) DeleteForwardingRule ¶
func (*GCPClient) DeletePortmapNEG ¶
func (*GCPClient) DeleteServiceAttachment ¶
func (*GCPClient) DetachEndpoints ¶
func (*GCPClient) GetBackendService ¶
func (*GCPClient) GetFirewall ¶
func (*GCPClient) GetForwardingRule ¶
func (*GCPClient) GetServiceAttachment ¶
func (*GCPClient) ListEndpoints ¶
type PortMapping ¶
Click to show internal directories.
Click to hide internal directories.