destination

package
v1.0.6 Latest Latest
Warning

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

Go to latest
Published: Oct 27, 2026 License: MIT Imports: 10 Imported by: 1 module, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Overview

Package destination enforces outbound destination grants at dial time.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ParseURL

func ParseURL(raw string) (*url.URL, error)

ParseURL parses a string at an input boundary and validates the destination.

func Public

func Public(ip netip.Addr) bool

func ValidateURL

func ValidateURL(u *url.URL) error

ValidateURL checks a required URL, including nil and empty values. Address policy, where used, is applied at every connection after DNS resolution.

Types

type Policy

type Policy struct {
	Purpose string
	Grants  map[netip.AddrPort]struct{} // Port zero permits any port.
	Lookup  func(context.Context, string) ([]net.IPAddr, error)
	// contains filtered or unexported fields
}

Policy grants purpose-specific IP destinations and CIDR subnets. Keep separate instances for runners, webhooks and discovery.

func New

func New(purpose string, grants []string) (Policy, error)

New accepts literal IP addresses, IP:port grants, or CIDR subnets. A bare IP or subnet permits any port.

func (Policy) Client

func (p Policy) Client() *http.Client

func (Policy) DialContext

func (p Policy) DialContext(ctx context.Context, network, address string) (net.Conn, error)

func (Policy) Transport

func (p Policy) Transport(headerTimeout time.Duration) *http.Transport

Jump to

Keyboard shortcuts

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