loadbalancer

package
v1.16.6 Latest Latest
Warning

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

Go to latest
Published: May 11, 2026 License: Apache-2.0 Imports: 29 Imported by: 0

README

Load Balancer

Purpose

pkg/handler/loadbalancer handles v2 load balancers.

This package is mostly about three things:

  • linkage to a parent network
  • quota/allocation coordination
  • stronger semantic validation than many other handlers

So although it follows the common v2 model, it is one of the more domain-specific resource handlers.

Distinctive Behaviour

  • load balancers are network-linked and inherit region/project context from the selected network
  • create and update both use sagas so allocation changes and resource mutation can be compensated on failure
  • listener, pool, and member shapes are validated aggressively:
    • DNS-label listener names
    • protocol restrictions
    • port ranges
    • member uniqueness
    • health-check constraints
  • requested VIP validation is tied to the selected network's prefix

Invariants And Guard Rails

  • LoadBalancer v2 resources are labeled with ResourceAPIVersionLabel=2, and direct object access is gated accordingly.
  • A load balancer must belong to an authorized network in the same project.
  • Quota allocation and resource mutation should move together as far as the saga model can make them move together.
  • Deletion is straightforward ownership/lifecycle teardown and does not use the extra reference model that some other resources do.

Caveats

  • This package carries more domain validation than many sibling handlers.
  • The saga pattern improves consistency, but create/update still remain best-effort multi-step workflows rather than true transactions.

Cross-Package Context

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Client

type Client struct {
	handlercommon.ClientArgs
}

func New

func New(clientArgs handlercommon.ClientArgs) *Client

func (*Client) CreateV2

func (*Client) DeleteV2

func (c *Client) DeleteV2(ctx context.Context, loadBalancerID string) error

func (*Client) GetV2

func (c *Client) GetV2(ctx context.Context, loadBalancerID string) (*openapi.LoadBalancerV2Read, error)

func (*Client) GetV2Raw

func (c *Client) GetV2Raw(ctx context.Context, loadBalancerID string) (*regionv1.LoadBalancer, error)

func (*Client) UpdateV2

func (c *Client) UpdateV2(ctx context.Context, loadBalancerID string, request *openapi.LoadBalancerV2Update) (*openapi.LoadBalancerV2Read, error)

Jump to

Keyboard shortcuts

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