driver

package
v1.3.2 Latest Latest
Warning

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

Go to latest
Published: Apr 5, 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 LBAttributes added in v1.3.1

type LBAttributes struct {
	IdleTimeout        int
	DeletionProtection bool
	AccessLogsEnabled  bool
	AccessLogsBucket   string
}

LBAttributes describes configurable attributes of a load balancer.

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)

	CreateRule(ctx context.Context, config RuleConfig) (*RuleInfo, error)
	DeleteRule(ctx context.Context, ruleARN string) error
	DescribeRules(ctx context.Context, listenerARN string) ([]RuleInfo, error)

	ModifyListener(ctx context.Context, input ModifyListenerInput) error

	GetLBAttributes(ctx context.Context, lbARN string) (*LBAttributes, error)
	PutLBAttributes(ctx context.Context, lbARN string, attrs LBAttributes) 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 ModifyListenerInput added in v1.3.1

type ModifyListenerInput struct {
	ListenerARN    string
	Port           int
	Protocol       string
	DefaultActions []RuleAction
}

ModifyListenerInput describes modifications to apply to a listener.

type RuleAction added in v1.3.1

type RuleAction struct {
	Type           string // "forward"
	TargetGroupARN string
}

RuleAction describes an action for a listener rule (e.g., forward to a target group).

type RuleCondition added in v1.3.1

type RuleCondition struct {
	Field  string // "path-pattern" or "host-header"
	Values []string
}

RuleCondition describes a condition for a listener rule (e.g., path-pattern or host-header).

type RuleConfig added in v1.3.1

type RuleConfig struct {
	ListenerARN string
	Priority    int
	Conditions  []RuleCondition
	Actions     []RuleAction
}

RuleConfig describes a listener rule to create.

type RuleInfo added in v1.3.1

type RuleInfo struct {
	ARN         string
	ListenerARN string
	Priority    int
	Conditions  []RuleCondition
	Actions     []RuleAction
	IsDefault   bool
}

RuleInfo describes a listener rule.

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