gcplb

package
v1.6.2 Latest Latest
Warning

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

Go to latest
Published: May 14, 2026 License: MIT Imports: 8 Imported by: 0

Documentation

Overview

Package gcplb provides an in-memory mock implementation of GCP Cloud Load Balancing.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Mock

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

Mock is an in-memory mock implementation of the GCP Cloud Load Balancing service.

func New

func New(opts *config.Options) *Mock

New creates a new Cloud Load Balancing mock with the given configuration options.

func (*Mock) CreateListener

func (m *Mock) CreateListener(_ context.Context, cfg driver.ListenerConfig) (*driver.ListenerInfo, error)

CreateListener creates a new URL map / listener on a load balancer.

func (*Mock) CreateLoadBalancer

func (m *Mock) CreateLoadBalancer(_ context.Context, cfg driver.LBConfig) (*driver.LBInfo, error)

CreateLoadBalancer creates a new forwarding rule (load balancer).

func (*Mock) CreateRule added in v1.3.1

func (m *Mock) CreateRule(_ context.Context, cfg driver.RuleConfig) (*driver.RuleInfo, error)

CreateRule creates a new URL map path rule for a listener.

func (*Mock) CreateTargetGroup

func (m *Mock) CreateTargetGroup(_ context.Context, cfg driver.TargetGroupConfig) (*driver.TargetGroupInfo, error)

CreateTargetGroup creates a new backend service (target group).

func (*Mock) DeleteListener

func (m *Mock) DeleteListener(_ context.Context, arn string) error

DeleteListener deletes a URL map / listener by resource name (ARN).

func (*Mock) DeleteLoadBalancer

func (m *Mock) DeleteLoadBalancer(_ context.Context, arn string) error

DeleteLoadBalancer deletes a forwarding rule (load balancer) by resource name (ARN).

func (*Mock) DeleteRule added in v1.3.1

func (m *Mock) DeleteRule(_ context.Context, ruleARN string) error

DeleteRule deletes a URL map path rule by resource name (ARN).

func (*Mock) DeleteTargetGroup

func (m *Mock) DeleteTargetGroup(_ context.Context, arn string) error

DeleteTargetGroup deletes a backend service (target group) by resource name (ARN).

func (*Mock) DeregisterTargets

func (m *Mock) DeregisterTargets(_ context.Context, targetGroupARN string, targets []driver.Target) error

DeregisterTargets removes instances from a backend service (target group).

func (*Mock) DescribeListeners

func (m *Mock) DescribeListeners(_ context.Context, lbARN string) ([]driver.ListenerInfo, error)

DescribeListeners returns all listeners (URL maps) for the specified load balancer.

func (*Mock) DescribeLoadBalancers

func (m *Mock) DescribeLoadBalancers(_ context.Context, arns []string) ([]driver.LBInfo, error)

DescribeLoadBalancers returns load balancers matching the given resource names (ARNs). If arns is empty, all load balancers are returned.

func (*Mock) DescribeRules added in v1.3.1

func (m *Mock) DescribeRules(_ context.Context, listenerARN string) ([]driver.RuleInfo, error)

DescribeRules returns all path rules for the specified listener.

func (*Mock) DescribeTargetGroups

func (m *Mock) DescribeTargetGroups(_ context.Context, arns []string) ([]driver.TargetGroupInfo, error)

DescribeTargetGroups returns backend services (target groups) matching the given resource names. If arns is empty, all backend services are returned.

func (*Mock) DescribeTargetHealth

func (m *Mock) DescribeTargetHealth(_ context.Context, targetGroupARN string) ([]driver.TargetHealth, error)

DescribeTargetHealth returns the health status of all instances in a backend service.

func (*Mock) GetLBAttributes added in v1.3.1

func (m *Mock) GetLBAttributes(_ context.Context, lbARN string) (*driver.LBAttributes, error)

GetLBAttributes returns the attributes for a load balancer.

func (*Mock) ModifyListener added in v1.3.1

func (m *Mock) ModifyListener(_ context.Context, input driver.ModifyListenerInput) error

ModifyListener modifies an existing URL map listener's port, protocol, or default actions.

func (*Mock) PutLBAttributes added in v1.3.1

func (m *Mock) PutLBAttributes(_ context.Context, lbARN string, attrs driver.LBAttributes) error

PutLBAttributes sets the attributes for a load balancer.

func (*Mock) RegisterTargets

func (m *Mock) RegisterTargets(_ context.Context, targetGroupARN string, targets []driver.Target) error

RegisterTargets adds instances to a backend service (target group).

func (*Mock) SetTargetHealth

func (m *Mock) SetTargetHealth(_ context.Context, targetGroupARN, targetID, state string) error

SetTargetHealth sets the health state of a specific instance in a backend service.

Jump to

Keyboard shortcuts

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