driver

package
v1.3.0 Latest Latest
Warning

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

Go to latest
Published: Mar 26, 2026 License: MIT Imports: 1 Imported by: 0

Documentation

Overview

Package driver defines the interface for load balancer service implementations.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type LBConfig

type LBConfig struct {
	Name    string
	Type    string // "application", "network"
	Scheme  string // "internet-facing", "internal"
	Subnets []string
	Tags    map[string]string
}

LBConfig describes a load balancer to create.

type LBInfo

type LBInfo struct {
	ID      string
	ARN     string
	Name    string
	Type    string
	Scheme  string
	State   string
	DNSName string
	Subnets []string
	Tags    map[string]string
}

LBInfo describes a load balancer.

type ListenerConfig

type ListenerConfig struct {
	LBARN          string
	Protocol       string
	Port           int
	TargetGroupARN string
}

ListenerConfig describes a listener to create.

type ListenerInfo

type ListenerInfo struct {
	ARN            string
	LBARN          string
	Protocol       string
	Port           int
	TargetGroupARN string
}

ListenerInfo describes a listener.

type LoadBalancer

type LoadBalancer interface {
	CreateLoadBalancer(ctx context.Context, config LBConfig) (*LBInfo, error)
	DeleteLoadBalancer(ctx context.Context, arn string) error
	DescribeLoadBalancers(ctx context.Context, arns []string) ([]LBInfo, error)

	CreateTargetGroup(ctx context.Context, config TargetGroupConfig) (*TargetGroupInfo, error)
	DeleteTargetGroup(ctx context.Context, arn string) error
	DescribeTargetGroups(ctx context.Context, arns []string) ([]TargetGroupInfo, error)

	CreateListener(ctx context.Context, config ListenerConfig) (*ListenerInfo, error)
	DeleteListener(ctx context.Context, arn string) error
	DescribeListeners(ctx context.Context, lbARN string) ([]ListenerInfo, error)

	RegisterTargets(ctx context.Context, targetGroupARN string, targets []Target) error
	DeregisterTargets(ctx context.Context, targetGroupARN string, targets []Target) error
	DescribeTargetHealth(ctx context.Context, targetGroupARN string) ([]TargetHealth, error)
	SetTargetHealth(ctx context.Context, targetGroupARN string, targetID string, state string) error
}

LoadBalancer is the interface that load balancer provider implementations must satisfy.

type Target

type Target struct {
	ID   string
	Port int
}

Target identifies a target (e.g., instance) in a target group.

type TargetGroupConfig

type TargetGroupConfig struct {
	Name       string
	Protocol   string
	Port       int
	VPCID      string
	HealthPath string
	Tags       map[string]string
}

TargetGroupConfig describes a target group to create.

type TargetGroupInfo

type TargetGroupInfo struct {
	ID         string
	ARN        string
	Name       string
	Protocol   string
	Port       int
	VPCID      string
	HealthPath string
	Tags       map[string]string
}

TargetGroupInfo describes a target group.

type TargetHealth

type TargetHealth struct {
	Target Target
	State  string // "healthy", "unhealthy", "draining", "initial"
	Reason string
}

TargetHealth describes the health status of a target.

Jump to

Keyboard shortcuts

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